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: Emanuel Berg
Subject: Re: The function naming convention used by Emacs.
Date: Sun, 26 Sep 2021 13:48:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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)

and do byte-compile for more pointers ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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