From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 26 15:42:06 2020 Received: (at submit) by debbugs.gnu.org; 26 Apr 2020 19:42:06 +0000 Received: from localhost ([127.0.0.1]:34987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSnAE-0004Hn-Dk for submit@debbugs.gnu.org; Sun, 26 Apr 2020 15:42:06 -0400 Received: from lists.gnu.org ([209.51.188.17]:48700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSnAC-0004Hc-DS for submit@debbugs.gnu.org; Sun, 26 Apr 2020 15:42:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49816) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSnAB-0001gB-4r for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2020 15:42:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSnA9-0002MA-T2 for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2020 15:42:02 -0400 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:46295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSnA9-0002L6-Fw for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2020 15:42:01 -0400 Received: by mail-qk1-x733.google.com with SMTP id g74so15969610qke.13 for ; Sun, 26 Apr 2020 12:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=aVPPOB1CmqzXykPw5AUxVTlNXMWjRKyEomDPmJFvoPI=; b=aQSw+28anb/sPaWI2E9S6URNejN6V5JLkFaHMRne+MXH55yc5NEqY31LSUsI342cNi UTRMxLyAeej5YpLlclk7p447uWMzE5P0dL89rMEDWFJiizXt0j25G3s1+FnzgzZfxBO2 22l9EcT390QJOo7tB9oOfU16QFXRJaqlYArqhrehhE6iDmlre5d9yDCYE5D3gBv1YrBP z1wd5BzRscVaj+7fTdRxyBqMGK0armecam36Lj5mYiZjFrW1veZJG+TjQpe9aib5mh+6 hbZSv3RDZdNpepi50vnyo+IY4y7dCgoC0VJrXVqVEthR+CQL5+NmeJp1Tj51MlAeoKoF eHWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=aVPPOB1CmqzXykPw5AUxVTlNXMWjRKyEomDPmJFvoPI=; b=mc57c89ldpj1l9Pr4XpmlSoJV033rzEkJa4A4CD+8Yjyqe+H0Kt+PFJ+HmLK3ukelI YCIq5N3caOocwUG+hKxaQ/hpfnC8emZQ8/Zz7/S5bP2OjN+UDDQLRA99XM37uHHJBLTT a4E8BkdTsvV26Ms4iG6FFCxiVjoFJEd6DVZ5GhTcVYSBEpCwzV+lLaltkXo7C5i7pC29 U5DYLWbRCFtPVuu1YMlbgFWYuLoVc0r1FtouCvQe5p3YGa5QJcHvgh8bEY98qztItteQ 6CEVt8HcTE3Da3r/E0bswE5XmwCer+hGX7FXfX7bv9woPD82dj1mG0QyoRIDbfist4fF mbtA== X-Gm-Message-State: AGi0PuYhnAmKiAqVB5M2XdmwjW3l2HRLcY1DWTDriA+7LPP80BWNLRWY 3KtFAb+nl+0Bz4SxSRCEWgfYXR9DjiA= X-Google-Smtp-Source: APiQypIK2DU20pireMpFw1N0koLhmbO6aiViHK5jHSbSksATQRZerA1zyfoFUUa+bEUZNVEEFC5dLg== X-Received: by 2002:a37:dd5:: with SMTP id 204mr17865092qkn.321.1587930116841; Sun, 26 Apr 2020 12:41:56 -0700 (PDT) Received: from pikus.mina86.com ([89.36.67.7]) by smtp.gmail.com with ESMTPSA id z90sm7422105qtd.75.2020.04.26.12.41.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 12:41:56 -0700 (PDT) From: Michal Nazarewicz To: bug-gnu-emacs@gnu.org Subject: [PATCH] cc-mode: add support for Doxygen documentation style Date: Sun, 26 Apr 2020 20:41:48 +0100 Message-Id: <20200426194148.257848-1-mina86@mina86.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=mnazarewicz@gmail.com; helo=mail-qk1-x733.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::733 X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: * lisp/progmodes/cc-fonts.el (doxygen-font-lock-doc-comments, doxygen-font-lock-keywords): New constants defining Doxygen comment style support. * lisp/progmodes/cc-vars.el (c-doc-comment-style): Upda [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mnazarewicz[at]gmail.com) 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) * lisp/progmodes/cc-fonts.el (doxygen-font-lock-doc-comments, doxygen-font-lock-keywords): New constants defining Doxygen comment style support. * lisp/progmodes/cc-vars.el (c-doc-comment-style): Updated docstring to mention now-supported Doxygen mode. --- etc/NEWS | 16 +++++++- lisp/progmodes/cc-fonts.el | 78 ++++++++++++++++++++++++++++++++++++++ lisp/progmodes/cc-vars.el | 1 + 3 files changed, 94 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 025d5c14a7..537abef47b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -198,7 +198,6 @@ like cell phones, tablets or cameras. Previously, assigning a new template to an already defined tag had no effect. - ** map.el *** Pcase 'map' pattern added keyword symbols abbreviation. @@ -288,6 +287,21 @@ prefix on the Subject line in various languages. These new navigation commands are bound to 'n' and 'p' in 'apropos-mode'. +** cc-mode + +*** Added support for Doxygen documentation style. +‘doxygen’ is now valid ‘c-doc-comment-style’ which recognises all +comment styles supported by Doxygen (namely ‘///’, ‘//!’, ‘/** … */’ +and ‘/*! … */’. ‘gtkdoc’ remains the default for C and C++ modes; to +use ‘doxygen’ by default one might evaluate: + + (setq-default c-doc-comment-style + '((java-mode . javadoc) + (pike-mode . autodoc) + (c-mode . doxygen) + (c++-mode . doxygen))) + +or use it in a custom ‘c-style’. * New Modes and Packages in Emacs 28.1 diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 2cbbc66c14..9ea08a4624 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -3016,6 +3016,84 @@ autodoc-font-lock-keywords (c-font-lock-doc-comments "/[*/]!" limit autodoc-font-lock-doc-comments))))) +;; Doxygen + +(defconst doxygen-font-lock-doc-comments + ;; TODO: Handle @code, @verbatim, @dot, @f etc. better by not highlighting + ;; text inside of those commands. Something smarter than just regexes may be + ;; needed to do that efficiently. + `((,(concat + ;; Make sure that the special character has not been escaped. E.g. in + ;; ‘\@foo’ only ‘\@’ is a command (similarly for other characters like + ;; ‘\\foo’, ‘\#%\".|\\\\]" ; single-character escapes + "\\|::\\|---?" ; \:: \-- \--- + "\\)" + ;; HTML tags and entities: + "\\|" + "\\|&\\(?:\\sw+\\|#[0-9]+\\|#x[0-9a-fA-F]+\\);" + "\\)") + 1 ,c-doc-markup-face-name prepend nil) + ;; Commands inside of strings are not commands so override highlighting with + ;; string face. This also affects HTML attribute values if they are + ;; surrounded with double quotes which may or may not be considered a good + ;; thing. + ("\\(?:^\\|[^\\@]\\)\\(\"[^\"[:cntrl:]]+\"\\)" + 1 font-lock-string-face prepend nil) + ;; HTML comments inside of the Doxygen comments. + ("\\(?:^\\|[^\\@]\\)\\(\\)" + 1 font-lock-comment-face prepend nil) + ;; Autolinking. Doxygen auto-links anything that is a class name but we have + ;; no hope of matching those. We are, however, able to match functions and + ;; members using explicit scoped syntax. For functions, we can also find + ;; them by noticing argument-list. Note that Doxygen accepts ‘::’ as well + ;; as ‘#’ as scope operators. + (,(let* ((ref "[\\@]ref\\s-+") + (ref-opt (concat "\\(?:" ref "\\)?")) + (id "[a-zA-Z_][a-zA-Z_0-9]*") + (args "\\(?:()\\|([^()]*)\\)") + (scope "\\(?:#\\|::\\)")) + (concat + "\\(?:^\\|[^\\@/%:]\\)\\(?:" + ref-opt "\\(?1:" scope "?" "\\(?:" id scope "\\)+" "~?" id "\\)" + "\\|" ref-opt "\\(?1:" scope "~?" id "\\)" + "\\|" ref-opt "\\(?1:" scope "?" "~?" id "\\)" args + "\\|" ref "\\(?1:" "~?" id "\\)" + "\\|" ref-opt "\\(?1:~[A-Z][a-zA-Z0-9_]+\\)" + "\\)")) + 1 font-lock-function-name-face prepend nil) + ;; Match URLs and emails. This has two purposes. First of all, Doxygen + ;; autolinks URLs. Second of all, ‘@bar’ in ‘foo@bar.baz’ has been matched + ;; above as a command; try and overwrite it. + (,(let* ((host "[A-Za-z0-9]\\(?:[A-Za-z0-9-]\\{0,61\\}[A-Za-z0-9]\\)") + (fqdn (concat "\\(?:" host "\\.\\)+" host)) + (comp "[!-(*--/-=?-~]+") + (path (concat "/\\(?:" comp "[.]+" "\\)*" comp))) + (concat "\\(?:mailto:\\)?[a-zA-0_.]+@" fqdn + "\\|https?://" fqdn "\\(?:" path "\\)?")) + 0 font-lock-keyword-face prepend nil))) + +(defconst doxygen-font-lock-keywords + `((,(lambda (limit) + (c-font-lock-doc-comments "/\\(?:/[/!]\\|\\*[\\*!]\\)" + limit doxygen-font-lock-doc-comments))))) + ;; 2006-07-10: awk-font-lock-keywords has been moved back to cc-awk.el. (cc-provide 'cc-fonts) diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 3995b21185..b885f6ae1d 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -576,6 +576,7 @@ c-doc-comment-style javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode). autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode). gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C and C++ modes). + doxygen -- Doxygen style. The value may also be a list of doc comment styles, in which case all of them are recognized simultaneously (presumably with markup cues -- 2.26.2 From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 27 13:22:20 2020 Received: (at control) by debbugs.gnu.org; 27 Apr 2020 17:22:20 +0000 Received: from localhost ([127.0.0.1]:38032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT7SW-0000oL-LA for submit@debbugs.gnu.org; Mon, 27 Apr 2020 13:22:20 -0400 Received: from mail-qk1-f179.google.com ([209.85.222.179]:40240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT7SV-0000o7-9W for control@debbugs.gnu.org; Mon, 27 Apr 2020 13:22:19 -0400 Received: by mail-qk1-f179.google.com with SMTP id l78so18808346qke.7 for ; Mon, 27 Apr 2020 10:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=XACSTjH/dEfb1gTp96oz9sXC+w6p1JVsGdezS1bIXTA=; b=tgMobW3INCOKAF404X4KrlaDKTokw6YFlkFxEbrHpZALHQ/+3/+d4aeS9HFD2nku1u gKIYg0KoRk0so/6WFXXDUFdyhJtPq8PZgQ6z6/Zz3FFsY7CzeE9EuwMNXWvzgGimvv1A 2jYmoYmK6CgZ9opaUjJWWZAz3zMb55PWIjhApR4gnbPL/Md/GyPY4NZjkQsCdon5P+lI CeoZF44fiF3nkqLa5Ph3BEBmi5T+FqJVZg2D8tNNw0GJJL8VvEZ2MxXVvH3S6r9AagHr T7kfpZgAhZqnmtgZBPqbAw6vp+qOUtpTtNrciAHwUCCf/etFgkdbGyZK3/QegEYCoG9p UTYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=XACSTjH/dEfb1gTp96oz9sXC+w6p1JVsGdezS1bIXTA=; b=cb+SapHrtf6HDtS2F3upRlWSKCwyjHTC3+8ovFNneDc097lxA8gWoIW3H7Y1/Cz8kq 8o9gIYpSTJW6N26Ccntjy3b1+gTbDwWDlJecY8jmN/qRSYZQckx/ur5+qUJNw+sdNSdy cePAtRrRyyqWWdhawRXS+ePnaxWMXME0GfZflCNSrjMqQvVpcgSnDezaaXyX24PFatmb vtkYVUSUpQfZgxso+0FSwPr9eG3RFBKZs8RQp+4AjOYm95t2JdPr2Fpbu2EyOhtgXbua D4HU0k2VVtaD7JGf+mhF8zB+RMYiceLerCkgIYCW23h/qEMNRuiXd9xkJy6C4JNK9xU2 uQtw== X-Gm-Message-State: AGi0PuZkBaef/LIEToH/VL8OazO1nXuMfPteqTAiOpxYZ7cvFjOmB1K2 ATiOTjW+MVemI9k51C6WSkH6b/Ad X-Google-Smtp-Source: APiQypLniw/i8y1TLFx+3JFYNO1gl1TIEX8y0JAP9esaZnO/k2Rodjk5+yzG5r8rNAwhVn4w92wnog== X-Received: by 2002:a37:9e08:: with SMTP id h8mr23979690qke.369.1588008133681; Mon, 27 Apr 2020 10:22:13 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42]) by smtp.gmail.com with ESMTPSA id j90sm11353819qte.20.2020.04.27.10.22.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Apr 2020 10:22:13 -0700 (PDT) From: Noam Postavsky To: control@debbugs.gnu.org Subject: control message for bug #40877 Date: Mon, 27 Apr 2020 13:22:11 -0400 Message-ID: <85wo60973w.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain 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 (-) severity 40877 wishlist severity 40863 wishlist severity 40854 wishlist severity 40813 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Fri May 01 14:47:10 2020 Received: (at 40877-done) by debbugs.gnu.org; 1 May 2020 18:47:10 +0000 Received: from localhost ([127.0.0.1]:50645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUage-0001OD-9v for submit@debbugs.gnu.org; Fri, 01 May 2020 14:47:10 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUagc-0001O0-JG for 40877-done@debbugs.gnu.org; Fri, 01 May 2020 14:46:59 -0400 Received: by mail-wm1-f66.google.com with SMTP id y24so636632wma.4 for <40877-done@debbugs.gnu.org>; Fri, 01 May 2020 11:46:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=6EVavJ6EPlcGaASB7YT6rjowonUmjwvkRKE0XBInqj8=; b=CcxIwyPPf9ZUwQPNla3XtpVwmHYmID359I9JhKmI+9VDLumKdjOjhfOdkZWbwXgjGZ aj4qBB4g+ZbDmaT58aa7GTtbZwBbXB+Su/xLy4tdqLnlErOFAgq/T5V3v3uGMQHVYoJP 2C7B9VaCElJ1Wl8sZPzfVNpTUPxTjmtkkvvTeEWIPqPnZMtqigX/Mfecl1glnyADpLLf fImvcMHlZ5LQefUQdOlT55T9zfi8PpHfrU93+2sycdDG9z8Q8mBYlWpjXUJou+C9hz5K vIb1PFJztzz4YmHLrD4O8stklteXmzdxbJLKNRrADLSZtPb2sbIE/8PS8xSu24wtGYxy t2gw== X-Gm-Message-State: AGi0PuaZhntGMFCqjU71xyxOFXyHQK3tgDvr6GVZfRI1F5bTkfSl/0Qb EObCchDLgES5X0Oar2Y5N6sSHvWJLKfnOokvzYcbeYoA X-Google-Smtp-Source: APiQypJtLNA9q5XndmD+zfviN+7n/5WgS6/gvSEL2nDWFMapvA6TAjAXILwn30sLrOPfRqp4NvBIJK4/cQkeByu9igk= X-Received: by 2002:a1c:1f8e:: with SMTP id f136mr821353wmf.166.1588358812505; Fri, 01 May 2020 11:46:52 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Micha=C5=82_Nazarewicz?= Date: Fri, 1 May 2020 19:46:41 +0100 Message-ID: Subject: Re: [PATCH] cc-mode: add support for Doxygen documentation style To: 40877-done@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 40877-done 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: -0.5 (/) SeKAmXZlIHRha2VuIGxhY2sgb2YgcmVwbGllcyBhcyBsYWNrIG9mIG9iamVjdGlvbnMgYW5kIHB1 c2hlZCB0aGUgY2hhbmdlLg0KDQotLSANCkJlc3QgcmVnYXJkcw0K44Of44OP44KmIOKAnPCdk7bw nZOy8J2Tt/Cdk6o4NuKAnSDjg4rjgrbjg6zjg7TjgqTjg4QNCsKrSWYgYXQgZmlyc3QgeW91IGRv buKAmXQgc3VjY2VlZCwgZ2l2ZSB1cCBza3lkaXZpbmfCuw0K From unknown Sun Jun 22 00:49:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 May 2020 11:24:06 +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