GNU bug report logs -
#29371
26.0.50; (setf (buffer-modified-p) t) bug
Previous Next
Reported by: Devon Sean McCullough <Emacs-Hacker2017 <at> jovi.net>
Date: Tue, 21 Nov 2017 01:54:02 UTC
Severity: minor
Tags: fixed, patch
Merged with 21201
Found in versions 25.0.50, 26.0.50
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
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 29371 in the body.
You can then email your comments to 29371 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#29371
; Package
emacs
.
(Tue, 21 Nov 2017 01:54:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Devon Sean McCullough <Emacs-Hacker2017 <at> jovi.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 21 Nov 2017 01:54:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
(setf (buffer-modified-p) t) -> (with-current-buffer nil (set-buffer-modified-p t))
which bombs because nil is not a buffer.
Here's a fix:
diff -Bbdu old/cl-lib.el new/cl-lib.el
--- old/cl-lib.el 2017-06-06 16:19:10.000000000 -0400
+++ new/cl-lib.el 2017-11-20 20:08:41.000000000 -0500
@@ -539,7 +539,7 @@
;; Some more Emacs-related place types.
(gv-define-simple-setter buffer-file-name set-visited-file-name t)
(gv-define-setter buffer-modified-p (flag &optional buf)
- `(with-current-buffer ,buf
+ `(with-current-buffer (or ,buf (current-buffer))
(set-buffer-modified-p ,flag)))
(gv-define-simple-setter buffer-name rename-buffer t)
(gv-define-setter buffer-string (store)
Peace
--Devon
P.S. Here's a backtrace:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
set-buffer(nil)
(save-current-buffer (set-buffer nil) (set-buffer-modified-p t))
(with-current-buffer nil (set-buffer-modified-p t))
(setf (buffer-modified-p) t)
eval((setf (buffer-modified-p) t))
command-line-1(("--funcall" "toggle-debug-on-error" "--load" "cl" "--eval" "(setf (buffer-modified-p) t)"))
command-line()
normal-top-level()
P.P.S. We can imagine optimizers
which know (or nil ...) -> (or ...), (or #) -> #
and (with-current-buffer (current-buffer) ...) -> (progn ...)
but this is, after all, simply a text editor.
In GNU Emacs 26.0.50 (build 1, x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))
of 2017-06-07 built on builder10-9.local
Windowing system distributor 'Apple', version 10.3.1404
Recent messages:
Warning: arch-dependent data dir ’/Users/build/workspace/Emacs-Multi-Build/label/mavericks/emacs-source/nextstep/Emacs.app/Contents/MacOS/libexec/’: No such file or directory
For information about GNU Emacs and the GNU system, type C-h C-a.
Debug on Error enabled globally
Entering debugger...
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 ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Debugger
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message subr-x puny seq byte-opt
bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
mml-sec password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode easymenu debug cl gv cl-loaddefs
cl-lib cus-start cus-load time-date tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote kqueue cocoa ns multi-tty make-network-process emacs)
Memory information:
((conses 16 213089 10429)
(symbols 48 21048 2)
(miscs 40 64 182)
(strings 32 20087 5364)
(string-bytes 1 619310)
(vectors 16 35085)
(vector-slots 8 697226 6051)
(floats 8 54 126)
(intervals 56 252 0)
(buffers 976 12))
Merged 21201 29371.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Tue, 21 Nov 2017 01:57:02 GMT)
Full text and
rfc822 format available.
Added tag(s) patch.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Tue, 17 Jul 2018 12:17:03 GMT)
Full text and
rfc822 format available.
Added tag(s) fixed.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Tue, 28 Aug 2018 00:02:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
21201 <at> debbugs.gnu.org and bruce.connor.am <at> gmail.com
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Tue, 28 Aug 2018 00:02: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
.
(Tue, 25 Sep 2018 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 270 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.