[elpa] externals-release/org 89d13998bd 1/2: org-element-fixed-width-parser: Fix when :value is empty
branch: externals-release/org commit 89d13998bd6ad4144d383ede16ff71cfaae439b3 Author: Ihor Radchenko Commit: Ihor Radchenko org-element-fixed-width-parser: Fix when :value is empty * lisp/org-element.el (org-element-fixed-width-interpreter): Interpret fixed-width element with :value "" as ":\n", not as empty string. * testing/lisp/test-org-element.el (test-org-element/fixed-width-interpreter): Fixed the test. The previous test, albeit intentionally asserting "" result, breaks reversibility of parse-interpret sequence. --- lisp/org-element.el | 4 +++- testing/lisp/test-org-element.el | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index f787fb1f71..389acf8250 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -2382,7 +2382,9 @@ Assume point is at the beginning of the fixed-width area." (defun org-element-fixed-width-interpreter (fixed-width _) "Interpret FIXED-WIDTH element as Org syntax." (let ((value (org-element-property :value fixed-width))) -(and value (replace-regexp-in-string "^" ": " value +(and value + (if (string-empty-p value) ":\n" + (replace-regexp-in-string "^" ": " value) Horizontal Rule diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 2d67cc8711..43f1d860f0 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -3099,7 +3099,7 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01" (should (equal (org-element-fixed-width-interpreter '(fixed-width (:value "")) nil) - "")) + ":\n")) ;; Handle nil value. (should-not (org-element-fixed-width-interpreter
[nongnu] elpa/helm 1854882316 5/5: Update FUNDING.yml
branch: elpa/helm commit 1854882316d76fa0eeb7898249cd8872924ea7ee Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index cc0d9475dd..510a18dd28 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: thierryvolpiatto +patreon: thierry volpiatto
[nongnu] elpa/helm d4a27fb446 4/5: Update FUNDING.yml
branch: elpa/helm commit d4a27fb4464b3a54c57faf580ae7606c3fb0c1e3 Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index cdc829f8c5..cc0d9475dd 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: 86324343 +patreon: thierryvolpiatto
[nongnu] elpa/helm eb4b61b1bf 3/5: Update FUNDING.yml
branch: elpa/helm commit eb4b61b1bf949c70494f411232f03697b050437c Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 510a18dd28..cdc829f8c5 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: thierry volpiatto +patreon: 86324343
[nongnu] elpa/helm c2b64cd738 1/5: Create FUNDING.yml
branch: elpa/helm commit c2b64cd738e920ead01116e78d4b9947e6f3592c Author: Thierry Volpiatto Commit: GitHub Create FUNDING.yml Add a patreon link --- .github/FUNDING.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00..cc0d9475dd --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +patreon: thierryvolpiatto
[nongnu] elpa/helm 9f2bf727c5 2/5: Update FUNDING.yml
branch: elpa/helm commit 9f2bf727c59dc5f09e54ef31c743beb3faaea5bc Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index cc0d9475dd..510a18dd28 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: thierryvolpiatto +patreon: thierry volpiatto
[elpa] externals-release/org a52d0f0918 2/2: org-export-as: Fix subtree export when metadata ends right before heading
branch: externals-release/org commit a52d0f09181d8d21170717c3ad5e4a4b3908b22e Author: Ihor Radchenko Commit: Ihor Radchenko org-export-as: Fix subtree export when metadata ends right before heading * lisp/ox.el (org-export-as): Only include first newline after heading line when the metadata is non-empty. * testing/lisp/test-ox.el (test-org-export/export-scope): Add test. Reported-by: Kaushal Modi Link: https://orgmode.org/list/CAFyQvY1d=UEJ-6ZPG1X+st=fcfbantfgbvnhxyxh_xkclgg...@mail.gmail.com --- lisp/ox.el | 2 +- testing/lisp/test-ox.el | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ox.el b/lisp/ox.el index 12767267a7..a5f2249cad 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3040,7 +3040,7 @@ Return code as a string." ;; This way, we will be able to retrieve its export ;; options when calling ;; `org-export--get-subtree-options'. - (backward-char) + (when (bolp) (backward-char)) (narrow-to-region (point) (point-max ;; Initialize communication channel with original buffer ;; attributes, unavailable in its copy. diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index cdb549df4b..99f5c0f0f7 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -1113,6 +1113,16 @@ Text" (org-export-as (org-test-default-backend) 'subtree nil nil '(:with-planning t :with-properties t) + (should + (equal "" + (org-test-with-temp-text " +* H +:PROPERTIES: +:A: 1 +:END: +* H2" + (org-export-as (org-test-default-backend) + 'subtree ;; Visible. (should (equal "* H1\n"
[elpa] externals-release/org updated (630f86dfc4 -> a52d0f0918)
elpasync pushed a change to branch externals-release/org. from 630f86dfc4 Update version number for the 9.6.1 release new 89d13998bd org-element-fixed-width-parser: Fix when :value is empty new a52d0f0918 org-export-as: Fix subtree export when metadata ends right before heading Summary of changes: lisp/org-element.el | 4 +++- lisp/ox.el | 2 +- testing/lisp/test-org-element.el | 2 +- testing/lisp/test-ox.el | 10 ++ 4 files changed, 15 insertions(+), 3 deletions(-)
[elpa] externals/org updated (bcca8819c3 -> d0758eabfe)
elpasync pushed a change to branch externals/org. from bcca8819c3 test-ob-shell.el: Organize tests new 89d13998bd org-element-fixed-width-parser: Fix when :value is empty new a52d0f0918 org-export-as: Fix subtree export when metadata ends right before heading new d0758eabfe Merge branch 'bugfix' Summary of changes: lisp/org-element.el | 4 +++- lisp/ox.el | 2 +- testing/lisp/test-org-element.el | 2 +- testing/lisp/test-ox.el | 10 ++ 4 files changed, 15 insertions(+), 3 deletions(-)
[elpa] externals/org d0758eabfe: Merge branch 'bugfix'
branch: externals/org commit d0758eabfebc2fac3170eecded81672e6150a885 Merge: bcca8819c3 a52d0f0918 Author: Ihor Radchenko Commit: Ihor Radchenko Merge branch 'bugfix' --- lisp/org-element.el | 4 +++- lisp/ox.el | 2 +- testing/lisp/test-org-element.el | 2 +- testing/lisp/test-ox.el | 10 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 9d91c71fac..ccecec342f 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -2382,7 +2382,9 @@ Assume point is at the beginning of the fixed-width area." (defun org-element-fixed-width-interpreter (fixed-width _) "Interpret FIXED-WIDTH element as Org syntax." (let ((value (org-element-property :value fixed-width))) -(and value (replace-regexp-in-string "^" ": " value +(and value + (if (string-empty-p value) ":\n" + (replace-regexp-in-string "^" ": " value) Horizontal Rule diff --git a/lisp/ox.el b/lisp/ox.el index 495d273957..86dce8f7cf 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3040,7 +3040,7 @@ Return code as a string." ;; This way, we will be able to retrieve its export ;; options when calling ;; `org-export--get-subtree-options'. - (backward-char) + (when (bolp) (backward-char)) (narrow-to-region (point) (point-max ;; Initialize communication channel with original buffer ;; attributes, unavailable in its copy. diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 2d67cc8711..43f1d860f0 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -3099,7 +3099,7 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01" (should (equal (org-element-fixed-width-interpreter '(fixed-width (:value "")) nil) - "")) + ":\n")) ;; Handle nil value. (should-not (org-element-fixed-width-interpreter diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index cdb549df4b..99f5c0f0f7 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -1113,6 +1113,16 @@ Text" (org-export-as (org-test-default-backend) 'subtree nil nil '(:with-planning t :with-properties t) + (should + (equal "" + (org-test-with-temp-text " +* H +:PROPERTIES: +:A: 1 +:END: +* H2" + (org-export-as (org-test-default-backend) + 'subtree ;; Visible. (should (equal "* H1\n"
[nongnu] elpa/helm updated (b978aee0f0 -> 1854882316)
elpasync pushed a change to branch elpa/helm. from b978aee0f0 Merge pull request #2583 from mosquito-magnet/fix-docstring-error-on-meta-key new c2b64cd738 Create FUNDING.yml new 9f2bf727c5 Update FUNDING.yml new eb4b61b1bf Update FUNDING.yml new d4a27fb446 Update FUNDING.yml new 1854882316 Update FUNDING.yml Summary of changes: .github/FUNDING.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/FUNDING.yml
[nongnu] elpa/helm-core updated (b978aee0f0 -> 1854882316)
elpasync pushed a change to branch elpa/helm-core. from b978aee0f0 Merge pull request #2583 from mosquito-magnet/fix-docstring-error-on-meta-key adds c2b64cd738 Create FUNDING.yml adds 9f2bf727c5 Update FUNDING.yml adds eb4b61b1bf Update FUNDING.yml adds d4a27fb446 Update FUNDING.yml adds 1854882316 Update FUNDING.yml No new revisions were added by this update. Summary of changes: .github/FUNDING.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/FUNDING.yml
[elpa] externals/org 0d5951a9b0 1/2: org-refile: Fix edge case when we refile on top of the same subtree
branch: externals/org commit 0d5951a9b02d9ce71af154612d0fa3a3381856ec Author: Ihor Radchenko Commit: Ihor Radchenko org-refile: Fix edge case when we refile on top of the same subtree * lisp/org-refile.el (org-refile): Use dedicated marker (move after insertion) to store position of the heading being refiled. Otherwise, if refiled heading is inserted at the same point, `save-excursion' would restore point before the inserted heading instead of keeping it at the original heading. * testing/lisp/test-org.el (test-org/refile): At test. Reported-by: /u/madclassix --- lisp/org-refile.el | 107 +-- testing/lisp/test-org.el | 11 + 2 files changed, 69 insertions(+), 49 deletions(-) diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 5a41c022fe..03c351cf6b 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -541,58 +541,67 @@ prefix argument (`C-u C-u C-u C-c C-w')." (org-kill-new (buffer-substring region-start region-end)) (org-save-markers-in-region region-start region-end)) (org-copy-subtree 1 nil t)) - (with-current-buffer (setq nbuf (or (find-buffer-visiting file) - (find-file-noselect file))) - (setq reversed (org-notes-order-reversed-p)) - (org-with-wide-buffer - (if pos - (progn -(goto-char pos) -(setq level (org-get-valid-level (funcall outline-level) 1)) -(goto-char - (if reversed - (or (outline-next-heading) (point-max)) - (or (save-excursion (org-get-next-sibling)) - (org-end-of-subtree t t) - (point-max) -(setq level 1) -(if (not reversed) -(goto-char (point-max)) - (goto-char (point-min)) - (or (outline-next-heading) (goto-char (point-max) - (unless (bolp) (newline)) - (org-paste-subtree level nil nil t) - ;; Record information, according to `org-log-refile'. - ;; Do not prompt for a note when refiling multiple - ;; headlines, however. Simply add a time stamp. - (cond - ((not org-log-refile)) - (regionp -(org-map-region - (lambda () (org-add-log-setup 'refile nil nil 'time)) - (point) - (+ (point) (- region-end region-start - (t -(org-add-log-setup 'refile nil nil org-log-refile))) - (and org-auto-align-tags - (let ((org-loop-over-headlines-in-active-region nil)) - (org-align-tags))) - (let ((bookmark-name (plist-get org-bookmark-names-plist - :last-refile))) -(when bookmark-name - (with-demoted-errors "Bookmark set error: %S" -(bookmark-set bookmark-name - ;; If we are refiling for capture, make sure that the - ;; last-capture pointers point here - (when (bound-and-true-p org-capture-is-refiling) -(let ((bookmark-name (plist-get org-bookmark-names-plist -:last-capture-marker))) +(let ((origin (point-marker))) + ;; Handle special case when we refile to exactly same + ;; location with tree promotion/demotion. Point marker + ;; saved by `org-width-wide-buffer' (`save-excursion') + ;; will then remain before the inserted subtree in + ;; unexpected location. + (set-marker-insertion-type origin t) + (with-current-buffer (setq nbuf (or (find-buffer-visiting file) + (find-file-noselect file))) + (setq reversed (org-notes-order-reversed-p)) + (org-with-wide-buffer +(if pos +(progn + (goto-char pos) + (setq level (org-get-valid-level (funcall outline-level) 1)) + (goto-char + (if reversed + (or (outline-next-heading) (point-max)) + (or (save-excursion (org-get-next-sibling)) + (org-end-of-subtree t t) + (point-max) + (setq level 1) + (if (not reversed) + (goto-char (point-max)) +(goto-char (point-min)) +(or (outline-next-heading) (goto-char (point-max) +(unless (bolp) (newline)) +
[nongnu] elpa/helm-core updated (1854882316 -> 22ba14bf36)
elpasync pushed a change to branch elpa/helm-core. from 1854882316 Update FUNDING.yml adds 74d6809393 Update FUNDING.yml adds 39f3b7f84f Update FUNDING.yml adds 22ba14bf36 Update FUNDING.yml No new revisions were added by this update. Summary of changes:
[nongnu] elpa/evil updated (f003ca28a9 -> 30e819dcf4)
elpasync pushed a change to branch elpa/evil. from f003ca28a9 Fix Fundamental mode hack new c306300b47 Fix evil-set-leader with nil state argument new 9daad9cca5 Use extended-format menu item for leader bindings new 30e819dcf4 Fix executing macro infinite times Summary of changes: evil-commands.el | 27 --- evil-core.el | 24 +--- evil-ex.el | 4 ++-- evil-tests.el| 9 + 4 files changed, 28 insertions(+), 36 deletions(-)
[nongnu] elpa/evil c306300b47 1/3: Fix evil-set-leader with nil state argument
branch: elpa/evil commit c306300b47165f151d3e0ed12a99b98a65f4 Author: Axel Forsman Commit: Axel Forsman Fix evil-set-leader with nil state argument The predicate (listp state) is true also for the value nil of state, meaning the correct clause with all-states was never considered. Closes #1383 --- evil-core.el | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/evil-core.el b/evil-core.el index d773b2e5d8..b43c1545d1 100644 --- a/evil-core.el +++ b/evil-core.el @@ -948,12 +948,10 @@ KEY should be in the form produced by `kbd'. STATE is one of all of the above. If LOCALLEADER is non-nil, set the local leader instead." (let* ((all-states '(normal insert visual replace operator motion emacs)) - (states (cond ((listp state) state) - ((member state all-states) (list state)) - ((null state) all-states) - ;; Maybe throw error here + (states (cond ((null state) all-states) + ((consp state) state) (t (list state - (binding (if localleader 'evil-send-localleader 'evil-send-leader))) + (binding (if localleader #'evil-send-localleader #'evil-send-leader))) (dolist (state states) (evil-global-set-key state key binding
[nongnu] elpa/evil 9daad9cca5 2/3: Use extended-format menu item for leader bindings
branch: elpa/evil commit 9daad9cca5e44887c5408b3cbbeb437b8fb80fa8 Author: Axel Forsman Commit: Axel Forsman Use extended-format menu item for leader bindings This fixes the issue of the evil-send-(local-)leader commands being recognized as the motion while in Operator-pending state. Additionally, describe-key (C-h k) can now be used to lookup keybindings using leader. Note that simply binding [(local-)leader] keyboard macros would not work, since then the command would not receive the prefix argument. Closes #1711 --- evil-core.el | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/evil-core.el b/evil-core.el index b43c1545d1..2205ea525c 100644 --- a/evil-core.el +++ b/evil-core.el @@ -926,20 +926,6 @@ A return value of t means all states." (t state -(defun evil-send-leader () - "Put symbol leader in `unread-command-events' to trigger any - bindings." - (interactive) - (setq prefix-arg current-prefix-arg) - (push '(t . leader) unread-command-events)) - -(defun evil-send-localleader () - "Put symbol localleader in `unread-command-events' to trigger any - bindings." - (interactive) - (setq prefix-arg current-prefix-arg) - (push '(t . localleader) unread-command-events)) - (defun evil-set-leader (state key &optional localleader) "Set KEY to trigger leader bindings in STATE. KEY should be in the form produced by `kbd'. STATE is one of @@ -951,7 +937,9 @@ instead." (states (cond ((null state) all-states) ((consp state) state) (t (list state - (binding (if localleader #'evil-send-localleader #'evil-send-leader))) + (leaderkey (if localleader [localleader] [leader])) + (binding + `(menu-item "" nil :filter ,(lambda (_cmd) (key-binding leaderkey) (dolist (state states) (evil-global-set-key state key binding
[nongnu] elpa/helm 74d6809393 1/3: Update FUNDING.yml
branch: elpa/helm commit 74d6809393cda803f46b7a1ecd8ff7da4dd44b61 Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 510a18dd28..07be3dafa5 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: thierry volpiatto +patreon: "thierry volpiatto"
[nongnu] elpa/textile-mode updated (a49d9bf421 -> 8f8c09ef09)
elpasync pushed a change to branch elpa/textile-mode. from a49d9bf421 Merge pull request #4 from phikal/patch-1 new 985d327ab0 Do not override inline-code face new c0d9de4ef2 Fix inline-code regexp new 8f8c09ef09 Merge pull request #5 from Hi-Angel/fix-inline-code-highlight Summary of changes: textile-mode.el | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-)
[elpa] externals/org ecb62e2e31 2/2: org-babel-shell-initialize: Refactor
branch: externals/org commit ecb62e2e317b1a4b5b8a6c0f111ed7ef18413040 Author: Stefan Monnier Commit: Ihor Radchenko org-babel-shell-initialize: Refactor * lisp/ob-shell.el (org-babel-shell-initialize): Refactor avoiding `eval' runtime calls and assigning 'definition-name function symbol property to assist Emacs help system with finding the definition. Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60568#71 > One of the discussed features was displaying function source code right > in *Help* buffers. This feature usefulness have been objected at that > time, on the grounds that showing function code may be too long and > cause large *Help* buffers. FWIW, I find myself regularly jumping to `M-x ielm` to look at the `symbol-function`, so I would actually appreciate a button in the *Help* buffer to display the actual value in the `symbol-function` slot. This would also bring `describe-function` a bit closer to `describe-variable`, which I think is good. > 1. emacs -Q > 2. M-: (require 'ob-shell) > 3. f org-babel-execute:sh > 4. Click on the source code link in *Help* buffer > 5. Observe point jumping to (point-min) with no obvious way to find the >function definition. We have `definition-name` for that. I.e. `org-babel-shell-initialize` should arguably do (put 'org-babel-execute:sh 'definition-name 'org-babel-shell-initialize) so that step 4 above jumps to `org-babel-shell-initialize`. The patch below does that, along with saving some kittens. Stefan --- lisp/ob-shell.el | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el index 7b2d5192c7..9e7b45a891 100644 --- a/lisp/ob-shell.el +++ b/lisp/ob-shell.el @@ -75,20 +75,25 @@ This function has to be called whenever `org-babel-shell-names' is modified outside the Customize interface." (interactive) (dolist (name org-babel-shell-names) -(eval `(defun ,(intern (concat "org-babel-execute:" name)) - (body params) -,(format "Execute a block of %s commands with Babel." name) -(let ((shell-file-name ,name) - (org-babel-prompt-command -(or (cdr (assoc ,name org-babel-shell-set-prompt-commands)) -(alist-get t org-babel-shell-set-prompt-commands - (org-babel-execute:shell body params -(eval `(defalias ',(intern (concat "org-babel-variable-assignments:" name)) -'org-babel-variable-assignments:shell -,(format "Return list of %s statements assigning to the block's \ +(let ((fname (intern (concat "org-babel-execute:" name + (defalias fname +(lambda (body params) + (:documentation + (format "Execute a block of %s commands with Babel." name)) + (let ((shell-file-name name) +(org-babel-prompt-command + (or (cdr (assoc name org-babel-shell-set-prompt-commands)) + (alist-get t org-babel-shell-set-prompt-commands + (org-babel-execute:shell body params + (put fname 'definition-name 'org-babel-shell-initialize)) +(defalias (intern (concat "org-babel-variable-assignments:" name)) + #'org-babel-variable-assignments:shell + (format "Return list of %s statements assigning to the block's \ variables." - name))) -(eval `(defvar ,(intern (concat "org-babel-default-header-args:" name)) '() + name)) +(funcall (if (fboundp 'defvar-1) #'defvar-1 #'set) ;Emacs-29 + (intern (concat "org-babel-default-header-args:" name)) + nil))) (defcustom org-babel-shell-names '("sh" "bash" "zsh" "fish" "csh" "ash" "dash" "ksh" "mksh" "posh")
[nongnu] elpa/helm 39f3b7f84f 2/3: Update FUNDING.yml
branch: elpa/helm commit 39f3b7f84f611439fce6e60e3700f527fc48f58e Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 07be3dafa5..cdc829f8c5 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: "thierry volpiatto" +patreon: 86324343
[nongnu] elpa/helm 22ba14bf36 3/3: Update FUNDING.yml
branch: elpa/helm commit 22ba14bf3640f97631ced2f105f1744e54d3c3c9 Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index cdc829f8c5..510a18dd28 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: 86324343 +patreon: thierry volpiatto
[nongnu] elpa/textile-mode 8f8c09ef09 3/3: Merge pull request #5 from Hi-Angel/fix-inline-code-highlight
branch: elpa/textile-mode commit 8f8c09ef097a95a713307fdb5c92b9778dfbc1fc Merge: a49d9bf421 c0d9de4ef2 Author: Julien Barnier Commit: GitHub Merge pull request #5 from Hi-Angel/fix-inline-code-highlight Fix inline code highlight --- textile-mode.el | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/textile-mode.el b/textile-mode.el index 23271753e5..cb21d120c3 100644 --- a/textile-mode.el +++ b/textile-mode.el @@ -24,7 +24,7 @@ ;;; Commentary: -;; An emacs major mode for Textile markup language +;; An emacs major mode for Textile markup language ;; (https://textile-lang.com/) editing. ;;; Known bugs or limitations: @@ -103,6 +103,15 @@ non-matching parentheses" markup "\\)\\W")) +(defun textile-inline-code-matcher (markup) + "Return the matcher regexp for an inline code" + (concat + "\\W\\(" + markup + ".+?" + markup + "\\)\\W")) + (defun textile-list-bullet-matcher (bullet) "Return the matcher regexp for a list bullet" (concat @@ -185,7 +194,7 @@ non-matching parentheses" ;; citation `(,(textile-inline-markup-matcher "\\?\\?") 1 'textile-citation-face prepend t) ;; code - `(,(textile-inline-markup-matcher "@") 1 'textile-inline-code-face prepend t) + `(,(textile-inline-code-matcher "@") 1 'textile-inline-code-face t t) ;; deletion `(,(textile-inline-markup-matcher "-") 1 'textile-deleted-face prepend t) ;; insertion
[nongnu] elpa/textile-mode c0d9de4ef2 2/3: Fix inline-code regexp
branch: elpa/textile-mode commit c0d9de4ef260163895c0ee548896055397be4538 Author: Konstantin Kharlamov Commit: Konstantin Kharlamov Fix inline-code regexp Before this a sentence @-@ would not be considered a code. Not it is. --- textile-mode.el | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/textile-mode.el b/textile-mode.el index 6e6e097c02..cb21d120c3 100644 --- a/textile-mode.el +++ b/textile-mode.el @@ -103,6 +103,15 @@ non-matching parentheses" markup "\\)\\W")) +(defun textile-inline-code-matcher (markup) + "Return the matcher regexp for an inline code" + (concat + "\\W\\(" + markup + ".+?" + markup + "\\)\\W")) + (defun textile-list-bullet-matcher (bullet) "Return the matcher regexp for a list bullet" (concat @@ -185,7 +194,7 @@ non-matching parentheses" ;; citation `(,(textile-inline-markup-matcher "\\?\\?") 1 'textile-citation-face prepend t) ;; code - `(,(textile-inline-markup-matcher "@") 1 'textile-inline-code-face t t) + `(,(textile-inline-code-matcher "@") 1 'textile-inline-code-face t t) ;; deletion `(,(textile-inline-markup-matcher "-") 1 'textile-deleted-face prepend t) ;; insertion
[nongnu] elpa/evil 30e819dcf4 3/3: Fix executing macro infinite times
branch: elpa/evil commit 30e819dcf47294a758a47a362d2f61fc19aefcf0 Author: Axel Forsman Commit: Axel Forsman Fix executing macro infinite times This commit fixes a regression caused by #1549 where you could no longer give a prefix argument to execute the macro in an infinite loop. --- evil-commands.el | 27 --- evil-ex.el | 4 ++-- evil-tests.el| 9 + 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/evil-commands.el b/evil-commands.el index 3f9b5ab417..5816d8a721 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -2390,7 +2390,7 @@ will be opened instead." (evil-set-register evil-this-macro nil) (kmacro-start-macro nil) (setq evil-macro-buffer (current-buffer))) - (t (error "Invalid register") + (t (error "Invalid register `%s'" register) (evil-define-command evil-execute-macro (count macro) "Execute keyboard macro MACRO, COUNT times. @@ -2402,15 +2402,14 @@ when called interactively." :suppress-operator t (interactive (let (count macro register) - (setq count (if current-prefix-arg - (if (numberp current-prefix-arg) - current-prefix-arg - 0) 1) + (setq count (cond ((null current-prefix-arg) 1) + ((numberp current-prefix-arg) current-prefix-arg) + (t 0)) register (or evil-this-register (read-char))) (cond - ((or (and (eq register ?@) (eq evil-last-register ?:)) - (eq register ?:)) - (setq macro (lambda () (evil-ex-repeat nil)) + ((or (eq register ?:) + (and (eq register ?@) (eq evil-last-register ?:))) + (setq macro #'evil-ex-repeat evil-last-register ?:)) ((eq register ?@) (unless evil-last-register @@ -2423,24 +2422,22 @@ when called interactively." (cond ((functionp macro) (evil-repeat-abort) -(dotimes (_ (or count 1)) - (funcall macro))) +(if (zerop count) +(while t (funcall macro)) + (dotimes (_ (or count 1)) (funcall macro ((or (and (not (stringp macro)) (not (vectorp macro))) (member macro '("" []))) ;; allow references to currently empty registers ;; when defining macro -(unless evil-this-macro - (user-error "No previous macro"))) +(unless evil-this-macro (user-error "No previous macro"))) (t (condition-case err (evil-with-single-undo - (dotimes (_ (or count 1)) -(execute-kbd-macro macro))) + (execute-kbd-macro macro count)) ;; enter Normal state if the macro fails (error (evil-normal-state) - (evil-normalize-keymaps) (signal (car err) (cdr err))) (evil-define-command evil-execute-last-recorded-macro (count) diff --git a/evil-ex.el b/evil-ex.el index 496348f387..4f75d3fc60 100644 --- a/evil-ex.el +++ b/evil-ex.el @@ -675,8 +675,8 @@ This function interprets special file names like # and %." (unless (zerop (length evil-ex-argument)) (evil-ex-replace-special-filenames evil-ex-argument))) -(defun evil-ex-repeat (count) - "Repeat the last ex command." +(defun evil-ex-repeat (&optional count) + "Repeat the last Ex command." (interactive "P") (when count (goto-char (point-min)) diff --git a/evil-tests.el b/evil-tests.el index 51eb5ab4a3..4e8aaf4dd8 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -9589,6 +9589,15 @@ parameter set." ("ci|testing" [escape]) "| foo |testing| bar |"))) +(ert-deftest evil-test-kbd-macro () + "Test recording and replaying of macros." + :tags '(evil kbd-macro) + (ert-info ("Execute macro an infinite number of times") +(evil-test-buffer "xxx" + (evil-set-register ?q "ryl") + (error 'end-of-line "\C-u@q") + "yyy"))) + (ert-deftest evil-test-undo-kbd-macro () "Test if evil can undo the changes made by a keyboard macro when an error stops the execution of the macro"
[nongnu] elpa/textile-mode 985d327ab0 1/3: Do not override inline-code face
branch: elpa/textile-mode commit 985d327ab02feff4f24fa627ead1e840571a0ede Author: Konstantin Kharlamov Commit: Konstantin Kharlamov Do not override inline-code face Given this text: foo @_x() test@ bar before this commit the `_x()` would get highlighted as an acronym, even though it's inside an inline-code markup. After this commit the whole thing will be just "inline-code" instead. --- textile-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/textile-mode.el b/textile-mode.el index 23271753e5..6e6e097c02 100644 --- a/textile-mode.el +++ b/textile-mode.el @@ -24,7 +24,7 @@ ;;; Commentary: -;; An emacs major mode for Textile markup language +;; An emacs major mode for Textile markup language ;; (https://textile-lang.com/) editing. ;;; Known bugs or limitations: @@ -185,7 +185,7 @@ non-matching parentheses" ;; citation `(,(textile-inline-markup-matcher "\\?\\?") 1 'textile-citation-face prepend t) ;; code - `(,(textile-inline-markup-matcher "@") 1 'textile-inline-code-face prepend t) + `(,(textile-inline-markup-matcher "@") 1 'textile-inline-code-face t t) ;; deletion `(,(textile-inline-markup-matcher "-") 1 'textile-deleted-face prepend t) ;; insertion
[elpa] externals/org updated (d0758eabfe -> ecb62e2e31)
elpasync pushed a change to branch externals/org. from d0758eabfe Merge branch 'bugfix' new 0d5951a9b0 org-refile: Fix edge case when we refile on top of the same subtree new ecb62e2e31 org-babel-shell-initialize: Refactor Summary of changes: lisp/ob-shell.el | 31 -- lisp/org-refile.el | 107 +-- testing/lisp/test-org.el | 11 + 3 files changed, 87 insertions(+), 62 deletions(-)
[nongnu] elpa/helm updated (1854882316 -> 22ba14bf36)
elpasync pushed a change to branch elpa/helm. from 1854882316 Update FUNDING.yml new 74d6809393 Update FUNDING.yml new 39f3b7f84f Update FUNDING.yml new 22ba14bf36 Update FUNDING.yml Summary of changes:
[nongnu] elpa/helm 7b164dc2aa: Update FUNDING.yml
branch: elpa/helm commit 7b164dc2aab38600c5a9b8d5cf51f2de4fd668dc Author: Thierry Volpiatto Commit: GitHub Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 510a18dd28..cc0d9475dd 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -patreon: thierry volpiatto +patreon: thierryvolpiatto
[nongnu] elpa/helm-core updated (22ba14bf36 -> 7b164dc2aa)
elpasync pushed a change to branch elpa/helm-core. from 22ba14bf36 Update FUNDING.yml adds 7b164dc2aa Update FUNDING.yml No new revisions were added by this update. Summary of changes: .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[nongnu] elpa/sweeprolog 686db6f891 1/2: Support completion when reading a goal from the minibuffer
branch: elpa/sweeprolog commit 686db6f891115e67a00f4776c18875751764876c Author: Eshel Yaron Commit: Eshel Yaron Support completion when reading a goal from the minibuffer * sweeprolog.el (sweeprolog-read-goal-map): new keymap, derived from sweeprolog-read-term-map. (sweeprolog-goals-at-point): new function, similar to sweeprolog-terms-at-point but only returns goal terms. (sweeprolog-read-goal): use them. --- sweeprolog.el | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/sweeprolog.el b/sweeprolog.el index d60a3d09e9..44c060246c 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -4732,6 +4732,13 @@ moving point." map) "Keymap used by `sweeprolog-read-term'.") +(defvar sweeprolog-read-goal-map + (let ((map (make-sparse-keymap))) +(set-keymap-parent map sweeprolog-read-term-map) +(define-key map (kbd "C-i") #'completion-at-point) +map) + "Keymap used by `sweeprolog-goal-term'.") + (defun sweeprolog-terms-at-point (&optional point) "Return boundarines of Prolog terms at POINT, innermost first." (setq point (or point (point))) @@ -4754,6 +4761,23 @@ moving point." start (- point start +(defun sweeprolog-goals-at-point (&optional point) + (when (derived-mode-p 'sweeprolog-mode 'sweeprolog-top-level-mode) +(setq point (or point (point))) +(save-excursion + (goto-char point) + (mapcar (lambda (beg-end) +(buffer-substring-no-properties (car beg-end) +(cdr beg-end))) + (let ((goals-at-point nil)) +(sweeprolog-analyze-term-at-point + (lambda (beg end arg) + (when (<= beg point end) + (pcase arg + (`("goal_term" ,_ ,_ ,_) +(push (cons beg end) goals-at-point)) +goals-at-point) + (defvar sweeprolog-read-term-history nil "History list for `sweeprolog-read-term'.") @@ -4772,9 +4796,16 @@ moving point." (defun sweeprolog-read-goal (&optional prompt) "Read a Prolog goal prompting with PROMPT (default \"?- \")." (setq prompt (or prompt "?- ")) - (read-from-minibuffer prompt nil -sweeprolog-read-term-map nil -'sweeprolog-read-goal-history)) + (minibuffer-with-setup-hook + (lambda () +(set-syntax-table sweeprolog-mode-syntax-table) +(dolist (capf sweeprolog-completion-at-point-functions) + (add-hook 'completion-at-point-functions capf nil t))) +(read-from-minibuffer prompt nil + sweeprolog-read-goal-map nil + 'sweeprolog-read-goal-history + (when (derived-mode-p 'sweeprolog-mode) +(sweeprolog-goals-at-point) (defun sweeprolog-term-search-next (point overlays backward) "Return first overlay in OVERLAYS starting after POINT.
[nongnu] elpa/sweeprolog eb2608bc64 2/2: ADDED: command for sending a goal to top-level from any buffer
branch: elpa/sweeprolog commit eb2608bc6459e6f25159e98c0f80ec4e142820e5 Author: Eshel Yaron Commit: Eshel Yaron ADDED: command for sending a goal to top-level from any buffer * sweeprolog.el (sweeprolog-top-level): extract buffer setup logic to... (sweeprolog-top-level-buffer): new function. (sweeprolog-top-level-send-string): new function, used by... (sweeprolog-top-level-send-goal): new command, reads a goal from the minibuffer and sends it to a Prolog top-level buffer. (sweeprolog-mode-map): bind it to C-c C-q. (sweeprolog-menu): add "Send Goal to Top-level" entry. * README.org ("Sending Goals to the Top-level"): new manual section. --- README.org| 20 + sweeprolog.el | 92 --- 2 files changed, 83 insertions(+), 29 deletions(-) diff --git a/README.org b/README.org index e94587a3aa..4da79be640 100644 --- a/README.org +++ b/README.org @@ -1599,6 +1599,26 @@ buffers, you can arrange for it to be enabled as part of the #+end_src +** Sending Goals to the Top-level +:PROPERTIES: +:CUSTOM_ID: top-level-send-goal +:DESCRIPTION: Commands for sending goals to the be executed in the Top-level +:ALT_TITLE: Send to Top-level +:END: + +#+FINDEX: sweeprolog-top-level-send-goal +You can send a goal to execute in a Prolog top-level from any buffer +with the command ~M-x sweeprolog-top-level-send-goal~. This command +prompts for a Prolog goal in the minibuffer, executes it in a +top-level buffer and displays that buffer if it's not already visible. +While inserting the goal in the minibuffer, you can use ~TAB~ (or ~C-i~) +to get completion suggestions. + +In ~sweeprolog-mode~ buffers, you can invoke +~sweeprolog-top-level-send-goal~ by typing ~C-c C-q~. It also uses the +goal at point (if any) as the "future history" for the goal prompt, +which you can access with ~M-n~ in the minibuffer. + * Finding Prolog code :PROPERTIES: :CUSTOM_ID: finding-prolog-code diff --git a/sweeprolog.el b/sweeprolog.el index 44c060246c..14c8567bc2 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -391,6 +391,7 @@ determinism specification, and the third is a summary line." (define-key map (kbd "C-c C-m") #'sweeprolog-insert-term-with-holes) (define-key map (kbd "C-c C-o") #'sweeprolog-find-file-at-point) (define-key map (kbd "C-c C-s") #'sweeprolog-term-search) +(define-key map (kbd "C-c C-q") #'sweeprolog-top-level-send-goal) (define-key map (kbd "C-c C-t") #'sweeprolog-top-level) (define-key map (kbd "C-c C-u") #'sweeprolog-update-dependencies) (define-key map (kbd "C-c C-`") @@ -502,6 +503,7 @@ determinism specification, and the third is a summary line." (and (derived-mode-p 'sweeprolog-top-level-mode) sweeprolog-top-level-thread-id))) (buffer-list)) ] +[ "Send Goal to Top-level" sweeprolog-top-level-send-goal t ] [ "Open Top-level Menu" sweeprolog-list-top-levels t ] "--" [ "Describe Predicate" sweeprolog-describe-predicate t ] @@ -2443,41 +2445,73 @@ Interactively, PROJ is the prefix argument." (sweeprolog--query-once "sweep" "sweep_colourise_query" (cons query (marker-position beg))) -;;;###autoload -(defun sweeprolog-top-level (&optional buffer) - "Run a Prolog top-level in BUFFER. -If BUFFER is nil, a buffer called \"*sweeprolog-top-level*\" is used -by default. - -Interactively, a prefix arg means to prompt for BUFFER." - (interactive - (let* ((buffer - (and current-prefix-arg -(read-buffer "Top-level buffer: " - (if (and (eq major-mode 'sweeprolog-top-level-mode) - (null (get-buffer-process - (current-buffer - (buffer-name) - (generate-new-buffer-name "*sweeprolog-top-level*")) - (list buffer))) - (let ((buf (get-buffer-create (or buffer "*sweeprolog-top-level*" -(with-current-buffer buf - (unless (eq major-mode 'sweeprolog-top-level-mode) -(sweeprolog-top-level-mode))) -(unless sweeprolog-prolog-server-port - (sweeprolog-start-prolog-server)) -(unless (sweeprolog--query-once "sweep" "sweep_accept_top_level_client" -(buffer-name buf)) - (error "Failed to create new top-level!")) -(with-current-buffer buf +(defun sweeprolog-top-level-buffer (&optional name) + "Return a Prolog top-level buffer named NAME. + +If NAME is nil, use the default name \"*sweeprolog-top-level*\". + +If the buffer already exists, ensure it is associated with a live +top-level." + (unless sweeprolog-prolog-server-port +(sweeprolog-start-prolog-server)) + (let ((buf (get-buffer-create (or name "*sweeprolog-top-level*" +(unless (process-live-p (get-buffer-process
[nongnu] elpa/sweeprolog updated (027f7e9a64 -> eb2608bc64)
elpasync pushed a change to branch elpa/sweeprolog. from 027f7e9a64 DOC: explain how to follow source locations in top-level messages new 686db6f891 Support completion when reading a goal from the minibuffer new eb2608bc64 ADDED: command for sending a goal to top-level from any buffer Summary of changes: README.org| 20 + sweeprolog.el | 129 +++--- 2 files changed, 117 insertions(+), 32 deletions(-)
[elpa] externals/aggressive-indent a437a45868 2/2: Merge pull request #145 from liuchong/patch-1
branch: externals/aggressive-indent commit a437a45868f94b77362c6b913c5ee8e67b273c42 Merge: f376cdc25d b59d928060 Author: Artur Malabarba <453029+malaba...@users.noreply.github.com> Commit: GitHub Merge pull request #145 from liuchong/patch-1 Fix #101 - Protect command undo-tree-visualize --- aggressive-indent.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aggressive-indent.el b/aggressive-indent.el index 9a57206851..ad81cc6141 100644 --- a/aggressive-indent.el +++ b/aggressive-indent.el @@ -129,7 +129,7 @@ active. If the minor mode is turned on with the local command, :type '(repeat symbol) :package-version '(aggressive-indent . "1.8.4")) -(defcustom aggressive-indent-protected-commands '(undo undo-tree-undo undo-tree-redo whitespace-cleanup) +(defcustom aggressive-indent-protected-commands '(undo undo-tree-undo undo-tree-redo undo-tree-visualize undo-tree-visualize-undo undo-tree-visualize-redo whitespace-cleanup) "Commands after which indentation will NOT be performed. Aggressive indentation could break things like `undo' by locking the user in a loop, so this variable is used to control which
[elpa] externals/aggressive-indent b59d928060 1/2: Fix #101 - Protect command undo-tree-visualize
branch: externals/aggressive-indent commit b59d928060d7aeac55d181711fa7725b695e8bbc Author: 刘冲 Commit: Liu Chong Fix #101 - Protect command undo-tree-visualize --- aggressive-indent.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aggressive-indent.el b/aggressive-indent.el index b32b5870fd..3778bfdaf2 100644 --- a/aggressive-indent.el +++ b/aggressive-indent.el @@ -129,7 +129,7 @@ active. If the minor mode is turned on with the local command, :type '(repeat symbol) :package-version '(aggressive-indent . "1.8.4")) -(defcustom aggressive-indent-protected-commands '(undo undo-tree-undo undo-tree-redo whitespace-cleanup) +(defcustom aggressive-indent-protected-commands '(undo undo-tree-undo undo-tree-redo undo-tree-visualize undo-tree-visualize-undo undo-tree-visualize-redo whitespace-cleanup) "Commands after which indentation will NOT be performed. Aggressive indentation could break things like `undo' by locking the user in a loop, so this variable is used to control which
[elpa] externals-release/wisi decea1307c: * wisi.el (Version): Bump to include prj-alire.el copyright fix
branch: externals-release/wisi commit decea1307cc18e7596468cca20c626b4c67d1f31 Author: Stephen Leake Commit: Stephen Leake * wisi.el (Version): Bump to include prj-alire.el copyright fix --- wisi.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wisi.el b/wisi.el index ff517456a6..3ac2c90f83 100644 --- a/wisi.el +++ b/wisi.el @@ -7,7 +7,7 @@ ;; Keywords: parser ;; indentation ;; navigation -;; Version: 4.2.0 +;; Version: 4.2.1 ;; package-requires: ((emacs "25.3") (seq "2.20")) ;; URL: https://stephe-leake.org/ada/wisitoken.html ;;
[elpa] externals/cape 8841d1d21c: cape-tex: Do not insert backslash when already looking at \phi (Fix #71)
branch: externals/cape commit 8841d1d21c64061d34fe35c46c05b661421cdab1 Author: Daniel Mendler Commit: Daniel Mendler cape-tex: Do not insert backslash when already looking at \phi (Fix #71) --- cape-char.el | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cape-char.el b/cape-char.el index 81b3799586..5f49a54098 100644 --- a/cape-char.el +++ b/cape-char.el @@ -73,7 +73,8 @@ PREFIX are the prefix characters." (ann (intern (format "cape--%s-annotation" name))) (docsig (intern (format "cape--%s-docsig" name))) (exit (intern (format "cape--%s-exit" name))) -(properties (intern (format "cape--%s-properties" name +(properties (intern (format "cape--%s-properties" name))) +(thing-re (concat (regexp-opt (mapcar #'char-to-string prefix)) "[^ \n\t]*" ))) `(progn (defvar ,hash (cape-char--translation ,method @@ -113,13 +114,13 @@ is nil the function acts like a capf." method method) (if interactive ;; NOTE: Disable cycling since replacement breaks it. (let (completion-cycle-threshold ,prefix-required) - (when (memq last-input-event ',prefix) + (when (and (memq last-input-event ',prefix) + (not (thing-at-point-looking-at ,thing-re))) (self-insert-command 1 last-input-event)) (cape--interactive #',capf)) (when-let (bounds (cond - ((thing-at-point-looking-at - ,(concat (regexp-opt (mapcar #'char-to-string prefix)) "[^ \n\t]*" )) + ((thing-at-point-looking-at ,thing-re) (cons (match-beginning 0) (match-end 0))) ((not ,prefix-required) (cons (point) (point) (append
[elpa] externals/corfu b5458a132c: Change corfu-popupinfo face height to 1.0 (Fix #288)
branch: externals/corfu commit b5458a132c678b5fe97b4a7819b9bb1dba31aee2 Author: Daniel Mendler Commit: Daniel Mendler Change corfu-popupinfo face height to 1.0 (Fix #288) --- extensions/corfu-popupinfo.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el index f4e2ba231b..48e1294572 100644 --- a/extensions/corfu-popupinfo.el +++ b/extensions/corfu-popupinfo.el @@ -46,7 +46,7 @@ (require 'subr-x)) (defface corfu-popupinfo - '((t :inherit corfu-default :height 0.8)) + '((t :inherit corfu-default)) "Face used for the info popup." :group 'corfu-faces)
[elpa] externals/compat 5709f7c4a1: compat-28: Add test for dlet
branch: externals/compat commit 5709f7c4a16b7137e7eb74d304ce7e1ba13114fa Author: Daniel Mendler Commit: Daniel Mendler compat-28: Add test for dlet --- compat-28.el| 2 +- compat-tests.el | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/compat-28.el b/compat-28.el index 43d2c9146c..339c06e07a 100644 --- a/compat-28.el +++ b/compat-28.el @@ -405,7 +405,7 @@ If `default-directory' is already an existing directory, it's not changed." "/"))) ,@body)) -(compat-defmacro dlet (binders &rest body) ;; +(compat-defmacro dlet (binders &rest body) ;; "Like `let' but using dynamic scoping." (declare (indent 1) (debug let)) `(let (_) diff --git a/compat-tests.el b/compat-tests.el index 5eea987985..64bb8de66f 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -1529,6 +1529,16 @@ (should-equal "defg" (string-replace "abc" "defg" "abc")) (should-error (string-replace "" "x" "abc") :type 'wrong-length-argument)) +(ert-deftest dlet () + (should-not (boundp 'compat-tests--dlet1)) + (should-not (boundp 'compat-tests--dlet2)) + (dlet ((compat-tests--dlet1 1) + (compat-tests--dlet2 2)) +(should-equal (symbol-value 'compat-tests--dlet1) 1) +(should-equal (symbol-value 'compat-tests--dlet2) 2)) + (should-not (boundp 'compat-tests--dlet1)) + (should-not (boundp 'compat-tests--dlet2))) + (ert-deftest when-let* () (should-equal "second" (when-let*
[elpa] externals/ebdb d86eedbf7c 2/3: Basic implementation of mailing list record type
branch: externals/ebdb commit d86eedbf7c1b41229c9fee65e8f82be026a128cf Author: Eric Abrahamsen Commit: Eric Abrahamsen Basic implementation of mailing list record type * ebdb.el (ebdb-record-mailing-list): It now has slots! (ebdb-read, ebdb-string): And the basic methods. (ebdb-record-mail): This is now a generic function, which it should have been all along, so that different record classes can return their own mail addresses. --- ebdb-com.el | 8 - ebdb.el | 103 ++-- 2 files changed, 94 insertions(+), 17 deletions(-) diff --git a/ebdb-com.el b/ebdb-com.el index d1bf15cffa..27bf1fdf1f 100644 --- a/ebdb-com.el +++ b/ebdb-com.el @@ -128,7 +128,8 @@ create roles for those records, etc." :group 'faces) (defcustom ebdb-name-face-alist '((ebdb-record-person . ebdb-person-name) - (ebdb-record-organization . ebdb-organization-name)) + (ebdb-record-organization . ebdb-organization-name) + (ebdb-record-mailing-list . ebdb-mailing-list-name)) "Alist of record class types to the face names. Faces are used to font-lock their names in the *EBDB* buffer." :type '(repeat (cons (ebdb-record :tag "Record type") (face :tag "Face" @@ -143,6 +144,11 @@ Faces are used to font-lock their names in the *EBDB* buffer." "Face used for EBDB organization names." :group 'ebdb-faces) +(defface ebdb-mailing-list-name + '((t (:inherit font-lock-constant-face))) + "Face used for EBDB mailing list names." + :group 'ebdb-faces) + (defface ebdb-marked '((t (:background "LightBlue"))) "Face used for currently-marked records." diff --git a/ebdb.el b/ebdb.el index 870284545a..568a8f4fdd 100644 --- a/ebdb.el +++ b/ebdb.el @@ -3915,16 +3915,73 @@ instances to add as part of the role." (ebdb-record-insert-field record role 'organizations) (ebdb-init-field role record))) -(defclass ebdb-record-mailing-list (ebdb-record eieio-named) +(defclass ebdb-record-mailing-list (ebdb-record) ((name :type ebdb-field-name-simple :initarg :name +:initform nil) + (id +:type ebdb-field-domain +:initarg :id +:initform nil) + (posting-address +:type ebdb-field-mail +:initarg :posting-address +:initform nil) + (unsubscribe-address +:type ebdb-field-mail +:initarg :unsubscribe-address +:initform nil) + (unsubscribe-url +:type ebdb-field-url +:initarg :unsubscribe-url +:initform nil) + (user-address +:type ebdb-field-mail +:initarg :user-address +:initform nil) + (archive-url +:type ebdb-field-url +:initarg :archive-url :initform nil)) :allow-nil-initform t :documentation "A record class representing a mailing list.") -(cl-defmethod ebdb-read ((_class (subclass ebdb-record-mailing-list)) &optional _db _slots) - (error "Mailing list records haven't been implemented yet")) +(cl-defmethod ebdb-read ((class (subclass ebdb-record-mailing-list)) &optional slots) + (let ((name (ebdb-read 'ebdb-field-name-simple)) + (id (let ((ebdb-read-string-override "Mailing list id")) + (ebdb-read 'ebdb-field-domain))) + + (posting-address +(let ((ebdb-read-string-override "Posting address")) + (ebdb-with-exit + (ebdb-read 'ebdb-field-mail + + (user-address +(let ((ebdb-read-string-override "Address to post from")) + (ebdb-with-exit + (ebdb-read +'ebdb-field-mail nil +(ebdb-parse 'ebdb-field-mail user-mail-address) + + (archive-url +(let ((ebdb-read-string-override "Archive URL")) + (ebdb-with-exit + (ebdb-read 'ebdb-field-url) +(setq slots (list :name name :id id :posting-address posting-address + :user-address user-address :archive-url archive-url)) +(cl-call-next-method class slots))) + +(cl-defmethod ebdb-init-record ((record ebdb-record-mailing-list)) + (with-slots (name posting-address) record +(ebdb-init-field name record) +(ebdb-init-field posting-address record))) + +(cl-defmethod ebdb-string ((record ebdb-record-mailing-list)) + (with-slots (name id) record +(if (and name id) + (concat name " " id) + (or name id ;;; Merging @@ -4748,27 +4805,41 @@ If RECORDS are given, only search those records." (object-assoc label 'label phones) phones))) -(defun ebdb-record-mail (record &optional no-roles label defunct) +(cl-defgeneric ebdb-record-mail (record &optional no-roles label defunct) "Return a list of all RECORD's mail fields. If NO-ROLES is non-nil, exclude mail fields from RECORD's roles. If LABEL is a string, return the mail with that label. If DEFUNCT is non-nil, also consider RECORD's defunct mail -addresses. Sort mails by descending priority." - (let ((mails (slot-value record 'mail)))
[elpa] externals/ebdb fa65397bae 1/3: Fix bug in window popping-up
branch: externals/ebdb commit fa65397bae97ec58efdbda1fdab2fd3484ce7e81 Author: Eric Abrahamsen Commit: Eric Abrahamsen Fix bug in window popping-up * ebdb-com.el (ebdb-pop-up-window): The setting of `buffer-window' was supposed to belong to the THEN branch. --- ebdb-com.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ebdb-com.el b/ebdb-com.el index 04609c81c9..d1bf15cffa 100644 --- a/ebdb-com.el +++ b/ebdb-com.el @@ -1262,8 +1262,9 @@ popped up from." (if (not (or split-window size)) ;; Not splitting, but buffer isn't visible, just take up ;; the whole window. - (pop-to-buffer-same-window buf) - (setq buffer-window (get-buffer-window buf t)) + (progn + (pop-to-buffer-same-window buf) + (setq buffer-window (get-buffer-window buf t))) ;; Otherwise split. (setq buffer-window
[elpa] externals/ebdb 610d1ed5d4 3/3: Fix function signature of ebdb-record-mail, release 0.8.17
branch: externals/ebdb commit 610d1ed5d4095936836102e1e48dc4416d0d260b Author: Eric Abrahamsen Commit: Eric Abrahamsen Fix function signature of ebdb-record-mail, release 0.8.17 * ebdb.el (ebdb-record-mail): Missing optional arguments, and the no-roles argument wasn't doing its job. --- ebdb.el | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ebdb.el b/ebdb.el index 568a8f4fdd..c69d898f29 100644 --- a/ebdb.el +++ b/ebdb.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2016-2022 Free Software Foundation, Inc. -;; Version: 0.8.16 +;; Version: 0.8.17 ;; Package-Requires: ((emacs "25.1") (seq "2.15")) ;; Maintainer: Eric Abrahamsen @@ -4833,9 +4833,11 @@ addresses. Sort mails by descending priority.") &optional _no-roles _label _defunct) nil) -(cl-defmethod ebdb-record-mail ((record ebdb-record-person)) - (delete nil (mapcar (lambda (role) (slot-value role 'mail)) - (slot-value record 'organizations +(cl-defmethod ebdb-record-mail ((record ebdb-record-person) + &optional no-roles _label _defunct) + (unless no-roles +(delete nil (mapcar (lambda (role) (slot-value role 'mail)) + (slot-value record 'organizations) (cl-defmethod ebdb-record-mail ((record ebdb-record-mailing-list) &optional _no-roles _label _defunct)
[elpa] externals/ebdb updated (a961744cc4 -> 610d1ed5d4)
girzel pushed a change to branch externals/ebdb. from a961744cc4 Adjust Notmuch insinuation new fa65397bae Fix bug in window popping-up new d86eedbf7c Basic implementation of mailing list record type new 610d1ed5d4 Fix function signature of ebdb-record-mail, release 0.8.17 Summary of changes: ebdb-com.el | 13 ++-- ebdb.el | 107 ++-- 2 files changed, 100 insertions(+), 20 deletions(-)
[elpa] externals/compat f820d79689: compat-29: Use when-let
branch: externals/compat commit f820d796897ff564abd4d7830a71d060e82d5021 Author: Daniel Mendler Commit: Daniel Mendler compat-29: Use when-let --- compat-29.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compat-29.el b/compat-29.el index 6250a896e5..80588e0910 100644 --- a/compat-29.el +++ b/compat-29.el @@ -776,9 +776,8 @@ The binding is probably a symbol with a function definition. If optional argument ACCEPT-DEFAULT is non-nil, recognize default bindings; see the description of `keymap-lookup' for more details about this." - (let ((map (current-local-map))) -(when map - (keymap-lookup map keys accept-default + (when-let ((map (current-local-map))) +(keymap-lookup map keys accept-default))) (compat-defun keymap-global-lookup (keys &optional accept-default _message) ;; "Return the binding for command KEYS in current global keymap only.
[elpa] externals/compat 5dbe99b23f: compat-28: Add test for macroexp-file-name
branch: externals/compat commit 5dbe99b23f8142c968a263f67b2bce594765ada7 Author: Daniel Mendler Commit: Daniel Mendler compat-28: Add test for macroexp-file-name --- compat-28.el| 2 +- compat-tests.el | 9 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compat-28.el b/compat-28.el index 339c06e07a..8b0cae84f2 100644 --- a/compat-28.el +++ b/compat-28.el @@ -738,7 +738,7 @@ where the mouse button is clicked to find a thing nearby." Defined in macroexp.el -(compat-defun macroexp-file-name () ;; +(compat-defun macroexp-file-name () ;; "Return the name of the file from which the code comes. Returns nil when we do not know. A non-nil result is expected to be reliable when called from a macro in order diff --git a/compat-tests.el b/compat-tests.el index 64bb8de66f..e852d94118 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -1970,6 +1970,15 @@ (should-equal 'foo (compat-call lookup-key (list a-map b-map) "x")) (should-equal 'bar (compat-call lookup-key (list b-map a-map) "x" +;; We need an indirection since `macroexp-file-name' is a function and not a +;; macro. I don't understand why this wrong choice was made. +;; `macroexp-file-name' should be a macro. +(defmacro compat-tests--filename () + (macroexp-file-name)) + +(ert-deftest macroexp-file-name () + (should-equal (file-name-nondirectory (compat-tests--filename)) "compat-tests.el")) + (ert-deftest macroexpand-1 () (should-equal '(if a b c) (macroexpand-1 '(if a b c))) (should-equal '(if a (progn b)) (macroexpand-1 '(when a b)))
[elpa] externals/osm 63426c9c03 2/3: osm-ol: Use geo url scheme by default (Fix #31)
branch: externals/osm commit 63426c9c032ef5bce406646de683205f2b851685 Author: Daniel Mendler Commit: Daniel Mendler osm-ol: Use geo url scheme by default (Fix #31) --- README.org | 12 ++-- osm-ol.el | 16 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index d4a7987b09..3ce2eabf1c 100644 --- a/README.org +++ b/README.org @@ -80,12 +80,12 @@ buffers in Emacs. Furthermore you can open Org links in arbitrary buffers with ~org-open-at-point-global~. I recommend binding this command to a key, e.g., ~C-c o~. #+begin_example - [[osm:41.869560826994544,12.45849609375;z=6;s=opentopomap][Italia, 41.87° 12.46° OpenTopoMap]] - [[osm:51.48950698022105,-0.144195556640625;z=11][London, England, 51.49° -0.14°]] - [[osm:55.686875255964424,12.569732666015625;z=12;s=cyclosm][København, Danmark, 55.69° 12.57° CyclOSM]] - [[osm:40.72956780913898,-73.97918701171875;z=12;s=stamen-watercolor][New York, United States, 40.73° -73.98° Stamen Watercolor]] - [[osm:27.961656050984658,86.89224243164062;z=13;s=opentopomap][Mount Everest, 27.96° 86.89° OpenTopoMap]] - (Address link) + [[geo:41.869560826994544,12.45849609375;z=6;s=opentopomap][Italia, 41.87° 12.46° OpenTopoMap]] + [[geo:51.48950698022105,-0.144195556640625;z=11][London, England, 51.49° -0.14°]] + [[geo:55.686875255964424,12.569732666015625;z=12;s=cyclosm][København, Danmark, 55.69° 12.57° CyclOSM]] + [[geo:40.72956780913898,-73.97918701171875;z=12;s=stamen-watercolor][New York, United States, 40.73° -73.98° Stamen Watercolor]] + [[geo:27.961656050984658,86.89224243164062;z=13;s=opentopomap][Mount Everest, 27.96° 86.89° OpenTopoMap]] + (Address link) #+end_example Elisp link examples diff --git a/osm-ol.el b/osm-ol.el index 1c531c9d09..67ed30f353 100644 --- a/osm-ol.el +++ b/osm-ol.el @@ -25,13 +25,20 @@ (require 'ol) +(defcustom osm-ol-type "geo" + "URL scheme used for OSM links. +The scheme defaults to `geo:' (RFC 5870), but if desired you can +also configure the old scheme `osm:'." + :type 'string + :group 'osm) + ;; Only load osm on demand (autoload 'osm--goto "osm") (autoload 'osm-search "osm") (declare-function osm--org-link-data "osm") (org-link-set-parameters - "osm" + osm-ol-type :follow #'osm-ol-open :store #'osm-ol-store) @@ -57,10 +64,11 @@ (when (derived-mode-p 'osm-mode) (pcase-let ((`(,lat ,lon ,zoom ,server ,desc) (osm--org-link-data))) (org-link-store-props - :type "osm" + :type osm-ol-type :description desc - :link (format "osm:%.6f,%.6f;z=%s%s" - lat lon zoom (if server (format ";s=%s" server) "")) + :link (format "%s:%.6f,%.6f;z=%s%s" + osm-ol-type lat lon zoom + (if server (format ";s=%s" server) "")) (provide 'osm-ol) ;;; osm-ol.el ends here
[elpa] externals/osm 3e9e839df0 3/3: Update README
branch: externals/osm commit 3e9e839df03e14ea8789ce1ef868155e994f5f0f Author: Daniel Mendler Commit: Daniel Mendler Update README --- README.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 3ce2eabf1c..48516bc87d 100644 --- a/README.org +++ b/README.org @@ -77,7 +77,9 @@ created at point with the mouse, see ~osm-bookmark-set-click~ and Click on a link or press ~RET~ to jump to the location. These links work in Org buffers in Emacs. Furthermore you can open Org links in arbitrary buffers with -~org-open-at-point-global~. I recommend binding this command to a key, e.g., ~C-c o~. +~org-open-at-point-global~. I recommend binding the command to a convenient key, +e.g., ~C-c o~. The format of the links complies with the [[https://en.wikipedia.org/wiki/Geo_URI_scheme][geo URI scheme]] defined by +[[https://datatracker.ietf.org/doc/html/rfc5870][RFC 5870]]. #+begin_example [[geo:41.869560826994544,12.45849609375;z=6;s=opentopomap][Italia, 41.87° 12.46° OpenTopoMap]]
[elpa] externals/osm 9fa61e4b12 1/3: osm-ol: Switch org link convention to geo uri scheme (RFC 5870)
branch: externals/osm commit 9fa61e4b127f74d345c5261058d5d83eca0c207f Author: Daniel Mendler Commit: Daniel Mendler osm-ol: Switch org link convention to geo uri scheme (RFC 5870) --- README.org | 12 ++-- osm-ol.el | 24 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.org b/README.org index c66715bd65..d4a7987b09 100644 --- a/README.org +++ b/README.org @@ -76,15 +76,15 @@ created at point with the mouse, see ~osm-bookmark-set-click~ and Org link examples Click on a link or press ~RET~ to jump to the location. These links work in Org -buffers in Emacs. Furthermore you can open Org links in arbitary buffers with +buffers in Emacs. Furthermore you can open Org links in arbitrary buffers with ~org-open-at-point-global~. I recommend binding this command to a key, e.g., ~C-c o~. #+begin_example - [[osm:opentopomap:41.869560826994544,12.45849609375,6][Italia, 41.87° 12.46° OpenTopoMap]] - [[osm:51.48950698022105,-0.144195556640625,11][London, England, 51.49° -0.14°]] - [[osm:cyclosm:55.686875255964424,12.569732666015625,12][København, Danmark, 55.69° 12.57° CyclOSM]] - [[osm:stamen-watercolor:40.72956780913898,-73.97918701171875,12][New York, United States, 40.73° -73.98° Stamen Watercolor]] - [[osm:opentopomap:27.961656050984658,86.89224243164062,13][Mount Everest, 27.96° 86.89° OpenTopoMap]] + [[osm:41.869560826994544,12.45849609375;z=6;s=opentopomap][Italia, 41.87° 12.46° OpenTopoMap]] + [[osm:51.48950698022105,-0.144195556640625;z=11][London, England, 51.49° -0.14°]] + [[osm:55.686875255964424,12.569732666015625;z=12;s=cyclosm][København, Danmark, 55.69° 12.57° CyclOSM]] + [[osm:40.72956780913898,-73.97918701171875;z=12;s=stamen-watercolor][New York, United States, 40.73° -73.98° Stamen Watercolor]] + [[osm:27.961656050984658,86.89224243164062;z=13;s=opentopomap][Mount Everest, 27.96° 86.89° OpenTopoMap]] (Address link) #+end_example diff --git a/osm-ol.el b/osm-ol.el index 1c456ded97..1c531c9d09 100644 --- a/osm-ol.el +++ b/osm-ol.el @@ -40,14 +40,16 @@ (save-match-data (cond ((string-match - "\\`\\(?:\\([^:]+\\):\\)?\\([0-9.-]+\\),\\([0-9.-]+\\),\\([0-9]+\\)\\'" link) - (osm--goto - (string-to-number (match-string 2 link)) - (string-to-number (match-string 3 link)) - (string-to-number (match-string 4 link)) - (and (match-end 1) (intern (match-string 1 link))) - 'osm-link - "Org Link")) + "\\`\\([0-9.-]+\\),\\([0-9.-]+\\)\\(?:,[0-9.-]+\\)?\\(;.+\\'\\|\\'\\)" link) + (let* ((lat (string-to-number (match-string 1 link))) + (lon (string-to-number (match-string 2 link))) + (args (url-parse-args (match-string 3 link) "")) + (zoom (cdr (assoc "z" args))) + (server (cdr (assoc "s" args +(osm--goto lat lon + (and zoom (string-to-number zoom)) + (and server (intern-soft server)) + 'osm-link "Org Link"))) (t (osm-search link) (defun osm-ol-store () @@ -57,10 +59,8 @@ (org-link-store-props :type "osm" :description desc - :link (format - "osm:%s%.6f,%.6f,%s" - (if server (format "%s:" server) "") - lat lon zoom) + :link (format "osm:%.6f,%.6f;z=%s%s" + lat lon zoom (if server (format ";s=%s" server) "")) (provide 'osm-ol) ;;; osm-ol.el ends here
[elpa] externals/osm updated (e6caf26619 -> 3e9e839df0)
elpasync pushed a change to branch externals/osm. from e6caf26619 Turn `osm' into a function new 9fa61e4b12 osm-ol: Switch org link convention to geo uri scheme (RFC 5870) new 63426c9c03 osm-ol: Use geo url scheme by default (Fix #31) new 3e9e839df0 Update README Summary of changes: README.org | 18 ++ osm-ol.el | 36 ++-- 2 files changed, 32 insertions(+), 22 deletions(-)
[nongnu] elpa/nix-mode 91a317e425 2/2: Merge pull request #176 from lafrenierejm/reformatter
branch: elpa/nix-mode commit 91a317e425be15b03d31d404d798c21faf373113 Merge: 54e5626829 fb6c1ca5dd Author: Matthew Bauer Commit: GitHub Merge pull request #176 from lafrenierejm/reformatter Replace custom `nixfmt` wrapping with `reformatter` --- flake.nix | 1 + nix-format.el | 49 - 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index bffea7cd0d..53aa5e9dbe 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,7 @@ f magit-section transient + reformatter ]); in stdenvNoCC.mkDerivation { pname = "nix-mode"; diff --git a/nix-format.el b/nix-format.el index 75e679e46e..679ad02629 100644 --- a/nix-format.el +++ b/nix-format.el @@ -3,54 +3,29 @@ ;; This file is NOT part of GNU Emacs. ;; Homepage: https://github.com/NixOS/nix-mode -;; Package-Requires: ((emacs "24.1")) +;; Package-Requires: ((emacs "24.1") (reformatter "0.6")) ;; Version: 1.5.0 ;;; Commentary: ;;; Code: +(require 'reformatter) (defcustom nix-nixfmt-bin "nixfmt" "Path to nixfmt executable." :group 'nix :type 'string) -(if (fboundp 'replace-buffer-contents) -(defun nix--replace-buffer-contents (src dst) - (with-current-buffer dst (replace-buffer-contents src))) - (defun nix--replace-buffer-contents (src dst) -(if (not (string= (with-current-buffer src (buffer-string)) - (with-current-buffer dst (buffer-string - (with-current-buffer src - (copy-to-buffer dst (point-min) (point-max)) - -(defun nix--format-call (buf nixfmt-bin) - "Format BUF using nixfmt." - (with-current-buffer (get-buffer-create "*nixfmt*") -(erase-buffer) -(insert-buffer-substring buf) -(if (zerop (call-process-region (point-min) (point-max) nixfmt-bin t t nil)) - (nix--replace-buffer-contents (current-buffer) buf) - (error "Nixfmt failed, see *nixfmt* buffer for details" - -(defun nix--find-nixfmt () - "Find the nixfmt binary, or error if it's missing." - (let ((nixfmt-bin (executable-find nix-nixfmt-bin))) -(unless nixfmt-bin - (error "Could not locate executable %S" nix-nixfmt-bin)) -nixfmt-bin)) - -(defun nix-format-buffer () - "Format the current buffer using nixfmt." - (interactive) - (nix--format-call (current-buffer) (nix--find-nixfmt)) - (message "Formatted buffer with nixfmt.")) - -;;;###autoload -(defun nix-format-before-save () - "Add this to `before-save-hook' to run nixfmt when saving." - (when (derived-mode-p 'nix-mode) -(nix-format-buffer))) +;;;###autoload (autoload 'nixfmt-buffer "nix-format") +;;;###autoload (autoload 'nixfmt-region "nix-format") +;;;###autoload (autoload 'nixfmt-on-save-mode "nix-format") +(reformatter-define nixfmt + :program nix-nixfmt-bin + :args (list input-file) + :stdin nil + :stdout nil + :input-file (reformatter-temp-file-in-current-directory) + :group 'nix) (provide 'nix-format) ;;; nix-format.el ends here
[nongnu] elpa/nix-mode fb6c1ca5dd 1/2: Replace custom nixfmt wrapping with reformatter
branch: elpa/nix-mode commit fb6c1ca5dd22580267142f19f78608a99de77552 Author: Joseph LaFreniere Commit: Joseph LaFreniere Replace custom nixfmt wrapping with reformatter --- flake.nix | 1 + nix-format.el | 49 - 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index bffea7cd0d..53aa5e9dbe 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,7 @@ f magit-section transient + reformatter ]); in stdenvNoCC.mkDerivation { pname = "nix-mode"; diff --git a/nix-format.el b/nix-format.el index 75e679e46e..679ad02629 100644 --- a/nix-format.el +++ b/nix-format.el @@ -3,54 +3,29 @@ ;; This file is NOT part of GNU Emacs. ;; Homepage: https://github.com/NixOS/nix-mode -;; Package-Requires: ((emacs "24.1")) +;; Package-Requires: ((emacs "24.1") (reformatter "0.6")) ;; Version: 1.5.0 ;;; Commentary: ;;; Code: +(require 'reformatter) (defcustom nix-nixfmt-bin "nixfmt" "Path to nixfmt executable." :group 'nix :type 'string) -(if (fboundp 'replace-buffer-contents) -(defun nix--replace-buffer-contents (src dst) - (with-current-buffer dst (replace-buffer-contents src))) - (defun nix--replace-buffer-contents (src dst) -(if (not (string= (with-current-buffer src (buffer-string)) - (with-current-buffer dst (buffer-string - (with-current-buffer src - (copy-to-buffer dst (point-min) (point-max)) - -(defun nix--format-call (buf nixfmt-bin) - "Format BUF using nixfmt." - (with-current-buffer (get-buffer-create "*nixfmt*") -(erase-buffer) -(insert-buffer-substring buf) -(if (zerop (call-process-region (point-min) (point-max) nixfmt-bin t t nil)) - (nix--replace-buffer-contents (current-buffer) buf) - (error "Nixfmt failed, see *nixfmt* buffer for details" - -(defun nix--find-nixfmt () - "Find the nixfmt binary, or error if it's missing." - (let ((nixfmt-bin (executable-find nix-nixfmt-bin))) -(unless nixfmt-bin - (error "Could not locate executable %S" nix-nixfmt-bin)) -nixfmt-bin)) - -(defun nix-format-buffer () - "Format the current buffer using nixfmt." - (interactive) - (nix--format-call (current-buffer) (nix--find-nixfmt)) - (message "Formatted buffer with nixfmt.")) - -;;;###autoload -(defun nix-format-before-save () - "Add this to `before-save-hook' to run nixfmt when saving." - (when (derived-mode-p 'nix-mode) -(nix-format-buffer))) +;;;###autoload (autoload 'nixfmt-buffer "nix-format") +;;;###autoload (autoload 'nixfmt-region "nix-format") +;;;###autoload (autoload 'nixfmt-on-save-mode "nix-format") +(reformatter-define nixfmt + :program nix-nixfmt-bin + :args (list input-file) + :stdin nil + :stdout nil + :input-file (reformatter-temp-file-in-current-directory) + :group 'nix) (provide 'nix-format) ;;; nix-format.el ends here
[elpa] externals/compat 15288f4771: compat-29: Add while-let test
branch: externals/compat commit 15288f4771999f640f8df6560d8623d773dfa312 Author: Daniel Mendler Commit: Daniel Mendler compat-29: Add while-let test --- compat-29.el| 2 +- compat-tests.el | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/compat-29.el b/compat-29.el index 80588e0910..b330f33569 100644 --- a/compat-29.el +++ b/compat-29.el @@ -326,7 +326,7 @@ this defaults to the current buffer." (put-text-property sub-start sub-end 'display disp object))) (setq sub-start sub-end -(compat-defmacro while-let (spec &rest body) ;; +(compat-defmacro while-let (spec &rest body) ;; "Bind variables according to SPEC and conditionally evaluate BODY. Evaluate each binding in turn, stopping if a binding value is nil. If all bindings are non-nil, eval BODY and repeat. diff --git a/compat-tests.el b/compat-tests.el index e852d94118..d402eadded 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -1539,6 +1539,12 @@ (should-not (boundp 'compat-tests--dlet1)) (should-not (boundp 'compat-tests--dlet2))) +(ert-deftest while-let () + (let ((first '(1 2 3 4)) (second '(a b c)) zipped) +(while-let ((x (pop first)) (y (pop second))) + (push (cons x y) zipped)) +(should-equal '((3 . c) (2 . b) (1 . a)) zipped))) + (ert-deftest when-let* () (should-equal "second" (when-let*
[elpa] externals/compat cfa81c0566 4/4: compat-tests: Update comment
branch: externals/compat commit cfa81c05666ed7619fbdad19ccd235e8541c1e04 Author: Daniel Mendler Commit: Daniel Mendler compat-tests: Update comment --- compat-tests.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compat-tests.el b/compat-tests.el index a66e467668..f03d6c6e90 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -2000,8 +2000,8 @@ (should-equal 'bar (compat-call lookup-key (list b-map a-map) "x" ;; We need an indirection since `macroexp-file-name' is a function and not a -;; macro. I don't understand why this wrong choice was made. -;; `macroexp-file-name' should be a macro. +;; macro. `macroexp-file-name' is not a function since it is used mostly in a +;; macro context. (defmacro compat-tests--filename () (macroexp-file-name))
[elpa] externals/compat updated (15288f4771 -> cfa81c0566)
elpasync pushed a change to branch externals/compat. from 15288f4771 compat-29: Add while-let test new 68ead168f8 compat-29: Add buttonize and buttonize-region new b2efae0997 compat-29: Fix typo in last commit new 543805066a Remove unnecessary :feature arguments from compat-defuns new cfa81c0566 compat-tests: Update comment Summary of changes: NEWS.org| 1 + compat-25.el| 1 - compat-28.el| 18 -- compat-29.el| 45 + compat-macs.el | 19 --- compat-tests.el | 27 +-- compat.texi | 29 +++-- 7 files changed, 102 insertions(+), 38 deletions(-)
[elpa] externals/compat 68ead168f8 1/4: compat-29: Add buttonize and buttonize-region
branch: externals/compat commit 68ead168f83bacda23de623a32fb9fa767a9 Author: Daniel Mendler Commit: Daniel Mendler compat-29: Add buttonize and buttonize-region --- NEWS.org| 1 + compat-28.el| 17 - compat-29.el| 45 + compat-macs.el | 19 --- compat-tests.el | 23 +++ compat.texi | 29 +++-- 6 files changed, 100 insertions(+), 34 deletions(-) diff --git a/NEWS.org b/NEWS.org index 968b938364..7a418d1514 100644 --- a/NEWS.org +++ b/NEWS.org @@ -7,6 +7,7 @@ - compat-28: Add ~make-separator-line~. - compat-29: Minor fixes to ~keymap-*~ functions. - compat-29: Add ~with-memoization~. +- compat-29: Add ~buttonize~ and ~buttonize-region~. * Release of "Compat" Version 29.1.1.0 diff --git a/compat-28.el b/compat-28.el index 8b0cae84f2..0235ce44a4 100644 --- a/compat-28.el +++ b/compat-28.el @@ -768,23 +768,6 @@ The previous values will be be restored upon exit." variables) ,@body)) - Defined in button.el - -(compat-defun button-buttonize (string callback &optional data) ;; - "Make STRING into a button and return it. -When clicked, CALLBACK will be called with the DATA as the -function argument. If DATA isn't present (or is nil), the button -itself will be used instead as the function argument." - :feature button - (propertize string - 'face 'button - 'button t - 'follow-link t - 'category t - 'button-data data - 'keymap button-map - 'action callback)) - Defined in time-data.el (compat-defun decoded-time-period (time) ;; diff --git a/compat-29.el b/compat-29.el index b330f33569..d05d617ca6 100644 --- a/compat-29.el +++ b/compat-29.el @@ -957,5 +957,50 @@ command exists in this specific map, but it doesn't have the ,@(nreverse props)) defvar-form + Defined in button.el + +(compat-defun button--properties (callback data help-echo) ;; + "Helper function." + (list 'font-lock-face 'button +'mouse-face 'highlight +'help-echo help-echo +'button t +'follow-link t +'category t +'button-data data +'keymap button-map +'action callback)) + +(defun buttonize (string callback &optional data help-echo) ;; + "Make STRING into a button and return it. +When clicked, CALLBACK will be called with the DATA as the +function argument. If DATA isn't present (or is nil), the button +itself will be used instead as the function argument. + +If HELP-ECHO, use that as the `help-echo' property. + +Also see `buttonize-region'." + (let ((string + (apply #'propertize string +(button--properties callback data help-echo +;; Add the face to the end so that it can be overridden. +(add-face-text-property 0 (length string) 'button t string) +string)) + +(compat-defun buttonize-region (start end callback &optional data help-echo) ;; + "Make the region between START and END into a button. +When clicked, CALLBACK will be called with the DATA as the +function argument. If DATA isn't present (or is nil), the button +itself will be used instead as the function argument. + +If HELP-ECHO, use that as the `help-echo' property. + +Also see `buttonize'." + (add-text-properties start end (button--properties callback data help-echo)) + (add-face-text-property start end 'button t)) + +;; Obsolete Alias since 29 +(compat-defalias button-buttonize buttonize :obsolete t) + (provide 'compat-29) ;;; compat-29.el ends here diff --git a/compat-macs.el b/compat-macs.el index 62e1bce0f5..f37c0ab1e5 100644 --- a/compat-macs.el +++ b/compat-macs.el @@ -25,12 +25,12 @@ ;; around. (require 'subr-x) -(defvar compat--current-version nil +(defvar compat--version nil "Version of the currently defined compatibility definitions.") (defmacro compat-declare-version (version) "Set the Emacs version that is currently being handled to VERSION." - (setq compat--current-version version) + (setq compat--version version) (let ((before (1- (car (version-to-list version) (when (and (< 24 before) (< emacs-major-version before)) `(require ',(intern (format "compat-%d" before)) @@ -45,7 +45,7 @@ Prepend compatibility notice to the actual documentation string." If this is not documented on yourself system, you can check \ `(compat) Emacs %s' for more details.]\n\n%s" type name - compat--current-version compat--current-version + compat--version compat--version docstring)) (let ((fill-column 80)) (fill-region (point-min) (point-max))) @@ -76,7 +76,7 @@ If this is not documented on yourself system, you can check \ (eval cond t) ;; The current Emacs must be older than the current declared Compat ;; version, see `compat-declare-version'. - (version< emac
[elpa] externals/compat 543805066a 3/4: Remove unnecessary :feature arguments from compat-defuns
branch: externals/compat commit 543805066af805ee4df449d5288229bfa8293c66 Author: Daniel Mendler Commit: Daniel Mendler Remove unnecessary :feature arguments from compat-defuns --- compat-25.el | 1 - compat-28.el | 1 - 2 files changed, 2 deletions(-) diff --git a/compat-25.el b/compat-25.el index 64d7fff47a..42fa9e0a5a 100644 --- a/compat-25.el +++ b/compat-25.el @@ -195,7 +195,6 @@ threading." (compat-defun macroexpand-1 (form &optional environment) ;; "Perform (at most) one step of macro expansion." - :feature macroexp (cond ((consp form) (let* ((head (car form)) diff --git a/compat-28.el b/compat-28.el index 0235ce44a4..3cf133ff40 100644 --- a/compat-28.el +++ b/compat-28.el @@ -745,7 +745,6 @@ A non-nil result is expected to be reliable when called from a macro in order to find the file in which the macro's call was found, and it should be reliable as well when used at the top-level of a file. Other uses risk returning non-nil value that point to the wrong file." - :feature macroexp (let ((file (car (last current-load-list (or (if (stringp file) file) (bound-and-true-p byte-compile-current-file
[elpa] externals/compat b2efae0997 2/4: compat-29: Fix typo in last commit
branch: externals/compat commit b2efae0997918e1ed8205764b4cabda0ea475c43 Author: Daniel Mendler Commit: Daniel Mendler compat-29: Fix typo in last commit --- compat-29.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat-29.el b/compat-29.el index d05d617ca6..bcee2bd975 100644 --- a/compat-29.el +++ b/compat-29.el @@ -971,7 +971,7 @@ command exists in this specific map, but it doesn't have the 'keymap button-map 'action callback)) -(defun buttonize (string callback &optional data help-echo) ;; +(compat-defun buttonize (string callback &optional data help-echo) ;; "Make STRING into a button and return it. When clicked, CALLBACK will be called with the DATA as the function argument. If DATA isn't present (or is nil), the button
[nongnu] elpa/evil-numbers updated (7bd9bb0bce -> dbe39b0ac7)
elpasync pushed a change to branch elpa/evil-numbers. from 7bd9bb0bce Cleanup: use pcase-dolist new 434298ed9a Auto format using elisp-autofmt new dbe39b0ac7 Cleanup: replace 'if' with 'cond' Summary of changes: .elisp-autofmt | 0 evil-numbers.el | 323 tests/evil-numbers-tests.el | 320 ++- 3 files changed, 373 insertions(+), 270 deletions(-) create mode 100644 .elisp-autofmt
[nongnu] elpa/evil-numbers dbe39b0ac7 2/2: Cleanup: replace 'if' with 'cond'
branch: elpa/evil-numbers commit dbe39b0ac74580a5241a5f8c373cdcc6b00f119c Author: Campbell Barton Commit: Campbell Barton Cleanup: replace 'if' with 'cond' Avoids the need for `progn` adding/removing when using multiple statements in the first condition. --- evil-numbers.el | 108 +++- 1 file changed, 68 insertions(+), 40 deletions(-) diff --git a/evil-numbers.el b/evil-numbers.el index fa897f073c..ee4aa86965 100644 --- a/evil-numbers.el +++ b/evil-numbers.el @@ -165,9 +165,11 @@ This doesn't match VIM's behavior." (result (list))) (while str-dst-rev (let ((ch-src (pop str-src-rev))) -(if (and ch-src (memq ch-src sep-chars-list)) -(push ch-src result) - (push (pop str-dst-rev) result +(cond + ((and ch-src (memq ch-src sep-chars-list)) + (push ch-src result)) + (t + (push (pop str-dst-rev) result) (apply #'string result))) ;; --- @@ -184,13 +186,19 @@ This doesn't match VIM's behavior." - nil: Mixed case." (let ((str-dn (downcase str)) (str-up (upcase str))) -(if (string-equal str str-dn) -(if (string-equal str str-up) -default - -1) - (if (string-equal str str-up) - 1 -nil +(cond + ((string-equal str str-dn) + (cond + ((string-equal str str-up) +default) + (t +-1))) + (t + (cond + ((string-equal str str-up) +1) + (t +nil)) (defun evil-numbers--format-binary (number &optional width fillchar) "Format NUMBER as binary. @@ -203,9 +211,11 @@ representation of NUMBER is smaller." (setq number (truncate number 2))) (let ((len (length nums))) (apply #'concat - (if (and width (< len width)) - (make-string (- width len) fillchar) - "") + (cond + ((and width (< len width)) + (make-string (- width len) fillchar)) + (t + "")) nums (defun evil-numbers--format (num width base) @@ -232,13 +242,17 @@ CH-NUM: Number of characters to step. LIMIT: Point which will not be stepped past." (let* ((is-forward (< 0 dir)) (skip-chars-fn - (if is-forward - #'skip-chars-forward -#'skip-chars-backward)) + (cond + (is-forward +#'skip-chars-forward) + (t +#'skip-chars-backward))) (clamp-fn - (if is-forward - #'min -#'max)) + (cond + (is-forward +#'min) + (t +#'max))) (skipped (abs (funcall skip-chars-fn @@ -307,9 +321,11 @@ Each item in MATCH-CHARS is a cons pair. (match-list (list))) ;; Sanity check. - (when (if is-forward -(> (point) limit) - (< (point) limit)) + (when (cond + (is-forward + (> (point) limit)) + (t + (< (point) limit))) (error "Limit is on wrong side of point (internal error)")) (unless is-forward @@ -382,9 +398,11 @@ Each item in MATCH-CHARS is a cons pair. (defun evil-numbers--translate-with-alist (alist string) "Translate every symbol in STRING using ALIST." - (funcall (if (stringp string) - #'concat - #'identity) + (funcall (cond +((stringp string) + #'concat) +(t + #'identity)) (mapcar (lambda (c) (cdr (assoc c alist))) string))) (defun evil-numbers--encode-super (x) @@ -454,18 +472,22 @@ replacing it by the result of NUMBER-XFORM-FN and return non-nil." (match-string num-group (str-prev-strip - (if sep-char - (evil-numbers--strip-chars str-prev sep-char) -str-prev)) + (cond + (sep-char +(evil-numbers--strip-chars str-prev sep-char)) + (t +str-prev))) (num-prev (string-to-number str-prev-strip base)) (num-next (funcall number-xform-fn num-prev)) (str-next (evil-numbers--format (abs num-next) - (if padded - (- (match-end num-group) (match-beginning num-group)) - 1) + (cond +(padded + (- (match-end num-group) (match-beginning num-group))) +(t + 1)) base))) ;; Maintain case. @@ -654,21 +676,27 @@ negative number to a positive will result in a number with a + sign." (setq amount (or amount 1)) (setq padded -(if (co
[nongnu] elpa/evil-numbers 434298ed9a 1/2: Auto format using elisp-autofmt
branch: elpa/evil-numbers commit 434298ed9a62839f75bf9d624aa86405a8703646 Author: Campbell Barton Commit: Campbell Barton Auto format using elisp-autofmt Avoids the need for manual formatting. --- .elisp-autofmt | 0 evil-numbers.el | 259 +-- tests/evil-numbers-tests.el | 320 +++- 3 files changed, 327 insertions(+), 252 deletions(-) diff --git a/.elisp-autofmt b/.elisp-autofmt new file mode 100644 index 00..e69de29bb2 diff --git a/evil-numbers.el b/evil-numbers.el index 6a5fc3e743..fa897f073c 100644 --- a/evil-numbers.el +++ b/evil-numbers.el @@ -80,7 +80,9 @@ :group 'convenience) (define-obsolete-variable-alias - 'evil-numbers/padDefault 'evil-numbers-pad-default "evil-numbers v0.6") + 'evil-numbers/padDefault + 'evil-numbers-pad-default + "evil-numbers v0.6") (defcustom evil-numbers-pad-default nil "Whether numbers are padded by default." @@ -209,14 +211,18 @@ representation of NUMBER is smaller." (defun evil-numbers--format (num width base) "Format NUM with at least WIDTH space in BASE." (cond - ((= base 2) (evil-numbers--format-binary num width)) - ((= base 8) (format (format "%%0%do" width) num)) - ((= base 16) (format (format "%%0%dX" width) num)) - ((= base 10) (format (format "%%0%dd" width) num)) - (t ""))) - -(defun evil-numbers--skip-chars-impl -(ch-skip ch-sep-optional dir ch-num limit) + ((= base 2) +(evil-numbers--format-binary num width)) + ((= base 8) +(format (format "%%0%do" width) num)) + ((= base 16) +(format (format "%%0%dX" width) num)) + ((= base 10) +(format (format "%%0%dd" width) num)) + (t +""))) + +(defun evil-numbers--skip-chars-impl (ch-skip ch-sep-optional dir ch-num limit) "Wrapper for `skip-chars-forward' and `skip-chars-backward'. CH-SKIP: Characters to skip. @@ -225,17 +231,20 @@ DIR: Direction to step in (1 -1). CH-NUM: Number of characters to step. LIMIT: Point which will not be stepped past." (let* ((is-forward (< 0 dir)) - (skip-chars-fn (if is-forward -#'skip-chars-forward - #'skip-chars-backward)) - (clamp-fn (if is-forward - #'min - #'max)) + (skip-chars-fn + (if is-forward + #'skip-chars-forward +#'skip-chars-backward)) + (clamp-fn + (if is-forward + #'min +#'max)) (skipped - (abs (funcall -skip-chars-fn ch-skip -;; Limit. -(funcall clamp-fn (+ (point) (* ch-num dir)) limit) + (abs + (funcall skip-chars-fn +ch-skip +;; Limit. +(funcall clamp-fn (+ (point) (* ch-num dir)) limit) ;; Step over single separators, as long as there is a number after them. ;; Allow '100,123' and '16_777_216' to be handled as single numbers. @@ -245,16 +254,24 @@ LIMIT: Point which will not be stepped past." (setq ch-num (- ch-num skipped)) (while (and (not (zerop ch-num)) (save-excursion - (and (eq 1 (evil-numbers--skip-chars-impl - ch-sep-optional nil - dir 1 limit)) + (and (eq +1 +(evil-numbers--skip-chars-impl + ch-sep-optional + nil + dir + 1 + limit)) (progn ;; Note counted towards 'skipped' ;; as this character is to be ignored entirely. (setq skipped-next (evil-numbers--skip-chars-impl -ch-skip nil -dir ch-num limit)) +ch-skip +nil +dir +ch-num +limit)) (unless (zerop skipped-next) (setq point-next (point)) ;; Found (apply `point-new'). @@ -290,7 +307,9 @@ Each item in MATCH-CHARS is a cons pair. (match-list (list))) ;; Sanity check. - (when (if is-forward (> (point) limit) (< (point) limit)) + (when (if is-forward +(> (point) limit) + (< (point) limit)) (error "Limit is on wrong side of point (internal error)")) (unless is-forward @@ -305,14 +324,22 @@ Each item in MATCH-CHARS is a cons pair. ((integerp ch-num)
[elpa] externals/compat 69a69fa23e: while-let: Test the single binding case
branch: externals/compat commit 69a69fa23ea01406f8b5b43adf3de885e668cced Author: Daniel Mendler Commit: Daniel Mendler while-let: Test the single binding case bug#60758 --- compat-25.el| 3 +-- compat-29.el| 3 +++ compat-tests.el | 14 ++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/compat-25.el b/compat-25.el index 42fa9e0a5a..bc9449b7f0 100644 --- a/compat-25.el +++ b/compat-25.el @@ -120,8 +120,7 @@ with an old syntax that accepted only one binding." (debug ([&or (symbolp form) (&rest [&or symbolp (symbolp form) (form)])] body))) - (when (and (<= (length spec) 2) - (not (listp (car spec + (when (and (<= (length spec) 2) (not (listp (car spec ;; Adjust the single binding case (setq spec (list spec))) (let ((empty (make-symbol "s")) diff --git a/compat-29.el b/compat-29.el index bcee2bd975..819988b3a9 100644 --- a/compat-29.el +++ b/compat-29.el @@ -333,6 +333,9 @@ If all bindings are non-nil, eval BODY and repeat. The variable list SPEC is the same as in `if-let'." (declare (indent 1) (debug if-let)) + (when (and (<= (length spec) 2) (not (listp (car spec +;; Adjust the single binding case +(setq spec (list spec))) (let ((done (gensym "done"))) `(catch ',done (while t diff --git a/compat-tests.el b/compat-tests.el index f03d6c6e90..854903cd72 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -46,6 +46,10 @@ (defmacro should-equal (a b) `(should (equal ,a ,b))) +(defmacro compat-tests--if (cond then &rest else) + (declare (indent 2)) + (if (eval cond t) then (macroexp-progn else))) + (ert-deftest compat-loaded-features () (let ((version 0)) (while (< version 30) @@ -1563,6 +1567,12 @@ (should-not (boundp 'compat-tests--dlet2))) (ert-deftest while-let () + ;; FIXME: Reenable this test on Emacs 29 and 30 (bug#60758) + (compat-tests--if (< emacs-major-version 29) +(let ((list '(1 2 3 4)) rev) + (while-let (x (pop list)) +(push x rev)) + (should-equal '(4 3 2 1) rev))) (let ((first '(1 2 3 4)) (second '(a b c)) zipped) (while-let ((x (pop first)) (y (pop second))) (push (cons x y) zipped)) @@ -1592,10 +1602,6 @@ (should-equal "else" (if-let* (((= 5 6))) "then" "else"))) -(defmacro compat-tests--if (cond then &rest else) - (declare (indent 2)) - (if cond then (macroexp-progn else))) - (ert-deftest when-let () ;; FIXME Broken on Emacs 25 (compat-tests--if (= emacs-major-version 25)