diff options
| author | Glenn Morris | 2014-07-25 05:37:07 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-07-25 05:37:07 -0400 |
| commit | b61f5e45ec143ca7fb7003c55adae779c7db7965 (patch) | |
| tree | abcaf4345adc16cf62dc83ac81dfb2fb55b34e38 | |
| parent | c3dfb46e1c4ee289c0c2b8f6454aba3480e8f1de (diff) | |
| download | emacs-b61f5e45ec143ca7fb7003c55adae779c7db7965.tar.gz emacs-b61f5e45ec143ca7fb7003c55adae779c7db7965.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/vc/ediff-init.el | 2 | ||||
| -rw-r--r-- | lisp/vc/ediff-util.el | 10 |
3 files changed, 12 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5024dadcad9..c977581df1a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-07-25 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * vc/ediff-init.el (ediff-toggle-read-only-function): | ||
| 4 | * vc/ediff-util.el (ediff-toggle-read-only): | ||
| 5 | Replace obsolete toggle-read-only with read-only-mode. | ||
| 6 | |||
| 1 | 2014-07-24 Michael Albinus <michael.albinus@gmx.de> | 7 | 2014-07-24 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 8 | ||
| 3 | * net/tramp-cache.el (tramp-flush-file-function): Wrap the code | 9 | * net/tramp-cache.el (tramp-flush-file-function): Wrap the code |
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index af45acd3c37..589ea454965 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el | |||
| @@ -1346,7 +1346,7 @@ this variable represents.") | |||
| 1346 | (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil | 1346 | (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil |
| 1347 | "Overlay for the current difference region in the ancestor buffer.") | 1347 | "Overlay for the current difference region in the ancestor buffer.") |
| 1348 | 1348 | ||
| 1349 | (defvar ediff-toggle-read-only-function 'toggle-read-only | 1349 | (defvar ediff-toggle-read-only-function 'read-only-mode |
| 1350 | "Function to be used to toggle read-only status of the buffer. | 1350 | "Function to be used to toggle read-only status of the buffer. |
| 1351 | If nil, Ediff tries using the command bound to C-x C-q.") | 1351 | If nil, Ediff tries using the command bound to C-x C-q.") |
| 1352 | 1352 | ||
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index dbf52479527..9ca9effbfd4 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el | |||
| @@ -1027,8 +1027,8 @@ of the current buffer." | |||
| 1027 | (file-writable-p file))) | 1027 | (file-writable-p file))) |
| 1028 | (toggle-ro-cmd (cond (ediff-toggle-read-only-function) | 1028 | (toggle-ro-cmd (cond (ediff-toggle-read-only-function) |
| 1029 | ((ediff-file-checked-out-p file) | 1029 | ((ediff-file-checked-out-p file) |
| 1030 | 'toggle-read-only) | 1030 | 'read-only-mode) |
| 1031 | (file-writable 'toggle-read-only) | 1031 | (file-writable 'read-only-mode) |
| 1032 | (t (key-binding "\C-x\C-q"))))) | 1032 | (t (key-binding "\C-x\C-q"))))) |
| 1033 | ;; If the file is checked in, make sure we don't make buffer modifiable | 1033 | ;; If the file is checked in, make sure we don't make buffer modifiable |
| 1034 | ;; without warning the user. The user can fool our checks by making the | 1034 | ;; without warning the user. The user can fool our checks by making the |
| @@ -1039,7 +1039,7 @@ of the current buffer." | |||
| 1039 | ;; non-interactively, in which case don't ask questions | 1039 | ;; non-interactively, in which case don't ask questions |
| 1040 | ctl-buf) | 1040 | ctl-buf) |
| 1041 | (cond ((not buffer-read-only) | 1041 | (cond ((not buffer-read-only) |
| 1042 | (setq toggle-ro-cmd 'toggle-read-only)) | 1042 | (setq toggle-ro-cmd 'read-only-mode)) |
| 1043 | ((and (or (beep 1) t) ; always beep | 1043 | ((and (or (beep 1) t) ; always beep |
| 1044 | (y-or-n-p | 1044 | (y-or-n-p |
| 1045 | (format | 1045 | (format |
| @@ -1054,13 +1054,13 @@ of the current buffer." | |||
| 1054 | (ediff-change-saved-variable | 1054 | (ediff-change-saved-variable |
| 1055 | 'buffer-read-only nil buf-type))) | 1055 | 'buffer-read-only nil buf-type))) |
| 1056 | (t | 1056 | (t |
| 1057 | (setq toggle-ro-cmd 'toggle-read-only) | 1057 | (setq toggle-ro-cmd 'read-only-mode) |
| 1058 | (beep 1) (beep 1) | 1058 | (beep 1) (beep 1) |
| 1059 | (message | 1059 | (message |
| 1060 | "Boy, this is risky! Don't modify this file...") | 1060 | "Boy, this is risky! Don't modify this file...") |
| 1061 | (sit-for 3)))) ; let the user see the warning | 1061 | (sit-for 3)))) ; let the user see the warning |
| 1062 | (if (and toggle-ro-cmd | 1062 | (if (and toggle-ro-cmd |
| 1063 | (string-match "toggle-read-only" (symbol-name toggle-ro-cmd))) | 1063 | (string-match "read-only-mode" (symbol-name toggle-ro-cmd))) |
| 1064 | (save-excursion | 1064 | (save-excursion |
| 1065 | (save-window-excursion | 1065 | (save-window-excursion |
| 1066 | (select-window (ediff-get-visible-buffer-window buf)) | 1066 | (select-window (ediff-get-visible-buffer-window buf)) |