From: John Wiegley Date: Sun, 3 Jan 2016 07:31:52 +0000 (-0800) Subject: Merge branch 'emacs-25-merge' X-Git-Tag: emacs-26.0.90~2827^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=91917dd58ec5278e555b9c693a830749083e8f89;p=emacs.git Merge branch 'emacs-25-merge' --- 91917dd58ec5278e555b9c693a830749083e8f89 diff --cc doc/misc/ses.texi index 4cb4188f690,9b2a457a710..fe6d5ab5422 --- a/doc/misc/ses.texi +++ b/doc/misc/ses.texi @@@ -435,44 -436,14 +436,44 @@@ Centering with dashes and spill-over Centering with tildes (~) and spill-over. @end table - You can define printer function local to a sheet with command - @code{ses-define-local-printer}. For instance define printer - @samp{foo} to @code{"%.2f"} and then use symbol @samp{foo} as a - printer function. Then, if you call again + You can define printer function local to a sheet with the command + @code{ses-define-local-printer}. For instance, define a printer + @samp{foo} to @code{"%.2f"}, and then use symbol @samp{foo} as a + printer function. Then, if you call again @code{ses-define-local-printer} on @samp{foo} to redefine it as - @code{"%.3f"} all the cells using printer @samp{foo} will be reprinted - accordingly. + @code{"%.3f"}, all the cells using printer @samp{foo} will be + reprinted accordingly. +When you define a printer function with a lambda expression taking one +argument, please take care that the returned value is a string, or a +list containing a string, even when the input argument has an +unexpected value. Here is an example: + +@example +(lambda (val) + (cond + ((null val) "") + ((and (numberp val) (>= val 0)) (format "%.1f" val)) + (t (ses-center-span (format "%S" val) ?#)))) +@end example + +This example will: +@itemize +@item +When the cell is empty (ie.@: when @code{val} is @code{nil}), print an +empty string @code{""} +@item +When the cell value is a non negative number, format the the value in +fixed-point notation with one decimal after point +@item +Otherwise, handle the value as erroneous by printing it as an +s-expression (using @code{prin1}), centered and surrounded by @code{#} +filling. +@end itemize + + + + @node Clearing cells @section Clearing cells @cindex clearing commands diff --cc lisp/ldefs-boot.el index b870d81727d,3d1f6d28898..f0c65fa032b --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@@ -32369,38 -32382,31 +32390,31 @@@ Zone out, completely ;;;;;; "gnus/nntp.el" "gnus/nnvirtual.el" "gnus/nnweb.el" "gnus/registry.el" ;;;;;; "gnus/rfc1843.el" "gnus/rfc2045.el" "gnus/rfc2047.el" "gnus/rfc2231.el" ;;;;;; "gnus/rtree.el" "gnus/sieve-manage.el" "gnus/smime.el" "gnus/spam-stat.el" - ;;;;;; "gnus/spam-wash.el" "hex-util.el" "hfy-cmap.el" "htmlfontify-loaddefs.el" - ;;;;;; "ibuf-ext.el" "ibuffer-loaddefs.el" "international/charscript.el" - ;;;;;; "international/fontset.el" "international/iso-ascii.el" "international/ja-dic-cnv.el" - ;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "international/uni-bidi.el" - ;;;;;; "international/uni-brackets.el" "international/uni-category.el" - ;;;;;; "international/uni-combining.el" "international/uni-comment.el" - ;;;;;; "international/uni-decimal.el" "international/uni-decomposition.el" - ;;;;;; "international/uni-digit.el" "international/uni-lowercase.el" - ;;;;;; "international/uni-mirrored.el" "international/uni-name.el" - ;;;;;; "international/uni-numeric.el" "international/uni-old-name.el" - ;;;;;; "international/uni-titlecase.el" "international/uni-uppercase.el" - ;;;;;; "kermit.el" "language/hanja-util.el" "language/thai-word.el" - ;;;;;; "ldefs-boot.el" "leim/quail/arabic.el" "leim/quail/croatian.el" - ;;;;;; "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" "leim/quail/czech.el" - ;;;;;; "leim/quail/ethiopic.el" "leim/quail/georgian.el" "leim/quail/greek.el" - ;;;;;; "leim/quail/hanja-jis.el" "leim/quail/hanja.el" "leim/quail/hanja3.el" - ;;;;;; "leim/quail/hebrew.el" "leim/quail/indian.el" "leim/quail/ipa-praat.el" - ;;;;;; "leim/quail/ipa.el" "leim/quail/japanese.el" "leim/quail/lao.el" - ;;;;;; "leim/quail/latin-alt.el" "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" - ;;;;;; "leim/quail/latin-pre.el" "leim/quail/lrt.el" "leim/quail/persian.el" - ;;;;;; "leim/quail/py-punct.el" "leim/quail/pypunct-b5.el" "leim/quail/rfc1345.el" - ;;;;;; "leim/quail/sgml-input.el" "leim/quail/sisheng.el" "leim/quail/slovak.el" - ;;;;;; "leim/quail/symbol-ksc.el" "leim/quail/thai.el" "leim/quail/tibetan.el" + ;;;;;; "gnus/spam-wash.el" "hex-util.el" "hfy-cmap.el" "ibuf-ext.el" + ;;;;;; "international/charscript.el" "international/fontset.el" + ;;;;;; "international/iso-ascii.el" "international/ja-dic-cnv.el" + ;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "kermit.el" + ;;;;;; "language/hanja-util.el" "language/thai-word.el" "ldefs-boot.el" + ;;;;;; "leim/quail/arabic.el" "leim/quail/croatian.el" "leim/quail/cyril-jis.el" + ;;;;;; "leim/quail/cyrillic.el" "leim/quail/czech.el" "leim/quail/ethiopic.el" + ;;;;;; "leim/quail/georgian.el" "leim/quail/greek.el" "leim/quail/hanja-jis.el" + ;;;;;; "leim/quail/hanja.el" "leim/quail/hanja3.el" "leim/quail/hebrew.el" + ;;;;;; "leim/quail/indian.el" "leim/quail/ipa-praat.el" "leim/quail/ipa.el" + ;;;;;; "leim/quail/japanese.el" "leim/quail/lao.el" "leim/quail/latin-alt.el" + ;;;;;; "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" "leim/quail/latin-pre.el" + ;;;;;; "leim/quail/lrt.el" "leim/quail/persian.el" "leim/quail/py-punct.el" + ;;;;;; "leim/quail/pypunct-b5.el" "leim/quail/rfc1345.el" "leim/quail/sgml-input.el" + ;;;;;; "leim/quail/sisheng.el" "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" + ;;;;;; "leim/quail/tamil-dvorak.el" "leim/quail/thai.el" "leim/quail/tibetan.el" ;;;;;; "leim/quail/viqr.el" "leim/quail/vntelex.el" "leim/quail/vnvni.el" ;;;;;; "leim/quail/welsh.el" "loadup.el" "mail/blessmail.el" "mail/mailheader.el" -;;;;;; "mail/mspools.el" "mail/rfc2368.el" "mail/rfc822.el" "mail/rmail-spam-filter.el" -;;;;;; "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el" -;;;;;; "mail/rmailmsc.el" "mail/rmailsort.el" "mail/rmailsum.el" -;;;;;; "mail/undigest.el" "mh-e/mh-acros.el" "mh-e/mh-alias.el" -;;;;;; "mh-e/mh-buffers.el" "mh-e/mh-compat.el" "mh-e/mh-funcs.el" -;;;;;; "mh-e/mh-gnus.el" "mh-e/mh-identity.el" "mh-e/mh-inc.el" -;;;;;; "mh-e/mh-junk.el" "mh-e/mh-letter.el" "mh-e/mh-limit.el" +;;;;;; "mail/mspools.el" "mail/rfc2368.el" "mail/rfc822.el" "mail/rmail-loaddefs.el" +;;;;;; "mail/rmail-spam-filter.el" "mail/rmailedit.el" "mail/rmailkwd.el" +;;;;;; "mail/rmailmm.el" "mail/rmailmsc.el" "mail/rmailsort.el" +;;;;;; "mail/rmailsum.el" "mail/undigest.el" "mh-e/mh-acros.el" +;;;;;; "mh-e/mh-alias.el" "mh-e/mh-buffers.el" "mh-e/mh-compat.el" +;;;;;; "mh-e/mh-funcs.el" "mh-e/mh-gnus.el" "mh-e/mh-identity.el" +;;;;;; "mh-e/mh-inc.el" "mh-e/mh-junk.el" "mh-e/mh-letter.el" "mh-e/mh-limit.el" ;;;;;; "mh-e/mh-loaddefs.el" "mh-e/mh-mime.el" "mh-e/mh-print.el" ;;;;;; "mh-e/mh-scan.el" "mh-e/mh-search.el" "mh-e/mh-seq.el" "mh-e/mh-show.el" ;;;;;; "mh-e/mh-speed.el" "mh-e/mh-thread.el" "mh-e/mh-tool-bar.el" diff --cc lisp/ses.el index ee2bcd54b00,d15483f4783..86b0ae672ac --- a/lisp/ses.el +++ b/lisp/ses.el @@@ -1114,10 -1114,12 +1114,10 @@@ region, or nil if cursor is not at a ce (defun ses-check-curcell (&rest args) "Signal an error if `ses--curcell' is inappropriate. - The end marker is appropriate if some argument is 'end. - A range is appropriate if some argument is 'range. - A single cell is appropriate unless some argument is 'needrange." + The end marker is appropriate if some argument is `end'. + A range is appropriate if some argument is `range'. + A single cell is appropriate unless some argument is `needrange'." - (if (eq ses--curcell t) - ;; curcell recalculation was postponed, but user typed ahead. - (ses-set-curcell)) + (ses-set-curcell); fix bug#21054 (cond ((not ses--curcell) (or (memq 'end args)