emacs question

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема emacs question
Дата
Msg-id 3847F5BD.EF522D7E@alumni.caltech.edu
обсуждение исходный текст
Ответы Re: emacs question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Sorry for the (slightly) off-topic question, but it *does* relate to
being able to use emacs for editing Postgres source files:

I'm trying to use emacs for more editing than I have previously (which
was restricted to Makefiles, lisp, and sgml). And I've got at least
two projects which have differing formatting requirements which also
differ from the emacs defaults.

I'm running into trouble trying to get the tab vs space stuff right.
For Postgres, I want to set the tabbing to 4 columns, and to preserve
tabs in the input and output. I think I can do that, with
 (setq tab-width 4) (setq standard-indent 4)

though I'm not sure that standard-indent needs to be adjusted at all.

For my other project, I need 2-column indents always space filled, so
no tabs allowed. It happens to be C++, so I can differentiate between
the C code for Postgres.

Anyway, the first complication was working through the fact that emacs
(20.4, if it matters) claims to have loaded "cc-mode" on startup, when
in fact the major mode is actually called "c++-mode" internally. So I
had a devil of a time setting the hooks.

But I'm also having trouble getting things to space-fill when
indenting. I've tried
 (setq c++-mode-hook 'rtc-cc-mode)
 (defun rtc-cc-mode ()   (setq tab-width 2)   (setq standard-indent 2)   (setq indent-tab-mode nil))

which gave me two-column tabs, but I had hoped that nil-ing
indent-tab-mode would space fill. untabify gets rid of the tabs in a
selected region, but the tabs come back if I hit the tab key. I've
tried nil-ing the other values and setting them to zero, but that
seems to revert the behavior to 8 column tabs.

My emacs book got me this far, but the behavior seems to be a bit at
odds with their description and they don't give a specific example
covering this. Any hints would be *greatly* appreciated.

TIA
                   - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: [Fwd: postgresql-6.5.3. RPMs (Well Done!)]
Следующее
От: Lamar Owen
Дата:
Сообщение: Re: [HACKERS] postmaster.pid