From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Should (buffer-list) ever return killed buffers? Date: Mon, 24 May 2021 21:11:38 +0300 Message-ID: <877djouhlx.fsf@osv.gnss.ru> References: <87wnrpujo0.fsf@osv.gnss.ru> <871r9w5jws.fsf_-_@osv.gnss.ru> <83a6okdx60.fsf@gnu.org> <6381ce45-24d5-90f7-c490-7006460f7f43@gmx.at> <835yz8dvfk.fsf@gnu.org> <87wnroxi4d.fsf@osv.gnss.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6096"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: martin rudalics , Eli Zaretskii , emacs-devel@gnu.org, cpitclaudel@gmail.com, monnier@iro.umontreal.ca To: Philipp Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 24 20:14:07 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 1llF5a-0001Gw-HQ for ged-emacs-devel@m.gmane-mx.org; Mon, 24 May 2021 20:14:06 +0200 Original-Received: from localhost ([::1]:32904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llF5Z-0002Wl-Jq for ged-emacs-devel@m.gmane-mx.org; Mon, 24 May 2021 14:14:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llF3H-0000c4-K8 for emacs-devel@gnu.org; Mon, 24 May 2021 14:11:45 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:36476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llF3G-0007E5-1D; Mon, 24 May 2021 14:11:43 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id m11so41960988lfg.3; Mon, 24 May 2021 11:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=UXdZ6mLuFUKz1imNy7ukYHLIZna5nB+EElco0yDxUWM=; b=ShO3pO6DuA9EtvwNC1BR4jlsVI22cCUeJbArvq8Lh3G4OF8/v8iVogRc4ZKJrZtjOa P32DKTWHZq114C76c3FmiORrcILSdMC/I9uZ7BHvXFW24v3A0Q+kQbvq32RBUTDMVSNM 5VeiibHiMl0IvGx84tlCuJ2055ARwEyWvNkCBLOvvg75BGuhxuTy/Hvs6cHpt4ozrG/f vrkX6lGPQ2RLLFJeV6uD8SFDACaj8JLyw8WNxwuUexPyjWAtHuLf7pcOW+AoHZKDPaGY C9svFuCnwVUOxtZRs2WP5CgP0gKnKSPnIzYEwVLkyXGnLH+tKHlvy68dSyPHfjnXMdQb Bp1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=UXdZ6mLuFUKz1imNy7ukYHLIZna5nB+EElco0yDxUWM=; b=gA5hJmRXcLi8N5tQhjh6oxeTCoZflRzEkQmNhvco+/nlrBzb/s7c9tAnSPxyZ4VJae yFG1LYWDmmNoCCrQdbCurP/oxTB6Xw5r1UmCxZFtiwXADQKBu2Llme5os4iJ/eQpqR20 4IeOQ9z3bHQKocz838SVskCeSJFNtr8cjGYPCHDSpkjo3qf/6z5hTpf/sbEgri65OvkL ArX0snB3NJVMP05hjZnWz9p8RFqJNXLaezzFbekXlIyeBg9iKJcrAugHHqc8oiDngT5J YQINdFdFbbeuUVH3UCfY2Gh/Yb7LLuIekLBs7/HzZ0wLvAwd8ZwV+c4F13B8hIJX9qYh YwDQ== X-Gm-Message-State: AOAM531bNOwID4nOKmR85ng74DI22tYQwKsC6qdlIG9KZ2VM86fjWKfF AFYGKd534Pp7kAa7UlS3H7wEEIHT3Ho= X-Google-Smtp-Source: ABdhPJwXJOJ+FhSJc58GCmpevc+egFR23ZoejEZPyPZUSbflYIxaNRACKhC179x+lgHvIeMMqLMBAg== X-Received: by 2002:a19:5e1e:: with SMTP id s30mr11316199lfb.547.1621879899830; Mon, 24 May 2021 11:11:39 -0700 (PDT) Original-Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id z41sm1482997lfu.88.2021.05.24.11.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 11:11:39 -0700 (PDT) In-Reply-To: (Philipp's message of "Mon, 24 May 2021 18:07:41 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=sorganov@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:269788 Archived-At: Philipp writes: >> Am 24.05.2021 um 17:32 schrieb Sergey Organov : >> >> Eli Zaretskii writes: >> >>>> Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org >>>> From: martin rudalics >>>> Date: Mon, 24 May 2021 16:50:48 +0200 >>>> >>>>>> + (unless (or (nill bufname) >>>>>> + (eq (aref bufname 0) ?\s) ;; Don't kill internal buffers >>>>>> (string-match-p preserve-regexp bufname)) >>>>>> (kill-buffer buffer))))) >>>>>> (delete-other-windows) >>>>> >>>>> AFAICT, kill-buffer already is a no-op when the buffer is dead. So >>>>> what exactly does this fix? (Apologies if I'm missing something: I >>>>> cannot say that I've read all the discussions in this thread to the >>>>> last detail.) >>>> >>>> Sergey never told us but it's likely `aref' choking on nil. >>> >>> Then why not use buffer-live-p? >> >> Cause aref is choking on bufname being nil, I think. What if >> representation of killed buffers change? > > That won't happen. The ELisp manual guarantees that "[t]he > ‘buffer-name’ of a buffer is ‘nil’ if, and only if, the buffer is > killed." Probably. I provided a patch as convenience. Whatever fix you guys come-up with, I'll be happy to use. Thanks, -- Sergey Organov