From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 6d11f6e: Allow to invoke original M-TAB binding in 'flyspell-prog-mode' Date: Thu, 31 Dec 2015 20:59:19 +0200 Message-ID: <8360zebg1k.fsf@gnu.org> References: <20151231154421.21882.79337@vcs.savannah.gnu.org> <83a8oqbkbp.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1451588338 30473 80.91.229.3 (31 Dec 2015 18:58:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Dec 2015 18:58:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 31 19:58:57 2015 Return-path: Envelope-to: ged-emacs-devel@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 1aEiR7-0002Sa-99 for ged-emacs-devel@m.gmane.org; Thu, 31 Dec 2015 19:58:57 +0100 Original-Received: from localhost ([::1]:56577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEiR6-0002wQ-Of for ged-emacs-devel@m.gmane.org; Thu, 31 Dec 2015 13:58:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEiQt-0002w7-Qu for emacs-devel@gnu.org; Thu, 31 Dec 2015 13:58:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEiQp-0002yS-8e for emacs-devel@gnu.org; Thu, 31 Dec 2015 13:58:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEiQp-0002yO-50; Thu, 31 Dec 2015 13:58:39 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2458 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aEiQo-0000nY-FF; Thu, 31 Dec 2015 13:58:38 -0500 In-reply-to: (message from Stefan Monnier on Thu, 31 Dec 2015 13:28:44 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197281 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Thu, 31 Dec 2015 13:28:44 -0500 > > >> > * lisp/textmodes/flyspell.el (flyspell-prog-mode): Record the > >> > original M-TAB binding in a buffer-local variable. > >> > (flyspell-auto-correct-word): Invoke the original binding of M-TAB > >> > if that is recorded, when point is in a place where flyspell > >> > should not be active (e.g., because the user turned on > >> > 'flyspell-prog-mode'). (Bug#18533) > >> Why not compute this fallback binding dynamically? > > Sorry, I don't understand what you mean. > > Is anything wrong with how I did it? > > The M-TAB binding that you record in a global var may not be the same as > the binding that would be used (if it weren't for flyspell) when the > user hits M-TAB. Could be, though unlikely. > The "usual" way to deal with "semi-transparent" minor-mode bindings like > this is to do something like > > (let* ((flyspell-mode nil)) ;; Temporarily hide flyspell's binding. > (call-interactively (key-binding (this-single-command-keys)))) Thanks, feel free to install such a change.