7
votes
Accepted
Hook to switch the linter binaries in Emacs Lisp according to virtual environment
It would be a good idea to write a docstring for the defvar'd variables like linter-execs. The explanations in the post would ...
6
votes
Accepted
6
votes
Expand string patterns in Elisp
Scoping
In Emacs Lisp a nesting a defun inside another defun does not create a lexically scoped function. The symbol for the '...
5
votes
Accepted
elisp function to replace text in an org file
You can make a better (interactive) declaration. Because this modifies the buffer, we want to disable it on read-only buffers. We do that this way:
...
5
votes
Accepted
`nov.el` function to search the entire `epub` ebook
One thing you could do to speed up the search, is to search for a match first in the raw html, and if you find a match, only then render it using (nov-render-html) ...
4
votes
Example of emacs setup code written in elisp
target platform
Neither the Review Context nor the code comments
describe what OS platform(s) we are targeting.
...
4
votes
Accepted
Multiple regexp replace in string
Style-wise, it looks odd to see the function argument named in all-caps. Standard convention is to use lower-case (but still upcase it in the doc-string).
Trying to run the code, it immediately ...
4
votes
Accepted
Check for pangrams in elisp
(setq letters (get-letters s))
You are setting the same letters variable from different functions; in Emacs Lisp, that sets a ...
4
votes
Accepted
Installing packages when needed
When quoting a list of symbols, it's redundant to quote each symbol within the list.
There's no need to eval a symbol.
This sequence looks strange:
...
4
votes
Expand string patterns in Elisp
It's unusual to defun within a function. If you just want expat available while executing ...
4
votes
X-up utility for EVE Online
The conclusion to Shepmaster's excellent answer pointed out that if the yaml-rust library were augmented, it would be possible to consume the ...
3
votes
Rubik's cube mode for emacs
First, congrats on writing a Rubik's Cube mode. That is a feat. There are, however, three parts I would love to see improved in a follow-up version:
Currently, none of the symbols are private; ...
3
votes
Accepted
replace a text from emacs buffer to insert it vertically with emacs lisp script
Few general points about your code:
(while condition &body) form already treats &body as an implicit ...
3
votes
Accepted
Edis: Emacs driven indentation script
One of the pitfalls with any language using formatting constructs you're not that familiar with, is that it becomes an unreadable mess. Your code though is properly formatted, properly indented (it ...
Mast♦
- 13.5k
2
votes
Iterating over global keymap, removing all bindings to super keys
Apart from using dolist as mentioned by @brfennpocock it looks mostly
fine.
system-type is a symbol though, so you can compare ...
2
votes
Testing whether lambda expression returns true for any list element
If you already have Common Lisp-derived functions in there, use CL-SOME instead:
...
2
votes
Checking if val is present in list
The Good Thing
The code works and does what was intended. Making it shorter and improving readability are improvements not bug fixes.
Readability
It is hard to follow the logic of the code. Adding ...
2
votes
Accepted
Minimal substring with all characters contained in string
I know this is old, but I will write some remarks anyways, hope you will find it useful.
This code lacks knowledge of usual language shortcuts, eg. (if x nil y) is ...
2
votes
Accepted
WOMOIWIW: What Org-mode Opens is What I Want
That's a cool feature I've to say. And the code looks excellent, I
suppose you could argue for one or the other wrt. cond vs. if...
1
vote
Accepted
Get the suffix for the date string
I'm concerned that make-suffix is sufficiently general that we'll have name collisions with other packages - or even new Emacs versions. Perhaps prefix with some ...
1
vote
Split a list into two parts
values should be cl-values in Emacs Lisp (and use (require 'cl-lib) instead of ...
1
vote
Split a list into two parts
First, as already noted in a comment, the first argument of the function is the list, and the second is the number of elements. So in the examples below I assume that this is what you want.
Then, you ...
1
vote
Power menu (Shutdown, Reboot, Sleep) in ELISP
Disclaimer: Total beginner here too. So take everything with a grain of salt.
That being said this looks perfectly fine. However, I suggest you to use ...
1
vote
Check for pangrams in elisp
At the high level bit, there's not much to complain about and a lot to like. Not so much because the code works (a necessary but non-trivial requirement for this site). But because the logic is sound (...
1
vote
Accepted
Detect resolution of X display and change font accordingly
You'll want to guard the function so you don't try to call it on non-X displays (e.g. emacs -nw):
...
1
vote
Detect resolution of X display and change font accordingly
You wrote calls to setq-default twice, with blah-blah-size-34-or-18. Call it just once, with a :size of an if expression that evaluates to 34 or 18.
Put another ...
1
vote
Testing whether lambda expression returns true for any list element
Apply 'file-exists-p on the list of files and check whether true is a member of the result:
...
1
vote
Start a process in Elisp
You can remove the let, as you only reference f once.
I'd also make it a named function; this makes it easier for you to update ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
elisp × 45lisp × 12
beginner × 5
strings × 4
combinatorics × 2
configuration × 2
game × 1
parsing × 1
recursion × 1
datetime × 1
interview-questions × 1
regex × 1
file-system × 1
rust × 1
formatting × 1
template × 1
search × 1
clojure × 1
gui × 1
game-of-life × 1
coordinate-system × 1
ascii-art × 1
common-lisp × 1
macros × 1
child-process × 1