/[emacs]/emacs/lisp/calc/calc-yank.el
ViewVC logotype

Diff of /emacs/lisp/calc/calc-yank.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by jpb, Sun Jan 2 07:39:20 2005 UTC revision 1.15 by jpb, Sun Jan 2 17:04:37 2005 UTC
# Line 430  Line 430 
430  (defvar calc-edit-handler)  (defvar calc-edit-handler)
431  (defvar calc-restore-trail)  (defvar calc-restore-trail)
432  (defvar calc-allow-ret)  (defvar calc-allow-ret)
433    (defvar calc-edit-top)
434    
435  (defun calc-edit-mode (&optional handler allow-ret title)  (defun calc-edit-mode (&optional handler allow-ret title)
436    "Calculator editing mode.  Press RET, LFD, or C-c C-c to finish.    "Calculator editing mode.  Press RET, LFD, or C-c C-c to finish.
# Line 470  To cancel the edit, simply kill the *Cal Line 471  To cancel the edit, simply kill the *Cal
471                "Press `C-c C-c'"                "Press `C-c C-c'"
472                (if allow-ret "" " or RET")                (if allow-ret "" " or RET")
473                " to finish, `C-x k RET' to cancel.\n\n")                " to finish, `C-x k RET' to cancel.\n\n")
474               'font-lock-face 'italic))))               'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t))
475        (make-local-variable 'calc-edit-top)
476        (setq calc-edit-top (point))))
477  (put 'calc-edit-mode 'mode-class 'special)  (put 'calc-edit-mode 'mode-class 'special)
478    
479  (defun calc-show-edit-buffer ()  (defun calc-show-edit-buffer ()
# Line 487  To cancel the edit, simply kill the *Cal Line 490  To cancel the edit, simply kill the *Cal
490            (if win            (if win
491                (delete-window win))))                (delete-window win))))
492      (set-buffer-modified-p nil)      (set-buffer-modified-p nil)
493      (goto-char (point-min))      (goto-char calc-edit-top)))
     (forward-line 2)))  
494    
495  (defun calc-edit-return ()  (defun calc-edit-return ()
496    (interactive)    (interactive)
# Line 522  To cancel the edit, simply kill the *Cal Line 524  To cancel the edit, simply kill the *Cal
524                    (set-buffer original)                    (set-buffer original)
525                    (not (eq major-mode 'calc-mode))))                    (not (eq major-mode 'calc-mode))))
526          (error "Original calculator buffer has been corrupted")))          (error "Original calculator buffer has been corrupted")))
527      (goto-char (point-min))      (goto-char calc-edit-top)
     (when (looking-at "Calc Edit\\|Editing ")  
       (forward-line 1))  
     (if (looking-at "^ *$")  
         (forward-line 1))  
528      (if (buffer-modified-p)      (if (buffer-modified-p)
529          (eval calc-edit-handler))          (eval calc-edit-handler))
530      (if one-window      (if one-window
# Line 551  To cancel the edit, simply kill the *Cal Line 549  To cancel the edit, simply kill the *Cal
549    
550  (defun calc-finish-stack-edit (num)  (defun calc-finish-stack-edit (num)
551    (let ((buf (current-buffer))    (let ((buf (current-buffer))
552          (str (buffer-substring (point) (point-max)))          (str (buffer-substring calc-edit-top (point-max)))
553          (start (point))          (start (point))
554          pos)          pos)
555      (if (and (integerp num) (> num 1))      (if (and (integerp num) (> num 1))

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26