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:32:34 -0400 Message-ID: <550C67C2.9020208@gmx.com> References: <550BF8BE.5080105@gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C8h7VTD4XGQnVUds9PXJU4slHwwB0Q19U" X-Trace: ger.gmane.org 1426876475 8970 80.91.229.3 (20 Mar 2015 18:34:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 18:34:35 +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:34:24 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 1YZ1kQ-0002kj-MG for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 19:34:18 +0100 Original-Received: from localhost ([::1]:45115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1kK-0005yr-L2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 14:34:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1kG-0005yk-Ap for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:34:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZ1kB-0002oY-AD for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:34:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1kB-0002oT-6y for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:34:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YZ1kA-0007vP-HR for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 14:34:02 -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:34:02 +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.142687640930339 (code B ref 20152); Fri, 20 Mar 2015 18:34:02 +0000 Original-Received: (at 20152) by debbugs.gnu.org; 20 Mar 2015 18:33:29 +0000 Original-Received: from localhost ([127.0.0.1]:59353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ1jc-0007tF-QN for submit@debbugs.gnu.org; Fri, 20 Mar 2015 14:33:29 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:60540) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ1ja-0007sY-6i for 20152@debbugs.gnu.org; Fri, 20 Mar 2015 14:33:27 -0400 Original-Received: from [192.168.1.12] ([96.232.130.59]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MYP57-1Z40qI091F-00VBw4; Fri, 20 Mar 2015 19:33:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 In-Reply-To: OpenPGP: url=hkp://keys.gnupg.net X-Provags-ID: V03:K0:zq7sUpATmqCmRFXE4tK1eSe0+b027eF9xV0mal5lThCex9Iw2ke fWzInpZ+PcEuFeuJ45O0Ps7P0qPV2yjkUChWZ3N7ihkY6f0c8bvp3feYoyRbgvU51nY/yji dX7cxJIY4pIUv1UDG5lMjDA9gPrJjXC/g1QmcNrrJF4C4W/uL1MfOLAQsWcV1R7CdtyJv2s kDBH/CZOjvrzMVhGJbrKQ== 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:100718 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --C8h7VTD4XGQnVUds9PXJU4slHwwB0Q19U Content-Type: multipart/mixed; boundary="------------090708080009050104020201" This is a multi-part message in MIME format. --------------090708080009050104020201 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Stefan, I noticed that my solution, while good, was partial, in that it didn't cover ALL the possible navigation commands. 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. This patch replaces `emacs_bug_20152-a.patch'. Signing off for Shabbat, Boruch. 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 hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --------------090708080009050104020201 Content-Type: text/x-patch; name="emacs_bug_20152-a2.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="emacs_bug_20152-a2.patch" --- bookmark.el 2015-03-20 14:25:37.325230039 -0400 +++ bookmark-new.el 2015-03-20 14:22:03.981236956 -0400 @@ -2068,6 +2068,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". --------------090708080009050104020201-- --C8h7VTD4XGQnVUds9PXJU4slHwwB0Q19U 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 iQIcBAEBAgAGBQJVDGfCAAoJEDvrUfDmCx9L4g0P/iaoNnVA1GbCTCKSt8Af6Yp6 iYoVnMj0z306M1+umEySfXONM44Np7VlJplW8C3sF+YpZrkiVd5FLljWaNuRDZIG VL0t7WFU5bYPVXin26BZbLq5jhE3vTa6YJWXHmawGL0sptXnBnFtKQWXlsqPCQ8k lhSgybyLrEvgVIRKxD0mADCVVyNPl8Eu83LL+8F2H1hPntnarNC4G2tMNBcmOQUE GCu4oUJj3BnYgdK15v78PixlIqfinLbqs+y5cSe5ae5M7SSJCXSg5f+WhpdtyhRg pXuFXhlK/qPCvFY7NnbZL6Kmv173VDKUpcNbtQrZ6P2+fw18Cf/bN+3juBEOeIye gn0rBTqS1ZyWBE9SyzhTXLgErmM/8nNNZ5j2r/5eIoCTocf8fbLAHBBPhC2AKRQ0 3XCw9r/0VdKz9uVbD5tDBxwje223vYH2dF3An281OElPJoP9Jl0lPXaryCBNBKWx iLDdojHj4aRRL4FH/xS9ge/fJIQsFdU0mjeSe8acke9a5yWskfSgreJ7RhDkhiIm hI3PQ6LV3IWHdi9zwPI1rsFXRU3Xw8FgIxs0EVgVtZ6KnyKiIy+QhCPDiq8x4W+s WME7HKH0vMbeJmawYFGkl7BvTjqWgb1WQKEEHhZEvFsPwxcbCqSWS8o/MbR3QvO3 BKuhvHpa1OP6v3HcGC1B =C8iX -----END PGP SIGNATURE----- --C8h7VTD4XGQnVUds9PXJU4slHwwB0Q19U--