abo-abo / hydra

make Emacs bindings that stick around
1.85k stars 113 forks source link

Return does not complete I-search edit after yanking. #239

Open martinp26 opened 7 years ago

martinp26 commented 7 years ago

When editing the i-search string with C-S M-e, normally RETURN terminates editing.

However, if I yank some previously copied string using the yank hydra, RETURN does not leave the hydra and instead appends a verbatim newline to the search string.

abo-abo commented 7 years ago

What code are you using?

martinp26 commented 7 years ago

(defhydra hydra-yank-pop () "yank" ("C-y" yank nil) ("M-y" yank-pop nil) ("y" (yank-pop 1) "next") ("Y" (yank-pop -1) "prev") ("l" browse-kill-ring "list" :color blue) ; or helm-show-kill-ring ) (global-set-key (kbd "M-y") #'hydra-yank-pop/yank-pop) (global-set-key (kbd "C-y") #'hydra-yank-pop/yank)

abo-abo commented 7 years ago

Can't reproduce. Try to reproduce with emacs -Q.

martinp26 commented 7 years ago

I can repro with emacs -Q, (GNU Emacs 24.3.1 in Ubuntu 14.04).


(load-library "~/.emacs.d/elpa/hydra-20161117.1028/lv")
(load-library "~/.emacs.d/elpa/hydra-20161117.1028/hydra")

(defhydra hydra-yank-pop ()
"yank"
("C-y" yank nil)
("M-y" yank-pop nil)
("y" (yank-pop 1) "next")
("Y" (yank-pop -1) "prev")
("l" browse-kill-ring "list" :color blue) ; or helm-show-kill-ring
)
(global-set-key (kbd "M-y") #'hydra-yank-pop/yank-pop)
(global-set-key (kbd "C-y") #'hydra-yank-pop/yank)

Expectation: terminate editing and commence search. Reality: append newline to search editing mini-buffer

abo-abo commented 7 years ago

Can't reproduce with emacs-24.5. Looking for the word buffer in *scratch*, everything works.

martinp26 commented 7 years ago

Interesting. I gave it another try with 26.0.50.2 and cannot reproduce there either.