]> git.eshelyaron.com Git - emacs.git/commitdiff
2009-08-15 Michael Kifer <kifer@cs.stonybrook.edu>
authorMichael Kifer <kifer@cs.stonybrook.edu>
Sat, 15 Aug 2009 05:57:08 +0000 (05:57 +0000)
committerMichael Kifer <kifer@cs.stonybrook.edu>
Sat, 15 Aug 2009 05:57:08 +0000 (05:57 +0000)
* viper-cmd.el (viper-insert-isearch-string): new function.
(viper-if-string): redefine C-s in the minibuffer to insert the last
incremental search string.

* ediff-init.el (ediff-coding-system): use escape-quoted in case of
XEmacs.

* ediff-merg.el (ediff-merge-region-is-non-clash-to-skip,
ediff-merge-region-is-non-clash,
ediff-skip-merge-region-if-changed-from-default-p): use defun.
Also check if the job is really a merge job.

* ediff.el (ediff-current-file): new function.

lisp/ChangeLog
lisp/ediff-init.el
lisp/ediff-merg.el
lisp/ediff.el
lisp/emulation/viper-cmd.el
lisp/emulation/viper.el

index dbef38f6fc9214ae92d398b16e1876a6a56a41c8..0be3871d1f0252f740f92c35ab22491019b2a453 100644 (file)
@@ -1,3 +1,19 @@
+2009-08-15  Michael Kifer  <kifer@cs.stonybrook.edu>
+       
+       * viper-cmd.el (viper-insert-isearch-string): new function.
+       (viper-if-string): redefine C-s in the minibuffer to insert the last
+       incremental search string.
+       
+       * ediff-init.el (ediff-coding-system): use escape-quoted in case of
+       XEmacs.
+       
+       * ediff-merg.el (ediff-merge-region-is-non-clash-to-skip,
+       ediff-merge-region-is-non-clash,
+       ediff-skip-merge-region-if-changed-from-default-p): use defun.
+       Also check if the job is really a merge job.
+       
+       * ediff.el (ediff-current-file): new function.
+       
 2009-08-15  Chong Yidong  <cyd@stupidchicken.com>
 
        * progmodes/js.el: Edit docstrings throughout to follow Emacs
index 4b637dca179a1886b8358731620cb3a88294e237..d58008f9d12f64a2e0ed8ab7fe819f70cea4eb04 100644 (file)
@@ -727,7 +727,9 @@ work."
   :type 'symbol
   :group 'ediff)
 
-(defcustom ediff-coding-system-for-write 'emacs-internal
+(defcustom ediff-coding-system-for-write (if (featurep 'xemacs)
+                                            'escape-quoted
+                                          'emacs-internal)
   "The coding system for write to use when writing out difference regions
 to temp files in buffer jobs and when Ediff needs to find fine differences."
   :type 'symbol
index 35ea4348d0e98aee5585d78af594fc3d9dd4cb70..ca90e0923f01579c316ac8e192f2126b06e45279 100644 (file)
@@ -97,23 +97,25 @@ Buffer B."
 
 ;; check if there is no clash between the ancestor and one of the variants.
 ;; if it is not a merge job then return true
-(defsubst ediff-merge-region-is-non-clash (n)
+(defun ediff-merge-region-is-non-clash (n)
   (if (ediff-merge-job)
       (string-match "prefer" (or (ediff-get-state-of-merge n) ""))
     t))
 
 ;; If ediff-show-clashes-only, check if there is no clash between the ancestor
 ;; and one of the variants.
-(defsubst ediff-merge-region-is-non-clash-to-skip (n)
-  (and ediff-show-clashes-only
+(defun ediff-merge-region-is-non-clash-to-skip (n)
+  (and (ediff-merge-job)
+       ediff-show-clashes-only
        (ediff-merge-region-is-non-clash n)))
 
 ;; If ediff-skip-changed-regions, check if the merge region differs from
 ;; the current default. If a region is different from the default, it means
 ;; that the user has made determination as to how to merge for this particular
 ;; region.
-(defsubst ediff-skip-merge-region-if-changed-from-default-p (n)
-  (and ediff-skip-merge-regions-that-differ-from-default
+(defun ediff-skip-merge-region-if-changed-from-default-p (n)
+  (and (ediff-merge-job)
+       ediff-skip-merge-regions-that-differ-from-default
        (ediff-merge-changed-from-default-p n 'prefers-too)))
 
 
index 1b76db41449ed3e89f5cbc48b5a27d07115f0c78..6243c040e2c11424fdcdc9312acc28e73e410d8f 100644 (file)
@@ -12,8 +12,8 @@
 ;; filed in the Emacs bug reporting system against this file, a copy
 ;; of the bug report be sent to the maintainer's email address.
 
-(defconst ediff-version "2.81.2" "The current version of Ediff")
-(defconst ediff-date "November 22, 2008" "Date of last update")
+(defconst ediff-version "2.81.3" "The current version of Ediff")
+(defconst ediff-date "August 15, 2009" "Date of last update")
 
 
 ;; This file is part of GNU Emacs.
@@ -360,6 +360,43 @@ deleted."
 ;;;###autoload
 (defalias 'ediff 'ediff-files)
 
+;;;###autoload
+(defun ediff-current-file ()
+  "Start ediff between current buffer and its file on disk.
+This command can be used instead of `revert-buffer'.  If there is
+nothing to revert then this command fails."
+  (interactive)
+  (unless (or revert-buffer-function
+              revert-buffer-insert-file-contents-function
+              (and buffer-file-number
+                   (or (buffer-modified-p)
+                       (not (verify-visited-file-modtime
+                             (current-buffer))))))
+    (error "Nothing to revert"))
+  (let* ((auto-save-p (and (recent-auto-save-p)
+                           buffer-auto-save-file-name
+                           (file-readable-p buffer-auto-save-file-name)
+                           (y-or-n-p
+                            "Buffer has been auto-saved recently.  Compare with auto-save file? ")))
+         (file-name (if auto-save-p
+                        buffer-auto-save-file-name
+                      buffer-file-name))
+         (revert-buf-name (concat "FILE=" file-name))
+         (revert-buf (get-buffer revert-buf-name))
+         (current-major major-mode))
+    (unless file-name
+      (error "Buffer does not seem to be associated with any file"))
+    (when revert-buf
+      (kill-buffer revert-buf)
+      (setq revert-buf nil))
+    (setq revert-buf (get-buffer-create revert-buf-name))
+    (with-current-buffer revert-buf
+      (insert-file-contents file-name)
+      ;; Assume same modes:
+      (funcall current-major))
+    (ediff-buffers revert-buf (current-buffer))))
+
+
 ;;;###autoload
 (defun ediff-backup (file)
   "Run Ediff on FILE and its backup file.
index 7a793b92d9ad25306fb8854f42868c7322950207..83f268aa7ed1c2282c39c1926b2af814cfe0bb79 100644 (file)
@@ -3685,15 +3685,24 @@ controlled by the sign of prefix numeric value."
 \f
 ;; searching
 
+(defun viper-insert-isearch-string ()
+  "Insert `isearch' last search string."
+  (interactive)
+  (when isearch-string (insert isearch-string)))
+
 (defun viper-if-string (prompt)
   (if (memq viper-intermediate-command
            '(viper-command-argument viper-digit-argument viper-repeat))
       (setq viper-this-command-keys (this-command-keys)))
-  (let ((s (viper-read-string-with-history
+  (let* ((keymap (let ((keymap (copy-keymap minibuffer-local-map)))
+                   (define-key keymap [(control ?s)] 'viper-insert-isearch-string)
+                   keymap))
+         (s (viper-read-string-with-history
            prompt
            nil ; no initial
            'viper-search-history
-           (car viper-search-history))))
+             (car viper-search-history)
+             keymap)))
     (if (not (string= s ""))
        (setq viper-s-string s))))
 
index d2234fb22d9f45ee386003222acfdf300e14c265..1631b1aa6ba1647a780abe8528a28b9a9b35c655 100644 (file)
@@ -14,7 +14,7 @@
 ;; filed in the Emacs bug reporting system against this file, a copy
 ;; of the bug report be sent to the maintainer's email address.
 
-(defconst viper-version "3.14 of November 22, 2008"
+(defconst viper-version "3.14.1 of August 15, 2009"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.