* Why does quote and verse block fontification have to override local fontification?
@ 2017-02-22 9:51 Anders Johansson
2017-02-22 10:51 ` Nicolas Goaziou
2017-02-22 12:18 ` [PATCH 1/1] org.el: Make faces org-quote and org-verse be appended Anders Johansson
0 siblings, 2 replies; 4+ messages in thread
From: Anders Johansson @ 2017-02-22 9:51 UTC (permalink / raw)
To: emacs-orgmode
Hi,
I want to fontify quote blocks (i use them a lot for note taking
and writing paper) so that they stand out (and so I enable
org-fontify-quote-and-verse-blocks) but it would be useful to
preserve the local fontification of emphasis, links etc. inside
quote blocks. This can easily be achieved with a patch like this
org.el:
6096,6099c6096,6099
< ((string= block-type "quote")
< (add-face-text-property beg1 (min (point-max) (1+
end1)) 'org-quote t))
< ((string= block-type "verse")
< (add-face-text-property beg1 (min (point-max) (1+
end1)) 'org-verse t)))
---
> ((string= block-type "quote")
> (add-text-properties beg1 (min (point-max) (1+ end1))
> '(face org-quote)))
> ((string= block-type "verse")
> (add-text-properties beg1 (min (point-max) (1+ end1))
> '(face org-verse))))
In this invocation add-face-text-property appends org-quote to the
face property, and hence all other fontification is kept.
Does this interfere with something else or what people would
expect? In my view it looks much better, but I guess that can
depend on the appearance of org-quote and org-verse (I have them
as font-lock-comment-face, just a slightly different colour, on
top of which italics etc. look good).
--
Anders Johansson
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Why does quote and verse block fontification have to override local fontification?
2017-02-22 9:51 Why does quote and verse block fontification have to override local fontification? Anders Johansson
@ 2017-02-22 10:51 ` Nicolas Goaziou
2017-02-22 12:18 ` [PATCH 1/1] org.el: Make faces org-quote and org-verse be appended Anders Johansson
1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2017-02-22 10:51 UTC (permalink / raw)
To: Anders Johansson; +Cc: emacs-orgmode
Hello,
Anders Johansson <mejlaandersj@gmail.com> writes:
> I want to fontify quote blocks (i use them a lot for note taking and
> writing paper) so that they stand out (and so I enable
> org-fontify-quote-and-verse-blocks) but it would be useful to preserve
> the local fontification of emphasis, links etc. inside quote blocks.
> This can easily be achieved with a patch like this org.el:
>
> 6096,6099c6096,6099
> < ((string= block-type "quote")
> < (add-face-text-property beg1 (min (point-max) (1+ end1))
> 'org-quote t))
> < ((string= block-type "verse")
> < (add-face-text-property beg1 (min (point-max) (1+ end1))
> 'org-verse t)))
> ---
>> ((string= block-type "quote")
>> (add-text-properties beg1 (min (point-max) (1+ end1))
>> '(face org-quote)))
>> ((string= block-type "verse")
>> (add-text-properties beg1 (min (point-max) (1+ end1))
>> '(face org-verse))))
>
>
> In this invocation add-face-text-property appends org-quote to the
> face property, and hence all other fontification is kept.
>
> Does this interfere with something else or what people would expect?
> In my view it looks much better, but I guess that can depend on the
> appearance of org-quote and org-verse (I have them as
> font-lock-comment-face, just a slightly different colour, on top of
> which italics etc. look good).
Sounds good. Could you provide a patch using git format-patch command?
Please add TINYCHANGE at the end of the commit message if you haven't
signed FSF copyright papers.
Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] org.el: Make faces org-quote and org-verse be appended
2017-02-22 9:51 Why does quote and verse block fontification have to override local fontification? Anders Johansson
2017-02-22 10:51 ` Nicolas Goaziou
@ 2017-02-22 12:18 ` Anders Johansson
2017-02-23 13:19 ` Nicolas Goaziou
1 sibling, 1 reply; 4+ messages in thread
From: Anders Johansson @ 2017-02-22 12:18 UTC (permalink / raw)
To: emacs-orgmode
This means fontification of emphasis, links etc. is kept in quote
and
verse blocks even with org-fontify-quote-and-verse-blocks non-nil.
TINYCHANGE
---
lisp/org.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 3290a2b..282c078 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5934,9 +5934,9 @@ by a #."
'(org-block))))))) ; end of source
block
((not org-fontify-quote-and-verse-blocks))
((string= block-type "quote")
- (add-text-properties beg1 (min (point-max) (1+ end1))
'(face org-quote)))
+ (add-face-text-property beg1 (min (point-max) (1+ end1))
'org-quote t))
((string= block-type "verse")
- (add-text-properties beg1 (min (point-max) (1+ end1))
'(face org-verse))))
+ (add-face-text-property beg1 (min (point-max) (1+ end1))
'org-verse t)))
(add-text-properties beg beg1 '(face
org-block-begin-line))
(add-text-properties (min (point-max) (1+ end)) (min
(point-max) (1+ end1))
'(face org-block-end-line))
--
2.11.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-23 13:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-22 9:51 Why does quote and verse block fontification have to override local fontification? Anders Johansson
2017-02-22 10:51 ` Nicolas Goaziou
2017-02-22 12:18 ` [PATCH 1/1] org.el: Make faces org-quote and org-verse be appended Anders Johansson
2017-02-23 13:19 ` Nicolas Goaziou
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.