7

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.


6

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 ...


4

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 ...


3

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-...


3

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-...


3

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

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 ...


2

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)}}}


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

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 ...


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

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.


1

It seems you can set the variable org-export-with-broken-links: org-export-with-broken-links is a variable defined in ‘ox.el’. Its value is t Original value was nil Documentation: Non-nil means do not raise an error on broken links. When this variable is non-nil, broken links are ignored, without stopping the export process. If it is ...


1

You could use org-insert-link not totally interactively with (org-insert-link nil "other" "description") but that won't help. The following functions are a quick-and-dirty solution to update your org-links maintaining your descriptions and creating org-ids for headers, if needed. (defun adl/org-link-update () (interactive) (require 'org-id) (while (...


1

I am not sure how to use the org-capture framework, but something like this is close to what you ask for above. The idea is to use a hook function to check if your file exists and if not insert the content you want in it. You might want to add additional checks that it is an org file. (defun special-follow () (let ((current-element (org-element-context)) ...


1

Ignoring a lot of complexities (in particular, the possible presence of todo keywords etc. in the headings and what to do exactly when the file or the heading is not found), a very simple search function to follow this type of links could be something along the lines of (defun follow-org-heading-link (path) "Follow an org-heading link with PATH." (let* (...


1

I think this is determined by firefox itself and can't be easily fixed by Emacs. Firefox-side solution In about:config, toggle browser.tabs.loadDivertedInBackground from false to true. See also this stackoverflow question Outline of possible (ugly) alternatives Tweak your window-manager to make Emacs reclaim focus. In Emacs, define two new functions (...


1

You can use org-bracket-link-regexp for extracting the parts of bracket links: | link | description | |----------------------------------------+----------------------------| | [[http://blah.com/blah/blah/foo][foo]] | foo | | [[http://missing.description]] | http://...


1

I think this is a backend specific "feature". I see what you see (the extra space) for html and latex export, but not for ascii export. I think you can use a filter to eliminate the space like this: (let ((org-export-filter-link-functions '((lambda (txt _ _) (if (string= txt " ") "" txt))))) (org-html-export-as-html))


1

You can scroll the window using set-window-vscroll, but image-mode (the package pdf-view uses to display the page) will reset it soon after. Also, Emacs may just ignore your request, if the image is not larger than the window. So, it does not look good.


1

from the org-ref manual: Controlling link messages and tooltips Org-ref is setup to provide messages in the minibuffer when your cursor is on a link, and tooltips when your mouse hovers over a link. If this is distracting you can turn it off by putting this in your init file: (setq org-ref-show-citation-on-enter nil) Alternatively, you can turn this on ...


1

Out-of-the-box (i.e. with org-contrib), it seems to be possible with, say, info links (where you can link to a specific section, as info:filename#nodename-or-index), but not with man links. Looking at the source corroborates that: info, man. In principle, there is no reason why you couldn't define your own org link handler, based on org-man linked above. In ...


1

yes, but you have to do it for each link. Assuming you are using org 9, you can do it like this in an init file, or in an elisp src block in your org-file: (org-link-set-parameters "cite" :export 'some-new-export-function)


1

I believe this is essentially what you want: ;; Set directory of files to search for *.org files (setq autolinks-mode-dir "/Users/jkitchin/vc/journal/2018/08/07/") ;; Get all .org files in this directory. (setq autolinks-mode-files (directory-files autolinks-mode-dir t "[.]org\\'")) ;; Convert it to a list of just the filenames, without paths. (setq ...


1

file+sys:image.png should open with the system application.


1

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.


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