Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / 11 / fb8a90c6c90ed261aa0366a874d42e231c66ce
1 Return-Path: <dmitry.kurochkin@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 392AB429E25\r
6         for <notmuch@notmuchmail.org>; Tue, 24 May 2011 15:16:02 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id DiVeIBgPkrLn for <notmuch@notmuchmail.org>;\r
17         Tue, 24 May 2011 15:16:01 -0700 (PDT)\r
18 Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
19         [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 2E028431FB6\r
22         for <notmuch@notmuchmail.org>; Tue, 24 May 2011 15:16:01 -0700 (PDT)\r
23 Received: by fxm8 with SMTP id 8so5348794fxm.26\r
24         for <notmuch@notmuchmail.org>; Tue, 24 May 2011 15:16:00 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=domainkey-signature:from:to:subject:in-reply-to:references\r
27         :user-agent:date:message-id:mime-version:content-type;\r
28         bh=RkmiHTrFufFWBbh+jjK0wYrcVEsmck/G3uqXBvALaUg=;\r
29         b=C07OBUo7veewdxkFdhaSaCseoaWFlq1UNuR+33XQddDWrD81DFyABEOEae/I6s4M0e\r
30         wrMyhA4lx9CHetnod2Nn+CX0zMBipakUpe9ZtoVRRkdPz0PQNKbLeRkMs7zfoMbvSOnd\r
31         qcU4UYiX5wFRQxf2yLi9aJ3tfWEAWLF7EqiTw=\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
33         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
34         :mime-version:content-type;\r
35         b=BzQ+LCDbWcy3sOEGreFm6hyGB/aCwMiEviPZYZ4mGx6kmXUwFX3+N42SeTYRDgbErt\r
36         VybAhymjSuk3cXYPUviV0SRPC83KkoZEtFiR8iR8FO3QzwDB5MbMC+lMyxfRLHDCiSrm\r
37         zrPVjItyKC+hex0zAng/vf7TNqSY9HE+FUYDE=\r
38 Received: by 10.223.158.72 with SMTP id e8mr4143637fax.39.1306275343345;\r
39         Tue, 24 May 2011 15:15:43 -0700 (PDT)\r
40 Received: from localhost ([91.144.186.21])\r
41         by mx.google.com with ESMTPS id b17sm2878653fab.47.2011.05.24.15.15.42\r
42         (version=TLSv1/SSLv3 cipher=OTHER);\r
43         Tue, 24 May 2011 15:15:42 -0700 (PDT)\r
44 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
45 To: Carl Worth <cworth@cworth.org>, notmuch@notmuchmail.org\r
46 Subject: Re: [PATCH] Save and restore point explicitly in\r
47         `notmuch-wash-toggle-invisible-action'.\r
48 In-Reply-To: <87oc2rvjvj.fsf@yoom.home.cworth.org>\r
49 References: <1306090675-26982-1-git-send-email-dmitry.kurochkin@gmail.com>\r
50         <1306164587-20326-1-git-send-email-dmitry.kurochkin@gmail.com>\r
51         <87oc2rlujb.fsf@yoom.home.cworth.org> <8762ozrfrr.fsf@gmail.com>\r
52         <87oc2rvjvj.fsf@yoom.home.cworth.org>\r
53 User-Agent: Notmuch/0.5-216-g0104e23 (http://notmuchmail.org) Emacs/23.3.1\r
54         (x86_64-pc-linux-gnu)\r
55 Date: Wed, 25 May 2011 02:16:06 +0400\r
56 Message-ID: <871uznrbh5.fsf@gmail.com>\r
57 MIME-Version: 1.0\r
58 Content-Type: text/plain; charset=us-ascii\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Tue, 24 May 2011 22:16:02 -0000\r
72 \r
73 On Tue, 24 May 2011 15:01:04 -0700, Carl Worth <cworth@cworth.org> wrote:\r
74 > On Wed, 25 May 2011 00:43:20 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
75 > > Now, looking at Emacs source code, save_excursion_save() uses\r
76 > > point_marker() to save the point.  As you said above, markers are\r
77 > > updated when the corresponding text is updated.  That explains why the\r
78 > > cursor jumps when using `save-excursion'.\r
79 > > \r
80 > > On the other hand, `point' returns position as an integer.  Which is\r
81 > > just what we need.\r
82\r
83 > Ah. So that explains why your patch is actually making a difference.\r
84\r
85 > But I've usually had "jumping cursor" problems when using an integer,\r
86 > (and switching to a marker fixes it). For example, imagine the following\r
87 > operation:\r
88\r
89 >       User positions cursor on some word\r
90 >       Our code saves point as an integer\r
91 >       Some operation inserts new text before point\r
92 >       Our code restores the cursor to the saved integer\r
93\r
94 > This sequence restores point to the same integer position in the buffer,\r
95 > but logically makes the cursor appear to "jump" to the user, (since the\r
96 > cursor will no longer be on the word it was on before but will now be\r
97 > earlier in the buffer).\r
98\r
99 > The fix for the above is to switch from an integer to a marker.\r
100\r
101 \r
102 Ah, I see now.\r
103 \r
104 > So I'm curious to know the case you're hitting where you getbetter\r
105 > behavior by switching from a marker to an integer. Can you describe it\r
106 > in a bit more detail?\r
107\r
108 \r
109 I did not find a better way to update the button label than to:\r
110 \r
111 1. insert the new label\r
112 2. move the button overlay from the old label to the new one\r
113 3. remove the old label\r
114 \r
115 When a user clicks the button, the cursor is somewhere inside the old\r
116 label.  If we save the point as a marker, after step 3 it would end up\r
117 at the position where the old label was.  If the new label is inserted\r
118 before the old one, that means after the new label.  So the cursor jumps\r
119 from inside the button to the position after the button.  Since the new\r
120 button is placed at the same position where the old one was, restoring\r
121 the point to the same offset it was at the beginning works as we need.\r
122 \r
123 Regards,\r
124   Dmitry\r
125 \r
126 > -Carl\r
127 Non-text part: application/pgp-signature\r