kamat@uceng.UC.EDU (Govind N. Kamat) (09/13/89)
I'd like my C indentation to look like this:
char *
function(arg)
int arg;
The GNU Emacs manual says that this is supposed to be the default
style, setting no indentation variables; however, I seem to end up
with:
char *
function(arg)
int arg;
And perhaps I can ask one more question of you "GNUru's": we have
some terminals using ^h for erasure, and others with "delete" keys.
Now I use the key-translate-table to set emacs up correctly, but is
there some way I could get the tty setup information communicated to
emacs automatically?
Please reply by e-mail, and if there is enough interest, I'll post a
summary. Thanks for your help!
--
Govind N. Kamat College of Engineering
kamat@uceng.UC.EDU University of Cincinnati
Cincinnati, OH 45221, USAjym@APPLE.COM (09/14/89)
Well, as long as we're doing indentation problems . . . I like to indent this way: status = function_with_many_args( first_in_the_series_of_arguments, second_in_this_thrilling_series, this_stuff_just_goes_on_and_on, the_point_being_that_one_needs_several_lines_to_do_this, well, you_get_the_idea ); C mode assumes you want to indent to where the left paren is. I don't. Any suggestions? ::::.-----.:::::<_Jym_>::::::::::::::::::::::::::::::::::::::::::: :::/ | \::::.-----.:::::::::::::::: Jym Dyer ::::::::::::::::: ::/ | \::/ o o \::::::::::::: jym@nli.com :::::::::::::::: ::\ /|\ /::\ \___/ /::::::::: Natural Languages, Inc. :::::::: :::\ / | \ /::::`-----':::::::::: Berserkeley, California :::::::: ::::`-----':::::::::::::::::::::::::::::::::::::::::::::::::::::::
kamat@uceng.UC.EDU (Govind N. Kamat) (09/26/89)
In article <KAMAT.89Sep12182842@uceng.UC.EDU> I'd asked:
I'd like my C indentation to look like this:
char *
function(arg)
int arg;
The GNU Emacs manual says that this is supposed to be the default
style, setting no indentation variables; however, I seem to end up
with:
char *
function(arg)
int arg;
Well, I received quite a few messages, all asking me to summarize
anything discovered. Alas, I got no solutions :) and so I poked
around in the code myself. The following seems to work for me:
Apply this patch to c-mode.el. You will also have to build the binary
again since c-mode is listed in loadup.el. Alternatively, I guess you
could reload c-mode in your .emacs. If your taste runs to having the
argument declarations align on the left margin, set the variable
c-argdecl-indent to 0.
Let me know if you find this breaks anything.
*** c-mode.el.OLD Tue Sep 19 21:41:32 1989
--- c-mode.el Tue Sep 19 21:41:43 1989
***************
*** 385,391 ****
;; Now add a little if this is a continuation line.
(+ basic-indent (if (or (bobp)
(memq (preceding-char) '(?\) ?\; ?\})))
! 0 c-continued-statement-offset)))))
((/= (char-after containing-sexp) ?{)
;; line is expression, not statement:
;; indent to just after the surrounding open.
--- 385,391 ----
;; Now add a little if this is a continuation line.
(+ basic-indent (if (or (bobp)
(memq (preceding-char) '(?\) ?\; ?\})))
! 0 0)))))
((/= (char-after containing-sexp) ?{)
;; line is expression, not statement:
;; indent to just after the surrounding open.
--
Govind N. Kamat College of Engineering
kamat@uceng.UC.EDU University of Cincinnati
Cincinnati, OH 45221, USA