Ads by Google

Saturday, January 21, 2012

A quick round up on Org, Emacs 23.4 news

Looks like I'll be busy for the next couple of weeks on work related stuff.  Here's some newsworthy posts from various mailing lists.

Konrad Hinsen has posted a patch for org-mode for IMAP support for VM links in orgmode.  Possibly of interest only to VM users.

Due to a security issue, there will be a Emacs 23.4 release in the next week or so, here's the announcement of the first release candidate by Chong Yidong.


Sunday, January 15, 2012

Sending Emails with Attachments from the Command Line Revisited

Previously I had posted about trying to send attachment emails from the command line here and here.  But the hitch was, every time I changed computers(which while infrequent) I still had to download and compile mpack and install it every time.

On a whim, when I asked on the cygwin mailing list, I was asked to try the Email package.  And I have to report it works beautifully.  It needs an MTA to connect to the mail server, for which there is msmtp and is part of the Cygwin packaged utilities already.   That sort of solves my portability issue.

Configuring Email was simple.  Edit the email.conf file with the following minimum details and you're set.


############################################################
SENDMAIL_BIN = '/usr/sbin/msmtp -t'
MY_NAME  = 'Sivaram '
MY_EMAIL = 'nnsivaram.nnet@gmail.com'
#REPLY_TO = ''
USE_TLS = 'true'
TEMP_DIR = '/tmp'
SMTP_AUTH = 'LOGIN'
SMTP_AUTH_USER = ' nnsivaram.nnet

And you call it in the shell script as follows


    echo "Mailing... $mailid with $attachfile"


    /usr/bin/email  -s "Mailed report on `date`" -a $attachfile  $mailid < $mbody
    echo "email Return code is $?"


Tuesday, January 10, 2012

C gave you "Hello World" while Haskell....

gives you

ghci> filter (`elem` ['A'..'Z']) "i lauGh At You BecAuse u r aLL the Same"
"GAYBALLS"
 
Cue me, laughing like a juvenile, suddenly, in office. 
But on a more serious note, learnyouahaskell.com teaches 
you Haskell, a FP language.  

Monday, January 9, 2012

New Emacs version(23.4) to be released due to security flaw in CEDET

Apparently, there's a security flaw in CEDET's code that allows arbitrary execution of code.  To fix it, the Emacs maintainers are going to release a new version of Emacs 23.3 with the patch as Emacs 23.4.

You can read more about it here.

Thursday, December 8, 2011

Monday, December 5, 2011

The History of Unix

Just stumbled on this fantastic IEEE article on the The Strange Birth and Long Life of Unix;  A fantastic read, worth the 15 minutes of time in knowing how Unix came about.

Unix: an emasculated version of Multics!

Thursday, December 1, 2011

Third Emacs pretest out

The third Emacs pretest is now out.  Binaries and tarballs can be found here.  The NEWS file will have the list of changes.

Moving buffers between windows

If you're new to emacs, it might be a good idea to read this post to know the difference between frames and windows before you can follow this post.

I had to do some fair amount of coding recently with lots of interlinked files.  With so many windows open and with my limited screen estate, I soon settled on a 3 window layout with the screen split horizontally and the top half split again into 2.  This way I could read code flowing off to the right on the bottom half while referring to the called functions in the other 2 windows on top.


But I soon found myself switching to those buffers to read a bit more on the definitions and losing my window layout.  A quick ask on gnu.emacs.help turned up this emacswiki page, the last elisp function that I reproduce below was perfect for my needs.

(defun rotate-windows ()
  "Rotate your windows"
  (interactive)
  (cond ((not (> (count-windows)1))
     (message "You can't rotate a single window!"))
    (t
     (setq i 1)
     (setq numWindows (count-windows))
     (while  (< i numWindows)
       (let* (
          (w1 (elt (window-list) i))
          (w2 (elt (window-list) (+ (% i numWindows) 1)))
         
          (b1 (window-buffer w1))
          (b2 (window-buffer w2))
         
          (s1 (window-start w1))
          (s2 (window-start w2))
          )
         (set-window-buffer w1  b2)
         (set-window-buffer w2 b1)
         (set-window-start w1 s2)
         (set-window-start w2 s1)
         (setq i (1+ i)))))))


There are a number of other options available too as mentioned by Sundar Vasan in his post. They give your more options and key bindings to use.

Monday, November 28, 2011

Gnus Tip: Customising the position of point when replying

If you have a need to top post or inline or below the mail depending on whom and where you're replying to, Gnus allows you to customise it by setting message-cite-reply-position whose doc string is reproduced below

message-cite-reply-position is a variable defined in `message.el'.
Its value is traditional
Documentation:
*Where the reply should be positioned.
If `traditional', reply inline.
If `above', reply above quoted text.
If `below', reply below quoted text.
Note: Many newsgroups frown upon nontraditional reply styles. You
probably want to set this variable only for specific groups,
e.g. using `gnus-posting-styles':

  (eval (set (make-local-variable 'message-cite-reply-above) 'above))

I've highlighted the warning just in case you missed it. :-)

Hat tip to Eric Abrahamsen's reply to a poster.  And in his post, you can see an example customisation of gnus-posting-styles to do group specific behaviour of reply.