From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: LOCK-BUFFER when two buffer visits the same buffer Date: Sat, 11 Dec 2021 12:29:48 +0100 Message-ID: <875yrv74hk.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13953"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.5; emacs 29.0.50 Cc: emacs-devel@gnu.org To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 11 12:42:58 2021 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 1mw0mI-0003S3-CP for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Dec 2021 12:42:58 +0100 Original-Received: from localhost ([::1]:47076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mw0mG-0004Dx-NX for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Dec 2021 06:42:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw0lP-00037d-VW for emacs-devel@gnu.org; Sat, 11 Dec 2021 06:42:03 -0500 Original-Received: from [2001:470:142:3::e] (port=57842 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw0lP-00078C-Hn; Sat, 11 Dec 2021 06:42:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=lmRJPtKWG15HDv3tbZ3LHTWMCmRC/e1skXeVFNltuCA=; b=NrtaYwNpSnYqj4 ApqjgmqKvtNjZ4I173zevCnGOGQT2qPVeNJh+4PJSLifj7TCmt1kiupkMCdiJ8IcQHggJeMet9H9f 2BFKTGnhb1csBFOkQE0+oAJxDT2UuUZg9BX6kyvtD391cl/mqQXfqZmw8nRjFzS3zrRPxhbKV7hG5 0gGzY0Z3c/W/LtRuAN0bedMZwOmDqzsGhIVCCvPYtCsj1Js/8vnQQCvZuXdEwcD3UOSStkjjZXiPk 3f2BpGov9bqP5LYQeFtTXqzckvknswyRdCbqMmxr7sAC9490+x0hLFo8ORkcMVVK6z3N4OoUeKOV4 PKfaYM/EklyG5960n+Ig==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:39769) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mw0lP-000813-Lb; Sat, 11 Dec 2021 06:42:03 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id CC0CB27C0054; Sat, 11 Dec 2021 06:42:02 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 11 Dec 2021 06:42:02 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeeggddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffuffgjkfggtgfgsehtqhertddtreejnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepie dugffhhfejveevvdfhffegteelleejffefgefgueeggeelheefieeujefhheegnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 11 Dec 2021 06:42:01 -0500 (EST) In-reply-to: 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" Xref: news.gmane.io gmane.emacs.devel:281676 Archived-At: Qiantan Hong writes: > I do lock-buffer in the first buffer, then in the second buffer, and I > killed the second buffer, the lock is gone =E2=80=94 even it seems that b= uffer > one should hold the lock! More details, please. Do you just call (lock-buffer) or (lock-buffer "~/file")? One emacs instance or two? As I understand the docs, file locks are not associated with a buffer but the emacs instance and (lock-buffer) is just a shorthand for (when (buffer-modified-p) (lock-file (buffer-file-name))) Bye, Tassilo