]> git.eshelyaron.com Git - emacs.git/commitdiff
2006-12-23 Michael Kifer <kifer@cs.stonybrook.edu>
authorMichael Kifer <kifer@cs.stonybrook.edu>
Sat, 23 Dec 2006 21:33:50 +0000 (21:33 +0000)
committerMichael Kifer <kifer@cs.stonybrook.edu>
Sat, 23 Dec 2006 21:33:50 +0000 (21:33 +0000)
* 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.

ChangeLog
lisp/ediff-diff.el
lisp/emulation/viper-cmd.el

index 222a92f21c97df0b92516a7a34d01746e370f82a..8ab7dbadd2298ac0c47b28aba5a936f035396973 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
+       
 2006-12-22  Mark Davies  <mark@mcs.vuw.ac.nz>
 
        * configure.in: Add support for NetBSD on x86-64, hp800 and sh3el.
index 7786326bea971e78a5b4ef6e4fb35faac1a882ee..34a1ceda2541f4b9add6fb9a2e5faee18c830954 100644 (file)
@@ -133,9 +133,13 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
 (defcustom ediff-diff-options ""
   "*Options to pass to `ediff-diff-program'.
 If Unix diff is used as `ediff-diff-program',
- then a useful option is `-w', to ignore space.
-Options `-c' and `-i' are not allowed. Case sensitivity can be
- toggled interactively using \\[ediff-toggle-ignore-case]."
+then a useful option is `-w', to ignore space.
+Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be
+toggled interactively using \\[ediff-toggle-ignore-case].
+
+This variable is not for customizing the look of the differences produced by
+the command \\[ediff-show-diff-output]. Use the variable 
+`ediff-custom-diff-options' for that."
   :set 'ediff-reset-diff-options
   :type 'string
   :group 'ediff-diff)
@@ -254,10 +258,10 @@ one optional arguments, diff-number to refine.")
 ;; ediff-setup-diff-regions-function, which can also have the value
 ;; ediff-setup-diff-regions3, which takes 4 arguments.
 (defun ediff-setup-diff-regions (file-A file-B file-C)
-  ;; looking for '-c', '-i', or a 'c', 'i' among clustered non-long options
-  (if (string-match "^-[ci]\\| -[ci]\\|\\(^\\| \\)-[^- ]+[ci]"
+  ;; looking for '-c', '-i', '-u', or 'c', 'i', 'u' among clustered non-long options
+  (if (string-match "^-[ciu]\\| -[ciu]\\|\\(^\\| \\)-[^- ]+[ciu]"
                    ediff-diff-options)
-      (error "Options `-c' and `-i' are not allowed in `ediff-diff-options'"))
+      (error "Options `-c', `-u', and `-i' are not allowed in `ediff-diff-options'"))
 
   ;; create, if it doesn't exist
   (or (ediff-buffer-live-p ediff-diff-buffer)
index ac3ef55d6e45af78285b83208c5e7808ef2a1977..d3dae72d13e1ad061aae29e88e12cb39965473fa 100644 (file)
   (run-hook-with-args 'viper-before-change-functions beg end))
 
 (defsubst viper-post-command-sentinel ()
-  (run-hooks 'viper-post-command-hooks)
+  (condition-case conds
+      (run-hooks 'viper-post-command-hooks)
+    (error (viper-message-conditions conds)))
   (if (eq viper-current-state 'vi-state)
       (viper-restore-cursor-color 'after-insert-mode)))
 
@@ -926,8 +928,7 @@ Vi's prefix argument will be used.  Otherwise, the prefix argument passed to
 
     (condition-case nil
        (let (viper-vi-kbd-minor-mode) ; execute without kbd macros
-         (setq result (eval form))
-         )
+         (setq result (eval form)))
       (error
        (signal 'quit nil)))
 
@@ -1971,9 +1972,16 @@ Undo previous insertion and inserts new."
        (if (and (eobp)
                 (not (bolp))
                 require-final-newline
+                ;; add newline only if we actually edited buffer. otherwise it
+                ;; might unintentionally modify binary buffers
+                (buffer-modified-p) 
                 (not (viper-is-in-minibuffer))
                 (not buffer-read-only))
-           (insert "\n")))
+           ;; text property may be read-only
+           (condition-case nil
+               (insert "\n")
+             (error nil))
+         ))
       ))
 
 (defun viper-yank-defun ()