From: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
To: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: SES local variables to define printers
Date: Sat, 25 May 2013 22:43:14 +0200 [thread overview]
Message-ID: <80vc666ba5.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]
Stefan Monnier a écrit :
> Hi Vincent,
>
> Could you show us an example of what used to work, as well as an example
> of what you'd ideally want to see working (in case it's different)?
>
>
> Stefan
>
Here is an example "example.ses", if you open it with the current SES it
will generate an error "Invalid printer" while it used to work --- don't
remember with which version, but that sort of thing was working one year
or so ago.
If you take my patch (attached as ses.el.gz) and configure
ses-enable-local-variables you will have desired printing.
The thing is that I often use Calc object in cells --- and this is even
the very reason why I use SES --- the downside of that is that I need to
configure suitable printing functions for those Calc objects --- this is
all the more true that some time I happen not to have the same float
format for all the cells.
Another use case is that in some cell I have to be confirmed values
(some guess which I need to reconfirm...) and I want some printing with
some mark that this cell needs to be consolidated.
In the attached example I use two local printers checked-time and
tbc-time: cells B2 -- B4 use checked-time, while cells B5 & B6 use
tbc-time. check-time does some fancy printing for Calc HMS forms, and
tbc-time add some extra "?? " prefix on top of that. So I get this
display:
-----Task------ -----Time------
gardening 1h 3m 0s
cooking 0h 45m 3.1s
sleeping 7h 35m 6s
bird watching ?? 0h 20m 0s
*Total* ?? 9h 43m 9.1s
BR,
Vincent.
[-- Attachment #2: example.ses --]
[-- Type: text/plain, Size: 1364 bytes --]
-----Task------ -----Time------
gardening 1h 3m 0s
cooking 0h 45m 3.1s
sleeping 7h 35m 6s
bird watching ?? 0h 20m 0s
*Total* ?? 9h 43m 9.1s
\f
(ses-cell A1 "Task" "Task" ses-dashfill nil)
(ses-cell B1 "Time" "Time" ses-dashfill nil)
(ses-cell A2 "gardening" "gardening" nil nil)
(ses-cell B2 (hms 1 3 0) (quote (hms 1 3 0)) checked-time (B6))
(ses-cell A3 "cooking" "cooking" nil nil)
(ses-cell B3 (hms 0 45 (float 312 -2)) (quote (hms 0 45 (float 312 -2))) checked-time (B6))
(ses-cell A4 "sleeping" "sleeping" nil nil)
(ses-cell B4 (hms 7 35 6) (quote (hms 7 35 6)) checked-time (B6))
(ses-cell A5 "bird watching" "bird watching" nil nil)
(ses-cell B5 (hms 0 20 0) (quote (hms 0 20 0)) tbc-time (B6))
(ses-cell A6 "*Total*" "*Total*" nil nil)
(ses-cell B6 (hms 9 43 (float 912 -2)) (calcFunc-add B2 B3 B4 B5) tbc-time nil)
(ses-column-widths [15 15])
(ses-column-printers [nil nil])
(ses-default-printer "%.7g")
(ses-header-row 0)
( ;Global parameters (these are read first)
2 ;SES file-format
6 ;numrows
2 ;numcols
)
;; Local Variables:
;; mode: ses
;; checked-time: (lambda (x) (let ((calc-float-format '(fix 1)) (calc-hms-format "%sh %sm %ss")) (math-format-value x)))
;; tbc-time: (lambda (x) (let ((calc-float-format '(fix 1))(calc-hms-format "?? %sh %sm %ss")) (math-format-value x)))
;; End:
[-- Attachment #3: ses.el.gz --]
[-- Type: application/octet-stream, Size: 37599 bytes --]
next reply other threads:[~2013-05-25 20:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-25 20:43 Vincent Belaïche [this message]
2013-05-26 1:17 ` SES local variables to define printers Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2013-05-30 15:36 Vincent Belaïche
2013-05-30 17:15 ` Stefan Monnier
2013-05-30 7:24 Vincent Belaïche
2013-05-30 5:50 Vincent Belaïche
2013-05-30 13:20 ` Stefan Monnier
2013-05-28 4:38 Vincent Belaïche
2013-05-28 4:57 ` Stefan Monnier
2013-05-26 20:25 Vincent Belaïche
2013-05-27 1:35 ` Stefan Monnier
2013-05-26 7:16 Vincent Belaïche
2013-05-26 18:02 ` Stefan Monnier
2013-05-24 5:53 Vincent Belaïche
2013-05-24 5:46 Vincent Belaïche
2013-05-24 5:45 Vincent Belaïche
2013-05-24 13:28 ` Stefan Monnier
2013-05-23 20:52 Vincent Belaïche
2013-05-23 21:35 ` Davis Herring
2013-05-24 1:06 ` Glenn Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80vc666ba5.fsf@gmail.com \
--to=vincent.b.1@hotmail.fr \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.