From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Huchler Subject: how to force org-mode to interpret number as string Date: Wed, 05 Mar 2014 04:45:11 +0100 Message-ID: <87siqx9um0.fsf@mars.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL2ls-0000tF-Lk for emacs-orgmode@gnu.org; Tue, 04 Mar 2014 22:45:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL2ln-0001Id-Ej for emacs-orgmode@gnu.org; Tue, 04 Mar 2014 22:45:28 -0500 Received: from plane.gmane.org ([80.91.229.3]:34486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL2ln-0001Hj-7p for emacs-orgmode@gnu.org; Tue, 04 Mar 2014 22:45:23 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WL2ll-0002P1-V7 for emacs-orgmode@gnu.org; Wed, 05 Mar 2014 04:45:21 +0100 Received: from hsi-kbw-109-193-108-156.hsi7.kabel-badenwuerttemberg.de ([109.193.108.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Mar 2014 04:45:21 +0100 Received: from stefan.huchler by hsi-kbw-109-193-108-156.hsi7.kabel-badenwuerttemberg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Mar 2014 04:45:21 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org I try to generate mail drafts from a table as template-tokens. The Problem is that that org-mode seems to auto-format the salary column as a number. I donĀ“t need to calc this numbers so saving/getting it as string would be what I want. It not only butchers the string because he interprets the numbers behind of the . as decimal point, while in germany we use the "," for that, and the point as a way to mark thousends. But even if he would understand that the number is 5000 and not 5, if the outcommented replace-regexp throughs a error because its not string. To convert it back makes no sense, the fields will always be interpreted as replacement-strings. #+TBLNAME: jobs | jobname | city | salary | email | | Taxi-driver | New York City | 500.000 | mayor@gotham-city.com | | Butcher | Peking | 5.000 | Jinping@china.cn | #+SRC_NAME: generate_job_mails_from_table #+BEGIN_SRC emacs-lisp :var table=jobs header=jobs[0] data=jobs[1:-1] :results output (setq column-length (length header)) (setq lines) (dolist (line data) (setq tmp-line) (dotimes (i column-length) (add-to-list 'tmp-line (cons (nth i header) (nth i line))) ; (print (nth i line) ) (add-to-list 'lines tmp-line) ) (message-mail) (setq line1 (car lines)) (insert (cdr (assoc "email" line1))) (message-goto-subject) (insert "applying for the job: $jobname") (dolist (var line1) ; (replace-regexp (concat "$"(car var)) (cdr var )) (print (cdr var)) ) #+END_SRC #+RESULTS: : : "Jinping@china.cn" : : 5.0 : : "Peking" : : "Butcher" btw, is there a easier way to generate this dict(python) like "lines" in elisp?