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: Thu, 02 Nov 2023 20:55:55 +0000 Message-ID: <877cmzzxf5.fsf@posteo.de> References: <8734xp77vl.fsf@posteo.de> <83edh88y2h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22019"; mail-complaints-to="usenet@ciao.gmane.io" To: 66890@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 02 21:57:38 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 1qyekz-0005VC-Qw for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Nov 2023 21:57:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyeks-0000YB-TJ; Thu, 02 Nov 2023 16:57: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 1qyekp-0000Xa-FZ for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 16:57: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 1qyekp-0007pa-7D for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 16:57:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyelO-0001cI-A5 for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 16:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Nagy Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Nov 2023 20:58: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.16989586546172 (code B ref 66890); Thu, 02 Nov 2023 20:58:02 +0000 Original-Received: (at 66890) by debbugs.gnu.org; 2 Nov 2023 20:57:34 +0000 Original-Received: from localhost ([127.0.0.1]:56274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyekw-0001bU-20 for submit@debbugs.gnu.org; Thu, 02 Nov 2023 16:57:34 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:43715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyekr-0001b9-TW for 66890@debbugs.gnu.org; Thu, 02 Nov 2023 16:57:32 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 916E2240027 for <66890@debbugs.gnu.org>; Thu, 2 Nov 2023 21:56:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1698958608; bh=9J0EVrvbVXULRrV0APCYQdkmKWNOO0ENU9AOuf/rmwY=; h=From:To:Subject:Date:Message-ID:MIME-Version:From; b=r4sRPhYshbfrBGRbCFNNAPn45bS5kpdSk1AdruvG7Mv9emyHkrZpd6Gxsu6KXUYYH EopAMhM5LSh0GMLgd99xM+yymnPDjB0EGtZNJ/VCnRgl8fCmTOA9rLxzb6jocmmZdl fIs/OdXAruDptLl9wRaIFxsikhtnudRpvSunSKoxdN6wnbVoPydwW8HCz87cLXjlcD dd+ZUx7Gb6wqBD9jccd4h3GM6LWheom9pGtzMzn7hcIaKXrgikoBVEA0dpDUqKKw56 K180KSkDpRn/q3s8ax1UoAAGliRXWwm2UoUcGcNmOkvlOcLgv0qtQc0mLs+buEV7Q7 xm16udZ1ymOWw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SLx4w11G5z6tvb for <66890@debbugs.gnu.org>; Thu, 2 Nov 2023 21:56:48 +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:273677 Archived-At: (resending only to debbugs.gnu.org because my previous mail had delivery problems) 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? -- Daniel Nagy