emacs-devel
[Top][All Lists]
Advanced

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

Re: scratch/command 064f146 1/2: Change command to interactive ... modes


From: Lars Ingebrigtsen
Subject: Re: scratch/command 064f146 1/2: Change command to interactive ... modes
Date: Tue, 16 Feb 2021 13:15:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Isn't this a bit premature?  I thought we were still debating how best
> to implement the annotations?

The discussion seems to have evaporated, so...

Stefan M was in favour of using contextual annotation, so that

(some-new-directive 'foo-mode)

(defun foo-thing1 ()
  (interactive))

(defun foo-thing2 ()
  (interactive))

means that these two commands are tagged as being for foo-mode, and then
using "negative tagging" like

  (declare (completion t))

on the commands that shouldn't get that tagging.  He didn't expound on
why -- whether he just thinks (interactive "p" foo-mode) is just too
ugly, and offends the eye, or whether this would be less work.

It won't be less work -- adding the markup is mechanical, but whether a
command should be mode-specific (and in what mode it should be in) is
what requires work: You have to actually look at each command and make
the determination (and that's the case whether you use contextual
annotations or not).

For instance, I tagged up message.el, and most of the commands are for
message mode, some are general, and there's one command
(`message-make-html-message-with-image-files') that only works in
dired-mode.  (This sort of thing is more common than you'd think --
there's a bunch of commands work in the intersection of two modes, so
it's arbitrary what file they end up in.)

(I've already written about how I think contextual annotations are a
long-term maintenance nightmare, so I won't repeat that bit here.)

-- 
(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]