all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Andreas Matthias <andreas.matthias@gmail.com>
Cc: 74156@debbugs.gnu.org
Subject: bug#74156: 29.4; Incorrect face with outline-minor-mode-highlight in lisp-mode
Date: Sat, 02 Nov 2024 19:14:02 +0200	[thread overview]
Message-ID: <865xp5o8x1.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAHp59H27pEzcF2fuJpREm2u-6vysmUWMR=mP4Q=2m5ZCAXbKJA@mail.gmail.com> (Andreas Matthias's message of "Fri, 1 Nov 2024 14:11:54 +0100")

> Take this example Elisp file:
>
> ;;; xxx -- OK: face is outline-1
> ;;;; xxx -- OK: face is outline-2
> (defun test ()) ; WRONG: face is outline-8
>
> ;; Local Variables:
> ;; outline-minor-mode-highlight: override
> ;; eval: (outline-minor-mode 1)
> ;; End:
>
> After loading this file into Emacs you will see that the function
> definition
> is displayed incorrectly in face outline-8.
>
> I guess this is due to the definition of outline-regexp in lisp-mode.el:
>
> ";;;;* [^ \t\n]\\|(\\|\\(^;;;###\\(\\([-[:alnum:]]+?\\)-\\)?\\
> (autoload\\)\\)"
>
> Notice the opening parenthesis in the regular expression that causes
> the function definition to be recognized as an outline heading.
>
> I removed the opening parenthesis and now the face of the function
> definition
> is correct. This is fine for me. But note that you loose the ability to
> move
> to top-level expressions, like this function definition, with
> (outline-next-visible-heading) and (outline-previous-visible-heading).

Isn't the face 'outline-8' because 'lisp-outline-level' returns
the level 1000 for the opening parenthesis in 'lisp-outline-level':

  (defun lisp-outline-level ()
    (let ((len (- (match-end 0) (match-beginning 0))))
      (cond ((or (looking-at-p "(")
                 (looking-at-p lisp-mode-autoload-regexp))
             1000)

The level 1000 corresponds to outline-8:

Level    1 - outline-1
Level    2 - outline-2
Level    3 - outline-3
Level    4 - outline-4
Level    5 - outline-5
Level    6 - outline-6
Level    7 - outline-7
Level    8 - outline-8
Level    9 - outline-1
Level   10 - outline-2
Level   11 - outline-3
...
Level  998 - outline-6
Level  999 - outline-7
Level 1000 - outline-8





  reply	other threads:[~2024-11-02 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-01 13:11 bug#74156: 29.4; Incorrect face with outline-minor-mode-highlight in lisp-mode Andreas Matthias
2024-11-02 17:14 ` Juri Linkov [this message]
2024-11-02 23:40   ` Andreas Matthias
2024-11-03 17:54     ` Juri Linkov
2024-11-03 18:25       ` Andreas Matthias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=865xp5o8x1.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=74156@debbugs.gnu.org \
    --cc=andreas.matthias@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.