all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Search StackOverflow and paste code snippets without leaving the edited file
@ 2013-12-26  7:21 Tom
  0 siblings, 0 replies; 38+ messages in thread
From: Tom @ 2013-12-26  7:21 UTC (permalink / raw)
  To: help-gnu-emacs

Check out the animgif demonstration here:

https://github.com/azac/sublime-howdoi-direct-paste

It can be a good little Emacs project for the holidays if someone
wants to do a port.


(And I know: you shouldn't copy code blindly from the internet. It's
only a convenience tool for quickly fethcing trivial code and
modifying it for your own purposes. People who copy code blindly can
also do it manually after all.)




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Search StackOverflow and paste code snippets without leaving the edited file
@ 2013-12-27  9:54 Andrey Tykhonov
  2013-12-27 11:12 ` Tom
       [not found] ` <CAD3zm21kt_JReiDRufhY_TbG7V8rc3TLW+uah3oxq8+xE_tQEw@mail.gmail.com>
  0 siblings, 2 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2013-12-27  9:54 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: adatgyujto

Hi Tom,

I was glad to find your letter in the inbox about idea to write a port for
sublime-howdoi-direct-paste. I was looking for some small Emacs project to
implement. And I decided to implement howdoi for emacs.

Check out the emacs-howdoi: https://github.com/atykhonov/emacs-howdoi

I wrote it last night. This is my first Emacs package and I'm relatively
new in Emacs/elisp... Therefore any comments due to code (and functionality
overall), suggestions, ideas about new features etc etc etc will be highly
appreciated.


Thank you!


Andrey T.

> Check out the animgif demonstration here:

> https://github.com/azac/sublime-howdoi-direct-paste[1]

> It can be a good little Emacs project for the holidays if someone
> wants to do a port.


> (And I know: you shouldn't copy code blindly from the internet. It's
> only a convenience tool for quickly fethcing trivial code and
> modifying it for your own purposes. People who copy code blindly can
> also do it manually after all.)


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2013-12-27  9:54 Search StackOverflow and paste code snippets without leaving the edited file Andrey Tykhonov
@ 2013-12-27 11:12 ` Tom
       [not found] ` <CAD3zm21kt_JReiDRufhY_TbG7V8rc3TLW+uah3oxq8+xE_tQEw@mail.gmail.com>
  1 sibling, 0 replies; 38+ messages in thread
From: Tom @ 2013-12-27 11:12 UTC (permalink / raw)
  To: help-gnu-emacs

Andrey Tykhonov <atykhonov <at> gmail.com> writes:

> I was glad to find your letter in the inbox about idea to write a port for
> sublime-howdoi-direct-paste. I was looking for some small Emacs project to
> implement. And I decided to implement howdoi for emacs.
> 
> Check out the emacs-howdoi: https://github.com/atykhonov/emacs-howdoi
> 

Nice. I haven't tried it yet, because I need to install the howdoi tool first.

A possible future improvement can be implementing the parsing/fetching part
in elisp, so the package is not dependent on an external tool. I checked
the source of the howdoi app and it seems fairly trivial.




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Fwd: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]   ` <CAM7J8HJtU3=ACaZ=WgQi5_kEq-ecnTNPiQgCxC8h79+0ZMTMuw@mail.gmail.com>
@ 2013-12-27 21:40     ` Andrey Tykhonov
  2013-12-29 17:43       ` York Zhao
  0 siblings, 1 reply; 38+ messages in thread
From: Andrey Tykhonov @ 2013-12-27 21:40 UTC (permalink / raw)
  To: help-gnu-emacs

(Forgot include help-gnu-emacs in CC)


2013/12/27 Andrey Tykhonov <atykhonov@gmail.com>

> Hi York Zhao!
>
> Thanks for such detailed description of the issues which you've
> experienced during `howdoi` installation. Thank you that you've posted this
> here!
>
> Your letter for me is the strong reason why python' `howdoi` needs to be
> excluded from `emacs-howdoi` dependencies.
>
> And I'm currently working on this. So `emacs-howdoi` will be working
> without `python-howdoi` and thus `python-howdoi` will be not required to be
> installed any more. I have already implemented some prototype and I'm going
> to finish it during next several days... May be even today I'll provide
> some basic version, will see... Please wait.
>
> P.S. Well, I were using linux and I've installed `howdoi` from the system
> repository. And it works just good for me without any issues. I took a look
> at the source of `python-howdoi` and the message "Sorry, couldn't find
> any help with that topic" doesn't bring me any idea why it behaves so. (May
> be in spare time I'll try to reproduce and investigate it on windows). By
> the way if you still want to install `python-howdoi` you could try via
> `python setup.py install` as you did. Just before it install setuptools:
> download https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py and
> execute by means of python. However I'm not sure that that will be helpful.
>
>
> Thank you!
>
>
> Andrey
>
>
> 2013/12/27 York Zhao <gtdplatform@gmail.com>
>
>> Hi Andrey Tykhonov,
>>
>> Thank for introducing the "howdoi", sounds cool so I decided to give it a
>> shot.
>>
>> I forked the "howdoi" repository first and followed the installation
>> instruction, in bash from msysGit I typed:
>>
>> $ python setup.py install
>>
>> And I got the following error:
>>
>> Traceback (most recent call last):
>>   File "setup.py", line 3, in <module>
>>     from setuptools import setup, find_packages
>> ImportError: No module named setuptools
>>
>> So I downloaded "A standalone Windows executable with the howdoi
>> application"
>> from their link at github, I tried all their examples, but always got the
>> response "Sorry, couldn't find any help with that topic". For example, I
>> typed:
>>
>> $ howdoi -a format date bash
>>
>> And I got:
>>
>> Sorry, couldn't find any help with that topic
>>
>> I'm sorry I should have posted this to "howdoi" but I just thought you
>> were
>> using Windows as well and so I just wanted to see if you have a quick
>> answer to
>> my problem.
>>
>>
>> Thanks in advance,
>>
>> York
>>
>> On Fri, Dec 27, 2013 at 4:54 AM, Andrey Tykhonov <atykhonov@gmail.com>
>> wrote:
>> > Hi Tom,
>> >
>> > I was glad to find your letter in the inbox about idea to write a port
>> for
>> > sublime-howdoi-direct-paste. I was looking for some small Emacs project
>> to
>> > implement. And I decided to implement howdoi for emacs.
>> >
>> > Check out the emacs-howdoi: https://github.com/atykhonov/emacs-howdoi
>> >
>> > I wrote it last night. This is my first Emacs package and I'm relatively
>> > new in Emacs/elisp... Therefore any comments due to code (and
>> functionality
>> > overall), suggestions, ideas about new features etc etc etc will be
>> highly
>> > appreciated.
>> >
>> >
>> > Thank you!
>> >
>> >
>> > Andrey T.
>> >
>> >> Check out the animgif demonstration here:
>> >
>> >> https://github.com/azac/sublime-howdoi-direct-paste[1]
>> >
>> >> It can be a good little Emacs project for the holidays if someone
>> >> wants to do a port.
>> >
>> >
>> >> (And I know: you shouldn't copy code blindly from the internet. It's
>> >> only a convenience tool for quickly fethcing trivial code and
>> >> modifying it for your own purposes. People who copy code blindly can
>> >> also do it manually after all.)
>>
>
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2013-12-27 21:40     ` Fwd: " Andrey Tykhonov
@ 2013-12-29 17:43       ` York Zhao
  2014-01-03 14:36         ` Andrey Tykhonov
  0 siblings, 1 reply; 38+ messages in thread
From: York Zhao @ 2013-12-29 17:43 UTC (permalink / raw)
  To: Andrey Tykhonov; +Cc: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2013-12-29 17:43       ` York Zhao
@ 2014-01-03 14:36         ` Andrey Tykhonov
  2014-01-03 17:51           ` Tom
  2014-01-04 23:26           ` York Zhao
  0 siblings, 2 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-03 14:36 UTC (permalink / raw)
  To: York Zhao, adatgyujto; +Cc: help-gnu-emacs

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 <your-query> 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
(<your-query>).

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/<https://github.com/atykhonov/emacs-howdoi/blob/master/howdoi.el>
git-repository,
use and enjoy!

Look forward for your comments, suggestions, opinions, feature requests!...



Best regards,
Andrey


2013/12/29 York Zhao <gtdplatform@gmail.com>

> 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
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-03 14:36         ` Andrey Tykhonov
@ 2014-01-03 17:51           ` Tom
  2014-01-04 23:22             ` Andrey Tykhonov
  2014-01-04 23:26           ` York Zhao
  1 sibling, 1 reply; 38+ messages in thread
From: Tom @ 2014-01-03 17:51 UTC (permalink / raw)
  To: help-gnu-emacs

Andrey Tykhonov <atykhonov <at> gmail.com> writes:

> 
> 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.

Now that it does not need an external tool I tried it and it seems to
work nicely. Good job.


> 
> 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.

I think it's a good decision not to add external dependencies if it
can be avoided.  I liked it that the package is self contained and it
does not need additional libraries to install.


> Look forward for your comments, suggestions, opinions, feature requests!...

Some ideas:

- There could be a message when the question is retrieved, so the
user sees something is happening. Minor issue.

- A key could be added, so the user can jump to the question on 
stackoverflow from the howdoi buffer.

- Sometimes there are links in the answer:

E.g. Have a look at <a href="...">str_replace</a>

These could be rendered as links, so the user can click on them in the
howdoi buffer.


It occured to me it would be convenient to choose from a list of
suggestions when inputting the search query, similary when searching
on google, but this latter feature does not need to be added to
howdoi, because helm already implemented it, so it's trivial to create
a helm source which calls howdoi. I just mention it here, so potential
users know they can easily enhance howdoi input with helm:

https://github.com/emacs-helm/helm/blob/master/helm-net.el#L199




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
@ 2014-01-03 17:53 Rustom Mody
  2014-01-03 18:19 ` Tom
  0 siblings, 1 reply; 38+ messages in thread
From: Rustom Mody @ 2014-01-03 17:53 UTC (permalink / raw)
  To: help-gnu-emacs

Andrey Tykhonov wrote:
> 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.

Parsing html with regexp??
Well there is this famous stack overflow post you should see

http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1758162#1758162



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-03 17:53 Rustom Mody
@ 2014-01-03 18:19 ` Tom
  0 siblings, 0 replies; 38+ messages in thread
From: Tom @ 2014-01-03 18:19 UTC (permalink / raw)
  To: help-gnu-emacs

Rustom Mody <rustompmody <at> gmail.com> writes:
 
> Parsing html with regexp??
> Well there is this famous stack overflow post you should see
> 

Full parsing and searching for specific tags is not the same thing.





^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-03 17:51           ` Tom
@ 2014-01-04 23:22             ` Andrey Tykhonov
  2014-01-05 21:11               ` Tom
  0 siblings, 1 reply; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-04 23:22 UTC (permalink / raw)
  To: Tom; +Cc: help-gnu-emacs

2014/1/3 Tom <adatgyujto@gmail.com>

> Andrey Tykhonov <atykhonov <at> gmail.com> writes:
>
> >
> > 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.
>
> Now that it does not need an external tool I tried it and it seems to
> work nicely. Good job.
>

Thank you, Tom!


>
>
> >
> > 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.
>
> I think it's a good decision not to add external dependencies if it
> can be avoided.  I liked it that the package is self contained and it
> does not need additional libraries to install.
>
>
> > Look forward for your comments, suggestions, opinions, feature
> requests!...
>
> Some ideas:
>
> - There could be a message when the question is retrieved, so the
> user sees something is happening. Minor issue.


Fixed (I hope a message is good enough: "Answer retrieved!")


>
> - A key could be added, so the user can jump to the question on
> stackoverflow from the howdoi buffer.


A key has been added. So a question could be browsed by C-c C-o key binding.


>
> - Sometimes there are links in the answer:
>

Yes, that's right.


>
> E.g. Have a look at <a href="...">str_replace</a>
>
> These could be rendered as links, so the user can click on them in the
> howdoi buffer.
>

I started implementation of this task. Well... I'm going to replace "<a
href="http://google.com">Google!</a>" by a "Google!" and insert it as a
button (by means of insert-button). So it will be possible to click on such
text or hit RET to browse a link (seems this part of functionality is not
so good for regexps).


>
>
> It occured to me it would be convenient to choose from a list of
> suggestions when inputting the search query, similary when searching
> on google, but this latter feature does not need to be added to
> howdoi, because helm already implemented it, so it's trivial to create
> a helm source which calls howdoi. I just mention it here, so potential
> users know they can easily enhance howdoi input with helm:
>
> https://github.com/emacs-helm/helm/blob/master/helm-net.el#L199


Great! I dreamed about such ability! Ability from emacs to make a query
with auto-completion to the google. I tried helm but didn't discover it
enough to find it useful for me.

It would very good for me also to have ability to make howdoi queries with
suggestions! I took a look at source code but didn't find nice solution
yet. Please share your code snippet.

One thing is actual for me which stops me from using howdoi more actively.
For some reason howdoi query permanently takes up to 10 seconds. It makes
me waiting (emacs is unresponsible during a query)... helm-google-suggest
works fine. However sometimes it hangs out... Sometimes... And now I'm
thinking: what can obstructs http requests being more fast?


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-03 14:36         ` Andrey Tykhonov
  2014-01-03 17:51           ` Tom
@ 2014-01-04 23:26           ` York Zhao
  2014-01-04 23:52             ` Andrey Tykhonov
  1 sibling, 1 reply; 38+ messages in thread
From: York Zhao @ 2014-01-04 23:26 UTC (permalink / raw)
  To: Andrey Tykhonov; +Cc: help-gnu-emacs, Tom

Hi Andrey,

I just tried it, it's interesting, could be a potential time saver, thank you.
And I agree with Tom that it mould be better to be able to jump to the original
article at Stack Overflow. And of course add a Helm source to utilize Google
Suggestion.

York



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-04 23:26           ` York Zhao
@ 2014-01-04 23:52             ` Andrey Tykhonov
  2014-01-05  0:23               ` York Zhao
  0 siblings, 1 reply; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-04 23:52 UTC (permalink / raw)
  To: York Zhao; +Cc: help-gnu-emacs, Tom

2014/1/5 York Zhao <gtdplatform@gmail.com>

> Hi Andrey,
>

Hi York!


>
> I just tried it, it's interesting, could be a potential time saver, thank
> you.
>

Thank you!


> And I agree with Tom that it mould be better to be able to jump to the
> original
> article at Stack Overflow.


Already implemented and committed. You can check out it. Use C-c C-o in a
pop up buffer to open original article.


> And of course add a Helm source to utilize Google
> Suggestion.
>

Also want that functionality. Asked Tom to share code snippet with this
functionality.



Andrey


>
> York
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-04 23:52             ` Andrey Tykhonov
@ 2014-01-05  0:23               ` York Zhao
  2014-01-05  1:23                 ` Andrey Tykhonov
       [not found]                 ` <mailman.11053.1388885009.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 38+ messages in thread
From: York Zhao @ 2014-01-05  0:23 UTC (permalink / raw)
  To: Andrey Tykhonov; +Cc: help-gnu-emacs, Tom

Hi Andrey,

Jump to Stack Overflow worked. Thank you.

P.S. Why use minor mode in the result buffer? In my opinion, it is better to use
major mode for this purpose.

York



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-05  0:23               ` York Zhao
@ 2014-01-05  1:23                 ` Andrey Tykhonov
       [not found]                 ` <mailman.11053.1388885009.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-05  1:23 UTC (permalink / raw)
  To: York Zhao; +Cc: help-gnu-emacs, Tom

2014/1/5 York Zhao <gtdplatform@gmail.com>

> Hi Andrey,
>
> Jump to Stack Overflow worked. Thank you.
>

Nice!


>
> P.S. Why use minor mode in the result buffer? In my opinion, it is better
> to use
> major mode for this purpose.
>

First of all because it is small enough, in my opinion, to be a major mode.
It contains in itself only three key bindings. So I decided that minor mode
will be appropriate. And also may be because I was thinking about feature
when some appropriate major mode will be turned on for a pop up buffer. For
example, you make a query "python file exists", howdoi.el sees that query
contains some keyword which could be related to major mode ("python") and
turns on python-mode (in a pop up buffer). But as I understand such feature
could be good only when code snippets are requested. I mean that cases when
someone wants just code snippets (without any explanations, without context
etc) would be probably rare appeared (therefore I removed such
functionality for an pop up buffer). However I'm not sure. For me it is
much more better to get an answer with short context. And in case of code +
explanation major mode (such as python-mode) is inappropriate there...

So, for now, there is no any major mode and minor mode is implemented.
However look forward for ideas about major mode. How it could make
howdoi.el better? Which benefits do you see?


Andrey


> York
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                 ` <mailman.11053.1388885009.10748.help-gnu-emacs@gnu.org>
@ 2014-01-05  2:05                   ` Emanuel Berg
  2014-01-06  1:08                     ` Marcin Borkowski
                                       ` (3 more replies)
  0 siblings, 4 replies; 38+ messages in thread
From: Emanuel Berg @ 2014-01-05  2:05 UTC (permalink / raw)
  To: help-gnu-emacs

Andrey Tykhonov <atykhonov@gmail.com> writes:

> First of all because it is small enough, in my
> opinion, to be a major mode.  It contains in itself
> only three key bindings. So I decided that minor mode
> will be appropriate.

First of all, this project seems to be an absolute
*killer*! M-a-r-v-e-l-o-u-s!

As for major mode or not, I don't see why this should
not be a major mode. Weather it should be a major mode
or a minor mode is not a function of the project's
size, but *character*. Why don't make a whole interface
around this tool with one-key strokes? I.e., not `C-x
p' or the like for previous question, but simply
`p'. If you want this module to be reached from other
modes, you can have that *interface* a minor mode,
because this module truly reaches over the entire span
of computer activity.

Some other thoughts:

I can't stand web browsers for a thousand real and
imagined reasons, but there is no denying the human
"weight" does make the web indispensable.

Gnus and Usenet, for example, should be a hundred times
better than the hysterical SX sites, but because of
the popularity of those sites, and the marginalization
of lots of Usenet newsgroups (or Google groups, now),
it doesn't matter. It is just reality. It is hard to
beat thousands of programmers who are eager to prove
themselves and are neurotic about their
"reputation". Sad state, but submit a question - one
second later, you have a correct answer. Like I said,
hard to beat.

With tools like this, perhaps in time, we can have "the
best of both worlds".

If you like, check out some interface hacks I did to
w3m [1]. It is all about getting the contents of Google
searches, YouTube, Pirate Bay, Wikipedia, etc., and to
have that integrated with you Emacs buffer (the region,
or word-at-point, to fire off searches). It has been
working good for me, though your project is a big leap
beyond those mere interfaces. Anyway, keep it up :)

[1] http://user.it.uu.se/~embe8573/conf/.emacs-w3m

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-04 23:22             ` Andrey Tykhonov
@ 2014-01-05 21:11               ` Tom
  2014-01-10 10:23                 ` Andrey Tykhonov
  0 siblings, 1 reply; 38+ messages in thread
From: Tom @ 2014-01-05 21:11 UTC (permalink / raw)
  To: help-gnu-emacs

Andrey Tykhonov <atykhonov <at> gmail.com> writes:
> >
> > - There could be a message when the question is retrieved, so the
> > user sees something is happening. Minor issue.
> 
> Fixed (I hope a message is good enough: "Answer retrieved!")

I meant a message during the retrieval ("Retrieving answer..."),
because sometimes a few seconds elapses while the answer is retrieved
and the user has no feedback then. 

> 
> Great! I dreamed about such ability! Ability from emacs to make a query
> with auto-completion to the google. I tried helm but didn't discover it
> enough to find it useful for me.
> 
> It would very good for me also to have ability to make howdoi queries with
> suggestions! I took a look at source code but didn't find nice solution
> yet. Please share your code snippet.
> 

I simply I copied the google suggest source and changed the action to
howdoi:

(setq helm-howdoi
  '((name . "howdoi google")
    (candidates . (lambda ()
                    (funcall helm-google-suggest-default-function)))
    (action . (("howdoi" . howdoi-query)))
    (volatile)
    (requires-pattern . 3)
    (delayed)))


and then you can call howdoi via helm like this:

(helm :sources 'helm-howdoi)





^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-05  2:05                   ` Emanuel Berg
@ 2014-01-06  1:08                     ` Marcin Borkowski
       [not found]                     ` <mailman.11158.1388970524.10748.help-gnu-emacs@gnu.org>
                                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 38+ messages in thread
From: Marcin Borkowski @ 2014-01-06  1:08 UTC (permalink / raw)
  To: help-gnu-emacs

Dnia 2014-01-05, o godz. 03:05:17
Emanuel Berg <embe8573@student.uu.se> napisał(a):

> Andrey Tykhonov <atykhonov@gmail.com> writes:
> 
> > First of all because it is small enough, in my
> > opinion, to be a major mode.  It contains in itself
> > only three key bindings. So I decided that minor mode
> > will be appropriate.
> 
> First of all, this project seems to be an absolute
> *killer*! M-a-r-v-e-l-o-u-s!

Agreed.

> [...] It is just reality. It is hard to
> beat thousands of programmers who are eager to prove
> themselves and are neurotic about their
> "reputation". Sad state, but submit a question - one
> second later, you have a correct answer. Like I said,
> hard to beat.

I'm afraid that you are mistaken here.  I guess they are not
"neurotic", but just normal.  In other words, this is how human beings
work...  And I don't find it very sad, either, though maybe a bit
amusing.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                     ` <mailman.11158.1388970524.10748.help-gnu-emacs@gnu.org>
@ 2014-01-06  2:06                       ` Emanuel Berg
  2014-01-06 22:05                         ` Marcin Borkowski
                                           ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Emanuel Berg @ 2014-01-06  2:06 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> I'm afraid that you are mistaken here.  I guess they
> are not "neurotic", but just normal.  In other words,
> this is how human beings work...  And I don't find it
> very sad, either, though maybe a bit amusing.

If they do too much of those sites, if they are not
neurotic, they will be soon enough.

What is neurotic about it is that they have (at least)
two incorrect assumptions, first there is a "correct"
answer and discussion can at most be allowed in the
commentator fields. In facts, things can be discussed
for ages and that is a fine way to do it.

Second, that those sites are "mutually exclusive". This
is delirious. There is "ask Ubuntu" - but what is
Ubuntu? Ubuntu is Debian, and Debian is Linux, and
Linux is Unix, and Unix is software, and software is
achieved by programming... it is all interconnected,
and at several levels at that.

And this "artificial perfection" makes for frustration
because reality is never perfect, and when this
happens, which is all the time, if you can't decode it
for what it is (reality), you'll just be
frustrated. And this is why (you might have noticed)
that people are very fast at upvoting when some guy is
mastering some other guy, telling him his question
doesn't make sense, he posted in the "incorrect" site,
and so on.

That's why I like Usenet much more because here, when
you act like a moron, you are simply a moron, because
you are human, and you don't need to "recode" it in any
other way, claiming some other guy didn't stick to the
rules, bubbling about the nature of the site, etc.

Just because we do computers, doesn't mean we *are*
computers, and we will never be, thank god.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-06  2:06                       ` Emanuel Berg
@ 2014-01-06 22:05                         ` Marcin Borkowski
  2014-01-06 23:41                         ` Marcin Borkowski
       [not found]                         ` <mailman.11239.1389051686.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 38+ messages in thread
From: Marcin Borkowski @ 2014-01-06 22:05 UTC (permalink / raw)
  To: help-gnu-emacs

Dnia 2014-01-06, o godz. 03:06:47
Emanuel Berg <embe8573@student.uu.se> napisał(a):

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
> 
> > I'm afraid that you are mistaken here.  I guess they
> > are not "neurotic", but just normal.  In other words,
> > this is how human beings work...  And I don't find it
> > very sad, either, though maybe a bit amusing.
> 
> If they do too much of those sites, if they are not
> neurotic, they will be soon enough.

Maybe this is a good point...

> Just because we do computers, doesn't mean we *are*
> computers, and we will never be, thank god.

I guess that we might be both right here.  I have very little
experience with StackOverflow, and much more with TeX.StackExchange,
and now I recall that I find the latter much, much friendlier
(especially toward newbies).  I'm not sure whether cases of downvoting
I've seen ran into two digit numbers, for instance.  Also, closing
questions is a very rare situation.  And after looking at a few
discussions on SO, I was appalled by the nastiness of some comments...

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-06  2:06                       ` Emanuel Berg
  2014-01-06 22:05                         ` Marcin Borkowski
@ 2014-01-06 23:41                         ` Marcin Borkowski
       [not found]                         ` <mailman.11239.1389051686.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 38+ messages in thread
From: Marcin Borkowski @ 2014-01-06 23:41 UTC (permalink / raw)
  To: help-gnu-emacs

And two more afterthoughts (SCNR).

Dnia 2014-01-06, o godz. 03:06:47
Emanuel Berg <embe8573@student.uu.se> napisał(a):

> Second, that those sites are "mutually exclusive". This
> is delirious. There is "ask Ubuntu" - but what is
> Ubuntu? Ubuntu is Debian, and Debian is Linux, and
> Linux is Unix, and Unix is software, and software is
> achieved by programming... it is all interconnected,
> and at several levels at that.

Disagreed.  Then, why do we teach algebra, combinatorics, analysis and
set theory as different subjects at the university?  Answer: this is
technically easier, and some people just like algebra/analysis/whatnot
more.

And, there are i.e. some Ubuntu-specific questions, completely
unrelated to, say, Gentoo or programming in general.

> And this "artificial perfection" makes for frustration
> because reality is never perfect, and when this
> happens, which is all the time, if you can't decode it
> for what it is (reality), you'll just be
> frustrated. And this is why (you might have noticed)
> that people are very fast at upvoting when some guy is
> mastering some other guy, telling him his question
> doesn't make sense, he posted in the "incorrect" site,
> and so on.
> 
> That's why I like Usenet much more because here, when
> you act like a moron, you are simply a moron, because
> you are human, and you don't need to "recode" it in any
> other way, claiming some other guy didn't stick to the
> rules, bubbling about the nature of the site, etc.

None of these ("artificial perfection", "one and only one correct
answer" etc.) are commonly observed on TeX.SE.  Maybe it's just a
smaller community, and the site is not very formal.  For instance, some
time ago there was a discussion on TeX.SE about a particular style by
one particular person.  A newcomer (from SO) started to correct her
posts (which are typed exclusively in lowercase).  His corrections were
promptly reverted, since it is a well-known person, and her usage of
lower- and uppercase is a well-known habit, conveying concrete
information (she uses uppercase iff she writes on behalf of the
institution she works for).  Yes, there is a rule that posts should be
correct from grammatical point of view, but here the community decided
to screw that rule for some clear reason, and everybody is fine.
(Well, everybody was fine, apart from one guy from SO, who claimed that
this particular rule was more important than what the community did.
He found no supporters.)

Another example: on the TeX.SE blog there are (from time to time)
interviews with the most famous users.  The interviews are conducted on
the chat, and *every* user may ask a question.  There's nothing like
that at SO, AFAIK (podcasts are, I guess, a bit different thing - I've
never listened to them, so this is a guess only).

Why am I writing all this OT stuff here?  One of the reasons is that I
have to write that the Emacs community seems to me one of rather few
internet communities with similar features as the TeX community: small,
maybe even niche, but very friendly.

Thank you all!

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                         ` <mailman.11239.1389051686.10748.help-gnu-emacs@gnu.org>
@ 2014-01-07 18:54                           ` Emanuel Berg
  0 siblings, 0 replies; 38+ messages in thread
From: Emanuel Berg @ 2014-01-07 18:54 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> None of these ("artificial perfection", "one and only
> one correct answer" etc.) are commonly observed on
> TeX.SE.

It is very interesting that you mention this because
this is *exactly* me experience, and I have actually
written about that in this group when this was
discussed perhaps a year ago.

Though I can't see the difference (I did lots of LaTeX
a while back, while doing programming at the same time)
- it must be something with the nature of that work
(publishing and typesetting) that don't produce as much
frustration as does programming.

> Disagreed.  Then, why do we teach algebra,
> combinatorics, analysis and set theory as different
> subjects at the university?  Answer: this is
> technically easier, and some people just like
> algebra/analysis/whatnot more.

The university analogy is correct in the sense that is
a way to do it, and it works. However, if you ask the
math teacher in algebra class a calculus question, what
will happen is most probably [s]he will answer that
question to the best of her/his ability. If not
possible, [s]he will explain how that is another field
and make a mental note to later contemplate how that
off-topic (or was it?) question popped up, and decide
perhaps it relates somehow, in which case [s]he should
go to the library and try to assemble a rudimentary
answer for next time. What will most definitely *not*
happen is that the teacher will bark "that's not what
we do here" and the rest of the class will give her/him
a standing ovation.

As for the sites, I agree the division is a practical
thing. However, the practical thing should never be an
obstacle, because then it is not practical anymore, is
it? On the SX sites, I don't think the practical
solution is an obstacle exclusively in-itself, in fact,
I think it makes sense on the blueprint, only when
(some) people use those sites, they run into dead ends,
and when they do, on those sites it is very difficult to
express anything other than "questions and answers",
and this is why to me it sure looks like when they are
angry at newcomers and bubble haughtily about the nature
of their sites, the tone of that tells me that they are
actually frustrated about other things completely. You
probably think I'm an amateur psychologist now but
that's how it looks to me.

But there are other reasons I like Usenet more. One is
the common interface for everything. Another reason is
the text-only style. Take a look below. I don't think
you will ever have the like on a "Q&A" site. And, there
are questions and answers here, too. Why not have it
all, and programmable at that, when it is so easy to
have?

http://www.google.com/googlegroups/archive_announce_20.html

> And, there are i.e. some Ubuntu-specific questions,
> completely unrelated to, say, Gentoo or programming
> in general.

Yes, there are such cases but there are as many cases
where things are not as easily isolated from each
other. I think it is much better to just give it your
all, and not bicker about such things.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-05  2:05                   ` Emanuel Berg
  2014-01-06  1:08                     ` Marcin Borkowski
       [not found]                     ` <mailman.11158.1388970524.10748.help-gnu-emacs@gnu.org>
@ 2014-01-10 10:00                     ` Andrey Tykhonov
  2014-01-10 12:43                       ` Paul Smith
       [not found]                       ` <mailman.11515.1389357802.10748.help-gnu-emacs@gnu.org>
       [not found]                     ` <mailman.11510.1389348059.10748.help-gnu-emacs@gnu.org>
  3 siblings, 2 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-10 10:00 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

2014/1/5 Emanuel Berg <embe8573@student.uu.se>

> Andrey Tykhonov <atykhonov@gmail.com> writes:
>
> > First of all because it is small enough, in my
> > opinion, to be a major mode.  It contains in itself
> > only three key bindings. So I decided that minor mode
> > will be appropriate.
>
> First of all, this project seems to be an absolute
> *killer*! M-a-r-v-e-l-o-u-s!
>

Let's make a GNU Emacs a better place to live! :-)


>
> As for major mode or not, I don't see why this should
> not be a major mode. Weather it should be a major mode
> or a minor mode is not a function of the project's
> size, but *character*. Why don't make a whole interface
> around this tool with one-key strokes? I.e., not `C-x
> p' or the like for previous question, but simply
> `p'. If you want this module to be reached from other
> modes, you can have that *interface* a minor mode,
> because this module truly reaches over the entire span
> of computer activity.
>

I got the reason to implement major mode! Thank you!
I just recently committed the major mode and now "n", "p", "b", "q", "<",
">" key bindings (for next, previous, browse, quit-window, beginning of
buffer, end of buffer) are available in a pop up buffer. Also there is
minor mode (howdoi-minor-mode) available with such key bindings:

C-c o n - howdoi-show-next-question
C-c o p - howdoi-show-previous-question
C-c o c - howdoi-show-current-question
C-c o b - howdoi-browse-current-question
C-c o q - howdoi-query
C-c o l - howdoi-query-line-at-point
C-c o r - howdoi-query-line-at-point-replace-by-code-snippet

I'm not sure that I chose right prefix "C-c o". I hope it will be ok.


>
> Some other thoughts:
>
> I can't stand web browsers for a thousand real and
> imagined reasons, but there is no denying the human
> "weight" does make the web indispensable.
>
> Gnus and Usenet, for example, should be a hundred times
> better than the hysterical SX sites, but because of
> the popularity of those sites, and the marginalization
> of lots of Usenet newsgroups (or Google groups, now),
> it doesn't matter. It is just reality. It is hard to
> beat thousands of programmers who are eager to prove
> themselves and are neurotic about their
> "reputation". Sad state, but submit a question - one
> second later, you have a correct answer. Like I said,
> hard to beat.
>
> With tools like this, perhaps in time, we can have "the
> best of both worlds".
>
> If you like, check out some interface hacks I did to
> w3m [1].

It is all about getting the contents of Google
> searches, YouTube, Pirate Bay, Wikipedia, etc., and to
> have that integrated with you Emacs buffer (the region,
> or word-at-point, to fire off searches).


I will check out it. Quite interesting how you've customized w3m!


> It has been
> working good for me, though your project is a big leap
> beyond those mere interfaces. Anyway, keep it up :)
>

Thank you!
If you have any ideas how to make `howdoi` better please share!


>
> [1] http://user.it.uu.se/~embe8573/conf/.emacs-w3m
>
> --
> underground experts united:
> http://user.it.uu.se/~embe8573
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-05 21:11               ` Tom
@ 2014-01-10 10:23                 ` Andrey Tykhonov
  2014-01-10 16:49                   ` Tom
       [not found]                   ` <mailman.11532.1389372624.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-10 10:23 UTC (permalink / raw)
  To: Tom; +Cc: help-gnu-emacs

Great! I'll add this code snippet to the README. It makes howdoi much more
usable. How do you think: may be it would be good idea to integrate this
code with howdoi? Of course in case of helm availability.

Yesterday howdoi was significantly improved.
As I was mentioned there is for now major mode available in a pop up buffer
and thus a little bit handy key bindings for navigation within questions.
A message during the retrieval ("Retrieving answer...") has been added.
Also html 2 text transformation was changed. Now links in a pop up buffer
transforms to text-buttons so you can click or RET on it to browse a answer
in a www browser. Also in general transformed answers looks much more
better then before. (I keep going without any third party dependencies).

Please let me know in case of any issues or about things which you don't
like or would like to have improved.


Thank you.
Andrey


2014/1/5 Tom <adatgyujto@gmail.com>

> Andrey Tykhonov <atykhonov <at> gmail.com> writes:
> > >
> > > - There could be a message when the question is retrieved, so the
> > > user sees something is happening. Minor issue.
> >
> > Fixed (I hope a message is good enough: "Answer retrieved!")
>
> I meant a message during the retrieval ("Retrieving answer..."),
> because sometimes a few seconds elapses while the answer is retrieved
> and the user has no feedback then.
>
> >
> > Great! I dreamed about such ability! Ability from emacs to make a query
> > with auto-completion to the google. I tried helm but didn't discover it
> > enough to find it useful for me.
> >
> > It would very good for me also to have ability to make howdoi queries
> with
> > suggestions! I took a look at source code but didn't find nice solution
> > yet. Please share your code snippet.
> >
>
> I simply I copied the google suggest source and changed the action to
> howdoi:
>
> (setq helm-howdoi
>   '((name . "howdoi google")
>     (candidates . (lambda ()
>                     (funcall helm-google-suggest-default-function)))
>     (action . (("howdoi" . howdoi-query)))
>     (volatile)
>     (requires-pattern . 3)
>     (delayed)))
>
>
> and then you can call howdoi via helm like this:
>
> (helm :sources 'helm-howdoi)
>
>
>
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 10:00                     ` Andrey Tykhonov
@ 2014-01-10 12:43                       ` Paul Smith
  2014-01-10 13:18                         ` Drew Adams
  2014-01-10 23:20                         ` Andrey Tykhonov
       [not found]                       ` <mailman.11515.1389357802.10748.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 38+ messages in thread
From: Paul Smith @ 2014-01-10 12:43 UTC (permalink / raw)
  To: Andrey Tykhonov; +Cc: help-gnu-emacs, Emanuel Berg

On Fri, 2014-01-10 at 12:00 +0200, Andrey Tykhonov wrote:
> I'm not sure that I chose right prefix "C-c o". I hope it will be ok.

Please do not use bindings with "C-c <letter>".  They seem unused
because they are reserved for customization by the individual user.
They're the only key bindings so reserved, and we really need to not
override them.

Thanks!




^ permalink raw reply	[flat|nested] 38+ messages in thread

* RE: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 12:43                       ` Paul Smith
@ 2014-01-10 13:18                         ` Drew Adams
  2014-01-10 23:33                           ` Andrey Tykhonov
  2014-01-10 23:20                         ` Andrey Tykhonov
  1 sibling, 1 reply; 38+ messages in thread
From: Drew Adams @ 2014-01-10 13:18 UTC (permalink / raw)
  To: psmith, Andrey Tykhonov; +Cc: help-gnu-emacs, Emanuel Berg

> > I'm not sure that I chose right prefix "C-c o". I hope it will be
> > ok.
> 
> Please do not use bindings with "C-c <letter>".  They seem unused
> because they are reserved for customization by the individual user.
> They're the only key bindings so reserved, and we really need to not
> override them.

Yes.  To elaborate:

In the Elisp manual, `i key TAB' shows `key bindings, conventions for'.
Choosing that takes you to node `Key Binding Conventions', where you
see this among other guidelines, right near the beginning:

 * Don't define `C-c LETTER' as a key in Lisp programs.  Sequences
   consisting of `C-c' and a letter (either upper or lower case) are
   reserved for users; they are the *only* sequences reserved for
   users, so do not block them.

If you are writing a major mode, you owe it to yourself to check
the manual for this and other advice about writing modes.
`i convention TAB' shows you, for example, index entries
`conventions for writing major modes' and `conventions for writing
minor modes'.



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 10:23                 ` Andrey Tykhonov
@ 2014-01-10 16:49                   ` Tom
       [not found]                   ` <mailman.11532.1389372624.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 38+ messages in thread
From: Tom @ 2014-01-10 16:49 UTC (permalink / raw)
  To: help-gnu-emacs

Andrey Tykhonov <atykhonov <at> gmail.com> writes:

> 
> Great! I'll add this code snippet to the README. It makes howdoi much more
> usable. How do you think: may be it would be good idea to integrate this
> code with howdoi? Of course in case of helm availability.

You can add the helm source definition to howdoi and a function
howdoi-helm query which in the first lines requires the needed
helm packages and the calls helm with howdoi.

If the user has helm installed then it works seamlessly and if
he doesn't then he'll get an error message saying helm cannot be
loaded, so he knows helm should be installed.

> Also in general transformed answers looks much more
> better then before. (I keep going without any third party
> dependencies).

According to the first line of this emacswiki page emacs 24.4
has a html renderer built-in. You could check its availability
and fall back to your own solution if it's not available:

http://www.emacswiki.org/emacs/HtmlRendering‎

I haven't tried it, but I guess it covers a lot of cases which
can occur in HTML docs.




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                       ` <mailman.11515.1389357802.10748.help-gnu-emacs@gnu.org>
@ 2014-01-10 18:43                         ` Emanuel Berg
  2014-01-10 21:45                           ` Paul Smith
       [not found]                           ` <mailman.11554.1389390359.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 38+ messages in thread
From: Emanuel Berg @ 2014-01-10 18:43 UTC (permalink / raw)
  To: help-gnu-emacs

Paul Smith <psmith@gnu.org> writes:

>> I'm not sure that I chose right prefix "C-c o". I
>> hope it will be ok.
>
> Please do not use bindings with "C-c <letter>".  They
> seem unused because they are reserved for
> customization by the individual user.  They're the
> only key bindings so reserved, and we really need to
> not override them.

So you say? When I ran out of keystrokes, or close and
short ones at least, I setup a new prefix key, namely
C-o, which is great because it requires minimal
hand/finger movements if you hands are initially at the
"asdf" and "jkl;" positions (assuming the US layout
keyboard). I actually think C-o is better than C-c for
that purpose because with C-c, you have both keys on
the same (left) hand which typically makes for a more
difficult keystroke to hit, though I'm unsure had I
setup the C-o prefix had I known you were "supposed" to
use C-c. Are there any other guidelines for shortcuts?
For modules, and especially those which you would
expect will get a wide spread, I agree you should not
override Emacs convention but for private use it is no
big deal and it is everyone's game. Also, though it
makes sense to make an effort to get it as good as
possible from day one, keep in mind that shortcuts are
perhaps the first things people learn how to setup to
their liking.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                     ` <mailman.11510.1389348059.10748.help-gnu-emacs@gnu.org>
@ 2014-01-10 18:47                       ` Emanuel Berg
  2014-01-10 23:43                         ` Andrey Tykhonov
  0 siblings, 1 reply; 38+ messages in thread
From: Emanuel Berg @ 2014-01-10 18:47 UTC (permalink / raw)
  To: help-gnu-emacs

Andrey Tykhonov <atykhonov@gmail.com> writes:

> I got the reason to implement major mode! Thank you!
> I just recently committed the major mode and now "n",
> "p", "b", "q", "<", ">" key bindings (for next,
> previous, browse, quit-window, beginning of buffer,
> end of buffer) are available in a pop up buffer. Also
> there is minor mode (howdoi-minor-mode) available
> with such key bindings:
>
> C-c o n - howdoi-show-next-question C-c o p -
> howdoi-show-previous-question C-c o c -
> howdoi-show-current-question C-c o b -
> howdoi-browse-current-question C-c o q - howdoi-query
> C-c o l - howdoi-query-line-at-point C-c o r -
> howdoi-query-line-at-point-replace-by-code-snippet
>
> I'm not sure that I chose right prefix "C-c o". I hope
> it will be ok.

Leaving the prefix issue aside (i.e., exactly what
prefix to use), this is a *great* interface: a major
mode for super-fast interaction, and a minor mode with
just a prefix to remember, and then exactly the same
keys.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                   ` <mailman.11532.1389372624.10748.help-gnu-emacs@gnu.org>
@ 2014-01-10 18:54                     ` Emanuel Berg
  2014-01-10 19:58                       ` Stefan Monnier
  2014-01-11  0:21                       ` Andrey Tykhonov
  0 siblings, 2 replies; 38+ messages in thread
From: Emanuel Berg @ 2014-01-10 18:54 UTC (permalink / raw)
  To: help-gnu-emacs

Tom <adatgyujto@gmail.com> writes:

> According to the first line of this emacswiki page
> emacs 24.4 has a html renderer built-in. You could
> check its availability and fall back to your own
> solution if it's not available:
>
> http://www.emacswiki.org/emacs/HtmlRendering‎
>
> I haven't tried it, but I guess it covers a lot of
> cases which can occur in HTML docs.

... but don't be too fast to just employ everything
just because it is possible. At this point, you (the
developer(s)) of this tool, have a great opportunity to
think what makes sense to include, and what is
redundant. Be sure to enjoy that opportunity :)

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 18:54                     ` Emanuel Berg
@ 2014-01-10 19:58                       ` Stefan Monnier
  2014-01-11  0:21                       ` Andrey Tykhonov
  1 sibling, 0 replies; 38+ messages in thread
From: Stefan Monnier @ 2014-01-10 19:58 UTC (permalink / raw)
  To: help-gnu-emacs

>> According to the first line of this emacswiki page
>> emacs 24.4 has a html renderer built-in. You could

This is incorrect: yes, EWW is new in 24.4, but SHR is older.  It was
already in 24.3 and maybe even earlier.


        Stefan




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 18:43                         ` Emanuel Berg
@ 2014-01-10 21:45                           ` Paul Smith
       [not found]                           ` <mailman.11554.1389390359.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 38+ messages in thread
From: Paul Smith @ 2014-01-10 21:45 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

On Fri, 2014-01-10 at 19:43 +0100, Emanuel Berg wrote:
> Paul Smith <psmith@gnu.org> writes:
> 
> >> I'm not sure that I chose right prefix "C-c o". I
> >> hope it will be ok.
> >
> > Please do not use bindings with "C-c <letter>".  They
> > seem unused because they are reserved for
> > customization by the individual user.  They're the
> > only key bindings so reserved, and we really need to
> > not override them.
> 
> So you say?

Actually, the Emacs Lisp manual says... :-)

> When I ran out of keystrokes, or close and
> short ones at least, I setup a new prefix key, namely
> C-o, though I'm unsure had I
> setup the C-o prefix had I known you were "supposed" to
> use C-c. Are there any other guidelines for shortcuts?

You're not "supposed" to use anything.  It's just you can be confident
that if you DO use that keymap, it won't conflict with any of the modes
that come with emacs or packages you install.

I'm not aware of any other keymaps reserved for users, if that's what
you mean by "guidelines".




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                           ` <mailman.11554.1389390359.10748.help-gnu-emacs@gnu.org>
@ 2014-01-10 21:53                             ` Emanuel Berg
  0 siblings, 0 replies; 38+ messages in thread
From: Emanuel Berg @ 2014-01-10 21:53 UTC (permalink / raw)
  To: help-gnu-emacs

Paul Smith <psmith@gnu.org> writes:

> You're not "supposed" to use anything.  It's just you
> can be confident that if you DO use that keymap, it
> won't conflict with any of the modes that come with
> emacs or packages you install.

Yes, that's what I meant (sort of), and that makes
perfect sense. Thank you.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 12:43                       ` Paul Smith
  2014-01-10 13:18                         ` Drew Adams
@ 2014-01-10 23:20                         ` Andrey Tykhonov
  1 sibling, 0 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-10 23:20 UTC (permalink / raw)
  To: psmith; +Cc: help-gnu-emacs

Paul, thank you for this important note!

I changed "C-c o" prefix to the "C-c C-o".

2014/1/10 Paul Smith <psmith@gnu.org>

> On Fri, 2014-01-10 at 12:00 +0200, Andrey Tykhonov wrote:
> > I'm not sure that I chose right prefix "C-c o". I hope it will be ok.
>
> Please do not use bindings with "C-c <letter>".  They seem unused
> because they are reserved for customization by the individual user.
> They're the only key bindings so reserved, and we really need to not
> override them.
>
> Thanks!
>
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 13:18                         ` Drew Adams
@ 2014-01-10 23:33                           ` Andrey Tykhonov
  0 siblings, 0 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-10 23:33 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Emanuel Berg, psmith

2014/1/10 Drew Adams <drew.adams@oracle.com>

> > > I'm not sure that I chose right prefix "C-c o". I hope it will be
> > > ok.
> >
> > Please do not use bindings with "C-c <letter>".  They seem unused
> > because they are reserved for customization by the individual user.
> > They're the only key bindings so reserved, and we really need to not
> > override them.
>
> Yes.  To elaborate:
>
> In the Elisp manual, `i key TAB' shows `key bindings, conventions for'.
> Choosing that takes you to node `Key Binding Conventions', where you
> see this among other guidelines, right near the beginning:
>
>  * Don't define `C-c LETTER' as a key in Lisp programs.  Sequences
>    consisting of `C-c' and a letter (either upper or lower case) are
>    reserved for users; they are the *only* sequences reserved for
>    users, so do not block them.


> If you are writing a major mode, you owe it to yourself to check
> the manual for this and other advice about writing modes.
> `i convention TAB' shows you, for example, index entries
> `conventions for writing major modes' and `conventions for writing
> minor modes'.
>

Thank you for these references, Drew! I feel that I need to investigate
this question more deeper before changing existing code. I've started with
major mode conventions and will put appropriate changes step by step.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 18:47                       ` Emanuel Berg
@ 2014-01-10 23:43                         ` Andrey Tykhonov
  0 siblings, 0 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-10 23:43 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

2014/1/10 Emanuel Berg <embe8573@student.uu.se>

> Andrey Tykhonov <atykhonov@gmail.com> writes:
>
> > I got the reason to implement major mode! Thank you!
> > I just recently committed the major mode and now "n",
> > "p", "b", "q", "<", ">" key bindings (for next,
> > previous, browse, quit-window, beginning of buffer,
> > end of buffer) are available in a pop up buffer. Also
> > there is minor mode (howdoi-minor-mode) available
> > with such key bindings:
> >
> > C-c o n - howdoi-show-next-question C-c o p -
> > howdoi-show-previous-question C-c o c -
> > howdoi-show-current-question C-c o b -
> > howdoi-browse-current-question C-c o q - howdoi-query
> > C-c o l - howdoi-query-line-at-point C-c o r -
> > howdoi-query-line-at-point-replace-by-code-snippet
> >
> > I'm not sure that I chose right prefix "C-c o". I hope
> > it will be ok.
>
> Leaving the prefix issue aside (i.e., exactly what
> prefix to use), this is a *great* interface: a major
> mode for super-fast interaction, and a minor mode with
> just a prefix to remember, and then exactly the same
> keys.
>

Well, inspired by your note, to make an interface a little bit better I've
changed "C-c C-o q" to the "C-c C-o u" key bindings (minor mode). So it
doesn't somehow intersect with the key binding "q" (major mode). And also
I've added key binding "u" (major mode) to be able to make howdoi-query
directly from a pop up buffer.


>
> --
> underground experts united:
> http://user.it.uu.se/~embe8573
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-10 18:54                     ` Emanuel Berg
  2014-01-10 19:58                       ` Stefan Monnier
@ 2014-01-11  0:21                       ` Andrey Tykhonov
  2014-01-11  0:38                         ` Stefan Monnier
       [not found]                         ` <mailman.11571.1389400713.10748.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 38+ messages in thread
From: Andrey Tykhonov @ 2014-01-11  0:21 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

2014/1/10 Emanuel Berg <embe8573@student.uu.se>

> Tom <adatgyujto@gmail.com> writes:
>
> > According to the first line of this emacswiki page
> > emacs 24.4 has a html renderer built-in. You could
> > check its availability and fall back to your own
> > solution if it's not available:
> >
> > http://www.emacswiki.org/emacs/HtmlRendering
> >
> > I haven't tried it, but I guess it covers a lot of
> > cases which can occur in HTML docs.
>
> ... but don't be too fast to just employ everything
> just because it is possible. At this point, you (the
> developer(s)) of this tool, have a great opportunity to
> think what makes sense to include, and what is
> redundant. Be sure to enjoy that opportunity :)
>

I definitely enjoy such opportunity! :)

For now I think it would be good to integrate some html renderer but only
as optional feature, as such feature which could brings benefits for users
who has emacs 24.4 but in the same time will not break functionality for
those users which still uses emacs < 24.4. Though the version 24.4 (and its
eww) is not the only point... Stefan Monnier mentioned SHR (thank you,
Stefan. Didn't meet this package before), which could be also used but it
depends on libxml. Somebody could have compiled emacs without libxml thus
SHR won't work...

By the way, inspired by your email about w3m, I've tried to render html by
means of it. And for me it provides the best result (though I haven't tried
eww or shr yet). But w3m is third party dependency which could be
unacceptable for somebody... Well, still thinking about next steps :)

Thank you!


Andrey


>
> --
> underground experts united:
> http://user.it.uu.se/~embe8573
>


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
  2014-01-11  0:21                       ` Andrey Tykhonov
@ 2014-01-11  0:38                         ` Stefan Monnier
       [not found]                         ` <mailman.11571.1389400713.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 38+ messages in thread
From: Stefan Monnier @ 2014-01-11  0:38 UTC (permalink / raw)
  To: help-gnu-emacs

> For now I think it would be good to integrate some html renderer but only
> as optional feature, as such feature which could brings benefits for users
> who has emacs 24.4 but in the same time will not break functionality for
> those users which still uses emacs < 24.4. Though the version 24.4 (and its
> eww) is not the only point... Stefan Monnier mentioned SHR (thank you,
> Stefan. Didn't meet this package before), which could be also used but it

No, it's not "also".  There is no "new html renderer" in 24.4.  What is
new in 24.4 is EWW which is not an html renderer but a web-browser,
which uses SHR to do the rendering.

> depends on libxml. Somebody could have compiled emacs without libxml thus
> SHR won't work...

Indeed, so you have to check for libxml's availability before using shr.



        Stefan




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: Search StackOverflow and paste code snippets without leaving the edited file
       [not found]                         ` <mailman.11571.1389400713.10748.help-gnu-emacs@gnu.org>
@ 2014-01-11  1:20                           ` Emanuel Berg
  0 siblings, 0 replies; 38+ messages in thread
From: Emanuel Berg @ 2014-01-11  1:20 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> What is new in 24.4 is EWW which is not an html
> renderer but a web-browser, which uses SHR to do the
> rendering.

Thanks for that fine print clarification. While I
suppose we should be grateful for even more great
software, it would be interesting to know the reasons
for this new browser.

Is it a problem that Emacs-w3m is "3rd party"? I only
have good words for Emacs-w3m - it does its job and it
is so easy to configure, both keys (typically, they use
too long keys, especially for a non-type setting), and
colors (not their fault, because they don't know what
colors I use) - the rest is programmable, as always...

I remember when there were Lynx, but I was put off
because I couldn't make it scroll one line at a time,
and they even said in the manual that this was
impossible. Then there were Links, but I didn't
experience it as near as solid/mature as Lynx (back
then, anyway). Now, I see in the Debian repositories
there are, apart from those two, and w3m, and
Emacs-w3m, also "Elinks", which sounds like Emacs +
Links, but the "E" is for "Enhanced", so it is a fork
of Links, I take it.

So it is a crowded marketplace.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2014-01-11  1:20 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-27  9:54 Search StackOverflow and paste code snippets without leaving the edited file Andrey Tykhonov
2013-12-27 11:12 ` Tom
     [not found] ` <CAD3zm21kt_JReiDRufhY_TbG7V8rc3TLW+uah3oxq8+xE_tQEw@mail.gmail.com>
     [not found]   ` <CAM7J8HJtU3=ACaZ=WgQi5_kEq-ecnTNPiQgCxC8h79+0ZMTMuw@mail.gmail.com>
2013-12-27 21:40     ` Fwd: " Andrey Tykhonov
2013-12-29 17:43       ` York Zhao
2014-01-03 14:36         ` Andrey Tykhonov
2014-01-03 17:51           ` Tom
2014-01-04 23:22             ` Andrey Tykhonov
2014-01-05 21:11               ` Tom
2014-01-10 10:23                 ` Andrey Tykhonov
2014-01-10 16:49                   ` Tom
     [not found]                   ` <mailman.11532.1389372624.10748.help-gnu-emacs@gnu.org>
2014-01-10 18:54                     ` Emanuel Berg
2014-01-10 19:58                       ` Stefan Monnier
2014-01-11  0:21                       ` Andrey Tykhonov
2014-01-11  0:38                         ` Stefan Monnier
     [not found]                         ` <mailman.11571.1389400713.10748.help-gnu-emacs@gnu.org>
2014-01-11  1:20                           ` Emanuel Berg
2014-01-04 23:26           ` York Zhao
2014-01-04 23:52             ` Andrey Tykhonov
2014-01-05  0:23               ` York Zhao
2014-01-05  1:23                 ` Andrey Tykhonov
     [not found]                 ` <mailman.11053.1388885009.10748.help-gnu-emacs@gnu.org>
2014-01-05  2:05                   ` Emanuel Berg
2014-01-06  1:08                     ` Marcin Borkowski
     [not found]                     ` <mailman.11158.1388970524.10748.help-gnu-emacs@gnu.org>
2014-01-06  2:06                       ` Emanuel Berg
2014-01-06 22:05                         ` Marcin Borkowski
2014-01-06 23:41                         ` Marcin Borkowski
     [not found]                         ` <mailman.11239.1389051686.10748.help-gnu-emacs@gnu.org>
2014-01-07 18:54                           ` Emanuel Berg
2014-01-10 10:00                     ` Andrey Tykhonov
2014-01-10 12:43                       ` Paul Smith
2014-01-10 13:18                         ` Drew Adams
2014-01-10 23:33                           ` Andrey Tykhonov
2014-01-10 23:20                         ` Andrey Tykhonov
     [not found]                       ` <mailman.11515.1389357802.10748.help-gnu-emacs@gnu.org>
2014-01-10 18:43                         ` Emanuel Berg
2014-01-10 21:45                           ` Paul Smith
     [not found]                           ` <mailman.11554.1389390359.10748.help-gnu-emacs@gnu.org>
2014-01-10 21:53                             ` Emanuel Berg
     [not found]                     ` <mailman.11510.1389348059.10748.help-gnu-emacs@gnu.org>
2014-01-10 18:47                       ` Emanuel Berg
2014-01-10 23:43                         ` Andrey Tykhonov
  -- strict thread matches above, loose matches on Subject: below --
2014-01-03 17:53 Rustom Mody
2014-01-03 18:19 ` Tom
2013-12-26  7:21 Tom

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.