help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Jump to autoconf macro documentation


From: Le Wang
Subject: Re: Jump to autoconf macro documentation
Date: Mon, 31 Jan 2011 08:46:59 +0800

You haven't said why it doesn't work.  Maybe you need to look into error handling?

http://www.gnu.org/software/emacs/elisp/html_node/Handling-Errors.html

In the future, please try harder to use the built-in help system *and* Google first before posting to this list.  This list should not be your first line of defense when you come across an issue.

Also when you post your issue, describe it in detail; and demonstrate that you've tried the obvious avenues to resolve it yourself, i.e. describe your attempts at solving the problem, and why you are stuck

"I thought the issue might be xxx, so I tried A, B and C.  But now I'm stuck." 

Giving more details will help others in the future who Google similar issues, It also shows people that you are sincere and willing to invest your own time before bothering others.

People who persistently spray terse "stream of thought" style questions into mailing lists get filtered out.  I like it when people show respect for others' time.

Please understand that I'm not trying to offend you, just trying to help you get more answers to your questions in the future.


On Mon, Jan 31, 2011 at 8:02 AM, Andrea Crotti <andrea.crotti.0@gmail.com> wrote:
To be more complete I thought that I could do the following thing, first I try
to look for the macro definition in aclocal.m4, and if it's not there I try in the Info page.

So I came up with something like
--8<---------------cut here---------------start------------->8---

 (setq autoconf-macro-syntax-table (make-syntax-table))
 (modify-syntax-entry ?_ "w" autoconf-macro-syntax-table)

 (defun get-autoconf-macro-definition ()
   "jump to the definition of a macro"
   (interactive)
   (let
       ((macro (with-syntax-table autoconf-macro-syntax-table (thing-at-point 'word))))
     (unless (get-autoconf-macro-local macro)
       (info "autoconf" (concat "*autconf*<" macro ">"))
       (Info-index macro))))

 (defun get-autoconf-macro-local (macro)
   "Look for the definition of the macro in aclocal.m4 before"
   (let
       ((local-macro-file "aclocal.m4"))
     (if (file-exists-p local-macro-file)
         (save-excursion
           (find-file local-macro-file)
           (search-forward (format "AC_DEFUN([%s])" macro)))
       nil)))

 (add-hook 'autoconf-mode-hook
           (lambda ()
             (local-set-key "\C-j" 'get-autoconf-macro-definition)))
--8<---------------cut here---------------end--------------->8---

What doesn't work yet is how to return false (and thus return to the previous state in case
the macro is not found anywhere.

And I should give an error message if I don't find the macro with Info-index as well, any idea?





--
Le

reply via email to

[Prev in Thread] Current Thread [Next in Thread]