• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/eshell/

Lines Matching +defs:string +defs:to +defs:char

21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
55 ;; ; 'ls' as the current input, it will go back to the same
62 ;; confusing, but the intention is to make the most useful
65 ;; if it is, history navigation tries to use similar keybindings to
77 "*A list of functions to call when loading `eshell-hist'."
92 "*If non-nil, name of the file to read/write input history.
113 whether to prompt the user.
114 If set to nil, it means never save history on termination of Emacs.
115 If set to `ask', ask if any Eshell buffers are open at exit time.
116 If set to t, history will always be saved, silently."
125 (not (string-match "\\`\\s-*\\'" str))))
126 "*Predicate for filtering additions to input history.
128 the input history list. Default is to save anything that isn't all
137 Otherwise, typing <M-p> and <M-n> will always go to the next history
143 (defcustom eshell-hist-move-to-end t
144 "*If non-nil, move to the end of the buffer before cycling history."
150 "*The regexp used to identifier history event designators."
156 "*The regexp used to identify history word designators."
162 "*The regexp used to identity history modifiers."
179 "*History keys to bind differently if point is in input text."
180 :type '(repeat (cons (vector :tag "Keys to bind"
189 (defvar eshell-matching-input-from-input-string "")
201 (define-key eshell-isearch-map [backspace] 'eshell-isearch-delete-char)
202 (define-key eshell-isearch-map [delete] 'eshell-isearch-delete-char)
291 (add-hook 'eshell-input-filter-functions 'eshell-add-to-history nil t)
316 "read from history file to current history list")
318 "write current history list to history file")
320 "append current history list to history file")
331 (when (and args (string-match "^[0-9]+$" (car args)))
349 ;; We have to build up a list ourselves from the ring vector.
369 (defun eshell-add-input-to-history (input)
370 "Add the string INPUT to the history ring.
378 (not (string-equal (eshell-get-history 0) input))))
383 (defun eshell-add-command-to-history ()
384 "Add the command entered at `eshell-command's prompt to the history ring.
385 The command is added to the input history ring, if the value of
389 This function is supposed to be called from the minibuffer, presumably
391 (eshell-add-input-to-history
394 (defun eshell-add-to-history ()
395 "Add last Eshell command to the history ring.
402 (eshell-add-input-to-history input))))
412 failure to read the history file.
436 (goto-char (point-max))
440 (let ((history (match-string 1)))
443 (not (string-equal (ring-ref ring 0) history)))
445 ring (subst-char-in-string ?\177 ?\n history))))
451 "Writes the buffer's `eshell-history-ring' to a history file.
479 (subst-char-in-region start (1- (point)) ?\n ?\177)))
490 (setq prefix (match-string 1)
499 ;; We have to build up a list ourselves from the ring vector.
504 (string= (substring hist 0 prelen) prefix)))
507 ;; Change "completion" to "history reference"
508 ;; to make the display accurate.
509 (with-output-to-temp-buffer history-buffer
516 (message "Hit space to flush")
523 "Return the word designator index referred to by REF."
525 ((string-match "^[0-9]+$" ref)
526 (string-to-number ref))
527 ((string= "^" ref) 1)
528 ((string= "$" ref) nil)
529 ((string= "%" ref)
544 (goto-char begin)
553 (forward-char))
581 (goto-char (car posb))
583 (delete-char (- (car pose) (car posb)))))
591 (when (string-match "\\`![^:^$*%]*\\'" arg)
598 ;; We have to build up a list ourselves from the ring
603 (string= (substring hist 0 stublen)
605 (string-match "^\\([^:^$*% \t\n]+\\)" hist))
606 (setq history (cons (match-string 1 hist)
620 Returns the resultant reference, or the same string REFERENCE if none
624 ;; STRING1 with STRING2. Equivalent to `!!:s/string1/string2/'
626 (string-match "\\^\\([^^]+\\)\\^\\([^^]+\\)\\^?\\s-*$"
629 (match-string 1 reference)
630 (match-string 2 reference))))
634 (if (not (string-match "^![^ \t\n=\(]" reference))
643 (if (not (string-match "^[:^$*%]" reference))
648 (error "Unable to honor word designator `%s'" reference))
649 (unless (string-match "^[:^$*%][[$^*%0-9-]" reference)
654 (string-match "^:" reference)))
660 (let* ((index (string-match eshell-hist-event-designator reference))
664 (let* ((event (match-string 1 reference))
667 ((string= event "!") (ring-length eshell-history-ring))
668 ((string= event "#") (error "!# not yet implemented"))
669 ((string-match "^-?[0-9]+$" event)
670 (let ((num (string-to-number event)))
674 ((string-match "^\\(\\??\\)\\([^?]+\\)\\??$" event)
675 (let ((pref (if (> (length (match-string 1 event)) 0)
677 (str (match-string 2 event)))
679 (eshell-previous-matching-input-string-position
682 (error "Failed to parse event designator `%s'" event)))))
687 (let* ((index (string-match eshell-hist-word-designator reference))
691 (let ((nth (match-string 1 reference))
692 (mth (match-string 2 reference))
698 (if (string= nth "*")
707 (if (string= mth "-")
709 (if (string= mth "*")
729 (narrow-to-region here (point))
730 (goto-char (point-min))
740 recalled last. You can use this to repeat a sequence of input lines."
751 (if (and eshell-hist-move-to-end
753 (goto-char eshell-last-output-end))
766 "Index to start a directional search, starting at `eshell-history-index'."
777 (defun eshell-previous-input-string (arg)
778 "Return the string ARG places along the input ring.
779 Moves relative to `eshell-history-index'."
795 (defun eshell-previous-matching-input-string (regexp arg)
796 "Return the string matching REGEXP ARG places along the input ring.
797 Moves relative to `eshell-history-index'."
798 (let* ((pos (eshell-previous-matching-input-string-position regexp arg)))
801 (defun eshell-previous-matching-input-string-position
804 Moves relative to START, or `eshell-history-index'."
821 (not (string-match regexp (eshell-get-history n))))
826 ;; Now that we know which ring element to use, if we found it,
828 (if (string-match regexp (eshell-get-history n))
838 (let ((pos (eshell-previous-matching-input-string-position regexp arg)))
866 (setq eshell-matching-input-from-input-string
871 (concat "^" (regexp-quote eshell-matching-input-from-input-string))
894 (forward-char))
896 (backward-char))))))
898 (defun eshell-return-to-prompt ()
899 "Once a search string matches, insert it at the end and go there."
907 isearch-string nil t)))
911 (goto-char eshell-last-output-end)
917 (goto-char eshell-last-output-end)
924 (goto-char eshell-last-output-end))))))
930 (goto-char (point-min))
941 (goto-char (point-max))
944 (isearch-mode invert t 'eshell-return-to-prompt))
952 (goto-char old-pos)
955 (backward-char)))
971 (goto-char eshell-last-output-end)
977 (goto-char eshell-last-output-end)
981 (defun eshell-isearch-delete-char ()
984 (isearch-delete-char)))