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 domi...@science.uva.nl 
 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


[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)
+   kws0 (delete |
+