summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-07-16 22:14:32 -0400
committerNoam Postavsky <npostavs@gmail.com>2018-08-27 18:54:23 -0400
commitc8b86362d45a07e0aec0041cade551c3c663ea8c (patch)
tree8a864ed38ddc58d516dfb09039a4d7bc33e2256c /lisp/emacs-lisp
parent66bf12b6a1777d8dd09f8ddcefe96314555d0134 (diff)
downloademacs-c8b86362d45a07e0aec0041cade551c3c663ea8c.tar.gz
emacs-c8b86362d45a07e0aec0041cade551c3c663ea8c.tar.bz2
emacs-c8b86362d45a07e0aec0041cade551c3c663ea8c.zip
Allow setf of buffer-modified-p without argument (Bug#21201)
* lisp/emacs-lisp/cl-lib.el (setf buffer-modified-p): Take current buffer if optional argument BUF is not passed.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-lib.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index d7e72ce99a3..592235d2de0 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -531,8 +531,9 @@ If ALIST is non-nil, the new pairs are prepended to it."
;; 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
- (set-buffer-modified-p ,flag)))
+ (macroexp-let2 nil buffer `(or ,buf (current-buffer))
+ `(with-current-buffer ,buffer
+ (set-buffer-modified-p ,flag))))
(gv-define-simple-setter buffer-name rename-buffer t)
(gv-define-setter buffer-string (store)
`(insert (prog1 ,store (erase-buffer))))