aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Kifer2006-10-23 19:20:15 +0000
committerMichael Kifer2006-10-23 19:20:15 +0000
commit7eb605c752b669ea2aa89040f512f91ce4a3de63 (patch)
tree630f5b2ea9e197c3e2681bf0e6f282ec4f6fd2d9 /lisp
parent6c2962c2287aa702dd81d60e1da7c267ce166a6f (diff)
downloademacs-7eb605c752b669ea2aa89040f512f91ce4a3de63.tar.gz
emacs-7eb605c752b669ea2aa89040f512f91ce4a3de63.zip
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ediff-diff.el4
-rw-r--r--lisp/ediff-mult.el14
-rw-r--r--lisp/ediff.el2
-rw-r--r--lisp/emulation/viper-cmd.el125
-rw-r--r--lisp/emulation/viper-ex.el5
-rw-r--r--lisp/emulation/viper.el2
6 files changed, 82 insertions, 70 deletions
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index e3675064010..d2dff294d2e 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -1450,7 +1450,9 @@ arguments to `skip-chars-forward'."
1450 (condition-case nil 1450 (condition-case nil
1451 (let ((res 1451 (let ((res
1452 (apply 'call-process ediff-cmp-program nil nil nil 1452 (apply 'call-process ediff-cmp-program nil nil nil
1453 (append ediff-cmp-options (list f1 f2))))) 1453 (append ediff-cmp-options (list (expand-file-name f1)
1454 (expand-file-name f2))))
1455 ))
1454 (and (numberp res) (eq res 0))) 1456 (and (numberp res) (eq res 0)))
1455 (error (format "Cannot execute program %S." ediff-cmp-program))) 1457 (error (format "Cannot execute program %S." ediff-cmp-program)))
1456 )) 1458 ))
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el
index b33ad7c1859..2ee573a4cb9 100644
--- a/lisp/ediff-mult.el
+++ b/lisp/ediff-mult.el
@@ -1637,11 +1637,15 @@ Useful commands:
1637 (set-buffer (setq tmp-buf (get-buffer-create ediff-tmp-buffer))) 1637 (set-buffer (setq tmp-buf (get-buffer-create ediff-tmp-buffer)))
1638 (erase-buffer) 1638 (erase-buffer)
1639 (shell-command 1639 (shell-command
1640 (format "%s %s %s %s" 1640 (format
1641 ediff-custom-diff-program ediff-custom-diff-options 1641 "%s %s %s %s"
1642 (ediff-get-session-objA-name session) 1642 (shell-quote-argument ediff-custom-diff-program)
1643 (ediff-get-session-objB-name session)) 1643 ediff-custom-diff-options
1644 t)) 1644 (shell-quote-argument (ediff-get-session-objA-name session))
1645 (shell-quote-argument (ediff-get-session-objB-name session))
1646 )
1647 t)
1648 )
1645 (save-excursion 1649 (save-excursion
1646 (set-buffer meta-diff-buff) 1650 (set-buffer meta-diff-buff)
1647 (goto-char (point-max)) 1651 (goto-char (point-max))
diff --git a/lisp/ediff.el b/lisp/ediff.el
index 6b37d4c1847..14e1461a8a7 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -8,7 +8,7 @@
8;; Keywords: comparing, merging, patching, tools, unix 8;; Keywords: comparing, merging, patching, tools, unix
9 9
10(defconst ediff-version "2.81.1" "The current version of Ediff") 10(defconst ediff-version "2.81.1" "The current version of Ediff")
11(defconst ediff-date "September 18, 2006" "Date of last update") 11(defconst ediff-date "October 23, 2006" "Date of last update")
12 12
13 13
14;; This file is part of GNU Emacs. 14;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 61d99e6c78d..ac3ef55d6e4 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -408,7 +408,6 @@
408 ) 408 )
409 409
410 410
411
412(defun viper-adjust-keys-for (state) 411(defun viper-adjust-keys-for (state)
413 "Make necessary adjustments to keymaps before entering STATE." 412 "Make necessary adjustments to keymaps before entering STATE."
414 (cond ((memq state '(insert-state replace-state)) 413 (cond ((memq state '(insert-state replace-state))
@@ -1263,65 +1262,69 @@ as a Meta key and any number of multiple escapes is allowed."
1263 (setq com char) 1262 (setq com char)
1264 (setq char (read-char)))))) 1263 (setq char (read-char))))))
1265 1264
1266 (if (atom com) 1265 (if (atom com)
1267 ;; `com' is a single char, so we construct the command argument 1266 ;; `com' is a single char, so we construct the command argument
1268 ;; and if `char' is `?', we describe the arg; otherwise 1267 ;; and if `char' is `?', we describe the arg; otherwise
1269 ;; we prepare the command that will be executed at the end. 1268 ;; we prepare the command that will be executed at the end.
1270 (progn 1269 (progn
1271 (setq cmd-info (cons value com)) 1270 (setq cmd-info (cons value com))
1272 (while (viper= char ?U) 1271 (while (viper= char ?U)
1273 (viper-describe-arg cmd-info) 1272 (viper-describe-arg cmd-info)
1274 (setq char (read-char))) 1273 (setq char (read-char)))
1275 ;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so we 1274 ;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so
1276 ;; execute it at the very end 1275 ;; we execute it at the very end
1277 (or (viper-movement-command-p char) 1276 (or (viper-movement-command-p char)
1278 (viper-digit-command-p char) 1277 (viper-digit-command-p char)
1279 (viper-regsuffix-command-p char) 1278 (viper-regsuffix-command-p char)
1280 (viper= char ?!) ; bang command 1279 (viper= char ?!) ; bang command
1281 (error "")) 1280 (viper= char ?g) ; the gg command (like G0)
1282 (setq cmd-to-exec-at-end 1281 (error ""))
1283 (viper-exec-form-in-vi 1282 (setq cmd-to-exec-at-end
1284 `(key-binding (char-to-string ,char))))) 1283 (viper-exec-form-in-vi
1285 1284 `(key-binding (char-to-string ,char)))))
1286 ;; as com is non-nil, this means that we have a command to execute 1285
1287 (if (viper-memq-char (car com) '(?r ?R)) 1286 ;; as com is non-nil, this means that we have a command to execute
1288 ;; execute apropriate region command. 1287 (if (viper-memq-char (car com) '(?r ?R))
1289 (let ((char (car com)) (com (cdr com))) 1288 ;; execute apropriate region command.
1290 (setq prefix-arg (cons value com)) 1289 (let ((char (car com)) (com (cdr com)))
1291 (if (viper= char ?r) 1290 (setq prefix-arg (cons value com))
1292 (viper-region prefix-arg) 1291 (if (viper= char ?r)
1293 (viper-Region prefix-arg)) 1292 (viper-region prefix-arg)
1294 ;; reset prefix-arg 1293 (viper-Region prefix-arg))
1295 (setq prefix-arg nil)) 1294 ;; reset prefix-arg
1296 ;; otherwise, reset prefix arg and call appropriate command 1295 (setq prefix-arg nil))
1297 (setq value (if (null value) 1 value)) 1296 ;; otherwise, reset prefix arg and call appropriate command
1298 (setq prefix-arg nil) 1297 (setq value (if (null value) 1 value))
1299 (cond 1298 (setq prefix-arg nil)
1300 ;; If we change ?C to ?c here, then cc will enter replacement mode 1299 (cond
1301 ;; rather than deleting lines. However, it will affect 1 less line than 1300 ;; If we change ?C to ?c here, then cc will enter replacement mode
1302 ;; normal. We decided to not use replacement mode here and follow Vi, 1301 ;; rather than deleting lines. However, it will affect 1 less line
1303 ;; since replacement mode on n full lines can be achieved with nC. 1302 ;; than normal. We decided to not use replacement mode here and
1304 ((equal com '(?c . ?c)) (viper-line (cons value ?C))) 1303 ;; follow Vi, since replacement mode on n full lines can be achieved
1305 ((equal com '(?d . ?d)) (viper-line (cons value ?D))) 1304 ;; with nC.
1306 ((equal com '(?d . ?y)) (viper-yank-defun)) 1305 ((equal com '(?c . ?c)) (viper-line (cons value ?C)))
1307 ((equal com '(?y . ?y)) (viper-line (cons value ?Y))) 1306 ((equal com '(?d . ?d)) (viper-line (cons value ?D)))
1308 ((equal com '(?< . ?<)) (viper-line (cons value ?<))) 1307 ((equal com '(?d . ?y)) (viper-yank-defun))
1309 ((equal com '(?> . ?>)) (viper-line (cons value ?>))) 1308 ((equal com '(?y . ?y)) (viper-line (cons value ?Y)))
1310 ((equal com '(?! . ?!)) (viper-line (cons value ?!))) 1309 ((equal com '(?< . ?<)) (viper-line (cons value ?<)))
1311 ((equal com '(?= . ?=)) (viper-line (cons value ?=))) 1310 ((equal com '(?> . ?>)) (viper-line (cons value ?>)))
1312 (t (error ""))))) 1311 ((equal com '(?! . ?!)) (viper-line (cons value ?!)))
1313 1312 ((equal com '(?= . ?=)) (viper-line (cons value ?=)))
1314 (if cmd-to-exec-at-end 1313 ;; gg acts as G0
1315 (progn 1314 ((equal (car com) ?g) (viper-goto-line 0))
1316 (setq last-command-char char) 1315 (t (error "")))))
1317 (setq last-command-event 1316
1318 (viper-copy-event 1317 (if cmd-to-exec-at-end
1319 (if viper-xemacs-p (character-to-event char) char))) 1318 (progn
1320 (condition-case nil 1319 (setq last-command-char char)
1321 (funcall cmd-to-exec-at-end cmd-info) 1320 (setq last-command-event
1322 (error 1321 (viper-copy-event
1323 (error ""))))) 1322 (if viper-xemacs-p (character-to-event char) char)))
1324 )) 1323 (condition-case nil
1324 (funcall cmd-to-exec-at-end cmd-info)
1325 (error
1326 (error "")))))
1327 ))
1325 1328
1326(defun viper-describe-arg (arg) 1329(defun viper-describe-arg (arg)
1327 (let (val com) 1330 (let (val com)
@@ -1733,6 +1736,7 @@ invokes the command before that, etc."
1733 (max viper-com-point (point)))) 1736 (max viper-com-point (point))))
1734 ((viper= char ?g) 1737 ((viper= char ?g)
1735 (push-mark viper-com-point t) 1738 (push-mark viper-com-point t)
1739 ;; execute the last emacs kbd macro on each line of the region
1736 (viper-global-execute)) 1740 (viper-global-execute))
1737 ((viper= char ?q) 1741 ((viper= char ?q)
1738 (push-mark viper-com-point t) 1742 (push-mark viper-com-point t)
@@ -3996,6 +4000,7 @@ Null string will repeat previous search."
3996(defun viper-buffer-search-enable (&optional c) 4000(defun viper-buffer-search-enable (&optional c)
3997 (cond (c (setq viper-buffer-search-char c)) 4001 (cond (c (setq viper-buffer-search-char c))
3998 ((null viper-buffer-search-char) 4002 ((null viper-buffer-search-char)
4003 ;; ?g acts as a default value for viper-buffer-search-char
3999 (setq viper-buffer-search-char ?g))) 4004 (setq viper-buffer-search-char ?g)))
4000 (define-key viper-vi-basic-map 4005 (define-key viper-vi-basic-map
4001 (cond ((viper-characterp viper-buffer-search-char) 4006 (cond ((viper-characterp viper-buffer-search-char)
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index f9f08034582..9f69c685948 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -1624,8 +1624,9 @@ reversed."
1624 (progn 1624 (progn
1625 (setq command 1625 (setq command
1626 ;; replace # and % with the previous/current file 1626 ;; replace # and % with the previous/current file
1627 (ex-expand-filsyms (concat ex-file ex-cmdfile-args) 1627 (ex-expand-filsyms
1628 (current-buffer))) 1628 (concat (shell-quote-argument ex-file) ex-cmdfile-args)
1629 (current-buffer)))
1629 (shell-command command t)) 1630 (shell-command command t))
1630 (insert-file-contents ex-file))) 1631 (insert-file-contents ex-file)))
1631 (ex-fixup-history viper-last-ex-prompt ex-file ex-cmdfile-args)) 1632 (ex-fixup-history viper-last-ex-prompt ex-file ex-cmdfile-args))
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index ea70ad609ad..82c070d5264 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -9,7 +9,7 @@
9;; Author: Michael Kifer <kifer@cs.stonybrook.edu> 9;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
10;; Keywords: emulations 10;; Keywords: emulations
11 11
12(defconst viper-version "3.13 of September 18, 2006" 12(defconst viper-version "3.13.1 of October 23, 2006"
13 "The current version of Viper") 13 "The current version of Viper")
14 14
15;; This file is part of GNU Emacs. 15;; This file is part of GNU Emacs.