unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Objective C coding style
@ 2012-07-12  1:15 Samuel Bronson
  2012-07-12  9:15 ` Jan Djärv
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Bronson @ 2012-07-12  1:15 UTC (permalink / raw)
  To: emacs-devel

I've noticed that the Objective C code of the NeXTstep port doesn't  
have a very consistent style.  I expect this is something to do with  
the fact that (standards.info) doesn't cover Objective C.  Would it be  
appropriate to adopt the GNUstep coding style?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Objective C coding style
  2012-07-12  1:15 Objective C coding style Samuel Bronson
@ 2012-07-12  9:15 ` Jan Djärv
  2012-07-12 16:52   ` Samuel Bronson
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Djärv @ 2012-07-12  9:15 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: emacs-devel

Hello.

12 jul 2012 kl. 03:15 skrev Samuel Bronson:

> I've noticed that the Objective C code of the NeXTstep port doesn't have a very consistent style.  I expect this is something to do with the fact that (standards.info) doesn't cover Objective C.  Would it be appropriate to adopt the GNUstep coding style?

How does that style look?  Is it "compatible" with the GNU C-style, for example w.r.t. braces?

	Jan D.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Objective C coding style
  2012-07-12  9:15 ` Jan Djärv
@ 2012-07-12 16:52   ` Samuel Bronson
  2012-07-13 10:13     ` Jan Djärv
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Bronson @ 2012-07-12 16:52 UTC (permalink / raw)
  To: Jan Djärv; +Cc: emacs-devel


On Jul 12, 2012, at 5:15 AM, Jan Djärv wrote:

> Hello.
>
> 12 jul 2012 kl. 03:15 skrev Samuel Bronson:
>
>> I've noticed that the Objective C code of the NeXTstep port doesn't  
>> have a very consistent style.  I expect this is something to do  
>> with the fact that (standards.info) doesn't cover Objective C.   
>> Would it be appropriate to adopt the GNUstep coding style?
>
> How does that style look?  Is it "compatible" with the GNU C-style,  
> for example w.r.t. braces?

Yes.  The GNUstep coding standards make normative reference to the GNU  
coding standards, summarize some of the more important rules, and lay  
down rules regarding the additional constructs and namespaces found in  
Objective C.

For example, they dictate where the whitespace should go in method  
signatures, how message expressions may be indentented, and how  
classes and methods are to be named.  There are a few GNUstep-specific  
rules (like prefixing GNUstep-only class names with GS), but those are  
easy to spot and ignore.

You can take a look at <http://www.gnustep.org/resources/documentation/Developer/CodingStandards/coding-standards.pdf 
 >, or at <http://www.gnustep.org/resources/documentation/Developer/CodingStandards/coding-standards_3.html 
 > and <http://www.gnustep.org/resources/documentation/Developer/CodingStandards/coding-standards_7.html 
 >.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Objective C coding style
  2012-07-12 16:52   ` Samuel Bronson
@ 2012-07-13 10:13     ` Jan Djärv
  2012-07-13 15:54       ` Glenn Morris
  2012-07-13 17:10       ` Glenn Morris
  0 siblings, 2 replies; 8+ messages in thread
From: Jan Djärv @ 2012-07-13 10:13 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: emacs-devel

Hello.

12 jul 2012 kl. 18:52 skrev Samuel Bronson:

> 
> On Jul 12, 2012, at 5:15 AM, Jan Djärv wrote:
> 
>> Hello.
>> 
>> 12 jul 2012 kl. 03:15 skrev Samuel Bronson:
>> 
>>> I've noticed that the Objective C code of the NeXTstep port doesn't have a very consistent style.  I expect this is something to do with the fact that (standards.info) doesn't cover Objective C.  Would it be appropriate to adopt the GNUstep coding style?
>> 
>> How does that style look?  Is it "compatible" with the GNU C-style, for example w.r.t. braces?
> 
> Yes.  The GNUstep coding standards make normative reference to the GNU coding standards, summarize some of the more important rules, and lay down rules regarding the additional constructs and namespaces found in Objective C.
> 
> For example, they dictate where the whitespace should go in method signatures, how message expressions may be indentented, and how classes and methods are to be named.  There are a few GNUstep-specific rules (like prefixing GNUstep-only class names with GS), but those are easy to spot and ignore.
> 
> You can take a look at <http://www.gnustep.org/resources/documentation/Developer/CodingStandards/coding-standards.pdf>, or at <http://www.gnustep.org/resources/documentation/Developer/CodingStandards/coding-standards_3.html> and <http://www.gnustep.org/resources/documentation/Developer/CodingStandards/coding-standards_7.html>.

I think it would be a good addition, but I guess it is up to the cc-mode developers.  There is currently no ObjC-style in cc-mode.  But ObjC is not well handeled by cc-mode (c-defun-name does not work at all with ObjC for example), so I am not optimistic.

Another question is if it should be the default for just the Emacs project or globally.

	Jan D.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Objective C coding style
  2012-07-13 10:13     ` Jan Djärv
@ 2012-07-13 15:54       ` Glenn Morris
  2012-07-14  1:51         ` Leo
  2012-07-13 17:10       ` Glenn Morris
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2012-07-13 15:54 UTC (permalink / raw)
  To: Jan Djärv; +Cc: Samuel Bronson, emacs-devel

Jan Djärv wrote:

> There is currently no ObjC-style in cc-mode. But ObjC is not well
> handeled by cc-mode (c-defun-name does not work at all with ObjC for
> example), so I am not optimistic.

It's probably no coincidence that the main NS port developer at the time
posted a patch to improve cc-mode's handling of objective-c. I don't
know if anything ever happened with it: http://debbugs.gnu.org/299



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Objective C coding style
  2012-07-13 10:13     ` Jan Djärv
  2012-07-13 15:54       ` Glenn Morris
@ 2012-07-13 17:10       ` Glenn Morris
  2012-07-14  9:09         ` Jan Djärv
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2012-07-13 17:10 UTC (permalink / raw)
  To: Jan Djärv; +Cc: Samuel Bronson, emacs-devel

Jan Djärv wrote:

> (c-defun-name does not work at all with ObjC for example)

I see you have a patch for that: http://debbugs.gnu.org/7879  (also 9032)
I'd just install it if I were you.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Objective C coding style
  2012-07-13 15:54       ` Glenn Morris
@ 2012-07-14  1:51         ` Leo
  0 siblings, 0 replies; 8+ messages in thread
From: Leo @ 2012-07-14  1:51 UTC (permalink / raw)
  To: emacs-devel

On 2012-07-13 23:54 +0800, Glenn Morris wrote:
> It's probably no coincidence that the main NS port developer at the time
> posted a patch to improve cc-mode's handling of objective-c. I don't
> know if anything ever happened with it: http://debbugs.gnu.org/299

In my experience, these patch have been integrated.

Leo




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Objective C coding style
  2012-07-13 17:10       ` Glenn Morris
@ 2012-07-14  9:09         ` Jan Djärv
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Djärv @ 2012-07-14  9:09 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Samuel Bronson, emacs-devel

Hello.

13 jul 2012 kl. 19:10 skrev Glenn Morris:

> Jan Djärv wrote:
> 
>> (c-defun-name does not work at all with ObjC for example)
> 
> I see you have a patch for that: http://debbugs.gnu.org/7879  (also 9032)
> I'd just install it if I were you.

I did so.

	Jan D.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-07-14  9:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-12  1:15 Objective C coding style Samuel Bronson
2012-07-12  9:15 ` Jan Djärv
2012-07-12 16:52   ` Samuel Bronson
2012-07-13 10:13     ` Jan Djärv
2012-07-13 15:54       ` Glenn Morris
2012-07-14  1:51         ` Leo
2012-07-13 17:10       ` Glenn Morris
2012-07-14  9:09         ` Jan Djärv

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).