[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] links-9.0 v3
From: |
Nicolas Goaziou |
Subject: |
Re: [O] links-9.0 v3 |
Date: |
Mon, 18 Jul 2016 14:02:20 +0200 |
John Kitchin <address@hidden> writes:
> What do you think of this approach:
>
> (defcustom org-link-parameters
> - '(("file" :complete 'org-file-complete-link)
> - ("file+emacs" :follow (lambda (path) (org-open-file path '(4))))
> - ("file+sys" :follow (lambda (path) (org-open-file path 'system)))
> + '(("file" :complete #'org-file-complete-link)
> + ("file+emacs" :follow (lambda (path) (org-open-file-link path '(4))))
> + ("file+sys" :follow (lambda (path) (org-open-file-link path 'system)))
It could work, but I suggest to rename it `org--open-file-link' or some
such, i.e., make it an internal function, because it could be confusing
with `org-open-link-from-string'.
> ("http") ("https") ("ftp") ("mailto")
> ("news") ("shell") ("elisp")
> ("doi") ("message") ("help"))
> @@ -10732,6 +10732,30 @@ they must return nil.")
>
> (defvar org-link-search-inhibit-query nil) ;; dynamically scoped
> (defvar clean-buffer-list-kill-buffer-names) ; Defined in midnight.el
> +
> +(defun org-open-file-link (path app)
> + "Open PATH using APP.
> +
> +PATH is from a file link, and can have the following
missing "syntax"?
> + [[file:~/code/main.c::255]]
> + [[file:~/xx.org::My Target]]
> + [[file:~/xx.org::*My Target]]
> + [[file:~/xx.org::#my-custom-id]]
> + [[file:~/xx.org::/regexp/]]
> +
> +APP is '(4) to open the PATH in Emacs, or 'system to use a system
> application."
> + (let* ((fields (split-string path "::"))
> + (option (when (cdr fields)
> + (mapconcat 'identity (cdr fields) ""))))
(and (cdr field)
(mapconcat #'identity (cdr fields) ""))
> + (apply #'org-open-file
> + (car fields)
> + app
> + (cond ((not option) nil)
> + ((org-string-match-p "\\`[0-9]+\\'" option)
org-string-match-p -> string-match-p
Regards,
- Re: [O] links-9.0 v3, (continued)
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/06
- Re: [O] links-9.0 v3, Nicolas Goaziou, 2016/07/07
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/07
- Re: [O] links-9.0 v3, Nicolas Goaziou, 2016/07/07
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/07
- Re: [O] links-9.0 v3, Nicolas Goaziou, 2016/07/08
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/07
- Re: [O] links-9.0 v3, Nicolas Goaziou, 2016/07/08
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/08
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/09
- Re: [O] links-9.0 v3,
Nicolas Goaziou <=
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/14
- Re: [O] links-9.0 v3, Nicolas Goaziou, 2016/07/18
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/18
- Re: [O] links-9.0 v3, Nicolas Goaziou, 2016/07/18
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/18
- Re: [O] links-9.0 v3, Nicolas Goaziou, 2016/07/18
- Re: [O] links-9.0 v3, John Kitchin, 2016/07/18