all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Aaron S. Hawley" <aaron.s.hawley@gmail.com>
Subject: bug#7138: 24.0.50; Markers lost with minibuffer completion
Date: Fri, 01 Oct 2010 01:13:21 +0200	[thread overview]
Message-ID: <jwv1v8avpjv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <AANLkTinZ_FCKQfT+T6UKnqTGW5C631Znnn6z1F1CR09M@mail.gmail.com> (Aaron S. Hawley's message of "Thu, 30 Sep 2010 11:42:24 -0400")

> I've found that setting markers with C-SPC in the minibuffer for C-x
> C-f and then completing some file name with TAB, the markers will be
> deleted and so C-u C-SPC won't work.  This is a corner case of
> completion and markers, but seems like it should be done right.  I
> have proposed a patch.

Looks pretty good, thank you.

> The comment in the function I changed suggests that marks should be
> preserved.  That doesn't seem to be the case at all.

It is talking about surrounding markers, not markers within the
replaced text.  Your patch changes the code to "delete first and insert
afterwards", which is not as good w.r.t preserving surrounding markers
(because after the delete, the markers that were after and before the
deleted text end up together and the subsequent insert can't tell which
to push to which side).

> +    (if (numberp pos)
> +        (setq pos (1- (abs pos)))
> +      (setq pos 0))

Aka  (setq pos (if (numberp pos) (1- (abs pos)) 0))

In any case, I've installed in the emacs-23 branch a slightly different
change, which additionally tries to find a common suffix.
Thanks,


        Stefan





      reply	other threads:[~2010-09-30 23:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30 15:42 bug#7138: 24.0.50; Markers lost with minibuffer completion Aaron S. Hawley
2010-09-30 23:13 ` Stefan Monnier [this message]

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=jwv1v8avpjv.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=aaron.s.hawley@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.