emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Link abbreviations: include abbreviation table and linkwords with spaces
@ 2018-03-12 20:35 ST
  2018-03-12 23:11 ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: ST @ 2018-03-12 20:35 UTC (permalink / raw)
  To: Emacs-orgmode

Hello,

after reading "4.6 Link abbreviations" of the manual I have two
questions:

1. is it possible to define linkwords with spaces, like this: [[Harry
Potter:Chapter1]], it looks much more nice than
[[Harry_Potter:Chapter1]]?

2. is it possible to define a "links catalog" of abbreviations, like

#+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
#+LINK: google    http://www.google.com/search?q=%s

and then include them in all possible org files with

#+INCLUDE: "links_catalog.org"

Will the links be clickable?

Thank you!

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-12 20:35 Link abbreviations: include abbreviation table and linkwords with spaces ST
@ 2018-03-12 23:11 ` Nicolas Goaziou
  2018-03-13  8:51   ` ST
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2018-03-12 23:11 UTC (permalink / raw)
  To: ST; +Cc: Emacs-orgmode

Hello,

ST <smntov@gmail.com> writes:

> after reading "4.6 Link abbreviations" of the manual I have two
> questions:
>
> 1. is it possible to define linkwords with spaces, like this: [[Harry
> Potter:Chapter1]], it looks much more nice than
> [[Harry_Potter:Chapter1]]?

I think so.

> 2. is it possible to define a "links catalog" of abbreviations, like
>
> #+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
> #+LINK: google    http://www.google.com/search?q=%s
>
>
> and then include them in all possible org files with
>
> #+INCLUDE: "links_catalog.org"

SETUPFILE would be more appropriate. Also, you can define abbreviations
globally. See `org-link-abbrev-alist'.

> Will the links be clickable?

Yes.

Regards,

-- 
Nicolas Goaziou

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-12 23:11 ` Nicolas Goaziou
@ 2018-03-13  8:51   ` ST
  2018-03-13  9:18     ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: ST @ 2018-03-13  8:51 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode


> > after reading "4.6 Link abbreviations" of the manual I have two
> > questions:
> >
> > 1. is it possible to define linkwords with spaces, like this: [[Harry
> > Potter:Chapter1]], it looks much more nice than
> > [[Harry_Potter:Chapter1]]?
> 
> I think so.

If yes, then it's really worth mentioning this fact in the manual (4.6
Link abbreviations) because ones get the impression that only - and _
are allowed. One of the most strong sides of org is its readability as
raw text and in this case space makes link more readable.

> 
> > 2. is it possible to define a "links catalog" of abbreviations, like
> >
> > #+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
> > #+LINK: google    http://www.google.com/search?q=%s
> >
> >
> > and then include them in all possible org files with
> >
> > #+INCLUDE: "links_catalog.org"
> 
> SETUPFILE would be more appropriate. Also, you can define abbreviations
> globally. See `org-link-abbrev-alist'.

I wanted to avoid `org-link-abbrev-alist' as it is Emacs specific, while
#+INCLUDE: is part of the org-mode standard which should work also on
other platforms (theoretically).

Thank you!

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-13  8:51   ` ST
@ 2018-03-13  9:18     ` Nicolas Goaziou
  2018-03-13 11:53       ` ST
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2018-03-13  9:18 UTC (permalink / raw)
  To: ST; +Cc: Emacs-orgmode

Hello,

ST <smntov@gmail.com> writes:

>> > after reading "4.6 Link abbreviations" of the manual I have two
>> > questions:
>> >
>> > 1. is it possible to define linkwords with spaces, like this: [[Harry
>> > Potter:Chapter1]], it looks much more nice than
>> > [[Harry_Potter:Chapter1]]?
>> 
>> I think so.
>
> If yes, then it's really worth mentioning this fact in the manual (4.6
> Link abbreviations) because ones get the impression that only - and _
> are allowed. One of the most strong sides of org is its readability as
> raw text and in this case space makes link more readable.

My bad. Spaces are not allowed, because

  #+LINK: linkword URL

would not be parse-able. The manual states

    The linkword must be a word, starting with a letter, followed by
    letters, numbers, ‘-’, and ‘_’.

but it seems implementation only disallows spaces (for LINK keyword) and
colons (for links).

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-13  9:18     ` Nicolas Goaziou
@ 2018-03-13 11:53       ` ST
  2018-03-14 14:02         ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: ST @ 2018-03-13 11:53 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode

> >> > after reading "4.6 Link abbreviations" of the manual I have two
> >> > questions:
> >> >
> >> > 1. is it possible to define linkwords with spaces, like this: [[Harry
> >> > Potter:Chapter1]], it looks much more nice than
> >> > [[Harry_Potter:Chapter1]]?
> >> 
> >> I think so.
> >
> > If yes, then it's really worth mentioning this fact in the manual (4.6
> > Link abbreviations) because ones get the impression that only - and _
> > are allowed. One of the most strong sides of org is its readability as
> > raw text and in this case space makes link more readable.
> 
> My bad. Spaces are not allowed, because
> 
>   #+LINK: linkword URL
> 
> would not be parse-able.

#+LINK: link word URL

Why should this not be parse-able? Cut #+LINK: from the beginning, URL
(last token) from the end, and the rest will be "link word", even with
(several) spaces in between...

Thanks.

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-13 11:53       ` ST
@ 2018-03-14 14:02         ` Nicolas Goaziou
  2018-03-14 18:32           ` ST
  2018-03-16  7:38           ` ST
  0 siblings, 2 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2018-03-14 14:02 UTC (permalink / raw)
  To: ST; +Cc: Emacs-orgmode

Hello,

ST <smntov@gmail.com> writes:

> Why should this not be parse-able? Cut #+LINK: from the beginning, URL
> (last token) from the end, and the rest will be "link word", even with
> (several) spaces in between...

Can we be sure so-called URL part will never contain a space? You put
a constraint either on the linkword or on the "URL" part.

Regards,

-- 
Nicolas Goaziou

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-14 14:02         ` Nicolas Goaziou
@ 2018-03-14 18:32           ` ST
  2018-03-16  7:38           ` ST
  1 sibling, 0 replies; 10+ messages in thread
From: ST @ 2018-03-14 18:32 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode

On Wed, 2018-03-14 at 15:02 +0100, Nicolas Goaziou wrote:
> Hello,
> 
> ST <smntov@gmail.com> writes:
> 
> > Why should this not be parse-able? Cut #+LINK: from the beginning, URL
> > (last token) from the end, and the rest will be "link word", even with
> > (several) spaces in between...
> 
> Can we be sure so-called URL part will never contain a space? You put
> a constraint either on the linkword or on the "URL" part.

1. If I were to choose on which part to put a constraint - I'll do so
with the "URL" part as it appears only once and in the best case as meta
data in comments, while "link word" can appear tens or hundreds of times
in the text itself, which needs to look nice.

2. Spaces in URLs a rare, while all docs that have more than one word in
their title look nicer with spaces. I found only 3 cases here:
https://orgmode.org/manual/External-links.html

3. Anyway the problem of spaces in the URLs is not a new one - you have
the same in bash. Solution - just put URL part in "URL", as you usually
do on command line. And as you already do defining
org-link-abbrev-alist:

("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h")

so for the cases where there must be spaces in the URL do:

#+LINK: My Book "path/to/My Book.org"

but by default in normal case just use:

#+LINK: My Book path/to/My_Book.org

What is your opinion? Can this qualify as feature request?

Thanks!

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-14 14:02         ` Nicolas Goaziou
  2018-03-14 18:32           ` ST
@ 2018-03-16  7:38           ` ST
  2018-03-16 21:57             ` Nicolas Goaziou
  1 sibling, 1 reply; 10+ messages in thread
From: ST @ 2018-03-16  7:38 UTC (permalink / raw)
  To: Emacs-orgmode

Hello,

to those engineers, who are responsible for adding new features: does this case
of enabling linkwords with spaces (see below) qualifies as a new feature
request? If yes - where should I file it?

Thank you!

----------------------------------------------------------------

> 
> > Why should this not be parse-able? Cut #+LINK: from the beginning, URL
> > (last token) from the end, and the rest will be "link word", even with
> > (several) spaces in between...
> 
> Can we be sure so-called URL part will never contain a space? You put
> a constraint either on the linkword or on the "URL" part.

1. If I were to choose on which part to put a constraint - I'll do so
with the "URL" part as it appears only once and in the best case as meta
data in comments, while "link word" can appear tens or hundreds of times
in the text itself, which needs to look nice.

2. Spaces in URLs a rare, while all docs that have more than one word in
their title look nicer with spaces. I found only 3 cases here:
https://orgmode.org/manual/External-links.html

3. Anyway the problem of spaces in the URLs is not a new one - you have
the same in bash. Solution - just put URL part in "URL", as you usually
do on command line. And as you already do defining
org-link-abbrev-alist:

("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h")

so for the cases where there must be spaces in the URL do:

#+LINK: My Book "path/to/My Book.org"

but by default in normal case just use:

#+LINK: My Book path/to/My_Book.org

What is your opinion? Can this qualify as feature request?

Thanks!

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-16  7:38           ` ST
@ 2018-03-16 21:57             ` Nicolas Goaziou
  2018-03-18  9:20               ` ST
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2018-03-16 21:57 UTC (permalink / raw)
  To: ST; +Cc: Emacs-orgmode

Hello,

ST <smntov@gmail.com> writes:

> to those engineers, who are responsible for adding new features: does this case
> of enabling linkwords with spaces (see below) qualifies as a new feature
> request?

I have no objection, but it needs to be tested carefully.

> If yes - where should I file it?

It is already filed here, on the ML. However, I suggest to give it a go,
as it may be faster that waiting for someone to implement it.

Regards,

-- 
Nicolas Goaziou

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

* Re: Link abbreviations: include abbreviation table and linkwords with spaces
  2018-03-16 21:57             ` Nicolas Goaziou
@ 2018-03-18  9:20               ` ST
  0 siblings, 0 replies; 10+ messages in thread
From: ST @ 2018-03-18  9:20 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode

Thank you!

Unfortunately my (lack of) elisp knowledge doesn't allow me to implement
this feature myself. I'll wait until somebody finds it useful enough...

On Fri, 2018-03-16 at 22:57 +0100, Nicolas Goaziou wrote:
> Hello,
> 
> ST <smntov@gmail.com> writes:
> 
> > to those engineers, who are responsible for adding new features: does this case
> > of enabling linkwords with spaces (see below) qualifies as a new feature
> > request?
> 
> I have no objection, but it needs to be tested carefully.
> 
> > If yes - where should I file it?
> 
> It is already filed here, on the ML. However, I suggest to give it a go,
> as it may be faster that waiting for someone to implement it.
> 
> Regards,
> 

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

end of thread, other threads:[~2018-03-18  9:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 20:35 Link abbreviations: include abbreviation table and linkwords with spaces ST
2018-03-12 23:11 ` Nicolas Goaziou
2018-03-13  8:51   ` ST
2018-03-13  9:18     ` Nicolas Goaziou
2018-03-13 11:53       ` ST
2018-03-14 14:02         ` Nicolas Goaziou
2018-03-14 18:32           ` ST
2018-03-16  7:38           ` ST
2018-03-16 21:57             ` Nicolas Goaziou
2018-03-18  9:20               ` ST

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