unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* Problem with custom links
@ 2021-02-09  0:31 Thomas S. Dye
  2021-02-12  5:16 ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas S. Dye @ 2021-02-09  0:31 UTC (permalink / raw)
  To: emacs-orgmode

Aloha all,

Recently, custom links that I've used for years changed their 
behavior.  They used to behave like other org mode links, but now 
they are displayed in a different color face and are always fully 
displayed, unless I add two new keywords to 
org-link-set-parameters.

  (org-link-set-parameters
   "parencite"
   :follow 'org-ebib-open
   :export (lambda (path desc format)
             (cond
              ((eq format 'html)
               (format "(<cite>%s</cite>)" path))
              ((eq format 'latex)
               (if (or (not desc) (equal 0 (search "parencite:" 
               desc)))
                   (format "\\parencite{%s}" path)
                 (format "\\parencite[%s][%s]{%s}"
                         (cadr (split-string desc ";"))
                         (car (split-string desc ";")) path)))))
   :display 'org-link
   :face 'org-link)

I added the :display and :face keywords after I stumbled upon a 
list of defined links (which I wish I'd noted because I haven't 
found it since) that indicated that :display was set to 'full 
(which confused me because I'd read that the default was supposed 
to be 'org-link).  Adding these two keywords restores the original 
behavior for me.

I'm wondering why I have to set these keywords to get the default 
behavior?

I did search ORG-NEWS for a relevant entry, but didn't see 
anything that rang a bell.

I hope you and yours are well in the face of the pandemic.

Let me know if you have questions.

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye


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

* Re: Problem with custom links
  2021-02-09  0:31 Problem with custom links Thomas S. Dye
@ 2021-02-12  5:16 ` Kyle Meyer
  2021-02-12 23:05   ` Thomas S. Dye
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2021-02-12  5:16 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode

Thomas S. Dye writes:

> Aloha all,
>
> Recently, custom links that I've used for years changed their 
> behavior.  They used to behave like other org mode links, but now 
> they are displayed in a different color face and are always fully 
> displayed, unless I add two new keywords to 
> org-link-set-parameters.
>
>   (org-link-set-parameters
>    "parencite"
[...]
>    :display 'org-link
>    :face 'org-link)

I tried this snippet, dropping the :display and :face arguments

  (org-link-set-parameters
   "parencite"
   :follow 'org-ebib-open
   :export (lambda (path desc format)
             (cond
              ((eq format 'html)
               (format "(<cite>%s</cite>)" path))
              ((eq format 'latex)
               (if (or (not desc) (equal 0 (search "parencite:" 
                                                   desc)))
                   (format "\\parencite{%s}" path)
                 (format "\\parencite[%s][%s]{%s}"
                         (cadr (split-string desc ";"))
                         (car (split-string desc ";")) path))))))

with the following buffer:

  [[parencite:foo][bar]]

With an otherwise default configuration and the current master
(49364f904), the link gets fontified with the org-link face and
displayed as just "bar".  So, that seems to be behaving as expected and
I don't spot any relevant code change to the handling of the defaults in
org-activate-links.

Have you tried to trigger it without any additional configuration?


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

* Re: Problem with custom links
  2021-02-12  5:16 ` Kyle Meyer
@ 2021-02-12 23:05   ` Thomas S. Dye
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas S. Dye @ 2021-02-12 23:05 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

Aloha Kyle,

Thanks for taking a look at this, and also for the instructions 
how to test.  I get the results you report.

Separately, off list, John Kitchin kindly noted that my symptoms 
might be caused by org-ref.  A bit of snooping led me to 
understand that org-ref was installed on my system as a dependency 
of emacs-reveal, so the mystery is solved.

I'm happy using the two new keywords; they seem to protect my 
setup from being changed by org-ref.

All the best,
Tom


Kyle Meyer writes:

> Thomas S. Dye writes:
>
>> Aloha all,
>>
>> Recently, custom links that I've used for years changed their
>> behavior.  They used to behave like other org mode links, but 
>> now
>> they are displayed in a different color face and are always 
>> fully
>> displayed, unless I add two new keywords to
>> org-link-set-parameters.
>>
>>   (org-link-set-parameters
>>    "parencite"
> [...]
>>    :display 'org-link
>>    :face 'org-link)
>
> I tried this snippet, dropping the :display and :face arguments
>
>   (org-link-set-parameters
>    "parencite"
>    :follow 'org-ebib-open
>    :export (lambda (path desc format)
>              (cond
>               ((eq format 'html)
>                (format "(<cite>%s</cite>)" path))
>               ((eq format 'latex)
>                (if (or (not desc) (equal 0 (search "parencite:"
>                                                    desc)))
>                    (format "\\parencite{%s}" path)
>                  (format "\\parencite[%s][%s]{%s}"
>                          (cadr (split-string desc ";"))
>                          (car (split-string desc ";")) 
>                          path))))))
>
> with the following buffer:
>
>   [[parencite:foo][bar]]
>
> With an otherwise default configuration and the current master
> (49364f904), the link gets fontified with the org-link face and
> displayed as just "bar".  So, that seems to be behaving as 
> expected and
> I don't spot any relevant code change to the handling of the 
> defaults in
> org-activate-links.
>
> Have you tried to trigger it without any additional 
> configuration?


--
Thomas S. Dye
https://tsdye.online/tsdye


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

end of thread, other threads:[~2021-02-12 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  0:31 Problem with custom links Thomas S. Dye
2021-02-12  5:16 ` Kyle Meyer
2021-02-12 23:05   ` Thomas S. Dye

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 http://ou63pmih66umazou.onion/public-inbox.git