From aafc864bcb267a7b45a7c0c3ad2a0fd06de3a1fb Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 20 Oct 2016 00:21:38 -0400 Subject: org-open-file-at-point: Support \includegraphics "includegraphics" may not be part of the text returned by thing-at-point if includegraphics is passed options. --- lisp/km-org.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lisp') diff --git a/lisp/km-org.el b/lisp/km-org.el index 9f7c8f8..9cc1ff5 100644 --- a/lisp/km-org.el +++ b/lisp/km-org.el @@ -654,6 +654,14 @@ to be easily overriden.") (buffer-substring-no-properties (region-beginning) (region-end))) (thing-at-point 'filename)))) + (when (and file + (derived-mode-p 'latex-mode) + (string-match (rx (zero-or-one "includegraphics") + "{" + (group (one-or-more not-newline)) + "}") + file)) + (setq file (match-string-no-properties 1 file))) (if (and file (file-exists-p file)) (org-open-file file) (km/org-open-file))))) -- cgit v1.2.3