From: Mark Wooding Date: Thu, 15 May 2008 10:46:31 +0000 (+0100) Subject: Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/162d33499592d12d7c9f44c1a66f40b073eef16b?hp=362f6ac4b077d89c56de8d85f1c1cd4d7d918c65 Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile * 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile: emacs: Initial blogging support. emacs: Turn off fontification in shell mode. emacs: Force py-shell to start ipython with the right colours. bashrc, dircolors: Enable colouring for `dumb' terminals. dot-emacs: Clobber message-mode's header colours. --- diff --git a/dot-emacs.el b/dot-emacs.el index 007ec45..1596f11 100644 --- a/dot-emacs.el +++ b/dot-emacs.el @@ -313,23 +313,26 @@ (defadvice find-file (after mdw-autorevert activate) (defadvice write-file (after mdw-autorevert activate) (mdw-check-autorevert)) -(defun mdwmail-mode () +(define-derived-mode mdwmail-mode mail-mode "[mdw] mail" "Major mode for editing news and mail messages from external programs Not much right now. Just support for doing MailCrypt stuff." - (interactive) - (kill-all-local-variables) - (use-local-map text-mode-map) - (setq local-abbrev-table text-mode-abbrev-table) - (setq major-mode 'mdwmail-mode) - (setq mode-name "[mdw] mail") - (set-buffer-file-coding-system 'utf-8) - (make-local-variable 'paragraph-separate) - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "[ \t]*[-_][-_][-_]+$\\|^-- \\|-----\\|" - paragraph-start)) - (setq paragraph-separate (concat "[ \t]*[-_][-_][-_]+$\\|^-- \\|-----\\|" - paragraph-separate)) - (run-hooks 'text-mode-hook 'mdwmail-mode-hook 'mail-setup-hook)) + :syntax-table nil + :abbrev-table nil + (run-hooks 'mail-setup-hook)) + +(define-key mdwmail-mode-map [?\C-c ?\C-c] 'disabled-operation) + +(add-hook 'mdwail-mode-hook + (lambda () + (set-buffer-file-coding-system 'utf-8) + (make-local-variable 'paragraph-separate) + (make-local-variable 'paragraph-start) + (setq paragraph-start + (concat "[ \t]*[-_][-_][-_]+$\\|^-- \\|-----\\|" + paragraph-start)) + (setq paragraph-separate + (concat "[ \t]*[-_][-_][-_]+$\\|^-- \\|-----\\|" + paragraph-separate)))) ;; --- How to encrypt in mdwmail --- @@ -562,6 +565,7 @@ (defun mdw-misc-mode-config () (auto-fill-mode 1) (setq fill-column 77) (setq show-trailing-whitespace t) + (outline-minor-mode t) (mdw-set-font)) ;; --- Set up all sorts of faces --- @@ -2002,6 +2006,17 @@ (defun mdw-text-mode () "\\([ \t]*\\([>#|:] ?\\)*[ \t]*\\)" 3) (auto-fill-mode 1)) +;;;----- Outline mode ------------------------------------------------------- + +(defun mdw-outline-collapse-all () + "Completely collapse everything in the entire buffer." + (interactive) + (save-excursion + (goto-char (point-min)) + (while (< (point) (point-max)) + (hide-subtree) + (forward-line)))) + ;;;----- Shell mode --------------------------------------------------------- (defun mdw-sh-mode-setup () diff --git a/emacs b/emacs index dfe9caf..9b9ae96 100644 --- a/emacs +++ b/emacs @@ -178,6 +178,12 @@ (defvar mdw-black-background t) +(eval-after-load "outline" + '(progn + (trap (require 'foldout)) + (define-key outline-mode-prefix-map [?\C-r] 'reveal-mode) + (define-key outline-mode-prefix-map [?\C--] 'mdw-outline-collapse-all))) + (setq cltl2-root-url (mdw-config 'cltl-url)) (setq common-lisp-hyperspec-root (mdw-config 'hyperspec-url)) @@ -330,6 +336,8 @@ (global-set-key [?\C-x ?w ?j] 'windmove-down) (global-set-key [?\C-x ?w right] 'windmove-right) (global-set-key [?\C-x ?w ?l] 'windmove-right) +(global-set-key [?\C-x ?g ?l] 'org-store-link) +(global-set-key [?\C-x ?g ?a] 'org-agenda) (global-set-key [?\C-x ?t ?i] 'timeclock-in) (global-set-key [?\C-x ?t ?c] 'timeclock-change) (global-set-key [?\C-x ?t ?o] 'timeclock-out) @@ -361,6 +369,7 @@ ("\\.m$" . objc-mode) ("\\.mxd$" . c-mode) ("\\.cs" . csharp-mode) + ("\\.org$" . org-mode) ;; ("/[ch]/" . c-mode) (,(concat "/\\(" "\\.stgit\\.msg" "\\|"