1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 10:31:37 -08:00

* lisp/emacs-lisp/checkdoc.el (checkdoc-syntax-table): Fix last change.

(checkdoc-sentencespace-region-engine, checkdoc-this-string-valid)
(checkdoc-proper-noun-region-engine): Use with-syntax-table.
This commit is contained in:
Stefan Monnier 2010-11-15 16:40:30 -05:00
parent ae76d9e11e
commit cca982d001
2 changed files with 81 additions and 87 deletions

View file

@ -1,3 +1,9 @@
2010-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/checkdoc.el (checkdoc-syntax-table): Fix last change.
(checkdoc-sentencespace-region-engine, checkdoc-this-string-valid)
(checkdoc-proper-noun-region-engine): Use with-syntax-table.
2010-11-15 Agustín Martín <agustin.martin@hispalinux.es>
* textmodes/flyspell.el (flyspell-generic-progmode-verify):

View file

@ -434,7 +434,7 @@ be re-created.")
;; When dealing with syntax in doc strings, make sure that - are
;; encompassed in words so we can use cheap \\> to get the end of a symbol,
;; not the end of a word in a conglomerate.
(modify-syntax-entry ?- "w" checkdoc-syntax-table)
(modify-syntax-entry ?- "w" st)
st)
"Syntax table used by checkdoc in document strings.")
@ -1370,12 +1370,8 @@ See the style guide in the Emacs Lisp manual for more details."
documentation string")
(point) (+ (point) 1) t)))))
(if (and (not err) (looking-at "\""))
(let ((old-syntax-table (syntax-table)))
(unwind-protect
(progn
(set-syntax-table checkdoc-syntax-table)
(with-syntax-table checkdoc-syntax-table
(checkdoc-this-string-valid-engine fp))
(set-syntax-table old-syntax-table)))
err)))
(defun checkdoc-this-string-valid-engine (fp)
@ -1987,11 +1983,8 @@ internally skip over no answers.
If the offending word is in a piece of quoted text, then it is skipped."
(save-excursion
(let ((case-fold-search nil)
(errtxt nil) bb be
(old-syntax-table (syntax-table)))
(unwind-protect
(progn
(set-syntax-table checkdoc-syntax-table)
(errtxt nil) bb be)
(with-syntax-table checkdoc-syntax-table
(goto-char begin)
(while (re-search-forward checkdoc-proper-noun-regexp end t)
(let ((text (match-string 1))
@ -2029,7 +2022,6 @@ If the offending word is in a piece of quoted text, then it is skipped."
"Name %s should appear capitalized as %s"
text (capitalize text))
bb b be e)))))))
(set-syntax-table old-syntax-table))
(if errtxt (checkdoc-create-error errtxt bb be)))))
(defun checkdoc-sentencespace-region-engine (begin end)
@ -2037,11 +2029,8 @@ If the offending word is in a piece of quoted text, then it is skipped."
(if sentence-end-double-space
(save-excursion
(let ((case-fold-search nil)
(errtxt nil) bb be
(old-syntax-table (syntax-table)))
(unwind-protect
(progn
(set-syntax-table checkdoc-syntax-table)
(errtxt nil) bb be)
(with-syntax-table checkdoc-syntax-table
(goto-char begin)
(while (re-search-forward "[^ .0-9]\\(\\. \\)[^ \n]" end t)
(let ((b (match-beginning 1))
@ -2073,7 +2062,6 @@ If the offending word is in a piece of quoted text, then it is skipped."
(setq errtxt
"There should be two spaces after a period"
bb b be e)))))))
(set-syntax-table old-syntax-table))
(if errtxt (checkdoc-create-error errtxt bb be))))))
;;; Ispell engine