Irreal: Emacs Autoloads

Over at lunarsite, Sebastian Wiesner has a very nice post that explains the ins and outs of autoloads in Emacs lisp. Mostly, autoloads take care of themselves but sometimes users do need to interact with them. Here’s an example that I learned from Steve Purcell.

Of course, if you’re writing packages you will need to understand how autoloads work and when to use them. Wiesner’s post gives you all the information you need. Definitely worth a read even if you’re not writing your own packages.

-1:-- Emacs Autoloads (Post jcs)--L0--C0--July 29, 2014 10:40 AM

Irreal: git-timemachine

Recently, I’ve seen several references to the git-timemachine package. It didn’t seem that interesting to me so I ignored it. Then I noticed that Bozhidar Batsov is recommending it on Emacs Redux. When Batsov recommends something, it’s generally an indication that that something is worth a look.

So I loaded git-timemachine from Melpa and started playing with it. It provides a functionality that, as far as I know, is missing or hard to use in git or magit. When you invoke git-timemachine on a file, you can scroll through all the versions of the file in git. This isn’t the commit records but the actual file—you get the ultimate in context.

If you often—or even sometimes—find yourself looking at older version of a file, you should take a look at this package. It’s easy to load and try out with ELPA. You don’t even need to adjust your .emcas or init.el, just load the package and start using it. If you decide you don’t like it, just uninstall it. It’s definitely worth a look.

-1:-- git-timemachine (Post jcs)--L0--C0--July 28, 2014 11:56 AM

Eric James Michael Ritz: GNU Emacs: Competing With Other Editors—Should It?

Today while browsing the Emacs Reddit I came across this interesting thread. The sensationlist title contains the following quote from co-maintainer Stefan Monnier:

We’re not in the business of competing.

He is referring to competing with other editors and IDEs. Today I want to frame his comment in the proper context and discuss whether GNU Emacs should compete with the likes of Visual Studio and Eclipse.

The Context

Stefen’s comments come from a thread discussing the policy for packages in ELPA, the official Emacs package repository. In the emacs-24 branch of the official repository, the Python mode has going through various non-bug–fix changes. Some people believe this should not happen. Changes to language-specific modes should adhere to the same feature freeze as everything else. Other people believe that changes to such modes should always be welcome, assuming that don’t break anything. One argument for this is that it helps Emacs stay up to do with editors that pump out new features, and this would help Emacs keep up.

And here came the, “We’re not in the business of competing comment.”

The Benefits of Not Competing

GNU Emacs has long done its own thing. Any long-time user will tell you that. This attitude allows the Emacs developers to focus on what interests them without being beholden to the trends and practices of editors such as Visual Studio. Granted—a lot of Emacs Lisp developers will simply ‘steal’ those features be re-writing them in Emacs Lisp, but that’s beside my point.

Decades of this attitude has created an atmosphere around Emacs where newcomers are expected to conform to the standards of Emacs, or to move on to something else. “Why isn’t Control+S ‘save’ instead of starting a search?” I’ve seen these questions a lot. Emacs fans tend to trot out three responses:

  1. You can bind the keys to whatever you want. (Non-obvious to most on how to do that.)

  2. Emacs was that way long before Control+S because the standard for save. (Clinging to the past in an effort to avoid change.)

  3. You’ll get used to it soon enough. (The weakest of all rebuttals.)

It’s worth mentioning CUA Mode helps these issues. But then you have the long-term users who seem to view CUA Mode with the same disdain that the Brazilian national football teams has when it comes to guarding their goal against Germans.

Long Term Objectives

I saw the following quote in the discussion linked above. It in no way reflects the Free Software Foundation. That said, this is not the first time I’ve seen this?

They do not want to succeed in any of these criteria. Users, developers, and donations are nice to have, but simply not a priority of GNU and the FSF.

The only thing they really want to succeed at is freedom, and by their measures Emacs already succeeded in this aspect, being a free software project under a strong copyleft license, owned by a non-profit foundation.

And that freedom does not fade or decrease if Emacs fail to attract users, developers or donations. The license ensures that Emacs is going to remain free as long as our legal system persists, even if no one was left using or developing it.

The Hell…? As another poster succintly put it, “Freedom without people, that’s an interesting goal.”

The Free Software Foundation (FSF) cannot have an attitude like this. They must realize that they compete with other editors whether they want to or not. Many programmers seem to make their choice in editors after trying each for about fifteen to thirty minutes in my experience. Emacs should do whatever it can to rope in new users within that time frame. It’s esoteric behavior that made sense decades ago no longer stands against todays standards.

Now then, the power to customize Emacs is second-to-none. But there is no reason to expect a new user approach Emacs to even realize that. Even worse, some users feel like such new users are hurting the community. They would rather have Emacs as an inclusive club for people who have invested the effort in its arcane arts.


How to change this community culture? I will write my thoughts in the future. But I admit to having no simple answers. If you have any thoughts, ideas, or disagreements then please leave them in the comments.

-1:-- GNU Emacs: Competing With Other Editors—Should It? (Post ericjmritz)--L0--C0--July 26, 2014 11:28 PM

Alex Schroeder: Oddmuse Curl

These days I’ve been working on Oddmuse Curl, an Emacs mode for editing Oddmuse wikis including this one, and Emacs Wiki. I’ve been trying to fit more and more functionality into the Emacs Version Control (VC) framework. It has been an interesting challenge. There still many things I’m missing, but a surprising amount of stuff already works.

  • better highlighting of wiki markup
  • inserting known pages
  • following links
  • creating new pages
  • posting any buffer to a wiki
  • creating new “blog” pages (name starts with current date)
  • searching wiki for a text (this does not work for Emacs Wiki because of Duck Duck Go unless you add old=1 to oddmuse-search-command – and that’s very slow)
  • searching wiki for matching page names (since we already have a list of page names cached, I guess a fancier interface is possible)
  • preview of edits in an Emacs buffer
  • preview of edits in a local file with a browser
  • preview of current page in a browser (browse-url)
  • diff with current version on the wiki
  • revert to current version on the wiki
  • log of all the changes made to a page
  • recent changes


-1:-- Oddmuse Curl (Post)--L0--C0--July 26, 2014 09:31 PM

Grant Rettke: R 3.1.1 out and it fixes the package manager function

Via gog.

-1:-- R 3.1.1 out and it fixes the package manager function (Post Grant)--L0--C0--July 26, 2014 08:57 PM

John Sullivan: No such pipe, or this pipe has been deleted

This data comes from but the Pipe does not exist or has been deleted.
-1:-- No such pipe, or this pipe has been deleted (Post)--L0--C0--July 26, 2014 08:58 AM

Timo Geusch: Sprinkler controller upgrade part III – setting it up

Putting the OpenSprinkler and Raspberry Pi together was easy, getting them to run showed my inexperience when it comes to playing with hardware. The overall install went pretty smoothly and the documentation is good and easy to follow so I’m not going to ramble on about it for very long, but just throw up some […]
-1:-- Sprinkler controller upgrade part III – setting it up (Post Timo Geusch)--L0--C0--July 25, 2014 02:39 PM

Emacs Redux: Configure the scratch buffer's mode

Pretty much every Emacs user knows of the *scratch* buffer - after all it’s always present when you start your Emacs. If you’ve set inhibit-startup-screen to t (which I recommend) it will even be the very first buffer see each time you fire up your beloved editor (unless you alter initial-buffer-choice, that is).

The scratch buffer was conceived a scratchpad for notes and Emacs Lisp experiments and a lot of Emacs users find it quite handy. On the other hand - even more users don’t really write Emacs Lisp and probably find little value in this buffer.

One little know fact about the *scratch* buffer is that its initial major mode (by default it’s lisp-interaction-mode) is not hardcoded and you can alter it. If you’re a Ruby developer you might opt to make it use ruby-mode by default:

(setq initial-major-mode 'ruby-mode)

If you do this I’d also advise you to change the buffer’s initial contents. By default they are:

;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.

For Ruby something like this might be better:

(setq initial-scratch-message "\
# This buffer is for notes you don't want to save, and for Ruby code.
# If you want to create a file, visit that file with C-x C-f,
# then enter the text in that file's own buffer.")

Or you can simply set initial-scratch-message to nil and be done with it.

-1:-- Configure the scratch buffer's mode (Post)--L0--C0--July 25, 2014 12:23 PM

Emacs Redux: Travel back and forward in git history

I recently discovered an extremely cool package called git-timemachine that allows you to step though the git history of the file you’re currently editing in Emacs.

Using it is pretty simple:

  • visit a git-controlled file and issue M-x git-timemachine (or bind it to a keybinding of your choice)
  • use the following keys to navigate historic version of the file:
    • p visit previous historic version
    • n visit next historic version
    • w copy the hash of the current historic version
    • q exit the time machine buffer

Here you can see git-timemachine in action:


This package is bundled with Prelude.

-1:-- Travel back and forward in git history (Post)--L0--C0--July 22, 2014 04:02 PM

Ivan Kanis: Learning Lisp is like learning ancient Greek

Learning Lisp is like learning ancient Greek; although it is alien, it provides insight into modern computer languages.

-1:-- Learning Lisp is like learning ancient Greek (Post Ivan Kanis)--L0--C0--July 21, 2014 12:00 AM

Flickr tag 'emacs': 2014-07-15_223308_1366x768_scrot

Thiago Barroso Perrotta posted a photo:


A typical emacs session.

-1:-- 2014-07-15_223308_1366x768_scrot (Post Thiago Barroso Perrotta ( 16, 2014 01:34 AM

Grant Rettke: Another Emacs configuration in org

Here. It is nice.

My apologies for forgetting how I ended up here.

-1:-- Another Emacs configuration in org (Post Grant)--L0--C0--July 14, 2014 01:24 AM

Mickey Petersen: Displaying and Interacting with processes using Proced

If you’re a regular user of the commandline tools top or ps then I have good news for you: there’s an Emacs command that does that and it works on Windows too!

The command is M-x proced and it is modelled on M-x dired (but it is not built on top of dired) and it does shadow most of the common navigational aids: n and p move down and up and g refreshes the buffer, for instance.

It’s also feature rich; by combining the utility of ps with the sortable, columnized and interactive system of top you get the best of both worlds.

What I like about it is that it’s a buffer like any other in Emacs. So if you’re keeping your eye on a handful of processes you can use highlight-phrase to highlight the strings you want to visually separate from the rest. It is also, in true Emacs tradition, very customizable — but I’ll get to that a bit later.

Marking, Sorting, Filtering and Formatting Columns

By default you will be given the short formatting but you can change the number of displayed columns by typing F. You’ll be shown a prompt where you can select from short, medium, long and verbose.

You can also change the filtering — which defaults to all — by pressing f. Like the formatting key above you are given a list of common filter types. Furthermore you can filter by any of the visible columns by moving your point to it and pressing RET. It will incrementally filter so you can repeatedly filter as much as you like — this is a very handy feature. Refreshing the buffer with g does not reset it: you must change your filter with f.

Like dired you can mark processes with both d and m (they do the same thing) and unmark with backspace and u. You can mark and unmark all processes with M and U. And finally you can then filter the marked processes with o.

There are some specialty mark commands as well. The command t will invert your marks and C and P will mark the children or parents of the process point is on.

Finally you can sort by columns as well. All the sort commands are bound to M-x proced-sort-xxx and to the prefix menu s:

Command Description
s c Sort by CPU %
s m Sort by Memory %
s p Sort by PID
s s Sort by Start Time
s t Sort by CPU Time
s u Sort by User
s S Sort by other column

If you want to sort by a column not bound to a key you must use s S where you are then prompted for the name of a column to sort by.

Sending Signals and Interacting with processes

Unsurprisingly sending POSIX signals is fully supported by Emacs. This is done using the Elisp function signal-process. Because of that all signals are sent using the uid of the Emacs process proced is running in. Conceivably proced could be changed to call out to userland command kill (using an external command is supported) and, by combining it with TRAMP for sudo elevation it could kill processes owned by other users. Sadly that functionality does not currently exist but abusing the default-directory variable might work.

To send a signal mark the processes you want to signal, or alternatively put your point on the target process, and press k or x. You will be shown a list of target processes and you can optionally change the default suggestion of TERM to something else.

When the signal(s) have been sent you can review the log by pressing ?.

As of Emacs 24.3 you can also renice a command by pressing r.

Understanding & Customizing Proced’s Internals

Proced is very flexible and it also supports the customize interface. You can access this inferface by typing M-x customize-group proced RET.

Proced will use the Elisp function list-system-processes to retrieve all the known PIDs and then call process-attributes on each one of them to fetch the process details. The good news is that Proced does not parse the output of ps or /proc directly but relies on Emacs’s compatibility layer to make sense of everything: this also means it works rather well on Windows.

Proced can auto update the display and you can enable this for a Proced buffer by running the command proced-toggle-auto-update and it will update every proced-auto-update-interval which is by default 5 seconds.

To make Proced auto update by default you must add a hook:

(defun proced-settings ()

(add-hook 'proced-mode-hook 'proced-settings)

You are free to customize other settings in this mode hook in much the same way you would other mode hook functions.

If you’re really serious about tweaking the way the columns are displayed you can try your hand at editing the alist variable proced-grammar-alist. It controls how sorting, justification and string formatting works for each of the process attributes returned by process-attributes.

You can also alter the default Proced filter by changing proced-filter from user to something else. Creating your own filter is also possible by adding to the proced-filter-alist; in fact this functionality lets you do rather complex things such as calling a custom function for every process attribute.

The default sort and sort order (descending or ascending) is governed by proced-sort and proced-descent respectively.

There are many more customizable options and the author of Proced, Roland Winkler, has done a great job ensuring they’re accessible from Emacs’s customize interface.

It goes without saying that Proced is a both feature rich and customizable. I think it’s a very capable replacement for most ps and top use cases, but like so features in Emacs almost nobody has heard of it.


-1:-- Displaying and Interacting with processes using Proced (Post mickey)--L0--C0--July 08, 2014 10:03 AM

Chris Ball: Serverless WebRTC, continued

Around a year ago, in WebRTC without a signaling server, I presented an simple app that can start a chat session with another browser without using a local web server (i.e. you just browse to file:///), and without using a signaling server (instead of both going to the same web page to share “offers”, you share them manually, perhaps via IM).

It’s been a busy year for WebRTC! When I released serverless-webrtc, Chrome didn’t support datachannels yet, so the code only worked on Firefox. Now it works in stable releases of both browsers, and is interoperable between the two, for both reliable (TCP-like) and unreliable (UDP-like) transfers. And I’ve just added Node to the mix (so you can do Node—Node / Node—Chrome / Node—Firefox) as well, with the first release of the serverless-webrtc NPM package. Here’s how to try it out:

$ git clone git://
$ cd serverless-webrtc
$ npm install
$ firefox serverless-webrtc.html &
$ node serverless-webrtc.js
<paste firefox's offer into node, hit return>
<paste node's answer into firefox, click ok>
<you're connected!>

And here’s a screenshot of what that looks like:

I’m able to do this thanks to the wrtc NPM module, which binds the WebRTC Native Code Package (written in C++) to Node, and then exposes a JS API on top of it that looks like the browser’s WebRTC JS API. It’s really impressive work, and the maintainers have been super-friendly.

Next I’d like to unwrap the JS from the node client and make a pure C++ version, because the Tor developers would like “to have two C++ programs that are capable of chatting with each other, after being given an offer and answer manually”, to help investigate WebRTC as a method of relaying Tor traffic.

Finally, a link that isn’t related to this project but is too cool not to mention – Feross Aboukhadijeh has a WebTorrent project to port a full BitTorrent client to the browser, also using WebRTC in a serverless way (with trackerless torrents, and peer-to-peer node introductions).

What would it mean if the next Wikipedia or GitHub (see Yurii Rashkovskii’s GitChain project!) didn’t have to spend tens of millions of dollars each year for servers and bandwidth, and could rely on peer-to-peer interaction? I’d love to find out, and I have a feeling WebRTC is going to show us.

-1:-- Serverless WebRTC, continued (Post cjb)--L0--C0--July 01, 2014 01:01 PM

Eric James Michael Ritz: Send Emacs Buffer to jrnl

Lately I’ve been using the program jrnl to keep a journal of personal information. You can write entries completely from the command-line but I dislike that approach because editing text is a pain. Since I am a GNU Emacs junkie I wanted to use that program for all of my writing. Today I want to share an extremely simple function I wrote for that purpose.

You can add a journal entry by feeding it in via standard input, e.g.

$ jrnl < /tmp/entry.txt

It does not take that much effort to write such a file in Emacs and then run the command above. But I am lazy, like most programmers. Instead of taking the minuscule time to save a file and enter one shell command I wrote the following:

(defun ejmr/send-buffer-to-jrnl ()
  "Sends the content of the current buffer to jrnl."
  (call-process-region (point-min) (point-max) "jrnl")
  (message "Saved buffer contents in journal"))

This illustrates some very basic Emacs Lisp.

First, we have to get the entire contents of the buffer. The functions point-min and point-max give us the buffer’s full length. We could also get the buffer contents by calling buffer-string, but that would not be useful here, the reason being…

Second, we have to give a region to call-process-region. The first two arguments indicate the starting and ending position of the region we want to use. This is why we use the point-* functions instead of buffer-string.

The third and final argument is simply the name of the program which will receive the region via standard input. The result is the same as if we’d executed jrnl < entry.txt where the file entry.txt contains everything in the current buffer. After that all I had to do was bind the command to a key.

As I said, this is rudimentary Emacs Lisp, but I hope it demonstrates how simply you can pass the contents of a buffer onto another program.

-1:-- Send Emacs Buffer to jrnl (Post ericjmritz)--L0--C0--June 30, 2014 09:30 PM

Got Emacs?: Emacs Third Pretest Released

A bit late in posting about it but here is official pretest  release announcement. The Windows binaries take a bit of time to appear if you can't see it already.
-1:-- Emacs Third Pretest Released (Post sivaram ( 30, 2014 02:49 AM

sachachua: Read Lisp, Tweak Emacs (Beginner 4/4): “How can I add more features? How do I deal with errors?”

This entry is part 4 of 4 in the series Read Lisp, Tweak Emacs

Previous module: “How can I make things more convenient?”

Some conventions we’ll use:

  • Inline code will be boxed and monospace in the HTML version and generally surrounded by equal signs in plain text.
  • Code samples will be monospace and in boxes in the HTML version, and enclosed in #+begin_src#+end_src in plain text. Example:
    (message "Hello world")

After this module, you’ll be able to:

  • load libraries so that you can add new features or set configuration variables
  • install and configure packages in order to add more features to your Emacs
  • understand and fix common errors
  • learn more! =)

Adding more features to Emacs

Most Emacs libraries are not loaded automatically. This saves memory and keeps things simpler. Some of the customizations you may want to make require that other parts of Emacs are loaded first. For example, if you want to define a key for the c-mode-map (used for editing C code) or add a function to org-mode-hook (called when a buffer is set up with Org Mode), those libraries need to be loaded first. You can load libraries by using require, like this:

(require 'org)

This loads the org library. require looks for a file named after the name provided to it, loads it, and double-checks that the library includes (provide 'feature-name-goes-here). It signals a Cannot open load file error if the library is not found. If the library exists but does not provide that symbol, you’ll get a Required feature FEATURE was not provided error instead.

Note that the symbol you give to require might not be the same as the function you call. For example, c-mode is actually defined in the cc-mode library, while org-mode is defined in org. To find out what file a function is defined in, use C-h f (describe-function) followed by the name of the function. The first line will tell you what file the function is defined in, if any. For example, c-mode‘s definition starts with:

c-mode is an interactive autoloaded compiled Lisp function in

The first part of the filename (before the .el or .elc) is usually what you would use with require. If you have the source installed (the .el file), you can look for the (provide ...) expression to find the actual symbol to use.

Installing packages

Emacs comes with a lot of code, but there are even more packages out there. When you read other people’s Emacs configurations, you might come across other interesting packages to try out.

Sometimes people don’t indicate which packages they use, so you have to guess the package name based on the function. For example, (global-auto-complete-mode) turns on a completion mode called auto-complete-mode in all buffers. Before you can use this, you will need to install the auto-complete package. In general, you can find package names by looking at functions that include mode in their name, removing global, turn-on, and other prefixes as needed.

The default package repository in Emacs 24 has a limited number of packages. For more choices, you may want to add another repository such as MELPA or Marmalade Here’s the code that you would run in order to add these repositories to your Emacs:

(require 'package)
(add-to-list 'package-archives '("melpa" . ""))
(add-to-list 'package-archives '("marmalade" . ""))

Note that MELPA includes many packages under active development. If you prefer to install only the packages marked as stable, replace the MELPA line with this:

(add-to-list 'package-archives '("melpa-stable" . ""))

If you’re connected to the Internet, use M-x package-refresh-contents to update the list of packages. Use M-x package-list-packages to list the available packages. RET displays the package’s description. i marks the current package for installation, and x actually performs the operations. If you know the name of the package you want to install, you can skip the list and use M-x package-install instead.

A lightweight list of the key functions defined by packages is loaded after your init.el is run. You can start that initialization earlier by adding (package-initialize), which is useful if you want to call functions that are defined in packages.

Sometimes people want to install some packages on one computer but not on another. Here’s some code that runs some configuration if the miniedit package can be loaded, but silently continues if the package has not been installed.

(when (require 'miniedit nil t)
   (define-key minibuffer-local-map (kbd "C-c e") 'miniedit))

If you use C-h f (describe-function) on require, you’ll see that it has one required argument (feature) and two optional arguments (filename, noerror). require returns non-nil (or true) if the library was loaded, so if the library exists, then the rest of the code inside the when expression gets called.

Along those lines, you may come across code that looks like this:

(eval-after-load "dash" 

This runs (dash-enable-font-lock) only after dash is loaded. It does not automatically load dash. You’ll see this when people have configuration that they want to run only if something is loaded, which can make sense for performance reasons. When you’re starting out, you may want to use require instead of eval-after-load, since the argument to eval-after-load has to be quoted.

Other Emacs Lisp files

Some files are not yet available as packages. If you search for the function, you’ll probably find a webpage with an .el file. You can save those to your computer and load them with:

(load "/path/to/file")

You can also use this technique to split up your Emacs configuration file into smaller files. For example, you might have an org-config.el file, a programming-config.el file, and so forth. If you would like to load a host-specific file only if it exists, you can take advantage of the optional NOERROR argument for load like this:

(load (concat "~/.emacs.d/" (system-name) ".el") t)

Want to find out what that filename is? Position your cursor after the ​".el") and use C-x C-e (eval-last-sexp) to see the value in the buffer.

Use C-h f (describe-function) to learn more about the load function, including other arguments you can pass to it.

If you would like to use the require syntax to load files only if they haven’t already been loaded, you can do that as long as they include the (provide ...) expression somewhere. First, you’ll need to add your downloaded Emacs Lisp file to the load-path with something like this.

(add-to-list 'load-path "/path/to/dir/with/el/files")

Then you can use require to load the Emacs Lisp code if it exists.

(require 'feature-name)

“Oh no! I have an error!”

Part of learning Emacs is having the confidence to experiment, which you can develop by learning how to recognize and deal with different errors.

If you’ve already added the code to your ~/.emacs.d/init.el, you can start Emacs with emacs --debug-init to display debugging messages, or you can start Emacs with emacs -q to skip your personal configuration. Before reporting a bug with Emacs or with a package, use emacs -q (or emacs -Q, which skips site-wide configuration as well) to see if it works as intended without your personal configuration.

To make it easier to find errors while Emacs is running, use M-x toggle-debug-on-error, then do whatever you did to trigger the error. You will probably see a detailed list of functions called in the *Messages* buffer. If you find this useful, you can enable this by default in your ~/.emacs.d/init.el. Add:

(setq debug-on-error t)

If you have code that takes a while, you might find the debug-on-quit variable or the M-x toggle-debug-on-quit function useful as well. You can quit a long-running operation by using C-g (keyboard-quit).

You can narrow down the source of the problem by progressively commenting out more and more of the code. Make sure you comment out balanced sets of parentheses. To comment a region, select it and use M-x comment-region. You can use M-x uncomment-region to uncomment it. M-x comment-dwim (do what I mean) guesses whether you want to comment or uncomment something, and has the handy keyboard shortcut M-;.

Here are some common error messages and how you can try fixing them. If you don’t see the error you’re struggling with here, ask the relevant mailing list, help-gnu-emacs, the #emacs channel on, or StackOverflow for help. Good luck!

Scan error: “Unbalanced parentheses” or “Containing expression ends prematurely”

You may have pasted in something that has a “(” but no matching “)“, which results in unbalanced parentheses. Alternatively, you may have pasted in something that has “)” but no “(“, which results in a premature end. You can use M-x check-parens to quickly check for mismatched parentheses, or try reading the code carefully in order to find the mismatched pair. You can also use C-M-f (forward-sexp) and C-M-b (backward-sexp) to navigate by complete expressions until you find the specific one that causes the error.

Cannot open load file: …

The code is trying to require or load a file that Emacs can’t find.

  • Have you installed the appropriate package? Use M-x list-packages to see if it has been packaged into a form that’s easy to install. You may need to add other sources to your package-archives to see a wider range of packages.
  • Have you downloaded it manually and added it to your load-path? See the notes on load-path for more details.
  • If you’re using load, does the file exist?

Lisp error: (void-function …)

The code calls a function that has not been defined.

  • Have you installed the appropriate package? Look at the function name and try to guess the name of the package. People usually start the function name with the package name in order to make the function names unique. Use M-x list-packages to see the available packages. You may need to add other sources to your package-archives to see a wider range of packages.
  • If you downloaded the library manually, load or require it.
  • If you’re copying some code that isn’t packaged in a library, check if there are any defun (define function) expressions that you forgot to copy. Make sure to include and evaluate those.

Symbol’s value as variable is void: _

The code is trying to get the value of a variable that has not yet been set. See if there’s other code that you need to evaluate first in order to set up those variables. If the expression involves add-to-list or add-hook, you may need to use require to load the library that defines that list or hook first.

You might also get this if you’re using C-x C-e (eval-last-sexp) to evaluate an expression that’s inside let or other things that create variables. When you’re starting out, make sure you use C-x C-e (eval-last-sexp) after the outermost set of parentheses.

I’m using C-x C-e (eval-last-sexp) and I don’t get the results I expected

Make sure you call C-x C-e after the outermost ) for the expression you want to evaluate.

(ido-mode 1)
            +---- Your cursor should be here

If the code you’re looking at has multiple expressions, you’ll need to call C-x C-e after each of them. It might be easier to select the region and use M-x eval-region, or evaluate the entire buffer with M-x eval-buffer. Alternatively, use M-x ielm to evaluate the code instead.

Again, if you don’t see the error you’re struggling with here, ask the relevant mailing list, help-gnu-emacs, the #emacs channel on, or StackOverflow for help. Good luck!

Wrapping up the beginner course

I hope that this course has helped you become more comfortable with reading and tweaking Emacs Lisp configuration code from blog posts, wiki pages, and other resources. There’s much more to learn, of course. With describe-function, describe-variable, and the ability to quickly experiment with Emacs Lisp code without restarting Emacs all the time, I’m sure you’ll get the hang of it! If you’d like to review or refer to this course, you can get it as one page at .

Check out An Introduction to Programming in Emacs Lisp, and delve into the Emacs Lisp Reference Manual for more details. Both are available within Emacs as Info manuals, which you can read with C-h i (info). Look for the Emacs Lisp Intro and Elisp entries, and browse through those manuals for more details. To search the current info manuals, type s (Info-search). To search all info manuals, use M-x info-apropos.

If you liked this or you have other questions, please get in touch – I’d love to hear from you, and I’m happy to help with other Emacs questions you may have. Good luck and have fun!

More links:

Series Navigation« Read Lisp Tweak Emacs (Beginner 3/4): How can I make things more convenient?

The post Read Lisp, Tweak Emacs (Beginner 4/4): “How can I add more features? How do I deal with errors?” appeared first on sacha chua :: living an awesome life.

-1:-- Read Lisp, Tweak Emacs (Beginner 4/4): “How can I add more features? How do I deal with errors?” (Post Sacha Chua)--L0--C0--June 26, 2014 12:00 PM

Alex Schroeder: Encrypting Mail using Gnus on OSX

Today I learned…

  1. If you want to use GPG, and you’re on OSX, pinentry will not work. You need a graphical pinentry tool. Your best bet is GPG Tools which is linked from the GnuPG website. You get Mail and Keychain integration for free, which I don’t really care about at the moment, and you get all the command line tools. Thus when I ran gpg in eshell just now, I was asked for my passphrase.
  2. If you want Emacs to know about your gpg-agent, you need to tell it about the PID and the temporary file and all that. My solution is Emacs-only. There’s probably a better way to do this such that you can use GPG from elsewhere as well. See the code snippet below.
  3. If you use Gnus to send mail, you cannot read the encrypted mails unless you set a mysterious variable. See the code snippet below.

First, how to run gpg-agent from your init file:

(setenv "GPG_AGENT_INFO"
	  (shell-command "/usr/local/bin/gpg-agent --daemon" (current-buffer))
	  (goto-char (point-min))
	  (when (re-search-forward "GPG_AGENT_INFO=\\([^;\n]+\\)" nil t)
	    (match-string 1))))
;; (getenv "GPG_AGENT_INFO")

How to make sure that mails are always encrypted to you, too:

(setq mml2015-encrypt-to-self t
      mml2015-signers '("353AEFEF"))

There you go.

The alternative to mml2015-signers would be to set mml2015-sign-with-sender to t, I guess.


-1:-- Encrypting Mail using Gnus on OSX (Post)--L0--C0--June 26, 2014 10:20 AM

sachachua: Read Lisp Tweak Emacs (Beginner 3/4): How can I make things more convenient?

This entry is part 3 of 4 in the series Read Lisp, Tweak Emacs

“How can I customize Emacs to make things more convenient?”

After this module, you’ll be able to:

  • define your own keyboard shortcuts so that you can call functions more easily
  • work with custom functions that other people have defined in their configurations
  • copy and use anonymous functions

Keyboard shortcuts

The default keyboard shortcuts (or “keybindings”) can be difficult to remember, and many useful functions don’t have any keyboard shortcuts at all. People often set up their own keyboard shortcuts to make other commands easier to use. There are different ways to assign keys depending on where you want the keybinding to be available.

Setting keybindings in all buffers

You can assign a key to a function globally, which means that it will be available in buffers of any type if there are no mode maps or local keybindings that override it. (Mode maps are set by major modes like emacs-lisp-mode or minor modes like auto-fill-mode.) Setting a global keybinding is usually done with global-set-key, although sometimes you’ll see it done with define-key and global-map.

You can use global-set-key interactively by calling it with M-x global-set-key. Type the keyboard shortcut you would like to set, then specify the name of the function you would like Emacs to call. Note that the function must be interactive – that is, it must be something you can call with M-x and it should include (interactive ...) in its definition. For example, try M-x global-set-key, then press <f10>, and assign it to save-buffer. After you do that, you should be able to press <f10> to save the current buffer.

If you like a keybinding that you’ve interactively set, use C-x ESC ESC (repeat-complex-command) to see the Emacs Lisp code for it. You can copy and paste that into your configuration. For example, setting the keybinding above will result in:

(global-set-key [f10] (quote save-buffer))

You can also write keybindings from scratch. For example, the code below redefines the Return key (or the Enter key) so that it calls the newline-and-indent function by default.

(global-set-key (kbd "RET") 'newline-and-indent)

Remember, ​'newline-and-indent and (quote newline-and-indent) are the same thing – they both refer to the name of a thing (a function, in this case) instead of its value.

(global-set-key (kbd "C-+") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)

These set C-+ (Ctrl and <plus>) and C-- (Ctrl and <minus>) to increase and decrease the font size when you’re running Emacs in a graphical environment.

If you want to set a keyboard shortcut only in particular modes or types of files, jump ahead to Setting keybindings in a particular mode.

What does kbd do? How can I figure out which key it sets?

If you’ve gone through the Emacs Tutorial (Help – Emacs Tutorial or C-h t), you’ll be familiar with many of the conventions used for writing keyboard shortcuts. C- stands for the Ctrl key, M- stands for the Meta key (which is probably Alt or Option on your keyboard). There are other prefixes as well. S- is for Shift, H- is for Hyper, and s- is for Super. Some people use operating system tools (such as setxkbmap for Linux) to change keys on their keyboard to Super or Hyper in order to enable even more keyboard shortcuts.

Uppercase or lowercase depends on the character in the shortcut. C-x means Control + x, while C-X is actually Control + Shift + X. You can also specify shift by adding S-, so C-X and C-S-x are the same.

In addition, there are some special characters: RET, SPC, TAB, and ESC must be written in uppercase to mean the special keys they refer to. (There’s also LFD and NUL, but you’re probably not going to encounter those as often.) You can use angle brackets to refer to some other keys, like <return>, <up>, <down>, <left>, <right>. Function keys are written like this: <f1>.

There are different ways to specify the key. Many people use (kbd ...) because it makes bindings easy to read.

(global-set-key (kbd "M-/") 'hippie-expand)

This is the same as

(global-set-key "\M-/" 'hippie-expand)


(global-set-key [?\M-/] 'hippie-expand)

You can use ^ to mean Control, so

(global-set-key (kbd "C-s") 'isearch-forward-regexp)

is the same as either of these lines:

(global-set-key "\C-s" 'isearch-forward-regexp)
(global-set-key (kbd "^s") 'isearch-forward-regexp)

but C- is probably easier to read.

When you use kbd, whitespace doesn’t usually matter, but it’s easier to read if you use space to separate the keys to type. For more information about the syntax used by kbd, see C-h f (describe-function) for kbd, then follow the link to the documentation for edmacro-mode.

In general, you can use C-h k (describe-key) followed by a keyboard shortcut to see if it’s already bound, and if so, what function it calls. If you type C-h k and the key you’re interested in, and Emacs is still waiting for another key, then you’re probably looking at a prefix key. For example, C-x is a prefix key that’s used in keyboard shortcuts like C-x C-e (eval-last-sexp).

Multi-key shortcuts

You can set up keybindings that use more than one key combination. This is a popular technique since you can only have so many short keybindings. For example, the following code changes C-x C-b to call ibuffer, which lists your buffers and makes it easy to jump to another buffer.

(global-set-key (kbd "C-x C-b") 'ibuffer)

You don’t have to start with C-c or C-x. Consider using one of your function keys like <f9> as the start of your keyboard shortcuts. Then you can create shortcuts that don’t involve using Ctrl, Alt, or other modifier keys. For example:

(global-set-key (kbd "<f9> b") 'ibuffer)

Read other people’s configurations to get a sense of useful commands and handy keyboard shortcuts. By convention, shortcuts like C-c followed by a lowercase or uppercase letter are reserved for your use, as are the function keys <f5> to <f9>. Other keyboard shortcuts are likely to already be defined by modes. You can override them if you want.

Some people like using a function key followed by letters in order to minimize the need to press Control or Meta. For example, you might use:

(global-set-key (kbd "C-c r") 'query-replace)


(global-set-key (kbd "<f9> r") 'query-replace)

to make it easier to replace strings. You can even bind it to both shortcuts.

Binding keys to other keys

In addition to setting keyboard shortcuts for functions, you can also define keys to expand to a longer sequence of keystrokes. You can use this for inserting strings or calling keyboard macros. For example:

(global-set-key (kbd "<f7> e") "")
(global-set-key (kbd "<f7> w") "")
(global-set-key (kbd "<f7> u") (kbd "C-x C-s"))

These might be handy for quickly inserting your e-mail address or website.

Dealing with errors: “Key sequence __ starts with non-prefix key _

If you want to create a multi-key shortcut, the preceding keys must not already be assigned to functions. For example, if you want M-t l to call transpose-lines, you’ll need to get rid of M-t‘s default binding to transpose-words first. To unset a key, bind it to nil or use global-unset-key. Here’s a group of shortcuts you can try.

(global-set-key (kbd "M-t") nil) ;; Remove the old keybinding
(global-set-key (kbd "M-t c") 'transpose-chars)
(global-set-key (kbd "M-t w") 'transpose-words)
(global-set-key (kbd "M-t t") 'transpose-words)
(global-set-key (kbd "M-t M-t") 'transpose-words)
(global-set-key (kbd "M-t l") 'transpose-lines)
(global-set-key (kbd "M-t e") 'transpose-sexps)
(global-set-key (kbd "M-t s") 'transpose-sentences)
(global-set-key (kbd "M-t p") 'transpose-paragraphs)

The example above has three bindings for transpose-words. M-t w uses the mnemonic of t-ranspose w-ords. M-t t is similar to the original binding for transpose-words, which was M-t. M-t M-t may seem like overkill, but sometimes you’ll find it easier to hold the Meta key down and hit t twice quickly instead of typing M-t, releasing Meta, and then typing t. As you read other people’s keybindings, you’ll get a sense of how people have configured their keyboard shortcuts to speed up typing and minimize thinking.

Setting keybindings in a particular mode

Sometimes you want keys to do different things in different types of files. Modes are how Emacs changes behaviour based on context. For example, Java files use java-mode, Org files use org-mode, and so forth. In addition to the major mode for a buffer, you may have several minor modes that modify the behaviour. Each mode has a keybinding map (or a “keymap”). You can assign a key in a mode map, which means it will override global keybindings in buffers with that mode. You can do this with define-key if you know the name of the keymap you want to change, which is generally the name of the mode + -map. For example:

(define-key emacs-lisp-mode-map (kbd "C-c f") 'find-function)

changes the C-c f keyboard shortcut to find-function (which jumps to the definition of a function), but only in Emacs Lisp buffers.

Note that if you use define-key with a mode map, the mode must already be loaded by the time this code is run. That’s why you’ll often see this after a require (which loads the code) or inside an eval-after-load (which postpones the code until after the mode is loaded). See Adding more features to Emacs for information on loading packages and adding new functions to Emacs.

Other ways people bind keys

The bind-key package provides a function that makes it easier to see your personal keybindings, but bind-key is not part of Emacs by default. I use bind-key a lot in my configuration. The syntax is similar to global-set-key, except it automatically wraps the keyboard shortcut string in kbd. It also keeps track of which keyboard shortcuts you’ve overridden so that you can use M-x describe-personal-keybindings to review them.

(bind-key "C-+" 'text-scale-increase)
(bind-key "C--" 'text-scale-decrease)

You’ll need to install and use the bind-key package before you can use that code.

Because keybinding is something that lots of people do to customize their Emacs, you may find other ways that people have simplified writing keybindings for themselves. When in doubt, use C-h f (describe-function) to explore how something works. If the function can’t be found, see if it’s in a package somewhere, or search the Web for more information.

For more about keybindings, see the Emacs manual and this Mastering Emacs post on keybindings.

Defuns – function definitions

In addition to the functions built into Emacs or available in packages, many people define their own with the defun function.

People often distinguish custom functions by starting them with my/ or their initials. This makes it easier to tell which functions they’ve customized and which ones are part of a package. It also minimizes the risk of accidentally overriding a function defined elsewhere. You can change the name of a function as long as you make sure you change the name wherever it’s called, such as in keyboard shortcuts, hooks, or other functions.

For example, here’s a custom function from Jorgan Schaefer’s config:

(defun fc/kill-to-beginning-of-line ()
  "Kill from the beginning of the line to point."
  (kill-region (point-at-bol) (point)))

This creates a function called fc/kill-to-beginning-of-line. () is the argument list. Since it doesn’t contain anything, that means this function does not take arguments. ​"Kill from the beginning of the line to point."​ is a documentation string (or docstring) that describes what the function does. Docstrings are optional, but highly recommended. (interactive) means that this can be called with M-x (execute-extended-command) or bound to a keyboard shortcut.

If a function does not have the (interactive) keyword, you won’t be able to call it with M-x or assign it to a keyboard shortcut, but you will still be able to write Emacs Lisp code that calls the function. This means M-x (execute-extended-command) lists only the commands that people will probably find useful while working directly with Emacs, skipping internal functions used by code.

Once you’ve defined a custom function, you can bind it to a keyboard shortcut if you want. The code below binds the fc/kill-to-beginning-of-line function to C-c C-u:

(global-set-key (kbd "C-c C-u") 'fc/kill-to-beginning-of-line)

You will often see custom functions added to hooks. A hook is a list of functions that’s called by some other code. Modes usually define a hook that’s called after the mode is initialized so that you can further customize its behaviours. For example, emacs-lisp-mode has an associated emacs-lisp-mode-hook which is run when a buffer is set up in Emacs Lisp Mode. You can add built-in functions or custom functions to hooks, and they’ll be run when that hook is called.

People sometimes use hook functions to set up keybindings instead of using define-key. For example, this code:

(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
(define-key emacs-lisp-mode-map (kbd "C-c f") 'find-function)

can also be written as:

(defun my/set-up-emacs-lisp-shortcuts ()
  "Set up some conveniences for Emacs Lisp."
  (local-set-key (kbd "C-c f") 'find-function))
(add-hook 'emacs-lisp-mode-hook 'my/set-up-emacs-lisp-shortcuts)

Lambdas – anonymous functions

Sometimes people just want to create a keyboard binding or process some data without defining a new function. lambda creates an anonymous function, which is a function that doesn’t have a name. Here’s an example:

(global-set-key (kbd "C-c e") (lambda () (interactive) (find-file "~/.emacs.d/init.el")))

This binds C-c e to an anonymous function. The () means it doesn’t take any arguments. (interactive) means it can be called through a keyboard shortcut, although since it’s anonymous, it can’t be called with M-x. The function opens the ~/.emacs.d/init.el file, which is a handy way to edit your configuration.

  1. Look for an Emacs configuration file that defines keybindings that you’re curious about. Install any packages or copy any custom functions needed. Experiment with using those keybindings. Do you like them? Do you want to tweak them further?
  2. Think about how you use Emacs. What kinds of keyboard shortcuts would make your work easier? How can you adapt some of the functions you’ve read into things that would make them even more convenient for you?
You can find the draft of the complete course at Enjoy!
Series Navigation« Read Lisp Tweak Emacs [Beginner 2/4]: How to understand what Emacs Lisp code doesRead Lisp, Tweak Emacs (Beginner 4/4): “How can I add more features? How do I deal with errors?” »

The post Read Lisp Tweak Emacs (Beginner 3/4): How can I make things more convenient? appeared first on sacha chua :: living an awesome life.

-1:-- Read Lisp Tweak Emacs (Beginner 3/4): How can I make things more convenient? (Post Sacha Chua)--L0--C0--June 20, 2014 12:31 AM

Dev and Such [Emacs Category]: A Possible Paradigm Shift

Lately I've been experiencing a change in the way I look at, think about, and use Emacs.

Emacs was always a one-stop shop for me. If I could do it in Emacs, I did. Email. Web browsing. Twitter. Listening to music. Games. Shells and terminals. Even Google Maps. Of course, I did coding and actual text editing as well.

Well, a while back a gave ol' vim a shot. I like it. Quite a bit, actually. It is my second preferred editor, and I even use evil-mode in Emacs now. I learned a lot during my time with vim, and I have been applying lessons learned to my other work flows. It has created a dichotomy in me that I've been struggling back and forth with for a while now.

Vi(m)'s big motive, so to speak, is to do one thing and do it well. It accomplishes this. It's fast and efficient. Editing in Vim is fast and efficient. This is largely why I have adopted evil-mode. However, I found myself asking "where is X?", where X could be terminals, web browsers, etc. These things simply don't exist in Vim (and, really, rightfully shouldn't). Those things aren't part of the One Thing it does well. That forced me to outsource these things to other programs. Programs I already used, mind you. This was, as crazy as it seems, a revelation. If I'm going to have a terminal, a web browser, etc. open anyway, I may as well make use of them.

So, here I am, years into my Emacs experience, finding myself with, once again, a new look on all things Emacs. Emacs is a hell of a text editor. It does lots of other things as well, some of which it does extremely well. However, not everything needs to be done, or should be done, in Emacs. It hurts me just a little to say that, but I'm increasingly believing that to be true. Heresy, thy name is me.

I'd be remiss if I didn't mention another potential factor in this recent change of mind and heart. I'm slowly (but not that slowly) severing ties with the Google Machine. In doing so, I've become aware of just how tied in I was. It was eye opening and scary. Having all your eggs in one basket, so to speak, has its benefits, but also can basically be a self-imposed lock down.

As I was untangling myself from this web (heh... get it?), I began recognizing other similar situations I was in. Emacs was at the forefront. Being so tied in to Emacs, when it crashed (which, to be fair, is rare), an update went badly, or anything else prevented Emacs from working appropriately, it was detrimental. Spreading tasks to the appropriate separate handlers is important. This is the same reason why micro-frameworks have become a huge deal, especially in the PHP world. It's piecing together your own solutions with several parts that each do one thing and do it well.

The end result of all this is I'm going to use Emacs for what it's good for: development and text editing. This includes things like running terminals for tests or other things, using version control (seriously, magit is the shit [technical term]), and other development and text editing related things. Other tasks will be delegated elsewhere, including 2048.

If you go through the history of Emacs posts on this blog, you'll see that I've flip-flopped on several topics and not kept up with various changes I've made (cough org-mode cough). This may very well fall into that category as well, and I may find myself back to doing as much in Emacs as possible. For now, though, I'll be spreading my work across multiple applications.

Side notes:

You'll notice the title of this article says "possible". That's largely due to what I said in the last paragraph.

Also, as far as getting myself away from the Google Machine, to be fair, I've basically just jumped ship to Apple (for most, but not all, things). This may sound hypocritical, but a.) as I'm basically all Apple hardware these days anyway, it at least makes more sense than being tied into Google, and b.) Apple is now at least on par with Google as far as the EFF is concerned. I'm not a complete hypocrite, though, as I've been looking at what Apple services I can move to other providers, so I'm at least trying to apply this same separation of services thought to my Apple tie-ins as well.

-1:-- A Possible Paradigm Shift (Post)--L0--C0--June 17, 2014 01:57 PM

Jorgen Schäfer: The Sorry State of Emacs Lisp Package Archives

GNU Emacs 24 (released in June 2012) introduced official support for packages, that is, a way of installing extensions from a remote repository. This was a huge step forward for Emacs, as it not only allowed users to easily find and install extensions, but it also made it possible for extensions to build upon other extensions without having to tell the user “great you want to install this, just install this extensions and those five other ones, too.” It used to be that many extensions each re-implemented common functionality just to get around this problem. Now, we have a number of general-purpose libraries.

Two years into the age of packages, there are three (four) major package archives available, but they all have some serious problems, making none of them even remotely as useful as, say, Python’s PyPI.


Emacs comes with one package archive preconfigured, GNU’s own Emacs Lisp Package Archive (ELPA). This archive is subject to the same copyright assignment policy as Emacs itself, making it nothing more than a way of adding packages to Emacs without shipping them in the default installation. With a high hurdle (requesting copyright assignment not only from yourself but from any possible contributor) and almost no benefits, it’s hardly used.

At the time of this writing, GNU ELPA contains 74 packages.


Arguably at the moment the most widely used package archive, MELPA follows a rather idiosyncratic approach to packages. Users do not upload packages, rather MELPA is configured with recipes that specify how to build a package from a remote source, ideally a version control system.

This solves one of the core problems of Emacs packages: Package authors quite regularly do not care about releases. Reducing the workload to get them published, as MELPA does, means there will be more packages available and they won’t become outdated easily just because the author did not feel like releasing their software again. This is a much bigger problem for Emacs Lisp packages than for other languages.

Sadly, MELPA has a few home-made problems.

By far the biggest one is the choice of version numbers. MELPA simply ignores any version numbers specified by the package and uses its own version number scheme based on dates. This makes sense, as it simply downloads the “latest version” from repositories, and for packages with no real releases, this isn’t a problem. But as soon as you have a package with actual releases, this is quite confusing. Worse, though, these version numbers act as a vendor lock-in. If your package evergets on MELPA, you better keep it current there because whenever someone uses MELPA, their version will override whichever one you release because 20140613.420 is simply a higher version number than 5.1.3 or whatever you just released. And MELPA has no problems adding packages even without asking the author if they are ok with it, so authors end up having to deal with this problem no matter what.

And all of this completely without need. They could have just added the date at the end of any existing version string, and all would have been well. is still higher than 5.1.3.

Even when you decide to support MELPA for a package with actual releases, it’s a pain. When you do a release, you can’t just go and announce it right away, because MELPA can take anything from an hour to a day to figure out that your source change and it re-builds it. You have no control whatsoever over this process.

Another problem is with the intention of MELPA. The maintainers deliberately want it to provide unstable packages, preferring unstable over even slightly outdated. Getting stable releases of packages with those into MELPA requires quite some effort and their authors have to deal with some abuse for it.

MELPA currently contains 1 834 packages.

MELPA Stable

To solve the latter problem, the MELPA maintainers created a spin-off of MELPA for stable packages. It has much stricter requirements than MELPA, and uses github tags to specify stable versions. This is a great idea, but sadly it’s primarily well-intended and does not actually solve any problem. Because it contains only roughly a third of the packages in MELPA unstable, users quite regularly have to use MELPA unstable as well. But MELPA unstable also contains the packages from MELPA stable, with the vendor lock-in version numbers, so they always override the stable ones, making MELPA stable mostly useless.

It is possible to circumvent this in Emacs 24.4 by pinning all packages available from MELPA stable to that repository, but that’s only possible in 24.4, and it’s something users need to do manually. Not really a good prospect for package authors.

MELPA Stable currently contains 591 packages.


Finally, there’s Maramalade. If you come from another programming language, this is what you expect a package archive to look like. Users create accounts, upload their packages with version numbers of their choice, and others can download them. Simple.

Sadly, it suffers from two distinct problems.

The first is the aforementioned mentality of many package authors. Uploading a package to a package archive is effort, and many simply skip it, much like they skip doing releases entirely. This results in a number of outdated packages in Marmalade.

The second problem is workload related. Marmalade used to be written in Node.js and was pretty flaky. The current maintainer had to rewrite it from scratch (it’s now a full web app written in Emacs Lisp, which is kind of cool), and he is already rather busy. With very little help, the rewrite took a while, and for a few months, uploads via the web interface were broken due to bugs in the old software, while currently, creating accounts is not working in the new software yet. Due to these problems, some packages simply moved away from Marmalade.

Between the heavy workload on the maintainer and the problems with package authors who do not do releases, I’m not sure about the future of Marmalade. Though I do hope it stays around; from the options we have, it’s by far the sanest.

Marmalade currently contains 1 043 packages.

Moving Forward

Emacs Lisp Package Archives have some rather unique problems to solve with the general reluctance to do actual releases of packages. Finding a balance between supporting this well and also supporting packages with actual releases is not easy, and all of the current archives have some serious problems because of this.

A good solution for this problem, and adapting or replacing the existing package archives, would be a huge step forward for Emacs.

-1:-- The Sorry State of Emacs Lisp Package Archives (Post Jorgen Schäfer ( 13, 2014 06:19 PM

Flickr tag 'emacs': Emacs Text Editor

xmodulo posted a photo:

Emacs Text Editor

What is a good text editor on Linux

If you would like to use this photo, be sure to place a proper attribution linking to

-1:-- Emacs Text Editor (Post xmodulo ( 11, 2014 02:03 AM

Ben Simon: bitgrid -- The Result of a Little Tin Can Hacking

I give you: bitgrid, a webapp without a cause. It's the result of some Tin Can Hacking.

During our last trip overseas I got the idea in my head to give myself a little programming challenge. Given the flight from DC to Paris, what kind of software could I build from scratch? I'd have at my disposal whatever was installed on my laptop, but with no Internet Connection, I was effectively on my own. I couldn't go off and grab 3rd party libraries or get answers from Google. Not to mention, I was programming all this from coach. So not only did I have to get by without StackOverflow, I'd also have to get by without legroom.

It was just me, emacs and xampp, stuck in a tin can flying at 30,000 feet.

After a little brainstorming, I decided I'd focus on building a simple little app for sharing crude images. This ended up refining itself into bitgrid, an app where you can fill in various points of a grid and share that grid with your friends. The state of the application is stored in the URL, so there's actually no database dependency. (In other words: bitgrid may not have much value, but boy does it scale!)

Here's what the webapp looks like:

And here's the URL behind that particular grid:

What's bitgrid useful for? Well, that's hard to say. It's a pretty generic app, so it's got any number of uses. You could use it to make crude maps or share minimalist art. You could use it to pass secret messages, or as a sort of online ranger beads. With a little effort, you could probably create an online game with it; one that gets played by passing URLs back and forth over Twitter. The sky's the limit.

All I know is, it was a fun little diversion.

Here are some grids to get you started: one, two and three. But really, go make something amazing!

Update: (1) an anonymous user submitted a fix to the bug keeping you from highlighting an entire row of grid points, and I've applied it. And (2), I've put the repo up at github. Feel free to fork this sucker and hack away.

Update: Special thanks to Erwin Koning for finding and fixing a nasty bug in bitgrid.

-1:-- bitgrid -- The Result of a Little Tin Can Hacking (Post Ben Simon)--L0--C0--June 10, 2014 07:11 AM

John Sullivan: GPG keysigning and government identification

Please stop recommending that checking government-issued ID is a good way to verify someone's identity before signing their GPG key.

Have you been a US bartender before? Or held any other position where you've had to verify an ID? It's not an easy thing to do. People in those positions have books of valid IDs from different states. They have lights that show the security marks. They still get it wrong regularly. A very amateur fake ID, or borrowed real ID, will fool just about everyone in any informal context.

What's even worse is that people have a habit of happily looking at passports from other countries than their own, and nodding knowingly. It's fun, but be honest, you have no idea what you're doing.

How about just signing keys with people you would actually say you know well enough to trust? It's not the Web of Amateur ID Checking.

ID checking is at best ineffective against the threats it's supposed to address, and is probably actually damaging to the Web of Trust because of the false sense of security.

No idea what I'm talking about? Learn to encrypt your email by reading the FSF's new Email Self-Defense Guide, published in honor of today's Reset The Net effort.

-1:-- GPG keysigning and government identification (Post)--L0--C0--June 05, 2014 04:02 AM

Julien Danjou: OpenStack Design Summit Juno, from a Ceilometer point of view

Last week was the OpenStack Design Summit in Atlanta, GA where we, developers, discussed and designed the new OpenStack release (Juno) coming up. I've been there mainly to discuss Ceilometer upcoming developments.

The summit has been great. It was my third OpenStack design summit, and the first one not being a PTL, meaning it was a largely more relaxed summit for me!

On Monday, we started by a 2.5 hours meeting with Ceilometer core developers and contributors about the Gnocchi experimental project that I've started a few weeks ago. It was a great and productive afternoon, and allowed me to introduce and cover this topic extensively, something that would not have been possible in the allocated session we had later in the week.

Ceilometer had his design sessions running mainly during Wednesday. We noted a lot of things and commented during the sessions in our Etherpads instances. Here is a short summary of the sessions I've attended.

Scaling the central agent

I was in charge of the first session, and introduced the work that was done so far in the scaling of the central agent. Six months ago, during the Havana summit, I proposed to scale the central agent by distributing the tasks among several node, using a library to handle the group membership aspect of it. That led to the creation of the tooz library that we worked on at eNovance during the last 6 months.

Now that we have this foundation available, Cyril Roelandt started to replace the Ceilometer alarming job repartition code by Taskflow and Tooz. Starting with the central agent is simpler and will be a first proof of concept to be used by the central agent then. We plan to get this merged for Juno.

For the central agent, the same work needs to be done, but since it's a bit more complicated, it will be done after the alarming evaluators are converted.

Test strategy

The next session discussed the test strategy and how we could improve Ceilometer unit and functional testing. There is a lot in this area to be done, and this is going to be one of the main focus of the team in the upcoming weeks. Having Tempest tests run was a goal for Havana, and even if we made a lot of progress, we're still no there yet.

Complex queries and per-user/project data collection

This session, led by Ildikó Váncsa, was about adding finer-grained configuration into the pipeline configuration to allow per-user and per-project data retrieval. This was not really controversial, though how to implement this exactly is still to be discussed, but the idea was well received. The other part of the session was about adding more in the complex queries feature provided by the v2 API.

Rethinking Ceilometer as a Time-Series-as-a-Service

This was my main session, the reason we met on Monday for a few hours, and one of the most promising session – I hope – of the week.

It appears that the way Ceilometer designed its API and storage backends a long time ago is now a problem to scale the data storage. Also, the events API we introduced in the last release partially overlaps some of the functionality provided by the samples API that causes us scaling troubles.

Therefore, I've started to rethink the Ceilometer API by building it as a time series read/write service, letting the audit part of our previous sample API to the event subsystem. After a few researches and experiments, I've designed a new project called Gnocchi, which provides exactly that functionality in a hopefully scalable way.

Gnocchi is split in two parts: a time series API and its driver, and a resource indexing API with its own driver. Having two distinct driver sets allows it to use different technologies to store each data type in the best storage engine possible. The canonical driver for time series handling is based on Pandas and Swift. The canonical resource indexer driver is based on SQLAlchemy.

The idea and project was well received and looked pretty exciting to most people. Our hope is to design a version 3 of the Ceilometer API around Gnocchi at some point during the Juno cycle, and have it ready as some sort of preview for the final release.

Revisiting the Ceilometer data model

This session led by Alexei Kornienko, kind of echoed the previous session, as it clearly also tried to address the Ceilometer scalability issue, but in a different way.

Anyway, the SQL driver limitations have been discussed and Mehdi Abaakouk implemented some of the suggestions during the week, so we should very soon see more performances in Ceilometer with the current default storage driver.

Ceilometer devops session

We organized this session to get feedbacks from the devops community about deploying Ceilometer. It was very interesting, and the list of things we could improve is long, and I think will help us to drive our future efforts.

SNMP inspectors

This session, led by Lianhao Lu, discussed various details of the future of SNMP support in Ceilometer.

Alarm and logs improvements

This mixed session, led by Nejc Saje and Gordon Chung, was about possible improvements on the alarm evaluation system provided by Ceilometer, and making logging in Ceilometer more effective. Both half-sessions were interesting and led to several ideas on how to improve both systems.


Considering the current QA problems with Ceilometer, Eoghan Glynn, the new Project Technical Leader for Ceilometer, clearly indicated that this will be the main focus of the release cycle.

Personally, I will be focused on working on Gnocchi, and will likely be joined by others in the next weeks. Our idea is to develop a complete solution with a high velocity in the next weeks, and then works on its integration with Ceilometer itself.

-1:-- OpenStack Design Summit Juno, from a Ceilometer point of view (Post Julien Danjou)--L0--C0--May 30, 2014 04:49 PM

Raimon Grau: erc makes you faster at jokes!

Hi, today's post is a simple sinppet I wrote to ease the pain of looking for recurrent references on the internet.

At work we use IRC heavily (it's our main channel for comunication). As you know,every platform or channel of comunication has its own processes and joke (slightly related (but interesting nonetheless): The medium is the Massage ) . So IRC is mostly about sending links to gifs and to funny images, and funny images with captions in them.

It's so simple that it doesn't even need explanation. You just have to know that all defuns named "erc-cmd-SOMETHING" will be automatically callable from erc as a /something.

defun erc-cmd-MEME (wat)
"Fetch links from the alist of knowledge"
let ((h '(("trap" ""))))
(erc-send-message (cadr (assoc wat h)))))

Combined with erc-image.el, it makes a really nice IRC experience :)

-1:-- erc makes you faster at jokes! (Post Raimon Grau ( 28, 2014 02:03 PM

emacspeak: Emacspeak And Company: Complete Anything Front-End For emacspeak

Emacspeak And Company: Complete Anything Front-End For Emacspeak

1 Emacspeak And Company: Complete Anything Front-End For Emacspeak

Module emacspeak-company speech-enables package Company — a flexible complete-anything extension for Emacs. Package company gains much of its flexibility by providing an extensible framework for both back-ends and front-ends; back-ends are responsible for language-specific support e.g., C++ vs Emacs Lisp; front-ends can provide different visualizations of the available completions.

I started using package company as I taught myself to program in Go over the last couple of weeks, and package emacspeak-company was one of the bi-products.

1.1 Using Company With Emacspeak

You can turn on company-mode in dividual buffers; you can also turn it on globally. Company comes pre-packaged with backend support for many programming languages; for programming in Go, I use module company-go in conjunction with the GoCode tool.

See customization group company to customize package company; Emacspeak loads package emacspeak-company when package company is loaded, and that automatically sets up the Emacspeak front-end.

Once activated, package company shows available completions where available once you type a prescribed number of characters. Available candidates are displayed visually via an overlay and can be traversed using either the up/down arrows or keys M-n and M-p. You can also search and filter the available completions, see documentation for command company-mode. The available visual front-ends also display relevant metadata for the current candidate in the echo area.

Front-end emacspeak-company performs the following additional actions:

  • Speaks current candidate along with the relevant metadata.
  • The metadata is spoken using voice-annotate.
  • Auditory icon help indicates that completion has started.
  • pressing F1 during completion displays documentation for the current candidate.
  • You can choose the current candidate by pressing RET; this

speaks the selected candidate.

  • Auditory icon close-object indicates that completion has finished.

1.2 Insights From Speech-Enabling Company

Company uses a fluid visual interface to display completions without the user having to switch contexts — it achieves this by using overlays that appear briefly in the form of a conceptual tooltip. These pseudo tooltips are created and destroyed via a timer; keyboard interaction causes these to be updated — including hiding the tooltip where appropriate.

Module emacspeak-company speech-enables this interface by examining the underlying information used to create the visualization to produce an effective audio-formatted representation. The net effect is that you can write code with completion helping you along the way; you do not need to switch tasks to lookup details as to what completions are available.

1.3 Acknowledgements

Thanks again to the authors of package company for a really nice tool — it's a real productivity winner — especially when learning a new language and its built-in packages.

I found these articles really helpful while learning to write package emacspeak-company.

Learning Go was a pleasure (it's still a pleasure — I'm still learning:-)) and the documentation on GoLang is excellent. As an added bonus, that entire site uses clean, well-formed HTML without any unnecessary artifacts that make so much of today's Web a giant mess; I have been able to use Emacs/EWW exclusively while working with — a real bonus for someone programming heavily in Emacs.

Date: <2014-05-27 Tue>

Author: T.V Raman

Created: 2014-05-27 Tue 08:51

Emacs (Org mode 8.2.6)


-1:-- Emacspeak And Company: Complete Anything Front-End For emacspeak (Post T. V. Raman ( 27, 2014 03:54 PM

Jorgen Schäfer: Race conditions in Emacs' process filter functions

Race conditions are always fun. They are particularly surprising when they happen in a single-threaded program like Emacs. I just ran into this problem for the second time.

When Emacs reads data from a process, it executes a filter functionassociated with that process. The idea is that this filter function handles the data, and after it returns, Emacs continues with other work. Due to some peculiarities of Emacs, it is easily possible for filter functions to run while other filter functions are running, seemingly randomly.

Emacs runs filter functions whenever it reads data from a process, even if this happens while a filter function is already running. And there are many places where Emacs reads data from processes. Even if you knew all the functions that do so, you do not control or know about the code Emacs runs most of the time. For example, if you create a buffer in a particular mode, that mode’s hook is run, which could execute pretty much anything.

I first encountered this problem in Circe, my IRC client for Emacs. In a filter function, it can open a new buffer in a specific mode (a query). That mode can have flyspell active, Emacs spell checker. But flyspell starts a new process for spell checking. Starting a new process can cause Emacs to read from processes, running filter functions. This resulted in a difficult to debug problem that happened only when a user received two messages in very close succession.

You can read my comments on the problem in the Circe source code.

I just ran into the same problem again in Elpy, my Python development environment. To my surprise, Emacs’ process-send-string does not only send data, it also reads data from the process and handles it in the same call. In this particular case, the usual sequence of action is to run an initialization function, and then set a flag that initialization happened, so no need to run it again. But the initialization function sends data to a process. And the filter function for this process might call the original function. Which would notice that no initialization happened, send data, which would read data, which would notice that no initialization happened yet, so send data again … stack overflow.

Solution? A dynamic scope “lock” (not a real lock as it does not block, but close enough).

(defvar my-lock nil)
(when (not my-lock)
(let ((my-lock t))

For a single-threaded application like Emacs, this looks completely useless. But it works.

-1:-- Race conditions in Emacs' process filter functions (Post Jorgen Schäfer ( 27, 2014 09:24 AM

Justin Heyes-Jones: Sending notifications from Emacs (Mac OS X)

Sending notifications from emacs is something I find useful. In an earlier blog post I talked about how to use Growl to do so.

Well now you don't need Growl any longer. There's a neat github project called terminal notifier which let's you send notifications from the terminal.

You can install it simply, via Homebrew or Rubygems as follows:
$ [sudo] gem install terminal-notifier
brew install terminal-notifier
Then you can send notifications using a command like this:

terminal-notifier -message "hello"

Finally in order to send the notification from emacs we need to write a little Emacs lisp.

Check out this gist for the code I use:

This lets you send a notification in the future using M-x timed-notification

You are prompted for a time, and the format of that time can be given in a human readable way such as "2 seconds" or "5 minutes" (If you're curious for the allowed options look at the info page in emacs for the function timer-duration )

Then you are prompted for the message "Go to the store", and the message will be sent.

The code is very simple, it simply uses run-at-time to run the terminal command in the future. A useful command is find-executable, which given a name will find that executable in your path and run it. This makes configuring tools like this less effort.


Hey if it doesn't work first time what can you do?

  1. Check if terminal notify is installed correctly by running at terminal
  2. If that succeeds and you don't get a message check if you have enabled do not disturb mode
  3. Otherwise if that succeeds and yet emacs isn't sending messages you likely don't have the executable on the path. M-x customize-variable exec-path

-1:-- Sending notifications from Emacs (Mac OS X) (Post Justin ( 26, 2014 05:09 PM

Got Emacs?: Editor wars redux in the mainstream press

From a post on comp.emacs, here's an article on slate comparing Emacs and Vi. Doesn't say anything new to people familiar to Emacs and Vi.  Just that it's there at all in some minor mainstream press.
-1:-- Editor wars redux in the mainstream press (Post sivaram ( 14, 2014 04:20 PM