]> git.eshelyaron.com Git - emacs.git/commit
Restore focus to Bookmark List after editing annotation
authorStefan Kangas <stefankangas@gmail.com>
Tue, 2 Jul 2019 01:06:37 +0000 (03:06 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 14 Jul 2019 06:26:42 +0000 (09:26 +0300)
commit7c30ad184fee3254e3f37601c9af8280f15e3409
treeb8e5dc44c02e9ba15242c0fa1630dd3b40e6900f
parent352530ee0a52153a7936864275dce7f89e070a15
Restore focus to Bookmark List after editing annotation

There are two entry points to bookmark-edit-annotation-mode: the first
when we add a bookmark and bookmark-use-annotations is non-nil; the
second when bookmark-bmenu-edit-annotation is run from the bookmark
list.  When editing is concluded, in the first case, we should just
quit window.  In the second case, we should instead return to the
bookmark list.

* lisp/bookmark.el (text-property-search): Require.
(bookmark-annotation-name): Make buffer-local and improve doc string.
(bookmark--annotation-from-bookmark-list): New buffer-local variable.
(bookmark-edit-annotation): New argument from-bookmark-list sets
bookmark--annotation-from-bookmark-list.
(bookmark-bmenu-edit-annotation): Call bookmark-edit-annotation with
argument from-bookmark-list set to t.
(bookmark-send-edited-annotation): When editing originated in the
bookmark list, restore focus to bookmark list and move point back to
edited bookmark. (Bug#20150)

(bookmark-edit-annotation-mode): Fix typo.
(bookmark-bmenu-buffer): New variable.
(bookmark-bmenu-surreptitiously-rebuild-list)
(bookmark-bmenu-list): Use it.

* test/lisp/bookmark-tests.el (with-bookmark-bmenu-test): New macro.
(bookmark-tests-set/bookmark-use-annotations-t)
(bookmark-bmenu-edit-annotation/show-annotation)
(bookmark-bmenu-send-edited-annotation)
(bookmark-bmenu-send-edited-annotation/restore-focus): New test cases.
lisp/bookmark.el
test/lisp/bookmark-tests.el