[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r109812: * lisp/simple.el (read-only-
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r109812: * lisp/simple.el (read-only-mode): Move from lisp/files.el for bootstrapping. |
Date: |
Wed, 29 Aug 2012 13:36:49 -0400 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 109812
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2012-08-29 13:36:49 -0400
message:
* lisp/simple.el (read-only-mode): Move from lisp/files.el for bootstrapping.
* files.el (read-only-mode): Move to simple.el.
modified:
lisp/ChangeLog
lisp/files.el
lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-08-29 15:11:51 +0000
+++ b/lisp/ChangeLog 2012-08-29 17:36:49 +0000
@@ -1,5 +1,8 @@
2012-08-29 Stefan Monnier <address@hidden>
+ * simple.el (read-only-mode): Move from files.el for bootstrapping.
+ * files.el (read-only-mode): Move to simple.el.
+
* files.el (read-only-mode): New minor mode.
(toggle-read-only): Use it and mark obsolete.
(find-file--read-only):
=== modified file 'lisp/files.el'
--- a/lisp/files.el 2012-08-29 15:11:51 +0000
+++ b/lisp/files.el 2012-08-29 17:36:49 +0000
@@ -4818,32 +4818,6 @@
"Modification-flag cleared"))
(set-buffer-modified-p arg))
-(define-minor-mode read-only-mode
- "Change whether the current buffer is read-only.
-With prefix argument ARG, make the buffer read-only if ARG is
-positive, otherwise make it writable. If buffer is read-only
-and `view-read-only' is non-nil, enter view mode.
-
-Do not call this from a Lisp program unless you really intend to
-do the same thing as the \\[toggle-read-only] command, including
-possibly enabling or disabling View mode. Also, note that this
-command works by setting the variable `buffer-read-only', which
-does not affect read-only regions caused by text properties. To
-ignore read-only status in a Lisp program (whether due to text
-properties or buffer state), bind `inhibit-read-only' temporarily
-to a non-nil value."
- :variable buffer-read-only
- (cond
- ((and (not buffer-read-only) view-mode)
- (View-exit-and-edit)
- (make-local-variable 'view-read-only)
- (setq view-read-only t)) ; Must leave view mode.
- ((and buffer-read-only view-read-only
- ;; If view-mode is already active, `view-mode-enter' is a nop.
- (not view-mode)
- (not (eq (get major-mode 'mode-class) 'special)))
- (view-mode-enter))))
-
(defun toggle-read-only (&optional arg interactive)
(declare (obsolete read-only-mode "24.3"))
(interactive (list current-prefix-arg t))
=== modified file 'lisp/simple.el'
--- a/lisp/simple.el 2012-08-18 05:11:38 +0000
+++ b/lisp/simple.el 2012-08-29 17:36:49 +0000
@@ -6961,6 +6961,32 @@
(defvar vis-mode-saved-buffer-invisibility-spec nil
"Saved value of `buffer-invisibility-spec' when Visible mode is on.")
+(define-minor-mode read-only-mode
+ "Change whether the current buffer is read-only.
+With prefix argument ARG, make the buffer read-only if ARG is
+positive, otherwise make it writable. If buffer is read-only
+and `view-read-only' is non-nil, enter view mode.
+
+Do not call this from a Lisp program unless you really intend to
+do the same thing as the \\[toggle-read-only] command, including
+possibly enabling or disabling View mode. Also, note that this
+command works by setting the variable `buffer-read-only', which
+does not affect read-only regions caused by text properties. To
+ignore read-only status in a Lisp program (whether due to text
+properties or buffer state), bind `inhibit-read-only' temporarily
+to a non-nil value."
+ :variable buffer-read-only
+ (cond
+ ((and (not buffer-read-only) view-mode)
+ (View-exit-and-edit)
+ (make-local-variable 'view-read-only)
+ (setq view-read-only t)) ; Must leave view mode.
+ ((and buffer-read-only view-read-only
+ ;; If view-mode is already active, `view-mode-enter' is a nop.
+ (not view-mode)
+ (not (eq (get major-mode 'mode-class) 'special)))
+ (view-mode-enter))))
+
(define-minor-mode visible-mode
"Toggle making all invisible text temporarily visible (Visible mode).
With a prefix argument ARG, enable Visible mode if ARG is
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r109812: * lisp/simple.el (read-only-mode): Move from lisp/files.el for bootstrapping.,
Stefan Monnier <=