From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: [External] : The function naming convention used by Emacs.
Date: Mon, 27 Sep 2021 13:46:17 +0800 [thread overview]
Message-ID: <CAGP6POLWMgH8cCw9MPB2c9aiBGBf+xGr_2ZDOzRCxw_QwqTKYg@mail.gmail.com> (raw)
In-Reply-To: <SJ0PR10MB5488E01B50A65266F71A750EF3A69@SJ0PR10MB5488.namprd10.prod.outlook.com>
On Mon, Sep 27, 2021 at 1:04 AM Drew Adams <drew.adams@oracle.com> wrote:
>
> > 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)
What's the exact vanilla Emacs keystrokes corresponding to the above operations?
> 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
Thank you for showing me this. With swiper [1], I use the following
command to access the above Elisp manual built-in Emacs:
C-h i RET elisp RET cod conv RET
[1] https://github.com/abo-abo/swiper
HZ
next prev parent reply other threads:[~2021-09-27 5:46 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 ` [External] : " Drew Adams
2021-09-27 5:46 ` Hongyi Zhao [this message]
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=CAGP6POLWMgH8cCw9MPB2c9aiBGBf+xGr_2ZDOzRCxw_QwqTKYg@mail.gmail.com \
--to=hongyi.zhao@gmail.com \
--cc=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
/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.