5 ms·
Emacs' feature of being a platform for Lisp is really something that needs to be restated again and again. You can do practically anything to text or other obj
by bloopernova 5y ago
Emacs' feature of being a platform for Lisp is really something that needs to be restated again and again.
You can do practically anything to text or other objects. If you can think of it, I'm pretty sure that Emacs can accomplish that for you. Any transform, file action, font changes, etc etc.
Example, this auto-saves a given file. In this case, whenever I archive an org-mode subtree, the archive file is auto-saved:
435 │ ;; The `save-some-buffers` function can run silently, and it also accepts a
436 │ ;; function argument to predicate whether a buffer is saved or not.
437 │ ;; This predicate simply says "save the buffer's file if it's the notes archive
438 │ ;; file"
439 │ (defun redacted/save-notes-archive-file ()
440 │ (interactive)
441 │ (save-some-buffers 'no-confirm (lambda ()
442 │ (equal buffer-file-name
443 │ (expand-file-name redacted/notes-archive-file)))))
444 │
445 │ ;; Finally, the newly-defined function can advise the archive function. So,
446 │ ;; after a subtree in org is archived, the archive file will be automatically saved.
447 │ (advice-add 'org-archive-subtree :after #'redacted/save-notes-archive-file)
- convolvatron 5y agoI really wish emacs had evolved a model for dealing with simple vector graphics. I know part of that falls on the market for not choosing a common model..but
- phyrex 5y agoAFAIK it supports SVG rendering. Is that not enough or what did you have in mind?
- cossatot 5y agoI agree completely. I made a big push to switch from vim to spacemacs so that I could use org-mode for note taking and reduce my dependence on paper notebooks, but the lack of ability to easily sketch really killed it. I'm a geologist so I need to sketch out maps and other kinds of figures that aren't just scatterplots and flowcharts or whatever (which can be done programmatically). If I could have something even quite crude it would be revolutionary, especially if the org clients were improved for iOS with better editing/syncing capabilities and less of a focus on agenda and calendar capabilities (todoist and native calendar apps work better for my job situation, personally). The rest of org is so easy and powerful... I still dream my little dreams but am not willing to learn how to implement something like that myself I guess.
- chadkennedy 5y agoWould this help? https://elpa.gnu.org/packages/sketch-mode.html https://elpa.gnu.org/packages/sketch-mode.html
- AlanYx 5y agoThere's also canvas-mode, which is newer but will hopefully pick up: https://lifeofpenguin.blogspot.com/2021/08/scribble-notes-in-gnu-emacs.html https://lifeofpenguin.blogspot.com/2021/08/scribble-notes-in...
- cossatot 5y agoThis also looks great, thanks a ton!
- cossatot 5y agoThanks! This looks awesome.
- dotancohen 5y ago> I made a big push to switch from vim to spacemacs so that I could use > org-mode for note taking and reduce my dependence on paper notebooks This is exactly me for the past few months. I've replaced most of my Markdown notes dating back years to org-mode. If anybody is looking for a good notes platform, seriously, learn org-mode. I only wish that I started earlier. Signed, a two-decades VIM user.
- weaksauce 5y agoalso... i can't stress this enough... use and learn magit. so amazing for git it was spc-g-g for me on spacemacs but i am not sure what they moved to in spacemacs. on doom it is that.
- skulk 5y ago> if I could have something even quite crude it would be revolutionary How crude are you willing to go? Check out M-x artist-mode, which comes with emacs. https://www.emacswiki.org/emacs/ArtistMode https://www.emacswiki.org/emacs/ArtistMode (this is mostly a joke, I don't think anyone uses that)
- chadkennedy 5y agoWould this help? https://elpa.gnu.org/packages/sketch-mode.html https://elpa.gnu.org/packages/sketch-mode.html
- jmclnx 5y agoLearning Lisp is on my "bucket list", I know where to go to learn it but I need the time :)
- davidw 5y agoEmacs lisp is something you can figure out a bit at a time: mostly you're writing 'snippets', rather than organizing some huge codebase where you have to know all the ins and outs.
- throwaway2037 5y agoI second this. At my first Real Job after university, I was challenged by a teammate to learn to use Emacs. He laughed at how primitive my (non-Vim!) vi editor was. In hindsight, it was absolutely true. I bought the O'Reilly book for Emacs and spent many weekends teaching myself the basics. You are right: Bit by bit you write tiny macros that do things you need or want. After 1/2/5/10/30 years, your personal macros compound to create real efficiency. I don't use Emacs today, but I do appreciate that the ecosystem is enormous and well-developed.
- quanticle 5y agoI agree that elisp, itself, is quite easy to learn. I wish I could say the same about the emacs API. M-x apropos is somewhat useful, but quite a lot of my editor customizations come down to either 1) reading the source of the functionality that I'm trying to customize and reading what variables it accesses or 2) random Googling to see what others have customized. That said, to emacs' credit, it makes (1) extraordinarily easy. C-h k to see which function is being called by a given key-combination and C-h f to get to the source of that function makes it very easy to look at the internals of the editor and figure what I should setq in order to make the editor behave in the way I want.
- dotancohen 5y ago> Learning Lisp is on my "bucket list", I know where to go to learn it but I need the time :) Where?
- jpe90 5y agoBefore I learned lisp, I remember seeing this sentiment expressed a lot and thinking people were underselling the difficulty and overselling the usefulness of "programming your text editor" as opposed to just configuring it via standard options. After I learned enough Common Lisp to build a few small projects, I realized how powerful it is to write small, bespoke functions for odd text editing jobs. You can write and save functions that do something very specific but powerful to any project you're working on, regardless of the language or tooling used, because everything uses text. I'm so glad I learned it.
- codethief 5y agoI'm glad to hear that because so far my impression agrees with yours (before you learned Lisp) and this comment[0]. Do you happen to know a good tutorial to learn Emacs Lisp? [0]: https://news.ycombinator.com/item?id=29256103 https://news.ycombinator.com/item?id=29256103
- jpe90 5y agoI learned it from the manual built into Emacs itself, which you can access by entering "C-x r" and then following the link to "Emacs Lisp" near the top. I had literally never heard of Lisp at the time I stumbled on it. But the way that I actually got competent enough to do anything interesting with it was to learn Common Lisp, because they are similar in that learning to solve problems in Common Lisp lets you do the same in Elisp. I learned Common Lisp by reading Practical Common Lisp by Peter Seibel and writing small programs. I would really recommend spending a little time learning both dialects because it's easy to learn "just enough" elisp to configure your setup but not enough to appreciate what you can do with it.