Re: Emacs vs pg_indent's weird indentation for function declarations

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Emacs vs pg_indent's weird indentation for function declarations
Дата
Msg-id CAEepm=0UtAPN2RChs7=pOqHm2uvbU6Px7vfyvt8_-eiP7=ozUg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Emacs vs pg_indent's weird indentation for function declarations  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Emacs vs pg_indent's weird indentation for function declarations  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On Mon, Jan 28, 2019 at 8:08 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Mon, Jan 28, 2019 at 12:28:30AM -0500, Tom Lane wrote:
> > Thomas Munro <thomas.munro@enterprisedb.com> writes:
> >> That's ... annoying.  I wish indent wouldn't do that, because it means
> >> that my declarations get moved around every time I write code.
> >
> > If you can fix it, I'd vote for accepting the patch.  I don't personally
> > have the desire to dig into the indent code that much ...
>
> If you could get pgindent smarter in this area, it would be really
> nice..

Ah, it's not indent doing it, it's pgindent's post_indent subroutine
trying to correct the effects of the (implied) -psl option, but not
doing a complete job of it (it should adjust the indentation lines of
later lines if it changes the first line).

One idea I had was to tell indent not to do that by using -npsl when
processing headers, like in the attached.  That fixes all the headers
I looked at, though of course it doesn't fix the static function
declarations that appear in .c files, so it's not quite the right
answer.

-- 
Thomas Munro
http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: "repliation" as database name
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pg_basebackup, walreceiver and wal_sender_timeout