Elisp
Table of Contents
- related elisplispemacs
- [A] * lists manipulation elisp
- [A] * string manipulation elisp
- [B] * debugging elisp
- [C] * code style elisp
- [C] sharp-quote names of functions
(mapcar #'fun list)
elisp - [C] elisp basics elisp
- [B] /r/emacs: (Almost) All You Need to Know About Variables elisp
- [C] unwind-protect works as with / try-finally block elisppython
- TODO [C] lisp unpacking like in python (let ((x '(2 3))) `(1 ,@x 4 5)) elispdrillpython
- ---------------------------------------- elisp
- TODO [D] /r/emacs: Tutorial on Good Lisp Programming Style elisp
- [C] More batteries included with emacs | Karthinks regexes in elisp elisp
- TODO [C] Wilfred/ht.el: The missing hash table library for Emacs elisp
- [D] Changing Properties - GNU Emacs Lisp Reference Manual https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html elisp
- TODO [D] How to Locate the Variable I Need? : orgmode elisptoblogorg
- TODO [C] mention defvar vs setq elispemacs
- [D] Emacs Should Be Emacs Lisp - Tom Tromey https://braindump.jethro.dev/talks/emacs_should_be_emacs_lisp/ elisp
- [D] What's the performance · Issue #19 · alphapapa/org-ql https://github.com/alphapapa/org-ql/issues/19 elisp
- [D] What's the performance · Issue #19 · alphapapa/org-ql https://github.com/alphapapa/org-ql/issues/19 elisp
- [D] bbatsov/emacs-lisp-style-guide: A community-driven Emacs Lisp style guide elisp
- [C] (8) Writing A Spotify Client in 16 Minutes - YouTube elisp
- elisp type -a nathan | awk 'END{print}' / Twitter
¶related elisplispemacs
¶[A] * string manipulation elisp
¶[A] magnars/s.el: The long lost Emacs string manipulation library elisp
much saner and more consisten than builtins
¶[C] * code style elisp
CREATED: [2018-04-24]
http://lisp-lang.org/style-guide/
variable naming
*earmuff*
style for mutable globals?
but:
- dynamic variables have a prefix
- local variables (or anything set with a let) do not have a prefix
- prefer when cond to if cond ..., prefer unless cond to if (not cond)
- predicates
end withp
or-p
- doesn't have namespaces.
package--private-function
package-public-function
¶defclass? elisp
¶:type slot; trivial-types lib? elisp
¶[C] sharp-quote names of functions (mapcar #'fun list)
elisp
¶[C] elisp basics elisp
cursor point region http://ergoemacs.org/emacs/elisp_cursor_position.html
http://ergoemacs.org/emacs/elisp_editing_basics.html
http://ergoemacs.org/emacs/elisp_optional_params.html
&optional prams. &rest remaining params
no named params, no type checking..
thing-at-point
¶[B] /r/emacs: (Almost) All You Need to Know About Variables elisp
¶[C] unwind-protect works as with / try-finally block elisppython
¶TODO [C] lisp unpacking like in python (let ((x '(2 3))) `(1 ,@x 4 5)) elispdrillpython
CREATED: [2021-01-01]
¶---------------------------------------- elisp
¶TODO [D] /r/emacs: Tutorial on Good Lisp Programming Style elisp
¶[C] More batteries included with emacs | Karthinks regexes in elisp elisp
A cleaner approach to regular expressions in Emacs, as most package maintainers will tell you, is to use the rx library instead. rx translates regular expressions in sexp form to a regexp string:
¶TODO [C] Wilfred/ht.el: The missing hash table library for Emacs elisp
¶[D] Changing Properties - GNU Emacs Lisp Reference Manual https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html elisp
Function: add-text-properties start end props &optional object This function adds or overrides text properties for the text between start and end in the string or buffer object. If object is nil, it defaults to the current buffer.
jesus
¶TODO [D] How to Locate the Variable I Need? : orgmode elisptoblogorg
https://www.reddit.com/r/orgmode/comments/d6wzkr/how_to_locate_the_variable_i_need/
The way I deal with these things: if it's not immediately searchable on stackoverlow, I wouldn't bother doing web search. My thinking would be: Ok, what builting org function could possibly use number of stars? Right, when I promote/demote the subtree it must be using that at some point.
small tutorial for hacking on emacs?
¶TODO [C] mention defvar vs setq elispemacs
CREATED: [2020-02-24]
¶[D] Emacs Should Be Emacs Lisp - Tom Tromey https://braindump.jethro.dev/talks/emacs_should_be_emacs_lisp/ elisp
¶[D] What's the performance · Issue #19 · alphapapa/org-ql https://github.com/alphapapa/org-ql/issues/19 elisp
Yes, it's generally slower because it checks every heading with predicates. The tradeoff is that the code is more composable and understandable than the 5-screens-long functions in org-agenda.el. Even so, for a lot of use cases, it's fast enough already. There is already a per-buffer, per-query cache that makes performance fast on repeated queries in unchanged buffers, which helps a lot.
¶[D] What's the performance · Issue #19 · alphapapa/org-ql https://github.com/alphapapa/org-ql/issues/19 elisp
One cool trick that elfeed implements is JIT-compilation of search queries. If you call a function in a map or a loop or something similar this makes a difference. Yeah, I learned that trick from Chris's code. Both the "predicate" function and "action" function are byte-compiled before running the "query".
¶[D] bbatsov/emacs-lisp-style-guide: A community-driven Emacs Lisp style guide elisp
¶[C] (8) Writing A Spotify Client in 16 Minutes - YouTube elisp
I mean.. ok, but nothing super remarkable idk?
should do a similar demo in python, for example
¶ type -a nathan | awk 'END{print}' / Twitter elisp
(elt "arst" 2)
nth element of string