unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* Bug: org-priority face has extra space at the end starting from version 9.4 [9.4 (9.4-elpaplus @ /home/rrudakov/.emacs.d/elpa/org-plus-contrib-20200914/)]
@ 2020-09-15 18:50 Roman Rudakov
  2020-09-16  8:52 ` Protesilaos Stavrou
  0 siblings, 1 reply; 2+ messages in thread
From: Roman Rudakov @ 2020-09-15 18:50 UTC (permalink / raw)
  To: emacs-orgmode

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

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See

https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

Hello,

I use theme which draw boxes around priority cookie. Before updating to
version 9.4 box was rendered just around square brackets, but since
version 9.4 it has additional space at the end.

I think it's related to the fact that org-priority face definition used
to use separate regex which didn't include space, and now it uses
variable org-priority-regexp which does include additional space
character.

;; Old
(defun org-font-lock-add-priority-faces (limit)
"Add the special priority faces."
(while (re-search-forward "^\\*+ .*?\\(\\[#\\(.\\)\\]\\)" limit t)
(add-text-properties
(match-beginning 1) (match-end 1)
(list 'face (org-get-priority-face (string-to-char (match-string 2)))
'font-lock-fontified t))))

;; New
(defun org-font-lock-add-priority-faces (limit)
"Add the special priority faces."
(while (re-search-forward org-priority-regexp limit t)
(add-text-properties
(match-beginning 1) (match-end 1)
(list 'face (org-get-priority-face (string-to-char (match-string 2)))
'font-lock-fontified t))))

(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]+\\)\\] ?\\)"

Removing space before last question mark fixes my problem, but I'm not
sure it won't affect something.[org-mode-priority-9.3.8.png][org-mode-priority-9.4.png]

Emacs : GNU Emacs 27.1 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
of 2020-08-11
Package: Org mode version 9.4 (9.4-elpaplus @ /home/rrudakov/.emacs.d/elpa/org-plus-contrib-20200914/)

[-- Attachment #2.1: Type: text/html, Size: 2371 bytes --]

[-- Attachment #2.2: org-mode-priority-9.4.png --]
[-- Type: image/png, Size: 5121 bytes --]

[-- Attachment #2.3: org-mode-priority-9.3.8.png --]
[-- Type: image/png, Size: 5315 bytes --]

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

* Re: Bug: org-priority face has extra space at the end starting from version 9.4 [9.4 (9.4-elpaplus @ /home/rrudakov/.emacs.d/elpa/org-plus-contrib-20200914/)]
  2020-09-15 18:50 Bug: org-priority face has extra space at the end starting from version 9.4 [9.4 (9.4-elpaplus @ /home/rrudakov/.emacs.d/elpa/org-plus-contrib-20200914/)] Roman Rudakov
@ 2020-09-16  8:52 ` Protesilaos Stavrou
  0 siblings, 0 replies; 2+ messages in thread
From: Protesilaos Stavrou @ 2020-09-16  8:52 UTC (permalink / raw)
  To: Roman Rudakov; +Cc: emacs-orgmode

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

Roman Rudakov <rrudakov@pm.me> [2020-09-15, 18:50 +0000]:

> I use theme which draw boxes around priority cookie. Before updating to
> version 9.4 box was rendered just around square brackets, but since
> version 9.4 it has additional space at the end.
>
> I think it's related to the fact that org-priority face definition used
> to use separate regex which didn't include space, and now it uses
> variable org-priority-regexp which does include additional space
> character.
>
> [...]

This issue is noticeable with any face properties for 'org-priority'
such as box, background, underline, overline.

Just to add a reproducible recipe for this case.

On 'emacs -Q' running Org 9.4:

+ C-x C-f /tmp/test.org
+ Insert a heading, like:

    * TODO [#A] This is a test

…see attached screenshot with "default" state.

* Now evaluate the following expression:

    (set-face-attribute 'org-priority nil :underline t)

…see attached screenshot with "edited" state.

-- 
Protesilaos Stavrou
protesilaos.com

[-- Attachment #2: org-9.4-priority-cookie-face-default.png --]
[-- Type: image/png, Size: 26032 bytes --]

[-- Attachment #3: org-9.4-priority-cookie-face-edited.png --]
[-- Type: image/png, Size: 25688 bytes --]

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

end of thread, other threads:[~2020-09-16  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 18:50 Bug: org-priority face has extra space at the end starting from version 9.4 [9.4 (9.4-elpaplus @ /home/rrudakov/.emacs.d/elpa/org-plus-contrib-20200914/)] Roman Rudakov
2020-09-16  8:52 ` Protesilaos Stavrou

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git