emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108682: Fix bug #11726 -- send a mes


From: Bastien Guerry
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108682: Fix bug #11726 -- send a message after `toggle-read-only'.
Date: Fri, 22 Jun 2012 16:12:42 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108682
committer: Bastien Guerry <address@hidden>
branch nick: trunk
timestamp: Fri 2012-06-22 16:12:42 +0200
message:
  Fix bug #11726 -- send a message after `toggle-read-only'.
  
  Thanks to Drew Adam for reporting this.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-06-22 13:42:38 +0000
+++ b/lisp/ChangeLog    2012-06-22 14:12:42 +0000
@@ -1,3 +1,8 @@
+2012-06-22  Bastien Guerry  <address@hidden>
+
+       * files.el (toggle-read-only): Display a message telling whether
+       the buffer is read-only or not (bug#11726).
+
 2012-06-22  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/gv.el: New file.

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2012-06-22 13:42:38 +0000
+++ b/lisp/files.el     2012-06-22 14:12:42 +0000
@@ -4857,18 +4857,21 @@
              (not buffer-read-only)))  ; If buffer-read-only is set correctly,
       nil                             ; do nothing.
     ;; Toggle.
-    (cond
-     ((and 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 (not 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))
-     (t (setq buffer-read-only (not buffer-read-only))
-        (force-mode-line-update)))))
+    (progn
+      (cond
+       ((and 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 (not 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))
+       (t (setq buffer-read-only (not buffer-read-only))
+         (force-mode-line-update))))
+    (message "Read-only %s for this buffer"
+            (if buffer-read-only "enabled" "disabled"))))
 
 (defun insert-file (filename)
   "Insert contents of file FILENAME into buffer after point.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]