From: Michael Kifer Date: Sat, 15 Aug 2009 05:57:08 +0000 (+0000) Subject: 2009-08-15 Michael Kifer X-Git-Tag: emacs-pretest-23.1.90~1854 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=68b962d42a9cc126759448484d23e10e2102d622;p=emacs.git 2009-08-15 Michael Kifer * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dbef38f6fc9..0be3871d1f0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2009-08-15 Michael Kifer + + * 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 * progmodes/js.el: Edit docstrings throughout to follow Emacs diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index 4b637dca179..d58008f9d12 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el @@ -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 diff --git a/lisp/ediff-merg.el b/lisp/ediff-merg.el index 35ea4348d0e..ca90e0923f0 100644 --- a/lisp/ediff-merg.el +++ b/lisp/ediff-merg.el @@ -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))) diff --git a/lisp/ediff.el b/lisp/ediff.el index 1b76db41449..6243c040e2c 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el @@ -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. diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 7a793b92d9a..83f268aa7ed 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -3685,15 +3685,24 @@ controlled by the sign of prefix numeric value." ;; 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)))) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index d2234fb22d9..1631b1aa6ba 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -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.