[O] Performance of org-mode with BIDI (was: Largest org file you have + performance)

2011-08-02 Thread Reiner Steib
On Mon, Aug 01 2011, Florian Beck wrote:

 If you are using the current bzr version of emacs, make sure to set
 `bidi-display-reordering' to nil.

Please don't.  Instead, report problems caused by
`bidi-display-reordering' with M-x report-emacs-bug RET so the Emacs
developers can fix the problem.

Bye, Reiner.
-- 
   ,,,
  (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




Re: [O] fatal: The remote end hung up unexpectedly

2011-08-02 Thread Sebastien Vauban
Hello,

Sebastien Vauban wrote:
 For a couple of weeks (2 to 3 weeks, I would say), I often experience the
 above message when git pull'ing.

 It does not bother me: I just retry later, and it often works then, but I
 thought it'd be worth mentioning.

It appears I was still referring to repo.or.cz. That may be the root cause of
this.

Best regards,
  Seb

PS- Thanks to Erik.

-- 
Sebastien Vauban




[O] [PATCH 0/8] Org mode macros, refactored

2011-08-02 Thread David Maus
Following series of patches is product of some refactoring of
macro-usage in Org mode. It defines two new macros and applies those
macros in other macros in org-macs and batch-agenda functions.

Comments are welcome. I'll create a bundle for the patches in
patchwork. If there are no objections I would like to push these
changes at the end of the week.

Maybe the most conveniant macro for further development is

(org-with-uninterend SYMBOLS BODY)

This macro wraps BODY in a let binding form where each symbol in
SYMBOLS is bound to a new but uninterned symbol of the same name. This
way you can avoid leaking or, more precisely, capturing of symbols if
you write a macro that needs to bind its own control variables in the
macro expansion form.

E.g.

(defmacro org-preserve-lc (rest body)
  `(let ((line (org-current-line))
 (col (current-column)))
 (unwind-protect
   (progn ,@body)
 (org-goto-line line)
 (org-move-to-column col

The let binding at the top of the expansion form shadows symbols with
the name line and cols if they are bound before BODY, and if BODY uses
symbols with the same name it would overwrite the symbols bound in the
let form.

Org-with-uninterned prevents this by creating new uninterned symbols
which are unreachable outside the expanded form and inside BODY.

(defmacro org-preserve-lc (rest body)
  (org-with-uninterned (line col)
`(let ((,line (org-current-line))
   (,col (current-column)))
   (unwind-protect
   (progn ,@body)
 (org-goto-line ,line)
 (org-move-to-column ,col)

Expands to:

(let
((line
  (make-symbol
   (symbol-name 'line)))
 (col
  (make-symbol
   (symbol-name 'col
  `(let
   ((,line
 (org-current-line))
(,col
 (current-column)))
 (unwind-protect
 (progn ,@body)
   (org-goto-line ,line)
   (org-move-to-column ,col

This way ,line and ,col in the macro expansion refer to the new
uninterned symbols line and col created outside the expansion form.

Note: The usage of make-symbol works but has one drawback: The new
uninterned symbols have the same name as the maybe interned symbols in
BODY. Ideally we should use `gensym' instead, which creates a new
uninterned symbol with a unique name. But gensym is part of the
cl-package and thus not allowed to be called at runtime for a program
to be part of Emacs core.

David Maus (8):
  New macro: Execute BODY in enviroment with uninterned SYMBOLS.
  Use new macro org-with-uninterned
  New macro: Evaluate BODY in ENVIRONMENT
  New function: Substitute posix classes in regular expression
  Use macro org-with-uninterned
  New function: Turn a flat parameter list into an alist
  Use org-eval-in-environment, make macros functions
  Make org-batch-store-agenda-views a fun, use org-eval-in-environment

 lisp/org-agenda.el |   92 ---
 lisp/org-macs.el   |  137 +++-
 2 files changed, 123 insertions(+), 106 deletions(-)

-- 
1.7.2.5




[O] [PATCH 1/7] New macro: Execute BODY in enviroment with uninterned SYMBOLS

2011-08-02 Thread David Maus
* org-macs.el (org-with-uninterned): New macro. Execute BODY in
enviroment with uninterned SYMBOLS.
---
 lisp/org-macs.el |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 906be61..53c60e5 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -370,6 +370,12 @@ The number of levels is controlled by 
`org-inlinetask-min-level'
   (format-seconds string seconds)
 (format-time-string string (seconds-to-time seconds
 
+(defmacro org-with-uninterned (symbols rest body)
+  `(let ,(mapcar (lambda (s)
+  `(,s (make-symbol (symbol-name ',s symbols)
+ ,@body))
+(put 'org-with-uninterned 'lisp-indent-function 1)
+
 (provide 'org-macs)
 
 ;; arch-tag: 7e6a73ce-aac9-4fc0-9b30-ce6f89dc6668
-- 
1.7.2.5




[O] [PATCH 3/7] Use new macro org-with-uninterned

2011-08-02 Thread David Maus
* org-macs.el (org-preserve-lc, org-with-point-at)
(org-with-remote-undo, org-save-outline-visibility): Use new macro
org-with-uninterned.
---
 lisp/org-macs.el |   90 --
 1 files changed, 47 insertions(+), 43 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 7a0cc60..ab21ef7 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -110,12 +110,13 @@ Also, do not record undo information.
 s))
 
 (defmacro org-preserve-lc (rest body)
-  `(let ((_line (org-current-line))
-(_col (current-column)))
- (unwind-protect
-(progn ,@body)
-   (org-goto-line _line)
-   (org-move-to-column _col
+  (org-with-uninterned (line col)
+`(let ((,line (org-current-line))
+  (,col (current-column)))
+   (unwind-protect
+  (progn ,@body)
+(org-goto-line ,line)
+(org-move-to-column ,col)
 
 (defmacro org-without-partial-completion (rest body)
   `(if (and (boundp 'partial-completion-mode)
@@ -142,12 +143,13 @@ We use a macro so that the test can happen at compilation 
time.
 
 (defmacro org-with-point-at (pom rest body)
   Move to buffer and point of point-or-marker POM for the duration of BODY.
-  `(let ((pom ,pom))
- (save-excursion
-   (if (markerp pom) (set-buffer (marker-buffer pom)))
+  (org-with-uninterned (mpom)
+`(let ((,mpom ,pom))
(save-excursion
-(goto-char (or pom (point)))
-,@body
+(if (markerp ,mpom) (set-buffer (marker-buffer ,mpom)))
+(save-excursion
+  (goto-char (or ,mpom (point)))
+  ,@body)
 (put 'org-with-point-at 'lisp-indent-function 1)
 
 (defmacro org-no-warnings (rest body)
@@ -180,26 +182,27 @@ We use a macro so that the test can happen at compilation 
time.
 
 (defmacro org-with-remote-undo (_buffer rest _body)
   Execute BODY while recording undo information in two buffers.
-  `(let ((_cline (org-current-line))
-(_cmd this-command)
-(_buf1 (current-buffer))
-(_buf2 ,_buffer)
-(_undo1 buffer-undo-list)
-(_undo2 (with-current-buffer ,_buffer buffer-undo-list))
-_c1 _c2)
- ,@_body
- (when org-agenda-allow-remote-undo
-   (setq _c1 (org-verify-change-for-undo
- _undo1 (with-current-buffer _buf1 buffer-undo-list))
-_c2 (org-verify-change-for-undo
- _undo2 (with-current-buffer _buf2 buffer-undo-list)))
-   (when (or _c1 _c2)
-;; make sure there are undo boundaries
-(and _c1 (with-current-buffer _buf1 (undo-boundary)))
-(and _c2 (with-current-buffer _buf2 (undo-boundary)))
-;; remember which buffer to undo
-(push (list _cmd _cline _buf1 _c1 _buf2 _c2)
-  org-agenda-undo-list)
+  (org-with-uninterned (cline cmd buf1 buf2 undo1 undo2 c1 c2)
+`(let ((,cline (org-current-line))
+  (,cmd this-command)
+  (,buf1 (current-buffer))
+  (,buf2 ,_buffer)
+  (,undo1 buffer-undo-list)
+  (,undo2 (with-current-buffer ,_buffer buffer-undo-list))
+  ,c1 ,c2)
+   ,@_body
+   (when org-agenda-allow-remote-undo
+(setq ,c1 (org-verify-change-for-undo
+   ,undo1 (with-current-buffer ,buf1 buffer-undo-list))
+  ,c2 (org-verify-change-for-undo
+   ,undo2 (with-current-buffer ,buf2 buffer-undo-list)))
+(when (or ,c1 ,c2)
+  ;; make sure there are undo boundaries
+  (and ,c1 (with-current-buffer ,buf1 (undo-boundary)))
+  (and ,c2 (with-current-buffer ,buf2 (undo-boundary)))
+  ;; remember which buffer to undo
+  (push (list ,cmd ,cline ,buf1 ,c1 ,buf2 ,c2)
+org-agenda-undo-list))
 (put 'org-with-remote-undo 'lisp-indent-function 1)
 
 (defmacro org-no-read-only (rest body)
@@ -331,18 +334,19 @@ but it also means that the buffer should stay alive
 during the operation, because otherwise all these markers will
 point nowhere.
   (declare (indent 1))
-  `(let ((data (org-outline-overlay-data ,use-markers))
-rtn)
- (unwind-protect
-(progn
-  (setq rtn (progn ,@body))
-  (org-set-outline-overlay-data data))
-   (when ,use-markers
-(mapc (lambda (c)
-(and (markerp (car c)) (move-marker (car c) nil))
-(and (markerp (cdr c)) (move-marker (cdr c) nil)))
-  data)))
- rtn))
+  (org-with-uninterned (data rtn)
+`(let ((,data (org-outline-overlay-data ,use-markers))
+  ,rtn)
+   (unwind-protect
+  (progn
+(setq ,rtn (progn ,@body))
+(org-set-outline-overlay-data ,data))
+(when ,use-markers
+  (mapc (lambda (c)
+  (and (markerp (car c)) (move-marker (car c) nil))
+  (and (markerp (cdr c)) (move-marker (cdr c) nil)))
+,data)))
+   ,rtn)))
 
 (defmacro org-with-wide-buffer (rest 

[O] [PATCH 7/7] Make org-batch-store-agenda-views a fun, use org-eval-in-environment

2011-08-02 Thread David Maus
* org-agenda.el (org-batch-store-agenda-views): Make it a function,
use org-eval-in-environment.
---
 lisp/org-agenda.el |   20 +---
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 6079377..9215d2a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2697,17 +2697,14 @@ This ensures the export commands can easily use it.
   (interactive)
   (eval (list 'org-batch-store-agenda-views)))
 
-;; FIXME, why is this a macro?
 ;;;###autoload
-(defmacro org-batch-store-agenda-views (rest parameters)
+(defun org-batch-store-agenda-views (rest parameters)
   Run all custom agenda commands that have a file argument.
   (let ((cmds (org-agenda-normalize-custom-commands 
org-agenda-custom-commands))
(pop-up-frames nil)
(dir default-directory)
-   pars cmd thiscmdkey files opts cmd-or-set)
-(while parameters
-  (push (list (pop parameters) (if parameters (pop parameters))) pars))
-(setq pars (reverse pars))
+   (pars (org-make-parameter-alist parameters))
+   cmd thiscmdkey files opts cmd-or-set)
 (save-window-excursion
   (while cmds
(setq cmd (pop cmds)
@@ -2717,13 +2714,14 @@ This ensures the export commands can easily use it.
  files (nth (if (listp cmd-or-set) 4 5) cmd))
(if (stringp files) (setq files (list files)))
(when files
- (eval (list 'let (append org-agenda-exporter-settings opts pars)
- (list 'org-agenda nil thiscmdkey)))
+ (org-eval-in-environment (append org-agenda-exporter-settings
+  opts pars)
+   (org-agenda nil thiscmdkey))
  (set-buffer org-agenda-buffer-name)
  (while files
-   (eval (list 'let (append org-agenda-exporter-settings opts pars)
-   (list 'org-write-agenda
- (expand-file-name (pop files) dir) nil t
+   (org-eval-in-environment (append org-agenda-exporter-settings
+opts pars)
+ (org-write-agenda (expand-file-name (pop files) dir) nil t)))
  (and (get-buffer org-agenda-buffer-name)
   (kill-buffer org-agenda-buffer-name)))
 
-- 
1.7.2.5




[O] [PATCH 2/7] New macro: Evaluate FORM in ENVIRONMENT

2011-08-02 Thread David Maus
* org-macs.el (org-eval-in-environment): New macro. Evaluate
FORM in ENVIRONMENT.
(org-with-uninterned): Move to top of file.
---
 lisp/org-macs.el |   23 ++-
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 53c60e5..7a0cc60 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -47,6 +47,12 @@
 (declare-function org-add-props org-compat (string plist rest props))
 (declare-function org-string-match-p org-compat (rest args))
 
+(defmacro org-with-uninterned (symbols rest body)
+  `(let ,(mapcar (lambda (s)
+  `(,s (make-symbol (symbol-name ',s symbols)
+ ,@body))
+(put 'org-with-uninterned 'lisp-indent-function 1)
+
 (defmacro org-called-interactively-p (optional kind)
   (if (featurep 'xemacs)
`(interactive-p)
@@ -370,11 +376,18 @@ The number of levels is controlled by 
`org-inlinetask-min-level'
   (format-seconds string seconds)
 (format-time-string string (seconds-to-time seconds
 
-(defmacro org-with-uninterned (symbols rest body)
-  `(let ,(mapcar (lambda (s)
-  `(,s (make-symbol (symbol-name ',s symbols)
- ,@body))
-(put 'org-with-uninterned 'lisp-indent-function 1)
+(defun org-make-parameter-alist (flat)
+  Return alist based on FLAT.
+FLAT is a list with alternating symbol names and values. The
+returned alist is a list of lists with the symbol name in car and
+the value in cdr.
+  (when flat
+(cons (list (car flat) (cadr flat))
+ (org-make-parameter-alist (cddr flat)
+
+(defmacro org-eval-in-environment (environment form)
+  `(eval '(let ,environment ,form)))
+(put 'org-eval-in-environment 'lisp-indent-function 1)
 
 (provide 'org-macs)
 
-- 
1.7.2.5




[O] [PATCH 4/7] New function: Substitute posix classes in regular expression

2011-08-02 Thread David Maus
* org-macs.el (org-substitute-posix-classes): New function. Substitute
posix classes in regular expression.
(org-re): Rewritten to use new function.
---
 lisp/org-macs.el |   28 +++-
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index ab21ef7..198d210 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -93,21 +93,23 @@ Also, do not record undo information.
before-change-functions after-change-functions)
,@body
 
+(defun org-substitute-posix-classes (re)
+  Substitute posix classes in regular expression RE.
+  (let ((ss re))
+(save-match-data
+  (while (string-match \\[:alnum:\\] ss)
+   (setq ss (replace-match a-zA-Z0-9 t t ss)))
+  (while (string-match \\[:word:\\] ss)
+   (setq ss (replace-match a-zA-Z0-9 t t ss)))
+  (while (string-match \\[:alpha:\\] ss)
+   (setq ss (replace-match a-zA-Z t t ss)))
+  (while (string-match \\[:punct:\\] ss)
+   (setq ss (replace-match \001-@[-`{-~ t t ss)))
+  ss)))
+
 (defmacro org-re (s)
   Replace posix classes in regular expression.
-  (if (featurep 'xemacs)
-  (let ((ss s))
-   (save-match-data
- (while (string-match \\[:alnum:\\] ss)
-   (setq ss (replace-match a-zA-Z0-9 t t ss)))
- (while (string-match \\[:word:\\] ss)
-   (setq ss (replace-match a-zA-Z0-9 t t ss)))
- (while (string-match \\[:alpha:\\] ss)
-   (setq ss (replace-match a-zA-Z t t ss)))
- (while (string-match \\[:punct:\\] ss)
-   (setq ss (replace-match \001-@[-`{-~ t t ss)))
- ss))
-s))
+  (if (featurep 'xemacs) `(org-substitute-posix-classes ,s) s))
 
 (defmacro org-preserve-lc (rest body)
   (org-with-uninterned (line col)
-- 
1.7.2.5




[O] [PATCH 5/7] Use macro org-with-uninterned

2011-08-02 Thread David Maus
* org-agenda.el (org-agenda-with-point-at-orig-entry): Use macro
org-with-uninterned.
---
 lisp/org-agenda.el |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index d47013b..25a556e 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1714,12 +1714,13 @@ Note that functions in this alist don't need to be 
quoted.
 If STRING is non-nil, the text property will be fetched from position 0
 in that string.  If STRING is nil, it will be fetched from the beginning
 of the current line.
-  `(let ((marker (get-text-property (if string 0 (point-at-bol))
-   'org-hd-marker string)))
- (with-current-buffer (marker-buffer marker)
-   (save-excursion
-(goto-char marker)
-,@body
+  (org-with-uninterned (marker)
+`(let ((,marker (get-text-property (if string 0 (point-at-bol))
+  'org-hd-marker string)))
+   (with-current-buffer (marker-buffer ,marker)
+(save-excursion
+  (goto-char ,marker)
+  ,@body)
 
 (defun org-add-agenda-custom-command (entry)
   Replace or add a command in `org-agenda-custom-commands'.
-- 
1.7.2.5




[O] [PATCH 6/7] Use org-eval-in-environment, make macros functions

2011-08-02 Thread David Maus
* org-agenda.el (org-batch-agenda, org-batch-agenda-csv): Make
a function, use org-eval-in-environment.
---
 lisp/org-agenda.el |   59 ++-
 1 files changed, 26 insertions(+), 33 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 25a556e..6079377 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2569,22 +2569,19 @@ s   Search for keywords C   Configure 
custom agenda commands
   (org-let (nth 1 series) '(org-finalize-agenda)))
 
 ;;;###autoload
-(defmacro org-batch-agenda (cmd-key rest parameters)
+(defun org-batch-agenda (cmd-key rest parameters)
   Run an agenda command in batch mode and send the result to STDOUT.
 If CMD-KEY is a string of length 1, it is used as a key in
 `org-agenda-custom-commands' and triggers this command.  If it is a
 longer string it is used as a tags/todo match string.
 Parameters are alternating variable names and values that will be bound
 before running the agenda command.
-  (let (pars)
-(while parameters
-  (push (list (pop parameters) (if parameters (pop parameters))) pars))
+  (org-eval-in-environment (org-make-parameter-alist parameters)
 (if ( (length cmd-key) 2)
-   (eval (list 'let (nreverse pars)
-   (list 'org-tags-view nil cmd-key)))
-  (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key
-(set-buffer org-agenda-buffer-name)
-(princ (org-encode-for-stdout (buffer-string)
+   (org-tags-view nil cmd-key)
+  (org-agenda nil cmd-key)))
+  (set-buffer org-agenda-buffer-name)
+  (princ (org-encode-for-stdout (buffer-string
 
 ;(defun org-encode-for-stdout (string)
 ;  (if (fboundp 'encode-coding-string)
@@ -2597,7 +2594,7 @@ before running the agenda command.
 (defvar org-agenda-info nil)
 
 ;;;###autoload
-(defmacro org-batch-agenda-csv (cmd-key rest parameters)
+(defun org-batch-agenda-csv (cmd-key rest parameters)
   Run an agenda command in batch mode and send the result to STDOUT.
 If CMD-KEY is a string of length 1, it is used as a key in
 `org-agenda-custom-commands' and triggers this command.  If it is a
@@ -2631,30 +2628,26 @@ extraSting with extra planning info
 priority-l   The priority letter if any was given
 priority-n   The computed numerical priority
 agenda-day   The day in the agenda where this is listed
-
-  (let (pars)
-(while parameters
-  (push (list (pop parameters) (if parameters (pop parameters))) pars))
-(push (list 'org-agenda-remove-tags t) pars)
+  (org-eval-in-environment (append (org-agenda-remove-tags t)
+  (org-make-parameter-alist parameters))
 (if ( (length cmd-key) 2)
-   (eval (list 'let (nreverse pars)
-   (list 'org-tags-view nil cmd-key)))
-  (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key
-(set-buffer org-agenda-buffer-name)
-(let* ((lines (org-split-string (buffer-string) \n))
-  line)
-  (while (setq line (pop lines))
-   (catch 'next
- (if (not (get-text-property 0 'org-category line)) (throw 'next nil))
- (setq org-agenda-info
-   (org-fix-agenda-info (text-properties-at 0 line)))
- (princ
-  (org-encode-for-stdout
-   (mapconcat 'org-agenda-export-csv-mapper
-  '(org-category txt type todo tags date time extra
- priority-letter priority agenda-day)
- ,)))
- (princ \n))
+   (org-tags-view nil cmd-key)
+  (org-agenda nil cmd-key)))
+  (set-buffer org-agenda-buffer-name)
+  (let* ((lines (org-split-string (buffer-string) \n))
+line)
+(while (setq line (pop lines))
+  (catch 'next
+   (if (not (get-text-property 0 'org-category line)) (throw 'next nil))
+   (setq org-agenda-info
+ (org-fix-agenda-info (text-properties-at 0 line)))
+   (princ
+(org-encode-for-stdout
+ (mapconcat 'org-agenda-export-csv-mapper
+'(org-category txt type todo tags date time extra
+   priority-letter priority agenda-day)
+,)))
+   (princ \n)
 
 (defun org-fix-agenda-info (props)
   Make sure all properties on an agenda item have a canonical form.
-- 
1.7.2.5




Re: [O] [PATCH 0/8] Org mode macros, refactored

2011-08-02 Thread David Maus
*sigh*

These patches should apply to current master but I somehow messed up
 my development tree. Two separate commits where squashed to 2/7 --
 will post a follow up this afternoon.

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber dmj...@jabber.org
Email. dm...@ictsoc.de


pgpxbgQhyC0hL.pgp
Description: PGP signature


Re: [O] [PATCH 0/8] Org mode macros, refactored

2011-08-02 Thread Štěpán Němec
On Tue, 02 Aug 2011 11:23:33 +0200
David Maus wrote:

 Note: The usage of make-symbol works but has one drawback: The new
 uninterned symbols have the same name as the maybe interned symbols in
 BODY.

An oft-used workaround (also occuring in the Emacs core code) is to add
some line-noise (e.g. --symbol--) to the created symbol names so they
are at least visually distinguishable.

-- 
Štěpán



Re: [O] [PATCH 2/7] New macro: Evaluate FORM in ENVIRONMENT

2011-08-02 Thread Štěpán Němec
On Tue, 02 Aug 2011 11:23:35 +0200
David Maus wrote:

 * org-macs.el (org-eval-in-environment): New macro. Evaluate
 FORM in ENVIRONMENT.
 (org-with-uninterned): Move to top of file.
 ---
  lisp/org-macs.el |   23 ++-
  1 files changed, 18 insertions(+), 5 deletions(-)

 diff --git a/lisp/org-macs.el b/lisp/org-macs.el
 index 53c60e5..7a0cc60 100644
 --- a/lisp/org-macs.el
 +++ b/lisp/org-macs.el
 @@ -47,6 +47,12 @@
  (declare-function org-add-props org-compat (string plist rest props))
  (declare-function org-string-match-p org-compat (rest args))
  
 +(defmacro org-with-uninterned (symbols rest body)
 +  `(let ,(mapcar (lambda (s)
 +`(,s (make-symbol (symbol-name ',s symbols)
 + ,@body))
 +(put 'org-with-uninterned 'lisp-indent-function 1)
 +

So in the previous commit you added this macro, in the next commit you
move it to the top of the file? Why didn't you put it into the right
place to begin with?

[...]

 +(defun org-make-parameter-alist (flat)
 +  Return alist based on FLAT.
 +FLAT is a list with alternating symbol names and values. The
 +returned alist is a list of lists with the symbol name in car and
 +the value in cdr.
 +  (when flat
 +(cons (list (car flat) (cadr flat))
 +   (org-make-parameter-alist (cddr flat)

This new function is not mentioned anywhere in the commit message.

-- 
Štěpán



[O] how to make org-clock-in close the files it opens

2011-08-02 Thread Julian Burgos
Dear list,

When using org-clock-in, all files in my agenda list are opened.  This
makes sense, as org mode is looking for clocks already opened.  But it
is possible to make org mode to close all these files?  I do keep lots
of files in my agenda, and it is a pain to have to close them by hand.
Many thanks,

Julian

-- 
Julian Mariano Burgos
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: jul...@hafro.is, jmbur...@uw.edu



Re: [O] fatal: The remote end hung up unexpectedly

2011-08-02 Thread John Hendy
On Tue, Aug 2, 2011 at 3:12 AM, Sebastien Vauban
wxhgmqzgw...@spammotel.com wrote:
 Hello,

 Sebastien Vauban wrote:
 For a couple of weeks (2 to 3 weeks, I would say), I often experience the
 above message when git pull'ing.

 It does not bother me: I just retry later, and it often works then, but I
 thought it'd be worth mentioning.

 It appears I was still referring to repo.or.cz. That may be the root cause of
 this.

I had this as well and changed to the orgmode.org repo vs. repo.or.cz.
Is this enough of a problem with or.cz that the page on keeping up to
date with orgmode should be updated?

John


 Best regards,
  Seb

 PS- Thanks to Erik.

 --
 Sebastien Vauban






[O] How to add entry in the Agenda view

2011-08-02 Thread Xin Shi
Hello Experts,

I am using orgmode 7.7 in Emacs 23.3.

I usually have a dedicated window (frame) for Org Agenda view. I found it
would be very convient to be able to add item directly from the Agenda
buffer, however, I don't see that command in the manual. (A closer one is
the refill, which moves the entry to another category)

Can anyone help?

Thanks!

Xin


Re: [O] [PATCH 2/7] New macro: Evaluate FORM in ENVIRONMENT

2011-08-02 Thread David Maus
At Tue, 02 Aug 2011 12:50:05 +0200,
Štěpán Němec wrote:
 
 On Tue, 02 Aug 2011 11:23:35 +0200
 David Maus wrote:
 
  * org-macs.el (org-eval-in-environment): New macro. Evaluate
  FORM in ENVIRONMENT.
  (org-with-uninterned): Move to top of file.
  ---
   lisp/org-macs.el |   23 ++-
   1 files changed, 18 insertions(+), 5 deletions(-)
 
  diff --git a/lisp/org-macs.el b/lisp/org-macs.el
  index 53c60e5..7a0cc60 100644
  --- a/lisp/org-macs.el
  +++ b/lisp/org-macs.el
  @@ -47,6 +47,12 @@
   (declare-function org-add-props org-compat (string plist rest props))
   (declare-function org-string-match-p org-compat (rest args))
   
  +(defmacro org-with-uninterned (symbols rest body)
  +  `(let ,(mapcar (lambda (s)
  +  `(,s (make-symbol (symbol-name ',s symbols)
  + ,@body))
  +(put 'org-with-uninterned 'lisp-indent-function 1)
  +
 
 So in the previous commit you added this macro, in the next commit you
 move it to the top of the file? Why didn't you put it into the right
 place to begin with?
 
 [...]
 
  +(defun org-make-parameter-alist (flat)
  +  Return alist based on FLAT.
  +FLAT is a list with alternating symbol names and values. The
  +returned alist is a list of lists with the symbol name in car and
  +the value in cdr.
  +  (when flat
  +(cons (list (car flat) (cadr flat))
  + (org-make-parameter-alist (cddr flat)
 
 This new function is not mentioned anywhere in the commit message.

Yepp. I messed up the branch, correction is on its way.

Best,
  -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber dmj...@jabber.org
Email. dm...@ictsoc.de


pgprSfDjQPHFs.pgp
Description: PGP signature


Re: [O] [PATCH 1/7] New macro: Execute BODY in enviroment with uninterned SYMBOLS

2011-08-02 Thread David Maus
Supersedes 1/7: Define macro at top of the file.

From 3a97836940b18ea2f50d53218e51fa81d617e788 Mon Sep 17 00:00:00 2001
From: David Maus dm...@ictsoc.de
Date: Tue, 2 Aug 2011 15:39:49 +0200
Subject: [PATCH] New macro: Execute BODY in enviroment with uninterned SYMBOLS

* org-macs.el (org-with-uninterned): New macro. Execute BODY in
enviroment with uninterned SYMBOLS.
---
 lisp/org-macs.el |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 906be61..1d31744 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -47,6 +47,12 @@
 (declare-function org-add-props org-compat (string plist rest props))
 (declare-function org-string-match-p org-compat (rest args))
 
+(defmacro org-with-uninterned (symbols rest body)
+  `(let ,(mapcar (lambda (s)
+  `(,s (make-symbol (symbol-name ',s symbols)
+ ,@body))
+(put 'org-with-uninterned 'lisp-indent-function 1)
+
 (defmacro org-called-interactively-p (optional kind)
   (if (featurep 'xemacs)
`(interactive-p)
-- 
1.7.2.5



pgpoAPV38Nqwc.pgp
Description: PGP signature


Re: [O] [PATCH 2/7] New macro: Evaluate FORM in ENVIRONMENT

2011-08-02 Thread David Maus
Fix smashed up commits: these two replace 2/7

From d55980b50dea594912b38bd7d9b96989c6a54129 Mon Sep 17 00:00:00 2001
From: David Maus dm...@ictsoc.de
Date: Tue, 2 Aug 2011 15:41:36 +0200
Subject: [PATCH] New macro: Evaluate FORM in ENVIRONMENT

* org-macs.el (org-eval-in-environment): New macro. Evaluate FORM in
ENVIRONMENT.
---
 lisp/org-macs.el |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 1d31744..4062f07 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -376,6 +376,10 @@ The number of levels is controlled by 
`org-inlinetask-min-level'
   (format-seconds string seconds)
 (format-time-string string (seconds-to-time seconds
 
+(defmacro org-eval-in-environment (environment form)
+  `(eval '(let ,environment ,form)))
+(put 'org-eval-in-environment 'lisp-indent-function 1)
+
 (provide 'org-macs)
 
 ;; arch-tag: 7e6a73ce-aac9-4fc0-9b30-ce6f89dc6668
-- 
1.7.2.5

From 04a3f7c9c69faa59f1d9c6343dbb22b3faad3d52 Mon Sep 17 00:00:00 2001
From: David Maus dm...@ictsoc.de
Date: Tue, 2 Aug 2011 15:43:15 +0200
Subject: [PATCH] New function: Return alist of parameters based on flat list

* org-macs.el (org-make-parameter-alist): New function. Return alist
of parameters based on flat list.
---
 lisp/org-macs.el |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 4062f07..7a0cc60 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -376,6 +376,15 @@ The number of levels is controlled by 
`org-inlinetask-min-level'
   (format-seconds string seconds)
 (format-time-string string (seconds-to-time seconds
 
+(defun org-make-parameter-alist (flat)
+  Return alist based on FLAT.
+FLAT is a list with alternating symbol names and values. The
+returned alist is a list of lists with the symbol name in car and
+the value in cdr.
+  (when flat
+(cons (list (car flat) (cadr flat))
+ (org-make-parameter-alist (cddr flat)
+
 (defmacro org-eval-in-environment (environment form)
   `(eval '(let ,environment ,form)))
 (put 'org-eval-in-environment 'lisp-indent-function 1)
-- 
1.7.2.5



pgphNvWwOahgs.pgp
Description: PGP signature


Re: [O] How to add entry in the Agenda view

2011-08-02 Thread Stephen Eglen
Xin Shi shixin...@gmail.com writes:

 I usually have a dedicated window (frame) for Org Agenda view. I found
 it would be very convient to be able to add item directly from the
 Agenda buffer, however, I don't see that command in the manual. (A
 closer one is the refill, which moves the entry to another category)


With point on a day in the agenda, try i d, and see the value of
org-agenda-diary-file.  Here's the snippet from the info doc.

Stephen

`i (`org-agenda-diary-entry')'
 Insert a new entry into the diary, using the date at the cursor
 and (for block entries) the date at the mark.  This will add to
 the Emacs diary file(3), in a way similar to the `i' command in
 the calendar.  The diary file will pop up in another window, where
 you can add the entry.

 If you configure `org-agenda-diary-file' to point to an Org-mode
 file, Org will create entries (in org-mode syntax) in that file
 instead.  Most entries will be stored in a date-based outline tree
 that will later make it easy to archive appointments from previous
 months/years.  The tree will be built under an entry with a
 `DATE_TREE' property, or else with years as top-level entries.
 Emacs will prompt you for the entry text--if you specify it, the
 entry will be created in `org-agenda-diary-file' without further
 interaction.  If you directly press RET at the prompt without
 typing text, the target file will be shown in another window for
 you to finish the entry there.  See also the `k r' command.  





[O] C-x n s no longer works in outline mode

2011-08-02 Thread Leo
I have been using this outside of org-mode for many years but it is
broken in 7.7.

Debugger entered--Lisp error: (error Before first headline at position 134230 
in buffer init)
  signal(error (Before first headline at position 134230 in buffer init))
  error(Before first headline at position %d in buffer %s 134230 #buffer 
init)
  byte-code(\300\301`p#\207 [error Before first headline at position %d in 
buffer %s] 4)
  org-back-to-heading(t)
  org-narrow-to-subtree()
  call-interactively(org-narrow-to-subtree nil nil)

Leo




Re: [O] how to make org-clock-in close the files it opens

2011-08-02 Thread Matt Lundin
Julian Burgos jmbur...@uw.edu writes:

 When using org-clock-in, all files in my agenda list are opened.  This
 makes sense, as org mode is looking for clocks already opened.  But it
 is possible to make org mode to close all these files?  

I was going to suggest M-x org-agenda-exit, but that does not work
because neither org-resolve-clocks nor org-find-open-clocks add the
files they open to org-agenda-new-buffers. 

As a workaround you could feed a list of files to org-release-buffers.

 I do keep lots of files in my agenda, and it is a pain to have to
 close them by hand. Many thanks,

Might I ask why you would like to close your agenda files? They will be
reopened when you call the agenda.

Best,
Matt



Re: [O] Org-babel results preamble

2011-08-02 Thread Eric Schulte
Hi Derek,

If you name your code block, then it should be possible to update
results without any need to replace the lines preceding the results.

For example,

#+source: disk-usage
#+begin_src sh
  df
#+end_src

#+PLOT: title:Disk Usage ind:6 deps:(5) type:2d with:histograms set:yrange 
[0:100]
#+results: disk-usage
| Filesystem | 1K-blocks | Used | Available | Use% | Mounted   | on |
| /dev/sda6  |  28835836 |  8447712 |  18923344 |  31% | / ||
| none   |   2997072 |  676 |   2996396 |   1% | /dev  ||
| none   |   3006056 |0 |   3006056 |   0% | /dev/shm  ||
| none   |   3006056 |   96 |   3005960 |   1% | /var/run  ||
| none   |   3006056 |0 |   3006056 |   0% | /var/lock ||
| /dev/sda7  | 144176824 | 72225604 |  64627420 |  53% | /home ||

Derek Thomas derekctho...@gmail.com writes:

 I have found that using org-plot to plot the results output of an
 org-babel code block is very useful in prototyping my code.  One minor
 annoyance is the need to remove and replace the #+PLOT: header at the
 beginning of the results output.  Is it possible to specify a
 preamble in the source block?  I am looking to produce something
 like this:

 #+begin_src sh :results wrap
 ./dtest
 #+end_src
 #+PLOT: ind:1 deps:(2)
 #+results:
 #+BEGIN_RESULT
 | 0.000E+000 | 1.0 |
 | 9.99776482582E-003 |   0.99000223517 |
 | 1.99955296516E-002 |   0.98000447035 |
 | 2.99932944775E-002 |   0.97000670552 |
 | 3.99910593033E-002 |0.9600089407 |
 | 4.99888241291E-002 |   0.95001117587 |
 #+END_RESULT
 Thanks,

 Derek


-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



[O] ebib configuration for org-bibtex

2011-08-02 Thread Thomas S. Dye
Aloha all,

I'm trying, partially successfully, to configure org-bibtex so it mimics
some useful features of ebib.  In particular, I'm wanting to add several
optional fields that ebib uses.


I have this in .emacs:

#+begin_src emacs-lisp :tangle yes
  (dolist (type org-bibtex-types)
(push :url (cdr (assoc :optional (cdr type
(push :annote (cdr (assoc :optional (cdr type
(push :abstract (cdr (assoc :optional (cdr type
(push :keywords (cdr (assoc :optional (cdr type
(push :file (cdr (assoc :optional (cdr type
)

  (push (cons :url A URL for the reference) org-bibtex-fields)
  (push (cons :annote Annotation is typically not exported) org-bibtex-fields)
  (push (cons :abstract Abstract for annotated bibliography) 
org-bibtex-fields)
  (push (cons :keywords Keywords for sorting with ebib) org-bibtex-fields)
  (push (cons :file A local file path used by ebib to open the
  reference in an appropriate application) org-bibtex-fields)
#+end_src

Most of it works fine, but the optional :file field doesn't respect its
argument.  So, the following entry in the Org-mode file:

** Active Documents with Org-mode
   :PROPERTIES:
   :TITLE:Active Documents with Org-mode
   :TYPE: article
   :AUTHOR:   Eric Schulte and Dan Davison
   :JOURNAL:  Computing in Science and Engineering
   :YEAR: 2011
   :VOLUME:   13
   :NUMBER:   3
   :PAGES:2--9
   :MONTH:May/June
   :URL:  http://www.cs.unm.edu/~eschulte/data/CISE-13-3-SciProg.pdf
   :FILE: Schulte-Davison-Babel.pdf
   :CUSTOM_ID: schulte11:_activ_docum_org
   :END:

is exported with org-bibtex like this:

@article{schulte11:_activ_docum_org,
  author =   {Eric Schulte and Dan Davison},
  title ={Active Documents with Org-mode},
  journal =  {Computing in Science and Engineering},
  year = 2011,
  file = {/Users/dk/Public/projects/916-rr/rr.org},
  url =
  {http://www.cs.unm.edu/~eschulte/data/CISE-13-3-SciProg.pdf},
  volume =   13,
  number =   3,
  pages ={2--9},
  month ={May/June}
}

Pressing f in ebib now just takes me back to the Org-mode file, rather
than launching a pdf reader on my local copy of the article.

Any ideas how I can achieve my goal?

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com



[O] possible org to html internal link problem.

2011-08-02 Thread jack song
Dear All,

When I publish html from org. I could not get correct sec link for html
file, although org link worked.

After googling it, I found page below

I think there is a bug in orgmode  where if you use
file:file1::#my_section_link_id it generates incorrect html link, but
correct org link. If you use file:file1::my_section_link_id generates
correct html link, but incorrect org link.

http://stackoverflow.com/questions/4577709/emacs-org-mode-org-to-html-conversion-linking-to-section-in-a-different-page

Please improve the html publish module of orgmode if i am right.

Thanks a lot.

Jack


[O] Gather properties for use by babel source block?

2011-08-02 Thread Tim Burt

I want to gather data from properties into something that can be used by
a babel source block (e.g. plot the data).  Searches in the manual,
worg, and gmane have not yielded the method, but my best guess is that
I've missed it.  If so, this is simply a request for a pointer to the
documentation I should read.

BACKGROUND: I'm trying to complete a workflow where I capture data over
time and periodically operate with it (e.g. put into a database and
plot).  The excellent documentation for orgmode has made certain parts
easy going, but the current obstacle is extracting properties that can
subsequently be operated on in babel source blocks.
 + [X] Capture data into properties using templates
 + [X] View tables of properties in org file
   * [X] use columnview dynamic block
   * [X] use org-collector
 + [ ] Gather properties for use by babel source block
 + [-] Operate on the gathered properties 
   * [-] SQL or SQLite
 - [X] follow simple tutorials for proof of principle
 - [ ] populate database with gathered properties
   * [-] R
 - [X] follow simple tutorials
 - [ ] calculate statistics and populate database
 - [ ] plot from database
 - [ ] plot from table in org file

Good evening,
Tim



Re: [O] Inline tasks in agenda search

2011-08-02 Thread suvayu ali
Hi again,

On Mon, Aug 1, 2011 at 6:49 PM, suvayu ali fatkasuvayu+li...@gmail.com wrote:
 On Mon, Aug 1, 2011 at 5:57 PM, suvayu ali fatkasuvayu+li...@gmail.com 
 wrote:
 Hi Orgers,

 Is there any way to ignore the END entries in inline tasks in agenda
 search results?

 Strangely now this works! Don't know what I changed.


I was mistaken, the problem is still there. The second search simply
didn't have the END entries which I mistakenly thought the problem was
resolved. Let me try to outline the issue clearly again. Lets say I have
this subtree:


** Bs⁰ mass :mass:

Bs⁰ mass is reconstructed for
+ Bs⁰-Dsπ using the π mass hypothesis
+ Bs⁰-DsK using both the K and π mass hypothesis

_Questions_:
*** π hypothesis  :Qn:
Why π hypothesis is considered only for DsK, and why
not K hypothesis for Dsπ?
*** END


Now if I search for the tag mass (C-c a m mass RET), I get a search
result like this:


analysis: Bs⁰ mass  :mass:
analysis: π hypothesis  :mass::Qn:
analysis: END  :mass::


The first 2 results are just what I expect. But the END from the inline
task shows up in the agenda too! Is there anyway to get rid of that?

Thanks a lot for any ideas.

-- 
Suvayu

Open source is the future. It sets us free.