(defun delete-whitespace () (interactive) (save-restriction (push-mark (point)) (skip-chars-forward "[\t\n ]") (kill-region (mark) (point)) (pop-mark) ) ) (defun format-iel-conf () "Calls format_iel_bib.py to format the IEL bibliography entry in the region into BibTeX format for a conference paper." (interactive) (call-process-region (point) (mark) "~/bin/format_iel_bib.py" t t nil "conference") ) (defun count-stuff-in-region () "Counts number of characters, words, and lines between point and mark." (interactive) (call-process-region (point) (mark) "wc" nil t nil) ) (defun format-iel-jour () "Calls format_iel_bib.py to format the IEL bibliography entry in the emregion into BibTeX format for a journal paper." (interactive) (call-process-region (point) (mark) "~/bin/format_iel_bib.py" t t nil "journal") ) (defun my-full-time-stamp () (interactive) (save-restriction (insert "Emin Martinian, emin@iname.com, ") (shell-command "date" t) )) (defun my-time-stamp () (interactive) (save-restriction (shell-command "date '+%a %b %d, %Y'" t) )) ;; the following macro does (load "~/.emacs") (fset 'reload-dot-emacs-file [?\M-x ?l ?o ?a ?d ?- ?f ?i ?l ?e return ?\C-a ?\C-k ?~ ?/ ?. ?e ?m ?a ?c ?s return]) ;; the following macro goes to the ~/things_to_do file (fset 'visit-things-to-do [?\C-x ?\C-f ?\C-a ?\C-k ?~ ?/ ?t ?h ?i ?n ?g ?s ?_ ?t ?o ?_ ?d ?o return]) ;; the following macro goes to the ~/things_done file (fset 'visit-things-done [?\C-x ?\C-f ?\C-a ?\C-k ?~ ?/ ?t ?h ?i ?n ?g ?s ?_ ?d ?o ?n ?e return]) ;; set up my function comment header for c/c++ as a macro (fset 'insert-tcl-comment-header [?\C-u ?7 ?0 ?# return ?# return ?# ? ?P ?R ?O ?C ?: ?\M-i ?\M-i return ?# return ?# ? ?i ?n ?p ?u ?t ?s ?: ?\M-i return ?# return ?# ? ?o ?u ?t ?p ?u ?t ?: ?\M-i return ?# return ?# ? ?p ?u ?r ?p ?o ?s ?e ?: ?\M-i return ?# return ?# ? ?m ?o ?d ?i ?f ?i ?e ?d ?: ?\M-i ?\C-q ?s ?\C-a ?\C-n ?# return ?\C-u ?7 ?0 ?# up up up up up up up up up up]) (fset 'insert-c-comment-header [?/ ?/ ? ?\C-u ?7 ?0 ?- return ?/ ?/ return ?/ ?/ ? ?F ?U ?N ?C ?T ?I ?O ?N ?: ?\M-i return ?/ ?/ return ?/ ?/ ? ?I ?N ?P ?U ?T ?S ?: ?\M-i return ?/ ?/ return ?/ ?/ ? ?R ?E ?T ?U ?R ?N ?S ?: ?\M-i return ?/ ?/ return ?/ ?/ ? ?P ?U ?R ?P ?O ?S ?E ?: ?\M-i return ?/ ?/ return ?/ ?/ ? ?M ?O ?D ?I ?F ?I ?E ?D ?: ?\M-i ?\C-q ?s ?\C-e return ?/ ?/ return ?/ ?/ ? ?\C-u ?7 ?0 ?- up up up up up up up up up up]) (defalias 'insert-matlab-comment-header (read-kbd-macro "C-u 50% RET % RET % SPC INPUTS: ESC i RET % RET % SPC OUTPUT: ESC i RET % RET % SPC DESCRIPTION: ESC i RET % RET % SPC $ I d $ RET % RET C-u 50% 9*C-p")) (defun setup-my-c-style () (progn (local-set-key "\C-qc" 'insert-c-comment-header) (local-set-key "\C-xz" 'compile) ) ) (defun setup-my-tcl-style () (progn (local-set-key "\C-qc" 'insert-tcl-comment-header) ) ) (defun setup-my-latex-style () (progn (setq tex-dvi-view-command "xdvi -geometry 1000x700 -s 3") (auto-fill-mode 1) (local-set-key "\C-xz" 'compile) (local-set-key "\C-j" esc-map) ;; tex-mode tries to override my ;; remapping of C-j so override tex! ) ) (defun setup-my-matlab-style () (progn (local-set-key "\C-qc" 'insert-matlab-comment-header) ) ) (defun ask-me-before-sending-mail () (interactive) (if (not (y-or-n-p " Send Message ")) (keyboard-quit)) )