From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Setting up user defined texinfo headlines using outline-heading-alist Date: Thu, 13 May 2021 17:10:14 +0200 Message-ID: References: <878s4m5mbj.fsf@posteo.net> 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="15787"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 13 17:12:02 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 1lhD0M-00040F-5D for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 17:12:02 +0200 Original-Received: from localhost ([::1]:50790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhD0L-0000VT-3Q for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 11:12:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhCyl-0000S3-Om for help-gnu-emacs@gnu.org; Thu, 13 May 2021 11:10:23 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:44463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhCyg-0006D6-CB for help-gnu-emacs@gnu.org; Thu, 13 May 2021 11:10:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620918614; bh=cXs3ReqvTXwGSGRsZKgLAi+QGqEAXEgsJ9NsgsaXBkk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=AanTz3niw2Ph4w2PQ07LyxZy0cC8vDniTBSRer8tI4RAuCyS0cOV7nSS2mnetMNix cVn9yEien+Fp4+V3IHiGcpffilaN+TxF6DQfaWIDETGZ/HYBX/LvvJP6FuxhfOa8Pe 9SrpZ3lsds6LBfUhtcAVTX+fQdqk/8We5DslfZzA= 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-bs03.server.lan [172.19.170.169]) (via HTTP); Thu, 13 May 2021 17:10:14 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:SDFol2ZugOsFLsrzVNDzWBTtG9Ie84jZ72VhjI/icdN33uBOnha4KevL9e5iAm3aZDj1D Iea7TXD5HF50hwnXYSpgwlFPshMtD1QuuDYTVvLidRR3WmmzJB52vTeHCgyFxbJh7Uu4lMCC7d12 fdOsrlxa9qkzVbrgVK0/AqBZ+Q+aOVzTTDsIuGH2XhlU7qM90U5iUI0eUCsLNJiCQ5n5iAXSB3ko 6eR2X9iXQlrIj7Ph700HsHc5kDBVNwdMMZlarAZH38sUsnamwWEm3iO8aiavagwts6rSeROY+PP7 LY= X-UI-Out-Filterresults: notjunk:1;V03:K0:nvLAGZqtHpg=:M8/MEkgHwAUeBFGoWytJl0 Dj+s6Q13oPResrK+Vco73YEyy6lSbgrDeIyhqgZPFhP0oLy9pr4cUGhrECepFHPXAFinwa1Rg /rRuO7z9zO4DXKfNUNyeQVp1zYivo/rsn9Y53ezCslL5EouNBQOT5wwpfYs2lXTb4uQj9PCt1 XpqiD22TqXHdkAtxXZlUKXohagdSFNQ0/6VXXKGM6vjEgmNV7HnqvOIs7wecHnLXJY4xmfPXO Xj3yUkUNuwuSGlMo1c0uqqfuUKtseBzFsKvu38PrLZ4n9/1qdXRVUK8+iQ/XbC1TBoNuq9qNH XLcleFxF2FvDVa1z7Fqxl472dmBX82coTA+jRvJihfHvxU7AroouRZRo0BTmVlC40XxcAJ2Ce DTiWCJ1ZXTY+Fq7hljehSfZ402Wixwyq+zSkZCUoc9cKkjl23mmtt+2gs4T91erEjWCTfSa/c /JZzuWQ9+Gql94UddALFRApHctn9zWGXkke3QkHQ1UJlr6/6i4ZEektgg1FZNBDqOdhf/7wro KUVBSXpygHUZPheZ2X1P9Ma3Y1MhyFxcZyk4M/eTmmNXXxzFnNsfQNq7IUslS0z+IJX9A3q64 OccoSK2B8h8PuCg6EPJchYglXu5Mal/ESPpmqQxLeudFKKoSPQhPL84modJKctsGFeJ2R5/2C ONMoeTcPWJr5C73PMvb2NCKBLXyjix0OigaftRWUjdPHLRrJzZ9AaNGLhqHTvgiEVNifWUCWS tvl95ZTjKwMAg9M4DrzsbmHvoPGxEYc9H4Cs6Hr+CJybxr0FOYqdZea5zJFQTMssjxe/YLxV Received-SPF: pass client-ip=212.227.17.21; envelope-from=dimech@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:129750 Archived-At: I have followed your suggestion of using a function that sets outline-headi= ng-alist using texinfo-mode-hook=2E=20 Have included the following setup (see code section), yet I am still getti= ng=20 @node uchapter-amcoh @unnumbered 6 @ Ameliorating Waveform Coherency=2E=2E=2E whenever I hit "C-C @ C-t" (Hide Body)=2E Should I not get @usec and @us= ubsec showing up as well? -------- code -------- (defvar texinfo-hdlevels '( ("@chapter" =2E 2) ("@section" =2E 3) ("@subsection" =2E 4) ("@subsubsection" =2E 5) ;; -------------------------------------------------- ("@unnumbered" =2E 2) ("@unnumberedsec" =2E 3) ("@unnumberedsubsec" =2E 4) ("@unnumberedsubsubsec" =2E 5) ;; -------------------------------------------------- ("@appendix" =2E 2) ("@appendixsec" =2E 3) ("@appendixsubsec" =2E 4) ("@appendixsubsubsec" =2E 5) ;; -------------------------------------------------- ("@majorheading" 2) ;; -------------------------------------------------- ("@chapheading" 2) ("@heading" 3) ("@subheading" 4) ("@subsubheading" 5) ;; -------------------------------------------------- ("@uchap" =2E 2) ("@usec" =2E 2) ("@usubsec" =2E 3) ("@usubsubsec" =2E 4) )) (defun instate-texinfo-hdlevels () (setq-local outline-heading-alist texinfo-hdlevels)) (defun texinfo-hdlevels-hook () "todo" (add-hook 'texinfo-mode-hook #'instate-texinfo-hdlevels)) (defun outline-hooks () "todo" (add-hook 'emacs-lisp-mode-hook #'outline-minor-mode) (add-hook 'texinfo-mode-hook #'outline-minor-mode) ) (outline-hooks) (texinfo-hdlevels-hook) Regards Christopher > Sent: Friday, May 14, 2021 at 1:26 AM > From: "Yuri Khan" > To: "Christopher Dimech" > Cc: "Help Gnu Emacs" > Subject: Re: Setting up user defined texinfo headlines using outline-hea= ding-alist > > On Thu, 13 May 2021 at 19:46, Christopher Dimech wrot= e: >=20 > [=E2=80=A6] >=20 > Ha! Much better=2E >=20 > > Have modified my init file with the following code that resets "outlin= e-heading-alist" > > to include @usec, @usebsec as headings in addition to @unnumbered > > > > (defvar texinfo-hdlevels [=E2=80=A6]) > > > > (setq-local outline-heading-alist texinfo-hdlevels) >=20 > If that=E2=80=99s all that you have in your init file, then the setq-loc= al > acts on the wrong buffer=2E It sets the local value of the variable > =E2=80=98outline-heading-alist=E2=80=99 in whichever buffer that is curr= ent at the > time your init file is executed, maybe *scratch* or something=2E But you > actually want it to act on the buffer that visits your test=2Etexi file= =2E >=20 > To that end, put that setq-local in a hook that runs when you visit a > =2Etexi file: >=20 > (defun my-texinfo-outline () > (setq-local outline-heading-alist texinfo-hdlevels)) >=20 > (add-hook 'texinfo-mode-hook #'my-texinfo-outline) >=20 > This is a recurring pattern in Emacs configuration: If you have a > general facility that works in various buffers regardless of their > major mode, and you want it to behave differently depending on the > major mode, you put configuration in a hook that is run by that major > mode=2E >=20 >