; emacs configuration from Dirk Jagdmann ; http://cubic.org/~doj/emacs ; disable fsync for file writes (setq write-region-inhibit-fsync t) ;;;;This sets garbage collection to hundred times of the default. ;;;;Supposedly significantly speeds up startup time. (Seems to work ;;;;for me, but my computer is pretty modern. Disable if you are on ;;;;anything less than 1 ghz). (setq gc-cons-threshold 5000000) (global-font-lock-mode t) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(auto-compression-mode t nil (jka-compr)) '(browse-url-browser-function (quote browse-url-firefox)) '(case-fold-search t) '(column-number-mode t) '(compile-auto-highlight t) '(current-language-environment "ASCII") '(display-time-24hr-format t) '(display-time-mode t nil (time)) '(display-time-use-mail-icon t) '(ecb-layout-always-operate-in-edit-window (quote (delete-window delete-other-windows split-window-horizontally split-window-vertically switch-to-buffer))) '(ecb-layout-name "left6") '(ecb-layout-nr 6) '(ecb-options-version "2.27") '(ecb-tree-indent 1) '(ecb-truncate-lines nil) '(ecb-truncate-long-names t) '(ecb-windows-width 0.25) '(inhibit-startup-screen t) '(inhibit-splash-screen t) '(inhibit-startup-message t) '(initial-scratch-message nil) '(line-number-mode t) '(mouse-wheel-follow-mouse t) '(mouse-wheel-mode t nil (mwheel)) '(mouse-yank-at-point t) '(org-log-done t) '(paren-mode (quote paren) nil (paren)) '(query-user-mail-address nil) '(show-paren-mode t nil (paren)) '(show-trailing-whitespace t) '(speedbar-navigating-speed 2 t) '(speedbar-update-speed 2 t) '(sql-product (quote postgres)) '(tab-width 8) '(tool-bar-mode nil nil (tool-bar)) '(toolbar-captioned-p nil) '(toolbar-visible-p nil) '(transient-mark-mode t) '(truncate-partial-width-windows nil) '(uniquify-buffer-name-style nil nil (uniquify)) '(user-full-name "Dirk Jagdmann") '(user-mail-address "doj@cubic.org")) (setq user-company-name "Cubic") (save-place-mode 1) (setq save-place-forget-unreadable-files nil) ; (scroll-bar-mode -1) ; disable scroll-bars (setq kill-whole-line t) ; will make "Ctrl-k" kills an entire line if the cursor is at the beginning of line ; (global-set-key [(meta g)] 'goto-line) (global-set-key [f1] (lambda () (interactive) (manual-entry (current-word)))) (global-set-key [(control f1)] 'ecb-activate) (global-set-key [(control shift f1)] 'ecb-deactivate) (global-set-key [(meta f1)] 'font-lock-mode) (global-set-key [f2] 'revert-buffer) (global-set-key [(control f2)] 'delete-trailing-whitespace) (global-set-key [f3] 'repeat-complex-command) (global-set-key [f4] 'add-change-log-entry) (global-set-key [f5] 'replace-string) (global-set-key [(control f5)] 'query-replace) (global-set-key [f6] 'replace-regexp) (global-set-key [(control f6)] 'query-replace-regexp) (global-set-key [f9] 'compile) (global-set-key [(control f9)] 'kill-compilation) (global-set-key [f10] 'next-error) (global-set-key [(shift f10)] 'flymake-goto-next-error) (global-set-key [(shift meta f10)] 'flymake-goto-prev-error) (global-set-key [(meta f10)] 'flymake-display-err-menu-for-current-line) (global-set-key [(control f10)] 'sort-lines) (global-set-key [f11] 'fill-region) (global-set-key [(control f11)] 'hide-ifdef-block) (global-set-key [(control shift f11)] 'show-ifdef-block) (global-set-key [f12] 'hs-show-block) (global-set-key [(control f12)] 'hs-hide-block) (global-set-key [(shift f12)] 'hs-show-all) (global-set-key [(control shift f12)] 'hs-hide-all) (global-set-key [Scroll_Lock] 'scroll-lock-mode) ; A wheel mouse that doesn't beep, unlike mwheel-install (defun scroll-me-up () (interactive) (scroll-up 20)) (defun scroll-me-down () (interactive) (scroll-down 20)) (defun scroll-me-up-a-bit () (interactive) (scroll-up 5)) (defun scroll-me-down-a-bit () (interactive) (scroll-down 5)) (define-key global-map [(button4)] 'scroll-me-down) (define-key global-map [(button5)] 'scroll-me-up) (define-key global-map [(shift button4)] 'scroll-me-down-a-bit) (define-key global-map [(shift button5)] 'scroll-me-up-a-bit) ; alternative buffer window (require 'bs) (global-set-key "\C-x\C-b" 'bs-show) ; do not break hard linked files (setq backup-by-copying-when-linked t) ; use aspell instead of ispell (setq-default ispell-program-name "aspell") ; start emacs in server mode (add-hook 'after-init-hook 'server-start) ; provide command 'uncomment-region' (defun uncomment-region (beg end) "Like `comment-region' invoked with a C-u prefix arg." (interactive "r") (comment-region beg end -1)) ; enable auto compression mode (auto-compression-mode 1) ; make scripts executable upon saving (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) ;; Make all yes/no prompts into y/n prompts (fset 'yes-or-no-p 'y-or-n-p) ;;; some code stolen from KDE emacs script ; Creates the ifndef/define/endif statements necessary for a header file (defun header-protection () (interactive) (let ((f (buffer-file-name))) (if (string-match "^.*/" f) (setq f (replace-match "" t t f))) (while (string-match "\\." f) (setq f (replace-match "__" t t f))) (save-excursion (goto-char (point-min)) (insert "#ifndef " (upcase f) "\n#define " (upcase f) "\n\n") (goto-char (point-max)) (insert "\n#endif\n") ) ) ) (defun insert-c-skeleton () (interactive) (insert "/* Copyright (c) ") (insert (format-time-string "%Y")) (insert (format " %s <%s> */\n\n" user-full-name user-mail-address)) (insert "#include \n\n") (insert "int main(int argc, char **argv)\n{\n\n return 0;\n}\n") (previous-line) (previous-line) (previous-line) ) (defun insert-select-skeleton () (interactive) (insert "/* #include */\n") (insert "int __maxfd__=-1;\n") (insert "fd_set rfds;\n") (insert "FD_ZERO(&rfds);\n") (insert "#define FD_ADD(fd) do { FD_SET(fd, &rfds); if(fd > __maxfd__) __maxfd__=fd; } while(0)\n") (insert "\n") (insert "#undef FD_ADD\n") (insert "struct timeval tv;\n") (insert "tv.tv_sec = 1;\n") (insert "tv.tv_usec = 0;\n") (insert "\n") (insert "const int __s__ = select(__maxfd__+1, &rfds, NULL, NULL, &tv);\n") (insert "if(__s__ < 0)\n") (insert " {\n") (insert " perror(\"select()\");\n") (insert " }\n") (insert "else if(__s__ == 0)\n") (insert " {\n") (insert " /* timeout */\n") (insert " }\n") (insert "else if(FD_ISSET(fd, &rfds))\n") (insert " {\n") (insert " }\n") ) (defun insert-trigger-skeleton () (interactive) (insert "CREATE OR REPLACE FUNCTION a()\n") (insert "RETURNS trigger\n") (insert "AS $BODY$\n") (insert " DECLARE\n") (insert " BEGIN\n") (insert " RETURN NEW;\n") (insert " END;\n") (insert "$BODY$ LANGUAGE plpgsql;\n") (insert "\n") (insert "CREATE TRIGGER a\n") (insert "BEFORE INSERT or UPDATE or DELETE ON \n") (insert "FOR EACH ROW EXECUTE PROCEDURE a();\n") ) ; add .pgc files to c++mode (autoload 'c++-mode "c++" "Major mode for C++ code." t) (setq auto-mode-alist (cons '("\.pgc$" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\.ipp$" . c++-mode) auto-mode-alist)) ; add wxWidgets stuff (require 'cc-mode) (add-to-list 'c++-font-lock-extra-types "\\bwx[A-Z][a-z][a-zA-Z]*?\\b") (defun c-wx-lineup-topmost-intro-cont (langelem) (save-excursion (beginning-of-line) (if (re-search-forward "EVT_" (line-end-position) t) 'c-basic-offset (c-lineup-topmost-intro-cont langelem)))) (setq c++-mode-hook (lambda () (c-set-offset 'topmost-intro-cont 'c-wx-lineup-topmost-intro-cont))) ; customize CPerl mode (defun doj-cperl-setup () (cperl-set-style "C++")) (add-hook 'cperl-mode-hook 'doj-cperl-setup) (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\|t\\)\\'" . cperl-mode)) (add-to-list 'interpreter-mode-alist '("env perl" . cperl-mode)) (defalias 'perl-mode 'cperl-mode) (defun insert-perl-skeleton () (interactive) (insert "#!/usr/bin/env perl\n# $Header: /home/doj/a/www/doj/emacs,v 1.4 2011-03-20 23:40:36 doj Exp $\n# Copyright (c) ") (insert (format-time-string "%Y")) (insert (format " %s <%s>\n" user-full-name user-mail-address)) (insert "\n") (insert "while(<>)\n{\n chomp;\n\n print \"$_\\n\";\n}\n") (previous-line) (previous-line) (previous-line) ) ; from http://www.emacswiki.org/cgi-bin/wiki/ChangingEncodings (defun recode-region (start end &optional coding-system) "Replace the region with a recoded text." (interactive "r\n\zCoding System (utf-8): ") (setq coding-system (or coding-system 'utf-8)) (let ((buffer-read-only nil) (text (buffer-substring start end))) (delete-region start end) (insert (decode-coding-string (string-make-unibyte text) coding-system)))) ;;; buffer-charsets.el --- show usage of charsets in a buffer ;; Displays list of charsets used in current buffer. (require 'hi-lock) (defun charset-chars-regexp (charset) (let ((dim (charset-dimension charset)) (chars (charset-chars charset)) (plane (charset-iso-graphic-plane charset)) min max) (cond ((eq charset 'eight-bit-control) (setq min 128 max 159)) ((eq charset 'eight-bit-graphic) (setq min 160 max 255)) (t (if (= chars 94) (setq min 33 max 126) (setq min 32 max 127)) (or (= plane 0) (setq min (+ min 128) max (+ max 128))))) (if (= dim 1) (format "[%c-%c]" (make-char charset min) (make-char charset max)) (format "[%c-%c]" (make-char charset min min) (make-char charset max max))))) (defun buffer-charsets () (find-charset-region (point-min) (point-max))) (defun display-buffer-charsets () "Displays list of charsets used in current buffer" (interactive) (let ((charsets (buffer-charsets)) (curr-buf-name (current-buffer))) (with-output-to-temp-buffer "*Buffer Charsets*" (save-excursion (set-buffer standard-output) (insert (format "Buffer %s uses the following charsets:\n" curr-buf-name)) (while charsets (insert (symbol-name (car charsets))) (insert "\n") (setq charsets (cdr charsets))))))) (defun charset-alist (charset-list) (let ((l (charset-list)) charset-alist) (while l (setq charset-alist (cons (list (symbol-name (car l))) charset-alist)) (setq l (cdr l))) charset-alist)) (defun show-buffer-charset-characters (charset face) "Uses hi-lock-mode to highlight by face characters of charset." (interactive (let ((completion-ignore-case t)) (list (completing-read "Charset:" (charset-alist (buffer-charsets)) nil t nil nil) (hi-lock-read-face-name)))) (highlight-regexp (charset-chars-regexp (intern charset)) face)) (defun unhighlight-charset (charset) (interactive (let ((completion-ignore-case t)) (list (completing-read "Charset:" (charset-alist (buffer-charsets)) nil t nil nil)))) (unhighlight-regexp (charset-chars-regexp (intern charset)))) ;(define-key hi-lock-map "\C-xwc" 'show-buffer-charset-characters) ;(define-key hi-lock-map "\C-xwu" 'unhighlight-charset) ; po-mode (setq auto-mode-alist (cons '("\\.po\\'\\|\\.po\\." . po-mode) auto-mode-alist)) (autoload 'po-mode "po-mode" "Major mode for translators to edit PO files" t) ;(modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\." 'po-find-file-coding-system) ;(autoload 'po-find-file-coding-system "po-mode") ;; set time to show in corner (setq display-time-day-and-date t) (display-time) ; cycle buffers with C-Tab, ignoring uninteresting ones ; ripped from http://www.dotemacs.de/dotfiles/KilianAFoth.emacs.html (defun backward-buffer () (interactive) "Switch to previously selected buffer." (let* ((list (cdr (buffer-list))) (buffer (car list))) (while (and (cdr list) (string-match "\\*" (buffer-name buffer))) (progn (setq list (cdr list)) (setq buffer (car list)))) (bury-buffer) (switch-to-buffer buffer))) (defun forward-buffer () (interactive) "Opposite of backward-buffer." (let* ((list (reverse (buffer-list))) (buffer (car list))) (while (and (cdr list) (string-match "\\*" (buffer-name buffer))) (progn (setq list (cdr list)) (setq buffer (car list)))) (switch-to-buffer buffer))) (global-set-key [(control tab)] 'backward-buffer) (global-set-key [(control shift tab)] 'forward-buffer) ; kill current buffer without confirmation ; ripped from http://www.dotemacs.de/dotfiles/DaveGallucci.emacs.html (defun kill-current-buffer () "Kill the current buffer, without confirmation." (interactive) (kill-buffer (current-buffer))) (global-set-key "\C-xk" 'kill-current-buffer) ;convert a buffer from dos ^M end of lines to unix end of lines (defun dos2unix () (interactive) (goto-char (point-min)) (while (search-forward "\r" nil t) (replace-match ""))) (defun turn-to-unix () (interactive) (set-buffer-file-coding-system 'iso-8859-1-unix)) (defun insert-time () (interactive) (insert (format-time-string "%Y-%m-%d"))) (defun insert-libpng-license () (interactive) (setq doj-startpos (point)) (insert "Copyright (c) ") (insert (format-time-string "%Y")) (insert (format " %s <%s>\n" user-full-name user-mail-address)) (insert "\n") (insert "This software is provided 'as-is', without any express or implied\n") (insert "warranty. In no event will the authors be held liable for any damages\n") (insert "arising from the use of this software.\n") (insert "\n") (insert "Permission is granted to anyone to use this software for any purpose,\n") (insert "including commercial applications, and to alter it and redistribute it\n") (insert "freely, subject to the following restrictions:\n") (insert "\n") (insert " 1. The origin of this software must not be misrepresented; you\n") (insert " must not claim that you wrote the original software. If you use\n") (insert " this software in a product, an acknowledgment in the product\n") (insert " documentation would be appreciated but is not required.\n") (insert "\n") (insert " 2. Altered source versions must be plainly marked as such, and\n") (insert " must not be misrepresented as being the original software.\n") (insert "\n") (insert " 3. This notice may not be removed or altered from any source\n") (insert " distribution.\n") (insert "\n") (insert "$Header: /home/doj/a/www/doj/emacs,v 1.4 2011-03-20 23:40:36 doj Exp $\n") (setq doj-endpos (point)) (comment-region doj-startpos doj-endpos) ) (defun insert-zlib-license () (insert-libpng-license) ) (defun insert-gpl () (interactive) (setq doj-startpos (point)) (insert "Copyright (c) ") (insert (format-time-string "%Y")) (insert (format " %s <%s>\n" user-full-name user-mail-address)) (insert "\n") (insert "This program is free software; you can redistribute it and/or modify\n") (insert "it under the terms of the GNU General Public License as published by\n") (insert "the Free Software Foundation; either version 2 of the License, or\n") (insert "(at your option) any later version.\n") (insert "\n") (insert "This program is distributed in the hope that it will be useful,\n") (insert "but WITHOUT ANY WARRANTY; without even the implied warranty of\n") (insert "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n") (insert "GNU General Public License for more details.\n") (insert "\n") (insert "You should have received a copy of the GNU General Public License\n") (insert "along with this program; if not, write to the Free Software\n") (insert "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n") (insert "\n") (insert "$Header: /home/doj/a/www/doj/emacs,v 1.4 2011-03-20 23:40:36 doj Exp $\n") (setq doj-endpos (point)) (comment-region doj-startpos doj-endpos) ) (defun insert-bsd-license () (interactive) (setq doj-startpos (point)) (insert "Copyright (c) ") (insert (format-time-string "%Y")) (insert (format ", %s <%s>\n" user-full-name user-mail-address)) (insert "All rights reserved.\n") (insert "\n") (insert "Redistribution and use in source and binary forms, with or\n") (insert "without modification, are permitted provided that the following\n") (insert "conditions are met:\n") (insert "\n") (insert " * Redistributions of source code must retain the above copyright\n") (insert " notice, this list of conditions and the following disclaimer.\n") (insert " * Redistributions in binary form must reproduce the above\n") (insert " copyright notice, this list of conditions and the following\n") (insert " disclaimer in the documentation and/or other materials\n") (insert " provided with the distribution.\n") (insert " * Neither the name of ") (insert (format "%s" user-company-name)) (insert " nor the names of its\n") (insert " contributors may be used to endorse or promote products\n") (insert " derived from this software without specific prior written\n") (insert " permission.\n") (insert "\n") (insert "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n") (insert "\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n") (insert "LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n") (insert "A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n") (insert "HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n") (insert "SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n") (insert "LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n") (insert "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n") (insert "THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n") (insert "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n") (insert "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n") (setq doj-endpos (point)) (comment-region doj-startpos doj-endpos) ) (defun insert-ldr-header () (setq fn (file-name-nondirectory(buffer-file-name (window-buffer (minibuffer-selected-window))))) (interactive) (insert (format "0 FILE %s\n" fn)) (insert "0 \n") (insert (format "0 Name: %s\n" fn)) (insert (format "0 Author: %s <%s> [%s]\n" user-full-name user-mail-address user-login-name)) (insert "0 Website: \n") (insert "0 URL: \n") (insert "0 LastChanged: $Date$\n") (insert "0 !LDRAW_ORG Unofficial_Model\n") (insert "0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt\n") (insert "0 !THEME \n") (insert "0 !KEYWORDS words, more words,\n") (insert (format "0 !HISTORY %s [%s] first version\n" (format-time-string "%Y-%m-%d") user-login-name)) ) ; convert end-of-line style (defun set-buffer-eol-conversion (type) "Convert buffer to TYPE line endings. TYPE should be one of the symbols: unix, dos, mac." (let ((old-bfcs buffer-file-coding-system)) (set-buffer-file-coding-system (coding-system-change-eol-conversion (cond ((null buffer-file-coding-system) 'undecided) ((eq buffer-file-coding-system 'no-conversion) 'raw-text) (buffer-file-coding-system)) type)) (unless (eq old-bfcs buffer-file-coding-system) ;; Larry Smith: This may be necessary to remove ^Ms when going ;; from unix to dos. FJW: When else? (if (eq type 'dos) (decode-coding-region (point-min) (point-max) buffer-file-coding-system)) (message "Coding system changed from %s to %s." old-bfcs buffer-file-coding-system) ))) (defun set-buffer-eol-conversion-unix () "Convert buffer to UNIX line endings" (interactive "*") (set-buffer-eol-conversion 'unix)) (defun set-buffer-eol-conversion-dos () "Convert buffer to MS-DOS line endings" (interactive "*") (set-buffer-eol-conversion 'dos)) (defun set-buffer-eol-conversion-mac () "Convert buffer to Macintosh line endings" (interactive "*") (set-buffer-eol-conversion 'mac)) (define-key global-map (vector '(control x) '(control m) ?:) 'set-buffer-eol-conversion-unix) (define-key global-map (vector '(control x) '(control m) ?\\) 'set-buffer-eol-conversion-dos) (define-key global-map (vector '(control x) '(control m) ?/) 'set-buffer-eol-conversion-mac) ; http://www.emacswiki.org/cgi-bin/wiki/AsciiTable (defun ascii-table () "Display basic ASCII table (0 thru 128)." (interactive) (switch-to-buffer "*ASCII*") (erase-buffer) (save-excursion (let ((i -1)) (insert "ASCII characters 0 thru 127.\n\n") (insert " Hex Dec Char| Hex Dec Char| Hex Dec Char| Hex Dec Char\n") (while (< i 31) (insert (format "%4x %4d %4s | %4x %4d %4s | %4x %4d %4s | %4x %4d %4s\n" (setq i (+ 1 i)) i (single-key-description i) (setq i (+ 32 i)) i (single-key-description i) (setq i (+ 32 i)) i (single-key-description i) (setq i (+ 32 i)) i (single-key-description i))) (setq i (- i 96)))))) ; http://www.emacswiki.org/cgi-bin/wiki/ModeCompile ;; Helper for compilation. Close the compilation window if ;; there was no error at all. (defun compilation-exit-autoclose (status code msg) ;; If M-x compile exists with a 0 (when (and (eq status 'exit) (zerop code)) ;; then bury the *compilation* buffer, so that C-x b doesn't go there (bury-buffer) ;; and delete the *compilation* window (delete-window (get-buffer-window (get-buffer "*compilation*")))) ;; Always return the anticipated result of compilation-exit-message-function (cons msg code)) ;; Specify my function (maybe I should have done a lambda function) ;(setq compilation-exit-message-function 'compilation-exit-autoclose) ; javascript mode (require 'generic-x) (when (locate-library "javascript") (autoload 'javascript-mode "javascript" nil t) (add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode)) (set-variable 'javascript-indent-level 2) ) ; reload the init file (defun reload-init-file () "Reload the .emacs file" ( interactive "*" ) (load-file "~/.emacs")) ; make TAGS (defun tags-generate-c-file () "generate TAGS file from c sources" (interactive) (setq shell-file-name "/bin/sh") (shell-command "etags *.cc *.hh *.c *.h *.cpp *.hpp 2>/dev/null")) ; turn on terminal type colors (defun black-background () "Switches colors to white on black." (interactive) (set-background-color "block") (set-foreground-color "white") (set-cursor-color "gray") ; (set-default-font "-outline-Times New Roman-normal-r-normal-normal-*-*-96-96-p-*-iso8859-1") ) ;;;;Use ANSI colors within shell-mode (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) ;;;;Change pasting behavior. Normally, it pastes where the mouse ;;;;is at, which is not necessarily where the cursor is. This changes ;;;;things so all pastes, whether they be middle-click or C-y or menu, ;;;;all paste at the cursor. (setq mouse-yank-at-point t) ;;;;The autosave is typically done by keystrokes, but I'd like to save ;;;;after a certain amount of time as well. (setq auto-save-timeout 1800) ;;;;What it says. Keeps the cursor in the same relative row during ;;;;pgups and dwns. (setq scroll-preserve-screen-position t) ;;;;;Accelerate the cursor when scrolling. (load "accel" t t) ;;;;This apparently allows seamless editting of files in a tar/jar/zip ;;;;file. (auto-compression-mode 1) ;; This function will format the whole file for you (defun indent-whole-buffer () (interactive) (indent-region (point-min) (point-max) nil)) ;; povray-mode (add-to-list 'load-path "~/.emacs.d/pov-mode") (autoload 'pov-mode "pov-mode" "POV-Ray scene file mode" t) (add-to-list 'auto-mode-alist '("\\.pov\\'" . pov-mode)) (add-to-list 'auto-mode-alist '("\\.inc\\'" . pov-mode))