[Top][All Lists]

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

Re: Making `interactive' conditional

From: Óscar Fuentes
Subject: Re: Making `interactive' conditional
Date: Mon, 11 Jan 2016 07:48:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> That does sound kinda exciting.  To take a random example, `M-x
>> delete-matching-lines' could have a :when of `buffer-writable-p' and not
>> auto-complete when in a read-only buffer.  Etc.
> I'd be wary of going too far down that road: I often want to modify
> read-only buffers 'cause I hadn't realized they're still read-only.
> In that case, not finding the command in M-x would make me lose a lot
> more time (looking for the damn command, under the assumption that
> I just misremember it) than getting a clear "beep!  buffer is
> read-only!" after which I can C-x C-q and move on.
>> Hm...  I think that sounds a bit too magical to be workable in general.
> That's exactly what I thought when I read the suggestion to omit
> delete-matching-lines in read-only buffers.

Your example looks quite convincing to me, and objections on that line
were made by others on previous messages. However, applying
`delete-matching-lines' to a dired buffer or a gnus summary buffer and
obtaining "beep! buffer is read only!" as an answer is not very helpful,
nor the user would consciously apply that command to that kind of
buffer, so I still think that decorating delete-matching-lines with a

(and (not read-only) visiting-file)

condition makes sense. That is, the feature is useful, but its use is
not so straightforward as with the mode-related conditions.

Apart from that, the :when key, if intended as a general predicate,
makes me worry about its performance impact.

reply via email to

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