In org-9 it might be as simple as this for file links:
: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.
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:
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 ...
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 ...
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:
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-...
For elisp that is certainly possible. The general strategy might be something like:
You could add a description if you wanted to also, e.g.
For other languages it wouldn't be that easy. You can make a link like this:
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 ...
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.
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?
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 ...
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-...
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))
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-...
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.
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
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 ...
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 ()
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))
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."
I think this is determined by firefox itself and can't be easily fixed by Emacs.
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 (...
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://...
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)))))
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.
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 ...
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 ...
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)
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.
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.