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.devel Subject: Re: did the abbrev mechanism ever expand =?utf-8?B?wqt0d28gd29y?= =?utf-8?B?ZHPCuw==?= to =?utf-8?Q?=C2=ABtwo?= different =?utf-8?Q?words=C2=BB=2E?= Date: Fri, 08 Jan 2021 19:05:11 +0100 Message-ID: <87eeivz4mg.fsf@gmail.com> References: <871rewmrsh.fsf@mat.ucm.es> <83zh1kjyg4.fsf@gnu.org> <87ft3blu0u.fsf@mat.ucm.es> <87v9c7zoin.fsf@gmail.com> <878s93h81y.fsf@mat.ucm.es> <87r1mvzfpe.fsf@gmail.com> <87h7nro3ju.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="7126"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 08 19:09:27 2021 Return-path: Envelope-to: ged-emacs-devel@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 1kxwCU-0001jq-OS for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jan 2021 19:09:26 +0100 Original-Received: from localhost ([::1]:53320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxwCT-0004uT-OG for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jan 2021 13:09:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxw8W-0001YX-2S for emacs-devel@gnu.org; Fri, 08 Jan 2021 13:05:20 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:40562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxw8R-0001A5-Up for emacs-devel@gnu.org; Fri, 08 Jan 2021 13:05:19 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id r4so9148817wmh.5 for ; Fri, 08 Jan 2021 10:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=F9yAZ9TAdLW90dwBGoagLwKvjssdzE0vNpvQR7jMlTg=; b=D7O0lqWzrbaffyrAve9kTfXohUrcD9qSesSqav/DPFP7V3hk+bX9WJVi5wwxIDSfRc x0/fIgYMuk8Qo+TulSYH7fcUfcsJvBmyuSHC1N0ySBjLNVtwE5g/BcH7qpQ7B9HkNIfO l4OoAEZzBR3R5vE148GZgn2M0/GDM4vsv2ThUdBdzQjkKCBYbfEKR1HLlO2EQ+q/uB7b XlPLeBmKVhVc5Og0pplpUnuflQILRjm5z8EZocyAge+mbaoEXmFFUeS5Ybs6PuL1c5Ve aRzcL2R7KVb8gZ0VeXJTrh4z3oee3Xgez0m6FSdDAhdaiSGDGfFD/QUVSVgk3mJUU7dI lmfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=F9yAZ9TAdLW90dwBGoagLwKvjssdzE0vNpvQR7jMlTg=; b=QLaEnXxVL0P7Ebg+KdnSJ4UX31ncMhdGcDSLAkn/lGVDkCzfKcD83hCZ8C78IqFqS0 Zhtrj44EQ84Gpa4iPSiPpOxL4UpFM7aNPNOMcvwXzdNBllQ67sHoykZd/T1W3rI6UmMn Tet03TYZXoxoApHfBvQaSzdct++W+xe6o7za2WJDoo13RTg2cjGoFGO4h6vpL5s/6UPd nJocvXLGdP108Dvj7tYY3Q0+lP45ZDim2LnsNUpXRpx8BCPB7H0ICuLOQ8FRe28gnBr+ UmiGN88mrQlJZ8JEfBXc78+hMcwUX54AXPvybhz944pTJoKQGLzUEx7yPmyXHNYwnB2/ DRxw== X-Gm-Message-State: AOAM533t978WPQldqy+UzLCDtiGcuzV4O/WrDeHMYyloYiWB9whf3ViB n/lsoDPibJkcJm4duKMf6agnuYHYY0w= X-Google-Smtp-Source: ABdhPJyQiSOMSXD5W4cGs2Oka4+qN0TBkQ41Pt+gszgjMWCtdpax2QTa0G5vFoP46v9lxxb7f5li2w== X-Received: by 2002:a7b:c849:: with SMTP id c9mr4086276wml.11.1610129113495; Fri, 08 Jan 2021 10:05:13 -0800 (PST) Original-Received: from rltb ([2a01:e34:ecfc:a861:69b6:6aaf:dbd3:8964]) by smtp.gmail.com with ESMTPSA id o8sm14221832wrm.17.2021.01.08.10.05.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 10:05:12 -0800 (PST) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <87h7nro3ju.fsf@mat.ucm.es> (Uwe Brauer's message of "Fri, 08 Jan 2021 16:23:49 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=rpluim@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:262766 Archived-At: Uwe Brauer writes: > Right, thanks, however good and bad news. > > > I am using=20 > > (define-abbrev-table 'fundamental-mode-abbrev-table > '( > ("a que" "a qu=C3=A9" nil :count 0) > ("asi" "as=C3=AD" nil :count 0)) > "Uwe's table" > :regexp "\\(\\w+ \\w+\\)") > > > 1. It works in the sense that "a que" is expanded to "a qu=C3=A9" > > 2. But now asi is *not* expanded to as=C3=AD > > The reasons seems to me that what you did is globally for the whole > table, while I hoped it could be done locally for each entry. > That=CA=BCs not the way abbrev tables work: the regexp answers the question "which characters before point do I use to lookup abbrevs in this table?". That can't be both two words separated by a space and a single word at the same time, ie using "\\(\\w+ \\w+\\)\\|\\(w+\\) will fail, since that will match the 'two word' version if there=CA=BCs a space on the line, so in order to get what you want you need two abbrev tables: (define-abbrev-table 'fundamental-mode-abbrev-table '( ("asi" "as=C3=AD" nil :count 0))) (define-abbrev-table 'my-abbrev-table '( ("a que" "a qu=C3=A9" nil :count 0)) "Uwe's table" :regexp "\\(\\w+ \\w+\\)") (setq local-abbrev-table (list my-abbrev-table fundamental-mode-abbrev-= table)) (there=CA=BCs a ':parents' property you can set on an abbrev table to achie= ve the same thing, in theory, but I don=CA=BCt know how that interacts with ':regexp') Robert