From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#29923: [PATCH] Skip writing empty abbrev tables Date: Sun, 09 Sep 2018 16:43:29 -0400 Message-ID: <87tvmyflla.fsf@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536525729 5228 195.159.176.226 (9 Sep 2018 20:42:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2018 20:42:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 29923@debbugs.gnu.org To: Allen Li Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 09 22:42:04 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fz6Wx-0001H1-1o for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2018 22:42:03 +0200 Original-Received: from localhost ([::1]:48677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz6Z3-0003Vl-Gt for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2018 16:44:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz6Yx-0003Ve-3F for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 16:44:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fz6Ys-0007Tw-V0 for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 16:44:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46491) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fz6Yr-0007Sw-Ut for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 16:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fz6Yr-0004vd-LM for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 16:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Sep 2018 20:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29923-submit@debbugs.gnu.org id=B29923.153652581918906 (code B ref 29923); Sun, 09 Sep 2018 20:44:01 +0000 Original-Received: (at 29923) by debbugs.gnu.org; 9 Sep 2018 20:43:39 +0000 Original-Received: from localhost ([127.0.0.1]:51509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz6YV-0004us-6W for submit@debbugs.gnu.org; Sun, 09 Sep 2018 16:43:39 -0400 Original-Received: from mail-it0-f47.google.com ([209.85.214.47]:55747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz6YT-0004ud-6U for 29923@debbugs.gnu.org; Sun, 09 Sep 2018 16:43:37 -0400 Original-Received: by mail-it0-f47.google.com with SMTP id d10-v6so27028155itj.5 for <29923@debbugs.gnu.org>; Sun, 09 Sep 2018 13:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vat5QhtdMSPtB+gtud9fPe5LT0VCBOBQMRUEef/sqxs=; b=uIyhl7GoY98l2D3Qb4m3fP9OkdJTnsUTjA6WkPmFRBmu80Okvc1vpMtbwitZDyOcpe 3AYxS4QUPqXa1aIXC6w+TutYsDane46B/gXLuUtOkpfn3R9+X9w4tuRs3/9/bShEIZ0C 72xYhv7XZB7vu14zSyeZU02Ki5ZEBXc3+XyAf+Ogp/9RFeh4mSx84uzWhS0+LQNazMUt 2+FC8ZfRxnNbX752SwV5Dxy3FRAW8D5ANCRbbVJqn1QNJjzpOWU0EjJ/hB+fPTbayxkE ya4w0PytV2O1p9BYiJYfr9PFko6D4gxajTcuEHtMFOOuMWKwEUAE+0DB3HI2X8hiRz6D x7bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=vat5QhtdMSPtB+gtud9fPe5LT0VCBOBQMRUEef/sqxs=; b=m5sVI2evWNN4G4jiCIgs3H0fLvf0ERwiSnHnYoUfUhuphCXc6FN+IVNZUxSr6gj/5R NkP0YUQIrbfLxzw0MiRzlvEtiUqO4P/rHEGm6PwfgoeUFsrcDlhzrow15xPU1iibpJoC H4g+iAJ48G+JBvb+S9uvbo83U9ARQIGVAIt7hRWba9NUBqKgNTc5njg2vvYPS3xWapBm hc67lHPEe4e4YBoo7hoXd2HvSVywLR73Y2bi5nH0PM4vm0JmuS8i5kbVU7dzuCYt+a8P dY2NCIY2WQCdgYkbDiRY5d9KIqIc6jyZFB8NELhjxtFifraGvVtjhA6ptQGcjJmcSGNK vC8w== X-Gm-Message-State: APzg51Au8gUN5lScFrmorXgAJyO9QY0kIqi686Fy/lHPnXcr/RK0XOYV YOGDiJdK7raYe4h8tEpdf/jADp5B X-Google-Smtp-Source: ANB0VdZ/BivNHiVP9p8eddXCHAOIZyHfMJSPAabHxK5l2VSmXN6u2so9pHvAEH7zteR90Rny/X0sUw== X-Received: by 2002:a02:89fc:: with SMTP id e57-v6mr16103700jak.44.1536525811353; Sun, 09 Sep 2018 13:43:31 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id y18-v6sm7329305ita.29.2018.09.09.13.43.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Sep 2018 13:43:30 -0700 (PDT) In-Reply-To: (Allen Li's message of "Sun, 31 Dec 2017 20:36:24 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150170 Archived-At: Allen Li writes: > Subject: [PATCH] Skip writing empty abbrev tables > > Fixes bug#29923 > > * lisp/abbrev.el (write-abbrev-file): Pass SKIPEMPTY to > insert-abbrev-table-description. > (insert-abbrev-table-description): Add SKIPEMPTY optional > parameter. Skip inserting empty tables if SKIPEMPTY is non-nil. > (eval-when-compile (require 'cl-lib)) > (require 'obarray) > +(require 'seq) You didn't end up using seq, as far as I can tell. > -(defun insert-abbrev-table-description (name &optional readable) > +(defun insert-abbrev-table-description (name &optional readable skipempty) > "Insert before point a full description of abbrev table named NAME. > NAME is a symbol whose value is an abbrev table. > If optional 2nd arg READABLE is non-nil, a human-readable description > is inserted. Otherwise the description is an expression, > a call to `define-abbrev-table', which would > define the abbrev table NAME exactly as it is currently defined. > +If optional arg SKIPEMPTY is non-nil, skip insertion if table is empty. > > Abbrevs marked as \"system abbrevs\" are omitted." > - (mapatoms (lambda (sym) (if (symbol-value sym) (push sym symbols))) table) > + (mapatoms (lambda (sym) > + (if (and (symbol-value sym) (not (abbrev-get sym :system))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Looks like the second check you added implements the "Abbrevs marked as \"system abbrevs\" are omitted" part. I guess that actually fixes an additional bug? Worth mentioning in the commit message, I think.