unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9484: scheme-indent-function bug?
@ 2011-09-12 14:59 彥瑾
  2011-09-13  4:02 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: 彥瑾 @ 2011-09-12 14:59 UTC (permalink / raw)
  To: 9484

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

Dear:
             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
                                )

               and this will make my scheme compiler error ( I try both
gambit-c and racket)

               if I write a simple emacs lisp

              (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

               maybe this is a scheme-mode's bug ?

[-- Attachment #2: Type: text/html, Size: 2146 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#9484: scheme-indent-function bug?
  2011-09-12 14:59 bug#9484: scheme-indent-function bug? 彥瑾
@ 2011-09-13  4:02 ` Glenn Morris
  2011-09-13  7:01   ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2011-09-13  4:02 UTC (permalink / raw)
  To: coldnew.tw; +Cc: 9484


> 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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#9484: scheme-indent-function bug?
  2011-09-13  4:02 ` Glenn Morris
@ 2011-09-13  7:01   ` Glenn Morris
  0 siblings, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2011-09-13  7:01 UTC (permalink / raw)
  To: 9484-done


I have given scheme-indent-function a doc-string and am closing this.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-13  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-12 14:59 bug#9484: scheme-indent-function bug? 彥瑾
2011-09-13  4:02 ` Glenn Morris
2011-09-13  7:01   ` Glenn Morris

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).