diff options
| author | era eriksson | 2013-11-20 00:52:15 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-11-20 00:52:15 -0800 |
| commit | 0ec16636be13e2209cddf6917d81a2ab00e44c5d (patch) | |
| tree | 8b6800875ada4d8f863532029ce7b72214ebd581 | |
| parent | dc7e8c171ff999fcfe7e4b86e91296eb8abc9c49 (diff) | |
| download | emacs-0ec16636be13e2209cddf6917d81a2ab00e44c5d.tar.gz emacs-0ec16636be13e2209cddf6917d81a2ab00e44c5d.zip | |
* doc/misc/ses.texi (Quick Tutorial): New chapter.
(The Basics, Formulas): Copyedits.
(Resizing, Printer functions): Add index entries.
Fixes: debbugs:14748
| -rw-r--r-- | doc/misc/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/misc/ses.texi | 106 |
2 files changed, 111 insertions, 1 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 6ea80e4be8d..f2254f912da 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-11-20 era eriksson <era+emacsbugs@iki.fi> | ||
| 2 | |||
| 3 | * ses.texi (Quick Tutorial): New chapter. (Bug#14748) | ||
| 4 | (The Basics, Formulas): Copyedits. | ||
| 5 | (Resizing, Printer functions): Add index entries. | ||
| 6 | |||
| 1 | 2013-11-17 Jay Belanger <jay.p.belanger@gmail.com> | 7 | 2013-11-17 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 8 | ||
| 3 | * calc.texi (Customizing Calc): Mention new variable | 9 | * calc.texi (Customizing Calc): Mention new variable |
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi index a44d790781d..8ac023b8135 100644 --- a/doc/misc/ses.texi +++ b/doc/misc/ses.texi | |||
| @@ -66,6 +66,7 @@ To report bugs, use @kbd{M-x report-emacs-bug}. | |||
| 66 | 66 | ||
| 67 | @menu | 67 | @menu |
| 68 | * Sales Pitch:: Why use @acronym{SES}? | 68 | * Sales Pitch:: Why use @acronym{SES}? |
| 69 | * Quick Tutorial:: A quick introduction | ||
| 69 | * The Basics:: Basic spreadsheet commands | 70 | * The Basics:: Basic spreadsheet commands |
| 70 | * Advanced Features:: Want to know more? | 71 | * Advanced Features:: Want to know more? |
| 71 | * For Gurus:: Want to know @emph{even more}? | 72 | * For Gurus:: Want to know @emph{even more}? |
| @@ -98,6 +99,95 @@ To report bugs, use @kbd{M-x report-emacs-bug}. | |||
| 98 | 99 | ||
| 99 | @c =================================================================== | 100 | @c =================================================================== |
| 100 | 101 | ||
| 102 | @node Quick Tutorial | ||
| 103 | @chapter Quick Tutorial | ||
| 104 | @cindex introduction | ||
| 105 | @cindex tutorial | ||
| 106 | |||
| 107 | If you want to get started quickly and think that you know what to | ||
| 108 | expect from a simple spreadsheet, this chapter may be all that you | ||
| 109 | need. | ||
| 110 | |||
| 111 | First, visit a new file with the @file{.ses} extension. | ||
| 112 | Emacs presents you with an empty spreadsheet containing a single cell. | ||
| 113 | |||
| 114 | Begin by inserting a headline: @kbd{"Income"@key{RET}}. The double | ||
| 115 | quotes indicate that this is a text cell. (Notice that Emacs | ||
| 116 | automatically inserts the closing quotation mark.) | ||
| 117 | |||
| 118 | To insert your first income value, you must first resize the | ||
| 119 | spreadsheet. Press @key{TAB} to add a new cell and navigate back up | ||
| 120 | to it. Enter a number, such as @samp{2.23}. Then proceed to add a | ||
| 121 | few more income entries, e.g.: | ||
| 122 | |||
| 123 | @example | ||
| 124 | @group | ||
| 125 | A | ||
| 126 | Income | ||
| 127 | 2.23 | ||
| 128 | 0.02 | ||
| 129 | 15.76 | ||
| 130 | -4.00 | ||
| 131 | @end group | ||
| 132 | @end example | ||
| 133 | |||
| 134 | To add up the values, enter a Lisp expression: | ||
| 135 | |||
| 136 | @example | ||
| 137 | (+ A2 A3 A4 A5) | ||
| 138 | @end example | ||
| 139 | |||
| 140 | Perhaps you want to add a cell to the right of cell A4 to explain | ||
| 141 | why you have a negative entry. Pressing @kbd{TAB} in that cell | ||
| 142 | adds an entire new column @samp{B}, where you can add such a note. | ||
| 143 | |||
| 144 | The column is fairly narrow by default, but pressing @kbd{w} allows | ||
| 145 | you to resize it as needed. Make it 20 characters wide. You can | ||
| 146 | now add descriptive legends for all the entries, e.g.: | ||
| 147 | |||
| 148 | @example | ||
| 149 | @group | ||
| 150 | A B | ||
| 151 | Income | ||
| 152 | 2.23 Consulting fee | ||
| 153 | 0.02 Informed opinion | ||
| 154 | 15.76 Lemonade stand | ||
| 155 | -4 Loan to Joe | ||
| 156 | 14.01 Total | ||
| 157 | @end group | ||
| 158 | @end example | ||
| 159 | |||
| 160 | By default, the labels in column B are right-justified. To change | ||
| 161 | that, you can enter a printer function for the whole column, using | ||
| 162 | e.g., @kbd{M-p ("%s")}. You can override a column's printer function | ||
| 163 | in any individual cell using @kbd{p}. | ||
| 164 | |||
| 165 | If Joe pays back his loan, you might blank that entry; e.g., by | ||
| 166 | positioning the cursor in cell A5 and pressing @kbd{C-d} twice. | ||
| 167 | If you do that, the total cell will display @samp{######}. That is | ||
| 168 | because the regular @code{+} operator does not handle a range that | ||
| 169 | contains some empty cells. Instead of emptying the cell, you could | ||
| 170 | enter a literal @samp{0}, or delete the entire row using @kbd{C-k}. | ||
| 171 | An alternative is to use the special function @code{ses+} instead of | ||
| 172 | the regular @code{+}: | ||
| 173 | |||
| 174 | @example | ||
| 175 | (ses+ A2 A3 A4 A5) | ||
| 176 | @end example | ||
| 177 | |||
| 178 | To make a formula robust against changes in the spreadsheet geometry, | ||
| 179 | you can use the @code{ses-range} macro to refer to a range of cells by | ||
| 180 | the end-points, e.g.: | ||
| 181 | |||
| 182 | @example | ||
| 183 | (apply 'ses+ (ses-range A2 A5)) | ||
| 184 | @end example | ||
| 185 | |||
| 186 | (The @code{apply} is necessary because @code{ses-range} produces a | ||
| 187 | @emph{list} of values. This allows for more complex possibilities.) | ||
| 188 | |||
| 189 | @c =================================================================== | ||
| 190 | |||
| 101 | @node The Basics | 191 | @node The Basics |
| 102 | @comment node-name, next, previous, up | 192 | @comment node-name, next, previous, up |
| 103 | @chapter The Basics | 193 | @chapter The Basics |
| @@ -117,6 +207,7 @@ A @dfn{cell identifier} is a symbol with a column letter and a row | |||
| 117 | number. Cell B7 is the 2nd column of the 7th row. For very wide | 207 | number. Cell B7 is the 2nd column of the 7th row. For very wide |
| 118 | spreadsheets, there are two column letters: cell AB7 is the 28th | 208 | spreadsheets, there are two column letters: cell AB7 is the 28th |
| 119 | column of the 7th row. Super wide spreadsheets get AAA1, etc. | 209 | column of the 7th row. Super wide spreadsheets get AAA1, etc. |
| 210 | You move around with the regular Emacs movement commands. | ||
| 120 | 211 | ||
| 121 | @table @kbd | 212 | @table @kbd |
| 122 | @item j | 213 | @item j |
| @@ -161,13 +252,17 @@ Highlight all cells (@code{mark-whole-buffer}). | |||
| 161 | @section Cell formulas | 252 | @section Cell formulas |
| 162 | @cindex formulas | 253 | @cindex formulas |
| 163 | @cindex formulas, entering | 254 | @cindex formulas, entering |
| 255 | @cindex values | ||
| 256 | @cindex cell values | ||
| 257 | @cindex editing cells | ||
| 164 | @findex ses-read-cell | 258 | @findex ses-read-cell |
| 165 | @findex ses-read-symbol | 259 | @findex ses-read-symbol |
| 166 | @findex ses-edit-cell | 260 | @findex ses-edit-cell |
| 167 | @findex ses-recalculate-cell | 261 | @findex ses-recalculate-cell |
| 168 | @findex ses-recalculate-all | 262 | @findex ses-recalculate-all |
| 169 | 263 | ||
| 170 | To enter a number into the current cell, just start typing: | 264 | To insert a value into a cell, simply type a numeric expression, |
| 265 | @samp{"double-quoted text"}, or a Lisp expression. | ||
| 171 | 266 | ||
| 172 | @table @kbd | 267 | @table @kbd |
| 173 | @item 0..9 | 268 | @item 0..9 |
| @@ -213,6 +308,13 @@ Recalculate the entire spreadsheet (@code{ses-recalculate-all}). | |||
| 213 | @node Resizing | 308 | @node Resizing |
| 214 | @section Resizing the spreadsheet | 309 | @section Resizing the spreadsheet |
| 215 | @cindex resizing spreadsheets | 310 | @cindex resizing spreadsheets |
| 311 | @cindex dimensions | ||
| 312 | @cindex row, adding or removing | ||
| 313 | @cindex column, adding or removing | ||
| 314 | @cindex adding rows or columns | ||
| 315 | @cindex inserting rows or columns | ||
| 316 | @cindex removing rows or columns | ||
| 317 | @cindex deleting rows or columns | ||
| 216 | @findex ses-insert-row | 318 | @findex ses-insert-row |
| 217 | @findex ses-insert-column | 319 | @findex ses-insert-column |
| 218 | @findex ses-delete-row | 320 | @findex ses-delete-row |
| @@ -269,6 +371,8 @@ Undo previous action (@code{(undo)}). | |||
| 269 | @node Printer functions | 371 | @node Printer functions |
| 270 | @section Printer functions | 372 | @section Printer functions |
| 271 | @cindex printer functions | 373 | @cindex printer functions |
| 374 | @cindex cell formatting | ||
| 375 | @cindex formatting cells | ||
| 272 | @findex ses-read-cell-printer | 376 | @findex ses-read-cell-printer |
| 273 | @findex ses-read-column-printer | 377 | @findex ses-read-column-printer |
| 274 | @findex ses-read-default-printer | 378 | @findex ses-read-default-printer |