all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Questions about parser state
@ 2013-10-04 23:19 Xue Fuqiao
  2013-10-05  2:08 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Xue Fuqiao @ 2013-10-04 23:19 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I have two questions about parser state in Emacs Lisp.  In (info
"(elisp) Parser State"):

   Here are the meanings of the elements of the parser state:
[...]
  5. ‘t’ if the end point is just after a quote character.
[...]
  7. What kind of comment is active: ‘nil’ if not in a comment or in a
     comment of style ‘a’;

My question is:
1. What does the "quote character" mean?  Does it mean "'" in Lisp?  If
   so, what about "," and "#"?
2. What is comment style ‘a’?  In (info "(elisp) Syntax Flags"): "A
   comment style is a set of flags ‘b’, ‘c’, and ‘n’, so there can be up
   to 8 different comment styles."  I can't find an ‘a’ style.

I've also searched the archives/web, but didn't get anything that looked
promising.  Can anyone point me in the right direction?

-- 
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/



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

* Re: Questions about parser state
  2013-10-04 23:19 Questions about parser state Xue Fuqiao
@ 2013-10-05  2:08 ` Stefan Monnier
  2013-10-05 10:08   ` Xue Fuqiao
  2013-10-05 14:17   ` Drew Adams
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2013-10-05  2:08 UTC (permalink / raw)
  To: help-gnu-emacs

> 1. What does the "quote character" mean?  Does it mean "'" in Lisp?  If
>    so, what about "," and "#"?

No, it's typically the \ char.

> 2. What is comment style ‘a’?  In (info "(elisp) Syntax Flags"): "A
>    comment style is a set of flags ‘b’, ‘c’, and ‘n’, so there can be up
>    to 8 different comment styles."  I can't find an ‘a’ style.

`a' is the comment style when neither `b' nor `c' is present.


        Stefan




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

* Re: Questions about parser state
  2013-10-05  2:08 ` Stefan Monnier
@ 2013-10-05 10:08   ` Xue Fuqiao
  2013-10-05 19:26     ` Stefan Monnier
  2013-10-05 14:17   ` Drew Adams
  1 sibling, 1 reply; 5+ messages in thread
From: Xue Fuqiao @ 2013-10-05 10:08 UTC (permalink / raw)
  To: help-gnu-emacs

On Sat, Oct 5, 2013 at 10:08 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> 1. What does the "quote character" mean?  Does it mean "'" in Lisp?  If
>>    so, what about "," and "#"?
>
> No, it's typically the \ char.
>
>> 2. What is comment style ‘a’?  In (info "(elisp) Syntax Flags"): "A
>>    comment style is a set of flags ‘b’, ‘c’, and ‘n’, so there can be up
>>    to 8 different comment styles."  I can't find an ‘a’ style.
>
> `a' is the comment style when neither `b' nor `c' is present.

I see, thank you.  To make it clearer, what about the following patch?

=== modified file 'doc/lispref/syntax.texi'
*** doc/lispref/syntax.texi    2013-10-03 15:32:10 +0000
--- doc/lispref/syntax.texi    2013-10-05 10:07:16 +0000
***************
*** 339,349 ****
  @cindex comment style
  Emacs supports several comment styles simultaneously in any one syntax
  table.  A comment style is a set of flags @samp{b}, @samp{c}, and
! @samp{n}, so there can be up to 8 different comment styles.
! Each comment delimiter has a style and only matches comment delimiters
! of the same style.  Thus if a comment starts with the comment-start
! sequence of style ``bn'', it will extend until the next matching
! comment-end sequence of style ``bn''.

  The appropriate comment syntax settings for C++ can be as follows:

--- 339,350 ----
  @cindex comment style
  Emacs supports several comment styles simultaneously in any one syntax
  table.  A comment style is a set of flags @samp{b}, @samp{c}, and
! @samp{n}, so there can be up to 8 different comment styles.  When
! neither @samp{b} nor @samp{c} is present, the comment style is
! @samp{a}.  Each comment delimiter has a style and only matches comment
! delimiters of the same style.  Thus if a comment starts with the
! comment-start sequence of style ``bn'', it will extend until the next
! matching comment-end sequence of style ``bn''.

  The appropriate comment syntax settings for C++ can be as follows:

***************
*** 838,844 ****

  @item
  @cindex quote character
! @code{t} if the end point is just after a quote character.

  @item
  The minimum parenthesis depth encountered during this scan.
--- 839,845 ----

  @item
  @cindex quote character
! @code{t} if the end point is just after an escape-syntax character.

  @item
  The minimum parenthesis depth encountered during this scan.

-- 
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/



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

* RE: Questions about parser state
  2013-10-05  2:08 ` Stefan Monnier
  2013-10-05 10:08   ` Xue Fuqiao
@ 2013-10-05 14:17   ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2013-10-05 14:17 UTC (permalink / raw)
  To: Stefan Monnier, help-gnu-emacs

> > 1. What does the "quote character" mean?  Does it mean "'" in Lisp?  If
> >    so, what about "," and "#"?
> 
> No, it's typically the \ char.

Though char escaping is a type of quoting, would it be clearer to refer
to \ as the escape character?  That's common language, and it is what we
do when talking about regexps (e.g., (elisp) `Syntax Descriptors': "Thus,
`\' as a designator character always means "escape character" syntax...."




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

* Re: Questions about parser state
  2013-10-05 10:08   ` Xue Fuqiao
@ 2013-10-05 19:26     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2013-10-05 19:26 UTC (permalink / raw)
  To: help-gnu-emacs

> ! @samp{n}, so there can be up to 8 different comment styles.  When
> ! neither @samp{b} nor @samp{c} is present, the comment style is
> ! @samp{a}.  Each comment delimiter has a style and only matches comment

Actually, the use of `a' is problematic, indeed.
Since we really have 8 styles: "", "b", "c", "bc", "n", "bn", "cn", "bcn".
So, "a" doesn't fit very well in there.
It's inherited from earlier times where we had just "" and "b", so ""
could be considered as "a".

So we should probably get rid of the "style `a'" terminology and replace
it with something else.


        Stefan




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

end of thread, other threads:[~2013-10-05 19:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-04 23:19 Questions about parser state Xue Fuqiao
2013-10-05  2:08 ` Stefan Monnier
2013-10-05 10:08   ` Xue Fuqiao
2013-10-05 19:26     ` Stefan Monnier
2013-10-05 14:17   ` Drew Adams

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.