emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug?] org-link-set-parameters: when `:display 'full', link face is applied only in description part
@ 2021-06-03 21:11 Juan Manuel Macías
  2021-06-04 11:31 ` Juan Manuel Macías
  0 siblings, 1 reply; 7+ messages in thread
From: Juan Manuel Macías @ 2021-06-03 21:11 UTC (permalink / raw)
  To: orgmode

Hi all,

In master:

if I do:

(org-link-set-parameters "foo"
			 :display 'full
			 :face '(:foreground "chocolate" :weight bold :underline t))

and then:

[[foo:target][description]]

the face parameter is only applied in the description part.

Expected result: shouldn't the face be applied to the entire link?

Best regards,

Juan Manuel 


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

* Re: [bug?] org-link-set-parameters: when `:display 'full', link face is applied only in description part
  2021-06-03 21:11 [bug?] org-link-set-parameters: when `:display 'full', link face is applied only in description part Juan Manuel Macías
@ 2021-06-04 11:31 ` Juan Manuel Macías
  2021-06-06 22:34   ` Juan Manuel Macías
  0 siblings, 1 reply; 7+ messages in thread
From: Juan Manuel Macías @ 2021-06-04 11:31 UTC (permalink / raw)
  To: orgmode

Hello again,

To simplify what I mentioned in my previous message, the bug is simply
reproducible with any link, when running `org-toggle-link-display'.

I'm not sure, but I would say it was introduced in the commit:

8bdcf51ac lisp/org.el: Update previews correctly when color chnages

Best regards,

Juan Manuel 

Juan Manuel Macías writes:

> Hi all,
>
> In master:
>
> if I do:
>
> (org-link-set-parameters "foo"
> 			 :display 'full
> 			 :face '(:foreground "chocolate" :weight bold :underline t))
>
> and then:
>
> [[foo:target][description]]
>
> the face parameter is only applied in the description part.
>
> Expected result: shouldn't the face be applied to the entire link?
>
> Best regards,
>
> Juan Manuel 
>



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

* Re: [bug?] org-link-set-parameters: when `:display 'full', link face is applied only in description part
  2021-06-04 11:31 ` Juan Manuel Macías
@ 2021-06-06 22:34   ` Juan Manuel Macías
  2021-06-08  0:24     ` [PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.) Juan Manuel Macías
  0 siblings, 1 reply; 7+ messages in thread
From: Juan Manuel Macías @ 2021-06-06 22:34 UTC (permalink / raw)
  To: orgmode

Juan Manuel Macías writes:

> To simplify what I mentioned in my previous message, the bug is simply
> reproducible with any link, when running `org-toggle-link-display'.
>
> I'm not sure, but I would say it was introduced in the commit:
>
> 8bdcf51ac lisp/org.el: Update previews correctly when color chnages

I correct myself. I think the commit where this problem was introduced is:

979e82fc3  Make sure that headline faces take precedence

Best regards,

Juan Manuel 


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

* [PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.)
  2021-06-06 22:34   ` Juan Manuel Macías
@ 2021-06-08  0:24     ` Juan Manuel Macías
  2021-09-26  6:08       ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Juan Manuel Macías @ 2021-06-08  0:24 UTC (permalink / raw)
  To: orgmode

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

As I commented in a previous post of this thread, to reproduce the
bug, just run `org-toggle-link-display'.

As a possible solution I'm attaching this patch (little tested).

Best regards,

Juan Manuel


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org.el-prevent-partial-fontification-link-display-full.patch --]
[-- Type: text/x-patch, Size: 1252 bytes --]

From caf32a7e1fb1b4bddfa011520f5403d5b6b19ddd Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias <maciaschain@posteo.net>
Date: Tue, 8 Jun 2021 01:55:02 +0200
Subject: [PATCH] org.el: prevent partial fontification when a link is
 displayed full

* lisp/org.el (org-activate-links): apply `face-property' variable in
other cases when handle invisible parts in bracket links
---
 lisp/org.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1bd9e02eb..b55d8798a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5224,9 +5224,11 @@ This includes angle, plain, and bracket links."
 			       ,(or (org-link-get-parameter type :display)
 				    'org-link))
 			     properties)))
+		(add-face-text-property start visible-start face-property)
 		(add-text-properties start visible-start hidden)
-                (add-face-text-property visible-start visible-end face-property)
+		(add-face-text-property visible-start visible-end face-property)
 		(add-text-properties visible-start visible-end properties)
+		(add-face-text-property visible-end end face-property)
 		(add-text-properties visible-end end hidden)
 		(org-rear-nonsticky-at visible-start)
 		(org-rear-nonsticky-at visible-end)))
-- 
2.31.1


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

* Re: [PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.)
  2021-06-08  0:24     ` [PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.) Juan Manuel Macías
@ 2021-09-26  6:08       ` Bastien
  2021-09-26 11:35         ` Juan Manuel Macías
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2021-09-26  6:08 UTC (permalink / raw)
  To: Juan Manuel Macías; +Cc: orgmode

Hi Juan,

Juan Manuel Macías <maciaschain@posteo.net> writes:

> As a possible solution I'm attaching this patch (little tested).

I could not apply the patch in the bugfix or main branch.  Is it still
relevant?  If the bug is still here, feel free to send an updated patch.

Thanks!

-- 
 Bastien


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

* Re: [PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.)
  2021-09-26  6:08       ` Bastien
@ 2021-09-26 11:35         ` Juan Manuel Macías
  2021-09-26 12:49           ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Juan Manuel Macías @ 2021-09-26 11:35 UTC (permalink / raw)
  To: Bastien; +Cc: orgmode

Hi Bastien, thank you for your message,

Bastien writes:

> I could not apply the patch in the bugfix or main branch.  Is it still
> relevant?  If the bug is still here, feel free to send an updated patch.

I have consulted the log, and the patch was already applied by Nicololas
in commit:

40a20136d * | | Prevent partial fontification when a link is displayed full

Best regards,

Juan Manuel 


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

* Re: [PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.)
  2021-09-26 11:35         ` Juan Manuel Macías
@ 2021-09-26 12:49           ` Bastien
  0 siblings, 0 replies; 7+ messages in thread
From: Bastien @ 2021-09-26 12:49 UTC (permalink / raw)
  To: Juan Manuel Macías; +Cc: orgmode

Juan Manuel Macías <maciaschain@posteo.net> writes:

> I have consulted the log, and the patch was already applied by Nicololas
> in commit

Oops, sorry for the noise and thanks for confirming!

-- 
 Bastien


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

end of thread, other threads:[~2021-09-26 12:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 21:11 [bug?] org-link-set-parameters: when `:display 'full', link face is applied only in description part Juan Manuel Macías
2021-06-04 11:31 ` Juan Manuel Macías
2021-06-06 22:34   ` Juan Manuel Macías
2021-06-08  0:24     ` [PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.) Juan Manuel Macías
2021-09-26  6:08       ` Bastien
2021-09-26 11:35         ` Juan Manuel Macías
2021-09-26 12:49           ` Bastien

Code repositories for project(s) associated with this 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).