emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Smarter M-x that filters on major-mode


From: Lars Ingebrigtsen
Subject: Re: Smarter M-x that filters on major-mode
Date: Sat, 13 Feb 2021 12:43:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> To reverse the question: What's the benefit of marking these functions
>> as interactive when they're not meant to be used as commands?
>
> It's marginally less complexity in `define-derived-mode`.

It's very marginal indeed. 

> And it obeys the "Major Mode Conventions" node which repeats over and
> over "the major mode command": the fact that it is expected to be
> a command is so obvious there that it's not even stated explicitly.

That may have been the expectation, but that doesn't mean that we can't
improve things here.

I've had (several times) Emacs erase the contents of a buffer and
disable undo because I've typed the wrong `M-x foo-mode' command -- one
that's not meant for editing, but only exists to do stuff in a
specially-formatted buffer.

Also see what we did to `M-x shell-mode' after the nth complaint that
somebody had executed shell-mode instead of shell-script-mode.  Those
contortions would be unnecessary if we just left shell-mode
noninteractive.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]