emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Links in node-property
@ 2014-03-01 20:16 Michael Brand
  2014-03-01 20:22 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Brand @ 2014-03-01 20:16 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode

Hi Nicolas

Will org-open-at-point still support links in node-property?

:PROPERTIES:
:ID:       24ac0164-3c4f-4792-93ac-aaae68a19632
:related:  [[id:15763c8f-f022-486e-9449-bac56f7aa028]]
:features: http://orgmode.org/features.html
:doc:      http://orgmode.org/org.html
:END:

Michael

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Links in node-property
  2014-03-01 20:16 Links in node-property Michael Brand
@ 2014-03-01 20:22 ` Nicolas Goaziou
  2014-03-01 21:11   ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2014-03-01 20:22 UTC (permalink / raw)
  To: Michael Brand; +Cc: Org Mode

Hello,

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...


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Links in node-property
  2014-03-01 20:22 ` Nicolas Goaziou
@ 2014-03-01 21:11   ` Bastien
  2014-03-01 22:05     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2014-03-01 21:11 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Michael Brand, Org Mode

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Links in node-property
  2014-03-01 21:11   ` Bastien
@ 2014-03-01 22:05     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2014-03-01 22:05 UTC (permalink / raw)
  To: Bastien; +Cc: Michael Brand, Org Mode

Bastien <bzg@gnu.org> writes:

> 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.)

My bad. This should now be fixed.

> Anyway, not supporting links in comments does not feel right, as
> links in comments are both frequent and useful.

Comments, by definition, are dead data. It just doesn't make sense to
expect to have an active link, or timestamp, or whatever inside. If you
put an active timestamp in a comment, you don't expect it to show in the
agenda, right?

If you need live non-exportable data, you can stuff it in a regular
drawer.

> 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?

I think that if we reverted each buggy commit, we wouldn't be far from
the very first commit in Org.

Anyway, I suggest to either explain to me why opening the next link is
needed, so we can discuss on how to do it best, or implement the feature
yourself, as you intended to do a few minutes ago.

In any case, I don't see the need to trash the few hours of work
I invested already in this (well, almost) working function.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-01 22:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-01 20:16 Links in node-property Michael Brand
2014-03-01 20:22 ` Nicolas Goaziou
2014-03-01 21:11   ` Bastien
2014-03-01 22:05     ` Nicolas Goaziou

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).