From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Mon, 05 Nov 2018 02:43:56 +0100 Message-ID: <87y3a8jo2r.fsf@web.de> References: <20151216202605.GA3752@acm.fritz.box> <87h8hc4xw2.fsf_-_@web.de> <83tvlcsnee.fsf@gnu.org> <87pnw037ar.fsf@web.de> <83ftwvs7y9.fsf@gnu.org> <877ei7mkfh.fsf@web.de> <87a7mze7tl.fsf@web.de> <831s89mo03.fsf@gnu.org> <87pnvsifxt.fsf@web.de> <83muqwkkt1.fsf@gnu.org> <875zxjv3ku.fsf@web.de> <83o9bbjqcj.fsf@gnu.org> <87r2g7t7bo.fsf@web.de> <83tvl2hzt6.fsf@gnu.org> <87r2g5x3gk.fsf@web.de> <87va5gzxyk.fsf@web.de> <87lg6czxo9.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541383245 15364 195.159.176.226 (5 Nov 2018 02:00:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2018 02:00:45 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , Stefan Monnier , Noam Postavsky To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 05 03:00:41 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJUBz-0003qq-Qg for ged-emacs-devel@m.gmane.org; Mon, 05 Nov 2018 03:00:40 +0100 Original-Received: from localhost ([::1]:60986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJUE5-0003jP-T6 for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2018 21:02:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJTwB-0001JV-JX for emacs-devel@gnu.org; Sun, 04 Nov 2018 20:44:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJTwA-0004UH-Nq for emacs-devel@gnu.org; Sun, 04 Nov 2018 20:44:19 -0500 Original-Received: from mout.web.de ([212.227.17.11]:48371) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJTw3-0004MN-6Y; Sun, 04 Nov 2018 20:44:11 -0500 Original-Received: from drachen.dragon ([94.218.210.177]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MhDYL-1fxILO3nZh-00MP44; Mon, 05 Nov 2018 02:44:00 +0100 Original-Received: from drachen.dragon ([94.218.210.177]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MhDYL-1fxILO3nZh-00MP44; Mon, 05 Nov 2018 02:44:00 +0100 In-Reply-To: <87lg6czxo9.fsf@web.de> (Michael Heerdegen's message of "Thu, 01 Nov 2018 15:20:54 +0100") X-Provags-ID: V03:K1:3XAbY7S0u9oAhOcP+s614HqhOHh5eyVz/8OeEBdqXIcnF50jCsM IqlL9P/ScHNQ601NjLfDQOUGfOE/Dh5VEYzM/0CkCA3kssQzHwTv+Io7PxB4j5xK4pVNc4z jG5VQbqlELMT4n1Ku7x3//7GEXaWgT4VzMjOlXaMcKIPnTkUyh96qD8912wxioIiAQN8nvI XmFQaECB02Bbc7dvWf6Ww== X-UI-Out-Filterresults: notjunk:1;V01:K0:9iu5+bj0C/Y=:IF9lRiKxDk2Y4S/iwnpxms D9wNIJHCN/2a2KJBnS+76Ehyjmg4YSjv8nTnpUEMiPPHFJjzVvyMKPmEvFMmFPQC3fRd+1lhX N7Xt6lKVwC2eJHCXJZQ6mUG57+Wo9oFh+akywSw7YOp6EvsHd1FTySdZcXhvVUwsT5n2r0Laz GKcGmdwPbKS0pYaEOEWXHRhN+6TAyT5wylnjc041IJr8k+CFwv/jp4LdfSJDIgSiQFRPlk8lX HldkMTzloZCmcRoWBLp60+pICn5tZvQtbymr3+CYv6UIb4OdHYJ0cI8P+h/GISXh5c6i/QzBg 9ClvUDUv6HFdPOqFJ59zHw+R1bH6B/vYUInYGQ/x6FfP1GJe0vkCggY2zAaeaZ3WPVb8RHgZb qb/38frt30cKj2q5H4yqEoe/Dsvn0kdksvtvGaUI4VGhSFkYTHkZAbdLlRoqOwZZug6or5B6U u+jDzP43vzfLKIYHAEK/qadXpkYb2+lSV82yj+l2Lij4knGkLhqr7R5NKwmDriFj8/owScmWk 3PZvQqxFq/nvFtx3Ua3yoeUrE9M9/B/c6P0UnIMqFWXbX7avJj8bi7XKV7PADz/By8plwwVce MFpJILeT9TxZb/f/NoSbeCym7x2mNQBOkyE1famReFC+rH9wPUKgbAEFVWGJJTlu12UdJv5xJ CBV5HqmVMZ/HWmpwYklUNQC0yDAi53Vg45HlYzUsDfjHg/+gTJcSFOYDDF9kPXjsUASdF+ba3 ynKg6j/Ps1qbcCrk5ALOhDvJw7l0GY8vuxT5HnfXpLAfPsiXJzbxQR9d5gMdkIfFg3AvlOcA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.11 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231012 Archived-At: Michael Heerdegen writes: > > I'm pretty sure the *-loaddefs files are also generated. > > Oh, indeed. But git clean -xf or so should all remove these - right? Ok, I did that in my repo to exclude the generated files. I also kept in mind that some files are distributed via Gnu Elpa and 'SOMETHING may not be used there as a pcase pattern. I decided to not perform the 'DOESNT-HAVE-TO-BE-QUOTED replacement: while browsing the matches, I found that this seems to touch personal preferences and personal styles in too many cases. I wouldn't want that somebody would treat my code in such a way. The `DOESNT-UNQUOTE thing is a bit different. It also touches stylistic reasoning, but OTOH confuses people because when the backquote is followed by a list than it's not clear that it's actually just a constant list and not something constructed. Replacing the backquote with a quote can improve readability. OTOH, some people seem to prefer that the body of a macro is always a backquote expression. And that, also recursively in unquoted parts that need to be quoted. Likewise, there are lots of backquoted :type defcustom expressions, and lots of backquoted menu specifications. Of course, lots were also pcase patterns. I tried to filter out those very few cases that could not be replaced with quotes. Hope I found all. For now, I attach a patch were I replaced nearly everything where it was possible. Comments welcome. If we are sure which changes we want to keep, I'll do the final fine-tuning (fixing indentation and comments, if some were shifted, etc.) BTW, some files use backquotes very excessively, mainly lisp/progmodes/verilog-mode.el. I guess verilog consists mainly of backquotes? There were some backquoted function names and lambdas. I replaced the backquote with #' (symbols), and most of the time nothing (lambdas in lexical binding files). I was very conservative with lambdas in files that didn't use lexbind. Finally, the thing I found in lisp/calendar/time-date.el looked like a bug to me I found by accident. I'm attaching the patch. Michael.