diff options
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-buffer.el')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-buffer.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-buffer.el b/emacs/.emacs.d/lisp/my/my-buffer.el index c17e765..f2da7f5 100644 --- a/emacs/.emacs.d/lisp/my/my-buffer.el +++ b/emacs/.emacs.d/lisp/my/my-buffer.el @@ -518,5 +518,15 @@ With double prefix arguments, create a new indirect buffer." (revert-buffer t t)) (switch-to-buffer buffer))) +(defun my-fontify-with-mode (text mode) + "Fontify TEXT with MODE." + (with-temp-buffer + (funcall mode) + (insert text) + (if (fboundp 'font-lock-ensure) + (font-lock-ensure) + (with-no-warnings (font-lock-fontify-buffer))) + (buffer-string))) + (provide 'my-buffer) ;;; my-buffer.el ends here |