General refactor for comments & docstrings
This commit is contained in:
parent
2cc8a96a30
commit
6a03b37dd3
3 changed files with 15 additions and 13 deletions
|
@ -185,7 +185,7 @@ search current file. See `+ivy-task-tags' to customize what this searches for."
|
||||||
(defun +ivy/projectile-find-file ()
|
(defun +ivy/projectile-find-file ()
|
||||||
"A more sensible `counsel-projectile-find-file', which will revert to
|
"A more sensible `counsel-projectile-find-file', which will revert to
|
||||||
`counsel-find-file' if invoked from $HOME, `counsel-file-jump' if invoked from a
|
`counsel-find-file' if invoked from $HOME, `counsel-file-jump' if invoked from a
|
||||||
non-project, `projectile-find-file' if in a bug project (more than
|
non-project, `projectile-find-file' if in a big project (more than
|
||||||
`ivy-sort-max-size' files), or `counsel-projectile-find-file' otherwise.
|
`ivy-sort-max-size' files), or `counsel-projectile-find-file' otherwise.
|
||||||
|
|
||||||
The point of this is to avoid Emacs locking up indexing massive file trees."
|
The point of this is to avoid Emacs locking up indexing massive file trees."
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
(if comment-line-break-function
|
(if comment-line-break-function
|
||||||
(funcall comment-line-break-function)
|
(funcall comment-line-break-function)
|
||||||
(comment-indent-new-line)))
|
(comment-indent-new-line)))
|
||||||
;; Find a better way to do this
|
;; TODO Find a better way to do this
|
||||||
((and (eq major-mode 'haskell-mode)
|
((and (eq major-mode 'haskell-mode)
|
||||||
(fboundp 'haskell-indentation-newline-and-indent))
|
(fboundp 'haskell-indentation-newline-and-indent))
|
||||||
(setq evil-auto-indent nil)
|
(setq evil-auto-indent nil)
|
||||||
|
|
|
@ -63,8 +63,8 @@
|
||||||
;; `evil'
|
;; `evil'
|
||||||
(progn
|
(progn
|
||||||
(defun +popup*evil-command-window (hist cmd-key execute-fn)
|
(defun +popup*evil-command-window (hist cmd-key execute-fn)
|
||||||
"The evil command window has a mind of its own (uses `switch-to-buffer'). We
|
"Monkey patch the evil command window to use `pop-to-buffer' instead of
|
||||||
monkey patch it to use pop-to-buffer, and to remember the previous window."
|
`switch-to-buffer', allowing the popup manager to handle it."
|
||||||
(when (eq major-mode 'evil-command-window-mode)
|
(when (eq major-mode 'evil-command-window-mode)
|
||||||
(user-error "Cannot recursively open command line window"))
|
(user-error "Cannot recursively open command line window"))
|
||||||
(dolist (win (window-list))
|
(dolist (win (window-list))
|
||||||
|
@ -153,8 +153,8 @@ the command buffer."
|
||||||
|
|
||||||
;; `helpful'
|
;; `helpful'
|
||||||
(progn
|
(progn
|
||||||
;; Open link in origin window (non-popup) instead of inside the popup window.
|
(defun +popup*helpful-open-in-origin-window (button)
|
||||||
(defun +popup*helpful--navigate (button)
|
"Open links in non-popup, originating window rather than helpful's window."
|
||||||
(let ((path (substring-no-properties (button-get button 'path)))
|
(let ((path (substring-no-properties (button-get button 'path)))
|
||||||
enable-local-variables
|
enable-local-variables
|
||||||
origin)
|
origin)
|
||||||
|
@ -166,7 +166,7 @@ the command buffer."
|
||||||
(setq origin (selected-window))
|
(setq origin (selected-window))
|
||||||
(recenter))
|
(recenter))
|
||||||
(select-window origin)))
|
(select-window origin)))
|
||||||
(advice-add #'helpful--navigate :override #'+popup*helpful--navigate))
|
(advice-add #'helpful--navigate :override #'+popup*helpful-open-in-origin-window))
|
||||||
|
|
||||||
|
|
||||||
;; `helm'
|
;; `helm'
|
||||||
|
@ -179,12 +179,14 @@ the command buffer."
|
||||||
((symbol-function 'org-completing-read)
|
((symbol-function 'org-completing-read)
|
||||||
(lambda (&rest args)
|
(lambda (&rest args)
|
||||||
(when-let* ((win (get-buffer-window "*Org Links*")))
|
(when-let* ((win (get-buffer-window "*Org Links*")))
|
||||||
;; While helm opened as a popup, helm commands will mistaken
|
;; While helm is opened as a popup, it will mistaken the
|
||||||
;; the *Org Links* popup for the "originated window", and
|
;; *Org Links* popup for the "originated window", and will
|
||||||
;; try to manipulate it, but since that is a popup too (as
|
;; target it for actions invoked by the user. However, since
|
||||||
;; is a dedicated side window), Emacs errors and complains
|
;; *Org Links* is a popup too (they're dedicated side
|
||||||
;; it can't do that. So we get rid of it.
|
;; windows), Emacs complains about being unable to split a
|
||||||
|
;; side window. The simple fix: get rid of *Org Links*!
|
||||||
(delete-window win)
|
(delete-window win)
|
||||||
|
;; But it must exist for org to clean up later.
|
||||||
(get-buffer-create "*Org Links*"))
|
(get-buffer-create "*Org Links*"))
|
||||||
(apply old-org-completing-read args))))
|
(apply old-org-completing-read args))))
|
||||||
(apply orig-fn args)))
|
(apply orig-fn args)))
|
||||||
|
@ -337,7 +339,7 @@ instead of switch-to-buffer-*."
|
||||||
|
|
||||||
;; `windmove'
|
;; `windmove'
|
||||||
(progn
|
(progn
|
||||||
;; Users should be about to hop into popups easily, but Elisp shouldn't.
|
;; Users should be able to hop into popups easily, but Elisp shouldn't.
|
||||||
(defun doom*ignore-window-parameters (orig-fn &rest args)
|
(defun doom*ignore-window-parameters (orig-fn &rest args)
|
||||||
"Allow *interactive* window moving commands to traverse popups."
|
"Allow *interactive* window moving commands to traverse popups."
|
||||||
(cl-letf (((symbol-function #'windmove-find-other-window)
|
(cl-letf (((symbol-function #'windmove-find-other-window)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue