Hi Nicolas, Nicolas Goaziou <n.goaz...@gmail.com> writes:
> Michael Brand <michael.ch.br...@gmail.com> 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?
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) =(55 nil) (let ((end (org-element-property :end context))) (= (save-excursion (if (invisible-p (point)) (progn (goto-char (next-single-property-change (point) (quote invisible) nil end)))) (skip-chars-forward " " end) (point)) end)) (cond ((and (memq type (quote (headline inlinetask))) (progn (save-excursion (beginning-of-line) (looking-at org-complex-heading-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-- (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) (setq --dolist-tail-- (cdr --dolist-tail--)))) (require (quote org-attach)) (org-attach-reveal (quote if-exists))))) ((let ((end (org-element-property :end context))) (= (save-excursion (if (invisible-p (point)) (progn (goto-char ...))) (skip-chars-forward " " end) (point)) end)) (user-error "No link 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) (>= (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 (string-match "[*?{]" ...) (dired path) (apply ... path arg ...))) ((assoc type org-link-protocols) (funcall (nth 1 ...) path)) ((equal type "help") (let (...) (cond ... ... ...))) ((equal type "mailto") (let (... ... ... final-args) (apply cmd ...))) ((member type (quote ...)) (browse-url (org-link-escape-browser ...))) ((equal type "doi") (browse-url (org-link-escape-browser ...))) ((equal type "message") (browse-url (concat type ":" path))) ((equal type "shell") (let (... ...) (if ... ... ...))) ((equal 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-reference)) (and (eq type (quote footnote-definition)) (save-excursion (skip-chars-forward " ") (let ((begin ...)) (if begin (< ... begin) (= ... ...)))))) (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-property :parent context)))) (cond ((and (memq type (quote (headline inlinetask))) (progn (save-excursion (beginning-of-line) (looking-at org-complex-heading-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))))) ((let ((end (org-element-property :end context))) (= (save-excursion (if (invisible-p ...) (progn ...)) (skip-chars-forward " " end) (point)) end)) (user-error "No link 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) (>= (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-protocols) (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 type "shell") (let ... ...)) ((equal type "elisp") (let ... ...)) ((equal type "id") (require ...) (funcall ... path)) ((member type ...) (if ... nil ... ...)) (t (browse-url-at-point)))))) ((or (eq type (quote footnote-reference)) (and (eq type (quote footnote-definition)) (save-excursion (skip-chars-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 footnote-definition footnote-reference timestamp)))) (setq context (org-element-property :parent context)))) (cond ((and (memq type (quote (headline inlinetask))) (progn (save-excursion (beginning-of-line) (looking-at org-complex-heading-regexp)) (or (not ...) (< ... ...)))) (let* ((data (org-offer-links-in-entry ... ... arg)) (links (car data)) (links-end (cdr data))) (if links (let (... link) (while --dolist-tail-- ... ... ... ... ...)) (require (quote org-attach)) (org-attach-reveal (quote if-exists))))) ((let ((end (org-element-property :end context))) (= (save-excursion (if ... ...) (skip-chars-forward " " end) (point)) end)) (user-error "No link 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) (>= ... ...)))) (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 ...)) (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 org-window-config-before-follow-link (current-window-configuration)) (org-remove-occur-highlights nil nil t) (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 ...) (quote ...))) (setq context (org-element-property :parent context)))) (cond ((and (memq type (quote ...)) (progn (save-excursion ... ...) (or ... ...))) (let* ((data ...) (links ...) (links-end ...)) (if links (let ... ...) (require ...) (org-attach-reveal ...)))) ((let ((end ...)) (= (save-excursion ... ... ...) end)) (user-error "No link found")) ((eq type (quote timestamp)) (org-follow-timestamp-link)) ((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 type (quote footnote-reference)) (and (eq type ...) (save-excursion ... ...))) (org-footnote-action)) (t (user-error "No link found"))))) (move-marker org-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)
-- Bastien