diff options
| author | Glenn Morris | 2008-03-01 20:23:36 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-01 20:23:36 +0000 |
| commit | ce8fc80bbd0790fc7134bc620f8e6690e0080570 (patch) | |
| tree | 66601ae53fa9b24f6232524b73ba0f8f13b218e3 | |
| parent | f3b9e4791f7da7911bd8838c4247b668356c4312 (diff) | |
| download | emacs-ce8fc80bbd0790fc7134bc620f8e6690e0080570.tar.gz emacs-ce8fc80bbd0790fc7134bc620f8e6690e0080570.zip | |
(viper-cond-compile-for-xemacs-or-emacs): Delete macro.
Expand all viper-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Replace obselete frame-local variables with frame-parameters.
(viper-replace-overlay-cursor-color, viper-insert-state-cursor-color)
(viper-emacs-state-cursor-color, viper-vi-state-cursor-color): Only
call make-variable-frame-local on XEmacs.
| -rw-r--r-- | lisp/ChangeLog | 49 | ||||
| -rw-r--r-- | lisp/emulation/viper-init.el | 61 |
2 files changed, 69 insertions, 41 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 045be916d24..e774809a71d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,50 @@ | |||
| 1 | 2008-03-01 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-maybe-guarded): Restore | ||
| 4 | code commented out 2007-11-10. | ||
| 5 | |||
| 6 | * emulation/edt.el (zmacs-region-stays): Define for compiler once only. | ||
| 7 | |||
| 8 | * emulation/viper-init.el (viper-cond-compile-for-xemacs-or-emacs): | ||
| 9 | Delete macro. | ||
| 10 | * emulation/viper-cmd.el, emulation/viper-ex.el: | ||
| 11 | * emulation/viper-init.el, emulation/viper-keym.el: | ||
| 12 | * emulation/viper-mous.el, emulation/viper-util.el: | ||
| 13 | * emulation/viper.el: | ||
| 14 | Expand all viper-cond-compile-for-xemacs-or-emacs calls to a | ||
| 15 | featurep test. | ||
| 16 | |||
| 17 | Replace obselete frame-local variables with frame-parameters. | ||
| 18 | * emulation/viper-init.el (viper-replace-overlay-cursor-color) | ||
| 19 | (viper-insert-state-cursor-color, viper-emacs-state-cursor-color) | ||
| 20 | (viper-vi-state-cursor-color): Only call make-variable-frame-local | ||
| 21 | on XEmacs. | ||
| 22 | * emulation/viper-util.el (viper-frame-value): New macro. | ||
| 23 | * emulation/viper-cmd.el (viper-insert-state-post-command-sentinel) | ||
| 24 | (viper-R-state-post-command-sentinel) | ||
| 25 | (viper-replace-state-post-command-sentinel) | ||
| 26 | (viper-change-state-to-insert, viper-change-state-to-emacs): | ||
| 27 | * emulation/viper-util.el (viper-set-cursor-color-according-to-state) | ||
| 28 | (viper-save-cursor-color, viper-get-saved-cursor-color-in-replace-mode) | ||
| 29 | (viper-get-saved-cursor-color-in-insert-mode) | ||
| 30 | (viper-get-saved-cursor-color-in-emacs-mode, viper-set-replace-overlay): | ||
| 31 | Use viper-frame-value for viper-replace-overlay-cursor-color, | ||
| 32 | viper-emacs-state-cursor-color, viper-insert-state-cursor-color, and | ||
| 33 | viper-vi-state-cursor-color values. | ||
| 34 | |||
| 35 | * emulation/viper-cmd.el (zmacs-region-stays): | ||
| 36 | * emulation/viper-util.el (zmacs-region-stays): No need to define | ||
| 37 | for compiler. | ||
| 38 | |||
| 39 | * emulation/viper-keym.el (viper-add-keymap): Use mapc rather than | ||
| 40 | mapcar on Emacs. | ||
| 41 | |||
| 42 | * emulation/viper-mous.el (viper-counting-clicks-p): Only define | ||
| 43 | on XEmacs. | ||
| 44 | |||
| 45 | * emulation/viper-util.el (viper-set-minibuffer-overlay): Use when | ||
| 46 | rather than if. | ||
| 47 | |||
| 1 | 2008-03-01 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 48 | 2008-03-01 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 2 | 49 | ||
| 3 | * whitespace.el: New version 9.3. As the glyph code generation was | 50 | * whitespace.el: New version 9.3. As the glyph code generation was |
| @@ -42,8 +89,6 @@ | |||
| 42 | * diff-mode.el (diff-sanity-check-hunk): Only accept an empty line if | 89 | * diff-mode.el (diff-sanity-check-hunk): Only accept an empty line if |
| 43 | we still expect more lines. | 90 | we still expect more lines. |
| 44 | 91 | ||
| 45 | 2008-03-01 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 46 | |||
| 47 | * textmodes/fill.el (fill-comment-paragraph): Don't try to do | 92 | * textmodes/fill.el (fill-comment-paragraph): Don't try to do |
| 48 | comment-paragraph filling if the commark doesn't match | 93 | comment-paragraph filling if the commark doesn't match |
| 49 | comment-start-skip. | 94 | comment-start-skip. |
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index d0f89751d57..d14e34b1340 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el | |||
| @@ -49,30 +49,16 @@ | |||
| 49 | 49 | ||
| 50 | ;; Tell whether we are running as a window application or on a TTY | 50 | ;; Tell whether we are running as a window application or on a TTY |
| 51 | 51 | ||
| 52 | ;; This is used to avoid compilation warnings. When emacs/xemacs forms can | ||
| 53 | ;; generate compile time warnings, we use this macro. | ||
| 54 | ;; In this case, the macro will expand into the form that is appropriate to the | ||
| 55 | ;; compiler at hand. | ||
| 56 | ;; Suggested by rms. | ||
| 57 | (defmacro viper-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form) | ||
| 58 | (if (featurep 'xemacs) | ||
| 59 | xemacs-form emacs-form)) | ||
| 60 | |||
| 61 | |||
| 62 | (defsubst viper-device-type () | 52 | (defsubst viper-device-type () |
| 63 | (viper-cond-compile-for-xemacs-or-emacs | 53 | (if (featurep 'xemacs) |
| 64 | (device-type (selected-device)) | 54 | (device-type (selected-device)) |
| 65 | window-system | 55 | window-system)) |
| 66 | )) | ||
| 67 | 56 | ||
| 68 | (defun viper-color-display-p () | 57 | (defun viper-color-display-p () |
| 69 | (condition-case nil | 58 | (condition-case nil |
| 70 | (viper-cond-compile-for-xemacs-or-emacs | 59 | (if (featurep 'xemacs) |
| 71 | (eq (device-class (selected-device)) 'color) ; xemacs form | 60 | (eq (device-class (selected-device)) 'color) |
| 72 | (if (fboundp 'display-color-p) ; emacs form | 61 | (display-color-p)) |
| 73 | (display-color-p) | ||
| 74 | (x-display-color-p)) | ||
| 75 | ) | ||
| 76 | (error nil))) | 62 | (error nil))) |
| 77 | 63 | ||
| 78 | ;; in XEmacs: device-type is tty on tty and stream in batch. | 64 | ;; in XEmacs: device-type is tty on tty and stream in batch. |
| @@ -353,7 +339,7 @@ Use `M-x viper-set-expert-level' to change this.") | |||
| 353 | (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method)) | 339 | (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method)) |
| 354 | (inactivate-input-method)) | 340 | (inactivate-input-method)) |
| 355 | ((and (featurep 'xemacs) (boundp 'current-input-method)) | 341 | ((and (featurep 'xemacs) (boundp 'current-input-method)) |
| 356 | ;; XEmacs had broken quil-mode for some time, so we are working around | 342 | ;; XEmacs had broken quail-mode for some time, so we are working around |
| 357 | ;; it here | 343 | ;; it here |
| 358 | (setq quail-mode nil) | 344 | (setq quail-mode nil) |
| 359 | (if (featurep 'quail) | 345 | (if (featurep 'quail) |
| @@ -444,11 +430,14 @@ delete the text being replaced, as in standard Vi." | |||
| 444 | ;; internal var, used to remember the default cursor color of emacs frames | 430 | ;; internal var, used to remember the default cursor color of emacs frames |
| 445 | (defvar viper-vi-state-cursor-color nil) | 431 | (defvar viper-vi-state-cursor-color nil) |
| 446 | 432 | ||
| 447 | (if (fboundp 'make-variable-frame-local) | 433 | ;; Frame-local variables are obsolete from Emacs 22.2 onwards, so we |
| 448 | (dolist (v '(viper-replace-overlay-cursor-color | 434 | ;; do it by hand with viper-frame-value (qv). |
| 449 | viper-insert-state-cursor-color viper-emacs-state-cursor-color | 435 | (when (and (featurep 'xemacs) |
| 450 | viper-vi-state-cursor-color)) | 436 | (fboundp 'make-variable-frame-local)) |
| 451 | (make-variable-frame-local v))) | 437 | (make-variable-frame-local 'viper-replace-overlay-cursor-color) |
| 438 | (make-variable-frame-local 'viper-insert-state-cursor-color) | ||
| 439 | (make-variable-frame-local 'viper-emacs-state-cursor-color) | ||
| 440 | (make-variable-frame-local 'viper-vi-state-cursor-color)) | ||
| 452 | 441 | ||
| 453 | (viper-deflocalvar viper-replace-overlay nil "") | 442 | (viper-deflocalvar viper-replace-overlay nil "") |
| 454 | (put 'viper-replace-overlay 'permanent-local t) | 443 | (put 'viper-replace-overlay 'permanent-local t) |
| @@ -480,19 +469,13 @@ color displays. By default, the delimiters are used only on TTYs." | |||
| 480 | :group 'viper) | 469 | :group 'viper) |
| 481 | 470 | ||
| 482 | ;; XEmacs requires glyphs | 471 | ;; XEmacs requires glyphs |
| 483 | (viper-cond-compile-for-xemacs-or-emacs | 472 | (when (featurep 'xemacs) |
| 484 | (progn ; xemacs | 473 | (or (glyphp viper-replace-region-end-delimiter) |
| 485 | (or (glyphp viper-replace-region-end-delimiter) | 474 | (setq viper-replace-region-end-delimiter |
| 486 | (setq viper-replace-region-end-delimiter | 475 | (make-glyph viper-replace-region-end-delimiter))) |
| 487 | (make-glyph viper-replace-region-end-delimiter))) | 476 | (or (glyphp viper-replace-region-start-delimiter) |
| 488 | (or (glyphp viper-replace-region-start-delimiter) | 477 | (setq viper-replace-region-start-delimiter |
| 489 | (setq viper-replace-region-start-delimiter | 478 | (make-glyph viper-replace-region-start-delimiter)))) |
| 490 | (make-glyph viper-replace-region-start-delimiter))) | ||
| 491 | ) | ||
| 492 | nil ; emacs | ||
| 493 | ) | ||
| 494 | |||
| 495 | |||
| 496 | 479 | ||
| 497 | ;; These are local marker that must be initialized to nil and moved with | 480 | ;; These are local marker that must be initialized to nil and moved with |
| 498 | ;; `viper-move-marker-locally' | 481 | ;; `viper-move-marker-locally' |