,(if (cdr forms) (cons 'progn forms) (car forms))
(error (message "Error (trapped): %s" (error-message-string err)))))
+;; --- Configuration reading ---
+
+(defvar mdw-config nil)
+(defun mdw-config (sym)
+ "Read the configuration variable named SYM."
+ (unless mdw-config
+ (setq mdw-config (with-temp-buffer
+ (insert-file-contents "~/.mdw.conf")
+ (replace-regexp "^[ \t]*\\(#.*\\|\\)\n" ""
+ nil (point-min) (point-max))
+ (replace-regexp (concat "^[ \t]*"
+ "\\([-a-zA-Z0-9_.]*\\)"
+ "[ \t]*=[ \t]*"
+ "\\(.*[^ \t\n]\\|\\)"
+ "[ \t]**\\(\n\\|$\\)")
+ "(\\1 . \"\\2\") "
+ nil (point-min) (point-max))
+ (car (read-from-string
+ (concat "(" (buffer-string) ")"))))))
+ (cdr (assq sym mdw-config)))
+
;; --- Splitting windows ---
(defconst mdw-scrollbar-width (if window-system 6 1)