diff options
Diffstat (limited to 'lisp/calc')
-rw-r--r-- | lisp/calc/calc-embed.el | 3 | ||||
-rw-r--r-- | lisp/calc/calc-ext.el | 38 | ||||
-rw-r--r-- | lisp/calc/calc-graph.el | 3 | ||||
-rw-r--r-- | lisp/calc/calc-help.el | 31 | ||||
-rw-r--r-- | lisp/calc/calc-math.el | 5 | ||||
-rw-r--r-- | lisp/calc/calc-misc.el | 104 | ||||
-rw-r--r-- | lisp/calc/calc-mode.el | 9 | ||||
-rw-r--r-- | lisp/calc/calc-prog.el | 13 | ||||
-rw-r--r-- | lisp/calc/calc-store.el | 43 | ||||
-rw-r--r-- | lisp/calc/calc-units.el | 39 | ||||
-rw-r--r-- | lisp/calc/calc-yank.el | 20 | ||||
-rw-r--r-- | lisp/calc/calc.el | 19 |
12 files changed, 163 insertions, 164 deletions
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index 9a580d9602a..bb427ef86e6 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -335,7 +335,8 @@ (message (concat "Embedded Calc mode enabled; " (if calc-embedded-quiet - "Type `C-x * x'" + (substitute-command-keys + "Type \\`C-x * x'") "Give this command again") " to return to normal"))))) (scroll-down 0))) ; fix a bug which occurs when truncate-lines is changed. diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 058d78e8476..7ee73d100a0 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1266,27 +1266,23 @@ calc-kill calc-kill-region calc-yank)))) (math-normalize val))))) -(defvar calc-help-map nil) - -(if calc-help-map - nil - (setq calc-help-map (make-keymap)) - (define-key calc-help-map "b" 'calc-describe-bindings) - (define-key calc-help-map "c" 'calc-describe-key-briefly) - (define-key calc-help-map "f" 'calc-describe-function) - (define-key calc-help-map "h" 'calc-full-help) - (define-key calc-help-map "i" 'calc-info) - (define-key calc-help-map "k" 'calc-describe-key) - (define-key calc-help-map "n" 'calc-view-news) - (define-key calc-help-map "s" 'calc-info-summary) - (define-key calc-help-map "t" 'calc-tutorial) - (define-key calc-help-map "v" 'calc-describe-variable) - (define-key calc-help-map "\C-c" 'calc-describe-copying) - (define-key calc-help-map "\C-d" 'calc-describe-distribution) - (define-key calc-help-map "\C-n" 'calc-view-news) - (define-key calc-help-map "\C-w" 'calc-describe-no-warranty) - (define-key calc-help-map "?" 'calc-help-for-help) - (define-key calc-help-map "\C-h" 'calc-help-for-help)) +(defvar-keymap calc-help-map + "b" 'calc-describe-bindings + "c" 'calc-describe-key-briefly + "f" 'calc-describe-function + "h" 'calc-full-help + "i" 'calc-info + "k" 'calc-describe-key + "n" 'calc-view-news + "s" 'calc-info-summary + "t" 'calc-tutorial + "v" 'calc-describe-variable + "C-c" 'calc-describe-copying + "C-d" 'calc-describe-distribution + "C-n" 'calc-view-news + "C-w" 'calc-describe-no-warranty + "?" 'calc-help-for-help + "C-h" 'calc-help-for-help) (defvar calc-prefix-help-retry nil) (defvar calc-prefix-help-phase 0) diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 14890e14030..a95967bef4e 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -969,7 +969,8 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (define-key calc-dumb-map "\C-c\C-c" 'exit-recursive-edit))) (use-local-map calc-dumb-map) (setq truncate-lines t) - (message "Type `q' or `C-c C-c' to return to Calc") + (message (substitute-command-keys + "Type \\`q' or \\`C-c C-c' to return to Calc")) (recursive-edit) (bury-buffer "*Gnuplot Trail*"))) diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 3355b63b6e1..a513a7de0c5 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -50,25 +50,25 @@ (beep)))) (defun calc-help-for-help (arg) - "You have typed `h', the Calc help character. Type a Help option: + "You have typed \\`h', the Calc help character. Type a Help option: -B calc-describe-bindings. Display a table of all key bindings. -H calc-full-help. Display all `?' key messages at once. +\\`B' calc-describe-bindings. Display a table of all key bindings. +\\`H' calc-full-help. Display all \\`?' key messages at once. -I calc-info. Read the Calc manual using the Info system. -T calc-tutorial. Read the Calc tutorial using the Info system. -S calc-info-summary. Read the Calc summary using the Info system. +\\`I' calc-info. Read the Calc manual using the Info system. +\\`T' calc-tutorial. Read the Calc tutorial using the Info system. +\\`S' calc-info-summary. Read the Calc summary using the Info system. -C calc-describe-key-briefly. Look up the command name for a given key. -K calc-describe-key. Look up a key's documentation in the manual. -F calc-describe-function. Look up a function's documentation in the manual. -V calc-describe-variable. Look up a variable's documentation in the manual. +\\`C' calc-describe-key-briefly. Look up the command name for a given key. +\\`K' calc-describe-key. Look up a key's documentation in the manual. +\\`F' calc-describe-function. Look up a function's documentation in the manual. +\\`V' calc-describe-variable. Look up a variable's documentation in the manual. -N calc-view-news. Display Calc history of changes. +\\`N' calc-view-news. Display Calc history of changes. -C-c Describe conditions for copying Calc. -C-d Describe how you can get a new copy of Calc or report a bug. -C-w Describe how there is no warranty for Calc." +\\`C-c' Describe conditions for copying Calc. +\\`C-d' Describe how you can get a new copy of Calc or report a bug. +\\`C-w' Describe how there is no warranty for Calc." (interactive "P") (if calc-dispatch-help (let (key) @@ -111,9 +111,6 @@ C-w Describe how there is no warranty for Calc." (with-current-buffer "*Help*" (let ((inhibit-read-only t)) (goto-char (point-min)) - (when (search-forward "Major Mode Bindings:" nil t) - (delete-region (point-min) (point)) - (insert "Calc Mode Bindings:")) (when (search-forward "Global bindings:" nil t) (forward-line -1) (delete-region (point) (point-max))) diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 5fd07d57d81..40236e452cc 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el @@ -618,8 +618,9 @@ If this can't be done, return NIL." (defun math-nth-root-float (a nrf-n &optional guess) (math-inexact-result) (math-with-extra-prec 1 - (let ((math-nrf-nf (math-float nrf-n)) - (math-nrf-nfm1 (math-float (1- nrf-n)))) + (let ((math-nrf-n nrf-n) + (math-nrf-nf (math-float nrf-n)) + (math-nrf-nfm1 (math-float (1- nrf-n)))) (math-nth-root-float-iter a (or guess (math-make-float 1 (/ (+ (math-numdigs (nth 1 a)) diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index e944f812525..7c75e79a268 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -61,48 +61,48 @@ ;;;###autoload (defun calc-dispatch-help (arg) - "C-x* is a prefix key sequence; follow it with one of these letters: + "\\`C-x *' is a prefix key sequence; follow it with one of these letters: For turning Calc on and off: - C calc. Start the Calculator in a window at the bottom of the screen. - O calc-other-window. Start the Calculator but don't select its window. - B calc-big-or-small. Control whether to use the full Emacs screen for Calc. - Q quick-calc. Use the Calculator in the minibuffer. - K calc-keypad. Start the Calculator in keypad mode (X window system only). - E calc-embedded. Use the Calculator on a formula in this editing buffer. - J calc-embedded-select. Like E, but select appropriate half of => or :=. - W calc-embedded-word. Like E, but activate a single word, i.e., a number. - Z calc-user-invocation. Invoke Calc in the way you defined with `Z I' cmd. - X calc-quit. Turn Calc off. + \\`C' calc. Start the Calculator in a window at the bottom of the screen. + \\`O' calc-other-window. Start the Calculator but don't select its window. + \\`B' calc-big-or-small. Toggle using the full Emacs screen for Calc. + \\`Q' quick-calc. Use the Calculator in the minibuffer. + \\`K' calc-keypad. Start the Calculator in keypad mode (X window system only). + \\`E' calc-embedded. Use the Calculator on a formula in this editing buffer. + \\`J' calc-embedded-select. Like \\`E', but select appropriate half of => or :=. + \\`W' calc-embedded-word. Like \\`E', but activate a single word, i.e., a number. + \\`Z' calc-user-invocation. Invoke Calc in the way you defined with `Z I' cmd. + \\`X' calc-quit. Turn Calc off. For moving data into and out of Calc: - G calc-grab-region. Grab the region defined by mark and point into Calc. - R calc-grab-rectangle. Grab the rectangle defined by mark, point into Calc. - : calc-grab-sum-down. Grab a rectangle and sum the columns. - _ calc-grab-sum-across. Grab a rectangle and sum the rows. - Y calc-copy-to-buffer. Copy a value from the stack into the editing buffer. + \\`G' calc-grab-region. Grab the region defined by mark and point into Calc. + \\`R' calc-grab-rectangle. Grab the rectangle defined by mark, point into Calc. + \\`:' calc-grab-sum-down. Grab a rectangle and sum the columns. + \\`_' calc-grab-sum-across. Grab a rectangle and sum the rows. + \\`Y' calc-copy-to-buffer. Copy a value from the stack into the editing buffer. For use with Embedded mode: - A calc-embedded-activate. Find and activate all :='s and =>'s in buffer. - D calc-embedded-duplicate. Make a copy of this formula and select it. - F calc-embedded-new-formula. Insert a new formula at current point. - N calc-embedded-next. Advance cursor to next known formula in buffer. - P calc-embedded-previous. Advance cursor to previous known formula. - U calc-embedded-update-formula. Re-evaluate formula at point. - \\=` calc-embedded-edit. Use calc-edit to edit formula at point. + \\`A' calc-embedded-activate. Find and activate all :='s and =>'s in buffer. + \\`D' calc-embedded-duplicate. Make a copy of this formula and select it. + \\`F' calc-embedded-new-formula. Insert a new formula at current point. + \\`N' calc-embedded-next. Advance cursor to next known formula in buffer. + \\`P' calc-embedded-previous. Advance cursor to previous known formula. + \\`U' calc-embedded-update-formula. Re-evaluate formula at point. + \\``' calc-embedded-edit. Use calc-edit to edit formula at point. Documentation: - I calc-info. Read the Calculator manual in the Emacs Info system. - T calc-tutorial. Run the Calculator Tutorial using the Emacs Info system. - S calc-summary. Read the Summary from the Calculator manual in Info. + \\`I' calc-info. Read the Calculator manual in the Emacs Info system. + \\`T' calc-tutorial. Run the Calculator Tutorial using the Emacs Info system. + \\`S' calc-summary. Read the Summary from the Calculator manual in Info. Miscellaneous: - L calc-load-everything. Load all parts of the Calculator into memory. - M read-kbd-macro. Read a region of keystroke names as a keyboard macro. - 0 (zero) calc-reset. Reset Calc stack and modes to default state. + \\`L' calc-load-everything. Load all parts of the Calculator into memory. + \\`M' read-kbd-macro. Read a region of keystroke names as a keyboard macro. + \\`0' (zero) calc-reset. Reset Calc stack and modes to default state. -Press `*' twice (`C-x * *') to turn Calc on or off using the same -Calc user interface as before (either C-x * C or C-x * K; initially C-x * C)." +Press \\`*' twice (\\`C-x * *') to turn Calc on or off using the same +Calc user interface as before (either \\`C-x * C' or \\`C-x * K'; initially \\`C-x * C')." (interactive "P") (calc-check-defines) (if calc-dispatch-help @@ -216,26 +216,28 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C)." (defun calc-help () (interactive) (let ((msgs - '("Press `h' for complete help; press `?' repeatedly for a summary" - "Letter keys: Negate; Precision; Yank; Why; Xtended cmd; Quit" - "Letter keys: SHIFT + Undo, reDo; Inverse, Hyperbolic, Option" - "Letter keys: SHIFT + sQrt; Sin, Cos, Tan; Exp, Ln, logB" - "Letter keys: SHIFT + Floor, Round; Abs, conJ, arG; Pi" - "Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro; Keep-args" - "Other keys: +, -, *, /, ^, \\ (int div), : (frac div)" - "Other keys: & (1/x), | (concat), % (modulo), ! (factorial)" - "Other keys: \\=' (alg-entry), = (eval), \\=` (edit); M-RET (last-args)" - "Other keys: SPC/RET (enter/dup), LFD (over); < > (scroll horiz)" - "Other keys: DEL (drop), M-DEL (drop-above); { } (scroll vert)" - "Other keys: TAB (swap/roll-dn), M-TAB (roll-up)" - "Other keys: [ , ; ] (vector), ( , ) (complex), ( ; ) (polar)" - "Prefix keys: Algebra, Binary/business, Convert, Display" - "Prefix keys: Functions, Graphics, Help, J (select)" - "Prefix keys: Kombinatorics/statistics, Modes, Store/recall" - "Prefix keys: Trail/time, Units/statistics, Vector/matrix" - "Prefix keys: Z (user), SHIFT + Z (define)" - "Prefix keys: prefix + ? gives further help for that prefix" - " Calc by Dave Gillespie, daveg@synaptics.com"))) + ;; FIXME: Change these to `substitute-command-keys' syntax. + (mapcar #'substitute-command-keys + '("Press \\`h' for complete help; press \\`?' repeatedly for a summary" + "Letter keys: Negate; Precision; Yank; Why; Xtended cmd; Quit" + "Letter keys: SHIFT + Undo, reDo; Inverse, Hyperbolic, Option" + "Letter keys: SHIFT + sQrt; Sin, Cos, Tan; Exp, Ln, logB" + "Letter keys: SHIFT + Floor, Round; Abs, conJ, arG; Pi" + "Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro; Keep-args" + "Other keys: +, -, *, /, ^, \\ (int div), : (frac div)" + "Other keys: & (1/x), | (concat), % (modulo), ! (factorial)" + "Other keys: \\=' (alg-entry), = (eval), \\=` (edit); M-RET (last-args)" + "Other keys: \\`SPC'/\\`RET' (enter/dup), LFD (over); < > (scroll horiz)" + "Other keys: \\`DEL' (drop), \\`M-DEL' (drop-above); { } (scroll vert)" + "Other keys: \\`TAB' (swap/roll-dn), \\`M-TAB' (roll-up)" + "Other keys: [ , ; ] (vector), ( , ) (complex), ( ; ) (polar)" + "Prefix keys: Algebra, Binary/business, Convert, Display" + "Prefix keys: Functions, Graphics, Help, J (select)" + "Prefix keys: Kombinatorics/statistics, Modes, Store/recall" + "Prefix keys: Trail/time, Units/statistics, Vector/matrix" + "Prefix keys: Z (user), SHIFT + Z (define)" + "Prefix keys: prefix + ? gives further help for that prefix" + " Calc by Dave Gillespie, daveg@synaptics.com")))) (if calc-full-help-flag msgs (if (or calc-inverse-flag calc-hyperbolic-flag) diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index ff00a4a2a68..5690f101182 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -109,11 +109,14 @@ (setq n (and (not (eq calc-auto-why t)) (if calc-auto-why t 1)))) (calc-change-mode 'calc-auto-why n nil) (cond ((null n) - (message "User must press `w' to explain unsimplified results")) + (message (substitute-command-keys + "User must press \\`w' to explain unsimplified results"))) ((eq n t) - (message "Automatically doing `w' to explain unsimplified results")) + (message (substitute-command-keys + "Automatically doing \\`w' to explain unsimplified results"))) (t - (message "Automatically doing `w' only for unusual messages"))))) + (message (substitute-command-keys + "Automatically doing \\`w' only for unusual messages")))))) (defun calc-group-digits (n) (interactive "P") diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 44b967c3859..f11d9741ec7 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -205,9 +205,8 @@ (progn (setq cmd-base-default (concat "User-" keyname)) (setq cmd (completing-read - (concat "Define M-x command name (default calc-" - cmd-base-default - "): ") + (format-prompt "Define M-x command name" + (concat "calc-" cmd-base-default)) obarray 'commandp nil (if (and odef (symbolp (cdr odef))) (symbol-name (cdr odef)) @@ -241,8 +240,8 @@ (setq func (concat "calcFunc-" (completing-read - (concat "Define algebraic function name (default " - cmd-base-default "): ") + (format-prompt "Define algebraic function name" + cmd-base-default) (mapcar (lambda (x) (substring x 9)) (all-completions "calcFunc-" obarray)) @@ -679,7 +678,7 @@ (or last-kbd-macro (error "No keyboard macro defined")) (setq calc-invocation-macro last-kbd-macro) - (message "Use `C-x * Z' to invoke this macro")) + (message (substitute-command-keys "Use \\`C-x * Z' to invoke this macro"))) (defun calc-user-define-edit () (interactive) ; but no calc-wrapper! @@ -1950,7 +1949,7 @@ Redefine the corresponding command." ;; The variable math-exp-env is local to math-define-body, but is ;; used by math-define-exp, which is called (indirectly) by -;; by math-define-body. +;; math-define-body. (defvar math-exp-env) (defun math-define-body (body exp-env) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index c0dd77d9b2a..023dd40c155 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -163,19 +163,19 @@ tag (and (not val) 1)) (message "Variable \"%s\" changed" (calc-var-name var))))))) -(defvar calc-var-name-map nil "Keymap for reading Calc variable names.") -(if calc-var-name-map - () - (setq calc-var-name-map (copy-keymap minibuffer-local-completion-map)) - (define-key calc-var-name-map " " 'self-insert-command) - (mapc (lambda (x) - (define-key calc-var-name-map (char-to-string x) - 'calcVar-digit)) - "0123456789") - (mapc (lambda (x) - (define-key calc-var-name-map (char-to-string x) - 'calcVar-oper)) - "+-*/^|")) +(defvar calc-var-name-map + (let ((map (copy-keymap minibuffer-local-completion-map))) + (define-key map " " #'self-insert-command) + (mapc (lambda (x) + (define-key map (char-to-string x) + #'calcVar-digit)) + "0123456789") + (mapc (lambda (x) + (define-key map (char-to-string x) + #'calcVar-oper)) + "+-*/^|") + map) + "Keymap for reading Calc variable names.") (defvar calc-store-opers) @@ -188,12 +188,15 @@ (let* ((calc-store-opers store-opers) (var (concat "var-" - (let ((minibuffer-completion-table - (mapcar (lambda (x) (substring x 4)) - (all-completions "var-" obarray))) - (minibuffer-completion-predicate - (lambda (x) (boundp (intern (concat "var-" x))))) - (minibuffer-completion-confirm t)) + (minibuffer-with-setup-hook + (lambda () + (setq-local minibuffer-completion-table + (mapcar (lambda (x) (substring x 4)) + (all-completions "var-" obarray))) + (setq-local minibuffer-completion-predicate + (lambda (x) + (boundp (intern (concat "var-" x))))) + (setq-local minibuffer-completion-confirm t)) (read-from-minibuffer prompt nil calc-var-name-map nil 'calc-read-var-name-history))))) @@ -586,7 +589,7 @@ (defun calc-permanent-variable (&optional var) (interactive) (calc-wrapper - (or var (setq var (calc-read-var-name "Save variable (default all): "))) + (or var (setq var (calc-read-var-name (format-prompt "Save variable" "all")))) (let (calc-pv-pos) (and var (or (and (boundp var) (symbol-value var)) (error "No such variable"))) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index d1565e74a04..c8405c7d1a0 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -486,18 +486,13 @@ If COMP or STD is non-nil, put that in the units table instead." (setq defunits (math-get-default-units expr)) (unless new-units (setq new-units - (read-string (concat + (read-string (format-prompt (if (and uoldname (not nouold)) (concat "Old units: " uoldname ", new units") "New units") - (if defunits - (concat - " (default " - defunits - "): ") - ": ")))) + defunits))) (if (and (string= new-units "") defunits) @@ -533,14 +528,7 @@ If COMP or STD is non-nil, put that in the units table instead." (let* ((old-units (math-extract-units expr)) (defunits (math-get-default-units expr)) units - (new-units - (read-string (concat "New units" - (if defunits - (concat - " (default " - defunits - "): ") - ": "))))) + (new-units (read-string (format-prompt "New units" defunits)))) (if (and (string= new-units "") defunits) @@ -596,19 +584,14 @@ If COMP or STD is non-nil, put that in the units table instead." (setq expr (math-mul expr uold))) (setq defunits (math-get-default-units expr)) (setq unew (or new-units - (completing-read - (concat - (if uoldname - (concat "Old temperature units: " - uoldname - ", new units") - "New temperature units") - (if defunits - (concat " (default " - defunits - "): ") - ": ")) - tempunits))) + (completing-read (format-prompt + (if uoldname + (concat "Old temperature units: " + uoldname + ", new units") + "New temperature units") + defunits) + tempunits))) (setq unew (math-read-expr (if (string= unew "") defunits unew))) (when (eq (car-safe unew) 'error) (error "Bad format in units expression: %s" (nth 2 unew))) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 8c6d3f51e5d..71cc68b0c20 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -47,6 +47,8 @@ (calc-check-stack num) (let ((stuff (calc-top-list n (- num n -1)))) (calc-cursor-stack-index num) + (unless calc-kill-line-numbering + (re-search-forward "\\=[0-9]+:\\s-+" (point-at-eol) t)) (let ((first (point))) (calc-cursor-stack-index (- num n)) (if (null nn) @@ -264,14 +266,16 @@ as well as set the contents of the Emacs register REGISTER to TEXT." "Return the CALCVAL portion of the contents of the Calc register REG, unless the TEXT portion doesn't match the contents of the Emacs register REG, in which case either return the contents of the Emacs register (if it is -text) or nil." +text or a number) or nil." (let ((cval (cdr (assq reg calc-register-alist))) (val (cdr (assq reg register-alist)))) - (if (stringp val) - (if (and (stringp (car cval)) - (string= (car cval) val)) - (cdr cval) - val)))) + (cond + ((stringp val) + (if (and (stringp (car cval)) + (string= (car cval) val)) + (cdr cval) + val)) + ((numberp val) (number-to-string val))))) (defun calc-copy-to-register (register start end &optional delete-flag) "Copy the lines in the region into register REGISTER. @@ -711,9 +715,9 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (insert (propertize (concat (or title title "Calc Edit Mode. ") - (format-message "Press `C-c C-c'") + (substitute-command-keys "Press \\`C-c C-c'") (if allow-ret "" " or RET") - (format-message " to finish, `C-x k RET' to cancel.\n\n")) + (substitute-command-keys " to finish, \\`C-x k RET' to cancel.\n\n")) 'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t)) (setq-local calc-edit-top (point)))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 171f7711324..254c703ee22 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -412,7 +412,7 @@ and deleted by `calc-pop'." (defcustom calc-undo-length 100 "The number of undo steps that will be preserved when Calc is quit." - :type 'integer) + :type 'natnum) (defcustom calc-highlight-selections-with-faces nil "If non-nil, use a separate face to indicate selected sub-formulas. @@ -439,6 +439,14 @@ to be identified as that note." :version "24.1" :type 'string) +(defcustom calc-kill-line-numbering t + "If non-nil, calculator kills include any line numbering. + +This option does not affect calc kill and copy commands which +operate on the region, such as `calc-copy-region-as-kill'." + :version "29.1" + :type 'boolean) + (defvar math-format-date-cache) ; calc-forms.el (defface calc-nonselected-face @@ -494,7 +502,7 @@ This setting only applies to floats in normal display mode.") (defmacro defcalcmodevar (var defval &optional doc) "Declare VAR as a Calc variable, with default value DEFVAL and doc-string DOC. The variable VAR will be added to `calc-mode-var-list'." - (declare (doc-string 3)) + (declare (doc-string 3) (indent defun)) `(progn (defvar ,var ,defval ,doc) (add-to-list 'calc-mode-var-list (list (quote ,var) ,defval)))) @@ -1375,7 +1383,7 @@ Notations: 3.14e6 3.14 * 10^6 LONG is a desired text for a wide window, SHORT is a desired abbreviated text, and width is the buffer width, which will be -some fraction of the 'parent' window width (At the time of +some fraction of the \"parent\" window width (At the time of writing, 2/3 for calc, 1/3 for trail). The optional FUDGE is a trial-and-error adjustment number for the edge-cases at the border of the two cases." @@ -1621,7 +1629,8 @@ See calc-keypad for details." (stringp (nth 1 err)) (string-match "max-specpdl-size\\|max-lisp-eval-depth" (nth 1 err))) - (error "Computation got stuck or ran too long. Type `M' to increase the limit") + (error (substitute-command-keys + "Computation got stuck or ran too long. Type \\`M' to increase the limit")) (setq calc-aborted-prefix nil) (signal (car err) (cdr err))))) (when calc-aborted-prefix @@ -3439,7 +3448,7 @@ The prefix `calcFunc-' is added to the specified name to get the actual Lisp function name. See Info node `(calc)Defining Functions'." - (declare (doc-string 3)) ;; FIXME: Edebug spec? + (declare (doc-string 3) (indent defun)) ;; FIXME: Edebug spec? (require 'calc-ext) (math-do-defmath func args body)) |