[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/leaf 1274e35 11/18: Merge remote-tracking branch 'origi
From: |
Stefan Monnier |
Subject: |
[elpa] externals/leaf 1274e35 11/18: Merge remote-tracking branch 'origin/master' into fix-leaf-find-in-embedded-leaf-block |
Date: |
Wed, 2 Jun 2021 18:28:02 -0400 (EDT) |
branch: externals/leaf
commit 1274e355f463defa31a6fc337d92110c01019869
Merge: 8a78547 eb8ce41
Author: Naoya Yamashita <conao3@gmail.com>
Commit: Naoya Yamashita <conao3@gmail.com>
Merge remote-tracking branch 'origin/master' into
fix-leaf-find-in-embedded-leaf-block
---
leaf-tests.el | 12 ++++++------
leaf.el | 32 +++++++++++++++++++++++---------
2 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/leaf-tests.el b/leaf-tests.el
index f786db0..3a8e607 100644
--- a/leaf-tests.el
+++ b/leaf-tests.el
@@ -2409,37 +2409,37 @@ Example:
'(((leaf-key "C-M-i" 'flyspell-correct-wrapper)
(let* ((old (lookup-key global-map (kbd "C-M-i")))
(value `(global-map "C-M-i" flyspell-correct-wrapper ,(and old
(not (numberp old)) old) nil)))
- (push value leaf-key-bindlist)
+ (leaf-safe-push value leaf-key-bindlist)
(define-key global-map (kbd "C-M-i") 'flyspell-correct-wrapper)))
((leaf-key [remap backward-sentence] 'sh-beginning-of-command)
(let* ((old (lookup-key global-map [remap backward-sentence]))
(value `(global-map "<remap> <backward-sentence>"
sh-beginning-of-command ,(and old (not (numberp old)) old) nil)))
- (push value leaf-key-bindlist)
+ (leaf-safe-push value leaf-key-bindlist)
(define-key global-map [remap backward-sentence]
'sh-beginning-of-command)))
((leaf-key "C-M-i" 'flyspell-correct-wrapper 'c-mode-map)
(let* ((old (lookup-key c-mode-map (kbd "C-M-i")))
(value `(c-mode-map "C-M-i" flyspell-correct-wrapper ,(and old
(not (numberp old)) old) nil)))
- (push value leaf-key-bindlist)
+ (leaf-safe-push value leaf-key-bindlist)
(define-key c-mode-map (kbd "C-M-i") 'flyspell-correct-wrapper)))
((leaf-key [remap backward-sentence] 'sh-beginning-of-command
'shell-mode-map)
(let* ((old (lookup-key shell-mode-map [remap backward-sentence]))
(value `(shell-mode-map "<remap> <backward-sentence>"
sh-beginning-of-command ,(and old (not (numberp old)) old) nil)))
- (push value leaf-key-bindlist)
+ (leaf-safe-push value leaf-key-bindlist)
(define-key shell-mode-map [remap backward-sentence]
'sh-beginning-of-command)))
((leaf-key (vector 'key-chord ?i ?j) 'undo nil)
(let* ((old (lookup-key global-map [key-chord 105 106]))
(value `(global-map "<key-chord> i j" undo ,(and old (not
(numberp old)) old) nil)))
- (push value leaf-key-bindlist)
+ (leaf-safe-push value leaf-key-bindlist)
(define-key global-map [key-chord 105 106] 'undo)))
((leaf-key [(control ?x) (control ?f)] 'undo)
(let* ((old (lookup-key global-map [(control 120) (control 102)]))
(value `(global-map "C-x C-f" undo ,(and old (not (numberp old))
old) nil)))
- (push value leaf-key-bindlist)
+ (leaf-safe-push value leaf-key-bindlist)
(define-key global-map [(control 120) (control 102)] 'undo))))))
(when (version< "24.0" emacs-version)
diff --git a/leaf.el b/leaf.el
index ee9eaef..ce62eda 100644
--- a/leaf.el
+++ b/leaf.el
@@ -5,7 +5,7 @@
;; Author: Naoya Yamashita <conao3@gmail.com>
;; Maintainer: Naoya Yamashita <conao3@gmail.com>
;; Keywords: lisp settings
-;; Version: 4.4.4
+;; Version: 4.4.6
;; URL: https://github.com/conao3/leaf.el
;; Package-Requires: ((emacs "24.1"))
@@ -362,15 +362,21 @@ Sort by `leaf-sort-leaf--values-plist' in this order.")
(defcustom leaf-defaults '()
"The value that are interpreted as specified for all `leaf' blocks."
- :type 'sexp
+ :type '(plist :key-type (choice (const :leaf-autoload)
+ (const :leaf-defer)
+ (const :leaf-protect)
+ (const :leaf-defun)
+ (const :leaf-defvar)
+ (const :leaf-path)
+ (symbol :tag "A keyword in `M-x
leaf-available-keywords`"))
+ :value-type (choice boolean
+ (sexp :tag "Default value of the
keyword")))
:group 'leaf)
-(defcustom leaf-system-defaults (leaf-list
- :leaf-autoload t :leaf-defer t :leaf-protect t
- :leaf-defun t :leaf-defvar t :leaf-path t)
- "The value for all `leaf' blocks for leaf system."
- :type 'sexp
- :group 'leaf)
+(defvar leaf-system-defaults (list
+ :leaf-autoload t :leaf-defer t :leaf-protect t
+ :leaf-defun t :leaf-defvar t :leaf-path t)
+ "The value for all `leaf' blocks for leaf system.")
(defcustom leaf-defer-keywords (list
:bind :bind*
@@ -768,6 +774,14 @@ see `alist-get'."
(indent-region (point-min) (point-max))
(display-buffer buf))))
+(defmacro leaf-safe-push (newelt place)
+ "Safely add NEWELT to the list stored in the generalized variable PLACE.
+This is equivalent to `push' if PLACE is bound, otherwise, `setq'
+is used to define a new list."
+ `(if (boundp ',place)
+ (push ,newelt ,place)
+ (setq ,place (list ,newelt))))
+
;;;; find-function
@@ -840,7 +854,7 @@ For example:
(mstr (if (stringp key*) key* (key-description key*))))
`(let* ((old (lookup-key ,mmap ,(if vecp key* `(kbd ,key*))))
(value ,(list '\` `(,mmap ,mstr ,command* ,',(and old (not
(numberp old)) old) ,path))))
- (push value leaf-key-bindlist)
+ (leaf-safe-push value leaf-key-bindlist)
(define-key ,mmap ,(if vecp key* `(kbd ,key*)) ',command*))))
(defmacro leaf-key* (key command)
- [elpa] externals/leaf eb5aed9 01/18: Add custom type for leaf-defaults and change leaf-system-defaults to defvar, (continued)
- [elpa] externals/leaf eb5aed9 01/18: Add custom type for leaf-defaults and change leaf-system-defaults to defvar, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf 1263f8a 05/18: tagged v4.4.5, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf 39c3bac 12/18: use leaf-this-file instead of hardcoding, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf c565595 13/18: tagged v4.4.7, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf 4d48501 08/18: Merge remote-tracking branch 'origin/master' into refactor/typing-leaf-defaults, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf eb8ce41 10/18: Merge pull request #490 from zonuexe/refactor/typing-leaf-defaults, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf ad3b6a0 16/18: fix testcases, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf d3a0f73 17/18: tagged v4.4.8, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf 75914b5 07/18: mention leaf-available-keywords instead of leaf-system-defaults, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf 9e9d06c 09/18: tagged v4.4.6, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf 1274e35 11/18: Merge remote-tracking branch 'origin/master' into fix-leaf-find-in-embedded-leaf-block,
Stefan Monnier <=
- [elpa] externals/leaf 256abf5 14/18: Merge pull request #492 from Z572/fix-leaf-find-in-embedded-leaf-block, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf b4b21de 15/18: add :leaf-defer-let system keyword and move :leaf-defer `let` hack, Stefan Monnier, 2021/06/02
- [elpa] externals/leaf bf870b1 18/18: Merge pull request #495 from conao3/feature#494, Stefan Monnier, 2021/06/02