GNU bug report logs -
#37155
26.2; `describe-register-1' should not say "Garbage" for (get-register...) -> nil
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Fri, 23 Aug 2019 06:08:02 UTC
Severity: minor
Tags: fixed
Found in version 26.2
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37155 in the body.
You can then email your comments to 37155 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37155
; Package
emacs
.
(Fri, 23 Aug 2019 06:08:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Drew Adams <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 23 Aug 2019 06:08:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
`register-alist' is an alist. It behaves like one and it should behave
like one. It should be usable as one.
`(get-register ?a)' returns nil for an alist entry of `(?a)', as it
should. And, per the doc, `get-register' returning nil means the
register has NO content - it's empty.
`M-x list-registers' handles such empty-register elements of the alist
correctly: it does not list them at all. Those registers have no
content.
That's all as it should be.
However, register previewing, and in particular
`register-describe-oneline', is faulty/misleading when it comes to
registers with no content. Like `list-registers' previewing should
not list them at all. Instead, it lists them as having "Garbage:"
as their content. This is wrong (and it's doubly wrong to include
the `:' char with nothing following it).
`view-register' is OK. It correctly says a register is empty when it
is. Functions that use `describe-register-1' without testing with
`get-register' to handle the empty case do the wrong thing.
Example:
(set-register ?a "aaa")
(set-register ?b "bbb")
(setq register-alist (append '((?a)) register-alist)) correctly empties
register ?a. It gives ((?a) (?b . "bbb") (?a . "aaa")), which correctly
has ?a as an empty register: (get-register ?a) returns nil.
But `register-preview' and similar, which use
`register-preview-default', which uses `register-describe-oneline', do
the wrong thing. They show empty registers as being full of "Garbage:"
rather than having no content. And they show two occurrences for
register ?a, both with "Garbage:". Instead, they should show zero
occurrences of register ?a.
In short, previewing should use `get-register'. It should respect
alist behavior, recognizing an empty register per `get-register'.
In GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
of 2019-04-13
Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749
Windowing system distributor `Microsoft Corp.', version 10.0.17763
Configured using:
`configure --without-dbus --host=x86_64-w64-mingw32
--without-compress-install 'CFLAGS=-O2 -static -g3'
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37155
; Package
emacs
.
(Fri, 20 Sep 2019 22:20:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 37155 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
> In short, previewing should use `get-register'. It should respect
> alist behavior, recognizing an empty register per `get-register'.
Makes sense. I've now done this on the Emacs trunk.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 20 Sep 2019 22:20:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
37155 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 20 Sep 2019 22:20:03 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 19 Oct 2019 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 245 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.