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

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

Re: shell-script mode index


From: Ken Goldman
Subject: Re: shell-script mode index
Date: Thu, 26 Jun 2014 16:20:43 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 6/26/2014 1:05 PM, Drew Adams wrote:

`M-x imenu-add-menu-bar-index', then `M-x imenu'.

Thanks.  That worked.  I put this in .emacs:

(add-hook 'sh-mode-hook
          (function (lambda ()
                      (setq imenu-sort-function 'imenu--sort-by-name)
                      (setq imenu-max-items 40)
                      (imenu buffer-file-name)
                      (imenu-add-to-menubar "index")
                      )))

I now have this (and lots of other code repeated) for a few hooks. Is there a way to put this in some elisp code that says, 'Do this for any mode that supports it?"

When I tried to do it outside a hook, I got an error for fundamental-mode.





reply via email to

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