Commit b61f5e45 authored by Glenn Morris's avatar Glenn Morris
Browse files

ediff: Replace obsolete toggle-read-only with read-only-mode

* lisp/vc/ediff-init.el (ediff-toggle-read-only-function):
* lisp/vc/ediff-util.el (ediff-toggle-read-only):
Replace obsolete toggle-read-only with read-only-mode.
parent c3dfb46e
2014-07-25 Glenn Morris <rgm@gnu.org>
* vc/ediff-init.el (ediff-toggle-read-only-function):
* vc/ediff-util.el (ediff-toggle-read-only):
Replace obsolete toggle-read-only with read-only-mode.
2014-07-24 Michael Albinus <michael.albinus@gmx.de> 2014-07-24 Michael Albinus <michael.albinus@gmx.de>
   
* net/tramp-cache.el (tramp-flush-file-function): Wrap the code * net/tramp-cache.el (tramp-flush-file-function): Wrap the code
......
...@@ -1346,7 +1346,7 @@ this variable represents.") ...@@ -1346,7 +1346,7 @@ this variable represents.")
(ediff-defvar-local ediff-current-diff-overlay-Ancestor nil (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
"Overlay for the current difference region in the ancestor buffer.") "Overlay for the current difference region in the ancestor buffer.")
(defvar ediff-toggle-read-only-function 'toggle-read-only (defvar ediff-toggle-read-only-function 'read-only-mode
"Function to be used to toggle read-only status of the buffer. "Function to be used to toggle read-only status of the buffer.
If nil, Ediff tries using the command bound to C-x C-q.") If nil, Ediff tries using the command bound to C-x C-q.")
......
...@@ -1027,8 +1027,8 @@ of the current buffer." ...@@ -1027,8 +1027,8 @@ of the current buffer."
(file-writable-p file))) (file-writable-p file)))
(toggle-ro-cmd (cond (ediff-toggle-read-only-function) (toggle-ro-cmd (cond (ediff-toggle-read-only-function)
((ediff-file-checked-out-p file) ((ediff-file-checked-out-p file)
'toggle-read-only) 'read-only-mode)
(file-writable 'toggle-read-only) (file-writable 'read-only-mode)
(t (key-binding "\C-x\C-q"))))) (t (key-binding "\C-x\C-q")))))
;; If the file is checked in, make sure we don't make buffer modifiable ;; If the file is checked in, make sure we don't make buffer modifiable
;; without warning the user. The user can fool our checks by making the ;; without warning the user. The user can fool our checks by making the
...@@ -1039,7 +1039,7 @@ of the current buffer." ...@@ -1039,7 +1039,7 @@ of the current buffer."
;; non-interactively, in which case don't ask questions ;; non-interactively, in which case don't ask questions
ctl-buf) ctl-buf)
(cond ((not buffer-read-only) (cond ((not buffer-read-only)
(setq toggle-ro-cmd 'toggle-read-only)) (setq toggle-ro-cmd 'read-only-mode))
((and (or (beep 1) t) ; always beep ((and (or (beep 1) t) ; always beep
(y-or-n-p (y-or-n-p
(format (format
...@@ -1054,13 +1054,13 @@ of the current buffer." ...@@ -1054,13 +1054,13 @@ of the current buffer."
(ediff-change-saved-variable (ediff-change-saved-variable
'buffer-read-only nil buf-type))) 'buffer-read-only nil buf-type)))
(t (t
(setq toggle-ro-cmd 'toggle-read-only) (setq toggle-ro-cmd 'read-only-mode)
(beep 1) (beep 1) (beep 1) (beep 1)
(message (message
"Boy, this is risky! Don't modify this file...") "Boy, this is risky! Don't modify this file...")
(sit-for 3)))) ; let the user see the warning (sit-for 3)))) ; let the user see the warning
(if (and toggle-ro-cmd (if (and toggle-ro-cmd
(string-match "toggle-read-only" (symbol-name toggle-ro-cmd))) (string-match "read-only-mode" (symbol-name toggle-ro-cmd)))
(save-excursion (save-excursion
(save-window-excursion (save-window-excursion
(select-window (ediff-get-visible-buffer-window buf)) (select-window (ediff-get-visible-buffer-window buf))
......
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