Re: Setting up development environment

2007-07-16 Thread Dag-Erling Smørgrav
Brian Chu [EMAIL PROTECTED] writes:
 Dag-Erling Smørgrav [EMAIL PROTECTED] writes:
  Brian Chu [EMAIL PROTECTED] writes:
   I have a question about indentation.  In the previously supplied
   .emacs hook, tabs are represented by 8 spaces.
  No, Emacs automatically converts spaces to tabs according to the current
  setting of tab-width, which is normally 8.
 Hm.  It doesn't always replace 8 spaces with tabs (for files that are
 heavily spaced-indented), but I suppose that using `M-x tabify` would
 do the trick.

The indentation code, which is what we were discussing, does.

Please do not top-post.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting up development environment

2007-07-16 Thread Tom Evans
On Wed, 2007-05-30 at 08:21 +0200, Dag-Erling Smørgrav wrote:
...
 Emacs setup (for both C and C++):
 
 (defun des-knf ()
   (interactive)
 
   ;; Basic indent is 8 spaces
   (make-local-variable 'c-basic-offset)
   (setq c-basic-offset 8)
 
   ;; Continuation lines are indented 4 spaces
   (make-local-variable 'c-offsets-alist)
   (c-set-offset 'arglist-cont 4)
   (c-set-offset 'arglist-cont-nonempty 4)
   (c-set-offset 'statement-cont 4)
 
   ;; Labels are flush to the left
   (c-set-offset 'label [0])
 
   ;; Fill column
   (make-local-variable 'fill-column)
   (setq fill-column 74))
 
 (add-hook 'c-mode-common-hook 'des-knf)
 
 As for how to cross-build, read build(7).
 
 DES

Before I start translating this/style(9), does anyone already have an
equivalent for vim?

Regards

Tom


signature.asc
Description: This is a digitally signed message part


Re: Setting up development environment

2007-07-16 Thread Sean C. Farley

On Mon, 16 Jul 2007, Tom Evans wrote:


On Wed, 2007-05-30 at 08:21 +0200, Dag-Erling Smørgrav wrote:
...

Emacs setup (for both C and C++):

(defun des-knf ()
  (interactive)

  ;; Basic indent is 8 spaces
  (make-local-variable 'c-basic-offset)
  (setq c-basic-offset 8)

  ;; Continuation lines are indented 4 spaces
  (make-local-variable 'c-offsets-alist)
  (c-set-offset 'arglist-cont 4)
  (c-set-offset 'arglist-cont-nonempty 4)
  (c-set-offset 'statement-cont 4)

  ;; Labels are flush to the left
  (c-set-offset 'label [0])

  ;; Fill column
  (make-local-variable 'fill-column)
  (setq fill-column 74))

(add-hook 'c-mode-common-hook 'des-knf)

As for how to cross-build, read build(7).

DES


Before I start translating this/style(9), does anyone already have an
equivalent for vim?


I have not made a proper indent file out of this, but this is what I
use.  Before I work on BSD code I just run :call FreeBSD_Style().  The
IgnoreParenIndent() function is needed to avoid vim's built-in cindent
code when it comes to line-continuation after a parentheses.  Better
solutions are welcome.

-

set nocompatible
set autoindent

 Let vim determine the file type to be edited.
filetype plugin indent on

 Ignore indents caused by parentheses in FreeBSD style.
fun! IgnoreParenIndent()
let indent = cindent(v:lnum)

if indent  4000
if cindent(v:lnum - 1)  4000
return indent(v:lnum - 1)
else
return indent(v:lnum - 1) + 4
endif
else
return (indent)
endif
endfun

 Conform to style(9).
fun! FreeBSD_Style()
setlocal cindent
setlocal formatoptions=clnoqrt
setlocal textwidth=80

setlocal indentexpr=IgnoreParenIndent()
setlocal indentkeys=0{,0},0),:,0#,!^F,o,O,e

setlocal cinoptions=(4200,u4200,+0.5s,*500,t0,U4200
setlocal shiftwidth=8
setlocal tabstop=8
setlocal noexpandtab
endfun

-

Sean
--
[EMAIL PROTECTED]___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]

Re: Setting up development environment

2007-07-15 Thread Brian Chu

I have a question about indentation.  In the previously supplied
.emacs hook, tabs are represented by 8 spaces.  Most of the kernel
code, however, actually uses the tab character.

Are both forms acceptable?  If not, anyone willing to share their
tab-character-tabs .emacs c hook?

Thanks,
Brian

On 5/30/07, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:

Daniel Molina Wegener [EMAIL PROTECTED] writes:
Is there any official way to setup a development environment for
 FreeBSD. I mean, I want to contribute with FreeBSD development. All
 I know that there is a Developer's Handbook, but what about setting a
 development environment for FreeBSD-CURRENT and -STABLE including
 from official c-mode-hooks and c++-mode-hooks for emacs to environment
 variables for cross-compiling the FreeBSD source.

Emacs setup (for both C and C++):

(defun des-knf ()
  (interactive)

  ;; Basic indent is 8 spaces
  (make-local-variable 'c-basic-offset)
  (setq c-basic-offset 8)

  ;; Continuation lines are indented 4 spaces
  (make-local-variable 'c-offsets-alist)
  (c-set-offset 'arglist-cont 4)
  (c-set-offset 'arglist-cont-nonempty 4)
  (c-set-offset 'statement-cont 4)

  ;; Labels are flush to the left
  (c-set-offset 'label [0])

  ;; Fill column
  (make-local-variable 'fill-column)
  (setq fill-column 74))

(add-hook 'c-mode-common-hook 'des-knf)

As for how to cross-build, read build(7).

DES
--
Dag-Erling Smørgrav - [EMAIL PROTECTED]

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting up development environment

2007-07-15 Thread Dag-Erling Smørgrav
Brian Chu [EMAIL PROTECTED] writes:
 I have a question about indentation.  In the previously supplied
 .emacs hook, tabs are represented by 8 spaces.

No, Emacs automatically converts spaces to tabs according to the current
setting of tab-width, which is normally 8.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting up development environment

2007-07-15 Thread Brian Chu

Hm.  It doesn't always replace 8 spaces with tabs (for files that are
heavily spaced-indented), but I suppose that using `M-x tabify` would
do the trick.

Thanks!

Brian

On 7/15/07, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:

Brian Chu [EMAIL PROTECTED] writes:
 I have a question about indentation.  In the previously supplied
 .emacs hook, tabs are represented by 8 spaces.

No, Emacs automatically converts spaces to tabs according to the current
setting of tab-width, which is normally 8.

DES
--
Dag-Erling Smørgrav - [EMAIL PROTECTED]


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting up development environment

2007-07-15 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
Brian Chu [EMAIL PROTECTED] writes:
: I have a question about indentation.  In the previously supplied
: .emacs hook, tabs are represented by 8 spaces.  Most of the kernel
: code, however, actually uses the tab character.
: 
: Are both forms acceptable?  If not, anyone willing to share their
: tab-character-tabs .emacs c hook?

Use hard tabs.  Don't use spaces, since they cause more problems than
the tabs.  The big problem is that emacs likes to 'reformat' adjacent
lines if you have the settings to use spaces.

Warner


: Thanks,
: Brian
: 
: On 5/30/07, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:
:  Daniel Molina Wegener [EMAIL PROTECTED] writes:
:  Is there any official way to setup a development environment for
:   FreeBSD. I mean, I want to contribute with FreeBSD development. All
:   I know that there is a Developer's Handbook, but what about setting a
:   development environment for FreeBSD-CURRENT and -STABLE including
:   from official c-mode-hooks and c++-mode-hooks for emacs to environment
:   variables for cross-compiling the FreeBSD source.
: 
:  Emacs setup (for both C and C++):
: 
:  (defun des-knf ()
:(interactive)
: 
:;; Basic indent is 8 spaces
:(make-local-variable 'c-basic-offset)
:(setq c-basic-offset 8)
: 
:;; Continuation lines are indented 4 spaces
:(make-local-variable 'c-offsets-alist)
:(c-set-offset 'arglist-cont 4)
:(c-set-offset 'arglist-cont-nonempty 4)
:(c-set-offset 'statement-cont 4)
: 
:;; Labels are flush to the left
:(c-set-offset 'label [0])
: 
:;; Fill column
:(make-local-variable 'fill-column)
:(setq fill-column 74))
: 
:  (add-hook 'c-mode-common-hook 'des-knf)
: 
:  As for how to cross-build, read build(7).
: 
:  DES
:  --
:  Dag-Erling Smørgrav - [EMAIL PROTECTED]
: ___
: freebsd-hackers@freebsd.org mailing list
: http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
: To unsubscribe, send any mail to [EMAIL PROTECTED]
: 
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting up development environment

2007-05-30 Thread Dag-Erling Smørgrav
Daniel Molina Wegener [EMAIL PROTECTED] writes:
Is there any official way to setup a development environment for
 FreeBSD. I mean, I want to contribute with FreeBSD development. All
 I know that there is a Developer's Handbook, but what about setting a
 development environment for FreeBSD-CURRENT and -STABLE including
 from official c-mode-hooks and c++-mode-hooks for emacs to environment
 variables for cross-compiling the FreeBSD source.

Emacs setup (for both C and C++):

(defun des-knf ()
  (interactive)

  ;; Basic indent is 8 spaces
  (make-local-variable 'c-basic-offset)
  (setq c-basic-offset 8)

  ;; Continuation lines are indented 4 spaces
  (make-local-variable 'c-offsets-alist)
  (c-set-offset 'arglist-cont 4)
  (c-set-offset 'arglist-cont-nonempty 4)
  (c-set-offset 'statement-cont 4)

  ;; Labels are flush to the left
  (c-set-offset 'label [0])

  ;; Fill column
  (make-local-variable 'fill-column)
  (setq fill-column 74))

(add-hook 'c-mode-common-hook 'des-knf)

As for how to cross-build, read build(7).

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting up development environment

2007-05-30 Thread Luiz Otavio Souza

Daniel Molina Wegener escreveu:

Hello,

   Is there any official way to setup a development environment for
FreeBSD. I mean, I want to contribute with FreeBSD development. All
I know that there is a Developer's Handbook, but what about setting a
development environment for FreeBSD-CURRENT and -STABLE including
from official c-mode-hooks and c++-mode-hooks for emacs to environment
variables for cross-compiling the FreeBSD source.

   Can anyone guide me, or send me tips to get an optimal chance to
contribute with FreeBSD?.

Best regards,
  
Check the development(7) man page (and send good work, good ideias to 
the project).


luiz
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Setting up development environment

2007-05-29 Thread Daniel Molina Wegener

Hello,

   Is there any official way to setup a development environment for
FreeBSD. I mean, I want to contribute with FreeBSD development. All
I know that there is a Developer's Handbook, but what about setting a
development environment for FreeBSD-CURRENT and -STABLE including
from official c-mode-hooks and c++-mode-hooks for emacs to environment
variables for cross-compiling the FreeBSD source.

   Can anyone guide me, or send me tips to get an optimal chance to
contribute with FreeBSD?.

Best regards,
-- 
 .O. | Daniel Molina Wegener   | C/C++ Developer
 ..O | dmw [at] unete [dot] cl | FOSS Coding Adict
 OOO | BSD  Linux User| Standards Rocks!


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]