diff options
| author | Michael Kifer | 2001-07-21 05:28:24 +0000 |
|---|---|---|
| committer | Michael Kifer | 2001-07-21 05:28:24 +0000 |
| commit | 4960e7572aba4d10ef5f49b4dc27f3cc4a4a7af5 (patch) | |
| tree | 88083e3fa4569e9e18dad3994d3e7d8809a9c33c | |
| parent | 0582471880ed96258caccd64e4d8bcf3028c610d (diff) | |
| download | emacs-4960e7572aba4d10ef5f49b4dc27f3cc4a4a7af5.tar.gz emacs-4960e7572aba4d10ef5f49b4dc27f3cc4a4a7af5.zip | |
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
of Scott Bronson.
(ex-cmd-assoc,ex-compile,ex-cmd-one-letr): New functions.
(viper-check-sub,viper-get-ex-command,viper-execute-ex-command):
Deleted functions.
(viper-get-ex-com-subr,viper-ex,ex-mark): Changed to use the new
ex-token-list.
(viper-get-ex-address-subr): convert registers to char data type.
* viper-util.el (viper-int-to-char,viper-char-equal): new
functions.
(viper-memq-char): use viper-int-to-char.
(viper-file-checked-in-p): use vc-locking-user, if vc doesn't have
vc-locking-state.
(viper-read-key): use viper-read-key-sequence.
* viper.el (viper-major-mode-modifier-list): added
inferior-emacs-lisp-mode.
(this-major-mode-requires-vi-state): new function that uses simple
heuristics to decide if vi state is appropriate.
(set-viper-state-in-major-mode): use this-major-mode-requires-vi-state.
(viper-non-hook-settings): don't advise read-key-sequence.
(viper-read-key-sequence): new function that replaces the
previously used advice to read-key-sequence.
* viper-cmd.el (viper-test-com-defun,viper-exec-change,
viper-exec-Change,viper-execute-com,viper-insert,viper-append,
viper-Append,viper-Insert,viper-open-line,viper-Open-line,
viper-open-line-at-point,viper-substitute,viper-overwrite,
viper-replace-char-subr,viper-forward-word,viper-forward-Word):
got rid of the negative character hack.
(viper-escape-to-state,viper-replace-state-exit-cmd):
use viper-read-key-sequence.
(viper-envelop-ESC-key): no need for ad-get-orig-definition.
(viper-minibuffer-standard-hook,viper-read-string-with-history):
don't override existing minibuffer-setup-hook.
(viper-mark-point,viper-goto-mark-subr,viper-brac-function):
convert registers to char data type.
(viper-autoindent): use viper-indent-line.
* viper-keym.el: use viper-exec-key-in-emacs.
* viper.texi: Added credits, new commands, like :make.
* ediff-util.el: Copyright years.
(ediff-choose-syntax-table): New function.
(ediff-setup): Use ediff-choose-syntax-table.
(ediff-file-checked-out-p,ediff-file-checked-in-p): check if
vc-state is available.
(ediff-make-temp-file): use ediff-coding-system-for-write.
* ediff-init.el (ediff-with-syntax-table): New macro, uses
with-syntax-table.
(ediff-coding-system-for-read): from ediff-diff.el
(ediff-coding-system-for-write): new variable.
(ediff-highest-priority): fixed the bug having to do with disappearing
overlays.
(ediff-file-remote-p): use file-remote-p, if available.
(ediff-listable-file): new function.
(ediff-file-attributes): use ediff-listable-file.
* ediff-mult.el (ediff-meta-insert-file-info1): use
ediff-listable-file.
* ediff-ptch.el (ediff-prompt-for-patch-file): use
ediff-coding-system-for-read.
(ediff-patch-file-internal): use ediff-coding-system-for-write.
* ediff-diff.el (ediff-coding-system-for-read): moved to ediff-init.el.
(ediff-match-diff3-line,ediff-get-diff3-group): improved pattern.
* ediff.el: Date of last update, copyright years.
* ediff-wind (ediff-setup-control-frame): Nill->nil.
* ediff.texi: added clarifications, acknowledgements.
| -rw-r--r-- | lisp/ChangeLog | 75 | ||||
| -rw-r--r-- | lisp/ediff-diff.el | 13 | ||||
| -rw-r--r-- | lisp/ediff-init.el | 65 | ||||
| -rw-r--r-- | lisp/ediff-mult.el | 2 | ||||
| -rw-r--r-- | lisp/ediff-ptch.el | 9 | ||||
| -rw-r--r-- | lisp/ediff-util.el | 21 | ||||
| -rw-r--r-- | lisp/ediff.el | 4 | ||||
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 183 | ||||
| -rw-r--r-- | lisp/emulation/viper-ex.el | 40 | ||||
| -rw-r--r-- | lisp/emulation/viper-keym.el | 4 | ||||
| -rw-r--r-- | lisp/emulation/viper-util.el | 29 | ||||
| -rw-r--r-- | lisp/emulation/viper.el | 76 | ||||
| -rw-r--r-- | man/ChangeLog | 6 | ||||
| -rw-r--r-- | man/ediff.texi | 74 | ||||
| -rw-r--r-- | man/viper.texi | 27 |
15 files changed, 441 insertions, 187 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2f14c6eedeb..55ad54cfcdd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,78 @@ | |||
| 1 | 2001-07-21 Michael Kifer <kifer@cs.sunysb.edu> | ||
| 2 | |||
| 3 | * ediff-util.el: Copyright years. | ||
| 4 | (ediff-choose-syntax-table): New function. | ||
| 5 | (ediff-setup): Use ediff-choose-syntax-table. | ||
| 6 | (ediff-file-checked-out-p,ediff-file-checked-in-p): check if | ||
| 7 | vc-state is available. | ||
| 8 | (ediff-make-temp-file): use ediff-coding-system-for-write. | ||
| 9 | |||
| 10 | * ediff-init.el (ediff-with-syntax-table): New macro, uses | ||
| 11 | with-syntax-table. | ||
| 12 | (ediff-coding-system-for-read): from ediff-diff.el | ||
| 13 | (ediff-coding-system-for-write): new variable. | ||
| 14 | (ediff-highest-priority): fixed the bug having to do with disappearing | ||
| 15 | overlays. | ||
| 16 | (ediff-file-remote-p): use file-remote-p, if available. | ||
| 17 | (ediff-listable-file): new function. | ||
| 18 | (ediff-file-attributes): use ediff-listable-file. | ||
| 19 | |||
| 20 | * ediff-mult.el (ediff-meta-insert-file-info1): use | ||
| 21 | ediff-listable-file. | ||
| 22 | |||
| 23 | * ediff-ptch.el (ediff-prompt-for-patch-file): use | ||
| 24 | ediff-coding-system-for-read. | ||
| 25 | (ediff-patch-file-internal): use ediff-coding-system-for-write. | ||
| 26 | |||
| 27 | * ediff-diff.el (ediff-coding-system-for-read): moved to ediff-init.el. | ||
| 28 | (ediff-match-diff3-line,ediff-get-diff3-group): improved pattern. | ||
| 29 | |||
| 30 | * ediff.el: Date of last update, copyright years. | ||
| 31 | |||
| 32 | * ediff-wind (ediff-setup-control-frame): Nill->nil. | ||
| 33 | |||
| 34 | * viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy | ||
| 35 | of Scott Bronson. | ||
| 36 | (ex-cmd-assoc,ex-compile,ex-cmd-one-letr): New functions. | ||
| 37 | (viper-check-sub,viper-get-ex-command,viper-execute-ex-command): | ||
| 38 | Deleted functions. | ||
| 39 | (viper-get-ex-com-subr,viper-ex,ex-mark): Changed to use the new | ||
| 40 | ex-token-list. | ||
| 41 | (viper-get-ex-address-subr): convert registers to char data type. | ||
| 42 | |||
| 43 | * viper-util.el (viper-int-to-char,viper-char-equal): new | ||
| 44 | functions. | ||
| 45 | (viper-memq-char): use viper-int-to-char. | ||
| 46 | (viper-file-checked-in-p): use vc-locking-user, if vc doesn't have | ||
| 47 | vc-locking-state. | ||
| 48 | (viper-read-key): use viper-read-key-sequence. | ||
| 49 | |||
| 50 | * viper.el (viper-major-mode-modifier-list): added | ||
| 51 | inferior-emacs-lisp-mode. | ||
| 52 | (this-major-mode-requires-vi-state): new function that uses simple | ||
| 53 | heuristics to decide if vi state is appropriate. | ||
| 54 | (set-viper-state-in-major-mode): use this-major-mode-requires-vi-state. | ||
| 55 | (viper-non-hook-settings): don't advise read-key-sequence. | ||
| 56 | (viper-read-key-sequence): new function that replaces the | ||
| 57 | previously used advice to read-key-sequence. | ||
| 58 | |||
| 59 | * viper-cmd.el (viper-test-com-defun,viper-exec-change, | ||
| 60 | viper-exec-Change,viper-execute-com,viper-insert,viper-append, | ||
| 61 | viper-Append,viper-Insert,viper-open-line,viper-Open-line, | ||
| 62 | viper-open-line-at-point,viper-substitute,viper-overwrite, | ||
| 63 | viper-replace-char-subr,viper-forward-word,viper-forward-Word): | ||
| 64 | got rid of the negative character hack. | ||
| 65 | (viper-escape-to-state,viper-replace-state-exit-cmd): | ||
| 66 | use viper-read-key-sequence. | ||
| 67 | (viper-envelop-ESC-key): no need for ad-get-orig-definition. | ||
| 68 | (viper-minibuffer-standard-hook,viper-read-string-with-history): | ||
| 69 | don't override existing minibuffer-setup-hook. | ||
| 70 | (viper-mark-point,viper-goto-mark-subr,viper-brac-function): | ||
| 71 | convert registers to char data type. | ||
| 72 | (viper-autoindent): use viper-indent-line. | ||
| 73 | |||
| 74 | * viper-keym.el: use viper-exec-key-in-emacs. | ||
| 75 | |||
| 1 | 2001-07-20 Stefan Monnier <monnier@cs.yale.edu> | 76 | 2001-07-20 Stefan Monnier <monnier@cs.yale.edu> |
| 2 | 77 | ||
| 3 | * server.el (server-visit-files): Fix variable name typo. | 78 | * server.el (server-visit-files): Fix variable name typo. |
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el index f2b2687c0c5..128737c4df3 100644 --- a/lisp/ediff-diff.el +++ b/lisp/ediff-diff.el | |||
| @@ -57,15 +57,6 @@ Must produce output compatible with Unix's diff3 program." | |||
| 57 | :type 'string | 57 | :type 'string |
| 58 | :group 'ediff-diff) | 58 | :group 'ediff-diff) |
| 59 | 59 | ||
| 60 | (defcustom ediff-coding-system-for-read 'raw-text | ||
| 61 | "*The coding system for read to use when running the diff program as a subprocess. | ||
| 62 | In most cases, the default will do. However, under certain circumstances in | ||
| 63 | Windows NT/98/95 you might need to use something like 'raw-text-dos here. | ||
| 64 | So, if the output that your diff program sends to Emacs contains extra ^M's, | ||
| 65 | you might need to experiment here, if the default or 'raw-text-dos doesn't | ||
| 66 | work." | ||
| 67 | :type 'symbol | ||
| 68 | :group 'ediff-diff) | ||
| 69 | 60 | ||
| 70 | ;; The following functions must precede all defcustom-defined variables. | 61 | ;; The following functions must precede all defcustom-defined variables. |
| 71 | 62 | ||
| @@ -153,7 +144,7 @@ This output is not used by Ediff internally." | |||
| 153 | 144 | ||
| 154 | ;;; Support for diff3 | 145 | ;;; Support for diff3 |
| 155 | 146 | ||
| 156 | (defvar ediff-match-diff3-line "^====\\(.?\\)$" | 147 | (defvar ediff-match-diff3-line "^====\\(.?\\)\C-m?$" |
| 157 | "Pattern to match lines produced by diff3 that describe differences.") | 148 | "Pattern to match lines produced by diff3 that describe differences.") |
| 158 | (defcustom ediff-diff3-options "" | 149 | (defcustom ediff-diff3-options "" |
| 159 | "*Options to pass to `ediff-diff3-program'." | 150 | "*Options to pass to `ediff-diff3-program'." |
| @@ -918,7 +909,7 @@ delimiter regions")) | |||
| 918 | ;; can produce the groups in the order 1, 2, 3 or 1, 3, 2. | 909 | ;; can produce the groups in the order 1, 2, 3 or 1, 3, 2. |
| 919 | (save-excursion | 910 | (save-excursion |
| 920 | (re-search-forward | 911 | (re-search-forward |
| 921 | (concat "^" file ":\\([0-9]+\\)\\(,\\([0-9]+\\)\\)?\\([ac]\\)$")) | 912 | (concat "^" file ":\\([0-9]+\\)\\(,\\([0-9]+\\)\\)?\\([ac]\\)\C-m?$")) |
| 922 | (beginning-of-line 2) | 913 | (beginning-of-line 2) |
| 923 | ;; treatment depends on whether it is an "a" group or a "c" group | 914 | ;; treatment depends on whether it is an "a" group or a "c" group |
| 924 | (if (string-equal (buffer-substring (match-beginning 4) (match-end 4)) "c") | 915 | (if (string-equal (buffer-substring (match-beginning 4) (match-end 4)) "c") |
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index 4594445a89f..fa8e0e9b794 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; ediff-init.el --- macros, variables, and defsubsts used by Ediff | 1 | ;;; ediff-init.el --- Macros, variables, and defsubsts used by Ediff |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -714,6 +714,22 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire." | |||
| 714 | :type 'symbol | 714 | :type 'symbol |
| 715 | :group 'ediff) | 715 | :group 'ediff) |
| 716 | 716 | ||
| 717 | (defcustom ediff-coding-system-for-read 'raw-text | ||
| 718 | "*The coding system for read to use when running the diff program as a subprocess. | ||
| 719 | In most cases, the default will do. However, under certain circumstances in | ||
| 720 | Windows NT/98/95 you might need to use something like 'raw-text-dos here. | ||
| 721 | So, if the output that your diff program sends to Emacs contains extra ^M's, | ||
| 722 | you might need to experiment here, if the default or 'raw-text-dos doesn't | ||
| 723 | work." | ||
| 724 | :type 'symbol | ||
| 725 | :group 'ediff) | ||
| 726 | |||
| 727 | (defcustom ediff-coding-system-for-write 'no-conversion | ||
| 728 | "*The coding system for write to use when writing out difference regions | ||
| 729 | to temp files when Ediff needs to find fine differences." | ||
| 730 | :type 'symbol | ||
| 731 | :group 'ediff) | ||
| 732 | |||
| 717 | 733 | ||
| 718 | (if ediff-xemacs-p | 734 | (if ediff-xemacs-p |
| 719 | (progn | 735 | (progn |
| @@ -1174,7 +1190,7 @@ this variable represents.") | |||
| 1174 | (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil | 1190 | (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil |
| 1175 | "Overlay for the current difference region in the ancestor buffer.") | 1191 | "Overlay for the current difference region in the ancestor buffer.") |
| 1176 | 1192 | ||
| 1177 | ;; Compute priority of ediff overlay. | 1193 | ;; Compute priority of a current ediff overlay. |
| 1178 | (defun ediff-highest-priority (start end buffer) | 1194 | (defun ediff-highest-priority (start end buffer) |
| 1179 | (let ((pos (max 1 (1- start))) | 1195 | (let ((pos (max 1 (1- start))) |
| 1180 | ovr-list) | 1196 | ovr-list) |
| @@ -1184,13 +1200,21 @@ this variable represents.") | |||
| 1184 | (while (< pos (min (point-max) (1+ end))) | 1200 | (while (< pos (min (point-max) (1+ end))) |
| 1185 | (setq ovr-list (append (overlays-at pos) ovr-list)) | 1201 | (setq ovr-list (append (overlays-at pos) ovr-list)) |
| 1186 | (setq pos (next-overlay-change pos))) | 1202 | (setq pos (next-overlay-change pos))) |
| 1187 | (1+ (apply '+ | 1203 | (+ 1 ediff-shadow-overlay-priority |
| 1188 | (mapcar (lambda (ovr) | 1204 | (apply 'max |
| 1189 | (if ovr | 1205 | (mapcar |
| 1190 | (or (ediff-overlay-get ovr 'priority) 0) | 1206 | (lambda (ovr) |
| 1191 | 0)) | 1207 | (if (and ovr |
| 1192 | ovr-list) | 1208 | ;; exclude ediff overlays from priority |
| 1193 | )) | 1209 | ;; calculation, or else priority will keep |
| 1210 | ;; increasing | ||
| 1211 | (null (ediff-overlay-get ovr 'ediff)) | ||
| 1212 | (null (ediff-overlay-get ovr 'ediff-diff-num))) | ||
| 1213 | ;; use the overlay priority or 0 | ||
| 1214 | (or (ediff-overlay-get ovr 'priority) 0) | ||
| 1215 | 0)) | ||
| 1216 | ovr-list) | ||
| 1217 | )) | ||
| 1194 | )))) | 1218 | )))) |
| 1195 | 1219 | ||
| 1196 | 1220 | ||
| @@ -1281,14 +1305,16 @@ This default should work without changes." | |||
| 1281 | 1305 | ||
| 1282 | ;;; In-line functions | 1306 | ;;; In-line functions |
| 1283 | 1307 | ||
| 1284 | (or (fboundp 'ediff-file-remote-p) ; user supplied his own function: use it | 1308 | ;; If file-remote-p is defined (as in XEmacs, use it. Otherwise, check |
| 1285 | (defun ediff-file-remote-p (file-name) | 1309 | ;; if find-file-name-handler is defined for 'file-local-copy |
| 1310 | (defun ediff-file-remote-p (file-name) | ||
| 1311 | (or (and (fboundp 'file-remote-p) (file-remote-p file-name)) | ||
| 1286 | (find-file-name-handler file-name 'file-local-copy))) | 1312 | (find-file-name-handler file-name 'file-local-copy))) |
| 1287 | ;;; (or (and (featurep 'efs-auto) (efs-ftp-path file-name)) | 1313 | |
| 1288 | ;;; (and (featurep 'tramp) (tramp-tramp-file-p file-name)) | 1314 | ;; File for which we can get attributes, such as size or date |
| 1289 | ;;; (and (fboundp 'file-remote-p) (file-remote-p file-name)) | 1315 | (defun ediff-listable-file (file-name) |
| 1290 | ;;; ;; Can happen only in Emacs, since XEmacs has file-remote-p | 1316 | (let ((handler (find-file-name-handler file-name 'file-local-copy))) |
| 1291 | ;;; (and (require 'ange-ftp) (ange-ftp-ftp-name file-name))))) | 1317 | (or (null handler) (eq handler 'dired-handler-fn)))) |
| 1292 | 1318 | ||
| 1293 | 1319 | ||
| 1294 | (defsubst ediff-frame-unsplittable-p (frame) | 1320 | (defsubst ediff-frame-unsplittable-p (frame) |
| @@ -1740,9 +1766,10 @@ Unless optional argument INPLACE is non-nil, return a new string." | |||
| 1740 | (apply 'message string args))) | 1766 | (apply 'message string args))) |
| 1741 | 1767 | ||
| 1742 | (defun ediff-file-attributes (filename attr-number) | 1768 | (defun ediff-file-attributes (filename attr-number) |
| 1743 | (if (ediff-file-remote-p filename) | 1769 | (if (ediff-listable-file filename) |
| 1744 | -1 | 1770 | (nth attr-number (file-attributes filename)) |
| 1745 | (nth attr-number (file-attributes filename)))) | 1771 | -1) |
| 1772 | ) | ||
| 1746 | 1773 | ||
| 1747 | (defsubst ediff-file-size (filename) | 1774 | (defsubst ediff-file-size (filename) |
| 1748 | (ediff-file-attributes filename 7)) | 1775 | (ediff-file-attributes filename 7)) |
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el index 206ef40351b..7115a2671f8 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el | |||
| @@ -970,7 +970,7 @@ behavior." | |||
| 970 | 500)) | 970 | 500)) |
| 971 | file-modtime file-size) | 971 | file-modtime file-size) |
| 972 | (cond ((not (stringp fname)) (setq file-size -2)) ; file doesn't exits | 972 | (cond ((not (stringp fname)) (setq file-size -2)) ; file doesn't exits |
| 973 | ((not (ediff-file-remote-p fname)) | 973 | ((ediff-listable-file fname) |
| 974 | (if (file-exists-p fname) | 974 | (if (file-exists-p fname) |
| 975 | ;; set real size and modtime | 975 | ;; set real size and modtime |
| 976 | (setq file-size (ediff-file-size fname) | 976 | (setq file-size (ediff-file-size fname) |
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el index 6cbd9bb70c6..95d93ed5899 100644 --- a/lisp/ediff-ptch.el +++ b/lisp/ediff-ptch.el | |||
| @@ -408,7 +408,8 @@ are two possible targets for this patch. However, these files do not exist." | |||
| 408 | (defun ediff-prompt-for-patch-file () | 408 | (defun ediff-prompt-for-patch-file () |
| 409 | (let ((dir (cond (ediff-patch-default-directory) ; try patch default dir | 409 | (let ((dir (cond (ediff-patch-default-directory) ; try patch default dir |
| 410 | (ediff-use-last-dir ediff-last-dir-patch) | 410 | (ediff-use-last-dir ediff-last-dir-patch) |
| 411 | (t default-directory)))) | 411 | (t default-directory))) |
| 412 | (coding-system-for-read ediff-coding-system-for-read)) | ||
| 412 | (find-file-noselect | 413 | (find-file-noselect |
| 413 | (read-file-name | 414 | (read-file-name |
| 414 | (format "Patch is in file:%s " | 415 | (format "Patch is in file:%s " |
| @@ -445,7 +446,7 @@ are two possible targets for this patch. However, these files do not exist." | |||
| 445 | (goto-char (point-min)) | 446 | (goto-char (point-min)) |
| 446 | (and (re-search-forward ediff-context-diff-label-regexp nil t) | 447 | (and (re-search-forward ediff-context-diff-label-regexp nil t) |
| 447 | (current-buffer))))) | 448 | (current-buffer))))) |
| 448 | (t (other-buffer (current-buffer) 'visible-ok))) | 449 | (t (ediff-other-buffer (current-buffer)))) |
| 449 | 'must-match))) | 450 | 'must-match))) |
| 450 | 451 | ||
| 451 | 452 | ||
| @@ -576,6 +577,10 @@ optional argument, then use it." | |||
| 576 | ;; file for the purpose of patching. | 577 | ;; file for the purpose of patching. |
| 577 | (true-source-filename source-filename) | 578 | (true-source-filename source-filename) |
| 578 | (target-filename source-filename) | 579 | (target-filename source-filename) |
| 580 | ;; this ensures that the patch process gets patch buffer in the | ||
| 581 | ;; encoding that Emacs thinks is right for that type of text | ||
| 582 | (coding-system-for-write | ||
| 583 | (if (boundp 'buffer-file-coding-system) buffer-file-coding-system)) | ||
| 579 | target-buf buf-to-patch file-name-magic-p | 584 | target-buf buf-to-patch file-name-magic-p |
| 580 | patch-return-code ctl-buf backup-style aux-wind) | 585 | patch-return-code ctl-buf backup-style aux-wind) |
| 581 | 586 | ||
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el index 2eabfa9fc86..8d0f7395149 100644 --- a/lisp/ediff-util.el +++ b/lisp/ediff-util.el | |||
| @@ -1101,15 +1101,24 @@ of the current buffer." | |||
| 1101 | (defsubst ediff-file-checked-out-p (file) | 1101 | (defsubst ediff-file-checked-out-p (file) |
| 1102 | (or (not (featurep 'vc-hooks)) | 1102 | (or (not (featurep 'vc-hooks)) |
| 1103 | (and (vc-backend file) | 1103 | (and (vc-backend file) |
| 1104 | (or (memq (vc-state file) '(edited needs-merge)) | 1104 | (if (fboundp 'vc-state) |
| 1105 | (stringp (vc-state file)))))) | 1105 | (or (memq (vc-state file) '(edited needs-merge)) |
| 1106 | (stringp (vc-state file))) | ||
| 1107 | ;; XEmacs has no vc-state | ||
| 1108 | (vc-locking-user file)) | ||
| 1109 | ))) | ||
| 1106 | 1110 | ||
| 1107 | (defsubst ediff-file-checked-in-p (file) | 1111 | (defsubst ediff-file-checked-in-p (file) |
| 1108 | (and (featurep 'vc-hooks) | 1112 | (and (featurep 'vc-hooks) |
| 1109 | ;; CVS files are considered not checked in | 1113 | ;; CVS files are considered not checked in |
| 1110 | (not (memq (vc-backend file) '(nil CVS))) | 1114 | (not (memq (vc-backend file) '(nil CVS))) |
| 1111 | (not (memq (vc-state file) '(edited needs-merge))) | 1115 | (if (fboundp 'vc-state) |
| 1112 | (not (stringp (vc-state file))))) | 1116 | (progn |
| 1117 | (not (memq (vc-state file) '(edited needs-merge))) | ||
| 1118 | (not (stringp (vc-state file)))) | ||
| 1119 | ;; XEmacs has no vc-state | ||
| 1120 | (not (vc-locking-user file))) | ||
| 1121 | )) | ||
| 1113 | 1122 | ||
| 1114 | (defun ediff-file-compressed-p (file) | 1123 | (defun ediff-file-compressed-p (file) |
| 1115 | (condition-case nil | 1124 | (condition-case nil |
| @@ -2971,7 +2980,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." | |||
| 2971 | (defun ediff-make-temp-file (buff &optional prefix given-file start end) | 2980 | (defun ediff-make-temp-file (buff &optional prefix given-file start end) |
| 2972 | (let* ((p (ediff-convert-standard-filename (or prefix "ediff"))) | 2981 | (let* ((p (ediff-convert-standard-filename (or prefix "ediff"))) |
| 2973 | (short-p p) | 2982 | (short-p p) |
| 2974 | (coding-system-for-write 'no-conversion) | 2983 | (coding-system-for-write ediff-coding-system-for-write) |
| 2975 | f short-f) | 2984 | f short-f) |
| 2976 | (if (and (fboundp 'msdos-long-file-names) | 2985 | (if (and (fboundp 'msdos-long-file-names) |
| 2977 | (not (msdos-long-file-names)) | 2986 | (not (msdos-long-file-names)) |
| @@ -3464,7 +3473,7 @@ Ediff Control Panel to restore highlighting." | |||
| 3464 | ;; never detach | 3473 | ;; never detach |
| 3465 | (ediff-overlay-put | 3474 | (ediff-overlay-put |
| 3466 | overl (if ediff-emacs-p 'evaporate 'detachable) nil) | 3475 | overl (if ediff-emacs-p 'evaporate 'detachable) nil) |
| 3467 | ;; make vip-minibuffer-overlay open-ended | 3476 | ;; make overlay open-ended |
| 3468 | ;; In emacs, it is made open ended at creation time | 3477 | ;; In emacs, it is made open ended at creation time |
| 3469 | (if ediff-xemacs-p | 3478 | (if ediff-xemacs-p |
| 3470 | (progn | 3479 | (progn |
diff --git a/lisp/ediff.el b/lisp/ediff.el index d824128e4d0..a170d4b1a99 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | ;; Created: February 2, 1994 | 6 | ;; Created: February 2, 1994 |
| 7 | ;; Keywords: comparing, merging, patching, tools, unix | 7 | ;; Keywords: comparing, merging, patching, tools, unix |
| 8 | 8 | ||
| 9 | (defconst ediff-version "2.75" "The current version of Ediff") | 9 | (defconst ediff-version "2.76" "The current version of Ediff") |
| 10 | (defconst ediff-date "March 5, 2001" "Date of last update") | 10 | (defconst ediff-date "July 18, 2001" "Date of last update") |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | ;; This file is part of GNU Emacs. | 13 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 9033ac7ce02..d4574779412 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -74,18 +74,15 @@ | |||
| 74 | ;; given symbol foo, foo-p is the test function, foos is the set of | 74 | ;; given symbol foo, foo-p is the test function, foos is the set of |
| 75 | ;; Viper command keys | 75 | ;; Viper command keys |
| 76 | ;; (macroexpand '(viper-test-com-defun foo)) | 76 | ;; (macroexpand '(viper-test-com-defun foo)) |
| 77 | ;; (defun foo-p (com) (consp (memq (if (< com 0) (- com) com) foos))) | 77 | ;; (defun foo-p (com) (consp (memq com foos))) |
| 78 | 78 | ||
| 79 | (defmacro viper-test-com-defun (name) | 79 | (defmacro viper-test-com-defun (name) |
| 80 | (let* ((snm (symbol-name name)) | 80 | (let* ((snm (symbol-name name)) |
| 81 | (nm-p (intern (concat snm "-p"))) | 81 | (nm-p (intern (concat snm "-p"))) |
| 82 | (nms (intern (concat snm "s")))) | 82 | (nms (intern (concat snm "s")))) |
| 83 | `(defun ,nm-p (com) | 83 | `(defun ,nm-p (com) |
| 84 | (consp (viper-memq-char | 84 | (consp (viper-memq-char com ,nms) |
| 85 | (if (and (viper-characterp com) (< com 0)) | 85 | )))) |
| 86 | (- com) com) | ||
| 87 | ,nms) | ||
| 88 | )))) | ||
| 89 | 86 | ||
| 90 | ;; Variables for defining VI commands | 87 | ;; Variables for defining VI commands |
| 91 | 88 | ||
| @@ -725,10 +722,8 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 725 | viper-emacs-kbd-minor-mode) | 722 | viper-emacs-kbd-minor-mode) |
| 726 | (unwind-protect | 723 | (unwind-protect |
| 727 | (progn | 724 | (progn |
| 728 | (setq com (key-binding (setq key | 725 | (setq com |
| 729 | (if viper-xemacs-p | 726 | (key-binding (setq key (viper-read-key-sequence nil)))) |
| 730 | (read-key-sequence nil) | ||
| 731 | (read-key-sequence nil t))))) | ||
| 732 | ;; In case of binding indirection--chase definitions. | 727 | ;; In case of binding indirection--chase definitions. |
| 733 | ;; Have to do it here because we execute this command under | 728 | ;; Have to do it here because we execute this command under |
| 734 | ;; different keymaps, so command-execute may not do the | 729 | ;; different keymaps, so command-execute may not do the |
| @@ -797,6 +792,12 @@ Similar to viper-escape-to-emacs, but accepts forms rather than keystrokes." | |||
| 797 | (viper-set-mode-vars-for viper-current-state) | 792 | (viper-set-mode-vars-for viper-current-state) |
| 798 | result)) | 793 | result)) |
| 799 | 794 | ||
| 795 | ;; This executes the last kbd event in emacs mode. Is used when we want to | ||
| 796 | ;; interpret certain keys directly in emacs (as, for example, in comint mode). | ||
| 797 | (defun viper-exec-key-in-emacs (arg) | ||
| 798 | (interactive "P") | ||
| 799 | (viper-escape-to-emacs arg last-command-event)) | ||
| 800 | |||
| 800 | 801 | ||
| 801 | ;; This is needed because minor modes sometimes override essential Viper | 802 | ;; This is needed because minor modes sometimes override essential Viper |
| 802 | ;; bindings. By letting Viper know which files these modes are in, it will | 803 | ;; bindings. By letting Viper know which files these modes are in, it will |
| @@ -878,9 +879,7 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 878 | (progn | 879 | (progn |
| 879 | (let (minor-mode-map-alist) | 880 | (let (minor-mode-map-alist) |
| 880 | (viper-set-unread-command-events event) | 881 | (viper-set-unread-command-events event) |
| 881 | (setq keyseq | 882 | (setq keyseq (read-key-sequence nil 'continue-echo)) |
| 882 | (funcall | ||
| 883 | (ad-get-orig-definition 'read-key-sequence) nil)) | ||
| 884 | ) ; let | 883 | ) ; let |
| 885 | ;; If keyseq translates into something that still has ESC | 884 | ;; If keyseq translates into something that still has ESC |
| 886 | ;; at the beginning, separate ESC from the rest of the seq. | 885 | ;; at the beginning, separate ESC from the rest of the seq. |
| @@ -933,8 +932,7 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 933 | ;; this is escape event with nothing after it | 932 | ;; this is escape event with nothing after it |
| 934 | ;; put in unread-command-event and then re-read | 933 | ;; put in unread-command-event and then re-read |
| 935 | (viper-set-unread-command-events event) | 934 | (viper-set-unread-command-events event) |
| 936 | (setq keyseq | 935 | (setq keyseq (read-key-sequence nil)) |
| 937 | (funcall (ad-get-orig-definition 'read-key-sequence) nil)) | ||
| 938 | )) | 936 | )) |
| 939 | ;; not an escape event | 937 | ;; not an escape event |
| 940 | (setq keyseq (vector event))) | 938 | (setq keyseq (vector event))) |
| @@ -1121,7 +1119,8 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1121 | ;; execute apropriate region command. | 1119 | ;; execute apropriate region command. |
| 1122 | (let ((char (car com)) (com (cdr com))) | 1120 | (let ((char (car com)) (com (cdr com))) |
| 1123 | (setq prefix-arg (cons value com)) | 1121 | (setq prefix-arg (cons value com)) |
| 1124 | (if (viper= char ?r) (viper-region prefix-arg) | 1122 | (if (viper= char ?r) |
| 1123 | (viper-region prefix-arg) | ||
| 1125 | (viper-Region prefix-arg)) | 1124 | (viper-Region prefix-arg)) |
| 1126 | ;; reset prefix-arg | 1125 | ;; reset prefix-arg |
| 1127 | (setq prefix-arg nil)) | 1126 | (setq prefix-arg nil)) |
| @@ -1249,9 +1248,10 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1249 | (exchange-point-and-mark)) | 1248 | (exchange-point-and-mark)) |
| 1250 | (if (eq (preceding-char) ?\n) | 1249 | (if (eq (preceding-char) ?\n) |
| 1251 | (viper-backward-char-carefully)) ; give back the newline | 1250 | (viper-backward-char-carefully)) ; give back the newline |
| 1252 | (if (viper= com ?c) | 1251 | (if (eq viper-intermediate-command 'viper-repeat) |
| 1253 | (viper-change (mark t) (point)) | 1252 | (viper-change-subr (mark t) (point)) |
| 1254 | (viper-change-subr (mark t) (point)))) | 1253 | (viper-change (mark t) (point)) |
| 1254 | )) | ||
| 1255 | 1255 | ||
| 1256 | ;; this is invoked by viper-substitute-line | 1256 | ;; this is invoked by viper-substitute-line |
| 1257 | (defun viper-exec-Change (m-com com) | 1257 | (defun viper-exec-Change (m-com com) |
| @@ -1271,9 +1271,10 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1271 | (setq viper-use-register nil))) | 1271 | (setq viper-use-register nil))) |
| 1272 | (delete-region (mark t) (point))) | 1272 | (delete-region (mark t) (point))) |
| 1273 | (open-line 1) | 1273 | (open-line 1) |
| 1274 | (if (viper= com ?C) | 1274 | (if (eq viper-intermediate-command 'viper-repeat) |
| 1275 | (viper-change-state-to-insert) | 1275 | (viper-yank-last-insertion) |
| 1276 | (viper-yank-last-insertion))) | 1276 | (viper-change-state-to-insert) |
| 1277 | )) | ||
| 1277 | 1278 | ||
| 1278 | (defun viper-exec-delete (m-com com) | 1279 | (defun viper-exec-delete (m-com com) |
| 1279 | (or (and (markerp viper-com-point) (marker-position viper-com-point)) | 1280 | (or (and (markerp viper-com-point) (marker-position viper-com-point)) |
| @@ -1455,15 +1456,13 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1455 | ;; this is the special command `#' | 1456 | ;; this is the special command `#' |
| 1456 | (if (> com 128) | 1457 | (if (> com 128) |
| 1457 | (viper-special-prefix-com (- com 128)) | 1458 | (viper-special-prefix-com (- com 128)) |
| 1458 | (let ((fn (aref viper-exec-array (if (< com 0) (- com) com)))) | 1459 | (let ((fn (aref viper-exec-array com))) |
| 1459 | (if (null fn) | 1460 | (if (null fn) |
| 1460 | (error "%c: %s" com viper-InvalidViCommand) | 1461 | (error "%c: %s" com viper-InvalidViCommand) |
| 1461 | (funcall fn m-com com)))) | 1462 | (funcall fn m-com com)))) |
| 1462 | (if (viper-dotable-command-p com) | 1463 | (if (viper-dotable-command-p com) |
| 1463 | (viper-set-destructive-command | 1464 | (viper-set-destructive-command |
| 1464 | (list m-com val | 1465 | (list m-com val com reg nil nil))) |
| 1465 | (if (viper-memq-char com (list ?c ?C ?!)) (- com) com) | ||
| 1466 | reg nil nil))) | ||
| 1467 | )) | 1466 | )) |
| 1468 | 1467 | ||
| 1469 | 1468 | ||
| @@ -1889,8 +1888,7 @@ Undo previous insertion and inserts new." | |||
| 1889 | (if (fboundp 'minibuffer-prompt-end) | 1888 | (if (fboundp 'minibuffer-prompt-end) |
| 1890 | (delete-region (minibuffer-prompt-end) (point-max)) | 1889 | (delete-region (minibuffer-prompt-end) (point-max)) |
| 1891 | (erase-buffer)) | 1890 | (erase-buffer)) |
| 1892 | (insert initial))) | 1891 | (insert initial)))) |
| 1893 | (viper-minibuffer-setup-sentinel)) | ||
| 1894 | 1892 | ||
| 1895 | (defsubst viper-minibuffer-real-start () | 1893 | (defsubst viper-minibuffer-real-start () |
| 1896 | (if (fboundp 'minibuffer-prompt-end) | 1894 | (if (fboundp 'minibuffer-prompt-end) |
| @@ -1994,7 +1992,16 @@ problems." | |||
| 1994 | ;; KEYMAP is used, if given, instead of minibuffer-local-map. | 1992 | ;; KEYMAP is used, if given, instead of minibuffer-local-map. |
| 1995 | ;; INIT-MESSAGE is the message temporarily displayed after entering the | 1993 | ;; INIT-MESSAGE is the message temporarily displayed after entering the |
| 1996 | ;; minibuffer. | 1994 | ;; minibuffer. |
| 1997 | (let ((minibuffer-setup-hook 'viper-minibuffer-standard-hook) | 1995 | (let ((minibuffer-setup-hook |
| 1996 | ;; stolen from add-hook | ||
| 1997 | (let ((old | ||
| 1998 | (if (boundp 'minibuffer-setup-hook) | ||
| 1999 | minibuffer-setup-hook | ||
| 2000 | nil))) | ||
| 2001 | (cons | ||
| 2002 | 'viper-minibuffer-standard-hook | ||
| 2003 | (if (or (not (listp old)) (eq (car old) 'lambda)) | ||
| 2004 | (list old) old)))) | ||
| 1998 | (val "") | 2005 | (val "") |
| 1999 | (padding "") | 2006 | (padding "") |
| 2000 | temp-msg) | 2007 | temp-msg) |
| @@ -2059,7 +2066,7 @@ problems." | |||
| 2059 | (let ((val (viper-p-val arg)) | 2066 | (let ((val (viper-p-val arg)) |
| 2060 | (com (viper-getcom arg))) | 2067 | (com (viper-getcom arg))) |
| 2061 | (viper-set-destructive-command (list 'viper-insert val ?r nil nil nil)) | 2068 | (viper-set-destructive-command (list 'viper-insert val ?r nil nil nil)) |
| 2062 | (if com | 2069 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2063 | (viper-loop val (viper-yank-last-insertion)) | 2070 | (viper-loop val (viper-yank-last-insertion)) |
| 2064 | (viper-change-state-to-insert)))) | 2071 | (viper-change-state-to-insert)))) |
| 2065 | 2072 | ||
| @@ -2071,7 +2078,7 @@ problems." | |||
| 2071 | (com (viper-getcom arg))) | 2078 | (com (viper-getcom arg))) |
| 2072 | (viper-set-destructive-command (list 'viper-append val ?r nil nil nil)) | 2079 | (viper-set-destructive-command (list 'viper-append val ?r nil nil nil)) |
| 2073 | (if (not (eolp)) (forward-char)) | 2080 | (if (not (eolp)) (forward-char)) |
| 2074 | (if (viper= com ?r) | 2081 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2075 | (viper-loop val (viper-yank-last-insertion)) | 2082 | (viper-loop val (viper-yank-last-insertion)) |
| 2076 | (viper-change-state-to-insert)))) | 2083 | (viper-change-state-to-insert)))) |
| 2077 | 2084 | ||
| @@ -2083,7 +2090,7 @@ problems." | |||
| 2083 | (com (viper-getcom arg))) | 2090 | (com (viper-getcom arg))) |
| 2084 | (viper-set-destructive-command (list 'viper-Append val ?r nil nil nil)) | 2091 | (viper-set-destructive-command (list 'viper-Append val ?r nil nil nil)) |
| 2085 | (end-of-line) | 2092 | (end-of-line) |
| 2086 | (if (viper= com ?r) | 2093 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2087 | (viper-loop val (viper-yank-last-insertion)) | 2094 | (viper-loop val (viper-yank-last-insertion)) |
| 2088 | (viper-change-state-to-insert)))) | 2095 | (viper-change-state-to-insert)))) |
| 2089 | 2096 | ||
| @@ -2095,7 +2102,7 @@ problems." | |||
| 2095 | (com (viper-getcom arg))) | 2102 | (com (viper-getcom arg))) |
| 2096 | (viper-set-destructive-command (list 'viper-Insert val ?r nil nil nil)) | 2103 | (viper-set-destructive-command (list 'viper-Insert val ?r nil nil nil)) |
| 2097 | (back-to-indentation) | 2104 | (back-to-indentation) |
| 2098 | (if (viper= com ?r) | 2105 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2099 | (viper-loop val (viper-yank-last-insertion)) | 2106 | (viper-loop val (viper-yank-last-insertion)) |
| 2100 | (viper-change-state-to-insert)))) | 2107 | (viper-change-state-to-insert)))) |
| 2101 | 2108 | ||
| @@ -2107,26 +2114,15 @@ problems." | |||
| 2107 | (com (viper-getcom arg))) | 2114 | (com (viper-getcom arg))) |
| 2108 | (viper-set-destructive-command (list 'viper-open-line val ?r nil nil nil)) | 2115 | (viper-set-destructive-command (list 'viper-open-line val ?r nil nil nil)) |
| 2109 | (let ((col (current-indentation))) | 2116 | (let ((col (current-indentation))) |
| 2110 | (if (viper= com ?r) | 2117 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2111 | (viper-loop val | 2118 | (viper-loop val |
| 2112 | (end-of-line) | 2119 | (end-of-line) |
| 2113 | (newline 1) | 2120 | (newline 1) |
| 2114 | (if viper-auto-indent | 2121 | (viper-indent-line col) |
| 2115 | (progn | ||
| 2116 | (setq viper-cted t) | ||
| 2117 | (if viper-electric-mode | ||
| 2118 | (indent-according-to-mode) | ||
| 2119 | (indent-to col)) | ||
| 2120 | )) | ||
| 2121 | (viper-yank-last-insertion)) | 2122 | (viper-yank-last-insertion)) |
| 2122 | (end-of-line) | 2123 | (end-of-line) |
| 2123 | (newline 1) | 2124 | (newline 1) |
| 2124 | (if viper-auto-indent | 2125 | (viper-indent-line col) |
| 2125 | (progn | ||
| 2126 | (setq viper-cted t) | ||
| 2127 | (if viper-electric-mode | ||
| 2128 | (indent-according-to-mode) | ||
| 2129 | (indent-to col)))) | ||
| 2130 | (viper-change-state-to-insert))))) | 2126 | (viper-change-state-to-insert))))) |
| 2131 | 2127 | ||
| 2132 | (defun viper-Open-line (arg) | 2128 | (defun viper-Open-line (arg) |
| @@ -2137,27 +2133,15 @@ problems." | |||
| 2137 | (com (viper-getcom arg))) | 2133 | (com (viper-getcom arg))) |
| 2138 | (viper-set-destructive-command (list 'viper-Open-line val ?r nil nil nil)) | 2134 | (viper-set-destructive-command (list 'viper-Open-line val ?r nil nil nil)) |
| 2139 | (let ((col (current-indentation))) | 2135 | (let ((col (current-indentation))) |
| 2140 | (if (viper= com ?r) | 2136 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2141 | (viper-loop val | 2137 | (viper-loop val |
| 2142 | (beginning-of-line) | 2138 | (beginning-of-line) |
| 2143 | (open-line 1) | 2139 | (open-line 1) |
| 2144 | (if viper-auto-indent | 2140 | (viper-indent-line col) |
| 2145 | (progn | ||
| 2146 | (setq viper-cted t) | ||
| 2147 | (if viper-electric-mode | ||
| 2148 | (indent-according-to-mode) | ||
| 2149 | (indent-to col)) | ||
| 2150 | )) | ||
| 2151 | (viper-yank-last-insertion)) | 2141 | (viper-yank-last-insertion)) |
| 2152 | (beginning-of-line) | 2142 | (beginning-of-line) |
| 2153 | (open-line 1) | 2143 | (open-line 1) |
| 2154 | (if viper-auto-indent | 2144 | (viper-indent-line col) |
| 2155 | (progn | ||
| 2156 | (setq viper-cted t) | ||
| 2157 | (if viper-electric-mode | ||
| 2158 | (indent-according-to-mode) | ||
| 2159 | (indent-to col)) | ||
| 2160 | )) | ||
| 2161 | (viper-change-state-to-insert))))) | 2145 | (viper-change-state-to-insert))))) |
| 2162 | 2146 | ||
| 2163 | (defun viper-open-line-at-point (arg) | 2147 | (defun viper-open-line-at-point (arg) |
| @@ -2168,13 +2152,14 @@ problems." | |||
| 2168 | (com (viper-getcom arg))) | 2152 | (com (viper-getcom arg))) |
| 2169 | (viper-set-destructive-command | 2153 | (viper-set-destructive-command |
| 2170 | (list 'viper-open-line-at-point val ?r nil nil nil)) | 2154 | (list 'viper-open-line-at-point val ?r nil nil nil)) |
| 2171 | (if (viper= com ?r) | 2155 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2172 | (viper-loop val | 2156 | (viper-loop val |
| 2173 | (open-line 1) | 2157 | (open-line 1) |
| 2174 | (viper-yank-last-insertion)) | 2158 | (viper-yank-last-insertion)) |
| 2175 | (open-line 1) | 2159 | (open-line 1) |
| 2176 | (viper-change-state-to-insert)))) | 2160 | (viper-change-state-to-insert)))) |
| 2177 | 2161 | ||
| 2162 | ;; bound to s | ||
| 2178 | (defun viper-substitute (arg) | 2163 | (defun viper-substitute (arg) |
| 2179 | "Substitute characters." | 2164 | "Substitute characters." |
| 2180 | (interactive "P") | 2165 | (interactive "P") |
| @@ -2182,9 +2167,10 @@ problems." | |||
| 2182 | (com (viper-getcom arg))) | 2167 | (com (viper-getcom arg))) |
| 2183 | (push-mark nil t) | 2168 | (push-mark nil t) |
| 2184 | (forward-char val) | 2169 | (forward-char val) |
| 2185 | (if (viper= com ?r) | 2170 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2186 | (viper-change-subr (mark t) (point)) | 2171 | (viper-change-subr (mark t) (point)) |
| 2187 | (viper-change (mark t) (point))) | 2172 | (viper-change (mark t) (point))) |
| 2173 | ;; com is set to ?r when we repeat this comand with dot | ||
| 2188 | (viper-set-destructive-command (list 'viper-substitute val ?r nil nil nil)) | 2174 | (viper-set-destructive-command (list 'viper-substitute val ?r nil nil nil)) |
| 2189 | )) | 2175 | )) |
| 2190 | 2176 | ||
| @@ -2356,7 +2342,7 @@ These keys are ESC, RET, and LineFeed" | |||
| 2356 | (if (eq this-command 'viper-intercept-ESC-key) | 2342 | (if (eq this-command 'viper-intercept-ESC-key) |
| 2357 | (setq com 'viper-exit-insert-state) | 2343 | (setq com 'viper-exit-insert-state) |
| 2358 | (viper-set-unread-command-events last-input-char) | 2344 | (viper-set-unread-command-events last-input-char) |
| 2359 | (setq com (key-binding (read-key-sequence nil)))) | 2345 | (setq com (key-binding (viper-read-key-sequence nil)))) |
| 2360 | 2346 | ||
| 2361 | (condition-case conds | 2347 | (condition-case conds |
| 2362 | (command-execute com) | 2348 | (command-execute com) |
| @@ -2405,11 +2391,11 @@ These keys are ESC, RET, and LineFeed" | |||
| 2405 | (let ((val (viper-p-val arg)) | 2391 | (let ((val (viper-p-val arg)) |
| 2406 | (com (viper-getcom arg)) (len)) | 2392 | (com (viper-getcom arg)) (len)) |
| 2407 | (viper-set-destructive-command (list 'viper-overwrite val ?r nil nil nil)) | 2393 | (viper-set-destructive-command (list 'viper-overwrite val ?r nil nil nil)) |
| 2408 | (if com | 2394 | (if (eq viper-intermediate-command 'viper-repeat) |
| 2409 | (progn | 2395 | (progn |
| 2410 | ;; Viper saves inserted text in viper-last-insertion | 2396 | ;; Viper saves inserted text in viper-last-insertion |
| 2411 | (setq len (length viper-last-insertion)) | 2397 | (setq len (length viper-last-insertion)) |
| 2412 | (delete-char len) | 2398 | (delete-char (min len (- (point-max) (point) 1))) |
| 2413 | (viper-loop val (viper-yank-last-insertion))) | 2399 | (viper-loop val (viper-yank-last-insertion))) |
| 2414 | (setq last-command 'viper-overwrite) | 2400 | (setq last-command 'viper-overwrite) |
| 2415 | (viper-set-complex-command-for-undo) | 2401 | (viper-set-complex-command-for-undo) |
| @@ -2476,7 +2462,7 @@ These keys are ESC, RET, and LineFeed" | |||
| 2476 | 2462 | ||
| 2477 | (defun viper-replace-char-subr (com arg) | 2463 | (defun viper-replace-char-subr (com arg) |
| 2478 | (let (char) | 2464 | (let (char) |
| 2479 | (setq char (if (viper= com ?r) | 2465 | (setq char (if (eq viper-intermediate-command 'viper-repeat) |
| 2480 | viper-d-char | 2466 | viper-d-char |
| 2481 | (read-char))) | 2467 | (read-char))) |
| 2482 | (let (inhibit-quit) ; preserve consistency of undo-list and iso-accents | 2468 | (let (inhibit-quit) ; preserve consistency of undo-list and iso-accents |
| @@ -2694,15 +2680,17 @@ On reaching beginning of line, stop and signal error." | |||
| 2694 | (com (viper-getcom arg))) | 2680 | (com (viper-getcom arg))) |
| 2695 | (if com (viper-move-marker-locally 'viper-com-point (point))) | 2681 | (if com (viper-move-marker-locally 'viper-com-point (point))) |
| 2696 | (viper-forward-word-kernel val) | 2682 | (viper-forward-word-kernel val) |
| 2697 | (if com (progn | 2683 | (if com |
| 2698 | (cond ((viper-memq-char com (list ?c (- ?c))) | 2684 | (progn |
| 2699 | (viper-separator-skipback-special 'twice viper-com-point)) | 2685 | (cond ((viper-char-equal com ?c) |
| 2700 | ;; Yank words including the whitespace, but not newline | 2686 | (viper-separator-skipback-special 'twice viper-com-point)) |
| 2701 | ((viper-memq-char com (list ?y (- ?y))) | 2687 | ;; Yank words including the whitespace, but not newline |
| 2702 | (viper-separator-skipback-special nil viper-com-point)) | 2688 | ((viper-char-equal com ?y) |
| 2703 | ((viper-dotable-command-p com) | 2689 | (viper-separator-skipback-special nil viper-com-point)) |
| 2704 | (viper-separator-skipback-special nil viper-com-point))) | 2690 | ((viper-dotable-command-p com) |
| 2705 | (viper-execute-com 'viper-forward-word val com))))) | 2691 | (viper-separator-skipback-special nil viper-com-point))) |
| 2692 | (viper-execute-com 'viper-forward-word val com))) | ||
| 2693 | )) | ||
| 2706 | 2694 | ||
| 2707 | 2695 | ||
| 2708 | (defun viper-forward-Word (arg) | 2696 | (defun viper-forward-Word (arg) |
| @@ -2716,10 +2704,10 @@ On reaching beginning of line, stop and signal error." | |||
| 2716 | (viper-skip-nonseparators 'forward) | 2704 | (viper-skip-nonseparators 'forward) |
| 2717 | (viper-skip-separators t)) | 2705 | (viper-skip-separators t)) |
| 2718 | (if com (progn | 2706 | (if com (progn |
| 2719 | (cond ((viper-memq-char com (list ?c (- ?c))) | 2707 | (cond ((viper-char-equal com ?c) |
| 2720 | (viper-separator-skipback-special 'twice viper-com-point)) | 2708 | (viper-separator-skipback-special 'twice viper-com-point)) |
| 2721 | ;; Yank words including the whitespace, but not newline | 2709 | ;; Yank words including the whitespace, but not newline |
| 2722 | ((viper-memq-char com (list ?y (- ?y))) | 2710 | ((viper-char-equal com ?y) |
| 2723 | (viper-separator-skipback-special nil viper-com-point)) | 2711 | (viper-separator-skipback-special nil viper-com-point)) |
| 2724 | ((viper-dotable-command-p com) | 2712 | ((viper-dotable-command-p com) |
| 2725 | (viper-separator-skipback-special nil viper-com-point))) | 2713 | (viper-separator-skipback-special nil viper-com-point))) |
| @@ -4234,7 +4222,7 @@ and regexp replace." | |||
| 4234 | (interactive) | 4222 | (interactive) |
| 4235 | (let ((char (read-char))) | 4223 | (let ((char (read-char))) |
| 4236 | (cond ((and (<= ?a char) (<= char ?z)) | 4224 | (cond ((and (<= ?a char) (<= char ?z)) |
| 4237 | (point-to-register (1+ (- char ?a)))) | 4225 | (point-to-register (viper-int-to-char (1+ (- char ?a))))) |
| 4238 | ((viper= char ?<) (viper-mark-beginning-of-buffer)) | 4226 | ((viper= char ?<) (viper-mark-beginning-of-buffer)) |
| 4239 | ((viper= char ?>) (viper-mark-end-of-buffer)) | 4227 | ((viper= char ?>) (viper-mark-end-of-buffer)) |
| 4240 | ((viper= char ?.) (viper-set-mark-if-necessary)) | 4228 | ((viper= char ?.) (viper-set-mark-if-necessary)) |
| @@ -4304,7 +4292,7 @@ One can use `` and '' to temporarily jump 1 step back." | |||
| 4304 | (backward-char 1))) | 4292 | (backward-char 1))) |
| 4305 | (cond ((viper-valid-register char '(letter)) | 4293 | (cond ((viper-valid-register char '(letter)) |
| 4306 | (let* ((buff (current-buffer)) | 4294 | (let* ((buff (current-buffer)) |
| 4307 | (reg (1+ (- char ?a))) | 4295 | (reg (viper-int-to-char (1+ (- char ?a)))) |
| 4308 | (text-marker (get-register reg))) | 4296 | (text-marker (get-register reg))) |
| 4309 | ;; If marker points to file that had markers set (and those markers | 4297 | ;; If marker points to file that had markers set (and those markers |
| 4310 | ;; were saved (as e.g., in session.el), then restore those markers | 4298 | ;; were saved (as e.g., in session.el), then restore those markers |
| @@ -4410,6 +4398,19 @@ One can use `` and '' to temporarily jump 1 step back." | |||
| 4410 | (if (or (bolp) (viper-looking-back "[^ \t]")) | 4398 | (if (or (bolp) (viper-looking-back "[^ \t]")) |
| 4411 | (setq viper-cted nil))))) | 4399 | (setq viper-cted nil))))) |
| 4412 | 4400 | ||
| 4401 | ;; do smart indent | ||
| 4402 | (defun viper-indent-line (col) | ||
| 4403 | (if viper-auto-indent | ||
| 4404 | (progn | ||
| 4405 | (setq viper-cted t) | ||
| 4406 | (if (and viper-electric-mode | ||
| 4407 | (not (memq major-mode '(fundamental-mode | ||
| 4408 | text-mode | ||
| 4409 | paragraph-indent-text-mode)))) | ||
| 4410 | (indent-according-to-mode) | ||
| 4411 | (indent-to col))))) | ||
| 4412 | |||
| 4413 | |||
| 4413 | (defun viper-autoindent () | 4414 | (defun viper-autoindent () |
| 4414 | "Auto Indentation, Vi-style." | 4415 | "Auto Indentation, Vi-style." |
| 4415 | (interactive) | 4416 | (interactive) |
| @@ -4427,17 +4428,7 @@ One can use `` and '' to temporarily jump 1 step back." | |||
| 4427 | ;; use \n instead of newline, or else <Return> will move the insert point | 4428 | ;; use \n instead of newline, or else <Return> will move the insert point |
| 4428 | ;;(newline 1) | 4429 | ;;(newline 1) |
| 4429 | (insert "\n") | 4430 | (insert "\n") |
| 4430 | (if viper-auto-indent | 4431 | (viper-indent-line viper-current-indent) |
| 4431 | (progn | ||
| 4432 | (setq viper-cted t) | ||
| 4433 | (if (and viper-electric-mode | ||
| 4434 | (not | ||
| 4435 | (memq major-mode '(fundamental-mode | ||
| 4436 | text-mode | ||
| 4437 | paragraph-indent-text-mode )))) | ||
| 4438 | (indent-according-to-mode) | ||
| 4439 | (indent-to viper-current-indent)) | ||
| 4440 | )) | ||
| 4441 | )) | 4432 | )) |
| 4442 | 4433 | ||
| 4443 | 4434 | ||
| @@ -4469,7 +4460,7 @@ One can use `` and '' to temporarily jump 1 step back." | |||
| 4469 | ((viper= ?\] reg) | 4460 | ((viper= ?\] reg) |
| 4470 | (viper-heading-end arg)) | 4461 | (viper-heading-end arg)) |
| 4471 | ((viper-valid-register reg '(letter)) | 4462 | ((viper-valid-register reg '(letter)) |
| 4472 | (let* ((val (get-register (1+ (- reg ?a)))) | 4463 | (let* ((val (get-register (viper-int-to-char (1+ (- reg ?a))))) |
| 4473 | (buf (if (not (markerp val)) | 4464 | (buf (if (not (markerp val)) |
| 4474 | (error viper-EmptyTextmarker reg) | 4465 | (error viper-EmptyTextmarker reg) |
| 4475 | (marker-buffer val))) | 4466 | (marker-buffer val))) |
| @@ -4699,17 +4690,17 @@ Please, specify your level now: ") | |||
| 4699 | (if (and enforce-buffer | 4690 | (if (and enforce-buffer |
| 4700 | (not (equal (current-buffer) (marker-buffer val)))) | 4691 | (not (equal (current-buffer) (marker-buffer val)))) |
| 4701 | (error (concat viper-EmptyTextmarker " in this buffer") | 4692 | (error (concat viper-EmptyTextmarker " in this buffer") |
| 4702 | (1- (+ char ?a)))) | 4693 | (viper-int-to-char (1- (+ char ?a))))) |
| 4703 | (pop-to-buffer (marker-buffer val)) | 4694 | (pop-to-buffer (marker-buffer val)) |
| 4704 | (goto-char val)) | 4695 | (goto-char val)) |
| 4705 | ((and (consp val) (eq (car val) 'file)) | 4696 | ((and (consp val) (eq (car val) 'file)) |
| 4706 | (find-file (cdr val))) | 4697 | (find-file (cdr val))) |
| 4707 | (t | 4698 | (t |
| 4708 | (error viper-EmptyTextmarker (1- (+ char ?a))))))) | 4699 | (error viper-EmptyTextmarker (viper-int-to-char (1- (+ char ?a)))))))) |
| 4709 | 4700 | ||
| 4710 | 4701 | ||
| 4711 | (defun viper-save-kill-buffer () | 4702 | (defun viper-save-kill-buffer () |
| 4712 | "Save then kill current buffer. " | 4703 | "Save then kill current buffer." |
| 4713 | (interactive) | 4704 | (interactive) |
| 4714 | (if (< viper-expert-level 2) | 4705 | (if (< viper-expert-level 2) |
| 4715 | (save-buffers-kill-emacs) | 4706 | (save-buffers-kill-emacs) |
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index 3b01dd05241..398e5a937c6 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el | |||
| @@ -122,6 +122,7 @@ | |||
| 122 | ("k" (ex-mark) one-letter) | 122 | ("k" (ex-mark) one-letter) |
| 123 | ("kmark" (ex-mark)) | 123 | ("kmark" (ex-mark)) |
| 124 | ("m" "move") | 124 | ("m" "move") |
| 125 | ("make" (ex-compile)) | ||
| 125 | ; old viper doesn't specify a default for "ma" so leave it undefined | 126 | ; old viper doesn't specify a default for "ma" so leave it undefined |
| 126 | ("map" (ex-map)) | 127 | ("map" (ex-map)) |
| 127 | ("mark" (ex-mark)) | 128 | ("mark" (ex-mark)) |
| @@ -215,7 +216,7 @@ | |||
| 215 | ;; If there is no appropriate key (no match or duplicate matches) return nil | 216 | ;; If there is no appropriate key (no match or duplicate matches) return nil |
| 216 | (defun ex-cmd-assoc (key list) | 217 | (defun ex-cmd-assoc (key list) |
| 217 | (let ((entry (try-completion key list)) | 218 | (let ((entry (try-completion key list)) |
| 218 | result onelet) | 219 | result) |
| 219 | (setq result (cond | 220 | (setq result (cond |
| 220 | ((eq entry t) (assoc key list)) | 221 | ((eq entry t) (assoc key list)) |
| 221 | ((stringp entry) (or (ex-splice-args-in-1-letr-cmd key list) | 222 | ((stringp entry) (or (ex-splice-args-in-1-letr-cmd key list) |
| @@ -320,6 +321,11 @@ Don't put `-c' here, as it is added automatically." | |||
| 320 | :type '(choice (const nil) string) | 321 | :type '(choice (const nil) string) |
| 321 | :group 'viper-ex) | 322 | :group 'viper-ex) |
| 322 | 323 | ||
| 324 | (defcustom ex-compile-command "make" | ||
| 325 | "The comand to run when the user types :make." | ||
| 326 | :type 'string | ||
| 327 | :group 'viper-ex) | ||
| 328 | |||
| 323 | (defcustom viper-glob-function | 329 | (defcustom viper-glob-function |
| 324 | (cond (ex-unix-type-shell 'viper-glob-unix-files) | 330 | (cond (ex-unix-type-shell 'viper-glob-unix-files) |
| 325 | ((eq system-type 'emx) 'viper-glob-mswindows-files) ; OS/2 | 331 | ((eq system-type 'emx) 'viper-glob-mswindows-files) ; OS/2 |
| @@ -643,7 +649,7 @@ reversed." | |||
| 643 | 'viper-ex-history | 649 | 'viper-ex-history |
| 644 | ;; no default when working on region | 650 | ;; no default when working on region |
| 645 | (if initial-str | 651 | (if initial-str |
| 646 | "none" | 652 | nil |
| 647 | (car viper-ex-history)) | 653 | (car viper-ex-history)) |
| 648 | map | 654 | map |
| 649 | (if initial-str | 655 | (if initial-str |
| @@ -855,8 +861,9 @@ reversed." | |||
| 855 | (save-excursion | 861 | (save-excursion |
| 856 | (if (null ex-token) | 862 | (if (null ex-token) |
| 857 | (exchange-point-and-mark) | 863 | (exchange-point-and-mark) |
| 858 | (goto-char (viper-register-to-point | 864 | (goto-char |
| 859 | (1+ (- ex-token ?a)) 'enforce-buffer))) | 865 | (viper-register-to-point |
| 866 | (viper-int-to-char (1+ (- ex-token ?a))) 'enforce-buffer))) | ||
| 860 | (setq address (point-marker))))) | 867 | (setq address (point-marker))))) |
| 861 | address)) | 868 | address)) |
| 862 | 869 | ||
| @@ -1454,7 +1461,7 @@ reversed." | |||
| 1454 | (error "`%s' requires a following letter" ex-token)))) | 1461 | (error "`%s' requires a following letter" ex-token)))) |
| 1455 | (save-excursion | 1462 | (save-excursion |
| 1456 | (goto-char (car ex-addresses)) | 1463 | (goto-char (car ex-addresses)) |
| 1457 | (point-to-register (1+ (- char ?a)))))) | 1464 | (point-to-register (viper-int-to-char (1+ (- char ?a))))))) |
| 1458 | 1465 | ||
| 1459 | 1466 | ||
| 1460 | 1467 | ||
| @@ -2159,6 +2166,29 @@ Please contact your system administrator. " | |||
| 2159 | (shell-command-on-region (point) (mark t) command t)) | 2166 | (shell-command-on-region (point) (mark t) command t)) |
| 2160 | (goto-char beg))))) | 2167 | (goto-char beg))))) |
| 2161 | 2168 | ||
| 2169 | (defun ex-compile () | ||
| 2170 | "Reads args from the command line, then runs make with the args. | ||
| 2171 | If no args are given, then it runs the last compile command. | ||
| 2172 | Type 'mak ' (including the space) to run make with no args." | ||
| 2173 | (let (args) | ||
| 2174 | (save-window-excursion | ||
| 2175 | (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) | ||
| 2176 | (set-buffer viper-ex-work-buf) | ||
| 2177 | (setq args (buffer-substring (point) (point-max))) | ||
| 2178 | (end-of-line)) | ||
| 2179 | ;; Remove the newline that may (will?) be at the end of the args | ||
| 2180 | (if (string= "\n" (substring args (1- (length args)))) | ||
| 2181 | (setq args (substring args 0 (1- (length args))))) | ||
| 2182 | ;; Run last command if no args given, else construct a new command. | ||
| 2183 | (setq args | ||
| 2184 | (if (string= "" args) | ||
| 2185 | (if (boundp 'compile-command) | ||
| 2186 | compile-command | ||
| 2187 | ex-compile-command) | ||
| 2188 | (concat ex-compile-command " " args))) | ||
| 2189 | (compile args) | ||
| 2190 | )) | ||
| 2191 | |||
| 2162 | ;; Print line number | 2192 | ;; Print line number |
| 2163 | (defun ex-line-no () | 2193 | (defun ex-line-no () |
| 2164 | (message "%d" | 2194 | (message "%d" |
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 2df1b388755..73155a05798 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el | |||
| @@ -445,8 +445,8 @@ Useful in some modes, such as Gnus, MH, etc.") | |||
| 445 | 445 | ||
| 446 | (defvar viper-comint-mode-modifier-map (make-sparse-keymap) | 446 | (defvar viper-comint-mode-modifier-map (make-sparse-keymap) |
| 447 | "This map modifies comint mode.") | 447 | "This map modifies comint mode.") |
| 448 | (define-key viper-comint-mode-modifier-map "\C-m" 'comint-send-input) | 448 | (define-key viper-comint-mode-modifier-map "\C-m" 'viper-exec-key-in-emacs) |
| 449 | (define-key viper-comint-mode-modifier-map "\C-d" 'comint-delchar-or-maybe-eof) | 449 | (define-key viper-comint-mode-modifier-map "\C-d" 'viper-exec-key-in-emacs) |
| 450 | 450 | ||
| 451 | (defvar viper-dired-modifier-map (make-sparse-keymap) | 451 | (defvar viper-dired-modifier-map (make-sparse-keymap) |
| 452 | "This map modifies Dired behavior.") | 452 | "This map modifies Dired behavior.") |
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index a27f20b626f..cacd8debd46 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; viper-util.el --- utilities used by viper.el | 1 | ;;; viper-util.el --- Utilities used by viper.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -103,16 +103,26 @@ | |||
| 103 | (symbol-function | 103 | (symbol-function |
| 104 | (if viper-xemacs-p 'characterp 'integerp))) | 104 | (if viper-xemacs-p 'characterp 'integerp))) |
| 105 | 105 | ||
| 106 | (fset 'viper-int-to-char | ||
| 107 | (symbol-function | ||
| 108 | (if viper-xemacs-p 'int-to-char 'identity))) | ||
| 109 | |||
| 106 | ;; CHAR is supposed to be a char or an integer (positive or negative) | 110 | ;; CHAR is supposed to be a char or an integer (positive or negative) |
| 107 | ;; LIST is a list of chars, nil, and negative numbers | 111 | ;; LIST is a list of chars, nil, and negative numbers |
| 108 | ;; Check if CHAR is a member by trying to convert into integers, if necessary. | 112 | ;; Check if CHAR is a member by trying to convert in characters, if necessary. |
| 109 | ;; Introduced for compatibility with XEmacs, where integers are not the same as | 113 | ;; Introduced for compatibility with XEmacs, where integers are not the same as |
| 110 | ;; chars. | 114 | ;; chars. |
| 111 | (defun viper-memq-char (char list) | 115 | (defun viper-memq-char (char list) |
| 112 | (cond (viper-emacs-p (memq char list)) | 116 | (cond ((and (integerp char) (>= char 0)) |
| 113 | ((and (integerp char) (>= char 0)) (memq (int-to-char char) list)) | 117 | (memq (viper-int-to-char char) list)) |
| 114 | ((memq char list)))) | 118 | ((memq char list)))) |
| 115 | 119 | ||
| 120 | ;; Check if char-or-int and char are the same as characters | ||
| 121 | (defun viper-char-equal (char-or-int char) | ||
| 122 | (cond ((and (integerp char-or-int) (>= char-or-int 0)) | ||
| 123 | (= (viper-int-to-char char-or-int) char)) | ||
| 124 | ((eq char-or-int char)))) | ||
| 125 | |||
| 116 | ;; Like =, but accommodates null and also is t for eq-objects | 126 | ;; Like =, but accommodates null and also is t for eq-objects |
| 117 | (defun viper= (char char1) | 127 | (defun viper= (char char1) |
| 118 | (cond ((eq char char1) t) | 128 | (cond ((eq char char1) t) |
| @@ -683,8 +693,13 @@ | |||
| 683 | (and (featurep 'vc-hooks) | 693 | (and (featurep 'vc-hooks) |
| 684 | ;; CVS files are considered not checked in | 694 | ;; CVS files are considered not checked in |
| 685 | (not (memq (vc-backend file) '(nil CVS))) | 695 | (not (memq (vc-backend file) '(nil CVS))) |
| 686 | (not (memq (vc-state file) '(edited needs-merge))) | 696 | (if (fboundp 'vc-state) |
| 687 | (not (stringp (vc-state file))))) | 697 | (progn |
| 698 | (not (memq (vc-state file) '(edited needs-merge))) | ||
| 699 | (not (stringp (vc-state file)))) | ||
| 700 | ;; XEmacs has no vc-state | ||
| 701 | (not (vc-locking-user file))) | ||
| 702 | )) | ||
| 688 | 703 | ||
| 689 | ;; checkout if visited file is checked in | 704 | ;; checkout if visited file is checked in |
| 690 | (defun viper-maybe-checkout (buf) | 705 | (defun viper-maybe-checkout (buf) |
| @@ -926,7 +941,7 @@ | |||
| 926 | help-char key) | 941 | help-char key) |
| 927 | (use-global-map viper-overriding-map) | 942 | (use-global-map viper-overriding-map) |
| 928 | (unwind-protect | 943 | (unwind-protect |
| 929 | (setq key (elt (read-key-sequence nil) 0)) | 944 | (setq key (elt (viper-read-key-sequence nil) 0)) |
| 930 | (use-global-map global-map)) | 945 | (use-global-map global-map)) |
| 931 | key)) | 946 | key)) |
| 932 | 947 | ||
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 792bb1578b0..277ae0c408e 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; viper.el --- a full-featured Vi emulator for GNU Emacs and XEmacs, | 1 | ;;; viper.el --- A full-featured Vi emulator for GNU Emacs and XEmacs, |
| 2 | ;; a VI Plan for Emacs Rescue, | 2 | ;; a VI Plan for Emacs Rescue, |
| 3 | ;; and a venomous VI PERil. | 3 | ;; and a venomous VI PERil. |
| 4 | ;; Viper Is also a Package for Emacs Rebels. | 4 | ;; Viper Is also a Package for Emacs Rebels. |
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | ;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01 Free Software Foundation, Inc. | 9 | ;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01 Free Software Foundation, Inc. |
| 10 | 10 | ||
| 11 | (defconst viper-version "3.10 of March 3, 2001" | 11 | (defconst viper-version "3.11 of July 18, 2001" |
| 12 | "The current version of Viper") | 12 | "The current version of Viper") |
| 13 | 13 | ||
| 14 | ;; This file is part of GNU Emacs. | 14 | ;; This file is part of GNU Emacs. |
| @@ -401,6 +401,7 @@ widget." | |||
| 401 | 401 | ||
| 402 | completion-list-mode | 402 | completion-list-mode |
| 403 | diff-mode | 403 | diff-mode |
| 404 | idl-mode | ||
| 404 | 405 | ||
| 405 | perl-mode | 406 | perl-mode |
| 406 | cperl-mode | 407 | cperl-mode |
| @@ -446,6 +447,7 @@ unless it is coming up in a wrong Viper state." | |||
| 446 | (defcustom viper-insert-state-mode-list | 447 | (defcustom viper-insert-state-mode-list |
| 447 | '(internal-ange-ftp-mode | 448 | '(internal-ange-ftp-mode |
| 448 | comint-mode | 449 | comint-mode |
| 450 | inferior-emacs-lisp-mode | ||
| 449 | eshell-mode | 451 | eshell-mode |
| 450 | shell-mode) | 452 | shell-mode) |
| 451 | "*A list of major modes that should come up in Vi Insert state." | 453 | "*A list of major modes that should come up in Vi Insert state." |
| @@ -462,11 +464,14 @@ unless it is coming up in a wrong Viper state." | |||
| 462 | (nth 0 triple) (nth 1 triple) (eval (nth 2 triple)))) | 464 | (nth 0 triple) (nth 1 triple) (eval (nth 2 triple)))) |
| 463 | viper-major-mode-modifier-list)) | 465 | viper-major-mode-modifier-list)) |
| 464 | 466 | ||
| 467 | ;; We change standard bindings in some major mode, making them slightly | ||
| 468 | ;; different than in "normal" vi/insert/emacs states | ||
| 465 | (defcustom viper-major-mode-modifier-list | 469 | (defcustom viper-major-mode-modifier-list |
| 466 | '((help-mode emacs-state viper-slash-and-colon-map) | 470 | '((help-mode emacs-state viper-slash-and-colon-map) |
| 467 | (comint-mode insert-state viper-comint-mode-modifier-map) | 471 | (comint-mode insert-state viper-comint-mode-modifier-map) |
| 468 | (comint-mode vi-state viper-comint-mode-modifier-map) | 472 | (comint-mode vi-state viper-comint-mode-modifier-map) |
| 469 | (shell-mode insert-state viper-comint-mode-modifier-map) | 473 | (shell-mode insert-state viper-comint-mode-modifier-map) |
| 474 | (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map) | ||
| 470 | (shell-mode vi-state viper-comint-mode-modifier-map) | 475 | (shell-mode vi-state viper-comint-mode-modifier-map) |
| 471 | (ange-ftp-shell-mode insert-state viper-comint-mode-modifier-map) | 476 | (ange-ftp-shell-mode insert-state viper-comint-mode-modifier-map) |
| 472 | (ange-ftp-shell-mode vi-state viper-comint-mode-modifier-map) | 477 | (ange-ftp-shell-mode vi-state viper-comint-mode-modifier-map) |
| @@ -595,11 +600,23 @@ This startup message appears whenever you load Viper, unless you type `y' now." | |||
| 595 | 600 | ||
| 596 | (if viper-xemacs-p | 601 | (if viper-xemacs-p |
| 597 | (make-variable-buffer-local 'bar-cursor)) | 602 | (make-variable-buffer-local 'bar-cursor)) |
| 603 | (if (eq major-mode 'viper-mode) | ||
| 604 | (setq major-mode 'fundamental-mode)) | ||
| 598 | 605 | ||
| 599 | (or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi | 606 | (or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi |
| 600 | (memq major-mode viper-insert-state-mode-list) ; don't switch | 607 | (memq major-mode viper-insert-state-mode-list) ; don't switch |
| 601 | (viper-change-state-to-vi))))) | 608 | (viper-change-state-to-vi))))) |
| 602 | 609 | ||
| 610 | |||
| 611 | ;; Apply a little heuristic to invoke vi state on major-modes | ||
| 612 | ;; that are not listed in viper-vi-state-mode-list | ||
| 613 | (defun this-major-mode-requires-vi-state (mode) | ||
| 614 | (cond ((memq mode viper-vi-state-mode-list) t) | ||
| 615 | ((memq mode viper-emacs-state-mode-list) nil) | ||
| 616 | ((memq mode viper-insert-state-mode-list) nil) | ||
| 617 | (t (and (eq (key-binding "a") 'self-insert-command) | ||
| 618 | (eq (key-binding " ") 'self-insert-command))))) | ||
| 619 | |||
| 603 | 620 | ||
| 604 | ;; This hook designed to enable Vi-style editing in comint-based modes." | 621 | ;; This hook designed to enable Vi-style editing in comint-based modes." |
| 605 | (defun viper-comint-mode-hook () | 622 | (defun viper-comint-mode-hook () |
| @@ -760,7 +777,7 @@ remains buffer-local." | |||
| 760 | (lambda (buf) | 777 | (lambda (buf) |
| 761 | (if (viper-buffer-live-p buf) | 778 | (if (viper-buffer-live-p buf) |
| 762 | (with-current-buffer buf | 779 | (with-current-buffer buf |
| 763 | (cond ((and (memq major-mode viper-vi-state-mode-list) | 780 | (cond ((and (this-major-mode-requires-vi-state major-mode) |
| 764 | (eq viper-current-state 'emacs-state)) | 781 | (eq viper-current-state 'emacs-state)) |
| 765 | (viper-mode)) | 782 | (viper-mode)) |
| 766 | ((memq major-mode viper-emacs-state-mode-list) | 783 | ((memq major-mode viper-emacs-state-mode-list) |
| @@ -798,6 +815,8 @@ remains buffer-local." | |||
| 798 | ;; However, this has the effect that if the user didn't specify the | 815 | ;; However, this has the effect that if the user didn't specify the |
| 799 | ;; default mode, new buffers that fall back on the default will come up | 816 | ;; default mode, new buffers that fall back on the default will come up |
| 800 | ;; in Fundamental Mode and Vi state. | 817 | ;; in Fundamental Mode and Vi state. |
| 818 | ;; When viper-mode is executed in such a case, it will set the major mode | ||
| 819 | ;; back to fundamental-mode. | ||
| 801 | (if (eq default-major-mode 'fundamental-mode) | 820 | (if (eq default-major-mode 'fundamental-mode) |
| 802 | (setq default-major-mode 'viper-mode)) | 821 | (setq default-major-mode 'viper-mode)) |
| 803 | 822 | ||
| @@ -956,36 +975,16 @@ remains buffer-local." | |||
| 956 | (setq global-mode-string | 975 | (setq global-mode-string |
| 957 | (append '("" viper-mode-string) (cdr global-mode-string)))) | 976 | (append '("" viper-mode-string) (cdr global-mode-string)))) |
| 958 | 977 | ||
| 959 | (defadvice read-key-sequence (around viper-read-keyseq-ad activate) | ||
| 960 | "Harness to work for Viper. This advice is harmless---don't worry!" | ||
| 961 | (let (inhibit-quit event keyseq) | ||
| 962 | (setq keyseq ad-do-it) | ||
| 963 | (setq event (if viper-xemacs-p | ||
| 964 | (elt keyseq 0) ; XEmacs returns vector of events | ||
| 965 | (elt (listify-key-sequence keyseq) 0))) | ||
| 966 | (if (viper-ESC-event-p event) | ||
| 967 | (let (unread-command-events) | ||
| 968 | (viper-set-unread-command-events keyseq) | ||
| 969 | (if (viper-fast-keysequence-p) | ||
| 970 | (let ((viper-vi-global-user-minor-mode nil) | ||
| 971 | (viper-vi-local-user-minor-mode nil) | ||
| 972 | (viper-replace-minor-mode nil) ; actually unnecessary | ||
| 973 | (viper-insert-global-user-minor-mode nil) | ||
| 974 | (viper-insert-local-user-minor-mode nil)) | ||
| 975 | (setq keyseq ad-do-it)) | ||
| 976 | (setq keyseq ad-do-it)))) | ||
| 977 | keyseq)) | ||
| 978 | |||
| 979 | (defadvice describe-key (before viper-read-keyseq-ad protect activate) | 978 | (defadvice describe-key (before viper-read-keyseq-ad protect activate) |
| 980 | "Force to read key via `read-key-sequence'." | 979 | "Force to read key via `viper-read-key-sequence'." |
| 981 | (interactive (list (viper-events-to-keys | 980 | (interactive (list (viper-events-to-keys |
| 982 | (read-key-sequence "Describe key: "))))) | 981 | (viper-read-key-sequence "Describe key: "))))) |
| 983 | 982 | ||
| 984 | (defadvice describe-key-briefly | 983 | (defadvice describe-key-briefly |
| 985 | (before viper-read-keyseq-ad protect activate) | 984 | (before viper-read-keyseq-ad protect activate) |
| 986 | "Force to read key via `read-key-sequence'." | 985 | "Force to read key via `viper-read-key-sequence'." |
| 987 | (interactive (list (viper-events-to-keys | 986 | (interactive (list (viper-events-to-keys |
| 988 | (read-key-sequence "Describe key briefly: "))))) | 987 | (viper-read-key-sequence "Describe key briefly: "))))) |
| 989 | 988 | ||
| 990 | 989 | ||
| 991 | (defadvice find-file (before viper-add-suffix-advice activate) | 990 | (defadvice find-file (before viper-add-suffix-advice activate) |
| @@ -1056,6 +1055,27 @@ remains buffer-local." | |||
| 1056 | 1055 | ||
| 1057 | ) ; end viper-non-hook-settings | 1056 | ) ; end viper-non-hook-settings |
| 1058 | 1057 | ||
| 1058 | ;; Viperized read-key-sequence | ||
| 1059 | (defun viper-read-key-sequence (prompt &optional continue-echo) | ||
| 1060 | (let (inhibit-quit event keyseq) | ||
| 1061 | (setq keyseq (read-key-sequence prompt continue-echo)) | ||
| 1062 | (setq event (if viper-xemacs-p | ||
| 1063 | (elt keyseq 0) ; XEmacs returns vector of events | ||
| 1064 | (elt (listify-key-sequence keyseq) 0))) | ||
| 1065 | (if (viper-ESC-event-p event) | ||
| 1066 | (let (unread-command-events) | ||
| 1067 | (viper-set-unread-command-events keyseq) | ||
| 1068 | (if (viper-fast-keysequence-p) | ||
| 1069 | (let ((viper-vi-global-user-minor-mode nil) | ||
| 1070 | (viper-vi-local-user-minor-mode nil) | ||
| 1071 | (viper-replace-minor-mode nil) ; actually unnecessary | ||
| 1072 | (viper-insert-global-user-minor-mode nil) | ||
| 1073 | (viper-insert-local-user-minor-mode nil)) | ||
| 1074 | (setq keyseq (read-key-sequence prompt continue-echo))) | ||
| 1075 | (setq keyseq (read-key-sequence prompt continue-echo))))) | ||
| 1076 | keyseq)) | ||
| 1077 | |||
| 1078 | |||
| 1059 | 1079 | ||
| 1060 | ;; Ask only if this-command/last-command are nil, i.e., when loading | 1080 | ;; Ask only if this-command/last-command are nil, i.e., when loading |
| 1061 | (cond ((and (eq viper-mode 'ask) (null this-command) (null last-command)) | 1081 | (cond ((and (eq viper-mode 'ask) (null this-command) (null last-command)) |
| @@ -1259,7 +1279,7 @@ These two lines must come in the order given. | |||
| 1259 | (setq-default minor-mode-map-alist minor-mode-map-alist) | 1279 | (setq-default minor-mode-map-alist minor-mode-map-alist) |
| 1260 | )) | 1280 | )) |
| 1261 | 1281 | ||
| 1262 | (if (and viper-mode (memq major-mode viper-vi-state-mode-list)) | 1282 | (if (and viper-mode (this-major-mode-requires-vi-state major-mode)) |
| 1263 | (viper-mode)) | 1283 | (viper-mode)) |
| 1264 | 1284 | ||
| 1265 | (if viper-mode | 1285 | (if viper-mode |
diff --git a/man/ChangeLog b/man/ChangeLog index 717be4fdf65..6af5a433523 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2001-07-21 Michael Kifer <kifer@cs.sunysb.edu> | ||
| 2 | |||
| 3 | * viper.texi: Added credits, new commands, like :make. | ||
| 4 | |||
| 5 | * ediff.texi: added credits. | ||
| 6 | |||
| 1 | 2001-06-08 Carsten Dominik <dominik@astro.uva.nl> | 7 | 2001-06-08 Carsten Dominik <dominik@astro.uva.nl> |
| 2 | 8 | ||
| 3 | * reftex.texi: Updated to version 4.16 | 9 | * reftex.texi: Updated to version 4.16 |
diff --git a/man/ediff.texi b/man/ediff.texi index 3e6a73ca710..8247a8935bf 100644 --- a/man/ediff.texi +++ b/man/ediff.texi | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | @synindex vr cp | 13 | @synindex vr cp |
| 14 | @synindex fn cp | 14 | @synindex fn cp |
| 15 | @synindex pg cp | 15 | @synindex pg cp |
| 16 | @synindex ky cp | ||
| 16 | 17 | ||
| 17 | @dircategory Emacs | 18 | @dircategory Emacs |
| 18 | @direntry | 19 | @direntry |
| @@ -150,6 +151,15 @@ The architecture and the interface are, of course, drastically different. | |||
| 150 | @node Major Entry Points, Session Commands, Introduction, Top | 151 | @node Major Entry Points, Session Commands, Introduction, Top |
| 151 | @chapter Major Entry Points | 152 | @chapter Major Entry Points |
| 152 | 153 | ||
| 154 | When Ediff starts up, it displays a small control window, which accepts the | ||
| 155 | Ediff commands and two or three windows displaying the files to be compared | ||
| 156 | or merged. The control window can be in its own small frame or it can be | ||
| 157 | part of a bigger frame that displays other buffers. In any case, it is | ||
| 158 | important that the control window be active (i.e., be the one receiving the | ||
| 159 | keystrokes) when you use Ediff. You can switch to other Emacs buffers at | ||
| 160 | will and even edit the files currently being compared with Ediff and then | ||
| 161 | switch back to Ediff at any time by activating the appropriate Emacs windows. | ||
| 162 | |||
| 153 | Ediff can be invoked interactively using the following functions, which can | 163 | Ediff can be invoked interactively using the following functions, which can |
| 154 | be run either from the minibuffer or from the menu bar. In the menu bar, | 164 | be run either from the minibuffer or from the menu bar. In the menu bar, |
| 155 | all Ediff's entry points belong to three submenus of the Tools menu: | 165 | all Ediff's entry points belong to three submenus of the Tools menu: |
| @@ -443,27 +453,35 @@ command (see @kbd{ga}, @kbd{gb}, and @kbd{gc}). | |||
| 443 | 453 | ||
| 444 | @table @kbd | 454 | @table @kbd |
| 445 | @item ? | 455 | @item ? |
| 456 | @kindex ? | ||
| 446 | Toggles the Ediff Quick Help window ON and OFF. | 457 | Toggles the Ediff Quick Help window ON and OFF. |
| 447 | @item G | 458 | @item G |
| 459 | @kindex G | ||
| 448 | Prepares a mail buffer for sending a praise or a curse to the Ediff maintainer. | 460 | Prepares a mail buffer for sending a praise or a curse to the Ediff maintainer. |
| 449 | 461 | ||
| 450 | @item E | 462 | @item E |
| 463 | @kindex E | ||
| 451 | Brings up the top node of this manual, where you can find further | 464 | Brings up the top node of this manual, where you can find further |
| 452 | information on the various Ediff functions and advanced issues, such as | 465 | information on the various Ediff functions and advanced issues, such as |
| 453 | customization, session groups, etc. | 466 | customization, session groups, etc. |
| 454 | 467 | ||
| 455 | @item v | 468 | @item v |
| 469 | @kindex v | ||
| 456 | Scrolls up buffers A and B (and buffer C where appropriate) in a | 470 | Scrolls up buffers A and B (and buffer C where appropriate) in a |
| 457 | coordinated fashion. | 471 | coordinated fashion. |
| 458 | @item V | 472 | @item V |
| 473 | @kindex V | ||
| 459 | Scrolls the buffers down. | 474 | Scrolls the buffers down. |
| 460 | 475 | ||
| 461 | @item < | 476 | @item < |
| 477 | @kindex < | ||
| 462 | Scrolls the buffers to the left simultaneously. | 478 | Scrolls the buffers to the left simultaneously. |
| 463 | @item > | 479 | @item > |
| 480 | @kindex > | ||
| 464 | Scrolls buffers to the right. | 481 | Scrolls buffers to the right. |
| 465 | 482 | ||
| 466 | @item wd | 483 | @item wd |
| 484 | @kindex wd | ||
| 467 | Saves the output from the diff utility, for further reference. | 485 | Saves the output from the diff utility, for further reference. |
| 468 | 486 | ||
| 469 | With prefix argument, saves the plain output from @code{diff} (see | 487 | With prefix argument, saves the plain output from @code{diff} (see |
| @@ -473,14 +491,18 @@ argument, it saves customized @code{diff} output (see | |||
| 473 | it is available. | 491 | it is available. |
| 474 | 492 | ||
| 475 | @item wa | 493 | @item wa |
| 494 | @kindex wa | ||
| 476 | Saves buffer A, if it was modified. | 495 | Saves buffer A, if it was modified. |
| 477 | @item wb | 496 | @item wb |
| 497 | @kindex wb | ||
| 478 | Saves buffer B, if it was modified. | 498 | Saves buffer B, if it was modified. |
| 479 | @item wc | 499 | @item wc |
| 500 | @kindex wc | ||
| 480 | Saves buffer C, if it was modified (if you are in a session that | 501 | Saves buffer C, if it was modified (if you are in a session that |
| 481 | compares three files simultaneously). | 502 | compares three files simultaneously). |
| 482 | 503 | ||
| 483 | @item a | 504 | @item a |
| 505 | @kindex a | ||
| 484 | @emph{In comparison sessions:} | 506 | @emph{In comparison sessions:} |
| 485 | Copies the current difference region (or the region specified as the prefix | 507 | Copies the current difference region (or the region specified as the prefix |
| 486 | to this command) from buffer A to buffer B. | 508 | to this command) from buffer A to buffer B. |
| @@ -493,6 +515,7 @@ to this command) from buffer A to the merge buffer. The old contents of | |||
| 493 | this region in buffer C can be restored via the command @kbd{r}. | 515 | this region in buffer C can be restored via the command @kbd{r}. |
| 494 | 516 | ||
| 495 | @item b | 517 | @item b |
| 518 | @kindex b | ||
| 496 | Works similarly, but copies the current difference region from buffer B to | 519 | Works similarly, but copies the current difference region from buffer B to |
| 497 | buffer A (in @emph{comparison sessions}) or the merge buffer (in | 520 | buffer A (in @emph{comparison sessions}) or the merge buffer (in |
| 498 | @emph{merge sessions}). | 521 | @emph{merge sessions}). |
| @@ -502,39 +525,50 @@ be reinstated via the command @kbd{ra} in comparison sessions and | |||
| 502 | @kbd{r} in merge sessions. | 525 | @kbd{r} in merge sessions. |
| 503 | 526 | ||
| 504 | @item ab | 527 | @item ab |
| 528 | @kindex ab | ||
| 505 | Copies the current difference region (or the region specified as the prefix | 529 | Copies the current difference region (or the region specified as the prefix |
| 506 | to this command) from buffer A to buffer B. This (and the next five) | 530 | to this command) from buffer A to buffer B. This (and the next five) |
| 507 | command is enabled only in sessions that compare three files | 531 | command is enabled only in sessions that compare three files |
| 508 | simultaneously. The old region in buffer B is saved and can be restored | 532 | simultaneously. The old region in buffer B is saved and can be restored |
| 509 | via the command @kbd{rb}. | 533 | via the command @kbd{rb}. |
| 510 | @item ac | 534 | @item ac |
| 535 | @kindex ac | ||
| 511 | Copies the difference region from buffer A to buffer C. | 536 | Copies the difference region from buffer A to buffer C. |
| 512 | The old region in buffer C is saved and can be restored via the command | 537 | The old region in buffer C is saved and can be restored via the command |
| 513 | @kbd{rc}. | 538 | @kbd{rc}. |
| 514 | @item ba | 539 | @item ba |
| 540 | @kindex ba | ||
| 515 | Copies the difference region from buffer B to buffer A. | 541 | Copies the difference region from buffer B to buffer A. |
| 516 | The old region in buffer A is saved and can be restored via the command | 542 | The old region in buffer A is saved and can be restored via the command |
| 517 | @kbd{ra}. | 543 | @kbd{ra}. |
| 518 | @item bc | 544 | @item bc |
| 545 | @kindex bc | ||
| 519 | Copies the difference region from buffer B to buffer C. | 546 | Copies the difference region from buffer B to buffer C. |
| 520 | The command @kbd{rc} undoes this. | 547 | The command @kbd{rc} undoes this. |
| 521 | @item ca | 548 | @item ca |
| 549 | @kindex ca | ||
| 522 | Copies the difference region from buffer C to buffer A. | 550 | Copies the difference region from buffer C to buffer A. |
| 523 | The command @kbd{ra} undoes this. | 551 | The command @kbd{ra} undoes this. |
| 524 | @item cb | 552 | @item cb |
| 553 | @kindex cb | ||
| 525 | Copies the difference region from buffer C to buffer B. | 554 | Copies the difference region from buffer C to buffer B. |
| 526 | The command @kbd{rb} undoes this. | 555 | The command @kbd{rb} undoes this. |
| 527 | 556 | ||
| 528 | @item p | 557 | @item p |
| 529 | @itemx DEL | 558 | @itemx DEL |
| 559 | @kindex p | ||
| 560 | @kindex DEL | ||
| 530 | Makes the previous difference region current. | 561 | Makes the previous difference region current. |
| 531 | @item n | 562 | @item n |
| 532 | @itemx SPC | 563 | @itemx SPC |
| 564 | @kindex n | ||
| 565 | @kindex SPC | ||
| 533 | Makes the next difference region current. | 566 | Makes the next difference region current. |
| 534 | 567 | ||
| 535 | @item j | 568 | @item j |
| 536 | @itemx -j | 569 | @itemx -j |
| 537 | @itemx Nj | 570 | @itemx Nj |
| 571 | @kindex j | ||
| 538 | Makes the very first difference region current. | 572 | Makes the very first difference region current. |
| 539 | 573 | ||
| 540 | @kbd{-j} makes the last region current. Typing a number, N, and then `j' | 574 | @kbd{-j} makes the last region current. Typing a number, N, and then `j' |
| @@ -542,6 +576,7 @@ makes the difference region N current. Typing -N (a negative number) then | |||
| 542 | `j' makes current the region Last - N. | 576 | `j' makes current the region Last - N. |
| 543 | 577 | ||
| 544 | @item ga | 578 | @item ga |
| 579 | @kindex ga | ||
| 545 | Makes current the difference region closest to the position of the point in | 580 | Makes current the difference region closest to the position of the point in |
| 546 | buffer A. | 581 | buffer A. |
| 547 | 582 | ||
| @@ -553,11 +588,13 @@ region, then it is in an area where all variants agree with each other. In | |||
| 553 | this case, the variants will be positioned so that each would display this | 588 | this case, the variants will be positioned so that each would display this |
| 554 | area (of agreement). | 589 | area (of agreement). |
| 555 | @item gb | 590 | @item gb |
| 591 | @kindex gb | ||
| 556 | Makes current the difference region closest to the position of the point in | 592 | Makes current the difference region closest to the position of the point in |
| 557 | buffer B. | 593 | buffer B. |
| 558 | 594 | ||
| 559 | With a prefix argument, behaves like @kbd{ga}, but with respect to buffer B. | 595 | With a prefix argument, behaves like @kbd{ga}, but with respect to buffer B. |
| 560 | @item gc | 596 | @item gc |
| 597 | @kindex gc | ||
| 561 | @emph{In merge sessions:} | 598 | @emph{In merge sessions:} |
| 562 | makes current the difference region closest to the point in the merge buffer. | 599 | makes current the difference region closest to the point in the merge buffer. |
| 563 | 600 | ||
| @@ -567,12 +604,14 @@ makes current the region closest to the point in buffer C. | |||
| 567 | With a prefix argument, behaves like @kbd{ga}, but with respect to buffer C. | 604 | With a prefix argument, behaves like @kbd{ga}, but with respect to buffer C. |
| 568 | 605 | ||
| 569 | @item ! | 606 | @item ! |
| 607 | @kindex ! | ||
| 570 | Recomputes the difference regions, bringing them up to date. This is often | 608 | Recomputes the difference regions, bringing them up to date. This is often |
| 571 | needed because it is common to do all sorts of editing during Ediff | 609 | needed because it is common to do all sorts of editing during Ediff |
| 572 | sessions, so after a while, the highlighted difference regions may no | 610 | sessions, so after a while, the highlighted difference regions may no |
| 573 | longer reflect the actual differences among the buffers. | 611 | longer reflect the actual differences among the buffers. |
| 574 | 612 | ||
| 575 | @item * | 613 | @item * |
| 614 | @kindex * | ||
| 576 | Forces refinement of the current difference region, which highlights the exact | 615 | Forces refinement of the current difference region, which highlights the exact |
| 577 | words of disagreement among the buffers. With a negative prefix argument, | 616 | words of disagreement among the buffers. With a negative prefix argument, |
| 578 | unhighlights the current region. | 617 | unhighlights the current region. |
| @@ -589,17 +628,20 @@ This command is also useful when the highlighted fine differences are | |||
| 589 | no longer current, due to user editing. | 628 | no longer current, due to user editing. |
| 590 | 629 | ||
| 591 | @item m | 630 | @item m |
| 631 | @kindex m | ||
| 592 | Displays the current Ediff session in a frame as wide as the physical | 632 | Displays the current Ediff session in a frame as wide as the physical |
| 593 | display. This is useful when comparing files side-by-side. Typing `m' again | 633 | display. This is useful when comparing files side-by-side. Typing `m' again |
| 594 | restores the original size of the frame. | 634 | restores the original size of the frame. |
| 595 | 635 | ||
| 596 | @item | | 636 | @item | |
| 637 | @kindex | | ||
| 597 | Toggles the horizontal/vertical split of the Ediff display. Horizontal | 638 | Toggles the horizontal/vertical split of the Ediff display. Horizontal |
| 598 | split is convenient when it is possible to compare files | 639 | split is convenient when it is possible to compare files |
| 599 | side-by-side. If the frame in which files are displayed is too narrow | 640 | side-by-side. If the frame in which files are displayed is too narrow |
| 600 | and lines are cut off, typing @kbd{m} may help some. | 641 | and lines are cut off, typing @kbd{m} may help some. |
| 601 | 642 | ||
| 602 | @item @@ | 643 | @item @@ |
| 644 | @kindex @@ | ||
| 603 | Toggles auto-refinement of difference regions (i.e., automatic highlighting | 645 | Toggles auto-refinement of difference regions (i.e., automatic highlighting |
| 604 | of the exact words that differ among the variants). Auto-refinement is | 646 | of the exact words that differ among the variants). Auto-refinement is |
| 605 | turned off on devices where Emacs doesn't support highlighting. | 647 | turned off on devices where Emacs doesn't support highlighting. |
| @@ -609,11 +651,13 @@ user can always forcefully refine specific difference regions by typing | |||
| 609 | @kbd{*}. | 651 | @kbd{*}. |
| 610 | 652 | ||
| 611 | @item h | 653 | @item h |
| 654 | @kindex h | ||
| 612 | Cycles between full highlighting, the mode where fine differences are not | 655 | Cycles between full highlighting, the mode where fine differences are not |
| 613 | highlighted (but computed), and the mode where highlighting is done with | 656 | highlighted (but computed), and the mode where highlighting is done with |
| 614 | ASCII strings. The latter is not really recommended, unless on a dumb TTY. | 657 | ASCII strings. The latter is not really recommended, unless on a dumb TTY. |
| 615 | 658 | ||
| 616 | @item r | 659 | @item r |
| 660 | @kindex r | ||
| 617 | Restores the old contents of the region in the merge buffer. | 661 | Restores the old contents of the region in the merge buffer. |
| 618 | (If you copied a difference region from buffer A or B into the merge buffer | 662 | (If you copied a difference region from buffer A or B into the merge buffer |
| 619 | using the commands @kbd{a} or @kbd{b}, Ediff saves the old contents of the | 663 | using the commands @kbd{a} or @kbd{b}, Ediff saves the old contents of the |
| @@ -622,22 +666,26 @@ region in case you change your mind.) | |||
| 622 | This command is enabled in merge sessions only. | 666 | This command is enabled in merge sessions only. |
| 623 | 667 | ||
| 624 | @item ra | 668 | @item ra |
| 669 | @kindex ra | ||
| 625 | Restores the old contents of the current difference region in buffer A, | 670 | Restores the old contents of the current difference region in buffer A, |
| 626 | which was previously saved when the user invoked one of these commands: | 671 | which was previously saved when the user invoked one of these commands: |
| 627 | @kbd{b}, @kbd{ba}, @kbd{ca}, which see. This command is enabled in | 672 | @kbd{b}, @kbd{ba}, @kbd{ca}, which see. This command is enabled in |
| 628 | comparison sessions only. | 673 | comparison sessions only. |
| 629 | @item rb | 674 | @item rb |
| 675 | @kindex rb | ||
| 630 | Restores the old contents of the current difference region in buffer B, | 676 | Restores the old contents of the current difference region in buffer B, |
| 631 | which was previously saved when the user invoked one of these commands: | 677 | which was previously saved when the user invoked one of these commands: |
| 632 | @kbd{a}, @kbd{ab}, @kbd{cb}, which see. This command is enabled in | 678 | @kbd{a}, @kbd{ab}, @kbd{cb}, which see. This command is enabled in |
| 633 | comparison sessions only. | 679 | comparison sessions only. |
| 634 | @item rc | 680 | @item rc |
| 681 | @kindex rc | ||
| 635 | Restores the old contents of the current difference region in buffer C, | 682 | Restores the old contents of the current difference region in buffer C, |
| 636 | which was previously saved when the user invoked one of these commands: | 683 | which was previously saved when the user invoked one of these commands: |
| 637 | @kbd{ac}, @kbd{bc}, which see. This command is enabled in 3-file | 684 | @kbd{ac}, @kbd{bc}, which see. This command is enabled in 3-file |
| 638 | comparison sessions only. | 685 | comparison sessions only. |
| 639 | 686 | ||
| 640 | @item ## | 687 | @item ## |
| 688 | @kindex ## | ||
| 641 | Tell Ediff to skip over regions that disagree among themselves only in the | 689 | Tell Ediff to skip over regions that disagree among themselves only in the |
| 642 | amount of white space and line breaks. | 690 | amount of white space and line breaks. |
| 643 | 691 | ||
| @@ -647,6 +695,8 @@ again puts Ediff back in the original state. | |||
| 647 | 695 | ||
| 648 | @item #h | 696 | @item #h |
| 649 | @itemx #f | 697 | @itemx #f |
| 698 | @kindex #f | ||
| 699 | @kindex #h | ||
| 650 | Ediff works hard to ameliorate the effects of boredom in the workplace... | 700 | Ediff works hard to ameliorate the effects of boredom in the workplace... |
| 651 | 701 | ||
| 652 | Quite often differences are due to identical replacements (e.g., the word | 702 | Quite often differences are due to identical replacements (e.g., the word |
| @@ -667,24 +717,30 @@ regular expressions. All other regions will be skipped | |||
| 667 | over. @xref{Selective Browsing}, for more. | 717 | over. @xref{Selective Browsing}, for more. |
| 668 | 718 | ||
| 669 | @item A | 719 | @item A |
| 720 | @kindex A | ||
| 670 | Toggles the read-only property in buffer A. | 721 | Toggles the read-only property in buffer A. |
| 671 | If file A is under version control and is checked in, it is checked out | 722 | If file A is under version control and is checked in, it is checked out |
| 672 | (with your permission). | 723 | (with your permission). |
| 673 | @item B | 724 | @item B |
| 725 | @kindex B | ||
| 674 | Toggles the read-only property in buffer B. | 726 | Toggles the read-only property in buffer B. |
| 675 | If file B is under version control and is checked in, it is checked out. | 727 | If file B is under version control and is checked in, it is checked out. |
| 676 | @item C | 728 | @item C |
| 729 | @kindex C | ||
| 677 | Toggles the read-only property in buffer C (in 3-file comparison sessions). | 730 | Toggles the read-only property in buffer C (in 3-file comparison sessions). |
| 678 | If file C is under version control and is checked in, it is checked out. | 731 | If file C is under version control and is checked in, it is checked out. |
| 679 | 732 | ||
| 680 | @item ~ | 733 | @item ~ |
| 734 | @kindex ~ | ||
| 681 | Swaps the windows where buffers A and B are displayed. If you are comparing | 735 | Swaps the windows where buffers A and B are displayed. If you are comparing |
| 682 | three buffers at once, then this command would rotate the windows among | 736 | three buffers at once, then this command would rotate the windows among |
| 683 | buffers A, B, and C. | 737 | buffers A, B, and C. |
| 684 | 738 | ||
| 685 | @item i | 739 | @item i |
| 740 | @kindex i | ||
| 686 | Displays all kinds of useful data about the current Ediff session. | 741 | Displays all kinds of useful data about the current Ediff session. |
| 687 | @item D | 742 | @item D |
| 743 | @kindex D | ||
| 688 | Runs @code{ediff-custom-diff-program} on the variants and displays the | 744 | Runs @code{ediff-custom-diff-program} on the variants and displays the |
| 689 | buffer containing the output. This is useful when you must send the output | 745 | buffer containing the output. This is useful when you must send the output |
| 690 | to your Mom. | 746 | to your Mom. |
| @@ -693,6 +749,7 @@ With a prefix argument, displays the plain @code{diff} output. | |||
| 693 | @xref{Patch and Diff Programs}, for details. | 749 | @xref{Patch and Diff Programs}, for details. |
| 694 | 750 | ||
| 695 | @item R | 751 | @item R |
| 752 | @kindex R | ||
| 696 | Displays a list of currently active Ediff sessions---the Ediff Registry. | 753 | Displays a list of currently active Ediff sessions---the Ediff Registry. |
| 697 | You can then restart any of these sessions by either clicking on a session | 754 | You can then restart any of these sessions by either clicking on a session |
| 698 | record or by putting the cursor over it and then typing the return key. | 755 | record or by putting the cursor over it and then typing the return key. |
| @@ -706,10 +763,12 @@ Control Panel. If you don't have a control panel handy, type this in the | |||
| 706 | minibuffer: @kbd{M-x eregistry}. @xref{Registry of Ediff Sessions}. | 763 | minibuffer: @kbd{M-x eregistry}. @xref{Registry of Ediff Sessions}. |
| 707 | 764 | ||
| 708 | @item M | 765 | @item M |
| 766 | @kindex M | ||
| 709 | Shows the session group buffer that invoked the current Ediff session. | 767 | Shows the session group buffer that invoked the current Ediff session. |
| 710 | @xref{Session Groups}, for more information on session groups. | 768 | @xref{Session Groups}, for more information on session groups. |
| 711 | 769 | ||
| 712 | @item z | 770 | @item z |
| 771 | @kindex z | ||
| 713 | Suspends the current Ediff session. (If you develop a condition known as | 772 | Suspends the current Ediff session. (If you develop a condition known as |
| 714 | Repetitive Ediff Injury---a serious but curable illness---you must change | 773 | Repetitive Ediff Injury---a serious but curable illness---you must change |
| 715 | your current activity. This command tries hard to hide all Ediff-related | 774 | your current activity. This command tries hard to hide all Ediff-related |
| @@ -718,21 +777,25 @@ buffers.) | |||
| 718 | The easiest way to resume a suspended Ediff session is through the registry | 777 | The easiest way to resume a suspended Ediff session is through the registry |
| 719 | of active sessions. @xref{Registry of Ediff Sessions}, for details. | 778 | of active sessions. @xref{Registry of Ediff Sessions}, for details. |
| 720 | @item q | 779 | @item q |
| 780 | @kindex q | ||
| 721 | Terminates this Ediff session. With a prefix argument (e.g.,@kbd{1q}), asks | 781 | Terminates this Ediff session. With a prefix argument (e.g.,@kbd{1q}), asks |
| 722 | if you also want to delete the buffers of the variants. | 782 | if you also want to delete the buffers of the variants. |
| 723 | Modified files and the results of merges are never deleted. | 783 | Modified files and the results of merges are never deleted. |
| 724 | 784 | ||
| 725 | @item % | 785 | @item % |
| 786 | @kindex % | ||
| 726 | Toggles narrowing in Ediff buffers. Ediff buffers may be narrowed if you | 787 | Toggles narrowing in Ediff buffers. Ediff buffers may be narrowed if you |
| 727 | are comparing only parts of these buffers via the commands | 788 | are comparing only parts of these buffers via the commands |
| 728 | @code{ediff-windows-*} and @code{ediff-regions-*}, which see. | 789 | @code{ediff-windows-*} and @code{ediff-regions-*}, which see. |
| 729 | 790 | ||
| 730 | @item C-l | 791 | @item C-l |
| 792 | @kindex C-l | ||
| 731 | Restores the usual Ediff window setup. This is the quickest way to resume | 793 | Restores the usual Ediff window setup. This is the quickest way to resume |
| 732 | an Ediff session, but it works only if the control panel of that session is | 794 | an Ediff session, but it works only if the control panel of that session is |
| 733 | visible. | 795 | visible. |
| 734 | 796 | ||
| 735 | @item $$ | 797 | @item $$ |
| 798 | @kindex $$ | ||
| 736 | While merging with an ancestor file, Ediff is determined to reduce user's | 799 | While merging with an ancestor file, Ediff is determined to reduce user's |
| 737 | wear and tear by saving him and her much of unproductive, repetitive | 800 | wear and tear by saving him and her much of unproductive, repetitive |
| 738 | typing. If it notices that, say, file A's difference region is identical to | 801 | typing. If it notices that, say, file A's difference region is identical to |
| @@ -752,6 +815,7 @@ of the variants clashes with the ancestor but the other variant agrees with | |||
| 752 | it. Typing @kbd{$$} again undoes this setting. | 815 | it. Typing @kbd{$$} again undoes this setting. |
| 753 | 816 | ||
| 754 | @item $* | 817 | @item $* |
| 818 | @kindex $* | ||
| 755 | When merging files with large number of differences, it is sometimes | 819 | When merging files with large number of differences, it is sometimes |
| 756 | convenient to be able to skip the difference regions for which you already | 820 | convenient to be able to skip the difference regions for which you already |
| 757 | decided which variant is most appropriate. Typing @kbd{$*} will accomplish | 821 | decided which variant is most appropriate. Typing @kbd{$*} will accomplish |
| @@ -767,8 +831,10 @@ this region will be skipped if it differs from the current difference | |||
| 767 | region in buffer A, etc. | 831 | region in buffer A, etc. |
| 768 | 832 | ||
| 769 | @item / | 833 | @item / |
| 834 | @kindex / | ||
| 770 | Displays the ancestor file during merges. | 835 | Displays the ancestor file during merges. |
| 771 | @item & | 836 | @item & |
| 837 | @kindex & | ||
| 772 | In some situations, such as when one of the files agrees with the ancestor file | 838 | In some situations, such as when one of the files agrees with the ancestor file |
| 773 | on a difference region and the other doesn't, Ediff knows what to do: it copies | 839 | on a difference region and the other doesn't, Ediff knows what to do: it copies |
| 774 | the current difference region from the second buffer into the merge buffer. | 840 | the current difference region from the second buffer into the merge buffer. |
| @@ -788,6 +854,7 @@ region has the status @samp{default-A} then changing the default action to | |||
| 788 | corresponding region from buffer B. | 854 | corresponding region from buffer B. |
| 789 | 855 | ||
| 790 | @item s | 856 | @item s |
| 857 | @kindex s | ||
| 791 | Causes the merge window shrink to its minimum size, thereby exposing as much | 858 | Causes the merge window shrink to its minimum size, thereby exposing as much |
| 792 | of the variant buffers as possible. Typing `s' again restores | 859 | of the variant buffers as possible. Typing `s' again restores |
| 793 | the original size of that window. | 860 | the original size of that window. |
| @@ -807,12 +874,14 @@ The split between the merge window and the variant windows is controlled by | |||
| 807 | the variable @code{ediff-merge-window-share}, which see. | 874 | the variable @code{ediff-merge-window-share}, which see. |
| 808 | 875 | ||
| 809 | @item + | 876 | @item + |
| 877 | @kindex + | ||
| 810 | Combines the difference regions from buffers A and B and copies the | 878 | Combines the difference regions from buffers A and B and copies the |
| 811 | result into the merge buffer. @xref{Merging and diff3}, and the | 879 | result into the merge buffer. @xref{Merging and diff3}, and the |
| 812 | variables @code{ediff-combine-diffs} and @code{ediff-combination-pattern}. | 880 | variables @code{ediff-combine-diffs} and @code{ediff-combination-pattern}. |
| 813 | 881 | ||
| 814 | 882 | ||
| 815 | @item = | 883 | @item = |
| 884 | @kindex = | ||
| 816 | You may run into situations when a large chunk of text in one file has been | 885 | You may run into situations when a large chunk of text in one file has been |
| 817 | edited and then moved to a different place in another file. In such a case, | 886 | edited and then moved to a different place in another file. In such a case, |
| 818 | these two chunks of text are unlikely to belong to the same difference | 887 | these two chunks of text are unlikely to belong to the same difference |
| @@ -836,6 +905,9 @@ be asked which two of the three buffers to use). | |||
| 836 | Ediff would take the current region in the merge buffer and compare | 905 | Ediff would take the current region in the merge buffer and compare |
| 837 | it to the current region in the buffer of your choice (A or B). | 906 | it to the current region in the buffer of your choice (A or B). |
| 838 | 907 | ||
| 908 | @emph{Note: In all these cases you must first switch to the appropriate | ||
| 909 | Emacs buffers and manually set the regions that you want to compare.} | ||
| 910 | |||
| 839 | Highlighting set by the parent Ediff session is removed, to avoid interference | 911 | Highlighting set by the parent Ediff session is removed, to avoid interference |
| 840 | with highlighting of the child session. When done with the child session, type | 912 | with highlighting of the child session. When done with the child session, type |
| 841 | @kbd{C-l} in the parent's control panel to restore the original highlighting. | 913 | @kbd{C-l} in the parent's control panel to restore the original highlighting. |
| @@ -2329,12 +2401,14 @@ Leigh L Klotz (klotz@@adoc.xerox.com), | |||
| 2329 | Fritz Knabe (Fritz.Knabe@@ecrc.de), | 2401 | Fritz Knabe (Fritz.Knabe@@ecrc.de), |
| 2330 | Heinz Knutzen (hk@@informatik.uni-kiel.d400.de), | 2402 | Heinz Knutzen (hk@@informatik.uni-kiel.d400.de), |
| 2331 | Andrew Koenig (ark@@research.att.com), | 2403 | Andrew Koenig (ark@@research.att.com), |
| 2404 | Hannu Koivisto (azure@@iki.fi), | ||
| 2332 | Ken Laprade (laprade@@dw3f.ess.harris.com), | 2405 | Ken Laprade (laprade@@dw3f.ess.harris.com), |
| 2333 | Will C Lauer (wcl@@cadre.com), | 2406 | Will C Lauer (wcl@@cadre.com), |
| 2334 | Richard Levitte (levitte@@e.kth.se), | 2407 | Richard Levitte (levitte@@e.kth.se), |
| 2335 | Mike Long (mike.long@@analog.com), | 2408 | Mike Long (mike.long@@analog.com), |
| 2336 | Martin Maechler (maechler@@stat.math.ethz.ch), | 2409 | Martin Maechler (maechler@@stat.math.ethz.ch), |
| 2337 | Simon Marshall (simon@@gnu.org), | 2410 | Simon Marshall (simon@@gnu.org), |
| 2411 | Paul C. Meuse (pmeuse@@delcomsys.com), | ||
| 2338 | Richard Mlynarik (mly@@adoc.xerox.com), | 2412 | Richard Mlynarik (mly@@adoc.xerox.com), |
| 2339 | Stefan Monnier (monnier@@cs.yale.edu), | 2413 | Stefan Monnier (monnier@@cs.yale.edu), |
| 2340 | Chris Murphy (murphycm@@sun.aston.ac.uk), | 2414 | Chris Murphy (murphycm@@sun.aston.ac.uk), |
diff --git a/man/viper.texi b/man/viper.texi index e0838fdbb7b..674e44111f0 100644 --- a/man/viper.texi +++ b/man/viper.texi | |||
| @@ -168,6 +168,17 @@ with Vi is possible but not desirable. This chapter tells you about the | |||
| 168 | Emacs ideas that you should know about, how to use Viper within Emacs and | 168 | Emacs ideas that you should know about, how to use Viper within Emacs and |
| 169 | some incompatibilities. | 169 | some incompatibilities. |
| 170 | 170 | ||
| 171 | This manual is written with the assumption that you are an experienced Vi | ||
| 172 | user who wants to switch to Emacs while retaining the ability to edit files | ||
| 173 | Vi style. Incredible as it might seem, there are experienced Emacs users | ||
| 174 | who use Viper as a backdoor into the superior (as every Vi user already knows) | ||
| 175 | world of Vi! These users are well familiar with Emacs bindings and prefer them | ||
| 176 | in some cases, especially in the Vi Insert state. John Hawkins | ||
| 177 | <jshawkin@@eecs.umich.edu> has provided a set of customizations, which | ||
| 178 | enables additional Emacs bindings under Viper. These customizations can be | ||
| 179 | included in your @file{~/.viper} file and are found at the following URL: | ||
| 180 | @file{http://www.eecs.umich.edu/~jshawkin/viper-sample}. | ||
| 181 | |||
| 171 | Viper was formerly known as VIP-19, which was | 182 | Viper was formerly known as VIP-19, which was |
| 172 | a descendant of VIP 3.5 by Masahiko Sato and VIP 4.4 by Aamod Sane. | 183 | a descendant of VIP 3.5 by Masahiko Sato and VIP 4.4 by Aamod Sane. |
| 173 | 184 | ||
| @@ -1850,10 +1861,8 @@ specifying a new face. (Emacs faces are described in the Emacs Lisp | |||
| 1850 | reference.) On a color display, the following customization method is | 1861 | reference.) On a color display, the following customization method is |
| 1851 | usually most effective: | 1862 | usually most effective: |
| 1852 | @example | 1863 | @example |
| 1853 | (set-face-foreground viper-replace-overlay-face | 1864 | (set-face-foreground viper-replace-overlay-face "DarkSlateBlue") |
| 1854 | "DarkSlateBlue") | 1865 | (set-face-background viper-replace-overlay-face "yellow") |
| 1855 | (set-face-background viper-replace-overlay-face | ||
| 1856 | "yellow") | ||
| 1857 | @end example | 1866 | @end example |
| 1858 | For a complete list of colors available to you, evaluate the expression | 1867 | For a complete list of colors available to you, evaluate the expression |
| 1859 | @code{(x-defined-colors)}. (Type it in the buffer @code{*scratch*} and then | 1868 | @code{(x-defined-colors)}. (Type it in the buffer @code{*scratch*} and then |
| @@ -2059,8 +2068,7 @@ can write this: | |||
| 2059 | @noindent | 2068 | @noindent |
| 2060 | To customize the binding for @kbd{C-h} in Insert state: | 2069 | To customize the binding for @kbd{C-h} in Insert state: |
| 2061 | @example | 2070 | @example |
| 2062 | (define-key viper-insert-global-user-map | 2071 | (define-key viper-insert-global-user-map "\C-h" 'my-del-backwards-function) |
| 2063 | "\C-h" 'my-del-backwards-function) | ||
| 2064 | @end example | 2072 | @end example |
| 2065 | @noindent | 2073 | @noindent |
| 2066 | 2074 | ||
| @@ -2109,8 +2117,7 @@ Dired functions, the trick can be accomplished via the following code: | |||
| 2109 | (setq my-dired-vi-purist-map (make-sparse-keymap)) | 2117 | (setq my-dired-vi-purist-map (make-sparse-keymap)) |
| 2110 | (define-key my-dired-vi-purist-map "k" 'viper-previous-line) | 2118 | (define-key my-dired-vi-purist-map "k" 'viper-previous-line) |
| 2111 | (define-key my-dired-vi-purist-map "l" 'viper-forward-char) | 2119 | (define-key my-dired-vi-purist-map "l" 'viper-forward-char) |
| 2112 | (viper-modify-major-mode 'dired-mode | 2120 | (viper-modify-major-mode 'dired-mode 'emacs-state my-dired-vi-purist-map) |
| 2113 | 'emacs-state my-dired-vi-purist-map) | ||
| 2114 | @end example | 2121 | @end example |
| 2115 | 2122 | ||
| 2116 | Yet another way to customize key bindings in a major mode is to edit the | 2123 | Yet another way to customize key bindings in a major mode is to edit the |
| @@ -4198,6 +4205,8 @@ Put the output of <cmd> after the line <address> (default current). | |||
| 4198 | @item :<address>r <name> | 4205 | @item :<address>r <name> |
| 4199 | Read the file <name> into the buffer after the line <address> (default | 4206 | Read the file <name> into the buffer after the line <address> (default |
| 4200 | current). | 4207 | current). |
| 4208 | @item :make | ||
| 4209 | Run the make command in the current directory. | ||
| 4201 | @end table | 4210 | @end table |
| 4202 | @findex @kbd{:<address>r <name>} | 4211 | @findex @kbd{:<address>r <name>} |
| 4203 | @findex @kbd{:<address>r !<cmd>} | 4212 | @findex @kbd{:<address>r !<cmd>} |
| @@ -4209,6 +4218,7 @@ current). | |||
| 4209 | @findex @kbd{:!!@: <args>} | 4218 | @findex @kbd{:!!@: <args>} |
| 4210 | @findex @kbd{:!<cmd>} | 4219 | @findex @kbd{:!<cmd>} |
| 4211 | @findex @kbd{:sh} | 4220 | @findex @kbd{:sh} |
| 4221 | @findex @kbd{:make} | ||
| 4212 | 4222 | ||
| 4213 | @node Options,Emacs Related Commands,Shell Commands,Commands | 4223 | @node Options,Emacs Related Commands,Shell Commands,Commands |
| 4214 | @section Options | 4224 | @section Options |
| @@ -4455,6 +4465,7 @@ minakaji@@osaka.email.ne.jp (Mikio Nakajima), | |||
| 4455 | Mark.Bordas@@East.Sun.COM (Mark Bordas), | 4465 | Mark.Bordas@@East.Sun.COM (Mark Bordas), |
| 4456 | meyering@@comco.com (Jim Meyering), | 4466 | meyering@@comco.com (Jim Meyering), |
| 4457 | martin@@xemacs.org (Martin Buchholz), | 4467 | martin@@xemacs.org (Martin Buchholz), |
| 4468 | mbutler@@redfernnetworks.com (Malcolm Butler), | ||
| 4458 | mveiga@@dit.upm.es (Marcelino Veiga Tuimil), | 4469 | mveiga@@dit.upm.es (Marcelino Veiga Tuimil), |
| 4459 | paulk@@summit.esg.apertus.com (Paul Keusemann), | 4470 | paulk@@summit.esg.apertus.com (Paul Keusemann), |
| 4460 | pfister@@cs.sunysb.edu (Hanspeter Pfister), | 4471 | pfister@@cs.sunysb.edu (Hanspeter Pfister), |