]> git.eshelyaron.com Git - emacs.git/commitdiff
Update to Org 9.6-61-g63e073f
authorKyle Meyer <kyle@kyleam.com>
Sun, 25 Dec 2022 16:36:36 +0000 (11:36 -0500)
committerKyle Meyer <kyle@kyleam.com>
Sun, 25 Dec 2022 16:36:36 +0000 (11:36 -0500)
lisp/org/ob-core.el
lisp/org/ob-tangle.el
lisp/org/oc-basic.el
lisp/org/org-element.el
lisp/org/org-persist.el
lisp/org/org-version.el
lisp/org/org.el
lisp/org/ox-html.el

index f69538f78c9aa0f9854c9211c67f0d0a56661207..c2a3673752ea35c7e693bd22e009b85640a2122b 100644 (file)
@@ -2464,7 +2464,11 @@ INFO may provide the values of these header arguments (in the
                       (cons 'unordered
                             (mapcar
                              (lambda (e)
-                               (list (if (stringp e) e (format "%S" e))))
+                                (cond
+                                 ((stringp e) (list e))
+                                 ((listp e)
+                                  (mapcar (lambda (x) (format "%S" x)) e))
+                                 (t (list (format "%S" e)))))
                              (if (listp result) result
                                (split-string result "\n" t))))
                       '(:splicep nil :istart "- " :iend "\n")))
@@ -3183,8 +3187,8 @@ situations in which is it not appropriate."
          (if (and (memq (string-to-char cell) '(?\( ?`))
                   (not (org-babel-confirm-evaluate
                       ;; See `org-babel-get-src-block-info'.
-                      (list "emacs-lisp" (format "%S" cell)
-                            '((:eval . yes)) nil (format "%S" cell)
+                      (list "emacs-lisp" cell
+                            '((:eval . yes)) nil (format "%s" cell)
                             nil nil))))
              ;; Not allowed.
              (user-error "Evaluation of elisp code %S aborted." cell)
index bd17bda32ba35ea5e23673164525315b2cdb61d1..fd6b6f3b943defa0e47af84f5ea02d4251da9ba7 100644 (file)
@@ -500,7 +500,8 @@ The PARAMS are the 3rd element of the info for the same src block."
                  (cl-letf (((symbol-function 'org-store-link-functions)
                             (lambda () nil)))
                    (org-store-link nil))))
-             (bare (and (string-match org-link-bracket-re l)
+             (bare (and l
+                        (string-match org-link-bracket-re l)
                         (match-string 1 l))))
         (when bare
           (if (and org-babel-tangle-use-relative-file-links
index 3ef7a37e3b3a0362b9122ffee7e1a8f25b7cdf0d..01e314bfdba71c58d0e3e3ca1f42a6bbac680d85 100644 (file)
@@ -162,17 +162,17 @@ Return a hash table with citation references as keys and fields alist as values.
         (puthash (cdr (assq 'id item))
                  (mapcar (pcase-lambda (`(,field . ,value))
                            (pcase field
-                             ('author
-                              ;; Author is an array of objects, each
-                              ;; of them designing a person.  These
-                              ;; objects may contain multiple
-                              ;; properties, but for this basic
-                              ;; processor, we'll focus on `given' and
-                              ;; `family'.
+                             ((or 'author 'editors)
+                              ;; Author and editors are arrays of
+                              ;; objects, each of them designing a
+                              ;; person.  These objects may contain
+                              ;; multiple properties, but for this
+                              ;; basic processor, we'll focus on
+                              ;; `given' and `family'.
                               ;;
                               ;; For compatibility with BibTeX, add
-                              ;; "and" between authors.
-                              (cons 'author
+                              ;; "and" between authors and editors.
+                              (cons field
                                     (mapconcat
                                      (lambda (alist)
                                        (concat (alist-get 'family alist)
index 71c242ea658f9cf7b3502499af990ad5e84ee359..e049c65d6bfaa300f46b1c85782bfe855597914d 100644 (file)
@@ -1365,7 +1365,16 @@ Assume point is at beginning of the inline task."
           (priority (and (looking-at "\\[#.\\][ \t]*")
                          (progn (goto-char (match-end 0))
                                 (aref (match-string 0) 2))))
-          (title-start (point))
+           (commentedp
+           (and (let ((case-fold-search nil))
+                   (looking-at org-element-comment-string))
+                (goto-char (match-end 0))
+                 (when (looking-at-p "\\(?:[ \t]\\|$\\)")
+                   (point))))
+          (title-start (prog1 (point)
+                          (unless (or todo priority commentedp)
+                            ;; Headline like "* :tag:"
+                            (skip-chars-backward " \t"))))
           (tags (when (re-search-forward
                        "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
                        (line-end-position)
@@ -1375,6 +1384,7 @@ Assume point is at beginning of the inline task."
           (title-end (point))
           (raw-value (org-trim
                       (buffer-substring-no-properties title-start title-end)))
+           (archivedp (member org-element-archive-tag tags))
           (task-end (save-excursion
                       (end-of-line)
                       (and (re-search-forward org-element-headline-re limit t)
@@ -1410,7 +1420,9 @@ Assume point is at beginning of the inline task."
                         :todo-keyword todo
                         :todo-type todo-type
                         :post-blank (1- (count-lines (or task-end begin) end))
-                        :post-affiliated begin)
+                        :post-affiliated begin
+                         :archivedp archivedp
+                        :commentedp commentedp)
                   time-props
                   standard-props))))
       (org-element-put-property
index 6ccf357784e1d9f8a941ea6119e7b265bc4d9749..60291e5187f1ec75b8b396e75d3b9ce89052ea90 100644 (file)
@@ -874,15 +874,21 @@ When IGNORE-RETURN is non-nil, just return t on success without calling
 When ASSOCIATED is non-nil, only save the matching data."
   (unless org-persist--index (org-persist--load-index))
   (setq associated (org-persist--normalize-associated associated))
-  (unless
+  (if
       (and (equal 1 (length org-persist--index))
            ;; The single collection only contains a single container
            ;; in the container list.
            (equal 1 (length (plist-get (car org-persist--index) :container)))
            ;; The container is an `index' container.
            (eq 'index (caar (plist-get (car org-persist--index) :container)))
-           ;; No `org-persist-directory' exists yet.
-           (not (file-exists-p org-persist-directory)))
+           (or (not (file-exists-p org-persist-directory))
+               (org-directory-empty-p org-persist-directory)))
+      ;; Do not write anything, and clear up `org-persist-directory' to reduce
+      ;; clutter.
+      (when (and (file-exists-p org-persist-directory)
+                 (org-directory-empty-p org-persist-directory))
+        (delete-directory org-persist-directory))
+    ;; Write the data.
     (let (all-containers)
       (dolist (collection org-persist--index)
         (if associated
@@ -963,6 +969,30 @@ Also, remove containers associated with non-existing files."
             (push collection new-index)))))
     (setq org-persist--index (nreverse new-index))))
 
+(defun org-persist-clear-storage-maybe ()
+  "Clear `org-persist-directory' according to `org-persist--disable-when-emacs-Q'.
+
+When `org-persist--disable-when-emacs-Q' is non-nil and Emacs is called with -Q
+command line argument, `org-persist-directory' is created in potentially public
+system temporary directory.  Remove everything upon existing Emacs in
+such scenario."
+  (when (and org-persist--disable-when-emacs-Q
+             ;; FIXME: This is relying on undocumented fact that
+             ;; Emacs sets `user-init-file' to nil when loaded with
+             ;; "-Q" argument.
+             (not user-init-file)
+             (file-exists-p org-persist-directory))
+    (delete-directory org-persist-directory 'recursive)))
+
+;; Point to temp directory when `org-persist--disable-when-emacs-Q' is set.
+(when (and org-persist--disable-when-emacs-Q
+           ;; FIXME: This is relying on undocumented fact that
+           ;; Emacs sets `user-init-file' to nil when loaded with
+           ;; "-Q" argument.
+           (not user-init-file))
+  (setq org-persist-directory
+        (make-temp-file "org-persist-" 'dir)))
+
 ;; Automatically write the data, but only when we have write access.
 (let ((dir (directory-file-name
             (file-name-as-directory org-persist-directory))))
@@ -972,20 +1002,12 @@ Also, remove containers associated with non-existing files."
   (if (not (file-writable-p dir))
       (message "Missing write access rights to org-persist-directory: %S"
                org-persist-directory)
+    (add-hook 'kill-emacs-hook #'org-persist-clear-storage-maybe) ; Run last.
     (add-hook 'kill-emacs-hook #'org-persist-write-all)
     ;; `org-persist-gc' should run before `org-persist-write-all'.
     ;; So we are adding the hook after `org-persist-write-all'.
     (add-hook 'kill-emacs-hook #'org-persist-gc)))
 
-;; Point to temp directory when `org-persist--disable-when-emacs-Q' is set.
-(if (and org-persist--disable-when-emacs-Q
-         ;; FIXME: This is relying on undocumented fact that
-         ;; Emacs sets `user-init-file' to nil when loaded with
-         ;; "-Q" argument.
-         (not user-init-file))
-    (setq org-persist-directory
-          (make-temp-file "org-persist-" 'dir)))
-
 (add-hook 'after-init-hook #'org-persist-load-all)
 
 (provide 'org-persist)
index 8de0d1a4a9760867829e0c90f0ece77d62e1b2bf..a0016265f029f3746a10b3f9aaebdb20b59853c5 100644 (file)
@@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made."
 (defun org-git-version ()
   "The Git version of Org mode.
 Inserted by installing Org or when a release is made."
-   (let ((org-git-version "release_9.6-49-g47d129"))
+   (let ((org-git-version "release_9.6-61-g63e073f"))
      org-git-version))
 \f
 (provide 'org-version)
index 6aa2a16219d80e8cfb31eb0b912206a9731317e1..ab8b76b926a656d87591d2b8779e99a08ccba7d9 100644 (file)
@@ -20213,7 +20213,10 @@ interactive command with similar behavior."
 (defun org-back-to-heading (&optional invisible-ok)
   "Go back to beginning of heading."
   (beginning-of-line)
-  (or (org-at-heading-p (not invisible-ok))
+  (or (and (org-at-heading-p (not invisible-ok))
+           (not (and (featurep 'org-inlinetask)
+                   (fboundp 'org-inlinetask-end-p)
+                   (org-inlinetask-end-p))))
       (if (org-element--cache-active-p)
           (let ((heading (org-element-lineage (org-element-at-point)
                                            '(headline inlinetask)
index 86b10cbf785b1d80773bfd45d262c3a44604d7f7..19cdf4c5a265b997de9ed8439037e7a6c3f87032 100644 (file)
@@ -3337,7 +3337,7 @@ INFO is a plist holding contextual information.  See
                      ((org-html-standalone-image-p destination info)
                       (org-export-get-ordinal
                        (org-element-map destination 'link #'identity info t)
-                       info 'link 'org-html-standalone-image-p))
+                       info '(link) 'org-html-standalone-image-p))
                      (t (org-export-get-ordinal
                          destination info nil counter-predicate))))
                     (desc