Greg Newman: Let Org-mode manage your Emacs Dot files

If you’re an org-mode user, you’ve probably heard of org-babel by now. From the worg documentation, Org-babel extends the very excellent Org-mode with the ability to execute source code within Org-mode documents. As its name implies, Org-babel will execute code in many different languages to include emacs-lisp, ruby and python. The results of code execution — text, tables and graphics — can be used as input to other source code blocks or integrated into the powerful publishing facilities of Org-mode.

The other day on the org-mode mailing list Dan Davidson pointed out that he had been managing his dot files within org-mode documents. At that point, although I had been following the babel conversations, I had not had time to work with it. The thought of having my emacs configs in org documents intrigued me. What will that do for me besides eat up a few hours of my time? What it does is allow me to have my configs in an outline structure with folding, notes, hyperlinks to documentation and if I want to have todo’s within my configs I can allow Org-mode to add those to my agenda. Ok, a little nerdy but what the bacon!

So I spent Friday evening redoing my setup. I have a copy of my new emacs dot files up on bitbucket for anyone who wants to dig deeper. It’s close to what I was using before but I will be spending more time on it over the next few weeks. If anyone wants a github mirror leave a comment and I’ll create one.

How to set it up?

I’m not going to duplicate the efforts of the Babel developers. The worg documentation site was enough to get me going and Eric Schulte has a forked version of Phil Hagelberg’s emacs-starter-kit for great examples.

Note: Not too long ago org-babel was merged into org-mode as an official package but you can follow development at Eric Schulte’s github project.

-1:-- Let Org-mode manage your Emacs Dot files (Post Greg Newman)--L0--C0--February 08, 2010 07:39 PM

Greg Newman: Backing up Org-Mode Files

As many already know, I live in org-mode and keep my org files in a private bitbucket repository for safe keeping. One thing I don’t (or didn’t) do is push those files to the repository on a regular basis. The other morning I ate my wheaties and gained enough super power to rectify the issue.

The bash script

I keep all my dotfiles in this uber-private repository, not just my org files. To continue with this approach I added a bash script within my dot files directory which will do my grunt work.


#!/bin/sh
REPOS="hgfiles"
for REPO in $REPOS
do
    echo "Repository: $REPO"
    cd ~/$REPO
    # Add new files
    hg add .
    hg commit -m "$(date)"
    hg push
done

The variable “REPOS” holds the directories that I want pushed to bitbucket. If you have more than one, add them to this variable. Basically, the script just loops through the REPOS and adds any new files, commits them with a message of the current date and time and pushes it. If there are no new files it just fails silently and my world doesn’t implode on me.

If you are using github or a similar service, just change out the hg commands with the git commands. If you’re using svn… I’m so sorry to hear that.

The plist

Now since I’m horrible at pushing these on a regular basis and don’t have the money to buy a trained monkey to push them for me, I added them to Mac OS X’s launchctl. To do that it’s fairly simple.

I created a plist file which is also stored in my dot files directory.
cd to/the/directory touch greg.dotfiles.orghg.plist
Open this plist file in your favorite editor and add the following code.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>greg.dotfiles.orghg</string>
        <key>ProgramArguments</key>
        <array>
                <string>/Users/greg/hgfiles/management/hg.commit</string>
        </array>
        <key>StartInterval</key>
        <integer>3600</integer>
</dict>
</plist>

ProgramArguments is the path to the bash script I created earlier so Mac knows where to find it. The StartInterval is the interval to run the script. In my case I have it push every hour. 3600 seconds divided by 60 equals 60 minutes. You get the picture.

Schedule it!

Now that this is saved it’s time to hook it up and test it. For testing purposes, I changed the StartInterval to 2 minutes (180) so I could watch the console for errors in the log.

The plist file needs to be copied to the proper directory and added to the daemons.


cp greg.dotfiles.orghg.plist /Library/LaunchAgents/greg.dotfiles.orghg.plist
launchctl load /Library/LaunchAgents/greg.dotfiles.orghg.plist

All done and I can once again sleep knowing my org files are safe and sound within my repositories.

If you’re a linux user, you won’t need the plist parts, just create a cron job that will run the bash script every hour (or whatever your desired interval).

-1:-- Backing up Org-Mode Files (Post Greg Newman)--L0--C0--February 08, 2010 07:39 PM

Emacs-fu: interactive replacement



I recently found an interesting little package called iedit.el, which allows
you to interactive replacements on multiple strings at the same time. That is,
as you do one replace, you can see how all the same matches being replaced as
you type. It's hard to explain in words, you just have to try it out.

So, how to install this package?

  • First, download the package (see the link above)
  • Put it in a directory where emacs can find it; for example,
    ~/.emacs.d/elisp. If you haven't done so already, you can tell emacs to look in that directory by adding to your .emacs:
    (setq load-path (cons "~/emacs.d/elisp/" load-path))
    
  • Then, tell emacs to load this specific module; you can add
    (require 'iedit)
    
    to your .emacs to load it (alternatively, you could use the autoload facility)
  • then, define a key binding for this:
    (define-key global-map (kbd "C-;") 'iedit-mode)
    
  • Now, search for some strings that appears multiple times in your buffer, select it,
    press C-; (Ctrl+;), and watch how all other matching strings are
    changing at the same time.

Very nice.

-1:-- interactive replacement (Post djcb (noreply@blogger.com))--L0--C0--February 08, 2010 01:16 PM

Phil Hagelberg: in which telephone seems like entirely the wrong word

After years of resisting phone ownership followed by a few years of owning a 2003-era Nokia dumbphone, I finally decided to make the jump when the Nexus One was announced. I've got a strong distaste for systems that place arbitrary restrictions on their users, and while the Android OS itself doesn't have any, many Android phones before the Nexus One have had the carriers interfere with the user's control over their phone, though not to the same offensive degree as Apple. The Nexus One is sold directly through Google without giving the carriers a chance to sully it.

Daily Usage

The screen is just brilliant, and the 800x480 resolution means everything is sharp. The OS is very smooth and responsive. Having spent so long on a system where the keyboard is king and the mouse is only used in exceptional cases, switching to the inverse situation on the phone is a bit odd, but not as disorienting as you'd expect. Like any handheld keyboard, the Nexus's is bad for writing anything longer than a tweet, but it's certainly no worse than the hardware keyboard on the old Zaurus I toy around with occasionally. The built-in apps work great, and if you take the plunge to fully switch to GMail, it pretty much makes syncing your mailbox a solved problem.

nexus logo

There are a few nit picks like the color balance being a bit off on the camera, the way the face buttons don't trigger unless you push the upper half, and the fact that the built-in jabber client only supports a single account. But these are all pretty minor or easy to work around. The only thing that really bugs me about it is the fact that there's no ZeroConf implementation yet for the platform. But there are people working on this, so it's just a matter of time.

Oh, and using it to Talk?

It turns out you can also use the Nexus One to interface with the global legacy telephone system and make calls on that. Supposedly it has a very nice dual-mic noise suppression system for when you do this, but I've only made a handful of test calls so far. I got a data-only plan for half of what the regular voice+data plans go for and had planned to use Sipdroid to make VoIP calls with it, but then I realized I just don't make voice calls any more. So while there's a barely-noticeable delay with SIP calls over the 3G network, it really doesn't bother me. I also have used the Wired Tether app to hook up my laptop on the go and can confirm that calls via Skype sound fine too. So it's nice that T-Mobile isn't blocking that on a network level. They do seem to be the least-user-hostile of all the US carriers.

Hacking It

Of course once you get past the formalities, the question that matters to a hacker is how it feels to hack. I've only really gotten started with this, but my initial report is fairly positive. The official toolsets are either Eclipse or Ant, neither of which give me warm fuzzies, but luckily you can use Ant out of the box without getting exposed to the XML-editing ickiness.

garrett demo

Getting programs onto the device is pretty simple. Once your source is ready, you run ant debug, which produces a .apk package. You can use the adb (android debugger) program to load it up over USB, but since I keep leaving my USB cable various places, I prefer just scping it to my server and pointing my device's browser directly at the .apk. You can also use this to install dev builds of various apps before they have been uploaded to the Market.

The API seems pretty sane. A lot of thought has gone into the notion of supporting a single front-and-center application while allowing others to run in the background without impacting battery life and performance too severely. I've played a bit with the graphics tools, and they remind me a fair bit of Processing, which is a good thing. I haven't done much intricate UI work with a lot of buttons or menus, but that kind of stuff can be tedious even in the nicest environments.

Language of Choice

Since the Android VM is based on the JVM, there's a whole host of languages that can run on it. Unfortunately, Dalvik is no Hotspot—it currently lacks JIT, and the GC is merely serviceable rather than astoundingly good like Hotspot's. The lack of a good GC makes using persistent data structures a real drag since they generate a lot of ephemeral garbage, so Clojure is not a good choice. The lack of JIT coupled with CPUs that are comparatively low-powered means that while JRuby runs, it's not altogether pleasant, especially considering the blitz with which regular apps perform. I've been told there is some low-hanging fruit for improving performance on Android, so this is likely to improve to a degree. Rhino, Python, Lua, Scala, and others work, (including, I'm told, even some legacy languages like Java, if you can imagine that) but I decided to try the less-traveled route with something called Duby.

Duby is a language created by Charles Nutter, the head of the JRuby project. JRuby is an amazing feat in part because Ruby's object model is vastly different from what's natively available on the Java platform. By an astounding effort they've managed to put together a first-class Ruby implementation, but it does beg the question: what would a modern language look like that went with the grain of its host instead of violently against it? Duby is an attempt to answer that question.

The syntax of Duby is nearly identical to that of Ruby; it only adds type declarations to method definitions. Yes, that means it's statically-typed. While it has type inference, it's not Hindley-Milner-style, it's closer to Scala's. Locals get their types inferred, it's only arguments in method definitions that need hints. So far I keep forgetting this nearly every time I write a new method since it looks so close to Ruby otherwise, but I'm sure I'll get the hang of it. Closures are implemented, so you can iterate over collections with blocks. Duby is also unique in that it literally has no runtime— its literals translate directly to ArrayLists and HashMaps, so once you've compiled, the code is more or less identical to what the Java compiler would have output.

Progress

So far I've only put together a couple toy apps: Hello World, and a graphics demo with a bouncing ball. Unfortunately, Duby is a very immature language, and it shows. Starting out I had to go to Charlie at nearly every turn with stack traces. Half the time it would be my fault, and half the time it would be something as-yet-unsupported by the compiler. But so far he's been able to turn around and bring in all the features I need, which has been quite amazing. I'm hoping to get a chance to dive into the compiler source myself and get to the point where I can add features I need with minimal guidance.

Adapting the build process to Duby was surprisingly easy. You redeclare the compile task to call the Duby compiler instead of javac, tell it to output its bytecode in the right directory, and the rest of it just falls into place.

My next plans are to add more interactivity to my graphics demo; I'd like to play with creating objects and applying motion rules to them; I hope to come up with something my two-year-old would get a kick out of. So far it's been a lot of fun and a great way to explore the capabilities of this remarkable device.

-1:-- in which telephone seems like entirely the wrong word (Post Phil Hagelberg)--L0--C0--February 07, 2010 09:35 PM

Chris Ball: Computers that aren't computers

Me: "I think I'm done buying computers that I can't run my own code on."
Friend: "Just think of the iPad as being a pile of books. You can't run your code on those either."
Me: "Thinking of a computer as being a pile of books is like thinking of a guitar as being Abbey Road by the Beatles."

-1:-- Computers that aren't computers (Post Chris Ball)--L0--C0--February 07, 2010 02:02 AM

Flickr tag 'emacs': Digitoimiamme pienpainatteita

xmacex posted a photo:

Digitoimiamme pienpainatteita

Some material about Helsinki that we've digitized recently.

-1:-- Digitoimiamme pienpainatteita (Post xmacex (nobody@flickr.com))--L0--C0--February 06, 2010 09:04 AM

Da Zhang: hack on match-paren


I used to use a short code "match-paren" (http://grok2.tripod.com/) when I program, especially in Lisp where parentheses are everywhere. I like this piece of code, for its simplicity and usefulness: if you bind this code to something like M-[, and when you press M-[ on a "(", the cursor goes to the matching ")" automatically. This also works when mark is activated, so you can highlight the region between two matching "(" and ")" very easily. The original code is as follows:

(defun match-paren (arg)
"Go to the matching paren if on a paren."
(interactive "p")
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))))

Then sometimes I found that the code does not always work intuitively, especially when I want to highlight a region with the matching "(" and ")", so I did the following hack:
(1) when you keep hitting the key-binding, e.g., M-[, the cursor jump back and forth between its original locations, not like the original code
(2) when the mark is active, the cursor jump to the matching parenthesis and move forward one step after reaching ")" or backward one step after reaching "(", so the highlighted region contains everything between (and including) the matching "(" and ")". I found this especially useful when you want to cut a list out when programming in Lisp.

Here is my hack.

(defun da-match-paren (arg)
"Go to the matching paren if on a paren."
(interactive "p")
(cond ((and mark-active (looking-at "\\s\(")) (forward-list 1))
((and mark-active (looking-back "\\s\)")) (backward-list 1))
((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
))
(global-set-key (kbd "M-[") ‘da-match-paren)

-1:-- hack on match-paren (Post zhangda)--L0--C0--February 05, 2010 02:38 PM

Yoni Rabkin Katzenell: Spread the love with emms-lastfm-client.el

Work on emms-lastfm-client.el continues. This time on track.love, track.ban and the submissions API. This part of the Last.fm API isn't designed or specified as well as the others.

You can follow the action (read: experience various flavors of breakage) at:

$ git clone http://yrk.nfshost.com/repos/emms-yrk.git


...or just wait for me to release a working version to the Savannah Emms repository sometime in the indeterminate future.

While on the subject of music: an album getting a whole lot of play with me lately is Aghora's inenarrable Formless (I've been listening to Zeigeist lately as well, but you'll never get me to admit to that in public).
-1:-- Spread the love with emms-lastfm-client.el (Post)--L0--C0--February 05, 2010 11:25 AM

Flickr tag 'emacs': I cannot remember everything...

infion posted a photo:

I cannot remember everything...

35/365 · 4. Feb 2010
That is the cause why there are reference cards. This one helps on Emacs Org-Mode and Org-Mode helps me ;-)

-1:-- I cannot remember everything... (Post infion (nobody@flickr.com))--L0--C0--February 04, 2010 10:22 PM

Da Zhang: another way to track literature


I found using NIH or NSF grant number, such as NIH RO1-EB002123, is another good way to track a series of papers from a particular research group. Actually, the corresponding authors usually pay attention to which grants a paper should mention at the Acknowledgment part, so the papers having the same grant number are often automatically and carefully classified according to the big project they are related to. I think this is worth mentioning in my web note.

-1:-- another way to track literature (Post zhangda)--L0--C0--February 04, 2010 08:58 PM

Barry Hawkins: The Agile Business Analyst

Agile Business Analysts?

I have recently been fleshing out my thoughts on the role of business analysts in an Agile team. This is something I have historically addressed on a case-by-case basis with clients, but when thinking about it last week at a client site, I realized that I do have a general take on how the role and responsibilities of a business analyst change when a group moves to using an Agile process. Per the usual, I’ll be using Scrum as the example process where needed.

The Classical Roles

Historically the business analyst has had two primary roles. In a process where cross-functional communication and collaboration are minimized, these roles are essential. What little communication that takes place between the business and the software development teams purporting to serve them passes almost exclusively through one or more business analysts. I view the business analyst in a phased development approach as having two roles; Translator and Gatekeeper.

The Translator

The business analyst is primarily tasked with taking the needs of the business and translating them into a written document that is then handed to the software developers and testers. This role’s necessity is based upon some fundamental assumptions. First, programmers and testers are on the whole, too socially retarded to actually talk to the business persons and find out what they want. Second, the business is primarily viewed as being unable to focus its thought long enough to tell the programmers and testers what they need. Since a key value of an Agile approach to software development is to have individuals and their interactions be the driving force rather than processes an tools (see The Agile Manifesto), the obliteration of this role is a primary objective.

The Gatekeeper

Business analysts are also viewed the gatekeepers for requirements in classical, phased software process approaches. This is a somewhat unfair role, since they rarely have the authority to prevent business or technology changes, like a meter maid trying to stop an armed terrorist. It’s even more unnatural since change always happens, so it’s like the meter maid being assigned to an anti-terrorist unit with no additional training, authority, or weapons.

The Agile Roles

Some of the more extreme practitioners of Agile methodologies say that business analysts have no role in an Agile team. I disagree, provided the role of the business analyst is allowed to evolve. The roles I’ve seen them take on as valuable members of an Agile team are Facilitator, Historian, and Journalist.

The Facilitator

A high degree of collaboration and interaction take place between business and technology in Agile Software Development. The business analyst can serve a critical need in these interactions, facilitating communication between business and technology and making sure that critical areas are being covered in an interaction. This can be a more fulfilling experience for an analyst, since they often talk to one side, then go to other to pass on the information, all the while thinking, “Man, this would be simpler if you were both in the room with me at the same time.

The Historian

The business analyst’s documentation skill is excellent for capturing significant information that often gets lost in a team of purely technical people. I have seen some great uses of business analysts in this area. One is to document the system that the team actually builds (not the big, up-front imagined system that is covered in a phased design stage). Another is capturing key technological and architectural decisions and the context in which they were made, so that when a group revisits certain items asking, “Why in the world did we decide to do that?”, they have the means to be reminded or informed why a particular path was chosen.

The Journalist

The business analyst can also be the team’s journalist, making sure the latest information makes it out to all interested parties. One creative approach I’ve seen at a client site is a business analyst who has a project blog. He posts entries after each meeting between the business and technology, documenting what new user stories were created (even scans in the story cards!), a summary of the discussions held, and documents any key decisions that might have been made. Oh, and he provides an excellent executive summary at the top that’s suitable for anyone’s review, right up to the CEO. Tell me you wouldn’t love to have that guy in your Agile team.

-1:-- The Agile Business Analyst (Post Barry Hawkins)--L0--C0--February 03, 2010 01:39 PM

Tim Bielawa: Macports updates their Erlang version, update your load-path’s

I’ve been working on my XMPP server pet project recently, and the need for a good Erlang XML parser has finally struck. I decided to go with Erlsom. It’s in MacPorts, so from there I installed it. Now, since I don’t update my port tree frequently I get delightful surprises from time to time. This time installing Erlsom triggered an update of Erlang, to the latest version!

Short story shorter, the update changes the path to the erlang-mode.el file so before you can M-x erlang-mode again you’ll have you fix your Emacs load-path to register the new location. (See my older post on how to initially set up Erlang and Emacs from MacPorts from scratch)

The new load commands should be:

(setq load-path (cons  "/opt/local/lib/erlang/lib/tools-2.6.5/emacs/" load-path))
(setq erlang-root-dir "/opt/local/lib/erlang")
(setq exec-path (cons "/opt/local/bin" exec-path))
(require 'erlang-start)

It just requires changing the tools-x.x.x to 2.6.5.

p.s. about erlang-mode

-1:-- Macports updates their Erlang version, update your load-path’s (Post tbielawa)--L0--C0--February 03, 2010 05:08 AM

Matt Harrison: Baby steps....

After figuring out that I should use linum, I started the lisp code for emacs support for python code coverage from scratch. It felt a little like chaining generators. Write a small function, test it in the scratch window....

pycov

Notice the pretty red, and the *pycov* in the lower right. Code here

-1:-- Baby steps.... (Post Matt)--L0--C0--February 02, 2010 06:02 AM

Gabriel Saldaña: 3 methods on how to backup your Emacs file

<script type="text/javascript"></script> <script src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script>

Data dump by swanksalot on flickr
The emacs personalization file (dotemacs) is a very important resource for every Emacs user. Typically found at ~/.emacs, this file contains <abbrev title="Emacs Lisp">elisp</abbrev> code all the personalization of Emacs to accommodate each user. Its so important that it basically represents your Emacs “personality”.

To loose your .emacs file can mean loosing a lot of hours of tweaking and personalizing GNU Emacs through a bunch of collected-through-time snippets. So, being a very valuable asset, having a good method to back it up is a must have.

Here are 3 common methods people use to keep their Emacs file safe:

Simple backup

The most simple thing to do is to manually make copies of the file on a different directory, another partition on the same hard drive, an external hard drive, or a USB key. Also works well when having multiple computers and copying the same .emacs file on each of them. Using rsync to back it up periodically is a good idea, and it can be used to backup all your other elisp code for common modes (typically at ~/.emacs.d/) you use too.

A good option would be to back it up to an online storage service like Drop.io or even Amazon S3.

Version control

The standard and most common way to store your emacs customizations is by saving them on a file named .emacs placed on your home folder. But this is difficult to setup on a version control system since version control systems check things under directories. So this would mean you would be version controlling your whole home folder, which wouldn’t be a bad idea on some cases but on others would be a mess to maintain.

Fortunately there’s another way: at startup, Emacs also looks for a file called init.el on a hidden folder named .emacs.d/ in your home folder when the typical ~/.emacs file is not found. This way, you can easily set your preferred version control system to track changes on that folder. This has the advantage that any other Emacs modes or code you have can be stored and tracked too. This way, whenever you have a clean install, your Emacs setup and modes are just a checkout away from getting done.

On some setups, tracking changes on the whole ~/.emacs.d/ directory may not be a good option. So, to track changes on only your .emacs file can be achieved by moving your init.el file to a folder inside the home elisp directory and will look like this: ~/.emacs.d/dotemacs/init.el and make a symbolic link to it in ~/.emacs.d/ This way I can version control the “dotemacs” directory very easily.

Distributed version control

Many people use <abbrev title="Subversion">SVN</abbrev> as their preferred version control system, which backs up your data into a central location. But using a distributed version control system like Git, Mercurial or Bazaar is a better option. <abbrev title="distributed version control system">DVCS</abbrev>s let you setup multiple locations where to backup your code repository, so you don’t have a single point of failure. So you can version control your dotemacs file and back up the changes history on many places like Github, Gitorious, Launchpad or any other code hosting service, plus several other remote locations like multiple machines, a <abbrev title="network attached storage">NAS</abbrev> or external drives with complete history of your changes.

Do you know other methods? How do you keep from loosing your dotemacs file?

Data dump image by swanksalot on Flickr
Share:
  • Digg
  • del.icio.us
  • Technorati
  • Reddit
  • StumbleUpon
  • Facebook
  • Meneame
  • FriendFeed
  • Identi.ca
  • Twitter
  • Google Bookmarks

Related posts:

  1. PHP syntax check as you type with Emacs
  2. Mac OS X from a GNU/Linux User
  3. Emacs identica-mode version 0.7

-1:-- 3 methods on how to backup your Emacs file (Post Gabriel Saldaña)--L0--C0--February 01, 2010 06:17 PM

Got Emacs?: I think I should go out more

Saw this xkcd strip via reddit.  And actually felt sad over the last panel of the strip. 
I think I'm getting a bit nerdy for my own good.
Feel a bit like Melvin(Jack Nicholson) crying over the dog in As Good as It Gets.

This is not good, not good at all.

-1:-- I think I should go out more (Post sivaram (noreply@blogger.com))--L0--C0--February 01, 2010 01:49 PM

Phil Hagelberg: in which, were a title to be summarized from the content, it would be altogether too similar to many of the titles used for past articles, possibly to the point of indistinguishability

Anyone who follows my exploits will have noticed I'm a tireless proponent of ELPA, the Emacs Lisp Package Archive. As a maintainer of several Elisp libraries, ELPA makes my life easier by helping me sidestep the boring problems of distribution and installation. You may not know that package.el, the software behind ELPA, has been submitted for inclusion in the next version of Emacs. I've taken up the task of getting it ready.

museum of flight bridge

Including something like package.el into Emacs is a big job, and it's something that can only happen gradually. Emacs comes with a number of applications such as Org Mode and Gnus that are developed externally to Emacs and merged periodically into the main Emacs source tree. If they were to be redone as packages they could still be distributed with Emacs builds but kept out of the source tree. They could also be upgraded and installed/removed independently of Emacs' historically long release cycles.

If you've submitted packages to ELPA before, you know it's a process that could use some streamlining. Currently it's all done by email, and packages must be manually uploaded by a single maintainer before they appear to users. This has long been the biggest shortcoming of ELPA. I've written some additions (package-maint.el) that allow you to automate the maintenance of a package source. Basically you provide it with a list of git URLs, and it will check out each tagged version and create a package from it. Of course, that wouldn't be useful without giving clients the ability to get packages from multiple sources at once, which I also added to package.el.

If you maintain any Emacs packages of your own, please try out my changes to package.el. If you use any of my packages, try upgrading and adding my package source to your list.

(add-to-list 'package-archives
             '("technomancy" . "http://repo.technomancy.us/emacs/") t)

That way you'll get access to my updates as soon as they're tagged rather than waiting for them to be manually uploaded, though currently the latest versions of all my packages are in ELPA. Next steps are closer integration with Emacs in order to have packages installable on a system-wide level as well as a per-user level, prerelease version number support, and extraction of some built-in Emacs libraries as packages. Suggestions, bug reports, and patches welcome!

-1:-- in which, were a title to be summarized from the content, it would be altogether too similar to many of the titles used for past articles, possibly to the point of indistinguishability (Post Phil Hagelberg)--L0--C0--January 31, 2010 06:10 PM

Michael Olson: [projects] Emacs Muse 3.20 released

Emacs Muse 3.20 is now available.

Emacs Muse is an authoring and publishing environment for Emacs. It simplifies the process of writing documents and publishing them to various output formats. One of the principal aims in the development of Muse is to make it very easy to produce good-looking, standards-compliant documents.

This will be my last release as maintainer of Emacs Muse, and the project will need a new maintainer effective immediately.

Release info
Tarball
http://download.gna.org/muse-el/muse-3.20.tar.gz
Zip file
http://download.gna.org/muse-el/muse-3.20.zip
-1:-- [projects] Emacs Muse 3.20 released (Post Michael Olson (mwolson@member.fsf.org))--L0--C0--January 31, 2010 04:35 PM

Matt Keller: Announce: mk-project 1.3

I'm pleased to announce the release of version 1.3 of mk-project. It offers several new features and a bug fix.

Feature: Custom Find Commands

Mk-project uses a "find" command in several scenarios: finding files to pipe to etags (project-tags), finding files to pipe to grep (project-grep) and finding files to index (project-index, project-find-file). Until this release, the find commands used in these situations where calculated using a combination of the "basedir", "src-patterns", "ignore-patterns" and "vcs" project settings. As nice and simple as this scheme was, there was no way to customize these find commands for more complicated project structures. For example, I'm currently working on a project with a very large $basedir/thirdparty directory that I do not want to include in TAGS, grep actions or the project index. With version 1.3, I can specify custom find commands that will omit the thirdparty directory:

(project-def "big-project"
  `((basedir         "~/big-project")
    (src-patterns    ("*.java"))
    (ignore-patterns ("*.class"))
    (src-find-cmd    ,(concat "find ~/big-project \\( -path ~/big-project/thirdparty -prune \\) -o "
                              "\\( -type f -name \"*.java\" -o -print \\)"))
    (grep-find-cmd   "find . -type f | egrep -v thirdparty ")
    (index-find-cmd  (lambda (context) 
                       (concat "find ~/big-project "
                               "\\( -path ~/big-project/thirdparty -prune \\) -o -print")))
    ...))

As you can see, there are 3 new "-find-cmd" project settings. The values can be simple strings specifying a "find" command or a function of 1 argument that returns the find command. The argument will be 'src, 'grep or 'index as appropriate, which allows you to write a single function to generate all 3 find commands if you'd like.

Feature: Relative paths in TAGS files

If your tags-file is located in your basedir (directly in the basedir, not a subdirectory of basedir), the generated TAGS file will now use relative file names. This makes the TAGS file portable. For example, if you copied the basedir to a new location, you could copy the TAGS file to the new directory and it would work without modification.

Feature: Custom ack command name

You can customize the ack-command name for your system. It defaults to "ack.pl" (or "ack" on Windows systems).

Bug Fix

Fixed issue #1: project-ack does not use the "confirmed" command.

...

mk-project.el 1.3 is available from github or the Emacs Wiki.

-1:-- Announce: mk-project 1.3 (Post)--L0--C0--January 30, 2010 10:37 AM

emacspeak: AsTeR --- Audio System For Technical Readings

Almost exactly 16 years to the date after presenting AsTeR --- Audio System For Technical Readings --- to the CS Faculty at Cornell for my PhD, I released the source code as Open Source --- thanks to Prof. David Gries at Cornell for approving this release.

The sources are checked into GoogleCode project aster-math --- unfortunately, the name AsTeR was unavailable since there is an unrelated project of the same name at SourceForge.

So you might well ask: why 16 years later, and why now? The honest answer is No good reason, except that after graduating from Cornell, I decided that I would work on newer projects, and consequently had no cycles to support the AsTeR code base. Nothing has changed in that context, nor is it likely to change in the coming future; however I get requests off and on from different parts of the Web from teachers and students alike who have seen my PhD thesis, played with the demos, and wish to study the sources.

What You'll Find In The Sources

The code has not been actively developed since I finished my work at Cornell; however, over the years, I 've ensured that the system starts up and runs on Linux using the Open Source CLisp environment. The only text-to-speech engine that is supported is the hardware DECTalk --- though it should be a small matter of programming to support the various Emacspeak speech servers. If you do checkout the source code, start by looking at the README file which contains brief instructions on getting started. Feel free to use the Emacspeak mailing list for now if you wish to discuss the code --- if the traffic justifies it, we can later create a project-specific list.

-1:-- AsTeR --- Audio System For Technical Readings (Post T. V. Raman (noreply@blogger.com))--L0--C0--January 26, 2010 05:03 PM

John Sullivan: Come to anti-DRM event in SF on Wednesday 8:30am at Yerba Buena Center for the Arts

I'll be in San Francisco this Wednesday morning for the Defective By Design anti-DRM protest at Apple's launch event. We'll be out having fun handing out flyers, doing a little theater of our own, and talking to the media and people walking by about the danger DRM poses to the public's freedom and the history of Apple's support for it. We'll be focusing especially on the App Store model used on the iPhone (and possibly used on the tablet to be announced on Wednesday), which prevents users from installing any software from anywhere else.

We're starting at 8:30am (that's not our fault -- Apple is starting at 10am so people will be arriving by 9am I'm sure) outside the Yerba Buena Center for the Arts Theater. A perfect time for stopping by on the way to work :).

Here's the full background info.

If you can come out and support the effort, please let me know at info@defectivebydesign.org.

We'll be meeting up outside the Theater entrance. Stay tuned to http://identi.ca/dbd for updates. Hope to see you there, and bring some friends!

-1:-- Come to anti-DRM event in SF on Wednesday 8:30am at Yerba Buena Center for the Arts (Post)--L0--C0--January 25, 2010 09:52 PM

Alex Bennée: Finally public

After much faffing about with repeated sending of faxes to multiple numbers I finally proved I was human and accountable enough for “Edit with Emacs” to appear on the Chrome Extension Gallery. This almost immediately showed up some documentation and usage usability issues so I spent some of my spare time at the weekend creating an options page. I’ve also got a growing number of feature branches coming in from other github users so I merged some more contributions into the v1.4 release.

I have to say the usage of git as an SCM tool as well as github’s non-fussy functional website makes managing contributions a lot easier. It’s nice to see the world has moved on since the venerable SourceForge was the only option for those who didn’t want to bother maintaining their own project infrastructure.

One of the feature branches being proposed is changing the interface to the “Edit Server” to pass a richer set of information about the text area being edited. This would allow the server to do clever things like position the frame near the position of the text area on the browser and possibly manipulate fonts. So far I’m trying to keep the current edit server calling conventions similar to those offered by other similar extensions that need to do a similar thing. Although for Emacs users edit-server.el will surely be the default and most used method it seems churlish to break compatibility for those that prefer to run/hack other servers. I’ve been documenting the URL conventions so it would be nice if I got some feedback how to maintain a useful extensible “API” for the broadest range of solutions.

-1:-- Finally public (Post Alex)--L0--C0--January 25, 2010 12:41 PM

Yoni Rabkin Katzenell: Recent Favorites

Here are two GNU/Emacs tools which have been starring recently at work. Blogging about them will provide me with a short respite from said work:

All of my new workfiles are getting ";;; -*- show-trailing-whitespace: t -*-" at the top. Not only does this keep an eye on trailing whitespace (enemy of diffs and the ill-begotten child of split-lines) but it has an additional beneficial side effect: When I open a new line and realize I need to tweak something nearby before continuing, show-trailing-whitespace will automatically leave a hard-to-miss red strip at the new line's position as I leave it. This makes tracking back to that point very easy. As a corollary, I typically perform bigger jumps within the same file either by point-to-register aka C-x r SPC coupled with register-to-point, or I split the buffer with split-window-vertically aka C-x 2.

The second is good old M-x rgrep. For example, to figure out if I've ever blogged here about whitespace I went to my on-disk copy of this blog and fired off M-x rgrep RET whitespace RET .... I find it fast enough to obviate having a search engine indexing things on my machine (*).

* It helps that I code, which means that all of the interesting stuff on my computer is nothing fancier than UTF-8 encoded text. If I dealt primarily in PDFs, ODFs and the like things would be different.
-1:-- Recent Favorites (Post)--L0--C0--January 23, 2010 07:38 PM

Anupam Sengupta: Quickly diff the changes made in the current buffer with its file


Update (23rd Jan 2010): Separated the key-assignment and  function definition.

A simple function to quickly do a diff of the current buffer contents with its underlying file. Very useful if the file has been changed outside (e.g., a log file).

;; Diff the current buffer with the file contents
(defun my-diff-current-buffer-with-disk ()
 "Compare the current buffer with it's disk file."
 (interactive)
 (diff-buffer-with-file (current-buffer)))
(global-set-key (kbd "C-c w") 'my-diff-current-buffer-with-disk)
-1:-- Quickly diff the changes made in the current buffer with its file (Post evolve75)--L0--C0--January 23, 2010 05:24 PM

Thomas Kappler: A simple Markdown journal in Emacs


I wanted to get into daily journaling since a long time. Keeping a journal makes it easy to find and go back to all kinds of things you have encountered and thus saves time. But more important is, I believe, that journaling structures your thoughts, like any kind of writing. You need to think clearly about something before you can write it down. Then, the act of writing it down anchors it more deeply in your memory.

Alas, all my previous attempts at journaling failed. Whatever the reason, whether on paper or on the computer, I never felt entirely at home with the solutions I tried. So what’s a hacker to do – write his own solution.

I know that there are already many ways to write a journal in Emacs. Well, here’s another one: simple-journal. It’s tiny and simple, it produces a Markdown format that I love, and having it written myself I feel more inclined to actually use it.

The journal looks like this:

### 2010-01-10

- **18:15** - "XML serializations should be hidden away from
  human view lest small children accidentally see them and become
  frightened." - from the paper *Representing disjunction and
  quantifiers in RDF*, McDermottDou02.pdf.

### 2010-01-17

- **14:45** - Set up a minimal Wicket application with Netbeans (a
  first for me, version 6.8) and Jetty. I want to try out working
  asynchronously with JSON using Wicket. Here are the steps to get the
  application running, serving up an empty page:

  - Start a plain Java SE project in Netbeans.
  - ... 

Being in Markdown, it’s very readable, and can readily be converted to well-formatted HTML. The format is completely hard-coded in the code for the moment. The goal was just to quickly get something simple and small working. Nevertheless, I’m always happy about feedback and ideas.

There’s one item on the TODO list that I’d really like to have, but I’m wondering about how to implement it a somewhat simple and efficient way: showing all entries that have “TODO” in them, or that start with “TODO”. Do I have to go through the buffer to collect them and show them in a temporary buffer? That would be a bit more programming than I feel is appropriate for such a task, and the temp buffer wouldn’t be in sync with the journal. Planet Emacs, ideas? ;-)

Posted in Own Code Tagged: emacs, journal, markdown, Own Code, programming
-1:-- A simple Markdown journal in Emacs (Post thomas11)--L0--C0--January 23, 2010 11:56 AM

John Sullivan: Emacs installed on the N900

I finally got around to installing GNU Emacs on my Nokia N900.

The instructions and package there worked for me. I did not find it necessary to do the maximization fix -- after turning off the tool bar, the minibuffer was visible for me.

Remapping the keyboard using the file provided does seem to cause some problems. The function key is no longer sticky, so I have to hold it down along with the letter key to get a number. That's not so possible when trying to type the number 1. Will have to look into that.

Now, to get Planner mode working well on it.

And yes, I will be trying out reading my mail using Gnus on it.

-1:-- Emacs installed on the N900 (Post)--L0--C0--January 22, 2010 07:29 AM

Emacs-fu: duplicating lines and commenting them

Someone on the Emacs Help mailing list asked for an easy way to duplicate a line
and, optionally, comment-out the first one.

Let's first look at simple duplication of a line. This is a common operation,
and vi-users might use something like Yp for that. In emacs, one way to do
this is by typing C-a C-k C-k C-y C-y, which is actually not as bizarre as
it looks if you try it. When using slick copy, as explained in another post,
it's as easy as M-w C-n C-y; and of course it's easy to define a shorter key
binding.

repeat after me
repeat after me

However, neither of these methods works correctly when you're on the last line
of the buffer (by default at least). Also, it puts the point (cursor) below
the duplicated line, while I'd like to put it at the start of it. It seems we
need something a little smarter.

While we're at it, let's also consider the second question: commenting-out the
first line of the duplicates. This is a quite common thing to do when writing
programs or configuration files; you want to try the effect of a small
variation of a line, but want to keep the original so it can be restored when
the variation turns out not to be as good as expected.

/* for (;;) fork (); */
for (;;) fork ();

I hacked up something quickly to solve both questions, and it has evolved a
little bit since – to answer both of the questions. The bit of weirdness in
the end is because of the special case of the last line in a buffer. It
defines key bindings C-c y for duplicating a line, and C-c c for
duplicating + commenting – but of course you can change those.

(defun djcb-duplicate-line (&optional commentfirst)
  "comment line at point; if COMMENTFIRST is non-nil, comment the original" 
  (interactive)
  (beginning-of-line)
  (push-mark)
  (end-of-line)
  (let ((str (buffer-substring (region-beginning) (region-end))))
    (when commentfirst
    (comment-region (region-beginning) (region-end)))
    (insert-string
      (concat (if (= 0 (forward-line 1)) "" "\n") str "\n"))
    (forward-line -1)))

;; or choose some better bindings....

;; duplicate a line
(global-set-key (kbd "C-c y") 'djcb-duplicate-line)

;; duplicate a line and comment the first
(global-set-key (kbd "C-c c") (lambda()(interactive)(djcb-duplicate-line t)))
-1:-- duplicating lines and commenting them (Post djcb (noreply@blogger.com))--L0--C0--January 21, 2010 10:18 PM

Alex Ott: one more additions to article about emacs + vcs

Two new parts was added - about Emacs + Aegis and Emacs + Visual Source Safe
-1:-- one more additions to article about emacs + vcs (Post Alex Ott (alexott@gmail.com))--L0--C0--January 21, 2010 09:34 AM

Alex Ott: Article about Emacs and Version Control Systems (finish)

Just finished translation and uploaded latest three parts of my article about using Emacs for work with Version Control Systems (VCS). This are parts about work with VC, ClearCase & Perforce.
The content of article match start of 2007, so next big thing, that I'll do is updating content to modern state - add information about emacs-git and aHg packages, update information about other packages.
-1:-- Article about Emacs and Version Control Systems (finish) (Post Alex Ott (alexott@gmail.com))--L0--C0--January 21, 2010 09:34 AM

Emacs Life: py




oh. my. god. i just learned about pymacs, which allows two-way communication between Emacs Lisp and Python. I'm moving from Ruby to Python, and this sound spectacular.

IPythonEmacs23
ipython.el
Anyone using ipython.el?
PythonMode at the EmacsWiki
iPython
How do I use IPython as my emacs python interpreter
emacs 23 and iPython
IPython can integrate with Emacs



-1:-- py (Post sness (noreply@blogger.com))--L0--C0--January 20, 2010 05:28 PM

Anupam Sengupta: Emacs function to add new path elements to the $PATH environment variable


A very simple eLisp function to add new path elements to the PATH environment variable. Very useful for adding new comint executables from within .emacs/init.el files.

(defun my-add-path (path-element)
 "Add the specified path element to the Emacs PATH"
  (interactive "DEnter directory to be added to path: ")
  (if (file-directory-p path-element)
    (setenv "PATH"
       (concat (expand-file-name path-element)
               path-separator (getenv "PATH")))))
-1:-- Emacs function to add new path elements to the $PATH environment variable (Post evolve75)--L0--C0--January 19, 2010 05:09 PM