GNU bug report logs -
#13740
About a coding convention
Previous Next
Reported by: Xue Fuqiao <xfq.free <at> gmail.com>
Date: Mon, 18 Feb 2013 00:27:02 UTC
Severity: wishlist
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13740 in the body.
You can then email your comments to 13740 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13740
; Package
emacs
.
(Mon, 18 Feb 2013 00:27:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Xue Fuqiao <xfq.free <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 18 Feb 2013 00:27:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In (info "(elisp) Coding Conventions"):
* Constructs that define a function or variable should be macros,
not functions, and their names should start with `define-'. The
macro should receive the name to be defined as the first argument.
That will help various tools find the definition automatically.
Avoid constructing the names in the macro itself, since that would
confuse these tools.
I think macros like `cl-defsubst', `cl-defun' should be mentioned here.
--
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13740
; Package
emacs
.
(Tue, 19 Feb 2013 19:57:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 13740 <at> debbugs.gnu.org (full text, mbox):
Xue Fuqiao wrote:
> In (info "(elisp) Coding Conventions"):
>
> * Constructs that define a function or variable should be macros,
> not functions, and their names should start with `define-'. The
> macro should receive the name to be defined as the first argument.
> That will help various tools find the definition automatically.
> Avoid constructing the names in the macro itself, since that would
> confuse these tools.
>
> I think macros like `cl-defsubst', `cl-defun' should be mentioned here.
Why? What would you say about them?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13740
; Package
emacs
.
(Thu, 21 Feb 2013 00:31:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 13740 <at> debbugs.gnu.org (full text, mbox):
On Tue, 19 Feb 2013 14:55:35 -0500
Glenn Morris <rgm <at> gnu.org> wrote:
> Xue Fuqiao wrote:
> > In (info "(elisp) Coding Conventions"):
> >
> > * Constructs that define a function or variable should be macros,
> > not functions, and their names should start with `define-'. The
> > macro should receive the name to be defined as the first argument.
> > That will help various tools find the definition automatically.
> > Avoid constructing the names in the macro itself, since that would
> > confuse these tools.
> >
> > I think macros like `cl-defsubst', `cl-defun' should be mentioned here.
> Why?
They are macros that define functions, but they don't start with `define-'.
> What would you say about them?
Maybe something like this:
Constructs that define a function or variable should be macros, not functions, and their names should start with `define-', except for some macros in `cl-lib', like `cl-defsubst' and `cl-defun'.
--
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13740
; Package
emacs
.
(Thu, 21 Feb 2013 02:13:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 13740 <at> debbugs.gnu.org (full text, mbox):
On Thu, 21 Feb 2013 01:54:56 +0000 (GMT)
Christopher Schmidt <christopher <at> ch.ristopher.com> wrote:
> Xue Fuqiao <xfq.free <at> gmail.com> writes:
> > They are macros that define functions, but they don't start with
> > `define-'.
> Anything about cl-lib does not belong into the Elisp node. IMO cl-lib
> breaking conventions is not worth a note, either.
But cl-lib is a part of Emacs. We make aliases like this:
define-inline-function-cl --> cl-defsubst
defune-function-cl --> cl-defun
Or we can mention the convention breakage in the CL manual.
> Christopher
--
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13740
; Package
emacs
.
(Thu, 21 Feb 2013 15:23:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 13740 <at> debbugs.gnu.org (full text, mbox):
> Constructs that define a function or variable should be macros, not
> functions, and their names should start with `define-', except for some
> macros in `cl-lib', like `cl-defsubst' and `cl-defun'.
Actually, I think they can also start with "<prefix>-define-".
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13740
; Package
emacs
.
(Thu, 21 Feb 2013 17:04:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 13740 <at> debbugs.gnu.org (full text, mbox):
Xue Fuqiao wrote:
> Constructs that define a function or variable should be macros, not
> functions, and their names should start with `define-', except for
> some macros in `cl-lib', like `cl-defsubst' and `cl-defun'.
I don't think it is useful to list pre-existing exceptions to a general
guideline.
The whole thing is mutually inconsistent anyway:
constructs that define functions, variables, etc., work better if
they start with @samp{defun} or @samp{defvar}, [...]
[...]
Constructs that define a function or variable should be macros,
not functions, and their names should start with @samp{define-}.
Reply sent
to
Stefan Kangas <stefan <at> marxist.se>
:
You have taken responsibility.
(Fri, 07 Aug 2020 11:24:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Xue Fuqiao <xfq.free <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 07 Aug 2020 11:24:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 13740-done <at> debbugs.gnu.org (full text, mbox):
Glenn Morris <rgm <at> gnu.org> writes:
> Xue Fuqiao wrote:
>
>> Constructs that define a function or variable should be macros, not
>> functions, and their names should start with `define-', except for
>> some macros in `cl-lib', like `cl-defsubst' and `cl-defun'.
>
> I don't think it is useful to list pre-existing exceptions to a general
> guideline.
Agreed. Since no one else has voiced an opinion, I'm therefore closing
this bug report.
Best regards,
Stefan Kangas
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 05 Sep 2020 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 233 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.