diff -r efa00a6ef34e -r 6889ad2dbd35 .emacs-my --- a/.emacs-my Thu Dec 09 12:32:50 2010 +0200 +++ b/.emacs-my Tue Dec 14 15:54:04 2010 +0200 @@ -659,6 +659,19 @@ (setq-default calc-group-digits t) (setq-default calc-group-char "'") +(defun my-calc-eval-region (arg beg end) + "Calculate the region and display the result in the echo area. +With prefix ARG non-nil, insert the result at the end of region." + (interactive "P\nr") + (require 'calc) + (let* ((expr (buffer-substring-no-properties beg end)) + (result (calc-eval expr))) + (if (null arg) + (message "%s = %s" expr result) + (goto-char end) + (save-excursion + (insert result))))) + ;;; ---------------------------------------------------------------- ;;; TeX, LaTeX.