emacs-devel
[Top][All Lists]
Advanced

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

Re: declare function/macro private


From: Stefan Monnier
Subject: Re: declare function/macro private
Date: Tue, 08 Jun 2021 11:46:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> The point was just to support Paul Rankin's position that a '--'
> substring isn't a reliable determinant of a function's public/private
> nature, so can't be used as an alternative to an explicit (optional)
> declaration.

FWIW, I do not think a function should be considered non-internal just
because it has to be declared as interactive.

Similarly, the default value of a `foo-function` or `foo-hook` variable
can very much be an internal function, IMO.

The point of "internal" is that other code shouldn't use this directly
because it is subject to change, removal, or unexpected behavior if
called in a different context, ...

More concretely it means that end users are recommended not to do:

   (define-key company-active-map [my-key-sequence]
     #'company--select-next-and-warn)

If they want to use another key than `M-n` they should presumably do:

   (define-key company-active-map [my-key-sequence]
     (lookup-key company-active-map (kbd "M-n")))

[ I don't know if this use of "--" in company.el was a good idea,
  OTOH. ;-)  ]


        Stefan




reply via email to

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