all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: Robert Pluim <rpluim@gmail.com>
Cc: Uwe Brauer <oub@mat.ucm.es>, larsi@gnus.org, 45693@debbugs.gnu.org
Subject: bug#45693: [two word expansion works, but write-abbrev-file destroys it]
Date: Wed, 13 Jan 2021 17:25:42 +0100	[thread overview]
Message-ID: <877dogyfax.fsf@mat.ucm.es> (raw)
In-Reply-To: <87v9cam56e.fsf@mat.ucm.es>

[-- Attachment #1: Type: text/plain, Size: 2176 bytes --]

>>> "RP" == Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Wed, 13 Jan 2021 14:18:37 +0100, Uwe Brauer <oub@mat.ucm.es> said:
>>> Uwe Brauer <oub@mat.ucm.es> writes:

>>> Based on the code above, there is no list: youʼre unconditionally
>>> setting local-abbrev-table to a single table. You'd want something
>>> like:

>>> (define-minor-mode american-minor-mode 
>>> nil nil nil nil
>>> (setq local-abbrev-table
>>> (if american-minor-mode
>>> (list american-minor-mode-abbrev-table local-abbrev-table))))

Uwe> Ok I did not think that through, you were referring to 
Uwe> (setq local-abbrev-table (list my-abbrev-table fundamental-mode-abbrev-table))

Uwe> And the question is what comes first in that list, right?

Uwe> You asked whether to take the first or all elements of the list, would
Uwe> it be very resource consuming to take all?

> Not really, but people might find it confusing when 'add a local
> abbrev' results in modifying more than one abbrev table.

Ok, then the following question supposed I have executed 

(setq local-abbrev-table (list my-abbrev-table fundamental-mode-abbrev-table))

I want to add 

    1. A simple word abbrev as in nacion to nación

    2. I want to add a two word abbrev as in
       a que --> a qué


For the latter I would use registers and something like this 

(defun ediff-copy-to-register-A ()
  (interactive)
  (copy-to-register ?A (region-beginning) (region-end) nil)
  (message "diff is copied to register A"))

(defun ediff-copy-to-register-B ()
  (interactive)
  (copy-to-register ?B (region-beginning) (region-end) nil)
  (message "diff is copied to register B"))

(defun ediff-define-abbrev ()
  (interactive)
  (let ((name (get-register ?A)))
	(let ((expansion (get-register ?B)))
	  (set-text-properties 0 (length name) nil name)
	  (define-abbrev local-abbrev-table  name (downcase expansion))))
  (message "abbrev is added using register A and B."))

Now should the first abbrev land in the fundamental local abbrev list
and the two word abbrev in my-abbrev-table?

Or shall I create another minor mode that I associate with the my-abbrev-table?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

      reply	other threads:[~2021-01-13 16:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 15:54 bug#45693: 28.0.50; abbrev does not expand two words any more Uwe Brauer
2021-01-10 14:35 ` Lars Ingebrigtsen
2021-01-10 15:51   ` Uwe Brauer
2021-01-10 15:52     ` Lars Ingebrigtsen
2021-01-10 17:22       ` Uwe Brauer
2021-01-10 21:21       ` bug#45693: [two word expansion works, but write-abbrev-file destroys it] (was: bug#45693: 28.0.50; abbrev does not expand two words any more) Uwe Brauer
2021-01-11 10:49         ` bug#45693: [two word expansion works, but write-abbrev-file destroys it] Robert Pluim
2021-01-11 15:26           ` Eli Zaretskii
2021-01-11 15:50             ` Uwe Brauer
2021-01-11 17:38               ` Robert Pluim
2021-01-11 20:17                 ` Uwe Brauer
2021-01-11 20:38                   ` Robert Pluim
2021-01-11 20:48                     ` Uwe Brauer
2021-01-11 21:03                       ` Robert Pluim
2021-01-12  8:01                         ` Uwe Brauer
2021-01-12 10:34                           ` Robert Pluim
2021-01-12 13:26                             ` Uwe Brauer
2021-01-12 16:45                             ` Uwe Brauer
2021-01-12 17:59                               ` Robert Pluim
2021-01-13  7:37                                 ` Uwe Brauer
2021-01-13  9:16                                   ` Robert Pluim
2021-01-13  9:28                                     ` Uwe Brauer
2021-01-13  9:39                                       ` Robert Pluim
2021-01-13  9:51                                         ` Uwe Brauer
2021-01-13 10:09                                           ` Robert Pluim
2021-01-13 13:18                                             ` Uwe Brauer
2021-01-13 14:03                                               ` Robert Pluim
2021-01-13 16:25                                                 ` Uwe Brauer [this message]

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

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

  git send-email \
    --in-reply-to=877dogyfax.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=45693@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rpluim@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.