Ads by Google

Wednesday, January 28, 2009

Making Emacs open a default directory

Watch this interesting thread on the emacs newsgroup.  Note how complicated the request sounds and the wealth of simpler solutions that follow.  It's instructive to know that you don't need to use macros or fiddle around with any settings in elisp to do all of this.

My recommendation is that, if you have frequently want to access a particular directory, use bookmarks.  I posted about them here and here.

Saturday, January 24, 2009

R support for Org-mode

org-mode has some decent support for plotting using gnuplot for some time now.  For those using R, it looks like there might be some support for that too, if the preliminary discussions are anything to go by.

Do note that at this stage, you need ESS to be also installed.

Friday, January 16, 2009

Difference between Echo Area and Minibuffer

This thread on provides clear description of what is the minibuffer and echo area.

The confusion arises because the location of text is the same for both. Also the OP's request is useful for a beginner too.

Tuesday, January 13, 2009

CWE/SANS TOP 25 Most Dangerous Programming Errors

Via the TheRegister, finally, someone has come up with a list of errors that will generally get you knackered when you develop your application.


Obviously, this list will be useful to people who want to code better and  crackers, who know that things rarely if ever get patched.  Don't get me wrong, I'm all for full disclosure and all that but given the way automated patch cycles work, I'm not hopeful that  a manual sweep of applications will ever be done.

And the rest of the programming world will move on; creating "better" classes of gargantuan errors that will make the security world weep.

Bet on it.

Only when a super massive botnet gets created by some cracker which exploits some or all variations of the errors, will some cosmetic re-arrangement of the deck chairs happen.

Wednesday, January 7, 2009

Good movie formats to embed in LaTeX and PDF

This should be an interesting thread to follow for those who embed movies in their LaTeX document. A fairly good discussion on comp.text.tex on what works and what doesn't with different multimedia file formats and different viewers on different platforms.
*hey, that's 3 differents in one sentence.

Essential reading for those who want to make some interactive PDFs. Just in case, you didn't know, the popular package to embed them is movie15 which allows you embed video and audio files.

Of course, your PDF file will then be humongous; no, no magic compression or size reduction will occur.

Sunday, January 4, 2009

January 2009 TUG News

Just saw a post on the comp.text.tex newsgroup by Karl Berry on the latest TUG news. And that the new PracTeX journal is also out. To those interested in SAS and LaTeX, some of the articles might be useful.

Take a look.

Thursday, January 1, 2009

Applying the same patch again and again

I sync up my org-mode code using git by issuing git pull. And I keep getting the same error every time the one file I edit is modified.

$ git pull
remote: Counting objects: 98, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 85 (delta 57), reused 82 (delta 54)
Unpacking objects: 100% (85/85), done.
From git://
8915859..cd92610 master -> origin/master
Updating 8915859..cd92610
error: Entry 'Makefile' not uptodate. Cannot merge.

That's because the Makefile has been edited to point to the correct Emacs binary path and other customisations. So I had to rename the Makefile and then redo the command.

$ mv Makefile m
$ git pull
Updating 8915859..cd92610
Fast forward
ChangeLog | 6 +
Makefile | 2 +
ORGWEBPAGE/ | 140 ++++++++++++++++-
doc/ChangeLog | 12 ++
doc/org.texi | 170 +++++++++++++++-----
lisp/ChangeLog | 51 ++++++
lisp/org-exp.el | 291 +++++++++++++++++++++--------
lisp/org-export-latex.el | 37 +++--
lisp/org-footnote.el | 391+++++++++++++++++++++++++++++++
lisp/org.el | 81 ++++++++--
10 files changed, 1042 insertions(+), 139 deletions(-)
create mode 100644 lisp/org-footnote.el

And then edit the Makefile to re-apply the changes again. Specifically the diff lines highlighted is what I have to change everytime.

$ diff Makefile m
< EMACS=emacs
> EMACS=c:/gnu/emacs-22.2/bin/emacs
< prefix=/usr/local
> prefix=c:/gnu
< org-footnote.el \
< DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir doc/.nosearch
> DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir
< lisp/org-footnotes.elc: lisp/org-macs.elc lisp/org-compat.elc

Well, a simpler way to do it is as follows.

  1. Issue a git pull
  2. If the Makefile has a conflict, rename the file and issue a git pull again
  3. Generate a patch file by issuing diff -e NEWfile OLDfile > foo.patch
  4. apply the patch on the Makefile as patch Makefile foo.patch
  5. The edits that one has made is re-applied on the new Makefile
$ diff -e Makefile m
DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir
$ diff -e Makefile m > b.patch
$ patch Makefile b.patch
$ make

Since I don't make any changes to org-mode codebase and the only thing that has to be changed everytime Makefile changes is the path info, this is a bit faster than editing the Makefile everytime.

Though it took me sometime to figure it out and there's still this nagging doubt whether there's a even simpler way.

Any ideas?

EDIT: Just realised that the patch file will have to edited to have ONLY the changes you want else it will remove the newer lines added to other parts of the Makefile. So, this post is kind of wrong and displays a slightly addled view of patching AND version control.

Looks like PUBLIC FAIL!