

Show HN: Emacs Mini Manual - tuhdo
http://tuhdo.github.io/emacs-tutor.html

======
pimgeek
This is really impressive, I'm starting to try Racket coding with Emacs +
Geiser Mode. And I really need some sort of Guides to rely on once in a while.

The following words also sounds convincing:

"If you are a programmer, you should try to automate thing as much as
possible. One way of doing this is using a good editor that automates many
menial and tedious tasks. For example, one of the thing that annoys me is
using the command cd to change into a deep directory path like this:

[/path/to/a/very/long/long/long/long/long/long/..../directory/ ]"

~~~
cmpitg
You might want to combine Geiser with Quack[1] for best result with Scheme.
Also, I think it's worth a shot to have a look at the fairly new Racket-
mode[2] written by Greg[3]. Geiser + Quack are rather old and for Scheme in
general, Racket-mode focuses on and is tightly integrated with Racket.

[1] [http://www.neilvandyke.org/quack/](http://www.neilvandyke.org/quack/) [2]
[https://github.com/greghendershott/racket-
mode](https://github.com/greghendershott/racket-mode) [3]
[http://www.greghendershott.com/](http://www.greghendershott.com/)

~~~
klibertp
racket-mode is good in that it at least indents Racket code properly. It
implements it's own integration with the REPL, IIRC, which makes working with
Geiser at the same time not ideal. But still manageable, just a bit of
tweaking needed. Disclaimer: I may remember wrong or it may have changed since
I was last configuring Racket support in Emacs, so don't get discouraged and
just go check racket-mode anyway :)

------
gnuvince
tuhdo: just to clarify, I am Vincent Foley-Bourgon and yes, I wrote both "Why
I (Still) Use Emacs" articles. I sometimes omit the last part of my last name
since it's often butchered by people who don't speak French.

By the way, thanks for putting both of them up there: I forgot about the one I
put up on Wordpress :D

~~~
tuhdo
Ahhh this is good to know

Thanks for writing such a good article, so people can have a better glimpse of
what Emacs is capable of. It saved my time because I don't have to research
all of those and make my article even longer :D

------
klibertp
[http://tuhdo.github.io/emacs-
tutor.html#text-7-29](http://tuhdo.github.io/emacs-tutor.html#text-7-29) \-
the excersise:

    
    
        C-f to the beginning of each character group and add whitespace.
    

No, don't! Use C-s or even better iy-goto-char
([https://github.com/doitian/iy-go-to-char](https://github.com/doitian/iy-go-
to-char)). This scales much better.

You can also set mark at first 'b' in the first line, go to first 'b' in the
last line and use C-x r t to insert a string across all the lines.

You can of course use regex-replace, too: \\(a+\|b+\|c+\|d+\\) -> \1 <\- space
here

And so on and on. It's good to see well written "introductory courses", like
this one, but what about "Emacs for black belts"? "Advanced Emacsology"? There
is one book about writing Emacs extensions
([http://shop.oreilly.com/product/9781565922617.do](http://shop.oreilly.com/product/9781565922617.do)),
but that's all there is. Does anyone know about another source of knowledge
about the most advanced Emacs techniques?

~~~
tuhdo
I've fixed that. I only wanted something simple for new users to try out the
new feature (Macro).

This manual is only about stock Emacs features, not adding complexity with 3rd
party packages. When I first introduced on Reddit, someone advised me to stick
to stock Emacs (which I did) because they see this section using an external
package (ggtags) for browsing kernel source code:
[http://tuhdo.github.io/emacs-tutor.html#sec-8](http://tuhdo.github.io/emacs-
tutor.html#sec-8). When people are good with the basics, they understand what
they need and find appropriate packages.

If you want advance techniques, the primary resource should be Emacs Lisp
Manual, Emacs docstrings, and learn code written by package maintainers.

EDIT: Even before working with Emacs Lisp, using 3rd party packages already
makes Emacs much more advanced.

~~~
klibertp
> If you want advance[d] techniques, the primary resource should be Emacs Lisp
> Manual, Emacs docstrings, and learn[ing] code written by package
> maintainers.

(I'm also learning English, so I know that having your mistakes pointed out
helps - that's what the [] are for in the quote)

Yeah, been there, done that. :) Docstrings and easy access to source code
(find-function, find-library) are a great strength of Emacs - not only the
documentation is of great quality, but it's mostly up-to-date. But going
through packages' sources is not always pleasant: some authors are not very
good with English (like me, for example), others have a dislike for writing
comments, yet others are biased against cl-lib or too much in favour of eieio
and so on. It's still a great learning experience, but it takes more time than
it could take if the content was presented more systematically and in a more
readable manner. Like in a book. Or a series of articles, or something. Note:
I _am_ thinking about writing something like this myself, but I don't feel
confident enough just yet.

> someone advised me to stick to stock Emacs

I think it's stupid advice - bad for both programmers and non-programmers. If
you're a programmer, using Emacs is (should be) about endless customization,
tweaking and - you guessed it - _programming_ your editor to do your work for
you. In this case learning to use C-f instead of right arrow is so stupid it
_hurts_ \- you should learn about define-key, make-sparse-keymap, global-set-
key, describe-keymap (and generally describe-...) and of course apropos
instead. I guarantee it will take you less time than making C-f a habit!
That's the way I learned Emacs: I started learning with Emacs Lisp Manual, not
a tutorial or Emacs Manual and it got me up to speed in no time at all.
Instead of learning what keys to press to do something it's better - again,
for programmers - to just learn the name of a function which does what you
want. It's true that I don't use many standard keybindings and I remapped most
of them, but this is ok, because this is my editor and nobody else is going to
use it anyway. And when I started fiddling with packages I already knew how to
hack them into shape and dig through their code, which is infinitely better
than just knowing where to find them and praying they have any docs at all :)

And for non-programmers, sticking with vanilla Emacs makes it unnecessarily
painful experience, with 2/3 of useful features disabled by default and
without access to the functionality available via packages, which I'd call
really essential. For non-programmers vanilla Emacs is not that much better
than Notepad++ or Gedit (if at all, considering weird key bindings!) and it's
pointless to stick to it just to "learn about Emacs philosophy" \- non-
programmers won't benefit from "the Emacs way" (which is: being an infinitely
_programmable_ editor!) at all. It's much better for them to grab some Emacs
starter kit, like Prelude or any other starter kit out there and then use
customize-... interface to tweak what they need.

~~~
tuhdo
I did write about customizing and extending Emacs here, and made a clear point
about extending and customizing:

" Because the nature of Emacs is an extensible system, people write extensions
to improve Emacs and share with others. The extensions improve various aspects
of Emacs: Improve existing and add new editing features, integrate 3rd party
tools, add programming languages supports, change Emacs appearance… Without
the ability to extend, Emacs will just be another obscure editor with some
useful features but cannot meet the demands of people, because different
people have different needs, and Emacs maintainers cannot provide them all and
integrate all into Emacs. With the ability to extend, people can bend Emacs
the way they want, much like Lisp.

Unlike other editors which encourage users to stay with the default as much as
they can, Emacs encourages users to customize and extend Emacs as much as they
can."

[http://tuhdo.github.io/emacs-tutor3.html](http://tuhdo.github.io/emacs-
tutor3.html)

I just don't want to mix the two things: Emacs basics and Emacs extending
together in a guide. It should be separate. I used to use packages a lot,
until I realize that many built-in features which I didn't know serve me well.
Learning stock Emacs is beneficial because users get the features that are
always available.

> I started learning with Emacs Lisp Manual, not a tutorial or Emacs Manual
> and it got me up to speed in no time at all

I guess you method could work for, but I think it would be intimidating for
most new users when they first read that to be able to use Emacs, they will
have to learn Emacs Lisp. This is contrasting to everything else, even Vim.

Vanilla Emacs is definitely better than Notepad++ or Gedit:

\- Emacs is an implementation of Emacs Lisp with an editor on top of it. The
other editors are just... editors.

\- Emacs has many useful features such as:

\+ how to use mark and point and region. A useful feature is exchange-point-
and-mark; other editors do not have this.

\+ Dired

\+ ibuffers, that can manage hundreds of buffers

\+ a window management system (so you don't have to use things like tmux,
screen)

\+ registers, you can save anything, like window configuration, text, position

\+ the help system

\+ Bookmark (to quickly access things later)

\+ Calc (a scientific calculator)

\+ CEDET a language framework for building IDE features (like context-
sensitive completion, jump, find references...). The best language it is
supporting is C/C++, as demonstrated in the guide.

...more features that typical editors won't have...

Learning all these things should not require customization and external
packages to further add burden to learners. After people learned something
like Dired, if they want more, they can look it up for packages like Dired+.

Finally, Prelude disables arrow keys and encourage users to use key bindings
like C-f, C-b... I think most of the key bindings for editing in Emacs are
fine and make editing faster. Of course, the bindings are not as ergonomics as
Vim, but it is still much better than other editors.

Since you don't like C-f, C-b... I guess you don't like key bindings with
prefix C-x and C-c as well?

------
baddox
That's a pretty good introduction. I've been using emacs for years, but this
post reminds me that I've never gotten around to setting up a satisfactory
project management system, so that I can grep and find files across the whole
project.

~~~
technomancy
Projectile is neat, but you don't need anything fancy to grep and find across
the project. I just have a single binding to switch to an eshell, and running
rgrep or find commands automatically pops up a hyperlinked buffer containing
results. Having a shell function to cd to the project root helps too.

~~~
baddox
Yeah, right now my workflow is just to use silver searcher in my (non-emacs)
terminal which is always in a window right next to emacs. Eventually I'll take
a few moments to integrate the workflow into emacs.

~~~
tuhdo
You can use Ag right inside Emacs with this package:
[https://github.com/Wilfred/ag.el](https://github.com/Wilfred/ag.el)

If you use Helm, there's helm-ag: [https://github.com/syohex/emacs-helm-
ag](https://github.com/syohex/emacs-helm-ag)

Use MELPA and package manager to install the above packages:
[http://tuhdo.github.io/emacs-
tutor3.html#sec-4-1](http://tuhdo.github.io/emacs-tutor3.html#sec-4-1)

------
MarcScott
This looks like an excellent resource for those new to emacs, and a good
reference for those already using it.

All written in org-mode as well.

Thank you

~~~
jzzskijj
Definitely good for someone already using it. At least in my case.

------
rafaelbeirigo
Mini Mini Manual... ;)

Great material!

------
neonscribe
Nice work. It would be nice if you can find a native English speaker, or at
least someone with stronger English skills, to edit (in the literary sense)
your prose. You manage to get the point across, but the grammatical errors are
distracting.

~~~
tuhdo
Thank for your feedback. I will improve it. Please tell me my mistakes , I
will fix it quick. Even a little is better than none. For your convenience,
feel free to open a new issues at
[https://github.com/tuhdo/tuhdo.github.io](https://github.com/tuhdo/tuhdo.github.io)

~~~
neonscribe
Almost every sentence needs work. What you need is a writer who is fluent in
English to spend a few hours going over it.

~~~
tuhdo
I've fixed some mistakes in sections before the "Concepts" section (which is
the core of the manual). Hopefully it improves reading before getting the
actual part.

------
wyclif
Wow, this is great but I'm a vim user. I'd really love to have something in
this format for vim. Maybe something like that already exists but I just don't
know about it yet?

~~~
vadskye
I would like to write something like this for Vim, but I don't know how to
easily create animated screencaps like those displayed here. Does anyone know
a good tool for that?

~~~
tuhdo
I used byzanz-record for these screenshots:
[http://askubuntu.com/a/123515/13847](http://askubuntu.com/a/123515/13847)

~~~
vadskye
I will look into that, thank you!

------
emlearn5
I learned how to record the window layout with register, but I also want it to
be recorded for next time. but I would like to record this for next time I use
emacs. How to do this?

~~~
tuhdo
You need extension package. Workgroup2 is great for this:
[https://github.com/pashinin/workgroups2](https://github.com/pashinin/workgroups2)

With workgroups2, windows configurations can be stored in a workgroup, and you
can create as many workgroups and named it; later, you can switch back.
Because you can name your window configurations, you don't have the burden to
remember which to which in registers. You can also save your window
configurations to continue using them in later Emacs sessions.

You can issue a command to save current session with workgroup2.

------
mattattaque
As a diehard vim guy, I've always wanted to at least dabble a bit in emacs to
see what it's all about. This will do nicely. Thanks.

------
yoanizer
I don't use Emacs, but this is great. Nice work.

------
Yuioup
I've seen this page before but couldn't get anything to work in Windows.

~~~
tuhdo
Do you use this patched Emacs for Windows:
[http://semantic.supelec.fr/popineau/programming-
emacs.html#s...](http://semantic.supelec.fr/popineau/programming-
emacs.html#sec-2) ? According to the guide in that page:

"There is no installer. All you have to do is:

\- Unpack in a location like c:\Local\

\- Setup a shortcut on your desktop to c:\Local\Emacs\bin\emacsclientw.exe

\- Double click the new shortcut."

Or just use the 32 bit version from official GNU Emacs homepage.

Could you tell me what the problems are? I use Emacs on Windows fine, with all
my 3rd-party packages. At least with stock Emacs, it should work on Windows.

~~~
Yuioup
Hey that look awesome! It's been a while since I last tried Emacs (I'm a vim
on Windows user) but I will definitely check this out.

------
TeMPOraL
Shameless plug: always happy to see Nyan Mode being used ;).

------
nodivbyzero
Well done.

