all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda.
@ 2017-02-16 21:30 Hong Xu
  2017-02-16 21:36 ` Noam Postavsky
  0 siblings, 1 reply; 7+ messages in thread
From: Hong Xu @ 2017-02-16 21:30 UTC (permalink / raw)
  To: 25765

	* flyspell.el (flyspell-auto-correct-word, flyspell-word): Quote
	flyspell-generic-check-word-predicate when applying fboundp on
	it. This avoids (wrong-type-argument symbolp) when
	flyspell-generic-check-word-predicate is a lambda.
---
 lisp/textmodes/flyspell.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index f7683d967905..f05624b55194 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1097,8 +1097,8 @@ flyspell-word
            (flyspell-word (flyspell-get-word following))
            start end poss word ispell-filter)
       (if (or (eq flyspell-word nil)
- 	      (and (fboundp flyspell-generic-check-word-predicate)
- 		   (not (funcall flyspell-generic-check-word-predicate))))
+              (and (fboundp 'flyspell-generic-check-word-predicate)
+                   (not (funcall flyspell-generic-check-word-predicate))))
 	  t
 	(progn
 	  ;; destructure return flyspell-word info list.
@@ -1914,7 +1914,7 @@ flyspell-auto-correct-word
   ;; invoke the original binding of M-TAB, if that was recorded.
   (if (and (local-variable-p 'flyspell--prev-meta-tab-binding)
            (commandp flyspell--prev-meta-tab-binding t)
-           (fboundp flyspell-generic-check-word-predicate)
+           (fboundp 'flyspell-generic-check-word-predicate)
            (not (funcall flyspell-generic-check-word-predicate))
            (equal (where-is-internal 'flyspell-auto-correct-word nil t)
                   [?\M-\t]))
-- 
2.11.0







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

* bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda.
  2017-02-16 21:30 bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda Hong Xu
@ 2017-02-16 21:36 ` Noam Postavsky
  2017-02-16 22:03   ` Hong Xu
  0 siblings, 1 reply; 7+ messages in thread
From: Noam Postavsky @ 2017-02-16 21:36 UTC (permalink / raw)
  To: Hong Xu; +Cc: 25765

On Thu, Feb 16, 2017 at 4:30 PM, Hong Xu <hong@topbug.net> wrote:
> -             (and (fboundp flyspell-generic-check-word-predicate)
> -                  (not (funcall flyspell-generic-check-word-predicate))))
> +              (and (fboundp 'flyspell-generic-check-word-predicate)
> +                   (not (funcall flyspell-generic-check-word-predicate))))

> -           (fboundp flyspell-generic-check-word-predicate)
> +           (fboundp 'flyspell-generic-check-word-predicate)

I don't think that's the right fix, rather the fboundp should be
replaced with functionp.





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

* bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda.
  2017-02-16 21:36 ` Noam Postavsky
@ 2017-02-16 22:03   ` Hong Xu
  2017-02-18  2:56     ` npostavs
  0 siblings, 1 reply; 7+ messages in thread
From: Hong Xu @ 2017-02-16 22:03 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 25765


[-- Attachment #1.1: Type: text/plain, Size: 309 bytes --]


On 2017-02-16 Thu 13:36 GMT-0800, Noam Postavsky <npostavs@users.sourceforge.net> wrote:

> On Thu, Feb 16, 2017 at 4:30 PM, Hong Xu <hong@topbug.net> wrote:
>
> I don't think that's the right fix, rather the fboundp should be
> replaced with functionp.

I agree. I've attached a new version of this patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Avoid-errors-when-flyspell-generic-check-word-predic.patch --]
[-- Type: text/x-diff, Size: 1833 bytes --]

From 3011a0c7ce7ce2c505b663743c79915b18fd0404 Mon Sep 17 00:00:00 2001
From: Hong Xu <hong@topbug.net>
Date: Thu, 16 Feb 2017 13:28:56 -0800
Subject: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a
 lambda.

	* flyspell.el (flyspell-auto-correct-word, flyspell-word):
	Apply functionp instead of fboundp on
	flyspell-generic-check-word-predicate. This
	avoids (wrong-type-argument symbolp) when
	flyspell-generic-check-word-predicate is a lambda.
---
 lisp/textmodes/flyspell.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index f7683d967905..fecfd2fc3ecb 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1097,8 +1097,8 @@ flyspell-word
            (flyspell-word (flyspell-get-word following))
            start end poss word ispell-filter)
       (if (or (eq flyspell-word nil)
- 	      (and (fboundp flyspell-generic-check-word-predicate)
- 		   (not (funcall flyspell-generic-check-word-predicate))))
+              (and (functionp flyspell-generic-check-word-predicate)
+                   (not (funcall flyspell-generic-check-word-predicate))))
 	  t
 	(progn
 	  ;; destructure return flyspell-word info list.
@@ -1914,7 +1914,7 @@ flyspell-auto-correct-word
   ;; invoke the original binding of M-TAB, if that was recorded.
   (if (and (local-variable-p 'flyspell--prev-meta-tab-binding)
            (commandp flyspell--prev-meta-tab-binding t)
-           (fboundp flyspell-generic-check-word-predicate)
+           (functionp flyspell-generic-check-word-predicate)
            (not (funcall flyspell-generic-check-word-predicate))
            (equal (where-is-internal 'flyspell-auto-correct-word nil t)
                   [?\M-\t]))
-- 
2.11.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda.
  2017-02-16 22:03   ` Hong Xu
@ 2017-02-18  2:56     ` npostavs
  2017-02-18  3:27       ` Hong Xu
  0 siblings, 1 reply; 7+ messages in thread
From: npostavs @ 2017-02-18  2:56 UTC (permalink / raw)
  To: Hong Xu; +Cc: 25765

tags 25765 fixed
close 25765 26.1
# With this patch, new checks can be added via add-function
close 3425 26.1
quit

Hong Xu <hong@topbug.net> writes:

> On 2017-02-16 Thu 13:36 GMT-0800, Noam Postavsky <npostavs@users.sourceforge.net> wrote:
>
>> On Thu, Feb 16, 2017 at 4:30 PM, Hong Xu <hong@topbug.net> wrote:
>>
>> I don't think that's the right fix, rather the fboundp should be
>> replaced with functionp.
>
> I agree. I've attached a new version of this patch.
>

Thanks, pushed to master [1: a83b66923c].

1: 2017-02-17 21:50:46 -0500 a83b66923cfb71bb477d7a1f426f7426f91917da
  Avoid errors when flyspell-generic-check-word-predicate is a lambda.





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

* bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda.
  2017-02-18  2:56     ` npostavs
@ 2017-02-18  3:27       ` Hong Xu
  2017-02-18  8:23         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Hong Xu @ 2017-02-18  3:27 UTC (permalink / raw)
  To: npostavs; +Cc: 25765


[-- Attachment #1.1: Type: text/plain, Size: 952 bytes --]

On 02/17/2017 06:56 PM, npostavs@users.sourceforge.net wrote:
> tags 25765 fixed
> close 25765 26.1
> # With this patch, new checks can be added via add-function
> close 3425 26.1
> quit
> 
> Hong Xu <hong@topbug.net> writes:
> 
>> On 2017-02-16 Thu 13:36 GMT-0800, Noam Postavsky <npostavs@users.sourceforge.net> wrote:
>>
>>> On Thu, Feb 16, 2017 at 4:30 PM, Hong Xu <hong@topbug.net> wrote:
>>>
>>> I don't think that's the right fix, rather the fboundp should be
>>> replaced with functionp.
>>
>> I agree. I've attached a new version of this patch.
>>
> 
> Thanks, pushed to master [1: a83b66923c].
> 
> 1: 2017-02-17 21:50:46 -0500 a83b66923cfb71bb477d7a1f426f7426f91917da
>   Avoid errors when flyspell-generic-check-word-predicate is a lambda.
> 

Is it possible to back port this fix to the emacs-25 branch? Looks like
this bug was introduced in 6d11f6ed9a1afa6f3903fffeb58159beedeb1d14
which is new in Emacs 25.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda.
  2017-02-18  3:27       ` Hong Xu
@ 2017-02-18  8:23         ` Eli Zaretskii
  2017-02-18 13:34           ` npostavs
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2017-02-18  8:23 UTC (permalink / raw)
  To: Hong Xu; +Cc: 25765, npostavs

> From: Hong Xu <hong@topbug.net>
> Date: Fri, 17 Feb 2017 19:27:50 -0800
> Cc: 25765@debbugs.gnu.org
> 
> > 1: 2017-02-17 21:50:46 -0500 a83b66923cfb71bb477d7a1f426f7426f91917da
> >   Avoid errors when flyspell-generic-check-word-predicate is a lambda.
> > 
> 
> Is it possible to back port this fix to the emacs-25 branch? Looks like
> this bug was introduced in 6d11f6ed9a1afa6f3903fffeb58159beedeb1d14
> which is new in Emacs 25.

Sorry, no.  It's too late for that: the emacs-25 branch is in deep
freeze now.





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

* bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda.
  2017-02-18  8:23         ` Eli Zaretskii
@ 2017-02-18 13:34           ` npostavs
  0 siblings, 0 replies; 7+ messages in thread
From: npostavs @ 2017-02-18 13:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25765, Hong Xu

Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> Is it possible to back port this fix to the emacs-25 branch? Looks like
>> this bug was introduced in 6d11f6ed9a1afa6f3903fffeb58159beedeb1d14
>> which is new in Emacs 25.
>
> Sorry, no.  It's too late for that: the emacs-25 branch is in deep
> freeze now.

Also, only the instance in `flyspell-auto-correct-word' was introduced
in Emacs 25; the other case in `flyspell-word' goes back to the original
revision of flyspell.el in 1998 [1: 60371a2e3d], when the variable was
still called `flyspell-generic-check-word-p'.

1: 1998-06-26 01:24:05 +0000 60371a2e3d30618c3f65a5d1c83a9e4c99ee95a2
  Initial revision





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

end of thread, other threads:[~2017-02-18 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-16 21:30 bug#25765: [PATCH] Avoid errors when flyspell-generic-check-word-predicate is a lambda Hong Xu
2017-02-16 21:36 ` Noam Postavsky
2017-02-16 22:03   ` Hong Xu
2017-02-18  2:56     ` npostavs
2017-02-18  3:27       ` Hong Xu
2017-02-18  8:23         ` Eli Zaretskii
2017-02-18 13:34           ` npostavs

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.