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: Setting up user defined texinfo headlines using outline-heading-alist Date: Thu, 13 May 2021 20:26:58 +0700 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="9601"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 13 15:27:38 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 1lhBNK-0002Jh-OP for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 15:27:38 +0200 Original-Received: from localhost ([::1]:41538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhBND-0007Ao-Rw for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 09:27:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhBMu-0007AM-BP for help-gnu-emacs@gnu.org; Thu, 13 May 2021 09:27:12 -0400 Original-Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]:46636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhBMs-0006pc-N5 for help-gnu-emacs@gnu.org; Thu, 13 May 2021 09:27:12 -0400 Original-Received: by mail-vs1-xe2a.google.com with SMTP id t6so11159307vsp.13 for ; Thu, 13 May 2021 06:27:10 -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 :cc:content-transfer-encoding; bh=u0/AmUpnWgiSpn5BizxXvSq9bh8Z3s3HqnW89ACEyGo=; b=JdF2Ccc/KnBX1MF+J+QYZ0l7QnXoSJHT3fHLvE+Ujci330530YjsetEVS4z31mHPmB 4n94fZbKch3jCsNHld4GBBRpl+Z01ll9JoyqtubAQLFGikTT+2v8bgMzbxjpqQu+Ujz5 bme1pX1+R9kdx7KbJ5ZzYrF1/UFwzwbLsY6O4JiTTz5bar6oqOXIm/zuquGzHxcS7Brd qc1p8kegGnWbcHbVJQ9tXWr51YzJxXYHaCKrMtmhusW/QryjoibySst7AFsmuE672wIG AIwzfPQhmiaAIqtPCNidKP713qju0NGwneZhSWhn2+ERuGEnOrVgL8GMy6QgQ0b06Alr cxpA== 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:cc:content-transfer-encoding; bh=u0/AmUpnWgiSpn5BizxXvSq9bh8Z3s3HqnW89ACEyGo=; b=oN6ibLPfa+XaTbzM7UEY3//2bWLKO7rd1b8Ytx6IKceKnLdA3kOlluhp1kFdtiP/qi 5FCJt/PGnC5kPyUOwYnlcMHDI03RtfcVWB83q5EQEtXv2UpBo4rmW7pxWrtcQ7NulTKR mu89MD+fqn7sxNethM+7gNyzuW+5tHvKb0gRru5V1Lbs1LNMYup93DtZ5X2+3eEhjpbq VtTesJ0S2GR/v/jJwpUIGWYYWUUwqt2Rxd+UGSw2tO613QtRqjlEfM3V8LwTjalnyWes GX4RgAUL+CRvhod8q/nWd7+EMdiEj0LfPmvrPsO0vRi0saQ1HYF57QYPxN0hnjJ/0dVQ 9cpw== X-Gm-Message-State: AOAM532O6WIbWBaqXvR3XNjLg2PGCX0A+OR0mh3BoTS1RSLMJUArgwdi NE9yTK8sB1GNsL5zQ7HvS0Ro5Ii0OOapOrziZkc= X-Google-Smtp-Source: ABdhPJzB+6QMTcnjiQRhhThfhO93oDiT2Xj1HI4P8eoy90KB6c19uu0ctJbdW4ph7eEjTdzVXhupZa+zh8uaT2+wSdw= X-Received: by 2002:a67:c283:: with SMTP id k3mr38047301vsj.12.1620912429762; Thu, 13 May 2021 06:27:09 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2a; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe2a.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:129749 Archived-At: On Thu, 13 May 2021 at 19:46, Christopher Dimech wrote: [=E2=80=A6] Ha! Much better. > Have modified my init file with the following code that resets "outline-h= eading-alist" > to include @usec, @usebsec as headings in addition to @unnumbered > > (defvar texinfo-hdlevels [=E2=80=A6]) > > (setq-local outline-heading-alist texinfo-hdlevels) If that=E2=80=99s all that you have in your init file, then the setq-local acts on the wrong buffer. It sets the local value of the variable =E2=80=98outline-heading-alist=E2=80=99 in whichever buffer that is current= at the time your init file is executed, maybe *scratch* or something. But you actually want it to act on the buffer that visits your test.texi file. To that end, put that setq-local in a hook that runs when you visit a .texi file: (defun my-texinfo-outline () (setq-local outline-heading-alist texinfo-hdlevels)) (add-hook 'texinfo-mode-hook #'my-texinfo-outline) 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.