From mboxrd@z Thu Jan 1 00:00:00 1970 From: ross@rosslaird.com (Ross A. Laird) Subject: Uniquely url-ify sentences? Date: Sat, 05 Mar 2011 11:38:11 -0800 Message-ID: <87tyfhfjdo.fsf@rosslaird.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=45110 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvxJG-0000bL-ST for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 14:38:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvxJE-0006T2-4w for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 14:38:38 -0500 Received: from lo.gmane.org ([80.91.229.12]:56262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvxJD-0006Sf-OC for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 14:38:36 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PvxJA-0005nJ-EB for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 20:38:32 +0100 Received: from h24-207-61-79.dlt.dccnet.com ([24.207.61.79]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Mar 2011 20:38:32 +0100 Received: from ross by h24-207-61-79.dlt.dccnet.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Mar 2011 20:38:32 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Although most users of orgmode and emacs seem to be members of the programming world, a few professional writers also use these tools (and I cannot imagine why everyone else uses Word...). As a writer and non-programmer, I have a task that is probably very simple for a programmer but seems a bit complicated to me. It's something that could be done in many different ways, but I'd like to do it in orgmode/emacs with the simplest possible workflow. Here's the situation: I have a narrative manuscript. I'd like to post one sentence from this manuscript every day as a tweet with a link back to the sentence (and then show the previous and next paragraphs of the manuscript on the page that is linked from the tweet). The manuscript is in an org file (I also have a version in LaTeX). Given my limited knowledge, I imagine I could do this with a macro in emacs: 1. From the beginning of the first sentence, search to dot-then-space (or zap to dot, or something similar). 2. Insert line break (or move sentence into another buffer). 3. Go to end of sentence and insert unique link anchor (main url plus incremented line number or part of sentence or something similar). 4. Use the list of sentences with links as daily tweets. This type of macro workflow would probably work, with some fiddling, but I find that with macros there is always something to mess up the workflow at some point. For example, in this case, there may be some situation in which dot-space does not define the sentence precisely (ellipses, say, or a sentence that ends with an exclamation). I predict this will happen (it seems to happen every time with macros), and I wonder if I should try some other approach. What do you think might be the best way to do this? Is there a way to uniquely url-ify sentences? If so, I could just create a second version of the manuscript and url-ify the whole thing in one step. All I really need is to create a unique anchor (#) for each sentence. The main url can be consistent through the whole thing. Feedback and suggestions most welcome. Ross -- Ross A. Laird, PhD www.rosslaird.com