;; This file contains an example of the functions that are defined by ;; `mumamo-fetch-major-mode-setup'. The file was written using utf-8. ;; The functions are given names like mumamo-eval-in-MODE. The code ;; that was evaled to define the function is saved in the property ;; `mumamo-defun' on the function symbol. This code was used to insert ;; the function code below: (insert (pp-to-string (get 'mumamo-eval-in-html-mode 'mumamo-defun))) ;; I have inserted comments by hand below: (defun mumamo-eval-in-html-mode (body) ;; The parameter BODY is evaled at the end of the let form ;; below. The let bound variables are from two sources: ;; ;; 1) Buffer local variables (minus some that do not fit/disturbs, ;; see `mumamo-get-relevant-buffer-local-vars'. ;; ;; 2) From the list in `mumamo-fetch-major-mode-setup'. This list ;; contains variables that are often set buffer locally for ;; fontification indentation etc. Unfortunately not all of these ;; are automatic buffer locals. (let ;; These variables are from the list in ;; `mumamo-fetch-major-mode-setup': ((sgml-xml-mode nil) (indent-line-function 'sgml-indent-line) (indent-region-function nil) (normal-auto-fill-function 'do-auto-fill) (comment-start "") (comment-start-skip "") (char-property-alias-alist '((face font-lock-face))) (auto-composition-mode-major-mode 'html-mode) (auto-composition-mode t) (auto-composition-function 'auto-compose-chars) (adaptive-fill-regexp "[ ]*")) ;; The syntax table is handled differently since it is not just a ;; variable. Instead of copying it the name of the syntax table is ;; used together with `with-syntax-table' to change it ;; temporarily. (with-syntax-table (if html-mode-syntax-table html-mode-syntax-table (standard-syntax-table)) (let ((t1 (get-internal-run-time)) t2) ;; And here I am setting font lock variables again. Why did I ;; do that? I have to test, it is probably a left over from ;; earlier versions. (setq font-lock-set-defaults nil) (font-lock-set-defaults) ;; Just some timing test stuff: (setq t2 (get-internal-run-time)) (mumamo-msgfntfy "font-lock-set-defaults runtime=%s, %s" t1 t2) t2) ;; And finally - here is what I wanted to do: (eval body)))) ;; Local Variables: ;; coding: utf-8 ;; End: