Jelajahi Sumber

org-attach: variable name change

* lisp/org-attach.el (org-attach-attach): Change variable name only
  for the point of better semantics
Gustav Wikström 5 tahun lalu
induk
melakukan
f0ce4a6357
1 mengubah file dengan 8 tambahan dan 8 penghapusan
  1. 8 8
      lisp/org-attach.el

+ 8 - 8
lisp/org-attach.el

@@ -490,18 +490,18 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from
   (setq method (or method org-attach-method))
   (let ((basename (file-name-nondirectory file)))
     (let* ((attach-dir (org-attach-dir 'get-create))
-           (fname (expand-file-name basename attach-dir)))
+           (attach-file (expand-file-name basename attach-dir)))
       (cond
-       ((eq method 'mv) (rename-file file fname))
-       ((eq method 'cp) (copy-file file fname))
-       ((eq method 'ln) (add-name-to-file file fname))
-       ((eq method 'lns) (make-symbolic-link file fname))
-       ((eq method 'url) (url-copy-file file fname)))
+       ((eq method 'mv) (rename-file file attach-file))
+       ((eq method 'cp) (copy-file file attach-file))
+       ((eq method 'ln) (add-name-to-file file attach-file))
+       ((eq method 'lns) (make-symbolic-link file attach-file))
+       ((eq method 'url) (url-copy-file file attach-file)))
       (run-hook-with-args 'org-attach-after-change-hook attach-dir)
       (org-attach-tag)
       (cond ((eq org-attach-store-link-p 'attached)
-	     (push (list (concat "attachment:" (file-name-nondirectory fname))
-			 (file-name-nondirectory fname))
+	     (push (list (concat "attachment:" (file-name-nondirectory attach-file))
+			 (file-name-nondirectory attach-file))
 		   org-stored-links))
             ((eq org-attach-store-link-p t)
              (push (list (concat "file:" file)