From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package proposal: org-translate Date: Sat, 19 Sep 2020 14:03:04 +0000 Message-ID: References: <87sgbht2wm.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4260"; mail-complaints-to="usenet@ciao.gmane.io" To: Eric Abrahamsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 19 16:04:48 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 1kJdTr-0000yP-Hl for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 16:04:47 +0200 Original-Received: from localhost ([::1]:51024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJdTq-00081S-Kp for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 10:04:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJdSJ-0007FI-Qo for emacs-devel@gnu.org; Sat, 19 Sep 2020 10:03:11 -0400 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:32831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJdSH-0008AR-RV for emacs-devel@gnu.org; Sat, 19 Sep 2020 10:03:11 -0400 Original-Received: by mail-ej1-x632.google.com with SMTP id j11so11894318ejk.0 for ; Sat, 19 Sep 2020 07:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to; bh=5LCZ87eOkCYcZox73jWW2W6RzfmilyRNUG8yXWyqPKo=; b=JRmgG2X3VyVd7aWtJJx7FB+4P2t8rP6exOj9EINGfrxht/f6XjXhS50udqkV9JtPHf VmlMI3FgVX4U8kUE3m94XN+PqMFupTTfb3tx+ZEcNHpVseHZGTvVgUg03yobKFbYvEx1 iOk4IVnoJrx+YCFUGruvpj9WtD4da/Nf4Fa+hfGrgc0zbxC8LWvkRchBdmJuBtXkMWJC ZsWF72DiLmD6TbzMeZVKMFrPUvpM7mR7BmvEHgtBZM6h9GPmafqwjO8rGht1P0c6UBXG d7Soz98202M8ZKB2E1POeHW8GucURBmud+728ob+9g99Et8LDzIh9OHlOPrIxxnnWChV S18Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=5LCZ87eOkCYcZox73jWW2W6RzfmilyRNUG8yXWyqPKo=; b=oObE61s2zKNY/mkdrEH9TQXypmcB+ktZPcwZJVSwn+X/KuabmVj/xeRONFdw8V1erb 7G8+brfYv8AGISQgsceXheQCdrOlmDY24V9yEhyouD12jPEDtxkq2TOPOrm7pSrRWS4e QhiWbF21JXLHxK/8sDMZo7Qrs9Ey+z5NI2nu5+eIk+1AOVzi+K8zELcnzYHcbtLggdgY YYsXJbPHfXPLlap7wtRce9uEV4n0EA5oKIlH8aSxqc7QavTRuE2WeM3o5bNyVtxEarAU 8oidNZ1W1j/wnBcflnZwPRBbfG0PqvhTeywD+V+fysEX8EJM2QkWieuSaC4mid9hajGy WxBg== X-Gm-Message-State: AOAM53115nlA1GuVTsyNPcW7LXfSAEOmf35iBh+Njo4oNP2E74Hbxm2Q DvsLIjMRsyp0q6WCzkZaqHqqig/GE4QR18h7eRlTnEiw X-Google-Smtp-Source: ABdhPJxkODGu4mGKghZ4lvuIp7XcOmGvf12/zIUi8za560IOgFSOAOKuuVu1aRmpz6g/C2m0rYGsPCNACZzRrm+0kmg= X-Received: by 2002:a17:906:7248:: with SMTP id n8mr40662546ejk.160.1600524185030; Sat, 19 Sep 2020 07:03:05 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 19 Sep 2020 14:03:04 +0000 In-Reply-To: <87sgbht2wm.fsf@ericabrahamsen.net> Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=stefankangas@gmail.com; helo=mail-ej1-x632.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:256168 Archived-At: 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. 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. `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.) 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: goto-char(nil) (progn (select-window (car save-selected-window--state) 'norecord) (goto-char ogt-probable-source-location) (re-search-forward (string ogt-segmentation-character) nil t arg) (set-marker ogt-probable-source-location (point)) (ogt-highlight-source-segment) (recenter)) (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (goto-char ogt-probable-source-location) (re-search-forward (string ogt-segmentation-character) nil t arg) (set-marker ogt-probable-source-location (point)) (ogt-highlight-source-segment) (recenter)) (internal--after-with-selected-window save-selected-window--state)) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (goto-char ogt-probable-source-location) (re-search-forward (string ogt-segmentation-character) nil t arg) (set-marker ogt-probable-source-location (point)) (ogt-highlight-source-segment) (recenter)) (internal--after-with-selected-window save-selected-window--state))) (let ((save-selected-window--state (internal--before-with-selected-window ogt-source-window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (goto-char ogt-probable-source-location) (re-search-forward (string ogt-segmentation-character) nil t arg) (set-marker ogt-probable-source-location (point)) (ogt-highlight-source-segment) (recenter)) (internal--after-with-selected-window save-selected-window--state)))) (if (marker-position ogt-probable-source-location) (let ((save-selected-window--state (internal--before-with-selected-window ogt-source-window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (goto-char ogt-probable-source-location) (re-search-forward (string ogt-segmentation-character) nil t arg) (set-marker ogt-probable-source-location (point)) (ogt-highlight-source-segment) (recenter)) (internal--after-with-selected-window save-selected-window--state)))) (ogt-update-source-location)) ogt-forward-segment(1) funcall-interactively(ogt-forward-segment 1) command-execute(ogt-forward-segment) 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. That's basically as far as I got for now. Thanks again for working on this. Best regards, Stefan Kangas