emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* attachments and inheritance (bug?)
@ 2020-07-09 15:27 Julius Dittmar
  2020-09-06  8:38 ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Julius Dittmar @ 2020-07-09 15:27 UTC (permalink / raw)
  To: Org Mode

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: attachments and inheritance (bug?)
  2020-07-09 15:27 attachments and inheritance (bug?) Julius Dittmar
@ 2020-09-06  8:38 ` Bastien
  2020-09-06  8:52   ` flare
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2020-09-06  8:38 UTC (permalink / raw)
  To: Julius Dittmar; +Cc: Org Mode

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: attachments and inheritance (bug?)
  2020-09-06  8:38 ` Bastien
@ 2020-09-06  8:52   ` flare
  2020-09-06  9:12     ` tomas
  2020-09-06 10:10     ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: flare @ 2020-09-06  8:52 UTC (permalink / raw)
  To: emacs-orgmode


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,



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: attachments and inheritance (bug?)
  2020-09-06  8:52   ` flare
@ 2020-09-06  9:12     ` tomas
  2020-09-06 10:10     ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: tomas @ 2020-09-06  9:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: attachments and inheritance (bug?)
  2020-09-06  8:52   ` flare
  2020-09-06  9:12     ` tomas
@ 2020-09-06 10:10     ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien @ 2020-09-06 10:10 UTC (permalink / raw)
  To: flare; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-06 10:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-09 15:27 attachments and inheritance (bug?) Julius Dittmar
2020-09-06  8:38 ` Bastien
2020-09-06  8:52   ` flare
2020-09-06  9:12     ` tomas
2020-09-06 10:10     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).