unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: small chunk-of-code and a question.
       [not found] <200305271857.OAA09454@rds294.goodyear.com>
@ 2003-05-27 20:45 ` Kevin Rodgers
  0 siblings, 0 replies; only message in thread
From: Kevin Rodgers @ 2003-05-27 20:45 UTC (permalink / raw)


[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:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-27 20:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200305271857.OAA09454@rds294.goodyear.com>
2003-05-27 20:45 ` small chunk-of-code and a question Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).