Subject: bug#20150: 24.4: bookmarks: return from editing annotations (FIX INCLUDED)

From: Boruch Baum <[email-masked]>
Date: Fri, 20 Mar 2015 12:22:31 -0400

Pleasure.

On 03/20/2015 10:28 AM, Stefan Monnier wrote:
>> The fix restores focus to the bmenu-list window, and restores point to
>> where it had been prior to editing the annotation.
> 
> Could you send it as a patch, otherwise I can't really see what's different.
> 
> 
>         Stefan
> 

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

--- bookmark.el	2015-03-20 12:08:33.477496667 -0400
+++ bookmark-new.el	2015-03-20 12:09:49.401494206 -0400
@@ -889,13 +889,24 @@
         (bookmark-kill-line t)
       (forward-line 1)))
   ;; Take no chances with text properties.
-  (let ((annotation (buffer-substring-no-properties (point-min) (point-max)))
-	(bookmark-name bookmark-annotation-name))
+  (let
+    ((annotation (buffer-substring-no-properties (point-min) (point-max)))
+	 (bookmark-name bookmark-annotation-name)
+     (return-line
+       (with-current-buffer "*Bookmark List*"
+         (line-number-at-pos)))
+     (return-column
+       (with-current-buffer "*Bookmark List*"
+         (current-column))))
     (bookmark-set-annotation bookmark-name annotation)
     (setq bookmark-alist-modification-count
           (1+ bookmark-alist-modification-count))
-    (bookmark-bmenu-surreptitiously-rebuild-list))
-  (kill-buffer (current-buffer)))
+    (kill-buffer (current-buffer))
+    (pop-to-buffer (get-buffer "*Bookmark List*"))
+    (bookmark-bmenu-list)
+    (goto-char (point-min))
+    (forward-line (1- return-line))
+    (forward-char return-column)))

 (defun bookmark-edit-annotation (bookmark-name-or-record)