gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

small chunk-of-code and a question.


From: Tom Wurgler
Subject: small chunk-of-code and a question.
Date: Tue, 27 May 2003 14:57:53 -0400 (EDT)

Here is a defun I find useful.  Like `looking-at' except looks just before
point.   Use it if you can.... 

(defun looking-back (regexp)
  "Return t if text before point matches regular expression REGEXP.
This function modifies the match data that `match-beginning',
`match-end' and `match-data' access; save and restore the match
data if you want to preserve them."
  (save-excursion
    (let ((beg (point)))
      (if (re-search-backward regexp nil t)
          (if (= (match-end 0) beg)
              t
            nil)
        nil))))

Then the question:

In GNU emacs 20.-, in shell mode, repeated `comint-previous-input' while at the
prompt cycled back though the history of the commands used in that buffer to
date.  When that list was gone through, it started over.  However, starting with
21+, you cycle through the list once and then start cycling through the user's
~/.history list as well.  How can I set it to use the old behaviour, ie I don't
want to use the ~/.history list?

Thanks for any help...

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]