(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) ")"))))))
+ (setq mdw-config
+ (flet ((replace (what with)
+ (goto-char (point-min))
+ (while (re-search-forward what nil t)
+ (replace-match with t))))
+ (with-temp-buffer
+ (insert-file-contents "~/.mdw.conf")
+ (replace "^[ \t]*\\(#.*\\|\\)\n" "")
+ (replace (concat "^[ \t]*"
+ "\\([-a-zA-Z0-9_.]*\\)"
+ "[ \t]*=[ \t]*"
+ "\\(.*[^ \t\n]\\|\\)"
+ "[ \t]**\\(\n\\|$\\)")
+ "(\\1 . \"\\2\")\n")
+ (car (read-from-string
+ (concat "(" (buffer-string) ")")))))))
(cdr (assq sym mdw-config)))
;; --- Is an Emacs library available? ---
(or arg (progn
(goto-char (point-max))
(insert "\nNP: ")
- (insert-file np-file)))))
+ (insert-file-contents np-file)))))
(defun mdw-check-autorevert ()
"Sets global-auto-revert-ignore-buffer appropriately for this buffer,