Re: [O] Implemented word count for subtrees
El Thu, 28 Apr 2011 09:53:17 +0200 Sébastien Vauban va escriure: > > Another suggestion: a variable to choose between a word-count and a > line-count? > Or page-count. With a rough estimator that can predict how many pages each section would take. (Maybe even invoking LaTeX?) This feature is the one I most missed when I had to write a thesis where each section had to have a known number of pages (e.g. introduction 1 page, chapter 1 10 pages, … total 60 pages). I see it as useful enough to go in /contrib/ Many thanks!
Re: [O] Implemented word count for subtrees
Sébastien Vauban writes: > Hi Simon, > > Simon Guest wrote: >> Dear Org mode people, >> >> I implemented word counting for Org mode sub-trees. That is, count >> each sub-tree, and accumulate totals into the parent heading lines. >> Others have asked about this, so I attach my code below. > > Another suggestion: a variable to choose between a word-count and a > line-count? Or display both at the same time? =NNN/MM=? -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.209.g1a687)
Re: [O] Implemented word count for subtrees
Simon Guest writes: > At Wed, 27 Apr 2011 18:51:06 +0100, > Eric S Fraga wrote: >> This is quite nice. Thanks! >> > >> I cannot help you with the mark problem; hopefully others can. >> >> One suggestion, however: I wonder if you could introduce the word count >> in a different way? I do use my headings and having the dots and the >> actual count inserted is not great (although easy work around: >> org-wc-display and then undo immediately after looking at the >> counts...). Maybe you could automatically define a tag for each >> heading, something like :wc:? Of course, this won't be good for >> anybody that wishes to export documents *with* tags... >> >> Anyway, I've incorporated your code into my emacs configuration. Thanks >> again! > > Hi Eric, > > Thanks for your comments. > > The counts are not actually inserted as text in the file. It's just > an overlay, done with text properties like the clock durations (from > where I stole the code). They don't get saved in the file, and in > fact as soon as you edit the buffer, they all disappear. At least, > they do for me. > > Does it do something different for you? If so, it may be something to > do with the file coding system that is letting them get saved. Is > your Org mode file a simple ASCII file, or something else? Ah, I see that the counts do disappear as soon as I do anything. My confusion came about because as soon as I invoke =org-wc-display=, my buffer becomes /modified/ which led me believe that the counts were actually inserted into the document.As they are not inserted, please ignore my previous comments. However, it would be helpful if the modification flag were not changed by asking for the word count. I don't know enough elisp to suggest what to change but you should be able to add the text properties without causing the buffer modification flag to change? Column view, for instance, doesn't do this. Thanks again, eric -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.209.g1a687)
Re: [O] Implemented word count for subtrees
Hi Simon, Simon Guest wrote: > Dear Org mode people, > > I implemented word counting for Org mode sub-trees. That is, count > each sub-tree, and accumulate totals into the parent heading lines. > Others have asked about this, so I attach my code below. Another suggestion: a variable to choose between a word-count and a line-count? Just thinking at that because of the Org-clone in VIM... Best regards, Seb -- Sébastien Vauban
Re: [O] Implemented word count for subtrees
At Wed, 27 Apr 2011 18:51:06 +0100, Eric S Fraga wrote: > This is quite nice. Thanks! > > I cannot help you with the mark problem; hopefully others can. > > One suggestion, however: I wonder if you could introduce the word count > in a different way? I do use my headings and having the dots and the > actual count inserted is not great (although easy work around: > org-wc-display and then undo immediately after looking at the > counts...). Maybe you could automatically define a tag for each > heading, something like :wc:? Of course, this won't be good for > anybody that wishes to export documents *with* tags... > > Anyway, I've incorporated your code into my emacs configuration. Thanks > again! Hi Eric, Thanks for your comments. The counts are not actually inserted as text in the file. It's just an overlay, done with text properties like the clock durations (from where I stole the code). They don't get saved in the file, and in fact as soon as you edit the buffer, they all disappear. At least, they do for me. Does it do something different for you? If so, it may be something to do with the file coding system that is letting them get saved. Is your Org mode file a simple ASCII file, or something else? cheers, Simon
Re: [O] Implemented word count for subtrees
Simon Guest writes: > Dear Org mode people, > > I implemented word counting for Org mode sub-trees. That is, count > each sub-tree, and accumulate totals into the parent heading lines. > Others have asked about this, so I attach my code below. This is quite nice. Thanks! I cannot help you with the mark problem; hopefully others can. One suggestion, however: I wonder if you could introduce the word count in a different way? I do use my headings and having the dots and the actual count inserted is not great (although easy work around: org-wc-display and then undo immediately after looking at the counts...). Maybe you could automatically define a tag for each heading, something like :wc:? Of course, this won't be good for anybody that wishes to export documents *with* tags... Anyway, I've incorporated your code into my emacs configuration. Thanks again! -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.211.gb0094)