mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 00:32:54 +00:00
Patch by Jan Böker. Jan writes: > What is this? > ============= > > This patch changes the way extension regexps in `org-file-apps' are > handled. Instead of against the file name, the regexps are now matched > against the whole link, and you can use grouping to extract link > parameters which you can then use in a command string to be executed. > > For example, to allow linking to PDF files using the syntax > file:/doc.pdf::<page number>, you can add the following entry to > org-file-apps: > > Extension: \.pdf::\([0-9]+\)\' > Command: evince "%s" -p %1 > > In a command string to be executed, the parameters can be referenced > using %1, %2, etc. Lisp forms can access them using (string-match n link). > > > Where to get it? > ================ > Either apply the patch by hand or > > git pull git://github.com/jboecker/org-mode.git org-file-apps-parameters > > > What's next? / Feedback > ======================= > > - Find the bugs. Since this messes with links, a central concept of Org, > I probably have missed some edge cases; so please test this and > report if it works for you. > > I also appreciate any feedback on code quality or the design decisions > made. I am learning elisp along the way, so you may be able to write > some changes in a more idiomatic and/or elegant way. > > - Add a mechanism for org-mode modules to add default values to > org-file-apps, similar to the variables org-file-apps-defaults-*. > This could be used by modules to define their own extensions to the > syntax of file: links. > > - Modify org-docview.el to use this and deprecate the docview: link syntax. > > > What does it (intentionally) break? > =================================== > > This patch introduces a backwards-incompatible change. If LINE or SEARCH > is given, the file is no longer guaranteed to open in emacs: if IN-EMACS > is nil and an entry in org-file-apps matches, that takes precedence. > > A grep of the lisp/ and contrib/ directories showed that no code in the > org-mode distribution was relying on this behaviour; whereever LINE or > SEARCH is given, IN-EMACS is also set to t. > > I decided against adding an additional parameter because that would be > redundant; the original link as seen by org-open-at-point can be > reconstructed from PATH, LINE and SEARCH. > > I am not that sure if this is the right way to do this, but it seems to > break as little as possible while hopefully avoiding to add too much > complexity. |
||
---|---|---|
.. | ||
ChangeLog | ||
ChangeLog.01 | ||
org-agenda.el | ||
org-archive.el | ||
org-ascii.el | ||
org-attach.el | ||
org-bbdb.el | ||
org-beamer.el | ||
org-bibtex.el | ||
org-clock.el | ||
org-colview-xemacs.el | ||
org-colview.el | ||
org-compat.el | ||
org-crypt.el | ||
org-ctags.el | ||
org-datetree.el | ||
org-docbook.el | ||
org-docview.el | ||
org-exp-blocks.el | ||
org-exp.el | ||
org-faces.el | ||
org-feed.el | ||
org-footnote.el | ||
org-freemind.el | ||
org-gnus.el | ||
org-habit.el | ||
org-html.el | ||
org-icalendar.el | ||
org-id.el | ||
org-indent.el | ||
org-info.el | ||
org-inlinetask.el | ||
org-irc.el | ||
org-jsinfo.el | ||
org-latex.el | ||
org-list.el | ||
org-mac-message.el | ||
org-macs.el | ||
org-mew.el | ||
org-mhe.el | ||
org-mobile.el | ||
org-mouse.el | ||
org-plot.el | ||
org-protocol.el | ||
org-publish.el | ||
org-remember.el | ||
org-rmail.el | ||
org-src.el | ||
org-table.el | ||
org-timer.el | ||
org-vm.el | ||
org-w3m.el | ||
org-wl.el | ||
org-xoxo.el | ||
org.el |