[Orgmode] Re: Format for a note

2009-08-30 Thread Matt Lundin
Nick Bell  writes:

> I have just started to use 'z' to add a note from agenda. I'd like to
> change the format of the added note to [the_date] the_note (i.e.
> remove the \\newline after the date which currently appears.
>
> I've looked everywhere but can't find out how to do this. Is it
> possible?

I believe you can change the content of the header line using the
variable org-log-note-headings, but as far as I can tell the format

- header \\ 
  note 

is hardcoded into the function. The "\\" ensures a line break during
export. I appreciate this behavior because it guarantees a clean,
consistent list of notes, regardless of whether they are created with
"z" or via org's automatic logging functions.

Best,
Matt


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


[Orgmode] Re: org-agenda-custom-commands - what's wrong with my setup

2009-08-30 Thread Matt Lundin
"aldrin d'souza"  writes:

> hello org-mode users,
>
> for some reason, my agenda export isn't working as it used to in the
> past.
>
> (setq org-agenda-custom-commands  '(("x" agenda "export to html" nil
> ("~/agenda.html"

If you want the agenda to show up when you select "x", then you need to
use an empty string after agenda:

--8<---cut here---start->8---
(setq org-agenda-custom-commands 
  '(("x" agenda "" nil
 ("~/agenda.html"
--8<---cut here---end--->8---

If you want to name the agenda view, then you should use:

--8<---cut here---start->8---
(setq org-agenda-custom-commands 
  '(("x" "Export to html" agenda "" nil
 ("~/agenda.html"
--8<---cut here---end--->8---

> with this in my org configuration, i get 'x' as an accepted keystroke
> in the agenda command selection buffer. however, when i use it, it does
> not export my agenda. how should i troubleshoot, can someone point me
> to where do i start looking? this used to work in the past, but now
> that i use it after a gap, it doesn't seem to do its thing.

When you select "x", it will only display the agenda in an emacs buffer.
To export the agenda, you need to use:

C-c a e (export agenda views)

This command exports all agenda views for which you have defined an
export target (in this case, "~/agenda.html").

Best,
Matt


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


[Orgmode] Re: org-mode on sloooow computer

2009-08-31 Thread Matt Lundin
Daniel Martins  writes:

> This version is 30 days old.

Actually, org-mode 6.21b was released on Feb. 2, 2009.

But org-mode does change quickly. :)

> To do not create problems with my Ubuntu distribution it is a bit hard
> to try newer versions but I can try if this is
>
>  I feel that there is something critical beyond an upgrade but I do not
> know how to find the core of the problem
>
> Other modes are not slow

You can always try out a new version of org-mode without changing
anything in your emacs installation. Simply download
(http://orgmode.org/org-6.29c.zip), unzip, byte-compile the files
(either from the command line or dired), and add the new directory to
your load path.

See this FAQ for more information:

http://orgmode.org/worg/org-faq.php#installing-org-without-make-tools

Best,
Matt


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


[Orgmode] Re: org-mode on sloooow computer

2009-08-31 Thread Matt Lundin
Daniel Martins  writes:

> My org-agenda is incredibly slow. Please help me understand what is
> happening
>
> My computer is not so slow. It is a dual core
>
>  Intel(R) Pentium(R) D CPU 2.80GHz
> with 2GB of RAM
>
> My organizer.org has 21000 lines
>
> I can split it in a couple of files if this is the solution.
>
> My org-version is 6.21b
>
> GNU Emacs 23.1.50.1 (i486-pc-linux-gnu, GTK+ Version 2.12.9)
>  of 2009-08-01 on radon, modified by Debian

As a first step, I would recommend upgrading to the most recent version
of org-mode. As the conversation you forwarded suggests, there have been
a bunch of optimizations since 6.21b. Other than that, I'm not sure what
would be causing the slowness -- I have thousands of lines in my org
files and the agenda appears almost instantaneously on a very modest
Atom processor. Are other emacs modes slow on the machine?

Best,
Matt



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


[Orgmode] Re: [Feature request/proposal] Pinkie finger saving/amateur mode & alternate org-mode-keymap

2009-09-01 Thread Matt Lundin
"Tim O'Callaghan"  writes:

> I've been using org, but it is starting to bug me that it relies so
> heavily on control-c this and control-u control-c that. It is now also
> the case that there is a bewildering array of key strokes to memorise.
> You only need to look at the org-mode reference card to see that.

An aside: Swapping caps-lock and control makes C-c a very convenient
key combination.

> So this latest release with the agenda keymap change got me thinking
> about the org keymapings, and I'd like to propose something a bit
> different.
>
> This is an idea that will work as a reference for beginners, a dynamic
> built in org-mode reference card, and a pinkie finger saver.
>
> Essentially it is this. There is a  - meta-o or
> ctrl-c-ctrl-c-ctrl-h or whatever. When you press this key it brings up
> a menu like the remember mode and agenda mode front ends. This menu is
> the top of a tree like structure that gives access to all of the
> org-mode key-mappable things. Below is an example created from
> headings in the org-mode reference card.

You can already do something like this with tmm-menubar. You could bind
something like (tmm-menubar 50) to a key to get a browseable menu. Note:
the 50 should be replaced by the the "x-position" of the org menu in
your own menubar. Here's the result:

,
| Press PageUp key to reach this buffer from the minibuffer.
| Alternatively, you can use Up/Down keys (or your History keys) to change
| the item in the minibuffer, and press RET when you are done, or press the
| marked letters to pick up your choice.  Type C-g or ESC ESC ESC to cancel.
| Click  on a completion to select it.
| In this buffer, type RET to select the completion near point.
| 
| Possible completions are:
| s==>Show/Hide n==>New Heading
| N==>Navigate Headings e==>Edit Structure
| E==>Editing   a==>Archive
| h==>Hyperlinkst==>TODO Lists
| T==>TAGS and Properties   d==>Dates and Scheduling
| l==>Logging work  A==>Agenda Command...
| S==>Set Restriction Lock  f==>File List for Agenda
| v==>Special views current filep==>Export/Publish...
| L==>LaTeX D==>Documentation
| c==>Customize b==>Send bug report
| r==>Refresh/Reload
`

Obviously, this would not aid in learning keyboard shortcuts.

> It should also be extendible enough for users to add their own
> functions, and org-mode extensions to add any new keys.

You might also want to checkout CategoryMenus on the Emacs Wiki:

http://www.emacswiki.org/emacs/CategoryMenus

OneKey, LaCarte, Icicles, etc. all look like they might be useful.

Best,
Matt


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


[Orgmode] Re: RSI

2009-09-01 Thread Matt Lundin
Samuel Wales  writes:

> Repetitive strain injury is real and important.
>
> One thing that you can do is to ensure that you have a keyboard that
> has modifier keys on both sides.  You should pound a new habit into
> your cerebellum: use two hands.
>
> For example, c-c c-o should look like this:
>
>   r hand presses ctrl
>   l hand presses c
>   let go
>   l hand presses ctrl
>   r hand presses o
>   let go
>
> This is obviously inefficient, but it is the correct thing.
>
> Ideally, the most important c-c and c-x operations would be on the
> lhs.  That way, you can hold down ctrl and press the two keys.
>
> Many (maybe even most) will find this idea strange.  But I urge all of
> you to try it for a few months.

This is no doubt the correct method, but it is not realistic for many
users given the idiosyncratic layouts of keyboards today. Many of the
laptops I've used have had a misplaced or non-existent right control
key. Thus, short of using viper, the only solution that works for me is
to use the Caps Lock key as Control. With that slight modification, I
find emacs controls *very* comfortable (perhaps even as comfortable than
vim). Once I made that switch, RSI issues disappeared virtually
overnight.

Now, any RSI issues I experience come from using n and p or j and k
repeatedly.

Needless to say, YMMV.

Best,
Matt






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


[Orgmode] Re: Mobile org

2009-09-02 Thread Matt Lundin
Marcelo de Moraes Serpa  writes:

> Hello list,
>
> org-mode really changed my life, and allowed me to fully implement GTD
> the way I wanted. However, I miss having access to it everytime, so,
> I'm looking for a mobile device that could run emacs and org, and that
> I could keep in sync with my laptop.

There have been many discussions of this topic in the past. I would
recommend searching the gmane archives for iPhone, Nokia N810, Android,
portable, etc.

http://news.gmane.org/gmane.emacs.orgmode

If I had money to burn[1] and needed a mobile device, I would wait for
the Nokia N900, which is both a smartphone and a hackable Linux pocket
computer. There are Emacs packages that run on its predecessor, the
N810.

Best,
Matt

Footnotes:

[1] This is a big if. ;)


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


[Orgmode] Re: BUG: blank items in the agenda

2009-09-02 Thread Matt Lundin
"Peter Westlake"  writes:

> This is quite obscure, and an odd corner case, but here it is.
>
> If you have an item which is:
>
> - a TODO
> - scheduled
> - ordered
> - blocked by a child TODO
>
> then it leaves an empty line in the agenda.
>
> Here's a test case:
> ,
> | * Press t r on this line in the agenda
> |   SCHEDULED: <2009-09-02 Wed>
> |   :PROPERTIES:
> |   :ORDERED:  t
> |   :END:
> | *** TODO Report invisible scheduled items
> `
>
> C-a a a will show an agenda with "Scheduled: Press t r ...".
> Press "t" on that line to add a TODO.
> Press "r" to redisplay, and see the line go blank.

I can't duplicate this.

GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.16.5)

Org-mode version 6.30c

Best,
Matt


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


[Orgmode] Org-remember and org-back-to-heading

2009-09-03 Thread Matt Lundin
Hi everyone,

When I call org-remember or org-store-link above the first headline in
an org buffer, I receive the following error message:

Before first headline at position 1 in buffer index.org

It seems that either org-remember or org-store-link (or both) calls
org-back-to-heading in order to grab the relevant heading for
annotation. As a result, if I try to store a link above the first
heading, emacs spits out the error message above because there is no
heading to return to.

Is this the intended behavior? Sometimes I prefer to create a link to
the file as a whole rather than to a particular headline. E.g., I might
want to create a todo to organize notes.org, which is not an agenda
file. In this instance, it does not matter whether org-remember creates
a link to a particular headline. In fact, I would prefer a link to the
file as a whole and thus expect to be able to store a link while on the
first empty line of the file or on #+TITLE.

Thanks,
Matt


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


[Orgmode] Re: FILETAGS documentation clarification

2009-09-04 Thread Matt Lundin
PT  writes:

> I tried FILETAGS for the first time and it failed to work and it
> took a while until I found out why.
>
> I assumed orgfiles are scanned dynamically for filetags, so I
> don't have to do anything just write it into the file. Turned out I
> had to reload the file as well, because org cached filetag info.

Any time you change one of the in-buffer settings line (e.g.,
#+FILETAGS), you need to refresh the buffer by hitting C-c C-c on the
new or updated line. You don't have to reload the file.

Here's the information in the manual:

http://orgmode.org/manual/In_002dbuffer-settings.html

Best,
Matt


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


[Orgmode] Re: Org-mode version 6.30trans (release_6.30d.5.gc125); make fails on org-ascii.el

2009-09-05 Thread Matt Lundin
Hi Daniel,

Daniel Martins  writes:

> On the other hand: Shouldn't a simple `make' do everything needed
> to succeed?
>
> On "How do I keep current with Org mode development?"
>
> http://orgmode.org/worg/org-faq.php#
> keeping-current-with-Org-mode-development
>
> it is suggested the following commands
>
> git pull && make clean && make && make doc && make install
>
> I've put together with a command which updaes a bunch of svn
> repositories from my students.
>
> The problem is: make clean before make FORCES recompiling the same
> files again and not only the updated files!
>
> As org-mode is updated very often and the the compiling process is a
> bit slow and always annoying
> I decide to change the comand to
>
> git pull & && make  && make install
>
> I dropped make doc because it seems that there is som problem with
> texinfo files of these new version.
>
> The problem of omitting make clean isthat: if a file disappears its
> compiled maybe will not disappear and cause problems.
>
> Therefore I repeat Sebastien request:
>
> Shouldn't a simple `make' do everything needed to succeed?

I can't say anything definitive. All I know is that a simple "make &&
make install" usually works for me. 

But, as far as I understand it, omitting the "make clean" has the
potential to cause problems, because org source files are occasionally
renamed or made obsolete. So if you run into any problems after an
install, you should run make clean.

Best,
Matt



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


[Orgmode] Re: GTD and adding next actions under projects with remember

2009-09-09 Thread Matt Lundin
Desmond Rivet  writes:

> I'm using org-mode to implement GTD (or, at least, making a valiant
> effort :) I'm currently doing the following:
>
>  * projects are TODO items under a "Project" heading with a) a project
>tag and b) a CATEGORY property summarizing the project with a short
>label.
>
>  * "waiting" items are TODO items with a waiting tag under a "Waiting"
>heading.
>
>  * next actions are TODO items without a project or waiting tag. 
>
>  * contexts are tags attached to the next action and start with "@"
>
>  * if a next action is under a project heading, then it belongs to that
>project.  I have a special heading called, for lack of a better name,
>"Misc" under which I put all my next actions which are not associated
>with any project.
>
> This all seems to work ok so far, except for one thing: I can't figure
> out how to add next actions under a particular project heading using
> remember.

You can either:

1. Use "C-1 C-c C-c" to file the item interactively.

or

2. Set org-remember-store-without-prompt to nil.

Best,
Matt


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


[Orgmode] Re: Question re CATEGORY and Agenda Views

2009-09-09 Thread Matt Lundin
Markus Heller  writes:

> I apologize if this is RTFM, i couldn't find the answer.  Maybe it's
> also because of a misconception on my part.
>
> I have a .org file with the following setup (HEAVILY inspired by Bernt
> Hansen, http://doc.norang.ca/org-mode.html):
>
> * ABC1
>   :PROPERTIES:
> :CATEGORY: Bugfixes
> :PROJECT:  ABC1
>   :END:
> ** STARTED Find bugs
> ** STARTED Fix bugs
>
> * ABC2
>   :PROPERTIES:
> :CATEGORY: Bugfixes
> :PROJECT:  ABC2
>   :END:
> ** STARTED Find bugs
> ** STARTED Fix bugs
>
> So I have 2 different projects with identical tasks.  If I bring up
> the agenda and list all STARTED tasks, I get a list that looks like:
>
> Bugfixes:   STARTED Find bugs  :NEXT:
> Bugfixes:   STARTED Fix bugs   :NEXT:
> Bugfixes:   STARTED Find bugs  :NEXT:
> Bugfixes:   STARTED Fix bugs   :NEXT:
>
> So the first column is taken from the CATEGORY property.  How can I
> change this so that the actual project is displayed in the agenda
> view? I would expect that I'd have to use the PROJECT property, but
> how do I do this?  Or is my whole idea flawed?

By default, the first item in an agenda line is the CATEGORY. You can
change the appearance of agenda lines by setting
org-agenda-prefix-format, though you will not be able to display an
arbitrary property such as PROJECT. (AFAIK, you are limited to category,
tag, time of day, and scheduling information.)

There is no default functionality for a PROJECT property in org-mode.

Here are a few options I can think of:

1. Use the CATEGORY to designate the project (perhaps make BUGFIXES a
   tag).

2. Set up a column view for the agenda that allows you to view the
   project property.

3. Use a tag to designate the project. This would allow you to filter
   the agenda by project.

4. Use follow mode in the agenda to see the context (i.e., the project
   heading).

Hope this helps.

Matt






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


[Orgmode] Re: diary-remind, and org-agenda, and remember

2009-09-10 Thread Matt Lundin
Desmond Rivet  writes:
>
> For example, this will work in an org file (the reminders show up on the
> agenda):
>
> * Birthdays
> %%(diary-remind '(diary-date 1 6 t) -14) Suzie's birthday.
> %%(diary-remind '(diary-date 11 5 t) -14) John's birthday.
>
> But this will *not* work in an org file (the reminders do *not* show
> up):
>
> * Birthdays
> ** %%(diary-remind '(diary-date 1 6 t) -14) Suzie's birthday.
> ** %%(diary-remind '(diary-date 11 5 t) -14) John's birthday.
>
> I'm using the latest orgmode from the repository.
>
> Anyway, this normally wouldn't be too much of a bother except that I'm
> experimenting with org-remember to add the dates, and this seems to have
> its own problems.
>
> (I was recently having trouble with using '%' signs in the org remember
> templates, but this particular problem has been solved.  Thanks!)
>
> For example, when I have this in my dates.org file:
>
> * Birthday
> %%(diary-remind '(diary-date 1 6 t) -14) Suzie's birthday.
> %%(diary-remind '(diary-date 11 5 t) -14) John's birthday.
>
> with a remember template that looks like this:
>
> (setq org-remember-templates
> '(
> ("Birthday" ?b "%\\%(diary-remind '(diary-date  %^{Month} %^{Day}  t) 
> -%^{Remind days}) %^{Brief Description}%?" "~/pim/gtd/dates.org" "Birthdays")
>  )
>)
>
> then I get this when I finish with C-c C-c:
>
> * Birthdays
> %%(diary-remind '(diary-date 1 6 t) -14) Suzie's birthday.
> %%(diary-remind '(diary-date 11 5 t) -14) John's birthday.
> ** Thu Sep 10 19:06:55 2009 (%%(diary-remind '(diary-date  12 12  t) -12) 12)
>%%(diary-remind '(diary-date  12 12  t) -12) 12
>

I think org-remember automatically adds a heading for purposes of
filing. Otherwise remember items could easily get lost.

Would something like this work?

--8<---cut here---start->8---
(setq org-remember-templates
 '(
  ("Birthday" ?b "* %^{Title}\n %\\%(diary-remind '(diary-date  
%^{Month} %^{Day}  t) %^{Remind days}) %^{Brief Description}%?" 
"~/pim/gtd/dates.org" "Birthdays")
  )
)
--8<---cut here---end--->8---

I'm wondering, though, whether it wouldn't be easier to navigate to the
birthdays heading and simply kill, yank, and edit to create a new
birthday, e.g.,

--8<---cut here---start->8---
* Birthday
%%(diary-remind '(diary-date 1 6 t) -14) Suzie's birthday.
%%(diary-remind '(diary-date 11 5 t) -14) John's birthday.
%%(diary-remind '(diary-date 3 5 t) -14) George's birthday.
--8<---cut here---end--->8---

Adding George's birthday just took me only a few seconds.

Best,
Matt


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


[Orgmode] Re: Scaling org-mode

2009-09-13 Thread Matt Lundin
d...@teklibre.org (Dave Täht) writes:

> I have really been enjoying importing my life into org-mode, which I've
> been doing for about two months now. 
>
> But.
>
> It currently visits about 100 files and 10k of text to construct the
> agenda. It's starting to get kind of slow and interrupt my workflow,
> particularly the background process that scans them. 
>
> While the system is effectively frozen, my message buffer fills up with
> messages about setting the flyspell dictionary to en, etc. This is quite
> annoying with text to speech turned on. I ended up just having appts
> spoken.

My guess is that this is a flyspell problem. I only get messages about
flyspell if I don't have aspell or the proper dictionary installed. Do
you get these messages when you open buffers in other text modes? What
exactly are the messages? What is your flyspell config?

> Solution #1) cut the number of files down - is a good one. I probably
> can cut those files easily in half right now. The problem is that I have
> about 600 more files to import (scenes from a book), and I really like
> the idea of being able to know what my characters are doing in 2023, and
> separate files was kind of useful at one point.

One recommendation would be to leave files that are purely notes out of
your agenda. I noticed from your blog posts that you are adding
timestamps to events from your novel. Are these active or inactive
timestamps? My guess is that parsing all that data is slowing org-mode
down. You can always create a timeline from within a particular file
without including it in your normal agenda files. You can also create
custom agenda views to work on different sets of org files.

http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php

While org-mode is exceptionally robust as a plain text tool, if you need
to manage an ever-growing collection of thousands and thousands of
pieces of data, you'll probably be better served by 1) using a database
or 2) dividing your org-mode files into separate "collections" (i.e.,
reserving your regular agenda for only a subset of org files).

I keep my org files lean by regularly archiving subtrees. I can always
search the archives when I need to.

> so thought 2) would be to have it only attempt to construct background
> agendas when the system is otherwise idle for a few minutes. I don't
> know how to do that, I figure wrapping this bit with something that
> could detect idleness instead of just running arbitrarily would be good.
>
>   (run-at-time nil 3600 'org-agenda-to-appt)
>
> don't know how to detect idleness.

http://www.gnu.org/software/emacs/elisp/html_node/Idle-Timers.html

Best,
Matt


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


[Orgmode] Re: Unnumbered sections in LaTeX export

2009-09-13 Thread Matt Lundin
"Thomas S. Dye"  writes:

> The variable org-export-latex-classes has a specification for
> unnumbered sections but I haven't found any documentation how to mark
> up the org file to activate them.  I might have missed something
> obvious.  Could someone give me a pointer to documentation or some
> help how to markup the org file?

#+OPTIONS: num:nil

http://orgmode.org/manual/Export-options.html

Best,
Matt


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


[Orgmode] Re: dir or folder structure into org-file?

2009-09-14 Thread Matt Lundin
Erwin Panen  writes:

>
> Not sure this is the right place to ask;
> I'm looking for a way to import a complete file structure into an
> org-mode buffer that will be saved to an org-mode file.
>
> I assume org or emacs must be able to do this, but I haven't found
> anything googling around..
>
> Thanks for your help!

I believe org-fstree is a good option for this:

http://burtzlaff.de/org-fstree/

Best,
Matt


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


[Orgmode] Re: Can I publish one block of org file?

2009-09-15 Thread Matt Lundin
Water Lin  writes:

> I am using org to write my draft. After finish the writing, I will copy
> to my blog poster and edit something like linker, pictures.
>
> This way works but is a little slow and should be very careful or else
> it is very easy to forget some linkers, pictures, etc.
>
> I am trying to find a way to write full text in org mode. I think it is
> a good way to do following:
> ---
> After I finish the writing, I select the block of my article, then use a
> command to publish it to basic html and copy the html code into memory.
>
>
> I don't need whole html elements, just need the customized html code for
> the block.
>
> I try to read the org help doc but can't find anything related to
> it. Please give me a start stone, thanks...

C-u M-x org-export-region-as-html

or

C-u C-c C-e R

>From the doc-string:

,
| org-export-region-as-html is an interactive compiled Lisp function in
| `org-html.el'.
| 
| (org-export-region-as-html beg end &optional body-only buffer)
| 
| Convert region from beg to end in org-mode buffer to HTML.
| If prefix arg body-only is set, omit file header, footer, and table of
| contents, and only produce the region of converted text, useful for
| cut-and-paste operations.
| If buffer is a buffer or a string, use/create that buffer as a target
| of the converted HTML.  If buffer is the symbol `string', return the
| produced HTML as a string and leave not buffer behind.  For example,
| a Lisp program could call this function in the following way:
| 
|   (setq html (org-export-region-as-html beg end t 'string))
| 
| When called interactively, the output buffer is selected, and shown
| in a window.  A non-interactive call will only return the buffer.
`

Best,
Matt


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


[Orgmode] Re: Documentation wishlist items

2009-09-15 Thread Matt Lundin
Ethan  writes:

> Hi guys,
>
> I've been studying org-mode for a few months now, and I think I'm
> finally getting the hang of it. 

I'm still saying the same thing after 1 year. :)

> It's really overwhelming, and I really appreciate the efforts that
> must have gone into the manual and the worg project. But I think it
> still needs work.
>
> The fundamental problem is that org-mode isn't a planner, it isn't an
> organizer. 

???

> It's a toolkit full of tools which people use differently,
> in lots of ways, to build their own planner/organizer. To understand
> org-mode, you have to understand all of the tools available, and the
> options you have for each, and the ways they interact with the other
> tools.

I must respectfully disagree here. The org-mode basics are quite simple.
Create an outline, organize it however you see fit, mark actions as
TODOs, schedule, view and review using the agenda. To take advantage of
org, you really don't need to know much more than that. The basic
concepts would apply to any outliner or basic task management tool.

All the other features---clocking, properties, column view, exporting,
publishing, tags, tables/spreadsheets, effort estimates, etc.---are
there in the background in the event that you need them. 

Heck, even without all the extras, org would still be a world-class
outliner.

> For example, let's take Archiving. The documentation I'm reading right
> now, at http://orgmode.org/manual/Archiving.html#Archiving, puts
> archiving in "Document Structure", section 2.6, before TODO keywords,
> tags, the agenda, or anything else. There's one paragraph about what
> archiving means, then five or six paragraphs about how a headline with
> the ARCHIVE tag behaves, and then a section about moving trees and
> where you could move them. It isn't clear what workflows you might use
> Archive Sibling in, or why C-u C-c C-x C-s would archive *children* of
> the selected headline instead of the headline itself.

The manual is not your only source of information. I make heavy use of
C-h v and C-h f to learn more about particular variables and functions.

> Another good example is TODO keywords, categories, and tags. It isn't
> clear what they all are, or why they are distinct, or what the
> differences are, and it's easy to confuse them with similarly-named but
> completely distinct concepts like properties.

Here's how I see it.

1) TODO keywords: How does this item fit into my workflow?

2) Category: What group does this tree belong to? (This is the word that
   appears next to the item in the agenda.)

3) Tags: What words do I want to add to this item/tree to enable me to
   find it easily. (Commonly used for GTD contexts.)

4) Properties: What extra data would I like to attach to this item?
   (Commonly used to set special options for a subtree/item, but also
   very useful for creating ad-hoc "databases".)

In my opinion, one of the biggest decisions new users have to make is
how to designate projects. Should I use a TODO keyword, a tag, or a
second level headline? I prefer the todo keyword "PROJECT" myself, but
any of these would work fine.

And if you regret the decision three months from now, you can always use
org-map-entries to change your project items en masse.

> Reading HOWTO's like Bernt Hansen's and Charles Cave's are really
> interesting to see how people work, but even documents like these don't
> explain *why* they set things up in this way. For example, Bernt
> Hansen's document explains that his toplevel headings are "main
> categories", and shows that they each have a CATEGORY property, but
> doesn't explain what that buys him, or what problem that solves.

My guess is that this allows him to see what group an item belongs to in
the agenda view, since categories are listed in the left column.

But this is like asking why someone puts their pots in the cupboard next
to the oven rather than above the sink, or why someone uses legal pads
rather than a spiral notebook.

My recommendation: Just start creating trees, use only a few TODO
states, and allow the organization to evolve in the way that feels the
most comfortable to you.

Best,
Matt


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


[Orgmode] Re: Documentation wishlist items

2009-09-16 Thread Matt Lundin
Sebastian Rose  writes:

> Ethan  writes:
>> Hi guys,
>>
> Documentation is not such an easy thing to do and a lot of work, too. A
> tutorial _is_ missing. We had some discussions here about that, but no
> one got around to it. I think about it every so often, but writing a
> tutorial is such a big thing to do.
>
> Personally, I think that one or two fictive characters would fit
> best. People, simply using Org-mode to take notes, plan, publish and so
> on.
>
> The entire thing should start _very_ simple and without any
> customization at all. I see customization in chapter 15 - no earlier
> really unless unavoidable.

Great ideas here and in the outline! Before we dive into creating a new
tutorial, we might want to use David O'Toole's venerable tutorial as a
point of reference. Rereading it today, it's remarkable how none of the
core principles of org-mode have changed despite so much development:

  - http://orgmode.org/worg/org-tutorials/orgtutorial_dto.php

We might also take a look at the beginner's customization guide:

  - http://orgmode.org/worg/org-configs/org-customization-guide.php

What needs to be updated there? What's missing?

I do like how org currently places Bernt's and Charles's tutorials under
a "power users" section, to distinguish them from basic tutorials. They
are examples of how two seasoned org-mode users take advantage of the
variety of features that org offers.

Would it be safe to say, though, that org-mode has since grown so
powerful and feature-rich that its many options can now overwhelm new
users, despite its core simplicity? What I hear in Ethan's original post
and in many recent mailing list posts is a request for help sorting out
the essentials from the "optional" features depending on use-scenarios.

An example: It seems that a new user, inspired by the many excellent
tutorials on remember, might be tempted to use remember to enter
*everything* in their org-files (with dozens of complex remember
templates). But in many instances, it may be faster and more convenient
to enter things directly into the outline.

I think what we're dealing with is the paradox of choice. Too many
options can paralyze/overwhelm a user. For instance, while archiving is
a straightforward feature, it's easy to get hung up on the fact that
there are three separate types of archiving, which gives rise to
uncertainty about which to use and when to use it, or perhaps even a
sense that one *must* understand and use all of them just because they
all exist.

With that in mind, we might add sections to the tutorial/book structured
around various use scenarios: 

 - If you're outlining/writing an book, here are some of the
   features that might be useful.

 - If you want a basic GTD system, here are a few ways you might do it.

 - If you want to use org for sophisticated project management and
   clocking, here are some of the things you might use find useful.

 - If you're researching a book... 

 - If you want to keep track of interesting bookmarks on the web...

 - If you want to publish documents for your co-workers...

Alternatively, we might move through the tutorial/dialogue feature by
feature:

 - What in the world are drawers? Why would I want to use those?

 - Etc.

Just a few ideas.

Best,
Matt






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


[Orgmode] Re: Documentation wishlist items

2009-09-16 Thread Matt Lundin
Sebastian Rose  writes:

> Bastien  writes:
>> Sebastian Rose  writes:
>>
>>> Here is some kind of outline for such a tutorial.
>>
>> Wow.  That an outline for a full book!  
>>
>> And I guess that's what comes at the horizon: an (O-Reilly) book about
>> Org-mode.  It would not compete with the manual as a reference, but it
>> would make it easier to more people to open Org's doors.
>
>
> OK, let's just start it. I'd like to have the tutorial on
> orgmode.org/worg. But I'm not yet sure about the structure.
>
>
> Option (A)
>   is, to create an .../worg/the-org-tutorial/index.org, that just
>   contains an index to the chapters. Each chapter goes to a single file
>   in that directory.
>
> Option (B)
>   Put the entire thing into one big file. This has the advantage, that
>   we wouldn't need to create any extra directories on worg:
>   orgmode.org/worg/org-tutorials/the-org-tutorial.org
>
>
>   || (A) Multiple files | (B) Monolitic |
>   |++---|
>   | Outlining a skeleton   | -  | + |
>   | Restructure| -  | + |
>   | Multiple editors   | +  | - |
>   | Distribution (e.g. as PDF) | -  | + |
>   | Easy navigation| +  | - |
>   |++---|
>   | Sum| -1 | +1|
>
>
>
> Thoughts?

My vote would be for separate files that could also be published as a
monolithic pdf file. I know the possibility of publishing multiple files
as a single book exists in muse, but how would one do that with
org-mode? Is there a directive to publish separate html files and a
monolithic pdf file simultaneously (perhaps via #+INCLUDE directives)?

- Matt


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


[Orgmode] Re: Documentation wishlist items

2009-09-16 Thread Matt Lundin
Bastien  writes:

> Hi Ethan,
>
> Ethan  writes:
>
>> Another good example is TODO keywords, categories, and tags. It isn't clear
>> what they all are, or why they are distinct, or what the differences are, and
>> it's easy to confuse them with similarly-named but completely distinct 
>> concepts
>> like properties.
>
> The manual might enjoy a glossary.  ;)
>
> I have created org-glossary.org on Worg, please check it out and add
> your own definitions: http://repo.or.cz/w/Worg.git

O.K. So I went a little crazy and added a bunch of definitions to the
glossary.

  - http://orgmode.org/worg/org-glossary.php

Perhaps it's not so much a glossary any more as an shorter introduction
to the basic concepts of org-mode.

My apologies if I ended up repeating details from the manual, but my
goal was to provide the following:

   1) a brief definition of each term/concept.

   2) a more detailed explanation of what it is and/or how it works.

   3) possible uses (e.g., Why might one want to use categories?)

I made a small dent in the list of terms. Please feel free to take up
any of the remaining entries.   

Best,
Matt



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


[Orgmode] Re: Hoisting (so to speak)

2009-09-17 Thread Matt Lundin
timetrap  writes:

> One of my favorite features in the vim out liner was the ability to
> "hoist" a sparse tree into a new temporary buffer.
>
> Is there a way to do this in org-mode?

Of course there is. This is emacs. ;) 

Use C-x n s to narrow to the current subtree.

Use C-x n w to go back to the whole buffer (widen).

Use C-c x b to create a new buffer containing only the current subtree.

See http://orgmode.org/worg/org-faq.php#indirect-buffers

Note: I can't recall if the vim outliner's "hoisting" includes
temporarily/artificially "raising" the headline level/indentation of the
narrowed subtree. Org-mode does not do this (and intentionally so).

Best,
Matt


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


[Orgmode] Re: Eliminate DONE state?

2009-09-18 Thread Matt Lundin
PT  writes:

> Is is possible to eliminate the DONE state completely? I'd like a single 
> state TODO and want to switch between TODO and nothing states, but 
>
>  (setq org-todo-keywords '((sequence "TODO")))
>
> doesn't seem to work, because it always considers the last state as a
> DONE state.
>
> Is it possible to have only a single actionable task state and nothing 
> else, so when I switch then the sequence is nothing-TODO-nothing-TODO-...? 

Not that I am aware of. Lots of functionality in org depends on inactive
TODOs. For instance, if you don't have a DONE state, then scheduled
items will remain on your agenda forever, even if they aren't marked as
a TODO.

Why not just switch back and forth between TODO and nothing by S-Right
and S-Left?

Best,
Matt


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


[Orgmode] Re: urgency & importance (was: (no subject)

2009-09-18 Thread Matt Lundin
Robin Green  writes:

> Is there any equivalent to planner-mode's planner-rank.el for
> org-mode? I want to automatically compute some sort of combined
> measure of urgency and importance for each of my TODOs, and rank them
> according to this measure. (Of course, I could write my own code to do
> this, and I might do just that if there isn't anything suitable
> already out there.)

Could you please explain what you mean by urgency and importance? I'm
not familiar with that distinction.

You might want to checkout the docstring for the variable
org-agenda-sorting-strategy. There are lots of ways to sort items in the
agenda, along with the possibility of creating your own sorting
functions.

Best,
Matt


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


[Orgmode] Re: Eliminate DONE state?

2009-09-18 Thread Matt Lundin
Carsten Dominik  writes:

> On Sep 18, 2009, at 1:31 PM, PT wrote:
>
>> Is is possible to eliminate the DONE state completely? I'd like a
>> single
>> state TODO and want to switch between TODO and nothing states, but
>>
>> (setq org-todo-keywords '((sequence "TODO")))
>>
>> doesn't seem to work, because it always considers the last state as a
>> DONE state.
>>
>> Is it possible to have only a single actionable task state and nothing
>> else, so when I switch then the sequence is nothing-TODO-nothing-
>> TODO-...?
>
>
> Hi PT,
>
> the following seems to work, but  am not sure if it will break
> something.
>
> (setq org-todo-keywords '((sequence "TODO" "|")))

That was my first thought, too. But on my machine, it causes TODO items
to be assigned a CLOSED timestamp.

Best,
Matt


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


[Orgmode] Re: org-examples.git?

2009-09-18 Thread Matt Lundin
d...@teklibre.org (Dave Täht) writes:

> My eyes glazed over at the documentation thread.  

I'm afraid my posts may have had something to do with that. :)

> There are a lot of wonderful tutorials out there, and some great
> documentation, but often it requires a fairly high level of
> understanding of emacs to solve what's missing or what goes wrong and a
> bit of cutting and pasting.
>
> I'm kind of more interested in actual, working examples, that require as
> little setup and thought as possible, all collected in one place (like,
> org-examples.git or as part of the org-mode git tree), that anyone could
> try, use, or edit as a base...

Here are a couple of nice places to start:

http://orgmode.org/worg/org-configs/org-customization-guide.php

http://orgmode.org/worg/org-configs/org-customization-survey.php

Best,
Matt


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


[Orgmode] Re: Default Date for Scheduling in Remember Buffer

2009-09-22 Thread Matt Lundin
Philipp Schaefer  writes:

> I just tried the functionality described in the manual in the section
> http://orgmode.org/org.html#Setting-up-Remember-for-Org , according to
> which the key combination 'k r' leads to timestamps defaulting to the
> day on which the pointer was when 'k r' was invoked. Now is it somehow
> possible to alter the behaviour of %t to not only be converted to a
> simple timestamp but instead to a deadline- or scheduled-timestamp?

Here's the simplest way to do it:

(setq org-remember-templates
  '((?s "* TODO %^{Title}\n SCHEDULED: %t\n %a\n %i")
(?d "* TODO %^{Title}\n DEADLINE: %t\n %a\n %i")
;; ... other templates here
))

- Matt


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


[Orgmode] Re: Is it possible to show an agenda item only if it's due?

2009-09-22 Thread Matt Lundin
PT  writes:

> I have several items on my agenda which have a time
> specification (e.g. 4pm), but it only means I should work on it
> sometime after 4pm. It can even be 8pm when I actually deal with
> the item.
>
> So there is no need for me to see the item constantly on the
> daily agenda, I'd like this item to appear only if I display the
> agenda after 4pm. I don't want to see it before the given time,
> because I can't work on it then, so it only clutters the view.
>
> Is it possible to do this with org?

One recommendation:

Create an ":EVENING:" tag and filter it out in the agenda. Or,
optionally, create custom agenda commands for day and evening agendas
that pull up different results based on tags.

- Matt


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


[Orgmode] Re: Is it possible to show an agenda item only if it's due?

2009-09-22 Thread Matt Lundin
PT  writes:

> Matt Lundin  imapmail.org> writes:
>
>> One recommendation:
>> 
>> Create an ":EVENING:" tag and filter it out in the agenda. Or,
>> optionally, create custom agenda commands for day and evening agendas
>> that pull up different results based on tags.
>> 
>
> This wouldn't work, because I have lots of different such times during
> the day which cannot be grouped into 2-3 main categories.
>
> 4pm was only an example. It can be any other time during the day and I only
> want those items to appear when their time is due.

Ah I see. Another idea: write an agenda skip function that converts the
timestamp to universal time and ignores the entry if it is greater than
(current-time). Such as,

--8<---cut here---start->8---
(defun my-skip-if-later ()
  "Skip entries that are later than the current time."
  (let ((time (or (org-entry-get nil "TIMESTAMP")
  (org-entry-get nil "SCHEDULED"
(when time
  (if (time-less-p (org-time-string-to-time time) (current-time))
  nil  ;; less than current time --> include it
(outline-next-heading) ;; otherwise move on

(setq org-agenda-custom-commands
  '(("A" "Without later items" agenda "" 
 ((org-agenda-ndays 1)
 (org-agenda-skip-function '(my-skip-if-later))
--8<---cut here---end--->8---

Note: this is just a quick example. I haven't tested it and am not sure
whether it breaks something. Also, it would become considerably more
complex if you also wanted to consider time-of-day information in the
heading.

- Matt


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


[Orgmode] Re: two custom agenda view questions

2009-09-23 Thread Matt Lundin
Michael Gilbert  writes:

> Still too much of a newbie to figure this out on my own. I get lost in
> the Lisp still.
>
> (1) I want to define a custom agenda view that displays only those
> tasks that have today as a deadline or are past-due. Since many of my
> tasks also have scheduled timestamps, sometimes these end up being the
> same day. It looks to me as if they will be left out if I skip
> scheduled items, even if they also have a current deadline. How can I
> finesse this?

--8<---cut here---start->8---
(setq org-agenda-custom-commands
  '(("d" "Due today" agenda ""
 ((org-deadline-warning-days 1)
  (org-agenda-skip-scheduled-if-deadline-is-shown t)
  (org-agenda-skip-function '(org-agenda-skip-entry-if 
'notdeadline))
--8<---cut here---end--->8---

> (2) Eventually, I want to create a DONE log of copies of items as they
> get finished, with contextual data retained. But for right now, all I
> want is to be able to switch to an agenda view of tasks that were
> complete today. I've tried a few ideas that seemed like low-hanging
> fruit here, but no luck.

Type "l" in the agenda for log mode.

- Matt


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


[Orgmode] Re: Weekly review of completed actions

2009-09-24 Thread Matt Lundin
Kevin Chow  writes:

> After long searching I've decided that org-mode will be my productivity
> tool of choice. I'm actually learning emacs just so I can use org-mode
> and right now I'm a bit of a newb.
>
> My question is how do I process my todo list in a way that I can mark
> something as done or archived or something and then have it not show up
> in my normal view and instead go into a list of completed actions. I'm
> sure there's an easy way to do this but I'm still new enough not to
> know what it is. Thanks in advance for your help!

http://orgmode.org/manual/Agenda-commands.html#Agenda-commands

By default, completed items will not show up in your todo list. 

You can, however, see completed items at any time:

   1. By pressing "l" in the daily/weekly agenda view (and, optionally
   "v a" or "v A" to include archived items).

   2. By doing a TODO search for "DONE" items. (C-c a T DONE)

You can also create custom agenda commands for a variety of scenarios.

- Matt


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


[Orgmode] Re: HTML export without all tags

2009-09-25 Thread Matt Lundin
Detlef Steuer  writes:

> I'm in the process of adapting cmsimple (www.cmsimple.dk) to use our
> university's corporate design. Cmsimple in its core is a php script,
> which takes _one_ html file and creates the complete layout of a site
> on the fly while splitting the file apart at h[123] levels.
>
> Now I want to create that one html file with org-mode. What else?
>
> If I could get org-mode to export pure html without all the  tags
> I think I am done. But how to explain to orgmode to be dumb?

AFAIK, the  tags are hard-coded into org-export-as-html. 

You might try org-export-generic in the contrib directory of the git
repository. 

Another (more complex) solution: export to LaTeX and then use a
converter such as hevea or tex4ht to create a basic html file.

Too bad cmsimple doesn't parse org source files instead of html! ;)

- Matt


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


[Orgmode] Re: HTML export without all tags

2009-09-25 Thread Matt Lundin
Carsten Dominik  writes:

> On Sep 25, 2009, at 2:00 PM, Detlef Steuer wrote:
>
>> Is there a way to get rid of all div tags in exported html?
>
> I guess the easiest would be to just post-process the html file
> produced by Org.  For example with perl (untested):
>
> perl -ap -e 's/]*>//g' orgoutput.html > simple.html

So simple and elegant. It's amazing how many simple tricks you learn by
hanging around this list. :)

- Matt


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


[Orgmode] Re: suggestion: options for chronological agenda

2009-09-26 Thread Matt Lundin
Ilya Shlyakhter  writes:

> I often need to find recently modified entries. I try to timestamp
> entries I work on with the active timestamps (in angular brackets),
> and use the C-x a L command. This mostly works, but is imperfect:

> - when i use time logging, it inserts "inactive" timestamps that
> are not found this way. so, i can't use this to find "recently worked
> on" entries.

I believe that's because org-mode, in general, treats active timestamps
as scheduling data -- i.e., things you need to do. I.e., it is optimized
for using inactive timestamps to indicate "recently worked on" items.

> - it looks at the _first_ timestamp in an entry, rather than the
> _last_ timestamp

Could you give an example? When I try C-c a L, it creates separate
instances for each timestamp in an entry.

E.g., the following file...

--8<---cut here---start->8---
* A test
<2009-09-25 Fri>
<2009-09-26 Sat>
--8<---cut here---end--->8---

becomes...

--8<---cut here---start->8---
Friday 25 September 2009
  A test
---
Saturday   26 September 2009
  A test
--8<---cut here---end--->8---

> - it is limited to one file .   would be much better if it could
> be made to work across the entire agenda.
> - it would be fine to have the option to limit it to entries
> within the last, say, week, if that would speed it up.

Depending on whether or not Carsten decides to change the behavior of
the timeline view ;) , you could always use a custom agenda command to
accomplish the same thing.

>
> The suggestion is to enhance the timeline agenda with options to:
>- recognize "inactive" timestamps ([in square brackets])

See the variable org-agenda-inactive-timestamps.

> It would also be _really_ great if the chronological listing could be
> filtered to contain only entries matching a certain tag/property
> query.

Try filtering the timeline with "/".

Best,
Matt


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


[Orgmode] Re: to bookmarks

2009-09-26 Thread Matt Lundin
andrea Crotti  writes:

> Bookmarks from org-mode:
>
>I insert many many links inside my orgmode but sometimes I would also like 
> to have them in my 
> browsers (safari and firefox sometimes).
>
>Is there already something working out of the box?
>
>The hierarchy like
>
>* level1
>** level2
>   [[http://sito.com][sito]]
>
> Should maybe create directories, for a cleaner view..

I've been looking for similar functionality for a while so I hacked up a
simple function to export the bookmarks of an org file as an html file,
which can then -- at least theoretically ;) -- be imported into your
favorite web browser. I'm an elisp novice, but it seems to work:

--8<---cut here---start->8---
(defun org-export-html-bookmarks ()
  "Extract bookmarks from the current org file and create an html file that
can be imported into a web browser."
  (interactive)
  (let ((file (file-name-nondirectory (buffer-file-name)))
bookmarks)
  (save-excursion
(goto-char (point-min))
(while (re-search-forward org-bracket-link-analytic-regexp nil t)
  (when (equal (match-string 2) "http")
(let ((url (concat (match-string 1)
   (match-string 3)))
  (desc (org-substring-no-properties (match-string 5
  (push (concat "" desc "\n") bookmarks
(with-temp-buffer 
  (insert
   "\n"
   "\n"
   "\n"
   "Bookmarks\n"
   "Bookmarks\n"
   "" file " (" (format-time-string "%Y-%m-%d") ")\n"
   "\n")
  (apply 'insert (nreverse bookmarks))
  (insert
   "\n"
   "")
  (write-file (concat (file-name-sans-extension file) 
"-bookmarks.html"))
--8<---cut here---end--->8---

I'll put it up in the "hacks" section on Worg.

Regards,

Matt


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


[Orgmode] Re: short way to insert source tag in org mode?

2009-09-27 Thread Matt Lundin
Water Lin  writes:

> While I am using org to publish my source code, I include my code in
> following way:
>
> #+BEGIN_SRC emacs-lisp
> some emacs-lisp code
> #+END_SRC
>
> Everytime I copy the begin and the end tag which is
>
> #+BEGIN_SRC emacs-lisp
>
> and
>
> #+END_SRC
>
> to my org file.
>
> I want to find a way to inset them handly. Is there a key binding for
> this?

It's an experimental feature, but I use "http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Editing LaTeX code in org-mode

2009-09-27 Thread Matt Lundin
"Alan E. Davis"  writes:

>    #+BEGIN_LaTeX
>    questions and sections
>   #+END_LaTeX
>
> For now, however, is there a way to use AUCTeX to edit the LaTeX in the
> environment above?  Currently, my habit of using C-c e to enter
> environments is getting in the way, for example.
>
> Perhaps there is a way to easily enter environments, perhaps the
> "multiplechoice" environment can be defined in a variable? (and
> others?)

Have you tried "C-c '"? If auctex is your default TeX environment,
hitting C-c ' inside a LaTeX should take you to an auctex buffer.

- Matt




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


[Orgmode] New footnote with folded footnote section

2009-09-27 Thread Matt Lundin
Hi Carsten,

I have org-footnote-section set to "Footnotes." If I insert a new
footnote while...

 1. the "* Footnotes" tree already exists and

 2. the "* Footnotes" tree is folded

...the footnote definition label is inserted, but the "* Footnotes"
subtree remains folded and the cursor jumps to the "* Footnotes"
headline rather than the definition line.

I've tried using org-reveal (C-c C-r) to open the "Footnotes" section,
but nothing happens. I've tried typing C-c C-c to go back to the
footnote, but since the cursor is on a headline, the result is a tag
prompt. When I hit TAB to cycle, the cursor remains on the headline.

Thanks for your help.
Matt


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


[Orgmode] Re: tags in todo list

2009-09-29 Thread Matt Lundin
David Schoen  writes:

> I was wondering if there is a way to filter the todo list (C-c a t) by
> tags that are applied.
>
> I'm trying to use org-mode for a GTD style process management which
> means I've got things like :home: and :office: set as tags and as such
> when I'm at the office I would like to have some way of hiding the
> :home: entries.

Try pressing "/" in the agenda. 

  - http://orgmode.org/worg/org-faq.php#limit-agenda-with-tag-filtering

  - http://orgmode.org/manual/Agenda-commands.html#Agenda-commands

Best,
Matt


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


[Orgmode] Re: Filtering the global todo list in a custom agenda

2009-09-30 Thread Matt Lundin
PT  writes:

> I'm trying to filter the global todo list, so that items with certain
> tags don't appear in it, but this solution doesn't seem to work:
>
> (setq org-agenda-custom-commands
>   '(("h" "Agenda and todo"
>  ((agenda "")
>   (alltodo "-test")
>
>
> Items with "test" tag are shown nevertheless. How could I filter them?

(setq org-agenda-custom-commands
  '(("h" "Agenda and todo"
 ((agenda "")
  (tags-todo "-test")

- Matt


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


[Orgmode] Re: Is there a good way to use org as blog system?

2009-09-30 Thread Matt Lundin
Bob Erb  writes:

> Hi, Water.
>
> Water Lin  writes:
>> I want to mantain a local static html blog system on my local
>> computer. I think org is good enough to organise the stuff.
>>
>> Is there any special function for me to use org as blog system?
>
> Take a look at worg; it'll do ya:
>
>  http://orgmode.org/worg/worg-about.php

I'm not sure what you mean here. Could you please clarify how Worg would
help one set up local, static html blog?

Perhaps you mean org-publish? Worg is just a website generated from a
set of org files edited by org users.

- Matt









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


[Orgmode] Re: HTML export: How to export body only, as HTML "fragment"?

2009-09-30 Thread Matt Lundin
Bill Powell  writes:

> - get HTML export to just convert the text to HTML,
>   without wrapping a template and  and  and
>  tags around it. I can't find an option to do this,
> but it seems like if there isn't one, it should be fairly
> easy to implement. Pyblosxom needs HTML fragments so it can
> wrap my custom templates with dynamic title lists, etc.

There are BODY-ONLY arguments for both org-export-as-html and
org-export-region-as-html.

Here's an example provided in the docstring of
org-export-region-as-html:

,
|   (setq html (org-export-region-as-html beg end t 'string))
`

Best,
Matt


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


[Orgmode] Re: Orgmode for budgeting/expense recording

2009-10-01 Thread Matt Lundin
Raffi R  writes:

> Thank you, I will have a look.

You might also want to have a look at this thread:

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

Best,
Matt

>
> On Thu, Oct 1, 2009 at 1:43 PM, Russell Adams  
> wrote:
>> I use John Wiegley's Ledger:
>>
>> http://wiki.github.com/jwiegley/ledger
>>
>> Good luck!
>>
>> On Thu, Oct 01, 2009 at 12:13:56PM -0400, Raffi R wrote:
>>> I was wondering if anyone has any experience using orgmode for
>>> budgeting and (more particularly) keeping track of daily and
>>> day-to-day expenses, and would be interested in describing their
>>> workflow.
>>>
>>> Thanks!
>>>
>>> - Raffi.


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


[Orgmode] Re: Orgmode for budgeting/expense recording

2009-10-02 Thread Matt Lundin
Eric S Fraga  writes:

> As do I and highly recommended indeed!
>
> It would be interesting to see a org-babel interface to ledger...
> what ledger is missing, in the context of emacs, is an easy way to see
> the actual output of the ledger command (e.g. bal or reg) while
> looking at the ledger file.
>

Do you use ledger.el, which comes with the ledger source? It makes it
very easy to enter new items and to invoke ledger commands from within a
ledger file. I also find it indispensable for reconciling accounts.

Best,
Matt


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


Re: [O] How to never have the Footnote heading generated?

2014-06-21 Thread Matt Lundin
Grant Rettke  writes:

> I want only to use in-line footnotes and never to have them
> automatically entered into an auto created Footnote heading.

An easy way to create inline footnotes is to use the following setting:

(setq org-footnote-auto-label nil)

Then, when you call org-footnote-action, simply press return for an
"anonymous" (i.e., inline) footnote.

 - The footnote looks like this.[fn:: Like this one]

Best,
Matt



Re: [O] How to never have the Footnote heading generated?

2014-06-22 Thread Matt Lundin
Grant Rettke  writes:

>> What I was aiming for was to have in-line footnotes that did have
>> randomly generated IDs so that I one still may reference them.

> Here is what I had intended:
>
> (setq org-footnote-define-inline +1)
> (setq org-footnote-auto-label 'random)
> (setq org-footnote-auto-adjust nil)

Nice! I misunderstood the initial question. The above works fine for me
as a way to insert inline footnotes with random labels. When I call
org-footnote-action, I get the following.

 - Here is a footnote.[fn:5952d54e: A footnote]

>> I misunderstood though, because the footnotes will still get defined
>> in the Footnote section, too. 

Could you please explain what you mean here? The above settings do not
create a footnote section when I call org-footnote-action or
org-footnote-new. But you could use (setq org-footnote-section nil) to
ensure that any footnote definitions (if they exist) will be placed in
the same section as the footnote reference.

Or do you mean the label for "Footnotes" in, say, html export? If so, I
believe you can configure the variable org-html-footnotes-section.

Best,
Matt



[O] [Bug] element cache problem with repeating timestamps

2014-06-22 Thread Matt Lundin
A recent git pull broke logging with repeating todos. 

I'm guessing this has something to do with one of the recent changes to
the org element cache, since setting org-element-use-cache to nil solves
the problem.

Recipe to replicate:

1. /usr/bin/emacs -Q -l ~/minimal.el

Here is minimal.el:



minimal.el
Description: application/emacs-lisp

2. Open a file containing the following:

--8<---cut here---start->8---

* TODO Repeating task
  SCHEDULED: <2014-06-23 Mon 20:00 .+1d> 
  :LOGBOOK:
  - State "DONE"   from "TODO"   [2014-06-22 Sun 23:01]
  :END:
  :PROPERTIES:
  :LAST_REPEAT: [2014-06-22 Sun 23:01]
  :END:
--8<---cut here---end--->8---

3. Hit org-todo on the headline. The buffer then looks like this:

--8<---cut here---start->8---
* TODO Repeating task
<2014-06-23 Mon 20:00 .+1d>  SCHEDULED:  
  :LOGBOOK:
  - State "DONE"   from "TODO"   [2014-06-22 Sun 23:10]
  - State "DONE"   from "TODO"   [2014-06-22 Sun 23:10]
  - State "DONE"   from "TODO"   [2014-06-22 Sun 23:01]
  :END:
  :PROPERTIES:
  :LAST_REPEAT: [2014-06-22 Sun 23:10]
  :END:
--8<---cut here---end--->8---

Sometimes (more difficult to replicate) the LAST_REPEAT ends up in the
wrong place (e.g., the beginning of the buffer). Also, emacs sometimes
freezes when calling org-todo.

 - Org-mode version beta_8.3 (beta_8.3-16-g8ad206 @
   /home/user134/org-mode/lisp/)
 - GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of
   2014-06-11 on var-lib-archbuild-staging-x86_64-jgc

Thanks,
Matt


Re: [O] [Bug] element cache problem with repeating timestamps

2014-06-23 Thread Matt Lundin
Nicolas Goaziou  writes:

> Hello,
>
> Matt Lundin  writes:
>
>> A recent git pull broke logging with repeating todos. 
>>
>> I'm guessing this has something to do with one of the recent changes to
>> the org element cache, since setting org-element-use-cache to nil solves
>> the problem.
>
> It should be fixed. Thank you for reporting it.

Thanks! Works fine now.

Matt



Re: [O] Latest Speed Keys "D" and "U" behavior

2014-06-23 Thread Matt Lundin
marcowahls...@gmail.com writes:

> Hi,
>
> In the past speed key "D" (analog "U") on a headline moved the whole
> subtree down.  In the latest org-mode version the effect of speed key
> "D" is to move the headline (and only just the headline) down.  BTW this
> change of behavior is due to a change in `org-shiftmetadown' AFAICT.
>
> Is the user who wants the old behavior back supposed to configure
> `org-speed-commands-user' with `org-metadown'?
>
> Personal note: I used those keys a lot as I can clearly observe since
> their functionality changed.  And I vote for giving the speed keys "D"
> and "U" back their old functionality.

I can confirm this bug. I consider it an undesired change since when one
is on a headline, one rarely wants to move only the headline up and
down. E.g., turning...

* TODO Headline
  :LOGBOOK:
  CLOCK: [2014-06-23 Mon 09:34]--[2014-06-23 Mon 09:35] =>  0:01
  :END:

...into...

  :LOGBOOK:
* TODO Headline
  CLOCK: [2014-06-23 Mon 09:34]--[2014-06-23 Mon 09:35] =>  0:01
  :END:

...does not make much sense. Below is a patch to fix it.

Best,
Matt

>From faf34bdedcae517e68c50ae9a77ee8086588dfe3 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Mon, 23 Jun 2014 09:17:54 -0500
Subject: [PATCH] Fix speedkeys to move subtrees up and down

* lisp/org.el: (org-speed-commands-default) Org speed keys were not
  updated to reflect the recent changes to org-shiftmetaup and
  org-shiftmetadown. As a result the default bindings for speedkeys
  "U" and "D" were destructive, since they moved only single
  lines. Binding them to org-metaup and org-metadown fixes the
  problem.

Thanks to Marco Wahl for reporting the problem:
http://permalink.gmane.org/gmane.emacs.orgmode/87873
---
 lisp/org.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index c82fd06..2b57fc0 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19523,8 +19523,8 @@ boundaries."
 ("s" . org-narrow-to-subtree)
 ("=" . org-columns)
 ("Outline Structure Editing")
-("U" . org-shiftmetaup)
-("D" . org-shiftmetadown)
+("U" . org-metaup)
+("D" . org-metadown)
 ("r" . org-metaright)
 ("l" . org-metaleft)
 ("R" . org-shiftmetaright)
-- 
2.0.0



Re: [O] org-ref in action

2014-06-24 Thread Matt Lundin
John Kitchin  writes:

> org-ref has basically stabilized. You can get the latest code at
> https://github.com/jkitchin/jmax/blob/master/org-ref.org.
>
> I made a little screen capture video here to show you what it does:
> https://www.youtube.com/watch?v=JyvpSVl4_dg
>
> Try it out, if it looks interesting, and let me know if you find any
> bugs!

This looks interesting. Thanks for the work you put into it! I look
forward to trying it out.

Matt



Re: [O] still seeing semi-regular lockups

2014-06-24 Thread Matt Lundin
Eric Abrahamsen  writes:

> Nicolas Goaziou  writes:
>
>> Hello,
>>
>> Eric Abrahamsen  writes:
>>
>>> None of those three, I'm afraid! It was hanging on a variety of editing
>>> operations that, as far as I can tell, had little in common. There's a
>>> possibility that they were list-item-related, but really there wasn't
>>> much commonality.
>>
>> FYI, I recently fixed a bug[fn:1] that could introduce uncommon random
>> lockups. Hopefully, it may be related to your problem (which is
>> different from Daimrod's).
>
> Thanks for the followup! I was watching Daimrod's thread, and also
> Matt's most recent posting -- that also seemed more relevant to my
> problems, which were almost solely confined to log/state notes. I've
> pulled the fix, and will let you know if I see any more problems.

With the latest git, I've experienced three lock-ups/freezes this
evening when a) archiving a subtree to a file, b) changing a todo state
with repeating timestamp, and 3) calling C-c C-c in an org-capture
buffer. (I don't think this is due to a recent change - I've been
running into these lockups sporadically for several months.)

The freezes are very difficult to replicate reliably. When they happen,
emacs is unresponsive and can only be killed from the outside. Any tips
on how to debug this would be greatly appreciated.

Matt



Re: [O] still seeing semi-regular lockups

2014-06-24 Thread Matt Lundin
Matt Lundin  writes:

> Eric Abrahamsen  writes:
>
>> Nicolas Goaziou  writes:
>>
>>> Hello,
>>>
>>> Eric Abrahamsen  writes:
>>>
>>>> None of those three, I'm afraid! It was hanging on a variety of editing
>>>> operations that, as far as I can tell, had little in common. There's a
>>>> possibility that they were list-item-related, but really there wasn't
>>>> much commonality.
>>>
>>> FYI, I recently fixed a bug[fn:1] that could introduce uncommon random
>>> lockups. Hopefully, it may be related to your problem (which is
>>> different from Daimrod's).
>>
>> Thanks for the followup! I was watching Daimrod's thread, and also
>> Matt's most recent posting -- that also seemed more relevant to my
>> problems, which were almost solely confined to log/state notes. I've
>> pulled the fix, and will let you know if I see any more problems.
>
> With the latest git, I've experienced three lock-ups/freezes this
> evening when a) archiving a subtree to a file, b) changing a todo state
> with repeating timestamp, and 3) calling C-c C-c in an org-capture
> buffer. (I don't think this is due to a recent change - I've been
> running into these lockups sporadically for several months.)
>
> The freezes are very difficult to replicate reliably. When they happen,
> emacs is unresponsive and can only be killed from the outside. Any tips
> on how to debug this would be greatly appreciated.

FWIW, Emacs just locked up again when I attempted to refile a subtree
from one org file to another (using org-refile).

GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2014-06-11 
on var-lib-archbuild-staging-x86_64-jgc
Org-mode version beta_8.3 (beta_8.3-26-g1c3bdb @/home/user123/org-mode/lisp/)

Matt



Re: [O] still seeing semi-regular lockups

2014-06-25 Thread Matt Lundin
Daimrod  writes:

> Matt Lundin  writes:
>
>>
>> The freezes are very difficult to replicate reliably. When they happen,
>> emacs is unresponsive and can only be killed from the outside. Any tips
>> on how to debug this would be greatly appreciated.
>
> See my previous post:
> http://thread.gmane.org/gmane.emacs.orgmode/86255/focus=86263
>
> You can wrap `jit-lock--debug-fontify' with:
>
> (advice-add 'jit-lock--debug-fontify :around
> (lambda (fun &rest args)
>   (with-local-quit (apply fun args
>
> and then force emacs to break and display a backtrace by sending the
> SIGUSR2 to the emacs process.
>

Thanks, that's helpful. It seems jit-lock--debug-fontify is the
development emacs. I'll build that in a moment...

For the record, I've been seeing these lockups with stable releases of
emacs (currently 24.3).

Thanks,
Matt



Re: [O] org-ref in action

2014-06-25 Thread Matt Lundin
Eric Schulte  writes:

>
> This is a lot of useful functionality, and very nicely presented.
>
> Did you happen to try the built in bibtex support in Org-mode core and
> contrib?  And if so, is there a reason that you implemented this all
> independently?
>
> I think part of the problem with existing Org-mode bibtex support is
> that no-one knows it exists.

Well, you can count on one big fan of org-bibtex.el here! (Though I must
admit that I have not used ox-bibtex.el.)

> To help address this I threw up a very quick-and-dirty screen cast
> demonstrating some of Org's existing bibtex functionality.
>
> https://vimeo.com/99167082

Thanks! Over the years, I've particularly appreciated the way
org-bibtex.el makes it easy to keep bib data together with notes/todos.
Both org-bibtex-read and org-bibtex-yank have become indispensable to my
own workflow.

Best,
Matt



Re: [O] still seeing semi-regular lockups

2014-06-25 Thread Matt Lundin
Daimrod  writes:

> Matt Lundin  writes:
>>
>> With the latest git, I've experienced three lock-ups/freezes this
>> evening when a) archiving a subtree to a file, b) changing a todo state
>> with repeating timestamp, and 3) calling C-c C-c in an org-capture
>> buffer. (I don't think this is due to a recent change - I've been
>> running into these lockups sporadically for several months.)
>>
>> The freezes are very difficult to replicate reliably. When they happen,
>> emacs is unresponsive and can only be killed from the outside. Any tips
>> on how to debug this would be greatly appreciated.
>
> See my previous post:
> http://thread.gmane.org/gmane.emacs.orgmode/86255/focus=86263
>
> You can wrap `jit-lock--debug-fontify' with:
>
> (advice-add 'jit-lock--debug-fontify :around
> (lambda (fun &rest args)
>   (with-local-quit (apply fun args
>
> and then force emacs to break and display a backtrace by sending the
> SIGUSR2 to the emacs process.

O.K., I built the most emacs development from bzr and used the advice
above.

With "killall -USR2 emacs", the following backtrace popped up, which
highlights flyspell as the culrpit. Note: I have flyspell turned on in
all text buffers, but I have (for several months) only experienced
lockups when using org-mode. I spend more time in TeX buffers than in
org-mode, and I have never had a lockup with AUCTeX.

--8<---cut here---start->8---
* (setq quit-flag t)
  (condition-case nil (let ((inhibit-quit nil)) (let ((command
  this-command) deactivate-mark) (if (flyspell-check-pre-word-p)
  (save-excursion (quote (flyspell-debug-signal-pre-word-checked))
  (goto-char flyspell-pre-point) (flyspell-word))) (if
  (flyspell-check-word-p) (progn (quote
  (flyspell-debug-signal-word-checked)) (flyspell-word) (setq
  flyspell-pre-pre-buffer (current-buffer)) (setq flyspell-pre-pre-point
  (point))) (setq flyspell-pre-pre-buffer nil) (setq
  flyspell-pre-pre-point nil) (if (and (symbolp this-command) (get
  this-command (quote flyspell-delayed))) (progn (setq
  flyspell-word-cache-end -1) (setq flyspell-word-cache-result (quote
  _) (while (and (not (input-pending-p)) (consp flyspell-changes))
  (let ((start (car ...)) (stop (cdr ...))) (if
  (flyspell-check-changed-word-p start stop) (save-excursion (quote ...)
  (goto-char start) (flyspell-word))) (setq flyspell-changes (cdr
  flyspell-changes (setq flyspell-previous-command command))) (quit
  (setq quit-flag t) (eval (quote (ignore nil)
(progn (condition-case nil (let ((inhibit-quit nil)) (let ((command
this-command) deactivate-mark) (if (flyspell-check-pre-word-p)
(save-excursion (quote (flyspell-debug-signal-pre-word-checked))
(goto-char flyspell-pre-point) (flyspell-word))) (if
(flyspell-check-word-p) (progn (quote
(flyspell-debug-signal-word-checked)) (flyspell-word) (setq
flyspell-pre-pre-buffer (current-buffer)) (setq
flyspell-pre-pre-point (point))) (setq flyspell-pre-pre-buffer nil)
(setq flyspell-pre-pre-point nil) (if (and (symbolp this-command)
(get this-command ...)) (progn (setq flyspell-word-cache-end -1)
(setq flyspell-word-cache-result ... (while (and (not
(input-pending-p)) (consp flyspell-changes)) (let ((start ...) (stop
...)) (if (flyspell-check-changed-word-p start stop) (save-excursion
... ... ...)) (setq flyspell-changes (cdr flyspell-changes (setq
flyspell-previous-command command))) (quit (setq quit-flag t) (eval
(quote (ignore nil))
  (if flyspell-mode (progn (condition-case nil (let ((inhibit-quit
  nil)) (let ((command this-command) deactivate-mark) (if
  (flyspell-check-pre-word-p) (save-excursion (quote ...) (goto-char
  flyspell-pre-point) (flyspell-word))) (if (flyspell-check-word-p)
  (progn (quote ...) (flyspell-word) (setq flyspell-pre-pre-buffer
  ...) (setq flyspell-pre-pre-point ...)) (setq
  flyspell-pre-pre-buffer nil) (setq flyspell-pre-pre-point nil) (if
  (and ... ...) (progn ... ...))) (while (and (not ...) (consp
  flyspell-changes)) (let (... ...) (if ... ...) (setq
  flyspell-changes ...))) (setq flyspell-previous-command command)))
  (quit (setq quit-flag t) (eval (quote (ignore nil)))
flyspell-post-command-hook()
  recursive-edit()
--8<---cut here---end--->8---

Matt



Re: [O] still seeing semi-regular lockups

2014-06-25 Thread Matt Lundin
Matt Lundin  writes:

> With "killall -USR2 emacs", the following backtrace popped up, which
> highlights flyspell as the culrpit.
 ~~~
And, of course, I had flyspell turned off when writing this email. :)

Matt



Re: [O] org-ref in action

2014-06-26 Thread Matt Lundin
John Kitchin  writes:

> Some features could be merged, but there is an important difference in
> that org-ref uses bibtex as the backend database, and reftex for
> searching, and org-bibtex uses org-mode headings as the backend
> database, and tag/property searches (I think).  It is like the
> difference between org-contacts and bbdb. They both serve similar
> needs, but with different data sources, and different ways to think
> about it.

Yes, org-bibtex.el generally precludes the use of reftex to enter
citations. I get around this problem with a custom perl script, which
runs automatically in the background, extracts all org-bibtex data, and
deposits it in a central bib file.

> We might be able to figure out a way to specify a "backend" that would
> allow the independent features to work in both though.

I think the key in any possible feature merge is to remember citation
management is idiosyncratic. I.e., org-mode should offer helper
functions that enable individuals to customize their own workflows
rather than "systems" that dictate a particular workflow (e.g., a single
notes file) or presuppose a specific export backend. For instance,
org-mode citation tools should not assume that users will export via
bibtex/bibtex2html rather than, say, biber/biblatex or pandoc (which now
has a powerful, format-agnostic citation filter).[1]

Best,
Matt

Footnotes:

[1] http://johnmacfarlane.net/pandoc/demo/example19/Citations.html



Re: [O] org-ref in action

2014-06-26 Thread Matt Lundin
Matt Lundin  writes:

> John Kitchin  writes:
>
>> Some features could be merged, but there is an important difference in
>> that org-ref uses bibtex as the backend database, and reftex for
>> searching, and org-bibtex uses org-mode headings as the backend
>> database, and tag/property searches (I think).  It is like the
>> difference between org-contacts and bbdb. They both serve similar
>> needs, but with different data sources, and different ways to think
>> about it.
>
> Yes, org-bibtex.el generally precludes the use of reftex to enter citations.

s/enter/search/






Re: [O] org-ref in action

2014-06-26 Thread Matt Lundin
Grant Rettke  writes:

> On Thu, Jun 26, 2014 at 9:08 AM, Matt Lundin  wrote:
>> I think the key in any possible feature merge is to remember citation
>> management is idiosyncratic.
>
> Off topic:
>
> How do people choose today?
>
> Why choose bibtex over biblatex?

Thanks to inertia, bibtex still has a number of users in the sciences,
since it was originally designed for scientific citations. In the
humanities, however, bibtex is a non-starter, since biblatex offers much
more flexibility. The good news is that bibtex and biblatex use the same
database format, so it's easy to transition from bibtex to biblatex.
However, there are other options, such as CSL.[1]

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

I'm not sure I understand your question. Could you clarify?

I simply meant that everyone will have a different workflow/system for
storing and managing citations. E.g., some will prefer to store
bibliographical data in a zotero database, others in a single bib file,
others in multiple bib files, others as properties in org headlines,
etc.

I think one can make a conception distinction here between citation
management (i.e., how one stores bibliographical data) and citation
processing (i.e., the software one uses to export that data to some
output format). There are many, many formats (mods, bib, etc.) and tools
(biber, bibtex, csl/citeproc, etc.) for formatting bibliographical data.

In an ideal world, one should be able to 1) process bibliographical data
from multiple formats; 2) choose from hundreds of citation styles; and
3) format citations for multiple backends. I am not suggesting that
org-mode should directly support all these things, but its default
methods of handling citations should not get in the way of using
external tools that provide such flexibility.

For instance, pandoc (an immensely impressive piece of software!)
accepts bibliographical data from numerous sources and processes it for
multiple outputs (html, plain text, docx, rtf, etc.). By contrast,
ox-bibtex.el runs citations through bibtex2html, which is pretty much
limited to the "old-fashioned" bibtex formats. Ironically, ox-bibtex.el
invokes pandoc to convert from html to plain text, but only after it has
already used bibtex2html to process the data.

Best,
Matt

Footnotes:

[1] Citation Style Language - http://citationstyles.org/



Re: [O] org-ref in action

2014-06-26 Thread Matt Lundin
Alan Schmitt  writes:

> On 2014-06-26 16:39, Matt Lundin  writes:
>
>> By contrast, ox-bibtex.el runs citations through bibtex2html, which is
>> pretty much limited to the "old-fashioned" bibtex formats.
>
> What would be required for bibtex2html to take biblatex input? I thought
> the backend format was similar or the same (as you can tell, I know
> nothing of biblatex).

I don't think this is possible without some major
hacking/conversion/filtering. Biblatex has many more entry types and
fields than bibtex. I've found that most of the older bibtex utils
(bibtools, bibtex2html) choke on my biblatex files.

Even if biblatex2html did read biblatex data, its output, I believe, is
limited to bibtex styles, which cannot handle more complex formats. Many
scientific journals require bibtex formats. But many humanities
disciplines have more complicated bibliographical requirements that
bibtex cannot handle.   

Best,
Matt



Re: [O] refile affects kill ring

2014-06-26 Thread Matt Lundin
Samuel Wales  writes:

> in recent maint, it seems that refiling an entry will put that entry
> into the kill ring.  perhaps it should leave the kill ring intact?

I think this has been the behavior for a very long time. E.g., I went
back to a version of org-refile from 2010 and it invokes
org-copy-subtree and org-paste-subtree.

Best,
Matt



Re: [O] [FeatReq] New option for `org-entry-properties' WHICH argument?

2014-06-26 Thread Matt Lundin
Thorsten Jolitz  writes:

> Hi List, 
>
> what about adding one more option for WHICH
>
> ,[ C-h f org-entry-properties RET ]
> | org-entry-properties is a compiled Lisp function in `org.el'.
> | 
> | (org-entry-properties &optional POM WHICH SPECIFIC)
> | [...]
> | If WHICH is nil or `all', get all properties.  If WHICH is
> | `special' or `standard', only get that subclass.  If WHICH
> | is a string only get exactly this property.  SPECIFIC can be a string, the
> | specific property we are interested in.  Specifying it can speed
> | things up because then unnecessary parsing is avoided.
> `
>
> that would filter out all Org related properties, i.e. the properties
> the system itself uses, and thus return only the application related
> properties?
>
> E.g. option 'non-org'
[..]
>
> What do you think?

+1

It would help in extracting user data when such data is interspersed
with org properties (e.g., LAST_REPEAT).

Matt



Re: [O] org-ref in action

2014-06-27 Thread Matt Lundin
Alan Schmitt  writes:

> On 2014-06-26 20:44, Matt Lundin  writes:
>>
>> I don't think this is possible without some major
>> hacking/conversion/filtering. Biblatex has many more entry types and
>> fields than bibtex. I've found that most of the older bibtex utils
>> (bibtools, bibtex2html) choke on my biblatex files.
>
> Is there a list of these new entry types? 

It depends on the style. I use the biblatex-chicago style. I grepped the
sample bib file supplied with the package to get a list of entry
types[fn:1] and fields.[fn:2] And this represents only a subset of the
possible fields! See also the variable bibtex-biblatex-entry-alist in
bibtex.el (shipped with emacs).

> Looking at the code for bibtex2html (for instance
> https://github.com/backtracking/bibtex2html/blob/master/bibtex.mli) I
> see that entry types are strings, so if there are issues, I guess they
> would happen in the generation part but not in the parsing part.

You are right. I see that one can specify a style file for parsing bib
files and biblatex does supply a biblatex.bst, e.g.,

  bibtex2html -s biblatex

However, this still produces errors (and a blank html file) when I run
it on a larger bib file that pdflatex/biber parses fine. I was able to
get it to run without errors on a small carefully culled subset (a book
and an article).

>> Even if biblatex2html did read biblatex data, its output, I believe,
>> is limited to bibtex styles, which cannot handle more complex
>> formats.

> I'm very ignorant here: from my understanding, bibtex2html does not
> care about bibtex style, it just takes bibtex data as input and
> produces html. 

> Is the problem that some entries are ignored, 

Yes, as well as many fields.

> or is there something deeper that I'm missing?

For my particular use-case, the problem is that it formats the
bibliographical data incorrectly. This is because biblatex relies on
LaTeX macros (rather than bibtex) to format the bibliography. Thus, any
utility that relies on bibtex to format bibliographies not work with
biblatex styles.

This, by the way, is why biblatex was is such a boon for those of use
working in the humanities: bibtex was *never* sufficient for humanities
citations. 

E.g., the biblatex-chicago style outputs a bibliographical item for a
book like this (with org markup added to show emphasis):

Wolloch, Isser. /The New Regime: Transformations of the French Civic
Order, 1789--1820s/. New York and London: W. W. Norton, 1994.

bibtex2html produces this:

Isser Wolloch. /The New Regime./ W. W. Norton, 1994.

Best, 
Matt (who also would also be happy to take this off list)

Footnotes:

[fn:1] Article, Artwork, Audio, Book, Booklet, Collection, CustomC, Image,
InBook, InCollection, inproceedings, InReference, Letter, Manual,
MastersThesis, Misc, Music, MVCollection, Online, Patent, Periodical,
PhdThesis, Reference, Review, SuppBook, TechReport, Unpublished, Video

[fn:2] addendum, address, afterword, annote, author, authortype,
bookauthor, booksubtitle, booktitle, booktitleaddon, chapter, crossref,
date, doi, edition, editor, editora, editoratype, editortype,
entrysubtype, eventdate, howpublished, institution, isbn, issue,
issuetitle, journaltitle, keywords, language, lista, location,
longcrossref, mainsubtitle, maintitle, month, namea, nameaddon, nameb,
namec, note, number, options, organization, origdate, origlanguage,
origlocation, origpublisher, pages, part, publisher, pubstate, school,
series, shortauthor, shorthand, shorttitle, sortkey, sorttitle,
subtitle, title, titleaddon, translator, type, url, urldate, useauthor,
usecompiler, useeditor, usera, userc, userd, usere, userf, volume,
volumes, xref, year



Re: [O] org-ref in action

2014-06-27 Thread Matt Lundin
Matt Lundin  writes:

> Alan Schmitt  writes:
>
> You are right. I see that one can specify a style file for parsing bib
> files and biblatex does supply a biblatex.bst, e.g.,
>
>   bibtex2html -s biblatex
>
> However, this still produces errors (and a blank html file) when I run
> it on a larger bib file that pdflatex/biber parses fine. I was able to
> get it to run without errors on a small carefully culled subset (a book
> and an article).

For the record, after correcting an error in several of my bib entries,
bibtex2html -s biblatex is able to parse a biblatex database without
error. However, the resulting html is empty.

Thanks,
Matt



Re: [O] still seeing semi-regular lockups

2014-07-18 Thread Matt Lundin
York Zhao  writes:

>> On Mon, Jun 30, 2014 at 8:43 PM, York Zhao 
> wrote:
>
>> I got the problem today, with org-mode version "815c218" in Emacs
> 24.3.1. The
>> error message is: if: Lisp nesting exceeds `max-lisp-eval-depth'.
> Attached is
>> the backtrace saved in a file. Hope this will help.
>
> Just an update. I haven't been bitten by this deadly problem for
> awhile, highly
> likely that it had been fixed. Thanks a lot.

FWIW, I'm still getting regular lockups with the cache. I'll dig into it
further when I have time.

Matt



Re: [O] Infinite loop with org-log-done 'time?

2014-07-18 Thread Matt Lundin
Ethan  writes:

> I'm running org-mode from git (version "8.3beta"), and recently I
> started to get hangs in org files. I can't characterize them
> completely; I have a clear memory of causing something when I hit Enter
> to create a newline before a heading. Today I managed to reproduce it
> reliably when I changed a particular heading from DONE to TODO. When I
> trigger the hang, emacs's CPU spikes to 100% and C-g doesn't stop emacs
> (it flashes to signal that it got a quit, but doesn't actually quit).
> I've had to kill emacs, sometimes with -9, and restart.
>
> The bug has been tricky to track down. I can reproduce it reliably in
> one particular file by switching DONE to TODO on one particular
> heading. Changing DONE to TODO on another nearby heading doesn't seem
> to cause the problem. For this reason, I don't have a minimal example.
>
> It doesn't happen in org-mode in stock emacs. It also doesn't happen,
> even with org-mode from git, if I disable my '(org-log-done 'time)
> customization. I managed to get a backtrace using gdb (attached). I can
> provide (off-list) the .org file that I used to induce the failure.
>
> I haven't seen anyone else comment about this issue so I assume it's
> something specific to my configuration. Has anyone else seen anything
> like this

I experience this. In my case, it seems to involve some mysterious
combination of the element cache, clocking, and logging. The lockups are
disruptive enough that I have to set org-element-use-cache to nil ---
otherwise I experience 2 to 3 lockups per hour. The problem completely
disappears with the cache off.

Alas, the baroque complexity of my .emacs and the size of my org files
make it difficult to discover the precise cause.

I'll see if I can provide an ECM.

Matt








[O] Possible to use src block to generate org headlines for export?

2014-07-22 Thread Matt Lundin
I am attempting to use a babel code snippet to generate org headlines
for export. However, I seem to be running into a corner case here.

AFAICT, the only way to generate headlines safely with babel is to wrap
them in a :RESULTS: drawer.

Take the following example:

--8<---cut here---start->8---
#+BEGIN_SRC perl :export results :results output org drawer
  print "* Headline One\n";
  print "* Headline Two\n";
  print "* Headline Three\n";
#+END_SRC
--8<---cut here---end--->8---

If I hit the source block, it creates wraps the output in a drawer. This
protects the results, so when executing the source block again, babel
correctly detects the drawer and replaces the output rather than
multiplying it indefinitely, as it does with "raw".

--8<---cut here---start->8---
#+RESULTS:
:RESULTS:
* Headline One
* Headline Two
* Headline Three
:END:
--8<---cut here---end--->8---

The problem with the results drawer is that org-element (and thus ox.el)
does not recognize it as a drawer and thus includes :RESULTS: in the
export. The html output looks like this:

--8<---cut here---start->8---

:RESULTS:


1 Headline One


2 Headline Two


3 Headline Three




--8<---cut here---end--->8---

In short, is there a more graceful and export-friendly way to use babel
to generate org headlines for export? Or is there an easy way to get the
export backend to delete the opening part of the drawer (i.e.,
:RESULTS:)?

Any advice would be greatly appreciated. 

Thanks,
Matt



Re: [O] Possible to use src block to generate org headlines for export?

2014-07-22 Thread Matt Lundin
Nick Dokos  writes:
>>
>> In short, is there a more graceful and export-friendly way to use babel
>> to generate org headlines for export? Or is there an easy way to get the
>> export backend to delete the opening part of the drawer (i.e.,
>> :RESULTS:)?
>>
>> Any advice would be greatly appreciated. 
>>
>
> No solace for your pain alas.  See
> http://thread.gmane.org/gmane.emacs.orgmode/88557
>
> My suggestion (as it was for Ronald, except that he had already rejected
> it :-) ) would be to use raw: you lose the idempotency of results
> production, but I don't know of any other problems.

Thanks for the link. My ignorance of it shows how far behind I am on
orgmode ML reading!

I agree with Nicolas's argument that only headlines can contain
headlines.

That said, having the ability to generate org copy for export also seems
useful.

I wonder whether org-babel might take advantage of COMMENT headlines for
org output: E.g.

* COMMENT Here beginneth the results for code block named "do-some-magic"
* COMMENT Here endeth the results for code block named "do-some-magic"

Obviously, this could wreak havoc on ones outline structure, so some
extra magic would be needed to set the correct headline level.

However, since the headlines I'm generating are always at the end of the
file, I've hacked my way to a solution with the following:

--8<---cut here---start->8---
#+BEGIN_SRC emacs-lisp :exports none :results none
  (save-excursion
(goto-char (point-min))
(while (re-search-forward "#\\+RESULTS: generate-blog-summary" nil t)
  (beginning-of-line)
  (delete-region (point) (point-max
#+END_SRC

#+NAME: generate-blog-summary
#+BEGIN_SRC perl :exports results :results output org raw
  print "* Headline One\n";
  print "* Headline Two\n";
  print "* Headline Three\n";
#+END_SRC
--8<---cut here---end--->8---

Thus, each time I export, the emacs-lisp snippet nicely deletes the old
results, making space for the new ones. 

Let's hope the real blog (when I get around to publishing it) is more
interesting than the example above. ;)

Best,
Matt



Re: [O] Possible to use src block to generate org headlines for export?

2014-07-22 Thread Matt Lundin
Correction below...

Matt Lundin  writes:
>
> #+BEGIN_SRC emacs-lisp :exports none :results none
>   (save-excursion
> (goto-char (point-min))
> (while (re-search-forward "#\\+RESULTS: generate-blog-summary" nil t)
  (when ...
>   (beginning-of-line)
>   (delete-region (point) (point-max
> #+END_SRC
 



Re: [O] Possible to use src block to generate org headlines for export?

2014-07-23 Thread Matt Lundin
Hi Brett,

Brett Viren  writes:

> Matt Lundin  writes:
>
>> Let's hope the real blog (when I get around to publishing it) is more
>> interesting than the example above. ;)
>
> Maybe it would be more convenient to add the "meta-ness" you want as
> part of a new exporter process?  

To change the "meta" wrappers for code block results, we would have to
modify org babel (ob-core.el). Right now, the only wrapper that org
babel uses to contain the results of *raw* org output is a :RESULTS:
drawer. However, headlines wrapped in a drawer is something that
org-element, by definition, cannot recognize. For the same reason, no
custom export backend is going to be able to recognize this element.

But I've discovered to my delight all this is moot.

The *best and simplest solution* for automatically generating org
headlines for export is...

...never to execute the source block by hand in org source file. That
way, the results will appear only in the *temporary* copy of the buffer
is parsed for export and one does need to worry about demarcating the
output with a :RESULTS: drawer...

--8<---cut here---start->8---
#+BEGIN_SRC perl :exports results :results output org raw
[code to generate org source]
#+END_SRC
--8<---cut here---end--->8---

The above works perfectly so long I as resist the temptation to hit C-c
C-c.[fn:1]

And that can be solved easily by adding the following line to the top of
the file:

--8<---cut here---start->8---
# -*- org-babel-no-eval-on-ctrl-c-ctrl-c: t; -*-
--8<---cut here---end--->8---

Isn't emacs wonderful?

In short, it is much easier than I assumed to use babel blocks (and any
language one wants) to generate org headlines destined for publishing.

This is amazing! The applications are endless. E.g., I will use this to
generate a blog summary when publishing my website. I'll post a tutorial
sometime soon. Suffice it to say, one can easily use babel blocks to
generate content on a web page, thus implementing the functionality of a
static site generator like Jekyll, docpad, octopress, etc. (but with
infinitely more flexibility).

Best,
Matt

Footnotes:

[fn:1] If one really needs to see the headlines in the original org
buffer, a hook can be used to remove the :RESULTS: drawer.

--8<---cut here---start->8---
(defun my-remove-stray-results-drawer (backend)
  (when (eq backend 'html)
(while (re-search-forward "^\\s-*:RESULTS:\\s-*\n" nil t)
  (replace-match ""

(add-hook 'org-export-before-parsing-hook 'my-remove-results-drawer)
--8<---cut here---end--->8---



Re: [O] Possible to use src block to generate org headlines for export?

2014-07-23 Thread Matt Lundin
Charles Berry  writes:

> Matt Lundin  imapmail.org> writes:
>
> Or wrap the results in a drawer when you type C-c C-c, but render them as 
> raw on export (which removes the drawer and replaces with raw results).
>
> Like so:
>
> #+header: :results (if (boundp 'backend) "raw" "drawer") 
> #+BEGIN_SRC emacs-lisp :exports both 
>
> (format "* headline\n1\n2\n5\n")
> #+END_SRC

Thanks so much! I'm clipping this for reference. This is very helpful
when one wants to preview the results in the buffer.

Best,
Matt



[O] [PATCH] Fix id generation in ox-rss.el

2014-07-23 Thread Matt Lundin
The attached patch fixes a bug in ox-rss.el that causes org-publish to
generate IDs in whatever org buffer emacs happens to be currently
visiting. I was puzzled why my org files were suddenly filled with
hundreds of ID entries. I discovered it happened when I called org
publish while visiting those files.

Thanks,
Matt

>From b482d2ebd53a60a91355433f49350b450869451e Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Wed, 23 Jul 2014 14:18:06 -0500
Subject: [PATCH] Fix ID generation in org-rss-publish-to-rss

* contrib/lisp/ox-rss.el: (org-rss-publish-to-rss) Fix a bug that
  causes ID properties to be generated in org buffer emacs is
  currently visiting rather than the file containing the feed. This
  bug can cause hundreds of ID entries to be added to an org file
  unrelated to the publishing project.
---
 contrib/lisp/ox-rss.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index c69a37b..5cae288 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -204,11 +204,10 @@ publishing directory.
 Return output file name."
   (let ((bf (get-file-buffer filename)))
 (if bf
-	(progn
-	  (org-icalendar-create-uid filename 'warn-user)
 	  (with-current-buffer bf
+	(org-icalendar-create-uid filename 'warn-user)
 	(org-rss-add-pubdate-property)
-	(write-file filename)))
+	(write-file filename))
   (find-file filename)
   (org-icalendar-create-uid filename 'warn-user)
   (org-rss-add-pubdate-property)
-- 
2.0.2



Re: [O] Possible to use src block to generate org headlines for export?

2014-07-23 Thread Matt Lundin
Brett Viren  writes:

> Matt Lundin  writes:
>
>> Brett Viren  writes:
>>>
>>> Maybe it would be more convenient to add the "meta-ness" you want as
>>> part of a new exporter process?  
>>
>> To change the "meta" wrappers for code block results, we would have to
>> modify org babel (ob-core.el). 
>
> Just to be clear (hopefully) I actually meant something different. I
> was suggesting to *not* use org babel to produce your extra headlines.
> Rather, have whatever logic produces them reside in some new exporter.
>
> I'm may be making incorrect guesses as to what you are actually going
> for with these extra headlines.  You mentioning this is for a blog made
> me think they are some kind of "standard augmentation" for every blog
> post or something.  If not then I'm probably barking up the wrong tree.
> But if so, putting them into an exporter seems apt.

I am using org-babel (+ perl) to gather a page containing the content of
the most recent posts. I also export this page to rss via ox-rss.el. I
could simply use a perl script to generate the file during the export
process, but a babel source block makes it convenient to modify the text
before and after the dynamic content and to test modifications to the
code.

To generate dynamic content for just one page, babel works fine.
However, if I wanted to update every page with such content, it would
make *much* more sense (as you suggest) to create an exporter.

> This is an approach I'm taking in a JSON+HTML exporter (analogous to
> the latex+pdf one) that I'm working on. For example, I'd like to have
> a "tag cloud" generated from tags on org headlines. This tag cloud
> won't explicitly exist on the org side. Rather it will be implicitly
> produced and updated by some (Python) code that runs as part of the
> JSON->HTML stage of the exporter.

That sounds interesting. I look forward to hearing more!

Thanks for the clarification!

Best,
Matt



[O] Exporting html: any way to customize format h1 class="title"?

2014-07-25 Thread Matt Lundin
I greatly appreciate the new export backends (thanks Nicolas!). The
filter functions are fantastic.

One thing that I'm having difficulty finding, however, is some way to
modify the content of the  and  headings in the
html.

The function org-html-template hard-codes the formatting of the title:

,[ox-html.el [lines 1864-1865]
|(let ((title (plist-get info :title)))
|  (format "%s\n" (org-export-data (or title "") 
info)))
`

AFAICT, there is no filter that would enable one to bypass the  tag
her or to give it different text than the  tag.

The reason I ask is because I would like to omit the h1 header on the
home page of my website or to give it different text than that given to
. Since my site will display a banner with my name at the top of
all pages, I would prefer to avoid the redundancy of "Name" or a
pedantic "Home" at the top the home page.[fn:1]

On other pages, it would also be nice to be able to give different text
to the  and  tags. For instance, many sites
append the site name to the page title in the  tag.

In the old export backends there were hooks that allowed some small
modifications on the html after exporting it However, the two hooks of
the new export backend hooks (org-export-before-processing-hook,
org-export-before-parsing-hook) are called on copies of the org source.

Are there any clever means that I've missed to modify the title tags?

Thanks,
Matt

Footnotes:

[fn:1] I know I can hide h1.title it with "display:none;" in the CSS,
but I'd prefer not to do so, since it seems that hiding a major element
can seem spammy to search engines. And now that I notice it, the
org-mode site uses "display: none" in its css file to hide h1.title on
all pages. Wouldn't it be easier to have an option in ox-html.el to omit
the tag from the exported file?



Re: [O] Exporting html: any way to customize format h1 class="title"?

2014-07-26 Thread Matt Lundin
Nicolas Goaziou  writes:

> Hello,
>
> Matt Lundin  writes:
>
>> AFAICT, there is no filter that would enable one to bypass the  tag
>> her or to give it different text than the  tag.
>
> [...]
>
>> In the old export backends there were hooks that allowed some small
>> modifications on the html after exporting it However, the two hooks of
>> the new export backend hooks (org-export-before-processing-hook,
>> org-export-before-parsing-hook) are called on copies of the org
>> source.
>
> See `org-export-filter-final-output-functions'.

Thanks, Nicolas! I suspected I was missing something. Sorry I overlooked
that in the documentation.

Again, many, many thanks again for the org-element and the new export
backends. They have made publishing with org-mode a delight.

Best,
Matt




[O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-28 Thread Matt Lundin
This patch fixes a bug in which org-publish makes the following call...

(let ((org-inhibit-startup t) (org-mode)))

...in buffers that are already open. This often happens, for instance,
when publishing a sitemap. But there is no need to call org-mode again
in these open buffers. Moreover calling org-mode with
org-inhibit-startup set to t destroys crucial information in open
buffers, such as dir-locals variables. This can interfere rather
seriously with web publishing, causing website files I am editing to
lose the following crucial settings after I call org-publish:

((org-mode .
   ((org-link-file-path-type . relative)
(org-display-custom-times . t

Thanks,
Matt

>From 05410ec611fdf8483053e2905df9a52ea9c53551 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Mon, 28 Jul 2014 23:56:42 -0500
Subject: [PATCH] Remove unnecessary invocations of org-mode

* lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date)
  Fix unnecessary invocations of org-mode with
  org-inhibit-startup.

The functions above call org-mode with org-inhibit-startup in org
buffers that are already open. The result is that these open buffers
lose some crucial local variables during publishing. For instance,
an open buffer will lose its dir-local-variables-alist setting
during publishing. There is no need to call org-mode here, because
org-mode is a) either already initialized in the buffer or b)
initialized via earlier call to find-file-no-select.

This looks to me like a relic of some past time when these functions were
called in temporary buffers that contained copies of the file's contents.
---
 lisp/ox-publish.el | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index be208df..94f12e9 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -806,11 +806,9 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
   "Find the title of FILE in project."
   (or
(and (not reset) (org-publish-cache-get-file-property file :title nil t))
-   (let* ((org-inhibit-startup t)
-	  (visiting (find-buffer-visiting file))
+   (let* ((visiting (find-buffer-visiting file))
 	  (buffer (or visiting (find-file-noselect file
  (with-current-buffer buffer
-   (org-mode)
(let ((title
 	  (let ((property (plist-get (org-export-get-environment) :title)))
 		(if property
@@ -831,7 +829,6 @@ time in `current-time' format."
 	   (file-buf (or visiting (find-file-noselect file nil)))
 	   (date (plist-get
 		  (with-current-buffer file-buf
-		(let ((org-inhibit-startup t)) (org-mode))
 		(org-export-get-environment))
 		  :date)))
   (unless visiting (kill-buffer file-buf))
-- 
2.0.2



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Bastien  writes:

> Hi Matt,
>
> Matt Lundin  writes:
>
>> This patch fixes a bug in which org-publish makes the following call...
>> (let ((org-inhibit-startup t) (org-mode)))
>
> Applied, thanks!

Oops... I see now that org-publish-find-date and org-publish-find-title
call org-export-get-environment. This in turn relies on org-set-local to
set #+BIND: variables, which requires the buffer to be writable. I have
an org-mode-hook that sets some of my web publishing files read-only (so
as to prevent accidental editing). Without org-inhibit-startup, these
buffers remain read-only, causing the following error message:

--8<---cut here---start->8---
org-export--get-global-options: Buffer is read-only: #
--8<---cut here---end--->8---

This could be solved by wrapping org-export-get-environment withing
those functions with (let ((buffer-read-only nil)) ...).

However, I think the fundamental problem is that
org-export-get-environment should be called on a copy of the buffer.
That, at least, is how it is used in org-export-as (see lines 3084 -
3107 of ox.el). When org-publish-find-title and org-publish-call-date
calls it in a buffer that is already open, it does so on the original
copy of the buffer. This has the effect of setting the #+BIND variables
within the live buffer, which could (theoretically) be dangerous, since,
AFAICT, they should only be set in a temporary copy of the buffer.

So to be safe, we could do the following in org-publish-find-date and
org-publish-find-title... 

(org-export-with-buffer-copy (org-export-get-environment))

What do you think?

Best,
Matt



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Matt Lundin  writes:

> Bastien  writes:
>
>> Hi Matt,
>>
>> Matt Lundin  writes:
>>
>>> This patch fixes a bug in which org-publish makes the following call...
>>> (let ((org-inhibit-startup t) (org-mode)))
>>
>> Applied, thanks!
>
> Oops... I see now that org-publish-find-date and org-publish-find-title
> call org-export-get-environment. This in turn relies on org-set-local to
> set #+BIND: variables, which requires the buffer to be writable. I have
> an org-mode-hook that sets some of my web publishing files read-only (so
> as to prevent accidental editing). Without org-inhibit-startup, these
> buffers remain read-only, causing the following error message:

[...continuing the previous post.]

I think I've found a more general problem here. When called in an org
buffer...

(let ((org-inhibit-startup t)) (org-mode))

...either wipes out dir-locals variables or prevents them from loading.
I have looked at the org-mode code and am not entirely sure why this
would be the case. 

However, this causes problems, for instance, when
org-agenda-inhibit-startup is t or when calling org-toggle-tags-groups.

And one more minor thing...

The documentation for org-agenda-inhibit-startup says that the default
is t. However, the default is nil.

,
| Inhibit startup when preparing agenda buffers.
| When this variable is `t' (the default), the initialization of
| the Org agenda buffers is inhibited: e.g. the visibility state
| is not set, the tables are not re-aligned, etc.
`

Thanks,
Matt





Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Matt Lundin  writes:

> Bastien  writes:
>
>> Hi Matt,
>>
>> Matt Lundin  writes:
>>
>>> This patch fixes a bug in which org-publish makes the following call...
>>> (let ((org-inhibit-startup t) (org-mode)))
>>
>> Applied, thanks!
>
> This could be solved by wrapping org-export-get-environment withing
> those functions with (let ((buffer-read-only nil)) ...).

Correction... this should be...

(let ((inhibit-read-only t)) ...)

Correction is for the record only, as this is moot given the rest of the
email.

Matt



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Bastien  writes:

> Hi Matt,
>
> Matt Lundin  writes:
>
>> So to be safe, we could do the following in org-publish-find-date and
>> org-publish-find-title... 
>>
>> (org-export-with-buffer-copy (org-export-get-environment))
>>
>> What do you think?
>
> Yes, this sounds right, please go ahead.
>
> I applied your fix in the maint branch, so if you need to revert it
> please do the revert from there first.

Here's the patch. There's no need to revert anything, as this builds
upon my previous commit.

>From 72217e53103a82e0397d1435331e3eed10f0fbd5 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 10:39:57 -0500
Subject: [PATCH 1/2] Call org-export-get-environment in buffer copy

* lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date)
  Make sure to call org-export-get-environment in copy of
  buffer. Otherwise, #+bind variables meant for export can be set in
  live buffers.
---
 lisp/ox-publish.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 94f12e9..26d4be7 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -810,7 +810,10 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
 	  (buffer (or visiting (find-file-noselect file
  (with-current-buffer buffer
(let ((title
-	  (let ((property (plist-get (org-export-get-environment) :title)))
+	  (let ((property
+		 (plist-get
+		  (org-export-with-buffer-copy (org-export-get-environment))
+		  :title)))
 		(if property
 		(org-no-properties (org-element-interpret-data property))
 		  (file-name-nondirectory (file-name-sans-extension file))
@@ -829,7 +832,7 @@ time in `current-time' format."
 	   (file-buf (or visiting (find-file-noselect file nil)))
 	   (date (plist-get
 		  (with-current-buffer file-buf
-		(org-export-get-environment))
+		(org-export-with-buffer-copy (org-export-get-environment)))
 		  :date)))
   (unless visiting (kill-buffer file-buf))
   ;; DATE is either a timestamp object or a secondary string.  If it
-- 
2.0.3



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Bastien  writes:

> Hi Matt,
>
> Matt Lundin  writes:
>
>> The documentation for org-agenda-inhibit-startup says that the default
>> is t. However, the default is nil.
>>
>> ,
>> | Inhibit startup when preparing agenda buffers.
>> | When this variable is `t' (the default), the initialization of
>> | the Org agenda buffers is inhibited: e.g. the visibility state
>> | is not set, the tables are not re-aligned, etc.
>> `
>
> Please go ahead for this too.

Gladly!

>From 5b2ef2c660d8163199f45d4dbf58d33f3ec1f918 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 10:59:19 -0500
Subject: [PATCH] Fix docstring of org-agenda-inhibit-startup

* lisp/org.el: org-agenda-inhibit-startup: fix docstring to reflect
  default value
---
 lisp/org.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 5c4b211..df13fff 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17961,9 +17961,9 @@ This requires Emacs >= 24.1, build with imagemagick support."
 
 (defcustom org-agenda-inhibit-startup nil
   "Inhibit startup when preparing agenda buffers.
-When this variable is `t' (the default), the initialization of
-the Org agenda buffers is inhibited: e.g. the visibility state
-is not set, the tables are not re-aligned, etc."
+When this variable is `t', the initialization of the Org agenda
+buffers is inhibited: e.g. the visibility state is not set, the
+tables are not re-aligned, etc."
   :type 'boolean
   :version "24.3"
   :group 'org-agenda)
-- 
2.0.3



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Matt Lundin  writes:

> Bastien  writes:
>
>> Matt Lundin  writes:
>>
>>> So to be safe, we could do the following in org-publish-find-date and
>>> org-publish-find-title... 
>>>
>>> (org-export-with-buffer-copy (org-export-get-environment))
>>>
>>> What do you think?
>>
>> Yes, this sounds right, please go ahead.
>>
>> I applied your fix in the maint branch, so if you need to revert it
>> please do the revert from there first.
>
> Here's the patch. There's no need to revert anything, as this builds
> upon my previous commit.
>
> From 72217e53103a82e0397d1435331e3eed10f0fbd5 Mon Sep 17 00:00:00 2001
> From: Matt Lundin 
> Date: Tue, 29 Jul 2014 10:39:57 -0500
> Subject: [PATCH 1/2] Call org-export-get-environment in buffer copy
>
> * lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date)
>   Make sure to call org-export-get-environment in copy of
>   buffer. Otherwise, #+bind variables meant for export can be set in
>   live buffers.

Please *do not apply* the previous patch. Instead, I've attached an
optimized version.

All in all this patch + commit 507244d56b055e7595ba94fe89d45c7ddb2559df
modestly improves the performance of org-publish-org-sitemap. On a
directory of 104 files, it used to take this long...

 org-publish-org-sitemap  1   10.508871433  10.508871433

...to generate a sitemap. With this patch and commit 507244d, it takes
this long...

 org-publish-org-sitemap  1   7.700290794   7.700290794

Clearly, this is still very inadequate, but it is an improvement. I
would love to use the built in site-map functions, but they are simply
to slow for any larger projects.

Could we do something like this to speed it up?

--8<---cut here---start->8---
(with-temp-buffer 
  (insert-file-contents file)
  (goto-char (point-min))
  (when (re-search-forward "^#\\+TITLE:" nil t)
(org-element-at-point)))
--8<---cut here---end--->8---

Until then, here's the patch.

>From 9260e6d4c5537994ffb6df2f2cc48c62ad4ffb63 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 13:35:41 -0500
Subject: [PATCH] Protect open buffers when publishing sitemap

* lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date)
  Make sure to call org-export-get-environment in copy of buffer if
  emacs is already visiting. Otherwise, #+bind variables meant for
  export can be set in live buffers.

This patch also optimizes the above functions by inhibiting
org-startup on buffers emacs visits temporarily.
---
 lisp/ox-publish.el | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 94f12e9..df40572 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -806,11 +806,18 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
   "Find the title of FILE in project."
   (or
(and (not reset) (org-publish-cache-get-file-property file :title nil t))
-   (let* ((visiting (find-buffer-visiting file))
+   (let* ((org-inhibit-startup t)
+	  (visiting (find-buffer-visiting file))
 	  (buffer (or visiting (find-file-noselect file
  (with-current-buffer buffer
(let ((title
-	  (let ((property (plist-get (org-export-get-environment) :title)))
+	  (let ((property
+		 (plist-get
+		  ;; protect local variables in open buffers
+		  (if visiting
+			  (org-export-with-buffer-copy (org-export-get-environment))
+			(org-export-get-environment))
+		  :title)))
 		(if property
 		(org-no-properties (org-element-interpret-data property))
 		  (file-name-nondirectory (file-name-sans-extension file))
@@ -825,11 +832,14 @@ If FILE is an Org file and provides a DATE keyword use it.  In
 any other case use the file system's modification time.  Return
 time in `current-time' format."
   (if (file-directory-p file) (nth 5 (file-attributes file))
-(let* ((visiting (find-buffer-visiting file))
+(let* ((org-inhibit-startup t)
+	   (visiting (find-buffer-visiting file))
 	   (file-buf (or visiting (find-file-noselect file nil)))
 	   (date (plist-get
 		  (with-current-buffer file-buf
-		(org-export-get-environment))
+		(if visiting
+			(org-export-with-buffer-copy (org-export-get-environment))
+		  (org-export-get-environment)))
 		  :date)))
   (unless visiting (kill-buffer file-buf))
   ;; DATE is either a timestamp object or a secondary string.  If it
-- 
2.0.3



[O] broken links in org-html publishing

2014-07-29 Thread Matt Lundin
Commit c9ca0b6df86de13a5302b5a3c955fb2fb1023d36 broke html links in my
publishing setup. 

The links on my website point to file.org rather than file.html. The
problem is a mismatch between line 145 and 2695.

The attached patch fixes the issue.

>From c23658146426d4780d7aa842f0bbd61e1356baf9 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 23:31:50 -0500
Subject: [PATCH] Fix broken links in html publishing

* lisp/ox-html.el: Fix incorrect property name in :options-alist of
  html backend definition.
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 1b00c38..af4232c 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -142,7 +142,7 @@
 (:html-infojs-options nil nil org-html-infojs-options)
 (:html-infojs-template nil nil org-html-infojs-template)
 (:html-inline-image-rules nil nil org-html-inline-image-rules)
-(:html-link-org-as-html nil nil org-html-link-org-files-as-html)
+(:html-link-org-files-as-html nil nil org-html-link-org-files-as-html)
 (:html-mathjax-options nil nil org-html-mathjax-options)
 (:html-mathjax-template nil nil org-html-mathjax-template)
 (:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format)
-- 
2.0.3



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-30 Thread Matt Lundin
Nicolas Goaziou  writes:

> Hello,
>
> Matt Lundin  writes:
>
>> Clearly, this is still very inadequate, but it is an improvement. I
>> would love to use the built in site-map functions, but they are simply
>> to slow for any larger projects.
>>
>> Could we do something like this to speed it up?
>>
>> (with-temp-buffer 
>>   (insert-file-contents file)
>>   (goto-char (point-min))
>>   (when (re-search-forward "^#\\+TITLE:" nil t)
>> (org-element-at-point)))
>
> No, you also need to parse #+SETUPFILE: keywords. You could also get
> false positive within a verbatim block:
>
>  #+begin_example
>  #+title: something
>  #+end_example

> However, it is possible to write a specialized function to extract
> only #+TITLE.
>
> Another option is to cache results. See `org-publish-cache-set' and
> `org-publish-cache-get'.

Thanks for the helpful information. I think the cache would be a nice
way to go, especially if it were combined a timestamp check. E.g., only
files that have been updated since the last publishing should be queried
for titles; otherwise, use the cached file.

I notice that org-publish-find-title does cache the title, but AFAICT
this is never used, since org-publish-format-file-entry calls
org-publish-find-title with the reset argument. Perhaps we could add a
variable to make this optional in org-publish-format-file-entry. E.g., 

--8<---cut here---start->8---
(defun org-publish-format-file-entry (fmt file project-plist)
  (format-spec
   fmt
   `((?t . ,(org-publish-find-title file org-publish-find-title-use-cache))
[...]
--8<---cut here---end--->8---

A similar option could be added to the date function date function.

Would it be O.K. if I went ahead and implemented this?
Thanks,
Matt





[O] [BUG] org-toggle-time-stamp-overlays does not work in #+DATE line

2014-07-30 Thread Matt Lundin
Steps to replicate.

1. Evaluate the following:

(setq org-time-stamp-custom-formats '("<%B %e, %Y>" . "<%B %e, %Y>"))

2. Use the following sample org file. 

--8<---cut here---start->8---
#+DATE: [2014-07-30 Wed 22:05]

* Headline
  [2014-07-30 Wed 22:05]
--8<---cut here---end--->8---

3. M-x org-toggle-time-stamp-overlays

The buffer should look like this:

--8<---cut here---start->8---
#+DATE: [2014-07-30 Wed]

* Headline
  [2014-07-30 Wed]
--8<---cut here---end--->8---

4. M-x org-toggle-time-stamp-overlays

The buffer now looks like this:

--8<---cut here---start->8---
#+DATE: [2014-07-30 Wed 22:05]

* Headline
  [2014-07-30 Wed 22:05]
--8<---cut here---end--->8---

...thus preventing any easy editing of the timestamp in the #+DATE
line.

Best,
Matt



[O] [BUG] org-html export does not put section numbers in div id

2014-07-30 Thread Matt Lundin
Take the following file:

--8<---cut here---start->8---
#+options: num:nil

* Headline
** Subheading
* Another headline
--8<---cut here---end--->8---

When exported to html, the section headings are not numbered, as
expected. 

However, the section numbers are missing from the outline container
divs, which look like this:



As a result, the table of contents links do not work.

Here are the relevant portions of the html:

--8<---cut here---start->8---

test

Table of Contents


Headline

Subheading


Another headline





Headline


Subheading



Another headline


--8<---cut here---end--->8---

Thanks,
Matt



[O] Manipulating Dates Automatically in a Headline

2014-08-11 Thread Matt Price
Hi Everyone,

I've asked this before, but that was a year or two ago and am hoping
someone has an idea now, perhaps involving babel or something.

every year at this time I rewrite a set of syllabi. I do a lot of
moving htings around while i'm oding it, and at the end I have to
enter a whole bunch of dates somewhat laboriously.  I have headlines
that look about like either like this:

-
* Outline
** Week 1: Topic Title (<2013-09-10>)
Longish Description
*** Reading
- Article 1
- Article 2
*** Lab
*** Notes
---

or like this:
--
* Outline
** Week 1: <2013-09-09>
*** Seminar: Technology and Society  (<2013-09-10>)
*** Reading
- Article 1
- Article 2
*** Plenary: Global Citizenship (<2013-09-13>)


I would like to replace the timestamps with code that dynamically
generates timestamps based on the value either in the last sibling
headline, or the parent headline.  It seems to me this ought to be
possible, but I'm not at all sure how to do it.  i would really
appreciate any guidance.  thanks!

Matt



[O] [PATCH] Fix and optimize publishing cache check

2014-08-12 Thread Matt Lundin
This patch does two things:

1. It prevents org-publish from perpetually republishing files
containing includes. Currently, if an included file changes, it is
published, as is the file that includes it. However, until changes are
made in the file that includes it (which may be never) its modification
time remain older than that of the included file, so it will be
republished every time org-publish is called, even if neither file has
changed. 

   - Note: This patch fixes this behavior by updating the modification
 time of the file that contains the includes. If this is deemed too
 destructive/meddlesome, we could consider alternate behaviors, such
 as setting the cached time with a simple float-time. Let me know
 what would be best.

2. It optimizes checking for included files. Currently,
org-publish-cache-file-needs-publishing visits every file in a project
to check for includes. On my underpowered box, this takes a long time
(over a minute) on a project with 1000+ files, thus defeating the
purpose of the cache. This patch causes org-publish to store information
about included files in the cache itself:

  a. If a file has changed it updates information about the files it
  includes and stores it in the cache.

  b. If a file has not changed, it checks the cache for included files
  and sees if any of those files have been updated (thus preventing the
  need to check every file in the project for includes)

Best,
Matt

>From 94a8061bb30e1992213fb8e71ee949d336d37435 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 12 Aug 2014 07:51:44 -0500
Subject: [PATCH] Fix and optimize publish cache check

* lisp/ox-publish.el: (org-publish-cache-file-needs-publishing) Fix
  org-publish-cache-file-needs-publishing to change timestamp of files
  containing includes. Speed up check for includes by storing
  information about included files in cache itself.

This patch ensures that org-publish-cache-file-needs-publishing does
not keep publishing a file containing includes by updating the
modification time of that file. It also speeds up publishing by
caching information about included files, thus keeping
org-publish-cache-file-needs-publishing from having to visit every
file just to check includes (which can take a long time on a project
containing hundreds or thousands of files).
---
 lisp/ox-publish.el | 60 +++---
 1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index df40572..228411f 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1168,32 +1168,42 @@ the file including them will be republished as well."
 	 (pstamp (org-publish-cache-get key))
 	 (org-inhibit-startup t)
 	 (visiting (find-buffer-visiting filename))
-	 included-files-ctime buf)
-(when (equal (file-name-extension filename) "org")
-  (setq buf (find-file (expand-file-name filename)))
+	 (ctime (org-publish-cache-ctime-of-src filename))
+	 (needsp (or (null pstamp) (< pstamp ctime)))
+	 includes buf)
+;; if the file needs publishing, refresh the included-files cache property
+(when (and needsp
+	   (equal (file-name-extension filename) "org"))
+  (setq buf (find-file-noselect (expand-file-name filename)))
   (with-current-buffer buf
-	(goto-char (point-min))
-	(while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
-	  (let* ((element (org-element-at-point))
-		 (included-file
-		  (and (eq (org-element-type element) 'keyword)
-		   (let ((value (org-element-property :value element)))
-			 (and value
-			  (string-match "^\\(\".+?\"\\|\\S-+\\)" value)
-			  (org-remove-double-quotes
-			   (match-string 1 value)))
-	(when included-file
-	  (add-to-list 'included-files-ctime
-			   (org-publish-cache-ctime-of-src
-			(expand-file-name included-file))
-			   t)
-  (unless visiting (kill-buffer buf)))
-(if (null pstamp) t
-  (let ((ctime (org-publish-cache-ctime-of-src filename)))
-	(or (< pstamp ctime)
-	(when included-files-ctime
-	  (not (null (delq nil (mapcar (lambda (ct) (< ctime ct))
-	   included-files-ctime))
+	(save-excursion
+	  (goto-char (point-min))
+	  (while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
+	(let* ((element (org-element-at-point))
+		   (included-file
+		(and (eq (org-element-type element) 'keyword)
+			 (let ((value (org-element-property :value element)))
+			   (and value
+(string-match "^\\(\".+?\"\\|\\S-+\\)" value)
+(org-remove-double-quotes
+ (match-string 1 value)))
+	  (when included-file (add-to-list 'includes (expand-file-name included-file)))
+  (unless visiting (kill-buffer buf))
+  (when includes (org-publish-cache-set-file-property filename :includes includes)))
+;; return t if needsp or if included files have changed
+  

Re: [O] [PATCH] Fix and optimize publishing cache check

2014-08-12 Thread Matt Lundin
Here is an improved version of the previous patch (please apply it
rather than the previous). This version further optimizes cache checking
by only calling find-buffer-visiting if necessary. (It also fixes some
long lines.) On a test project containing 5000 files, running
org-publish on the project with the cache enabled now takes seconds
rather than minutes.

Best,
Matt

>From ea7203b4d988967f0a70bd45ad7502a961a28aee Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 12 Aug 2014 23:25:23 -0500
Subject: [PATCH] Fix and optimize publish cache check

* lisp/ox-publish.el: (org-publish-cache-file-needs-publishing) Fix
  org-publish-cache-file-needs-publishing to change timestamp of files
  containing includes. Speed up check for includes by storing
  information about included files in cache itself.

This patch ensures that org-publish-cache-file-needs-publishing does
not keep publishing a file containing includes by updating the
modification time of that file. It also speeds up publishing by
caching information about included files, thus keeping
org-publish-cache-file-needs-publishing from having to visit every
file just to check includes (which can take a long time on a project
containing hundreds or thousands of files).
---
 lisp/ox-publish.el | 68 --
 1 file changed, 41 insertions(+), 27 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index df40572..e848a0c 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1167,33 +1167,47 @@ the file including them will be republished as well."
 	 (key (org-publish-timestamp-filename filename pub-dir pub-func))
 	 (pstamp (org-publish-cache-get key))
 	 (org-inhibit-startup t)
-	 (visiting (find-buffer-visiting filename))
-	 included-files-ctime buf)
-(when (equal (file-name-extension filename) "org")
-  (setq buf (find-file (expand-file-name filename)))
-  (with-current-buffer buf
-	(goto-char (point-min))
-	(while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
-	  (let* ((element (org-element-at-point))
-		 (included-file
-		  (and (eq (org-element-type element) 'keyword)
-		   (let ((value (org-element-property :value element)))
-			 (and value
-			  (string-match "^\\(\".+?\"\\|\\S-+\\)" value)
-			  (org-remove-double-quotes
-			   (match-string 1 value)))
-	(when included-file
-	  (add-to-list 'included-files-ctime
-			   (org-publish-cache-ctime-of-src
-			(expand-file-name included-file))
-			   t)
-  (unless visiting (kill-buffer buf)))
-(if (null pstamp) t
-  (let ((ctime (org-publish-cache-ctime-of-src filename)))
-	(or (< pstamp ctime)
-	(when included-files-ctime
-	  (not (null (delq nil (mapcar (lambda (ct) (< ctime ct))
-	   included-files-ctime))
+	 (ctime (org-publish-cache-ctime-of-src filename))
+	 (needsp (or (null pstamp) (< pstamp ctime)))
+	 includes)
+;; if the file needs publishing, refresh the included-files cache property
+(when (and needsp
+	   (equal (file-name-extension filename) "org"))
+  (let ((visiting (find-buffer-visiting filename))
+	(buf (find-file-noselect (expand-file-name filename
+	(with-current-buffer buf
+	  (save-excursion
+	(goto-char (point-min))
+	(while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
+	  (let* ((element (org-element-at-point))
+		 (included-file
+		  (and (eq (org-element-type element) 'keyword)
+			   (let ((value (org-element-property :value element)))
+			 (and value
+  (string-match "^\\(\".+?\"\\|\\S-+\\)" value)
+  (org-remove-double-quotes
+   (match-string 1 value)))
+		(when included-file
+		  (add-to-list 'includes (expand-file-name included-file)))
+	(unless visiting (kill-buffer buf))
+	(when includes
+	  (org-publish-cache-set-file-property filename :includes includes
+;; return t if needsp or if included files have changed
+(or needsp
+	(when (delq nil
+		(mapcar (lambda (file)
+			  (let ((ct (org-publish-cache-ctime-of-src file)))
+(and (file-exists-p file)
+ (< ctime ct
+			(org-publish-cache-get-file-property filename :includes)))
+	  ;; update the timestamp of the published file if buffer is not modified
+	  (let ((visiting (find-buffer-visiting filename))
+		(buf (find-file-noselect (expand-file-name filename
+	(with-current-buffer buf
+	  (when (not (buffer-modified-p))
+		(set-buffer-modified-p t) (save-buffer)))
+	(unless visiting (kill-buffer buf)))
+	  t
 
 (defun org-publish-cache-set-file-property
   (filename property value &optional project-name)
-- 
2.0.4



Matt Lundin  writes:

> This patch does two things:
>
> 1. It prevents org-publish from perpetually republishing files
> containing includes. Currently, if an included file changes, it is
> publi

Re: [O] Manipulating Dates Automatically in a Headline

2014-08-13 Thread Matt Price
It's been a couple of days so I'll try restate this question more
clearly.  I'm hoping it's possible to do something like this:

* Week one (<2014-09-09>)
* Week two (EVALUATE A LISP EXPRESSION THAT INSERTS A TIMESTAMP ONE
WEEK LATER THAN LAST TIMESTAMP FOUND IN BUFFER)

I don't have much experience with babel so I'm not sure how to do
this, but if it's possible I would love some hints.  Thanks as always,

Matt


On Mon, Aug 11, 2014 at 2:20 PM, Matt Price  wrote:
> Hi Everyone,
>
> I've asked this before, but that was a year or two ago and am hoping
> someone has an idea now, perhaps involving babel or something.
>
> every year at this time I rewrite a set of syllabi. I do a lot of
> moving htings around while i'm oding it, and at the end I have to
> enter a whole bunch of dates somewhat laboriously.  I have headlines
> that look about like either like this:
>
> -
> * Outline
> ** Week 1: Topic Title (<2013-09-10>)
> Longish Description
> *** Reading
> - Article 1
> - Article 2
> *** Lab
> *** Notes
> ---
>
> or like this:
> --
> * Outline
> ** Week 1: <2013-09-09>
> *** Seminar: Technology and Society  (<2013-09-10>)
> *** Reading
> - Article 1
> - Article 2
> *** Plenary: Global Citizenship (<2013-09-13>)
> 
>
> I would like to replace the timestamps with code that dynamically
> generates timestamps based on the value either in the last sibling
> headline, or the parent headline.  It seems to me this ought to be
> possible, but I'm not at all sure how to do it.  i would really
> appreciate any guidance.  thanks!
>
> Matt



[O] [BUG] BBDB anniversary links don't open in agenda

2014-09-11 Thread Matt Lundin
BBDB anniversary links don't open in the agenda.

At the moment, the function org-agenda-open-link seems to be set up only
to open links if they are actually in the original buffer. But bbdb
anniversary links are generated from the following sexp:

%%(org-bbdb-anniversaries)

When org-agenda-open-link jumps to the buffer to look for a link like
[[bbdb:John Doe]], it will not find it. This seems symptomatic of a
bigger problem in org-agenda-open-link, which is that (AFAICT) it will
*never* get to the second item in the conditional.

Here are the details:

1. This bit of code searches both the original buffer and the agenda
line for links (notice the prefix):

,[ org-agenda.el, lines 8516-8519
|(buffer (and marker (marker-buffer marker)))
|(prefix (buffer-substring (point-at-bol) (point-at-eol)))
|(lkall (and buffer (org-offer-links-in-entry
|buffer marker arg prefix)))
`

2. This will trigger the first conditional, since there will always be
both a buffer and a link. But this means that the function never arrives
at the second conditional, which opens links found in the agenda buffer
itself.

3. Instead, a bbdb link will be lost in the first conditional, which
assumes that that the link can actually be found in the buffer.

,[ 8530-8537
| (if (or (not trg) (string-match org-any-link-re trg))
| (save-excursion
|   (save-restriction
| (widen)
| (goto-char marker)
| (when (search-forward l nil lkend)
|   (goto-char (match-beginning 0))
|   (org-open-at-point
`

The bug was introduced with commit
bd779fad624af01dbcb35b381dee10452dc945b1 on Jan 13, 2013:

It would be easy enough to insert a check for bbdb links in the first
conditional clause. However, it seems to me that the logic of
org-agenda-open-link has become rather convoluted.

Is there a scenario in which one would ever reach the second conditional
clause, which opens links found only in the agenda buffer?

Any advice on the best way to proceed would be greatly appreciated.

Best,
Matt



[O] help tracking down bad setting?

2014-09-18 Thread Matt Price
Hi everyone,

When I load org-mode I get the following error:

local-set-key: Key sequence C-c SPC C-r starts with non-prefix key C-c SPC

I am pretty sure I set something to this value somewhere at some time,
but I have no idea what, where, or when.  I have grepped through

.emacs
.emacs.d/*

for local-set-key, "C-c SPC C-r" and "SPC" and I haven't found anything.

org still seems to run, but some process is interrupted, I think ,as
any function which calls (org-mode) will not run any code after that
call.

What do you think -- where should I look, and what should I search for?

Thanks a lot,

Matt



Re: [O] help tracking down bad setting?

2014-09-18 Thread Matt Price
On Thu, Sep 18, 2014 at 3:46 PM, Matt Price  wrote:
> Hi everyone,
>
> When I load org-mode I get the following error:
>
> local-set-key: Key sequence C-c SPC C-r starts with non-prefix key C-c SPC
>
> I am pretty sure I set something to this value somewhere at some time,
> but I have no idea what, where, or when.  I have grepped through
>
> .emacs
> .emacs.d/*
>
> for local-set-key, "C-c SPC C-r" and "SPC" and I haven't found anything.
>

OK, I found it here:

  (local-set-key "\C-c  \C-r" 'org-decrypt-entry)

Removing the space between \C-c and \C-r worked.  I guess I really
don't understand the syntax for setting keybindings in emacs -- every
time I do it it's trial and error!

Matt



Re: [O] help tracking down bad setting?

2014-09-18 Thread Matt Price
I meant to add: found the culprit by checking the value of org-mode-hook.
And also, thanks Thorsten!


[O] adding #+ATTR_XXX to list items?

2014-12-03 Thread Matt Price
I came across this bug for ox-reveal.el (which is not supported), but it
seems to originate in ox-html.el.  When I try something like this:

- show bullet-points
- show more bullet-points
#+ATTR_REVEAL: :frag roll-in
- one
- by
- one

the HTML that is generated gives:

ul class="org-ul">show bullet-pointsshow more
bullet-pointsonebyone


Looking more closely, it appears that org itself regards this as two
lists.  I think most users writing something like this would intend to
generate one single list, with an attribute applied to a single list item.
Is there a way to get that effect?  Should there be?

Thanks,

Matt

PS, there is a bug report against org-reveal at:

https://github.com/yjwen/org-reveal/issues/42


[O] exporting zotxt or orgref links to HTML and ODF

2015-01-26 Thread Matt Price
Hi eveyrone,

I've just looked back through my email archives and from what I can tell,
almost everyone who uses Org to write papers uses LaTex for the final
product.

I have never learned to use Latex, mostly because, as a humanist, almost
none of my colleagues can use LaTex files, and the same goes for journals I
interact with, which generally prefer Word submission(!).  Because of this,
I am still trying to figure out a way to use org-mode for scholarly
writing. At present, I write my first, very rough drafts in Org, then
export to ODT and add citations from Zotero (we don't really use Bibtex
either); after this step, I can't really go back to Org, which is of course
very frustrating.


I would prefer to write exclusively in Org, then export to ODT when I have
a high-quality draft that I want to share with colleagues; in some cases, I
would also like to export directly to HTML for posting on a blog or course
website. In fact, one use case that would really help me is a very simple
one: when writing course syllabi, I would really like to just get the full
references to course readings to show up in HTML exports.

My question: does anyone yet have a workflow that lets them export directly
to HTML or ODT?

I've just tried using zotxt again (
https://bitbucket.org/egh/zotxt-emacs/overview -- first time in a while);
it is remarkably easy to use in Org itself.  By default, though, the links
simply aren't handled in the HTML and ODT exports, and so the cites will be
completely absent.

Here is the text inserted by zotxt for a single citation:



[[zotero://select/items/0_TI27HJ5I][Suchman, Lucy. “Subject Objects.”
Feminist Theory 12, no. 2 (August 1, 2011): 119–45.
http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml.]]
---

In HTML, I would like to replace this with something like this:

(Suchman 2011)

and then have Org generate a bibligraphy somewhere, a bit like org-ref
seems to do, It would be nice if I could steal the styles from somehwere,
the way org-ref seems to do.

For ODT< it seems a little more complicated. Here is the rather lengthy
equivalent that Zotero itself produces for my default style (Chicago) in
Libreoffice:
---
1http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml.}","plainCitation":"Lucy
Suchman, “Subject Objects,” Feminist Theory 12, no. 2 (August 1, 2011):
119–45,
http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml.";
},"citationItems":[{"id":149,"uris":["
http://zotero.org/users/20/items/TI27HJ5I"],"uri":[";
http://zotero.org/users/20/items/TI27HJ5I"],"itemData":{"id":149,"type":"article-journal","title":"Subject
objects","container-title":"Feminist
Theory","page":"119-145","volume":"12","issue":"2","URL":"
http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml"
;,"ISSN":"14647001","author":[{"family":"Suchman","given":"Lucy"}],"issued":{"date-parts":[["2011",8,1]]}}}],"schema":"
https://github.com/citation-style-language/schema/raw/master/csl-citation.json"}
RNDuhNYYpC1hN"/>Lucy Suchman, “Subject
Objects,” Feminist
Theory 12, no. 2 (August 1,
2011): 119–45,
http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml.http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml.}","plainCitation":"Lucy
Suchman, “Subject Objects,” Feminist Theory 12, no. 2 (August 1, 2011):
119–45,
http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml.";
},"citationItems":[{"id":149,"uris":["
http://zotero.org/users/20/items/TI27HJ5I"],"uri":[";
http://zotero.org/users/20/items/TI27HJ5I"],"itemData":{"id":149,"type":"article-journal","title":"Subject
objects","container-title":"Feminist
Theory","page":"119-145","volume":"12","issue":"2","URL":"
http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml"
;,"ISSN":"14647001","author":[{"family":"Suchman","given":"Lucy"}],"issued":{"date-parts":[["2011",8,1]]}}}],"schema":"
https://github.com/citation-style-language/schema/raw/master/csl-citation.json"}
RNDuhNYYpC1hN"/>
--

I'm not sure what the best way to do this is; it may be that zotxt could be
extended to get zotero to do the heavy lifting here.

I know Erik H reads this list, so if you have any suggestions, Erik, I
would love to hear them.  But maybe other people also have suggestions
about modifying export filters - -that would also be really helpful for
me.  Thanks as always,

Matt


[O] HTML --> Org-mode?

2015-01-26 Thread Matt Price
Hmm,

Looks like I asked this about a year ago and didn't follow up on it.  Does
anyone know a way to generate org-mode syntax from an html string? I would
like to extend zotxt slightly (see my last post) and at present zotxt can
pull citations 7 bibliography entries from Zotero only in plain-text and
HTML form.  The plaintext form loses information, so I would like to
translate the HTML into org-mode syntax.

Since this would have to happen in the context of an

(org-add-link-type  )

invocation, it would be best if this could be done directly in emacs
somehow...

Thanks as always,

Matt


Re: [O] exporting zotxt or orgref links to HTML and ODF

2015-01-26 Thread Matt Price
Hi will,

I haven't gotten very far with this yet, but adding a couple of lines to
the definition of org-add-link-type in org-zotxt.el (around line 150,
https://bitbucket.org/egh/zotxt-emacs/src/74702e2b2f2aa0427f099eb4fe69dce8709f67fc/org-zotxt.el?at=master)
at least allows for unformatted, plain-text reproduction of citations:

--
(org-add-link-type "zotero"
   (lambda (rest)
 (zotxt-select-key (substring rest 15)))
   (lambda (path desc format)
 (if (and (eq format 'latex)
  (string-match "^@\\(.*\\)$" desc))
 (format "\\cite{%s}" (match-string 1 desc))
   nil)
 (if ( eq format 'html)
 (format "%s" desc)

   nil)))
---

A better option would be to somehow acquire the html that the Zotero
extension "zotxt" generates when zotxt.el requests the formatted citation
from it.  I'm not quite sure how to do this, but I htink the action happens
zotxt-choose-deferred, which starts on line 125 of zotxt.el (
https://bitbucket.org/egh/zotxt-emacs/src/74702e2b2f2aa0427f099eb4fe69dce8709f67fc/zotxt.el?at=master
):

-

(defun zotxt-choose-deferred (&optional method search-string)  "Prompt
a user for a search string, then ask the user to select an item from
the citation.If METHOD is supplied, it should be one of
:title-creator-year, :fields, or :everything.If SEARCH-STRING is
supplied, it should be the search string."  (if (null method)
(let ((method-name  (zotxt-completing-read
"Zotero search method (nothing for title, creator, year): "
  zotxt-quicksearch-method-names  nil t nil nil "title,
creator, year")))(setq method (cdr (assoc method-name
zotxt-quicksearch-method-names)  (if (null search-string)
(setq search-string(read-string (format "Zotero
quicksearch (%s) query: " (cdr (assq method
zotxt-quicksearch-method-to-names))  (lexical-let ((d
(deferred:new)))(request (format "%s/search" zotxt-url-base)
  :params `(("q" . ,search-string)   ("method" . ,(cdr
(assq method zotxt-quicksearch-method-params)))
("format" . "bibliography")) :parser 'json-read :success
(function*   (lambda (&key data &allow-other-keys)
(let* ((results (mapcar (lambda (e)
(cons (cdr (assq 'text e))
 (cdr (assq 'key e
data))(count (length results))
   (citation (if (= 0 count)
   nil(if (= 1 count)
  (car (car results))
(zotxt-completing-read "Select item: " results
   (key (cdr (assoc-string citation results
   (deferred:callback-post d (if (null
citation) nil `((:key ,key :citation
,citationd))

-

My lisp isn't good enough to read this function properly, but apparently the
:citation property of the result item plist is set to the 'text'
object of each item.
If one could  also add the 'html' object which the zotxt Zotero plugin returns
(the nomenclature is a little misleading, I know), then that
information could be made available to emacs/org
for use on export.  See line 307-309 of the zotxt extension, here:
 
https://bitbucket.org/egh/zotxt/src/a12d538ae9245b142fdb0b2d241e43b82221/extension/bootstrap.js?at=master

Not sure if this helps much?  It's the best I have so far!  Thanks,
Matt



On Mon, Jan 26, 2015 at 12:49 PM, Monroe, Will 
wrote:

>  Matt,
>
> I don't have much to contribute at this stage but as someone who uses org
> heavily for outlining and writing, zotero for citation management, and who
> is obliged to provide copies as Word documents (I'm an instructional
> designer at at law school), I appreciate the question.
>
> I also appreciate the point to zotxt!  Didn't know about that.
>
> I hope you get some good replies.
>
> Will
>
> -
> Will Monroe, Ph.D.
> Head of Instructional Technology
> Paul M. Hebert Law Center
> 225.578.7838
> will.mon...@law.lsu.edu
>
> On 1/26/15 10:29 AM, Matt Price wrote:
>
>   Hi eveyrone,
>
>  I've just looked back through my email archives and from what I can tell,
> almost everyone who uses Org to write papers uses LaTex for the final
> product.
>
>  I have never learned to use Latex, mostly because, as a humanist, almost
> none of my colleagues can use LaTex files, and the same goes for jou

Re: [O] HTML --> Org-mode?

2015-01-26 Thread Matt Price
I think the answer may be something like:

(shell-command-to-string (concat  "pandoc -f html -t org <<< '"  :html "'" )

Though I'm not quite sure how to go about it just yet.

On Mon, Jan 26, 2015 at 3:50 PM, Tory S. Anderson 
wrote:

> man pandoc will be your friend. It guided me to the following simple
> (interactive) use:
>
> pandoc -f html -t org
>  how are you? 
>  I am good 
> *how are you?* /I am good/
>
> I won't be able to help you much farther than that, though.
> - Tory
>
> Matt Price  writes:
>
> > That should be enough. I would need to feed a string form emacs to
> > pandoc, then capture the output as a new string that can be output in
> > the export filter. Do you know how to do that part?
> > Thanks,
> > Matt
> >
> > On Mon, Jan 26, 2015 at 3:31 PM, Tory S. Anderson
> >  wrote:
> >
> > Using the magic wizard program Pandoc, I just had success with a
> > simple little example:
> >
> > pandoc -o test.org test.html
> >
> > Input test.html:
> > 
> > 
> > TEST strong!
> > 
> > Cell 1
> > Cell 2
> > Cell 3
> > Cell 4
> > 
> > 
> > 
> >
> > Output test.org:
> > *TEST strong!*
> > Cell 1
> > Cell 2
> > Cell 3
> > Cell 4
> >
> > I'm not sure how sophisticated the strings you are dealing with,
> > but pandoc might do the trick for you.
> > - Tory
> >
> >
> >
> >
> > Matt Price  writes:
> >
> > > Hmm,
> > >
> > > Looks like I asked this about a year ago and didn't follow up on
> > it.
> > > Does anyone know a way to generate org-mode syntax from an html
> > > string? I would like to extend zotxt slightly (see my last post)
> > and
> > > at present zotxt can pull citations 7 bibliography entries from
> > Zotero
> > > only in plain-text and HTML form. The plaintext form loses
> > > information, so I would like to translate the HTML into org-mode
> > > syntax.
> > >
> > > Since this would have to happen in the context of an
> > >
> > > (org-add-link-type )
> > >
> > > invocation, it would be best if this could be done directly in
> > emacs
> > > somehow...
> > >
> > > Thanks as always,
> > >
> > > Matt
> >
>


<    5   6   7   8   9   10   11   12   13   14   >