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: Level of headings not recognised Date: Sun, 11 Aug 2024 00:08:45 +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="21602"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 11 00:09:24 2024 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 1scuH5-0005US-UR for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 11 Aug 2024 00:09:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scuGc-0002in-8u; Sat, 10 Aug 2024 18:08:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scuGa-0002h4-F2 for help-gnu-emacs@gnu.org; Sat, 10 Aug 2024 18:08:52 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scuGY-0000V4-4b for help-gnu-emacs@gnu.org; Sat, 10 Aug 2024 18:08:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.com; s=s31663417; t=1723327725; x=1723932525; i=dimech@gmx.com; bh=ZMS+DtdcrKUiMIei0XJlzeI0Dj4zSoHNqkhBtxvf+8g=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Cc:Subject: Content-Type:Date:In-Reply-To:References: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=mLZmCGOPcIEfZnG8vVTUpPG+kavnNpVJJYh1GkPGUl5kEAFaE+InpBTmqyERYQab N/XocJY41ncOFp1EfJsg66ATEgnvWk0W4ml5v5tJuMM5XE/wI/DiFhiXP9vUMg2iL TNjMeLl4dkXoz+gu1tGZXWAfGryu2p/V0RqLMdmecmBB2VWoz4wzP/KhMxPwhZVJJ lhtbFCfWZWWEFUT0u0Ya7M1LOGEPwKzpiaJoLbEwveraAu7Zetm2ulQ60VeOsRxKf 6jWBCcqL4AFj/1bEZojRWMai/CRs+kojWi1wpEoUK0g1MSbtDfkwQ9/q2t8R52mM+ dhjzypyw4F8MLFsNZg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [92.251.79.197] ([92.251.79.197]) by web-mail.gmx.net (3c-app-mailcom-bs07.server.lan [172.19.170.175]) (via HTTP); Sun, 11 Aug 2024 00:08:45 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:PNbtm6+xGUMPngDkGi6Cd2WNIT9k7cWz11bi5Em/J9SdlFipPBDcJNBYhsoRN8kGtTi8w /bGRCghAVJWEV2FWXWujFr4JkNi4QjG6IQ3MAImB0/794LSVfmNR7ughsF3BOhddN9XICZ+LYPmt EmCkbxxJiLibtnBdN5ZUk/vP6xS4beP6XyiK0NcwdUEEOpkNeGQiHNgd8n2VY+fWIUXzTh7cA/mk Iwy4835Zmfjw4UM3m07Ey4Ez6uB7lg+y8T8LCAkbkYgasRZEITsOn9LScrmsDqEezTLEf4xzPa1G fg= UI-OutboundReport: notjunk:1;M01:P0:ZuH2sgcPMcY=;Bzw6MSemK+Qj6u6BH0IriwoFc+r k0uao0nvjbmwsdsbo/jHUuW/OKX8M9IfdemVDMmWOk46v1MDAe0dRqzlnVCPNNlFDEq90bf7r uuUznlvZCxlvktve0ZSEPNYdX8GHr+d5cww8R5l8k5xJ2qSkTy4aQn5sVf1vuMXK87l3V8NFk biHAkDD3sRcJYUovn7Vuc47tbPBVmbEmAbOejSe7de3q4YxhRxLTnU2z+RYS9olrcnr4VGFyj C+s7zM9Rd9oMO1zfddYo3L/3JcJlkgrNxjbw7DNNVFXlwCuqfceofqm0HNtIK+ZApv2P0ZlzN MBChHGJF3cd69zH2/aGhEfb/Gw4YMQK8qYat5TyDRCpv4Xws9Xso7ya73nL2RmzbPFpsGdw/p bzCnFGGpXx0K4SVVePBtAnZBBOHe508GUT9IJyshB+j5t6f2LEwPj8kGLM93kS73PR1hK6/Rn GGnbuRKh4QG0w05WmU3vF6v2kMtM0DdX4vISU52RHJ8szW14t18kxwOd77DDeaOiEKWEjecEg F28Byf0ZWARcP1Hp13uhM9wl2zfWZUb0rwpxes4emb/eJ/T8iO3VYr6LwNY+sDLriAhchQEef 5fxyFPUJdTTAJba23yMN5NU4zQRZEEgRLJDPPB8NR+UkyqZVYEgiSkJ3WwaNwtfI7yd3+qsak gE8JjXg+CoooorjPVrNq0XuHsPM3ubqdfikeArezbQ== Received-SPF: pass client-ip=212.227.15.15; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147595 Archived-At: > Sent: Sunday, August 11, 2024 at 8:30 AM > From: "Heime" > To: "Heime" > Cc: "Heime via Users list for the GNU Emacs text editor" > Subject: Re: Level of headings not recognised > > On Sunday, August 11th, 2024 at 5:49 AM, Heime wrote: > > > On Sunday, August 11th, 2024 at 3:07 AM, Heime heimeborgia@protonmail.= com wrote: > > > > > What is wrong in setting heading levels this way ? > > > > > > When I apply the following code, Level H1 is considered at same hier= archy as > > > other levels. This means that if I do "Hide Sublevels" headings at l= evels 2, > > > 3 etc still get displayed. > > > > > > (defvar mast-elisp-levels > > > '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4) > > > (";;; H5" . 5) (";;; H6" . 6) (";;; H7" . 7) (";;; H8" . 8) )) > > > > > > (defun mast-regexp () > > > > > > (let ( (hrklevels nil) ) > > > > > > (cond > > > ((memq major-mode '(emacs-lisp-mode lisp-interaction-mode)) > > > (setq hrklevels mast-elisp-levels))) > > > > > > (when hrklevels > > > (setq outline-regexp > > > (concat (regexp-opt (mapcar 'car hrklevels)) "\\>")) > > > > > > (setq outline-heading-alist hrklevels)) )) > > > > > > (defun mast-regexp-hooks (actm) > > > > > > (let ( (kmdalit '(emacs-lisp-mode-hook > > > lisp-interaction-mode-hook) ) > > > > > > (hook-fn (cond > > > ((eq actm 'add) #'add-hook) > > > ((eq actm 'remove) #'remove-hook) > > > (t (error "ACTM %s is invalid" actm)))) ) > > > > > > (dolist (mdhk kmdalit) > > > (funcall hook-fn mdhk #'mast-regexp)) )) > > > > > > Should one use setq, setq-local, steq-default. Cannot get headings to > > work from level 2 to 8 > > I am getting into extreme difficulty in setting outline-regexp. How sho= uld it be set ? Apply (setq-local outline-level 'outline-level) The setting ensures that the outline-minor-mode correctly recognizes and i= nterprets the hierarchical levels of headings when using custom regex patterns. The variable outline-level determines the depth of each heading in the out= line. By default, this is set to a function that calculates the level based on t= he number of leading asterisks (*) in a heading. When you define custom heading levels using outline-regexp and outline-hea= ding-alist, the mode needs to know how to calculate the outline levels correctly. setq-local sets the value of outline-level locally for the current buffer.= This is important because you want the custom level recognition to apply only in s= pecific modes (like emacs-lisp-mode) and not globally across all buffers. By setting outline-level locally, you ensure that outline-minor-mode uses = the correct function to calculate the levels based on your custom setup. If you don't= set outline-level locally, outline-minor-mode might fall back on its default b= ehavior, which expects levels to be calculated based on asterisks or other default = indicators.