From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ihor Radchenko Subject: Re: FW: [RFC] Link-type for attachments, more attach options Date: Sun, 18 Nov 2018 08:42:20 +0800 Message-ID: <87d0r3xllf.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> References: <84y3acss7h.fsf@gmail.com> <875zxe4yro.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOBDW-00060f-JM for emacs-orgmode@gnu.org; Sat, 17 Nov 2018 19:45:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOBC9-0002ro-B8 for emacs-orgmode@gnu.org; Sat, 17 Nov 2018 19:44:17 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:39581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gOBC9-0002rZ-31 for emacs-orgmode@gnu.org; Sat, 17 Nov 2018 19:44:13 -0500 Received: by mail-pg1-x530.google.com with SMTP id r9-v6so12215557pgv.6 for ; Sat, 17 Nov 2018 16:44:12 -0800 (PST) In-Reply-To: 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?= , Marco Wahl Cc: emacs-orgmode --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Gustav, > I'm not sure I follow your suggestion regarding changing the > implementation. But anyhow I don't think the implementation is heavy > and at risk of cumbersome code duplication. My opinion ofc =F0=9F=98=8A=20 Sure. The code is not that complicated. > I like the idea of a function that would symbolically links folders > from "ID"-folder structure to a hierarchy-folder structure, based on > the name and path of the org-file and its headings containing the > links. I probably wouldn't use it much myself though. Not until > org-mode starts working better with multiple files, allowing us to > more easily define "org-mode libraries".=20 I am wondering what you mean by "org-mode libraries". Can you explain further?=20 Also, another thought about the attachment: links. It would be useful to implement links to attachments, which are not in the current org entry. For example, something like "attachment:ORG-ID:file-name", where ORG-ID refers to ID of an arbitrary org entry. Best, Ihor Gustav Wikstr=C3=B6m writes: > Hi Ihor, > > I'm not sure I follow your suggestion regarding changing the implementati= on. But anyhow I don't think the implementation is heavy and at risk of cum= bersome code duplication. My opinion ofc =F0=9F=98=8A > > I like the idea of a function that would symbolically links folders from = "ID"-folder structure to a hierarchy-folder structure, based on the name an= d path of the org-file and its headings containing the links. I probably w= ouldn't use it much myself though. Not until org-mode starts working better= with multiple files, allowing us to more easily define "org-mode libraries= ". > > /G=20 > >> -----Original Message----- >> From: Ihor Radchenko >> Sent: den 3 november 2018 04:38 >> To: Gustav Wikstr=C3=B6m ; Marco Wahl >> Cc: emacs-orgmode >> Subject: Re: [O] FW: [RFC] Link-type for attachments, more attach options >>=20 >> Hi Gustav, >>=20 >> Thanks for the patch! >> I am a heavy user of org attachments, so it is pleasant that someone >> spent a time to implement this useful feature into org. >>=20 >> A comment regarding the code. >> Your new link types appears to reimplement some of the code for the >> "file:" links. >> Would it make more sense to implement the "attachment:" link type as >> abbreviation? >> I mean something like the code below: >>=20 >> ```` >> (defun yant/process-att-abbrev (arg) >> "Return `org-attach-dir' for the current entry." >> (s-concat (org-attach-dir 'CREATE) arg)) >>=20 >> (add-to-list 'org-link-abbrev-alist (cons "att" "file:%(yant/process-att= -abbrev)")) >>=20 >> (defun org-att-link-complete (&optional arg) >> "Completion function for att: link." >> (let* ((ref-dir (org-attach-dir 'CREATE)) >> (filelink (let ((default-directory ref-dir)) >> (org-file-complete-link))) >> (filepath (apply #'s-concat (cdr (s-split ":" filelink))))) >> (format "att:%s" filepath))) >>=20 >> (org-link-set-parameters "att" >> :complete #'org-att-link-complete) >> ```` >>=20 >> Also, is anyone interested in automatic placing of org attachments into >> a folder structure, which mirrors the org path? >> Something like in the following Stack Exchange question: >> https://emacs.stackexchange.com/questions/26412/human-readable-directory= -tree-with-org- >> attach >>=20 >> Best, >> Ihor >>=20 >> Gustav Wikstr=C3=B6m writes: >>=20 >> > Hi Marco, >> > >> > Nice to hear you like it! Yeah, I'm pretty happy with that functionali= ty as well. Use it >> all the time to quickly add links to attached files. >> > >> > One use case I have for this (as an example) is for projects and tasks= . I have a >> 'tasks.org' file with nodes for each of my tasks and each of my projects= . Usually, if the >> task is about some digital work, there are files involved with it. So I = have a convention >> to add folders next to the 'tasks.org' file with names like 'YYMM [task/= project title]', >> and attach the folder to each task/project node. C-c C-l attached RET th= en makes it super- >> easy to refer to particular files within that folder, from within the no= de in the >> 'tasks.org' file! >> > >> > Another use case is for my 'digital brain', where it's also fairly com= mon for me to have >> attachment folders where I want to refer to files within them. Images fo= r example, that >> then will be displayed in the org-mode file. Haven't settled on whether = I should use auto- >> managed ID's for these folders, or :ATTACH_DIR: properties though. Curre= ntly using a bit >> of both... >> > >> > I'm not familiar with the 'next' branch and the plans for integrating = it into 'master'. >> But if 'master' is to offensive to merge into straight away, 'next' soun= ds like a good >> option! >> > >> > Kind regards >> > Gustav >> > >> > -----Original Message----- >> > From: Marco Wahl >> > Sent: den 1 november 2018 17:01 >> > To: Gustav Wikstr=C3=B6m >> > Subject: Re: FW: [RFC] Link-type for attachments, more attach options >> > >> > The following message is a courtesy copy of an article that has been p= osted to >> gmane.emacs.orgmode as well. >> > >> > Hi Gustav, >> > >> > I played a bit with your proposition. I like it; in particular the co= mpletion function >> to insert links from the attachment directory with >> > >> > C-c C-l attached RET >> > >> > It seems natural to me to have a more specific link type for attached = files. >> > >> > In my opinion your patch should be applied to the 'next' branch. >> > >> > >> > My 2ct, >> > Marco >> > --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEERZAHPFbUe3JemmzmZHB2Kn2hHYsFAlvwtWwACgkQZHB2Kn2h HYs4vggAmjuI+F5iaKf7aBAQrUIpVv4a+/SC5lSjlNZU4uUR4GA2UeE7JI8wjk4x KGiwdVArL1zy7ZhCOogPAo4fzpcxbT2wYXTEtsx6Qts5n9w69cBZjB7nJ/om7fIp 3IW86zRAa9ZIsZD6eNFbn/QvyLKcdTqVaJa/EgvFvIOIl3X9pDhGmZOn5FvpHpcB o0WAVRtLsOCFe3uYsPokoiKJMtT2TTog3ZKLouQlLR+pM3Ci6A+rYIm6i6hI3mfS /EZnDKgS4BkxVEnqDOwlgtjU0hUoo5X+e0eIEQ0J+N78c749U0ro7ecvpVFW9CeX OkBPbmMF+ORHZDLZOMxOX/1fBFha/Q== =cCaB -----END PGP SIGNATURE----- --=-=-=--