From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?J=E9r=E9my_Compostella?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] window.el: Improve mark management Date: Fri, 20 Jan 2012 17:52:51 +0100 Message-ID: References: <87zkdjtr4v.fsf@Apollo.jerryland.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04478797275be204b6f88418 X-Trace: dough.gmane.org 1327078410 4553 80.91.229.12 (20 Jan 2012 16:53:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2012 16:53:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 20 17:53:26 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RoHiN-0002G5-VL for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2012 17:53:24 +0100 Original-Received: from localhost ([::1]:40570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHiN-0000Hm-ID for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2012 11:53:23 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHiF-0000Gz-40 for emacs-devel@gnu.org; Fri, 20 Jan 2012 11:53:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoHiD-0000M0-Kw for emacs-devel@gnu.org; Fri, 20 Jan 2012 11:53:15 -0500 Original-Received: from mail-tul01m020-f169.google.com ([209.85.214.169]:54798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHiD-0000Ll-B8 for emacs-devel@gnu.org; Fri, 20 Jan 2012 11:53:13 -0500 Original-Received: by obbta7 with SMTP id ta7so1210632obb.0 for ; Fri, 20 Jan 2012 08:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=4cMVE3K7eLMEBWpDmthlHzxjoVSRJieQ1nfg5HhK+6k=; b=bjoGPIep1fbUd8EKfKezm6v2iAiC/FW+yeFJeBvKHyWMKOhksMtHvsF240FcyuR/uv kkKBv46ya9t93BnbEBbAE4DAQgXRRVudeJKwZep/RICi578gD7eG5AGLHYRra0ps31ZI n+BrsKpsrbEq1Dm9ZjMJPQjfaOhAaZD2skyNI= Original-Received: by 10.182.76.135 with SMTP id k7mr251978obw.62.1327078392159; Fri, 20 Jan 2012 08:53:12 -0800 (PST) Original-Received: by 10.60.49.103 with HTTP; Fri, 20 Jan 2012 08:52:51 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147780 Archived-At: --f46d04478797275be204b6f88418 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2012/1/20 Stefan Monnier > > 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=E9r=E9my --f46d04478797275be204b6f88418 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2012/1/20 Stefan Monnier <<= a href=3D"mailto:monnier@iro.umontreal.ca" target=3D"_blank">monnier@iro.um= ontreal.ca>
> into account the previously set mark(s). It looks better to use > `push-mark' instead of `set-mark'. Moreover it does not restor= e 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 l= eads to the lost of the potential previous mark.
Maybe I could ju= st add a control like call `push-mark' only if current if current mark<= /div>
is not equal to the saved one.
=A0
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 =A0my previous thread = ("[PATCH] window.el: Remove mark saving and restoring")
that I cancel to have=A0time to think about it a little bit more. The propo= sition 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 th= inking more about it I figured out that somebody could want the mark restor= ed.