diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 24 | ||||
-rw-r--r-- | lisp/ediff-init.el | 4 | ||||
-rw-r--r-- | lisp/ediff-mult.el | 17 | ||||
-rw-r--r-- | lisp/ediff-util.el | 19 | ||||
-rw-r--r-- | lisp/ediff-wind.el | 6 | ||||
-rw-r--r-- | lisp/emulation/viper-cmd.el | 40 | ||||
-rw-r--r-- | lisp/emulation/viper-ex.el | 21 | ||||
-rw-r--r-- | lisp/emulation/viper.el | 1 |
8 files changed, 105 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1043fa7b798..0060322637d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,27 @@ +2001-12-24 Michael Kifer <kifer@cs.sunysb.edu> + + * viper-cmd.el (viper-change-state): Got rid of make-local-hook. + (viper-special-read-and-insert-char): Make C-m work right in the r + comand. + (viper-buffer-search-enable): Fixed format string. + + * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name + instead of viper-info-on-file. + (ex-set-visited-file-name): New function. + + * viper.el (viper-emacs-state-mode-list): Added mail-mode. + + * ediff-mult.el (ediff-meta-mark-equal-files): Added optional + action argument. + + * ediff-init.el: Fixed some doc strings. + + * ediff-util.el (ediff-after-quit-hook-internal): New variable. + Got rid of make-local-hook. + + * ediff-wind.el (ediff-setup-control-frame): Got rid of + make-local-hook. + 2001-12-23 Richard M. Stallman <rms@gnu.org> * term/x-win.el (x-handle-geometry): Put height and width diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index cbc57655ac2..336f360f31a 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el @@ -590,7 +590,7 @@ highlighted using ASCII flags." Actually, Ediff restores the scope of visibility that existed at startup.") (defcustom ediff-keep-variants t - "*nil means that non-modified variant buffers should be removed at the end of the session after some interrogation. + "*nil means prompt to remove unmodified buffers A/B/C at session end. Supplying a prefix argument to the quit command `q' temporarily reverses the meaning of this variable." :type 'boolean @@ -1241,7 +1241,7 @@ This property can be toggled interactively." (defcustom ediff-autostore-merges 'group-jobs-only "*Save the results of merge jobs automatically. -nil means don't save automatically. t means always save. Anything but nil or t +nil means don't save automatically. t means always save. Anything else means save automatically only if the merge job is part of a group of jobs, such as `ediff-merge-directory' or `ediff-merge-directory-revisions'." :type '(choice (const nil) (const t) (const group-jobs-only)) diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el index 8b0860e5c8a..ac779849353 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el @@ -2110,10 +2110,17 @@ If this is a session registry buffer then just bury it." (ediff-update-meta-buffer (current-buffer) 'must-redraw)) -(defun ediff-meta-mark-equal-files () - "Run though the session list and mark identical files. -This is used only for sessions that involve 2 or 3 files at the same time." +;; ACTION is ?h, ?m, ?=: to mark for hiding, mark for operation, or simply +;; indicate which are equal files +(defun ediff-meta-mark-equal-files (&optional action) + "Run through the session list and mark identical files. +This is used only for sessions that involve 2 or 3 files at the same time. +ACTION is an optional argument that can be ?h, ?m, ?=, to mark for hiding, mark +for operation, or simply indicate which are equal files. If it is nil, then +last-command-char is used to decide which action to take." (interactive) + (if (null action) + (setq action last-command-char)) (let ((list (cdr ediff-meta-list)) marked1 marked2 marked3 fileinfo1 fileinfo2 fileinfo3 elt) @@ -2138,9 +2145,9 @@ This is used only for sessions that involve 2 or 3 files at the same time." (or (ediff-mark-if-equal fileinfo2 fileinfo3) (setq marked3 nil)))) (if (and marked1 marked2 marked3) - (cond ((eq last-command-char ?h) + (cond ((eq action ?h) (ediff-mark-session-for-hiding elt 'mark)) - ((eq last-command-char ?m) + ((eq action ?m) (ediff-mark-session-for-operation elt 'mark)) )) (setq list (cdr list))) diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el index 8d0f7395149..22925c1fc03 100644 --- a/lisp/ediff-util.el +++ b/lisp/ediff-util.el @@ -40,6 +40,8 @@ (defvar mark-active) (defvar ediff-emacs-p) +(defvar ediff-after-quit-hook-internal nil) + (eval-when-compile (let ((load-path (cons (expand-file-name ".") load-path))) (or (featurep 'ediff-init) @@ -294,8 +296,6 @@ to invocation.") (make-local-variable 'ediff-window-setup-function) (make-local-variable 'ediff-keep-variants) - (make-local-hook 'ediff-after-quit-hook-internal) - ;; unwrap set up parameters passed as argument (while setup-parameters (set (car (car setup-parameters)) (cdr (car setup-parameters))) @@ -317,9 +317,11 @@ to invocation.") (if (string-match "buffer" (symbol-name ediff-job-name)) (setq ediff-keep-variants t)) - (make-local-hook 'pre-command-hook) + (if ediff-xemacs-p + (make-local-hook 'pre-command-hook)) + (if (ediff-window-display-p) - (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil t)) + (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil 'local)) (setq ediff-mouse-pixel-position (mouse-pixel-position)) ;; adjust for merge jobs @@ -3845,7 +3847,10 @@ Mail anyway? (y or n) ") "Toggle profiling Ediff commands." (interactive) (ediff-barf-if-not-control-buffer) - (make-local-hook 'post-command-hook) + + (if ediff-xemacs-p + (make-local-hook 'post-command-hook)) + (let ((pre-hook 'pre-command-hook) (post-hook 'post-command-hook)) (if (not (equal ediff-command-begin-time '(0 0 0))) @@ -3853,8 +3858,8 @@ Mail anyway? (y or n) ") (remove-hook post-hook 'ediff-calc-command-time) (setq ediff-command-begin-time '(0 0 0)) (message "Ediff profiling disabled")) - (add-hook pre-hook 'ediff-save-time t t) - (add-hook post-hook 'ediff-calc-command-time nil t) + (add-hook pre-hook 'ediff-save-time t 'local) + (add-hook post-hook 'ediff-calc-command-time nil 'local) (message "Ediff profiling enabled")))) (defun ediff-print-diff-vector (diff-vector-var) diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el index 1a18bead505..4a0928997bd 100644 --- a/lisp/ediff-wind.el +++ b/lisp/ediff-wind.el @@ -1018,8 +1018,10 @@ into icons, regardless of the window manager." (if ediff-xemacs-p (ediff-with-current-buffer ctl-buffer - (make-local-hook 'select-frame-hook) - (add-hook 'select-frame-hook 'ediff-xemacs-select-frame-hook nil t) + (if ediff-xemacs-p + (make-local-hook 'select-frame-hook)) + (add-hook + 'select-frame-hook 'ediff-xemacs-select-frame-hook nil 'local) )) (ediff-with-current-buffer ctl-buffer diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 0df2022ae04..70347ce2aee 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -298,10 +298,12 @@ ;; desirable that viper-pre-command-sentinel is the last hook and ;; viper-post-command-sentinel is the first hook. - (make-local-hook 'viper-after-change-functions) - (make-local-hook 'viper-before-change-functions) - (make-local-hook 'viper-post-command-hooks) - (make-local-hook 'viper-pre-command-hooks) + (if viper-xemacs-p + (progn + (make-local-hook 'viper-after-change-functions) + (make-local-hook 'viper-before-change-functions) + (make-local-hook 'viper-post-command-hooks) + (make-local-hook 'viper-pre-command-hooks))) (remove-hook 'post-command-hook 'viper-post-command-sentinel) (add-hook 'post-command-hook 'viper-post-command-sentinel) @@ -786,9 +788,15 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to ;; key translation. (Such left-overs are possible if the user ;; types a regular key.) (let (unread-command-events) - ;; The next 2 cmds are intended to prevent the input method + ;; The next cmd and viper-set-unread-command-events + ;; are intended to prevent the input method ;; from swallowing ^M, ^Q and other special characters (setq ch (read-char)) + ;; replace ^M with the newline + (if (eq ch ?\C-m) (setq ch ?\n)) + ;; Make sure ^V and ^Q work as quotation chars + (if (memq ch '(?\C-v ?\C-q)) + (setq ch (read-char))) (viper-set-unread-command-events ch) (quail-input-method nil) @@ -806,6 +814,11 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to ;; quail-input-method (let (unread-command-events) (setq ch (read-char)) + ;; replace ^M with the newline + (if (eq ch ?\C-m) (setq ch ?\n)) + ;; Make sure ^V and ^Q work as quotation chars + (if (memq ch '(?\C-v ?\C-q)) + (setq ch (read-char))) (viper-set-unread-command-events ch) (quail-start-translation nil) @@ -818,9 +831,19 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to )) ((and (boundp 'iso-accents-mode) iso-accents-mode) (setq ch (aref (read-key-sequence nil) 0)) + ;; replace ^M with the newline + (if (eq ch ?\C-m) (setq ch ?\n)) + ;; Make sure ^V and ^Q work as quotation chars + (if (memq ch '(?\C-v ?\C-q)) + (setq ch (aref (read-key-sequence nil) 0))) (insert ch)) (t (setq ch (read-char)) + ;; replace ^M with the newline + (if (eq ch ?\C-m) (setq ch ?\n)) + ;; Make sure ^V and ^Q work as quotation chars + (if (memq ch '(?\C-v ?\C-q)) + (setq ch (read-char))) (insert ch)) ) (setq last-command-event @@ -2554,12 +2577,9 @@ These keys are ESC, RET, and LineFeed" (or (eq viper-intermediate-command 'viper-repeat) (viper-special-read-and-insert-char)) - ;; 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) @@ -3836,7 +3856,7 @@ Null string will repeat previous search." (define-key viper-vi-basic-map (cond ((viper-characterp viper-buffer-search-char) (char-to-string viper-buffer-search-char)) - (t (error "viper-buffer-search-char: wrong value type, %s" + (t (error "viper-buffer-search-char: wrong value type, %S" viper-buffer-search-char))) 'viper-command-argument) (aset viper-exec-array viper-buffer-search-char 'viper-exec-buffer-search) diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index 1ee912eb18c..9b26f468600 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -115,7 +115,7 @@ ("customize" (customize-group "viper")) ("delete" (ex-delete)) ("edit" (ex-edit)) - ("file" (viper-info-on-file)) + ("file" (ex-set-visited-file-name)) ("g" "global") ("global" (ex-global nil) is-mashed) ("goto" (ex-goto)) @@ -2232,6 +2232,25 @@ Type 'mak ' (including the space) to run make with no args." (kill-buffer " *viper-info*"))) )) + +;; Without arguments displays info on file. With an arg, sets the visited file +;; name to that arg +(defun ex-set-visited-file-name () + (viper-get-ex-file) + (if (string= ex-file "") + (viper-info-on-file) + ;; If ex-file is a directory, use the file portion of the buffer + ;; file name (like ex-write). Do this even if ex-file is a + ;; non-existent directory, since set-visited-file-name signals an + ;; error on this condition, too. + (if (and (string= (file-name-nondirectory ex-file) "") + buffer-file-name + (not (file-directory-p buffer-file-name))) + (setq ex-file (concat (file-name-as-directory ex-file) + (file-name-nondirectory buffer-file-name)))) + (set-visited-file-name ex-file))) + + ;; display all variables set through :set (defun ex-show-vars () (with-output-to-temp-buffer " *viper-info*" diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index f1d3bb298af..a76dedd3f08 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -426,6 +426,7 @@ widget." tar-mode mh-folder-mode + mail-mode gnus-group-mode gnus-summary-mode |