diff options
| author | Miles Bader | 2007-06-16 22:33:42 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-06-16 22:33:42 +0000 |
| commit | 262d5ce7c21d6c1136fd2b8df67736e41e8e8953 (patch) | |
| tree | 853a5d30babd0abd585ccbe7f4e228bf43a42d5c /lisp/emulation | |
| parent | 5534694247d2b5259325ff43af0624aa2f8abb3e (diff) | |
| parent | af41f8a8d6660ad1fefad5bda69d1acb8e40b4d1 (diff) | |
| download | emacs-262d5ce7c21d6c1136fd2b8df67736e41e8e8953.tar.gz emacs-262d5ce7c21d6c1136fd2b8df67736e41e8e8953.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 793-802)
- Update from CVS
- Remove RCS keywords
- Merge from emacs--rel--22
* emacs--rel--22 (patch 42-50)
- Update from CVS
- Merge from gnus--rel--5.10
- Gnus ChangeLog tweaks
* gnus--rel--5.10 (patch 229-232)
- Merge from emacs--devo--0, emacs--rel--22
- ChangeLog tweak
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-23
Diffstat (limited to 'lisp/emulation')
| -rw-r--r-- | lisp/emulation/tpu-edt.el | 321 | ||||
| -rw-r--r-- | lisp/emulation/tpu-mapper.el | 6 | ||||
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 10 | ||||
| -rw-r--r-- | lisp/emulation/viper-init.el | 15 | ||||
| -rw-r--r-- | lisp/emulation/viper-keym.el | 4 | ||||
| -rw-r--r-- | lisp/emulation/viper-util.el | 6 | ||||
| -rw-r--r-- | lisp/emulation/viper.el | 104 |
7 files changed, 216 insertions, 250 deletions
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index 8d65a267c4e..68e1561ae4d 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el | |||
| @@ -207,16 +207,16 @@ | |||
| 207 | 207 | ||
| 208 | ;; ; The emacs universal-argument function is very useful. | 208 | ;; ; The emacs universal-argument function is very useful. |
| 209 | ;; ; This line maps universal-argument to Gold-PF1. | 209 | ;; ; This line maps universal-argument to Gold-PF1. |
| 210 | ;; (define-key GOLD-SS3-map "P" 'universal-argument) ; Gold-PF1 | 210 | ;; (define-key tpu-gold-map [kp_f1] 'universal-argument) ; Gold-PF1 |
| 211 | 211 | ||
| 212 | ;; ; Make KP7 move by paragraphs, instead of pages. | 212 | ;; ; Make KP7 move by paragraphs, instead of pages. |
| 213 | ;; (define-key SS3-map "w" 'tpu-paragraph) ; KP7 | 213 | ;; (define-key tpu-global-map [kf_7] 'tpu-paragraph) ; KP7 |
| 214 | 214 | ||
| 215 | ;; ; Repeat the preceding mappings for X-windows. | 215 | ;; ; Repeat the preceding mappings for X-windows. |
| 216 | ;; (cond | 216 | ;; (cond |
| 217 | ;; (window-system | 217 | ;; (window-system |
| 218 | ;; (global-set-key [kp_7] 'tpu-paragraph) ; KP7 | 218 | ;; (define-key tpu-global-map [kp_7] 'tpu-paragraph) ; KP7 |
| 219 | ;; (define-key GOLD-map [kp_f1] 'universal-argument))) ; GOLD-PF1 | 219 | ;; (define-key tpu-gold-map [kp_f1] 'universal-argument))) ; GOLD-PF1 |
| 220 | 220 | ||
| 221 | ;; ; Display the TPU-edt version. | 221 | ;; ; Display the TPU-edt version. |
| 222 | ;; (tpu-version) | 222 | ;; (tpu-version) |
| @@ -292,146 +292,88 @@ | |||
| 292 | ;;; User Configurable Variables | 292 | ;;; User Configurable Variables |
| 293 | ;;; | 293 | ;;; |
| 294 | (defcustom tpu-have-ispell t | 294 | (defcustom tpu-have-ispell t |
| 295 | "*If non-nil (default), TPU-edt uses ispell for spell checking." | 295 | "If non-nil (default), TPU-edt uses ispell for spell checking." |
| 296 | :type 'boolean | 296 | :type 'boolean |
| 297 | :group 'tpu) | 297 | :group 'tpu) |
| 298 | 298 | ||
| 299 | (defcustom tpu-kill-buffers-silently nil | 299 | (defcustom tpu-kill-buffers-silently nil |
| 300 | "*If non-nil, TPU-edt kills modified buffers without asking." | 300 | "If non-nil, TPU-edt kills modified buffers without asking." |
| 301 | :type 'boolean | 301 | :type 'boolean |
| 302 | :group 'tpu) | 302 | :group 'tpu) |
| 303 | 303 | ||
| 304 | (defcustom tpu-percent-scroll 75 | 304 | (defcustom tpu-percent-scroll 75 |
| 305 | "*Percentage of the screen to scroll for next/previous screen commands." | 305 | "Percentage of the screen to scroll for next/previous screen commands." |
| 306 | :type 'integer | 306 | :type 'integer |
| 307 | :group 'tpu) | 307 | :group 'tpu) |
| 308 | 308 | ||
| 309 | (defcustom tpu-pan-columns 16 | 309 | (defcustom tpu-pan-columns 16 |
| 310 | "*Number of columns the tpu-pan functions scroll left or right." | 310 | "Number of columns the tpu-pan functions scroll left or right." |
| 311 | :type 'integer | 311 | :type 'integer |
| 312 | :group 'tpu) | 312 | :group 'tpu) |
| 313 | 313 | ||
| 314 | 314 | ||
| 315 | ;;; | 315 | ;;; |
| 316 | ;;; Emacs version identifiers - currently referenced by | ||
| 317 | ;;; | ||
| 318 | ;;; o tpu-mark o tpu-set-mark | ||
| 319 | ;;; o mode line section o tpu-load-xkeys | ||
| 320 | ;;; | ||
| 321 | (defconst tpu-lucid-emacs-p | ||
| 322 | (string-match "Lucid" emacs-version) | ||
| 323 | "Non-nil if we are running Lucid Emacs.") | ||
| 324 | |||
| 325 | ;;; | ||
| 326 | ;;; Global Keymaps | 316 | ;;; Global Keymaps |
| 327 | ;;; | 317 | ;;; |
| 328 | (defvar CSI-map | ||
| 329 | (let ((map (make-sparse-keymap))) | ||
| 330 | (define-key map "A" 'tpu-previous-line) ; up | ||
| 331 | (define-key map "B" 'tpu-next-line) ; down | ||
| 332 | (define-key map "D" 'tpu-backward-char) ; left | ||
| 333 | (define-key map "C" 'tpu-forward-char) ; right | ||
| 334 | |||
| 335 | (define-key map "1~" 'tpu-search) ; Find | ||
| 336 | (define-key map "2~" 'tpu-paste) ; Insert Here | ||
| 337 | (define-key map "3~" 'tpu-cut) ; Remove | ||
| 338 | (define-key map "4~" 'tpu-select) ; Select | ||
| 339 | (define-key map "5~" 'tpu-scroll-window-down) ; Prev Screen | ||
| 340 | (define-key map "6~" 'tpu-scroll-window-up) ; Next Screen | ||
| 341 | |||
| 342 | (define-key map "11~" 'nil) ; F1 | ||
| 343 | (define-key map "12~" 'nil) ; F2 | ||
| 344 | (define-key map "13~" 'nil) ; F3 | ||
| 345 | (define-key map "14~" 'nil) ; F4 | ||
| 346 | (define-key map "15~" 'nil) ; F5 | ||
| 347 | (define-key map "17~" 'nil) ; F6 | ||
| 348 | (define-key map "18~" 'nil) ; F7 | ||
| 349 | (define-key map "19~" 'nil) ; F8 | ||
| 350 | (define-key map "20~" 'nil) ; F9 | ||
| 351 | (define-key map "21~" 'tpu-exit) ; F10 | ||
| 352 | (define-key map "23~" 'tpu-insert-escape) ; F11 (ESC) | ||
| 353 | (define-key map "24~" 'tpu-next-beginning-of-line) ; F12 (BS) | ||
| 354 | (define-key map "25~" 'tpu-delete-previous-word) ; F13 (LF) | ||
| 355 | (define-key map "26~" 'tpu-toggle-overwrite-mode) ; F14 | ||
| 356 | (define-key map "28~" 'tpu-help) ; HELP | ||
| 357 | (define-key map "29~" 'execute-extended-command) ; DO | ||
| 358 | (define-key map "31~" 'tpu-goto-breadcrumb) ; F17 | ||
| 359 | (define-key map "32~" 'nil) ; F18 | ||
| 360 | (define-key map "33~" 'nil) ; F19 | ||
| 361 | (define-key map "34~" 'nil) ; F20 | ||
| 362 | map) | ||
| 363 | "Maps the CSI function keys on the VT100 keyboard. | ||
| 364 | CSI is DEC's name for the sequence <ESC>[.") | ||
| 365 | 318 | ||
| 366 | (defvar GOLD-CSI-map | 319 | (defvar tpu-gold-map |
| 367 | (let ((map (make-sparse-keymap))) | ||
| 368 | (define-key map "A" 'tpu-move-to-beginning) ; up-arrow | ||
| 369 | (define-key map "B" 'tpu-move-to-end) ; down-arrow | ||
| 370 | (define-key map "C" 'end-of-line) ; right-arrow | ||
| 371 | (define-key map "D" 'beginning-of-line) ; left-arrow | ||
| 372 | |||
| 373 | (define-key map "1~" 'nil) ; Find | ||
| 374 | (define-key map "2~" 'nil) ; Insert Here | ||
| 375 | (define-key map "3~" 'tpu-store-text) ; Remove | ||
| 376 | (define-key map "4~" 'tpu-unselect) ; Select | ||
| 377 | (define-key map "5~" 'tpu-previous-window) ; Prev Screen | ||
| 378 | (define-key map "6~" 'tpu-next-window) ; Next Screen | ||
| 379 | |||
| 380 | (define-key map "11~" 'nil) ; F1 | ||
| 381 | (define-key map "12~" 'nil) ; F2 | ||
| 382 | (define-key map "13~" 'nil) ; F3 | ||
| 383 | (define-key map "14~" 'nil) ; F4 | ||
| 384 | (define-key map "16~" 'nil) ; F5 | ||
| 385 | (define-key map "17~" 'nil) ; F6 | ||
| 386 | (define-key map "18~" 'nil) ; F7 | ||
| 387 | (define-key map "19~" 'nil) ; F8 | ||
| 388 | (define-key map "20~" 'nil) ; F9 | ||
| 389 | (define-key map "21~" 'nil) ; F10 | ||
| 390 | (define-key map "23~" 'nil) ; F11 | ||
| 391 | (define-key map "24~" 'nil) ; F12 | ||
| 392 | (define-key map "25~" 'nil) ; F13 | ||
| 393 | (define-key map "26~" 'nil) ; F14 | ||
| 394 | (define-key map "28~" 'describe-bindings) ; HELP | ||
| 395 | (define-key map "29~" 'nil) ; DO | ||
| 396 | (define-key map "31~" 'tpu-drop-breadcrumb) ; F17 | ||
| 397 | (define-key map "32~" 'nil) ; F18 | ||
| 398 | (define-key map "33~" 'nil) ; F19 | ||
| 399 | (define-key map "34~" 'nil) ; F20 | ||
| 400 | map) | ||
| 401 | "Maps the function keys on the VT100 keyboard preceded by GOLD-CSI.") | ||
| 402 | |||
| 403 | (defvar GOLD-SS3-map | ||
| 404 | (let ((map (make-sparse-keymap))) | ||
| 405 | (define-key map "A" 'tpu-move-to-beginning) ; up-arrow | ||
| 406 | (define-key map "B" 'tpu-move-to-end) ; down-arrow | ||
| 407 | (define-key map "C" 'end-of-line) ; right-arrow | ||
| 408 | (define-key map "D" 'beginning-of-line) ; left-arrow | ||
| 409 | |||
| 410 | (define-key map "P" 'keyboard-quit) ; PF1 | ||
| 411 | (define-key map "Q" 'help-for-help) ; PF2 | ||
| 412 | (define-key map "R" 'tpu-search) ; PF3 | ||
| 413 | (define-key map "S" 'tpu-undelete-lines) ; PF4 | ||
| 414 | (define-key map "p" 'open-line) ; KP0 | ||
| 415 | (define-key map "q" 'tpu-change-case) ; KP1 | ||
| 416 | (define-key map "r" 'tpu-delete-to-eol) ; KP2 | ||
| 417 | (define-key map "s" 'tpu-special-insert) ; KP3 | ||
| 418 | (define-key map "t" 'tpu-move-to-end) ; KP4 | ||
| 419 | (define-key map "u" 'tpu-move-to-beginning) ; KP5 | ||
| 420 | (define-key map "v" 'tpu-paste) ; KP6 | ||
| 421 | (define-key map "w" 'execute-extended-command) ; KP7 | ||
| 422 | (define-key map "x" 'tpu-fill) ; KP8 | ||
| 423 | (define-key map "y" 'tpu-replace) ; KP9 | ||
| 424 | (define-key map "m" 'tpu-undelete-words) ; KP- | ||
| 425 | (define-key map "l" 'tpu-undelete-char) ; KP, | ||
| 426 | (define-key map "n" 'tpu-unselect) ; KP. | ||
| 427 | (define-key map "M" 'tpu-substitute) ; KPenter | ||
| 428 | map) | ||
| 429 | "Maps the function keys on the VT100 keyboard preceded by GOLD-SS3.") | ||
| 430 | |||
| 431 | (defvar GOLD-map | ||
| 432 | (let ((map (make-keymap))) | 320 | (let ((map (make-keymap))) |
| 433 | (define-key map "\e[" GOLD-CSI-map) ; GOLD-CSI map | 321 | ;; Previously we used escape sequences here. We now instead presume |
| 434 | (define-key map "\eO" GOLD-SS3-map) ; GOLD-SS3 map | 322 | ;; that term/*.el does its job to map the escape sequence to the right |
| 323 | ;; key-symbol. | ||
| 324 | |||
| 325 | (define-key map [up] 'tpu-move-to-beginning) ; up-arrow | ||
| 326 | (define-key map [down] 'tpu-move-to-end) ; down-arrow | ||
| 327 | (define-key map [right] 'end-of-line) ; right-arrow | ||
| 328 | (define-key map [left] 'beginning-of-line) ; left-arrow | ||
| 329 | |||
| 330 | (define-key map [find] 'nil) ; Find | ||
| 331 | (define-key map [insert] 'nil) ; Insert Here | ||
| 332 | (define-key map [delete] 'tpu-store-text) ; Remove | ||
| 333 | (define-key map [select] 'tpu-unselect) ; Select | ||
| 334 | (define-key map [prior] 'tpu-previous-window) ; Prev Screen | ||
| 335 | (define-key map [next] 'tpu-next-window) ; Next Screen | ||
| 336 | |||
| 337 | (define-key map [f1] 'nil) ; F1 | ||
| 338 | (define-key map [f2] 'nil) ; F2 | ||
| 339 | (define-key map [f3] 'nil) ; F3 | ||
| 340 | (define-key map [f4] 'nil) ; F4 | ||
| 341 | (define-key map [f5] 'nil) ; F5 | ||
| 342 | (define-key map [f6] 'nil) ; F6 | ||
| 343 | (define-key map [f7] 'nil) ; F7 | ||
| 344 | (define-key map [f8] 'nil) ; F8 | ||
| 345 | (define-key map [f9] 'nil) ; F9 | ||
| 346 | (define-key map [f10] 'nil) ; F10 | ||
| 347 | (define-key map [f11] 'nil) ; F11 | ||
| 348 | (define-key map [f12] 'nil) ; F12 | ||
| 349 | (define-key map [f13] 'nil) ; F13 | ||
| 350 | (define-key map [f14] 'nil) ; F14 | ||
| 351 | (define-key map [help] 'describe-bindings) ; HELP | ||
| 352 | (define-key map [menu] 'nil) ; DO | ||
| 353 | (define-key map [f17] 'tpu-drop-breadcrumb) ; F17 | ||
| 354 | (define-key map [f18] 'nil) ; F18 | ||
| 355 | (define-key map [f19] 'nil) ; F19 | ||
| 356 | (define-key map [f20] 'nil) ; F20 | ||
| 357 | |||
| 358 | (define-key map [kp-f1] 'keyboard-quit) ; PF1 | ||
| 359 | (define-key map [kp-f2] 'help-for-help) ; PF2 | ||
| 360 | (define-key map [kp-f3] 'tpu-search) ; PF3 | ||
| 361 | (define-key map [kp-f4] 'tpu-undelete-lines) ; PF4 | ||
| 362 | (define-key map [kp-0] 'open-line) ; KP0 | ||
| 363 | (define-key map [kp-1] 'tpu-change-case) ; KP1 | ||
| 364 | (define-key map [kp-2] 'tpu-delete-to-eol) ; KP2 | ||
| 365 | (define-key map [kp-3] 'tpu-special-insert) ; KP3 | ||
| 366 | (define-key map [kp-4] 'tpu-move-to-end) ; KP4 | ||
| 367 | (define-key map [kp-5] 'tpu-move-to-beginning) ; KP5 | ||
| 368 | (define-key map [kp-6] 'tpu-paste) ; KP6 | ||
| 369 | (define-key map [kp-7] 'execute-extended-command) ; KP7 | ||
| 370 | (define-key map [kp-8] 'tpu-fill) ; KP8 | ||
| 371 | (define-key map [kp-9] 'tpu-replace) ; KP9 | ||
| 372 | (define-key map [kp-subtract] 'tpu-undelete-words) ; KP- | ||
| 373 | (define-key map [kp-separator] 'tpu-undelete-char) ; KP, | ||
| 374 | (define-key map [kp-decimal] 'tpu-unselect) ; KP. | ||
| 375 | (define-key map [kp-enter] 'tpu-substitute) ; KPenter | ||
| 376 | |||
| 435 | ;; | 377 | ;; |
| 436 | (define-key map "\C-A" 'tpu-toggle-overwrite-mode) ; ^A | 378 | (define-key map "\C-A" 'tpu-toggle-overwrite-mode) ; ^A |
| 437 | (define-key map "\C-B" 'nil) ; ^B | 379 | (define-key map "\C-B" 'nil) ; ^B |
| @@ -553,48 +495,72 @@ CSI is DEC's name for the sequence <ESC>[.") | |||
| 553 | map) | 495 | map) |
| 554 | "Maps the function keys on the VT100 keyboard preceded by PF1. | 496 | "Maps the function keys on the VT100 keyboard preceded by PF1. |
| 555 | GOLD is the ASCII 7-bit escape sequence <ESC>OP.") | 497 | GOLD is the ASCII 7-bit escape sequence <ESC>OP.") |
| 498 | (define-obsolete-variable-alias 'GOLD-map 'tpu-gold-map "23.1") | ||
| 556 | 499 | ||
| 557 | (defvar SS3-map | 500 | (defvar tpu-global-map |
| 558 | (let ((map (make-sparse-keymap))) | 501 | (let ((map (make-sparse-keymap))) |
| 559 | (define-key map "P" GOLD-map) ; GOLD map | 502 | |
| 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. | ||
| 505 | (define-key map [find] 'tpu-search) ; Find | ||
| 506 | (define-key map [insert] 'tpu-paste) ; Insert Here | ||
| 507 | (define-key map [delete] 'tpu-cut) ; Remove | ||
| 508 | (define-key map [select] 'tpu-select) ; Select | ||
| 509 | (define-key map [prior] 'tpu-scroll-window-down) ; Prev Screen | ||
| 510 | (define-key map [next] 'tpu-scroll-window-up) ; Next Screen | ||
| 511 | |||
| 512 | (define-key map [f1] 'nil) ; F1 | ||
| 513 | (define-key map [f2] 'nil) ; F2 | ||
| 514 | (define-key map [f3] 'nil) ; F3 | ||
| 515 | (define-key map [f4] 'nil) ; F4 | ||
| 516 | (define-key map [f5] 'nil) ; F5 | ||
| 517 | (define-key map [f6] 'nil) ; F6 | ||
| 518 | (define-key map [f7] 'nil) ; F7 | ||
| 519 | (define-key map [f8] 'nil) ; F8 | ||
| 520 | (define-key map [f9] 'nil) ; F9 | ||
| 521 | (define-key map [f10] 'tpu-exit) ; F10 | ||
| 522 | (define-key map [f11] 'tpu-insert-escape) ; F11 (ESC) | ||
| 523 | (define-key map [f12] 'tpu-next-beginning-of-line) ; F12 (BS) | ||
| 524 | (define-key map [f13] 'tpu-delete-previous-word) ; F13 (LF) | ||
| 525 | (define-key map [f14] 'tpu-toggle-overwrite-mode) ; F14 | ||
| 526 | (define-key map [help] 'tpu-help) ; HELP | ||
| 527 | (define-key map [menu] 'execute-extended-command) ; DO | ||
| 528 | (define-key map [f17] 'tpu-goto-breadcrumb) ; F17 | ||
| 529 | (define-key map [f18] 'nil) ; F18 | ||
| 530 | (define-key map [f19] 'nil) ; F19 | ||
| 531 | (define-key map [f20] 'nil) ; F20 | ||
| 532 | |||
| 533 | |||
| 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. | ||
| 536 | (define-key map [kp-f1] tpu-gold-map) ; GOLD map | ||
| 560 | ;; | 537 | ;; |
| 561 | (define-key map "A" 'tpu-previous-line) ; up | 538 | (define-key map [up] 'tpu-previous-line) ; up |
| 562 | (define-key map "B" 'tpu-next-line) ; down | 539 | (define-key map [down] 'tpu-next-line) ; down |
| 563 | (define-key map "C" 'tpu-forward-char) ; right | 540 | (define-key map [right] 'tpu-forward-char) ; right |
| 564 | (define-key map "D" 'tpu-backward-char) ; left | 541 | (define-key map [left] 'tpu-backward-char) ; left |
| 565 | 542 | ||
| 566 | (define-key map "Q" 'tpu-help) ; PF2 | 543 | (define-key map [kp-f2] 'tpu-help) ; PF2 |
| 567 | (define-key map "R" 'tpu-search-again) ; PF3 | 544 | (define-key map [kp-f3] 'tpu-search-again) ; PF3 |
| 568 | (define-key map "S" 'tpu-delete-current-line) ; PF4 | 545 | (define-key map [kp-f4] 'tpu-delete-current-line) ; PF4 |
| 569 | (define-key map "p" 'tpu-line) ; KP0 | 546 | (define-key map [kp-0] 'tpu-line) ; KP0 |
| 570 | (define-key map "q" 'tpu-word) ; KP1 | 547 | (define-key map [kp-1] 'tpu-word) ; KP1 |
| 571 | (define-key map "r" 'tpu-end-of-line) ; KP2 | 548 | (define-key map [kp-2] 'tpu-end-of-line) ; KP2 |
| 572 | (define-key map "s" 'tpu-char) ; KP3 | 549 | (define-key map [kp-3] 'tpu-char) ; KP3 |
| 573 | (define-key map "t" 'tpu-advance-direction) ; KP4 | 550 | (define-key map [kp-4] 'tpu-advance-direction) ; KP4 |
| 574 | (define-key map "u" 'tpu-backup-direction) ; KP5 | 551 | (define-key map [kp-5] 'tpu-backup-direction) ; KP5 |
| 575 | (define-key map "v" 'tpu-cut) ; KP6 | 552 | (define-key map [kp-6] 'tpu-cut) ; KP6 |
| 576 | (define-key map "w" 'tpu-page) ; KP7 | 553 | (define-key map [kp-7] 'tpu-page) ; KP7 |
| 577 | (define-key map "x" 'tpu-scroll-window) ; KP8 | 554 | (define-key map [kp-8] 'tpu-scroll-window) ; KP8 |
| 578 | (define-key map "y" 'tpu-append-region) ; KP9 | 555 | (define-key map [kp-9] 'tpu-append-region) ; KP9 |
| 579 | (define-key map "m" 'tpu-delete-current-word) ; KP- | 556 | (define-key map [kp-subtract] 'tpu-delete-current-word) ; KP- |
| 580 | (define-key map "l" 'tpu-delete-current-char) ; KP, | 557 | (define-key map [kp-separator] 'tpu-delete-current-char) ; KP, |
| 581 | (define-key map "n" 'tpu-select) ; KP. | 558 | (define-key map [kp-decimal] 'tpu-select) ; KP. |
| 582 | (define-key map "M" 'newline) ; KPenter | 559 | (define-key map [kp-enter] 'newline) ; KPenter |
| 583 | map) | ||
| 584 | "Maps the SS3 function keys on the VT100 keyboard. | ||
| 585 | SS3 is DEC's name for the sequence <ESC>O.") | ||
| 586 | 560 | ||
| 587 | (defvar tpu-global-map | ||
| 588 | (let ((map (make-sparse-keymap))) | ||
| 589 | (define-key map "\e[" CSI-map) | ||
| 590 | (define-key map "\eO" SS3-map) | ||
| 591 | map) | 561 | map) |
| 592 | "TPU-edt global keymap.") | 562 | "TPU-edt global keymap.") |
| 593 | 563 | ||
| 594 | (and (not (boundp 'minibuffer-local-ns-map)) | ||
| 595 | (defvar minibuffer-local-ns-map (make-sparse-keymap) | ||
| 596 | "Hack to give Lucid Emacs the same maps as ordinary Emacs.")) | ||
| 597 | |||
| 598 | 564 | ||
| 599 | ;;; | 565 | ;;; |
| 600 | ;;; Global Variables | 566 | ;;; Global Variables |
| @@ -697,7 +663,7 @@ SS3 is DEC's name for the sequence <ESC>O.") | |||
| 697 | (setq tpu-mark-flag (if transient-mark-mode "" (if (tpu-mark) " @" " "))) | 663 | (setq tpu-mark-flag (if transient-mark-mode "" (if (tpu-mark) " @" " "))) |
| 698 | (force-mode-line-update)) | 664 | (force-mode-line-update)) |
| 699 | 665 | ||
| 700 | (cond (tpu-lucid-emacs-p | 666 | (cond ((featurep 'xemacs) |
| 701 | (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line) | 667 | (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line) |
| 702 | (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line)) | 668 | (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line)) |
| 703 | (t | 669 | (t |
| @@ -778,7 +744,7 @@ Otherwise sets the tpu-match markers to nil and returns nil." | |||
| 778 | "TPU-edt version of the mark function. | 744 | "TPU-edt version of the mark function. |
| 779 | Return the appropriate value of the mark for the current | 745 | Return the appropriate value of the mark for the current |
| 780 | version of Emacs." | 746 | version of Emacs." |
| 781 | (cond (tpu-lucid-emacs-p (mark (not zmacs-regions))) | 747 | (cond ((featurep 'xemacs) (mark (not zmacs-regions))) |
| 782 | (t (and mark-active (mark (not transient-mark-mode)))))) | 748 | (t (and mark-active (mark (not transient-mark-mode)))))) |
| 783 | 749 | ||
| 784 | (defun tpu-set-mark (pos) | 750 | (defun tpu-set-mark (pos) |
| @@ -2366,7 +2332,7 @@ If FILE is nil, try to load a default file. The default file names are | |||
| 2366 | (setq file (expand-file-name file))) | 2332 | (setq file (expand-file-name file))) |
| 2367 | (tpu-xkeys-file | 2333 | (tpu-xkeys-file |
| 2368 | (setq file (expand-file-name tpu-xkeys-file))) | 2334 | (setq file (expand-file-name tpu-xkeys-file))) |
| 2369 | (tpu-lucid-emacs-p | 2335 | ((featurep 'xemacs) |
| 2370 | (setq file (convert-standard-filename | 2336 | (setq file (convert-standard-filename |
| 2371 | (expand-file-name "~/.tpu-lucid-keys")))) | 2337 | (expand-file-name "~/.tpu-lucid-keys")))) |
| 2372 | (t | 2338 | (t |
| @@ -2382,34 +2348,11 @@ If FILE is nil, try to load a default file. The default file names are | |||
| 2382 | (cond ((file-readable-p file) | 2348 | (cond ((file-readable-p file) |
| 2383 | (load-file file)) | 2349 | (load-file file)) |
| 2384 | (t | 2350 | (t |
| 2385 | (switch-to-buffer "*scratch*") | 2351 | ;; FIXME: This used to force the user to build `file'. With the |
| 2386 | (erase-buffer) | 2352 | ;; new code, such a file is not even necessary, but we'll keep |
| 2387 | (insert " | 2353 | ;; a warning message. |
| 2388 | 2354 | (message "%s not found: use tpu-mapper.el to create it" | |
| 2389 | Ack!! You're running TPU-edt under X-windows without loading an | 2355 | (abbreviate-file-name file))))) |
| 2390 | X key definition file. To create a TPU-edt X key definition | ||
| 2391 | file, run the tpu-mapper.el program. It came with TPU-edt. It | ||
| 2392 | even includes directions on how to use it! Perhaps it's lying | ||
| 2393 | around here someplace. ") | ||
| 2394 | (let ((file "tpu-mapper.el") | ||
| 2395 | (found nil) | ||
| 2396 | (path nil) | ||
| 2397 | (search-list (append (list (expand-file-name ".")) load-path))) | ||
| 2398 | (while (and (not found) search-list) | ||
| 2399 | (setq path (concat (car search-list) | ||
| 2400 | (if (string-match "/$" (car search-list)) "" "/") | ||
| 2401 | file)) | ||
| 2402 | (if (and (file-exists-p path) (not (file-directory-p path))) | ||
| 2403 | (setq found t)) | ||
| 2404 | (setq search-list (cdr search-list))) | ||
| 2405 | (cond (found | ||
| 2406 | (insert (format | ||
| 2407 | "Ah yes, there it is, in \n\n %s \n\n" path)) | ||
| 2408 | (if (tpu-y-or-n-p "Do you want to run it now? ") | ||
| 2409 | (load-file path))) | ||
| 2410 | (t | ||
| 2411 | (insert "Nope, I can't seem to find it. :-(\n\n") | ||
| 2412 | (sit-for 120))))))) | ||
| 2413 | 2356 | ||
| 2414 | (defun tpu-copy-keyfile (oldname newname) | 2357 | (defun tpu-copy-keyfile (oldname newname) |
| 2415 | "Copy the TPU-edt X key definitions file to the new default name." | 2358 | "Copy the TPU-edt X key definitions file to the new default name." |
diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el index 975e61c8df3..eeaa5c7c560 100644 --- a/lisp/emulation/tpu-mapper.el +++ b/lisp/emulation/tpu-mapper.el | |||
| @@ -202,9 +202,9 @@ | |||
| 202 | (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]")) | 202 | (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]")) |
| 203 | (cond ((not (equal tpu-key tpu-return)) | 203 | (cond ((not (equal tpu-key tpu-return)) |
| 204 | (set-buffer "Keys") | 204 | (set-buffer "Keys") |
| 205 | (insert (format"(global-set-key %s %s)\n" tpu-key func)) | 205 | (insert (format"(define-key tpu-global-map %s %s)\n" tpu-key func)) |
| 206 | (set-buffer "Gold-Keys") | 206 | (set-buffer "Gold-Keys") |
| 207 | (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func)) | 207 | (insert (format "(define-key tpu-gold-map %s %s)\n" tpu-key gold-func)) |
| 208 | (set-buffer "Directions")) | 208 | (set-buffer "Directions")) |
| 209 | ;; bogosity to get next prompt to come up, if the user hits <CR>! | 209 | ;; bogosity to get next prompt to come up, if the user hits <CR>! |
| 210 | ;; check periodically to see if this is still needed... | 210 | ;; check periodically to see if this is still needed... |
| @@ -393,5 +393,5 @@ | |||
| 393 | ") | 393 | ") |
| 394 | (goto-char (point-min)) | 394 | (goto-char (point-min)) |
| 395 | 395 | ||
| 396 | ;;; arch-tag: bab5872f-cd3a-4c1c-aedb-047b67646f6c | 396 | ;; arch-tag: bab5872f-cd3a-4c1c-aedb-047b67646f6c |
| 397 | ;;; tpu-mapper.el ends here | 397 | ;;; tpu-mapper.el ends here |
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 9bd1654020b..f4c0650b1c8 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -106,7 +106,7 @@ | |||
| 106 | ;; define viper-charpair-command-p | 106 | ;; define viper-charpair-command-p |
| 107 | (viper-test-com-defun viper-charpair-command) | 107 | (viper-test-com-defun viper-charpair-command) |
| 108 | 108 | ||
| 109 | (defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?H ?j ?k ?l | 109 | (defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?j ?k ?l |
| 110 | ?H ?M ?L ?n ?t ?T ?w ?W ?$ ?% | 110 | ?H ?M ?L ?n ?t ?T ?w ?W ?$ ?% |
| 111 | ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?` | 111 | ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?` |
| 112 | ?\; ?, ?0 ?? ?/ ?\ ?\C-m | 112 | ?\; ?, ?0 ?? ?/ ?\ ?\C-m |
| @@ -1321,10 +1321,10 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1321 | (setq last-command-event | 1321 | (setq last-command-event |
| 1322 | (viper-copy-event | 1322 | (viper-copy-event |
| 1323 | (if viper-xemacs-p (character-to-event char) char))) | 1323 | (if viper-xemacs-p (character-to-event char) char))) |
| 1324 | (condition-case nil | 1324 | (condition-case err |
| 1325 | (funcall cmd-to-exec-at-end cmd-info) | 1325 | (funcall cmd-to-exec-at-end cmd-info) |
| 1326 | (error | 1326 | (error |
| 1327 | (error ""))))) | 1327 | (error "%s" (error-message-string err)))))) |
| 1328 | )) | 1328 | )) |
| 1329 | 1329 | ||
| 1330 | (defun viper-describe-arg (arg) | 1330 | (defun viper-describe-arg (arg) |
| @@ -1902,7 +1902,7 @@ With prefix argument, find next destructive command." | |||
| 1902 | (setq viper-intermediate-command | 1902 | (setq viper-intermediate-command |
| 1903 | 'repeating-display-destructive-command) | 1903 | 'repeating-display-destructive-command) |
| 1904 | ;; first search through command history--set temp ring | 1904 | ;; first search through command history--set temp ring |
| 1905 | (setq viper-temp-command-ring (copy-list viper-command-ring))) | 1905 | (setq viper-temp-command-ring (copy-sequence viper-command-ring))) |
| 1906 | (setq cmd (if next | 1906 | (setq cmd (if next |
| 1907 | (viper-special-ring-rotate1 viper-temp-command-ring 1) | 1907 | (viper-special-ring-rotate1 viper-temp-command-ring 1) |
| 1908 | (viper-special-ring-rotate1 viper-temp-command-ring -1))) | 1908 | (viper-special-ring-rotate1 viper-temp-command-ring -1))) |
| @@ -1936,7 +1936,7 @@ to in the global map, instead of cycling through the insertion ring." | |||
| 1936 | (length viper-last-inserted-string-from-insertion-ring)))) | 1936 | (length viper-last-inserted-string-from-insertion-ring)))) |
| 1937 | ) | 1937 | ) |
| 1938 | ;;first search through insertion history | 1938 | ;;first search through insertion history |
| 1939 | (setq viper-temp-insertion-ring (copy-list viper-insertion-ring))) | 1939 | (setq viper-temp-insertion-ring (copy-sequence viper-insertion-ring))) |
| 1940 | (setq this-command 'viper-insert-from-insertion-ring) | 1940 | (setq this-command 'viper-insert-from-insertion-ring) |
| 1941 | ;; so that things will be undone properly | 1941 | ;; so that things will be undone properly |
| 1942 | (setq buffer-undo-list (cons nil buffer-undo-list)) | 1942 | (setq buffer-undo-list (cons nil buffer-undo-list)) |
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 86e0e044641..4a1bae82711 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el | |||
| @@ -97,6 +97,13 @@ | |||
| 97 | :tag "Is it VMS?" | 97 | :tag "Is it VMS?" |
| 98 | :group 'viper-misc) | 98 | :group 'viper-misc) |
| 99 | 99 | ||
| 100 | (defcustom viper-suppress-input-method-change-message nil | ||
| 101 | "If t, the message notifying about changes in the input method is not displayed. | ||
| 102 | Normally, a message is displayed each time on enters the vi, insert or replace | ||
| 103 | state." | ||
| 104 | :type 'boolean | ||
| 105 | :group 'viper-misc) | ||
| 106 | |||
| 100 | (defcustom viper-force-faces nil | 107 | (defcustom viper-force-faces nil |
| 101 | "If t, Viper will think that it is running on a display that supports faces. | 108 | "If t, Viper will think that it is running on a display that supports faces. |
| 102 | This is provided as a temporary relief for users of graphics-capable terminals | 109 | This is provided as a temporary relief for users of graphics-capable terminals |
| @@ -326,7 +333,8 @@ Use `M-x viper-set-expert-level' to change this.") | |||
| 326 | ;; turn off special input methods in vi-state | 333 | ;; turn off special input methods in vi-state |
| 327 | (if (eq viper-current-state 'vi-state) | 334 | (if (eq viper-current-state 'vi-state) |
| 328 | (viper-set-input-method nil)) | 335 | (viper-set-input-method nil)) |
| 329 | (if (memq viper-current-state '(vi-state insert-state replace-state)) | 336 | (if (and (memq viper-current-state '(vi-state insert-state replace-state)) |
| 337 | (not viper-suppress-input-method-change-message)) | ||
| 330 | (message "Viper special input method%s: on" | 338 | (message "Viper special input method%s: on" |
| 331 | (if (or current-input-method default-input-method) | 339 | (if (or current-input-method default-input-method) |
| 332 | (format " %S" | 340 | (format " %S" |
| @@ -339,7 +347,8 @@ Use `M-x viper-set-expert-level' to change this.") | |||
| 339 | (if (null viper-mule-hook-flag) | 347 | (if (null viper-mule-hook-flag) |
| 340 | () | 348 | () |
| 341 | (setq viper-special-input-method nil) | 349 | (setq viper-special-input-method nil) |
| 342 | (if (memq viper-current-state '(vi-state insert-state replace-state)) | 350 | (if (and (memq viper-current-state '(vi-state insert-state replace-state)) |
| 351 | (not viper-suppress-input-method-change-message)) | ||
| 343 | (message "Viper special input method%s: off" | 352 | (message "Viper special input method%s: off" |
| 344 | (if (or current-input-method default-input-method) | 353 | (if (or current-input-method default-input-method) |
| 345 | (format " %S" | 354 | (format " %S" |
| @@ -369,7 +378,7 @@ Use `M-x viper-set-expert-level' to change this.") | |||
| 369 | ;; Set quail-mode to ARG | 378 | ;; Set quail-mode to ARG |
| 370 | (defun viper-set-input-method (arg) | 379 | (defun viper-set-input-method (arg) |
| 371 | (setq viper-mule-hook-flag t) ; just a precaution | 380 | (setq viper-mule-hook-flag t) ; just a precaution |
| 372 | (let (viper-mule-hook-flag) ; temporarily inactivate viper mule hooks | 381 | (let (viper-mule-hook-flag) ; temporarily deactivate viper mule hooks |
| 373 | (cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method) | 382 | (cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method) |
| 374 | ;; activate input method | 383 | ;; activate input method |
| 375 | (viper-activate-input-method)) | 384 | (viper-activate-input-method)) |
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 9dd78ce8aa1..1d158274198 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el | |||
| @@ -339,8 +339,8 @@ If running in a terminal, [(escape)] is not understood, so must use \"\\e\"." | |||
| 339 | (define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol) | 339 | (define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol) |
| 340 | (define-key viper-vi-basic-map "\C-u" 'viper-scroll-down) | 340 | (define-key viper-vi-basic-map "\C-u" 'viper-scroll-down) |
| 341 | (define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one) | 341 | (define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one) |
| 342 | (define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward) | 342 | ;;(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward) |
| 343 | (define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward) | 343 | ;;(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward) |
| 344 | (define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style) | 344 | (define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style) |
| 345 | (define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file) | 345 | (define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file) |
| 346 | 346 | ||
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 0419af5fedf..eef92106de2 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -168,7 +168,7 @@ | |||
| 168 | 168 | ||
| 169 | (defun viper-set-cursor-color-according-to-state (&optional frame) | 169 | (defun viper-set-cursor-color-according-to-state (&optional frame) |
| 170 | (cond ((eq viper-current-state 'replace-state) | 170 | (cond ((eq viper-current-state 'replace-state) |
| 171 | (viper-change-cursor-color viper-replace-state-cursor-color frame)) | 171 | (viper-change-cursor-color viper-replace-overlay-cursor-color frame)) |
| 172 | ((and (eq viper-current-state 'emacs-state) | 172 | ((and (eq viper-current-state 'emacs-state) |
| 173 | viper-emacs-state-cursor-color) | 173 | viper-emacs-state-cursor-color) |
| 174 | (viper-change-cursor-color viper-emacs-state-cursor-color frame)) | 174 | (viper-change-cursor-color viper-emacs-state-cursor-color frame)) |
| @@ -889,9 +889,7 @@ | |||
| 889 | ;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg | 889 | ;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg |
| 890 | ;; in sit-for, so this function smoothes out the differences. | 890 | ;; in sit-for, so this function smoothes out the differences. |
| 891 | (defsubst viper-sit-for-short (val &optional nodisp) | 891 | (defsubst viper-sit-for-short (val &optional nodisp) |
| 892 | (if viper-xemacs-p | 892 | (sit-for (/ val 1000.0) nodisp)) |
| 893 | (sit-for (/ val 1000.0) nodisp) | ||
| 894 | (sit-for 0 val nodisp))) | ||
| 895 | 893 | ||
| 896 | ;; EVENT may be a single event of a sequence of events | 894 | ;; EVENT may be a single event of a sequence of events |
| 897 | (defsubst viper-ESC-event-p (event) | 895 | (defsubst viper-ESC-event-p (event) |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 67ec3660c65..a42e7f1eb91 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> | 9 | ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> |
| 10 | ;; Keywords: emulations | 10 | ;; Keywords: emulations |
| 11 | 11 | ||
| 12 | (defconst viper-version "3.13.1 of October 23, 2006" | 12 | (defconst viper-version "3.14 of June 14, 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. |
| @@ -298,7 +298,6 @@ | |||
| 298 | ;;; Code: | 298 | ;;; Code: |
| 299 | 299 | ||
| 300 | (require 'advice) | 300 | (require 'advice) |
| 301 | (require 'cl) | ||
| 302 | (require 'ring) | 301 | (require 'ring) |
| 303 | 302 | ||
| 304 | ;; compiler pacifier | 303 | ;; compiler pacifier |
| @@ -457,6 +456,7 @@ unless it is coming up in a wrong Viper state." | |||
| 457 | (defcustom viper-insert-state-mode-list | 456 | (defcustom viper-insert-state-mode-list |
| 458 | '(internal-ange-ftp-mode | 457 | '(internal-ange-ftp-mode |
| 459 | comint-mode | 458 | comint-mode |
| 459 | gud-mode | ||
| 460 | inferior-emacs-lisp-mode | 460 | inferior-emacs-lisp-mode |
| 461 | erc-mode | 461 | erc-mode |
| 462 | eshell-mode | 462 | eshell-mode |
| @@ -481,6 +481,7 @@ unless it is coming up in a wrong Viper state." | |||
| 481 | '((help-mode emacs-state viper-slash-and-colon-map) | 481 | '((help-mode emacs-state viper-slash-and-colon-map) |
| 482 | (comint-mode insert-state viper-comint-mode-modifier-map) | 482 | (comint-mode insert-state viper-comint-mode-modifier-map) |
| 483 | (comint-mode vi-state viper-comint-mode-modifier-map) | 483 | (comint-mode vi-state viper-comint-mode-modifier-map) |
| 484 | (gud-mode insert-state viper-comint-mode-modifier-map) | ||
| 484 | (shell-mode insert-state viper-comint-mode-modifier-map) | 485 | (shell-mode insert-state viper-comint-mode-modifier-map) |
| 485 | (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map) | 486 | (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map) |
| 486 | (shell-mode vi-state viper-comint-mode-modifier-map) | 487 | (shell-mode vi-state viper-comint-mode-modifier-map) |
| @@ -1025,48 +1026,63 @@ It also can't undo some Viper settings." | |||
| 1025 | (setq global-mode-string | 1026 | (setq global-mode-string |
| 1026 | (append '("" viper-mode-string) (cdr global-mode-string)))) | 1027 | (append '("" viper-mode-string) (cdr global-mode-string)))) |
| 1027 | 1028 | ||
| 1028 | (defadvice describe-key (before viper-describe-key-ad protect activate) | 1029 | (viper-cond-compile-for-xemacs-or-emacs |
| 1029 | "Force to read key via `viper-read-key-sequence'." | 1030 | ;; XEmacs |
| 1030 | (interactive (let (key) | 1031 | (defadvice describe-key (before viper-describe-key-ad protect activate) |
| 1031 | (setq key (viper-read-key-sequence | 1032 | "Force to read key via `viper-read-key-sequence'." |
| 1032 | "Describe key (or click or menu item): ")) | 1033 | (interactive (list (viper-read-key-sequence "Describe key: ")))) |
| 1033 | (list key | 1034 | ;; Emacs |
| 1034 | (prefix-numeric-value current-prefix-arg) | 1035 | (defadvice describe-key (before viper-describe-key-ad protect activate) |
| 1035 | ;; If KEY is a down-event, read also the | 1036 | "Force to read key via `viper-read-key-sequence'." |
| 1036 | ;; corresponding up-event. | 1037 | (interactive (let (key) |
| 1037 | (and (vectorp key) | 1038 | (setq key (viper-read-key-sequence |
| 1038 | (let ((last-idx (1- (length key)))) | 1039 | "Describe key (or click or menu item): ")) |
| 1039 | (and (eventp (aref key last-idx)) | 1040 | (list key |
| 1040 | (memq 'down (event-modifiers | 1041 | (prefix-numeric-value current-prefix-arg) |
| 1041 | (aref key last-idx))))) | 1042 | ;; If KEY is a down-event, read also the |
| 1042 | (or (and (eventp (aref key 0)) | 1043 | ;; corresponding up-event. |
| 1043 | (memq 'down (event-modifiers | 1044 | (and (vectorp key) |
| 1044 | (aref key 0))) | 1045 | (let ((last-idx (1- (length key)))) |
| 1045 | ;; For the C-down-mouse-2 popup | 1046 | (and (eventp (aref key last-idx)) |
| 1046 | ;; menu, there is no subsequent up-event. | 1047 | (memq 'down (event-modifiers |
| 1047 | (= (length key) 1)) | 1048 | (aref key last-idx))))) |
| 1048 | (and (> (length key) 1) | 1049 | (or (and (eventp (aref key 0)) |
| 1049 | (eventp (aref key 1)) | 1050 | (memq 'down (event-modifiers |
| 1050 | (memq 'down (event-modifiers (aref key 1))))) | 1051 | (aref key 0))) |
| 1051 | (read-event)))))) | 1052 | ;; For the C-down-mouse-2 popup menu, |
| 1052 | 1053 | ;; there is no subsequent up-event | |
| 1053 | (defadvice describe-key-briefly | 1054 | (= (length key) 1)) |
| 1054 | (before viper-describe-key-briefly-ad protect activate) | 1055 | (and (> (length key) 1) |
| 1055 | "Force to read key via `viper-read-key-sequence'." | 1056 | (eventp (aref key 1)) |
| 1056 | (interactive (let (key) | 1057 | (memq 'down (event-modifiers (aref key 1))))) |
| 1057 | (setq key (viper-read-key-sequence | 1058 | (read-event)))))) |
| 1058 | "Describe key (or click or menu item): ")) | 1059 | ) ; viper-cond-compile-for-xemacs-or-emacs |
| 1059 | ;; If KEY is a down-event, read and discard the | 1060 | |
| 1060 | ;; corresponding up-event. | 1061 | (viper-cond-compile-for-xemacs-or-emacs |
| 1061 | (and (vectorp key) | 1062 | ;; XEmacs |
| 1062 | (let ((last-idx (1- (length key)))) | 1063 | (defadvice describe-key-briefly |
| 1063 | (and (eventp (aref key last-idx)) | 1064 | (before viper-describe-key-briefly-ad protect activate) |
| 1064 | (memq 'down (event-modifiers (aref key last-idx))))) | 1065 | "Force to read key via `viper-read-key-sequence'." |
| 1065 | (read-event)) | 1066 | (interactive (list (viper-read-key-sequence "Describe key briefly: ")))) |
| 1066 | (list key | 1067 | ;; Emacs |
| 1067 | (if current-prefix-arg | 1068 | (defadvice describe-key-briefly |
| 1068 | (prefix-numeric-value current-prefix-arg)) | 1069 | (before viper-describe-key-briefly-ad protect activate) |
| 1069 | 1)))) | 1070 | "Force to read key via `viper-read-key-sequence'." |
| 1071 | (interactive (let (key) | ||
| 1072 | (setq key (viper-read-key-sequence | ||
| 1073 | "Describe key (or click or menu item): ")) | ||
| 1074 | ;; If KEY is a down-event, read and discard the | ||
| 1075 | ;; corresponding up-event. | ||
| 1076 | (and (vectorp key) | ||
| 1077 | (let ((last-idx (1- (length key)))) | ||
| 1078 | (and (eventp (aref key last-idx)) | ||
| 1079 | (memq 'down (event-modifiers (aref key last-idx))))) | ||
| 1080 | (read-event)) | ||
| 1081 | (list key | ||
| 1082 | (if current-prefix-arg | ||
| 1083 | (prefix-numeric-value current-prefix-arg)) | ||
| 1084 | 1)))) | ||
| 1085 | ) ;; viper-cond-compile-for-xemacs-or-emacs | ||
| 1070 | 1086 | ||
| 1071 | (defadvice find-file (before viper-add-suffix-advice activate) | 1087 | (defadvice find-file (before viper-add-suffix-advice activate) |
| 1072 | "Use `read-file-name' for reading arguments." | 1088 | "Use `read-file-name' for reading arguments." |