unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Agustin Martin <agustin.martin@hispalinux.es>
To: Leo <sdl.web@gmail.com>, 6761@debbugs.gnu.org
Subject: bug#6761: 23.2; flyspell-prog-mode in TeX mode
Date: Fri, 12 Nov 2010 17:59:14 +0100	[thread overview]
Message-ID: <20101112165914.GA8167@agmartin.aq.upm.es> (raw)
In-Reply-To: <m1mxt9zgk7.fsf@cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

On Fri, Jul 30, 2010 at 06:26:00AM +0100, Leo wrote:
> When flyspell-prog-mode is turned on a TeX buffer, anything that has a
> trailing % will be checked, for example
> 
>   bookmarksnumbered%
> 
> This is incorrect as the word is neither doc string nor comment. I run
> into this bug fairly often in LaTeX class and style files.

I finally had time to look at this and seems I found the problem.
flyspell-prog-mode just checks that face is not one of the faces selected as
text faces, but does that in the char right after the word, so in

auto%

checks face in the % char getting font-lock-comment-face instead of nil as
should be for a not-to-be-checked word.

I am playing with attached patch that tries to make sure that check is done 
in the final character of the word, not in the next char outside it.

Will test a bit more and commit if no problems are found.

Thanks for your feedback,

-- 
Agustin

[-- Attachment #2: flyspell-prog-mode.0.diff --]
[-- Type: text/x-diff, Size: 542 bytes --]

--- flyspell.el.orig	2010-10-20 13:56:38.000000000 +0200
+++ flyspell.el	2010-11-12 17:15:52.000000000 +0100
@@ -1063,7 +1063,9 @@
            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))))
+		   (save-excursion
+		     (goto-char (- (nth 2 flyspell-word) 1))
+		     (not (funcall flyspell-generic-check-word-predicate)))))
 	  t
 	(progn
 	  ;; destructure return flyspell-word info list.

  reply	other threads:[~2010-11-12 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30  5:26 bug#6761: 23.2; flyspell-prog-mode in TeX mode Leo
2010-11-12 16:59 ` Agustin Martin [this message]
2010-11-15 13:28   ` Agustin Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101112165914.GA8167@agmartin.aq.upm.es \
    --to=agustin.martin@hispalinux.es \
    --cc=6761@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).