GNU bug report logs - #66394
29.1; Make register-read-with-preview more useful

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thievol <at> posteo.net>

Date: Sat, 7 Oct 2023 19:07:01 UTC

Severity: normal

Found in version 29.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Thierry Volpiatto <thievol <at> posteo.net>
Cc: 66394 <at> debbugs.gnu.org
Subject: Re: bug#66394: 29.1; Make register-read-with-preview more useful
Date: Fri, 27 Oct 2023 03:27:59 +0200
Thierry Volpiatto <thievol <at> posteo.net> writes:

> Why do you need another argument as long as you use `this-command`?
> You can use e.g. (pcase this-command ('foo #'foo-p) etc...)

I doubt all potential uses will use `this-command'.

It's cleaner if the command that knows what it wants passes the
information via argument than to make the other function derive it
indirectly from the context (functional style).

Maybe in the future we might need to pass other predicates as well.
What when a user wants to add another register command?  Or if a future
command needs to prompt more than once?

A predicate passed to the function can also be wrapped for further
filtering etc... that's all more controllable and extensible than hiding
the decision in a defun.

Michael.




This bug report was last modified 1 year and 209 days ago.

Previous Next


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