GNU bug report logs - #48674
Frames and minibuffer bug

Previous Next

Package: emacs;

Reported by: Iris García <iris.garcia.desebastian <at> gmail.com>

Date: Wed, 26 May 2021 14:42:04 UTC

Severity: normal

Merged with 48675

Found in version 28.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


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

From: Iris García <iris.garcia.desebastian <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 48674 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>
Subject: Re: bug#48674: Frames and minibuffer bug
Date: Fri, 28 May 2021 11:34:13 +0200
[Message part 1 (text/plain, inline)]
Hi Martin,

Thanks for the comments, to be honest, my elisp knowledge is very limited
and I wanted to learn by doing a modal editing package.

This package has two modes: normal and insert, I like to change the cursor
color and type according to the active editing mode.

For this reason, I have a hook in the minibuffer, so everytime I open the
minibuffer I want to switch to insert mode and this triggers the
cursor update in every frame then when the minibufer is closed go back to
normal mode and again update the cursor in every frame.

I'm pretty sure there are better ways to achieve this, but this was the one
I got working in Emacs 27.

I'm happy to share the entire code if that helps but I think the point here
is the bug is real and should be fixed no?

In the meantime, I'll take your snippet (thanks for that) and try to edit
my package to workaround the bug.

Regards,

Iris.

On Fri, 28 May 2021 at 10:25, martin rudalics <rudalics <at> gmx.at> wrote:

>  >> The only difference is the add-hook, this time using
>  >> window-state-change-hook instead of minibuffer-...
>  >> This leads to the same bug.
>
> It's still the same bug.  No matter what happens, evaluating
>
> (let ((window (selected-window)))
>    (dolist (frame (frame-list))
>      (with-selected-frame frame))
>    (eq window (selected-window)))
>
> must always yield t.
>
> Note, however, that the `with-selected-frame' in your function is not
> needed.  `modify-frame-parameters' works without selecting the frame
> whose parameter you want to modify.  Also I do not understand why you
> want to modify the cursor in all windows when you enter the minibuffer.
>
> Consider the following snippet to set the background of the minibuffer
> window when it is active (hopefully `active-minibuffer-window' always
> returns the right value when exiting the minibuffer).
>
>
> (defun foo ()
>    (with-current-buffer (window-buffer (active-minibuffer-window))
>      (set (make-local-variable 'face-remapping-alist)
>          '((default (:background "yellow") default)))))
>
> (defun bar ()
>    (with-current-buffer (window-buffer (active-minibuffer-window))
>      (set (make-local-variable 'face-remapping-alist) nil)))
>
> (add-hook 'minibuffer-setup-hook #'foo)
> (add-hook 'minibuffer-exit-hook #'bar)
>
>
> I never tried to remap the cursor color in a buffer-local way, but I
> think you can figure out how to do that in a similar fashion.
>
> martin
>
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 354 days ago.

Previous Next


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