thanhvg / emacs-howdoyou

Search and read stackoverflow and its sisters’ sites
69 stars 7 forks source link
elisp emacs emacs-lisp package stackoverflow

+STARTUP: align fold hidestars oddeven indent

+TITLE: Emacs Howdoyou - A package to search and read stackoverflow and its sisters' sites

[[http://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]

[[file:screenshots/howdoyou.png]]

The result is then showed in an ~org-mode~ buffer. For each result, question and three answers were showed, but they are collapsed by default except the first answer. As this package uses Google to get the links, for each query there will be a dozen of links, the fist link will be used, then users can go to next link and previous link. The author believes that when searching for solutions it is important for users to read both questions and answers, so no "quick look" features such as code only view or code completion are provided.

[[https://melpa.org/#/howdoyou][file:https://melpa.org/packages/howdoyou-badge.svg]]

Spacemacs layer:

https://github.com/thanhvg/spacemacs-eos

Note that =spacemas-eos= has its own faster google suggetion engine provided by [[https://github.com/thanhvg/emacs-google-suggest][google-suggest]] package.

add this function definition to your config file

+begin_src elisp

(defun my/howdoyou-with-suggestions () "Call howdoyou-query' with suggestions fromcounsel-web-suggest'." (interactive) (counsel-web-suggest nil "How Do You: "

'counsel-web-suggest--google

                    (lambda (x)
                      (howdoyou-query x))))

+end_src

Now when calling =my/howdoyou-with-suggestion= (either from ~M-x~ or by [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Key-Bindings.html][key binding]] of your choice) it will pass =counsel-web-suggest= suggestions to howdoyou-query.

[[file:screenshots/howdoyou.gif]]

[[file:screenshots/howdoyou2.gif]]