aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/crisp.el2
-rw-r--r--lisp/emulation/cua-base.el64
-rw-r--r--lisp/emulation/cua-gmrk.el10
-rw-r--r--lisp/emulation/cua-rect.el34
-rw-r--r--lisp/emulation/edt-lk201.el2
-rw-r--r--lisp/emulation/edt-pc.el2
-rw-r--r--lisp/emulation/edt.el96
-rw-r--r--lisp/emulation/keypad.el12
-rw-r--r--lisp/emulation/pc-select.el12
-rw-r--r--lisp/emulation/vi.el40
-rw-r--r--lisp/emulation/vip.el24
-rw-r--r--lisp/emulation/viper-cmd.el28
-rw-r--r--lisp/emulation/viper-ex.el210
-rw-r--r--lisp/emulation/viper-init.el2
-rw-r--r--lisp/emulation/viper-keym.el70
-rw-r--r--lisp/emulation/viper-macs.el160
-rw-r--r--lisp/emulation/viper-mous.el76
-rw-r--r--lisp/emulation/viper-util.el178
-rw-r--r--lisp/emulation/viper.el184
-rw-r--r--lisp/emulation/ws-mode.el30
20 files changed, 618 insertions, 618 deletions
diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el
index 13aa47c766..8a5410d48a 100644
--- a/lisp/emulation/crisp.el
+++ b/lisp/emulation/crisp.el
@@ -338,7 +338,7 @@ consecutive use moves point to the end of the buffer."
"Go back one buffer."
(interactive)
(switch-to-buffer (car (last (buffer-list)))))
-
+
(defun crisp-meta-x-wrapper ()
"Wrapper function to conditionally override the normal M-x bindings.
When `crisp-override-meta-x' is non-nil, M-x will exit Emacs (the
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 8a2efcc8b0..24f4e5e946 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -54,7 +54,7 @@
;; This probably sounds strange and difficult to get used to - but
;; based on my own experience and the feedback from many users of
;; this package, it actually works very well and users adapt to it
-;; instantly - or at least very quickly. So give it a try!
+;; instantly - or at least very quickly. So give it a try!
;; ... and in the few cases where you make a mistake and accidentally
;; delete the region - you just undo the mistake (with C-z).
;;
@@ -120,15 +120,15 @@
;; --------------------
;; Emacs' standard register support is also based on a separate set of
;; "register commands".
-;;
+;;
;; CUA's register support is activated by providing a numeric
;; prefix argument to the C-x, C-c, and C-v commands. For example,
;; to copy the selected region to register 2, enter [M-2 C-c].
;; Or if you have activated the keypad prefix mode, enter [kp-2 C-c].
-;;
+;;
;; And CUA will copy and paste normal region as well as rectangles
;; into the registers, i.e. you use exactly the same command for both.
-;;
+;;
;; In addition, the last highlighted text that is deleted (not
;; copied), e.g. by [delete] or by typing text over a highlighted
;; region, is automatically saved in register 0, so you can insert it
@@ -140,7 +140,7 @@
;; between the mark and point as a "virtual rectangle", and using a
;; completely separate set of "rectangle commands" [C-x r ...] on the
;; region to copy, kill, fill a.s.o. the virtual rectangle.
-;;
+;;
;; cua-mode's superior rectangle support is based on using a true visual
;; representation of the selected rectangle. To start a rectangle, use
;; [S-return] and extend it using the normal movement keys (up, down,
@@ -154,12 +154,12 @@
;; the rectangle is inserted into the existing lines in the buffer.
;; If overwrite-mode is active when you paste a rectangle, it is
;; inserted as normal (multi-line) text.
-;;
+;;
;; Furthermore, cua-mode's rectangles are not limited to the actual
;; contents of the buffer, so if the cursor is currently at the end of a
;; short line, you can still extend the rectangle to include more columns
;; of longer lines in the same rectangle. Sounds strange? Try it!
-;;
+;;
;; You can enable padding for just this rectangle by pressing [M-p];
;; this works like entering `picture-mode' where the tabs and spaces
;; are automatically converted/inserted to make the rectangle truly
@@ -185,7 +185,7 @@
;; paragraph like this one, just place the cursor on the first character
;; of the first line, and enter the following:
;; S-return M-} ; ; <space> S-return
-
+
;; cua-mode's rectangle support also includes all the normal rectangle
;; functions with easy access:
;;
@@ -202,7 +202,7 @@
;; [M-m] copies the rectangle as normal multi-line text (for paste)
;; [M-n] fills each line of the rectangle with increasing numbers using
;; a supplied format string (prompt)
-;; [M-o] opens the rectangle by moving the highlighted text to the
+;; [M-o] opens the rectangle by moving the highlighted text to the
;; right of the rectangle and filling the rectangle with blanks.
;; [M-p] toggles rectangle padding, i.e. insert tabs and spaces to
;; make rectangles truly rectangular
@@ -222,14 +222,14 @@
;; are lost, but can be recovered using [C-z].
;; CUA Global Mark
-;; ---------------
+;; ---------------
;; The final feature provided by CUA is the "global mark", which
;; makes it very easy to copy bits and pieces from the same and other
;; files into the current text. To enable and cancel the global mark,
;; use [S-C-space]. The cursor will blink when the global mark
;; is active. The following commands behave differently when the global
;; mark is set:
-;; <ch> All characters (including newlines) you type are inserted
+;; <ch> All characters (including newlines) you type are inserted
;; at the global mark!
;; [C-x] If you cut a region or rectangle, it is automatically inserted
;; at the global mark, and the global mark is advanced.
@@ -289,7 +289,7 @@ If the value is t, these mappings are always enabled. If the value is
'shift, these keys are only enabled if the last region was marked with
a shifted movement key. If the value is nil, these keys are never
enabled."
- :type '(choice (const :tag "Disabled" nil)
+ :type '(choice (const :tag "Disabled" nil)
(const :tag "Shift region only" shift)
(other :tag "Enabled" t))
:group 'cua)
@@ -303,7 +303,7 @@ is not turned on."
:type 'boolean
:group 'cua)
-(defcustom cua-prefix-override-inhibit-delay
+(defcustom cua-prefix-override-inhibit-delay
(if (featurep 'lisp-float-type) (/ (float 1) (float 5)) nil)
"*If non-nil, time in seconds to delay before overriding prefix key.
If there is additional input within this time, the prefix key is
@@ -325,12 +325,12 @@ If the value is nil, use a shifted prefix key to inhibit the override."
(defcustom cua-enable-register-prefix 'not-ctrl-u
"*If non-nil, registers are supported via numeric prefix arg.
If the value is t, any numeric prefix arg in the range 0 to 9 will be
-interpreted as a register number.
+interpreted as a register number.
If the value is not-ctrl-u, using C-u to enter a numeric prefix is not
-interpreted as a register number.
+interpreted as a register number.
If the value is ctrl-u-only, only numeric prefix entered with C-u is
interpreted as a register number."
- :type '(choice (const :tag "Disabled" nil)
+ :type '(choice (const :tag "Disabled" nil)
(const :tag "Enabled, but C-u arg is not a register" not-ctrl-u)
(const :tag "Enabled, but only for C-u arg" ctrl-u-only)
(other :tag "Enabled" t))
@@ -404,7 +404,7 @@ Can be toggled by [M-p] while the rectangle is active,"
:type 'boolean
:group 'cua)
-(defface cua-global-mark-face '((((class color))
+(defface cua-global-mark-face '((((class color))
(:foreground "black")
(:background "yellow"))
(t (:bold t)))
@@ -576,7 +576,7 @@ Will change cursor color to specified color if string."
(not (numberp cua-prefix-override-inhibit-delay))
(<= cua-prefix-override-inhibit-delay 0)
;; In state [1], start [T] and change to state [2]
- (run-with-timer cua-prefix-override-inhibit-delay nil
+ (run-with-timer cua-prefix-override-inhibit-delay nil
'cua--prefix-override-timeout)))
;; Don't record this command
(setq this-command last-command)
@@ -604,7 +604,7 @@ Repeating prefix key when region is active works as a single prefix key."
(cua-copy-rectangle arg)
(cua-copy-region arg))
(let ((keys (this-single-command-keys)))
- (setq unread-command-events
+ (setq unread-command-events
(cons (aref keys (1- (length keys))) unread-command-events))))
(defun cua--prefix-cut-handler (arg)
@@ -614,7 +614,7 @@ Repeating prefix key when region is active works as a single prefix key."
(cua-cut-rectangle arg)
(cua-cut-region arg))
(let ((keys (this-single-command-keys)))
- (setq unread-command-events
+ (setq unread-command-events
(cons (aref keys (1- (length keys))) unread-command-events))))
(defun cua--prefix-override-timeout ()
@@ -633,7 +633,7 @@ Repeating prefix key when region is active works as a single prefix key."
;; Execute original command
(setq this-command this-original-command)
(call-interactively this-command))
-
+
(defun cua--keep-active ()
(setq mark-active t
deactivate-mark nil))
@@ -650,13 +650,13 @@ Repeating prefix key when region is active works as a single prefix key."
(defvar cua--register nil)
(defun cua--prefix-arg (arg)
- (setq cua--register
+ (setq cua--register
(and cua-enable-register-prefix
(integerp arg) (>= arg 0) (< arg 10)
(let* ((prefix (aref (this-command-keys) 0))
(ctrl-u-prefix (and (integerp prefix)
(= prefix ?\C-u))))
- (cond
+ (cond
((eq cua-enable-register-prefix 'not-ctrl-u)
(not ctrl-u-prefix))
((eq cua-enable-register-prefix 'ctrl-u-only)
@@ -691,7 +691,7 @@ Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
(if cua-delete-copy-to-register-0
(set-register ?0 cua--last-deleted-region-text))
(delete-region start end)
- (setq cua--last-deleted-region-pos
+ (setq cua--last-deleted-region-pos
(cons (current-buffer)
(and (consp buffer-undo-list)
(car buffer-undo-list))))
@@ -861,7 +861,7 @@ of text."
(defun cua-help-for-region (&optional help)
"Show region specific help in echo area."
(interactive)
- (message
+ (message
(concat (if help "C-?:help " "")
"C-z:undo C-x:cut C-c:copy C-v:paste S-ret:rect")))
@@ -959,7 +959,7 @@ Extra commands should be added to `cua-user-movement-commands'")
(unless mark-active
(push-mark-command nil nil)))
(t
- ;; If we set mark-active to nil here, the region highlight will not be
+ ;; If we set mark-active to nil here, the region highlight will not be
;; removed by the direct_output_ commands.
(setq deactivate-mark t)))
@@ -969,7 +969,7 @@ Extra commands should be added to `cua-user-movement-commands'")
(get this-command 'pending-delete)))
(nc (cond
((not ds) nil)
- ((eq ds 'yank)
+ ((eq ds 'yank)
'cua-paste)
((eq ds 'kill)
(if cua--rectangle
@@ -986,9 +986,9 @@ Extra commands should be added to `cua-user-movement-commands'")
(if nc
(setq this-original-command this-command
this-command nc)))))
-
+
;; Detect extension of rectangles by mouse or other movement
- (setq cua--buffer-and-point-before-command
+ (setq cua--buffer-and-point-before-command
(if cua--rectangle (cons (current-buffer) (point))))
)
(error nil)))
@@ -1008,7 +1008,7 @@ Extra commands should be added to `cua-user-movement-commands'")
;; Debugging
(if cua--debug
- (cond
+ (cond
(cua--rectangle (cua--rectangle-assert))
(mark-active (message "Mark=%d Point=%d Expl=%s"
(mark t) (point) cua--explicit-region-start))))
@@ -1123,7 +1123,7 @@ Extra commands should be added to `cua-user-movement-commands'")
(define-key cua--prefix-override-keymap [(control x)] 'cua--prefix-override-handler)
(define-key cua--prefix-override-keymap [(control c)] 'cua--prefix-override-handler)
-
+
(define-key cua--prefix-repeat-keymap [(control x) (control x)] 'cua--prefix-repeat-handler)
(define-key cua--prefix-repeat-keymap [(control x) up] 'cua--prefix-cut-handler)
(define-key cua--prefix-repeat-keymap [(control x) down] 'cua--prefix-cut-handler)
@@ -1135,7 +1135,7 @@ Extra commands should be added to `cua-user-movement-commands'")
(define-key cua--prefix-repeat-keymap [(control c) left] 'cua--prefix-copy-handler)
(define-key cua--prefix-repeat-keymap [(control c) right] 'cua--prefix-copy-handler)
- ;; Enable shifted fallbacks for C-x and C-c when region is active
+ ;; Enable shifted fallbacks for C-x and C-c when region is active
(define-key cua--region-keymap [(shift control x)] 'Control-X-prefix)
(define-key cua--region-keymap [(shift control c)] 'mode-specific-command-prefix)
;; replace current region
diff --git a/lisp/emulation/cua-gmrk.el b/lisp/emulation/cua-gmrk.el
index 5e482ee8d2..4055fb2b1c 100644
--- a/lisp/emulation/cua-gmrk.el
+++ b/lisp/emulation/cua-gmrk.el
@@ -33,7 +33,7 @@
(require 'cua-rect)
)
-;;; Global Marker
+;;; Global Marker
;; Non-nil when global marker is active.
(defvar cua--global-mark-active nil)
@@ -72,12 +72,12 @@
(move-marker cua--global-mark-marker (point))
(if (overlayp cua--global-mark-overlay)
(move-overlay cua--global-mark-overlay (point) (1+ (point)))
- (setq cua--global-mark-overlay
+ (setq cua--global-mark-overlay
(make-overlay (point) (1+ (point))))
(overlay-put cua--global-mark-overlay 'face 'cua-global-mark-face))
(if (and cua-global-mark-blink-cursor-interval
(not cua--orig-blink-cursor-interval))
- (setq cua--orig-blink-cursor-interval blink-cursor-interval
+ (setq cua--orig-blink-cursor-interval blink-cursor-interval
blink-cursor-interval cua-global-mark-blink-cursor-interval))
(setq cua--global-mark-active t)
(if msg
@@ -325,7 +325,7 @@ With prefix argument, don't jump to global mark when cancelling it."
(move-to-column col)
(move-marker cua--global-mark-marker (point))
(move-overlay cua--global-mark-overlay (point) (1+ (point))))))))
-
+
(defun cua-cancel-global-mark ()
"Cancel the global mark."
@@ -346,7 +346,7 @@ With prefix argument, don't jump to global mark when cancelling it."
(if (or (not (eq (current-buffer) (marker-buffer cua--global-mark-marker)))
(not (pos-visible-in-window-p (marker-position cua--global-mark-marker))))
(let ((w (selected-window)) (p (point)) h)
- ;; The following code is an attempt to keep the global mark visible in
+ ;; The following code is an attempt to keep the global mark visible in
;; other window -- but it doesn't work.
(switch-to-buffer-other-window (marker-buffer cua--global-mark-marker) t)
(goto-char (marker-position cua--global-mark-marker))
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index a0663d93d2..47b315d062 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -88,7 +88,7 @@ Knows about CUA rectangle highlighting in addition to standard undo."
(let ((l cua--undo-list))
(while l
(if (eq (car (car l)) pending-undo-list)
- (setq cua--restored-rectangle
+ (setq cua--restored-rectangle
(and (vectorp (cdr (car l))) (cdr (car l)))
l nil)
(setq l (cdr l)))))
@@ -126,7 +126,7 @@ Knows about CUA rectangle highlighting in addition to standard undo."
(setcdr cul nil))
(setq cua--tidy-undo-counter (1+ cua--tidy-undo-counter))
(if cua--debug
- (message "Clean undo list in %s (%d)"
+ (message "Clean undo list in %s (%d)"
(buffer-name) cc)))))))
(setq buffers (cdr buffers)))
(/= cnt cua--tidy-undo-counter)))
@@ -176,7 +176,7 @@ Knows about CUA rectangle highlighting in addition to standard undo."
(let ((c (aref cua--rectangle 4)))
(if (not (integerp advance))
c
- (aset cua--rectangle 4
+ (aset cua--rectangle 4
(if (= advance 0)
(- 3 c) ; opposite corner
(mod (+ c 4 advance) 4)))
@@ -302,9 +302,9 @@ Knows about CUA rectangle highlighting in addition to standard undo."
(cua--rectangle-right (1+ (cua--rectangle-right)))
(move-to-column (cua--rectangle-right) pad))
((cua--rectangle-right-side)
- (forward-char 1)
+ (forward-char 1)
(cua--rectangle-right (current-column)))
- ((or pad (eolp))
+ ((or pad (eolp))
(cua--rectangle-left (1+ (cua--rectangle-left)))
(move-to-column (cua--rectangle-right) pad))
(t
@@ -666,8 +666,8 @@ If command is repeated at same position, delete the rectangle."
;; Turn on rectangular marking mode by disabling transient mark mode
;; and manually handling highlighting from a post command hook.
;; Be careful if we are already marking a rectangle.
- (setq cua--rectangle
- (if (and cua--last-rectangle
+ (setq cua--rectangle
+ (if (and cua--last-rectangle
(eq (car cua--last-rectangle) (current-buffer))
(eq (car (cdr cua--last-rectangle)) (point)))
(cdr (cdr cua--last-rectangle))
@@ -684,7 +684,7 @@ If command is repeated at same position, delete the rectangle."
(defun cua--deactivate-rectangle ()
;; This is used to clean up after `cua--activate-rectangle'.
(mapcar (function delete-overlay) cua--rectangle-overlays)
- (setq cua--last-rectangle (cons (current-buffer)
+ (setq cua--last-rectangle (cons (current-buffer)
(cons (point) ;; cua-save-point
cua--rectangle))
cua--rectangle nil
@@ -827,7 +827,7 @@ With prefix argument, the toggle restriction."
(cua--rectangle-restriction (car r) t (not (car (cdr (cdr r)))))
(cua--rectangle-restriction "" nil nil))
(cua--rectangle-restriction
- (format "[%c]"
+ (format "[%c]"
(read-char "Restrictive rectangle (char): ")) t arg))))
(defun cua-move-rectangle-up ()
@@ -1040,7 +1040,7 @@ The length of STRING need not be the same as the rectangle width."
(defun cua-sequence-rectangle (first incr fmt)
"Resequence each line of CUA rectangle starting from FIRST.
The numbers are formatted according to the FORMAT string."
- (interactive
+ (interactive
(list (if current-prefix-arg
(prefix-numeric-value current-prefix-arg)
(string-to-number
@@ -1169,7 +1169,7 @@ With prefix arg, replace rectangle with output from command."
(interactive (list
current-prefix-arg
(read-from-minibuffer "Shell command on rectangle: "
- nil nil nil
+ nil nil nil
'shell-command-history)))
(cua--rectangle-aux-replace -1 t t replace 1
'(lambda (s e)
@@ -1185,7 +1185,7 @@ With prefix arg, replace rectangle with output from command."
"Remove the first line of the rectangle and scroll remaining lines up."
(interactive)
(cua--rectangle-aux-replace 0 t t t t
- '(lambda (s e)
+ '(lambda (s e)
(if (= (forward-line 1) 0)
(delete-region s (point))))))
@@ -1225,7 +1225,7 @@ With prefix arg, indent to that column."
indent)
(cua--rectangle-operation 'corners nil t pad
'(lambda (s e l r)
- (move-to-column
+ (move-to-column
(if (cua--rectangle-right-side t)
(max (1+ r) col) l)
pad)
@@ -1243,9 +1243,9 @@ With prefix arg, indent to that column."
(defun cua-help-for-rectangle (&optional help)
(interactive)
(let ((M (if cua-use-hyper-key " H-" " M-")))
- (message
+ (message
(concat (if help "C-?:help" "")
- M "p:pad" M "o:open" M "c:close" M "b:blank"
+ M "p:pad" M "o:open" M "c:close" M "b:blank"
M "s:string" M "f:fill" M "i:incr" M "n:seq"))))
@@ -1273,7 +1273,7 @@ With prefix arg, indent to that column."
(cua--rectangle-bot t)
(cua--rectangle-top t))
(if (cua--rectangle-padding)
- (setq unread-command-events
+ (setq unread-command-events
(cons (if cua-use-hyper-key ?\H-P ?\M-P) unread-command-events)))))
(if cua--rectangle
(if (and mark-active
@@ -1333,7 +1333,7 @@ With prefix arg, indent to that column."
(define-key cua--rectangle-keymap [remap backward-delete-char-untabify] 'cua-delete-char-rectangle)
(define-key cua--rectangle-keymap [remap self-insert-command] 'cua-insert-char-rectangle)
(define-key cua--rectangle-keymap [remap self-insert-iso] 'cua-insert-char-rectangle)
-
+
;; Catch self-inserting characters which are "stolen" by other modes
(define-key cua--rectangle-keymap [t]
'(menu-item "sic" cua-insert-char-rectangle :filter cua--self-insert-char-p))
diff --git a/lisp/emulation/edt-lk201.el b/lisp/emulation/edt-lk201.el
index cdbe34060a..6afadd6c16 100644
--- a/lisp/emulation/edt-lk201.el
+++ b/lisp/emulation/edt-lk201.el
@@ -43,7 +43,7 @@
;;; Code:
(defconst *EDT-keys*
- '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3])
+ '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3])
("KP4" . [kp-4]) ("KP5" . [kp-5]) ("KP6" . [kp-6]) ("KP7" . [kp-7])
("KP8" . [kp-8]) ("KP9" . [kp-9]) ("KP," . [kp-separator])
("KP-" . [kp-subtract]) ("KPP" . [kp-decimal]) ("KPE" . [kp-enter])
diff --git a/lisp/emulation/edt-pc.el b/lisp/emulation/edt-pc.el
index 2b6aa25b06..30e1b53546 100644
--- a/lisp/emulation/edt-pc.el
+++ b/lisp/emulation/edt-pc.el
@@ -72,7 +72,7 @@
;;; Code:
(defconst *EDT-keys*
- '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3])
+ '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3])
("KP4" . [kp-4]) ("KP5" . [kp-5]) ("KP6" . [kp-6]) ("KP7" . [kp-7])
("KP8" . [kp-8]) ("KP9" . [kp-9]) ("KP," . "" )
("KP-" . [kp-add]) ("KPP" . [kp-decimal]) ("KPE" . [kp-enter])
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index ecb53bdffb..427a803da8 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -27,7 +27,7 @@
;;; Commentary:
-;;
+;;
;; This is Version 4.0 of the EDT Emulation for Emacs 19 and above.
;; It comes with special functions which replicate nearly all of EDT's
@@ -41,10 +41,10 @@
;; Getting Started:
-;; To start the EDT Emulation, first start Emacs and then enter
+;; To start the EDT Emulation, first start Emacs and then enter
;;
;; M-x edt-emulation-on
-;;
+;;
;; to begin the emulation. After initialization is complete, the
;; following message will appear below the status line informing you
;; that the emulation has been enabled: "Default EDT keymap active".
@@ -59,13 +59,13 @@
;; Emacs "etc" directory. It contains very helpful user information.
;; The EDT emulation consists of the following files:
-;;
+;;
;; edt-user.doc - User Instructions and Sample Customization File
;; edt.el - EDT Emulation Functions and Default Configuration
;; edt-lk201.el - Built-in support for DEC LK-201 Keyboards
;; edt-vt100.el - Built-in support for DEC VT-100 (and above) terminals
;; edt-pc.el - Built-in support for PC 101 Keyboards under MS-DOS
-;; edt-mapper.el - Create an EDT LK-201 Map File for Keyboards Without
+;; edt-mapper.el - Create an EDT LK-201 Map File for Keyboards Without
;; Built-in Support
;; Enhancements:
@@ -81,7 +81,7 @@
;; following line
;;
;; (edt-set-scroll-margins "20%" "25%")
-;;
+;;
;; sets the top margin to 20% of the window and the bottom margin
;; to 25% of the window. To disable this feature, set each
;; margin to 0%. You can also invoke edt-set-scroll-margins
@@ -91,13 +91,13 @@
;; NOTE: Another way to set the scroll margins is to use the
;; Emacs customization feature (not available in Emacs 19) to set
;; the following two variables directly:
-;;
+;;
;; edt-top-scroll-margin and edt-bottom-scroll-margin
;;
;; Enter the Emacs `customize' command. First select the Editing
;; group and then select the Emulations group. Finally, select
;; the Edt group and follow the directions.
-;;
+;;
;; 2. The SUBS command is now supported and bound to GOLD-Enter by
;; default. (This design was copied from tpu-edt.el.) Note, in
;; earlier versions of EDT Emulation, GOLD-Enter was assigned to
@@ -149,9 +149,9 @@
;;; History:
-;;
+;;
;; Version 4.0 2000 Added New Features and Fixed a Few Bugs
-;;
+;;
;;; Code:
@@ -198,7 +198,7 @@ setting replicates EDT's page delimiter behavior. The original value
is restored when edt-emulation-off is called."
:type 'boolean
:group 'edt)
-
+
(defcustom edt-use-EDT-control-key-bindings nil
"*Emacs MUST be restarted for a change in value to take effect!
Non-nil causes the control key bindings to be replaced with EDT
@@ -209,7 +209,7 @@ use within the EDT emulation."
:group 'edt)
(defcustom edt-word-entities '(?\t)
- "*Specifies the list of EDT word entity characters.
+ "*Specifies the list of EDT word entity characters.
The default list, (\?\\t), contains just the TAB character, which
emulates EDT. Characters are specified in the list using their
decimal ASCII values. A question mark, followed by the actual
@@ -402,7 +402,7 @@ Argument NUM is the number of page delimiters to move."
;;; EDT defaults a section size to be 16 lines of its one and only
;;; 24-line window. That's two-thirds of the window at a time. The
;;; EDT SECT commands moves the cursor, not the window.
-;;;
+;;;
;;; This emulation of EDT's SECT moves the cursor approximately
;;; two-thirds of the current window at a time.
@@ -491,7 +491,7 @@ Argument NUM is the number of EOL marks to move."
;;; This one is a tad messy. To emulate EDT's behavior everywhere in
;;; the file (beginning of file, end of file, beginning of line, end
;;; of line, etc.) it takes a bit of special handling.
-;;;
+;;;
;;; The variable edt-word-entities contains a list of characters which
;;; are to be viewed as distinct words where ever they appear in the
;;; buffer. This emulates the EDT line mode command SET ENTITY WORD.
@@ -729,7 +729,7 @@ Optional argument FIND is t if this function is called from `edt-find'."
(if (equal edt-direction-string edt-forward-string)
(edt-find-forward t)
(edt-find-backward t)))
-
+
;;;
;;; FNDNXT
@@ -798,7 +798,7 @@ Optional argument FIND is t if this function is called from `edt-find'."
(if (equal edt-direction-string edt-forward-string)
(edt-find-next-forward)
(edt-find-next-backward)))
-
+
;;;
;;; APPEND
;;;
@@ -1008,7 +1008,7 @@ Argument NUM is the number of characters to delete."
(defun edt-substitute (num)
"Replace the selected region with the contents of the CUT buffer and.
Repeat the most recent FIND command. (The Emacs kill ring is used as
-the CUT buffer.)
+the CUT buffer.)
Argument NUM is the repeat count. A positive value indicates the of times
to repeat the substitution. A negative argument means replace all occurrences
of the search text."
@@ -1087,7 +1087,7 @@ Also, execute command specified if in Minibuffer."
(exit-minibuffer))
(if edt-x-emacs19-p (setq zmacs-region-stays t)))
-
+
;;;
;;; BACKUP
;;;
@@ -1205,7 +1205,7 @@ Argument NUM is the number of tabs to insert."
Argument NUM is the prefix value tested."
(if (<= num 0)
(error "Prefix must be positive")))
-
+
;;;
;;; Check Selection
;;;
@@ -1277,7 +1277,7 @@ Argument BOTTOM is the bottom margin in number of lines or percent of window."
;;;; ENHANCEMENTS AND ADDITIONS FOR EDT KEYPAD MODE
;;;;
-;;;
+;;;
;;; Several enhancements and additions to EDT keypad mode commands are
;;; provided here. Some of these have been motivated by similar
;;; TPU/EVE and EVE-Plus commands. Others are new.
@@ -1818,7 +1818,7 @@ Argument NUM is the number of times to duplicate the line."
(save-buffer)
(save-buffers-kill-emacs))
-;;;
+;;;
;;; QUIT
;;;
@@ -1836,9 +1836,9 @@ Warn user that modifications will be lost."
(kill-emacs)
(setq working nil)))
(setq list (cdr list))))
- (if working (kill-emacs))))
+ (if working (kill-emacs))))
-;;;
+;;;
;;; SPLIT WINDOW
;;;
@@ -2024,7 +2024,7 @@ Optional argument NOT-YES changes the default to negative."
;;; Function used to load LK-201 key mapping file generated by edt-mapper.el.
;;;
(defun edt-load-keys (file)
- "Load the LK-201 key mapping FILE generated by edt-mapper.el.
+ "Load the LK-201 key mapping FILE generated by edt-mapper.el.
If FILE is nil, which is the normal case, try to load a default file.
The default file names are based upon the window system, terminal
type, and version of Emacs in use: GNU Emacs or XEmacs (aka Lucid
@@ -2042,7 +2042,7 @@ created."
"~/.edt-" edt-emacs-variant
(if edt-term (concat "-" edt-term))
(if edt-xserver (concat "-" edt-xserver))
- (if edt-window-system
+ (if edt-window-system
(concat "-" (upcase (symbol-name edt-window-system))))
"-keys")))))
(cond ((file-readable-p file)
@@ -2053,7 +2053,7 @@ created."
(insert "
Ack!! You're running the Enhanced EDT Emulation without loading an
- EDT key mapping file. To create an EDT key mapping file, run the
+ EDT key mapping file. To create an EDT key mapping file, run the
edt-mapper.el program. It is safest to run it from an Emacs loaded
without any of your own customizations found in your .emacs file, etc.
The reason for this is that some user customizations confuse edt-mapper.
@@ -2061,7 +2061,7 @@ created."
follows:
emacs -q -l edt-mapper.el
-
+
[NOTE: If you do nothing out of the ordinary in your .emacs file, and
the search for edt-mapper.el is successful, you can try running it now.]
@@ -2412,7 +2412,7 @@ Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>."
'edt-key-not-assigned 'edt-key-not-assigned)
;; Control key bindings: Regular and GOLD
- ;;
+ ;;
;; Standard EDT control key bindings conflict with standard Emacs
;; control key bindings. Normally, the standard Emacs control key
;; bindings are left unchanged in the default EDT mode. However, if
@@ -2578,7 +2578,7 @@ Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>."
G-F9: Paste Rect Insert +----------+----------+----------+----------+
F10: Cut Rectangle
G-F10: Paste Rectangle
- F11: ESC
+ F11: ESC
F12: Begining of Line +----------+----------+----------+----------+
G-F12: Delete Other Windows | GOLD | HELP | FNDNXT | DEL L |
F13: Delete to Begin of Word | (PF1) | (PF2) | (PF3) | (PF4) |
@@ -2600,7 +2600,7 @@ G-C-k: Restore Key | WORD | EOL | CHAR | Next |
C-t: Display the Time | (0) | (.) | SUBS |
C-u: Delete to Begin of Line | Open Line | RESET | |
C-v: Redraw Display +---------------------+----------+----------+
- C-w: Set Screen Width 132
+ C-w: Set Screen Width 132
C-z: Suspend Emacs +----------+----------+----------+
G-C-\\: Split Window | FNDNXT | Yank | CUT |
| (FIND) | (INSERT) | (REMOVE) |
@@ -2610,26 +2610,26 @@ G-C-\\: Split Window | FNDNXT | Yank | CUT |
G-e: Exit | (SELECT) |(PREVIOUS)| (NEXT) |
G-f: Find File | | | |
G-g: Find File Other Window +----------+----------+----------+
- G-h: Keypad Help
- G-i: Insert File
- G-k: Toggle Capitalization Word
- G-l: Downcase Region
- G-m: Save Some Buffers
- G-n: Next Error
+ G-h: Keypad Help
+ G-i: Insert File
+ G-k: Toggle Capitalization Word
+ G-l: Downcase Region
+ G-m: Save Some Buffers
+ G-n: Next Error
G-o: Switch to Next Window
- G-q: Quit
- G-r: Revert File
- G-s: Save Buffer
- G-u: Upcase Region
- G-v: Find File Other Window
- G-w: Write file
- G-y: EDT Emulation OFF
+ G-q: Quit
+ G-r: Revert File
+ G-s: Save Buffer
+ G-u: Upcase Region
+ G-v: Find File Other Window
+ G-w: Write file
+ G-y: EDT Emulation OFF
G-z: Switch to User EDT Key Bindings
- G-1: Delete Other Windows
- G-2: Split Window
- G-%: Go to Percentage
- G- : Undo (GOLD Spacebar)
- G-=: Go to Line
+ G-1: Delete Other Windows
+ G-2: Split Window
+ G-%: Go to Percentage
+ G- : Undo (GOLD Spacebar)
+ G-=: Go to Line
G-`: What line
G-/: Query-Replace"
diff --git a/lisp/emulation/keypad.el b/lisp/emulation/keypad.el
index c638409613..69dc8a3d3b 100644
--- a/lisp/emulation/keypad.el
+++ b/lisp/emulation/keypad.el
@@ -113,7 +113,7 @@ decimal key must be specified."
(character :tag "Numeric Keypad with Decimal Key"
:match (lambda (widget value) (integerp value))
:value ?.)
- (const :tag "Numeric prefix arguments" prefix)
+ (const :tag "Numeric prefix arguments" prefix)
(const :tag "Cursor keys" cursor)
(const :tag "Shifted cursor keys" S-cursor)
(const :tag "Unspecified/User-defined" none)
@@ -136,7 +136,7 @@ decimal key must be specified."
(character :tag "Numeric Keypad with Decimal Key"
:match (lambda (widget value) (integerp value))
:value ?.)
- (const :tag "Numeric prefix arguments" prefix)
+ (const :tag "Numeric prefix arguments" prefix)
(const :tag "Cursor keys" cursor)
(const :tag "Shifted cursor keys" S-cursor)
(const :tag "Unspecified/User-defined" none)
@@ -159,7 +159,7 @@ decimal key must be specified."
(character :tag "Numeric Keypad with Decimal Key"
:match (lambda (widget value) (integerp value))
:value ?.)
- (const :tag "Numeric prefix arguments" prefix)
+ (const :tag "Numeric prefix arguments" prefix)
(const :tag "Cursor keys" cursor)
(const :tag "Shifted cursor keys" S-cursor)
(const :tag "Unspecified/User-defined" none)
@@ -182,7 +182,7 @@ decimal key must be specified."
(character :tag "Numeric Keypad with Decimal Key"
:match (lambda (widget value) (integerp value))
:value ?.)
- (const :tag "Numeric prefix arguments" prefix)
+ (const :tag "Numeric prefix arguments" prefix)
(const :tag "Cursor keys" cursor)
(const :tag "Shifted cursor keys" S-cursor)
(const :tag "Unspecified/User-defined" none)
@@ -244,7 +244,7 @@ the decimal key on the keypad is mapped to DECIMAL instead of `.'"
[delete insert end down next left
space right home up prior])
((eq setup 'S-cursor)
- [S-delete S-insert S-end S-down S-next S-left
+ [S-delete S-insert S-end S-down S-next S-left
S-space S-right S-home S-up S-prior])
((eq setup 'none)
nil)
@@ -268,7 +268,7 @@ the decimal key on the keypad is mapped to DECIMAL instead of `.'"
((eq (aref kp i) 'S-kp-space)
(define-key function-key-map [S-kp-begin]
(if bind (vector (aref bind i)))))))
-
+
(setq i (1+ i)))))
;;; keypad.el ends here
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el
index d9adad9a7e..6b7b7ece9c 100644
--- a/lisp/emulation/pc-select.el
+++ b/lisp/emulation/pc-select.el
@@ -185,7 +185,7 @@ restored to their original values when `pc-selection-mode' is toggled off.")
([C-up] . backward-paragraph-nomark) ; KPrevPara cUp
([S-C-down] . forward-paragraph-mark)
([S-C-up] . backward-paragraph-mark))))
-
+
(setq pc-select-default-key-bindings lst)))
(defvar pc-select-extra-key-bindings nil
@@ -219,7 +219,7 @@ restored to their original values when `pc-selection-mode' is toggled off.")
([C-M-delete] . kill-sexp)
;; Next line proposed by Eli Barzilay
([C-escape] . electric-buffer-list))))
-
+
(setq pc-select-extra-key-bindings lst)))
(defvar pc-select-meta-moves-sexps-key-bindings
@@ -773,7 +773,7 @@ restore the previous value of that key binding from SAVED-MAP."
(defmacro pc-select-add-to-alist (alist var val)
"Ensure that ALIST contains the cons cell (VAR . VAL).
If a cons cell whose car is VAR is already on the ALIST, update the
-cdr of that cell with VAL. Otherwise, make a new cons cell
+cdr of that cell with VAL. Otherwise, make a new cons cell
\(VAR . VAL), and prepend it onto ALIST."
(let ((elt (make-symbol "elt")))
`(let ((,elt (assq ',var ,alist)))
@@ -803,7 +803,7 @@ variable MODE-VAR (instead of the value of the variable MODE) on
(,mode ,arg)))
(defmacro pc-select-restore-var (var)
- "Restore the previous value of the variable VAR.
+ "Restore the previous value of the variable VAR.
Look up VAR's previous value in `pc-select-saved-settings-alist', and,
if the value is found, set VAR to that value."
(let ((elt (make-symbol "elt")))
@@ -919,7 +919,7 @@ but before calling `pc-selection-mode'):
;; (setq-default normal-erase-is-backspace t)
;; However, the documentation for the variable says that
;; "setting it with setq has no effect", so I'm removing it.
-
+
(pc-select-save-and-set-var highlight-nonselected-windows nil)
(pc-select-save-and-set-var transient-mark-mode t)
(pc-select-save-and-set-var mark-even-if-inactive t)
@@ -966,7 +966,7 @@ but before calling `pc-selection-mode'):
pc-select-old-M-delete-binding))
(setq pc-select-key-bindings-alist nil
pc-select-saved-settings-alist nil))))
-
+
;;;###autoload
(defcustom pc-selection-mode nil
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el
index 1509a78601..7ae43c8b16 100644
--- a/lisp/emulation/vi.el
+++ b/lisp/emulation/vi.el
@@ -30,7 +30,7 @@
; (vi-mode))))))
; 3) In your .emacs file you can define the command "vi-mode" to be "autoload"
; or you can execute the "load" command to load "vi" directly.
-; 4) Read the comments for command "vi-mode" before you start using it.
+; 4) Read the comments for command "vi-mode" before you start using it.
;
; COULD DO
; 1). A general 'define-operator' function to replace current hack
@@ -153,7 +153,7 @@ command extensions.")
(define-key vi-com-map "\C-\\" 'vi-unimplemented)
(define-key vi-com-map "\C-]" 'find-tag)
(define-key vi-com-map "\C-^" 'vi-locate-def) ; extension
- (define-key vi-com-map "\C-_" 'vi-undefined)
+ (define-key vi-com-map "\C-_" 'vi-undefined)
(define-key vi-com-map " " 'forward-char)
(define-key vi-com-map "!" 'vi-operator)
@@ -201,7 +201,7 @@ command extensions.")
(define-key vi-com-map "H" 'vi-home-window-line)
(define-key vi-com-map "I" 'vi-insert-before-first-nonwhite)
(define-key vi-com-map "J" 'vi-join-lines)
- (define-key vi-com-map "K" 'vi-undefined)
+ (define-key vi-com-map "K" 'vi-undefined)
(define-key vi-com-map "L" 'vi-last-window-line)
(define-key vi-com-map "M" 'vi-middle-window-line)
(define-key vi-com-map "N" 'vi-reverse-last-search)
@@ -212,7 +212,7 @@ command extensions.")
(define-key vi-com-map "S" 'vi-substitute-lines)
(define-key vi-com-map "T" 'vi-backward-upto-char)
(define-key vi-com-map "U" 'vi-unimplemented)
- (define-key vi-com-map "V" 'vi-undefined)
+ (define-key vi-com-map "V" 'vi-undefined)
(define-key vi-com-map "W" 'vi-forward-blank-delimited-word)
(define-key vi-com-map "X" 'call-last-kbd-macro) ; modification/extension
(define-key vi-com-map "Y" 'vi-yank-line)
@@ -247,7 +247,7 @@ command extensions.")
(define-key vi-com-map "s" 'vi-substitute-chars)
(define-key vi-com-map "t" 'vi-forward-upto-char)
(define-key vi-com-map "u" 'undo)
- (define-key vi-com-map "v" 'vi-verify-spelling)
+ (define-key vi-com-map "v" 'vi-verify-spelling)
(define-key vi-com-map "w" 'vi-forward-word)
(define-key vi-com-map "x" 'vi-kill-char)
(define-key vi-com-map "y" 'vi-operator)
@@ -355,7 +355,7 @@ form that is ready to be `apply'ed.")
"Non-nil if it is in insert state.")
; in "loaddefs.el"
-;(defvar search-last-string ""
+;(defvar search-last-string ""
; "Last string search for by a search command.")
(defvar vi-search-last-command nil ; (re-)search-forward(backward)
@@ -366,12 +366,12 @@ form that is ready to be `apply'ed.")
(defvar vi-mode-old-mode-name nil
"Save the mode-name before entering vi-mode.")
-
+
(defvar vi-mode-old-major-mode nil
"Save the major-mode before entering vi-mode.")
(defvar vi-mode-old-case-fold nil)
-
+
;(defconst vi-add-to-mode-line-1
; '(overwrite-mode nil " Insert"))
@@ -404,7 +404,7 @@ form that is ready to be `apply'ed.")
(make-local-variable 'vi-mode-old-major-mode)
(make-local-variable 'vi-mode-old-case-fold)
(run-hooks 'vi-mode-hook))
-
+
;;;###autoload
(defun vi-mode ()
"Major mode that acts like the `vi' editor.
@@ -448,7 +448,7 @@ Major differences between this mode and real vi :
`vi-name-last-change-or-macro', `vi-verify-spelling', `vi-locate-def',
`vi-mark-region', and 'vi-quote-words'. Some of them are quite handy.
- Use \\[vi-switch-mode] to switch among different modes quickly.
-
+
Syntax table and abbrevs while in vi mode remain as they were in Emacs."
(interactive)
(if (null vi-mode-old-major-mode) ; very first call for current buffer
@@ -539,7 +539,7 @@ This function expects 'overwrite-mode' being set properly beforehand."
(<= vi-ins-repetition 0))
(vi-goto-command-state t)
(if (> vi-ins-repetition 1)
- (progn
+ (progn
(let ((str (buffer-substring vi-ins-point (point))))
(while (> vi-ins-repetition 1)
(insert str)
@@ -585,7 +585,7 @@ insert state."
(interactive "*r")
(kill-region start end)
(vi-set-last-change-command 'kill-region))
-
+
(defun vi-append-at-end-of-line (arg)
"go to end of line and then go into vi insert state."
(interactive "*p")
@@ -651,7 +651,7 @@ insert state."
;;;;;
(defun vi-isearch-forward (arg)
- "Incremental search forward. Use regexp version if ARG is non-nil."
+ "Incremental search forward. Use regexp version if ARG is non-nil."
(interactive "P")
(let ((scmd (if arg 'isearch-forward-regexp 'isearch-forward))
(opoint (point)))
@@ -724,7 +724,7 @@ If the optional search args are given, use those instead of the ones saved."
((eq search-command 'search-forward) 'search-backward)
((eq search-command 'search-backward) 'search-forward))
search-string nil nil arg)))
-
+
(defun vi-join-lines (arg)
"join ARG lines from current line (default 2), cleaning up white space."
(interactive "P")
@@ -842,7 +842,7 @@ Goto mark '@' means jump into and pop the top mark on the mark ring."
(set-mark-command nil)
(goto-char mark)
(if line-flag (back-to-indentation)))))))
-
+
(defun vi-goto-line-mark (char)
"Go to the line (at first non-white) marked by next char."
(interactive "c")
@@ -1062,7 +1062,7 @@ MOTION-COMMAND with ARG.
((eq moving-unit 'line)
(goto-char begin) (beginning-of-line) (setq begin (point))
(goto-char end) (next-line 1) (beginning-of-line) (setq end (point))))
- (if (> end (point-max)) (setq end (point-max))) ; force in buffer region
+ (if (> end (point-max)) (setq end (point-max))) ; force in buffer region
(cons begin end)))))
(defun vi-delete-op (motion-command arg)
@@ -1106,7 +1106,7 @@ Used in checking whether the yanked text should be put back as lines or not."
(= (aref string (1- (length string))) ?\n))
(defun vi-put-before (arg &optional after-p)
- "Put yanked (in vi sense) text back before/above cursor.
+ "Put yanked (in vi sense) text back before/above cursor.
If a numeric prefix value (currently it should be >1) is given, put back
text as lines. If the optional after-p is given, put after/below the cursor."
(interactive "P")
@@ -1302,7 +1302,7 @@ For the use of the prefix-arg, refer to individual functions called."
(interactive "*P")
(let ((rcmd (if arg 'replace-regexp 'replace-string)))
(call-interactively rcmd nil)))
-
+
(defun vi-adjust-window (arg position)
"Move current line to the top/center/bottom of the window."
(interactive "p\nc")
@@ -1329,7 +1329,7 @@ For the use of the prefix-arg, refer to individual functions called."
(ding))))
(defun vi-name-last-change-or-macro (arg char)
- "Give name to the last change command or just defined kbd macro.
+ "Give name to the last change command or just defined kbd macro.
If prefix ARG is given, name last macro, otherwise name last change command.
The following CHAR will be the name for the command or macro."
(interactive "P\nc")
@@ -1343,7 +1343,7 @@ The following CHAR will be the name for the command or macro."
(vi-set-last-change-command 'vi-more-redo-insertion str
overwrite-p prefix-code)))
(fset (intern (char-to-string char)) vi-last-change-command)))
-
+
(defun vi-call-named-change-or-macro (count char)
"Execute COUNT times the keyboard macro definition named by the following CHAR."
(interactive "p\nc")
diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el
index 6db67394ea..15d5925083 100644
--- a/lisp/emulation/vip.el
+++ b/lisp/emulation/vip.el
@@ -49,7 +49,7 @@
(defvar vip-insert-local-map nil
"Local map used in insert command mode. (Buffer-specific.)")
-
+
(make-variable-buffer-local 'vip-emacs-local-map)
(make-variable-buffer-local 'vip-insert-local-map)
@@ -113,7 +113,7 @@
(defvar vip-f-forward nil
"For use by \";\" command.")
-
+
(defvar vip-f-offset nil
"For use by \";\" command.")
@@ -378,7 +378,7 @@ No message."
'delete-backward-char))
(define-key vip-insert-local-map "\C-w"
'vip-delete-backward-word))
- ((eq new-mode 'emacs-mode)
+ ((eq new-mode 'emacs-mode)
(vip-change-mode-line "Emacs:")
(use-local-map vip-emacs-local-map)))
(setq vip-current-mode new-mode)
@@ -508,7 +508,7 @@ EVENTS is a list of events, which become the beginning of the command."
"Compute numeric prefix arg value. Invoked by CHAR. VALUE is the value
obtained so far, and COM is the command part obtained so far."
(while (and (>= char ?0) (<= char ?9))
- (setq value (+ (* (if (numberp value) value 0) 10) (- char ?0)))
+ (setq value (+ (* (if (numberp value) value 0) 10) (- char ?0)))
(setq char (read-char)))
(setq prefix-arg value)
(if com (setq prefix-arg (cons prefix-arg com)))
@@ -561,7 +561,7 @@ obtained so far, and COM is the command part obtained so far."
(setq com char)
(setq char (read-char)))))))
(if (atom com)
- ;; com is a single char, so we construct prefix-arg
+ ;; com is a single char, so we construct prefix-arg
;; and if char is ?, describe prefix arg, otherwise exit by
;; pushing the char back
(progn
@@ -615,7 +615,7 @@ obtained so far, and COM is the command part obtained so far."
(interactive "P")
(condition-case conditions
(vip-prefix-arg-com
- last-command-char
+ last-command-char
(cond ((null arg) nil)
((consp arg) (car arg))
((numberp arg) arg)
@@ -935,7 +935,7 @@ vi command mode. It will repeat the insertion command if original insertion
command was invoked with argument > 1."
(let ((i-com (car vip-d-com)) (val (car (cdr vip-d-com))))
(if (and val (> val 1)) ;; first check that val is non-nil
- (progn
+ (progn
(setq vip-d-com (list i-com (1- val) ?r))
(vip-repeat nil)
(setq vip-d-com (list i-com val ?r))))))
@@ -1037,7 +1037,7 @@ command was invoked with argument > 1."
(vip-change-subr (mark) (point))
(vip-change (mark) (point))))
(setq vip-d-com (list 'vip-substitute val ?r))))
-
+
(defun vip-substitute-line (arg)
"Substitute lines."
(interactive "p")
@@ -1057,7 +1057,7 @@ command was invoked with argument > 1."
(interactive "P")
(let ((val (vip-p-val arg)))
(vip-line (cons val ?Y))))
-
+
;; region command
@@ -1076,7 +1076,7 @@ command was invoked with argument > 1."
(move-marker vip-com-point (point))
(exchange-point-and-mark)
(vip-execute-com 'vip-Region val com)))
-
+
(defun vip-replace-char (arg)
"Replace the following ARG chars by the character read."
(interactive "P")
@@ -1171,7 +1171,7 @@ beginning of buffer, stop and signal error."
(progn
(forward-char)
(vip-execute-com 'vip-end-of-word val com)))))
-
+
(defun vip-backward-word (arg)
"Backward word."
(interactive "P")
@@ -2911,7 +2911,7 @@ a token has type \(command, address, end-mark\) and value."
(vip-change-mode-to-emacs)
(shell))
-(defun ex-substitute (&optional repeat r-flag)
+(defun ex-substitute (&optional repeat r-flag)
"ex substitute.
If REPEAT use previous reg-exp which is ex-reg-exp or
vip-s-string"
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index faba7baf1b..02bffa64bd 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -863,7 +863,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
) ; let
(error nil)
) ; condition-case
-
+
(viper-set-input-method nil)
(viper-set-iso-accents-mode nil)
(viper-set-mode-vars-for viper-current-state)
@@ -1208,7 +1208,7 @@ as a Meta key and any number of multiple escapes is allowed."
(if (atom com)
;; `com' is a single char, so we construct the command argument
- ;; and if `char' is `?', we describe the arg; otherwise
+ ;; and if `char' is `?', we describe the arg; otherwise
;; we prepare the command that will be executed at the end.
(progn
(setq cmd-info (cons value com))
@@ -1216,16 +1216,16 @@ as a Meta key and any number of multiple escapes is allowed."
(viper-describe-arg cmd-info)
(setq char (read-char)))
;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so we
- ;; execute it at the very end
+ ;; execute it at the very end
(or (viper-movement-command-p char)
(viper-digit-command-p char)
(viper-regsuffix-command-p char)
(viper= char ?!) ; bang command
(error ""))
(setq cmd-to-exec-at-end
- (viper-exec-form-in-vi
+ (viper-exec-form-in-vi
`(key-binding (char-to-string ,char)))))
-
+
;; as com is non-nil, this means that we have a command to execute
(if (viper-memq-char (car com) '(?r ?R))
;; execute apropriate region command.
@@ -1239,7 +1239,7 @@ as a Meta key and any number of multiple escapes is allowed."
;; otherwise, reset prefix arg and call appropriate command
(setq value (if (null value) 1 value))
(setq prefix-arg nil)
- (cond
+ (cond
;; If we change ?C to ?c here, then cc will enter replacement mode
;; rather than deleting lines. However, it will affect 1 less line than
;; normal. We decided to not use replacement mode here and follow Vi,
@@ -1253,11 +1253,11 @@ as a Meta key and any number of multiple escapes is allowed."
((equal com '(?! . ?!)) (viper-line (cons value ?!)))
((equal com '(?= . ?=)) (viper-line (cons value ?=)))
(t (error "")))))
-
+
(if cmd-to-exec-at-end
(progn
(setq last-command-char char)
- (setq last-command-event
+ (setq last-command-event
(viper-copy-event
(if viper-xemacs-p (character-to-event char) char)))
(condition-case nil
@@ -1987,7 +1987,7 @@ Undo previous insertion and inserts new."
;; Thie is a temp hook that uses free variables init-message and initial.
;; A dirty feature, but it is the simplest way to have it do the right thing.
-;; The INIT-MESSAGE and INITIAL vars come from the scope set by
+;; The INIT-MESSAGE and INITIAL vars come from the scope set by
;; viper-read-string-with-history
(defun viper-minibuffer-standard-hook ()
(if (stringp init-message)
@@ -2594,13 +2594,13 @@ These keys are ESC, RET, and LineFeed"
(setq char (if com viper-d-char (viper-char-at-pos 'backward)))
(if com (insert char))
-
+
(setq viper-d-char char)
-
+
(viper-loop (1- (if (> arg 0) arg (- arg)))
(delete-char 1 t)
(insert char))
-
+
(viper-adjust-undo)
(backward-char arg)
))
@@ -4604,7 +4604,7 @@ One can use `` and '' to temporarily jump 1 step back."
;; Get viper standard value of SYMBOL. If symbol is customized, get its
;; standard value. Otherwise, get the value saved in the alist STORAGE. If
-;; STORAGE is nil, use viper-saved-user-settings.
+;; STORAGE is nil, use viper-saved-user-settings.
(defun viper-standard-value (symbol &optional storage)
(or (eval (car (get symbol 'customized-value)))
(eval (car (get symbol 'saved-value)))
@@ -4945,6 +4945,6 @@ Mail anyway (y or n)? ")
))
-
+
;;; viper-cmd.el ends here
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 312357f321..f4d3e8c766 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -150,7 +150,7 @@
("set" (ex-set))
("shell" (ex-shell))
("source" (ex-source))
- ("stop" (suspend-emacs))
+ ("stop" (suspend-emacs))
("sr" (ex-substitute t t))
("submitReport" (viper-submit-report))
("substitute" (ex-substitute) is-mashed)
@@ -165,7 +165,7 @@
("v" "vglobal")
("version" (viper-version))
("vglobal" (ex-global t) is-mashed)
- ("visual" (ex-edit))
+ ("visual" (ex-edit))
("w" "write")
("wq" (ex-write t))
("write" (ex-write nil))
@@ -238,26 +238,26 @@
;; A-list of Ex variables that can be set using the :set command.
-(defconst ex-variable-alist
+(defconst ex-variable-alist
'(("wrapscan") ("ws") ("wrapmargin") ("wm")
("tabstop-global") ("ts-g") ("tabstop") ("ts")
("showmatch") ("sm") ("shiftwidth") ("sw") ("shell") ("sh")
- ("readonly") ("ro")
+ ("readonly") ("ro")
("nowrapscan") ("nows") ("noshowmatch") ("nosm")
("noreadonly") ("noro") ("nomagic") ("noma")
("noignorecase") ("noic")
("noautoindent-global") ("noai-g") ("noautoindent") ("noai")
("magic") ("ma") ("ignorecase") ("ic")
- ("autoindent-global") ("ai-g") ("autoindent") ("ai")
- ("all")
+ ("autoindent-global") ("ai-g") ("autoindent") ("ai")
+ ("all")
))
-
+
;; Token recognized during parsing of Ex commands (e.g., "read", "comma")
(defvar ex-token nil)
-;; Type of token.
+;; Type of token.
;; If non-nil, gives type of address; if nil, it is a command.
(defvar ex-token-type nil)
@@ -323,7 +323,7 @@
((string-match "\\(bash$\\|bash.exe$\\)" shell-file-name)
"-noprofile") ; bash: ignore .profile
)))
- "Options to pass to the Unix-style shell.
+ "Options to pass to the Unix-style shell.
Don't put `-c' here, as it is added automatically."
:type '(choice (const nil) string)
:group 'viper-ex)
@@ -344,7 +344,7 @@ Don't put `-c' here, as it is added automatically."
The default tries to set this variable to work with Unix, Windows,
OS/2, and VMS.
-However, if it doesn't work right for some types of Unix shells or some OS,
+However, if it doesn't work right for some types of Unix shells or some OS,
the user should supply the appropriate function and set this variable to the
corresponding function symbol."
:type 'symbol
@@ -370,7 +370,7 @@ corresponding function symbol."
;; e.g., :r !date
(defvar ex-cmdfile nil)
(defvar ex-cmdfile-args "")
-
+
;; flag used in viper-ex-read-file-name to indicate that we may be reading
;; multiple file names. Used for :edit and :next
(defvar viper-keep-reading-filename nil)
@@ -389,10 +389,10 @@ reversed."
;; Last shell command executed with :! command.
(defvar viper-ex-last-shell-com nil)
-
+
;; Indicates if Minibuffer was exited temporarily in Ex-command.
(defvar viper-incomplete-ex-cmd nil)
-
+
;; Remembers the last ex-command prompt.
(defvar viper-last-ex-prompt "")
@@ -414,7 +414,7 @@ reversed."
;; A token has a type, \(command, address, end-mark\), and a value
(defun viper-get-ex-token ()
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(skip-chars-forward " \t|")
(let ((case-fold-search t))
@@ -556,25 +556,25 @@ reversed."
"\\|" "![ \t]*[a-zA-Z].*"
"\\)"
"!*")))
-
+
(save-window-excursion ;; put cursor at the end of the Ex working buffer
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(goto-char (point-max)))
(cond ((viper-looking-back quit-regex1) (exit-minibuffer))
((viper-looking-back stay-regex) (insert " "))
((viper-looking-back quit-regex2) (exit-minibuffer))
(t (insert " ")))))
-
+
;; complete Ex command
(defun ex-cmd-complete ()
(interactive)
(let (save-pos dist compl-list string-to-complete completion-result)
-
+
(save-excursion
(setq dist (skip-chars-backward "[a-zA-Z!=>&~]")
save-pos (point)))
-
+
(if (or (= dist 0)
(viper-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
(viper-looking-back
@@ -586,14 +586,14 @@ reversed."
(viper-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
(looking-at "[^ \t\n\C-m]"))
nil
- (with-output-to-temp-buffer "*Completions*"
+ (with-output-to-temp-buffer "*Completions*"
(display-completion-list
(viper-alist-to-list ex-token-alist))))
;; Preceding chars may be part of a command name
(setq string-to-complete (buffer-substring save-pos (point)))
(setq completion-result
(try-completion string-to-complete ex-token-alist))
-
+
(cond ((eq completion-result t) ; exact match--do nothing
(viper-tmp-insert-at-eob " (Sole completion)"))
((eq completion-result nil)
@@ -607,17 +607,17 @@ reversed."
(viper-filter-alist (concat "^" completion-result)
ex-token-alist)))
(if (> (length compl-list) 1)
- (with-output-to-temp-buffer "*Completions*"
+ (with-output-to-temp-buffer "*Completions*"
(display-completion-list
(viper-alist-to-list (reverse compl-list)))))))
)))
-
-;; Read Ex commands
+
+;; Read Ex commands
;; ARG is a prefix argument. If given, the ex command runs on the region
;;(without the user having to specify the address :a,b
;; STRING is the command to execute. If nil, then Viper asks you to enter the
-;; command.
+;; command.
(defun viper-ex (arg &optional string)
(interactive "P")
(or string
@@ -648,10 +648,10 @@ reversed."
(+ reg-beg-line (count-lines reg-beg reg-end) -1)))))
(if reg-beg-line
(setq initial-str (format "%d,%d" reg-beg-line reg-end-line)))
-
- (setq com-str
+
+ (setq com-str
(or string (viper-read-string-with-history
- ":"
+ ":"
initial-str
'viper-ex-history
;; no default when working on region
@@ -663,7 +663,7 @@ reversed."
" [Type command to execute on current region]"))))
(save-window-excursion
;; just a precaution
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(delete-region (point-min) (point-max))
(insert com-str "\n")
@@ -718,7 +718,7 @@ reversed."
(t (let ((ans (viper-get-ex-address-subr address dot)))
(if ans (setq address ans)))))
(setq prev-token-type ex-token-type))))
-
+
;; Get a regular expression and set `ex-variant', if found
;; Viper doesn't parse the substitution or search patterns.
@@ -783,7 +783,7 @@ reversed."
;; Get an Ex option g or c
(defun viper-get-ex-opt-gc (c)
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(if (looking-at (format "%c" c)) (forward-char 1))
(skip-chars-forward " \t")
@@ -872,7 +872,7 @@ reversed."
(save-excursion
(if (null ex-token)
(exchange-point-and-mark)
- (goto-char
+ (goto-char
(viper-register-to-point
(viper-int-to-char (1+ (- ex-token ?a))) 'enforce-buffer)))
(setq address (point-marker)))))
@@ -900,7 +900,7 @@ reversed."
(setq ex-count nil)
(setq ex-flag nil)
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(skip-chars-forward " \t")
(if (looking-at "[a-zA-Z]")
@@ -926,7 +926,7 @@ reversed."
ex-count nil
ex-flag nil)
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(skip-chars-forward " \t")
(if (looking-at "!")
@@ -952,7 +952,7 @@ reversed."
;; Expand \% and \# in ex command
(defun ex-expand-filsyms (cmd buf)
(let (cf pf ret)
- (save-excursion
+ (save-excursion
(set-buffer buf)
(setq cf buffer-file-name)
(setq pf (ex-next nil t))) ; this finds alternative file name
@@ -966,7 +966,7 @@ reversed."
(insert cmd)
(goto-char (point-min))
(while (re-search-forward "%\\|#" nil t)
- (let ((data (match-data))
+ (let ((data (match-data))
(char (buffer-substring (match-beginning 0) (match-end 0))))
(if (viper-looking-back (concat "\\\\" char))
(replace-match char)
@@ -991,7 +991,7 @@ reversed."
ex-cmdfile-args "")
(save-excursion
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(skip-chars-forward " \t")
(if (looking-at "!")
@@ -1052,9 +1052,9 @@ reversed."
(skip-chars-backward " \t\n")
(setq prompt (buffer-substring (point-min) (point)))
))
-
+
(setq viper-last-ex-prompt prompt)
-
+
;; If we just finished reading command, redisplay prompt
(if viper-incomplete-ex-cmd
(setq ex-file (viper-ex-read-file-name (format ":%s " prompt)))
@@ -1067,8 +1067,8 @@ reversed."
;; file names, arranges to re-enter the minibuffer.
(defun viper-complete-filename-or-exit ()
(interactive)
- (setq viper-keep-reading-filename t)
- ;; don't exit if directory---ex-commands don't
+ (setq viper-keep-reading-filename t)
+ ;; don't exit if directory---ex-commands don't
(cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer))
;; apparently the argument to an Ex command is
;; supposed to be a shell command
@@ -1098,12 +1098,12 @@ reversed."
(minibuffer-local-completion-map
(copy-keymap minibuffer-local-completion-map))
beg end cont val)
-
+
(viper-add-keymap ex-read-filename-map
- (if viper-emacs-p
+ (if viper-emacs-p
minibuffer-local-completion-map
- read-file-name-map))
-
+ read-file-name-map))
+
(setq cont (setq viper-keep-reading-filename t))
(while cont
(setq viper-keep-reading-filename nil
@@ -1114,14 +1114,14 @@ reversed."
(setq val (concat "\"" val "\"")))
(setq str (concat str (if (equal val "") "" " ")
val (if (equal val "") "" " ")))
-
+
;; Only edit, next, and Next commands accept multiple files.
;; viper-keep-reading-filename is set in the anonymous function that is
;; bound to " " in ex-read-filename-map.
(setq cont (and viper-keep-reading-filename
(ex-cmd-accepts-multiple-files-p ex-token)))
)
-
+
(setq beg (string-match "[^ \t]" str) ; delete leading blanks
end (string-match "[ \t]*$" str)) ; delete trailing blanks
(if (member ex-token '("read" "write"))
@@ -1137,11 +1137,11 @@ reversed."
(defun viper-undisplayed-files ()
(mapcar
- (lambda (b)
+ (lambda (b)
(if (null (get-buffer-window b))
(let ((f (buffer-file-name b)))
(if f f
- (if ex-cycle-through-non-files
+ (if ex-cycle-through-non-files
(let ((s (buffer-name b)))
(if (string= " " (substring s 0 1))
nil
@@ -1156,7 +1156,7 @@ reversed."
(args "")
(file-count 1))
(while (not (null l))
- (if (car l)
+ (if (car l)
(setq args (format "%s %d) %s\n" args file-count (car l))
file-count (1+ file-count)))
(setq l (cdr l)))
@@ -1260,7 +1260,7 @@ reversed."
(setq ex-file (viper-abbreviate-file-name (buffer-file-name))))
((string= ex-file "")
(error viper-NoFileSpecified)))
-
+
(let (msg do-edit)
(if buffer-file-name
(cond ((buffer-modified-p)
@@ -1274,7 +1274,7 @@ reversed."
buffer-file-name)
do-edit t))
(t (setq do-edit nil))))
-
+
(if do-edit
(if (yes-or-no-p msg)
(progn
@@ -1282,9 +1282,9 @@ reversed."
(kill-buffer (current-buffer)))
(message "Buffer %s was left intact" (buffer-name))))
) ; let
-
+
(if (null (setq file (get-file-buffer ex-file)))
- (progn
+ (progn
;; this also does shell-style globbing
(ex-find-file
;; replace # and % with the previous/current file
@@ -1296,7 +1296,7 @@ reversed."
(if ex-offset
(progn
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(delete-region (point-min) (point-max))
(insert ex-offset "\n")
@@ -1339,7 +1339,7 @@ reversed."
(viper-get-ex-pat)
(if (null ex-token)
(error "`%s': Missing regular expression" gcommand)))
-
+
(if (string= ex-token "")
(if (null viper-s-string)
(error viper-NoPrevSearch)
@@ -1379,7 +1379,7 @@ reversed."
(forward-line -1)
(end-of-line)))))
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
;; com-str is the command string, i.e., g/pattern/ or v/pattern'
(setq com-str (buffer-substring (1+ (point)) (1- (point-max)))))
@@ -1460,7 +1460,7 @@ reversed."
(error "`%s': Spurious text \"%s\" after mark name"
name (substring name 1) viper-SpuriousText))
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(skip-chars-forward " \t")
(if (looking-at "[a-z]")
@@ -1475,17 +1475,17 @@ reversed."
(goto-char (car ex-addresses))
(point-to-register (viper-int-to-char (1+ (- char ?a)))))))
-
-
+
+
;; Alternate file is the file next to the first one in the buffer ring
(defun ex-next (cycle-other-window &optional find-alt-file)
(catch 'ex-edit
(let (count l)
- (if (not find-alt-file)
+ (if (not find-alt-file)
(progn
(viper-get-ex-file)
(if (or (char-or-string-p ex-offset)
- (and (not (string= "" ex-file))
+ (and (not (string= "" ex-file))
(not (string-match "^[0-9]+$" ex-file))))
(progn
(ex-edit t)
@@ -1515,41 +1515,41 @@ reversed."
(defun ex-next-related-buffer (direction &optional no-recursion)
-
+
(viper-ring-rotate1 viper-related-files-and-buffers-ring direction)
-
- (let ((file-or-buffer-name
+
+ (let ((file-or-buffer-name
(viper-current-ring-item viper-related-files-and-buffers-ring))
(old-ring viper-related-files-and-buffers-ring)
(old-win (selected-window))
skip-rest buf wind)
-
+
(or (and (ring-p viper-related-files-and-buffers-ring)
(> (ring-length viper-related-files-and-buffers-ring) 0))
(error "This buffer has no related files or buffers"))
-
+
(or (stringp file-or-buffer-name)
(error
"File and buffer names must be strings, %S" file-or-buffer-name))
-
+
(setq buf (cond ((get-buffer file-or-buffer-name))
((file-exists-p file-or-buffer-name)
(find-file-noselect file-or-buffer-name))
))
-
+
(if (not (viper-buffer-live-p buf))
(error "Didn't find buffer %S or file %S"
file-or-buffer-name
(viper-abbreviate-file-name
(expand-file-name file-or-buffer-name))))
-
+
(if (equal buf (current-buffer))
(or no-recursion
;; try again
(progn
(setq skip-rest t)
(ex-next-related-buffer direction 'norecursion))))
-
+
(if skip-rest
()
;; setup buffer
@@ -1557,7 +1557,7 @@ reversed."
()
(setq wind (get-lru-window (if viper-xemacs-p nil 'visible)))
(set-window-buffer wind buf))
-
+
(if (viper-window-display-p)
(progn
(raise-frame (window-frame wind))
@@ -1565,15 +1565,15 @@ reversed."
(save-window-excursion (select-window wind) (sit-for 1))
(select-window wind)))
(save-window-excursion (select-window wind) (sit-for 1)))
-
+
(save-excursion
(set-buffer buf)
(setq viper-related-files-and-buffers-ring old-ring))
-
+
(setq viper-local-search-start-marker (point-marker))
)))
-
-
+
+
;; Force auto save
(defun ex-preserve ()
(message "Autosaving all buffers that need to be saved...")
@@ -1595,7 +1595,7 @@ reversed."
(defun ex-quit ()
;; skip "!", if it is q!. In Viper q!, w!, etc., behave as q, w, etc.
(save-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(if (looking-at "!") (forward-char 1)))
(if (< viper-expert-level 3)
@@ -1621,19 +1621,19 @@ reversed."
(setq ex-file buffer-file-name)))
(if ex-cmdfile
(progn
- (setq command
+ (setq command
;; replace # and % with the previous/current file
(ex-expand-filsyms (concat ex-file ex-cmdfile-args)
(current-buffer)))
(shell-command command t))
(insert-file-contents ex-file)))
(ex-fixup-history viper-last-ex-prompt ex-file ex-cmdfile-args))
-
+
;; this function fixes ex-history for some commands like ex-read, ex-edit
-(defun ex-fixup-history (&rest args)
+(defun ex-fixup-history (&rest args)
(setq viper-ex-history
(cons (mapconcat 'identity args " ") (cdr viper-ex-history))))
-
+
;; Ex recover from emacs \#file\#
(defun ex-recover ()
@@ -1674,7 +1674,7 @@ reversed."
(viper-set-unread-command-events ?\C-m)))
(message ":set <Variable> [= <Value>]")
(or batch (sit-for 2))
-
+
(while (string-match "^[ \\t\\n]*$"
(setq str
(completing-read ":set " ex-variable-alist)))
@@ -1755,19 +1755,19 @@ reversed."
(or (viper-set-unread-command-events "") (sit-for 2))
(setq val (read-string (format ":set %s = " var)))
(ex-fixup-history "set" orig-var val)
-
+
;; check numerical values
(if (member var
'("sw" "shiftwidth"
"ts" "tabstop"
"ts-g" "tabstop-global"
- "wm" "wrapmargin"))
+ "wm" "wrapmargin"))
(condition-case nil
(or (numberp (setq val2 (car (read-from-string val))))
(error "%s: Invalid value, numberp, %S" var val))
(error
(error "%s: Invalid value, numberp, %S" var val))))
-
+
(cond
((member var '("sw" "shiftwidth"))
(setq var "viper-shift-width"))
@@ -1782,27 +1782,27 @@ reversed."
set-cmd "setq-default"))
((member var '("wm" "wrapmargin"))
;; make it take effect in curr buff and new bufs
- (kill-local-variable 'fill-column)
- (setq var "fill-column"
+ (kill-local-variable 'fill-column)
+ (setq var "fill-column"
val (format "(- (window-width) %s)" val)
set-cmd "setq-default"))
((member var '("sh" "shell"))
(setq var "explicit-shell-file-name"
val (format "\"%s\"" val)))))
(ex-fixup-history "set" orig-var))
-
+
(if set-cmd
(setq actual-lisp-cmd
(format "\n(%s %s %s) %s" set-cmd var val auto-cmd-label)
lisp-cmd-del-pattern
(format "^\n?[ \t]*([ \t]*%s[ \t]+%s[ \t].*)[ \t]*%s"
set-cmd var auto-cmd-label)))
-
+
(if (and ask-if-save
(y-or-n-p (format "Do you want to save this setting in %s "
viper-custom-file-name)))
(progn
- (viper-save-string-in-file
+ (viper-save-string-in-file
actual-lisp-cmd viper-custom-file-name
;; del pattern
lisp-cmd-del-pattern)
@@ -1822,7 +1822,7 @@ reversed."
lisp-cmd-del-pattern)
))
))
-
+
(if set-cmd
(message "%s %s %s"
set-cmd var
@@ -1843,7 +1843,7 @@ reversed."
;; special meaning
(defun ex-get-inline-cmd-args (regex-forw &optional chars-back replace-str)
(save-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(goto-char (point-min))
(re-search-forward regex-forw nil t)
@@ -1868,7 +1868,7 @@ reversed."
;; Ex shell command
(defun ex-shell ()
(shell))
-
+
;; Viper help. Invokes Info
(defun ex-help ()
(condition-case nil
@@ -1895,7 +1895,7 @@ Please contact your system administrator. "
;; Ex substitute command
;; If REPEAT use previous regexp which is ex-reg-exp or viper-s-string
-(defun ex-substitute (&optional repeat r-flag)
+(defun ex-substitute (&optional repeat r-flag)
(let ((opt-g nil)
(opt-c nil)
(matched-pos nil)
@@ -1993,7 +1993,7 @@ Please contact your system administrator. "
(defun ex-tag ()
(let (tag)
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(skip-chars-forward " \t")
(set-mark (point))
@@ -2013,13 +2013,13 @@ Please contact your system administrator. "
;; Ex write command
;; ex-write doesn't support wildcards, because file completion is a better
-;; mechanism. We also don't support # and %
+;; mechanism. We also don't support # and %
;; because file history is a better mechanism.
(defun ex-write (q-flag)
(viper-default-ex-addresses t)
(viper-get-ex-file)
(let ((end (car ex-addresses))
- (beg (car (cdr ex-addresses)))
+ (beg (car (cdr ex-addresses)))
(orig-buf (current-buffer))
;;(orig-buf-file-name (buffer-file-name))
;;(orig-buf-name (buffer-name))
@@ -2030,14 +2030,14 @@ Please contact your system administrator. "
(if ex-cmdfile
(progn
(viper-enlarge-region beg end)
- (shell-command-on-region (point) (mark t)
+ (shell-command-on-region (point) (mark t)
(concat ex-file ex-cmdfile-args)))
(if (and (string= ex-file "") (not (buffer-file-name)))
(setq ex-file
(read-file-name
(format "Buffer %s isn't visiting any file. File to save in: "
(buffer-name)))))
-
+
(setq writing-whole-file (and (= (point-min) beg) (= (point-max) end))
ex-file (if (string= ex-file "")
(buffer-file-name)
@@ -2049,7 +2049,7 @@ Please contact your system administrator. "
(setq ex-file
(concat (file-name-as-directory ex-file)
(file-name-nondirectory buffer-file-name))))
-
+
(setq file-exists (file-exists-p ex-file)
writing-same-file (string= ex-file (buffer-file-name)))
@@ -2070,7 +2070,7 @@ Please contact your system administrator. "
(format "File %s exists. Overwrite? " ex-file))))
(error "Quit"))
;; writing a region or whole buffer to non-visited file
- (unwind-protect
+ (unwind-protect
(save-excursion
(viper-enlarge-region beg end)
(setq region (buffer-substring (point) (mark t)))
@@ -2104,7 +2104,7 @@ Please contact your system administrator. "
(if (and (buffer-file-name) writing-same-file)
(set-visited-file-modtime))
;; prevent loss of data if saving part of the buffer in visited file
- (or writing-whole-file
+ (or writing-whole-file
(not writing-same-file)
(progn
(sit-for 2)
@@ -2115,7 +2115,7 @@ Please contact your system administrator. "
(save-buffers-kill-emacs)
(kill-buffer (current-buffer))))
)))
-
+
(defun ex-write-info (exists file-name beg end)
(message "`%s'%s %d lines, %d characters"
@@ -2155,7 +2155,7 @@ Please contact your system administrator. "
(defun ex-command ()
(let (command)
(save-window-excursion
- (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
+ (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(skip-chars-forward " \t")
(setq command (buffer-substring (point) (point-max)))
@@ -2262,7 +2262,7 @@ Type 'mak ' (including the space) to run make with no args."
(with-output-to-temp-buffer " *viper-info*"
(princ (if viper-auto-indent
"autoindent (local)\n" "noautoindent (local)\n"))
- (princ (if (default-value 'viper-auto-indent)
+ (princ (if (default-value 'viper-auto-indent)
"autoindent (global) \n" "noautoindent (global) \n"))
(princ (if viper-case-fold-search "ignorecase\n" "noignorecase\n"))
(princ (if viper-re-search "magic\n" "nomagic\n"))
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 889bb61b4d..8787e2eaa6 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -535,7 +535,7 @@ defined in the low-level key-translation-map or function-key-map, such as those
emitted by the arrow and function keys. Other sequences, e.g., \\e/, are
treated as ESC command followed by a `/'. This is done for people who type fast
and tend to hit other characters right after they hit ESC. Other people like
-Emacs to translate ESC sequences all the time.
+Emacs to translate ESC sequences all the time.
The default is to translate all sequences only when using a dumb terminal.
This permits you to use ESC as a meta key in insert mode."
:type 'boolean
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el
index 0b978d97e8..2369346a3f 100644
--- a/lisp/emulation/viper-keym.el
+++ b/lisp/emulation/viper-keym.el
@@ -52,16 +52,16 @@
(defvar viper-toggle-key "\C-z"
"The key used to change states from emacs to Vi and back.
-In insert mode, this key also functions as Meta.
+In insert mode, this key also functions as Meta.
Must be set in .viper file or prior to loading Viper.
This setting cannot be changed interactively.")
-(defvar viper-ESC-key "\e"
- "Key used to ESC.
+(defvar viper-ESC-key "\e"
+ "Key used to ESC.
Must be set in .viper file or prior to loading Viper.
This setting cannot be changed interactively.")
-
-;;; Emacs keys in other states.
+
+;;; Emacs keys in other states.
(defcustom viper-want-emacs-keys-in-insert t
"*Set to nil if you want complete Vi compatibility in insert mode.
@@ -84,7 +84,7 @@ don't have a convenient Meta key.
Setting viper-no-multiple-ESC to nil will allow as many multiple ESC,
as is allowed by the major mode in effect."
:type 'boolean
- :group 'viper)
+ :group 'viper)
(defcustom viper-want-ctl-h-help nil
"*If non-nil, C-h gets bound to help-command; otherwise, C-h gets the usual Vi bindings."
@@ -103,14 +103,14 @@ as is allowed by the major mode in effect."
;; keymap used to zap all keymaps other than function-key-map,
;; device-function-key-map, etc.
(defvar viper-overriding-map (make-sparse-keymap))
-
+
(viper-deflocalvar viper-vi-local-user-map (make-sparse-keymap)
"Keymap for user-defined local bindings.
Useful for changing bindings such as ZZ in certain major modes.
For instance, in letter-mode, one may want to bind ZZ to
mh-send-letter. In a newsreader such as gnus, tin, or rn, ZZ could be bound
to save-buffers-kill-emacs then post article, etc.")
-(put 'viper-vi-local-user-map 'permanent-local t)
+(put 'viper-vi-local-user-map 'permanent-local t)
(defvar viper-vi-global-user-map (make-sparse-keymap)
"Keymap for user-defined global bindings.
@@ -126,11 +126,11 @@ This map is global, shared by all buffers.")
(defvar viper-vi-diehard-map (make-sparse-keymap)
"This keymap is in use when the user asks Viper to simulate Vi very closely.
This happens when viper-expert-level is 1 or 2. See viper-set-expert-level.")
-
+
(viper-deflocalvar viper-insert-local-user-map (make-sparse-keymap)
"Auxiliary map for per-buffer user-defined keybindings in Insert state.")
-(put 'viper-insert-local-user-map 'permanent-local t)
+(put 'viper-insert-local-user-map 'permanent-local t)
(defvar viper-insert-global-user-map (make-sparse-keymap)
"Auxiliary map for global user-defined bindings in Insert state.")
@@ -148,16 +148,16 @@ viper-insert-basic-map. Not recommended, except for novice users.")
(defvar viper-replace-map (make-sparse-keymap)
"Map used in Viper's replace state.")
-
+
(defvar viper-emacs-global-user-map (make-sparse-keymap)
"Auxiliary map for global user-defined bindings in Emacs state.")
(defvar viper-emacs-kbd-map (make-sparse-keymap)
"This keymap keeps Vi-style kbd macros for emacs mode.")
-
+
(viper-deflocalvar viper-emacs-local-user-map (make-sparse-keymap)
"Auxiliary map for local user-defined bindings in Emacs state.")
-(put 'viper-emacs-local-user-map 'permanent-local t)
+(put 'viper-emacs-local-user-map 'permanent-local t)
;; This keymap should stay empty
(defvar viper-empty-keymap (make-sparse-keymap))
@@ -170,19 +170,19 @@ viper-insert-basic-map. Not recommended, except for novice users.")
;;; Variables used by minor modes
-;; Association list of the form
+;; Association list of the form
;; ((major-mode . keymap) (major-mode . keymap) ...)
;; Viper uses these keymaps to make user-requested adjustments
;; to its Vi state in various major modes.")
(defvar viper-vi-state-modifier-alist nil)
-;; Association list of the form
+;; Association list of the form
;; ((major-mode . keymap) (major-mode . keymap) ...)
;; Viper uses these keymaps to make user-requested adjustments
;; to its Insert state in various major modes.")
(defvar viper-insert-state-modifier-alist nil)
-;; Association list of the form
+;; Association list of the form
;; ((major-mode . keymap) (major-mode . keymap) ...)
;; Viper uses these keymaps to make user-requested adjustments
;; to its Emacs state in various major modes.
@@ -240,7 +240,7 @@ viper-insert-basic-map. Not recommended, except for novice users.")
(define-key viper-insert-basic-map "\C-d" 'viper-backward-indent)
(define-key viper-insert-basic-map "\C-w" 'viper-delete-backward-word)
(define-key viper-insert-basic-map "\C-t" 'viper-forward-indent)
-(define-key viper-insert-basic-map
+(define-key viper-insert-basic-map
(if viper-xemacs-p [(shift tab)] [S-tab]) 'viper-insert-tab)
(define-key viper-insert-basic-map "\C-v" 'quoted-insert)
(define-key viper-insert-basic-map "\C-?" 'viper-del-backward-char-in-insert)
@@ -420,11 +420,11 @@ viper-insert-basic-map. Not recommended, except for novice users.")
;;; Minibuffer keymap
-
+
(defvar viper-minibuffer-map (make-sparse-keymap)
"Keymap used to modify keys when Minibuffer is in Insert state.")
-
+
(define-key viper-minibuffer-map "\C-m" 'viper-exit-minibuffer)
(define-key viper-minibuffer-map "\C-j" 'viper-exit-minibuffer)
@@ -469,7 +469,7 @@ Normally, this would be called from a hook to a major mode or
on a per buffer basis.
Usage:
(viper-add-local-keys state '((key-str . func) (key-str . func)...)) "
-
+
(let (map)
(cond ((eq state 'vi-state)
(if viper-need-new-vi-local-map
@@ -486,7 +486,7 @@ Usage:
(setq viper-emacs-local-user-map (make-sparse-keymap)))
(setq viper-need-new-emacs-local-map nil
map viper-emacs-local-user-map))
- (t
+ (t
(error
"Invalid state in viper-add-local-keys: %S. Valid states: vi-state, insert-state or emacs-state" state)))
@@ -507,7 +507,7 @@ sanity."
viper-emacs-local-user-map (make-sparse-keymap)
viper-need-new-emacs-local-map nil)
(viper-normalize-minor-mode-map-alist))
-
+
(defun viper-modify-major-mode (mode state keymap)
"Modify key bindings in a major-mode in a Viper state using a keymap.
@@ -530,16 +530,16 @@ Arguments: (major-mode viper-state keymap)"
(if (setq elt (assoc mode (eval alist)))
(set alist (delq elt (eval alist))))
(set alist (cons (cons mode keymap) (eval alist)))
-
+
;; Normalization usually doesn't help here, since one needs to
;; normalize in the actual buffer where changes to the keymap are
;; to take place. However, it doesn't hurt, and it helps whenever this
;; function is actually called from within the affected buffer.
(viper-normalize-minor-mode-map-alist)
-
+
(viper-set-mode-vars-for viper-current-state)))
-
+
;; Displays variables that control Viper's keymaps
(defun viper-debug-keymaps ()
(interactive)
@@ -575,7 +575,7 @@ Arguments: (major-mode viper-state keymap)"
(princ (format "viper-insert-global-user-minor-mode: %S\n"
viper-insert-global-user-minor-mode))
(princ (format "viper-insert-kbd-minor-mode: %S\n"
- viper-insert-kbd-minor-mode))
+ viper-insert-kbd-minor-mode))
(princ (format "viper-insert-state-modifier-minor-mode: %S\n"
viper-insert-state-modifier-minor-mode))
(princ (format "viper-insert-diehard-minor-mode: %S\n"
@@ -590,7 +590,7 @@ Arguments: (major-mode viper-state keymap)"
viper-emacs-global-user-minor-mode))
(princ (format "viper-emacs-state-modifier-minor-mode: %S\n"
viper-emacs-state-modifier-minor-mode))
-
+
(princ (format "\nviper-expert-level %S\n" viper-expert-level))
(princ (format "viper-no-multiple-ESC %S\n" viper-no-multiple-ESC))
(princ (format "viper-always %S\n" viper-always))
@@ -599,22 +599,22 @@ Arguments: (major-mode viper-state keymap)"
(princ (format "viper-ex-style-editing %S\n"
viper-ex-style-editing))
(princ (format "viper-want-emacs-keys-in-vi %S\n"
- viper-want-emacs-keys-in-vi))
+ viper-want-emacs-keys-in-vi))
(princ (format "viper-want-emacs-keys-in-insert %S\n"
- viper-want-emacs-keys-in-insert))
+ viper-want-emacs-keys-in-insert))
(princ (format "viper-want-ctl-h-help %S\n" viper-want-ctl-h-help))
-
+
(princ "\n\n\n")
(princ (format "Default value for minor-mode-map-alist: \n%S\n\n"
(default-value 'minor-mode-map-alist)))
(princ (format "Actual value for minor-mode-map-alist: \n%S\n"
minor-mode-map-alist))
))
-
+
;;; Keymap utils
-
-(defun viper-add-keymap (mapsrc mapdst)
+
+(defun viper-add-keymap (mapsrc mapdst)
"Add contents of mapsrc to mapdst. It is assumed that mapsrc is sparse."
(viper-cond-compile-for-xemacs-or-emacs
;; xemacs
@@ -624,11 +624,11 @@ Arguments: (major-mode viper-state keymap)"
(mapcar (lambda (p) (define-key mapdst (vector (car p)) (cdr p)))
(cdr mapsrc))
))
-
+
(defun viper-modify-keymap (map alist)
"Modifies MAP with bindings specified in the ALIST. The alist has the
form ((key . function) (key . function) ... )."
- (mapcar (lambda (p) (define-key map (eval (car p)) (cdr p)))
+ (mapcar (lambda (p) (define-key map (eval (car p)) (cdr p)))
alist))
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index 69d1a42b2e..b13c922188 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -58,7 +58,7 @@
;; Register holding last macro.
(defvar viper-last-macro-reg nil)
-;; format of the elements of kbd alists:
+;; format of the elements of kbd alists:
;; (name ((buf . macr)...(buf . macr)) ((maj-mode . macr)...) (t . macr))
;; kbd macro alist for Vi state
(defvar viper-vi-kbd-macro-alist nil)
@@ -121,7 +121,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(viper-display-macro macro-name)
(if ins "Insert" "Vi")))
))
-
+
;; Ex unmap
(defun ex-unmap ()
@@ -141,7 +141,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(viper-display-macro temp)))
(viper-unrecord-kbd-macro macro-name (if ins 'insert-state 'vi-state))
))
-
+
;; read arguments for ex-map
(defun ex-map-read-args (variant)
@@ -149,7 +149,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(key-seq [])
temp key event message
macro-name macro-body args)
-
+
(condition-case nil
(setq args (concat (ex-get-inline-cmd-args ".*map[!]*[ \t]?" "\n\C-m")
" nil nil ")
@@ -158,15 +158,15 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
macro-body (car (read-from-string args (cdr temp))))
(error
(signal
- 'error
+ 'error
'("map: Macro name and body must be a quoted string or a vector"))))
-
+
;; We expect macro-name to be a vector, a string, or a quoted string.
;; In the second case, it will emerge as a symbol when read from
;; the above read-from-string. So we need to convert it into a string
(if macro-name
(cond ((vectorp macro-name) nil)
- ((stringp macro-name)
+ ((stringp macro-name)
(setq macro-name (vconcat macro-name)))
(t (setq macro-name (vconcat (prin1-to-string macro-name)))))
(message ":map%s <Name>" variant)(sit-for 2)
@@ -198,13 +198,13 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(viper-event-key event)))
)
(setq macro-name key-seq))
-
+
(if (= (length macro-name) 0)
(error "Can't map an empty macro name"))
(setq macro-name (viper-fixup-macro macro-name))
(if (viper-char-array-p macro-name)
(setq macro-name (viper-char-array-to-macro macro-name)))
-
+
(if macro-body
(cond ((viper-char-array-p macro-body)
(setq macro-body (viper-char-array-to-macro macro-body)))
@@ -212,7 +212,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(t (error "map: Invalid syntax in macro definition"))))
(setq cursor-in-echo-area nil)(sit-for 0) ; this overcomes xemacs tty bug
(cons macro-name macro-body)))
-
+
;; read arguments for ex-unmap
@@ -230,7 +230,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
event message
key key-seq macro-name)
(setq macro-name (ex-get-inline-cmd-args ".*unma?p?[!]*[ \t]*"))
-
+
(if (> (length macro-name) 0)
()
(message ":unmap%s <Name>" variant) (sit-for 2)
@@ -245,7 +245,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(setq key-seq (subseq key-seq 0 (- (length key-seq) 2))))
((member key '(tab (control i) ?\t))
(setq key-seq (subseq key-seq 0 (1- (length key-seq))))
- (setq message
+ (setq message
(format
":unmap%s %s"
variant (if (> (length key-seq) 0)
@@ -255,7 +255,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(setq key-seq
(viper-do-sequence-completion key-seq macro-alist message))
))
- (setq message
+ (setq message
(format
":unmap%s %s"
variant (if (> (length key-seq) 0)
@@ -278,14 +278,14 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
(if (= (length macro-name) 0)
(error "Can't unmap an empty macro name"))
-
+
;; convert macro names into vector, if starts with a `['
(if (memq (elt macro-name 0) '(?\[ ?\"))
(car (read-from-string macro-name))
(vconcat macro-name))
))
-
-
+
+
;; Terminate a Vi kbd macro.
;; optional argument IGNORE, if t, indicates that we are dealing with an
;; existing macro that needs to be registered, but there is no need to
@@ -311,11 +311,11 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
;; always go back to Vi, since this is where we started
;; defining macro
(viper-change-state-to-vi)))
-
+
(viper-record-kbd-macro macro-name
(if ins 'insert-state 'vi-state)
(viper-display-macro macro-body))
-
+
(ex-fixup-history (format "map%s %S %S" mod-char
(viper-display-macro macro-name)
(viper-display-macro macro-body)))
@@ -337,7 +337,7 @@ define the macro. MACRO-BODY is a string that represents the keyboard macro.
Optional SCOPE says whether the macro should be global \(t\), mode-specific
\(a major-mode symbol\), or buffer-specific \(buffer name, a string\).
If SCOPE is nil, the user is asked to specify the scope."
- (let* (state-name keymap
+ (let* (state-name keymap
(macro-alist-var
(cond ((eq state 'vi-state)
(setq state-name "Vi state"
@@ -354,20 +354,20 @@ If SCOPE is nil, the user is asked to specify the scope."
))
new-elt old-elt old-sub-elt msg
temp lis lis2)
-
+
(if (= (length macro-name) 0)
(error "Can't map an empty macro name"))
-
+
;; Macro-name is usually a vector. However, command history or macros
;; recorded in ~/.viper may be recorded as strings. So, convert to
- ;; vectors.
+ ;; vectors.
(setq macro-name (viper-fixup-macro macro-name))
(if (viper-char-array-p macro-name)
(setq macro-name (viper-char-array-to-macro macro-name)))
(setq macro-body (viper-fixup-macro macro-body))
(if (viper-char-array-p macro-body)
(setq macro-body (viper-char-array-to-macro macro-body)))
-
+
;; don't ask if scope is given and is of the right type
(or (eq scope t)
(stringp scope)
@@ -423,7 +423,7 @@ If SCOPE is nil, the user is asked to specify the scope."
(if (y-or-n-p
(format "Save this macro in %s? "
(viper-abbreviate-file-name viper-custom-file-name)))
- (viper-save-string-in-file
+ (viper-save-string-in-file
(format "\n(viper-record-kbd-macro %S '%S %s '%S)"
(viper-display-macro macro-name)
state
@@ -436,12 +436,12 @@ If SCOPE is nil, the user is asked to specify the scope."
(if (vectorp macro-body)
(format "%S" macro-body)
macro-body)
- scope)
+ scope)
viper-custom-file-name))
-
+
(message msg)
))
-
+
(setq new-elt
(cons macro-name
(cond ((eq scope t) (list nil nil (cons t nil)))
@@ -463,7 +463,7 @@ If SCOPE is nil, the user is asked to specify the scope."
(viper-array-to-string macro-name)))
(setq lis2 (cons (car lis) lis2))
(setq lis (cdr lis)))
-
+
(setq lis2 (reverse lis2))
(set macro-alist-var (append lis2 (cons new-elt lis)))
(setq old-elt new-elt)))
@@ -471,7 +471,7 @@ If SCOPE is nil, the user is asked to specify the scope."
(cond ((eq scope t) (viper-kbd-global-pair old-elt))
((symbolp scope) (assoc scope (viper-kbd-mode-alist old-elt)))
((stringp scope) (assoc scope (viper-kbd-buf-alist old-elt)))))
- (if old-sub-elt
+ (if old-sub-elt
(setcdr old-sub-elt macro-body)
(cond ((symbolp scope) (setcar (cdr (cdr old-elt))
(cons (cons scope macro-body)
@@ -480,9 +480,9 @@ If SCOPE is nil, the user is asked to specify the scope."
(cons (cons scope macro-body)
(viper-kbd-buf-alist old-elt))))))
))
-
-
+
+
;; macro name must be a vector of viper-style keys
(defun viper-unrecord-kbd-macro (macro-name state)
"Delete macro MACRO-NAME from Viper STATE.
@@ -491,7 +491,7 @@ internally, but the user can also use it in ~/.viper to delete pre-defined
macros supplied with Viper. The best way to avoid mistakes in macro names to
be passed to this function is to use viper-describe-kbd-macros and copy the
name from there."
- (let* (state-name keymap
+ (let* (state-name keymap
(macro-alist-var
(cond ((eq state 'vi-state)
(setq state-name "Vi state"
@@ -508,7 +508,7 @@ name from there."
))
buf-mapping mode-mapping global-mapping
macro-pair macro-entry)
-
+
;; Macro-name is usually a vector. However, command history or macros
;; recorded in ~/.viper may appear as strings. So, convert to vectors.
(setq macro-name (viper-fixup-macro macro-name))
@@ -522,11 +522,11 @@ name from there."
(error "%S is not mapped to a macro for %s in `%s'"
(viper-display-macro macro-name)
state-name (buffer-name)))
-
+
(setq buf-mapping (viper-kbd-buf-pair macro-entry)
mode-mapping (viper-kbd-mode-pair macro-entry)
global-mapping (viper-kbd-global-pair macro-entry))
-
+
(cond ((and (cdr buf-mapping)
(or (and (not (cdr mode-mapping)) (not (cdr global-mapping)))
(y-or-n-p
@@ -534,7 +534,7 @@ name from there."
(viper-display-macro macro-name)
(buffer-name)))))
(setq macro-pair buf-mapping)
- (message "%S is unmapped for %s in `%s'"
+ (message "%S is unmapped for %s in `%s'"
(viper-display-macro macro-name)
state-name (buffer-name)))
((and (cdr mode-mapping)
@@ -559,7 +559,7 @@ name from there."
(cdr global-mapping)
(progn
(set macro-alist-var (delq macro-entry (eval macro-alist-var)))
- (if (viper-can-release-key (aref macro-name 0)
+ (if (viper-can-release-key (aref macro-name 0)
(eval macro-alist-var))
(define-key
keymap
@@ -567,7 +567,7 @@ name from there."
nil))
))
))
-
+
;; Check if MACRO-ALIST has an entry for a macro name starting with
;; CHAR. If not, this indicates that the binding for this char
;; in viper-vi/insert-kbd-map can be released.
@@ -575,7 +575,7 @@ name from there."
(let ((lis macro-alist)
(can-release t)
macro-name)
-
+
(while (and lis can-release)
(setq macro-name (car (car lis)))
(if (eq char (aref macro-name 0))
@@ -602,13 +602,13 @@ name from there."
next-best-match keyseq event-seq
macro-first-char macro-alist-elt macro-body
command)
-
+
(setq macro-first-char last-command-event
event-seq (viper-read-fast-keysequence macro-first-char macro-alist)
keyseq (viper-events-to-macro event-seq)
macro-alist-elt (assoc keyseq macro-alist)
next-best-match (viper-find-best-matching-macro macro-alist keyseq))
-
+
(if (null macro-alist-elt)
(setq macro-alist-elt (car next-best-match)
unmatched-suffix (subseq event-seq (cdr next-best-match))))
@@ -617,7 +617,7 @@ name from there."
((setq macro-body (viper-kbd-buf-definition macro-alist-elt)))
((setq macro-body (viper-kbd-mode-definition macro-alist-elt)))
((setq macro-body (viper-kbd-global-definition macro-alist-elt))))
-
+
;; when defining keyboard macro, don't use the macro mappings
(if (and macro-body (not defining-kbd-macro))
;; block cmd executed as part of a macro from entering command history
@@ -634,7 +634,7 @@ name from there."
;; some other command (setting prefix arg can happen if we do, say,
;; 2dw and there is a macro starting with 2. Then control will go to
;; this routine
- (or prefix-arg (setq prefix-arg count))
+ (or prefix-arg (setq prefix-arg count))
(setq command (key-binding (read-key-sequence nil)))
(if (commandp command)
(command-execute command)
@@ -644,7 +644,7 @@ name from there."
;;; Displaying and completing macros
-
+
(defun viper-describe-kbd-macros ()
"Show currently defined keyboard macros."
(interactive)
@@ -656,7 +656,7 @@ name from there."
(princ "\n\nMacros in Emacs state:\n======================\n")
(mapcar 'viper-describe-one-macro viper-emacs-kbd-macro-alist)
))
-
+
(defun viper-describe-one-macro (macro)
(princ (format "\n *** Mappings for %S:\n ------------\n"
(viper-display-macro (car macro))))
@@ -673,29 +673,29 @@ name from there."
(princ (format "\n %S" (cdr (viper-kbd-global-pair macro))))
(princ " none"))
(princ "\n"))
-
+
(defun viper-describe-one-macro-elt (elt)
(let ((name (car elt))
(defn (cdr elt)))
(princ (format "\n * %S:\n %S\n" name defn))))
-
-
-
+
+
+
;; check if SEQ is a prefix of some car of an element in ALIST
(defun viper-keyseq-is-a-possible-macro (seq alist)
(let ((converted-seq (viper-events-to-macro seq)))
- (eval (cons 'or
+ (eval (cons 'or
(mapcar
(lambda (elt) (viper-prefix-subseq-p converted-seq elt))
(viper-this-buffer-macros alist))))))
-
+
;; whether SEQ1 is a prefix of SEQ2
(defun viper-prefix-subseq-p (seq1 seq2)
(let ((len1 (length seq1))
(len2 (length seq2)))
(if (<= len1 len2)
(equal seq1 (subseq seq2 0 len1)))))
-
+
;; find the longest common prefix
(defun viper-common-seq-prefix (&rest seqs)
(let* ((first (car seqs))
@@ -707,18 +707,18 @@ name from there."
(setq len 0)
(setq len (apply 'min (mapcar 'length seqs))))
(while (< idx len)
- (if (eval (cons 'and
+ (if (eval (cons 'and
(mapcar (lambda (s) (equal (elt first idx) (elt s idx)))
rest)))
(setq pref (vconcat pref (vector (elt first idx)))))
(setq idx (1+ idx)))
pref))
-
+
;; get all sequences that match PREFIX from a given A-LIST
(defun viper-extract-matching-alist-members (pref alist)
(delq nil (mapcar (lambda (elt) (if (viper-prefix-subseq-p pref elt) elt))
(viper-this-buffer-macros alist))))
-
+
(defun viper-do-sequence-completion (seq alist compl-message)
(let* ((matches (viper-extract-matching-alist-members seq alist))
(new-seq (apply 'viper-common-seq-prefix matches))
@@ -726,27 +726,27 @@ name from there."
(cond ((and (equal seq new-seq) (= (length matches) 1))
(message "%s (Sole completion)" compl-message)
(sit-for 2))
- ((null matches)
+ ((null matches)
(message "%s (No match)" compl-message)
(sit-for 2)
(setq new-seq seq))
- ((member seq matches)
+ ((member seq matches)
(message "%s (Complete, but not unique)" compl-message)
(sit-for 2)
(viper-display-vector-completions matches))
((equal seq new-seq)
(viper-display-vector-completions matches)))
new-seq))
-
-
+
+
(defun viper-display-vector-completions (list)
(with-output-to-temp-buffer "*Completions*"
- (display-completion-list
+ (display-completion-list
(mapcar 'prin1-to-string
(mapcar 'viper-display-macro list)))))
-
-
-
+
+
+
;; alist is the alist of macros
;; str is the fast key sequence entered
;; returns: (matching-macro-def . unmatched-suffix-start-index)
@@ -766,17 +766,17 @@ name from there."
(setq found t))
)
(setq lis (cdr lis)))
-
+
(if found
(setq match macro-def
unmatched-start-idx def-len)
(setq match nil
unmatched-start-idx 0))
-
+
(cons match unmatched-start-idx)))
-
-
-
+
+
+
;; returns a list of names of macros defined for the current buffer
(defun viper-this-buffer-macros (macro-alist)
(let (candidates)
@@ -788,8 +788,8 @@ name from there."
(car elt)))
macro-alist))
(setq candidates (delq nil candidates))))
-
-
+
+
;; if seq of Viper key symbols (representing a macro) can be converted to a
;; string--do so. Otherwise, do nothing.
(defun viper-display-macro (macro-name-or-body)
@@ -798,7 +798,7 @@ name from there."
((viper-char-array-p macro-name-or-body)
(mapconcat 'char-to-string macro-name-or-body ""))
(t macro-name-or-body)))
-
+
;; convert sequence of events (that came presumably from emacs kbd macro) into
;; Viper's macro, which is a vector of the form
;; [ desc desc ... ]
@@ -813,7 +813,7 @@ name from there."
nil
(viper-event-key elt)))
event-seq))))
-
+
;; convert strings or arrays of characters to Viper macro form
(defun viper-char-array-to-macro (array)
(let ((vec (vconcat array))
@@ -822,7 +822,7 @@ name from there."
(setq macro (mapcar 'character-to-event vec))
(setq macro vec))
(vconcat (mapcar 'viper-event-key macro))))
-
+
;; For macros bodies and names, goes over MACRO and checks if all members are
;; names of keys (actually, it only checks if they are symbols or lists
;; if a digit is found, it is converted into a symbol (e.g., 0 -> \0, etc).
@@ -850,18 +850,18 @@ name from there."
((symbolp elt) nil)
(t (setq break t)))
(setq idx (1+ idx))))
-
+
(if break
(error "Wrong type macro component, symbol-or-listp, %S" elt)
macro)))
-
+
(defun viper-macro-to-events (macro-body)
(vconcat (mapcar 'viper-key-to-emacs-key macro-body)))
-
-
+
+
;;; Reading fast key sequences
-
+
;; Assuming that CHAR was the first character in a fast succession of key
;; strokes, read the rest. Return the vector of keys that was entered in
;; this fast succession of key strokes.
@@ -902,7 +902,7 @@ name from there."
(viper-set-register-macro reg))
(execute-kbd-macro (get-register reg) count)))
((or (= ?@ reg) (= ?\^j reg) (= ?\^m reg))
- (if viper-last-macro-reg
+ (if viper-last-macro-reg
nil
(error "No previous kbd macro"))
(execute-kbd-macro (get-register viper-last-macro-reg) count))
@@ -916,7 +916,7 @@ name from there."
(viper-set-register-macro reg))))
(t
(error "`%c': Unknown register" reg)))))
-
+
(defun viper-global-execute ()
"Call last keyboad macro for each line in the region."
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 330f93fc49..1889a901e8 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -58,23 +58,23 @@
;;; Variables
-
+
;; Variable used for catching the switch-frame event.
;; If non-nil, indicates that previous-frame should be the selected
;; one. Used by viper-mouse-click-get-word. Not a user option.
(defvar viper-frame-of-focus nil)
-
+
;; Frame that was selected before the switch-frame event.
(defconst viper-current-frame-saved (selected-frame))
-
+
(defcustom viper-surrounding-word-function 'viper-surrounding-word
"*Function that determines what constitutes a word for clicking events.
-Takes two parameters: a COUNT, indicating how many words to return,
+Takes two parameters: a COUNT, indicating how many words to return,
and CLICK-COUNT, telling whether this is the first click, a double-click,
or a tripple-click."
:type 'symbol
:group 'viper-mouse)
-
+
;; time interval in millisecond within which successive clicks are
;; considered related
(defcustom viper-multiclick-timeout (if (viper-window-display-p)
@@ -94,10 +94,10 @@ considered related."
;; Local variable used to toggle wraparound search on click.
(viper-deflocalvar viper-mouse-click-search-noerror t)
-
+
;; Local variable used to delimit search after wraparound.
(viper-deflocalvar viper-mouse-click-search-limit nil)
-
+
;; remembers prefix argument to pass along to commands invoked by second
;; click.
;; This is needed because in Emacs (not XEmacs), assigning to preix-arg
@@ -147,7 +147,7 @@ considered related."
(event-point click) ; xemacs
(posn-point (event-start click)) ; emacs
))
-
+
(defun viper-surrounding-word (count click-count)
"Returns word surrounding point according to a heuristic.
@@ -174,7 +174,7 @@ is ignored."
(setq beg (point))
(end-of-line)
(setq result (buffer-substring beg (point))))
-
+
(if (and (not (viper-looking-at-alphasep))
(or (save-excursion (viper-backward-char-carefully)
(viper-looking-at-alpha))
@@ -194,13 +194,13 @@ is ignored."
(t (char-to-string (following-char))))
)
))
-
+
;; Add `-' to alphanum, if it wasn't added and if we are in Lisp
(or (looking-at "-")
(not (string-match "lisp" (symbol-name major-mode)))
(setq modifiers (concat modifiers "C-C-")))
-
-
+
+
(save-excursion
(cond ((> click-count 1) (viper-skip-nonseparators 'backward))
((viper-looking-at-alpha modifiers)
@@ -212,7 +212,7 @@ is ignored."
(viper-skip-alpha-backward modifiers))))
(setq word-beg (point))
-
+
(setq skip-flag nil) ; don't move 1 char forw the first time
(while (> count 0)
(if skip-flag (viper-forward-char-carefully 1))
@@ -237,19 +237,19 @@ is ignored."
Click may be in another window. Current window and buffer isn't changed.
On single or double click, returns the word as determined by
`viper-surrounding-word-function'."
-
+
(let ((click-word "")
(click-pos (viper-mouse-click-posn click))
(click-buf (viper-mouse-click-window-buffer click)))
(or (natnump count) (setq count 1))
(or (natnump click-count) (setq click-count 1))
-
+
(save-excursion
(save-window-excursion
(if click-pos
(progn
(set-buffer click-buf)
-
+
(goto-char click-pos)
(setq click-word
(funcall viper-surrounding-word-function count click-count)))
@@ -280,7 +280,7 @@ See `viper-surrounding-word' for the definition of a word in this case."
((and (listp arg) (integerp (car arg)))
(setq arg (car arg)))
(t (setq arg 1)))
-
+
(if (not (eq (key-binding viper-mouse-down-insert-key-parsed)
'viper-mouse-catch-frame-switch))
() ; do nothing
@@ -309,13 +309,13 @@ See `viper-surrounding-word' for the definition of a word in this case."
(not (viper-mouse-event-p interrupting-event)))
(viper-set-unread-command-events interrupting-event))
)))))
-
+
;; Arg is an event. Accepts symbols and numbers, too
(defun viper-mouse-event-p (event)
(if (eventp event)
(string-match "\\(mouse-\\|frame\\|screen\\|track\\)"
(prin1-to-string (viper-event-key event)))))
-
+
;; XEmacs has no double-click events. So, we must simulate.
;; So, we have to simulate event-click-count.
(defun viper-event-click-count (click)
@@ -323,7 +323,7 @@ See `viper-surrounding-word' for the definition of a word in this case."
(viper-event-click-count-xemacs click) ; xemacs
(event-click-count click) ; emacs
))
-
+
;; kind of semaphore for updating viper-current-click-count
(defvar viper-counting-clicks-p nil)
(viper-cond-compile-for-xemacs-or-emacs
@@ -346,7 +346,7 @@ See `viper-surrounding-word' for the definition of a word in this case."
))
nil ; emacs
)
-
+
(defun viper-mouse-click-search-word (click arg)
"Find the word clicked or double-clicked on. Word may be in another window.
@@ -367,7 +367,7 @@ this command."
() ; do nothing, if binding isn't right or not over text
(let ((previous-search-string viper-s-string)
click-word click-count)
-
+
(if (and
(viper-multiclick-p)
;; This trick checks if there is a pending mouse event if so, we use
@@ -387,12 +387,12 @@ this command."
;; uninterrupted wait
(setq click-count (viper-event-click-count click))
(setq click-word (viper-mouse-click-get-word click nil click-count))
-
+
(if (> click-count 1)
(setq arg viper-global-prefix-argument
viper-global-prefix-argument nil))
(setq arg (or arg 1))
-
+
(viper-deactivate-mark)
(if (or (not (string= click-word viper-s-string))
(not (markerp viper-search-start-marker))
@@ -404,7 +404,7 @@ this command."
viper-local-search-start-marker viper-search-start-marker
viper-mouse-click-search-noerror t
viper-mouse-click-search-limit nil)
-
+
;; make search string known to Viper
(setq viper-s-string (if viper-re-search
(regexp-quote click-word)
@@ -413,7 +413,7 @@ this command."
(setq viper-search-history
(cons viper-s-string viper-search-history)))
))
-
+
(push-mark nil t)
(while (> arg 0)
(viper-forward-word 1)
@@ -431,7 +431,7 @@ this command."
(marker-buffer viper-local-search-start-marker))
(goto-char viper-local-search-start-marker))
(viper-line-pos 'end)))
-
+
(goto-char (point-min))
(search-forward click-word
viper-mouse-click-search-limit nil)))
@@ -452,14 +452,14 @@ this command."
click-word (buffer-name (current-buffer)))
(setq arg 1) ;; to terminate the loop
(sit-for 2))
- (setq viper-mouse-click-search-noerror t)
+ (setq viper-mouse-click-search-noerror t)
(setq viper-mouse-click-search-limit nil)
(if (and (markerp viper-local-search-start-marker)
(marker-buffer viper-local-search-start-marker))
(goto-char viper-local-search-start-marker))))
(setq arg (1- arg)))
))))
-
+
(defun viper-mouse-catch-frame-switch (event arg)
"Catch the event of switching frame.
Usually is bound to a `down-mouse' event to work properly. See sample
@@ -472,10 +472,10 @@ bindings in the Viper manual."
(setq viper-frame-of-focus viper-current-frame-saved))
;; make Emacs forget that it executed viper-mouse-catch-frame-switch
(setq this-command last-command))
-
+
;; Called just before switching frames. Saves the old selected frame.
;; Sets last-command to handle-switch-frame (this is done automatically in
-;; Emacs.
+;; Emacs.
;; The semantics of switching frames is different in Emacs and XEmacs.
;; In Emacs, if you select-frame A while mouse is over frame B and then
;; start typing, input goes to frame B, which becomes selected.
@@ -575,21 +575,21 @@ bindings in the Viper manual."
(cond ((or (null viper-mouse-up-search-key-parsed)
(null viper-mouse-down-search-key-parsed))
nil) ; just quit
- ((and (null force)
+ ((and (null force)
(key-binding viper-mouse-up-search-key-parsed)
(not (eq (key-binding viper-mouse-up-search-key-parsed)
'viper-mouse-click-search-word)))
- (message
+ (message
"%S already bound to a mouse event. Viper mouse-search feature disabled"
viper-mouse-up-search-key-parsed))
- ((and (null force)
+ ((and (null force)
(key-binding viper-mouse-down-search-key-parsed)
(not (eq (key-binding viper-mouse-down-search-key-parsed)
'viper-mouse-catch-frame-switch)))
(message
"%S already bound to a mouse event. Viper mouse-search feature disabled"
viper-mouse-down-search-key-parsed))
- (t
+ (t
(global-set-key viper-mouse-up-search-key-parsed
'viper-mouse-click-search-word)
(global-set-key viper-mouse-down-search-key-parsed
@@ -608,7 +608,7 @@ bindings in the Viper manual."
(key-binding viper-mouse-up-insert-key-parsed)
(not (eq (key-binding viper-mouse-up-insert-key-parsed)
'viper-mouse-click-insert-word)))
- (message
+ (message
"%S already bound to a mouse event. Viper mouse-insert feature disabled"
viper-mouse-up-insert-key-parsed))
((and (null force)
@@ -618,7 +618,7 @@ bindings in the Viper manual."
(message
"%S already bound to a mouse event. Viper mouse-insert feature disabled"
viper-mouse-down-insert-key-parsed))
- (t
+ (t
(global-set-key viper-mouse-up-insert-key-parsed
'viper-mouse-click-insert-word)
(global-set-key viper-mouse-down-insert-key-parsed
@@ -666,7 +666,7 @@ This buffer may be different from the one where the click occurred."
(integer :tag "Button"))
:set 'viper-reset-mouse-insert-key
:group 'viper-mouse)
-
+
;;; Local Variables:
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 2bbdb828ff..fc7f0c8223 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -136,20 +136,20 @@
(eq (device-class (selected-device)) 'color) ; xemacs
(x-display-color-p) ; emacs
))
-
+
(defsubst viper-get-cursor-color ()
(viper-cond-compile-for-xemacs-or-emacs
;; xemacs
(color-instance-name (frame-property (selected-frame) 'cursor-color))
(cdr (assoc 'cursor-color (frame-parameters))) ; emacs
))
-
+
;; OS/2
(cond ((eq (viper-device-type) 'pm)
(fset 'viper-color-defined-p
(lambda (color) (assoc color pm-color-alist)))))
-
+
;; cursor colors
(defun viper-change-cursor-color (new-color)
@@ -163,7 +163,7 @@
(selected-frame) (list (cons 'cursor-color new-color)))
)
))
-
+
;; By default, saves current frame cursor color in the
;; viper-saved-cursor-color-in-replace-mode property of viper-replace-overlay
(defun viper-save-cursor-color (before-which-mode)
@@ -180,7 +180,7 @@
'viper-saved-cursor-color-in-insert-mode)
color)))
))))
-
+
(defsubst viper-get-saved-cursor-color-in-replace-mode ()
(or
@@ -197,7 +197,7 @@
(selected-frame)
'viper-saved-cursor-color-in-insert-mode)
viper-vi-state-cursor-color))
-
+
;; restore cursor color from replace overlay
(defun viper-restore-cursor-color(after-which-mode)
(if (viper-overlay-p viper-replace-overlay)
@@ -206,7 +206,7 @@
(viper-get-saved-cursor-color-in-replace-mode)
(viper-get-saved-cursor-color-in-insert-mode))
)))
-
+
;; Check the current version against the major and minor version numbers
;; using op: cur-vers op major.minor If emacs-major-version or
@@ -234,14 +234,14 @@
(error "%S: Invalid op in viper-check-version" op))))
(cond ((memq op '(= > >=)) nil)
((memq op '(< <=)) t))))
-
+
(defun viper-get-visible-buffer-window (wind)
(if viper-xemacs-p
(get-buffer-window wind t)
(get-buffer-window wind 'visible)))
-
-
+
+
;; Return line position.
;; If pos is 'start then returns position of line start.
;; If pos is 'end, returns line end. If pos is 'mid, returns line center.
@@ -286,7 +286,7 @@
;; Like move-marker but creates a virgin marker if arg isn't already a marker.
;; The first argument must eval to a variable name.
;; Arguments: (var-name position &optional buffer).
-;;
+;;
;; This is useful for moving markers that are supposed to be local.
;; For this, VAR-NAME should be made buffer-local with nil as a default.
;; Then, each time this var is used in `viper-move-marker-locally' in a new
@@ -309,14 +309,14 @@
;;; List/alist utilities
-
+
;; Convert LIST to an alist
(defun viper-list-to-alist (lst)
(let ((alist))
(while lst
(setq alist (cons (list (car lst)) alist))
(setq lst (cdr lst)))
- alist))
+ alist))
;; Convert ALIST to a list.
(defun viper-alist-to-list (alst)
@@ -334,8 +334,8 @@
(if (string-match regexp (car (car inalst)))
(setq outalst (cons (car inalst) outalst)))
(setq inalst (cdr inalst)))
- outalst))
-
+ outalst))
+
;; Filter LIST using REGEXP. Return list whose elements match the regexp.
(defun viper-filter-list (regexp lst)
(interactive "s x")
@@ -344,9 +344,9 @@
(if (string-match regexp (car inlst))
(setq outlst (cons (car inlst) outlst)))
(setq inlst (cdr inlst)))
- outlst))
+ outlst))
+
-
;; Append LIS2 to LIS1, both alists, by side-effect and returns LIS1
;; LIS2 is modified by filtering it: deleting its members of the form
;; \(car elt\) such that (car elt') is in LIS1.
@@ -359,7 +359,7 @@
(while (setq elt (assoc (car (car temp)) lis2))
(setq lis2 (delq elt lis2)))
(setq temp (cdr temp)))
-
+
(nconc lis1 lis2)))
@@ -380,7 +380,7 @@
(command (cond (viper-ms-style-os-p (format "\"ls -1 -d %s\"" filespec))
(t (format "ls -1 -d %s" filespec))))
status)
- (save-excursion
+ (save-excursion
(set-buffer (get-buffer-create viper-ex-tmp-buf-name))
(erase-buffer)
(setq status
@@ -425,7 +425,7 @@
((looking-at "'")
(setq delim ?')
(re-search-forward "[^']+" nil t)) ; noerror
- (t
+ (t
(re-search-forward
(concat "[^" skip-chars "]+") nil t))) ;noerror
(setq fname
@@ -459,14 +459,14 @@
(defun viper-glob-mswindows-files (filespec)
(let ((case-fold-search t)
tmp tmp2)
- (save-excursion
+ (save-excursion
(set-buffer (get-buffer-create viper-ex-tmp-buf-name))
(erase-buffer)
(insert filespec)
(goto-char (point-min))
(setq tmp (viper-get-filenames-from-buffer))
(while tmp
- (setq tmp2 (cons (directory-files
+ (setq tmp2 (cons (directory-files
;; the directory part
(or (file-name-directory (car tmp))
"")
@@ -495,7 +495,7 @@
(t (car ring))))
(viper-current-ring-item ring)
)))
-
+
(defun viper-special-ring-rotate1 (ring dir)
(if (memq viper-intermediate-command
'(repeating-display-destructive-command
@@ -503,14 +503,14 @@
(viper-ring-rotate1 ring dir)
;; don't rotate otherwise
(viper-ring-rotate1 ring 0)))
-
+
;; current ring item; if N is given, then so many items back from the
;; current
(defun viper-current-ring-item (ring &optional n)
(setq n (or n 0))
(if (and (ring-p ring) (> (ring-length ring) 0))
(aref (cdr (cdr ring)) (mod (- (car ring) 1 n) (ring-length ring)))))
-
+
;; Push item onto ring. The second argument is a ring-variable, not value.
(defun viper-push-onto-ring (item ring-var)
(or (ring-p (eval ring-var))
@@ -532,7 +532,7 @@
(viper-array-to-string (this-command-keys))))
(viper-ring-insert (eval ring-var) item))
)
-
+
;; removing elts from ring seems to break it
(defun viper-cleanup-ring (ring)
@@ -542,7 +542,7 @@
(if (equal (viper-current-ring-item ring)
(viper-current-ring-item ring 1))
(viper-ring-pop ring))))
-
+
;; ring-remove seems to be buggy, so we concocted this for our purposes.
(defun viper-ring-pop (ring)
(let* ((ln (ring-length ring))
@@ -551,20 +551,20 @@
(hd (car ring))
(idx (max 0 (ring-minus1 hd ln)))
(top-elt (aref vec idx)))
-
+
;; shift elements
(while (< (1+ idx) veclen)
(aset vec idx (aref vec (1+ idx)))
(setq idx (1+ idx)))
(aset vec idx nil)
-
+
(setq hd (max 0 (ring-minus1 hd ln)))
(if (= hd (1- ln)) (setq hd 0))
(setcar ring hd) ; move head
(setcar (cdr ring) (max 0 (1- ln))) ; adjust length
top-elt
))
-
+
(defun viper-ring-insert (ring item)
(let* ((ln (ring-length ring))
(vec (cdr (cdr ring)))
@@ -572,7 +572,7 @@
(hd (car ring))
(vecpos-after-hd (if (= hd 0) ln hd))
(idx ln))
-
+
(if (= ln veclen)
(progn
(aset vec hd item) ; hd is always 1+ the actual head index in vec
@@ -584,7 +584,7 @@
(setq idx (1- idx)))
(aset vec vecpos-after-hd item))
item))
-
+
;;; String utilities
@@ -592,12 +592,12 @@
;; PRE-STRING is a string to prepend to the abbrev string.
;; POST-STRING is a string to append to the abbrev string.
;; ABBREV_SIGN is a string to be inserted before POST-STRING
-;; if the orig string was truncated.
+;; if the orig string was truncated.
(defun viper-abbreviate-string (string max-len
pre-string post-string abbrev-sign)
(let (truncated-str)
(setq truncated-str
- (if (stringp string)
+ (if (stringp string)
(substring string 0 (min max-len (length string)))))
(cond ((null truncated-str) "")
((> (length string) max-len)
@@ -610,7 +610,7 @@
(save-excursion
(beginning-of-line)
(looking-at "^[ \t]*$")))
-
+
;;; Saving settings in custom file
@@ -644,7 +644,7 @@
(sit-for 2)
(message "")))
))
-
+
;; Save STRING in CUSTOM-FILE. If PATTERN is non-nil, remove strings that
;; match this pattern.
(defun viper-save-string-in-file (string custom-file &optional pattern)
@@ -670,7 +670,7 @@
;; Can happen only in Emacs, since XEmacs has file-remote-p
(ange-ftp-ftp-name file-name))))))
-
+
;; This is a simple-minded check for whether a file is under version control.
;; If file,v exists but file doesn't, this file is considered to be not checked
@@ -721,9 +721,9 @@
(viper-abbreviate-file-name file))))
(with-current-buffer buf
(command-execute checkout-function)))))
-
-
+
+
;;; Overlays
(defun viper-put-on-search-overlay (beg end)
@@ -756,7 +756,7 @@
(defsubst viper-move-replace-overlay (beg end)
(viper-move-overlay viper-replace-overlay beg end))
-
+
(defun viper-set-replace-overlay (beg end)
(if (viper-overlay-live-p viper-replace-overlay)
(viper-move-replace-overlay beg end)
@@ -764,7 +764,7 @@
;; never detach
(viper-overlay-put
viper-replace-overlay (if viper-emacs-p 'evaporate 'detachable) nil)
- (viper-overlay-put
+ (viper-overlay-put
viper-replace-overlay 'priority viper-replace-overlay-priority)
;; If Emacs will start supporting overlay maps, as it currently supports
;; text-property maps, we could do away with viper-replace-minor-mode and
@@ -773,15 +773,15 @@
;; viper-replace-overlay
;; (if viper-xemacs-p 'keymap 'local-map)
;; viper-replace-map)
- )
+ )
(if (viper-has-face-support-p)
(viper-overlay-put
viper-replace-overlay 'face viper-replace-overlay-face))
(viper-save-cursor-color 'before-replace-mode)
(viper-change-cursor-color viper-replace-overlay-cursor-color)
)
-
-
+
+
(defun viper-set-replace-overlay-glyphs (before-glyph after-glyph)
(or (viper-overlay-live-p viper-replace-overlay)
(viper-set-replace-overlay (point-min) (point-min)))
@@ -791,7 +791,7 @@
(after-name (if viper-xemacs-p 'end-glyph 'after-string)))
(viper-overlay-put viper-replace-overlay before-name before-glyph)
(viper-overlay-put viper-replace-overlay after-name after-glyph))))
-
+
(defun viper-hide-replace-overlay ()
(viper-set-replace-overlay-glyphs nil nil)
(viper-restore-cursor-color 'after-replace-mode)
@@ -799,12 +799,12 @@
(if (viper-has-face-support-p)
(viper-overlay-put viper-replace-overlay 'face nil)))
-
+
(defsubst viper-replace-start ()
(viper-overlay-start viper-replace-overlay))
(defsubst viper-replace-end ()
(viper-overlay-end viper-replace-overlay))
-
+
;; Minibuffer
@@ -814,7 +814,7 @@
(progn
(viper-overlay-put
viper-minibuffer-overlay 'face viper-minibuffer-current-face)
- (viper-overlay-put
+ (viper-overlay-put
viper-minibuffer-overlay 'priority viper-minibuffer-overlay-priority)
;; never detach
(viper-overlay-put
@@ -828,7 +828,7 @@
(viper-overlay-put viper-minibuffer-overlay 'start-open nil)
(viper-overlay-put viper-minibuffer-overlay 'end-open nil)))
)))
-
+
(defun viper-check-minibuffer-overlay ()
(if (viper-overlay-live-p viper-minibuffer-overlay)
(viper-move-overlay
@@ -849,7 +849,7 @@
(defsubst viper-is-in-minibuffer ()
(save-match-data
(string-match "\*Minibuf-" (buffer-name))))
-
+
;;; XEmacs compatibility
@@ -861,8 +861,8 @@
;; emacs
(abbreviate-file-name file)
))
-
-;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
+
+;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
;; in sit-for, so this function smoothes out the differences.
(defsubst viper-sit-for-short (val &optional nodisp)
(if viper-xemacs-p
@@ -883,7 +883,7 @@
(save-excursion
(set-buffer buf)
(and (<= pos (point-max)) (<= (point-min) pos))))))
-
+
(defsubst viper-mark-marker ()
(viper-cond-compile-for-xemacs-or-emacs
(mark-marker t) ; xemacs
@@ -896,7 +896,7 @@
(setq mark-ring (delete (viper-mark-marker) mark-ring))
(set-mark-command nil)
(setq viper-saved-mark (point)))
-
+
;; In transient mark mode (zmacs mode), it is annoying when regions become
;; highlighted due to Viper's pushing marks. So, we deactivate marks, unless
;; the user explicitly wants highlighting, e.g., by hitting '' or ``
@@ -927,8 +927,8 @@
(and (<= ?A reg) (<= reg ?Z)))
))
-
-
+
+
;; it is suggested that an event must be copied before it is assigned to
;; last-command-event in XEmacs
(defun viper-copy-event (event)
@@ -936,15 +936,15 @@
(copy-event event) ; xemacs
event ; emacs
))
-
+
;; Uses different timeouts for ESC-sequences and others
(defsubst viper-fast-keysequence-p ()
- (not (viper-sit-for-short
+ (not (viper-sit-for-short
(if (viper-ESC-event-p last-input-event)
viper-ESC-keyseq-timeout
viper-fast-keyseq-timeout)
t)))
-
+
;; like read-event, but in XEmacs also try to convert to char, if possible
(defun viper-read-event-convert-to-char ()
(let (event)
@@ -978,7 +978,7 @@
;; keysequence. Otherwise, viper-fast-keysequence-p will be
;; always t -- whether there is anything after ESC or not
(viper-set-unread-command-events keyseq)
- (setq keyseq (read-key-sequence nil)))
+ (setq keyseq (read-key-sequence nil)))
(viper-set-unread-command-events keyseq)
(setq keyseq (read-key-sequence nil)))))
keyseq))
@@ -989,13 +989,13 @@
;; macros, since it enables certain macros to be shared between X and TTY modes
;; by correctly mapping key sequences for Left/Right/... (one an ascii
;; terminal) into logical keys left, right, etc.
-(defun viper-read-key ()
- (let ((overriding-local-map viper-overriding-map)
+(defun viper-read-key ()
+ (let ((overriding-local-map viper-overriding-map)
(inhibit-quit t)
- help-char key)
- (use-global-map viper-overriding-map)
+ help-char key)
+ (use-global-map viper-overriding-map)
(unwind-protect
- (setq key (elt (viper-read-key-sequence nil) 0))
+ (setq key (elt (viper-read-key-sequence nil) 0))
(use-global-map global-map))
key))
@@ -1019,7 +1019,7 @@
(event-key event))
((button-event-p event)
(concat "mouse-" (prin1-to-string (event-button event))))
- (t
+ (t
(error "viper-event-key: Unknown event, %S" event)))
;; Emacs doesn't handle capital letters correctly, since
;; \S-a isn't considered the same as A (it behaves as
@@ -1053,7 +1053,7 @@
(if mod
(append mod (list basis))
basis))))
-
+
(defun viper-key-to-emacs-key (key)
(let (key-name char-p modifiers mod-char-list base-key base-key-name)
(cond (viper-xemacs-p key)
@@ -1109,7 +1109,7 @@
"viper-eventify-list-xemacs: can't convert to event, %S"
elt))))
lis))
-
+
;; Smoothes out the difference between Emacs' unread-command-events
;; and XEmacs unread-command-event. Arg is a character, an event, a list of
@@ -1154,7 +1154,7 @@
(and (vectorp vec)
(eval (cons 'and (mapcar '(lambda (elt) (if (eventp elt) t)) vec)))))
-
+
;; check if vec is a vector of character symbols
(defun viper-char-symbol-sequence-p (vec)
(and
@@ -1164,8 +1164,8 @@
(mapcar (lambda (elt)
(and (symbolp elt) (= (length (symbol-name elt)) 1)))
vec)))))
-
-
+
+
(defun viper-char-array-p (array)
(eval (cons 'and (mapcar 'viper-characterp array))))
@@ -1188,7 +1188,7 @@
(t (prin1-to-string (vconcat temp)))))
((viper-char-symbol-sequence-p event-seq)
(mapconcat 'symbol-name event-seq ""))
- ((and (vectorp event-seq)
+ ((and (vectorp event-seq)
(viper-char-array-p
(setq temp (mapcar 'viper-key-to-character event-seq))))
(mapconcat 'char-to-string temp ""))
@@ -1201,8 +1201,8 @@
)
events
""))
-
-
+
+
(defun viper-read-char-exclusive ()
(let (char
(echo-keystrokes 1))
@@ -1230,13 +1230,13 @@
(= 1 (length (symbol-name (nth 1 key)))))
(read (format "?\\C-%s" (symbol-name (nth 1 key)))))
(t key)))
-
-
+
+
(defun viper-setup-master-buffer (&rest other-files-or-buffers)
"Set up the current buffer as a master buffer.
Arguments become related buffers. This function should normally be used in
the `Local variables' section of a file."
- (setq viper-related-files-and-buffers-ring
+ (setq viper-related-files-and-buffers-ring
(make-ring (1+ (length other-files-or-buffers))))
(mapcar '(lambda (elt)
(viper-ring-insert viper-related-files-and-buffers-ring elt))
@@ -1277,7 +1277,7 @@ Usually contains ` ', linefeed, TAB or formfeed.")
;; Set Viper syntax classes and related variables according to
-;; `viper-syntax-preference'.
+;; `viper-syntax-preference'.
(defun viper-update-syntax-classes (&optional set-default)
(let ((preference (cond ((eq viper-syntax-preference 'emacs)
"w") ; Viper words have only Emacs word chars
@@ -1338,7 +1338,7 @@ This is most appropriate for major modes intended for editing programs.
`emacs' means Viper words are the same as Emacs words as specified by Emacs
syntax tables.
This option is appropriate if you like Emacs-style words."
- :type '(radio (const strict-vi) (const reformed-vi)
+ :type '(radio (const strict-vi) (const reformed-vi)
(const extended) (const emacs))
:set 'viper-set-syntax-preference
:group 'viper)
@@ -1382,7 +1382,7 @@ This option is appropriate if you like Emacs-style words."
(defun viper-skip-alpha-forward (&optional addl-chars)
(or (stringp addl-chars) (setq addl-chars ""))
(viper-skip-syntax
- 'forward
+ 'forward
(cond ((eq viper-syntax-preference 'strict-vi)
"")
(t viper-ALPHA-char-class))
@@ -1393,7 +1393,7 @@ This option is appropriate if you like Emacs-style words."
(defun viper-skip-alpha-backward (&optional addl-chars)
(or (stringp addl-chars) (setq addl-chars ""))
(viper-skip-syntax
- 'backward
+ 'backward
(cond ((eq viper-syntax-preference 'strict-vi)
"")
(t viper-ALPHA-char-class))
@@ -1404,7 +1404,7 @@ This option is appropriate if you like Emacs-style words."
;; weird syntax tables may confuse strict-vi style
(defsubst viper-skip-all-separators-forward (&optional within-line)
(if (eq viper-syntax-preference 'strict-vi)
- (if within-line
+ (if within-line
(skip-chars-forward viper-strict-SEP-chars-sans-newline)
(skip-chars-forward viper-strict-SEP-chars))
(viper-skip-syntax 'forward
@@ -1413,7 +1413,7 @@ This option is appropriate if you like Emacs-style words."
(if within-line (viper-line-pos 'end)))))
(defsubst viper-skip-all-separators-backward (&optional within-line)
(if (eq viper-syntax-preference 'strict-vi)
- (if within-line
+ (if within-line
(skip-chars-backward viper-strict-SEP-chars-sans-newline)
(skip-chars-backward viper-strict-SEP-chars))
(viper-skip-syntax 'backward
@@ -1437,7 +1437,7 @@ This option is appropriate if you like Emacs-style words."
'forward
(concat "^" viper-ALPHA-char-class viper-SEP-char-class)
;; Emacs may consider some of these as words, but we don't want them
- viper-non-word-characters
+ viper-non-word-characters
(viper-line-pos 'end))))
(defun viper-skip-nonalphasep-backward ()
(if (eq viper-syntax-preference 'strict-vi)
@@ -1475,8 +1475,8 @@ This option is appropriate if you like Emacs-style words."
(t nil)))
(if (memq ?^ syntax) (setq negated-syntax t))
- (while (and (not (= local 0))
- (cond ((eq direction 'forward)
+ (while (and (not (= local 0))
+ (cond ((eq direction 'forward)
(not (eobp)))
(t (not (bobp)))))
(setq char-looked-at (viper-char-at-pos direction)
@@ -1507,11 +1507,11 @@ This option is appropriate if you like Emacs-style words."
(setq total (+ total local)))
total
))
-
-
+
+
(provide 'viper-util)
-
+
;;; Local Variables:
;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 50b5d82dff..f5837192ce 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -103,7 +103,7 @@
;; -----------------
;; Bug reports and ideas contributed by many users have helped
;; improve Viper and the various versions of VIP.
-;; See the on-line manual for a complete list of contributors.
+;; See the on-line manual for a complete list of contributors.
;;
;;
;;; Notes:
@@ -112,24 +112,24 @@
;; In most cases, Viper handles major modes correctly, i.e., they come up
;; in the right state (either vi-state or emacs-state). For instance, text
;; files come up in vi-state, while, say, Dired appears in emacs-state by
-;; default.
+;; default.
;; However, some modes do not appear in the right mode in the beginning,
;; usually because they neglect to follow Emacs conventions (e.g., they don't
;; use kill-all-local-variables when they start). Some major modes
;; may fail to come up in emacs-state if they call hooks, such as
-;; text-hook, for no good reason.
-;;
+;; text-hook, for no good reason.
+;;
;; As an immediate solution, you can hit C-z to bring about the right mode.
;; An interim solution is to add an appropriate hook to the mode like this:
-;;
+;;
;; (add-hook 'your-favorite-mode 'viper-mode)
-;; or
+;; or
;; (add-hook 'your-favorite-mode 'viper-change-state-to-emacs)
-;;
+;;
;; whichever applies. The right thing to do, however, is to complain to the
;; author of the respective package. (Sometimes they also neglect to equip
;; their modes with hooks, which is one more reason for complaining.)
-;;
+;;
;; 2. Keymap handling
;; Each Viper state (insert, vi, replace) is implemented as a collection of
;; several minor modes, each with its own keymap.
@@ -220,17 +220,17 @@
;; viper-insert-global-user-minor-mode can be set with the define-key command.
;;
;; The next minor mode, viper-insert-kbd-minor-mode,
-;; is used for keyboard VI-style macros defined with :map!.
+;; is used for keyboard VI-style macros defined with :map!.
;;
;; The fifth minor mode, viper-insert-state-modifier-minor-mode, is like
;; viper-vi-state-modifier-minor-mode, except that it is used in the Insert
-;; state; it can be used to modify keys in a mode-specific fashion.
+;; state; it can be used to modify keys in a mode-specific fashion.
;;
;; The minor mode viper-insert-diehard-minor-mode is in effect when
;; the user wants a high degree of Vi compatibility (a bad idea, really!).
;; The last minor mode, viper-insert-basic-minor-mode, is always in effect
;; when Viper is in insert state. It binds a small number of keys needed for
-;; Viper's operation.
+;; Viper's operation.
;;
;; Finally, Viper provides minor modes for overriding bindings set by Emacs
;; modes when Viper is in Emacs state:
@@ -261,14 +261,14 @@
;; used in conjunction with the minor modes for insert-state, and its
;; keymap overshadows the keymaps for insert minor modes.
;;
-;; 4. Defining buffer-local bindings in Vi and Insert modes.
+;; 4. Defining buffer-local bindings in Vi and Insert modes.
;; As mentioned before, sometimes, it is convenient to have
;; buffer-specific of mode-specific key bindings in Vi and insert modes.
;; Viper provides a special function, viper-add-local-keys, to do precisely
;; this. For instance, is you need to add couple of mode-specific bindings
-;; to Insert mode, you can put
+;; to Insert mode, you can put
;;
-;; (viper-add-local-keys 'insert-state '((key1 . func1) (key2 .func2)))
+;; (viper-add-local-keys 'insert-state '((key1 . func1) (key2 .func2)))
;;
;; somewhere in a hook of this major mode. If you put something like this
;; in your own elisp function, this will define bindings specific to the
@@ -353,7 +353,7 @@ user decide when to invoke Viper in a major mode."
;; Non-viper variables that need to be saved in case the user decides to
;; de-viperize emacs.
(defvar viper-saved-non-viper-variables nil)
-
+
(defcustom viper-mode (cond (noninteractive nil)
(t 'ask))
"To Viperize or not to Viperize.
@@ -371,18 +371,18 @@ widget."
'(fundamental-mode
makefile-mode
help-mode
-
+
awk-mode
m4-mode
xrdb-mode
winmgr-mode
autoconf-mode
cvs-edit-mode
-
+
html-mode html-helper-mode
emacs-lisp-mode lisp-mode lisp-interaction-mode
-
- jde-mode java-mode
+
+ jde-mode java-mode
cc-mode c-mode c++-mode objc-mode
fortran-mode f90-mode
basic-mode
@@ -395,19 +395,19 @@ widget."
text-mode indented-text-mode
tex-mode latex-mode bibtex-mode
ps-mode
-
+
completion-list-mode
diff-mode
idl-mode
-
+
perl-mode
cperl-mode
javascript-mode
tcl-mode
python-mode
-
+
sh-mode ksh-mode csh-mode
-
+
gnus-article-mode
mh-show-mode
)
@@ -430,11 +430,11 @@ widget."
mail-mode
gnus-group-mode
gnus-summary-mode
-
+
Info-mode
Buffer-menu-mode
compilation-mode
-
+
view-mode
vm-mode
vm-summary-mode)
@@ -531,7 +531,7 @@ If Viper is enabled, turn it off. Otherwise, turn it on."
(setq viper-mode t)
(load-library "viper"))
- (if viper-first-time ; Important check. Prevents mix-up of startup
+ (if viper-first-time ; Important check. Prevents mix-up of startup
(progn ; and expert-level msgs when viper-mode recurses
(setq viper-first-time nil)
(setq viper-vi-state-cursor-color
@@ -553,27 +553,27 @@ and improving upon much of it.
1. Viper supports Vi at several levels. Level 1 is the closest to Vi,
level 5 provides the most flexibility to depart from many Vi conventions.
-
+
You will be asked to specify your user level in a following screen.
-
+
If you select user level 1 then the keys ^X, ^C, ^Z, and ^G will behave
as in VI, to smooth transition to Viper for the beginners. However, to
- use Emacs productively, you are advised to reach user level 3 or higher.
-
+ use Emacs productively, you are advised to reach user level 3 or higher.
+
At user level 2 or higher, ^X and ^C have Emacs, not Vi, bindings;
^Z toggles Vi/Emacs states; ^G is Emacs' keyboard-quit (like ^C in Vi).
-
+
2. Vi exit functions (e.g., :wq, ZZ) work on INDIVIDUAL files -- they
do not cause Emacs to quit, except at user level 1 (for a novice).
3. ^X^C EXITS EMACS.
4. Viper supports multiple undo: `u' will undo. Typing `.' will repeat
undo. Another `u' changes direction.
-
+
6. Emacs Meta key is `C-\\' (in all modes) or `\\ ESC' (in Vi command mode).
On a window system, the best way is to use the Meta-key on your keyboard.
7. Try \\[keyboard-quit] and \\[abort-recursive-edit] repeatedly,if
- something funny happens. This would abort the current editing command.
-
+ something funny happens. This would abort the current editing command.
+
For more information on Viper:
a. Type `:help' in Vi command mode
@@ -584,7 +584,7 @@ To submit a bug report or to contact the author, type :submitReport in Vi
command mode. To shoo Viper away and return to pure Emacs (horror!), type:
M-x viper-go-away
-
+
This startup message appears whenever you load Viper, unless you type `y' now."
))
(goto-char (point-min))
@@ -608,7 +608,7 @@ This startup message appears whenever you load Viper, unless you type `y' now."
(or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi
(memq major-mode viper-insert-state-mode-list) ; don't switch
(viper-change-state-to-vi)))))
-
+
;; Apply a little heuristic to invoke vi state on major-modes
;; that are not listed in viper-vi-state-mode-list
@@ -661,13 +661,13 @@ remains buffer-local."
;; restore non-viper vars
(setq-default
next-line-add-newlines
- (viper-standard-value
- 'next-line-add-newlines viper-saved-non-viper-variables)
+ (viper-standard-value
+ 'next-line-add-newlines viper-saved-non-viper-variables)
require-final-newline
- (viper-standard-value
- 'require-final-newline viper-saved-non-viper-variables)
+ (viper-standard-value
+ 'require-final-newline viper-saved-non-viper-variables)
scroll-step
- (viper-standard-value 'scroll-step viper-saved-non-viper-variables)
+ (viper-standard-value 'scroll-step viper-saved-non-viper-variables)
mode-line-buffer-identification
(viper-standard-value
'mode-line-buffer-identification viper-saved-non-viper-variables)
@@ -680,12 +680,12 @@ remains buffer-local."
(viper-standard-value
'mark-even-if-inactive viper-saved-non-viper-variables)))
- ;; Ideally, we would like to be able to de-localize local variables
+ ;; Ideally, we would like to be able to de-localize local variables
(viper-delocalize-var 'minor-mode-map-alist)
(viper-delocalize-var 'require-final-newline)
(if viper-xemacs-p (viper-delocalize-var 'bar-cursor))
-
+
;; deactivate all advices done by Viper.
(ad-deactivate-regexp "viper-")
@@ -695,23 +695,23 @@ remains buffer-local."
(viper-delocalize-var 'viper-insert-minibuffer-minor-mode)
(viper-delocalize-var 'viper-vi-intercept-minor-mode)
(viper-delocalize-var 'viper-insert-intercept-minor-mode)
-
+
(viper-delocalize-var 'viper-vi-local-user-minor-mode)
(viper-delocalize-var 'viper-vi-kbd-minor-mode)
(viper-delocalize-var 'viper-vi-global-user-minor-mode)
(viper-delocalize-var 'viper-vi-state-modifier-minor-mode)
(viper-delocalize-var 'viper-vi-diehard-minor-mode)
(viper-delocalize-var 'viper-vi-basic-minor-mode)
-
+
(viper-delocalize-var 'viper-replace-minor-mode)
-
+
(viper-delocalize-var 'viper-insert-local-user-minor-mode)
(viper-delocalize-var 'viper-insert-kbd-minor-mode)
(viper-delocalize-var 'viper-insert-global-user-minor-mode)
(viper-delocalize-var 'viper-insert-state-modifier-minor-mode)
(viper-delocalize-var 'viper-insert-diehard-minor-mode)
(viper-delocalize-var 'viper-insert-basic-minor-mode)
-
+
(viper-delocalize-var 'viper-emacs-intercept-minor-mode)
(viper-delocalize-var 'viper-emacs-local-user-minor-mode)
(viper-delocalize-var 'viper-emacs-kbd-minor-mode)
@@ -725,16 +725,16 @@ remains buffer-local."
viper-insert-minibuffer-minor-mode nil
viper-vi-intercept-minor-mode nil
viper-insert-intercept-minor-mode nil
-
+
viper-vi-local-user-minor-mode nil
viper-vi-kbd-minor-mode nil
viper-vi-global-user-minor-mode nil
viper-vi-state-modifier-minor-mode nil
viper-vi-diehard-minor-mode nil
viper-vi-basic-minor-mode nil
-
+
viper-replace-minor-mode nil
-
+
viper-insert-local-user-minor-mode nil
viper-insert-kbd-minor-mode nil
viper-insert-global-user-minor-mode nil
@@ -804,7 +804,7 @@ remains buffer-local."
(defun viper-major-mode-change-sentinel ()
(save-match-data
(or (string-match "\*Minibuf-" (buffer-name))
- (setq viper-new-major-mode-buffer-list
+ (setq viper-new-major-mode-buffer-list
(cons (current-buffer) viper-new-major-mode-buffer-list))))
;; change the global value of hook
(add-hook 'viper-post-command-hooks 'set-viper-state-in-major-mode t))
@@ -821,14 +821,14 @@ remains buffer-local."
;; back to fundamental-mode.
(if (eq default-major-mode 'fundamental-mode)
(setq default-major-mode 'viper-mode))
-
+
(add-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel)
(add-hook 'find-file-hooks 'set-viper-state-in-major-mode)
;; keep this because many modes we don't know about use this hook
(defvar text-mode-hook)
(add-hook 'text-mode-hook 'viper-mode)
-
+
(defvar emerge-startup-hook)
(add-hook 'emerge-startup-hook 'viper-change-state-to-emacs)
@@ -855,7 +855,7 @@ remains buffer-local."
'(defadvice vc-diff (after viper-vc-ad activate)
"Force Vi state in VC diff buffer."
(viper-change-state-to-vi))))
-
+
(eval-after-load
"emerge"
'(defadvice emerge-quit (after viper-emerge-advice activate)
@@ -865,7 +865,7 @@ remains buffer-local."
(defadvice emerge-quit (after viper-emerge-advice activate)
"Run `viper-change-state-to-vi' after quitting emerge."
(viper-change-state-to-vi))
-
+
;; passwd.el sets up its own buffer, which turns up in Vi mode,
;; thus overriding the local map. We don't need Vi mode here.
(eval-after-load
@@ -873,7 +873,7 @@ remains buffer-local."
'(defadvice read-passwd-1 (before viper-passwd-ad activate)
"Switch to emacs state while reading password."
(viper-change-state-to-emacs)))
-
+
;; Emacs shell, ange-ftp, and comint-based modes
(add-hook 'comint-mode-hook 'viper-comint-mode-hook) ; comint
@@ -887,7 +887,7 @@ remains buffer-local."
;; Modify major modes according to viper-major-mode-modifier-list
(viper-apply-major-mode-modifiers)
-
+
;; For RMAIL users.
;; Put buf in Emacs state after edit.
(eval-after-load
@@ -909,7 +909,7 @@ remains buffer-local."
"Set viper-automatic-iso-accents to iso-accents-mode."
(let ((arg (ad-get-arg 0)))
ad-do-it
- (setq viper-automatic-iso-accents
+ (setq viper-automatic-iso-accents
(if (eq viper-current-state 'vi-state)
(if arg
;; if iso-accents-mode was called with positive arg, turn
@@ -954,7 +954,7 @@ remains buffer-local."
(if (and viper-special-input-method (eq viper-current-state 'vi-state))
(viper-inactivate-input-method)
ad-do-it)))
-
+
) ; viper-set-hooks
@@ -968,22 +968,22 @@ remains buffer-local."
;; different keymaps for different buffers. Also, the keymaps associated
;; with viper-vi/insert-state-modifier-minor-mode can be different.
(make-variable-buffer-local 'minor-mode-map-alist)
-
+
;; Viper changes the default mode-line-buffer-identification
(setq-default mode-line-buffer-identification '(" %b"))
-
+
;; setup emacs-supported vi-style feel
(setq next-line-add-newlines nil
require-final-newline t)
-
+
(make-variable-buffer-local 'require-final-newline)
-
+
;; don't bark when mark is inactive
(if viper-emacs-p
(setq mark-even-if-inactive t))
-
+
(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)
@@ -993,13 +993,13 @@ remains buffer-local."
(defadvice describe-key (before viper-read-keyseq-ad protect activate)
"Force to read key via `viper-read-key-sequence'."
(interactive (list (viper-read-key-sequence "Describe key: "))))
-
+
(defadvice describe-key-briefly
(before viper-read-keyseq-ad protect activate)
"Force to read key via `viper-read-key-sequence'."
(interactive (list (viper-read-key-sequence "Describe key briefly: "))))
-
-
+
+
(defadvice find-file (before viper-add-suffix-advice activate)
"Use `read-file-name' for reading arguments."
(interactive (cons (read-file-name "Find file: " nil default-directory)
@@ -1012,7 +1012,7 @@ remains buffer-local."
((and viper-emacs-p (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
-
+
(defadvice find-file-other-window (before viper-add-suffix-advice activate)
"Use `read-file-name' for reading arguments."
(interactive (cons (read-file-name "Find file in other window: "
@@ -1026,7 +1026,7 @@ remains buffer-local."
((and viper-emacs-p (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
-
+
(defadvice find-file-other-frame (before viper-add-suffix-advice activate)
"Use `read-file-name' for reading arguments."
@@ -1042,14 +1042,14 @@ remains buffer-local."
(list find-file-wildcards))))
))
-
+
(defadvice read-file-name (around viper-suffix-advice activate)
"Tell `exit-minibuffer' to run `viper-file-add-suffix' as a hook."
(let ((viper-minibuffer-exit-hook
(append viper-minibuffer-exit-hook
'(viper-minibuffer-trim-tail viper-file-add-suffix))))
ad-do-it))
-
+
(defadvice start-kbd-macro (after viper-kbd-advice activate)
"Remove Viper's intercepting bindings for C-x ).
This may be needed if the previous `:map' command terminated abnormally."
@@ -1063,7 +1063,7 @@ remains buffer-local."
(add-hook 'mouse-leave-frame-hook
'viper-remember-current-frame)
(defadvice handle-switch-frame (before viper-frame-advice activate)
- "Remember the selected frame before the switch-frame event."
+ "Remember the selected frame before the switch-frame event."
(viper-remember-current-frame (selected-frame)))) )
) ; end viper-non-hook-settings
@@ -1081,7 +1081,7 @@ Viper is a Package for Emacs Rebels and a venomous VI PERil,
It's time to decide: to Viperize or not to Viperize...
-If you wish to Viperize AND make this your way of life, please put
+If you wish to Viperize AND make this your way of life, please put
(setq viper-mode t)
(require 'viper)
@@ -1102,7 +1102,7 @@ These two lines must come in the order given.
((eq viper-mode t))
;; Otherwise, it was asking Viper was not loaded through .emacs
;; In this case, it was either through M-x viper-mode or via something
- ;; else, like the custom widget. If Viper was loaded through
+ ;; else, like the custom widget. If Viper was loaded through
;; M-x viper-mode, then viper will kick in anyway.
(t (setq viper-mode nil)))
@@ -1129,10 +1129,10 @@ These two lines must come in the order given.
(if viper-emacs-p
(cons 'mark-even-if-inactive (list mark-even-if-inactive)))
)))
-
-
+
+
;; Set some useful macros, advices
-;; These must be BEFORE ~/.viper is loaded,
+;; These must be BEFORE ~/.viper is loaded,
;; so the user can unrecord them in ~/.viper.
(if viper-mode
(progn
@@ -1147,42 +1147,42 @@ These two lines must come in the order given.
(viper-record-kbd-macro
(vector viper-repeat-from-history-key '\2) 'vi-state
[(meta x) v i p e r - r e p e a t - f r o m - h i s t o r y return] 't)
-
- ;; set macros for toggling case sensitivity and regexp search
+
+ ;; set macros for toggling case sensitivity and regexp search
(viper-set-searchstyle-toggling-macros nil)
;; Make %%% toggle parsing comments for matching parentheses
(viper-set-parsing-style-toggling-macro nil)
;; ~/.viper is loaded if exists
(viper-load-custom-file)
-
+
;; should be after loading custom file to avoid the pesky msg that
;; mouse-search/insert keys are already bound
(viper-bind-mouse-search-key)
(viper-bind-mouse-insert-key)
))
-
+
;; Applying Viper customization -- runs after (load .viper)
;; Save user settings or Viper defaults for vars controlled by
-;; viper-expert-level
+;; viper-expert-level
(if (null viper-saved-user-settings)
- (setq viper-saved-user-settings
+ (setq viper-saved-user-settings
(list (cons 'viper-want-ctl-h-help (list viper-want-ctl-h-help))
(cons 'viper-always (list viper-always))
(cons 'viper-no-multiple-ESC (list viper-no-multiple-ESC))
(cons 'viper-ex-style-motion (list viper-ex-style-motion))
(cons 'viper-ex-style-editing
(list viper-ex-style-editing))
- (cons 'viper-want-emacs-keys-in-vi
+ (cons 'viper-want-emacs-keys-in-vi
(list viper-want-emacs-keys-in-vi))
(cons 'viper-electric-mode (list viper-electric-mode))
(cons 'viper-want-emacs-keys-in-insert
(list viper-want-emacs-keys-in-insert))
(cons 'viper-re-search (list viper-re-search)))))
-
+
(if viper-mode
(progn
@@ -1191,7 +1191,7 @@ These two lines must come in the order given.
(viper-buffer-search-enable))
(viper-update-syntax-classes 'set-default)
))
-
+
;;; Familiarize Viper with some minor modes that have their own keymaps
(if viper-mode
@@ -1228,11 +1228,11 @@ These two lines must come in the order given.
(define-key viper-vi-intercept-map viper-toggle-key 'viper-toggle-key-action)
(define-key
viper-emacs-intercept-map viper-toggle-key 'viper-change-state-to-vi)
-
+
;;; Escape from Emacs and Insert modes to Vi for one command
-(define-key
+(define-key
viper-emacs-intercept-map "\C-c\\" 'viper-escape-to-vi)
-(define-key
+(define-key
viper-insert-intercept-map "\C-c\\" 'viper-escape-to-vi)
(if viper-mode
@@ -1250,10 +1250,10 @@ These two lines must come in the order given.
(if (and viper-mode
- (or viper-always
+ (or viper-always
(and (< viper-expert-level 5) (> viper-expert-level 0))))
(viper-set-hooks))
-
+
;; Let all minor modes take effect after loading.
;; This may not be enough, so we also set default minor-mode-alist.
;; Without setting the default, new buffers that come up in emacs mode have
diff --git a/lisp/emulation/ws-mode.el b/lisp/emulation/ws-mode.el
index 5441af3304..330506b102 100644
--- a/lisp/emulation/ws-mode.el
+++ b/lisp/emulation/ws-mode.el
@@ -42,7 +42,7 @@
(setq wordstar-C-k-map (make-keymap))
(setq wordstar-C-o-map (make-keymap))
(setq wordstar-C-q-map (make-keymap))
-
+
(define-key wordstar-mode-map "\C-a" 'backward-word)
(define-key wordstar-mode-map "\C-b" 'fill-paragraph)
(define-key wordstar-mode-map "\C-c" 'scroll-up)
@@ -68,9 +68,9 @@
(define-key wordstar-mode-map "\C-x" 'next-line)
(define-key wordstar-mode-map "\C-y" 'kill-complete-line)
(define-key wordstar-mode-map "\C-z" 'scroll-up-line)
-
+
;; wordstar-C-k-map
-
+
(define-key wordstar-C-k-map " " ())
(define-key wordstar-C-k-map "0" 'ws-set-marker-0)
(define-key wordstar-C-k-map "1" 'ws-set-marker-1)
@@ -116,11 +116,11 @@
(define-key wordstar-C-k-map "\C-x" 'save-buffers-kill-emacs)
(define-key wordstar-C-k-map "y" 'ws-delete-block)
(define-key wordstar-C-k-map "\C-y" 'ws-delete-block)
-
+
;; wordstar-C-j-map not yet implemented
-
+
;; wordstar-C-o-map
-
+
(define-key wordstar-C-o-map " " ())
(define-key wordstar-C-o-map "c" 'wordstar-center-line)
(define-key wordstar-C-o-map "\C-c" 'wordstar-center-line)
@@ -141,7 +141,7 @@
(define-key wordstar-C-o-map "wh" 'split-window-horizontally)
(define-key wordstar-C-o-map "wo" 'other-window)
(define-key wordstar-C-o-map "wv" 'split-window-vertically)
-
+
;; wordstar-C-q-map
(define-key wordstar-C-q-map " " ())
(define-key wordstar-C-q-map "0" 'ws-find-marker-0)
@@ -336,8 +336,8 @@ the distance between the end of the text and `fill-column'."
(delete-horizontal-space)
(setq line-length (current-column))
(beginning-of-line)
- (indent-to
- (+ left-margin
+ (indent-to
+ (+ left-margin
(/ (- fill-column left-margin line-length) 2))))))
(defun scroll-down-line ()
@@ -368,13 +368,13 @@ the distance between the end of the text and `fill-column'."
(defvar ws-block-end-marker nil "End of \"Block\" in WordStar mode.")
(defvar ws-search-string nil "String of last search in WordStar mode.")
-(defvar ws-search-direction t
+(defvar ws-search-direction t
"Direction of last search in WordStar mode. t if forward, nil if backward.")
-(defvar ws-last-cursorposition nil
+(defvar ws-last-cursorposition nil
"Position before last search etc. in WordStar mode.")
-(defvar ws-last-errormessage nil
+(defvar ws-last-errormessage nil
"Last error message issued by a WordStar mode function.")
;;;;;;;;;;;
@@ -510,7 +510,7 @@ in ws-last-errormessage for recovery with C-q w."
"In WordStar mode: Move block to current cursor position."
(interactive)
(if (and ws-block-begin-marker ws-block-end-marker)
- (let ()
+ (let ()
(kill-region ws-block-begin-marker ws-block-end-marker)
(yank)
(save-excursion
@@ -702,7 +702,7 @@ This will only work for errors raised by WordStar mode functions."
(kill-region p (point))))
(defun ws-kill-bol ()
- "In WordStar mode: Kill to beginning of line
+ "In WordStar mode: Kill to beginning of line
\(like WordStar, not like Emacs)."
(interactive)
(let ((p (point)))
@@ -730,7 +730,7 @@ This will only work for errors raised by WordStar mode functions."
(defun ws-query-replace (from to)
"In WordStar mode: Search string, remember string for repetition."
- (interactive "sReplace:
+ (interactive "sReplace:
sWith: " )
(setq ws-search-string from)
(setq ws-search-direction t)