Settings

Theme

Integrating Emacs with Siri Shortcuts

danpetrov.xyz

69 points by danpetrov 4 years ago · 13 comments

Reader

kwooding 4 years ago

I was really, really hoping this was about enabling emacs to be scripted via siri shortcuts. (Though this is super useful, too).

Honestly, just being able to set emacs full/split screen via a siri shortcut (and hence, any Shortcut script) would be unbelievably useful for automating pieces of my workflow.

  • tra3 4 years ago

    You should be able to attach an apple script to a Siri shortcut that runs emacsclient:

    /opt/homebrew/bin/emacsclient -e '(toggle-frame-maximized)'

  • ghotli 4 years ago

    You may find this osx tiler useful. These days I can't live without it and it's been stable for me for quite some time.

    https://github.com/koekeishiya/yabai

    • idle_zealot 4 years ago

      Did yabai ever fix native tabs totally breaking your window layout? I really want to use it, but not being able to use terminal or finder tabs with it is a tough sell.

      • ghotli 4 years ago

        Well I guess the answer is yes but since I never encountered that issue in the first place I wouldn't consider my opinion definitive. I did just test tabs in iTerm and Finder, both functioned just fine without any weirdness. Hope that helps!

tra3 4 years ago

This is why I love using emacs. The extensibility is endless, which is of course both a benefit and a liability sometimes.

I've tinkered with my own customizations of course, but can someone recommend a good methodical approach for learning elisp and emacs internals?

  • pjm331 4 years ago

    I’ve been learning by doing advent of code this year. The ramp up of problem difficulty is nice for general lisp learning, and as I get more comfortable I’ve been stretching out more and more into the emacs specific parts like working with buffers and text properties. Kind of like learning JavaScript first and then getting into the DOM and other browser specific APIs. My main resource has been the emacs lisp manual that ships with emacs.

  • User23 4 years ago

    The official documentation[1] is quite good. An Introduction to Programming in Emacs Lisp[2] is just what it sounds like. It will get you familiar with writing Elisp, using the debugger, and some other basics. At that point, you should be able to navigate the Elisp Reference Manual without too much trouble.

    Once you have that foundation, you shouldn't have much trouble scratching whatever itches that arise. The community is thriving so often a web search will return a blog or video explaining how to do exactly what you want. And once you're familiar with it, Elisp is a fairly readable language, so you can learn a lot from looking at the source for other packages to get ideas.

    Edit: Sibling comment for Advent of Code is also a solid idea. Arguably Emacs's greatest strength is that it's a fantastic Elisp development environment.

    [1] https://www.gnu.org/software/emacs/manual/

    [2] https://www.gnu.org/software/emacs/manual/eintr.html

    • medo-bear 4 years ago

      i think similarity between Common Lisp and Emacs Lisp should be pointed out more often. if you learn Emacs Lisp you have almost learned Common Lisp too. at least to the point where reading the Common Lisp Hyperspec would be a breeze

      i point this out since Common Lisp is a language with huge potential for industrial applications and heavy computations. the utility of Emacs Lisp is non existent beyond emacs. of course, if you use Emacs the program to its full potential then knowing Emacs Lisp is also a huge deal

      • danpetrovOP 4 years ago

        Emacs Lisp is totally usable as a minimal scripting language outside of the regular Emacs context.

        You can compile Emacs without any GUI toolkit support and run it heedlessly as a lisp interpreter. You can even make Emacs packages behave like CLIs with a few lines of code.

        • medo-bear 4 years ago

          of course. emacs itself is written in emacs lisp. it's not just an extension script for it. but it is not the most performant language. depending on the implementation, common lisp can be a beast with unmatched interactive development (in emacs of course)

    • tra3 4 years ago

      I know I've seen #2 previously but lost it.

      Thank you!

barbierosey 4 years ago

my friend: Emacs or Vim ? me: Emacs or what ?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection