;;; -*- emacs-lisp -*- ;;;; Initialization of paths (setq xemacsp (or (featurep 'sxemacs) (featurep 'xemacs)) sxemacsp (and (featurep 'sxemacs) (featurep 'xemacs)) prefix "/homes/algebra/freundt/usr/local" natdir (format "%s/lib/sxemacs-%d.%d.%d/lisp" prefix emacs-major-version emacs-minor-version emacs-beta-version) pkgdir (format "%s/share/sxemacs/pack/xemacs-packages/" prefix) muldir (format "%s/share/sxemacs/pack/mule-packages" prefix) extdir (format "%s/share/sxemacs/packages/" prefix) sitdir (format "%s/share/sxemacs/site-packages" prefix) myldir "/homes/algebra/freundt/mylisp" ;; now the hierarchies hierarchies ;;'(natdir muldir pkgdir extdir sitdir myldir) '(extdir myldir)) (when (or sxemacsp xemacsp) (setq lispdir extdir)) ;;(add-to-list 'Info-directory-list "/usr/site-local/info") ;;(add-to-list 'Info-directory-list (concat (getenv "lispdir") "/../info")) ;;(add-to-list 'Info-directory-list (concat (getenv "SRC") "/gnus/texi")) (mapc-internal #'(lambda (hier) (set (intern (format "%s-loads" hier)) (cons (eval hier) (directory-files-recur (eval hier) t nil t nil 0))) (set (intern (format "%saa-loads" hier)) (directory-files-recur (eval hier) t "auto-autoloads.el$" t nil nil nil))) hierarchies) (setq load-path (append (mapcar #'eval (reverse hierarchies)) load-path)) (mapc-internal #'(lambda (hier) (mapc #'(lambda (file) (condition-case nil (progn (load-file file) (setq load-path (cons (file-name-directory file) load-path))) (error nil))) (eval (intern (format "%saa-loads" hier)))) (mapc #'(lambda (dir) (condition-case nil (setq load-path (cons dir load-path) load-path (cons (expand-file-name "lisp" dir) load-path)) (error nil))) (eval (intern (format "%s-loads" hier))))) hierarchies) (custom-set-variables '(toolbar-visible-p nil)) ;; (defun myemacs-correct-build-time () ;; (setq emacs-build-time (format-time-string "%D %T" (current-time)))) ;; (add-to-list 'load-path "~/mylisp") ;; (add-to-list 'load-path (concat site-lispdir "/ProofGeneral/generic/")) ;; (add-to-list 'load-path (concat lispdir "/bbdb/bits/")) ;;(setq data-directory-list nil) ;(add-to-list 'data-directory-list pkgdir) ;(add-to-list 'data-directory-list extdir) ;; (and sxemacsp ;; (mapcar (lambda (subdir) ;; (let ((add (file-name-as-directory subdir))) ;; (add-to-list 'data-directory-list add))) ;; (directory-files-recur pkgdir t "etc$" t 'subdirs))) ;; (add-to-list 'data-directory-list (expand-file-name "../etc" pkgdir)) ;;; things that are mangled on my machine (setq gnus-xmas-glyph-directory (expand-file-name "gnus/etc" lispdir)) (setq ps-postscript-code-directory data-directory) (setq sgml-data-directory data-directory) (setq smiley-data-directory (concat data-directory "smilies")) (set-time-zone-rule "UTC0") ;;;; Requiries ;; commented lines are things I would like to use, ;; but they are not set up correctly, yet (require 'atode) (require 'backup-dir) (require 'bbdb) (require 'bm) (require 'browse-kill-ring) (require 'bs) (require 'cc-fonts) (require 'certs) ;;(require 'cl) (require 'color-eldoc) (require 'completion) (require 'cparen) (require 'filladapt) ;;(require 'func-menu) ;;(require 'gse-rename) (require 'hippie-exp) (require 'iswitchb) ;;(require 'kash) ;;(require 'kash-mode) ;;(require 'keypatt) (require 'latin-unity) (require 'mic-paren) ;;(require 'mmm-mode) (require 'moy-bbdb) ;(require 'msn) (require 'mtorus) ;;(require 'mtrace) (require 'mule) ;;(require 'multr) (require 'mule-uni) (require 'mucs) (and window-system (require 'mwheel)) (require 'net-utils) (require 'pabbrev) (require 'quail) (require 'rsz-minibuf) (require 'saveconf) (require 'savehist) (require 'saveplace) (load-file "~/mylisp/my-profile.el") ;; (setq tramp-load-time ;; (my-profile-time ;; (require 'tramp))) (require 'un-define) (require 'unicode) (require 'url) (require 'x-symbol) (require 'xetla) ;;;; Autoload Initialization ;; autoloads (autoload 'auto-capitalize-mode "auto-capitalize" "Toggle `auto-capitalize' minor mode in this buffer." t) (autoload 'turn-on-auto-capitalize-mode "auto-capitalize" "Turn on `auto-capitalize' minor mode in this buffer." t) (autoload 'camelCase-mode "camelCase-mode" "Turn on `camelCase' minor mode in this buffer." t) (autoload 'enable-auto-capitalize-mode "auto-capitalize" "Enable `auto-capitalize' minor mode in this buffer." t) (autoload 'folding-mode "folding" "Folding mode" t) ;; lispdir is useful and should work (autoload 'format-lisp-code-directory "lispdir" nil t) (autoload 'grep "igrep" "Add igrep text search to tools menu." t) (autoload 'hexl-find-file "hexl" "Edit file FILENAME in hexl-mode." t) (autoload 'hexl-follow-ascii "hexl-xtra.el" "Toggle following ASCII in Hexl buffers." t) ;; HTML helper (autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t) (autoload 'igrep "igrep" "Add igrep text search to tools menu." t) (autoload 'lisp-dir-apropos "lispdir" nil t) (autoload 'lisp-dir-retrieve "lispdir" nil t) (autoload 'lisp-dir-verify "lispdir" nil t) (autoload 'remember "remember" nil t) (autoload 'remember-region "remember" nil t) (autoload 'todo-mode "todo-mode" "Major mode for editing TODO lists." t) (autoload 'todo-show "todo-mode" "Show TODO items." t) (autoload 'todo-insert-item "todo-mode" "Add TODO item." t) (autoload 'turn-on-eldoc-mode "eldoc" nil t) (autoload 'completing-help-mode "completing-help" "Toggle a facility to display information on completions." t nil) (autoload 'turn-on-completing-help-mode "completing-help" "Turn on a facility to display information on completions." t nil) (autoload 'turn-off-completing-help-mode "completing-help" "Turn off a facility to display information of completions." t nil) (autoload 'turn-on-bib-cite "bib-cite" nil t) (autoload 'mapreplace-string "mapreplace" nil t) (autoload 'mapreplace-regexp "mapreplace" nil t) (autoload 'query-mapreplace "mapreplace" nil t) (autoload 'query-mapreplace-regexp "mapreplace" nil t) (autoload 'imenu-go-find-at-position "imenu-go" "Go to the definition of the current word." t) (autoload 'imenu-go--back "imenu-go" "Return back to a position saved during `imenu-go-find-at-position'." t) (autoload 'imenu-create-hierarchical-index "hier-imenu" "Generate an alist for imenu from a buffer with hierarchical structure.") (autoload 'hier-imenu-dtd-setup "hier-imenu" "Scan buffer for a DTD and set `hier-imenu' parameters accordingly.") (autoload 'comment-out-region "comment" nil t) (autoload 'wdired-change-to-wdired-mode "wdired") (autoload 'pgg-encrypt-region "pgg" "Encrypt the current region." t) (autoload 'pgg-decrypt-region "pgg" "Decrypt the current region." t) (autoload 'pgg-sign-region "pgg" "Sign the current region." t) (autoload 'pgg-verify-region "pgg" "Verify the current region." t) (autoload 'pgg-insert-key "pgg" "Insert the ASCII armored public key." t) (autoload 'pgg-snarf-keys-region "pgg" "Import public keys in the current region." t) ;; psgml (autoload 'sgml-mode "psgml" "Major mode for editing SGML" t) (autoload 'xml-mode "psgml" "Major mode for editing XML" t) ;;;; Special CAS section ;; CAS autoloads (autoload 'cocoa "cocoa.el" "CoCoA running mode" 't) (autoload 'cocoa-mode "cocoa.el" "CoCoA editing mode" 't) (autoload 'singular "singular" "Start Singular using default values." t) (autoload 'singular-other "singular" "Ask for arguments and start Singular." t) ;;; too heavy? (setq reportmail-time nil reportmail-interval 60 reportmail-match-using-regexps t ;; reportmail-junk-mail-checklist '(("From" "Mail System") ;; ("From" "^.+yahoo\\.") ;; ("From" "^.*root@math")) reportmail-incoming-mail-file "/var/mail/freundt") (load-file (expand-file-name "misc/reportmail.el" lispdir)) ;;(load-file (concat (getenv "lispdir") "/jukebox/mpg123.el")) (defun hrop-perm-lines (perm) "" (interactive "sPerm: ") (let ((perm (mapcar #'string-to-int (split-string perm " " t)))) perm)) ;;;; Some additional init-files (mapc (lambda (file) (load-file (expand-file-name file "~"))) '(;;".menubar" ".sxemacs/.abbrev" ".sxemacs/.tex" ".sxemacs/.mtorus" ".sxemacs/.howm" ".sxemacs/.keys" ".sxemacs/.sounds" ;;".sxemacs/.smileys" ".sxemacs/.psgml" ;;".sxemacs/.jabber" ;;".sxemacs/.semantic" ;;".sxemacs/.patcher" ;;".sxemacs/.emeteo" ;;".sxemacs/.eicq" ".sxemacs/.certs" ".sxemacs/.scripts" ".sxemacs/eshell/.eshell" ".sxemacs/.faces" ;;".sxemacs/.wiki" )) (set-random-bg-face) ;; Setting up things we've loaded ;; inits, calls, etc. (put 'narrow-to-region 'disabled nil) (put 'erase 'disabled nil) ;; completions (initialize-completions) ;;; SXE C style setup (defun my-c-set-style-SXE (&rest ignore) (interactive) (require 'filladapt) (turn-on-auto-fill) (turn-on-filladapt-mode) (set-fill-column 80) (setq tab-width 8 indent-tabs-mode t) (c-set-style "linux")) (defun my-c-set-style-ME (&rest ignore) (interactive) (setq tab-width 2 indent-tabs-mode nil) (c-set-style "gnu")) (setq build-rpt-use-gnus-p t build-rpt-use-gnus-group "nnml:mail.devel.SXEmacs.builds") ;;; emeteo ;;;; moved to .emeteo (when (fboundp #'table-disable-advice) (table-disable-advice)) ;;; some frame fiddling (setq frame-title-format (concat (getenv "HOSTNAME") "@" (getenv "GNU_PORT") ":%b %f %n (%s) %C %[")) ;;; modeline fiddling (setq modeline-format (setq-default modeline-format (list "" "%C" (cons modeline-modified-extent 'modeline-modified) (cons modeline-buffer-id-extent (list 'line-number-mode "L%l ")) (cons modeline-buffer-id-extent (list 'column-number-mode "C%c ")) (cons modeline-buffer-id-extent (cons -3 "%p")) " " (cons modeline-buffer-id-extent 'modeline-buffer-identification) " %n" " " 'global-mode-string " %[(" (cons modeline-minor-mode-extent (list "" 'mode-name 'minor-mode-alist)) (cons modeline-narrowed-extent "%n") 'modeline-process ")%]----" "-%-"))) (line-number-mode 1) (column-number-mode 1) (setq-default tab-width 8) ;; (setq-default tab-width 2) ;;(setq initial-major-mode 'emacs-lisp-mode) ;; mwheel (mwheel-install) ;; X-Symbol (x-symbol-initialize) (if (featurep 'x-symbol) (x-symbol-init-grid/menu)) (turn-on-x-symbol-conditionally) ;; misc. (auto-compression-mode 1) (camelCase-mode 1) (auto-capitalize-mode 1) (hexl-follow-ascii) (recent-files-initialize) ;(bookmark-load "~/.emacs.bmk") ;;(winring-initialize) (savehist-load) (setq savehist-coding-system 'iso-2022-8) ;; just for now ;;(iswitchb-default-keybindings) ;;(isearchb-activate) ;;(icomplete-mode) ;;(turn-on-permanent-buffers) ;;(turn-on-completing-help-mode) ;;(resize-minibuffer-mode) ;;;; Additional settings and variable customization (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt) (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m) (add-hook 'hexl-mode-hook 'hexl-follow-ascii) ;;(add-hook 'find-file-hooks 'fume-add-menubar-entry) (add-hook 'emacs-lisp-mode-hook #'turn-on-eldoc-mode) (add-hook 'emacs-lisp-mode-hook #'imenu-add-menubar-index) (add-hook 'emacs-lisp-mode-hook #'turn-on-font-lock) (add-hook 'emacs-lisp-mode-hook #'turn-on-auto-fill) (add-hook 'emacs-lisp-mode-hook #'turn-on-filladapt-mode) (add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode) ;;(add-hook 'lisp-interaction-mode-hook 'font-lock-mode) (add-hook 'ielm-mode-hook 'turn-on-eldoc-mode) (add-hook 'tex-mode-hook 'imenu-add-menubar-index) (add-hook 'sgml-mode-hook 'hier-imenu-dtd-setup) (add-hook 'html-mode-hook 'hier-imenu-dtd-setup) (add-hook 'html-mode-hook 'hm--html-minor-mode 1) (add-hook 'emacs-lisp-mode-hook (lambda () (setq fill-column 80) (setq indent-tabs-mode nil))) (add-hook 'c++-mode-hook (function (lambda () (font-lock-mode 1))) ;;(function (lambda () (gtags-mode 1))) ) (defun my-c/java-mode-hook-fun () ;;(gtags-mode 1) ;;(camelCase-mode 1) ;;(imenu-add-menubar-index) ;;(c-toggle-auto-newline 1) ;;(c-toggle-electric-state 1) ;;(c-subword-mode 1) (font-lock-mode 1) (my-c-set-style-SXE)) (defun my-nbjava-mode-hook-fun () (require 'filladapt) (turn-on-auto-fill) (turn-on-filladapt-mode) (set-fill-column 80) (setq tab-width 8 indent-tabs-mode nil) (c-set-style "java")) (add-hook 'c-mode-hook #'my-c/java-mode-hook-fun) (add-hook 'java-mode-hook #'my-nbjava-mode-hook-fun) (add-hook 'scheme-mode-hook #'turn-on-filladapt-mode) ;;(remove-hook 'kill-emacs-hook 'timeclock-query-out) ;(add-hook 'dired-after-readin-hook 'highline-on) (add-hook 'write-file-hooks 'time-stamp) (add-hook 'kash-mode-hook #'(lambda () (font-lock-mode 1) (camelCase-mode 1))) (add-hook 'sh-mode-hook #'(lambda () (local-unset-key [tab]))) ;; Mail ;; hooks zur bbdb (add-hook 'bbdb-change-hook 'bbdb-creation-date-hook) (add-hook 'bbdb-change-hook 'bbdb-timestamp-hook) (add-hook 'bbdb-after-change-hook (lambda (&rest ignore) (bbdb-resort-database) (bbdb-save-db))) ;; CAS (add-hook 'cocoa-mode-hook '(lambda () (font-lock-mode 't) (abbrev-mode 't))) (defadvice list-buffers (after highlight-line activate) (save-excursion (set-buffer "*Buffer List*") (highline-on))) ;;; W3m ;;(setq w3m-icon-directory (concat (getenv "lispdir") "/emacs-w3m/icons30/")) ;;; TRAMP (setq tramp-default-method "scp") (setq tramp-default-method-alist nil) (add-to-list 'tramp-default-method-alist '("" "freundt" "scp")) (add-to-list 'tramp-default-method-alist '("\\`localhost\\'" "\\`root\\'" "su")) ;; (tramp-set-completion-function "ssh" ;; '((tramp-parse-sconfig "/etc/ssh_config") ;; (tramp-parse-sconfig "~/.ssh/config"))) (setq tramp-shell-prompt-pattern "^.+?<.+?>%" tramp-remote-path (split-string (getenv "PATH") ":") tramp-process-echos nil tramp-auto-save-directory "~/.autosave" tramp-bkup-backup-directory-info '( (t "~/.autosave/" ok-create full-path) )) ;;; GAP (setq gap-process-string "gap" gap-start-options '("-l" "/net/muck.home/kantmp/gap/" "-n")) ;;; PCL-CVS (setq cvs-buffer-name '(format "*cvs%s*" (let ((dir (replace-regexp-in-string "^.+/\\([^/]+\\).?$" "\\1" (expand-file-name dir)))) (if dir (format " (%s)" dir) "")))) ;;; iswitchb (setq iswitchb-method 'maybe-frame iswitchb-default-method 'maybe-frame) ;;; clipboards ;; (setq selected-text-type nil ;; selection-coercible-types nil ;; selection-coercion-alist nil ;; selection-appender-alist nil ;; selection-converter-alist nil) ;; (setq interprogram-cut-function nil ;; interprogram-paste-function nil ;;#'get-clipboard-foreign ;; x-selection-strict-motif-ownership nil) (setq-default selection-converter-in-alist '((INTEGER . select-convert-from-integer) (TIMESTAMP . select-convert-from-integer) (LENGTH . select-convert-from-integer) (LIST_LENGTH . select-convert-from-integer) (CLIENT_WINDOW . select-convert-from-integer) (PROCESS . select-convert-from-integer) (IP_ADDRESS . select-convert-from-ip-address) (CF_TEXT . select-convert-from-cf-text) (text/html . select-convert-from-utf16-le-text) (text/_moz_htmlcontext . select-convert-from-utf16-le-text) (text/_moz_htmlinfo . select-convert-from-utf16-le-text))) ;; AutoModes (add-to-list 'auto-mode-alist '("\\.\\(coc\\|cocoa\\|cocoarc\\|pkg\\|ts\\)\\'" . cocoa-mode)) (add-to-list 'auto-mode-alist '("\\.siv\\'" . sieve-mode)) (add-to-list 'auto-mode-alist '("\\.[ch]+\\'" . c-mode)) (add-to-list 'auto-mode-alist '("\\.sing\\'" . c++-mode)) (add-to-list 'auto-mode-alist '("\\.lib\\'" . c++-mode)) (add-to-list 'auto-mode-alist '("\\.\\(tex\\|ltx\\|ind\\|sty\\)\\'" . TeX-latex-mode)) (add-to-list 'auto-mode-alist '("\\.bib\\'" . bibtex-mode)) ;;(add-to-list 'auto-mode-alist '("\\.g[id]?\\'" . kash-mode)) ;;(add-to-list 'auto-mode-alist '("\\.k[id]?\\'" . kash-mode)) ;;(add-to-list 'auto-mode-alist '("\\.grp\\'" . kash-mode)) (add-to-list 'auto-mode-alist '("\\.html$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.shtml$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.xhtml$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.asp$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.phtml$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.lsh\\'" . lisp-mode)) ;;(remassoc "\\.\\(tex\\|ltx\\|ind\\|sty\\)\\'" auto-mode-alist) ;;(setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.java\\'" . java-mode) auto-mode-alist)) (setq auto-save-directory "~/.autosave" auto-save-timeout nil auto-save-default nil) (setq buffers-menu-grouping-function 'group-buffers-menu-by-mode-then-alphabetically buffers-menu-submenus-for-groups-p t buffers-menu-max-size nil buffers-tab-max-size nil) (setq-default kill-whole-line t) (setq news-reply-header-hook nil) ;; calendar settings (setq calendar-latitude 52.51) (setq calendar-longitude 13.32) (setq calendar-location-name "Berlin, D") (setq european-calendar-style t) (setq calendar-week-start-day 1) (setq ;;display-time-icons-dir (locate-data-directory "time") display-time-24hr-format 1 display-time-day-and-date t) (setq paren-sexp-mode t) (setq complex-buffers-menu-p t) (setq truncate-lines nil truncate-partial-width-windows nil) (setq-default truncate-lines nil truncate-partial-width-windows nil) (setq progress-feedback-use-echo-area t) (setq buffer-menu-format-buffer-line-function 'slow-format-buffers-menu-line buffer-list-changed-hook nil) ;; gpg, mailcrypt, mail (setq mml2015-use 'gpg) ;;(setq mml2015-use 'mailcrypt) (setq gpg-passphrase-timeout 600 gpg-temp-directory (expand-file-name '"~/.gnupg") gpg-command-default-alist (quote ((gpg . "gpg") (gpg-2comp . "gpg"))) gpg-default-key-id "0xd0c56486" mm-decrypt-option 'always mm-verify-option 'always) (setq pgg-default-user-id "0xd0c56486" pgg-gpg-user-id "0xd0c56486" pgg-gpg-program "gpg") (setq passwd-echo nil passwd-history nil password-cache t password-cache-expiry 60) ;; gnats (setq gnats:root "/net/kant/gnats/kant") ;; matlab (setq matlab-indent-function t) ;; XEtla (set-alist 'xetla-buffer-type-alist 'inventory '((format "*xetla-inventory%s*" (let ((dir (replace-regexp-in-string "^.+/\\([^/]+\\).?$" "\\1" (expand-file-name path)))) (if dir (format " (%s)" dir) ""))))) (setq xetla-tips-enabled nil) (load-file "~/mylisp/xetla/ewoc.el") ;;; Unicode zeugs ;;(latin-unity-install) ;; bbdb (bbdb-initialize 'gnus 'message 'w3 'supercite) (setq bbdb/news-auto-create-p 'bbdb-ignore-most-messages-hook bbdb/mail-auto-create-p 'bbdb-ignore-most-messages-hook bbdb-ignore-most-messages-alist '(("To" . "Sebastian Freundt\\|freundt@math.tu-berlin.de")) bbdb-ignore-some-messages-alist '(("From" . "daemon") ("From" . "abuse@") ("From" . "news@") ("From" . "cron") ("From" . "root@") ("From" . "Gmane Autoauthorizer") ("To" . "Gmane Autoauthorizer") ("From" . "noreply@") ("From" . "prontomail") ("From" . "majordomo") ("From" . "postmaster") ("From" . "quota") ("Subject" . "MAILER DAEMON") ("From" . "Mail Delivery Subsystem"))) (setq bbdb-display-layout 'multi-line) (setq bbdb-notice-hook 'bbdb-auto-notes-hook) (setq bbdb-auto-notes-alist '(("Organization" (".*" company 0)) ("Newsgroup" ("[^,]+" newsgroups 0)) ;;("Subject" (".*" last-subj 0 t)) ("User-Agent" (".*" mailer 0)) ("X-Newsreader" (".*" mailer 0)) ("X-gpg-key-ID" (".*" key 0)) ("X-Mailer" (".*" mailer 0)) ("X-URL" (".*" url 0)) ("X-Face" (".+" face 0 'replace)) ("Face" (".+" cface 0 'replace)))) ;;(put 'face 'field-separator "\n") ;;(put 'cface 'field-separator "\n") (setq bbdb-default-area-code "030" bbdb-north-american-phone-numbers-p nil bbdb-complete-name-allow-cycling t bbdb-offer-save 'dontask bbdb-file-coding-system 'iso-2022-8 bbdb-define-all-aliases-mode 'all bbdb-inhibit-revert-questions-p t bbdb-auto-revert-p t) (autoload 'gnus-convert-face-to-png "gnus-fun") (defun steve-bbdb-display-colour-face () "Search for face properties and display the faces. This is from Steve Youngs." (let ((inhibit-read-only t); edit the BBDB buffer (all-records bbdb-records) cface record start) (while all-records (setq record (caar all-records) cface (bbdb-record-getprop record 'cface) start (marker-position (nth 2 (car all-records)))) (if cface (progn (set-extent-begin-glyph (make-extent start start) (make-glyph (list (vector 'png ':data (gnus-convert-face-to-png cface))))) (insert " "))) (setq all-records (cddr all-records))))) (add-hook 'bbdb-list-hook 'steve-bbdb-display-colour-face) ;;(remove-hook 'bbdb-list-hook 'bbdb-hack-x-face) (defun hrop-bbdb-display-highres-face () "Search for image properties and display the faces." (let ((inhibit-read-only t); edit the BBDB buffer (all-records bbdb-records) image record start) (while all-records (setq record (caar all-records) image (bbdb-record-getprop record 'image) start (marker-position (nth 2 (car all-records)))) (and image (flet ((hrop-ins-png (img) (set-extent-begin-glyph (make-extent start start) (make-glyph (list (vector 'png ':data (with-temp-buffer (insert-file-contents img) (buffer-string)))))) (insert " "))) (cond ((file-readable-p image) (hrop-ins-png image)) ((file-readable-p (file-name-directory image)) (mapc #'hrop-ins-png (directory-files (file-name-directory image) t (file-name-nondirectory image) nil t)))))) (setq all-records (cddr all-records))))) (defun sy-add-to-kill (start end &optional prepend) "Copy region START END and append it to the latest kill. Or, PREPEND with prefix arg. With this you could select \"THIS \" word, `\\[kill-ring-save]' to save it to the kill ring, then select this \"WORD \" and do `\\[sy-add-to-kill]', then select this word \"HERE\", do `\\[sy-add-to-kill]', then select these words \"DON'T WANT \", do `\\[universal-argument] \\[sy-add-to-kill]', and finally do `\\[yank]' and you'd get... DON'T WANT THIS WORD HERE" (interactive "r\nP") (let ((prepend (or prepend current-prefix-arg))) (if prepend (kill-append (buffer-substring start end) 'before) (kill-append (buffer-substring start end) nil)))) (add-hook 'bbdb-list-hook 'hrop-bbdb-display-highres-face) (defvar allow-writes-to-create-dirs nil "If t, user can do a write-file or write-region even to non-existing paths. All non-existing parent dirs are created.") (defadvice write-file (before check-dirname-file activate) "If `allow-writes-to-create-dirs', create any nonexistent parent dirs needed." (if (and allow-writes-to-create-dirs (file-name-directory filename)) (let ((dir (file-name-directory filename))) (if (not (file-exists-p dir)) (make-directory dir t))))) (defadvice write-region (before check-dirname-region activate) "If `allow-writes-to-create-dirs', create any nonexistent parent dirs needed." (if allow-writes-to-create-dirs (let ((dir (file-name-directory filename))) (if (and dir (not (file-exists-p dir))) (make-directory dir t))))) (setq allow-writes-to-create-dirs t) (setq enable-local-eval t enable-local-variables t) ;; coding stuff (setq default-buffer-file-coding-system 'iso-8859-1 buffer-file-coding-system-for-read 'iso-8859-1 message-draft-coding-system 'iso-8859-1 message-send-coding-system 'iso-8859-1) (setq hippie-expand-try-functions-list '( try-expand-all-abbrevs try-complete-file-name-partially try-complete-file-name try-expand-list try-expand-whole-kill try-expand-line try-expand-list-all-buffers try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-completion try-complete-lisp-symbol-partially try-complete-lisp-symbol try-font-name )) ;;(global-pabbrev-mode nil) ;; modeline (custom-set-variables '(modeline-scrolling-method t) '(gutter-buffers-tab-visible-p nil)) (setq crypt-encryption-type 'pgp ; default encryption mechanism crypt-confirm-password t) ; make sure new passwords are correct (setq random-face-dir '"~/.faces/") (setq x-symbol-mode t) (setq recent-files-number-of-entries 1024) (setq recent-files-permanent-first t) (setq recent-files-include-save-now t) (setq recent-files-actions-on-top t) (setq minibuffer-max-depth nil) (setq version-control t) (setq kept-old-versions 1) (setq kept-new-versions 2) (setq delete-old-versions t) (setq dired-copy-preserve-time t dired-no-confirm '(recursive-delete kill-dired-buffer kill-file-buffer)) (setq auto-save-directory "~/.autosave") ;;(pc-select-mode) (turn-on-pending-delete) (setq backup-by-copying t) (setq bkup-backup-directory-info '( (t "~/.autosave/" ok-create full-path) )) (setq-default indent-tabs-mode t) ;; specifier sets (set-specifier scrollbar-on-left-p t) (set-specifier scrollbar-on-top-p t) (set-specifier scrollbar-width 10) (set-specifier scrollbar-height 10) (set-specifier menubar-visible-p nil) ;; keypatt ;;(setq keypatt-dribble-filename "~/.dribble") ;;(keypatt-log-keys) (setq-default case-fold-search t overwrite-mode nil case-fold-search t case-replace t zmacs-regions t mouse-yank-at-point nil default-mouse-track-extent nil require-final-newline nil next-line-add-newlines nil teach-extended-commands-p t teach-extended-commands-timeout 2 debug-on-error nil debug-on-quit nil lpr-switches nil get-frame-for-buffer-default-instance-limit nil temp-buffer-show-function 'show-temp-buffer-in-current-frame font-lock-auto-fontify t font-lock-use-fonts t font-lock-use-colors nil font-lock-maximum-decoration t font-lock-maximum-size 256000 font-lock-mode-enable-list nil font-lock-mode-disable-list nil) (remove-hook 'font-lock-mode-hook 'turn-on-fast-lock) (add-hook 'font-lock-mode-hook 'font-lock-fontify-buffer) (if (featurep 'scrollbar) (progn (add-spec-list-to-specifier scrollbar-width 'nil) (add-spec-list-to-specifier scrollbar-height 'nil))) (add-spec-list-to-specifier modeline-shadow-thickness '((global (nil . 2)))) (setq-default truncate-lines nil bar-cursor nil buffers-menu-max-size 25 complex-buffers-menu-p nil buffers-menu-sort-function 'sort-buffers-menu-by-mode-then-alphabetically buffers-menu-grouping-function 'group-buffers-menu-by-mode-then-alphabetically buffers-menu-submenus-for-groups-p nil font-menu-ignore-scaled-fonts t font-menu-this-frame-only-p t mouse-avoidance-mode nil browse-url-browser-function 'browse-url-w3) (if (featurep 'mule) (set-language-environment '"English")) ;;xslide mode ;;(define-key xsl-mode-map [del] 'backward-or-forward-delete-char) (defun paren-act-mad () (interactive) (paren-activate)) (paren-act-mad) (defmacro measure-time (&rest body) (let ((bf `(progn ,@body))) (let* ((sta (current-btime)) (res (eval bf)) (sto (current-btime)) (tim (- sto sta))) ;;`(put ,res 'result ,tim) `,tim))) ;;(measure-time (1- (2^ 100000))) ;;(reportmail) (display-time) ;;(metarm) (when (file-exists-p (eval mtorus-state-file)) (mtorus-state-load)) (when (getenv "GNU_PORT") (gnuserv-start)) (if (featurep 'ent) (setq gnuserv-cookie (format "%.32x" (randomb 128))) ;;(random (2^ 128)))) (setq gnuserv-cookie nil)) (when gnuserv-cookie (shell-command (concat "xauth add :999 . " gnuserv-cookie)) (shell-command (format "xauth add %s:999 . %s" (getenv "HOSTNAME") gnuserv-cookie))) (c-lang-defconst c-modifier-kwds "Keywords that can prefix normal declarations of identifiers \(and typically act as flags). Things like argument declarations inside function headers are also considered declarations in this sense. If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses will be handled." t nil (c c++) '("auto" "extern" "inline" "extern_inline" "register" "static") c++ (append '("explicit" "friend" "mutable" "template" "using" "virtual") (c-lang-const c-modifier-kwds)) objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static") ;; FIXME: Some of those below ought to be on `c-other-decl-kwds' instead. idl '("abstract" "attribute" "const" "consumes" "custom" "emits" "import" "in" "inout" "local" "multiple" "oneway" "out" "private" "provides" "public" "publishes" "readonly" "typeid" "typeprefix" "uses" ;; In CORBA PSDL: "primary" "state" ;; In CORBA CIDL: "bindsTo" "delegatesTo" "implements" "proxy" "storedOn") ;; Note: "const" is not used in Java, but it's still a reserved keyword. java '("abstract" "const" "final" "native" "private" "protected" "public" "static" "strictfp" "synchronized" "transient" "volatile") pike '("final" "inline" "local" "nomask" "optional" "private" "protected" "public" "static" "variant")) (load-library "cc-fonts") ;;(symbol-value (intern "c-modifier-kwds" c-lang-constants)) ;;(c-lang-const c-modifier-kwds c) ;; (when (featurep 'emeteo-modeline) ;; (emeteo-modeline) ;; (emms-modeline 1)) ;; if shit is getting on me nerves (setq display-time-mail-file "~/.never_gonna_happen") ;;;; Additional defuns ;; (delete-itimer "auto-save") ;; Local variables: ;; donteval: (mtorus-add-pos-to-ring (current-buffer) "emacs-config") ;; indent-tabs-mode: nil ;; End: