diff options
| author | John Wiegley | 2016-08-02 11:43:07 -0700 |
|---|---|---|
| committer | John Wiegley | 2016-08-02 11:43:07 -0700 |
| commit | cd1b4d60ceeb74852954824fd9ba0f6c21ca9c94 (patch) | |
| tree | 0280f90d49dd52884ad414f6f5c14582bc90a9ca | |
| parent | f7ceb8e028923287a75b148a49c65d3232f68ace (diff) | |
| download | emacs-cd1b4d60ceeb74852954824fd9ba0f6c21ca9c94.tar.gz emacs-cd1b4d60ceeb74852954824fd9ba0f6c21ca9c94.zip | |
Revert "Fix ses-delete-blanks to delete only blanks + documentation."
This reverts commit 3c97b0f7589e06aeb1ab0147f0ee32974c32926d.
| -rw-r--r-- | doc/misc/ses.texi | 54 | ||||
| -rw-r--r-- | lisp/ses.el | 3 |
2 files changed, 13 insertions, 44 deletions
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi index e443dfb6cbe..58f9ba8ccf3 100644 --- a/doc/misc/ses.texi +++ b/doc/misc/ses.texi | |||
| @@ -187,14 +187,6 @@ the end-points, e.g.: | |||
| 187 | (The @code{apply} is necessary because @code{ses-range} produces a | 187 | (The @code{apply} is necessary because @code{ses-range} produces a |
| 188 | @emph{list} of values. This allows for more complex possibilities.) | 188 | @emph{list} of values. This allows for more complex possibilities.) |
| 189 | 189 | ||
| 190 | Alternatively you can use the @code{!} modifier of @code{ses-range} to | ||
| 191 | remove blank cells which allows to use @code{+} instead of | ||
| 192 | @code{ses+}: | ||
| 193 | |||
| 194 | @lisp | ||
| 195 | (apply '+ (ses-range A2 A5 !)) | ||
| 196 | @end lisp | ||
| 197 | |||
| 198 | @c =================================================================== | 190 | @c =================================================================== |
| 199 | 191 | ||
| 200 | @node The Basics | 192 | @node The Basics |
| @@ -603,8 +595,8 @@ Pops up a menu to set the current row as the header, or revert to | |||
| 603 | column letters. | 595 | column letters. |
| 604 | @item M-x ses-rename-cell | 596 | @item M-x ses-rename-cell |
| 605 | @findex ses-rename-cell | 597 | @findex ses-rename-cell |
| 606 | Rename a cell from a standard A1-like name to any string that can be a | 598 | Rename a cell from a standard A1-like name to any |
| 607 | valid local variable name (See also @ref{Nonrelocatable references}). | 599 | string. |
| 608 | @item M-x ses-repair-cell-reference-all | 600 | @item M-x ses-repair-cell-reference-all |
| 609 | @findex ses-repair-cell-reference-all | 601 | @findex ses-repair-cell-reference-all |
| 610 | When you interrupt a cell formula update by clicking @kbd{C-g}, then | 602 | When you interrupt a cell formula update by clicking @kbd{C-g}, then |
| @@ -799,17 +791,8 @@ are some useful functions to call from your formulas: | |||
| 799 | 791 | ||
| 800 | @table @code | 792 | @table @code |
| 801 | @item (ses-delete-blanks &rest @var{args}) | 793 | @item (ses-delete-blanks &rest @var{args}) |
| 802 | Returns a list from which all blank cells (value is either @code{nil} | 794 | Returns a list from which all blank cells (value is either @code{nil} or |
| 803 | or '*skip*) have been deleted. Order of args is reverted. Please note | 795 | '*skip*) have been deleted. |
| 804 | that @code{ses-range} has a @code{!} modifier that allows to remove | ||
| 805 | blanks, so it is possible to write: | ||
| 806 | @lisp | ||
| 807 | (ses-range A1 A5 !) | ||
| 808 | @end lisp | ||
| 809 | instead of | ||
| 810 | @lisp | ||
| 811 | (apply 'ses-delete-blanks (ses-range A1 A5 <)) | ||
| 812 | @end lisp | ||
| 813 | 796 | ||
| 814 | @item (ses+ &rest @var{args}) | 797 | @item (ses+ &rest @var{args}) |
| 815 | Sum of non-blank arguments. | 798 | Sum of non-blank arguments. |
| @@ -859,9 +842,9 @@ this to undo the effect of @kbd{t}. | |||
| 859 | @end table | 842 | @end table |
| 860 | 843 | ||
| 861 | When a printer function signals an error, the fallback printer | 844 | When a printer function signals an error, the fallback printer |
| 862 | @samp{"%S"} is substituted. This is useful when your column printer | 845 | @samp{"%s"} is substituted. This is useful when your column printer |
| 863 | is numeric-only and you use a string as a cell value. Note that the | 846 | is numeric-only and you use a string as a cell value. Note that the |
| 864 | standard default printer is @samp{"%.7g"} which is numeric-only, so cells | 847 | standard default printer is ``%.7g'' which is numeric-only, so cells |
| 865 | that are empty of contain strings will use the fallback printer. | 848 | that are empty of contain strings will use the fallback printer. |
| 866 | @kbd{c} on such cells will display ``Format specifier doesn't match | 849 | @kbd{c} on such cells will display ``Format specifier doesn't match |
| 867 | argument type''. | 850 | argument type''. |
| @@ -1003,18 +986,7 @@ can type ahead without worrying about the glitch. | |||
| 1003 | @kbd{C-u C-y} relocates none of the cell-references. What about mixed | 986 | @kbd{C-u C-y} relocates none of the cell-references. What about mixed |
| 1004 | cases? | 987 | cases? |
| 1005 | 988 | ||
| 1006 | The best way is to rename cells that you do not want to be relocatable | 989 | You can use |
| 1007 | by using @code{ses-rename-cell}. | ||
| 1008 | @findex ses-rename-cell | ||
| 1009 | Cells that do not have an A1-like name style are not relocated on | ||
| 1010 | yank. Using this method, the concerned cells won't be relocated | ||
| 1011 | whatever formula they appear in. Please note however that when a | ||
| 1012 | formula contains some range @code{(ses-range @var{cell1} @var{cell2})} | ||
| 1013 | then in the yanked formula each range bound @var{cell1} and | ||
| 1014 | @var{cell2} are relocated, or not, indepently, depending on whether | ||
| 1015 | they are A1-like or renamed. | ||
| 1016 | |||
| 1017 | An alternative method is to use | ||
| 1018 | @lisp | 990 | @lisp |
| 1019 | (symbol-value 'B3) | 991 | (symbol-value 'B3) |
| 1020 | @end lisp | 992 | @end lisp |
| @@ -1022,8 +994,7 @@ to make an @dfn{absolute reference}. The formula relocator skips over | |||
| 1022 | quoted things, so this will not be relocated when pasted or when | 994 | quoted things, so this will not be relocated when pasted or when |
| 1023 | rows/columns are inserted/deleted. However, B3 will not be recorded | 995 | rows/columns are inserted/deleted. However, B3 will not be recorded |
| 1024 | as a dependency of this cell, so this cell will not be updated | 996 | as a dependency of this cell, so this cell will not be updated |
| 1025 | automatically when B3 is changed, this is why using | 997 | automatically when B3 is changed. |
| 1026 | @code{ses-rename-cell} is most of the time preferable. | ||
| 1027 | 998 | ||
| 1028 | The variables @code{row} and @code{col} are dynamically bound while a | 999 | The variables @code{row} and @code{col} are dynamically bound while a |
| 1029 | cell formula is being evaluated. You can use | 1000 | cell formula is being evaluated. You can use |
| @@ -1040,13 +1011,12 @@ kind of dependency is also not recorded. | |||
| 1040 | @findex ses-reconstruct-all | 1011 | @findex ses-reconstruct-all |
| 1041 | 1012 | ||
| 1042 | Begins with an 014 character, followed by sets of cell-definition | 1013 | Begins with an 014 character, followed by sets of cell-definition |
| 1043 | macros for each row, followed by the set of local printer | 1014 | macros for each row, followed by column-widths, column-printers, |
| 1044 | defintitions, followed by column-widths, column-printers, | ||
| 1045 | default-printer, and header-row. Then there's the global parameters | 1015 | default-printer, and header-row. Then there's the global parameters |
| 1046 | (file-format ID, row count, column count, local printer count) and the | 1016 | (file-format ID, numrows, numcols) and the local variables (specifying |
| 1047 | local variables (specifying @acronym{SES} mode for the buffer, etc.). | 1017 | @acronym{SES} mode for the buffer, etc.). |
| 1048 | 1018 | ||
| 1049 | When a @acronym{SES} file is loaded, first the global parameters are | 1019 | When a @acronym{SES} file is loaded, first the numrows and numcols values are |
| 1050 | loaded, then the entire data area is @code{eval}ed, and finally the local | 1020 | loaded, then the entire data area is @code{eval}ed, and finally the local |
| 1051 | variables are processed. | 1021 | variables are processed. |
| 1052 | 1022 | ||
diff --git a/lisp/ses.el b/lisp/ses.el index b379ef1f9c6..0b38af41a8b 100644 --- a/lisp/ses.el +++ b/lisp/ses.el | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | |||
| 2 | ;;; ses.el -- Simple Emacs Spreadsheet -*- lexical-binding:t -*- | 1 | ;;; ses.el -- Simple Emacs Spreadsheet -*- lexical-binding:t -*- |
| 3 | 2 | ||
| 4 | ;; Copyright (C) 2002-2016 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2002-2016 Free Software Foundation, Inc. |
| @@ -3747,7 +3746,7 @@ Use `math-format-value' as a printer for Calc objects." | |||
| 3747 | "Return ARGS reversed, with the blank elements (nil and *skip*) removed." | 3746 | "Return ARGS reversed, with the blank elements (nil and *skip*) removed." |
| 3748 | (let (result) | 3747 | (let (result) |
| 3749 | (dolist (cur args) | 3748 | (dolist (cur args) |
| 3750 | (unless (memq cur '(nil *skip*)) | 3749 | (unless (memq cur '(nil *skip* *error*)) |
| 3751 | (push cur result))) | 3750 | (push cur result))) |
| 3752 | result)) | 3751 | result)) |
| 3753 | 3752 | ||