From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20705: Emacs segfaults when typing "(yas-expand" after M-: in yas-minor-mode Date: Sat, 06 Jun 2015 16:34:35 +0300 Message-ID: <83vbf1m044.fsf@gnu.org> References: <556B72BB.4080508@live.com> <874mmq583h.fsf@gnu.org> <83twuoret9.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1433597724 14090 80.91.229.3 (6 Jun 2015 13:35:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Jun 2015 13:35:24 +0000 (UTC) Cc: bojohan@gnu.org, 20705@debbugs.gnu.org To: clement.pitclaudel@live.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 06 15:35:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z1EFj-00005n-Td for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jun 2015 15:35:12 +0200 Original-Received: from localhost ([::1]:51648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1EFj-0007jw-2S for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jun 2015 09:35:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1EFg-0007hm-0W for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2015 09:35:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1EFc-00031H-K7 for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2015 09:35:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1EFc-00030w-H1 for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2015 09:35:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z1EFb-0006Ee-Ol for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2015 09:35:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jun 2015 13:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20705-submit@debbugs.gnu.org id=B20705.143359768823942 (code B ref 20705); Sat, 06 Jun 2015 13:35:03 +0000 Original-Received: (at 20705) by debbugs.gnu.org; 6 Jun 2015 13:34:48 +0000 Original-Received: from localhost ([127.0.0.1]:42671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z1EFL-0006E4-56 for submit@debbugs.gnu.org; Sat, 06 Jun 2015 09:34:47 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:54373) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z1EFH-0006Do-RL for 20705@debbugs.gnu.org; Sat, 06 Jun 2015 09:34:44 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NPI00800YF0TE00@a-mtaout22.012.net.il> for 20705@debbugs.gnu.org; Sat, 06 Jun 2015 16:34:36 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NPI0083NZ1OFU90@a-mtaout22.012.net.il>; Sat, 06 Jun 2015 16:34:36 +0300 (IDT) In-reply-to: <83twuoret9.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103660 Archived-At: Ping! Clément, any word on this? > Date: Wed, 03 Jun 2015 18:29:06 +0300 > From: Eli Zaretskii > Cc: clement.pitclaudel@live.com, 20705@debbugs.gnu.org > > > From: Johan Bockgård > > Cc: 20705@debbugs.gnu.org, Eli Zaretskii > > Date: Tue, 02 Jun 2015 19:32:50 +0200 > > > > The code looks like this: > > > > (defun yas--keybinding-beyond-yasnippet () > > "Get current keys's binding as if YASsnippet didn't exist." > > (let* ((yas-minor-mode nil) > > (yas--direct-keymaps nil) > > (keys (this-single-command-keys))) > > (or (key-binding keys t) > > (key-binding (yas--fallback-translate-input keys) t)))) > > > > Apparently this-single-command-keys returns [] (empty vector) when run > > from a timer. This in turn makes key-binding crash. > > Thanks for the analysis. > > Clément, can you try the patch below? > > diff --git a/src/keymap.c b/src/keymap.c > index 8f4ac0d..b69b409 100644 > --- a/src/keymap.c > +++ b/src/keymap.c > @@ -1652,10 +1652,14 @@ Returns nil if COMMAND is not remapped (or not a symbol). > > if (NILP (position) && VECTORP (key)) > { > - Lisp_Object event > - /* mouse events may have a symbolic prefix indicating the > - scrollbar or mode line */ > - = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0); > + Lisp_Object event; > + > + if (ASIZE (key) == 0) > + return Qnil; > + > + /* mouse events may have a symbolic prefix indicating the > + scrollbar or mode line */ > + event = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0); > > /* We are not interested in locations without event data */ > > > > >