;;; 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
;; 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:
(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.
(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)
(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"))
(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."
(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))))
(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
(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"
(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))
(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
(provide 'vip)
+;;; arch-tag: bff623ef-48f7-41d4-9aa3-2e840c9ab415
;;; vip.el ends here