org-appear icon indicating copy to clipboard operation
org-appear copied to clipboard

org-appear does not trigger in links in comments!

Open japhir opened this issue 3 years ago • 8 comments

if I have an org file with a link on a commented (#) line, it does not appear!

Org mode is awesome!
# note to self: [[https://orgmode.org][org-mode]] is where I got the above info from

japhir avatar May 07 '21 13:05 japhir

this is probably because it's also not indicated as a link in any other way, so may be an upstream bug?

japhir avatar May 07 '21 13:05 japhir

Hey, @japhir!

Comments do not have children elements in the org-element API and org-appear cannot detect elements within a comment. The part of Org that hides links uses a different mechanism, though. If you M-x org-toggle-link-display in a buffer with your example text, the full link will be hidden.

awth13 avatar May 08 '21 13:05 awth13

There is a similar problem in the document title. #+title: Test [[id:7ef1a2d7-7847-415e-b777-b1eb583636e6][Test]]

wxxxcxx avatar May 11 '21 10:05 wxxxcxx

I also encountered the problem in normal org region for links. test

wowhxj avatar Jun 22 '21 03:06 wowhxj

@wowhxj, this looks like a different issue. I also can't reproduce it.

Would you mind telling me which version of Emacs/Org are you using and what is the value of org-appear-autolinks? How did you insert the link? Do you have any special configuration that affects Org links?

awth13 avatar Jun 22 '21 10:06 awth13

@wowhxj, this looks like a different issue. I also can't reproduce it.

Would you mind telling me which version of Emacs/Org are you using and what is the value of org-appear-autolinks? How did you insert the link? Do you have any special configuration that affects Org links?

I'm using GNU Emacs 27.2 with Org mode version 9.4.6 (9.4.6-4-g093c94-elpaplus).

The value of org-appear-autolinks is nil.

I use C-c C-l which stands for org-insert-link command to insert a URL link.

Following is the text of the link:

[[https://github.com/awth13/org-appear][org-appear]]

My configuration for org link is as following:

(setq org-return-follows-link nil)

(use-package ol
  :ensure nil
  :after org
  :custom
  (org-link-keep-stored-after-insertion t)
  (org-link-abbrev-alist '(("Arxiv"         . "https://arxiv.org/abs/")
                           ("GitHub"        . "https://github.com/")
                           ("GitLab"        . "https://gitlab.com/")
                           ("Google"        . "https://google.com/search?q=")
                           ("Baidu"         . "https://baidu.com/s?wd=")
                           ("RFCs"          . "https://tools.ietf.org/html/")
                           ("LWN"           . "https://lwn.net/Articles/")
                           ("StackOverflow" . "https://stackoverflow.com/q/%s")
                           ("WG21"          . "https://wg21.link/")
                           ("Wikipedia"     . "https://en.wikipedia.org/wiki/")
                           ("YouTube"       . "https://youtube.com/watch?v=")
                           ("Zhihu"         . "https://zhihu.com/question/"))))

wowhxj avatar Jun 23 '21 00:06 wowhxj

I tried to set org-appear-autolinks to t and solved the problem.

(use-package org-appear
  :ensure t
  :hook (org-mode . org-appear-mode)
  :custom
  (org-appear-autolinks t)
  )

test

I'm sorry that I didn't know that. Sorry for the inconvenience and thanks for the wonderful package. :-)

wowhxj avatar Jun 23 '21 02:06 wowhxj

@wowhxj, thank you for such a detailed response! I have to investigate this since, when org-appear-autolinks is nil, org-appear should not do anything with links. Your input is very useful.

I'm sorry that I didn't know that.

That's more of a call for me to improve the README :)

awth13 avatar Jun 23 '21 05:06 awth13