From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Nagy Newsgroups: gmane.emacs.bugs Subject: bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument Date: Sat, 04 Nov 2023 20:57:41 +0000 Message-ID: <87jzqxgrof.fsf@posteo.de> References: <8734xp77vl.fsf@posteo.de> <83edh88y2h.fsf@gnu.org> <877cmzzxf5.fsf@posteo.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38984"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66890@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 04 22:01:56 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qzNmG-0009wg-6c for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Nov 2023 22:01:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzNln-0008Q2-Ly; Sat, 04 Nov 2023 17:01:27 -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 1qzNlm-0008Ps-4Z for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 17:01:26 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzNll-0000qK-RW for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 17:01:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qzNmL-0006fU-VZ for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 17:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Nagy Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Nov 2023 21:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66890 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 66890-submit@debbugs.gnu.org id=B66890.169913166525562 (code B ref 66890); Sat, 04 Nov 2023 21:02:01 +0000 Original-Received: (at 66890) by debbugs.gnu.org; 4 Nov 2023 21:01:05 +0000 Original-Received: from localhost ([127.0.0.1]:35824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzNlR-0006eD-DI for submit@debbugs.gnu.org; Sat, 04 Nov 2023 17:01:05 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:36165) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzNlO-0006db-2B for 66890@debbugs.gnu.org; Sat, 04 Nov 2023 17:01:03 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 446AC240028 for <66890@debbugs.gnu.org>; Sat, 4 Nov 2023 22:00:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1699131619; bh=RIuxCIQzVcawctgUohpjWaGd5IyEOlf6KjCNog/mZRg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=QHL7jFqaWGXiPDZUjLn+ikWdPuhCMbAHDrLIBNrKoFHKQYgB5ox8u2U6/RWcrYG4f DoCqQww15wuClLZdqHhWfP9K5RNJ3wigKNiRuAgrr99Yn1iLOfJU1LM6wHo+nX03Nq F+gG70deQ82f3deMzUO1ifaZVW3cMD4IUQTIigYpQHOPh7xlsVfKT4Frb9xawhsVRb +CX5SPMyaJtdUeJfQ2y7dtyvwGKTvhR7p85ZKjeWNGV+3nN/5F6AXfgOdiImseDaFl vjQ64kddER9wyFQFbixx9dEAHc7F2k3A/70aMkPQMMX0VMlgLtktilqRQvEF038+Ol +cMiMzSTmH+Uw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SN9420T70z6tvJ; Sat, 4 Nov 2023 22:00:17 +0100 (CET) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273791 Archived-At: Stefan Monnier writes: > I do have an opinion on this: I wish I could go back in time and get > rid of this `buffer-or-string` business altogether. > The reason is that I've seen several ELisp packages which abused > buffer names as "handles" for buffers, leading to nasty bugs when > those buffers get renamed (e.g. by things like uniquify). A reduced API surface will not prevent people from using buffer names as handles. They will just wrap the string with `(get-buffer ...)' and call it a day. That seems like a logic problem, that you cannot check for via function arguments. > Could you show some examples of the kind of reductions you're thinking > of? No, I cannot. This was mostly meant as a general statement. But maybe I can argue in the other direction. What if things from that list above were requiring to be more explicit. Such that you would need to write `(with-current-buffer (get-buffer "mybuffer") ...)' instead of `(with-current-buffer "mybuffer" ...)'. That would seem to me like an (unnecessary) complication. In general, I would say that, if the computer can unambigously decide what is supposed to happen, it should help me and automatically correct my "mistakes". Also I would argue, that is similar to what is already present in Emacs with the dwim commands. Commands can behave differently if, for example a region is active. So the "Do what I mean" notion means, if I pass in a string, does the function unambigously know what I mean with that? If yes, then it should do that. -- Daniel Nagy