From unknown Thu Jun 19 14:32:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#59234 <59234@debbugs.gnu.org> To: bug#59234 <59234@debbugs.gnu.org> Subject: Status: CC Mode 5.35.2 (ObjC//l); Random fontification of nsterm.m Reply-To: bug#59234 <59234@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:32:50 +0000 retitle 59234 CC Mode 5.35.2 (ObjC//l); Random fontification of nsterm.m reassign 59234 cc-mode submitter 59234 Po Lu severity 59234 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 12 22:13:19 2022 Received: (at submit) by debbugs.gnu.org; 13 Nov 2022 03:13:19 +0000 Received: from localhost ([127.0.0.1]:49698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou3Qt-0006mC-BJ for submit@debbugs.gnu.org; Sat, 12 Nov 2022 22:13:19 -0500 Received: from lists.gnu.org ([209.51.188.17]:33362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou3Qr-0006m5-JT for submit@debbugs.gnu.org; Sat, 12 Nov 2022 22:13:18 -0500 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 1ou3Qr-0007S4-DG for bug-gnu-emacs@gnu.org; Sat, 12 Nov 2022 22:13:17 -0500 Received: from sonic315-22.consmr.mail.ne1.yahoo.com ([66.163.190.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ou3Qp-0003Yw-No for bug-gnu-emacs@gnu.org; Sat, 12 Nov 2022 22:13:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668309192; bh=nyXJwmotJb9NmA0VrTGICysBaf3zrwpVRJTl+zSQt3c=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=Ff92imbT5+fA/uryGqxfrzEobJgdZQl9zr43SOY2cF/WphpWXLZY35/F/gmzlqjaKWF4vS8NQsM4Yw7Hg9HjEfDiPtqbDUa5y0yt1Idp7bc1FTT48jKOGdxHivNUUbRm7zTqHKELH/aRtC+nuJd3Qd69HvAGl2zaM1kDDZFhDpxtKTSGBJ1A900IafzjU78HvIRiBtLZWdVKqypvqWBGSQHIwo9HNoDjarVEmnTu8Y2zI9h8xfaPoJ1pliv0jycVGCYwD8qy/RZjDFzD8QeVFRkHSU1TtMEIPITNwrKvKnF4VJ1hvnI1ZkxV5GXOMAbzvtKmpkUHfODy8OCxdop2og== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668309192; bh=P3t76QVc/9GM+vWb4q8vSPzhiE8dmZ+0DkpzjqLf3MV=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=sGanwvegWdvDoPAaBF5NezdJwFj9pJRLwYcF4UIfBv45ycLEHvXbFGn5Y8PsHaAiY6+MB7ss9pqg/RWsHw0nl1zqJUNEQrd7TvpZ3v98tdt2kriJ+YDl3ll3//EpiwsoP4u8ROdA4tLDziWh4Q5uowD1uiks4roBz9BxEXuHoxtqf9N1jKyZRB6a91BxGEe5vHEyKE5yfZn4GRIC2rJ/kunj6YkjNzJlRaSAbwqf4f7xzAg2Jjm3mDJx3WSRqkdC7u/dOL/8XDUL2lCCBYlCnN8FVUkBxAXDd48cFcTEgRscIwObZtTLTP8YDQsDfc3VGTKRFBEUDevNfBUU/9ARRQ== X-YMail-OSG: CQNyYGgVM1lEm.myy9xjBFKFZyCX3fg_O2TcWgvFC1i1l0f6byjEcsc.el_JZTg lXP_6.jA3uPncw530hRJVUTVa3_TMQ2wwOkspM.juzYtfsyXecozIf0TJQnbfM78zds6YXWg4hjB JB7G4xf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hKEHJHmpgABxfrebs3nlbg-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Sun, 13 Nov 2022 03:13:12 +0000 Received: by hermes--production-sg3-6c8895b545-pb7wm (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 20fdcb489fb368c47c27933083551375; Sun, 13 Nov 2022 03:13:08 +0000 (UTC) From: Po Lu To: bug-gnu-emacs@gnu.org Subject: CC Mode 5.35.2 (ObjC//l); Random fontification of nsterm.m X-Debbugs-Package: cc-mode Date: Sun, 13 Nov 2022 11:13:02 +0800 Message-ID: <87pmdrlf7l.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable References: <87pmdrlf7l.fsf.ref@yahoo.com> X-Mailer: WebService/1.1.20826 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 5874 Received-SPF: pass client-ip=66.163.190.148; envelope-from=luangruo@yahoo.com; helo=sonic315-22.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.6 (-) Package: cc-mode If you go to src/nsterm.m, around line 4020 there should be the following code: static void ns_draw_stretch_glyph_string (struct glyph_string *s) { struct face *face; NSColor *fg_color; if (s->hl =3D=3D DRAW_CURSOR && !x_stretch_cursor_p) { /* If `x-stretch-cursor' is nil, don't draw a block cursor as wide as the stretch glyph. */ int width, background_width =3D s->background_width; int x =3D s->x; if (!s->row->reversed_p) { int left_x =3D window_box_left_offset (s->w, TEXT_AREA); if (x < left_x) { background_width -=3D left_x - x; x =3D left_x; } } else { in it, "width" and "background_width" are seemingly randomly fontified as types. Then, if you scroll up to line 3658, you will see the following code: if (left_p && top_p) [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), NSMinY (outer), 1, 1)]; if (right_p && top_p) [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, NSMinY (outer), 1, 1)]; if (right_p && bottom_p) [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, NSMaxY (outer) - 1, 1, 1)]; if (left_p && bottom_p) [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), NSMaxY (outer) - 1, 1, 1)]; NSBezierPath is a type, and is correctly fontified, but NSMinX and NSMaxX (and their Y variants) are functions, yet are fontified as types. Thanks. Emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu) of 2022-11-12 Package: CC Mode 5.35.2 (ObjC//l) Buffer Style: GNU c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties category-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (= other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode = . gtkdoc) (c++-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-no= nempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(t c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . 0) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-= method-call +) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEF= UN-intro-cont) (brace-list-intro first c-lineup-2nd-brace-entry-in-arglist c-lineup-c= lass-decl-init-+ +) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'objc-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(?://+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%= ;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 13 14:46:55 2022 Received: (at 59234) by debbugs.gnu.org; 13 Nov 2022 19:46:55 +0000 Received: from localhost ([127.0.0.1]:48427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouIwR-0000DA-6v for submit@debbugs.gnu.org; Sun, 13 Nov 2022 14:46:55 -0500 Received: from mx3.muc.de ([193.149.48.5]:33889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouIwO-0000Cr-AN for 59234@debbugs.gnu.org; Sun, 13 Nov 2022 14:46:53 -0500 Received: (qmail 60248 invoked by uid 3782); 13 Nov 2022 20:46:45 +0100 Received: from acm.muc.de (p2e5d57b3.dip0.t-ipconnect.de [46.93.87.179]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 13 Nov 2022 20:46:45 +0100 Received: (qmail 10270 invoked by uid 1000); 13 Nov 2022 19:46:44 -0000 Date: Sun, 13 Nov 2022 19:46:44 +0000 To: Po Lu Subject: Re: bug#59234: CC Mode 5.35.2 (ObjC//l); Random fontification of nsterm.m Message-ID: References: <87pmdrlf7l.fsf.ref@yahoo.com> <87pmdrlf7l.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pmdrlf7l.fsf@yahoo.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59234 Cc: 59234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Po. On Sun, Nov 13, 2022 at 11:13:02 +0800, Po Lu via CC-Mode-help wrote: > Package: cc-mode > If you go to src/nsterm.m, around line 4020 there should be the > following code: > static void > ns_draw_stretch_glyph_string (struct glyph_string *s) > { > struct face *face; > NSColor *fg_color; > if (s->hl == DRAW_CURSOR > && !x_stretch_cursor_p) > { > /* If `x-stretch-cursor' is nil, don't draw a block cursor as > wide as the stretch glyph. */ > int width, background_width = s->background_width; > int x = s->x; > if (!s->row->reversed_p) > { > int left_x = window_box_left_offset (s->w, TEXT_AREA); > if (x < left_x) > { > background_width -= left_x - x; > x = left_x; > } > } > else > { > in it, "width" and "background_width" are seemingly randomly fontified > as types. Then, if you scroll up to line 3658, you will see the > following code: > if (left_p && top_p) > [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), > NSMinY (outer), > 1, 1)]; > if (right_p && top_p) > [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, > NSMinY (outer), > 1, 1)]; > if (right_p && bottom_p) > [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, > NSMaxY (outer) - 1, > 1, 1)]; > if (left_p && bottom_p) > [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), > NSMaxY (outer) - 1, > 1, 1)]; > NSBezierPath is a type, and is correctly fontified, but NSMinX and > NSMaxX (and their Y variants) are functions, yet are fontified as types. The problem here is the setting of the customisable variable objc-font-lock-extra-types. In Objective C's case, it causes all identifiers beginning with an upper case letter and containing a lower case letter to be recognised as types. This is clearly not satisfactory, even if it was OK a long time ago. I would recommend you to customize this variable to nil. Note that CC Mode internal stuff gets set up at an early stage of Objective C Mode's initialisation, before buffer local variables or .dir-local.el get processed. So trying to change it in these places won't work (believe me, I've tried ;-). I'll try and think up a more satisfactory solution. > Thanks. > Emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu) > of 2022-11-12 > Package: CC Mode 5.35.2 (ObjC//l) > Buffer Style: GNU > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties category-properties 1-bit) [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 13 19:21:10 2022 Received: (at 59234) by debbugs.gnu.org; 14 Nov 2022 00:21:11 +0000 Received: from localhost ([127.0.0.1]:48654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouNDq-00070e-J2 for submit@debbugs.gnu.org; Sun, 13 Nov 2022 19:21:10 -0500 Received: from sonic306-22.consmr.mail.ne1.yahoo.com ([66.163.189.84]:46159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouNDl-0006zg-5i for 59234@debbugs.gnu.org; Sun, 13 Nov 2022 19:21:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668385258; bh=/DXuAT8fJzOxu0aiJpiLTD3lRzyxFUJZ8dFUXAQnmkQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=eNGaVOYnKxl3gWVA8sbxElLbDm7qcEyuChDZNVUk+XPM/haXGVpY5JyMOS7gsy0knGzHaaNbiYDaDq6W+nvoRbxH+YFrVJBPz3T7ntWFeQK35L0WvlfUlKiPUlGvdOBMbvaOu5kV1mmZkv1trpPagxC2YBxCK2DZyWOjLfCTQXhDK+XtH4TpcF73LrzZTbJpErIuetK5zmfbA7EPQ+AtrxCfScCcnd6jd0gZzDCmwjwdMgv+jAEXCH3n2a/TyIuKLqJ15fgc7Ll5h6x8EUYqMJTmbVD3qB0EYBLGBF7jfZwfY64qs+VTjZKf4ipSeLQaZneuKsROKFU7qCDjJcvJnA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668385258; bh=sOXBxuDJpmWiCFVy85uHsiSYmpka4AykAOIUIWHs2vh=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ASLDSR68YT4HYNGHe4KARZezqWDdDVpsa67fCQNdkx5xb5guvG13ybnPi71T0axKfh5cj23K3I+hv047KRd4M7OROH5fE/FEJ7Fr1U2AGwRQOYGDig/rTNJy0EL/AZmkGx+VjdBKHkxd2zMyzt45GiiuXLNR7X01EXh1TYosp6mSjcvgy20whin7mBJdMaoxrTRpFOg9xr2XzslIsE57iDzCdNs/b48KeQFKnFe6FDpl+/t5Bq5XU9+H4SWBRbHbJNTAI5kG0yG5JoyfmH2T8WOb2+VqgN4CwztJoRUsBBzpMV7GpRRM9FEvNLaYUo/NDuaHoAWQPsWwI/p4BHiB2Q== X-YMail-OSG: a56zMdMVM1mwDYvLk5rUMLH0KEzuThUYZT2k34cathr8Jk9sqM46I1x.xzv_5PJ 931fDvi2jkBjbfGbMNDbxKdSBtHo8qUU7o_JBYjh7r36cYDCGh34CnkF1D8U.tNYK0ujQS7w8LVi Hr424WhE8eEmn.wv0B5OAOI8BUNt9m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vupdpUa2bdcRx9 X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Mon, 14 Nov 2022 00:20:58 +0000 Received: by hermes--production-sg3-6c8895b545-66t5n (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 75970ce7a42cac3408298b1f76334871; Mon, 14 Nov 2022 00:20:51 +0000 (UTC) From: Po Lu To: Alan Mackenzie Subject: Re: bug#59234: CC Mode 5.35.2 (ObjC//l); Random fontification of nsterm.m In-Reply-To: (Alan Mackenzie's message of "Sun, 13 Nov 2022 19:46:44 +0000") References: <87pmdrlf7l.fsf.ref@yahoo.com> <87pmdrlf7l.fsf@yahoo.com> Date: Mon, 14 Nov 2022 08:20:45 +0800 Message-ID: <87o7tajsiq.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.20826 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 2759 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59234 Cc: 59234@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Hello, Po. > > On Sun, Nov 13, 2022 at 11:13:02 +0800, Po Lu via CC-Mode-help wrote: >> Package: cc-mode > >> If you go to src/nsterm.m, around line 4020 there should be the >> following code: > >> static void >> ns_draw_stretch_glyph_string (struct glyph_string *s) >> { >> struct face *face; >> NSColor *fg_color; > >> if (s->hl == DRAW_CURSOR >> && !x_stretch_cursor_p) >> { >> /* If `x-stretch-cursor' is nil, don't draw a block cursor as >> wide as the stretch glyph. */ >> int width, background_width = s->background_width; >> int x = s->x; > >> if (!s->row->reversed_p) >> { >> int left_x = window_box_left_offset (s->w, TEXT_AREA); > >> if (x < left_x) >> { >> background_width -= left_x - x; >> x = left_x; >> } >> } >> else >> { > >> in it, "width" and "background_width" are seemingly randomly fontified >> as types. Then, if you scroll up to line 3658, you will see the >> following code: > > >> if (left_p && top_p) >> [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), >> NSMinY (outer), >> 1, 1)]; > >> if (right_p && top_p) >> [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, >> NSMinY (outer), >> 1, 1)]; > >> if (right_p && bottom_p) >> [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, >> NSMaxY (outer) - 1, >> 1, 1)]; > >> if (left_p && bottom_p) >> [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), >> NSMaxY (outer) - 1, >> 1, 1)]; > >> NSBezierPath is a type, and is correctly fontified, but NSMinX and >> NSMaxX (and their Y variants) are functions, yet are fontified as types. > > The problem here is the setting of the customisable variable > objc-font-lock-extra-types. In Objective C's case, it causes all > identifiers beginning with an upper case letter and containing a lower > case letter to be recognised as types. > > This is clearly not satisfactory, even if it was OK a long time ago. > > I would recommend you to customize this variable to nil. Note that CC > Mode internal stuff gets set up at an early stage of Objective C Mode's > initialisation, before buffer local variables or .dir-local.el get > processed. So trying to change it in these places won't work (believe > me, I've tried ;-). > > I'll try and think up a more satisfactory solution. > >> Thanks. > >> Emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu) >> of 2022-11-12 >> Package: CC Mode 5.35.2 (ObjC//l) >> Buffer Style: GNU >> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties category-properties 1-bit) > > [ .... ] Thank you. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 23 16:35:01 2023 Received: (at 59234-done) by debbugs.gnu.org; 23 Jan 2023 21:35:01 +0000 Received: from localhost ([127.0.0.1]:55468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pK4Sz-0007ww-2p for submit@debbugs.gnu.org; Mon, 23 Jan 2023 16:35:01 -0500 Received: from mx3.muc.de ([193.149.48.5]:50916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pK4Sw-0007wi-Vy for 59234-done@debbugs.gnu.org; Mon, 23 Jan 2023 16:34:59 -0500 Received: (qmail 13944 invoked by uid 3782); 23 Jan 2023 22:34:52 +0100 Received: from acm.muc.de (p4fe15ef6.dip0.t-ipconnect.de [79.225.94.246]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 23 Jan 2023 22:34:52 +0100 Received: (qmail 20967 invoked by uid 1000); 23 Jan 2023 21:34:51 -0000 Date: Mon, 23 Jan 2023 21:34:51 +0000 To: Po Lu Subject: Re: bug#59234: CC Mode 5.35.2 (ObjC//l); Random fontification of nsterm.m Message-ID: References: <87pmdrlf7l.fsf.ref@yahoo.com> <87pmdrlf7l.fsf@yahoo.com> <87o7tajsiq.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o7tajsiq.fsf@yahoo.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59234-done Cc: acm@muc.de, 59234-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Po. On Mon, Nov 14, 2022 at 08:20:45 +0800, Po Lu wrote: > Alan Mackenzie writes: > > Hello, Po. > > > > On Sun, Nov 13, 2022 at 11:13:02 +0800, Po Lu via CC-Mode-help wrote: > >> Package: cc-mode > > > >> If you go to src/nsterm.m, around line 4020 there should be the > >> following code: > > > >> static void > >> ns_draw_stretch_glyph_string (struct glyph_string *s) > >> { > >> struct face *face; > >> NSColor *fg_color; > > > >> if (s->hl == DRAW_CURSOR > >> && !x_stretch_cursor_p) > >> { > >> /* If `x-stretch-cursor' is nil, don't draw a block cursor as > >> wide as the stretch glyph. */ > >> int width, background_width = s->background_width; > >> int x = s->x; > > > >> if (!s->row->reversed_p) > >> { > >> int left_x = window_box_left_offset (s->w, TEXT_AREA); > > > >> if (x < left_x) > >> { > >> background_width -= left_x - x; > >> x = left_x; > >> } > >> } > >> else > >> { > > > >> in it, "width" and "background_width" are seemingly randomly fontified > >> as types. Then, if you scroll up to line 3658, you will see the > >> following code: > > > > > >> if (left_p && top_p) > >> [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), > >> NSMinY (outer), > >> 1, 1)]; > > > >> if (right_p && top_p) > >> [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, > >> NSMinY (outer), > >> 1, 1)]; > > > >> if (right_p && bottom_p) > >> [NSBezierPath fillRect: NSMakeRect (NSMaxX (outer) - 1, > >> NSMaxY (outer) - 1, > >> 1, 1)]; > > > >> if (left_p && bottom_p) > >> [NSBezierPath fillRect: NSMakeRect (NSMinX (outer), > >> NSMaxY (outer) - 1, > >> 1, 1)]; > > > >> NSBezierPath is a type, and is correctly fontified, but NSMinX and > >> NSMaxX (and their Y variants) are functions, yet are fontified as types. > > > > The problem here is the setting of the customisable variable > > objc-font-lock-extra-types. In Objective C's case, it causes all > > identifiers beginning with an upper case letter and containing a lower > > case letter to be recognised as types. > > > > This is clearly not satisfactory, even if it was OK a long time ago. > > > > I would recommend you to customize this variable to nil. Note that CC > > Mode internal stuff gets set up at an early stage of Objective C Mode's > > initialisation, before buffer local variables or .dir-local.el get > > processed. So trying to change it in these places won't work (believe > > me, I've tried ;-). > > > > I'll try and think up a more satisfactory solution. > > > >> Thanks. > > > >> Emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu) > >> of 2022-11-12 > >> Package: CC Mode 5.35.2 (ObjC//l) > >> Buffer Style: GNU > >> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties category-properties 1-bit) > > > > [ .... ] > Thank you. I've set the default value of objc-font-lock-extra-types to nil, and committed the fix to the release branch. I'm closing the bug with this post. -- Alan Mackenzie (Nuremberg, Germany). From unknown Thu Jun 19 14:32:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 21 Feb 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator