unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] emacs-25 6d11f6e: Allow to invoke original M-TAB binding in 'flyspell-prog-mode'
Date: Thu, 31 Dec 2015 13:28:44 -0500	[thread overview]
Message-ID: <jwvege2a33k.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <83a8oqbkbp.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 31 Dec 2015 19:26:50 +0200")

>> >     * 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.

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))))


-- Stefan



  reply	other threads:[~2015-12-31 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151231154421.21882.79337@vcs.savannah.gnu.org>
     [not found] ` <E1aEfOn-0005hY-LW@vcs.savannah.gnu.org>
2015-12-31 17:14   ` [Emacs-diffs] emacs-25 6d11f6e: Allow to invoke original M-TAB binding in 'flyspell-prog-mode' Stefan Monnier
2015-12-31 17:26     ` Eli Zaretskii
2015-12-31 18:28       ` Stefan Monnier [this message]
2015-12-31 18:59         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvege2a33k.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).