DS.rs = [[an error occurred while processing this directive]]

My .emacs file:

Perhaps the most interesting parts are towards the end. There are three commands to insert GPLv3 variants into the top of a source file: boilerplate-{,l,a}gpl3. There's also a timestamp inserter (insert-timestamp) and revert-all-buffers (useful for DVCS outside of emacs (which is necessary until git/bzr support comes in.)).

(setq c-default-style '((other . "gnu")))
(global-font-lock-mode)
(setq make-backup-files nil)
(global-set-key "\C-g" 'goto-line)
(setq tab-width 2)
(setq display-time-and-date t)
(setq c-indent-level 1)
(setq c-perl-indent-level 2)
(setq java-indent-level 2)
(setq c-continued-statement-offset 0)
(setq perl-indent-level 2)

(if (fboundp 'zone-leave-me-alone)
  (zone-leave-me-alone))

(put 'downcase-region 'disabled nil)
(tool-bar-mode -1)
(menu-bar-mode -1)
;(zone-when-idle -1)
(scroll-bar-mode -1)
(setq inhibit-splash-screen t)
(setq initial-buffer-choice nil)

(defun boilerplate-gpl3 ()
        (interactive)
        "Insert GPLv3 boilerplate"
        (insert "

Copyright (C) " (format-time-string "%Y") " Joseph Pingenot

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

"))
(defun boilerplate-lgpl3 ()
        (interactive)
        "Insert LGPLv3 boilerplate"
        (insert "

Copyright (C) " (format-time-string "%Y") " Joseph Pingenot

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

"))
(defun boilerplate-agpl3 ()
        (interactive)
        "Insert AGPLv3 boilerplate"
        (insert "

    Copyright (C) " (format-time-string "%Y") " Joseph Pingenot

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"))
(defun insert-timestamp ()
        (interactive)
        "Inserts a timestamp"
        (insert (format-time-string "%Y%m%d.%H%M%S%z/%s")))

;Stolen from the emacs wiki. :)
(defun revert-all-buffers ()
  "Refreshes all open buffers from their respective files"
  (interactive)
  (let* ((list (buffer-list))
         (buffer (car list)))
    (while buffer
      (when (buffer-file-name buffer)
        (progn
          (set-buffer buffer)
          (revert-buffer t t t)))
      (setq list (cdr list))
      (setq buffer (car list))))
 (message "Refreshing open files"))

(defun word-count nil "Count words in buffer" (interactive)
  (shell-command-on-region (point-min) (point-max) "wc -w"))

Page last modified Thursday, 18-Feb-2010 16:21:25 EST