From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#48264: [PATCH v3 03/15] Add and use BUFFER_DEFAULT_VALUE_P Date: Fri, 07 May 2021 08:49:59 -0400 Message-ID: <87tuner9mw.fsf@catern.com> References: <877dkbsj9d.fsf@catern.com> <20210506213346.9730-4-sbaugh@catern.com> <83czu3c88w.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="30561"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48264@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 07 14:51:26 2021 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 1lezwz-0007nn-Eg for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 14:51:25 +0200 Original-Received: from localhost ([::1]:56268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lezwx-000406-OH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 08:51:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lezwb-0003yE-Uy for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 08:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lezwb-0005EI-L3 for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 08:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lezwb-0006Pr-Iy for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 08:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 May 2021 12:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48264 X-GNU-PR-Package: emacs Original-Received: via spool by 48264-submit@debbugs.gnu.org id=B48264.162039180224637 (code B ref 48264); Fri, 07 May 2021 12:51:01 +0000 Original-Received: (at 48264) by debbugs.gnu.org; 7 May 2021 12:50:02 +0000 Original-Received: from localhost ([127.0.0.1]:43699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lezve-0006PG-Aj for submit@debbugs.gnu.org; Fri, 07 May 2021 08:50:02 -0400 Original-Received: from venus.catern.com ([68.183.49.163]:59606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lezvc-0006P0-IE for 48264@debbugs.gnu.org; Fri, 07 May 2021 08:50:00 -0400 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=98.7.229.235; helo=localhost; envelope-from=sbaugh@catern.com; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=catern.com; s=mail; t=1620391799; bh=h4IFaEi+fcwqmhTufE5VBUGovUjcnmcueznvbRLvLtQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=c25Ka+9uk34yYoQgDIRycBHARKMX6fAOe987jgQFx6t30oriW+NZnwYW+tm8ov0lt JwrGWChLhhASEYQm6WZC2YIOoFjpqk3P5vIc4l9N0ouieFTn5cqPcAn8XC5ZGv3pr9 jcAOOlsih57xkBylCKvRtYX0KMjz5kF/spnbJdBg= Original-Received: from localhost (cpe-98-7-229-235.nyc.res.rr.com [98.7.229.235]) by venus.catern.com (Postfix) with ESMTPSA id D792C2E4579; Fri, 7 May 2021 12:49:59 +0000 (UTC) In-Reply-To: <83czu3c88w.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:205924 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Date: Thu, 6 May 2021 17:33:34 -0400 >> Cc: Spencer Baugh >> >> This makes the code more clear and allows us to more easily change how >> this property is determined. > > Does it? Can you explain why you think so? It looks like we are > replacing clear code with an equally clear different code. Well, "if (idx > 0)" as a conditional requires a fair bit of digging in the implementation of DEFVAR_PER_BUFFER variables to understand. On the other hand, "if (BUFFER_DEFAULT_VALUE_P (offset))" is immediately clear: We're checking if this variable has a default value. By hiding the implementation detail of "idx", we both remove the need to know what idx is, and make it easier to later change the implementation (as a later commit does).