From: "Jérémy Compostella" <jeremy.compostella@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] window.el: Improve mark management
Date: Fri, 20 Jan 2012 17:52:51 +0100 [thread overview]
Message-ID: <CA+TATJFFaBm=2s_9MHjaaHZ-K8K17xdc_px35fqFd=NrKuR32A@mail.gmail.com> (raw)
In-Reply-To: <jwvwr8mo5o6.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2084 bytes --]
2012/1/20 Stefan Monnier <monnier@iro.umontreal.ca>
> > into account the previously set mark(s). It looks better to use
> > `push-mark' instead of `set-mark'. Moreover it does not restore the
> > active mark state which lead to an automatically active mark in
> > restored buffer.
>
> `push-mark' is wrong if nothing happened between window-state-get and
> window-state-put.
>
I do agree but the use of set-mark leads to the lost of the potential
previous mark.
Maybe I could just add a control like call `push-mark' only if current if
current mark
is not equal to the saved one.
> And the mark & mark-active are buffer-local but not window-local.
> If we window-state-get in a frame which shows the same buffer several
> times, window-state-put would end up pushing the same mark several times.
That was more of less the subject of my previous thread ("[PATCH]
window.el: Remove mark saving and restoring")
that I cancel to have time to think about it a little bit more. The
proposition was to remove the mark
stuff (I did provide a patch for this) that looks not relevant in the
`window-state-get' and
`window-state-put'. However but thinking more about it I figured out that
somebody could want the mark restored.
> I'm not completely sure. The current code doesn't seem that bad since,
> as you say, it basically reproduces the behavior of
> window-configurations.
> So I'd like to first hear of what are concrete cases where the current
> behavior is a problem.
It's very simple : with the current code, when you call the
`window-state-put' function, the mark is restored as active.
In conclusion I think we have to make a choice:
- Either, we accept the idea that the mark is restored and we should take
care of its active state, avoid the previous
potential mark loss and do not push-mark when the current `mark' is equal
to the saved one.
- Either, remove all the mark stuff from `window-state-get' and
`window-state-put' functions.
- Other ?
I have patch almost ready for these two proposals so let me know.
Jérémy
[-- Attachment #2: Type: text/html, Size: 2936 bytes --]
next prev parent reply other threads:[~2012-01-20 16:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-19 19:43 [PATCH] window.el: Improve mark management Jérémy Compostella
2012-01-20 10:01 ` martin rudalics
2012-01-20 13:42 ` Stefan Monnier
2012-01-20 15:13 ` martin rudalics
2012-01-20 16:11 ` Stefan Monnier
2012-01-20 16:52 ` Jérémy Compostella [this message]
2012-01-20 18:25 ` Stefan Monnier
2012-01-21 14:36 ` Jérémy Compostella
2012-01-24 20:31 ` Stefan Monnier
2012-01-25 10:32 ` martin rudalics
2012-01-25 13:45 ` Stefan Monnier
2012-01-25 15:01 ` Jérémy Compostella
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='CA+TATJFFaBm=2s_9MHjaaHZ-K8K17xdc_px35fqFd=NrKuR32A@mail.gmail.com' \
--to=jeremy.compostella@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.