emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/setup 9f21c4a: Reindent everything


From: ELPA Syncer
Subject: [elpa] externals/setup 9f21c4a: Reindent everything
Date: Thu, 30 Sep 2021 15:57:20 -0400 (EDT)

branch: externals/setup
commit 9f21c4ae158bfb07a3913f5010d3977083d466dd
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Reindent everything
---
 setup.el | 303 ++++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 152 insertions(+), 151 deletions(-)

diff --git a/setup.el b/setup.el
index 1321125..7731daf 100644
--- a/setup.el
+++ b/setup.el
@@ -77,10 +77,10 @@ Do not modify this variable by hand.  Instead use
   "Expand macros in BODY given by `setup-macros'.
 NAME is a symbol or string designating the default feature."
   (macroexpand-all
-      (if (assq :with-feature setup-macros)
-          `(:with-feature ,name ,@body)
-        (macroexp-progn body))
-      (append setup-macros macroexpand-all-environment)))
+   (if (assq :with-feature setup-macros)
+       `(:with-feature ,name ,@body)
+     (macroexp-progn body))
+   (append setup-macros macroexpand-all-environment)))
 
 ;;;###autoload
 (defun setup-make-docstring ()
@@ -268,48 +268,48 @@ and VAL into one s-expression."
   (cond ((symbolp name) (funcall wrap-fn name val))
         ((eq (car-safe name) 'append)
          (funcall wrap-fn
-          (cadr name)
-          (let ((sym (gensym)))
-            `(let ((,sym ,val)
-                   (list ,(funcall old-val-fn (cadr name))))
-               (if (member ,sym list)
-                   list
-                 (append list (list ,sym)))))))
+                  (cadr name)
+                  (let ((sym (gensym)))
+                    `(let ((,sym ,val)
+                           (list ,(funcall old-val-fn (cadr name))))
+                       (if (member ,sym list)
+                           list
+                         (append list (list ,sym)))))))
         ((eq (car-safe name) 'prepend)
          (funcall wrap-fn
-          (cadr name)
-          (let ((sym (gensym)))
-            `(let ((,sym ,val)
-                   (list ,(funcall old-val-fn (cadr name))))
-               (if (member ,sym list)
-                   list
-                 (cons ,sym list))))))
+                  (cadr name)
+                  (let ((sym (gensym)))
+                    `(let ((,sym ,val)
+                           (list ,(funcall old-val-fn (cadr name))))
+                       (if (member ,sym list)
+                           list
+                         (cons ,sym list))))))
         ((eq (car-safe name) 'remove)
          (funcall wrap-fn
-          (cadr name)
-          `(remove ,val ,(funcall old-val-fn name))))
+                  (cadr name)
+                  `(remove ,val ,(funcall old-val-fn name))))
         ((error "Invalid option %S" name))))
 
 
 ;;; Default local macros definitions
 
 (setup-define :with-feature
-  (lambda (features &rest body)
-    (let (bodies)
-      (dolist (feature (if (listp features) features (list features)))
-        (push (if feature
-                  (let* ((mode (if (string-match-p "-mode\\'" (symbol-name 
feature))
-                                   feature
-                                 (intern (format "%s-mode" feature))))
-                         (setup-opts `((feature . ,feature)
-                                       (mode . ,mode)
-                                       (hook . ,(intern (format "%s-hook" 
mode)))
-                                       (map . ,(intern (format "%s-map" mode)))
-                                       ,@setup-opts)))
-                    (setup-expand body))
-                body)
-              bodies))
-      (macroexp-progn (if features (nreverse bodies) body))))
+    (lambda (features &rest body)
+      (let (bodies)
+        (dolist (feature (if (listp features) features (list features)))
+          (push (if feature
+                    (let* ((mode (if (string-match-p "-mode\\'" (symbol-name 
feature))
+                                     feature
+                                   (intern (format "%s-mode" feature))))
+                           (setup-opts `((feature . ,feature)
+                                         (mode . ,mode)
+                                         (hook . ,(intern (format "%s-hook" 
mode)))
+                                         (map . ,(intern (format "%s-map" 
mode)))
+                                         ,@setup-opts)))
+                      (setup-expand body))
+                  body)
+                bodies))
+        (macroexp-progn (if features (nreverse bodies) body))))
   :documentation "Change the FEATURE that BODY is configuring.
 This macro also declares a current mode by appending \"-mode\" to
 FEATURE, unless it already ends with \"-mode\".
@@ -318,53 +318,53 @@ If FEATURE is a list, apply BODY to all elements of 
FEATURE."
   :indent 1)
 
 (setup-define :with-mode
-  (lambda (modes &rest body)
-    (let (bodies)
-      (dolist (mode (if (listp modes) modes (list modes)))
-        (push (let ((setup-opts `((mode . ,mode)
-                                  (hook . ,(intern (format "%s-hook" mode)))
-                                  (map . ,(intern (format "%s-map" mode)))
-                                  ,@setup-opts)))
-                (setup-expand body))
-              bodies))
-      (macroexp-progn (nreverse bodies))))
+    (lambda (modes &rest body)
+      (let (bodies)
+        (dolist (mode (if (listp modes) modes (list modes)))
+          (push (let ((setup-opts `((mode . ,mode)
+                                    (hook . ,(intern (format "%s-hook" mode)))
+                                    (map . ,(intern (format "%s-map" mode)))
+                                    ,@setup-opts)))
+                  (setup-expand body))
+                bodies))
+        (macroexp-progn (nreverse bodies))))
   :documentation "Change the MODE that BODY is configuring.
 If MODE is a list, apply BODY to all elements of MODE."
   :debug '(sexp setup)
   :indent 1)
 
 (setup-define :with-map
-  (lambda (maps &rest body)
-    (let (bodies)
-      (dolist (map (if (listp maps) maps (list maps)))
-        (push (let ((setup-opts (cons `(map . ,map) setup-opts)))
-                (setup-expand body))
-              bodies))
-      (macroexp-progn (nreverse bodies))))
+    (lambda (maps &rest body)
+      (let (bodies)
+        (dolist (map (if (listp maps) maps (list maps)))
+          (push (let ((setup-opts (cons `(map . ,map) setup-opts)))
+                  (setup-expand body))
+                bodies))
+        (macroexp-progn (nreverse bodies))))
   :documentation "Change the MAP that BODY will bind to.
 If MAP is a list, apply BODY to all elements of MAP."
   :debug '(sexp setup)
   :indent 1)
 
 (setup-define :with-hook
-  (lambda (hooks &rest body)
-    (let (bodies)
-      (dolist (hook (if (listp hooks) hooks (list hooks)))
-        (push (let ((setup-opts (cons `(hook . ,hook) setup-opts)))
-                (setup-expand body))
-              bodies))
-      (macroexp-progn (nreverse bodies))))
+    (lambda (hooks &rest body)
+      (let (bodies)
+        (dolist (hook (if (listp hooks) hooks (list hooks)))
+          (push (let ((setup-opts (cons `(hook . ,hook) setup-opts)))
+                  (setup-expand body))
+                bodies))
+        (macroexp-progn (nreverse bodies))))
   :documentation "Change the HOOK that BODY will use.
 If HOOK is a list, apply BODY to all elements of HOOK."
   :debug '(sexp setup)
   :indent 1)
 
 (setup-define :package
-  (lambda (package)
-    `(unless (package-installed-p ',package)
-       (unless (memq ',package package-archive-contents)
-         (package-refresh-contents))
-       (package-install ',package)))
+    (lambda (package)
+      `(unless (package-installed-p ',package)
+         (unless (memq ',package package-archive-contents)
+           (package-refresh-contents))
+         (package-install ',package)))
   :documentation "Install PACKAGE if it hasn't been installed yet.
 This macro can be used as NAME, and it will replace itself with
 the first PACKAGE."
@@ -372,9 +372,9 @@ the first PACKAGE."
   :shorthand #'cadr)
 
 (setup-define :require
-  (lambda (feature)
-    `(unless (require ',feature nil t)
-       ,(setup-quit)))
+    (lambda (feature)
+      `(unless (require ',feature nil t)
+         ,(setup-quit)))
   :documentation "Try to require FEATURE, or stop evaluating body.
 This macro can be used as NAME, and it will replace itself with
 the first FEATURE."
@@ -382,76 +382,76 @@ the first FEATURE."
   :shorthand #'cadr)
 
 (setup-define :global
-  (lambda (key command)
-    `(global-set-key
-      ,(setup-ensure-kbd key)
-      ,(setup-ensure-function command)))
+    (lambda (key command)
+      `(global-set-key
+        ,(setup-ensure-kbd key)
+        ,(setup-ensure-function command)))
   :documentation "Globally bind KEY to COMMAND."
   :debug '(form sexp)
   :repeatable t)
 
 (setup-define :bind
-  (lambda (key command)
-    `(define-key ,(setup-get 'map)
-       ,(setup-ensure-kbd key)
-       ,(setup-ensure-function command)))
+    (lambda (key command)
+      `(define-key ,(setup-get 'map)
+         ,(setup-ensure-kbd key)
+         ,(setup-ensure-function command)))
   :documentation "Bind KEY to COMMAND in current map."
   :after-loaded t
   :debug '(form sexp)
   :repeatable t)
 
 (setup-define :unbind
-  (lambda (key)
-    `(define-key ,(setup-get 'map)
-       ,(setup-ensure-kbd key)
-       nil))
+    (lambda (key)
+      `(define-key ,(setup-get 'map)
+         ,(setup-ensure-kbd key)
+         nil))
   :documentation "Unbind KEY in current map."
   :after-loaded t
   :debug '(form)
   :repeatable t)
 
 (setup-define :rebind
-  (lambda (key command)
-    `(progn
-       (dolist (key (where-is-internal ',command ,(setup-get 'map)))
-         (define-key ,(setup-get 'map) key nil))
-       (define-key ,(setup-get 'map)
-         ,(setup-ensure-kbd key)
-         ,(setup-ensure-function command))))
+    (lambda (key command)
+      `(progn
+         (dolist (key (where-is-internal ',command ,(setup-get 'map)))
+           (define-key ,(setup-get 'map) key nil))
+         (define-key ,(setup-get 'map)
+           ,(setup-ensure-kbd key)
+           ,(setup-ensure-function command))))
   :documentation "Unbind the current key for COMMAND, and bind it to KEY."
   :after-loaded t
   :debug '(form sexp)
   :repeatable t)
 
 (setup-define :hook
-  (lambda (function)
-    `(add-hook ',(setup-get 'hook) ,(setup-ensure-function function)))
+    (lambda (function)
+      `(add-hook ',(setup-get 'hook) ,(setup-ensure-function function)))
   :documentation "Add FUNCTION to current hook."
   :repeatable t)
 
 (setup-define :hook-into
-  (lambda (mode)
-    `(add-hook ',(let ((name (symbol-name mode)))
-                   (if (string-match-p "-hook\\'" name)
-                       mode
-                     (intern (concat name "-hook"))))
-               ,(setup-ensure-function (setup-get 'mode))))
+    (lambda (mode)
+      `(add-hook ',(let ((name (symbol-name mode)))
+                     (if (string-match-p "-hook\\'" name)
+                         mode
+                       (intern (concat name "-hook"))))
+                 ,(setup-ensure-function (setup-get 'mode))))
   :documentation "Add current mode to HOOK."
   :repeatable t)
 
 (setup-define :option
-  (lambda (name val)
-    (setup-make-setter
-     name val
-     (lambda (name)
-       `(funcall (or (get ',name 'custom-get)
-                     #'symbol-value)
-                 ',name))
-     (lambda (name val)
-       `(progn
-          (custom-load-symbol ',name)
-          (funcall (or (get ',name 'custom-set) #'set-default)
-                   ',name ,val)))))
+    (lambda (name val)
+      (setup-make-setter
+       name val
+       (lambda (name)
+         `(funcall (or (get ',name 'custom-get)
+                       #'symbol-value)
+                   ',name))
+       (lambda (name val)
+         `(progn
+            (custom-load-symbol ',name)
+            (funcall (or (get ',name 'custom-set) #'set-default)
+                     ',name ,val)))))
   :documentation "Set the option NAME to VAL.
 NAME may be a symbol, or a cons-cell.  If NAME is a cons-cell, it
 will use the car value to modify the behaviour.  These forms are
@@ -476,21 +476,21 @@ therefore not be stored in `custom-set-variables' blocks."
   :repeatable t)
 
 (setup-define :hide-mode
-  (lambda ()
-    `(setq minor-mode-alist
-           (delq (assq ,(setup-get 'mode) minor-mode-alist)
-                 minor-mode-alist)))
+    (lambda ()
+      `(setq minor-mode-alist
+             (delq (assq ,(setup-get 'mode) minor-mode-alist)
+                   minor-mode-alist)))
   :documentation "Hide the mode-line lighter of the current mode."
   :after-loaded t)
 
 (setup-define :local-set
-  (lambda (name val)
-    (setup-make-setter
-     name val
-     (lambda (name)
-       (if (consp name) (cadr name) name))
-     (lambda (name val)
-       `(add-hook ',(setup-get 'hook) (lambda () (setq-local ,name ,val))))))
+    (lambda (name val)
+      (setup-make-setter
+       name val
+       (lambda (name)
+         (if (consp name) (cadr name) name))
+       (lambda (name val)
+         `(add-hook ',(setup-get 'hook) (lambda () (setq-local ,name ,val))))))
   :documentation "Set the value of NAME to VAL in buffers of the current mode.
 NAME may be a symbol, or a cons-cell.  If NAME is a cons-cell, it
 will use the car value to modify the behaviour. These forms are
@@ -509,17 +509,17 @@ supported:
   :repeatable t)
 
 (setup-define :local-hook
-  (lambda (hook function)
-    `(add-hook ',(setup-get 'hook)
-               (lambda ()
-                 (add-hook ',hook ,(setup-ensure-function function) nil t))))
+    (lambda (hook function)
+      `(add-hook ',(setup-get 'hook)
+                 (lambda ()
+                   (add-hook ',hook ,(setup-ensure-function function) nil t))))
   :documentation "Add FUNCTION to HOOK only in buffers of the current mode."
   :debug '(symbolp sexp)
   :repeatable t)
 
 (setup-define :advise
-  (lambda (symbol where function)
-    `(advice-add ',symbol ,where ,(setup-ensure-function function)))
+    (lambda (symbol where function)
+      `(advice-add ',symbol ,where ,(setup-ensure-function function)))
   :documentation "Add a piece of advice on a function.
 See `advice-add' for more details."
   :after-loaded t
@@ -527,23 +527,23 @@ See `advice-add' for more details."
   :repeatable t)
 
 (setup-define :also-load
-  (lambda (feature)
-    `(require ',feature))
+    (lambda (feature)
+      `(require ',feature))
   :documentation "Load FEATURE with the current body."
   :after-loaded t
   :repeatable t)
 
 (setup-define :needs
-  (lambda (executable)
-    `(unless (executable-find ,executable)
-       ,(setup-quit)))
+    (lambda (executable)
+      `(unless (executable-find ,executable)
+         ,(setup-quit)))
   :documentation "If EXECUTABLE is not in the path, stop here."
   :repeatable 1)
 
 (setup-define :if-package
-  (lambda (package)
-    `(unless (package-installed-p ',package)
-       ,(setup-quit)))
+    (lambda (package)
+      `(unless (package-installed-p ',package)
+         ,(setup-quit)))
   :documentation "If package is not installed, stop evaluating the body.
 This macro can be used as NAME, and it will replace itself with
 the first PACKAGE."
@@ -551,9 +551,9 @@ the first PACKAGE."
   :shorthand #'cadr)
 
 (setup-define :if-feature
-  (lambda (feature)
-    `(unless (featurep ',feature)
-       ,(setup-quit)))
+    (lambda (feature)
+      `(unless (featurep ',feature)
+         ,(setup-quit)))
   :documentation "If FEATURE is not available, stop evaluating the body.
 This macro can be used as NAME, and it will replace itself with
 the first PACKAGE."
@@ -561,36 +561,37 @@ the first PACKAGE."
   :shorthand #'cadr)
 
 (setup-define :if-host
-  (lambda (hostname)
-    `(unless (string= (system-name) ,hostname)
-       ,(setup-quit)))
+    (lambda (hostname)
+      `(unless (string= (system-name) ,hostname)
+         ,(setup-quit)))
   :documentation "If HOSTNAME is not the current hostname, stop evaluating 
form.")
 
 (setup-define :only-if
-  (lambda (condition)
-    `(unless ,condition
-       ,(setup-quit)))
+    (lambda (condition)
+      `(unless ,condition
+         ,(setup-quit)))
   :documentation "If CONDITION is non-nil, stop evaluating the body."
   :debug '(form)
   :repeatable t)
 
 (setup-define :load-from
-  (lambda (path)
-    `(let ((path* (expand-file-name ,path)))
-       (if (file-exists-p path*)
-           (add-to-list 'load-path path*)
-         ,(setup-quit))))
+    (lambda (path)
+      `(let ((path* (expand-file-name ,path)))
+         (if (file-exists-p path*)
+             (add-to-list 'load-path path*)
+           ,(setup-quit))))
   :documentation "Add PATH to load path.
 This macro can be used as NAME, and it will replace itself with
 the nondirectory part of PATH.
 If PATH does not exist, abort the evaluation."
-  :shorthand (lambda (args) (intern
-                             (file-name-nondirectory
-                              (directory-file-name (cadr args))))))
+  :shorthand (lambda (args)
+               (intern
+                (file-name-nondirectory
+                 (directory-file-name (cadr args))))))
 
 (setup-define :file-match
-  (lambda (pat)
-    `(add-to-list 'auto-mode-alist (cons ,pat ',(setup-get 'mode))))
+    (lambda (pat)
+      `(add-to-list 'auto-mode-alist (cons ,pat ',(setup-get 'mode))))
   :documentation "Associate the current mode with files that match PAT."
   :debug '(form)
   :repeatable t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]