From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: michael-franzese@gmx.com Newsgroups: gmane.emacs.help Subject: Changing outline-minor-mode keybindings for texinfo files Date: Fri, 14 May 2021 18:36:08 +0200 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="31375"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs , Jean Louis To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 19:22:52 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 1lhbWV-0007sm-DV for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 19:22:51 +0200 Original-Received: from localhost ([::1]:57020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhbWU-0006CQ-A6 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 13:22:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhanq-0006Y2-VP for help-gnu-emacs@gnu.org; Fri, 14 May 2021 12:36:43 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:44777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhano-0002dj-TT for help-gnu-emacs@gnu.org; Fri, 14 May 2021 12:36:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621010168; bh=OWXEDQe8fUuIkHAbbgsPDOqYLXlgN8ueXacP9zVtYok=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=hKsdCrO7Nl0kjdSXoKl6OsLW+nQ8zStYnhgKHVA7Hw6h5aTCNGP8B2/Va1L7n1mZn NuLwBF3/Yu4N8EiAOPYd8mxkX791sAOPSjLs64a7YEbVwUKJHFP+6bIpLf6WKUYyj6 oZ8OBB+n7qzhop1gpQ1kkhSC70Ev5PMTtiWV3w9Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs04.server.lan [172.19.170.170]) (via HTTP); Fri, 14 May 2021 18:36:08 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:VECoo8lw4VaVKEtebN/xzt0EZddjwm9hp2eAJHx1BHqq08lcaI8QcjprR1/fHiOjqS+g8 XMeVBw/0NwAHYbhJ4Ct1LqUxIuTniGN+PgfaNmdx3C65/HrwucU29qceLTJm+a/j9C5u+0vUTUpA 5tihIGyP5lh/OJApuLLdAXtFfV3mEHrXqPd9lFPMmqiCA910H1q6uYB3vIO0kMwAXkXkhzKmMOA5 rYzBouAVjlYnL93mQFtl/CSpxTZ6lQIlc6xTqBw6xId3WBuDdGNHI8Rod9oIVeTrpyyJwlwIxh5L OE= X-UI-Out-Filterresults: notjunk:1;V03:K0:5T+EUkRdFj8=:6Bh2m+RWEaqWr3WtfSBdJy WTA1xfQU6hU/FCMMsKL6M1XILsaXvRqA7JCnNhhvl5pCfYqExyb3NzL8bX27qBb/LS7RwiavG exMhccJDRqW7D1rHDQAZU2KcNzSYJHqrZCr6LqcZIRzY2PDtZX5SqLGwGOCDe0KyG2MaKn68+ Pz7o0nEUaGkaX4sE4nX5mDqSksF1ja6rIJFXU1Kmg39GEuyfNCg61FRwgc/0c8V6XYZvdndnD nZcUE5wv37LXA2eJ1AZINpCLpo09Jk3JN5Rc8B/LEPCSpme5PvolMmJUYrJZI6ix3M68aqj7n bHpTXY7xyoPbQh4LBnh0jdcXVGtsFEWzO1XP1Tm2Zp/SxhIEToSXEIT3JFNCE1q0IxpUw5e9X kBawe+JBEy6DMnn+Ds9i2g28KOatJm0HbK05E4wOTKt2VtuDWUcitvLEOVqhbYJ31l25zcr4X VgZH//C4bnzakzh5MBm7Ol1qzTwnBsVbq8/98U07GQfE2Pr4KRiUQjPuTAFxgSZYxB2dZwqi3 A5Gba1mPJRok7grzhNcXZsJ4QVKEenvxrhoTM5w4wsRPSmMONY/yn0pGenbRjoh1vGqES+DTF vV/LZ9TEtbtUs0LzuaFkOrgpF55apJK4+X0j5jTH4Eucr3xWcj0rVROHPAZ4/U08yTFbY0G0M npqCxPoiDM3wcCcXr54AlNPv65SWQPW45MHoF4cd/c8HSG3slirgBfmas7B1/2hYPgk38q3SD pxcF/JeETfFA3rEIRfgYtu0NRwvpBlkY+5FwZ31WB/ky+BQ/cx6AosgkaD0sZ5OimEjd5jck Received-SPF: pass client-ip=212.227.15.19; envelope-from=michael-franzese@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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:129777 Archived-At: > Sent: Saturday, May 15, 2021 at 4:20 AM > From: "Yuri Khan" > To: michael-franzese@gmx=2Ecom > Cc: "Help Gnu Emacs" , "Jean Louis" > Subject: Re: Changing outline-minor-mode keybindings for texinfo files > > On Fri, 14 May 2021 at 20:33, wrote: >=20 > > Have wade to following adaptation which seems to work=2E Still I woul= d value > > comments and points of view=2E > > > > (defun vmove-keytrigger () > > "Visualises outline and moves texinfo code=2E" >=20 > This docstring is inaccurate, and uses the wrong grammatical form=2E > (Docstrings, by convention, use the imperative form=2E) Better: >=20 > "Set up keys for use in texinfo-mode=2E" >=20 > > (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) )) >=20 > The let binding is redundant, you could call =E2=80=98define-key=E2=80= =99 directly on > =E2=80=98texinfo-mode-map=E2=80=99: >=20 > (defun vmove-keytrigger () > "Set up keys for use in texinfo-mode=2E" > (define-key texinfo-mode-map (kbd "H-q") #'outline-hide-sublevels) > (define-key texinfo-mode-map (kbd "H-b") #'outline-hide-body) > (define-key texinfo-mode-map (kbd "H-") #'outline-move-subtree-up= ) > (define-key texinfo-mode-map (kbd "H-") #'outline-move-subtree-= down) )) >=20 >=20 > > (add-hook 'texinfo-mode-hook 'vmove-keytrigger) >=20 > This too is excessive=2E You redefine these keys each time you open a > new buffer in texinfo mode, but it is sufficient to define them once > during an Emacs session=2E You cannot just put (define-key > texinfo-mode-map =E2=80=A6) in your init file because the variable > =E2=80=98texinfo-mode-map=E2=80=99 is probably not defined at the time o= f > initialization, but you can defer that to the time when =E2=80=98texinfo= =E2=80=99 is > loaded: >=20 > (with-eval-after-load 'texinfo > (define-key texinfo-mode-map (kbd "H-q") #'outline-hide-sublevels) > (define-key texinfo-mode-map (kbd "H-b") #'outline-hide-body) > (define-key texinfo-mode-map (kbd "H-") #'outline-move-subtree-up) > (define-key texinfo-mode-map (kbd "H-") #'outline-move-subtree-d= own)) >=20 >=20 > (Note that =E2=80=98with-eval-after-load=E2=80=99 is a relatively new ma= cro; on older > Emacs versions, you might have to use =E2=80=98eval-after-load=E2=80=99 = which is > slightly less easy to use=2E) Would your comments also mean that I remove the add-hook (add-hook 'texinfo-mode-hook 'vmove-keytrigger)