[slime-devel] slime-search-property and xemacs

Raymond Toy toy.raymond at gmail.com
Wed Feb 9 03:57:38 UTC 2011


There's an issue with slime-search-property and xemacs.  In xemacs,
next-single-char-property-change returns nil if the property is not
found instead of the end of the object as in emacs.  This problem shows
up when you're using M-p/M-n to find the next compiler note/warning in
the source code.  We get an error about (goto-char nil) when the last
note is found.

Here is small patch to slime-search-property so that it works with
xemacs.  I was not sure what the best approach would be for this, so I'm
sending the patch.

Ray

--- slime.el	04 Feb 2011 09:26:36 -0500	1.1355
+++ slime.el	08 Feb 2011 22:46:17 -0500	
@@ -4834,9 +4834,17 @@
 Return the value of PROP.
 If BACKWARD is non-nil, search backward.
 If PROP-VALUE-FN is non-nil use it to extract PROP's value."
-  (let ((next-candidate (if backward
+  (let ((next-candidate (if (featurep 'xemacs)
+                          (if backward
+                              #'(lambda (pos prop)
+                                  (or
(previous-single-char-property-change pos prop)
+                                      (point-max)))
+                              #'(lambda (pos prop)
+                                  (or (next-single-char-property-change
pos prop)
+                                      (point-max))))
+                          (if backward
                             #'previous-single-char-property-change
-                            #'next-single-char-property-change))
+                            #'next-single-char-property-change)))
         (prop-value-fn  (or prop-value-fn
                             (lambda ()
                               (get-text-property (point) prop))))






More information about the slime-devel mailing list