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/)]
On 2020-10-11, 02:40 -0400, Kyle Meyer wrote: > I'm wary of changing the regexp. Although the docstring does suggest > the space shouldn't be a part of the first group, the group has included > the space since org-priority-regex was introduced way back in 2008. And > making the suggested change results in a failing test > (test-org/entry-put). So at this point, I'd lean towards adjusting the > docstring. > > I've applied a different fix for the regression (b1de0c8e4). Thank you Kyle! I can confirm that the issue is no longer present on my end. -- Protesilaos Stavrou protesilaos.com
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/)]
Protesilaos Stavrou writes: > On 2020-09-29, 08:00 +, Roman Rudakov wrote: > >> "Protesilaos Stavrou" writes: >> >>> Roman Rudakov [2020-09-15, 18:50 +]: >>> 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. Thanks, all, for the excellent report and debugging. >> I think proper value for `org-priority-regex` should be >> ".*?\\(\\[#\\([A-Z0-9]+\\)\\]\\) ?", extra space should be moved out of >> the brackets, It won't break anything and face definition will be >> correct. > > This is to confirm that I and Ilja (in Cc) get the desired behaviour by > evaluating the suggested regexp. I'm wary of changing the regexp. Although the docstring does suggest the space shouldn't be a part of the first group, the group has included the space since org-priority-regex was introduced way back in 2008. And making the suggested change results in a failing test (test-org/entry-put). So at this point, I'd lean towards adjusting the docstring. I've applied a different fix for the regression (b1de0c8e4).
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/)]
On 2020-09-29, 08:00 +, Roman Rudakov wrote: > "Protesilaos Stavrou" writes: > >> Roman Rudakov [2020-09-15, 18:50 +]: >> >>> 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 > > Hello, > > I think proper value for `org-priority-regex` should be > ".*?\\(\\[#\\([A-Z0-9]+\\)\\]\\) ?", extra space should be moved out of > the brackets, It won't break anything and face definition will be > correct. > > Best regards. This is to confirm that I and Ilja (in Cc) get the desired behaviour by evaluating the suggested regexp. Steps to quickly reproduce this on 'emacs -Q': + C-x C-f /tmp/test.org + Insert a heading with a priority cookie: - * TODO [#A] This is a test + Evaluate: (set-face-attribute 'org-priority nil :background "#ddd") - The background is just to visualise the extra blank to the right of the cookie's closing bracket. Same principle for underlines, overlines, boxes. + Eval: (setq org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]+\\)\\]\\) ?") + M-x org-mode-restart + The extra space which was coloured before should no longer be affected by the face properties. The background we added must only cover the priority cookie's text. Best regards, Protesilaos -- Protesilaos Stavrou protesilaos.com
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/)]
"Protesilaos Stavrou" writes: > Roman Rudakov [2020-09-15, 18:50 +]: > >> 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 Hello, I think proper value for `org-priority-regex` should be ".*?\\(\\[#\\([A-Z0-9]+\\)\\]\\) ?", extra space should be moved out of the brackets, It won't break anything and face definition will be correct. Best regards.
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/)]
Roman Rudakov [2020-09-15, 18:50 +]: > 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
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/)]
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/)