all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* State argument of `parse-partial-sexp'
@ 2006-05-15  9:46 martin rudalics
  2006-05-15 14:33 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2006-05-15  9:46 UTC (permalink / raw)


Elisp manual and doc-string of `parse-partial-sexp' imply that the 8th
and 9th element are not needed (can be omitted) in the state argument.
I think they are needed.  Hence, I propose the following patches:


2006-05-15  Martin Rudalics  <rudalics@gmx.at>

	* syntax.texi (Parsing Expressions): Fix description of
	`parse-partial-sexp'.

*** syntax.texi	Mon May  1 10:08:56 2006
--- syntax.texi	Mon May 15 11:04:44 2006
***************
*** 661,670 ****
  string, or the end of a comment or a string, whichever comes first.

  @cindex parse state
! The fifth argument @var{state} is a ten-element list of the same form
! as the value of this function, described below.  (It is OK to omit the
! last two elements of this list.)  The return value of one call may be
! used to initialize the state of the parse on another call to
  @code{parse-partial-sexp}.

  The result is a list of ten elements describing the final state of
--- 661,669 ----
  string, or the end of a comment or a string, whichever comes first.

  @cindex parse state
! The fifth argument @var{state} is a ten-element list of the same form as
! the value of this function, described below.  The return value of one
! call may be used to initialize the state of the parse on another call to
  @code{parse-partial-sexp}.

  The result is a list of ten elements describing the final state of
***************
*** 724,730 ****

  @end enumerate

! Elements 0, 3, 4, 5, 7 and 9 are significant in the argument
  @var{state}.

  @cindex indenting with parentheses
--- 723,729 ----

  @end enumerate

! Elements 0, 3, 4, 5, 7, 8 and 9 are significant in the argument
  @var{state}.

  @cindex indenting with parentheses


2006-05-15  Martin Rudalics  <rudalics@gmx.at>

	* syntax.c (`parse-partial-sexp'): Fix doc-string.

*** syntax.c	Mon May  1 10:08:58 2006
--- syntax.c	Mon May 15 11:06:54 2006
***************
*** 3043,3050 ****
  Fourth arg STOPBEFORE non-nil means stop when come to
   any character that starts a sexp.
  Fifth arg OLDSTATE is a list like what this function returns.
!  It is used to initialize the state of the parse.  Elements number 1, 2, 6
!  and 8 are ignored; you can leave off element 8 (the last) entirely.
  Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
   If it is symbol `syntax-table', stop after the start of a comment or a
   string, or after end of a comment or a string.  */)
--- 3043,3050 ----
  Fourth arg STOPBEFORE non-nil means stop when come to
   any character that starts a sexp.
  Fifth arg OLDSTATE is a list like what this function returns.
!  It is used to initialize the state of the parse.  Elements number 1, 2,
!  and 6 are ignored.
  Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
   If it is symbol `syntax-table', stop after the start of a comment or a
   string, or after end of a comment or a string.  */)

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

* Re: State argument of `parse-partial-sexp'
  2006-05-15  9:46 State argument of `parse-partial-sexp' martin rudalics
@ 2006-05-15 14:33 ` Stefan Monnier
  2006-05-16  6:37   ` martin rudalics
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2006-05-15 14:33 UTC (permalink / raw)
  Cc: emacs-devel

> Elisp manual and doc-string of `parse-partial-sexp' imply that the 8th
> and 9th element are not needed (can be omitted) in the state argument.
> I think they are needed.  Hence, I propose the following patches:

Good point.  While you're there, do in the manual as is done in the
docstring:
- don't specify the length of the state argument: just say it's the same as
  the return value.
- specify the ignored elements rather than the non-ignored ones.
  The list of ignored ones is much less likely to change.


        Stefan


> 2006-05-15  Martin Rudalics  <rudalics@gmx.at>

> 	* syntax.texi (Parsing Expressions): Fix description of
> 	`parse-partial-sexp'.

> *** syntax.texi	Mon May  1 10:08:56 2006
> --- syntax.texi	Mon May 15 11:04:44 2006
> ***************
> *** 661,670 ****
>   string, or the end of a comment or a string, whichever comes first.

>   @cindex parse state
> ! The fifth argument @var{state} is a ten-element list of the same form
> ! as the value of this function, described below.  (It is OK to omit the
> ! last two elements of this list.)  The return value of one call may be
> ! used to initialize the state of the parse on another call to
>   @code{parse-partial-sexp}.

>   The result is a list of ten elements describing the final state of
> --- 661,669 ----
>   string, or the end of a comment or a string, whichever comes first.

>   @cindex parse state
> ! The fifth argument @var{state} is a ten-element list of the same form as
> ! the value of this function, described below.  The return value of one
> ! call may be used to initialize the state of the parse on another call to
>   @code{parse-partial-sexp}.

>   The result is a list of ten elements describing the final state of
> ***************
> *** 724,730 ****

>   @end enumerate

> ! Elements 0, 3, 4, 5, 7 and 9 are significant in the argument
>   @var{state}.

>   @cindex indenting with parentheses
> --- 723,729 ----

>   @end enumerate

> ! Elements 0, 3, 4, 5, 7, 8 and 9 are significant in the argument
>   @var{state}.

>   @cindex indenting with parentheses


> 2006-05-15  Martin Rudalics  <rudalics@gmx.at>

> 	* syntax.c (`parse-partial-sexp'): Fix doc-string.

> *** syntax.c	Mon May  1 10:08:58 2006
> --- syntax.c	Mon May 15 11:06:54 2006
> ***************
> *** 3043,3050 ****
>   Fourth arg STOPBEFORE non-nil means stop when come to
>    any character that starts a sexp.
>   Fifth arg OLDSTATE is a list like what this function returns.
> !  It is used to initialize the state of the parse.  Elements number 1, 2, 6
> !  and 8 are ignored; you can leave off element 8 (the last) entirely.
>   Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
>    If it is symbol `syntax-table', stop after the start of a comment or a
>    string, or after end of a comment or a string.  */)
> --- 3043,3050 ----
>   Fourth arg STOPBEFORE non-nil means stop when come to
>    any character that starts a sexp.
>   Fifth arg OLDSTATE is a list like what this function returns.
> !  It is used to initialize the state of the parse.  Elements number 1, 2,
> !  and 6 are ignored.
>   Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
>    If it is symbol `syntax-table', stop after the start of a comment or a
>    string, or after end of a comment or a string.  */)


> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: State argument of `parse-partial-sexp'
  2006-05-15 14:33 ` Stefan Monnier
@ 2006-05-16  6:37   ` martin rudalics
  0 siblings, 0 replies; 3+ messages in thread
From: martin rudalics @ 2006-05-16  6:37 UTC (permalink / raw)
  Cc: emacs-devel

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

 > - don't specify the length of the state argument: just say it's the same as
 >   the return value.

The state argument can be the empty list, I'd say "same form" should
suffice here.

 > - specify the ignored elements rather than the non-ignored ones.
 >   The list of ignored ones is much less likely to change.

Elementary.  I attached a patch.


[-- Attachment #2: syntax-texi.patch --]
[-- Type: text/plain, Size: 1318 bytes --]

*** syntax.texi	Mon May  1 10:08:56 2006
--- syntax.texi	Tue May 16 08:21:20 2006
***************
*** 661,669 ****
  string, or the end of a comment or a string, whichever comes first.

  @cindex parse state
! The fifth argument @var{state} is a ten-element list of the same form
! as the value of this function, described below.  (It is OK to omit the
! last two elements of this list.)  The return value of one call may be
  used to initialize the state of the parse on another call to
  @code{parse-partial-sexp}.

--- 661,668 ----
  string, or the end of a comment or a string, whichever comes first.

  @cindex parse state
! The fifth argument @var{state} is a list of the same form as the value
! of this function, described below.  The return value of one call may be
  used to initialize the state of the parse on another call to
  @code{parse-partial-sexp}.

***************
*** 724,731 ****

  @end enumerate

! Elements 0, 3, 4, 5, 7 and 9 are significant in the argument
! @var{state}.

  @cindex indenting with parentheses
  This function is most often used to compute indentation for languages
--- 723,729 ----

  @end enumerate

! Elements 1, 2, and 6 are ignored in the argument @var{state}.

  @cindex indenting with parentheses
  This function is most often used to compute indentation for languages

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2006-05-16  6:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-15  9:46 State argument of `parse-partial-sexp' martin rudalics
2006-05-15 14:33 ` Stefan Monnier
2006-05-16  6:37   ` martin rudalics

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.