zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: PATCH: parse from even deeper in hell
Date: Mon, 23 Feb 2015 12:36:07 +0000	[thread overview]
Message-ID: <20150223123607.4f4d5097@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAHYJk3R-K=WX=L4qPD207wZaxoE1K-gGxbaywujhTjzXv0fe9w@mail.gmail.com>

On Mon, 23 Feb 2015 12:35:51 +0100
Mikael Magnusson <mikachu@gmail.com> wrote:
> I figured out that when we assign lineptr after fiddling with it, we
> also need to update start, it records the location of *lineptr on
> entry to the function, and is used to calculate things later on. With
> that addition, the unmetafy + metafy mostly works. insert-last-word
> still gets "stuck" on words that came from the old metafication and
> starts over from the end of history, leaving the old word in place.

What's the line this happens with?  Is it the same as the one that
originally failed?

I wonder if it's getting information by some other path, though it seems
strange the last word wouldn't come from the bit we've apparently fixed
up.

> Indeed fc -l lists this line differently still, even though it appears
> correctly in zle.
> 10673* echo mp3info 好きになり\M-c\M-^Aい.mp3
> 10675* echo mp3info 好きになりたい.mp3

That suggests this is indeed a different code path to the one that got
fixed --- it sounds like the same line entered in a new shell is OK so
it can only be that there's some bit of the history that's not fixed.
So we may need the equivalent earlier or elsewhere in addition; the
former would be better.

> This is with the following code, which fixes(?) all the errors and
> seems to make things work pretty well. However, even doing the remeta
> unconditionally, I still get the above result with fc -l and
> insert-last-word. It also happens, unsurprisingly, if I don't use
> hist_lex_words.

That's yet another pointer that the code needs to go elsewhere.

> If I accept a line recalled in this way, the new
> history entry is saved correctly and works fine in new shells.
> 
>     for (ptr = lineptr; *ptr; ptr++)
>         if (*ptr != Meta && imeta(*ptr)) {
>             remeta = 1;
>             break;
>         }
>     if (remeta) {
>         unmetafy(lineptr, &remeta);
>         start = lineptr = metafy(lineptr, remeta, META_USEHEAP);
>     }

That looks an entirely reasonable fix for the problem, if we can work
out what's still wrong and move things around.

At worst, ensuring the file gets completely written out from scratch
(turning off INC_APPEND_HISTORY) should fix things for subsequent
shells, whether new or old.

pws


  reply	other threads:[~2015-02-23 12:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 10:13 Peter Stephenson
2015-02-19 21:47 ` Mikael Magnusson
2015-02-19 22:03   ` Peter Stephenson
2015-02-20  3:16     ` Mikael Magnusson
2015-02-20  3:22       ` Mikael Magnusson
2015-02-20  3:33         ` Mikael Magnusson
2015-02-20  3:43           ` Mikael Magnusson
2015-02-20  4:19             ` Ray Andrews
2015-02-20  9:54               ` Peter Stephenson
2015-02-20 10:00             ` Peter Stephenson
2015-02-20 10:12               ` Mikael Magnusson
2015-02-22 18:26                 ` Peter Stephenson
2015-02-23  9:54                   ` Peter Stephenson
2015-02-23 10:11                     ` Peter Stephenson
2015-02-23 11:35                       ` Mikael Magnusson
2015-02-23 12:36                         ` Peter Stephenson [this message]
2015-02-23 12:57                           ` Peter Stephenson
2015-02-23 13:38                             ` Mikael Magnusson
2015-02-23 13:46                               ` Mikael Magnusson
2015-02-23 13:51                                 ` PATCH: Remeta one frame earlier Mikael Magnusson
2015-02-23 13:58                                   ` Peter Stephenson
2015-02-23 14:05                                   ` Peter Stephenson
2015-02-23 14:32                                     ` Mikael Magnusson
2015-02-23 17:32                                       ` Peter Stephenson

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

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

  git send-email \
    --in-reply-to=20150223123607.4f4d5097@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).