[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a ses question
From: |
andrés ramírez |
Subject: |
Re: a ses question |
Date: |
Mon, 30 Oct 2023 19:03:19 +0000 |
Hi. Vincent.
I just yanked the elisp snippet You shared (without any modification) I
just did M-x eval-defun, and It gave me this error:
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (error "Eager macro-expansion failure:
(void-variable ses-...")
signal(error ("Eager macro-expansion failure: (void-variable ses-..."))
error("Eager macro-expansion failure: %S" (void-variable ses--cells))
internal-macroexpand-for-load((setq elisp--eval-defun-result (let
((print-level nil) (print-length nil)) (defalias 'smeter/further-processing
#'(lambda nil "process input on as spreadsheet using ses formulae..."
(interactive) (let (... ... ... ... ... ... myyyyymm mysesoutput chunk
bigchunk) (goto-char ...) (setq beg ...) (setq workbook-filename ...)
(forward-line 1) (setq beg ...) (forward-line 4) (setq prevmeasu ...) (setq beg
...) (setq waterbill ...) (forward-line 1) (setq beg ...) (forward-line 4)
(setq measu ...) (setq beg ...) (setq myyyyymm ...) (if ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ...)))))) t)
eval-region(162 5110 t #f(compiled-function (ignore) #<bytecode
-0x5bb31d1b5fed60e>)) ; Reading at buffer position 2635
elisp--eval-defun()
eval-defun(nil)
funcall-interactively(eval-defun nil)
call-interactively(eval-defun record nil)
command-execute(eval-defun record)
execute-extended-command(nil "eval-defun" "eval-defun")
funcall-interactively(execute-extended-command nil "eval-defun" "eval-defun")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
--8<---------------cut here---------------end--------------->8---
Best Regards
Andrés Ramírez
>>>>> "Vincent" == Vincent Belaïche <vincent.b.1@hotmail.fr> writes:
Vincent> Just reading again the code which I sent in my
Vincent> previous email, I found a problem, there would be one trailing
column separator « & »
Vincent> too many. Probably the following would be better:
Vincent> (let ((range (with-current-buffer the-ses-buffer (ses-range A1 C3
; adapt to your case
Vincent> *2 '>v ; use 'v> to
read columnwsise
Vincent> )))) (dolist (row (cdr
range)) ; cdr to
Vincent> remove 'vec (pop row) ; remove 'vec (while (progn (insert
(format "%f" (pop
Vincent> row))) ; assuming all cells are floating point numbers
(when row (insert
Vincent> "&" ; if & is the column separator ) t ; loop again
)))
Vincent> (insert "\\\\\n"; if \\ is the row separator )))