From: Mark Wooding Date: Thu, 20 May 2010 13:26:24 +0000 (+0100) Subject: Merge remote branch 'crybaby' X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/1f504136a4d488c4bfcd2b0f7185ba5d9a9d0f6f?ds=inline;hp=-c Merge remote branch 'crybaby' * crybaby: dot/emacs: Turn off Senator again. el/dot-emacs.el: Don't use a fancy face for `which-func'. --- 1f504136a4d488c4bfcd2b0f7185ba5d9a9d0f6f diff --combined dot/emacs index 3dc2377,c1abaed..29974a6 --- a/dot/emacs +++ b/dot/emacs @@@ -62,7 -62,7 +62,7 @@@ (trap (or mdw-fast-startup (require 'tex-site))) - (trap (or mdw-fast-startup (semantic-load-enable-excessive-code-helpers))) + (trap (or mdw-fast-startup t (semantic-load-enable-code-helpers))) (setq semanticdb-default-save-directory "~/.emacs.d/semanticdb/") (eval-after-load "senator" '(setq isearch-mode-hook @@@ -443,7 -443,6 +443,7 @@@ (global-set-key [?\C-x ?t ?s] 'timeclock-status-string) (global-set-key [?\C-x ?t ?p] 'nc-timesheet-prepare) (global-set-key [?\C-x ?t ?\C-m] 'nc-timesheet-submit) + (global-set-key [?\C-x ?3] 'mdw-split-window-horizontally) (global-set-key [?\M-#] 'calc-dispatch) (global-set-key [?\C-x ?/] 'auto-fill-mode) (global-set-key [?\C-x ?w ?d] 'mdw-divvy-window) diff --combined el/dot-emacs.el index 08cc3de,bef8695..4cca329 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@@ -137,33 -137,6 +137,33 @@@ library. ((eq side 'left) 1) (t 2)))) +(defun mdw-horizontal-window-overhead () + "Computes the horizontal window overhead. +This is the number of columns used by fringes, scroll bars and other such +cruft." + (if (not window-system) + 1 + (let ((tot 0)) + (dolist (what '(scroll-bar fringe)) + (dolist (side '(left right)) + (incf tot (funcall (intern (concat (symbol-name what) "-columns")) + side)))) + tot))) + +(defun mdw-split-window-horizontally (&optional width) + "Split a window horizontally. +Without a numeric argument, split the window approximately in +half. With a numeric argument WIDTH, allocate WIDTH columns to +the left-hand window (if positive) or -WIDTH columns to the +right-hand window (if negative). Space for scroll bars and +fringes is not taken out of the allowance for WIDTH, unlike +\\[split-window-horizontally]." + (interactive "P") + (split-window-horizontally + (cond ((null width) nil) + ((>= width 0) (+ width (mdw-horizontal-window-overhead))) + ((< width 0) width)))) + (defun mdw-divvy-window (&optional width) "Split a wide window into appropriate widths." (interactive "P") @@@ -173,7 -146,16 +173,7 @@@ 77) (t 78))) (let* ((win (selected-window)) - (sb-width (if (not window-system) - 1 - (let ((tot 0)) - (dolist (what '(scroll-bar fringe)) - (dolist (side '(left right)) - (incf tot - (funcall (intern (concat (symbol-name what) - "-columns")) - side)))) - tot))) + (sb-width (mdw-horizontal-window-overhead)) (c (/ (+ (window-width) sb-width) (+ width sb-width)))) (while (> c 1) @@@ -922,6 -904,8 +922,8 @@@ doesn't match any of the regular expres (((type tty)) :foreground "green") (t :foreground "SeaGreen1")) (mdw-define-face message-header-name (((type tty)) :foreground "green") (t :foreground "SeaGreen1")) + (mdw-define-face which-func + (t nil)) (mdw-define-face diff-index (t :weight bold))