I have written a code:
;;; calculator.el --- Calculator
;;; Commentary:
;;; Code:
(let ((operand1 (read-number "Enter the first number: "))
(operand2 (read-number "Enter the second number: ")))
(princ (format "The sum is %d" (+ operand1 operand2))))
(provide 'calculator)
;;; calculator.el ends her
I have a problem with disappearing the last program output "The sum is NUMBER". Have you any idea on how to give the program user chance of seeing the final sum printed by princ?
When I type M-x load-file calculator.el
there's printed "Loading /home/lester29/calculator.el (source)...done"
in the echo area after giving for example 2 and 3 to read-number
, not The sum is 5
.
When I type eval-buffer
there's nothing printed after feeding operand1
and operand2
with 2 and 3.
How can I use a file such as calculator.el
as a script, as I would do with a file python calculator.py
?