General refactors & comment revision
This commit is contained in:
parent
e3a1b0bbe3
commit
a999a0ddd6
5 changed files with 41 additions and 23 deletions
|
@ -93,6 +93,7 @@ Accepts the same arguments as `message'."
|
||||||
ARGS is a list of the last N arguments to pass to FUN. The result is a new
|
ARGS is a list of the last N arguments to pass to FUN. The result is a new
|
||||||
function which does the same as FUN, except that the last N arguments are fixed
|
function which does the same as FUN, except that the last N arguments are fixed
|
||||||
at the values with which this function was called."
|
at the values with which this function was called."
|
||||||
|
(declare (pure t) (side-effect-free t))
|
||||||
(lambda (&rest pre-args)
|
(lambda (&rest pre-args)
|
||||||
(apply fn (append pre-args args))))
|
(apply fn (append pre-args args))))
|
||||||
|
|
||||||
|
@ -104,7 +105,7 @@ at the values with which this function was called."
|
||||||
"Expands to (lambda () (interactive) ,@body).
|
"Expands to (lambda () (interactive) ,@body).
|
||||||
A factory for quickly producing interaction commands, particularly for keybinds
|
A factory for quickly producing interaction commands, particularly for keybinds
|
||||||
or aliases."
|
or aliases."
|
||||||
(declare (doc-string 1))
|
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||||
`(lambda () (interactive) ,@body))
|
`(lambda () (interactive) ,@body))
|
||||||
(defalias 'lambda! 'λ!)
|
(defalias 'lambda! 'λ!)
|
||||||
|
|
||||||
|
@ -112,7 +113,7 @@ or aliases."
|
||||||
"Expands to a command that interactively calls COMMAND with prefix ARG.
|
"Expands to a command that interactively calls COMMAND with prefix ARG.
|
||||||
A factory for quickly producing interactive, prefixed commands for keybinds or
|
A factory for quickly producing interactive, prefixed commands for keybinds or
|
||||||
aliases."
|
aliases."
|
||||||
(declare (doc-string 1))
|
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||||
(lambda () (interactive)
|
(lambda () (interactive)
|
||||||
(let ((current-prefix-arg arg))
|
(let ((current-prefix-arg arg))
|
||||||
(call-interactively command))))
|
(call-interactively command))))
|
||||||
|
@ -419,10 +420,9 @@ DOCSTRING and BODY are as in `defun'.
|
||||||
where-alist))
|
where-alist))
|
||||||
`(progn
|
`(progn
|
||||||
(defun ,symbol ,arglist ,docstring ,@body)
|
(defun ,symbol ,arglist ,docstring ,@body)
|
||||||
,(when where-alist
|
(dolist (targets (list ,@(nreverse where-alist)))
|
||||||
`(dolist (targets (list ,@(nreverse where-alist)))
|
(dolist (target (cdr targets))
|
||||||
(dolist (target (cdr targets))
|
(advice-add target (car targets) #',symbol))))))
|
||||||
(advice-add target (car targets) #',symbol)))))))
|
|
||||||
|
|
||||||
(provide 'core-lib)
|
(provide 'core-lib)
|
||||||
;;; core-lib.el ends here
|
;;; core-lib.el ends here
|
||||||
|
|
|
@ -44,6 +44,21 @@ Emacs.")
|
||||||
:config
|
:config
|
||||||
(projectile-mode +1)
|
(projectile-mode +1)
|
||||||
|
|
||||||
|
;; Projectile runs four functions to determine the root (in this order):
|
||||||
|
;;
|
||||||
|
;; + `projectile-root-local' -> consults the `projectile-project-root'
|
||||||
|
;; variable for an explicit path.
|
||||||
|
;; + `projectile-root-bottom-up' -> consults
|
||||||
|
;; `projectile-project-root-files-bottom-up'; searches from / to your
|
||||||
|
;; current directory for certain files (including .project and .git)
|
||||||
|
;; + `projectile-root-top-down' -> consults `projectile-project-root-files';
|
||||||
|
;; searches from the current directory down to / for certain project
|
||||||
|
;; markers, like package.json, setup.py, or Cargo.toml
|
||||||
|
;; + `projectile-root-top-down-recurring' -> consults
|
||||||
|
;; `projectile-project-root-files-top-down-recurring'; searches from the
|
||||||
|
;; current directory down to / for a directory that has .svn or Makefile but
|
||||||
|
;; doesn't have a parent with one of those files.
|
||||||
|
;;
|
||||||
;; In the interest of performance, we reduce the number of project root marker
|
;; In the interest of performance, we reduce the number of project root marker
|
||||||
;; files/directories projectile searches for when resolving the project root.
|
;; files/directories projectile searches for when resolving the project root.
|
||||||
(setq projectile-project-root-files-bottom-up
|
(setq projectile-project-root-files-bottom-up
|
||||||
|
|
|
@ -320,7 +320,8 @@ treat Emacs as a non-application window."
|
||||||
;; always avoid GUI
|
;; always avoid GUI
|
||||||
(setq use-dialog-box nil)
|
(setq use-dialog-box nil)
|
||||||
;; Don't display floating tooltips; display their contents in the echo-area.
|
;; Don't display floating tooltips; display their contents in the echo-area.
|
||||||
(if (bound-and-true-p tooltip-mode) (tooltip-mode -1))
|
(when (bound-and-true-p tooltip-mode)
|
||||||
|
(tooltip-mode -1))
|
||||||
;; native linux tooltips are ugly
|
;; native linux tooltips are ugly
|
||||||
(when IS-LINUX
|
(when IS-LINUX
|
||||||
(setq x-gtk-use-system-tooltips nil))
|
(setq x-gtk-use-system-tooltips nil))
|
||||||
|
|
|
@ -238,17 +238,19 @@ If prefix ARG is set, prompt for a directory to search from."
|
||||||
"Conduct a text search in the current project root.
|
"Conduct a text search in the current project root.
|
||||||
If prefix ARG is set, prompt for a known project to search from."
|
If prefix ARG is set, prompt for a known project to search from."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let ((default-directory
|
(let* ((disabled-command-function nil)
|
||||||
(if arg
|
(default-directory
|
||||||
(if-let (projects (projectile-relevant-known-projects))
|
(if arg
|
||||||
(completing-read "Search project: " projects
|
(if-let (projects (projectile-relevant-known-projects))
|
||||||
nil t nil nil (doom-project-root))
|
(completing-read "Search project: " projects
|
||||||
(user-error "There are no known projects"))
|
nil t nil nil (doom-project-root))
|
||||||
default-directory)))
|
(user-error "There are no known projects"))
|
||||||
(call-interactively
|
default-directory))
|
||||||
(cond ((featurep! :completion ivy) #'+ivy/project-search)
|
(this-command
|
||||||
((featurep! :completion helm) #'+helm/project-search)
|
(cond ((featurep! :completion ivy) #'+ivy/project-search)
|
||||||
(#'projectile-grep)))))
|
((featurep! :completion helm) #'+helm/project-search)
|
||||||
|
(#'projectile-ripgrep))))
|
||||||
|
(call-interactively this-command)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/search-other-project ()
|
(defun +default/search-other-project ()
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
;; other windows just to pop up one tiny window).
|
;; other windows just to pop up one tiny window).
|
||||||
;; 2. Forcing plugins to use `display-buffer' and `pop-to-buffer' instead of
|
;; 2. Forcing plugins to use `display-buffer' and `pop-to-buffer' instead of
|
||||||
;; `switch-to-buffer' (which is unaffected by `display-buffer-alist', which
|
;; `switch-to-buffer' (which is unaffected by `display-buffer-alist', which
|
||||||
;; this module heavily relies on).
|
;; we must rely on, heavily).
|
||||||
;; 3. Closing popups (temporarily) before functions that are highly destructive
|
;; 3. Closing popups (temporarily) before functions that are highly destructive
|
||||||
;; to the illusion of popup control get run (with the use of the
|
;; to the illusion of popup control get run (with the use of the
|
||||||
;; `save-popups!' macro).
|
;; `save-popups!' macro).
|
||||||
|
@ -206,10 +206,10 @@ the command buffer."
|
||||||
(defadvice! +popup--helm-elisp--persistent-help-a (candidate _fun &optional _name)
|
(defadvice! +popup--helm-elisp--persistent-help-a (candidate _fun &optional _name)
|
||||||
:before #'helm-elisp--persistent-help
|
:before #'helm-elisp--persistent-help
|
||||||
(let (win)
|
(let (win)
|
||||||
(when (and (helm-attr 'help-running-p)
|
(and (helm-attr 'help-running-p)
|
||||||
(string= candidate (helm-attr 'help-current-symbol))
|
(string= candidate (helm-attr 'help-current-symbol))
|
||||||
(setq win (get-buffer-window (get-buffer (help-buffer)))))
|
(setq win (get-buffer-window (get-buffer (help-buffer))))
|
||||||
(delete-window win)))))
|
(delete-window win)))))
|
||||||
|
|
||||||
|
|
||||||
;;;###package Info
|
;;;###package Info
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue