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

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

Changing outline-minor-mode keybindings for texinfo files


From: michael-franzese
Subject: Changing outline-minor-mode keybindings for texinfo files
Date: Sat, 15 May 2021 08:07:06 +0200


> Sent: Saturday, May 15, 2021 at 5:58 PM
> From: "Yuri Khan" <yuri.v.khan@gmail.com>
> To: michael-franzese@gmx.com
> Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>, "Jean Louis" <bugs@gnu.support>
> Subject: Re: Changing outline-minor-mode keybindings for texinfo files
>
> On Sat, 15 May 2021 at 12:25, <michael-franzese@gmx.com> wrote:
>
> > I would need some implementation examples about how the function can be
> > invoked as you describe.
> >
> > Currently I got the following
> >
> > (defun show-keytrigger ()
> >    (with-eval-after-load 'texinfo
> >       (define-key texinfo-mode-map
> >          (kbd "H-s") #'outline-show-subtree) ))
> >
> > (add-hook 'texinfo-mode-hook 'show-keytrigger)
>
> Again, you are using a hook that runs in each new texinfo-mode buffer,
> but it is sufficient to define a key once per session. You can replace
> the above with just this:
>
>     (with-eval-after-load 'texinfo
>       (define-key texinfo-mode-map
>                   (kbd "H-s") #'outline-show-subtree))

My difficulty is to have a function that defines some keybindings, so I can 
easily
switch them off by commenting the function call.

So the difficulty is how to call the function after texinfo has loaded.  Is 
there
some condition to check?  My code automatically assign the major made because I 
use
auto-mode-alist at the beginning of my init file.

   (add-to-list 'auto-mode-alist '("\\.texi\\'" . texinfo-mode))





reply via email to

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