summaryrefslogtreecommitdiff
path: root/lisp/emulation
diff options
context:
space:
mode:
authorMichael Kifer <kifer@cs.stonybrook.edu>2005-10-06 00:09:49 +0000
committerMichael Kifer <kifer@cs.stonybrook.edu>2005-10-06 00:09:49 +0000
commite2de3a29450c31966bcb8336c1f52b2ad495298a (patch)
treeb0eabde48df09afaec7eb3f7ec30876c0711196b /lisp/emulation
parent20ef86730cca82a1a2e212a665c0b119ed2d70b2 (diff)
downloademacs-e2de3a29450c31966bcb8336c1f52b2ad495298a.tar.gz
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
* ediff-merge.el (ediff-merge-region-is-non-clash): new defsubst. (ediff-merge-region-is-non-clash-to-skip): previouslu called ediff-merge-region-is-non-clash. * ediff-mult.el (ediff-append-custom-diff,ediff-meta-show-patch): use insert-buffer-substring. * ediff-ptch.el (ediff-fixup-patch-map): use better heuristics for selecting files to patch. Also bug fixes. * ediff-util.el (ediff-setup): bug fix. (ediff-next-difference): Never skip clashes that differ in white space only. * ediff-wind.el (ediff-setup-control-frame,ediff-destroy-control-frame): check the menubar feature. * viper-cmd.el (viper-normalize-minor-mode-map-alist, viper-refresh-mode-line): use make-local-variable to localize some vars instead of make-variable-buffer-local. Suggested by Stefan Monnier. * viper-init.el (viper-make-variable-buffer-local): delete alias. (viper-restore-cursor-type,viper-set-insert-cursor-type): use make-local-variable instead of make-variable-buffer-local. Suggested by Stefan Monnier. * viper.el (viper-mode): don't use viper-make-variable-buffer-local. (viper-comint-mode-hook): use make-local-variable on require-final-newline. (viper-non-hook-settings): don't use make-variable-buffer-local.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/viper-cmd.el23
-rw-r--r--lisp/emulation/viper-init.el17
-rw-r--r--lisp/emulation/viper.el30
3 files changed, 28 insertions, 42 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 398c47d4784..08ebbbcc9d0 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -494,13 +494,20 @@
viper-empty-keymap))
))
- ;; in emacs with emulation-mode-map-alists, nothing needs to be done
+ ;; This var is not local in Emacs, so we make it local. It must be local
+ ;; because although the stack of minor modes can be the same for all buffers,
+ ;; the associated *keymaps* can be different. In Viper,
+ ;; viper-vi-local-user-map, viper-insert-local-user-map, and others can have
+ ;; different keymaps for different buffers. Also, the keymaps associated
+ ;; with viper-vi/insert-state-modifier-minor-mode can be different.
+ ;; ***This is needed only in case emulation-mode-map-alists is not defined.
+ ;; In emacs with emulation-mode-map-alists, nothing needs to be done
(unless
(and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
- (setq minor-mode-map-alist
- (viper-append-filter-alist
- (append viper--intercept-key-maps viper--key-maps)
- minor-mode-map-alist)))
+ (set (make-local-variable 'minor-mode-map-alist)
+ (viper-append-filter-alist
+ (append viper--intercept-key-maps viper--key-maps)
+ minor-mode-map-alist)))
)
@@ -509,7 +516,7 @@
;; Modifies mode-line-buffer-identification.
(defun viper-refresh-mode-line ()
- (setq viper-mode-string
+ (set (make-local-variable 'viper-mode-string)
(cond ((eq viper-current-state 'emacs-state) viper-emacs-state-id)
((eq viper-current-state 'vi-state) viper-vi-state-id)
((eq viper-current-state 'replace-state) viper-replace-state-id)
@@ -4781,7 +4788,7 @@ sensitive for VI-style look-and-feel."
level-changed t)
(insert "
Please specify your level of familiarity with the venomous VI PERil
-(and the VI Plan for Emacs Rescue).
+\(and the VI Plan for Emacs Rescue).
You can change it at any time by typing `M-x viper-set-expert-level RET'
1 -- BEGINNER: Almost all Emacs features are suppressed.
@@ -5000,5 +5007,5 @@ Mail anyway (y or n)? ")
-;;; arch-tag: 739a6450-5fda-44d0-88b0-325053d888c2
+;; arch-tag: 739a6450-5fda-44d0-88b0-325053d888c2
;;; viper-cmd.el ends here
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 8aa7e4649d4..33713e8a869 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -115,11 +115,6 @@ In all likelihood, you don't need to bother with this setting."
;;; Macros
-;; Fool the compiler to avoid warnings.
-;; Viper calls make-variable-buffer-local from within other functions, which
-;; triggers compiler warnings.
-(defalias 'viper-make-variable-buffer-local 'make-variable-buffer-local)
-
(defmacro viper-deflocalvar (var default-value &optional documentation)
`(progn
(defvar ,var ,default-value
@@ -1019,19 +1014,19 @@ Should be set in `~/.viper' file."
(defun viper-restore-cursor-type ()
(condition-case nil
(if viper-xemacs-p
- (setq bar-cursor nil)
+ (set (make-local-variable 'bar-cursor) nil)
(setq cursor-type default-cursor-type))
(error nil)))
(defun viper-set-insert-cursor-type ()
(if viper-xemacs-p
- (setq bar-cursor 2)
+ (set (make-local-variable 'bar-cursor) 2)
(setq cursor-type '(bar . 2))))
-;;; Local Variables:
-;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
-;;; End:
+;; Local Variables:
+;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
+;; End:
-;;; arch-tag: 4efa2416-1fcb-4690-be10-1a2a0248d250
+;; arch-tag: 4efa2416-1fcb-4690-be10-1a2a0248d250
;;; viper-init.el ends here
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index b3fd6d139c0..a361469382e 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -9,7 +9,7 @@
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;; Keywords: emulations
-(defconst viper-version "3.11.5 of September 19, 2005"
+(defconst viper-version "3.11.5 of October 5, 2005"
"The current version of Viper")
;; This file is part of GNU Emacs.
@@ -605,8 +605,6 @@ This startup message appears whenever you load Viper, unless you type `y' now."
))
(viper-set-expert-level 'dont-change-unless)))
- (if viper-xemacs-p
- (viper-make-variable-buffer-local 'bar-cursor))
(if (eq major-mode 'viper-mode)
(setq major-mode 'fundamental-mode))
@@ -627,8 +625,8 @@ This startup message appears whenever you load Viper, unless you type `y' now."
;; This hook designed to enable Vi-style editing in comint-based modes."
(defun viper-comint-mode-hook ()
- (setq require-final-newline nil
- viper-ex-style-editing nil
+ (set (make-local-variable 'require-final-newline) nil)
+ (setq viper-ex-style-editing nil
viper-ex-style-motion nil)
(viper-change-state-to-insert))
@@ -1000,17 +998,6 @@ It also can't undo some Viper settings."
;; these are primarily advices and Vi-ish variable settings
(defun viper-non-hook-settings ()
- ;; This var is not local in Emacs, so we make it local. It must be local
- ;; because although the stack of minor modes can be the same for all buffers,
- ;; the associated *keymaps* can be different. In Viper,
- ;; viper-vi-local-user-map, viper-insert-local-user-map, and others can have
- ;; different keymaps for different buffers. Also, the keymaps associated
- ;; with viper-vi/insert-state-modifier-minor-mode can be different.
- ;; ***This is needed only in case emulation-mode-map-alists is not defined
- (unless
- (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
- (viper-make-variable-buffer-local 'minor-mode-map-alist))
-
;; Viper changes the default mode-line-buffer-identification
(setq-default mode-line-buffer-identification '(" %b"))
@@ -1018,8 +1005,6 @@ It also can't undo some Viper settings."
(setq next-line-add-newlines nil
require-final-newline t)
- (viper-make-variable-buffer-local 'require-final-newline)
-
;; don't bark when mark is inactive
(if viper-emacs-p
(setq mark-even-if-inactive t))
@@ -1027,7 +1012,6 @@ It also can't undo some Viper settings."
(setq scroll-step 1)
;; Variable displaying the current Viper state in the mode line.
- (viper-deflocalvar viper-mode-string viper-emacs-state-id)
(or (memq 'viper-mode-string global-mode-string)
(setq global-mode-string
(append '("" viper-mode-string) (cdr global-mode-string))))
@@ -1336,9 +1320,9 @@ These two lines must come in the order given.
(provide 'viper)
-;;; Local Variables:
-;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
-;;; End:
+;; Local Variables:
+;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
+;; End:
-;;; arch-tag: 5f3e844c-c4e6-4bbd-9b73-63bdc14e7d79
+;; arch-tag: 5f3e844c-c4e6-4bbd-9b73-63bdc14e7d79
;;; viper.el ends here