diff options
| author | Jay Belanger | 2013-11-16 22:22:24 -0600 |
|---|---|---|
| committer | Jay Belanger | 2013-11-16 22:22:24 -0600 |
| commit | 014690de705b6be7c55aa0b9ea85694c4fa1fd73 (patch) | |
| tree | cf6baa4e80e412e7be0453ca21c1fb325367c926 | |
| parent | 0f679e866c6aaf8cebd9291bd715bc99eea511ae (diff) | |
| download | emacs-014690de705b6be7c55aa0b9ea85694c4fa1fd73.tar.gz emacs-014690de705b6be7c55aa0b9ea85694c4fa1fd73.zip | |
* calc/calc.el (calc-context-sensitive-enter): New variable.
(calc-enter): Use `calc-context-sensitive-enter'.
* doc/misc/calc.texi (Customizing Calc): Mention the new variable
`calc-context-sensitive-enter'.
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 8 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calc/calc.el | 14 |
4 files changed, 30 insertions, 2 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 976922a3978..ca4169316c5 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-11-17 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc.texi (Customizing Calc): Mention new variable | ||
| 4 | `calc-context-sensitive-enter'. | ||
| 5 | |||
| 1 | 2013-11-12 Aaron Ecay <aaronecay@gmail.com> | 6 | 2013-11-12 Aaron Ecay <aaronecay@gmail.com> |
| 2 | 7 | ||
| 3 | * org.texi (Exporting code blocks): Document the 'inline-only | 8 | * org.texi (Exporting code blocks): Document the 'inline-only |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 04160eafad0..0154c82750a 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -35696,6 +35696,14 @@ have different dimensions. The default value of @code{calc-ensure-consistent-uni | |||
| 35696 | is @code{nil}. | 35696 | is @code{nil}. |
| 35697 | @end defvar | 35697 | @end defvar |
| 35698 | 35698 | ||
| 35699 | @defvar calc-context-sensitive-enter | ||
| 35700 | The command @code{calc-enter} will typically duplicate the top of the | ||
| 35701 | stack. If @code{calc-context-sensitive-enter} is non-@code{nil}, | ||
| 35702 | then the @code{calc-enter} will copy the element at the cursor to the | ||
| 35703 | top of the stack. The default value of | ||
| 35704 | @code{calc-context-sensitive-enter} is @code{nil}. | ||
| 35705 | @end defvar | ||
| 35706 | |||
| 35699 | @defvar calc-undo-length | 35707 | @defvar calc-undo-length |
| 35700 | The variable @code{calc-undo-length} determines the number of undo | 35708 | The variable @code{calc-undo-length} determines the number of undo |
| 35701 | steps that Calc will keep track of when @code{calc-quit} is called. | 35709 | steps that Calc will keep track of when @code{calc-quit} is called. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2b4f941048c..faa2243ca3b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-11-17 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc/calc.el (calc-context-sensitive-enter): New variable. | ||
| 4 | (calc-enter): Use `calc-context-sensitive-enter'. | ||
| 5 | |||
| 1 | 2013-11-16 Teodor Zlatanov <tzz@lifelogs.com> | 6 | 2013-11-16 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 7 | ||
| 3 | * progmodes/cfengine.el: Version bump. | 8 | * progmodes/cfengine.el: Version bump. |
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 2795a177a41..72d456957c7 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -146,6 +146,7 @@ | |||
| 146 | (declare-function calc-set-language "calc-lang" (lang &optional option no-refresh)) | 146 | (declare-function calc-set-language "calc-lang" (lang &optional option no-refresh)) |
| 147 | (declare-function calc-edit-finish "calc-yank" (&optional keep)) | 147 | (declare-function calc-edit-finish "calc-yank" (&optional keep)) |
| 148 | (declare-function calc-edit-cancel "calc-yank" ()) | 148 | (declare-function calc-edit-cancel "calc-yank" ()) |
| 149 | (declare-function calc-locate-cursor-element "calc-yank" (pt)) | ||
| 149 | (declare-function calc-do-quick-calc "calc-aent" ()) | 150 | (declare-function calc-do-quick-calc "calc-aent" ()) |
| 150 | (declare-function calc-do-calc-eval "calc-aent" (str separator args)) | 151 | (declare-function calc-do-calc-eval "calc-aent" (str separator args)) |
| 151 | (declare-function calc-do-keypad "calc-keypd" (&optional full-display interactive)) | 152 | (declare-function calc-do-keypad "calc-keypd" (&optional full-display interactive)) |
| @@ -426,6 +427,13 @@ when converting units." | |||
| 426 | :version "24.3" | 427 | :version "24.3" |
| 427 | :type 'boolean) | 428 | :type 'boolean) |
| 428 | 429 | ||
| 430 | (defcustom calc-context-sensitive-enter | ||
| 431 | nil | ||
| 432 | "If non-nil, the stack element under the cursor will be copied by `calc-enter'." | ||
| 433 | :group 'calc | ||
| 434 | :version "24.4" | ||
| 435 | :type 'boolean) | ||
| 436 | |||
| 429 | (defcustom calc-undo-length | 437 | (defcustom calc-undo-length |
| 430 | 100 | 438 | 100 |
| 431 | "The number of undo steps that will be preserved when Calc is quit." | 439 | "The number of undo steps that will be preserved when Calc is quit." |
| @@ -2257,8 +2265,10 @@ the United States." | |||
| 2257 | ((= n 0) | 2265 | ((= n 0) |
| 2258 | (calc-push-list (calc-top-list (calc-stack-size)))) | 2266 | (calc-push-list (calc-top-list (calc-stack-size)))) |
| 2259 | (t | 2267 | (t |
| 2260 | (calc-push-list (calc-top-list n)))))) | 2268 | (if (not calc-context-sensitive-enter) |
| 2261 | 2269 | (calc-push-list (calc-top-list n)) | |
| 2270 | (let ((num (max 1 (calc-locate-cursor-element (point))))) | ||
| 2271 | (calc-push-list (calc-top-list n num)))))))) | ||
| 2262 | 2272 | ||
| 2263 | (defun calc-pop (n) | 2273 | (defun calc-pop (n) |
| 2264 | (interactive "P") | 2274 | (interactive "P") |