]> git.eshelyaron.com Git - emacs.git/commitdiff
2001-10-13 Michael Kifer <kifer@cs.sunysb.edu>
authorMichael Kifer <kifer@cs.stonybrook.edu>
Sat, 13 Oct 2001 21:38:19 +0000 (21:38 +0000)
committerMichael Kifer <kifer@cs.stonybrook.edu>
Sat, 13 Oct 2001 21:38:19 +0000 (21:38 +0000)
* 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.

lisp/ChangeLog
lisp/emulation/viper-cmd.el
lisp/emulation/viper-ex.el
man/ChangeLog
man/viper.texi

index f5b2c02e30122d4066e64c20fc9283f91e024b28..2a8ff46e21d02bd7bbc8450f1b3449faea9bf8f3 100644 (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.
index f7f2e3f853d81dc1600aef3bc08f996a80ec009b..0df2022ae04f6ec8dc832d23b3acb2d7c9b3af16 100644 (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)
+    ))
 
 \f
 ;; basic cursor movement.  j, k, l, h commands.
index 1ae136a067e7d9266eb7024eef20080c851bc580..1ee912eb18ce210c66b5eea62b25621f95f2f8af 100644 (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 
index 46b758981edc75840380e5226d2361114ce59020..4549c8d62eb7f6a074b48e9af579429abfb6d286 100644 (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.
index 2504bb2b539c5f1ea911aed5a05a6e03a931a225..a390b5850772f45c8fe3e1c35d59deea32d84166 100644 (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>