[slime-cvs] CVS slime
CVS User heller
heller at common-lisp.net
Tue Mar 3 10:03:59 UTC 2009
Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv18975
Modified Files:
ChangeLog hyperspec.el slime.el
Log Message:
Use a separate key, C-c C-d #, to lookup reader-macros.
* hyperspec.el (common-lisp-hyperspec-lookup-reader-macro): New
command.
(common-lisp-hyperspec-reader-macros): New variable.
(common-lisp-hyperspec-reader-macro-at-point): Moved over from
slime.el
* slime.el (slime-doc-bindings): Bind C-c C-d #.
(slime-hyperspec-lookup): Don't consider reader-macros.
--- /project/slime/cvsroot/slime/ChangeLog 2009/03/02 20:35:54 1.1704
+++ /project/slime/cvsroot/slime/ChangeLog 2009/03/03 10:03:59 1.1705
@@ -1,3 +1,15 @@
+2009-03-03 Helmut Eller <heller at common-lisp.net>
+
+ Use a separate key, C-c C-d #, to lookup reader-macros.
+
+ * hyperspec.el (common-lisp-hyperspec-lookup-reader-macro): New
+ command.
+ (common-lisp-hyperspec-reader-macros): New variable.
+ (common-lisp-hyperspec-reader-macro-at-point): Moved over from
+ slime.el
+ * slime.el (slime-doc-bindings): Bind C-c C-d #.
+ (slime-hyperspec-lookup): Don't consider reader-macros.
+
2009-03-02 Tobias C. Rittweiler <tcr at freebits.de>
* hyperspec.el (common-lisp-hyperspec-symbols): Add entries for
--- /project/slime/cvsroot/slime/hyperspec.el 2009/03/02 20:35:55 1.13
+++ /project/slime/cvsroot/slime/hyperspec.el 2009/03/03 10:03:59 1.14
@@ -1138,10 +1138,13 @@
;;;
;;; 20090302 Tobias C Rittweiler, and Stas Boukarev
-;;; `common-lisp-hyperspec-symbol-table' (Data/Map_Sym.txt in particular)
-;;; does not contain entries for the reader macros. So we have to add these
-;;; in either cases of the if-expression above.
-(mapc (lambda (entry) (intern-clhs-symbol (car entry) (cadr entry)))
+(defvar common-lisp-hyperspec-reader-macros (make-hash-table :test #'equal))
+
+;;; Data/Map_Sym.txt in does not contain entries for the reader
+;;; macros. So we have to enumerate these explicitly.
+(mapc (lambda (entry)
+ (puthash (car entry) (cadr entry)
+ common-lisp-hyperspec-reader-macros))
'(("#" "02_dh.htm")
("##" "02_dhp.htm")
("#'" "02_dhb.htm")
@@ -1171,8 +1174,21 @@
(")" "02_db.htm")
(";" "02_dd.htm")))
+(defun common-lisp-hyperspec-lookup-reader-macro (macro)
+ "Browse the CLHS entry for the reader-macro MACRO."
+ (interactive
+ (list (completing-read "Look up reader-macro: "
+ common-lisp-hyperspec-reader-macros nil t
+ (common-lisp-hyperspec-reader-macro-at-point))))
+ (browse-url
+ (concat common-lisp-hyperspec-root "Body/"
+ (gethash macro common-lisp-hyperspec-reader-macros))))
+
+(defun common-lisp-hyperspec-reader-macro-at-point ()
+ (let ((regexp "\\(#.?\\)\\|\\([\"',`';()]\\)"))
+ (when (looking-back regexp nil t)
+ (match-string-no-properties 0))))
-
;;; FORMAT character lookup by Frode Vatvedt Fjeld <frodef at acm.org> 20030902
;;;
;;; adjusted for ILISP by Nikodemus Siivola 20030903
--- /project/slime/cvsroot/slime/slime.el 2009/02/27 22:00:25 1.1138
+++ /project/slime/cvsroot/slime/slime.el 2009/03/03 10:03:59 1.1139
@@ -589,7 +589,8 @@
(?d slime-describe-symbol)
(?f slime-describe-function)
(?h slime-hyperspec-lookup)
- (?~ common-lisp-hyperspec-format)))
+ (?~ common-lisp-hyperspec-format)
+ (?# common-lisp-hyperspec-lookup-reader-macro)))
(defvar slime-who-map (make-sparse-keymap)
"Keymap for who-xref commands. Bound to a prefix key.")
@@ -4519,9 +4520,7 @@
(defun slime-hyperspec-lookup (symbol-name)
"A wrapper for `hyperspec-lookup'"
- (interactive (list (let* ((symbol-at-point
- (or (slime-reader-macro-at-point)
- (slime-symbol-at-point)))
+ (interactive (list (let* ((symbol-at-point (slime-symbol-at-point))
(stripped-symbol
(and symbol-at-point
(downcase
@@ -8246,13 +8245,6 @@
"Return the sexp at point as a string, othwise signal an error."
(or (slime-string-at-point) (error "No string at point.")))
-(defun slime-reader-macro-at-point ()
- (let ((regexp "\\(#.?\\)\\|\\([\"',`';()]\\)"))
- (save-match-data
- (when (looking-back regexp)
- (buffer-substring-no-properties (match-beginning 0)
- (match-end 0))))))
-
(defun slime-input-complete-p (start end)
"Return t if the region from START to END contains a complete sexp."
(save-excursion
More information about the slime-cvs
mailing list