all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: coldnew.tw@gmail.com
Cc: 9484@debbugs.gnu.org
Subject: bug#9484: scheme-indent-function bug?
Date: Tue, 13 Sep 2011 00:02:42 -0400	[thread overview]
Message-ID: <d0wrdd144d.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CAF6djU_KMQcw-0dAs_6GUcQenM3MgpnCXUkbuFqUjBoP93EXzA@mail.gmail.com> ("彥瑾"'s message of "Mon, 12 Sep 2011 22:59:42 +0800")


> I want to make c-declare function likes following
>
>              (c-declare #<<c-declare-end
>
>               #include <stdio.h>
>               c-declare-end
>               )
>
> but if I use (put 'c-decare 'scheme-indent-function 0) whitch is
> according to scheme wiki
>
> the scheme code will looks like:
>
>              (c-declare #<<c-declare-end
>
>                                #include <stdio.h>
>                                c-declare-end
>                                 )

If the scheme wiki says that

(put 'c-declare 'scheme-indent-function 0)

will give everything 0 indentation, then I believe it is incorrect.
It's a shame scheme-indent-function doesn't have a doc-string, but it
works like the function lisp-indent-function, which does. Quoting that:

* an integer N, meaning indent the first N arguments specially
  like ordinary function arguments and then indent any further
  arguments like a body;

A value of 0 means to indent like `progn' (for example), not "to column 0".

> (defun scheme-indent-dummy (state indent-point normal-indent) 0)
> (put 'c-declare 'scheme-indent-function 'scheme-indent-dummy)
>
> and the scheme's c-declare function will indent as I want

I don't think there is a standard way to say "indent to column N", so
writing a function like that seems the correct way to do it.


I think scheme-indent-function should get a doc-string, but other than
that I do not think there is a bug.





  reply	other threads:[~2011-09-13  4:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 14:59 bug#9484: scheme-indent-function bug? 彥瑾
2011-09-13  4:02 ` Glenn Morris [this message]
2011-09-13  7:01   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0wrdd144d.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=9484@debbugs.gnu.org \
    --cc=coldnew.tw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.