X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/5829b6b1d3f2bab6bbdeef92f7b3e0f85db6ca33..f5a7f2454290ef7473e0b32def4486d0b50096d0:/dot/emacs diff --git a/dot/emacs b/dot/emacs index 79220bd..13d142c 100644 --- a/dot/emacs +++ b/dot/emacs @@ -46,6 +46,11 @@ ;; Load some other bits of code. +;; Magic to make ELPA packages work. +(trap +(package-initialize) +) + (maybe-autoload 'cc-mode "cc-mode" nil t) (maybe-autoload 'rexx-mode "rexx-mode" nil t) (maybe-autoload 'cvs-update "pcl-cvs" nil t) @@ -130,6 +135,7 @@ (and (or window-system (mdw-emacs-version-p 23)) (not mdw-fast-startup) + (not (and (fboundp 'daemonp) (daemonp))) (progn (setq server-temp-file-regexp (concat "^" tmpdir "\\|/draft$") edit-server-new-frame nil gnuserv-frame t) @@ -187,13 +193,15 @@ (setq sendmail-program "~/bin/sendmail-hack" send-mail-function 'sendmail-send-it mail-interactive t + mail-specify-envelope-from t + mail-envelope-from 'header sendmail-error-reporting-interactive '("-odb" "-oee")) (autoload 'sendmail-send-it "sendmail") (autoload 'smtpmail-send-it "smtpmail") (setq mail-user-agent 'message-user-agent read-mail-command 'gnus) -(setq message-signature-separator "^-- \\(\\|\\[mdw\\]\\)$" +(setq message-signature-separator "^-- \\(\\[mdw\\]\\)?$" message-yank-prefix "> " message-yank-cited-prefix "> " message-send-mail-function 'message-send-mail-with-sendmail @@ -220,23 +228,30 @@ bbdb-north-american-phone-numbers-p nil bbdb-dwim-net-address-allow-redundancy t bbdb-extract-address-components-func 'bbdb-extract-address-components + bbdb-allow-duplicates t bbdb/news-auto-create-p (lambda () (let ((group gnus-newsgroup-name)) (and (string-match "^nn\\(imap\\|folder\\)\\+" group) - (not (string-match ":\\(crap\\|spam\\|lists\\|corpus\\)\\." + (not (string-match (concat ":" "\\(" "\\(" "crap" + "\\|" "spam" + "\\|" "lists" + "\\|" "corpus" + "\\)" "\\." + "\\|" "Junk Email$" + "\\)") group))))) bbdb-user-mail-names (concat "^" "\\(" "\\(mdw\\|markw\\|root\\|postmaster\\)" - "\\([-+][^@]*\\|\\)" + "\\([-+][^@]*\\)?" "@\\(\\(dist\\|esc\\)orted\\.org\\.uk\\|odin\\.gg\\)" "\\|" "\\(" "\\(mdw\\|mwooding\\)" "\\(\\+[^@]*\\)?" "\\|" "0" "\\(mdw\\|mwooding\\)" "k\\.[^@]*" "\\)" "@" "\\(chiark\\|slimy\\|coriolis\\)\\.greenend\\.org\\.uk" - "\\|" "distorted\\.mdw@g\\(\\|oogle\\)mail.com" + "\\|" "distorted\\.mdw@g\\(oogle\\)?mail.com" "\\|" "mwooding@\\(good\\|blackberry\\)\\.com" "\\|" "mark\\.wooding@trustonic\\.com" "\\)$") @@ -343,7 +358,7 @@ eshell-cmpl-cycle-completions nil) (setq dired-deletion-confirmer ;Make deletion easier in dired (symbol-function 'y-or-n-p) - delete-by-moving-to-trash t + delete-by-moving-to-trash (mdw-emacs-version-p 24) dired-listing-switches "-alF" ;Do `ls -F' things in dired windows wdired-allow-to-change-permissions 'advanced) (setq read-quoted-char-radix 16) ;C-q HEX-STUFF [RET] @@ -380,6 +395,7 @@ (setq Info-fontify-maximum-menu-size 100000) (setq set-mark-command-repeat-pop t) (setq password-cache-expiry nil) +(setq mouse-autoselect-window t) (setq-default proced-filter 'all proced-sort 'user) (setq ispell-program-name "aspell-hack" @@ -411,6 +427,10 @@ (define-key outline-mode-prefix-map [?\C-r] 'reveal-mode) (define-key outline-mode-prefix-map [?\C--] 'mdw-outline-collapse-all))) +(define-key isearch-mode-map [?\C-?] 'isearch-del-char) +(define-key isearch-mode-map [backspace] 'isearch-del-char) +(define-key isearch-mode-map [?\e ?\C-?] 'isearch-delete-char) + (setq imenu-auto-rescan t imenu-auto-rescan-maxout (* 128 1024) imenu-max-items 60) @@ -582,10 +602,7 @@ (setq frame-background-mode (if mdw-black-background 'dark 'light) frame-inhibit-implied-resize t default-frame-alist - `((width . ,(+ mdw-column-width - (cond ((<= emacs-major-version 20) 1) - ((= emacs-major-version 26) 3) - (t 0)))) + `((width . ,(+ mdw-column-width mdw-frame-width-fudge)) (height . 33) (vertical-scroll-bars . right) (cursor-type . bar) @@ -616,7 +633,12 @@ ;; Other frame fiddling. -(setq frame-title-format '("" invocation-name "@" system-name ": %b")) +(defvar mdw-hostname + (if (string-match "\\." system-name) + (substring system-name 0 (match-beginning 0)) + system-name)) +(setq frame-title-format '("Emacs " user-login-name "@" mdw-hostname " – %b") + icon-title-format frame-title-format) ;; Global keymap changes. @@ -656,8 +678,8 @@ (global-set-key [?\e ?\e] 'mdw-wrong) (global-set-key [?\e ?\C-\] ?\C-\]] 'keyboard-escape-quit) (global-set-key [?\C-c ?\M-x] 'execute-extended-command) - (global-set-key [?\C-c ?d ?w] 'devhelp-word-at-point) (global-set-key [?\C-c ?d ?a] 'devhelp-assistant-word-at-point) + (global-set-key [?\C-c ?d ?w] 'devhelp-word-at-point) (global-set-key [?\C-c ?g ?a] 'org-agenda) (global-set-key [?\C-c ?g ?b] 'org-iswitchb) (global-set-key [?\C-c ?g ?l] 'org-store-link) @@ -687,6 +709,8 @@ (global-set-key [?\C-c ?t ?s] 'timeclock-status-string) (global-set-key [?\C-c ?t ?t] 'gtags-find-tag-from-here) (global-set-key [?\C-c ?t ?w] 'timeclock-workday-remaining-string) + (global-set-key [?\C-c ?v ?i] 'vm-visit-imap-folder) + (global-set-key [?\C-c ?v ?m] 'vm-visit-folder) (global-set-key [?\C-c ?v ?v] 'mdw-auto-revert) (global-set-key [?\C-c ?w ?d] 'mdw-divvy-window) (global-set-key [?\C-c ?w ?h] 'windmove-left) @@ -699,6 +723,9 @@ (global-set-key [?\C-c ?w left] 'windmove-left) (global-set-key [?\C-c ?w right] 'windmove-right) (global-set-key [?\C-h ?\C-m] 'manual-entry) + (global-set-key [?\C-x ?4 ?\C-j] 'dired-jump-other-window) + (global-set-key [?\C-x ?4 ?j] 'dired-jump-other-window) + (global-set-key [?\C-x ?\C-j] 'dired-jump) (global-set-key [?\C-x ?\C-n] 'skel-create-file) (global-set-key [?\C-x ?4 ?n] 'skel-create-file-other-window) (global-set-key [?\C-x ?5 ?n] 'skel-create-file-other-frame) @@ -727,6 +754,9 @@ try-expand-list-all-buffers))) hippie-expand-try-functions-list))) +(autoload 'dired-jump "dired-x") +(autoload 'dired-jump-other-window "dired-x") + (eval-after-load "dired" '(progn (or (lookup-key dired-mode-map [?\C-x ?\C-q]) @@ -863,9 +893,9 @@ ((executable-find "sudo") "sudo") (t "su"))) (this-host (concat "\\`\\(localhost\\|" - (system-name) "\\|\\)\\'")) + (system-name) "\\)?\\'")) (this-user (concat "\\`\\(" (user-login-name) "\\|" - (user-real-login-name) "\\|\\)\\'"))) + (user-real-login-name) "\\)?\\'"))) (setq tramp-default-method-alist `((,this-host nil ,rootlyness) (nil ,this-user "ssh") @@ -910,7 +940,7 @@ (setq shell-prompt-pattern "^[^]#$%>»}\n]*\\([]#$%»}]\\|>>?\\) *") (setq comint-password-prompt-regexp (concat "\\(\\([Ee]nter \\|[Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)" - "[Pp]assword\\|[Pp]ass ?phrase\\(\\| [-a-zA-Z0-9._]+\\)\\):") + "[Pp]assword\\|[Pp]ass ?phrase\\( [-a-zA-Z0-9._]+\\)?\\):") comint-file-name-chars "~/A-Za-z0-9+@:_.$#%,={}-" shell-file-name-chars comint-file-name-chars)