From: "Michaël Cadilhac" <michael@cadilhac.name>
To: emacs-orgmode@gnu.org
Subject: Re: Completely hide the :PROPERTIES: drawer in org-mode.
Date: Wed, 28 Aug 2019 17:38:39 -0500 [thread overview]
Message-ID: <CADt3fpPGYZsJ+Of2SThTYGtQN5Y5xD4XAptx4T7CtdYQbNV_Mw@mail.gmail.com> (raw)
In-Reply-To: <87lg2iq7w2.fsf@nicolasgoaziou.fr>
[-- Attachment #1.1: Type: text/plain, Size: 401 bytes --]
Apologies for the delay.
Is that alright?
On Thu, 14 Feb 2019 at 17:15, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:
> Michaël Cadilhac <michael@cadilhac.name> writes:
>
> > Will do. This in particular requires to swap fontifying the drawers
> > and the keywords (since :END: and :PROPERTIES: are keywords):
>
> [...]
>
> > Agreed?
>
> Sure. Please do what is necessary ;)
>
[-- Attachment #1.2: Type: text/html, Size: 796 bytes --]
[-- Attachment #2: 0001-Fontify-drawers-correctly.patch --]
[-- Type: text/x-patch, Size: 1727 bytes --]
From aebea2663b929f0dbf8e1408c9ddb85f210e2c0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Cadilhac?= <michael@cadilhac.name>
Date: Wed, 28 Aug 2019 16:26:06 -0500
Subject: [PATCH] Fontify drawers correctly.
* lisp/org.el (org-fontify-drawers): Fix face used, fix range of text
properties.
(org-set-font-lock-defaults): Fontify drawers after keywords.
---
lisp/org.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index ea2c75130..31faac516 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5356,9 +5356,10 @@ by a #."
"Fontify drawers."
(when (re-search-forward org-drawer-regexp limit t)
(add-text-properties
- (match-beginning 0) (match-end 0)
- '(font-lock-fontified t face org-special-keyword))
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
+ (line-beginning-position) (line-beginning-position 2)
+ '(font-lock-fontified t face org-drawer))
+ (org-remove-flyspell-overlays-in
+ (line-beginning-position) (line-beginning-position 2))
t))
(defun org-fontify-macros (limit)
@@ -5612,12 +5613,12 @@ needs to be inserted at a specific position in the font-lock sequence.")
'("^[ \t]*| *\\([#*]\\) *|" (1 'org-formula t))
'("^[ \t]*|\\( *\\([$!_^/]\\) *|.*\\)|" (1 'org-formula t))
'("| *\\(<[lrc]?[0-9]*>\\)" (1 'org-formula t))
- ;; Drawers
- '(org-fontify-drawers)
;; Properties
(list org-property-re
'(1 'org-special-keyword t)
'(3 'org-property-value t))
+ ;; Drawers
+ '(org-fontify-drawers)
;; Link related fontification.
'(org-activate-links)
(when (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
--
2.22.0
next prev parent reply other threads:[~2019-08-28 22:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 16:21 Completely hide the :PROPERTIES: drawer in org-mode Keith David Bershatsky
2019-02-12 8:37 ` Nicolas Goaziou
2019-02-12 20:17 ` Michaël Cadilhac
2019-02-13 14:32 ` Nicolas Goaziou
2019-02-13 15:11 ` Michaël Cadilhac
2019-02-13 15:55 ` Nicolas Goaziou
2019-02-14 14:16 ` Michaël Cadilhac
2019-02-14 16:11 ` Nicolas Goaziou
2019-02-14 16:21 ` Michaël Cadilhac
2019-02-14 23:15 ` Nicolas Goaziou
2019-08-28 22:38 ` Michaël Cadilhac [this message]
2019-09-05 16:54 ` Nicolas Goaziou
2019-02-13 18:44 ` Marco Wahl
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADt3fpPGYZsJ+Of2SThTYGtQN5Y5xD4XAptx4T7CtdYQbNV_Mw@mail.gmail.com \
--to=michael@cadilhac.name \
--cc=emacs-orgmode@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.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).