EmacsMacOSModule icon indicating copy to clipboard operation
EmacsMacOSModule copied to clipboard

👉 [[https://github.com/sponsors/xenodium][Support this work via GitHub Sponsors]]

  • An Emacs macOS module

#+HTML: macOS sharing files from Emacs dired

While extending Emacs is best done in elisp, closer macOS integrations are only possible by using native APIs.

[[https://github.com/SavchenkoValeriy/emacs-swift-module][emacs-swift-module]] enables loading native modules into Emacs, and thus extending with Swift native macOS APIs.

For now, this is mostly an experiment to exercise [[https://github.com/SavchenkoValeriy/emacs-swift-module][emacs-swift-module]] and see where we can take native integrations.

This repo currently includes native Emacs interactive commands to reveal files and share them. For example, AirDrop your current buffer or a selection of dired files.

  • Setup
  • Open =macos.el= and =M-x eval-buffer=.
  • Run =M-x macos-module-dev-reload= to build and load the native module.
  • Utilities

#+BEGIN_SRC emacs-lisp :results table :colnames '("Command" "Description") :exports results (let ((rows)) (mapatoms (lambda (symbol) (when (and (string-match "^macos-" (symbol-name symbol)) (not (string-match "git-set-author-name-and-email-credentials" (symbol-name symbol))) (commandp symbol)) (push `(,(symbol-name symbol) ,(car (split-string (or (documentation symbol t) "") "\n"))) rows)))) (seq-sort (lambda (row1 row2) (string-greaterp (seq-elt row2 0) (seq-elt row1 0))) rows)) #+END_SRC

#+RESULTS: | Command | Description | |-------------------------+--------------------------------------| | macos-module-dev-reload | Rebuild and reload native module. | | macos-reveal-in-finder | Reveal file(s) in macOS Finder. | | macos-share | Share file(s) with other macOS apps. |