reddit / emacs
Emacs table
deafpolygon · 2022-12-05 20:34
Super-newbie alert.
Hey, I'm working on a watched movie list for myself (prepping for 2023). One of my hobbies is watching movies (I watch maybe 100-200+ a year - yes that's 2 movies a week, sometimes more! I don't have cable and don't watch much TV outside those times) and I like to track what I've already watched. I had one set-up in Obsidian, but one thing I didn't like was the lack of portability (Dataview can only be read within Obsidian). So , I was wondering if I could replicate this in Emacs Org-mode.
Here's [an example](https://imgur.com/a/iRHbGPv) - 1st is from Obsidian, 2nd is from Emacs.
Is there a way to have it automatically wrap at a certain width?
I'm aware of M-RET M-RET, but I'd like a more automatic way of doing this, so I can see about typing in my comments a little quicker. For example:
| IMDB | [[https://www.imdb.com/title/tt13533944][tt13533944]] |
| Watched | 2022-11-19 |
| Genre | Horror |
| Comment | It was okay. It's a "folk horror" and it does pretty well for that. I did enjoy the different "scenery" since the movie was filmed in |
| | Ireland. |
| Released | 10 Nov 2022 |
| | |
Also, is it possible to render an image inside a table cell or column?
And finally, I was thinking of attaching a movie cover to each "movie" header but then, how do I reference the attachment into an inline image?
CulturMultur · 2022-12-05 21:05
I’d consider downloading all info from IMDB like using [imdb.el](https://www.emacswiki.org/emacs/imdb.el) and saving all in PROPERTIES drawer and the body of heading is a comment (potentially big). Keeping comment in a table looks very limiting.
Then use org-ql to search.
HM0880 · 2022-12-05 22:43
Instead of tables, can you use headlines? For example, `** Watched <new line> <date>` and `** Comment <new line> <your text here>`.
trs_80 · 2022-12-06 03:14
I essentially agree with other two replies.
For those key-value pairs (genre, etc.) use Org properties, which are a key-value store. Later on you could write some ELisp to scrape IMDB (or similar) and auto-populate. In fact, maybe something like that exists already (or something you could leverage)?
EDIT: I just noticed one of other replies mentioned imdb.el, so yeah, appears it already exists (which is often the case, part of what makes Emacs great!).
I would simply use the title of the movie as headline. And put them all in a file called movies.org.
You could also use custom todo states like "SOMEDAY/MAYBE" and "WATCHED" (or simply "DONE"). This way it becomes not only a record of what you already watched, but a list of movies you might be interested in watching in the future. You could even rank them by priority.
You could put comments in the body, or in a timestamped logbook entry. Maybe you watch the movie again years later, and your opinion changes? You would have (automatically) time stamped comments to compare over time.
Org Mode is really great for stuff like this, essentially a lightweight, plain text database.
JDRiverRun · 2022-12-06 04:22
And when you want to look at all of them at a glance, org-columns is your friend.
deafpolygon · 2022-12-06 05:14
I didn't think about the properties drawer. I'll check out imdb.el - I'm using spacemacs, so I'm not sure how to add custom scripts (yet)... will look into it. Thanks!
deafpolygon · 2022-12-06 05:15
I'll look into using a combination of headline and note body instead. That's a bit better than sticking everything in a table. Thanks..
deafpolygon · 2022-12-06 05:15
How do you invoke org-columns?
deafpolygon · 2022-12-06 05:21
Thanks for the feedback/ideas.
I'll check out imdb.el - I am sure someone has written about leveraging that... I have not yet really dived into elisp but I will. Can I call python scripts and pull in information that way? Probably better to just learn and be using Lisp though.
Can I use custom todo per file? I don't want them to be globally applied.
> Org Mode is really great for stuff like this, essentially a lightweight, plain text database.
Yeah, in Obsidian, I had hundreds of tiny files. In just the past year alone I have like 400 files (including covers). My issue with that is, individually, they could get lost, changed, or deleted (rare, but a potential error). I have to deal with the filesystem and figure out how to make sure the movie cover stays with the file.
Any advice on using Org-attach to make the cover show up ? I remember things best visually, so seeing the cover and synopsis, I can recall something I've watched better. I know attachments end up as an individual file still, but it's a bit more sticky, I think.
Pay08 · 2022-12-06 06:23
>Can I call python scripts and pull in information that way?
You can write and execute code blocks in Org, but without simply writing an external script that writes to a file, I don't think what you mean is doable. It'd be great if you could elaborate, though, I don't really understand what you mean.
deafpolygon · 2022-12-06 07:11
I just mean, can lisp call out to a script, execute it, take its output and do whatever it needs... I don't understand what I'm asking because I am new to this. :|
Pay08 · 2022-12-06 07:27
You can execute shell commands with elisp (`shell-command` and `shell-command-to-string`) and store their output. However, you'd either have to write a parser for the output yourself or use a markup format that already has a parser written for it. You might also want to look at `make-process`. See "Processes" in the elisp manual for more information. But doing it through a file may be easier.
JDRiverRun · 2022-12-06 12:54
[https://orgmode.org/manual/Column-View.html](https://orgmode.org/manual/Column-View.html)
You'll want a custom `#+COLUMNS:` property at the top.
wakatara · 2022-12-08 11:47
You might want to do what I do with my Resonance Calendar (since I include movies) rather than in tables and that a org-agenda-custom-command (which I was totally surprised to find out you could do). Have to admit it is shaping up nicely and you can use idiomatic org conventions (I had both a Res Cal in Notion and then in Obsidian, but this solution works very nicely.).
This also gives you the added advantage of a page per movie for things like reviews and then you can just pull in the fields you want into the custom view. I am working with this now and have to say it's pretty slick...
See answer here:[https://www.reddit.com/r/orgmode/comments/z9jrtq/comment/iyve5mj/?context=3](https://www.reddit.com/r/orgmode/comments/z9jrtq/comment/iyve5mj/?context=3)
nb: All credit goes to the person who provided the solution to me. I just asked the question but it sounds exactly the same.