Pārlūkot izejas kodu

org-git-link.el: Avoid cl.el aliases

* contrib/lisp/org-git-link.el (org-gitbare-open):
(org-git-open):
(org-git-find-gitdir):
(org-git-create-git-link): Prefer nth function to cl.el's first,
second, third.

org-git-link.el does not explicitly load cl.el, and variants without
the "cl-" prefix have been out of favor since Emacs 24.3.
Kyle Meyer 7 gadi atpakaļ
vecāks
revīzija
b9c5720618
1 mainītis faili ar 11 papildinājumiem un 11 dzēšanām
  1. 11 11
      contrib/lisp/org-git-link.el

+ 11 - 11
contrib/lisp/org-git-link.el

@@ -73,8 +73,8 @@
 
 (defun org-gitbare-open (str)
   (let* ((strlist (org-git-split-string str))
-         (gitdir (first strlist))
-         (object (second strlist)))
+         (gitdir (nth 0 strlist))
+         (object (nth 1 strlist)))
     (org-git-open-file-internal gitdir object)))
 
 
@@ -96,12 +96,12 @@
 
 (defun org-git-open (str)
   (let* ((strlist (org-git-split-string str))
-         (filepath (first strlist))
-         (commit (second strlist))
-         (line (third strlist))
+         (filepath (nth 0 strlist))
+         (commit (nth 1 strlist))
+         (line (nth 2 strlist))
          (dirlist (org-git-find-gitdir (file-truename filepath)))
-         (gitdir (first dirlist))
-         (relpath (second dirlist)))
+         (gitdir (nth 0 dirlist))
+         (relpath (nth 1 dirlist)))
     (org-git-open-file-internal gitdir (concat commit ":" relpath))
     (when line (goto-line (string-to-int line)))))
 
@@ -127,10 +127,10 @@
     (catch 'toplevel
       (while (not (file-exists-p (expand-file-name ".git" dir)))
         (let ((dirlist (org-git-split-dirpath dir)))
-          (when (string= (second dirlist) "") ; at top level
+          (when (string= (nth 1 dirlist) "") ; at top level
             (throw 'toplevel nil))
-          (setq dir (first dirlist)
-                relpath (concat (file-name-as-directory (second dirlist)) relpath))))
+          (setq dir (nth 0 dirlist)
+                relpath (concat (file-name-as-directory (nth 1 dirlist)) relpath))))
       (list (expand-file-name ".git" dir) relpath))))
 
 
@@ -174,7 +174,7 @@ than two double colons, str2 and/or str3 may be set the empty string."
 (defun org-git-create-git-link (file &optional line)
   "Create git link part to file at specific time"
   (interactive "FFile: ")
-  (let* ((gitdir (first (org-git-find-gitdir (file-truename file))))
+  (let* ((gitdir (nth 0 (org-git-find-gitdir (file-truename file))))
          (branchname (org-git-get-current-branch gitdir))
          (timestring (format-time-string "%Y-%m-%d" (current-time))))
     (concat "git:" file "::" (org-git-create-searchstring branchname timestring)