all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Carlos Pita <carlosjosepita@gmail.com>
Cc: 19650@debbugs.gnu.org, Fabian Ezequiel Gallina <galli.87@gmail.com>
Subject: bug#19650:
Date: Thu, 12 Mar 2015 21:19:41 -0400	[thread overview]
Message-ID: <jwvr3stsob0.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <jwvpp8eujc3.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Thu, 12 Mar 2015 15:10:56 -0400")

> 1) Changing insert for insert-before-markers is problematic because it
> somehow wreaks havoc with font locking. I guess some other markers are
> being moved around besides he-string-end, maybe the one pointing to
> the end of the prompt or something like that (since everything gets
> colored the same the prompt is). Moreover, the he-string-beg marker
> would still point to the wrong place no matter what its type were.

Indeed, the issue is not "insert-before" vs "insert-after" but that we
delete+insert the exact same text, so the markers should simply not
move, but Emacs can't know that.

Basically, the delete+insert only changes the text's properties, so "the
right way" to fix this is to not delete and not insert, but instead to
take the result string, extract its text-properties and apply them
carefully to the corresponding of the buffer, so as not to affect
any marker.

Another "right way" is to do the font-locking "in situ" instead of doing
it in a side buffer.  This would be good, but IIUC it's not as
straightforward as it sounds.

> 3) Same as (2) above, but saving/restoring the *positions*  of both
> he-string-beg and he-string-end. This is the best solution I could
> figure out till now. Take a look at the attached patch, please.
> What do you think?

I think it's hideous, but maybe it's OK as a temporary workaround.
I'll let Fabian decide if he wants it in his code.  But if he accepts
it, the code should have some extra comments explaining what's going on.


        Stefan





  parent reply	other threads:[~2015-03-13  1:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 22:47 bug#19650: 25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand Carlos Pita
2015-01-22 16:42 ` bug#19650: Carlos Pita
     [not found]   ` <jwvpp8eujc3.fsf-monnier+emacsbugs@gnu.org>
2015-03-13  1:19     ` Stefan Monnier [this message]
2015-02-02 19:29 ` bug#19650: Carlos Pita
2015-02-08  3:28 ` bug#19650: 25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand Fabián Ezequiel Gallina
     [not found] ` <handler.19650.D19650.142336612525392.notifdone@debbugs.gnu.org>
2015-02-09 14:12   ` bug#19650: closed (25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand) Carlos Pita
2015-02-10  2:45 ` bug#19650: 25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand Fabián Ezequiel Gallina

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=jwvr3stsob0.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=19650@debbugs.gnu.org \
    --cc=carlosjosepita@gmail.com \
    --cc=galli.87@gmail.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.