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

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

[nongnu] elpa/helm 1b1f1ed98d: Fix emacs-27 incompatibility with minibuf


From: ELPA Syncer
Subject: [nongnu] elpa/helm 1b1f1ed98d: Fix emacs-27 incompatibility with minibuffer-follows-selected-frame (#2536)
Date: Mon, 1 Aug 2022 00:58:35 -0400 (EDT)

branch: elpa/helm
commit 1b1f1ed98d318643e27783e669e7ddb877b571a6
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix emacs-27 incompatibility with minibuffer-follows-selected-frame (#2536)
---
 helm-core.el | 17 +++++++++++------
 helm-eval.el |  7 ++++++-
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 02736cf846..91d8cd3388 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -2910,7 +2910,6 @@ HISTORY args see `helm'."
            do (progn (set-window-dedicated-p win nil)
                      (push `(,win . ,state) 
helm--original-dedicated-windows-alist)))
   (unless helm--nested (setq helm-initial-frame (selected-frame)))
-  ;(setq minibuffer-follows-selected-frame (not helm--nested))
   ;; Launch tramp-archive with dbus-event in `while-no-input-ignore-events'.
   (helm--maybe-load-tramp-archive)
   ;; Activate the advices.
@@ -2940,7 +2939,8 @@ HISTORY args see `helm'."
         mode-line-in-non-selected-windows
         minibuffer-completion-confirm
         (ori--minibuffer-follows-selected-frame
-         (default-value 'minibuffer-follows-selected-frame))
+         (and (boundp 'minibuffer-follows-selected-frame)
+              (default-value 'minibuffer-follows-selected-frame)))
         (input-method-verbose-flag helm-input-method-verbose-flag)
         (helm-maybe-use-default-as-input
          (and (null input)
@@ -2948,8 +2948,12 @@ HISTORY args see `helm'."
                   (cl-loop for s in (helm-normalize-sources sources)
                            thereis (memq s 
helm-sources-using-default-as-input))))))
     ;; This allows giving the focus to a nested helm session which use
-    ;; a frame, like completion in `helm-eval-expression'.
-    (setq minibuffer-follows-selected-frame (not helm--nested))
+    ;; a frame, like completion in
+    ;; `helm-eval-expression'. Unfortunately
+    ;; `minibuffer-follows-selected-frame' is available only in
+    ;; emacs-28+ (bug#2536).
+    (and ori--minibuffer-follows-selected-frame
+         (setq minibuffer-follows-selected-frame (not helm--nested)))
     (unwind-protect
         (condition-case-unless-debug _v
             (let ( ;; `helm--source-name' is non-`nil'
@@ -3004,8 +3008,9 @@ HISTORY args see `helm'."
       (helm-log "helm-alive-p = %S" (setq helm-alive-p nil))
       (helm--remap-mouse-mode -1)       ; Reenable mouse bindings.
       (setq helm-alive-p nil)
-      (setq minibuffer-follows-selected-frame
-            ori--minibuffer-follows-selected-frame)
+      (and ori--minibuffer-follows-selected-frame
+           (setq minibuffer-follows-selected-frame
+                 ori--minibuffer-follows-selected-frame))
       ;; Prevent error "No buffer named *helm*" triggered by
       ;; `helm-set-local-variable'.
       (setq helm--force-updating-p nil)
diff --git a/helm-eval.el b/helm-eval.el
index 72b7884bf5..33a8744ec9 100644
--- a/helm-eval.el
+++ b/helm-eval.el
@@ -180,7 +180,12 @@ Should take one arg: the string to display."
 (defun helm-eval-expression (arg)
   "Preconfigured `helm' for `helm-source-evaluation-result'."
   (interactive "P")
-  (let ((helm-elisp-help-function #'helm-elisp-show-doc-modeline))
+  (let ((helm-elisp-help-function #'helm-elisp-show-doc-modeline)
+        (helm-show-completion-display-function
+         ;; Nested completion in a frame works only in emacs-28+ when
+         ;; minibuffer-follows-selected-frame is available.
+         (and (boundp 'minibuffer-follows-selected-frame)
+              (default-value 'helm-show-completion-display-function))))
     (helm :sources (helm-build-evaluation-result-source)
           :input (when arg (thing-at-point 'sexp))
           :buffer "*helm eval*"



reply via email to

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