From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Garreau\, Alexandre" Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Thu, 01 Nov 2018 00:44:57 +0100 Message-ID: <87in1hr892.fsf@portable.galex-713.eu> References: <20151216202605.GA3752@acm.fritz.box> <87egdy8tyz.fsf@fencepost.gnu.org> <56895FDE.4060406@yandex.ru> <8760za8r4a.fsf@fencepost.gnu.org> <87h9iunkcg.fsf@web.de> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1541029442 750 195.159.176.226 (31 Oct 2018 23:44:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2018 23:44:02 +0000 (UTC) User-Agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian Cc: Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 01 00:43:57 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 1gI09V-0008U9-7S for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 00:43:57 +0100 Original-Received: from localhost ([::1]:34053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gI0Bb-00031n-IO for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2018 19:46:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gI0AZ-0002lw-4m for emacs-devel@gnu.org; Wed, 31 Oct 2018 19:45:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gI0AY-0004wg-9w for emacs-devel@gnu.org; Wed, 31 Oct 2018 19:45:03 -0400 Original-Received: from portable.galex-713.eu ([2a00:5884:8305::1]:46062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gI0AW-0004uC-SS; Wed, 31 Oct 2018 19:45:02 -0400 Original-Received: from localhost ([::1] helo=portable.galex-713.eu) by portable.galex-713.eu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gI0AT-0003tI-Fu; Thu, 01 Nov 2018 00:44:57 +0100 PGP-FINGERPRINT: E109 9988 4197 D7CB B0BC 5C23 8DEB 24BA 867D 3F7F Accept-Language: fr, en, eo, it, br In-Reply-To: <87r2g5x3gk.fsf@web.de> (Michael Heerdegen's message of "Wed, 31 Oct 2018 21:31:55 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:5884:8305::1 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:230926 Archived-At: On 2018-10-31 at 21:31, Michael Heerdegen wrote: > ;;; ** Search the Emacs Elisp sources for > `',(or > (pred keywordp) > (pred numberp) > (pred stringp)) > > ;;; ** 509 matches in 50 files: > I believe a =E2=80=9Cfew examples=E2=80=9D contexts might be useful: > ;;; *** /home/micha/software/emacs/lisp/allout.el (1 match) > > ;;;; Line 5138 > ': Context: > (cond ((eq curr-elem '*) (allout-show-current-subtree) > (if (> allout-recent-end-of-subtree max-pos) > (setq max-pos allout-recent-end-of-subtree))) > ((eq curr-elem '+) > (if (not (allout-hidden-p)) > (save-excursion (allout-hide-current-subtree t))) > (allout-show-current-branches) > (if (> allout-recent-end-of-subtree max-pos) > (setq max-pos allout-recent-end-of-subtree))) > ((eq curr-elem '-) (allout-show-current-entry)) > ((eq curr-elem ':) > (setq stay t) > ;; Expand the `repeat' spec to an explicit version, > ;; w.r.t. remaining siblings: > ;;; *** /home/micha/software/emacs/lisp/cus-edit.el (2 matches) > > ;;;; Line 4711 > ':style Context: > (widget-put (get 'boolean 'widget-type) > :custom-menu (lambda (_widget symbol) > (vector (custom-unlispify-menu-entry symbol) > `(customize-variable ',symbol) > ':style 'toggle > ':selected symbol))) > ;;; *** /home/micha/software/emacs/lisp/cus-load.el (154 matches) > > ;;;; Line 929 > '"20.4" > > ;;;; Line 931 > '"21.1" Context: > (custom-put-if-not 'SQL 'custom-version '"20.4") > [=E2=80=A6] > (custom-put-if-not 'align 'custom-version '"21.1") And so on=E2=80=A6 > ;;; *** /home/micha/software/emacs/lisp/descr-text.el (1 match) > > ;;;; Line 684 > '#xa0 > ((and nobreak-char-display char (eq char '#xa= 0)) > 'nobreak-space) > ;;; *** /home/micha/software/emacs/lisp/info.el (1 match) > > ;;;; Line 5163 > '"(dir)top" Context: > (setq completions > (Info-speedbar-fetch-file-nodes (or node '"(dir)top")))) > ;;; *** /home/micha/software/emacs/lisp/ldefs-boot.el (57 matches) > > ;;;; Line 393 > '3 Context: > (function-put 'defadvice 'doc-string-elt '3) > ;;; *** /home/micha/software/emacs/lisp/calc/calc-aent.el (2 matches) > > ;;;; Line 718 > '?\. > > ;;;; Line 721 > '?_ Context: > (and (eq ch '?\.) > (eq (string-match "\\.[0-9]" math-exp-str math-exp-pos) > math-exp-pos)) > (and (eq ch '?_) > (eq (string-match "_\\.?[0-9]" math-exp-str math-exp-pos) > math-exp-pos) All the rest is alike. In the end I believe the maximally useful and compact presentation would be one example per type, with context along (most often upper sexp is enough, maybe some lines around too). Suggesting that for el-search.