[slime-devel] Re: slime-display-edit-hilights

Peter Seibel peter at gigamonkeys.com
Mon Dec 19 23:48:04 UTC 2005


Peter Seibel <peter at gigamonkeys.com> writes:

> Peter Seibel <peter at gigamonkeys.com> writes:
>
>> "Marco Baringer" <mb at bese.it> writes:
>>
>>> Alain.Picard at memetrics.com writes:
>>>
>>>> Marco Baringer writes:
>>>>  > 
>>>>  > for those of you who don't follow c.l.l (which is probaly a good idea)
>>>>  > i commited William Bland's patch[1]. see the ChangeLog for details.
>>>>
>>>> Yeah, that's pretty cool, but there are two major annoyances with it:
>>>>  * It tries to do it's thing even in the REPL.
>>>>    This seems insane; you only want to do this in source files, IMHO
>>>
>>> nikodemus fixed this yesterday..
>>
>> Hmmm. I see his entry in the ChangeLog but I still get the
>> highlighting in the REPL.
>
> Meanwhile, here's a patch to turn off hilighting when in a comment.

And here's a potentially better one, thanks to kreuter on #lisp. Only
tested on CVS emacs.

-Peter

Index: ChangeLog
===================================================================
RCS file: /project/slime/cvsroot/slime/ChangeLog,v
retrieving revision 1.821
diff -u -r1.821 ChangeLog
--- ChangeLog	18 Dec 2005 17:24:36 -0000	1.821
+++ ChangeLog	19 Dec 2005 23:46:04 -0000
@@ -1,3 +1,8 @@
+2005-12-19  Peter Seibel  <peter at gigamonkeys.com>
+
+	* slime.el (slime-self-insert-command): Got rid of message about
+	setting up face and skipping edit-hilights when in a comment.
+
 2005-12-18  Nikodemus Siivola <nikodemus at random-state.net>
 
 	* slime.el (slime-mode-hook): Bind simple characters to
Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.571
diff -u -r1.571 slime.el
--- slime.el	18 Dec 2005 17:24:36 -0000	1.571
+++ slime.el	19 Dec 2005 23:46:14 -0000
@@ -9888,12 +9888,16 @@
 (defun slime-self-insert-command ()
   (interactive)
   (self-insert-command 1)
-  (when (and slime-display-edit-hilights (slime-connected-p))
-    (message "Setting up face.")
+  (when (and slime-display-edit-hilights
+             (slime-connected-p)
+             (not (in-comment-p)))
     (let ((overlay (make-overlay (- (point) 1) (point))))
       (flet ((putp (name value) (overlay-put overlay name value)))
         (putp 'face 'slime-display-edit-face)
         (putp 'slime-edit t)))))
+
+(defun in-comment-p ()
+  (nth 4 (syntax-ppss (point))))
 
 (add-hook 'slime-mode-hook
           (lambda ()

-- 
Peter Seibel           * peter at gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp  * http://www.gigamonkeys.com/book/




More information about the slime-devel mailing list