[O] Org Mode dedicated app on OS X

2011-07-04 Thread Ken Mankoff

Hi,

I'm just beginning to use org-mode on OS X. I'm in a terminal a lot, 
and in Aquamacs Emacs a lot too, but not all the time. To make it 
easier to use org-mode, I would like to give it a dedicated app with 
the org-mode icon (unicorn) in the dock. Is there a way to do this?


Fluid.app is a single site browser (SSB) that sort of turns web 
pages into desktop apps. I would like something similar for Emacs.


I think one way might be to make a copy of Aquamacs Emacs, change 
the icon, and then edit the info.plist or some internal file so 
that when it launches it launches directly into org-mode, loading 
some keystrokes to my default view.


Has anyone else done something similar? Is anyone else interested in 
something like this? Any suggestions how to go about doing it?


Thanks,

  -k.



Re: [O] Org Mode dedicated app on OS X

2011-07-05 Thread Ken Mankoff

Hi Stefan,

Thanks for the tips. Most already done.

On Tue, 5 Jul 2011, Stefan Vollmar wrote:
you could start with an Emacs-typical approach by editing your 
~/.emacs-file so that .org-files are automatically opened with 
org-mode


Yes I've followed the initial instructions and love that emacs knows 
modes based on file extension and/or content.



If you put this line into your .bashrc file:
alias e=open -a /Applications/Aquamacs.app/
you can do this from the commandline:
e somefile.org


I use this:

eee() { if [ ! -e $@ ]; then touch $@; fi; /sw/bin/launch -m -a Aquamacs 
$@; }

I also have copied Aquamacs.app, renamed it OrgMode.app, and have 
the unicorn as the icon. I'm a bit stuck on the last step you 
suggest.


If you are thinking about a distribution-like approach (so it 
works out-of-the-box for others) you would probably need to copy 
your changes to a


/Applications/Aquamacs.app/Contents/Resources/site-lisp

directory.


I don't need it to distribute it to 3rd parties, but I'm not opposed 
to setting it up like that. What files should I put in the 
directory? And what contents? And how do I get emacs to auto-load 
them? I'm still figuring out a workflow so please let me know if 
this makes sense, but I'm picturing something like this:


* I launch my OrgMode.app

* It opens and (via its internal site-lisp magic) loads 
~/Dropbox/Org/index.org


* index.org is a file I'll maintain manually that links to my other 
org files so I can access them using the inter-linking ability in 
org-mode


* If something like index.org can be automated that would be OK, but 
I don't mind maintaning it as my meta-org file. Perhaps based on 
something like I have now in my .emacs:


(setq org-agenda-files (list ~/Dropbox/org/foo.org
 ~/Dropbox/org/bar.org))


  -k.



Re: [O] Basic vcard-to-org-contacts converter

2014-03-24 Thread Ken Mankoff

And I posted a solution a few weeks ago that parses the Apple
AddressBook to Org contacts. Wrapped in a LaunchAgent that runs the
script whenever the addressbook is updated (file timestamp changes)
and it keeps mu4e up-to-date with Apple OS X and iDevices.

  -k.

On 2014-03-24 at 20:07, Feng Shu wrote:
 Titus von der Malsburg malsb...@posteo.de writes:

 Hi list!

 I decided to give org-contacts a try.  Since there doesn't seem to be a
 facility for importing contacts in vcard format, I wrote a little Python
 script for that.  Perhaps someone on this list finds it useful.

   https://gist.github.com/tmalsburg/9747104

 The script uses the Python package vobject for parsing vcard files.  On
 Debian-like systems this package is available as python-vobject.  I
 tested the script with contacts exported from Apple's iCloud service and
 that worked well.  However, the vcard format is somewhat messy and I
 don't know what happens with vcard files generated in other contact
 managers.  Use at your own risk.

 Import from csv is a solution too, I use the below hack functions to import a
 csv file...

 #+begin_src

 (defun eh-org-contacts-parse-csv-line (line)
   Build a org contact from a csv line
   (let ((list (split-string line ,)))
 (concat *  (nth 0 list) \n
 :PROPERTIES:\n
 :PHONE:  (nth 1 list) \n
 :EMAIL:  (let ((string (nth 2 list)))
  (if (string-match-p @ string) string
(if ( (length string) 0) (concat string 
 @qq.com \n
 :NOTE:   (mapconcat 'identity (nthcdr 3 list) ; ) \n
 :END:\n)))

 (defun eh-org-contacts-csv-import (optional filename)
   Convert a csv file to org contacts format and insert current point
   (interactive)
   (let ((file (if filename filename (read-file-name CSV file:)))
 (buffer (current-buffer))
 (point (point))
 contacts-string)
   (with-temp-buffer
 (insert-file-contents file)
 (goto-char (point-min))
 (while ( (point) (point-max))
   (setq contacts-string (concat contacts-string 
 (eh-org-contacts-parse-csv-line (buffer-substring (point) (progn 
 (end-of-line) (point \n))
   (forward-line 1)
   (beginning-of-line 1)))
   (switch-to-buffer buffer)
   (goto-char point)
   (insert contacts-string)))

 #+end_src


 If there's interest, I might migrate the script to a proper Github
 repository and develop it further, i.e., merge your pull-requests ;-)

   Titus




Re: [O] Space in Exported Text

2014-03-26 Thread Ken Mankoff

On 2014-03-26 at 14:32, Esben Stien wrote:
 If I f.ex make a beautiful table in org-mode: 

 |-+-+---++-|
 | foo | bar | xyzzy | hukarz | |
 | qux | | corge | grault | garply waldo fred plugh |
 | baz | |   || |
 |-+-+---++-|

  , it's not so beautiful anymore if I send it in an email.

 Is it not possible to force these spacings as space?

 I guess this is gnus fault, but I'm not really sure.

Looks perfect to me. I'm using fixed-width font in my email
client. Changing tabs to spaces won't solve bad looking tables because
most people use variable-width fonts. Nothing you can do about that.

You can also use mu4e and compose emails in an Org minor-mode
(includes babel and everything!) and convert emails to HTML when sent
(and include a plain-text copy too). I think that would be the best
bet of having a table look good to the recipient. See Org Mode
Example section at bottom of
http://www.brool.com/index.php/using-mu4e 

  -k.




Re: [O] Zotero: import HTML -- org syntax?

2014-03-28 Thread Ken Mankoff
On Fri, Mar 28, 2014 at 10:43 AM, Matt Price mopto...@gmail.com wrote:

 Hi,

 so, in my ponderously slow efforts to figure out a decent citation
 workflow for Org, I am trying for some modest integration with Zotero,
 which is the tool my humanities colleagues are most likely to use.

 I keep all of the references for my courses in a Zotero database.
 When generating a syllabus, I select a set of references, then copy
 them over to my org file.  However, then I have to edit each reference
 to give the appropriate italicization; in one of my courses we use APA
 citation formats, which I don't really know very well, and sometimes I
 make mistakes.


Doesn't Zotero offer an option to export to a BibTeX file and keep that
BibTeX file in sync? If so, you can just cite from the BibTeX file in Org
using RefTeX.

  -k.


Re: [O] Using Emacs Org-mode on a server with ssh on an iPad

2014-04-03 Thread Ken Mankoff

If you jailbreak the iPad, you can run a full emacs on the iPad
locally. http://gamma-level.com/iphoneos/ports/emacs 

  -k.

On 2014-04-02 at 09:10, Pere Quintana Seguí wrote:
 As I mentioned in a previous message, I recently bought an iPad.

 I'm considering the possibility to not use Mobileorg and use Emacs on a
 server (Digital Ocean) with an ssh client and a bluetooth keyboard.

 Is anyone using Emacs and org-mode this way regularly? Which ssh client
 are you using? Which bluetooth keyboard?

 Thanks

 Pere




[O] Mac OS Alias file links

2014-04-08 Thread Ken Mankoff

I use links to files quite often in Org Mode. Either by C-l file: or
drag-and-drop (with smart-dnd). But when files move, the links break.

BibDesk solves this by storing Mac OS Aliases to files. Then if files
move, the alias still works. BibDesk actually stores more:

 The Bdsk-File entries store Mac OS aliases, which contain a file ID
 and absolute path. Bdsk-File entries also store a relative path, which
 is used if the alias is broken.

Is there a way to add this feature to Org Mode? Yes, obviously, since
this is emacs and Org Mode. But has anyone already done this? Any advice
where to start?

Thanks,

  -k.



[O] how to debug Archive view in custom agenda

2014-04-11 Thread Ken Mankoff

when I try to view the Archive (v A) in my custom agenda view, I get an
error: 

Rebuilding agenda buffer...
org-refresh-properties: Wrong type argument: integer-or-marker-p, nil

When I view Archive in the timeline for a single Org file (C-c a L v A)
it works just fine.

How do I debug the above message to determine what might be the cause of
the error?

Thanks,

  -k.



Re: [O] how to debug Archive view in custom agenda

2014-04-11 Thread Ken Mankoff

On 2014-04-11 at 18:26, Nick Dokos wrote:
 Ken Mankoff mank...@gmail.com writes:

 when I try to view the Archive (v A) in my custom agenda view, I get an
 error: 

 Rebuilding agenda buffer...
 org-refresh-properties: Wrong type argument: integer-or-marker-p, nil

 When I view Archive in the timeline for a single Org file (C-c a L v A)
 it works just fine.

 How do I debug the above message to determine what might be the cause of
 the error?


 (setq debug-on-error t)

 try the v A again and send in the backtrace.


I can send the backtrace if you want, but I figure it out. I had an 
:Effort: :15 in an archive file which was causing the problem. Not sure
why. Perhaps it needed to be 00:15? Anyway, I just removed it and it
works again.

Thank you,

  -k.



Re: [O] how to debug Archive view in custom agenda

2014-04-11 Thread Ken Mankoff

On 2014-04-11 at 19:04, Nick Dokos wrote:
 Did you figure it out with the help of the backtrace?

Yes. Pasted below. But when I send it, mu4e warns than NUL characters
exist. I've replaced them with one of the options provided, the .
character.


 Send it anyway: it can't hurt and it might help somebody.

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  put-text-property(28799 nil org-effort :15)
  org-refresh-properties(Effort org-effort)
  byte-code(\306!\203\f.q\210\202.\307!\210\310!q\210~\210\311 
\210`.eb\210\312.\313\314\315\312#\203,.\316 \210)\317\2046.\320 
\210\321\204A.\322\f\323\\210\324\204L.\322\325\326\\210\327.%\.\327..'\.\327.(.)\.(\327.*.+\.*\327.,.-..#./\330./!.0\331.0!*.,.1\203\220.\332\327.2.3\!.2\333
 
.4\312\211.5.6\312.7\315\211.8.9\315.:\334\216\212\335ed.;#\210.\203\324.eb\210\336.=\315\312#\203\324.\337\312!\203\270.\340\341
 
\342\312!.#\210\202\270.eb\210\343.?.@\.A\336.A\315\312#\203\365.\340\344\224\342\312!.B#\210\202\337..
   b\207 [file pos case-fold-search 
org-agenda-ignore-drawer-properties org-effort-property 
org-todo-keywords-for-agenda bufferp org-check-agenda-file 
org-get-agenda-file-buffer org-set-regexps-and-options-for-tags t 
search-forward #+setupfile nil org-set-regexps-and-options category 
org-refresh-category-properties effort org-refresh-properties org-effort appt 
APPT_WARNTIME org-appt-warntime append copy-sequence delete-dups 
org-uniquify-alist buffer-modified-p ((byte-code \204.\301\302!\210\302\207 
[modified restore-buffer-modified-p nil] 2)) remove-text-properties 
re-search-forward org-at-heading-p add-text-properties point-at-bol 
org-end-of-subtree format 0 org-todo-keywords-1 org-done-keywords-for-agenda 
org-done-keywords org-todo-keyword-alist-for-agenda org-todo-key-alist 
org-drawers-for-agenda org-drawers org-tag-alist-for-agenda org-tag-alist 
org-tag-persistent-alist list res org-group-tags ...] 5)
  org-agenda-prepare-buffers( ...list_of_files... )
  org-agenda-prepare(My Custom Agenda)
  (let nil (org-agenda-prepare name))
  eval((let nil (org-agenda-prepare name)))
  org-let(nil (org-agenda-prepare name))
  org-agenda-run-series(My Custom Agenda (((tags-todo +DEADLINE=\+3d\ 
((org-agenda-overriding-header Deadline = 3 Days))) (tags-todo 
+SCHEDULED\tomorrow\ ((org-agenda-overriding-header Scheduled Today))) 
(todo INPROGRESS ((org-agenda-overriding-header In Progress))) (todo 
WAITING|VERIFY ((org-agenda-overriding-header Waiting or Verify))) (agenda 
 ((org-agenda-overriding-header Scheduled) (org-deadline-warning-days 0))) 
(todo SOMEDAY ((org-agenda-overriding-header Someday))) (tags REFILE 
((org-agenda-overriding-header REFILE nil (org.txt org.html 
org.ics)))
  eval((org-agenda-run-series My Custom Agenda (quote (((tags-todo 
+DEADLINE=\+3d\ ((org-agenda-overriding-header Deadline = 3 Days))) 
(tags-todo +SCHEDULED\tomorrow\ ((org-agenda-overriding-header 
Scheduled Today))) (todo INPROGRESS ((org-agenda-overriding-header In 
Progress))) (todo WAITING|VERIFY ((org-agenda-overriding-header Waiting or 
Verify))) (agenda  ((org-agenda-overriding-header Scheduled) 
(org-deadline-warning-days 0))) (todo SOMEDAY ((org-agenda-overriding-header 
Someday))) (tags REFILE ((org-agenda-overriding-header REFILE nil 
(org.txt org.html org.ics)
  org-agenda-redo()
  org-agenda-archives-mode(files)
  org-agenda-view-mode-dispatch()
  call-interactively(org-agenda-view-mode-dispatch nil nil)





Re: [O] how to debug Archive view in custom agenda

2014-04-11 Thread Ken Mankoff

Hm.. That didn't work. Trying again...

On 2014-04-11 at 19:47, Ken Mankoff wrote:
 On 2014-04-11 at 19:04, Nick Dokos wrote:
 Did you figure it out with the help of the backtrace?

 Yes. Pasted below. But when I send it, mu4e warns than NUL characters
 exist. I've replaced them with one of the options provided, the .
 character.


 Send it anyway: it can't hurt and it might help somebody.

 Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
   put-text-property(28799 nil org-effort :15)
   org-refresh-properties(Effort org-effort)
   byte-code(\306!\203\f.q\210\202.


Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  put-text-property(28799 nil org-effort :15)
  org-refresh-properties(Effort org-effort)
  byte-code(\306!\203\fq\210\202\307!\210\310!q\210~\210\311 
\210`eb\210\312\313\314\315\312#\203,\316 \210)\317\2046\320 
\210\321\204A\322\f\323\\210\324\204L\322\325\326\\210\327%\\327'\\327()\(\327*+\*\327,-.#/\330/!0\3310!*,1\203\220\332\32723\!2\333
 
4\312\21156\3127\315\21189\315:\334\216\212\335ed;#\210\203\324eb\210\336=\315\312#\203\324\337\312!\203\270\340\341
 
\342\312!#\210\202\270eb\210\343?@\A\336A\315\312#\203\365\340\344\224\342\312!B#\210\202\337.
 b\207 [file pos case-fold-search 
org-agenda-ignore-drawer-properties org-effort-property 
org-todo-keywords-for-agenda bufferp org-check-agenda-file 
org-get-agenda-file-buffer org-set-regexps-and-options-for-tags t 
search-forward #+setupfile nil org-set-regexps-and-options category 
org-refresh-category-properties effort org-refresh-properties org-effort appt 
APPT_WARNTIME org-appt-warntime append copy-sequence delete-dups 
org-uniquify-alist buffer-modified-p ((byte-code \204\301\302!\210\302\207 
[modified restore-buffer-modified-p nil] 2)) remove-text-properties 
re-search-forward org-at-heading-p add-text-properties point-at-bol 
org-end-of-subtree format 0 org-todo-keywords-1 org-done-keywords-for-agenda 
org-done-keywords org-todo-keyword-alist-for-agenda org-todo-key-alist 
org-drawers-for-agenda org-drawers org-tag-alist-for-agenda org-tag-alist 
org-tag-persistent-alist list res org-group-tags ...] 5)
  org-agenda-prepare-buffers( ...list_of_files... )
  org-agenda-prepare(My Custom Agenda)
  (let nil (org-agenda-prepare name))
  eval((let nil (org-agenda-prepare name)))
  org-let(nil (org-agenda-prepare name))
  org-agenda-run-series(My Custom Agenda (((tags-todo +DEADLINE=\+3d\ 
((org-agenda-overriding-header Deadline = 3 Days))) (tags-todo 
+SCHEDULED\tomorrow\ ((org-agenda-overriding-header Scheduled Today))) 
(todo INPROGRESS ((org-agenda-overriding-header In Progress))) (todo 
WAITING|VERIFY ((org-agenda-overriding-header Waiting or Verify))) (agenda 
 ((org-agenda-overriding-header Scheduled) (org-deadline-warning-days 0))) 
(todo SOMEDAY ((org-agenda-overriding-header Someday))) (tags REFILE 
((org-agenda-overriding-header REFILE nil (org.txt org.html 
org.ics)))
  eval((org-agenda-run-series My Custom Agenda (quote (((tags-todo 
+DEADLINE=\+3d\ ((org-agenda-overriding-header Deadline = 3 Days))) 
(tags-todo +SCHEDULED\tomorrow\ ((org-agenda-overriding-header 
Scheduled Today))) (todo INPROGRESS ((org-agenda-overriding-header In 
Progress))) (todo WAITING|VERIFY ((org-agenda-overriding-header Waiting or 
Verify))) (agenda  ((org-agenda-overriding-header Scheduled) 
(org-deadline-warning-days 0))) (todo SOMEDAY ((org-agenda-overriding-header 
Someday))) (tags REFILE ((org-agenda-overriding-header REFILE nil 
(org.txt org.html org.ics)
  org-agenda-redo()
  org-agenda-archives-mode(files)
  org-agenda-view-mode-dispatch()
  call-interactively(org-agenda-view-mode-dispatch nil nil)



[O] Fwd: Mac OS Alias file links

2014-04-13 Thread Ken Mankoff
Hi,

I posted something at the beginning of the week, and have received no
reply. If nobody had anything to say that is fine. But I notice that my
original post on gmane
http://article.gmane.org/gmane.emacs.orgmode/84707 appears blank, so
perhaps the no reply is due to a posting issue. Hence, I send the email
again...

  -k.

On 2014-04-08 at 03:03, Ken Mankoff wrote:
 I use links to files quite often in Org Mode. Either by C-l file: or
 drag-and-drop (with smart-dnd). But when files move, the links break.

 BibDesk solves this by storing Mac OS Aliases to files. Then if files
 move, the alias still works. BibDesk actually stores more:

 The Bdsk-File entries store Mac OS aliases, which contain a file ID
 and absolute path. Bdsk-File entries also store a relative path,
 which is used if the alias is broken.

 Is there a way to add this feature to Org Mode? Yes, obviously, since
 this is emacs and Org Mode. But has anyone already done this? Any
 advice where to start?

 Thanks,

   -k.




Re: [O] Fwd: Mac OS Alias file links

2014-04-14 Thread Ken Mankoff
Hi Bastien,

Thanks for letting me know it displays properly and email received. The
URL works for me this morning too.

On 2014-04-14 at 05:22, Bastien wrote:
 Even for those who uses MacOSX, you should perhaps be more specific
 on how Org-mode would store such links, then somebody might step up.

Aliases are a type of links (ln on linux, shortcut on Windows
alias on OS X (OS X of course also supports ln)). The difference
between an OS X alias and ln is that if the target is moved, the OS X
alias still points to it, and double-clicking on an alias (or issuing
the open command in a terminal) will open the target, wherever it
is. I just checked in a VM and Windows Shortcuts also behave this way.

Therefore, if in addition to file: there were an alias: option, Org
could link to files that move. I think this is a powerful feature. I
imagine alias: would be an option when I press C-cl, and a way to set
it as the default when I press C-ucl.

That is, links would be [[alias:foo][FileName]] where foo is a string
version (hashed?) of the alias.

In BibDesk, foo is ~1200 characters long, and according to the BibDesk
documentation, that ~1200 characters is:

 The Bdsk-File entries store Mac OS aliases, which contain a file ID
 and absolute path. Bdsk-File entries also store a relative path, which
 is used if the alias is broken.

So it looks like an Alias can be hashed some way and stored as just a
string. An example BibDesk entry in by BibTeX file looks like:

@article{citekey,
Author = {Someone},
Journal = {Nature},
Pages = {24--42},
Title = {{A Paper}},
Bdsk-File-1 = {YnBsa...etc for 1200 characters...}}

Opening the file with C-o would involve un-hashing it, and then treating
it the same way a file: is opened.

I imagine Org would mostly store the links the same way it stores file
links. The change would be that since the link is the alias (long ugly
string), the description would be required, and perhaps default to
/path/to/filename. Although since the whole point is that the /path/to/
can change, perhaps the default name would just be filename.

  -k.



Re: [O] Fwd: Mac OS Alias file links

2014-04-14 Thread Ken Mankoff

On 2014-04-14 at 08:42, Nick Dokos wrote:
 What does emacs do when you C-x C-f an alias?

Alias in OS X (and Shortcut in Windows) present as files. Org treats it
just as it should - as a file. Everything works.

 If it opens it properly (i.e. opens the target file) then why is
 anything needed in org? It seems to me that a file: link should just
 work.

 If it does not, then maybe that's where the capability should be added.
 Org seems to be the wrong place for it.

 But note that everything I know about aliases, I learnt in the last five
 minutes, so I could be way off the mark.

This requires me to 1) manually make an alias (something I never do), 2)
choose where to store that alias on disk, and then 3) link to the alias
in Org. Worse, the situation is not improved or difference since if the
alias moves, the Org link (to the alias) is broken.

I'm imagining the alias never exists on disk. Just as a representation
inside Org, and pointing to the target file. Now the link can never
break, unless the target is deleted. And there is no additional effort
on our part beyond the existing work to make a link.

  -k.

P.S. How does one make a link to a folder or directory in org? 





Re: [O] Fwd: Mac OS Alias file links

2014-04-14 Thread Ken Mankoff

On 2014-04-14 at 12:26, Achim Gratz wrote:
 Ken Mankoff writes:
 Aliases are a type of links (ln on linux, shortcut on Windows
 alias on OS X (OS X of course also supports ln)). The difference
 between an OS X alias and ln is that if the target is moved, the OS
 X alias still points to it, and double-clicking on an alias (or
 issuing the open command in a terminal) will open the target,
 wherever it is.

 If I understand correctly, this only works through Finder and not from
 a shell and POSIXfile access functions.  Whether or not Emacs could
 use aliases therefore depends on what interface it is using to access
 files on MacOS (I have no idea).

When you say this only works I'm not sure what you are referring to. I
assume creation and/or access.

* Creation 

Yes creating Aliases is a Finder function, although creation can be
scripted from the shell through the osascript CLI utility provided on
OSX.

* Access

Some access works through the shell.

If I make a link to an alias in Org, opening the link works and is
handled by the system for all the different types of files I can create
an alias to.

But an alias is not like an ln-like link. It presents to the OS as its
own file, so if you try to edit an alias to a plain text file, you get a
bunch of garbage (the alias), not the plain text file.

In my fantasy, the link wouldn't be to an alias file, it would *contain
the alias* the way the BibDesk field does. Therefore C-o on an alias:
link would require extra code: Decode the alias, then pass it off to the
system.

 I just checked in a VM and Windows Shortcuts also behave this way.

 No, they don't.  Explorer does find the file if you move it into a
 subfolder and will ask you to tell it where it went if it doesn't find
 it, but any direct access through that shortcut will fail as if the
 file didn't exist.  Also, WIndows shortcuts and Windows links are two
 totally different things and links don't follow moving targets either.

My system is different. I'm not sure why. I have an XP VM. I created a
New Text Document file on the desktop. I right-click, and select
Create Shortcut. I have a new shortcut on the desktop. I moved the
original file elsewhere (C:\, My Documents, etc. not just subfolders),
double-clicked on the shortcut (still on Desktop), and the original file
opened. I could edit and save it and saves were placed into the
relocated file. If direct access you mean POSIX-level access, then
perhaps. I don't know. But I think emacs can operate on files at a
higher level. 

  -k.



Re: [O] Fwd: Mac OS Alias file links

2014-04-14 Thread Ken Mankoff

On 2014-04-14 at 13:42, Charles Berry wrote:
 The point of using an alias rather than a filename or the name of a
 symbolic link that points to the file is that it inherits the property
 of Mac OS X aliases that moving the file does not break the alias ---
 it still points to file.

Exactly!

 For this to work as you fantasize, you would need to enable the Finder
 application to modify the part of the *.org file that encodes the
 alias when you change the location of the aliased file just as the
 Finder does to the alias when the location of the aliased file is
 modified in the Finder.

I don't think so. I'm not sure how BibDesk handles it, but my BibTeX
file is not modified when I move the PDF that is linked to an entry via
that 1200 character field that encodes the alias. Clearly BibDesk does
something neat to encode and decode that field, but once created, the OS
nor Finder know anything about that line or the file containing it. I
don't think Finder would need to know about a string in an Org file
either.

 OTOH, writing an AppleScript to make an alias in a folder that is
 never moved, writing elisp to call that script and then make an
 org-mode link to the alias just created might work for you.

Yes this would work too as a hack.

  -k.



Re: [O] Fwd: Mac OS Alias file links

2014-04-14 Thread Ken Mankoff

On 2014-04-14 at 20:21, Charles C. Berry wrote:
 BibDesk has an archive of entries typically stored at

 ~/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/*.bdskcache

 and the 'NS.data' element of Bdsk-File-1 seems to point to one element.

 The *.bdskcache file has a bplist and I guess the 'FileAlias' component 
 is what points to the pdf or whatever.

Aha! I think this is essentially what you described in your last
email when you said,

 OTOH, writing an AppleScript to make an alias in a folder that is
 never  moved, writing elisp to call that script and then make an
 org-mode link to  the alias just created might work for you.  

I guess that is how it is done. I think I can figure out how to do this
much in elisp + a system language. The elisp side will be a good
learning project.

 One approach that sidesteps having to know the CoreFoundation.h stuff
 is to use the BibDesk AppleScript capabilities. There is a model for
 this at

 http://www.jonathansick.ca/adsbibdesk/

 written in python, FWIW.

Yes. The AppKit module is a nice interface from Python to the OSX
system. I think I will likely write the non-emacs code using this, or
AppleScript or Automator directly.

  -k.



Re: [O] Mobileorg doesn't correctly import one .org file

2014-04-16 Thread Ken Mankoff

On 2014-04-16 at 12:49, Bastien wrote:
 Pere Quintana Seguí p...@quintanasegui.com writes:

 Everything looks fine except one file which is not correctly
 imported.

I missed and can't find the original email, but does the erroneous file
have an  in the filename? That is a known MobileOrg bug.

  -k.



[O] python babel not running startup file

2014-04-24 Thread Ken Mankoff

I have the PYTHONSTARTUP environment variable set to ~/.pythonrc. That
file is not run by Org babel. Can anyone recommend how to execute that
file, or some other method for customizing all Org babel python
executions.

Specifically, I load a custom colorbar in my ~/.pythonrc and
~/.ipythonrc files, and would like Org python to behave the same.

  -k.



Re: [O] python babel not running startup file

2014-04-25 Thread Ken Mankoff

On 2014-04-25 at 11:28, Eric Schulte wrote:
 Yes, customize the org-babel-python-command variable.

Right. I had tried that and it didn't work before I sent the email. This
does work:

(setq org-babel-python-command python -i /Users/mankoff/.pythonrc)

Perhaps I had a typo or other bug with my previous attempt.

Works now!

Thanks,

  -k.



Re: [O] State of the art in citations

2014-04-27 Thread Ken Mankoff
Hi Clément and Others,

On 2014-04-27 at 10:14, Clément B. wrote:
 (setq reftex-cite-format
'((?\C-m . \\cite[]{%l})
  (?b . [[ref:%l][%A (%y)]])))

I've been using reftex in Org - LaTeX for a while and have my Org text
sprinkled with \cite{foo:}. I just saw the customized
reftex-cite-format from Clément (above). It looks much nicer in the
text, but raises two questions:

1) Can the link just use lastname? It looks like %A is the only way to
access author names, and does full names, so perhaps not without writing
some custom function? And more importantly, 

2) When I export this to LaTeX, it is not treated as a proper LaTeX
citation. The text is just the %A (%y) part. Is there some way to
export so that the ref:%l turns into a \cite{%l}? 

Thanks,

  -k.



Re: [O] State of the art in citations

2014-04-27 Thread Ken Mankoff

On 2014-04-27 at 10:53, Clément B. wrote:
 Hi Ken,

 When I export this to LaTeX, it is not treated as a proper LaTeX
 citation. The text is just the %A (%y) part. Is there some way to
 export so that the ref:%l turns into a \cite{%l}?

 The ref is a custom link type, you can define those in org with
 `org-add-link-type`, and they allow control over the export
 behaviour. See the previous posts in this thread for an example.

Ah! Got it. This is really nice. Thank you. 

I find the best way to support ODT is simply add something like this:

  ((eq format 'odt)
   (format (%s) desc))

This doesn't create a bibliography section, but that section is awkward
to export to anyway. It requires the 3rd party Org hack that isn't
officially supported, java, jabref, is awfully slow (~2
seconds/reference), etc. I now put the references inline as above, and
then manually add the references by exporting to PDF and copying/paste
that reference section. 

Not great, but less of a hack than ODT-supported references, and working
with ODT/Word is a hack anyway.

Still looking into lastname (Year) format...

  -k.



Re: [O] State of the art in citations

2014-04-27 Thread Ken Mankoff

On 2014-04-27 at 12:05, Clément B. wrote:
 Still looking into lastname (Year) format...

 I hadn't noticed that before, but now that you mention it, I
 think this is related to the way you format your bib file.

 For example %A (%y) with:

 1. name = {Darwin, Charles}
year = {1859}

will yield Darwin (1859)


 2. name = {Charles Darwin}
year = {1859}

will yield Charles Darwin (1859)

 Not very consistent. This might be something to take to the AUCTeX
guys.

I've asked about this here:
https://tex.stackexchange.com/questions/173804/best-practices-for-bibtex-author-field
 

Maybe bibtool or some other tool can reformat my BibTeX 
file to Last, First.

  -k.



Re: [O] State of the art in citations

2014-04-27 Thread Ken Mankoff

On 2014-04-27 at 12:01, Thomas S. Dye wrote:
 Clément B. clem...@inventati.org writes:

 This makes inserting custom links (ref) easier with the usual
 `reftex-citation` bound to C-c [.

 On the other hand, it will work with multicite commands,
 whereas Clement's does not look like it will.

 It does not, and that's a big limitation. 

It appears to work for multicite for me. Or at least well enough. If I
select multiple entries, I get this:

[[ref:Author1:,Author2:,Author3:][()]]

I can then easily insert the text I want into the (). It exports
properly to LaTeX as \cite{Author1:,Author2:,Author3:}.

Maybe most people multi-cite more than me, but I think it is only a bit
of extra work to add what I want in the () and then it exports properly
to LaTeX and, using the references-via-LaTeX, to ODT/HTML too!

  -k.



[O] minted in Org 8.6

2014-04-29 Thread Ken Mankoff

When I export w/ the latest Org all code environments are verbatim, not
minted. I'm using a test example from
https://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00585.html
which is:

#+begin_src emacs-lisp
;; minted latex export
(setq org-export-latex-listings 'minted
  org-export-latex-minted-options
  '((frame lines)
(fontsize \\scriptsize)
(linenos )))
#+end_src


If I test this with emacs -Q, it works. If I test it with my default,
code is exported as verbatim. This suggests the bug is in an init file
of mine.

However, I have removed all Org sections of my init file. I am fairly
confident this is not a setting of mine, since if I look at the current
state included in a org-submit-bug-report, the state is almost the
same between emacs and emacs -Q, the only difference being Org 7.9 v.
Org 8.6, and a few default settings that have changed between the two.

Could this be a setting set somewhere else that is not included in the
bug report? How would I find it? Or is it a bug w/ minted export in the
latest Org? 

Thanks,

  -k.



Re: [O] Bibliography woes!

2014-05-05 Thread Ken Mankoff

On 2014-05-05 at 19:39, John Hendy wrote:
 If this works, someone can chime in regarding how to modify Org so
 that it will run the necessary biber/biblatex commands so you don't
 have to jump to a command line every time. Or perhaps that's a one
 time thing -- maybe as long as biber generates the .bbl file, you can
 refer to anything you want in that file from then on?

I've found latexmk to be the best tool for compiling LaTeX
documents. It runs all necessary commands as many times as needed,
including pdflatex, bibtex, biblatex, etc.. It is fairly smart and will
run the command to make the index if you load the index, for example. 

It can run in daemon mode and monitor the included files (and graphics)
so if one of those changes, the PDF is regenerated.

I prefer daemon mode, so I bring up a terminal and run latexmk file.tex
in the folder where I'm working on file.org. This also speeds things up,
since exporting to latex is fast, but compiling is slow. I can export
and still use emacs, rather than waiting for the compile to finish.

But if you want to run latexmk from Org, that works too. The -pvc-
turns off the preview continuous mode (daemon).

(setq org-latex-pdf-process (list /usr/texbin/latexmk -f -gg -pvc- %f))

  -k.



Re: [O] Bibliography woes!

2014-05-06 Thread Ken Mankoff

On 2014-05-06 at 03:33, Rainer M Krug wrote:
 Ken Mankoff mank...@gmail.com writes:
 I've found latexmk to be the best tool for compiling LaTeX
 documents.

 This sounds very interesting. Could you please provide some details on
 how you use latexmk? Do you use any special options?

My ~/.latexmkrc file is below. It appears I have extra functions for
making glossaries and working with PythonTeX. There is plenty of support
for latexmk on TeX.SE
https://tex.stackexchange.com/questions/tagged/latexmk

Since I turn on preview_continuous_mode in my ~/.latexmkrc, I need to
explicitly turn it off if I am calling latexmk from Org, hence the
-pvc- option here:

(setq org-latex-pdf-process (list /usr/texbin/latexmk -f -gg -pvc- %f))

But as I said, I find I prefer to bring up a terminal in the directory
where I am working, and dedicate it to running 'latexmk' in continuous
monitoring mode. When I want to clean up a project I'll run latexmk -c
file.tex to discard all of the temporary files. I have Skim.app or
Preview.app (OS X PDF viewers) open the PDF file. I edit Org files,
export to LaTeX (C-c C-e l l), and then keep working while the PDF
regenerates. 

  -k.



# BEGIN ~/.latexmkrc

$pdf_mode = 1;
$preview_continuous_mode = 1;
$new_viewer_always = 1;
$silent = 1; # don't stop on errors
$verbose = 0;
#$halt_on_error = 1;

$clean_ext = 'bbl run.xml %R-blx.bib acn glo xdy synctex.gz';

# continue past errors
$force_mode = 1; 
$shell_escape = 1;

# shell escape
$pdflatex = 'pdflatex --shell-escape -file-line-error -synctex=1 %O %S';

# $pdf_previewer = 'open -a /Applications/Preview.app';
$pdf_previewer = 'open -a /Users/mankoff/local/Applications/Skim.app';

# Sage:
# http://permalink.gmane.org/gmane.comp.mathematics.sage.support/17166

# glossaries 
http://tex.stackexchange.com/questions/1226/how-to-make-latexmk-use-makeglossaries
add_cus_dep('glo', 'gls', 0, 'makeglo2gls');
sub makeglo2gls {
system(makeindex -s '$_[0]'.ist -t '$_[0]'.glg -o '$_[0]'.gls 
'$_[0]'.glo);
}

# PythonTeX
add_cus_dep('pytxcode', 'pyg', 0, 'pythontexcompile');
sub pythontexcompile {
system(pythontex.py $_[0]);
}





[O] export section body but not section title

2014-05-06 Thread Ken Mankoff

Is there a way (tag?) in Org to export the body but not the
title/heading? For example,

* Section 1   :noexport:
  Some Text
* Section 2
  Some more text

Would not export the Some Text or any part of Section 1. I'd like to
export the Some Text text, just not the title Section 1. 

Use Case: More sections and collapsability in the Org doc makes
writing/organizing easier, but the journal format doesn't allow any
sections except one (Supplemental Material). 

Is this supported in Org as-is, or does it require a bit of Lisp code?
I'd be happy for a LaTeX-specific solution.

  -k.




Re: [O] How to generate an index?

2014-05-07 Thread Ken Mankoff
Hi Sharon,

 * Things not working properly
 - I can't find how to get the title, author and date on a page of
 their own. 
 - I can't find how to get references showing in the table of
 contents.
 - The index is working with the default of 2 columns, but I want the
 page numbers to all be aligned to the right. I haven't yet found how
 to do it.

 Can anyone help with any, or all, of the three problems I've just
 outlined please? Apart from those its working well :)

These are all LaTeX issues, not Org issues.

Have you tried searching on https://tex.stackexchange.com/ They are very
helpful there, and all of these questions are answered there.

https://tex.stackexchange.com/questions/29440/how-can-i-get-maketitle-to-create-a-separate-title-page-with-the-article-class
https://tex.stackexchange.com/questions/8458/making-the-bibliography-appear-in-the-table-of-contents

Etc.

I suggest you work outside of Org in pure LaTeX to solve these
issues. Then try to get everything working in Org. One step at a time.

  -k.



[O] Adding export option for babel language

2014-05-07 Thread Ken Mankoff

I'd like to add support for PythonTeX to Org Babel 
https://github.com/gpoore/pythontex

The motivation is that PythonTeX is a better literate environment than
just Org + Babel, because it can print results inline just like an
interactive Python session, instead of all the code followed by all the
results. 

This is just a modification to the existing LaTeX export for python, it
is not support for a new language. I'm new to Org development and seek
advice how to begin approaching the solution.

I'd like the python code blocks to behave just as they do now, but if I
have set (setq org-latex-listings 'pythontex) instead of (setq
org-latex-listings 'minted), then instead of wrapping python code blocks
with:

\begin{minted}[]{python}
x+2
print x
\end{minted}

It should wrap them with

\begin{pyconsole}
x+2
print x
\end{pyconsole}

I found out that the minted export is handled in ox-latex.el, and I
assume I could get pythontex support by going through that file and
tearing it down and building it back up with pythontex in place of
minted, but I also noticed this:

   ;; Case 2.  Custom environment.
   (custom-env (format \\begin{%s}\n%s\\end{%s}\n
   custom-env
   (org-export-format-code-default src-block info)
   custom-env))

Can I take advantage of this code? It seems like this might be the
support for Special Blocks
http://orgmode.org/worg/org-contrib/org-special-blocks.html But that
page says that the code is obsolete. And a special block won't be
treated as a python org babel block in the Org file, which is important.

Any advice where I should start digging to add pythontex support will be
much appreciated.

Thanks,

  -k.




[O] Org + Elpy Python + IPython

2014-05-07 Thread Ken Mankoff

FYI Org + Elpy + IPython all play nicely now.

There have been some previous posts about people (me included) having
trouble using the full IPython stack in Org Mode. Some of those problems
were limited to when using sessions, and others only if trying to take
full advantage of the nice Python support provided by Elpy (enabled via
the (elpy-use-ipython) command).

I think the primary issue was Org text analysis on the  prompt which
in IPython becomes In [n]:. This is solved with the --classic flag
to ipython.

With this setup:

(setq org-babel-python-command ipython --pylab=qt4 --pdb --nosep --classic 
--no-banner --no-confirm-exit)

I now have Org, Python, IPython, and Elpy (including (elpy-use-ipython))
all running together in session and non-session mode.

  -k.



Re: [O] Adding export option for babel language

2014-05-08 Thread Ken Mankoff
Hi Chuck,

On 2014-05-08 at 12:17, Charles Berry ccbe...@ucsd.edu wrote:
 I'd like the python code blocks to behave just as they do now, but if I
 have set (setq org-latex-listings 'pythontex) instead of (setq
 org-latex-listings 'minted), then instead of wrapping python code blocks
 with:
 
 \begin{minted}[]{python}
 x+2
 print x
 \end{minted}
 
 It should wrap them with
 
 \begin{pyconsole}
 x+2
 print x
 \end{pyconsole}
 

 A quick-and-dirty approach to do just that much would be to write an export
 filter for `src-block' and maybe `inline-src-block', see

(info (org) Advanced configuration)

http://orgmode.org/worg/dev/org-export-reference.html#filter-system

 and 

 http://orgmode.org/worg/exporters/filter-markup.html


 Also, `C-h f org--filter TAB' should give you a buffer of such filter
 functions (and a couple of false positives) that you might browse.

I've briefly looked at the filters. Yes, it seems like that might be one
way to do this. But I have a hunch it is already implemented, and that I
just don't know how to access it or what variable to set.

See:
http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/ox-latex.el#n2280

Where Case 1 is no fontification, Case 3 is minted, and Case 2 is
custom. I can see that if `custom-env` is set correctly, it wraps the
code exactly as I want above:

   (custom-env (format \\begin{%s}\n%s\\end{%s}\n
   custom-env
   (org-export-format-code-default src-block info)
   custom-env))

But I'm not sure where to set custom-env, although I know I want to set
it to `pyconsole`.

  -k.



Re: [O] Adding export option for babel language

2014-05-08 Thread Ken Mankoff

I figured it out:

(setq org-latex-custom-lang-environments
 '((python pyconsole)))

And of course \usepackage{pythontex} somewhere.

This is really nice. Now the Org buffer behaves as before, but the
exported LaTeX has the python code appear as if it were run right there
in an interactive session. I set :export code so the Org results are
not shown in the PDF, and PythonTeX re-generates the results and puts
them inline!

  -k.


On 2014-05-08 at 15:53, Ken Mankoff mank...@gmail.com wrote:
 Hi Chuck,

 On 2014-05-08 at 12:17, Charles Berry ccbe...@ucsd.edu wrote:
 I'd like the python code blocks to behave just as they do now, but if I
 have set (setq org-latex-listings 'pythontex) instead of (setq
 org-latex-listings 'minted), then instead of wrapping python code blocks
 with:
 
 \begin{minted}[]{python}
 x+2
 print x
 \end{minted}
 
 It should wrap them with
 
 \begin{pyconsole}
 x+2
 print x
 \end{pyconsole}
 

 A quick-and-dirty approach to do just that much would be to write an export
 filter for `src-block' and maybe `inline-src-block', see

(info (org) Advanced configuration)

http://orgmode.org/worg/dev/org-export-reference.html#filter-system

 and 

 http://orgmode.org/worg/exporters/filter-markup.html


 Also, `C-h f org--filter TAB' should give you a buffer of such filter
 functions (and a couple of false positives) that you might browse.

 I've briefly looked at the filters. Yes, it seems like that might be one
 way to do this. But I have a hunch it is already implemented, and that I
 just don't know how to access it or what variable to set.

 See:
 http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/ox-latex.el#n2280

 Where Case 1 is no fontification, Case 3 is minted, and Case 2 is
 custom. I can see that if `custom-env` is set correctly, it wraps the
 code exactly as I want above:

(custom-env (format \\begin{%s}\n%s\\end{%s}\n
  custom-env
  (org-export-format-code-default src-block info)
  custom-env))

 But I'm not sure where to set custom-env, although I know I want to set
 it to `pyconsole`.

   -k.




Re: [O] org-edit-src-code outside of org

2014-05-13 Thread Ken Mankoff
Hi Jorge,

mu4e has an option to edit mail messages in Org mode. You can insert and
execute code blocks, etc. See example at bottom of this blog post:
http://www.brool.com/index.php/using-mu4e

  -k.

On 2014-05-13 at 14:49, Jorge A. Alfaro-Murillo jorge.a.alf...@gmail.com 
wrote:
 Hi, I would like to use org-edit-src-code outside of org, I think it
 would be very handy in Message mode, to send messages that contain code
 and edit that code in the proper mode.

 I put something like this

  #+BEGIN_SRC emacs-lisp
(defun mm-org-try-structure-completion ()
  (interactive)
  (if (not (org-try-structure-completion))
  (message-tab)))
(eval-after-load message
  '(progn
 (define-key message-mode-map (kbd tab)
 'mm-org-try-structure-completion)))
  #+END_SRC

 which allows me now to do 'a letter' and hit tab and get a the proper
 source block just as in org.

 I can enter the editing of the source block without problems with
 org-edit-src-code (which I plan to bind to C-c ', just as in org),
 however when I am want to close the editing and go back to the message
 buffer it fails, specifically the part of org-edit-src-exit that says:

  #+BEGIN_SRC emacs-lisp
(unless (org-bound-and-true-p org-edit-src-from-org-mode)
   (error This is not a sub-editing buffer, something is wrong))
  #+END_SRC
   
 Is there a particular reason why the code has to check to see if it is
 coming from org-mode? Shouldn't it be enough that already the
 org-in-block-p was passed?

 If I evaluate the function definition of org-edit-src-exit without the
 last part everything works as expect, I can exit with C-c ' and the code
 is there. Even doing C-x C-s before exiting works as well.

 Best,

 Jorge.

 PS: What is the alternative when you write messages with code, do you
 guys first write it in org and then copy and yank it?




Re: [O] Using Emacs, Org-mode and R for Research Writing in Social Sciencess

2014-05-13 Thread Ken Mankoff
Hi Vikas

On 2014-05-13 at 12:52, Vikas Rawal vikasli...@agrarianresearch.org wrote:
 
 You mentioning pandoc as one of the tools to use made me finally sit
 down and look at it.  I am very glad I did.  Just today, I started
 working on a paper that has to be in Word format in the end.  This is
 always annoying but especially when the paper has mathematics in it.

 I have been totally addicted to Org-mode, and find it absurd to write
 in Word. On the other hand, none of my collaborators use LaTeX or
 Org. For a long time, I produced PDFs, circulated them, and then in
 the end, when others had to work on the document, bit my lip and
 converted it painfully to Word, manually fixing all LaTeX-specific
 stuff.

 Pandoc is a treat and clearly the way to go, at least until
 development of odt exporter catches up.

Your post gave me hope that Org - LaTeX - docx (via pandoc) would work
for me. It does not. The equations do not show up, among many other
issues.

I'm using Org 8.2.6, pandoc 1.12.3, Pages.app on OS X 10.9 and Word 2011
(v. 14.2.0).

I use pandoc like this:

pandoc -f latex -t docx test.tex -o test.docx

I see Org has exported my W m^{-2} as W m$^{\text{-2}}$, which is
not what I would expect in LaTeX. In OS X Pages.app viewing the docx
this appears as W m. In Word it shows up either as just -2 or W
m-2. In Word, the Math shows up with each character as a box (the math
is just missing in Pages). In Word the figures are missing (they appear
in Pages).

Can you clarify your Org - LaTeX - Docx workflow? It would be nice to
be able to do this.

Thanks,

  -k.



Re: [O] Using Emacs, Org-mode and R for Research Writing in Social Sciencess

2014-05-14 Thread Ken Mankoff

On 2014-05-14 at 01:00, Vikas Rawal vikasli...@agrarianresearch.org wrote:
 
 pandoc -f latex -t docx test.tex -o test.docx
 
 I see Org has exported my W m^{-2} as W m$^{\text{-2}}$, which is
 not what I would expect in LaTeX. In OS X Pages.app viewing the docx
 this appears as W m. In Word it shows up either as just -2 or W
 m-2. In Word, the Math shows up with each character as a box (the math
 is just missing in Pages). In Word the figures are missing (they appear
 in Pages).
 

 First, you should differentiate between whether the problem is in
 Org-LaTeX conversion, or in LaTeX-Docx conversion.

 From what you describe above, the problem seems to be in Org-LaTeX 
 conversion. 

 For me, $W m^{-2}$ in Org produces correct LaTeX markup, and I get a good 
 docx using Pandoc.

Yes that equation problem seems to be due to me and Org-LaTeX.

But elsewhere I have

\begin{equation}
x=42
\end{equation}

in Org, which looks just like that in LaTeX, and that appears as just
strange little extended ASCII boxes in MS Word.

  -k.



[O] Org based websites w/o export

2014-05-19 Thread Ken Mankoff

I've just come across an interesting website generator that I think has
potential for making Org websites. I have no affiliation with this
project, but thought it might interest this community. I have an
interest in an org-based website, but none of the existing ones have met
my needs yet.

Jr https://github.com/Xeoncross/jr is a static static (yes 2x) site
generator. Most static site generators work by you writing markdown,
then you converting to HTML locally, and then you uploading the static
HTML pages. Existing Org site generators work like this to, I think -
export to markdown and then convert again with Jekyll. Or of course you
can convert Org to HTML directly.

Jr works by having javascript render the markdown to HTML. That is, you
write markdown, upload markdown w/o running a generator, and the
generator runs in the browser of the viewer.

This is efficient for the server (simpler pages) and author (no need to
run a static site generator), but may be globally inefficient for a
popular site (many browser doing rendering).

If Jr or a fork rendered Org to HTML instead of Markdown to HTML, then
we could have website that are directly written in Org. A starting place
for this is the existing Javascript support for Org here
http://orgmode.org/manual/JavaScript-support.html but that still
requires you to export the Org file to HTML before uploading it to the
web.

Anyway... maybe of interest to some of y'all. I'll be watching that
program develop and may be contributing to an Org port of it as I have
time.

   -k.



Re: [O] Org + Elpy Python + IPython

2014-05-20 Thread Ken Mankoff

Addendum to this old thread:

On 2014-05-07 at 22:52, Ken Mankoff mank...@gmail.com wrote:
 FYI Org + Elpy + IPython all play nicely now.

 There have been some previous posts about people (me included) having
 trouble using the full IPython stack in Org Mode. Some of those
 problems were limited to when using sessions, and others only if
 trying to take full advantage of the nice Python support provided by
 Elpy (enabled via the (elpy-use-ipython) command).

 I think the primary issue was Org text analysis on the  prompt which
 in IPython becomes In [n]:. This is solved with the --classic flag
 to ipython.

 With this setup:

 (setq org-babel-python-command ipython --pylab=qt4 --pdb --nosep --classic 
 --no-banner --no-confirm-exit)

 I now have Org, Python, IPython, and Elpy (including
 (elpy-use-ipython)) all running together in session and non-session
 mode.

ipython --classic appears to let IPython work properly with Org, but it
does not. There are some nefarious bugs. For example, the second
indented for loop (foo, bar) never runs if the interpreter is ipython
--classic, but runs properly for python.

for n in [1,2]:
print n
for a in ['a','b']:
print a

for f in ['foo','bar']:
print f

It appears that IPython munges empty lines differently than python. I've
tried the  --no-autoindent and --no-pprint and the blank line still
causes problems. Anyway, I recommend sticking with plain Python which
works in all code I've tried both session and non-session.

  -k.





Re: [O] Org + Elpy Python + IPython

2014-05-20 Thread Ken Mankoff

And with a bit more work (and help from others) I have it working.

IPython, Org, Elpy, session or no-session. Still cannot set
(elpy-use-ipython) which makes the IPython sessions a bit less awesome
(no popup help, for example). But everything else appears to work.

(setq org-babel-python-command ipython --pylab=osx --pdb --nosep --classic 
--no-banner --no-confirm-exit)

;; https://github.com/jorgenschaefer/elpy/issues/191
;; https://lists.gnu.org/archive/html/emacs-orgmode/2014-03/msg00405.html
;; make IPython work w/ Org
(defadvice org-babel-python-evaluate
  (around org-python-use-cpaste
  (session body optional result-type result-params preamble) activate)
  Add a %cpaste and '--' to the body, so that ipython does the right thing.
  (setq body (concat %cpaste -q\n body \n--\n))
  ad-do-it
  (if (stringp ad-return-value)
  (setq ad-return-value (replace-regexp-in-string \\(^Pasting code; enter 
'--' alone on the line to stop or use Ctrl-D\.[\r\n]:*\\) 
  ad-return-value


 -k.




Re: [O] Advice needed: Cant find a decent way to autosync my work TODO org file between laptop and work pc

2014-05-24 Thread Ken Mankoff

Do you have auto-revert enabled for that file? At the top of a
dropbox-shared Org file I have this:

# -*- coding: utf-8; eval: (auto-revert-mode 1); -*-

I still find it a bit buggy, and also have this code snippet which I
execute whenever I begin editing in that Org file. I also try to
remember to save it when done.

#+BEGIN_SRC emacs-lisp :results none
(revert-buffer nil t)
#+END_SRC

  -k.

On 2014-05-24 at 01:11, Xebar Saram zelt...@gmail.com wrote:
 Hi all

 i need to sync my main work TODO org file between my work PC and laptop i
 carry around on work related trips and when im at home. i have tried
 several methods buy really none of them work.

 i mainly used git over the last 6 months but that forces me to
 pull/commit/push manually each time i add something to either machine and
 that is really annoying. plus i get merge conflicts all the time

 I have tried dropbox at the past but again this causes conflicts,
 isntreliable to me (on my
 linux laptop it doesn't always resume sync after sleep)

 I am using linux (arch linux on laptop  and debian on work PC to be precise)

 Also i use mobileorg on phones/tablets which works with various levels of
 success :)

 any advice would be hugely appreciated!

 thanks alot

 Z



Re: [O] [FR] Archive subtree with parent structure

2014-05-28 Thread Ken Mankoff

On 2014-05-28 at 15:39, Bastien wrote:
 If I also archive AB after that, it gets inserted in the structure which
 is now identical to the structure we started with.

 FR noted, thanks.  I'm curious to see if people would really find this
 a good option, as I like having my archives stored as flat entries.

+1. 

I'd find this useful. I would like archives to exactly mimic source, and
I also archive sub-tasks and items throughout a project, not just the
entire project when I'm done with it.

Currently my archive setup is:

;; http://orgmode.org/worg/org-hacks.html#sec-1-7-1
(setq org-archive-location (concat org-directory /archive/%s_archive::* 
Archived Tasks))
;; Archive to archive/foo.org_archive and then under the existing header
(defadvice org-archive-subtree (around my-org-archive-subtree activate)
  (let ((org-archive-location
 (if (save-excursion (org-back-to-heading)
 ( (org-outline-level) 1))
 (concat (car (split-string org-archive-location ::))
 ::* 
 (car (org-get-outline-path)))
   org-archive-location)))
ad-do-it))

  -k.



Re: [O] proposal to have ignoreheading tags/properties

2014-06-12 Thread Ken Mankoff

+1 to the OP.

On 2014-06-12 at 13:32, Thorsten Jolitz wrote:

 In a tree structure, when ignoring the parent node, it seems only
 logical that the siblings are ignored too.

I'm found myself in all of the following situations: 
  1. I want the heading and everything below not-exported
  2. I want the heading not-exported, but the content exported. 
 1. I don't care if the sub-headings are kept or moved up a level
 2. I do care - I want the sub-headings to remain as-is.
 3. I do care - I want the sub-headings to be promoted.
  3. I want the heading and the heading-level content not-exported, but
 sub-heading and their content exported

 You seem to use the wrong tool for the task (headlines), this looks
 like a perfect use case for TAGS, i.e. define your (concept) groups as
 tags. If these tags are not part of `org-export-exclude-tags' they
 won't affect exporting, but you can still use them to build your
 agenda or a sparse tree or so.

A simple example where tags don't work, nothing to do with agenda. Some
paper formats (Nature, for example) do not allow headings or
sub-headings. It is just 2 pages of text. But it is certainly nice to
write the paper and organize thoughts in sections and sub-sections. This
is case 2.0 above. Each heading is tagged :noexport and it is not
exported, but the content (text, figures, lists) below the heading is
exported. I'm not sure how tags would help here, other than the tag of
:noexport. 

Another common (for me) example is to have a heading called * Appendix
in a paper, and then the LaTeX \appendix command. The Org heading is
just for me. It should not be exported. All headings below the \appendix
command are Org sub-sections but should be promoted to \section in the
final document.

  -k.



Re: [O] proposal to have ignoreheading tags/properties

2014-06-12 Thread Ken Mankoff

On 2014-06-12 at 14:11, Thorsten Jolitz wrote:
 Ken Mankoff mank...@gmail.com writes:

 Another common (for me) example is to have a heading called *
 Appendix in a paper, and then the LaTeX \appendix command. The Org
 heading is just for me. It should not be exported. All headings below
 the \appendix command are Org sub-sections but should be promoted to
 \section in the final document.

 then IMO it should be 

 ,
 | * Appendix
 | ** Latex Command :noexport:
 | \appendix
 | ** Subsec1
 | ** Subsec2 ...
 `

I'm confused how this creates a correct LaTeX document. The \appendix
command is not exported, since that section was tagged :noexport:, in
which case, what is the point of having \appendix?

I *need* the LaTeX command exported. It changes things in the remainder
of the LaTeX document. A section titled Appendix, which is what your
text above creates, does not create a correct LaTeX
document. Furthermore, Subsec1 and Subsec2 need to be promoted, either
in Org or in the export.

,
| * Appendix :noexportheading:promotesubheading:
| \appendix
| ** Subsec1
| ** Subsec2
`

The above works, assuming that noexportheading doesn't export the
heading, but does export the content (\appendix), and the
promotesubheading does what you would expect.

  -k.



Re: [O] proposal to have ignoreheading tags/properties

2014-06-12 Thread Ken Mankoff

On 2014-06-12 at 15:21, Nicolas Girard wrote:
 I also ran across this need. What I had in mind was that certain todo
 types would be treated as inline.  
 ...
 Such a feature is more generic and would be useful in other contexts ;
 and the LaTeX-related issues discussed in this thread would be solved
 using something like

 * INLINE appendix
   \appendix
 * Appendix 1

In your example, I cannot collapse * Appendix 1 under INLINE
appendix. I need to add a * to it, and it is now at the incorrect
level when exporting. There is no point in having the INLINE appendix
here.

I'm not sure how this feature using TODO keywords is more generic
(also, more generic than what?). TODO types have a very specific
functionality, and I think one can only have 1 TODO type. So if you
wanted to have

* INLINE TODO foo
or
* WAITING INLINE bar

It would not work.

Implementing this feature as tags allows one to use existing TODO
items. Tags are already a more generic item so adding a new behavior
isn't that dramatic (and is it new? :noexport: already exists), and
multiple tags are supported. It seems a better place for the
implementation.

I vote for the following tags:

+ :noexport: Does not export item, content, and children.
+ :ignoreheading: Does not export heading. Exports content and children.
+ :ignorecontent: Does not export heading or content. Does export children.
+ :ignorebranch: Does not export heading, content, or children.
+ :promotesubheadings: Promotes children headings, regardless of
  exporting this heading or not

Note that :ignorebranch: is the same as :noexport but is a more
consistent naming scheme. Ignoring and promotion are two separate items
and can be used together or exclusively for maximum number of export
behaviors. 

In this case, a modified version of your example might look like this:

* Appendix  :ignoreheading:promotesubheadings:
  \appendix
** Appendix 1
** Appendix 2

  -k.





Re: [O] proposal to have ignoreheading tags/properties

2014-06-12 Thread Ken Mankoff

On 2014-06-12 at 16:13, Eric Schulte wrote:
 What do you think about the attached patch which should add this
 functionality to the core.

Why inline? 

Org already has inline TODO items which is a different thing. 

I don't think the word inline signifies that a heading will or won't
be exported and/or its children promoted.

  -k.



Re: [O] proposal to have ignoreheading tags/properties

2014-06-12 Thread Ken Mankoff
Hi Eric,  On 2014-06-12 at 20:46, Eric Schulte wrote: 
Can you suggest a more intuitive/appropriate tag name?  I'm not 
personally partial to inline, it was just the first thing that 
occurred to me.  Previous implementations of similar behavior 
used the tag prelim. 


I posted the following before. I think you might not be getting 
all the emails I post to the list. For example, I commented that 
INLINE as a TODO keyword didn't make sense to me using a similar 
explanation to your reply to that same email.   I have used your 
implementation from last week using prelim but changed the word, 
because as with inline, I don't associate the word prelim with 
the behavior being implemented. 

 -k. 


I vote for the following tags:

+ :noexport: Does not export item, content, and children.
+ :ignoreheading: Does not export heading. Exports content and 
children.
+ :ignorecontent: Does not export heading or content. Does export 
children.

+ :ignorebranch: Does not export heading, content, or children.
+ :promotesubheadings: Promotes children headings, regardless of
 exporting this heading or not

Note that :ignorebranch: is the same as :noexport but is a more
consistent naming scheme. Ignoring and promotion are two separate 
items
and can be used together or exclusively for maximum number of 
export

behaviors.



[O] BEGIN_LATEX_HEADER [cont]

2014-06-19 Thread Ken Mankoff

Hi,

I'm following up on a thread suggesting a method to easily include 
large

amounts of LaTeX header material. See
https://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg00480.html 


Please consider this a +1 for that feature request.

One suggestion was:
You could have a LaTeX block and tangle it to preamble.tex and 
input

preamble.tex in a LATEX_HEADER.


Which seems like an OK work-around. 


I have two follow-up questions about this.

1) I can't seem to get

#+BEGIN_LATEX :tangle preamble.tex

to work. It needs to be

#+BEGIN_SRC latex :tangle preamble.tex

Is this correct?

Secondly, is there a way to automatically tangle one just this 
section
each time I export the file? Or automatically all sections (but 
just in

this file)?

Thanks,

 -k.



Re: [O] BEGIN_LATEX_HEADER [cont]

2014-06-20 Thread Ken Mankoff




On 2014-06-20 at 04:50, Nicolas Goaziou wrote:
 I suggest to use existing solutions instead: configure
 `org-latex-classes'.

I'm all for using existing solutions, but cannot see how I might use
this to easily customize export differently for different documents when
large amounts of LaTeX preamble code is being used.

The tangle to preamble.tex and then include works but I cannot automate
it as per the example from Aaron. It still works pretty well even if I
do it manually.

  -k.





Re: [O] BEGIN_LATEX_HEADER [cont]

2014-06-21 Thread Ken Mankoff

On 2014-06-21 at 20:42, Aaron Ecay wrote:
 2014ko ekainak 21an, Nicolas Goaziou-ek idatzi zuen:
 
 Aaron Ecay aarone...@gmail.com writes:
 
 The first is that editing non-trivial latex code embedded in an
 elisp string quickly becomes tedious, whereas it’s much pleasanter
 in org using org-edit-special, syntax highlighting of src blocks,
 etc.
 
 This is a no-op since you only do it a limited number of times, i.e.
 once for each document type.

 If you do it once, then it’s not a no-op, by definition.  I think you
 mean that you disagree in the amount which you weight this as a
 concern, which is a reasonable opinion to have.  But phrasing it in
 the way you did is inaccurate and rather curt.

 FWIW, in my experience latex (or any) code rarely flows from mind to
 keyboard perfectly in the first attempt; there is some period of
 revision, during which convenient editing matters.

It is not a 1x operation, it is a per-document operation. For example,
in my use-case that started this whole discussion, each publication
requires tweaking a dozen or more lines of biblatex config.

  -k.



Re: [O] org-ref in action

2014-06-26 Thread Ken Mankoff

On 2014-06-26 at 10:11, Grant Rettke wrote:
 Why choose bibtex over biblatex?

People choose bibtex because that is how it has been done and is well
supported/documented and still popular on Google results. People choose
biblatex because that appears to be the new under-development
with-bells-and-whistles way moving forward.

 Where do people discuss such questions like this in real life?

http://tex.stackexchange.com

  -k.




Re: [O] Directly search for Headlines?

2014-07-07 Thread Ken Mankoff

On 2014-07-07 at 11:19, Nick Dokos wrote:
 John Durden johndur...@yandex.com writes:

 Can you search directly for headlines in all agenda-files, with the
 name of the headline, not tags? If so, how? If not, wouldn't this be
 useful?


 Try `s' in the agenda perhaps?

Yes this feature would be useful. 

s in agenda just saves all Org Buffers for me.

My work-around is to search for * Foo, but this doesn't find headlines
with TODO items.

  -k.




Re: [O] Directly search for Headlines?

2014-07-07 Thread Ken Mankoff

On 2014-07-07 at 15:11, Nick Dokos wrote:
 Ken Mankoff mank...@gmail.com writes:

 On 2014-07-07 at 11:19, Nick Dokos wrote:
 John Durden johndur...@yandex.com writes:

 Can you search directly for headlines in all agenda-files, with the
 name of the headline, not tags? If so, how? If not, wouldn't this be
 useful?


 Try `s' in the agenda perhaps?

 Sorry, I meant `s' in the agenda dispatcher:

 C-c a s
 C-c a S


I use the key combos you suggest all the time, but the OP wanted to just
search HEADLINES. Maybe the above methods work if you use regex and
exploit the fact that all headlines have * characters in them, but
this use of regex seems a bit overly complex.

  -k.



[O] emails written in Org Mode

2014-07-08 Thread Ken Mankoff
Hi Thorsten,  On a recent thread you wrote: 

... *outorg-edit-buffer* (where I write my message-mode email in 
full

org-mode).


I already write emails in emacs. I'm interested in being able to compose
emails using Org Mode. I see you use gnus. I use mu4e[1]. I wonder if
your setup is gnus-specific or might work with other emacs mail
clients. Will you provide some information about this?

Thanks,

 -k.

[1] http://www.djcbsoftware.nl/code/mu/mu4e.html



Re: [O] Directly search for Headlines?

2014-07-09 Thread Ken Mankoff

On 2014-07-08 at 17:01, Samuel Wales wrote:
 On 7/7/14, Ken Mankoff mank...@gmail.com wrote:
 s in agenda just saves all Org Buffers for me.

 c-c a s

 My work-around is to search for * Foo, but this doesn't find headlines
 with TODO items.

 it should.

You're right. It does! Not sure why I thought it didn't. 

OP issue solved, I think, with this.

  -k.



Re: [O] emails written in Org Mode

2014-07-09 Thread Ken Mankoff
Hi All,

Thanks for the suggestions.

orgstruct++-mode and orgtbl-mode help a lot. It would be nice to be able
to execute code too. 

I have an email in to the mu4e group about just switching to org-mode
and then back to message-mode. Since mu4e isn't gnus, and doesn't use
plain message-mode as the major mode, I need to switch back to the mu4e
compose mode, but it lists as m4e:compose in the modeline, and that
isn't a major mode I can figure out how to switch to.

Thanks,

  -k.


On 2014-07-09 at 16:03, Nick Dokos wrote:
 John Kitchin jkitc...@andrew.cmu.edu writes:

 Can't you just change your buffer mode to org-mode, compose, change back
 to message-mode and send? Did you want to do more than that?


 ... or, depending on what one wants to do, adding one of the minor modes
 (orgstruct-mode, orgstruct++-mode, orgtbl-mode) to message-mode buffers
 may be enough.

 Nick




Re: [O] emails written in Org Mode

2014-07-10 Thread Ken Mankoff
Hi Thorsten and others,

Thanks to your help I have it set up well. Here is my setup, based on
the idea from John Kitchin to just switch major modes:

1. I've set mu4e so that the reply line starts with * (an Org
   section) like this:

   #+BEGIN_SRC emacs-lisp
   (setq message-citation-line-format * On %Y-%m-%d at %R, %f wrote:)
   #+END_SRC

   Now, the quoted part of the email is its own section.

2. I've added a function to switch between org-mode and
   mu4e-compose-mode, and bound it to C-@, so I can easily swap modes:

   #+BEGIN_SRC emacs-lisp
   (defun kdm-mu4e-org-compose ()
   Switch to/from mu4e-compose-mode and org-mode
   (interactive)
   (if (eq 'mu4e-compose-mode (buffer-local-value 'major-mode (current-buffer)))
   (org-mode)
 (mu4e-compose-mode)))
   (global-set-key \M-@ 'kdm-mu4e-org-compose)
   #+END_SRC

With this, I read emails in mu4e. When I hit reply, I reply
normally. If I want to drop into Org mode for the reply, I do so with
M-@, use Org, and then M-@ back to mu4e before sending.

I've just set this up. We'll see how well it works. mu4e used to
support Org and I'm sure it will in the future, and then things might
be better integrated, but I think this will work for now.

  -k.

* On 2014-07-10 at 04:28, Thorsten Jolitz wrote:
 Ken Mankoff mank...@gmail.com writes:

 Hi Ken,

 orgstruct++-mode and orgtbl-mode help a lot. It would be nice to be able
 to execute code too. 

 they are both nice but not the real thing

 I have an email in to the mu4e group about just switching to org-mode
 and then back to message-mode. Since mu4e isn't gnus, and doesn't use
 plain message-mode as the major mode, I need to switch back to the mu4e
 compose mode, but it lists as m4e:compose in the modeline, and that
 isn't a major mode I can figure out how to switch to.

 When you start writing an email in mu4e, could you just:

  1. do

  ,
  | M-: major-mode
  `
  
  2. do M-x mark-whole-buffer  M-x kill-ring-save, i.e.
  
  ,
  | C-x h
  | M-w
  `

 and post the results?

 And maybe figure out if in the mu4e world there exists a customizable
 variable like:

 ,[ C-h v mail-header-separator RET ]
 | mail-header-separator is a variable defined in `sendmail.el'.
 | Its value is --text follows this line--
 | 
 | Documentation:
 | Line used to separate headers from text in messages being composed.
 | You can customize this variable.
 `

 This would probably give me all the info I need to adapt outorg.

 On 2014-07-09 at 16:03, Nick Dokos wrote:

 John Kitchin jkitc...@andrew.cmu.edu writes:

 Can't you just change your buffer mode to org-mode, compose, change back
 to message-mode and send? Did you want to do more than that?


 ... or, depending on what one wants to do, adding one of the minor modes
 (orgstruct-mode, orgstruct++-mode, orgtbl-mode) to message-mode buffers
 may be enough.




[O] latex export for 4th-level heading

2014-07-10 Thread Ken Mankoff

When exporting to LaTeX, fourth-level headings become \enumerate. In
LaTeX, the item below \subsubsection is \paragraph, not \enumerate.

Here is what happens:

* Top becomes \section
** Second becomes \subsection
*** Third becomes \subsubsection
 Fourth becomes \enumerate

Is there a way to set Fourth to either \paragraph or just nothing?

 -k.



Re: [O] latex export for 4th-level heading

2014-07-10 Thread Ken Mankoff

* On 2014-07-10 at 17:08, Thomas S. Dye wrote:
 Aloha Ken,

 Ken Mankoff mank...@gmail.com writes:

 When exporting to LaTeX, fourth-level headings become \enumerate. In
 LaTeX, the item below \subsubsection is \paragraph, not \enumerate.

 Here is what happens:

 * Top becomes \section
 ** Second becomes \subsection
 *** Third becomes \subsubsection
  Fourth becomes \enumerate

 Is there a way to set Fourth to either \paragraph or just nothing?

 Only the first three outline levels will be used as headings. Deeper
 levels will become itemized lists. You can change the location of this
 switch globally by setting the variable org-export-headline-levels, or
 on a per-file basis with a line

  #+OPTIONS: H:4


Thanks. That makes sense. I thought that was just for controlling the
TOC depth, but it makes sense it controls content headings too.

  -k.



Re: [O] An Org centric research lab: Goodbye MS word, excel, and powerpoint

2014-07-10 Thread Ken Mankoff

* On 2014-07-10 at 20:45, Grant Rettke wrote:
 On Wed, Jul 9, 2014 at 5:37 PM, Doyley, Marvin M.
 mdoy...@ur.rochester.edu wrote:
 I notice that you prefer to use python rather than matlab. Is there a reason 
  for this ? Matlab is free at my
 institution so cost  is not an issue.

It won't be free in the future for the people you are training...

  -k.



Re: [O] How to call org-display-inline-images so that after a graphviz block is evaluated the image is refreshed?

2014-07-11 Thread Ken Mankoff

Try (org-redisplay-inline-images). Note re.

#+BEGIN_SRC lang :post (org-redisplay-inline-images)
#+END_SRC
#+RESULTS:

  -k.

* On 2014-07-11 at 20:14, Grant Rettke wrote:
 Hi,

 The ability to use graphviz in an org document is stellar and makes it
 so much more productive to use org.

 Combined with inline image display, it is a powerhouse combo.

 After evaluating my source block, I would like to refresh the generated image.

 Thus far, I just call org-display-inline-image.

 What is the best way to automate it so that the images are always up to date?

 Kind regards,

 Grant Rettke | ACM, ASA, FSF, IEEE, SIAM
 g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
 “Wisdom begins in wonder.” --Socrates
 ((λ (x) (x x)) (λ (x) (x x)))
 “Life has become immeasurably better since I have been forced to stop
 taking it seriously.” --Thompson




Re: [O] An Org centric research lab: Goodbye MS word, excel, and powerpoint

2014-07-11 Thread Ken Mankoff
Hi Marvin,

* On 2014-07-09 at 18:37, Doyley, Marvin M. wrote:
 I notice that you prefer to use python rather than matlab. Is there a
 reason for this ? Matlab is free at my institution so cost is not an
 issue.

An additional blog post (with good discussion and links to other posts)
on the Python v. MATLAB debate:

http://lorenabarba.com/blog/why-i-push-for-python/

and

http://phillipmfeldman.org/Python/Advantages_of_Python_Over_Matlab.html

  -k.



Re: [O] Include lengthy LaTeX in export preamble

2014-07-27 Thread Ken Mankoff
Hi Jacob,

#+LATEX_HEADER: does work on export (when else would it work?)

I think I recall a space between the : and the LaTeX command is
needed. Do you have one?

For more ideas on how to have lengthy custom headers, see thread here:
https://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00734.html
and links therein. There are three general approaches:

1) Make a custom class file and include that, either in your init file
or in the Org file.

2) From Aaron Ecay, put your header in a #+BEGIN_SRC latex section, and
then run a bit of lisp to export that section, and then include the
exported file in a #+LATEX_HEADER: \include{preamble}. This is the
approach I use.

,
| #+begin_src emacs-lisp
|   (org-babel-goto-named-src-block preamble)
|   (org-babel-tangle)
| #+end_src
| 
| #+name: preamble
| #+begin_src latex :tangle preamble.tex
|   % code goes here
| #+end_src
`

3) Implement a patch or pester developers to create a third simpler
solution.

Good luck,

  -k.


* On 2014-07-27 at 21:00, Jacob Gerlach wrote:
 I have a lengthy command customization that I want to include in LaTeX
 export. Since it must appear in the preamble,
 #+BEGIN_LATEX
 ...
 #+END_LATEX

 didn't work. I had to prepend
 #+LATEX_HEADER:
 to each line in order to achieve my result.

 I found C-h v org-format-latex-header RET:

 The document header used for processing LaTeX fragments...

 But it seems that when the docstring says fragments, it is not referring
 to exporting.

 Are there any customizations to do the same during export?

 Thanks,
 Jake




Re: [O] Archive subtrees hierarchical (keep the parent structure)

2014-08-05 Thread Ken Mankoff
Hi Florian,

This code looks useful and an improvement over the previous setup I was
using. https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01218.html

Can you explain what else is needed for your code to work? Currently I
have

#+BEGIN_SRC emacs-lisp
(setq org-archive-location (concat org-directory /archive/%s_archive::))
#+END_SRC

But I don't see things archived as subtrees with just this. Do I need
new/different configuration to work with your code?

Thanks,

  -k.


* On 2014-08-04 at 15:29, Florian Adamsky wrote:
 Dear all,

 some of my org-mode files are getting bigger and bigger. So, I decided
 to use the archive feature to remove old stuff. However, I was not happy
 with the current archive feature, because it just puts subtrees
 unorganized in the archive file.

 I was more looking for a way to archive a subtree, but keep the parent
 structure. Means, if the point is at the subtree *** FOO in the
 following example:

 * A
 ** B
 *** FOO

 then it should copy the heading * A and ** B to the archive file and
 then move *** Foo to it. The only thing that I found was a feature
 request from Florian Lindner [fn:1]. A couple of days I was given it a
 shot and tried to implement that myself. Attached you'll find my
 attempt.

 It is a bit hackish, but it works for me. I think the attached code
 misses two features:
   1. it only copies the parent headings with tags, but ignores
   properties and stuff like that

   2. it ignores org-reverse-note-order, but that should not be too hard
   to add.

 Before I work on it again, I would like to hear your comments. Have I
 implemented functions that are already in org-mode? Is this feature
 useful for other people? Does it in more complicated org-mode files?

 Best regards

 Footnotes:

 [fn:1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01214.html




Re: [O] Archive subtrees hierarchical (keep the parent structure)

2014-08-05 Thread Ken Mankoff
Hi Florian,

* On 2014-08-05 at 11:32, Florian Adamsky wrote:
 This code looks useful and an improvement over the previous setup I
 was
 using. https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01218.html

 Can you explain what else is needed for your code to work? Currently I
 have

 No, just run M-x org-archive-subtree-hierarchical. I tried the code
 with the latest org-mode version 8.3beta and with emacs -q and in both
 cases it works without problems.

 However, if you set the following variable to the new function, it
 should work with the default keybinding for org-archive:

 #+BEGIN_SRC emacs-lisp
 (setq org-archive-default-command 'org-archive-subtree-hierarchical)
 #+END_SRC

 If you have any trouble, please give me a note.

You are correct that M-x org-archive-subtree-hierarchical works just
fine. But I can't get it to work with the default keybinding as you show
above. 

C-c C-x C-s is my (the?) default keybinding for archiving
trees/subtrees.  Is this the correct keybinding?

When I describe that with C-h k C-c C-x C-s I see:

 C-c C-x C-s runs the command org-advertized-archive-subtree, which is
 an alias for `org-archive-subtree' in `org.el'.

 It is bound to C-c C-x C-s, menu-bar Org Archive Move Subtree
 to Archive file.
 
 (org-advertized-archive-subtree optional FIND-DONE)

So I have tried mapping all of those to call the new function:

(setq org-archive-default-command 'org-archive-subtree-hierarchical)
(setq org-archive-subtree 'org-archive-subtree-hierarchical)
(setq org-advertized-archive-subtree 'org-archive-subtree-hierarchical)

But it still doesn't work. I can bind org-archive-subtree-hierarchical
directly to C-c C-x C-s, which will work. Is that the correct solution?

Thanks,

  -k.



Re: [O] Archive subtrees hierarchical (keep the parent structure)

2014-08-05 Thread Ken Mankoff
Yes that works perfectly. Not sure why I had memorized a different
keystroke. Thank you!



On Tue, Aug 5, 2014 at 1:46 PM, Florian Adamsky fa-orgm...@haktar.org
wrote:

 Dear Ken,

 On Tuesday, Aug 05 2014, Ken Mankoff mank...@gmail.com wrote:

  You are correct that M-x org-archive-subtree-hierarchical works just
  fine. But I can't get it to work with the default keybinding as you show
  above.
 
  C-c C-x C-s is my (the?) default keybinding for archiving
  trees/subtrees.  Is this the correct keybinding?

 according to the documentation the default keybinding to archive the
 current entry is C-c C-x C-a. Could you try that instead?

 [...]

 Best
 --
 Florian Adamsky
 http://florian.adamsky.it/



Re: [O] MobileOrg documentation?

2014-08-08 Thread Ken Mankoff
Advance Capture is Android only, not on my iPhone version. On iPhone, you
cannot add sub-headings. You can type it out as much as you want with **
and ***, but you'll need to do some editing on the desktop side. Those
modifications could be made automagically when the desktop auto-detects
that updates have been pushed from the phone...

  -k.


On Fri, Aug 8, 2014 at 2:28 PM, Jorge A. Alfaro-Murillo 
jorge.alfaro-muri...@yale.edu wrote:

 David Masterson writes:

 Hmmm.  Simple question (I think).  Can you edit outlines (at least
 somewhat) from MobileOrg?  For instance, can you add outline headers to
 your Org outline in MobileOrg?  Or is MobileOrg only useful for viewing Org
 outlines and capturing items to add to your outlines later?


 Yes.

 In MobileOrg of your phone: Settings, Synchronization, check Advanced
 capture. Click over any headline and then use the capture button (the
 circle with a plus inside). Write the new headline, save, and synchronize.

 Afterwards run org-mobile-pull from your computer, the changes should be
 there. At least it works for me under Android.

 Best,

 --
 Jorge.





Re: [O] MobileOrg documentation?

2014-08-08 Thread Ken Mankoff
Some code to auto-update Org when Mobile Org pushes:

http://kenmankoff.com/2012/08/17/emacs-org-mode-and-mobileorg-auto-sync/

  -k.


On Fri, Aug 8, 2014 at 5:15 PM, David Masterson dsmaster...@gmail.com
wrote:

 jorge.alfaro-muri...@yale.edu (Jorge A. Alfaro-Murillo) writes:

  David Masterson writes:
 
  Hmmm.  Simple question (I think).  Can you edit outlines (at least
  somewhat) from MobileOrg?  For instance, can you add outline headers
  to your Org outline in MobileOrg?  Or is MobileOrg only useful for
  viewing Org outlines and capturing items to add to your outlines
  later?
 
  Yes.
 
  In MobileOrg of your phone: Settings, Synchronization, check Advanced
  capture. Click over any headline and then use the capture button (the
  circle with a plus inside). Write the new headline, save, and
  synchronize.

 Hmmm.  Don't see this in MobileOrg for iOS.  I do see Settings,
 Settings, AutoCapture Mode, but not Advanced Capture.  Is this an
 example of two different code bases?  This is MobileOrg v1.6.1.

  Afterwards run org-mobile-pull from your computer, the changes should be
  there. At least it works for me under Android.

 Yes, I expected that, once you made a change in MobileOrg, you have to
 cycle over to Emacs Org via org-mobile-pu(sh|ll).

 --
 David Masterson
 Programmer At Large





[O] problem with markdown exporter

2014-08-20 Thread Ken Mankoff
I've turn on Markdown exporting with (require 'ox-md). Citations aren't
being exported properly, so I'm trying to customize it. I have the
following setup:

(org-add-link-type
 textcite  (lambda (key) (org-open-file cby-references-file t nil key))
 (lambda (path desc format)
   (cond
((eq format 'latex) (format \\textcite{%s} path))
((eq format 'md) (format [@%s] path))
((eq format 'odt) (format %s desc))
((eq format 'html) (format cite%s/cite path))
)))

Which works for latex, odt, and hml. But it doesn't appear that the
format string is ever being set to 'md, and so the [[cite:foo][Foo,
]] in my org file isn't getting converted to [@foo].

Searching online I find many strings matching (eq format 'odt) or
'latex but none with 'md. Is there some other way to achieve this?

Thanks,

  -k.



Re: [O] default headers for source code blocks

2014-09-09 Thread Ken Mankoff
What about custom template expansions?

http://nicholasvanhorn.com/2014/04/07/org-structure-completion/

Advantage: your C-c C-v d sql RET becomes only sql TAB. 

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback 
keyboard. 

 On Sep 9, 2014, at 13:24, Subhan Michael Tindall subh...@familycareinc.org 
 wrote:
 
 My apologies if this is in TFM, but I can’t seem to find it after substantial 
 digging.
 I’m using a lot of source code blocks lately.
 What I’d like is a way to specify a set of default headers to insert when a 
 new block is created.
 Right now:
 C-c C-v d sql RET
 #+begin_src sql
 #+end_src
  
 What I want is this:
 C-c C-v d sql RET
 #+begin_src sql  :exports code :tangle yes :comments noweb
 #+end_src
  
 Is there a configuration variable I can set for this?  All I can find is refs 
 to see source language documentation, but nothing that actually indicates 
 if/how to manage it.
  
 Thanks,
  
  
 Subhan Michael Tindall
 Program Analyst – FamilyCare Health Plans
 825 NE Multnomah St, Suite 1400; Portland OR 97232
 Direct: 503-471-3127
 Fax:  503-471-3177
 Email:  subh...@familycareinc.org
 image001.jpg
  
 
 This message is intended for the sole use of the individual and entity to 
 which it is addressed and may contain information that is privileged, 
 confidential and exempt from disclosure under applicable law. If you are not 
 the intended addressee, nor authorized to receive for the intended addressee, 
 you are hereby notified that you may not use, copy, disclose or distribute to 
 anyone the message or any information contained in the message. If you have 
 received this message in error, please immediately advise the sender by reply 
 email and delete the message.  Thank you.


[O] Emacs StackExchange Site

2014-09-15 Thread Ken Mankoff

Some on this list might be interested to know there is a proposal to
create a StackExchange site specifically for Emacs.

https://area51.stackexchange.com/proposals/76571/emacs

  -k.



[O] Bug: CAPTION space after 70th character (8.2.7c-71-g60418c-elpa)

2014-09-26 Thread Ken Mankoff

I'm experiencing a strange Org bug in the latest few versions.

If I have a #+CAPTION line, I can type my figure caption as I would
expect. But as soon as I pass the 70th column, the spacebar triggers an
error. I can type letters after the 70th column, but not a space. When I
press the spacebar on the 70th or higher column, the mini-buffer says:

Buffer ` *temp*-624801' still has clients; kill it? (y or n)

I see no effect if I press y or n, and can continue to type letters, but
any additional spaces repeats the error.

If I change the line from #+CAPTION to anything else (##+CAPTION
#+CAPTIONN etc.) the bug does not exhibit.

  -k.



Re: [O] Bug: CAPTION space after 70th character (8.2.7c-71-g60418c-elpa)

2014-09-26 Thread Ken Mankoff

* On 2014-09-26 at 11:53, Rasmus wrote:
 Ken Mankoff mank...@gmail.com writes:
 If I have a #+CAPTION line, I can type my figure caption as I would
 expect. But as soon as I pass the 70th column, the spacebar triggers
 an error. I can type letters after the 70th column, but not a
 space. When I press the spacebar on the 70th or higher column, the
 mini-buffer says:

 Buffer ` *temp*-624801' still has clients; kill it? (y or n)


 I can't reproduce using the latest version of org.  

 Does this happen when you start Emacs with emacs -q?  If not, it could
 be some third-party package causing the error.

 Try also M-x toggle-debug-on-error and make the error reappear.  This
 should give insights in where the error occurs.


debug-on-error doesn't help because there isn't actually an error as far
as I can tell. It is a bug, not an error. Nothing shows up in *Messages*

I've isolated the problem to this line:

(add-hook 'text-mode-hook 'turn-on-auto-fill)

Which I've had enabled for a long time, but has only recently been
causing issues with CAPTION lines. I can re-create it only when that
line is uncommented.

Oddly, even the re-creation is complicated. I can't get the bug to show
up in the primary window. I must launch a second frame. I can re-create
it like this:

$ /usr/local/Cellar/emacs-mac/emacs-24.3-mac-4.8/bin/emacs -Q
load Org
M-x auto-fill-mode
#+CAPTION lots of text and spaces does not cause bug
$ /usr/local/Cellar/emacs-mac/emacs-24.3-mac-4.8/bin/emacsclient -c foo.org
#+CAPTION and now the bug exists after line 70

It doesn't appear if I open a new frame with C-x 5 2, only if I open a
new frame with emacsclient from the command line.

Some more strange behavior: If the bug appears and I close the frame,
and then open the file again (find-file foo.org), the file (a massive
ORG file) appears as *temp* in the modeline and the contents of the
file are only the 1 line of the caption. If I kill buffer *temp* and
then find-file again, the contents are correctly loaded.

  -k.



Re: [O] Bug: CAPTION space after 70th character (8.2.7c-71-g60418c-elpa)

2014-09-27 Thread Ken Mankoff


 On Sep 27, 2014, at 15:27, Aaron Ecay aarone...@gmail.com wrote:
 
 Hi Ken,
 
 2014ko irailak 26an, Ken Mankoff-ek idatzi zuen:
 debug-on-error doesn't help because there isn't actually an error as far
 as I can tell. It is a bug, not an error. Nothing shows up in
 *Messages*
 
 How about setting debug-on-quit and hitting C-g when the prompt shows
 up?

Still nothing in *Messages*. I know this is related to fill-paragraph, because 
that triggers this too, even if used below the CAPTION line. CAPTION doesn't 
let fill-paragraph do its thing, which I assume is part of the issue. 

  -k. 


Re: [O] Bug: CAPTION space after 70th character (8.2.7c-71-g60418c-elpa)

2014-09-27 Thread Ken Mankoff

* On 2014-09-27 at 21:02, Aaron Ecay wrote:
 Hi Ken,

 2014ko irailak 27an, Ken Mankoff-ek idatzi zuen:
 How about setting debug-on-quit and hitting C-g when the prompt shows
 up?
 
 Still nothing in *Messages*. I know this is related to fill-paragraph,
 because that triggers this too, even if used below the CAPTION
 line. CAPTION doesn't let fill-paragraph do its thing, which I assume
 is part of the issue.

 Odd; my suggestion should have given you a backtrace after hitting C-g,
 but I guess for some reason it didn’t work.

 Since you can trigger the undesired behavior with fill-paragraph, what
 about using edebug (info (elisp) Edebug) to instrument that function
 and then stepping through to see where the prompt is triggered?

Triggered by the line (funcall function justify)

I find it strange that y'all can't re-create this since I can do it with
emacs -Q, although perhaps it is specific to the emacs-mac port. I'm
happy to keep following instructions and dig deeper, but this is way
outside the scope of my emacs/elisp skills. I'm happy to just invoke new
frames with C-x 5 2 rather than emacsclient to work around this for now.

  -k.



Re: [O] Bug: CAPTION space after 70th character (8.2.7c-71-g60418c-elpa)

2014-09-27 Thread Ken Mankoff

* On 2014-09-27 at 23:45, Ken Mankoff wrote:
 I find it strange that y'all can't re-create this since I can do it
 with emacs -Q, although perhaps it is specific to the emacs-mac
 port.

Just checked and it isn't in latest emacs HEAD. I'll submit a bug report
to the emacs-mac project.

  -k.



Re: [O] Bug: CAPTION space after 70th character (8.2.7c-71-g60418c-elpa)

2014-09-27 Thread Ken Mankoff

* On 2014-09-28 at 00:27, Ken Mankoff wrote:
 * On 2014-09-27 at 23:45, Ken Mankoff wrote:
 I find it strange that y'all can't re-create this since I can do it
 with emacs -Q, although perhaps it is specific to the emacs-mac port.

 Just checked and it isn't in latest emacs HEAD. I'll submit a bug
 report to the emacs-mac project.

For record-keeping purposes, google, Bing, other people, and future
versions of me, this bug has been reported here:
https://github.com/railwaycat/emacs-mac-port/issues/59

  -k.



Re: [O] Bug: CAPTION space after 70th character (8.2.7c-71-g60418c-elpa)

2014-09-28 Thread Ken Mankoff
So in addition to this only appearing in the emacs-mac port, it is also
only in recent Org version. I now think this is related to the new feature
of allowing multiple #+CAPTION lines, instead of just one #+CAPTION line.

  -k.

On Sun, Sep 28, 2014 at 12:41 AM, Ken Mankoff mank...@gmail.com wrote:


 * On 2014-09-28 at 00:27, Ken Mankoff wrote:
  * On 2014-09-27 at 23:45, Ken Mankoff wrote:
  I find it strange that y'all can't re-create this since I can do it
  with emacs -Q, although perhaps it is specific to the emacs-mac port.
 
  Just checked and it isn't in latest emacs HEAD. I'll submit a bug
  report to the emacs-mac project.

 For record-keeping purposes, google, Bing, other people, and future
 versions of me, this bug has been reported here:
 https://github.com/railwaycat/emacs-mac-port/issues/59

   -k.



[O] \input causes conflict with LaTeX equation preview

2014-10-18 Thread Ken Mankoff
I have

#+LATEX_HEADER: \input{preamble}

in an Org file. When I try to preview equations, it does not work
because \input{preamble} is exported to the equation preview preamble,
but no file preamble.tex is exported. The preamble.tex file is not
needed just to preview an equation.

Can anyone suggest a work-around?

Thanks,

  -k.


Re: [O] \input causes conflict with LaTeX equation preview

2014-10-20 Thread Ken Mankoff

* On 2014-10-20 at 18:26, Rasmus wrote:
 Ken Mankoff mank...@gmail.com writes:

 I have

 #+LATEX_HEADER: \input{preamble}

 in an Org file. When I try to preview equations, it does not work
 because \input{preamble} is exported to the equation preview
 preamble, but no file preamble.tex is exported. The preamble.tex
 file is not needed just to preview an equation.

 Can anyone suggest a work-around?

 \IfFileExists{./preamble.tex}{true}{false}

 Etoolbox has a number of nice tests for more sophisticated
 conditioning.


Works great. Thank you.

  -k.



[O] Effort entry and confusing effort estimates

2013-05-20 Thread Ken Mankoff
Hi,

I'm looking into effort and time tracking and have a few questions about
efforts,

1) What is the difference between C-c C-x C-e and C-c C-x e?

When I set an effort while clocked in, C-c C-x C-e asks for an effort and
formats it in a format I understand such as 00:30 or 1d. When not clocked
in, I have to use C-c C-x e (no CTRL for the last one) and it doesn't seem
to parse my entry for a timestamp or convert from 8h to 1d. For example, I
can enter an effort of aoeu and it accepts that.

2) When clocked in and using C-c C-x C-e, the conversion seems buggy:

I enter - converted to
1d - 08:00
2d - 16:00
3d - 1d 00:00
4d - 1d 08:00
7d - 2d 08:00
1w - 1d 16:00

I get that 1 day is 8 hours, and 2d 8h == 1d 16h, but I'm still confused
why 2d is 16h and 3d is 1d.

Thanks,

   -k.


Re: [O] Effort entry and confusing effort estimates

2013-05-20 Thread Ken Mankoff
Doh. I get the math now. 3d is 3*8h = 1d. Ok. Confusing but I get it.

But I'm still confused what 'org-set-effort' expects/interprets compared to
'org-clock-modify-effort-estimate'. Any clarification will be much
appreciated.

Thanks,

   -k.


On Mon, May 20, 2013 at 8:32 PM, Ken Mankoff mank...@gmail.com wrote:

 Hi,

 I'm looking into effort and time tracking and have a few questions about
 efforts,

 1) What is the difference between C-c C-x C-e and C-c C-x e?

 When I set an effort while clocked in, C-c C-x C-e asks for an effort and
 formats it in a format I understand such as 00:30 or 1d. When not clocked
 in, I have to use C-c C-x e (no CTRL for the last one) and it doesn't seem
 to parse my entry for a timestamp or convert from 8h to 1d. For example, I
 can enter an effort of aoeu and it accepts that.

 2) When clocked in and using C-c C-x C-e, the conversion seems buggy:

 I enter - converted to
 1d - 08:00
 2d - 16:00
 3d - 1d 00:00
 4d - 1d 08:00
 7d - 2d 08:00
 1w - 1d 16:00

 I get that 1 day is 8 hours, and 2d 8h == 1d 16h, but I'm still confused
 why 2d is 16h and 3d is 1d.

 Thanks,

-k.



Re: [O] Effort entry and confusing effort estimates

2013-05-21 Thread Ken Mankoff

Hi Bastien,

On Tue, 21 May 2013, Bastien wrote:


Ken Mankoff mank...@gmail.com writes:

But I'm still confused what 'org-set-effort' expects/interprets 
compared to 'org-clock-modify-effort-estimate'. Any clarification 
will be much appreciated.


`org-set-effort' allows you to _set_ the effort value.

`org-clock-modify-effort-estimate' allows you to either set the 
effort value (e.g. if you enter 1:30, the old value will be 
replaced by this one) or to increment/decrement the effort value 
by using +mm or +n[hdwmy] -- e.g. entering +1d will increment the 
current value by 1 day.  1 day is interpreted depending on 
`org-effort-durations', which see.


Thanks for the explanation. I guess I'm confused why one 
formats/converts/checks the input and the other does not. I guess 
this doesn't imply that org-set-effort does anything different, it 
really is just a pure subset of org-clock-modify-effort-estimate.


Thanks,

  -k.




[O] Hide empty custom agenda sections

2013-06-17 Thread Ken Mankoff
Hi,

I have a section of my custom agenda that shows items synced through
mobile-org. My mobile.org file has

#+FILETAGS: REFILE

Which means a custom agenda command of

(tags REFILE ((org-agenda-overriding-header REFILE)))

shows all items from that file.

Right now I have this at the bottom of my custom agenda, and it is
therefore often off-screen. I would like to have it at the top, but only
appear when there are items under this section. Most of the time it is
there and three lines are wasting space (header separator =, header
REFILE, and a blank line).

I haven't seen this feature. Does a command exist that already supports
this, or do I need to develop this myself?

Thanks,

   -k.


Re: [O] Hide empty custom agenda sections

2013-06-27 Thread Ken Mankoff
Hi Bastien,

Here is my custom agenda section. I'd like to have the DEADLINE and the
REFILE only show up if items exist in those sections, not when they are
empty. Actually, I guess I'd like this for all sections.

(setq org-agenda-custom-commands
  '((c My Custom Agenda
 (
  (tags REFILE ((org-agenda-overriding-header REFILE)))
  (tags-todo +DEADLINE=\+3d\
 (
  (org-agenda-overriding-header Deadline = 3 Days)
  ))
  (tags-todo +SCHEDULED\tomorrow\
 (
  (org-agenda-overriding-header Scheduled Today)
  ))
  (todo INPROGRESS ((org-agenda-overriding-header In Progress)))
  (todo WAITING|VERIFY ((org-agenda-overriding-header Waiting or
Verify)))
  (agenda  (
  (org-agenda-overriding-header Scheduled)
  (org-deadline-warning-days 0)
  ))
  (todo SOMEDAY ((org-agenda-overriding-header Someday)))
  (tags REFILE ((org-agenda-overriding-header REFILE)))
  ) nil (org.txt org.html org.ics



On Thu, Jun 27, 2013 at 10:44 AM, Bastien b...@gnu.org wrote:

 Hi Ken,

 Ken Mankoff mank...@gmail.com writes:

  Right now I have this at the bottom of my custom agenda, and it is
  therefore often off-screen. I would like to have it at the top, but
  only appear when there are items under this section. Most of the time
  it is there and three lines are wasting space (header separator 
  =, header REFILE, and a blank line).

 So you are using agenda blocks, right?

 Please post the skeleton of your custom agendas so that we can better
 understand.

 Thanks,

 --
  Bastien



Re: [O] Hide empty custom agenda sections

2013-06-28 Thread Ken Mankoff
So I tried adding a (nil) in the custom agenda section. If this were
allowed (presumably ignored), I could write a function that returns nil
unless there were items tagged REFILE, in which case it would return

  (tags REFILE ((org-agenda-overriding-header REFILE)))

But having (nil) caused an error. I guess I could make the entire My
Custom Agenda section be the output of a function, but that seems overly
complex.

  -k.


On Thu, Jun 27, 2013 at 11:18 AM, Ken Mankoff mank...@gmail.com wrote:

 Hi Bastien,

 Here is my custom agenda section. I'd like to have the DEADLINE and the
 REFILE only show up if items exist in those sections, not when they are
 empty. Actually, I guess I'd like this for all sections.

 (setq org-agenda-custom-commands
   '((c My Custom Agenda
  (
   (tags REFILE ((org-agenda-overriding-header REFILE)))
   (tags-todo +DEADLINE=\+3d\
  (
   (org-agenda-overriding-header Deadline = 3 Days)
   ))
   (tags-todo +SCHEDULED\tomorrow\
  (
   (org-agenda-overriding-header Scheduled Today)
   ))
   (todo INPROGRESS ((org-agenda-overriding-header In
 Progress)))
   (todo WAITING|VERIFY ((org-agenda-overriding-header Waiting
 or Verify)))
   (agenda  (
   (org-agenda-overriding-header Scheduled)
   (org-deadline-warning-days 0)
   ))
   (todo SOMEDAY ((org-agenda-overriding-header Someday)))
   (tags REFILE ((org-agenda-overriding-header REFILE)))
   ) nil (org.txt org.html org.ics



 On Thu, Jun 27, 2013 at 10:44 AM, Bastien b...@gnu.org wrote:

 Hi Ken,

 Ken Mankoff mank...@gmail.com writes:

  Right now I have this at the bottom of my custom agenda, and it is
  therefore often off-screen. I would like to have it at the top, but
  only appear when there are items under this section. Most of the time
  it is there and three lines are wasting space (header separator 
  =, header REFILE, and a blank line).

 So you are using agenda blocks, right?

 Please post the skeleton of your custom agendas so that we can better
 understand.

 Thanks,

 --
  Bastien





Re: [O] Hide empty custom agenda sections

2013-07-01 Thread Ken Mankoff
On Mon, Jul 1, 2013 at 9:38 AM, Bastien b...@gnu.org wrote:


 I gave another quick look but this would be too complex to implement,
 even if I agree this would be nice to have.


Ok. Oh well. Thank you for considering and replying.

   -k.


[O] auto-creating checkbox list items

2013-11-28 Thread Ken Mankoff
I think an older version of org-mode had the behavior where if I am making
a  list like this:

* Some list
+ [ ] and I then make a new item by pressing ESC+RET
+ [ ] the + and [] are auto-magically created.

The current version only populates the +, not the [ ].

Does anyone else recall this feature? Is there a preference to set it, or
was it removed for some reason?

Thanks,

   -k.


[O] No ODT export option

2014-01-10 Thread Ken Mankoff
Hi,

I'd like to export to ODT or even directly to DOC. But I notice I do not
have an ODT export option. Can someone help me set this up?

I'm running org-20140107/ from ELPA on OS X in the emacs 24.3
(emacsformacosx distribution from http://emacsformacosx.com/). In my ELPA
folder I see:

$ find . | grep -i odt
./org-20140107/etc/styles/OrgOdtContentTemplate.xml
./org-20140107/etc/styles/OrgOdtStyles.xml
./org-20140107/ox-odt.el
./org-20140107/ox-odt.elc

But when I'm in emacs in org-mode and I do ESC-x apropos org-odt and
examine org-odt-data-dir the content of that variable
are /usr/share/emacs/etc/org which does not exist.

Any help for ODT (and/or DOC) much appreciated.

FYI I also have LibreOffice installed which is how I will view the ODT
files, and/or do the DOC conversion if I can't get that straight from org.

Thank you,

   Ken Mankoff


Re: [O] No ODT export option

2014-01-10 Thread Ken Mankoff
Ok I seen the option now but when I try to export I get the following error:

OpenDocument export failed: Symbol's function definition is void:
cl--set-getf


On Fri, Jan 10, 2014 at 11:32 AM, Ista Zahn istaz...@gmail.com wrote:

 Hi Ken,

 ODT export isn't enabled by default. You can enable it by putting

 (require 'ox-odt)

 in your config file and restart emacs.

 Best,
 Ista

 On Fri, Jan 10, 2014 at 11:23 AM, Ken Mankoff mank...@gmail.com wrote:
  Hi,
 
  I'd like to export to ODT or even directly to DOC. But I notice I do not
  have an ODT export option. Can someone help me set this up?
 
  I'm running org-20140107/ from ELPA on OS X in the emacs 24.3
  (emacsformacosx distribution from http://emacsformacosx.com/). In my
 ELPA
  folder I see:
 
  $ find . | grep -i odt
  ./org-20140107/etc/styles/OrgOdtContentTemplate.xml
  ./org-20140107/etc/styles/OrgOdtStyles.xml
  ./org-20140107/ox-odt.el
  ./org-20140107/ox-odt.elc
 
  But when I'm in emacs in org-mode and I do ESC-x apropos org-odt and
  examine org-odt-data-dir the content of that variable are
  /usr/share/emacs/etc/org which does not exist.
 
  Any help for ODT (and/or DOC) much appreciated.
 
  FYI I also have LibreOffice installed which is how I will view the ODT
  files, and/or do the DOC conversion if I can't get that straight from
 org.
 
  Thank you,
 
 Ken Mankoff



Re: [O] No ODT export option

2014-01-10 Thread Ken Mankoff
Oh! I tried it from the CLI emacs rather than the GUI one and it worked. I
think I can figure it out from here. Thank you!


On Fri, Jan 10, 2014 at 11:42 AM, Ken Mankoff mank...@gmail.com wrote:

 Ok I seen the option now but when I try to export I get the following
 error:

 OpenDocument export failed: Symbol's function definition is void:
 cl--set-getf


 On Fri, Jan 10, 2014 at 11:32 AM, Ista Zahn istaz...@gmail.com wrote:

 Hi Ken,

 ODT export isn't enabled by default. You can enable it by putting

 (require 'ox-odt)

 in your config file and restart emacs.

 Best,
 Ista

 On Fri, Jan 10, 2014 at 11:23 AM, Ken Mankoff mank...@gmail.com wrote:
  Hi,
 
  I'd like to export to ODT or even directly to DOC. But I notice I do not
  have an ODT export option. Can someone help me set this up?
 
  I'm running org-20140107/ from ELPA on OS X in the emacs 24.3
  (emacsformacosx distribution from http://emacsformacosx.com/). In my
 ELPA
  folder I see:
 
  $ find . | grep -i odt
  ./org-20140107/etc/styles/OrgOdtContentTemplate.xml
  ./org-20140107/etc/styles/OrgOdtStyles.xml
  ./org-20140107/ox-odt.el
  ./org-20140107/ox-odt.elc
 
  But when I'm in emacs in org-mode and I do ESC-x apropos org-odt and
  examine org-odt-data-dir the content of that variable are
  /usr/share/emacs/etc/org which does not exist.
 
  Any help for ODT (and/or DOC) much appreciated.
 
  FYI I also have LibreOffice installed which is how I will view the ODT
  files, and/or do the DOC conversion if I can't get that straight from
 org.
 
  Thank you,
 
 Ken Mankoff





[O] Citations and references in ODT

2014-01-10 Thread Ken Mankoff
Hi,

I have export with references and bibliography working well in LaTeX
export. I'm now exporting to ODT, and wonder if there is reference and
bibliography support for this file format.

I've found this 2011 post saying no
https://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg00296.html

And this 2013 post saying yes
https://lists.gnu.org/archive/html/emacs-orgmode/2013-07/msg00969.html

But I'm not sure if that 2013 code is part of the latest ELPA distribution,
or if there is extra work to get it set up on my system.

Thanks,

   -k.


Re: [O] Citations and references in ODT

2014-01-11 Thread Ken Mankoff

Hi,

On Sat, 11 Jan 2014, Jambunathan K wrote:
If you run in to issues, write me a note and I will happy to make 
fixes or enhancements.


I do have some issues. The unit test is nice, and LaTeX export with 
it appears to work perfectly once I add the following:


\bibliographystyle{unsrt}
\bibliography{MyLibrary}

I'm now trying to get ODT w/ references and failing. The message I 
get is:


OpenDocument export failed: Format specifier doesn't match argument 
type


I did the following based on your instructions and some guessing.

1) I put ox-odt.el and ox-jabref.el and etc/schema and etc/styles in 
my ~/emacs.d/elpa/org-2014017 folder. Some of that involved 
overwriting existing files.


2) I downloaded JabRef application (I'm on OS X), and copied the JAR 
file from inside it into your unit test folder. I ran java -jar 
jabref and opened MyLibrary.bib with the program and saved it. I 
did this because I assume I have to tell JabRef about the bib file?


3) I put MathToWeb.jar in the unit test folder. However, if I run 
java -jar MathToWeb.jar I get the following error. I have an email 
in to the MathToWeb developer/maintainer about this


$ java -jar mathtoweb.jar
Exception in thread main java.lang.UnsupportedClassVersionError: 
mathtoweb/engine/MathToWeb : Unsupported major.minor version 51.0


However, if I export to HTML, I do get to see all the equations. Not 
sure why that is working.


* Results

If I export to LaTeX from org-mode, everything looks good.

If I export to HTML, I do see all the equations, despite the 
MathToWeb error.


If I export to ODT, emacs reports

OpenDocument export failed: Format specifier doesn't match argument 
type


I notice at the top of your test-new.org file the following line:

#+ODT_STYLES_FILE: ~/list-table-1.odt

But I cannot find a list-table-1.odt anywhere in the unit test ZIP 
file or in your org-mode git repo (which I cloned, but elsewhere and 
then copied the files from there to my org-mode elpa repo).



Any hints about where I took a wrong step will be appreciated.

Thanks,

  -k.



Re: [O] Citations and references in ODT

2014-01-11 Thread Ken Mankoff


OK I got it working. THANK YOU. This is amazing. One good authoring 
environment that does both LaTeX and lets me collaborate (somewhat, 
partially, if I'm the primary author) with people using MS Word.


On Sat, 11 Jan 2014, Jambunathan K wrote:

At the minimum you may have to

 M-x byte-compile-file ox-odt.el

and may be fix regenerate autoloads.  See the recipe at the end of 
this message for a cumbersome but a fool proof method.


I thought I had a snippet in my init file to deal with stale elc 
files. Anyway, when I recompile I did get a warning:


Compiling file /Users/mankoff/.emacs.d/elpa/org-20140107/ox-odt.el at Sat Jan 
11 09:00:46 2014
Entering directory `/Users/mankoff/.emacs.d/elpa/org-20140107/'

In end of data:
ox-odt.el:4779:1:Warning: the following functions are not known to 
be defined:

clear-image-cache, image-size


You need to install the Chicago jar file which contain the 
*.layout file that JabRef needs.


I had not installed the plugin.

Clearly not installing the plugin into JabRef was a problem. Perhaps 
the stale elc was too. Anyway, it works now.


Thank you,

  -k.



[O] multi-line citation export issue

2014-01-12 Thread Ken Mankoff
If I have some text and then \cite{a, b
  c, d, e}, these citations do not export properly
to LaTeX, due to the newline in the \cite{}.

The command is escaped and appears as \cite\{a, b, c, d, e\}.

   -k.


Re: [O] multi-line citation export issue

2014-01-12 Thread Ken Mankoff
And a slightly more complicated example:

\cite[some text here
where spaces are not optional]{citekey1,citekey2}

Exports as \cite[some text here where spaces are not
optional]\{citekey1,citekey2\}

   -k.


On Sun, Jan 12, 2014 at 6:21 PM, Ken Mankoff mank...@gmail.com wrote:

 If I have some text and then \cite{a, b
   c, d, e}, these citations do not export properly
 to LaTeX, due to the newline in the \cite{}.

 The command is escaped and appears as \cite\{a, b, c, d, e\}.

-k.



Re: [O] multi-line citation export issue

2014-01-12 Thread Ken Mankoff

On Mon, 13 Jan 2014, Nicolas Goaziou wrote:


Use export snippets:

 @@latex:\cite{}@@



I am not familiar with export snippets, but I guess from that syntax 
that I will not be able to export with citations to ODT/DOC. Right 
now one org file exports well to both formats.


I will deal with multiple citations by not having spaces, and find 
some other way (rewording?) to deal with the \cite[foo bar]{baz} 
situation. And maybe someone more versed in org source can file this 
as a bug, even if not a priority.


  -k.



Re: [O] Citations and references in ODT

2014-01-12 Thread Ken Mankoff
Hi,

I find the ODT export very useful. Working on another document imported
from LaTeX I have a lot of \citep{} and \citet{} in addition to \cite{}. Is
it possible for ox-jabref.el to support this even if it does not
distinguish between the T and P?

I edited the line near the bottom with the regex and changed

 (value (∧ (string-match cite{\\(.*?\\)} latex-frag)

to

 (value (∧ (string-match cite?{\\(.*?\\)} latex-frag)

But it did not help.

   -k.


Re: [O] multi-line citation export issue

2014-01-13 Thread Ken Mankoff

Hi Nicolas et al.,

On Mon, 13 Jan 2014, Nicolas Goaziou wrote:


Ken Mankoff mank...@gmail.com writes:

I am not familiar with export snippets, but I guess from that 
syntax that I will not be able to export with citations to 
ODT/DOC. Right now one org file exports well to both formats.


You can also write the same for odt:

 @@odt:\cite{key}@@

So, in your buffer, it would become:

 @@latex:\cite{key}odt:\cite{key}@@

And you can avoid the implied repetition with a macro:

 #+MACRO: cite @@latex:\cite{$1}odt:\cite{$1}@@

and write in your document:

 {{{cite(key)}}}

Note that you will need to escape commas (with backslashed) in key.

This also works for your more complicated example :

 #+MACRO: cite2 @@latex:\cite[$1]{$2}odt:\cite[$1]{$2}@@



Wow. I was going point out that citing for both formats is 
cumbersome and makes the document hard-to-read, but the MACRO solves 
this. I was not aware of MACRO's. I guess this is both the beauty 
and pain of Org and emacs, all this customization. And down the 
rabbit-hole I go, because now I need to redefine my RefTeX shortcut 
so that it inserts {{{cite(key)}}} instead of \cite{key}.


Unfortunately this is probably not something I have the skill to do 
right now. Perhaps I could get it for one citation, but the regex 
detect when inside an existing cite command and just insert the key, 
not the latex command wrapping it, is beyond my lisp skill and time. 
I'll just deal with no spaces inside \cite{a,b}.


But thank you for teaching me about MACRO anyway.

  -k.



Re: [O] Citations and references in ODT

2014-01-13 Thread Ken Mankoff
Yes I just figured out I need the . before the ?. It works now. I also
made changes in both ox-odt.el and ox-jabref.el, everywhere that I found
the \cite regex.

Works well now. Thank you!

   -k.



On Mon, Jan 13, 2014 at 1:31 AM, Nick Dokos ndo...@gmail.com wrote:

 Ken Mankoff mank...@gmail.com writes:

  Hi,
 
  I find the ODT export very useful. Working on another document imported
 from LaTeX I have a lot of \citep{} and \citet{} in addition to \cite{}. Is
 it possible for ox-jabref.el to
  support this even if it does not distinguish between the T and P?
 
  I edited the line near the bottom with the regex and changed
 
   (value (∧ (string-match cite{\\(.*?\\)} latex-frag)
 
  to
 
   (value (∧ (string-match cite?{\\(.*?\\)} latex-frag)
 

 Try cite[tp]?{\\(.*?\\)}  or cite.?{\\(.*?\\)}instead
 (untested).

  But it did not help.
 
 -k.
 

 --
 Nick





[O] python :session does return

2014-01-14 Thread Ken Mankoff


I've seen various historical issues with :session but it seems I may 
have a different problem. This is the latest org in emacs 24.3. If I 
do not have :session, then everything works just fine.


If I C-c C-c in the following code:

#+BEGIN_SRC python :session transect
import numpy as np
x = np.arange(12)
#+END_SRC

Emacs hangs the first time with minibuffer message of Sent 
python-eldoc-setup-code. If I C-g, I can edit the org buffer again. 
All other invocations of that code and the minibuffer message is 
executing Python code block..., but still emacs hangs until I C-g.


If I look at the *transect* buffer, I see the following. The code 
runs just fine, but for some reason it does not return.


  -k.



Enthought Canopy Python 2.7.3 | 64-bit | (default, Dec  2 2013, 
16:19:29)

[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more 
information.

import numpy as np
Start .pythonrc
End .pythonrc

import numpy as np

x = np.arange(12)
x = np.arange(12)


open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022Yjm', 
'w').write(str(_))
open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022Yjm', 
'w').write(str(_))





'org_babel_python_eoe'
'org_babel_python_eoe'

 Traceback (most recent call last):

  File stdin, line 1, in module
NameError: name '_' is not defined

  'org_babel_python_eoe'
import numpy as np

import numpy as np
x = np.arange(12)

x = np.arange(12)




open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022lts', 
'w').write(str(_))


open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022lts', 
'w').write(str(_))









'org_babel_python_eoe'

'org_babel_python_eoe'

'org_babel_python_eoe'









  1   2   3   4   5   >