emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] lisp/org.el: Use `org-document-info' face for subtitles
@ 2020-11-03  9:48 Titus von der Malsburg
  2020-11-06  6:18 ` Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Titus von der Malsburg @ 2020-11-03  9:48 UTC (permalink / raw)
  To: emacs-orgmode

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


Org currently uses `org-meta-line' to display the value of the #+subtitle: property.  However, the subtitle isn’t meta information, but document information supposed to be displayed in the exported document like title, author, date, e-mail.  The attached patch uses the face `org-document-info' to display subtitles, which is the same face as for title, author, date, e-mail.

  Titus


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-org.el-Use-face-org-document-info-for-subtitle.patch --]
[-- Type: text/x-diff, Size: 1035 bytes --]

From ffb43ad434031ff0ae335711d7ac29c8a4973417 Mon Sep 17 00:00:00 2001
From: Titus von der Malsburg <malsburg@posteo.de>
Date: Tue, 3 Nov 2020 10:32:57 +0100
Subject: [PATCH] lisp/org.el: Use face org-document-info for subtitle

* lisp/org.el: The value for the #+subtitle: property is now displayed
with face `org-document-info' instead of `org-meta-line'.

Like the title, author, e-mail, date, the subtitle is information
that is displayed in the exported document.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 03df139fb..27f09645b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5307,7 +5307,7 @@ by a #."
 		 (min (point-max) end-of-endline))
 	       '(face org-block-end-line)))
 	    t))
-	 ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
+	 ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:"))
 	  (org-remove-flyspell-overlays-in
 	   (match-beginning 0)
 	   (if (equal "+title:" dc1) (match-end 2) (match-end 0)))
-- 
2.25.1


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

* Re: [PATCH] lisp/org.el: Use `org-document-info' face for subtitles
  2020-11-03  9:48 [PATCH] lisp/org.el: Use `org-document-info' face for subtitles Titus von der Malsburg
@ 2020-11-06  6:18 ` Kyle Meyer
  2020-11-06 11:59   ` Titus von der Malsburg
  0 siblings, 1 reply; 8+ messages in thread
From: Kyle Meyer @ 2020-11-06  6:18 UTC (permalink / raw)
  To: Titus von der Malsburg; +Cc: emacs-orgmode

Titus von der Malsburg writes:

> Subject: [PATCH] lisp/org.el: Use face org-document-info for subtitle
>
> * lisp/org.el: The value for the #+subtitle: property is now displayed
> with face `org-document-info' instead of `org-meta-line'.
>
> Like the title, author, e-mail, date, the subtitle is information
> that is displayed in the exported document.

Makes sense to me, and I guess it was left out just because #+subtitle
wasn't around until v8.3.

> ---
>  lisp/org.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 03df139fb..27f09645b 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -5307,7 +5307,7 @@ by a #."
>  		 (min (point-max) end-of-endline))
>  	       '(face org-block-end-line)))
>  	    t))
> -	 ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
> +	 ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:"))
>  	  (org-remove-flyspell-overlays-in
>  	   (match-beginning 0)
>  	   (if (equal "+title:" dc1) (match-end 2) (match-end 0)))

Please also update org-document-info-keyword's docstring.


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

* Re: [PATCH] lisp/org.el: Use `org-document-info' face for subtitles
  2020-11-06  6:18 ` Kyle Meyer
@ 2020-11-06 11:59   ` Titus von der Malsburg
  2020-11-07 22:04     ` Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Titus von der Malsburg @ 2020-11-06 11:59 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

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


On 2020-11-06 Fr 07:18, Kyle Meyer wrote:
> Titus von der Malsburg writes:
>
>> Subject: [PATCH] lisp/org.el: Use face org-document-info for subtitle
>>
>> * lisp/org.el: The value for the #+subtitle: property is now displayed
>> with face `org-document-info' instead of `org-meta-line'.
>>
>> Like the title, author, e-mail, date, the subtitle is information
>> that is displayed in the exported document.
>
> Makes sense to me, and I guess it was left out just because #+subtitle
> wasn't around until v8.3.
>
>> ---
>>  lisp/org.el | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lisp/org.el b/lisp/org.el
>> index 03df139fb..27f09645b 100644
>> --- a/lisp/org.el
>> +++ b/lisp/org.el
>> @@ -5307,7 +5307,7 @@ by a #."
>>  		 (min (point-max) end-of-endline))
>>  	       '(face org-block-end-line)))
>>  	    t))
>> -	 ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
>> +	 ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:"))
>>  	  (org-remove-flyspell-overlays-in
>>  	   (match-beginning 0)
>>  	   (if (equal "+title:" dc1) (match-end 2) (match-end 0)))
>
> Please also update org-document-info-keyword's docstring.

Done.  I also updated the docstring for `org-document-info'.  See attached patch.

  Titus


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-org.el-Display-subtitle-lines-with-document-inf.patch --]
[-- Type: text/x-diff, Size: 2004 bytes --]

From 3d27f195a635f9ef8cbf43e1549663bef447c8fa Mon Sep 17 00:00:00 2001
From: Titus von der Malsburg <malsburg@posteo.de>
Date: Tue, 3 Nov 2020 10:32:57 +0100
Subject: [PATCH] lisp/org.el: Display subtitle lines with document info faces

* lisp/org.el: The #+SUBTITLE: keyword is now displayed with
`org-document-info-keyword' and its value with
`org-document-info' (instead of `org-meta-line').

Like the title, author, e-mail, date, the subtitle is information
that is displayed in the exported document, not meta information.
---
 lisp/org-faces.el | 8 +++++---
 lisp/org.el       | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 94b283ad6..2f3273f55 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -414,12 +414,14 @@ changes."
   '((((class color) (background light)) (:foreground "midnight blue"))
     (((class color) (background dark)) (:foreground "pale turquoise"))
     (t nil))
-  "Face for document date, author and email; i.e. that which
-follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
+  "Face for document subtitle, date, author and email; i.e. that
+which follows a #+SUBTITLE:, #+DATE:, #+AUTHOR: or #+EMAIL:
+keyword."
   :group 'org-faces)
 
 (defface org-document-info-keyword '((t :inherit shadow))
-  "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
+  "Face for #+TITLE:, #+SUBTITLE:, #+AUTHOR:, #+EMAIL: and
+#+DATE: keywords."
   :group 'org-faces)
 
 (defface org-block `((t :inherit shadow
diff --git a/lisp/org.el b/lisp/org.el
index 9a13f03d6..89cb09fe1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5307,7 +5307,7 @@ by a #."
 		 (min (point-max) end-of-endline))
 	       '(face org-block-end-line)))
 	    t))
-	 ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
+	 ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:"))
 	  (org-remove-flyspell-overlays-in
 	   (match-beginning 0)
 	   (if (equal "+title:" dc1) (match-end 2) (match-end 0)))
-- 
2.25.1


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

* Re: [PATCH] lisp/org.el: Use `org-document-info' face for subtitles
  2020-11-06 11:59   ` Titus von der Malsburg
@ 2020-11-07 22:04     ` Kyle Meyer
  2020-11-12 17:13       ` Titus von der Malsburg
  0 siblings, 1 reply; 8+ messages in thread
From: Kyle Meyer @ 2020-11-07 22:04 UTC (permalink / raw)
  To: Titus von der Malsburg; +Cc: emacs-orgmode

Titus von der Malsburg writes:

> On 2020-11-06 Fr 07:18, Kyle Meyer wrote:
>> Titus von der Malsburg writes:
>>
>>> Subject: [PATCH] lisp/org.el: Use face org-document-info for subtitle
>>>
>>> * lisp/org.el: The value for the #+subtitle: property is now displayed
>>> with face `org-document-info' instead of `org-meta-line'.
>>>
>>> Like the title, author, e-mail, date, the subtitle is information
>>> that is displayed in the exported document.
>>
>> Makes sense to me, and I guess it was left out just because #+subtitle
>> wasn't around until v8.3.
>>
>>> ---
>>>  lisp/org.el | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/lisp/org.el b/lisp/org.el
>>> index 03df139fb..27f09645b 100644
>>> --- a/lisp/org.el
>>> +++ b/lisp/org.el
>>> @@ -5307,7 +5307,7 @@ by a #."
>>>  		 (min (point-max) end-of-endline))
>>>  	       '(face org-block-end-line)))
>>>  	    t))
>>> -	 ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
>>> +	 ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:"))
>>>  	  (org-remove-flyspell-overlays-in
>>>  	   (match-beginning 0)
>>>  	   (if (equal "+title:" dc1) (match-end 2) (match-end 0)))
>>
>> Please also update org-document-info-keyword's docstring.
>
> Done.  I also updated the docstring for `org-document-info'.  See attached patch.

Thanks.  Applied (e2fe59683), add entries to the changelog for the
faces.


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

* Re: [PATCH] lisp/org.el: Use `org-document-info' face for subtitles
  2020-11-07 22:04     ` Kyle Meyer
@ 2020-11-12 17:13       ` Titus von der Malsburg
  2020-11-16  5:33         ` [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via `org-hidden-keywords' Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Titus von der Malsburg @ 2020-11-12 17:13 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

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


On 2020-11-07 Sa 23:04, Kyle Meyer wrote:
> Titus von der Malsburg writes:
>
>> On 2020-11-06 Fr 07:18, Kyle Meyer wrote:
>>> Titus von der Malsburg writes:
>>>
>>>> Subject: [PATCH] lisp/org.el: Use face org-document-info for subtitle
>>>>
>>>> * lisp/org.el: The value for the #+subtitle: property is now displayed
>>>> with face `org-document-info' instead of `org-meta-line'.
>>>>
>>>> Like the title, author, e-mail, date, the subtitle is information
>>>> that is displayed in the exported document.
>>>
>>> Makes sense to me, and I guess it was left out just because #+subtitle
>>> wasn't around until v8.3.
>>>
>>>> ---
>>>>  lisp/org.el | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/lisp/org.el b/lisp/org.el
>>>> index 03df139fb..27f09645b 100644
>>>> --- a/lisp/org.el
>>>> +++ b/lisp/org.el
>>>> @@ -5307,7 +5307,7 @@ by a #."
>>>>  		 (min (point-max) end-of-endline))
>>>>  	       '(face org-block-end-line)))
>>>>  	    t))
>>>> -	 ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
>>>> +	 ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:"))
>>>>  	  (org-remove-flyspell-overlays-in
>>>>  	   (match-beginning 0)
>>>>  	   (if (equal "+title:" dc1) (match-end 2) (match-end 0)))
>>>
>>> Please also update org-document-info-keyword's docstring.
>>
>> Done.  I also updated the docstring for `org-document-info'.  See attached patch.
>
> Thanks.  Applied (e2fe59683), add entries to the changelog for the
> faces.

Attached is a follow-up patch that allows users to hide the #+SUBTITLE: keyword via `org-hidden-keywords' just like #+TITLE, #+AUTHOR:, and similar.

  Titus


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-org.el-Allow-hiding-SUBTITLE-keyword-via-org-hi.patch --]
[-- Type: text/x-diff, Size: 943 bytes --]

From 794e126fa1ab3cebc8de3bf35324e8353bc8a427 Mon Sep 17 00:00:00 2001
From: Titus von der Malsburg <malsburg@posteo.de>
Date: Thu, 12 Nov 2020 18:03:33 +0100
Subject: [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via
 `org-hidden-keywords'

* lisp/org.el: Allow users to include 'subtitle in
`org-hidden-keywords' to hide #+SUBTITLE: keyword.

This way #+SUBTITLE is treated like similar keywords for title, date,
e-mail, and author.
---
 lisp/org.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org.el b/lisp/org.el
index 73b270712..0d2fbddda 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3573,6 +3573,7 @@ appear in the buffer without the initial \"#+TITLE:\" part."
   :type '(set (const :tag "#+AUTHOR" author)
 	      (const :tag "#+DATE" date)
 	      (const :tag "#+EMAIL" email)
+	      (const :tag "#+SUBTITLE" subtitle)
 	      (const :tag "#+TITLE" title)))
 
 (defcustom org-custom-properties nil
-- 
2.25.1


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

* [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via `org-hidden-keywords'
  2020-11-12 17:13       ` Titus von der Malsburg
@ 2020-11-16  5:33         ` Kyle Meyer
  2020-11-16 10:20           ` Titus von der Malsburg
  0 siblings, 1 reply; 8+ messages in thread
From: Kyle Meyer @ 2020-11-16  5:33 UTC (permalink / raw)
  To: Titus von der Malsburg; +Cc: emacs-orgmode

Titus von der Malsburg writes:

> Subject: [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via
>  `org-hidden-keywords'
>
> * lisp/org.el: Allow users to include 'subtitle in
> `org-hidden-keywords' to hide #+SUBTITLE: keyword.
>
> This way #+SUBTITLE is treated like similar keywords for title, date,
> e-mail, and author.

Thanks, sounds good.

> ---
>  lisp/org.el | 1 +
>  1 file changed, 1 insertion(+)

Could you add an entry to ORG-NEWS?

> diff --git a/lisp/org.el b/lisp/org.el
> index 73b270712..0d2fbddda 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -3573,6 +3573,7 @@ appear in the buffer without the initial \"#+TITLE:\" part."
>    :type '(set (const :tag "#+AUTHOR" author)
>  	      (const :tag "#+DATE" date)
>  	      (const :tag "#+EMAIL" email)
> +	      (const :tag "#+SUBTITLE" subtitle)
>  	      (const :tag "#+TITLE" title)))

Please add

    :package-version '(Org . "9.5")

dropping the current ':version "24.1"'.


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

* Re: [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via `org-hidden-keywords'
  2020-11-16  5:33         ` [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via `org-hidden-keywords' Kyle Meyer
@ 2020-11-16 10:20           ` Titus von der Malsburg
  2020-11-17  4:38             ` Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Titus von der Malsburg @ 2020-11-16 10:20 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

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


On 2020-11-16 Mo 06:33, Kyle Meyer wrote:
> Titus von der Malsburg writes:
>
>> Subject: [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via
>>  `org-hidden-keywords'
>>
>> * lisp/org.el: Allow users to include 'subtitle in
>> `org-hidden-keywords' to hide #+SUBTITLE: keyword.
>>
>> This way #+SUBTITLE is treated like similar keywords for title, date,
>> e-mail, and author.
>
> Thanks, sounds good.
>
>> ---
>>  lisp/org.el | 1 +
>>  1 file changed, 1 insertion(+)
>
> Could you add an entry to ORG-NEWS?

Done.

>> diff --git a/lisp/org.el b/lisp/org.el
>> index 73b270712..0d2fbddda 100644
>> --- a/lisp/org.el
>> +++ b/lisp/org.el
>> @@ -3573,6 +3573,7 @@ appear in the buffer without the initial \"#+TITLE:\" part."
>>    :type '(set (const :tag "#+AUTHOR" author)
>>  	      (const :tag "#+DATE" date)
>>  	      (const :tag "#+EMAIL" email)
>> +	      (const :tag "#+SUBTITLE" subtitle)
>>  	      (const :tag "#+TITLE" title)))
>
> Please add
>
>     :package-version '(Org . "9.5")
>
> dropping the current ':version "24.1"'.

Done.

Updated patch attached.

Thanks for your guidance.

  Titus


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-org.el-Allow-hiding-SUBTITLE-keyword-via-org-hi.patch --]
[-- Type: text/x-diff, Size: 1778 bytes --]

From fc3957aad8c94d1b1f3f1882c9f5d6da4552b640 Mon Sep 17 00:00:00 2001
From: Titus von der Malsburg <malsburg@posteo.de>
Date: Mon, 16 Nov 2020 11:05:15 +0100
Subject: [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via
 `org-hidden-keywords'

* lisp/org.el: Allow users to include 'subtitle in
`org-hidden-keywords' to hide #+SUBTITLE: keyword.

This way #+SUBTITLE is treated like similar keywords for title, date,
e-mail, and author.
---
 etc/ORG-NEWS | 6 ++++++
 lisp/org.el  | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 66347fe90..889eb4aab 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -12,6 +12,12 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 
 * Version 9.5 (not yet released)
 ** New options and settings
+*** Option ~org-hidden-keywords~ now also applies to #+SUBTITLE:
+
+The option ~org-hidden-keywords~ previously applied
+to #+TITLE:, #+AUTHOR:, #+DATE:, and #+EMAIL:.  Now it can also be
+used to hide the #+SUBTITLE: keyword.
+
 *** New formatting directive ~%L~ for org-capture
 
 The new ~%L~ formatting directive contains the bare link target, and
diff --git a/lisp/org.el b/lisp/org.el
index 73b270712..2b50f94ee 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3569,10 +3569,11 @@ lines to the buffer:
 For example, a value \\='(title) for this list makes the document's title
 appear in the buffer without the initial \"#+TITLE:\" part."
   :group 'org-appearance
-  :version "24.1"
+  :package-version '(Org . "9.5")
   :type '(set (const :tag "#+AUTHOR" author)
 	      (const :tag "#+DATE" date)
 	      (const :tag "#+EMAIL" email)
+	      (const :tag "#+SUBTITLE" subtitle)
 	      (const :tag "#+TITLE" title)))
 
 (defcustom org-custom-properties nil
-- 
2.25.1


[-- Attachment #3: Type: text/plain, Size: 209 bytes --]




-- 
Dr. Titus von der Malsburg
Dept. Linguistics, University of Potsdam
Dept. Brain & Cognitive Sciences, MIT
https://tmalsburg.github.io
PGP fingerprint: C34C 7364 EAAD 4752 FABA  35E6 AE34 59F3 C613 689D

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

* Re: [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via `org-hidden-keywords'
  2020-11-16 10:20           ` Titus von der Malsburg
@ 2020-11-17  4:38             ` Kyle Meyer
  0 siblings, 0 replies; 8+ messages in thread
From: Kyle Meyer @ 2020-11-17  4:38 UTC (permalink / raw)
  To: Titus von der Malsburg; +Cc: emacs-orgmode

Titus von der Malsburg writes:

> Updated patch attached.

Thanks.  Applied (8bade78ce).


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

end of thread, other threads:[~2020-11-17  4:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03  9:48 [PATCH] lisp/org.el: Use `org-document-info' face for subtitles Titus von der Malsburg
2020-11-06  6:18 ` Kyle Meyer
2020-11-06 11:59   ` Titus von der Malsburg
2020-11-07 22:04     ` Kyle Meyer
2020-11-12 17:13       ` Titus von der Malsburg
2020-11-16  5:33         ` [PATCH] lisp/org.el: Allow hiding #+SUBTITLE: keyword via `org-hidden-keywords' Kyle Meyer
2020-11-16 10:20           ` Titus von der Malsburg
2020-11-17  4:38             ` Kyle Meyer

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).