Emacs 初学者应该教什么? [英] What to teach a beginner in Emacs?

查看:10
本文介绍了Emacs 初学者应该教什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你有一个 10 分钟的实践课程来教别人 Emacs,你会给他们看什么?

<前>启动 emacs:emacs...退出 emacs:C-x C-c

当您站在他们身后时,在启动和退出 Emacs 之间,您还能让他们做什么?

解决方案

如果我只有 10 分钟,我根本不会教他们任何捷径.所有常用快捷键都在菜单中相应命令旁边可用;用户可以自己发现的那些.

要教授的最重要的东西是那些能让用户自己发现/学习的东西:

  • 那个人可以用 C-x C-c 或 File->Quit 退出 Emacs.当卡住时,应该输入C-g,如果这不起作用,则ESC ESC ESC.[这可能是避免对 Emacs 完全失望的唯一最有用的建议,相信我.]

  • 教程:Help->Emacs Tutorial,或C-h t.[这不是一个非常有用的记住捷径;鉴于一个人一生中阅读教程的次数很少...]

  • Emacs 中的每一次按键都绑定到一个函数的概念,而 Emacs 所做的只是一个接一个地执行函数.有更多的函数可以绑定到键上,并且可以使用 M-x function-name 调用没有击键的函数.

  • 那个人可以使用 C-h k [keystroke] 发现特定键调用的功能.让用户浏览其中的一些(包括有趣的事实,即键入一个字母并不特殊,只需调用 self-insert-command,因此如果需要,可以绑定字母z"改为发送电子邮件 :D)

  • 那个人可以用C-h a(或M-x apropos-command)搜索可能有用的函数,例如C-h a 段落 显示所有与段落相关的命令,包括哪些快捷方式将一个段落带到段落的结尾/开头.而 C-h w command-name 会告诉你该命令是否绑定到某个按键.[让他们通过这个来发现撤销的关键是什么——通常他们会尝试 C-z 并且它会做一些令人讨厌的事情:)]

  • 您可以阅读关于函数如何使用 M-x describe-function (C-h f) 的详细文档.Emacs 对大多数事情都有很好的文档;和 M-x apropos-documentation (C-h d) 是发现东西的好方法.

  • 那个人的设置存储在 .emacs 中,即使不了解 Emacs Lisp,也可以通过查看该文件来收集一些信息.

  • 通常可以通过在其后键入 C-h 来找到完成"一组特定键的所有击键,例如'C-x C-h' 将显示所有以 C-x 开头的快捷键;C-h C-h 特别有用;Cc Ch 对于特定于模式的命令很有用,例如在 java-mode 或 c++-mode 或 LaTeX-mode 等(嗯,modes"...)

    莉>
  • 卡住时,可以搜索http://www.emacswiki.org/.(或在 Freenode 上的 #emacs IRC 频道中提问,或发布到 gnu.emacs.help.)

这应该在 10 分钟内完成,我认为这是最重要的内容.我不会因为太多要记住的快捷方式而过载;无论如何,这毫无意义——如果用户知道如何发现快捷方式,他们就会为他们最常使用的任何东西找到快捷方式.不过,请让他们写下这些命令的名称,以及 Emacswiki 等.

重要的是向他们展示 Emacs 有多么强大以及它的模型有多么通用(所有关于它是一个操作系统的笑话都不仅仅是笑话).如果你只是展示一堆神秘的快捷方式来做他们在其他编辑器中已经可以做的事情,Emacs 似乎不值得所有的麻烦.本着同样的精神,我也完全支持 Anton Nazarov 的回答,即向他们展示 Emacs 可以为他们做什么(如果他们使用 LaTeX,则为 AucTeX,等等).然后就可以自己判断Emacs是否值得学习了,上面的都学了.

If you had a 10 minute hands-on session to teach someone Emacs, what would you show them?

Start emacs: emacs
 ...
Quit emacs: C-x C-c

What else would you have them do between starting and quitting Emacs, while you stood behind them?

解决方案

If I had only 10 minutes, I would not teach them any shortcuts at all. All the common shortcuts are available next to the corresponding commands in the menus; those the users can discover for themselves.

The most important things to teach are those that will enable the users to discover/learn by themselves:

  • That one can quit Emacs with C-x C-c, or File->Quit. When stuck, one should type C-g, and, if that doesn't work, ESC ESC ESC. [This is probably the single most useful advice to prevent total frustration with Emacs, trust me.]

  • The tutorial: Help->Emacs Tutorial, or C-h t. [This is not a terribly useful shortcut to remember; given how few times one reads the tutorial over the course of one's life...]

  • The concept that every keystroke in Emacs is bound to a function, and all that Emacs does is execute functions one after another. That there are more functions than can possibly be bound to keys, and functions without a keystroke can be invoked with M-x function-name.

  • That one can discover what function a particular key invokes with C-h k [keystroke]. Make the user walk through a few of those (including the amusing fact that typing a letter is not special and just invokes self-insert-command, so if one wanted, one could bind the letter 'z' to send email instead :D)

  • That one can search for possibly useful functions with C-h a (or M-x apropos-command), e.g. C-h a paragraph shows all the commands to do with paragraphs, including what shortcuts will take one to the end/beginning of a paragraph. And that C-h w command-name will tell you if the command is bound to some keystroke or not. [Make them walk through this to discover what the key for undo is -- usually they'll try C-z and it does something annoying :)]

  • That you can read detailed documentation about what a function does with M-x describe-function (C-h f). That Emacs has great documentation about most things; and M-x apropos-documentation (C-h d) is a great way of discovering stuff.

  • That one's settings are stored in .emacs, and that one can glean some things by looking at that file even if one don't understand Emacs Lisp.

  • That one can usually find all keystrokes that "complete" a particular set of keys by typing C-h after it, e.g. 'C-x C-h' will show all the shortcuts starting with C-x; C-h C-h is particularly useful; C-c C-h is useful for mode-specific commands such as when in java-mode or c++-mode or LaTeX-mode, etc. (Hmm, "modes"...)

  • That when stuck, one can search on http://www.emacswiki.org/. (Or ask a question in the #emacs IRC channel on Freenode, or post to gnu.emacs.help.)

This should fit in 10 minutes, and it's the most important stuff, I think. I wouldn't overload with too many shortcuts to remember; that's pointless anyway -- if the users know how to discover shortcuts, they'll find out shortcuts for whatever they use most frequently. Do have them write down the names of these commands, though, and also about Emacswiki etc.

The important thing is to show them how powerful Emacs is and how universal its model is (all those jokes about it being an operating system are not just jokes). If you just show a bunch of arcane shortcuts to do things they can already do in other editors, Emacs won't seem worth all the trouble. In the same spirit, I also wholly support Anton Nazarov's answer of showing them what Emacs can do (AucTeX if they use LaTeX, etc.) for their specific purposes. Then they can judge for themselves whether Emacs is worth learning, and learn using all the above.

这篇关于Emacs 初学者应该教什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆