So passen Sie die Notizen am Ende einer Aufgabe im Organisationsmodus an bzw. analysieren sie

Ich suche nach einer Möglichkeit, das, was ich als "Notizen" bezeichne, abzugleichen. Dies ist die letzte Zeile (oder der letzte Zeilensatz) einer Organisationsaufgabe, in der es heißt:These are the notes of the task."

Ich habe einen wirklich komponiertlange regexp daskann mach den Job, aber ich hoffe, dass der Org-Modus schon etwas Besseres bietet:

"^\\(\\*\\*\\)\\(?: +\\(Active\\|Next Action\\|Hold\\|Reference\\|Delegated\\|Postponed\\|Waiting\\|Someday\\|Planning\\|Canceled\\|None\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*\\(?:\\(\n\\)\\)?\\(?: +\\(DEADLINE:\\|SCHEDULED:\\)\\)?\\(?: +\\(<\\)\\([^>]+\\)\\(>\\)\\)?\\(?: +\\(DEADLINE:\\|SCHEDULED:\\)\\)?\\(?: +\\(<\\)\\([^>]+\\)\\(>\\)\\)?\\(?:\\(\n\\)\\)?\\(?: +\\(CLOSED:.*\\)\\)?\\(?:\\(\n\\)\\)?\\(?: +\\(:PROPERTIES:\\)\\)?\\(?:\\(\n\\)\\)?\\(?: +\\(:ToodledoID:\\)\\)?\\(?: +\\([0-9]+\\)\\)?\\(?:\\(\n\\)\\)?\\(?: +\\(:ToodledoFolder:\\)\\)?\\(?: +\\(EVENTS\\|TASKS\\|UNDATED\\|DONE\\|CONTACT\\)\\)?\\(?:\\(\n\\)\\)\\(?: +\\(:Hash:\\)\\)?\\(?: +\\(.*+\\)\\)?\\(?:\\(\n\\)\\)?\\(?: +\\(:END:\\)\\)?\\(?:\\(\n\\)\\)?\\(.*\\(?:\n.*\\)*?\\)\\(?:^\\)"
** Delegated [#A] 0 @ Title of the task. :event:lawlist:
   DEADLINE: <2014-01-11 Sat 08:00>  SCHEDULED: <2014-01-11 Sat>
   :PROPERTIES:
   :ToodledoID: 353081871
   :ToodledoFolder: EVENTS
   :Hash: 20657e7586fcc67da708789d7bbc0fbd
   :END:
These are the notes of the task.

Die vollständigsten Beispiele für das Parsen einer von mir gefundenen Organisationsaufgabeorg-element-parse-bufferAber ich sehe immer noch nicht den Schlüssel, um nur die Noten zu extrahieren:https://github.com/yyr/org-mode/blob/master/testing/lisp/test-org-element.el

Wenn möglich, hätte ich gerne etwas Ähnlichesimaginär Code(org-element-property :notes (org-element-at-point)), welchenicht Zum Extrahieren der Notizen muss der Teilbaum eingegrenzt werden. Ich habe ein paar hundert Aufgaben, und ich suche nach einem Weg, umschnell Kämmen Sie die Master-Organisationsdatei und erstellen Sie meinen eigenen benutzerdefinierten Agenda-Puffer, in dem das erste und das nächste angezeigt werdenvielleicht die zweiten Zeilen (wenn Frist oder geplant) und die Notizen am Endewenn sie existieren. Ich habe das Gefühl, dass es eine erhebliche Verzögerung geben wird, um die endgültige Anzeige zu erstellen, wenn ich mich auf einen Teilbaum für 200 Aufgaben beschränken muss.

Damit sind die ersten beiden Zeilen der Aufgabe bereits erledigt:

(defvar lawlist-org-heading-regexp
  "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*\\(\n.*DEADLINE.*$\\)"
  "Custom match org headline, plus the second line with a deadline.")

(setq txt
  (save-excursion
    (org-back-to-heading t)
    (when (looking-at org-heading-regexp)
        (concat
          (match-string 1)
          " "
          (match-string 2)
          (if (and (looking-at lawlist-org-heading-regexp) (match-string 3))
            (match-string 3))
          "\n" )))) )

(message "%s" (org-element-map (org-element-parse-buffer) 'paragraph 'identity nil t)) gibt mir folgendes:

 (paragraph 
  (:begin 244 
      :end 276 
      :contents-begin 244 
      :contents-end 276 
      :post-blank 0 
      :post-affiliated 244 
      :parent (section 
           (:begin 58 
               :end 276 
               :contents-begin 58 
               :contents-end 276 
               :post-blank 0 
               :parent (headline 
                (:raw-value 0 
                        @ 
                        Title of the task. 
                        :begin 1 
                        :end 276 
                        :pre-blank 0 
                        :hiddenp nil 
                        :contents-begin 58 
                        :contents-end 276 
                        :level 2 
                        :priority 65 
                        :tags (event lawlist) 
                        :todo-keyword Delegated 
                        :todo-type todo 
                        :post-blank 0 
                        :footnote-section-p nil 
                        :archivedp nil 
                        :commentedp nil 
                        :quotedp nil 
                        :deadline (timestamp 
                               (:type active 
                                  :raw-value <2014-01-11 Sat 08:00> 
                                  :year-start 2014 
                                  :month-start 1 
                                  :day-start 11 
                                  :hour-start 8 
                                  :minute-start 0 
                                  :year-end 2014 
                                  :month-end 1 
                                  :day-end 11 
                                  :hour-end 8 
                                  :minute-end 0 
                                  :begin 71 
                                  :end 95 
                                  :post-blank 2)) 
                        :scheduled (timestamp 
                            (:type active 
                                   :raw-value <2014-01-11 Sat>
                                   :year-start 2014
                                   :month-start 1
                                   :day-start 11
                                   :hour-start nil
                                   :minute-start nil
                                   :year-end 2014
                                   :month-end 1
                                   :day-end 11
                                   :hour-end nil
                                   :minute-end nil
                                   :begin 106
                                   :end 122
                                   :post-blank 0))
                        :TOODLEDOID 353081871
                        :TOODLEDOFOLDER EVENTS
                        :HASH 20657e7586fcc67da708789d7bbc0fbd
                        :CATEGORY .scratch
                        :title (0 @ Title of the task.)
                        :parent (org-data nil #4)) #2)) 
           (planning (:closed nil
                  :deadline (timestamp 
                         (:type active
                            :raw-value <2014-01-11 Sat 08:00>
                            :year-start 2014
                            :month-start 1
                            :day-start 11
                            :hour-start 8
                            :minute-start 0
                            :year-end 2014
                            :month-end 1
                            :day-end 11
                            :hour-end 8
                            :minute-end 0
                            :begin 71
                            :end 95
                            :post-blank 2))
                  :scheduled (timestamp 
                          (:type active
                             :raw-value <2014-01-11 Sat>
                             :year-start 2014
                             :month-start 1
                             :day-start 11
                             :hour-start nil
                             :minute-start nil
                             :year-end 2014
                             :month-end 1
                             :day-end 11
                             :hour-end nil
                             :minute-end nil
                             :begin 106
                             :end 122
                             :post-blank 0))
                  :begin 58
                  :end 123
                  :post-blank 0
                  :parent #2)) 
           (property-drawer (:begin 123
                    :end 244
                    :hiddenp nil
                    :contents-begin 139
                    :contents-end 235
                    :post-blank 0
                    :post-affiliated 123
                    :parent #2) 
                (node-property (:key ToodledoID
                             :value 353081871
                             :begin 139
                             :end 165
                             :post-blank 0
                             :parent #3)) 
                (node-property (:key ToodledoFolder
                             :value EVENTS
                             :begin 165
                             :end 192
                             :post-blank 0
                             :parent #3)) 
                (node-property (:key Hash
                             :value 20657e7586fcc67da708789d7bbc0fbd
                             :begin 192
                             :end 235
                             :post-blank 0
                             :parent #3))) 
           #0))
  These are the notes of the task.)

Antworten auf die Frage(1)

Ihre Antwort auf die Frage