From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Ridolfi Subject: limitation: no tab in my headlines Date: Fri, 27 Jul 2012 09:54:50 +0100 (BST) Message-ID: <1343379290.23934.YahooMailNeo@web29804.mail.ird.yahoo.com> Reply-To: Giovanni Ridolfi Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SugKA-0002W8-F8 for emacs-orgmode@gnu.org; Fri, 27 Jul 2012 04:55:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SugJy-0006TV-Ab for emacs-orgmode@gnu.org; Fri, 27 Jul 2012 04:55:06 -0400 Received: from nm25-vm5.bullet.mail.ird.yahoo.com ([212.82.109.206]:23865) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SugJx-0006TL-O6 for emacs-orgmode@gnu.org; Fri, 27 Jul 2012 04:54:54 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Orgmode Hello everybody,=0A=0AOrg-mode version 7.8.11 (c8acf8d6957 @ =0AGNU Emacs 2= 4.1.1 (i386-mingw-nt6.1.7601) of 2012-06-10 on MARVIN=0A=0Awhile killing/ya= nking text from text files to my org file=0AI found this limitation: I cann= ot create a link to a headline=0Awhose text contains a tab.=0A=0AEditing a = file in Org will prevent to insert table in headlines:=0A(and this is a goo= d thing):=0A=0A* this is a tab,=A0 press tab=0A* I get the Message: EMPTY E= NTRY =0A=A0 this is text I press tab (the text got aligned)=0A=0A----------= -------------- let's import a different text file -----=0Athis is file a.tx= t=0Athis is a tab=A0=A0=A0 tab! (from 13 to 16)=0A-------------------------= -------------------------------=0Acopy last line, then transform that line = in headline:=0A=0A** this is a tab=A0=A0=A0 tab! (from 16 to 24)=0AI transf= ormed the line in a 2nd level headline with C-*=0Athen I try to create a li= nk to the 2nd level headline=0AC-l=0A:Messagge: Stored: this is a tab=A0=A0= =A0 tab! (from 13 to 16)=0ANow tab is from 32 to 40, ok=0A=0AThen I save th= e link C-c C-l=0Ain the message line I have the link to the headline withou= t tabs, but only with spaces:=0Afile:~/test.org::*this is a tab tab! (from = 13 to 16)=0A=0A=0AHowever tab is kept in the description part of the link:= =0A[[*this%20is%20a%20tab%20tab!%20(from%2013%20to%2016)][this is a tab=A0= =A0=A0 tab! (from 13 to 16)]]=0A=0AObviously this link does not refer to th= e headline=0AIf I click on it, since=0A=A0org-link-search-must-match-exact-= headline 'query-to-create=0AMessage is:=0A=0A"No match - create this as a n= ew heading? "=0A=0AIf I customize this variable useing fuzzy search, ("Its = value is nil")=0A=0Athe message is:=0Aif: No match=0A=0APlease, see the bac= ktrace below.=0A=0A=0A** Substituting tab with %20 does NOT work=0Aas it is= now=0A[[*this%20is%20a%20tab%20tab!%20(from%2013%20to%2016)][this is a tab= =A0=A0=A0 tab! (from 13 to 16)]]=0A=0A** Substituting tab with  =A0 do= es NOT work=0A=0A[[*this is a tab    &nb= sp;   tab! (from 13 to 16)][this=0A is a= tab=A0=A0=A0 tab! (from 13 to 16)]]=0A=0A** Substituting tab with %09 does= NOT work=0A%09 should be the URL Encode for tab [fn::http://www.tutorialsp= oint.com/html/html_url_encoding.htm]=0A=0A[[*this%20is%20a%20tab%09tab!%20(= from%2013%20to%2016)][this is a tab=A0=A0=A0 tab! (from 13 to 16)]]=0A=0A**= So =0AI know there's not tab in HTML [fn::http://htmltab.kb-creative.net/]= =0A=0AWhat is the best approach?=0A- a note in the documentation describing= the limitation =0A=0A- a patch to enable tabs in links (since it is a corn= er case I will not=0A=A0=A0 prod for it)=0A=0A- a note suggesting to use :I= D: property as the link is active=0A=A0 if it has a :ID:=A0 (see below)=0A= =0A** this is a tab=A0=A0=A0 tab! (from 16 to 24) with wizard-of-ID=0A:PROP= ERTIES:=0A:ID: wizard_of_id=0A:END:=0A=0A** link to wizard of id=0A=0A[[*th= is%20is%20a%20tab%20tab!%20(from%2016%20to%2024)%20with%20wizard-of-ID][thi= s=0A is a tab=A0=A0=A0 tab! (from 16 to 24) with wizard-of-ID]]=0A=0A=0A=A0= cheers, Giovanni =0A---------------------------------------------- Backtra= ce ---------------------------------=0A=0A=0A=A0 signal(error ("No match"))= =0A=A0 error("No match")=0A=A0 (if (or (and (org-search-not-self 1 re0 nil = t) (setq type (quote dedicated))) (org-search-not-self 1 re1 nil t) (org-se= arch-not-self 1 re2 nil t) (org-search-not-self 1 re2a nil t) (org-search-n= ot-self 1 re3 nil t) (org-search-not-self 1 re4 nil t) (org-search-not-self= 1 re5 nil t)) (goto-char (match-beginning 1)) (goto-char pos) (error "No m= atch"))=0A=A0 (cond ((eq type (quote org-occur)) (org-occur reall)) ((eq ty= pe (quote occur)) (org-do-occur (downcase reall) (quote cleanup))) (t (goto= -char (point-min)) (setq type (quote fuzzy)) (if (or (and (org-search-not-s= elf 1 re0 nil t) (setq type (quote dedicated))) (org-search-not-self 1 re1 = nil t) (org-search-not-self 1 re2 nil t) (org-search-not-self 1 re2a nil t)= (org-search-not-self 1 re3 nil t) (org-search-not-self 1 re4 nil t) (org-s= earch-not-self 1 re5 nil t)) (goto-char (match-beginning 1)) (goto-char pos= ) (error "No match"))))=0A=A0 (cond ((run-hook-with-args-until-success (quo= te org-execute-file-search-functions) s)) ((and (equal (string-to-char s0) = 35) (> (length s0) 1) (save-excursion (goto-char (point-min)) (and (re-sear= ch-forward (concat "^[ =A0=A0=A0 ]*:CUSTOM_ID:[ =A0=A0=A0 ]+" (regexp-quote= ...) "[ =A0=A0=A0 ]*$") nil t) (setq type (quote dedicated) pos (match-beg= inning 0)))) (goto-char pos) (org-back-to-heading t))) ((save-excursion (go= to-char (point-min)) (and (re-search-forward (concat "<<" (regexp-quote s0)= ">>") nil t) (setq type (quote dedicated) pos (match-beginning 0)))) (goto= -char pos)) ((save-excursion (goto-char (point-min)) (and (re-search-forwar= d (format "^[ =A0=A0=A0 ]*#\\+TARGET: %s" (regexp-quote s0)) nil t) (setq t= ype (quote dedicated) pos (match-beginning 0)))) (goto-char pos)) ((save-ex= cursion (goto-char (point-min)) (and (re-search-forward (format "^[ =A0=A0= =A0 ]*#\\+NAME: %s" (regexp-quote s0)) nil t) (setq type (quote dedicated) = pos (match-beginning 0)))) (goto-char pos)) ((and (string-match "^(\\(.*\\))$" s0) (save-excursion (g= oto-char (point-min)) (and (re-search-forward (concat "[^[]" (regexp-quote = ...)) nil t) (setq type (quote dedicated) pos (1+ (match-beginning 0)))))) = (goto-char pos)) ((string-match "^/\\(.*\\)/$" s) (cond ((derived-mode-p (q= uote org-mode)) (org-occur (match-string 1 s))) (t (org-do-occur (match-str= ing 1 s))))) ((and (derived-mode-p (quote org-mode)) org-link-search-must-m= atch-exact-headline) (and (equal (string-to-char s) 42) (setq s (substring = s 1))) (goto-char (point-min)) (cond ((let (case-fold-search) (re-search-fo= rward (format org-complex-heading-regexp-format (regexp-quote s)) nil t)) (= setq type (quote dedicated)) (goto-char (match-beginning 0))) ((and (not or= g-link-search-inhibit-query) (eq org-link-search-must-match-exact-headline = (quote query-to-create)) (y-or-n-p "No match - create this as a new heading= ? ")) (goto-char (point-max)) (or (bolp) (newline)) (insert "* " s "\n") (beginning-of-line 0)) (t (goto-char pos) (error "No match")))) (t (= when (equal (string-to-char s) 42) (setq pre "^\\*+[ =A0=A0=A0 ]+\\(?:\\sw+= \\)?[ =A0=A0=A0 ]*" post (org-re "[ =A0=A0=A0 ]*\\(?:[ =A0=A0=A0 ]+:[[:alnu= m:]_@#%:+]:[ =A0=A0=A0 ]*\\)?$") s (substring s 1))) (remove-text-propertie= s 0 (length s) (quote (face nil mouse-face nil keymap nil fontified nil)) s= ) (setq words (org-split-string s "[ \n=0A=A0=A0=A0 ]+") re0 (concat "\\(<<= " (regexp-quote s0) ">>\\)") re2 (concat markers "\\(" (mapconcat (quote do= wncase) words "[ =A0=A0=A0 ]+") "\\)" markers) re2a_ (concat "\\(" (mapconc= at (quote downcase) words "[ =A0=A0=A0 =0A\n]+") "\\)[ =A0=A0=A0 =0A\n]") r= e2a (concat "[ =A0=A0=A0 =0A\n]" re2a_) re4_ (concat "\\(" (mapconcat (quot= e downcase) words "[^a-zA-Z_=0A\n]+") "\\)[^a-zA-Z_]") re4 (concat "[^a-zA-= Z_]" re4_) re1 (concat pre re2 post) re3 (concat pre (if pre re4_ re4) post= ) re5 (concat pre ".*" re4) re2 (concat pre re2) re2a (concat pre (if pre r= e2a_ re2a)) re4 (concat pre (if pre re4_ re4)) reall (concat "\\(" re0 "\\)= \\|\\(" re1 "\\)\\|\\(" re2 "\\)\\|\\(" re3 "\\)\\|\\(" re4 "\\)\\|\\(" re5= "\\)")) (cond ((eq type (quote org-occur)) (org-occur reall)) ((eq type (q= uote occur)) (org-do-occur (downcase reall) (quote cleanup))) (t (goto-char= (point-min)) (setq type (quote fuzzy)) (if (or (and (org-search-not-self 1= re0 nil t) (setq type ...)) (org-search-not-self 1 re1 nil t) (org-search-= not-self 1 re2 nil t) (org-search-not-self 1 re2a nil t) (org-search-not-se= lf 1 re3 nil t) (org-search-not-self 1 re4 nil t) (org-search-not-self 1 re= 5 nil t)) (goto-char (match-beginning 1)) (goto-char pos) (error "No match"= ))))))=0A=A0 (let ((case-fold-search t) (s0 (mapconcat (quote identity) (or= g-split-string s "[ =A0=A0=A0 =0A\n]+") " ")) (markers (concat "\\(?:" (map= concat (lambda (x) (regexp-quote (car x))) (append (quote (... ... ... ...)= ) org-emphasis-alist) "\\|") "\\)")) (pos (point)) (pre nil) (post nil) wor= ds re0 re1 re2 re3 re4_ re4 re5 re2a re2a_ reall) (cond ((run-hook-with-arg= s-until-success (quote org-execute-file-search-functions) s)) ((and (equal = (string-to-char s0) 35) (> (length s0) 1) (save-excursion (goto-char (point= -min)) (and (re-search-forward (concat "^[ =A0=A0=A0 ]*:CUSTOM_ID:[ =A0=A0= =A0 ]+" ... "[ =A0=A0=A0 ]*$") nil t) (setq type (quote dedicated) pos (mat= ch-beginning 0)))) (goto-char pos) (org-back-to-heading t))) ((save-excursi= on (goto-char (point-min)) (and (re-search-forward (concat "<<" (regexp-quo= te s0) ">>") nil t) (setq type (quote dedicated) pos (match-beginning 0))))= (goto-char pos)) ((save-excursion (goto-char (point-min)) (and (re-search-= forward (format "^[ =A0=A0=A0 ]*#\\+TARGET: %s" (regexp-quote s0)) nil t) (= setq type (quote dedicated) pos (match-beginning 0)))) (goto-char pos)) ((save-excursion (goto-char (point= -min)) (and (re-search-forward (format "^[ =A0=A0=A0 ]*#\\+NAME: %s" (regex= p-quote s0)) nil t) (setq type (quote dedicated) pos (match-beginning 0))))= (goto-char pos)) ((and (string-match "^(\\(.*\\))$" s0) (save-excursion (g= oto-char (point-min)) (and (re-search-forward (concat "[^[]" ...) nil t) (s= etq type (quote dedicated) pos (1+ ...))))) (goto-char pos)) ((string-match= "^/\\(.*\\)/$" s) (cond ((derived-mode-p (quote org-mode)) (org-occur (mat= ch-string 1 s))) (t (org-do-occur (match-string 1 s))))) ((and (derived-mod= e-p (quote org-mode)) org-link-search-must-match-exact-headline) (and (equa= l (string-to-char s) 42) (setq s (substring s 1))) (goto-char (point-min)) = (cond ((let (case-fold-search) (re-search-forward (format org-complex-headi= ng-regexp-format ...) nil t)) (setq type (quote dedicated)) (goto-char (mat= ch-beginning 0))) ((and (not org-link-search-inhibit-query) (eq org-link-search-must-match-exact-headline (quote query-to-create)) (y-or-n= -p "No match - create this as a new heading? ")) (goto-char (point-max)) (o= r (bolp) (newline)) (insert "* " s "\n") (beginning-of-line 0)) (t (goto-ch= ar pos) (error "No match")))) (t (when (equal (string-to-char s) 42) (setq = pre "^\\*+[ =A0=A0=A0 ]+\\(?:\\sw+\\)?[ =A0=A0=A0 ]*" post (org-re "[ =A0= =A0=A0 ]*\\(?:[ =A0=A0=A0 ]+:[[:alnum:]_@#%:+]:[ =A0=A0=A0 ]*\\)?$") s (sub= string s 1))) (remove-text-properties 0 (length s) (quote (face nil mouse-f= ace nil keymap nil fontified nil)) s) (setq words (org-split-string s "[ \n= =0A=A0=A0=A0 ]+") re0 (concat "\\(<<" (regexp-quote s0) ">>\\)") re2 (conca= t markers "\\(" (mapconcat (quote downcase) words "[ =A0=A0=A0 ]+") "\\)" m= arkers) re2a_ (concat "\\(" (mapconcat (quote downcase) words "[ =A0=A0=A0 = =0A\n]+") "\\)[ =A0=A0=A0 =0A\n]") re2a (concat "[ =A0=A0=A0 =0A\n]" re2a_)= re4_ (concat "\\(" (mapconcat (quote downcase) words "[^a-zA-Z_=0A\n]+") "= \\)[^a-zA-Z_]") re4 (concat "[^a-zA-Z_]" re4_) re1 (concat pre re2 post) re= 3 (concat pre (if pre re4_ re4) post) re5 (concat pre ".*" re4) re2 (concat= pre re2) re2a (concat pre (if pre re2a_ re2a)) re4 (concat pre (if pre re4= _ re4)) reall (concat "\\(" re0 "\\)\\|\\(" re1 "\\)\\|\\(" re2 "\\)\\|\\("= re3 "\\)\\|\\(" re4 "\\)\\|\\(" re5 "\\)")) (cond ((eq type (quote org-occ= ur)) (org-occur reall)) ((eq type (quote occur)) (org-do-occur (downcase re= all) (quote cleanup))) (t (goto-char (point-min)) (setq type (quote fuzzy))= (if (or (and ... ...) (org-search-not-self 1 re1 nil t) (org-search-not-se= lf 1 re2 nil t) (org-search-not-self 1 re2a nil t) (org-search-not-self 1 r= e3 nil t) (org-search-not-self 1 re4 nil t) (org-search-not-self 1 re5 nil = t)) (goto-char (match-beginning 1)) (goto-char pos) (error "No match"))))))= (and (derived-mode-p (quote org-mode)) (not stealth) (org-show-context (qu= ote link-search))) type)=0A=A0 org-link-search(#("*this is a tab tab! (from= 13 to 16)" 0 35 (org-attr nil)) nil 1243)=0A=A0 eval((org-link-search #("*= this is a tab tab! (from 13 to 16)" 0 35 (org-attr nil)) nil 1243))=0A=A0 (= progn (widen) (eval cmd))=0A=A0 (condition-case nil (let ((org-link-search-= inhibit-query t)) (eval cmd)) (error (progn (widen) (eval cmd))))=0A=A0 (le= t ((cmd (\` (org-link-search (\, path) (\, (cond (... ...) (... ...) (t nil= ))) (\, pos))))) (condition-case nil (let ((org-link-search-inhibit-query t= )) (eval cmd)) (error (progn (widen) (eval cmd)))))=0A=A0 (cond ((assoc typ= e org-link-protocols) (funcall (nth 1 (assoc type org-link-protocols)) path= )) ((equal type "mailto") (let ((cmd (car org-link-mailto-program)) (args (= cdr org-link-mailto-program)) args1 (address path) (subject "") a) (if (str= ing-match "\\(.*\\)::\\(.*\\)" path) (setq address (match-string 1 path) su= bject (org-link-escape (match-string 2 path)))) (while args (cond ((not (st= ringp ...)) (push (pop args) args1)) (t (setq a (pop args)) (if (string-mat= ch "%a" a) (setq a ...)) (if (string-match "%s" a) (setq a ...)) (push a ar= gs1)))) (apply cmd (nreverse args1)))) ((member type (quote ("http" "https"= "ftp" "news"))) (browse-url (concat type ":" (if (org-string-match-p "[[:n= onascii:] ]" path) (org-link-escape path org-link-escape-chars-browser) pat= h)))) ((string=3D type "doi") (browse-url (concat org-doi-server-url (if (o= rg-string-match-p "[[:nonascii:] ]" path) (org-link-escape path org-link-es= cape-chars-browser) path)))) ((member type (quote ("message"))) (browse-url (concat type ":" path))) ((string=3D type "tags"= ) (org-tags-view arg path)) ((string=3D type "tree-match") (org-occur (conc= at "\\[" (regexp-quote path) "\\]"))) ((string=3D type "file") (if (string-= match "::\\([0-9]+\\)\\'" path) (setq line (string-to-number (match-string = 1 path)) path (substring path 0 (match-beginning 0))) (if (string-match "::= \\(.+\\)\\'" path) (setq search (match-string 1 path) path (substring path = 0 (match-beginning 0))))) (if (string-match "[*?{]" (file-name-nondirectory= path)) (dired path) (org-open-file path arg line search))) ((string=3D typ= e "shell") (let ((cmd path)) (if (or (and (not (string=3D org-confirm-shell= -link-not-regexp "")) (string-match org-confirm-shell-link-not-regexp cmd))= (not org-confirm-shell-link-function) (funcall org-confirm-shell-link-func= tion (format "Execute \"%s\" in shell? " (org-add-props cmd nil ... ...))))= (progn (message "Executing %s" cmd) (shell-command cmd)) (error "Abort")))= ) ((string=3D type "elisp") (let ((cmd path)) (if (or (and (not (string=3D o= rg-confirm-elisp-link-not-regexp "")) (string-match org-confirm-elisp-link-= not-regexp cmd)) (not org-confirm-elisp-link-function) (funcall org-confirm= -elisp-link-function (format "Execute \"%s\" as elisp? " (org-add-props cmd= nil ... ...)))) (message "%s =3D> %s" cmd (if (equal (string-to-char cmd) = 40) (eval (read cmd)) (call-interactively (read cmd)))) (error "Abort")))) = ((and (string=3D type "thisfile") (run-hook-with-args-until-success (quote = org-open-link-functions) path))) ((string=3D type "thisfile") (if arg (swit= ch-to-buffer-other-window (org-get-buffer-for-internal-link (current-buffer= ))) (org-mark-ring-push)) (let ((cmd (\` (org-link-search (\, path) (\, ...= ) (\, pos))))) (condition-case nil (let ((org-link-search-inhibit-query t))= (eval cmd)) (error (progn (widen) (eval cmd)))))) (t (browse-url-at-point)= ))=0A=A0 (save-current-buffer (set-buffer (or reference-buffer (current-buf= fer))) (if (string-match " +\\'" path) (setq path (replace-match "" t t pat= h))) (if (and org-link-translation-function (fboundp org-link-translation-f= unction)) (let ((tmp (funcall org-link-translation-function type path))) (s= etq type (car tmp) path (cdr tmp)))) (cond ((assoc type org-link-protocols)= (funcall (nth 1 (assoc type org-link-protocols)) path)) ((equal type "mail= to") (let ((cmd (car org-link-mailto-program)) (args (cdr org-link-mailto-p= rogram)) args1 (address path) (subject "") a) (if (string-match "\\(.*\\)::= \\(.*\\)" path) (setq address (match-string 1 path) subject (org-link-escap= e (match-string 2 path)))) (while args (cond ((not ...) (push ... args1)) (= t (setq a ...) (if ... ...) (if ... ...) (push a args1)))) (apply cmd (nrev= erse args1)))) ((member type (quote ("http" "https" "ftp" "news"))) (browse= -url (concat type ":" (if (org-string-match-p "[[:nonascii:] ]" path) (org-link-escape path org-link-escape-chars-browser) path)))) ((string=3D = type "doi") (browse-url (concat org-doi-server-url (if (org-string-match-p = "[[:nonascii:] ]" path) (org-link-escape path org-link-escape-chars-browser= ) path)))) ((member type (quote ("message"))) (browse-url (concat type ":" = path))) ((string=3D type "tags") (org-tags-view arg path)) ((string=3D type= "tree-match") (org-occur (concat "\\[" (regexp-quote path) "\\]"))) ((stri= ng=3D type "file") (if (string-match "::\\([0-9]+\\)\\'" path) (setq line (= string-to-number (match-string 1 path)) path (substring path 0 (match-begin= ning 0))) (if (string-match "::\\(.+\\)\\'" path) (setq search (match-strin= g 1 path) path (substring path 0 (match-beginning 0))))) (if (string-match = "[*?{]" (file-name-nondirectory path)) (dired path) (org-open-file path arg= line search))) ((string=3D type "shell") (let ((cmd path)) (if (or (and (n= ot ...) (string-match org-confirm-shell-link-not-regexp cmd)) (not org-confirm-shell-link-function) (funcall org-confirm-shell-link-function = (format "Execute \"%s\" in shell? " ...))) (progn (message "Executing %s" c= md) (shell-command cmd)) (error "Abort")))) ((string=3D type "elisp") (let = ((cmd path)) (if (or (and (not ...) (string-match org-confirm-elisp-link-no= t-regexp cmd)) (not org-confirm-elisp-link-function) (funcall org-confirm-e= lisp-link-function (format "Execute \"%s\" as elisp? " ...))) (message "%s = =3D> %s" cmd (if (equal ... 40) (eval ...) (call-interactively ...))) (erro= r "Abort")))) ((and (string=3D type "thisfile") (run-hook-with-args-until-s= uccess (quote org-open-link-functions) path))) ((string=3D type "thisfile")= (if arg (switch-to-buffer-other-window (org-get-buffer-for-internal-link (= current-buffer))) (org-mark-ring-push)) (let ((cmd (\` (org-link-search ...= ... ...)))) (condition-case nil (let ((org-link-search-inhibit-query t)) (= eval cmd)) (error (progn (widen) (eval cmd)))))) (t (browse-url-at-point)))= )=0A=A0 (with-current-buffer (or reference-buffer (current-buffer)) (if (st= ring-match " +\\'" path) (setq path (replace-match "" t t path))) (if (and = org-link-translation-function (fboundp org-link-translation-function)) (let= ((tmp (funcall org-link-translation-function type path))) (setq type (car = tmp) path (cdr tmp)))) (cond ((assoc type org-link-protocols) (funcall (nth= 1 (assoc type org-link-protocols)) path)) ((equal type "mailto") (let ((cm= d (car org-link-mailto-program)) (args (cdr org-link-mailto-program)) args1= (address path) (subject "") a) (if (string-match "\\(.*\\)::\\(.*\\)" path= ) (setq address (match-string 1 path) subject (org-link-escape (match-strin= g 2 path)))) (while args (cond ((not ...) (push ... args1)) (t (setq a ...)= (if ... ...) (if ... ...) (push a args1)))) (apply cmd (nreverse args1))))= ((member type (quote ("http" "https" "ftp" "news"))) (browse-url (concat t= ype ":" (if (org-string-match-p "[[:nonascii:] ]" path) (org-link-escape path org-link-escape-chars-browser) path)))) ((string=3D type "doi") (brow= se-url (concat org-doi-server-url (if (org-string-match-p "[[:nonascii:] ]"= path) (org-link-escape path org-link-escape-chars-browser) path)))) ((memb= er type (quote ("message"))) (browse-url (concat type ":" path))) ((string= =3D type "tags") (org-tags-view arg path)) ((string=3D type "tree-match") (= org-occur (concat "\\[" (regexp-quote path) "\\]"))) ((string=3D type "file= ") (if (string-match "::\\([0-9]+\\)\\'" path) (setq line (string-to-number= (match-string 1 path)) path (substring path 0 (match-beginning 0))) (if (s= tring-match "::\\(.+\\)\\'" path) (setq search (match-string 1 path) path (= substring path 0 (match-beginning 0))))) (if (string-match "[*?{]" (file-na= me-nondirectory path)) (dired path) (org-open-file path arg line search))) = ((string=3D type "shell") (let ((cmd path)) (if (or (and (not ...) (string-= match org-confirm-shell-link-not-regexp cmd)) (not org-confirm-shell-link-function) (funcall org-confirm-shell-link-function = (format "Execute \"%s\" in shell? " ...))) (progn (message "Executing %s" c= md) (shell-command cmd)) (error "Abort")))) ((string=3D type "elisp") (let = ((cmd path)) (if (or (and (not ...) (string-match org-confirm-elisp-link-no= t-regexp cmd)) (not org-confirm-elisp-link-function) (funcall org-confirm-e= lisp-link-function (format "Execute \"%s\" as elisp? " ...))) (message "%s = =3D> %s" cmd (if (equal ... 40) (eval ...) (call-interactively ...))) (erro= r "Abort")))) ((and (string=3D type "thisfile") (run-hook-with-args-until-s= uccess (quote org-open-link-functions) path))) ((string=3D type "thisfile")= (if arg (switch-to-buffer-other-window (org-get-buffer-for-internal-link (= current-buffer))) (org-mark-ring-push)) (let ((cmd (\` (org-link-search ...= ... ...)))) (condition-case nil (let ((org-link-search-inhibit-query t)) (= eval cmd)) (error (progn (widen) (eval cmd)))))) (t (browse-url-at-point)))= )=0A=A0 (let (type path link line search (pos (point))) (catch (quote match= ) (save-excursion (skip-chars-forward "^]\n=0A") (when (org-in-regexp org-b= racket-link-regexp 1) (setq link (org-extract-attributes (org-link-unescape= (org-match-string-no-properties 1)))) (while (string-match " *\n *" link) = (setq link (replace-match " " t t link))) (setq link (org-link-expand-abbre= v link)) (cond ((or (file-name-absolute-p link) (string-match "^\\.\\.?/" l= ink)) (setq type "file" path link)) ((string-match org-link-re-with-space3 = link) (setq type (match-string 1 link) path (match-string 2 link))) (t (set= q type "thisfile" path link))) (throw (quote match) t))) (when (get-text-pr= operty (point) (quote org-linked-text)) (setq type "thisfile" pos (if (get-= text-property (1+ (point)) (quote org-linked-text)) (1+ (point)) (point)) p= ath (buffer-substring (or (previous-single-property-change pos (quote org-l= inked-text)) (point-min)) (or (next-single-property-change pos (quote org-l= inked-text)) (point-max)))) (throw (quote match) t)) (save-excursion (when = (or (org-in-regexp org-angle-link-re) (org-in-regexp org-plain-link-re)) (setq type (match-string 1) path (org-l= ink-unescape (match-string 2))) (throw (quote match) t))) (save-excursion (= when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ =A0=A0=A0 ]*$")) (s= etq type "tags" path (match-string 1)) (while (string-match ":" path) (setq= path (replace-match "+" t t path))) (throw (quote match) t))) (when (org-i= n-regexp "<\\([^><\n]+\\)>") (setq type "tree-match" path (match-string 1))= (throw (quote match) t))) (unless path (error "No link found")) (with-curr= ent-buffer (or reference-buffer (current-buffer)) (if (string-match " +\\'"= path) (setq path (replace-match "" t t path))) (if (and org-link-translati= on-function (fboundp org-link-translation-function)) (let ((tmp (funcall or= g-link-translation-function type path))) (setq type (car tmp) path (cdr tmp= )))) (cond ((assoc type org-link-protocols) (funcall (nth 1 (assoc type org= -link-protocols)) path)) ((equal type "mailto") (let ((cmd (car org-link-mailto-program)) (args (cdr org-link-mailto-program)) args1 (addr= ess path) (subject "") a) (if (string-match "\\(.*\\)::\\(.*\\)" path) (set= q address (match-string 1 path) subject (org-link-escape ...))) (while args= (cond (... ...) (t ... ... ... ...))) (apply cmd (nreverse args1)))) ((mem= ber type (quote ("http" "https" "ftp" "news"))) (browse-url (concat type ":= " (if (org-string-match-p "[[:nonascii:] ]" path) (org-link-escape path org= -link-escape-chars-browser) path)))) ((string=3D type "doi") (browse-url (c= oncat org-doi-server-url (if (org-string-match-p "[[:nonascii:] ]" path) (o= rg-link-escape path org-link-escape-chars-browser) path)))) ((member type (= quote ("message"))) (browse-url (concat type ":" path))) ((string=3D type "= tags") (org-tags-view arg path)) ((string=3D type "tree-match") (org-occur = (concat "\\[" (regexp-quote path) "\\]"))) ((string=3D type "file") (if (st= ring-match "::\\([0-9]+\\)\\'" path) (setq line (string-to-number (match-string 1 path)) path (substring path 0 (match-beginning 0))) (if (s= tring-match "::\\(.+\\)\\'" path) (setq search (match-string 1 path) path (= substring path 0 ...)))) (if (string-match "[*?{]" (file-name-nondirectory = path)) (dired path) (org-open-file path arg line search))) ((string=3D type= "shell") (let ((cmd path)) (if (or (and ... ...) (not org-confirm-shell-li= nk-function) (funcall org-confirm-shell-link-function ...)) (progn (message= "Executing %s" cmd) (shell-command cmd)) (error "Abort")))) ((string=3D ty= pe "elisp") (let ((cmd path)) (if (or (and ... ...) (not org-confirm-elisp-= link-function) (funcall org-confirm-elisp-link-function ...)) (message "%s = =3D> %s" cmd (if ... ... ...)) (error "Abort")))) ((and (string=3D type "th= isfile") (run-hook-with-args-until-success (quote org-open-link-functions) = path))) ((string=3D type "thisfile") (if arg (switch-to-buffer-other-window= (org-get-buffer-for-internal-link (current-buffer))) (org-mark-ring-push)) (let ((cmd (\` ...))) (condition-case nil (let (...) (eval cmd)) (error (p= rogn ... ...))))) (t (browse-url-at-point)))))=0A=A0 (cond ((and (org-at-he= ading-p) (not (org-at-timestamp-p t)) (not (org-in-regexp (concat org-plain= -link-re "\\|" org-bracket-link-regexp "\\|" org-angle-link-re "\\|" "[ =A0= =A0=A0 ]:[^ =A0=A0=A0 \n]+:[ =A0=A0=A0 ]*$"))) (not (get-text-property (poi= nt) (quote org-linked-text)))) (or (org-offer-links-in-entry arg) (progn (r= equire (quote org-attach)) (org-attach-reveal (quote if-exists))))) ((run-h= ook-with-args-until-success (quote org-open-at-point-functions))) ((org-at-= timestamp-p t) (org-follow-timestamp-link)) ((and (or (org-footnote-at-refe= rence-p) (org-footnote-at-definition-p)) (not (org-in-regexp org-bracket-li= nk-regexp))) (org-footnote-action)) (t (let (type path link line search (po= s (point))) (catch (quote match) (save-excursion (skip-chars-forward "^]\n= =0A") (when (org-in-regexp org-bracket-link-regexp 1) (setq link (org-extra= ct-attributes ...)) (while (string-match " *\n *" link) (setq link ...)) (s= etq link (org-link-expand-abbrev link)) (cond (... ...) (... ...) (t ...)) = (throw (quote match) t))) (when (get-text-property (point) (quote org-linke= d-text)) (setq type "thisfile" pos (if (get-text-property ... ...) (1+ ...)= (point)) path (buffer-substring (or ... ...) (or ... ...))) (throw (quote = match) t)) (save-excursion (when (or (org-in-regexp org-angle-link-re) (org= -in-regexp org-plain-link-re)) (setq type (match-string 1) path (org-link-u= nescape ...)) (throw (quote match) t))) (save-excursion (when (org-in-regex= p (org-re "\\(:[[:alnum:]_@#%:]+\\):[ =A0=A0=A0 ]*$")) (setq type "tags" pa= th (match-string 1)) (while (string-match ":" path) (setq path ...)) (throw= (quote match) t))) (when (org-in-regexp "<\\([^><\n]+\\)>") (setq type "tr= ee-match" path (match-string 1)) (throw (quote match) t))) (unless path (error "No link found")) (with-current-buffer (or reference-buffer (curren= t-buffer)) (if (string-match " +\\'" path) (setq path (replace-match "" t t= path))) (if (and org-link-translation-function (fboundp org-link-translati= on-function)) (let ((tmp ...)) (setq type (car tmp) path (cdr tmp)))) (cond= ((assoc type org-link-protocols) (funcall (nth 1 ...) path)) ((equal type = "mailto") (let (... ... args1 ... ... a) (if ... ...) (while args ...) (app= ly cmd ...))) ((member type (quote ...)) (browse-url (concat type ":" ...))= ) ((string=3D type "doi") (browse-url (concat org-doi-server-url ...))) ((m= ember type (quote ...)) (browse-url (concat type ":" path))) ((string=3D ty= pe "tags") (org-tags-view arg path)) ((string=3D type "tree-match") (org-oc= cur (concat "\\[" ... "\\]"))) ((string=3D type "file") (if (string-match "= ::\\([0-9]+\\)\\'" path) (setq line ... path ...) (if ... ...)) (if (string= -match "[*?{]" ...) (dired path) (org-open-file path arg line search))) ((string=3D type "shell") (let (...) (if ... ... ...))) ((string=3D type "= elisp") (let (...) (if ... ... ...))) ((and (string=3D type "thisfile") (ru= n-hook-with-args-until-success ... path))) ((string=3D type "thisfile") (if= arg (switch-to-buffer-other-window ...) (org-mark-ring-push)) (let (...) (= condition-case nil ... ...))) (t (browse-url-at-point)))))))=0A=A0 (if (cal= l-interactively (function org-babel-open-src-block-result)) nil (org-load-m= odules-maybe) (move-marker org-open-link-marker (point)) (setq org-window-c= onfig-before-follow-link (current-window-configuration)) (org-remove-occur-= highlights nil nil t) (cond ((and (org-at-heading-p) (not (org-at-timestamp= -p t)) (not (org-in-regexp (concat org-plain-link-re "\\|" org-bracket-link= -regexp "\\|" org-angle-link-re "\\|" "[ =A0=A0=A0 ]:[^ =A0=A0=A0 \n]+:[ = =A0=A0=A0 ]*$"))) (not (get-text-property (point) (quote org-linked-text)))= ) (or (org-offer-links-in-entry arg) (progn (require (quote org-attach)) (o= rg-attach-reveal (quote if-exists))))) ((run-hook-with-args-until-success (= quote org-open-at-point-functions))) ((org-at-timestamp-p t) (org-follow-ti= mestamp-link)) ((and (or (org-footnote-at-reference-p) (org-footnote-at-def= inition-p)) (not (org-in-regexp org-bracket-link-regexp))) (org-footnote-ac= tion)) (t (let (type path link line search (pos (point))) (catch (quote match) (save-excursion (skip-chars-forward "^]\n=0A") (when (org-in= -regexp org-bracket-link-regexp 1) (setq link ...) (while ... ...) (setq li= nk ...) (cond ... ... ...) (throw ... t))) (when (get-text-property (point)= (quote org-linked-text)) (setq type "thisfile" pos (if ... ... ...) path (= buffer-substring ... ...)) (throw (quote match) t)) (save-excursion (when (= or ... ...) (setq type ... path ...) (throw ... t))) (save-excursion (when = (org-in-regexp ...) (setq type "tags" path ...) (while ... ...) (throw ... = t))) (when (org-in-regexp "<\\([^><\n]+\\)>") (setq type "tree-match" path = (match-string 1)) (throw (quote match) t))) (unless path (error "No link fo= und")) (with-current-buffer (or reference-buffer (current-buffer)) (if (str= ing-match " +\\'" path) (setq path (replace-match "" t t path))) (if (and o= rg-link-translation-function (fboundp org-link-translation-function)) (let = (...) (setq type ... path ...))) (cond ((assoc type org-link-protocols) (fu= ncall ... path)) ((equal type "mailto") (let ... ... ... ...)) ((member type ...) (browse-url ...)) ((string=3D type "doi") (br= owse-url ...)) ((member type ...) (browse-url ...)) ((string=3D type "tags"= ) (org-tags-view arg path)) ((string=3D type "tree-match") (org-occur ...))= ((string=3D type "file") (if ... ... ...) (if ... ... ...)) ((string=3D ty= pe "shell") (let ... ...)) ((string=3D type "elisp") (let ... ...)) ((and .= .. ...)) ((string=3D type "thisfile") (if arg ... ...) (let ... ...)) (t (b= rowse-url-at-point))))))) (move-marker org-open-link-marker nil) (run-hook-= with-args (quote org-follow-link-hook)))=0A=A0 (unless (call-interactively = (function org-babel-open-src-block-result)) (org-load-modules-maybe) (move-= marker org-open-link-marker (point)) (setq org-window-config-before-follow-= link (current-window-configuration)) (org-remove-occur-highlights nil nil t= ) (cond ((and (org-at-heading-p) (not (org-at-timestamp-p t)) (not (org-in-= regexp (concat org-plain-link-re "\\|" org-bracket-link-regexp "\\|" org-an= gle-link-re "\\|" "[ =A0=A0=A0 ]:[^ =A0=A0=A0 \n]+:[ =A0=A0=A0 ]*$"))) (not= (get-text-property (point) (quote org-linked-text)))) (or (org-offer-links= -in-entry arg) (progn (require (quote org-attach)) (org-attach-reveal (quot= e if-exists))))) ((run-hook-with-args-until-success (quote org-open-at-poin= t-functions))) ((org-at-timestamp-p t) (org-follow-timestamp-link)) ((and (= or (org-footnote-at-reference-p) (org-footnote-at-definition-p)) (not (org-= in-regexp org-bracket-link-regexp))) (org-footnote-action)) (t (let (type p= ath link line search (pos (point))) (catch (quote match) (save-excursion (skip-chars-forward "^]\n=0A") (when (org-in= -regexp org-bracket-link-regexp 1) (setq link ...) (while ... ...) (setq li= nk ...) (cond ... ... ...) (throw ... t))) (when (get-text-property (point)= (quote org-linked-text)) (setq type "thisfile" pos (if ... ... ...) path (= buffer-substring ... ...)) (throw (quote match) t)) (save-excursion (when (= or ... ...) (setq type ... path ...) (throw ... t))) (save-excursion (when = (org-in-regexp ...) (setq type "tags" path ...) (while ... ...) (throw ... = t))) (when (org-in-regexp "<\\([^><\n]+\\)>") (setq type "tree-match" path = (match-string 1)) (throw (quote match) t))) (unless path (error "No link fo= und")) (with-current-buffer (or reference-buffer (current-buffer)) (if (str= ing-match " +\\'" path) (setq path (replace-match "" t t path))) (if (and o= rg-link-translation-function (fboundp org-link-translation-function)) (let = (...) (setq type ... path ...))) (cond ((assoc type org-link-protocols) (fu= ncall ... path)) ((equal type "mailto") (let ... ... ... ...)) ((member type ...) (browse-url ...)) ((string=3D type "doi") (br= owse-url ...)) ((member type ...) (browse-url ...)) ((string=3D type "tags"= ) (org-tags-view arg path)) ((string=3D type "tree-match") (org-occur ...))= ((string=3D type "file") (if ... ... ...) (if ... ... ...)) ((string=3D ty= pe "shell") (let ... ...)) ((string=3D type "elisp") (let ... ...)) ((and .= .. ...)) ((string=3D type "thisfile") (if arg ... ...) (let ... ...)) (t (b= rowse-url-at-point))))))) (move-marker org-open-link-marker nil) (run-hook-= with-args (quote org-follow-link-hook)))=0A=A0 org-open-at-point()=0A=A0 or= g-open-at-mouse((mouse-2 (# 1243 (171 . 50) 5105819 n= il 1243 (19 . 3) nil (3 . 2) (8 . 16))))=0A=A0 call-interactively(org-open-= at-mouse nil nil)