From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Changing outline-minor-mode keybindings for texinfo files Date: Fri, 14 May 2021 23:00:14 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23115"; mail-complaints-to="usenet@ciao.gmane.io" To: michael-franzese@gmx.com, Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 18:25:42 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhadC-0005jh-76 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 18:25:42 +0200 Original-Received: from localhost ([::1]:39464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhadB-0007Oi-96 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 12:25:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhaEp-0000YI-Hm for help-gnu-emacs@gnu.org; Fri, 14 May 2021 12:00:33 -0400 Original-Received: from mail-vs1-xe33.google.com ([2607:f8b0:4864:20::e33]:42653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhaEl-0003gw-0t for help-gnu-emacs@gnu.org; Fri, 14 May 2021 12:00:31 -0400 Original-Received: by mail-vs1-xe33.google.com with SMTP id 66so15495661vsk.9 for ; Fri, 14 May 2021 09:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=JYGrnA5JFb62iZ11TBzHh+oNx0V2pG+sU28jTpe9fWA=; b=VGF787xK4GpYqPK0ZBASlIn4WRGVSsLWKcWPP6PGf/645t3ZgFKKxvoBIFzvR00Ur2 u78bNN8pc2GsjRCPd3y2GUOEyQEAl1RHzou0LW2aUOk1bE3VuTlpwqVv23qjBhaWQJu3 MV6AfWQ6/xSMpbdrIHnBarjSuGz+TbAOFTB6wnQ+cJOFbEbEL5A039raKfutVEYctZn6 wKgs2SStDGkuJFl/kzjbpLajUdO14rOJTDjDiaZz6xkknU9aa4sxIN8NZPikw+9BfJ5d RHNED9O6GZtvmxCJTU7JlwrB5d1lYn/A60bn9NA8duJn6Y2CQCiVqfZE4hhYeS+swYJc H0BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=JYGrnA5JFb62iZ11TBzHh+oNx0V2pG+sU28jTpe9fWA=; b=Z5uDgzrYlq+mtOiYJ60y6AfFGUEqAdeFa9tLyUZyIDiJ8yvnhF9EZWeVRQUAxBnN8W y8rYIaRBpkE3oYURSvgX6bBvu2XR/D87dDfyI6QYj7xvmAsmotNi41hgsL3qNQe1X4tI cAK/V9R3eBfstrf1pE8rQkQ3BGDQiaKTmT9MQLKQUE9rmUostFVPDKAu1dz/Kd3QjXhF AkZBxn9VfsA2hdqcVOiblPV6LkKiOTcNUgrHs1IX4JHzd5ikxpOv1//ZQlRnmGnEX1zg M5l8NWf+Ewvh/WrVkMLpF46zWG/3pHJYg7WJCHjs+yQ7hcRxaHXP6SUN0jc/zTzUUPwv wz8w== X-Gm-Message-State: AOAM530idP7MTXoHpUePD3YjXA1wZbVJdTflcV7Aa7ug2RkCOmrefjH1 MzNeXp16xIDYgt6xqRopjBtMHh0ndypP/Cob6ME= X-Google-Smtp-Source: ABdhPJx9KQ5rbkJpAwNFB+uYUbkscyj9+I1Yhf28cYBKjRD3C4uLaKnXUj50R0euKC/Y2+epVBIfWMAuMoOgl3el3b0= X-Received: by 2002:a67:1087:: with SMTP id 129mr494776vsq.42.1621008026052; Fri, 14 May 2021 09:00:26 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e33; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129773 Archived-At: On Fri, 14 May 2021 at 21:06, Jean Louis 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-") #'outline-move-subtree-up) > > (define-key map (kbd "H-") #'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 =E2=80=98map=E2=80=99 is a reference to the same object that =E2=80=98texinfo-mode-map=E2=80=99 refers to. Within the functions, they ar= e 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.