tam17aki / ace-isearch

A seamless bridge between isearch, ace-jump-mode, avy, and helm-swoop.
103 stars 10 forks source link

Work weird with isearch #8

Closed wd closed 9 years ago

wd commented 9 years ago
(define-key isearch-mode-map (kbd "C-f") 
  '(lambda ()
     (interactive)
     (save-excursion
       (set 'ps (re-search-backward "[^[:alnum:]-_@.]" nil t))
       (forward-char)
       (isearch-yank-internal
        (lambda ()
          (set 'pe (re-search-forward "[[:alnum:]-_@.]*[[:alnum:]]" nil t))
          (kill-ring-save (+ ps 1) pe)
          (+ pe 0)
          )
        ))
     )
  )

I usually use C-s C-f to yank current symbol to isearch, ace-isearch will trigger helm-swoop, when I select one founded line and press RET, helm-swoop will quit, but the cursor won't goto that line. Do not know where am wrong ..

tam17aki commented 9 years ago

Hi,

Thank you for using ace-isearch.

If you are using Emacs 24.4, you can try isearch-forward-symbol-at-point which implements the same feature as you intended:

(define-key isearch-mode-map (kbd "C-f") 'isearch-forward-symbol-at-point)

Using this command, cursor go to the line properly. I can't point out what is wrong about your snippet for now...

wd commented 9 years ago

Thanks, it's workd. :+1: