From cf27ae1cc7d217eaf5593d56174ebd0ac89e8317 Mon Sep 17 00:00:00 2001 From: conao3 Date: Thu, 11 Jul 2019 00:35:24 +0900 Subject: [PATCH 1/2] move :advice and :advice-remove documentation in misc part --- README.org | 296 ++++++++++++++++++++++++++--------------------------- 1 file changed, 148 insertions(+), 148 deletions(-) diff --git a/README.org b/README.org index d927bc8..b769ecc 100644 --- a/README.org +++ b/README.org @@ -26,7 +26,6 @@ - [[https://github.com/conao3/leaf.el#commands-keyword][:commands keyword]] - [[https://github.com/conao3/leaf.el#after-keyword][:after keyword]] - [[https://github.com/conao3/leaf.el#bind-bind-keywords][:bind, :bind* keywords]] - - [[#advice-advice-remove-keywords][:advice, :advice-remove keyword]] - [[https://github.com/conao3/leaf.el#configure-variables-keywords][Configure variables keywords]] - [[https://github.com/conao3/leaf.el#custom-custom-face-keywords][:custom, :custom-face keywords]] - [[https://github.com/conao3/leaf.el#pre-setq-setq-setq-default-keywords][:pre-setq, :setq, :setq-default keywords]] @@ -43,6 +42,7 @@ - [[https://github.com/conao3/leaf.el#documentation-keywords][Documentation keywords]] - [[https://github.com/conao3/leaf.el#doc-file-url-keywords][:doc, :file, :url keywords]] - [[https://github.com/conao3/leaf.el#misc-keywords][Misc keywords]] + - [[#advice-advice-remove-keywords][:advice, :advice-remove keyword]] - [[https://github.com/conao3/leaf.el#pl-pre-setq-pl-setq-pl-setq-default-pl-custom-keywords][:pl-pre-setq, :pl-setq, :pl-setq-default, :pl-custom keywords]] - [[#system-keywords][System keywords]] - [[#leaf-protect-keyword][:leaf-protect keyword]] @@ -664,153 +664,6 @@ If you omit ~:package~, use leaf-block name as ~:package~ to lazy load. ("M-O" . isearch-moccur-all)))))))) #+end_src -** :advice, :advice-remove keywords -~:advice~ provide frontend of ~advice-add~, and ~:advice-remove~ provide frontend of ~advice-remove~. - -~:advice~ keyword accept list of ~(WHERE SYMBOL FUNCTION)~ or nested it. - -You can use all ~WHERE~ symbol such as -(~:around~ ~:before~ ~:after~ ~:override~ ~:after-until~ ~:after-while~ ~:before-until~ ~:before-while~ ~:filter-args~ ~:filter-return~) - -~SYMBOL~ is the adviced function symbol, ~FUNCTION~ is advice function symbol or lambda form. - -~:advice-remove~ must not specify ~WHERE~ keyword. - -#+begin_src emacs-lisp - (cort-deftest-with-macroexpand leaf/advice - '(((leaf leaf - :preface - (defun matu (x) - (princ (format ">>%s<<" x)) - nil) - (defun matu-around0 (f &rest args) - (prog2 - (princ "around0 ==>") - (apply f args) - (princ "around0 <=="))) - (defun matu-before0 (&rest args) - (princ "before0:")) - :advice - (:around matu matu-around0) - (:before matu matu-before0)) - (prog1 'leaf - (autoload #'matu-around0 "leaf" nil t) - (autoload #'matu-before0 "leaf" nil t) - (defun matu (x) - (princ - (format ">>%s<<" x)) - nil) - (defun matu-around0 - (f &rest args) - (prog2 - (princ "around0 ==>") - (apply f args) - (princ "around0 <=="))) - (defun matu-before0 - (&rest args) - (princ "before0:")) - (advice-add 'matu :around #'matu-around0) - (advice-add 'matu :before #'matu-before0))) - - ((leaf leaf - :preface - (defun matu (x) - (princ (format ">>%s<<" x)) - nil) - (defun matu-around0 (f &rest args) - (prog2 - (princ "around0 ==>") - (apply f args) - (princ "around0 <=="))) - (defun matu-before0 (&rest args) - (princ "before0:")) - :advice ((:around matu matu-around0) - (:before matu matu-before0))) - (prog1 'leaf - (autoload #'matu-around0 "leaf" nil t) - (autoload #'matu-before0 "leaf" nil t) - (defun matu (x) - (princ - (format ">>%s<<" x)) - nil) - (defun matu-around0 - (f &rest args) - (prog2 - (princ "around0 ==>") - (apply f args) - (princ "around0 <=="))) - (defun matu-before0 - (&rest args) - (princ "before0:")) - (advice-add 'matu :around #'matu-around0) - (advice-add 'matu :before #'matu-before0))) - - ((leaf leaf - :preface - (defun matu (x) - (princ (format ">>%s<<" x)) - nil) - (defun matu-around0 (f &rest args) - (prog2 - (princ "around0 ==>") - (apply f args) - (princ "around0 <=="))) - (defun matu-before0 (&rest args) - (princ "before0:")) - :advice ((:around matu matu-around0) - (:before matu matu-before0) - (:around matu (lambda (f &rest args) - (prog2 - (princ "around1 ==>") - (apply f args) - (princ "around1 <==")))))) - (prog1 'leaf - (autoload #'matu-around0 "leaf" nil t) - (autoload #'matu-before0 "leaf" nil t) - (defun matu - (x) - (princ - (format ">>%s<<" x)) - nil) - (defun matu-around0 - (f &rest args) - (prog2 - (princ "around0 ==>") - (apply f args) - (princ "around0 <=="))) - (defun matu-before0 - (&rest args) - (princ "before0:")) - (advice-add 'matu :around #'matu-around0) - (advice-add 'matu :before #'matu-before0) - (advice-add 'matu :around (function - (lambda - (f &rest args) - (prog2 - (princ "around1 ==>") - (apply f args) - (princ "around1 <=="))))))))) - - (cort-deftest-with-macroexpand leaf/advice-remove - '(((leaf leaf - :advice-remove - (matu matu-around0) - (matu matu-before0)) - (prog1 'leaf - (autoload (function matu-before0) "leaf" nil t) - (autoload #'matu-around0 "leaf" nil t) - (advice-remove 'matu #'matu-around0) - (advice-remove 'matu #'matu-before0))) - - ((leaf leaf - :advice-remove ((:around matu matu-around0) - (:before matu matu-before0))) - (prog1 'leaf - (autoload #'matu "leaf" nil t) - (advice-remove ':around #'matu) - (advice-remove ':before #'matu))))) -#+end_src - ** COMMENT :defaults keyword ~:defalts~ provide to download recommended settings for specified package. For more detail, see [[https://github.com/conao3/leaf-defaults.git][leaf-defaults]]. @@ -1482,6 +1335,153 @@ The arguments specified for this keyword have no effect on the result of the con (leaf-init))))) #+END_SRC * Misc keywords +** :advice, :advice-remove keywords +~:advice~ provide frontend of ~advice-add~, and ~:advice-remove~ provide frontend of ~advice-remove~. + +~:advice~ keyword accept list of ~(WHERE SYMBOL FUNCTION)~ or nested it. + +You can use all ~WHERE~ symbol such as +(~:around~ ~:before~ ~:after~ ~:override~ ~:after-until~ ~:after-while~ ~:before-until~ ~:before-while~ ~:filter-args~ ~:filter-return~) + +~SYMBOL~ is the adviced function symbol, ~FUNCTION~ is advice function symbol or lambda form. + +~:advice-remove~ must not specify ~WHERE~ keyword. + +#+begin_src emacs-lisp + (cort-deftest-with-macroexpand leaf/advice + '(((leaf leaf + :preface + (defun matu (x) + (princ (format ">>%s<<" x)) + nil) + (defun matu-around0 (f &rest args) + (prog2 + (princ "around0 ==>") + (apply f args) + (princ "around0 <=="))) + (defun matu-before0 (&rest args) + (princ "before0:")) + :advice + (:around matu matu-around0) + (:before matu matu-before0)) + (prog1 'leaf + (autoload #'matu-around0 "leaf" nil t) + (autoload #'matu-before0 "leaf" nil t) + (defun matu (x) + (princ + (format ">>%s<<" x)) + nil) + (defun matu-around0 + (f &rest args) + (prog2 + (princ "around0 ==>") + (apply f args) + (princ "around0 <=="))) + (defun matu-before0 + (&rest args) + (princ "before0:")) + (advice-add 'matu :around #'matu-around0) + (advice-add 'matu :before #'matu-before0))) + + ((leaf leaf + :preface + (defun matu (x) + (princ (format ">>%s<<" x)) + nil) + (defun matu-around0 (f &rest args) + (prog2 + (princ "around0 ==>") + (apply f args) + (princ "around0 <=="))) + (defun matu-before0 (&rest args) + (princ "before0:")) + :advice ((:around matu matu-around0) + (:before matu matu-before0))) + (prog1 'leaf + (autoload #'matu-around0 "leaf" nil t) + (autoload #'matu-before0 "leaf" nil t) + (defun matu (x) + (princ + (format ">>%s<<" x)) + nil) + (defun matu-around0 + (f &rest args) + (prog2 + (princ "around0 ==>") + (apply f args) + (princ "around0 <=="))) + (defun matu-before0 + (&rest args) + (princ "before0:")) + (advice-add 'matu :around #'matu-around0) + (advice-add 'matu :before #'matu-before0))) + + ((leaf leaf + :preface + (defun matu (x) + (princ (format ">>%s<<" x)) + nil) + (defun matu-around0 (f &rest args) + (prog2 + (princ "around0 ==>") + (apply f args) + (princ "around0 <=="))) + (defun matu-before0 (&rest args) + (princ "before0:")) + :advice ((:around matu matu-around0) + (:before matu matu-before0) + (:around matu (lambda (f &rest args) + (prog2 + (princ "around1 ==>") + (apply f args) + (princ "around1 <==")))))) + (prog1 'leaf + (autoload #'matu-around0 "leaf" nil t) + (autoload #'matu-before0 "leaf" nil t) + (defun matu + (x) + (princ + (format ">>%s<<" x)) + nil) + (defun matu-around0 + (f &rest args) + (prog2 + (princ "around0 ==>") + (apply f args) + (princ "around0 <=="))) + (defun matu-before0 + (&rest args) + (princ "before0:")) + (advice-add 'matu :around #'matu-around0) + (advice-add 'matu :before #'matu-before0) + (advice-add 'matu :around (function + (lambda + (f &rest args) + (prog2 + (princ "around1 ==>") + (apply f args) + (princ "around1 <=="))))))))) + + (cort-deftest-with-macroexpand leaf/advice-remove + '(((leaf leaf + :advice-remove + (matu matu-around0) + (matu matu-before0)) + (prog1 'leaf + (autoload (function matu-before0) "leaf" nil t) + (autoload #'matu-around0 "leaf" nil t) + (advice-remove 'matu #'matu-around0) + (advice-remove 'matu #'matu-before0))) + + ((leaf leaf + :advice-remove ((:around matu matu-around0) + (:before matu matu-before0))) + (prog1 'leaf + (autoload #'matu "leaf" nil t) + (advice-remove ':around #'matu) + (advice-remove ':before #'matu))))) +#+end_src + ** :pl-pre-setq, :pl-setq, :pl-setq-default, :pl-custom keywords Those keywords provide configure variables with [[https://github.com/emacs-mirror/emacs/blob/master/lisp/plstore.el][plstore.el]]. ~plstore~ provide plist based data managing and encryption. From 3d9e2c84f6321069a6c5e9701512f410ad3eee75 Mon Sep 17 00:00:00 2001 From: conao3 Date: Thu, 11 Jul 2019 00:35:44 +0900 Subject: [PATCH 2/2] tagged v3.3.9 --- leaf.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaf.el b/leaf.el index 7e4c805..804e62f 100644 --- a/leaf.el +++ b/leaf.el @@ -5,7 +5,7 @@ ;; Author: Naoya Yamashita ;; Maintainer: Naoya Yamashita ;; Keywords: lisp settings -;; Version: 3.3.8 +;; Version: 3.3.9 ;; URL: https://github.com/conao3/leaf.el ;; Package-Requires: ((emacs "24.4"))