Skip to content

Instantly share code, notes, and snippets.

@gabriel-laddel
Created February 11, 2013 04:39
Show Gist options
  • Save gabriel-laddel/4752654 to your computer and use it in GitHub Desktop.
Save gabriel-laddel/4752654 to your computer and use it in GitHub Desktop.
;Hola, I'm have an issue with ELISP control structures - could anyone point me in the right direction?
;I currently have "\C-c\C-o" bound to rgrep via `global set key` I would like to automatically jump to the
;*grep* buffer when finished with grep, but I'm not sure how to say that without doing something like
(global-set-key "\C-c\C-o" (lambda (x)
(interactive "sSearch for:"
; then prompt for directory ect.
)
(rgrep %s)
;; the downside to this being that I lose the default behavior of rgrep (defaulting to the symbol under cursor, or selected text)
(switch-to-buffer "*grep*")))
;Ideally I want this:
(global-set-key "\C-c\C-o" (lambda ()
(interactive)
(rgrep)
; at this point have rgrep take over and when finished, call `switch-to-buffer`
(switch-to-buffer "*grep*")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment