bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#59350: 29.0.50; Eval region or buffer


From: Drew Adams
Subject: bug#59350: 29.0.50; Eval region or buffer
Date: Fri, 18 Nov 2022 16:48:11 +0000

> 'elisp-eval-buffer' is a nice new command that evaluates the current
> buffer with a convenient keybinding 'C-c C-e'.  It would be nicer also to 
> react
> on the currently active region:

I think the more usual (conventional?) naming is to
name the function "*-region", not "*-buffer", and
to have the doc string say that if the region isn't
active (or isn't active and nonempty, or whatever)
then the limits used are `point-min' and `point-max'
(IOW, the possibly-restricted buffer).

The region case is more general (arbitrary limits),
even if it's more particular if applied only when
active (and maybe nonempty).

Another usual (conventional?) naming, depending on
the context, can be just `*', explaining in the doc
string that the function applies to the region if
active (or...), and otherwise to the buffer.

Commands named `*-buffer' tend to act on the full
buffer (possibly restricted by narrowing), whether
or not the region is active.

I don't claim this is a rule, but I think it's
fairly common practice.

It's also fairly common to have separate commands
- or at least functions - for the region and the
buffer.

(I could be wrong.)





reply via email to

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