From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#45693: [two word expansion works, but write-abbrev-file destroys it] Date: Wed, 13 Jan 2021 10:16:11 +0100 Message-ID: <87o8htqjs4.fsf@gmail.com> References: <87v9cam56e.fsf@mat.ucm.es> <87lfd0svvp.fsf@gnus.org> <87czycpz71.fsf@mat.ucm.es> <87wnwkiybo.fsf@gnus.org> <87eeis1oag.fsf_-_@mat.ucm.es> <87wnwjd9yy.fsf@gmail.com> <83czybfq9q.fsf@gnu.org> <875z4379ri.fsf@mat.ucm.es> <87mtxf4bm6.fsf@gmail.com> <87pn2bxm7x.fsf@mat.ucm.es> <87h7nn2oqp.fsf@gmail.com> <87h7nnxkrm.fsf@mat.ucm.es> <8735z72nk3.fsf@gmail.com> <87sg767fdx.fsf@mat.ucm.es> <87bldu1m0m.fsf@gmail.com> <87h7nmumrq.fsf@mat.ucm.es> <87y2gyxchx.fsf@gmail.com> <87h7nl2spr.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 45693@debbugs.gnu.org To: Uwe Brauer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 13 10:17:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzcH7-0009kp-Ih for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Jan 2021 10:17:09 +0100 Original-Received: from localhost ([::1]:39284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzcH6-0001D6-8q for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Jan 2021 04:17:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzcH0-0001Ca-Lg for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 04:17:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzcH0-0004bx-Ee for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 04:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kzcH0-0006T1-BE for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 04:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jan 2021 09:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45693 X-GNU-PR-Package: emacs Original-Received: via spool by 45693-submit@debbugs.gnu.org id=B45693.161052938224788 (code B ref 45693); Wed, 13 Jan 2021 09:17:02 +0000 Original-Received: (at 45693) by debbugs.gnu.org; 13 Jan 2021 09:16:22 +0000 Original-Received: from localhost ([127.0.0.1]:34245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzcGM-0006Rk-Ah for submit@debbugs.gnu.org; Wed, 13 Jan 2021 04:16:22 -0500 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:44092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzcGJ-0006RT-K7 for 45693@debbugs.gnu.org; Wed, 13 Jan 2021 04:16:21 -0500 Original-Received: by mail-wr1-f50.google.com with SMTP id w5so1252559wrm.11 for <45693@debbugs.gnu.org>; Wed, 13 Jan 2021 01:16:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:mail-copies-to :gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=STZ56trDUZO29BzI1vuTjTG/DfFf3qFVrQVF1q9uxGI=; b=oI/osEVhUMxHwHk9nhmU/LnJDxjgJWtJLX2K3FaEfuJjwoItEH9wpE3zNSMrvMp5/5 JLqNZjxyqA9CHN6VrXJZXYhc3OubWYY55/1chT+Ei7kA3frFdMbdnVsHTybBrSVclD36 ZUUFOpm/wFKdXIxqe0xao6Bpl87d85epTlIQlnYjpWmk6bYnrXXpJ2FYiTCBKz3rZ9Al C74nyJPjieGzMDWxCXdCvKNgz4H0oMXb+fwe1PnPOlSILtwcXRTWvrmBvN7H7h2pmrot +mH+LUmXAtKQEPTPhJO2R+urCv9PCz8nlNuB49TAUMl2v9sXIsxBOzBv5tlH+JFH86JE cLFw== 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:in-reply-to:references :mail-copies-to:gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=STZ56trDUZO29BzI1vuTjTG/DfFf3qFVrQVF1q9uxGI=; b=KbV9OeNG+pG9aKSL3OhxNzyizqTCaE5gV5Tjxcv7XemhnVs2b7j7tJr5gR7YzYRS3R YgzW6Ffc+ou5BYIMv4filQjtTe8mrIfIX5+p6/gAX+uDhnabwVbNXbRJqbM8OKWVb1C5 vWTTH50vt2PDRow/Qg3UY2z3BBSeuW7tKUchjzoKxM2rcy0+iBbFKUD+nk/hkauiHhJe 9FIV/Bg4pFLfXp6MoK7YWiiXGrg331dY97O4C+Xoybvxcd2EqRSFgsNJ1rOe36dUMxyG t29GEUBr/n+yM9obo+paPX1Qz8ladk2HMw0++oczqWn7UI2ge4BP8EOo7YK5pb4b0t+b GjlA== X-Gm-Message-State: AOAM533rTzeeWsFfljADDOtfXTkR9fZDDjQ9mBtidJvyUrdLFwJhEB+s ZD8ttoKJX9O2Z+/bJ0wXfyEW0n0zXcc= X-Google-Smtp-Source: ABdhPJw0oYTLTGxPdAAdwSX+akcrYLOv/Pye5A8Tst8TPHcV0IoRkVP9jBZHSQTez3lP5r97kFDiRA== X-Received: by 2002:adf:f74e:: with SMTP id z14mr1576073wrp.146.1610529373393; Wed, 13 Jan 2021 01:16:13 -0800 (PST) Original-Received: from rltb ([2a01:e34:ecfc:a861:69b6:6aaf:dbd3:8964]) by smtp.gmail.com with ESMTPSA id o124sm2030153wmb.5.2021.01.13.01.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 01:16:12 -0800 (PST) In-Reply-To: <87h7nl2spr.fsf@mat.ucm.es> (Uwe Brauer's message of "Wed, 13 Jan 2021 08:37:04 +0100") Mail-Copies-To: never Gmane-Reply-To-List: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197881 Archived-At: Uwe Brauer writes: > Steps to reproduce (I attach the files for convenience) > > 1. Start emacs -Q > > 2. Load the patched abbrev.el provided by Robert > > 3. Load or execute the following > > a. (setq abbrev-file-name "~/Abbrev-Doble/.abbrev-new_defs") ; or > any other path > > b. (read-abbrev-file "~/Abbrev-Doble/.abbrev-double_defs") ; file = attached > > c. (setq-default abbrev-mode t) > > 4. Open a file in fundamental mode, called say new. > > 5. Execute (setq local-abbrev-table (list my-abbrev-table fundamental= -mode-abbrev-table)) > > 6. Check via edit-abbrevs (note: the properties are not displayed by > this function! Should that be fixed also? > > 7. Check whether the doble expansion works: > > a. Type a que > > b. Indeed it works > > 8. Add a local (inverse) abbrev: > > a. Type nacion > > b. Put the cursor at the end of the word > > c. Type C-x a i l > > d. Type naci=C3=B3n > > e. The error pops up > obarray-get: Wrong type argument: vectorp, ([## 0 0 0 0 0 0 0 0= 0 ...] [## 0 0 0 0 0 0 0 0 0 ...]) > > 9. Repeat step 7 but use C-x a i g > > a. No error! Understandable because the global abbrev table does > not have properties. > > Did I explain that enough? > Yes, perfect, thanks. inverse-add-mode-abbrev tries to add the abbrev to 'local-abbrev-table', which is a list here: Debugger entered--Lisp error: (wrong-type-argument vectorp ([## 0 0 0 0 0 0= 0 0 0 0 0 0 0 0 0 0 0 a\ que 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0= 0 0 0 0 0 0 0 0 ...] [## 0 0 0 0 0 0 asi 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...])) intern-soft("" ([## 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a\ que 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] [## 0 0 0 0 0 0 asi = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0= 0 0 0 0 ...])) obarray-get(([## 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a\ que 0 0 0 0 0 0 0 0= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] [## 0 0 0 0 0 0 asi 0 0= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = 0 0 0 ...]) "") abbrev-table-get(([## 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a\ que 0 0 0 0 0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] [## 0 0 0 0 0 0 as= i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0= 0 0 0 0 0 ...]) :abbrev-table-modiff) define-abbrev(([## 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a\ que 0 0 0 0 0 0 0= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] [## 0 0 0 0 0 0 asi 0= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = 0 0 0 0 ...]) "nacion" "the nation") inverse-add-abbrev(([## 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a\ que 0 0 0 0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] [## 0 0 0 0 0 0 = asi 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0= 0 0 0 0 0 0 ...]) "Mode" 1) inverse-add-mode-abbrev(1) funcall-interactively(inverse-add-mode-abbrev 1) call-interactively(inverse-add-mode-abbrev nil nil) command-execute(inverse-add-mode-abbrev) So it=CA=BCs explicitly documented that 'local-abbrev-table' can be a *list* of abbrev tables, but lots of the abbrev code assumes that it gets passed a single table. It=CA=BCs easy enough to check for 'consp' in such cases, but then which of tables in that list should we add the abbrev to? The first one? All of them? I=CA=BCm leaning towards "first, and document that you should put the most specific table at the front of the list of local abbrev tables", but I=CA=BCd welcome opinions from others. Robert