From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Question collaborative editing. Date: Wed, 30 Sep 2020 15:19:31 +0200 Message-ID: <20200930131931.scdkrx46vylpi4c3@Ergus> References: <219042AC-556D-48CC-8920-82D9BF2BD3AA@aol.com> <3A81FB67-A558-4281-8285-CDD9B01033E3@posteo.net> <1C949FC9-6023-467E-99EC-75D57B08AFB0@gnu.support> <20200929124513.fd745r2txowwbiir@Ergus> <87blho7af9.fsf@red-bean.com> <20200929215849.zg4wzytbrwx2b7ih@Ergus> <84B86B7C-81F0-42DF-894C-BF577E4B3D6E@mit.edu> <20200930001333.g6b3mqa4mdsoxiue@Ergus> <87r1qjzp91.fsf@red-bean.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2499"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Qiantan Hong , Emacs developers , Fermin , Noam Postavsky , Jean Louis , Stefan Monnier To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 30 15:20:57 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNc2T-0000WJ-2I for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Sep 2020 15:20:57 +0200 Original-Received: from localhost ([::1]:44140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNc2S-0005fz-1o for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Sep 2020 09:20:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNc1X-0004PD-F9 for emacs-devel@gnu.org; Wed, 30 Sep 2020 09:19:59 -0400 Original-Received: from sonic301-2.consmr.mail.bf2.yahoo.com ([74.6.129.41]:36651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kNc1T-0003ic-Sc for emacs-devel@gnu.org; Wed, 30 Sep 2020 09:19:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1601471990; bh=cbI/fDkIUo1fDav9l/HcLqRxgZ1r637i8CvFK8zp1QA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=TxuyXWrQIW8WYNALrLdDd/Pi51lWReDvCCTaKe3b+PAfo1TUjh5ES/b7Ivaf7ULHKcqdfWqDIAvmAtGfXthsD68XpaFI9vqUGcFmBe/ovGtKtjS9UQFngVPc8cn/zCVKJzrMKmnZoK81nQ1M6M1m+o2ENC+XYLmNozyAWiATJOSyVKHk+VMVRpNSyGxbfJuKP7yT8pTbY8e9gONcG5JfrNHkHQUondL/uXcUj111u/ZPgEDjedgyJWKAUr+AQQlfxYbNUUnFvR/LPHps3NwhLIFzCPg7LjNt5Hf4RUO24zS9lUREZ5cN+ozSy5VSuA1FDzAsPGQFeRIsNhzhVwqaLg== X-YMail-OSG: X.RLqBIVM1n2S1pSmCOHlxRycmAbx7B5To3fPpUij.7FjGQr.VM1IklPJeqZAF3 IcTBKojimnkXt0q23zHrJo5Ekog5rRtcn8chs8PXCYmI_r1Yq.UNHyMrF0lLYSPKXla5dtLypWvM dvof.MImhCcLFAyeQIt7v2kfwKU9eo.7YQ9JM45CuBKeT7tYF0OUjBSUNMrNccnTy2W_Bj.4vHIL dUSm2ZUOR8BwDGQMeB0l_nHQskdJi09exB9o485d4e7yUPuK1J8MMfGruoj1EcXwMGdHcHKRyHnw .oWHHxdL0mhFEpRTVhOLdOV4SWUSrul3mkwOneTLTyqkxKKFuu8PpW.w5er9prbsKLQKXAleHCXT Iu7wFRIUciLoiJtTYgiwqNfWkMUb5PDexBe2JtyPvBuBftr59S7lXiA4h_hdfSXffsmjtFgmZTV9 3pIJRyy.s0q.J3l_Hc6TrlbUXa9seiN7kp04ulkhXrUaUzkp9re8Ucnjb1e_UyZSFfeplrBOhG1G irUnEKHbJRXwfdvgpLeHci_lrMAzHgG8tJlpiwRpAgnTBH6VPAyugJLt.lyt3ARK9tngtyxwoaJg D1Qw9LiDZzVR4mzfzcH3dx1Ep4oHaFlvYAFcZ25lMCRfZI2kVRt7Th2gV1XrCnlJ7FTtItc.zDhm iC4kDUzJ5BQgvA66CvwrMHb1C9dqCLRbWYZQLMP.8fa.obC.w413835kii8C25wVcqEsO5BQKPmM Ew4gkUtMSU2Q1n08JfA97YGOxXNCjua4VLwBcQQPr4Vr6gp9HD0TUERytLm7sgXMMNGeK9A30VXu DZ2s85v9zjCBin8b0MgJQA37AZihedJg8PXZAlsmE8 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Wed, 30 Sep 2020 13:19:50 +0000 Original-Received: by smtp421.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 49795793b8464b169e0c5d153716c24d; Wed, 30 Sep 2020 13:19:46 +0000 (UTC) Content-Disposition: inline In-Reply-To: <87r1qjzp91.fsf@red-bean.com> X-Mailer: WebService/1.1.16718 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Received-SPF: pass client-ip=74.6.129.41; envelope-from=spacibba@aol.com; helo=sonic301-2.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/30 08:28:22 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.373, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256749 Archived-At: On Wed, Sep 30, 2020 at 02:40:26AM -0500, Karl Fogel wrote: >On 30 Sep 2020, Ergus wrote: >>I would be concerned about the performance (but I am paranoid about >>Emacs performance anyway so don't worry for that). AFAIR emacs buffers >>are stored in a contiguous way (I may be wrong) > >Information about how Emacs buffers are represented under the hood can be found here: > >* https://git.savannah.gnu.org/cgit/emacs.git/tree/src/buffer.h#n213 > >* https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Gap.html > This is interesting indeed. I was looking at this to compare what's around: https://ecc-comp.blogspot.com/2015/05/a-brief-glance-at-how-5-text-editors.html >TL;DR: It's a contiguous array with a gap at the point where insertion or deletion happens. When you need to insert or delete somewhere else, Emacs first moves the gap to the new location. The gap is exposed to Elisp via the functions `gap-position' and `gap-size', though I must confess I've never used them from Elisp. > >Best regards, >-Karl