Skip to content

Instantly share code, notes, and snippets.

@gausby
Created January 30, 2012 13:34
Show Gist options
  • Save gausby/1704426 to your computer and use it in GitHub Desktop.
Save gausby/1704426 to your computer and use it in GitHub Desktop.
Defines a function that perform a search on DuckDuckGo. The results opens in your default browser. Put it in your emacs init file.
(defun duckduckgo nil
"Duck Duck Go something."
(interactive)
(let (arg)
(if mark-active
(setq arg (buffer-substring (region-beginning) (region-end)))
(setq arg (read-from-minibuffer "Search term: ")))
(browse-url (format "http://duckduckgo.com/?q=%s" arg))))
@gausby
Copy link
Author

gausby commented Jan 30, 2012

...most of the code is lifted from this google search function: http://www.version2.dk/blog/emacsforum-var-super-sjovt-men-vi-skal-lige-32810#comment-185491

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment