Closed tpeacock19 closed 1 year ago
Did you try STYLE
?
- optional STYLE: If the symbol 'none, no styling of any kind is
applied to headings. If otherwise non-nil, the stem and repeat
character parts of the heading both get identical stem-styling.
Can you provide a screen shot with modus (only) styling?
I did eventually use style. Though it only worked when I set it to (emacs-lisp-mode ";;" ?\; none)
. Though, I cannot tell you why it would not work when quoted.
I guess my request is more simply that outli-mode
has optional features (the fontification and/or speed keys) that are opt-in rather than opt-out. However, I understand that it's your package so you can be as opinionated as you want.
Additionally, it may be much simpler to leverage the faces included in outline-minor-mode
with (setq outline-minor-mode-highlight t)
.
How did you set it? If you set via customize an outer single quote is implicit.
I personally want style to match org headers so I don't have to think. And I like to have comments 'char face shine through in stem. Is the real issue that style='none was too hard to find in the docs?
If you set via customize an outer single quote is implicit.
I evaluated the form in the screenshots. The two examples are above. Whether I set with lisp directly or through customize, it does not seem to work. Does setting it to (emacs-lisp-mode ";;" ?\; none)
with setq
work for you?
I personally want style to match org headers so I don't have to think.
You could accomplish this with (custom-set-faces '(outline-1 ((t (:inherit org-level-1)))))
.
Is the real issue that style='none was too hard to find in the docs?
No, I just expected a global variable to control the styling, and when it did not work with setting the value to 'none
, I grew impatient and simply incorporated the outli-heading-config
/outline-heading-alist
logic to my personal config.
I evaluated the form in the screenshots.
It does not live update; perhaps you were evaluating in an open buffer, and didn't toggle outline-mode? I have added a note mentioning this.
I just expected a global variable to control the styling
I see. I will consider adding a global style disable for people in your situation.
It does not live update; perhaps you were evaluating in an open buffer, and didn't toggle outline-mode? I have added a note mentioning this.
No, I know how to toggle modes. I would like if you at least attempted to try setting it with lisp instead of customize. It happens with emacs -Q
as well. Thanks anyway.
@tpeacock19 you have two quotes on 'none,
an outer and inner. As a result, the symbol you are setting STYLE
to is 'none
, not (as expected) none
. Quoting rules in emacs can be confusing, but this is likely your problem. Also, screenshots are not very useful for evaluating snippets; consider wrapping them in ```elisp...```
for easier evaluation.
You asked for the screenshot. And the docstring says the symbol 'none
. But I don't use this package so no help is necessary.
OK, I have implemented two default
custom variables which, if non-nil, globally override the settings in outli-heading-config
. See outli-default-style
and outli-default-nobar
. Give a try.
Thanks for the quick fix, can confirm outli-default-nobar
is working.
@brongulus great! @tpeacock19 My only point is that screenshots are useful to see style, but not for evaluating code. There is definitely ambiguity in how to specify quoted symbols in emacs; I've changed the docs for now (but have seen people get confused in the past because of the missing '
, so we'll see). In general, I always assume symbols do not start with punctuation and haven't run into counter-examples.
The main issue is that quoting none in your outli-heading-config
defcustom is incorrect.
(choice :tag "Style"
(const :tag "No Styling" 'none)
(const :tag "Uniform Style" t)
(const :tag "Default Style" nil))
At least when testing it now, if I use customize to set the emacs-lisp-mode style to 'No Styling' it shows up as:
`((emacs-lisp-mode ";;" 59 'none nil)
(tex-mode "%%" 37 t nil)
(org-mode)
(t
(let*
((c
(or comment-start "#"))
(space
(unless
(eq
(aref c
(1-
(length c)))
32)
" ")))
(concat c space))
42 nil nil))
Which, will not result in disabling the styling, since you are comparing it to a standard 'none symbol in outli-fontify-headlines
with (eq style 'none)
. You don't do in the newer outli-default-style
so I imagine it was just a typo. Fixing that would help anyone using customize to try to disable styling.
‘(const VALUE)’ The value must be VALUE—nothing else is allowed.
The main use of ‘const’ is inside of ‘choice’. For example, ‘(choice integer (const nil))’ allows either an integer or ‘nil’. ‘:tag’ is often used with ‘const’, inside of ‘choice’. For example, (choice (const :tag "Yes" t) (const :tag "No" nil) (const :tag "Ask" foo)) describes a variable for which ‘t’ means yes, ‘nil’ means no, and ‘foo’ means “ask”.
The main issue is that quoting none in your outli-heading-config defcustom is incorrect
Aha, so defcustom was promoting 'none
afterall! Thanks very much, fixed.
I think it would be useful to allow for the fontification settings to be optional. I currently use
modus-themes
and themodus-themes-headings
variable is already applied to the outline-minor-mode facesoutline-{1-8}
, thus, I don't need the fontification options ofoutli
.In fact, I think the style options can be applied to these faces and you would not need to use your regexp-based function
outli-fontify-headlines