From unknown Fri Aug 15 14:45:30 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#21465 <21465@debbugs.gnu.org> To: bug#21465 <21465@debbugs.gnu.org> Subject: Status: [PATCH] CC-modes hierarchy Reply-To: bug#21465 <21465@debbugs.gnu.org> Date: Fri, 15 Aug 2025 21:45:30 +0000 retitle 21465 [PATCH] CC-modes hierarchy reassign 21465 emacs,cc-mode submitter 21465 Stefan Monnier severity 21465 normal tag 21465 wontfix patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 11 22:32:16 2015 Received: (at submit) by debbugs.gnu.org; 12 Sep 2015 02:32:16 +0000 Received: from localhost ([127.0.0.1]:57556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zaabu-0003PA-OX for submit@debbugs.gnu.org; Fri, 11 Sep 2015 22:32:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39542) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zaabq-0003P0-QC for submit@debbugs.gnu.org; Fri, 11 Sep 2015 22:32:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zaabo-0006OE-D9 for submit@debbugs.gnu.org; Fri, 11 Sep 2015 22:32:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zaabo-0006OA-An for submit@debbugs.gnu.org; Fri, 11 Sep 2015 22:32:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zaabm-000869-6F for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2015 22:32:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zaabi-0006Mw-Ut for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2015 22:32:06 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:62062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zaabi-0006Mc-O2 for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2015 22:32:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BKDwA731xV/zi6xEVcgxBUgy6yU49uJAqFcQSBQD0QAQEBAQEBAYEKQQWDXgYBAVNfEyEBFwEEDYhjDZsitCCPbQEBhQQFi0SLXYQag1w+in6CWoYSgUUjYWYME4IuIoE9gTsBAQE X-IPAS-Result: A0BKDwA731xV/zi6xEVcgxBUgy6yU49uJAqFcQSBQD0QAQEBAQEBAYEKQQWDXgYBAVNfEyEBFwEEDYhjDZsitCCPbQEBhQQFi0SLXYQag1w+in6CWoYSgUUjYWYME4IuIoE9gTsBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="164611018" Received: from 69-196-186-56.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.196.186.56]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Sep 2015 22:32:00 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id AF24AAE12C; Fri, 11 Sep 2015 22:32:00 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: [PATCH] CC-modes hierarchy X-debbugs-Cc: bug-cc-mode@gnu.org Date: Fri, 11 Sep 2015 22:32:00 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) Package: Emacs Version: 25.0.50 Any objection to the patch below? It does the following: - Move code common to all CC-mode major modes to a c-mode-common-mode function. - Add new c-derivative-mode as a parent of C, C++, and ObjC, for settings which apply to C-derived languages but not for others. This has become necessary given that CC-mode is used nowadays as an engine for modes which have little to do with C. - Remove code that's redundant with what define-derived-mode does: - set local-map - set syntax-table - set keymap parent - Remove c-make-inherited-keymap, since it's not used any more. - Fix c-after-font-lock-init so it only *moves* the function, and doesn't accidentally add it (in case the derived mode decided to remove the function from the hook, for example). AFAIK this patch has no issues w.r.t compatibility since it relies on behavior of define-derived-mode which has existed since "for ever". But it hasn't seen much testing, admittedly (except for my own personal use). Stefan diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 97491e4..4279c9f 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -71,6 +71,17 @@ ;; ;; http://lists.sourceforge.net/mailman/listinfo/cc-mode-announce +;; Externally maintained major modes which use CC-mode's engine: +;; - cuda-mode +;; - haxe-mode +;; - d-mode +;; - dart-mode +;; - cc-php-js-cs.el +;; - php-mode +;; - yang-mode +;; - math-mode (mathematica) +;; - unrealscript-mode + ;;; Code: ;; For Emacs < 22.2. @@ -200,22 +211,6 @@ control). See \"cc-mode.el\" for more info." (defvar c-mode-base-map () "Keymap shared by all CC Mode related modes.") -(defun c-make-inherited-keymap () - (let ((map (make-sparse-keymap))) - ;; Necessary to use `cc-bytecomp-fboundp' below since this - ;; function is called from top-level forms that are evaluated - ;; while cc-bytecomp is active when one does M-x eval-buffer. - (cond - ;; Emacs - ((cc-bytecomp-fboundp 'set-keymap-parent) - (set-keymap-parent map c-mode-base-map)) - ;; XEmacs - ((fboundp 'set-keymap-parents) - (set-keymap-parents map c-mode-base-map)) - ;; incompatible - (t (error "CC Mode is incompatible with this version of Emacs"))) - map)) - (defun c-define-abbrev-table (name defs &optional doc) ;; Compatibility wrapper for `define-abbrev' which passes a non-nil ;; sixth argument for SYSTEM-FLAG in emacsen that support it @@ -1219,7 +1214,7 @@ Note that the style variables are always made local to the buffer." (backward-char)) ; back over (, [, <. (and (/= new-pos pos) new-pos))) -(defun c-change-expand-fl-region (beg end old-len) +(defun c-change-expand-fl-region (_beg _end _old-len) ;; Expand the region (c-new-BEG c-new-END) to an after-change font-lock ;; region. This will usually be the smallest sequence of whole lines ;; containing `c-new-BEG' and `c-new-END', but if `c-new-BEG' is in a @@ -1307,8 +1302,9 @@ Note that the style variables are always made local to the buffer." (defun c-after-font-lock-init () ;; Put on `font-lock-mode-hook'. This function ensures our after-change ;; function will get executed before the font-lock one. - (remove-hook 'after-change-functions 'c-after-change t) - (add-hook 'after-change-functions 'c-after-change nil t)) + (when (memq #'c-after-change after-change-functions) + (remove-hook 'after-change-functions #'c-after-change t) + (add-hook 'after-change-functions #'c-after-change nil t))) (defun c-font-lock-init () "Set up the font-lock variables for using the font-lock support in CC Mode. @@ -1401,6 +1397,27 @@ This function is called from `c-common-init', once per mode initialization." (c-update-modeline))) +(defvar c-mode-common-map c-mode-base-map) + +(define-derived-mode c-mode-common prog-mode "CC-generic" + "Pseudo major mode, parent of all modes using the CC engine." + (c-initialize-cc-mode t) + (setq abbrev-mode t)) ;FIXME: Why? + +(defvar c-derivative-mode-map + ;; FIXME: We can't have the menu on this keymap, because the menus for C, + ;; C++, and ObjC can't be shared: the only difference between them is their + ;; title, but easy-menu offers no way to compute the title dynamically. + (let ((map (make-sparse-keymap))) + ;; Add bindings which are useful for any C derivative. + (define-key map "\C-c\C-e" #'c-macro-expand) + map) + "Keymap used in c-derivative-mode buffers.") + +(define-derived-mode c-derivative-mode c-mode-common "C-derivative" + "Pseudo major mode, parent of all modes for C derivatives. +A C derivative is a language which is a superset of C (or is C itself).") + ;; Support for C (defvar c-mode-syntax-table @@ -1413,9 +1430,8 @@ This function is called from `c-common-init', once per mode initialization." "Abbreviation table used in c-mode buffers.") (defvar c-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for C. - (define-key map "\C-c\C-e" 'c-macro-expand) map) "Keymap used in c-mode buffers.") @@ -1454,7 +1470,7 @@ This function is called from `c-common-init', once per mode initialization." (unless (fboundp 'prog-mode) (defalias 'prog-mode 'fundamental-mode)) ;;;###autoload -(define-derived-mode c-mode prog-mode "C" +(define-derived-mode c-mode c-derivative-mode "C" "Major mode for editing K&R and ANSI C code. To submit a problem report, enter `\\[c-submit-bug-report]' from a c-mode buffer. This automatically sets up a mail buffer with version @@ -1468,11 +1484,6 @@ initialization, then `c-mode-hook'. Key bindings: \\{c-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table c-mode-syntax-table) - (setq local-abbrev-table c-mode-abbrev-table - abbrev-mode t) - (use-local-map c-mode-map) (c-init-language-vars-for 'c-mode) (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; (c-common-init 'c-mode) @@ -1495,9 +1506,8 @@ Key bindings: "Abbreviation table used in c++-mode buffers.") (defvar c++-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for C++. - (define-key map "\C-c\C-e" 'c-macro-expand) (define-key map "\C-c:" 'c-scope-operator) (define-key map "<" 'c-electric-lt-gt) (define-key map ">" 'c-electric-lt-gt) @@ -1508,7 +1518,7 @@ Key bindings: (cons "C++" (c-lang-const c-mode-menu c++))) ;;;###autoload -(define-derived-mode c++-mode prog-mode "C++" +(define-derived-mode c++-mode c-derivative-mode "C++" "Major mode for editing C++ code. To submit a problem report, enter `\\[c-submit-bug-report]' from a c++-mode buffer. This automatically sets up a mail buffer with @@ -1523,11 +1533,6 @@ initialization, then `c++-mode-hook'. Key bindings: \\{c++-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table c++-mode-syntax-table) - (setq local-abbrev-table c++-mode-abbrev-table - abbrev-mode t) - (use-local-map c++-mode-map) (c-init-language-vars-for 'c++-mode) (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; (c-common-init 'c++-mode) @@ -1549,9 +1554,8 @@ Key bindings: "Abbreviation table used in objc-mode buffers.") (defvar objc-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for Objective-C. - (define-key map "\C-c\C-e" 'c-macro-expand) map) "Keymap used in objc-mode buffers.") @@ -1561,7 +1565,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.m\\'" . objc-mode)) ;;;###autoload -(define-derived-mode objc-mode prog-mode "ObjC" +(define-derived-mode objc-mode c-derivative-mode "ObjC" "Major mode for editing Objective C code. To submit a problem report, enter `\\[c-submit-bug-report]' from an objc-mode buffer. This automatically sets up a mail buffer with @@ -1576,11 +1580,6 @@ initialization, then `objc-mode-hook'. Key bindings: \\{objc-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table objc-mode-syntax-table) - (setq local-abbrev-table objc-mode-abbrev-table - abbrev-mode t) - (use-local-map objc-mode-map) (c-init-language-vars-for 'objc-mode) (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; (c-common-init 'objc-mode) @@ -1604,7 +1603,7 @@ Key bindings: "Abbreviation table used in java-mode buffers.") (defvar java-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for Java. map) "Keymap used in java-mode buffers.") @@ -1622,7 +1621,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.java\\'" . java-mode)) ;;;###autoload -(define-derived-mode java-mode prog-mode "Java" +(define-derived-mode java-mode c-mode-common "Java" "Major mode for editing Java code. To submit a problem report, enter `\\[c-submit-bug-report]' from a java-mode buffer. This automatically sets up a mail buffer with @@ -1637,11 +1636,6 @@ initialization, then `java-mode-hook'. Key bindings: \\{java-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table java-mode-syntax-table) - (setq local-abbrev-table java-mode-abbrev-table - abbrev-mode t) - (use-local-map java-mode-map) (c-init-language-vars-for 'java-mode) (c-common-init 'java-mode) (easy-menu-add c-java-menu) @@ -1660,7 +1654,7 @@ Key bindings: "Abbreviation table used in idl-mode buffers.") (defvar idl-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for IDL. map) "Keymap used in idl-mode buffers.") @@ -1671,7 +1665,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.idl\\'" . idl-mode)) ;;;###autoload -(define-derived-mode idl-mode prog-mode "IDL" +(define-derived-mode idl-mode c-mode-common "IDL" "Major mode for editing CORBA's IDL, PSDL and CIDL code. To submit a problem report, enter `\\[c-submit-bug-report]' from an idl-mode buffer. This automatically sets up a mail buffer with @@ -1686,10 +1680,7 @@ initialization, then `idl-mode-hook'. Key bindings: \\{idl-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table idl-mode-syntax-table) - (setq local-abbrev-table idl-mode-abbrev-table) - (use-local-map idl-mode-map) + (kill-local-variable 'abbrev-mode) ;FIXME: Only mode that doesn't enable it!? (c-init-language-vars-for 'idl-mode) (c-common-init 'idl-mode) (easy-menu-add c-idl-menu) @@ -1710,7 +1701,7 @@ Key bindings: "Abbreviation table used in pike-mode buffers.") (defvar pike-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Additional bindings. (define-key map "\C-c\C-e" 'c-macro-expand) map) @@ -1723,7 +1714,7 @@ Key bindings: ;;;###autoload (add-to-list 'interpreter-mode-alist '("pike" . pike-mode)) ;;;###autoload -(define-derived-mode pike-mode prog-mode "Pike" +(define-derived-mode pike-mode c-mode-common "Pike" "Major mode for editing Pike code. To submit a problem report, enter `\\[c-submit-bug-report]' from a pike-mode buffer. This automatically sets up a mail buffer with @@ -1738,11 +1729,6 @@ initialization, then `pike-mode-hook'. Key bindings: \\{pike-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table pike-mode-syntax-table) - (setq local-abbrev-table pike-mode-abbrev-table - abbrev-mode t) - (use-local-map pike-mode-map) (c-init-language-vars-for 'pike-mode) (c-common-init 'pike-mode) (easy-menu-add c-pike-menu) @@ -1765,11 +1751,11 @@ Key bindings: "Abbreviation table used in awk-mode buffers.") (defvar awk-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for awk. - (define-key map "#" 'self-insert-command) - (define-key map "/" 'self-insert-command) - (define-key map "*" 'self-insert-command) + (define-key map "#" 'self-insert-command);Override electric parent binding. + (define-key map "/" 'self-insert-command);Override electric parent binding. + (define-key map "*" 'self-insert-command);Override electric parent binding. (define-key map "\C-c\C-n" 'undefined) ; #if doesn't exist in awk. (define-key map "\C-c\C-p" 'undefined) (define-key map "\C-c\C-u" 'undefined) @@ -1788,7 +1774,7 @@ Key bindings: (declare-function c-awk-unstick-NL-prop "cc-awk" ()) ;;;###autoload -(define-derived-mode awk-mode prog-mode "AWK" +(define-derived-mode awk-mode c-mode-common "AWK" "Major mode for editing AWK code. To submit a problem report, enter `\\[c-submit-bug-report]' from an awk-mode buffer. This automatically sets up a mail buffer with version @@ -1807,11 +1793,6 @@ Key bindings: ;; declared in cc-awk.el and hasn't yet been loaded. :syntax-table nil (require 'cc-awk) ; Added 2003/6/10. - (c-initialize-cc-mode t) - (set-syntax-table awk-mode-syntax-table) - (setq local-abbrev-table awk-mode-abbrev-table - abbrev-mode t) - (use-local-map awk-mode-map) (c-init-language-vars-for 'awk-mode) (c-common-init 'awk-mode) (c-awk-unstick-NL-prop) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 12 12:51:59 2015 Received: (at submit) by debbugs.gnu.org; 12 Sep 2015 16:51:59 +0000 Received: from localhost ([127.0.0.1]:58505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zao1v-0007du-9J for submit@debbugs.gnu.org; Sat, 12 Sep 2015 12:51:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35171) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zao1s-0007dm-Cl for submit@debbugs.gnu.org; Sat, 12 Sep 2015 12:51:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zao1r-0001WV-3M for submit@debbugs.gnu.org; Sat, 12 Sep 2015 12:51:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zao1r-0001WI-0i for submit@debbugs.gnu.org; Sat, 12 Sep 2015 12:51:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zao1q-0005fK-0W for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 12:51:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zao1m-0001Ub-QS for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 12:51:53 -0400 Received: from mail-qk0-f171.google.com ([209.85.220.171]:35605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zao1m-0001UX-LR for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 12:51:50 -0400 Received: by qkap81 with SMTP id p81so43783706qka.2 for ; Sat, 12 Sep 2015 09:51:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=n5xOXPALS39Um38N1vr4ukvMlyFczNygajNaM/o/Wbk=; b=dPU9UmAkg6OQU+YVnGXwxRdHjGfvx23nB4OwDRl2z8MibsSJ5QGJtv5QTi21VYlynA wLOAdVDtyJhEo/TpmZNZZY0Qlq4STjqanrzseiVYAnDNvopfoHXQ7IhvwqF+KmiaC2dn ZfoynhusJ3UgpkmxDrWQ8yxtHTU61CdO5U0yhjUjGkXh38POaLGFkQ2jNja7iArGm8sI HqtgkrdCAQ2esBqhPXtAooNcjCB6RmkE6tqOAYzIHkw2RBgADAk5dPs2B86aMJPlMdUI 2no+eNtiw04VIGQPD1m7q82QBzVn7dUvzzgzxTjrztG36aqIcXPdzuz4ZOJ/+yC+oq+L LTdw== X-Gm-Message-State: ALoCoQlBBEfbfViv2RWTqi17uD+RwN+zobHjvTMVe/KXx5GkYXd4kSlt7YCWkB7RjJlQn30wtWax X-Received: by 10.55.197.213 with SMTP id k82mr7346448qkl.49.1442076710060; Sat, 12 Sep 2015 09:51:50 -0700 (PDT) Received: from holos.localdomain (c-73-172-248-173.hsd1.md.comcast.net. [73.172.248.173]) by smtp.gmail.com with ESMTPSA id z19sm2333699qge.38.2015.09.12.09.51.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Sep 2015 09:51:49 -0700 (PDT) Received: by holos.localdomain (Postfix, from userid 1000) id 25F8068971; Sat, 12 Sep 2015 12:51:47 -0400 (EDT) From: Mark Oteiza To: bug-gnu-emacs@gnu.org Subject: Re: bug#21465: [PATCH] CC-modes hierarchy References: Date: Sat, 12 Sep 2015 12:51:47 -0400 In-Reply-To: (Stefan Monnier's message of "Fri, 11 Sep 2015 22:32:00 -0400") Message-ID: <87pp1neg2k.fsf@udel.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) --=-=-= Content-Type: text/plain Stefan Monnier writes: > Package: Emacs > Version: 25.0.50 > - Move code common to all CC-mode major modes to a c-mode-common-mode function. > - Add new c-derivative-mode as a parent of C, C++, and ObjC, for > settings which apply to C-derived languages but not for others. > This has become necessary given that CC-mode is used nowadays as an > engine for modes which have little to do with C. > ... > - Remove c-make-inherited-keymap, since it's not used any more. It is not clear to me how to adapt a 3rd party derived mode to this. Granted, it was never clear to me how to make a mode derived from CC mode, but that's another thread. For mode derivation, either I have (define-derived-mode foo++-mode c++-mode "Foo++" ...) In which case there will be a parent c++-mode-map and a C++ menu present when there shouldn't be, or: (define-derived-mode foo++-mode c-derivative-mode "Foo++" ...) and fontification is broken. I've attached an example: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=freefem++-mode.el Content-Transfer-Encoding: quoted-printable Content-Description: freefem++ mode ;;; freefem++-mode.el --- Major mode for the FreeFem++ language ;; Copyright =C2=A9 2014-2015 Mark Oteiza ;; Copyright =C2=A9 2008-2011 J. Rafael Rodr=C3=ADguez Galv=C3=A1n ;; Author: Mark Oteiza ;; J. Rafael Rodr=C3=ADguez Galv=C3=A1n ;; Created: 25 Jan 2014 ;; Version: 0.3 ;; Keywords: languages ;; This file is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published ;; by the Free Software Foundation, either version 3 of the License, ;; or (at your option) any later version. ;; This file is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this file. If not, see . ;;; Commentary: ;; Inspired by `freefem++-mode.el' by J. Rafael Rodr=C3=ADguez Galv=C3=A1n. ;; ;; FreeFem++ is a partial differential ;; equation solver. It has its own language. FreeFem++ scripts can ;; solve multiphysics nonlinear systems in 2D and 3D. ;;; Code: (defgroup freefem++ nil "Support for the FreeFem++ language." :group 'languages :link '(url-link "http://www.freefem.org/ff++/") :prefix "freefem++-") (require 'cc-mode) (require 'compile) (eval-when-compile (require 'cl) ;temporary (require 'cc-langs) (require 'cc-fonts)) (eval-and-compile (c-add-language 'freefem++-mode 'c++-mode)) ;;; Lexer-level syntax (identifiers, tokens etc). (c-lang-defconst c-symbol-chars ;; No underscore or other symbols permitted in identifiers freefem++ c-alnum) (c-lang-defconst c-cpp-include-directives freefem++ '("include" "load")) (c-lang-defconst c-opt-cpp-macro-define freefem++ "macro") ;; Additional constants for parser-level constructs. (c-lang-defconst c-type-decl-prefix-key ;; No pointers, casting, or &=3D operator, only references freefem++ (concat "\\(&\\)\\([^=3D]\\|$\\)")) (c-lang-defconst c-opt-type-suffix-key ;; Arrays freefem++ "\\(\\[[^]]*\\]\\|\\[\<^\>]*\\]\\)") ;; Keyword lists. (c-lang-defconst c-primitive-type-kwds freefem++ '("bool" "border" "Cmatrix" "complex" "func" "ifstream" "int" "macro" "matrix" "mesh" "mesh3" "ofstream" "problem" "real" "R3" "solve" "string" "varf")) (c-lang-defconst c-primitive-type-prefix-kwds ;; Both here and in `c-primitive-type-kwds' freefem++ '("func")) (c-lang-defconst c-paren-nontype-kwds freefem++ '("int1d" "int2d" "int3d" "intalledges" "on" "jump" "mean" "dx" "dxx" "dxy" "dy" "dyx" "dyy" "dz" "interpolate" "set" "plot")) (c-lang-defconst c-constant-kwds freefem++ '("true" "false" "pi" ;; Reserved "P" "N" ;; Finite elements "P0" "P1" "P2" "P3" "P4" "P0VF" "P1nc" "P1dc" "P2dc" "P1b" "P2b" "P2h" "RT0" "RT1" "BDM1" "RT0Ortho" "RT1Ortho" "BDM1Ortho" "RTmodif" "P0edge" "P1edge" "P2edge" "P3edge" "P4edge" "P5edge" "P03d" "P13d" "P1b3d" "P23d" "RT03d" "Edge03d" ;; Solvers "LU" "Cholesky" "Crout" "CG" "GMRES" "UMFPACK" "sparsesolver" ;; Quadrature finite elements "qf1pE" "qf2pE" "qf3pE" "qf4pE" "qf5pE" "qf1pElump")) ;; Font Lock linking (defconst freefem++-font-lock-keywords-1 (c-lang-const c-matchers-1 freefem= ++) "Minimal highlighting for FreeFem++ mode.") (defconst freefem++-font-lock-keywords-2 (c-lang-const c-matchers-2 freefem= ++) "Fast normal highlighting for FreeFem++ mode.") (defconst freefem++-font-lock-keywords-3 (c-lang-const c-matchers-3 freefem= ++) "Accurate normal highlighting for FreeFem++ mode.") (defvar freefem++-font-lock-keywords freefem++-font-lock-keywords-3 "Default expressions to highlight in FreeFem++ mode.") ;; Program invocation (defcustom freefem++-program "FreeFem++" "Command used to execute the FreeFem++ compiler. See also `freefem++-program-options'." :type 'string :group 'freefem++) (defcustom freefem++-program-options (list "-ne") "Options applied to `freefem++-program'. Options: -v , level of freefem output (0--1000000) -fglut , the file name of save all plots (replot with ffglut comma= nd) -glut , change compatible with ffglut -gff , change compatible with ffglut (with space quoti= ng) -nowait, nowait at the end on window -wait, wait at the end on window -nw, no ffglut, ffmedit (=3D> no graphics windows) -ne, no edp script output -cd, Change dir to script dir" :type '(repeat string) :group 'freefem++) (defcustom freefem++-run-error-regexp-alist '(("^ Error line number \\([0-9]+\\), in file \\([[:alpha:]][-[:alnum:].]= +\\)," 2 1)) "Alist that specifies how to match errors in FreeFem++ output." :type 'alist :link '(variable-link compilation-error-regexp-alist) :group 'freefem++) (defvar-local freefem++-process nil "Process currently executing `freefem++-program'") (defun freefem++-kill-process () "Send kill signal to FreeFem++ process." (interactive) (interrupt-process freefem++-process)) (define-compilation-mode freefem++-run-mode "Compilation" "Major mode for FreeFem++ compilation log buffers.") (defun freefem++-run-buffer () "Send current buffer to FreeFem++." (interactive) (save-some-buffers) (let ((file (file-name-nondirectory buffer-file-name)) (command (mapconcat #'identity (cons freefem++-program freefem++-program-options) " "))) (setq freefem++-process (compilation-start (concat command " " file) 'freefem++-run-mode)))) ;; Easy menu (c-lang-defconst c-mode-menu ;; The definition for the mode menu. The menu title is prepended to ;; this before it's fed to `easy-menu-define'. t `(["Process this buffer" freefem++-run-buffer t] ["Kill FreeFem++ process" freefem++-kill-process t] "---" ["Comment Out Region" comment-dwim (c-fn-region-is-active-p)] ["Uncomment Region" comment-dwim (c-fn-region-is-active-p)] ["Indent Expression" c-indent-exp (memq (char-after) '(?\( ?\[ ?\{))] ["Indent Line or Region" c-indent-line-or-region t] ["Fill Comment Paragraph" c-fill-paragraph t] "----" ["Backward Statement" c-beginning-of-statement t] ["Forward Statement" c-end-of-statement t] "----" ("Toggle..." ["Syntactic indentation" c-toggle-syntactic-indentation :style toggle :selected c-syntactic-indentation] ["Electric mode" c-toggle-electric-state :style toggle :selected c-electric-flag] ["Auto newline" c-toggle-auto-newline :style toggle :selected c-auto-newline] ["Hungry delete" c-toggle-hungry-state :style toggle :selected c-hungry-delete-key] ["Subword mode" c-subword-mode :style toggle :selected (and (boundp 'c-subword-mode) c-subword-mode)]))) ;; Support for FreeFem++ (defvar freefem++-mode-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?' "_" table) table) "Syntax table used in `freefem++-mode' buffers.") (defvar freefem++-mode-abbrev-table nil "Abbreviation table used in `freefem++-mode' buffers.") (c-define-abbrev-table 'freefem++-mode-abbrev-table '(("else" "else" c-electric-continued-statement 0) ("while" "while" c-electric-continued-statement 0) ("catch" "catch" c-electric-continued-statement 0))) (defvar freefem++-mode-map (let ((map (if (fboundp 'c-make-inherited-keymap) (c-make-inherited-keymap) (make-sparse-keymap)))) (define-key map (kbd "C-c C-c") 'freefem++-run-buffer) (define-key map (kbd "C-c C-k") 'freefem++-kill-process) map) "Keymap used in `freefem++-mode' buffers.") (easy-menu-define freefem++-menu freefem++-mode-map "FreeFem++ Mode Command= s" (cons "FreeFem++" (c-lang-const c-mode-menu freefem++))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.[ei]dp\\'" . freefem++-m= ode)) (defalias 'freefem++-parent-mode (if (fboundp 'c-derivative-mode) 'c-derivative-mode 'c++-mode)) ;;;###autoload (define-derived-mode freefem++-mode freefem++-parent-mode "FreeFem++" "Major mode for editing code written in the FreeFem++ programming languag= e. See http://www.freefem.org/ff++/ for more information about the FreeFem++ language. In addition to any hooks its parent mode might have run, this mode runs the hook `freefem++-mode-hook' as the final step during initialization. Key bindings: \\{freefem++-mode-map}" :group 'freefem++ (c-initialize-cc-mode t) (c-init-language-vars freefem++-mode) (c-common-init 'freefem++-mode) (easy-menu-add freefem++-menu) (cc-imenu-init cc-imenu-c++-generic-expression) (c-update-modeline)) (provide 'freefem++-mode) ;;; freefem++-mode.el ends here --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 13 09:25:57 2015 Received: (at 21465) by debbugs.gnu.org; 13 Sep 2015 13:25:57 +0000 Received: from localhost ([127.0.0.1]:58806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb7I4-0003Zz-Sr for submit@debbugs.gnu.org; Sun, 13 Sep 2015 09:25:57 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:29280) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb7I2-0003Zq-4y for 21465@debbugs.gnu.org; Sun, 13 Sep 2015 09:25:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A/FgA731xV/0jo92hcDoMChAKFVcMLBAICgTw9EAEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQEEnxeSFINZI2GBBYFUWiKCeAEBAQ X-IPAS-Result: A0A/FgA731xV/0jo92hcDoMChAKFVcMLBAICgTw9EAEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQEEnxeSFINZI2GBBYFUWiKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="164707465" Received: from 104-247-232-72.cpe.teksavvy.com (HELO fmsmemgm.homelinux.net) ([104.247.232.72]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Sep 2015 09:25:53 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 2B868AE124; Sun, 13 Sep 2015 09:25:53 -0400 (EDT) From: Stefan Monnier To: Mark Oteiza Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: References: <87pp1neg2k.fsf@udel.edu> Date: Sun, 13 Sep 2015 09:25:53 -0400 In-Reply-To: <87pp1neg2k.fsf@udel.edu> (Mark Oteiza's message of "Sat, 12 Sep 2015 12:51:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > It is not clear to me how to adapt a 3rd party derived mode to > this. Hmm... I'm missing something. I don't see how your problem is linked to my patch? > For mode derivation, either I have > (define-derived-mode foo++-mode c++-mode "Foo++" > ...) > In which case there will be a parent c++-mode-map and a C++ menu present But that's already the case with the code in (say) Emacs-24, no? > when there shouldn't be, or: > (define-derived-mode foo++-mode c-derivative-mode "Foo++" > ...) > and fontification is broken. How is it broken? Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 13 12:06:32 2015 Received: (at 21465) by debbugs.gnu.org; 13 Sep 2015 16:06:32 +0000 Received: from localhost ([127.0.0.1]:59189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb9nT-0007HZ-RL for submit@debbugs.gnu.org; Sun, 13 Sep 2015 12:06:32 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:36388) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb9nS-0007HQ-9M for 21465@debbugs.gnu.org; Sun, 13 Sep 2015 12:06:30 -0400 Received: by qgx61 with SMTP id 61so98341065qgx.3 for <21465@debbugs.gnu.org>; Sun, 13 Sep 2015 09:06:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=50BQQAnwr4Wlip8vTGfVK+/mN27Gd/5qHaJoQDww2P0=; b=OUvyLfEOnv/pIpxwyN2YQWFeDfYUkld+oXtXDYadviN9v+rOeRnzOpx8j2C9Ayflvs 0Wp9WGn5kaQ5PbEdxL0WYSwCOcdX+z1PNLCd4en/3mwD7DoFxundRPIc/22wjNOKo+R5 UoTq6UlVKY4sblM3YW+V0DMMYDlueOFRTZJJU1Av6WImgsRiOS8LT+c5kiF3gnOH4kBb 7xBVpyzmL+S3K4ahcTXP4POaxcZPEUyHQm00NKU1dEhunQTL2CXDA1qn/tSL6GlOJpTE wSqmECwNLPQfi4ftyRd9pOTNQkhNyr8qFNiHmXTkku5D/f94eFhrpeScOmwkmrzuOA52 6Fpw== X-Gm-Message-State: ALoCoQk/QimFltiFQdaspkeFcbC5PkG92rYCIdIr7xkwSRd52fX1dy9V5cbUernpMq4NZhZGfHSd X-Received: by 10.140.194.148 with SMTP id p142mr15748428qha.84.1442160389628; Sun, 13 Sep 2015 09:06:29 -0700 (PDT) Received: from holos.localdomain (c-73-172-248-173.hsd1.md.comcast.net. [73.172.248.173]) by smtp.gmail.com with ESMTPSA id e197sm4159009qhc.30.2015.09.13.09.06.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Sep 2015 09:06:28 -0700 (PDT) Received: by holos.localdomain (Postfix, from userid 1000) id EFFC568971; Sun, 13 Sep 2015 12:06:26 -0400 (EDT) Date: Sun, 13 Sep 2015 12:06:26 -0400 From: Mark Oteiza To: Stefan Monnier Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: <20150913160626.GA1086@holos> References: <87pp1neg2k.fsf@udel.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24+9 (2dac9fa02842) (2015-08-30) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.7 (/) On 13/09/15 at 09:25am, Stefan Monnier wrote: > > It is not clear to me how to adapt a 3rd party derived mode to > > this. > > Hmm... I'm missing something. I don't see how your problem is linked to > my patch? The patch makes changes which will break modes in emacs 25, so I'm interested in knowing how to adapt, in particular, so my mode (and others) can be backward compatible. I think I have figured out how to accomodate this change: just checking for c-make-inherited-keymap and c-derivative-mode, so I am happy. > > For mode derivation, either I have > > > (define-derived-mode foo++-mode c++-mode "Foo++" > > ...) > > > In which case there will be a parent c++-mode-map and a C++ menu present > > But that's already the case with the code in (say) Emacs-24, no? Nope, for some reason, doing (c-make-inherited-keymap) in the map definition in 24, I end up only with a Foo++ menu. Simply using (make-keymap), I'd end with with both Foo++ and C++ menus. > > when there shouldn't be, or: > > (define-derived-mode foo++-mode c-derivative-mode "Foo++" > > ...) > > and fontification is broken. > > How is it broken? Oh, it was broken because I was using (make-syntax-table) instead of (funcall (c-lang-const c-make-mode-syntax-table c)). It looks like c-derivative-mode comes with no syntax table, which is alright. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 13 16:24:38 2015 Received: (at 21465) by debbugs.gnu.org; 13 Sep 2015 20:24:38 +0000 Received: from localhost ([127.0.0.1]:59312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbDpF-0006sM-Oz for submit@debbugs.gnu.org; Sun, 13 Sep 2015 16:24:38 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:21855) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbDpC-0006sD-Kp for 21465@debbugs.gnu.org; Sun, 13 Sep 2015 16:24:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A3FgA731xV/0jo92hcDoMChAKFVcMLBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQEEnxeSFINZI2GCWVoigngBAQE X-IPAS-Result: A0A3FgA731xV/0jo92hcDoMChAKFVcMLBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQEEnxeSFINZI2GCWVoigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="164730948" Received: from 104-247-232-72.cpe.teksavvy.com (HELO fmsmemgm.homelinux.net) ([104.247.232.72]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Sep 2015 16:24:33 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 76173AE27B; Sun, 13 Sep 2015 16:24:33 -0400 (EDT) From: Stefan Monnier To: Mark Oteiza Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: References: <87pp1neg2k.fsf@udel.edu> <20150913160626.GA1086@holos> Date: Sun, 13 Sep 2015 16:24:33 -0400 In-Reply-To: <20150913160626.GA1086@holos> (Mark Oteiza's message of "Sun, 13 Sep 2015 12:06:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > Nope, for some reason, doing (c-make-inherited-keymap) in the map > definition in 24, I end up only with a Foo++ menu. Simply using > (make-keymap), I'd end with with both Foo++ and C++ menus. Oh, you mean that your code uses c-make-inherited-keymap and the change breaks your code, so you then try to fix it by replacing it with make-sparse-keymap or make-keymap. Indeed, that's not the right fix. The right fix is to complain about the removal of c-make-inherited-keymap because it is used by external CC-mode modes. BTW, you don't need c-make-inherited-keymap. Instead you need (defvar foo++-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map c-mode-base-map) ... map)) This should be just as backward compatible as using c-make-inherited-keymap (and "backward" includes XEmacs, here). >> > when there shouldn't be, or: >> > (define-derived-mode foo++-mode c-derivative-mode "Foo++" >> > ...) >> > and fontification is broken. >> >> How is it broken? > Oh, it was broken because I was using (make-syntax-table) instead of > (funcall (c-lang-const c-make-mode-syntax-table c)). It looks like > c-derivative-mode comes with no syntax table, which is alright. Indeed, we could set C's syntax table in c-derivative-mode. That would make a lot of sense, thanks. The proposed patch just introduces c-derivative-mode as a way to make the hierarchy more visible, but it doesn't make c-derivative-mode usable on its own. You could argue that c-derivative-mode should be the same as c-mode, but my patch does not try to do that (yet?). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 13 17:18:05 2015 Received: (at 21465) by debbugs.gnu.org; 13 Sep 2015 21:18:05 +0000 Received: from localhost ([127.0.0.1]:59330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbEez-00084G-1t for submit@debbugs.gnu.org; Sun, 13 Sep 2015 17:18:05 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:34513) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbEex-000849-Tz for 21465@debbugs.gnu.org; Sun, 13 Sep 2015 17:18:04 -0400 Received: by qkfq186 with SMTP id q186so51319937qkf.1 for <21465@debbugs.gnu.org>; Sun, 13 Sep 2015 14:18:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=LOvc4/AFpab6mFxIWO1To1TLzBo7qK041Zp9JcQD0nk=; b=TqB9MXj9Bl7vhsryOZjUFzVJh693zXohULT8q6UgkCA7iCTOnOBlj6J+mcJqm/UH+A iqLNIFe2igRQaqjKi3dFMR/SGaFfDL19eozau/Oxb5c7/0iI5bqEczqbYsoRtJ3mnGm3 qw+R7wWuN7jOWBTu+d+UX8DhDhSV3Pf11tDF7G2CCZTdoyQon5sq3vzjt0Oky2QAYLeo 4+zBIf06qnsyUrXFQ1o39PnYxWn0tbwCo5+/YEgqRSrrs4o39Wfmg6Uy+Sg3cq8fR1g4 Ki9qaf+VY76q3EG3NX+y5MNU6xRfAxbz9icRcqaHAmYHnqPRdtZbIMtn1M3y0lY/LfV5 EDSQ== X-Gm-Message-State: ALoCoQmh8oEatiPcJpNxAL2HmQ5BFbhKxb0vL3Rus4ksvceDHHAOdyHaXPoW7Cri1miJgxiR3LED X-Received: by 10.55.41.224 with SMTP id p93mr16625732qkp.73.1442179083546; Sun, 13 Sep 2015 14:18:03 -0700 (PDT) Received: from holos.localdomain (c-73-172-248-173.hsd1.md.comcast.net. [73.172.248.173]) by smtp.gmail.com with ESMTPSA id 8sm4642557qgi.1.2015.09.13.14.18.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Sep 2015 14:18:02 -0700 (PDT) Received: by holos.localdomain (Postfix, from userid 1000) id 22E5268971; Sun, 13 Sep 2015 17:18:01 -0400 (EDT) Date: Sun, 13 Sep 2015 17:18:01 -0400 From: Mark Oteiza To: Stefan Monnier Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: <20150913211801.GA10161@holos> References: <87pp1neg2k.fsf@udel.edu> <20150913160626.GA1086@holos> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24+12 (e85eda4ee425) (2015-08-30) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.7 (/) On 13/09/15 at 04:24pm, Stefan Monnier wrote: > > Nope, for some reason, doing (c-make-inherited-keymap) in the map > > definition in 24, I end up only with a Foo++ menu. Simply using > > (make-keymap), I'd end with with both Foo++ and C++ menus. > > Oh, you mean that your code uses c-make-inherited-keymap and the change > breaks your code, so you then try to fix it by replacing it with > make-sparse-keymap or make-keymap. > > Indeed, that's not the right fix. The right fix is to complain about > the removal of c-make-inherited-keymap because it is used by external > CC-mode modes. > > BTW, you don't need c-make-inherited-keymap. Instead you need > > (defvar foo++-mode-map > (let ((map (make-sparse-keymap))) > (set-keymap-parent map c-mode-base-map) > ... > map)) > > This should be just as backward compatible as using > c-make-inherited-keymap (and "backward" includes XEmacs, here). That works, thanks. > >> > when there shouldn't be, or: > >> > (define-derived-mode foo++-mode c-derivative-mode "Foo++" > >> > ...) > >> > and fontification is broken. > >> > >> How is it broken? > > > Oh, it was broken because I was using (make-syntax-table) instead of > > (funcall (c-lang-const c-make-mode-syntax-table c)). It looks like > > c-derivative-mode comes with no syntax table, which is alright. > > Indeed, we could set C's syntax table in c-derivative-mode. That would > make a lot of sense, thanks. The proposed patch just introduces > c-derivative-mode as a way to make the hierarchy more visible, but it > doesn't make c-derivative-mode usable on its own. You could argue that > c-derivative-mode should be the same as c-mode, but my patch does not > try to do that (yet?). Oh, and I guess it's not necessary to do the (funcall …) since it's already c-mode-syntax-table. Similar to the keymap, I can do (set-char-table-parent table c-mode-syntax-table) It would be nice if c-derivative-mode did that work for us. Then, if I didn't want the c-mode keymap or syntax table, I could set the parent of my derived table to nil. That's what I did for a mode that I recently made derive from conf-mode. I didn't want conf-mode's keymap. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 14 15:33:54 2015 Received: (at 21465) by debbugs.gnu.org; 14 Sep 2015 19:33:55 +0000 Received: from localhost ([127.0.0.1]:60566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbZVi-0000A9-6g for submit@debbugs.gnu.org; Mon, 14 Sep 2015 15:33:54 -0400 Received: from mail.muc.de ([193.149.48.3]:55486) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbZVe-00009y-K0 for 21465@debbugs.gnu.org; Mon, 14 Sep 2015 15:33:51 -0400 Received: (qmail 13730 invoked by uid 3782); 14 Sep 2015 19:33:49 -0000 Date: 14 Sep 2015 19:33:49 -0000 Message-ID: <20150914193349.13729.qmail@mail.muc.de> From: Alan Mackenzie To: 21465@debbugs.gnu.org Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.1-RELEASE-p16 (amd64)) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21465 Cc: Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.0 (/) In article you wrote: > Package: Emacs > Version: 25.0.50 > Any objection to the patch below? > It does the following: > - Move code common to all CC-mode major modes to a c-mode-common-mode function. > - Add new c-derivative-mode as a parent of C, C++, and ObjC, for > settings which apply to C-derived languages but not for others. > This has become necessary given that CC-mode is used nowadays as an > engine for modes which have little to do with C. > - Remove code that's redundant with what define-derived-mode does: > - set local-map > - set syntax-table > - set keymap parent > - Remove c-make-inherited-keymap, since it's not used any more. > - Fix c-after-font-lock-init so it only *moves* the function, and doesn't > accidentally add it (in case the derived mode decided to remove the function > from the hook, for example). Why? What is the point of the change? It introduces an extra layer onto the stack of major modes, but this extra layer seems to do no more than execute two forms, `(c-initialize-cc-mode t)' and `(setq abbrev-mode t)'. There is no coherence here, just two forms which happen to be in several mode's initialisation routines and put together, even though they don't form a coherent whole. If this is to be done, surely a defun rather than an extra layer of moding would be better. c-derivative-mode would really need to be called c-c-derivative mode to avoid confusion, since the prefix "c-" is just a name prefix. But again, what's this mode for? It does nothing other than add a single binding to a newly created key map. I'm not convinced there's any need to be able to treat the "C derivative" languages differently from all the others - anything you'd do in C++ Mode, you'd also be wanting to do in Java Mode in the (somewhat unusual) circumstance that you're hacking both languages. There's `c-mode-common-hook' for this. Occasionally, people ask which hook they should make their changes in. The standard recommendation is in `c-mode-common-hook' apart from (rare) things which are specific to just one language. If there are one or two extra levels of mode hook, there will be extra confusion. These new modes would add all the complexity of key maps, mode hooks, and whatever, yet not achieve any coherent abstraction. They would fragment the initialisation code. (Not that the current initialisation code is anything to write home about, but this rearrangement wouldn't be an improvement.) c-after-font-lock-init surely isn't broken. c-after-change is ALWAYS on after-change-functions. Without it, CC Mode simply wouldn't function. Or is there some way that Font Lock is called before CC Mode's initialisation, and c-after-change is somehow sneeking onto the hook twice? Or something like that. There is probably scope for getting rid of the explicit settings of the local key map, syntax table, and so on. > AFAIK this patch has no issues w.r.t compatibility since it relies on > behavior of define-derived-mode which has existed since "for ever". > But it hasn't seen much testing, admittedly (except for my own personal use). The question is, will XEmacs's define-derived-mode work? By the way, abbrev mode is used to expand "else" and "while" to themselves + re-indentation. There are one or two other keywords handled likewise. This isn't something either of us like, but doesn't seem urgent enough to get round to fixing. > Stefan [ patch read and snipped. ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 14 21:06:09 2015 Received: (at 21465) by debbugs.gnu.org; 15 Sep 2015 01:06:09 +0000 Received: from localhost ([127.0.0.1]:60724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbehF-0007pL-4Q for submit@debbugs.gnu.org; Mon, 14 Sep 2015 21:06:09 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:24129) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbehD-0007pC-EC for 21465@debbugs.gnu.org; Mon, 14 Sep 2015 21:06:08 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A2FgA731xV/0jo92hcgxCEAoVVwwsEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtBZAhE5Y0jhwjYYMzIoJ4AQEB X-IPAS-Result: A0A2FgA731xV/0jo92hcgxCEAoVVwwsEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtBZAhE5Y0jhwjYYMzIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="164849252" Received: from 104-247-232-72.cpe.teksavvy.com (HELO ceviche.home) ([104.247.232.72]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2015 21:06:07 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 2195166113; Mon, 14 Sep 2015 21:06:06 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: References: <20150914193349.13729.qmail@mail.muc.de> Date: Mon, 14 Sep 2015 21:06:06 -0400 In-Reply-To: <20150914193349.13729.qmail@mail.muc.de> (Alan Mackenzie's message of "14 Sep 2015 19:33:49 -0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > c-after-font-lock-init surely isn't broken. c-after-change is ALWAYS on > after-change-functions. No, it's not. Not in my sm-awk-mode which derives from awk-mode. Or rather, I don't want it there and c-after-font-lock-init forces it down my throat again after I removed it. > Without it, CC Mode simply wouldn't function. It does. Besides, my patch does not remove c-after-change from after-change-functions. It just stops c-after-font-lock-init from re-adding it if someone decided to remove it. AFAIK c-after-change is never removed from after-change-functions by accident, so re-adding it blindly is a bug. >> AFAIK this patch has no issues w.r.t compatibility since it relies on >> behavior of define-derived-mode which has existed since "for ever". >> But it hasn't seen much testing, admittedly (except for my own personal use). > The question is, will XEmacs's define-derived-mode work? The text you quote is my answer to the question. > By the way, abbrev mode is used to expand "else" and "while" to themselves > + re-indentation. There are one or two other keywords handled likewise. > This isn't something either of us like, but doesn't seem urgent enough > to get round to fixing. Indeed, I don't think it's urgent to fix it, but I think it deserves a comment. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 15 04:46:30 2015 Received: (at 21465) by debbugs.gnu.org; 15 Sep 2015 08:46:31 +0000 Received: from localhost ([127.0.0.1]:60888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zblsk-0001uO-7o for submit@debbugs.gnu.org; Tue, 15 Sep 2015 04:46:30 -0400 Received: from nk11p08mm-asmtpout001.mac.com ([17.158.58.246]:64989 helo=nk11p08mm-asmtp001.mac.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zblsi-0001uE-CB for 21465@debbugs.gnu.org; Tue, 15 Sep 2015 04:46:29 -0400 Received: from [192.168.1.102] (unknown [116.16.123.63]) by nk11p08mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0NUP0020AN102V30@nk11p08mm-asmtp001.mac.com> for 21465@debbugs.gnu.org; Tue, 15 Sep 2015 08:46:17 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-09-15_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=2.25774954287772e-12 compositescore=0.755084241041471 phishscore=0 kscore.is_spamscore=0 rbsscore=0.755084241041471 recipient_to_sender_totalscore=0 spamscore=0 urlsuspectscore=0.755084241041471 adultscore=0 kscore.compositescore=0 circleOfTrustscore=0 suspectscore=13 recipient_domain_to_sender_totalscore=0 bulkscore=0 recipient_domain_to_sender_domain_totalscore=0 recipient_to_sender_domain_totalscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1412110000 definitions=main-1509150139 Subject: Re: bug#21465: [PATCH] CC-modes hierarchy From: Zhang Kai Yu Content-type: text/plain; charset=us-ascii X-Mailer: iPad Mail (13A340) Message-id: Date: Tue, 15 Sep 2015 16:46:11 +0800 To: 21465@debbugs.gnu.org Content-transfer-encoding: quoted-printable MIME-version: 1.0 (1.0) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 21465 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -2.3 (--) This is useful feature. For example, when user set up auto completion, since clang provides completi= on to C, C++, and Objective-C, user just setup auto completion onto the comm= on hook. When user open a php file, C stuff starts to auto completion. Also, C snippets is required in C++ and Objective-C, but do not make sense i= n php. C++ and Objective-C contains C, however php not. There are some keywords in C= are not keywords in php, vice versa. It has structure similar to C but tota= lly different language and running environment. IMHO we should adapt to this.= From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 16 09:56:02 2015 Received: (at 21465) by debbugs.gnu.org; 16 Sep 2015 13:56:02 +0000 Received: from localhost ([127.0.0.1]:34926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcDBp-0005UV-Tg for submit@debbugs.gnu.org; Wed, 16 Sep 2015 09:56:02 -0400 Received: from mail.muc.de ([193.149.48.3]:29781) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcDBn-0005UM-D0 for 21465@debbugs.gnu.org; Wed, 16 Sep 2015 09:56:00 -0400 Received: (qmail 45034 invoked by uid 3782); 16 Sep 2015 13:55:57 -0000 Received: from acm.muc.de (p579E9B29.dip0.t-ipconnect.de [87.158.155.41]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 16 Sep 2015 15:55:56 +0200 Received: (qmail 4471 invoked by uid 1000); 16 Sep 2015 13:57:12 -0000 Date: Wed, 16 Sep 2015 13:57:12 +0000 To: Stefan Monnier Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: <20150916135712.GB3449@acm.fritz.box> References: <20150914193349.13729.qmail@mail.muc.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.0 (/) Hello, Stefan. On Mon, Sep 14, 2015 at 09:06:06PM -0400, Stefan Monnier wrote: > > c-after-font-lock-init surely isn't broken. c-after-change is ALWAYS on > > after-change-functions. > No, it's not. Not in my sm-awk-mode which derives from awk-mode. > Or rather, I don't want it there and c-after-font-lock-init forces it > down my throat again after I removed it. > > Without it, CC Mode simply wouldn't function. > It does. It may appear to, but c-after-change does important things like invalidating caches, and preparing the buffer for font locking. Sooner or later, something will go wrong. (Unless you've put in an sm-c-after-change, or something like that.) But you probably know this. This is one of these "please don't report any bugs whilst this is active". > Besides, my patch does not remove c-after-change from > after-change-functions. It just stops c-after-font-lock-init from > re-adding it if someone decided to remove it. The impression should not be given that c-after-change is in any way an optional extra. It's essential to CC Mode. Why do you want to remove it from your setup? > AFAIK c-after-change is never removed from after-change-functions by > accident, so re-adding it blindly is a bug. I don't think so. Anybody advanced/foolish enough to remove it will know how to remove it even after c-after-font-lock-init has inserted it. This isn't something that should be encouraged. Again, why do you want to take it out of your Awk Mode? [ .... ] > Stefan -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 16 21:49:55 2015 Received: (at 21465) by debbugs.gnu.org; 17 Sep 2015 01:49:55 +0000 Received: from localhost ([127.0.0.1]:35414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcOKg-0003rW-K6 for submit@debbugs.gnu.org; Wed, 16 Sep 2015 21:49:55 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:18549) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcOKc-0003rM-TM for 21465@debbugs.gnu.org; Wed, 16 Sep 2015 21:49:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A2FgA731xV/0jo92hcgxCEAoVVwwsEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtBZ8Xg2uOKYNZI2GDMyKCeAEBAQ X-IPAS-Result: A0A2FgA731xV/0jo92hcgxCEAoVVwwsEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtBZ8Xg2uOKYNZI2GDMyKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="165074299" Received: from 104-247-232-72.cpe.teksavvy.com (HELO pastel.home) ([104.247.232.72]) by ironport2-out.teksavvy.com with ESMTP; 16 Sep 2015 21:49:49 -0400 Received: by pastel.home (Postfix, from userid 20848) id 4337562363; Wed, 16 Sep 2015 21:49:49 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: References: <20150914193349.13729.qmail@mail.muc.de> <20150916135712.GB3449@acm.fritz.box> Date: Wed, 16 Sep 2015 21:49:49 -0400 In-Reply-To: <20150916135712.GB3449@acm.fritz.box> (Alan Mackenzie's message of "Wed, 16 Sep 2015 13:57:12 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > It may appear to, but c-after-change does important things like > invalidating caches, and preparing the buffer for font locking. Sooner > or later, something will go wrong. (Unless you've put in an > sm-c-after-change, or something like that.) But you probably know this. That's right. > This is one of these "please don't report any bugs whilst this is > active". I still have no idea why you think it's right for c-after-font-lock-init to add c-after-change to after-change-functions if it's not there in the first place. I understand why you might not consider it as a bug, but why do you consider it as a feature? > Again, why do you want to take it out of your Awk Mode? Because I'm trying to make my awk-mode behave in "the standard way" used by all other (non-cc) major modes. E.g. using syntax-propertize. I know we disagree on whether "like everyone else" is a quality or a defect, but I'd ask you to try at least not to actively and gratuitously prevent me from writing a mode that uses the cc-mode infrastructure yet behaves a bit more "like everyone else". So, to put it some other way: can you give me a concrete example where my change to c-after-font-lock-init is harmful? Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 17 08:29:22 2015 Received: (at 21465) by debbugs.gnu.org; 17 Sep 2015 12:29:22 +0000 Received: from localhost ([127.0.0.1]:35806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcYJV-0003ko-NI for submit@debbugs.gnu.org; Thu, 17 Sep 2015 08:29:22 -0400 Received: from mail.muc.de ([193.149.48.3]:52614) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcYJS-0003kd-7W for 21465@debbugs.gnu.org; Thu, 17 Sep 2015 08:29:19 -0400 Received: (qmail 99084 invoked by uid 3782); 17 Sep 2015 12:29:16 -0000 Received: from acm.muc.de (p579E894E.dip0.t-ipconnect.de [87.158.137.78]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 17 Sep 2015 14:29:15 +0200 Received: (qmail 3083 invoked by uid 1000); 17 Sep 2015 12:30:32 -0000 Date: Thu, 17 Sep 2015 12:30:32 +0000 To: Stefan Monnier Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: <20150917123032.GA2644@acm.fritz.box> References: <20150914193349.13729.qmail@mail.muc.de> <20150916135712.GB3449@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.0 (/) Hello, Stefan. On Wed, Sep 16, 2015 at 09:49:49PM -0400, Stefan Monnier wrote: > > It may appear to, but c-after-change does important things like > > invalidating caches, and preparing the buffer for font locking. Sooner > > or later, something will go wrong. (Unless you've put in an > > sm-c-after-change, or something like that.) But you probably know this. > That's right. > > This is one of these "please don't report any bugs whilst this is > > active". > I still have no idea why you think it's right for c-after-font-lock-init > to add c-after-change to after-change-functions if it's not there in the > first place. > I understand why you might not consider it as a bug, but why do you > consider it as a feature? We're bikeshedding. I suppose it doesn't really matter if we check for the presence of c-after-change first. It's more code, that's all. But it doesn't really matter. Hopefully _nobody_ (except someone like yourself who knows what they're doing) is going to try running without c-after-change. > > Again, why do you want to take it out of your Awk Mode? > Because I'm trying to make my awk-mode behave in "the standard way" used > by all other (non-cc) major modes. E.g. using syntax-propertize. Ah, OK. > I know we disagree on whether "like everyone else" is a quality or > a defect, but I'd ask you to try at least not to actively and > gratuitously prevent me from writing a mode that uses the cc-mode > infrastructure yet behaves a bit more "like everyone else". > So, to put it some other way: can you give me a concrete example where > my change to c-after-font-lock-init is harmful? Provided you have the functionality of c-after-change in there correctly somewhere, then it shouldn't be harmful. So I withdraw my objection to that change to c-after-font-lock-init. > Stefan -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 19 14:43:18 2015 Received: (at 21465) by debbugs.gnu.org; 19 Sep 2015 18:43:18 +0000 Received: from localhost ([127.0.0.1]:37909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZdN6T-0002zI-TZ for submit@debbugs.gnu.org; Sat, 19 Sep 2015 14:43:18 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:39076) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZdN6R-0002z9-A4 for 21465@debbugs.gnu.org; Sat, 19 Sep 2015 14:43:16 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C028A201F5 for <21465@debbugs.gnu.org>; Sat, 19 Sep 2015 14:43:14 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute1.internal (MEProxy); Sat, 19 Sep 2015 14:43:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= secure.kjonigsen.net; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:reply-to:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=1lK9WTk1Lr04yGOp4vEaaGE1JLs =; b=nMXVMNdgZnCb2qup6UuYVeg6WlwljW8QOYfGquVVU520CBLn5fZmi2HvJDP I2brZsojvDooXkv2jmal1eyJN3bp/V+pTa/eTpv89frFYgUtRHPXu16vq2BgMU6J dchTHsuDa+tiRsPoUZZ2SgElk9rqIWm893RrFglWhwHJyo8g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:reply-to:subject:to :x-sasl-enc:x-sasl-enc; s=smtpout; bh=1lK9WTk1Lr04yGOp4vEaaGE1JL s=; b=UWLMK+z+SolJx/ItvNMcjg4utE/YTUG6acySPZvNTyQ36b0dZXvMNqjoWW ++FU/uvzL+BK8f+xq9icVCMlM51E/ahlsSXmtshvUnIhFlvJ7gbmB0xoFthGutQI d+uluRfQbj/nwl9TIYhKr1cvS52fGqaeAnChbwVcR+VmCd7fI= Received: by web3.nyi.internal (Postfix, from userid 99) id 9787710601D; Sat, 19 Sep 2015 14:43:14 -0400 (EDT) Message-Id: <1442688194.3803932.388172161.1040AB59@webmail.messagingengine.com> X-Sasl-Enc: 3GayotLVz/4Zc7To3WiQp/lXDIgKyND50bqc6GTcE+YG 1442688194 From: =?ISO-8859-1?Q?Jostein=20Kj=F8nigsen?= To: 21465@debbugs.gnu.org, Stefan Monnier MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: MessagingEngine.com Webmail Interface - ajax-e92f8263 Subject: Re: [PATCH] CC-modes hierarchy Date: Sat, 19 Sep 2015 20:43:14 +0200 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21465 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: jostein@kjonigsen.net 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: -0.7 (/) > Any objection to the patch below? >=20 > It does the following: > - Remove c-make-inherited-keymap, since it's not used any more. >=20 > AFAIK this patch has no issues w.r.t compatibility since it relies on > behavior of define-derived-mode which has existed since "for ever" csharp-mode[1] is not hosted on ELPA or in Emacs core, so I'm not going to blame Emacs developers for not checking it, but it may have issues with this patch. csharp-mode has gone halfway through a transition to use of "make-derive-mode", but it's not 100% there. That means that it currently (still) uses "c-make-inherited-keymap" to configure itself[2]. If fixing it on my end is easy, I guess that will be easier than objecting to this patch. I see there's a suggestion posted[3] which I can try out. Just thought I'd put it out there that there are indeed more 3rd party modules depending on the current implementation. [1] https://github.com/josteink/csharp-mode [2] https://github.com/josteink/csharp-mode/blob/master/csharp-mode.el#L1428-L1= 430 [3] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21465#17 -- Jostein Kj=F8nigsen jostein@kjonigsen.net / jostein@secure.kjonigsen.net From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 20 09:35:25 2015 Received: (at 21465) by debbugs.gnu.org; 20 Sep 2015 13:35:26 +0000 Received: from localhost ([127.0.0.1]:38219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zdem4-0000Iu-P9 for submit@debbugs.gnu.org; Sun, 20 Sep 2015 09:35:25 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:63438) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zdelw-0000IN-Do for 21465@debbugs.gnu.org; Sun, 20 Sep 2015 09:35:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AsEwA731xV/2yixEVcgxCEAoVVuzcJh0sEAgKBPDkUAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYCAR+LOoUFB4QtBbM/gUUjYYMzIoJ4AQEB X-IPAS-Result: A0AsEwA731xV/2yixEVcgxCEAoVVuzcJh0sEAgKBPDkUAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYCAR+LOoUFB4QtBbM/gUUjYYMzIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="165366411" Received: from 69-196-162-108.dsl.teksavvy.com (HELO ceviche.home) ([69.196.162.108]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Sep 2015 09:35:15 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 323BA6614D; Sun, 20 Sep 2015 09:35:15 -0400 (EDT) From: Stefan Monnier To: Jostein =?windows-1252?Q?Kj=F8nigsen?= Subject: Re: [PATCH] CC-modes hierarchy Message-ID: References: <1442688194.3803932.388172161.1040AB59@webmail.messagingengine.com> Date: Sun, 20 Sep 2015 09:35:15 -0400 In-Reply-To: <1442688194.3803932.388172161.1040AB59@webmail.messagingengine.com> ("Jostein =?windows-1252?Q?Kj=F8nigsen=22's?= message of "Sat, 19 Sep 2015 20:43:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 21465 Cc: jostein@kjonigsen.net, 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > That means that it currently (still) uses "c-make-inherited-keymap" to > configure itself[2]. Thanks, someone already pointed out that this function needs to stay for backward compatibility. > Just thought I'd put it out there that there are indeed more 3rd party > modules depending on the current implementation. Oh, yes. Actually, the patch's first hunk lists those externally maintained modes that use cc-mode (at least those I know of, and indeed, csharp-mode was missing) and I guess most of them are in the same situation. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 09 16:35:43 2015 Received: (at 21465) by debbugs.gnu.org; 9 Oct 2015 20:35:43 +0000 Received: from localhost ([127.0.0.1]:34649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkeOE-000695-Uz for submit@debbugs.gnu.org; Fri, 09 Oct 2015 16:35:43 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:15332) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkeOA-00068u-Hu for 21465@debbugs.gnu.org; Fri, 09 Oct 2015 16:35:39 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A2FgA731xV/xWhxEVcgxCEAoVVwwsEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEBBQEBAQEBHYs6hQUHhC0BBLM/gUUjYYMzIoJ4AQEB X-IPAS-Result: A0A2FgA731xV/xWhxEVcgxCEAoVVwwsEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEBBQEBAQEBHYs6hQUHhC0BBLM/gUUjYYMzIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="169033515" Received: from 69-196-161-21.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.196.161.21]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Oct 2015 16:35:37 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 38D9BAE24D; Fri, 9 Oct 2015 16:35:37 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: References: <20150914193349.13729.qmail@mail.muc.de> <20150916135712.GB3449@acm.fritz.box> <20150917123032.GA2644@acm.fritz.box> Date: Fri, 09 Oct 2015 16:35:37 -0400 In-Reply-To: <20150917123032.GA2644@acm.fritz.box> (Alan Mackenzie's message of "Thu, 17 Sep 2015 12:30:32 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > So I withdraw my objection to that change to c-after-font-lock-init. Thanks, I installed that hunk into master, Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 09 16:49:29 2015 Received: (at 21465) by debbugs.gnu.org; 9 Oct 2015 20:49:29 +0000 Received: from localhost ([127.0.0.1]:34654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkebY-0006TL-GH for submit@debbugs.gnu.org; Fri, 09 Oct 2015 16:49:29 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:28467) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkebV-0006TC-NJ for 21465@debbugs.gnu.org; Fri, 09 Oct 2015 16:49:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BRFgA731xV/xWhxEVcgxBUgy6FVbxvIQqFcQQCAoE8PRABAQEBAQEBgQpBBYNdAQEBAgEBAQFTIwULCw4mEhQTAQQNJIg3CA3PFgEBAQEBAQQBAQEBAR2LOoQzAQFQB4QtBYtEi12EGoNcPoYrhy2DfoIUgUUjYYEpHIFuIoE9gTsBAQE X-IPAS-Result: A0BRFgA731xV/xWhxEVcgxBUgy6FVbxvIQqFcQQCAoE8PRABAQEBAQEBgQpBBYNdAQEBAgEBAQFTIwULCw4mEhQTAQQNJIg3CA3PFgEBAQEBAQQBAQEBAR2LOoQzAQFQB4QtBYtEi12EGoNcPoYrhy2DfoIUgUUjYYEpHIFuIoE9gTsBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="169034364" Received: from 69-196-161-21.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.196.161.21]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Oct 2015 16:49:24 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 37CB2AE24D; Fri, 9 Oct 2015 16:49:19 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: References: <20150914193349.13729.qmail@mail.muc.de> Date: Fri, 09 Oct 2015 16:49:19 -0400 In-Reply-To: <20150914193349.13729.qmail@mail.muc.de> (Alan Mackenzie's message of "14 Sep 2015 19:33:49 -0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 21465 Cc: 21465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > Why? What is the point of the change? It introduces an extra layer onto > the stack of major modes, but this extra layer seems to do no more than > execute two forms, `(c-initialize-cc-mode t)' and `(setq abbrev-mode t)'. You already have this layer, with c-mode-common-hook and c-mode-base-map. My patch just makes this layering more standard and then takes advantage of it to share some code. Here's another version of the patch with the following changes: - Got rid of c-derivative-mode (which I still use at other places in my local patches, but for now, I won't push for it any more). - Keep c-make-inherited-keymap for backward compatibility. - Fix the "c-mode-hook is run twice" bug, using the same hack as is used by define-globalized-minor-mode. The third point also makes the c-mode-common "extra layer" more useful since that hack is added in there. Any objections to this version? Stefan It does the following: - Move code common to all CC-mode major modes to a c-mode-common-mode function. - Remove code that's redundant with what define-derived-mode does: - set local-map - set syntax-table - set keymap parent - run mode hooks - Mark c-make-inherited-keymap and c-run-mode-hooks obsolete. - Use inhibit-modification-hooks rather than binding *-change-functions to nil. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 1b6a233..c476117 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -71,6 +71,19 @@ ;; ;; http://lists.sourceforge.net/mailman/listinfo/cc-mode-announce +;; Externally maintained major modes which use CC-mode's engine: +;; - cuda-mode +;; - csharp-mode (https://github.com/josteink/csharp-mode) +;; - haxe-mode +;; - d-mode +;; - dart-mode +;; - cc-php-js-cs.el +;; - php-mode +;; - yang-mode +;; - math-mode (mathematica) +;; - unrealscript-mode +;; - groovy-mode + ;;; Code: ;; For Emacs < 22.2. @@ -215,6 +228,8 @@ control). See \"cc-mode.el\" for more info." ;; incompatible (t (error "CC Mode is incompatible with this version of Emacs"))) map)) +(make-obsolete 'c-make-inherited-keymap + "Use make-sparse-keymap + (set-keymap-parent c-mode-base-map); or derive from c-mode-common" "25.1") (defun c-define-abbrev-table (name defs &optional doc) ;; Compatibility wrapper for `define-abbrev' which passes a non-nil @@ -667,7 +682,7 @@ compatible with old code; callers should always specify it." (setq c-new-BEG (point-min)) (setq c-new-END (point-max)) (save-excursion - (let (before-change-functions after-change-functions) + (let ((inhibit-modification-hooks t)) (mapc (lambda (fn) (funcall fn (point-min) (point-max))) c-get-state-before-change-functions) @@ -835,6 +850,7 @@ Note that the style variables are always made local to the buffer." (if (cc-bytecomp-fboundp 'run-mode-hooks) `(run-mode-hooks ,@hooks) `(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks)))) +(make-obsolete 'c-run-mode-hooks "derive your mode from c-common-mode" "25.1") ;;; Change hooks, linking with Font Lock and electric-indent-mode. @@ -1219,7 +1235,7 @@ Note that the style variables are always made local to the buffer." (backward-char)) ; back over (, [, <. (and (/= new-pos pos) new-pos))) -(defun c-change-expand-fl-region (beg end old-len) +(defun c-change-expand-fl-region (_beg _end _old-len) ;; Expand the region (c-new-BEG c-new-END) to an after-change font-lock ;; region. This will usually be the smallest sequence of whole lines ;; containing `c-new-BEG' and `c-new-END', but if `c-new-BEG' is in a @@ -1402,6 +1418,35 @@ This function is called from `c-common-init', once per mode initialization." (c-update-modeline))) +(defvar c-mode-common-map c-mode-base-map) + +(defvar c-mode-common-update-mode-lines () + "List of buffers where we should update the mode line.") + +(defun c-mode-common-update-mode-lines () + (while c-mode-common-update-mode-lines + (let ((buf (pop c-mode-common-update-mode-lines))) + (when (buffer-live-p buf) + (with-current-buffer (c-update-modeline))))) + (remove-hook 'post-command-hook #'c-mode-common-update-mode-lines) + (remove-hook 'find-file-hook #'c-mode-common-update-mode-lines)) + +(define-derived-mode c-mode-common prog-mode "CC-generic" + "Pseudo major mode, parent of all modes using the CC engine." + (c-initialize-cc-mode t) + (setq abbrev-mode t) ;; Used for c-electric-continued-statement! + ;; We want to update the mode-line but *after* the major mode's hooks + ;; have been run. + ;; FIXME: Ideally, we'd just use a mode-line entry that's computed + ;; dynamically, but it's not clear how to do that (we could use + ;; `mode-line-process' but that would look weird if the user has decided to + ;; put mode-line-process elsewhere than immediately to the right of the major + ;; mode's name), so for now we'll use the ugly hack below, similar to the one + ;; used by `define-globalized-minor-mode'. + (push (current-buffer) c-mode-common-update-mode-lines) + (add-hook 'post-command-hook #'c-mode-common-update-mode-lines) + (add-hook 'find-file-hook #'c-mode-common-update-mode-lines)) + ;; Support for C (defvar c-mode-syntax-table @@ -1414,7 +1459,7 @@ This function is called from `c-common-init', once per mode initialization." "Abbreviation table used in c-mode buffers.") (defvar c-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for C. (define-key map "\C-c\C-e" 'c-macro-expand) map) @@ -1455,7 +1500,7 @@ This function is called from `c-common-init', once per mode initialization." (unless (fboundp 'prog-mode) (defalias 'prog-mode 'fundamental-mode)) ;;;###autoload -(define-derived-mode c-mode prog-mode "C" +(define-derived-mode c-mode c-mode-common "C" "Major mode for editing C code. To submit a problem report, enter `\\[c-submit-bug-report]' from a @@ -1470,18 +1515,11 @@ initialization, then `c-mode-hook'. Key bindings: \\{c-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table c-mode-syntax-table) - (setq local-abbrev-table c-mode-abbrev-table - abbrev-mode t) - (use-local-map c-mode-map) (c-init-language-vars-for 'c-mode) (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; (c-common-init 'c-mode) (easy-menu-add c-c-menu) - (cc-imenu-init cc-imenu-c-generic-expression) - (c-run-mode-hooks 'c-mode-common-hook 'c-mode-hook) - (c-update-modeline)) + (cc-imenu-init cc-imenu-c-generic-expression)) ;; Support for C++ @@ -1497,7 +1535,7 @@ Key bindings: "Abbreviation table used in c++-mode buffers.") (defvar c++-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for C++. (define-key map "\C-c\C-e" 'c-macro-expand) (define-key map "\C-c:" 'c-scope-operator) @@ -1510,7 +1548,7 @@ Key bindings: (cons "C++" (c-lang-const c-mode-menu c++))) ;;;###autoload -(define-derived-mode c++-mode prog-mode "C++" +(define-derived-mode c++-mode c-mode-common "C++" "Major mode for editing C++ code. To submit a problem report, enter `\\[c-submit-bug-report]' from a c++-mode buffer. This automatically sets up a mail buffer with @@ -1525,18 +1563,11 @@ initialization, then `c++-mode-hook'. Key bindings: \\{c++-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table c++-mode-syntax-table) - (setq local-abbrev-table c++-mode-abbrev-table - abbrev-mode t) - (use-local-map c++-mode-map) (c-init-language-vars-for 'c++-mode) (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; (c-common-init 'c++-mode) (easy-menu-add c-c++-menu) - (cc-imenu-init cc-imenu-c++-generic-expression) - (c-run-mode-hooks 'c-mode-common-hook 'c++-mode-hook) - (c-update-modeline)) + (cc-imenu-init cc-imenu-c++-generic-expression)) ;; Support for Objective-C @@ -1551,7 +1582,7 @@ Key bindings: "Abbreviation table used in objc-mode buffers.") (defvar objc-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for Objective-C. (define-key map "\C-c\C-e" 'c-macro-expand) map) @@ -1563,7 +1594,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.m\\'" . objc-mode)) ;;;###autoload -(define-derived-mode objc-mode prog-mode "ObjC" +(define-derived-mode objc-mode c-derivative-mode "ObjC" "Major mode for editing Objective C code. To submit a problem report, enter `\\[c-submit-bug-report]' from an objc-mode buffer. This automatically sets up a mail buffer with @@ -1578,18 +1609,11 @@ initialization, then `objc-mode-hook'. Key bindings: \\{objc-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table objc-mode-syntax-table) - (setq local-abbrev-table objc-mode-abbrev-table - abbrev-mode t) - (use-local-map objc-mode-map) (c-init-language-vars-for 'objc-mode) (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ; (c-common-init 'objc-mode) (easy-menu-add c-objc-menu) - (cc-imenu-init nil 'cc-imenu-objc-function) - (c-run-mode-hooks 'c-mode-common-hook 'objc-mode-hook) - (c-update-modeline)) + (cc-imenu-init nil 'cc-imenu-objc-function)) ;; Support for Java @@ -1606,7 +1630,7 @@ Key bindings: "Abbreviation table used in java-mode buffers.") (defvar java-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for Java. map) "Keymap used in java-mode buffers.") @@ -1624,7 +1648,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.java\\'" . java-mode)) ;;;###autoload -(define-derived-mode java-mode prog-mode "Java" +(define-derived-mode java-mode c-mode-common "Java" "Major mode for editing Java code. To submit a problem report, enter `\\[c-submit-bug-report]' from a java-mode buffer. This automatically sets up a mail buffer with @@ -1639,17 +1663,10 @@ initialization, then `java-mode-hook'. Key bindings: \\{java-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table java-mode-syntax-table) - (setq local-abbrev-table java-mode-abbrev-table - abbrev-mode t) - (use-local-map java-mode-map) (c-init-language-vars-for 'java-mode) (c-common-init 'java-mode) (easy-menu-add c-java-menu) - (cc-imenu-init cc-imenu-java-generic-expression) - (c-run-mode-hooks 'c-mode-common-hook 'java-mode-hook) - (c-update-modeline)) + (cc-imenu-init cc-imenu-java-generic-expression)) ;; Support for CORBA's IDL language @@ -1662,7 +1679,7 @@ Key bindings: "Abbreviation table used in idl-mode buffers.") (defvar idl-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for IDL. map) "Keymap used in idl-mode buffers.") @@ -1673,7 +1690,7 @@ Key bindings: ;;;###autoload (add-to-list 'auto-mode-alist '("\\.idl\\'" . idl-mode)) ;;;###autoload -(define-derived-mode idl-mode prog-mode "IDL" +(define-derived-mode idl-mode c-mode-common "IDL" "Major mode for editing CORBA's IDL, PSDL and CIDL code. To submit a problem report, enter `\\[c-submit-bug-report]' from an idl-mode buffer. This automatically sets up a mail buffer with @@ -1688,16 +1705,13 @@ initialization, then `idl-mode-hook'. Key bindings: \\{idl-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table idl-mode-syntax-table) - (setq local-abbrev-table idl-mode-abbrev-table) - (use-local-map idl-mode-map) + ;; No c-electric-continued-statement here, so we don't need abbrev-mode. + (kill-local-variable 'abbrev-mode) (c-init-language-vars-for 'idl-mode) (c-common-init 'idl-mode) (easy-menu-add c-idl-menu) ;;(cc-imenu-init cc-imenu-idl-generic-expression) ;TODO - (c-run-mode-hooks 'c-mode-common-hook 'idl-mode-hook) - (c-update-modeline)) + ) ;; Support for Pike @@ -1712,7 +1726,7 @@ Key bindings: "Abbreviation table used in pike-mode buffers.") (defvar pike-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Additional bindings. (define-key map "\C-c\C-e" 'c-macro-expand) map) @@ -1725,7 +1739,7 @@ Key bindings: ;;;###autoload (add-to-list 'interpreter-mode-alist '("pike" . pike-mode)) ;;;###autoload -(define-derived-mode pike-mode prog-mode "Pike" +(define-derived-mode pike-mode c-mode-common "Pike" "Major mode for editing Pike code. To submit a problem report, enter `\\[c-submit-bug-report]' from a pike-mode buffer. This automatically sets up a mail buffer with @@ -1740,17 +1754,11 @@ initialization, then `pike-mode-hook'. Key bindings: \\{pike-mode-map}" - (c-initialize-cc-mode t) - (set-syntax-table pike-mode-syntax-table) - (setq local-abbrev-table pike-mode-abbrev-table - abbrev-mode t) - (use-local-map pike-mode-map) (c-init-language-vars-for 'pike-mode) (c-common-init 'pike-mode) (easy-menu-add c-pike-menu) ;;(cc-imenu-init cc-imenu-pike-generic-expression) ;TODO - (c-run-mode-hooks 'c-mode-common-hook 'pike-mode-hook) - (c-update-modeline)) + ) ;; Support for AWK @@ -1767,11 +1775,11 @@ Key bindings: "Abbreviation table used in awk-mode buffers.") (defvar awk-mode-map - (let ((map (c-make-inherited-keymap))) + (let ((map (make-sparse-keymap))) ;; Add bindings which are only useful for awk. - (define-key map "#" 'self-insert-command) - (define-key map "/" 'self-insert-command) - (define-key map "*" 'self-insert-command) + (define-key map "#" 'self-insert-command);Override electric parent binding. + (define-key map "/" 'self-insert-command);Override electric parent binding. + (define-key map "*" 'self-insert-command);Override electric parent binding. (define-key map "\C-c\C-n" 'undefined) ; #if doesn't exist in awk. (define-key map "\C-c\C-p" 'undefined) (define-key map "\C-c\C-u" 'undefined) @@ -1790,7 +1798,7 @@ Key bindings: (declare-function c-awk-unstick-NL-prop "cc-awk" ()) ;;;###autoload -(define-derived-mode awk-mode prog-mode "AWK" +(define-derived-mode awk-mode c-mode-common "AWK" "Major mode for editing AWK code. To submit a problem report, enter `\\[c-submit-bug-report]' from an awk-mode buffer. This automatically sets up a mail buffer with version @@ -1809,17 +1817,9 @@ Key bindings: ;; declared in cc-awk.el and hasn't yet been loaded. :syntax-table nil (require 'cc-awk) ; Added 2003/6/10. - (c-initialize-cc-mode t) - (set-syntax-table awk-mode-syntax-table) - (setq local-abbrev-table awk-mode-abbrev-table - abbrev-mode t) - (use-local-map awk-mode-map) (c-init-language-vars-for 'awk-mode) (c-common-init 'awk-mode) - (c-awk-unstick-NL-prop) - - (c-run-mode-hooks 'c-mode-common-hook 'awk-mode-hook) - (c-update-modeline)) + (c-awk-unstick-NL-prop)) ;; bug reporting diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 6bd5815..f4b54e3 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -510,7 +510,7 @@ wouldn't be able to undo them. The return value is the value of the last form in BODY." `(let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-point-motion-hooks t) - before-change-functions after-change-functions + (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename ; Prevent primitives checking ; for file modification From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 07 12:52:11 2020 Received: (at 21465) by debbugs.gnu.org; 7 Sep 2020 16:52:11 +0000 Received: from localhost ([127.0.0.1]:50642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFKNH-0005nR-JK for submit@debbugs.gnu.org; Mon, 07 Sep 2020 12:52:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:59476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFKNG-0005nC-Bp for 21465@debbugs.gnu.org; Mon, 07 Sep 2020 12:52:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XE97nlNU0R6RMQeKMzBdq+KqqLdvSTHUQc4UFb33f8M=; b=b4mOSGoIrGOu2wZWQp5l49FND4 AHnXvHFwCqbTfOzzOipM5EkMRqqvBdj5pcK+LdjiItz7vWTHuDlVcMsa6IgI6AIq7iR7q8o0SRPKT reFU69AoEounwr+6y9T+m39/40JeLfPIbGC5Fgu1PH1jlUsNOzDt12XXhgmpOpkoVtVk=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFKN7-0001U9-DA; Mon, 07 Sep 2020 18:52:03 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#21465: [PATCH] CC-modes hierarchy References: <20150914193349.13729.qmail@mail.muc.de> X-Now-Playing: Coil's _A Prison of Measured Time_: "Wir Clk Wir (A Deeply Disturbed Passing Mix)" Date: Mon, 07 Sep 2020 18:52:00 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 09 Oct 2015 16:49:19 -0400") Message-ID: <87a6y15y33.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > You already have this layer, with c-mode-common-hook and > c-mode-base-map. My patch just makes this layering more standard and > then takes advantage of it to share some code. > > Here's another ve [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21465 Cc: Alan Mackenzie , 21465@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 (-) Stefan Monnier writes: > You already have this layer, with c-mode-common-hook and > c-mode-base-map. My patch just makes this layering more standard and > then takes advantage of it to share some code. > > Here's another version of the patch with the following changes: > - Got rid of c-derivative-mode (which I still use at other places in my > local patches, but for now, I won't push for it any more). > - Keep c-make-inherited-keymap for backward compatibility. > - Fix the "c-mode-hook is run twice" bug, using the same hack as is used > by define-globalized-minor-mode. > The third point also makes the c-mode-common "extra layer" more useful > since that hack is added in there. > > Any objections to this version? This was four years ago, and there apparently wasn't any response here? Alan? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 07 16:03:52 2020 Received: (at 21465) by debbugs.gnu.org; 7 Sep 2020 20:03:52 +0000 Received: from localhost ([127.0.0.1]:50960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFNMm-0006WV-4g for submit@debbugs.gnu.org; Mon, 07 Sep 2020 16:03:52 -0400 Received: from colin.muc.de ([193.149.48.1]:24500 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kFNMk-0006WH-0L for 21465@debbugs.gnu.org; Mon, 07 Sep 2020 16:03:50 -0400 Received: (qmail 42070 invoked by uid 3782); 7 Sep 2020 20:03:43 -0000 Received: from acm.muc.de (p4fe15cc5.dip0.t-ipconnect.de [79.225.92.197]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 07 Sep 2020 22:03:42 +0200 Received: (qmail 14245 invoked by uid 1000); 7 Sep 2020 20:03:42 -0000 Date: Mon, 7 Sep 2020 20:03:42 +0000 To: Lars Ingebrigtsen Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: <20200907200342.GA14029@ACM> References: <20150914193349.13729.qmail@mail.muc.de> <87a6y15y33.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6y15y33.fsf@gnus.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21465 Cc: acm@muc.de, Stefan Monnier , 21465@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, Lars. On Mon, Sep 07, 2020 at 18:52:00 +0200, Lars Ingebrigtsen wrote: > Stefan Monnier writes: > > You already have this layer, with c-mode-common-hook and > > c-mode-base-map. My patch just makes this layering more standard and > > then takes advantage of it to share some code. > > Here's another version of the patch with the following changes: > > - Got rid of c-derivative-mode (which I still use at other places in my > > local patches, but for now, I won't push for it any more). > > - Keep c-make-inherited-keymap for backward compatibility. > > - Fix the "c-mode-hook is run twice" bug, using the same hack as is used > > by define-globalized-minor-mode. > > The third point also makes the c-mode-common "extra layer" more useful > > since that hack is added in there. > > Any objections to this version? > This was four years ago, and there apparently wasn't any response here? > Alan? Five years on, I'm still not keen on this change. It is a large patch. It would fragment the currently coherent functions c-mode, c++-mode and so on. It would extend the stack of modes by inserting a new, meaningless mode, c-mode-common; this might induce hackers to try to derive directly from c-mode-common (which wouldn't work) rather than one of the genuine CC Mode modes. It would magnify differences between the Emacs version of CC Mode and the upstream version, or cause a lot of work integrating the patch into the latter. Of the above, I think it is the artificial introduction of c-mode-common I'm least keen on. I would be happiest if this bug could just be closed with "won't fix". > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 07 16:40:45 2020 Received: (at 21465) by debbugs.gnu.org; 7 Sep 2020 20:40:45 +0000 Received: from localhost ([127.0.0.1]:51028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFNwT-0007SI-IB for submit@debbugs.gnu.org; Mon, 07 Sep 2020 16:40:45 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFNwR-0007S1-N5 for 21465@debbugs.gnu.org; Mon, 07 Sep 2020 16:40:44 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 143C5440CB3; Mon, 7 Sep 2020 16:40:38 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 75CA1440CA6; Mon, 7 Sep 2020 16:40:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1599511236; bh=DTtusuXOiPBIXi7nWpQuaM49vzZ2iM21RP19i5YO2Sk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Qs22O12jYaniKQ4uw2jRlNF7Vvl95mCBH45bej4kqggnMlFCI6spias15hVU48U4U C02X4YDXDD2WwrC4tdCQvXIKOyxNAXIq49RWk3gsUwJQYTZ11jn7ZlSBfP/+PftnkP ASN+IUdoCaqXnKULy9O/56aujTnuY5P0PRUdryMMQfXFXJuJAxHjyDD8/eXOVs3KLQ 1bsvsVQnNtnaSIL73xiFGX/ajSG9qASdisebIs9UgD4dkps1kaE04Hx2EaayUfqzUB zsAqTSGx05bElC4didzm3jxiuEvM4T2pWzslv4qKk/WT0egEXFNaHtUOtpOxRPlqEC Cy1CwquL9rimQ== Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0CD731204F6; Mon, 7 Sep 2020 16:40:36 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Subject: Re: bug#21465: [PATCH] CC-modes hierarchy Message-ID: References: <20150914193349.13729.qmail@mail.muc.de> <87a6y15y33.fsf@gnus.org> <20200907200342.GA14029@ACM> Date: Mon, 07 Sep 2020 16:40:35 -0400 In-Reply-To: <20200907200342.GA14029@ACM> (Alan Mackenzie's message of "Mon, 7 Sep 2020 20:03:42 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.041 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 21465 Cc: Lars Ingebrigtsen , 21465@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: -3.3 (---) > I would be happiest if this bug could just be closed with "won't fix". Agreed. I got discouraged from contributing to CC-mode. Stefan "Using sm-c-mode instead ;-)" From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 08 06:11:53 2020 Received: (at control) by debbugs.gnu.org; 8 Sep 2020 10:11:53 +0000 Received: from localhost ([127.0.0.1]:52066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFabR-0000be-I8 for submit@debbugs.gnu.org; Tue, 08 Sep 2020 06:11:53 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFabP-0000bR-Va for control@debbugs.gnu.org; Tue, 08 Sep 2020 06:11:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=W20X9T26cRjCPFf1AsXpY515St7d17wvaWd2l4SjvjY=; b=CYnD8h4nNL1nGHKebQpN1WA0Bl ybMRorq9+ren0qZWcMCpNisj6dUhjv/lzlBEoPL8su0oMdWDPWm/eLkQ/Rj/EJs5duIf+Vdkxm5Xh Qnkf6I300MgTeYrAR/0UmrXxUUJVBGugmGC4DmaP6pQuA3bnJwV8KP4HS9VKiHwFGXn0=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFabH-0001xs-U7 for control@debbugs.gnu.org; Tue, 08 Sep 2020 12:11:46 +0200 Date: Tue, 08 Sep 2020 12:11:42 +0200 Message-Id: <87mu2060ip.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #21465 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 21465 wontfix close 21465 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 21465 wontfix close 21465 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 08 06:12:07 2020 Received: (at 21465) by debbugs.gnu.org; 8 Sep 2020 10:12:07 +0000 Received: from localhost ([127.0.0.1]:52072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFabe-0000cj-QA for submit@debbugs.gnu.org; Tue, 08 Sep 2020 06:12:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFabd-0000br-J8 for 21465@debbugs.gnu.org; Tue, 08 Sep 2020 06:12:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AOqXOr90W8Ptm7nxFBMdZN3Al9+OL9Ii4ZE0vO4tyos=; b=dww4SCJAnlYAyzNnAGSruU3n5B NMz+N/ZuTIOHx/XpyZUrjV0c3B6xQyfOImCBl97gleAv3T1IpqCPZPV1FPBvObxXG34vaRcV5mFPB IkHgjcmtkLsP1kdO2Df2/NUC1Eft2wZBv1WhzunUUIptN/weYF36kzbVS8k7iolwd/Fs=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFabU-0001xz-KK; Tue, 08 Sep 2020 12:11:59 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#21465: [PATCH] CC-modes hierarchy References: <20150914193349.13729.qmail@mail.muc.de> <87a6y15y33.fsf@gnus.org> <20200907200342.GA14029@ACM> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEX3sTnAYxLp2KFd PBv69+D///9kZhvsAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+QJCAoAOds3tHQAAAG6SURBVDjLdZTr keQwCIQlrQMQ5wQ0DAl4nMCWlvxj2m4kax53px+uMp9pQcNMSlXjpMJnK/PtK+GoedcEkl7PeVR+ PN+y1AVIUptvIvIEQbK8g0JwHiL7GSIfIA5D+V1qnIMxOf8D8r8y9mOGSnsDQCNS9G+gEeczv4HN EdMJoodZsLk3ZkBKUk2LSJh5AdqEtgiqey50O0B8UCNJLuMDsLSKxqYp18EdIhX1D7CGgaqgv3UA +QKQXEN+gOIoP0sDOHJaI66IBzAYiJFVdVaVE5oiSGJNaOPmPspdYGt5h66qcWVWRkYJY7DlBXQk S+mN9daivXA3CKyzTf9OzFDtHPGQYiPVGajFeDnKmAAraE5cOoTzuTLQAkxP6Jxz2ifQhrUBAKn0 A8ZBqrsqF43AEz3JSJAoIoCgZ2/Q4myEAPYs4OgFzoxN3aXwtQagO20uvwwwMi4Yd8EFahV/JeP4 B1jE2gX6IsGsB4BN2q0bcWwXjLsBdNX7Qx8/N/y+PYWc+XeAO3q73c8/SsApBdi6YREghkwDcFNK HVcfnX8UATim9mxQz8fjPgF8ewJTKC4gHw3iclsg6Sv4BcIggr7UaWxqAAAAJXRFWHRkYXRlOmNy ZWF0ZQAyMDIwLTA5LTA4VDEwOjAwOjU3KzAwOjAwsYS1/AAAACV0RVh0ZGF0ZTptb2RpZnkAMjAy MC0wOS0wOFQxMDowMDo1NyswMDowMMDZDUAAAAAASUVORK5CYII= X-Now-Playing: Sleaford Mods's _Eton Alive_: "OBCT" Date: Tue, 08 Sep 2020 12:11:55 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 07 Sep 2020 16:40:35 -0400") Message-ID: <87imco60ic.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: >> I would be happiest if this bug could just be closed with "won't fix". > > Agreed. I got discouraged from contributing to CC-mode. > > Stefan "Using sm-c-mode instead ;-)" Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21465 Cc: Alan Mackenzie , 21465@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 (-) Stefan Monnier writes: >> I would be happiest if this bug could just be closed with "won't fix". > > Agreed. I got discouraged from contributing to CC-mode. > > Stefan "Using sm-c-mode instead ;-)" OK, closed. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 15 14:45:30 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, 06 Oct 2020 11:24:07 +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