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.bugs Subject: bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument Date: Fri, 03 Nov 2023 08:46:09 +0200 Message-ID: <83sf5n72ry.fsf@gnu.org> References: <8734xp77vl.fsf@posteo.de> <83edh88y2h.fsf@gnu.org> <87bkcbzy6c.fsf@posteo.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20684"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66890@debbugs.gnu.org, stefankangas@gmail.com To: Daniel Nagy , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 03 07:47:53 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 1qynyC-00058X-JA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Nov 2023 07:47:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qynxr-0003Yh-6R; Fri, 03 Nov 2023 02:47:31 -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 1qynxn-0003We-RB for bug-gnu-emacs@gnu.org; Fri, 03 Nov 2023 02:47: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 1qynxn-0004U9-J7 for bug-gnu-emacs@gnu.org; Fri, 03 Nov 2023 02:47:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qynyM-0000QO-H0 for bug-gnu-emacs@gnu.org; Fri, 03 Nov 2023 02:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Nov 2023 06:48: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.16989940261563 (code B ref 66890); Fri, 03 Nov 2023 06:48:02 +0000 Original-Received: (at 66890) by debbugs.gnu.org; 3 Nov 2023 06:47:06 +0000 Original-Received: from localhost ([127.0.0.1]:56649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qynxO-0000Oo-42 for submit@debbugs.gnu.org; Fri, 03 Nov 2023 02:47:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qynxI-0000OT-A3 for 66890@debbugs.gnu.org; Fri, 03 Nov 2023 02:47:00 -0400 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 1qynwc-0004LZ-Qi; Fri, 03 Nov 2023 02:46:14 -0400 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=Det+b7IVU7YEltT0KUbFF2YVzmZocNiTkw03ZUYY3+4=; b=d55y8i74cGxv cYcDkMnIjrqkpDESyWzX6kn2qAvCcAkAJ729PmSf5qQMvXcpMfItllUDazVK+ekiI5d2CGcU7B6E5 JkalBsNW+JKOVZw9pNAJIx9P1VsIgabIQZNd3JabDlDVDQWjhq+YMHWHNqQcCaQ63l7+iouJzYN+s 6Boa9SUnVjAzlYXvgeoYg2t+g/8nmbYYbSTMll4Iu7+LGcDYWmlkYLKC7kwh95783KgqymsaVJVR9 vB9WZFyfR6KoPp0I3Ur/60rtHMF85ywWgTBOt3pcy+Wl1Gyw5ScyQqOu08kXsOMn5qm2CfDDzaeGI /Tt6pUz/ixJppZLAl5jY0g==; In-Reply-To: <87bkcbzy6c.fsf@posteo.de> (message from Daniel Nagy on Thu, 02 Nov 2023 20:38:35 +0000) 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:273693 Archived-At: > From: Daniel Nagy > Cc: Eli Zaretskii , 66890@debbugs.gnu.org > Date: Thu, 02 Nov 2023 20:38:35 +0000 > > These are the additional functions/macros, that I found using `M-x > apropos-function', that accept both types of arguments: > > `buffer-hash' > `buffer-match-p' > `buffer-text-pixel-size' > `bury-buffer' > `display-buffer' > `get-buffer-create' > `get-buffer-window' > `get-buffer-window-list' > `kill-buffer' > `pop-to-buffer' > `project-display-buffer' > `project-display-buffer-other-frame' > `project-switch-to-buffer' > `replace-buffer-in-windows' > `set-buffer' > `set-window-buffer' > `switch-to-buffer' > `switch-to-buffer-other-frame' > `switch-to-buffer-other-tab' > `switch-to-buffer-other-window' > `tab-bar-get-buffer-tab' > `temp-buffer-window-setup' > `window-normalize-buffer' > `window-normalize-buffer-to-switch-to' > `with-current-buffer' > `with-current-buffer-window' > `with-displayed-buffer-window' > `with-temp-buffer-window' > > The number of functions, that only accept a buffer is vast and probably > outnumbers that list above, so I am not going to list them here. > > These are some disadvantages of such a change, that come to my mind: > > 1. Could the acceptance of a string in that place of the argument > prohibit possible future possibilites? > > 2. Does the newly accepted argument type sacrifice function purity > and/or side-effect-freeness? > > 3. API inconsistency. > > 4. Slightly increased code complexity, especially in the C part of > the code base. > > My commentary in this particular case would be, that I dont see how now > accepting strings in addition would shadow any future usage of that ( or > other ) functions. Neither do I see how it would break function purity > or side-effect-freeness, but that could just be my lack of imagination. > > As for the advantage my main argument would be convenience. It does > reduce user's elisp code and and makes smaller evaluations in the > minibuffer easier to type. > > I wanted to file some more of such polymorphism suggestions. Would those > be welcome? I added Stefan Monnier to this discussion, in case he has an opinion on this issue, which seems now to be about a vast change in Emacs.