[ILUG-BOM] elisp

Nagarjuna G. nagarjun@[EMAIL-PROTECTED]
Fri Jul 19 16:38:03 IST 2002


On Tue, Jul 16, 2002 at 01:18:48AM +0530, Vinay Pai wrote:
> I've always known you can do real cool things in emacs with elisp, but
> never got around to learning how. Has anyone out there significantly
> tweaked their .emacs files? If so care to send me an example of the
> stuff you've done?
> 

This was my old .emacs file.

(add-hook 'find-file-hooks 'auto-insert)

;(server-start)
(require 'paren)

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

(setq abbrev-file-name "~/abbrevs")
(setq set-fill-column "100")
(setq default-mode 'text-mode)

(global-set-key [?\C-h] 'delete-backward-char)
(global-set-key [?\C-x h] 'help-for-help)
(global-set-key [DEL] 'delete-char) 

(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'tex-mode-hook 'turn-on-auto-fill)

(condition-case ()
    (quietly-read-abbrev-file)
   (file-error nil))

(add-hook 'text-mode-hook
	  (function
	   (lambda ()
	     (setq abbrev-mode t))))

(add-hook 'tex-mode-hook
	  (function
	   (lambda ()
	     (setq abbrev-mode t))))

;(fset 'lit-this-backward
;   "b{\\em f\\'/}")
(global-set-key "\M-1" 'lindex1)
(global-set-key "\M-2" 'lindex2)
(global-set-key "\M-3" 'lindex3)
(global-set-key "\M-4" 'lindex4)
(global-set-key "\M-5" 'lindex5)
(global-set-key "\M-6" 'lindex6)
(global-set-key "\M-7" 'lindex7)
(global-set-key "\M-z" 'spell-word)
(fset 'lindex
   "\\index{}")
(fset 'lindex2
   "\\index{}/1bbb ffj1q")
(fset 'lindex3
   "\\index{}/1bbbb fffj1q")
(fset 'lindex4
   "\\index{}/1bbbbb ffffj1q")
(fset 'lindex5
   "\\index{}/1bbbbbb fffffj1q")
(fset 'lindexi6
   "\\index{}/1bbbbbbb ffffffj1q")
(fset 'lindexi7
   "\\index{}/1bbbbbbbb fffffffj1q")
(fset 'lindexi8
   "\\index{}/1bbbbbbbbb ffffffffj1q")
(fset 'lindex1
   "\\index{}/1bb fj1q")

(setq default-justification "full")
(setq inhibit-startup-echo-area-message t) 
(setq save-abbrevs "t")
(setq search-highlight "t")
(setq tex-dvi-view-command  "xdvi -s 12 -bg gray -fg black")
(setq tex-directory "~/tmp")

;(global-set-key "\C-m" 'set-mark-command)  
(global-set-key "\C-ci" 'itemize-para)
(global-set-key "\C-xg" 'goto-line)
(global-set-key "\C-xI" 'lit-this-backward)
(global-set-key "\C-xaa" 'abbrev-mode)  
(global-set-key "\C-xnn" 'name-last-kdb-macro)  
(global-set-key "\C-xni" 'insert-kbd-macro)  
(global-set-key "\C-cd" 'dvar)  

(global-set-key "\C-cm" 'math-switch)  
(global-set-key "\M-z" 'ispell-word)


(fset 'lequation
   "\\begin{equation}\\end{equation}")

(put 'downcase-region 'disabled nil)

(put 'eval-expression 'disabled nil)

;ps-print configuration 

(defun my-centre ()
      "Nagarjuna G.")

(defun my-name ()
       "Homi Bhabha Centre for Science Education, TIFR")

(setq ps-left-header (list 'my-centre 'my-name))

(setq ps-font-size 12)


;(setq ps-font "Times-Roman")
(setq ps-font "Courier")

(setq ps-font-bold "Times-Bold")

(setq ps-font-italic "Times-Italic")

(setq ps-font-bold-italic "Times-BoldItalic")

;; For desktop -- saving the context while killing emacs
	(load "desktop")
	(desktop-load-default)
	(desktop-read)
(fset 'math-switch
   "$$\C-b")

(fset 'script-entry
   "&\C-m\C-m&\C-m\C-m&\C-m\C-m&\C-m\\\\\C-p\C-p\C-p\C-p\C-p\C-p\C-p\C-p")

(fset 'initiate-latex-input-file
   "\\documentclass{article}\C-m\\usepackage{bookman,11pt}\C-m\C-m\\begin{document}\C-m\C-m")

(fset 'kbd-macro-in-dot-emacs
   "\C-x\C-f\C-a\C-k/home/nagarjun/.emacs\C-m\C-[>\C-[xinsert-kbd-macro")

(fset 'itemize-para
   [escape ?a ?\\ ?i ?t ?e ?m ?{ escape ?e ?}])

(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)

(fset 'printps
   "\C-[xps-spool-buffer\C-m\C-xb*PostScript*\C-m\C-[<\C-[>\C-[xwrite region\C-mprint.ps\C-m")

(fset 'my-address
   "Nagarjuna G.\C-mHomi Bhabha Center\C-?\C-?re for Science Educatioon\C-?\C-?n\C-mMumbai \C-m\C-[OA\C-[OA\C-[OA\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC\C-[OC ")

(fset 'delete-cntl-Ms-inthebuffer
   "\C-[<\C-[%\C-qM\C-h\C-q\C-m\C-m\C-m!")
(custom-set-variables)
(custom-set-faces)
 
(load "/home2/nagarjun/python-mode.el")

(setq last-kbd-macro
   "\C-[-\C-[d\C-y\\index{\C-y}")

(setq last-kbd-macro
   "\\chapter{}\C-[OD")

(fset 'dvar
   [?< ?d ?t ?m ?l ?- ?v ?a ?r ?  ?s ?t ?a ?n ?d ?a ?r ?d ?_ ?h ?t ?m ?l ?_ ?> left])


(setq last-kbd-macro
   [escape ?d escape ?d escape ?d escape ?d ?\C-e escape ?x ?d ?e backspace backspace ?e ?n ?d ?  ?k ?b ?d ?  ?m ? ])




More information about the Linuxers mailing list