From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package proposal: org-translate Date: Sat, 19 Sep 2020 09:04:52 -0700 Message-ID: <87a6xlkb17.fsf@ericabrahamsen.net> References: <87sgbht2wm.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 19 18:50:30 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJg4D-0005H7-J4 for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 18:50:29 +0200 Original-Received: from localhost ([::1]:39328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJg4C-0002sn-Hf for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 12:50:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJfM9-0002YH-Uo for emacs-devel@gnu.org; Sat, 19 Sep 2020 12:04:57 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:55788 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJfM7-00082B-7G for emacs-devel@gnu.org; Sat, 19 Sep 2020 12:04:57 -0400 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 73407FA035; Sat, 19 Sep 2020 16:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1600531493; bh=Vfx+JeCdGIOPf0dBhCLoP9VWuZhW8Y6+eVuCTEJ3Stk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TXm5lAEmINKQ6ALJ5NFo7admpwaDDqEA0K0ppEdXwdPULFyunVzSAsEQzvdchs2Zk NOhO+oQN4jpGzoVBCUt1c9OmqPxaq3UQVnocReVXMPwdhxjHFsvvBDReiaKv2WiXDX c89Q5pyIqAYQ+CU2rp173rddditvp6Skkb5dMFJA= In-Reply-To: (Stefan Kangas's message of "Sat, 19 Sep 2020 14:03:04 +0000") Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/19 12:04:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256198 Archived-At: Stefan Kangas writes: > Hi Eric, > > Eric Abrahamsen writes: > >> I've added version 0 of a package called org-translate to ELPA, and I'm >> proposing it for release. It's a translation environment based on Org. >> It's not quite a full-on CAT tool, but I suppose has the potential to >> get there. I'm posting the Commentary section from the library below. >> Comments/suggestions/complaints very welcome! > > I am happy to hear a package like this is in the works, as I do and have > done a lot of translating in Emacs. > > I realize this is just a first draft, but I'll just add my thoughts > from trying the package. Thank you very much for testing! > First, I think the Commentary should clearly explain how to set up your > org file and get started. It explains it only abstractly, but > preferably should do so in concrete steps. > > The minor mode documentation should include an overview of the key > bindings. I would also appreciate an overview of the keybindings and > expected workflow in the Commentary section. Yep, others have also mentioned that the docs are lacking, I'll add this first. > `ogt-start-translating' while in an org buffer should just start with > the current org buffer. It works after setting up a bookmark, but I'm > not sure requiring the user to keep a bookmark is the best design > choice. (Also, there is no completion for the bookmarks.) `ogt-start-translating' is really only useful if you're not in the org buffer already, and if you've chosen to use bookmarks. Maybe I should rename it `ogt-open-bookmark' or something. Otherwise, just turning on the minor mode is all you need. You only get completion if you've already bookmarked a translation project -- `start-translating' will only offer bookmarks that represent existing translation projects. > So I set up the bookmark, and now it asks to segment the file. Seems to > work fine, and I get markers in my file (but all the markers say "" > for some reason). Now my file looks like: > > * Original > > In the early hours of 9 September > > The first segment is from after the "l" in "Original" to before "In". > I guess that should rather be ignored. > > If I remove the headline and run `ogt-forward-segment', I see the > following backtrace: I think all this is just a symptom of the mode being unable to identify which subtree is the original text, and which is the translation. I think in that case it should just error out with a helpful message, rather than limping along and segmenting incorrectly. [...] > Saving the file and opening it again, I now see " " in every location > where there previously were markers. Running `ogt-start-translating' > doesn't give a backtrace, but the message: "org-back-to-heading: Before > first headline at position 121 in buffer trans.org" > > So I re-add the "Original" headline and try again, seems to work now and > the characters above are again the markers "". I'm not sure if I'm > supposed to type the text directly in place? I would rather have the > translation text in a separate window, fixed in place and highlighted, > and I'd like to see only the segment I'm currently translating with the > rest of the text highlighted. More like OmegaT or a proper CAT > software. I'm still thinking this is a result of the mode misidentifying the parts of the buffer. Your notes above have just " " and "" where you're talking about the markers -- I'm assuming the actual characters were stripped out on sending. If you get the parts properly identified, I think the mode will behave the way you want it to: source text in one window, translation in another, and the source window follows along as you progress with the translation. > That's basically as far as I got for now. Thanks for test-running what's obviously a half-baked library! I guess I hadn't yet gotten out of my own head and thought about how a new user would approach the code. Step one should be making sure that the buffer contains one top-level heading for each of the source text, translation text, and glossary. Look at the values (and docstrings) of the `ogt-default-{source,translation,glossary}-locator' options to see how to tell the minor mode to locate each subtree. But I'll put all this in the Commentary section later today. Thanks again, Eric