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

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

bug#39902: 28.0.50; Marking in dired with active region


From: Drew Adams
Subject: bug#39902: 28.0.50; Marking in dired with active region
Date: Mon, 16 Mar 2020 08:21:55 -0700 (PDT)

> My vote is to use what I suggested, or similar:
> 
> (progn (goto-char end)
>        (when (bolp) (backward-char))
>        (line-end-position))

This (and I guess the variants that others
proposed) has a bug when point is at bol, the
region is empty, and `use-empty-active-region'
is non-nil.  In that case it raises an error
saying that "start > end" (which is not a very
clear error message in general, BTW).

This code seems to DTRT:

(progn (goto-char end)
       (when (and (bolp) (> end beg))
         (backward-char))
       (line-end-position))

[Non-nil option `use-empty-active-region' is
a pesky use case.  A guess is that there are
other, similar bugs lurking in Emacs.  I
wonder how many times we actually test for
that use case when we use `use-region-p'.]





reply via email to

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