Subject: [two word expansion works, but write-abbrev-file destroys it] (was: bug#45693: 28.0.50; abbrev does not expand two words any more)

From: Uwe Brauer <[email-masked]>
Date: Sun, 10 Jan 2021 22:21:11 +0100

>>> "LI" == Lars Ingebrigtsen <[email-masked]> writes:

> Uwe Brauer <[email-masked]> writes:
>> I am trying to set up a recipe to reproduce that behavior. If I do that,
>> should I open a new bug or just post it here?

> Just post it here.

The solution posted by Robert Pluim allows a two word expansion but will
be destroyed by write-abbrev-file

Step to reproduce the issue.

    1. Start emacs -Q (using master commit  "84ec57fe06e187f41a3546131d5dae3b185c3511")

    2. Create an abbrev file (see attachment) called .abbrev-doble_defs
       that contain 
       (define-abbrev-table 'fundamental-mode-abbrev-table
      '(
        ("asi" "así" nil :count 0)))

        (define-abbrev-table 'my-abbrev-table
      '(
        ("a que" "a qué" nil :count 0))
      "Uwe's table"
      :regexp "\\(\\w+ \\w+\\)")

    3. Load files with the following lines
       (setq abbrev-file-name "~/ALLES/HGs/init_files/Abbrev-Doble/.abbrev-new_defs")
       (read-abbrev-file "~/ALLES/HGs/init_files/Abbrev-Doble/.abbrev-double_defs")
       (setq-default abbrev-mode t)
       Or any other path that is convenient.

    4. Open new file in fundamental mode, say called new
       execute in that file
       (setq local-abbrev-table (list my-abbrev-table fundamental-mode-abbrev-table))

       Then asi--> así
       and 
       a que--> a quë

    5. (write-abbrev-file "~/ALLES/HGs/init_files/Abbrev-Doble/.abbrev-new_defs")

The part 
        (define-abbrev-table 'my-abbrev-table
      '(
        ("a que" "a qué" nil :count 0))
      "Uwe's table"
      :regexp "\\(\\w+ \\w+\\)")

Is gone!