From 88d218a5a085a2c0484141b3b39e1fc2bc8cce44 Mon Sep 17 00:00:00 2001 From: Bastien Date: Wed, 19 Feb 2020 18:10:26 +0100 Subject: [PATCH 1/4] Fix 5acf4d4692 --- lisp/ox-latex.el | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 46983bf43..2d6acb13e 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2172,25 +2172,27 @@ contextual information." "Transcode an ITEM element from Org to LaTeX. CONTENTS holds the contents of the item. INFO is a plist holding contextual information." - (let* ((counter - (let ((count (org-element-property :counter item)) - (level - ;; Determine level of current item to determine the - ;; correct LaTeX counter to use (enumi, enumii...). - (let ((parent item) (level 0)) - (while (memq (org-element-type - (setq parent (org-export-get-parent parent))) - '(plain-list item)) - (when (and (eq (org-element-type parent) 'plain-list) - (eq (org-element-property :type parent) - 'ordered)) - (cl-incf level))) - level))) - (and count - (< level 5) - (format "\\setcounter{enum%s}{%s}\n" - (nth (1- level) '("i" "ii" "iii" "iv")) - (1- count))))) + (let* ((orderedp (eq (org-element-property + :type (org-export-get-parent item)) + 'ordered)) + (level + ;; Determine level of current item to determine the + ;; correct LaTeX counter to use (enumi, enumii...). + (let ((parent item) (level 0)) + (while (memq (org-element-type + (setq parent (org-export-get-parent parent))) + '(plain-list item)) + (when (and (eq (org-element-type parent) 'plain-list) + (eq (org-element-property :type parent) + 'ordered)) + (cl-incf level))) + level)) + (count (org-element-property :counter item)) + (counter (and count + (< level 5) + (format "\\setcounter{enum%s}{%s}\n" + (nth (1- level) '("i" "ii" "iii" "iv")) + (1- count)))) (checkbox (cl-case (org-element-property :checkbox item) (on "$\\boxtimes$") (off "$\\square$") @@ -2209,9 +2211,11 @@ contextual information." "\\item" (cond ((and checkbox tag) - (format "{%s %s} %s" checkbox tag tag-footnotes)) + (format (if orderedp "{%s %s} %s" "[{%s %s}] %s") + checkbox tag tag-footnotes)) ((or checkbox tag) - (format "{%s} %s" (or checkbox tag) tag-footnotes)) + (format (if orderedp "{%s} %s" "[{%s}] %s") + (or checkbox tag) tag-footnotes)) ;; Without a tag or a check-box, if CONTENTS starts with ;; an opening square bracket, add "\relax" to "\item", ;; unless the brackets comes from an initial export From 05f294ec5b77e059bd09137d5ca7d1cfb3529e99 Mon Sep 17 00:00:00 2001 From: Bastien Date: Fri, 21 Feb 2020 16:12:11 +0100 Subject: [PATCH 2/4] org.el: Two minor fixes * lisp/org.el (org-set-tags-command): Fix point position after setting tag at the beginning of a blank heading. (org-kill-line): Prevent from throwing an error when killing the headline while point is right after the * chars. --- lisp/org.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 81a0bf7fb..3d841dfa6 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12345,7 +12345,9 @@ in Lisp code use `org-set-tags' instead." #'org-tags-completion-function nil nil (org-make-tag-string current-tags) 'org-tags-history))))))) - (org-set-tags tags))))))) + (org-set-tags tags))))) + ;; `save-excursion' may not replace the point at the right position: + (when (looking-back "^\*+") (forward-char)))) (defun org-align-tags (&optional all) "Align tags in current entry. @@ -20394,7 +20396,8 @@ depending on context." (if (<= end (point)) ;on tags part (kill-region (point) (line-end-position)) (kill-region (point) end))) - (org-align-tags)) + ;; Only align tags when we are still on a heading: + (if (org-at-heading-p) (org-align-tags))) (t (kill-region (point) (line-end-position))))) (defun org-yank (&optional arg) From 38928848c7d5bde4aecd160ee4093fc423f2b4c3 Mon Sep 17 00:00:00 2001 From: Bastien Date: Sun, 23 Feb 2020 14:29:38 +0100 Subject: [PATCH 3/4] org-id.el: Fix typo in comment * lisp/org-id.el (org-id-find-id-file): Fix typo in comment. --- lisp/org-id.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-id.el b/lisp/org-id.el index 3efbde04d..14a461500 100644 --- a/lisp/org-id.el +++ b/lisp/org-id.el @@ -631,7 +631,7 @@ When FILES is given, scan also these files." (or (and org-id-locations (hash-table-p org-id-locations) (gethash id org-id-locations)) - ;; ball back on current buffer + ;; Fall back on current buffer (buffer-file-name (or (buffer-base-buffer (current-buffer)) (current-buffer))))) From 46886f22d99e9fa45cc02427af9271ca37028b7d Mon Sep 17 00:00:00 2001 From: Bastien Date: Mon, 24 Feb 2020 10:34:46 +0100 Subject: [PATCH 4/4] doc/org-manual.org (Completion): Fix documentation * doc/org-manual.org (Completion): Fix documentation. --- doc/org-manual.org | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 8e221d59d..1b1a0f50a 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -18340,9 +18340,6 @@ shortcuts. - After =\=, complete TeX symbols supported by the exporter. - - After =*=, complete headlines in the current buffer so that they - can be used in search links like: =[[*find this headline]]= - - After =:= in a headline, complete tags. Org deduces the list of tags from the =TAGS= in-buffer option (see [[*Setting Tags]]), the variable ~org-tag-alist~, or from all tags used in the current @@ -18352,7 +18349,10 @@ shortcuts. of keys is constructed dynamically from all keys used in the current buffer. - - After =[=, complete link abbreviations (see [[*Link Abbreviations]]). + - After =[[=, complete link abbreviations (see [[*Link Abbreviations]]). + + - After =[[*=, complete headlines in the current buffer so that they + can be used in search links like: =[[*find this headline]]= - After =#+=, complete the special keywords like =TYP_TODO= or file-specific =OPTIONS=. After option keyword is complete,