all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: vincent.belaiche@gmail.com (Vincent Belaïche)
To: Stefan Monnier <monnier@iro.umontreal.ca> , emacs-devel@gnu.org
Cc: "Vincent Belaïche" <vincent.belaiche@gmail.com>
Subject: RE: SES local variables to define printers
Date: Sun, 26 May 2013 09:16:48 +0200	[thread overview]
Message-ID: <80a9nixlb3.fsf@gmail.com> (raw)



> From: monnier@iro.umontreal.ca
> To: vincent.b.1@hotmail.fr
> CC: emacs-devel@gnu.org
> Subject: Re: SES local variables to define printers
> Date: Sat, 25 May 2013 21:17:10 -0400
> 
> > 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.
> 
> It doesn't work with any of Debian's Emacs-24.1, Emacs-23.4, or
> Emacs-22.3. It must have been something different.
> 

Well, since that was 1 year ago or so that I was using this sheet I may
have done some hack at that time... sorry for the bold assertion that
this *WAS wORKING*, I must admit that I am not so sure now.

Now, having thought a bit more about it, I think that in most sheets I
have the local variables my-tbc-time and my-checked-time defined as
local variables, and the printer function defined as e.g. (lambda (x)
(funcall my-tbc-time x)) rather than just my-tbc-time. 

I don't know why in the faulty one-year-old-sheet it was done with just
my-tbc-time for the printer. Probably I had the symbol-function slot
also defined somewhere else --- like in my *scratch* --- to the same
function and that was hiding that defining locally the function in the
value slot was not working.

> > If you take my patch (attached as ses.el.gz) and configure
> > ses-enable-local-variables you will have desired printing.
> 
> How 'bout:
> 
> You add to your .emacs
> 
> (defun my-checked-time (x)
> (let ((calc-float-format '(fix 1)) (calc-hms-format "%sh %sm %ss"))
> (math-format-value x)))
> (defun my-tbc-time (x)
> (let ((calc-float-format '(fix 1))(calc-hms-format "?? %sh %sm %ss"))
> (math-format-value x)))
> 
> and then you can use those printer functions in your ses files.
> 
> It's simple and safe, and it works without any changes.
> 
> 

Well, it also means that your .emacs will grow endlessly as you create
new sheets, and also that you cannot archive the sheet+printer in the
same batch easily. Definitely I would not buy this one.

Maybe another way would be to use ede mode, and to  have the printer
functions defined in some prj.el file. I must admit that I am not an
experienced user of ede, I use it only inderectly through JDEE and I am
not well aware of how ede ensures security.

Anyway there could be some safe macro ses-printer-def placed in the EDE
prj.el file to define needed printer functions, and ses-printer-def
would make some check that the printer uses only functions without
border effect and without any loop structure.

Anyway, the simpler is to have printer functions configured as:

 (lambda (x) (funcall my-tbc-time x))

> Stefan

   Vincent.



             reply	other threads:[~2013-05-26  7:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-26  7:16 Vincent Belaïche [this message]
2013-05-26 18:02 ` 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-25 20:43 Vincent Belaïche
2013-05-26  1:17 ` 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=80a9nixlb3.fsf@gmail.com \
    --to=vincent.belaiche@gmail.com \
    --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.