diff options
| -rw-r--r-- | lisp/emulation/viper-ex.el | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index fc13232739d..f4734d2e1cf 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el | |||
| @@ -752,7 +752,10 @@ reversed.") | |||
| 752 | (set-buffer vip-ex-work-buf) | 752 | (set-buffer vip-ex-work-buf) |
| 753 | (skip-chars-forward " \t") | 753 | (skip-chars-forward " \t") |
| 754 | (if (looking-at "!") | 754 | (if (looking-at "!") |
| 755 | (if (not (vip-looking-back "[ \t]")) | 755 | (if (and (not (vip-looking-back "[ \t]")) |
| 756 | ;; read doesn't have a corresponding :r! form, so ! is | ||
| 757 | ;; immediately interpreted as a shell command. | ||
| 758 | (not (string= ex-token "read"))) | ||
| 756 | (progn | 759 | (progn |
| 757 | (setq ex-variant t) | 760 | (setq ex-variant t) |
| 758 | (forward-char 1) | 761 | (forward-char 1) |
| @@ -1075,7 +1078,7 @@ reversed.") | |||
| 1075 | (if buffer-file-name | 1078 | (if buffer-file-name |
| 1076 | (cond ((buffer-modified-p) | 1079 | (cond ((buffer-modified-p) |
| 1077 | (setq msg | 1080 | (setq msg |
| 1078 | (format "Buffer %s is modified. Edit buffer? " | 1081 | (format "Buffer %s is modified. Discard changes? " |
| 1079 | (buffer-name)) | 1082 | (buffer-name)) |
| 1080 | do-edit t)) | 1083 | do-edit t)) |
| 1081 | ((not (verify-visited-file-modtime (current-buffer))) | 1084 | ((not (verify-visited-file-modtime (current-buffer))) |
| @@ -1785,9 +1788,17 @@ Please contact your system administrator. " | |||
| 1785 | (setq writing-whole-file (and (= (point-min) beg) (= (point-max) end)) | 1788 | (setq writing-whole-file (and (= (point-min) beg) (= (point-max) end)) |
| 1786 | ex-file (if (string= ex-file "") | 1789 | ex-file (if (string= ex-file "") |
| 1787 | (buffer-file-name) | 1790 | (buffer-file-name) |
| 1788 | (expand-file-name ex-file)) | 1791 | (expand-file-name ex-file))) |
| 1789 | file-exists (file-exists-p ex-file) | 1792 | ;; if ex-file is a directory use the file portion of the buffer file name |
| 1793 | (if (and (file-directory-p ex-file) | ||
| 1794 | buffer-file-name | ||
| 1795 | (not (file-directory-p buffer-file-name))) | ||
| 1796 | (setq ex-file | ||
| 1797 | (concat ex-file (file-name-nondirectory buffer-file-name)))) | ||
| 1798 | |||
| 1799 | (setq file-exists (file-exists-p ex-file) | ||
| 1790 | writing-same-file (string= ex-file (buffer-file-name))) | 1800 | writing-same-file (string= ex-file (buffer-file-name))) |
| 1801 | |||
| 1791 | (if (and writing-whole-file writing-same-file) | 1802 | (if (and writing-whole-file writing-same-file) |
| 1792 | (if (not (buffer-modified-p)) | 1803 | (if (not (buffer-modified-p)) |
| 1793 | (message "(No changes need to be saved)") | 1804 | (message "(No changes need to be saved)") |
| @@ -1819,8 +1830,8 @@ Please contact your system administrator. " | |||
| 1819 | (set-buffer temp-buf) | 1830 | (set-buffer temp-buf) |
| 1820 | (set-buffer-modified-p nil) | 1831 | (set-buffer-modified-p nil) |
| 1821 | (kill-buffer temp-buf) | 1832 | (kill-buffer temp-buf) |
| 1822 | ) | 1833 | )) |
| 1823 | )) | 1834 | ) |
| 1824 | ;; this prevents the loss of data if writing part of the buffer | 1835 | ;; this prevents the loss of data if writing part of the buffer |
| 1825 | (if (and (buffer-file-name) writing-same-file) | 1836 | (if (and (buffer-file-name) writing-same-file) |
| 1826 | (set-visited-file-modtime)) | 1837 | (set-visited-file-modtime)) |