Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Friday, December 18, 2009

org-mode speed keys

I use org-mode in Emacs, and today I discovered "speed commands":

org-use-speed-commands is a variable defined in `org.el'.
Its value is t

Documentation:
Non-nil means, activate single letter commands at beginning of a headline. This may also be a function to test for appropriate locations where speed commands should be active.
So, when you put your cursor at the beginning of a headline, then many commands are accessible by a single key.

Wednesday, August 26, 2009

Tabs or Spaces!

I use Emacs. My coworker/boss uses Vi. Actually, he uses a Vi mode inside XEmacs.

I use spaces. He uses tabs. Our other coworker is the guy in red as shown here.

EDIT: Fortunately, we all use OS X.

Tuesday, August 25, 2009

When to automate, abstract, generalize?

When you have a repetitive task to perform, at what point is it worth it to write a script to automate the task? When is it appropriate to abstract away the details? When should you write one highly parametrized function, and when should you write several specialized functions?

More importantly, how should you go about answering these questions beforehand so that you don't go down the wrong (i.e. inefficient) path?

At a conference a couple years ago I attended a talk that addressed some of these questions, but I do not really remember much about it...

I found myself dealing with all of these questions today. I had written some highly parametrized Verilog modules, but it was very tedious to support each variation. Furthermore, I ran into a bug in the simulator (described at the end of my next post), and I decided to circumvent the bug by splitting each module into a few specialized modules. I was then faced with the tedious task of factoring each module into its specialized variants, so I decided to write some elisp to do it for me.

So, in the end I found that I had made the wrong decision to implement parametrized modules, though I could not have predicted the ridiculous bug that I ran into and so was justified in the decision. I feel like writing the elisp to automate the rewrites of each module saved a lot of time, but I cannot really be sure.
Reblog this post [with Zemanta]

Saturday, August 15, 2009

Emacs 23

Emacs version 23.1 is now stable. I have deployed it on several Linux machines and on my Macbook Pro. Emacs 23 natively supports OS X [1] (support for the NeXTstep APIs was integrated into CVS in July 2008 [2]), so building on OS X gives me an Emacs.app that runs as a Cocoa app.

Emacs 23 adds support for daemon mode (via "emacs --daemon"), which is like Emacs Server in that you can connect to it and open files using emacsclient, except that you do not have to have any frame open. I use the following shell aliases to send files to the daemon, run Emacs commands, and open new frames:
# start a windowed frame
alias ec="emacsclient -n -c -a emacs"

# start a terminal frame
alias em="emacsclient -t -a emacs -nw"

# do not start a new frame
alias ea="emacsclient -n -a emacs"
I also set EDITOR so that most programs use the daemon to open files:
export EDITOR="emacsclient -t"
I use daemon mode like GNU Screen, though I also leave Emacs terminal frames open inside Screen windows.