From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kf Newsgroups: gmane.emacs.help Subject: Re: Abbrev for shorthand purposes Date: Sat, 6 Aug 2022 20:08:06 -0400 Message-ID: References: Reply-To: gebser@mousecar.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27770"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 07 02:08:56 2022 Return-path: Envelope-to: geh-help-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 1oKTqh-000736-J7 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 07 Aug 2022 02:08:55 +0200 Original-Received: from localhost ([::1]:43974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKTqf-0003WZ-TY for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 20:08:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKTpz-0003WP-QM for help-gnu-emacs@gnu.org; Sat, 06 Aug 2022 20:08:11 -0400 Original-Received: from mout.perfora.net ([74.208.4.196]:55305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKTpy-00023J-8b for help-gnu-emacs@gnu.org; Sat, 06 Aug 2022 20:08:11 -0400 Original-Received: from [192.168.0.21] ([76.73.230.143]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MA82J-1o9FYU3HWz-00BPSh for ; Sun, 07 Aug 2022 02:08:07 +0200 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:y5E2bNyKzStXRPxcWFt2xPVpkKQDEVbO1F6vE5IBKrM4oSXhdiK 4msvosehdbFMs3o8FR0xH3LR7GZlq2bUsWZWnHDlwmyx3YAyBQRdbZaHSObfqlcJZ1nlE2d UEr6GVWUROQGAT5dLRyuf2/3T8QIeJWScLZ0YTcG/+NK0c8QVRx4h6lJ+dc+Mi1Q60qpmLt YPROPf4nbDlx5ZiDBhGFg== X-UI-Out-Filterresults: notjunk:1;V03:K0:dFXut/89QX0=:w7fa41whrDMhxDMe7JlDSA rKvx27VZMRzWoYkts/QTPWah6nTX5GMI7T87Ei2WBWx+V9nzpygbLxVTZkZ6tydZycDJlroXc eyVvKPPFiP92mfv4W8+V69tPDEDID4E3g0PBv+u/kIOqg2PkHeLzdRX6q18KA7TZBF614DXY3 zYXQv9L4m7EtjoT2m1mZiyGfOVjfT7WdIXYB5Y5DByHDIQ94JHYpryNBCDRL1b6s+pXRdpnw8 s26lUfLBPF+5kIbU4B+8+FHPPm7pzW4Z+DiHvKL/o34pTk8c6IoKc93Jct9TGPLw7mkyjSYwf JHrHE73HXTyUFpmqwTv2yXD4eG7Q08R98GS54Ojy+6wb1cr79Vb8a2rEUVuSyNbDX3I2fcxk+ Nwt6KLeuypPz7gdUtJPX8ZgrBSi6XbaWyKLyUntcEkCYylmempmrNKXhO9Auf4KGxDLEr90pw m/CTs9Wby3RZyjEKCo2u2b/GHXehhRXWrG5wa2FdhV/arKqmjQQWYWwKVQDVG9opTvcyqVo6l uBtz8baLqexXMmjz8Qr/qMWULkGLqq9sIVkELF+5apiLWlCIsh+a8/fOPfNEoKf5Da0cftlpW Pb0qjaCM0kk85myyZcS4Ga5SmugjIWybAbnUa+nAfyeJaS3VPVHZJHqsBqt1NvyPvkI8fXGvE v5GqDN5jzEKe+/65hvr4tk4xYTlg8+vlD2ACLCpkdIL/isiuo/H8Hy7uoU7U/EKjEjggyoLuh LwuqkmUWkIBfZ7gx7j7Iu6nvuGoghBsq5NwuyA== Received-SPF: none client-ip=74.208.4.196; envelope-from=gebser@mousecar.com; helo=mout.perfora.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138755 Archived-At: On 8/5/22 1:31 AM, uzibalqa via Users list for the GNU Emacs text editor wrote: > Have been trying to use abbrev for shorthand purposes. I can go from text to shorthand but not the other way round, because > of the punctuation. Is there something I can do? Use of abbrev-mode also fails in situations when different the same abbreviation > could expand to more than one word. > > ("wayward" "wa/") ("westward" "W/") > ("adjustment" "ajs-") ("armament" "am-") > ("basement" "bs-") ("casement" "ks-") > ("enactment" "nak-") ("enjoyment" "njy-") > ("enlargement" "nlj-") ("entertainment" "Ntn-") ("measurement" "mz/-") ("movement" "mv-") > ("recommend" "rk-") ("require" "rqi") ("separate" "sp;") > ("silk" "slk") ("struck" "Sk") ("subject" "sj") > Since no one else has yet to reply, I'll jump in with my non-expertise. I see at least two problems: (1) the order of your terms is reversed, e.g., '("wayward" "wa/")' should be '("wa/" "wayward")' and (2) those term pairs should be one to a line, at least that's how emacs has always constructed my ~/.abbrevs file. In addition, there are some other terms to each line. Here's a small part of my ~/.abbrevs file: .... (define-abbrev-table 'global-abbrev-table '( ("aann" "Just got an annoyance phone call." nil :count 14) ("abck" "back" nil :count 3) ("abiltiy" "ability" nil :count 2) ("abotu" "about" nil :count 41) ("abt" "about" nil :count 1) ("abuot" "about" nil :count 7) .... The first line defines a table of abbrevs for all modes. My ~/.abbrevs contains multiple tables, each for a different mode. Note that there are 5 elements to each line. Unfortunately, I understand only the first two, but that much has worked for me for a long time. hth.