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: Fri, 14 May 2021 18:19:04 +0200


> Sent: Saturday, May 15, 2021 at 4:00 AM
> From: "Yuri Khan" <yuri.v.khan@gmail.com>
> To: michael-franzese@gmx.com, "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: Changing outline-minor-mode keybindings for texinfo files
>
> On Fri, 14 May 2021 at 21:06, Jean Louis <bugs@gnu.support> wrote:
> 
> > > (defun vmove-keytrigger ()
> > >    "Visualises outline and moves texinfo code."
> > >
> > >    (let ( (map texinfo-mode-map) )
> > >      (define-key map (kbd "H-q") #'outline-hide-sublevels)
> > >      (define-key map (kbd "H-b") #'outline-hide-body)
> > >      (define-key map (kbd "H-<up>") #'outline-move-subtree-up)
> > >      (define-key map (kbd "H-<down>") #'outline-move-subtree-down) ))
> > >
> > > (add-hook 'texinfo-mode-hook 'vmove-keytrigger)
> >
> > In my opinion that hook, when it runs, internally get that all
> > defined, but once function finishes, nothing yields out of it, because
> > it is within `let' enclosure and because you are working on a
> > temporary variable `map'.
> 
> No, because ‘map’ is a reference to the same object that
> ‘texinfo-mode-map’ refers to. Within the functions, they are two names
> of the same data structure. Changes made through one name within the
> function are then visible through the other name after the function
> returns.

So it is good?



reply via email to

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