]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/em-hist.el
Delete the autoloads for functions defined with ibuffer-specific commands.
[gnu-emacs] / lisp / eshell / em-hist.el
index 5b661bbd7483b2714e7f7f8858d9dd3510d43562..a5426f530011ff30591f770e840384bd92a984b4 100644 (file)
@@ -1,6 +1,8 @@
-;;; em-hist --- history list management
+;;; em-hist.el --- history list management
 
-;; Copyright (C) 1999, 2000 Free Sofware Foundation
+;; Copyright (C) 1999, 2000 Free Software Foundation
+
+;; Author: John Wiegley <johnw@gnu.org>
 
 ;; This file is part of GNU Emacs.
 
@@ -350,17 +352,13 @@ unless a different file is specified on the command line.")
 (defun eshell-put-history (input &optional ring at-beginning)
   "Put a new input line into the history ring."
   (unless ring (setq ring eshell-history-ring))
-  (subst-char-in-string ?\n ?\177 input t)
   (if at-beginning
       (ring-insert-at-beginning ring input)
     (ring-insert ring input)))
 
 (defun eshell-get-history (index &optional ring)
   "Get an input line from the history ring."
-  (unless ring (setq ring eshell-history-ring))
-  (let ((input (concat (ring-ref ring index))))
-    (subst-char-in-string ?\177 ?\n input t)
-    input))
+  (ring-ref (or ring eshell-history-ring) index))
 
 (defun eshell-add-to-history ()
   "Add INPUT to the history ring.
@@ -376,7 +374,7 @@ input."
                   (ring-empty-p eshell-history-ring)
                   (not (string-equal (eshell-get-history 0) input))))
          (eshell-put-history input))
-      (setq eshell-save-history-index eshell-history-ring)
+      (setq eshell-save-history-index eshell-history-index)
       (setq eshell-history-index nil))))
 
 (defun eshell-read-history (&optional filename silent)
@@ -419,7 +417,8 @@ line, with the most recent command last.  See also
              (if (or (null ignore-dups)
                      (ring-empty-p ring)
                      (not (string-equal (ring-ref ring 0) history)))
-                 (ring-insert-at-beginning ring history)))
+                 (ring-insert-at-beginning
+                  ring (subst-char-in-string ?\177 ?\n history))))
            (setq count (1+ count))))
        (setq eshell-history-ring ring
              eshell-history-index nil))))))
@@ -451,7 +450,9 @@ See also `eshell-read-history'."
        (with-temp-buffer
          (while (> index 0)
            (setq index (1- index))
-           (insert (ring-ref ring index) ?\n))
+           (let ((start (point)))
+             (insert (ring-ref ring index) ?\n)
+             (subst-char-in-region start (1- (point)) ?\n ?\177)))
          (eshell-with-private-file-modes
           (write-region (point-min) (point-max) file append
                         'no-message))))))))
@@ -815,7 +816,8 @@ If N is negative, find the next or Nth next match."
     (if (null pos)
        (error "Not found")
       (setq eshell-history-index pos)
-      (message "History item: %d" (- (ring-length eshell-history-ring) pos))
+      (unless (minibuffer-window-active-p (selected-window))
+       (message "History item: %d" (- (ring-length eshell-history-ring) pos)))
        ;; Can't use kill-region as it sets this-command
       (delete-region (save-excursion (eshell-bol) (point)) (point))
       (insert-and-inherit (eshell-get-history pos)))))
@@ -891,7 +893,6 @@ If N is negative, search backwards for the -Nth previous match."
        (goto-char eshell-last-output-end)
        (delete-region (point) (point-max))
        (when (and text (> (length text) 0))
-         (subst-char-in-string ?\177 ?\n text t)
          (insert text)
          (put-text-property (1- (point)) (point)
                             'last-search-pos before)