]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/vip.el
(add-log-buffer-file-name-function): Add defvar.
[gnu-emacs] / lisp / emulation / vip.el
index 80e941d2ed614e59dbbf4544ecd6e201fe0a0021..51fbdb6b8c4f2e6f30ce1b09f135d432cf207232 100644 (file)
@@ -1,7 +1,7 @@
 ;;; vip.el --- a VI Package for GNU Emacs
 
-;; Copyright (C) 1986, 1987, 1988, 1992, 1993, 1998
-;;        Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1987, 1988, 1992, 1993, 1998, 2002, 2003, 2004,
+;;   2005 Free Software Foundation, Inc.
 
 ;; Author: Masahiko Sato <ms@sail.stanford.edu>
 ;; Keywords: emulations
@@ -20,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -1112,9 +1112,10 @@ the query replace mode will toggle between string replace and regexp replace."
            (replace-match (vip-read-string
                            (format "Replace regexp \"%s\" with: " str))
                           nil nil))
-       (replace-string
-        str
-        (vip-read-string (format "Replace \"%s\" with: " str)))))))
+       (with-no-warnings
+         (replace-string
+          str
+          (vip-read-string (format "Replace \"%s\" with: " str))))))))
 
 \f
 ;; basic cursor movement.  j, k, l, m commands.
@@ -1342,7 +1343,7 @@ after search."
 (defun vip-find-char-forward (arg)
   "Find char on the line.  If called interactively read the char to find
 from the terminal, and if called from vip-repeat, the char last used is
-used.  This behaviour is controlled by the sign of prefix numeric value."
+used.  This behavior is controlled by the sign of prefix numeric value."
   (interactive "P")
   (let ((val (vip-p-val arg)) (com (vip-getcom arg)))
     (if (> val 0)
@@ -2177,7 +2178,7 @@ a token has type \(command, address, end-mark\) and value."
                 (cond ((string= ex-token-type "plus") "add-number")
                       ((string= ex-token-type "minus") "sub-number")
                       (t "abs-number")))
-          (setq ex-token (string-to-int (buffer-substring (point) (mark)))))
+          (setq ex-token (string-to-number (buffer-substring (point) (mark)))))
          ((looking-at "\\$")
           (forward-char 1)
           (setq ex-token-type "end"))
@@ -2253,7 +2254,7 @@ a token has type \(command, address, end-mark\) and value."
           (setq ex-token-type "end-mark")
           (setq ex-token "goto"))
          (t
-          (error "illegal token")))))
+          (error "invalid token")))))
 
 (defun vip-ex (&optional string)
   "ex commands within VIP."
@@ -2292,7 +2293,7 @@ a token has type \(command, address, end-mark\) and value."
                             (setq cont nil))
                            (t (error "Extra character at end of a command")))))))
            ((string= ex-token-type "non-command")
-            (error (format "%s: Not an editor command" ex-token)))
+            (error "%s: Not an editor command" ex-token))
            ((string= ex-token-type "whole")
             (setq ex-addresses
                   (cons (point-max) (cons (point-min) ex-addresses))))
@@ -2471,14 +2472,14 @@ a token has type \(command, address, end-mark\) and value."
        (progn
          (set-mark (point))
          (re-search-forward "[0-9][0-9]*")
-         (setq ex-count (string-to-int (buffer-substring (point) (mark))))
+         (setq ex-count (string-to-number (buffer-substring (point) (mark))))
          (skip-chars-forward " \t")))
     (if (looking-at "[pl#]")
        (progn
          (setq ex-flag t)
          (forward-char 1)))
     (if (not (looking-at "[\n|]"))
-       (error "Illegal extra characters"))))
+       (error "Invalid extra characters"))))
 
 (defun vip-get-ex-count ()
   (setq ex-variant nil
@@ -2496,14 +2497,14 @@ a token has type \(command, address, end-mark\) and value."
        (progn
          (set-mark (point))
          (re-search-forward "[0-9][0-9]*")
-         (setq ex-count (string-to-int (buffer-substring (point) (mark))))
+         (setq ex-count (string-to-number (buffer-substring (point) (mark))))
          (skip-chars-forward " \t")))
     (if (looking-at "[pl#]")
        (progn
          (setq ex-flag t)
          (forward-char 1)))
     (if (not (looking-at "[\n|]"))
-       (error "Illegal extra characters"))))
+       (error "Invalid extra characters"))))
 
 (defun vip-get-ex-file ()
   "get a file name and set ex-variant, ex-append and ex-offset if found"
@@ -2830,7 +2831,8 @@ a token has type \(command, address, end-mark\) and value."
       (skip-chars-forward " \t")
       (if (looking-at "[\n|]") (error "Missing rhs"))
       (set-mark (point))
-      (end-of-buffer)
+      (with-no-warnings
+       (end-of-buffer))
       (backward-char 1)
       (setq string (buffer-substring (mark) (point))))
     (if (not (lookup-key ex-map char))
@@ -2900,7 +2902,8 @@ a token has type \(command, address, end-mark\) and value."
        (setq file (buffer-substring (point) (mark)))))
       (if variant
          (shell-command command t)
-       (insert-file file))))
+       (with-no-warnings
+         (insert-file file)))))
 
 (defun ex-set ()
   (eval (list 'setq
@@ -3072,4 +3075,5 @@ vip-s-string"
 
 (provide 'vip)
 
+;;; arch-tag: bff623ef-48f7-41d4-9aa3-2e840c9ab415
 ;;; vip.el ends here