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.devel Subject: Re: Why `read-buffer` is implemented in C? Date: Sun, 05 May 2024 19:26:56 +0300 Message-ID: <86msp4cjhr.fsf@gnu.org> References: <87seywmfpm.fsf@telefonica.net> 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="5737"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 05 18:27:24 2024 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 1s3ehv-0001Ez-8M for ged-emacs-devel@m.gmane-mx.org; Sun, 05 May 2024 18:27:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3ehb-0004CC-8w; Sun, 05 May 2024 12:27:03 -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 1s3ehZ-0004B2-ES for emacs-devel@gnu.org; Sun, 05 May 2024 12:27:01 -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 1s3ehY-0001yO-4m; Sun, 05 May 2024 12:27:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=QFw1PtuJgpYn9/ywPgEpatkM/CO2+dCy5SqMwlP4pdo=; b=AjdDvfgJUDVETlkZ3D73 jKGWjFokipB0lnO0v79c6QQQ7alEejOXww68RWRwR7fXQOP1DXjF+pdCUJCyRAsw9biUBQ/OoU2aI ls/0OTkTjYV0mH70QX5QUvoJW7XXEjcXSB3jvrM9q4cjQhwt5W0WpSfHvVRFKTMhc3iibaoHAew3K 9i8YwBVHC3/Y0mXu1xuLKDZ2Xcz/C7YyNvJzJPH01PoJh840P3ltUNMoX6J5Gt6mfcKQ2hgztcSnA GUg8JxC4N5hRbsLx5h9gXgxN0oqt5YA/pOVDibP2FtRfCnULMnP0zqQIL6D64VIdkf6Da6wyTyMQQ vLsfVVl4fLpEYQ==; In-Reply-To: <87seywmfpm.fsf@telefonica.net> (message from =?utf-8?Q?=C3=93scar?= Fuentes on Sun, 05 May 2024 17:38:29 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318847 Archived-At: > From: Óscar Fuentes > Date: Sun, 05 May 2024 17:38:29 +0200 > > While diagnosing a problem, I stumbled on read-buffer. Why is it > implemented in C? I mean, why is it *still* implemented in C? Because we didn't have a good enough reason to move it to Lisp. Such moves are not really trivial; for starters, you need to make sure that its Lisp definition will be loaded in loadup before the first Lisp file that uses read-buffer. And that's just the tip of the iceberg (e.g., I see 2 places in C that call read-buffer, so we'd need to make sure these two places are not used before the Lisp definition is loaded; etc. etc.). So we only do such things when we have a good reason, whose advantages can justify the potential trouble such changes can (and do) cause. Otherwise, it's simply un-economical.