emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Emacs inserts hardwired org-agenda-files variable, overwriting user


From: Jean Louis
Subject: Re: Emacs inserts hardwired org-agenda-files variable, overwriting user options
Date: Sun, 13 Dec 2020 23:28:42 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Christopher Dimech <dimech@gmx.com> [2020-12-13 20:49]:
> > Reference to manual:
> > (info "(org) TODO Items")
> >
> > And it is definitely not a "plain text". It is probably largest mode
> > for Emacs, a true and full application handling much more than plain
> > text. It has more than 129 Emacs Lisp files. Maybe in beginning it was
> > plain text, not any more now. Now it is a wannabe database.
> 
> In a way it is becoming the opposite of what Carsten was trying to do
> in the beginning.  And plain text is always portable.
> 
> We should not exclude the original intention and use, making it fully
> database.

It is already text type of a database with structured data built into
properties and tags, headings, body of headings, etc. Just that it is
scattered database of things that do not have well defined its own
place.

As I see it, one could keep Org file in the database and edit it on
the file system and that it all gets updated to the database. That way
it would become collaborative Org mode. It is easier than one can
imagine.

I was using simple function to update Org TODO tasks to database.

(defun hyperscope-capture-org-heading ()
  "Captures Org heading and stores it in the Hyperscope dynamic
  knowledge repository"
  (interactive)
  (let* ((body (org-copy-subtree nil nil nil t))
         (body (pop kill-ring))
         (body (org-no-properties body))
         (heading (org-get-heading))
         (created (org-property-values "CREATED"))
         (date (if created (substring (car created) 1 11) nil))
         (body (with-temp-buffer
                 (insert body)
                 (org-mode)
                 (org-back-to-heading)
                 (kill-line)
                 (delete-matching-lines ":PROPERTIES:")
                 (delete-matching-lines ":CREATED:")
                 (delete-matching-lines ":ID:")
                 (delete-matching-lines ":END:")
                 (buffer-string))))
    (hyperscope-add-note-to-set-1 heading body date)))

(defun hyperscope-capture-org-heading-as-note-for-person ()
  "Captures Org heading for a person and stores it in the
  Hyperscope dynamic knowledge repository"
  (interactive)
  (let* ((body (org-copy-subtree nil nil nil t))
         (body (pop kill-ring))
         (body (org-no-properties body))
         (heading (org-get-heading))
         (created (org-property-values "CREATED"))
         (date (if created (substring (car created) 1 11) nil))
         (body (with-temp-buffer
                 (insert body)
                 (org-mode)
                 (org-back-to-heading)
                 (kill-line)
                 (delete-matching-lines ":PROPERTIES:")
                 (delete-matching-lines ":CREATED:")
                 (delete-matching-lines ":ID:")
                 (delete-matching-lines ":END:")
                 (buffer-string)))
         (contact (cf-search-id (read-from-minibuffer "Contact: " nil nil nil 
'cf-search-history))))
    (hyperscope-add-note-to-set-1 heading body date)))

Similar functions could be used to to simply update the record in the
database. And all meta data of Org properties, tags, etc, all that
could be inserted into database.

Jean





reply via email to

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