unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: Richard Stallman <rms@gnu.org>
Cc: oub@mat.ucm.es, Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: [adding abbrev using two-word-expansions] (was: did the abbrev mechanism ever expand «two words» to «two different words».)
Date: Sat, 09 Jan 2021 09:11:49 +0100	[thread overview]
Message-ID: <8735zabkca.fsf_-_@mat.ucm.es> (raw)
In-Reply-To: E1ky7rw-0005du-84@fencepost.gnu.org

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

>>> "RS" == Richard Stallman <rms@gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]

>> This mean a word-separator character cannot be part of an abbrev.

> I am pretty sure that was always the case.

Well in my .abbrev_defs files I have entries like 


    ("en cambio" "a cambio" nil :count 34)

Which seems to indicate that it worked at same stage. Maybe I used code
similar of what Robert suggested but deleted it some time ago
(documentation is important).


I want to add a remark, concerning adding new abbrev.

I have now  a modification of my code



(define-minor-mode castellano-minor-mode
    nil nil nil nil
    (setq local-abbrev-table
          (if castellano-minor-mode
              (list my-abbrev-table castellano-minor-mode-abbrev-table)))
    (message "Added the local `my-abbrev-table' to the `castellano-minor-abbrev-table'"))


I used to define two words abbrev like this


(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."))

That however does not work any more instead gives an error of the form 


Any idea what to do, now?



Debugger entered--Lisp error: (wrong-type-argument vectorp ([de\ usar 0
  0 en\ la\ mayor\ brevedad\ posible de\ la\ entrega 0 en\ la\
  siguiente\ manera los\ prácticas\ 0 hola\ salva a\ final 0 0 0 0 los\
  funciones 0 0 0 0 0 0 hola\ gabriel a\ penas de\ comprometerme\ de\
  darte 0 0 0 0 hola\ raúl posibilidad\ hacerlo 0 0 0 hola\ alicia 0 0
  los\ siguientes\ cosas 0 0 0 los\ siguientes\ posibilidades les\
  ruego\ aclararme en\ internet los\ manos 0 0 0 0 lamento\ que\ me\
  has\ encontrado ...] [áfrica vacio votacion utlidad volutarios útlies
  vistemos vicino terero vacuana áfin vostros util vostotros vistido
  veronica varibilidad vienieras varidad traquilidad veniste tristesa
  verifca venieron victimas volvia traduccir volutaria vecorial
  virtualizar àrea viveis supervision trival tutoria zanhoria vivia
  vivian vivisite vuitre tradicion volutario varon zero volvere tuvé
  vistitado virnes ví vendria ...])) intern-soft("" ([de\ usar 0 0 en\
  la\ mayor\ brevedad\ posible de\ la\ entrega 0 en\ la\ siguiente\
  manera los\ prácticas\ 0 hola\ salva a\ final 0 0 0 0 los\ funciones 0
  0 0 0 0 0 hola\ gabriel a\ penas de\ comprometerme\ de\ darte 0 0 0 0
  hola\ raúl posibilidad\ hacerlo 0 0 0 hola\ alicia 0 0 los\
  siguientes\ cosas 0 0 0 los\ siguientes\ posibilidades les\ ruego\
  aclararme en\ internet los\ manos 0 0 0 0 lamento\ que\ me\ has\
  encontrado ...] [áfrica vacio votacion utlidad volutarios útlies
  vistemos vicino terero vacuana áfin vostros util vostotros vistido
  veronica varibilidad vienieras varidad traquilidad veniste tristesa
  verifca venieron victimas volvia traduccir volutaria vecorial
  virtualizar àrea viveis supervision trival tutoria zanhoria vivia
  vivian vivisite vuitre tradicion volutario varon zero volvere tuvé
  vistitado virnes ví vendria ...])) obarray-get(([de\ usar 0 0 en\ la\
  mayor\ brevedad\ posible de\ la\ entrega 0 en\ la\ siguiente\ manera
  los\ prácticas\ 0 hola\ salva a\ final 0 0 0 0 los\ funciones 0 0 0 0
  0 0 hola\ gabriel a\ penas de\ comprometerme\ de\ darte 0 0 0 0 hola\
  raúl posibilidad\ hacerlo 0 0 0 hola\ alicia 0 0 los\ siguientes\
  cosas 0 0 0 los\ siguientes\ posibilidades les\ ruego\ aclararme en\
  internet los\ manos 0 0 0 0 lamento\ que\ me\ has\ encontrado ...]
  [áfrica vacio votacion utlidad volutarios útlies vistemos vicino
  terero vacuana áfin vostros util vostotros vistido veronica
  varibilidad vienieras varidad traquilidad veniste tristesa verifca
  venieron victimas volvia traduccir volutaria vecorial virtualizar àrea
  viveis supervision trival tutoria zanhoria vivia vivian vivisite
  vuitre tradicion volutario varon zero volvere tuvé vistitado virnes ví
  vendria ...]) "") abbrev-table-get(([de\ usar 0 0 en\ la\ mayor\
  brevedad\ posible de\ la\ entrega 0 en\ la\ siguiente\ manera los\
  prácticas\ 0 hola\ salva a\ final 0 0 0 0 los\ funciones 0 0 0 0 0 0
  hola\ gabriel a\ penas de\ comprometerme\ de\ darte 0 0 0 0 hola\ raúl
  posibilidad\ hacerlo 0 0 0 hola\ alicia 0 0 los\ siguientes\ cosas 0 0
  0 los\ siguientes\ posibilidades les\ ruego\ aclararme en\ internet
  los\ manos 0 0 0 0 lamento\ que\ me\ has\ encontrado ...] [áfrica
  vacio votacion utlidad volutarios útlies vistemos vicino terero
  vacuana áfin vostros util vostotros vistido veronica varibilidad
  vienieras varidad traquilidad veniste tristesa verifca venieron
  victimas volvia traduccir volutaria vecorial virtualizar àrea viveis
  supervision trival tutoria zanhoria vivia vivian vivisite vuitre
  tradicion volutario varon zero volvere tuvé vistitado virnes ví
  vendria ...]) :abbrev-table-modiff) define-abbrev(([de\ usar 0 0 en\
  la\ mayor\ brevedad\ posible de\ la\ entrega 0 en\ la\ siguiente\
  manera los\ prácticas\ 0 hola\ salva a\ final 0 0 0 0 los\ funciones 0
  0 0 0 0 0 hola\ gabriel a\ penas de\ comprometerme\ de\ darte 0 0 0 0
  hola\ raúl posibilidad\ hacerlo 0 0 0 hola\ alicia 0 0 los\
  siguientes\ cosas 0 0 0 los\ siguientes\ posibilidades les\ ruego\
  aclararme en\ internet los\ manos 0 0 0 0 lamento\ que\ me\ has\
  encontrado ...] [áfrica vacio votacion utlidad volutarios útlies
  vistemos vicino terero vacuana áfin vostros util vostotros vistido
  veronica varibilidad vienieras varidad traquilidad veniste tristesa
  verifca venieron victimas volvia traduccir volutaria vecorial
  virtualizar àrea viveis supervision trival tutoria zanhoria vivia
  vivian vivisite vuitre tradicion volutario varon zero volvere tuvé
  vistitado virnes ví vendria ...]) "cuando antes" "cuanto antes")
  ediff-define-abbrev() funcall-interactively(ediff-define-abbrev)
  call-interactively(ediff-define-abbrev nil nil)
  command-execute(ediff-define-abbrev)

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

      reply	other threads:[~2021-01-09  8:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 20:10 did the abbrev mechanism ever expand «two words» to «two different words» Uwe Brauer
2021-01-07 20:15 ` Eli Zaretskii
2021-01-07 20:29   ` Uwe Brauer
2021-01-07 20:36   ` Stefan Monnier
2021-01-07 20:40     ` Eli Zaretskii
2021-01-08  8:20     ` Uwe Brauer
2021-01-08 10:55       ` Robert Pluim
2021-01-08 13:28         ` Uwe Brauer
2021-01-08 14:05           ` Robert Pluim
2021-01-08 15:23             ` Uwe Brauer
2021-01-08 18:05               ` Robert Pluim
2021-01-08 18:48                 ` Uwe Brauer
2021-01-08 20:29                 ` Stefan Monnier
2021-01-08 21:06                   ` Uwe Brauer
2021-01-09 12:14                     ` Eric S Fraga
2021-01-09 13:39                       ` Uwe Brauer
2021-01-09 13:42                 ` [BUG? write-abbrev-file destroys this construction] (was: did the abbrev mechanism ever expand «two words» to «two different words».) Uwe Brauer
2021-01-09  6:37   ` did the abbrev mechanism ever expand «two words» to «two different words» Richard Stallman
2021-01-09  8:11     ` 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

  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=8735zabkca.fsf_-_@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /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).