Skip to content

Commit

Permalink
[ivy] made visible action message before dispatcher quit
Browse files Browse the repository at this point in the history
  • Loading branch information
c0001 committed May 9, 2024
1 parent c87201d commit b661796
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion elements/core/tentacles/entropy-emacs-ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,11 @@ upstream and may be make risky follow the ivy updates.
(funcall symname-func this-caller))
)))
(progn
(user-error "Ivy quit for caller '%s'" this-caller)))))
(if (functionp entropy/emacs-ivy-dispatch-caller-done-message-func)
(unwind-protect
(user-error (funcall entropy/emacs-ivy-dispatch-caller-done-message-func))
(setq entropy/emacs-ivy-dispatch-caller-done-message-func nil))
(user-error "Ivy quit for caller '%s'" this-caller))))))
(advice-add 'ivy-read :after #'entropy/emacs-ivy--ivy-read-quit-after-dispatch-actions)

;; **** inhibit double tab trigger
Expand Down
11 changes: 11 additions & 0 deletions elements/core/tentacles/entropy-emacs-popwin.el
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,17 @@ specification."
(t
(let* ((buff-name (completing-read prompt table)))
(funcall action buff-name))))))
(when (eq entropy/emacs-command-completion-use-style 'ivy)
(ivy-add-actions
'entropy/emacs-popwin-shackle-popup-buffer
`(("k"
,(lambda (buffer) (interactive)
(setq entropy/emacs-ivy-dispatch-caller-done-message-func
'current-message)
(entropy/emacs-message-simple-progress-message
(format "Killing buffer %S" buffer)
(kill-buffer buffer)))
"kill buffer"))))

(defun entropy/emacs-popwin-shackle-popup-find-file-action (file)
(let* ((buff-name (buffer-name (find-file-noselect file)))
Expand Down
8 changes: 8 additions & 0 deletions elements/core/wasteland/var-binds/entropy-emacs-defvar.el
Original file line number Diff line number Diff line change
Expand Up @@ -2426,6 +2426,14 @@ not dynamically change their regexp builder from
;; filenames or CJK missed filenames.
(ivy--regex-plus str)))

(defvar entropy/emacs-ivy-dispatch-caller-done-message-func nil
"A function which should return a message string used to display
after a ivy dispatcher action invoked done.
This variable exists since eemacs hacked ivy-read, on where the
`current-message' maybe overridden by the eemacs's ivy-read's
quit action after a dispatcher action ran done.")

;; ** operation refer
;; *** Read only suggestion

Expand Down

0 comments on commit b661796

Please sign in to comment.