From debbugs-submit-bounces@debbugs.gnu.org Tue May 28 16:44:14 2019 Received: (at submit) by debbugs.gnu.org; 28 May 2019 20:44:15 +0000 Received: from localhost ([127.0.0.1]:57297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVixC-0006AS-Dw for submit@debbugs.gnu.org; Tue, 28 May 2019 16:44:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVix9-0006AC-Kq for submit@debbugs.gnu.org; Tue, 28 May 2019 16:44:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:58031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVix2-0002hU-Ex for submit@debbugs.gnu.org; Tue, 28 May 2019 16:44:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVix0-0006fT-Bu for bug-gnu-emacs@gnu.org; Tue, 28 May 2019 16:44:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hViwy-0002b6-8H for bug-gnu-emacs@gnu.org; Tue, 28 May 2019 16:44:02 -0400 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]:39980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hViww-0002WM-3b for bug-gnu-emacs@gnu.org; Tue, 28 May 2019 16:43:58 -0400 Received: by mail-oi1-x232.google.com with SMTP id r136so186585oie.7 for ; Tue, 28 May 2019 13:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=WL1JEK3Zvl/8R5u8tnG2egCLfnJahZ7aTPDcYWAbvX4=; b=bVxQuG1OrXow5C+7VRmelx95VoGf7mcVtSUJN6F9vpXUZw+NBBz+0OE9OSTokYirZv ZM1AP7D6DyCz0yk4ZRFAbJxdApJQ/NNqxQW5ANOG0FBUt5W2uotoH0PHQiLmQZi3OEVd hcgBTWdxQsxVHTkl5XkOv6+jCPrR5l0u4760vClU3FMDI5IbxDBDn81T34hGnS8L+TNF bN8FGn9t5iE3xun49uzeuKXVOSXWAAtOYIhFcgpj2eJoPFahrh9B9F10bfPm9zHvpToa EaQZODfJa4eSVi0bYuNVo5rVYnOLU4etQ1xQOsO6ANmAcLnzbsrYyEAfkQUA4bwkU0PP KUjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=WL1JEK3Zvl/8R5u8tnG2egCLfnJahZ7aTPDcYWAbvX4=; b=i1fRourCldBpPMsPbKNA6HhIXwFvTPzsjEMgGq+NgU8WTnsGnZAtHvtqGunOHGagMr V9EYhkag3s7YkkPdepHHFFq5tvmamxlEGUGPGOe84tui+DuBbJpMXw7/NrwqARcQG4GB gQWmVRDeGlFIygEiXnulzVcNyFxrsALSPsKURrhib1akycW7i4p+QFFi3WSArWC2gwwi JXRYMdxjB5dzKmRtRnaTp2R25PKTQzyHg+0PJKworkrFsYhyJmJ0xsJc2YF8eFGue1KC SHCSW+C/+CN6hfdiPBo2tNkwVOGmBpCV/nnxXmB11M78m959Dlj+57bDarC8zHc4UyrB BiLA== X-Gm-Message-State: APjAAAVFqjcLbwc9YbRFW1uHERuOzuDYTfWn/SNlJqhkgpWdZ5wX3LdQ B5bAzgaMJiqNysRpV7RqYQttQE9/ X-Google-Smtp-Source: APXvYqygaCeng3kGIqEnUqS1czBg4wcXIBIWNzh/rCpuYtUuVrvmkx4iEZKor6OQaedoLU6d5E0hJw== X-Received: by 2002:aca:4ac7:: with SMTP id x190mr3629669oia.38.1559076236016; Tue, 28 May 2019 13:43:56 -0700 (PDT) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id f4sm6528040oih.39.2019.05.28.13.43.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 13:43:54 -0700 (PDT) User-agent: mu4e 1.2.0; emacs 27.0.50 From: Alex Branham To: bug-gnu-emacs@gnu.org Subject: [PATCH] avoid flyspell error if point is at bob Date: Tue, 28 May 2019 15:43:53 -0500 Message-ID: <87h89e8g3a.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::232 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Hello - The attached patch avoids an args-out-of-range error (from `get-text-property') if `flyspell-prog-mode' is on and point is in a comment at the beginning of the buffer. Thanks, Alex --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Avoid-a-flyspell-error-if-point-is-at-beginning-of-b.patch >From e130dfcb542af667fbef6e6eb867c46eee6d9746 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Tue, 28 May 2019 15:40:26 -0500 Subject: [PATCH] Avoid a flyspell error if point is at beginning of buffer * lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify): Check if point is at bob. This prevents an error when e.g. 'flyspell-auto-correct-word' gets called with point at the beginning of the buffer. --- lisp/textmodes/flyspell.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index d18916dfd0..e711fe72b2 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -424,8 +424,9 @@ like \"Some." (defun flyspell-generic-progmode-verify () "Used for `flyspell-generic-check-word-predicate' in programming modes." ;; (point) is next char after the word. Must check one char before. - (let ((f (get-text-property (- (point) 1) 'face))) - (memq f flyspell-prog-text-faces))) + (unless (bobp) + (let ((f (get-text-property (- (point) 1) 'face))) + (memq f flyspell-prog-text-faces)))) ;; Records the binding of M-TAB in effect before flyspell was activated. (defvar flyspell--prev-meta-tab-binding) -- 2.21.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 29 12:08:23 2019 Received: (at 35967) by debbugs.gnu.org; 29 May 2019 16:08:23 +0000 Received: from localhost ([127.0.0.1]:59672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hW17m-0000w6-Vs for submit@debbugs.gnu.org; Wed, 29 May 2019 12:08:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hW17l-0000vn-E5 for 35967@debbugs.gnu.org; Wed, 29 May 2019 12:08:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW17d-00022T-4F; Wed, 29 May 2019 12:08:15 -0400 Received: from [176.228.60.248] (port=3952 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hW17Z-0004fI-CH; Wed, 29 May 2019 12:08:09 -0400 Date: Wed, 29 May 2019 19:08:18 +0300 Message-Id: <83pno1xmz1.fsf@gnu.org> From: Eli Zaretskii To: Alex Branham In-reply-to: <87h89e8g3a.fsf@gmail.com> (message from Alex Branham on Tue, 28 May 2019 15:43:53 -0500) Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob References: <87h89e8g3a.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35967 Cc: 35967@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Alex Branham > Date: Tue, 28 May 2019 15:43:53 -0500 > > >From e130dfcb542af667fbef6e6eb867c46eee6d9746 Mon Sep 17 00:00:00 2001 > From: Alex Branham > Date: Tue, 28 May 2019 15:40:26 -0500 > Subject: [PATCH] Avoid a flyspell error if point is at beginning of buffer > > * lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify): > Check if point is at bob. This prevents an error when e.g. > 'flyspell-auto-correct-word' gets called with point at the > beginning of the buffer. > --- > lisp/textmodes/flyspell.el | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el > index d18916dfd0..e711fe72b2 100644 > --- a/lisp/textmodes/flyspell.el > +++ b/lisp/textmodes/flyspell.el > @@ -424,8 +424,9 @@ like \"Some." > (defun flyspell-generic-progmode-verify () > "Used for `flyspell-generic-check-word-predicate' in programming modes." > ;; (point) is next char after the word. Must check one char before. > - (let ((f (get-text-property (- (point) 1) 'face))) > - (memq f flyspell-prog-text-faces))) > + (unless (bobp) > + (let ((f (get-text-property (- (point) 1) 'face))) > + (memq f flyspell-prog-text-faces)))) Thanks. Maybe it's just me, but whenever I see bobp, I always have to consult the docs regarding what happens in a narrowed buffer. For that reason, I prefer comparison with point-min instead. Am I the only one troubled by that? From debbugs-submit-bounces@debbugs.gnu.org Thu May 30 07:58:39 2019 Received: (at 35967) by debbugs.gnu.org; 30 May 2019 11:58:39 +0000 Received: from localhost ([127.0.0.1]:60889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWJhf-0006dl-EM for submit@debbugs.gnu.org; Thu, 30 May 2019 07:58:39 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:37053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWJhe-0006dW-1F for 35967@debbugs.gnu.org; Thu, 30 May 2019 07:58:38 -0400 Received: by mail-ed1-f66.google.com with SMTP id w37so8781906edw.4 for <35967@debbugs.gnu.org>; Thu, 30 May 2019 04:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=EhRGndsuaKv3PrCptNEJ+Wo/jgSVPMqF9W78Wgega5o=; b=a+xkkd8N6ZcNhdg1XkjkgvBqtMbVKI9sv41bXvGslahS1SoPH/TxY8NLCn5UHuUdC1 jlgS2hYLh1m682MZTzMats0FwHUMAsRpps1BQUQWusI4xrq7KoPxycBsAOieIV38am0W uFL2KKnSkj982aHMxGmPYPd7Ku5NUFr+A3qMBDYUPHI0rGkuHeWJsWygC7YtNu88a267 syN5St+Ty+vFCfqwJG67LctzRyCF5uw+A0iZHicCshtc+JTYyLbTxpeQCAcKsOvQnb5n R/jvyfU2S3ME3AhesikGDbpaFFcbm3aQODkdR/zTKo9cUyEkTJPwOw5oiIHE1fKkfl7h 7/qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=EhRGndsuaKv3PrCptNEJ+Wo/jgSVPMqF9W78Wgega5o=; b=Joj1HKBXNskgXHv2TLJ7YAjyOlrdTSLM/lwj7HhQgLD4t0RytQYOmVUgJMprLyKqVd rbWDLYEkmRNP19utqVZdpTyk1273y24nAdyU9lEQbB/+6pdvefZLZbpPBSHrcGStMot4 KibwpzKq2hLZrqkXYQf5uZ2Vfy3Aad4561w+iQwIPPtNK0IlT6ly8BGdSpfqzfIwfXa4 8AT5XmgXKUhnD57808tMWMYPCb9DSaR5Tt7atHDdZQ/T7WH3VjZ/fhI63GOHH5zkNb7X fdLYVVcV+R/j9JziYujvMFEDBg9qVa+TevQLfREAVKsQtx2vb8Jz0kj19L62au+60s8T bHzw== X-Gm-Message-State: APjAAAVLu58F+hLvRz576zi5v077A6t0Uiw8RcKpNXbB8SyHc/Je5a8F Ec6DTQ1IZG/2QdbYDGhdUVe7xg== X-Google-Smtp-Source: APXvYqy98pg4t1sp1Ruc4Dt9pCitJ9Ggm/5ttuJX5334LlkesJQ+iKR2ogvpIdtO//RCL2mZQwy7UA== X-Received: by 2002:a17:906:c3cb:: with SMTP id cj11mr3077775ejb.132.1559217511538; Thu, 30 May 2019 04:58:31 -0700 (PDT) Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id n15sm393726eja.26.2019.05.30.04.58.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 30 May 2019 04:58:30 -0700 (PDT) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> Date: Thu, 30 May 2019 12:58:29 +0100 In-Reply-To: <83pno1xmz1.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 May 2019 19:08:18 +0300") Message-ID: <87pno0upay.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35967 Cc: Alex Branham , 35967@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Alex Branham >> Date: Tue, 28 May 2019 15:43:53 -0500 >> >> >From e130dfcb542af667fbef6e6eb867c46eee6d9746 Mon Sep 17 00:00:00 2001 >> From: Alex Branham >> Date: Tue, 28 May 2019 15:40:26 -0500 >> Subject: [PATCH] Avoid a flyspell error if point is at beginning of buffer >> >> * lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify): >> Check if point is at bob. This prevents an error when e.g. >> 'flyspell-auto-correct-word' gets called with point at the >> beginning of the buffer. >> --- >> lisp/textmodes/flyspell.el | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el >> index d18916dfd0..e711fe72b2 100644 >> --- a/lisp/textmodes/flyspell.el >> +++ b/lisp/textmodes/flyspell.el >> @@ -424,8 +424,9 @@ like \"Some." >> (defun flyspell-generic-progmode-verify () >> "Used for `flyspell-generic-check-word-predicate' in programming modes." >> ;; (point) is next char after the word. Must check one char before. >> - (let ((f (get-text-property (- (point) 1) 'face))) >> - (memq f flyspell-prog-text-faces))) >> + (unless (bobp) >> + (let ((f (get-text-property (- (point) 1) 'face))) >> + (memq f flyspell-prog-text-faces)))) > > Maybe it's just me, but whenever I see bobp, I always have to consult > the docs regarding what happens in a narrowed buffer. For that > reason, I prefer comparison with point-min instead. > > Am I the only one troubled by that? I wouldn't say I'm troubled by what bobp does in a narrowed buffer (I would expect it to heed buffer restrictions). Rather, bobp conveys only some property of current state, whereas explicit comparisons to point-min such as (> (point) (point-min)) or (max (point-min) (1- (point))) additionally suggest that subsequent buffer position operations are being guarded from out-of-bounds errors. But that's just my reading into the distinction, so it probably comes down to taste and habits. -- Basil From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 11 10:12:22 2019 Received: (at 35967) by debbugs.gnu.org; 11 Jun 2019 14:12:22 +0000 Received: from localhost ([127.0.0.1]:59883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hahVe-0003lY-Bs for submit@debbugs.gnu.org; Tue, 11 Jun 2019 10:12:22 -0400 Received: from mail-io1-f41.google.com ([209.85.166.41]:40359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hahVb-0003lJ-4Q for 35967@debbugs.gnu.org; Tue, 11 Jun 2019 10:12:19 -0400 Received: by mail-io1-f41.google.com with SMTP id n5so9991830ioc.7 for <35967@debbugs.gnu.org>; Tue, 11 Jun 2019 07:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=h2JqMCU2fYqwV3S1siwvLFuhYom5iTikv4Sy5KYd7y0=; b=JAy0PEXP7+U85RgXu4/Gyjx8LXmrlj06PsyiY05xBKGnLTVqdfdo+0Lyaty6vzQ2nE d5qhjyYYDJx5XEQklLdeUPu6+C+fu56m70MK5wxtcu5h5GxxVHM437JI/Vu6zB2r37gb uq3znfau47n4IJh0Pf0Y0JO6WYltPIl64t8zHQ6eGTDADFHiws5uIjB6EnwzUA+qtQC9 UZORVFdErx0Hc8ZArvimvh/HFslW4rBNOVb70CEMTHsi9vJ+5vpd8v8faqhchWzD5BzV KdG5bZR6HW1j5dCRBbEUbY75P8mZMMqR7gye+3cBuA+peeD6I4T4nCbDnH9m2AIU38OR grjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=h2JqMCU2fYqwV3S1siwvLFuhYom5iTikv4Sy5KYd7y0=; b=bsu1019+LDI6VShhi154y10eQK9uAp1WJFo61hmckfbzp0hucHxB/w/YZLQC973YCd qyr+DOeGihMhLWSC/K7BUwjQ5S8eBcslKeU3Ehti67L5BjznIv3WQyxhxZgUem69e5Cl IBiLd/wH0IAt+cuHSH+jbCeP58HBrHln/ZMKxQZyumF9NuoaKS+G7PLF2Y3G/IiFSp26 jIgmjKuavvJ9xw2uu66oa9ySNvFDt23qG6IEFFUmcfe2SYZCAVbEdfKXmS8c07m1Ue2B cHRAwg5k2hA/NpvVM5Y+XyjmSL+p+6e35DIvXrUpSY6wJE/YYsmKaBf4WBBH9E9B5JKu +aSA== X-Gm-Message-State: APjAAAUqFYeFzhPVNC8H7Q/xyOB4JwTcE/y+pljvmWxyvS1sYcRSEGCn V/JlRtwfSKKqe1Eyk5ElANqF5I78 X-Google-Smtp-Source: APXvYqwHe1/L6Z0pT0FmppxkF8q24omAsnPvkcv0bkqEsEt1Nz2U9c0dASRNMpGOUtN9lqM5hPs6vg== X-Received: by 2002:a6b:e702:: with SMTP id b2mr9459898ioh.175.1560262333444; Tue, 11 Jun 2019 07:12:13 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id z138sm1342216itc.36.2019.06.11.07.12.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jun 2019 07:12:12 -0700 (PDT) From: npostavs@gmail.com To: Eli Zaretskii Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> Date: Tue, 11 Jun 2019 10:12:12 -0400 In-Reply-To: <83pno1xmz1.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 May 2019 19:08:18 +0300") Message-ID: <857e9sb48z.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35967 Cc: Alex Branham , 35967@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> + (unless (bobp) >> + (let ((f (get-text-property (- (point) 1) 'face))) >> + (memq f flyspell-prog-text-faces)))) > > Thanks. > > Maybe it's just me, but whenever I see bobp, I always have to consult > the docs regarding what happens in a narrowed buffer. For that > reason, I prefer comparison with point-min instead. > > Am I the only one troubled by that? It doesn't take too long to check the docstring, does it? And it seems fairly easy to remember that bobp should treat a narrowed buffer the same way that beginning-of-buffer will. My only complaint about bobp is that it's abbreviated perhaps a little too far, to the point of obscurity. As in, who is "bob" and why are we asking about him? From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 11 10:39:16 2019 Received: (at 35967) by debbugs.gnu.org; 11 Jun 2019 14:39:16 +0000 Received: from localhost ([127.0.0.1]:59958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hahvf-0006an-UO for submit@debbugs.gnu.org; Tue, 11 Jun 2019 10:39:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hahvd-0006ab-IB for 35967@debbugs.gnu.org; Tue, 11 Jun 2019 10:39:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hahvT-0001EM-E1; Tue, 11 Jun 2019 10:39:04 -0400 Received: from [176.228.60.248] (port=3587 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hahvS-00023V-NW; Tue, 11 Jun 2019 10:39:03 -0400 Date: Tue, 11 Jun 2019 17:39:02 +0300 Message-Id: <83d0jk9oft.fsf@gnu.org> From: Eli Zaretskii To: npostavs@gmail.com In-reply-to: <857e9sb48z.fsf@gmail.com> (npostavs@gmail.com) Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> <857e9sb48z.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35967 Cc: alex.branham@gmail.com, 35967@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: npostavs@gmail.com > Cc: Alex Branham , 35967@debbugs.gnu.org > Date: Tue, 11 Jun 2019 10:12:12 -0400 > > it seems fairly easy to remember that bobp should treat a narrowed > buffer the same way that beginning-of-buffer will. Not for this old curmudgeon, evidently. > My only complaint about bobp is that it's abbreviated perhaps a little > too far, to the point of obscurity. As in, who is "bob" and why are we > asking about him? That question has a known answer: Bob's your uncle. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 14 14:17:44 2019 Received: (at 35967) by debbugs.gnu.org; 14 Jun 2019 18:17:44 +0000 Received: from localhost ([127.0.0.1]:37762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbqlk-0005N5-2B for submit@debbugs.gnu.org; Fri, 14 Jun 2019 14:17:44 -0400 Received: from mail-ot1-f50.google.com ([209.85.210.50]:37120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbqli-0005Mo-2O for 35967@debbugs.gnu.org; Fri, 14 Jun 2019 14:17:43 -0400 Received: by mail-ot1-f50.google.com with SMTP id s20so3526623otp.4 for <35967@debbugs.gnu.org>; Fri, 14 Jun 2019 11:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=fdNuwOiGoT2ETPsgy12eAfa4fbWG34F4kJa+TNvtoP8=; b=o0/NZBKX83UdhUCk+wrCNq8Dlr0Jkf7Fu60e62X59kFVXHQfUVImnyJjHNeLjGDBR3 qszxg160erB4S6kTbJnMASaNQ+IGZ0Ao6npo1wLB6BdSjyRN3KrUFyAc/aVAa7RTxNNt vvkN3aTZrYHy9kRW/KH7WduU8valuxx/XCUD49YGqJEQrpBapP3UxCghhQo3tK3w6wry jsrWblCA4WaohenZerXwZUmxYTPF8fBrx/wftOzKI01GocsRhlRzC/IonFmAOmjvMgSV /2erwzSLzUJxA6yGnI/FqvWOzheI21qz3h1Z8HIZKATemQxaHFzaivnR/W59z49vbF++ RSlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=fdNuwOiGoT2ETPsgy12eAfa4fbWG34F4kJa+TNvtoP8=; b=pTD6RB7YQwyeZzm2hhnzeqHsClAX2a7ZRdysFR8wEVDK6r2goQqOmflb+iD72r7WI3 uFfsVbJQLNWdLhyonyXsgST7kCLbAtHeJvsXekjJq67RSeey9csgoZyBnDnWs1y6BBvR r/X5sYZGrKQH2eWcKGIC4fdGTbNqvc6ELWqZ2e0qMQbn4cx/unHzAq2G0mS65XFbZvBn AEeD5wsgpeOhmnO+TQVlk88xqi/tvDD/DUhGQBnqHv2R0bAi9cIlNP29uaflSrzXmAoc JtesS4E5j0RpVKkYNRt6YNta3oHBECWTqZIpaIqj01lOIiKuChisDnnZdv6465pp3pmj JyXQ== X-Gm-Message-State: APjAAAVh9tu7iCRKjerbt/pdEyVR6sUCpE1ePV13zjSMgiWZKEfNryJE TJqTO27RPZ0TsewzCpm5u5CHkCE5 X-Google-Smtp-Source: APXvYqwsA2N06Y8gcKlZxTFfgHMHrJmYrdUS9WBzE+DzC4Ec/IHVkFmhY+6UoYsgbvKlZbzUI+umAg== X-Received: by 2002:a9d:7f94:: with SMTP id t20mr35830632otp.370.1560536256087; Fri, 14 Jun 2019 11:17:36 -0700 (PDT) Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id m5sm1360245oif.13.2019.06.14.11.17.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 11:17:33 -0700 (PDT) References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> <857e9sb48z.fsf@gmail.com> <83d0jk9oft.fsf@gnu.org> User-agent: mu4e 1.2.0; emacs 27.0.50 From: Alex Branham To: Eli Zaretskii Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob In-reply-to: <83d0jk9oft.fsf@gnu.org> Date: Fri, 14 Jun 2019 13:17:31 -0500 Message-ID: <87tvcsqbes.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 35967 Cc: 35967@debbugs.gnu.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain On Tue 11 Jun 2019 at 09:39, Eli Zaretskii wrote: >> From: npostavs@gmail.com >> Cc: Alex Branham , 35967@debbugs.gnu.org >> Date: Tue, 11 Jun 2019 10:12:12 -0400 >> >> it seems fairly easy to remember that bobp should treat a narrowed >> buffer the same way that beginning-of-buffer will. > > Not for this old curmudgeon, evidently. Here's a new patch that checks for (equal (point) 1) rather than using bobp. OK to push to master? Alex --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Avoid-a-flyspell-error-if-point-is-at-beginning-of-b.patch >From c7d7ccaf5b94a1146e4664ec21564f982686fcab Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Fri, 14 Jun 2019 13:15:36 -0500 Subject: [PATCH] Avoid a flyspell error if point is at beginning of buffer * lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify): Check if point is at the beginning of the buffer. This prevents an error when e.g. 'flyspell-auto-correct-word' gets called with point at the beginning of the buffer. --- lisp/textmodes/flyspell.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index d18916dfd0..7237a0f8ab 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -423,9 +423,10 @@ flyspell-prog-text-faces (defun flyspell-generic-progmode-verify () "Used for `flyspell-generic-check-word-predicate' in programming modes." - ;; (point) is next char after the word. Must check one char before. - (let ((f (get-text-property (- (point) 1) 'face))) - (memq f flyspell-prog-text-faces))) + (unless (eql (point) 1) + ;; (point) is next char after the word. Must check one char before. + (let ((f (get-text-property (- (point) 1) 'face))) + (memq f flyspell-prog-text-faces)))) ;; Records the binding of M-TAB in effect before flyspell was activated. (defvar flyspell--prev-meta-tab-binding) -- 2.21.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 14 14:32:03 2019 Received: (at 35967) by debbugs.gnu.org; 14 Jun 2019 18:32:03 +0000 Received: from localhost ([127.0.0.1]:37780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbqzb-0005lv-2L for submit@debbugs.gnu.org; Fri, 14 Jun 2019 14:32:03 -0400 Received: from mail-io1-f46.google.com ([209.85.166.46]:34012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbqzZ-0005lO-Sw for 35967@debbugs.gnu.org; Fri, 14 Jun 2019 14:32:02 -0400 Received: by mail-io1-f46.google.com with SMTP id k8so7972524iot.1 for <35967@debbugs.gnu.org>; Fri, 14 Jun 2019 11:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Aex1LH46le9GduNvMqrhccOqnkdQmhtPkAGXprfySQ0=; b=pL5q3wba6c4NoKMtVWVvO3HaJO7+j4zueRcJBNycqFCUnJXIDPMCBc0vDkEfu1Aj7C Qw+K/0MgIoZ3VGwrFqT0NfQdQfIGHvWPSMH6jOQlmTx54rdN6hdtcDbPHs8Zyhz76M/I 8R+RZ61UVUJFUV9xPf1W9iLTxsytrQFmv2HxsIQ8H/t5kedch+N8ZPKNxvkI2xp/Z5ry L1jibOAobjXKuZGAlIfQrNoWDLbk/+tl+AQgQM4L4DjD+m24pf2iKmPmaMgO2ukcOpsV Otyixra3kvW2t+LNNyBf96Rao02/dWr9RT6hx35YBRrCnf9iT27D/zH3gF3FEH9Dtz9c CY5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Aex1LH46le9GduNvMqrhccOqnkdQmhtPkAGXprfySQ0=; b=ZX7SP/fzFE8CRViQ73CY5vqwVDjf7tUzgqLHSV1cFO13hAuxwGKmlWZCCGt8OQ4q4L b3fsMn7gJkxxPAOONvYbycnQqYDXIsArx88wBz8hA0eFz07dECojl5yoGCIJoupNPzr5 Ihg6JLj2TtMhfF3HIv6XwlxYeq0tAliw2UQ/tuG96Hg8Ou7BWnCZz4CD7vHkJ3QSoSn4 0pcc/23Lhf+zFjEGeiztx15p8kf2niWB2utysoJ/hcj0uYu6XzodTDvw2WvLu3DCxHA6 UJo3DMqrDq8kdGgjTW904RM/RUfuXH3tWOTDnRqttywQc+ycq2z+/cDzb1sDvDUFMQvD 2VzQ== X-Gm-Message-State: APjAAAXlocKFtGkbc2hIbQQ1Zkle8OAQFPIZDbtpxJnZpqs8i8VOFLAT 6nduwX8ZPE/1Sj9FZYyd3qk= X-Google-Smtp-Source: APXvYqyHzJCqgFkgl2HDfww8T8c61j2myeOMSF9g3nd7el90E3pfSmbSNvcy2IirBJRbGL4KiLy+hA== X-Received: by 2002:a02:c6b8:: with SMTP id o24mr22255234jan.80.1560537116086; Fri, 14 Jun 2019 11:31:56 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id p9sm2983926ioj.49.2019.06.14.11.31.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 11:31:55 -0700 (PDT) From: npostavs@gmail.com To: Alex Branham Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> <857e9sb48z.fsf@gmail.com> <83d0jk9oft.fsf@gnu.org> <87tvcsqbes.fsf@gmail.com> Date: Fri, 14 Jun 2019 14:31:55 -0400 In-Reply-To: <87tvcsqbes.fsf@gmail.com> (Alex Branham's message of "Fri, 14 Jun 2019 13:17:31 -0500") Message-ID: <858su4c92c.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35967 Cc: Eli Zaretskii , 35967@debbugs.gnu.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alex Branham writes: > Here's a new patch that checks for (equal (point) 1) rather than using > bobp. OK to push to master? > + (unless (eql (point) 1) > + ;; (point) is next char after the word. Must check one char before. > + (let ((f (get-text-property (- (point) 1) 'face))) This will do the wrong thing when point is at the beginning of a narrowed buffer. Score one point for bobp? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 14 14:41:38 2019 Received: (at 35967) by debbugs.gnu.org; 14 Jun 2019 18:41:38 +0000 Received: from localhost ([127.0.0.1]:37791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbr8s-000611-G3 for submit@debbugs.gnu.org; Fri, 14 Jun 2019 14:41:38 -0400 Received: from mail-oi1-f169.google.com ([209.85.167.169]:36440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbr8q-00060o-S0 for 35967@debbugs.gnu.org; Fri, 14 Jun 2019 14:41:37 -0400 Received: by mail-oi1-f169.google.com with SMTP id w7so2693010oic.3 for <35967@debbugs.gnu.org>; Fri, 14 Jun 2019 11:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=E9XWCpmGbA4rOtoql6EmPZfzAbnSRmNd80foNO4a7o8=; b=n/thdmF0trlHXaBacQqR7NZlcZeu3uY/DejYmg3armWQSQLOSM9yAnllafO+c1xUTD lCic5zDxtIg7298BSBB5goWvcvkTD+roIZAFlMMZZxjb48YxmY/2FSxGVhyURR+9VLeX uCX+wAbAEfv297Pg6ll5DJBT08VHl56RuSbzQnTYv3Z2t79l6rCg/BLVFXyGV6W+fCKK rUw9GfZsmGQ/FbdqCkP7TqPtFlOONnc0plMlNTB66C1EZZkv7cz/ZeI7kba1ifYVQG0h xqWqaJVDSDPqqPwjUDSH4aY3/mbxEqUC1ovzHWdH0QZ5lerUyzxOsehaW+hVzqkR5Y5A /7Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=E9XWCpmGbA4rOtoql6EmPZfzAbnSRmNd80foNO4a7o8=; b=QoqII00v6b1uB9hx28Tk3hV5nH5vArWaMFmpXBrTq9BkFzgQ2o+HGsQ4/AIDSrN1Y4 T/3/Tm/hK8SzreaMHzHwO09p/mEaW1PfT/wqUUWm5zp+ul4d4yA4A4ZummthNcHQFitC 1ipcC8apj+E1Hx73xs2d8XeTVi8JODfYHgEEPV8pN9NLCHHtqRWokFNeCiMANHahQaiH IcBGCRnWhvOWd/5Jd+OHeHzKC7l6oNZ4RVTqXrV6z2Ngru9123jurdco1QigmUOvb4AF SCnTYt95hR5xDbWituxvEMwrYPAp3ySn1hO8SNVF6TUtCGgYOlN1NHtkPAm4oWnKFpw6 HOAQ== X-Gm-Message-State: APjAAAVHD50NaNIZlrmw7X6PAv/uhb1IWn5tWwVJlt8cc/ebaiIQkghC JuvJmA5x2KfK9TA5aRbP5uteR5RW X-Google-Smtp-Source: APXvYqxq0Vro2Y0TTqTuy5vVCWu5AP0JKt4vY/xZUWeGkcpiCADZ8kRON5UUgbatDeIjqRY8b5HIEg== X-Received: by 2002:aca:3143:: with SMTP id x64mr2736390oix.73.1560537690952; Fri, 14 Jun 2019 11:41:30 -0700 (PDT) Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id s64sm1475475oie.40.2019.06.14.11.41.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 11:41:30 -0700 (PDT) References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> <857e9sb48z.fsf@gmail.com> <83d0jk9oft.fsf@gnu.org> <87tvcsqbes.fsf@gmail.com> <858su4c92c.fsf@gmail.com> User-agent: mu4e 1.2.0; emacs 27.0.50 From: Alex Branham To: npostavs@gmail.com Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob In-reply-to: <858su4c92c.fsf@gmail.com> Date: Fri, 14 Jun 2019 13:41:29 -0500 Message-ID: <87pnngqaau.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35967 Cc: Eli Zaretskii , 35967@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain On Fri 14 Jun 2019 at 13:31, npostavs@gmail.com wrote: > Alex Branham writes: > >> Here's a new patch that checks for (equal (point) 1) rather than using >> bobp. OK to push to master? > >> + (unless (eql (point) 1) >> + ;; (point) is next char after the word. Must check one char before. >> + (let ((f (get-text-property (- (point) 1) 'face))) > > This will do the wrong thing when point is at the beginning of a > narrowed buffer. Score one point for bobp? Oh, of course. Here it is with (point-min), which should work I think. Alex --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Avoid-a-flyspell-error-if-point-is-at-beginning-of-b.patch >From f4ecc0a1657e736173f6daeabbe870dae4e8a7f1 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Fri, 14 Jun 2019 13:15:36 -0500 Subject: [PATCH] Avoid a flyspell error if point is at beginning of buffer * lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify): Check if point is at the beginning of the buffer. This prevents an error when e.g. 'flyspell-auto-correct-word' gets called with point at the beginning of the buffer. --- lisp/textmodes/flyspell.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index d18916dfd0..22f9db4363 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -423,9 +423,10 @@ flyspell-prog-text-faces (defun flyspell-generic-progmode-verify () "Used for `flyspell-generic-check-word-predicate' in programming modes." - ;; (point) is next char after the word. Must check one char before. - (let ((f (get-text-property (- (point) 1) 'face))) - (memq f flyspell-prog-text-faces))) + (unless (eql (point) (point-min)) + ;; (point) is next char after the word. Must check one char before. + (let ((f (get-text-property (- (point) 1) 'face))) + (memq f flyspell-prog-text-faces)))) ;; Records the binding of M-TAB in effect before flyspell was activated. (defvar flyspell--prev-meta-tab-binding) -- 2.21.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 14 15:14:24 2019 Received: (at 35967) by debbugs.gnu.org; 14 Jun 2019 19:14:24 +0000 Received: from localhost ([127.0.0.1]:37810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbreZ-0006pF-OQ for submit@debbugs.gnu.org; Fri, 14 Jun 2019 15:14:24 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:56163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbreX-0006p6-Co for 35967@debbugs.gnu.org; Fri, 14 Jun 2019 15:14:22 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45QVf41fHNz1rYjh; Fri, 14 Jun 2019 21:14:19 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45QVf30Tfxz1qqkS; Fri, 14 Jun 2019 21:14:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id J8zqJn0no3Nu; Fri, 14 Jun 2019 21:14:18 +0200 (CEST) X-Auth-Info: f5pb0DOR9jCW/kwSBnz63VYM0TySi7A8p5EAyonG+1Bp1txrFvtDR1TzGWlmn4WW Received: from igel.home (ppp-46-244-172-177.dynamic.mnet-online.de [46.244.172.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 14 Jun 2019 21:14:18 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 069F82C1086; Fri, 14 Jun 2019 21:14:15 +0200 (CEST) From: Andreas Schwab To: Alex Branham Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> <857e9sb48z.fsf@gmail.com> <83d0jk9oft.fsf@gnu.org> <87tvcsqbes.fsf@gmail.com> <858su4c92c.fsf@gmail.com> <87pnngqaau.fsf@gmail.com> X-Yow: Catsup and Mustard all over the place! It's the Human Hamburger! Date: Fri, 14 Jun 2019 21:14:15 +0200 In-Reply-To: <87pnngqaau.fsf@gmail.com> (Alex Branham's message of "Fri, 14 Jun 2019 13:41:29 -0500") Message-ID: <87pnngdlo8.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 35967 Cc: 35967@debbugs.gnu.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) On Jun 14 2019, Alex Branham wrote: > diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el > index d18916dfd0..22f9db4363 100644 > --- a/lisp/textmodes/flyspell.el > +++ b/lisp/textmodes/flyspell.el > @@ -423,9 +423,10 @@ flyspell-prog-text-faces > > (defun flyspell-generic-progmode-verify () > "Used for `flyspell-generic-check-word-predicate' in programming modes." > - ;; (point) is next char after the word. Must check one char before. > - (let ((f (get-text-property (- (point) 1) 'face))) > - (memq f flyspell-prog-text-faces))) > + (unless (eql (point) (point-min)) > + ;; (point) is next char after the word. Must check one char before. > + (let ((f (get-text-property (- (point) 1) 'face))) Perhaps change this to (1- (point)). Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 17 15:05:06 2019 Received: (at 35967-done) by debbugs.gnu.org; 17 Jun 2019 19:05:06 +0000 Received: from localhost ([127.0.0.1]:43333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcwwE-0001sn-7N for submit@debbugs.gnu.org; Mon, 17 Jun 2019 15:05:06 -0400 Received: from mail-ot1-f54.google.com ([209.85.210.54]:44406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcwwB-0001s8-5H for 35967-done@debbugs.gnu.org; Mon, 17 Jun 2019 15:05:04 -0400 Received: by mail-ot1-f54.google.com with SMTP id b7so10548045otl.11 for <35967-done@debbugs.gnu.org>; Mon, 17 Jun 2019 12:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=pogIV2k6UkSBEWsMpLEBhK+QfFkR6RDYvFWhQhx3tEM=; b=r1i41K0qeOWZ+1PiZJuCSRfQn70tOj/sNsLiDOAwztaSMxhUgWn+JHTtWRT/fCFAPJ DCtO4qPcTRlarPbXex25TLaZPNtfkDDqIiQ3P0z+oEVAFcfdGW+twyO1lhzvDY35ZlJn 6P3WU9JD0x05FGs60ONcFKAJU05jLAvXetbR0QfwhKcZx2u9d8dhPmkMuIN7kjsnEG/z aOqPSP21kN51aHNwQmO51BBwbHTGHCiYiXKEjRmVG9fdZl/kYRttcvI71rzwenPXNNb7 JHp2XxJSNJM6kN/nF9iWQkV+E+Sdd17pF9AN2WxK0ER3RnOSNUXd9ep6RoV1zJrUiJ0p ZouA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=pogIV2k6UkSBEWsMpLEBhK+QfFkR6RDYvFWhQhx3tEM=; b=n+R2zlFXU2GWGSdRRTaGc6ENZHtbXv7aPJPA/bI3zB/BeqGENTROKJY8A3dfohPNdJ 1ov4r3hS/No5yttz9zuvqmIEMmc1Sr6R7ND/ii8Ca+8LgaN0OauGcjEL3veX4yl4WhGb iI9DQ0PgmJOlGsE1v9WzlCQQJmEf1LTd53sjngRsA1XLqw0eGg+8DaBfenWe2RlzFj6T L2Hm53WvXcqVgjnvN3VFYGSQQbC/5+x3nqLenVSlchwv0GnMTk9CyJn9noqMzrfA3m9s FvJLrPYlKKM5dBiWmnfWuVUEYSKbOuU/KxKqP+rxQ2eA5WgkMoAzSAVuwM7D5fOzXB+V 0x6A== X-Gm-Message-State: APjAAAWh0xoaALEPRk2ZYK4fRU+lBP9YM12FpIUR0AivqYw4ZGlVOGue 3vVywssvzbvpMmRvc4KLZA3X+9oN X-Google-Smtp-Source: APXvYqy9As4hy0HjRbiiWVO7y2AgYHJBaPF1nPrKlMNzY65qpt0+YxhnJZWrnQcer3qINzLlNnJcJw== X-Received: by 2002:a9d:6e93:: with SMTP id a19mr61564147otr.216.1560798297268; Mon, 17 Jun 2019 12:04:57 -0700 (PDT) Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id x128sm5077952oig.54.2019.06.17.12.04.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 12:04:56 -0700 (PDT) References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> <857e9sb48z.fsf@gmail.com> <83d0jk9oft.fsf@gnu.org> <87tvcsqbes.fsf@gmail.com> <858su4c92c.fsf@gmail.com> <87pnngqaau.fsf@gmail.com> <87pnngdlo8.fsf@igel.home> User-agent: mu4e 1.2.0; emacs 27.0.50 From: Alex Branham To: Andreas Schwab Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob In-reply-to: <87pnngdlo8.fsf@igel.home> Date: Mon, 17 Jun 2019 14:04:53 -0500 Message-ID: <871rzshw2y.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35967-done Cc: npostavs@gmail.com, 35967-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri 14 Jun 2019 at 14:14, Andreas Schwab wrote: >> + (let ((f (get-text-property (- (point) 1) 'face))) > > Perhaps change this to (1- (point)). Thanks, I made that change and pushed as 1942f4ccba52896e3e97789dc6b51926ad74c591 on the master branch. Alex From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 08:19:14 2019 Received: (at 35967) by debbugs.gnu.org; 18 Jun 2019 12:19:14 +0000 Received: from localhost ([127.0.0.1]:43881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdD4w-0004D2-Tz for submit@debbugs.gnu.org; Tue, 18 Jun 2019 08:19:11 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdD4v-0004Cq-5p for 35967@debbugs.gnu.org; Tue, 18 Jun 2019 08:19:09 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 155EF443AD8; Tue, 18 Jun 2019 08:19:03 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D145B443AD4; Tue, 18 Jun 2019 08:19:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1560860341; bh=Hgoqe9we7Pz1XmDExzr8TXHs45ysHnbrkBbx8KszNro=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=AgkLCy3t0pDAfWeK99j/3ImjEJWHseAsiKdu0Vz+Ius4kiSp/qv4Ndatn2yqlfvnE /hjO+avMkEgzZZfgGf0Q/B7gglk/OtuT66m8E+ObnS/de/xIqx2F/9T5nQlj7xtzvw jMTfPh2WHMEzYbDqt0exm71BkXIPwTdMMOBOatdS0xJtPdRAUV7PaV7oVnzp525vQ4 JMDTKHBFynRV5jv/eLhgP9q+sDb7Fc1Zw0EOC69yHLG3LVc0XakfXUlCacrErOauPP uhkXbxnW7TUsfMnbbDPhDAsBwXn8C+xQ9YiPJ7/QGRQoFJ/tBrMTBifaAHfOb6T6Ib YnT0KC6zb+PLQ== Received: from alfajor (unknown [157.52.10.58]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 853BB12020E; Tue, 18 Jun 2019 08:19:01 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#35967: [PATCH] avoid flyspell error if point is at bob Message-ID: References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> Date: Tue, 18 Jun 2019 08:18:59 -0400 In-Reply-To: <83pno1xmz1.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 May 2019 19:08:18 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35967 Cc: Alex Branham , 35967@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Am I the only one troubled by that? I find it a lot more clear than (eq (point) (point-min)). But if we start avoiding `bobp`, we should then tweak the byte-compiler to turn (eq (point) (point-min)) into `bobp` for us. Stefan From unknown Tue Sep 09 21:33:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 17 Jul 2019 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator