unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* C coding conventions for notmuch
@ 2010-11-23 18:48 Daniel Kahn Gillmor
  2010-11-24  0:39 ` Rob Browning
  2010-11-24 21:25 ` Michal Sojka
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Kahn Gillmor @ 2010-11-23 18:48 UTC (permalink / raw)
  To: notmuch


[-- Attachment #1.1: Type: text/plain, Size: 620 bytes --]

hey notmuch folks--

attached is a .dir-locals.el file; placed in the root of the notmuch
source tree, it makes emacs pick the default coding style (at least,
using the style i see in notmuch-show.c today).

If we want a consistent coding style for the project, this would
probably be a good place to define it so that those of us who use emacs
as our editor don't have to think about it.

Thanks to rlb on #notmuch for pointing me to the right bit of emacs
documentation [0] to sort this out.

Regards,

	--dkg

[0]
http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html


[-- Attachment #1.2: .dir-locals.el --]
[-- Type: text/plain, Size: 241 bytes --]

; emacs local configuration settings for notmuch source
; surmised by dkg on 2010-11-23 13:43:18-0500

(
 (c-mode . (
            (indent-tabs-mode . t)
            (tab-width . 8)
            (c-basic-offset . 4)
            )
         )
)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 900 bytes --]

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

* Re: C coding conventions for notmuch
  2010-11-23 18:48 C coding conventions for notmuch Daniel Kahn Gillmor
@ 2010-11-24  0:39 ` Rob Browning
  2010-11-24  0:58   ` Jameson Rollins
  2010-11-24 21:25 ` Michal Sojka
  1 sibling, 1 reply; 6+ messages in thread
From: Rob Browning @ 2010-11-24  0:39 UTC (permalink / raw)
  To: notmuch

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

> attached is a .dir-locals.el file; placed in the root of the notmuch
> source tree, it makes emacs pick the default coding style (at least,
> using the style i see in notmuch-show.c today).

Carl also suggested he might want to folow "linux" style in general, so
perhaps:

  ((c-mode . ((c-file-style "linux")
              (indent-tabs-mode . t)
              (tab-width . 8)
              (c-basic-offset . 4))))

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

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

* Re: C coding conventions for notmuch
  2010-11-24  0:39 ` Rob Browning
@ 2010-11-24  0:58   ` Jameson Rollins
  0 siblings, 0 replies; 6+ messages in thread
From: Jameson Rollins @ 2010-11-24  0:58 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

On Tue, 23 Nov 2010 13:48:40 -0500, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:
> attached is a .dir-locals.el file; placed in the root of the notmuch
> source tree, it makes emacs pick the default coding style (at least,
> using the style i see in notmuch-show.c today).

On Tue, 23 Nov 2010 18:39:07 -0600, Rob Browning <rlb@defaultvalue.org> wrote:
> Carl also suggested he might want to folow "linux" style in general, so
> perhaps:

You guys should just send these as patches.  Seems like it would be a
good idea to me just to keep this file with the source.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: C coding conventions for notmuch
  2010-11-23 18:48 C coding conventions for notmuch Daniel Kahn Gillmor
  2010-11-24  0:39 ` Rob Browning
@ 2010-11-24 21:25 ` Michal Sojka
  2010-11-24 21:54   ` Daniel Kahn Gillmor
  1 sibling, 1 reply; 6+ messages in thread
From: Michal Sojka @ 2010-11-24 21:25 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, notmuch

On Tue, 23 Nov 2010, Daniel Kahn Gillmor wrote:
> hey notmuch folks--
> 
> ; emacs local configuration settings for notmuch source
> ; surmised by dkg on 2010-11-23 13:43:18-0500
> 
> (
>  (c-mode . (
>             (indent-tabs-mode . t)
>             (tab-width . 8)
>             (c-basic-offset . 4)

;; I think, that Carl also likes this setting :-)
              (c-cleanup-list . (space-before-funcall))
              
>             )
>          )
> )

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

* Re: C coding conventions for notmuch
  2010-11-24 21:25 ` Michal Sojka
@ 2010-11-24 21:54   ` Daniel Kahn Gillmor
  2010-11-25 11:08     ` Michal Sojka
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Kahn Gillmor @ 2010-11-24 21:54 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

On 11/24/2010 04:25 PM, Michal Sojka wrote:
>               (c-cleanup-list . (space-before-funcall))

This line makes my emacs prompt that it "may not be safe" -- it seems
impolite to ask users just opening up the code within emacs to execute
arbitrary emacs macros.

This sort of decision is what made the Word Macro virus effective ;)

	--dkg


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 900 bytes --]

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

* Re: C coding conventions for notmuch
  2010-11-24 21:54   ` Daniel Kahn Gillmor
@ 2010-11-25 11:08     ` Michal Sojka
  0 siblings, 0 replies; 6+ messages in thread
From: Michal Sojka @ 2010-11-25 11:08 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, notmuch

On Wed, 24 Nov 2010, Daniel Kahn Gillmor wrote:
> On 11/24/2010 04:25 PM, Michal Sojka wrote:
> >               (c-cleanup-list . (space-before-funcall))
> 
> This line makes my emacs prompt that it "may not be safe" -- it seems
> impolite to ask users just opening up the code within emacs to execute
> arbitrary emacs macros.


Hmm. I have this settings in .emacs instead of .dir-locals.el so I
didn't noticed that.

This is the relevant piece of my .emacs if somebody is interested in it:

(defconst cworth-c-style
  `((c-basic-offset . 4)
    (c-cleanup-list . (space-before-funcall)))
    "Carl Worth's C/C++ Programming Style")

(c-add-style "cworth" cworth-c-style)


(dir-locals-set-class-variables
 'notmuch
 '((c-mode . ((c-file-style . "cworth")))
   (c++-mode . ((c-file-style . "cworth")))))
(dir-locals-set-directory-class "~/src/notmuch" 'notmuch)


-Michal

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

end of thread, other threads:[~2010-11-25 11:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23 18:48 C coding conventions for notmuch Daniel Kahn Gillmor
2010-11-24  0:39 ` Rob Browning
2010-11-24  0:58   ` Jameson Rollins
2010-11-24 21:25 ` Michal Sojka
2010-11-24 21:54   ` Daniel Kahn Gillmor
2010-11-25 11:08     ` Michal Sojka

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

	https://yhetil.org/notmuch.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).