From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Boruch Baum Newsgroups: gmane.emacs.bugs Subject: bug#20152: 24.4: bookmarks display wrong annotation (FIX INCLUDED) Date: Fri, 20 Mar 2015 14:46:33 -0400 Message-ID: <550C6B09.3010208@gmx.com> References: <550BF8BE.5080105@gmx.com> <550C67C2.9020208@gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GXnseTG9AoM05MvG51rgBjK1p2a9220ph" X-Trace: ger.gmane.org 1426877360 26193 80.91.229.3 (20 Mar 2015 18:49:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 18:49:20 +0000 (UTC) Cc: 20152@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 20 19:49:09 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YZ1yk-0007Jf-LU for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 19:49:06 +0100 Original-Received: from localhost ([::1]:45173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1yj-0003ck-ST for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 14:49:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1xm-00029H-AY for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZ1xi-0008D0-8m for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:48:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1xi-0008Cw-4u for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YZ1xh-0000L4-N1 for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Boruch Baum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Mar 2015 18:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20152 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20152-submit@debbugs.gnu.org id=B20152.14268772441169 (code B ref 20152); Fri, 20 Mar 2015 18:48:01 +0000 Original-Received: (at 20152) by debbugs.gnu.org; 20 Mar 2015 18:47:24 +0000 Original-Received: from localhost ([127.0.0.1]:59374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ1x5-0000Il-H8 for submit@debbugs.gnu.org; Fri, 20 Mar 2015 14:47:24 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:51378) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ1x3-0000I3-B2 for 20152@debbugs.gnu.org; Fri, 20 Mar 2015 14:47:22 -0400 Original-Received: from [192.168.1.12] ([96.232.130.59]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MOO6X-1Yccqb0UNB-005u06; Fri, 20 Mar 2015 19:47:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 In-Reply-To: <550C67C2.9020208@gmx.com> OpenPGP: url=hkp://keys.gnupg.net X-Provags-ID: V03:K0:hJnMpa7/R5nhHb2jf72xp2eX66y8wJ3pmnqmHVOlnSLgPWm0Gmq 9iZSwLsPv2GYxtDoiFcX1wIJAQvyw8FliH+jjpkp/zaQYWG8aFug5LOm7WfFKnBhS/7uaiR N5sGJtW6eA7w7NIMLLwxzHP+G0xqKBaHXEon8Cyd09Wz5NH3WnXqTkG0aJIl/i7H/dVBD5X w0U3PY/S4kmjsOB68eUFg== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100721 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GXnseTG9AoM05MvG51rgBjK1p2a9220ph Content-Type: multipart/mixed; boundary="------------070406070702060505000706" This is a multi-part message in MIME format. --------------070406070702060505000706 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable And this, replaces `emacs_bug_20152-b.patch'. Now I'm really signing off. On 03/20/2015 02:32 PM, Boruch Baum wrote: > Stefan, >=20 > I noticed that my solution, while good, was partial, in that it didn't > cover ALL the possible navigation commands. >=20 > Attached is a more elegant, smaller, and more thorough fix, especially > appropriate or a buffer such as bookmark-bmenu, as so many of the > keystrokes within the buffer will be navigation commands. >=20 > This patch replaces `emacs_bug_20152-a.patch'. >=20 > Signing off for Shabbat, >=20 > Boruch. >=20 > On 03/20/2015 10:31 AM, Stefan Monnier wrote: >> Same here, please resend your fix as a patch ("diff -u" or "diff -c").= --=20 >=20 >=20 > hkp://keys.gnupg.net > CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 >=20 --=20 hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --------------070406070702060505000706 Content-Type: text/x-patch; name="emacs_bug_20152-b2.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="emacs_bug_20152-b2.patch" --- bookmark.el 2015-03-20 14:25:37.325230039 -0400 +++ bookmark-new.el 2015-03-20 14:40:51.425200402 -0400 @@ -1901,9 +1901,20 @@ (bookmark-bmenu-other-window)))) =20 =20 +(defvar bookmark-bmenu-toggle-auto-display-annotations nil +"When not `nil', function `bookmark-bmenu-show-annotation' (by +default, bound to `a`), toggles whether to automatically display +a bookmark's annotation as one navigates through the bookmark +list. Default is `nil'.") + (defun bookmark-bmenu-show-annotation () "Show the annotation for the current bookmark in another window." (interactive) + (when (and (called-interactively-p "any") + bookmark-bmenu-toggle-auto-display-annotations) + (if bookmark-bmenu-auto-display-annotations + (setq bookmark-bmenu-auto-display-annotations nil) + (setq bookmark-bmenu-auto-display-annotations t))) (let ((bookmark (bookmark-bmenu-bookmark))) (bookmark-show-annotation bookmark))) =20 @@ -2068,6 +2079,31 @@ (forward-line 1)) (forward-line 0)) =20 +(defvar bookmark-bmenu-auto-display-annotations nil +"Whether to automatically display a bookmark's annotation as one +navigates through the bookmark list. `t' for yes. Default is +`nil'.") + +(defvar bookmark-bmenu-last-post-command-line 1 +"The line number at point, within the bookmark list buffer, after +the last command had been run in that buffer.") + +(defun bookmark-bmenu-motion-hook-function () +"This function is added to the `post-command-hook' locally for +bookmark list buffers, in order to update any visible annotations +as one navigates within the buffer." + (let ((annotation-buffer)) + (when (/=3D bookmark-bmenu-last-post-command-line (line-number-at-po= s)) + (when (setq annotation-buffer (get-buffer "*Bookmark Annotation*")= ) + (kill-buffer annotation-buffer)) + (when bookmark-bmenu-auto-display-annotations + (bookmark-bmenu-show-annotation))))) + +(defun bookmark-bmenu-post-command-hook-function () + (add-hook 'post-command-hook 'bookmark-bmenu-motion-hook-function t t)= ) + +(add-hook 'bookmark-bmenu-mode-hook 'bookmark-bmenu-post-command-hook-fu= nction) + =20 =0C ;;; Menu bar stuff. Prefix is "bookmark-menu". --------------070406070702060505000706-- --GXnseTG9AoM05MvG51rgBjK1p2a9220ph Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVDGsJAAoJEDvrUfDmCx9LvKIP/0SlQdcplSNDktJty8TH7+58 hwm7k8XDQeZ0L1CjP3k3K8ezL734ArVUOQwoCgXdKLMH+PbuwygQJFOnFjIF1w3a jpuRi1hQ01Wf8QLBm2LeaRC52RQ5fiu+PLra7hBgmCvrCjDYFIrUsHCK9ASY8N2F Aw/d/3Fwgg2FNysIwe8aYX7Gr6sJ8rCwibk7pTgTqDd/hsORnp2WTDyLOlsgLn3M c2nJNe7P4yYGGLPOBYPwnJgrX0kWYHDCu52HSqAOuhCJHR9sn7TXVR6w+Gs8g07E lcvvbMrNqNVunjwwZBo/i0fFXBZQyMeyL7ihsSROR4O8CF5tKiLsq4Eu2HPg/HJX uZC1npvhSO6PFy3JZs2BUoURgU/o9204IHb+0nQx20XK3xq8K0ALP6wND0pR4RYN lSn7lanPZz1T7ZstsvFbbEZ5h4cmoU9Pt3QjsCnOYWFmTOgEsgcO1pcBXUDOK7Jb Tla653NXFmYuuYEvLqQFlTW/VXgKLCMNoGkzI4v4i5SVZxItJQxQicH3Iy15NP0L J3g9KoH98LBjCn37ZsjGIZxxZ+lmIvRYj7WPCkaHeI3QKrJ9J14zbhP8EvV8oyFF 0a09bZ68CMc5UlJc+BCJ8BRjynl0CSe2Hzlvh3OP7wfhq5ZvL0xHD0G5n9Iev+a2 VU4GIL3ZprKqLsbT8708 =wpqi -----END PGP SIGNATURE----- --GXnseTG9AoM05MvG51rgBjK1p2a9220ph--