]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/bookmark.el (bookmark-show-annotation): Use `when' instead of `if'.
authorKarl Fogel <kfogel@red-bean.com>
Tue, 13 Jul 2010 22:17:51 +0000 (18:17 -0400)
committerKarl Fogel <kfogel@red-bean.com>
Tue, 13 Jul 2010 22:17:51 +0000 (18:17 -0400)
  This is also from Thierry Volpiatto's patch in bug #6444.  However,
  because it was extraneous to the functional change in that patch,
  and causes a re-indendation, I am committing it separately.

lisp/ChangeLog
lisp/bookmark.el

index f7bf7832488b9dd148d35f32bbd2ee586d858c55..ab1d043e3f23e2aa85f3c26bac98097179cac6e0 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-13  Karl Fogel  <kfogel@red-bean.com>
+
+       * bookmark.el (bookmark-show-annotation): Use `when' instead of `if'.
+       This is also from Thierry Volpiatto's patch in bug #6444.  However,
+       because it was extraneous to the functional change in that patch,
+       and causes a re-indendation, I am committing it separately.
+
 2010-07-13  Karl Fogel  <kfogel@red-bean.com>
 
        * bookmark.el (bookmark-show-annotation): Ensure annotations show,
index b0d06f4e5554bd867c41e83387e5be942afe82ad..7c8ac45bb04698ad6e172abc59e7e5a0c0f21217 100644 (file)
@@ -1733,15 +1733,15 @@ last full line, move to the last full line.  The return value is undefined."
   "Display the annotation for bookmark named BOOKMARK in a buffer,
 if an annotation exists."
   (let ((annotation (bookmark-get-annotation bookmark)))
-    (if (and annotation (not (string-equal annotation "")))
-        (save-excursion
-          (let ((old-buf (current-buffer)))
-            (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
-            (delete-region (point-min) (point-max))
-            ;; (insert (concat "Annotation for bookmark '" bookmark "':\n\n"))
-            (insert annotation)
-            (goto-char (point-min))
-            (switch-to-buffer-other-window old-buf))))))
+    (when (and annotation (not (string-equal annotation "")))
+      (save-excursion
+        (let ((old-buf (current-buffer)))
+          (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
+          (delete-region (point-min) (point-max))
+          ;; (insert (concat "Annotation for bookmark '" bookmark "':\n\n"))
+          (insert annotation)
+          (goto-char (point-min))
+          (switch-to-buffer-other-window old-buf))))))
 
 
 (defun bookmark-show-all-annotations ()