Просмотр исходного кода

Use macro `org-with-gensyms' in `org-agenda-with-point-at-orig-entry'

* org-agenda.el (org-agenda-with-point-at-orig-entry): Use macro
`org-with-gensyms'.
David Maus 14 лет назад
Родитель
Сommit
b471e56a3e
1 измененных файлов с 7 добавлено и 6 удалено
  1. 7 6
      lisp/org-agenda.el

+ 7 - 6
lisp/org-agenda.el

@@ -1714,12 +1714,13 @@ Note that functions in this alist don't need to be quoted."
 If STRING is non-nil, the text property will be fetched from position 0
 If STRING is non-nil, the text property will be fetched from position 0
 in that string.  If STRING is nil, it will be fetched from the beginning
 in that string.  If STRING is nil, it will be fetched from the beginning
 of the current line."
 of the current line."
-  `(let ((marker (get-text-property (if string 0 (point-at-bol))
-				    'org-hd-marker string)))
-     (with-current-buffer (marker-buffer marker)
-       (save-excursion
-	 (goto-char marker)
-	 ,@body))))
+  (org-with-gensyms (marker)
+    `(let ((,marker (get-text-property (if string 0 (point-at-bol))
+				       'org-hd-marker string)))
+       (with-current-buffer (marker-buffer ,marker)
+	 (save-excursion
+	   (goto-char ,marker)
+	   ,@body)))))
 
 
 (defun org-add-agenda-custom-command (entry)
 (defun org-add-agenda-custom-command (entry)
   "Replace or add a command in `org-agenda-custom-commands'.
   "Replace or add a command in `org-agenda-custom-commands'.