all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] emacs-25 6d11f6e: Allow to invoke original M-TAB binding in 'flyspell-prog-mode'
       [not found] ` <E1aEfOn-0005hY-LW@vcs.savannah.gnu.org>
@ 2015-12-31 17:14   ` Stefan Monnier
  2015-12-31 17:26     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2015-12-31 17:14 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

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


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] emacs-25 6d11f6e: Allow to invoke original M-TAB binding in 'flyspell-prog-mode'
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-12-31 17:26 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: Eli Zaretskii <eliz@gnu.org>
> Date: Thu, 31 Dec 2015 12:14:35 -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?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] emacs-25 6d11f6e: Allow to invoke original M-TAB binding in 'flyspell-prog-mode'
  2015-12-31 17:26     ` Eli Zaretskii
@ 2015-12-31 18:28       ` Stefan Monnier
  2015-12-31 18:59         ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2015-12-31 18:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] emacs-25 6d11f6e: Allow to invoke original M-TAB binding in 'flyspell-prog-mode'
  2015-12-31 18:28       ` Stefan Monnier
@ 2015-12-31 18:59         ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2015-12-31 18:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> 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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-31 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2015-12-31 18:59         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.