emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: flare <gabrielxaviersmith@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: attachments and inheritance (bug?)
Date: Sun, 06 Sep 2020 01:52:36 -0700	[thread overview]
Message-ID: <871rjfffsb.fsf@gmail.com> (raw)
In-Reply-To: <87lfhnpaep.fsf@gnu.org>


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,



  reply	other threads:[~2020-09-06  8:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 15:27 attachments and inheritance (bug?) Julius Dittmar
2020-09-06  8:38 ` Bastien
2020-09-06  8:52   ` flare [this message]
2020-09-06  9:12     ` tomas
2020-09-06 10:10     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rjfffsb.fsf@gmail.com \
    --to=gabrielxaviersmith@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).