From 64aa0fef4d3a43d2cd748578eb7c93f8ba75fe67 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 12 Jul 2017 23:54:56 +0200 Subject: [PATCH] Appease byte-compiler --- core/autoload/buffers.el | 2 +- core/autoload/popups.el | 2 ++ core/core-popups.el | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index 0338ef5d8..b5cf4846a 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -125,7 +125,7 @@ buffers. If there's nothing left, switch to `doom-fallback-buffer'. See ;; `switch-to-prev-buffer' properly update buffer list order. (cl-loop with move-func = (if (> n 0) #'switch-to-next-buffer #'switch-to-prev-buffer) - for _i to 20 + for i to 20 while (not (memq (current-buffer) buffers)) do (dotimes (_i (abs n)) diff --git a/core/autoload/popups.el b/core/autoload/popups.el index 9d8e0501d..dc1acfe8d 100644 --- a/core/autoload/popups.el +++ b/core/autoload/popups.el @@ -1,5 +1,7 @@ ;;; core/autoload/popups.el -*- lexical-binding: t; -*- +(defvar doom-popup-remember-history) + ;;;###autoload (defun doom-popup-p (&optional target) "Return TARGET (a window) if TARGET (a window or buffer) is a popup. Uses diff --git a/core/core-popups.el b/core/core-popups.el index 4b8bd7d90..d8f72de97 100644 --- a/core/core-popups.el +++ b/core/core-popups.el @@ -412,19 +412,19 @@ the command buffer." (advice-add #'helm-ag--edit :around #'doom*helm-ag-edit))) +(defsubst doom--switch-from-popup (location) + (doom/popup-close) + (switch-to-buffer (car location) nil t) + (if (not (cdr location)) + (message "Unable to find location in file") + (goto-char (cdr location)) + (recenter))) + (after! help-mode ;; Help buffers use `other-window' to decide where to open followed links, ;; which can be unpredictable. It should *only* replace the original buffer we ;; opened the popup from. To fix this these three button types need to be ;; redefined to set aside the popup before following a link. - (defsubst doom--switch-from-popup (location) - (doom/popup-close) - (switch-to-buffer (car location) nil t) - (if (not (cdr location)) - (message "Unable to find location in file") - (goto-char (cdr location)) - (recenter))) - (define-button-type 'help-function-def :supertype 'help-xref 'help-function