1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

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

	* viper-cmd.el: Fixed indentation.

	* viper.texi: Clarified that viper won't expand special symbols in
	search patterns.
This commit is contained in:
Michael Kifer 2001-10-13 21:38:19 +00:00
parent e641b454cd
commit 2d341681c8
5 changed files with 66 additions and 40 deletions

View File

@ -1,3 +1,8 @@
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.

View File

@ -2554,22 +2554,23 @@ These keys are ESC, RET, and LineFeed"
(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)
))
;; basic cursor movement. j, k, l, h commands.

View File

@ -716,6 +716,8 @@ reversed."
;; 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))
@ -848,7 +850,9 @@ reversed."
(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)
@ -871,6 +875,7 @@ reversed."
;; 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)
@ -1251,27 +1256,27 @@ reversed."
((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

View File

@ -1,3 +1,8 @@
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.

View File

@ -3210,8 +3210,9 @@ syntax tables in order to not thwart the various major modes that set these
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
@ -3680,6 +3681,10 @@ In Emacs, @samp{\&} stands for the last matched expression, so
@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]
@ -3745,6 +3750,11 @@ wrapping around.
@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>