From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: How is text properties stored? Date: Thu, 9 May 2019 16:26:42 -0400 Message-ID: <5EA156D7-EF8A-42C1-AEB2-4A97ADCE74CF@gmail.com> References: <25202F5C-FE09-49D9-8782-5E9D013E0262@gmail.com> <934D9111-CDF3-4076-8F1D-2EC85276B098@gmail.com> <83ftpogp6k.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_9DE04636-B1E5-42F7-91A2-518CC40D7D0D" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="115025"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 09 22:27:08 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOpdD-000ToW-Kz for ged-emacs-devel@m.gmane.org; Thu, 09 May 2019 22:27:07 +0200 Original-Received: from localhost ([127.0.0.1]:60559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOpdC-0005Dv-Ie for ged-emacs-devel@m.gmane.org; Thu, 09 May 2019 16:27:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOpd3-0005Df-HA for emacs-devel@gnu.org; Thu, 09 May 2019 16:26:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOpd2-0003tt-In for emacs-devel@gnu.org; Thu, 09 May 2019 16:26:57 -0400 Original-Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:40991) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOpd2-0003tQ-B6 for emacs-devel@gnu.org; Thu, 09 May 2019 16:26:56 -0400 Original-Received: by mail-qt1-x82f.google.com with SMTP id y22so672154qtn.8 for ; Thu, 09 May 2019 13:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=Gqf9FQ7zUc0Vx36HrImiWhxXu0m7Eyzw2aWp2trUWDk=; b=hZt3J+CQMoWGzoJkSN74GgtjJWdU+Kv9ZgJqNNkcUhOEIfNqJ4lcZ05AHPPoSstutC 9fiPzAojyN5Q3in2930QvEmJujMddsvvc66SjoI72K4vSfHGXRaLz+kxDCPoWslHOjwT CPaPhg2YsmhaGM986+nL4/cQhsbH1WaygY+CycX6gdsnHKSFi3ucQf1hBKR5L9cVt7t4 cjAl2mokj6xUAlGTTf34Twgx0M5WAsJOuYsQYXdb3uwXSpAITY/FoDqn1ipzBn7WxcVS gbwwAGe6znthb61DLIk5NbqOMkX1sWJPUr/0D2sfQVUKC9+AKd9wTTQ5xbFkf8NsUdlV RTuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=Gqf9FQ7zUc0Vx36HrImiWhxXu0m7Eyzw2aWp2trUWDk=; b=gI+dpmTnjZnsodiw61W6lxgU96H/sZk79z8xMBKBe7lHpFwRgnG6VLzwGMDVRwdIJm 91Yhrb3sVuNhE3JmraLOE+Qp2zVFnjrYzo//vlDAtke4ThIpMwOzE/qm13obexLy0f2Q 47Yf74doZt0nQ0XKNTkmbyz8Fo0vXBzHAeT6jJqqT0za/bkbAnw2OhnKDSxbz/8w41YA /dlnzzpcoBa3lHCIJkbP9Z/E3K9JdbSGY8IV+jVM2VUm9YEHAfFJKp75lX8nGGk2/EQi IiZ7gs6sXao3aMP734xhXgYEPz8YIFcsKj/uHs1FMthqCz9HuwDsYsL4ehLbtH4I4g+D WAsw== X-Gm-Message-State: APjAAAWMQ7ssYqtAaHiDU4xvV497Sen1+yEO2Sl8KkR+l72uAyHMGAcV qIuxjcqz7xJ0MyrWCS5L1aH2p80n7BE= X-Google-Smtp-Source: APXvYqzENpuan4u3vlzdp7GjXpJgKSroAE5+Pot5sDzmo59peie/XEjXXrG9/B/loGlv7DCAiuRLEg== X-Received: by 2002:ac8:28d0:: with SMTP id j16mr5830772qtj.15.1557433614867; Thu, 09 May 2019 13:26:54 -0700 (PDT) Original-Received: from [192.168.1.11] (c-71-207-8-160.hsd1.pa.comcast.net. [71.207.8.160]) by smtp.gmail.com with ESMTPSA id n22sm1986793qtb.56.2019.05.09.13.26.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:26:53 -0700 (PDT) In-Reply-To: <83ftpogp6k.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.102.3) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:236345 Archived-At: --Apple-Mail=_9DE04636-B1E5-42F7-91A2-518CC40D7D0D Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > No, positions of intervals are continuously maintained as side effect > of editing commands that change buffer text. I still don't understand how is position maintained when user inserts something. Say I insert some characters in interval (3), I know total_length of (2) and (4) are updated. But how are the positions of all the intervals after (3) -- (4), (5) and (6) updated? I don't see relevant code in adjust_intervals_for_insertion. ----- (4) --- / | \ - (2) - | - (6) / | \ | / | (1) (2) (3) (4) (5) (6) Sincerely, Yuan --Apple-Mail=_9DE04636-B1E5-42F7-91A2-518CC40D7D0D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
No, = positions of intervals are continuously maintained as side effect
of editing commands that change buffer = text.

I still don't understand = how is position maintained when user inserts
something. Say I insert = some characters in interval (3), I know
total_length of (2) and (4) are updated. But = how are the positions of
all the intervals after (3) -- (4), (5) and = (6) updated? I don't see
relevant code in = adjust_intervals_for_insertion.

      ----- = (4) ---
     /       |     =  \
  - (2) -    |    - = (6)
 / =   |   \   |   /   |
(1) (2) (3) (4) (5) = (6)


Sincerely, Yuan

= --Apple-Mail=_9DE04636-B1E5-42F7-91A2-518CC40D7D0D--