aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kifer2005-09-20 17:47:28 +0000
committerMichael Kifer2005-09-20 17:47:28 +0000
commit15c77b9ecd23bfcb6c831bbc25d35ec8d0723fad (patch)
tree65a1226ad4376299b55254a51ccf406c445ac5e7
parent41ea4df8c30cb9c1c7254188c5aa812d9875f383 (diff)
downloademacs-15c77b9ecd23bfcb6c831bbc25d35ec8d0723fad.tar.gz
emacs-15c77b9ecd23bfcb6c831bbc25d35ec8d0723fad.zip
2005-09-20 Michael Kifer <kifer@cs.stonybrook.edu>
* ediff-ptch.el (ediff-file-name-sans-prefix): treat nil as an empty string. (ediff-fixup-patch-map): better heuristic for intuiting the file names to patch. (ediff-prompt-for-patch-file): more intuitive prompt. * ediff-util.el: use insert-buffer-substring. * ediff-vers.el (cvs-run-ediff-on-file-descriptor): bug fix. * viper-cmd.el (viper-change-state): don't move over the field boundaries in the minibuffer. (viper-set-minibuffer-style): add viper-minibuffer-post-command-hook. (viper-minibuffer-post-command-hook): new hook. (viper-line): don't move cursor at bolp. * viper-ex.el (ex-pwd, viper-info-on-file): fixed message * viper-init.el: add alias to make-variable-buffer-local to avoid compiler warnings. * viper-macs.el (ex-map): better messages. * viper-utils.el (viper-beginning-of-field): new function. * viper.el: replace make-variable-buffer-local with viper-make-variable-buffer-local everywhere, to avoid warnings.
-rw-r--r--lisp/ChangeLog30
-rw-r--r--lisp/ediff-ptch.el143
-rw-r--r--lisp/ediff-util.el2
-rw-r--r--lisp/ediff-vers.el5
-rw-r--r--lisp/ediff.el4
-rw-r--r--lisp/emulation/viper-cmd.el12
-rw-r--r--lisp/emulation/viper-init.el5
-rw-r--r--lisp/emulation/viper-macs.el8
-rw-r--r--lisp/emulation/viper-util.el8
-rw-r--r--lisp/emulation/viper.el9
10 files changed, 158 insertions, 68 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4ed37707b96..9f448eaa7eb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,33 @@
12005-09-20 Michael Kifer <kifer@cs.stonybrook.edu>
2
3 * ediff-ptch.el (ediff-file-name-sans-prefix): treat nil as an empty
4 string.
5 (ediff-fixup-patch-map): better heuristic for intuiting the file names
6 to patch.
7 (ediff-prompt-for-patch-file): more intuitive prompt.
8
9 * ediff-util.el: use insert-buffer-substring.
10
11 * ediff-vers.el (cvs-run-ediff-on-file-descriptor): bug fix.
12
13 * viper-cmd.el (viper-change-state): don't move over the field
14 boundaries in the minibuffer.
15 (viper-set-minibuffer-style): add viper-minibuffer-post-command-hook.
16 (viper-minibuffer-post-command-hook): new hook.
17 (viper-line): don't move cursor at bolp.
18
19 * viper-ex.el (ex-pwd, viper-info-on-file): fixed message
20
21 * viper-init.el: add alias to make-variable-buffer-local to avoid
22 compiler warnings.
23
24 * viper-macs.el (ex-map): better messages.
25
26 * viper-utils.el (viper-beginning-of-field): new function.
27
28 * viper.el: replace make-variable-buffer-local with
29 viper-make-variable-buffer-local everywhere, to avoid warnings.
30
12005-09-19 Stefan Monnier <monnier@iro.umontreal.ca> 312005-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 32
3 * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line): 33 * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line):
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el
index df781e92b5b..2e374f11040 100644
--- a/lisp/ediff-ptch.el
+++ b/lisp/ediff-ptch.el
@@ -163,10 +163,16 @@ program."
163;; strip prefix from filename 163;; strip prefix from filename
164;; returns /dev/null, if can't strip prefix 164;; returns /dev/null, if can't strip prefix
165(defsubst ediff-file-name-sans-prefix (filename prefix) 165(defsubst ediff-file-name-sans-prefix (filename prefix)
166 (save-match-data 166 (if prefix
167 (if (string-match (concat "^" (regexp-quote prefix)) filename) 167 (save-match-data
168 (substring filename (match-end 0)) 168 (if (string-match (concat "^" (if (stringp prefix)
169 (concat "/null/" filename)))) 169 (regexp-quote prefix)
170 ""))
171 filename)
172 (substring filename (match-end 0))
173 (concat "/null/" filename)))
174 filename)
175 )
170 176
171 177
172 178
@@ -260,11 +266,14 @@ program."
260 count))) 266 count)))
261 267
262;; Fix up the file names in the list using the argument FILENAME 268;; Fix up the file names in the list using the argument FILENAME
263;; Algorithm: find the first file's directory and cut it out from each file 269;; Algorithm: find the files' directories in the patch and, if a directory is
264;; name in the patch. Prepend the directory of FILENAME to each file in the 270;; absolute, cut it out from the corresponding file name in the patch.
265;; patch. In addition, the first file in the patch is replaced by FILENAME. 271;; Relative directories are not cut out.
266;; Each file is actually a file-pair of files found in the context diff header 272;; Prepend the directory of FILENAME to each resulting file (which came
267;; In the end, for each pair, we select the shortest existing file. 273;; originally from the patch).
274;; In addition, the first file in the patch document is replaced by FILENAME.
275;; Each file is actually a pair of files found in the context diff header
276;; In the end, for each pair, we ask the user which file to patch.
268;; Note: Ediff doesn't recognize multi-file patches that are separated 277;; Note: Ediff doesn't recognize multi-file patches that are separated
269;; with the `Index:' line. It treats them as a single-file patch. 278;; with the `Index:' line. It treats them as a single-file patch.
270;; 279;;
@@ -275,30 +284,41 @@ program."
275 ;; directory part of filename 284 ;; directory part of filename
276 (file-name-as-directory filename) 285 (file-name-as-directory filename)
277 (file-name-directory filename))) 286 (file-name-directory filename)))
278 ;; Filename-spec is objA; at this point it is represented as 287 ;; In case 2 files are possible patch targets, the user will be offered
279 ;; (file1 . file2). We get it using ediff-get-session-objA 288 ;; to choose file1 or file2. In a multifile patch, if the user chooses
280 ;; directory part of the first file in the patch 289 ;; 1 or 2, this choice is preserved to decide future alternatives.
281 (base-dir1 (file-name-directory 290 chosen-alternative
282 (car (ediff-get-session-objA-name (car ediff-patch-map)))))
283 ;; directory part of the 2nd file in the patch
284 (base-dir2 (file-name-directory
285 (cdr (ediff-get-session-objA-name (car ediff-patch-map)))))
286 ) 291 )
287 292
288 ;; chop off base-dirs 293 ;; chop off base-dirs
289 (mapcar (lambda (session-info) 294 (mapcar (lambda (session-info)
290 (let ((proposed-file-names 295 (let* ((proposed-file-names
291 (ediff-get-session-objA-name session-info))) 296 ;; Filename-spec is objA; it is represented as
297 ;; (file1 . file2). Get it using ediff-get-session-objA.
298 (ediff-get-session-objA-name session-info))
299 ;; base-dir1 is the dir part of the 1st file in the patch
300 (base-dir1 (file-name-directory (car proposed-file-names)))
301 ;; directory part of the 2nd file in the patch
302 (base-dir2 (file-name-directory (cdr proposed-file-names)))
303 )
304 ;; If both base-dir1 and base-dir2 are relative, assume that
305 ;; these dirs lead to the actual files starting at the present
306 ;; directory. So, we don't strip these relative dirs from the
307 ;; file names. This is a heuristic intended to improve guessing
308 (unless (or (file-name-absolute-p base-dir1)
309 (file-name-absolute-p base-dir2))
310 (setq base-dir1 ""
311 base-dir2 ""))
292 (or (string= (car proposed-file-names) "/dev/null") 312 (or (string= (car proposed-file-names) "/dev/null")
293 (setcar proposed-file-names 313 (setcar proposed-file-names
294 (ediff-file-name-sans-prefix 314 (ediff-file-name-sans-prefix
295 (car proposed-file-names) base-dir1))) 315 (car proposed-file-names) base-dir1)))
296 (or (string= 316 (or (string=
297 (cdr proposed-file-names) "/dev/null") 317 (cdr proposed-file-names) "/dev/null")
298 (setcdr proposed-file-names 318 (setcdr proposed-file-names
299 (ediff-file-name-sans-prefix 319 (ediff-file-name-sans-prefix
300 (cdr proposed-file-names) base-dir2))) 320 (cdr proposed-file-names) base-dir2)))
301 )) 321 ))
302 ediff-patch-map) 322 ediff-patch-map)
303 323
304 ;; take the given file name into account 324 ;; take the given file name into account
@@ -314,8 +334,8 @@ program."
314 (ediff-get-session-objA-name session-info))) 334 (ediff-get-session-objA-name session-info)))
315 (if (and (string-match "^/null/" (car proposed-file-names)) 335 (if (and (string-match "^/null/" (car proposed-file-names))
316 (string-match "^/null/" (cdr proposed-file-names))) 336 (string-match "^/null/" (cdr proposed-file-names)))
317 ;; couldn't strip base-dir1 and base-dir2 337 ;; couldn't intuit the file name to patch, so
318 ;; hence, something is wrong 338 ;; something is amiss
319 (progn 339 (progn
320 (with-output-to-temp-buffer ediff-msg-buffer 340 (with-output-to-temp-buffer ediff-msg-buffer
321 (ediff-with-current-buffer standard-output 341 (ediff-with-current-buffer standard-output
@@ -367,17 +387,29 @@ other files, enter /dev/null
367 (f1-exists (file-exists-p file1)) 387 (f1-exists (file-exists-p file1))
368 (f2-exists (file-exists-p file2))) 388 (f2-exists (file-exists-p file2)))
369 (cond 389 (cond
370 ((and (< (length file2) (length file1)) 390 ((and
371 f2-exists) 391 ;; The patch program prefers the shortest file as the patch
392 ;; target. However, this is a questionable heuristic. In an
393 ;; interactive program, like ediff, we can offer the user a
394 ;; choice.
395 ;; (< (length file2) (length file1))
396 (not f1-exists)
397 f2-exists)
372 ;; replace file-pair with the winning file2 398 ;; replace file-pair with the winning file2
373 (setcar session-file-object file2)) 399 (setcar session-file-object file2))
374 ((and (< (length file1) (length file2)) 400 ((and
375 f1-exists) 401 ;; (< (length file1) (length file2))
402 (not f2-exists)
403 f1-exists)
376 ;; replace file-pair with the winning file1 404 ;; replace file-pair with the winning file1
377 (setcar session-file-object file1)) 405 (setcar session-file-object file1))
378 ((and f1-exists f2-exists 406 ((and f1-exists f2-exists
379 (string= file1 file2)) 407 (string= file1 file2))
380 (setcar session-file-object file1)) 408 (setcar session-file-object file1))
409 ((and f1-exists f2-exists (eq chosen-alternative 1))
410 (setcar session-file-object file1))
411 ((and f1-exists f2-exists (eq chosen-alternative 2))
412 (setcar session-file-object file2))
381 ((and f1-exists f2-exists) 413 ((and f1-exists f2-exists)
382 (with-output-to-temp-buffer ediff-msg-buffer 414 (with-output-to-temp-buffer ediff-msg-buffer
383 (ediff-with-current-buffer standard-output 415 (ediff-with-current-buffer standard-output
@@ -393,10 +425,15 @@ Please advice:
393 Type `y' to use %s as the target; 425 Type `y' to use %s as the target;
394 Type `n' to use %s as the target. 426 Type `n' to use %s as the target.
395" 427"
396 file1 file2 file2 file1))) 428 file1 file2 file1 file2)))
397 (setcar session-file-object 429 (setcar session-file-object
398 (if (y-or-n-p (format "Use %s ? " file2)) 430 (if (y-or-n-p (format "Use %s ? " file1))
399 file2 file1))) 431 (progn
432 (setq chosen-alternative 1)
433 file1)
434 (setq chosen-alternative 2)
435 file2))
436 )
400 (f2-exists (setcar session-file-object file2)) 437 (f2-exists (setcar session-file-object file2))
401 (f1-exists (setcar session-file-object file1)) 438 (f1-exists (setcar session-file-object file1))
402 (t 439 (t
@@ -407,7 +444,7 @@ Please advice:
407 (if (string= file1 file2) 444 (if (string= file1 file2)
408 (princ (format " 445 (princ (format "
409 %s 446 %s
410is the target for this patch. However, this file does not exist." 447is assumed to be the target for this patch. However, this file does not exist."
411 file1)) 448 file1))
412 (princ (format " 449 (princ (format "
413 %s 450 %s
@@ -441,22 +478,26 @@ are two possible targets for this patch. However, these files do not exist."
441 478
442;; prompt for file, get the buffer 479;; prompt for file, get the buffer
443(defun ediff-prompt-for-patch-file () 480(defun ediff-prompt-for-patch-file ()
444 (let ((dir (cond (ediff-patch-default-directory) ; try patch default dir 481 (let ((dir (cond (ediff-use-last-dir ediff-last-dir-patch)
445 (ediff-use-last-dir ediff-last-dir-patch) 482 (ediff-patch-default-directory) ; try patch default dir
446 (t default-directory))) 483 (t default-directory)))
447 (coding-system-for-read ediff-coding-system-for-read)) 484 (coding-system-for-read ediff-coding-system-for-read)
448 (find-file-noselect 485 patch-file-name)
449 (read-file-name 486 (setq patch-file-name
450 (format "Patch is in file:%s " 487 (read-file-name
451 (cond ((and buffer-file-name 488 (format "Patch is in file:%s "
452 (equal (expand-file-name dir) 489 (cond ((and buffer-file-name
453 (file-name-directory buffer-file-name))) 490 (equal (expand-file-name dir)
454 (concat 491 (file-name-directory buffer-file-name)))
455 " (default " 492 (concat
456 (file-name-nondirectory buffer-file-name) 493 " (default "
457 ")")) 494 (file-name-nondirectory buffer-file-name)
458 (t ""))) 495 ")"))
459 dir buffer-file-name 'must-match)) 496 (t "")))
497 dir buffer-file-name 'must-match))
498 (if (file-directory-p patch-file-name)
499 (error "Patch file cannot be a directory: %s" patch-file-name)
500 (find-file-noselect patch-file-name))
460 )) 501 ))
461 502
462 503
@@ -647,7 +688,7 @@ optional argument, then use it."
647 (ediff-maybe-checkout buf-to-patch) 688 (ediff-maybe-checkout buf-to-patch)
648 689
649 (ediff-with-current-buffer patch-diagnostics 690 (ediff-with-current-buffer patch-diagnostics
650 (insert-buffer patch-buf) 691 (insert-buffer-substring patch-buf)
651 (message "Applying patch ... ") 692 (message "Applying patch ... ")
652 ;; fix environment for gnu patch, so it won't make numbered extensions 693 ;; fix environment for gnu patch, so it won't make numbered extensions
653 (setq backup-style (getenv "VERSION_CONTROL")) 694 (setq backup-style (getenv "VERSION_CONTROL"))
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el
index a28f9d459ff..445669c599f 100644
--- a/lisp/ediff-util.el
+++ b/lisp/ediff-util.el
@@ -367,7 +367,7 @@ to invocation.")
367 (ediff-unique-buffer-name "*ediff-merge" "*"))) 367 (ediff-unique-buffer-name "*ediff-merge" "*")))
368 (save-excursion 368 (save-excursion
369 (set-buffer buffer-C) 369 (set-buffer buffer-C)
370 (insert-buffer buf) 370 (insert-buffer-substring buf)
371 (funcall (ediff-with-current-buffer buf major-mode)) 371 (funcall (ediff-with-current-buffer buf major-mode))
372 (widen) ; merge buffer is always widened 372 (widen) ; merge buffer is always widened
373 (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t) 373 (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t)
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el
index 9ae720e9bc3..f1f2305de81 100644
--- a/lisp/ediff-vers.el
+++ b/lisp/ediff-vers.el
@@ -299,7 +299,10 @@
299 ((eq type 'MODIFIED) 299 ((eq type 'MODIFIED)
300 (ediff-buffers 300 (ediff-buffers
301 (find-file-noselect tmp-file) 301 (find-file-noselect tmp-file)
302 (find-file-noselect (cvs-fileinfo->full-path fileinfo)) 302 (if (featurep 'xemacs)
303 ;; XEmacs doesn't seem to have cvs-fileinfo->full-name
304 (find-file-noselect (cvs-fileinfo->full-path fileinfo))
305 (find-file-noselect (cvs-fileinfo->full-name fileinfo)))
303 nil ; startup-hooks 306 nil ; startup-hooks
304 'ediff-revisions))) 307 'ediff-revisions)))
305 (if (stringp tmp-file) (delete-file tmp-file)) 308 (if (stringp tmp-file) (delete-file tmp-file))
diff --git a/lisp/ediff.el b/lisp/ediff.el
index 35b28a3e550..a4b5bd77368 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -7,8 +7,8 @@
7;; Created: February 2, 1994 7;; Created: February 2, 1994
8;; Keywords: comparing, merging, patching, tools, unix 8;; Keywords: comparing, merging, patching, tools, unix
9 9
10(defconst ediff-version "2.80" "The current version of Ediff") 10(defconst ediff-version "2.80.1" "The current version of Ediff")
11(defconst ediff-date "July 8, 2005" "Date of last update") 11(defconst ediff-date "September 19, 2005" "Date of last update")
12 12
13 13
14;; This file is part of GNU Emacs. 14;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 99a130e7f1d..7d2e10a8f31 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -358,7 +358,7 @@
358 'viper-insertion-ring)) 358 'viper-insertion-ring))
359 359
360 (if viper-ESC-moves-cursor-back 360 (if viper-ESC-moves-cursor-back
361 (or (bolp) (backward-char 1)))) 361 (or (bolp) (viper-beginning-of-field) (backward-char 1))))
362 )) 362 ))
363 363
364 ;; insert or replace 364 ;; insert or replace
@@ -1996,7 +1996,8 @@ Undo previous insertion and inserts new."
1996;;; Minibuffer business 1996;;; Minibuffer business
1997 1997
1998(defsubst viper-set-minibuffer-style () 1998(defsubst viper-set-minibuffer-style ()
1999 (add-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)) 1999 (add-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
2000 (add-hook 'post-command-hook 'viper-minibuffer-post-command-hook))
2000 2001
2001 2002
2002(defun viper-minibuffer-setup-sentinel () 2003(defun viper-minibuffer-setup-sentinel ()
@@ -2039,6 +2040,11 @@ Undo previous insertion and inserts new."
2039 (minibuffer-prompt-end) 2040 (minibuffer-prompt-end)
2040 (point-min))) 2041 (point-min)))
2041 2042
2043(defun viper-minibuffer-post-command-hook()
2044 (when (active-minibuffer-window)
2045 (when (< (point) (viper-minibuffer-real-start))
2046 (goto-char (viper-minibuffer-real-start)))))
2047
2042 2048
2043;; Interpret last event in the local map first; if fails, use exit-minibuffer. 2049;; Interpret last event in the local map first; if fails, use exit-minibuffer.
2044;; Run viper-minibuffer-exit-hook before exiting. 2050;; Run viper-minibuffer-exit-hook before exiting.
@@ -2570,7 +2576,7 @@ These keys are ESC, RET, and LineFeed"
2570 ;; last line of buffer when this line has no \n. 2576 ;; last line of buffer when this line has no \n.
2571 (viper-add-newline-at-eob-if-necessary) 2577 (viper-add-newline-at-eob-if-necessary)
2572 (viper-execute-com 'viper-line val com)) 2578 (viper-execute-com 'viper-line val com))
2573 (if (and (eobp) (not (bobp))) (forward-line -1)) 2579 (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
2574 ) 2580 )
2575 2581
2576(defun viper-yank-line (arg) 2582(defun viper-yank-line (arg)
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 9c1df1b0ad5..8aa7e4649d4 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -115,6 +115,11 @@ In all likelihood, you don't need to bother with this setting."
115 115
116;;; Macros 116;;; Macros
117 117
118;; Fool the compiler to avoid warnings.
119;; Viper calls make-variable-buffer-local from within other functions, which
120;; triggers compiler warnings.
121(defalias 'viper-make-variable-buffer-local 'make-variable-buffer-local)
122
118(defmacro viper-deflocalvar (var default-value &optional documentation) 123(defmacro viper-deflocalvar (var default-value &optional documentation)
119 `(progn 124 `(progn
120 (defvar ,var ,default-value 125 (defvar ,var ,default-value
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index 9349a950e97..d401c148ad6 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -118,7 +118,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
118 (define-key viper-vi-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro) 118 (define-key viper-vi-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
119 (define-key viper-insert-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro) 119 (define-key viper-insert-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
120 (define-key viper-emacs-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro) 120 (define-key viper-emacs-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
121 (message "Mapping %S in %s state. Hit `C-x )' to complete the mapping" 121 (message "Mapping %S in %s state. Type macro definition followed by `C-x )'"
122 (viper-display-macro macro-name) 122 (viper-display-macro macro-name)
123 (if ins "Insert" "Vi"))) 123 (if ins "Insert" "Vi")))
124 )) 124 ))
@@ -170,7 +170,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
170 ((stringp macro-name) 170 ((stringp macro-name)
171 (setq macro-name (vconcat macro-name))) 171 (setq macro-name (vconcat macro-name)))
172 (t (setq macro-name (vconcat (prin1-to-string macro-name))))) 172 (t (setq macro-name (vconcat (prin1-to-string macro-name)))))
173 (message ":map%s <Name>" variant)(sit-for 2) 173 (message ":map%s <Macro Name>" variant)(sit-for 2)
174 (while 174 (while
175 (not (member key 175 (not (member key
176 '(?\C-m ?\n (control m) (control j) return linefeed))) 176 '(?\C-m ?\n (control m) (control j) return linefeed)))
@@ -442,10 +442,6 @@ If SCOPE is nil, the user is asked to specify the scope."
442 scope) 442 scope)
443 viper-custom-file-name)) 443 viper-custom-file-name))
444 444
445 ;; 2005-09-18 T06:41:22-0400 (Sunday) D. Goel
446 ;; From careful parsing of the above code, it looks like msg
447 ;; couldn't be nil when we reach here. Since it is a string,
448 ;; and a complicated one too, we might as well provide it a "%s"
449 (message "%s" msg) 445 (message "%s" msg)
450 )) 446 ))
451 447
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index cc9f42b9800..d0b9b34e4d6 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -1405,6 +1405,7 @@ This option is appropriate if you like Emacs-style words."
1405 viper-SEP-char-class 1405 viper-SEP-char-class
1406 (or within-line "\n") 1406 (or within-line "\n")
1407 (if within-line (viper-line-pos 'end))))) 1407 (if within-line (viper-line-pos 'end)))))
1408
1408(defsubst viper-skip-all-separators-backward (&optional within-line) 1409(defsubst viper-skip-all-separators-backward (&optional within-line)
1409 (if (eq viper-syntax-preference 'strict-vi) 1410 (if (eq viper-syntax-preference 'strict-vi)
1410 (if within-line 1411 (if within-line
@@ -1433,6 +1434,7 @@ This option is appropriate if you like Emacs-style words."
1433 ;; Emacs may consider some of these as words, but we don't want them 1434 ;; Emacs may consider some of these as words, but we don't want them
1434 viper-non-word-characters 1435 viper-non-word-characters
1435 (viper-line-pos 'end)))) 1436 (viper-line-pos 'end))))
1437
1436(defun viper-skip-nonalphasep-backward () 1438(defun viper-skip-nonalphasep-backward ()
1437 (if (eq viper-syntax-preference 'strict-vi) 1439 (if (eq viper-syntax-preference 'strict-vi)
1438 (skip-chars-backward 1440 (skip-chars-backward
@@ -1502,6 +1504,12 @@ This option is appropriate if you like Emacs-style words."
1502 total 1504 total
1503 )) 1505 ))
1504 1506
1507;; tells when point is at the beginning of field
1508(defun viper-beginning-of-field ()
1509 (or (bobp)
1510 (not (eq (get-char-property (point) 'field)
1511 (get-char-property (1- (point)) 'field)))))
1512
1505 1513
1506;; this is copied from cl-extra.el 1514;; this is copied from cl-extra.el
1507;; Return the subsequence of SEQ from START to END. 1515;; Return the subsequence of SEQ from START to END.
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index bfa730cc434..b3fd6d139c0 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -9,7 +9,7 @@
9;; Author: Michael Kifer <kifer@cs.stonybrook.edu> 9;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
10;; Keywords: emulations 10;; Keywords: emulations
11 11
12(defconst viper-version "3.11.5 of August 6, 2005" 12(defconst viper-version "3.11.5 of September 19, 2005"
13 "The current version of Viper") 13 "The current version of Viper")
14 14
15;; This file is part of GNU Emacs. 15;; This file is part of GNU Emacs.
@@ -606,7 +606,7 @@ This startup message appears whenever you load Viper, unless you type `y' now."
606 (viper-set-expert-level 'dont-change-unless))) 606 (viper-set-expert-level 'dont-change-unless)))
607 607
608 (if viper-xemacs-p 608 (if viper-xemacs-p
609 (make-variable-buffer-local 'bar-cursor)) 609 (viper-make-variable-buffer-local 'bar-cursor))
610 (if (eq major-mode 'viper-mode) 610 (if (eq major-mode 'viper-mode)
611 (setq major-mode 'fundamental-mode)) 611 (setq major-mode 'fundamental-mode))
612 612
@@ -769,6 +769,7 @@ It also can't undo some Viper settings."
769 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook) 769 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook)
770 (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel) 770 (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
771 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel) 771 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel)
772 (remove-hook 'post-command-hook 'viper-minibuffer-post-command-hook)
772 773
773 ;; unbind Viper mouse bindings 774 ;; unbind Viper mouse bindings
774 (viper-unbind-mouse-search-key) 775 (viper-unbind-mouse-search-key)
@@ -1008,7 +1009,7 @@ It also can't undo some Viper settings."
1008 ;; ***This is needed only in case emulation-mode-map-alists is not defined 1009 ;; ***This is needed only in case emulation-mode-map-alists is not defined
1009 (unless 1010 (unless
1010 (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) 1011 (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
1011 (make-variable-buffer-local 'minor-mode-map-alist)) 1012 (viper-make-variable-buffer-local 'minor-mode-map-alist))
1012 1013
1013 ;; Viper changes the default mode-line-buffer-identification 1014 ;; Viper changes the default mode-line-buffer-identification
1014 (setq-default mode-line-buffer-identification '(" %b")) 1015 (setq-default mode-line-buffer-identification '(" %b"))
@@ -1017,7 +1018,7 @@ It also can't undo some Viper settings."
1017 (setq next-line-add-newlines nil 1018 (setq next-line-add-newlines nil
1018 require-final-newline t) 1019 require-final-newline t)
1019 1020
1020 (make-variable-buffer-local 'require-final-newline) 1021 (viper-make-variable-buffer-local 'require-final-newline)
1021 1022
1022 ;; don't bark when mark is inactive 1023 ;; don't bark when mark is inactive
1023 (if viper-emacs-p 1024 (if viper-emacs-p