From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 02:03:11 -0400 Message-ID: References: <8734xp77vl.fsf@posteo.de> <83edh88y2h.fsf@gnu.org> <877cmzzxf5.fsf@posteo.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35754"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66890@debbugs.gnu.org, Daniel Nagy To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 04 07:04:50 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 1qz9m6-00096z-BT for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Nov 2023 07:04:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qz9lm-0007SW-6T; Sat, 04 Nov 2023 02:04:30 -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 1qz9li-0007S1-RX for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 02:04:27 -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 1qz9li-00012s-JO for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 02:04:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qz9mI-0003gA-3q for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 02:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Nov 2023 06:05:02 +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.169907784814073 (code B ref 66890); Sat, 04 Nov 2023 06:05:02 +0000 Original-Received: (at 66890) by debbugs.gnu.org; 4 Nov 2023 06:04:08 +0000 Original-Received: from localhost ([127.0.0.1]:60233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz9lP-0003ev-U4 for submit@debbugs.gnu.org; Sat, 04 Nov 2023 02:04:08 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz9lN-0003eO-DQ for 66890@debbugs.gnu.org; Sat, 04 Nov 2023 02:04:06 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9E6F38076B; Sat, 4 Nov 2023 02:03:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1699077802; bh=Qx+CcwWrE/HZ/Mrwn0l+rnoV6iLxfdIcsMhAjPf/PUE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=m1P/IpG2noTzOxCjoAseuWlezetEweLFw1MWydUNqgsB7l5KD7jAMe3NtbKw+7TT7 a14joEmnqrELtFlI7k+n7X49fWM4toRBH5Z3yLqGUeJdBjK18oYh25ODHK28DDFvOE aVckH+4bYrwLQx+BtBhoyTxsd2FTW7F3DKiTC0Doh2jZ68yEhykEmbLi4t0IRF3BYU DN7oqwWfJ5PIg4nHjXPHgonQhyr2lFnOXj24txV4IjnlPBeLCEJhnIFzw6RurHtZAB rP3T/d4IX6KKvXner5AnV8vHVvXCi/ywdSLIHdNugZXWsEJVJ+lH6dPZt7B+kRTSJz vI3u/+50t3Euw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B9B7B80577; Sat, 4 Nov 2023 02:03:22 -0400 (EDT) Original-Received: from pastel (unknown [45.72.195.71]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8B415120209; Sat, 4 Nov 2023 02:03:22 -0400 (EDT) In-Reply-To: (Stefan Kangas's message of "Fri, 3 Nov 2023 17:21:44 -0700") 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:273741 Archived-At: >> 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). > > I'm not sure which way to lean here: writing ELisp customizations is > easier for regular users if these functions accept either buffer or > string. It's also less verbose. What you write sounds obvious, but at the same time I'm hard pressed to think of a customization where I'd pass a buffer name to a function that usually takes a buffer. The only use of `get-buffer` I could find in my own customizations is one where accepting buffers-or-strings wouldn't help (I pass the buffer to functions like `eq` rather than to functions that specifically expect a buffer). >> Maybe we should just "de-emphasize" the fact that those functions also >> accept strings, and instead insist that you have to go through >> `get-buffer` (or `get-buffer-create`). If that sounds vague and you >> don't know what that would mean concretely, well.. you're not alone :-) > Perhaps we could recommend against abusing it in `(elisp) Tips'. It's not as strong a "de-emphasize" as I was picturing, but yes, that counts. Stefan