emacs-devel
[Top][All Lists]
Advanced

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

Re: line-number-mode at EOB


From: Stephen Berman
Subject: Re: line-number-mode at EOB
Date: Tue, 18 Jul 2017 22:38:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Tue, 18 Jul 2017 22:03:47 +0300 Eli Zaretskii <address@hidden> wrote:

> In any case, I don't think that what-line should be changed, because
> it's used elsewhere, and such a change is backward-incompatible.

According to rgrep, what-line occurs in these Emacs Lisp libraries:
vi.el, tpu-edt.el (both in obsolete/), f90.el, view.el, and edt.el.  In
all but one case, it's used just as a command to return the line number
at point, so for these it would be no problem if it returned "EOB" at
EOB.  The exception is f90.el, which uses it noninteractively:

                  (message "Matches %s: %s"
                           (what-line)
                           (buffer-substring
                            (line-beginning-position)
                            (line-end-position)))

I think this could only be problematic if EOB is not preceded by a
newline: then it would indeed be necessary to change the caller to
ensure that point isn't at EOB.  Alternatively, what-line could be
changed so that in noninteractive uses it always returns a line number,
even at EOB.

But anyway, it seems like the idea of not displaying a line number in
the mode line at EOB is at best too controversial to accept outright,
since there are incompatible intuitions about whether EOB is a line
(when preceded by a newline).  Given that, if it were to be included in
Emacs at all, then it should be conditioned by a user option.

Steve Berman



reply via email to

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