Commit c992e211 authored by Michael Kifer's avatar Michael Kifer
Browse files

*** empty log message ***

parent 39f002d2
......@@ -489,7 +489,7 @@ reversed.")
((eq ex-token-type 'non-command)
(error "`%s': %s" ex-token vip-BadExCommand))
(error (format "`%s': %s" ex-token vip-BadExCommand)))
((eq ex-token-type 'whole)
(setq address nil)
(setq ex-addresses
......@@ -839,9 +839,23 @@ reversed.")
(setq vip-keep-reading-filename t)
;; don't exit if directory---ex-commands don't
(cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer))
(t (minibuffer-complete-word))))
;; apparently the argument to an Ex command is
;; supposed to be a shell command
((vip-looking-back "^[ \t]*!.*")
(setq ex-cmdfile t)
(insert " "))
(setq ex-cmdfile nil)
(defun vip-handle-! ()
(if (and (string=
(buffer-string) (vip-abbreviate-file-name default-directory))
(member ex-token '("read" "write")))
(insert "!"))
(defun ex-cmd-accepts-multiple-files-p (token)
(member token '("edit" "next" "Next")))
......@@ -853,7 +867,10 @@ reversed.")
(copy-keymap minibuffer-local-completion-map))
beg end cont val)
(vip-add-keymap ex-read-filename-map minibuffer-local-completion-map)
(vip-add-keymap ex-read-filename-map
(if vip-emacs-p
(setq cont (setq vip-keep-reading-filename t))
(while cont
......@@ -944,19 +961,22 @@ reversed.")
(string= ex-token "change")
(string= ex-token "insert")
(string= ex-token "open"))
(error "`%s': Obsolete command, not supported by Viper"
(format "`%s': Obsolete command, not supported by Viper"
((or (string= ex-token "abbreviate")
(string= ex-token "unabbreviate"))
"`%s': Vi-style abbrevs are obsolete. Use the more powerful Emacs abbrevs"
((or (string= ex-token "list")
(string= ex-token "print")
(string= ex-token "z")
(string= ex-token "#"))
(error "`%s': Command not implemented in Viper" ex-token))
(t (error "`%s': %s" ex-token vip-BadExCommand))))
(format "`%s': Command not implemented in Viper" ex-token)))
(t (error (format "`%s': %s" ex-token vip-BadExCommand)))))
(defun vip-undisplayed-files ()
......@@ -1081,7 +1101,7 @@ reversed.")
(if (not file)
(cond ((and (string= ex-file "") buffer-file-name)
(setq ex-file (abbreviate-file-name (buffer-file-name))))
(setq ex-file (vip-abbreviate-file-name (buffer-file-name))))
((string= ex-file "")
(error vip-NoFileSpecified)))
......@@ -1361,7 +1381,8 @@ reversed.")
(if (not (vip-buffer-live-p buf))
(error "Didn't find buffer %S or file %S"
(abbreviate-file-name (expand-file-name file-or-buffer-name))))
(expand-file-name file-or-buffer-name))))
(if (equal buf (current-buffer))
(or no-recursion
......@@ -1425,7 +1446,8 @@ reversed.")
;; Ex read command
(defun ex-read ()
(let ((point (if (null ex-addresses) (point) (car ex-addresses))))
(let ((point (if (null ex-addresses) (point) (car ex-addresses)))
(goto-char point)
(if (not (or (bobp) (eobp))) (forward-line 1))
......@@ -1435,7 +1457,9 @@ reversed.")
(error vip-NoFileSpecified))
(setq ex-file buffer-file-name)))
(if ex-cmdfile
(shell-command ex-file t)
(setq command (ex-expand-filsyms ex-file (current-buffer)))
(shell-command command t))
(insert-file-contents ex-file)))
(ex-fixup-history vip-last-ex-prompt ex-file))
......@@ -1675,7 +1699,7 @@ reversed.")
(condition-case nil
(pop-to-buffer (get-buffer-create "*info*"))
(info "")
(info (if vip-xemacs-p "" "viper"))
(message "Type `i' to search for a specific topic"))
(error (beep 1)
(with-output-to-temp-buffer " *vip-info*"
......@@ -1875,7 +1899,7 @@ Please contact your system administrator. "
(defun ex-write-info (exists file-name beg end)
(message "`%s'%s %d lines, %d characters"
(abbreviate-file-name file-name)
(vip-abbreviate-file-name file-name)
(if exists "" " [New file]")
(count-lines beg (min (1+ end) (point-max)))
(- end beg)))
......@@ -1947,7 +1971,7 @@ Please contact your system administrator. "
lines file info)
(setq lines (count-lines (point-min) (vip-line-pos 'end))
file (if (buffer-file-name)
(concat (abbreviate-file-name (buffer-file-name)) ":")
(concat (vip-abbreviate-file-name (buffer-file-name)) ":")
(concat (buffer-name) " [Not visiting any file]:"))
info (format "line=%d/%d pos=%d/%d col=%d %s"
(if (= pos1 pos2)
......@@ -391,8 +391,9 @@ If SCOPE is nil, the user is asked to specify the scope."
(if (stringp macro-body) " ....\"" " ....]"))
(if (y-or-n-p (format "Save this macro in %s? "
(abbreviate-file-name vip-custom-file-name)))
(if (y-or-n-p
(format "Save this macro in %s? "
(vip-abbreviate-file-name vip-custom-file-name)))
(format "\n(vip-record-kbd-macro %S '%S %s '%S)"
(vip-display-macro macro-name)
......@@ -903,7 +904,7 @@ there."
(setq vip-last-macro-reg reg)
(vip-set-register-macro reg))))
(error "`%c': Unknown register" reg)))))
(error (format "`%c': Unknown register" reg))))))
(defun vip-global-execute ()
......@@ -4839,8 +4839,7 @@ One can use `` and '' to temporarily jump 1 step back."
((vip-valid-register reg '(letter))
(let* ((val (get-register (1+ (- reg ?a))))
(buf (if (not val)
(format vip-EmptyTextmarker reg))
(error vip-EmptyTextmarker reg)
(marker-buffer val)))
(pos (marker-position val))
line-no text (s pos) (e pos))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment