Fork me on GitHub
#emacs
<
2022-07-12
>
teodorlu13:07:03

Learned some Emacs Lisp today! Possibly useful for non-expert Emacs users. Personally I'm finding it really motivating to solve small "friction points" in Emacs when some part of a task feels tedious. 1 - read-string and completing-read are nice for building small, interactive UIs. read-string reads a string. First arg is the prompt.

(let ((name (read-string "Please enter your name: ")))
  (message (s-concat "Hello, " name "!")))
completing-read lets you write or select from a list of options. First arg is the prompt, second arg is the list of options to select from.
(let ((dish (completing-read "What is your favourite dish? "
                             '(:pizza :pasta :red-hot-chili-peppers))))
  (cond ((equal dish ":pizza") (message "I also like pizza!"))
        ((equal dish ":pasta") (message "Pasta is good."))
        (:else (message (s-concat dish "? Doesn't sound familiar")))))
2 - Emacs lisp let* is like clojure let, Emacs lisp let can't be used "down".
| let    | scope      | example                                  |
|--------+------------+------------------------------------------|
| `let`  | in         | `(let  ((x 1)            ) (message x))` |
| `let*` | in or down | `(let* ((x 1) (y (* x 10)) (message y))` |
(based on working notes at https://play.teod.eu/emacs/#2022-07-12 for learning emacs. working notes contain a bit more context / motivation.)

馃憤 7
Benjamin14:07:50

Does anybody have opinions on logseq, obsidian or org-roam. Or does anybody have a setup of using one of those via emacs?

Benjamin14:07:56

trying logseq. I like some things about expecially the prospect of writing datalog queries. But honestly it's just a little bit clunky and I feel silly as emacs user to interact with that.

otfrom14:07:17

I've been pretty happy with org-roam so far, but I don't use massive amounts of the features beyond dailies and capturing

Karol W贸jcik15:07:55

I鈥檓 using org-roam on desktop and LogSeq on mobile. LogSeq works much better for me than Obsidian and I hope additional features improving the org roam compatibility will land soon.

pavlosmelissinos16:07:58

I mostly use org-roam for dailies and some notes here and there but I've been planning for a while to have a zettelkasten-like workflow. I believe it delivers, haven't had any issues in general except for one feature: it doesn't carry over unfinished items to the next day (like org-agenda does) > Or does anybody have a setup of using one of those via emacs? Do you mean like a technical guide (like will an init.el do?) or are you looking for workflow ideas?

pavlosmelissinos16:07:01

Anyway, here's https://github.com/PavlosMelissinos/dotfiles/blob/e2c8b4f3f4db3fa254100044b5292a859fe32797/.config/emacs/init.el#L659-L688. As for a workflow, I'm still on the lookout but I recommend https://takesmartnotes.com/ if you're looking for a new perspective. It's very dense writing and has a refreshing take on note-taking.

teodorlu17:07:34

I've gotten a lot of value out of Org-mode, Roam Reasearch, and a bit of Org-Roam. The core concept of organization -- no hierarchy, strong entities, strong linking and a bias to start with "daily notes"/"temporal indexing" -- has probably changed how I take notes forever. > Does anybody have opinions on logseq, obsidian or org-roam We can probably talk about this for multiple evenings, so I'll try to narrow. Roam (very similar to logseq) Good: I find Roam to be excellent for idea capture, and general note taking. Zero threshold to start writing, easy to compose ideas. Good to build entities for ideas, good to see which entities / ideas connect to which. Bad: Little control over how content looks for sharing with others. The heavily hierarchical structure I typically use is hard to read. Bad: Less effective than Emacs for straight text editing. Bad: Harder to extend than Org-mode files. Good: just paste images / embed media, and it works. Org-mode / org-roam Excellent for extensibility. I'm building https://github.com/teodorlu/play.teod.eu on top of Org-mode, pandoc and some babashka scripts. I love the flexibility. But I don't even try doing anything with it from mobile. Right now, I'm not techically using org-roam to link those org-mode files together, but I think it should be possible. Conclusion (subjective) I'm really happy with Roam (logseq) on mobile and for nontechnical note taking. But for files I want to publish, I'm not replacing Emacs Org-mode/Org-roam any time soon. I don't see this as an either/or question -- I like both Roam and Org for what they give me. And I also find the exercise of moving ideas from deep nesting (Roam) to a "flatter narrative" (Org).

soulflyer17:07:24

I went with the zetteldeft instead. Simpler and works well with org files...

馃憖 1
teodorlu17:07:08

@U0E3H1J5Q I'd never heard zetteldeft before now. Really curious about why you're liking it better than Org-roam 馃檪

soulflyer17:07:15

Mostly it evolved that way. I went from Notational velocity to Deft to Zetteldeft. Tinkered with org-roam along the way, but I just liked the way zetteldeft worked. Not having a db, just a collection of .org files is a bonus I think.

馃憤 1
ag17:07:16

I've never heard about Zettelkasten (method) before. Nor I knew about Obsidian or Logseq or any other alternatives. At some point, I decided to check out Org-Roam manual. It starts with that book, "How to take smart notes". I decided to read the book and use Org-Roam for note taking. Like Richard Feynman once said: "Notes aren't a record of my thinking process. They are my thinking process". I used vanilla Org extensively and the decision to make that leap of faith wasn't easy to make. I backed up all existing .org files of mine and jumped into Org-roam. And now I love it. I stopped worrying about organizing my notes; before Org-Roam that was the itch I had to scratch from time to time. Turns out - no hierarchical systematization, be that several levels of outlining, date-trees, single-file, multi-file, active & inactive time-stamps, tags, properties, or extensive use of Org-Agenda really help you find the relevant information. Turns out, whenever I create a single unit of knowledge - a note, a zettel, a document, etc., I just have to ask myself a single question: "in what context do I want to re-discover this piece later?". And it doesn't matter where this note is stored - in a separate file or as a subheading. I can now find relevant stuff very quickly. It happens to me all the time, during a meeting, someone starts remembering a fact: "I think John mentioned two months ago something about this vulnerability...", I'd switch to Emacs and quickly find everything that John was talking about. Unless I decided not to write it down. And I say: "if I can't find it in my notes, this shit has never happened..."

馃槃 2
1
teodorlu17:07:10

> a note, a zettel, a document @U0G75ARHC - Would you care to define the difference between a note, a zettel and a document? (I feel like we've had similar experiences with flat note taking systems 馃槃)

teodorlu17:07:16

Do they map to fleeting notes, permanent notes and project notes as defined in How to Take Smart notes? (below)

ag17:07:35

@U3X7174KS For me right now, there's no semantic difference. I just needed a quick method to link things to each other. Since I'm using Evil (currently Doom), I even mapped [[ in insert mode to org-roam-node-insert and [ SPC to insert a normal square bracket (pair of brackets to be precise). While typing stuff up, I'd occasionally press [[ and link it to something else. There's an endless debate about how to use tags, and filetags. I instead decided to ignore tags completely. For me, everything is a link - is it some kind of status of the thing e.g., TODO? - Link it to the "category note 'TODO'"; is it a place, or has an association with a person - link it. Yes, I have .org files like "people" and "colleagues". Is it a quote from a book? I have http://books.org.

馃挴 1
ag17:07:14

Whenever I no longer wish to see the connection, I'd just add ROAM_EXCLUDE: t property

馃挴 1
teodorlu17:07:07

That makes sense. Thanks for explaining!

mpenet18:07:49

org-roam here. Having the ability to use org babel and make notes source blocks eval'able and depend on clj/java libs is awesome, especially for work related stuff

ag18:07:36

I have just a couple of things missing in Org-Roam that would be a bit difficult to implement on my own. One of them is the way to find notes related to multiple other notes. e.g., If I want to see notes related to "Lisp", I'd just open the backlinks buffer. But If I, for example, want to filter notes at the intersection of "Lisp", "Type Theory" and "Formal logic", Org-Roam doesn't currently have a good way of doing something like that. Another missing thing is the mobile access. Existing Org apps (at least on Android) don't have a good UI oriented for searching through great number of .org files. Most of them are oriented for vanilla Org-mode workflow, where things are organized around smaller number of files.

Andrea19:07:18

@U0G75ARHC actually I thought to implement that intersection thing, but I settled on using projectile ag (the silver searcher), which allows you to search strings in files. It works quite smoothly: you would search Lisp and Type Theory and it would show you the files. (Sure the filenames are not the best to read, but good enough)

ag19:07:35

Well, yes. That's what I've been using. I have around a thousand notes right now. I wonder what happens when this number grows to let's say five thousand?

Andrea21:07:11

still works fine 馃槈 I mean these fancy grep programs are pretty fast nowadays

otfrom18:07:24

This is the kind of off topic day I live for

馃槃 2
teodorlu18:07:44

I think there's a strong correlation between Emacs users and people who think by writing. Not quite sure why.

ag18:07:47

I guess that most Emacs users aren't beginner programmers. Beginner programmers tend to focus on writing code. With experience, later they learn - to be a successful programmer one has to learn not a single (or multiple) programming languages, but has to become fluent and expressive in a single language - English. I have not seen this amount of regard for the written language in any other system, editor or IDE. Look how many thesaurus and spell-checking packages we have on MELPA alone.

2
teodorlu13:07:51

Came over a nice article that supports your point about the effectiveness of writing. https://staysaasy.com/management/2022/07/10/Writing-Management.html

ag15:07:29

Funny, but even I, a non-native English speaker know that the proper title would be: "Good managers write well"...

馃槃 1
ag15:07:37

I guess the author deliberately chose to construct it that way, to make it a bit more clickbaity...

teodorlu16:07:11

The same struck my norwegian head 馃槃 At the same time, I kind of like it. Sounds kind of brutalist. Like a rock. "Throw rocks. Write it good."

ag17:07:55

"Kill a beaver. Save a tree"

馃槃 1
Cora (she/her)18:07:46

definitely click-baity title

Cora (she/her)18:07:17

but in a good way 馃槉

馃槃 1
Drew Verlee02:07:02

I usually know I'm in trouble when i sense the person I'm talking to feels they have found the one true way to communicate. E.g Using Jira, only reply in threads, the Oxford comma, xyz note taking app, every sentence should start with "given x then y", etc...

2
teodorlu09:07:52

I get the same bad feeling talking to developers who have found the one true way. I mean, don't they care about what they achieve with the code / text they write?

Cora (she/her)12:07:53

ok, but, the oxford comma....

ag19:07:42

Today I use flyspell, lsp-grammarly, google-translate, sdcv-mode, mw-thesaurus, define-it, langtool, writeegood-mode and some other packages and quite a few handwritten functions to manage all my writing in Emacs. And I'm not even mentioning things like separadit (for editing comments in indirect buffers) I don't remember ever trying to set up even a portion of these capabilities in any of the numerous editors I've used before.

馃槃 3