unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: textconv.c
Date: Sun, 12 Feb 2023 16:32:16 +0200	[thread overview]
Message-ID: <83ilg7gdjj.fsf@gnu.org> (raw)
In-Reply-To: <87k00nyo60.fsf@yahoo.com> (message from Po Lu on Sun, 12 Feb 2023 22:05:27 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Sun, 12 Feb 2023 22:05:27 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Please move the code which manipulates buffer text and the gap to
> > insdel.c.  And I don't really understand why you needed to add
> > copy_buffer, since we already have insert_from_buffer and copy_text.
> >
> > The rest (textconv_query) should go to some existing file(fns.c,
> > perhaps?).  There's no justification for a new file for such a little
> > code.
> >
> > Thanks.
> 
> That code is going to be significantly expanded in the feature/android
> branch, so I expect it will become much larger (and definitely worth its
> own file.)

I don't see how this changes the situation in any significant way.  If
and when we see that the added stuff is too large, we can then decide
to split some of it.  But not in advance, and we are not there yet.

> `insert_from_buffer' inserts text into a buffer, instead of copying out
> of a buffer

I don't see why this is important, since you can switch the buffer
temporarily.  We do this all over the place, since insdel.c always
works on the current buffer.

> and `copy_text' seems to not handle the gap nor work on character
> positions.

Look at its callers, and you will see how that part is done.  In a
nutshell, you prepare the gap in advance, and then call copy_text.

> There will be many more changes on the feature/android branch, since
> Android input methods more or less can't work without the ability to
> perform arbitrary modifications to buffer text, and the ability to
> obtain buffer contents and the position of the point in the buffer being
> displayed.

[lots of details omitted]

And you intended to produce code which supports this without any
discussions of the architecture and design?  I'm surprised, to say the
least.  This has to be discussed, with the participation of everyone
on board who knows about the Emacs internals related to these issues.
We have here a significant amount of knowledge, expertise, and past
experience with similar issues, and disregarding that and trying to
solve this by your lone self is at the very least unwise.

My suggestion is that you describe the problem(s), i.e. what these
input methods expect from the client application, in enough detail
that will allow people here think about it and suggest solutions.
Please don't write even a single line of code before such a
description is posted and people have enough time to respond with
suggestions, ideas, and questions.  (I have already a couple of ideas,
but will withhold them until I'm convinced that I understand the
problems to be solved.)

P.S. And please start a thread with a new, more meaningful name when
you post those details.

Thanks.



  reply	other threads:[~2023-02-12 14:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12 12:58 textconv.c Eli Zaretskii
2023-02-12 14:05 ` textconv.c Po Lu
2023-02-12 14:32   ` Eli Zaretskii [this message]
2023-02-12 15:06     ` textconv.c Eli Zaretskii
2023-02-12 15:35       ` textconv.c Po Lu
2023-02-12 15:27     ` Android input methods (was: Re: textconv.c) Po Lu
2023-02-12 15:57       ` Eli Zaretskii
2023-02-13  2:21         ` Android input methods Po Lu
2023-02-13 13:49           ` Eli Zaretskii
2023-02-13 14:37             ` Po Lu
2023-02-13 15:17               ` Eli Zaretskii
2023-02-13 17:04                 ` Eli Zaretskii
2023-02-14  1:57                 ` Po Lu
2023-02-14 14:32                   ` Eli Zaretskii
2023-02-14 15:14                     ` Po Lu
2023-02-14 17:01                       ` Eli Zaretskii
2023-02-15  2:13                         ` Po Lu
2023-02-12 16:00       ` Android input methods (was: Re: textconv.c) Lynn Winebarger

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=83ilg7gdjj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /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).