[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: which-function => DEFUN?
From: |
Juanma Barranquero |
Subject: |
Re: which-function => DEFUN? |
Date: |
Mon, 10 May 2010 16:22:30 +0200 |
On Mon, May 10, 2010 at 15:58, Lennart Borgman
<address@hidden> wrote:
> It is a bit annoying to see DEFUN as the function shown by
> which-function-mode.
>
> I am sure someone here has written an
> imenu-extract-index-name-function for use in Emacs C sources... ;-)
(defun which-func-identify-DEFUN ()
(save-excursion
(save-match-data
(beginning-of-defun)
(and (looking-at "DEFUN +(\"[^\"]+\",[ \n]+\\(F[^,]+\\),")
(match-string-no-properties 1)))))
Likely the `save-match-data' is not required, but I tend to err on the
side of saving it on my code.
> Where is it? How do you set it up?
(add-hook 'which-func-functions 'which-func-identify-DEFUN nil t)
on the required buffers (I set it through `c-mode-hook').
Juanma
- which-function => DEFUN?, Lennart Borgman, 2010/05/10
- Re: which-function => DEFUN?,
Juanma Barranquero <=
- Re: which-function => DEFUN?, Stefan Monnier, 2010/05/10
- Re: which-function => DEFUN?, Juanma Barranquero, 2010/05/10
- Global match data considered harmful, Stephen J. Turnbull, 2010/05/10
- Re: Global match data considered harmful, Stefan Monnier, 2010/05/11