diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2003-02-04 13:24:35 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2003-02-04 13:24:35 +0000 |
commit | a1506d2977a8c2eb982ad0b59416009cdfaa6f51 (patch) | |
tree | 3cbb868ad6eb3b188d5064389538c490c124d8be /lisp/emulation/viper-ex.el | |
parent | f1180544bb5ff44cdb45b8734734294b0a2fa7a4 (diff) | |
download | emacs-a1506d2977a8c2eb982ad0b59416009cdfaa6f51.tar.gz |
Trailing whitepace deleted.
Diffstat (limited to 'lisp/emulation/viper-ex.el')
-rw-r--r-- | lisp/emulation/viper-ex.el | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index 312357f3214..f4d3e8c766e 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -150,7 +150,7 @@ ("set" (ex-set)) ("shell" (ex-shell)) ("source" (ex-source)) - ("stop" (suspend-emacs)) + ("stop" (suspend-emacs)) ("sr" (ex-substitute t t)) ("submitReport" (viper-submit-report)) ("substitute" (ex-substitute) is-mashed) @@ -165,7 +165,7 @@ ("v" "vglobal") ("version" (viper-version)) ("vglobal" (ex-global t) is-mashed) - ("visual" (ex-edit)) + ("visual" (ex-edit)) ("w" "write") ("wq" (ex-write t)) ("write" (ex-write nil)) @@ -238,26 +238,26 @@ ;; A-list of Ex variables that can be set using the :set command. -(defconst ex-variable-alist +(defconst ex-variable-alist '(("wrapscan") ("ws") ("wrapmargin") ("wm") ("tabstop-global") ("ts-g") ("tabstop") ("ts") ("showmatch") ("sm") ("shiftwidth") ("sw") ("shell") ("sh") - ("readonly") ("ro") + ("readonly") ("ro") ("nowrapscan") ("nows") ("noshowmatch") ("nosm") ("noreadonly") ("noro") ("nomagic") ("noma") ("noignorecase") ("noic") ("noautoindent-global") ("noai-g") ("noautoindent") ("noai") ("magic") ("ma") ("ignorecase") ("ic") - ("autoindent-global") ("ai-g") ("autoindent") ("ai") - ("all") + ("autoindent-global") ("ai-g") ("autoindent") ("ai") + ("all") )) - + ;; Token recognized during parsing of Ex commands (e.g., "read", "comma") (defvar ex-token nil) -;; Type of token. +;; Type of token. ;; If non-nil, gives type of address; if nil, it is a command. (defvar ex-token-type nil) @@ -323,7 +323,7 @@ ((string-match "\\(bash$\\|bash.exe$\\)" shell-file-name) "-noprofile") ; bash: ignore .profile ))) - "Options to pass to the Unix-style shell. + "Options to pass to the Unix-style shell. Don't put `-c' here, as it is added automatically." :type '(choice (const nil) string) :group 'viper-ex) @@ -344,7 +344,7 @@ Don't put `-c' here, as it is added automatically." The default tries to set this variable to work with Unix, Windows, OS/2, and VMS. -However, if it doesn't work right for some types of Unix shells or some OS, +However, if it doesn't work right for some types of Unix shells or some OS, the user should supply the appropriate function and set this variable to the corresponding function symbol." :type 'symbol @@ -370,7 +370,7 @@ corresponding function symbol." ;; e.g., :r !date (defvar ex-cmdfile nil) (defvar ex-cmdfile-args "") - + ;; flag used in viper-ex-read-file-name to indicate that we may be reading ;; multiple file names. Used for :edit and :next (defvar viper-keep-reading-filename nil) @@ -389,10 +389,10 @@ reversed." ;; Last shell command executed with :! command. (defvar viper-ex-last-shell-com nil) - + ;; Indicates if Minibuffer was exited temporarily in Ex-command. (defvar viper-incomplete-ex-cmd nil) - + ;; Remembers the last ex-command prompt. (defvar viper-last-ex-prompt "") @@ -414,7 +414,7 @@ reversed." ;; A token has a type, \(command, address, end-mark\), and a value (defun viper-get-ex-token () (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (skip-chars-forward " \t|") (let ((case-fold-search t)) @@ -556,25 +556,25 @@ reversed." "\\|" "![ \t]*[a-zA-Z].*" "\\)" "!*"))) - + (save-window-excursion ;; put cursor at the end of the Ex working buffer - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (goto-char (point-max))) (cond ((viper-looking-back quit-regex1) (exit-minibuffer)) ((viper-looking-back stay-regex) (insert " ")) ((viper-looking-back quit-regex2) (exit-minibuffer)) (t (insert " "))))) - + ;; complete Ex command (defun ex-cmd-complete () (interactive) (let (save-pos dist compl-list string-to-complete completion-result) - + (save-excursion (setq dist (skip-chars-backward "[a-zA-Z!=>&~]") save-pos (point))) - + (if (or (= dist 0) (viper-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") (viper-looking-back @@ -586,14 +586,14 @@ reversed." (viper-looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") (looking-at "[^ \t\n\C-m]")) nil - (with-output-to-temp-buffer "*Completions*" + (with-output-to-temp-buffer "*Completions*" (display-completion-list (viper-alist-to-list ex-token-alist)))) ;; Preceding chars may be part of a command name (setq string-to-complete (buffer-substring save-pos (point))) (setq completion-result (try-completion string-to-complete ex-token-alist)) - + (cond ((eq completion-result t) ; exact match--do nothing (viper-tmp-insert-at-eob " (Sole completion)")) ((eq completion-result nil) @@ -607,17 +607,17 @@ reversed." (viper-filter-alist (concat "^" completion-result) ex-token-alist))) (if (> (length compl-list) 1) - (with-output-to-temp-buffer "*Completions*" + (with-output-to-temp-buffer "*Completions*" (display-completion-list (viper-alist-to-list (reverse compl-list))))))) ))) - -;; Read Ex commands + +;; Read Ex commands ;; ARG is a prefix argument. If given, the ex command runs on the region ;;(without the user having to specify the address :a,b ;; STRING is the command to execute. If nil, then Viper asks you to enter the -;; command. +;; command. (defun viper-ex (arg &optional string) (interactive "P") (or string @@ -648,10 +648,10 @@ reversed." (+ reg-beg-line (count-lines reg-beg reg-end) -1))))) (if reg-beg-line (setq initial-str (format "%d,%d" reg-beg-line reg-end-line))) - - (setq com-str + + (setq com-str (or string (viper-read-string-with-history - ":" + ":" initial-str 'viper-ex-history ;; no default when working on region @@ -663,7 +663,7 @@ reversed." " [Type command to execute on current region]")))) (save-window-excursion ;; just a precaution - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (delete-region (point-min) (point-max)) (insert com-str "\n") @@ -718,7 +718,7 @@ reversed." (t (let ((ans (viper-get-ex-address-subr address dot))) (if ans (setq address ans))))) (setq prev-token-type ex-token-type)))) - + ;; Get a regular expression and set `ex-variant', if found ;; Viper doesn't parse the substitution or search patterns. @@ -783,7 +783,7 @@ reversed." ;; Get an Ex option g or c (defun viper-get-ex-opt-gc (c) (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (if (looking-at (format "%c" c)) (forward-char 1)) (skip-chars-forward " \t") @@ -872,7 +872,7 @@ reversed." (save-excursion (if (null ex-token) (exchange-point-and-mark) - (goto-char + (goto-char (viper-register-to-point (viper-int-to-char (1+ (- ex-token ?a))) 'enforce-buffer))) (setq address (point-marker))))) @@ -900,7 +900,7 @@ reversed." (setq ex-count nil) (setq ex-flag nil) (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (skip-chars-forward " \t") (if (looking-at "[a-zA-Z]") @@ -926,7 +926,7 @@ reversed." ex-count nil ex-flag nil) (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (skip-chars-forward " \t") (if (looking-at "!") @@ -952,7 +952,7 @@ reversed." ;; Expand \% and \# in ex command (defun ex-expand-filsyms (cmd buf) (let (cf pf ret) - (save-excursion + (save-excursion (set-buffer buf) (setq cf buffer-file-name) (setq pf (ex-next nil t))) ; this finds alternative file name @@ -966,7 +966,7 @@ reversed." (insert cmd) (goto-char (point-min)) (while (re-search-forward "%\\|#" nil t) - (let ((data (match-data)) + (let ((data (match-data)) (char (buffer-substring (match-beginning 0) (match-end 0)))) (if (viper-looking-back (concat "\\\\" char)) (replace-match char) @@ -991,7 +991,7 @@ reversed." ex-cmdfile-args "") (save-excursion (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (skip-chars-forward " \t") (if (looking-at "!") @@ -1052,9 +1052,9 @@ reversed." (skip-chars-backward " \t\n") (setq prompt (buffer-substring (point-min) (point))) )) - + (setq viper-last-ex-prompt prompt) - + ;; If we just finished reading command, redisplay prompt (if viper-incomplete-ex-cmd (setq ex-file (viper-ex-read-file-name (format ":%s " prompt))) @@ -1067,8 +1067,8 @@ reversed." ;; file names, arranges to re-enter the minibuffer. (defun viper-complete-filename-or-exit () (interactive) - (setq viper-keep-reading-filename t) - ;; don't exit if directory---ex-commands don't + (setq viper-keep-reading-filename t) + ;; don't exit if directory---ex-commands don't (cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer)) ;; apparently the argument to an Ex command is ;; supposed to be a shell command @@ -1098,12 +1098,12 @@ reversed." (minibuffer-local-completion-map (copy-keymap minibuffer-local-completion-map)) beg end cont val) - + (viper-add-keymap ex-read-filename-map - (if viper-emacs-p + (if viper-emacs-p minibuffer-local-completion-map - read-file-name-map)) - + read-file-name-map)) + (setq cont (setq viper-keep-reading-filename t)) (while cont (setq viper-keep-reading-filename nil @@ -1114,14 +1114,14 @@ reversed." (setq val (concat "\"" val "\""))) (setq str (concat str (if (equal val "") "" " ") val (if (equal val "") "" " "))) - + ;; Only edit, next, and Next commands accept multiple files. ;; viper-keep-reading-filename is set in the anonymous function that is ;; bound to " " in ex-read-filename-map. (setq cont (and viper-keep-reading-filename (ex-cmd-accepts-multiple-files-p ex-token))) ) - + (setq beg (string-match "[^ \t]" str) ; delete leading blanks end (string-match "[ \t]*$" str)) ; delete trailing blanks (if (member ex-token '("read" "write")) @@ -1137,11 +1137,11 @@ reversed." (defun viper-undisplayed-files () (mapcar - (lambda (b) + (lambda (b) (if (null (get-buffer-window b)) (let ((f (buffer-file-name b))) (if f f - (if ex-cycle-through-non-files + (if ex-cycle-through-non-files (let ((s (buffer-name b))) (if (string= " " (substring s 0 1)) nil @@ -1156,7 +1156,7 @@ reversed." (args "") (file-count 1)) (while (not (null l)) - (if (car l) + (if (car l) (setq args (format "%s %d) %s\n" args file-count (car l)) file-count (1+ file-count))) (setq l (cdr l))) @@ -1260,7 +1260,7 @@ reversed." (setq ex-file (viper-abbreviate-file-name (buffer-file-name)))) ((string= ex-file "") (error viper-NoFileSpecified))) - + (let (msg do-edit) (if buffer-file-name (cond ((buffer-modified-p) @@ -1274,7 +1274,7 @@ reversed." buffer-file-name) do-edit t)) (t (setq do-edit nil)))) - + (if do-edit (if (yes-or-no-p msg) (progn @@ -1282,9 +1282,9 @@ reversed." (kill-buffer (current-buffer))) (message "Buffer %s was left intact" (buffer-name)))) ) ; let - + (if (null (setq file (get-file-buffer ex-file))) - (progn + (progn ;; this also does shell-style globbing (ex-find-file ;; replace # and % with the previous/current file @@ -1296,7 +1296,7 @@ reversed." (if ex-offset (progn (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (delete-region (point-min) (point-max)) (insert ex-offset "\n") @@ -1339,7 +1339,7 @@ reversed." (viper-get-ex-pat) (if (null ex-token) (error "`%s': Missing regular expression" gcommand))) - + (if (string= ex-token "") (if (null viper-s-string) (error viper-NoPrevSearch) @@ -1379,7 +1379,7 @@ reversed." (forward-line -1) (end-of-line))))) (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) ;; com-str is the command string, i.e., g/pattern/ or v/pattern' (setq com-str (buffer-substring (1+ (point)) (1- (point-max))))) @@ -1460,7 +1460,7 @@ reversed." (error "`%s': Spurious text \"%s\" after mark name" name (substring name 1) viper-SpuriousText)) (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (skip-chars-forward " \t") (if (looking-at "[a-z]") @@ -1475,17 +1475,17 @@ reversed." (goto-char (car ex-addresses)) (point-to-register (viper-int-to-char (1+ (- char ?a))))))) - - + + ;; Alternate file is the file next to the first one in the buffer ring (defun ex-next (cycle-other-window &optional find-alt-file) (catch 'ex-edit (let (count l) - (if (not find-alt-file) + (if (not find-alt-file) (progn (viper-get-ex-file) (if (or (char-or-string-p ex-offset) - (and (not (string= "" ex-file)) + (and (not (string= "" ex-file)) (not (string-match "^[0-9]+$" ex-file)))) (progn (ex-edit t) @@ -1515,41 +1515,41 @@ reversed." (defun ex-next-related-buffer (direction &optional no-recursion) - + (viper-ring-rotate1 viper-related-files-and-buffers-ring direction) - - (let ((file-or-buffer-name + + (let ((file-or-buffer-name (viper-current-ring-item viper-related-files-and-buffers-ring)) (old-ring viper-related-files-and-buffers-ring) (old-win (selected-window)) skip-rest buf wind) - + (or (and (ring-p viper-related-files-and-buffers-ring) (> (ring-length viper-related-files-and-buffers-ring) 0)) (error "This buffer has no related files or buffers")) - + (or (stringp file-or-buffer-name) (error "File and buffer names must be strings, %S" file-or-buffer-name)) - + (setq buf (cond ((get-buffer file-or-buffer-name)) ((file-exists-p file-or-buffer-name) (find-file-noselect file-or-buffer-name)) )) - + (if (not (viper-buffer-live-p buf)) (error "Didn't find buffer %S or file %S" file-or-buffer-name (viper-abbreviate-file-name (expand-file-name file-or-buffer-name)))) - + (if (equal buf (current-buffer)) (or no-recursion ;; try again (progn (setq skip-rest t) (ex-next-related-buffer direction 'norecursion)))) - + (if skip-rest () ;; setup buffer @@ -1557,7 +1557,7 @@ reversed." () (setq wind (get-lru-window (if viper-xemacs-p nil 'visible))) (set-window-buffer wind buf)) - + (if (viper-window-display-p) (progn (raise-frame (window-frame wind)) @@ -1565,15 +1565,15 @@ reversed." (save-window-excursion (select-window wind) (sit-for 1)) (select-window wind))) (save-window-excursion (select-window wind) (sit-for 1))) - + (save-excursion (set-buffer buf) (setq viper-related-files-and-buffers-ring old-ring)) - + (setq viper-local-search-start-marker (point-marker)) ))) - - + + ;; Force auto save (defun ex-preserve () (message "Autosaving all buffers that need to be saved...") @@ -1595,7 +1595,7 @@ reversed." (defun ex-quit () ;; skip "!", if it is q!. In Viper q!, w!, etc., behave as q, w, etc. (save-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (if (looking-at "!") (forward-char 1))) (if (< viper-expert-level 3) @@ -1621,19 +1621,19 @@ reversed." (setq ex-file buffer-file-name))) (if ex-cmdfile (progn - (setq command + (setq command ;; replace # and % with the previous/current file (ex-expand-filsyms (concat ex-file ex-cmdfile-args) (current-buffer))) (shell-command command t)) (insert-file-contents ex-file))) (ex-fixup-history viper-last-ex-prompt ex-file ex-cmdfile-args)) - + ;; this function fixes ex-history for some commands like ex-read, ex-edit -(defun ex-fixup-history (&rest args) +(defun ex-fixup-history (&rest args) (setq viper-ex-history (cons (mapconcat 'identity args " ") (cdr viper-ex-history)))) - + ;; Ex recover from emacs \#file\# (defun ex-recover () @@ -1674,7 +1674,7 @@ reversed." (viper-set-unread-command-events ?\C-m))) (message ":set <Variable> [= <Value>]") (or batch (sit-for 2)) - + (while (string-match "^[ \\t\\n]*$" (setq str (completing-read ":set " ex-variable-alist))) @@ -1755,19 +1755,19 @@ reversed." (or (viper-set-unread-command-events "") (sit-for 2)) (setq val (read-string (format ":set %s = " var))) (ex-fixup-history "set" orig-var val) - + ;; check numerical values (if (member var '("sw" "shiftwidth" "ts" "tabstop" "ts-g" "tabstop-global" - "wm" "wrapmargin")) + "wm" "wrapmargin")) (condition-case nil (or (numberp (setq val2 (car (read-from-string val)))) (error "%s: Invalid value, numberp, %S" var val)) (error (error "%s: Invalid value, numberp, %S" var val)))) - + (cond ((member var '("sw" "shiftwidth")) (setq var "viper-shift-width")) @@ -1782,27 +1782,27 @@ reversed." set-cmd "setq-default")) ((member var '("wm" "wrapmargin")) ;; make it take effect in curr buff and new bufs - (kill-local-variable 'fill-column) - (setq var "fill-column" + (kill-local-variable 'fill-column) + (setq var "fill-column" val (format "(- (window-width) %s)" val) set-cmd "setq-default")) ((member var '("sh" "shell")) (setq var "explicit-shell-file-name" val (format "\"%s\"" val))))) (ex-fixup-history "set" orig-var)) - + (if set-cmd (setq actual-lisp-cmd (format "\n(%s %s %s) %s" set-cmd var val auto-cmd-label) lisp-cmd-del-pattern (format "^\n?[ \t]*([ \t]*%s[ \t]+%s[ \t].*)[ \t]*%s" set-cmd var auto-cmd-label))) - + (if (and ask-if-save (y-or-n-p (format "Do you want to save this setting in %s " viper-custom-file-name))) (progn - (viper-save-string-in-file + (viper-save-string-in-file actual-lisp-cmd viper-custom-file-name ;; del pattern lisp-cmd-del-pattern) @@ -1822,7 +1822,7 @@ reversed." lisp-cmd-del-pattern) )) )) - + (if set-cmd (message "%s %s %s" set-cmd var @@ -1843,7 +1843,7 @@ reversed." ;; special meaning (defun ex-get-inline-cmd-args (regex-forw &optional chars-back replace-str) (save-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (goto-char (point-min)) (re-search-forward regex-forw nil t) @@ -1868,7 +1868,7 @@ reversed." ;; Ex shell command (defun ex-shell () (shell)) - + ;; Viper help. Invokes Info (defun ex-help () (condition-case nil @@ -1895,7 +1895,7 @@ Please contact your system administrator. " ;; Ex substitute command ;; If REPEAT use previous regexp which is ex-reg-exp or viper-s-string -(defun ex-substitute (&optional repeat r-flag) +(defun ex-substitute (&optional repeat r-flag) (let ((opt-g nil) (opt-c nil) (matched-pos nil) @@ -1993,7 +1993,7 @@ Please contact your system administrator. " (defun ex-tag () (let (tag) (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (skip-chars-forward " \t") (set-mark (point)) @@ -2013,13 +2013,13 @@ Please contact your system administrator. " ;; Ex write command ;; ex-write doesn't support wildcards, because file completion is a better -;; mechanism. We also don't support # and % +;; mechanism. We also don't support # and % ;; because file history is a better mechanism. (defun ex-write (q-flag) (viper-default-ex-addresses t) (viper-get-ex-file) (let ((end (car ex-addresses)) - (beg (car (cdr ex-addresses))) + (beg (car (cdr ex-addresses))) (orig-buf (current-buffer)) ;;(orig-buf-file-name (buffer-file-name)) ;;(orig-buf-name (buffer-name)) @@ -2030,14 +2030,14 @@ Please contact your system administrator. " (if ex-cmdfile (progn (viper-enlarge-region beg end) - (shell-command-on-region (point) (mark t) + (shell-command-on-region (point) (mark t) (concat ex-file ex-cmdfile-args))) (if (and (string= ex-file "") (not (buffer-file-name))) (setq ex-file (read-file-name (format "Buffer %s isn't visiting any file. File to save in: " (buffer-name))))) - + (setq writing-whole-file (and (= (point-min) beg) (= (point-max) end)) ex-file (if (string= ex-file "") (buffer-file-name) @@ -2049,7 +2049,7 @@ Please contact your system administrator. " (setq ex-file (concat (file-name-as-directory ex-file) (file-name-nondirectory buffer-file-name)))) - + (setq file-exists (file-exists-p ex-file) writing-same-file (string= ex-file (buffer-file-name))) @@ -2070,7 +2070,7 @@ Please contact your system administrator. " (format "File %s exists. Overwrite? " ex-file)))) (error "Quit")) ;; writing a region or whole buffer to non-visited file - (unwind-protect + (unwind-protect (save-excursion (viper-enlarge-region beg end) (setq region (buffer-substring (point) (mark t))) @@ -2104,7 +2104,7 @@ Please contact your system administrator. " (if (and (buffer-file-name) writing-same-file) (set-visited-file-modtime)) ;; prevent loss of data if saving part of the buffer in visited file - (or writing-whole-file + (or writing-whole-file (not writing-same-file) (progn (sit-for 2) @@ -2115,7 +2115,7 @@ Please contact your system administrator. " (save-buffers-kill-emacs) (kill-buffer (current-buffer)))) ))) - + (defun ex-write-info (exists file-name beg end) (message "`%s'%s %d lines, %d characters" @@ -2155,7 +2155,7 @@ Please contact your system administrator. " (defun ex-command () (let (command) (save-window-excursion - (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) + (setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (set-buffer viper-ex-work-buf) (skip-chars-forward " \t") (setq command (buffer-substring (point) (point-max))) @@ -2262,7 +2262,7 @@ Type 'mak ' (including the space) to run make with no args." (with-output-to-temp-buffer " *viper-info*" (princ (if viper-auto-indent "autoindent (local)\n" "noautoindent (local)\n")) - (princ (if (default-value 'viper-auto-indent) + (princ (if (default-value 'viper-auto-indent) "autoindent (global) \n" "noautoindent (global) \n")) (princ (if viper-case-fold-search "ignorecase\n" "noignorecase\n")) (princ (if viper-re-search "magic\n" "nomagic\n")) |