GNU bug report logs - #73386
[PATCH] Fix keybinding support for *-auto-reveal

Previous Next

Package: auctex;

Reported by: Paul Nelson <ultrono <at> gmail.com>

Date: Fri, 20 Sep 2024 14:54:02 UTC

Severity: normal

Tags: patch

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Nelson <ultrono <at> gmail.com>
Subject: bug#73386: closed (Re: bug#73386: [PATCH] Fix keybinding support
 for *-auto-reveal)
Date: Thu, 26 Sep 2024 21:00:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#73386: [PATCH] Fix keybinding support for *-auto-reveal

which was filed against the auctex package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 73386 <at> debbugs.gnu.org.

-- 
73386: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73386
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Arash Esbati <arash <at> gnu.org>
To: Paul Nelson <ultrono <at> gmail.com>
Cc: 73386-done <at> debbugs.gnu.org
Subject: Re: bug#73386: [PATCH] Fix keybinding support for *-auto-reveal
Date: Thu, 26 Sep 2024 22:57:03 +0200
Paul Nelson <ultrono <at> gmail.com> writes:

> Seems fine on my end, so I've attached the updated patch.

Thanks, I installed your patch.  Closing.

Best, Arash

[Message part 3 (message/rfc822, inline)]
From: Paul Nelson <ultrono <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: [PATCH] Fix keybinding support for *-auto-reveal
Date: Fri, 20 Sep 2024 16:52:48 +0200
[Message part 4 (text/plain, inline)]
Hello,

I just realized that my earlier patch
8db1e90b6d25beb72b5ebbc706b6def64794dcf8 broke key-binding support for
auto-reveal (i.e., using left/right rather than C-f/b to open previews
and folds).  The attached patch remedies this.  Details below.

Thanks, best,

Paul

---

The user option *-auto-reveal-commands consists of both functions and
lists for keybinding:

(defcustom preview-auto-reveal-commands
  '((key-binding [left])
    (key-binding [right])
    backward-char
    forward-char
    pop-to-mark-command
    undo)
  "List of commands that may cause a preview to be revealed.
This list is consulted by the default value of `preview-auto-reveal'."
  :type '(repeat (choice (function :tag "Function")
                         (sexp :tag "Key binding"))))

When we call (apply #'preview-arrived-via
preview-auto-reveal-commands), the lists for keybinding are not
evaluated, so we never pick up the command to which left/right are
bound.  The attach patch remedies this issue by first evaluating any
keybinding.

In retrospect, a more uniform approach would have been to have all
elements of *-auto-reveal-commands be "something that gets evaluated",
i.e.,

(defcustom preview-auto-reveal-commands
  '((key-binding [left])
    (key-binding [right])
    #'backward-char
    #'forward-char
    #'pop-to-mark-command
    #'undo)
    ...)

This would allow a more uniform default implementation of
*-auto-reveal.  Given that the docstring for *-auto-reveal-commands
says that it should consist of either functions or key bindings, I
think the proposed solution is acceptable.  It's also a bit simpler
for me, since I have a couple packages that add functions (rather than
function symbols) to *-auto-reveal-commands.
[0001-Fix-keybinding-support-for-auto-reveal.patch (application/octet-stream, attachment)]

This bug report was last modified 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.