[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/leaf a1442a8 29/46: Merge branch 'master' into find-fun
From: |
Stefan Monnier |
Subject: |
[elpa] externals/leaf a1442a8 29/46: Merge branch 'master' into find-func |
Date: |
Mon, 15 Mar 2021 22:20:45 -0400 (EDT) |
branch: externals/leaf
commit a1442a8e44d733d65a0533d2bb06117d3f094e9d
Merge: 005481d b07b728
Author: Naoya Yamashita <conao3@gmail.com>
Commit: GitHub <noreply@github.com>
Merge branch 'master' into find-func
---
leaf-tests.el | 96 +++++++++++++++++++++++++++++------------------------------
leaf.el | 38 +++++++++++++++++------
2 files changed, 77 insertions(+), 57 deletions(-)
diff --git a/leaf-tests.el b/leaf-tests.el
index a0fbcf5..e8e4071 100644
--- a/leaf-tests.el
+++ b/leaf-tests.el
@@ -854,11 +854,11 @@ Example:
(foo-package-to-function . #'ignore)
(foo-package-to-lambda . (lambda (elm) (message elm))))
(prog1 'foo-package
- (customize-set-variable 'foo-package-to-enable t "Customized with leaf
in foo-package block")
- (customize-set-variable 'foo-package-to-disable nil "Customized with
leaf in foo-package block")
- (customize-set-variable 'foo-package-to-symbol 'symbol "Customized with
leaf in foo-package block")
- (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in foo-package block")
- (customize-set-variable 'foo-package-to-lambda (lambda (elm) (message
elm)) "Customized with leaf in foo-package block")))
+ (customize-set-variable 'foo-package-to-enable t "Customized with leaf
in `foo-package' block")
+ (customize-set-variable 'foo-package-to-disable nil "Customized with
leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-symbol 'symbol "Customized with
leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-lambda (lambda (elm) (message
elm)) "Customized with leaf in `foo-package' block")))
;; multi cons-cell in list will be accepted
((leaf foo-package
@@ -868,23 +868,23 @@ Example:
(foo-package-to-function . #'ignore)
(foo-package-to-lambda . (lambda (elm) (message elm)))))
(prog1 'foo-package
- (customize-set-variable 'foo-package-to-enable t "Customized with leaf
in foo-package block")
- (customize-set-variable 'foo-package-to-disable nil "Customized with
leaf in foo-package block")
- (customize-set-variable 'foo-package-to-symbol 'symbol "Customized with
leaf in foo-package block")
- (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in foo-package block")
- (customize-set-variable 'foo-package-to-lambda (lambda (elm) (message
elm)) "Customized with leaf in foo-package block")))
+ (customize-set-variable 'foo-package-to-enable t "Customized with leaf
in `foo-package' block")
+ (customize-set-variable 'foo-package-to-disable nil "Customized with
leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-symbol 'symbol "Customized with
leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-lambda (lambda (elm) (message
elm)) "Customized with leaf in `foo-package' block")))
;; distribution feature is supported
((leaf foo-package
:custom (((to-enable1 to-enable2 to-enable3) . t)
((to-disable1 to-disable2 to-disable3) . nil)))
(prog1 'foo-package
- (customize-set-variable 'to-enable1 t "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-enable2 t "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-enable3 t "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-disable1 nil "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-disable2 nil "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-disable3 nil "Customized with leaf in
foo-package block")))
+ (customize-set-variable 'to-enable1 t "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-enable2 t "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-enable3 t "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-disable1 nil "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-disable2 nil "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-disable3 nil "Customized with leaf in
`foo-package' block")))
;; and mix specification is accepted
((leaf foo-package
@@ -894,15 +894,15 @@ Example:
(((to-enable1 to-enable2 to-enable3) . t)
((to-disable1 to-disable2 to-disable3) . nil)))
(prog1 'foo-package
- (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in foo-package block")
- (customize-set-variable 'to-symbol1 'baz "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-symbol2 'baz "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-enable1 t "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-enable2 t "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-enable3 t "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-disable1 nil "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-disable2 nil "Customized with leaf in
foo-package block")
- (customize-set-variable 'to-disable3 nil "Customized with leaf in
foo-package block")))))
+ (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in `foo-package' block")
+ (customize-set-variable 'to-symbol1 'baz "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-symbol2 'baz "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-enable1 t "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-enable2 t "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-enable3 t "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-disable1 nil "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-disable2 nil "Customized with leaf in
`foo-package' block")
+ (customize-set-variable 'to-disable3 nil "Customized with leaf in
`foo-package' block")))))
(cort-deftest-with-macroexpand leaf/custom*
'(
@@ -929,11 +929,11 @@ Example:
(foo-package-to-function #'ignore)
(foo-package-to-lambda (lambda (elm) (message elm)))))
(prog1 'foo-package
- (customize-set-variable 'foo-package-to-enable t "Customized with leaf
in foo-package block")
- (customize-set-variable 'foo-package-to-disable nil "Customized with
leaf in foo-package block")
- (customize-set-variable 'foo-package-to-symbol 'symbol "Customized with
leaf in foo-package block")
- (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in foo-package block")
- (customize-set-variable 'foo-package-to-lambda (lambda (elm) (message
elm)) "Customized with leaf in foo-package block")))
+ (customize-set-variable 'foo-package-to-enable t "Customized with leaf
in `foo-package' block")
+ (customize-set-variable 'foo-package-to-disable nil "Customized with
leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-symbol 'symbol "Customized with
leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-function #'ignore "Customized
with leaf in `foo-package' block")
+ (customize-set-variable 'foo-package-to-lambda (lambda (elm) (message
elm)) "Customized with leaf in `foo-package' block")))
;; distribution feature is supported
;; ((leaf foo-package
@@ -974,7 +974,7 @@ Example:
(eruby-standard-face . '((t (:slant italic)))))
(prog1 'eruby-mode
(custom-set-faces
- '(eruby-standard-face ((t (:slant italic))) nil "Customized with leaf
in eruby-mode block"))))
+ '(eruby-standard-face ((t (:slant italic))) nil "Customized with leaf
in `eruby-mode' block"))))
;; distribution feature is supported
((leaf eruby-mode
@@ -982,8 +982,8 @@ Example:
((default eruby-standard-face) . '((t (:slant italic)))))
(prog1 'eruby-mode
(custom-set-faces
- '(default ((t (:slant italic))) nil "Customized with leaf in
eruby-mode block")
- '(eruby-standard-face ((t (:slant italic))) nil "Customized with leaf
in eruby-mode block"))))))
+ '(default ((t (:slant italic))) nil "Customized with leaf in
`eruby-mode' block")
+ '(eruby-standard-face ((t (:slant italic))) nil "Customized with leaf
in `eruby-mode' block"))))))
(cort-deftest-with-macroexpand leaf/pl-custom
'(
@@ -992,7 +992,7 @@ Example:
:pl-custom
(sql-connection-alist . some-plstore))
(prog1 'sql
- (customize-set-variable 'sql-connection-alist (leaf-handler-auth sql
sql-connection-alist some-plstore) "Customized in leaf `sql' from plstore
`some-plstore'")))
+ (customize-set-variable 'sql-connection-alist (leaf-handler-auth sql
sql-connection-alist some-plstore) "Customized with leaf in `sql' block using
`some-plstore' plstore")))
;; Emulate customizing `erc-password' and `erc-nickserv-passwords'
;; with values taken from `some-plstore', and `erc-user-full-name'
@@ -1002,17 +1002,17 @@ Example:
((erc-password erc-nickserv-passwords) . some-plstore)
((erc-user-full-name erc-nick) . another-plstore))
(prog1 'erc
- (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password some-plstore) "Customized in leaf `erc' from plstore
`some-plstore'")
- (customize-set-variable 'erc-nickserv-passwords (leaf-handler-auth erc
erc-nickserv-passwords some-plstore) "Customized in leaf `erc' from plstore
`some-plstore'")
- (customize-set-variable 'erc-user-full-name (leaf-handler-auth erc
erc-user-full-name another-plstore) "Customized in leaf `erc' from plstore
`another-plstore'")
- (customize-set-variable 'erc-nick (leaf-handler-auth erc
erc-nick another-plstore) "Customized in leaf `erc' from plstore
`another-plstore'")))
+ (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password some-plstore) "Customized with leaf in `erc' block using
`some-plstore' plstore")
+ (customize-set-variable 'erc-nickserv-passwords (leaf-handler-auth erc
erc-nickserv-passwords some-plstore) "Customized with leaf in `erc' block using
`some-plstore' plstore")
+ (customize-set-variable 'erc-user-full-name (leaf-handler-auth erc
erc-user-full-name another-plstore) "Customized with leaf in `erc' block using
`another-plstore' plstore")
+ (customize-set-variable 'erc-nick (leaf-handler-auth erc
erc-nick another-plstore) "Customized with leaf in `erc' block using
`another-plstore' plstore")))
;; you can use symbol to configure with `leaf-default-plstore'.
((leaf erc
:pl-custom erc-nick erc-password)
(prog1 'erc
- (customize-set-variable 'erc-nick (leaf-handler-auth erc erc-nick
leaf-default-plstore) "Customized in leaf `erc' from plstore
`leaf-default-plstore'")
- (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password leaf-default-plstore) "Customized in leaf `erc' from plstore
`leaf-default-plstore'")))))
+ (customize-set-variable 'erc-nick (leaf-handler-auth erc erc-nick
leaf-default-plstore) "Customized with leaf in `erc' block using
`leaf-default-plstore' plstore")
+ (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password leaf-default-plstore) "Customized with leaf in `erc' block using
`leaf-default-plstore' plstore")))))
(cort-deftest-with-macroexpand leaf/bind
'(
@@ -2039,7 +2039,7 @@ Example:
(prog1 'sql
(customize-set-variable 'sql-connection-alist
(leaf-handler-auth sql sql-connection-alist
some-plstore)
- "Customized in leaf `sql' from plstore
`some-plstore'")))
+ "Customized with leaf in `sql' block using
`some-plstore' plstore")))
;; Emulate customizing `erc-password' and `erc-nickserv-passwords'
;; with values taken from `some-plstore', and `erc-user-full-name'
@@ -2049,17 +2049,17 @@ Example:
((erc-password erc-nickserv-passwords) . some-plstore)
((erc-user-full-name erc-nick) . another-plstore))
(prog1 'erc
- (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password some-plstore) "Customized in leaf `erc' from plstore
`some-plstore'")
- (customize-set-variable 'erc-nickserv-passwords (leaf-handler-auth erc
erc-nickserv-passwords some-plstore) "Customized in leaf `erc' from plstore
`some-plstore'")
- (customize-set-variable 'erc-user-full-name (leaf-handler-auth erc
erc-user-full-name another-plstore) "Customized in leaf `erc' from plstore
`another-plstore'")
- (customize-set-variable 'erc-nick (leaf-handler-auth erc
erc-nick another-plstore) "Customized in leaf `erc' from plstore
`another-plstore'")))
+ (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password some-plstore) "Customized with leaf in `erc' block using
`some-plstore' plstore")
+ (customize-set-variable 'erc-nickserv-passwords (leaf-handler-auth erc
erc-nickserv-passwords some-plstore) "Customized with leaf in `erc' block using
`some-plstore' plstore")
+ (customize-set-variable 'erc-user-full-name (leaf-handler-auth erc
erc-user-full-name another-plstore) "Customized with leaf in `erc' block using
`another-plstore' plstore")
+ (customize-set-variable 'erc-nick (leaf-handler-auth erc
erc-nick another-plstore) "Customized with leaf in `erc' block using
`another-plstore' plstore")))
;; you can use symbol to configure with `leaf-default-plstore'.
((leaf erc
:auth-custom erc-nick erc-password)
(prog1 'erc
- (customize-set-variable 'erc-nick (leaf-handler-auth erc erc-nick
leaf-default-plstore) "Customized in leaf `erc' from plstore
`leaf-default-plstore'")
- (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password leaf-default-plstore) "Customized in leaf `erc' from plstore
`leaf-default-plstore'")))))
+ (customize-set-variable 'erc-nick (leaf-handler-auth erc erc-nick
leaf-default-plstore) "Customized with leaf in `erc' block using
`leaf-default-plstore' plstore")
+ (customize-set-variable 'erc-password (leaf-handler-auth erc
erc-password leaf-default-plstore) "Customized with leaf in `erc' block using
`leaf-default-plstore' plstore")))))
(cort-deftest-with-macroexpand leaf/auth-setq
'(
@@ -2262,7 +2262,7 @@ Example:
(package-install 'macrostep))
(error
(display-warning 'leaf
- (format "In `macrostep' block, failed to
:package of macrostep. Error msg: %s"
+ (format "In `macrostep' block, failed to
:package of `macrostep'. Error msg: %s"
(error-message-string err)))))))))))
(when (version< "24.0" emacs-version)
diff --git a/leaf.el b/leaf.el
index 7bc74df..c5cedbb 100644
--- a/leaf.el
+++ b/leaf.el
@@ -136,11 +136,11 @@ Same as `list' but this macro does not evaluate any
arguments."
:pl-pre-setq `(,@(mapcar (lambda (elm) `(setq ,(car elm)
(leaf-handler-auth ,leaf--name ,(car elm) ,(cdr elm)))) leaf--value)
,@leaf--body)
:auth-pre-setq `(,@(mapcar (lambda (elm) `(setq ,(car elm)
(leaf-handler-auth ,leaf--name ,(car elm) ,(cdr elm)))) leaf--value)
,@leaf--body)
- :custom `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) ,(cdr elm) ,(format "Customized with leaf in %s block"
leaf--name))) leaf--value) ,@leaf--body)
- :custom* `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) ,(cdr elm) ,(format "Customized with leaf in %s block"
leaf--name))) leaf--value) ,@leaf--body)
- :pl-custom `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) (leaf-handler-auth ,leaf--name ,(car elm) ,(cdr elm)) ,(format
"Customized in leaf `%s' from plstore `%s'" leaf--name (symbol-name (cdr
elm))))) leaf--value) ,@leaf--body)
- :auth-custom `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) (leaf-handler-auth ,leaf--name ,(car elm) ,(cdr elm)) ,(format
"Customized in leaf `%s' from plstore `%s'" leaf--name (symbol-name (cdr
elm))))) leaf--value) ,@leaf--body)
- :custom-face `((custom-set-faces ,@(mapcar (lambda (elm) `'(,(car
elm) ,(car (cddr elm)) nil ,(format "Customized with leaf in %s block"
leaf--name))) leaf--value)) ,@leaf--body)
+ :custom `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) ,(cdr elm) ,(leaf--create-custom-comment :custom))) leaf--value)
,@leaf--body)
+ :custom* `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) ,(cdr elm) ,(leaf--create-custom-comment :custom*))) leaf--value)
,@leaf--body)
+ :pl-custom `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) (leaf-handler-auth ,leaf--name ,(car elm) ,(cdr elm))
,(leaf--create-custom-comment :pl-custom (cdr elm)))) leaf--value) ,@leaf--body)
+ :auth-custom `(,@(mapcar (lambda (elm) `(customize-set-variable
',(car elm) (leaf-handler-auth ,leaf--name ,(car elm) ,(cdr elm))
,(leaf--create-custom-comment :auth-custom (cdr elm)))) leaf--value)
,@leaf--body)
+ :custom-face `((custom-set-faces ,@(mapcar (lambda (elm) `'(,(car
elm) ,(car (cddr elm)) nil ,(leaf--create-custom-comment :custom-face)))
leaf--value)) ,@leaf--body)
:init `(,@leaf--value ,@leaf--body)
:require `(,@(mapcar (lambda (elm) `(require ',elm)) leaf--value)
,@leaf--body)
@@ -596,6 +596,16 @@ see `alist-get'."
"Raise error with type leaf. MESSAGE and ARGS is same form as `lwarn'."
(apply #'lwarn `(leaf :error ,message ,@args)))
+(defun leaf--create-custom-comment (type &rest args)
+ "Create message for TYPE using ARGS."
+ (concat
+ (format "Customized with leaf in `%s' block" leaf--name)
+ (when (memq type '(:pl-custom :auth-custom))
+ (let* ((store (pop args)))
+ (format " using `%s' plstore" store)))
+ (when load-file-name
+ (format " at `%s'" load-file-name))))
+
;;;; General functions for leaf
@@ -940,8 +950,14 @@ FN also accept list of FN."
`(condition-case err
(progn ,@body)
(error
- (display-warning 'leaf (format ,(format "Error in `%s' block. Error
msg: %%s" name)
- (error-message-string err))))))
+ (display-warning 'leaf (format
+ ,(concat
+ (format "Error in `%s' block" name)
+ (when load-file-name
+ (format " at `%s'" load-file-name))
+ "."
+ " Error msg: %s")
+ (error-message-string err))))))
(defmacro leaf-handler-leaf-path (name)
"Meta handler for :leaf-path for NAME."
@@ -966,8 +982,12 @@ FN also accept list of FN."
(error
(display-warning 'leaf
(format
- ,(format "In `%s' block, failed to :package of
%s. Error msg: %%s"
- name pkg)
+ ,(concat
+ (format "In `%s' block" name)
+ (when load-file-name
+ (format " at `%s'" load-file-name))
+ (format ", failed to :package of `%s'." pkg)
+ " Error msg: %s")
(error-message-string err)))))))))
(defmacro leaf-handler-auth (name sym store)
- [elpa] externals/leaf 562885f 08/46: README: add documentation about the leaf-find, (continued)
- [elpa] externals/leaf 562885f 08/46: README: add documentation about the leaf-find, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf c5ddde8 09/46: leaf-path: add test, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf a82c47d 10/46: add :commands* keyword, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf ad2d3ee 12/46: Merge pull request #472 from conao3/feature#471, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf 2edf0fc 20/46: use eq to compare symbols, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf b07b728 16/46: Merge pull request #476 from conao3/feature#475, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf edb220a 23/46: use eval-after-load for old Emacs<=24.3, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf 8d68ff9 30/46: Merge pull request #469 from Z572/find-func, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf cfa1047 32/46: add leaf-find-function-support to configure find-func integration, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf f0a1cf9 17/46: use backquote instead of cons, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf a1442a8 29/46: Merge branch 'master' into find-func,
Stefan Monnier <=
- [elpa] externals/leaf d0f9ceb 25/46: fix testcases, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf b04f3ba 36/46: tagged v4.3.8, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf bc78da0 38/46: Let the leaf-key-describe-bindings with a path, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf 539758b 26/46: add testcases, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf ce10d84 22/46: use mapcan for old Emacs<=27.1, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf 3e28eb0 31/46: fix list minor issue, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf 641672c 35/46: expand leaf--paths initialize sexp, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf 896da3e 44/46: fix leaf-find-regexp., Stefan Monnier, 2021/03/15
- [elpa] externals/leaf b1fe4f2 46/46: Merge pull request #481 from Z572/fix-leaf-find-regexp, Stefan Monnier, 2021/03/15
- [elpa] externals/leaf b64a2fa 40/46: fix test, Stefan Monnier, 2021/03/15