]> git.eshelyaron.com Git - emacs.git/commitdiff
(calc-edit-mode): Mention C-cC-c as the way to finish, C-xk as the way
authorJay Belanger <jay.p.belanger@gmail.com>
Fri, 31 Dec 2004 05:59:44 +0000 (05:59 +0000)
committerJay Belanger <jay.p.belanger@gmail.com>
Fri, 31 Dec 2004 05:59:44 +0000 (05:59 +0000)
to cancel the edit.  Add cancel routine to kill-buffer-hook.

lisp/calc/calc-yank.el

index 0470abca5365eaf6060b2beb2f010cc10948c62c..2fdfab6c6f432f4e42812046f05c7acaf03c6916 100644 (file)
@@ -460,16 +460,14 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
     (make-local-variable 'calc-allow-ret)
     (setq calc-allow-ret allow-ret)
     (erase-buffer)
+    (add-hook 'kill-buffer-hook (lambda () 
+                                  (let ((calc-edit-handler nil))
+                                    (calc-edit-finish t))
+                                  (message "(Cancelled)")) t t)
     (insert (or title title "Calc Edit Mode")
-           ".  Press "
-           (if (eq (lookup-key (current-global-map) "\e#") 'calc-dispatch)
-               "M-# M-# or C-c C-c"
-             (if allow-ret "C-c C-c" "RET"))
-           " to finish, "
-           (if (eq (lookup-key (current-global-map) "\e#") 'calc-dispatch)
-               "M-# x"
-             "C-x k RET")
-           " to cancel.\n")))
+           ".  Press `C-c C-c'"
+            (if allow-ret "" " or RET")
+           " to finish, `C-x k RET' to cancel.\n")))
 (put 'calc-edit-mode 'mode-class 'special)
 
 (defun calc-show-edit-buffer ()