GNU bug report logs - #45686
28.0.50; Could minibuf-eldef-setup-minibuffer inhibit modifications hooks, please?

Previous Next

Package: emacs;

Reported by: Omar Antolín Camarena <omar <at> matem.unam.mx>

Date: Wed, 6 Jan 2021 00:27:02 UTC

Severity: normal

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Omar Antolín Camarena <omar <at> matem.unam.mx>
Cc: 45686 <at> debbugs.gnu.org
Subject: bug#45686: 28.0.50; Could minibuf-eldef-setup-minibuffer inhibit modifications hooks, please?
Date: Sun, 10 Jan 2021 15:43:25 +0100
Omar Antolín Camarena <omar <at> matem.unam.mx> writes:

> I'd like it if minibuf-eldef-setup-minibuffer was wrapped in
>
> (let ((inhibit-modification-hooks t))
>   ...)

[...]

> This works fabulously except if I use
>
> (setq minibuffer-eldef-shorten-default t)
> (minibuffer-electric-default-mode)
>
> Because if the minibuffer prompt does have a default, and it gets
> shortened, the shortening triggers after-change-functions even though
> the user hasn't typed anything at the minibuffer. So that's why I want
> minibuf-eldef-setup-minibuffer to inhibit modification hooks, but if
> there's a reason it shouldn't or a better way to solve my problem, I
> would love to hear it.

Well, I could see others wanting to trigger something on these
modifications, too, so I'm not sure inhibiting these specific
modifications from running the hooks would be a good general solution.
And as you say:

> For now, I just add this to my configuration, so my problem is actually
> solved already:
>
> (defun stealthily (fn &rest args)
>   (let ((inhibit-modification-hooks t))
>     (apply fn args)))
>
> (advice-add 'minibuf-eldef-setup-minibuffer :around #'stealthily)

That looks like the correct solution for your use case?

Anybody else got an opinion here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 81 days ago.

Previous Next


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