emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Feature] Store heading properties remotely, outside the Org file (was:


From: Ihor Radchenko
Subject: [Feature] Store heading properties remotely, outside the Org file (was: Completely hide properties drawer in 9.6)
Date: Sun, 18 Dec 2022 13:26:29 +0000

Below is the idea how one can store heading properties in a separate
file or even database.

I think it might be of interest for users who hate property drawer
clutter yet needed to store some metadata associated with Org headings.

To be consistent with Org internal logic, we may, instead of using ID,
use a separate :INCLUDE-PROPERTIES: heading property to define where the
additional heading properties are stored.

If a heading has :INCLUDE-PROPERTIES:, the properties will be calculated
according to: (1) heading property drawer; (2) INCLUDE-PROPERTIES value;
(3) parent headings, if property inheritance is enabled.

The value of INCLUDE-PROPERTIES might be a file:/id: link that may point to
another Org heading, or, potentially (maybe via third-party packages),
to SQL database.

Jean Louis <bugs@gnu.support> writes:

> To me it is very practical to have this simple heading with a drawer
> that is completely hidden, which references by using UUID to a complex
> set of properties. To somebody else, that may not be useful or is
> abstract to understand.
>
> In my work I would not like having more properties for Org heading but
> one, like this one:
>
> * My heading
>   :PROPERTIES:
>   :ID: 944334aa-acab-4e6a-8dd6-ebfd144eac6b
>   :END:
>
> And that alone would be a reference to any other property that I
> personally may need. It is a link from heading to relations to many
> different pieces of information. 
> ...
> Emacs 29 has SQLite built-in, there is PostgreSQL module and also
> rcd-hash-edit package that works in similar way as shown on
> video. Hashes may easily be stored in text files and read from text files. 
> ...
> And by thinking that, it is also possible to make Org functions that save 
> properties in separate Org file automatically. 
>
> In case of the heading like this:
>
> * My heading
>   :PROPERTIES:
>   :ID: 944334aa-acab-4e6a-8dd6-ebfd144eac6b
>   :END:
>
> One could have a separate Org file that is used only to write properties, and 
> which could contain something like following:
>
> * 944334aa-acab-4e6a-8dd6-ebfd144eac6b
>   :PROPERTIES:
>   :DATE-CREATED: 2022-12-18
>   :PERSON-RELATED: Ihor Radchenko
>   :END:
>
> There are many reasons why properties should be hidden or separate
> from Org file, apart from aesthetics and readability. I have been
> sharing Org files and headings too many times to staff members
> (without export), and then why should other person see clocked or
> scheduled properties if such are not meant for that person?
>
> The above eloboration demonstrates that properties could not only be
> hidden from main view, but become structural and organized collection
> of data. Storage is possible into PostgreSQL by using emacs-libpq
> module or PostgreSQL packages, in Emacs 29 by using the built-in
> SQLite or SQLite packages, or cdb database or key/value databases, or
> by storing hashes into files, or by storing properties into separate
> Org files.
>
> Implementation is close to fingertips.
>
> Generally, using properties and UUIDs as references to properties,
> also liberates properties from Org mode and gives the power of
> referencing to any kind of text or mode.
>
> That means, having Markdown file with commented UUID, could allow the
> user to have the same properties as in Org mode, one could freely tag,
> clock-in, clock-out, schedule, deadline, etc. any kind of Markdown
> heading, whatabout Asciidoc, truly plain text, HTML pieces, Wiki, and
> other formats and files.
>
> In normal text files, I would then make UUIDs invisible inside of
> Emacs, when necessary:
>
> (defun rcd-uuid-reference-make-invisible ()
>   "Make all UUIDs in buffer invisible."
>   (interactive)
>   (save-excursion
>     (goto-char (point-min))
>     (while (search-forward-regexp thing-at-point-uuid-regexp nil t)
>       (when (thing-at-point 'uuid)
>       (facemenu-set-invisible (match-beginning 0) (match-end 0))))))
>
> ;; df2c9f4d-77ab-4697-842e-d7aa31ffeee3
>
> If UUIDs are disturbing in the output, then I would have a filter to
> export the file without UUIDs, when necessary.


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]