From a072cb87c9e3ec8b1e86669ede6421ecbbe96573 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 9 Jun 2016 00:21:53 -0400 Subject: [PATCH] Don't let cursor stay in help buffer popup after following a link --- core/core-popup.el | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/core/core-popup.el b/core/core-popup.el index 64946d4b3..0c0ddbd91 100644 --- a/core/core-popup.el +++ b/core/core-popup.el @@ -70,14 +70,13 @@ (require 'find-func) (when (eq file 'C-source) (setq file (help-C-file-name (indirect-function fun) 'fun))) - (let ((location - (find-function-search-for-symbol fun nil file))) + (let ((location (find-function-search-for-symbol fun nil file))) (doom/popup-save (switch-to-buffer (car location) nil t) - (awhen (cdr location) (goto-char it))) - (if (cdr location) - (goto-char (cdr location)) - (message "Unable to find location in file"))))) + (if (cdr location) + (goto-char (cdr location)) + (message "Unable to find location in file"))) + (select-window (get-buffer-window (car location)))))) (define-button-type 'help-variable-def :supertype 'help-xref @@ -87,10 +86,10 @@ (let ((location (find-variable-noselect var file))) (doom/popup-save (switch-to-buffer (car location) nil t) - (awhen (cdr location) (goto-char it))) - (if (cdr location) - (goto-char (cdr location)) - (message "Unable to find location in file"))))) + (if (cdr location) + (goto-char (cdr location)) + (message "Unable to find location in file"))) + (select-window (get-buffer-window (car location)))))) (define-button-type 'help-face-def :supertype 'help-xref @@ -100,10 +99,10 @@ (find-function-search-for-symbol fun 'defface file))) (doom/popup-save (switch-to-buffer (car location) nil t) - (awhen (cdr location) (goto-char it))) - (if (cdr location) - (goto-char (cdr location)) - (message "Unable to find location in file")))))) + (if (cdr location) + (goto-char (cdr location)) + (message "Unable to find location in file"))) + (select-window (get-buffer-window (car location))))))) (provide 'core-popup) ;;; core-popup.el ends here