unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: 20152@debbugs.gnu.org
Subject: bug#20152: 24.4: bookmarks display wrong annotation (FIX INCLUDED)
Date: Wed, 25 Mar 2015 21:41:30 -0400	[thread overview]
Message-ID: <jwvegoc5yom.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <550C6B09.3010208@gmx.com> (Boruch Baum's message of "Fri, 20 Mar 2015 14:46:33 -0400")

> In the bookmark list buffer, after viewing an annotation for a
> bookmark, navigating to another bookmark entry does not kill the
> annotation buffer display, leading to confusion about which entry
> the still-visible annotation refers.

Indeed.  How 'bout we only fix this part, not by removing the window,
but by keeping it up-to-date as long as the annotations buffer
is displayed?
Can you provide a patch which does just that?

> +(defvar bookmark-bmenu-toggle-auto-display-annotations nil

I think this is not needed: if the user wants to see the annotations,
she can hit `a' after which they'll be auto-updated as she moves in
the list.  And if she doesn't want to see the annotations, she can hit
`q' in the annotations buffer (which should call quit-window).

> +"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'.")

We typically use "non-nil" and "nil" rather than "not `nil'" and
"`nil'".  Same for t which we don't put in `...'.  All other symbols
indeed do get `...'.

> +    (if bookmark-bmenu-auto-display-annotations
> +      (setq bookmark-bmenu-auto-display-annotations nil)
> +     (setq bookmark-bmenu-auto-display-annotations t)))

Aka (setq bookmark-bmenu-auto-display-annotations
          (not bookmark-bmenu-auto-display-annotations))

> +(defvar bookmark-bmenu-auto-display-annotations nil

I don't think we need this either, just use
(get-buffer-window "*Bookmark Annotation*" t) instead.

> +(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-function)

Better keep bookmark-bmenu-mode-hook nil by default.  IOW, the code
should simply be added to bookmark-bmenu-mode instead.


        Stefan





  reply	other threads:[~2015-03-26  1:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 10:38 bug#20152: 24.4: bookmarks display wrong annotation (FIX INCLUDED) Boruch Baum
2015-03-20 14:31 ` Stefan Monnier
2015-03-20 16:29   ` Boruch Baum
2015-03-20 18:32   ` Boruch Baum
2015-03-20 18:46     ` Boruch Baum
2015-03-26  1:41       ` Stefan Monnier [this message]
2021-12-02 10:17         ` Lars Ingebrigtsen
2021-12-03  6:31           ` Boruch Baum
2021-12-05  0:55             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvegoc5yom.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20152@debbugs.gnu.org \
    --cc=boruch_baum@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).