From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrey Tykhonov Newsgroups: gmane.emacs.help Subject: Re: Search StackOverflow and paste code snippets without leaving the edited file Date: Fri, 3 Jan 2014 16:36:52 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1388759867 13003 80.91.229.3 (3 Jan 2014 14:37:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jan 2014 14:37:47 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: York Zhao , adatgyujto@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 03 15:37:55 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vz5sn-000386-RI for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jan 2014 15:37:54 +0100 Original-Received: from localhost ([::1]:50157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz5sn-00061u-Dz for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jan 2014 09:37:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz5sE-0005a8-4S for help-gnu-emacs@gnu.org; Fri, 03 Jan 2014 09:37:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz5s9-0005Uv-K7 for help-gnu-emacs@gnu.org; Fri, 03 Jan 2014 09:37:18 -0500 Original-Received: from mail-oa0-x229.google.com ([2607:f8b0:4003:c02::229]:54416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz5s9-0005Si-Cj for help-gnu-emacs@gnu.org; Fri, 03 Jan 2014 09:37:13 -0500 Original-Received: by mail-oa0-f41.google.com with SMTP id j17so16263385oag.28 for ; Fri, 03 Jan 2014 06:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=D0eLJUHPM6+zQHKjW8rp9zaY2JvYbwf6bJl54wmvCAw=; b=mi/i6w6syMrF3uOcNGyXLDShkDk72pwtgHgjwCU39djaFTfSnC2RtqqqZjVbioROqZ L21UYfZHWdV52HOdoczTzIG+djKlZd8vR8AKxa/XA3k110KIq39CdVTJjdrf5pc7vUWF E09BWiX1Jacab60KOKFHCYMgsh1Muty08jd71NjrSlUlG+b6c/Jrj9dZkkclhbG3cwII A51CicEb0LkFiRuFfSY+TPdQLllfCZyDPbfzDwjUyWF5JUTaKaSZCL8XsnQ5OpowxnMM PqCfrup3wqPmROKQ98ov7eCc5yg0nWjyln5xZpS+Ud8BK2f89B9ksHGiG2xYNjRjNcwd VJHg== X-Received: by 10.182.220.225 with SMTP id pz1mr1529040obc.51.1388759832278; Fri, 03 Jan 2014 06:37:12 -0800 (PST) Original-Received: by 10.76.169.42 with HTTP; Fri, 3 Jan 2014 06:36:52 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::229 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95236 Archived-At: Hi Tom, hi York Zhao, hi all! I just recently finished new version of howdoi.el : https://github.com/atykhonov/emacs-howdoi It was totally reimplemented. And now it doesn't require python's `howdoi` command line tool. It works without it. Few words about its current usage. There is line "format date bash" in a *scratch* buffer. You could execute M-x howdoi-query-line-at-point-replace-by-code-snippet RET and mentioned line will be replaced by "DATE=`date +%Y-%m-%d`". Other example. There could be "elisp split string" in the *scratch* buffer. After execution of `howdoi-query-line-at-point-replace-by-code-snippet` mentioned string will be replaced by (split-string "1.2.3" "\\."). While reading this (or any other answer) you may be wanted to get additional info, for example: why '.' is escaped and why '\'? You could execute then `howdoi-show-current-question` and a pop up buffer will be shown with full answer and you'll get a chance to get additional explanations without needs to make additional queries. You could also do M-x howdoi-query RET RET or M-x howdoi-query-line-at-point and you'll get an answer in a pop up buffer. For example: M-x howdoi-query RET howdoi RET In a pop up buffer you could use key bindings such as C-c C-n and C-c C-p to get next/previous questions which are similar to the original one (). In a pop up buffer only an answers are shown. To be able to see an question change `howdoi-display-question` variable value to t. Few words about implementation. I was looking for a elisp library which will help to parse html. And I found libxml-parse-html-region but I was not able to use it as my emacs required to be re-compiled with libxml. Well, I recompiled it and now that function is available for me but I decided to avoid usage of this function as this dependency may be broken for someone else. So for html-parsing I used regexps. May be that was wrong decision to use regexps... I would like to hear your opinions about it. Then I decided to avoid usage of emacs-request library and built-in url.el emacs library was used instead. So seems there are no any external dependency for howdoi.el. It should just work. Check out howdoi.el from https://github.com/atykhonov/emacs-howdoi/ git-repository, use and enjoy! Look forward for your comments, suggestions, opinions, feature requests!... Best regards, Andrey 2013/12/29 York Zhao > Hi Andrey, > > Thank you very much for your reply. I'm sorry that I was wrong on guessing > you > were using Windows as I saw from your example on GitHub you used `\' as > path > name separator. > > Glad to know your plan for rewriting "howdoi" in Emacs lisp, that's really > interesting and I'm looking forward to try it out once it is ready. > > I may try you suggestion to see how the python "howdoi" goes on my system. > > Thanks, > > York >