unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Allen Li <vianchielfaura@gmail.com>
Cc: 29923@debbugs.gnu.org
Subject: bug#29923: [PATCH] Skip writing empty abbrev tables
Date: Sun, 09 Sep 2018 16:43:29 -0400	[thread overview]
Message-ID: <87tvmyflla.fsf@gmail.com> (raw)
In-Reply-To: <CAJr1M6cCeA4p3VyNgFG7bsniKxNSVTQpSna7G6+fMpfDTaZZAw@mail.gmail.com> (Allen Li's message of "Sun, 31 Dec 2017 20:36:24 -0800")

Allen Li <vianchielfaura@gmail.com> 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.





  reply	other threads:[~2018-09-09 20:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01  3:44 bug#29923: 25.3; write-abbrev-file inserts many empty tables Allen Li
2018-01-01  4:36 ` bug#29923: [PATCH] Skip writing empty abbrev tables Allen Li
2018-09-09 20:43   ` Noam Postavsky [this message]
2018-09-15  1:22     ` Allen Li
2018-09-18 22:53       ` Noam Postavsky
2018-09-19  2:55         ` Allen Li
2018-09-19  6:04           ` Andreas Röhler
2018-09-26  9:03             ` Allen Li
2018-09-19  6:44           ` Eli Zaretskii
2018-09-26  9:01             ` Allen Li
2018-09-29  7:29               ` Eli Zaretskii
2018-09-09  0:31 ` bug#29923: 25.3; write-abbrev-file inserts many empty tables Allen Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvmyflla.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=29923@debbugs.gnu.org \
    --cc=vianchielfaura@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).