From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#36243: 26.2; defining inverse abbrevs include space Date: Mon, 17 Jun 2019 10:44:36 -0400 Message-ID: <85y320l19n.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="247635"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: 36243@debbugs.gnu.org To: Allen Li Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 17 17:52:29 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hctvo-0012KH-Lv for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Jun 2019 17:52:28 +0200 Original-Received: from localhost ([::1]:48738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hctvn-000506-Hh for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Jun 2019 11:52:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49772) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcssg-0006Ln-BB for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 10:45:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcssY-0007We-Hm for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 10:45:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcssX-0007WF-U0 for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 10:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcssX-0007as-Ni for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 10:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jun 2019 14:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36243 X-GNU-PR-Package: emacs Original-Received: via spool by 36243-submit@debbugs.gnu.org id=B36243.156078268329148 (code B ref 36243); Mon, 17 Jun 2019 14:45:01 +0000 Original-Received: (at 36243) by debbugs.gnu.org; 17 Jun 2019 14:44:43 +0000 Original-Received: from localhost ([127.0.0.1]:43130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcssF-0007a3-46 for submit@debbugs.gnu.org; Mon, 17 Jun 2019 10:44:43 -0400 Original-Received: from mail-io1-f50.google.com ([209.85.166.50]:39207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcssE-0007Zr-55 for 36243@debbugs.gnu.org; Mon, 17 Jun 2019 10:44:42 -0400 Original-Received: by mail-io1-f50.google.com with SMTP id r185so15768705iod.6 for <36243@debbugs.gnu.org>; Mon, 17 Jun 2019 07:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=CsVLEEhqBUit/QkKf3g1OYlTdoGwXUg9pPrOKWO6oyg=; b=LQiqwsQvVC3PJ89bgJI5wbN4tYw3rgJIUHV/bCbLinWj4TL3QPG+FdccH/FJZRcsfG wQlLuG7DftvDhFVbJCFKJ3S10omTkgsIa+Z8bw0BE4u8FD0J0zZxJZIakQfB084kq1fU uxB5tMqTCy7BWph5pJTBS9BpYofmSRDowASUa2RyheD0BCAPY3xgGeHXLADaoiHreyXr +Wn/ZdZjgYsuY/HZp3pdKZs8LkULtTUWdQvPjOp3ZgC9KKcMe/uln+c1dDdBBcYRnIwA vMzL38/l3FYmQE4ME514xejiHRJn3M/66jHehYW31BDzM346CiAeICZ2c45TRlPuq77s xjhA== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=CsVLEEhqBUit/QkKf3g1OYlTdoGwXUg9pPrOKWO6oyg=; b=lf4RN5FZINV7xOPXiWsaS4RMXjpf0t8yYOdUp8BSS5JRE3UeAtsbTUoh7ExqQ97Fqh E1v1i3DtavUuis4IlVXQzibJQescAT0DWfrXaGcTkzY1V8n+9jiiT7sTBvLsKqu8WvEG OG3+jXqtLIar/bUP7kA5mxN0nomxfxwl+qdj4tY+gnvjnsS8YegmFxRendWzrC1Linx1 oNlTHoSh8KXjMp/GCkkQrsVDYd7mJoVnKOsjknitsaAPLaenDEPGgH5FVaGmVvn+voVJ v8O69KWnQIrEi4a6GMvCJXmWGfsKprUlCrbf5GNWSu0T5AB7MwLWcQSW1MD586L7mJUp K8QA== X-Gm-Message-State: APjAAAUeZnK0tWxsqhvVLEK/i86NBIBtYh11BBUoej0UejIPNB673kON UYZm1xVxImj05w3b9liMsE8aU2e+ X-Google-Smtp-Source: APXvYqwqrOtG34ni2KpmX2ugXipNFikJ99qcfiq5jb0/0ttY3kiFgi5AatpYcZZdogac1WBc32bXNw== X-Received: by 2002:a5d:904e:: with SMTP id v14mr5460072ioq.61.1560782676300; Mon, 17 Jun 2019 07:44:36 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id f26sm9698547iob.4.2019.06.17.07.44.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jun 2019 07:44:35 -0700 (PDT) In-Reply-To: (Allen Li's message of "Sun, 16 Jun 2019 10:35:09 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160735 Archived-At: Allen Li writes: > Defining an inverse abbrev in a buffer like so (@ is point): > > some text foo @ > > C-x a i l find outer otter RET > > defines an abbrev "foo " -> "find outer otter" > * lisp/abbrev.el (inverse-add-abbrev): Skip trailing nonword > characters when defining abbrev. > (defun inverse-add-abbrev (table type arg) > (let (name exp start end) > (save-excursion > - (forward-word (1+ (- arg))) > + (if (<= arg 0) > + (forward-word (1+ (- arg))) > + (forward-word (- arg)) > + (forward-word)) > (setq end (point)) > (backward-word 1) This seems like a somewhat obfuscated way of skipping nonword characters. How about using skip-syntax-backward instead?