diff options
| author | Chong Yidong <cyd@gnu.org> | 2012-07-13 15:06:09 +0800 |
|---|---|---|
| committer | Chong Yidong <cyd@gnu.org> | 2012-07-13 15:06:09 +0800 |
| commit | b68b33375caeb82a4b3418d43c75bc8ccd43633a (patch) | |
| tree | 2e14569d03369d1de85cfd81bb5a404373ec1245 /lisp/ffap.el | |
| parent | 1a95276708930fe579fff152c590df875c29570e (diff) | |
| download | emacs-b68b33375caeb82a4b3418d43c75bc8ccd43633a.tar.gz | |
Don't warn on toggle-read-only calls.
Clarify the documentation of toggle-read-only, and audit the code tree
for uses of toggle-read-only; where appropriate, switch to setting the
variable buffer-read-only or calling toggle-read-only with a (new)
second arg.
* lisp/files.el (toggle-read-only): Doc fix and code cleanup. New arg
to allow printing the message when called from Lisp.
* lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
Remove toggle-read-only.
* lisp/bindings.el (mode-line-toggle-read-only):
* lisp/dired.el (dired-toggle-read-only):
* lisp/ibuffer.el (ibuffer-do-toggle-read-only): Call toggle-read-only
with non-nil second arg.
* lisp/bs.el (bs-toggle-readonly):
* lisp/buff-menu.el (Buffer-menu-toggle-read-only): Remove
with-no-warnings around toggle-read-only.
* lisp/ffap.el (ffap--toggle-read-only): Accept a list of buffers.
Remove with-no-warnings around toggle-read-only.
(ffap-read-only, ffap-read-only-other-window)
(ffap-read-only-other-frame): Callers changed.
* lisp/help-mode.el: Don't require view package.
(help-mode-finish): Set buffer-read-only instead of calling
toggle-read-only.
* lisp/emacs-lisp/eieio-custom.el (eieio-customize-object):
* lisp/vc/ediff.el (ediff-set-read-only-in-buf-A): Set buffer-read-only
directly.
* lisp/gnus/smime.el (smime-certificate-info): Set buffer-read-only directly,
instead of calling toggle-read-only with a (bogus) argument.
* doc/emacs/buffers.texi (Misc Buffer): Document view-read-only.
* doc/lispref/buffers.texi (Read Only Buffers): Document toggle-read-only
changes. Reword to account for the fact that read-only is currently not
supported in overlay properties.
Diffstat (limited to 'lisp/ffap.el')
| -rw-r--r-- | lisp/ffap.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el index a8455189cb9..3d1f402ab6c 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1698,9 +1698,11 @@ Only intended for interactive use." (set-window-dedicated-p win wdp)) value)) -(defun ffap--toggle-read-only (buffer) - (with-current-buffer buffer - (with-no-warnings +(defun ffap--toggle-read-only (buffer-or-list) + (dolist (buffer (if (listp buffer-or-list) + buffer-or-list + (list buffer-or-list))) + (with-current-buffer buffer (toggle-read-only 1)))) (defun ffap-read-only () @@ -1710,8 +1712,7 @@ Only intended for interactive use." (let ((value (call-interactively 'ffap))) (unless (or (bufferp value) (bufferp (car-safe value))) (setq value (current-buffer))) - (mapc #'ffap--toggle-read-only - (if (listp value) value (list value))) + (ffap--toggle-read-only value) value)) (defun ffap-read-only-other-window () @@ -1719,8 +1720,7 @@ Only intended for interactive use." Only intended for interactive use." (interactive) (let ((value (ffap-other-window))) - (mapc #'ffap--toggle-read-only - (if (listp value) value (list value))) + (ffap--toggle-read-only value) value)) (defun ffap-read-only-other-frame () @@ -1728,8 +1728,7 @@ Only intended for interactive use." Only intended for interactive use." (interactive) (let ((value (ffap-other-frame))) - (mapc #'ffap--toggle-read-only - (if (listp value) value (list value))) + (ffap--toggle-read-only value) value)) (defun ffap-alternate-file () |
