emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Michael Brand <michael.ch.brand@gmail.com>,
	Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Links in node-property
Date: Sat, 01 Mar 2014 22:11:48 +0100	[thread overview]
Message-ID: <87bnxp8vzf.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87d2i5pt39.fsf@gmail.com> (Nicolas Goaziou's message of "Sat, 01	Mar 2014 21:22:18 +0100")

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Michael Brand <michael.ch.brand@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?


[-- Attachment #2: link-in-comment.txt --]
[-- Type: text/plain, Size: 8053 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

  reply	other threads:[~2014-03-01 21:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 20:16 Links in node-property Michael Brand
2014-03-01 20:22 ` Nicolas Goaziou
2014-03-01 21:11   ` Bastien [this message]
2014-03-01 22:05     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnxp8vzf.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=michael.ch.brand@gmail.com \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).