Hi,
> ATTACH_DIR_INHERIT is no longer supported and is +removed.
I just found that removing ATTACH_DIR_INHERIT broke my current
configuration. I do not use ATTACH_DIR property - all the attachment
folders are created using ID. Also, I use ID property to store links to
entries. Therefore, inheriting ATTACH_DIR does nothing for me and
inheriting ID always gives the current entry's id value. At the end, I
cannot make a common attachment directory for the whole subtree, like I
was able to do with ATTACH_DIR_INHERIT.
Regards,
Ihor
Gustav Wikström writes:
> Hi!
>
>> > + (if should-get
>> > + (progn (message "Running git annex get \"%s\"." path-relative)
>> > + (call-process "git" nil nil nil "annex" "get" path-relative))
>> > +(error "File %s stored in git annex but it is not available, and was
>> > not
>> retrieved"
>> > + path))
>>
>> Nitpick:
>>
>> (unless should-get
>> (error "File %S stored in git annex but unavailable" path))
>> (message "Running git annex get %S." path-relative)
>> (call-process ...)
>
> Ok, fixed.
>
>> > +Selective means to respect the inheritance setting in
>> > +`org-use-property-inheritance'."
>> >:group 'org-attach
>> > + :type '(choice
>> > +(const :tag "Don't use inheritance" nil)
>> > +(const :tag "Inherit parent node attachments" t)
>> > +(const :tag "Respect org-use-property-inheritance" selective)
>> > +)
>>
>> Dangling paren spotted.
>
> Fixed.
>
>> > + (setq attachment (or (org-attach-dir)
>> > + (quote "Can't find an existing attachment-folder")))
>>
>> You forgot to remove that weird quote. Maybe you meant `error'?
>
> Hmm, actually no. But the code is pretty bad so I've refactored it a
> bit. The purpose of the change is for org-attach to give an indication
> of the active attachment path, or to signal that there is none. But
> for that I don't really need a separate variable. Thus it's slightly
> refactored for code-clarity.
>
>> > +(if attach-dir
>> > + (progn (if (not (file-directory-p attach-dir))
>> > + (make-directory attach-dir t))
>> > + attach-dir)
>> > + (error "No attachment directory is associated with the current
>> > node"
>>
>> Same nitpick as above:
>>
>> (unless attach-dir
>> (error "No attachment ..."))
>> (if (file-directory-p attach-dir) attach-dir
>> (make-directory attach-dir))
>
> Ok, fixed.
>
>> > +(defun org-attach-dir-from-id (id)
>> > + "Creates a path based on `org-attach-id-dir' and ID."
>> > + (expand-file-name
>> > + (funcall org-attach-id-to-path-function id)
>> > + (expand-file-name org-attach-id-dir)))
>>
>> Creates path -> Return a file name.
>
> Fixed.
>
>> > +of the entry. Creates relative links if `org-attach-dir-relative'
>> > +is t.
>>
>> Nitpick:
>>
>> is t -> is non-nil.
>
> Ah, true. Fixed.
>
>> If tests pass, feel free to apply the patches in master. Thank you!
>
> Got it. Aaand one test failure. That test is unrelated to my changes
> though, and fails also on master. Test-org-table/copy-down. So I'll
> try to apply my patch asap regardless of that one test failing.
>
> Just one more thing - a few days back I added a row to lisp/ox-html.el
> regarding inline-images. I'm including that change as well since it
> relates 100% to the new attachment link. I looked in the other
> export-backends too but didn't add anything due to lack of time for
> testing. Maybe the additions for other backends is as trivial as for
> html. So someone who regularly export to those backends might want to
> suggest patches for them to make attachment links to images actually
> display as images?
>
> Final patches attached for full disclosure before applying them.
>
>>
>> Regards,
>>
>> --
>> Nicolas Goaziou
> From 3cbe356b0a9d1a98848df0fa09ba306392995b88 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Gustav=20Wikstr=C3=B6m?=
> Date: Sun, 26 May 2019 03:34:34 +0200
> Subject: [PATCH 1/2] org-test, test-org-element, test-org, test-ox,
> test-property-inheritance
>
> * org-test.el:
>
> Fix org-test-with-temp-text-in-file. Make it work with , as
> some tests already expect it to do! Also make it fail more gracefully
> by still removing temporary buffers and files.
>
> Improve org-test-in-example-file. Make it behave similar to
> org-test-with-temp-text and org-test-with-temp-text-in-file, in that
> it will return the last evaluated expression.
>
> * testing/lisp/test-org-element.el
>
> Fix a temp-text strings so that it doesn't have an initial newline.
>
> * testing/lisp/test-org.el
>
> Minor cleanup to align code-structure with other tests. Nothing
> changes in the test execpt style.
>
> * testing/lisp/test-ox.el
>
> Fix a couple of temp-text strings so that they don't have initial
> newlines.
>
> ** test-org-export/expand-include
>
> Test specification was wrong, due to org-test-with-temp-text-in-file
> not previously working with . Since that is fixed in this
> patch the