From 1b3b87dfe0fae8e5266319531c0a874c8b4313b1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 10 Sep 2013 23:31:56 -0400 Subject: Use define-derived-mode (and derived-mode-p). * lisp/play/snake.el (snake-mode): * lisp/play/mpuz.el (mpuz-mode): * lisp/play/landmark.el (lm-mode): * lisp/play/blackbox.el (blackbox-mode): * lisp/play/5x5.el (5x5-mode): * lisp/obsolete/options.el (Edit-options-mode): * lisp/net/quickurl.el (quickurl-list-mode): * lisp/net/newst-treeview.el (newsticker-treeview-mode): * lisp/mail/rmailsum.el (rmail-summary-mode): * lisp/mail/mspools.el (mspools-mode): * lisp/locate.el (locate-mode): * lisp/ibuffer.el (ibuffer-mode): * lisp/emulation/ws-mode.el (wordstar-mode): * lisp/emacs-lisp/debug.el (debugger-mode): * lisp/array.el (array-mode): * lisp/net/eudc.el (eudc-mode): Use define-derived-mode. * lisp/net/mairix.el (mairix-searches-mode-font-lock-keywords): Move initialization into declaration. (mairix-searches-mode): Use define-derived-mode. * lisp/net/eudc-hotlist.el (eudc-hotlist-mode): Use define-derived-mode. (eudc-edit-hotlist): Use dolist. * lisp/man.el (Man-mode-syntax-table): Rename from man-mode-syntax-table. (Man-mode): Use define-derived-mode. * lisp/info.el (Info-edit-mode-map): Rename from Info-edit-map. (Info-edit-mode): Use define-derived-mode. (Info-cease-edit): Use Info-mode. * lisp/eshell/esh-mode.el (eshell-mode-syntax-table): Move initialization into declaration. (eshell-mode): Use define-derived-mode. * lisp/chistory.el (command-history-mode-map): Rename from command-history-map. (command-history-mode): Use define-derived-mode. * lisp/calc/calc.el (calc-trail-mode-map): New var. (calc-trail-mode): Use define-derived-mode. (calc-trail-buffer): Set calc-main-buffer manually. * lisp/bookmark.el (bookmark-insert-annotation): New function. (bookmark-edit-annotation): Use it. (bookmark-edit-annotation-mode): Make it a proper major mode. (bookmark-send-edited-annotation): Use derived-mode-p. * lisp/arc-mode.el (archive-mode): Move kill-all-local-variables a tiny bit closer to its ideal place. Use \' to match EOS. * lisp/cedet/semantic/grammar.el (semantic-grammar-mode): Use define-derived-mode. (semantic-grammar-mode-syntax-table): Rename from semantic-grammar-syntax-table. (semantic-grammar-mode-map): Rename from semantic-grammar-map. * lisp/cedet/data-debug.el (data-debug-mode-map): Rename from data-debug-map. (data-debug-mode): Use define-derived-mode. * lisp/gnus/score-mode.el (gnus-score-mode-map): Move initialization into declaration. (gnus-score-mode): Use define-derived-mode. * lisp/gnus/gnus-srvr.el (gnus-browse-mode): Use define-derived-mode. * lisp/gnus/gnus-kill.el (gnus-kill-file-mode-map): Move initialization into declaration. (gnus-kill-file-mode): Use define-derived-mode. (gnus-kill-file-edit-file, gnus-kill-file-enter-kill, gnus-kill): Use derived-mode-p. * lisp/gnus/gnus-group.el (gnus-group-mode): Use define-derived-mode. (gnus-group-setup-buffer, gnus-group-name-at-point) (gnus-group-make-web-group, gnus-group-enter-directory) (gnus-group-suspend): Use derived-mode-p. * lisp/gnus/gnus-cus.el (gnus-custom-mode): Use define-derived-mode. * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode): Use define-derived-mode. * lisp/gnus/gnus-art.el (gnus-article-mode): Use define-derived-mode. (gnus-article-setup-buffer, gnus-article-prepare) (gnus-article-prepare-display, gnus-sticky-article) (gnus-kill-sticky-article-buffer, gnus-kill-sticky-article-buffers) (gnus-bind-safe-url-regexp, gnus-article-check-buffer) (gnus-article-read-summary-keys): Use derived-mode-p. --- lisp/calc/calc.el | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 2eeb880c34d..2795a177a41 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1387,7 +1387,12 @@ Notations: 3.14e6 3.14 * 10^6 (calc-check-defines)) (setplist 'calc-define nil))))) -(defun calc-trail-mode (&optional buf) +(defvar calc-trail-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map calc-mode-map) + map)) + +(define-derived-mode calc-trail-mode fundamental-mode "Calc Trail" "Calc Trail mode. This mode is used by the *Calc Trail* buffer, which records all results obtained by the GNU Emacs Calculator. @@ -1397,26 +1402,18 @@ the Trail. This buffer uses the same key map as the *Calculator* buffer; calculator commands given here will actually operate on the *Calculator* stack." - (interactive) - (fundamental-mode) - (use-local-map calc-mode-map) - (setq major-mode 'calc-trail-mode) - (setq mode-name "Calc Trail") (setq truncate-lines t) (setq buffer-read-only t) (make-local-variable 'overlay-arrow-position) (make-local-variable 'overlay-arrow-string) - (when buf - (set (make-local-variable 'calc-main-buffer) buf)) (when (= (buffer-size) 0) (let ((buffer-read-only nil)) - (insert (propertize "Emacs Calculator Trail\n" 'face 'italic)))) - (run-mode-hooks 'calc-trail-mode-hook)) + (insert (propertize "Emacs Calculator Trail\n" 'face 'italic))))) (defun calc-create-buffer () "Create and initialize a buffer for the Calculator." (set-buffer (get-buffer-create "*Calculator*")) - (or (eq major-mode 'calc-mode) + (or (derived-mode-p 'calc-mode) (calc-mode)) (setq max-lisp-eval-depth (max max-lisp-eval-depth 1000)) (when calc-always-load-extensions @@ -1439,7 +1436,7 @@ commands given here will actually operate on the *Calculator* stack." (when (get-buffer-window "*Calc Keypad*") (calc-keypad) (set-buffer (window-buffer))) - (if (eq major-mode 'calc-mode) + (if (derived-mode-p 'calc-mode) (calc-quit) (let ((oldbuf (current-buffer))) (calc-create-buffer) @@ -1490,7 +1487,7 @@ commands given here will actually operate on the *Calculator* stack." (if (and (equal (buffer-name) "*Gnuplot Trail*") (> (recursion-depth) 0)) (exit-recursive-edit) - (if (eq major-mode 'calc-edit-mode) + (if (derived-mode-p 'calc-edit-mode) (calc-edit-finish arg) (if calc-was-keypad-mode (calc-keypad) @@ -1504,13 +1501,13 @@ commands given here will actually operate on the *Calculator* stack." (if (and (equal (buffer-name) "*Gnuplot Trail*") (> (recursion-depth) 0)) (exit-recursive-edit)) - (if (eq major-mode 'calc-edit-mode) + (if (derived-mode-p 'calc-edit-mode) (calc-edit-cancel) (if (and interactive calc-embedded-info (eq (current-buffer) (aref calc-embedded-info 0))) (calc-embedded nil) - (unless (eq major-mode 'calc-mode) + (unless (derived-mode-p 'calc-mode) (calc-create-buffer)) (run-hooks 'calc-end-hook) (if (integerp calc-undo-length) @@ -1631,10 +1628,10 @@ See calc-keypad for details." (if (math-lessp 1 time) (calc-record time "(t)")))) (or (memq 'no-align calc-command-flags) - (eq major-mode 'calc-trail-mode) + (derived-mode-p 'calc-trail-mode) (calc-align-stack-window)) (and (memq 'position-point calc-command-flags) - (if (eq major-mode 'calc-mode) + (if (derived-mode-p 'calc-mode) (progn (goto-char (point-min)) (forward-line (1- calc-final-point-line)) @@ -1664,7 +1661,7 @@ See calc-keypad for details." (setq calc-command-flags (cons f calc-command-flags)))) (defun calc-select-buffer () - (or (eq major-mode 'calc-mode) + (or (derived-mode-p 'calc-mode) (if calc-main-buffer (set-buffer calc-main-buffer) (let ((buf (get-buffer "*Calculator*"))) @@ -1801,7 +1798,7 @@ See calc-keypad for details." (and calc-embedded-info (calc-embedded-mode-line-change)))))) (defun calc-align-stack-window () - (if (eq major-mode 'calc-mode) + (if (derived-mode-p 'calc-mode) (progn (let ((win (get-buffer-window (current-buffer)))) (if win @@ -1988,7 +1985,7 @@ See calc-keypad for details." (defvar calc-any-evaltos nil) (defun calc-refresh (&optional align) (interactive) - (and (eq major-mode 'calc-mode) + (and (derived-mode-p 'calc-mode) (not calc-executing-macro) (let* ((buffer-read-only nil) (save-point (point)) @@ -2016,7 +2013,7 @@ See calc-keypad for details." (calc-align-stack-window) (goto-char save-point)) (if save-mark (set-mark save-mark)))) - (and calc-embedded-info (not (eq major-mode 'calc-mode)) + (and calc-embedded-info (not (derived-mode-p 'calc-mode)) (with-current-buffer (aref calc-embedded-info 1) (calc-refresh align))) (setq calc-refresh-count (1+ calc-refresh-count))) @@ -2078,12 +2075,13 @@ the United States." (null (buffer-name calc-trail-buffer))) (save-excursion (setq calc-trail-buffer (get-buffer-create "*Calc Trail*")) - (let ((buf (or (and (not (eq major-mode 'calc-mode)) + (let ((buf (or (and (not (derived-mode-p 'calc-mode)) (get-buffer "*Calculator*")) (current-buffer)))) (set-buffer calc-trail-buffer) - (or (eq major-mode 'calc-trail-mode) - (calc-trail-mode buf))))) + (unless (derived-mode-p 'calc-trail-mode) + (calc-trail-mode) + (set (make-local-variable 'calc-main-buffer) buf))))) (or (and calc-trail-pointer (eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) (with-current-buffer calc-trail-buffer @@ -2152,7 +2150,7 @@ the United States." (defun calc-trail-here () (interactive) - (if (eq major-mode 'calc-trail-mode) + (if (derived-mode-p 'calc-trail-mode) (progn (beginning-of-line) (if (bobp) -- cgit v1.2.1 From 16d9f8966f7aa73f9e7bae8e208c7a35c03cb54d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 11 Sep 2013 22:48:22 -0700 Subject: Update some function declarations * calc/calc-help.el (Info-goto-node): * progmodes/cperl-mode.el (Info-find-node): * vc/ediff.el (Info-goto-node): Update declarations. --- lisp/calc/calc-help.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 2b7b56c3f89..641453568ca 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -30,7 +30,7 @@ (require 'calc-macs) ;; Declare functions which are defined elsewhere. -(declare-function Info-goto-node "info" (nodename &optional fork)) +(declare-function Info-goto-node "info" (nodename &optional fork strict-case)) (declare-function Info-last "info" ()) -- cgit v1.2.1 From c8722a9799832942ff219f4ae881f44985c35924 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Wed, 16 Oct 2013 22:37:05 -0500 Subject: * calc/calc-comb.el (math-prime-test): Don't assume large integers are represented by lists. * doc/misc/calc.el (Data Type Formats): Don't specify the size at which integers begin to be represented by lists. --- lisp/calc/calc-comb.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index e09bef0b5c9..1a2d6092196 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el @@ -815,8 +815,14 @@ (list nil v) '(t)))) ((not (equal n (car math-prime-test-cache))) - (cond ((= (% (nth 1 n) 2) 0) '(nil 2)) - ((= (% (nth 1 n) 5) 0) '(nil 5)) + (cond ((if (consp n) + (= (% (nth 1 n) 2) 0) + (= (% n 2) 0)) + '(nil 2)) + ((if (consp n) + (= (% (nth 1 n) 5) 0) + (= (% n 5) 0)) + '(nil 5)) (t (let ((q n) (sum 0)) (while (not (eq q 0)) (setq sum (% -- cgit v1.2.1 From 014690de705b6be7c55aa0b9ea85694c4fa1fd73 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 16 Nov 2013 22:22:24 -0600 Subject: * 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'. --- lisp/calc/calc.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lisp/calc') 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 @@ (declare-function calc-set-language "calc-lang" (lang &optional option no-refresh)) (declare-function calc-edit-finish "calc-yank" (&optional keep)) (declare-function calc-edit-cancel "calc-yank" ()) +(declare-function calc-locate-cursor-element "calc-yank" (pt)) (declare-function calc-do-quick-calc "calc-aent" ()) (declare-function calc-do-calc-eval "calc-aent" (str separator args)) (declare-function calc-do-keypad "calc-keypd" (&optional full-display interactive)) @@ -426,6 +427,13 @@ when converting units." :version "24.3" :type 'boolean) +(defcustom calc-context-sensitive-enter + nil + "If non-nil, the stack element under the cursor will be copied by `calc-enter'." + :group 'calc + :version "24.4" + :type 'boolean) + (defcustom calc-undo-length 100 "The number of undo steps that will be preserved when Calc is quit." @@ -2257,8 +2265,10 @@ the United States." ((= n 0) (calc-push-list (calc-top-list (calc-stack-size)))) (t - (calc-push-list (calc-top-list n)))))) - + (if (not calc-context-sensitive-enter) + (calc-push-list (calc-top-list n)) + (let ((num (max 1 (calc-locate-cursor-element (point))))) + (calc-push-list (calc-top-list n num)))))))) (defun calc-pop (n) (interactive "P") -- cgit v1.2.1 From 26b75b456e536c1fb2d3979e07e82455b2d9c1ca Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 19 Dec 2013 22:53:24 -0600 Subject: lisp/calc/calc.el (calc-enter, calc-pop): Use the variable `calc-context-sensitive-enter'. doc/misc/calc.texi (Stack Manipulation Commands): Mention using the variable `calc-context-sensitive-enter' for `calc-enter' and `calc-pop'. --- lisp/calc/calc.el | 73 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 33 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 72d456957c7..64549268e6e 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -429,7 +429,8 @@ when converting units." (defcustom calc-context-sensitive-enter nil - "If non-nil, the stack element under the cursor will be copied by `calc-enter'." + "If non-nil, the stack element under the cursor will be copied by `calc-enter' +and deleted by `calc-pop'." :group 'calc :version "24.4" :type 'boolean) @@ -2259,41 +2260,47 @@ the United States." (defun calc-enter (n) (interactive "p") - (calc-wrapper - (cond ((< n 0) - (calc-push-list (calc-top-list 1 (- n)))) - ((= n 0) - (calc-push-list (calc-top-list (calc-stack-size)))) - (t - (if (not calc-context-sensitive-enter) - (calc-push-list (calc-top-list n)) - (let ((num (max 1 (calc-locate-cursor-element (point))))) - (calc-push-list (calc-top-list n num)))))))) + (let ((num (if calc-context-sensitive-enter (max 1 (calc-locate-cursor-element (point)))))) + (calc-wrapper + (cond ((< n 0) + (calc-push-list (calc-top-list 1 (- n)))) + ((= n 0) + (calc-push-list (calc-top-list (calc-stack-size)))) + (num + (calc-push-list (calc-top-list n num))) + (t + (calc-push-list (calc-top-list n))))) + (if (and calc-context-sensitive-enter (> n 0)) (calc-cursor-stack-index (+ num n))))) (defun calc-pop (n) (interactive "P") - (calc-wrapper - (let* ((nn (prefix-numeric-value n)) - (top (and (null n) (calc-top 1)))) - (cond ((and (null n) - (eq (car-safe top) 'incomplete) - (> (length top) (if (eq (nth 1 top) 'intv) 3 2))) - (calc-pop-push-list 1 (let ((tt (copy-sequence top))) - (setcdr (nthcdr (- (length tt) 2) tt) nil) - (list tt)))) - ((< nn 0) - (if (and calc-any-selections - (calc-top-selected 1 (- nn))) - (calc-delete-selection (- nn)) - (calc-pop-stack 1 (- nn) t))) - ((= nn 0) - (calc-pop-stack (calc-stack-size) 1 t)) - (t - (if (and calc-any-selections - (= nn 1) - (calc-top-selected 1 1)) - (calc-delete-selection 1) - (calc-pop-stack nn))))))) + (let ((num (if calc-context-sensitive-enter (max 1 (calc-locate-cursor-element (point)))))) + (calc-wrapper + (let* ((nn (prefix-numeric-value n)) + (top (and (null n) (calc-top 1)))) + (cond ((and calc-context-sensitive-enter (> num 1)) + (calc-pop-stack nn num)) + ((and (null n) + (eq (car-safe top) 'incomplete) + (> (length top) (if (eq (nth 1 top) 'intv) 3 2))) + (calc-pop-push-list 1 (let ((tt (copy-sequence top))) + (setcdr (nthcdr (- (length tt) 2) tt) nil) + (list tt)))) + ((< nn 0) + (if (and calc-any-selections + (calc-top-selected 1 (- nn))) + (calc-delete-selection (- nn)) + (calc-pop-stack 1 (- nn) t))) + ((= nn 0) + (calc-pop-stack (calc-stack-size) 1 t)) + (t + (if (and calc-any-selections + (= nn 1) + (calc-top-selected 1 1)) + (calc-delete-selection 1) + (calc-pop-stack nn)))))) + (if calc-context-sensitive-enter (calc-cursor-stack-index (1- num))))) + -- cgit v1.2.1 From ba3189039adc8ec5eba5ed3e21d42019a4616b7c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 1 Jan 2014 07:43:34 +0000 Subject: Update copyright year to 2014 by running admin/update-copyright. --- lisp/calc/calc-aent.el | 2 +- lisp/calc/calc-alg.el | 2 +- lisp/calc/calc-arith.el | 2 +- lisp/calc/calc-bin.el | 2 +- lisp/calc/calc-comb.el | 2 +- lisp/calc/calc-cplx.el | 2 +- lisp/calc/calc-embed.el | 2 +- lisp/calc/calc-ext.el | 2 +- lisp/calc/calc-fin.el | 2 +- lisp/calc/calc-forms.el | 2 +- lisp/calc/calc-frac.el | 2 +- lisp/calc/calc-funcs.el | 2 +- lisp/calc/calc-graph.el | 2 +- lisp/calc/calc-help.el | 2 +- lisp/calc/calc-incom.el | 2 +- lisp/calc/calc-keypd.el | 2 +- lisp/calc/calc-lang.el | 2 +- lisp/calc/calc-macs.el | 2 +- lisp/calc/calc-map.el | 2 +- lisp/calc/calc-math.el | 2 +- lisp/calc/calc-menu.el | 2 +- lisp/calc/calc-misc.el | 2 +- lisp/calc/calc-mode.el | 2 +- lisp/calc/calc-mtx.el | 2 +- lisp/calc/calc-nlfit.el | 2 +- lisp/calc/calc-poly.el | 2 +- lisp/calc/calc-prog.el | 2 +- lisp/calc/calc-rewr.el | 2 +- lisp/calc/calc-rules.el | 2 +- lisp/calc/calc-sel.el | 2 +- lisp/calc/calc-stat.el | 2 +- lisp/calc/calc-store.el | 2 +- lisp/calc/calc-stuff.el | 2 +- lisp/calc/calc-trail.el | 2 +- lisp/calc/calc-undo.el | 2 +- lisp/calc/calc-units.el | 2 +- lisp/calc/calc-vec.el | 2 +- lisp/calc/calc-yank.el | 2 +- lisp/calc/calc.el | 2 +- lisp/calc/calcalg2.el | 2 +- lisp/calc/calcalg3.el | 2 +- lisp/calc/calccomp.el | 2 +- lisp/calc/calcsel2.el | 2 +- 43 files changed, 43 insertions(+), 43 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 6b0cfbb55d9..107c0ae4ce4 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1,6 +1,6 @@ ;;; calc-aent.el --- algebraic entry functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: Dave Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index 2240c1c81b3..4bd37a4982d 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -1,6 +1,6 @@ ;;; calc-alg.el --- algebraic functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el index c64a4f49fe8..43b42038aa6 100644 --- a/lisp/calc/calc-arith.el +++ b/lisp/calc/calc-arith.el @@ -1,6 +1,6 @@ ;;; calc-arith.el --- arithmetic functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el index a159488b935..8f061b04da4 100644 --- a/lisp/calc/calc-bin.el +++ b/lisp/calc/calc-bin.el @@ -1,6 +1,6 @@ ;;; calc-bin.el --- binary functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index 1a2d6092196..1cec272c869 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el @@ -1,6 +1,6 @@ ;;; calc-comb.el --- combinatoric functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-cplx.el b/lisp/calc/calc-cplx.el index 34297e83a5d..7f1d18a047b 100644 --- a/lisp/calc/calc-cplx.el +++ b/lisp/calc/calc-cplx.el @@ -1,6 +1,6 @@ ;;; calc-cplx.el --- Complex number functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index 0da9be0d499..e6fbb18dd8a 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -1,6 +1,6 @@ ;;; calc-embed.el --- embed Calc in a buffer -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 2cb5bf450d5..885a7f2ceaf 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1,6 +1,6 @@ ;;; calc-ext.el --- various extension functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-fin.el b/lisp/calc/calc-fin.el index a93a57c79ee..32d95973476 100644 --- a/lisp/calc/calc-fin.el +++ b/lisp/calc/calc-fin.el @@ -1,6 +1,6 @@ ;;; calc-fin.el --- financial functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index 77efb1efc84..dbde4cd0c41 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -1,6 +1,6 @@ ;;; calc-forms.el --- data format conversion functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-frac.el b/lisp/calc/calc-frac.el index 63288054bb3..fb8c423c6a4 100644 --- a/lisp/calc/calc-frac.el +++ b/lisp/calc/calc-frac.el @@ -1,6 +1,6 @@ ;;; calc-frac.el --- fraction functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el index 24dd95d23eb..ffca70b2248 100644 --- a/lisp/calc/calc-funcs.el +++ b/lisp/calc/calc-funcs.el @@ -1,6 +1,6 @@ ;;; calc-funcs.el --- well-known functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 16fc6c09dbe..38d75e98029 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -1,6 +1,6 @@ ;;; calc-graph.el --- graph output functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 641453568ca..be04e5a12c0 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -1,6 +1,6 @@ ;;; calc-help.el --- help display functions for Calc, -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-incom.el b/lisp/calc/calc-incom.el index d86668ce328..b3f0d7325b7 100644 --- a/lisp/calc/calc-incom.el +++ b/lisp/calc/calc-incom.el @@ -1,6 +1,6 @@ ;;; calc-incom.el --- complex data type input functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el index bd24bf7f15d..d5021e68806 100644 --- a/lisp/calc/calc-keypd.el +++ b/lisp/calc/calc-keypd.el @@ -1,6 +1,6 @@ ;;; calc-keypd.el --- mouse-capable keypad input for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 965cb65e8db..d02baef8560 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -1,6 +1,6 @@ ;;; calc-lang.el --- calc language functions -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el index 4b75f8d4ae8..af61599e43f 100644 --- a/lisp/calc/calc-macs.el +++ b/lisp/calc/calc-macs.el @@ -1,6 +1,6 @@ ;;; calc-macs.el --- important macros for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-map.el b/lisp/calc/calc-map.el index cfc5a19701f..2c591be00aa 100644 --- a/lisp/calc/calc-map.el +++ b/lisp/calc/calc-map.el @@ -1,6 +1,6 @@ ;;; calc-map.el --- higher-order functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 3b845f563a1..1487d07dfce 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el @@ -1,6 +1,6 @@ ;;; calc-math.el --- mathematical functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el index 5120528eaf4..201dc58a68b 100644 --- a/lisp/calc/calc-menu.el +++ b/lisp/calc/calc-menu.el @@ -1,6 +1,6 @@ ;;; calc-menu.el --- a menu for Calc -;; Copyright (C) 2007-2013 Free Software Foundation, Inc. +;; Copyright (C) 2007-2014 Free Software Foundation, Inc. ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 405131937f9..b21516f5f6a 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -1,6 +1,6 @@ ;;; calc-misc.el --- miscellaneous functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index c46a2e5f21c..244d1f7cfe2 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -1,6 +1,6 @@ ;;; calc-mode.el --- calculator modes for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-mtx.el b/lisp/calc/calc-mtx.el index b3df0e3fde8..4f6dbd2273f 100644 --- a/lisp/calc/calc-mtx.el +++ b/lisp/calc/calc-mtx.el @@ -1,6 +1,6 @@ ;;; calc-mtx.el --- matrix functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el index bd816c1e29c..67309fe8eec 100644 --- a/lisp/calc/calc-nlfit.el +++ b/lisp/calc/calc-nlfit.el @@ -1,6 +1,6 @@ ;;; calc-nlfit.el --- nonlinear curve fitting for Calc -;; Copyright (C) 2007-2013 Free Software Foundation, Inc. +;; Copyright (C) 2007-2014 Free Software Foundation, Inc. ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-poly.el b/lisp/calc/calc-poly.el index 07d725c88e7..515c5fc9275 100644 --- a/lisp/calc/calc-poly.el +++ b/lisp/calc/calc-poly.el @@ -1,6 +1,6 @@ ;;; calc-poly.el --- polynomial functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 4c4d090d7c9..30a06a2aa00 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1,6 +1,6 @@ ;;; calc-prog.el --- user programmability functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el index 96c657285b9..f622f8092a8 100644 --- a/lisp/calc/calc-rewr.el +++ b/lisp/calc/calc-rewr.el @@ -1,6 +1,6 @@ ;;; calc-rewr.el --- rewriting functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-rules.el b/lisp/calc/calc-rules.el index 8dedc257132..120421a7c4b 100644 --- a/lisp/calc/calc-rules.el +++ b/lisp/calc/calc-rules.el @@ -1,6 +1,6 @@ ;;; calc-rules.el --- rules for simplifying algebraic expressions in Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el index ad3c0cc6c3d..b0a2c975903 100644 --- a/lisp/calc/calc-sel.el +++ b/lisp/calc/calc-sel.el @@ -1,6 +1,6 @@ ;;; calc-sel.el --- data selection functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-stat.el b/lisp/calc/calc-stat.el index db8f9d09cc5..2b63821a6ba 100644 --- a/lisp/calc/calc-stat.el +++ b/lisp/calc/calc-stat.el @@ -1,6 +1,6 @@ ;;; calc-stat.el --- statistical functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index e5274b21d8b..185e4e4c859 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -1,6 +1,6 @@ ;;; calc-store.el --- value storage functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el index 9535248c8f9..a30910407ef 100644 --- a/lisp/calc/calc-stuff.el +++ b/lisp/calc/calc-stuff.el @@ -1,6 +1,6 @@ ;;; calc-stuff.el --- miscellaneous functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-trail.el b/lisp/calc/calc-trail.el index 61824882446..c3cfad8ba72 100644 --- a/lisp/calc/calc-trail.el +++ b/lisp/calc/calc-trail.el @@ -1,6 +1,6 @@ ;;; calc-trail.el --- functions for manipulating the Calc "trail" -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-undo.el b/lisp/calc/calc-undo.el index cfae9b3e227..109f53dfdf8 100644 --- a/lisp/calc/calc-undo.el +++ b/lisp/calc/calc-undo.el @@ -1,6 +1,6 @@ ;;; calc-undo.el --- undo functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 595d875eb6e..31efd4b4ab3 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -1,6 +1,6 @@ ;;; calc-units.el --- unit conversion functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el index 35ca41832dd..d29314ef8ed 100644 --- a/lisp/calc/calc-vec.el +++ b/lisp/calc/calc-vec.el @@ -1,6 +1,6 @@ ;;; calc-vec.el --- vector functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index d9807e70c92..76ed7efb91c 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -1,6 +1,6 @@ ;;; calc-yank.el --- kill-ring functionality for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 64549268e6e..ba1c7de9967 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1,6 +1,6 @@ ;;; calc.el --- the GNU Emacs calculator -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el index cd962e7dbed..1b86f79149a 100644 --- a/lisp/calc/calcalg2.el +++ b/lisp/calc/calcalg2.el @@ -1,6 +1,6 @@ ;;; calcalg2.el --- more algebraic functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 564edc66f23..d84f0de9bae 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -1,6 +1,6 @@ ;;; calcalg3.el --- more algebraic functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index 2aa971628b4..f913b66be2d 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -1,6 +1,6 @@ ;;; calccomp.el --- composition functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calcsel2.el b/lisp/calc/calcsel2.el index f299e6a8b73..c9ed9ff767b 100644 --- a/lisp/calc/calcsel2.el +++ b/lisp/calc/calcsel2.el @@ -1,6 +1,6 @@ ;;; calcsel2.el --- selection functions for Calc -;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger -- cgit v1.2.1 From d5081c1ed8e0dd509007b7a617d2640686e91f75 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 5 Jan 2014 22:25:30 -0800 Subject: Spelling fixes. * calc/calc-yank.el (calc-edit-mode, calc-edit-cancel): * emacs-lisp/debug.el (cancel-debug-on-entry): * epg.el (epg-error-to-string): * files.el (recover-file): * lpr.el (lpr-buffer, print-buffer, lpr-region, print-region): * mail/emacsbug.el (report-emacs-bug-hook): * mail/sendmail.el (mail-recover): * ses.el (ses-yank-resize): * term/ns-win.el (ns-print-buffer): Spelling fixes in diagnostics, mostly for "canceled" with one L. * epg.el (epg-key-capability-alist): Rename from misspelled version. All uses changed. * obsolete/xesam.el (xesam-all-fields): Fix misspelled field name. --- lisp/calc/calc-yank.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 76ed7efb91c..0f38b318432 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -588,7 +588,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (add-hook 'kill-buffer-hook (lambda () (let ((calc-edit-handler nil)) (calc-edit-finish t)) - (message "(Cancelled)")) t t) + (message "(Canceled)")) t t) (insert (propertize (concat (or title title "Calc Edit Mode. ") @@ -669,7 +669,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (interactive) (let ((calc-edit-handler nil)) (calc-edit-finish)) - (message "(Cancelled)")) + (message "(Canceled)")) (defun calc-finish-stack-edit (num) (let ((buf (current-buffer)) -- cgit v1.2.1 From cc0f2ece4753d6e15eaa9519dc672b9ef332a55d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Jan 2014 20:50:40 -0500 Subject: Fix some function declarations * lisp/calc/calc-embed.el (thing-at-point-looking-at): * lisp/emacs-lisp/map-ynp.el (x-popup-dialog): * lisp/obsolete/lmenu.el (x-popup-dialog): * lisp/emacs-lisp/package.el (url-recreate-url): * lisp/mail/mailclient.el (clipboard-kill-ring-save): * lisp/subr.el (x-popup-dialog): Update declaration. * lisp/mail/rmail.el (rmail-mime-message-p): * lisp/window.el (tool-bar-lines-needed): Remove unnecessary declaration. --- lisp/calc/calc-embed.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index e6fbb18dd8a..52d2f4c0611 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -30,7 +30,8 @@ (require 'calc-macs) ;; Declare functions which are defined elsewhere. -(declare-function thing-at-point-looking-at "thingatpt" (regexp)) +(declare-function thing-at-point-looking-at "thingatpt" + (regexp &optional distance)) (defun calc-show-plain (n) -- cgit v1.2.1 From 6a6b8e405e82dfcc506bb926f742c9fa1f5b080b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 2 Feb 2014 16:40:49 -0800 Subject: Be more consistent in using register-read-with-preview to read registers * frameset.el (frameset-to-register): * kmacro.el (kmacro-to-register): * register.el (increment-register): * calc/calc-yank.el (calc-copy-to-register, calc-insert-register) (calc-append-to-register, calc-prepend-to-register): * play/gametree.el (gametree-layout-to-register) (gametree-apply-register-layout): * textmodes/picture.el (picture-clear-rectangle-to-register) (picture-yank-rectangle-from-register): * vc/emerge.el (emerge-combine-versions-register): Use register-read-with-preview to read registers. * cedet/semantic/senator.el (senator-copy-tag-to-register): Use register-read-with-preview, if available. * calculator.el, emulation/viper-cmd.el: Comments. --- lisp/calc/calc-yank.el | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 0f38b318432..8d182372cfb 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -163,8 +163,12 @@ text) or `nil'." (defun calc-copy-to-register (register start end &optional delete-flag) "Copy the lines in the region into register REGISTER. -With prefix arg, delete as well." - (interactive "cCopy to register: \nr\nP") +With prefix arg, delete as well. + +Interactively, reads the register using `register-read-with-preview'." + (interactive (list (register-read-with-preview "Copy to register: ") + (region-beginning) (region-end) + current-prefix-arg)) (if (eq major-mode 'calc-mode) (let* ((top-num (calc-locate-cursor-element start)) (top-pos (save-excursion @@ -183,8 +187,10 @@ With prefix arg, delete as well." (copy-to-register register start end delete-flag))) (defun calc-insert-register (register) - "Insert the contents of register REGISTER." - (interactive "cInsert register: ") + "Insert the contents of register REGISTER. + +Interactively, reads the register using `register-read-with-preview'." + (interactive (list (register-read-with-preview "Insert register: "))) (if (eq major-mode 'calc-mode) (let ((val (calc-get-register register))) (calc-wrapper @@ -237,16 +243,24 @@ otherwise the end. If DELETE-FLAG is non-nil, also delete the region." (defun calc-append-to-register (register start end &optional delete-flag) "Copy the lines in the region to the end of register REGISTER. -With prefix arg, also delete the region." - (interactive "cAppend to register: \nr\nP") +With prefix arg, also delete the region. + +Interactively, reads the register using `register-read-with-preview'." + (interactive (list (register-read-with-preview "Append to register: ") + (region-beginning) (region-end) + current-prefix-arg)) (if (eq major-mode 'calc-mode) (calc-add-to-register register start end nil delete-flag) (append-to-register register start end delete-flag))) (defun calc-prepend-to-register (register start end &optional delete-flag) "Copy the lines in the region to the beginning of register REGISTER. -With prefix arg, also delete the region." - (interactive "cPrepend to register: \nr\nP") +With prefix arg, also delete the region. + +Interactively, reads the register using `register-read-with-preview'." + (interactive (list (register-read-with-preview "Prepend to register: ") + (region-beginning) (region-end) + current-prefix-arg)) (if (eq major-mode 'calc-mode) (calc-add-to-register register start end t delete-flag) (prepend-to-register register start end delete-flag))) -- cgit v1.2.1 From 2804e0bd8f9a58d8d9e77965cdb34f495ee7f292 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 13 Feb 2014 20:35:59 -0600 Subject: lisp/calc/calc-menu.el (calc-vectors-menu): Remove menu item for incorrect keybinding. doc/misc/calc.texi (Single-Variable Statistics): Remove mention of incorrect keybinding. --- lisp/calc/calc-menu.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el index 201dc58a68b..9dbb40aa824 100644 --- a/lisp/calc/calc-menu.el +++ b/lisp/calc/calc-menu.el @@ -917,12 +917,13 @@ (call-interactively 'calc-vector-geometric-mean))) :keys "H u G" :active (>= (calc-stack-size) 1)] - ["RMS(1:)" - (progn (require 'calc-arith) - (call-interactively 'calc-abs)) - :keys "A" - :active (>= (calc-stack-size) 1) - :help "The root-mean-square, or quadratic mean"]) + ;; ["RMS(1:)" + ;; (progn (require 'calc-arith) + ;; (call-interactively 'calc-abs)) + ;; :keys "A" + ;; :active (>= (calc-stack-size) 1) + ;; :help "The root-mean-square, or quadratic mean"] + ) ["Abbreviate long vectors" (progn (require 'calc-mode) -- cgit v1.2.1 From ec774634839b0d6ea52f96e272954bdbb5cd9726 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 24 May 2014 23:14:47 +0800 Subject: * calc/calc.el (math-bignum): Handle most-negative-fixnum. Fixes: debbugs:17556 --- lisp/calc/calc.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index ba1c7de9967..04d852e5cb3 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2773,9 +2773,18 @@ largest Emacs integer.") ;; Coerce integer A to be a bignum. [B S] (defun math-bignum (a) - (if (>= a 0) - (cons 'bigpos (math-bignum-big a)) - (cons 'bigneg (math-bignum-big (- a))))) + (cond + ((>= a 0) + (cons 'bigpos (math-bignum-big a))) + ((= a most-negative-fixnum) + ;; Note: cannot get the negation directly because + ;; (- most-negative-fixnum) is most-negative-fixnum. + ;; + ;; most-negative-fixnum := -most-positive-fixnum - 1 + (math-sub (cons 'bigneg (math-bignum-big most-positive-fixnum)) + 1)) + (t + (cons 'bigneg (math-bignum-big (- a)))))) (defun math-bignum-big (a) ; [L s] (if (= a 0) -- cgit v1.2.1 From 6e5a5743ddab1142018f20000081184f0bd9dc94 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Thu, 26 Jun 2014 11:13:13 +0400 Subject: * src/fns.c (Fcompare_strings): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE. * lisp/calc/calc-alg.el (math-beforep): * lisp/progmodes/cc-guess.el (c-guess-view-reorder-offsets-alist-in-style): Simplify because string-lessp can accept symbols as args. --- lisp/calc/calc-alg.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index 4bd37a4982d..c26b007bb96 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -293,7 +293,7 @@ (Math-objectp a)) ((eq (car a) 'var) (if (eq (car b) 'var) - (string-lessp (symbol-name (nth 1 a)) (symbol-name (nth 1 b))) + (string-lessp (nth 1 a) (nth 1 b)) (not (Math-numberp b)))) ((eq (car b) 'var) (Math-numberp a)) ((eq (car a) (car b)) @@ -302,7 +302,7 @@ (and b (or (null a) (math-beforep (car a) (car b))))) - (t (string-lessp (symbol-name (car a)) (symbol-name (car b)))))) + (t (string-lessp (car a) (car b))))) (defsubst math-simplify-extended (a) -- cgit v1.2.1 From 708dc66d7b8dd5bd4f66558cd6a61502b6b68b43 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Fri, 27 Jun 2014 12:10:04 +0800 Subject: Backport fix for http://debbugs.gnu.org/17556 from trunk * lisp/calc/calc.el (math-bignum): Handle most-negative-fixnum. --- lisp/calc/calc.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index ba1c7de9967..04d852e5cb3 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2773,9 +2773,18 @@ largest Emacs integer.") ;; Coerce integer A to be a bignum. [B S] (defun math-bignum (a) - (if (>= a 0) - (cons 'bigpos (math-bignum-big a)) - (cons 'bigneg (math-bignum-big (- a))))) + (cond + ((>= a 0) + (cons 'bigpos (math-bignum-big a))) + ((= a most-negative-fixnum) + ;; Note: cannot get the negation directly because + ;; (- most-negative-fixnum) is most-negative-fixnum. + ;; + ;; most-negative-fixnum := -most-positive-fixnum - 1 + (math-sub (cons 'bigneg (math-bignum-big most-positive-fixnum)) + 1)) + (t + (cons 'bigneg (math-bignum-big (- a)))))) (defun math-bignum-big (a) ; [L s] (if (= a 0) -- cgit v1.2.1 From 86e714105d760ce1bcc03cd4338b9839e0bfccb9 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 4 Sep 2014 20:04:47 -0500 Subject: calc/calc-forms.el (math-normalize-hms): Do a better check for "negative" hms forms. --- lisp/calc/calc-forms.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index dbde4cd0c41..a48075cce91 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -273,7 +273,10 @@ (m (math-normalize (nth 2 a))) (s (let ((calc-internal-prec (max (- calc-internal-prec 4) 3))) (math-normalize (nth 3 a))))) - (if (math-negp h) + (if (or + (math-negp h) + (and (= h 0) (math-negp m)) + (and (= h 0) (= m 0) (math-negp s))) (progn (if (math-posp s) (setq s (math-add s -60) -- cgit v1.2.1 From a57fa9642d4953dd6b249f563776e8e9ed60ced5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 1 Oct 2014 13:23:42 -0400 Subject: * lisp/subr.el (alist-get): New accessor. * lisp/emacs-lisp/gv.el (alist-get): Provide expander. * lisp/winner.el (winner-remember): * lisp/tempo.el (tempo-use-tag-list): * lisp/progmodes/gud.el (minor-mode-map-alist): * lisp/international/mule-cmds.el (define-char-code-property): * lisp/frameset.el (frameset-filter-params): * lisp/files.el (dir-locals-set-class-variables): * lisp/register.el (get-register, set-register): * lisp/calc/calc-yank.el (calc-set-register): Use it. * lisp/ps-print.el (ps-get, ps-put, ps-del): Mark as obsolete. * lisp/tooltip.el (tooltip-set-param): Mark as obsolete. (tooltip-show): Use alist-get instead. * lisp/ses.el (ses--alist-get): Remove. Use alist-get instead. * admin/unidata/unidata-gen.el (unidata-gen-table-word-list): Use alist-get and cl-incf. --- lisp/calc/calc-prog.el | 3 +++ lisp/calc/calc-yank.el | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 30a06a2aa00..156bf4cd0db 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -139,6 +139,7 @@ "calc-")))) (let* ((kmap (calc-user-key-map)) (old (assq key kmap))) + ;; FIXME: Why not (define-key kmap (vector key) func)? (if old (setcdr old func) (setcdr kmap (cons (cons key func) (cdr kmap)))))))) @@ -322,6 +323,7 @@ (if key (let* ((kmap (calc-user-key-map)) (old (assq key kmap))) + ;; FIXME: Why not (define-key kmap (vector key) cmd)? (if old (setcdr old cmd) (setcdr kmap (cons (cons key cmd) (cdr kmap))))))) @@ -467,6 +469,7 @@ (format "z%c" key))))) (let* ((kmap (calc-user-key-map)) (old (assq key kmap))) + ;; FIXME: Why not (define-key kmap (vector key) func)? (if old (setcdr old cmd) (setcdr kmap (cons (cons key cmd) (cdr kmap)))))))) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 8d182372cfb..9781d4174f5 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -143,10 +143,7 @@ TEXT and CALCVAL are the TEXT and internal structure of stack entries.") "Set the contents of the Calc register REGISTER to (TEXT . CALCVAL), as well as set the contents of the Emacs register REGISTER to TEXT." (set-register register text) - (let ((aelt (assq register calc-register-alist))) - (if aelt - (setcdr aelt (cons text calcval)) - (push (cons register (cons text calcval)) calc-register-alist)))) + (setf (alist-get register calc-register-alist) (cons text calcval))) (defun calc-get-register (reg) "Return the CALCVAL portion of the contents of the Calc register REG, -- cgit v1.2.1 From 2f990ea257a24dff9340927e10644243042addf0 Mon Sep 17 00:00:00 2001 From: "H. Dieter Wilhelm" Date: Wed, 1 Oct 2014 20:41:10 -0500 Subject: calc/calc-help.el (calc-describe-thing): Quote strings which could look like regexps. --- lisp/calc/calc-help.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index be04e5a12c0..dfd29230fe5 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -366,9 +366,9 @@ C-w Describe how there is no warranty for Calc." (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (or (let ((case-fold-search nil)) (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\ Date: Tue, 28 Oct 2014 19:37:37 -0500 Subject: doc/misc/calc.texi (Quick Calculator): Mention prefix argument of `quick-calc'. etc/NEWS: Mention prefix argument of `quick-calc'. lisp/calc/calc.el (quick-calc): lisp/calc/calc-aent.el (calc-do-quick-calc): New argument INSERT. --- lisp/calc/calc-aent.el | 5 +++-- lisp/calc/calc.el | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 107c0ae4ce4..968d30ee60a 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -52,7 +52,7 @@ "The history list for quick-calc.") ;;;###autoload -(defun calc-do-quick-calc () +(defun calc-do-quick-calc (&optional insert) (require 'calc-ext) (calc-check-defines) (if (eq major-mode 'calc-mode) @@ -108,7 +108,8 @@ (setq buf long)))) (calc-handle-whys) (message "Result: %s" buf))) - (if (eq last-command-event 10) + (if (or insert + (eq last-command-event 10)) (insert shortbuf) (kill-new shortbuf))))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 04d852e5cb3..85266fbac32 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -147,7 +147,7 @@ (declare-function calc-edit-finish "calc-yank" (&optional keep)) (declare-function calc-edit-cancel "calc-yank" ()) (declare-function calc-locate-cursor-element "calc-yank" (pt)) -(declare-function calc-do-quick-calc "calc-aent" ()) +(declare-function calc-do-quick-calc "calc-aent" (&optional insert)) (declare-function calc-do-calc-eval "calc-aent" (str separator args)) (declare-function calc-do-keypad "calc-keypd" (&optional full-display interactive)) (declare-function calcFunc-unixtime "calc-forms" (date &optional zone)) @@ -1549,10 +1549,12 @@ commands given here will actually operate on the *Calculator* stack." (and kbuf (bury-buffer kbuf)))))) ;;;###autoload -(defun quick-calc () - "Do a quick calculation in the minibuffer without invoking full Calculator." - (interactive) - (calc-do-quick-calc)) +(defun quick-calc (&optional insert) + "Do a quick calculation in the minibuffer without invoking full Calculator. +With prefix argument INSERT, insert the result in the current +buffer. Otherwise, the result is copied into the kill ring." + (interactive "P") + (calc-do-quick-calc insert)) ;;;###autoload (defun calc-eval (str &optional separator &rest args) -- cgit v1.2.1 From 1a30156b984735be444d54e51c40bc3243345110 Mon Sep 17 00:00:00 2001 From: Thierry Banel Date: Sat, 15 Nov 2014 23:24:25 -0600 Subject: 2014-11-16 Thierry Banel (tiny change) * calc-arith.el (math-max-list, math-min-list): Fix bug for date handling. --- lisp/calc/calc-arith.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el index 43b42038aa6..3a2d1598491 100644 --- a/lisp/calc/calc-arith.el +++ b/lisp/calc/calc-arith.el @@ -2249,7 +2249,7 @@ (defun math-min-list (a b) (if b - (if (or (Math-anglep (car b)) (eq (car b) 'date) + (if (or (Math-anglep (car b)) (eq (caar b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-min-list (math-min a (car b)) (cdr b)) @@ -2279,7 +2279,7 @@ (defun math-max-list (a b) (if b - (if (or (Math-anglep (car b)) (eq (car b) 'date) + (if (or (Math-anglep (car b)) (eq (caar b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-max-list (math-max a (car b)) (cdr b)) -- cgit v1.2.1 From 342bc0e04b68d9c52503816bedaf67c9e77be8d2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Nov 2014 17:56:49 -0800 Subject: .gitignore cleanup. * .gitignore: Merge contents of subsidiary files and organize the result so as to avoid duplication. Remove no-longer needed entries. * admin/charsets/.gitignore, admin/unidata/.gitignore: * doc/lispintro/.gitignore, etc/.gitignore, leim/.gitignore: * leim/ja-dic/.gitignore, lib-src/.gitignore, lisp/.gitignore: * lisp/calc/.gitignore, lisp/calendar/.gitignore: * lisp/cedet/.gitignore, lisp/emulation/.gitignore: * lisp/erc/.gitignore, lisp/eshell/.gitignore, lisp/gnus/.gitignore: * lisp/international/.gitignore, lisp/language/.gitignore: * lisp/leim/.gitignore, lisp/leim/quail/.gitignore: * lisp/mail/.gitignore, lisp/mh-e/.gitignore, lisp/net/.gitignore: * lisp/nxml/.gitignore, lisp/obsolete/.gitignore: * lisp/play/.gitignore, lisp/progmodes/.gitignore: * lisp/term/.gitignore, lisp/textmodes/.gitignore: * lisp/url/.gitignore, nt/.gitignore, src/.gitignore: Remove; no longer needed. --- lisp/calc/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 lisp/calc/.gitignore (limited to 'lisp/calc') diff --git a/lisp/calc/.gitignore b/lisp/calc/.gitignore deleted file mode 100644 index a46b68dccbd..00000000000 --- a/lisp/calc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.elc -calc-loaddefs.el -- cgit v1.2.1 From 7e09ef09a479731d01b1ca46e94ddadd73ac98e3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 1 Jan 2015 14:26:41 -0800 Subject: Update copyright year to 2015 Run admin/update-copyright. --- lisp/calc/calc-aent.el | 2 +- lisp/calc/calc-alg.el | 2 +- lisp/calc/calc-arith.el | 2 +- lisp/calc/calc-bin.el | 2 +- lisp/calc/calc-comb.el | 2 +- lisp/calc/calc-cplx.el | 2 +- lisp/calc/calc-embed.el | 2 +- lisp/calc/calc-ext.el | 2 +- lisp/calc/calc-fin.el | 2 +- lisp/calc/calc-forms.el | 2 +- lisp/calc/calc-frac.el | 2 +- lisp/calc/calc-funcs.el | 2 +- lisp/calc/calc-graph.el | 2 +- lisp/calc/calc-help.el | 2 +- lisp/calc/calc-incom.el | 2 +- lisp/calc/calc-keypd.el | 2 +- lisp/calc/calc-lang.el | 2 +- lisp/calc/calc-macs.el | 2 +- lisp/calc/calc-map.el | 2 +- lisp/calc/calc-math.el | 2 +- lisp/calc/calc-menu.el | 2 +- lisp/calc/calc-misc.el | 2 +- lisp/calc/calc-mode.el | 2 +- lisp/calc/calc-mtx.el | 2 +- lisp/calc/calc-nlfit.el | 2 +- lisp/calc/calc-poly.el | 2 +- lisp/calc/calc-prog.el | 2 +- lisp/calc/calc-rewr.el | 2 +- lisp/calc/calc-rules.el | 2 +- lisp/calc/calc-sel.el | 2 +- lisp/calc/calc-stat.el | 2 +- lisp/calc/calc-store.el | 2 +- lisp/calc/calc-stuff.el | 2 +- lisp/calc/calc-trail.el | 2 +- lisp/calc/calc-undo.el | 2 +- lisp/calc/calc-units.el | 2 +- lisp/calc/calc-vec.el | 2 +- lisp/calc/calc-yank.el | 2 +- lisp/calc/calc.el | 2 +- lisp/calc/calcalg2.el | 2 +- lisp/calc/calcalg3.el | 2 +- lisp/calc/calccomp.el | 2 +- lisp/calc/calcsel2.el | 2 +- 43 files changed, 43 insertions(+), 43 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 968d30ee60a..23de53e0f0c 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1,6 +1,6 @@ ;;; calc-aent.el --- algebraic entry functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: Dave Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index c26b007bb96..ebc5ba66ec6 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -1,6 +1,6 @@ ;;; calc-alg.el --- algebraic functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el index 3a2d1598491..de27c5684e6 100644 --- a/lisp/calc/calc-arith.el +++ b/lisp/calc/calc-arith.el @@ -1,6 +1,6 @@ ;;; calc-arith.el --- arithmetic functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el index 8f061b04da4..9a1e524e609 100644 --- a/lisp/calc/calc-bin.el +++ b/lisp/calc/calc-bin.el @@ -1,6 +1,6 @@ ;;; calc-bin.el --- binary functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index 1cec272c869..4e52a3b144e 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el @@ -1,6 +1,6 @@ ;;; calc-comb.el --- combinatoric functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-cplx.el b/lisp/calc/calc-cplx.el index 7f1d18a047b..edcd3c21a0b 100644 --- a/lisp/calc/calc-cplx.el +++ b/lisp/calc/calc-cplx.el @@ -1,6 +1,6 @@ ;;; calc-cplx.el --- Complex number functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index 52d2f4c0611..fcb4b032096 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -1,6 +1,6 @@ ;;; calc-embed.el --- embed Calc in a buffer -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 885a7f2ceaf..c3acb89e417 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1,6 +1,6 @@ ;;; calc-ext.el --- various extension functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-fin.el b/lisp/calc/calc-fin.el index 32d95973476..76c34e63ef8 100644 --- a/lisp/calc/calc-fin.el +++ b/lisp/calc/calc-fin.el @@ -1,6 +1,6 @@ ;;; calc-fin.el --- financial functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index a48075cce91..ca6d021cef2 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -1,6 +1,6 @@ ;;; calc-forms.el --- data format conversion functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-frac.el b/lisp/calc/calc-frac.el index fb8c423c6a4..830bafed6ce 100644 --- a/lisp/calc/calc-frac.el +++ b/lisp/calc/calc-frac.el @@ -1,6 +1,6 @@ ;;; calc-frac.el --- fraction functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el index ffca70b2248..51922c88099 100644 --- a/lisp/calc/calc-funcs.el +++ b/lisp/calc/calc-funcs.el @@ -1,6 +1,6 @@ ;;; calc-funcs.el --- well-known functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 38d75e98029..20b0249ec1a 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -1,6 +1,6 @@ ;;; calc-graph.el --- graph output functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index dfd29230fe5..511e208ddea 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -1,6 +1,6 @@ ;;; calc-help.el --- help display functions for Calc, -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-incom.el b/lisp/calc/calc-incom.el index b3f0d7325b7..b2856b99adc 100644 --- a/lisp/calc/calc-incom.el +++ b/lisp/calc/calc-incom.el @@ -1,6 +1,6 @@ ;;; calc-incom.el --- complex data type input functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el index d5021e68806..18e900dc241 100644 --- a/lisp/calc/calc-keypd.el +++ b/lisp/calc/calc-keypd.el @@ -1,6 +1,6 @@ ;;; calc-keypd.el --- mouse-capable keypad input for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index d02baef8560..066d781cc95 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -1,6 +1,6 @@ ;;; calc-lang.el --- calc language functions -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el index af61599e43f..9730d30a86b 100644 --- a/lisp/calc/calc-macs.el +++ b/lisp/calc/calc-macs.el @@ -1,6 +1,6 @@ ;;; calc-macs.el --- important macros for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-map.el b/lisp/calc/calc-map.el index 2c591be00aa..3b5949c274b 100644 --- a/lisp/calc/calc-map.el +++ b/lisp/calc/calc-map.el @@ -1,6 +1,6 @@ ;;; calc-map.el --- higher-order functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 1487d07dfce..e7d073a9c7a 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el @@ -1,6 +1,6 @@ ;;; calc-math.el --- mathematical functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el index 9dbb40aa824..44086872dd0 100644 --- a/lisp/calc/calc-menu.el +++ b/lisp/calc/calc-menu.el @@ -1,6 +1,6 @@ ;;; calc-menu.el --- a menu for Calc -;; Copyright (C) 2007-2014 Free Software Foundation, Inc. +;; Copyright (C) 2007-2015 Free Software Foundation, Inc. ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index b21516f5f6a..9c5d7184149 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -1,6 +1,6 @@ ;;; calc-misc.el --- miscellaneous functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index 244d1f7cfe2..be18dcd0349 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -1,6 +1,6 @@ ;;; calc-mode.el --- calculator modes for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-mtx.el b/lisp/calc/calc-mtx.el index 4f6dbd2273f..b8c5ff91093 100644 --- a/lisp/calc/calc-mtx.el +++ b/lisp/calc/calc-mtx.el @@ -1,6 +1,6 @@ ;;; calc-mtx.el --- matrix functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el index 67309fe8eec..8e0eb738682 100644 --- a/lisp/calc/calc-nlfit.el +++ b/lisp/calc/calc-nlfit.el @@ -1,6 +1,6 @@ ;;; calc-nlfit.el --- nonlinear curve fitting for Calc -;; Copyright (C) 2007-2014 Free Software Foundation, Inc. +;; Copyright (C) 2007-2015 Free Software Foundation, Inc. ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-poly.el b/lisp/calc/calc-poly.el index 515c5fc9275..1dab3c474aa 100644 --- a/lisp/calc/calc-poly.el +++ b/lisp/calc/calc-poly.el @@ -1,6 +1,6 @@ ;;; calc-poly.el --- polynomial functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 156bf4cd0db..27114077d15 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1,6 +1,6 @@ ;;; calc-prog.el --- user programmability functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el index f622f8092a8..e57a6b483c8 100644 --- a/lisp/calc/calc-rewr.el +++ b/lisp/calc/calc-rewr.el @@ -1,6 +1,6 @@ ;;; calc-rewr.el --- rewriting functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-rules.el b/lisp/calc/calc-rules.el index 120421a7c4b..4489f66bf99 100644 --- a/lisp/calc/calc-rules.el +++ b/lisp/calc/calc-rules.el @@ -1,6 +1,6 @@ ;;; calc-rules.el --- rules for simplifying algebraic expressions in Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el index b0a2c975903..ec104ee3c53 100644 --- a/lisp/calc/calc-sel.el +++ b/lisp/calc/calc-sel.el @@ -1,6 +1,6 @@ ;;; calc-sel.el --- data selection functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-stat.el b/lisp/calc/calc-stat.el index 2b63821a6ba..cf0b3ea4a12 100644 --- a/lisp/calc/calc-stat.el +++ b/lisp/calc/calc-stat.el @@ -1,6 +1,6 @@ ;;; calc-stat.el --- statistical functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 185e4e4c859..11bf96455b7 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -1,6 +1,6 @@ ;;; calc-store.el --- value storage functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el index a30910407ef..91ef259a109 100644 --- a/lisp/calc/calc-stuff.el +++ b/lisp/calc/calc-stuff.el @@ -1,6 +1,6 @@ ;;; calc-stuff.el --- miscellaneous functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-trail.el b/lisp/calc/calc-trail.el index c3cfad8ba72..9417f7f3fb6 100644 --- a/lisp/calc/calc-trail.el +++ b/lisp/calc/calc-trail.el @@ -1,6 +1,6 @@ ;;; calc-trail.el --- functions for manipulating the Calc "trail" -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-undo.el b/lisp/calc/calc-undo.el index 109f53dfdf8..28c1679354c 100644 --- a/lisp/calc/calc-undo.el +++ b/lisp/calc/calc-undo.el @@ -1,6 +1,6 @@ ;;; calc-undo.el --- undo functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 31efd4b4ab3..26a644a29ba 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -1,6 +1,6 @@ ;;; calc-units.el --- unit conversion functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el index d29314ef8ed..c1ef8954c3c 100644 --- a/lisp/calc/calc-vec.el +++ b/lisp/calc/calc-vec.el @@ -1,6 +1,6 @@ ;;; calc-vec.el --- vector functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 9781d4174f5..726a7202a8a 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -1,6 +1,6 @@ ;;; calc-yank.el --- kill-ring functionality for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 85266fbac32..58bbdb81289 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1,6 +1,6 @@ ;;; calc.el --- the GNU Emacs calculator -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el index 1b86f79149a..55064a35528 100644 --- a/lisp/calc/calcalg2.el +++ b/lisp/calc/calcalg2.el @@ -1,6 +1,6 @@ ;;; calcalg2.el --- more algebraic functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index d84f0de9bae..957f12064bd 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -1,6 +1,6 @@ ;;; calcalg3.el --- more algebraic functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index f913b66be2d..a3432c14b15 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -1,6 +1,6 @@ ;;; calccomp.el --- composition functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger diff --git a/lisp/calc/calcsel2.el b/lisp/calc/calcsel2.el index c9ed9ff767b..ace26847963 100644 --- a/lisp/calc/calcsel2.el +++ b/lisp/calc/calcsel2.el @@ -1,6 +1,6 @@ ;;; calcsel2.el --- selection functions for Calc -;; Copyright (C) 1990-1993, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Jay Belanger -- cgit v1.2.1 From 2290000ed69b1157739c280f090e5b60112e83fe Mon Sep 17 00:00:00 2001 From: Wolfgang Jenkner Date: Thu, 15 Jan 2015 20:02:17 +0100 Subject: Handle the `neg' operator in some calc-units functions. * lisp/calc/calc-units.el (math-units-in-expr-p) (math-single-units-in-expr-p, math-find-compatible-unit-rec) (math-extract-units): Handle the `neg' operator. (Bug#19582) * test/automated/calc-tests.el (calc-tests-equal, calc-tests-simple): New functions. (test-calc-remove-units, test-calc-extract-units) (test-calc-convert-units): New tests. --- lisp/calc/calc-units.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 26a644a29ba..05950864a52 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -904,10 +904,12 @@ If COMP or STD is non-nil, put that in the units table instead." (and (consp expr) (if (eq (car expr) 'var) (math-check-unit-name expr) - (and (or sub-exprs - (memq (car expr) '(* / ^))) - (or (math-units-in-expr-p (nth 1 expr) sub-exprs) - (math-units-in-expr-p (nth 2 expr) sub-exprs)))))) + (if (eq (car expr) 'neg) + (math-units-in-expr-p (nth 1 expr) sub-exprs) + (and (or sub-exprs + (memq (car expr) '(* / ^))) + (or (math-units-in-expr-p (nth 1 expr) sub-exprs) + (math-units-in-expr-p (nth 2 expr) sub-exprs))))))) (defun math-only-units-in-expr-p (expr) (and (consp expr) @@ -924,6 +926,8 @@ If COMP or STD is non-nil, put that in the units table instead." (cond ((math-scalarp expr) nil) ((eq (car expr) 'var) (math-check-unit-name expr)) + ((eq (car expr) 'neg) + (math-single-units-in-expr-p (nth 1 expr))) ((eq (car expr) '*) (let ((u1 (math-single-units-in-expr-p (nth 1 expr))) (u2 (math-single-units-in-expr-p (nth 2 expr)))) @@ -1079,6 +1083,8 @@ If COMP or STD is non-nil, put that in the units table instead." ((eq (car-safe expr) '/) (or (math-find-compatible-unit-rec (nth 1 expr) pow) (math-find-compatible-unit-rec (nth 2 expr) (- pow)))) + ((eq (car-safe expr) 'neg) + (math-find-compatible-unit-rec (nth 1 expr) pow)) ((and (eq (car-safe expr) '^) (integerp (nth 2 expr))) (math-find-compatible-unit-rec (nth 1 expr) (* pow (nth 2 expr)))) @@ -1497,6 +1503,8 @@ If COMP or STD is non-nil, put that in the units table instead." ((memq (car-safe expr) '(* /)) (cons (car expr) (mapcar 'math-extract-units (cdr expr)))) + ((eq (car-safe expr) 'neg) + (math-extract-units (nth 1 expr))) ((eq (car-safe expr) '^) (list '^ (math-extract-units (nth 1 expr)) (nth 2 expr))) ((math-check-unit-name expr) expr) -- cgit v1.2.1 From d1cb2f785525ad717a1504f4762505086b390bad Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Wed, 28 Jan 2015 21:17:10 -0600 Subject: * lisp/calc/calc-units.el (calc-convert-exact-units): New function. (calc-convert-units): Check for missing units. * lisp/calc/calc-ext.el (calc-init-extensions): Autoload `calc-convert-exact-units' and assign it a keybinding. * lisp/calc/calc-help (calc-u-prefix-help): Add help for the "un" keybinding. --- lisp/calc/calc-ext.el | 4 +++- lisp/calc/calc-help.el | 2 +- lisp/calc/calc-units.el | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index c3acb89e417..67d0c2701d2 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -561,6 +561,7 @@ (define-key calc-mode-map "ud" 'calc-define-unit) (define-key calc-mode-map "ue" 'calc-explain-units) (define-key calc-mode-map "ug" 'calc-get-unit-definition) + (define-key calc-mode-map "un" 'calc-convert-exact-units) (define-key calc-mode-map "up" 'calc-permanent-units) (define-key calc-mode-map "ur" 'calc-remove-units) (define-key calc-mode-map "us" 'calc-simplify-units) @@ -1176,7 +1177,8 @@ calc-trail-scroll-right calc-trail-yank) ("calc-undo" calc-last-args calc-redo) ("calc-units" calc-autorange-units calc-base-units -calc-convert-temperature calc-convert-units calc-define-unit +calc-convert-temperature calc-convert-units +calc-convert-exact-units calc-define-unit calc-enter-units-table calc-explain-units calc-extract-units calc-get-unit-definition calc-permanent-units calc-quick-units calc-remove-units calc-simplify-units calc-undefine-unit diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 511e208ddea..17e5b0fdead 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -647,7 +647,7 @@ C-w Describe how there is no warranty for Calc." (defun calc-u-prefix-help () (interactive) (calc-do-prefix-help - '("Simplify, Convert, Temperature-convert, Base-units" + '("Simplify, Convert, coNvert exact, Temperature-convert, Base-units" "Autorange; Remove, eXtract; Explain; View-table; 0-9" "Define, Undefine, Get-defn, Permanent" "SHIFT + View-table-other-window" diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 05950864a52..8442cf9ff25 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -470,6 +470,8 @@ If COMP or STD is non-nil, put that in the units table instead." (if (string-match "\\` */" uoldname) (setq uoldname (concat "1" uoldname))) (math-read-expr uoldname)))))) + (unless (math-units-in-expr-p uold t) + (error "No units specified")) (when (eq (car-safe uold) 'error) (error "Bad format in units expression: %s" (nth 1 uold))) (setq expr (math-mul expr uold)))) @@ -514,6 +516,38 @@ If COMP or STD is non-nil, put that in the units table instead." (math-put-default-units (if noold units res) (if comp units))) (calc-enter-result 1 "cvun" res)))))) +(defun calc-convert-exact-units () + (interactive) + (calc-slow-wrapper + (let* ((expr (calc-top-n 1))) + (unless (math-units-in-expr-p expr t) + (error "No units in expression.")) + (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 + "): ") + ": "))))) + (if (and + (string= new-units "") + defunits) + (setq new-units defunits)) + (setq units (math-read-expr new-units)) + (when (eq (car-safe units) 'error) + (error "Bad format in units expression: %s" (nth 2 units))) + (math-check-unit-consistency old-units units) + (let ((res + (list '* (math-mul (math-remove-units expr) + (math-simplify-units + (list '/ old-units units))) + units))) + (calc-enter-result 1 "cvxu" res)))))) + (defun calc-autorange-units (arg) (interactive "P") (calc-wrapper -- cgit v1.2.1 From 43fdb2a08061afba00243b164111c289d711d976 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Wed, 28 Jan 2015 21:29:58 -0600 Subject: * lisp/calc/calc-units.el (math-consistent-units-p): Strengthen the test for consistent units. --- lisp/calc/calc-units.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 8442cf9ff25..33cbcac7a2d 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -979,7 +979,7 @@ If COMP or STD is non-nil, put that in the units table instead." (or (and (eq (car-safe newunits) 'var) (assq (nth 1 newunits) math-standard-units-systems)) - (math-numberp (math-get-units (list '/ expr newunits))))) + (math-numberp (math-get-units (math-to-standard-units (list '/ expr newunits) nil))))) (defun math-check-unit-consistency (expr units) "Give an error if EXPR and UNITS do not have consistent units." -- cgit v1.2.1 From 4ba343984f1ea2bc87493339a315e13ba1410d28 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Wed, 28 Jan 2015 21:37:24 -0600 Subject: * lisp/calc/calc-units.el (calc-convert-exact-units): Improve the simplification. --- lisp/calc/calc-units.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 33cbcac7a2d..f3d02340fe3 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -544,7 +544,7 @@ If COMP or STD is non-nil, put that in the units table instead." (let ((res (list '* (math-mul (math-remove-units expr) (math-simplify-units - (list '/ old-units units))) + (math-to-standard-units (list '/ old-units units) nil))) units))) (calc-enter-result 1 "cvxu" res)))))) -- cgit v1.2.1 From e368697ce3647f1f34f4777d553604866c56ad25 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 9 Apr 2015 19:03:19 -0500 Subject: Fix description of Unix time, mention new function. * lisp/calc/calc-forms.el (calcFunc-unixtime): Fix adjustment for Unix time. * doc/misc/calc.texi (Date Forms): Fix description of Unix time. (Basic Operations on Units): Mention `calc-convert-exact-units'. --- lisp/calc/calc-forms.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index ca6d021cef2..c6e1fdbbeaa 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -1438,11 +1438,11 @@ as measured in the integer number of days before December 31, 1 BC (Gregorian)." (defun calcFunc-unixtime (date &optional zone) (if (math-realp date) (progn - (setq date (math-add 719164 (math-div date '(float 864 2)))) + (setq date (math-add 719163 (math-div date '(float 864 2)))) (list 'date (math-sub date (math-div (calcFunc-tzone zone date) '(float 864 2))))) (if (eq (car date) 'date) - (math-add (nth 1 (math-date-parts (nth 1 date) 719164)) + (math-add (nth 1 (math-date-parts (nth 1 date) 719163)) (calcFunc-tzone zone date)) (math-reject-arg date 'datep)))) -- cgit v1.2.1 From 2f26ac56580a6e665cec8bcfb4b525af7f7945ea Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 7 May 2015 22:42:37 -0700 Subject: * lisp/calc/calc.el (math-zerop): Declare. --- lisp/calc/calc.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp/calc') diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 58bbdb81289..1cc11b48ac3 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -154,6 +154,7 @@ (declare-function math-parse-date "calc-forms" (math-pd-str)) (declare-function math-lessp "calc-ext" (a b)) (declare-function math-compare "calc-ext" (a b)) +(declare-function math-zerop "calc-misc" (a)) (declare-function calc-embedded-finish-command "calc-embed" ()) (declare-function calc-embedded-select-buffer "calc-embed" ()) (declare-function calc-embedded-mode-line-change "calc-embed" ()) -- cgit v1.2.1 From 9d35bb8d6518bb913ab08bace2af08963c003177 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 19 May 2015 14:59:15 -0700 Subject: Fix minor quoting problems in doc strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These were glitches regardless of how or whether we tackle the problem of grave accent in doc strings. * lisp/calc/calc-aent.el (math-restore-placeholders): * lisp/ido.el (ido-ignore-buffers, ido-ignore-files): * lisp/leim/quail/cyrillic.el ("bulgarian-alt-phonetic"): * lisp/leim/quail/hebrew.el ("hebrew-new") ("hebrew-biblical-sil"): * lisp/leim/quail/thai.el ("thai-kesmanee"): * lisp/progmodes/idlw-shell.el (idlwave-shell-file-name-chars): Used curved quotes to avoid ambiguities like ‘`''’ in doc strings. * lisp/calendar/calendar.el (calendar-month-abbrev-array): * lisp/cedet/semantic/mru-bookmark.el (semantic-mrub-cache-flush-fcn): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-copy) (semantic-tag-components): * lisp/cedet/srecode/cpp.el (srecode-semantic-handle-:cpp): * lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring): * lisp/emacs-lisp/byte-opt.el (byte-optimize-all-constp): * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): * lisp/emacs-lisp/generator.el (iter-next): * lisp/gnus/gnus-art.el (gnus-treat-strip-list-identifiers) (gnus-article-mode-syntax-table): * lisp/net/rlogin.el (rlogin-directory-tracking-mode): * lisp/net/soap-client.el (soap-wsdl-get): * lisp/net/telnet.el (telnet-mode): * lisp/org/org-compat.el (org-number-sequence): * lisp/org/org.el (org-remove-highlights-with-change) (org-structure-template-alist): * lisp/org/ox-html.el (org-html-link-org-files-as-html): * lisp/play/handwrite.el (handwrite-10pt, handwrite-11pt) (handwrite-12pt, handwrite-13pt): * lisp/progmodes/f90.el (f90-mode, f90-abbrev-start): * lisp/progmodes/idlwave.el (idlwave-mode, idlwave-check-abbrev): * lisp/progmodes/verilog-mode.el (verilog-tool) (verilog-string-replace-matches, verilog-preprocess) (verilog-auto-insert-lisp, verilog-auto-insert-last): * lisp/textmodes/makeinfo.el (makeinfo-options): * src/font.c (Ffont_spec): Fix minor quoting problems in doc strings, e.g., missing quote, ``x'' where `x' was meant, etc. * lisp/erc/erc-backend.el (erc-process-sentinel-2): Fix minor quoting problem in other string. * lisp/leim/quail/ethiopic.el ("ethiopic"): * lisp/term/tvi970.el (tvi970-set-keypad-mode): Omit unnecessary quotes. * lisp/faces.el (set-face-attribute, set-face-underline) (set-face-inverse-video, x-create-frame-with-faces): * lisp/gnus/gnus-group.el (gnus-group-nnimap-edit-acl): * lisp/mail/supercite.el (sc-attribs-%@-addresses) (sc-attribs-!-addresses, sc-attribs-<>-addresses): * lisp/net/tramp.el (tramp-methods): * lisp/recentf.el (recentf-show-file-shortcuts-flag): * lisp/textmodes/artist.el (artist-ellipse-right-char) (artist-ellipse-left-char, artist-vaporize-fuzziness) (artist-spray-chars, artist-mode, artist-replace-string) (artist-put-pixel, artist-text-see-thru): * lisp/vc/ediff-util.el (ediff-submit-report): * lisp/vc/log-edit.el (log-edit-changelog-full-paragraphs): Use double-quotes rather than TeX markup in doc strings. * lisp/skeleton.el (skeleton-pair-insert-maybe): Reword to avoid the need for grave accent and apostrophe. * lisp/xt-mouse.el (xterm-mouse-tracking-enable-sequence): Don't use grave and acute accents to quote. --- lisp/calc/calc-aent.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 23de53e0f0c..cc048ebc223 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1034,7 +1034,7 @@ in Calc algebraic input.") (defun math-restore-placeholders (x) "Replace placeholders by the proper characters in the symbol x. -This includes `#' for `_' and `'' for `%'. +This includes ‘#’ for ‘_’ and ‘'’ for ‘%’. If the current Calc language does not use placeholders, return nil." (if (or (memq calc-language calc-lang-allow-underscores) (memq calc-language calc-lang-allow-percentsigns)) -- cgit v1.2.1 From 96794d2f97cd064e4c2bf4f71459b42558cc8c79 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 21 May 2015 10:04:45 -0700 Subject: Don't quote nil and t in doc strings This is as per "Tips for Documentation Strings" in the elisp manual. For consistency, do the same in diagnostics and comments. --- lisp/calc/calc-yank.el | 2 +- lisp/calc/calc.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 726a7202a8a..923df5d577f 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -149,7 +149,7 @@ 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 nil." (let ((cval (cdr (assq reg calc-register-alist))) (val (cdr (assq reg register-alist)))) (if (stringp val) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 1cc11b48ac3..52ed5d7eb3d 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2034,7 +2034,7 @@ See calc-keypad for details." ;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed. (defcustom calc-gregorian-switch nil "The first day the Gregorian calendar is used by Calc's date forms. -This is `nil' (the default) if the Gregorian calendar is the only one used. +This is nil (the default) if the Gregorian calendar is the only one used. Otherwise, it should be a list `(YEAR MONTH DAY)' when Calc begins to use the Gregorian calendar; Calc will use the Julian calendar for earlier dates. The dates in which different regions of the world began to use the -- cgit v1.2.1 From 5e9756e4c68a199f051c2b9998c07a683ff479ff Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 26 May 2015 12:29:38 -0700 Subject: Handle curved quotes in info files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/calc/calc-help.el (calc-describe-thing): * lisp/info.el (Info-find-index-name) (Info-try-follow-nearest-node, Info-fontify-node): * lisp/vc/ediff-help.el (ediff-help-for-quick-help): In info files, process quotes ‘like this’ the same way we process quotes `like this'. This catches a few places we missed earlier. --- lisp/calc/calc-help.el | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 17e5b0fdead..aace2a95585 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -365,21 +365,23 @@ C-w Describe how there is no warranty for Calc." (let (Info-history) (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (or (let ((case-fold-search nil)) - (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\ Date: Thu, 28 May 2015 00:06:14 -0700 Subject: Fix minor quoting problems in doc strings Most of these fixes involve escaping grave accents that are actually intended to be grave accents, not left quotes. (Bug#20385) --- lisp/calc/calc-misc.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 9c5d7184149..60c6fb9782c 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -89,7 +89,7 @@ For use with Embedded mode: 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. + \\=` calc-embedded-edit. Use calc-edit to edit formula at point. Documentation: I calc-info. Read the Calculator manual in the Emacs Info system. @@ -225,7 +225,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). "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: ' (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)" -- cgit v1.2.1 From 8e06d22bb654c649da6f32bd235a84eb2f4d188d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 2 Jun 2015 22:50:57 -0700 Subject: Support quotes 'like this' in info files This is possible when 'makeinfo --disable-encoding' is used in Texinfo 5. * lisp/calc/calc-help.el (calc-describe-thing): * lisp/gnus/gnus-art.el (gnus-button-alist): * lisp/info.el (Info-find-index-name): * lisp/vc/ediff-help.el (ediff-help-for-quick-help): Also support quotes 'like this'. * lisp/calc/calc-help.el (calc-describe-thing): Simplify. * lisp/finder.el (finder-font-lock-keywords): Remove var that hasn't been used in years, instead of bothering to fix its quoting. --- lisp/calc/calc-help.el | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index aace2a95585..b2e7df1b718 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -364,25 +364,21 @@ C-w Describe how there is no warranty for Calc." (error "Can't find `%s' in %s" thing where))) (let (Info-history) (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) - (or (let ((case-fold-search nil)) - (or (re-search-forward - (format "\\[[`‘]%s['’]\\]\\|([`‘]%s['’])\\|\\ Date: Thu, 4 Jun 2015 23:44:38 -0700 Subject: Fix curved quotes in a few places * lisp/calc/calc-misc.el (calc-help): Fix quoting. The strings in question are not doc strings, so this partially undoes the recent change that assumed they were doc strings. * lisp/cedet/srecode/srt-mode.el (srecode-macro-help): * lisp/info.el (Info-finder-find-node): Use curved quotes. * lisp/emacs-lisp/derived.el (derived-mode-make-docstring): Also allow curved quotes in doc strings. --- lisp/calc/calc-misc.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 60c6fb9782c..5d5f4ce0c86 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -217,7 +217,7 @@ 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" + '("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" @@ -225,7 +225,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). "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: ' (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)" -- cgit v1.2.1 From 59f1e8a02d22c31168986f11debc740272eb459c Mon Sep 17 00:00:00 2001 From: Wolfgang Jenkner Date: Mon, 29 Jun 2015 14:26:29 +0200 Subject: * lisp/calc-store.el (calc-insert-permanent-variable): Heed case. Otherwise `s p' of f and F will stomp on each other's value. (Bug#20916) --- lisp/calc/calc-store.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 11bf96455b7..91b927aad61 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -609,7 +609,8 @@ (defun calc-insert-permanent-variable (var) (goto-char (point-min)) - (if (search-forward (concat "(setq " (symbol-name var) " '") nil t) + (if (let (case-fold-search) + (search-forward (concat "(setq " (symbol-name var) " '") nil t)) (progn (setq calc-pv-pos (point-marker)) (forward-line -1) -- cgit v1.2.1 From 244c801689d2f7a80480d83cd7d092d4762ebe08 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 14 Aug 2015 15:50:35 -0700 Subject: =?UTF-8?q?Extend=20=E2=80=98format=E2=80=99=20to=20translate=20cu?= =?UTF-8?q?rved=20quotes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a followup to the recent doc string change, and deals with diagnostics and the like. This patch is more conservative than the doc string change, in that the behavior of ‘format’ changes only if its first arg contains curved quotes and the user prefers straight or grave quotes. (Come to think of it, perhaps we should be similarly conservative with doc strings too, but that can wait.) The upside of this conservatism is that existing usage is almost surely unaffected. The downside is that we'll eventually have to change Emacs's format strings to use curved quotes in places where the user might want curved quotes, but that's a simple and mechanical translation that I'm willing to do later. (Bug#21222) * doc/lispref/help.texi (Keys in Documentation): Move description of text-quoting-style from here ... * doc/lispref/strings.texi (Formatting Strings): ... to here, and describe new behavior of ‘format’. * etc/NEWS: Describe new behavior. * lisp/calc/calc-help.el (calc-describe-thing): * lisp/emacs-lisp/derived.el (derived-mode-make-docstring): * lisp/info.el (Info-find-index-name): Use ‘concat’ rather than ‘format’ to avoid misinterpretation of recently-added curved quotes. * src/doc.c (uLSQM0, uLSQM1, uLSQM2, uRSQM0, uRSQM1, uRSQM2): Move from here ... * src/lisp.h: ... to here. * src/doc.c (text_quoting_style): New function. (Fsubstitute_command_keys): Use it. * src/editfns.c (Fformat): Implement new behavior. * src/lisp.h (enum text_quoting_style): New enum. --- lisp/calc/calc-help.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index b2e7df1b718..7a1a983e6b3 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -365,7 +365,7 @@ C-w Describe how there is no warranty for Calc." (let (Info-history) (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (let* ((string-target (or target thing)) - (quoted (format "['`‘]%s['’]" (regexp-quote string-target))) + (quoted (concat "['`‘]" (regexp-quote string-target) "['’]")) (bracketed (format "\\[%s\\]\\|(%s)\\|\\ Date: Fri, 21 Aug 2015 06:31:54 -0700 Subject: Respect text-quoting-style in calc In calc, tespect text-quoting-style preference in diagnostic formats and fix a few similar problems in docstrings. * lisp/calc/calc-aent.el (math-read-factor): * lisp/calc/calc-embed.el (calc-do-embedded): * lisp/calc/calc-ext.el (calc-user-function-list) * lisp/calc/calc-graph.el (calc-graph-show-dumb): * lisp/calc/calc-help.el (calc-describe-key) (calc-describe-thing): * lisp/calc/calc-lang.el (calc-c-language) (math-parse-fortran-vector-end, math-parse-tex-sum) (math-parse-eqn-matrix, math-parse-eqn-prime) (calc-yacas-language, calc-maxima-language, calc-giac-language) (math-read-big-rec, math-read-big-balance): * lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes) (calc-auto-recompute): * lisp/calc/calc-prog.el (calc-user-define-invocation) (math-do-arg-check): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-units.el (math-build-units-table-buffer): * lisp/calc/calc-vec.el (math-read-brackets): * lisp/calc/calc-yank.el (calc-edit-mode): * lisp/calc/calc.el (calc, calc-do, calc-user-invocation): Use curved quotes in diagnostic format strings. * lisp/calc/calc-help.el (calc-describe-thing): Format docstrings with substitute-command-keys. * lisp/calc/calc-help.el (calc-j-prefix-help): * lisp/calc/calc-misc.el (calc-help): * lisp/calc/calc-ext.el (calc-shift-Z-prefix-help): Escape a docstring "`". --- lisp/calc/calc-aent.el | 4 ++-- lisp/calc/calc-embed.el | 10 ++++++---- lisp/calc/calc-ext.el | 14 +++++++------- lisp/calc/calc-graph.el | 2 +- lisp/calc/calc-help.el | 30 ++++++++++++++++++------------ lisp/calc/calc-lang.el | 39 ++++++++++++++++++++------------------- lisp/calc/calc-misc.el | 2 +- lisp/calc/calc-mode.el | 16 ++++++++-------- lisp/calc/calc-prog.el | 4 ++-- lisp/calc/calc-store.el | 2 +- lisp/calc/calc-units.el | 19 +++++++++++-------- lisp/calc/calc-vec.el | 12 ++++++------ lisp/calc/calc-yank.el | 4 ++-- lisp/calc/calc.el | 8 ++++---- 14 files changed, 89 insertions(+), 77 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index cc048ebc223..2fa8f19163d 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1121,7 +1121,7 @@ If the current Calc language does not use placeholders, return nil." (math-read-expr-list)))) (if (not (or (equal math-expr-data calc-function-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected `)'")) + (throw 'syntax "Expected ‘)’")) (math-read-token) (if (and (memq calc-language calc-lang-parens-are-subscripts) @@ -1246,7 +1246,7 @@ If the current Calc language does not use placeholders, return nil." (if (not (or (equal math-expr-data ")") (and (equal math-expr-data "]") (eq (car-safe exp) 'intv)) (eq math-exp-token 'end))) - (throw 'syntax "Expected `)'")) + (throw 'syntax "Expected ‘)’")) (math-read-token) exp)) ((eq math-exp-token 'string) diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index fcb4b032096..3f6e83e0c6d 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -330,10 +330,12 @@ (if calc-embedded-firsttime-formula (run-hooks 'calc-embedded-new-formula-hook)) (or (eq calc-embedded-quiet t) - (message "Embedded Calc mode enabled; %s to return to normal" - (if calc-embedded-quiet - "Type `C-x * x'" - "Give this command again"))))) + (message (concat + "Embedded Calc mode enabled; " + (if calc-embedded-quiet + "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 67d0c2701d2..1c40188d2b2 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1097,10 +1097,10 @@ calc-tan calc-tanh calc-to-degrees calc-to-radians) ("calc-mode" calc-alg-simplify-mode calc-algebraic-mode calc-always-load-extensions calc-auto-recompute calc-auto-why -calc-basic-simplify-mode calc-bin-simplify-mode calc-break-vectors -calc-center-justify calc-default-simplify-mode calc-display-raw -calc-eng-notation calc-ext-simplify-mode calc-fix-notation -calc-full-trail-vectors calc-full-vectors calc-get-modes calc-group-char +calc-basic-simplify-mode calc-bin-simplify-mode calc-break-vectors +calc-center-justify calc-default-simplify-mode calc-display-raw +calc-eng-notation calc-ext-simplify-mode calc-fix-notation +calc-full-trail-vectors calc-full-vectors calc-get-modes calc-group-char calc-group-digits calc-infinite-mode calc-left-justify calc-left-label calc-line-breaking calc-line-numbering calc-matrix-brackets calc-matrix-center-justify calc-matrix-left-justify calc-matrix-mode @@ -1177,7 +1177,7 @@ calc-trail-scroll-right calc-trail-yank) ("calc-undo" calc-last-args calc-redo) ("calc-units" calc-autorange-units calc-base-units -calc-convert-temperature calc-convert-units +calc-convert-temperature calc-convert-units calc-convert-exact-units calc-define-unit calc-enter-units-table calc-explain-units calc-extract-units calc-get-unit-definition calc-permanent-units calc-quick-units @@ -1957,7 +1957,7 @@ calc-kill calc-kill-region calc-yank)))) (desc (if (symbolp func) (if (= (logand kind 3) 0) - (format "`%c' = %s" key name) + (format "‘%c’ = %s" key name) (if pos (format "%s%c%s" (downcase (substring name 0 pos)) @@ -1988,7 +1988,7 @@ calc-kill calc-kill-region calc-yank)))) "kbd-macros: [ (if), : (else), | (else-if), ] (end-if)" "kbd-macros: < > (repeat), ( ) (for), { } (loop)" "kbd-macros: / (break)" - "kbd-macros: ` (save), ' (restore)") + "kbd-macros: \\=` (save), ' (restore)") "user" ?Z)) diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 20b0249ec1a..8378b23c0eb 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -958,7 +958,7 @@ 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 "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 7a1a983e6b3..01ab49510cd 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -240,7 +240,7 @@ C-w Describe how there is no warranty for Calc." (if (string-match "\\` +" prompts) (setq prompts (substring prompts (match-end 0)))) (setq msg (format - "%s: %s%s`%s'%s%s %s%s" + "%s: %s%s‘%s’%s%s %s%s" (if (string-match "\\`\\(calc-[-a-zA-Z0-9]+\\) *\\(.*\\)\\'" cmd) @@ -345,7 +345,7 @@ C-w Describe how there is no warranty for Calc." (calc-describe-thing var "Variable Index")) (defun calc-describe-thing (thing where &optional target not-quoted) - (message "Looking for `%s' in %s..." thing where) + (message "Looking for ‘%s’ in %s..." thing where) (let ((savewin (current-window-configuration))) (calc-info-goto-node where) (or (let ((case-fold-search nil)) @@ -361,7 +361,7 @@ C-w Describe how there is no warranty for Calc." (if Info-history (Info-last)) (set-window-configuration savewin) - (error "Can't find `%s' in %s" thing where))) + (error "Can't find ‘%s’ in %s" thing where))) (let (Info-history) (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (let* ((string-target (or target thing)) @@ -380,7 +380,7 @@ C-w Describe how there is no warranty for Calc." (re-search-forward quoted nil t) (search-forward string-target nil t))))) (beginning-of-line) - (message "Found `%s' in %s" thing where))) + (message "Found ‘%s’ in %s" thing where))) (defun calc-view-news () (interactive) @@ -400,11 +400,13 @@ C-w Describe how there is no warranty for Calc." (princ "GNU Emacs Calculator.\n") (princ " By Dave Gillespie.\n") (princ (format " %s\n\n" emacs-copyright)) - (princ "Type `h s' for a more detailed summary.\n") - (princ "Or type `h i' to read the full Calc manual on-line.\n\n") + (princ (format "Type ‘h s’ for a more detailed summary.\n")) + (princ (format "Or type ‘h i’ to read the full Calc manual on-line.\n\n")) (princ "Basic keys:\n") (let* ((calc-full-help-flag t)) - (mapc (function (lambda (x) (princ (format " %s\n" x)))) + (mapc (function (lambda (x) (princ (format + " %s\n" + (substitute-command-keys x))))) (nreverse (cdr (reverse (cdr (calc-help)))))) (mapc (function (lambda (prefix) (let ((msgs (condition-case err @@ -413,18 +415,22 @@ C-w Describe how there is no warranty for Calc." (if (car msgs) (princ (if (eq (nth 2 msgs) ?v) - "\n`v' or `V' prefix (vector/matrix) keys: \n" + (format + "\n‘v’ or ‘V’ prefix (vector/matrix) keys: \n") (if (nth 2 msgs) (format - "\n`%c' prefix (%s) keys:\n" + "\n‘%c’ prefix (%s) keys:\n" (nth 2 msgs) (or (cdr (assq (nth 2 msgs) calc-help-long-names)) (nth 1 msgs))) (format "\n%s-modified keys:\n" (capitalize (nth 1 msgs))))))) - (mapcar (function (lambda (x) - (princ (format " %s\n" x)))) + (mapcar (function + (lambda (x) + (princ (format + " %s\n" + (substitute-command-keys x))))) (car msgs))))) '(calc-inverse-prefix-help calc-hyperbolic-prefix-help @@ -539,7 +545,7 @@ C-w Describe how there is no warranty for Calc." '("Select, Additional, Once; eVal, Formula; Rewrite" "More, Less, 1-9, Next, Previous" "Unselect, Clear; Display; Enable; Breakable" - "' (replace), ` (edit), +, -, *, /, RET (grab), DEL" + "' (replace), \\=` (edit), +, -, *, /, RET (grab), DEL" "SHIFT + swap: Left, Right; maybe: Select, Once" "SHIFT + Commute, Merge, Distrib, jump-Eqn, Isolate" "SHIFT + Negate, & (invert); Unpack") diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 066d781cc95..9d5020df038 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -94,7 +94,7 @@ (interactive) (calc-wrapper (calc-set-language 'c) - (message "`C' language mode"))) + (message "‘C’ language mode"))) (put 'c 'math-oper-table '( ( "u!" calcFunc-lnot -1 1000 ) @@ -387,7 +387,7 @@ math-exp-token 'end math-expr-data "\000") x) - (throw 'syntax "Unmatched closing `/'"))) + (throw 'syntax "Unmatched closing ‘/’"))) (defun math-parse-fortran-subscr (sym args) (setq sym (math-build-var-name sym)) @@ -695,7 +695,7 @@ (defun math-parse-tex-sum (f val) (let (low high save) - (or (equal math-expr-data "_") (throw 'syntax "Expected `_'")) + (or (equal math-expr-data "_") (throw 'syntax "Expected ‘_’")) (math-read-token) (setq save math-exp-old-pos) (setq low (math-read-factor)) @@ -703,7 +703,7 @@ (progn (setq math-exp-old-pos (1+ save)) (throw 'syntax "Expected equation"))) - (or (equal math-expr-data "^") (throw 'syntax "Expected `^'")) + (or (equal math-expr-data "^") (throw 'syntax "Expected ‘^’")) (math-read-token) (setq high (math-read-factor)) (list (nth 2 f) (math-read-factor) (nth 1 low) (nth 2 low) high))) @@ -1165,14 +1165,14 @@ (while (assoc math-expr-data '(("ccol") ("lcol") ("rcol"))) (math-read-token) (or (equal math-expr-data calc-function-open) - (throw 'syntax "Expected `{'")) + (throw 'syntax "Expected ‘{’")) (math-read-token) (setq vec (cons (cons 'vec (math-read-expr-list)) vec)) (or (equal math-expr-data calc-function-close) - (throw 'syntax "Expected `}'")) + (throw 'syntax "Expected ‘}’")) (math-read-token)) (or (equal math-expr-data calc-function-close) - (throw 'syntax "Expected `}'")) + (throw 'syntax "Expected ‘}’")) (math-read-token) (math-transpose (cons 'vec (nreverse vec))))) @@ -1187,7 +1187,7 @@ (math-read-expr-list)))) (if (not (or (equal math-expr-data calc-function-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected `)'")) + (throw 'syntax "Expected ‘)’")) (math-read-token) (cons (intern (format "calcFunc-%s'" (nth 1 x))) args))) (list 'var @@ -1211,7 +1211,7 @@ (interactive) (calc-wrapper (calc-set-language 'yacas) - (message "`Yacas' language mode"))) + (message "‘Yacas’ language mode"))) (put 'yacas 'math-vector-brackets "{}") @@ -1427,7 +1427,7 @@ (interactive) (calc-wrapper (calc-set-language 'maxima) - (message "`Maxima' language mode"))) + (message "‘Maxima’ language mode"))) (put 'maxima 'math-oper-table '(("+" + 100 100) @@ -1625,7 +1625,7 @@ (interactive) (calc-wrapper (calc-set-language 'giac) - (message "`Giac' language mode"))) + (message "‘Giac’ language mode"))) (put 'giac 'math-oper-table '( ( "[" (math-read-giac-subscr) 250 -1 ) @@ -2237,7 +2237,7 @@ order to Calc's." (if (= sep ?\.) (setq h (1+ h))) (if (= sep ?\]) - (math-read-big-error (1- h) v "Expected `)'")) + (math-read-big-error (1- h) v "Expected ‘)’")) (if (= sep ?\)) (setq p (math-read-big-rec (1+ math-rb-h1) math-rb-v1 (1- h) math-rb-v2 v)) @@ -2252,7 +2252,7 @@ order to Calc's." 0 1) p)))) ((= (math-read-big-char (1- h) v) ?\]) - (math-read-big-error (1- h) v "Expected `)'")) + (math-read-big-error (1- h) v "Expected ‘)’")) ((= sep ?\,) (or (and (math-realp (car p)) (math-realp (nth 1 p))) (math-read-big-error @@ -2280,7 +2280,7 @@ order to Calc's." (setq h (math-read-big-balance (1+ hleft) v "[")) (if hright (or (= h hright) - (math-read-big-error hright v "Expected `]'")) + (math-read-big-error hright v "Expected ‘]’")) (setq hright h)) (setq p (cons (math-read-big-rec hleft v h (1+ v)) p)) @@ -2293,7 +2293,7 @@ order to Calc's." (setq h (1+ h))) (and (= (math-read-big-char h v) ?\]) (setq h (1+ h)))) - (math-read-big-error (1- h) v "Expected `]'")) + (math-read-big-error (1- h) v "Expected ‘]’")) (if (= (math-read-big-char h vtop) ?\,) (setq h (1+ h))) (math-read-big-emptyp math-rb-h1 (1+ v) (1- h) math-rb-v2 nil t) @@ -2317,7 +2317,7 @@ order to Calc's." (setq widest (math-read-big-char (1- h) v)) (if (or (memq widest '(?\; ?\))) (and (eq widest ?\.) (cdr p))) - (math-read-big-error (1- h) v "Expected `]'")) + (math-read-big-error (1- h) v "Expected ‘]’")) (if (= widest ?\.) (setq h (1+ h) widest (math-read-big-balance h v "[") @@ -2369,7 +2369,7 @@ order to Calc's." h widest) (= (math-read-big-char (1- h) v) ?\,))) (or (= (math-read-big-char (1- h) v) ?\)) - (math-read-big-error (1- h) v "Expected `)'")) + (math-read-big-error (1- h) v "Expected ‘)’")) (setq p (cons line (nreverse p)))) (setq p (list 'var (intern (math-remove-dashes p)) @@ -2432,7 +2432,8 @@ order to Calc's." (let ((y (math-read-big-rec h math-rb-v1 math-rb-h2 math-rb-v2 baseline nil t))) (or (= (math-read-big-char math-read-big-h2 baseline) ?\:) - (math-read-big-error math-read-big-h2 baseline "Expected `:'")) + (math-read-big-error math-read-big-h2 baseline + "Expected ‘:’")) (setq p (list (nth 1 widest) p y (math-read-big-rec (1+ math-read-big-h2) math-rb-v1 math-rb-h2 math-rb-v2 @@ -2507,7 +2508,7 @@ order to Calc's." (while (> count 0) (if (>= h len) (if what - (math-read-big-error nil v (format "Unmatched `%s'" what)) + (math-read-big-error nil v (format "Unmatched ‘%s’" what)) (setq count 0)) (if (memq (aref line h) '(?\( ?\[)) (setq count (1+ count)) diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 5d5f4ce0c86..e5d4b6b0607 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -225,7 +225,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). "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: ' (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)" diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index be18dcd0349..605084e3f35 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -110,11 +110,11 @@ (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 "User must press ‘w’ to explain unsimplified results")) ((eq n t) - (message "Automatically doing `w' to explain unsimplified results")) + (message "Automatically doing ‘w’ to explain unsimplified results")) (t - (message "Automatically doing `w' only for unusual messages"))))) + (message "Automatically doing ‘w’ only for unusual messages"))))) (defun calc-group-digits (n) (interactive "P") @@ -272,7 +272,7 @@ (vals (mapcar (function (lambda (v) (symbol-value (car v)))) calc-mode-var-list))) (unless calc-settings-file - (error "No `calc-settings-file' specified")) + (error "No ‘calc-settings-file’ specified")) (set-buffer (find-file-noselect (substitute-in-file-name calc-settings-file))) (goto-char (point-min)) @@ -410,7 +410,7 @@ ((= n 4) 'global) ((= n 5) 'save) (t 'local))) - (message "%s" + (message "%s" (cond ((and (eq calc-mode-save-mode 'local) calc-embedded-info) "Recording mode changes with [calc-mode: ...]") ((eq calc-mode-save-mode 'edit) @@ -478,7 +478,7 @@ (cond ((eq arg 0) 'scalar) ((< (prefix-numeric-value arg) 1) (and (< (prefix-numeric-value arg) -1) 'matrix)) - (arg + (arg (if (consp arg) 'sqmatrix (prefix-numeric-value arg))) ((eq calc-matrix-mode 'matrix) 'scalar) @@ -572,8 +572,8 @@ (calc-change-mode 'calc-auto-recompute arg nil t) (calc-refresh-evaltos) (message (if calc-auto-recompute - "Automatically recomputing `=>' forms when necessary" - "Not recomputing `=>' forms automatically")))) + "Automatically recomputing ‘=>’ forms when necessary" + "Not recomputing ‘=>’ forms automatically")))) (defun calc-working (n) (interactive "P") diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 27114077d15..df2eb764f3b 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -673,7 +673,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 "Use ‘C-x * Z’ to invoke this macro")) (defun calc-user-define-edit () (interactive) ; but no calc-wrapper! @@ -1899,7 +1899,7 @@ Redefine the corresponding command." `((and (,chk ,var) (math-reject-arg ,var ',qual))))) - (error "Unknown qualifier `%s'" qual-name)))))))) + (error "Unknown qualifier ‘%s’" qual-name)))))))) (defun math-do-arg-list-check (args is-opt is-rest) (cond ((null args) nil) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 91b927aad61..43dc602225e 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -442,7 +442,7 @@ (setq calc-last-edited-variable var) (calc-edit-mode (list 'calc-finish-stack-edit (list 'quote var)) t - (concat "Editing variable `" (calc-var-name var) "'. ")) + (format "Editing variable ‘%s’" (calc-var-name var))) (and value (insert (math-format-nice-expr value (frame-width)) "\n"))))) (calc-show-edit-buffer)) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index f3d02340fe3..d95af9492bd 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -422,7 +422,7 @@ If EXPR is nil, return nil." "Put the units in EXPR in the default units table. If COMP or STD is non-nil, put that in the units table instead." (let* ((new-units (or comp std (math-get-units expr))) - (standard-units (math-get-standard-units + (standard-units (math-get-standard-units (cond (comp (math-simplify-units expr)) (std expr) @@ -457,9 +457,9 @@ If COMP or STD is non-nil, put that in the units table instead." (eq (math-get-standard-units expr) 1)))) (let ((uold (or old-units (progn - (setq uoldname + (setq uoldname (if unitscancel - (read-string + (read-string "(The expression is unitless when simplified) Old Units: ") (read-string "Old units: "))) (if (equal uoldname "") @@ -1621,11 +1621,14 @@ If COMP or STD is non-nil, put that in the units table instead." (insert " " (nth 2 u) "\n") (while (eq (car (car (setq uptr (cdr uptr)))) 0))) (insert "\n\n") - (insert "(**) When in TeX or LaTeX display mode, the TeX specific unit\n" - "names will not use the `tex' prefix; the unit name for a\n" - "TeX point will be `pt' instead of `texpt', for example.\n" - "To avoid conflicts, the unit names for pint and parsec will\n" - "be `pint' and `parsec' instead of `pt' and `pc'.")) + (insert + (format + (concat + "(**) When in TeX or LaTeX display mode, the TeX specific unit\n" + "names will not use the ‘tex’ prefix; the unit name for a\n" + "TeX point will be ‘pt’ instead of ‘texpt’, for example.\n" + "To avoid conflicts, the unit names for pint and parsec will\n" + "be ‘pint’ and ‘parsec’ instead of ‘pt’ and ‘pc’.")))) (view-mode) (message "Formatting units table...done")) (setq math-units-table-buffer-valid t) diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el index c1ef8954c3c..c7a3e716d61 100644 --- a/lisp/calc/calc-vec.el +++ b/lisp/calc/calc-vec.el @@ -1107,7 +1107,7 @@ (cons 'vec (nreverse (sort (copy-sequence (cdr vec)) 'math-beforep))) (math-reject-arg vec 'vectorp))) -;; The variable math-grade-vec is local to calcFunc-grade and +;; The variable math-grade-vec is local to calcFunc-grade and ;; calcFunc-rgrade, but is used by math-grade-beforep, which is called ;; by calcFunc-grade and calcFunc-rgrade. (defvar math-grade-vec) @@ -1149,7 +1149,7 @@ (setq bin (math-floor bin))) (and (natnump bin) (< bin n) - (aset res bin + (aset res bin (math-add (aref res bin) (if wvec (car (setq wp (cdr wp))) wts))))) (cons 'vec (append res nil)))) @@ -1167,7 +1167,7 @@ (while (and tbds (Math-lessp (car tbds) num)) (setq i (1+ i)) (setq tbds (cdr tbds))) - (aset res i + (aset res i (math-add (aref res i) (if wvec (car (setq wp (cdr wp))) wts)))) (setq vp (cdr vp))) @@ -1550,7 +1550,7 @@ of two matrices is a matrix." ;; indirectly) by math-read-brackets. (defvar math-rb-close) -;; The next few variables are local to math-read-exprs in calc-aent.el +;; The next few variables are local to math-read-exprs in calc-aent.el ;; and math-read-expr in calc-ext.el, but are set in functions they call. (defvar math-exp-pos) (defvar math-exp-str) @@ -1618,13 +1618,13 @@ of two matrices is a matrix." (if (not (or (equal math-expr-data math-rb-close) (equal math-expr-data ")") (eq math-exp-token 'end))) - (throw 'syntax "Expected `]'"))) + (throw 'syntax "Expected ‘]’"))) (if (equal math-expr-data ";") (let ((math-exp-keep-spaces space-sep)) (setq vals (cons 'vec (math-read-matrix (list vals)))))) (if (not (or (equal math-expr-data math-rb-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected `]'"))) + (throw 'syntax "Expected ‘]’"))) (or (eq math-exp-token 'end) (math-read-token)) vals))) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 923df5d577f..d4be8ad832d 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -603,9 +603,9 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (insert (propertize (concat (or title title "Calc Edit Mode. ") - "Press `C-c C-c'" + (format "Press ‘C-c C-c’") (if allow-ret "" " or RET") - " to finish, `C-x k RET' to cancel.\n\n") + (format " to finish, ‘C-x k RET’ to cancel.\n\n")) 'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t)) (make-local-variable 'calc-edit-top) (setq calc-edit-top (point)))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 52ed5d7eb3d..b0046dcaf4b 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1474,7 +1474,7 @@ commands given here will actually operate on the *Calculator* stack." (and calc-display-trail (= (window-width) (frame-width)) (calc-trail-display 1 t))) - (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit") + (message "Welcome to the GNU Emacs Calculator! Press ‘?’ or ‘h’ for help, ‘q’ to quit") (run-hooks 'calc-start-hook) (and (windowp full-display) (window-point full-display) @@ -1622,7 +1622,7 @@ 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 "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 @@ -2303,7 +2303,7 @@ the United States." (calc-delete-selection 1) (calc-pop-stack nn)))))) (if calc-context-sensitive-enter (calc-cursor-stack-index (1- num))))) - + @@ -3856,7 +3856,7 @@ Also looks for the equivalent TeX words, \\gets and \\evalto." (defun calc-user-invocation () (interactive) (unless calc-invocation-macro - (error "Use `Z I' inside Calc to define a `C-x * Z' keyboard macro")) + (error "Use ‘Z I’ inside Calc to define a ‘C-x * Z’ keyboard macro")) (execute-kbd-macro calc-invocation-macro nil)) ;;; User-programmability. -- cgit v1.2.1 From 6b1765e05db432007ede6f1af3744e71063a728b Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 23 Aug 2015 13:43:34 +0200 Subject: =?UTF-8?q?Revert=20"Extend=20=E2=80=98format=E2=80=99=20to=20tran?= =?UTF-8?q?slate=20curved=20quotes"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 244c801689d2f7a80480d83cd7d092d4762ebe08. --- lisp/calc/calc-help.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 01ab49510cd..50a0291e4cd 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -365,7 +365,7 @@ C-w Describe how there is no warranty for Calc." (let (Info-history) (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (let* ((string-target (or target thing)) - (quoted (concat "['`‘]" (regexp-quote string-target) "['’]")) + (quoted (format "['`‘]%s['’]" (regexp-quote string-target))) (bracketed (format "\\[%s\\]\\|(%s)\\|\\ Date: Sun, 23 Aug 2015 22:38:02 -0700 Subject: =?UTF-8?q?More-conservative=20=E2=80=98format=E2=80=99=20quote=20?= =?UTF-8?q?restyling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of restyling curved quotes for every call to ‘format’, create a new function ‘format-message’ that does the restyling, and using the new function instead of ‘format’ only in contexts where this seems appropriate. Problem reported by Dmitry Gutov and Andreas Schwab in: http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00826.html http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00827.html * doc/lispref/commands.texi (Using Interactive): * doc/lispref/control.texi (Signaling Errors, Signaling Errors): * doc/lispref/display.texi (Displaying Messages, Progress): * doc/lispref/elisp.texi: * doc/lispref/help.texi (Keys in Documentation): * doc/lispref/minibuf.texi (Minibuffer Misc): * doc/lispref/strings.texi (Formatting Strings): * etc/NEWS: Document the changes. * lisp/abbrev.el (expand-region-abbrevs): * lisp/apropos.el (apropos-library): * lisp/calc/calc-ext.el (calc-record-message) (calc-user-function-list): * lisp/calc/calc-help.el (calc-describe-key, calc-full-help): * lisp/calc/calc-lang.el (math-read-big-balance): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-units.el (math-build-units-table-buffer): * lisp/calc/calc-yank.el (calc-edit-mode): * lisp/calendar/icalendar.el (icalendar-export-region) (icalendar--add-diary-entry): * lisp/cedet/mode-local.el (mode-local-print-binding) (mode-local-describe-bindings-2): * lisp/cedet/semantic/complete.el (semantic-completion-message): * lisp/cedet/semantic/edit.el (semantic-parse-changes-failed): * lisp/cedet/semantic/wisent/comp.el (wisent-log): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/dframe.el (dframe-message): * lisp/dired-aux.el (dired-query): * lisp/emacs-lisp/byte-opt.el (byte-compile-log-lap-1): * lisp/emacs-lisp/bytecomp.el (byte-compile-log) (byte-compile-log-file, byte-compile-warn, byte-compile-form): * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use) (cconv-analyze-form): * lisp/emacs-lisp/check-declare.el (check-declare-warn): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet): * lisp/emacs-lisp/edebug.el (edebug-format): * lisp/emacs-lisp/eieio-core.el (eieio-oref): * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message) (eldoc-message): * lisp/emacs-lisp/elint.el (elint-file, elint-log): * lisp/emacs-lisp/find-func.el (find-function-library): * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): * lisp/emacs-lisp/nadvice.el (advice--make-docstring): * lisp/emacs-lisp/package.el (package-compute-transaction) (package-install-button-action, package-delete-button-action) (package-menu--list-to-prompt): * lisp/emacs-lisp/timer.el (timer-event-handler): * lisp/emacs-lisp/warnings.el (lwarn, warn): * lisp/emulation/viper-cmd.el: (viper-toggle-parse-sexp-ignore-comments) (viper-kill-buffer, viper-brac-function): * lisp/emulation/viper-macs.el (viper-record-kbd-macro): * lisp/facemenu.el (facemenu-add-new-face): * lisp/faces.el (face-documentation, read-face-name) (face-read-string, read-face-font, describe-face): * lisp/files.el (find-alternate-file, hack-local-variables) (hack-one-local-variable--obsolete, write-file) (basic-save-buffer, delete-directory): * lisp/format.el (format-write-file, format-find-file) (format-insert-file): * lisp/help-fns.el (help-fns--key-bindings) (help-fns--compiler-macro, help-fns--obsolete) (help-fns--interactive-only, describe-function-1) (describe-variable): * lisp/help.el (describe-mode): * lisp/info-xref.el (info-xref-output): * lisp/info.el (Info-virtual-index-find-node) (Info-virtual-index, info-apropos): * lisp/international/kkc.el (kkc-error): * lisp/international/mule-cmds.el: (select-safe-coding-system-interactively) (select-safe-coding-system, describe-input-method): * lisp/international/mule-conf.el (code-offset): * lisp/international/mule-diag.el (describe-character-set) (list-input-methods-1): * lisp/international/quail.el (quail-error): * lisp/minibuffer.el (minibuffer-message): * lisp/mpc.el (mpc--debug): * lisp/msb.el (msb--choose-menu): * lisp/net/ange-ftp.el (ange-ftp-message): * lisp/net/gnutls.el (gnutls-message-maybe): * lisp/net/newst-backend.el (newsticker--sentinel-work): * lisp/net/newst-treeview.el (newsticker--treeview-load): * lisp/net/nsm.el (nsm-query-user): * lisp/net/rlogin.el (rlogin): * lisp/net/soap-client.el (soap-warning): * lisp/net/tramp.el (tramp-debug-message): * lisp/nxml/nxml-outln.el (nxml-report-outline-error): * lisp/nxml/nxml-parse.el (nxml-parse-error): * lisp/nxml/rng-cmpct.el (rng-c-error): * lisp/nxml/rng-match.el (rng-compile-error): * lisp/nxml/rng-uri.el (rng-uri-error): * lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer): * lisp/org/org-ctags.el: (org-ctags-ask-rebuild-tags-file-then-find-tag): * lisp/proced.el (proced-log): * lisp/progmodes/ebnf2ps.el (ebnf-log): * lisp/progmodes/flymake.el (flymake-log): * lisp/progmodes/vhdl-mode.el (vhdl-warning-when-idle): * lisp/replace.el (occur-1): * lisp/simple.el (execute-extended-command) (undo-outer-limit-truncate, define-alternatives): * lisp/startup.el (command-line): * lisp/subr.el (error, user-error, add-to-list): * lisp/tutorial.el (tutorial--describe-nonstandard-key) (tutorial--find-changed-keys): * src/callint.c (Fcall_interactively): * src/editfns.c (Fmessage, Fmessage_box): Restyle the quotes of format strings intended for use as a diagnostic, when restyling seems appropriate. * lisp/subr.el (format-message): New function. * src/doc.c (Finternal__text_restyle): New function. (syms_of_doc): Define it. --- lisp/calc/calc-ext.el | 4 ++-- lisp/calc/calc-help.el | 11 ++++++----- lisp/calc/calc-lang.el | 3 ++- lisp/calc/calc-store.el | 3 ++- lisp/calc/calc-units.el | 2 +- lisp/calc/calc-yank.el | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 1c40188d2b2..bd33fbeb241 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1245,7 +1245,7 @@ calc-kill calc-kill-region calc-yank)))) (defun calc-record-message (tag &rest args) - (let ((msg (apply 'format args))) + (let ((msg (apply #'format-message args))) (message "%s" msg) (calc-record msg tag)) (calc-clear-command-flag 'clear-message)) @@ -1957,7 +1957,7 @@ calc-kill calc-kill-region calc-yank)))) (desc (if (symbolp func) (if (= (logand kind 3) 0) - (format "‘%c’ = %s" key name) + (format-message "‘%c’ = %s" key name) (if pos (format "%s%c%s" (downcase (substring name 0 pos)) diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 50a0291e4cd..18c3b76c423 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -239,7 +239,7 @@ C-w Describe how there is no warranty for Calc." (setq prompts (substring prompts 0 (match-beginning 0)))) (if (string-match "\\` +" prompts) (setq prompts (substring prompts (match-end 0)))) - (setq msg (format + (setq msg (format-message "%s: %s%s‘%s’%s%s %s%s" (if (string-match "\\`\\(calc-[-a-zA-Z0-9]+\\) *\\(.*\\)\\'" @@ -400,8 +400,9 @@ C-w Describe how there is no warranty for Calc." (princ "GNU Emacs Calculator.\n") (princ " By Dave Gillespie.\n") (princ (format " %s\n\n" emacs-copyright)) - (princ (format "Type ‘h s’ for a more detailed summary.\n")) - (princ (format "Or type ‘h i’ to read the full Calc manual on-line.\n\n")) + (princ (format-message "Type ‘h s’ for a more detailed summary.\n")) + (princ (format-message + "Or type ‘h i’ to read the full Calc manual on-line.\n\n")) (princ "Basic keys:\n") (let* ((calc-full-help-flag t)) (mapc (function (lambda (x) (princ (format @@ -415,10 +416,10 @@ C-w Describe how there is no warranty for Calc." (if (car msgs) (princ (if (eq (nth 2 msgs) ?v) - (format + (format-message "\n‘v’ or ‘V’ prefix (vector/matrix) keys: \n") (if (nth 2 msgs) - (format + (format-message "\n‘%c’ prefix (%s) keys:\n" (nth 2 msgs) (or (cdr (assq (nth 2 msgs) diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 9d5020df038..7f5588b6d09 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -2508,7 +2508,8 @@ order to Calc's." (while (> count 0) (if (>= h len) (if what - (math-read-big-error nil v (format "Unmatched ‘%s’" what)) + (math-read-big-error nil v (format-message + "Unmatched ‘%s’" what)) (setq count 0)) (if (memq (aref line h) '(?\( ?\[)) (setq count (1+ count)) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 43dc602225e..4cf5b8c3a31 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -442,7 +442,8 @@ (setq calc-last-edited-variable var) (calc-edit-mode (list 'calc-finish-stack-edit (list 'quote var)) t - (format "Editing variable ‘%s’" (calc-var-name var))) + (format-message + "Editing variable ‘%s’" (calc-var-name var))) (and value (insert (math-format-nice-expr value (frame-width)) "\n"))))) (calc-show-edit-buffer)) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index d95af9492bd..d56c0b29c12 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -1622,7 +1622,7 @@ If COMP or STD is non-nil, put that in the units table instead." (while (eq (car (car (setq uptr (cdr uptr)))) 0))) (insert "\n\n") (insert - (format + (format-message (concat "(**) When in TeX or LaTeX display mode, the TeX specific unit\n" "names will not use the ‘tex’ prefix; the unit name for a\n" diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index d4be8ad832d..cce04705da8 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -603,9 +603,9 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (insert (propertize (concat (or title title "Calc Edit Mode. ") - (format "Press ‘C-c C-c’") + (format-message "Press ‘C-c C-c’") (if allow-ret "" " or RET") - (format " to finish, ‘C-x k RET’ to cancel.\n\n")) + (format-message " to finish, ‘C-x k RET’ to cancel.\n\n")) 'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t)) (make-local-variable 'calc-edit-top) (setq calc-edit-top (point)))) -- cgit v1.2.1 From 875a5d0ead827d3da32ecbd30e739a29f07bbc87 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 24 Aug 2015 23:39:33 -0700 Subject: Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics. --- lisp/calc/calc-aent.el | 4 ++-- lisp/calc/calc-lang.el | 4 ++-- lisp/calc/calc-misc.el | 2 +- lisp/calc/calc-prog.el | 10 +++++----- lisp/calc/calc.el | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 2fa8f19163d..2c588c15287 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1057,7 +1057,7 @@ If the current Calc language does not use placeholders, return nil." (defun math-read-if (cond op) (let ((then (math-read-expr-level 0))) (or (equal math-expr-data ":") - (throw 'syntax "Expected ':'")) + (throw 'syntax "Expected ‘:’")) (math-read-token) (list 'calcFunc-if cond then (math-read-expr-level (nth 3 op))))) @@ -1177,7 +1177,7 @@ If the current Calc language does not use placeholders, return nil." (setq el (cdr el)))) (if (equal math-expr-data "]") (math-read-token) - (throw 'syntax "Expected ']'"))) + (throw 'syntax "Expected ‘]’"))) val))))) ((eq math-exp-token 'dollar) (let ((abs (if (> math-expr-data 0) math-expr-data (- math-expr-data)))) diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 7f5588b6d09..70a9ff8a402 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -1817,7 +1817,7 @@ order to Calc's." (defun math-read-giac-subscr (x op) (let ((idx (math-read-expr-level 0))) (or (equal math-expr-data "]") - (throw 'syntax "Expected ']'")) + (throw 'syntax "Expected ‘]’")) (math-read-token) (list 'calcFunc-subscr x (calc-normalize (list '+ idx 1))))) @@ -1954,7 +1954,7 @@ order to Calc's." (progn (math-read-token) (equal math-expr-data "]"))) - (throw 'syntax "Expected ']]'")) + (throw 'syntax "Expected ‘]]’")) (math-read-token) (list 'calcFunc-subscr x idx))) diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index e5d4b6b0607..4d84146af94 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -952,7 +952,7 @@ Prompts for bug subject. Leaves you in a mail buffer." nil nil nil "Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If possible, include a backtrace by -doing 'M-x toggle-debug-on-error', then reproducing the bug. +doing ‘\\[toggle-debug-on-error]’, then reproducing the bug. " ))) ;;;###autoload (defalias 'calc-report-bug 'report-calc-bug) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index df2eb764f3b..cc1d27032ef 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -597,9 +597,9 @@ ",") ((equal name "#") (search-backward "#") - (error "Token '#' is reserved")) + (error "Token ‘#’ is reserved")) ((and unquoted (string-match "#" name)) - (error "Tokens containing '#' must be quoted")) + (error "Tokens containing ‘#’ must be quoted")) ((not (string-match "[^ ]" name)) (search-backward "\"" nil t) (error "Blank tokens are not allowed")) @@ -610,7 +610,7 @@ (quoted nil)) (while (progn (skip-chars-forward "\n\t ") - (if (eobp) (error "Expected '%s'" eterm)) + (if (eobp) (error "Expected ‘%s’" eterm)) (not (looking-at term))) (cond ((looking-at "%%") (end-of-line)) @@ -618,7 +618,7 @@ (forward-char 2) (let ((p (calc-read-parse-table-part "}" "}"))) (or (looking-at "[+*?]") - (error "Expected '+', '*', or '?'")) + (error "Expected ‘+’, ‘*’, or ‘?’")) (let ((sym (intern (buffer-substring (point) (1+ (point)))))) (forward-char 1) (looking-at "[^\n\t ]*") @@ -650,7 +650,7 @@ (match-end 1))))))) (goto-char (match-end 0))) ((looking-at ":=[\n\t ]") - (error "Misplaced ':='")) + (error "Misplaced ‘:=’")) (t (looking-at "[^\n\t ]*") (let ((end (match-end 0))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index b0046dcaf4b..8e4df58793d 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -989,11 +989,11 @@ Used by `calc-user-invocation'.") (defvar calc-last-kill nil "The last number killed in calc-mode.") (defvar calc-dollar-values nil - "Values to be used for '$'.") + "Values to be used for ‘$’.") (defvar calc-dollar-used nil - "The highest order of '$' that occurred.") + "The highest order of ‘$’ that occurred.") (defvar calc-hashes-used nil - "The highest order of '#' that occurred.") + "The highest order of ‘#’ that occurred.") (defvar calc-quick-prev-results nil "Previous results from Quick Calc.") (defvar calc-said-hello nil -- cgit v1.2.1 From 5e63c842007b0f85e91735a7c4e00be0b7fe9ba5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 28 Aug 2015 22:24:10 -0700 Subject: Fix minor text quoting in calc, calendar, vc * lisp/calc/calc-ext.el (calc-shift-Z-prefix-help): * lisp/calc/calc-help.el (calc-j-prefix-help): * lisp/calc/calc-misc.el (calc-help): * lisp/calc/calc.el (calc-algebraic-mode, calc-mode): Escape an apostrophe in a docstring. * lisp/calc/calc-forms.el (calc-hms-notation): * lisp/calc/calc-mode.el (calc-display-raw, calc-algebraic-mode): Escape an apostrophe in a diagnostic. * lisp/calc/calc-misc.el (calc-help): * lisp/calendar/diary-lib.el (diary-include-files): * lisp/calendar/todo-mode.el (todo-prefix, todo-item-mark): * lisp/vc/diff-mode.el (diff-delete-trailing-whitespace): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/ediff-merg.el (ediff-re-merge): * lisp/vc/ediff-ptch.el (ediff-patch-file-internal): * lisp/vc/ediff-util.el (ediff-test-save-region) (ediff-status-info): * lisp/vc/ediff.el (ediff-merge-revisions) (ediff-merge-revisions-with-ancestor): * lisp/vc/pcvs.el (cvs-mode-checkout, cvs-vc-command-advice): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): Respect text quoting style in doc string or diagnostic. * lisp/calc/calc-prog.el (calc-kbd-push, calc-kbd-pop): * lisp/vc/add-log.el (change-log-goto-source): Avoid double-formatting. * lisp/vc/ediff-init.el (format-message): New backward-compatibility alias. --- lisp/calc/calc-ext.el | 2 +- lisp/calc/calc-forms.el | 68 ++++++++++++++++++++++++------------------------- lisp/calc/calc-help.el | 2 +- lisp/calc/calc-misc.el | 7 ++--- lisp/calc/calc-mode.el | 12 ++++----- lisp/calc/calc-prog.el | 4 +-- lisp/calc/calc.el | 6 ++--- 7 files changed, 51 insertions(+), 50 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index bd33fbeb241..2442f020012 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1988,7 +1988,7 @@ calc-kill calc-kill-region calc-yank)))) "kbd-macros: [ (if), : (else), | (else-if), ] (end-if)" "kbd-macros: < > (repeat), ( ) (for), { } (loop)" "kbd-macros: / (break)" - "kbd-macros: \\=` (save), ' (restore)") + "kbd-macros: \\=` (save), \\=' (restore)") "user" ?Z)) diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index c6e1fdbbeaa..08fa5ceaa79 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -63,7 +63,7 @@ (defun calc-hms-notation (fmt) - (interactive "sHours-minutes-seconds format (hms, @ ' \", etc.): ") + (interactive "sHours-minutes-seconds format (hms, @ \\=' \", etc.): ") (calc-wrapper (if (string-match "\\`\\([^,; ]+\\)\\([,; ]*\\)\\([^,; ]\\)\\([,; ]*\\)\\([^,; ]\\)\\'" fmt) (progn @@ -273,7 +273,7 @@ (m (math-normalize (nth 2 a))) (s (let ((calc-internal-prec (max (- calc-internal-prec 4) 3))) (math-normalize (nth 3 a))))) - (if (or + (if (or (math-negp h) (and (= h 0) (math-negp m)) (and (= h 0) (= m 0) (math-negp s))) @@ -378,15 +378,15 @@ ;;; A numerical date is the number of days since midnight on ;;; the morning of December 31, 1 B.C. (Gregorian) or January 2, 1 A.D. (Julian). ;;; Emacs's calendar refers to such a date as an absolute date, some Calc function -;;; names also use that terminology. If the date is a non-integer, it represents -;;; a specific date and time. +;;; names also use that terminology. If the date is a non-integer, it represents +;;; a specific date and time. ;;; A "dt" is a list of the form, (year month day), corresponding to ;;; an integer code, or (year month day hour minute second), corresponding ;;; to a non-integer code. (defun math-date-to-gregorian-dt (date) "Return the day (YEAR MONTH DAY) in the Gregorian calendar. -DATE is the number of days since December 31, -1 in the Gregorian calendar." +DATE is the number of days since December 31, -1 in the Gregorian calendar." (let* ((month 1) day (year (math-quotient (math-add date (if (Math-lessp date 711859) @@ -399,7 +399,7 @@ DATE is the number of days since December 31, -1 in the Gregorian calendar." (setq year (math-add year -1))) (if (eq year 0) (setq year -1)) (setq date (1+ (math-sub date temp))) - (setq temp + (setq temp (if (math-leap-year-p year) [1 32 61 92 122 153 183 214 245 275 306 336 999] [1 32 60 91 121 152 182 213 244 274 305 335 999])) @@ -410,7 +410,7 @@ DATE is the number of days since December 31, -1 in the Gregorian calendar." (defun math-date-to-julian-dt (date) "Return the day (YEAR MONTH DAY) in the Julian calendar. -DATE is the number of days since December 31, -1 in the Gregorian calendar." +DATE is the number of days since December 31, -1 in the Gregorian calendar." (let* ((month 1) day (year (math-quotient (math-add date (if (Math-lessp date 711859) @@ -423,7 +423,7 @@ DATE is the number of days since December 31, -1 in the Gregorian calendar." (setq year (math-add year -1))) (if (eq year 0) (setq year -1)) (setq date (1+ (math-sub date temp))) - (setq temp + (setq temp (if (math-leap-year-p year t) [1 32 61 92 122 153 183 214 245 275 306 336 999] [1 32 60 91 121 152 182 213 244 274 305 335 999])) @@ -444,7 +444,7 @@ in the Gregorian calendar and the remaining part determines the time." (date (car parts)) (time (nth 1 parts)) (dt (if (and calc-gregorian-switch - (Math-lessp value + (Math-lessp value (or (nth 3 calc-gregorian-switch) (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)) @@ -453,7 +453,7 @@ in the Gregorian calendar and the remaining part determines the time." (math-date-to-gregorian-dt date)))) (if (math-integerp value) dt - (append dt + (append dt (list (/ time 3600) (% (/ time 60) 60) @@ -467,13 +467,13 @@ in the Gregorian calendar and the remaining part determines the time." (year (math-add approx (let ((y approx) (sum 0)) - (while (>= (math-compare date + (while (>= (math-compare date (math-absolute-from-iso-dt (setq y (math-add y 1)) 1 1)) 0) (setq sum (+ sum 1))) sum)))) - (list + (list year - (math-add (car (math-idivmod + (math-add (car (math-idivmod (math-sub date (math-absolute-from-iso-dt year 1 1)) 7)) 1) @@ -525,7 +525,7 @@ in the Gregorian calendar and the remaining part determines the time." (defun math-leap-year-p (year &optional julian) "Non-nil if YEAR is a leap year. If JULIAN is non-nil, then use the criterion for leap years -in the Julian calendar, otherwise use the criterion in the +in the Julian calendar, otherwise use the criterion in the Gregorian calendar." (if julian (if (math-negp year) @@ -584,7 +584,7 @@ Recall that DATE is the number of days since December 31, -1 in the Gregorian calendar." (if (eq year 0) (setq year -1)) (let ((yearm1 (math-sub year 1))) - (math-sub + (math-sub ;; Add the number of days of the year and the numbers of days ;; in the previous years (leap year days to be added separately) (math-add (math-day-in-year year month day) @@ -595,9 +595,9 @@ in the Gregorian calendar." (math-sub 365 (math-quotient (math-sub 3 year) 4))))) - ;; Subtract the number of Julian leap years which are not - ;; Gregorian leap years. In C=4N+r centuries, there will - ;; be 3N+r of these days. The following will compute + ;; Subtract the number of Julian leap years which are not + ;; Gregorian leap years. In C=4N+r centuries, there will + ;; be 3N+r of these days. The following will compute ;; 3N+r. (let* ((correction (math-mul (math-quotient yearm1 100) 3)) (res (math-idivmod correction 4))) @@ -612,7 +612,7 @@ Recall that DATE is the number of days since December 31, -1 in the Gregorian calendar." (if (eq year 0) (setq year -1)) (let ((yearm1 (math-sub year 1))) - (math-sub + (math-sub ;; Add the number of days of the year and the numbers of days ;; in the previous years (leap year days to be added separately) (math-add (math-day-in-year year month day) @@ -731,11 +731,11 @@ as measured in the integer number of days before December 31, 1 BC (Gregorian)." ((eq x 'n) (math-format-number (math-floor math-fd-date))) ((eq x 'J) - (math-format-number + (math-format-number (math-add math-fd-date math-julian-date-beginning))) ((eq x 'j) - (math-format-number (math-add - (math-floor math-fd-date) + (math-format-number (math-add + (math-floor math-fd-date) math-julian-date-beginning-int))) ((eq x 'U) (math-format-number (nth 1 (math-date-parts math-fd-date 719164)))) @@ -1082,7 +1082,7 @@ as measured in the integer number of days before December 31, 1 BC (Gregorian)." (throw 'syntax "Day value is out of range")) (and hour (progn - (if (or (< hour 0) + (if (or (< hour 0) (> hour 24) (and (= hour 24) (not (= minute 0)) @@ -1102,7 +1102,7 @@ as measured in the integer number of days before December 31, 1 BC (Gregorian)." (throw 'syntax "Weekday value is out of range")) (and hour (progn - (if (or (< hour 0) + (if (or (< hour 0) (> hour 24) (and (= hour 24) (not (= minute 0)) @@ -1473,7 +1473,7 @@ as measured in the integer number of days before December 31, 1 BC (Gregorian)." ;; From cal-dst (defvar calendar-current-time-zone-cache) -(defvar math-calendar-tzinfo +(defvar math-calendar-tzinfo nil "Information about the timezone, retrieved from the calendar.") @@ -1523,7 +1523,7 @@ second, the number of seconds offset for daylight savings." (if (calc-var-value 'var-TimeZone) (calcFunc-tzone (calc-var-value 'var-TimeZone) date) (let ((tzinfo (math-get-calendar-tzinfo))) - (+ (nth 0 tzinfo) + (+ (nth 0 tzinfo) (* (math-cal-daylight-savings-adjust date) (nth 1 tzinfo))))))) (defvar math-daylight-savings-hook 'math-std-daylight-savings) @@ -1559,8 +1559,8 @@ second, the number of seconds offset for daylight savings." (+ (nth 3 dt) (/ (nth 4 dt) 60.0))) (t 0))) - (rounded-abs-date - (+ + (rounded-abs-date + (+ (calendar-absolute-from-gregorian (list (nth 1 dt) (nth 2 dt) (nth 0 dt))) (/ (round (* 60 time)) 60.0 24.0)))) @@ -1700,7 +1700,7 @@ and ends on the last Sunday of October at 2 a.m." (let* ((dt (math-date-to-dt date)) (dim (math-days-in-month (car dt) (nth 1 dt))) (julian (if calc-gregorian-switch - (math-date-to-dt (math-sub + (math-date-to-dt (math-sub (or (nth 3 calc-gregorian-switch) (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)) 1))))) @@ -1727,14 +1727,14 @@ and ends on the last Sunday of October at 2 a.m." (list 'date (math-dt-to-date (list (car dt) (nth 1 dt) (1+ day)))) ;; Otherwise do some computations (let ((tm (+ day (- (nth 2 calc-gregorian-switch) (nth 2 julian))))) - (list 'date (math-dt-to-date + (list 'date (math-dt-to-date (list (car dt) (nth 1 dt) - ;; + ;; (if (> tm dim) dim tm))))))) ((and (eq (car dt) (car julian)) (= (nth 1 dt) (nth 1 julian))) - ;; In this case, the current month is truncated because of the switch + ;; In this case, the current month is truncated because of the switch ;; to the Gregorian calendar (list 'date (math-dt-to-date (list (car dt) @@ -1742,7 +1742,7 @@ and ends on the last Sunday of October at 2 a.m." (if (>= day (nth 2 julian)) (nth 2 julian) (1+ day)))))) - (t + (t ;; The default (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day)))) (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day))))) @@ -1779,7 +1779,7 @@ and ends on the last Sunday of October at 2 a.m." ;; Otherwise, just make sure the date doesn't go past the end of the year (list 'date (math-min (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day)) (math-dt-to-date (list (car dt) 12 31)))))) - (t + (t (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day))))) (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 18c3b76c423..395b12d8699 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -546,7 +546,7 @@ C-w Describe how there is no warranty for Calc." '("Select, Additional, Once; eVal, Formula; Rewrite" "More, Less, 1-9, Next, Previous" "Unselect, Clear; Display; Enable; Breakable" - "' (replace), \\=` (edit), +, -, *, /, RET (grab), DEL" + "\\=' (replace), \\=` (edit), +, -, *, /, RET (grab), DEL" "SHIFT + swap: Left, Right; maybe: Select, Once" "SHIFT + Commute, Merge, Distrib, jump-Eqn, Isolate" "SHIFT + Negate, & (invert); Unpack") diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 4d84146af94..e141589ab7b 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -225,7 +225,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). "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: \\=' (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)" @@ -253,11 +253,12 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). 0)) (let ((msg (nth calc-help-phase msgs))) (message "%s" (if msg - (concat msg ":" + (concat (substitute-command-keys msg) ":" (make-string (- (apply 'max (mapcar 'length msgs)) - (length msg)) 32) + (length msg)) + ?\ ) " [?=MORE]") "")))))))) diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index 605084e3f35..b5eef7f6784 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -258,7 +258,7 @@ (setq calc-display-raw (if calc-display-raw nil (if arg 0 t))) (calc-do-refresh) (if calc-display-raw - (message "Press d ' again to cancel \"raw\" display mode")))) + (message "%s" "Press d ' again to cancel \"raw\" display mode")))) @@ -446,11 +446,11 @@ (calc-change-mode '(calc-algebraic-mode calc-incomplete-algebraic-mode) (list (not calc-algebraic-mode) nil))) (use-local-map calc-mode-map) - (message (if calc-algebraic-mode - "Numeric keys and ( and [ begin algebraic entry" - (if calc-incomplete-algebraic-mode - "Only ( and [ begin algebraic entry" - "No keys except ' and $ begin algebraic entry"))))) + (message "%s" (if calc-algebraic-mode + "Numeric keys and ( and [ begin algebraic entry" + (if calc-incomplete-algebraic-mode + "Only ( and [ begin algebraic entry" + "No keys except ' and $ begin algebraic entry"))))) (defun calc-symbolic-mode (n) (interactive "P") diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index cc1d27032ef..58d2b5ce431 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1441,7 +1441,7 @@ Redefine the corresponding command." (let ((calc-kbd-push-level 0)) (execute-kbd-macro (substring body 0 -2)))) (let ((calc-kbd-push-level (1+ calc-kbd-push-level))) - (message "Saving modes; type Z' to restore") + (message "%s" "Saving modes; type Z' to restore") (recursive-edit)))))) (defun calc-kbd-pop () @@ -1450,7 +1450,7 @@ Redefine the corresponding command." (progn (message "Mode settings restored") (exit-recursive-edit)) - (error "Unbalanced Z' in keyboard macro"))) + (error "%s" "Unbalanced Z' in keyboard macro"))) ;; (defun calc-kbd-report (msg) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 8e4df58793d..ea20986bc85 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -736,7 +736,7 @@ If hms, angles are in degrees-minutes-seconds.") (defcalcmodevar calc-algebraic-mode nil "If non-nil, numeric entry accepts whole algebraic expressions. -If nil, algebraic expressions must be preceded by \"'\".") +If nil, algebraic expressions must be preceded by \"\\='\".") (defcalcmodevar calc-incomplete-algebraic-mode nil "Like calc-algebraic-mode except only affects ( and [ keys.") @@ -1311,7 +1311,7 @@ This is an RPN calculator featuring arbitrary-precision integer, rational, floating-point, complex, matrix, and symbolic arithmetic. RPN calculation: 2 RET 3 + produces 5. -Algebraic style: ' 2+3 RET produces 5. +Algebraic style: \\=' 2+3 RET produces 5. Basic operators are +, -, *, /, ^, & (reciprocal), % (modulo), n (change-sign). @@ -1330,7 +1330,7 @@ Notations: 3.14e6 3.14 * 10^6 [1 .. 4) semi-open interval, 1 <= x < 4 2 +/- 3 (p key) number with mean 2, standard deviation 3 2 mod 3 (M key) number 2 computed modulo 3 - <1 jan 91> Date form (enter using ' key) + <1 jan 91> Date form (enter using \\=' key) \\{calc-mode-map} -- cgit v1.2.1 From 6afef3f6ca2f3009c722b84e249903b7f807b044 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 7 Sep 2015 08:41:44 -0700 Subject: Go back to grave quoting in source-code docstrings etc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts almost all my recent changes to use curved quotes in docstrings and/or strings used for error diagnostics. There are a few exceptions, e.g., Bahá’í proper names. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/abbrev.el (expand-region-abbrevs): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet) (outlineify-sticky): * lisp/apropos.el (apropos-library): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/button.el (button-category-symbol, button-put) (make-text-button): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-embed.el (calc-do-embedded): * lisp/calc/calc-ext.el (calc-user-function-list): * lisp/calc/calc-graph.el (calc-graph-show-dumb): * lisp/calc/calc-help.el (calc-describe-key) (calc-describe-thing, calc-full-help): * lisp/calc/calc-lang.el (calc-c-language) (math-parse-fortran-vector-end, math-parse-tex-sum) (math-parse-eqn-matrix, math-parse-eqn-prime) (calc-yacas-language, calc-maxima-language, calc-giac-language) (math-read-giac-subscr, math-read-math-subscr) (math-read-big-rec, math-read-big-balance): * lisp/calc/calc-misc.el (calc-help, report-calc-bug): * lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes) (calc-auto-recompute): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part, calc-user-define-invocation) (math-do-arg-check): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-units.el (math-build-units-table-buffer): * lisp/calc/calc-vec.el (math-read-brackets): * lisp/calc/calc-yank.el (calc-edit-mode): * lisp/calc/calc.el (calc, calc-do, calc-user-invocation): * lisp/calendar/appt.el (appt-display-message): * lisp/calendar/diary-lib.el (diary-check-diary-file) (diary-mail-entries, diary-from-outlook): * lisp/calendar/icalendar.el (icalendar-export-region) (icalendar--convert-float-to-ical) (icalendar--convert-date-to-ical) (icalendar--convert-ical-to-diary) (icalendar--convert-recurring-to-diary) (icalendar--add-diary-entry): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/timeclock.el (timeclock-mode-line-display) (timeclock-make-hours-explicit, timeclock-log-data): * lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category) (todo-item-mark, todo-check-format) (todo-insert-item--next-param, todo-edit-item--next-key) (todo-mode): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/mode-local.el (describe-mode-local-overload) (mode-local-print-binding, mode-local-describe-bindings-2): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/cedet/srecode/srt-mode.el (srecode-macro-help): * lisp/cus-start.el (standard): * lisp/cus-theme.el (describe-theme-1): * lisp/custom.el (custom-add-dependencies, custom-check-theme) (custom--sort-vars-1, load-theme): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/dired-x.el (dired-do-run-mail): * lisp/dired.el (dired-log): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-enable-advice) (ad-disable-advice, ad-remove-advice, ad-set-argument) (ad-set-arguments, ad--defalias-fset, ad-activate) (ad-deactivate): * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand) (byte-compile-unfold-lambda, byte-optimize-form-code-walker) (byte-optimize-while, byte-optimize-apply): * lisp/emacs-lisp/byte-run.el (defun, defsubst): * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode) (byte-compile-log-file, byte-compile-format-warn) (byte-compile-nogroup-warn, byte-compile-arglist-warn) (byte-compile-cl-warn) (byte-compile-warn-about-unresolved-functions) (byte-compile-file, byte-compile--declare-var) (byte-compile-file-form-defmumble, byte-compile-form) (byte-compile-normal-call, byte-compile-check-variable) (byte-compile-variable-ref, byte-compile-variable-set) (byte-compile-subr-wrong-args, byte-compile-setq-default) (byte-compile-negation-optimizer) (byte-compile-condition-case--old) (byte-compile-condition-case--new, byte-compile-save-excursion) (byte-compile-defvar, byte-compile-autoload) (byte-compile-lambda-form) (byte-compile-make-variable-buffer-local, display-call-tree) (batch-byte-compile): * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use): * lisp/emacs-lisp/chart.el (chart-space-usage): * lisp/emacs-lisp/check-declare.el (check-declare-scan) (check-declare-warn, check-declare-file) (check-declare-directory): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine) (checkdoc-message-text-engine): * lisp/emacs-lisp/cl-extra.el (cl-parse-integer) (cl--describe-class): * lisp/emacs-lisp/cl-generic.el (cl-defgeneric) (cl--generic-describe, cl-generic-generalizers): * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody) (cl-symbol-macrolet): * lisp/emacs-lisp/cl.el (cl-unload-function, flet): * lisp/emacs-lisp/copyright.el (copyright) (copyright-update-directory): * lisp/emacs-lisp/edebug.el (edebug-read-list): * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read): * lisp/emacs-lisp/eieio-core.el (eieio--slot-override) (eieio-oref): * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor): * lisp/emacs-lisp/eieio-speedbar.el: (eieio-speedbar-child-make-tag-lines) (eieio-speedbar-child-description): * lisp/emacs-lisp/eieio.el (defclass, change-class): * lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms) (elint-init-form, elint-check-defalias-form) (elint-check-let-form): * lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu) (ert-results-pop-to-backtrace-for-test-at-point) (ert-results-pop-to-messages-for-test-at-point) (ert-results-pop-to-should-forms-for-test-at-point) (ert-describe-test): * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol) (find-function-library): * lisp/emacs-lisp/generator.el (iter-yield): * lisp/emacs-lisp/gv.el (gv-define-simple-setter): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): * lisp/emacs-lisp/nadvice.el (advice--make-docstring) (advice--make, define-advice): * lisp/emacs-lisp/package-x.el (package-upload-file): * lisp/emacs-lisp/package.el (package-version-join) (package-disabled-p, package-activate-1, package-activate) (package--download-one-archive) (package--download-and-read-archives) (package-compute-transaction, package-install-from-archive) (package-install, package-install-selected-packages) (package-delete, package-autoremove, describe-package-1) (package-install-button-action, package-delete-button-action) (package-menu-hide-package, package-menu--list-to-prompt) (package-menu--perform-transaction) (package-menu--find-and-notify-upgrades): * lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1): * lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode): * lisp/emacs-lisp/ring.el (ring-previous, ring-next): * lisp/emacs-lisp/rx.el (rx-check, rx-anything) (rx-check-any-string, rx-check-any, rx-check-not, rx-=) (rx-repeat, rx-check-backref, rx-syntax, rx-check-category) (rx-form): * lisp/emacs-lisp/smie.el (smie-config-save): * lisp/emacs-lisp/subr-x.el (internal--check-binding): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag): * lisp/emacs-lisp/testcover.el (testcover-1value): * lisp/emacs-lisp/timer.el (timer-event-handler): * lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments) (viper-toggle-search-style, viper-kill-buffer) (viper-brac-function): * lisp/emulation/viper-macs.el (viper-record-kbd-macro): * lisp/env.el (setenv): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp) (eshell-glob-entries): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/facemenu.el (facemenu-add-new-face) (facemenu-add-new-color): * lisp/faces.el (read-face-name, read-face-font, describe-face) (x-resolve-font-name): * lisp/files-x.el (modify-file-local-variable): * lisp/files.el (locate-user-emacs-file, find-alternate-file) (set-auto-mode, hack-one-local-variable--obsolete) (dir-locals-set-directory-class, write-file, basic-save-buffer) (delete-directory, copy-directory, recover-session) (recover-session-finish, insert-directory) (file-modes-char-to-who, file-modes-symbolic-to-number) (move-file-to-trash): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/finder.el (finder-commentary): * lisp/font-lock.el (font-lock-fontify-buffer): * lisp/format.el (format-write-file, format-find-file) (format-insert-file): * lisp/frame.el (get-device-terminal, select-frame-by-name): * lisp/fringe.el (fringe--check-style): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/help-fns.el (help-fns--key-bindings) (help-fns--compiler-macro, help-fns--parent-mode) (help-fns--obsolete, help-fns--interactive-only) (describe-function-1, describe-variable): * lisp/help.el (describe-mode) (describe-minor-mode-from-indicator): * lisp/image.el (image-type): * lisp/international/ccl.el (ccl-dump): * lisp/international/fontset.el (x-must-resolve-font-name): * lisp/international/mule-cmds.el (prefer-coding-system) (select-safe-coding-system-interactively) (select-safe-coding-system, activate-input-method) (toggle-input-method, describe-current-input-method) (describe-language-environment): * lisp/international/mule-conf.el (code-offset): * lisp/international/mule-diag.el (describe-character-set) (list-input-methods-1): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mouse.el (minor-mode-menu-from-indicator): * lisp/mpc.el (mpc-playlist-rename): * lisp/msb.el (msb--choose-menu): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/imap.el (imap-interactive-login): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/newst-backend.el (newsticker--sentinel-work): * lisp/net/newst-treeview.el (newsticker--treeview-load): * lisp/net/rlogin.el (rlogin): * lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer): * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/proced.el (proced-log): * lisp/progmodes/ada-mode.el (ada-get-indent-case) (ada-check-matching-start, ada-goto-matching-start): * lisp/progmodes/ada-prj.el (ada-prj-display-page): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/ebrowse.el (ebrowse-tags-apropos): * lisp/progmodes/etags.el (etags-tags-apropos-additional): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-shell-get-process-or-error) (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate): * lisp/recentf.el (recentf-open-files): * lisp/replace.el (query-replace-read-from) (occur-after-change-function, occur-1): * lisp/scroll-bar.el (scroll-bar-columns): * lisp/server.el (server-get-auth-key): * lisp/simple.el (execute-extended-command) (undo-outer-limit-truncate, list-processes--refresh) (compose-mail, set-variable, choose-completion-string) (define-alternatives): * lisp/startup.el (site-run-file, tty-handle-args, command-line) (command-line-1): * lisp/subr.el (noreturn, define-error, add-to-list) (read-char-choice, version-to-list): * lisp/term/common-win.el (x-handle-xrm-switch) (x-handle-name-switch, x-handle-args): * lisp/term/x-win.el (x-handle-parent-id, x-handle-smid): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/textmodes/two-column.el (2C-split): * lisp/tutorial.el (tutorial--describe-nonstandard-key) (tutorial--find-changed-keys): * lisp/type-break.el (type-break-noninteractive-query): * lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes) (wdired-do-perm-changes): * lisp/whitespace.el (whitespace-report-region): Prefer grave quoting in source-code strings used to generate help and diagnostics. * lisp/faces.el (face-documentation): No need to convert quotes, since the result is a docstring. * lisp/info.el (Info-virtual-index-find-node) (Info-virtual-index, info-apropos): Simplify by generating only curved quotes, since info files are typically that ways nowadays anyway. * lisp/international/mule-diag.el (list-input-methods): Don’t assume text quoting style is curved. * lisp/org/org-bibtex.el (org-bibtex-fields): Revert my recent changes, going back to the old quoting style. --- lisp/calc/calc-aent.el | 10 +++++----- lisp/calc/calc-embed.el | 2 +- lisp/calc/calc-ext.el | 2 +- lisp/calc/calc-graph.el | 2 +- lisp/calc/calc-help.el | 16 ++++++++-------- lisp/calc/calc-lang.el | 42 +++++++++++++++++++++--------------------- lisp/calc/calc-misc.el | 4 ++-- lisp/calc/calc-mode.el | 12 ++++++------ lisp/calc/calc-prog.el | 14 +++++++------- lisp/calc/calc-store.el | 2 +- lisp/calc/calc-units.el | 6 +++--- lisp/calc/calc-vec.el | 4 ++-- lisp/calc/calc-yank.el | 4 ++-- lisp/calc/calc.el | 12 ++++++------ 14 files changed, 66 insertions(+), 66 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 2c588c15287..2319c484498 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1034,7 +1034,7 @@ in Calc algebraic input.") (defun math-restore-placeholders (x) "Replace placeholders by the proper characters in the symbol x. -This includes ‘#’ for ‘_’ and ‘'’ for ‘%’. +This includes `#' for `_' and `'' for `%'. If the current Calc language does not use placeholders, return nil." (if (or (memq calc-language calc-lang-allow-underscores) (memq calc-language calc-lang-allow-percentsigns)) @@ -1057,7 +1057,7 @@ If the current Calc language does not use placeholders, return nil." (defun math-read-if (cond op) (let ((then (math-read-expr-level 0))) (or (equal math-expr-data ":") - (throw 'syntax "Expected ‘:’")) + (throw 'syntax "Expected `:'")) (math-read-token) (list 'calcFunc-if cond then (math-read-expr-level (nth 3 op))))) @@ -1121,7 +1121,7 @@ If the current Calc language does not use placeholders, return nil." (math-read-expr-list)))) (if (not (or (equal math-expr-data calc-function-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected ‘)’")) + (throw 'syntax "Expected `)'")) (math-read-token) (if (and (memq calc-language calc-lang-parens-are-subscripts) @@ -1177,7 +1177,7 @@ If the current Calc language does not use placeholders, return nil." (setq el (cdr el)))) (if (equal math-expr-data "]") (math-read-token) - (throw 'syntax "Expected ‘]’"))) + (throw 'syntax "Expected `]'"))) val))))) ((eq math-exp-token 'dollar) (let ((abs (if (> math-expr-data 0) math-expr-data (- math-expr-data)))) @@ -1246,7 +1246,7 @@ If the current Calc language does not use placeholders, return nil." (if (not (or (equal math-expr-data ")") (and (equal math-expr-data "]") (eq (car-safe exp) 'intv)) (eq math-exp-token 'end))) - (throw 'syntax "Expected ‘)’")) + (throw 'syntax "Expected `)'")) (math-read-token) exp)) ((eq math-exp-token 'string) diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index 3f6e83e0c6d..d0efe53f6e6 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -333,7 +333,7 @@ (message (concat "Embedded Calc mode enabled; " (if calc-embedded-quiet - "Type ‘C-x * x’" + "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 2442f020012..cb6ab6f8ecc 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1957,7 +1957,7 @@ calc-kill calc-kill-region calc-yank)))) (desc (if (symbolp func) (if (= (logand kind 3) 0) - (format-message "‘%c’ = %s" key name) + (format-message "`%c' = %s" key name) (if pos (format "%s%c%s" (downcase (substring name 0 pos)) diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 8378b23c0eb..20b0249ec1a 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -958,7 +958,7 @@ 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 "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 395b12d8699..444bb5ef920 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -240,7 +240,7 @@ C-w Describe how there is no warranty for Calc." (if (string-match "\\` +" prompts) (setq prompts (substring prompts (match-end 0)))) (setq msg (format-message - "%s: %s%s‘%s’%s%s %s%s" + "%s: %s%s`%s'%s%s %s%s" (if (string-match "\\`\\(calc-[-a-zA-Z0-9]+\\) *\\(.*\\)\\'" cmd) @@ -345,7 +345,7 @@ C-w Describe how there is no warranty for Calc." (calc-describe-thing var "Variable Index")) (defun calc-describe-thing (thing where &optional target not-quoted) - (message "Looking for ‘%s’ in %s..." thing where) + (message "Looking for `%s' in %s..." thing where) (let ((savewin (current-window-configuration))) (calc-info-goto-node where) (or (let ((case-fold-search nil)) @@ -361,7 +361,7 @@ C-w Describe how there is no warranty for Calc." (if Info-history (Info-last)) (set-window-configuration savewin) - (error "Can't find ‘%s’ in %s" thing where))) + (error "Can't find `%s' in %s" thing where))) (let (Info-history) (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (let* ((string-target (or target thing)) @@ -380,7 +380,7 @@ C-w Describe how there is no warranty for Calc." (re-search-forward quoted nil t) (search-forward string-target nil t))))) (beginning-of-line) - (message "Found ‘%s’ in %s" thing where))) + (message "Found `%s' in %s" thing where))) (defun calc-view-news () (interactive) @@ -400,9 +400,9 @@ C-w Describe how there is no warranty for Calc." (princ "GNU Emacs Calculator.\n") (princ " By Dave Gillespie.\n") (princ (format " %s\n\n" emacs-copyright)) - (princ (format-message "Type ‘h s’ for a more detailed summary.\n")) + (princ (format-message "Type `h s' for a more detailed summary.\n")) (princ (format-message - "Or type ‘h i’ to read the full Calc manual on-line.\n\n")) + "Or type `h i' to read the full Calc manual on-line.\n\n")) (princ "Basic keys:\n") (let* ((calc-full-help-flag t)) (mapc (function (lambda (x) (princ (format @@ -417,10 +417,10 @@ C-w Describe how there is no warranty for Calc." (princ (if (eq (nth 2 msgs) ?v) (format-message - "\n‘v’ or ‘V’ prefix (vector/matrix) keys: \n") + "\n`v' or `V' prefix (vector/matrix) keys: \n") (if (nth 2 msgs) (format-message - "\n‘%c’ prefix (%s) keys:\n" + "\n`%c' prefix (%s) keys:\n" (nth 2 msgs) (or (cdr (assq (nth 2 msgs) calc-help-long-names)) diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 70a9ff8a402..6b3b949424d 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -94,7 +94,7 @@ (interactive) (calc-wrapper (calc-set-language 'c) - (message "‘C’ language mode"))) + (message "C language mode"))) (put 'c 'math-oper-table '( ( "u!" calcFunc-lnot -1 1000 ) @@ -387,7 +387,7 @@ math-exp-token 'end math-expr-data "\000") x) - (throw 'syntax "Unmatched closing ‘/’"))) + (throw 'syntax "Unmatched closing `/'"))) (defun math-parse-fortran-subscr (sym args) (setq sym (math-build-var-name sym)) @@ -695,7 +695,7 @@ (defun math-parse-tex-sum (f val) (let (low high save) - (or (equal math-expr-data "_") (throw 'syntax "Expected ‘_’")) + (or (equal math-expr-data "_") (throw 'syntax "Expected `_'")) (math-read-token) (setq save math-exp-old-pos) (setq low (math-read-factor)) @@ -703,7 +703,7 @@ (progn (setq math-exp-old-pos (1+ save)) (throw 'syntax "Expected equation"))) - (or (equal math-expr-data "^") (throw 'syntax "Expected ‘^’")) + (or (equal math-expr-data "^") (throw 'syntax "Expected `^'")) (math-read-token) (setq high (math-read-factor)) (list (nth 2 f) (math-read-factor) (nth 1 low) (nth 2 low) high))) @@ -1165,14 +1165,14 @@ (while (assoc math-expr-data '(("ccol") ("lcol") ("rcol"))) (math-read-token) (or (equal math-expr-data calc-function-open) - (throw 'syntax "Expected ‘{’")) + (throw 'syntax "Expected `{'")) (math-read-token) (setq vec (cons (cons 'vec (math-read-expr-list)) vec)) (or (equal math-expr-data calc-function-close) - (throw 'syntax "Expected ‘}’")) + (throw 'syntax "Expected `}'")) (math-read-token)) (or (equal math-expr-data calc-function-close) - (throw 'syntax "Expected ‘}’")) + (throw 'syntax "Expected `}'")) (math-read-token) (math-transpose (cons 'vec (nreverse vec))))) @@ -1187,7 +1187,7 @@ (math-read-expr-list)))) (if (not (or (equal math-expr-data calc-function-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected ‘)’")) + (throw 'syntax "Expected `)'")) (math-read-token) (cons (intern (format "calcFunc-%s'" (nth 1 x))) args))) (list 'var @@ -1211,7 +1211,7 @@ (interactive) (calc-wrapper (calc-set-language 'yacas) - (message "‘Yacas’ language mode"))) + (message "Yacas language mode"))) (put 'yacas 'math-vector-brackets "{}") @@ -1427,7 +1427,7 @@ (interactive) (calc-wrapper (calc-set-language 'maxima) - (message "‘Maxima’ language mode"))) + (message "Maxima language mode"))) (put 'maxima 'math-oper-table '(("+" + 100 100) @@ -1625,7 +1625,7 @@ (interactive) (calc-wrapper (calc-set-language 'giac) - (message "‘Giac’ language mode"))) + (message "Giac language mode"))) (put 'giac 'math-oper-table '( ( "[" (math-read-giac-subscr) 250 -1 ) @@ -1817,7 +1817,7 @@ order to Calc's." (defun math-read-giac-subscr (x op) (let ((idx (math-read-expr-level 0))) (or (equal math-expr-data "]") - (throw 'syntax "Expected ‘]’")) + (throw 'syntax "Expected `]'")) (math-read-token) (list 'calcFunc-subscr x (calc-normalize (list '+ idx 1))))) @@ -1954,7 +1954,7 @@ order to Calc's." (progn (math-read-token) (equal math-expr-data "]"))) - (throw 'syntax "Expected ‘]]’")) + (throw 'syntax "Expected `]]'")) (math-read-token) (list 'calcFunc-subscr x idx))) @@ -2237,7 +2237,7 @@ order to Calc's." (if (= sep ?\.) (setq h (1+ h))) (if (= sep ?\]) - (math-read-big-error (1- h) v "Expected ‘)’")) + (math-read-big-error (1- h) v "Expected `)'")) (if (= sep ?\)) (setq p (math-read-big-rec (1+ math-rb-h1) math-rb-v1 (1- h) math-rb-v2 v)) @@ -2252,7 +2252,7 @@ order to Calc's." 0 1) p)))) ((= (math-read-big-char (1- h) v) ?\]) - (math-read-big-error (1- h) v "Expected ‘)’")) + (math-read-big-error (1- h) v "Expected `)'")) ((= sep ?\,) (or (and (math-realp (car p)) (math-realp (nth 1 p))) (math-read-big-error @@ -2280,7 +2280,7 @@ order to Calc's." (setq h (math-read-big-balance (1+ hleft) v "[")) (if hright (or (= h hright) - (math-read-big-error hright v "Expected ‘]’")) + (math-read-big-error hright v "Expected `]'")) (setq hright h)) (setq p (cons (math-read-big-rec hleft v h (1+ v)) p)) @@ -2293,7 +2293,7 @@ order to Calc's." (setq h (1+ h))) (and (= (math-read-big-char h v) ?\]) (setq h (1+ h)))) - (math-read-big-error (1- h) v "Expected ‘]’")) + (math-read-big-error (1- h) v "Expected `]'")) (if (= (math-read-big-char h vtop) ?\,) (setq h (1+ h))) (math-read-big-emptyp math-rb-h1 (1+ v) (1- h) math-rb-v2 nil t) @@ -2317,7 +2317,7 @@ order to Calc's." (setq widest (math-read-big-char (1- h) v)) (if (or (memq widest '(?\; ?\))) (and (eq widest ?\.) (cdr p))) - (math-read-big-error (1- h) v "Expected ‘]’")) + (math-read-big-error (1- h) v "Expected `]'")) (if (= widest ?\.) (setq h (1+ h) widest (math-read-big-balance h v "[") @@ -2369,7 +2369,7 @@ order to Calc's." h widest) (= (math-read-big-char (1- h) v) ?\,))) (or (= (math-read-big-char (1- h) v) ?\)) - (math-read-big-error (1- h) v "Expected ‘)’")) + (math-read-big-error (1- h) v "Expected `)'")) (setq p (cons line (nreverse p)))) (setq p (list 'var (intern (math-remove-dashes p)) @@ -2433,7 +2433,7 @@ order to Calc's." math-rb-v2 baseline nil t))) (or (= (math-read-big-char math-read-big-h2 baseline) ?\:) (math-read-big-error math-read-big-h2 baseline - "Expected ‘:’")) + "Expected `:'")) (setq p (list (nth 1 widest) p y (math-read-big-rec (1+ math-read-big-h2) math-rb-v1 math-rb-h2 math-rb-v2 @@ -2509,7 +2509,7 @@ order to Calc's." (if (>= h len) (if what (math-read-big-error nil v (format-message - "Unmatched ‘%s’" what)) + "Unmatched `%s'" what)) (setq count 0)) (if (memq (aref line h) '(?\( ?\[)) (setq count (1+ count)) diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index e141589ab7b..aa0ccb79edd 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -217,7 +217,7 @@ 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" + '("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" @@ -953,7 +953,7 @@ Prompts for bug subject. Leaves you in a mail buffer." nil nil nil "Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If possible, include a backtrace by -doing ‘\\[toggle-debug-on-error]’, then reproducing the bug. +doing `\\[toggle-debug-on-error]', then reproducing the bug. " ))) ;;;###autoload (defalias 'calc-report-bug 'report-calc-bug) diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index b5eef7f6784..3ed9612f79a 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -110,11 +110,11 @@ (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 "User must press `w' to explain unsimplified results")) ((eq n t) - (message "Automatically doing ‘w’ to explain unsimplified results")) + (message "Automatically doing `w' to explain unsimplified results")) (t - (message "Automatically doing ‘w’ only for unusual messages"))))) + (message "Automatically doing `w' only for unusual messages"))))) (defun calc-group-digits (n) (interactive "P") @@ -272,7 +272,7 @@ (vals (mapcar (function (lambda (v) (symbol-value (car v)))) calc-mode-var-list))) (unless calc-settings-file - (error "No ‘calc-settings-file’ specified")) + (error "No `calc-settings-file' specified")) (set-buffer (find-file-noselect (substitute-in-file-name calc-settings-file))) (goto-char (point-min)) @@ -572,8 +572,8 @@ (calc-change-mode 'calc-auto-recompute arg nil t) (calc-refresh-evaltos) (message (if calc-auto-recompute - "Automatically recomputing ‘=>’ forms when necessary" - "Not recomputing ‘=>’ forms automatically")))) + "Automatically recomputing `=>' forms when necessary" + "Not recomputing `=>' forms automatically")))) (defun calc-working (n) (interactive "P") diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 58d2b5ce431..57af0d27822 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -597,9 +597,9 @@ ",") ((equal name "#") (search-backward "#") - (error "Token ‘#’ is reserved")) + (error "Token `#' is reserved")) ((and unquoted (string-match "#" name)) - (error "Tokens containing ‘#’ must be quoted")) + (error "Tokens containing `#' must be quoted")) ((not (string-match "[^ ]" name)) (search-backward "\"" nil t) (error "Blank tokens are not allowed")) @@ -610,7 +610,7 @@ (quoted nil)) (while (progn (skip-chars-forward "\n\t ") - (if (eobp) (error "Expected ‘%s’" eterm)) + (if (eobp) (error "Expected `%s'" eterm)) (not (looking-at term))) (cond ((looking-at "%%") (end-of-line)) @@ -618,7 +618,7 @@ (forward-char 2) (let ((p (calc-read-parse-table-part "}" "}"))) (or (looking-at "[+*?]") - (error "Expected ‘+’, ‘*’, or ‘?’")) + (error "Expected `+', `*', or `?'")) (let ((sym (intern (buffer-substring (point) (1+ (point)))))) (forward-char 1) (looking-at "[^\n\t ]*") @@ -650,7 +650,7 @@ (match-end 1))))))) (goto-char (match-end 0))) ((looking-at ":=[\n\t ]") - (error "Misplaced ‘:=’")) + (error "Misplaced `:='")) (t (looking-at "[^\n\t ]*") (let ((end (match-end 0))) @@ -673,7 +673,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 "Use `C-x * Z' to invoke this macro")) (defun calc-user-define-edit () (interactive) ; but no calc-wrapper! @@ -1899,7 +1899,7 @@ Redefine the corresponding command." `((and (,chk ,var) (math-reject-arg ,var ',qual))))) - (error "Unknown qualifier ‘%s’" qual-name)))))))) + (error "Unknown qualifier `%s'" qual-name)))))))) (defun math-do-arg-list-check (args is-opt is-rest) (cond ((null args) nil) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 4cf5b8c3a31..3d8c865c7bf 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -443,7 +443,7 @@ (calc-edit-mode (list 'calc-finish-stack-edit (list 'quote var)) t (format-message - "Editing variable ‘%s’" (calc-var-name var))) + "Editing variable `%s'" (calc-var-name var))) (and value (insert (math-format-nice-expr value (frame-width)) "\n"))))) (calc-show-edit-buffer)) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index d56c0b29c12..4373e52eb87 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -1625,10 +1625,10 @@ If COMP or STD is non-nil, put that in the units table instead." (format-message (concat "(**) When in TeX or LaTeX display mode, the TeX specific unit\n" - "names will not use the ‘tex’ prefix; the unit name for a\n" - "TeX point will be ‘pt’ instead of ‘texpt’, for example.\n" + "names will not use the `tex' prefix; the unit name for a\n" + "TeX point will be `pt' instead of `texpt', for example.\n" "To avoid conflicts, the unit names for pint and parsec will\n" - "be ‘pint’ and ‘parsec’ instead of ‘pt’ and ‘pc’.")))) + "be `pint' and `parsec' instead of `pt' and `pc'.")))) (view-mode) (message "Formatting units table...done")) (setq math-units-table-buffer-valid t) diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el index c7a3e716d61..cd157703f49 100644 --- a/lisp/calc/calc-vec.el +++ b/lisp/calc/calc-vec.el @@ -1618,13 +1618,13 @@ of two matrices is a matrix." (if (not (or (equal math-expr-data math-rb-close) (equal math-expr-data ")") (eq math-exp-token 'end))) - (throw 'syntax "Expected ‘]’"))) + (throw 'syntax "Expected `]'"))) (if (equal math-expr-data ";") (let ((math-exp-keep-spaces space-sep)) (setq vals (cons 'vec (math-read-matrix (list vals)))))) (if (not (or (equal math-expr-data math-rb-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected ‘]’"))) + (throw 'syntax "Expected `]'"))) (or (eq math-exp-token 'end) (math-read-token)) vals))) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index cce04705da8..5694a4e56ae 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -603,9 +603,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’") + (format-message "Press `C-c C-c'") (if allow-ret "" " or RET") - (format-message " to finish, ‘C-x k RET’ to cancel.\n\n")) + (format-message " to finish, `C-x k RET' to cancel.\n\n")) 'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t)) (make-local-variable 'calc-edit-top) (setq calc-edit-top (point)))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index ea20986bc85..b4b0ad8b185 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -989,11 +989,11 @@ Used by `calc-user-invocation'.") (defvar calc-last-kill nil "The last number killed in calc-mode.") (defvar calc-dollar-values nil - "Values to be used for ‘$’.") + "Values to be used for `$'.") (defvar calc-dollar-used nil - "The highest order of ‘$’ that occurred.") + "The highest order of `$' that occurred.") (defvar calc-hashes-used nil - "The highest order of ‘#’ that occurred.") + "The highest order of `#' that occurred.") (defvar calc-quick-prev-results nil "Previous results from Quick Calc.") (defvar calc-said-hello nil @@ -1474,7 +1474,7 @@ commands given here will actually operate on the *Calculator* stack." (and calc-display-trail (= (window-width) (frame-width)) (calc-trail-display 1 t))) - (message "Welcome to the GNU Emacs Calculator! Press ‘?’ or ‘h’ for help, ‘q’ to quit") + (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit") (run-hooks 'calc-start-hook) (and (windowp full-display) (window-point full-display) @@ -1622,7 +1622,7 @@ 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 "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 @@ -3856,7 +3856,7 @@ Also looks for the equivalent TeX words, \\gets and \\evalto." (defun calc-user-invocation () (interactive) (unless calc-invocation-macro - (error "Use ‘Z I’ inside Calc to define a ‘C-x * Z’ keyboard macro")) + (error "Use `Z I' inside Calc to define a `C-x * Z' keyboard macro")) (execute-kbd-macro calc-invocation-macro nil)) ;;; User-programmability. -- cgit v1.2.1 From 2667d5c7fbaa3de8103488c7e3779eb768f9d15c Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Tue, 15 Sep 2015 19:53:06 -0500 Subject: Add new functions for the root mean square of a (Calc) vector * lisp/calc/calc-stats.el (calcFunc-rms, calc-vector-rms): New functions. * lisp/calc/calc-ext.el (calc-init-extensions): Add keybinding for `calc-vector-rms', add autoloads for `calc-vector-rms' and `calcFunc-rms'. * lisp/calc/calc-map.el (calc-u-oper-keys): Add entry for `calcFunc-rms'. * lisp/calc/calc-menu.el (calc-vectors-menu): Add entry for `calc-vector-rms'. * doc/misc/calc.texi (Single-Variable Statistics): Document the rms command. --- lisp/calc/calc-ext.el | 7 ++++--- lisp/calc/calc-map.el | 1 + lisp/calc/calc-menu.el | 7 +++++++ lisp/calc/calc-stat.el | 11 +++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index cb6ab6f8ecc..27898fd9c97 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -574,6 +574,7 @@ (define-key calc-mode-map "uG" 'calc-vector-geometric-mean) (define-key calc-mode-map "uM" 'calc-vector-mean) (define-key calc-mode-map "uN" 'calc-vector-min) + (define-key calc-mode-map "uR" 'calc-vector-rms) (define-key calc-mode-map "uS" 'calc-vector-sdev) (define-key calc-mode-map "uU" 'calc-undo) (define-key calc-mode-map "uX" 'calc-vector-max) @@ -932,7 +933,7 @@ calc-preserve-point calc-replace-selections calc-replace-sub-formula calc-roll-down-with-selections calc-roll-up-with-selections calc-sel-error) - ("calc-stat" calc-vector-op calcFunc-agmean + ("calc-stat" calc-vector-op calcFunc-agmean calcFunc-rms calcFunc-vcorr calcFunc-vcount calcFunc-vcov calcFunc-vflat calcFunc-vgmean calcFunc-vhmean calcFunc-vmax calcFunc-vmean calcFunc-vmeane calcFunc-vmedian calcFunc-vmin calcFunc-vpcov @@ -1147,8 +1148,8 @@ calc-vector-covariance calc-vector-geometric-mean calc-vector-harmonic-mean calc-vector-max calc-vector-mean calc-vector-mean-error calc-vector-median calc-vector-min calc-vector-pop-covariance calc-vector-pop-sdev -calc-vector-pop-variance calc-vector-product calc-vector-sdev -calc-vector-sum calc-vector-variance) +calc-vector-pop-variance calc-vector-product calc-vector-rms +calc-vector-sdev calc-vector-sum calc-vector-variance) ("calc-store" calc-assign calc-copy-special-constant calc-copy-variable calc-declare-variable diff --git a/lisp/calc/calc-map.el b/lisp/calc/calc-map.el index 3b5949c274b..d2c9da86a6f 100644 --- a/lisp/calc/calc-map.el +++ b/lisp/calc/calc-map.el @@ -417,6 +417,7 @@ ( ?G 1 calcFunc-vgmean ) ( ?M 1 calcFunc-vmean ) ( ?N 1 calcFunc-vmin ) + ( ?R 1 calcFunc-rms ) ( ?S 1 calcFunc-vsdev ) ( ?X 1 calcFunc-vmax ) ) ( ( ?C 2 calcFunc-vpcov ) diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el index 44086872dd0..8610090c5d1 100644 --- a/lisp/calc/calc-menu.el +++ b/lisp/calc/calc-menu.el @@ -863,6 +863,13 @@ :keys "I u M" :active (>= (calc-stack-size) 1) :help "The average (arithmetic mean) of the data values as an error form"] + ["rms(1:)" + (progn + (require 'calc-stat) + (call-interactively 'calc-vector-rms)) + :keys "u R" + :active (>= (calc-stack-size) 1) + :help "The root mean square of the data values"] ["sdev(1:)" (progn (require 'calc-stat) diff --git a/lisp/calc/calc-stat.el b/lisp/calc/calc-stat.el index cf0b3ea4a12..a797db2e67d 100644 --- a/lisp/calc/calc-stat.el +++ b/lisp/calc/calc-stat.el @@ -71,6 +71,11 @@ (calc-vector-op "meae" 'calcFunc-vmeane arg) (calc-vector-op "mean" 'calcFunc-vmean arg))))) +(defun calc-vector-rms (arg) + (interactive "P") + (calc-slow-wrapper + (calc-vector-op "rms" 'calcFunc-rms arg))) + (defun calc-vector-mean-error (arg) (interactive "P") (calc-invert-func) @@ -318,6 +323,12 @@ suminvsqrwts)) (math-div (calcFunc-reduce '(var add var-add) means) len))))))) +(defun calcFunc-rms (a) + "Return the root-mean-square of the vector A." + (math-sqrt + (calcFunc-vmean + (calcFunc-map '(var abssqr var-abssqr) a)))) + (defun math-fix-int-intv (x) (if (math-floatp x) x -- cgit v1.2.1 From 284c470ef752967fcd8bae6a450dc138462b1e49 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 17 Sep 2015 16:08:20 -0700 Subject: Backslash cleanup in Elisp source files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch should not change behavior. It typically omits backslashes where they are redundant (e.g., in the string literal "^\$"). In a few places, insert backslashes where they make regular expressions clearer: e.g., replace "^\*" (equivalent to "^*") with "^\\*", which has the same effect as a regular expression. Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs, and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with RCS IDs, as that makes it clearer that the backslash is intended. --- lisp/calc/calc-help.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 444bb5ef920..33cb1c1566c 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -386,7 +386,7 @@ C-w Describe how there is no warranty for Calc." (interactive) (calc-quit) (view-emacs-news) - (re-search-forward "^\*+ .*\\" nil t)) + (re-search-forward "^\\*+ .*\\" nil t)) (defvar calc-help-long-names '((?b . "binary/business") (?g . "graphics") -- cgit v1.2.1 From fb875ee6ff20034944df04b83a147493db7ddeb3 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 17 Sep 2015 22:22:18 -0500 Subject: Fix the routine for help on Calc's prefixes. * lisp/calc/calc-ext.el (calc-prefix-help-retry): New variable. (calc-do-prefix-help): Use `read-char' to determine the next Calc command. --- lisp/calc/calc-ext.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 27898fd9c97..adbb20c82f8 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1293,6 +1293,7 @@ calc-kill calc-kill-region calc-yank)))) (define-key calc-help-map "?" 'calc-help-for-help) (define-key calc-help-map "\C-h" 'calc-help-for-help)) +(defvar calc-prefix-help-retry nil) (defvar calc-prefix-help-phase 0) (defun calc-do-prefix-help (msgs group key) (if calc-full-help-flag @@ -1300,7 +1301,7 @@ calc-kill calc-kill-region calc-yank)))) (if (cdr msgs) (progn (setq calc-prefix-help-phase - (if (eq this-command last-command) + (if calc-prefix-help-retry (% (1+ calc-prefix-help-phase) (1+ (length msgs))) 0)) (let ((msg (nth calc-prefix-help-phase msgs))) @@ -1321,7 +1322,13 @@ calc-kill calc-kill-region calc-yank)))) (message "%s: %s: %c-" group (car msgs) key) (message "%s: (none) %c-" group key)) (message "%s: %s" group (car msgs)))) - (and key (calc-unread-command key)))) + (let* ((chr (read-char)) + (keys (if key (string key chr) (string chr))) + (bnd (local-key-binding keys))) + (setq calc-prefix-help-retry (= chr ??)) + (if bnd + (call-interactively bnd) + (message (concat keys " is undefined")))))) ;;;; Commands. -- cgit v1.2.1 From 404f3aff4f709641b45e5bcd61f91f860426e0cf Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 19 Sep 2015 21:44:45 -0500 Subject: * lisp/calc/calc-ext.el (calc-do-prefix-help): Tidy up error message. --- lisp/calc/calc-ext.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index adbb20c82f8..83722e761b0 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1323,12 +1323,13 @@ calc-kill calc-kill-region calc-yank)))) (message "%s: (none) %c-" group key)) (message "%s: %s" group (car msgs)))) (let* ((chr (read-char)) - (keys (if key (string key chr) (string chr))) - (bnd (local-key-binding keys))) + (bnd (local-key-binding (if key (string key chr) (string chr))))) (setq calc-prefix-help-retry (= chr ??)) (if bnd (call-interactively bnd) - (message (concat keys " is undefined")))))) + (if key + (message (concat (key-description (vector key chr)) " is undefined")) + (message (concat (key-description (vector chr)) " is undefined"))))))) ;;;; Commands. -- cgit v1.2.1 From ab11a1cf27ebe3791df45cccde3c851affd184dd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 20 Sep 2015 09:40:35 -0700 Subject: Use %s to format strings instead of splicing them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If FOO might contain quotes that are part of a file or variable name, the quotes should not be translated when showing FOO’s name in a diagnostic. So, for example, (message (concat (FOO ": bar"))) is not quite right, as it would translate FOO’s quotes. Change it to (message "%s: bar" FOO) instead. * lisp/allout.el (allout-process-exposed): * lisp/calc/calc-ext.el (calc-do-prefix-help): * lisp/calc/calc-store.el (calc-store-into): * lisp/calendar/todo-mode.el (todo-category-completions): * lisp/cedet/semantic/complete.el (semantic-completion-message): * lisp/org/ob-latex.el (convert-pdf): * lisp/org/org-crypt.el (org-crypt-check-auto-save): * lisp/org/ox-latex.el (org-latex-compile): * lisp/org/ox-man.el (org-man-compile): * lisp/org/ox-odt.el (org-odt--export-wrap): * lisp/org/ox-texinfo.el (org-texinfo-compile): * lisp/progmodes/ruby-mode.el (ruby-in-ppss-context-p): * lisp/progmodes/verilog-mode.el (verilog-batch-execute-func) (verilog-signals-combine-bus, verilog-read-defines) (verilog-getopt-file, verilog-expand-dirnames) (verilog-modi-lookup, verilog-modi-modport-lookup-one): * lisp/term/ns-win.el (ns-spi-service-call): Use %s to avoid translating quotes of file names etc. in diagnostics. --- lisp/calc/calc-ext.el | 5 ++--- lisp/calc/calc-store.el | 12 ++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 83722e761b0..933c446875e 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1327,9 +1327,8 @@ calc-kill calc-kill-region calc-yank)))) (setq calc-prefix-help-retry (= chr ??)) (if bnd (call-interactively bnd) - (if key - (message (concat (key-description (vector key chr)) " is undefined")) - (message (concat (key-description (vector chr)) " is undefined"))))))) + (message "%s is undefined" + (key-description (if key (vector key chr) (vector chr)))))))) ;;;; Commands. diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 3d8c865c7bf..21209c66677 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -58,8 +58,8 @@ (let ((msg (calc-store-value var (or calc-given-value (calc-top 1)) "" calc-given-value-flag))) - (message (concat "Stored to variable \"%s\"" msg) - (calc-var-name var))))) + (message "Stored to variable \"%s\"%s" + (calc-var-name var) msg)))) (setq var (calc-is-assignments (calc-top 1))) (if var (while var @@ -67,8 +67,8 @@ (calc-store-value (car (car var)) (cdr (car var)) (if (not (cdr var)) "") (if (not (cdr var)) 1)))) - (message (concat "Stored to variable \"%s\"" msg) - (calc-var-name (car (car var))))) + (message "Stored to variable \"%s\"%s" + (calc-var-name (car (car var))) msg)) (setq var (cdr var)))))))) (defun calc-store-plus (&optional var) @@ -422,8 +422,8 @@ (calc-var-name var1))))) (if var2 (let ((msg (calc-store-value var2 value ""))) - (message (concat "Variable \"%s\" copied to \"%s\"" msg) - (calc-var-name var1) (calc-var-name var2)))))))) + (message "Variable \"%s\" copied to \"%s\"%s" + (calc-var-name var1) (calc-var-name var2) msg))))))) (defvar calc-last-edited-variable nil) (defun calc-edit-variable (&optional var) -- cgit v1.2.1 From 166a6556d0ec9926035aa2bce3dc0b0827b447ef Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 29 Sep 2015 01:39:14 +0300 Subject: ; Remove extraneous "coding: utf-8" specifications in Elisp files --- lisp/calc/calc-aent.el | 1 - lisp/calc/calc-ext.el | 4 ---- lisp/calc/calc-lang.el | 4 ---- lisp/calc/calc-store.el | 4 ---- lisp/calc/calc-units.el | 4 ---- lisp/calc/calc.el | 4 ---- lisp/calc/calccomp.el | 4 ---- 7 files changed, 25 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 2319c484498..6336c3362fb 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1266,7 +1266,6 @@ If the current Calc language does not use placeholders, return nil." (provide 'calc-aent) ;; Local variables: -;; coding: utf-8 ;; generated-autoload-file: "calc-loaddefs.el" ;; End: diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 933c446875e..9adf66f23bd 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -3507,8 +3507,4 @@ A key may contain additional specs for Inverse, Hyperbolic, and Inv+Hyp.") (provide 'calc-ext) -;; Local variables: -;; coding: utf-8 -;; End: - ;;; calc-ext.el ends here diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 6b3b949424d..94366060a41 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -2525,8 +2525,4 @@ order to Calc's." (provide 'calc-lang) -;; Local variables: -;; coding: utf-8 -;; End: - ;;; calc-lang.el ends here diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 21209c66677..2684e627883 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -677,8 +677,4 @@ (provide 'calc-store) -;; Local variables: -;; coding: utf-8 -;; End: - ;;; calc-store.el ends here diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 4373e52eb87..a450d8f82a9 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -2163,8 +2163,4 @@ If non-nil, return a list consisting of the note and the cents coefficient." (provide 'calc-units) -;; Local variables: -;; coding: utf-8 -;; End: - ;;; calc-units.el ends here diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index b4b0ad8b185..de7bfb8cbef 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -3918,8 +3918,4 @@ See Info node `(calc)Defining Functions'." (provide 'calc) -;; Local variables: -;; coding: utf-8 -;; End: - ;;; calc.el ends here diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index a3432c14b15..119f41993c3 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -1670,8 +1670,4 @@ (provide 'calccomp) -;; Local variables: -;; coding: utf-8 -;; End: - ;;; calccomp.el ends here -- cgit v1.2.1 From 2124b332a21c0baf918731aa23f44cd62177d073 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 8 Oct 2015 08:32:00 -0500 Subject: Format initial input uniformly. * lisp/calc/calc.el (calc-digit-start-entry): New function. * lisp/calc/calc.el (calcDigit-start): * lisp/calc/calc-aent.el (calc-alg-digit-entry): Use `calc-digit-start-entry' to format input. --- lisp/calc/calc-aent.el | 8 ++------ lisp/calc/calc.el | 12 ++++++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 6336c3362fb..f4754c73e7e 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -30,6 +30,7 @@ (require 'calc-macs) ;; Declare functions which are defined elsewhere. +(declare-function calc-digit-start-entry "calc" ()) (declare-function calc-refresh-evaltos "calc-ext" (&optional which-var)) (declare-function calc-execute-kbd-macro "calc-prog" (mac arg &rest prefix)) (declare-function math-is-true "calc-ext" (expr)) @@ -450,12 +451,7 @@ The value t means abort and give an error message.") ;;;###autoload (defun calc-alg-digit-entry () (calc-alg-entry - (cond ((eq last-command-event ?e) - (if (> calc-number-radix 14) (format "%d.^" calc-number-radix) "1e")) - ((eq last-command-event ?#) (format "%d#" calc-number-radix)) - ((eq last-command-event ?_) "-") - ((eq last-command-event ?@) "0@ ") - (t (char-to-string last-command-event))))) + (calc-digit-start-entry))) ;; The variable calc-digit-value is initially declared in calc.el, ;; but can be set by calcDigit-algebraic and calcDigit-edit. diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index de7bfb8cbef..105e1e443b4 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2309,6 +2309,14 @@ the United States." ;;;; Reading a number using the minibuffer. +(defun calc-digit-start-entry () + (cond ((eq last-command-event ?e) + (if (> calc-number-radix 14) (format "%d.^" calc-number-radix) "1e")) + ((eq last-command-event ?#) (format "%d#" calc-number-radix)) + ((eq last-command-event ?_) "-") + ((eq last-command-event ?@) "0@ ") + (t (char-to-string last-command-event))))) + (defvar calc-buffer) (defvar calc-prev-char) (defvar calc-prev-prev-char) @@ -2319,7 +2327,6 @@ the United States." (if (or calc-algebraic-mode (and (> calc-number-radix 14) (eq last-command-event ?e))) (calc-alg-digit-entry) - (calc-unread-command) (setq calc-aborted-prefix nil) (let* ((calc-digit-value nil) (calc-prev-char nil) @@ -2337,7 +2344,8 @@ the United States." (unwind-protect (progn (define-key global-map "\e" nil) - (read-from-minibuffer "Calc: " "" calc-digit-map)) + (read-from-minibuffer + "Calc: " (calc-digit-start-entry) calc-digit-map)) (define-key global-map "\e" old-esc)))))) (or calc-digit-value (setq calc-digit-value (math-read-number buf))) (if (stringp calc-digit-value) -- cgit v1.2.1 From 52fecf53e2756ddb765c5bea49edaae507671a1b Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 8 Oct 2015 08:38:45 -0500 Subject: * lisp/calc/calc.el (calc-digit-start-entry): Fix typo. --- lisp/calc/calc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 105e1e443b4..0709c619f3d 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2315,7 +2315,7 @@ the United States." ((eq last-command-event ?#) (format "%d#" calc-number-radix)) ((eq last-command-event ?_) "-") ((eq last-command-event ?@) "0@ ") - (t (char-to-string last-command-event))))) + (t (char-to-string last-command-event)))) (defvar calc-buffer) (defvar calc-prev-char) -- cgit v1.2.1 From 111cebc0c7b86c1ce3507a32e19de5a32a9d2225 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 8 Oct 2015 22:25:38 -0400 Subject: * lisp/calc/calc.el: Silence byte-compiler warnings (calc-scan-for-dels): Use ignore-errors. (calc-dispatch, calc-do-dispatch): Make unused arg optional. (calc-read-key-sequence): Remove unused var `prompt2'. (calc-kill-stack-buffer): Remove unused var `buflist'. (calc): Remove unused var `oldbuf'. (calc-refresh): Use inhibit-read-only. (calc-can-abbrev-vectors): Declare. (calc-record): Remove unused var `mainbuf'. (math-sub-bignum): Remove unused var `sum'. (math-svo-c, math-svo-wid, math-svo-off): Declare. --- lisp/calc/calc.el | 148 +++++++++++++++++++++++++++--------------------------- 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 0709c619f3d..e44226d8702 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1105,20 +1105,18 @@ Used by `calc-user-invocation'.") "The key map for entering Calc digits.") (mapc (lambda (x) - (condition-case err - (progn - (define-key calc-digit-map x 'calcDigit-backspace) - (define-key calc-mode-map x 'calc-pop) - (define-key calc-mode-map - (if (and (vectorp x) (featurep 'xemacs)) - (if (= (length x) 1) - (vector (if (consp (aref x 0)) - (cons 'meta (aref x 0)) - (list 'meta (aref x 0)))) - "\e\C-d") - (vconcat "\e" x)) - 'calc-pop-above)) - (error nil))) + (ignore-errors + (define-key calc-digit-map x 'calcDigit-backspace) + (define-key calc-mode-map x 'calc-pop) + (define-key calc-mode-map + (if (and (vectorp x) (featurep 'xemacs)) + (if (= (length x) 1) + (vector (if (consp (aref x 0)) + (cons 'meta (aref x 0)) + (list 'meta (aref x 0)))) + "\e\C-d") + (vconcat "\e" x)) + 'calc-pop-above))) (if calc-scan-for-dels (append (where-is-internal 'delete-backward-char global-map) (where-is-internal 'backward-delete-char global-map) @@ -1189,25 +1187,24 @@ Used by `calc-user-invocation'.") ;;;###autoload (define-key ctl-x-map "*" 'calc-dispatch) ;;;###autoload -(defun calc-dispatch (&optional arg) +(defun calc-dispatch (&optional _arg) "Invoke the GNU Emacs Calculator. See \\[calc-dispatch-help] for details." - (interactive "P") + (interactive) ; (sit-for echo-keystrokes) - (condition-case err ; look for other keys bound to calc-dispatch - (let ((keys (this-command-keys))) - (unless (or (not (stringp keys)) - (string-match "\\`\C-u\\|\\`\e[-0-9#]\\|`[\M--\M-0-\M-9]" keys) - (eq (lookup-key calc-dispatch-map keys) 'calc-same-interface)) - (when (and (string-match "\\`[\C-@-\C-_]" keys) - (symbolp - (lookup-key calc-dispatch-map (substring keys 0 1)))) - (define-key calc-dispatch-map (substring keys 0 1) nil)) - (define-key calc-dispatch-map keys 'calc-same-interface))) - (error nil)) - (calc-do-dispatch arg)) + (ignore-errors ; look for other keys bound to calc-dispatch + (let ((keys (this-command-keys))) + (unless (or (not (stringp keys)) + (string-match "\\`\C-u\\|\\`\e[-0-9#]\\|`[\M--\M-0-\M-9]" keys) + (eq (lookup-key calc-dispatch-map keys) 'calc-same-interface)) + (when (and (string-match "\\`[\C-@-\C-_]" keys) + (symbolp + (lookup-key calc-dispatch-map (substring keys 0 1)))) + (define-key calc-dispatch-map (substring keys 0 1) nil)) + (define-key calc-dispatch-map keys 'calc-same-interface)))) + (calc-do-dispatch)) (defvar calc-dispatch-help nil) -(defun calc-do-dispatch (arg) +(defun calc-do-dispatch (&optional _arg) "Start the Calculator." (let ((key (calc-read-key-sequence (if calc-dispatch-help @@ -1225,8 +1222,7 @@ Used by `calc-user-invocation'.") (defun calc-read-key-sequence (prompt map) "Read keys, with prompt PROMPT and keymap MAP." - (let ((prompt2 (format "%s " (key-description (this-command-keys)))) - (glob (current-global-map)) + (let ((glob (current-global-map)) (loc (current-local-map))) (or (input-pending-p) (message "%s" prompt)) (let ((key (calc-read-key t)) @@ -1254,7 +1250,6 @@ embedded information from the appropriate buffers and tidy up the trail buffer." (let ((cb (current-buffer)) (info-list nil) - (buflist) ; (plural nil) (cea calc-embedded-active)) ;; Get a list of all buffers using this buffer for @@ -1448,42 +1443,41 @@ commands given here will actually operate on the *Calculator* stack." (set-buffer (window-buffer))) (if (derived-mode-p 'calc-mode) (calc-quit) - (let ((oldbuf (current-buffer))) - (calc-create-buffer) - (setq calc-was-keypad-mode nil) - (if (or (eq full-display t) - (and (null full-display) calc-full-mode)) - (switch-to-buffer (current-buffer) t) - (if (get-buffer-window (current-buffer)) - (select-window (get-buffer-window (current-buffer))) - (if calc-window-hook - (run-hooks 'calc-window-hook) - (let ((w (get-largest-window))) - (if (and pop-up-windows - (> (window-height w) - (+ window-min-height calc-window-height 2))) - (progn - (setq w (split-window w - (- (window-height w) - calc-window-height 2) - nil)) - (set-window-buffer w (current-buffer)) - (select-window w)) - (pop-to-buffer (current-buffer))))))) - (with-current-buffer (calc-trail-buffer) - (and calc-display-trail - (= (window-width) (frame-width)) - (calc-trail-display 1 t))) - (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit") - (run-hooks 'calc-start-hook) - (and (windowp full-display) - (window-point full-display) - (select-window full-display)) - (calc-check-defines) - (when (and calc-said-hello interactive) - (sit-for 2) - (message "")) - (setq calc-said-hello t))))) + (calc-create-buffer) + (setq calc-was-keypad-mode nil) + (if (or (eq full-display t) + (and (null full-display) calc-full-mode)) + (switch-to-buffer (current-buffer) t) + (if (get-buffer-window (current-buffer)) + (select-window (get-buffer-window (current-buffer))) + (if calc-window-hook + (run-hooks 'calc-window-hook) + (let ((w (get-largest-window))) + (if (and pop-up-windows + (> (window-height w) + (+ window-min-height calc-window-height 2))) + (progn + (setq w (split-window w + (- (window-height w) + calc-window-height 2) + nil)) + (set-window-buffer w (current-buffer)) + (select-window w)) + (pop-to-buffer (current-buffer))))))) + (with-current-buffer (calc-trail-buffer) + (and calc-display-trail + (= (window-width) (frame-width)) + (calc-trail-display 1 t))) + (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit") + (run-hooks 'calc-start-hook) + (and (windowp full-display) + (window-point full-display) + (select-window full-display)) + (calc-check-defines) + (when (and calc-said-hello interactive) + (sit-for 2) + (message "")) + (setq calc-said-hello t)))) ;;;###autoload (defun full-calc (&optional interactive) @@ -1999,9 +1993,9 @@ See calc-keypad for details." (interactive) (and (derived-mode-p 'calc-mode) (not calc-executing-macro) - (let* ((buffer-read-only nil) + (let* ((inhibit-read-only t) (save-point (point)) - (save-mark (condition-case err (mark) (error nil))) + (save-mark (ignore-errors (mark))) (save-aligned (looking-at "\\.$")) (thing calc-stack) (calc-any-evaltos nil)) @@ -2102,11 +2096,12 @@ the United States." (setq calc-trail-pointer (point-marker)))) calc-trail-buffer) +(defvar calc-can-abbrev-vectors) + (defun calc-record (val &optional prefix) (setq calc-aborted-prefix nil) (or calc-executing-macro - (let* ((mainbuf (current-buffer)) - (buf (calc-trail-buffer)) + (let* ((buf (calc-trail-buffer)) (calc-display-raw nil) (calc-can-abbrev-vectors t) (fval (if val @@ -3052,7 +3047,7 @@ largest Emacs integer.") (defun math-sub-bignum (a b) ; [l l l] (if b (if a - (let* ((a (copy-sequence a)) (aa a) (borrow nil) sum diff) + (let* ((a (copy-sequence a)) (aa a) (borrow nil) diff) (while (and aa b) (if borrow (if (>= (setq diff (- (car aa) (car b))) 1) @@ -3206,7 +3201,8 @@ largest Emacs integer.") aa a) (while (progn (setcar ss (% (setq prod (+ (+ (car ss) (* (car aa) d)) - c)) math-bignum-digit-size)) + c)) + math-bignum-digit-size)) (setq aa (cdr aa))) (setq c (/ prod math-bignum-digit-size) ss (or (cdr ss) (setcdr ss (list 0))))) @@ -3441,6 +3437,10 @@ largest Emacs integer.") ;; to math-stack-value-offset, but are used by math-stack-value-offset-fancy ;; in calccomp.el. +(defvar math-svo-c) +(defvar math-svo-wid) +(defvar math-svo-off) + (defun math-stack-value-offset (math-svo-c) (let* ((num (if calc-line-numbering 4 0)) (math-svo-wid (calc-window-width)) -- cgit v1.2.1 From 5186c998574a8807713b9a43518fdeae52feac67 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 10 Oct 2015 17:21:44 -0500 Subject: Use events instead of chars to keep track of steps. * lisp/calc/calc-prog.el (calc-kbd-loop): Use events instead of chars to keep track of steps. --- lisp/calc/calc-prog.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 57af0d27822..c5a837d3260 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1287,37 +1287,37 @@ Redefine the corresponding command." (setq rpt-count (if rpt-count (prefix-numeric-value rpt-count) 1000000)) (let* ((count 0) (parts nil) - (body "") + (body (vector) ) (open last-command-event) (counter initial) ch) (or executing-kbd-macro (message "Reading loop body...")) (while (>= count 0) - (setq ch (read-char)) - (if (= ch -1) + (setq ch (read-event)) + (if (eq ch -1) (error "Unterminated Z%c in keyboard macro" open)) - (if (= ch ?Z) + (if (eq ch ?Z) (progn - (setq ch (read-char) - body (concat body "Z" (char-to-string ch))) + (setq ch (read-event) + body (vconcat body (vector ?Z ch) )) (cond ((memq ch '(?\< ?\( ?\{)) (setq count (1+ count))) ((memq ch '(?\> ?\) ?\})) (setq count (1- count))) ((and (= ch ?/) (= count 0)) - (setq parts (nconc parts (list (concat (substring body 0 -2) - "Z]"))) + (setq parts (nconc parts (list (vconcat (substring body 0 -2) + (vector ?Z ?\]) ))) body "")) ((eq ch 7) (keyboard-quit)))) - (setq body (concat body (char-to-string ch))))) + (setq body (vconcat body (vector ch))))) (if (/= ch (cdr (assq open '( (?\< . ?\>) (?\( . ?\)) (?\{ . ?\}) )))) (error "Mismatched Z%c and Z%c in keyboard macro" open ch)) (or executing-kbd-macro (message "Looping...")) - (setq body (concat (substring body 0 -2) "Z]")) + (setq body (vconcat (substring body 0 -2) (vector ?Z ?\]) )) (and (not executing-kbd-macro) (= rpt-count 1000000) (null parts) -- cgit v1.2.1 From ec0d4d24fd11b5040de9f7657b486c3b1e743071 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Sat, 10 Oct 2015 18:36:51 -0500 Subject: Allow numbers with different radixes to be yanked. * lisp/calc/calc-yank.el (calc-yank): Allow radixes besides the default base 10. --- lisp/calc/calc-prog.el | 4 +- lisp/calc/calc-yank.el | 106 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 93 insertions(+), 17 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index c5a837d3260..8d97bc69a2d 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1287,7 +1287,7 @@ Redefine the corresponding command." (setq rpt-count (if rpt-count (prefix-numeric-value rpt-count) 1000000)) (let* ((count 0) (parts nil) - (body (vector) ) + (body (vector)) (open last-command-event) (counter initial) ch) @@ -1300,7 +1300,7 @@ Redefine the corresponding command." (if (eq ch ?Z) (progn (setq ch (read-event) - body (vconcat body (vector ?Z ch) )) + body (vconcat body (vector ?Z ch))) (cond ((memq ch '(?\< ?\( ?\{)) (setq count (1+ count))) ((memq ch '(?\> ?\) ?\})) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 5694a4e56ae..c93b64b6436 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -111,25 +111,101 @@ ;; otherwise it just parses the yanked string. ;; Modified to use Emacs 19 extended concept of kill-ring. -- daveg 12/15/96 ;;;###autoload -(defun calc-yank () - (interactive) +(defun calc-yank (radix) + "Yank a value into the Calculator buffer. + +Valid numeric prefixes for RADIX: 0, 2, 6, 8 +No radix notation is prepended for any other numeric prefix. + +If RADIX is 2, prepend \"2#\" - Binary. +If RADIX is 8, prepend \"8#\" - Octal. +If RADIX is 0, prepend \"10#\" - Decimal. +If RADIX is 6, prepend \"16#\" - Hexadecimal. + +If RADIX is a non-nil list (created using \\[universal-argument]), the user +will be prompted to enter the radix in the minibuffer. + +If RADIX is nil or if the yanked string already has a calc radix prefix, the +yanked string will be passed on directly to the Calculator buffer without any +alteration." + (interactive "P") (calc-wrapper (calc-pop-push-record-list 0 "yank" - (let ((thing (if (fboundp 'current-kill) - (current-kill 0 t) - (car kill-ring-yank-pointer)))) + (let* (radix-num + radix-notation + valid-num-regexp + (thing-raw + (if (fboundp 'current-kill) + (current-kill 0 t) + (car kill-ring-yank-pointer))) + (thing + (if (or (null radix) + ;; Match examples: -2#10, 10\n(10#10,01) + (string-match-p "^[-(]*[0-9]\\{1,2\\}#" thing-raw)) + thing-raw + (progn + (if (listp radix) + (progn + (setq radix-num + (read-number + "Set radix for yanked content (2-36): ")) + (when (not (and (integerp radix-num) + (<= 2 radix-num) + (>= 36 radix-num))) + (error (concat "The radix has to be an " + "integer between 2 and 36.")))) + (setq radix-num + (cond ((eq radix 2) 2) + ((eq radix 8) 8) + ((eq radix 0) 10) + ((eq radix 6) 16) + (t (message + (concat "No radix prepended " + "for invalid *numeric* " + "prefix %0d.") + radix) + nil)))) + (if radix-num + (progn + (setq radix-notation + (concat (number-to-string radix-num) "#")) + (setq valid-num-regexp + (cond + ;; radix 2 to 10 + ((and (<= 2 radix-num) + (>= 10 radix-num)) + (concat "[0-" + (number-to-string (1- radix-num)) + "]+")) + ;; radix 11 + ((= 11 radix-num) "[0-9aA]+") + ;; radix 12+ + (t + (concat "[0-9" + "a-" (format "%c" (+ (- ?a 11) radix-num)) + "A-" (format "%c" (+ (- ?A 11) radix-num)) + "]+")))) + ;; Ensure that the radix-notation is prefixed + ;; correctly even for multi-line yanks like below, + ;; 111 + ;; 1111 + (replace-regexp-in-string + valid-num-regexp + (concat radix-notation "\\&") + thing-raw)) + thing-raw))))) (if (eq (car-safe calc-last-kill) thing) - (cdr calc-last-kill) - (if (stringp thing) - (let ((val (math-read-exprs (calc-clean-newlines thing)))) - (if (eq (car-safe val) 'error) - (progn - (setq val (math-read-exprs thing)) - (if (eq (car-safe val) 'error) - (error "Bad format in yanked data") - val)) - val)))))))) + (cdr calc-last-kill) + (if (stringp thing) + (let ((val (math-read-exprs (calc-clean-newlines thing)))) + (if (eq (car-safe val) 'error) + (progn + (setq val (math-read-exprs thing)) + (if (eq (car-safe val) 'error) + (error "Bad format in yanked data") + val)) + val)))))))) ;;; The Calc set- and get-register commands are modified versions of functions ;;; in register.el -- cgit v1.2.1 From 54e3734a322aca9d396e4c7b0e73f08ac6c12501 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 10 Oct 2015 22:08:33 -0500 Subject: Document the optional prefix to `calc-yank'. * doc/misc/calc.texi (Yanking into the Stack): Document the optional prefix to `calc-yank'. * lisp/calc/calc-yank.el (calc-yank): Ensure that things killed from the Calc buffer are yanked back unchanged. --- lisp/calc/calc-yank.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index c93b64b6436..cd447500ffe 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -195,7 +195,7 @@ alteration." (concat radix-notation "\\&") thing-raw)) thing-raw))))) - (if (eq (car-safe calc-last-kill) thing) + (if (eq (car-safe calc-last-kill) thing-raw) (cdr calc-last-kill) (if (stringp thing) (let ((val (math-read-exprs (calc-clean-newlines thing)))) -- cgit v1.2.1 From 732d259948833935c343ed88b08316253e12b306 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sun, 11 Oct 2015 15:35:18 -0500 Subject: Have calc-yank recognize numbers in different bases. * lisp/calc/calc-yank.el (math-number-regexp): New function. (calc-yank): Use `math-number-regexp' to recognize numbers. --- lisp/calc/calc-yank.el | 56 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 15 deletions(-) (limited to 'lisp/calc') diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index cd447500ffe..5105ba9366c 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -107,6 +107,46 @@ (interactive "r") (calc-kill-region top bot t)) +(defun math-number-regexp (radix-num) + "Return a regexp which will match a Calc number base RADIX-NUM." + (let* ((digit-range + (cond + ;; radix 2 to 10 + ((and (<= 2 radix-num) + (>= 10 radix-num)) + (concat "[0-" + (number-to-string (1- radix-num)) + "]")) + ;; radix 11 + ((= 11 radix-num) "[0-9aA]") + ;; radix 12+ + (t + (concat "[0-9" + "a-" (format "%c" (+ (- ?a 11) radix-num)) + "A-" (format "%c" (+ (- ?A 11) radix-num)) + "]")))) + (integer-regexp (concat digit-range "+")) + (decimal-regexp (concat digit-range "+\\." digit-range "*"))) + (concat + " *\\(" + ;; "e" notation + "[-_+]?" decimal-regexp "[eE][-+]?[0-9]+" + "\\|" + "[-_+]?" integer-regexp "[eE][-+]?[0-9]+" + "\\|" + ;; Integer+fractions + "[-_+]?" integer-regexp "*[:/]" integer-regexp "[:/]" integer-regexp + "\\|" + ;; Fractions + "[-_+]?" integer-regexp "[:/]" integer-regexp + "\\|" + ;; Decimal point + "[-_+]?" decimal-regexp + "\\|" + ;; Integers + "[-_+]?" integer-regexp + "\\) *\\(\n\\|\\'\\)"))) + ;; This function uses calc-last-kill if possible to get an exact result, ;; otherwise it just parses the yanked string. ;; Modified to use Emacs 19 extended concept of kill-ring. -- daveg 12/15/96 @@ -171,21 +211,7 @@ alteration." (setq radix-notation (concat (number-to-string radix-num) "#")) (setq valid-num-regexp - (cond - ;; radix 2 to 10 - ((and (<= 2 radix-num) - (>= 10 radix-num)) - (concat "[0-" - (number-to-string (1- radix-num)) - "]+")) - ;; radix 11 - ((= 11 radix-num) "[0-9aA]+") - ;; radix 12+ - (t - (concat "[0-9" - "a-" (format "%c" (+ (- ?a 11) radix-num)) - "A-" (format "%c" (+ (- ?A 11) radix-num)) - "]+")))) + (math-number-regexp radix-num)) ;; Ensure that the radix-notation is prefixed ;; correctly even for multi-line yanks like below, ;; 111 -- cgit v1.2.1