From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mJfJEGH/RGDlbAAA0tVLHw (envelope-from ) for ; Sun, 07 Mar 2021 16:29:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AGJ4DGH/RGDJOwAAB5/wlQ (envelope-from ) for ; Sun, 07 Mar 2021 16:29:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ED3EB22823 for ; Sun, 7 Mar 2021 17:29:18 +0100 (CET) Received: from localhost ([::1]:57440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIwHN-00033m-Tp for larch@yhetil.org; Sun, 07 Mar 2021 11:29:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIwFb-00024i-7p for emacs-orgmode@gnu.org; Sun, 07 Mar 2021 11:27:27 -0500 Received: from mout02.posteo.de ([185.67.36.66]:50459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIwFY-0003Ct-Of for emacs-orgmode@gnu.org; Sun, 07 Mar 2021 11:27:27 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id C5BB72400FC for ; Sun, 7 Mar 2021 17:27:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1615134439; bh=xl7c7AAn8ZgZU/yDfHVOlAiHwFfMU8q2kbqsGoJZzH8=; h=To:From:Subject:Date:From; b=hnRtfcoStElGlCjmmIWA6ML6uAv9BG+bruBOImCHTg9Z7sdiBlgqz6K0M3we0LGuo KiDR8HxFiNM2AEb8pm6N9XbbhUkXwpb7LsLBV2ZaW+pNWwU4xHWSEyJk1xw1xIiFfZ 4GBRxtkvMttuHqX2PV1vE+FblOOZvxflYyWLveKJCudhg+erYQ8HOLbIcrKTrMReVK 4uhYUytdYiMEoaZxXHqA5GbLDtEH7lEFkf/MUlF0OBKe6LRsk+JJVxkNqEQnNm5ddR M1xUv6isBfrrtwTy6BVRa98xNppSDVMA3TF8NuZQmL6HIbi5/zz9nJpmSlGLq0Oy24 YfaKypXE/qUnA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Dtn1g0FPmz6tmG for ; Sun, 7 Mar 2021 17:27:18 +0100 (CET) To: emacs-orgmode@gnu.org From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Subject: [PATCH] org-compat.el (org-mode-flyspell-verify): Do not spell check code in headline Message-ID: <8d13a201-8243-9c7a-93eb-48f1d7fb9ec5@posteo.eu> Date: Sun, 7 Mar 2021 17:27:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------8BF759B5E1CE6B7BDE8BFDCE" Content-Language: fr Received-SPF: pass client-ip=185.67.36.66; envelope-from=sebastien.miquel@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sebastien.miquel@posteo.eu Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615134559; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Soa7CHN0oRxQ99zsqjU++l2BKpac4M4z0n0YU2fDfZE=; b=hhlasD2CH0T+n+lZsVWlJQXi5UCVXSgEUA/LFBmAfrzOjXUWyXIkGC0RdSlTsVKSPT1Mn6 BMc75rzCWa8g65+bpIylMwoEE7MSUIIeRh6xvreKROITjHnL+if6/o1+61923Ud9B8oIOY fg09p/9S18B3nTmoknkz1AhXD0fTPY55wJqC9OkCC8wyDLwW6Z0e2Gdwd4wSgsesFzpH7c jJYF+4K7BQh+oY7L/T2oJdkjUb5ArWm7/3JFfr+NB7STYoJElo1mjwj4cJ0lFEbGVfDB51 Y0N+KTcML3T/7cqtFnKd6z1T1mx/HUwmdqyNFPqzKCCU2l/F5WdxwhlygQzgPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615134559; a=rsa-sha256; cv=none; b=hRlYLxkp2z8hb9v2y6j3wE8kPPtVcQGNT9HNTmNmOOn/77YGDOp0ncztUCflblugaCbPM0 EUHflbQxFcpJhnlv5ikuLytRD5vxcVSsRDOldnhoT1uzkHMQzfkkigDdE/SMMn/o5mJnXO IuPiVidWYBlGUZwai+pkRiUj1+Yhq/gamAtz0U3CNoeKTh1fc1ZM4AB2YnBTFm84IEK+mT D1At4dPu82vDgr2k/v7KaAc51zphxw7Y4HBIu9W5PRQomc+JFzgodnkmQZmI+4CCEwNwSQ Zx+quIDDYxNvURiZY9nvrmwGeH9X5d4RbdQove/abA6qXLU2CbNo488pIEWfrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=hnRtfcoS; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.07 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=hnRtfcoS; dmarc=pass (policy=none) header.from=posteo.eu; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: ED3EB22823 X-Spam-Score: -3.07 X-Migadu-Scanner: scn1.migadu.com X-TUID: Q6BT+Y9aNdJh This is a multi-part message in MIME format. --------------8BF759B5E1CE6B7BDE8BFDCE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Currently code and verbatim snippets, and LaTeX fragments are spell checked by `flyspell` if they're in a headline. The attached patch fixes that. -- Sébastien Miquel --------------8BF759B5E1CE6B7BDE8BFDCE Content-Type: text/x-patch; charset=UTF-8; name="0001-org-compat.el-org-mode-flyspell-verify-Do-not-check-.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-org-compat.el-org-mode-flyspell-verify-Do-not-check-.pa"; filename*1="tch" >From b4291ce0ea455af499e75d3c9313183a0e8f46ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Sun, 7 Mar 2021 17:06:34 +0100 Subject: [PATCH] org-compat.el (org-mode-flyspell-verify): Do not check code in headline * lisp/org-compat.el (org-mode-flyspell-verify): Do not spell check code, verbatim and LaTeX fragments in headline title. --- lisp/org-compat.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 8cbf33137..3d45bed7f 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -1025,8 +1025,7 @@ ELEMENT is the element at point." (defun org-mode-flyspell-verify () "Function used for `flyspell-generic-check-word-predicate'." (if (org-at-heading-p) - ;; At a headline or an inlinetask, check title only. This is - ;; faster than relying on `org-element-at-point'. + ;; At a headline or an inlinetask, check title only. (and (save-excursion (beginning-of-line) (and (let ((case-fold-search t)) (not (looking-at-p "\\*+ END[ \t]*$"))) @@ -1035,7 +1034,9 @@ ELEMENT is the element at point." (match-beginning 4) (>= (point) (match-beginning 4)) (or (not (match-beginning 5)) - (< (point) (match-beginning 5)))) + (< (point) (match-beginning 5))) + ;; Ignore checks in code, verbatim and others. + (org--flyspell-object-check-p (org-element-at-point))) (let* ((element (org-element-at-point)) (post-affiliated (org-element-property :post-affiliated element))) (cond -- 2.30.1 --------------8BF759B5E1CE6B7BDE8BFDCE--