tag:blogger.com,1999:blog-126420202024-03-06T08:52:15.897+00:00readme<p>A blog. There's nothing to set it apart from the others out there, except this one's mine.</p>
<p>I'm a lecturer at Coventry University. I read, listen to music, make <a href="http://dis-dot-dat.net/index.cgi?item=music/">noise</a> and <a href="http://dis-dot-dat.net/index.cgi?item=code/">write code</a>.
<p>Hey, why not <a href="http://www.amazon.co.uk/Python-Rookies-Sarah-Mount/dp/1844807010/ref=sr_1_1?ie=UTF8&s=books&qid=1231022688&sr=8-1">buy my book</a>?</p></p>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.comBlogger189125tag:blogger.com,1999:blog-12642020.post-65502584404994022332012-03-28T23:13:00.001+00:002012-03-28T23:13:33.128+00:00Batman and the evil witch<div dir="ltr" style="text-align: left;" trbidi="on">
(Dream from 27/3/12)<div>
<br /></div>
<div>
I was working for a bland company doing something vague.</div>
<div>
<br /></div>
<div>
One day, everyone from my office was sent to a martial arts class on the other side of the city of alleyways we lived and worked in. The dojo was in a little square and opposite was a house.</div>
<div>
<br /></div>
<div>
From the house, we heard strange noises. The martial arts teacher and the rest of us looked through the window to see ...</div>
<div>
<br /></div>
<div>
(the back-story just arrived in my head at this point - years ago an evil and very powerful witch was hanged, but one of her followers stored her soul in a lump of play-dough)</div>
<div>
<br /></div>
<div>
... someone putting a play-dough hat on a cat. The cat grew and turned into a woman - the most powerful and evil witch in the world!</div>
<div>
<br /></div>
<div>
She saw us, so we all ran back through the alleyways to our office. The martial arts instructor came, too.</div>
<div>
<br /></div>
<div>
We had a sort of war council going. Nobody was likely to believe us and we were sure the witch would want to get rid of witnesses, so we decided we were responsible for saving the world. Except we were useless. At this point, big birds in huge flocks started flying around the office block. I mean really huge birds. Pigeons as big as a man. </div>
<div>
<br /></div>
<div>
The martial arts instructor, an elderly and pleasant guy, announced that he was actually Batman although he retired a long time ago. We all cheered, because, well, BATMAN! We had Batman on our side!</div>
<div>
<br /></div>
<div>
Then he pointed to me and said "And he was Robin!" I wasn't Robin. Ever. Turns out he was just a confused old man that had wandered into the dojo as we arrived.</div>
<div>
<br /></div>
<div>
<br /></div>
</div>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-62091264852658974232012-03-28T22:58:00.001+00:002012-03-28T23:00:12.588+00:00Buy me a dreamcatcher!<div dir="ltr" style="text-align: left;" trbidi="on">
I want to write about my dreams. Just to be clear: I don't think they predict anything, mean much that's useful or represent some alternative mode of consciousness. They've just been AWESOME lately.<br />
<br />
This post is about the dream from two nights ago.
It began with me trying to rinse my face in my bathroom basin. This was awkward because the bathroom cabinet was floating over it. Where the shadow of the cabinet fell on the basin, it left dirty black marks. This washed away leaving a message I can't quite remember. The water turned black.<br />
<br />
A colleague of mine had stuffed a towel down the loo, too. I won't name him.<br />
<br />
I was in a rush because I needed to get on an aeroplane to Hong Kong and be back before my lecture in our new Faculty building.<br />
<br />
When I got to the lecture, Alexei Sayle was in charge of progressing the slides. The slides were painted on large glass sheets. Alexei smashed each one as it was finished with, to reveal the one behind. Just smashed them angrily with his fist.
The room was like a sports hall and L shaped. People wandered through and I had to shout over the experimental jazz being played over the PA system and the people that kept singing as they walked through the middle of the class. At one point, I climbed on to a concrete art installation to try and get the attention of the class, who were scattered all around the huge room.<br />
<br />
In spite of all of this, I was having a lot of fun.</div>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-68981903197280787732012-02-24T15:27:00.000+00:002012-02-24T15:27:32.597+00:00Tabbing through fields in wanderlust<style type="text/css">
<!--
pre {
color: #ccbf99;
background-color: #222222;
}
.comment {
/* font-lock-comment-face */
color: #c29fab;
}
.comment-delimiter {
/* font-lock-comment-delimiter-face */
color: #c29fab;
}
.doc {
/* font-lock-doc-face */
color: #68e3d3;
}
.function-name {
/* font-lock-function-name-face */
color: #e28c33;
}
.keyword {
/* font-lock-keyword-face */
color: #a3bfd6;
font-weight: bold;
}
.string {
/* font-lock-string-face */
color: #68e3d3;
}
.type {
/* font-lock-type-face */
color: #c4d655;
text-decoration: underline;
}
-->
</style>
<div dir="ltr" style="text-align: left;" trbidi="on">
I sometimes automatically press TAB, expecting to move from the To: field to the right place on the next line (the subject: field) to start typing. Or from there a few lines down to where my e-mail should start. The problem is, I have TAB bound to yas/expand, which falls back to the function wl-draft-mode usually has bound to tab for other completion and possibly even inserting a tab. I think I've written the least intrusive bit of code to sit between these two and do what I want when TAB is pressed on the field lines.<br />
<br />
<br /></div>
<pre>
(add-hook
'wl-draft-mode-hook
'(<span class="keyword">lambda</span> ()
<span class="comment-delimiter">;; </span><span class="comment">Key bindings
</span>
(yas/minor-mode)
(setq yas/fallback-behavior
'(apply jks-draft-magic-tab))
))
<span class="comment-delimiter">;</span><span class="comment">This function came from: http://snarfed.org/emacs_lisp_for_flowed_text_email
</span>(<span class="keyword">defun</span> <span class="function-name">starts-with</span> (string prefix)
(and (>= (length string) (length prefix))
(equal prefix (substring string 0 (length prefix)))))
(<span class="keyword">defun</span> <span class="function-name">jks-draft-magic-tab</span> (<span class="type">&optional</span> start-pos)
<span class="doc">"Try do something sensible in wl-draft-mode under various
circumstances when tab is pressed"</span>
(interactive)
(<span class="keyword">let*</span> ((orig (thing-at-point 'line))
(typed (downcase orig)))
(<span class="keyword">cond</span> ((or (starts-with typed <span class="string">"to:"</span>) (starts-with typed <span class="string">"cc:"</span>) (starts-with typed <span class="string">"bcc:"</span>))
(search-forward <span class="string">"ect: "</span>))
((starts-with typed <span class="string">"subject:"</span>)
(search-forward <span class="string">"--text follows this line--\n"</span>))
(t (wl-complete-field-body-or-tab))))
)
</pre>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com1tag:blogger.com,1999:blog-12642020.post-27536235976423919092011-11-01T13:16:00.003+00:002011-11-01T13:18:16.179+00:00Capturing links and tasks from a browser using Emacs/OrgThis: <a href="http://orgmode.org/worg/org-contrib/org-protocol.html">http://orgmode.org/worg/org-contrib/org-protocol.html </a><br />
<br />
Plus this:<a href="http://permalink.gmane.org/gmane.emacs.orgmode/34060"> http://permalink.gmane.org/gmane.emacs.orgmode/34060 </a><br />
<br />
:)Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-82282115093994274632011-03-20T13:28:00.000+00:002011-03-20T13:29:04.003+00:00Sunday playlist<object width="250" height="400"><br /><param name="movie" value="http://listen.grooveshark.com/widget.swf" /><br /><param name="wmode" value="window" /><br /><param name="allowScriptAccess" value="always" /><br /><param name="flashvars" value="hostname=cowbell.grooveshark.com&playlistID=50637854&style=metal&p=0" /><br /><embed src="http://listen.grooveshark.com/widget.swf" type="application/x-shockwave-flash" width="250" height="400"<br />flashvars="hostname=cowbell.grooveshark.com&playlistID=50637854&style=metal&p=0" allowScriptAccess="always" wmode="window" /><br /></object>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-45493895963822149182010-08-22T22:03:00.001+00:002010-08-22T22:05:06.490+00:00Prayer in school<p>I recently read <a href="http://www.johannhari.com/2010/08/10/the-slow-whiny-death-of-british-christianity">The Slow, Whiny Death of British Christianity</a> byJohann Hari. There are a lot of issues discussed briefly in thearticle, but the one that really shocked me was the legal requirementfor prayer in schools.</p> <p> A few searches later and this is what I find: <a href="http://www.opsi.gov.uk/acts/acts1998/ukpga_19980031_en_7#pt2-ch6">School Standards and Framework Act 1998 (c. 31)</a> </p> <p> The key section is this one:</p> <ul> <li> 70. Requirements relating to collective worship<ol> <li> Subject to section 71, each pupil in attendance at acommunity, foundation or voluntary school shall on each schoolday take part in an act of collective worship.</li> <li> Subject to section 71, in relation to any community,foundation or voluntary school <ul> <li> the local education authority and the governing bodyshall exercise their functions with a view to securing,and</li> <li> the head teacher shall secure,that subsection (1) is complied with.</li> </ul> </li> <li> Schedule 20 makes further provision with respect to thecollective worship required by this section, includingprovision relating to- <ul> <li> the arrangements which are to be made in connection withsuch worship, and </li> <li> the nature of such worship. </li> </ul> </li> </ol> </li> </ul> <p>Section 71 goes on to explain that to be exempt from collectiveworship, the parents of a child have to request that it happens.</p> <p> This seems ridiculous. I personally feel that this is an assault onchildren - young impressionable minds being systematically given, asfact, a bunch of fairy tales by the most authoritative adults thechild has met yet. Is it any wonder they grow up playing the lottery,allowing money to be wasted on homoeopathy (<a href="http://www.nhs.uk/news/2010/July07/Pages/nhs-homeopathy.aspx">Homeopathy remains on NHS</a>)and taking advice from the likes of Mystic Meg? </p> <p> It's not that clear-cut for everyone, though.</p> <p> A colleague told me about <a href="http://www.channel4.com/programmes/faith-school-menace/episode-guide/series-1/episode-1">Faith School Menace?</a> (watch it on 4OD quickbefore it's gone), a program on More4 last week in which RichardDawkins presents his arguments against faith schools. This is aslightly different subject, but there was a sentiment that came upmore than once in the programme and has come up while I've beendiscussing this topic with my family. It goes something like this: ifkids don't get to experience faith, how will they make a balancedjudgement when they grow up?</p> <p> And this is where I hit a barrier. I can't understand the idea thatpeople should be allowed to "choose to believe" at the expense oftheir ability to tell truth from fiction. </p> <p> So I can only think about religion - not faith. I don't really knowwhat people mean by "faith". They can't mean what I think it means,because surely they'd want to get rid of it. </p> <p> If there is a god, it's possibly reasonable behaviour to worship him.If you look at the world and it seems to point to the existence of agod, well OK. I don't see it myself, but go ahead and pray. Theimportant thing is that you made a decision based on the evidence youhad.</p> <p> The problem is that someone who has been brought up being told,regularly, that there is a god has a big disadvantage when it comes totheir own personal calculation on the probability of the existence ofa supreme being. The mind that is doing the analysis has beenconditioned to at least consider the magical hypothesis.</p> <p> This, I think, is why so many atheists need proof of the non-existenceof god - discrepancies between the bible and real evidence, forexample. Most people have some kind of religion as default and ittakes some energy to get out of it.</p> <p> And we can't pretend that we're a devoutly Christian country in,either. Here's some data from an <a href="http://www.ipsos-mori.com/researchpublications/researcharchive/poll.aspx?oItemId=190">Ipsos MORI poll in 2007</a>. Thequestion asked "If you had to choose just one of the statements whichone best matches your view?"</p> <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <caption></caption> <colgroup><col align="left" /><col align="right" /> </colgroup> <tbody> <tr><td></td><td>%</td></tr> <tr><td>Scientific and other evidence provides the best way to understand the universe</td><td>62</td></tr> <tr><td>Religious beliefs are needed for a complete understanding of the universe</td><td>22</td></tr> <tr><td>Neither of these</td><td>10</td></tr> <tr><td>Don't Know</td><td>6</td></tr> </tbody> </table> <p> So, most of the country pick science over religion for explaining theworld. And from the same survey, 42% of people think the governmentpays too much attention to religious groups and leaders. </p> <p> <a href="http://www.secularism.org.uk/only38ofbritonsbelieveingod.html">Only 38% of Britons believe in God</a> yet nearly every child is supposedto be told that they <i>should</i>.</p> <p> I'm just thankful that schools aren't dong too well at meeting the requirement. From an <a href="http://www.archive2.official-documents.co.uk/document/deps/ofsted/170/05-secondary.html">Ofsted secondry schol report 2002/3 </a> </p> <ul> <li> "138: Governing bodies are effective in fulfilling theirresponsibilities in two thirds of schools. This is reflected intheir contribution to shaping the direction of the school andtheir understanding of its strengths and weaknesses. A third ofgoverning bodies do not fulfil their statutory duties adequately,sometimes because of a failure to pursue thoroughly enough suchmatters as arranging a daily act of collective worship." </li> <li> "141: Compliance with statutory requirements relating to thecurriculum has improved, but in over two fifths of schools thisremains unsatisfactory. Examples of non-compliance include failureto implement parts of the National Curriculum programmes of study,or provide religious education for all pupils. Four fifths ofschools do not hold a daily act of collective worship for allpupils." </li> </ul> <p>So we have a rule that says we should tell kids something most of usdon't believe and don't believe is useful and we don't actually obeythe rule anyway.</p> <p> Maye we should fix that?</p>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com2tag:blogger.com,1999:blog-12642020.post-70462741151532623082010-07-21T18:22:00.002+00:002010-07-21T18:24:50.918+00:00People aren't that mean after allThe "pay what you want" scheme sells well, but with low average price. Fixed price with charity donation has little effect. But "pay what you like" with 50% going to charity works really well: <a href="http://blogs.discovermagazine.com/notrocketscience/2010/07/15/caring-with-cash-or-how-radiohead-could-have-made-more-money/">http://blogs.discovermagazine.com/notrocketscience/2010/07/15/caring-with-cash-or-how-radiohead-could-have-made-more-money/</a>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-8929382543395235022010-07-19T22:59:00.001+00:002010-07-19T22:59:50.091+00:00New org-mode first impression <div xmlns='http://www.w3.org/1999/xhtml'> <p>OK, I've got my pop-up org-remember, oops, org-capture working again. I'm also using the new feature that allows me to drop items into a table. This is just perfect. I use an org file containing a table of numbered files in my cabinet. Combine that with a couple of local evals in the header that deals with magically incremental numbering and I'm a filing ninja.</p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com1tag:blogger.com,1999:blog-12642020.post-13905256527636257152010-07-19T20:55:00.002+00:002010-07-19T21:00:25.812+00:00New org! Remember mode out, org-capture in.<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbNSveOWbBNmQj3arPQD8g3bDlW-0Zei6_AQCsASvarRT97EPYm4nbdOYO8Gwjd-J304bYDq3Zv-i6eGHpd6JcsGqEeQ-HtwFf95C5iQxhJmgUNXFD3DryA-28ZL8DchSwkaf7/s1600/neworg.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 180px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbNSveOWbBNmQj3arPQD8g3bDlW-0Zei6_AQCsASvarRT97EPYm4nbdOYO8Gwjd-J304bYDq3Zv-i6eGHpd6JcsGqEeQ-HtwFf95C5iQxhJmgUNXFD3DryA-28ZL8DchSwkaf7/s320/neworg.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5495724737204880034" /></a><br /> <div xmlns='http://www.w3.org/1999/xhtml'> <p>Yup. New org. Babel is integrated, org-capture replaces remember. It can show symbols in-line nicely. Happy day!</p> </div> <a href="http://orgmode.org/Changes.html#v7.01">See here</a>. And don't forget to use org-track to make it all nice and easy.Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-63199890371924301872010-06-24T16:22:00.001+00:002010-06-24T16:22:41.523+00:00Mind blown <div xmlns='http://www.w3.org/1999/xhtml'> <p>http://www.ymacs.org/demo/</p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-42041214454198711812010-05-24T11:32:00.003+00:002010-05-24T11:36:24.773+00:00Pop-up emacs twitter posting<p>Mostly just taken from the remember-mode popup, but here it is: </p><br /><pre class="code">(add-hook 'twitter-status-edit-mode-hook <br /> 'delete-other-windows)<br /><br />(defadvice twitter-kill-status-buffer (after delete-twitter-frame activate) <br /> "Advise to close the frame if it is the twitter frame" <br /> (if (equal "twitter" (frame-parameter nil 'name)) <br /> (delete-frame)))<br /><br />(defadvice twitter-status-post (after delete-twitter-frame activate) <br /> "Advise to close the frame if it is the twitter frame" <br /> (if (equal "twitter" (frame-parameter nil 'name)) <br /> (delete-frame)))<br /><br />(defun make-twitter-frame () <br /> "Create a new frame and run twitter post." <br /> (interactive) (make-frame '((name . "twitter") (width . 80) (height . 15))) <br /> (select-frame-by-name "twitter") <br /> (twitter-status-edit)) <br /></pre><br /><p>I have it bound to Ctrl+Alt+Shift+T in gnome</p>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-4455268416008062392010-05-17T11:55:00.001+00:002010-05-17T11:55:49.899+00:00Smoke and Mirrors <div xmlns='http://www.w3.org/1999/xhtml'> <p><object height='300' width='400'><param value='true' name='allowfullscreen'/><param value='always' name='allowscriptaccess'/><param value='http://vimeo.com/moogaloop.swf?clip_id=11588636&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1' name='movie'/><embed height='300' width='400' allowscriptaccess='always' allowfullscreen='true' type='application/x-shockwave-flash' src='http://vimeo.com/moogaloop.swf?clip_id=11588636&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1'/></object><p><a href='http://vimeo.com/11588636'>Smoke and Mirrors 2010 showcase documentary record</a> from <a href='http://vimeo.com/neophyte'>Peter Every</a> on <a href='http://vimeo.com'>Vimeo</a>.</p></p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-50943126634518163752010-05-03T18:02:00.001+00:002010-05-03T18:02:34.213+00:00Pie<div style="float: right; margin-left: 10px; margin-bottom: 10px;"><a href="http://www.flickr.com/photos/_james/4575680078/" title="photo sharing"><img src="http://farm5.static.flickr.com/4014/4575680078_3553194527_m.jpg" alt="" style="border: solid 2px #000000;" /></a><br /><span style="font-size: 0.9em; margin-top: 0px;"><a href="http://www.flickr.com/photos/_james/4575680078/">Pie</a><br />Originally uploaded by <a href="http://www.flickr.com/people/_james/">digehode</a></span></div>I made pie. Because cake is a lie.<br clear="all" />Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-54239443480131073422010-04-28T10:48:00.003+00:002010-04-28T10:51:38.466+00:00My Wanderlust setupWanderlust is a pain to set up, but the flexibility you get is worth it. I've been using it for a month now and (thanks to various posts and trawling through the cutomisation groups for wl, bbdb, mu-cite) this is what my wanderlust setup has grown to:<br /><br /><br />;; mode:-*-emacs-lisp-*-<br />;; wanderlust <br /><br /><br />(setq wl-summary-always-sticky-folder-list t)<br />(setq wl-summary-line-format "%n%T%P %D/%M (%W) %h:%m %t%[%25(%c %f%) %] %s")<br />(setq wl-summary-width 150)<br />(setq wl-user-mail-address-list (quote ("j.shuttleworth@coventry.ac.uk" "csx239@coventry.ac.uk")))<br /><br />(setq bbdb-use-pop-up nil)<br /><br />;;Initial Wanderlust setup<br />;; autoload configuration<br />(autoload 'wl "wl" "Wanderlust" t)<br />(autoload 'wl-other-frame "wl" "Wanderlust on new frame." t)<br />(autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)<br /><br />;; If we wanted to we can set the init file to be something different<br />;; (setq wl-init-file "~/.emacs.d/wl.el")<br /><br /><br />;; This should allow us to compose mail using C-x m<br />(autoload 'wl-user-agent-compose "wl-draft" nil t)<br />(if (boundp 'mail-user-agent)<br /> (setq mail-user-agent 'wl-user-agent))<br />(if (fboundp 'define-mail-user-agent)<br /> (define-mail-user-agent<br /> 'wl-user-agent<br /> 'wl-user-agent-compose<br /> 'wl-draft-send<br /> 'wl-draft-kill<br /> 'mail-send-hook))<br /><br />;; BBDB for harvesting Email addresses.<br />;; THe rest in in my WL file<br />(add-to-list 'load-path "/usr/share/emacs23/site-lisp/bbdb/")<br />(setq bbdb-file "~/Documents/portables/bbdb") ;; keep ~/ clean; set before loading<br />(require 'bbdb) <br />(bbdb-initialize)<br /><br />(setq <br /> bbdb-offer-save 1 ;; 1 means save-without-asking<br /><br /> bbdb-use-pop-up t ;; allow popups for addresses<br /> bbdb-electric-p t ;; be disposable with SPC<br /> bbdb-popup-target-lines 1 ;; very small<br /><br /> bbdb-dwim-net-address-allow-redundancy t ;; always use full name<br /> bbdb-quiet-about-name-mismatches 2 ;; show name-mismatches 2 secs<br /><br /> bbdb-always-add-address t ;; add new addresses to existing...<br /> ;; ...contacts automatically<br /> bbdb-canonicalize-redundant-nets-p t ;; x@foo.bar.cx => x@bar.cx<br /><br /> bbdb-completion-type nil ;; complete on anything<br /><br /> bbdb-complete-name-allow-cycling t ;; cycle through matches<br /> ;; this only works partially<br /><br /> bbbd-message-caching-enabled t ;; be fast<br /> bbdb-use-alternate-names t ;; use AKA<br /><br /><br /> bbdb-elided-display t ;; single-line addresses<br /><br /> ;; auto-create addresses from mail<br /> bbdb/mail-auto-create-p 'bbdb-ignore-some-messages-hook <br />;; bbdb-ignore-some-messages-alist ;; don't ask about fake addresses<br /> ;; NOTE: there can be only one entry per header (such as To, From)<br /> ;; http://flex.ee.uec.ac.jp/texi/bbdb/bbdb_11.html<br /><br />;; '(( "From" . "no.?reply\\|DAEMON\\|daemon\\|facebookmail\\|twitter")))<br /><br />)<br /><br /><br />(add-to-list 'load-path "/usr/share/emacs23/site-lisp/mu-cite/")<br />(require 'mu-cite)<br />(add-hook 'mail-citation-hook 'mu-cite-original)<br />(setq mu-cite-top-format<br /> '("On " date "," full-name " spake thus:\n"))<br /><br /><br /><br /><br /><br />(setq signature-file-name "~/.signature"<br /> signature-insert-at-eof t<br /> signature-delete-blank-lines-at-eof t<br /> mu-cite-prefix-format (quote ("> ")) ; default to >, no questions asked, rather than name<br />)<br /><br /><br /><br />(add-hook<br /> 'wl-init-hook<br /> '(lambda ()<br /> ;; Add support for (signature . "filename")<br /> (unless (assq 'signature wl-draft-config-sub-func-alist)<br /> (wl-append wl-draft-config-sub-func-alist<br /> '((signature . wl-draft-config-sub-signature))))<br /><br /> (defun mime-edit-insert-signature (&optional arg)<br /> "Redefine to insert a signature file directly, not as a tag."<br /> (interactive "P")<br /> (insert-signature arg))<br /><br /> ;; Keep track of recently used Email addresses<br /> ;;(recent-addresses-mode 1)<br /> ))<br /><br /><br />(defun wl-draft-config-sub-signature (content)<br /> "Insert the signature at the end of the MIME message."<br /> (let ((signature-insert-at-eof nil)<br /> (signature-file-name content))<br /> (goto-char (mime-edit-content-end))<br /> (insert-signature)))<br /><br /><br /><br />(setq <br /> elmo-maildir-folder-path "~/Maildir" ;; where i store my mail<br /><br /> wl-stay-folder-window t ;; show the folder pane (left)<br /> wl-folder-window-width 25 ;; toggle on/off with 'i'<br /> <br /> wl-smtp-posting-server "mail.coventry.ac.uk" ;; put the smtp server here<br /><br /> ;wl-smtp-posting-server<br /> ;The initial setting is nil. This is the SMTP server name for mail transmission.<br /> ;wl-smtp-posting-port<br /> ;The initial setting is nil. This is the SMTP port number for mail transmission. If nil, default SMTP port number (25) is used.<br /> wl-smtp-posting-user "csx239"<br />;The initial setting is nil. This is the user name for SMTP AUTH authentication.<br /> wl-smtp-authenticate-type "login"<br />;The initial setting is nil. This string-valued variable specifies the authentication method for SMTP AUTH authentication. You may specify plain, cram-md5, digest-md5, login, etc. If nil, authentication will not be carried out.<br /><br /><br /><br /> wl-local-domain "ng43-1.coventry.ac.uk" ;; put something here...<br /> wl-message-id-domain "coventry.ac.uk" ;; ...<br /><br /> wl-from "James Shuttleworth <csx239@coventry.ac.uk>" ;; my From:<br /><br /> ;; note: all below are dirs (Maildirs) under elmo-maildir-folder-path <br /> ;; the '.'-prefix is for marking them as maildirs<br /> wl-fcc ".sent" ;; sent msgs go to the "sent"-folder<br /> wl-fcc-force-as-read t ;; mark sent messages as read <br /> wl-default-folder ".inbox" ;; my main inbox <br /> wl-draft-folder ".drafts" ;; store drafts in 'postponed'<br /> wl-trash-folder ".trash" ;; put trash in 'trash'<br /> wl-spam-folder ".trash" ;; ...spam as well<br /> wl-queue-folder ".queue" ;; we don't use this<br /><br /> ;; check this folder periodically, and update modeline<br /> wl-biff-check-folder-list '(".todo") ;; check every 180 seconds<br /> ;; (default: wl-biff-check-interval)<br /><br /><br /><br /><br /><br /> ;; hide many fields from message buffers<br /> wl-message-ignored-field-list '("^.*:")<br /> wl-message-visible-field-list<br /> '("^\\(To\\|Cc\\):"<br /><br /> "^Subject:"<br /> "^\\(From\\|Reply-To\\):"<br /> "^Organization:"<br /> "^Message-Id:"<br /> "^\\(Posted\\|Date\\):"<br /> "^[xX]-[Ff]ace:"<br /> )<br /> wl-message-sort-field-list<br /> '("^From"<br /><br /> "^Organization:"<br /> "^X-Attribution:"<br /> "^Subject"<br /> "^Date"<br /> "^To"<br /> "^Cc")<br />)<br /><br />;;Get BBDB workiing<br />(require 'bbdb-wl)<br />(bbdb-wl-setup)<br />(define-key wl-draft-mode-map (kbd "<C-tab>") 'bbdb-complete-name)<br /><br />(setq<br /> wl-forward-subject-prefix "Fwd: " ) ;; use "Fwd: " not "Forward: "<br /><br /><br />;; Invert behaviour of with and without argument replies.<br />;; just the author<br />(setq wl-draft-reply-without-argument-list<br /> '(("Reply-To" ("Reply-To") nil nil)<br /> ("Mail-Reply-To" ("Mail-Reply-To") nil nil)<br /> ("From" ("From") nil nil)))<br /><br /><br />;; bombard the world<br />(setq wl-draft-reply-with-argument-list<br /> '(("Followup-To" nil nil ("Followup-To"))<br /> ("Mail-Followup-To" ("Mail-Followup-To") nil ("Newsgroups"))<br /> ("Reply-To" ("Reply-To") ("To" "Cc" "From") ("Newsgroups"))<br /> ("From" ("From") ("To" "Cc") ("Newsgroups"))))<br /><br /><br />(defun djcb-wl-draft-subject-check ()<br /> "check whether the message has a subject before sending"<br /> (if (and (< (length (std11-field-body "Subject")) 1)<br /> (null (y-or-n-p "No subject! Send current draft?")))<br /> (error "Abort.")))<br /><br /><br />;; note, this check could cause some false positives; anyway, better<br />;; safe than sorry...<br />(defun djcb-wl-draft-attachment-check ()<br /> "if attachment is mention but none included, warn the the user"<br /> (save-excursion<br /> (goto-char 0)<br /> (unless ;; don't we have an attachment?<br /><br /> (re-search-forward "^Content-Disposition: attachment" nil t) <br /> (when ;; no attachment; did we mention an attachment?<br /> (re-search-forward "attach" nil t)<br /> (unless (y-or-n-p "Possibly missing an attachment. Send current draft?")<br /> (error "Abort."))))))<br /><br />(add-hook 'wl-mail-send-pre-hook 'djcb-wl-draft-subject-check)<br />(add-hook 'wl-mail-send-pre-hook 'djcb-wl-draft-attachment-check)<br /><br />;; don't ****ing split large messages<br />(setq mime-edit-split-message nil)<br /><br /><br />;For printing on black and white printer...<br />(setq wl-ps-print-buffer-function 'ps-print-buffer)<br /><br /><br /><br />;Auto add signature on draft edit<br />(remove-hook 'wl-draft-send-hook 'wl-draft-config-exec)<br />(add-hook 'wl-mail-setup-hook 'wl-draft-config-exec)<br />(setq wl-draft-config-alist<br /> '(((string-match "1" "1")<br /> (bottom . "\n--\n") (bottom-file . "~/.signature"))<br /> ))<br /><br /><br /><br />;; Wanderlust compose becomes bound to C-x m<br />(autoload 'wl-user-agent-compose "wl-draft" nil t)<br />(if (boundp 'mail-user-agent)<br /> (setq mail-user-agent 'wl-user-agent))<br />(if (fboundp 'define-mail-user-agent)<br /> (define-mail-user-agent<br /> 'wl-user-agent<br /> 'wl-user-agent-compose<br /> 'wl-draft-send<br /> 'wl-draft-kill<br /> 'mail-send-hook))<br /><br /><br />;; Fetchmail bount to C-x M-m<br /><br />(defun fetchmail-fetch ()<br /> (interactive) <br /> (shell-command "fetchmail")<br /> )<br />(global-set-key "\C-x\M-m" 'fetchmail-fetch)<br /><br /><br />;Stop mime errors when sending to AOL/others?<br />; osdir.com/ml/mail.wanderlust.general/2006-10/msg00007.html<br />;(setq-default mime-transfer-level 8)<br />(setq smtp-use-8bitmime nil)<br /><br /><br />;Swap a and A in summary mode, so citing original message is on a and no-cite on A.<br />;I want the most common action (for me) to be the one with fewer keypresses<br />(define-key wl-summary-mode-map (kbd "A") 'wl-summary-reply)<br />(define-key wl-summary-mode-map (kbd "a") 'wl-summary-reply-with-citation)Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com3tag:blogger.com,1999:blog-12642020.post-52184626587956407952010-04-11T21:05:00.001+00:002010-04-19T13:32:02.826+00:00This blog has moved<br /> This blog is now located at http://dis-dot-dat.blogspot.com/.<br /> You will be automatically redirected in 30 seconds or you may click <a href='http://dis-dot-dat.blogspot.com/'>here</a>.<br /><br /> For feed subscribers, please update your feed subscriptions to<br /> http://dis-dot-dat.blogspot.com/feeds/posts/default.<br /> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-37194874671064191192010-04-07T09:37:00.003+00:002010-04-07T13:22:14.900+00:00Customising WanderlustI've used a combination of <a href="http://www.mutt.org/">Mutt</a>, Emacs, Fetchmail, Procmail and Nullmailer for a long time now. Nearly a decade. But since most of the rest of my computer life is spentfi inside Emacs and I've swapped from paper-based task tracking to <a href="http://www.emacswiki.org/emacs/RememberMode">remember-mode</a>, I thought I'd give Wanderlust a try.<br /><br />The articles on getting started with Wanderlust at <a href="http://emacs-fu.blogspot.com ">emacs-fu</a> are great (<a href="http://emacs-fu.blogspot.com/2009/06/e-mail-with-wanderlust.html">Part 1</a> <a href="http://emacs-fu.blogspot.com/2009/09/wanderlust-tips-and-tricks.html">Part 2</a> <a href="http://emacs-fu.blogspot.com/2010/02/i-have-been-using-wanderlust-e-mail.html">Part 3</a>) and left me with a working mail client. Unfortunately, it worked in a way I didn't quite like as much as Mutt.<br /><br />Here's how I fixed it.<br /><br />All of the lisp bits in this post can go in your .wl file, so you don't have to pollute your .emacs. <br /><br /><h3>Summary lines </h3> The first thing that bothered me about Wanderlust was the short summary lines. I have a fairly high-resolution monitor, and there was a lot of wasted space in the summary buffer. Even on my low-resolution laptop, I had empty space to the right of the truncated subjects. Here's the solution:<br /><br />I was also a bit miffed by the date format and spacing of the elements in the summary lines, so I swapped those around to be correct (that is, British):<br /><br /><pre class="code"><br /> (setq wl-summary-line-format "%n%T%P %D/%M (%W) %h:%m %t%[%25(%c %f%) %] %s")<br /> (setq wl-summary-width 150)<br /></pre><br /><br /><h3>Stickiness </h3> Being used to Mutt, I kept pressing "q" to close the message preview. In Wanderlust, when shoeing an e-mail, you don't actually jump into its buffer, so all this kept doing was closing the summary. If you had any marks on messages or operations that hadn't been executed, this could be a real pain because they were all forgotten. I found that you could make a summary "sticky" with M-s, which makes the contents of the summary persistent in a Wanderlust session, but you have to remember to actually do that when you open a summary buffer. Then I found out how to make all summaries sticky by default:<br /><br /><pre class="code"> (setq wl-summary-always-sticky-folder-list t)</pre><br /><br /><h3>Virtual Folders </h3> One of the things I liked most about Mutt was the powerful searching functions. Wanderlust has something even better: virtual folders.<br /><br />Use V to create one. You can search by body, from, to, etc., but also by Flag, so a search for Flag of Unread shows all new mails. You can also use ! to invert the search: !Flag, for example.<br /><br />V can be used in a summary or from the Folders buffer. If you press it at your Desktop item, the virtual folder pulls mails from everything beneath it.<br /><br />Even better, if you use "m f" to make a virtual folder in the folders view, it becomes a new mailbox. And, if you save the folder buffer, it updates your .folders file. You can put nicer names on them, too. I have these two items in my .folders:<br /><br /><pre class="code"> /flag:unread/.inbox "Unread/inbox"<br /> /!flag:unread/.inbox "Read/inbox"<br /></pre><br /><br />Which got me out of the habit of moving read mail into a separate mailbox, as I used to have done automagically in Mutt - <a href=" http://inboxzero.com/articles/ ">in-box zero</a> makes me feel good. This is a good thing, because if you're using the brilliant remember-mode, the e-mails don't move around after you've added to-do items that link to them.<br /><br /><h3>Automatic signature </h3> I know you can press a few keystrokes and insert your signature in a draft e-mail, but I don't like it. Mutt used to append the signature automatically.<br /><br />Using <a href="http://www.emacswiki.org/emacs/MuCite">mu-cite</a>, I added this behaviour again. Notice how bad at lisp I am - I cobbled this together from bits I found on the Internet. 1=1 /is/ true, though :)<br /><br /><pre class="code"><br /> (require 'mu-cite)<br /> (add-hook 'mail-citation-hook 'mu-cite-original)<br /> <br /> (setq signature-file-name "~/.signature"<br /> signature-insert-at-eof t<br /> signature-delete-blank-lines-at-eof t)<br /> <br /> <br /> (add-hook<br /> 'wl-init-hook<br /> '(lambda ()<br /> ;; Add support for (signature . "filename")<br /> (unless (assq 'signature wl-draft-config-sub-func-alist)<br /> (wl-append wl-draft-config-sub-func-alist<br /> '((signature . wl-draft-config-sub-signature))))<br /> <br /> (defun mime-edit-insert-signature (&optional arg)<br /> "Redefine to insert a signature file directly, not as a tag."<br /> (interactive "P")<br /> (insert-signature arg))<br /> <br /> ;; Keep track of recently used Email addresses<br /> ;;(recent-addresses-mode 1)<br /> ))<br /> <br /> <br /> (defun wl-draft-config-sub-signature (content)<br /> "Insert the signature at the end of the MIME message."<br /> (let ((signature-insert-at-eof nil)<br /> (signature-file-name content))<br /> (goto-char (mime-edit-content-end))<br /> (insert-signature)))<br /></pre><br /> <br /><h3>Cite the way I like it </h3> I also always had a custom line at the start of any replies/forwards. Here's how to do that in Wanderlust.<br /><br /><pre class="code"> (setq mu-cite-top-format '("On " date "," from " spake thus:\n"))</pre><br /><br /><h3>Black and white printing </h3> I haven't tried this yet, but I found a note in the Wanderlust docs about printing to a black and white printer.<br /><br /><pre class="code"> (setq wl-ps-print-buffer-function 'ps-print-buffer)</pre><br /><br /><h3>Calling fetchmail </h3> At first I was doing this in an eshell buffer. I don't like to have it run automatically, because sometimes I want to read my mail on the web, but ultimately like to download my mail to local Maildirs. You'd understand if you had to live with the regular mail service fubars here at Coventry University :)<br /><br />I've bound it to C-x M-m, so it matches up with C-x m (write e-mail).<br /><br /><pre class="code"> (defun fetchmail-fetch ()<br /> (interactive) <br /> (shell-command "fetchmail")<br /> )<br /> (global-set-key "\C-x\M-m" 'fetchmail-fetch)<br /></pre><br /><br /><h3>X-Face </h3> Just for the fun of it, I have X-Face support. I've checked my e-mail for the past month and not a single other person inserts an X-Face header line, so there's not much point other than to see my own grinning face when I look in my sent mail folder. Still, that's enough reason for me.<br /><br />First add X-Face to the visible field list:<br /><br /><pre class="code"> (setq wl-message-visible-field-list<br /> '("^\\(To\\|Cc\\):"<br /> "^Subject:"<br /> "^\\(From\\|Reply-To\\):"<br /> "^Organization:"<br /> "^Message-Id:"<br /> "^\\(Posted\\|Date\\):"<br /> "^[xX]-[Ff]ace:"<br /> ))<br /></pre><br /><br />And then just make sure you have a suitable ~/.xface file. By default, wl-auto-insert-x-face is set to t, so it should just work.<br /><br />Feel free to e-mail me at csx239 AT coventry DOT ac DOT uk if you want to have someone to e-mail that uses x-face. It would make my day.Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com1tag:blogger.com,1999:blog-12642020.post-68002839080817977802010-04-01T09:51:00.001+00:002010-04-01T09:51:05.535+00:00eshell <div xmlns='http://www.w3.org/1999/xhtml'> <p>Why didn't someone tell me about this a long time ago? I've been using shell or ansi-term for years - all that time, I could have been using eshell. World: try harder.</p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com1tag:blogger.com,1999:blog-12642020.post-18552708391551887892010-03-30T09:20:00.001+00:002010-03-30T09:20:49.641+00:00I might get emacs pinky <div xmlns='http://www.w3.org/1999/xhtml'> <p>I tried switching capslock and control. I even tried using control on the capslock key and removing capslock altogether - I never use it anyway.</p><p>But it doesn't work. If it wasn't for the double quote being above 2, it would probably be OK. With a US layout, I don't suppose it's a problem, but with a UK keyboard it seems the easiest way to get a double quote is to use left-shift-2, which is all just a bit too close when I now also have my little finger hovering over capslock.</p><p>Now I need to unlearn the past week of this layout and insure my fingers.</p><p>My left pinky is slightly curved from heave eamcs use already.</p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com2tag:blogger.com,1999:blog-12642020.post-89309973820346470182010-02-08T09:11:00.001+00:002010-02-08T09:11:09.341+00:00org mode reading rssThis is great. org mode can read from my toodledo rss feed and the toodle-droid app lets me post on the move.<br /><br />I also have a script to sync my Google calendar with emacs' diary.<br /><br />I'm going to try letting go of my paper-based task list and day plan...Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com1tag:blogger.com,1999:blog-12642020.post-21209811811820278532010-02-05T03:10:00.001+00:002010-02-05T03:10:06.012+00:00Python + emacs + Android <div xmlns='http://www.w3.org/1999/xhtml'> <p><p>I'm writing Python in emacs and using just C-c C-c (interpret buffer) to execute it instantly on my phone.</p><p>I can hardly see through tears of joy.</p></p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com1tag:blogger.com,1999:blog-12642020.post-43904387602313824132010-02-02T20:38:00.001+00:002010-02-02T20:38:05.696+00:00Code in the cloud <div xmlns='http://www.w3.org/1999/xhtml'> <p>I wasn't particularly bothered by Mozilla's <a href='https://bespin.mozilla.com/'>Bespin</a> until I read that it's extensible and inspired by emacs. And some other, rather evil editor. Now I just need to wait 20 years and It will be surely be perfect.</p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-24443849591181708552010-01-22T23:13:00.001+00:002010-01-22T23:13:46.159+00:003rd of February is new phone day <div xmlns='http://www.w3.org/1999/xhtml'> <p>And look: <a href='http://android.processing.org/'>Processing for android</a>. I'm now about as excited as I used to get just before Christmas at age 15. I mean 7.</p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-77668984312377270222010-01-22T22:19:00.001+00:002010-01-22T22:19:21.940+00:00Are you knowledge-hungry? <div xmlns='http://www.w3.org/1999/xhtml'> <p>It looks like there's proof that learning because you want to know something is much better than learning because you want to pass a test. <a href='http://blog.newsweek.com/blogs/nurtureshock/archive/2009/12/15/this-is-your-brain-on-a-test.aspx'>http://blog.newsweek.com/blogs/nurtureshock/archive/2009/12/15/this-is-your-brain-on-a-test.aspx</a>. More reason than ever to find interesting exercises then, I suppose. </p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-3065784768175436652010-01-22T21:53:00.001+00:002010-01-22T21:55:01.864+00:00iPhone app development sounds like fun<p>After seeing this, anyway: <a href="http://www.igniteseattle.com/2010/01/eugene-lin-iphoning-my-way-to-retirement/">Eugene Lin – iPhoning My Way to Retirement</a><p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/7FtWWTllCrg&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/7FtWWTllCrg&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object>Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0tag:blogger.com,1999:blog-12642020.post-13481776076760341292010-01-21T13:33:00.001+00:002010-01-21T13:33:33.690+00:00I wish I'd thought of this <div xmlns='http://www.w3.org/1999/xhtml'> <p>Christmas decorations created to represent the on-line statistics of the person they're given to. <a href='http://russelldavies.typepad.com/planning/2010/01/data-decs.html'>http://russelldavies.typepad.com/planning/2010/01/data-decs.html</a></p> </div> Digehodehttp://www.blogger.com/profile/03902425596256545208noreply@blogger.com0