GNU bug report logs - #26564
Document that only functions and not variables can end with "-p"

Previous Next

Package: emacs;

Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>

Date: Wed, 19 Apr 2017 15:48:01 UTC

Severity: wishlist

Tags: fixed

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 26564 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 26564 <at> debbugs.gnu.org
Subject: Re: bug#26564: Document that only functions and not variables can end
 with "-p"
Date: Wed, 19 Apr 2017 16:22:39 +0000
[Message part 1 (text/plain, inline)]
On Wed, Apr 19, 2017 at 12:08 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > What would be the correct section to do so?
>
> "Coding Conventions", of course.
>

Please review this patch:

From 9749603b7c3ba45c9c81f9624d6dc42f740aee39 Mon Sep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi <at> gmail.com>
Date: Wed, 19 Apr 2017 12:20:05 -0400
Subject: [PATCH] Document convention to reserve "p" or "-p" suffix for
 predicate fns

* doc/lispref/tips.texi (Coding Conventions): The "p" or "-p" suffix
  should be used for only predicate functions, and not
  variables.  (Bug#26564)
---
 doc/lispref/tips.texi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 4e2a0fad1f..ec76fcb5ce 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -154,7 +154,9 @@ Coding Conventions
 condition is true or false, give the function a name that ends in
 @samp{p} (which stands for ``predicate'').  If the name is one word,
 add just @samp{p}; if the name is multiple words, add @samp{-p}.
-Examples are @code{framep} and @code{frame-live-p}.
+Examples are @code{framep} and @code{frame-live-p}.  This predicate
+suffix should not be used in variable names (i.e., you might name a
+variable @code{foo-feature} instead of @code{foo-feature-p}).

 @item
 If the purpose of a variable is to store a single function, give it a
-- 
2.11.0


-- 

Kaushal Modi
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.