;;;--------------------------------------------------------------------------
;;; Check command-line.
+(defun mdw-check-command-line-switch (switch)
+ (let ((probe nil) (next command-line-args) (found nil))
+ (while next
+ (cond ((string= (car next) switch)
+ (setq found t)
+ (if probe (rplacd probe (cdr next))
+ (setq command-line-args (cdr next))))
+ (t
+ (setq probe next)))
+ (setq next (cdr next)))
+ found))
+
(defvar mdw-fast-startup nil
"Whether .emacs should optimize for rapid startup.
This may be at the expense of cool features.")
-(let ((probe nil) (next command-line-args))
- (while next
- (cond ((string= (car next) "--mdw-fast-startup")
- (setq mdw-fast-startup t)
- (if probe
- (rplacd probe (cdr next))
- (setq command-line-args (cdr next))))
- (t
- (setq probe next)))
- (setq next (cdr next))))
+(setq mdw-fast-startup
+ (mdw-check-command-line-switch "--mdw-fast-startup"))
+
+(defvar mdw-splashy-startup nil
+ "Whether to show a splash screen and related frippery.")
+(setq mdw-splashy-startup
+ (mdw-check-command-line-switch "--mdw-splashy-startup"))
;;;--------------------------------------------------------------------------
;;; Some general utilities.
(erase-buffer)
(shell-command "date +%Y-%m-%d" t)
(goto-char (mark))
- (delete-backward-char 1)
+ (delete-char -1)
(buffer-string))
(kill-buffer buffer))))))
(let ((auto-revert-check-vc-info t))
(auto-revert-buffers)))
+(defun comint-send-and-indent ()
+ (interactive)
+ (comint-send-input)
+ (and mdw-auto-indent
+ (indent-for-tab-command)))
+
+(defadvice comint-line-beginning-position
+ (around mdw-calculate-it-properly () activate compile)
+ "Calculate the actual line start for multi-line input."
+ (if (or comint-use-prompt-regexp
+ (eq (field-at-pos (point)) 'output))
+ ad-do-it
+ (setq ad-return-value
+ (constrain-to-field (line-beginning-position) (point)))))
+
;;;--------------------------------------------------------------------------
;;; Dired hacking.
(list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
'(0 mdw-punct-face)))))
-(defun comint-send-and-indent ()
- (interactive)
- (comint-send-input)
- (and mdw-auto-indent
- (indent-for-tab-command)))
-
-(defadvice comint-line-beginning-position
- (around mdw-calculate-it-properly () activate compile)
- "Calculate the actual line start for multi-line input."
- (if (or comint-use-prompt-regexp
- (eq (field-at-pos (point)) 'output))
- ad-do-it
- (setq ad-return-value
- (constrain-to-field (line-beginning-position) (point)))))
-
(defun mdw-setup-m4 ()
;; Inexplicably, Emacs doesn't match braces in m4 mode. This is very