unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Eric Abrahamsen <eric@ericabrahamsen.net>, emacs-devel@gnu.org
Subject: Re: [ELPA] New package proposal: org-translate
Date: Sat, 19 Sep 2020 14:03:04 +0000	[thread overview]
Message-ID: <CADwFkmmigkmNtwq36qvXNeWo8ft+7B73bojBZgVK4SbqqJrB5g@mail.gmail.com> (raw)
In-Reply-To: <87sgbht2wm.fsf@ericabrahamsen.net>

Hi Eric,

Eric Abrahamsen <eric@ericabrahamsen.net> 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



  reply	other threads:[~2020-09-19 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  4:58 [ELPA] New package proposal: org-translate Eric Abrahamsen
2020-09-19 14:03 ` Stefan Kangas [this message]
2020-09-19 16:04   ` Eric Abrahamsen
2020-09-19 21:24     ` Eric Abrahamsen
2020-09-19 21:24     ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmmigkmNtwq36qvXNeWo8ft+7B73bojBZgVK4SbqqJrB5g@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=eric@ericabrahamsen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).