emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing features in c-ts-mode


From: Eli Zaretskii
Subject: Re: Missing features in c-ts-mode
Date: Thu, 16 Feb 2023 09:04:33 +0200

> From: Theodor Thornhill <theo@thornhill.no>
> Cc: casouri@gmail.com, emacs-devel@gnu.org
> Date: Wed, 15 Feb 2023 21:21:45 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Visit dispnew.c, turn on c-ts-mode, then go to line 174.  Type M-a and
> > watch in disbelief where it goes.  Same surprise if you type M-e.
> > Conclusion: preprocessor directives seem to drive this feature crazy.
> >
> 
> Hmm, I cannot find any preproc directives there, but I think I
> understand what you mean anyway.

The directives are "#ifdef GLYPH_DEBUG" on line 129 and the matching
#endif on line 234.  All that portion of dispnew.c is under that cpp
conditional.

> > static void
> > adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, 
> > int y, struct dim dim)
> > {
> >   int i;
> >   int new_rows;
> >   bool marginal_areas_changed_p = 0;
> >   bool tab_line_changed_p = 0;  <<<<<<<<<<<<<<<<<<<<
> >   bool tab_line_p = 0;
> >
> > Position point in the middle of the line and press M-a -- point goes
> > to the first non-blank character of the line: good.  Now type M-a
> > again -- point goes to the first non-blank character of the _previous_
> > line: why?
> 
> Likely because that is the beginning of the "first" previous node
> covered by the regexp.  Is that unexpected?

It was unexpected to some extent.  But I see that other
beginning-of-SOMETHING commands to the same, so perhaps it's just me.
Let's forget about this part, I probably need to adjust my
expectations.

> > Position point anywhere inside that line and press M-a -- point goes
> > to the "if" that encloses this block: why?  Moreover, if you go to the
> > first line _after_ the braces, the one which begins with "matrix->",
> > and press M-a, point still goes to that "if": why?
> >
> > C-M-f also appears broken: I cannot get it to move from an opening
> > brace to the matching closing brace -- instead, it goes to the closing
> > parenthesis of some inner expression.  For example, try C-M-f here:
> >
> >   else
> >     {
> >       /* If MATRIX->pool is null, MATRIX is responsible for managing
> >      its own memory.  It is a window matrix for window-based redisplay.
> >      Allocate glyph memory from the heap.  */
> >       if (dim.width > matrix->matrix_w
> >       || new_rows
> >       || tab_line_changed_p
> >       || header_line_changed_p
> >       || marginal_areas_changed_p)
> >     {
> >       struct glyph_row *row = matrix->rows;
> >
> 
> Yeah, this is the same bug as in a different bug report, bug#61374.  I
> didn't get to it yet, apologies!

No need to be sorry: this is the master branch, so everything there
takes a back seat for now, and emacs-29 is the most important.

> Hehe yeah. Thanks!  I'll check if just tweaking the regexps is enough,
> but likely we need something more in the code dealing with this
> too. Thanks for the detailed report though, now I have some clear
> expectations to devise tests from.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]