Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove use of `toggle-read-only' in elisp

The recommended way to make a buffer read-only from elisp is to set
`buffer-read-only' to non-nil. For making temporary edits to the buffer, setting
`inhibit-read-only' to non-nil overrides the read-only status of the buffer.
  • Loading branch information...
commit 165a4d8226e6835b6d43b92e9839e6f43cce8f42 1 parent fdb3f2b
@haxney haxney authored committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 smex.el
View
8 smex.el
@@ -468,9 +468,11 @@ sorted by frequency of use."
command-item))
smex-data))))
(view-buffer-other-window "*Smex: Unbound Commands*")
- (toggle-read-only nil)
- (erase-buffer)
- (ido-pp 'unbound-commands)
+ (setq buffer-read-only t)
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (ido-pp 'unbound-commands))
+ (set-buffer-modified-p nil)
(goto-char (point-min))))
(provide 'smex)
Please sign in to comment.
Something went wrong with that request. Please try again.