[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup f3b2e0a 3/3: Move a few macros to EmacsWiki
From: |
ELPA Syncer |
Subject: |
[elpa] externals/setup f3b2e0a 3/3: Move a few macros to EmacsWiki |
Date: |
Fri, 8 Oct 2021 04:57:41 -0400 (EDT) |
branch: externals/setup
commit f3b2e0a7fec7952d3773b4c1c81ef5d63c2e3721
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Move a few macros to EmacsWiki
The macros (:hide-mode, :advise, :needs, :if-host, :load-from) are
either named suboptimally or don't make real use of setup's
context-sensitivity system to be included in the package itself.
---
setup.el | 47 ++---------------------------------------------
1 file changed, 2 insertions(+), 45 deletions(-)
diff --git a/setup.el b/setup.el
index 3187eb5..ea8d485 100644
--- a/setup.el
+++ b/setup.el
@@ -51,6 +51,8 @@
;; - Remove `setup-wrap-to-demote-errors' from `setup-modifier-list'
;; - Let `:with-feature' and `:with-mode' check symbol properties to
;; improve context-setting guesses.
+;; - Move macros :hide-mode, :advise, :needs, :if-host and :load-from
+;; to EmacsWiki.
;;; Code:
@@ -506,14 +508,6 @@ therefore not be stored in `custom-set-variables' blocks."
:debug '(sexp form)
:repeatable t)
-(setup-define :hide-mode
- (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
@@ -548,15 +542,6 @@ supported:
:debug '(symbolp sexp)
:repeatable t)
-(setup-define :advise
- (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
- :debug '(sexp sexp function-form)
- :repeatable t)
-
(setup-define :also-load
(lambda (feature)
`(require ',feature))
@@ -564,13 +549,6 @@ See `advice-add' for more details."
:after-loaded t
:repeatable t)
-(setup-define :needs
- (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)
@@ -591,12 +569,6 @@ the first PACKAGE."
:repeatable t
:shorthand #'cadr)
-(setup-define :if-host
- (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
@@ -605,21 +577,6 @@ the first PACKAGE."
: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))))
- :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))))))
-
(setup-define :file-match
(lambda (pat)
`(add-to-list 'auto-mode-alist (cons ,pat ',(setup-get 'mode))))