Pages

Sunday, October 25, 2009

Python Mode In Emacs 23



I have updated my python programming section at my personal web to include use of flymake and iPython. Works really really well. That and company mode for completion makes quite a nice little python environment.


http://richardriley.net/projects/emacs/dotprogramming

Saturday, October 17, 2009

python in emacs





;;;;;
;************************************************
; rgr-python.el
;
; python integration
; Richard Riley.
; http://richardriley.net/default/projects/emacs/
;************************************************

(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))

(setq load-path
(append (list nil
"~/.emacs.d/lisp/pymacs/"
"~/.emacs.d/lisp/pysmell"
)
load-path))

(require 'ipython)
(setq python-python-command "ipython")
(setq py-python-command-args '( "-colors" "Linux"))

(require 'pymacs)
(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport t)

(add-hook 'python-mode-hook
'(lambda ()
(set (make-local-variable 'hippie-expand-try-functions-list) (add-to-list 'hippie-expand-try-functions-list 'try-pysmell-complete))))

(provide 'rgr-python)


Sunday, October 4, 2009

udev rules for firing up a phone manager on Debian

I just got udev rules working for adding and removal of my Sony Eriksson W760i on Debian Linux. It was a real swine to get working : primarily because of the lack of info about X issues when calling scripts from the udev process. Anyway here is how its done:

1) Create a local udev script file:

/etc/udev/rules.d/z21_local.rules

ACTION=="add",KERNEL=="ttyACM0",SUBSYSTEM=="tty",ATTRS{product}=="Sony Ericsson W760",ATTRS{serial}=="3570670210310730",RUN+="/home/shamrock/bin/phonelaunch",SYMLINK+="w760i"
ACTION=="remove",KERNEL=="ttyACM0",SUBSYSTEM=="tty",RUN+="/home/shamrock/bin/phonekill"


2) Script to lauch Wammu


#!/bin/bash
export HOME = /home/shamrock
set -x
xhost local:shamrock
export DISPLAY=:0.0
cd /home/shamrock
su shamrock -c "/usr/bin/wammu &"


3) Script to clean up on removal


#!/bin/bash
su shamrock -c "pkill wammu"



The details for the udev rules came from running:

sudo udevadm info --name=/dev/ttyACM0 --query=all --attribute-walk


Enjoy!

Sunday, September 13, 2009

Tuesday, September 1, 2009

now for the reverse dns




$TTL 1d ;
$ORIGIN 0.168.192.IN-ADDR.ARPA.
@ IN SOA dns.richardriley.net. richardriley.net. (
2007011501
7200
120
2419200
604800
)
IN NS dns.richardriley.net.
101 IN PTR hermes.richardriley.net.
102 IN PTR x30.richardriley.net.
104 IN PTR development.richardriley.net.


dumping bind parameters



richardriley.db

@ IN SOA dns.richardriley.net. richardriley.net.(
2008081428 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day

IN NS dns.richardriley.net.
IN MX 10 mail.richardriley.net.

imap IN A 192.168.0.101
mail IN A 192.168.0.101
smtp IN A 192.168.0.101
www IN A 192.168.0.101
ftp IN A 192.168.0.101

development IN A 192.168.0.104
hermes IN A 192.168.0.101
X30 IN A 192.168.0.102
g4 IN A 192.168.0.103


correct way to use g-client



finally got it working and not halting my emacs startup



(setq rgr/gblogger-post-url "http://www.blogger.com/feeds/4166588008280027121/posts/default")
(load "g-loaddefs")


Monday, August 31, 2009

Aspell causing emacs to hang



The following helped ...



(setq-default ispell-extra-args '("--sug-mode=ultra"))


Monday, August 24, 2009

emacs, gnus and mailto url from firefox on linux

I finally got mailto working properly with Gnus posting styles by tweaking some other solutions. Documented here.

company mode : emacs auto completion

I have recently cleaned up my programming elisp files and have got company-mode working again. It is truly excellent. check out the settings here.

Tuesday, August 18, 2009

emacs-fu: navigating through source code using tags

emacs-fu: navigating through source code using tags

I'm not sure that GLOBAL is a good thing. etags seems a lot better AND works with elisp. Combine it with etags tables. Having said that, the tags code navigation/completion situation in emacs is such a mess and so full of "almost ready" solutions one has to wonder what does what these days.

blogging with fixed url





(define-key mode-specific-map [?B] 'rgr/blog)

(defun rgr/blog ()
(interactive)
(if current-prefix-arg
(progn
(let ((url(read-from-minibuffer "Post URL:")))
(gblogger-new-entry url)))
(gblogger-new-entry rgr/gblogger-post-url)
))


Compositing and transparent emacs with xmonad


Read here for the emacs code
: Emacs-fu and making emacs transparent,
and here for the xmonad part : XMonad Compositing


Monday, August 17, 2009

gpg-agent for caching key passwords with gpg-agent



What a palava. A hundred readmes and howtos explaining how to run
gpg-agent in Linux for caching with the Emacs epa libraries and low
and behold it's already done in /etc/X11/Xsession.d/90gpg-agent. Aargh. Also in my .gnupg/gpg-agent.conf the gtk2 pin reader does not work. Has to be X11. Dont ask me why.



Addendum : I'm an idiot. It should be "pinentry-gtk-2". Works now!

Remember where you are in Emacs files.

Thursday, August 13, 2009

How to use g-client from emacs for blogger.com blogs


Download Source


g-client package

Unarchive, add to your path in emacs, open a terminal, cd to that
directory and run make config


Understanding how to use it


The key is to set your g-user-mail to your googlemail
ID..e.g



(setq g-user-email "rileyrgdev@gmail.com")

and then you run gblogger-blog to log in and view your
blogs. Then comes the not so tricky bit. Put your cursor over the
"post" link for the blog you are interested (you should be using W3M by the way!) in and then hit "u" in W3m to copy the POST URL to the clipboard. Having done that, simply run gblogger-new-entry and paste in that POST URL. The rest is all down to you and your favorite nxml emacs editor .... And google of course :-;

Another test with embedded html tags





http://purl.org/net/emacs-gblogger/
shamrock
Another test using nxml editor


Title test from g-client









Another test using nxml editor



Title test from g-client



(autoload 'ipa-insert "ipa")
(define-key mode-specific-map [?A] 'ipa-insert)
(define-key mode-specific-map [?b] 'gblogger-blog)
(define-key mode-specific-map [?B] 'gblogger-new-entry)
(define-key mode-specific-map [?W] 'w3m-bookmark-view)


another test from g-client



Hello from g-client!


Blog client broken

My gblogger client from emacs has broken. I am trying something called g-client but can't get it to work! Damn. Just as I was reinvigorated and was going to post a long article about the dangers of pinning and sucking in unstable code into a Debian Lenny set up (Yeah, I know what "unstable" means...).

Saturday, June 13, 2009

Emacs Python IDE

I finally got emacs working properly with the excellent company-mode. But I have to think this guy:

http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/

For some reason the rope/ropemacs/ropemode documentation is pretty inconsistent and hard to find. Installing it from mercurial as described in the article above did it.

company-mode supports rope and pysmell now out of the box.

See my emacs python integration here:

http://richardriley.net/projects/emacs/dotprogramming

rope etc is loaded by company-mode.

Friday, May 29, 2009

Java palava

It's great to come back to Java years after being sigularly unimpressed by that ridiculous little Java man applet only to discover that Java is still a complete and utter dogs dinner when it comes to installation. I have installed JDK under Vista 3 times today and still no javac is found. Standard "helpful" types tell me to update my "path". Err, great. Why didnt the installer do that? Why can I not find my way around Windows? Why does it feel like its been desigend to thwart my every move. And more importantly why the hell can't I run the Blackberry JDE plugin for Eclipse under Linux to avoid all this heartache?

SE/JDK/SDK/ME/ etc etc etc

It's one of those "I could cry" moments.

Will ... not ... give ... up ..........

Monday, May 11, 2009

Eclipse under Windows in VirtualBox under Debian

Sometimes one has to admit defeat. I had hoped to set up a Blackberry Development Env in Emacs under Debian. But why bother? I just installed eclipse on Vista running in VirtualBox and it ... just works. Excellent Java parsing/highlighting/navigation. Excellent project facilities. Excellent help. Easy to install the CDT and the Blackberry IDE. Could this be the beginning of the end of my love affair with Emcas? It's just falling too far behind. I liked to think I didn't like the IDE expereince but lets face it, most of my time has been setting up emacs to work as an IDE. I want context help, completion, syntax hiliting, live debugging and rebuilding. But the facts are the facts : and that is simply that Eclipse kicks Emcas arse as a programming IDE (particularly Java) in a lot of areas. Sure its slow (so is emacs) and big (so is emacs) but its just more up to date and theres more happenong on a daily basis. The documentation is better. The only problem with eclipse is that its not emacs.... Emacs will continue to be my org manager and my email and news reader and my erc client. I hope ....

Still, I guess this could be a good chance for me to try emacs 23 under Windows for the first time.

Blackberry Java IDE

One of the "great" things about Java is that its cross platform. Or so one hopes. So imagine my surprise when I install the Blackberry Java IDE plugin with no warnings only to discover it requires win32 DLLs.

Hell's bells.

Blackberry

It seems that no matter what I try with my Blackberry Storm it doesn't work properly or there are glitches. The most recent issue is trying to use Instamapper. I finally got the gps tracker client installed and working (no mention of needing to turn ON the gps location setting in advanced settings), I got one update to an Instmapper map and then -- nothing. It tells me its transmitting but no updates on the embedded map here:

http://richardriley.net/bike/index#gps

My experiences to this day have not been good. Applications have too much cross over for a start - google maps, blackberry maps, vodafone go, gpd tracker, etc. What is using the gps? Do they conflict? I dont know. I just know that nothing works as smoothly as it should.

As for the keyboard in porttrait mode. If it switches back to suretype once more without me asking the damn thing's is getting f*cked into the Elbe.

RIM : where the hell are the wireless updates?!?!?!? I'm stuck on poxy .78 firmware and it's total and utter rubbish.

Saturday, April 4, 2009

Setting the correct key for epa in emacs 23

Emacs 23 has seen a new default sign/encrypt mechanism. I found zero documentation for it give or take but with the developers help the following shows how to use mml2015 using gnus-posting-styles:


(add-to-list `gnus-posting-styles `(".*"
(name "Richard Riley")
(from "Richard Riley ")
(eval(setq gnushush-user-agent-header (quote real)))
(signature-file "~/.emacs.d/.sigs/rgr.sig")
(eval (setq mml2015-signers '("b39a104a")))
(organization "aich tea tea pea dicky riley dot net")))

Tuesday, March 31, 2009

xhtml v html

I have been struggling with xhtml and html issues. I could cry. I made the mistake of listening to people against my better judgement. The xhtml handling in the real world on web sites is a mess. A complete mess. I have reverted to strict html 4.01 with much better results for rendering simple web pages on all browsers. Here is a good read:

http://www.webdevout.net/articles/beware-of-xhtml

It's a can of worms I'm sure.

Monday, March 30, 2009

The Debian Way

Debian differs from other distros in more ways than mere stability and "common sense". Some of it is hacked in a way not apparent to those of us who do not live and breath Debian. It's a real Linux problem - a different way to do things in various distros. This can often lead, and frequently does, to messed up machines.

My tale today about this, hoping to help someone else with Debian, was an aborted emacs-snapshot install in Debian Lenny on my mail/web server. The PSU on it overheats as the inaccessible fan which cools it has developed a problem - that is by the by. Anyway a sudden huge workload caused it to power off. No problem, reboot. (It wil be fixed btw...) Nothing. No access. What the hell? Damn. It's a headless server tucked away in the hall. So I dragged it out, attached a monitor and keyboard and with horror saw the boot process stall when locating the root file system. Uh oh! After a while it drops out into an initramfs prompt which grandly informs me is powered by the "ash shell". Never heard of it. Uh oh again.

Long story short. After some googling and reading nightmares of the usual "RTFM" replies from dorks who had zero clue how to fix it, it became apparent my file system was not hosed. No. The latest kernel update I had performed (and not rebooted yet) had rewritten my menu.lst file. And it had used Debian "automagic" to specify where the images were stored. It had ignored all the sda1 references and thought that all images were on hda4. Why? I still dont know the reason it picked hda4 since the automagic *commented out* (its how it knows its an automagic variable apparently....) setting for kopt was hd0. This had been correct when I used to have IDE drives. I recently moved to SATA. (HD to SD of cours ...) How does this clash with device.map? No idea. And after 4 hours googling and ripping my hair out with no live web or email I didn't really care. So moral of the story - if oyu use Debian read every damn line in every damn config file because otherwise it might just do somethings which you wont like because you are unaware of them.

Black and white : I made a mistake by not updating kopt in menu.lst. Reality : I had not found a Debian howto for transferring a system and had used a generic linux/grub one. It wasn't enough. IMO the automagic should have informed me that it was single handedly rewriting all the device references in my menu.lst. I dont know how. It just should have.

Still, alls well that ends well. And had it been Windows? Wouldn't have had a clue where to start looking.

Sunday, March 8, 2009

xrandr, nvidia, xmonad, cedge and games

So the situation gets better. Now I am using Twinview where both
displays share a single xscreen, xrand now works. This enable cli like
control of the displays. So lets add a load more meta modes to the
screen seciton of my xorg.conf:


Option "metamodes" "DFP:1280x1024,TV:1024x768; DFP:1280x1024,TV:NULL; DFP:1280x1024,TV:800x600;DFP:1024x768,TV:NULL;DFP:NULL,TV:1024x768;DFP:NULL,TV:800x600;"


And now add the xmond lines to control them:

  • -- multi monitor stuff
  • ,((modMask(myConfig) .|. controlMask, xK_1), spawn ("xrandr -s 0"))
  • ,((modMask(myConfig) .|. controlMask, xK_2), spawn ("xrandr -s 1"))
  • ,((modMask(myConfig) .|. controlMask, xK_3), spawn ("xrandr -s 2"))
  • ,((modMask(myConfig) .|. controlMask, xK_4), spawn ("xrandr -s 3"))
  • ,((modMask(myConfig) .|. controlMask, xK_5), spawn ("xrandr -s 4"))
  • ,((modMask(myConfig) .|. controlMask, xK_6), spawn ("xrandr -s 5"))
And bobs your uncle. Want to play Bioshock with the TV off at 1280x1024? Hit C-Mod-1.

C-Mod-0 to get the default desktops back.

xorg.conf and meta modes

I learnt a new technique for getting my X desktop to play ball with full screen games. It's the meta mode set up. One adds a metamode list in the screen definition and X alters the way it works depending on the meta mode invoked. e.g here the TV turns off when a full screen game launches itself on the main display.

Option "metamodes" "TV: 1024x768 @1024x768, DFP: 1280x1024 +1024+0; TV: NULL, DFP: 1280x1024;

NVidia only. Helps a lot in getting games to position properly when run under cedega and using a WM like XMonad.

C Code Completion In The C Programming Language


Just a bit of google fodder here.

Cedet has as new version, 1.0pre6, which pretty much works immediately with the excellent auto-completion package available from the Emacs Wiki.

Alex Ott talks about it in much more details here.

This is important stuff. The completion was there before but people had varying degrees of success as it was quite hard to get ones head around. Now it seems to work a lot better in default mode. This could make a big impact on Emacs adoption IMO.

Saturday, March 7, 2009

Opening a file as root

I found this stuff very handy:

The procedure is to open any file belonging to root, for example, and then hit C-x C-r to reopen it as root using tramp.

1) Keybinding

  1. (global-set-key (kbd "C-x C-r") 'find-alternative-file-with-sudo)


2) Code

  1. (defun find-alternative-file-with-sudo ()
  2. "Open current buffer as root!"
  3. (interactive)
  4. (when buffer-file-name
  5. (find-alternate-file
  6. (concat "/sudo:root@localhost:"
  7. buffer-file-name))))
  8. (defface find-file-root-header-face
  9. '((t (:foreground "white" :background "red3")))
  10. "*Face use to display header-lines for files opened as root.")
  11. (defun find-file-root-header-warning ()
  12. "*Display a warning in header line of the current buffer.
  13. This function is suitable to add to `find-file-root-hook'."
  14. (let* ((warning "WARNING: EDITING FILE AS ROOT!")
  15. (space (+ 6 (- (window-width) (length warning))))
  16. (bracket (make-string (/ space 2) ?-))
  17. (warning (concat bracket warning bracket)))
  18. (setq header-line-format
  19. (propertize warning 'face 'find-file-root-header-face))))
  20. (defun find-file-hook-root-header-warning ()
  21. (when (and buffer-file-name (string-match "root@localhost" buffer-file-name))
  22. (find-file-root-header-warning)))
  23. (add-hook 'find-file-hook 'find-file-hook-root-header-warning)


Friday, February 27, 2009

CSS and standards

Sometimes I want to launch my keyboard through the screen. I knew it was a mistake to listen to latest fads. It now seems my attempts at using "standards compliant" CSS was a waste of time and effort. Why? Because bloody IE 5, 5.5 and 6 do not show up my (basic) low bandwidth html export from org-mode. And not so much as a hint as to why not. Gah. OK, standards move, and old SW does not, but still. I hate coding with target viewer switches : it's error prone, dirty and duplication of effort. Mind you, while I redit this post I see that blogger doesn't work with ie 5.5 either. Ha.

Wednesday, February 18, 2009

Using CEDET

I just came across this wonderful article about using Cedet.

http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html

Well worth reading for those looking for code completion in C and C++ yet are somewhat confused by CEDET documentation.

Tuesday, February 10, 2009

Splitting mail with BBDB and Gnus

I'm currently taking a lookt at splitting email using gnus. It would be a client side replacement for procmail. The advantage being ALL email downloaded at the server would be ing a single IMAP onbox so its's easier to see ALL from more limited clients, and that the splitting into seperate folders is more easily controlled using regexps on the Gnus client side. Anyway, more to come soon as I just got it working - here's the bookmark page:

http://www.emacswiki.org/emacs/SplitMailUsingBbdb

And, woohoo, I just got it working so that emails from BBDB entries tagged with gnus-private get stored in special folders as specified by that BBDB field. And all with IMAP. Wonderful stuff once more.

Thursday, February 5, 2009

Speeding up your Emacs - autoloads

Following a bit of re-structuring I was pleasantly surprised to see how easy it is to generate your own autoloads in order to speed up Emacs. Simply put, autoloads mean you do not load files or functions until you need them. Instead you read in a catalog of stubs which tell the system what to load if and when certain functions are called. And it's incredibly easy to use.

The first you do is make use of the "magic comment". All that is a special format line prior to your defun lines. e.g

  • ;;;###autoload
  • (defun rgr/anything ()
  • "default to thing at point for anything"
  • (interactive)
  • (anything nil (region-or-word-at-point)))
Here the ";;;###autoload" tells the autload generator to include the following functions. Then having set the necessary autoload file name, you can generate your autoload file which is commonly, but not necessarily, called "loaddefs.el". Here I use "my-autoload.el":

  • ;; Generate autoload for locally downloaded and developed elisp files
  • ;;;###autoload
  • (defun my-autoloads nil
  • (interactive)
  • "Generate autoloads for code in ~/.emacs.d/."
  • (interactive)
  • (let ((generated-autoload-file "~/.emacs.d/my-autoload.el"))
  • (update-directory-autoloads "~/.emacs.d")))
Then call my-autoloads and bobs your uncle. The main thing to consider is keeping your functions seperate from the key definitions (as one example) which call them since you would need to load that file to install the key binding thus slightly defeating the object!

I don't need to mention that you need to load the autoload file do I?

  • (require 'my-autoload)

Wednesday, February 4, 2009

Anything - more Emacs goodies

While restructuring my emacs files for faster load times I remembered that I had not really played too much with the wonderful anything. To put it simply anything calls up a bunch of functions provides a list of results that they return. Each return element has a context sensitive action menu. So for example, I call "anything" and type "riley". Because I have the anything-c-source-bbdb plugin set I see my bbdb entries which contain "riley". Also I have anything-c-source-w3m-bookmarks so I see any w3m bookmarks containing that word. Even more useful is anything-c-source-man-pages. There are hosts of plugins out there and more being developed. Give it a go. Here's my set up:

.emacs

  • (autoload 'anything "my-anything" nil t)

my-anything.el

  • (require 'anything-extension)
  • (require 'anything-config)

  • (setq anything-sources
  • (list
  • anything-c-source-man-pages
  • anything-c-source-bbdb
  • anything-c-source-locate
  • anything-c-source-w3m-bookmarks
  • anything-c-source-occur)
  • anything-idle-delay 0.2
  • anything-samewindow t
  • anything-input-idle-delay 0.2
  • anything-candidate-number-limit 10)
  • (provide 'my-anything)
And finally a key binding and a wrapper:

  • (global-set-key (kbd "") 'rgr/anything)
  • (defun rgr/anything ()
  • "default to thing at point for anything"
  • (interactive)
  • (anything nil (region-or-word-at-point)))

Monday, February 2, 2009

Speeding Up Emacs Loading

Wow. I just reduced my emacs startup time from 10 or more seconds to about 1. The secret is autoloading and eval-after-load. See the init files at my emacs config pages for more details. The main offenders were the programming modes, w3m, gnus and bbdb. I autload the packages when I call there access functions now and, not susprisingly, the start up is considerably faster.

Friday, January 23, 2009

Good news for hacker McKinnon

Great news indeed. This was a wonderful example of a big company (US Military and Secret Service and CIA and ...) so up themselves they could not see the wood for the trees. While we all know not to believe everything we read in the press, it seemed reasonably obvious to me that this hacker, Gary McKinnon, was nothing more than interested in probing around for technical and fantasy (UFO sightings) reasons. And they wanted to potentuially incarcerate him in Guantanamo Bay (in cell with big Amjed no doubt), tortue him to find out what he knows and then stick him on a chain gang for 5 of his 9 lifetimes.

My view would be if you can get on via the web then so what? They should have paid the guy 20 Billion Trillion dollars because that is, no doubt, what they will pay Security "experts" to lock down their Windows systems .....

http://news.bbc.co.uk/1/hi/uk/7846442.stm

,---- | British hacker Gary McKinnon has won permission from the High Court to | apply for a judicial review against his extradition to the United | States. | | | The 42-year-old from London, who was diagnosed last August as having | Asperger's Syndrome, has admitted hacking into US military computers. `----

Hopefully with the new regime common sense will prevail.

Caveat : I don't support hacking per se. But if you leave your system wide open then people will have a browse around.

Thursday, January 22, 2009

Web hosting with Apache and laziness.

For a while I had been ignoring a niggling little issue with my home hosted web site at http://www.richardriley.net. When you entered the web address the url actually served was http://www.richardriley.net/default. Finally I found a straightforward explanation of virtual hosts and using redirect matching which all came together and worked. Here is the link.

Wednesday, January 21, 2009

Emacs and GIT

I wrote a tutorial a while back to try and get my head around DVC which is a distributed version control system for emacs which claimed GIT support. It's quite good but general concensus on the emacs IRC channel was that Magit was the easiest to use and had far better handling of staging and branching. Well, there's a new boy in two and he's the new cock of the walk.

See Egg for more details.

It has a colour coded interface with context help and "just works".

If you are using Git and need more than the Emacs built in Version Control interface to Git (present in Emacs 23) then I believe you could do a lot worse than Egg.

I need to update my Emacs page to recommend Egg.

Monday, January 19, 2009

Using org-mode and security

There is a great addition to emacs called epa which uses your GnuPG set up encrypt your org file based on public key encryption.

Easy to set up and works great.

See here for more details.

Thursday, January 15, 2009

ibuffers - always something new.

One of the wonderful things with using such a huge and rich environment as Emacs (yes, an envorinment!) is that there is always something new to learn or to use.

Today I happened to wander over to Xah Lee's pages and discovered something called ibuffers. Wonderful interface to the often huge amounts of buffers one might have open in emacs at any one time. And to make it the default list-buffers C-x C-b commans merely define an alias for it

(defalias 'list-buffers 'ibuffer)

You can stack filters based on mode, mark buffers, operate on buffers etc. This is combination with my default C-x b command ido-switch-buffer makes for some powerful uber-geek buffer manipulation and selection.

Xah Lee is an interesting character. My advice is hear him out - he knows emacs back to front but can often appear somewhat reactionary and sharp in the face of criticism from some of the old school emacs users who, to be fair, do not take kindly to young guns criticising Emacs and the design decisions they have taken to get it where it is today. Personally I do believe that the "out of the box" Emacs could and should have a lot more user friendly defaults - the seasoned users that this offends should be more than able to reconfigure it to how they like it. Heresy I know. And thank god burning at the stake is now outlawed ....

Tuesday, January 13, 2009

Posting Source Code

I am having trouble with source code posting to blogger. This surprises me since I would have though this had been well covered at this stage in Blogger's life.

I tried this page but that doesnt support s-lisp, and, didn't work for other code either.

The settings in Blogger has something which allows conversion of hard returns to html breaks but that doesn't seem to work when blogging using the emacs client e-blog.

Any suggestions or comments?

Slow NFS Exporting on Debian Solved

I rarely reboot my main machine but when I do the export stage for nfs shares took an intoleranly long time. Googling indicated I should install portmap. It was already installed so I tried reinstalling. Still the same problem when I tried

sudo /etc/init.d/nfs-kernel-server restart

The solution turned out to be quite simple. Rather than needing to configure reverse lookup on the the DNS Server I have running (bind9), I simply added the NFS clients to my local /etc/hosts file.

e.g

192.168.0.101 hermes.richardriley.net
192.168.0.103 g4.richardriley.net
192.168.0.104 X30.richardriley.net

The time to export is not about half a second as opposed to a minute.

Monday, January 12, 2009

Haskell and multi-term

A nice way to run ghci inside emacs is to use Andy Stewart's terminal plug in multi-term. Simple tab key will complete the ghci command set.

More Emacs Haskell integration here and also some browse-apropos extensions to use Hayoo can be found here. Hayoo is particularly good as it includes XMobar and XMonadContrib.

Twitting for Twits

On the subject of blogs and emacs the most convenient twitter interface I have found is

http://www.emacswiki.org/cgi-bin/emacs/twit.el


I modified the one function though to default to selected text.

(defun twit-query-for-post (prompt-heading initial-input)

"Query for a Twitter.com post text in the minibuffer."

(read-string (concat prompt-heading " (140 char max): ")

(if initial-input initial-input (if (zerop(length(region-or-word-at-point))) "" (region-or-word-at-point) ))))

Finally, an emacs blog client which works.

Thanks to Xah Lee for pointing out the wonderful emacs blogging client "e-blog". It lacks some decent default functionality such as defaulting to selected region and assuming a default destination blog, but overrall it's a joy to use and very, very simple to set up.

http://code.google.com/p/e-blog/

Ideally org-mode would support a paginating blog minor mode but I think thats some way off. This would be great because a lot of people are already using org-mode to publish their web sites and project details. A blog facility seems a natural extension of this.