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

2011-04-02 Thread Charles Sebold
This has been a problem for me for some time, but I only just now had
the chance to find the problem.

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.

Diff is here, followed by the bug report data dump (edited to remove
things that don't need to be public, and I wonder if it would be a good
idea to modify the bug report to automatically leave out encryption
passwords and the like?).


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'."


Emacs  : GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-03-29 on CT-SEBOLDCR-T4C
Package: Org-mode version 7.5 (release_7.5.125.g70fe)

current state:
==
(setq
 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-custom-commands '(("z" tags "memorize&daily|odd|thursday|memday31")
  ("A" "Full Agenda" ((agenda "")))
  ("7" "Full Weekly Agenda"
   ((agenda "" ((org-agenda-span (quote week))
  ("h" . "HOME + tag/TODO searches")
  ("ha" "Full Agenda + Next Actions"
   ((agenda) (todo "INBOX") (todo "NEXTACTION") 
(todo "TODO")))
  ("hn" "Next Actions"
   ((todo "INBOX") (todo "NEXTACTION") (todo 
"TODO")))
  ("ht" "Non-LCMS Tasks" ((tags-todo "-lcms")))
  ("hp" "All Projects"
   ((todo "PROJECT") (todo "PROJWAITING") (todo 
"PROJVERIFY")))
  ("R" "TeamMania tasks" ((tags-todo 
"+work+teammania")))
  ("w" . "LCMS + tag/TODO searches")
  ("wo" "LCMS Servicewise Open Tickets"
   ((tags "+servicewise+ticket-status=\"Closed\"")))
 

[O] Re: ToC in org-faq

2011-04-02 Thread Matt Lundin
Jason Dunsmore  writes:

> Nick Dokos  writes:
>
>> The table of contents in the org-faq page on Worg,
>>
>> http://orgmode.org/worg/org-faq.html
>>
>> is always expanded, afaict: it's not a button that expands when you
>> mouse over it, as is the case in most (all?) Worg pages. Is that by
>> design or did something break?
>
> I think it's by design:
> http://repo.or.cz/w/Worg.git/blobdiff/509e39e..9b4399:/org-faq.org

It is by design, but the table of contents used to be displayed at the
top of the file, whereas now (in my browser) it floats to the right,
crowding out the content. I'm restoring the "pop-up" behavior for the
time being.

Best,
Matt



[O] Re: zotero (or mendeley) integration with org

2011-04-02 Thread Matt Lundin
"Alan E. Davis"  writes:

> Is it possible to use org babel to extract bibtex entries from file of
> notes to a *.bib file? 
>

Yes, you can use babel's tangling facilities to extract bibtex entries
enclosed in source blocks.

#+begin_src bibtex :tangle history.bib
  @InCollection{levi2001_microhistory,
author =   {Levi, Giovanni},
title ={On Microhistory},
editor =   {Peter Burke},
booktitle ={New Perspectives on Historical Writing},
address =  {University Park, PA},
publisher ={Penn State Press},
year = 2001,
  }
#+end_src

Calling org-babel-tangle-file will put this entry in the file
history.bib.

> The stumbling point for me in saving bibtex sources is I don't see a
> way to use the file as a bibtex *.bib file so as to use that as the
> direct source for the publication.  Perhaps this could be automated
> with babel?

There are a few other routes. 

1. Bibtex discards anything outside of an entry so you could symlink
   your org file to something with a bib extension (e.g., notes.org ->
   notes.bib) and simply point latex/bibtex to that file.

2. You could instruct emacs to edit bib files with orgmode and use babel
   and source blocks to enter items
   (add-to-list 'auto-mode-alist 
 '("\\.\\(org\\|bib\\)$" . org-mode))

3. AFAICT, reftex is blissfully indifferent to non-bibtex data, so you
   could use reftex to query your org files for citation keys. Then, you
   could use reftex to generate a proper bib file with all entries cited
   in your paper.

Best,
Matt






[O] Next OrgCamp in Paris (April 9th)

2011-04-02 Thread Frederic Couchet

Hello, second OrgCamp in Paris next week.

Some parisian Orgers are gathering for a new OrgCamp in Paris 

* Where: FPH, 38 rue Saint Sabin, 75011 Paris

* When: April 9th 2011 10am-8pm

* Participants: please register on the event's website

Here is the wiki for this event (in French):

http://www.lifehacking.fr/mediawiki/index.php/OrgCampAvril2011

Fred.




Re: [O] Re: zotero (or mendeley) integration with org

2011-04-02 Thread Eric S Fraga
"Alan E. Davis"  writes:

> Is it possible to use org babel to extract bibtex entries from file of notes
> to a *.bib file?
>
> The stumbling point for me in saving bibtex sources is I don't see a way to
> use the file as a bibtex *.bib file so as to use that as the direct source
> for the publication.  Perhaps this could be automated with babel?

Would tangling do what you want?  Seems to work for me:

--8<---cut here---start->8---
#+babel: :tangle hens.bib

* heat exchanger network synthesis
*** Rewriting grammar for HENS with splitting (Fraga, 2009)
#+begin_src bib
@article{fraga-2009a,
title = {A rewriting grammar for heat exchanger network structure 
evolution with stream splitting},
volume = 41,
issn = {{0305-215X}},
doi = {10.1080/03052150903070153},
number = 9,
journal = {Engineering Optimization},
author = {Eric S. Fraga},
year = 2009,
pages = {813-831}
}
#+end_src
--8<---cut here---end--->8---

Put this in a file, t.org say, and hit =C-c C-v t= (=org-babel-tangle=)
and it should create =hens.bib=.  Sorry for the self-citation here ;-)

You could also put the actual tangle destination on each src block, in
case you want to tangle to more than one file from the same org file.

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



[O] [Bug] [Version 7.5] org-capture : the clock doesn't resume on the original clocking task

2011-04-02 Thread Frederic Couchet
Hello,

I use ":clock-in t" and ":clock-resume t" in some org-capture templates.

Under org-mode 7.5, after the captured task is filed with C-c C-c the
clock doesn't resume on the original clocking task.

If I use the git version of org-capture, the clock resumes on the
original clocking task.

Here is the template :

(custom-set-variables
 '(org-capture-templates (quote (("t" "Todo" entry (file+headline 
"timesheet.org" "Next Actions") "* TODO %^{Brief Description} :REFILE: 
 %^{Effort}p %? Added: %U" :clock-in t :clock-resume t)))
...


Fred.




Re: [O] Re: zotero (or mendeley) integration with org

2011-04-02 Thread Alan E. Davis
I have been enlightened.  This closes a loop for my handling of literature.

Thank you both.

alan


[O] Re: Outlook replacement

2011-04-02 Thread Steinar Bang
> Suvayu Ali :

> How do you (as in all users using Emacs as their email client) deal
> with unreliable networks? When I used to use tramp over a particularly
> slow/unreliable network day before, I found every time tramp got stuck
> emacs would hang too until tramp could recover.

What does tramp have to do with using emacs as an email client?




[O] [bug] project publish :auto-postamble and :postamble broken for html

2011-04-02 Thread Eric Schulte
Hi,

I've noticed that all of my project which either try to set
:auto-postamble to nil, or set a custom value for :postamble have these
settings ignored.

Digging in, in the `org-export-as-html' function, when the project
plists are combined with the infile plists, the :postamble and
:auto-postamble options are removed from the project plist, and a new
:html-postamble option appears.

Through setting the :html-postamble option directly in my project
specification I am able to control the postamble contents on export, so
maybe the fix is as simple as updating the documentation to remove the
:auto-postamble and :postamble options and add the :html-postamble
option, or perhaps (probably preferable) `org-export-as-html' should be
updated to recognize these two options.

Thanks -- Eric



Re: [O] Re: Outlook replacement

2011-04-02 Thread Eric S Fraga
Steinar Bang  writes:

>> Suvayu Ali :
>
>> How do you (as in all users using Emacs as their email client) deal
>> with unreliable networks? When I used to use tramp over a particularly
>> slow/unreliable network day before, I found every time tramp got stuck
>> emacs would hang too until tramp could recover.
>
> What does tramp have to do with using emacs as an email client?

I think the point was that tramp on an unreliable network illustrates
the problems with emacs's single-threaded implementation and not that it
is otherwise related to email in emacs.

Even on a reliable, yet slow, network, I do get frustrated sometimes
when I have "sent" a very large email and cannot do anything in one of
org documents until the message has actually been sent.  Of course, that
is due to my using a non-queueing smtp MTA, something I *could* fix if
it bothered me enough...

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



Re: [O] Re: Outlook replacement

2011-04-02 Thread Suvayu Ali
On Sat, 02 Apr 2011 17:18:33 +0100
Eric S Fraga  wrote:

> Steinar Bang  writes:
> 
> >> Suvayu Ali :  
> >  
> >> How do you (as in all users using Emacs as their email client) deal
> >> with unreliable networks? When I used to use tramp over a
> >> particularly slow/unreliable network day before, I found every
> >> time tramp got stuck emacs would hang too until tramp could
> >> recover.  
> >
> > What does tramp have to do with using emacs as an email client?  
> 
> I think the point was that tramp on an unreliable network illustrates
> the problems with emacs's single-threaded implementation and not that
> it is otherwise related to email in emacs.

Yes, that was my point of mentioning tramp. I think the conclusion we
arrived at was to use OfflineImap would be the most optimum solution
for my use case.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [babel] feature request: automatically connect source code block to its session

2011-04-02 Thread Eric Schulte
Andreas Leha  writes:

> Hi Eric,
>
> thanks for looking into this!
>
> Unfortunately, I do not know the setup here.  But I asked on the ess
> mailing list and got an answer from Stephen Eglen:
>
> "I think you want to set ess-local-process-name given by the :session
> argument in the .org buffer when the temp buffer is opened by C-c '."
>
> I hope that is the information you need.
>

I opened up a example.R buffer, evaluated some code, and a session named
"*R*" was created and the value of `ess-local-process-name' was set to
"R", so I've just pushed up a patch which will set the value of
`ess-local-process-name' to "something" if the value of the :session
header is "*something*", it will also start the session if none exists.

Please let me know if this give the desired result.  If not, then could
you point me to an ESS feature which uses the associated session which I
could use locally to test?

Note also, that this patch adds a general facility through which any
language can prep an org edit src buffer through the definition of a
org-babel-edit-prep:lang function, which will be passed the full info
list for the code block.  If there are any other languages which would
benefit from edit-buffer initialization it should now be a simple task
to implement such initialization.

Thanks -- Eric

>
> Regards,
> Andreas
>
>
>
>
>
>
> Am 23.03.2011 04:00, schrieb Eric Schulte:
>> This seems reasonable,
>> 
>> Do you know how ESS associates a code buffer with a session (i.e. is
>> there some buffer-local variable which holds the session name)?
>> 
>> With this information in hand it shouldn't be difficult to expand the
>> C-' behavior for R s.t. it automatically associates the resulting
>> Org-Src buffer with the proper R session.
>> 
>> Good idea.  Best -- Eric
>> 
>> Andreas Leha  writes:
>> 
>>> Hi all,
>>>
>>> I have a feature request (if what I want is not already possible, that is).
>>>
>>> Could a source code block, which has the :session header argument, be
>>> associated with its session as soon as C-' is pressed?
>>>
>>> The background to this question is, that all ess support functionality
>>> for R (r-autoyas, autocomplete-R, and ess-eldoc) need an associated R
>>> session.  They start to function only as soon as the first line of the
>>> code block is evaluated, which associates the source buffer with its
>>> session.
>>> The autocomplete-R even fails to load without an associated R session
>>> (byte-code: Language mode `R-mode' fails with: "Symbol nil may not be
>>> buffer-local")
>>> and this way cuts the connection to org, such that C-' becomes undefined.
>>>
>>> Regards,
>>> Andreas
>> 



[O] Re: [Bug] [Version 7.5] org-capture : the clock doesn't resume on the original clocking task

2011-04-02 Thread Bernt Hansen
Frederic Couchet  writes:

> I use ":clock-in t" and ":clock-resume t" in some org-capture templates.
>
> Under org-mode 7.5, after the captured task is filed with C-c C-c the
> clock doesn't resume on the original clocking task.
>
> If I use the git version of org-capture, the clock resumes on the
> original clocking task.

Hi Frederic,

So does this mean it's fixed in origin/master but broken in release_7.5?
Is your original task in the same file as the target of your capture?

There were a few fixes to the codebase for clocking after the 7.5
release.

Regards,
Bernt



[O] Re: Use-cases for babel

2011-04-02 Thread Michael Gauland
Marcelo de Moraes Serpa  gmail.com> writes:

> We could also use this thread for additional ideas on how org-babel
> could be used.

I generally use org-babel with PlantUML, dot, or ditaa to generate diagrams as
part of my exported document. I find this especially useful for programming
notes, as it keeps everything in one file, but I also use it for more formal
design documents and presentations.

--Mike Gauland








Re: [O] Re: Use-cases for babel

2011-04-02 Thread Eric Schulte
Michael Gauland  writes:

> Marcelo de Moraes Serpa  gmail.com> writes:
>
>> We could also use this thread for additional ideas on how org-babel
>> could be used.
>

see also, http://orgmode.org/worg/org-contrib/babel/uses.html



Re: [O] Update org-mode

2011-04-02 Thread Christian Moe

In the Makefile, what settings do you have under these headings?

# Name of your emacs binary
# Where local software is found
# Where local lisp files go.
# Where info files go.

I'm one of the oddballs who compile and install every new Org version, 
because in the start I thought that was the "right" way, and it's 
become a habit.


The Makefile needs to point to the right paths for your Aquamacs 
application and its site-lisp and info subdirectories. I don't use 
Aquamacs, but mutatis mutandis it's probably similar to that for GNU 
Emacs on the Mac, namely:


 # Name of your emacs binary
 EMACS=/Applications/Emacs.app/Contents/MacOS/emacs

 # Where local software is found
 prefix=/Applications

 # Where local lisp files go.
 lispdir = $(prefix)/Emacs.app/Contents/Resources/site-lisp

 # Where info files go.
 infodir = $(prefix)/Emacs.app/Contents/Resources/info

I quickly found that git pulls would overwrite my hand-edited 
Makefile, and a hand-edited Makefile caused conflicts on the next 
pull, and I didn't understand git at all.


So I did a shell script that pulls org-mode, copies the Makefile, 
applies a patch with the above changes to the Makefile, compiles and 
installs, and then switches back the Makefile copy. Works for me.


Yours,
Christian



On 4/1/11 5:20 PM, Dror Atariah wrote:

I tried to follow the update process described here:
http://orgmode.org/worg/org-faq.html under:
How do I keep current with bleeding edge development?

The only change I made was the place where I checked out the new version. 
Instead of ~/elisp I have ~/Library/elisp.

Everything went smooth, except that I had to add "sudo" before the "make install". 
Without the sudo, I got an "access denied" error. Anyway, at the end, I got no warnings and it 
seems like the process was smooth. But when I checked the version of org-mode in aquamacs it was still 6.33x

I am using Emacs 23.3.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
  of 2011-03-19 on braeburn.aquamacs.org - Aquamacs Distribution 2.2 on a mac 
OS 10.6.7.

What should I do in order to fix it?

Thanks in advance,
Dror










[O] Re: Update org-mode

2011-04-02 Thread Achim Gratz
Christian Moe  writes:
> I quickly found that git pulls would overwrite my hand-edited
> Makefile, and a hand-edited Makefile caused conflicts on the next
> pull, and I didn't understand git at all.

You could set up your own local branch to track origin/master and
preferrably using rebase instead of merge.  That will result in the
following configuration (in .git/config):

[branch "local"]
remote = origin
merge = refs/heads/master
rebase = true

>From then on, you can just do "git pull" and your changes to the
Makefile will dutifully re-enacted by git.


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Update org-mode

2011-04-02 Thread Nick Dokos
Christian Moe  wrote:

> I quickly found that git pulls would overwrite my hand-edited
> Makefile, and a hand-edited Makefile caused conflicts on the next
> pull, and I didn't understand git at all.
> 

In 

   http://thread.gmane.org/gmane.emacs.orgmode/17102/focus=17115

Bernt pointed out the existence of an FAQ that explains in detail
the procedure for setting up a local branch that will rebase your
local modifications on top of whatever you pull:

   
http://orgmode.org/worg/org-faq.php#keeping-local-changes-current-with-Org-mode-development

Achim's reply in this thread also explains this, but the extra detail
in the FAQ might be helpful.

Nick






Re: [O] Update org-mode

2011-04-02 Thread Christian Moe

Nick, Achim,

Thanks for this. Other git newbies should obviously ignore my clumsy 
solution and follow those instructions instead.


I guess I missed them because I just stopped looking when I had an 
approach that worked. Embarrassed now.


Dror may still want to check those targets in his Makefile against the 
contents of his Aquamacs.app package.


Yours,
Christian

On 4/2/11 11:02 PM, Nick Dokos wrote:

Christian Moe  wrote:


I quickly found that git pulls would overwrite my hand-edited
Makefile, and a hand-edited Makefile caused conflicts on the next
pull, and I didn't understand git at all.



In

http://thread.gmane.org/gmane.emacs.orgmode/17102/focus=17115

Bernt pointed out the existence of an FAQ that explains in detail
the procedure for setting up a local branch that will rebase your
local modifications on top of whatever you pull:


http://orgmode.org/worg/org-faq.php#keeping-local-changes-current-with-Org-mode-development

Achim's reply in this thread also explains this, but the extra detail
in the FAQ might be helpful.

Nick









[O] [BUG] Changing TODO states sometimes modifies the scheduling of the next heading

2011-04-02 Thread Tom
I have a heading where the scheduling changed misteriuosly. It is
set to repeat weekly and I found it jumped to the next week
without me touching it at all. I set up a background watcher and
after a week it detected when the unwanted change happens.

I could not yet create a simple org file to reproduce the
problem, but I found the problematic part in the code. It happens
when I change the TODO state of a heading with repeating
scheduling. When org modifies the scheduling of the heading
according to the repeat period it also modifies the scheduling of
the heading under it.

Here's the buggy part of the code:


(defun org-auto-repeat-maybe (done-word)
...
(while (re-search-forward
  re (save-excursion (outline-next-heading) (point)) t)


http://repo.or.cz/w/org-mode.git/blob/HEAD:/lisp/org.el#l11546


The problem is the bound for the search is determined within the
while loop. The problem occurs when the scheduling of the heading
is changed and cursor is put on the beginning of the next line
after that. If that next line happens to be the next heading line
then the (outline-next-heading) call in the re-search-forward
skips over the next heading, setting the bound of the search to
the end of it, so the search includes the contents of the next
heading too, so its scheduling is also modified behind the user's
back.

The solution is simple: determine the bound of the search (the
end of the heading) before the while loop and use that value in
re-search-forward, instead of computing it within the loop.