I will rate your setup a 9/10 if you include prism.el. Why? …Why not?
I will rate your setup a 9/10 if you include prism.el. Why? …Why not?
You know the discussion’s gone off the rails when LWN picks it up. I’ve been biting my tongue at times while reading it (and now glad that I kept silent…but then, look at me now).
I can’t fathom the objections to using cl-lib
, especially since something as basic as the built-in debugger already uses it. Elisp is a very pleasant language to work in, but without cl-lib
it would be missing basic functionality.
It boggles my mind to see how some people seem to want to write Lisp as if it were C. As an experienced CL hacker I’ve seen often asks, “Is that the level of abstraction you want to be working at?” These forms from CL allow working at higher levels, treating the lower levels as solved problems that need not be re-engineered at each invocation. They don’t increase the cognitive burden–they significantly reduce it, especially when it comes to reading others’ code. By using those standard solutions, we stand on the shoulders of giants.
And pcase
is, as far as I’m concerned, a masterpiece of programming, a tool I sorely miss when working in any other environment. I really hate to see this incredibly useful contribution of Stefan Monnier’s disparaged, especially when much of the criticism merely comes from unfamiliarity and NIHism. (The use of backquote patterns with unquoting to destructure patterns, the same way they’re used to construct the same values, is brilliant and naturally Lispy. And the extensibility and modularity of pcase
is excellent–compare to, e.g. cl-loop
’s implementation (another macro I like to use, but it’s not easily extended).)
Some of the worst has been to see the disingenuous argumentation presented in these threads on emacs-devel. I’ve seen a lot of hypocrisy and insulting, passive-aggressive attitudes, blaming one person for what the other is himself doing. It wasn’t but a few weeks ago that I noted in another thread how off-putting the discussions can seem to newcomers, only to be told that such impressions are incorrect and invalid–and now to see such awful behavior between people who have effectively been colleagues for years. Is this how we will keep Emacs alive for another 40 years–by artificially holding back the language and viciously attacking those who object?
I think the fundamental question is, is all this worth it? Of all the things to spend the very limited programmer time available, to spend it on rewriting working code to use more awkward and verbose constructs because ideas from Common Lisp have cooties? (Forgive me, but that seems to be what it boils down to.) It’s disappointing.
Thanks. A screenshot would be helpful, too. :)
Hm, yeah, imagine some kind of service that takes a question from a user and posts it on Reddit, then feeds the answers into its own ML model and gives something back to the user (with a significant delay, obviously, so maybe more for training purposes).
There was a post here within the past couple of months that, when I looked at its account history, seemed to be obviously some kind of bot, but its writing was coherent enough to seem authentic in isolation.
Seems like a dark time for the Web is coming. :/
It does look nice!
I’ve no objection to writing another static site generator for Emacs/Org. But the name “One” is so overused. Seems like every company has “Foo ONE” and “Bar ONE”. Up til now, Emacs hadn’t fallen into that trap… ;)
Anyway, thanks for sharing your work.
Is it just me or have there been a lot of posts lately from accounts with overall negative comment karma.
can someone help or give me some YT videos to watch to have a good idea about emacs ?
I hesitate to be the curmudgeon here, but if you can’t–or won’t–bother to visit youtube.com and type “emacs” into the search box, then you probably won’t enjoy using Emacs. Emacs is most appreciated by people who take a bit of initiative.
I get nothing.
Please do not answer if you are not willing to tell me exactly what to put in my init.el file.
Please do not ask if you are not willing to google your question first. We are not ChatGPT.
“i want a video or a proof” that you googled these questions and found no answers
Since this question is asked at least weekly, you should have.
We do users like this no favors by indulging them.
Probably not what you want to do, but IIUC you could run Emacs from Cygwin and it wouldn’t have that problem.
These should be functions instead of macros.
As well, being that simple, they shouldn’t generally exist at all. Rather, the dolist
forms should just be inlined. (This is probably the usual case of a user who just learned about macros and is excited to use them, and so overuses them. We’ve all been there. :)
Emacs is more like a piece of marble. Harder to work with but has so much more potential.
More like a ball of clay: infinitely and trivially malleable. And you can bake parts of it into ceramic whenever you want.
My first suggestion would be to use plz
for HTTP. Then I’d use cl-loop
and pcase
to simplify the rest of the code. Here’s a partial rewrite with a TODO for further exercise. :)
(defun wikipedia-article-references (subject)
(let* ((url (format "https://en.wikipedia.org/wiki/%s" (url-hexify-string subject)))
(dom (plz 'get url :as #'libxml-parse-html-region)))
(cl-loop for cite-tag in (dom-by-tag dom 'cite)
for cite-class = (dom-attr cite-tag 'class)
collect (pcase cite-class
((rx "journal")
(let ((a-tag (dom-search cite-tag
(lambda (tag)
(string-prefix-p "https://doi.org" (dom-attr tag 'href))))))
(cons (concat "doi:" (dom-text a-tag))
;; TODO: Use `string-match' with `rx' and `match-string' here.
(let* ((cite-texts (dom-texts cite-tag))
(title-beg (1+ (string-search "\"" cite-texts)))
(title-end (string-search "\"" cite-texts (1+ title-beg))))
(substring cite-texts title-beg title-end)))))
((rx "book")
(let ((a-tag (dom-search cite-tag
(lambda (tag)
(string-prefix-p "/wiki/Special:BookSources" (dom-attr tag 'href))))))
(cons (concat "isbn:" (dom-text (dom-child-by-tag a-tag 'bdi)))
(dom-text (dom-child-by-tag cite-tag 'i)))))
(_ (let ((a-tag (assoc 'a cite-tag)))
(cons (dom-attr a-tag 'href) (dom-text a-tag))))))))
Regarding this:
And yes, I know that I could probably use a library like s, dash, seq, or cl, but I try to keep my elisp functions free of those kind of things
First of all, cl
and seq
are built-in to Emacs and are used in core Emacs code. There’s no reason not to use them. Second, dash
and s
are on ELPA and are widely used; it’s largely a matter of style, but they are solid libraries, so again, no reason not to use them. They don’t have cooties. ;)
Why did you add :after general
? I use :general
in many of my use-package
forms, but never have I added that.
Must be a variable then, not an option. Just use setq
on it. If you want to automate it, you could advise load-theme
similarly to how the function I linked does.
You can do M-x customize-option RET mode-line-padding RET
, or if you want to do it only for that theme, see https://github.com/alphapapa/unpackaged.el#customize-theme-faces for code that does that for faces; you could adapt it to do the same for an option.
Here’s an example of one of my current views: https://i.imgur.com/aZIncEM.png I use bufler-workspace
to save and restore a tab-bar tab of 4 windows, the left one being the project’s Org file, and the right ones showing 3 org-ql-search
views.
FYI, Org QL recently gained Embark support, so you can C-.
on one of the org-ql-view
items, just like in an Org Agenda buffer, and act on them, as well as candidates from the org-ql-find
series of commands.
(And before someone asks, the theme is ef-elea-light
by Prot.)
EmacsConf 2023 just wrapped up, but you can watch the prerecorded talks here: https://emacsconf.org/2023/