From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Implemented word count for subtrees Date: Thu, 28 Apr 2011 09:34:35 +0100 Message-ID: <87oc3qg4f8.fsf@ucl.ac.uk> References: <867hal4a6t.wl%simon.guest@tesujimath.org> <87iptzoa5x.fsf@ucl.ac.uk> <86zknb9v1y.wl%simon.guest@tesujimath.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFMgP-0006PL-O4 for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 04:34:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFMgO-0004Gs-OF for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 04:34:45 -0400 Received: from vscane-a2.ucl.ac.uk ([144.82.108.42]:46776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFMgO-0004GU-F5 for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 04:34:44 -0400 In-Reply-To: <86zknb9v1y.wl%simon.guest@tesujimath.org> (Simon Guest's message of "Thu, 28 Apr 2011 10:41:13 +1200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Simon Guest Cc: emacs-org list 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 :wcNNNN:? 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)