Practical Emacs Lisp
ergoemacs.org
Practical Emacs Lisp
1–10 of 60 posts
Re: Practical Emacs Lisp
#2Re: Practical Emacs Lisp
#3"Each page is self contained." Allright, I guess it's an Emacs site then.
Re: Practical Emacs Lisp
#4Re: Practical Emacs Lisp
#5Inexperienced Emacs Lisp programmers coming to this site for the first time should be aware that Xah Lee's code is generally not very idiomatic. He discusses it himself here: http://ergoemacs.org/misc/emacs_lisp_coding_style_language_i...
Sometimes a closing parenthesis is on a line by itself:
(defun foo ()
...
)
(let ((x y)
(z w)
)
...)
Historically, it's not been unheard of that Lisp experts (even implementors) do this sort of thing. Exhibit A, randomly picked source file inside CLISP:http://sourceforge.net/p/clisp/clisp/ci/default/tree/src/clo...
Some of Xah's indentation is inconsistent:
(function
(one space)
indent like data)
(function
(two space indent)
like code))
Not too much stands out otherwise; the code is readable.I'd have to read deeper to see whether things that are usually done one way are done differently for no good reason. What I would consider "unidiomatic" would be, for instance:
(if (not (null list)) ...)
rather than (if list ...)
(Any Lisp dialect requiring code such the former is labelled differently, namely "idiotic".)Re: Practical Emacs Lisp
#6http://steve-yegge.blogspot.com/2008/01/emergency-elisp.html
Re: Practical Emacs Lisp
#7Inexperienced Emacs Lisp programmers coming to this site for the first time should be aware that Xah Lee's code is generally not very idiomatic. He discusses it himself here: http://ergoemacs.org/misc/emacs_lisp_coding_style_language_i...
I'm an experienced Lisp programmer and most of it looks fine to me from a random sampling, as far as formatting goes. Sometimes a closing parenthesis is on a line by itself: (defun foo () ... ) (let ((x y) (z w) ) ...) Historically, it's not been unheard of that Lisp experts (even implementors) do this sort of thing. Exhibit A, randomly picked source file inside CLISP: http://sourceforge.net/p/clisp/clisp/ci/default/…
[0]: http://ergoemacs.org/emacs/elisp_grep_string_inside_tag.html
Re: Practical Emacs Lisp
#8Inexperienced Emacs Lisp programmers coming to this site for the first time should be aware that Xah Lee's code is generally not very idiomatic. He discusses it himself here: http://ergoemacs.org/misc/emacs_lisp_coding_style_language_i...
Re: Practical Emacs Lisp
#9Earlier quoted context omitted.
I'm an experienced Lisp programmer and most of it looks fine to me from a random sampling, as far as formatting goes. Sometimes a closing parenthesis is on a line by itself: (defun foo () ... ) (let ((x y) (z w) ) ...) Historically, it's not been unheard of that Lisp experts (even implementors) do this sort of thing. Exhibit A, randomly picked source file inside CLISP: http://sourceforge.net/p/clisp/clisp/ci/default/…
I perused a couple of links. This code [0] is pretty much unidiomatic. Closing parens one per line and using setq all over the place. [0]: http://ergoemacs.org/emacs/elisp_grep_string_inside_tag.html
Now you might think that this is also unidiomatic:
(setq totalCnt (1+ totalCnt))
Turns out, though, that Elisp doesn't have modify macros, except in the CL compatibility package.What Xah is doing is the same as the accepted SO answer for incrementing a local variable:
http://stackoverflow.com/questions/6858894/how-to-increment-...
Re: Practical Emacs Lisp
#10Inexperienced Emacs Lisp programmers coming to this site for the first time should be aware that Xah Lee's code is generally not very idiomatic. He discusses it himself here: http://ergoemacs.org/misc/emacs_lisp_coding_style_language_i...