1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

2006-10-23 Michael Kifer <kifer@cs.stonybrook.edu>

* viper-cmd.el (viper-prefix-arg-com): define gg as G0

	* viper-ex.el (ex-read): quote file argument.

	* ediff-diff.el (ediff-same-file-contents): expand file names.

	* ediff-mult.el (ediff-append-custom-diff): quote shell file arguments.
This commit is contained in:
Michael Kifer 2006-10-23 19:20:15 +00:00
parent 6c2962c228
commit 7eb605c752
8 changed files with 92 additions and 70 deletions

View file

@ -1,3 +1,13 @@
2006-10-23 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-cmd.el (viper-prefix-arg-com): define gg as G0
* viper-ex.el (ex-read): quote file argument.
* ediff-diff.el (ediff-same-file-contents): expand file names.
* ediff-mult.el (ediff-append-custom-diff): quote shell file arguments.
2006-10-23 Andreas Schwab <schwab@suse.de> 2006-10-23 Andreas Schwab <schwab@suse.de>
* configure.in: Make sure x_default_search_path is always set even * configure.in: Make sure x_default_search_path is always set even

View file

@ -1450,7 +1450,9 @@ arguments to `skip-chars-forward'."
(condition-case nil (condition-case nil
(let ((res (let ((res
(apply 'call-process ediff-cmp-program nil nil nil (apply 'call-process ediff-cmp-program nil nil nil
(append ediff-cmp-options (list f1 f2))))) (append ediff-cmp-options (list (expand-file-name f1)
(expand-file-name f2))))
))
(and (numberp res) (eq res 0))) (and (numberp res) (eq res 0)))
(error (format "Cannot execute program %S." ediff-cmp-program))) (error (format "Cannot execute program %S." ediff-cmp-program)))
)) ))

View file

@ -1637,11 +1637,15 @@ Useful commands:
(set-buffer (setq tmp-buf (get-buffer-create ediff-tmp-buffer))) (set-buffer (setq tmp-buf (get-buffer-create ediff-tmp-buffer)))
(erase-buffer) (erase-buffer)
(shell-command (shell-command
(format "%s %s %s %s" (format
ediff-custom-diff-program ediff-custom-diff-options "%s %s %s %s"
(ediff-get-session-objA-name session) (shell-quote-argument ediff-custom-diff-program)
(ediff-get-session-objB-name session)) ediff-custom-diff-options
t)) (shell-quote-argument (ediff-get-session-objA-name session))
(shell-quote-argument (ediff-get-session-objB-name session))
)
t)
)
(save-excursion (save-excursion
(set-buffer meta-diff-buff) (set-buffer meta-diff-buff)
(goto-char (point-max)) (goto-char (point-max))

View file

@ -8,7 +8,7 @@
;; Keywords: comparing, merging, patching, tools, unix ;; Keywords: comparing, merging, patching, tools, unix
(defconst ediff-version "2.81.1" "The current version of Ediff") (defconst ediff-version "2.81.1" "The current version of Ediff")
(defconst ediff-date "September 18, 2006" "Date of last update") (defconst ediff-date "October 23, 2006" "Date of last update")
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.

View file

@ -408,7 +408,6 @@
) )
(defun viper-adjust-keys-for (state) (defun viper-adjust-keys-for (state)
"Make necessary adjustments to keymaps before entering STATE." "Make necessary adjustments to keymaps before entering STATE."
(cond ((memq state '(insert-state replace-state)) (cond ((memq state '(insert-state replace-state))
@ -1263,65 +1262,69 @@ as a Meta key and any number of multiple escapes is allowed."
(setq com char) (setq com char)
(setq char (read-char)))))) (setq char (read-char))))))
(if (atom com) (if (atom com)
;; `com' is a single char, so we construct the command argument ;; `com' is a single char, so we construct the command argument
;; and if `char' is `?', we describe the arg; otherwise ;; and if `char' is `?', we describe the arg; otherwise
;; we prepare the command that will be executed at the end. ;; we prepare the command that will be executed at the end.
(progn (progn
(setq cmd-info (cons value com)) (setq cmd-info (cons value com))
(while (viper= char ?U) (while (viper= char ?U)
(viper-describe-arg cmd-info) (viper-describe-arg cmd-info)
(setq char (read-char))) (setq char (read-char)))
;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so we ;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so
;; execute it at the very end ;; we execute it at the very end
(or (viper-movement-command-p char) (or (viper-movement-command-p char)
(viper-digit-command-p char) (viper-digit-command-p char)
(viper-regsuffix-command-p char) (viper-regsuffix-command-p char)
(viper= char ?!) ; bang command (viper= char ?!) ; bang command
(error "")) (viper= char ?g) ; the gg command (like G0)
(setq cmd-to-exec-at-end (error ""))
(viper-exec-form-in-vi (setq cmd-to-exec-at-end
`(key-binding (char-to-string ,char))))) (viper-exec-form-in-vi
`(key-binding (char-to-string ,char)))))
;; as com is non-nil, this means that we have a command to execute ;; as com is non-nil, this means that we have a command to execute
(if (viper-memq-char (car com) '(?r ?R)) (if (viper-memq-char (car com) '(?r ?R))
;; execute apropriate region command. ;; execute apropriate region command.
(let ((char (car com)) (com (cdr com))) (let ((char (car com)) (com (cdr com)))
(setq prefix-arg (cons value com)) (setq prefix-arg (cons value com))
(if (viper= char ?r) (if (viper= char ?r)
(viper-region prefix-arg) (viper-region prefix-arg)
(viper-Region prefix-arg)) (viper-Region prefix-arg))
;; reset prefix-arg ;; reset prefix-arg
(setq prefix-arg nil)) (setq prefix-arg nil))
;; otherwise, reset prefix arg and call appropriate command ;; otherwise, reset prefix arg and call appropriate command
(setq value (if (null value) 1 value)) (setq value (if (null value) 1 value))
(setq prefix-arg nil) (setq prefix-arg nil)
(cond (cond
;; If we change ?C to ?c here, then cc will enter replacement mode ;; If we change ?C to ?c here, then cc will enter replacement mode
;; rather than deleting lines. However, it will affect 1 less line than ;; rather than deleting lines. However, it will affect 1 less line
;; normal. We decided to not use replacement mode here and follow Vi, ;; than normal. We decided to not use replacement mode here and
;; since replacement mode on n full lines can be achieved with nC. ;; follow Vi, since replacement mode on n full lines can be achieved
((equal com '(?c . ?c)) (viper-line (cons value ?C))) ;; with nC.
((equal com '(?d . ?d)) (viper-line (cons value ?D))) ((equal com '(?c . ?c)) (viper-line (cons value ?C)))
((equal com '(?d . ?y)) (viper-yank-defun)) ((equal com '(?d . ?d)) (viper-line (cons value ?D)))
((equal com '(?y . ?y)) (viper-line (cons value ?Y))) ((equal com '(?d . ?y)) (viper-yank-defun))
((equal com '(?< . ?<)) (viper-line (cons value ?<))) ((equal com '(?y . ?y)) (viper-line (cons value ?Y)))
((equal com '(?> . ?>)) (viper-line (cons value ?>))) ((equal com '(?< . ?<)) (viper-line (cons value ?<)))
((equal com '(?! . ?!)) (viper-line (cons value ?!))) ((equal com '(?> . ?>)) (viper-line (cons value ?>)))
((equal com '(?= . ?=)) (viper-line (cons value ?=))) ((equal com '(?! . ?!)) (viper-line (cons value ?!)))
(t (error ""))))) ((equal com '(?= . ?=)) (viper-line (cons value ?=)))
;; gg acts as G0
(if cmd-to-exec-at-end ((equal (car com) ?g) (viper-goto-line 0))
(progn (t (error "")))))
(setq last-command-char char)
(setq last-command-event (if cmd-to-exec-at-end
(viper-copy-event (progn
(if viper-xemacs-p (character-to-event char) char))) (setq last-command-char char)
(condition-case nil (setq last-command-event
(funcall cmd-to-exec-at-end cmd-info) (viper-copy-event
(error (if viper-xemacs-p (character-to-event char) char)))
(error ""))))) (condition-case nil
)) (funcall cmd-to-exec-at-end cmd-info)
(error
(error "")))))
))
(defun viper-describe-arg (arg) (defun viper-describe-arg (arg)
(let (val com) (let (val com)
@ -1733,6 +1736,7 @@ invokes the command before that, etc."
(max viper-com-point (point)))) (max viper-com-point (point))))
((viper= char ?g) ((viper= char ?g)
(push-mark viper-com-point t) (push-mark viper-com-point t)
;; execute the last emacs kbd macro on each line of the region
(viper-global-execute)) (viper-global-execute))
((viper= char ?q) ((viper= char ?q)
(push-mark viper-com-point t) (push-mark viper-com-point t)
@ -3996,6 +4000,7 @@ Null string will repeat previous search."
(defun viper-buffer-search-enable (&optional c) (defun viper-buffer-search-enable (&optional c)
(cond (c (setq viper-buffer-search-char c)) (cond (c (setq viper-buffer-search-char c))
((null viper-buffer-search-char) ((null viper-buffer-search-char)
;; ?g acts as a default value for viper-buffer-search-char
(setq viper-buffer-search-char ?g))) (setq viper-buffer-search-char ?g)))
(define-key viper-vi-basic-map (define-key viper-vi-basic-map
(cond ((viper-characterp viper-buffer-search-char) (cond ((viper-characterp viper-buffer-search-char)

View file

@ -1624,8 +1624,9 @@ reversed."
(progn (progn
(setq command (setq command
;; replace # and % with the previous/current file ;; replace # and % with the previous/current file
(ex-expand-filsyms (concat ex-file ex-cmdfile-args) (ex-expand-filsyms
(current-buffer))) (concat (shell-quote-argument ex-file) ex-cmdfile-args)
(current-buffer)))
(shell-command command t)) (shell-command command t))
(insert-file-contents ex-file))) (insert-file-contents ex-file)))
(ex-fixup-history viper-last-ex-prompt ex-file ex-cmdfile-args)) (ex-fixup-history viper-last-ex-prompt ex-file ex-cmdfile-args))

View file

@ -9,7 +9,7 @@
;; Author: Michael Kifer <kifer@cs.stonybrook.edu> ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;; Keywords: emulations ;; Keywords: emulations
(defconst viper-version "3.13 of September 18, 2006" (defconst viper-version "3.13.1 of October 23, 2006"
"The current version of Viper") "The current version of Viper")
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.

View file

@ -178,7 +178,7 @@ in some cases, especially in the Vi Insert state. John Hawkins
<jshawkin@@eecs.umich.edu> has provided a set of customizations, which <jshawkin@@eecs.umich.edu> has provided a set of customizations, which
enables additional Emacs bindings under Viper. These customizations can be enables additional Emacs bindings under Viper. These customizations can be
included in your @file{~/.viper} file and are found at the following URL: included in your @file{~/.viper} file and are found at the following URL:
@file{http://www.eecs.umich.edu/~jshawkin/viper-sample}. @file{http://traeki.freeshell.org/files/viper-sample}.
@menu @menu
* Emacs Preliminaries:: Basic concepts in Emacs. * Emacs Preliminaries:: Basic concepts in Emacs.