Eric James Michael Ritz over at One More Game-Dev and Programming Blog has a nice post on how and why to use pages in Emacs. Pages in Emacs are text separated by form feeds (0xC)1. As Ritz explains, it's easy to move between pages by using 【Ctrl+x[】 (backward-page) and 【Ctrl+x]】 (forward-page).
Most of us don't use pages but Ritz gives us a good use case. As he points out, you can install a package such as Steve Purcell's page-break-lines package that will make the breaks explicit and others that make navigation easier. Go read his post and see if you can make pages work for you.
In the first post of this series we looked at using org-mode to structure your notes. Today we’ll look at adding simple tables to your notes. Later we’ll see how these tables can be used for advanced features like spreadsheet style calculations, or using them as the input and/or output of code, and also how they export nicely in html or pdf documents. For now we’ll just use them as simple static tables in our notes.
I suggest adding the text below to the org file from last time to build an org-mode notebook on how to keep org-mode notebooks!
Hopefully you can see straight away that the simple structure provided
by org-mode gives a nice way to keep an electronic note book.
Often it is nice to include tables in our notes. Org handles this by
using | to separate columns, and a line of --- (inserted with C-c -)
to add horizontal lines.
Exercise: start typing in this table below; type the first line in
1) when you get to the "s" of comments, press TAB to go to the next
2) go up to the previous line and use C-c - to add the row of dashes
3) next enter a few lines of data, using TAB to go through the
cells - you should notice the columns changing width as needed
| ID | x | y | comments ||----+---+----+----------------|| A | 2 | 4 | blah || B | 3 | 9 | blah || C | 4 | 16 | blah blah blah || D | 5 | 25 | blah |
Now, you can move rows and columns around using M-arrow and insert or
delete rows and columns using M-S-arrow. Try this out now.
** Creating and exporting tables
You can create an empty table using C-c | to run the command
org-table-create-or-convert-from-region, which will prompt for table
dimensions if no region is selected.
The same command can easily convert some text to a table; select the
following text and use C-c | to run the command
org-table-create-or-convert-from-region again to convert the text to a
ID x y
A 2 4
B 3 9
C 4 16
D 5 25
You can also save tables to their own files by putting the cursor in
the table and using M-x org-table-export. You'll be asked for a
file name and a format. For the format, type orgtbl-to and press TAB
to see the available options (e.g. orgtbl-to-csv will convert to csv
in the output file).
You can use formulae to do arithmetic on tables, and use them like a
spreadsheet. This is something I keep meaning to use more often, but
don't generally find I need it. One useful command is C-c + which runs
org-table-sum to sum the numbers in the current column.
For more on this, see e.g. this introduction. Notice that we just
added a link in our org-mode file - this is a teaser for what we will
Bsag over at But She's a Girl has a nice post on using Org mode and Pandoc. She says that she's abandoned Markup in favor of Org mode because, among other things, it provides a rich set facilities for handling the structured text. You can move headers and their associated trees up or down and you can promote or demote them in the hierarchy. And, of course, it has especially rich table editing capabilities. Markup is wonderful and all" class="wp-smiley" style="height: 1em; max-height: 1em;" />I mean that" class="wp-smiley" style="height: 1em; max-height: 1em;" />but if you're using Emacs as your editor, Org brings you everything Markdown does and much more. You really should be using it.
I've written extensively about my own system of using Org mode for writing. Normally, that means I write in Org and then export to HTML, PDF, or this blog. I use the native Org exporters for that so I don't usually need Pandoc. Bsag, has gone another route and uses ox-pandoc as her export engine. That means that all the conversion is done by Pandoc. I don't know if that's better or worse than my system but if you're just getting started you might want to give bsag's systems a try.
She also mentions using Org and Pandoc to implement a lab notebook. If you're working in the sciences and need to keep a lab notebook, you should definitely give her post a read.
As you grow accustomed to fine-tuning your Emacs experience, it’s not unusual to
start using local variables in your files. These are specified as comment lines
at the of the file, and are extremely practical in a number of scenarios. Here’s
a very simple org file.
* Some headline
Ramblings no one cares about.
* Another headline
# Local Variables:
# fill-column: 666
The only problem is that org-mode thinks that everything after a headline is
part of its contents, which is clearly not the case here. One example where this
is bad is when you want to shuffle the headlines around with M-↓ or M-↑, and
you end up with something like this.
* Another headline
# Local Variables:
# fill-column: 666
* Some headline
Ramblings no one cares about.
I asked about that on Emacs.StackExchange and got a very simple solution: just
add a “dummy” level-1 headline before the local variable specification.
* Some headline
Ramblings no one cares about.
* Another headline
* COMMENT Footer
# Local Variables:
# fill-column: 42
Now you can move, archive, and refile all your headlines as you wish, without
fear of destroying your precious variables. You can even fine-tune the
visibility to folded, so that the footer is always folded, and you won’t have
to see those variables at all.
But this wouldn’t be our weekly Endless Parentheses if I didn’t give you some
code to practice your elisp. The following command is just like end-of-buffer,
except it places point before the footer. If invoked again, it will move to the
real end of buffer.
(defunendless/org-eob()"Move to end of content, then end of buffer."(interactive)(unless(use-region-p)(push-mark))(if(looking-at-p"\n\\* COMMENT Footer")(goto-char(point-max))(goto-char(point-min))(if(search-forward"\n* COMMENT Footer"nil'noerror)(goto-char(match-beginning0))(goto-char(point-max)))))(define-keyorg-mode-map[remapend-of-buffer]#'endless/org-eob)
Finally, run the following (and add them to your .emacs):
Changes in 1.9.0
Elpy now supports the autopep8 library for automatically formatting Python code. All refactoring-related code is now grouped under C-c C-r. Use C-c C-r i to fix up imports using importmagic, C-c C-r p to fix up Python code with autopep8, and C-c C-r r to bring up the old Rope refactoring menu.
C-c C-b will now select a region containing surrounding lines of the current indentation or more.
C-c C-z in a Python shell will now switch back to the last Python buffer, allowing to use the key to cycle back and forth between the Python buffer and shell.
The pattern used for C-c C-s is now customizeable in elpy-rgrep-file-pattern.
<C-return> now can be used to send the current statement to the Python shell. Be careful, this can break with nested statements.
The Elpy minor mode now also works in modes derived from python-mode, not just in the mode itself.
Thanks to ChillarAnand, raylu and Chedi for their contributions!
WordPress is a powerful and satisfying writing and publishing platform. After learning Org-Mode, I wanted to use Org-Mode for writing and WordPress for publishing. Org2Blog makes that easy.
WordPress easily exports your posts to XML. Org2Blog-Importers converts them to Org-Mode via Pandoc. Tonight I converted them here. Any future modifications belong in these documents with publishing to WordPress.
I tested both publishing new posts and modifying and re-publishing old posts and both worked correctly.
Today I want to talk about the concept of pages in GNU Emacs, how I use them, and why I use them. In my experience pages are often overlooked by Emacs users, most likely because they look ugly, but I will show you a package to deal with that. And along the way I will show you a package that I use to make it easier to navigate between pages.
A Crash Course Introduction to Pages
‘Pages’ in Emacs refers to text separated by the form-feed character, i.e. the ^L character, meaning Ctrl+L. We can type this character by pressing C-q C-l. Using C-q tells Emacs to directly insert whatever key you press next. Normally C-l runs the recenter-top-bottom command. And so we cannot simply type C-l to get the form-feed character. But C-q C-l tells Emacs to ignore any command bound to C-l and thus inserts a literal ^L, the character we need to separate text into pages.
We use C-x [ and C-x ] to move backward and forward through pages, respectively. Those keys, by default, invoke the backward-page and forward-page commands. By pressing C-x C-p we can mark whatever page we are on.
And that’s pretty much it. Later I will come back to talk about some packages to help us navigate pages. But this is all we need to know in order to get started with pages.
Why Use Pages?
I like to use pages, particularly in programming, as a means to divide content into sections. For our game, my studio has recently created the Chance library. The source code has page-breaks dividing each section, although you won’t seem them on GitHub; they will appear as blank lines, e.g. line 228. But in Emacs that page-break line looks like this.
What turns those ugly ^L characters into those pretty horizontal lines? Steve Purcell’s terrific page-break-lines package.
The Chance library uses LDoc for generating its documentation—a form of Javadoc for Lua. In LDoc one can use the @section markup to group the code into related chunks. I have a page-break directly above each comment block that creates a new @section. Doing so divides the source code itself into the same sections by treating each section as a page in Emacs.
The result is that I can easily navigate through the source code per-section by using pages. I could use the aforementioned C-x [ and C-x ] commands for this navigation, but instead….
A Nicer Way to Navigate Pages
I like to use helm-pages to move between pages in a file. When I invoke helm-pages in the Chance source code this is what I see. Since it shows the first line on each page this results in an easy, and in my opinion pretty, way to quickly move between sections of the code base. The test suite for Chance uses page-breaks in the same way, and again helm-pages works well since the first line on each page is a call to describe() which indicates what part of the library that section tests—I use Busted for the unit tests.
A short article, I know, but honestly there’s nothing else to really say. Hopefully this demonstrates how using pages in Emacs can be a useful way to divide-up source code (or any kind of file) and easily navigate to those divisions as needed. If you have never used pages in Emacs then give it a try sometime because, like me, you may find it to be a useful tool for organizing a single file into nice, logical chunks which you can jump between quickly and easily.
I’ve started learning to touch type (for the nth time) and I find I make a lot of typos. Most are easily fixed with flyspell’s C-;, but I quite often hit ; instead of l, which flyspell can’t fix as it looks like the end of a word. I wrote a quick bit of code to replace the most recent ; with l
;;fix ; typos(defunbjm-semicolon-to-l()"Change the most recent semicolon behind the point to an l character. Useful for fixing a common touch-typing error"(interactive)(let((bjm-start-pos (point)))(search-backward ";")(delete-char 1)(insert "l")(goto-char bjm-start-pos)))(global-set-key (kbd "C-:") 'bjm-semicolon-to-l)
This is pretty simplistic, but it shows how easy it is to add a very personalised bit of extra functionality to emacs with minimal lisp skills!
I had a fascination with Python at one point, until I got too annoyed
with the indentation rules. I still have a few scripts left over, so
I'm sympathetic to Python support in Emacs. The reason for
today's post comes from
on Emacs StackExchange. Essentially, the user wants to insert parens
automatically when a function name is completed.
The completion candidates come from
jedi plugin. To quickly see
where the list of strings is coming from, I've examined ac-sources
variable and saw that it contains ac-source-jedi-direct, which evaluates to:
Note the call to deferred:sync!. I had to add that one to make sure
that jedi:complete-request completes before jedi:ac-direct-matches
Testing with some Python code, where | is the point:
The Elisp code above will return:
(#("items"05(summary"function: __builtin__.dict.items"symbol"f"document"items(self)D.items() -> list of D's (key, value) pairs, as 2-tuples"))#("iteritems"09(summary"function: __builtin__.dict.iteritems"symbol"f"document"iteritems(self)D.iteritems() -> an iterator over the (key, value) items of D"))#("iterkeys"08(summary"function: __builtin__.dict.iterkeys"symbol"f"document"iterkeys(self)D.iterkeys() -> an iterator over the keys of D"))#("itervalues"010(summary"function: __builtin__.dict.itervalues"symbol"f"document"itervalues(self)D.itervalues() -> an iterator over the values of D")))
So these strings come with the symbol documentation and symbol type
encoded as string properties. After this, the rest of the Elisp code
follows very easily, you can find it as part of
package on MELPA:
(defuncounsel-jedi()"Python completion at point."(interactive)(let((bnd(bounds-of-thing-at-point'symbol)))(ifbnd(progn(setqcounsel-completion-beg(carbnd))(setqcounsel-completion-end(cdrbnd)))(setqcounsel-completion-begnil)(setqcounsel-completion-endnil)))(deferred:sync!(jedi:complete-request))(ivy-read"Symbol name: "(jedi:ac-direct-matches):action#'counsel--py-action))(defuncounsel--py-action(symbol)"Insert SYMBOL, erasing the previous one."(when(stringpsymbol)(with-ivy-window(whencounsel-completion-beg(delete-regioncounsel-completion-begcounsel-completion-end))(setqcounsel-completion-beg(move-marker(make-marker)(point)))(insertsymbol)(setqcounsel-completion-end(move-marker(make-marker)(point)))(when(equal(get-text-property0'symbolsymbol)"f")(insert"()")(setqcounsel-completion-end(move-marker(make-marker)(point)))(backward-char1)))))
Essentially, the last interesting part is (equal (get-text-property 0
'symbol symbol) "f") which test if the string corresponds to a
function or not. The rest of the code just fiddles with symbol markers
with ensure that the previous symbol is erased before the new symbol
is inserted if you press C-M-n (ivy-next-line-and-call),
or use ivy-resume. Just to describe how this would be useful for the
Python code above: I call counsel-jedi, followed by C-M-n
Pressing C-M-n again will result in:
Once I'm satisfied with my selected candidate, I can press either
C-m or C-j or C-g. Most of the above
code can be used almost verbatim if you're a Helm fan and want to
implement helm-jedi. Basically, the approach I described (going
through ac-sources) can be used to implement alternative completion
in a lot of cases where auto-complete-mode completion is already
Finally, if you like the idea of auto-inserting parens with completion
and are using C/C++, have a look at
function-args - this
package does that too, with Ivy, Ido and Helm as available back ends.
Artur Malabarba over on Endless Parentheses has a short post about embedding a YouTube video directly from org-mode. I haven’t tried using it in org2blog yet, but I’m hoping/expecting that it’ll work there, too. It’s a very timely post as I’ve got a couple of Emacs related short video tutorials planned that would really benefit… Read More »
If you’ve every tried to do some spell-checking in org-mode you know how
finicky that can be. Ispell is happy to check absolutely anything, even code
blocks and property drawers! When you’re blogging about code-snippets from an
org file this annoyance quickly turns into irritation. Here’s how you fix it.
(defunendless/org-ispell()"Configure `ispell-skip-region-alist' for `org-mode'."(make-local-variable'ispell-skip-region-alist)(add-to-list'ispell-skip-region-alist'(org-property-drawer-re))(add-to-list'ispell-skip-region-alist'("~""~"))(add-to-list'ispell-skip-region-alist'("=""="))(add-to-list'ispell-skip-region-alist'("^#\\+BEGIN_SRC"."^#\\+END_SRC")))(add-hook'org-mode-hook#'endless/org-ispell)
It gives the window manipulating commands I use the most nicer key bindings; just by keeping the Ctrl key pressed and typing away (crazily) on the keys 2 and 3 you can create master pieces of window configurations :)
I could do this since I realized I seldom or never use these shortcuts to enter a numeric argument. If I need to, I can use a slightly longer key sequence like C-u 1 or M-1 which I have kept (for now...).
Perhaps this post will inspire someone else to do the same.
My web.py - mapserver had no bookmarking ability. First time I ever needed those to mark good berry spots. I can execute major software projects on phone+emacs alone. Slowly yes, but then it is also bug-free code. Flag-icon made with Gimp on UbuntuOnAndroid, of course.
-1:-- Purpel Flags (Post timonoko (email@example.com))--L0--C0--August 18, 2015 10:07 AM
I’ve recently switched to using homebrew as my source for Emacs on OS X after seeing this blog post by Philip Ingram. It’s a simple way to install a current Emacs once or twice a year. I don’t use beta versions or other pre-release versions, only released versions. My editor is too important a tool… Read More »
I recently implemented a system for automatically moving among a list of Org-mode tasks, which I call *TaskFlows*. The idea is simple: tag a project as a taskflow, and when you complete a task, it automatically clocks in to the next task. It's incredibly simple, being only about 20 lines of code on top of Bernt Hansen's org-mode system, but the implications are quite nice for me.
Something for beginners like me. A course in research tools which includes some clear videos on using Emacs. Kurt Schwehr put the course on YouTube (linked in note) and the course is in org mode. The Course itself is GIS focused. You can download the whole thing with Mercurial. Instructions on the page. I found it very helpful when I started. http://vislab-ccom.unh.edu/~schwehr/rt/
I'd like to highlight a new command added to
ivy-kill-ring-save. It allows to store all current candidates to
the kill ring. This could have a number of uses.
Suppose you want to learn some Elisp, specifically all functions that
start with forward-. Then call counsel-describe-function with
"forward-" as input and press M-w. Then just yank this into
some buffer, org-mode for instance, and go through the functions
one-by-one takings notes on the way:
Suppose you want to store a subset of projectile-find-file names
that match a pattern. Just press M-w and those file names
will be on the top of the kill ring. Of course, you need to have this setting on:
This scenario should apply to basically any place where you're
completing file names, like counsel-locate or
which uses ivy for completion if it's installed.
Note also that the command comes for free, since normally nothing is
done by M-w when the region isn't active. When the region
is active, this command will store the selected text instead of
I've started to use Pocket a few months ago to store my
backlog of things to read. It's especially useful as I can use it to read
content offline since we still don't have any Internet access in places such
as airplanes or the Paris metro. It's only 2015 after all.
I am also a LWN.net subscriber for years now, and I really
like their articles from the weekly edition. Unfortunately, as the access is
restricted to subscribers, you need to login: it makes it impossible to add
these articles to Pocket directly. Sad.
Yesterday, I thought about that and decided to start hacking on it. LWN
provides a feature called "Subscriber Link" that allows you to share an article
with a friend. I managed to use that feature to share the articles with my
As doing that every week is tedious, I wrote a small Python program called
lwn2pocket that I published on
GitHub. Feel free to use it, hack it and send pull
There is an issue specific to Windows 7 that will cause emacs open new frames even if you have the server running. I believe for me there are actually two issues:
1) The emacs server file cannot be stored anywhere except within %appdata% so if you run your home from Dropbox or somesuch thing you will have to add this to force the server file back to the appdata directory:
2) The server directory had to be owned by the same user as is running emacs. Typically you will run emacs from a normal user and the directory will below to Administrator. To fix this you need to browse to “%appdata%/.emacs.d/server” in explorer and change the ownership of the directory to your windows username:
We just released version 2.0 of Circe, the Client for IRC in Emacs.
Circe is a Client for IRC in Emacs. It tries to have sane defaults, and integrates well with the rest of the editor, using standard Emacs key bindings and indicating activity in channels in the status bar so it stays out of your way unless you want to use it.
This is an anniversary release – today 10 years ago, Circe has had its first commit! Since then, the code base expanded quite a bit and Circe has gained a lot of good features, contributed by over a dozen people over time. And the client now has a number of users.
It's a weird feeling when you realize that this piece of software you wrote because you were unhappy with the existing solutions not only has been with you for a decade, but has other people using and contributing to it.
Major thanks to all the awesome people I know through this software. On to the next 10 years!
Whenever I need to get Emacs to prompt me for a date or time (even for non-Org things), I use org-read-date. I love its flexibility. It’s great to be able to say things like +3 for three days from now, fri for next Friday, +2tue for two Tuesdays from now, +1w for next week, and +1m for next month. It’s easy to use org-read-date in Emacs Lisp. Calling it with (org-read-date) (usually as an interactive argument, like so: (interactive (list (org-read-date)))) gives me a date like 2015-08-06 depending on what I type in.
I use org-read-date for non-interactive date calculations, too. For example, if I want to quickly get the Org-style date for tomorrow, I can use org-read-date‘s third parameter (from-string) like this:
(org-read-date nil nil "+1")
Here’s how to calculate relative dates based on a specified date. You can hard-code the base date or use another org-read-date to get it. In this example, I’m getting the Monday after 2015-08-31. Note the use of two + signs instead of just one.
org-time-string-to-time converts a date or time string into the internal representation for time. You can then extract individual components (ex: month) with decode-time, or convert it to the number of seconds since the epoch with time-to-seconds. Alternatively, you can convert Org time strings directly to seconds with org-time-to-seconds.
If you’re working with days, you can convert time strings with org-time-string-to-absolute. For example, you can use this to calculate the number of days between two dates (including the first day but excluding the last day), like this:
To get the month, day, and year, you can use org-time-string-to-time and decode-time, or you can use org-time-string-to-seconds and calendar-gregorian-from-absolute.
To convert internal time representations into Org-style dates, I tend to use (format-time-string "%Y-%m-%d" ...). encode-time is useful for converting something to the internal time representation. If you’re working with absolute days, you can convert them to Gregorian, and then format the string.
So, to loop over all the days between the start and end date, you could use a pattern like this:
(let* ((start-date (org-read-date))
(current (org-time-string-to-absolute start-date))
(end (org-time-string-to-absolute end-date))
(while (< current end)
(setq gregorian-date (calendar-gregorian-from-absolute current))
(elt gregorian-date 2) ; month
(elt gregorian-date 0) ; day
(elt gregorian-date 1))) ; year;; Do something here; ex:
(message "%s" formatted-date)
;; Move to the next date
(setq current (1+ current))))
Alternatively, you could use org-read-date with a default date, like this:
(let* ((start-date (org-read-date))
(while (string< current end-date)
;; Do something here; ex:
(message "%s" current)
;; Move to the next date
(setq current (org-read-date nil nil "++1" nil (org-time-string-to-time current)))))
There are probably more elegant ways to write this code, so if you can think of improvements, please feel free to share.
It's been a while since I talked about Ceilometer and its companions, so I
thought I'd go ahead and write a bit about what's going on this side of
OpenStack. I'm not going to cover new features and fancy stuff today, but
rather a shallow overview of the new project processes we initiated.
Ceilometer has grown a lot since that time
when we started it 3 years ago. It has evolved from a system designed to fetch
and store measurements, to a more complex system, with agents, alarms, events,
databases, APIs, etc.
All those features were needed and asked for by users and operators, but let's
be honest, some of them should never have ended up in the Ceilometer code
repository, especially not all at the same time.
The reality is we picked a pragmatic approach due to the rigidity of the
OpenStack Technical Committee in regards to new projects to become OpenStack
integrated – and, therefore, blessed – projects. Ceilometer was actually the
first project to be incubated and then integrated. We had to go through the
very first issues of that process.
Fortunately, now that time has passed, and all those constraints have been
relaxed. To me, the
OpenStack Foundation is turning into
something that looks like the
Apache Foundation, and there's, therefore,
no need to tie technical solutions to political issues.
now allows much more flexibility to all of that. Back a year ago, we were
afraid to bring Gnocchi into Ceilometer. Was the Technical Committee going to
review the project? Was the project going to be in the scope of Ceilometer for
the Technical Committee? Now we don't have to ask ourselves those questions,
now that we have that freedom, it empowers us to actually do what we think is
good in term of technical design without worrying too much about political
The first step in this new process was to continue working on
Gnocchi (a timeserie database and resource
indexer designed to overcome historical Ceilometer storage issue) and to decide
that it was not the right call to merge it into Ceilometer as some REST API v3,
but that it was better to keep it standalone.
We managed to get traction to Gnocchi, getting a few contributors and users.
We're even seeing talks proposed to the next Tokyo Summit where people leverage
Gnocchi, such as
"Service of predictive analytics on cost and performance in OpenStack",
"Cutting Edge NFV On OpenStack: Healing and Scaling Distributed Applications".
We are also doing some progress on pushing Gnocchi outside of the OpenStack
community, as it can be a self-sufficient timeserie and resource database that
can be used without any OpenStack interaction.
Rather than continuing to grow Ceilometer, during the last summit we all
decided that it was time to reorganize and split Ceilometer into the different
components it is made of, leveraging a more
The alarm subsystem of Ceilometer being mostly untied to the rest of
Ceilometer, we decided it was the first and perfect candidate to do that. I
personally engaged into doing the work and created a new repository with only
the alarm code from Ceilometer, named Aodh.
This made sense for a lot of reason. First because Aodh can now work completely
standalone, using either Ceilometer or Gnocchi as a backend – or any new plugin
you'd write. I love the idea that OpenStack projects can work standalone – like
Swift does for example – without implying any other OpenStack component. I
think it's a proof of good design. Secondly, because it allows us to resonate
on a smaller chunk of software – a reason really under-estimated today in
OpenStack. I believe that the size of your software should match a certain
ratio to the size of your team.
Aodh is, therefore, a new project under the OpenStack Telemetry program (or
what remains of OpenStack programs now), alongside Ceilometer and Gnocchi,
forked from the original Ceilometer alarm feature. We'll deprecate the latter
with the Liberty release, and we'll remove it in the Mitaka release.
Actually, moving that code out of Ceilometer (in the case of Aodh), or not
merging it in (in the case of Gnocchi) had a few side effects that I admit I
think we probably under-estimated back then.
Indeed, the code size of Gnocchi or Aodh ended up being much smaller than the
entire Ceilometer project – Gnocchi is 7× smaller and Aodh 5x smaller than
Ceilometer – and therefore much more easy to manipulate and to hack on. That
allowed us to merge dozens of patches in a few weeks, cleaning-up and enhancing
a lot of small things in the code. Those tasks are very much harder in
Ceilometer, due to the bigger size of the code base and the small size of our
team. By having our small team working on smaller chunks of changes – even when
it meant actually doing more reviews – greatly improved our general velocity
and the number of bugs fixed and features implemented.
On the more sociological side, I think it gave the team the sensation of
finally owning the project. Ceilometer was huge, and it was impossible for
people to know every side of it. Now, it's getting possible for people inside a
team to cover a much larger portion of those smaller project, which gives them
a greater sense of ownership and caring. Which ends up being good for the
project quality overall.
That also means that we technically decided to have different core teams by
project (Ceilometer, Gnocchi, and Aodh) as they all serve different purposes and
can all be used standalone or with each others. Meaning we could have
contributors completely ignoring other projects.
All of that reminds me some discussion I heard about projects such as Glance,
trying to fit new features in - some that are really orthogonal to the original
purpose. It's now clear to me that having different small components
interacting together that can be completely owned and taken care of by a
(small) team of contributors is the way to go. People that can therefore trust
each others and easily bring new people in, makes a project really incredibly
more powerful. Having a project covering a too wide set of features make things
more difficult if you don't have enough manpower. This is clearly an issue that
big projects inside OpenStack are facing now, such as Neutron or Nova.
I wrote some instructions for setting up Gmail, Gnus and GPG. I used Emacs 24.5 and GPG 2.0 for this tutorial.
If you’re on a Mac
I tried this using my Mac and a Guest account. A Guest account has all its files deleted when you log out. It’s as “clean” as I could get.
You can install Emacs in various ways. You could use Emacs For Mac OS X. “Pure Emacs! No Extras! No Nonsense!” This is what I used to run. I’ve also built Emacs from source many times. Just remember to ./configure --with-ns before you start. You can install it from Homebrew: You could brew install emacs or you could install Yamamoto Mitsuharu’s Emacs Mac Port. This last variant is what I’m using right now.
As for GPG, you have two options. You can install GPG via GPG Suite. This is what I used at first. gpg --version said gpg (GnuPG/MacGPG2) 2.0.27 (the current, stable version is 2.0.28). But I wanted to install GPG via Homebrew. If you want to try it as well, make sure you uninstall the GPG Suite if you had it installed.
If you just install gpg2, you won’t be able to enter your passphrase from within Emacs with a GUI. You’ll see a simple, cut off message saying epa-file--find-file-not-found-function: Opening input file: Decryption failed,. If you only use Emacs within terminal windows, no problem. No need to do anything. But if you like to use Emacs with fonts and colors, menus and scrollbars, then you need to install a special variant of pinentry in order to get a separate Pinentry window:
brew install gpg2
brew install pinentry-mac
Once you have done that, change your ~/.gnupg/gpg-agent.conf file so that it has only this one line:
When you install gpg2, it tells you to put use-standard-socket in your ~/.gnupg/gpg-agent.conf file. Don’t do that unless you only want to use Emacs from a terminal. Here’s a sample session in a terminal, showing you what you’ll get, if you don’t use pinentry-mac:
alex@Megabombus:~$ echo "This is a test." > test
alex@Megabombus:~$ gpg --recipient kensanata --encrypt test
alex@Megabombus:~$ ls test*
alex@Megabombus:~$ gpg --output test2 test.gpg
You need a passphrase to unlock the secret key for
user: "Alex Schroeder <firstname.lastname@example.org>"
8192-bit RSA key, ID 4529A45C, created 2015-03-01 (main key ID ACECFEAE)
gpg: encrypted with 8192-bit RSA key, ID 4529A45C, created 2015-03-01
"Alex Schroeder <email@example.com>"
alex@Megabombus:~$ ls test*
test test.gpg test2
alex@Megabombus:~$ diff test test2
When asked for your passphrase, you’ll see something like the following:
│ Please enter the passphrase to unlock the secret key for the OpenPGP certificate: │
│ "Alex Schroeder <firstname.lastname@example.org>" │
│ 8192-bit RSA key, ID 4529A45C, │
│ created 2015-03-01 (main key ID ACECFEAE). │
│ Passphrase *****************************************************************______ │
│ <OK> <Cancel> │
This pinentry works in a terminal, but it won’t show up when GPG is called by GUI Emacs! Install pinentry-mac and you’ll be able to provide your passphrase when using Emacs.
If you already tinkered with gpg before changing ~/.gnupg/gpg-agent.conf, you’ll have to reload gpg-agent.
alex@Megabombus:~$ echo RELOADAGENT | gpg-connect-agent
People often ask how am I navigating efficiently Emacs windows and
buffers. I have the feeling they expect me to share with them some
secrets that would turbo-charge common commands like C-s, M-f,
C-x o, etc. I don’t, however, use those commands that much. Ever
since I saw that vim’s
EasyMotion has been
ported to Emacs, I’ve been using that port - namely
Basically, it allows you to navigate to every visible portion of your
Emacs (buffers & windows) with only a handful of keystrokes (usually
one two activate it and one or two to get where you want to go). You
can see it in action in this
excellent video. ace-jump served
me well for years, but I’ve had a few gripes with it that were never
addressed (multi-char targets, CamelCase support, etc). I would have
implemented those myself, if the project was maintained at all, but
alas - that’s not the case. Seems I wasn’t the only one who was
frustrated with ace-jump, as the prolific
Oleh Krehel reimplemented it pretty much from
scratch for the purposes of his excellent
ace-window library. Once I
got wind of this, I managed to persuade Oleh to start distributing his
rewrite as a standalone project, which he dubbed
Avy features everything ace-jump does and more. Apart from the
many extra features, its codebase is way cleaner and readable and Oleh
is a fantastic and very responsive maintainer. So, as far as I’m
concerned ace-jump is now a dead project and pretty much everyone
who’s using it should try out avy instead. Their usage and interface
are pretty similar, so the learning curve is non-existing. By the way,
here’s avy in action:
And what about my usage of avy? Nothing fancy here - I just bind the
commands I consider most important to handy keystrokes.
avy-goto-word-or-subword-1 is aware of CamelCase words and I do a
lot of programming in languages that use those extensively.
avy has one more thing going for it - it’s part of the default Emacs
package repo GNU ELPA, which means
that you can install it right away without having to setup any
third-party repositories (which you’ll probably need sooner or later).
JDEE (Java Development
Environment for Emacs) used to be best way to develop Java apps in
Emacs a while back. It offered a ton of
like smart auto-completion and a debugger. Unfortunately at some point
the development slowed down significantly and the project went in a
catatonic state. There was pretty much no activity for years in the
official SourceForge repo and there was also no support for features
introduced in Java 5+.
Recently, however, the project migrated to
GitHub and it’s now way easier
to get involved. Seems that some people have already started work on
updating JDEE to support modern JDKs and modern Emacs functionality.
That’s a really exciting project, as Java support has traditionally
been a weakness of Emacs and I’m writing this post with the hope that
more people will help make JDEE great again.
So what are you waiting for? If you’re into Java and friends (Scala,
Clojure, Groovy, etc), check out the new official repo and let’s get
this party started!
-1:-- JDEE Reborn (Post)--L0--C0--July 19, 2015 08:37 AM