help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The function naming convention used by Emacs.


From: Hongyi Zhao
Subject: Re: The function naming convention used by Emacs.
Date: Sun, 26 Sep 2021 20:18:49 +0800

On Sun, Sep 26, 2021 at 7:49 PM Emanuel Berg via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Hongyi Zhao 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.
>
> It stands for "predicate", such a function returns t or nil.
>
> there is also the "f" suffix for "function", e.g. `cl-incf'
> and `cl-decf' ... and a couple of other conventions I can't
> remember right now.
>
> Speaking of CL, the convention for *global-variables* is not
> encouraged in Elisp.
>
> Other than that do this
>
> (require 'checkdoc)
>
> (setq checkdoc-permit-comma-termination-flag t)
>
> (defun check-package-style ()
>   (interactive)
>   (let ((msg "Style check..."))
>     (message msg)
>     (checkdoc-current-buffer t) ; TAKE-NOTES
>     (message "%sdone" msg) ))
> (defalias 'check-style #'check-package-style)

Do you mean and suggest adding the above code snippets into the init file?

> and do byte-compile for more pointers ...

I now use the `--with-native-compilation' option to configure Emacs
for compilation. So, the thing you mentioned above should have been
done automatically by Emacs.

HZ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]