Commit 056cb3a1 authored by Agustín Martín's avatar Agustín Martín
Browse files

ispell.el (ispell-region): Do not prefix sent string by comment in autoconf mode

    
 This commit changes some of the `in-comment' ocurrences to more specific
 `add-comment', set only if comment prefix is to be added.
    
 When in comment, old code prefixed string by comment string to let ispell
 know this is part of a comment string.
    
 This is only supported in some modes. In particular, this is not supported in
 autoconf mode where adding the comment string messes everything up because
 ispell tries to spellcheck the `dnl' string header causing misalignments in
 some cases (debbugs.gnu.org: #12768).
parent b159a1fd
......@@ -13,6 +13,9 @@
(ispell-buffer-with-debug): New function that creates a debugging
buffer and calls `ispell-buffer' with debugging enabled.
 
* textmodes/ispell.el (ispell-region): Do not prefix sent string by
comment in autoconf mode. (Bug#12768)
2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
 
* emacs-lisp/byte-opt.el (toplevel): Add compare-window-configurations,
......
......@@ -3006,15 +3006,23 @@ amount for last line processed."
(marker-position ispell-region-end))))
(let* ((ispell-start (point))
(ispell-end (min (point-at-eol) reg-end))
;; See if line must be prefixed by comment string to let ispell know this is
;; part of a comment string. This is only supported in some modes.
;; In particular, this is not supported in autoconf mode where adding the
;; comment string messes everything up because ispell tries to spellcheck the
;; `dnl' string header causing misalignments in some cases (debbugs.gnu.org: #12768).
(add-comment (and in-comment
(not (string= in-comment "dnl "))
in-comment))
(string (ispell-get-line
ispell-start ispell-end in-comment)))
ispell-start ispell-end add-comment)))
(ispell-print-if-debug
(format
"ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [string]: [%s]\n"
ispell-start ispell-end (point-at-eol) in-comment string))
(if in-comment ; account for comment chars added
(setq ispell-start (- ispell-start (length in-comment))
in-comment nil))
"ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [add-comment]: [%s], [string]: [%s]\n"
ispell-start ispell-end (point-at-eol) in-comment add-comment string))
(if add-comment ; account for comment chars added
(setq ispell-start (- ispell-start (length add-comment))
add-comment nil))
(setq ispell-end (point)) ; "end" tracks region retrieved.
(if string ; there is something to spell check!
;; (special start end)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment