[O] Bug: footnot not recognized during export [8.2.3c (release_8.2.3c-288-g8c9887 @ /Users/kai/.emacs.d/lisp/org-mode/)]

2013-11-25 Thread Kai Tetzlaff
--text follows this line--

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

   http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


The first footnote in this simple org file:

#+BEGIN_EXAMPLE
* Footnote Test

First FOOT_NOTE[fn:1]. And a SECOND[fn:2].

* Footnotes
[fn:1] Footnote 1.
[fn:2] Footnote 2.
#+END_EXAMPLE

is not recognized during export. E.g. ASCII export (C-c C-e t A) in
emacs -Q:

#+BEGIN_EXAMPLE
1 Footnote Test
===

First FOOT_NOTE[fn:1]. And a SECOND[1].

Footnotes
_

[1] Footnote 2.
#+END_EXAMPLE


Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin12.3.0, Carbon Version 1.6.0 
AppKit 1187.37)
of 2013-05-19 on chogori.tetzco.de
Package: Org-mode version 8.2.3c (release_8.2.3c-288-g8c9887 @ 
/Users/kai/.emacs.d/lisp/org-mode/)




Re: [O] Variable publishing-directory?

2011-08-18 Thread Kai Tetzlaff
Bastien b...@altern.org writes:

Hi Bastien,

 The patch looks good but I'd like to understand it better.
 Can you send an example configuration working with your patch?

In org-publish-project-alist, i have HTML publishing projects which
should be published to different target directories depending on e.g.
where emacs is running (which i determine in my init files using the MAC
address of the default GW, the name the machine, ...).

Here is an example: At home, i publish to a local directory
(:publishing-directory ~/tmp/publish-test) but at work i would like to
publish directly to a webserver (:publishing-directory
/plinkx:doxydoc:~/public_html/publish-test - this is on w32, using
tramps PuTTY/plink). To avoid having to change the definition of the
publishing project when i change locations i would like to construct the
actual value of :publishing-directory by calling a function:

 (publishing-dir-test
 :base-directory ~/Documents/Work/RS
 :recursive t
 :base-extension org
 :exclude-tags (intern)
 :publishing-directory '(expand-file-name publish-test 
kt:org-default-publishing-dir)
 :publishing-function org-publish-org-to-html)

Depending on the location i'm in, 'kt:org-default-publishing-dir' would
be set to either ~/tmp or /plinkx:doxydoc:~/public_html. Without the
patch, the example above does not work as the value of
:publishing-directory does not get evaluated.

 Also, please try to send git patch using these conventions:
 http://orgmode.org/worg/org-contribute.html#sec-5

 Thanks a lot!

Thanks for the hint. I've attached a revised version of the patch which
includes a changelog/commit msg - i hope that works for you.

Publish: allow dynamic construction of the publish destination.

* org-publish.el (org-publish-file): Added 'eval'ing the value of the
 :publishing-directory property before using it as destination of the
 publishing project. This allows to construct the publish destination
 directory dynamically at run-time using the return value of a
 function.

TINYCHANGE
---
 lisp/org-publish.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index e2213c5..518c1bf 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -684,7 +684,7 @@ See `org-publish-projects'.
 	 (pub-dir
 	  (file-name-as-directory
 	   (file-truename
-	(or (plist-get project-plist :publishing-directory)
+	(or (eval (plist-get project-plist :publishing-directory))
 		(error Project %s does not have :publishing-directory defined
 		   (car project))
 	 tmp-pub-dir)
-- 
1.7.5.4



Re: [O] Variable publishing-directory? (resent with patch as attachment)

2011-08-18 Thread Kai Tetzlaff
Bastien b...@altern.org writes:

Hi Bastien,

 The patch looks good but I'd like to understand it better.
 Can you send an example configuration working with your patch?

In org-publish-project-alist, i have HTML publishing projects which
should be published to different target directories depending on e.g.
where emacs is running (which i determine in my init files using the MAC
address of the default GW, the name the machine, ...).

Here is an example: At home, i publish to a local directory
(:publishing-directory ~/tmp/publish-test) but at work i would like to
publish directly to a webserver (:publishing-directory
/plinkx:doxydoc:~/public_html/publish-test - this is on w32, using
tramps PuTTY/plink). To avoid having to change the definition of the
publishing project when i change locations i would like to construct the
actual value of :publishing-directory by calling a function:

 (publishing-dir-test
 :base-directory ~/Documents/Work/RS
 :recursive t
 :base-extension org
 :exclude-tags (intern)
 :publishing-directory '(expand-file-name publish-test 
kt:org-default-publishing-dir)
 :publishing-function org-publish-org-to-html)

Depending on the location i'm in, 'kt:org-default-publishing-dir' would
be set to either ~/tmp or /plinkx:doxydoc:~/public_html. Without the
patch, the example above does not work as the value of
:publishing-directory does not get evaluated.

 Also, please try to send git patch using these conventions:
 http://orgmode.org/worg/org-contribute.html#sec-5

 Thanks a lot!

Thanks for the hint. I've attached a revised version of the patch which
includes a changelog/commit msg - i hope that works for you.

Publish: allow dynamic construction of the publish destination.

* org-publish.el (org-publish-file): Added 'eval'ing the value of the
 :publishing-directory property before using it as destination of the
 publishing project. This allows to construct the publish destination
 directory dynamically at run-time using the return value of a
 function.

TINYCHANGE
---
 lisp/org-publish.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index e2213c5..518c1bf 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -684,7 +684,7 @@ See `org-publish-projects'.
 	 (pub-dir
 	  (file-name-as-directory
 	   (file-truename
-	(or (plist-get project-plist :publishing-directory)
+	(or (eval (plist-get project-plist :publishing-directory))
 		(error Project %s does not have :publishing-directory defined
 		   (car project))
 	 tmp-pub-dir)
-- 
1.7.5.4



[O] Variable publishing-directory?

2011-08-15 Thread Kai Tetzlaff

I'm using an org-mode publishing project in different locations and
would like to set different (location dependent) values for the
publishing-directory property (e.g. use different servers to upload
published files).

There might be a way to do that with the current org-mode which i just
did not find. In that case, please let me know how. Otherwise the
attached patch seems to provide the desired effect and it would be great
if it could be added to org-mode.

BR,
Kai

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index ccd2068..4ed2346 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -685,7 +685,7 @@ See `org-publish-projects'.
 	 (pub-dir
 	  (file-name-as-directory
 	   (file-truename
-	(or (plist-get project-plist :publishing-directory)
+	(or (eval (plist-get project-plist :publishing-directory))
 		(error Project %s does not have :publishing-directory defined
 		   (car project))
 	 tmp-pub-dir)


[Orgmode] Bug: relative org file links get exported as href=http:./... instead of href=./... [7.01trans]

2010-09-11 Thread Kai Tetzlaff

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


Since about 1 week (09-03), relative links between org-mode files within the
same publishing project get and additional 'http:' prefix in the href attribute.

Instead of

a href=./ip-on-cmw.html

as in earlier versions the links are now converted to

a href=http:./ip-on-cmw.html

and fail to resolve when browsing the exported files.



Emacs  : GNU Emacs 24.0.50.2 (x86_64-apple-darwin10.4.0, NS 
apple-appkit-1038.32)
 of 2010-09-10 on mack.tetzco.de
Package: Org-mode version 7.01trans

current state:
==
(setq
 org-empty-line-terminates-plain-lists t
 org-log-done 'time
 org-file-apps '((auto-mode . emacs) (\\.x?html?\\' . default) (\\.pdf\\' . 
default)
 (directory dired-other-frame file))
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-link-frame-setup '((vm . vm-visit-folder-other-frame) (gnus . 
gnus-other-frame) (file . find-file-other-frame))
 org-special-ctrl-a/e 'reversed
 org-agenda-clockreport-parameter-plist '(:link nil :maxlevel 4)
 org-agenda-files '(~/.emacs.d/org/agenda)
 org-clock-persist-query-resume nil
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-publish-timestamp-directory ~/.emacs.d/tmp/org-timestamps/
 org-babel-load-languages '((clojure . t) (css . t) (ditaa . t) (dot . t) (C . 
t) (gnuplot . t) (mscgen . t)
(perl . t) (python . t) (R . t) (ruby . t) (sh . t))
 org-hide-leading-stars t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-clock-out-when-done nil
 org-babel-tangle-lang-exts '((ruby . rb) (python . py) (perl . pl) 
(c++ . cpp) (clojure . clj)
  (emacs-lisp . el))
 org-export-ascii-bullets '(42 43 45 126)
 org-clock-history-length 25
 org-agenda-start-with-log-mode t
 outline-minor-mode-prefix 
 org-special-ctrl-k t
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-publish-use-timestamps-flag nil
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-support-shift-select t
 org-clock-in-resume t
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tags-exclude-from-inheritance '(cmm cmn cmr)
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-babel-hide-result-toggle-maybe)
 outline-regexp \\*+ 
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-clock-persist t
 org-startup-indented t
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-M-RET-may-split-line '((default . t) (headline))
 org-default-notes-file ~/.emacs.d/org/notes.org
 org-directory ~/.emacs.d/org/
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-publish-project-alist '((NasTCs-org :base-directory 
~/.emacs.d/org/agenda/STF160 :base-extension org
  :exclude \\(org\\|html\\|css\\) 
:publishing-directory ~/NasTcOverview
  :publishing-function (kt:publish-html 
org-publish-org-to-org) :plain-source t
  :htmlized-source t :link-validation-function 
kt:copy-and-validate-link :title
  NAS Testcase Overview :table-of-contents t 
:section-numbers nil :headline-levels 3
  :sub-superscript nil :todo-keywords t :drawers t 
:tags not-in-toc :timestamps t
  :auto-index nil :exclude-tags (mdesc limpl) 
:style
  link rel=\StyleSheet\ href=\css/nas.css\ 
type=\text/css\)
 (NasTCs-other :base-directory 
~/.emacs.d/org/agenda/STF160 :recursive t
  :no-timestamps t :base-extension css\\|js 
:publishing-directory ~/NasTcOverview
  :publishing-function org-publish-attachment)
 (NasTCs :components (NasTCs-other 
NasTCs-org))
 (UPC :components (UPC-html UPC-HOWTO-other))
 (UPC-HOWTO-other :base-directory 
~/Documents/Work/RS/UPC :recursive t :no-timestamps
  t :base-extension 
xml\\|dtd\\|txt\\|ppt\\|sh\\|conf\\|exe\\|bat :publishing-directory
  ~/UpcOnCmw :publishing-function 
org-publish-attachment)
 (UPC-html :base-directory 
~/Documents/Work/RS/UPC :recursive t :base-extension org
  

Re: [Orgmode] Org-mode version 6.32; org-replace-disputed-keys t - breaks time shifts with S-up/down/left/right

2009-10-28 Thread Kai Tetzlaff
At Wed, 28 Oct 2009 17:55:44 +0100,
Hi Carsten,
 
  Some days ago i noticed that time shifting in CLOCK lines stopped  
  working.
  I've now toggled some org config variables and found that this  
  happens when
  org-replace-disputed-keys is set to t. This was not the case with  
  earlier
  org-mode versions.
 
 What exactly did work, and what does now no longer work?
 
 - Carsten

Since about a week/10d ago i could use S-up/down/left/right to manipulate
dates and timestamps in CLOCK: lines independent of the value of
org-replace-disputed-keys. Now with org-replace-disputed-keys set to t, the
shifted arrow key just start/extend the region (with
pc-selection-mode/shift-select-mode turned on). It's not a big deal to me. I
just noticed a change in how things work.

/Kai

 
 
 
  Emacs  : GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
  of 2009-10-14 on LENNART-69DE564 (patched)
  Package: Org-mode version 6.32
 
  current state:
  ==
  (setq
  org-empty-line-terminates-plain-lists t
  org-log-done 'time
  org-file-apps '((auto-mode . emacs) (\\.x?html?\\' . default) (\ 
  \.pdf\\' . default)
  (directory dired-other-frame file))
  org-link-frame-setup '((vm . vm-visit-folder-other-frame) (gnus .  
  gnus-other-frame)
 (file . find-file-other-frame))
  org-special-ctrl-a/e 'reversed
  org-agenda-clockreport-parameter-plist '(:link nil :maxlevel 4)
  org-agenda-files '(~/.emacs.d/org/agenda)
  org-clock-persist-query-resume nil
  org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
  org-publish-timestamp-directory ~/.emacs.d/tmp/org-timestamps/
  org-export-with-sub-superscripts '{}
  org-hide-leading-stars t
  org-after-todo-state-change-hook '(org-clock-out-if-current)
  org-clock-out-when-done nil
  org-clock-history-length 25
  org-odd-levels-only t
  outline-minor-mode-prefix 
  org-special-ctrl-k t
  org-publish-use-timestamps-flag nil
  org-support-shift-select t
  org-clock-in-resume t
  org-export-preprocess-hook '(org-export-blocks-preprocess)
  org-tags-exclude-from-inheritance '(cmm cmn cmr)
  org-tab-first-hook '(org-hide-block-toggle-maybe)
  outline-regexp \\*+ 
  org-src-mode-hook '(org-src-mode-configure-edit-buffer)
  org-confirm-shell-link-function 'yes-or-no-p
  org-clock-persist t
  org-agenda-before-write-hook '(org-agenda-add-entry-text)
  org-M-RET-may-split-line '((default . t) (headline))
  org-default-notes-file ~/.emacs.d/org/notes.org
  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide- 
  drawers org-cycle-show-empty-lines
   org-optimize-window-after-visibility-change)
  org-publish-project-alist '((NasTCs-org :base-directory  
  ~/.emacs.d/org/agenda/STF160 :base-extension
   org :exclude \\(org\\|html\\|css\ 
  \) :include
   (index.org  
  NasTestcases.org) :publishing-directory ~/NasTcOverview
   :publishing-function (kt:publish-html  
  org-publish-org-to-org) :plain-source t
   :htmlized-source t :link-validation- 
  function kt:copy-and-validate-link :title
   NAS Testcase Overview :style
   link rel=\StyleSheet 
  \\n   href=\css/nas.css 
  \\n   type=\text/css\
   :table-of-contents t :section-numbers  
  nil :headline-levels 3 :sub-superscript
   nil :todo-keywords t :drawers t :tags  
  not-in-toc :timestamps t :auto-index nil
   :exclude-tags (mdesc limpl))
  (NasTCs-other :base-directory  
  ~/.emacs.d/org/agenda/STF160 :recursive t
   :no-timestamps t :base-extension css\\| 
  js :include (.htaccess)
   :publishing-directory ~/ 
  NasTcOverview :publishing-function
   org-publish-attachment)
  (NasTCs :components (NasTCs-other  
  NasTCs-org))
  (CMerge :base-directory ~/.emacs.d/ 
  org/agenda/STF160 :exclude .* :include
   (NasTestcases.org) :publishing- 
  directory ~/NasTcMerge :publishing-function
   (kt:publish-html org-publish-org-to- 
  org) :link-validation-function
   kt:copy-and-validate-link :title Merge/ 
  Align EPS-only/Combined NAS TCs
   :table-of-contents nil :section-numbers  
  nil :headline-levels 3
   :sub-superscript nil :todo-keywords  
  t :drawers (PROPERTIES) :tags nil
   :timestamps nil :auto-index nil :select- 
  tags (cmm cmn cmr) :exclude-tags
   (limpl tci))
  )
  org-mode-hook '(org-clock-load
  #[nil \300\301\302\303\304$\207
   

[Orgmode] Org-mode version 6.32; org-replace-disputed-keys t - breaks time shifts with S-up/down/left/right

2009-10-27 Thread Kai Tetzlaff

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


Some days ago i noticed that time shifting in CLOCK lines stopped working.
I've now toggled some org config variables and found that this happens when
org-replace-disputed-keys is set to t. This was not the case with earlier
org-mode versions.

Emacs  : GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-10-14 on LENNART-69DE564 (patched)
Package: Org-mode version 6.32

current state:
==
(setq
 org-empty-line-terminates-plain-lists t
 org-log-done 'time
 org-file-apps '((auto-mode . emacs) (\\.x?html?\\' . default) (\\.pdf\\' . 
default)
 (directory dired-other-frame file))
 org-link-frame-setup '((vm . vm-visit-folder-other-frame) (gnus . 
gnus-other-frame)
(file . find-file-other-frame))
 org-special-ctrl-a/e 'reversed
 org-agenda-clockreport-parameter-plist '(:link nil :maxlevel 4)
 org-agenda-files '(~/.emacs.d/org/agenda)
 org-clock-persist-query-resume nil
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-publish-timestamp-directory ~/.emacs.d/tmp/org-timestamps/
 org-export-with-sub-superscripts '{}
 org-hide-leading-stars t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-clock-out-when-done nil
 org-clock-history-length 25
 org-odd-levels-only t
 outline-minor-mode-prefix 
 org-special-ctrl-k t
 org-publish-use-timestamps-flag nil
 org-support-shift-select t
 org-clock-in-resume t
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tags-exclude-from-inheritance '(cmm cmn cmr)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 outline-regexp \\*+ 
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-clock-persist t
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-M-RET-may-split-line '((default . t) (headline))
 org-default-notes-file ~/.emacs.d/org/notes.org
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-publish-project-alist '((NasTCs-org :base-directory 
~/.emacs.d/org/agenda/STF160 :base-extension
  org :exclude \\(org\\|html\\|css\\) :include
  (index.org NasTestcases.org) 
:publishing-directory ~/NasTcOverview
  :publishing-function (kt:publish-html 
org-publish-org-to-org) :plain-source t
  :htmlized-source t :link-validation-function 
kt:copy-and-validate-link :title
  NAS Testcase Overview :style
  link rel=\StyleSheet\\n   
href=\css/nas.css\\n   type=\text/css\
  :table-of-contents t :section-numbers nil 
:headline-levels 3 :sub-superscript
  nil :todo-keywords t :drawers t :tags not-in-toc 
:timestamps t :auto-index nil
  :exclude-tags (mdesc limpl))
 (NasTCs-other :base-directory 
~/.emacs.d/org/agenda/STF160 :recursive t
  :no-timestamps t :base-extension css\\|js 
:include (.htaccess)
  :publishing-directory ~/NasTcOverview 
:publishing-function
  org-publish-attachment)
 (NasTCs :components (NasTCs-other 
NasTCs-org))
 (CMerge :base-directory 
~/.emacs.d/org/agenda/STF160 :exclude .* :include
  (NasTestcases.org) :publishing-directory 
~/NasTcMerge :publishing-function
  (kt:publish-html org-publish-org-to-org) 
:link-validation-function
  kt:copy-and-validate-link :title Merge/Align 
EPS-only/Combined NAS TCs
  :table-of-contents nil :section-numbers nil 
:headline-levels 3
  :sub-superscript nil :todo-keywords t :drawers 
(PROPERTIES) :tags nil
  :timestamps nil :auto-index nil :select-tags 
(cmm cmn cmr) :exclude-tags
  (limpl tci))
 )
 org-mode-hook '(org-clock-load
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all 
append local] 5]
 )
 org-clock-out-remove-zero-time-clocks t
 org-refile-targets '((org-agenda-files :maxlevel . 3) (nil :maxlevel . 3))
 org-return-follows-link t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-refile-use-outline-path 'file
 org-log-into-drawer t
 

[Orgmode] Re: Org-mode version 6.31trans; Problem with new 'away time' feature

2009-10-24 Thread Kai Tetzlaff
Carsten Dominik wrote:
 
 On Oct 23, 2009, at 10:20 AM, Kai Tetzlaff wrote:
 
 John Wiegley wrote:
 On Oct 22, 2009, at 6:32 PM, Kai Tetzlaff wrote:

 'Cannot restart clock because task does not contain unfinished clock'

 When i look at the corresponding clock line the previously running
 clock
 has now indeed been stopped (with a time stamp corresponding to the
 current time).

 This is an interesting bug.  It sounds like the point is not being moved
 to the correct location to perform the clock-in.  I'll take a look.

 I did some additional investigation and found that if i'm clocking into
 an item with an unresolved inactive clock from the agenda (created by
 deleting the end time in its most recent CLOCK: line) a similar thing
 happens. I'm actually getting clocked out of the current clock and a new
 CLOCK line gets added which is then the running clock.
 
 I think this is what sould happen, no?
Maybe i wasn't clear. The task i'm clocking in to is the same which has
the unresolved clock. After confirming that all pending time should be
resolved to this same task i would have thought that the unresolved
clock would then just be reactivated. But no problem if that's not how
it works.

 
 The other problem you reported, where I said this is a conflict with
 James' code, should be fixed now.  Please verify.
Yes, it's fixed. Thanks!

 
 - Carsten
 

 Don't know if this helps but stepping through the code in the debugger i
 get to the following code in org-clock-resolve-clock:

 ((eq resolve-to 'now)
 (if restart-p
 (error RESTART-P is not valid here))
 (if (or close-p org-clock-clocking-in)   -- org-close: nil,
 org-clock-clocking-in: t
 (org-clock-clock-out clock fail-quietly) -- clock-out done here
   (unless (org-is-active-clock clock)
 (org-clock-clock-in clock t



 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode
 
 - Carsten
 
 
 
 
 
 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode
 



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [PATCH] Avoid losing persisted clock data when exiting emac without loading org-mode

2009-10-24 Thread Kai Tetzlaff
Carsten Dominik wrote:
 Hi Kai,
 
 
 On Oct 23, 2009, at 9:01 AM, Kai Tetzlaff wrote:
 
 Hi,

 i noticed that when using the org-mode clock persistence, the stored
 clock data gets deleted when i start emacs and exit again without
 turning on org-mode in between.

 When looking at org-clock-persistence-insinuate it looks like org-clock
 load will only run after org-mode gets started whereas org-clock-save
 will always be called when exiting emacs:

 (defun org-clock-persistence-insinuate ()
  Set up hooks for clock persistence
  (add-hook 'org-mode-hook 'org-clock-load)
  (add-hook 'kill-emacs-hook 'org-clock-save))

 Not running org-mode-hook (i.e. not starting org-mode) thus does not
 load clock data but org-clock-save overwrites any prviously saved data
 when exiting emacs.

 An easy fix for that would be to just add org-clock-load to e.g.
 emacs-startup-hook. But this will only work if the code in
 org-clock-load does not depend on any org-mode initialization code (or
 would require loading org-mode).

 So org-clock-save should probably check if org-clock-load has been
 running during the current emacs session (or if clock persistence was
 just enabled) and only then save clock data when exiting emacs. I tried
 to add this to the code in org-clock-save:

 diff --git a/lisp/org-clock.el b/lisp/org-clock.el
 index c7ebbf8..c0fe4e6 100644
 --- a/lisp/org-clock.el
 +++ b/lisp/org-clock.el
 @@ -1803,7 +1803,8 @@ This function is made for clock tables.
   Persist various clock-related data to disk.
 The details of what will be saved are regulated by the variable
 `org-clock-persist'.
 -  (when org-clock-persist
 +  (when (and org-clock-persist
 + (or org-clock-loaded (not (file-exists-p
 org-clock-persist-file
 (let (b)
   (with-current-buffer (find-file (expand-file-name
 org-clock-persist-file))
 (progn


 /Kai

 diff --git a/lisp/org-clock.el b/lisp/org-clock.el
 index c7ebbf8..c0fe4e6 100644
 --- a/lisp/org-clock.el
 +++ b/lisp/org-clock.el
 @@ -1803,7 +1803,8 @@ This function is made for clock tables.
   Persist various clock-related data to disk.
 The details of what will be saved are regulated by the variable
 `org-clock-persist'.
 -  (when org-clock-persist
 +  (when (and org-clock-persist
 + (or org-clock-loaded (not (file-exists-p
 org-clock-persist-file
 (let (b)
   (with-current-buffer (find-file (expand-file-name
 org-clock-persist-file))
 (progn
 
 
 I see you point, but I am not convinced that you fix is the right one. 
 What one really wants to do is save the clock and history if and only if
 the clock has been used in the current session.  So I guess it is better
 to create a special variable org-clock-used-in-this-session which then
 will be set to t each time clock-in starts a clock somewhere.  I believe
 this would be a better insurance policy.
You're right - this would be even better.

 Would you like to try your hand at a patch in this spirit?

I've just started to play with emacs lisp. But this sounds like
something not too difficult. So thanks for the offer :-), i'm going to
give it a try ...

 - Carsten
 
 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode
 
 - Carsten
 
 
 
 



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [PATCH] Avoid losing persisted clock data when exiting emac without loading org-mode

2009-10-24 Thread Kai Tetzlaff
Carsten Dominik wrote:
 Hi Kai,
 
 
 On Oct 23, 2009, at 9:01 AM, Kai Tetzlaff wrote:
 
 Hi,

 i noticed that when using the org-mode clock persistence, the stored
 clock data gets deleted when i start emacs and exit again without
 turning on org-mode in between.

 When looking at org-clock-persistence-insinuate it looks like org-clock
 load will only run after org-mode gets started whereas org-clock-save
 will always be called when exiting emacs:

 (defun org-clock-persistence-insinuate ()
  Set up hooks for clock persistence
  (add-hook 'org-mode-hook 'org-clock-load)
  (add-hook 'kill-emacs-hook 'org-clock-save))

 Not running org-mode-hook (i.e. not starting org-mode) thus does not
 load clock data but org-clock-save overwrites any prviously saved data
 when exiting emacs.

 An easy fix for that would be to just add org-clock-load to e.g.
 emacs-startup-hook. But this will only work if the code in
 org-clock-load does not depend on any org-mode initialization code (or
 would require loading org-mode).

 So org-clock-save should probably check if org-clock-load has been
 running during the current emacs session (or if clock persistence was
 just enabled) and only then save clock data when exiting emacs. I tried
 to add this to the code in org-clock-save:

 diff --git a/lisp/org-clock.el b/lisp/org-clock.el
 index c7ebbf8..c0fe4e6 100644
 --- a/lisp/org-clock.el
 +++ b/lisp/org-clock.el
 @@ -1803,7 +1803,8 @@ This function is made for clock tables.
   Persist various clock-related data to disk.
 The details of what will be saved are regulated by the variable
 `org-clock-persist'.
 -  (when org-clock-persist
 +  (when (and org-clock-persist
 + (or org-clock-loaded (not (file-exists-p
 org-clock-persist-file
 (let (b)
   (with-current-buffer (find-file (expand-file-name
 org-clock-persist-file))
 (progn


 /Kai

 
 I see you point, but I am not convinced that you fix is the right one. 
 What one really wants to do is save the clock and history if and only if
 the clock has been used in the current session.  So I guess it is better
 to create a special variable org-clock-used-in-this-session which then
 will be set to t each time clock-in starts a clock somewhere.  I believe
 this would be a better insurance policy.

 Would you like to try your hand at a patch in this spirit?

Ok, i've attached a new path which uses the suggested approach. I wasn't
exactly sure about where to set org-clock-used-in-this-session to t.
It's now done right at the end of org-clock-in, just before running
hooks in org-clock-in-hook.

I've done a couple of (simple) tests and it works fine for me.

/Kai

 - Carsten
 
 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode
 
 - Carsten
 
 
 
 


diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index b1041e2..467ffc4 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -244,6 +244,7 @@ to add an effort property.)
 (defvar org-clock-heading )
 (defvar org-clock-heading-for-remember )
 (defvar org-clock-start-time )
+(defvar org-clock-used-in-this-session nil)
 
 (defvar org-clock-left-over-time nil
   If non-nil, user cancelled a clock; this is when leftover time started.)
@@ -953,6 +954,7 @@ the clocking selection, associated with the letter `d'.
(setq org-clock-idle-timer
  (run-with-timer 60 60 'org-resolve-clocks-if-idle))
(message Clock starts at %s - %s ts msg-extra)
+(setq org-clock-used-in-this-session t)
(run-hooks 'org-clock-in-hook)))
 
 (defun org-clock-mark-default-task ()
@@ -1824,7 +1826,7 @@ This function is made for clock tables.
   Persist various clock-related data to disk.
 The details of what will be saved are regulated by the variable
 `org-clock-persist'.
-  (when org-clock-persist
+  (when (and org-clock-persist org-clock-used-in-this-session)
 (let (b)
   (with-current-buffer (find-file (expand-file-name 
org-clock-persist-file))
(progn
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [PATCH] Avoid losing persisted clock data when exiting emac without loading org-mode

2009-10-23 Thread Kai Tetzlaff
Hi,

i noticed that when using the org-mode clock persistence, the stored
clock data gets deleted when i start emacs and exit again without
turning on org-mode in between.

When looking at org-clock-persistence-insinuate it looks like org-clock
load will only run after org-mode gets started whereas org-clock-save
will always be called when exiting emacs:

(defun org-clock-persistence-insinuate ()
  Set up hooks for clock persistence
  (add-hook 'org-mode-hook 'org-clock-load)
  (add-hook 'kill-emacs-hook 'org-clock-save))

Not running org-mode-hook (i.e. not starting org-mode) thus does not
load clock data but org-clock-save overwrites any prviously saved data
when exiting emacs.

An easy fix for that would be to just add org-clock-load to e.g.
emacs-startup-hook. But this will only work if the code in
org-clock-load does not depend on any org-mode initialization code (or
would require loading org-mode).

So org-clock-save should probably check if org-clock-load has been
running during the current emacs session (or if clock persistence was
just enabled) and only then save clock data when exiting emacs. I tried
to add this to the code in org-clock-save:

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c7ebbf8..c0fe4e6 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1803,7 +1803,8 @@ This function is made for clock tables.
   Persist various clock-related data to disk.
 The details of what will be saved are regulated by the variable
 `org-clock-persist'.
-  (when org-clock-persist
+  (when (and org-clock-persist
+ (or org-clock-loaded (not (file-exists-p
org-clock-persist-file
 (let (b)
   (with-current-buffer (find-file (expand-file-name
org-clock-persist-file))
(progn


/Kai

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c7ebbf8..c0fe4e6 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1803,7 +1803,8 @@ This function is made for clock tables.
   Persist various clock-related data to disk.
 The details of what will be saved are regulated by the variable
 `org-clock-persist'.
-  (when org-clock-persist
+  (when (and org-clock-persist
+ (or org-clock-loaded (not (file-exists-p 
org-clock-persist-file
 (let (b)
   (with-current-buffer (find-file (expand-file-name 
org-clock-persist-file))
(progn
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Org-mode version 6.31trans; Problem with new 'away time' feature

2009-10-23 Thread Kai Tetzlaff
John Wiegley wrote:
 On Oct 22, 2009, at 6:32 PM, Kai Tetzlaff wrote:
 
 'Cannot restart clock because task does not contain unfinished clock'

 When i look at the corresponding clock line the previously running clock
 has now indeed been stopped (with a time stamp corresponding to the
 current time).
 
 This is an interesting bug.  It sounds like the point is not being moved
 to the correct location to perform the clock-in.  I'll take a look. 

I did some additional investigation and found that if i'm clocking into
an item with an unresolved inactive clock from the agenda (created by
deleting the end time in its most recent CLOCK: line) a similar thing
happens. I'm actually getting clocked out of the current clock and a new
CLOCK line gets added which is then the running clock.

Don't know if this helps but stepping through the code in the debugger i
get to the following code in org-clock-resolve-clock:

((eq resolve-to 'now)
 (if restart-p
 (error RESTART-P is not valid here))
 (if (or close-p org-clock-clocking-in)   -- org-close: nil,
org-clock-clocking-in: t
 (org-clock-clock-out clock fail-quietly) -- clock-out done here
   (unless (org-is-active-clock clock)
 (org-clock-clock-in clock t



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Org-mode version 6.31trans; Problem with new 'away time' feature

2009-10-22 Thread Kai Tetzlaff
Hi,

since the new resolve 'away time' feature has been integrated i'm having
problems when restarting emacs after exiting with a running clock. When
i'm starting org-mode after the emacs restart by entering agenda mode i
get the new prompt which is asking about how to deal with the unresolved
clock time. I'm confirming the prompt with 'k' to keep (and clocking in
again on) the previous task. I also confirm that the complete open time
should be used for the current task. But then what happens is that
org-mode complains that there are no unfinished clocks:

'Cannot restart clock because task does not contain unfinished clock'

When i look at the corresponding clock line the previously running clock
has now indeed been stopped (with a time stamp corresponding to the
current time).

Below is a *Message* buffer transcript of the output i get during emacs
startup when i have an open clock in one of my org files.

BR,
Kai

Press key for agenda command:
OVERVIEW
Restoring clock data
Loading c:/kt/.org-clock-save.el (source)...done
OVERVIEW
CONTENTS...done
Loading vc-hg...done
OVERVIEW
Clock stopped at [2009-10-22 Do 11:03] after HH:MM = 0:18
Cannot restart clock because task does not contain unfinished clock
OVERVIEW [2 times]
CONTENTS...done
OVERVIEW [4 times]
CONTENTS...done
OVERVIEW [2 times]
CONTENTS...done
Rebuilding agenda buffer...done
Log mode is on
Saving file c:/kt/.emacs.d/org/agenda/prg_wp.org...
Mark set
Replaced 0 occurrences
Wrote c:/kt/.emacs.d/org/agenda/prg_wp.org
Rebuilding agenda buffer...done
Clock stopped at [2009-10-22 Do 11:03] after HH:MM = 0:18
Clock starts at [2009-10-22 Do 11:03] - showing entire task time.

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.




Emacs  : GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-10-14 on LENNART-69DE564 (patched)
Package: Org-mode version 6.31trans

current state:
==
(setq
 org-empty-line-terminates-plain-lists t
 org-log-done 'time
 org-file-apps '((auto-mode . emacs) (\\.x?html?\\' . default)
(\\.pdf\\' . default)
 (directory dired-other-frame file))
 org-link-frame-setup '((vm . vm-visit-folder-other-frame) (gnus .
gnus-other-frame) (file . find-file-other-frame))
 org-special-ctrl-a/e 'reversed
 org-agenda-clockreport-parameter-plist '(:link nil :maxlevel 4)
 org-agenda-files '(~/.emacs.d/org/agenda)
 org-clock-persist-query-resume nil
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-publish-timestamp-directory ~/.emacs.d/tmp/org-timestamps/
 org-export-with-sub-superscripts '{}
 org-hide-leading-stars t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-clock-out-when-done nil
 org-clock-history-length 25
 org-odd-levels-only t
 org-special-ctrl-k t
 org-publish-use-timestamps-flag nil
 org-support-shift-select t
 org-clock-in-resume t
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tags-exclude-from-inheritance '(cmm cmn cmr)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-clock-persist t
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-M-RET-may-split-line '((default . t) (headline))
 org-default-notes-file ~/.emacs.d/org/notes.org
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-hide-drawers org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-publish-project-alist '((NasTCs-org :base-directory
~/.emacs.d/org/agenda/STF160 :base-extension org
  :exclude \\(org\\|html\\|css\\) :include 
(index.org
NasTestcases.org)
  :publishing-directory ~/NasTcOverview 
:publishing-function
  (kt:publish-html org-publish-org-to-org) 
:plain-source t
:htmlized-source t
  :link-validation-function 
kt:copy-and-validate-link :title NAS
Testcase Overview
  :style
  link rel=\StyleSheet\\n
href=\css/nas.css\\n   type=\text/css\
  :table-of-contents t :section-numbers nil 
:headline-levels 3
:sub-superscript nil
  :todo-keywords t :drawers t :tags not-in-toc 
:timestamps t
:auto-index nil :exclude-tags
  (mdesc limpl))
 (NasTCs-other :base-directory 
~/.emacs.d/org/agenda/STF160
:recursive t
  :no-timestamps t :base-extension css\\|js 
:include
(.htaccess) :publishing-directory
  ~/NasTcOverview :publishing-function 
org-publish-attachment)