emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog 9077b2985a 3/3: ENHANCED: use next-error-select


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 9077b2985a 3/3: ENHANCED: use next-error-select-buffer when switching to a buffer
Date: Mon, 10 Oct 2022 09:59:13 -0400 (EDT)

branch: elpa/sweeprolog
commit 9077b2985a708fb7e586f0b18f4e5d5fba4d597d
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ENHANCED: use next-error-select-buffer when switching to a buffer
    
    * sweeprolog.el: sweeprolog-mode: add hook to
    window-selection-change-functions.
---
 sweeprolog.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sweeprolog.el b/sweeprolog.el
index 28c07f80f6..71117ef6fd 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Eshel Yaron <~eshel/dev@lists.sr.ht>
 ;; Keywords: prolog languages extensions
 ;; URL: https://git.sr.ht/~eshel/sweep
-;; Package-Version: 0.5.4
+;; Package-Version: 0.6.0
 ;; Package-Requires: ((emacs "28"))
 
 ;; This file is NOT part of GNU Emacs.
@@ -2655,7 +2655,14 @@ if-then-else constructs in SWI-Prolog."
   (when sweeprolog-enable-flymake
     (add-hook 'flymake-diagnostic-functions #'sweeprolog-diagnostic-function 
nil t)
     (flymake-mode)
-    (setq-local next-error-function #'flymake-goto-next-error))
+    (setq-local next-error-function #'flymake-goto-next-error)
+    (add-hook 'window-selection-change-functions
+              (let ((buffer (current-buffer)))
+                (lambda (win)
+                  (when (equal buffer
+                               (window-buffer win))
+                    (next-error-select-buffer buffer))))
+              nil t))
   (when (and (boundp 'cycle-spacing-actions)
              (consp cycle-spacing-actions)
              sweeprolog-enable-cycle-spacing



reply via email to

[Prev in Thread] Current Thread [Next in Thread]