GNU bug report logs -
#45686
28.0.50; Could minibuf-eldef-setup-minibuffer inhibit modifications hooks, please?
Previous Next
Full log
View this message in rfc822 format
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.