From 6a03b37dd3f1c4acff2a412c7431ac63f6d791c9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 5 Jan 2019 15:20:49 -0500 Subject: [PATCH] General refactor for comments & docstrings --- modules/completion/ivy/autoload/ivy.el | 2 +- modules/feature/evil/autoload/advice.el | 2 +- modules/ui/popup/+hacks.el | 24 +++++++++++++----------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index 2b97608ed..dc39f863c 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -185,7 +185,7 @@ search current file. See `+ivy-task-tags' to customize what this searches for." (defun +ivy/projectile-find-file () "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 -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. The point of this is to avoid Emacs locking up indexing massive file trees." diff --git a/modules/feature/evil/autoload/advice.el b/modules/feature/evil/autoload/advice.el index fc62bbcfd..cd46546be 100644 --- a/modules/feature/evil/autoload/advice.el +++ b/modules/feature/evil/autoload/advice.el @@ -33,7 +33,7 @@ (if comment-line-break-function (funcall comment-line-break-function) (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) (fboundp 'haskell-indentation-newline-and-indent)) (setq evil-auto-indent nil) diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index c888b548f..e5abd14cb 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -63,8 +63,8 @@ ;; `evil' (progn (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 it to use pop-to-buffer, and to remember the previous window." + "Monkey patch the evil command window to use `pop-to-buffer' instead of +`switch-to-buffer', allowing the popup manager to handle it." (when (eq major-mode 'evil-command-window-mode) (user-error "Cannot recursively open command line window")) (dolist (win (window-list)) @@ -153,8 +153,8 @@ the command buffer." ;; `helpful' (progn - ;; Open link in origin window (non-popup) instead of inside the popup window. - (defun +popup*helpful--navigate (button) + (defun +popup*helpful-open-in-origin-window (button) + "Open links in non-popup, originating window rather than helpful's window." (let ((path (substring-no-properties (button-get button 'path))) enable-local-variables origin) @@ -166,7 +166,7 @@ the command buffer." (setq origin (selected-window)) (recenter)) (select-window origin))) - (advice-add #'helpful--navigate :override #'+popup*helpful--navigate)) + (advice-add #'helpful--navigate :override #'+popup*helpful-open-in-origin-window)) ;; `helm' @@ -179,12 +179,14 @@ the command buffer." ((symbol-function 'org-completing-read) (lambda (&rest args) (when-let* ((win (get-buffer-window "*Org Links*"))) - ;; While helm opened as a popup, helm commands will mistaken - ;; the *Org Links* popup for the "originated window", and - ;; try to manipulate it, but since that is a popup too (as - ;; is a dedicated side window), Emacs errors and complains - ;; it can't do that. So we get rid of it. + ;; While helm is opened as a popup, it will mistaken the + ;; *Org Links* popup for the "originated window", and will + ;; target it for actions invoked by the user. However, since + ;; *Org Links* is a popup too (they're dedicated side + ;; windows), Emacs complains about being unable to split a + ;; side window. The simple fix: get rid of *Org Links*! (delete-window win) + ;; But it must exist for org to clean up later. (get-buffer-create "*Org Links*")) (apply old-org-completing-read args)))) (apply orig-fn args))) @@ -337,7 +339,7 @@ instead of switch-to-buffer-*." ;; `windmove' (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) "Allow *interactive* window moving commands to traverse popups." (cl-letf (((symbol-function #'windmove-find-other-window)