From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps. Date: Mon, 31 Oct 2022 16:35:48 -0400 Message-ID: References: <83v8o0dtg3.fsf@gnu.org> <83pme8dp2r.fsf@gnu.org> <83iljzeugr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27215"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: acm@muc.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 31 21:37:07 2022 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 1opbWs-0006pi-Sx for ged-emacs-devel@m.gmane-mx.org; Mon, 31 Oct 2022 21:37:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbVq-00010l-R0; Mon, 31 Oct 2022 16:36:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbVi-0000zH-Od for emacs-devel@gnu.org; Mon, 31 Oct 2022 16:35:55 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbVh-0000NK-B9; Mon, 31 Oct 2022 16:35:54 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 56D47807CB; Mon, 31 Oct 2022 16:35:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A788B80390; Mon, 31 Oct 2022 16:35:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1667248549; bh=ntBhzySbphNFsWezMtFdeLJTBIcnK+DuInF1iZYS/cs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Gv/RWg96+j90b0Bq9+VZsXGqXVbh/J5gxh1teEfggPnI6fcqvNnDtIv5AO9uykKx0 mVtoOjVlPdksG9omuYurnruUkgaiW/hT/hlqAOzlYrfooGRy24z9H5YFXR8F6iuwku TLPNy+dSPU2UW4TXSLrvsoZli/tG8IHcdlfl7h8NlcaUaUsVXjdrLjNZ1MKg5nnKW0 ut341wEn8jtBhk4UWjq01ANE0L8kZ4Fh8JsOmbnK75V7mPaBMxtX/m+/D0YqbGv2KG 4+1HwFkn0k6W64u8k28zvxSF/GaquDmTH6AK/sF/weOWM+Q+Q2aWQel5DvGdduSoOF bWnqPAZoReIZQ== Original-Received: from alfajor (modemcable021.147-23-96.mc.videotron.ca [96.23.147.21]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6C23B120F8F; Mon, 31 Oct 2022 16:35:49 -0400 (EDT) In-Reply-To: <83iljzeugr.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 31 Oct 2022 20:09:08 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298887 Archived-At: >> >> + CHECK_FIXNUM_COERCE_MARKER (pos); >> >> + p = XFIXNUM (pos); >> > >> > This is sub-optimal: a marker holds both character and byte position, >> > and you lose it here. Ignoring the byte position is only justified if >> > the marker belongs to the wrong buffer. >> I suspect the performance impact is negligible > Are you talking about using character and byte position, Yes, tho only specifically in this `set-buffer-point` case. > The performance impact of char_to_byte is not negligible at all! Agreed. My comment was based on the fact that I don't expect `set-buffer-point` to be called very many times. > My remarks were general, not necessarily related to this particular > patch. The principle should always be if you already have a byte > position, use it! I didn't mean to imply otherwise. Stefan