;; -*- emacs-lisp -*- (setq load-path (cons (expand-file-name "gnus/contrib" lispdir) load-path) load-path (cons (expand-file-name "mail-lib" pkgdir) load-path) load-path (cons (expand-file-name "mylisp" "~") load-path)) ;; Bbdb for gnus stuff ;;;;(require 'gnus-bbdb) (bbdb-initialize 'gnus 'message) ;;;;(require 'bbdb-frame) (setq bbdb-send-mail-style 'message) (bbdb-insinuate-gnus) (bbdb-insinuate-message) (bbdb-insinuate-w3) (require 'bbdb-hooks) ;;(setq smtpmail-debug-verb t) ;;(require 'smtpmail) (require 'browse-url) (require 'gnus-diary) (require 'gnus-art) (require 'gnus-alias) ;;(require 'gnus-bcklg) (require 'gnus-cite) (require 'gnus-highlight) (require 'gnus-eyecandy) (require 'ietf-drums) (require 'gnus-fun) (require 'gnus-sum) (require 'gnus-delay) ;;(require 'gnus-pers) (require 'gnus-group) (require 'gnus-ml) (require 'gnus-picon) (require 'gnus-logic) (require 'gnus-dynamic-subject) (require 'gnus-summary-x-face) (require 'gnus-registry) ;;(require 'x-iso8859-1) ;;(require 'latin-unity) (require 'mail-extr) (require 'message) (require 'mm-decode) (require 'nndiary) (require 'nndoc) (require 'nneething) (require 'nnir) (require 'nnrss) (require 'nnweb) (require 'pgg) (load-library "smtpmail") (require 'smiley) (require 'spam) (require 'spam-splitter) (require 'spam-stat) (require 'starttls) (require 'url) (require 'x-face) (require 'xml-rpc) (require 'xml) (require 'gnus-namazu) (require 'w3m) (require 'epg) ;;(mypasswd-load-main) (spam-stat-load) ;;GNUS + styles (setq gnus-visible-headers (compile-regexp "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^Mail-Copies-To:\\|^To:\\|^Cc:\\|^X-Newsreader:\\|^X-Mailer:\\|^X-Sent:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From:\\|^gpg-key-ID:\\|^fingerprint:")) (setq gnus-use-trees nil gnus-build-sparse-thread 'some gnus-read-active-file t gnus-expert-user t) (setq gnus-verbose 10 gnus-verbose-backends 10) ;;; first of all the important things: (setq gnus-logo-color-style 'no) ;; Things to speed up gnus (setq gnus-save-newsrc-file nil) (setq gnus-read-newsrc-file nil) (setq gnus-save-killed-list nil) ;; Message style (setq message-from-style 'angles) (setq message-syntax-checks '((sender . disabled))) ;; posting styles et. al. (load-file "~/.user.mail") ;; encryption and auth stuff (setq smtpmail-local-domain nil send-mail-function #'smtpmail-send-it message-send-mail-function #'smtpmail-send-it message-send-mail-partially-limit nil smtpmail-default-smtp-server "qaos.math.tu-berlin.de" smtpmail-smtp-server "fluch.fresse.org" smtpmail-debug-info t smtpmail-debug-verb t smtpmail-starttls-credentials '(("mail.gmx.net" 25 nil nil) ("mail.math.tu-berlin.de" 25 "" "") ("qaos.math.tu-berlin.de" 25 "~/.certs/qaos.smtpd.key" "~/.certs/qaos.smtpd.cert" "~/.certs/qaos.ca") ("fluch.fresse.org" 25 "~/.certs/fluch.smtpd.key" "~/.certs/fluch.smtpd.cert" "~/.certs/fluch.ca")) starttls-ca-list '("~/.certs/qaos.ca" "~/.certs/fluch.ca")) ;; MIME-stuff (setq gnus-article-decode-mime-words t gnus-article-decode-charset 1 gnus-mime-view-all-parts t) ;; List of MIME types that should not be given buttons when rendered. (setq gnus-unbuttonized-mime-types nil gnus-mime-display-multipart-related-as-mixed t mm-discouraged-alternatives '("text/html" "text/enriched" "text/richtext" "application/x-pkcs7-signature") mm-inline-large-images t ;;mm-coding-system-priorities '(iso-2022-8) ;;mm-coding-system-priorities '(iso-8859-1) mm-default-directory "~/temp/" mm-use-find-coding-systems-region nil) (mapc (lambda (dspres) (setq mm-automatic-display (remove dspres mm-automatic-display))) '("text/html" "application/pkcs7-signature" "application/x-pkcs7-signature")) ;; (setq mm-content-transfer-encoding-defaults ;; '(("text/x-patch" 8bit) ;; ("text/.*" qp-or-base64) ;; ("message/rfc822" 8bit) ;; ("application/emacs-lisp" 8bit) ;; ("application/x-patch" 8bit) ;; ("application/pdf" base64) ;; (".*" base64))) (setq browse-url-browser-function 'browse-url-w3m) (setq gnus-agent nil) ;;; now my mail sources (load-file "~/.sources") (setq gnus-tmp-group "" query-user-mail-address nil) (defun mygnus-message-archive-group (group) (cond ((message-news-p) "misc-news") ((message-mail-p) (format "mail.%s" (format-time-string "%Y-%m" (current-time)))))) (setq gnus-message-archive-group #'mygnus-message-archive-group) (gnus-add-configuration '(article (cond (gnus-use-trees '(vertical 1.0 (summary 0.25 point) (tree 0.25) (article 1.0))) (t '(vertical 1.0 (summary 0.25 point) (if gnus-carpal '(summary-carpal 4)) (if gnus-use-trees '(tree 0.25)) (article 1.0)))))) ;; picons (setq gnus-use-picons t gnus-treat-display-picons t gnus-treat-display-smileys t gnus-treat-date-lapsed t gnus-treat-newsgroups-picon t gnus-treat-mail-picon t gnus-treat-from-picon t) (add-to-list 'gnus-picon-databases "/net/kant/local.linux.kant/share/picons.db") ;; Hooks ;;(gnus-start-date-timer 1) (add-hook 'gnus-group-mode-hook 'gnus-topic-mode) (add-hook 'gnus-group-update-hook 'gnus-group-line-add-icon) (add-hook 'gnus-topic-mode-hook (function (lambda () (local-set-key [T (meta M)] 'gnus-topic-move-matching)))) (add-hook 'gnus-summary-exit-hook 'gnus-summary-bubble-group) (add-hook 'gnus-article-prepare-hook 'gnus-article-display-x-face t) (add-hook 'gnus-article-prepare-hook 'smiley-buffer t) (add-hook 'gnus-article-prepare-hook 'gnus-article-emphasize t) ;;(add-hook 'gnus-article-prepare-hook 'ffap-gnus-menu) (add-hook 'gnus-article-prepare-hook 'gnus-pick-mode) ;;(setq gnus-article-x-face-command 'gnus-article-display-x-face) ;;(add-hook 'gnus-article-prepare-hook 'egocentric-mode) (autoload 'egocentric-mode "egocentric" "Highlight your name or various keywords in buffers") ;;* display de-quoted-unreadable ;; "d=E9j=E0vu" => "déjàvu" (add-hook 'gnus-article-prepare-hook 'gnus-article-de-quoted-unreadable) ;;(add-hook 'gnus-article-display-hook 'gnus-summary-verbose-header) (add-hook 'gnus-article-prepare-hook 'gnus-article-date-lapsed) (add-hook 'gnus-article-prepare-hook 'gnus-start-date-timer) ;;(add-hook 'message-send-hook 'message-keyword-insert) ;;(add-hook 'nnmail-prepare-incoming-message-hook 'message-auto-keyword-insert) ;;(add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) (add-to-list 'nnmail-extra-headers nnrss-description-field) ;;;;; moy-bbdb (autoload 'bbdb/send-hook "moy-bbdb" "Function to be added to `message-send-hook' to notice records when sending messages" t) (add-hook 'message-send-hook 'bbdb/send-hook) (defun my-msg-setup-fun () (x-face-define-menu) (define-key (current-local-map) "\C-x4x" 'select-xface) (gnus-alias-init) (gnus-alias-determine-identity)) (add-hook 'gnus-message-setup-hook #'my-msg-setup-fun) ;;; gnus-delay (gnus-delay-initialize) (defun my-message-mode-setup () (turn-on-auto-fill) (turn-on-filladapt-mode) (setq fill-column 74) (activate-input-method "latin-1-prefix") (define-key message-mode-map [(control ?w)] (lambda (&optional beg end) (interactive "r") (completion-kill-region beg end) (insert (format "[snip]\n"))))) (add-hook 'message-mode-hook #'my-message-mode-setup) (add-hook 'message-mode-hook 'message-xmas-maybe-fontify) ;; adding some timestamp (add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp) (setq gnus-group-line-format "%M%S%m%P%4I,%4T,%6R;%6N: %(%un%) %-106=%l%o %ud %L%p%B\n" gnus-topic-line-format "%i[ %(%{%n%}%) - %A/%g/%l ] %v\n" gnus-summary-line-format "%*%U%R%z%7V.%-6i %6L=%-6k %&user-date; %[%-20,20n%]%u+ %ux %2{ %}%3{%B%}%1{%us%} %N%uX\n" gnus-thread-indent-level 2 gnus-show-threads t gnus-summary-display-arrow nil gnus-summary-display-while-building t) (add-to-list 'gnus-extra-headers 'Newsgroups) (add-to-list 'nnmail-extra-headers 'Newsgroups) (add-to-list 'gnus-extra-headers 'X-Face) (add-to-list 'nnmail-extra-headers 'X-Face) (add-to-list 'gnus-extra-headers 'Face) (add-to-list 'nnmail-extra-headers 'Face) (defun mygnus-summary-mode-fun () (cond ((string-match "^nnrss:" gnus-newsgroup-name) (mapc 'make-local-variable '(gnus-show-threads gnus-article-sort-functions gnus-use-adaptive-scoring gnus-use-scoring gnus-score-find-score-files-function gnus-summary-line-format)) (setq gnus-show-threads nil gnus-article-sort-functions 'gnus-article-sort-by-subject gnus-use-adaptive-scoring nil gnus-use-scoring t gnus-score-find-score-files-function 'gnus-score-find-single gnus-summary-line-format "%*%U%R%z%7V.%-6i %6L=%-6k %&user-date; %2{ %}%3{%B%}%1{%us%} %N%uX\n")) ((string-match "^nnfolder\\+archive:" gnus-newsgroup-name) (mapc 'make-local-variable '(gnus-show-threads gnus-article-sort-functions gnus-use-adaptive-scoring gnus-use-scoring gnus-score-find-score-files-function gnus-summary-line-format)) (setq gnus-show-threads nil gnus-article-sort-functions 'gnus-article-sort-by-subject gnus-use-adaptive-scoring nil gnus-use-scoring t gnus-score-find-score-files-function 'gnus-score-find-single gnus-summary-line-format "%*%U%R%z%7V.%-6i %6L=%-6k %&user-date; [%-20,20~(form (let ((to (gnus-extract-address-components (or (gnus-extra-header 'To) (gnus-extra-header 'Newsgroups))))) (or (car to) (cadr to))))@]%u+ %1{%us%} %N%uX\n")))) (add-hook 'gnus-summary-mode-hook 'mygnus-summary-mode-fun) (defun gnus-user-format-function-X (header) (let ((descr (assq nnrss-description-field (mail-header-extra header)))) (if descr (concat "\t" (cdr descr)) ""))) (defun gnus-user-format-function-d (ignore) (setq gnus-tmp-timestamp (gnus-group-timestamp gnus-tmp-group)) (format-time-string "%a, %d.%m.%Y %H:%M:%S, %W" gnus-tmp-timestamp)) (setq gnus-server-unopen-status 'offline) (defun kc-mail-header-recipients (header) "Returns string of recipients extracted from To: and Cc: headers." (mapconcat (lambda (h) (gnus-extra-header h header)) '(To Cc Original-To) ", ")) (defvar kc-gnus-interesting-recipients nil "*Regexp of addresses for which to mark \"@\" in summary buffer.") (setq kc-gnus-interesting-recipients "^.+freundt@.+") (defun kc-gnus-interesting-recipients-p (to) "Returns non-nil if any string in TO is \"interesting\". A string is interesting if it is matched by `kc-gnus-interesting-recipients'" (and kc-gnus-interesting-recipients to (string-match kc-gnus-interesting-recipients to))) (defun gnus-user-format-function-+ (header) (if (kc-gnus-interesting-recipients-p (kc-mail-header-recipients header)) "@" " ")) ;;; summary buffer (setq gnus-article-sort-functions '(gnus-article-sort-by-date)) (setq gnus-user-date-format-alist '(((gnus-seconds-today) . "tod %k:%M") ((+ (gnus-seconds-today) 86400) . "yes %k:%M") (604800 . "%a %k:%M") ((gnus-seconds-month) . "%a %d.%m") ((gnus-seconds-year) . "%b %d ") (t . "%b %d %y"))) (defvar tool-bar-mode nil "") ;; n bissel was fuers Auge ;;; group-faces (progn (defface my-group-face-1 '((t (:foreground "Blue" :bold t))) "First group face") (defface my-group-face-2 '((t (:foreground "Darkred" :bold t))) "announce group face") (defface my-group-face-3 '((t (:foreground "Darkblue" :bold t))) "nnfolder group face") (defface my-group-empty-face-3 '((t (:foreground "Darkblue" :bold nil))) "empty nnfolder group face") (defface gnus-group-mail-1-face '((t (:bold t :foreground "Red"))) "") (defface gnus-group-news-1-face '((t (:bold t :foreground "Green4"))) "") (defface gnus-group-mail-1-empty-face '((t (:bold nil :foreground "Red3"))) "") (defface gnus-group-news-1-empty-face '((t (:bold nil :foreground "Green4"))) "") (custom-set-faces `(gnus-group-mail-1-face ((t (:bold t :foreground "Red")))) `(gnus-group-news-1-face ((t (:bold t :foreground "Green4")))) `(gnus-group-mail-1-empty-face ((t (:bold nil :foreground "Red3")))) `(gnus-group-news-1-empty-face ((t (:bold nil :foreground "Green4")))))) (setq gnus-group-highlight '(((> unread 20000) . my-group-face-1) ((string-match "\\bannounce$" group) . my-group-face-2) ((and (zerop unread) (string-match "^nnfolder" group)) . my-group-empty-face-3) ((string-match "^nnfolder" group) . my-group-face-3) ((and (zerop unread) mailp) . gnus-group-mail-1-empty-face) (mailp . gnus-group-mail-1-face) ((and (zerop unread) (not mailp)) . gnus-group-news-1-empty-face) ((not mailp) . gnus-group-news-1-face))) ;;; article faces (custom-set-faces '(gnus-header-subject-face ((t (:foreground "Blue" :bold t :size 10) t)))) (setq gnus-summary-same-subject "") (setq gnus-sum-thread-tree-root "" gnus-sum-thread-tree-false-root "< " gnus-sum-thread-tree-single-indent "" gnus-sum-thread-tree-indent " " gnus-sum-thread-tree-leaf-with-other "+-> " gnus-sum-thread-tree-single-leaf "\\-> " gnus-sum-thread-tree-vertical "| ") ;:*======================= ;:* Sexy slrn-like threading tree ;; ;; Sexy slrn-like thread trees with unicode characters. ;; ;; You need to be reasonably careful here because XEmacs 21.5 can do ;; this "out of the box", but XEmacs 21.4 needs the "mule-ucs" package. ;; The hairy part is that you SHOULDN'T use mule-ucs with XEmacs 21.5. ;; Of course, this is only a problem if you have both 21.4 and 21.5 ;; installed. ;; ;; I worked around this by putting the mule-ucs package in a non-standard ;; directory (somewhere OUT of the normal load-path) and only load it if ;; I'm in 21.4. ;; (defvar sy-want-sexy-tree t ;; "If non-nil, use a sexy unicode slrn-like threading tree.") (when (featurep 'mule) (if running-sxemacs (defalias 'sy-unicode-to-char 'ucs-to-char) (defalias 'sy-unicode-to-char 'unicode-to-char))) ;; (setq gnus-summary-same-subject "") ;; (setq gnus-sum-thread-tree-root ;; (concat (char-to-string (sy-unicode-to-char 9733)) " ")) ;; (setq gnus-sum-thread-tree-false-root ;; (concat (char-to-string (sy-unicode-to-char 9734)) " ")) ;; (setq gnus-sum-thread-tree-single-indent "") ;; (setq gnus-sum-thread-tree-leaf-with-other ;; (concat "+" ;;(char-to-string (sy-unicode-to-char 9584)) ;; (char-to-string (sy-unicode-to-char 8594)) ;; " ")) ;; (setq gnus-sum-thread-tree-vertical ;; (concat (char-to-string (sy-unicode-to-char 9474)) " ")) ;; (setq gnus-sum-thread-tree-single-leaf ;; (concat (char-to-string (sy-unicode-to-char 9584)) ;; (char-to-string (sy-unicode-to-char 8594)) ;; " "))) ;; (setq gnus-sum-thread-tree-root "\x4912f " ;; gnus-sum-thread-tree-single-indent "\x4912e " ;; gnus-sum-thread-tree-leaf-with-other "\x4903c\x49020\x490fa " ;; gnus-sum-thread-tree-vertical "\x49022" ;; gnus-sum-thread-tree-single-leaf "\x490b0\x49020\x490fa ") ;; (copy-face 'default 'mysubject) ;; (setq gnus-face-1 'mysubject) ;; ;; (copy-face 'default 'mytime) ;; (set-face-foreground 'mytime "indianred4") ;; (setq gnus-face-2 'mytime) ;; ;; (copy-face 'default 'mythreads) ;; (set-face-foreground 'mythreads "indianred4") ;; (setq gnus-face-3 'mythreads) ;; ;; (copy-face 'default 'mygrey) ;; (set-face-foreground 'mygrey "grey") ;; (setq gnus-face-4 'mygrey) ;; ;; (copy-face 'default 'myblack) ;; (set-face-foreground 'myblack "grey60") ;; (setq gnus-face-5 'myblack) ;; ;; (copy-face 'default 'mybiggernumbers) ;; (set-face-foreground 'mybiggernumbers "indianred4") ;; (setq gnus-face-6 'mybiggernumbers) (setq gnus-group-glyph-directory (concat gnus-xmas-glyph-directory "groupicons/") gnus-group-icon-list '(((string-match "[Aa]dmin" group) . "FaceSad.xpm") ((string-match "[Kk]erstin" group) . "FaceHappy.xpm"))) (setq gnus-x-face-directory (expand-file-name "~/usr/.faces")) (setq custom-background-mode 'light) ;;; summary faces (custom-set-faces ;; unread faces `(gnus-summary-normal-unread ((t (:size 12 :bold nil)))) `(gnus-summary-high-unread ((t (:size 12 :bold t)))) `(gnus-summary-low-unread ((t (:size 12 :foreground "#808080")))) ;; read faces `(gnus-summary-normal-read ((t (:size 12 :foreground "#00a0c0")))) `(gnus-summary-high-read ((t (:size 12 :bold t :foreground "#00a0c0")))) `(gnus-summary-low-read ((t (:size 12 :foreground "#80a0c0")))) ;; ticked face `(gnus-summary-normal-ticked ((t (:size 12 :foreground "Red")))) `(gnus-summary-high-ticked ((t (:size 12 :bold t :foreground "Red")))) `(gnus-summary-low-ticked ((t (:size 12 :foreground "Red")))) ;; agent faces `(gnus-summary-normal-undownloaded ((t (:size 12 :foreground "Lightblue")))) `(gnus-summary-high-undownloaded ((t (:size 12 :bold t :foreground "Lightblue")))) `(gnus-summary-low-undownloaded ((t (:size 12 :foreground "Lightblue")))) ;; ancient faces `(gnus-summary-normal-ancient ((t (:size 12 :foreground "Darkblue")))) `(gnus-summary-high-ancient ((t (:size 12 :bold t :foreground "Darkblue")))) `(gnus-summary-low-ancient ((t (:size 12 :foreground "Gray70")))) ;;; article faces ;; signature `(gnus-signature ((t (:size 12 :foreground "Darkblue"))))) (setq gnus-treat-highlight-headers 'head gnus-treat-highlight-expressions 'head gnus-treat-date-lapsed 'head gnus-article-date-lapsed-new-header t) (setq gnus-summary-highlight-expressions '( ;;("^.+?\\+[^[]*[[<]\\([^]]+\\)[]>]" . "#b0e0ff") ) gnus-article-highlight-expressions '(("\\(?:to\\|cc\\):.*" . "#ffff80") ("X-Weather:.*" . "yellow") ("X-Spam:.*" . "red2") ("Date:.*" . "#00ffd0") ("X-Sent:.*" "#00ffd0"))) (setq gnus-visual t) ;; '(summary-highlight ;; group-highlight ;; article-highlight ;; mouse-face ;; summary-menu ;; group-menu ;; article-menu ;; tree-highlight ;; menu ;; highlight ;; browse-menu ;; server-menu ;; page-marker ;; tree-menu ;; binary-menu ;; pick-menu ;; grouplens-menu)) (defface gnus-folder-groups-face '((t (:foreground "DarkSeaGreen1" :bold t))) "all folders', esp. nnfolders' group face") (defface gnus-mail-groups-face '((t (:foreground "DarkSeaGreen4" :bold t))) "all mails', esp. nnmails' group face") (defface gnus-news-groups-face '((t (:foreground "Green4" :bold t))) "all news', esp. nntp's group face") ; (set-face-background 'gnus-x-face "White") ;(face-background 'default)) ;; Scoring: (setq gnus-score-expiry-days 28 gnus-update-score-entry-dates t gnus-save-score t) (setq gnus-use-adaptive-scoring t) (load-file "~/.scores") ;; Namazu (gnus-namazu-insinuate) (setq gnus-namazu-make-index-command "mknmz") (setq gnus-namazu-make-index-arguments '("--all" "--mailnews" "--deny=^.*[^0-9].*$" "--exclude=(spam|junk-mail)")) ;;nnmail-Geschichten (setq nnmail-message-id-cache-length 65535) (setq nnmail-delete-file-function 'delete-file nnmail-delete-incoming nil nnml-get-new-mail t nndiary-get-new-mail t nnmail-treat-duplicates 'delete nnmail-movemail-program 'pop3-nnmail-movemail nnmail-pop-password-required t nnmail-use-long-file-names nil nnml-use-compressed-files nil) ;;; crypto stuff ;; gpg, mailcrypt, pgg, mail (setq pgg-default-scheme 'gpg pgg-scheme 'gpg pgg-default-user-id "0x82C9390E" pgg-gpg-user-id "0x82C9390E" pgg-passphrase-cache-expiry 120) (setq gpg-passphrase-timeout 120 gpg-temp-directory (expand-file-name '"~/.gnupg") gpg-command-default-alist (quote ((gpg . "gpg") (gpg-2comp . "gpg"))) gpg-default-key-id "0x82C9390E" mm-decrypt-option 'always mm-verify-option 'always) (and nil (setq pgg-default-user-id "0xd0c56486" pgg-gpg-user-id "0xd0c56486" gpg-default-key-id "0xd0c56486")) (defvar mygpg-ids nil) (setq mygpg-ids '("82c9390e" "d0c56486" "c2e7d7cf")) (defun mygpg-change-user-id (id) (interactive (let* ((compread-tbl (mapcar (lambda (s) (cons (format "%s" s) s)) mygpg-ids))) (list (completing-read "id: " compread-tbl nil t)))) (setq pgg-default-user-id id pgg-gpg-user-id id gpg-default-key-id id) (if (string-match "^0x" id) id (concat "0x" id))) (mygpg-change-user-id (car mygpg-ids)) (setq gnus-buttonized-mime-types '("multipart/encrypted" "multipart/signed")) ;;(setq mml2015-use 'gpg) ;;(setq mml2015-use 'mailcrypt) (setq mml2015-use 'pgg) ;;(setq mml1991-use 'gpg) ;;(setq mml1991-use 'mailcrypt) (setq mml1991-use 'pgg) (setq gnus-gcc-externalize-attachments 'all) (setq gnus-subscribe-newsgroup-method #'gnus-subscribe-topics) ;;nndiary-Geschichten (setq nndiary-get-new-mail t) ;;; my splitter (load-file "~/.mail.split") ;;nnrss stuff (setq nnrss-totally-quiet-p nil nnrss-fetch-extra-categories t nnrss-extra-categories '()) ;;; coding schiet (when running-sxemacs (require 'utf) (require 'unicode) (require 'unidata) (require 'mule-uni) (require 'un-define) ;;(mapc #'load-file (directory-files (concat (getenv "lispdir") "/latin-unity/") t "\\.el")) ;;(load-file (concat (getenv "lispdir") "/latin-unity/latin-unity-autoloads.el")) (require 'latin-unity-autoloads) ) (coding-system-put 'utf-8 'category 'utf-8) (set-coding-category-system 'utf-8 'utf-8) (set-coding-priority-list (cons 'utf-8 (delq 'utf-8 (coding-priority-list)))) ;; (put-charset-property 'latin-iso8859-1 'x-charset-registry "iso10646") ;; (put-charset-property 'latin-iso8859-15 'x-charset-registry "iso10646") ;; (put-charset-property 'latin-iso8859-1 'x-charset-registry "iso8859") ;; (put-charset-property 'latin-iso8859-15 'x-charset-registry "iso8859") ;;(set-charset-ccl-program 'latin-iso8859-1 'unicode-font-encoder) (prefer-coding-system 'iso-8859-1) ;;(prefer-coding-system 'utf-8) ;;(prefer-coding-system 'raw-text) ;;(setq nnmail-incoming-coding-system 'raw-text) ;;(setq gnus-default-charset 'utf-8) (defvar mymail-smtps (dllist "qaos.math.tu-berlin.de" "fluch.fresse.org" "mail.math.tu-berlin.de")) (defun mymail-switch-smtpd (smtp) "Switches `smtpmail-smtp-server' to value of SMTP." (interactive (let* ((mysmtpls (dllist-to-list mymail-smtps)) (compread-tbl (mapcar* #'list mysmtpls mysmtpls))) (list (completing-read "source: " compread-tbl nil t)))) (setq smtpmail-smtp-server smtp) (message "smtdp switched to %s" smtp)) (defun mymail-step-smtpd () (interactive) (let* ((car (dllist-pop-car mymail-smtps))) (dllist-append mymail-smtps car) (mymail-switch-smtpd (dllist-car mymail-smtps)))) (gnus-define-keys gnus-group-mode-map [f24] (lambda nil (interactive) (let* ((allp (eq mymail-source 'all)) (src (not allp)) (src (or (and src 'all) 'important))) (mymail-switch-sources src))) [f23] (lambda nil (interactive) (let* ((srcl (mapcar 'car mymail-sources)) (cpos (position mymail-source srcl)) (news (nth (% (1+ cpos) (length srcl)) srcl))) (mymail-switch-sources news))) [f22] mymail-step-smtpd [?q] undefined [?Q] gnus-group-exit) (gnus-define-keys gnus-summary-mode-map ;;(kbd "St") spam-bogofilter-score "Sx" gnus-summary-mark-as-spam "\M-d" gnus-summary-mark-as-spam) (gnus-define-keys gnus-article-mode-map "\C-x\C-s" gnus-mime-save-part) (gnus-define-keys message-mode-map [f22] mymail-step-smtpd) ;;; SPAAAAM proc (spam-initialize) (gnus-registry-initialize) (setq spam-junk-mailgroups '("spam" "mail.spam" "mail.junk" "junk-mail" "junk") spam-use-blacklist t spam-use-stat t spam-use-gmane-xref t spam-use-dig t spam-use-regex-headers t spam-use-regex-body t spam-use-spamassassin t spam-use-spamassassin-headers t spam-stat-process-directory-age 1000 spam-log-to-registry t) (remove-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load) (setq gnus-registry-max-entries 4000) (defun spam-stat-mine-regenerate nil ;;; REVISE ME, probably not correct anymore (interactive) ;; Reset: (defalias 'time-to-number-of-days 'time-to-days) ;;(spam-stat-reset) ;; Learn spam: (spam-stat-process-spam-directory "~/Mail/junk-mail") (spam-stat-process-spam-directory "~/Mail/spam") ;; Learn non-spam: (mapc 'spam-stat-process-non-spam-directory (directory-files "~/Mail/mail/" t "^[^.]" nil 'subdirs)) ;; Reduce table size: (spam-stat-reduce-size) ;; Save table: (spam-stat-save)) (setq gnus-spam-process-destinations '(("mail\\..*" "nnml:junk-mail"))) (setq rmail-ignored-headers nil) (setq pop3-debug nil) ;; Hooks und defuns (defun browse-nnrss-url( arg ) (interactive "p") (let ((url (assq nnrss-url-field (mail-header-extra (gnus-data-header (assq (gnus-summary-article-number) gnus-newsgroup-data)))))) (if url (progn (browse-url (cdr url)) (gnus-summary-mark-as-read-forward 1)) (gnus-summary-scroll-up arg)))) ;;; sound quatsch (setq gnus-sound-path (concat (getenv "lispdir") "/../etc/sounds")) (setq mygnus-sounds-alist '((mail . "post.wav") )) (defvar mygnus-event-sound-server nil "Sound server to use.") (defvar mygnus-event-function nil "Function to call when sound-events to be played.") ;;(setq mygnus-event-device (make-device 'stream "muck:16001")) (setq mygnus-event-sound-server "muck:16001" mygnus-event-function (lambda (sound) (shell-command (format "%s %s %s" "esdplay" (and mygnus-event-sound-server (format "-s %s" mygnus-event-sound-server)) sound))) mygnus-event-function (lambda (sound) (play-sound-file sound))) (defun mygnus-event (event) "Plays sound file assoc'd with event in `mygnus-sounds-alist'." ;;(play-sound-file (concat gnus-sound-path "/" (cdr (assoc event mygnus-sounds-alist)))) (funcall mygnus-event-function (concat gnus-sound-path "/post.wav"))) (defun mygnus-incoming-mail (&rest ignore) "Play a sound file if STR contains current nicks." (mygnus-event 'mail)) (defun mygnus-sound-enable nil (interactive) (add-hook 'display-time-mail-hook 'mygnus-incoming-mail)) (defun mygnus-sound-disable nil (interactive) (remove-hook 'display-time-mail-hook 'mygnus-incoming-mail)) (setq message-hidden-headers '()) (defvar gnus-group-translation-table) (setq gnus-group-translation-table '(("nnml:mail.Ósk" "mail.Osk"))) (defun gnus-user-format-function-n (dummy) "Translate group names according to gnus-group-translation-table." (let ((maybe-translated (lookup-by-tail gnus-tmp-group gnus-group-translation-table))) (or maybe-translated gnus-tmp-group))) (defun lookup-by-tail (string matchers) (let ((string-length (length string))) (let ((matched (find-if #'(lambda (matcher) (let* ((end-string (car matcher)) (end-length (length end-string)) (then-expr (cadr matcher))) (and (>= string-length end-length) (string= (substring string (- string-length end-length)) end-string)))) matchers))) (if matched (cadr matched) nil)))) (defun sy-group-move-to-next-unseen-group () "Moves point to the next group with unseen articles." (interactive) (while (and (eq (gnus-group-next-unread-group 1) 0) (eq 0 (gnus-number-of-unseen-articles-in-group (gnus-group-group-name)))))) (defun sy-group-move-to-prev-unseen-group () "Moves point to the previous group with unseen articles." (interactive) (while (and (eq (gnus-group-prev-unread-group 1) 0) (eq 0 (gnus-number-of-unseen-articles-in-group (gnus-group-group-name)))))) (define-key gnus-group-mode-map [(super ?n)] 'sy-group-move-to-next-unseen-group) (define-key gnus-group-mode-map [(super ?p)] 'sy-group-move-to-prev-unseen-group) ;; (eval-after-load "gnus" ;; #'(define-key gnus-summary-mode-map ;; (kbd "") 'browse-nnrss-url)) (add-to-list 'nnmail-extra-headers nnrss-url-field) (defun my-message-header-setup-hook () (let ((group (or gnus-newsgroup-name ""))) (when (or (message-fetch-field "newsgroups") (gnus-group-find-parameter group 'to-address) (gnus-group-find-parameter group 'to-list)) (insert "Mail-Copies-To: never\n")))) (add-hook 'message-header-setup-hook 'my-message-header-setup-hook) (defun dpi-change-subject (neues-subject) "introduces new subject." (interactive "snew Subject: ") (let ((case-fold-search nil)) (goto-line 0) (re-search-forward "^Subject: ") (if (re-search-forward "R[Ee]: " nil t) (replace-match "") ) (insert-string neues-subject) (insert-string " (was: ") (end-of-line) (insert-string ")") )) (defun my-nndiary-delete-overview () "Deletes mangled .overview" (interactive) (let ((gebover (expand-file-name "~/News/diary/Geburtstage/.overview")) (gebfamover (expand-file-name "~/News/diary/Geburtstage/Familie/.overview"))) (and (file-readable-p gebover) (delete-file gebover)) (and (file-readable-p gebfamover) (delete-file gebfamover)))) ;;; bojohans gnus stuff :) ... thx (defvar my-gnus-highlight-face (if window-system 'underline 'underline)) (define-key gnus-summary-mode-map [tab] 'my-gnus-summary-skip-quote) ;; See gnus-article-only-boring-p (defun my-gnus-summary-skip-quote () (interactive) (catch 'foo (let (my-overlay (delay 0.5) context-line-start context-line-end context-lines (highlight my-gnus-highlight-face)) (gnus-eval-in-buffer-window gnus-article-buffer ;;(article-goto-body) ;; (or (and (re-search-forward "^>" nil t) ;; (re-search-forward "^[^>\n]." nil t)) ;; (throw 'foo nil)) (setq context-lines (min 10 (/ (window-height) 2))) (let ((opoint (point))) (move-to-window-line context-lines) (when (looking-at "\\s-*$") ; empty line (forward-line -1)) (unless (save-restriction (save-excursion (narrow-to-region (if (article-goto-body) (point) (point-min)) (if (gnus-article-search-signature) (point) (point-max)))) (and (re-search-forward (format "^\\s-*\\(%s\\)" message-cite-prefix-regexp) nil t) (progn (beginning-of-line) (while (and (not (eobp)) (or (looking-at message-cite-prefix-regexp) (looking-at "\\s-*$"))) (forward-line)) (re-search-forward "\\S-" nil t)))) (goto-char opoint) (throw 'foo nil))) (recenter context-lines) (forward-line -1) (save-excursion (if window-system ; ugly hack (beginning-of-line 2) (beginning-of-line)) (setq context-line-start (point)) (end-of-line) (setq context-line-end (1+ (point))))) (when highlight ;;(setq my-overlay (make-overlay 1 1)) (setq my-overlay (make-overlay context-line-start context-line-end (get-buffer gnus-article-buffer))) (overlay-put my-overlay 'face highlight) (sit-for delay) (delete-overlay my-overlay))))) (defun my-gnus-summary-next-quote () (interactive) (catch 'foo (let (second-line-start second-line-end (highlight nil) (next-screen-context-lines 1)) (gnus-eval-in-buffer-window gnus-article-buffer (if (looking-at "\n\\(\\'\\|-- *$\\)") (throw 'foo nil)) (goto-char (window-start)) (forward-line next-screen-context-lines) (beginning-of-line) (re-search-forward "^\\([ \t]*>\\)*") ;;(re-search-forward (concat "^" message-cite-prefix-regexp)) (beginning-of-line) (let ((prefix (match-string-no-properties 0))) (while (and (or (looking-at prefix) (looking-at "[> \t]*$") ; line w/o text (looking-at "[ \t]*\\(\\[\\|\\.\\)")) ; [snip] (not (or (some 'looking-at gnus-signature-separator) (looking-at (concat prefix "[ \t]*>")) (eobp)))) (forward-line))) (recenter next-screen-context-lines) (setq context-line-start (point-at-bol 0)) (setq context-line-end (1+ (point-at-eol 0))) ;; (goto-char (window-start)) ;; (forward-line) ;; (setq context-line-start (point)) ;; (end-of-line) ;; (setq context-line-end (1+ (point))) ) (when highlight (setq my-overlay (make-overlay context-line-start context-line-end (get-buffer gnus-article-buffer))) (overlay-put my-overlay 'face '(underline . t)) (sit-for 0.1) (delete-overlay my-overlay) ) ))) (defun my-gnus-summary-previous-quote () (interactive) (catch 'foo (let (second-line-start second-line-end highlight) (gnus-eval-in-buffer-window gnus-article-buffer (if (looking-at "\\`") (throw 'foo nil)) (goto-char (window-end)) (forward-line (- (1+ next-screen-context-lines))) (beginning-of-line) (re-search-forward "^\\([ \t]*>\\)*") (beginning-of-line) (let ((prefix (match-string-no-properties 0))) (while (and (or (looking-at (concat prefix "[ \t]*[^>]")) (looking-at "[> \t]*$")) ; line w/o text (not (or (some 'looking-at gnus-signature-separator) (bobp)))) (forward-line -1))) (recenter (- (1+ next-screen-context-lines))) (save-excursion (goto-char (window-end)) (forward-line -2) (setq context-line-start (point)) (end-of-line) (setq context-line-end (1+ (point))))) (while highlight (setq my-overlay (make-overlay context-line-start context-line-end (get-buffer gnus-article-buffer))) (overlay-put my-overlay 'face '(underline . t)) (sit-for 0.5) (delete-overlay my-overlay) ) ))) (define-key gnus-summary-mode-map [(super tab)] 'my-gnus-summary-skip-quote) (define-key gnus-summary-mode-map [(hyper tab)] 'my-gnus-summary-next-quote) (define-key gnus-summary-mode-map [(hyper shift tab)] 'my-gnus-summary-previous-quote) (setq special-users '((postgres . "guenther") (gnats . "kerstin.guenther@gmx.net"))) (defun my-gnus-reinsert-gcc (&optional gcc) "" (setq test gcc) ) (add-hook 'bbdb-complete-name-hooks 'my-gnus-reinsert-gcc) (defface you-know-who-face '((((type x w32 mac)) (:height 0.8 :foreground "White"))) "Face used for You-know-who.") (defun you-know-who-hide-obscene-content () ;; (when (display-graphic-p) ;; (while (re-search-forward "\\" nil t) ;; (compose-region ;; (match-beginning 0) ;; (match-end 0) ;; [?n (tl . Bl) ?H (Br . Bl) ?o (tr . tr) ?e ;; (Br . Bl) ?t (tr . tr) ?\ (Br . Bl) ?\ (tr . tr) ?w ;; (Br . Bl) ?b (tr . tr) ?h (Br . Bl) ?e (tr . tr) ?o ;; (Br . Bl) ?\ (tr . tr) ?\ (Br . Bl) ?n (tr . tr) ?m ;; (Br . Bl) ?a (tr . tr) ?u (Br . Bl) ?m (tr . tr) ?s ;; (Br . Bl) ?e (tr . tr) ?t (Br . Bl) ?d ;; ]) ;; (put-text-property (match-beginning 0) (match-end 0) ;; 'face 'you-know-who-face))) ) ;; (add-hook 'gnus-article-prepare-hook ;; 'you-know-who-hide-obscene-content) ;; compat stuff (defun message-functionp (form) "Return non-nil if FORM is funcallable." (or (and (symbolp form) (fboundp form)) (and (listp form) (eq (car form) 'lambda)) (byte-code-function-p form))) ;(gnus-demon-add-handler 'gnus-demon-scan-mail 600 t) ;(gnus-demon-remove-handler 'gnus-demon-scan-mail) ;;(gnus-demon-remove-handler 'nnheader-run-at-time) ;(defun nnheader-run-at-time nil) ;(fmakunbound nnheader-run-at-time) ;(remove '("nnheader-run-at-time" 1 1 (lambda nil (article-update-date-lapsed)) nil nil nil (0 0 0)) itimer-list) ;(setq itimer-list nil) ;(itimer-timer-start) ;; Don't split up large messages before sending (setq mime-editor/split-message nil) (setq gnus-killed-list nil gnus-zombie-list nil gnus-save-killed-list nil gnus-check-new-newsgroups 'ask-server gnus-check-bogus-newsgroups t) ;; (get-buffer-create "*Article*") ;; (get-buffer-create "*Mail*") (setq gnus-message-highlight-citation nil) (gnus-compile) ;; Local Variables: ;; indent-tabs-mode: nil ;; End: