Live data from Hacker News

Practical Emacs Lisp

ergoemacs.org

21–30 of 60 posts

Re: Practical Emacs Lisp

#21
post #15

Xah Lee can't program a line of Lisp on his own. Most of that code is collected from elsewhere. There are much better resources to learn Emacs Lisp from.

What are some good ones? I'd love to have something to suggest to the elisp-curious.

An Introduction to Programming in Emacs Lisp is good, and is available both from inside emacs in M-x info, and on the web at https://www.gnu.org/software/emacs/manual/eintr.html

Re: Practical Emacs Lisp

#23
post #15

Xah Lee can't program a line of Lisp on his own. Most of that code is collected from elsewhere. There are much better resources to learn Emacs Lisp from.

The way to handle an unhelpful resource is to flag it. Even better would be to submit superior resources. The ad homenim is unproductive because it just makes people dumber and makes mean behavior look normal.

Re: Practical Emacs Lisp

#24
post #12
post #4

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

Can you recommend a tutorial that uses idiomatic Emacs Lisp and covers both "why" and "how" of Emacs Lisp at a level appropriate for someone who's used CL and Emacs a lot but has never noticed that he needs ELisp?

The manuals built in to Emacs are good, check M-x info.

Re: Practical Emacs Lisp

#25
post #15

Xah Lee can't program a line of Lisp on his own. Most of that code is collected from elsewhere. There are much better resources to learn Emacs Lisp from.

The way to handle an unhelpful resource is to flag it. Even better would be to submit superior resources. The ad homenim is unproductive because it just makes people dumber and makes mean behavior look normal.

Xah Lee has trolled Lisp groups for years. It's well known that much of his 'advice' is useless. The number of bullshit posts by him is a bignum. His comp.lang.lisp trolling is legendary.

Nothing 'ad homenim' or mean - just saying how it is.

Re: Practical Emacs Lisp

#26
post #15

Xah Lee can't program a line of Lisp on his own. Most of that code is collected from elsewhere. There are much better resources to learn Emacs Lisp from.

what a malicious lie. I have written some 10 packages, at least hundred thousand lines of emacs lisp since 2005, all public in github or on my website. http://ergoemacs.org/emacs/xah_emacs_modes.html

the only borrowed code i can think of now, now named xah-extend-selection in xah-fly-keys, by Nikolaj Schumacher, fully credited in the inline doc still. (and that function is also in ergoemacs-mode, fully credited still, now lead by Matt F.)

Any code, that possibly may be considered borrowed, i'm painstaking to give credit, often taking sometimes a hour to find the person's REAL NAME correctly (as opposed to nicknames) (if public), personal site url or blog url or social network url if any, to link to, painstakingly ask the which url he prefers, and often ask permission too when it is clearly not necessary. One can find lots of “i learned this from xyz” in my website.

I learned emacs lisp, starting in 2005, the first 5 years with much help from comp.emacs or gnu.emacs.help newsgroup, and freenode's irc emacs channel, and emacs wiki. This is also fully credited. Xah's Emacs Tutorial: Acknowledgment http://ergoemacs.org/emacs/thanks.html linked at the bottom of my emacs tutorial.

I know lisp before. Read entire Scheme r4rs and 75% of SICP in 1998, 1999. These can be verified in newsgroup. I coded Wolfram Language for 6 years before 1999, and worked at Wolfram Research for half a year. I have several eassys documentinging these facts. For example: Xah Lee's Computing Experience (Impression Of Lisp from Mathematica) http://xahlee.org/PageTwo_dir/Personal_dir/xah_comp_exp.html

personally, i generally don't borrow code, because i'm rather one of those weird or aloof guy with meticulous control of things, down to every character placement. In my elisp life since 2005 to today, i must have stolen ideas, concepts. I can't recall explicitly which at the moment, but i can say in good faith that any non-trivial concepts i've used in my project i've given acknowledgement.

Note: i've been considered a troll in comp.lang.lisp and other newsgroups from about 2000 to 2010. There were many heated arguments, and there are some who will say negative things about me wherever my name is mentioned. I do not think of myself as a troll, and have written many essays on this. Netiquette Anthropology: a Tale of Tech Geekers http://xahlee.info/Netiquette_dir/troll.html

PS unrelated but instead of a separate post: I want to thank many people who have helped a year ago. That was a big help. Thank you. I do dish-washing part-time, and am ok.

Re: Practical Emacs Lisp

#27
post #15

Xah Lee can't program a line of Lisp on his own. Most of that code is collected from elsewhere. There are much better resources to learn Emacs Lisp from.

I have no desire to get into a personal argument, but I would like to point out that one contribution he has made for me that have not seen elsewhere is that he has chosen to use Emacs as a text-processing scripting environment in preference to Perl or Python or some other scripting languages. Without commenting on issues of style or idiom I found his write-ups of this experience using the text-editing primitives of Emacs to be useful and interesting.

For example, consider:

"Text Processing: Emacs Lisp vs Perl" http://ergoemacs.org/emacs/elisp_text_processing_lang.html

"How to Write grep in Emacs Lisp" http://ergoemacs.org/emacs/elisp_grep_script.html

Re: Practical Emacs Lisp

#28

Earlier 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

hi PuercoPop, that code is meant to be run as a script (emacs --script filename), so i used setq is possibly more proper. But, this is just post-fact defense, as lots my pages began as quick blogs. As you know, CL has controversial status in gnu emacs dev community. e.g. http://ergoemacs.org/emacs/elisp_common_lisp_in_emacs.html I myself avoid it, because i don't like CL. I'm going to tuck in the hanging parens in a few days. Thank you for the criticism. (thanks to many others here too)

Re: Practical Emacs Lisp

#29

Earlier quoted context omitted.

As far as dash.el goes, I find lispm's critique of dash.el pretty convincing[0]. However a more profilic emacs coder fried of mine is undeterred and keeps using modern emacs lisp. I think much of the community does as well. [0]: https://www.reddit.com/r/lisp/comments/29ufoc/it_is_not_hard... About Scheme's regexp SRFI, have you seen rx.el? Not quite but I like it myself.

IIUC rx.el is a sexp dsl/interface to build vanilla regex down the line right ? from what I remember about scheme SRFI is not the 'syntax' but the return values, you get streams of match, then you can leverage, folds and maps. lispm point is nice (and no one can argue about evaluation order and count), but beside the battle-tested aspect, `loop` scares the crap out of me. That's even more a reason to prefer things th…

See this Xah Lee Elisp code:

    (defvar xah-left-brackets '("(" "{" "[" "" "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»")
      "list of right bracket chars.")
    (progn
      (setq xah-right-brackets '())
      (dotimes (x (- (length xah-brackets) 1))
        (when (= (% x 2) 1)
          (push (char-to-string (elt xah-brackets x))
                xah-right-brackets)))
      (setq xah-right-brackets (reverse xah-right-brackets)))
In CL this is just:

    (defun every-nth (seq start n &aux (len (length seq)))
      (loop for i = start then (+ i n)
            while (
Write useful building blocks. Don't duplicate code. Get rid of low level imperative code.

Bonus points for a more efficient version for lists.

Post reply on HN