From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59602: 29.0.50; csharp-mode should either be a package, or compat code could be removed Date: Sat, 26 Nov 2022 20:12:58 +0100 Message-ID: <87o7st4jid.fsf@thornhill.no> References: Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32183"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= To: Stefan Kangas , 59602@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 26 20:14:23 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oz0d5-0008Bq-BN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Nov 2022 20:14:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oz0cs-0000bi-9c; Sat, 26 Nov 2022 14:14:10 -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 1oz0cm-0000b3-Pk for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 14:14:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oz0ck-0003Nz-LS for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 14:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oz0ck-0003u9-8z for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 14:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Nov 2022 19:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59602 X-GNU-PR-Package: emacs Original-Received: via spool by 59602-submit@debbugs.gnu.org id=B59602.166948998914993 (code B ref 59602); Sat, 26 Nov 2022 19:14:02 +0000 Original-Received: (at 59602) by debbugs.gnu.org; 26 Nov 2022 19:13:09 +0000 Original-Received: from localhost ([127.0.0.1]:41446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz0bs-0003tl-PH for submit@debbugs.gnu.org; Sat, 26 Nov 2022 14:13:09 -0500 Original-Received: from out-118.mta0.migadu.com ([91.218.175.118]:59162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz0bq-0003tf-Qq for 59602@debbugs.gnu.org; Sat, 26 Nov 2022 14:13:08 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1669489985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bCYId/mdfIiNLX6kLHWokz7j4kSELIKYdRtt8JVTBnM=; b=wMx8W7Y2zZFeHbFhvyblxnwlTzuZAapOlCGi7USOQRkrw2MJsLdEsir/xwFP3fURg7h+Gv 77yfiEvJEno9K+XfJENU52eY2srOU/9sQFwpPgKgEZ9ZMJMVVjbwSeJd8eiT3wJrLtRxU/ NZVfX+/BAnmFXuVXEg4Hdb8Zx+z0qwto2aED1YG1e5zSdwlhX2fZqhSm05TbZSKlArftFM NJ4mTyrsoMrcNYODhAO9w/+JVePXs/1QvwaMNen4E+zciz8+8+U5017pRumF2umcFPL2h+ +VMiTN7AOCkVCXDX/B7tfO24qNrPG5xbXTXqxiLinvt2ffBZXBtNQhCkXRfAEA== In-Reply-To: X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249129 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas writes: > Severity: wishlist > > Is csharp-mode.el intended to be a :core package or should people just > use the version that comes with Emacs? > > If the former, I guess some Version and Package-Requires headers > are needed. > > If the latter, the compat code starting on line 512 could probably be > removed. I agree. The compat code should be removed. I don't thing we have much to gain by maintaining this as a :core package, so here's a patch doing what you suggest. I don't think that code should be part of Emacs at all, if not absolutely necessary :-) Theo --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-Remove-compatibility-code-in-csharp-mode.patch Content-Transfer-Encoding: quoted-printable >From 44189f78889e22f3e9321d8b089ed452bfa3c87a Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sat, 26 Nov 2022 20:10:58 +0100 Subject: [PATCH] Remove compatibility code in csharp-mode * lisp/progmodes/csharp-mode.el (c-basic-matchers-before): Remove invalid string check for Emacs 27. (version=3D): Remove compatibility hack for string handling in CC Mode in Emacs 27.1. --- lisp/progmodes/csharp-mode.el | 75 +---------------------------------- 1 file changed, 2 insertions(+), 73 deletions(-) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index a544a4b5cb..354aacf9bc 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -319,12 +319,7 @@ csharp--color-forwards (c-lang-defconst c-basic-matchers-before csharp `( ;; Warning face on unclosed strings - ,@(if (version< emacs-version "27.0") - ;; Taken from 26.1 branch - `(,(c-make-font-lock-search-function - (concat ".\\(" c-string-limit-regexp "\\)") - '((c-font-lock-invalid-string)))) - `(("\\s|" 0 font-lock-warning-face t nil))) + ("\\s|" 0 font-lock-warning-face t nil) =20 ;; Invalid single quotes c-font-lock-invalid-single-quotes @@ -346,7 +341,6 @@ c-basic-matchers-before nil (goto-char (match-end 0))))) =20 - ;; Negation character (eval . (list "\\(!\\)[^=3D]" 1 c-negation-char-face-name)) =20 @@ -375,8 +369,7 @@ c-basic-matchers-before (eval . (list (concat "\\ *( *" csharp--regex-type-name-matcher " *) *") - 1 font-lock-type-face)) - )) + 1 font-lock-type-face)))) =20 (c-lang-defconst c-basic-matchers-after csharp (append @@ -505,70 +498,6 @@ csharp-guess-basic-syntax =20 ;;; End of new syntax constructs =20 - - -;;; Fix for strings on version 27.1 - -(when (version=3D emacs-version "27.1") - ;; See: - ;; https://github.com/emacs-csharp/csharp-mode/issues/175 - ;; https://github.com/emacs-csharp/csharp-mode/issues/151 - ;; for the full story. - (defun c-pps-to-string-delim (end) - (let* ((start (point)) - (no-st-s `(0 nil nil ?\" nil nil 0 nil ,start nil nil)) - (st-s `(0 nil nil t nil nil 0 nil ,start nil nil)) - no-st-pos st-pos - ) - (parse-partial-sexp start end nil nil no-st-s 'syntax-table) - (setq no-st-pos (point)) - (goto-char start) - (while (progn - (parse-partial-sexp (point) end nil nil st-s 'syntax-table) - (unless (bobp) - (c-clear-syn-tab (1- (point)))) - (setq st-pos (point)) - (and (< (point) end) - (not (eq (char-before) ?\"))))) - (goto-char (min no-st-pos st-pos)) - nil)) - - (defun c-multiline-string-check-final-quote () - (let (pos-ll pos-lt) - (save-excursion - (goto-char (point-max)) - (skip-chars-backward "^\"") - (while - (and - (not (bobp)) - (cond - ((progn - (setq pos-ll (c-literal-limits) - pos-lt (c-literal-type pos-ll)) - (memq pos-lt '(c c++))) - ;; In a comment. - (goto-char (car pos-ll))) - ((save-excursion - (backward-char) ; over " - (c-is-escaped (point))) - ;; At an escaped string. - (backward-char) - t) - (t - ;; At a significant " - (c-clear-syn-tab (1- (point))) - (setq pos-ll (c-literal-limits) - pos-lt (c-literal-type pos-ll)) - nil))) - (skip-chars-backward "^\"")) - (cond - ((bobp)) - ((eq pos-lt 'string) - (c-put-syn-tab (1- (point)) '(15))) - (t nil)))))) - -;;; End of fix for strings on version 27.1 - ;; When invoked by MSBuild, csc=E2=80=99s errors look like this: ;; subfolder\file.cs(6,18): error CS1006: Name of constructor must ;; match name of class [c:\Users\user\project.csproj] --=20 2.34.1 --=-=-=--