Hello friends, either I misunderstood something or I stumbled upon a bug. Situation: I have a heading with some files attached. This heading has an ID property, upon which the directory for those files is based. There's also a subheading with no ID. Inside of that subheading I'd like to link to one of the attached files. But although org-attach-use-inheritance is non-nil, the attachment is not found from inside that subheading. Shouldn't it be found? Thanks for any pointers, Julius #+name main.org #+begin_src org ,* first heading :ATTACH: :PROPERTIES: :ID: 7eai57u0npi0 :END: [[attachment:some-file.txt]] ,** subheading (no ID property here) [[attachment:some-file.txt]] #+end_src #+name some-file.txt #+begin_src text Just some junk to verify whether the correct file is displayed. #+end_src - GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.10.9) of 2018-07-06 - org-mode: current master - no setting containing 'attach' in any configuration file
Hi Julius, Dittmar <Julius.Dittmar@gmx.de> writes: > Hello friends, > > either I misunderstood something or I stumbled upon a bug. > > Situation: I have a heading with some files attached. This heading has > an ID property, upon which the directory for those files is based. > > There's also a subheading with no ID. Inside of that subheading I'd like > to link to one of the attached files. But although > org-attach-use-inheritance is non-nil, the attachment is not found from > inside that subheading. > > Shouldn't it be found? I tried your example and the file is found for both links. What is the exact value of `org-attach-use-inheritance' (t or 'selective)? If 'selective, what is the value of `org-use-property-inheritance'? > - GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.10.9) of > 2018-07-06 > - org-mode: current master > - no setting containing 'attach' in any configuration file Can you provide a reproducible recipe with a minimal configuration? Thanks, -- Bastien
I have run into this issue myself, my solution for this ended up being
a quick hack to toggle this inheritence so that subheadings could reach
into superheadings when referencing the same attachments.
#+BEGIN_SRC elisp
(defun org-attach-switch-inheritence ()
"Allows for Subtrees to have their own distinct attach directories"
(interactive)
(if (member "ID" org-use-property-inheritance)
(progn
(setq org-use-property-inheritance
(delete "ID" org-use-property-inheritance)
)
(message "ID Inheritance Disabled")
)
(add-to-list 'org-use-property-inheritance "ID")
(message "ID Inheritance Enabled")
)
)
;; keybinding for C-c C-A
(local-set-key [3 33554433] 'org-attach-switch-inheritence)
#+END_SRC
Bastien writes:
> Hi Julius,
>
> Dittmar <Julius.Dittmar@gmx.de> writes:
>
>> Hello friends,
>>
>> either I misunderstood something or I stumbled upon a bug.
>>
>> Situation: I have a heading with some files attached. This heading has
>> an ID property, upon which the directory for those files is based.
>>
>> There's also a subheading with no ID. Inside of that subheading I'd like
>> to link to one of the attached files. But although
>> org-attach-use-inheritance is non-nil, the attachment is not found from
>> inside that subheading.
>>
>> Shouldn't it be found?
>
> I tried your example and the file is found for both links.
>
> What is the exact value of `org-attach-use-inheritance' (t or 'selective)?
>
> If 'selective, what is the value of `org-use-property-inheritance'?
>
>> - GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.10.9) of
>> 2018-07-06
>> - org-mode: current master
>> - no setting containing 'attach' in any configuration file
>
> Can you provide a reproducible recipe with a minimal configuration?
>
> Thanks,
[-- Attachment #1: Type: text/plain, Size: 571 bytes --] On Sun, Sep 06, 2020 at 01:52:36AM -0700, flare wrote: > > I have run into this issue myself, my solution for this ended up being > a quick hack to toggle this inheritence so that subheadings could reach > into superheadings when referencing the same attachments. > > #+BEGIN_SRC elisp > > (defun org-attach-switch-inheritence () ^^^^^^ Sorry for calling in from the peanut gallery... the conventional term for that kind of thing seems to be "toggle", not "switch", right? Anyway, thanks for making Org better :-) Cheers - t [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]
flare <gabrielxaviersmith@gmail.com> writes:
> I have run into this issue myself
Can you provide a reproducible recipe?
Perhaps I am missing something obvious, but I don't have the problem
reported by the OP.
--
Bastien