[slime-devel] swank-listener-hooks fix, paredit-friendly REPL patch

Knut Olav Bøhmer knut-olav.bohmer at telenor.com
Fri Oct 31 09:01:25 UTC 2008


Ivan Shvedunov wrote:
> On Thu, Oct 30, 2008 at 11:02 AM, Helmut Eller <heller at 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)))

-- 
Konsulent, Fri Programvare / Free Software Consultant
Cell: +47 - 473 44 008
Phone: +47 - 21 53 69 00, Fax: +47 - 21 53 69 09
Addr: Nydalsveien 30 B, 0484 Oslo
Web: www.freecode.no

"It seems that I know that I know. What I'd like to see,
Is the I that knows me, When I know that I know that I know."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20081031/159b7e1e/attachment.html>


More information about the slime-devel mailing list