GNU bug report logs -
#48294
Use 'with-current-buffer' byte-compiler warning seems wrong
Previous Next
Reported by: rswgnu <at> gmail.com
Date: Sat, 8 May 2021 20:15:01 UTC
Severity: normal
Tags: notabug
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi:
I get a lot of these byte-compile warnings in my Elisp code:
hbut.el:683:26:Warning: Use ‘with-current-buffer’ rather than
save-excursion+set-buffer
but since with-current-buffer does not save the value of point, it is
not a valid substitute for save-excursion and should not be suggested.
Evaluate the two samples below and you will see that they are not
equivalent. If I am correct, I'd like this suggestion disabled. Thanks.
-- rsw
(save-excursion
(set-buffer (current-buffer))
(forward-char 20))
(with-current-buffer (current-buffer)
(forward-char 20))
------
In GNU Emacs 27.1.90 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60
Version 10.14.6 (Build 18G95))
of 2020-12-18 built on builder10-14.porkrind.org
Windowing system distributor 'Apple', version 10.3.1894
System Description: Mac OS X 10.15.7
Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules'
Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS JSON PDUMPER
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
[Message part 2 (text/html, inline)]
This bug report was last modified 4 years and 69 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.