emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [RFC] Link-type for attachments, more attach options


From: Nicolas Goaziou
Subject: Re: [O] [RFC] Link-type for attachments, more attach options
Date: Tue, 27 Nov 2018 10:39:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello,

Gustav Wikström <address@hidden> writes:

> Too bad, "@" was growing on me. @ is currently automatically set as
> a tag when attaching files to nodes.

You probably customized `org-attach-auto-tag' because this is not the
default behaviour. It adds "ATTACH" tag automatically.

> So it was fitting to use it also
> in links in my opinion. Is the cite-syntax the same as the regular
> link-pattern? [[@: ...]] ?

It could be address@hidden, which is close enough to be confusing.

Moreover, all default link types currently use alphabetic characters.
Using a symbol here would be weird.

> Otherwise I'd suggest them to coexist. Or
> to change the cite-symbol to ... "c" maybe?

"@" is used for the citation key. Using a letter could interfere with
the key itself: @key vs. ckey.

> @ is a pretty standard symbol for attachments. Just have a look at
> Gmail, Outlook etc.

I prefer not to consider Gmail and Outlook as references, or even
standards. As another data point, Gnus uses "Attachment: " to list
attachments.

> I didn't change this in the attached patch. I'm hoping for second
> thoughts! :) The future ease of use (i.e. clarity and standardization
> of symbols in this case) should have precedence over current work in
> progress...

The citation syntax was discussed, and implemented, years ago. Also,
some external libraries apparently rely on it.

I still vote for "att", or "attachment".

> Yeah, I don't know why it's configured like that from the start. A bit 
> convoluted. Not sure of what way to go forward though. I can see at least two 
> paths:
>
> 1) Rename `org-attach-allow-inheritance' to
> `org-attach-enable-inheritance' and always make attachments inherited
> when that is set to "t". Deprecate "ATTACH_DIR_INHERIT". With this I'd
> also change the precedence-logic between ATTACH_DIR & ID properties
> and make ID-based attachment inherit as well. The properties
> ATTACH_DIR and ID should be inherited from the closest node when
> resolving attachments, with ATTACH_DIR having precedence over ID if
> both exist for the same node.

Why defining `org-attach-enable-inheritance' at all? There is already
`org-use-property-inheritance' for this. We do not need another
conflicting variable.

I don't think we should inherit ID properties either. ID is defined
outside "org-attach.el", so this library shouldn't mess with its
meaning. Does inheriting ID properties give anything valuable?

> 2) remove `org-attach-allow-inheritance' and only rely on the
> "ATTACH_DIR_INHERIT" property of any of the parent nodes to decide if
> the "ATTACH_DIR" property should be inherited. This would be a smaller
> change from the user's perspective, where we're basically saying you
> cannot disable inheritance, but it's only active when a node has the
> ATTACH_DIR_INHERIT-property.
>
> I prefer path (1). 

So do I, with the remarks above.

> +This list shows the full set of built-in external link types,
> +including examples for each:
> +
> +| Link Type | Description                  | Example                         
>                       |
> +|-----------+------------------------------+-------------------------------------------------------|
> +| http      | web                          | 
> =http://www.astro.uva.nl/=dominik=                    |
> +| https     | secure web                   | =https://orgmode.org/=          
>                       |
> +| doi       | DOI for electronic resources | =doi:10.1000/182=               
>                       |
> +| file      | file-links                   | 
> =file:/home/dominik/images/jupiter.jpg=               |
> +|           |                              | 
> =/home/dominik/images/jupiter.jpg= (same as above)    |
> +|           |                              | =file:papers/last.pdf=          
>                       |
> +|           |                              | =./papers/last.pdf= (same as 
> above)                   |
> +|           |                              | 
> =file:/ssh:address@hidden:papers/last.pdf= (remote)    |
> +|           |                              | 
> =/ssh:address@hidden:papers/last.pdf= (same as above)  |
> +|           |                              | =file:sometextfile::NNN= (jump 
> to line number)        |
> +|           |                              | =file:projects.org=             
>                       |
> +|           |                              | =file:projects.org::some words= 
> (text search) [fn:28] |
> +|           |                              | =file:projects.org::*task 
> title= (headline search)    |
> +| @         | links to attachments         | =@:projects.org=                
>                       |
> +|           |                              | =@:projects.org::some words= 
> (text search)            |
> +| docview   | doc-view mode                | =docview:papers/last.pdf::NNN=  
>                       |
> +| id        | Link to heading by id        | 
> =id:B7423F4D-2E8A-471B-8810-C40F074717E9=             |
> +| news      | Usenet link                  | =news:comp.emacs=               
>                       |
> +| mailto    | mail link                    | =mailto:address@hidden          
>                    |
> +| mhe       | MH-E folder link             | =mhe:folder= (folder link)      
>                       |
> +|           |                              | =mhe:folder#id= (message link)  
>                       |
> +| rmail     | Rmail link                   | =rmail:folder= (folder link)    
>                       |
> +|           |                              | =rmail:folder#id= (message 
> link)                      |
> +| gnus      | Gnus link                    | =gnus:group= (group link)       
>                       |
> +|           |                              | =gnus:group#id= (article link)  
>                       |
> +| bbdb      | BBDB link                    | =bbdb:R.*Stallman= (link with 
> regexp)                 |
> +| irc       | IRC link                     | =irc:/irc.com/#emacs/bob=       
>                       |
> +| info      | Info link                    | =info:org#External links=       
>                       |
> +| shell     | shell command                | =shell:ls *.org=                
>                       |
> +| elisp     | interactive elisp command    | =elisp:(find-file "Elisp.org")= 
>                       |

The second column still doesn't bring much information compared to the
first one. Getting back to your first idea, we may try to do something
like the following:

--8<---------------cut here---------------start------------->8---
Here is the full set of built-in link types.

- =file= :: File links. File name may be remote, absolute, or relative.

  Additionally, you can specify a line number, or a text search.  In Org
  files, you may link to a headline name, a custom ID, or a code
  reference instead.

  As a special case, "file" prefix may be omitted if the file name is
  complete, e.g., it starts with =./=, or =/=.

- =att= :: Same as file links, but for attached documents to the current
  node (see [[*Attachments]]).

- =bbdb= :: Link to a BBDB record, with possible regexp completion.

- =docview= :: Link to a document opened with DocView mode.  You may
  specify a page number.

- =doi= :: Link to an electronic ressource, through its handle.

- =elisp= :: Execute an Elisp command upon activation.

- =gnus=, =rmail=, =mhe= :: Links to messages or folders from a given
  Emacs' MUA.

- =http=, =https= :: Web links.

- =id= :: Link to a specific headline by its ID property, in an Org
  file.

- =info= :: Link to an Info manual, or to a specific node.

- =irc= :: Link to an IRC channel.

- =mailto= :: Link to message composition.

- =news= :: Usenet links.

- =shell= :: Execute a shell command upon activation.

The following table illustrates the link types above, along with their
options:

| Link Type | Example                                               |
|-----------+-------------------------------------------------------|
| http      | =http://www.astro.uva.nl/=dominik=                    |
| https     | =https://orgmode.org/=                                |
| doi       | =doi:10.1000/182=                                     |
| file      | =file:/home/dominik/images/jupiter.jpg=               |
|           | =/home/dominik/images/jupiter.jpg= (same as above)    |
|           | =file:papers/last.pdf=                                |
|           | =./papers/last.pdf= (same as above)                   |
|           | =file:/ssh:address@hidden:papers/last.pdf= (remote)    |
|           | =/ssh:address@hidden:papers/last.pdf= (same as above)  |
|           | =file:sometextfile::NNN= (jump to line number)        |
|           | =file:projects.org=                                   |
|           | =file:projects.org::some words= (text search) [fn:28] |
|           | =file:projects.org::*task title= (headline search)    |
|           | =file:projects.org::#custom-id= (headline search)     |
| att       | =att:projects.org=                                    |
|           | =att:projects.org::some words= (text search)          |
| docview   | =docview:papers/last.pdf::NNN=                        |
| id        | =id:B7423F4D-2E8A-471B-8810-C40F074717E9=             |
| news      | =news:comp.emacs=                                     |
| mailto    | =mailto:address@hidden                             |
| mhe       | =mhe:folder= (folder link)                            |
|           | =mhe:folder#id= (message link)                        |
| rmail     | =rmail:folder= (folder link)                          |
|           | =rmail:folder#id= (message link)                      |
| gnus      | =gnus:group= (group link)                             |
|           | =gnus:group#id= (article link)                        |
| bbdb      | =bbdb:R.*Stallman= (record with regexp)               |
| irc       | =irc:/irc.com/#emacs/bob=                             |
| info      | =info:org::External links=                            |
| shell     | =shell:ls *.org=                                      |
| elisp     | =elisp:(find-file "Elisp.org")=                       |
--8<---------------cut here---------------end--------------->8---

WDYT?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]