From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Branham Newsgroups: gmane.emacs.bugs Subject: bug#35967: [PATCH] avoid flyspell error if point is at bob Date: Fri, 14 Jun 2019 13:17:31 -0500 Message-ID: <87tvcsqbes.fsf@gmail.com> References: <87h89e8g3a.fsf@gmail.com> <83pno1xmz1.fsf@gnu.org> <857e9sb48z.fsf@gmail.com> <83d0jk9oft.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4292"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.2.0; emacs 27.0.50 Cc: 35967@debbugs.gnu.org, npostavs@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 14 20:33:36 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hbr15-0000z9-PN for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jun 2019 20:33:35 +0200 Original-Received: from localhost ([::1]:54142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbr13-00023w-74 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jun 2019 14:33:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50150) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbqm3-0001HE-Ms for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 14:18:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbqm2-0008KJ-H1 for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 14:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52453) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbqm2-0008KC-D5 for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 14:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hbqm2-0005Nj-6m for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 14:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jun 2019 18:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35967 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35967-submit@debbugs.gnu.org id=B35967.156053626420656 (code B ref 35967); Fri, 14 Jun 2019 18:18:02 +0000 Original-Received: (at 35967) by debbugs.gnu.org; 14 Jun 2019 18:17:44 +0000 Original-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 Original-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 Original-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) Original-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) In-reply-to: <83d0jk9oft.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160565 Archived-At: --=-=-= 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 --=-=-=--