Home

yrk

Recent Entries

You are viewing the most recent 20 entries

July 7th, 2009

09:44 pm: Numbered Releases, what are they good for?
Twice now I've been asked on #emacs if a new release of Emms is up and coming, stating that the last release has been a few years ago.

Free software projects use release numbers when appropriate while others forgo them completely. I think that Emms should stick with smooth, incremental releases through a network of distributed repositories.

Tags:

July 3rd, 2009

09:24 pm: Make time, not nil
Instead of nuking my initial-scratch-message to nil: (setq initial-scratch-message
(format ";; scratch buffer created %s\n;; happy hacking\n\n"
(format-time-string "%Y-%m-%d at %T")))


Tags:

June 28th, 2009

12:45 am: Potential vs. kinetic interest
Here is a potentially interesting article about "... allowing Emacs Lisp and R4RS Scheme to share data structures".

Interest is a conservative force, so you'll get all of the potential interesting-ness of the article as kinetic interesting-ness (minus the friction) if you read it (I haven't yet).

June 24th, 2009

12:54 pm: No emacs-ditz and some hardware hacks
I tried out emacs-ditz, but decided to ditch it before giving it a chance. The command-line interface to ditz is so spartan that adding an Emacs interface seems at best superfluous and at worst baroque. This is of course in praise of ditz.


I built myself the Polyvinyl-chloride do-it-yourself laptop stand. I had originally seen it on lifehacker. I've added 8 non-slip surfaces to the contact points with the table and laptop as little leather squares from an old belt stuck in place with contact cement.


Orr and I made pasta with our new pasta machine. I used some generic pasta flour mixed with buckwheat flour. Making it was fun (2 year old + flour + water == happy 2 year old) but the results weren't amazingly tasty, just kind of OK. I'll try to get some semolina flour for the next try.

June 19th, 2009

11:46 pm: Trying out Ditz
I need an intermediate bug tracking system so I've just installed Ditz; a command-line driven bug tracking system written in Ruby. Ditz keeps (or can keep) its data local and human readable so that it would be possible to add the bug tracking data itself to the revision control of the project.

I cloned the Ditz Gitorious repo but got a /usr/lib/ruby/1.8/yaml.rb:143:in `initialize': No such file or directory - ./.ditz-plugins (Errno::ENOENT) on trying to run it in a project directory. I solved the problem by copying .ditz-plugins from the repo directory to the project directory. I have no idea if I was supposed to do that.

I have a release to do in about a week and will be putting Ditz through its paces during that time. If it works out I'll step up and check the Ditz Emacs interface.

June 12th, 2009

08:38 pm: Enriching GNU/Emacs when shaving yaks
Emms Last.fm streaming audio support seems broken. I like Last.fm and decided to fix it. Then I came across the API Terms of Service and wondered if it is at all possible to distribute free software under the terms of the GPL which satisfies both the GPL and the Last.fm API Terms of Service.

So I copied the Last.fm API Terms of Service over to a text file in GNU/Emacs and decided to annotate the file as I read it. I've never done this. Usually I write code which gets compiled for display somewhere else, not inside GNU/Emacs, like Latex or HTML. I'm generally uncomfortable with tarting up text outside of outline mode in GNU/Emacs.

So I opened the file and added a -*- text -*- header, followed by invoking M-x enriched-mode and saving the file. The result was that GNU/Emacs saved the file with an added Content-Type: text/enriched at the start (you can't see this header unless you visit the file with M-x find-file-literally). Now I can do stuff like use M-o o to apply an arbitrary face to an area of text which I intent to use to make my annotations stand out.

As an addendum, if anyone wants to help out making sense Last.fm API Terms of Service in regards to the GPL feel free to contact me. It will be a boring, thankless job.

June 11th, 2009

12:45 am: 'nuff said
.git/info/exclude should always have a *.fasl line.

June 6th, 2009

11:13 pm: Apropos of Absolutely Nothing
The fast and primordial bits of GNU/Emacs are written in C. As an aside, C remains one of my favorite languages and I'm sorry not to be able to write in it for a living (or as one of my personal projects). Looking at the C source of GNU/Emacs helps me understand its behavior. For example, the while function is defined in eval.c. Its important bits look like this:

test = Fcar (args);
body = Fcdr (args);
while (!NILP (Feval (test)))
  {
    QUIT;
    Fprogn (body);
  }


You'll immediately understand the code, and wonder what QUIT does. QUIT is how GNU/Emacs handles interrupting the loop. Here is the comment from the QUIT macro defined in lisp.h.

/* Check quit-flag and quit if it is non-nil.
   Typing C-g does not directly cause a quit; it only sets Vquit_flag.
   So the program needs to do QUIT at times when it is safe to quit.
   Every loop that might run for a long time or might not exit
   ought to do QUIT at least once, at a safe place.
   Unless that is impossible, of course.
   But it is very desirable to avoid creating loops where QUIT is impossible.

   Exception: if you set immediate_quit to nonzero,
   then the handler that responds to the C-g does the quit itself.
   This is a good thing to do around a loop that has no side effects
   and (in particular) cannot call arbitrary Lisp code.  */


As a digression from the above digression: I don't need to switch Caps Lock and Ctrl in GNU/Emacs because I more often than not press Ctrl with the part of the palm directly below the little finger of my left hand. This is made possible by my marvelous IBM Model M keyboard.

Tags:

May 31st, 2009

11:57 pm: magit and ignorance
My absolutely favorite magit key-binding of the day: C-u i, which runs magit-ignore-item with a prompt.

Tags:

May 27th, 2009

10:11 pm: rt-liberation update: rt-liberation-update
I've just added rt-liberation-update.el to rt-liberation. It provides the function rt-liber-update. Here is its manual entry:

`rt-liber-update' is an interactive function which runs a query against the RT server asking for the tickets which have been updated since the time `rt-liber-update' was last run (each time it runs, it leaves a time-stamp). If no time-stamp is found, for instance when you run `rt-liber-update' for the first time, today's date is used. With the NO-UPDATE prefix, `rt-liber-update' will not update the time-stamp so that the next invocation will produce the same result.

It is supposed to mimic and automate the kind of queries I run every day to keep up. Time will tell if it is of any use.

git clone http://yrk.nfshost.com/repos/rt-liberation

Tags:

May 26th, 2009

12:13 pm: Montezuma release on the horizon
I've sent in a regression test for that nasty bug in montezuma. As a result, we can expect a 0.1.3 release very soon.

update:...aaaand it's out.

May 25th, 2009

07:04 pm: Let it be written
For the record, I think that a great hack would be to modify Google Maps so that zooming into BenoƮt Mandelbrot's house would show infinite smaller houses which can be zoomed into, indefinitely.

06:51 pm: Gitorious FTW
gitorious is a git hosting service whose source code is available under the terms of the GNU Affero General Public License. I'll be branching some of my Darcs code over there, starting with wireless.el.

09:51 am: Rock-a-box
My father asked me to install Rockbox on his old 4th generation Apple Ipod. I was almost disappointed by how easy it was. I just downloaded the nice GUI installer and clicked "install", no hacking needed.

May 24th, 2009

10:32 pm: you know what you doing...download every pretest...for great justice
A new GNU/Emacs pretest is available. Grab it at http://alpha.gnu.org/gnu/emacs/pretest/emacs-23.0.94.tar.gz.

P.S. Concerning the title of the post: I'm one of those

May 21st, 2009

12:43 am: gnus-dired-mode
I can't believe I haven't been using this up until now. Turns out you can do (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode), and then use:

C-c C-m C-a
"Send dired's marked files as an attachment (`gnus-dired-attach'). You
will be prompted for a message buffer."

Tags:

May 18th, 2009

08:45 pm: Getting attached isn't so bad
After forgetting to actually attach and attachment today in an email (for the millionth time) and blaming it on unpredictable quantum mechanical phenomena (first time) I've added the following to my .gnus (courtesy of http://www.emacswiki.org/emacs/GnusAttachmentReminder):

(defvar my-message-attachment-regexp "\\([Ww]e send\\|[Ii] send\\|attach\\)")
(defun my-message-check-attachment nil
  "Check if there is an attachment in the message if I claim it."
  (save-excursion
    (message-goto-body)
    (when (search-forward-regexp my-message-attachment-regexp nil t nil)
      (message-goto-body)
      (unless (or (search-forward "<#part" nil t nil)
                  (message-y-or-n-p
		   "No attachment. Send the message ?" nil nil))
        (error "No message sent")))))
(add-hook 'message-send-hook 'my-message-check-attachment)



Tags:

May 16th, 2009

08:46 am: MOD shuffle
I'm writing a regression test for a Montezuma bug and I need some nicely distributed data to imitate a real corpus. The Moses-Oakford-Durstenfeld shuffle is a simple way to create a random permutation of a sequence. (Algorithm P, section 3.4.2.,pg. 125 TAOCP Vol. 2.). As usual Common Lisp provides a succinct way to express it:

(defun mod-shuffle (l)
  (loop for j from (1- (length l)) above 0 do
       (rotatef (nth (random (length l)) l) (nth j l))))


The same algorithm isn't nearly as nice in Emacs Lisp (not to mention slow because it will be constantly iterating over lists):

(defun mod-shuffle (l)
  (let ((j (length l)))
    (while (> (setq j (1- j)) 0)
      (let ((k (random j))
	    (xj (nth j l)))
	(setcar (nthcdr j l) (nth k l)) ; x_{j} <- x_{k}
	(setcar (nthcdr k l) xj)        ; x_{k} <- x_{j}
	))))


One of the reasons being that we need to be able to shuffle pointers to objects and not just numbers:

(let ((l (list 5 '(foo) ?a ?b ?c ?d ?e ?f)))
  (mod-shuffle l)
  l)
==> (97 5 100 (foo) 98 102 99 101)


I bet that like CL the algorithm can be written in one or two lines of Python as well.

May 15th, 2009

07:28 pm: Israeli wine alert
The Shfeyah 2005 Cabernet Sauvignon Merlot is a steal at 85 NIS. Drop a kilo-shekel and get a box.

May 13th, 2009

07:29 pm: Halted Read
I couldn't even finish "HaltinG StatE" by Charles Stross. I'm a big fan of his Bob Howard novels (sorry Muli, I'll return your Jennifer Morgue soon I promise!) but I enjoyed about two pages out of the entire novel and ended up skipping the end.

I didn't connect with the "first person shooter" writing style and I don't play MMORPGs. I think the book was written for someone else.

Powered by LiveJournal.com