From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Mark position from C Date: Wed, 15 Feb 2023 15:54:08 +0200 Message-ID: <83sff7avb3.fsf@gnu.org> References: <878rgztc9p.fsf.ref@yahoo.com> <878rgztc9p.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14575"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 15 14:55:04 2023 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 1pSIFS-0003VK-OH for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Feb 2023 14:55:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSIEu-0001de-GW; Wed, 15 Feb 2023 08:54:28 -0500 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 1pSIEt-0001dQ-Il for emacs-devel@gnu.org; Wed, 15 Feb 2023 08:54:27 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSIEt-0001cL-90; Wed, 15 Feb 2023 08:54:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Yz2ZquPy6N+YqZF1OByiR/kyZfXpdjwh+RoUQDCmOJc=; b=C/JBdkYeI+VD kmIQrr2hTbOPMrlfZEqI1Co/O1yuZ59bM/dWiarfFDJGqsHRTa6B3J1q+YITF5ZYdYqwOvbBprjHl 1zAMRJsxafKe1mmSXtZX1E8oVJCq+kmAPh1kEWQ4bSqiJ/BZIgUSoTuGCPKKXT0uwzFFPSTcvv8z0 o5NfOK4aX9oRYpaZx1FbPMOd6EjcsSl/mxnnMf11jsBsdo0LVj8JOeLXunQeI0fzfboDrN/TfRfKd 9HM8llX/oKRZ9EPSojtA9rF9VQbkI69uLUSNnJXZqyzTmDmhkXtf6BCrIfPO2MI+kj5aN1tiRmSJ1 nIOl2Ey83U4i5n6Qk+9bcA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSIEs-0002Kv-Ok; Wed, 15 Feb 2023 08:54:27 -0500 In-Reply-To: <878rgztc9p.fsf@yahoo.com> (message from Po Lu on Wed, 15 Feb 2023 19:10:26 +0800) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303303 Archived-At: > From: Po Lu > Date: Wed, 15 Feb 2023 19:10:26 +0800 > > Is there a canonical C function to obtain the position of mark? Right > now, I'm doing this to compare mark against point, which looks wrong. > > && XMARKER (BVAR (current_buffer, mark))->position > && marker_position (BVAR (current_buffer, > mark)) == PT) marker_position (BVAR (current_buffer, mark)) is it. Why does it look wrong to you? And why do you need the first condition? And why do you need to access the mark in the first place? It is rare for the C code to need that; about the only place where we do it is in interpreting the 'interactive' codes.