unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 1275dc4: Improve fontifying of #| ... |# in `lisp-mode'
       [not found] ` <20210129064016.B950120B72@vcs0.savannah.gnu.org>
@ 2021-01-29 13:50   ` Stefan Monnier
  2021-01-30  6:07     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2021-01-29 13:50 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

> --- a/lisp/emacs-lisp/lisp-mode.el
> +++ b/lisp/emacs-lisp/lisp-mode.el
> @@ -775,6 +775,7 @@ or to switch back to an existing one."
>    (setq-local find-tag-default-function 'lisp-find-tag-default)
>    (setq-local comment-start-skip
>  	      "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
> +  (setq-local comment-end "|#")
>    (setq imenu-case-fold-search t))
>  
>  (defun lisp-find-tag-default ()

I think you meant to set `comment-end-skip` instead (and to a slightly
different value): the above change makes `M-;` insert `;;  |#` with
point in the middle.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 1275dc4: Improve fontifying of #| ... |# in `lisp-mode'
  2021-01-29 13:50   ` master 1275dc4: Improve fontifying of #| ... |# in `lisp-mode' Stefan Monnier
@ 2021-01-30  6:07     ` Lars Ingebrigtsen
  2021-01-30 14:41       ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-30  6:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +  (setq-local comment-end "|#")
>>    (setq imenu-case-fold-search t))
>>  
>>  (defun lisp-find-tag-default ()
>
> I think you meant to set `comment-end-skip` instead (and to a slightly
> different value): the above change makes `M-;` insert `;;  |#` with
> point in the middle.

Yup.  But what would that `comment-end-skip' value be?  I tried some
obvious variations, and none of them made the final |# bit be coloured
as anything but a comment.

(This part of Emacs is somewhat under-documented -- `comment-end-skip'
isn't even documented in the manual...)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 1275dc4: Improve fontifying of #| ... |# in `lisp-mode'
  2021-01-30  6:07     ` Lars Ingebrigtsen
@ 2021-01-30 14:41       ` Stefan Monnier
  2021-01-31  7:01         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2021-01-30 14:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

> Yup.  But what would that `comment-end-skip' value be?

IIRC it should be something like

    "[ \t]*\\(\n\\||#)"

But I know nothing about the ad-hoc font-lock trick that tries to
color it differently from the rest of the comment.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 1275dc4: Improve fontifying of #| ... |# in `lisp-mode'
  2021-01-30 14:41       ` Stefan Monnier
@ 2021-01-31  7:01         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-31  7:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Yup.  But what would that `comment-end-skip' value be?
>
> IIRC it should be something like
>
>     "[ \t]*\\(\n\\||#)"
>
> But I know nothing about the ad-hoc font-lock trick that tries to
> color it differently from the rest of the comment.

Oh, I thought I was doing something wrong, because that's what I
expected the effect to be.  :-/  #| ... |# is fontified just fine as a
comment, but only the leading delimiter is fontified as a delimiter.

So I've reverted the change and reopened the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-31  7:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210129064015.14890.68102@vcs0.savannah.gnu.org>
     [not found] ` <20210129064016.B950120B72@vcs0.savannah.gnu.org>
2021-01-29 13:50   ` master 1275dc4: Improve fontifying of #| ... |# in `lisp-mode' Stefan Monnier
2021-01-30  6:07     ` Lars Ingebrigtsen
2021-01-30 14:41       ` Stefan Monnier
2021-01-31  7:01         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).