(defvar mdw-hanging-indents
(concat "\\(\\("
- "\\([*o]\\|-[-#]?\\|[0-9]+\\.\\|\\[[0-9]+\\]\\|([a-zA-Z])\\)"
+ "\\([*o+]\\|-[-#]?\\|[0-9]+\\.\\|\\[[0-9]+\\]\\|([a-zA-Z])\\)"
"[ \t]+"
"\\)?\\)")
"*Standard regexp matching parts of a hanging indent.
(defvar mdw-auto-indent t
"Whether to indent automatically after a newline.")
+(defun mdw-whitespace-mode (&optional arg)
+ "Turn on/off whitespace mode, but don't highlight trailing space."
+ (interactive "P")
+ (when (and (boundp 'whitespace-style)
+ (fboundp 'whitespace-mode))
+ (let ((whitespace-style (remove 'trailing whitespace-style)))
+ (whitespace-mode arg))))
+
(defun mdw-misc-mode-config ()
(and mdw-auto-indent
(cond ((eq major-mode 'lisp-mode)
(auto-fill-mode 1)
(setq fill-column 77)
(setq show-trailing-whitespace t)
- (let ((whitespace-style (remove 'trailing whitespace-style)))
- (trap (whitespace-mode t)))
+ (mdw-whitespace-mode 1)
(and (fboundp 'gtags-mode)
(gtags-mode))
(outline-minor-mode t)
(trap (turn-on-font-lock)))
(defun mdw-post-config-mode-hack ()
- (let ((whitespace-style (remove 'trailing whitespace-style)))
- (trap (whitespace-mode t))))
+ (mdw-whitespace-mode 1))
(eval-after-load 'gtags
'(progn
(when (and frame-display
(eq window-system 'x)
(not (some (lambda (fr)
- (message "checking frame %s" frame)
(and (not (eq fr frame))
(string= (frame-parameter fr 'display)
- frame-display)
- (progn "frame %s still uses us" nil)))
+ frame-display)))
(frame-list))))
(run-with-idle-timer 0 nil #'x-close-connection frame-display))))
(add-hook 'delete-frame-functions 'mdw-last-one-out-turn-off-the-lights)
-(defvar mdw-frame-parameters-alist
- '((nil (menu-bar-lines . 0))))
-(defun mdw-set-frame-parameters (frame)
- (let ((params (assq (if (fboundp 'window-system)
- (window-system frame)
- window-system)
- mdw-frame-parameters-alist)))
- (when params
- (modify-frame-parameters frame (cdr params)))))
-(add-hook 'after-make-frame-functions 'mdw-set-frame-parameters)
-
;;;--------------------------------------------------------------------------
;;; General fontification.
;; Miscellaneous fiddling.
(mdw-standard-fill-prefix "\\([ \t]*#+[ \t]*\\)")
+ (setq indent-tabs-mode nil)
;; Now define fontification things.
(make-local-variable 'font-lock-keywords)