]> code.delx.au - gnu-emacs/blobdiff - lisp/comint.el
(x-select-enable-clipboard): Customize (per lispref).
[gnu-emacs] / lisp / comint.el
index 3a02d93ee725e88fb9be1fe3f5ca5e44028c05ce..f3922f3407dc32e9e015e2531ed8c3a23a4dc075 100644 (file)
@@ -512,7 +512,6 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
   (make-local-variable 'comint-scroll-to-bottom-on-input)
   (make-local-variable 'comint-scroll-to-bottom-on-output)
   (make-local-variable 'comint-scroll-show-maximum-output)
-  (make-local-hook 'pre-command-hook)
   (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom t t)
   (make-local-hook 'comint-output-filter-functions)
   (make-local-hook 'comint-exec-hook)
@@ -1331,6 +1330,16 @@ Argument 0 is the command name."
 ;;
 ;; Input processing stuff
 ;;
+(defun comint-add-to-input-history (cmd)
+  "Add CMD to the input history.
+Ignore duplicates if `comint-input-ignoredups' is non-nil."
+  (if (and (funcall comint-input-filter cmd)
+          (or (null comint-input-ignoredups)
+              (not (ring-p comint-input-ring))
+              (ring-empty-p comint-input-ring)
+              (not (string-equal (ring-ref comint-input-ring 0)
+                                 cmd))))
+      (ring-insert comint-input-ring cmd)))
 
 (defun comint-send-input ()
   "Send input to process.
@@ -1406,13 +1415,7 @@ Similarly for Soar, Scheme, etc."
              (delete-region pmark (point))
            (insert ?\n))
 
-         (if (and (funcall comint-input-filter history)
-                  (or (null comint-input-ignoredups)
-                      (not (ring-p comint-input-ring))
-                      (ring-empty-p comint-input-ring)
-                      (not (string-equal (ring-ref comint-input-ring 0)
-                                         history))))
-             (ring-insert comint-input-ring history))
+         (comint-add-to-input-history history)
 
          (run-hook-with-args 'comint-input-filter-functions
                              (concat input "\n"))
@@ -1714,7 +1717,7 @@ value of `comint-use-prompt-regexp-instead-of-fields'."
     ;; Return the contents of the field at the current point.
     (let ((pos (field-beginning (point))))
       (unless (eq (get-char-property pos 'field) 'input)
-       (error "Point not in input field"))
+       (error "Not an input field"))
       (field-string pos))))
 
 (defun comint-copy-old-input ()
@@ -2330,7 +2333,11 @@ This mirrors the optional behavior of tcsh."
 If a cons pair, it should be of the form (DIRSUFFIX . FILESUFFIX) where
 DIRSUFFIX and FILESUFFIX are strings added on unambiguous or exact completion.
 This mirrors the optional behavior of tcsh."
-  :type 'boolean
+  :type '(choice (const :tag "None" nil)
+                (const :tag "Add /" t)
+                (cons :tag "Suffix pair"
+                      (string :tag "Directory suffix")
+                      (string :tag "File suffix")))
   :group 'comint-completion)
 
 (defcustom comint-completion-recexact nil