* viper-ex.el (ex-edit): make checks for modified buffer/file.
(viper-get-ex-address-subr): more precise addr for the $ marker
* viper-cmd.el: Fixed indentation.
* viper.texi: Clarified that viper won't expand special symbols in
search patterns.
+2001-10-13 Michael Kifer <kifer@cs.sunysb.edu>
+
+ * viper-ex.el (ex-edit): make checks for modified buffer/file.
+ (viper-get-ex-address-subr): more precise addr for the $ marker
+
2001-10-13 Eli Zaretskii <eliz@is.elta.co.il>
* version.el (emacs-version): Bump to 21.1.50.
(or (eq viper-intermediate-command 'viper-repeat)
(viper-special-read-and-insert-char))
- (if (eq char ?\C-m) (setq char ?\n))
-
- (delete-char 1 t)
-
- (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)
- ))
+ ;; Is this needed?
+ (if (eq char ?\C-m) (setq char ?\n))
+
+ (delete-char 1 t)
+
+ (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)
+ ))
\f
;; basic cursor movement. j, k, l, h commands.
;; Get a regular expression and set `ex-variant', if found
+;; Viper doesn't parse the substitution or search patterns.
+;; In particular, it doesn't expand ~ into the last substitution.
(defun viper-get-ex-pat ()
(save-window-excursion
(setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(forward-line (1- ex-token))
(setq address (point-marker)))))
((eq ex-token-type 'end)
- (setq address (point-max-marker)))
+ (save-excursion
+ (goto-char (1- (point-max)))
+ (setq address (point-marker))))
((eq ex-token-type 'plus) t) ; do nothing
((eq ex-token-type 'minus) t) ; do nothing
((eq ex-token-type 'search-forward)
;; Search pattern and set address
+;; Doesn't wrap around. Should it?
(defun ex-search-address (forward)
(if (string= ex-token "")
(if (null viper-s-string)
((string= ex-file "")
(error viper-NoFileSpecified)))
-;;; (let (msg do-edit)
-;;; (if buffer-file-name
-;;; (cond ((buffer-modified-p)
-;;; (setq msg
-;;; (format "Buffer %s is modified. Discard changes? "
-;;; (buffer-name))
-;;; do-edit t))
-;;; ((not (verify-visited-file-modtime (current-buffer)))
-;;; (setq msg
-;;; (format "File %s changed on disk. Reread from disk? "
-;;; buffer-file-name)
-;;; do-edit t))
-;;; (t (setq do-edit nil))))
-;;;
-;;; (if do-edit
-;;; (if (yes-or-no-p msg)
-;;; (progn
-;;; (set-buffer-modified-p nil)
-;;; (kill-buffer (current-buffer)))
-;;; (message "Buffer %s was left intact" (buffer-name))))
-;;; ) ; let
+ (let (msg do-edit)
+ (if buffer-file-name
+ (cond ((buffer-modified-p)
+ (setq msg
+ (format "Buffer %s is modified. Discard changes? "
+ (buffer-name))
+ do-edit t))
+ ((not (verify-visited-file-modtime (current-buffer)))
+ (setq msg
+ (format "File %s changed on disk. Reread from disk? "
+ buffer-file-name)
+ do-edit t))
+ (t (setq do-edit nil))))
+
+ (if do-edit
+ (if (yes-or-no-p msg)
+ (progn
+ (set-buffer-modified-p nil)
+ (kill-buffer (current-buffer)))
+ (message "Buffer %s was left intact" (buffer-name))))
+ ) ; let
(if (null (setq file (get-file-buffer ex-file)))
(progn
+2001-10-13 Michael Kifer <kifer@cs.sunysb.edu>
+
+ * viper.texi: Clarified that viper won't expand special symbols in
+ search patterns.
+
2001-10-05 Gerd Moellmann <gerd@gnu.org>
* Branch for 21.1.
tables.
The usual Emacs convention is used to indicate Control Characters, i.e
-C-h for Control-h. @emph{Do not confuse this to mean the separate
-characters C - h!!!} The @kbd{^} is itself, never used to indicate a
+C-h for Control-h. @emph{Do not confuse this with a sequence of separate
+characters
+C, -, h!!!} The @kbd{^} is itself, never used to indicate a
Control character.
Finally, we note that Viper's Ex-style commands can be made to work on the
@kbd{s/[ab]+/\&\&/} will double the string matched by @kbd{[ab]}.
Viper doesn't treat @samp{&} specially, unlike Vi: use @samp{\&} instead.
+Viper does not parse search patterns and does not expand special symbols
+found there (e.g., @samp{~} is not expanded to the result of the previous
+substitution).
+
Note: @emph{The newline character (inserted as @kbd{C-qC-j})
can be used in <repl>}.
@item :[x,y]copy [z]
@table @kbd
@item <count> /<string>
To the <count>th occurrence of <string>.
+
+Viper does not parse search patterns and does not expand special symbols
+found there (e.g., @samp{~} is not expanded to the result of the previous
+substitution).
+
@item <count> ?<string>
To the <count>th previous occurrence of <string>.
@item <count> g<move>