GNU bug report logs - #75645
Implement something like (bookmark-bmenu-list) for registers

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Sat, 18 Jan 2025 10:51:02 UTC

Severity: wishlist

Full log


Message #23 received at 75645 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: Thierry Volpiatto <thievol <at> posteo.net>, 75645 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#75645: Implement something like (bookmark-bmenu-list) for
 registers
Date: Sat, 18 Jan 2025 18:26:29 +0000
[Message part 1 (text/plain, inline)]
Dani Moncayo <dmoncayo <at> gmail.com> writes:

> On Sat, Jan 18, 2025 at 5:56 PM Thierry Volpiatto <thievol <at> posteo.net> wrote:
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> From: Dani Moncayo <dmoncayo <at> gmail.com>
>> >> Date: Sat, 18 Jan 2025 11:50:23 +0100
>> >>
>> >> While analyzing source code files, I use (a lot) the functionality of
>> >> keeping buffer
>> >> positions in registers ((point-to-register) and (jump-to-register)).
>> >>
>> >> But I miss being able to display the current list of registers in a new buffer
>> >> similar to the one generated for bookmarks with the command
>> >> (bookmark-bmenu-list).
>> >>
>> >> And following the analogy, I'd like that new buffer to allow things like:
>> >> * Delete one, several, or all registers.
>> >> * Jump to the position pointed by some register, by clicking (or
>> >> pressing ENTER) on its line.
>> >>
>> >> I'd very much like to have such a feature, and I think others would like it too.
>> >
>> > Thanks.
>> >
>> > Thierry, any comments or suggestions?
>>
>> It is easy to provide a delete register command for Emacs, however with
>> the preview interface we can delete only one register at once:
>>
>> --8<---------------cut here---------------start------------->8---
>> (customize-set-variable 'register-use-preview 'insist)
>>
>> (defun register-delete (register)
>>   (interactive (list (register-read-with-preview "Delete register: ")))
>>   (setq register-alist (delete (assoc register register-alist)
>>                                register-alist)))
>>
>> (cl-defmethod register-command-info ((_command (eql register-delete)))
>>   (make-register-preview-info
>>    :types '(all)
>>    :msg "Delete register `%s'"
>>    :act 'modify
>>    :smatch t))
>> --8<---------------cut here---------------end--------------->8---
>
> I like that (register-delete) command.  But I think it should error
> out if I specify an already empty register.

You can't (try to) delete an empty register with the preview.

-- 
Thierry
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 200 days ago.

Previous Next


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