[elpa] elpa-admin 3de676c: * elpa-admin.el: Fix computation of list of docs

2021-10-16 Thread monnier--- via
branch: elpa-admin
commit 3de676cde3fce160b093e93d6aa3762e60a680a4
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-admin.el: Fix computation of list of docs

We can't compute the list of HTML docs from the `:doc` property (and
even if we could it would not be a good idea), so instead keep track
of those docs as we build them so the data is readily available.

(elpaa--html-insert-docs): Get the HTML docs names from the pkg-spec.
(elpaa--html-build-doc): Add `pkg-spec` arg.
Put the doc's info into the `pkg-spec`.
(elpaa--build-Info-1): Add `pkg-spec` arg accordingly.
(elpaa--build-Info): Adjust accordingly.
---
 elpa-admin.el | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/elpa-admin.el b/elpa-admin.el
index ef0b37b..a13b17f 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1399,7 +1399,7 @@ arbitrary code."
   (concat (file-name-base docfile) ".html"))
 
 (defun elpaa--html-insert-docs (pkg-spec)
-  (let ((docfiles (elpaa--get-docfiles pkg-spec))
+  (let ((docfiles (plist-get (cdr pkg-spec) :internal--html-docs))
;; `html-dir' is relative to the tarball directory, so html
;; references on mirrors work.  It does not include the
;; package name, so cross references among package docs work.
@@ -1410,10 +1410,10 @@ arbitrary code."
   ;; Should we use (expand-file-name pkg html-dir) instead?
(file-readable-p html-dir)) ;; html doc files were built
   (insert "Documentation\n")
-  (dolist (f docfiles)
-   (let ((html-file (concat html-dir (elpaa--doc-html-file f
+  (dolist (doc docfiles)
+   (let ((html-file (concat html-dir (cdr doc
  (insert ""
- (file-name-sans-extension f)
+ (car doc)
  "\n")
  ;; FIXME: get link text from info direntry?
  ))
@@ -1965,9 +1965,9 @@ directory; one of archive, archive-devel."
(make-directory html-dir t)))
 
 (dolist (f docfiles)
-  (elpaa--build-Info-1 f dir html-dir
+  (elpaa--build-Info-1 pkg-spec f dir html-dir
 
-(defun elpaa--html-build-doc (docfile html-dir)
+(defun elpaa--html-build-doc (pkg-spec docfile html-dir)
   (setq html-dir (directory-file-name html-dir))
   (let* ((destname (elpaa--doc-html-file docfile))
 (html-file (expand-file-name destname html-dir))
@@ -1982,7 +1982,9 @@ directory; one of archive, archive-devel."
   (elpaa--call-sandboxed
t "makeinfo" "--no-split" "--html" docfile "-o" tmpfile)
   (message "%s" (buffer-string)))
-(rename-file tmpfile html-file)
+(rename-file tmpfile html-file t)
+(push (cons (file-name-base html-file) (file-name-nondirectory html-file))
+  (plist-get (cdr pkg-spec) :internal--html-docs))
 
 ;; Create a symlink from elpa/archive[-devel]/doc/* to
 ;; the actual file, so html references work.
@@ -1991,7 +1993,7 @@ directory; one of archive, archive-devel."
(concat (file-name-nondirectory html-dir) "/" destname)
html-xref-file t
 
-(defun elpaa--build-Info-1 (docfile dir html-dir)
+(defun elpaa--build-Info-1 (pkg-spec docfile dir html-dir)
   "Build an info file from DOCFILE (a texinfo source file).
 DIR must be the package source directory.  If HTML-DIR is
 non-nil, also build html files, store them there.  HTML-DIR is
@@ -2034,7 +2036,7 @@ relative to elpa root."
t "makeinfo" "--no-split" docfile "-o" info-file)
   (message "%s" (buffer-string)))
 
-   (when html-dir (elpaa--html-build-doc docfile html-dir))
+   (when html-dir (elpaa--html-build-doc pkg-spec docfile html-dir))
 
 (setq docfile info-file)))
 



[elpa] externals/boxy-headings updated (be3dac1 -> f33ab07)

2021-10-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/boxy-headings.

  from  be3dac1   Merge branch 'next' into 'main'
   new  c4c5feb   Typo in boxy rel alist
   new  accd873   Added tests
   new  42fe06f   Bump version
   new  f33ab07   Merge branch 'next' into 'main'


Summary of changes:
 .elpaignore  |   2 +-
 .gitlab-ci.yml   |   1 +
 Eldev|  79 +++
 boxy-headings.el |   7 ++--
 tests/smoke.org  | 125 +++
 5 files changed, 209 insertions(+), 5 deletions(-)
 create mode 100644 tests/smoke.org



[elpa] externals/boxy-headings accd873 2/4: Added tests

2021-10-16 Thread ELPA Syncer
branch: externals/boxy-headings
commit accd873d31484cd498e963f5a1f80b4032645768
Author: Tyler Grinn 
Commit: Tyler Grinn 

Added tests
---
 .elpaignore |   2 +-
 .gitlab-ci.yml  |   1 +
 Eldev   |  79 +++
 tests/smoke.org | 125 
 4 files changed, 206 insertions(+), 1 deletion(-)

diff --git a/.elpaignore b/.elpaignore
index 7438c8e..7f2716a 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -5,4 +5,4 @@ deps
 .gitmodules
 Eldev
 README.org
-
+tests
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4714771..74e6f75 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,7 @@ package:
   script:
 - eldev lint
 - eldev compile -W
+- eldev test
 - eldev package
 - eldev md5
   artifacts:
diff --git a/Eldev b/Eldev
index 4a89d75..7a22358 100644
--- a/Eldev
+++ b/Eldev
@@ -20,3 +20,82 @@
   (append
(directory-files eldev-dist-dir t "\\.tar\\'")
(directory-files eldev-dist-dir t "\\.el\\'"
+
+(eldev-defcommand
+ boxy_headings-test (&rest _)
+ "Runs tests against all org files in tests folder."
+ :override t
+ (eldev-load-project-dependencies)
+ (require 'boxy-headings)
+ (let ((failures 0))
+   (cl-flet* ((get-expected ()
+(save-excursion
+  (re-search-forward "#\\+begin_example")
+  (org-element-property :value 
(org-element-at-point
+  (get-actual ()
+  (with-current-buffer (get-buffer "*Boxy*")
+(buffer-string)))
+  (print-result (title result)
+(message "%s : %s"
+ (if result
+ "\033[0;32mPASS\033[0m"
+   "\033[0;31mFAIL\033[0m")
+ title)
+(if (and (not result) (fboundp 'diff-buffers))
+(let ((expected (get-expected)))
+  (save-window-excursion
+(with-temp-buffer
+  (insert expected)
+  (diff-buffers (get-buffer "*Boxy*")
+(current-buffer)
+nil t))
+(with-current-buffer (get-buffer "*Diff*")
+  (message "@@ -actual +expected @@")
+  (message
+   (string-join
+(butlast
+ (butlast
+  (cdddr
+   (split-string
+(buffer-string)
+"\n"
+  "\n")))
+  (set-result (result)
+  (if (not result) (cl-incf failures))
+  (let ((inhibit-message t))
+(org-todo (if result "PASS" "FAIL")
+ (mapc
+  (lambda (test)
+(find-file test)
+(message "\n%s:\n" (file-name-base test))
+(message "\n  Testing headlines:\n")
+(org-babel-map-src-blocks nil
+  (goto-char beg-block)
+  (let* ((title (org-entry-get nil "ITEM"))
+ (boxy-headings-margin-y (if (org-entry-get nil "MARGIN-Y")
+ (string-to-number (org-entry-get 
nil "MARGIN-Y" t))
+   boxy-headings-margin-y))
+ (boxy-headings-margin-x (if (org-entry-get nil "MARGIN-X" t)
+ (string-to-number (org-entry-get 
nil "MARGIN-X" t))
+   boxy-headings-margin-x))
+ (boxy-headings-padding-y (if (org-entry-get nil "PADDING-Y" t)
+  (string-to-number (org-entry-get 
nil "PADDING-Y" t))
+boxy-headings-padding-y))
+ (boxy-headings-padding-x (if (org-entry-get nil "PADDING-X" t)
+  (string-to-number (org-entry-get 
nil "PADDING-X" t))
+boxy-headings-padding-x))
+ (result (catch 'result
+   (save-window-excursion
+ (condition-case nil
+ (progn
+   (org-edit-special)
+   (save-window-excursion (boxy-headings))
+   (org-edit-src-exit))
+ 

[elpa] externals/boxy-headings f33ab07 4/4: Merge branch 'next' into 'main'

2021-10-16 Thread ELPA Syncer
branch: externals/boxy-headings
commit f33ab079a90dfd60f6ec639d6514e7300d77d515
Merge: be3dac1 42fe06f
Author: Tyler Grinn 
Commit: Tyler Grinn 

Merge branch 'next' into 'main'

v2.1.1

Fix typo that caused 'left' and 'right' to not be valid REL property values.

See merge request tygrdev/boxy-headings!5
---
 .elpaignore  |   2 +-
 .gitlab-ci.yml   |   1 +
 Eldev|  79 +++
 boxy-headings.el |   7 ++--
 tests/smoke.org  | 125 +++
 5 files changed, 209 insertions(+), 5 deletions(-)

diff --git a/.elpaignore b/.elpaignore
index 7438c8e..7f2716a 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -5,4 +5,4 @@ deps
 .gitmodules
 Eldev
 README.org
-
+tests
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4714771..74e6f75 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,7 @@ package:
   script:
 - eldev lint
 - eldev compile -W
+- eldev test
 - eldev package
 - eldev md5
   artifacts:
diff --git a/Eldev b/Eldev
index 4a89d75..7a22358 100644
--- a/Eldev
+++ b/Eldev
@@ -20,3 +20,82 @@
   (append
(directory-files eldev-dist-dir t "\\.tar\\'")
(directory-files eldev-dist-dir t "\\.el\\'"
+
+(eldev-defcommand
+ boxy_headings-test (&rest _)
+ "Runs tests against all org files in tests folder."
+ :override t
+ (eldev-load-project-dependencies)
+ (require 'boxy-headings)
+ (let ((failures 0))
+   (cl-flet* ((get-expected ()
+(save-excursion
+  (re-search-forward "#\\+begin_example")
+  (org-element-property :value 
(org-element-at-point
+  (get-actual ()
+  (with-current-buffer (get-buffer "*Boxy*")
+(buffer-string)))
+  (print-result (title result)
+(message "%s : %s"
+ (if result
+ "\033[0;32mPASS\033[0m"
+   "\033[0;31mFAIL\033[0m")
+ title)
+(if (and (not result) (fboundp 'diff-buffers))
+(let ((expected (get-expected)))
+  (save-window-excursion
+(with-temp-buffer
+  (insert expected)
+  (diff-buffers (get-buffer "*Boxy*")
+(current-buffer)
+nil t))
+(with-current-buffer (get-buffer "*Diff*")
+  (message "@@ -actual +expected @@")
+  (message
+   (string-join
+(butlast
+ (butlast
+  (cdddr
+   (split-string
+(buffer-string)
+"\n"
+  "\n")))
+  (set-result (result)
+  (if (not result) (cl-incf failures))
+  (let ((inhibit-message t))
+(org-todo (if result "PASS" "FAIL")
+ (mapc
+  (lambda (test)
+(find-file test)
+(message "\n%s:\n" (file-name-base test))
+(message "\n  Testing headlines:\n")
+(org-babel-map-src-blocks nil
+  (goto-char beg-block)
+  (let* ((title (org-entry-get nil "ITEM"))
+ (boxy-headings-margin-y (if (org-entry-get nil "MARGIN-Y")
+ (string-to-number (org-entry-get 
nil "MARGIN-Y" t))
+   boxy-headings-margin-y))
+ (boxy-headings-margin-x (if (org-entry-get nil "MARGIN-X" t)
+ (string-to-number (org-entry-get 
nil "MARGIN-X" t))
+   boxy-headings-margin-x))
+ (boxy-headings-padding-y (if (org-entry-get nil "PADDING-Y" t)
+  (string-to-number (org-entry-get 
nil "PADDING-Y" t))
+boxy-headings-padding-y))
+ (boxy-headings-padding-x (if (org-entry-get nil "PADDING-X" t)
+  (string-to-number (org-entry-get 
nil "PADDING-X" t))
+boxy-headings-padding-x))
+ (result (catch 'result
+   (save-window-excursion
+ (condition-case nil
+ 

[elpa] externals/boxy-headings c4c5feb 1/4: Typo in boxy rel alist

2021-10-16 Thread ELPA Syncer
branch: externals/boxy-headings
commit c4c5feba832e5e3700fe679b4e5f8e0ba410a598
Author: Tyler Grinn 
Commit: Tyler Grinn 

Typo in boxy rel alist
---
 boxy-headings.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/boxy-headings.el b/boxy-headings.el
index 5c2adbe..f4b3bbd 100644
--- a/boxy-headings.el
+++ b/boxy-headings.el
@@ -131,8 +131,8 @@
 ("in front of" . ("in.+front"))
 ("behind"  . ("behind"))
 ("below"   . ("below"))
-("to the left of"  . ("to the left of"))
-("to the right of" . ("to the right of")))
+("to the left of"  . ("left"))
+("to the right of" . ("right")))
   "Mapping from a boxy relationship to a list of regexes.
 
 Each regex will be tested against the REL property of each
@@ -331,7 +331,6 @@ The default relationship is 'in'."
(lambda (rel)
  (seq-some
   (lambda (pattern)
-(message "Testing pattern %s" pattern)
 (string-match-p pattern heading-rel))
   (alist-get rel boxy-headings-rel-alist
  nil nil #'equal)))



[elpa] externals/boxy-headings 42fe06f 3/4: Bump version

2021-10-16 Thread ELPA Syncer
branch: externals/boxy-headings
commit 42fe06f9c1154a8b9ef82ec456d50f0135951b8e
Author: Tyler Grinn 
Commit: Tyler Grinn 

Bump version
---
 boxy-headings.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boxy-headings.el b/boxy-headings.el
index f4b3bbd..e0193b0 100644
--- a/boxy-headings.el
+++ b/boxy-headings.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Tyler Grinn 
-;; Version: 2.1.0
+;; Version: 2.1.1
 ;; File: boxy-headings.el
 ;; Package-Requires: ((emacs "26.1") (boxy "1.0") (org "9.3"))
 ;; Keywords: tools



[elpa] externals/coterm 88793a2: Remove the README file

2021-10-16 Thread ELPA Syncer
branch: externals/coterm
commit 88793a26ad7e651d8c386fcf02d0e8a946e54f73
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Remove the README file
---
 README | 1 -
 1 file changed, 1 deletion(-)

diff --git a/README b/README
deleted file mode 12
index e410317..000
--- a/README
+++ /dev/null
@@ -1 +0,0 @@
-coterm.el
\ No newline at end of file



[elpa] externals/org 9475993: Merge branch 'bugfix'

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 9475993a81ce895584fc47228a098767275da865
Merge: ad224f5 9bc3a2b
Author: Kyle Meyer 
Commit: Kyle Meyer 

Merge branch 'bugfix'
---
 etc/ORG-NEWS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0ba79cd..ebf6ce7 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -108,6 +108,15 @@ latest stable version of Org should be compatible with 
Emacs 28.x,
 
 See [[https://orgmode.org/worg/org-maintenance.html#emacs-compatibility][this 
note on Worg]] and [[git::519947e508e081e71bf67db99e27b1c171ba4dfe][this 
commit]].
 
+*** The keybinding for ~org-table-blank-field~ has been removed
+
+If you prefer to keep the keybinding, you can add it back to
+~org-mode-map~ like so:
+
+#+begin_src emacs-lisp
+(define-key org-mode-map (kbd "C-c SPC") #'org-table-blank-field)
+#+end_src
+
 ** New features
 
 *** New citation engine



[elpa] externals-release/org 9bc3a2b: ORG-NEWS: Mention org-table-blank-field keybinding removal

2021-10-16 Thread ELPA Syncer
branch: externals-release/org
commit 9bc3a2b98d1c64675436493751088c936be8b043
Author: Kyle Meyer 
Commit: Kyle Meyer 

ORG-NEWS: Mention org-table-blank-field keybinding removal

The keybinding was dropped in the 9.5 release by 0c4e844c8 (Remove
default binding for org-table-blank-field, 2021-04-28), but the change
didn't come with a NEWS entry.  9.5 is already out, but add an entry
anyway because it will hopefully still help some users, including
those that use the Org that ships with Emacs.

Reported-by: Michael Brand 
Link: https://list.orgmode.org/87lf2wcbqs@gnu.org
---
 etc/ORG-NEWS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index cbb0d38..5e7813c 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -98,6 +98,15 @@ latest stable version of Org should be compatible with Emacs 
28.x,
 
 See [[https://orgmode.org/worg/org-maintenance.html#emacs-compatibility][this 
note on Worg]] and [[git::519947e508e081e71bf67db99e27b1c171ba4dfe][this 
commit]].
 
+*** The keybinding for ~org-table-blank-field~ has been removed
+
+If you prefer to keep the keybinding, you can add it back to
+~org-mode-map~ like so:
+
+#+begin_src emacs-lisp
+(define-key org-mode-map (kbd "C-c SPC") #'org-table-blank-field)
+#+end_src
+
 ** New features
 
 *** New citation engine



[elpa] externals/org updated (ad224f5 -> 9475993)

2021-10-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  ad224f5   Merge branch 'bugfix'
   new  9bc3a2b   ORG-NEWS: Mention org-table-blank-field keybinding removal
   new  9475993   Merge branch 'bugfix'


Summary of changes:
 etc/ORG-NEWS | 9 +
 1 file changed, 9 insertions(+)



[nongnu] elpa/rust-mode updated (494d59f -> eed94e4)

2021-10-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/rust-mode.

  from  494d59f   Make most additional libraries optional
   new  01969b0   Update README.md
   new  9c2e067   drop run_rust_emacs_tests.sh and use make test in ci
   new  eed94e4   adjust emacs_versions used for ci


Summary of changes:
 .github/workflows/test.yml | 10 -
 README.md  | 15 -
 run_rust_emacs_tests.sh| 52 --
 3 files changed, 15 insertions(+), 62 deletions(-)
 delete mode 100755 run_rust_emacs_tests.sh



[nongnu] elpa/rust-mode 01969b0 1/3: Update README.md

2021-10-16 Thread ELPA Syncer
branch: elpa/rust-mode
commit 01969b0906309e40c05867f4c0c3a04c05493235
Author: Ayrat Badykov 
Commit: brotzeit 

Update README.md
---
 README.md | 4 
 1 file changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 7fb3f35..e2b3a6c 100644
--- a/README.md
+++ b/README.md
@@ -144,6 +144,10 @@ compile errors and Clippy lints inline.
 [cargo.el](https://github.com/kwrooijen/cargo.el) provides a minor
 mode for integration with Cargo, Rust's package manager.
 
+## cargo-mode
+
+[cargo-mode](https://github.com/ayrat555/cargo-mode) is an Emacs minor mode 
which allows to dynamically select a Cargo command. The reasons behind this 
package can be found in [the 
post](https://www.badykov.com/emacs/2021/05/29/emacs-cargo-mode/).
+
 ## Rustic
 [rustic](https://github.com/brotzeit/rustic) is a fork of rust-mode,
 extending it with other features such as integration with LSP and with 
flycheck.



[nongnu] elpa/rust-mode eed94e4 3/3: adjust emacs_versions used for ci

2021-10-16 Thread ELPA Syncer
branch: elpa/rust-mode
commit eed94e4e5eb624bb8bbfa8eb627207b0086e18d9
Author: brotzeit 
Commit: brotzeit 

adjust emacs_versions used for ci
---
 .github/workflows/test.yml | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 1c78413..e41f967 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -10,13 +10,11 @@ jobs:
   matrix:
 rust_version: [stable]
 emacs_version:
-  - 25.1
-  - 25.2
   - 25.3
-  - 26.1
-  - 26.2
   - 26.3
+  - 27.2
   - snapshot
+
 env:
   EMACS_VERSION: ${{ matrix.emacs_version }}
 steps:



[nongnu] elpa/rust-mode 9c2e067 2/3: drop run_rust_emacs_tests.sh and use make test in ci

2021-10-16 Thread ELPA Syncer
branch: elpa/rust-mode
commit 9c2e06756d3678cdcaaa57ec01591083c5f1d2c4
Author: brotzeit 
Commit: brotzeit 

drop run_rust_emacs_tests.sh and use make test in ci
---
 .github/workflows/test.yml |  4 +++-
 README.md  | 11 +-
 run_rust_emacs_tests.sh| 52 --
 3 files changed, 9 insertions(+), 58 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 758a861..1c78413 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -28,5 +28,7 @@ jobs:
 version: ${{ matrix.emacs_version }}
 
 - uses: actions/checkout@v1
+
 - name: Run tests
-  run: './run_rust_emacs_tests.sh'
+  run: |
+make test
diff --git a/README.md b/README.md
index e2b3a6c..5cdb229 100644
--- a/README.md
+++ b/README.md
@@ -149,7 +149,7 @@ mode for integration with Cargo, Rust's package manager.
 [cargo-mode](https://github.com/ayrat555/cargo-mode) is an Emacs minor mode 
which allows to dynamically select a Cargo command. The reasons behind this 
package can be found in [the 
post](https://www.badykov.com/emacs/2021/05/29/emacs-cargo-mode/).
 
 ## Rustic
-[rustic](https://github.com/brotzeit/rustic) is a fork of rust-mode,
+[rustic](https://github.com/brotzeit/rustic) is based on rust-mode,
 extending it with other features such as integration with LSP and with 
flycheck.
 
 
@@ -157,7 +157,8 @@ extending it with other features such as integration with 
LSP and with flycheck.
 
 ## Tests
 
-The file `rust-mode-tests.el` contains tests that can be run via
-[ERT](http://www.gnu.org/software/emacs/manual/html_node/ert/index.html).
-You can use `run_rust_emacs_tests.sh` to run them in batch mode, if
-you set the environment variable EMACS to a program that runs emacs.
+Run elisp tests:
+
+``` bash
+make test
+```
diff --git a/run_rust_emacs_tests.sh b/run_rust_emacs_tests.sh
deleted file mode 100755
index 600ad4d..000
--- a/run_rust_emacs_tests.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-# file at the top-level directory of this distribution and at
-# http://rust-lang.org/COPYRIGHT.
-#
-# Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-# http://opensource.org/licenses/MIT>, at your
-# option. This file may not be copied, modified, or distributed
-# except according to those terms.
-#
-# This runs the test for emacs rust-mode.
-# Either $EMACS must be set, or it must be possible to find emacs via PATH.
-
-if [ -z "$EMACS" ]; then
-EMACS=emacs
-fi
-
-$EMACS --batch || {
-   echo "You must set EMACS to a program that runs emacs."
-   exit 1
-}
-
-$( $EMACS -batch > /dev/null 2>&1 ) || {
-echo "Your emacs command ($EMACS) does not run properly."
-exit 2
-};
-
-$( $EMACS -batch --eval "(require 'ert)" > /dev/null 2>&1 ) || {
-echo 'You must install the `ert` dependency; see README.md'
-exit 3
-};
-
-warnings="$( $EMACS -Q -batch -f batch-byte-compile rust-mode.el 2>&1 | grep 
-v '^Wrote ' )"
-if [ -n "$warnings" ]; then
-echo "Byte-compilation failed:"
-echo "$warnings"
-exit 4
-else
-echo "Byte-compilation passed."
-fi
-
-warnings="$( $EMACS -Q -batch -l rust-mode.el -f batch-byte-compile 
rust-mode-tests.el 2>&1 | grep -v '^Wrote ' )"
-if [ -n "$warnings" ]; then
-echo "Byte-compilation failed:"
-echo "$warnings"
-exit 4
-else
-echo "Byte-compilation of test file passed."
-fi
-
-$EMACS -batch -l rust-mode.el -l rust-mode-tests.el -f 
ert-run-tests-batch-and-exit



[elpa] externals/transient 45975c2: manual: Update info about `incompatible' slot

2021-10-16 Thread Jonas Bernoulli
branch: externals/transient
commit 45975c24e1ab08bb32e9bdc06f5c5efe7c256e16
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

manual: Update info about `incompatible' slot
---
 docs/transient.org  | 7 ---
 docs/transient.texi | 7 ---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/docs/transient.org b/docs/transient.org
index b485ac5..4bce64c 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -8,7 +8,7 @@
 #+TEXINFO_DIR_CATEGORY: Emacs
 #+TEXINFO_DIR_TITLE: Transient: (transient).
 #+TEXINFO_DIR_DESC: Transient Commands
-#+SUBTITLE: for version 0.3.6 (v0.3.6-10-gbe119ee4+1)
+#+SUBTITLE: for version 0.3.6 (v0.3.6-13-gb526b9c7+1)
 
 #+TEXINFO_DEFFN: t
 #+OPTIONS: H:4 num:4 toc:2
@@ -37,7 +37,7 @@ Calling a suffix command usually causes the transient to be 
exited
 but suffix commands can also be configured to not exit the transient.
 
 #+TEXINFO: @noindent
-This manual is for Transient version 0.3.6 (v0.3.6-10-gbe119ee4+1).
+This manual is for Transient version 0.3.6 (v0.3.6-13-gb526b9c7+1).
 
 #+BEGIN_QUOTE
 Copyright (C) 2018-2021 Jonas Bernoulli 
@@ -1558,7 +1558,8 @@ functions use ~describe-function~.
 
 - ~incompatible~ A list of lists.  Each sub-list specifies a set of
   mutually exclusive arguments.  Enabling one of these arguments
-  causes the others to be disabled.
+  causes the others to be disabled.  An argument may appear in
+  multiple sub-lists.
 
 - ~scope~ For some transients it might be necessary to have a sort of
   secondary value, called a "scope".  See ~transient-define-prefix~.
diff --git a/docs/transient.texi b/docs/transient.texi
index 8c873b3..9028a2a 100644
--- a/docs/transient.texi
+++ b/docs/transient.texi
@@ -31,7 +31,7 @@ General Public License for more details.
 @finalout
 @titlepage
 @title Transient User and Developer Manual
-@subtitle for version 0.3.6 (v0.3.6-10-gbe119ee4+1)
+@subtitle for version 0.3.6 (v0.3.6-13-gb526b9c7+1)
 @author Jonas Bernoulli
 @page
 @vskip 0pt plus 1filll
@@ -65,7 +65,7 @@ Calling a suffix command usually causes the transient to be 
exited
 but suffix commands can also be configured to not exit the transient.
 
 @noindent
-This manual is for Transient version 0.3.6 (v0.3.6-10-gbe119ee4+1).
+This manual is for Transient version 0.3.6 (v0.3.6-13-gb526b9c7+1).
 
 @quotation
 Copyright (C) 2018-2021 Jonas Bernoulli 
@@ -1918,7 +1918,8 @@ command is invoked.  See @ref{Transient State}.
 @item
 @code{incompatible} A list of lists.  Each sub-list specifies a set of
 mutually exclusive arguments.  Enabling one of these arguments
-causes the others to be disabled.
+causes the others to be disabled.  An argument may appear in
+multiple sub-lists.
 
 
 @item



[nongnu] elpa/evil 215c39d: Pull temporary goal column normalization into let (#1533)

2021-10-16 Thread ELPA Syncer
branch: elpa/evil
commit 215c39d1c4312ce5a3a66c19bbba61374d029c86
Author: Tom Dalziel <33435574+tomd...@users.noreply.github.com>
Commit: GitHub 

Pull temporary goal column normalization into let (#1533)
---
 evil-common.el | 35 +++
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/evil-common.el b/evil-common.el
index 3977532..d843bda 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -1010,22 +1010,25 @@ This mostly copies the approach of Emacs' 
`line-move-1', but is modified
 so it is more compatible with evil's notions of eol & tracking."
   (declare (indent defun)
(debug t))
-  `(progn
- (setq this-command 'next-line)
- (if (consp temporary-goal-column)
- (setq temporary-goal-column (+ (car temporary-goal-column)
-(cdr temporary-goal-column
- (if (not (memq last-command '(next-line previous-line)))
- (setq temporary-goal-column
-   (if (and evil-track-eol
-(evil-eolp)
-(memq real-last-command '(move-end-of-line 
evil-end-of-line)))
-   most-positive-fixnum
- (current-column
- ,@body
- (if evil-start-of-line
- (evil-first-non-blank)
-   (line-move-to-column (truncate (or goal-column 
temporary-goal-column))
+  (let ((normalize-temporary-goal-column
+ `(if (consp temporary-goal-column)
+  (setq temporary-goal-column (+ (car temporary-goal-column)
+ (cdr temporary-goal-column))
+`(progn
+   (setq this-command 'next-line)
+   ,normalize-temporary-goal-column
+   (if (not (memq last-command '(next-line previous-line)))
+   (setq temporary-goal-column
+ (if (and evil-track-eol
+  (evil-eolp)
+  (memq real-last-command '(move-end-of-line 
evil-end-of-line)))
+ most-positive-fixnum
+   (current-column
+   ,@body
+   (if evil-start-of-line
+   (evil-first-non-blank)
+ ,normalize-temporary-goal-column
+ (line-move-to-column (truncate (or goal-column 
temporary-goal-column)))
 
 (defun evil-narrow (beg end)
   "Restrict the buffer to BEG and END.



[nongnu] elpa/rust-mode 80cdc54 2/3: Improve rust--format-fix-rustfmt-buffer

2021-10-16 Thread ELPA Syncer
branch: elpa/rust-mode
commit 80cdc5417c3f6a6faf85f0d78c6d606c9aa39cb0
Author: Sergey Vinokurov 
Commit: brotzeit 

Improve rust--format-fix-rustfmt-buffer
---
 rust-rustfmt.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/rust-rustfmt.el b/rust-rustfmt.el
index d3b7509..33f916d 100644
--- a/rust-rustfmt.el
+++ b/rust-rustfmt.el
@@ -86,13 +86,13 @@
 ;; Since we run rustfmt through stdin we get  markers in the
 ;; output. This replaces them with the buffer name instead.
 (defun rust--format-fix-rustfmt-buffer (buffer-name)
-  (with-current-buffer (get-buffer rust-rustfmt-buffername)
-(let ((inhibit-read-only t))
-  (goto-char (point-min))
-  (while (re-search-forward "--> :" nil t)
-(replace-match (format "--> %s:" buffer-name)))
-  (while (re-search-forward "--> stdin:" nil t)
-(replace-match (format "--> %s:" buffer-name))
+  (save-match-data
+(with-current-buffer (get-buffer rust-rustfmt-buffername)
+  (let ((inhibit-read-only t)
+(fixed (format "--> %s:" buffer-name)))
+  (goto-char (point-min))
+  (while (re-search-forward "--> \\(?:\\|stdin\\):" nil t)
+(replace-match fixed))
 
 ;; If rust-mode has been configured to navigate to source of the error
 ;; or display it, do so -- and return true. Otherwise return nil to



[nongnu] elpa/rust-mode updated (eed94e4 -> 2e970db)

2021-10-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/rust-mode.

  from  eed94e4   adjust emacs_versions used for ci
   new  d0c1ffa   update readme and bump version
   new  80cdc54   Improve rust--format-fix-rustfmt-buffer
   new  2e970db   Call *rustfmt* by its proper name in user messages


Summary of changes:
 README.md   | 39 +--
 rust-mode.el|  2 +-
 rust-rustfmt.el | 25 ++---
 3 files changed, 36 insertions(+), 30 deletions(-)



[nongnu] elpa/rust-mode d0c1ffa 1/3: update readme and bump version

2021-10-16 Thread ELPA Syncer
branch: elpa/rust-mode
commit d0c1ffa68d0ba0af0b35b761d2d73a2c1b4fc7a3
Author: brotzeit 
Commit: brotzeit 

update readme and bump version
---
 README.md| 39 +--
 rust-mode.el |  2 +-
 2 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/README.md b/README.md
index 5cdb229..0ffd6e1 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,7 @@
+# rust-mode
+
 
[![MELPA](https://melpa.org/packages/rust-mode-badge.svg)](https://melpa.org/#/rust-mode)
+[![](https://github.com/rust-lang/rust-mode/workflows/CI/badge.svg)](https://github.com/rust-lang/rust-mode/actions?query=workflow%3ACI)
 
 
 **Table of Contents**
@@ -23,7 +26,7 @@
 
 
 
-# Introduction
+## Introduction
 `rust-mode` makes editing [Rust](http://rust-lang.org) code with Emacs
 enjoyable. It requires Emacs 25 or later, and is included in both
 [Emacs Prelude](https://github.com/bbatsov/prelude) and
@@ -39,9 +42,9 @@ trait definitions. See [Auto-completion / code 
navigation](#auto-completion--cod
 below for tips on how to enable this.
 
 
-# Installation
+## Installation
 
-## Melpa
+### Melpa
 The package is available on MELPA. Add this to your init.el.
 
 ``` elisp
@@ -60,7 +63,7 @@ And put this in your config to load rust-mode automatically:
 
 `(require 'rust-mode)`
 
-## Manual installation
+### Manual installation
 Clone this repository locally, and add this to your init.el:
 
 ``` elisp
@@ -68,8 +71,8 @@ Clone this repository locally, and add this to your init.el:
 (autoload 'rust-mode "rust-mode" nil t)
 ```
 
-# Feature guide
-## Indentation
+## Feature guide
+### Indentation
 Commands like TAB should indent correctly.
 
 The Rust style guide recommends spaces rather than tabs for
@@ -81,7 +84,7 @@ which forces indentation to always use spaces.
   (lambda () (setq indent-tabs-mode nil)))
 ```
 
-## Code formatting
+### Code formatting
 
 The `rust-format-buffer` function will format your code with
 [rustfmt](https://github.com/rust-lang/rustfmt) if installed. By
@@ -95,7 +98,7 @@ on save:
 (setq rust-format-on-save t)
 ```
 
-## Running / testing / compiling code
+### Running / testing / compiling code
 
 The `rust-run`, `rust-test`, `rust-compile` and `rust-check` functions shell 
out to
 Cargo to run, test, build and check your code. Under the hood, these use the
@@ -108,11 +111,11 @@ you can use the following in your init.el:
 (define-key rust-mode-map (kbd "C-c C-c") 'rust-run)
 ```
 
-## Clippy
+### Clippy
 `rust-run-clippy` runs
 [Clippy](https://github.com/rust-lang/rust-clippy), a linter.
 
-## Easy insertion of !dbg
+### Easy insertion of !dbg
 `rust-dbg-wrap-or-unwrap` either wraps or unwraps the current region
 in `dbg!`. This can be useful for easily adding debug lines to your
 program.
@@ -120,9 +123,9 @@ program.
 This is bound to C-c C-d by default.
 
 
-# Other recommended packages
+## Other recommended packages
 
-## Auto-completion / code navigation
+### Auto-completion / code navigation
 This package does not provide integration with
 [RLS](https://github.com/rust-lang/rls), which provides
 auto-completion and code navigation. To use this you need an Emacs
@@ -136,26 +139,26 @@ A lighter package that uses
 [racer](https://github.com/racer-rust/racer) is
 [emacs-racer](https://github.com/racer-rust/emacs-racer).
 
-## flycheck
+### flycheck
 [flycheck](https://github.com/flycheck/flycheck) allows highlighting
 compile errors and Clippy lints inline.
 
-## cargo.el
+### cargo.el
 [cargo.el](https://github.com/kwrooijen/cargo.el) provides a minor
 mode for integration with Cargo, Rust's package manager.
 
-## cargo-mode
+### cargo-mode
 
 [cargo-mode](https://github.com/ayrat555/cargo-mode) is an Emacs minor mode 
which allows to dynamically select a Cargo command. The reasons behind this 
package can be found in [the 
post](https://www.badykov.com/emacs/2021/05/29/emacs-cargo-mode/).
 
-## Rustic
+### Rustic
 [rustic](https://github.com/brotzeit/rustic) is based on rust-mode,
 extending it with other features such as integration with LSP and with 
flycheck.
 
 
-# For package maintainers
+## For package maintainers
 
-## Tests
+### Tests
 
 Run elisp tests:
 
diff --git a/rust-mode.el b/rust-mode.el
index 2b9490b..58897fd 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1,6 +1,6 @@
 ;;; rust-mode.el --- A major-mode for editing Rust source code 
-*-lexical-binding: t-*-
 
-;; Version: 0.5.0
+;; Version: 1.0.0
 ;; Author: Mozilla
 ;; Url: https://github.com/rust-lang/rust-mode
 ;; Keywords: languages



[nongnu] elpa/rust-mode 2e970db 3/3: Call *rustfmt* by its proper name in user messages

2021-10-16 Thread ELPA Syncer
branch: elpa/rust-mode
commit 2e970db74fc6637840753140ad11bbfbd78dbd7d
Author: Sergey Vinokurov 
Commit: brotzeit 

Call *rustfmt* by its proper name in user messages
---
 rust-rustfmt.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/rust-rustfmt.el b/rust-rustfmt.el
index 33f916d..ddab81f 100644
--- a/rust-rustfmt.el
+++ b/rust-rustfmt.el
@@ -75,12 +75,14 @@
   (erase-buffer)
   (insert-file-contents tmpf)
   (rust--format-fix-rustfmt-buffer (buffer-name buf))
-  (error "Rustfmt could not format some lines, see *rustfmt* 
buffer for details"))
+  (error "Rustfmt could not format some lines, see %s buffer for 
details"
+ rust-rustfmt-buffername))
  (t
   (erase-buffer)
   (insert-file-contents tmpf)
   (rust--format-fix-rustfmt-buffer (buffer-name buf))
-  (error "Rustfmt failed, see *rustfmt* buffer for details"
+  (error "Rustfmt failed, see %s buffer for details"
+ rust-rustfmt-buffername
 (delete-file tmpf)
 
 ;; Since we run rustfmt through stdin we get  markers in the
@@ -118,7 +120,7 @@ rustfmt complain in the echo area."
   ;; buffer it is from.
   (let ((rustfmt (get-buffer rust-rustfmt-buffername)))
 (if (not rustfmt)
-(message "No *rustfmt*, no problems.")
+(message "No %s, no problems." rust-rustfmt-buffername)
   (let ((target-buffer (with-current-buffer rustfmt
  (save-excursion
(goto-char (point-min))
@@ -361,7 +363,8 @@ Return the created process."
 ;; KLDUGE: re-run the error handlers -- otherwise message area
 ;; would show "Wrote ..." instead of the error description.
 (or (rust--format-error-handler)
-(message "rustfmt detected problems, see *rustfmt* for more."))
+(message "rustfmt detected problems, see %s for more."
+ rust-rustfmt-buffername))
 
 ;;; _
 (provide 'rust-rustfmt)



[nongnu] branch new-with-editor created (now 8d52f93)

2021-10-16 Thread monnier--- via
monnier pushed a change to branch new-with-editor.

at  8d52f93   Recognize output of the sleeping editor even if it 
arrives in chunks

This branch includes the following new commits:

   new  8d52f93   Recognize output of the sleeping editor even if it 
arrives in chunks




[nongnu] new-with-editor 8d52f93: Recognize output of the sleeping editor even if it arrives in chunks

2021-10-16 Thread monnier--- via
branch: new-with-editor
commit 8d52f933e50624c7bca3880f57297ac17ba4ac2d
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

Recognize output of the sleeping editor even if it arrives in chunks

Fixes https://github.com/magit/magit/issues/4288#issuecomment-797972932.
---
 with-editor.el | 54 +-
 1 file changed, 33 insertions(+), 21 deletions(-)

diff --git a/with-editor.el b/with-editor.el
index 4a43595..ba856e6 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -641,33 +641,45 @@ may not insert the text into the PROCESS's buffer.  Then 
it calls
 
 (defvar with-editor-filter-visit-hook nil)
 
+(defconst with-editor-sleeping-editor-regexp
+  "^WITH-EDITOR: \\([0-9]+\\) OPEN \\([^]+?\\)\\(?: IN 
\\([^\r]+?\\)\\)?\r?$")
+
 (defun with-editor-output-filter (string)
+  (with-editor-sleeping-editor-filter nil string))
+
+(defun with-editor-sleeping-editor-filter (process string)
+  (when-let ((incomplete (and process (process-get process 'incomplete
+(setq string (concat incomplete string)))
   (save-match-data
-(if (string-match "^WITH-EDITOR: \
-\\([0-9]+\\) OPEN \\([^]+?\\)\
-\\(?: IN \\([^\r]+?\\)\\)?\r?$" string)
-(let ((pid  (match-string 1 string))
-  (file (match-string 2 string))
-  (dir  (match-string 3 string)))
-  (unless (file-name-absolute-p file)
-(setq file (expand-file-name file dir)))
-  (when default-directory
-(setq file (concat (file-remote-p default-directory) file)))
-  (with-current-buffer (find-file-noselect file)
-(with-editor-mode 1)
-(setq with-editor--pid pid)
-(run-hooks 'with-editor-filter-visit-hook)
-(funcall (or (with-editor-server-window) 'switch-to-buffer)
- (current-buffer))
-(kill-local-variable 'server-window))
-  nil)
-  string)))
+(cond
+ ((and process (not (string-match-p "\n\\'" string)))
+  (process-put process 'incomplete string)
+  nil)
+ ((string-match with-editor-sleeping-editor-regexp string)
+  (when process
+(process-put process 'incomplete nil))
+  (let ((pid  (match-string 1 string))
+(file (match-string 2 string))
+(dir  (match-string 3 string)))
+(unless (file-name-absolute-p file)
+  (setq file (expand-file-name file dir)))
+(when default-directory
+  (setq file (concat (file-remote-p default-directory) file)))
+(with-current-buffer (find-file-noselect file)
+  (with-editor-mode 1)
+  (setq with-editor--pid pid)
+  (run-hooks 'with-editor-filter-visit-hook)
+  (funcall (or (with-editor-server-window) 'switch-to-buffer)
+   (current-buffer))
+  (kill-local-variable 'server-window)))
+  nil)
+ (t string
 
 (defun with-editor-process-filter
 (process string &optional no-default-filter)
   "Listen for edit requests by child processes."
   (let ((default-directory (process-get process 'default-dir)))
-(with-editor-output-filter string))
+(with-editor-sleeping-editor-filter process string))
   (unless no-default-filter
 (internal-default-process-filter process string)))
 
@@ -744,7 +756,7 @@ This works in `shell-mode', `term-mode', `eshell-mode' and
 
 (defun with-editor-emulate-terminal (process string)
   "Like `term-emulate-terminal' but also handle edit requests."
-  (when (with-editor-output-filter string)
+  (when (with-editor-sleeping-editor-filter process string)
 (term-emulate-terminal process string)))
 
 (defvar with-editor-envvars '("EDITOR" "GIT_EDITOR" "HG_EDITOR"))



[nongnu] branch elpa/with-editor deleted (was 939e825)

2021-10-16 Thread monnier--- via
monnier pushed a change to branch elpa/with-editor.

   was  939e825   with-editor-sleeping-editor-filter: Restore significant 
return value

This change permanently discards the following revisions:

  discards  939e825   with-editor-sleeping-editor-filter: Restore significant 
return value
  discards  63afb66   Recognize output of the sleeping editor even if it 
arrives in chunks



[nongnu] branch elpa/with-editor created (now 8d52f93)

2021-10-16 Thread monnier--- via
monnier pushed a change to branch elpa/with-editor.

at  8d52f93   Recognize output of the sleeping editor even if it 
arrives in chunks

No new revisions were added by this update.



[nongnu] branch new-with-editor deleted (was 8d52f93)

2021-10-16 Thread monnier--- via
monnier pushed a change to branch new-with-editor.

   was  8d52f93   Recognize output of the sleeping editor even if it 
arrives in chunks

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[elpa] externals/coterm e3812b9: Adjust installation instructions

2021-10-16 Thread ELPA Syncer
branch: externals/coterm
commit e3812b96339b5ba580c15cd661ac3c4e38e634ca
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Adjust installation instructions
---
 coterm.el | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/coterm.el b/coterm.el
index c3bb07c..9848b49 100644
--- a/coterm.el
+++ b/coterm.el
@@ -33,11 +33,11 @@
 ;;
 ;; In addition to that, the following two local minor modes may be used:
 ;;
-;; `coterm-char-mode': If enabled, most characters you type are sent directly
+;; `coterm-char-mode': if enabled, most characters you type are sent directly
 ;; to the subprocess, which is useful for interacting with full-screen TUI
 ;; programs.
 ;;
-;; `coterm-auto-char-mode' If enabled, coterm will enter and leave
+;; `coterm-auto-char-mode': if enabled, coterm will enter and leave
 ;; `coterm-char-mode' automatically as appropriate.  For example, if you
 ;; execute "less" in a shell buffer, coterm will detect that "less" is running
 ;; and automatically enable char mode so that you can interact with less
@@ -53,12 +53,14 @@
 ;; The command `coterm-char-mode-cycle' is a handy command to cycle between
 ;; automatic char-mode, char-mode enabled and char-mode disabled.
 ;;
+;;
 ;; Installation:
 ;;
-;; Add the following to your Emacs init file:
+;; To install coterm, type M-x package-install RET coterm RET
+;;
+;; It is best to add the following elisp snippet to you Emacs init file, to
+;; enable `coterm-mode' automatically on startup:
 ;;
-;;   (add-to-list 'load-path "/path/to/emacs-coterm")
-;;   (require 'coterm)
 ;;   (coterm-mode)
 ;;
 ;;   ;; Optional: bind `coterm-char-mode-cycle' to C-; in comint



[elpa] elpa-admin d1a6387: * elpa-admin.el (elpaa--html-build-doc): Fix backward compatibility

2021-10-16 Thread monnier--- via
branch: elpa-admin
commit d1a63872d39bf2dc59822141353ecd5be88c0f1f
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-admin.el (elpaa--html-build-doc): Fix backward compatibility

Emacs-27 doesn't have a setf handler for `plist-get`.
---
 elpa-admin.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/elpa-admin.el b/elpa-admin.el
index a13b17f..381aed6 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1983,8 +1983,12 @@ directory; one of archive, archive-devel."
t "makeinfo" "--no-split" "--html" docfile "-o" tmpfile)
   (message "%s" (buffer-string)))
 (rename-file tmpfile html-file t)
-(push (cons (file-name-base html-file) (file-name-nondirectory html-file))
-  (plist-get (cdr pkg-spec) :internal--html-docs))
+;; FIXME: Use `push' in Emacs≥28
+(plist-put (cdr pkg-spec)
+   :internal--html-docs
+   (cons (cons (file-name-base html-file)
+   (file-name-nondirectory html-file))
+ (plist-get (cdr pkg-spec) :internal--html-docs)))
 
 ;; Create a symlink from elpa/archive[-devel]/doc/* to
 ;; the actual file, so html references work.



[elpa] externals/eev 05234e5: Simplified the way to use red bullets instead of red stars.

2021-10-16 Thread ELPA Syncer
branch: externals/eev
commit 05234e5979661ec288fbdf4c291f4cdd98210443
Author: Eduardo Ochs 
Commit: Eduardo Ochs 

Simplified the way to use red bullets instead of red stars.
---
 ChangeLog | 14 +
 VERSION   |  4 +--
 eepitch.el| 42 ---
 eev-anchors.el| 19 +---
 eev-audiovideo.el | 68 +--
 eev-intro.el  |  5 ++--
 eev-tlinks.el | 86 ---
 7 files changed, 163 insertions(+), 75 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 608b236..54bb016 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2021-10-16  Eduardo Ochs  
+
+   * eev-tlinks.el (find-eepitch-bullet-links): redefine
+   `ee-adjust-red-stars' instead of `eewrap-eepitch'.
+   (find-psne-links): use `ee-adjust-red-stars'.
+
+   * eepitch.el (ee-adjust-red-stars): new function.
+   (eewrap-eepitch): use `ee-adjust-red-stars'.
+
+2021-10-12  Eduardo Ochs  
+
+   * eev-audiovideo.el: added links to the indexes of all videos in
+   the section video-tutorials.
+
 2021-10-11  Eduardo Ochs  
 
* eev-intro.el (find-escripts-intro): rewrote the section "7.
diff --git a/VERSION b/VERSION
index f624715..00971df 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Tue Oct 12 04:02:20 GMT 2021
-Tue Oct 12 01:02:20 -03 2021
+Sat Oct 16 22:33:21 GMT 2021
+Sat Oct 16 19:33:21 -03 2021
diff --git a/eepitch.el b/eepitch.el
index 3c9d113..66b616b 100644
--- a/eepitch.el
+++ b/eepitch.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author: Eduardo Ochs 
 ;; Maintainer: Eduardo Ochs 
-;; Version:20211005
+;; Version:20211016
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eepitch.el>
@@ -40,6 +40,7 @@
 ;; «.find-comintprocess»   (to "find-comintprocess")
 ;;
 ;; «.eewrap-eepitch»   (to "eewrap-eepitch")
+;; «.ee-adjust-red-stars»  (to "ee-adjust-red-stars")
 ;; «.glyphs»   (to "glyphs")
 ;; «.set-glyphs»   (to "set-glyphs")
 ;; «.set-keys» (to "set-keys")
@@ -577,29 +578,40 @@ See: (find-eepitch-intro)"
 ;;;   \_/\_/ |_|  \__,_| .__/ 
 ;;;|_|
 ;;
-;; «eewrap-eepitch»  (to ".eewrap-eepitch")
+;; «eewrap-eepitch»   (to ".eewrap-eepitch")
+;; «ee-adjust-red-stars»  (to ".ee-adjust-red-stars")
 ;; See: (find-eev-quick-intro "6.3. Creating eepitch blocks: `M-T'")
 ;;  (find-eev-quick-intro "wrap")
 ;;  (find-wrap-intro)
+;;  (find-eev "eev-mode.el" "eev-mode-map-set" "M-T" "eewrap-eepitch")
+;;  (find-eepitch-bullet-links)
+
+(defun eewrap-eepitch () (interactive)
+  "Convert the current into an eepitch block (three lines long)."
+  (let* ((fmt   " (eepitch-%s)\n (eepitch-kill)\n (eepitch-%s)")
+(li(ee-this-line-extract))
+(newli (format fmt li li)))
+(insert (ee-adjust-red-stars newli)))
+  (ee-next-line 1))
+
+(defun ee-adjust-red-stars (str)
+  "Replace all the red stars in STR by another character if needed.
+By default this function returns STR unchanged. For a way to make
+it replace the red stars by bullets, see:
+  (find-eepitch-bullet-links)"
+  str)
+
+(defun ee-this-line-extract ()
+  "Delete the contents of the current line and return it as a string."
+  (delete-and-extract-region (ee-bol) (ee-eol)))
 
 (defun ee-no-properties (str)
   (setq str (copy-sequence str))
   (set-text-properties 0 (length str) nil str)
   str)
 
-;; (defun eepitch-delete-and-extract-line ()
-;;   (delete-and-extract-region (ee-bol) (ee-eol)))
 
-(defun ee-this-line-extract ()
-  "Delete the contents of the current line and return it as a string."
-  (delete-and-extract-region (ee-bol) (ee-eol)))
 
-(defun eewrap-eepitch () (interactive)
-  (let* ((fmt   " (eepitch-%s)\n (eepitch-kill)\n (eepitch-%s)")
-(li(ee-this-line-extract))
-(newli (format fmt li li)))
-(insert newli))
-  (ee-next-line 1))
 
 
 
@@ -612,9 +624,7 @@ See: (find-eepitch-intro)"
 ;;;
 ;; «glyphs»  (to ".glyphs")
 ;; See: (find-eev-quick-intro "6.4. Red stars")
-;; More glyphs:
-;;   (find-eev "eev-anchors.el")
-;;   (find-anchors-intro)
+;;  (find-eev "eev-anchors.el" "glyphs")
 ;; More on glyphs:
 ;;   http://angg.twu.net/glyphs.html
 ;; The `(<= 128 pos)' below is explained at:
diff --git a/eev-anchors.el b/eev-anchors.el
index f39bcff..dc913d3 100644
--- a/eev-anchors.el
+++ b/eev-anchors.el
@@ -35,6 +35,11 @@
 ;; See the tutorial on anchors here:
 ;;   (find-eev-quick-intro "8. Anchors")
 
+;; «.glyphs»   (to "glyphs")
+;; «.ee-goto-anchor»   (to "ee-goto-anchor"

[elpa] externals/eev d080f08: Rewrote lots of things in eev-on-windows.el.

2021-10-16 Thread ELPA Syncer
branch: externals/eev
commit d080f08a66a810810382a2355597bc07228dbdbe
Author: Eduardo Ochs 
Commit: Eduardo Ochs 

Rewrote lots of things in eev-on-windows.el.
---
 ChangeLog |  11 ++
 VERSION   |   4 +-
 eepitch.el|   2 +
 eev-intro.el  |   6 +--
 eev-on-windows.el | 107 +-
 eev-tlinks.el |  16 
 eev.el|   2 +-
 7 files changed, 75 insertions(+), 73 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 54bb016..ba17822 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,22 @@
 2021-10-16  Eduardo Ochs  
 
+   * eev-audiovideo.el (find-eev2019video, find-eev2020video)
+   (find-eevnavvideo, find-eevtemplvideo, find-eevfherelvideo)
+   (find-eevtestblsvideo, find-eevvlinksvideo): small changes in the
+   comments and in the docstrings.
+
* eev-tlinks.el (find-eepitch-bullet-links): redefine
`ee-adjust-red-stars' instead of `eewrap-eepitch'.
(find-psne-links): use `ee-adjust-red-stars'.
+   (find-red-star-links): new name for the function
+   `find-eepitch-bullet-links'. The old name is now an alias.
+   (find-eevshortvideo-links): new function.
+   (ee-psne-if-needed): use `ee-adjust-red-stars'.
 
* eepitch.el (ee-adjust-red-stars): new function.
(eewrap-eepitch): use `ee-adjust-red-stars'.
+   (eepitch-eshell2): new function.
+   (eepitch-luajit): new function.
 
 2021-10-12  Eduardo Ochs  
 
diff --git a/VERSION b/VERSION
index 00971df..ad153f6 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Sat Oct 16 22:33:21 GMT 2021
-Sat Oct 16 19:33:21 -03 2021
+Sun Oct 17 00:18:14 GMT 2021
+Sat Oct 16 21:18:14 -03 2021
diff --git a/eepitch.el b/eepitch.el
index 66b616b..0456d80 100644
--- a/eepitch.el
+++ b/eepitch.el
@@ -488,6 +488,7 @@ scratch."
 (defun eepitch-shell2  () (interactive) (eepitch '(shell "*shell 2*")))
 (defun eepitch-shell3  () (interactive) (eepitch '(shell "*shell 3*")))
 (defun eepitch-eshell  () (interactive) (eepitch '(eshell)))
+(defun eepitch-eshell2 () (interactive) (eepitch '(eshell 2)))
 
 
 
@@ -925,6 +926,7 @@ The arguments are explained here:
 (defun eepitch-lua52  () (interactive) (eepitch-comint "lua52"  "lua5.2"))
 (defun eepitch-lua53  () (interactive) (eepitch-comint "lua53"  "lua5.3"))
 (defun eepitch-lua54  () (interactive) (eepitch-comint "lua54"  "lua5.4"))
+(defun eepitch-luajit () (interactive) (eepitch-comint "luajit" "luajit"))
 (defun eepitch-julia  () (interactive) (eepitch-comint "julia"  "julia"))
 (defun eepitch-python2 () (interactive) (eepitch-comint "python2" "python2"))
 (defun eepitch-python3 () (interactive) (eepitch-comint "python3" "python3"))
diff --git a/eev-intro.el b/eev-intro.el
index 3e15657..c43a5ac 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -992,8 +992,8 @@ literal ^O in a buffer by typing `C-q C-o'.
 It is possible to make other characters play the role of the red
 star, but to make that work you need to know a bit of Lisp. See:
 
-  (find-eepitch-bullet-links)
-  (find-eev \"eev-tlinks.el\" \"find-eepitch-bullet-links\")
+  (find-red-star-links)
+  (find-eev \"eev-tlinks.el\" \"find-red-star-links\")
 
 
 
@@ -6537,8 +6537,6 @@ code-c-d to understand parts of this intro. See:
   (find-eev-quick-intro \"6.1. The main key: \")
   (find-eev-quick-intro \"9. Shorter hyperlinks\")
   (find-eev-quick-intro \"9.1. `code-c-d'\")
-  (find-eev-quick-intro \"9.3. Hyperlinks to PDF files\")
-  (find-eev-quick-intro \"9.5. Shorter hyperlinks to PDF files\")
 
 
 
diff --git a/eev-on-windows.el b/eev-on-windows.el
index 3700615..f07793f 100644
--- a/eev-on-windows.el
+++ b/eev-on-windows.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author: Eduardo Ochs 
 ;; Maintainer: Eduardo Ochs 
-;; Version:20211009
+;; Version:20211016
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-on-windows.el>
@@ -50,7 +50,7 @@
 ;;   (delete-file "~/bin/wget.exe")
 ;;   (ee-download-with-eww "http://angg.twu.net/2021-oficina/wget.exe"; 
"~/bin/")
 ;;   (ee-use-windows)
-;; and they need to run the tests in:
+;; and they need to run the tests in this section of this file:
 ;;   (to "directories")
 ;;
 ;; The function `(ee-use-windows)' is sort of reversible - with:
@@ -118,12 +118,11 @@
 
 
 ;; «ee-use-eshell»  (to ".ee-use-eshell")
-;; TODO: define an `eepitch-eshell2'.
 ;;
 (defun ee-use-eshell ()
   (interactive)
   (defun eepitch-shell  () (interactive) (eepitch-eshell))
-  (defun eepitch-shell2 () (interactive) (eepitch-eshell))
+  (defun eepitch-shell2 () (interac

[nongnu] elpa/swift-mode e246264: Fix face of function names

2021-10-16 Thread ELPA Syncer
branch: elpa/swift-mode
commit e24626440ce350596f4c1676f6644437a0500bbd
Author: taku0 
Commit: taku0 

Fix face of function names

Fixes https://github.com/swift-emacs/swift-mode/issues/174.
---
 swift-mode-font-lock.el| 10 +-
 test/swift-files/font-lock/font-lock.swift |  4 
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/swift-mode-font-lock.el b/swift-mode-font-lock.el
index 595554a..878d77a 100644
--- a/swift-mode-font-lock.el
+++ b/swift-mode-font-lock.el
@@ -653,16 +653,16 @@ Excludes true, false, and keywords begin with a number 
sign.")
  .
  'swift-mode:builtin-precedence-group-face)
 
-;; Method/function calls
-("\\<\\(\\(\\sw\\|\\s_\\)+\\)\\>\\??\\s-*("
- 1
- 'swift-mode:function-call-face)
-
 ;; Function and type declarations
 (swift-mode:font-lock-match-declared-function-names
  .
  'swift-mode:function-name-face)
 
+;; Method/function calls
+("\\<\\(\\(\\sw\\|\\s_\\)+\\)\\>\\??\\s-*("
+ 1
+ 'swift-mode:function-call-face)
+
 ;; Property accesses
 (swift-mode:font-lock-match-property-access
  .
diff --git a/test/swift-files/font-lock/font-lock.swift 
b/test/swift-files/font-lock/font-lock.swift
index 4113d74..a349ddb 100644
--- a/test/swift-files/font-lock/font-lock.swift
+++ b/test/swift-files/font-lock/font-lock.swift
@@ -55,3 +55,7 @@ foo +!+!+!+!+ bbb // "foo +!+!+!+!+ bbb"
 //
 
 enum Foo: Error { .foo } // #("enum Foo: Error { .foo }" 0 4 (face 
swift-mode:keyword-face) 5 8 (face swift-mode:function-name-face) 10 15 (face 
swift-mode:builtin-type-face) 19 22 (face swift-mode:property-access-face))
+
+func foo() { // #("func foo() {" 0 4 (face swift-mode:keyword-face) 5 8 (face 
swift-mode:function-name-face))
+foo() // #("foo()" 4 7 (face swift-mode:function-call-face))
+}



[elpa] externals/org 38b632d 06/29: org.el/org--get-local-tags: Add cache support

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 38b632d2ea0471ab57f891473ff96a2b74854034
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org--get-local-tags: Add cache support
---
 lisp/org.el | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 8cedfcb..b9a062e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12472,10 +12472,15 @@ TAGS is a list of strings."
 (defun org--get-local-tags ()
   "Return list of tags for the current headline.
 Assume point is at the beginning of the headline."
-  (and (looking-at org-tag-line-re)
-   (split-string (match-string-no-properties 2) ":" t)))
-
-(defun org-get-tags (&optional pos local)
+  (let* ((cached (and (org-element--cache-active-p) (org-element-at-point nil 
'cached)))
+ (cached-tags (org-element-property :tags cached)))
+(if cached
+;; If we do not wrap result into `cl-copy-list', reference would
+;; be returned and cache element might be modified directly.
+(cl-copy-list cached-tags)
+  ;; Parse tags manually.
+  (and (looking-at org-tag-line-re)
+   (split-string (match-string-no-properties 2) ":" t)
   "Get the list of tags specified in the current headline.
 
 When argument POS is non-nil, retrieve tags for headline at POS.



[elpa] externals/org 60c927f 17/29: Add new element parser and cache tests

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 60c927f8b8da12d07056373e3af98e1666b5637e
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Add new element parser and cache tests
---
 testing/lisp/test-org-element.el | 173 +--
 1 file changed, 168 insertions(+), 5 deletions(-)

diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 94f100f..560ba59 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -2165,8 +2165,13 @@ e^{i\\pi}+1=0
   ;; Handle non-empty blank line at the end of buffer.
   (should
(org-test-with-temp-text "#+BEGIN_CENTER\nC\n#+END_CENTER\n  "
- (= (org-element-property :end (org-element-at-point)) (point-max)
-
+ (= (org-element-property :end (org-element-at-point)) (point-max
+  (should
+   (org-test-with-temp-text "#+BEGIN_CENTER\nC\n#+END_CENTER\n  "
+ (= (org-element-property :end (org-element-at-point))
+(save-excursion
+  (search-forward "END")
+  (line-beginning-position))
 
  Plain List
 
@@ -2204,7 +2209,11 @@ Outside list"
   ;; beginning.
   (should
(org-test-with-temp-text "- list\n   \n   "
- (= (org-element-property :end (org-element-at-point)) (point-max)
+ (= (org-element-property :end (org-element-at-point)) (point-max
+  ;; Correctly compute list ending when list is before first headline.
+  (dolist (org-element-use-cache '(t nil))
+(org-test-with-temp-text "- list\n* Headline\n"
+  (should (= (org-element-property :end (org-element-at-point)) 8)
 
 
  Planning
@@ -3732,6 +3741,14 @@ Text
(org-test-with-temp-text "- Para1\n- Para2\n\nPara3"
 (progn (forward-line 2)
(org-element-type (org-element-at-point))
+  ;; Special case: at the last blank line in a plain list at the end of
+  ;; a headline, return the plain list, not the last item, and not the
+  ;; headline.
+  (should
+   (eq 'plain-list
+   (org-test-with-temp-text "* Headline\n- Para1\n- Para2\n\nPara3\n* 
Another headline"
+(progn (forward-line 3)
+   (org-element-type (org-element-at-point))
   ;; Special case: when a list ends at the end of buffer and there's
   ;; no final newline, return last element in last item.
   (should
@@ -4063,20 +4080,166 @@ Text
 
 (ert-deftest test-org-element/cache-bugs ()
   "Test basic expectations and common pitfalls for cache."
-  :expected-result :failed
   ;; Unindented second row of the table should not be re-parented by
   ;; inserted item.
   (should
(eq 'table
(let ((org-element-use-cache t))
 (org-test-with-temp-text
- "#+begin_center\nP0\n\n\n\n  P1\n  | a | b |\n| c | d 
|\n#+end_center"
+ "#+begin_center
+P0
+
+
+
+  P1
+  | a | b |
+| c | d |
+#+end_center"
  (save-excursion (search-forward "| c |") (org-element-at-point))
  (insert "- item")
  (search-forward "| c |")
  (beginning-of-line)
+ (org-element-type (org-element-at-point))
+  (should
+   (eq 'table
+   (let ((org-element-use-cache t))
+(org-test-with-temp-text
+ "
+- item 1
+
+
+  | a | b |
+| c | d |
+#+end_center"
+ (save-excursion (search-forward "| c |") (org-element-at-point))
+  (delete-char 1)
+ (search-forward "| c |")
+ (beginning-of-line)
+ (org-element-type (org-element-at-point))
+  (should
+   (eq 'table-row
+   (let ((org-element-use-cache t))
+(org-test-with-temp-text
+ "
+- item 1
+
+  | a | b |
+| c | d |
+#+end_center"
+ (save-excursion (search-forward "| c |") (org-element-at-point))
+  (insert "\n")
+ (search-forward "| c |")
+ (beginning-of-line)
  (org-element-type (org-element-at-point)))
 
+(ert-deftest test-org-element/cache-headline ()
+  "Test basic expectations and common pitfalls for cached headings."
+  ;; Appending to final headline in a subtree.
+  (org-test-with-temp-text
+  "
+* Heading
+Aliquam erat volutpat.
+
+*** Subheading
+** Another
+** Final
+:PROPERTIES:
+:ID: some
+:END:
+* Heading 2
+** End
+"
+(let ((org-element-use-cache t))
+  (org-element-at-point)
+  (save-excursion
+(goto-char (point-max))
+(org-element-at-point))
+  (insert ":CATEOGORY: cat\n")
+  (search-backward "* Heading")
+  (should
+   (eq (org-element-property :end (org-element-at-point))
+   (save-excursion
+ (search-forward "* Heading 2")
+ (line-beginning-position
+  (search-forward "* Heading 2")
+  (beginning-of-line)
+  (insert "\n\n")
+  (search-backward "* Heading")
+  (should
+   (eq (org-element-property :end (org-element-at-point))
+   (save-excursion
+ (search-forward "* Heading 2")
+ (line-beginning-position))
+  ;; Appending at eob.
+  (org-test-with-temp-text
+  "
+* Heading
+*** Sub-heading
+*

[elpa] externals/org 004ac14 28/29: Fix compatibility with Emacs 26

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 004ac14a5bacf311e3d0f14a7cd8345a49980bef
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Fix compatibility with Emacs 26

* lisp/org-compat.el (org-file-name-concat): Do not use
`string-empty-p'.
(combine-change-calls): Create a stub when `combine-change-calls' were
not yet available.
(org-replace-buffer-contents): Add compatibility function for
`replace-buffer-contents'.

* lisp/org-element.el (org-element--current-element): Do not use
`if-let'.
* lisp/org-persist.el (org-persist-gc): Do not use `when-let'.
* lisp/org-plot.el (org-plot/gnuplot): Do not use `if-let'.
* lisp/org-src.el (org-edit-src-save, org-edit-src-exit): Use
`org-replace-buffer-contents'.

* lisp/org.el (org-narrow-to-subtree, org--property-local-values,
org-entry-get-with-inheritance, org-in-commented-heading-p,
org-up-heading-safe, org-goto-first-child): Do not use
`if-let'/`when-let'.

* testing/org-test.el (org-test-at-time): Fallback to old
`decode-time' specification in older Emacs.
---
 lisp/org-compat.el  |  13 +-
 lisp/org-element.el | 365 ++--
 lisp/org-persist.el |  21 +--
 lisp/org-plot.el|   7 +-
 lisp/org-src.el |   8 +-
 lisp/org.el | 322 ++---
 testing/org-test.el |   9 +-
 7 files changed, 385 insertions(+), 360 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 737f628..4019b06 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -90,7 +90,7 @@ inserted before contatenating."
(delq nil
  (mapcar
   (lambda (str)
-(when (and str (not (string-empty-p str))
+(when (and str (not (seq-empty-p str))
(string-match "\\(.+\\)/?" str))
   (match-string 1 str)))
   (cons directory components)))
@@ -106,6 +106,17 @@ inserted before contatenating."
 
 ;;; Emacs < 27.1 compatibility
 
+(unless (fboundp 'combine-change-calls)
+  ;; A stub when `combine-change-calls' was not yet there.
+  (defmacro combine-change-calls (_beg _end &rest body)
+(declare (debug (form form def-body)) (indent 2))
+`(progn ,@body)))
+
+(if (version< emacs-version "27.1")
+(defsubst org-replace-buffer-contents (source &optional _max-secs 
_max-costs)
+  (replace-buffer-contents source))
+  (defalias 'org-replace-buffer-contents #'replace-buffer-contents))
+
 (unless (fboundp 'proper-list-p)
   ;; `proper-list-p' was added in Emacs 27.1.  The function below is
   ;; taken from Emacs subr.el 200195e824b^.
diff --git a/lisp/org-element.el b/lisp/org-element.el
index bcf5c62..42f97b4 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -4138,189 +4138,190 @@ not checked.
 
 This function assumes point is always at the beginning of the
 element it has to parse."
-  (if-let* ((element (and (not (buffer-narrowed-p))
-  (org-element--cache-active-p)
-  (not org-element--cache-sync-requests)
-  (org-element--cache-find (point) t)))
-(element (progn (while (and element
-(not (and (eq (point) 
(org-element-property :begin element))
-(eq mode (org-element-property 
:mode element)
-  (setq element (org-element-property :parent 
element)))
-element))
-(old-element element)
-(element (when
- (pcase (org-element-property :granularity element)
-   (`nil t)
-   (`object t)
-   (`element (not (memq granularity '(nil object
-   (`greater-element (not (memq granularity '(nil 
object element
-   (`headline (eq granularity 'headline)))
-   element)))
-  element
-(save-excursion
-  (let ((case-fold-search t)
-   ;; Determine if parsing depth allows for secondary strings
-   ;; parsing.  It only applies to elements referenced in
-   ;; `org-element-secondary-value-alist'.
-   (raw-secondary-p (and granularity (not (eq granularity 'object
-result)
-(setq
- result
- (cond
-  ;; Item.
-  ((eq mode 'item)
-  (org-element-item-parser limit structure raw-secondary-p))
-  ;; Table Row.
-  ((eq mode 'table-row) (org-element-table-row-parser limit))
-  ;; Node Property.
-  ((eq mode 'node-property) (org-element-node-property-parser limit))
-  ;; Headline.
-  ((org-with-limited-levels (org-at-heading-p))
-   (org-element-headline-parser limit raw-secondary-p))
-  ;; Sections (must be checked after headline).
- 

[elpa] externals/org 5d162b7 10/29: org.el/org-back-to-heading: Handle inlinetasks correctly

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 5d162b7bcf3b3790d9a4d2df8b5bf73f3a7e1dfc
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-back-to-heading: Handle inlinetasks correctly

* lisp/org.el(org-back-to-heading): Rewrite `outline-back-to-heading'
considering inlinetasks.
---
 lisp/org.el | 42 +++---
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index dafdb31..38ce7ac 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20567,21 +20567,39 @@ interactive command with similar behavior."
 (<= (org-outline-level) level
 
 (defun org-back-to-heading (&optional invisible-ok)
-  "Call `outline-back-to-heading', but provide a better error message."
-  (condition-case nil
-  (outline-back-to-heading invisible-ok)
-(error
- (user-error "Before first headline at position %d in buffer %s"
-(point) (current-buffer)
+  "Go back to beginning of heading."
+  (beginning-of-line)
+  (or (org-at-heading-p (not invisible-ok))
+  (let (found)
+   (save-excursion
+  ;; At inlinetask end.  Move to bol, so that the following
+  ;; search goes to the beginning of the inlinetask.
+  (when (and (featurep 'org-inlinetask)
+ (fboundp 'org-inlinetask-end-p)
+ (org-inlinetask-end-p))
+(goto-char (line-beginning-position)))
+ (while (not found)
+   (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
+   nil t)
+(user-error "Before first headline at position %d in buffer %s"
+   (point) (current-buffer)))
+;; Skip inlinetask end.
+(if (and (featurep 'org-inlinetask)
+ (fboundp 'org-inlinetask-end-p)
+ (org-inlinetask-end-p))
+(org-inlinetask-goto-beginning)
+ (setq found (and (or invisible-ok (not (org-invisible-p)))
+  (point))
+   (goto-char found)
+   found)))
 
 (defun org-back-to-heading-or-point-min (&optional invisible-ok)
   "Go back to heading or first point in buffer.
 If point is before first heading go to first point in buffer
 instead of back to heading."
-  (condition-case nil
-  (outline-back-to-heading invisible-ok)
-(error
- (goto-char (point-min)
+  (if (org-before-first-heading-p)
+  (goto-char (point-min))
+(org-back-to-heading invisible-ok)))
 
 (defun org-before-first-heading-p ()
   "Before first heading?"
@@ -20712,7 +20730,9 @@ level of the headline found (down to 0) or nil if 
already at a
 point before the first headline or at point-min."
   (when (ignore-errors (org-back-to-heading t))
 (if (< 1 (funcall outline-level))
-   (org-up-heading-safe)
+   (or (org-up-heading-safe)
+;; The first heading may not be level 1 heading.
+(goto-char (point-min)))
   (unless (= (point) (point-min)) (goto-char (point-min))
 
 (defun org-first-sibling-p ()



[elpa] externals/org 3c4290e 21/29: org.el/org-scan-tags: Make use of fast `org-element-cache-map'

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 3c4290e668b15c64e6d48b1926291987742476e8
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-scan-tags: Make use of fast `org-element-cache-map'
---
 lisp/org.el | 304 ++--
 1 file changed, 195 insertions(+), 109 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 5256fa4..2dde75d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11533,115 +11533,201 @@ headlines matching this string."
   (when (eq action 'sparse-tree)
(org-overview)
(org-remove-occur-highlights))
-  (while (let (case-fold-search)
-  (re-search-forward re nil t))
-   (setq org-map-continue-from nil)
-   (catch :skip
- ;; Ignore closing parts of inline tasks.
- (when (and (fboundp 'org-inlinetask-end-p) (org-inlinetask-end-p))
-   (throw :skip t))
- (setq todo (and (match-end 1) (match-string-no-properties 1)))
- (setq tags (and (match-end 4) (org-trim (match-string-no-properties 
4
- (goto-char (setq lspos (match-beginning 0)))
- (setq level (org-reduced-level (org-outline-level))
-   category (org-get-category))
-  (when (eq action 'agenda)
-(setq ts-date-pair (org-agenda-entry-get-agenda-timestamp (point))
- ts-date (car ts-date-pair)
- ts-date-type (cdr ts-date-pair)))
- (setq i llast llast level)
- ;; remove tag lists from same and sublevels
- (while (>= i level)
-   (when (setq entry (assoc i tags-alist))
- (setq tags-alist (delete entry tags-alist)))
-   (setq i (1- i)))
- ;; add the next tags
- (when tags
-   (setq tags (org-split-string tags ":")
- tags-alist
- (cons (cons level tags) tags-alist)))
- ;; compile tags for current headline
- (setq tags-list
-   (if org-use-tag-inheritance
-   (apply 'append (mapcar 'cdr (reverse tags-alist)))
- tags)
-   org-scanner-tags tags-list)
- (when org-use-tag-inheritance
-   (setcdr (car tags-alist)
-   (mapcar (lambda (x)
- (setq x (copy-sequence x))
- (org-add-prop-inherited x))
-   (cdar tags-alist
- (when (and tags org-use-tag-inheritance
-(or (not (eq t org-use-tag-inheritance))
-org-tags-exclude-from-inheritance))
-   ;; Selective inheritance, remove uninherited ones.
-   (setcdr (car tags-alist)
-   (org-remove-uninherited-tags (cdar tags-alist
- (when (and
-
-;; eval matcher only when the todo condition is OK
-(and (or (not todo-only) (member todo org-todo-keywords-1))
- (if (functionp matcher)
- (let ((case-fold-search t) (org-trust-scanner-tags t))
-   (funcall matcher todo tags-list level))
-   matcher))
-
-;; Call the skipper, but return t if it does not
-;; skip, so that the `and' form continues evaluating.
-(progn
-  (unless (eq action 'sparse-tree) (org-agenda-skip))
-  t)
-
-;; Check if timestamps are deselecting this entry
-(or (not todo-only)
-(and (member todo org-todo-keywords-1)
- (or (not org-agenda-tags-todo-honor-ignore-options)
- (not 
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))
-
-   ;; select this headline
-   (cond
-((eq action 'sparse-tree)
- (and org-highlight-sparse-tree-matches
-  (org-get-heading) (match-end 0)
-  (org-highlight-new-match
-   (match-beginning 1) (match-end 1)))
- (org-show-context 'tags-tree))
-((eq action 'agenda)
- (setq txt (org-agenda-format-item
-""
-(concat
- (if (eq org-tags-match-list-sublevels 'indented)
- (make-string (1- level) ?.) "")
- (org-get-heading))
-(make-string level ?\s)
-category
-tags-list)
-   priority (org-get-priority txt))
- (goto-char lspos)
- (setq marker (org-agenda-new-marker))
- (org-add-props txt props
-   'org-marker marker 'org-hd-marker marker 'org-category category
-   'todo-state todo
-'ts-date ts-date
-   'priority priority
-'type (concat "tagsmatch" ts-date-type))
- (push txt rtn))
-

[elpa] externals/org 85712d6 25/29: Add comments documenting cache diagnostics

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 85712d6456e7de1daa0e9d1d2203b445ee08c798
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Add comments documenting cache diagnostics
---
 lisp/org-element.el | 30 --
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 69baf0f..bcf5c62 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5182,17 +5182,20 @@ indentation removed from its contents."
 
 ;;; Cache
 ;;
-;; Implement a caching mechanism for `org-element-at-point' and
-;; `org-element-context', which see.
+;; Implement a caching mechanism for `org-element-at-point', 
`org-element-context', and for
+;; fast mapping across Org elements in `org-element-cache-map', which see.
 ;;
-;; A single public function is provided: `org-element-cache-reset'.
+;; When cache is enabled, the elements returned by `org-element-at-point' and
+;; `org-element-context' are returned by reference.  Altering these elements 
will
+;; also alter their cache representation.  The same is true for
+;; elements passed to mapping function in `org-element-cache-map'.
 ;;
-;; Cache is disabled by default for now because it sometimes triggers
-;; freezes, but it can be enabled globally with
-;; `org-element-use-cache'.  `org-element-cache-sync-idle-time',
-;; `org-element-cache-sync-duration' and
-;; `org-element-cache-sync-break' can be tweaked to control caching
-;; behavior.
+;; Public functions are: `org-element-cache-reset', 
`org-element-cache-refresh', and
+;; `org-element-cache-map'.
+;;
+;; Cache can be controlled using `org-element-use-cache' and 
`org-element-cache-persistent'.
+;;  `org-element-cache-sync-idle-time', `org-element-cache-sync-duration' and
+;; `org-element-cache-sync-break' can be tweaked to control caching behavior.
 ;;
 ;; Internally, parsed elements are stored in an AVL tree,
 ;; `org-element--cache'.  This tree is updated lazily: whenever
@@ -5224,7 +5227,14 @@ indentation removed from its contents."
 ;; associated to a key, obtained with `org-element--cache-key'.  This
 ;; mechanism is robust enough to preserve total order among elements
 ;; even when the tree is only partially synchronized.
-
+;;
+;; The cache code debuggin is fairly complex because cache request
+;; state is often hard to reproduce.  An extensive diagnostics
+;; functionality is built into the cache code to assist hunting bugs.
+;; See `org-element--cache-self-verify', 
`org-element--cache-self-verify-frequency',
+;; `org-element--cache-diagnostics', `org-element--cache-diagnostics-level',
+;; `org-element--cache-diagnostics-ring-size', 
`org-element--cache-map-statistics',
+;; `org-element--cache-map-statistics-threshold'.
 
 (defvar org-element-use-cache t
   "Non-nil when Org parser should cache its results.")



[elpa] externals/org ec73755 12/29: org.el/org-end-of-subtree: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit ec737554d053b2ce66a30ffc503c80c30729bebd
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-end-of-subtree: Support cache and passing element arg
---
 lisp/org.el | 58 --
 1 file changed, 32 insertions(+), 26 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 158e37d..196a264 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20847,8 +20847,8 @@ If there is no such heading, return nil."
   (unless (< (funcall outline-level) level)
 (point)
 
-(defun org-end-of-subtree (&optional invisible-ok to-heading)
-  "Goto to the end of a subtree."
+(defun org-end-of-subtree (&optional invisible-ok to-heading element)
+  "Goto to the end of a subtree at point or for ELEMENT heading."
   ;; This contains an exact copy of the original function, but it uses
   ;; `org-back-to-heading-or-point-min', to make it work also in invisible
   ;; trees and before first headline.  And is uses an invisible-ok argument.
@@ -20857,31 +20857,37 @@ If there is no such heading, return nil."
   ;; with many children and grandchildren etc, this can be much faster
   ;; than the outline version.
   (org-back-to-heading-or-point-min invisible-ok)
-  (let ((first t)
-   (level (funcall outline-level)))
-(cond ((= level 0)
-  (goto-char (point-max)))
- ((and (derived-mode-p 'org-mode) (< level 1000))
-  ;; A true heading (not a plain list item), in Org
-  ;; This means we can easily find the end by looking
-  ;; only for the right number of stars.  Using a regexp to do
-  ;; this is so much faster than using a Lisp loop.
-  (let ((re (concat "^\\*\\{1," (number-to-string level) "\\} ")))
-(forward-char 1)
-(and (re-search-forward re nil 'move) (beginning-of-line 1
- (t
-  ;; something else, do it the slow way
-  (while (and (not (eobp))
-  (or first (> (funcall outline-level) level)))
-(setq first nil)
-(outline-next-heading
-(unless to-heading
+  (unless (and (org-element--cache-active-p)
+   (let ((cached (or element (org-element-at-point nil t
+ (and cached
+  (eq 'headline (org-element-type cached))
+  (goto-char (org-element-property
+  :end cached)
+(let ((first t)
+ (level (funcall outline-level)))
+  (cond ((= level 0)
+(goto-char (point-max)))
+   ((and (derived-mode-p 'org-mode) (< level 1000))
+;; A true heading (not a plain list item), in Org
+;; This means we can easily find the end by looking
+;; only for the right number of stars.  Using a regexp to do
+;; this is so much faster than using a Lisp loop.
+(let ((re (concat "^\\*\\{1," (number-to-string level) "\\} ")))
+  (forward-char 1)
+  (and (re-search-forward re nil 'move) (beginning-of-line 1
+   (t
+;; something else, do it the slow way
+(while (and (not (eobp))
+(or first (> (funcall outline-level) level)))
+  (setq first nil)
+  (outline-next-heading))
+  (unless to-heading
+(when (memq (preceding-char) '(?\n ?\^M))
+  ;; Go to end of line before heading
+  (forward-char -1)
   (when (memq (preceding-char) '(?\n ?\^M))
-   ;; Go to end of line before heading
-   (forward-char -1)
-   (when (memq (preceding-char) '(?\n ?\^M))
- ;; leave blank line before heading
- (forward-char -1)
+   ;; leave blank line before heading
+   (forward-char -1
   (point))
 
 (defun org-end-of-meta-data (&optional full)



[elpa] externals/org f4bcc0c 29/29: Merge branch 'main' into feature/org-element-cache-new

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit f4bcc0cc5675c3f26e71494832460b7d0d1470fc
Merge: 004ac14 9475993
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'main' into feature/org-element-cache-new
---
 etc/ORG-NEWS |  9 
 lisp/oc-basic.el |  1 -
 lisp/org-goto.el | 67 
 lisp/org.el  |  1 +
 4 files changed, 43 insertions(+), 35 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 5700583..3c9d6e5 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -183,6 +183,15 @@ latest stable version of Org should be compatible with 
Emacs 28.x,
 
 See [[https://orgmode.org/worg/org-maintenance.html#emacs-compatibility][this 
note on Worg]] and [[git::519947e508e081e71bf67db99e27b1c171ba4dfe][this 
commit]].
 
+*** The keybinding for ~org-table-blank-field~ has been removed
+
+If you prefer to keep the keybinding, you can add it back to
+~org-mode-map~ like so:
+
+#+begin_src emacs-lisp
+(define-key org-mode-map (kbd "C-c SPC") #'org-table-blank-field)
+#+end_src
+
 ** New features
 
 *** New citation engine
diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index 691e284..1a01ea4 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -69,7 +69,6 @@
 (require 'bibtex)
 (require 'json)
 (require 'oc)
-(require 'org)
 (require 'seq)
 
 (declare-function org-open-at-point "org" (&optional arg))
diff --git a/lisp/org-goto.el b/lisp/org-goto.el
index 0a3470f..352bf9f 100644
--- a/lisp/org-goto.el
+++ b/lisp/org-goto.el
@@ -203,40 +203,39 @@ When nil, you can use these keybindings to navigate the 
buffer:
   "Let the user select a location in current buffer.
 This function uses a recursive edit.  It returns the selected
 position or nil."
-  (org-no-popups
-   (let ((isearch-mode-map org-goto-local-auto-isearch-map)
-(isearch-hide-immediately nil)
-(isearch-search-fun-function
- (lambda () #'org-goto--local-search-headings))
-(help (or help org-goto-help)))
- (save-excursion
-   (save-window-excursion
-(delete-other-windows)
-(and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
-(pop-to-buffer-same-window
- (condition-case nil
- (make-indirect-buffer (current-buffer) "*org-goto*" t)
-   (error (make-indirect-buffer (current-buffer) "*org-goto*" t
-(let (temp-buffer-show-function temp-buffer-show-hook)
-  (with-output-to-temp-buffer "*Org Help*"
-(princ (format help (if org-goto-auto-isearch
-"  Just type for auto-isearch."
-  "  n/p/f/b/u to navigate, q to quit.")
-(org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
-(org-overview)
-(setq buffer-read-only t)
-(if (and (boundp 'org-goto-start-pos)
- (integer-or-marker-p org-goto-start-pos))
-(progn (goto-char org-goto-start-pos)
-   (when (org-invisible-p)
- (org-show-set-visibility 'lineage)))
-  (goto-char (point-min)))
-(let (org-special-ctrl-a/e) (org-beginning-of-line))
-(message "Select location and press RET")
-(use-local-map org-goto-map)
-(recursive-edit)))
- (kill-buffer "*org-goto*")
- (cons org-goto-selected-point org-goto-exit-command
+  (let ((isearch-mode-map org-goto-local-auto-isearch-map)
+   (isearch-hide-immediately nil)
+   (isearch-search-fun-function
+(lambda () #'org-goto--local-search-headings))
+   (help (or help org-goto-help)))
+(save-excursion
+  (save-window-excursion
+   (delete-other-windows)
+   (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
+   (pop-to-buffer-same-window
+(condition-case nil
+(make-indirect-buffer (current-buffer) "*org-goto*" t)
+  (error (make-indirect-buffer (current-buffer) "*org-goto*" t
+   (let (temp-buffer-show-function temp-buffer-show-hook)
+ (with-output-to-temp-buffer "*Org Help*"
+   (princ (format help (if org-goto-auto-isearch
+   "  Just type for auto-isearch."
+ "  n/p/f/b/u to navigate, q to quit.")
+   (org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
+   (org-overview)
+   (setq buffer-read-only t)
+   (if (and (boundp 'org-goto-start-pos)
+(integer-or-marker-p org-goto-start-pos))
+   (progn (goto-char org-goto-start-pos)
+  (when (org-invisible-p)
+(org-show-set-visibility 'lineage)))
+ (goto-char (point-min)))
+   (let (org-special-ctrl-a/e) (org-beginning-of-line))
+   (message "Select location and press RET")
+   (use-local-map org-goto-map)
+   (recursive-edit)))
+(kill-buffer "*org-goto*")
+(cons org-goto-selected-point org-goto-exit-command)))
 
 ;;;###autoload
 (defun org-goto (&option

[elpa] externals/org 399a29c 13/29: org.el/org-up-heading-safe: Add cache support

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 399a29c4f47bc30e04d213f0224e0a364c9644ed
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-up-heading-safe: Add cache support
---
 lisp/org.el | 59 ---
 1 file changed, 36 insertions(+), 23 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 196a264..ea43d66 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20698,29 +20698,42 @@ headline found, or nil if no higher level is found.
 Also, this function will be a lot faster than `outline-up-heading',
 because it relies on stars being the outline starters.  This can really
 make a significant difference in outlines with very many siblings."
-  (when (ignore-errors (org-back-to-heading t))
-(let (level-cache)
-  (unless org--up-heading-cache
-(setq org--up-heading-cache (make-hash-table)))
-  (if (and (eq (buffer-chars-modified-tick) org--up-heading-cache-tick)
-   (setq level-cache (gethash (point) org--up-heading-cache)))
-  (when (<= (point-min) (car level-cache) (point-max))
-;; Parent is inside accessible part of the buffer.
-(progn (goto-char (car level-cache))
-   (cdr level-cache)))
-;; Buffer modified.  Invalidate cache.
-(unless (eq (buffer-chars-modified-tick) org--up-heading-cache-tick)
-  (setq-local org--up-heading-cache-tick
-  (buffer-chars-modified-tick))
-  (clrhash org--up-heading-cache))
-(let* ((level-up (1- (funcall outline-level)))
-   (pos (point))
-   (result (and (> level-up 0)
-   (re-search-backward
- (format "^\\*\\{1,%d\\} " level-up) nil t)
-   (funcall outline-level
-  (when result (puthash pos (cons (point) result) 
org--up-heading-cache))
-  result)
+  (if-let ((element (and (org-element--cache-active-p)
+ (org-element-at-point nil t
+  (let* ((current-heading (org-element-lineage element '(headline) 
'with-self))
+ (parent (org-element-lineage current-heading '(headline
+(if (and parent
+ (<= (point-min) (org-element-property :begin parent)))
+(progn
+  (goto-char (org-element-property :begin parent))
+  (org-element-property :level parent))
+  (when (and current-heading
+ (<= (point-min) (org-element-property :begin 
current-heading)))
+(goto-char (org-element-property :begin current-heading))
+nil)))
+(when (ignore-errors (org-back-to-heading t))
+  (let (level-cache)
+(unless org--up-heading-cache
+  (setq org--up-heading-cache (make-hash-table)))
+(if (and (eq (buffer-chars-modified-tick) org--up-heading-cache-tick)
+ (setq level-cache (gethash (point) org--up-heading-cache)))
+(when (<= (point-min) (car level-cache) (point-max))
+  ;; Parent is inside accessible part of the buffer.
+  (progn (goto-char (car level-cache))
+ (cdr level-cache)))
+  ;; Buffer modified.  Invalidate cache.
+  (unless (eq (buffer-chars-modified-tick) org--up-heading-cache-tick)
+(setq-local org--up-heading-cache-tick
+(buffer-chars-modified-tick))
+(clrhash org--up-heading-cache))
+  (let* ((level-up (1- (funcall outline-level)))
+ (pos (point))
+ (result (and (> level-up 0)
+ (re-search-backward
+   (format "^\\*\\{1,%d\\} " level-up) nil t)
+ (funcall outline-level
+(when result (puthash pos (cons (point) result) 
org--up-heading-cache))
+result))
 
 (defun org-up-heading-or-point-min ()
   "Move to the heading line of which the present is a subheading, or point-min.



[elpa] externals/org e70a8aa 18/29: Use org-element-cache in place of text property cache in agenda

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit e70a8aac593c5aae517e6f0b98e6061cefb15a6c
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Use org-element-cache in place of text property cache in agenda

* lisp/org-agenda.el (org-agenda-skip): Use
`org-in-archived-heading-p' and `org-in-commented-heading-p' in place
of text property cache.

(org-agenda-get-todos, org-agenda-get-timestamps,
org-agenda-get-sexps, org-agenda-get-progress,
org-agenda-get-deadlines, org-agenda-get-scheduled,
org-agenda-get-blocks): Do not use text property cache in favour of
Org API functions.  The API functions use cache now.

* lisp/org-clock.el (org-element--cache-active-p): Declare function to
suppress compiler warning.

(org-clock-in): Do not use text property cache when element cache is
active.

* lisp/org-duration.el (org-duration-to-minutes): Do not change match
data.  It is needed to not break agenda---agenda relies on match data
not being altered.

* lisp/org.el (org-run-like-in-org-mode): Use element cache.
(org-refresh-category-properties): Use element cache.
(org-make-tags-matcher, org-agenda-prepare-buffers): Do not rely on
text property cache.

* testing/lisp/test-org.el (test-org/refresh-category-properties): Do
not use text property cache.
---
 lisp/org-agenda.el   |  55 +++
 lisp/org-clock.el|   4 +-
 lisp/org-duration.el |  49 -
 lisp/org.el  | 137 ++-
 testing/lisp/test-org.el |  10 ++--
 5 files changed, 141 insertions(+), 114 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 5eb896b..888bd92 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4162,21 +4162,23 @@ The correct usage for `org-agenda-skip-function' is to 
bind it with
 `let' to scope it dynamically into the agenda-constructing command.
 A good way to set it is through options in `org-agenda-custom-commands'.")
 
-(defun org-agenda-skip ()
+(defun org-agenda-skip (&optional element)
   "Throw to `:skip' in places that should be skipped.
 Also moves point to the end of the skipped region, so that search can
-continue from there."
+continue from there.
+
+Optional argument ELEMENT contains element at point."
   (let ((p (point-at-bol)) to)
 (when (or
   (save-excursion (goto-char p) (looking-at comment-start-skip))
   (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
-   (or (and (get-text-property p :org-archived)
-(org-end-of-subtree t))
+   (or (and (save-match-data (org-in-archived-heading-p nil 
element))
+(org-end-of-subtree t element))
(and (member org-archive-tag org-file-tags)
 (goto-char (point-max)
   (and org-agenda-skip-comment-trees
-   (get-text-property p :org-comment)
-   (org-end-of-subtree t))
+(org-in-commented-heading-p nil element)
+   (org-end-of-subtree t element))
   (and (setq to (or (org-agenda-skip-eval 
org-agenda-skip-function-global)
 (org-agenda-skip-eval org-agenda-skip-function)))
(goto-char to))
@@ -5550,7 +5552,8 @@ and the timestamp type relevant for the sorting strategy 
in
  (t org-not-done-regexp
 marker priority category level tags todo-state
 ts-date ts-date-type ts-date-pair
-ee txt beg end inherited-tags todo-state-end-pos)
+ee txt beg end inherited-tags todo-state-end-pos
+ effort effort-minutes)
 (goto-char (point-min))
 (while (re-search-forward regexp nil t)
   (catch :skip
@@ -5569,6 +5572,8 @@ and the timestamp type relevant for the sorting strategy 
in
(goto-char (match-beginning 2))
(setq marker (org-agenda-new-marker (match-beginning 0))
  category (org-get-category)
+  effort (save-match-data (or (get-text-property (point) 'effort)
+  (org-entry-get (point) 
org-effort-property)))
  ts-date-pair (org-agenda-entry-get-agenda-timestamp (point))
  ts-date (car ts-date-pair)
  ts-date-type (cdr ts-date-pair)
@@ -5584,9 +5589,11 @@ and the timestamp type relevant for the sorting strategy 
in
  level (make-string (org-reduced-level (org-outline-level)) ? )
  txt (org-agenda-format-item "" txt level category tags t)
  priority (1+ (org-get-priority txt)))
+(setq effort-minutes (when effort (save-match-data 
(org-duration-to-minutes effort
(org-add-props txt props
  'org-marker marker 'org-hd-marker marker
  'priority priority
+  'effort effort 'effort-minutes effort-minutes
  'level level
  'ts-date ts-date
  'type 

[elpa] externals/org 8ceb9e7 27/29: Add NEWS entry for new element cache

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 8ceb9e79028cd55083b557b0d483604739ed766c
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Add NEWS entry for new element cache
---
 etc/ORG-NEWS | 75 
 1 file changed, 75 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0ba79cd..5700583 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -13,6 +13,81 @@ Please send Org bug reports to mailto:emacs-orgm...@gnu.org.
 
 * Version 9.6 (not yet released)
 
+** Important announcements and breaking changes
+
+*** Element cache is enabled by default and work for headings
+
+The old element cache code has been refactored.  Emacs does not hang
+anymore when the cache is enabled.
+
+When cache is enabled, ~org-element-at-point~ for headings is
+guaranteed to return valid =:parent= property.  The highest-level
+headings contain new =org-data= element as their parent.
+
+The new =org-data= element provides properties from top-level property
+drawer, buffer-global category, and =:path= property containing file
+path for file Org buffers.
+
+The new cache still need to be tested extensively.  Please, report any
+warning coming from element cache.  If you see warnings regularly, it
+would be helpful to set ~org-element--cache-self-verify~ to
+='backtrace= and provide the backtrace to Org mailing list.
+
+*** Element cache persists across Emacs sessions
+
+The cache state is saved between Emacs sessions.  Enabled by default.
+
+The cache persistence can be controlled via
+~org-element-cache-persistent~.
+
+** New features
+
+*** New library =org-persist.el= implements variable persistence across Emacs 
sessions
+
+The library stored variable data in ~org-persist-path~ (set to XDG
+cache dir by default).
+
+The entry points are ~org-persist-register~, ~org-persist-unregister~,
+~org-persist-read~, and ~org-persist-read-all~.  Storing circular
+structures is supported.  Storing references between different
+variables is also supported (see =:inherit= key in
+~org-persist-register~).
+
+** New functions and changes in function arguments
+
+*** New function ~org-element-cache-map~ for quick mapping across Org elements
+
+When element cache is enabled, the new function provides the best
+possible performance to map across large Org buffers.
+
+It is recommended to provide =:next-re= and =:fail-re= parameters for
+best speed.
+
+Diagnostic information about execution speed can be provided according
+to ~org-element--cache-map-statistics~ and
+~org-element--cache-map-statistics-threshold~.
+
+~org-scan-tags~ and tag views in agenda utilise the new function.
+
+*** New function ~org-element-at-point-no-context~
+
+This function is like ~org-element-at-point~, but it does not try to
+update the cache and does not guarantee correct =:parent= properties
+for =headline= elements.
+
+This function is faster than ~org-element-at-point~ when used together
+with frequent buffer edits.
+*** Various Org API functions now use cache and accept Org elements as 
optional arguments
+
+~org-in-archived-heading-p~, ~org-in-commented-heading-p~,
+~org-up-heading-safe~, ~org-end-of-subtree~, ~org-goto-first-child~,
+~org-back-to-heading~, ~org-entry-get-with-inheritance~, and
+~org-narrow-to-subtree~ all accept Org element as an extra optional
+argument.
+
+~org-get-tags~ now accepts Org element or buffer position as first
+argument.
+
 ** Miscellaneous
 
 *** New =transparent-image-converter= property for =dvipng=



[elpa] externals/org bc52c4d 03/29: Fix compatibility for older Emacs versions

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit bc52c4d9ab886c722b6fa0ca7f02823bf916aec4
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Fix compatibility for older Emacs versions

* lisp/org-compat.el (org-length>, org-file-name-concat): Add backward
compatibility for `length>' and `org-file-name-concat'.
---
 lisp/org-compat.el | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 6ac0b62..0950ff7 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -74,6 +74,33 @@
 
 ;;; Emacs < 28.1 compatibility
 
+(if (fboundp 'length>)
+(defalias 'org-length> #'length>)
+  (defun org-length> (sequence length)
+"Return non-nil if SEQUENCE is longer than LENGTH."
+(> (length sequence) length)))
+
+(if (fboundp 'file-name-concat)
+(defalias 'org-file-name-concat #'file-name-concat)
+  (defun org-file-name-concat (directory &rest components)
+"Append COMPONENTS to DIRECTORY and return the resulting string.
+
+Elements in COMPONENTS must be a string or nil.
+DIRECTORY or the non-final elements in COMPONENTS may or may not end
+with a slash -- if they don't end with a slash, a slash will be
+inserted before contatenating."
+(save-match-data
+  (mapconcat
+   #'identity
+   (delq nil
+ (mapcar
+  (lambda (str)
+(when (and str (not (string-empty-p str))
+   (string-match "\\(.+\\)/?" str))
+  (match-string 1 str)))
+  (cons directory components)))
+   "/"
+
 (if (fboundp 'directory-empty-p)
 (defalias 'org-directory-empty-p #'directory-empty-p)
   (defun org-directory-empty-p (dir)



[elpa] externals/org updated (9475993 -> f4bcc0c)

2021-10-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  9475993   Merge branch 'bugfix'
   new  6933c1a   lisp/org-persist.el: New library to store data across 
sessions
   new  fc80d05   Re-implement org-element-cache and add headline support
   new  bc52c4d   Fix compatibility for older Emacs versions
   new  68a44ea   org.el/org-narrow-to-subtree: Support cache and passing 
element arg
   new  7159ec0   org.el/org-at-planning-p: Add cache support
   new  38b632d   org.el/org--get-local-tags: Add cache support
   new  78abbcd   org.el/org-get-tags: Support cache and passing element arg
   new  7b83168   org.el/org--property-local-values: Support cache and 
passing element arg
   new  5bf5fdb   org.el/org-entry-get-with-inheritance: Support cache and 
passing element arg
   new  5d162b7   org.el/org-back-to-heading: Handle inlinetasks correctly
   new  d437817   org.el/org-goto-first-child: Support cache and passing 
element arg
   new  ec73755   org.el/org-end-of-subtree: Support cache and passing 
element arg
   new  399a29c   org.el/org-up-heading-safe: Add cache support
   new  86345df   org.el/org-in-commented-heading-p: Support cache and 
passing element arg
   new  fede258   org.el/org-in-archived-heading-p: Support cache and 
passing element arg
   new  fe6cefd   ox.el: Support cache during export
   new  60c927f   Add new element parser and cache tests
   new  e70a8aa   Use org-element-cache in place of text property cache in 
agenda
   new  5aeeb4f   Use `org-element-at-point-no-context' in 
performance-critical places
   new  85e0a69   Avoid frequent cache updates in some functions
   new  3c4290e   org.el/org-scan-tags: Make use of fast 
`org-element-cache-map'
   new  885808f   Fix incorrectly written test
   new  abe7222   Add declares to suppress compiler warnings
   new  07ca988   Fix compatibility with Emacs 27
   new  85712d6   Add comments documenting cache diagnostics
   new  eeb0450   Use XDG cache dir as default dir for cache persistance
   new  8ceb9e7   Add NEWS entry for new element cache
   new  004ac14   Fix compatibility with Emacs 26
   new  f4bcc0c   Merge branch 'main' into feature/org-element-cache-new


Summary of changes:
 etc/ORG-NEWS |   75 ++
 lisp/ob-core.el  |   19 +-
 lisp/ob-ref.el   |2 +-
 lisp/ol-bibtex.el|2 +-
 lisp/org-agenda.el   |   55 +-
 lisp/org-clock.el|4 +-
 lisp/org-compat.el   |   39 +-
 lisp/org-duration.el |   49 +-
 lisp/org-element.el  | 2674 --
 lisp/org-keys.el |2 +-
 lisp/org-list.el |2 +-
 lisp/org-macro.el|   11 +-
 lisp/org-persist.el  |  271 
 lisp/org-plot.el |7 +-
 lisp/org-src.el  |8 +-
 lisp/org-table.el|2 +
 lisp/org.el  | 1025 +--
 lisp/ox.el   |5 +
 testing/lisp/test-org-archive.el |8 +-
 testing/lisp/test-org-colview.el |1 +
 testing/lisp/test-org-element.el |  193 ++-
 testing/lisp/test-org.el |   12 +-
 testing/org-test.el  |9 +-
 23 files changed, 3347 insertions(+), 1128 deletions(-)
 create mode 100644 lisp/org-persist.el



[elpa] externals/org 6933c1a 01/29: lisp/org-persist.el: New library to store data across sessions

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 6933c1ad78088a5d34237f69868962483319b824
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

lisp/org-persist.el: New library to store data across sessions
---
 lisp/org-persist.el | 262 
 1 file changed, 262 insertions(+)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
new file mode 100644
index 000..1de4b4b
--- /dev/null
+++ b/lisp/org-persist.el
@@ -0,0 +1,262 @@
+;;; org-persist.el --- Persist data across Emacs sessions -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2021-2021 Free Software Foundation, Inc.
+
+;; Author: Ihor Radchenko 
+;; Keywords: cache, storage
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+;;
+;; This file implements persistant data storage across Emacs sessions.
+;; Both global and buffer-local data can be stored.
+
+;;; Code:
+
+(require 'org-compat)
+(require 'org-id)
+
+(declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-next-visible-heading "org" (arg))
+(declare-function org-at-heading-p "org" (&optional invisible-not-ok))
+
+(defvar org-persist-path (org-file-name-concat user-emacs-directory 
"org-persist/")
+  "Directory where the data is stored.")
+
+(defvar org-persist-index-file "index"
+  "File name used to store the data index.")
+
+(defvar org-persist-before-write-hook nil
+  "Abnormal hook ran before saving data for a single variable in a buffer.
+The hook must accept the same arguments as `org-persist-write'.
+The hooks will be evaluated until a hook returns non-nil.
+If any of the hooks return non-nil, do not save the data.")
+
+(defvar org-persist-before-read-hook nil
+  "Abnormal hook ran before reading data for a single variable in a buffer.
+The hook must accept the same arguments as `org-persist-read'.
+The hooks will be evaluated until a hook returns non-nil.
+If any of the hooks return non-nil, do not read the data.")
+
+(defvar org-persist-after-read-hook nil
+  "Abnormal hook ran after reading data for a single variable in a buffer.
+The hook must accept the same arguments as `org-persist-read'.")
+
+(defvar org-persist--index nil
+  "Global index.
+
+The index is a list of plists.  Each plist contains information about
+a data variable.  Each plist contains the following properties:
+
+  - `:variable'list of variables to be stored in single file
+  - `:persist-file': data file name
+  - `:path':   buffer file path, if any
+  - `:inode':  buffer file inode, if any
+  - `:hash':   buffer hash, if any")
+
+(defun org-persist--get-index (var &optional buffer)
+  "Return plist used to store VAR in BUFFER.
+When BUFFER is nil, return plist for global VAR."
+  (let* ((buffer-file (when buffer (buffer-file-name (or (buffer-base-buffer 
buffer)
+ buffer
+ (inode (when buffer-file (file-attribute-inode-number 
(file-attributes buffer-file)
+(let ((result (seq-find (lambda (plist)
+  (and (or (memq var (plist-get plist :variable))
+   (eq var (plist-get plist :variable)))
+   (or (equal inode (plist-get plist :inode))
+   (equal buffer-file (plist-get plist 
:path)
+org-persist--index)))
+  (when result
+(unless (equal buffer-file (plist-get result :path))
+  (setf result (plist-put result :path buffer-file
+  (unless result
+(push (list :variable (if (listp var) var (list var))
+:persist-file (replace-regexp-in-string "^.." "\\&/" 
(org-id-uuid))
+:path buffer-file
+:inode inode
+:hash (when buffer (secure-hash 'md5 buffer)))
+  org-persist--index)
+(setf result (car org-persist--index)))
+  result)))
+
+(defun org-persist--read-index ()
+  "Read `org-persist--index'"
+  (unless org-persist--index
+(when (file-exists-p (org-file-name-concat org-persist-path 
org-persist-index-file))
+  (with-temp-buffer
+(insert-file-contents (org-file-name-concat org-persist-path 
org-persist-index-file))
+(setq org-persist--index (read (current-buffer)))
+
+(cl-defun org-pers

[elpa] externals/org 78abbcd 07/29: org.el/org-get-tags: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 78abbcd052624b6198ad8bb4f2f72d9257b502f7
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-get-tags: Support cache and passing element arg

* lisp/org.el (org-fast-tag-selection): Allowing passing an element or
position as first argument.  Add cache support.
---
 lisp/org.el | 56 ++--
 1 file changed, 38 insertions(+), 18 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index b9a062e..b76d83f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12481,9 +12481,12 @@ Assume point is at the beginning of the headline."
   ;; Parse tags manually.
   (and (looking-at org-tag-line-re)
(split-string (match-string-no-properties 2) ":" t)
+
+(defun org-get-tags (&optional pos-or-element local)
   "Get the list of tags specified in the current headline.
 
-When argument POS is non-nil, retrieve tags for headline at POS.
+When argument POS-OR-ELEMENT is non-nil, retrieve tags for headline at
+POS.
 
 According to `org-use-tag-inheritance', tags may be inherited
 from parent headlines, and from the whole document, through
@@ -12496,23 +12499,40 @@ However, when optional argument LOCAL is non-nil, 
only return
 tags specified at the headline.
 
 Inherited tags have the `inherited' text property."
-  (if (and org-trust-scanner-tags
-   (or (not pos) (eq pos (point)))
-   (not local))
-  org-scanner-tags
-(org-with-point-at (or pos (point))
-  (unless (org-before-first-heading-p)
-(org-back-to-heading t)
-(let ((ltags (org--get-local-tags)) itags)
-  (if (or local (not org-use-tag-inheritance)) ltags
-(while (org-up-heading-safe)
-  (setq itags (nconc (mapcar #'org-add-prop-inherited
-(org--get-local-tags))
-itags)))
-(setq itags (append org-file-tags itags))
-(nreverse
-(delete-dups
- (nreverse (nconc (org-remove-uninherited-tags itags) 
ltags))
+  (save-match-data
+(if (and org-trust-scanner-tags
+ (or (not pos-or-element) (eq pos-or-element (point)))
+ (not local))
+org-scanner-tags
+  (org-with-point-at (unless (org-element-type pos-or-element)
+   (or pos-or-element (point)))
+(unless (and (not (org-element-type pos-or-element))
+ (org-before-first-heading-p))
+  (unless (org-element-type pos-or-element) (org-back-to-heading t))
+  (let ((ltags (if (org-element-type pos-or-element)
+   (org-element-property :tags (org-element-lineage 
pos-or-element '(headline) t))
+ (org--get-local-tags)))
+itags)
+(if (or local (not org-use-tag-inheritance)) ltags
+  (let ((cached (and (org-element--cache-active-p)
+ (if (org-element-type pos-or-element)
+ (org-element-lineage pos-or-element 
'(headline) t)
+   (org-element-at-point nil 'cached)
+(if cached
+(while (setq cached (org-element-property :parent cached))
+  (setq itags (nconc (mapcar #'org-add-prop-inherited
+ ;; If we do not wrap result 
into `cl-copy-list', reference would
+ ;; be returned and cache 
element might be modified directly.
+ (cl-copy-list 
(org-element-property :tags cached)))
+ itags)))
+  (while (org-up-heading-safe)
+(setq itags (nconc (mapcar #'org-add-prop-inherited
+  (org--get-local-tags))
+  itags)
+  (setq itags (append org-file-tags itags))
+  (nreverse
+  (delete-dups
+   (nreverse (nconc (org-remove-uninherited-tags itags) 
ltags)))
 
 (defun org-get-buffer-tags ()
   "Get a table of all tags used in the buffer, for completion."



[elpa] externals/org 68a44ea 04/29: org.el/org-narrow-to-subtree: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 68a44eadac00d07e2b45b10da60e0e3cd6300d6f
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-narrow-to-subtree: Support cache and passing element arg
---
 lisp/org.el | 27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 23b6bd6..ba3ca1c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7899,17 +7899,26 @@ If yes, remember the marker and the distance to BEG."
 (move-marker (car x) (+ beg (cdr x
   (setq org-markers-to-move nil))
 
-(defun org-narrow-to-subtree ()
+(defun org-narrow-to-subtree (&optional element)
   "Narrow buffer to the current subtree."
   (interactive)
-  (save-excursion
-(save-match-data
-  (org-with-limited-levels
-   (narrow-to-region
-   (progn (org-back-to-heading t) (point))
-   (progn (org-end-of-subtree t t)
-  (when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
-  (point)))
+  (if (org-element--cache-active-p)
+  (if-let* ((heading (org-element-lineage
+  (or element (org-element-at-point))
+  '(headline) t))
+(end (org-element-property :end heading)))
+  (narrow-to-region (org-element-property :begin heading)
+(if (= end (point-max))
+end (1- end)))
+(signal 'outline-before-first-heading nil))
+(save-excursion
+  (save-match-data
+(org-with-limited-levels
+ (narrow-to-region
+ (progn (org-back-to-heading t) (point))
+ (progn (org-end-of-subtree t t)
+(when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
+(point
 
 (defun org-toggle-narrow-to-subtree ()
   "Narrow to the subtree at point or widen a narrowed buffer."



[elpa] externals/org 7b83168 08/29: org.el/org--property-local-values: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 7b83168295b948993e07a2663995eab361faf906
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org--property-local-values: Support cache and passing element arg
---
 lisp/org.el | 50 ++
 1 file changed, 30 insertions(+), 20 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index b76d83f..4ecb300 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13038,30 +13038,40 @@ strings."
  ;; Return value.
  props)
 
-(defun org--property-local-values (property literal-nil)
-  "Return value for PROPERTY in current entry.
+(defun org--property-local-values (property literal-nil &optional element)
+  "Return value for PROPERTY in current entry or ELEMENT.
 Value is a list whose car is the base value for PROPERTY and cdr
 a list of accumulated values.  Return nil if neither is found in
 the entry.  Also return nil when PROPERTY is set to \"nil\",
 unless LITERAL-NIL is non-nil."
-  (let ((range (org-get-property-block)))
-(when range
-  (goto-char (car range))
-  (let* ((case-fold-search t)
-(end (cdr range))
-(value
- ;; Base value.
- (save-excursion
-   (let ((v (and (re-search-forward
-  (org-re-property property nil t) end t)
- (match-string-no-properties 3
- (list (if literal-nil v (org-not-nil v)))
-   ;; Find additional values.
-   (let* ((property+ (org-re-property (concat property "+") nil t)))
- (while (re-search-forward property+ end t)
-   (push (match-string-no-properties 3) value)))
-   ;; Return final values.
-   (and (not (equal value '(nil))) (nreverse value))
+  (if-let ((element (or element
+(and (org-element--cache-active-p)
+ (org-element-at-point nil 'cached)
+  (let* ((element (org-element-lineage element '(headline org-data 
inlinetask) 'with-self))
+ (base-value (org-element-property (intern (concat ":" (upcase 
property))) element))
+ (base-value (if literal-nil base-value (org-not-nil base-value)))
+ (extra-value (org-element-property (intern (concat ":" (upcase 
property) "+")) element))
+ (extra-value (if (listp extra-value) extra-value (list 
extra-value)))
+ (value (cons base-value extra-value)))
+(and (not (equal value '(nil))) value))
+(let ((range (org-get-property-block)))
+  (when range
+(goto-char (car range))
+(let* ((case-fold-search t)
+  (end (cdr range))
+  (value
+   ;; Base value.
+   (save-excursion
+ (let ((v (and (re-search-forward
+(org-re-property property nil t) end t)
+   (match-string-no-properties 3
+   (list (if literal-nil v (org-not-nil v)))
+ ;; Find additional values.
+ (let* ((property+ (org-re-property (concat property "+") nil t)))
+   (while (re-search-forward property+ end t)
+ (push (match-string-no-properties 3) value)))
+ ;; Return final values.
+ (and (not (equal value '(nil))) (nreverse value)))
 
 (defun org--property-global-or-keyword-value (property literal-nil)
   "Return value for PROPERTY as defined by global properties or by keyword.



[elpa] externals/org 5bf5fdb 09/29: org.el/org-entry-get-with-inheritance: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 5bf5fdbc28c004164f6b0ec8d53f886a01bb28b7
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-entry-get-with-inheritance: Support cache and passing element arg

* lisp/org.el (org-entry-get-with-inheritance): Add cache support.
Add new optional argument---an element to get properties from.  Fix
getting top-level properties when a headline is located at BOB.
---
 lisp/org.el | 76 -
 1 file changed, 55 insertions(+), 21 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 4ecb300..dafdb31 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13209,7 +13209,7 @@ no match, the marker will point nowhere.
 Note that also `org-entry-get' calls this function, if the INHERIT flag
 is set.")
 
-(defun org-entry-get-with-inheritance (property &optional literal-nil)
+(defun org-entry-get-with-inheritance (property &optional literal-nil element)
   "Get PROPERTY of entry or content at point, search higher levels if needed.
 The search will stop at the first ancestor which has the property defined.
 If the value found is \"nil\", return nil to show that the property
@@ -13217,27 +13217,61 @@ should be considered as undefined (this is the 
meaning of nil here).
 However, if LITERAL-NIL is set, return the string value \"nil\" instead."
   (move-marker org-entry-property-inherited-from nil)
   (org-with-wide-buffer
-   (let (value)
+   (let (value at-bob-no-heading)
  (catch 'exit
-   (while t
-(let ((v (org--property-local-values property literal-nil)))
-  (when v
-(setq value
-  (concat (mapconcat #'identity (delq nil v) " ")
-  (and value " ")
-  value)))
-  (cond
-   ((car v)
-(org-back-to-heading-or-point-min t)
-(move-marker org-entry-property-inherited-from (point))
-(throw 'exit nil))
-   ((org-up-heading-or-point-min))
-   (t
-(let ((global (org--property-global-or-keyword-value property 
literal-nil)))
-  (cond ((not global))
-(value (setq value (concat global " " value)))
-(t (setq value global
-(throw 'exit nil))
+   (if-let ((element (or element
+ (and (org-element--cache-active-p)
+  (org-element-at-point nil 'cached)
+   (let ((element (org-element-lineage element '(headline org-data 
inlinetask) 'with-self)))
+ (while t
+   (let* ((v (org--property-local-values property literal-nil 
element))
+  (v (if (listp v) v (list v
+ (when v
+   (setq value
+ (concat (mapconcat #'identity (delq nil v) " ")
+ (and value " ")
+ value)))
+ (cond
+ ((car v)
+  (move-marker org-entry-property-inherited-from 
(org-element-property :begin element))
+  (throw 'exit nil))
+ ((org-element-property :parent element)
+   (setq element (org-element-property :parent element)))
+ (t
+  (let ((global (org--property-global-or-keyword-value 
property literal-nil)))
+(cond ((not global))
+  (value (setq value (concat global " " value)))
+  (t (setq value global
+  (throw 'exit nil))
+ (while t
+  (let ((v (org--property-local-values property literal-nil)))
+(when v
+  (setq value
+(concat (mapconcat #'identity (delq nil v) " ")
+(and value " ")
+value)))
+(cond
+ ((car v)
+  (org-back-to-heading-or-point-min t)
+  (move-marker org-entry-property-inherited-from (point))
+  (throw 'exit nil))
+ ((or (org-up-heading-safe)
+   (and (not (bobp))
+(goto-char (point-min))
+nil)
+   ;; `org-up-heading-safe' returned nil.  We are at low
+   ;; level heading or bob.  If there is headline
+   ;; there, do not try to fetch its properties.
+   (and (bobp)
+(not at-bob-no-heading)
+(not (org-at-heading-p))
+(setq at-bob-no-heading t
+ (t
+  (let ((global (org--property-global-or-keyword-value property 
literal-nil)))
+(cond ((not global))
+  (value (setq value (concat global " " value)))
+  (t (setq value global
+  (throw 'exit nil)))
  (if literal-

[elpa] externals/org d437817 11/29: org.el/org-goto-first-child: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit d43781707be1042ceeeda416216f6bec4da1890a
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-goto-first-child: Support cache and passing element arg
---
 lisp/org.el | 31 +++
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 38ce7ac..158e37d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20777,17 +20777,32 @@ move point."
 (while (org-goto-sibling 'previous)
   (org-flag-heading nil
 
-(defun org-goto-first-child ()
+(defun org-goto-first-child (&optional element)
   "Goto the first child, even if it is invisible.
 Return t when a child was found.  Otherwise don't move point and
 return nil."
-  (let (level (pos (point)) (re org-outline-regexp-bol))
-(when (org-back-to-heading-or-point-min t)
-  (setq level (org-outline-level))
-  (forward-char 1)
-  (if (and (re-search-forward re nil t) (> (org-outline-level) level))
- (progn (goto-char (match-beginning 0)) t)
-   (goto-char pos) nil
+  (if (org-element--cache-active-p)
+  (when-let ((heading (org-element-lineage
+   (or element (org-element-at-point))
+   '(headline inlinetask org-data)
+   t)))
+(unless (or (eq 'inlinetask (org-element-type heading))
+(not (org-element-property :contents-begin heading)))
+  (let ((pos (point)))
+(goto-char (org-element-property :contents-begin heading))
+(if (re-search-forward
+ org-outline-regexp-bol
+ (org-element-property :end heading)
+ t)
+(progn (goto-char (match-beginning 0)) t)
+  (goto-char pos) nil
+(let (level (pos (point)) (re org-outline-regexp-bol))
+  (when (org-back-to-heading-or-point-min t)
+(setq level (org-outline-level))
+(forward-char 1)
+(if (and (re-search-forward re nil t) (> (org-outline-level) level))
+   (progn (goto-char (match-beginning 0)) t)
+ (goto-char pos) nil)
 
 (defun org-show-hidden-entry ()
   "Show an entry where even the heading is hidden."



[elpa] externals/org 86345df 14/29: org.el/org-in-commented-heading-p: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 86345df9ab24982c8d7e6a0d518e1d7dc5ae509b
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-in-commented-heading-p: Support cache and passing element arg
---
 lisp/org.el | 36 
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ea43d66..c17c24d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20612,20 +20612,32 @@ instead of back to heading."
   "Non-nil when on a headline."
   (outline-on-heading-p t))
 
-(defun org-in-commented-heading-p (&optional no-inheritance)
+(defun org-in-commented-heading-p (&optional no-inheritance element)
   "Non-nil if point is under a commented heading.
 This function also checks ancestors of the current headline,
-unless optional argument NO-INHERITANCE is non-nil."
-  (cond
-   ((org-before-first-heading-p) nil)
-   ((let ((headline (nth 4 (org-heading-components
-  (and headline
-  (let ((case-fold-search nil))
-(string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)")
-headline)
-   (no-inheritance nil)
-   (t
-(save-excursion (and (org-up-heading-safe) 
(org-in-commented-heading-p))
+unless optional argument NO-INHERITANCE is non-nil.
+
+Optional argument ELEMENT contains element at point."
+  (save-match-data
+(if-let ((el (or element (org-element-at-point nil 'cached
+(catch :found
+  (setq el (org-element-lineage el '(headline) 'include-self))
+  (if no-inheritance
+  (org-element-property :commentedp el)
+(while el
+  (when (org-element-property :commentedp el)
+(throw :found t))
+  (setq el (org-element-property :parent el)
+  (cond
+   ((org-before-first-heading-p) nil)
+   ((let ((headline (nth 4 (org-heading-components
+  (and headline
+  (let ((case-fold-search nil))
+(string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)")
+headline)
+   (no-inheritance nil)
+   (t
+(save-excursion (and (org-up-heading-safe) 
(org-in-commented-heading-p
 
 (defun org-in-archived-heading-p (&optional no-inheritance)
   "Non-nil if point is under an archived heading.



[elpa] externals/org fede258 15/29: org.el/org-in-archived-heading-p: Support cache and passing element arg

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit fede2588e4c76c7ba9a1c8f00aeb5837ac695ebe
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org.el/org-in-archived-heading-p: Support cache and passing element arg
---
 lisp/org.el | 19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index c17c24d..a3cb070 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20639,18 +20639,25 @@ Optional argument ELEMENT contains element at point."
(t
 (save-excursion (and (org-up-heading-safe) 
(org-in-commented-heading-p
 
-(defun org-in-archived-heading-p (&optional no-inheritance)
+(defun org-in-archived-heading-p (&optional no-inheritance element)
   "Non-nil if point is under an archived heading.
 This function also checks ancestors of the current headline,
-unless optional argument NO-INHERITANCE is non-nil."
+unless optional argument NO-INHERITANCE is non-nil.
+
+Optional argument ELEMENT contains element at point."
   (cond
((org-before-first-heading-p) nil)
-   ((let ((tags (org-get-tags nil 'local)))
-  (and tags
-  (cl-some (apply-partially #'string= org-archive-tag) tags
+   ((if element
+(org-element-property :archivedp element)
+  (let ((tags (org-get-tags element 'local)))
+(and tags
+(cl-some (apply-partially #'string= org-archive-tag) tags)
(no-inheritance nil)
(t
-(save-excursion (and (org-up-heading-safe) (org-in-archived-heading-p))
+(if (org-element--cache-active-p)
+(cl-some (lambda (el) (org-element-property :archivedp el))
+ (org-element-lineage (org-element-at-point) nil t))
+  (save-excursion (and (org-up-heading-safe) 
(org-in-archived-heading-p)))
 
 (defun org-at-comment-p nil
   "Return t if cursor is in a commented line."



[elpa] externals/org 85e0a69 20/29: Avoid frequent cache updates in some functions

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit 85e0a69567655071dbdf1c58dcc4d09130cb4a31
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Avoid frequent cache updates in some functions

* lisp/org.el (org-promote-subtree, org-demote-subtree,
org-paste-subtree, org--align-node-property): Group buffer changes
together and call after-change-functions once to avoid performance
degradation during cache updates.
---
 lisp/org.el | 61 ++---
 1 file changed, 34 insertions(+), 27 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 6b2d6bf..5256fa4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7267,7 +7267,9 @@ When a subtree is being promoted, the hook will be called 
for each node.")
 See also `org-promote'."
   (interactive)
   (save-excursion
-(org-with-limited-levels (org-map-tree 'org-promote)))
+(org-back-to-heading t)
+(combine-change-calls (point) (save-excursion (org-end-of-subtree t))
+  (org-with-limited-levels (org-map-tree 'org-promote
   (org-fix-position-after-promote))
 
 (defun org-demote-subtree ()
@@ -7275,7 +7277,9 @@ See also `org-promote'."
 See `org-demote' and `org-promote'."
   (interactive)
   (save-excursion
-(org-with-limited-levels (org-map-tree 'org-demote)))
+(org-back-to-heading t)
+(combine-change-calls (point) (save-excursion (org-end-of-subtree t))
+  (org-with-limited-levels (org-map-tree 'org-demote
   (org-fix-position-after-promote))
 
 (defun org-do-promote ()
@@ -7809,26 +7813,29 @@ When REMOVE is non-nil, remove the subtree from the 
clipboard."
(org-next-visible-heading 1)
(unless (bolp) (insert "\n")))
  (setq beg (point))
- (when (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
- (insert-before-markers txt)
- (unless (string-suffix-p "\n" txt) (insert "\n"))
- (setq newend (point))
- (org-reinstall-markers-in-region beg)
- (setq end (point))
- (goto-char beg)
- (skip-chars-forward " \t\n\r")
- (setq beg (point))
- (when (and (org-invisible-p) visp)
-   (save-excursion (outline-show-heading)))
- ;; Shift if necessary.
- (unless (= shift 0)
-   (save-restriction
-(narrow-to-region beg end)
-(while (not (= shift 0))
-  (org-map-region func (point-min) (point-max))
-  (setq shift (+ delta shift)))
-(goto-char (point-min))
-(setq newend (point-max
+ ;; Avoid re-parsing cache elements when i.e. level 1 heading
+ ;; is inserted and then promoted.
+ (combine-change-calls beg beg
+   (when (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
+   (insert-before-markers txt)
+   (unless (string-suffix-p "\n" txt) (insert "\n"))
+   (setq newend (point))
+   (org-reinstall-markers-in-region beg)
+   (setq end (point))
+   (goto-char beg)
+   (skip-chars-forward " \t\n\r")
+   (setq beg (point))
+   (when (and (org-invisible-p) visp)
+ (save-excursion (outline-show-heading)))
+   ;; Shift if necessary.
+   (unless (= shift 0)
+ (save-restriction
+  (narrow-to-region beg end)
+  (while (not (= shift 0))
+(org-map-region func (point-min) (point-max))
+(setq shift (+ delta shift)))
+  (goto-char (point-min))
+  (setq newend (point-max)
  (when (or for-yank (called-interactively-p 'interactive))
(message "Clipboard pasted as level %d subtree" new-level))
  (when (and (not for-yank) ; in this case, org-yank will decide about 
folding
@@ -19212,11 +19219,11 @@ Alignment is done according to `org-property-format', 
which see."
   (when (save-excursion
  (beginning-of-line)
  (looking-at org-property-re))
-(replace-match
- (concat (match-string 4)
-(org-trim
- (format org-property-format (match-string 1) (match-string 3
- t t)))
+(combine-change-calls (match-beginning 0) (match-end 0)
+  (let ((newtext (concat (match-string 4)
+(org-trim
+ (format org-property-format (match-string 1) 
(match-string 3))
+(setf (buffer-substring (match-beginning 0) (match-end 0)) newtext)
 
 (defun org-indent-line ()
   "Indent line depending on context.



[elpa] externals/org abe7222 23/29: Add declares to suppress compiler warnings

2021-10-16 Thread ELPA Syncer
branch: externals/org
commit abe7222ed8af9b75a109e97ff9ee36d2f8ca466a
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Add declares to suppress compiler warnings
---
 lisp/ob-core.el|  5 +++--
 lisp/ob-ref.el |  2 +-
 lisp/ol-bibtex.el  |  2 +-
 lisp/org-compat.el |  3 ++-
 lisp/org-keys.el   |  2 +-
 lisp/org-list.el   |  2 +-
 lisp/org-macro.el  |  2 ++
 lisp/org-table.el  |  1 +
 lisp/org.el| 12 ++--
 9 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index cd4f7e9..7a9467b 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -53,7 +53,8 @@
 (declare-function org-cycle "org" (&optional arg))
 (declare-function org-edit-src-code "org-src" (&optional code 
edit-buffer-name))
 (declare-function org-edit-src-exit "org-src"  ())
-(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-at-point "org-element" (&optional pom 
cached-only))
+(declare-function org-element-at-point-no-context "org-element" (&optional 
pom))
 (declare-function org-element-context "org-element" (&optional element))
 (declare-function org-element-normalize-string "org-element" (s))
 (declare-function org-element-property "org-element" (property element))
@@ -70,7 +71,7 @@
 (declare-function org-list-to-lisp "org-list" (&optional delete))
 (declare-function org-macro-escape-arguments "org-macro" (&rest args))
 (declare-function org-mark-ring-push "org" (&optional pos buffer))
-(declare-function org-narrow-to-subtree "org" ())
+(declare-function org-narrow-to-subtree "org" (&optional element))
 (declare-function org-next-block "org" (arg &optional backward block-regexp))
 (declare-function org-open-at-point "org" (&optional in-emacs 
reference-buffer))
 (declare-function org-previous-block "org" (arg &optional block-regexp))
diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el
index a7ab299..7bf6a5d 100644
--- a/lisp/ob-ref.el
+++ b/lisp/ob-ref.el
@@ -62,8 +62,8 @@
 (declare-function org-id-find-id-file "org-id" (id))
 (declare-function org-id-find-id-in-file "org-id" (id file &optional markerp))
 (declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
-(declare-function org-narrow-to-subtree "org" ())
 (declare-function org-show-context "org" (&optional key))
+(declare-function org-narrow-to-subtree "org" (&optional element))
 
 (defvar org-babel-update-intermediate nil
   "Update the in-buffer results of code blocks executed to resolve 
references.")
diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el
index 476095d..4da2692 100644
--- a/lisp/ol-bibtex.el
+++ b/lisp/ol-bibtex.el
@@ -133,7 +133,7 @@
 (declare-function org-heading-components "org" ())
 (declare-function org-insert-heading "org" (&optional arg invisible-ok top))
 (declare-function org-map-entries "org" (func &optional match scope &rest 
skip))
-(declare-function org-narrow-to-subtree "org" ())
+(declare-function org-narrow-to-subtree "org" (&optional element))
 (declare-function org-set-property "org" (property value))
 (declare-function org-toggle-tag "org" (tag &optional onoff))
 
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index f77f779..df2efc5 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -40,7 +40,8 @@
 (declare-function org-align-tags "org" (&optional all))
 (declare-function org-at-heading-p "org" (&optional ignored))
 (declare-function org-at-table.el-p "org" ())
-(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-at-point "org-element" (&optional pom 
cached-only))
+(declare-function org-element-at-point-no-context "org-element" (&optional 
pom))
 (declare-function org-element-context "org-element" (&optional element))
 (declare-function org-element-lineage "org-element" (blob &optional types 
with-self))
 (declare-function org-element-type "org-element" (element))
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index a10db7e..1034565 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -128,7 +128,7 @@
 (declare-function org-metaup "org" (&optional _arg))
 (declare-function org-narrow-to-block "org" ())
 (declare-function org-narrow-to-element "org" ())
-(declare-function org-narrow-to-subtree "org" ())
+(declare-function org-narrow-to-subtree "org" (&optional element))
 (declare-function org-next-block "org" (arg &optional backward block-regexp))
 (declare-function org-next-link "org" (&optional search-backward))
 (declare-function org-next-visible-heading "org" (arg))
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 6d3ef7c..b08e72e 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -133,7 +133,7 @@
 (declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
 (declare-function org-level-increment "org" ())
 (declare-function org-mode "org" ())
-(declare-function org-narrow-to-subtree "org" ())
+(declare-function org-narrow-to-subtree "org" (&optional element))
 (declare-function org-outline-level "org" ())
 (declare-function org-previous-line-empty-p "org