Emacs org-mode examples and cookbook
ehneilsen.net
ehneilsen.net
https://f-droid.org/wiki/page/com.orgzly
It was a little annoyance we did not have anything as good as this before.
1. Install the Termux app.
2. Install the Termux API app.
3. Install the Termux api CLI tools via apt. You now have access to clipboard.
4. Install Emacs within termux.
Termux offers an apt-based package management system, and a substantial, though partial, set of Debian-based packages. (592 packages as I write this -- a full Debian archive is >60k packages now.)
There are other tools installable through other package-management archives -- notably python's "pip", which provides tools such as youtube-dl (I've previously mentioned this for offline viewing and listening of YouTube and other video/audio content).
I'm not particularly enamoured of the Android app "ecosystem" on multiple points. Including privacy and quality.
IMO the phone form-factor is too small for any really effective use, and a dedicated dumbphone, or more stationary use of IP-based voice comms is generally a preferred option.
I've almost completely abandoned voice comms, as it happens.
Now how do I get Escape, Meta, Alt, Control, Shift?
(Joking aside, serious question.)
Helm autocompletion also makes working with onscreen keyboards easier
There are programming-oriented software keyboards.
I still use orgmode for tracking my time by clocking tasks. Unfortunately this Android app doesn't seem to provide this option.
https://play.google.com/store/apps/details?id=com.coste.sync...
syncorg on github
Tons of options: shell scripts, dbus.el (since 23)/notifications.el (since 24), write(1)/wall(1) for terminals, etc
Would that be something the HN crowd would be interested in?
All of this is doable, of course. But it will be a tough sell.
That said, I'd say go for it. Worst case, nobody uses it and you just learn some of the difficulties of implementing. Hard to see that as a failure.
This really may be the 'just build it and see' sort of scenario.
I think that could absolutely kill it.
Imagine writing extensions in js or lua or whatever, and having those extensions have clear DOM-like access to the outline, have full access to their stdlib, have access to built in services like notifications, etc.
Imagine being able to programmatically access and manipulate the outline from wherever: webhook to add an outline node from IFTTT, twilio access your notes? etc. Yes you _could_ do that with Emacs, but IMHO it would take an incredible amount of work to not suck, partly because all the various pieces necessary feel like hacks on top of hacks.
Sort of how Atom and VSCode provide _much_ better interfaces (both code and UI) to your source code, and are starting to make honest inroads against the established players (like Emacs and Vim).
You can run Emacs headless, it has C extension support now, your Mac app could start it headless and communicate with it over a socket or as a network process. Multiple Emacs modes do this to make Emacs itself talk to other programs (e.g. mu4e <-> mu, gud <-> gdb), there's no reason you can't do it the other way around.
Print out your todo list and carry a pen also works well.
IIUC, what org-mode provides you is:
1. a (markdown-like) lightweight document markup language, with lots of syntax hooks ("#+") for different tools.
2. some (even lighter, i.e., no "#+" required) organization-based syntax hooks. These are the TODO/DONE/... labels (plus the "[ ]" tidbits), the table syntax, the metadata (e.g. AUTHOR). In fact, the idea of adding metadata to a lightweight markup language is very interesting.
3. some "programmy" syntax items, including things like tags, spreadsheet-like tables, properties, etc.
4. the agenda view. This is a horizontal search on multiple .org files to create a work agenda.
5. some emacs functionality related to automatic recognition and operation on some of the syntax items. For example, org-table-align will "Re-align the table and don't move to another field".
There are lots of other features, but nothing that other lightweight markup languages don't/can't have too.
My main concerns are:
1. it is inextricably tied to emacs. AFAICT, only (5) in the previous list is emacs-only. All the other functionalities are related to the markup syntax.
2. I wish the org-mode language was fully markdown compatible (I can barely remember the syntax of one, and now I need to use 2).
The fact that org-mode is tied to Emacs is both its weakness but also its strength. By sitting on the Emacs interpreter, org-mode imposes no limits to what you can achieve. The synergy with other Emacs packages is enormous.
You also forgot to mention one of the coolest features of Org: exporting your documents to whatever format you may want, e.g. html, latex, markdown, odt, reveal.js, - and it's possible to hack the export to fit your needs usually with modest effort. Here's an example of workflow to collaborate with Word users, for example: https://lists.gnu.org/archive/html/emacs-orgmode/2015-06/msg...
And here a recent blog post on exporting org to jupyter notebooks: http://kitchingroup.cheme.cmu.edu/blog/2017/01/21/Exporting-...
Other languages also allow exporting to other formats. I use md-to-pdf all the time, and it works well. Integrating the use of other tools in the export process should be independent of the usage of emacs.
You can. It's a plain text file; Emacs provides a "live" and highly interactive UI for it, but nothing prevents you editing elsewhere and invoking Emacs, in "batch" (i.e. UI-less pure language interpreter) mode if you like, to evaluate, export, or perform whatever other actions on the file. I do this all the time, albeit in an interactive Emacs, with Editorial on my phone and files synced in Dropbox.
There are also libraries in languages other than elisp which provide some export functionality; notably, Github uses org-ruby, I think it's called, to HTMLify org files for web UI rendering.
I've been experimenting toward a modern SQL interaction mode, and an Org buffer makes a brilliant place for output - native handling of tabular data, syntax-highlighted code blocks each with the query that produced a given result, headlines, plenty of place for user-added annotations, built-in export, overall a ton of work that I don't have to do.
http://www.jstatsoft.org/v46/i03
I've been thinking of starting a project specifically in org-mode for quite a while.
Doing an outline for that presentation next week, but need to put it down now, and don't want to forget about it? Schedule a reminder or due date right there in the document and it'll show up in your agenda. No switching over to a reminder app. Want to log time spent on it? Do it right there. In the middle of all that and get a phone call with a new task? You're a hotkey away from recording that info without leaving what you're working on.
For me it's the integration of all things organizational that makes it compelling.
- http://www.howardism.org/Technical/Emacs/literate-devops.htm... (Literate DevOps)
- https://vincent.bernat.im/en/blog/2017-netops-org-mode ("same" for NetOps, I am the author of this one)
...and then went further down the rabbit hole. I installed org-reveal and used it to create a very nice presentation out of my .org file - with syntax-highlighted code seemlessly merging with screenshots.
Incredible. Thanks for pointing me to this - and thank you, Howard!
Google cache version:
http://webcache.googleusercontent.com/search?q=cache:HsxJcXa...
It's getting to the point where I need to just ignore cool stuff like this post in order to get on with my life.
It took me quite a while to set things up, but I use it every day as my main editor and I'm quite happy with it. I can also easily jump back into Vim if I'm pairing with a Vim person, which was one of the things I was concerned about.
SCNR
Now I'm back to using plain old emacs, and I'm hoping I can learn from spacemacs to make emacs better by contributing back to it.
I added this to my bash profile when I got serious about learning emacs. I was not a vi power user by any stretch, but it had been my default for years. I much prefer emacs now.
For me it seems to be down to the following. When I am working with vim, I feel like I am in the same eco-system as my shell, there is a really nice continuity, whereas emacs feels like a separate entity (almost like I have an separate instance of a word processor open). I am aware emacs can be run in the shell without its GUI, but it still felt like it was separately sitting its own world.
For org stuff, I now use taskwarrior [1], which embeds into vim using taskwiki [2] and vimwiki [3] (which provides markdown export)
However, I never really got into org-mode. I use it for some simple notes and lists, but I never export them into any different format. If I want to produce a well-formatted PDF, I directly write LaTeX with the help of some very nice Emacs modes. For online documents I feel that some sort of Markdown is often the most practical choice. So far, in my experience there was little overlap in between these use cases for the same documents.
This cookbook, however, is a very nice resource. Maybe one of these tricks will convince me to use org-mode more productively at some point.
I thought org-mode would be useful for personal task management, but I find it to offer way to many intricate options for that. The restricted feature set of Wunderlist is actually better for me, and having all lists always fully available on any device and the web is extremely useful.
My experience is quite the opposite. I was a heavy LaTeX user, and stopped pure LaTeX years ago when I learned org mode. For the usual markup, Org mode syntax is much nicer than LaTeX's. And if I want custom LaTeX, Org mode lets me insert it in the document.
I never manually write TeX or HTML documents any more. I always author in Org mode and export.
>I thought org-mode would be useful for personal task management, but I find it to offer way to many intricate options for that. The restricted feature set of Wunderlist is actually better for me, and having all lists always fully available on any device and the web is extremely useful.
The task management is as simple or as intricate as you like. Org mode doesn't force any intricacies on you. If you want a simple flow, you can get it without learning too much Org Mode.
However, having it available on any device is a big deal. I'll grant you that.
That's interesting! I googled a bit and found that people actually write research papers in org-mode.
But in my experience (physics) that usually requires a lot of manual LaTeX control. Also these documents are often written in collaboration with other people, who do not use org-mode.
Frankly, Auctex with Reftex is so nice, I do not see the advantages of org-mode for my main use cases.
Maybe I will give it another try one day for letters and other one-off documents. I could see an advantage in hiding all the LaTeX boilerplate cruft.
> The task management is as simple or as intricate as you like. Org mode doesn't force any intricacies on you. If you want a simple flow, you can get it without learning too much Org Mode.
This is one case where I find actual value in the choices and pleasant design somebody else has made for me. Of course, now that I have learnt how well Wunderlist works for me, I could try to re-implement it in org-mode. But what would I gain? Mainly nicer text editing capabilities, secondly independence from a cloud service. The text editing is not a big deal, since it is actually beneficial to keep these lists short. For now, the cloud service comes with so many advantages that I accept this dependence. Finally, I have come to the surprising realization that browsing and checking off these lists is actually nicer for me in a mouse-first, keyboard-second interface, at least as long as I get to use a keyboard with a trackpoint.
You can pretty much embed any LaTeX code in your document. Org mode is usually smart enough to pick up command (\whatever) without any extra markup (I believe this works even for custom commands you defined yourself). Equations are surrounded by a single or double $. If you have other special stuff, you can explicitly put it in a block by itself and Org mode will pass it to the .tex file unmodified.
Yeah, coauthoring could be an issue.
>Frankly, Auctex with Reftex is so nice, I do not see the advantages of org-mode for my main use cases.
I'll confess that I was not an advanced Auctex user, so I can't compare. The author of org mode is a heavy latex user (astronomy professor), so I'm sure he made it good enough for his needs.
One thing I liked was the ability to insert Greek characters with minimal keystrokes (a for alpha, b for beta, etc). You can preview your equations just as you would with auctex.
This tutorial shows the capabilities in older versions of org mode. Not sure if there is an updated version:
I work in a Windows shop (Microsoft data platform partner), and most of my coworkers don't even know what emacs is. I can always export my own notes to HTML or similar for others to consume, but most of my coworkers are using OneNote. I prefer org-mode to OneNote, but for convenience I use OneNote since we can collaborate better.
I didn't find anything that can ingest and spit out OneNote compatible notebooks when I looked.
1) Didn't have Java, installed it by following the prompt that appears by running 'java' in the shell
2) brew install plantuml
3) M-x package-install<RET> plantuml-mode<RET>
4) Add following to .emacs
(setq org-plantuml-jar-path "/usr/local/Cellar/plantuml/8057/libexec/plantuml.jar")
(require 'ob-plantuml)
;; active Babel languages
(org-babel-do-load-languages
'org-babel-load-languages
'((plantuml . t)
))Just wished Preview would show thumbnails in the TouchBar.
Some alternatives I used off and on for a bit: * NValt * Respose Notes * Evernote * Plain Tasks for Sublime Text https://github.com/aziz/PlainTasks * Workflowy * Other web-based/mobile optimized tools
It's still a great tool for managing a single dev's work life, especially if using emacs, but I've found more modern tools, with collaboration built in, pretty formatting for non-techies, etc. a little more flexible.
(I also dare to say that I'm on Microsoft OneNote these days, mostly because I work in a multi-platform environment.)
Recently, I came back to it just to use for code/programming notes and instead of trying to organize all the code into source blocks I went the other way and added in my own comments and questions in blocks that can be toggled on/off around the code that's there. Now the only org syntax I really use from org-mode is `#+BEGIN:` blocks for comments/questions I can quiz myself on and occasionally headlines when I want to organize something because it's in the way of reading the plain text. If I gave advice to someone new to it it would be to start with just plaintext notes and only add what you really need. You can quickly go overboad once you are trying to figure out how to do footnotes, file linking, exporting w/ images, source code execution, etc.
"Distraction free" apps don't work, because I frequently need to switch windows a lot and need some fancy features.
Really, the answer for me is to work on staying focused. (Perhaps a lobotomy would help.) But it isn't a problem with my tools.
You don't need 90% of those massively complicated setups that you get when you Google "org mode tutorial".
* Headline 1 [1/2]
** TODO Headline 2 [2/4] :tag1:tag2:
- [ ] Some incomplete task
- [X] Some other task
- [ ] [[http://example.com][Only this part shows]]
- [X] C-c C-c will toggle the state
** DONE Headline 3
** Some code in this one :code:
#+BEGIN_SRC elisp
(defun some-function (foo)
...)
#+END_SRC
But when I want more, it's there, and I can extend it. I toyed around with, but didn't complete, having rust code snippets exported to temp files that would be compiled with the output pushed back into the buffer, for example. Just stole the org-babel code for handling C and tweaked it. I made custom states for handling my org file which contains my ledger file (ledger-cli user) so it more clearly matches my workflow. Same with links to JIRA entries at work, and creating a task management workflow that matched the way my work hours get billed and tracked by management.OTOH, if Sublime and markdown works for you, keep using it. Nothing beats a functioning tool, in the end.
I don't understand. You can just use a tool and not fiddle with it constantly? Tell me of this strange way of working.
I used org-mode to help me learn org-mode, using everything I learned prior to help bootstrap learning the next piece. At the same time I integrated the pomodoro technique into my work flow. So my habit item for learning org-mode was to spend one 25 minute period a day learning. Do this for a couple of weeks, making sure to spend some time customizing everything to suit your process and you should be all set.
I need a guide that tells me how to rationally prioritize work, health and family above my never-ending .emacs.d side project.
Later, I learned Emacs itself, and then learning Org was much easier, because I could look up functions and keys and variables and customizations, etc. from within Emacs. As some other people said, I just learned a little bit at a time as I used Org. Eventually, after customizing it and even making a couple of Org-related packages, it's become my own system that works the way I want it to. And I will probably use it for the rest of my life. That's one of the beautiful things about Emacs and Org.
https://www.youtube.com/watch?v=sQS06Qjnkcc&list=PLVtKhBrRV_...
Don't start with the manual. Emacs manuals are more like reference books.
Find some tutorials and go from there.
The learning curve is shallow - that I can promise.
In hindsight, given the many things I've tried, email + pencil&paper is still hard to beat.
[1] http://www.actionday.com [2] https://www.leuchtturm1917.us/
org-mode is very deep, and you shouldn't try to learn it all at once. Start off small in a way that you find it useful, then start adding in features as you need. There's no need to use all, or even many, of the features for most use cases.
But it's nice to have them when needed.
Anyway, about the fonts: I use monospace fonts for code, but I like proportional fonts for Org documents, so I have this in my org-mode hook:
(buffer-face-set :family (face-attribute 'variable-pitch :family))
Then I use monospace in Org code blocks like this: (set-face-font 'org-block-background frame-font)
You could also set that one in the customize interface. Emacs
Regex
Latex
Bash/Terminal/Powershell
Unicode
APL/J/K
Linear Algebra
Category Theoryhttps://github.com/melling/LanguageLearning
https://github.com/melling/ios_topics/blob/master/README.org
For LaTeX: I very strongly recommend picking up a copy of the Lion Book (Leslie Lamport) and running through the examples. I actually picked up a great deal by taking documents I'd found online in bastardised for and tagging them up manually in LaTeX for output into flexible formats -- HTML, PDF, ePub, and more. It turns out that the basics of LaTeX are, well, pretty basics. Paragraphs are double returns, which buys you a lot. Italic and bold text, and the ``quoting'' style, are the main adaptations I had to make.
Digging into the equations and images features takes some doing, but you can produce excellent docs well before that point.
Stack Exchange has a wonderful LaTeX community.
Of the rest of your list:
1. Emacs: I actually got pretty good at it at one point, then signed on to a gig (in the days just before running one's own Unix was readily possible) in which it wasn't available and the boss (idiot) didn't believe in installing anything which wasn't vendor-provisioned. That said: commit to using it. I've found that I prefer vim's editing modes, but there's viper-mode in emacs. The power of having all text interactions under your editor is ... immense.
2. Regex: Start with the basics. The Sed & Awk book (O'Reilly) is a good start. Most of it is simple substiutions, and you can get tremendous mileage from that, though as with many tools, you can abuse the concept. Perl remains probably the canonical home for advanced regex use, though most languages have some facility for it now.
3. Bash: I'd recommend this, if only because Microsoft has a poor track record of integrating with others and/or supporting other tools over a long period of time. Bash has existed on Windows since the 1990s under various toolkits, most notably Cygwin, and is now pretty much native.
4. Unicode: mostly a matter of figuring out what bits you need within a given project. I'd deprecate that on your list and consider it something to pursue on an as-needed basis.
I can't much speak to the remainder of your list, though I'd suggest treating them as tools adapted to uses and goals.
Deep dives are fine, but sometimes you just wanto to get a few toes in the water.
I'd argue that if you've got performance issues with regexes, you're (arguably) abusing the tool.
* LearningList
** TODO Emacs
** TODO Regex
** TODO Latex
** TODO Bash/Terminal/Powershell
** TODO Unicode
** TODO APL/J/K
** TODO Linear Algebra
** TODO Category Theory
EDIT: Formathttps://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2x...
It doesn't take long, and I found the explanation clear enough that it's stuck. It's also a good reference site if you want to quickly remind yourself what X means in Y dialect.
I also have a long todo list that more things go on than get done. But, I think it's probably unreasonable to expect to learn more than say one or two programming-language level things a year if you've got a job. Certainly if you're going to do the learning thoroughly and not just forget it all by the next year.
http://webcache.googleusercontent.com/search?q=cache:HsxJcXa...
I have gotten into org-mode a few months ago, simply amazing.
Edit: I see why I have been downvoted, but here is the error message I received.
451 Actioning this file would cause "ehneilsen.net//notebook/orgExamples/org-examples.html" to exceed the per-hour file actions limit of 20000 actions, try again later
"He wrote a version of Emacs in Multics MacLisp, and he wrote his commands in MacLisp in a straightforward fashion. The editor itself was written entirely in Lisp. Multics Emacs proved to be a great success — programming new editing commands was so convenient that even the secretaries in his office started learning how to use it. They used a manual someone had written which showed how to extend Emacs, but didn't say it was a programming. So the secretaries, who believed they couldn't do programming, weren't scared off. They read the manual, discovered they could do useful things and they learned to program."
https://www.gnu.org/gnu/rms-lisp.en.html
"I'm a non-technical user, non-programmer, and I started using it because of org-mode."
https://groups.google.com/d/msg/gnu.emacs.help/QU6xN34ollo/K...
"Shel wrote Mailman in Lisp. Emacs-Lisp… Mailman was the Customer Service customer-email processing application for … four, five years? A long time, anyway. It was written in Emacs. Everyone loved it.
People still love it. To this very day, I still have to listen to long stories from our non-technical folks about how much they miss Mailman. I'm not shitting you. Last Christmas I was at an Amazon party, some party I have no idea how I got invited to, filled with business people, all of them much prettier and more charming than me and the folks I work with here in the Furnace, the Boiler Room of Amazon. Four young women found out I was in Customer Service, cornered me, and talked for fifteen minutes about how much they missed Mailman and Emacs, and how Arizona (the JSP replacement we'd spent years developing) still just wasn't doing it for them."
I find whole Emacs ecosystem slow. After I type, things are slowly happening one, by one. Org Mode, especially coming from Vim is not that impressive, I do respect history of it.
There no need to hunt for todos; use `C-c \` (or `C-c /` for more options) to create a sparse tree. It supports the same queries as agenda tag searches. For example, `/!` to show all unfinished tasks, or `/TODO` for just the ones with TODO as the keyword.
You can also use the timeline view with a prefix argument to see tasks in the current file (`C-u C-c a L`). Or you can restrict other agenda views to the current buffer (`C-c a < t` for a task list). Custom agenda commands can also specify their own set of agenda files (they can also be chosen by a function whenever the agenda view is created).
Will be great to be able to check in the source for sequence diagrams since the online services I've found for making them are hard to work with as a team.
It can literally "do" any tool you use that has a cli interface.
For TODO lists I prefer Asana, since it will send you e-mails/push notifications, and has a website + mobile app.
If I could build my notebooks in emacs...
But then org mode has most of the same functionality.
https://github.com/millejoh/emacs-ipython-notebook
Seems the best of both worlds!
Now, is there a elisp notebook (or is it just emacs)?.
You can format text and tables via Markdown, add MathJax equations, etc.
Then you can write down code, evaluate it, and it can evaluate to images as well... charts and such.
You can optionally export the resulting document to HTML and share it in static form, or just share a link to the notebook. In addition, github supports Jupyter notebooks.
I guess it boils down to having a hierarchical vs sequential document as the base form, really.
Jupyter may already be more featured than org-mode through the kernels it embeds. e.g: SageMath alone is gigantic.
Then, if you don't enjoy the web interface you can use it within emacs if so you prefer.
(Your comment could be substantially improved by pointing to the source, and perhaps explaining why the tool is preferable, in your view.)
You can see some demos here:
https://github.com/jupyter/jupyter/wiki/A-gallery-of-interes...
It's free/open source and can embed lots of different technologies:
https://github.com/jupyter/jupyter/wiki/Jupyter-kernels
I think Jupyter is very powerful, the learning curve is lower, and you can share your documents in an easy way if you need to.
Your comment is condescending and not very informative.
No, it's really not. Please assume good faith.
Please do not use ad-hominem.
To others: Downvoting this comment is manifestly unfair. Please don't do that.
My wife and I use Asana to manage our lives... albeit she does most of the tasks (I really need to improve on that. She is so darn productive).