emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Following a link to a #+NAME causes '(wrong-type-argument stringp nil)' [9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)]
@ 2020-11-22 20:44 Dima Kogan
  2020-11-27  4:49 ` Dante Catalfamo
  2020-12-01  5:14 ` Kyle Meyer
  0 siblings, 2 replies; 4+ messages in thread
From: Dima Kogan @ 2020-11-22 20:44 UTC (permalink / raw)
  To: emacs-orgmode

Hi. I'm using the org included with a recent build from emacs git. I
have this tst.org:




[[name][link]]

* heading
#+NAME: name

text




I open it with 'emacs -Q'. I move the point to the link at the top, and
C-c C-o to follow the link. This doesn't work:

  Debugger entered--Lisp error: (wrong-type-argument stringp nil)
    string-match("[ \f\11\n\15\13]+" nil 0)
    split-string(nil)
    org-link-search("name" 3)
    org-link-open((link (:type "fuzzy" :path "name" :format bracket :raw-link "name" :application nil :search-option nil :begin 1 :end 15 :contents-begin 9 :contents-end 13 :post-blank 0 :parent (paragraph (:begin 1 :end 17 :contents-begin 1 :contents-end 16 :post-blank 1 :post-affiliated 1 :parent nil)))) nil)
    org-open-at-point(nil)
    funcall-interactively(org-open-at-point nil)

Apparently org doesn't like the empty line right after the #+NAME tag.
Removing that empty line makes it work.

Thanks!
 

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0)
 of 2020-09-29, unofficial emacs-snapshot build: http://emacs.secretsauce.net
Package: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)


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

* Re: Bug: Following a link to a #+NAME causes '(wrong-type-argument stringp nil)' [9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)]
  2020-11-22 20:44 Bug: Following a link to a #+NAME causes '(wrong-type-argument stringp nil)' [9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)] Dima Kogan
@ 2020-11-27  4:49 ` Dante Catalfamo
  2020-12-01  5:14 ` Kyle Meyer
  1 sibling, 0 replies; 4+ messages in thread
From: Dante Catalfamo @ 2020-11-27  4:49 UTC (permalink / raw)
  To: emacs-orgmode

Isn't the #+NAME tag used to label things below it? I think that would 
explain why it doesn't work when there's nothing directly below it.

If you want to link to the heading, perhaps you should try something 
like [[* heading][link]]?

On 11/22/20 3:44 PM, Dima Kogan wrote:
> Hi. I'm using the org included with a recent build from emacs git. I
> have this tst.org:
> 
> 
> 
> 
> [[name][link]]
> 
> * heading
> #+NAME: name
> 
> text
> 
> 
> 
> 
> I open it with 'emacs -Q'. I move the point to the link at the top, and
> C-c C-o to follow the link. This doesn't work:
> 
>    Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>      string-match("[ \f\11\n\15\13]+" nil 0)
>      split-string(nil)
>      org-link-search("name" 3)
>      org-link-open((link (:type "fuzzy" :path "name" :format bracket :raw-link "name" :application nil :search-option nil :begin 1 :end 15 :contents-begin 9 :contents-end 13 :post-blank 0 :parent (paragraph (:begin 1 :end 17 :contents-begin 1 :contents-end 16 :post-blank 1 :post-affiliated 1 :parent nil)))) nil)
>      org-open-at-point(nil)
>      funcall-interactively(org-open-at-point nil)
> 
> Apparently org doesn't like the empty line right after the #+NAME tag.
> Removing that empty line makes it work.
> 
> Thanks!
>   
> 
> Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0)
>   of 2020-09-29, unofficial emacs-snapshot build: http://emacs.secretsauce.net
> Package: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)
> 


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

* Re: Bug: Following a link to a #+NAME causes '(wrong-type-argument stringp nil)' [9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)]
  2020-11-22 20:44 Bug: Following a link to a #+NAME causes '(wrong-type-argument stringp nil)' [9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)] Dima Kogan
  2020-11-27  4:49 ` Dante Catalfamo
@ 2020-12-01  5:14 ` Kyle Meyer
  2020-12-01  5:19   ` Dima Kogan
  1 sibling, 1 reply; 4+ messages in thread
From: Kyle Meyer @ 2020-12-01  5:14 UTC (permalink / raw)
  To: Dima Kogan; +Cc: emacs-orgmode

Dima Kogan writes:

> Hi. I'm using the org included with a recent build from emacs git. I
> have this tst.org:
>
> [[name][link]]
>
> * heading
> #+NAME: name
>
> text
>
> I open it with 'emacs -Q'. I move the point to the link at the top, and
> C-c C-o to follow the link. This doesn't work:
>
>   Debugger entered--Lisp error: (wrong-type-argument stringp nil)
[...]
> Apparently org doesn't like the empty line right after the #+NAME tag.
> Removing that empty line makes it work.

Thanks for the report.  As suggested in Dante's reply, the blank line
following #+name is invalid syntax.

  https://orgmode.org/worg/dev/org-syntax.html#Affiliated_keywords

On maint (3bb073b63), the type error is now avoided for invalid name
keywords.  No attempt is made to match these keywords, though, so your
example won't lead to a match aside from through a fuzzy text search
when org-link-search-must-match-exact-headline is nil.


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

* Re: Bug: Following a link to a #+NAME causes '(wrong-type-argument stringp nil)' [9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)]
  2020-12-01  5:14 ` Kyle Meyer
@ 2020-12-01  5:19   ` Dima Kogan
  0 siblings, 0 replies; 4+ messages in thread
From: Dima Kogan @ 2020-12-01  5:19 UTC (permalink / raw)
  To: emacs-orgmode

Kyle Meyer <kyle@kyleam.com> writes:

> Thanks for the report.  As suggested in Dante's reply, the blank line
> following #+name is invalid syntax.
>
>   https://orgmode.org/worg/dev/org-syntax.html#Affiliated_keywords
>
> On maint (3bb073b63), the type error is now avoided for invalid name
> keywords.  No attempt is made to match these keywords, though, so your
> example won't lead to a match aside from through a fuzzy text search
> when org-link-search-must-match-exact-headline is nil.

Thank you Kyle, Dante. I was using the wrong thing. I should have been
using the CUSTOM_ID property instead of the #+NAME tag. This was my
fault. I guess the fact that #+NAME was ALMOST working the way I wanted
it to increased my confusion. And the unhelpful error message.

Thanks again


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

end of thread, other threads:[~2020-12-01 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-22 20:44 Bug: Following a link to a #+NAME causes '(wrong-type-argument stringp nil)' [9.3 (release_9.3 @ /usr/share/emacs/28.0.50/lisp/org/)] Dima Kogan
2020-11-27  4:49 ` Dante Catalfamo
2020-12-01  5:14 ` Kyle Meyer
2020-12-01  5:19   ` Dima Kogan

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