From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] Link-type for attachments, more attach options Date: Tue, 27 Nov 2018 10:39:54 +0100 Message-ID: <87y39euadx.fsf@nicolasgoaziou.fr> References: <87muqo8o68.fsf@nicolasgoaziou.fr> <877eh8vd52.fsf_-_@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRZqJ-0003Z1-5q for emacs-orgmode@gnu.org; Tue, 27 Nov 2018 04:39:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRZqF-0001iv-Un for emacs-orgmode@gnu.org; Tue, 27 Nov 2018 04:39:43 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:54689) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gRZqF-0001hu-KV for emacs-orgmode@gnu.org; Tue, 27 Nov 2018 04:39:39 -0500 In-Reply-To: ("Gustav =?utf-8?Q?Wikstr=C3=B6m=22's?= message of "Sun, 25 Nov 2018 21:13:00 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Gustav =?utf-8?Q?Wikstr=C3=B6m?= Cc: emacs-orgmode Hello, Gustav Wikstr=C3=B6m 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 [@...], 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 co= nvoluted. 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).=20 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 | =3Dhttp://www.astro.uva.nl/= =3Ddominik=3D | > +| https | secure web | =3Dhttps://orgmode.org/=3D = | > +| doi | DOI for electronic resources | =3Ddoi:10.1000/182=3D = | > +| file | file-links | =3Dfile:/home/dominik/image= s/jupiter.jpg=3D | > +| | | =3D/home/dominik/images/jup= iter.jpg=3D (same as above) | > +| | | =3Dfile:papers/last.pdf=3D = | > +| | | =3D./papers/last.pdf=3D (sa= me as above) | > +| | | =3Dfile:/ssh:me@some.where:= papers/last.pdf=3D (remote) | > +| | | =3D/ssh:me@some.where:paper= s/last.pdf=3D (same as above) | > +| | | =3Dfile:sometextfile::NNN= =3D (jump to line number) | > +| | | =3Dfile:projects.org=3D = | > +| | | =3Dfile:projects.org::some = words=3D (text search) [fn:28] | > +| | | =3Dfile:projects.org::*task= title=3D (headline search) | > +| @ | links to attachments | =3D@:projects.org=3D = | > +| | | =3D@:projects.org::some wor= ds=3D (text search) | > +| docview | doc-view mode | =3Ddocview:papers/last.pdf:= :NNN=3D | > +| id | Link to heading by id | =3Did:B7423F4D-2E8A-471B-88= 10-C40F074717E9=3D | > +| news | Usenet link | =3Dnews:comp.emacs=3D = | > +| mailto | mail link | =3Dmailto:adent@galaxy.net= =3D | > +| mhe | MH-E folder link | =3Dmhe:folder=3D (folder li= nk) | > +| | | =3Dmhe:folder#id=3D (messag= e link) | > +| rmail | Rmail link | =3Drmail:folder=3D (folder = link) | > +| | | =3Drmail:folder#id=3D (mess= age link) | > +| gnus | Gnus link | =3Dgnus:group=3D (group lin= k) | > +| | | =3Dgnus:group#id=3D (articl= e link) | > +| bbdb | BBDB link | =3Dbbdb:R.*Stallman=3D (lin= k with regexp) | > +| irc | IRC link | =3Dirc:/irc.com/#emacs/bob= =3D | > +| info | Info link | =3Dinfo:org#External links= =3D | > +| shell | shell command | =3Dshell:ls *.org=3D = | > +| elisp | interactive elisp command | =3Delisp:(find-file "Elisp.= org")=3D | 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. - =3Dfile=3D :: 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 =3D./=3D, or =3D/=3D. - =3Datt=3D :: Same as file links, but for attached documents to the current node (see [[*Attachments]]). - =3Dbbdb=3D :: Link to a BBDB record, with possible regexp completion. - =3Ddocview=3D :: Link to a document opened with DocView mode. You may specify a page number. - =3Ddoi=3D :: Link to an electronic ressource, through its handle. - =3Delisp=3D :: Execute an Elisp command upon activation. - =3Dgnus=3D, =3Drmail=3D, =3Dmhe=3D :: Links to messages or folders from a= given Emacs' MUA. - =3Dhttp=3D, =3Dhttps=3D :: Web links. - =3Did=3D :: Link to a specific headline by its ID property, in an Org file. - =3Dinfo=3D :: Link to an Info manual, or to a specific node. - =3Dirc=3D :: Link to an IRC channel. - =3Dmailto=3D :: Link to message composition. - =3Dnews=3D :: Usenet links. - =3Dshell=3D :: Execute a shell command upon activation. The following table illustrates the link types above, along with their options: | Link Type | Example | |-----------+-------------------------------------------------------| | http | =3Dhttp://www.astro.uva.nl/=3Ddominik=3D | | https | =3Dhttps://orgmode.org/=3D | | doi | =3Ddoi:10.1000/182=3D | | file | =3Dfile:/home/dominik/images/jupiter.jpg=3D | | | =3D/home/dominik/images/jupiter.jpg=3D (same as above) | | | =3Dfile:papers/last.pdf=3D | | | =3D./papers/last.pdf=3D (same as above) | | | =3Dfile:/ssh:me@some.where:papers/last.pdf=3D (remote) | | | =3D/ssh:me@some.where:papers/last.pdf=3D (same as above) | | | =3Dfile:sometextfile::NNN=3D (jump to line number) | | | =3Dfile:projects.org=3D | | | =3Dfile:projects.org::some words=3D (text search) [fn:28] | | | =3Dfile:projects.org::*task title=3D (headline search) | | | =3Dfile:projects.org::#custom-id=3D (headline search) | | att | =3Datt:projects.org=3D | | | =3Datt:projects.org::some words=3D (text search) | | docview | =3Ddocview:papers/last.pdf::NNN=3D | | id | =3Did:B7423F4D-2E8A-471B-8810-C40F074717E9=3D | | news | =3Dnews:comp.emacs=3D | | mailto | =3Dmailto:adent@galaxy.net=3D | | mhe | =3Dmhe:folder=3D (folder link) | | | =3Dmhe:folder#id=3D (message link) | | rmail | =3Drmail:folder=3D (folder link) | | | =3Drmail:folder#id=3D (message link) | | gnus | =3Dgnus:group=3D (group link) | | | =3Dgnus:group#id=3D (article link) | | bbdb | =3Dbbdb:R.*Stallman=3D (record with regexp) | | irc | =3Dirc:/irc.com/#emacs/bob=3D | | info | =3Dinfo:org::External links=3D | | shell | =3Dshell:ls *.org=3D | | elisp | =3Delisp:(find-file "Elisp.org")=3D | --8<---------------cut here---------------end--------------->8--- WDYT? Regards, --=20 Nicolas Goaziou