]> git.eshelyaron.com Git - emacs.git/commitdiff
(help-function-cmacro): New button.
authorGlenn Morris <rgm@gnu.org>
Fri, 11 Sep 2009 03:39:48 +0000 (03:39 +0000)
committerGlenn Morris <rgm@gnu.org>
Fri, 11 Sep 2009 03:39:48 +0000 (03:39 +0000)
lisp/help-mode.el

index 91fb4f9925754d9e3695ff209af4516015f05c9e..7c032b81cf2ba2b3777eb7ed08718a213a53c0c6 100644 (file)
@@ -202,6 +202,22 @@ The format is (FUNCTION ARGS...).")
                       (message "Unable to find location in file"))))
   'help-echo (purecopy "mouse-2, RET: find function's definition"))
 
+(define-button-type 'help-function-cmacro
+  :supertype 'help-xref
+  'help-function (lambda (fun file)
+                  (setq file (locate-library file t))
+                  (if (and file (file-readable-p file))
+                      (progn
+                        (pop-to-buffer (find-file-noselect file))
+                        (goto-char (point-min))
+                        (if (re-search-forward
+                             (format "^[ \t]*(define-compiler-macro[ \t]+%s"
+                                     (regexp-quote (symbol-name fun))) nil t)
+                            (forward-line 0)
+                          (message "Unable to find location in file")))
+                    (message "Unable to find file")))
+  'help-echo (purecopy "mouse-2, RET: find function's compiler macro"))
+
 (define-button-type 'help-variable-def
   :supertype 'help-xref
   'help-function (lambda (var &optional file)