copy-region-as-kill can be called passing nil as `beg' and
`end'. Magit does that, which caused an error when this advice was in
effect.
* lisp/ses.el (ses--advice-copy-region-as-kill): avoid comparison
unless `beg' and `end' are non-nil.
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November. Change these FTP URLs to https://ftp.gnu.org
instead. Make similar changes for URLs to other organizations moving
away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
* lisp/ses.el (ses-replace-name-in-formula): Fix bug for it to
work also with one symbol formulas.
* test/lisp/ses-tests.el
(ses-tests-renaming-cell-with-one-symbol-formula): Add new
test for renaming with relocating a one symbol formula.
* doc/misc/ses.texi (Configuring what printer function
applies): Add description of keys for completing local printer
symbols and listing local printers in a help buffer.
(Formulas): Add decription for key to list the named cell
symbols in a help buffer.
* lisp/ses.el (ses-completion-keys): New constant.
(ses--completion-table): New defvar.
(ses--list-orig-buffer): New defvar.
(ses-mode-edit-map): Fixed for symbol completion, plus add
help functions to list named cells or local printers.
(ses-edit-cell-complete-symbol)
(ses--edit-cell-completion-at-point-function): New defuns for
completion during formula edition.
(ses-edit-cell): Redefine dynamically edit keymap for
completion keys to point at the right function.
(ses-read-printer-complete-symbol)
(ses--read-printer-completion-at-point-function): New defuns
for completion during printer edition.
(ses-read-printer): Redefine dynamically edit keymap for
completion keys to point at the right function.
(ses-list-local-printers): New defun.
(ses-list-named-cells): New defun.
* lisp/ses.el (ses-relocate-all): In case of insertion, do not
relocate value for named cells as they keep the same symbol.
(ses-rename-cell): Set new cell name symbol to cell value --- do not
rely on recalculating. Push cells with updated data --- cell name,
cell reference list, or cell formula --- to deferred write list.
* test/lisp/ses-tests.el: New file, with 7 tests for SES.
* lisp/ses.el (ses-sym-rowcol): Check that the renamed cell
hashmap has been instantiated before getting data from it. When
editing several spreadsheets, and you have spreadsheet #1 with a
cell named `foo', and no renamed cell in spreadsheet #2, then if
you make a formula with `foo' in spreadsheet #2, not doing this
check will make an error.
(ses-cell-set-formula): Robustify versus incorrect cell references
given in the user provided formula. An explicit error message is
provided after the action when the user gives an incorrect cell
reference, but the formula edition is not changed. This means that
if the incorrect reference is to a cell that is created someday,
then this new cell will not have the edited cell in its reference
list. Fixing this can still be done by editing again the first
cell formula.
(ses-relocate-symbol): Do not create symbol of referred-to cell
when this is a renamed cell.
* lisp/ses.el (ses-recalculate-cell): Add optional argument
ses--curcell to avoid overwriting ses--curcell when function is
called from ses-recalculate-all. Update docstring accordingly.
(ses-recalculate-all): Call ses-recalculate-cell with argument
ses--curcell to avoid its overwriting.
* doc/misc/ses.texi (Quick Tutorial): Minor clarification about the
ses-range `!' modifier.
(More on cell printing): Fix this that the fallback printer is
`ses-prin1', not "%S". That makes a difference for any cell value for
which "%S" would insert a backslash characters.
* lisp/ses.el (ses-local-printer-compile): Handle the nil cell value
--- contrary to emacs-25 branches ses-call-printer does not handle
prior to calling a function printer. Not doing this would still work
because the compiled function would throw and error and SES would in
the end resort to the ses-prin1 fallback, however this way would not
be in line with the raison d'être of compiling printer which is speed.
Here follows the logs from the two commits which I apply to master.
commit 3c97b0f758
Author: Vincent Belaïche <vincentb1@users.sourceforge.net>
Date: Fri Jul 29 13:44:14 2016 +0200
Fix ses-delete-blanks to delete only blanks + documentation.
* doc/misc/ses.texi (Quick Tutorial): Mention the '!'
'ses-range' modifier as an alternative to 'ses+'.
(Advanced Features): Add a refernce to node 'Nonrelocatable
references' concerning function 'ses-rename-cell'.
(Standard formula functions): Mention the '!' 'ses-range'
modifier as an alternative to 'ses-delete-blanks'.
(More on cell printing): Fix fallback printer
definition. Minor editorial formatting changes.
(Nonrelocatable references): Document the use of
'ses-rename-cell' as a better way to make cell reference
non-relocatable.
(The data area): Document the presence of local printer
definitions in the data area.
* lisp/ses.el (ses-delete-blanks): Do not remove
*error*. Any error in an argument should propagate into the
using formula rather than being silently hidden !
commit 8a38e948b0
Author: Vincent Belaïche <vincentb1@users.sourceforge.net>
Date: Thu Jul 28 19:49:37 2016 +0200
Fix local printer set to left aligned string formatter.
* lisp/ses.el (ses-local-printer-compile): Add missing case
for left-aligned string formatter.
* doc/misc/ses.texi (Quick Tutorial): Mention the '!'
'ses-range' modifier as an alternative to 'ses+'.
(Advanced Features): Add a refernce to node 'Nonrelocatable
references' concerning function 'ses-rename-cell'.
(Standard formula functions): Mention the '!' 'ses-range'
modifier as an alternative to 'ses-delete-blanks'.
(More on cell printing): Fix fallback printer
definition. Minor editorial formatting changes.
(Nonrelocatable references): Document the use of
'ses-rename-cell' as a better way to make cell reference
non-relocatable.
(The data area): Document the presence of local printer
definitions in the data area.
* lisp/ses.el (ses-delete-blanks): Do not remove
*error*. Any error in an argument should propagate into the
using formula rather than being silently hidden !
* doc/misc/ses.texi (Printer functions): Split the node into 5
sub-nodes + add some extra documentation.
(Various kinds of printer functions): Make an itemisation to
disintguish better the 3 types of printers, give an example of
lambda printer definition.
(Standard printer functions): Add documentation for ses-prin1
printer function.
(Local printer functions): Add documentation for creating
local printers programmatically from a hook.
(Writing a lambda printer function): Add documentation about
anti-stackoverflow precautions to take when you call the
standard printer functions from inside a local printer.
* lisp/ses.el (ses-standard-printer-functions): Add ses-prin1
among standard printer function, and update docstring
accordingly.
(ses-call-printer, ses-export-tab): Call `ses-prin1' instead
of prin1-to-string.
(ses-define-local-printer): Add definition to arguments so
that a local printer can be defined programmatically from a
mode hook. Make docstring more substantial. Use completing
read for local printer name input. Plus some minor
optimization.
(ses-define-if-new-local-printer): New defsubst.
(ses-center, ses-center-span, ses-dashfill)
(ses-dashfill-span, ses-tildefill-span): Allow to pass printer
as an optional argument to superseed column printer/default
spreadsheet printer.
(ses-prin1): New defun.
Bug is to unbind old cell names when renaming a cell with
'makunbound'. when the old cell name is of A1 type, then
'kill-local-variable' must be used instead, so that only the current
spreadsheet is affected. When the old cell name is a renamed cell,
then 'ses--unbind-cell-name' must be used in order to remove the old
name from the name hashmap.
* ses.el (ses-rename-cell): check consistency of cell symbol from
text-property and from array object. Instead of 'makunbound', use
either 'ses--unbind-cell-name' or 'kill-local-variable' depending on
whether the cell old name is a named cell or an A1 type cell
ee73997 Make erc work better when encountering unknown prefix chars
b99141d Make erc completion case-insensitive again
66c4620 Make complection in erc use consistent casing
8c562b2 Make /QUIT in erc more robust
d93d2c5 Make tracking faces in Emacs work more reliably
af6ab7e Make shr not bug out on images on non-graphical displays
3311f40 Fix bookmark display widths
d90ab1e Fix typo in eww-make-unique-file-name
7f81825 Make it possible to TAB to input fields
a43a1dc Insert complete alt texts when images are disabled
56ed4e1 Allow eww text fields to grow
66b315c Make erc work when subword-mode is switched on
255b68f Fix IMAP doc example
91557f5 Quoting fixes in doc strings and diagnostics
2c0dc9f Fix warning message in hack-local-variables
504696d Etags: yet another improvement in Ruby tags
8784ebf Fix x-popup-menu on TTYs without a mouse
8b87ecb * lisp/emacs-lisp/map.el: Improvements to the docstring of the
pcase macro
6191003 Use pop-to-buffer-same-window in eww
fe321fd * autogen.sh: Revert all recent changes.
74ebd4a * make-dist: Updates related to nt/.
737193a * make-dist: Add modules/.
3696bf2 * make-dist: Update for super-special file that can't live in etc/.
a4278e2 Fix failure to compile ns-win.el in parallel builds
860da4d Fix names of tags generated for Ruby accessors
f6213ce Fix file-name recognition in 'etags'
e42e662 Change Ruby file names and extensions recognized by 'etags'
58bfb6a More improvements for Ruby support in 'etags'
c04e911 Add --git-config option to autogen.sh
5713466 Fix editing undo changes in eww fields
51362d6 Allow the user more control of popping up the eww window
ee0fbd8 Make eww-browse-url with new-window parameter work again
9c3142d Clean up eww code slightly
cb035f3 Don't insert nil faces in shr
4c3fae3 ; * lisp/progmodes/prolog.el: Remove some obsolete commentary.
93f2153 Improve the custom type of some user options.
9f60d7e Mark some risky calendar variables.
1d07dcd Highlight two additional SCSS keywords
ee8b466 Recommend enabling integrity-checking in git
e639e10 Some corrections in Elisp manual
d766ca8 Chatter when autogen.sh changes Git configuration
3b734e1 * org/org-compat.el (org-font-lock-ensure): Fix bogus test (bug#22399)
43cb9f8 Omit unnecessary history from Lisp intro
2fbd1da * etc/HISTORY: Add some more history, plus git tags.
c90e1b4 Improve elisp “Security Considerations” doc
cedd7ca autogen.sh now arranges for git to check hashes
86ce76b ; Fix ChangeLog.2 commit ID.
7b1d2b1 Fix (c & 040) typo in emergency escapes
a8273da Fix display of overlay strings with 'display' and 'box' property
fc48106 Fix imap-starttls-open
cdecbed Fix return value of imap-starttls-open
20c7e34 ; * etc/NEWS: Fix renamed command name
98bdbdb Correct reference to DARWIN_OS preprocessor symbol
b250d29 Spelling fix
b920a0e Spelling fixes
93b144b Pacify GCC on C library without glibc API
This is the same change as commit on master branch. See
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=badcd38aa86ed7973f2be2743c405710973a0bdd
* lisp/ses.el (ses-localvars): rename variable
`ses--renamed-cell-symb-list' into `ses--in-killing-named-cell-list'
and adjust the comment about it.
(ses-plist-delq): new defun.
(ses--ses-buffer-list): new defvar.
(ses--unbind-cell-name): new defun.
(ses-relocate-symbol): Do not relocate symbol when it is a named cell.
(ses-relocate-formula): Undo change of
2011-12-27T19:30:39Z!vincentb1@users.sourceforge.net that was
preventing relocation for named cell --- now doing this is delegated
to function `ses-relocate-symbol'.
(ses-relocate-range): In docstring, undo change of
2016-01-03T07:31:52Z!johnw@newartisans.com, `ses-range' must remain
lower case as it is not a variable.
(ses-relocate-all): Cell name relocation : 1) check that cell is a
renamed cell by testing `ses-cell' property to :ses-named, rather than
comparing name to corresponding standard name. Set rowcol of renamed
cell into the hashmap --- `ses-cell' property must not be used for
that as the same name can be used for different locations in different
SES sheets ; 2) use `local-variable-if-set-p' rather than `boundp' and
`local-variable-p' to check if cell name is already in use in this
sheet or needs initialisation.
(ses-relocate-all): Cell value relocation : 1) like for name
relocation use the `ses-cell' property rather than comparing actual
name to corresponding standard name. 2) Correct bug introduced in
2011-12-27T19:30:39Z!vincentb1@users.sourceforge.net, as the test was
made the other way round than the intention --- ie value relocation
was disabled for standard cell, not for renamed cell as was the
intention.
(ses-relocate-all): Add loop for unbinding deleted renamed cells
names.
(ses-killbuffer-hook): new defun.
(ses-mode): Add the ses--ses-buffer-list maintenance mechanism ---
kill buffer hook, plus pushing current buffer if new in list.
(ses-delete-row, ses-delete-column): Collect deleted renamed cells
into `ses--in-killing-named-cell-list'.
(ses-rename-cell): Remove update of variable
`ses--renamed-cell-symb-list', this variable is renamed to
`ses--in-killing-named-cell-list', and its setting is done in
functions `ses-delete-row' and , `ses-delete-column' now.
(ses-rename-cell): Make cell new name a buffer local variable.
(ses-rename-cell): Change correction of
2015-12-30T23:10:37Z!vincentb1@users.sourceforge.net concerning
computation of the range over which `cursor-intangible' property was
to be updated. This correction was ok for non spilling cells, but not
for cells spilling over following blank cells. Simply use
`next-single-property-change' rather than computing the end column
from column widths.
* lisp/ses.el (ses-localvars): rename variable
`ses--renamed-cell-symb-list' into `ses--in-killing-named-cell-list'
and adjust the comment about it.
(ses-plist-delq): new defun.
(ses--ses-buffer-list): new defvar.
(ses--unbind-cell-name): new defun.
(ses-relocate-symbol): Do not relocate symbol when it is a named cell.
(ses-relocate-formula): Undo change of
2011-12-27T19:30:39Z!vincentb1@users.sourceforge.net that was
preventing relocation for named cell --- now doing this is delegated
to function `ses-relocate-symbol'.
(ses-relocate-range): In docstring, undo change of
2016-01-03T07:31:52Z!johnw@newartisans.com, `ses-range' must remain
lower case as it is not a variable.
(ses-relocate-all): Cell name relocation : 1) check that cell is a
renamed cell by testing `ses-cell' property to :ses-named, rather than
comparing name to corresponding standard name. Set rowcol of renamed
cell into the hashmap --- `ses-cell' property must not be used for
that as the same name can be used for different locations in different
SES sheets ; 2) use `local-variable-if-set-p' rather than `boundp' and
`local-variable-p' to check if cell name is already in use in this
sheet or needs initialisation.
(ses-relocate-all): Cell value relocation : 1) like for name
relocation use the `ses-cell' property rather than comparing actual
name to corresponding standard name. 2) Correct bug introduced in
2011-12-27T19:30:39Z!vincentb1@users.sourceforge.net, as the test was
made the other way round than the intention --- ie value relocation
was disabled for standard cell, not for renamed cell as was the
intention.
(ses-relocate-all): Add loop for unbinding deleted renamed cells
names.
(ses-killbuffer-hook): new defun.
(ses-mode): Add the ses--ses-buffer-list maintenance mechanism ---
kill buffer hook, plus pushing current buffer if new in list.
(ses-delete-row, ses-delete-column): Collect deleted renamed cells
into `ses--in-killing-named-cell-list'.
(ses-rename-cell): Remove update of variable
`ses--renamed-cell-symb-list', this variable is renamed to
`ses--in-killing-named-cell-list', and its setting is done in
functions `ses-delete-row' and , `ses-delete-column' now.
(ses-rename-cell): Change correction of
2015-12-30T23:10:37Z!vincentb1@users.sourceforge.net concerning
computation of the range over which `cursor-intangible' property was
to be updated. This correction was ok for non spilling cells, but not
for cells spilling over following blank cells. Simply use
`next-single-property-change' rather than computing the end column
from column widths.
* lisp/ses.el (ses-check-curcell): Suppress ``temporary fix'' comment,
and useless `(if t ...)' in order to align textually on fix done for
emacs-25 branch for bug#21054.
There were two problems:
- First ses-rename-cell has to work when called non interactively
(with non-nil CELL argument), so in this case the start pos of
put-text-property cannot be plainly (point), you need a
ses-goto-print call before
- Second, the range itself was computed erronously, only the first
char was affected instead of the full cell width. This was not
noticeable prior to changes (Deprecate `intangible' and
`point-entered' properties) made by Stefan on 2015-04-13T19:51:15Z
* lisp/ses.el (ses-rename-cell): Correct computation of position range
to which the 'cursor-intangible text property has to be set to cell
new name.
When using a lambda expression printer function the user should be
free to format differently a really empty cell, ie. containing nil,
from a cell containing an empty string "".
* ses.el (ses-call-printer): Replace `(or value "")' by just `value'
in the case of a lambda expression printer function.
* ses.texi (Printer functions): Add example and description about
lambda expression printer function handling all the possible values,
including unexpected ones.