[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing outline-minor-mode keybindings for texinfo files
From: |
Jean Louis |
Subject: |
Re: Changing outline-minor-mode keybindings for texinfo files |
Date: |
Fri, 14 May 2021 21:49:48 +0300 |
User-agent: |
Mutt/2.0.6 (2021-03-06) |
* Yuri Khan <yuri.v.khan@gmail.com> [2021-05-14 19:25]:
> 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.
Yes, I see by testing, it works with it as you say.
I was thinking this:
(setq a 1) ⇒ 1
(let ((b a))
(setq b 2)) ⇒ 2
a ⇒ 1
So while I understand it works, I don't know why it works.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/
- Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, Jean Louis, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, Jean Louis, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, Yuri Khan, 2021/05/14
- Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files,
Jean Louis <=
- Re: Changing outline-minor-mode keybindings for texinfo files, tomas, 2021/05/15
- Re: Changing outline-minor-mode keybindings for texinfo files, Yuri Khan, 2021/05/14
- Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, Yuri Khan, 2021/05/14
- Re: Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/15
- Re: Changing outline-minor-mode keybindings for texinfo files, Yuri Khan, 2021/05/15
- Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/15
- Re: Changing outline-minor-mode keybindings for texinfo files, Yuri Khan, 2021/05/15
- Re: Changing outline-minor-mode keybindings for texinfo files, michael-franzese, 2021/05/15
- Re: Changing outline-minor-mode keybindings for texinfo files, Yuri Khan, 2021/05/15