From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Missing features in c-ts-mode Date: Wed, 15 Feb 2023 22:03:48 +0200 Message-ID: <838rgyae6z.fsf@gnu.org> References: <83wn4iajyy.fsf@gnu.org> <87fsb67pfj.fsf@thornhill.no> <83lekyagwy.fsf@gnu.org> <87a61e7n5j.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8133"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org To: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 15 21:04:51 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSO1K-0001nJ-Sf for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Feb 2023 21:04:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSO0h-0001FZ-BX; Wed, 15 Feb 2023 15:04:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSO0f-0001F7-6Q for emacs-devel@gnu.org; Wed, 15 Feb 2023 15:04:09 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSO0e-00065c-Eq; Wed, 15 Feb 2023 15:04:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+EjHNIe73vVOUkIsWsXVKyWc6y5FEqzmnZ54jZtdSRk=; b=JdA/M5hRiGEN Mppcc+tnz9ns/qthYoWNmGLKi3tFFat+yylTeeSRwU/qJ8bdYITP3gr+Eu6U7LWGuakI8zOs6nHPG g+1o2lqQppyhThLzZ4DE5qIbtgJXyJdH9nB6YS0OIf3ULl6zryhEFcSMSR1Wj8sUwU9KTb2jFMZGw sq4y98OVVOu35OsV/J104Dkyr4lUhnUTTwg7DhcDmfDk2mxxIzIntpwFBr6l4TCfXEitYqcUUhuxQ FuOdy7FpEdtsSvLoVgox29dS5TOtIaxxRbK7F7aYfkzPArVkVPgqgYbWG3SO7tByH8EabtT/fMbY+ y/QyqwDHH/J2NUonlaGdFA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSO0d-0006tX-Ja; Wed, 15 Feb 2023 15:04:07 -0500 In-Reply-To: <87a61e7n5j.fsf@thornhill.no> (message from Theodor Thornhill on Wed, 15 Feb 2023 20:18:32 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303341 Archived-At: > From: Theodor Thornhill > Cc: casouri@gmail.com, emacs-devel@gnu.org > Date: Wed, 15 Feb 2023 20:18:32 +0100 > > >> Isn't M-a and M-e available on master? > > > > Maybe, I didn't look there, sorry. If they work there, then this one > > is fine. > > > > They should be there, but they may need tweaking. Let me know if they > behave unexpectedly. Hmm... they behave...strangely. 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. OK, so let's find a place without cpp directives. Go to line 368: 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? Now go to line 382: if (w) { window_box (w, ANY_AREA, 0, 0, &window_width, &window_height); tab_line_p = window_wants_tab_line (w); tab_line_changed_p = tab_line_p != matrix->tab_line_p; <<<<<<<<<<<<<<< header_line_p = window_wants_header_line (w); header_line_changed_p = header_line_p != matrix->header_line_p; } matrix->tab_line_p = tab_line_p; 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; Place point at the opening brace after "else" and type "C-M-f" -- point goes to the closing paren after "marginal_areas_changed_p". So this "needs work", I'd say ;-)