Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 20th, 2013  |  syntax: Lisp  |  size: 0.55 KB  |  views: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (add-hook 'isearch-mode-end-hook 'my-goto-match-beginning)
  2.     (defun my-goto-match-beginning ()
  3.       (when (and isearch-forward isearch-other-end)
  4.         (goto-char isearch-other-end)))
  5.     (defadvice isearch-exit (after my-goto-match-beginning activate)
  6.       "Go to beginning of match."
  7.       (when (and isearch-forward isearch-other-end)
  8.         (goto-char isearch-other-end)))
  9.  
  10.    (defun my-goto-match-beginning ()
  11.       (when (and isearch-forward isearch-other-end (not isearch-mode-end-hook-quit))
  12.         (goto-char isearch-other-end)))
clone this paste RAW Paste Data