all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Hongyi Zhao <hongyi.zhao@gmail.com>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: RE: [External] : The function naming convention used by Emacs.
Date: Sun, 26 Sep 2021 17:04:47 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488E01B50A65266F71A750EF3A69@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CAGP6POJ3FyyVWmu3wZ7V84dODaSiBrafHvnSLE1f-Nt-ZRMqfw@mail.gmail.com>

> As far as function names are concerned, are there some established
> conventions used by Emacs? For example, I noticed that there are so
> many functions in Emacs named by the suffix `-p', say,
> `file-exists-p', `ht-equal-p', and so on. But I still can't figure
> out the meaning of this suffix. Any tips will be appreciated.

Ask Emacs!

In the Elisp manual, `i' followed by `convention'
(if you have substring completion turned on) shows
these index-entry candidates (the exact list might
depend on your Emacs version):

 buffer display conventions
 coding conventions in Emacs Lisp 
 comments, Lisp convention for
 conventions for writing major modes 
 conventions for writing minor modes
 documentation conventions 
 documentation strings, conventions and tips
 key binding, conventions for 
 major mode conventions
 minor mode conventions 
 programming conventions
 set-advertised-calling-convention 
 typographic conventions

Some of those point to the same nodes of the manual.

Choosing, say, `coding conventions in Emacs Lisp'
takes you to node `Coding Conventions', where you
find this:

   • If the purpose of a function is to tell you
     whether a certain condition is true or false,
     give the function a name that ends in ‘p’
     (which stands for “predicate”).  If the name
     is one word, add just ‘p’; if the name is
     multiple words, add ‘-p’.  Examples are
     ‘framep’ and ‘frame-live-p’.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html



  parent reply	other threads:[~2021-09-26 17:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26 11:05 The function naming convention used by Emacs Hongyi Zhao
2021-09-26 11:27 ` 2QdxY4RzWzUUiLuE
2021-09-26 11:49   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-26 11:50   ` Hongyi Zhao
2021-09-26 11:48 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-26 12:18   ` Hongyi Zhao
2021-09-26 13:34     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-26 17:04 ` Drew Adams [this message]
2021-09-27  5:46   ` [External] : " Hongyi Zhao
2021-09-27 14:53     ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488E01B50A65266F71A750EF3A69@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.