Re: [O] xml statement in html and apache error

2011-04-07 Thread Richard Riley
Nick Dokos  writes:

> Richard Riley  wrote:
>
>> 
>> I cant really give too many details or suggestions as to why it failed,
>> but the default xml string at the top of export to html files was
>> causing apache to fail.
>> 
>> ,
>> | Parse error: syntax error, unexpected T_STRING in
>> | /home/shamrock/common-files/webs/richardriley.net/projects/emacs/index.html
>> | on line 1
>> `
>> 
>> I simply removed the html xml declaration,
>> 
>> ,
>> | org-export-html-xml-declaration is a variable defined in `org-html.el'.
>> | Its value is 
>> | (("php" . ""))
>> `
>> 
>
> This looks wrong (even though unrelated to the problem): in my setup I get
>
>

You're right. Was late at night. I pasted the wrong value. The working value
is

,
| org-export-html-xml-declaration is a variable defined in `org-html.el'.
| Its value is 
| (("php" . "\"; 
?>"))
`

That other value was in my scratch buffer from trying to debug the
situation. Note, I dont export to php, only html (currently).

>
> org-export-html-xml-declaration is a variable defined in `org-html.el'.
> Its value is
> (("html" . "")
>  ("php" . "\"; 
> ?>"))
>
>
>
> so deleting the html entry should leave you with the second line. You seem
> to have a mash of the two entries instead.
>

Sorry! Mea culpa there in my "bug report".

>> reexported my private little web, reloaded apache and all was
>> well. Which was cool considering I hadnt exported it from the org data
>> for all of about 2 years!
>> 
>> Far from thought out, almost certainly not "correct" I am sure, but got
>> my web back working.
>> 
>> Possibly someone else can comment on cause/effect.
>> 
>
> Well, I exported a toy project and despite the presence of the xml headers,
> my apache is not complaining at all. I also spot-checked a couple of files
> on orgmode.org and they have the xml header, but apache seems to deliver
> them without a problem. Which version of apache are you running? Mine is
> 2.2.16.

Two machines, both with Debian Squeeze.

,
| Server version: Apache/2.2.16 (Debian)
| Server built:   Mar 22 2011 20:56:31
`

>
> Nick
>
> PS. The exercise also uncovered an org bug but I'll post that as a
> separate message.
>

Let me re-run the scenario and check my publish parameters - its really
been a LONG time since I published but something changed with
apache. Both machines are relatively new installs. Possibly something
third party needs to be instaled on squeeze now to get xml statements
parsed? A google was not so helpful.

Thanks for the prompt reply.

r.



[O] Re: Using orgmode to take "inline notes" for research

2011-04-07 Thread Sébastien Vauban
Hi Jeff,

Jeff Horn wrote:
> No problem. As a note for others searching on this, I'll just go ahead and
> re-iterate that if you don't want a particular inline-task to be printed,
> just add the :noexport: tag to the headline.

Better to say it twice!

> Sebastian, or others: One is able to add properties to inline-style
> headlines correct? John could add an HTML container class property and use a
> stylesheet to play with HTML export, including "indentation", but I don't
> know if there is any equivalent help from the LaTeX exporter.

This is my current config for nice styling:

#+begin_src emacs-lisp
  ;; initial state (TODO keyword) of inline tasks
  (setq org-inlinetask-default-state "TODO")

  ;; templates for inline tasks in various exporters
  (setq org-inlinetask-export-templates
'((html "%s%s%s"
'((unless (eq todo "")
(format "%s%s "
class todo todo priority))
  heading content))
  (latex "\\todo[inline]{\\textbf{\\textsf{%s %s}}\\linebreak{} %s}"
 '((unless (eq todo "")
 (format "\\textsc{%s%s}" todo priority))
   heading content))
  (ascii " -- %s%s%s"
 '((unless (eq todo "")
 (format "%s%s " todo priority))
   heading
   (unless (eq content "")
 (format "\n ¦ %s"
 (mapconcat 'identity
(org-split-string content "\n")
"\n ¦ ")))
#+end_src

Customize to your own taste (and report back!)...

Best regards,
  Seb

-- 
Sébastien Vauban




[O] Bug: while cycling in properties [7.5 commit-4168fccdc7eab648d9c4517afe56765aaa1e9664]

2011-04-07 Thread Giovanni Ridolfi

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.3.1 (i386-mingw-nt5.1.2600)  of 2011-03-10 on 3249CTO
Package: Org-mode version 7.5 commit-4168fccdc7eab648d9c4517afe56765aaa1e9664

Hello everyone,

When cycling the values of a property in a :PROPERTIES: drawer with
  Shift-"arrow right" 

AND the property is *not* in the first column

the property is changed, *BUT* the cursor goes 
to (next-line 1) :-(

It used to work in the version of 31-03 07:28, 
that should be 

commit b8fdddcd9cba913478a084bfaf1e6372a5e8670e

but I can't be sure of number of commit :-(

- test file -
* first heading
:PROPERTIES: 
:ID: lab
   :Type_ALL: unexpected expected planned whoknows "hello world"
:END:
** test that works, cycle
:PROPERTIES: 
:ID: lab
:Type: unexpected 
:END:
*** test that DOES NOT work  :-(
:PROPERTIES: 
:ID: lab
:Type: unexpected 
:END:


Cheers,
Giovanni

current state:
==
(setq
 org-log-done 'time
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-agenda-files '("
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-babel-load-languages '((gnuplot . t) (emacs-lisp . t))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-capture-templates '(
 )
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-finalize-agenda-hook '(my-org-agenda-to-appt)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook 
'(org-remove-file-link-modifiers)
 org-mode-hook '((lambda nil
  (org-add-hook (quote change-major-mode-hook) (quote 
org-show-block-all) (quote append)
   (quote local))
  )
 (lambda nil
  (org-add-hook (quote change-major-mode-hook) (quote 
org-babel-show-result-all) (quote append)
   (quote local))
  )
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src 
org-babel-exp-inline-src-blocks))
 org-enforce-todo-dependencies t
 org-occur-hook '(org-first-headline-recenter)
 org-from-is-user-regexp nil
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc 
org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil) (comment 
org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil) (dot 
org-export-blocks-format-dot nil))
 )



[O] Custom agenda view for specific time intervals

2011-04-07 Thread Konrad Hinsen
Is there a way to create custom agenda views for specific time intervals, such 
as "May 2011" or "the month following the current month"? Interactively, I can 
create such a view using org-agenda-month-view, but I need to formulate this as 
a custom view to feed to mobile-org.

Konrad.




Re: [O] Bug: :clock-keep...not kept [7.5 commit-078c01bf3b1742b1015fac9f5bab3a429505f3c6]

2011-04-07 Thread Giovanni Ridolfi
Hello everyone,

I think I found a bug with the option ":clock-keep"

:clock-keep'
  Keep the clock running when filing the captured entry.

Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600)  of 2011-03-10 on 3249CTO
Package: Org-mode version 7.5 commit-4168fccdc7eab648d9c4517afe56765aaa1e9664

The option was introduced on 2011-03-07, by Bastien,
in commit:

b969081ebd0da2711f1006fec39e04fe4a90ef71  : org-capture.el: 
   new :no-clock-out template option.

and, after Carsten chimed in, message:
http://article.gmane.org/gmane.emacs.orgmode/38951
Bastien:
> See my previous message -- I used :no-clock-out to stick to the default
> behavior and avoid users to have to change their config.  Let me know if
> this is okay for you!

I like this decision, because of the templates is asked to clock
in, it seems natural for me that it will clock out when it is done.

This only suggestion I would have is it maybe call the property
:clock-keep-running.  No sure though.
--

in commit  

54c638523d4706d955c9d16cb5f499bcfa92bec9   : org-capture.el: 
  Rename :no-clock-out to :clock-keep.

The thread with the complete discussion is here:

http://thread.gmane.org/gmane.emacs.orgmode/38485

I tried to look at the code to understand it, but it is beyond my skills.

On the other hand I did some tests:
** set up  - beware I'm under Windows. 
   (for Bernt's set up (linuxish) please refer to message
   http://thread.gmane.org/gmane.emacs.orgmode/38485)

My minimal.emacs
--8<---cut here---start->8--
(add-to-list 'load-path (expand-file-name "c:/Documents and 
Settings/my-path/org/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org-install)

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)

(global-set-key "\C-cc" 'org-capture)

(setq org-capture-templates (quote (("t" "todo" entry (file "c:/Documents and 
Settings/my-path/a.org") "* TODO %?
%U
%a
" :immediate-finish t :clock-in t :clock-keep t  
--8<---cut here---end--->8---

I run emacs with:

c:\path\>  emacs -q -l ~/minimal.emacs 

C-c c tto call the template.  
   Fill it in and 
C-c C-cto close.

I have modified the properties in the last row:

** if :immediate-finish nil :clock-in t :clock-keep t
   the clock in clocks-in
BUT the clock is not kept, it is closed anyway. 

**without immediate-finish
** if  :clock-in t :clock-keep t
the clock in clocks-in
BUT the clock is not kept, it is closed anyway. 


cheers,
Giovanni

P.S. Side effect (very emacsish).

While testing I found an unexpected behaviour with :clock-resume

** if :immediate-finish t :clock-in t :clock-resume t
*** and If there is no clock to be resumed the clock-in does not
clock-in in the capture buffer.
Is this  a bug?
Shall be thrown a message: "No clock to be resumed"?

*** If there is clock to be resumed
the clock is resumed. It works.



[O] Re: export org file to html from command-line

2011-04-07 Thread Sean Davis
On Thu, Apr 7, 2011 at 1:12 AM, Jambunathan K  wrote:
> Sean Davis  writes:
>
>> I would like to have a way to export a file to html from the
>> command-line
>
> ,[ C-h f org-export-as-html-batch RET ]
> | org-export-as-html-batch is a compiled Lisp function in `org-html.el'.
> |
> | (org-export-as-html-batch)
> |
> | Call the function `org-export-as-html'.
> | This function can be used in batch processing as:
> | emacs   --batch
> |         --load=$HOME/lib/emacs/org.el
> |         --eval "(setq org-export-headline-levels 2)"
> |         --visit=MyFile --funcall org-export-as-html-batch
> |
> | [back]
> `

Here what I ended up doing:

/Applications/Aquamacs.app/Contents/MacOS/Aquamacs -nw --batch --eval
"(setq aquamacs-version 2)" --visit=biowulf-2011.org
--funcall=org-export-as-html

It also works fine with other exports.  Both "org-export-as-html" and
"org-export-as-pdf" work just fine.  Finally, I need to sort out the
details, but aquamacs needed to have aquamacs-version set in order to
run this in batch mode (hence, the (setq aquamacs-version 2) eval).

Thanks for the pointer to get things started.

Sean



[O] Re: Using orgmode to take "inline notes" for research

2011-04-07 Thread Nicolas Goaziou
Hello,

Jeff Horn  writes:

> AFAIK, "inline-tasks" don't have to have headlines. For instance:
>
> ,[ org-inlinetask example ]
> | *** NOTES
> | Test note with a headline word.
> | *** END
> |
> | ***
> | Test note with blank headline.
> | *** END
> `
>
> exports to ASCII as:
>
> ,[ ASCII export ]
> |  -- NOTES
> |  ¦ Test note with a headline word.
> |
> |  --
> |  ¦ Test note with blank headline.
> `

Some regexps used in org-inlinetask.el require a space and something
after the stars. It _may_ work without them, but I think that's asking
for trouble.

Regards,

-- 
Nicolas Goaziou



[O] Re: [PATCH] Problem with html export of description list items

2011-04-07 Thread Nicolas Goaziou
Hello,

Ethan Ligon  writes:

> Ethan Ligon  are.berkeley.edu> writes:
>> 
>> I've just stumbled across what I regard as a bug in the html export of
>> description list items.
>> 
>> The problem has to do with whether the specification of a description
>> list includes a trailing space or not; i.e., whether "- Item ::" is
>> treated the same way as "- Item :: ".  LaTeX export treats these as
>> identical.  Html export gets confused about what the description list
>> item is, and winds up generating a "???" for the description.

LaTeX exporter doesn't treats these as identical. What happens is that
in your example, the first item is correct and the list is thus set as
a description list. As such, LaTeX exporter tries hard to fill
description terms for every item in the list. If you exchange the first
and second items in your example, the list will be exported as
a standard itemize list in LaTeX.

For HTML (and DocBook) exporter, this is a little different, and term
recognition is hard-coded there. I will modify that.

> Having done the work to describe the problem, it wasn't hard to find a
> solution.  In this case that's a one character change to a regexp in
> org-html.el. 
>
> Here's the patch:
>
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index d19d88b..005a0f7 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -2501,7 +2501,7 @@ the alist of previous items."
> (concat "[ \t]*\\(\\S-+[ \t]*\\)"
>"\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\]\\)?"
>"\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?"
> -  "\\(?:\\(.*\\)[ \t]+::[ \t]+\\)?"
> +  "\\(?:\\(.*\\)[ \t]+::[ \t]*\\)?"
>"\\(.*\\)") line)
>(let* ((checkbox (match-string 3 line))
>  (desc-tag (or (match-string 4 line) "???"))

Your patch allows items like:

- term ::description

which are not valid for a description list.

Regards,

-- 
Nicolas Goaziou



SOLVED Re: [O] Bug: while cycling in properties [7.5 commit-4168fcc]

2011-04-07 Thread Giovanni Ridolfi
Giovanni Ridolfi  writes:
>
> Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600)  of 2011-03-10 on 3249CTO
> Package: Org-mode version 7.5 commit-4168fccdc7eab648d9c4517afe56765aaa1e9664
>
> When cycling the values of a property in a :PROPERTIES: drawer with
>   Shift-"arrow right" 
> AND the property is *not* in the first column
> the property is changed, *BUT* the cursor goes 
> to (next-line 1) :-(

I was wrong. 

Restarting emacs fixed this. 

Sorry for the noise.
Giovanni



Re: [O] xml statement in html and apache error

2011-04-07 Thread Nick Dokos
Richard Riley  wrote:

> 
> Two machines, both with Debian Squeeze.
> 
> ,
> | Server version: Apache/2.2.16 (Debian)
> | Server built:   Mar 22 2011 20:56:31
> `
> 
> >
> > Nick
> >
> > PS. The exercise also uncovered an org bug but I'll post that as a
> > separate message.
> >
> 
> Let me re-run the scenario and check my publish parameters - its really
> been a LONG time since I published but something changed with
> apache. Both machines are relatively new installs. Possibly something
> third party needs to be instaled on squeeze now to get xml statements
> parsed? A google was not so helpful.
> 

You may be right: I load modxslt on my apache - forgot about that. Not
sure whether the orgmode.org apache uses that as well. If I find some
time, I'll try without it.

Nick



[O] Bug: EOL needs to be converted to Unix for MobileOrg files [7.5 (release_7.5.147.g9ddc)]

2011-04-07 Thread Charles Sebold
Second attempt to send this patch.

I primarily use Org-mode on Windows, and my org files mostly have DOS
line endings.  A while back a patch from me was accepted to convert the
checksum file to Unix EOLs (and Richard updated the iOS app to be
agnostic about it, I think, at the same time), which saved a lot of
syncing because the checksum file never looked right to MobileOrg.

However, the files themselves are irritating because they appear to have
double line feeds when they are viewed on the iOS device, and edits from
MobileOrg never sync because stray ^Ms creep in.

This patch makes all files pushed to MobileOrg into Unix files as far as
line endings go.

It's not a very elegant solution and my feelings won't be hurt if a
better way is proposed.

Emacs  : GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-04-05 on CT-SEBOLDCR-T4C
Package: Org-mode version 7.5 (release_7.5.147.g9ddc)
Changes in master
	Modified lisp/org-mobile.el
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 83462f0..fa1d4f4 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -472,6 +472,12 @@ agenda view showing the flagged items."
    target-file)
   (org-mobile-cleanup-encryption-tempfile
 
+(defun org-mobile-copy-file (file newname)
+  "Copy file, converting to Unix line endings."
+  (with-temp-file newname
+(set-buffer-file-coding-system 'undecided-unix nil)
+(insert-file-contents file)))
+
 (defun org-mobile-copy-agenda-files ()
   "Copy all agenda files to the stage or WebDAV directory."
   (let ((files-alist org-mobile-files-alist)
@@ -485,7 +491,7 @@ agenda view showing the flagged items."
 	  (make-directory target-dir 'parents))
 	(if org-mobile-use-encryption
 	(org-mobile-encrypt-and-move file target-path)
-	  (copy-file file target-path 'ok-if-exists))
+	  (org-mobile-copy-file file target-path))
 	(setq check (shell-command-to-string
 		 (concat org-mobile-checksum-binary " "
 			 (shell-quote-argument (expand-file-name file)
@@ -710,12 +716,15 @@ encryption program does not understand them."
 
 (defun org-mobile-encrypt-file (infile outfile)
   "Encrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."
-  (shell-command
-   (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s"
-	   (shell-quote-argument (concat "pass:"
-	 (org-mobile-encryption-password)))
-	   (shell-quote-argument (expand-file-name infile))
-	   (shell-quote-argument (expand-file-name outfile)
+  (let ((tempfile (make-temp-file "orgmobile")))
+(org-mobile-copy-file infile tempfile)
+(shell-command
+ (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s"
+	 (shell-quote-argument (concat "pass:"
+	   (org-mobile-encryption-password)))
+	 (shell-quote-argument (expand-file-name tempfile))
+	 (shell-quote-argument (expand-file-name outfile
+(delete-file tempfile)))
 
 (defun org-mobile-decrypt-file (infile outfile)
   "Decrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."



Re: [O] Bug: datetree capture from agenda [7.5 (release_7.5.135.g7021f.dirty)]

2011-04-07 Thread Carsten Dominik

On 6.4.2011, at 12:50, Philip Rooke wrote:

> Carsten Dominik  writes:
> 
> Thanks Carsten,
> 
>> I can see that it might be nice to simply add some text
>> under the date headline in a date tree, in order to build
>> up a long journal entry from little snippets.
> 
> Yes, this is exactly what I do over the course of the day and I find it
> very useful.  The trouble I run into is that, all too often, I forget or
> don't have time to add an entry on the day the noteworthy event
> happened.  I use the agenda capture action (k c) in this situation since
> the date I am on in the agenda is picked up automatically by the
> template and the right date headline is created at the right place in
> the journal.  Currently I have to then cut/paste the note, which is the
> bit I was trying to avoid.
> 
>> However, you are trying to *mix* headline entries and plain entries
>> under the same date node in the tree, and this seems to be impossible.
> 
> Sorry, my fault, the full version of journal template I currently use
> ends up creating entries like:
> 
> *** 2011-04-06 Wednesday
> 
>Try and clarify journal/note taking use case for Carsten
>[2011-04-06 Wed 10:03]
> 
>Apologise for confusing Carsten as I don't actually use headline
>entries in the journal, plain only
>[2011-04-06 Wed 10:05]

This has kept me thinking.  I think it should be possible
to add plain text templates to a node target, and now I think I
know how to do this in a way that allows mixing with headlined
templates.  I am just adding plain text stuff to the text before
the first the first child, and entry-types as a child *after* this
initial text, however long it may be.

There are still good reasons so use the setup we have
constructed the other day, i.e. using only headlined snippets
for the journal.  One reason to use this is that you then
have structure editing at your disposal to reorganize
the journal.  For example if you have added something to
a past date, then you can go in and easily move that new
entry to the "right" position in the journal node, so
that the sequence of events during that day is
reflected correctly.

However, is you want, you can now use plain templates and point
them at a date tree or any other Org node, and get what you expect.
Here is an example:

(setq org-capture-templates
 '(("h" "Journal headline" entry (file+datetree "/tmp/journal.org"))
   ("n" "Journal note" plain (file+datetree "/tmp/journal.org")
"%<%H:%M> %?" :empty-lines 1)))

Thanks for finding this inconsistency, Philip.

- Carsten


> 
>> Wouldn't a better strategy be to have the "plain" section be started with a 
>> time,
> 
> Well, as you see above I actually do like to have the time of the entry,
> but the only way I thought I could do that was using the %U keyword in
> the template (which is clumsy as it then duplicates the date/day).
> 
>> 
>> (the %<%H:%M> requires the current git release...)
> 
> ... which, coincidently, seems to have appeared this morning :-)
> 
> That means I can use something like:
> 
> (setq org-capture-templates
>  '(("e" "Journal entry" entry (file+datetree "/tmp/journal.org")
> "* %<%H:%M>\n  %?")
>("l" "Journal late entry" entry (file+datetree "/tmp/journal.org")
> "* Retrospectively added %<%Y-%m-%d %H:%M>\n  %?")))
> 
> Used from an agenda action the retrospective date headline/notes are
> created and filed in the right place, giving something like:
> 
> * 2011
> ** 2011-04 April
> *** 2011-04-05 Tuesday
>  Retrospectively added 2011-04-06 11:35
> Checked with Bastien about committing doc string changes
> *** 2011-04-06 Wednesday
>  11:33
> Updated Org to latest version in order to get new capture keyword
> expansion capability
>  11:36
> Problem solved. Brilliant, that works.  Carsten never ceases to
> amaze...
> 
> Thank you.
> 
> Phil
> 




Re: [O] Re: Using orgmode to take "inline notes" for research

2011-04-07 Thread John Hendy
2011/4/7 Sébastien Vauban :
> Hi Jeff,
>
>
> This is my current config for nice styling:
>
> #+begin_src emacs-lisp
>   
> #+end_src
>
> Customize to your own taste (and report back!)...

I can't have something set up right. I was doubtful that I was going
this source block thing right when Eric posted his suggestion for
notes in code blocks. So, I pasted this into my org-mode file and
evaluated it. Is that not what I'm supposed to do? At the top of the
resultant pdf, I get:
,---
| language=Lisp (setq org-inlinetask-default-state "TODO")
| ;; templates for inline tasks in various exporters (setq
org-inlinetask-export-templates ’((html "’((unless (eq todo "") (format "
> Best regards,
>  Seb
>
> --
> Sébastien Vauban
>
>
>



Re: [O] Re: Using orgmode to take "inline notes" for research

2011-04-07 Thread Jeff Horn
2011/4/7 John Hendy :
> I can't have something set up right. I was doubtful that I was going
> this source block thing right when Eric posted his suggestion for
> notes in code blocks. So, I pasted this into my org-mode file and
> evaluated it. Is that not what I'm supposed to do? At the top of the
> resultant pdf, I get:
> 

Try pasting Seb's code into the *scratch* buffer, not the org-mode
buffer. Once you evaluate it in the scratch buffer, you should be to
make inline-tasks/headlines as normal and export to pdf to get the
style defined by the lisp code. From reading it, it should be the
headline content in small caps, followed by a line return, and text
notes.

If you like it, you can add the customizations to an init file, or use
the customize interface to set things up.

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/



Re: [O] Using orgmode to take "inline notes" for research

2011-04-07 Thread Eric S Fraga
John Hendy  writes:

[...]

>
> I like formats like this as well and have been "cheating" to do this
> in LaTeX more or less like this:
>
> #+attr_latex: align=l|p{0.95\textwidth}
> | \,| The text that I want quoted, which ends up looking good but
> needs to be on one insanely long line of an org-mode table|
>
> Is there a better way to send a quote into the table form (indented
> with a nice vertical line to the left) but not need to have the quote
> on one huge line of an actual table (from org -> LaTeX, that is...
> obviously the above works if using html)?

You could use the =changebar= style in latex and then enclose the text
you want highlighted in a double environment combining changebar and quote:

--8<---cut here---start->8---
\begin{quote}
  \begin{changebar}
... text goes here ...
  \end{changebar}
\end{quote}
--8<---cut here---end--->8---

Not tested.  You may want =quotation= instead of =quote=.

Not quite what you want but similar in concept... ;-)

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.142.g4168)



[O] org-beamer: getting back to no indentation after a block

2011-04-07 Thread bozongo
I've just given a presentation using org-beamer and it worked really well. 
Thanks, guys!


During preparation I ran into the problem described in the toy presentation 
below. I'm aware of why the second slide looks how it looks (the last line 
"belongs" to the block header).  Still, I wonder if there's a simpler solution 
for telling org that I want to get back to no indentation after the block, 
similar to the way on the very first slide.


I realise that using the solition on the last slide is not a big deal, so I'm 
fine if that's the answer.


michael


#+STARTUP: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation]
#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usefonttheme[onlysmall]{structurebold}
#+BEAMER_FRAME_LEVEL: 2
* My question in three slides
** A slide
Some unindented text
- item
- another item
back to unindented text
** The same slide, but with a block
Some unindented text
*** the only way to get a block is to add a heading, right? :B_block:
:PROPERTIES:
:BEAMER_env: block
:END:
- item
- another item
back to unindented text -- but no, this doesn't work, I'm still in
the block
** The same slide, but with a block
Some unindented text
*** the only way to get a block is to add a heading, right? :B_block:
:PROPERTIES:
:BEAMER_env: block
:END:
- item
- another item
*** This is the only way I can get what I want :B_normal:
:PROPERTIES:
:BEAMER_env: normal
:END:
but the fact that I'm forced to use a *** heading in the org file although
I specifically don't want any bullets makes me wonder if there isn't a
simpler way to achieve what I want?



Re: [O] Using orgmode to take "inline notes" for research

2011-04-07 Thread John Hendy
On Thu, Apr 7, 2011 at 12:33 AM, Eric S Fraga  wrote:
> John Hendy  writes:
>
> [...]
>
>>
>> I like formats like this as well and have been "cheating" to do this
>> in LaTeX more or less like this:
>>
>> #+attr_latex: align=l|p{0.95\textwidth}
>> | \,| The text that I want quoted, which ends up looking good but
>> needs to be on one insanely long line of an org-mode table|
>>
>> Is there a better way to send a quote into the table form (indented
>> with a nice vertical line to the left) but not need to have the quote
>> on one huge line of an actual table (from org -> LaTeX, that is...
>> obviously the above works if using html)?
>
> You could use the =changebar= style in latex and then enclose the text
> you want highlighted in a double environment combining changebar and quote:
>
> --8<---cut here---start->8---
> \begin{quote}
>  \begin{changebar}
>    ... text goes here ...
>  \end{changebar}
> \end{quote}
> --8<---cut here---end--->8---
>
> Not tested.  You may want =quotation= instead of =quote=.
>
> Not quite what you want but similar in concept... ;-)

I should have googled harder. Where were you all my life, StackOverflow?[1]

-
\begin{tabular}{l|p{0.9\textwidth}}
\quad &
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id hendrerit
nunc. Sed scelerisque lacus vitae erat eleifend eleifend. Donec eros
mi, placerat
in porta eleifend, placerat a urna. Pellentesque venenatis neque non turpis
convallis vehicula. Aliquam aliquet ultricies tincidunt.\\
\end{tabular}
-

[1] http://stackoverflow.com/questions/2911013/how-to-add-changebar-in-latex


John

>
> --
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
> : using Org-mode version 7.5 (release_7.5.142.g4168)
>



Re: [O] page break after TOC?

2011-04-07 Thread John Hendy
On Wed, Apr 6, 2011 at 1:11 AM, Nick Dokos  wrote:
> John Hendy  wrote:
>
>> I'd like my page1 to be on a separate page from the TOC. How do I
>> insert a pagebreak to do this? If I do it here:
>> ,---
>> | * Section 1
>> | \newpage
>> | test in section 1
>> `---
>>
>> I get the TOC, then the Section 1 title, then a page break, and then the 
>> text.
>>
>>
>
> Assuming you are talking about LaTeX export only, I would define my own
> class:
>
> * copy the system article.cls to myarticle.cls (wherever in my
> local tree LaTeX can find it; the current directory is the last
> resort but not very convenient - in my case LaTeX searches in
> /home/nick/.texmf-config/tex, so I created a directory in there
> /home/nick/.texmf-config/tex/latex/base and copied it in there
> - don't forget to run texhash or equivalent)
>
> * modify the definition of \tableofcontents to add a \newpage at
> the end
>
> * modify org-export-latex-classes by duplicating the article section and
> changing article->myarticle in one of them
>
> The above steps are one-time only. Then whenever you want
> the behavior, change the class that org exports to:

This perfect. I'll be doing this.

Thanks for the tip,
John

>
> #+LaTeX_CLASS: myarticle
>
> Nick
>
>



Re: [O] xml statement in html and apache error

2011-04-07 Thread Nick Dokos
Nick Dokos  wrote:

> Richard Riley  wrote:
> 
> > 
> > Two machines, both with Debian Squeeze.
> > 
> > ,
> > | Server version: Apache/2.2.16 (Debian)
> > | Server built:   Mar 22 2011 20:56:31
> > `
> > 
> > >
> > > Nick
> > >
> > > PS. The exercise also uncovered an org bug but I'll post that as a
> > > separate message.
> > >
> > 
> > Let me re-run the scenario and check my publish parameters - its really
> > been a LONG time since I published but something changed with
> > apache. Both machines are relatively new installs. Possibly something
> > third party needs to be instaled on squeeze now to get xml statements
> > parsed? A google was not so helpful.
> > 
> 
> You may be right: I load modxslt on my apache - forgot about that. Not
> sure whether the orgmode.org apache uses that as well. If I find some
> time, I'll try without it.
> 

I tried without loading modxslt and I still cannot reproduce the problem that
you see: no errors in the apache log and everything shows up as it should.

Nick



[O] Non-stop capture?

2011-04-07 Thread Mark S

Hello!

I have the emacs org-protocol setup to capture with a default template.  
But I still have to C-c C-c and then move back to the browser. Is there a  
way to make it so that as text is captured it is automatically and  
continuously sent to the capture location without interruption?


Thanks!
Mark



[O] Re: Non-stop capture?

2011-04-07 Thread Marc-Oliver Ihm

Am 07.04.2011 21:40, schrieb Mark S:

Hello!

I have the emacs org-protocol setup to capture with a default template.
But I still have to C-c C-c and then move back to the browser. Is there
a way to make it so that as text is captured it is automatically and
continuously sent to the capture location without interruption?

Thanks!
Mark




Hello,

Not sure, if I understand correctly.
As far as I know, capture does not set up a seperate buffer (at least 
with recent versions of org). What you see, is just the destination 
buffer narrowed down to a single entry. Therefore your input is never 
sent to the destination buffer, because you already type it there ...


regards, Marc-Oliver Ihm



[O] Re: Non-stop capture?

2011-04-07 Thread Jambunathan K
"Mark S"  writes:

> Hello!
>
> I have the emacs org-protocol setup to capture with a default
> template. But I still have to C-c C-c and then move back to the
> browser. Is there a way to make it so that as text is captured it is
> automatically and continuously sent to the capture location without
> interruption?

,[ C-h v org-capture-templates RET ]
| org-capture-templates is a variable defined in `org-capture.el'.
| Its value is shown below.
| 
| Documentation:
| Templates for the creation of new entries.
|
| [...] 
|
| Each entry is a list with the following items:
| 
|  :immediate-finish   When set, do not offer to edit the information, just
|  file it away immediately.  This makes sense if the
|  template only needs information that can be added
|  automatically.
| [...]
`

>
> Thanks!
> Mark
>
>

-- 



[O] Re: Non-stop capture?

2011-04-07 Thread Richard Riley
Jambunathan K  writes:

> "Mark S"  writes:
>
>> Hello!
>>
>> I have the emacs org-protocol setup to capture with a default
>> template. But I still have to C-c C-c and then move back to the
>> browser. Is there a way to make it so that as text is captured it is
>> automatically and continuously sent to the capture location without
>> interruption?
>
> ,[ C-h v org-capture-templates RET ]
> | org-capture-templates is a variable defined in `org-capture.el'.
> | Its value is shown below.
> | 
> | Documentation:
> | Templates for the creation of new entries.
> |
> | [...] 
> |
> | Each entry is a list with the following items:
> | 
> |  :immediate-finish   When set, do not offer to edit the information, just
> |  file it away immediately.  This makes sense if the
> |  template only needs information that can be added
> |  automatically.
> | [...]
> `
>

Isnt that for "capturing" things like clipboard text?




[O] Re: unicorn

2011-04-07 Thread Nick Dokos
Christopher Suckling  googlemail.com> writes:

> 
> 
> On 27 Feb 2009, at 18:47, Russell Adams wrote:
> 
> > In the spirit of Org, we need a folding unicorn! ;]
> 
> http://www.pajarita.org/aep/pajaritas/pajarita3-4.pdf
> 
> Best wishes,
> 
> Christopher
> 
> ___
> 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
> 
> 

I went looking for this one today and got a stale page, so I looked around
a bit and found it at a slightly different URL:

http://www.pajarita.biz/aep/pajaritas/pajarita3-4.pdf

Nick





[O] Making the output of %% functions linkable in agenda views

2011-04-07 Thread Sebold, Charles
Here's a test.  Take the line below and put it in an agenda file, then
view the agenda.

%%(format "%s" (concat "[[elisp:(info)]" "[Link to info]]"))

The results as I see them give me a link that I can mouse-click on, but
I can't move point to it and hit C-c C-o.

What do I need to do to make this a normal org link in every way?  Or is
this a bug?

(Obviously this is just a demo problem, I'm doing something much more
hideously complicated in real life, but this was good enough to share to
show what the problem was.)
-- 
Charles Sebold
Information Technology
The Lutheran Church – Missouri Synod
(314) 996-1891




[O] Re: Non-stop capture?

2011-04-07 Thread Mark S

Hi Jambunathan,

Thanks for pointing out :immediate-finish ! That had eluded my attention.

With :immediate-finish setting, org-mode still grabs the focus away from  
the browser. So I still have to alt-tab back to the browser. I would  
really like an uninterrupted web-clipping experience. Also, there is a  
strange message in the emacs status line on the bottom:


   Org-mode not loaded.

I don't get this, since clearly org-mode *is* loaded.

Thanks!
Mark

Note: Using capture with win xp, Emacs 23.2.1 (i386-mingw-nt5.1.2600),
org-mode 7.5, and Opera 11.01

--- On Thu, 4/7/11, Jambunathan K  wrote:


From: Jambunathan K 
Subject: Re: Non-stop capture?
To: throa...@yahoo.com
Cc: "emacs-orgmode@gnu.org" 
Date: Thursday, April 7, 2011, 11:54 AM
"Mark S" 
writes:

Hello!

>
> I have the emacs org-protocol setup to capture with a
default
> template. But I still have to C-c C-c and then move
back to the
> browser. Is there a way to make it so that as text is
captured it is
> automatically and continuously sent to the capture
location without
> interruption?
,[ C-h v org-capture-templates RET ]
| org-capture-templates is a variable defined in
`org-capture.el'.
| Its value is shown below.
|| Documentation:
| Templates for the creation of new entries.
|
| [...]|
| Each entry is a list with the following items:
||  :immediate-finish   When set, do not
offer to edit the information, just
|file it away immediately.  This
makes sense if the
|template only needs information that
can be added
|automatically.
| [...]
`



> Thanks!
> Mark
>
>
--




[O] Bug: No property change from ‘org-clock-sum’

2011-04-07 Thread Ben Finney
Howdy all,

When I use ‘org-clock-sum’ in Org-mode version 7.4, nothing appears to
happen: the items in the subtree are not updated and no ‘CLOCKSUM’
property appears.

Org-mode version 7.4
GNU Emacs 23.2.1 (powerpc-unknown-linux-gnu, GTK+ Version 2.20.1) of
2010-12-12 on porpora, modified by Debian


I'm trying to generate an invoice report using ‘org-invoice.el’.

The items on which I want to report have clock entries, generated
correctly with ‘org-clock-in’ and ‘org-clock-out’. An example:

=
* foo
** bar
*** [2011-03-24 Thu]
CLOCK: [2011-03-24 Thu 14:15]--[2011-03-24 Thu 18:03] =>  3:48
CLOCK: [2011-03-24 Thu 09:10]--[2011-03-24 Thu 12:27] =>  3:17
*** [2011-03-23 Wed]
CLOCK: [2011-03-23 Wed 14:10]--[2011-03-23 Wed 18:16] =>  4:06
CLOCK: [2011-03-23 Wed 09:30]--[2011-03-23 Wed 13:10] =>  3:40
*** [2011-03-22 Tue]
CLOCK: [2011-03-22 Tue 14:00]--[2011-03-22 Tue 17:30] =>  3:30
CLOCK: [2011-03-22 Tue 08:58]--[2011-03-22 Tue 13:31] =>  4:33
=

According to the doc string for ‘org-invoice-report’, the ‘CLOCKSUM’
property on each item in the subtree will be used for the report.

So apparently I need to ‘org-clock-sum’ on the tree before updating the
report, in order to automatically generate the ‘CLOCKSUM’ property. But
that function doesn't change anything.

Why wouldn't the ‘org-clock-sum’ function do what its doc string says?
How should I be updating the ‘CLOCKSUM’ property?

-- 
 \“The industrial system is profoundly dependent on commercial |
  `\   television and could not exist in its present form without it.” |
_o__)—John Kenneth Galbraith, _The New Industrial State_, 1967 |
Ben Finney




[O] Re: [PATCH] Problem with html export of description list items

2011-04-07 Thread Ethan Ligon
Nic-

Nicolas Goaziou  gmail.com> writes:
> > Ethan Ligon  are.berkeley.edu> writes:
> >> 
> >> I've just stumbled across what I regard as a bug in the html export of
> >> description list items.
> >> 
> >> The problem has to do with whether the specification of a description
> >> list includes a trailing space or not; i.e., whether "- Item ::" is
> >> treated the same way as "- Item :: ".  LaTeX export treats these as
> >> identical.  Html export gets confused about what the description list
> >> item is, and winds up generating a "???" for the description.
> 
> LaTeX exporter doesn't treats these as identical. What happens is that
> in your example, the first item is correct and the list is thus set as
> a description list. As such, LaTeX exporter tries hard to fill
> description terms for every item in the list. If you exchange the first
> and second items in your example, the list will be exported as
> a standard itemize list in LaTeX.



> Your patch allows items like:
> 
> - term ::description
> 
> which are not valid for a description list.

Thanks for correcting my misunderstanding of the latex-export
behavior.  But I still think this behavior is undesirable.

The org manual says that a description item takes the form '- term
:: ', and thus seems to require a space after the double colon.  I
suppose it's this that you're relying on in claiming that 
"- term ::description" is invalid.

I agree that "- term ::description" is ugly, but the use-case that is
giving me problems is something like
  
  - term ::
1. A list
2. Providing
3. The description

The html export code currently allows "- term ::[ \t]+", so the above
breaks unless there's a space or a tab following the "::".  My issue
would be addressed if we could just slightly expand the set of
allowable white space following, so that we'd have "::[ \t\n]+".

Does that seem reasonable?

Thanks,
-Ethan







[O] batch publish all, forcing. how?

2011-04-07 Thread lbmlist


I've been experimenting with:

emacs23 --batch -l ~/.emacs -f org-publish-all

to publish a total fresh version of my project, but it misses some files 
(an unchanging .css for example)


I suspect the optional force (defun org-publish-all (&optional force)...
might help, but I don't know lisp well enough to know how to send it 
force.


Can someone offer a howto?

Thanks in advance,

Louis





Re: [O] batch publish all, forcing. how?

2011-04-07 Thread Nick Dokos
lbml...@hethcote.com wrote:

> 
> I've been experimenting with:
> 
> emacs23 --batch -l ~/.emacs -f org-publish-all
> 
> to publish a total fresh version of my project, but it misses some
> files (an unchanging .css for example)
> 
> I suspect the optional force (defun org-publish-all (&optional force)...
> might help, but I don't know lisp well enough to know how to send it
> force.
> 
> Can someone offer a howto?
> 

Add a function to your .emacs

--8<---cut here---start->8---
(defun org-publish-all-force ()
   (interactive)
   (org-publish-all t))
--8<---cut here---end--->8---

and call it instead of org-publish-all on the command line.

But if the css file is unchanging, why does it matter?

Nick





[O] manipulating the agenda from elisp?

2011-04-07 Thread Filippo A. Salustri
Hi,
I'm thinking I might like to try some programming to do things to the agenda
from an elisp function.
I tried 'apropos agenda' but I didn't really see the kind of thing I'm
looking for.
What I'm hoping is for some way to iterate over each item in the agenda, and
be able to access the content of the item in some structured way.
I think I've seen functions that can pull info like TODO state and priority
from the item under the cursor, so it's the iteration part that I'm really
interested in.

Any advice?
Cheers.
Fil

-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/


[O] Re: Bug: :clock-keep...not kept [7.5 commit-078c01bf3b1742b1015fac9f5bab3a429505f3c6]

2011-04-07 Thread Bernt Hansen
Hi Giovanni,

Giovanni Ridolfi  writes:

> I think I found a bug with the option ":clock-keep"
>
> :clock-keep'
>   Keep the clock running when filing the captured entry.
>
> Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600)  of 2011-03-10 on 3249CTO
> Package: Org-mode version 7.5 commit-4168fccdc7eab648d9c4517afe56765aaa1e9664
>



> I tried to look at the code to understand it, but it is beyond my skills.
>
> On the other hand I did some tests:
> ** set up  - beware I'm under Windows. 
>(for Bernt's set up (linuxish) please refer to message
>http://thread.gmane.org/gmane.emacs.orgmode/38485)
>
> My minimal.emacs
> (add-to-list 'load-path (expand-file-name "c:/Documents and 
> Settings/my-path/org/lisp"))
> (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . 
> org-mode))
> (require 'org-install)
>
> (global-set-key "\C-cl" 'org-store-link)
> (global-set-key "\C-ca" 'org-agenda)
> (global-set-key "\C-cb" 'org-iswitchb)
>
> (global-set-key "\C-cc" 'org-capture)
>
> (setq org-capture-templates (quote (("t" "todo" entry (file "c:/Documents and 
> Settings/my-path/a.org") "* TODO %?
> %U
> %a
> " :immediate-finish t :clock-in t :clock-keep t  
>
> I run emacs with:
>
> c:\path\>  emacs -q -l ~/minimal.emacs 
>
> C-c c tto call the template.  
>Fill it in and 
> C-c C-cto close.
>
> I have modified the properties in the last row:
>
> ** if :immediate-finish nil :clock-in t :clock-keep t
>the clock in clocks-in
> BUT the clock is not kept, it is closed anyway. 

I can reproduce this problem.

I think :immediate-finish never clocks in at all which is
why :clock-keep is not doing anything in this case.

I think this is a bug and the clock should probably be started and kept
in the new capture task.

>
> **without immediate-finish
> ** if  :clock-in t :clock-keep t
> the clock in clocks-in
> BUT the clock is not kept, it is closed anyway. 

I can reproduce this problem as well.

I don't currently have a use case for :clock-keep so I'm not currently
using this feature in my templates.

I agree the clock should probably be started and kept in the new capture
task.


>
> cheers,
> Giovanni
>
> P.S. Side effect (very emacsish).
>
> While testing I found an unexpected behaviour with :clock-resume
>
> ** if :immediate-finish t :clock-in t :clock-resume t
> *** and If there is no clock to be resumed the clock-in does not
> clock-in in the capture buffer.
> Is this  a bug?
> Shall be thrown a message: "No clock to be resumed"?
>
> *** If there is clock to be resumed
> the clock is resumed. It works.

I think this is intended behaviour.  If a clock is not already running
before you start the capture then there is no task to resume the clock
on.  In this case the clock stops after the capture is finalized.

Is throwing an error message for this really useful?

GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11
on raven, modified by Debian

Regards,
Bernt



Re: [O] batch publish all, forcing. how?

2011-04-07 Thread lbmlist



On Thu, 7 Apr 2011, Nick Dokos wrote:



Add a function to your .emacs

--8<---cut here---start->8---
(defun org-publish-all-force ()
  (interactive)
  (org-publish-all t))
--8<---cut here---end--->8---

and call it instead of org-publish-all on the command line.

But if the css file is unchanging, why does it matter?

Nick







Thank you, works a treat.


There are so many changes being applied at this stage I am rm'ing the 
target and regenerating when I do a full publish. In a month or so, 
that'll be overkill.


Louis



[O] Bulk function documentation is missing

2011-04-07 Thread Bernt Hansen
Hi Puneeth,

I just ran across the new Bulk action feature which applies a function
to the marked entries in the agenda.  There is no documentation for this
feature that I can find other than in the commit itself.

This functionality was added by you in 5b1b94a (* org-agenda.el
(org-agenda-bulk-action): Allow the user to run a function., 2011-03-08)

Could you please also provide documentation in org.texi with an example
of how you use this?

Thanks,
Bernt



[O] Re: manipulating the agenda from elisp?

2011-04-07 Thread Bernt Hansen
"Filippo A. Salustri"  writes:

> Hi,
> I'm thinking I might like to try some programming to do things to the
> agenda from an elisp function.
> I tried 'apropos agenda' but I didn't really see the kind of thing
> I'm looking for.
> What I'm hoping is for some way to iterate over each item in the
> agenda, and be able to access the content of the item in some
> structured way.
> I think I've seen functions that can pull info like TODO state and
> priority from the item under the cursor, so it's the iteration part
> that I'm really interested in.
>
> Any advice?

Hi Fil,

I just found the B f code to execute an arbitrary function on marked
entries in the agenda.  Maybe this will help?

This following code visits the marked entries and just displays the
heading for the task.

Mark multiple entries in the agenda with 'm' and then 'B f bh/test RET'
should display the heading of each marked task in the *Messages* buffer.

--8<---cut here---start->8---
(defun bh/test ()
  (interactive)
  (let* ((marker (or (org-get-at-bol 'org-marker)
 (org-agenda-error)))
 (buffer (marker-buffer marker))
 (pos (marker-position marker)))
(with-current-buffer buffer
  (if (org-mode-p)
  (save-excursion
(goto-char pos)
(message "%s" (nth 4 (org-heading-components
--8<---cut here---end--->8---

Depending on what you want to do you can either act on marked entries or
create a custom agenda skip function that can visit the tasks as the
agenda is built.

HTH,
Bernt



[O] Re: manipulating the agenda from elisp?

2011-04-07 Thread Filippo A. Salustri
That's a good start!  Thanks!
Cheers.
Fil

On 7 April 2011 23:34, Bernt Hansen  wrote:

> "Filippo A. Salustri"  writes:
>
> > Hi,
> > I'm thinking I might like to try some programming to do things to the
> > agenda from an elisp function.
> > I tried 'apropos agenda' but I didn't really see the kind of thing
> > I'm looking for.
> > What I'm hoping is for some way to iterate over each item in the
> > agenda, and be able to access the content of the item in some
> > structured way.
> > I think I've seen functions that can pull info like TODO state and
> > priority from the item under the cursor, so it's the iteration part
> > that I'm really interested in.
> >
> > Any advice?
>
> Hi Fil,
>
> I just found the B f code to execute an arbitrary function on marked
> entries in the agenda.  Maybe this will help?
>
> This following code visits the marked entries and just displays the
> heading for the task.
>
> Mark multiple entries in the agenda with 'm' and then 'B f bh/test RET'
> should display the heading of each marked task in the *Messages* buffer.
>
> --8<---cut here---start->8---
> (defun bh/test ()
>  (interactive)
>  (let* ((marker (or (org-get-at-bol 'org-marker)
> (org-agenda-error)))
> (buffer (marker-buffer marker))
> (pos (marker-position marker)))
>(with-current-buffer buffer
>  (if (org-mode-p)
>  (save-excursion
>(goto-char pos)
>(message "%s" (nth 4 (org-heading-components
> --8<---cut here---end--->8---
>
> Depending on what you want to do you can either act on marked entries or
> create a custom agenda skip function that can visit the tasks as the
> agenda is built.
>
> HTH,
> Bernt
>



-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/


[O] [babel] By default, code blocks should not be evaluated during export

2011-04-07 Thread Paul Sexton
The default value of `org-export-babel-evaluate' is t. 

Having just crashed my Emacs session 5 times in a row trying to get
a file containing a BEGIN_SRC emacs-lisp ... END_SRC *code example*
to export to HTML...

I strongly feel it should default to nil.

I also feel that "executable code block" and "quoted code example that I would
like to display/export with pretty syntax highlighting" are two very different
concepts, and should have different block names.

eg #+BEGIN_EXEC for the executable blocks?
or allow an argument to example blocks, eg "#+BEGIN_EXAMPLE python" ?

Paul





Re: [O] Re: manipulating the agenda from elisp?

2011-04-07 Thread Nick Dokos
Filippo A. Salustri  wrote:

> That's a good start!  Thanks!
> Cheers.
> Fil
> 
> On 7 April 2011 23:34, Bernt Hansen  wrote:
> 
> "Filippo A. Salustri"  writes:
>
> > Hi,
> > I'm thinking I might like to try some programming to do things to the
> > agenda from an elisp function.
> > I tried 'apropos agenda' but I didn't really see the kind of thing
> > I'm looking for.
> > What I'm hoping is for some way to iterate over each item in the
> > agenda, and be able to access the content of the item in some
> > structured way.
> > I think I've seen functions that can pull info like TODO state and
> > priority from the item under the cursor, so it's the iteration part
> > that I'm really interested in.
> >
> > Any advice?
>

Be sure to read the "Hacking" appendix in the org manual, in particular
"Using the property API" and "Using the mapping API".

Nick

> Hi Fil,
>
> I just found the B f code to execute an arbitrary function on marked
> entries in the agenda.  Maybe this will help?
>
> This following code visits the marked entries and just displays the
> heading for the task.
>
> Mark multiple entries in the agenda with 'm' and then 'B f bh/test RET'
> should display the heading of each marked task in the *Messages* buffer.
>
> --8<---cut here---start->8---
> (defun bh/test ()
>  (interactive)
>  (let* ((marker (or (org-get-at-bol 'org-marker)
>                     (org-agenda-error)))
>         (buffer (marker-buffer marker))
>         (pos (marker-position marker)))
>    (with-current-buffer buffer
>      (if (org-mode-p)
>          (save-excursion
>            (goto-char pos)
>            (message "%s" (nth 4 (org-heading-components
> --8<---cut here---end--->8---
>
> Depending on what you want to do you can either act on marked entries or
> create a custom agenda skip function that can visit the tasks as the
> agenda is built.
>
> HTH,
> Bernt
> 
> --
> Filippo A. Salustri, Ph.D., P.Eng.
> Mechanical and Industrial Engineering
> Ryerson University
> 350 Victoria St, Toronto, ON
> M5B 2K3, Canada
> Tel: 416/979-5000 ext 7749
> Fax: 416/979-5265
> Email: salus...@ryerson.ca
> http://deseng.ryerson.ca/~fil/
> 
> 
> 
> Alternatives:
> 
> 



Re: [O] [babel] By default, code blocks should not be evaluated during export

2011-04-07 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/04/11 06:23, Paul Sexton wrote:
> The default value of `org-export-babel-evaluate' is t. 
> 
> Having just crashed my Emacs session 5 times in a row trying to get
> a file containing a BEGIN_SRC emacs-lisp ... END_SRC *code example*
> to export to HTML...
> 
> I strongly feel it should default to nil.
> 
> I also feel that "executable code block" and "quoted code example that I would
> like to display/export with pretty syntax highlighting" are two very different
> concepts, and should have different block names.

If you put

#+BABEL: :exports code

at the beginning of your file, only the code will be executed an not
evaluated - you can then use

#+begin_src python :exports results
  YOUR CODE
#+end_src

to export the results (see "Working with source code --- Header
arguments --- Specific header arguments --- :exports" in the org manual

or am I missing something here?

Rainer

> 
> eg #+BEGIN_EXEC for the executable blocks?
> or allow an argument to example blocks, eg "#+BEGIN_EXAMPLE python" ?
> 
> Paul
> 
> 
> 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:+33 - (0)9 53 10 27 44
Cell:   +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2esbkACgkQoYgNqgF2ego1YACeJgPio9ZCoXIO7q/p0l1dxSjX
U5wAn2vtTTbZIiKE03KPQs1AKa5YlBLw
=VVLi
-END PGP SIGNATURE-