0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 00:32:54 +00:00
org-mode/lisp
Carsten Dominik 75563bf71e Allow regexps in org-file-apps to capture link parameters using groups
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.
2010-03-21 18:10:00 +01:00
..
ChangeLog Allow regexps in org-file-apps to capture link parameters using groups 2010-03-21 18:10:00 +01:00
ChangeLog.01 Split ChangeLog file into parts. 2008-05-08 08:16:38 +02:00
org-agenda.el Fix time extraction when inserting diary entries with `i d' 2010-03-18 06:36:49 +01:00
org-archive.el Archiving: Allow to reverse order in target node 2010-03-11 07:23:03 +01:00
org-ascii.el ASCII export: Remove narrowing of columns for export 2010-02-12 18:48:16 +01:00
org-attach.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-bbdb.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-beamer.el beamer: Add custom options to an outline frame. 2010-03-04 21:55:18 +01:00
org-bibtex.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-clock.el Refactor some functions in clocking 2010-03-09 17:10:15 +01:00
org-colview-xemacs.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-colview.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-compat.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-crypt.el Make `org-reveal' also decrypt encrypted entries 2010-03-21 08:16:08 +01:00
org-ctags.el Bug fixes in org-ctags.el 2010-01-18 08:21:33 +01:00
org-datetree.el Fix typo 2010-01-23 22:47:47 +01:00
org-docbook.el Docbook exporter: Fix problems with exporting footnotes and empty lines 2010-03-08 19:43:34 +01:00
org-docview.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-exp-blocks.el babel: greatly simplified block exportation 2010-02-09 19:09:19 -07:00
org-exp.el HTML export: Fix problem with table attributes when first table line is special 2010-03-11 12:27:42 +01:00
org-faces.el Implement a simpler way to specify faces for tags and todo keywords 2010-02-25 16:41:28 +01:00
org-feed.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-footnote.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-freemind.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-gnus.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-habit.el Fix habit alignment problems 2010-01-31 17:51:49 +01:00
org-html.el HTML export: Fix linking to targets in external files 2010-03-19 18:04:23 +01:00
org-icalendar.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-id.el Fix bug when there is no hast for id locations 2010-02-26 19:51:15 +01:00
org-indent.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-info.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-inlinetask.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-irc.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-jsinfo.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-latex.el No extra newline after time planning line 2010-03-19 19:51:58 +01:00
org-list.el Fix cursor position after changing bullet types 2010-03-17 16:11:13 +01:00
org-mac-message.el Fix bug with insertion of date lines into a tree from the agenda 2010-02-01 14:30:36 +01:00
org-macs.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-mew.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-mhe.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-mobile.el Remove comma after means in many docstrings 2010-01-21 16:15:40 +01:00
org-mouse.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-plot.el plot: handles option lines starting after column 0 2010-03-01 08:22:18 -07:00
org-protocol.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-publish.el Publishing: Run the after-export-hook 2010-03-04 21:11:08 +01:00
org-remember.el Remember: Allow to file as sibling of current clock 2010-02-24 10:35:28 +01:00
org-rmail.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-src.el Re-install the support for table.el tables again. 2010-02-26 22:33:49 +01:00
org-table.el Tables: Introduce field coordinates for formulas, improve docs 2010-03-14 13:11:17 +01:00
org-timer.el Update org-timer.el so that we only allow one timer. 2010-02-25 16:03:38 +01:00
org-vm.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-w3m.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-wl.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org-xoxo.el Version number to 6.34trans 2010-01-20 10:13:21 +01:00
org.el Allow regexps in org-file-apps to capture link parameters using groups 2010-03-21 18:10:00 +01:00