11

Customize the variable org-id-link-to-org-use-id and set it to t (AKA Create ID to make link). Then when you do C-cl (i.e. org-store-link), an ID property will be added to the headline with a UUID as value. When you save the link somewhere else (perhaps in another file) with C-cC-l (i.e. org-insert-link), the link will appear like this: [[id:b7b07a14-5dbb-...


9

The variable you need to customize is org-link-file-path-type. It doesn't appear in the org manual, but it's documentation is available via C-h v: Documentation: How the path name in file links should be stored. Valid values are: relative Relative to the current directory, i.e. the directory of the file into which the link is being ...


8

In org-9 it might be as simple as this for file links: (org-link-set-parameters "file" :face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning))) For internal links I don't know an easy way to do it.


7

The abbreviated link type can easily be defined with org-set-link-parameters. That handles url's like yt:<video ID> but not image overlays for org links like [[https://youtu.be/<video ID>][http://img.youtube.com/vi/<video ID>/0.jpg]]. The regular expression for image overlays is hard-coded in org-display-inline-images. Thus you need to ...


5

It can be be done using a macro: #+MACRO: imglnk @@html:<a href="$1"><img src="$2"></a>@@ This is an image link: {{{imglnk(path-to-file,path-to-image)}}}


5

Using the suggested global binding C-c l for storing a link when you are visiting any file (not just an org-mode file) and the one for inserting a link into an org file, C-c C-l, should work fine. It does not do the elisp find-function bit that John Kitchin describes in his answer, but it should be adequate for almost all situations. But you need org-context-...


5

For elisp that is certainly possible. The general strategy might be something like: [[elisp:(find-function 'describe-function)]] You could add a description if you wanted to also, e.g. [[elisp:(find-function 'describe-function)][describe-function]] For other languages it wouldn't be that easy. You can make a link like this: [[file:~/vc/projects/neural-...


3

Disclaimer: I'm not an org user. The #+INCLUDE command requires valid file names in Emacs. If you want to include a remote file, you better use Tramp file names. However, if you enable URL Handler Mode (apply (url-handler-mode 1) ), your #+INCLUDE command shall work.


3

Links in org-files are font-locked by function org-activate-links. That function also looks for "fuzzy" link types in the alist org-link-parameters. So we are lucky and can also use org-link-set-parameters for fuzzy links. As discussed in the comments to the question org-link-search can be exploited to search for fuzzy link targets. One has to take several ...


3

Org Mode already supports embedding images in exported HTML. The inline preview functionality does not work for remote images (i.e. those found on the internet). See the question about this. Preview does work for local images, as I think you already know.


3

A capture template can contain arbitrary elisp code using the %(...) syntax. We just need a function that takes a string (which will be the region you are capturing) and strips the comment characters. The only fussy thing is learning what the comment start character is. This function runs in the capture buffer, not the original one so we have to jump back ...


3

tl;dr: do M-x customize-variable for the variable help-at-pt-display-when-idle and set its value to t. (Or "always", which is what the Customize buffer says.) What was initially confusing here is that there's the mouse pointer, and also the cursor (which here on emacs.sx we call point). As mentioned above, org-mode by default sets the :help-echo property ...


3

In literal examples, Org interprets strings like (ref:name) as labels, and use them as targets for special hyperlinks like [[(name)]] (...) You can also add a -r switch which removes the labels from the source code. See [[(jump)]]. #+begin_src emacs-lisp -r (let ((x 1)) (ref:jump) (print x)) #+end_src


3

You can use Radio Links for this. I use them quite a bit. Here's an excerpt with an example from the org-mode manual. For example, a target <<<My Target>>> causes each occurrence of ‘my target’ in normal text to become activated as a link. I found some more answers in another stack exchange answer. In this one a glossary is included as ...


3

There is. See (info "(org) External Links"): [[help:princ]]


2

I just saw this new emacs package org-super-links that allows backlinks creation. Usage example: * Section A :PROPERTIES: :ID: 6a63d1d9-d361-4586-9315-6f7cb98ab2ef :END: :BACKLINKS: [2020-04-12 Sun 11:42] <- [[id:0c924010-a1cb-4f01-b4af-05a33ce588fe][Section B]] :END: * Section B :PROPERTIES: :ID: 0c924010-a1cb-4f01-b4af-...


2

There is org-docview which allows you to create usual org-links to documents open in docview-mode. Using C-c l you can store a link and using C-c C-l you can insert it. I would actually suggest using pdf-tools with org-pdfview. Both are on melpa and on github.


2

Try writing your links in the Org document as [[thing][thing]]. This will create the link with the expected name.


2

What I've noticed is that if you place the cursor on the first character and then do C-b followed by C-f (or just C-b if you're at the beginning of a buffer), what you type afterwards will be prepended to the link (and not be part of it). Does this answer your question?


2

In your current settings the line (sh-mode . emacs) is not valid. Documentation states that only following entries: string, directory, remote, auto-mode, t and system are allowed. This means if your shell-scripts do not have a special filename pattern you have to work around. To work around you could: A) add, at the end of org-file-apps alist (after (auto-...


2

Have you tried using org-link-unescape to get back the original filename? Something like: :face '(lambda (path) (if (file-exists-p (org-link-unescape path)) '(:foreground "green") '(:foreground "red"))))


2

Error is caused by this quote: # -*- browse-url-browser-function: 'browse-url-chromium -*- ___________________________________| It shouldn't be there. Open video path in MPV on *nix OS's Add this line to the init file(.emacs), or evaluate in Scratch buffer (org-add-link-type "mpv" (lambda (path) (browse-url-xdg-open path))) browse-url-xdg-open uses xdg-...


2

You can use org-link-set-parameters to define your own link types as demonstrated in the following Elisp snippet. The snippet contains a function my-org-open-file which opens the file given as org file link target. If the file name is relative and if the file with that name does not exist my-org-open-file tries to find an existing file by expanding the file ...


2

It appears that the function to call to browse a link in an org-mode file is org-open-at-point which is bound to C-c C-o. Edit: Regarding the follow-up question about opening an org-mode link in a secondary browser, using another function seems to work: (defun org-open-at-point-with-firefox () (interactive) ...


2

I think you need to put a name on the block like this: * Heading Some text ** Subheading some text #+name: Lorem #+BEGIN_PROSE Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. #+END_PROSE some text * Heading with link to Lorem Here is the link: [[Lorem]].


2

Something like this perhaps: (defun sw-org-unfold-headline-maybe () (when (eq (car (org-element-at-point)) 'headline) (org-show-subtree))) (add-hook 'org-follow-link-hook #'sw-org-unfold-headline-maybe) The hook runs the function after the link has been followed and the function checks that it's at a headline before it unfolds it. There may be some ...


2

Emacs lisp newbie here. As far as I know there are two ways to change this behaviour without changing Org's source code: either a custom link type, or an advice around org-link-open (see (elisp) Advising Functions). Custom link type I've opted for the former, as the latter changed between Org versions (you need an advice around org-link-open in Org 9.3.6 an ...


2

You can execute arbitrary elisp code from a link: [[elisp:(message "Hello")][Greeting]] Clicking on the link runs the code and you get a greeting in the echo area. All you have to do is figure out what code to run. The first step is to find out the keybinding of C-h f, so do C-h c C-h f RET and you see that C-h f is bound to the command describe-...


2

You just need to set (setq org-return-follows-link t) in your init file (or use the Customize interface to do the same). Check also org-tab-follows-link and org-mouse-1-follows-link. EDIT: Actually, do not change org-tab-follows-link - just read its doc string with C-h v org-tab-follows-link and heed its pronouncements :-)


2

This should do it. (defun foo () (interactive) (add-hook 'next-error-hook 'toto) (let ((thisbuf (current-buffer))) (next-error) (switch-to-buffer thisbuf)) (remove-hook 'next-error-hook 'toto)) (defun toto () (message "Current buffer: %s" (current-buffer)) (org-store-link nil)) It fixes three problems: (current-buffer) ...


Only top voted, non community-wiki answers of a minimum length are eligible