GNU bug report logs - #59350
29.0.50; Eval region or buffer

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Fri, 18 Nov 2022 07:47:02 UTC

Severity: normal

Found in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 59350 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>, "59350 <at> debbugs.gnu.org"
 <59350 <at> debbugs.gnu.org>
Subject: RE: [External] : 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.)




This bug report was last modified 2 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.