aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
authorMiles Bader2007-08-21 04:55:30 +0000
committerMiles Bader2007-08-21 04:55:30 +0000
commit1fb072d1dff954c21d4805196df62c8eeead301c (patch)
treeda374db1a51e2a355b46f26a1c99e1ac5db5dca4 /lisp/emulation
parentaaf34461ff5804e5cebe163b31e535da72e81d87 (diff)
parentbdaf8a62d53cf8d5a0dc4f0dc530ecd6fc1f44fe (diff)
downloademacs-1fb072d1dff954c21d4805196df62c8eeead301c.tar.gz
emacs-1fb072d1dff954c21d4805196df62c8eeead301c.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 852-856) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 93-96) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 245) - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-32
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/cua-base.el16
-rw-r--r--lisp/emulation/tpu-edt.el461
-rw-r--r--lisp/emulation/tpu-extras.el66
-rw-r--r--lisp/emulation/viper-cmd.el32
-rw-r--r--lisp/emulation/viper-ex.el2
-rw-r--r--lisp/emulation/viper.el13
6 files changed, 303 insertions, 287 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 337be13e2e5..323cad15276 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1601,22 +1601,6 @@ shifted movement key, set `cua-highlight-region-shift-only'."
1601 (interactive) 1601 (interactive)
1602 (setq cua--debug (not cua--debug))) 1602 (setq cua--debug (not cua--debug)))
1603 1603
1604;; Install run-time check for older versions of CUA-mode which does not
1605;; work with GNU Emacs version 22.1 and newer.
1606;;
1607;; Except for version 1.2, all of the 1.x and 2.x version of cua-mode
1608;; provided the `CUA-mode' feature. Since this is no longer true,
1609;; we can warn the user if the `CUA-mode' feature is ever provided.
1610
1611;;;###autoload (eval-after-load 'CUA-mode
1612;;;###autoload '(error (concat "\n\n"
1613;;;###autoload "CUA-mode is now part of the standard GNU Emacs distribution, so you may\n"
1614;;;###autoload "now enable CUA via the Options menu or by customizing option `cua-mode'.\n\n"
1615;;;###autoload "You have loaded an older version of CUA-mode which does\n"
1616;;;###autoload "not work correctly with this version of GNU Emacs.\n\n"
1617;;;###autoload (if user-init-file (concat
1618;;;###autoload "To correct this, remove the loading and customization of the\n"
1619;;;###autoload "old version from the " user-init-file " file.\n\n")))))
1620 1604
1621(provide 'cua) 1605(provide 'cua)
1622 1606
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index 81187112a66..12e64940b06 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -322,176 +322,176 @@
322 ;; that term/*.el does its job to map the escape sequence to the right 322 ;; that term/*.el does its job to map the escape sequence to the right
323 ;; key-symbol. 323 ;; key-symbol.
324 324
325 (define-key map [up] 'tpu-move-to-beginning) ; up-arrow 325 (define-key map [up] 'tpu-move-to-beginning) ; up-arrow
326 (define-key map [down] 'tpu-move-to-end) ; down-arrow 326 (define-key map [down] 'tpu-move-to-end) ; down-arrow
327 (define-key map [right] 'end-of-line) ; right-arrow 327 (define-key map [right] 'end-of-line) ; right-arrow
328 (define-key map [left] 'beginning-of-line) ; left-arrow 328 (define-key map [left] 'beginning-of-line) ; left-arrow
329 329
330 (define-key map [find] 'nil) ; Find 330 ;; (define-key map [find] nil) ; Find
331 (define-key map [insert] 'nil) ; Insert Here 331 ;; (define-key map [insert] nil) ; Insert Here
332 (define-key map [delete] 'tpu-store-text) ; Remove 332 (define-key map [delete] 'tpu-store-text) ; Remove
333 (define-key map [select] 'tpu-unselect) ; Select 333 (define-key map [select] 'tpu-unselect) ; Select
334 (define-key map [prior] 'tpu-previous-window) ; Prev Screen 334 (define-key map [prior] 'tpu-previous-window) ; Prev Screen
335 (define-key map [next] 'tpu-next-window) ; Next Screen 335 (define-key map [next] 'tpu-next-window) ; Next Screen
336 336
337 (define-key map [f1] 'nil) ; F1 337 ;; (define-key map [f1] nil) ; F1
338 (define-key map [f2] 'nil) ; F2 338 ;; (define-key map [f2] nil) ; F2
339 (define-key map [f3] 'nil) ; F3 339 ;; (define-key map [f3] nil) ; F3
340 (define-key map [f4] 'nil) ; F4 340 ;; (define-key map [f4] nil) ; F4
341 (define-key map [f5] 'nil) ; F5 341 ;; (define-key map [f5] nil) ; F5
342 (define-key map [f6] 'nil) ; F6 342 ;; (define-key map [f6] nil) ; F6
343 (define-key map [f7] 'nil) ; F7 343 ;; (define-key map [f7] nil) ; F7
344 (define-key map [f8] 'nil) ; F8 344 ;; (define-key map [f8] nil) ; F8
345 (define-key map [f9] 'nil) ; F9 345 ;; (define-key map [f9] nil) ; F9
346 (define-key map [f10] 'nil) ; F10 346 ;; (define-key map [f10] nil) ; F10
347 (define-key map [f11] 'nil) ; F11 347 ;; (define-key map [f11] nil) ; F11
348 (define-key map [f12] 'nil) ; F12 348 ;; (define-key map [f12] nil) ; F12
349 (define-key map [f13] 'nil) ; F13 349 ;; (define-key map [f13] nil) ; F13
350 (define-key map [f14] 'nil) ; F14 350 ;; (define-key map [f14] nil) ; F14
351 (define-key map [help] 'describe-bindings) ; HELP 351 (define-key map [help] 'describe-bindings) ; HELP
352 (define-key map [menu] 'nil) ; DO 352 ;; (define-key map [menu] nil) ; DO
353 (define-key map [f17] 'tpu-drop-breadcrumb) ; F17 353 (define-key map [f17] 'tpu-drop-breadcrumb) ; F17
354 (define-key map [f18] 'nil) ; F18 354 ;; (define-key map [f18] nil) ; F18
355 (define-key map [f19] 'nil) ; F19 355 ;; (define-key map [f19] nil) ; F19
356 (define-key map [f20] 'nil) ; F20 356 ;; (define-key map [f20] nil) ; F20
357 357
358 (define-key map [kp-f1] 'keyboard-quit) ; PF1 358 (define-key map [kp-f1] 'keyboard-quit) ; PF1
359 (define-key map [kp-f2] 'help-for-help) ; PF2 359 (define-key map [kp-f2] 'help-for-help) ; PF2
360 (define-key map [kp-f3] 'tpu-search) ; PF3 360 (define-key map [kp-f3] 'tpu-search) ; PF3
361 (define-key map [kp-f4] 'tpu-undelete-lines) ; PF4 361 (define-key map [kp-f4] 'tpu-undelete-lines) ; PF4
362 (define-key map [kp-0] 'open-line) ; KP0 362 (define-key map [kp-0] 'open-line) ; KP0
363 (define-key map [kp-1] 'tpu-change-case) ; KP1 363 (define-key map [kp-1] 'tpu-change-case) ; KP1
364 (define-key map [kp-2] 'tpu-delete-to-eol) ; KP2 364 (define-key map [kp-2] 'tpu-delete-to-eol) ; KP2
365 (define-key map [kp-3] 'tpu-special-insert) ; KP3 365 (define-key map [kp-3] 'tpu-special-insert) ; KP3
366 (define-key map [kp-4] 'tpu-move-to-end) ; KP4 366 (define-key map [kp-4] 'tpu-move-to-end) ; KP4
367 (define-key map [kp-5] 'tpu-move-to-beginning) ; KP5 367 (define-key map [kp-5] 'tpu-move-to-beginning) ; KP5
368 (define-key map [kp-6] 'tpu-paste) ; KP6 368 (define-key map [kp-6] 'tpu-paste) ; KP6
369 (define-key map [kp-7] 'execute-extended-command) ; KP7 369 (define-key map [kp-7] 'execute-extended-command) ; KP7
370 (define-key map [kp-8] 'tpu-fill) ; KP8 370 (define-key map [kp-8] 'tpu-fill) ; KP8
371 (define-key map [kp-9] 'tpu-replace) ; KP9 371 (define-key map [kp-9] 'tpu-replace) ; KP9
372 (define-key map [kp-subtract] 'tpu-undelete-words) ; KP- 372 (define-key map [kp-subtract] 'tpu-undelete-words) ; KP-
373 (define-key map [kp-separator] 'tpu-undelete-char) ; KP, 373 (define-key map [kp-separator] 'tpu-undelete-char) ; KP,
374 (define-key map [kp-decimal] 'tpu-unselect) ; KP. 374 (define-key map [kp-decimal] 'tpu-unselect) ; KP.
375 (define-key map [kp-enter] 'tpu-substitute) ; KPenter 375 (define-key map [kp-enter] 'tpu-substitute) ; KPenter
376 376
377 ;; 377 ;;
378 (define-key map "\C-A" 'tpu-toggle-overwrite-mode) ; ^A 378 (define-key map "\C-A" 'tpu-toggle-overwrite-mode) ; ^A
379 (define-key map "\C-B" 'nil) ; ^B 379 ;; (define-key map "\C-B" nil) ; ^B
380 (define-key map "\C-C" 'nil) ; ^C 380 ;; (define-key map "\C-C" nil) ; ^C
381 (define-key map "\C-D" 'nil) ; ^D 381 ;; (define-key map "\C-D" nil) ; ^D
382 (define-key map "\C-E" 'nil) ; ^E 382 ;; (define-key map "\C-E" nil) ; ^E
383 (define-key map "\C-F" 'set-visited-file-name) ; ^F 383 (define-key map "\C-F" 'set-visited-file-name) ; ^F
384 (define-key map "\C-g" 'keyboard-quit) ; safety first 384 (define-key map "\C-g" 'keyboard-quit) ; safety first
385 (define-key map "\C-h" 'delete-other-windows) ; BS 385 (define-key map "\C-h" 'delete-other-windows) ; BS
386 (define-key map "\C-i" 'other-window) ; TAB 386 (define-key map "\C-i" 'other-window) ; TAB
387 (define-key map "\C-J" 'nil) ; ^J 387 ;; (define-key map "\C-J" nil) ; ^J
388 (define-key map "\C-K" 'tpu-define-macro-key) ; ^K 388 (define-key map "\C-K" 'tpu-define-macro-key) ; ^K
389 (define-key map "\C-l" 'downcase-region) ; ^L 389 (define-key map "\C-l" 'downcase-region) ; ^L
390 (define-key map "\C-M" 'nil) ; ^M 390 ;; (define-key map "\C-M" nil) ; ^M
391 (define-key map "\C-N" 'nil) ; ^N 391 ;; (define-key map "\C-N" nil) ; ^N
392 (define-key map "\C-O" 'nil) ; ^O 392 ;; (define-key map "\C-O" nil) ; ^O
393 (define-key map "\C-P" 'nil) ; ^P 393 ;; (define-key map "\C-P" nil) ; ^P
394 (define-key map "\C-Q" 'nil) ; ^Q 394 ;; (define-key map "\C-Q" nil) ; ^Q
395 (define-key map "\C-R" 'nil) ; ^R 395 ;; (define-key map "\C-R" nil) ; ^R
396 (define-key map "\C-S" 'nil) ; ^S 396 ;; (define-key map "\C-S" nil) ; ^S
397 (define-key map "\C-T" 'tpu-toggle-control-keys) ; ^T 397 (define-key map "\C-T" 'tpu-toggle-control-keys) ; ^T
398 (define-key map "\C-u" 'upcase-region) ; ^U 398 (define-key map "\C-u" 'upcase-region) ; ^U
399 (define-key map "\C-V" 'nil) ; ^V 399 ;; (define-key map "\C-V" nil) ; ^V
400 (define-key map "\C-w" 'tpu-write-current-buffers) ; ^W 400 (define-key map "\C-w" 'tpu-write-current-buffers) ; ^W
401 (define-key map "\C-X" 'nil) ; ^X 401 ;; (define-key map "\C-X" nil) ; ^X
402 (define-key map "\C-Y" 'nil) ; ^Y 402 ;; (define-key map "\C-Y" nil) ; ^Y
403 (define-key map "\C-Z" 'nil) ; ^Z 403 ;; (define-key map "\C-Z" nil) ; ^Z
404 (define-key map " " 'undo) ; SPC 404 (define-key map " " 'undo) ; SPC
405 (define-key map "!" 'nil) ; ! 405 ;; (define-key map "!" nil) ; !
406 (define-key map "#" 'nil) ; # 406 ;; (define-key map "#" nil) ; #
407 (define-key map "$" 'tpu-add-at-eol) ; $ 407 (define-key map "$" 'tpu-add-at-eol) ; $
408 (define-key map "%" 'tpu-goto-percent) ; % 408 (define-key map "%" 'tpu-goto-percent) ; %
409 (define-key map "&" 'nil) ; & 409 ;; (define-key map "&" nil) ; &
410 (define-key map "(" 'nil) ; ( 410 ;; (define-key map "(" nil) ; (
411 (define-key map ")" 'nil) ; ) 411 ;; (define-key map ")" nil) ; )
412 (define-key map "*" 'tpu-toggle-regexp) ; * 412 (define-key map "*" 'tpu-toggle-regexp) ; *
413 (define-key map "+" 'nil) ; + 413 ;; (define-key map "+" nil) ; +
414 (define-key map "," 'tpu-goto-breadcrumb) ; , 414 (define-key map "," 'tpu-goto-breadcrumb) ; ,
415 (define-key map "-" 'negative-argument) ; - 415 (define-key map "-" 'negative-argument) ; -
416 (define-key map "." 'tpu-drop-breadcrumb) ; . 416 (define-key map "." 'tpu-drop-breadcrumb) ; .
417 (define-key map "/" 'tpu-emacs-replace) ; / 417 (define-key map "/" 'tpu-emacs-replace) ; /
418 (define-key map "0" 'digit-argument) ; 0 418 (define-key map "0" 'digit-argument) ; 0
419 (define-key map "1" 'digit-argument) ; 1 419 (define-key map "1" 'digit-argument) ; 1
420 (define-key map "2" 'digit-argument) ; 2 420 (define-key map "2" 'digit-argument) ; 2
421 (define-key map "3" 'digit-argument) ; 3 421 (define-key map "3" 'digit-argument) ; 3
422 (define-key map "4" 'digit-argument) ; 4 422 (define-key map "4" 'digit-argument) ; 4
423 (define-key map "5" 'digit-argument) ; 5 423 (define-key map "5" 'digit-argument) ; 5
424 (define-key map "6" 'digit-argument) ; 6 424 (define-key map "6" 'digit-argument) ; 6
425 (define-key map "7" 'digit-argument) ; 7 425 (define-key map "7" 'digit-argument) ; 7
426 (define-key map "8" 'digit-argument) ; 8 426 (define-key map "8" 'digit-argument) ; 8
427 (define-key map "9" 'digit-argument) ; 9 427 (define-key map "9" 'digit-argument) ; 9
428 (define-key map ":" 'nil) ; : 428 ;; (define-key map ":" nil) ; :
429 (define-key map ";" 'tpu-trim-line-ends) ; ; 429 (define-key map ";" 'tpu-trim-line-ends) ; ;
430 (define-key map "<" 'nil) ; < 430 ;; (define-key map "<" nil) ; <
431 (define-key map "=" 'nil) ; = 431 ;; (define-key map "=" nil) ; =
432 (define-key map ">" 'nil) ; > 432 ;; (define-key map ">" nil) ; >
433 (define-key map "?" 'tpu-spell-check) ; ? 433 (define-key map "?" 'tpu-spell-check) ; ?
434 (define-key map "A" 'tpu-toggle-newline-and-indent) ; A 434 ;; (define-key map "A" 'tpu-toggle-newline-and-indent) ; A
435 (define-key map "B" 'tpu-next-buffer) ; B 435 ;; (define-key map "B" 'tpu-next-buffer) ; B
436 (define-key map "C" 'repeat-complex-command) ; C 436 ;; (define-key map "C" 'repeat-complex-command) ; C
437 (define-key map "D" 'shell-command) ; D 437 ;; (define-key map "D" 'shell-command) ; D
438 (define-key map "E" 'tpu-exit) ; E 438 ;; (define-key map "E" 'tpu-exit) ; E
439 (define-key map "F" 'tpu-set-cursor-free) ; F 439 ;; (define-key map "F" 'tpu-cursor-free-mode) ; F
440 (define-key map "G" 'tpu-get) ; G 440 ;; (define-key map "G" 'tpu-get) ; G
441 (define-key map "H" 'nil) ; H 441 ;; (define-key map "H" nil) ; H
442 (define-key map "I" 'tpu-include) ; I 442 ;; (define-key map "I" 'tpu-include) ; I
443 (define-key map "K" 'tpu-kill-buffer) ; K 443 ;; (define-key map "K" 'tpu-kill-buffer) ; K
444 (define-key map "L" 'tpu-what-line) ; L 444 (define-key map "L" 'tpu-what-line) ; L
445 (define-key map "M" 'buffer-menu) ; M 445 ;; (define-key map "M" 'buffer-menu) ; M
446 (define-key map "N" 'tpu-next-file-buffer) ; N 446 ;; (define-key map "N" 'tpu-next-file-buffer) ; N
447 (define-key map "O" 'occur) ; O 447 ;; (define-key map "O" 'occur) ; O
448 (define-key map "P" 'lpr-buffer) ; P 448 (define-key map "P" 'lpr-buffer) ; P
449 (define-key map "Q" 'tpu-quit) ; Q 449 ;; (define-key map "Q" 'tpu-quit) ; Q
450 (define-key map "R" 'tpu-toggle-rectangle) ; R 450 ;; (define-key map "R" 'tpu-toggle-rectangle) ; R
451 (define-key map "S" 'replace) ; S 451 ;; (define-key map "S" 'replace) ; S
452 (define-key map "T" 'tpu-line-to-top-of-window) ; T 452 ;; (define-key map "T" 'tpu-line-to-top-of-window) ; T
453 (define-key map "U" 'undo) ; U 453 ;; (define-key map "U" 'undo) ; U
454 (define-key map "V" 'tpu-version) ; V 454 ;; (define-key map "V" 'tpu-version) ; V
455 (define-key map "W" 'save-buffer) ; W 455 ;; (define-key map "W" 'save-buffer) ; W
456 (define-key map "X" 'tpu-save-all-buffers-kill-emacs) ; X 456 ;; (define-key map "X" 'tpu-save-all-buffers-kill-emacs) ; X
457 (define-key map "Y" 'copy-region-as-kill) ; Y 457 ;; (define-key map "Y" 'copy-region-as-kill) ; Y
458 (define-key map "Z" 'suspend-emacs) ; Z 458 ;; (define-key map "Z" 'suspend-emacs) ; Z
459 (define-key map "[" 'blink-matching-open) ; [ 459 (define-key map "[" 'blink-matching-open) ; [
460 (define-key map "\\" 'nil) ; \ 460 ;; (define-key map "\\" nil) ; \
461 (define-key map "]" 'blink-matching-open) ; ] 461 (define-key map "]" 'blink-matching-open) ; ]
462 (define-key map "^" 'tpu-add-at-bol) ; ^ 462 (define-key map "^" 'tpu-add-at-bol) ; ^
463 (define-key map "_" 'split-window-vertically) ; - 463 (define-key map "_" 'split-window-vertically) ; -
464 (define-key map "`" 'what-line) ; ` 464 (define-key map "`" 'what-line) ; `
465 (define-key map "a" 'tpu-toggle-newline-and-indent) ; a 465 (define-key map "a" 'tpu-toggle-newline-and-indent) ; a
466 (define-key map "b" 'tpu-next-buffer) ; b 466 (define-key map "b" 'tpu-next-buffer) ; b
467 (define-key map "c" 'repeat-complex-command) ; c 467 (define-key map "c" 'repeat-complex-command) ; c
468 (define-key map "d" 'shell-command) ; d 468 (define-key map "d" 'shell-command) ; d
469 (define-key map "e" 'tpu-exit) ; e 469 (define-key map "e" 'tpu-exit) ; e
470 (define-key map "f" 'tpu-set-cursor-free) ; f 470 (define-key map "f" 'tpu-cursor-free-mode) ; f
471 (define-key map "g" 'tpu-get) ; g 471 (define-key map "g" 'tpu-get) ; g
472 (define-key map "h" 'nil) ; h 472 ;; (define-key map "h" nil) ; h
473 (define-key map "i" 'tpu-include) ; i 473 (define-key map "i" 'tpu-include) ; i
474 (define-key map "k" 'tpu-kill-buffer) ; k 474 (define-key map "k" 'tpu-kill-buffer) ; k
475 (define-key map "l" 'goto-line) ; l 475 (define-key map "l" 'goto-line) ; l
476 (define-key map "m" 'buffer-menu) ; m 476 (define-key map "m" 'buffer-menu) ; m
477 (define-key map "n" 'tpu-next-file-buffer) ; n 477 (define-key map "n" 'tpu-next-file-buffer) ; n
478 (define-key map "o" 'occur) ; o 478 (define-key map "o" 'occur) ; o
479 (define-key map "p" 'lpr-region) ; p 479 (define-key map "p" 'lpr-region) ; p
480 (define-key map "q" 'tpu-quit) ; q 480 (define-key map "q" 'tpu-quit) ; q
481 (define-key map "r" 'tpu-toggle-rectangle) ; r 481 (define-key map "r" 'tpu-toggle-rectangle) ; r
482 (define-key map "s" 'replace) ; s 482 (define-key map "s" 'replace) ; s
483 (define-key map "t" 'tpu-line-to-top-of-window) ; t 483 (define-key map "t" 'tpu-line-to-top-of-window) ; t
484 (define-key map "u" 'undo) ; u 484 (define-key map "u" 'undo) ; u
485 (define-key map "v" 'tpu-version) ; v 485 (define-key map "v" 'tpu-version) ; v
486 (define-key map "w" 'save-buffer) ; w 486 (define-key map "w" 'save-buffer) ; w
487 (define-key map "x" 'tpu-save-all-buffers-kill-emacs) ; x 487 (define-key map "x" 'tpu-save-all-buffers-kill-emacs) ; x
488 (define-key map "y" 'copy-region-as-kill) ; y 488 (define-key map "y" 'copy-region-as-kill) ; y
489 (define-key map "z" 'suspend-emacs) ; z 489 (define-key map "z" 'suspend-emacs) ; z
490 (define-key map "{" 'nil) ; { 490 ;; (define-key map "{" nil) ; {
491 (define-key map "|" 'split-window-horizontally) ; | 491 (define-key map "|" 'split-window-horizontally) ; |
492 (define-key map "}" 'nil) ; } 492 ;; (define-key map "}" nil) ; }
493 (define-key map "~" 'exchange-point-and-mark) ; ~ 493 (define-key map "~" 'exchange-point-and-mark) ; ~
494 (define-key map "\177" 'delete-window) ; <X] 494 (define-key map "\177" 'delete-window) ; <X]
495 map) 495 map)
496 "Maps the function keys on the VT100 keyboard preceded by PF1. 496 "Maps the function keys on the VT100 keyboard preceded by PF1.
497GOLD is the ASCII 7-bit escape sequence <ESC>OP.") 497GOLD is the ASCII 7-bit escape sequence <ESC>OP.")
@@ -502,61 +502,61 @@ GOLD is the ASCII 7-bit escape sequence <ESC>OP.")
502 502
503 ;; Previously defined in CSI-map. We now presume that term/*.el does 503 ;; Previously defined in CSI-map. We now presume that term/*.el does
504 ;; its job to map the escape sequence to the right key-symbol. 504 ;; its job to map the escape sequence to the right key-symbol.
505 (define-key map [find] 'tpu-search) ; Find 505 (define-key map [find] 'tpu-search) ; Find
506 (define-key map [insert] 'tpu-paste) ; Insert Here 506 (define-key map [insert] 'tpu-paste) ; Insert Here
507 (define-key map [delete] 'tpu-cut) ; Remove 507 (define-key map [delete] 'tpu-cut) ; Remove
508 (define-key map [select] 'tpu-select) ; Select 508 (define-key map [select] 'tpu-select) ; Select
509 (define-key map [prior] 'tpu-scroll-window-down) ; Prev Screen 509 (define-key map [prior] 'tpu-scroll-window-down) ; Prev Screen
510 (define-key map [next] 'tpu-scroll-window-up) ; Next Screen 510 (define-key map [next] 'tpu-scroll-window-up) ; Next Screen
511 511
512 (define-key map [f1] 'nil) ; F1 512 ;; (define-key map [f1] nil) ; F1
513 (define-key map [f2] 'nil) ; F2 513 ;; (define-key map [f2] nil) ; F2
514 (define-key map [f3] 'nil) ; F3 514 ;; (define-key map [f3] nil) ; F3
515 (define-key map [f4] 'nil) ; F4 515 ;; (define-key map [f4] nil) ; F4
516 (define-key map [f5] 'nil) ; F5 516 ;; (define-key map [f5] nil) ; F5
517 (define-key map [f6] 'nil) ; F6 517 ;; (define-key map [f6] nil) ; F6
518 (define-key map [f7] 'nil) ; F7 518 ;; (define-key map [f7] nil) ; F7
519 (define-key map [f8] 'nil) ; F8 519 ;; (define-key map [f8] nil) ; F8
520 (define-key map [f9] 'nil) ; F9 520 ;; (define-key map [f9] nil) ; F9
521 (define-key map [f10] 'tpu-exit) ; F10 521 (define-key map [f10] 'tpu-exit) ; F10
522 (define-key map [f11] 'tpu-insert-escape) ; F11 (ESC) 522 (define-key map [f11] 'tpu-insert-escape) ; F11 (ESC)
523 (define-key map [f12] 'tpu-next-beginning-of-line) ; F12 (BS) 523 (define-key map [f12] 'tpu-next-beginning-of-line) ; F12 (BS)
524 (define-key map [f13] 'tpu-delete-previous-word) ; F13 (LF) 524 (define-key map [f13] 'tpu-delete-previous-word) ; F13 (LF)
525 (define-key map [f14] 'tpu-toggle-overwrite-mode) ; F14 525 (define-key map [f14] 'tpu-toggle-overwrite-mode) ; F14
526 (define-key map [help] 'tpu-help) ; HELP 526 (define-key map [help] 'tpu-help) ; HELP
527 (define-key map [menu] 'execute-extended-command) ; DO 527 (define-key map [menu] 'execute-extended-command) ; DO
528 (define-key map [f17] 'tpu-goto-breadcrumb) ; F17 528 (define-key map [f17] 'tpu-goto-breadcrumb) ; F17
529 (define-key map [f18] 'nil) ; F18 529 ;; (define-key map [f18] nil) ; F18
530 (define-key map [f19] 'nil) ; F19 530 ;; (define-key map [f19] nil) ; F19
531 (define-key map [f20] 'nil) ; F20 531 ;; (define-key map [f20] nil) ; F20
532 532
533 533
534 ;; Previously defined in SS3-map. We now presume that term/*.el does 534 ;; Previously defined in SS3-map. We now presume that term/*.el does
535 ;; its job to map the escape sequence to the right key-symbol. 535 ;; its job to map the escape sequence to the right key-symbol.
536 (define-key map [kp-f1] tpu-gold-map) ; GOLD map 536 (define-key map [kp-f1] tpu-gold-map) ; GOLD map
537 ;; 537 ;;
538 (define-key map [up] 'tpu-previous-line) ; up 538 (define-key map [up] 'tpu-previous-line) ; up
539 (define-key map [down] 'tpu-next-line) ; down 539 (define-key map [down] 'tpu-next-line) ; down
540 (define-key map [right] 'tpu-forward-char) ; right 540 (define-key map [right] 'tpu-forward-char) ; right
541 (define-key map [left] 'tpu-backward-char) ; left 541 (define-key map [left] 'tpu-backward-char) ; left
542 542
543 (define-key map [kp-f2] 'tpu-help) ; PF2 543 (define-key map [kp-f2] 'tpu-help) ; PF2
544 (define-key map [kp-f3] 'tpu-search-again) ; PF3 544 (define-key map [kp-f3] 'tpu-search-again) ; PF3
545 (define-key map [kp-f4] 'tpu-delete-current-line) ; PF4 545 (define-key map [kp-f4] 'tpu-delete-current-line) ; PF4
546 (define-key map [kp-0] 'tpu-line) ; KP0 546 (define-key map [kp-0] 'tpu-line) ; KP0
547 (define-key map [kp-1] 'tpu-word) ; KP1 547 (define-key map [kp-1] 'tpu-word) ; KP1
548 (define-key map [kp-2] 'tpu-end-of-line) ; KP2 548 (define-key map [kp-2] 'tpu-end-of-line) ; KP2
549 (define-key map [kp-3] 'tpu-char) ; KP3 549 (define-key map [kp-3] 'tpu-char) ; KP3
550 (define-key map [kp-4] 'tpu-advance-direction) ; KP4 550 (define-key map [kp-4] 'tpu-advance-direction) ; KP4
551 (define-key map [kp-5] 'tpu-backup-direction) ; KP5 551 (define-key map [kp-5] 'tpu-backup-direction) ; KP5
552 (define-key map [kp-6] 'tpu-cut) ; KP6 552 (define-key map [kp-6] 'tpu-cut) ; KP6
553 (define-key map [kp-7] 'tpu-page) ; KP7 553 (define-key map [kp-7] 'tpu-page) ; KP7
554 (define-key map [kp-8] 'tpu-scroll-window) ; KP8 554 (define-key map [kp-8] 'tpu-scroll-window) ; KP8
555 (define-key map [kp-9] 'tpu-append-region) ; KP9 555 (define-key map [kp-9] 'tpu-append-region) ; KP9
556 (define-key map [kp-subtract] 'tpu-delete-current-word) ; KP- 556 (define-key map [kp-subtract] 'tpu-delete-current-word) ; KP-
557 (define-key map [kp-separator] 'tpu-delete-current-char) ; KP, 557 (define-key map [kp-separator] 'tpu-delete-current-char) ; KP,
558 (define-key map [kp-decimal] 'tpu-select) ; KP. 558 (define-key map [kp-decimal] 'tpu-select) ; KP.
559 (define-key map [kp-enter] 'newline) ; KPenter 559 (define-key map [kp-enter] 'newline) ; KPenter
560 560
561 map) 561 map)
562 "TPU-edt global keymap.") 562 "TPU-edt global keymap.")
@@ -2225,8 +2225,8 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll."
2225;;; 2225;;;
2226;;; Minibuffer map additions to set search direction 2226;;; Minibuffer map additions to set search direction
2227;;; 2227;;;
2228(define-key minibuffer-local-map "\eOt" 'tpu-search-forward-exit) ;KP4 2228(define-key minibuffer-local-map [kp-4] 'tpu-search-forward-exit) ;KP4
2229(define-key minibuffer-local-map "\eOu" 'tpu-search-backward-exit) ;KP5 2229(define-key minibuffer-local-map [kp-5] 'tpu-search-backward-exit) ;KP5
2230 2230
2231 2231
2232;;; 2232;;;
@@ -2428,6 +2428,33 @@ If FILE is nil, try to load a default file. The default file names are
2428 (ad-disable-regexp "\\`tpu-") 2428 (ad-disable-regexp "\\`tpu-")
2429 (setq tpu-edt-mode nil)) 2429 (setq tpu-edt-mode nil))
2430 2430
2431
2432;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins
2433;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "e0629234f1abe076917a303456b48329")
2434;;; Generated autoloads from tpu-extras.el
2435
2436(autoload 'tpu-cursor-free-mode "tpu-extras" "\
2437Minor mode to allow the cursor to move freely about the screen.
2438
2439\(fn &optional ARG)" t nil)
2440
2441(autoload 'tpu-set-scroll-margins "tpu-extras" "\
2442Set scroll margins.
2443
2444\(fn TOP BOTTOM)" t nil)
2445
2446(autoload 'tpu-set-cursor-free "tpu-extras" "\
2447Allow the cursor to move freely about the screen.
2448
2449\(fn)" t nil)
2450
2451(autoload 'tpu-set-cursor-bound "tpu-extras" "\
2452Constrain the cursor to the flow of the text.
2453
2454\(fn)" t nil)
2455
2456;;;***
2457
2431(provide 'tpu-edt) 2458(provide 'tpu-edt)
2432 2459
2433;; arch-tag: f3dfe61c-2cbd-4f73-b9cc-eb215020b857 2460;; arch-tag: f3dfe61c-2cbd-4f73-b9cc-eb215020b857
diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el
index 609ce2e203b..062082a295a 100644
--- a/lisp/emulation/tpu-extras.el
+++ b/lisp/emulation/tpu-extras.el
@@ -112,18 +112,18 @@
112;;; Customization variables 112;;; Customization variables
113 113
114(defcustom tpu-top-scroll-margin 0 114(defcustom tpu-top-scroll-margin 0
115 "*Scroll margin at the top of the screen. 115 "Scroll margin at the top of the screen.
116Interpreted as a percent of the current window size." 116Interpreted as a percent of the current window size."
117 :type 'integer 117 :type 'integer
118 :group 'tpu) 118 :group 'tpu)
119(defcustom tpu-bottom-scroll-margin 0 119(defcustom tpu-bottom-scroll-margin 0
120 "*Scroll margin at the bottom of the screen. 120 "Scroll margin at the bottom of the screen.
121Interpreted as a percent of the current window size." 121Interpreted as a percent of the current window size."
122 :type 'integer 122 :type 'integer
123 :group 'tpu) 123 :group 'tpu)
124 124
125(defcustom tpu-backward-char-like-tpu t 125(defcustom tpu-backward-char-like-tpu t
126 "*If non-nil, in free cursor mode backward-char (left-arrow) works 126 "If non-nil, in free cursor mode backward-char (left-arrow) works
127just like TPU/edt. Otherwise, backward-char will move to the end of 127just like TPU/edt. Otherwise, backward-char will move to the end of
128the previous line when starting from a line beginning." 128the previous line when starting from a line beginning."
129 :type 'boolean 129 :type 'boolean
@@ -132,8 +132,12 @@ the previous line when starting from a line beginning."
132 132
133;;; Global variables 133;;; Global variables
134 134
135(defvar tpu-cursor-free nil 135;;;###autoload
136 "If non-nil, let the cursor roam free.") 136(define-minor-mode tpu-cursor-free-mode
137 "Minor mode to allow the cursor to move freely about the screen."
138 :init-value nil
139 (if (not tpu-cursor-free-mode)
140 (tpu-trim-line-ends)))
137 141
138 142
139;;; Hooks -- Set cursor free in picture mode. 143;;; Hooks -- Set cursor free in picture mode.
@@ -141,11 +145,10 @@ the previous line when starting from a line beginning."
141 145
142(add-hook 'picture-mode-hook 'tpu-set-cursor-free) 146(add-hook 'picture-mode-hook 'tpu-set-cursor-free)
143 147
144(defun tpu-before-save-hook () 148(defun tpu-trim-line-ends-if-needed ()
145 "Eliminate whitespace at ends of lines, if the cursor is free." 149 "Eliminate whitespace at ends of lines, if the cursor is free."
146 (if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends))) 150 (if (and (buffer-modified-p) tpu-cursor-free-mode) (tpu-trim-line-ends)))
147 151(add-hook 'before-save-hook 'tpu-trim-line-ends-if-needed)
148(add-hook 'before-save-hook 'tpu-before-save-hook)
149 152
150 153
151;;; Utility routines for implementing scroll margins 154;;; Utility routines for implementing scroll margins
@@ -171,12 +174,12 @@ the previous line when starting from a line beginning."
171(defun tpu-forward-char (num) 174(defun tpu-forward-char (num)
172 "Move right ARG characters (left if ARG is negative)." 175 "Move right ARG characters (left if ARG is negative)."
173 (interactive "p") 176 (interactive "p")
174 (if tpu-cursor-free (picture-forward-column num) (forward-char num))) 177 (if tpu-cursor-free-mode (picture-forward-column num) (forward-char num)))
175 178
176(defun tpu-backward-char (num) 179(defun tpu-backward-char (num)
177 "Move left ARG characters (right if ARG is negative)." 180 "Move left ARG characters (right if ARG is negative)."
178 (interactive "p") 181 (interactive "p")
179 (cond ((not tpu-cursor-free) 182 (cond ((not tpu-cursor-free-mode)
180 (backward-char num)) 183 (backward-char num))
181 (tpu-backward-char-like-tpu 184 (tpu-backward-char-like-tpu
182 (picture-backward-column num)) 185 (picture-backward-column num))
@@ -195,8 +198,8 @@ the previous line when starting from a line beginning."
195Prefix argument serves as a repeat count." 198Prefix argument serves as a repeat count."
196 (interactive "p") 199 (interactive "p")
197 (let ((beg (tpu-current-line))) 200 (let ((beg (tpu-current-line)))
198 (if tpu-cursor-free (or (eobp) (picture-move-down num)) 201 (if tpu-cursor-free-mode (or (eobp) (picture-move-down num))
199 (next-line-internal num)) 202 (line-move num))
200 (tpu-bottom-check beg num) 203 (tpu-bottom-check beg num)
201 (setq this-command 'next-line))) 204 (setq this-command 'next-line)))
202 205
@@ -205,7 +208,7 @@ Prefix argument serves as a repeat count."
205Prefix argument serves as a repeat count." 208Prefix argument serves as a repeat count."
206 (interactive "p") 209 (interactive "p")
207 (let ((beg (tpu-current-line))) 210 (let ((beg (tpu-current-line)))
208 (if tpu-cursor-free (picture-move-up num) (next-line-internal (- num))) 211 (if tpu-cursor-free-mode (picture-move-up num) (line-move (- num)))
209 (tpu-top-check beg num) 212 (tpu-top-check beg num)
210 (setq this-command 'previous-line))) 213 (setq this-command 'previous-line)))
211 214
@@ -223,7 +226,7 @@ Accepts a prefix argument for the number of lines to move."
223Accepts a prefix argument for the number of lines to move." 226Accepts a prefix argument for the number of lines to move."
224 (interactive "p") 227 (interactive "p")
225 (let ((beg (tpu-current-line))) 228 (let ((beg (tpu-current-line)))
226 (cond (tpu-cursor-free 229 (cond (tpu-cursor-free-mode
227 (let ((beg (point))) 230 (let ((beg (point)))
228 (if (< 1 num) (forward-line num)) 231 (if (< 1 num) (forward-line num))
229 (picture-end-of-line) 232 (picture-end-of-line)
@@ -238,7 +241,7 @@ Accepts a prefix argument for the number of lines to move."
238Accepts a prefix argument for the number of lines to move." 241Accepts a prefix argument for the number of lines to move."
239 (interactive "p") 242 (interactive "p")
240 (let ((beg (tpu-current-line))) 243 (let ((beg (tpu-current-line)))
241 (cond (tpu-cursor-free 244 (cond (tpu-cursor-free-mode
242 (picture-end-of-line (- 1 num))) 245 (picture-end-of-line (- 1 num)))
243 (t 246 (t
244 (end-of-line (- 1 num)))) 247 (end-of-line (- 1 num))))
@@ -248,7 +251,7 @@ Accepts a prefix argument for the number of lines to move."
248 "Move point to end of current line." 251 "Move point to end of current line."
249 (interactive) 252 (interactive)
250 (let ((beg (point))) 253 (let ((beg (point)))
251 (if tpu-cursor-free (picture-end-of-line) (end-of-line)) 254 (if tpu-cursor-free-mode (picture-end-of-line) (end-of-line))
252 (if (= beg (point)) (message "You are already at the end of a line.")))) 255 (if (= beg (point)) (message "You are already at the end of a line."))))
253 256
254(defun tpu-forward-line (num) 257(defun tpu-forward-line (num)
@@ -256,9 +259,8 @@ Accepts a prefix argument for the number of lines to move."
256Prefix argument serves as a repeat count." 259Prefix argument serves as a repeat count."
257 (interactive "p") 260 (interactive "p")
258 (let ((beg (tpu-current-line))) 261 (let ((beg (tpu-current-line)))
259 (next-line-internal num) 262 (forward-line num)
260 (tpu-bottom-check beg num) 263 (tpu-bottom-check beg num)))
261 (beginning-of-line)))
262 264
263(defun tpu-backward-line (num) 265(defun tpu-backward-line (num)
264 "Move to beginning of previous line. 266 "Move to beginning of previous line.
@@ -266,9 +268,8 @@ Prefix argument serves as repeat count."
266 (interactive "p") 268 (interactive "p")
267 (let ((beg (tpu-current-line))) 269 (let ((beg (tpu-current-line)))
268 (or (bolp) (>= 0 num) (setq num (- num 1))) 270 (or (bolp) (>= 0 num) (setq num (- num 1)))
269 (next-line-internal (- num)) 271 (forward-line (- num))
270 (tpu-top-check beg num) 272 (tpu-top-check beg num)))
271 (beginning-of-line)))
272 273
273 274
274;;; Movement by paragraph 275;;; Movement by paragraph
@@ -346,7 +347,7 @@ A repeat count means scroll that many sections."
346 (let* ((beg (tpu-current-line)) 347 (let* ((beg (tpu-current-line))
347 (height (1- (window-height))) 348 (height (1- (window-height)))
348 (lines (* num (/ (* height tpu-percent-scroll) 100)))) 349 (lines (* num (/ (* height tpu-percent-scroll) 100))))
349 (next-line-internal (- lines)) 350 (line-move (- lines))
350 (tpu-top-check beg lines))) 351 (tpu-top-check beg lines)))
351 352
352(defun tpu-scroll-window-up (num) 353(defun tpu-scroll-window-up (num)
@@ -356,7 +357,7 @@ A repeat count means scroll that many sections."
356 (let* ((beg (tpu-current-line)) 357 (let* ((beg (tpu-current-line))
357 (height (1- (window-height))) 358 (height (1- (window-height)))
358 (lines (* num (/ (* height tpu-percent-scroll) 100)))) 359 (lines (* num (/ (* height tpu-percent-scroll) 100))))
359 (next-line-internal lines) 360 (line-move lines)
360 (tpu-bottom-check beg lines))) 361 (tpu-bottom-check beg lines)))
361 362
362 363
@@ -448,22 +449,19 @@ A repeat count means scroll that many sections."
448(defun tpu-set-cursor-free () 449(defun tpu-set-cursor-free ()
449 "Allow the cursor to move freely about the screen." 450 "Allow the cursor to move freely about the screen."
450 (interactive) 451 (interactive)
451 (setq tpu-cursor-free t) 452 (tpu-cursor-free-mode 1)
452 (substitute-key-definition 'tpu-set-cursor-free
453 'tpu-set-cursor-bound
454 GOLD-map)
455 (message "The cursor will now move freely about the screen.")) 453 (message "The cursor will now move freely about the screen."))
456 454
457;;;###autoload 455;;;###autoload
458(defun tpu-set-cursor-bound () 456(defun tpu-set-cursor-bound ()
459 "Constrain the cursor to the flow of the text." 457 "Constrain the cursor to the flow of the text."
460 (interactive) 458 (interactive)
461 (tpu-trim-line-ends) 459 (tpu-cursor-free-mode -1)
462 (setq tpu-cursor-free nil)
463 (substitute-key-definition 'tpu-set-cursor-bound
464 'tpu-set-cursor-free
465 GOLD-map)
466 (message "The cursor is now bound to the flow of your text.")) 460 (message "The cursor is now bound to the flow of your text."))
467 461
462;; Local Variables:
463;; generated-autoload-file: "tpu-edt.el"
464;; End:
465
468;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a 466;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a
469;;; tpu-extras.el ends here 467;;; tpu-extras.el ends here
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 8dd22e9ea1f..82dc312cf28 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -1116,7 +1116,7 @@ as a Meta key and any number of multiple escapes is allowed."
1116 "Function that implements ESC key in Viper emulation of Vi." 1116 "Function that implements ESC key in Viper emulation of Vi."
1117 (interactive) 1117 (interactive)
1118 (let ((cmd (or (key-binding (viper-envelop-ESC-key)) 1118 (let ((cmd (or (key-binding (viper-envelop-ESC-key))
1119 '(lambda () (interactive) (error ""))))) 1119 '(lambda () (interactive) (error "Viper bell")))))
1120 1120
1121 ;; call the actual function to execute ESC (if no other symbols followed) 1121 ;; call the actual function to execute ESC (if no other symbols followed)
1122 ;; or the key bound to the ESC sequence (if the sequence was issued 1122 ;; or the key bound to the ESC sequence (if the sequence was issued
@@ -1238,7 +1238,7 @@ as a Meta key and any number of multiple escapes is allowed."
1238 ;; it is an error. 1238 ;; it is an error.
1239 (progn 1239 (progn
1240 ;; new com is (CHAR . OLDCOM) 1240 ;; new com is (CHAR . OLDCOM)
1241 (if (viper-memq-char char '(?# ?\")) (error "")) 1241 (if (viper-memq-char char '(?# ?\")) (error "Viper bell"))
1242 (setq com (cons char com)) 1242 (setq com (cons char com))
1243 (setq cont nil)) 1243 (setq cont nil))
1244 ;; If com is nil we set com as char, and read more. Again, if char is 1244 ;; If com is nil we set com as char, and read more. Again, if char is
@@ -1257,7 +1257,7 @@ as a Meta key and any number of multiple escapes is allowed."
1257 (let ((reg (read-char))) 1257 (let ((reg (read-char)))
1258 (if (viper-valid-register reg) 1258 (if (viper-valid-register reg)
1259 (setq viper-use-register reg) 1259 (setq viper-use-register reg)
1260 (error "")) 1260 (error "Viper bell"))
1261 (setq char (read-char)))) 1261 (setq char (read-char))))
1262 (t 1262 (t
1263 (setq com char) 1263 (setq com char)
@@ -1279,7 +1279,7 @@ as a Meta key and any number of multiple escapes is allowed."
1279 (viper-regsuffix-command-p char) 1279 (viper-regsuffix-command-p char)
1280 (viper= char ?!) ; bang command 1280 (viper= char ?!) ; bang command
1281 (viper= char ?g) ; the gg command (like G0) 1281 (viper= char ?g) ; the gg command (like G0)
1282 (error "")) 1282 (error "Viper bell"))
1283 (setq cmd-to-exec-at-end 1283 (setq cmd-to-exec-at-end
1284 (viper-exec-form-in-vi 1284 (viper-exec-form-in-vi
1285 `(key-binding (char-to-string ,char))))) 1285 `(key-binding (char-to-string ,char)))))
@@ -1313,7 +1313,7 @@ as a Meta key and any number of multiple escapes is allowed."
1313 ((equal com '(?= . ?=)) (viper-line (cons value ?=))) 1313 ((equal com '(?= . ?=)) (viper-line (cons value ?=)))
1314 ;; gg acts as G0 1314 ;; gg acts as G0
1315 ((equal (car com) ?g) (viper-goto-line 0)) 1315 ((equal (car com) ?g) (viper-goto-line 0))
1316 (t (error ""))))) 1316 (t (error "Viper bell")))))
1317 1317
1318 (if cmd-to-exec-at-end 1318 (if cmd-to-exec-at-end
1319 (progn 1319 (progn
@@ -2738,9 +2738,9 @@ On reaching end of line, stop and signal error."
2738 ;; the forward motion before the 'viper-execute-com', but, of 2738 ;; the forward motion before the 'viper-execute-com', but, of
2739 ;; course, 'dl' doesn't work on an empty line, so we have to 2739 ;; course, 'dl' doesn't work on an empty line, so we have to
2740 ;; catch that condition before 'viper-execute-com' 2740 ;; catch that condition before 'viper-execute-com'
2741 (if (and (eolp) (bolp)) (error "") (forward-char val)) 2741 (if (and (eolp) (bolp)) (error "Viper bell") (forward-char val))
2742 (if com (viper-execute-com 'viper-forward-char val com)) 2742 (if com (viper-execute-com 'viper-forward-char val com))
2743 (if (eolp) (progn (backward-char 1) (error "")))) 2743 (if (eolp) (progn (backward-char 1) (error "Viper bell"))))
2744 (forward-char val) 2744 (forward-char val)
2745 (if com (viper-execute-com 'viper-forward-char val com))))) 2745 (if com (viper-execute-com 'viper-forward-char val com)))))
2746 2746
@@ -2755,7 +2755,7 @@ On reaching beginning of line, stop and signal error."
2755 (if com (viper-move-marker-locally 'viper-com-point (point))) 2755 (if com (viper-move-marker-locally 'viper-com-point (point)))
2756 (if viper-ex-style-motion 2756 (if viper-ex-style-motion
2757 (progn 2757 (progn
2758 (if (bolp) (error "") (backward-char val)) 2758 (if (bolp) (error "Viper bell") (backward-char val))
2759 (if com (viper-execute-com 'viper-backward-char val com))) 2759 (if com (viper-execute-com 'viper-backward-char val com)))
2760 (backward-char val) 2760 (backward-char val)
2761 (if com (viper-execute-com 'viper-backward-char val com))))) 2761 (if com (viper-execute-com 'viper-backward-char val com)))))
@@ -3078,7 +3078,7 @@ On reaching beginning of line, stop and signal error."
3078 (if com (viper-execute-com 'viper-goto-col val com)) 3078 (if com (viper-execute-com 'viper-goto-col val com))
3079 (save-excursion 3079 (save-excursion
3080 (end-of-line) 3080 (end-of-line)
3081 (if (> val (current-column)) (error ""))) 3081 (if (> val (current-column)) (error "Viper bell")))
3082 )) 3082 ))
3083 3083
3084 3084
@@ -3198,7 +3198,7 @@ If point is on a widget or a button, simulate clicking on that widget/button."
3198;; If FORWARD then search is forward, otherwise backward. OFFSET is used to 3198;; If FORWARD then search is forward, otherwise backward. OFFSET is used to
3199;; adjust point after search. 3199;; adjust point after search.
3200(defun viper-find-char (arg char forward offset) 3200(defun viper-find-char (arg char forward offset)
3201 (or (char-or-string-p char) (error "")) 3201 (or (char-or-string-p char) (error "Viper bell"))
3202 (let ((arg (if forward arg (- arg))) 3202 (let ((arg (if forward arg (- arg)))
3203 (cmd (if (eq viper-intermediate-command 'viper-repeat) 3203 (cmd (if (eq viper-intermediate-command 'viper-repeat)
3204 (nth 5 viper-d-com) 3204 (nth 5 viper-d-com)
@@ -3544,7 +3544,7 @@ controlled by the sign of prefix numeric value."
3544 (if com (viper-move-marker-locally 'viper-com-point (point))) 3544 (if com (viper-move-marker-locally 'viper-com-point (point)))
3545 (backward-sexp 1) 3545 (backward-sexp 1)
3546 (if com (viper-execute-com 'viper-paren-match nil com))) 3546 (if com (viper-execute-com 'viper-paren-match nil com)))
3547 (t (error "")))))) 3547 (t (error "Viper bell"))))))
3548 3548
3549(defun viper-toggle-parse-sexp-ignore-comments () 3549(defun viper-toggle-parse-sexp-ignore-comments ()
3550 (interactive) 3550 (interactive)
@@ -4107,7 +4107,7 @@ Null string will repeat previous search."
4107 (let ((reg viper-use-register)) 4107 (let ((reg viper-use-register))
4108 (setq viper-use-register nil) 4108 (setq viper-use-register nil)
4109 (error viper-EmptyRegister reg)) 4109 (error viper-EmptyRegister reg))
4110 (error ""))) 4110 (error "Viper bell")))
4111 (setq viper-use-register nil) 4111 (setq viper-use-register nil)
4112 (if (viper-end-with-a-newline-p text) 4112 (if (viper-end-with-a-newline-p text)
4113 (progn 4113 (progn
@@ -4157,7 +4157,7 @@ Null string will repeat previous search."
4157 (let ((reg viper-use-register)) 4157 (let ((reg viper-use-register))
4158 (setq viper-use-register nil) 4158 (setq viper-use-register nil)
4159 (error viper-EmptyRegister reg)) 4159 (error viper-EmptyRegister reg))
4160 (error ""))) 4160 (error "Viper bell")))
4161 (setq viper-use-register nil) 4161 (setq viper-use-register nil)
4162 (if (viper-end-with-a-newline-p text) (beginning-of-line)) 4162 (if (viper-end-with-a-newline-p text) (beginning-of-line))
4163 (viper-set-destructive-command 4163 (viper-set-destructive-command
@@ -4202,7 +4202,7 @@ Null string will repeat previous search."
4202 (> val (viper-chars-in-region (point) (viper-line-pos 'end)))) 4202 (> val (viper-chars-in-region (point) (viper-line-pos 'end))))
4203 (setq val (viper-chars-in-region (point) (viper-line-pos 'end)))) 4203 (setq val (viper-chars-in-region (point) (viper-line-pos 'end))))
4204 (if (and viper-ex-style-motion (eolp)) 4204 (if (and viper-ex-style-motion (eolp))
4205 (if (bolp) (error "") (setq val 0))) ; not bol---simply back 1 ch 4205 (if (bolp) (error "Viper bell") (setq val 0))) ; not bol---simply back 1 ch
4206 (save-excursion 4206 (save-excursion
4207 (viper-forward-char-carefully val) 4207 (viper-forward-char-carefully val)
4208 (setq end-del-pos (point))) 4208 (setq end-del-pos (point)))
@@ -4467,7 +4467,7 @@ and regexp replace."
4467 ((viper= char ?,) (viper-cycle-through-mark-ring)) 4467 ((viper= char ?,) (viper-cycle-through-mark-ring))
4468 ((viper= char ?^) (push-mark viper-saved-mark t t)) 4468 ((viper= char ?^) (push-mark viper-saved-mark t t))
4469 ((viper= char ?D) (mark-defun)) 4469 ((viper= char ?D) (mark-defun))
4470 (t (error "")) 4470 (t (error "Viper bell"))
4471 ))) 4471 )))
4472 4472
4473;; Algorithm: If first invocation of this command save mark on ring, goto 4473;; Algorithm: If first invocation of this command save mark on ring, goto
@@ -4566,7 +4566,7 @@ One can use `` and '' to temporarily jump 1 step back."
4566 (switch-to-buffer buff) 4566 (switch-to-buffer buff)
4567 (goto-char viper-com-point) 4567 (goto-char viper-com-point)
4568 (viper-change-state-to-vi) 4568 (viper-change-state-to-vi)
4569 (error ""))))) 4569 (error "Viper bell")))))
4570 ((and (not skip-white) (viper= char ?`)) 4570 ((and (not skip-white) (viper= char ?`))
4571 (if com (viper-move-marker-locally 'viper-com-point (point))) 4571 (if com (viper-move-marker-locally 'viper-com-point (point)))
4572 (if (and (viper-same-line (point) viper-last-jump) 4572 (if (and (viper-same-line (point) viper-last-jump)
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index fda882ae6a2..627d2ff1814 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -1236,7 +1236,7 @@ reversed."
1236 (read-string "[Hit return to confirm] ") 1236 (read-string "[Hit return to confirm] ")
1237 (quit 1237 (quit
1238 (save-excursion (kill-buffer " *delete text*")) 1238 (save-excursion (kill-buffer " *delete text*"))
1239 (error ""))) 1239 (error "Viper bell")))
1240 (save-excursion (kill-buffer " *delete text*"))) 1240 (save-excursion (kill-buffer " *delete text*")))
1241 (if ex-buffer 1241 (if ex-buffer
1242 (cond ((viper-valid-register ex-buffer '(Letter)) 1242 (cond ((viper-valid-register ex-buffer '(Letter))
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 63cafb4a734..ff3217ac144 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.14 of June 14, 2007" 12(defconst viper-version "3.14 of August 18, 2007"
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.
@@ -646,6 +646,11 @@ This startup message appears whenever you load Viper, unless you type `y' now."
646 (remove-hook symbol 'viper-change-state-to-emacs) 646 (remove-hook symbol 'viper-change-state-to-emacs)
647 (remove-hook symbol 'viper-change-state-to-insert) 647 (remove-hook symbol 'viper-change-state-to-insert)
648 (remove-hook symbol 'viper-change-state-to-vi) 648 (remove-hook symbol 'viper-change-state-to-vi)
649 (remove-hook symbol 'viper-minibuffer-post-command-hook)
650 (remove-hook symbol 'viper-minibuffer-setup-sentinel)
651 (remove-hook symbol 'viper-major-mode-change-sentinel)
652 (remove-hook symbol 'set-viper-state-in-major-mode)
653 (remove-hook symbol 'viper-post-command-sentinel)
649 ))) 654 )))
650 655
651;; Remove local value in all existing buffers 656;; Remove local value in all existing buffers
@@ -682,6 +687,9 @@ It also can't undo some Viper settings."
682 global-mode-string 687 global-mode-string
683 (delq 'viper-mode-string global-mode-string)) 688 (delq 'viper-mode-string global-mode-string))
684 689
690 (setq default-major-mode
691 (viper-standard-value 'default-major-mode viper-saved-non-viper-variables))
692
685 (if viper-emacs-p 693 (if viper-emacs-p
686 (setq-default 694 (setq-default
687 mark-even-if-inactive 695 mark-even-if-inactive
@@ -772,9 +780,7 @@ It also can't undo some Viper settings."
772 (mapatoms 'viper-remove-hooks) 780 (mapatoms 'viper-remove-hooks)
773 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook) 781 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook)
774 (remove-hook 'erc-mode-hook 'viper-comint-mode-hook) 782 (remove-hook 'erc-mode-hook 'viper-comint-mode-hook)
775 (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
776 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel) 783 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel)
777 (remove-hook 'post-command-hook 'viper-minibuffer-post-command-hook)
778 784
779 ;; unbind Viper mouse bindings 785 ;; unbind Viper mouse bindings
780 (viper-unbind-mouse-search-key) 786 (viper-unbind-mouse-search-key)
@@ -1214,6 +1220,7 @@ These two lines must come in the order given.
1214(if (null viper-saved-non-viper-variables) 1220(if (null viper-saved-non-viper-variables)
1215 (setq viper-saved-non-viper-variables 1221 (setq viper-saved-non-viper-variables
1216 (list 1222 (list
1223 (cons 'default-major-mode (list default-major-mode))
1217 (cons 'next-line-add-newlines (list next-line-add-newlines)) 1224 (cons 'next-line-add-newlines (list next-line-add-newlines))
1218 (cons 'require-final-newline (list require-final-newline)) 1225 (cons 'require-final-newline (list require-final-newline))
1219 (cons 'scroll-step (list scroll-step)) 1226 (cons 'scroll-step (list scroll-step))