Emacs Lisp Function Guide?

前端 未结 12 2275
清歌不尽
清歌不尽 2021-01-30 12:13

I have been using Emacs for more than three years now but it still takes me days to write even small functions in Lisp. I\'ve looked through GNU Emacs Lisp Reference Manual but

12条回答
  •  遥遥无期
    2021-01-30 12:23

    I think you are taking the wrong approach. When learning a programming language and set of libraries (collectively, "Emacs Lisp"), you need to approach it on both the micro and macro scale. Before you can start writing software, you need to know what tools you have available. That is what the Emacs Lisp manual aims to educate you on. You really need to sit down and read the whole thing. That way you know what features Emacs provides.

    After you do that, you need "micro-level" information. There are a number of sources that provide this. If you have a general idea of what you need to do ("working with buffers"), then the Lisp reference is a good place to figure out what you need to know. If you know that there's a function that does what you want, but don't quite remember the name, then M-x apropos (C-u C-h a) will help you search the documentation. If you know what function you want to use, but don't remember quite how it works, then M-x describe-function (C-h f) will sort that out for you.

    So anyway, the key is to learn Emacs Lisp, and then let Emacs help you with the details. A list of functions isn't going to teach you much.

    (Oh, one more thing -- you should familiarize yourself with Common Lisp. Most Emacs libraries use cl, which are the useful CL functions implemented in Emacs Lisp. loop, destructuring-bind, defun*, and so on are all there, and they are very helpful.)

提交回复
热议问题