From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: small chunk-of-code and a question.
Date: Tue, 27 May 2003 14:45:45 -0600 [thread overview]
Message-ID: <3ED3CE79.9010106@yahoo.com> (raw)
In-Reply-To: 200305271857.OAA09454@rds294.goodyear.com
[Followup-To: gnu.emacs.help]
Tom Wurgler wrote:
> 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))))
You can get rid of a lot of those nil's and t's:
(save-excursion
(let ((beg (point)))
(and (re-search-backward regexp nil t)
(= (match-end 0) beg))))
> 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?
Try this:
(add-hook 'shell-mode-hook
(lambda () (setq comint-input-ring-file nil)))
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
parent reply other threads:[~2003-05-27 20:45 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200305271857.OAA09454@rds294.goodyear.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ED3CE79.9010106@yahoo.com \
--to=ihs_4664@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.