unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26564: Document that only functions and not variables can end with "-p"
@ 2017-04-19 15:47 Kaushal Modi
  2017-04-19 16:08 ` Eli Zaretskii
  2017-04-19 17:26 ` Drew Adams
  0 siblings, 2 replies; 19+ messages in thread
From: Kaushal Modi @ 2017-04-19 15:47 UTC (permalink / raw)
  To: 26564

[-- Attachment #1: Type: text/plain, Size: 1195 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2080 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-10-14  7:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-19 15:47 bug#26564: Document that only functions and not variables can end with "-p" Kaushal Modi
2017-04-19 16:08 ` Eli Zaretskii
2017-04-19 16:22   ` Kaushal Modi
2017-04-19 21:49     ` Michael Heerdegen
2017-04-19 22:04       ` Drew Adams
2017-04-19 22:18         ` Michael Heerdegen
2019-10-12 20:27     ` Lars Ingebrigtsen
2019-10-12 20:47       ` Kaushal Modi
2019-10-12 23:18       ` Drew Adams
2019-10-14  1:50         ` Richard Stallman
2019-10-14  2:22           ` Drew Adams
2019-10-14  7:24             ` Eli Zaretskii
2019-10-14  7:21           ` Eli Zaretskii
2017-04-19 17:26 ` Drew Adams
2017-04-19 21:44   ` Michael Heerdegen
2017-04-19 22:01     ` Drew Adams
2017-04-19 22:23       ` Michael Heerdegen
2017-04-19 22:28         ` Drew Adams
2017-04-20  1:42           ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).