Re: [Orgmode] structure editing in brainstorming mode

2009-01-01 Thread Carsten Dominik


On Jan 1, 2009, at 7:42 AM, Rustom Mody wrote:

On Wed, Dec 31, 2008 at 6:58 PM, Carsten Dominik > wrote:

I thought that transient-mark-mode was the only way to make use
of commands that automatically use the region if one is active.
But because of your mail, I went back to the Emacs manual and
learned about the Momentary Mark, which is
transient-transient-mark-mode, sort of.  Pretty nice, this is
a viable alternative to turning on transient-mark-mode, so viable
that I am now considering turning off transient-mark-mode :-)


Hey Neat! Thanks for that new year gift Carsten.


:-)

I think this should all already work, just leave transient-mark-mode
off, and then use `C-SPC C-SPC' instead of only a single `C-SPC' to
start a region.

- Carsten



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


Re: [Orgmode] Hook request and patch

2009-01-01 Thread Carsten Dominik


On Dec 31, 2008, at 7:54 PM, Tom Breton (Tehom) wrote:


Hi Tom,

is there a reason why you did not put the hook right after
the include file moment?

- Carsten


Yes, two.  But of course your judgement should take precedence.

In order to make my change slightly less severe, I put it just before
operations of a similar nature, and it seemed to me that the various  
"find

links" operations were most like it - but perhaps that reflects on the
particular purpose I was using it for.

And it seemed to me that putting it after the various "protect"  
operations

was better than putting it before them.



Hi Tom,

I had to change the name of the hook, "midprocess" does not do
it justice.  I'm not sure if you really want to do this after the
protection stuff, because it will limit the processing of your
include files.

I have now added a few more hooks at strategic locations in the
preprocessing code, please take your pick from the hooks I am listing
below.  If you do need the hook in the position where you put it,
let me know and I will add another one.

(defvar org-export-preprocess-hook nil
  "Hook for preprocessing an export buffer.
Pretty much the first thing when exporting is running this hook.")

(defvar org-export-preprocess-after-include-files-hook nil
  "Hook for preprocessing an export buffer.
This is run after the contents of included files have been inserted.")

(defvar org-export-preprocess-after-tree-selection-hook nil
  "Hook for preprocessing an export buffer.
This is run after selection of trees to be exported has happened.
This selection includes tags-based selection, as well as removal
of commented and archived trees.")

(defvar org-export-preprocess-before-backend-specifics-hook nil
  "Hook run before backend-specific functions are called during  
preprocessing.")


(defvar org-export-preprocess-final-hook nil
  "Hook for preprocessing an export buffer.
This is run as the last thing in the preprocessing buffer, just before
returning the buffer string to the backend.")


- Carsten


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


Re: [Orgmode] Footnotes and org-export, revisited

2009-01-01 Thread Carsten Dominik

Hi,

the result of this discussion about footnotes is now
in the latest git version, see

http://orgmode.org/Changes.html#sec-1.1.1

for more information.

- Carsten

On Dec 17, 2008, at 1:52 PM, Scot Becker wrote:


Dear all,

I'm a new org user who recently ran across the video of Carsten's
Google talk. I have been looking for something like org for years, but
learning Emacs had always seemed too high a price, so I never really
considered Emacs-based options.  However time is a teacher, and I see
now that there are plenty of other higher prices than learning Emacs,
which has anyway proved easier than I thought.  Org-mode is really an
amazing piece of work, a highly original piece of software, and
possibly just what this vim user needs. When I think how much time I
spent other solutions, including vim's two (basically unmaintained and
functionally feeble) outline modes, I can only resign myself to the
mild shame.

The following is in response to a brief thread posted to this list in
October by Matthew Lundin.  He described the limitations of
footnotes.el, and suggested two possibilities for extending footnotes
support in org-mode. [1].

The problem with Steve L. Baur's (otherwise useful) footnotes mode is
that it cannot 'read' the contents of a loaded buffer.  So in any
given editing session, footnote numbering always starts with 1, even
if you already had 1...10 in your file from a previous editing
session.  This is simply a limitation of the mode in its current
state.  I expect the package's scope was originally confined to using
footnotes in plain text emails, which are generally finished in one
shot.

There have been some efforts to overcome this limitation by means of a
patch to  footnote.el [2] and a new function, footnote-init.el [3]
which reads the contents of a newly loaded  buffer so that the patched
footnote.el 'knows' about previously placed footnotes.  These
particular patches may not have all the kinks worked out, however,[4]
and are not part of the current CVS of Emacs 23.

But someone working in Muse did write an interesting extension to
Muse's footnote support. (The extension is explained here [5], and the
revised version of the code is here [6]). It is basically a hook
function which converts footnotes with reference names[fn:named_note]
to plain, numbered footnotes, like Muse and org-mode support. It
operates on a temporary buffer  just before export to LaTeX or HTML,
so is transparent to the user.

I too would like to make use of org-mode to do more extensive
footnoting than the current footnote.el easily allows.  I'm not sure
of the best solution.  Here are the alternatives I can think of:

1.  Help Baur's footnotes.el get to the point where it has no trouble
with multiple editing sessions and managing the numbering of any
arbitrary quantity of footnotes.  This is possible in theory.  But I
suspect that footnotes associated with body text by simple Arabic
numerals are pretty easy to mangle in a simple text system that lets
you do arbitrary things with the text. Comments?

2.  Adapt the Muse code mentioned above for use with org-mode.  This
would keep org-mode's current footnote support unchanged, but allow
named footnotes while writing. Carsten suggested something like this
in his response to Matthew.

3.  Add named footnote support to org-mode according to Matthew's
second suggestion (similar to footnote functionality in Pandoc,
Multi-Markdown or ReST). This could optionally include a function for
the auto-generation of short (?) unique-ish IDs  to use instead of
names (in a long document, giving named references to dozens of
similar footnotes could itself be a source of confusion).

4.  Forget org-mode for anything with any quantity of footnotes.  This
is Carsten's other suggestion in response to Matthew.  It's possible
that the practicalities of footnote handling would prove too costly to
get right.  He knows this much better than I.  (though I'm not sure
that they impair org's plan-text readability as Carsten suggests.

5.  A final solution (which might also gain other advantages) could be
to begin to facilitate an org-export mode to Pandoc's native
plain-text syntax (an extension of Markdown).[7] Pandoc is a robust
Haskell engine to convert between plain text formats.  This would add
a step to org-mode export, but that one step could potentially allow
conversion into the wide range of formats that Pandoc supports
(markdown, reStructuredText, HTML, LaTeX, ConTeXt, RTF, DocBook XML,
OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, groff man pages,
and S5 HTML slide shows). Pandoc's syntax model already has a lot in
common with org's.  (Both allow LaTeX pass-through, for example).  I
don't know if such an export would meet the effort vs. value trade
off, but I suggest it might.

Comments? (by anyone who summoned the patience to read all of  that...
sorry for the length.  I couldn't manage less).

Scot B.

Footnotes:
[1] http://thread.gmane.org/gmane.emacs.orgmode/8373
[2] 
htt

Re: [Orgmode] Footnotes and org-export, revisited

2009-01-01 Thread Matthew Lundin

Hi Carsten,

First of all, let me say thank you for this wonderful addition to
org-mode. I will certainly do more of my writing in org-mode now.
Incredible!

I've tested the new footnote feature and can get everything to work
except anonymous footnotes. When using more than one anonymous
footnote, all subsequent anonymous footnotes are exported with the
number of the first footnote and their notes are lost. (The same
happens when normalizing footnotes in org-mode.) I've included the
source and output below. At the moment, I'm using Emacs 22.2.1 (Carbon
Emacs).

Happy New Year!

- Matt

---

A. Here is the org source:

--begin source--

* Testing the new footnotes function
  
Here is a footnote.[fn:: The first anonymous footnote.] And here is
another footnote.[fn:: The second anonymous footnote.] And a third
anonymous footnote.[fn:: The third anonymous footnote.] Now a footnote
with a definition.[fn:label] Here is the footnote with a
definition.[fn:special: Inline definition.] Here is a reference to
that same footnote.[fn:special] And a traditional numbered
footnote.[2]

[fn:label] Named footnote.

[2] Numbered footnote.

--end source--

B. Here's what the exported html looks like (copied from w3m):

---begin exported html---

Table of Contents

  * 1 Testing the new footnotes function

1 Testing the new footnotes function

Here is a footnote.^1 And here is another footnote.^1 And a third
anonymous footnote.^1 Now a footnote with a definition.^2 Here is the
footnote with a definition.^3 Here is a reference to that same
footnote.^3 And a traditional numbered footnote.^4

Footnotes:

^1 The first anonymous footnote.

^2 Named footnote.

^3 Inline definition.

^4 Numbered footnote.

---end exported html---

C. Finally, here are the results when I normalize the footnotes in
org-mode:

* Testing the new footnotes function
  
Here is a footnote.[1] And here is another footnote.[1] And a third
anonymous footnote.[1] Now a footnote with a definition.[2] Here is
the footnote with a definition.[3] Here is a reference to that same
footnote.[3] And a traditional numbered footnote.[4]

* Footnotes

[1] The first anonymous footnote.

[2] Named footnote.

[3] Inline definition.

[4] Numbered footnote.

Carsten Dominik  writes:

> Hi,
>
> the result of this discussion about footnotes is now
> in the latest git version, see
>
> http://orgmode.org/Changes.html#sec-1.1.1
>
> for more information.
>
> - Carsten


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


Re: [Orgmode] Footnotes and org-export, revisited

2009-01-01 Thread Carsten Dominik

Hi Matt,

the bug is fixed now, thanks for the report.

Also, you can set org-footnote-section to nil
if you want non-inline footnotes to be defined
in the outline node where they are referenced, instead
of a special outline node "Footnotes".

- Carsten

On Jan 1, 2009, at 5:48 PM, Matthew Lundin wrote:



Hi Carsten,

First of all, let me say thank you for this wonderful addition to
org-mode. I will certainly do more of my writing in org-mode now.
Incredible!

I've tested the new footnote feature and can get everything to work
except anonymous footnotes. When using more than one anonymous
footnote, all subsequent anonymous footnotes are exported with the
number of the first footnote and their notes are lost. (The same
happens when normalizing footnotes in org-mode.) I've included the
source and output below. At the moment, I'm using Emacs 22.2.1 (Carbon
Emacs).

Happy New Year!

- Matt

---

A. Here is the org source:

--begin source--

* Testing the new footnotes function

Here is a footnote.[fn:: The first anonymous footnote.] And here is
another footnote.[fn:: The second anonymous footnote.] And a third
anonymous footnote.[fn:: The third anonymous footnote.] Now a footnote
with a definition.[fn:label] Here is the footnote with a
definition.[fn:special: Inline definition.] Here is a reference to
that same footnote.[fn:special] And a traditional numbered
footnote.[2]

[fn:label] Named footnote.

[2] Numbered footnote.

--end source--

B. Here's what the exported html looks like (copied from w3m):

---begin exported html---

Table of Contents

 * 1 Testing the new footnotes function

1 Testing the new footnotes function

Here is a footnote.^1 And here is another footnote.^1 And a third
anonymous footnote.^1 Now a footnote with a definition.^2 Here is the
footnote with a definition.^3 Here is a reference to that same
footnote.^3 And a traditional numbered footnote.^4

Footnotes:

^1 The first anonymous footnote.

^2 Named footnote.

^3 Inline definition.

^4 Numbered footnote.

---end exported html---

C. Finally, here are the results when I normalize the footnotes in
org-mode:

* Testing the new footnotes function

Here is a footnote.[1] And here is another footnote.[1] And a third
anonymous footnote.[1] Now a footnote with a definition.[2] Here is
the footnote with a definition.[3] Here is a reference to that same
footnote.[3] And a traditional numbered footnote.[4]

* Footnotes

[1] The first anonymous footnote.

[2] Named footnote.

[3] Inline definition.

[4] Numbered footnote.

Carsten Dominik  writes:


Hi,

the result of this discussion about footnotes is now
in the latest git version, see

http://orgmode.org/Changes.html#sec-1.1.1

for more information.

- Carsten




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


Re: [Orgmode] structure editing in brainstorming mode

2009-01-01 Thread Matthew Lundin

Hi everyone,

Carsten Dominik  writes:

>
> Matt, we clearly need a FAQ entry about transient-mark-mode :-)
>
> - Carsten

I've put up a new FAQ on transient mark mode and Momentary Mark: 

http://orgmode.org/worg/org-faq.php#transient-mark-mode

Feel free to suggest any corrections.

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] Feature request and patch - blocked TODO to say BLOCKED

2009-01-01 Thread Tom Breton (Tehom)

Motivating incident: I had a todo-type item that contained no tasks
itself, directly, but linked to other tasks.  I arranged it this way
in order that those other tasks could be placed neatly in a hierarchy
and not appear as "TODO" in two places.  I used the org-depend.el
BLOCKER code to manage this situation.  BTW, it works nicely.

But when a task is blocked, the heading is left with no "TODO" marking
at all.  That's not so bad for sibling tasks, because there's one
right above it that says "TODO" (or something).  But for distant-link
style tasks, IMO it gives a misleading impression that there is
nothing to do.

I request the following:

 * Object: One TODO workflow keyword set that relates specially to
   "BLOCKER".  It would be something like (sequence "BLOCKED" "|"
   "UNBLOCKED").
 * Behavior: When a C-c C-t change to a heading is blocked, instead of
   doing nothing, mark the heading with the first entry in the
   blockage workflow keyword set.
 * Behavior: Also do so when there is a blocked C-c C-t change to any
   heading whose TODO mark is in a state in the blockage workflow
   keyword set.
 * Behavior: Ordinarily don't offer the blockage workflow keyword set
   for C-c C-t and related commands.

I append a patch which does this.

The change mostly affects org.el, because allowing new TODO keywords
requires org.el to know about them, at least in computing some regular
expressions.  It was also a lot neater to let org-todo react to
blocked transitions than to try to make `org-depend-block-todo' do it,
which also avoided `org-todo' indirectly calling itself.

Summary of changes

Added 3 variables:
 * org-todo-use-blockage-keywords-p :: whether to use this
 * org-todo-blockage-keywords :: configurable keywords
 * org-blockage-keywords-1 :: internal

Encapsulated part of `org-set-regexps-and-options' as
`org-set-todo-constants'.  I had to because it needed to be called
twice, once for normal keywords and once with a flag for blockage
keywords.  I used encap-sexp to do it automatically (it's on my site,
http://panix.com/~tehom/my-code/), so no code changed, and I kept that
comment aligned with the regexp.

Made `org-set-regexps-and-options' also process
`org-todo-blockage-keywords'.

Changed the behavior of org-todo and org-depend-block-todo as described
above.

Tom Breton (Tehom)

*** org-depend.el   2008-12-18 18:26:05.0 -0500
--- new-org-depend.el   2009-01-01 17:13:13.0 -0500
***
*** 196,204 
(unless (eq type 'todo-state-change)
;; We are not handling this kind of change
(throw 'return t))
!   (unless (and (not from) (member to org-not-done-keywords))
!   ;; This is not a change from nothing to TODO, ignore it
!   (throw 'return t))

;; OK, the plan is to switch from nothing to TODO
;; Lets see if we will allow it.  Find the BLOCKER property
--- 196,210 
(unless (eq type 'todo-state-change)
;; We are not handling this kind of change
(throw 'return t))
!;;Act on only the right types of TODO-change:
!(unless
! (or
!;;A change from a member of the blockage set
!(member from org-todo-blockage-keywords)
!;;A change from nothing to TODO
!(and (not from) (member to org-not-done-keywords)))
! ;; Otherwise ignore it
! (throw 'return t))

;; OK, the plan is to switch from nothing to TODO
;; Lets see if we will allow it.  Find the BLOCKER property
*** old-org.el  2008-12-18 18:26:05.0 -0500
--- org.el  2009-01-01 17:25:32.0 -0500
***
*** 1458,1464 
(const :tag "Type (cycling directly to DONE)" type))
   (repeat
(string :tag "Keyword"))
-
  (defvar org-todo-keywords-1 nil
"All TODO and DONE keywords active in a buffer.")
  (make-variable-buffer-local 'org-todo-keywords-1)
--- 1458,1463 
***
*** 1483,1488 
--- 1482,1494 
  (make-variable-buffer-local 'org-todo-key-alist)
  (defvar org-todo-key-trigger nil)
  (make-variable-buffer-local 'org-todo-key-trigger)
+ (defvar org-todo-use-blockage-keywords-p t)
+ (defvar org-todo-blockage-keywords
+'(sequence "BLOCKED" "|" "UNBLOCKED")
+"Keywords of the blocking workflow keyword set." )
+ (defvar org-blockage-keywords-1 nil
+"All blockage keywords active in a buffer" )
+ (make-variable-buffer-local 'org-blockage-keywords-1)

  (defcustom org-todo-interpretation 'sequence
"Controls how TODO keywords are interpreted.
***
*** 2997,3002 
--- 3003,3079 
  set this variable to if the option is found.  An optional forth element
PUSH
  means to push this value onto the list in the variable.")

+ (defun org-set-todo-constants (kwds block)
+""
+(let
+   (inter kws kw)
+   (while
+(setq kws (pop kwds))
+(setq
+   inter (pop kws)
+   sep (member "|" kws)