Re: [Orgmode] org-stow (Proof of concept)

2011-02-13 Thread Tom Breton (Tehom)

 I'm roughly parsing 37% of this :)

I will try to use less jargon.

 Again, can you demonstrate a clear and simple use-case, assuming people
 like me don't know anything about stow, stew, straw or whatsover?

OK, here's a use-case.  This is actually what I did right now while
recording a note that tells me to document a use-case.

 * First I make a note with org-remember (C-c r)
 * C-u C-c C-c to save it and go to it
 * M-x org-stow-make-item-stowable
   * It prompts me for a parent item.  I choose
 
\home\tehom\projects\elisp\org-mode\doc\local\org-stow.org/org-stow/Progress/
 With TAB, that's just a few keystrokes
 * M-x org-stow-item
   * Now there is a dblock from under Progress in org-stow.org that
 corresponds to this note, but that dblock is still empty.
 * Update dblocks
   * C-u C-c C-x C-u
   * You don't have to do this immediately; it will work at any time
   * Now it appears in two places: In notes and under the heading Progress.
 * Can do other work on that item
   * In fact, I set it to TODO
   * Update dblocks again.
   * Now the stowed copy says TODO too
   * When I finish the writeup, I will come back here and set DONE
 and update.

Another use-case:
 * At this point I added this write-up as another note.  So now
   everything I'm doing to answer you is in notes.
 * M-x org-stow-make-item-stowable
   * This time I store it in
 \home\tehom\projects\elisp\org-mode\doc\local\org-stow.org/org-stow/Docs/
 * M-x org-stow-item, update dblocks
   * Now the doc section of this file contains this item
 * Finish writing it (a moment from now) and update.

So I've added to a document while just dealing with notes, and
crucially, I can retract individual notes that become obsolete.


Take care,

Tom Breton (Tehom)



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


Re: [Orgmode] org-stow (Proof of concept)

2011-02-12 Thread Tom Breton (Tehom)

 M-x org-stow-make-item-stowable RET on TODO Drop off stuff is okay.

 But M-x org-stow-item RET on the same item is not -- here is a
 backtrace:

D'oh!  I completely forgot about the type-checking code!

That's for development, not production.  It just assertfails if the wrong
type is used.  Very helpful in finding problems early.  It relies on a
type-checking support module in emtest that defines certain types that
Common Lisp provides but cl doesn't.

I am pushing a quick fix where if that module is not available, the type
just always succeeds.

If you'd like the type-checking support (which is stand-alone) or all of
emtest, I can certainly include it.  Since you seem to have chosen ert, I
don't know what you want in this regard.

Tom Breton (Tehom)



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


Re: [Orgmode] org-stow (Proof of concept)

2011-02-11 Thread Tom Breton (Tehom)
 Tom Breton (Tehom) te...@panix.com writes:

 Any interest in trying this out?  I can push it if anyone else wants to
 try it out.

 I'm interested!  Please let me know where I can read some code.

 Thanks :)

I pushed it just now; it's on branch stow-design.  Here is a little
documentation:

*** How it works

It works by using dblocks as fake symbolic links.  After you stow items,
you do org-dblock-update with a prefix argument (C-u C-c C-x C-u) which
syncs the dblocks.

That may or may not be the best way to do this.  It's still experimental.

*** How to use it

The commands:

 * org-stow-make-item-stowable makes an item stowable.  It prompts you for
where to stow the item and remembers that information.

 * org-stow-item stows the item at point, marking it accordingly.

 * org-stow-unstow-item unstows the item at point, if it was stowed,
marking it accordingly.

 * org-dblock-update - existing org command.  Updates the dblocks to
reflect the current (un)stowing.

Thanks for the interest, and thanks Brian too.

Tom Breton (Tehom)



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


[Orgmode] Blogging from org-mode

2011-01-16 Thread Tom Breton (Tehom)
Some months back I contributed improvements to org-html.  My intent was to
make it easy to post org files as blog posts.

So this is a sort of delayed announcement.  There are two packages that
post to blogs from org-mode: My org2blog/atom and Puneesh's (punchagan's)
org2blog/wp.  I know there are also blog hosts based on org-mode, but
that's different.  This is pushing org files to a normal blog host such
as Blogger (for org2blog/atom) or Wordpress (org2blog/wp)

org2blog/atom lives in the git repo http://repo.or.cz/r/org2blog.git and
org2blog/wp lives in https://github.com/punchagan/org2blog.git

Both respect the normal export options (#+TITLE: etc) but other than that
the approaches are fairly different.

Please tell me if I've missed any other org-based blogging software (other
than the blog hosting software which is a different category).

Tom Breton (Tehom)



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


Re: [Orgmode] Blogging from org-mode

2011-01-16 Thread Tom Breton (Tehom)
 On 2011-01-16, Tom Breton (Tehom) te...@panix.com wrote:
 Please tell me if I've missed any other org-based blogging software
 (other
 than the blog hosting software which is a different category).

 Right, there are hosted blogs (like Blogger) and self-hosted blogs
 (where you run the software).

 Here is the latest version of my Blogger command.

Interesting.

 I would be delighted if there were some other protocol that
 it could use.

Feel free to play with org2blog/atom, and there's a mob user on the repo
if you feel like contributing.


 Could your API work to send the result to Blogger?  If so,
 how?  Do you have to sign up with Google in some special way
 or does it work just through the web?

Yes, and you don't have to do anything special on Google.  It uses the
Atom API thru g-client (elisp software by T V Raman), which is what drags
in the curl and xsltproc dependencies.  Those are not special Google
software, but they are non-elisp, non-emacs programs.

My philosophy is to make a package do one thing well.  But it leads to
dependencies.

Please let me know if you have any trouble obtaining the g-client version
that supports this.


 mail2blogger is a very intriguing option here and I'd like to do
 that.  Avoids the web entirely.  See comments.

I tried out mailing to blogger before writing org2blog/atom, but I was
frustrated by the things the mail interface couldn't do.


 Mark pages (About, Contribute, etc.) with the tag, :page:.  This
 will remove the top headline.  The reason is that Blogger pages
 always include the title as the name of the page and it looks
 silly to have two titles.

Right, it does and it does.  I'd be interested in a neat solution for
double-titling.  Right now I just let org2blog/atom export both.


Tom Breton (Tehom)



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


[Orgmode] org-stow (Proof of concept)

2011-01-14 Thread Tom Breton (Tehom)
I've written an addon that I call org-stow.  The basic idea is that
all remember notes live in a notes section, and you can make another
location pretend that the note lives there.  You build all or part of
a document that way.  If you know how stow works, it's like stow for
outline items.

Yes, it's a little bit like refiling a note, but:
 * Hopefully it's more convenient and natural to populate a whole
   document this way.
 * If you change your mind about a note later, you can just unstow
   it.

It's at the proof of concept stage now.  It stows notes, but doesn't
yet unstow them.

I used dblocks to mirror notes.  They are automatically inserted by
org-stow, and their dynamic contents is essentially copied from the
notes.

Any interest in trying this out?  I can push it if anyone else wants to
try it out.

Tom Breton (Tehom)



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


[Orgmode] Re: Proposal: Emtest as tester

2010-05-27 Thread Tom Breton (Tehom)
 Tom Breton (Tehom) te...@panix.com writes:

 At Carsten's request, I am proposing emtest as the tester for
 org-mode.  I would like to hear if there are any objections or
 questions.

 Hi Tom,

 My googling didn't manage to find emtest -- where does the code live at
 the moment?

At the moment it lives in a tarball.  I will put up an updated version at
panix.com/~tehom/my-code/emtest-bundle.tar.gz  That's emtest plus all
supporting packages.  (Should be all, I may have missed some dependencies
I have locally)

I'm looking to have it hosted on Savannah. You've given me the impetus to
go and do that, so thanks.

 Is there an Org repo out there demonstrating how it would
 integrate,

Right now the only git repo lives on my machine.

 and/or some documentation and examples of usage?

Right now the documentation consists of my design notes, which are
probably confusing since they include as-built, unrealized plans,
self-debates over the right approach, discarded and/or obsolete plans,
bugfixes, and progress notes.  I will try to write up something more
accessible.

Every feature has examples of usage in the tests.el files, one of the
virtues of tests.

Tom Breton (Tehom)



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


Re: [Orgmode] Proposal: Emtest as tester

2010-05-27 Thread Tom Breton (Tehom)
 Hi Tom,


 [...]

 I made an attempt earlier to propose a testing framework and wrote some
 thoughts in an email thread:

 http://www.mail-archive.com/emacs-orgmode@gnu.org/msg22558.html

I read that.  Interesting.

 Would your proposal cover my example-based approach?  How hard would it
 be to turn a typical bug report into a test case?

Not hard at all.  Most of what you propose is already supported.  You
would put both the input and expected output in FOO/examples/UNIQUE-NAMES

The sequence of commands can easily be made into a test case. 
`emt:insert' inserts the template for you (choose `emt:insert-test'), then
paste it in.

Rather than saving the buffer, you probably want to do it all inside a
mock buffer, like (excuse the online-editor formatting)

(emtb:with-buf (:file INPUT-FILE-NAME)
(operations)
(emtb:buf-contents-matches (:file OUTPUT-FILE-NAME))

For testing only visible output, you'd presumably use org-export-visible
and compare that buffer's contents to what's expected.

Wildcard comparisons in files are not yet supported.  I will take that as
a feature request.

Tom Breton (Tehom)



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


[Orgmode] Proposal: Emtest as tester

2010-05-24 Thread Tom Breton (Tehom)
At Carsten's request, I am proposing emtest as the tester for
org-mode.  I would like to hear if there are any objections or
questions.

** About Emtest

Emtest is an emacs-based test framework.  It reads tests, runs them on
command and presents their results.  Test suites can be run by suite,
by clause, or by library.

It is extensible and modular.  Nearly everything about it can be
replaced or extended.

One important feature is its testhelp libraries:

 * mocks/filebuf - for making mock files and buffers to run tests in.
 * mocks/dirtree - for making mock directory trees.
 * deep-type-checker - for testing that objects, especially
   structures, are type-correct right down to their leaves.
 * match - for pattern-matching.  When you want to test return values
   or similar, but some fields or elements don't have stable values
   (say, a timestamp or a UUID).
 * tagnames - extremely useful for defining test data and iterating
   over examples.
 * testpoint - useful for:
   1. testing functionality that is called deep inside something else,
  where writing a viable test would mean nearly cloning the
  something else to get the calling conditions right.
   2. Testing functionality that uses other functionality that can't
  be easily controlled by passing arguments.
   3. Testing that under given circumstances a certain point is
  reached, not reached, or reached the right number of times.

Also, in less than perfect shape right now:

 * mocks/keystuffer - work in progress, for capturing canned user input
 * misc and standard - standard testhelp functions.  Works but
   undergoing reorganization.
 * types - type specifications, extending what cl provides.  Right
   now, just a few that I needed.
 * persist - useful for tests of inspected output.  Not working right
   now due to redesign of an underlying package.

** Some questions

  * Where to include it:

* I'm proposing to put it under org-mode/testing/ So the directory
  structure would look like:

  * org-mode

* lisp

* (etc)

* testing

  * emtest

* Many files

  * Some support
  * packages emtest
  * uses.

  * org-agenda

* tests.el

* (And other test files)

  * org-archive

* tests.el

  * org-ascii

  * etc (the other org files' directories of test files)

* (other existing org directories)

  * Should testing of contrib files be in a separate directory?  It's
not clear to me that it needs to be or should be.

  * Loading.

Of course this shouldn't require much extra work to build and
install.  Yet there's a case to be made for not building or
installing it by default, them that don't use it doesn't pay a
cost.

So I'm thinking I should add another target to the makefile to
install it, as well as (of course) a test target.

  * How to include it, git-wise.

What git wants to do with included external projects is to make
them submodules.  However, I'm told that's a pain to deal with,
moreso from the other end than from mine.  And it does seem like it
would be.  Basically git treats a submodule as a single thing, but
still signs it version-wise with a hex ID, and wants it to be the
correct version.  So git insulates you just a little bit, at the
cost of having to deal with an additional repository.

So I'm thinking I'd just include it literally and if that proves
hard to maintain then we still have the other option.


 Tom Breton (Tehom)



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


Re: [Orgmode] org-html link building diff

2010-05-17 Thread Tom Breton (Tehom)

Hi, Carsten.  The new changes are pushed as
tehom-html-export-refactor-build-link

I couldn't undo the basing onto tehom-master, try though I might.
Something to do with intermediate changes that I couldn't fast-forward
and that I probably edited wrong.  So I made a separate branch,
tehom-html-export-refactor-build-link, which is now pushed to the
repo.  So tehom-master and html-export-refactor-build-link are already
obsolete.

I moved the tests into top-level directory testing, as you asked.  I'm
going to write a separate post describing the test conventions I use.

Now a question: IIUC you want a branch that has no tests, that
contains only the changes that would go into org.  Since I develop
tests and code at about the same time (tests slightly before code),
I'm not sure how to arrange the branching in a maintainable way.

I could of course make a one-time branch that just removes the testing
directory.  But then what happens for any future fixes?  Seems like
each time I'd have to rebase that branch and pick thru changes and
make it discard each change that deals with testing/.  It seems hard
to maintain.

Tom Breton (Tehom)



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


[Orgmode] Test-file naming conventions - mine and suggested for org

2010-05-17 Thread Tom Breton (Tehom)
In developing emtest, I've given some thought to conventions for test
files.  My convention is that:

   * tests of foo.el go into foo/tests.el

 * With feature name foo/tests

   * Any shared testhelp goes into foo/testhelp.el

 * With feature name foo/testhelp

   * Example files go in foo/examples/

   * Alternative, they can all be placed in another directory
 hierarchy, like org/testing/foo/tests.el as long as
 org/testing is in the load-path (emacs doesn't know the
 difference).

I welcome any comments on this convention.  I considered it carefully;
I wrote a small document considering the alternatives and chose this
as best.  But it's young enough that it could be changed, were strong
arguments made towards some alternative.

Tom Breton (Tehom)



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


Re: [Orgmode] org-html link building diff

2010-05-15 Thread Tom Breton (Tehom)
 Hi Tom,

 what is the status of this development?  Ready for prime time?  If
 yes, can you please rebase to master and send me the pointer to the
 branch again?

I believe it is ready, though I haven't heard any feedback.  I pushed the
changes on about the 4th of may.

 Or is there still stuff unclear?  Can I help?

Maybe.  I hadn't done this before, so some feedback and (if needed)
correction would be appreciated.

I had to change the url to git+ssh so it would authenticate me, but when I
pushed, it was visible in the public (non-ssh) git repo, so I thought it
was visible to everybody.  Isn't it?

I thought I had done what you wanted by creating a branch for all my
changes ever (tehom-master) and rebasing the org-html link changes on that
(html-export-refactor-build-link).  Is that working for you?  If not, how
can I fix it?

Tom Breton (Tehom)



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


Re: [Orgmode] org-html link building diff

2010-04-29 Thread Tom Breton (Tehom)
 Hi Tom,

 On Apr 28, 2010, at 5:01 AM, Tom Breton (Tehom) wrote:


 The changes are essentially made and pass my tests now, there's mostly
housekeeping now: pull, merge, push.

 Yes.  Send me your name on repo.or.cz and I'll add push for you.
Please create your own branch and stay on it.

 It is Tehom.

 I have added you.

Oops, when I went to push, I realized that I had capitalized that but it's
apparently not capitalized on repo.or.cz.  It's tehom.

My branch is called tehom-master and the branch that treats link export
based on it is called html-export-refactor-build-link

Tom Breton (Tehom)






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


Re: [Orgmode] org-html link building diff

2010-04-27 Thread Tom Breton (Tehom)

The changes are essentially made and pass my tests now, there's mostly
housekeeping now: pull, merge, push.

 Yes.  Send me your name on repo.or.cz and I'll add push for you.
 Please create your own branch and stay on it.

It is Tehom.

 This is for having a clickable Thumbnail - I am not sure if this is
 also handled elsewhere.

I believe it is.  The only difference seems to be that the first
builds:

 : a href=foo/target.htmlimg src=some.jpg/a

all by itself and the second builds:

 : img src=some.jpg href=foo/target.html

thru `org-export-html-format-image'.  Only the second handles
captions.  If the captions etc are the issue, then it should all go
thru the second.  Plus, `org-export-html-format-image' seems to be the
right place for image code.  It would be bad if changes added to
`org-export-html-format-image' didn't take because this other code
handled it instead.

A few questions:

 * Encountered while writing tests: When type is file and path is an
   absolute filename, we do substitutions.  Like /foo/unfoo/.././baz
   becomes /foo/baz.  But we don't do them when path is relative.
   Why not?

   Is that just because we'd then need to make it relative again which
   is more code, or is there some other reason?

 * Also found in the course of testing: id: links cause errors when
   buffer is not associated with a file.  This can happen when the arg
   body-only is passed.

   * Punt id links in that case?

   * Do them but avoid the filename relativizing step?

 * How do you feel about url-parse?  It's bundled with emacs, builds
   and destructures urls.  IMO we're not at the stage where it
   provides more help than the extra work it requires yet.

Tom Breton (Tehom)




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


[Orgmode] org-html link building diff

2010-04-18 Thread Tom Breton (Tehom)
I've refactored `org-export-as-html', factored code to build links
into `org-html-make-link'.

This does two things that I needed:

 * It allows custom link types to build anchors.
   * How: Call org-html-make-link.  Many parameters, see the function
 docstring.  It returns a string containing an HTML link.
 * It adds the capability to convert links when exporting.
   * How: Around the export call, bind org-html-cvt-link-fn to a
 function that takes 1 parameter (filename) and returns a url as a
 string.

I think it also makes the code cleaner.

There are more things that could be done - it's only used by some of
the cond branches, the others are unchanged.  But publish early and
often, so here it is.

I will append the changes as a diff, since I can't push to the org
repository (fatal: The remote end hung up unexpectedly)

Tom Breton (Tehom)
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 74f3a55..9aaadec 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -533,6 +533,106 @@ in a window.  A non-interactive call will only return the buffer.
 
 (defvar html-table-tag nil) ; dynamically scoped into this.
 (defvar org-par-open nil)
+(defconst org-html-cvt-link-fn 
+   ;;In the future this might change to take more args: type + path +
+   ;;fragment
+   #'identity
+   Function to convert link URLs to exportable URLs.
+Takes one argument, PATH.
+Returns exportable URL.
+Intended to be locally bound around a call to `org-export-as-html'. )
+
+;;; org-html-cvt-link-fn
+(defconst org-html-cvt-link-fn 
+   ;;In the future this might change to take more args: type + path +
+   ;;fragment
+   #'identity
+   Function to convert link URLs to exportable URLs.
+Takes one argument, PATH.
+Returns exportable URL.
+Intended for remote exporting. )
+
+
+;;; org-html-make-link
+;;Special variables seen:
+;;`html-extension' -- From plist
+;;`org-par-open' is a special variable so it's not in the arglist.
+(defun org-html-make-link (type path fragment desc descp attr
+   may-inline-p) 
+   Make an HTML link
+TYPE is the device-type of the link (And isn't used yet) (THIS://foo.html)
+PATH is the path of the link (http://THIS)
+FRAGMENT is the fragment part of the link, if any (The foo.html#THIS part)
+DESC is the link description, if any.
+DESCP is whether there originally was a description.
+ATTR is a string of other attributes of the a element.
+MAY-INLINE-P allows inlining it as an image.
+
+   (declare (special html-extension org-par-open))
+   (let ((filename path)
+	thefile)
+  (save-match-data
+	 ;;First pass.  Mostly deals with treating local files.  TYPE
+	 ;;may still change.
+	 (cond
+	((string= type file)
+	   ;;Substitute just if original path was absolute.
+	   ;;(Otherwise path must remain relative)
+	   (setq thefile 
+		  (if (file-name-absolute-p filename) 
+		 (expand-file-name filename) 
+		 filename))
+		  
+	   (when (and org-export-html-link-org-files-as-html
+			(string-match \\.org$ thefile))
+		  (setq type http)
+		  (setq thefile (concat (substring thefile 0
+	   (match-beginning 0))
+   . html-extension
+	(t (setq thefile filename)))
+	
+	 ;;If applicable, convert local path to remote URL
+	 (setq thefile
+	(or
+	   (funcall org-html-cvt-link-fn thefile)
+	   thefile))
+
+	 ;;Second pass.  Build final link except for leading type
+	 ;;spec.  Now TYPE is final.
+	 (cond
+	((or
+		(string= type http)
+		(string= type https))
+	   (if fragment
+		  (setq thefile (concat thefile # fragment
+	   
+	(t))
+	
+	 ;;Final URL-build, for all types.
+	 (setq thefile 
+	(concat type : (org-export-html-format-href thefile)))
+
+	 (if (and 
+		may-inline-p
+		;;Can't inline a URL with a fragment.
+		(not fragment)
+		(or 
+		   (eq t org-export-html-inline-images)
+		   (and 
+		  org-export-html-inline-images
+		  (not descp)))
+		(org-file-image-p
+		   filename org-export-html-inline-image-extensions))
+
+	(progn
+	   (message image %s %s thefile org-par-open)
+	   (org-export-html-format-image thefile org-par-open))
+	(concat 
+	   a href=\ thefile \ attr 
+	   (org-export-html-format-desc desc)
+	   /a)
+
+;;; org-export-as-html
 ;;;###autoload
 (defun org-export-as-html (arg optional hidden ext-plist
 			   to-buffer body-only pub-dir)
@@ -1014,7 +1114,7 @@ lang=\%s\ xml:lang=\%s\
   \ class=\target\ (match-string 1 line)
   @/a )
 			  t t line)
-
+	
 	  (setq line (org-html-handle-time-stamps line))
 
 	  ;; replace  by amp;,  and  by lt; and gt;
@@ -1070,28 +1170,25 @@ lang=\%s\ xml:lang=\%s\
 	  (save-match-data
 		(setq id-file (file-relative-name
 			   id-file (file-name-directory org-current-export-file)))
-		(setq id-file (concat (file-name-sans-extension id-file)
-  . html-extension))
-		(setq rpl (concat a href=\ id-file #
-  (if (org-uuidgen-p path) ID-)
-  path \
-  attr

[Orgmode] Tiny bug in org-html

2010-04-18 Thread Tom Breton (Tehom)
In the course of working with org-html, I noticed that
`org-export-as-html-and-open' seems to have a bug.  `kill-buffer'
needs an argument, a buffer, presumably the buffer that
`org-open-file' makes.  This code is protected by the nil default
value of `org-export-kill-product-buffer-when-displayed', so the bug
may not have been obvious.

Tom Breton (Tehom)




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


[Orgmode] And a question about org-html

2010-04-18 Thread Tom Breton (Tehom)
Does the image link building code before the big cond statement do
anything that the cond statement doesn't do anyways now?  I'm referring to
the block that begins with the comment:
;; Make an image out of the description if that is so wanted

It builds an image link in a slightly different way, but that doesn't seem
as good as a real image link, and it seems to duplicate functionality
that the cond statement has (and now in my new stuff, that
`org-html-make-link' always handles)

Tom Breton (Tehom)




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


[Orgmode] org blogging, where to find labels in org file?

2010-02-21 Thread Tom Breton (Tehom)

I'm adapting g-client to blog post directly from org-mode.  It's an
emacs package written by T V Raman that talks to Google API via Atom.
I'm just using it to post a blog.

I'm basically done[fn:1], but now I want it to post labels (aka tags).  Ie,
find labels in an org file and use them to label a blog post.

My question is, in an org file that will become a blog post, is there
an accepted or correct place for the labels to live?  Like:

 * The tags of the top item? (But then it can collide with meaningful
   tags)
 * A certain property of the top item?
 * An #+XXX: line?

What information does other org-based blogging software use as labels?

Thanks,

Tom Breton (Tehom)

*** Footnotes

[fn:1] My change consists of
 * a patch at http://www.panix.com/~tehom/my-code/gblogger.el.diff
   * It sent it to T V Raman, so maybe it will be in the next g-client.
 * a new file at http://www.panix.com/~tehom/my-code/org2blogger.el
   * it is neither part of org nor gclient but uses both.  It requires
 the patch.




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


Re: [Orgmode] org-choose bugfix - whoops

2009-04-08 Thread Tom Breton (Tehom)
My previous fix was mistaken.  Not sure why it passed tests; I
have two theories.  Regardless, it was wrong.  Current
`(org-outline-level)' seems the correct LEVEL= matcher argument to
make `org-map-entries' find only an item's immediate children.  (Operated
on by `org-reduced-level' of course)  I don't quite understand why.

Second, I may have solved the mystery of how the bug got by me before.
`org-map-entries' used to place point at the beginning of an item, a
fact which I used to recognize visiting the same item.  That seems to
have changed between org versions.

Third, I have fixed the real bug - properly now, I hope! - and
attached a patch.

Tom Breton (Tehom)


org-choose.el.diff
Description: Binary data
___
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-choose bugfix

2009-02-23 Thread Tom Breton (Tehom)
Here is a bugfix for org-choose that I've been meaning to post.

The bug was this:

  When looking for alternatives, it looks at the whole tree, not just
  the immediate children.

Now fixed.  Patch is attached.

Tom Breton (Tehom)


org-choose.el.diff
Description: Binary data
___
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-choose

2009-02-13 Thread Tom Breton (Tehom)
Hi, Carsten.


 One more thought:  I did read in another message that you
 are using an older version of Emacs? Emacs 21?

 I have a vague memory that split-string might work different
 there, with empty fields at the beginning and end

 I am not at all sure, though.  It it has to to, maybe
 you want to use org-split-string

That just might be it!  I have changed it to org-split-string.  A
patch is attached.

I can't detect any difference - all tests pass either way - so I hope
you will tell me whether it works now.

 Hi Tom,

 first, I did apply your patch - even though I do not
 think the require org-agenda should be needed.

I agree.  But since debugging at a distance is painful, and
org-map-entries calls agenda functions, I am trying to play it safe.

One other play-it-safe change in the patch: (require 'cl) is now on
its own, not inside `eval-when-compile'.  I realized last night that I
always have `cl' loaded, so maybe that was the difference between my
setup and others'.

 I also did make the change (not pushed yet) 'org - org, also because
 this is compatible with XEmacs, the symbol version not.

Thank you.  And thank you for your patience with this.

Tom Breton (Tehom)




___
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] Now with patch (Was Re: Org-choose)

2009-02-13 Thread Tom Breton (Tehom)
The previous message would have worked better if I had actually remembered
to attach the patch.  Here it is.

Tom Breton (Tehom)



org-choose.el.diff
Description: Binary data
___
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-choose

2009-02-13 Thread Tom Breton (Tehom)
 Hi Tom,

 thanks, this patch seems to fix at least the problem I was having.

Glad to hear it!

 I see that you now require 'cl also during runtime, which is
 probably (?) because you are also calling some functions,
 not only macros?

Yes.  The configuration difficulties made me think about that, and I
realized I really should do it cleanly.

 If we decide to move org-choose into the Org core at some point,
 then we would have to change this, because Emacs rules require
 that cl is only required during compilation.

I know.  That was my motivation for originally putting it in
`eval-when-compile'.

 I think that is a pity because it is *so* useful, but
 there you go.

My sentiments exactly.

 So, maybe at some point you might want to replace the cl functions
 with other code.

Yes.  I don't think there's any rush.

Tom Breton (Tehom)




___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-12 Thread Tom Breton (Tehom)
 On Wed, Feb 11, 2009 at 4:18 AM, Tom Breton (Tehom) wrote:
 [...]
 I couldn't reproduce this. Is this on the same test file as before?

 Sorry for the delay in reply, Tom.  I reproduce the situation below:

 First the test file.

 --8---cut here---start-8---
 #+CHOOSE_TODO: REJECTED(r) NOT_CHOSEN(n,-) MAYBE(,0)
 LEANING_TOWARDS(l) CHOSEN(c,+)

 * Which editor to use?
 *** LEANING_TOWARDS Emacs
 *** LEANING_TOWARDS Vim
 *** LEANING_TOWARDS Textmate
 *** REJECTED Gedit
 *** REJECTED Textpad
 --8---cut here---end---8---

 0. I have latest org-choose loaded, org-mode restarted, and local
setup refreshed.
 1. S-right on the second item to switch it to CHOSEN state.  It works.
 2. Now S-right on the first item to switch it to CHOSEN state.  Also
works.

 Both entries stay at CHOSEN state whereas I expected the second entry
 to switch to a NON-CHOSEN state (possibly switching just one state
 backwards not all the way back to REJECTED, but then I do not yet
 understand it fully.)

 Is this the right behaviour?  If yes, please help me understand this a
 little.  Or could I be doing or have something wrong in my setup?

That's not right the behavior, but again I can't seem to reproduce this. 
Using your test file and following your instructions, I get the correct
behavior.  Specifically, after S-right on second item:
[begin]
* Which editor to use?
*** NOT_CHOSEN Emacs
*** CHOSEN Vim
*** NOT_CHOSEN Textmate
*** REJECTED Gedit
*** REJECTED Textpad
[end]
Then after S-right on the first item, again correctly:
[begin]
* Which editor to use?
*** MAYBE Emacs
*** LEANING_TOWARDS Vim
*** NOT_CHOSEN Textmate
*** REJECTED Gedit
*** REJECTED Textpad
[end]

Now there's clearly something different between my setup and yours that it
causing a bug, but it's very difficult to diagnose and fix at a distance.

I have a theory that it's caused by an unloaded library whose absence makes
`org-map-entries' abort.

What I'm going to try is to add a require for org-agenda.  Will you try it
and tell me whether it fixes the bug?  Because I just can't see the bug in
my setup.

Tom Breton (Tehom)





___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-12 Thread Tom Breton (Tehom)
 Tom Breton (Tehom) te...@panix.com wrote:


  On Feb 11, 2009, at 2:08 AM, Tom Breton (Tehom) wrote:
 
 
  (let*
((x 1))
(eval-after-load 'simple (setq x 2))
x)
 
  =3D 2
 
 
 
  (let*
((x 1))
(eval-after-load 'simple '(setq x 2))
x)
 
  =3D 1
 
  In fact, I am getting 2 in both cases!???
  Do you really get 1 for the second???

 Yes I do, but it's clear now that I was mistaken about why.  On closer
 inspection, it has to do with emacs not recognizing 'simple because it
 wants to see simple instead (string instead of symbol).


 That's not correct: eval-after-load will happily accept a symbol instead
 of a string, as long as the symbol is a feature provided by the library.
 simple.el does that - the last form in it is

 (provide 'simple)

What version is this?  Because that's clearly not what it does on emacs
21.3.1. Here simple.el does not have (provide 'simple) in it.

I see no provision for accepting a symbol in eval-after-load.  The test it
uses is just:

(assoc file load-history)

The cars of load-history are all strings, so I can't see how it would find
a symbol among them.  And it continues to stubbornly return a 1 for that
example when I use 'simple.

Clearly something has changed across versions.

Tom Breton (Tehom)




___
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


Patch Re: [Orgmode] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-12 Thread Tom Breton (Tehom)
Here is a patch that I hope will solve the problems people are having with
org-choose.el.  It contains two intended fixes:

 * `eval-after-load' gets a string argument.  Apparently some emacsen can
accept a symbol, but older ones can't.
 * org-agenda is required before `org-map-entries' is called.  This is  
 admittedly a quick and dirty fix, if it even works.

Tom Breton (Tehom)


org-choose.el.diff
Description: Binary data
___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-11 Thread Tom Breton (Tehom)

 Hi Tom,

 maybe you can educate me:  I have never understood what the # does
 in code like the one you have here.  You are using it, so maybe you
 know?

 - Carsten



Here, it's   #'   that it of interest, not  #  alone.

At the most direct level, it quotes the symbol with `function' instead of
`quote'.  For example:

(format %s ' 'foo)  = (quote foo)
(format %s ' #'foo) = (function foo)

What it accomplishes:
 * In some contexts, it is needed to get a symbol's function binding
instead of its value binding.
 * It alerts the byte-compiler that it's seeing a function, so it can
perform certain optimizations (I don't know offhand exactly what).
 * Stylistically, it alerts the reader.

It's an imitation of Common Lisp's reader macro  #'  which does sort of
the same thing.

At the syntax level, it's really a combination of   #   which signals a
reader macro - though in emacs, it's all hard-coded and inextensible - and
 '  which stands for the function-quote reader macro.

FWIW, what I added to lread.c was an extension of the reader macro
facility at RMS' request, so you definitely asked the right guy.

Tom Breton (Tehom)




___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-11 Thread Tom Breton (Tehom)

 On Feb 11, 2009, at 2:08 AM, Tom Breton (Tehom) wrote:


 This bug is simple.  In Setting it all up at the end of org-
 choose.el,
 in 6.22b a quote got introduced before progn.  That's all.  With that
 quote, it evaluated a quoted form and did nothing.  I'd send a
 patch,
 but ISTM it's easier to just press backspace once.  It's here:

 (eval-after-load 'org
  '(progn
 ;;^--HERE.
 (add-to-list 'org-todo-setup-filter-hook
#'org-choose-setup-filter)
 (add-to-list 'org-todo-get-default-hook
#'org-choose-get-default-mark)
 (add-to-list 'org-trigger-hook
#'org-choose-keep-sensible)
 (add-to-list 'org-todo-interpretation-widgets
'(:tag Choose   (to record decisions) choose)
'append)
   ))

 Hi Tom,

 I added the quote because without it, evaluating org-chose.el did error.
 It was my understanding that such a form has to be quoted.  Am
 I missing something here?

What error did it give?  I didn't get one here.

Definitely the form should not be quoted.  Quoted, it does nothing.
Demonstration (with libary `simple' which is fairly basic in emacs so
probably loaded for everyone):

(let*
   ((x 1))
   (eval-after-load 'simple (setq x 2))
   x)

= 2



(let*
   ((x 1))
   (eval-after-load 'simple '(setq x 2))
   x)

= 1



Tom Breton (Tehom)





___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-11 Thread Tom Breton (Tehom)
nicholas.do...@hp.com wrote:
 Tom Breton (Tehom) te...@panix.com wrote:

 (let*
((x 1))
(eval-after-load 'simple (setq x 2))
x)

 =3D 2



 (let*
((x 1))
(eval-after-load 'simple '(setq x 2))
x)

 =3D 1


 Are you sure about this? My understanding of this differs from
 yours:

This is definitely a Boy is my face red moment.  You are completely
correct.  I had misunderstood `eval-after-load' as a macro.  Upon looking
at subr.el, it is obvious that you are right and I am wrong.

Thank you for pointing all that out.

 eval-after-load is an ordinary function (not a special form), and
 function evaluation in most LISPs (elisp in particular) evaluates
 arguments before the function is called on them. So if you give it an
 unquoted form, the form will be evaluated *before* eval-after-load gets
 its hands on it. That seems to me to defeat the purpose. I'd think that
 the thing to do is to give the quoted form as argument, then function
 evaluation evaluates the argument (i.e. unquotes the quoted form,
 giving back the form) which is then passed to eval-after-load for
 action. The semantics of eval-after-load imply that (depending on
 whether the library is already loaded or not) the form may be evaluated
 once. It is then squirrelled away and if the library is ever loaded
 again, it is evaluated (perhaps for the first time, perhaps for the
 nth), *after* the library is loaded.

 And I think your demonstration is misleading: after doing the
 eval-after-load, you need to reload simple to trigger the after-load
 evaluation, otherwise eval-after-load reduces to just plain eval (in
 this  particular case, since simple is, as you point out, already loaded -
 things would be different if you had chosen some obscure library that
 is not already loaded):

 (let*
 ((x 1))
 (eval-after-load 'simple (setq x 2))
 (load-library simple)
 x)
 2

 (let*
 ((x 1))
 (eval-after-load 'simple '(setq x 2))
 (load-library simple)
 x)
 2

 In the first case, (setq x 2) was evaluated, x was set to 2 and 2 was
 passed into eval-after-load. Assuming that simple is already loaded, the
 2 is evaluated: the result is 2 and it is just thrown away. After the
 library is loaded again, 2 is evaluated again and the result is 2 and it
 just thrown away. Since x was set to 2 before, the value of x is 2.

 In the second case, (quote (setq x 2)) is evaluated, so the form (setq x
 2) is passed to eval-after-load. Assuming that simple is already loaded,
 the form is evaluated, setting x to 2 and giving a result of 2 (which is
 thrown away). After the library is loaded, (setq x 2) is eval'led again,
 setting x to 2 again, and giving a result of 2 (which is thrown away).

 In both cases, the value of x (and therefore the value the let* form
 returns) is 2. But it seems to me that the second case is the useful
 one.

 Perhaps the most telling evidence that the quote should be there however
 is the following: if you look at eval-after-load instances in the emacs
 lisp directory, you'll see that the second argument in all of them is
 quoted or at least (when partial evaluation is required) backquoted --
 although I guess one could argue that they all originated by copying a
 badly constructed precursor - the programming version of original sin!-)

 Regards,
 Nick






___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-11 Thread Tom Breton (Tehom)

 On Feb 11, 2009, at 2:08 AM, Tom Breton (Tehom) wrote:


 (let*
   ((x 1))
   (eval-after-load 'simple (setq x 2))
   x)

 = 2



 (let*
   ((x 1))
   (eval-after-load 'simple '(setq x 2))
   x)

 = 1

 In fact, I am getting 2 in both cases!???
 Do you really get 1 for the second???

Yes I do, but it's clear now that I was mistaken about why.  On closer
inspection, it has to do with emacs not recognizing 'simple because it
wants to see simple instead (string instead of symbol).

;;As symbol
(let*
   ((x 1))
   (eval-after-load 'simple '(setq x 2))
   x)

= 1


;;As string
(let*
   ((x 1))
   (eval-after-load simple '(setq x 2))
   x)

= 2


Not sure why it's different for you.  I suspect it may have to do with a
difference between the emacs version I use and later versions.

 eval-after-load is a function, not a macro, so FORM will
 be evaluated *before* being passed to the function.  []

Yes, I see that now.

Tom Breton (Tehom)




___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-10 Thread Tom Breton (Tehom)
 On Tue, Feb 10, 2009 at 8:44 AM, Tom Breton (Tehom) wrote:
 [...]
 OK, I've add comments, keywords, and some docstrings I forgot to
 org-choose.el, and I wrote a standalone doc. Both are attached.

 This is very intriguing functionality.  I tried to follow your and
 Casten's
 earlier exchanges but could understand only a little.  So I tried to
 follow
 your tutorial but I am getting stuck at switching the `choosenness' of
 items.
 I get following error when I try to switch to any state from no state.
 Once
 I assign a state by typing it out manually (as opposed to using state
 switching commands), I can then switch between states but the error
 repeats
 when I try to switch to MAYBE state.

 ,
 | save-excursion: Symbol's function definition is void:
 outline-up-heading-all
 `

I couldn't reproduce this bug with your test file.

It seemed to have to do with loading, so I restarted emacs without
pre-loading org (ie, I commented it out of my .emacs).  I only found a
dependency on org-agenda, and once that was loaded, no more error.  So I
couldn't reproduce it.


 So far, my understaning is that only one item can be in YES state.  If I
 try
 to switch another item to YES then the existing YES will be demoted
 to MAYBE.

Right.

 So for a two-state choosenness only one item can be in CHOOSE
 state while all others will switch to NOT_CHOOSEN state.. is that
 understanding correct?

Hm, I didn't look at sets with just two states.  Now that I look at it,
yes, that works but not in the best way it could.  Because I never
contemplated 0 and - being properties of the same mark, it has to be
speced as something like:

#+CHOOSE_TODO: NO(n,-) YES(y,0)

Tom Breton (Tehom)



___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-10 Thread Tom Breton (Tehom)
 With three choices for choosenness, it works as I expected (only one item
 in
 CHOSEN state at a time) but for more choices like:

 #+CHOOSE_TODO: REJECTED(r) NOT_CHOSEN(n,-) MAYBE(,0)
 LEANING_TOWARDS(l) CHOSEN(c,+)

 it allows multiple items to be in CHOSEN state.  How do we interpret that?

I couldn't reproduce this.  Is this on the same test file as before?

Tom Breton (Tehom)




___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-10 Thread Tom Breton (Tehom)


 Hmm, not sure if I messed up there - so I fixed this bug.  Tom,
 please check if I did this right.

 - Carsten


Hi, Carsten.  I just looked at org-6.22b

You caught a problem, but I think it's a different bug.  I think there
are these different things:

 * What you saw, that it doesn't work at top level.  Good catch.  My
   code finds the groups of siblings via their parent.  If they have
   no parent, it doesn't work.  Doing that already generated an error
   deep in the guts of outline, but your way is better.  Let's keep
   your fix.
 * What Manish saw.  I can't reproduce this.  I suspect that it
   relates to outline somehow not being loaded, but org-choose
   requires org which requires outline.  I find a dependency on
   org-agenda from `org-map-entries' in org.el, and once I load that,
   it all works.

Tom Breton (Tehom)




___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-10 Thread Tom Breton (Tehom)
 On Tue, Feb 10, 2009 at 2:42 PM, Carsten Dominik wrote:

 On Feb 10, 2009, at 9:46 AM, Manish wrote:

 On Tue, Feb 10, 2009 at 8:44 AM, Tom Breton (Tehom) wrote:
 [...]

 OK, I've add comments, keywords, and some docstrings I forgot to
 org-choose.el, and I wrote a standalone doc. Both are attached.

 This is very intriguing functionality. I tried to follow your and
 Casten's
 earlier exchanges but could understand only a little. So I tried to
 follow
 your tutorial but I am getting stuck at switching the `choosenness' of
 items.
 I get following error when I try to switch to any state from no
 state.
 Once
 I assign a state by typing it out manually (as opposed to using state
 switching commands), I can then switch between states but the error
 repeats
 when I try to switch to MAYBE state.

 ,
 | save-excursion: Symbol's function definition is void:
 outline-up-heading-all
 `

 Hmm, not sure if I messed up there - so I fixed this bug. Tom,
 please check if I did this right.

 This issue is gone for me.  Thanks.

 So far, my understaning is that only one item can be in YES state. If
 I
 try
 to switch another item to YES then the existing YES will be demoted
 to MAYBE. So for a two-state choosenness only one item can be in
 CHOOSE
 state while all others will switch to NOT_CHOOSEN state.. is that
 understanding correct?

 With three choices for choosenness, it works as I expected (only one item
 in
 CHOSEN state at a time) but for more choices like:

 #+CHOOSE_TODO: REJECTED(r) NOT_CHOSEN(n,-) MAYBE(,0)
 LEANING_TOWARDS(l) CHOSEN(c,+)

 it allows multiple items to be in CHOSEN state.  How do we interpret that?

Having fetched and set up 6.22b, I can now reproduce it.

This bug is simple.  In Setting it all up at the end of org-choose.el,
in 6.22b a quote got introduced before progn.  That's all.  With that
quote, it evaluated a quoted form and did nothing.  I'd send a patch,
but ISTM it's easier to just press backspace once.  It's here:

(eval-after-load 'org
  '(progn
;;^--HERE.
 (add-to-list 'org-todo-setup-filter-hook
  #'org-choose-setup-filter)
 (add-to-list 'org-todo-get-default-hook
  #'org-choose-get-default-mark)
 (add-to-list 'org-trigger-hook
  #'org-choose-keep-sensible)
 (add-to-list 'org-todo-interpretation-widgets
  '(:tag Choose   (to record decisions) choose)
  'append)
   ))





Tom Breton (Tehom)








___
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] Slight fix to update-org.sh

2009-02-10 Thread Tom Breton (Tehom)
While updating to 6.22b, I remembered this:

I like pete's update-org.sh.  It's convenient when you haven't got git
(I'll get around to getting git someday, but it's not high priority)

It had a bit of a problem because my org directory wasn't a subdirectory
of my build directory.  I made some minor changes to make it do that and
to gunzip the archive.  I've attached it to this message.

Tom Breton (Tehom)



update-org.sh
Description: Bourne shell script
___
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] Docs submitted (Was Re: Advice sought on managing decision alternatives.)

2009-02-09 Thread Tom Breton (Tehom)
Hi, Carsten.

 Well, some ASCII documentation could be inserted into org-choose.el
 as a file commentary.  If you use a standard header with keywords
 for the finder (M-x finder-commentary and friends), that would be
 useful.

 Tutorials on Worg are usually written in Org, but you can upload
 any format you like (or send it it me) and we wil publish it there.

OK, I've add comments, keywords, and some docstrings I forgot to
org-choose.el, and I wrote a standalone doc.  Both are attached.

Tom Breton (Tehom)


docs.org-choose.el.diff
Description: Binary data


docs.org-choose-docs.org
Description: Binary data
___
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: Advice sought on managing decision alternatives.

2009-02-06 Thread Tom Breton (Tehom)
 Hi Tom,
 [...]

 WIth you patch, we have right now

 CHOOSEas the prefix
 choseness as the interpretation
 org-decision as the name of the module.

 My request would be to maybe use `choose' also as the
 interpretation symbol, or, alternatively, CHOSENESS
 as the prefix.

Yes.  I think choose is best; the ambiguity between chosenness and
choseness just invited difficulties.

Always feel free to suggest alternatives to my naming.  Sometimes my
initial ideas go in a funny direction.  Eg, my initial thinking, which I
now abandon, was:

 * org-DECISIONS.el because it supports decisions.
 * CHOSENNESS because it's the property the item has of being chosen or not.
   As William observed, it's grammatically correct but rare.
 * CHOOSE because I saw that CHOSENNESS has problems.

So choose it is.  I'd like to rename the file org-choose.el as well, now
that I think about the naming.

Do you want a patch for it?

 For customizing org-todo-keywords, instead of explicitly
 offering `choseness', maybe we can use a symbol field
 where people can type into.

It's more flexible but offers less support to the user.  Maybe we can have
the best of both worlds by restricting the choice to interpretations that
available modules support.  Ie, something like this:

 * Object: a variable that holds the names of the interpretation symbols,
or of the ones that aren't built in.
 * Behavior: interested modules add their interpretation symbol to the list
 * Behavior: When customizing org-todo-keywords, offer the symbols from
   that list as choices for interpretation symbols.

The primary difficulty would be getting widgets to understand that.


 That would turn your patch into a generally useful system
 of hooks where other ideas could be implemented as well.

 What do you think?

Sounds good to me.

Tom Breton (Tehom)






___
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: Advice sought on managing decision alternatives.

2009-01-31 Thread Tom Breton (Tehom)
 Hi Tom,

 this looks awesome.

 Right now I am stabilizing everything to make my final release
 for Emacs 23.1, so it may be a week or two before I get to
 integrate this.

Understood.

 Also, I am interested in the testing environment, and what
 you made here may end up to be enough to establish a testing
 framework for Org-mode.

 If it turns out to be like this, maybe you can make a tutorial
 on test creation and put that up on Worg?  I would be willing
 to put the code needed for the testing environment into the
 contrib directory.

Certainly.  One thing, once my testing package rtest is in a stable state,
I plan to release it on its own, possibly as a sourceforge project.  But I
have no objection to you also putting in the org contrib directory.

Tom Breton (Tehom)




___
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: Advice sought on managing decision alternatives.

2009-01-22 Thread Tom Breton (Tehom)
 P.S. What is you copyright status with the FSF?

I believe I'm already good to go.  A few years back when I contributed
some code to emacs' lread.c, RMS had me sign and send the letter that
legally enabled FSF to include it.  IIUC, that step only has to be
done once for any code contributor.


 Your add-on defines a setup function which is actually a *filter*
 function.

OK, sounds good.  And makes it a bit easier to test.

 The interaction type does very little indeed inside Org, it
 only decides if a cycling command should go to the next
 step (sequence) or jump to the first DONE state (type).
 I think we should treat any other interaction types like
 sequence in this respect.

Here it would also distinguish chosenness from the other
interpretations, but that would be entirely inside org-decisions.el.

 I will then add hooks wherever you need them, they will
 be called whenever a TODO keyword changes and your code
 can react to it.

OK.

 One important precaution would be to make sure that one does
 not end up in infinite loops, so maybe when the hook is called,
 bind it dynamically to a nil value while you mess around with
 with the status of the siblings.  Maybe do the same thing with
 the variables that trigger time stamp and note recording.

Right.  I had already planned to let the hooks to nil; I will do the
same for the time stamp and note recording variables.

Thanks for the advice.  I will code it up and send it.

Tom Breton (Tehom)




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

2009-01-14 Thread Tom Breton (Tehom)
 Hi Tom,

 I am hesitant to apply this relatively complex patch which
 I have not had the time to study closely enough.
 I am wondering:  Instead of setting a TODO keyword,
 would it not be simpler and equally effective to set a
 special tag when an entry is blocked?

That is a much better solution.  I have coded that and tested it against
an example file, and it works.

I've attached a patch.  One note: I used diff flag -b to ignore whitespace
because most of the change is that the big `catch' statement isn't
directly returned but assigned to proceed-p.  So most of it got indented
further but no change other than whitespace.  I can diff it without -b if
you prefer.

 You could use a bright font to mark this tag, in order to
 make it obvious.  And you could use a custom query to look
 for blocked items, to see what can be done about them

Tom Breton (Tehom)

[example-file.org]

* Header
** TODO Blocking item
** Item that gets blocked
:PROPERTIES:
   :BLOCKER:  previous-sibling
   :END:
[end]

[begin patch]
*** old-org-depend.el   2009-01-04 03:01:50.0 -0500
--- ord-depend.el   2009-01-14 21:15:47.0 -0500
***
*** 112,117 
--- 112,121 
  ;;

  (require 'org)
+ (defcustom org-tag-blocked-depends t
+   Whether to indicate blocked TODO items by a special tag.
+   :group 'org
+   :type 'bool)

  (defun org-depend-trigger-todo (change-plist)
Trigger new TODO entries after the current is switched to DONE.
***
*** 191,197 
 (from (plist-get change-plist :from))
 (to (plist-get change-plist :to))
 (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger
!blocker blockers bl p1)
  (catch 'return
(unless (eq type 'todo-state-change)
;; We are not handling this kind of change
--- 195,202 
 (from (plist-get change-plist :from))
 (to (plist-get change-plist :to))
 (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger
!blocker blockers bl p1
!  (proceed-p
  (catch 'return
 (unless (eq type 'todo-state-change)
;; We are not handling this kind of change
***
*** 234,239 
--- 239,251 
(throw 'return nil))
 t ; return t to indicate that we are not blocking
 )))
+  (when org-tag-blocked-depends
+   (org-toggle-tag blocked
+  (if proceed-p 'off 'on)))
+
+  proceed-p))
+
+

  (add-hook 'org-trigger-hook 'org-depend-trigger-todo)
  (add-hook 'org-blocker-hook 'org-depend-block-todo)

[end patch]




___
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: Links to id:xxxxxx don't work in exported html

2009-01-08 Thread Tom Breton (Tehom)
 Message: 4
 Date: Thu, 8 Jan 2009 15:49:16 +0100
 From: Friedrich Delgado Friedrichs frie...@nomaden.org
 Subject: [Orgmode] Links to id:xx don't work in exported html
 To: Emacs-orgmode mailing list emacs-orgmode@gnu.org
 Message-ID: 20090108144916.gb5...@taupan.ath.cx
 Content-Type: text/plain; charset=us-ascii

 Hi!

 I really like org-link-to-org-use-id, however it breaks links to
 org items in html export for me.

 I have the following test file:

 ** Test [[id:45c4a467-b6ee-497c-9ed7-40342738e1c2][Item in a different
 org-file]]
[snip]

 The two external links have the mentioned ids and the links work in org,
 however html export gives me the following html snippet:

 div id=outline-container-1.1 class=outline-3

Looks like the problem is that it is html-escaped because it's the headline.
I actually think this is the right behavior.

Tom Breton (Tehom)





___
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] Re: Release 6.17

2009-01-04 Thread Tom Breton (Tehom)


 On Jan 4, 2009, at 3:33 PM, Steven E. Harris wrote:
 [...]
 Without knowing what the enclosing `quote' form means, how do know
 that
 ((def)) is not part of it?

 Hi Steven,

 good question, and the answer is that is does not know,
 cannot know, because this is a feature that is supposed
 to work for any kind of example, an the parser cannot
 know all possible syntaxes :-)

 This idea is to make this work in a heuristic way, by using something
 that is unlikely enough to occur in real code.

 You are right that what I am using might be too
 dangerous for emacs lisp or other lisp dialects, and
 it could also show up in other languages like C.

 What would be safer? [...]


Perhaps it would make sense to let the syntax vary by source language. 
Like, elisp could have something like ;;((def))\n and C something like
/*((def))*/.

Tom Breton



___
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

[Orgmode] Re: org tables and R

2008-12-31 Thread Tom Breton (Tehom)

Dan writes:
 There are more details below. The code is at

 http://www.stats.ox.ac.uk/~davison/software/org-table-R/org-table-R.el

 It would be great to get any feedback on this. My thought was that
 something like this has the potential to provide a unified plotting
 and table formula interface, which might be attractive to people who
 know and/or like and/or want to learn R. There's lots more that could
 be done with this, and there must be all sorts of bugs in it at this
 stage. But if there's any interest in it then it could be
 improved. Anyway, read on if you're interested in hearing more details
 about the options and actions available.

 Dan

Looks like you did a lot of work on this.

 - rownames:integer
Specifies that column n contains the names of the rows of the
table. These must be unique.

For column names, are you interpreting the existing table column name
syntax? (a special leftmost column with ! in it (or ^ or _))
Or no column names?

 - replace:t
The original org-table is replaced by the text output (which will be
an org-table if the result is like a 1- or 2-dimensional array).

Does replace:nil do the opposite?

 - columns:lisp-list
This specifies the columns that the off-the-shelf action will
operate on (e.g. the columns you want to plot). The simplest case
is columns:j, where j is an integer. This could also be written
columns:(j). columns:((1)(2 3)) says that you want a graphic in
which columns 2 and 3 are plotted on the y-axis, and column 1 is
plotted on the x-axis. [...]

You might want to accept column names as well as column numbers.

Tom






___
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] Hook request and patch

2008-12-29 Thread Tom Breton (Tehom)
Motivating incident: I was exporting some files and I wanted to
process a file after I included it.  Using #+INCLUDE I could include
it and I could tell it to use BEGIN_XXX END_XXX so my code could
find it.

But I couldn't process it, because org-export-preprocess-string calls
`org-export-preprocess-hook' before it handles #+INCLUDE.

I didn't want to move org-export-preprocess-hook because for all I
know there's a good reason it comes first.  Similarly for the timing
of #+INCLUDE.

So I ask for a hook that is called after includes are handled.  Diffs
appended.

Another advantage: `org-update-all-dblocks' didn't seem to work in
org-export-preprocess-hook because the working buffer isn't yet in
org-mode when it's called, but works in the new hook.

Tom Breton (Tehom)

*** old-org-exp.el  2008-12-18 18:26:05.0 -0500
--- org-exp.el  2008-12-29 23:10:46.0 -0500
***
*** 297,302 
--- 297,305 
  (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-midprocess-hook nil
+   Hook for processing an export buffer after file inclusions.
+ Run after file inclusions and tree exclusions.)

  (defgroup org-export-translation nil
Options for translating special ascii sequences for the export
backends.
***
*** 1522,1527 
--- 1525,1532 
;; Find matches for radio targets and turn them into internal links
(org-export-mark-radio-links)

+   (run-hooks 'org-export-midprocess-hook)
+
;; Find all links that contain a newline and put them into a
single line
(org-export-concatenate-multiline-links)







___
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] How you can help

2008-10-25 Thread Tom Breton (Tehom)
 possible to write the tests in another file, but then either
tests aren't grouped together (must be run one by one) or you have to
do extra work to group them.  If they're in file, you can run every
test in a package with `rtest:library'.  The other really convenient
way to run a test is rtest:defun-at-point.


 If we can, would we loose quality/speed of tests?

Not at all.


Tom Breton (Tehom)

PS: One more piece of advice: Make an auto-insert or at least a
skeleton that inserts test headers, like the (when (not (fboundp ...
stuff above.  You'll be using it a fair bit, and it's real nice to
have it just automatically be there when you start a new file.  This
advice is geared toward my way of working, though, with the test code
in the same file as the functional code.




___
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