all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* outline-minor-mode: customizing outline-regexp?
@ 2018-01-12 22:10 John
  2018-01-13 14:05 ` Michael Heerdegen
       [not found] ` <mailman.7326.1515852317.27995.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: John @ 2018-01-12 22:10 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

Hello all!

I use outline-minor-mode in combination with the package outshine, but I'm 
having a problem with the `outline-regexp' variable.

The way I understand it, it's supposed to control the regexp for the 
outline headings. I want to change the regexp for css-mode, but no matter 
what I set it to, it appears to use the old syntax for headings, ignoring 
my changes.

This is my last, desperate attempt:

--8<---------------cut here---------------start------------->8---
(defun my/css-outline ()
  (interactive)
  (outline-minor-mode -1)
  (outline-minor-mode)
  (outshine-hook-function)
  (setq outline-regexp
        (rx "/**"
            (one-or-more (any "*"))
            " ")))
(add-hook 'css-mode-hook #'my/css-outline)
--8<---------------cut here---------------end--------------->8---

It successfully sets the `outline-regexp' variable, but outline-minor-
mode, or perhaps outshine, doesn't seem to respect it. I suspect there's 
something else I need to do.

Does anybody have experience with this? I'd be thankful for any help :-)

- John

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

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

* Re: outline-minor-mode: customizing outline-regexp?
  2018-01-12 22:10 outline-minor-mode: customizing outline-regexp? John
@ 2018-01-13 14:05 ` Michael Heerdegen
       [not found] ` <mailman.7326.1515852317.27995.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2018-01-13 14:05 UTC (permalink / raw)
  To: John; +Cc: help-gnu-emacs

John <john@ankarstrom.se> writes:

> This is my last, desperate attempt:
>
> (defun my/css-outline ()
>   (interactive)
>   (outline-minor-mode -1)
>   (outline-minor-mode)
>   (outshine-hook-function)
>   (setq outline-regexp
>         (rx "/**"
>             (one-or-more (any "*"))
>             " ")))
> (add-hook 'css-mode-hook #'my/css-outline)
>
> It successfully sets the `outline-regexp' variable, but outline-minor-
> mode, or perhaps outshine, doesn't seem to respect it. I suspect there's 
> something else I need to do.

Looking at the code (I don't use outshine) it seems that outshine sets
`outline-regexp' itself, so I guess it overwrites your setting.  I guess
you need to configure outshine's variables instead.


Michael.



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

* Re: outline-minor-mode: customizing outline-regexp?
       [not found] ` <mailman.7326.1515852317.27995.help-gnu-emacs@gnu.org>
@ 2018-01-13 14:22   ` John
  0 siblings, 0 replies; 3+ messages in thread
From: John @ 2018-01-13 14:22 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

Michael Heerdegen wrote:

> Looking at the code (I don't use outshine) it seems that outshine sets
> `outline-regexp' itself, so I guess it overwrites your setting.  I guess
> you need to configure outshine's variables instead.

You inspired me to take a look at the source as well, and I found the 
pretty much undocumented `comment-padding' variable used by outshine.

The default behavior is to require at least one space of padding, but 
(setq comment-padding "") changes that and achieves what I wanted to do.

Thanks!

> Michael.

- John

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

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

end of thread, other threads:[~2018-01-13 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 22:10 outline-minor-mode: customizing outline-regexp? John
2018-01-13 14:05 ` Michael Heerdegen
     [not found] ` <mailman.7326.1515852317.27995.help-gnu-emacs@gnu.org>
2018-01-13 14:22   ` John

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.