kaushalmodi / .emacs.d

My emacs configuration
MIT License
261 stars 49 forks source link

modi/eww-im-feeling-lucky can be improved #29

Open beacoder opened 6 years ago

beacoder commented 6 years ago

;; I'm-feeling-lucky (defun eww-im-feeling-lucky (search-term) "Google I'm feeling lucky." (interactive (list (smart/read-from-minibuffer "Google Search Term (I'm Feeling Lucky!)"))) ;; Keep on burying the current buffer if it turns out to be an eww buffer. (while (string-match "^eww$\|^eww<[[:digit:]]+>$" (buffer-name)) (bury-buffer)) ;; Start a new eww search. (eww search-term) (sleep-for 0.1) ;; https://stackoverflow.com/questions/16877882/how-to-access-google-search-im-feeling-lucky-functionality-using-api (eww-browse-url (concat (eww-current-url) "&btnI")))