emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* agenda csv export: three problems (batch, koi8-r and commas)
@ 2007-05-31  9:23 Ruslan Kosolapov
  2007-05-31 12:27 ` Jason F. McBrayer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ruslan Kosolapov @ 2007-05-31  9:23 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]


org-mode 4.75, emacs-snapshot (latest from debian sid)



--[ 1. Problems with -batch ]--

Command 
$ emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv "t")'
fails with 
Debugger entered--Lisp error: (void-function org-batch-agenda-csv)
  (org-batch-agenda-csv "t")
  eval((org-batch-agenda-csv "t"))
  command-line-1(("-l" "/home/rk/.emacs" "-eval" "(org-batch-agenda-csv \"t\")"))
  command-line()
  normal-top-level()

It's look like problem with autoload (unfortunatelly I dont know how
emacs works, so, maybe I wrong).


Command
$ emacs -batch -l ~/.emacs -eval '(load-library "org") (org-batch-agenda-csv "t")'
returns nothing useful.  And I don't know why :)


Only command 
emacs -batch -l ~/.emacs -eval '(my-make-csv)'
returns agenda in csv format.

Maybe fix of this issue is a documentation fix - maybe I do something
wrong :)




--[ 2. Problems with koi8-r ]--

I use koi8-r for my org-file, its works well in most cases.

But in csv I got junk instead koi8-r symbols.  As far as I understand,
html export works the same way, and in html I see html-entities
instead koi8-r.  In browser its look good, but not in terminal and
perl.

I tried to use utf-8, and fail too.

Of course, I execute emacs in the same locale as my org-file.

This issue is critical for me.



--[ 3. Problems with , and "" ]--

As far as I know, strings in csv should be quoted, else there will be
problems if string contains comma.

Now I see than "head" field placed in csv without quotes.  So, if I
use comma in heading text, csv-parsing script fails.

It is not problem for me because I do not use comma in heading text,
but this is a bug.

At other side, using types and quotation in csv output mean more
complex parser for it.  So, maybe better do not fix it by quotation
adding.

In MS Excel I can specify delimiter symbol for csv export, sometimes
it very useful.  I attach patch which implements this feature in
org-mode.

Changeable delimiter can be used as fix of "comma in heading" issue.

Patch (oh, no, it's so small :(  ;)  ):

[-- Attachment #2: org-mode-patch-for-csv-delimiter --]
[-- Type: application/octet-stream, Size: 720 bytes --]

--- org.el.orig	2007-05-31 15:51:32.000000000 +0700
+++ org.el	2007-05-31 16:07:32.000000000 +0700
@@ -1813,6 +1813,11 @@
   :group 'org-export-html
   :type 'string)
 
+(defcustom org-agenda-csv-delimiter ","
+  "Delimiter for fields in csv export of agenda."
+  :group 'org-agenda-export
+  :type 'string)
+
 (defgroup org-agenda-custom-commands nil
  "Options concerning agenda views in Org-mode."
  :tag "Org Agenda Custom Commands"
@@ -14491,7 +14496,7 @@
 	   (mapconcat 'org-agenda-export-csv-mapper
 		      '(org-category txt type todo tags date time-of-day extra
 				     priority-letter priority)
-		      ","))
+		      org-agenda-csv-delimiter))
 	  (princ "\n"))))))
 
 (defun org-fix-agenda-info (props)

[-- Attachment #3: Type: text/plain, Size: 1344 bytes --]




--[ Additional info ]--

.emacs:

(setq my-work-agenda-dir "/home/rk/work/doc/tasks/")
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(defun maf (filename)
  (concat my-work-agenda-dir filename))
(defun gtd ()
  (interactive)
  (find-file (maf "work.org"))
  )
(defun my-make-csv ()
  (gtd)
  (org-batch-agenda-csv "t"))
(setq org-agenda-files (list (maf "work.org")))


org-file (with koi8-r symbols, I hope mail does not corrupt them :) ):

#+STARTUP: lognotestate
#+STARTUP: showall
#+TAGS: { rk(r) sveta(s) kir(k) zalomlenkov(z) ilnar(i) sgunkin(g) const(c) max(m) ikryak(v) } ATT MS
#+SEQ_TODO: NEW NEXT RESCHEDULED | DONE CANCELED
#+SEQ_TODO: WAITING SOMEDAY | CANCELED
#+SEQ_TODO: FREEZED | CANCELED
#+LINK: wiki http://trac.qa.plesk.ru:8080/wiki/
#+TITLE:     QAA Tasks
#+AUTHOR:    rk
#+EMAIL:     rk@plesk.ru
#+LANGUAGE:  ru
#+OPTIONS:   H:4 num:t toc:t \n:nil @:t ::t |:t ^:t *:t TeX:t LaTeX:nil skip:t

#+CATEGORY: Incoming
* Incoming

#+CATEGORY: WorkFlow
* WorkFlow
** NEW Changelog для продуктов via RSS		:rk:kir:

#+CATEGORY: General
* General
** NEXT разобраться с backup failed на psaqa	:rk:
** NEW сделать нормальным репозиторий файлов для AD
** NEW проблема с именами preconditions		:rk:


-- 
Ruslan Kosolapov
Plesk QA Department Second Manager
SWsoft, Inc.

[-- Attachment #4: Type: text/plain, Size: 149 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-01  7:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-31  9:23 agenda csv export: three problems (batch, koi8-r and commas) Ruslan Kosolapov
2007-05-31 12:27 ` Jason F. McBrayer
2007-05-31 12:59   ` Ruslan Kosolapov
2007-05-31 14:41   ` Carsten Dominik
2007-05-31 12:53 ` Ruslan Kosolapov
2007-06-01  7:07 ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).