O'Reilly logo
  • first last thinks this is interesting:

;;    Calculator mode.
;;    Supports the operators +, -, *, /, and % (remainder).
;;    Commands:
;;    c       clear the stack
;;    =       print the value at the top of the stack
;;    p       print the entire stack contents

(defvar calc-mode-map nil
  "Local keymap for calculator mode buffers.")

; set up the calculator mode keymap with 
; C-j (linefeed) as "eval" key
(if calc-mode-map
  (setq calc-mode-map (make-sparse-keymap))
  (define-key calc-mode-map "\C-j" 'calc-eval))

(defconst calc-number-regexp 
  "Regular expression for recognizing numbers.")

(defconst calc-operator-regexp "[-+*/%]"
  "Regular expression for recognizing opera...


Cover of Learning GNU Emacs, 3rd Edition


ERROR: unbalanced right paraentes