Ivan Shvedunov wrote:
On Thu, Oct 30, 2008 at 11:02 AM, Helmut Eller heller@common-lisp.net wrote:
Patch applied.
Thanks.
Another patch attached to this message makes SLIME REPL usable in Paredit mode by using the part of input between its start and (point) as history search pattern. I've sent a patch doing that long time ago, it was applied but later accidentally (as I understood it after asking on #lisp) reverted. I forgot about it for a while and just kept changes in my copy of SLIME, but now I decided to share them again.
I committed this with some modifications. It's still a mystery to me how this patch can affect paredit mode.
Well, it affects paredit mode in REPL buffer. Paredit automagically inserts ')' after you type '('. So if you typed '(lo' you will have '(lo)' at your REPL prompt with point before the closing paren and when you press M-p to find previous '(loop ...)' expression you typed before, nothing will be found unless the portion between start of input and point is used, unless of course you typed exactly '(lo)' before.
How I fixed that in my slime.el is that I added t to slime-repl-current-input
=================================== file: slime.el
(defun slime-repl-history-pattern (&optional use-current-input) "Return the regexp for the navigation commands." (cond ((slime-repl-history-search-in-progress-p) slime-repl-history-pattern) (use-current-input - (let ((str (slime-repl-current-input))) + (let ((str (slime-repl-current-input t))) (cond ((string-match "^[ \n]*$" str) nil) (t (concat "^" (regexp-quote str)))))) (t nil)))