--- Begin Message ---
Subject: |
24.4: bookmarks: return from editing annotations (FIX INCLUDED) |
Date: |
Fri, 20 Mar 2015 03:24:04 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 |
When completing a bookmark annotation edit, the point on the bmenu-list
would move to point-max and the selected window would be wherever the
annotation buffer had been displayed.
The fix restores focus to the bmenu-list window, and restores point to
where it had been prior to editing the annotation.
(defun bookmark-send-edited-annotation ()
"Use buffer contents as annotation for a bookmark.
Lines beginning with `#' are ignored."
(interactive)
(if (not (derived-mode-p 'bookmark-edit-annotation-mode))
(error "Not in bookmark-edit-annotation-mode"))
(goto-char (point-min))
(while (< (point) (point-max))
(if (looking-at "^#")
(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)
(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))
(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)))
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
attachment
Description: Text document
signature.asc
Description: OpenPGP digital signature
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#20150: 24.4: bookmarks: return from editing annotations (FIX INCLUDED) |
Date: |
Sun, 14 Jul 2019 09:29:01 +0300 |
> From: Stefan Kangas <address@hidden>
> Date: Sat, 13 Jul 2019 15:09:39 +0200
> Cc: address@hidden
>
> Please see this updated patch with those two changes.
Thanks, pushed to the master branch.
--- End Message ---