From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#26564: Document that only functions and not variables can end with "-p" Date: Wed, 19 Apr 2017 15:47:06 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c1cc63661855f054d86f0b0 X-Trace: blaine.gmane.org 1492616894 18366 195.159.176.226 (19 Apr 2017 15:48:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2017 15:48:14 +0000 (UTC) To: 26564@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 19 17:48:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0rpv-0004b0-76 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Apr 2017 17:48:07 +0200 Original-Received: from localhost ([::1]:49003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0rq1-0005e5-36 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Apr 2017 11:48:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0rpu-0005dl-Ri for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 11:48:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0rpq-0002gh-I9 for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 11:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0rpq-0002gb-EK for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 11:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d0rpq-0003hy-5E for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 11:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Apr 2017 15:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26564 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.149261685014203 (code B ref -1); Wed, 19 Apr 2017 15:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Apr 2017 15:47:30 +0000 Original-Received: from localhost ([127.0.0.1]:57140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0rpK-0003h1-BF for submit@debbugs.gnu.org; Wed, 19 Apr 2017 11:47:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0rpI-0003gi-A8 for submit@debbugs.gnu.org; Wed, 19 Apr 2017 11:47:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0rpC-0002Mj-05 for submit@debbugs.gnu.org; Wed, 19 Apr 2017 11:47:23 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:47204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0rpB-0002Md-TC for submit@debbugs.gnu.org; Wed, 19 Apr 2017 11:47:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0rpA-0005bE-IC for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 11:47:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0rp9-0002L0-I3 for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 11:47:20 -0400 Original-Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:36761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0rp9-0002KU-86 for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 11:47:19 -0400 Original-Received: by mail-lf0-x229.google.com with SMTP id c80so14701590lfh.3 for ; Wed, 19 Apr 2017 08:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=JM2KHcTi1w4HF23RmGfBpal+eMq1NCbHoKBk6aHxOOk=; b=sm4B6qSCAOv9DzvjvCBNSXzh7ilf7+dBVEuP/iBwUZlNDrGgODlQjKlr9RY25b3sEW bBszWcy70uPCWSb7hH/nIAfExLheol1vNpr0dNtNg+GxWcQTyIQcGkShQ5wvr4RNOofv acExYOzPA6dtDM/L6ZWQPQ6QXE9DkAl2o3+qRpjDpju0eEKuCWcYskmaaaLz+4hrGUqQ zy7DS2YYhpf75r6/MBy3+N2E8qjnm/k6YtyIX3Y1q65xwnZ9JgJWPxMg0S97YR1lrc/4 K1j0b3VzPwn9wBt+VSC1WuqIpTaZmEVb2r36AGnN9aDdIa+j7qWxEjULP3uF25ZwlJ8Y FVTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=JM2KHcTi1w4HF23RmGfBpal+eMq1NCbHoKBk6aHxOOk=; b=Va44RCXACe43LBeIE3JOEl/+boLV/XCHJIZoUUTny3IB729Hrh6gavdh5wRCzKjlFY A9Sk3B8v89eo/dO/DxxcuOqy7u4iezsqe1pFHkB7UYtNrcyMQWySEiCldNwt4YzFCQsq 8E7WjRqB2FL3kBuL8lcBVNgXs6tj+uUZVpzLq0z48smAGqOvbG9hu0L1cWxnR8fTO+wS o8lEgWZ1G1YvmTRN7fIbDJsh8XiGvgqHUghZ0y381pozcNLGp4J5ss6yt3Xtim6z3rit OWh9SIXOJ9z54OSs/KDUF7cKEVIMB4MbHR/G4AFZR/pQ8/OiuyWmV5vDuW3useP5wiOJ Yhjg== X-Gm-Message-State: AN3rC/5wcGakQK21umkWYGSuiHXb0LRYsNCeHXkdiud2uXfyjLmM+HCC 1E+JQ5Epvp0zPUYMyww8loIbTkvhbQ== X-Received: by 10.25.145.83 with SMTP id y19mr1310085lfj.5.1492616837430; Wed, 19 Apr 2017 08:47:17 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131760 Archived-At: --94eb2c1cc63661855f054d86f0b0 Content-Type: text/plain; charset=UTF-8 The discussion on whether variables should end in "-p" came up few time on emacs-devel, at least the ones I was part of: 1. https://lists.gnu.org/archive/html/emacs-devel/2016-07/msg00734.html 2. http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00540.html Doing a rudimentary search in emacs/lisp/ code-base shows a sign of an undocumented convention that predicate functions, functions that return either nil or non-nil can end in "-p" (if the function name is multi-word, like nested-alist-p), or just "p" (if the function name is a single word, like stringp). I ran ag[1] in emacs/lisp: 1. 1511 matches -- defuns and defsubsts ending in -p -- ag 'def(un|subst)\s+[^ ]+-p\s+' --stats 2. 149 matches -- defvars, defconsts and defcustoms ending in -p -- ag 'def(var|const|custom)\s+[^ ]+-p\s+' --stats 3. 65 matches -- Just the user-facing defcustoms -- ag 'defcustom\s+[^ ]+-p\s+' --stats That corroborates that more functions tend to end in "-p" than variables. This bug report is to make a request to incorporate this unspoken rule as a rule in the Elisp manual. What would be the correct section to do so? [1]: https://github.com/ggreer/the_silver_searcher -- Kaushal Modi --94eb2c1cc63661855f054d86f0b0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The discussion on whether variables should end in "-p= " came up few time on emacs-devel, at least the ones I was part of:

D= oing a rudimentary search in emacs/lisp/ code-base shows a sign of an undoc= umented convention that predicate functions, functions that return either n= il or non-nil can end in "-p" (if the function name is multi-word= , like nested-alist-p), or just "p" (if the function name is a si= ngle word, like stringp).

I ran ag[1] in emacs/lisp:

1. 1511 matches -- defuns and defsubsts ending in -p -- a= g 'def(un|subst)\s+[^ ]+-p\s+' --stats
2. 149 matches -- defvars, defconsts and defcust= oms ending in -p -- ag 'def(var|const|custom)\s+[^ ]+-p\s+' --stats= =C2=A0
3. 65 matche= s -- Just the user-facing defcustoms -- ag 'defcustom\s+[^ ]+-p\s+'= --stats

That corroborates that more functions tend to end in "-p" than = variables.

This bug report is to make a request to= incorporate this unspoken rule as a rule in the Elisp manual.
What would be the correct section to do so?
--

Kaus= hal Modi

--94eb2c1cc63661855f054d86f0b0--