Category Archives: emacs

2016-01-11 Emacs News

Links from reddit.com/r/emacs, /r/orgmode, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, the changes to the Emacs NEWS file, and emacs-devel.

Past Emacs News round-ups

2016-01-04 Emacs News

Links from reddit.com/r/emacs, /r/orgmode, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, the changes to the Emacs NEWS file, and emacs-devel.

Past Emacs News round-ups

2015-12-28 Emacs News

Links from reddit.com/r/emacs, /r/orgmode, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, the changes to the Emacs NEWS file, and emacs-devel.

Past Emacs News round-ups

2015-12-21 Emacs Hangout

Update 2015-12-25: Added link about multiple e-mail accounts in Gnus

Embarrassing technical issues, but fortunately, people are awesome and patient! =) Skip to about 0:07 or 0:12 or something if you want to get to the conversation part.

Text chat:

Also, codingquark’s link: http://codingquark.com/multiple-email-accounts-in-gnus/

Event page

Timestamps very fuzzy because of stress =)

  • Awkwardness by myself (turns out I had to change a setting to let other people join)
  • 0:07 Okay, other people joining, whew! warning: echo
  • 0:12 Gnus
  • 0:17 Meeting other Emacs geeks
  • 0:25 Mail splitting
  • 0:30 Asana to Org
  • 0:33 Literate programming
  • 0:36 Org Mode tables and Emacs Lisp functions
  • 0:45 edebug
  • 0:48 GnuPG
  • 0:52 macros
  • 1:00 smartparens / paredit
  • 1:06 flashcards
  • 1:18 narrow
  • 1:20 switching buffers

The audio is offset by about 7 minutes from the timestamps above, so you don’t have to listen to my panicking. =) MP3, OGG

See http://sachachua.com/blog/tag/emacs-hangout for more info, including where to find upcoming hangouts.

2015-12-21 Emacs News

Links from reddit.com/r/emacs, /r/orgmode, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, the changes to the Emacs NEWS file, and emacs-devel.

Past Emacs News round-ups

Scan ~/bin and turn the scripts into Emacs commands

I want to automate little things on my computer so that I don’t have to look up command lines or stitch together different applications. Many of these things make sense to turn into shell scripts. That way, I can call them from other programs and assign keyboard shortcuts to them. Still, I spend most of my computer time in Emacs, and I don’t want to think about whether I’ve defined a command in Emacs Lisp or in a shell script. Besides, I like the way Helm lets me type parts of commands in order to select and call them.

Emacs Lisp allows you to define a macro that results in Emacs Lisp code. In this case, I want to define interactive functions so I can call them with M-x. In case I decide to call them from Emacs Lisp, such as (my/shell/rotate-screen "left"), I want to be able to pass arguments. I’m also using dash.el to provide functions like -filter and -not, although I could rewrite this to just use the standard Emacs Lisp functions.

Here’s the code that scans a given directory for executable files and creates interactive functions, and some code that calls it for my ~/bin directory.

(defmacro my/convert-shell-scripts-to-interactive-commands (directory)
  "Make the shell scripts in DIRECTORY available as interactive commands."
  (cons 'progn
          (-map
           (lambda (filename)
             (let ((function-name (intern (concat "my/shell/" (file-name-nondirectory filename)))))
               `(defun ,function-name (&rest args)
                  (interactive)
                  (apply 'call-process ,filename nil nil nil args))))
           (-filter (-not #'file-directory-p)
                    (-filter #'file-executable-p (directory-files directory t))))))

(my/convert-shell-scripts-to-interactive-commands "~/bin")

Let’s see how that goes!