Ivy-mode 0.7.0 is out07 Dec 2015
Ivy-mode is a completion method
that's similar to
Ido, but with emphasis on simplicity and
customizability. Currently, there are two related packages on MELPA:
ivy-readfor completion, as well as the basic
counselprovides some extra commands that use
The release notes are available at the homepage as usual. There are 220 commits since the last release, which was on Aug 5, roughly 4 months ago. Slowly but surely, the contributors list has grown to 20 people, besides me. A few people even got their Emacs Copyright Assignment just to make large contributions. Statistically, Org-mode is probably the prime package that leads to the most CA, but I'm glad that Ivy is there as well, contributing in a small way.
Since the release notes for
0.7.0 are huge, I don't embed them into
the post, they're listed separately. You can go through them at your
own pace, or wait until I make some highlights for each piece either
or the blog or in the manual. The manual, by the way, is a work in
progress but is already distributed in MELPA. Use C-h i
followed by g
(ivy) to read it. If you're new to reading
the info pages, there's info on info in info format: use dg
(info) to access it.
Today, I'll describe some cool stuff that I used to generate the
Markdown notes from
Changelog.org already has a
0.6.0 branch that I didn't want
to see, I've narrowed the buffer to only the
0.7.0 branch. This is
possible to do thanks to Emacs' narrowing feature and
org-narrow-to-subtree. After this command, the buffer behaves as if
0.6.0 branch isn't there and the only content is
But if I perform any edits and save the file, everything that was
hidden is still there.
As a shortcut, I'm using my worf to narrow faster.
Pressing [ while
worf-mode is active goes back to the current heading start.
While at heading start, pressing alphanumeric keys calls commands instead of self-inserting:
- N calls
- W calls
widen, which turns narrowing off.
There are, of course, many more commands and bindings in
it out if you like Org's Speed Keys feature, but feel like it could
use more structure.
pandoc-mode is an Emacs interface to pandoc - a tool that allows to export documents from one format to another. The Elisp package is available in MELPA. And I installed pandoc-1.15.2-1-amd64.deb from its homepage with:
sudo dpkg -i pandoc-1.15.2-1-amd64.deb
After that, M-x
pandoc-mode and I'm on easy street: C-c / calls
- Set the output format to Github-flavored Markdown with OG.
- Set the input format to Org-mode with bIo.
- Export with C-c / r.
- View the resulting buffer with C-c / V.
Add table of contents to Markdown
I used M-x
markdown-toc/generate-toc for this. The MELPA
provides this function. The resulting table of contents is a list
with a bunch of links, which turned out to be dead, because of the way
Github renders Markdown for releases.
swiper to replace each Markdown link with its title
swiper works with regexps, here's what I input to match each link:
This matches anything in brackets (non-greedy), followed by anything in parens; the bracket's content is captured in a group.
Then I press M-q (
swiper-query-replace) and enter
replacement - the first captured group. After this, I confirm each
replacement with y or confirm them all at once with
rectangle-mark-mode to promote TOC one level
Since all entries in the TOC were children to a single
I wanted to remove that entry and promote its children one level.
This can be done with
rectangle-mark-mode, bound by default to C-x SPC.
In my config, I use this instead:
(global-set-key (kbd "C-x SPC") 'hydra-rectangle/body)
hydra-rectangle/body is provided by
is also described in
an earlier post. I
really liked the
hydra-rectangle/body idea and use it all the time.
Here's a key sequence I used to delete a
4x95 rectangle in order to
promote the list items: C-x SPC 4l95jdo.
Use basic Elisp to turn each bug reference into an Org-mode link
When copy-pasting from the commit log into
Changelog.org, I quickly
tired of putting the each issue link as
[[https://github.com/abo-abo/swiper/issues/244][#244]]. So I
#244 instead, and used this code in the end to make the
(defun ora-quote-github-issues () (interactive) (let ((base "https://github.com/abo-abo/swiper/issues/")) (goto-char (point-min)) (while (re-search-forward "\\([^\\)#\\([0-9]+\\)" nil t) (replace-match (format "%s[[%s%s][#%s]]" (match-string 1) base (match-string 2) (match-string 2))))))
If anyone reading the blog wants to start with some basic Elisp, the
above function is a nice intro to a lot of useful functions. And I
expect that many people face this sort of automation scenario pretty
often. I'm pretty sure that M-%
could work here as well, but it's easier for me to just write out the
code and save it for later.
Thanks to everyone who contributed issues, code and documentation. Enjoy the new release.