From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Links in node-property Date: Sat, 01 Mar 2014 22:11:48 +0100 Message-ID: <87bnxp8vzf.fsf@bzg.ath.cx> References: <87d2i5pt39.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJrCQ-0006vB-Bh for emacs-orgmode@gnu.org; Sat, 01 Mar 2014 16:12:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJrCK-0001Tc-Vj for emacs-orgmode@gnu.org; Sat, 01 Mar 2014 16:11:58 -0500 Received: from rs249.mailgun.us ([209.61.151.249]:44168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJrCK-0001TV-O4 for emacs-orgmode@gnu.org; Sat, 01 Mar 2014 16:11:52 -0500 In-Reply-To: <87d2i5pt39.fsf@gmail.com> (Nicolas Goaziou's message of "Sat, 01 Mar 2014 21:22:18 +0100") 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: Nicolas Goaziou Cc: Michael Brand , Org Mode --=-=-= Content-Type: text/plain Hi Nicolas, Nicolas Goaziou writes: > Michael Brand writes: > >> Will org-open-at-point still support links in node-property? > > No. According to Org syntax, there are no links in property drawers. > There are also no links in comments, example blocks, fixed-width > areas... Believe me, there *are* links in comments, I can see them :) Right now, hitting C-c C-o on this link # http://orgmode.org in an org-mode buffer produces the attached backtrace, which is a problem /per se/ (easily fixable, I guess.) Anyway, not supporting links in comments does not feel right, as links in comments are both frequent and useful. I'm sorry for the frustration it will inevitably create, but at this stage I suggest to simply revert the commits related to the rewriting of `org-open-at-point'. To my knowledge, there is no bug that this rewrite fixes, there is no gain in speed, and only a regression (not opening the next link) and a bug (see `org-agenda-open-link'.) What do you think? --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=link-in-comment.txt Content-Transfer-Encoding: quoted-printable Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) =3D(55 nil) (let ((end (org-element-property :end context))) (=3D (save-excursion (if= (invisible-p (point)) (progn (goto-char (next-single-property-change (poin= t) (quote invisible) nil end)))) (skip-chars-forward " " end) (point)) end= )) (cond ((and (memq type (quote (headline inlinetask))) (progn (save-excurs= ion (beginning-of-line) (looking-at org-complex-heading-regexp)) (or (not (= match-beginning 5)) (< (point) (match-beginning 5))))) (let* ((data (org-of= fer-links-in-entry (current-buffer) (point) arg)) (links (car data)) (links= -end (cdr data))) (if links (let ((--dolist-tail-- (if ... ... links)) link= ) (while --dolist-tail-- (setq link (car --dolist-tail--)) (search-forward = link nil links-end) (goto-char (match-beginning 0)) (org-open-at-point) (se= tq --dolist-tail-- (cdr --dolist-tail--)))) (require (quote org-attach)) (o= rg-attach-reveal (quote if-exists))))) ((let ((end (org-element-property :e= nd context))) (=3D (save-excursion (if (invisible-p (point)) (progn (goto-c= har ...))) (skip-chars-forward " " end) (point)) end)) (user-error "No lin= k found")) ((eq type (quote timestamp)) (org-follow-timestamp-link)) ((and = (memq type (quote (headline inlinetask))) (progn (save-excursion (beginning= -of-line) (looking-at org-complex-heading-regexp)) (and (match-beginning 5)= (>=3D (point) (match-beginning 5))))) (org-tags-view arg (substring (match= -string 5) 0 -1))) ((eq type (quote link)) (let ((type (org-element-propert= y :type context)) (path (org-element-property :path context))) (save-curren= t-buffer (set-buffer (or reference-buffer (current-buffer))) (cond ((equal = type "file") (if (string-match "[*?{]" ...) (dired path) (apply ... path ar= g ...))) ((assoc type org-link-protocols) (funcall (nth 1 ...) path)) ((equ= al type "help") (let (...) (cond ... ... ...))) ((equal type "mailto") (let= (... ... ... final-args) (apply cmd ...))) ((member type (quote ...)) (bro= wse-url (org-link-escape-browser ...))) ((equal type "doi") (browse-url (or= g-link-escape-browser ...))) ((equal type "message") (browse-url (concat ty= pe ":" path))) ((equal type "shell") (let (... ...) (if ... ... ...))) ((eq= ual type "elisp") (let (...) (if ... ... ...))) ((equal type "id") (require= (quote ord-id)) (funcall (nth 1 ...) path)) ((member type (quote ...)) (if= (run-hook-with-args-until-success ... path) nil (if ... ... ...) (let ... = ...))) (t (browse-url-at-point)))))) ((or (eq type (quote footnote-referenc= e)) (and (eq type (quote footnote-definition)) (save-excursion (skip-chars-= forward " ") (let ((begin ...)) (if begin (< ... begin) (=3D ... ...))))))= (org-footnote-action)) (t (user-error "No link found"))) (let* ((context (org-element-context)) type) (while (and (not (memq (setq= type (org-element-type context)) (quote (headline inlinetask link footnote= -definition footnote-reference timestamp)))) (setq context (org-element-pro= perty :parent context)))) (cond ((and (memq type (quote (headline inlinetas= k))) (progn (save-excursion (beginning-of-line) (looking-at org-complex-hea= ding-regexp)) (or (not (match-beginning 5)) (< (point) (match-beginning 5))= ))) (let* ((data (org-offer-links-in-entry (current-buffer) (point) arg)) (= links (car data)) (links-end (cdr data))) (if links (let ((--dolist-tail-- = ...) link) (while --dolist-tail-- (setq link ...) (search-forward link nil = links-end) (goto-char ...) (org-open-at-point) (setq --dolist-tail-- ...)))= (require (quote org-attach)) (org-attach-reveal (quote if-exists))))) ((le= t ((end (org-element-property :end context))) (=3D (save-excursion (if (inv= isible-p ...) (progn ...)) (skip-chars-forward " " end) (point)) end)) (us= er-error "No link found")) ((eq type (quote timestamp)) (org-follow-timesta= mp-link)) ((and (memq type (quote (headline inlinetask))) (progn (save-excu= rsion (beginning-of-line) (looking-at org-complex-heading-regexp)) (and (ma= tch-beginning 5) (>=3D (point) (match-beginning 5))))) (org-tags-view arg (= substring (match-string 5) 0 -1))) ((eq type (quote link)) (let ((type (org= -element-property :type context)) (path (org-element-property :path context= ))) (save-current-buffer (set-buffer (or reference-buffer (current-buffer))= ) (cond ((equal type "file") (if ... ... ...)) ((assoc type org-link-protoc= ols) (funcall ... path)) ((equal type "help") (let ... ...)) ((equal type "= mailto") (let ... ...)) ((member type ...) (browse-url ...)) ((equal type "= doi") (browse-url ...)) ((equal type "message") (browse-url ...)) ((equal t= ype "shell") (let ... ...)) ((equal type "elisp") (let ... ...)) ((equal ty= pe "id") (require ...) (funcall ... path)) ((member type ...) (if ... nil .= .. ...)) (t (browse-url-at-point)))))) ((or (eq type (quote footnote-refere= nce)) (and (eq type (quote footnote-definition)) (save-excursion (skip-char= s-forward " ") (let (...) (if begin ... ...))))) (org-footnote-action)) (t= (user-error "No link found")))) (if (run-hook-with-args-until-success (quote org-open-at-point-functions)= ) nil (let* ((context (org-element-context)) type) (while (and (not (memq (= setq type (org-element-type context)) (quote (headline inlinetask link foot= note-definition footnote-reference timestamp)))) (setq context (org-element= -property :parent context)))) (cond ((and (memq type (quote (headline inlin= etask))) (progn (save-excursion (beginning-of-line) (looking-at org-complex= -heading-regexp)) (or (not ...) (< ... ...)))) (let* ((data (org-offer-link= s-in-entry ... ... arg)) (links (car data)) (links-end (cdr data))) (if lin= ks (let (... link) (while --dolist-tail-- ... ... ... ... ...)) (require (q= uote org-attach)) (org-attach-reveal (quote if-exists))))) ((let ((end (org= -element-property :end context))) (=3D (save-excursion (if ... ...) (skip-c= hars-forward " " end) (point)) end)) (user-error "No link found")) ((eq ty= pe (quote timestamp)) (org-follow-timestamp-link)) ((and (memq type (quote = (headline inlinetask))) (progn (save-excursion (beginning-of-line) (looking= -at org-complex-heading-regexp)) (and (match-beginning 5) (>=3D ... ...))))= (org-tags-view arg (substring (match-string 5) 0 -1))) ((eq type (quote li= nk)) (let ((type (org-element-property :type context)) (path (org-element-p= roperty :path context))) (save-current-buffer (set-buffer (or reference-buf= fer ...)) (cond (... ...) (... ...) (... ...) (... ...) (... ...) (... ...)= (... ...) (... ...) (... ...) (... ... ...) (... ...) (t ...))))) ((or (eq= type (quote footnote-reference)) (and (eq type (quote footnote-definition)= ) (save-excursion (skip-chars-forward " ") (let ... ...)))) (org-footnote-= action)) (t (user-error "No link found"))))) (if (call-interactively (function org-babel-open-src-block-result)) nil (= org-load-modules-maybe) (move-marker org-open-link-marker (point)) (setq or= g-window-config-before-follow-link (current-window-configuration)) (org-rem= ove-occur-highlights nil nil t) (if (run-hook-with-args-until-success (quot= e org-open-at-point-functions)) nil (let* ((context (org-element-context)) = type) (while (and (not (memq (setq type ...) (quote ...))) (setq context (o= rg-element-property :parent context)))) (cond ((and (memq type (quote ...))= (progn (save-excursion ... ...) (or ... ...))) (let* ((data ...) (links ..= .) (links-end ...)) (if links (let ... ...) (require ...) (org-attach-revea= l ...)))) ((let ((end ...)) (=3D (save-excursion ... ... ...) end)) (user-e= rror "No link found")) ((eq type (quote timestamp)) (org-follow-timestamp-l= ink)) ((and (memq type (quote ...)) (progn (save-excursion ... ...) (and ..= . ...))) (org-tags-view arg (substring (match-string 5) 0 -1))) ((eq type (= quote link)) (let ((type ...) (path ...)) (save-current-buffer (set-buffer = ...) (cond ... ... ... ... ... ... ... ... ... ... ... ...)))) ((or (eq typ= e (quote footnote-reference)) (and (eq type ...) (save-excursion ... ...)))= (org-footnote-action)) (t (user-error "No link found"))))) (move-marker or= g-open-link-marker nil) (run-hook-with-args (quote org-follow-link-hook))) org-open-at-point(nil) call-interactively(org-open-at-point nil nil) command-execute(org-open-at-point) --=-=-= Content-Type: text/plain -- Bastien --=-=-=--