[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: define-minor-mode question
From: |
Tim Cross |
Subject: |
Re: define-minor-mode question |
Date: |
Wed, 20 Apr 2022 18:20:57 +1000 |
User-agent: |
mu4e 1.7.12; emacs 28.1.50 |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Tim Cross <theophilusx@gmail.com>
>> Date: Wed, 20 Apr 2022 14:15:39 +1000
>>
>>
>> (define-minor-mode corgi-stateline-mode
>> "Toggle corgi-stateline-mode."
>> :init-value nil
>> :global t
>> (if (default-value 'corgi-stateline-mode)
>> (corgi-stateline/turn-on)
>> (corgi-stateline/turn-off)))
>>
>>
>> When I do M-x corgi-stateline-mode, I see two messages in the echo area.
>> The first tells me the mode is being enabled/disabled. The second says
>>
>> You can run the command 'corgi-stateline-mode' with M-x corg-m RET
>>
>> This is the problematic message. First, I don't want that message, but
>> more importantly, it is wrong. You cannot run the command with M-x
>> corg-m.
>
> Why not? What happens if you try?
>
When I tired it, it didn't work. The command was not found. I also tried
C-h f, which also failed.
After your reply, I dug a little deeper and now suspect this is an issue
with ivy. I don't normally use ivy, but the project I'm contributing to
does, so I was using their default setup. If I define the mode in a
clean (emacs -q) environment, the shorthand version works. I'm guesssing
that whatever Emacs uses to generate the shorthand name isn't being
picked up by ivy. I don't know if this is an ivy limitation or an ivy
configuration error at this point.
I initially thought the failure was due to something I had missed in
defining the minor mode.