[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 0017e74e6f 1/2: Allow preventing echo-input-in-header
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 0017e74e6f 1/2: Allow preventing echo-input-in-header-line from source |
Date: |
Tue, 5 Mar 2024 07:00:38 -0500 (EST) |
branch: elpa/helm
commit 0017e74e6f7a418a1003a5fe91416e1f912b5147
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Allow preventing echo-input-in-header-line from source
---
helm-core.el | 2 ++
helm-eval.el | 17 +++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/helm-core.el b/helm-core.el
index 2acfb65fb4..63df18f104 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -5873,6 +5873,8 @@ mode and header lines."
This is a toggle command."
(interactive)
+ (cl-assert (not (eq (helm-get-attr 'echo-input-in-header-line) 'never))
+ nil "echo-input-in-header-line not allowed in this source")
(with-helm-window
(add-hook 'helm-minibuffer-set-up-hook 'helm-hide-minibuffer-maybe)
(setq-local helm-echo-input-in-header-line
diff --git a/helm-eval.el b/helm-eval.el
index 94881c91ac..b7c7d9c3cc 100644
--- a/helm-eval.el
+++ b/helm-eval.el
@@ -84,8 +84,13 @@ Should take one arg: the string to display."
(define-key map (kbd "<left>") #'backward-char)
map))
+(defclass helm-evaluation-result-class (helm-source-dummy)
+ ((echo-input-in-header-line
+ :initarg :echo-input-in-header-line
+ :initform 'never)))
+
(defun helm-build-evaluation-result-source ()
- (helm-build-dummy-source "Evaluation Result"
+ (helm-make-source "Evaluation Result" 'helm-evaluation-result-class
:multiline t
:mode-line "C-RET: nl-and-indent, M-tab: reindent, C-tab:complete, C-p/n:
next/prec-line."
:filtered-candidate-transformer
@@ -93,11 +98,11 @@ Should take one arg: the string to display."
(list
(condition-case nil
(with-helm-current-buffer
- (pp-to-string
- (if edebug-active
- (edebug-eval-expression
- (read helm-pattern))
- (eval (read helm-pattern) t))))
+ (pp-to-string
+ (if edebug-active
+ (edebug-eval-expression
+ (read helm-pattern))
+ (eval (read helm-pattern) t))))
(error "Error"))))
:nohighlight t
:keymap helm-eval-expression-map