aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Kifer2006-12-23 21:33:50 +0000
committerMichael Kifer2006-12-23 21:33:50 +0000
commitc6a85d16a518115ac85e04d5b606961d438ced75 (patch)
tree080c76b62122a5892ce1f2a93bec2fdcf7333ac2 /lisp
parent4c1f8269661a0de955c116d221857059cfa882ef (diff)
downloademacs-c6a85d16a518115ac85e04d5b606961d438ced75.tar.gz
emacs-c6a85d16a518115ac85e04d5b606961d438ced75.zip
2006-12-23 Michael Kifer <kifer@cs.stonybrook.edu>
* ediff-diff.el (ediff-diff-options): clarify docstring. (ediff-setup-diff-regions): disallow -u in ediff-diff-options. * viper-cmd.el (viper-post-command-sentinel): protect against errors in hooks. (viper-add-newline-at-eob-if-necessary): add newline only if we actually modify buffer; ignore errors if occur.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ediff-diff.el16
-rw-r--r--lisp/emulation/viper-cmd.el16
2 files changed, 22 insertions, 10 deletions
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index 7786326bea9..34a1ceda254 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -133,9 +133,13 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
133(defcustom ediff-diff-options "" 133(defcustom ediff-diff-options ""
134 "*Options to pass to `ediff-diff-program'. 134 "*Options to pass to `ediff-diff-program'.
135If Unix diff is used as `ediff-diff-program', 135If Unix diff is used as `ediff-diff-program',
136 then a useful option is `-w', to ignore space. 136then a useful option is `-w', to ignore space.
137Options `-c' and `-i' are not allowed. Case sensitivity can be 137Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be
138 toggled interactively using \\[ediff-toggle-ignore-case]." 138toggled interactively using \\[ediff-toggle-ignore-case].
139
140This variable is not for customizing the look of the differences produced by
141the command \\[ediff-show-diff-output]. Use the variable
142`ediff-custom-diff-options' for that."
139 :set 'ediff-reset-diff-options 143 :set 'ediff-reset-diff-options
140 :type 'string 144 :type 'string
141 :group 'ediff-diff) 145 :group 'ediff-diff)
@@ -254,10 +258,10 @@ one optional arguments, diff-number to refine.")
254;; ediff-setup-diff-regions-function, which can also have the value 258;; ediff-setup-diff-regions-function, which can also have the value
255;; ediff-setup-diff-regions3, which takes 4 arguments. 259;; ediff-setup-diff-regions3, which takes 4 arguments.
256(defun ediff-setup-diff-regions (file-A file-B file-C) 260(defun ediff-setup-diff-regions (file-A file-B file-C)
257 ;; looking for '-c', '-i', or a 'c', 'i' among clustered non-long options 261 ;; looking for '-c', '-i', '-u', or 'c', 'i', 'u' among clustered non-long options
258 (if (string-match "^-[ci]\\| -[ci]\\|\\(^\\| \\)-[^- ]+[ci]" 262 (if (string-match "^-[ciu]\\| -[ciu]\\|\\(^\\| \\)-[^- ]+[ciu]"
259 ediff-diff-options) 263 ediff-diff-options)
260 (error "Options `-c' and `-i' are not allowed in `ediff-diff-options'")) 264 (error "Options `-c', `-u', and `-i' are not allowed in `ediff-diff-options'"))
261 265
262 ;; create, if it doesn't exist 266 ;; create, if it doesn't exist
263 (or (ediff-buffer-live-p ediff-diff-buffer) 267 (or (ediff-buffer-live-p ediff-diff-buffer)
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index ac3ef55d6e4..d3dae72d13e 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -171,7 +171,9 @@
171 (run-hook-with-args 'viper-before-change-functions beg end)) 171 (run-hook-with-args 'viper-before-change-functions beg end))
172 172
173(defsubst viper-post-command-sentinel () 173(defsubst viper-post-command-sentinel ()
174 (run-hooks 'viper-post-command-hooks) 174 (condition-case conds
175 (run-hooks 'viper-post-command-hooks)
176 (error (viper-message-conditions conds)))
175 (if (eq viper-current-state 'vi-state) 177 (if (eq viper-current-state 'vi-state)
176 (viper-restore-cursor-color 'after-insert-mode))) 178 (viper-restore-cursor-color 'after-insert-mode)))
177 179
@@ -926,8 +928,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
926 928
927 (condition-case nil 929 (condition-case nil
928 (let (viper-vi-kbd-minor-mode) ; execute without kbd macros 930 (let (viper-vi-kbd-minor-mode) ; execute without kbd macros
929 (setq result (eval form)) 931 (setq result (eval form)))
930 )
931 (error 932 (error
932 (signal 'quit nil))) 933 (signal 'quit nil)))
933 934
@@ -1971,9 +1972,16 @@ Undo previous insertion and inserts new."
1971 (if (and (eobp) 1972 (if (and (eobp)
1972 (not (bolp)) 1973 (not (bolp))
1973 require-final-newline 1974 require-final-newline
1975 ;; add newline only if we actually edited buffer. otherwise it
1976 ;; might unintentionally modify binary buffers
1977 (buffer-modified-p)
1974 (not (viper-is-in-minibuffer)) 1978 (not (viper-is-in-minibuffer))
1975 (not buffer-read-only)) 1979 (not buffer-read-only))
1976 (insert "\n"))) 1980 ;; text property may be read-only
1981 (condition-case nil
1982 (insert "\n")
1983 (error nil))
1984 ))
1977 )) 1985 ))
1978 1986
1979(defun viper-yank-defun () 1987(defun viper-yank-defun ()