GNU bug report logs - #77224
[PATCH] New minor mode 'cursor-indicators-mode'

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Sun, 23 Mar 2025 22:59:03 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mail <at> daniel-mendler.de, 77224 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
Date: Thu, 27 Mar 2025 11:10:06 -0600
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
>> Date: Thu, 27 Mar 2025 08:53:25 -0600
>> Cc: mail <at> daniel-mendler.de, 77224 <at> debbugs.gnu.org, 
>> 	Juri Linkov <juri <at> linkov.net>

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

>>  Btw, a possibly even better way is to modify the cursor looks from the
>>  hooks of the relevant commands, like overwrite-mode.  If some of them
>>  don't have a hook, we could add a hook.  This is better because it
>>  doesn't unnecessarily "punish" Emacs anywhere else, only the commands
>>  that could affect the cursor.

>> But what if user prefer using a lambda instead a function? For example for a specific mode or action from a
>> key binding package such as evil or meow
> Sorry, I don't understand: what lambda?  Aren't all the modes you want
> to catch normal minor modes with a hook?

Not only minor mode, also functions (function symbols or anonymous ones).
for example if user wants to change cursor appearance if a text at
current cursor position have an overlay or whatever, can do it
defining a function in their config:

#+begin_src elisp
(defun my/cursor-change ()
  (string-prefix-p " *" (buffer-name)))

(setopt cursor-indicators-conditions `((my/cursor-change hollow "yellow")))
#+end_src

or

#+begin_src elisp
(setopt cursor-indicators-conditions `((,(lambda () (string-prefix-p " *" (buffer-name)))
                                        hollow "yellow")))
#+end_src

The current code only check if symbol is a variable or a function
symbol (since minor modes also defines a variable with same minor
mode name) or a lambda, and it must return =non-nil=.

[Message part 2 (text/html, inline)]
[Message part 3 (text/plain, inline)]

-- 
                                          - E.G via GNU Emacs and Org.

This bug report was last modified 64 days ago.

Previous Next


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