Commit f6c951e5 authored by Glenn Morris's avatar Glenn Morris

Small fixes re toggle-read-only, mainly doc

* progmodes/hideif.el (hide-ifdef-mode-submap): Also substitute read-only-mode.

* bindings.el (mode-line-toggle-read-only):
* bs.el (bs-toggle-readonly):
* buff-menu.el (Buffer-menu-toggle-read-only):
* dired.el (dired-toggle-read-only):
* files.el (view-read-only, find-file-read-only)
(find-file-read-only-other-window)
(find-file-read-only-other-frame):
* progmodes/hideif.el (hide-ifdef-toggle-outside-read-only):
Doc fixes re toggle-read-only.

* view.el: Comment updates.
parent c255615a
2014-07-21 Glenn Morris <rgm@gnu.org>
* progmodes/hideif.el (hide-ifdef-mode-submap):
Also substitute read-only-mode.
* bindings.el (mode-line-toggle-read-only):
* bs.el (bs-toggle-readonly):
* buff-menu.el (Buffer-menu-toggle-read-only):
* dired.el (dired-toggle-read-only):
* files.el (view-read-only, find-file-read-only)
(find-file-read-only-other-window)
(find-file-read-only-other-frame):
* progmodes/hideif.el (hide-ifdef-toggle-outside-read-only):
Doc fixes re toggle-read-only.
2014-07-20 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el: Add comment about pipe buffering and
......
......@@ -36,7 +36,7 @@ corresponding to the mode line clicked."
(defun mode-line-toggle-read-only (event)
"Like `toggle-read-only', for the mode-line."
"Like toggling `read-only-mode', for the mode-line."
(interactive "e")
(with-selected-window (posn-window (event-start event))
(read-only-mode 'toggle)))
......
......@@ -954,7 +954,7 @@ Default is `bs--current-sort-function'."
(defun bs-toggle-readonly ()
"Toggle read-only status for buffer on current line.
Uses function `toggle-read-only'."
Uses function `read-only-mode'."
(interactive)
(with-current-buffer (bs--current-buffer)
(read-only-mode 'toggle))
......
......@@ -539,7 +539,7 @@ The current window remains selected."
(defun Buffer-menu-toggle-read-only ()
"Toggle read-only status of buffer on this line.
This behaves like invoking \\[toggle-read-only] in that buffer."
This behaves like invoking \\[read-only-mode] in that buffer."
(interactive)
(let ((read-only
(with-current-buffer (Buffer-menu-buffer t)
......
......@@ -2015,7 +2015,7 @@ Actual changes in files cannot be undone by Emacs."))
"Edit Dired buffer with Wdired, or make it read-only.
If the current buffer can be edited with Wdired, (i.e. the major
mode is `dired-mode'), call `wdired-change-to-wdired-mode'.
Otherwise, call `toggle-read-only'."
Otherwise, toggle `read-only-mode'."
(interactive)
(if (derived-mode-p 'dired-mode)
(wdired-change-to-wdired-mode)
......
......@@ -572,7 +572,7 @@ A value of nil means ignore them; anything else means query."
In fact, this means that all read-only buffers normally have
View mode enabled, including buffers that are read-only because
you visit a file you cannot alter, and buffers you make read-only
using \\[toggle-read-only]."
using \\[read-only-mode]."
:type 'boolean
:group 'view)
......@@ -1517,7 +1517,7 @@ file names with wildcards."
(defun find-file-read-only (filename &optional wildcards)
"Edit file FILENAME but don't allow changes.
Like \\[find-file], but marks buffer as read-only.
Use \\[toggle-read-only] to permit editing."
Use \\[read-only-mode] to permit editing."
(interactive
(find-file-read-args "Find file read-only: "
(confirm-nonexistent-file-or-buffer)))
......@@ -1526,7 +1526,7 @@ Use \\[toggle-read-only] to permit editing."
(defun find-file-read-only-other-window (filename &optional wildcards)
"Edit file FILENAME in another window but don't allow changes.
Like \\[find-file-other-window], but marks buffer as read-only.
Use \\[toggle-read-only] to permit editing."
Use \\[read-only-mode] to permit editing."
(interactive
(find-file-read-args "Find file read-only other window: "
(confirm-nonexistent-file-or-buffer)))
......@@ -1535,7 +1535,7 @@ Use \\[toggle-read-only] to permit editing."
(defun find-file-read-only-other-frame (filename &optional wildcards)
"Edit file FILENAME in another frame but don't allow changes.
Like \\[find-file-other-frame], but marks buffer as read-only.
Use \\[toggle-read-only] to permit editing."
Use \\[read-only-mode] to permit editing."
(interactive
(find-file-read-args "Find file read-only other frame: "
(confirm-nonexistent-file-or-buffer)))
......
......@@ -149,6 +149,9 @@
(define-key map "\C-q" 'hide-ifdef-toggle-read-only)
(define-key map "\C-w" 'hide-ifdef-toggle-shadowing)
(substitute-key-definition
'read-only-mode 'hide-ifdef-toggle-outside-read-only map)
;; `toggle-read-only' is obsoleted by `read-only-mode'.
(substitute-key-definition
'toggle-read-only 'hide-ifdef-toggle-outside-read-only map)
map)
......@@ -1049,7 +1052,7 @@ It does not do the work that's pointless to redo on a recursive entry."
(force-mode-line-update))
(defun hide-ifdef-toggle-outside-read-only ()
"Replacement for `toggle-read-only' within Hide-Ifdef mode."
"Replacement for `read-only-mode' within Hide-Ifdef mode."
(interactive)
(setq hif-outside-read-only (not hif-outside-read-only))
(message "Read only %s"
......
......@@ -491,12 +491,12 @@ Entry to view-mode runs the normal hook `view-mode-hook'."
(defun view--disable ()
(remove-hook 'change-major-mode-hook 'view--disable t)
(and view-overlay (delete-overlay view-overlay))
;; Calling toggle-read-only while View mode is enabled
;; Calling read-only-mode while View mode is enabled
;; sets view-read-only to t as a buffer-local variable
;; after exiting View mode. That arranges that the next toggle-read-only
;; after exiting View mode. That arranges that the next read-only-mode
;; will reenable View mode.
;; Canceling View mode in any other way should cancel that, too,
;; so that View mode stays off if toggle-read-only is called.
;; so that View mode stays off if read-only-mode is called.
(if (local-variable-p 'view-read-only)
(kill-local-variable 'view-read-only))
(if (boundp 'Helper-return-blurb)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment