define-it icon indicating copy to clipboard operation
define-it copied to clipboard

Doesn't focus on the buffer after the definition fetched

Open agzam opened this issue 4 years ago • 1 comments

It doesn't activate the buffer by default (when define-it-output-choice set to 'view).

For now, I'm using a workaround such as this:

(defun define-it--find-buffer (x)
  (let ((buf (format define-it--buffer-name-format define-it--current-word)))
    (pop-to-buffer buf)))

(advice-add 'define-it--in-buffer :after #'define-it--find-buffer)

Very trivial to fix it in the code, let me know if that behavior desirable, I'll make a PR.

agzam avatar Aug 04 '21 01:08 agzam

Maybe something like,


(defcustom define-it-display-action 'pop-to-buffer
  "comment here..."
  :type 'function
  :group 'define-it)

(defun define-it--in-buffer (content)
    ...
    (funcall define-it-display-action buf)))  ; remove save-selected-window here

I think this would be a better design decision? So you would not have to change anything. 😁

Feel free to make PR for this! (quite busy recently)

jcs090218 avatar Aug 04 '21 04:08 jcs090218