Skip to main content
XEmacs init.el

It's been almost eleven years since when I was introduced to GNU EMACS. It came in as a DOS based editor which failed to load files that were over 640k. This was followed by DPMI support which provided flaky support to open files larger than than and unreliable under Windows 3.1. I then migrated to GNU EMACS on win32 and finally settled down with XEmacs on XP.

Over the years, my (X)EMACS config file has and still undergoing changes and here is the latest configuration that I maintain.

Note: I am not a lisp hacker, but have basically accumulated a list of handy configuration options and snippets that were indispensable during the course of my programming career.


;;
;; Shoban's XEmacs init.el
;;

;; ----------------------------------------------------------------------
;; load paths

;(pushnew "~/.xemacs/xemacs-packages/dmacro" load-path :test 'equal)
(pushnew "~/.xemacs/xemacs-packages" load-path :test 'equal)

(setq Info-directory-list
'("c:/Program Files/XEmacs/XEmacs-21.4.13/info/"))

;; ----------------------------------------------------------------------
;; Default frame size

(set-frame-height (selected-frame) 40)
(set-frame-width (selected-frame) 90)
(set-frame-position (selected-frame) 5 5)

;; ----------------------------------------------------------------------
;; remove of the unused toolbar icons

(set-specifier default-toolbar-visible-p nil)
(set-specifier bottom-toolbar-visible-p nil)
(set-specifier left-toolbar-visible-p nil)
(set-specifier right-toolbar-visible-p nil)
(set-specifier top-toolbar-visible-p nil)

;; ----------------------------------------------------------------------
;; Font lock mode

(require 'font-lock)

(set-face-font 'default "Courier New:Regular:10")
(set-face-font 'font-lock-keyword-face "Courier New:Bold:10")
(set-face-font 'font-lock-type-face "Courier New:Bold:10")

;; ----------------------------------------------------------------------
;; Color themes

;(require 'color-theme)
;(color-theme-deep-blue)

;; ----------------------------------------------------------------------
;; Set source code indenting rules

(defun my-c-mode-hook()
(c-set-style "stroustrup")
(c-set-offset 'case-label '+) ; The case labels will be indented
(c-set-offset 'inline-open '0) ; C++ - no indent for access specifiers
(setq indent-tabs-mode nil)
(setq tab-width 4) ; tabs are 4 spaces wide
(setq c-basic-offset 4) ; Indentation set to 4 spaces
(c-toggle-hungry-state t) ; Backspacing deletes all spaces before
(define-key c-mode-base-map "\C-m" 'c-context-line-break)
)

(add-hook 'c-mode-common-hook 'my-c-mode-hook)

;(setq cperl-indent-level 4)

;; ----------------------------------------------------------------------
;; Load VB mode

(autoload 'visual-basic-mode "visual-basic-mode" "Visual Basic mode." t)
(setq auto-mode-alist (append '(("\\.\\(frm\\|bas\\|cls\\|ctl\\)$" .
visual-basic-mode)) auto-mode-alist))
(add-hook 'visual-basic-mode-hook 'turn-on-font-lock)

;(autoload 'vb-mode "vb-mode" "Visual Basic Editing Mode" t)
;(setq auto-mode-alist
; (append '(("\\.\\(cls\\|bas\\|frm\\|ctl\\|vbs\\|mst\\)\\'" . vb-mode))
; auto-mode-alist))
;(add-hook 'vb-mode-hook 'turn-on-font-lock)

;; ----------------------------------------------------------------------
;; C# mode

(autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
(setq auto-mode-alist
(append '(("\\.cs$" . csharp-mode)) auto-mode-alist))


;; ----------------------------------------------------------------------
;; dmacro

;(require 'dmacro)

;(dmacro-load "~/dmacro/shoban.dm")

;(setq auto-dmacro-alist (cons '("\\.h$" . dot-h) auto-dmacro-alist))
;(setq auto-dmacro-alist (cons '("\\.h[px][px]$" . dot-h) auto-dmacro-alist))
;(setq auto-dmacro-alist (cons '("\\.c$" . masthead) auto-dmacro-alist))
;(setq auto-dmacro-alist (cons '("\\.c[px][px]$" . masthead) auto-dmacro-alist))

;; ----------------------------------------------------------------------
;; EMACS Code browser

;(ecb-activate) ; Comment out this line if you do not need ECB loaded

;; ----------------------------------------------------------------------
;; Abbrevs

(setq abbrev-file-name "~/.xemacs/.abbrevs") ;; definitions from...
(quietly-read-abbrev-file)
(abbrev-mode 1)

;; ----------------------------------------------------------------------
;; Spell check

(setq-default ispell-program-name "e:\\utils\\Aspell\\aspell.exe")

;; ----------------------------------------------------------------------
;; Misc commands

;(clearcase-install)

(line-number-mode 1)

(require 'generic-extras)

;(savehist-load)

(require 'saveplace)
(setq-default save-place t)

(iswitchb-default-keybindings)

(require 'redo)

(require 'func-menu)
(add-hook 'find-file-hooks 'fume-add-menubar-entry)

(paren-set-mode 'paren)

;; ----------------------------------------------------------------------
;; Calendar - week

(require 'calendar)

(defun calendar-week-number (date)
"Return the week number for DATE.
The week starts on MONDAY."
(let* ((year (extract-calendar-year date))
(day-number (calendar-day-number date))
(day-of-week-first-day (calendar-day-of-week (list 1 1 year)))
(adjust))
(when (eq 0 day-of-week-first-day)
(setq day-of-week-first-day 7))
(setq adjust (% (- 9 day-of-week-first-day) 8))
(if (<>

(if (eq (console-type) 'mswindows)
(set-default-file-coding-system (get-coding-system 'undecided-dos))
)

Comments

Popular posts from this blog

Helmet and seat-belt mandated at TN Today morning, I was pleasantly surprised to see most bikers (along with pillion riders) traveling with their helmets on as TN geared itself from the 1st of June to make it mandatory to wear helmets for bikers and seat belts (for the front seat passengers) for car commuters. The FM radio RJs had been conducting on-the-road commentaries, catching helmet-less riders seeking justification on why they had not yet acquired one (the helmet) yet. The shamed few who got caught eventually were presented with a helmet. One the way (near Tirumangalam), I couldn't help notice people flocking near put-up helmet shops on the sidewalks, trying to acquire the license to ride a bike! Let's hope the momentum carries on...

WiFi atlast

After numerous hours of tweaking, I resolved the problem with my WG311v3 NetGear PCI card. The problem? The router was too far away! Now that I am online using my Linux box, here are a few screen-shots of my desktop! The next time your supported WiFi card acts up, you know what to do... For those inquisitive lot, I am currently using the XP drivers with ndiswrapper.

Design Patterns: The art of making TV serials or masala movies

After being tortured to sit through one too many series of never ending serials, here are a few rules or patterns that I had observed: Design patterns on serials or movies The-Not-Good-as-it-seems Pattern: If it is too good to be true, it is a dream and in real-world, it will happen exactly the opposite The-One-is-not-enough Pattern: One of the primary character will have two wives and will struggle between the two (or more?). Medical-Miracle Pattern: Someone will get amnesia and later will be always be cured. Double-Trouble Pattern: If twins are born, they will get separated to meet again 20 years later. Of-course, there will be scope for impersonation. The-Cryptic-Prophet Pattern: Swamijis, gypsies, sadhus will usually be able to give cryptic clues on what is about to happen next The-Cycle-of-Life Pattern: If a primary actor's family is portrayed as being very rich, chances are they will become poor. Conversely, the family opposing the hero / heroin will have the lifestyle op