[slime-devel] buglet hyperspec.el: hyperspec-lookup copies text properties at point

Michael Weber michaelw+slime at foldr.org
Thu Jan 22 23:28:11 UTC 2004


Hi,

HYPERSPEC-LOOKUP from slime's hyperspec.el copies the emacs text
properties when getting the symbol to lookup.  When called at a new
slime-repl prompt, the prompt is taken as symbol to lookup (since
there is nothing else).

But the slime-repl prompt has property read-only and thus it cannot be
edited at the HYPERSPEC-LOOKUP prompt in the minibuffer, to enter the
right symbol for lookup.

* to reproduce:

M-x slime
M-x hyperspec-lookup
; try to edit the "CL-USER>", emacs will beep and whine that it is
; read-only.

* software:
  + Latest SLIME
  + GNU/Emacs 21.3.50.1


* fix: 
  Drop text-properties when getting symbol at point.

  Ideally, thingatpt would provide such functionality, but it does
  not, currently.
  

Patch for hyperspec.el attached.


Cheers,
Michael
-------------- next part --------------
Index: hyperspec.el
===================================================================
RCS file: /project/slime/cvsroot/slime/hyperspec.el,v
retrieving revision 1.2
diff -u -r1.2 hyperspec.el
--- hyperspec.el	4 Dec 2003 16:42:53 -0000	1.2
+++ hyperspec.el	22 Jan 2004 21:10:07 -0000
@@ -60,6 +60,16 @@
 
 (defvar common-lisp-hyperspec-symbols (make-vector 67 0))
 
+
+(defun clhs-thing-at-point-no-properties (thing)
+  "Return thing of type THING at point, but without text properties."
+  (let ((inhibit-read-only t)
+	(object-at-point (thing-at-point thing)))
+    (set-text-properties 0 (length object-at-point) nil
+			 object-at-point)
+    object-at-point))
+
+
 (defun common-lisp-hyperspec (symbol-name)
   "View the documentation on SYMBOL-NAME from the Common Lisp HyperSpec.
 If SYMBOL-NAME has more than one definition, all of them are displayed with
@@ -73,7 +83,8 @@
 Visit http://www.lispworks.com/reference/HyperSpec/ for more information.
 If you copy the HyperSpec to another location, customize the variable
 `common-lisp-hyperspec-root' to point to that location."
-  (interactive (list (let ((symbol-at-point (thing-at-point 'symbol)))
+  (interactive (list (let ((symbol-at-point 
+			      (clhs-thing-at-point-no-properties 'symbol)))
                        (if (and symbol-at-point
                                 (intern-soft (downcase symbol-at-point)
                                              common-lisp-hyperspec-symbols))


More information about the slime-devel mailing list