Hi again, Some updates, and a fresh patch...! I won't say that much here since the patch speaks for itself (It contains a chapter to be added to ORG-NEWS). It's patch 0002 that is the important one. See sidenote below for a comment about patch 0001. I have to mention that the patch has grown quite a lot. With the Additional changes, I've taken the liberty to promote attachments to a level-1 headline within the documentation! Please review the new and improved" patch. > -----Original Message----- > From: Nicolas Goaziou > Sent: den 27 november 2018 10:40 > To: Gustav Wikström > Cc: emacs-orgmode > Subject: Re: [RFC] Link-type for attachments, more attach options > > Hello, > > Gustav Wikström 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. Yeah, you're right. My bad! > I prefer not to consider Gmail and Outlook as references, or even > standards. As another data point, Gnus uses "Attachment: " to list > attachments. I won't argue any longer. And I'll do as you say. Attachment: it is! > > 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? Inheriting ID's for attachments is actually valuable. It makes it possible, for example, to add attachment-links in subheadings to the node the attachment is defined on. After having used this for quite some time now it feels quite natural to have inheritance switched on for attachments. No negative side-effects at all. > > 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. I went with path (1) and tried to fit it into the already existing property inheritance framework. > > +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:me@some.where:papers/last.pdf= (remote) | > > +| | | =/ssh:me@some.where: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:adent@galaxy.net= | > > +| 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:me@some.where:papers/last.pdf= (remote) | > | | =/ssh:me@some.where: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:adent@galaxy.net= | > | 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? Thumbs up! (Sidenote 1; what do I need to do to gain access to the official git-repository? Would be nice to be able to provide pull requests there!) (Sidenote 2; The first patch is some minor unrelated fixups - it breaks test-org-export/expand-include as a side-effect. But that's probably because the test doesn't do what it should! 😲 ) Kind regards Gustav