all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Iris García" <iris.garcia.desebastian@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 48674@debbugs.gnu.org, Alan Mackenzie <acm@muc.de>
Subject: bug#48674: Frames and minibuffer bug
Date: Fri, 28 May 2021 11:34:13 +0200	[thread overview]
Message-ID: <CALBoQjq-GJ6TuxCjDMyu59URU4u36Cf5Y7D=v1jPMkWXCXgFnw@mail.gmail.com> (raw)
In-Reply-To: <c18dbbaa-016b-953d-2415-9a1389a77f1b@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

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@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
>

[-- Attachment #2: Type: text/html, Size: 3166 bytes --]

  reply	other threads:[~2021-05-28  9:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 11:23 bug#48674: Frames and minibuffer bug Iris García
2021-05-26 17:45 ` martin rudalics
2021-05-27 10:34   ` Alan Mackenzie
2021-05-27 16:33     ` martin rudalics
2021-05-27 19:56       ` Iris García
2021-05-28  8:25         ` martin rudalics
2021-05-28  9:34           ` Iris García [this message]
2021-05-28  9:51             ` martin rudalics
2021-05-31 16:36         ` Alan Mackenzie
2021-06-01 11:29           ` Iris García
2021-05-27 20:01       ` Alan Mackenzie
2021-05-28  8:26         ` martin rudalics
2021-05-28 17:15           ` Alan Mackenzie
2021-05-28 20:14             ` Alan Mackenzie
2021-05-29  9:20               ` martin rudalics
2021-05-29 13:10                 ` Alan Mackenzie
2021-05-29 15:12                   ` martin rudalics
2021-05-29 15:24                     ` Eli Zaretskii
2021-05-29 17:00                     ` Alan Mackenzie
2021-05-30 13:58                       ` Alan Mackenzie
2021-05-31  7:55                         ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALBoQjq-GJ6TuxCjDMyu59URU4u36Cf5Y7D=v1jPMkWXCXgFnw@mail.gmail.com' \
    --to=iris.garcia.desebastian@gmail.com \
    --cc=48674@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.