aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-11-06 18:44:13 -0700
committerGlenn Morris2010-11-06 18:44:13 -0700
commit76fc02b654eda5dfa1e83b0b9909b097a105785d (patch)
tree74f1cb00e74ce6bd02528cee0cae5f32731446c1
parente180ab9fdeb1d60d229d8170b76008ba33321001 (diff)
downloademacs-76fc02b654eda5dfa1e83b0b9909b097a105785d.tar.gz
emacs-76fc02b654eda5dfa1e83b0b9909b097a105785d.zip
Minor checkdoc simplifications.
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Use end-of-line N. (checkdoc-this-string-valid-engine, checkdoc-file-comments-engine): Use line-end-position.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/checkdoc.el26
2 files changed, 14 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fdecddeb38c..a1f951a6edd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12010-11-07 Glenn Morris <rgm@gnu.org> 12010-11-07 Glenn Morris <rgm@gnu.org>
2 2
3 * emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
4 Use end-of-line N.
5 (checkdoc-this-string-valid-engine, checkdoc-file-comments-engine):
6 Use line-end-position.
7
3 * emacs-lisp/chart.el (chart-zap-chars): 8 * emacs-lisp/chart.el (chart-zap-chars):
4 * play/decipher.el (decipher-set-map): 9 * play/decipher.el (decipher-set-map):
5 * progmodes/ada-mode.el (ada-get-current-indent) 10 * progmodes/ada-mode.el (ada-get-current-indent)
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index ac8e8943a24..a7fe7d02ac0 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1486,12 +1486,10 @@ regexp short cuts work. FP is the function defun information."
1486 "First line not a complete sentence. Add RET here? " 1486 "First line not a complete sentence. Add RET here? "
1487 "\n" t) 1487 "\n" t)
1488 (let (l1 l2) 1488 (let (l1 l2)
1489 (forward-line 1) 1489 (end-of-line 2)
1490 (end-of-line)
1491 (setq l1 (current-column) 1490 (setq l1 (current-column)
1492 l2 (save-excursion 1491 l2 (save-excursion
1493 (forward-line 1) 1492 (end-of-line 2)
1494 (end-of-line)
1495 (current-column))) 1493 (current-column)))
1496 (if (> (+ l1 l2 1) 80) 1494 (if (> (+ l1 l2 1) 80)
1497 (setq msg "Incomplete auto-fix; doc string \ 1495 (setq msg "Incomplete auto-fix; doc string \
@@ -1508,10 +1506,7 @@ may require more formatting")
1508 (forward-line 1) 1506 (forward-line 1)
1509 (beginning-of-line) 1507 (beginning-of-line)
1510 (if (and (re-search-forward "[.!?:\"]\\([ \t\n]+\\|\"\\)" 1508 (if (and (re-search-forward "[.!?:\"]\\([ \t\n]+\\|\"\\)"
1511 (save-excursion 1509 (line-end-position) t)
1512 (end-of-line)
1513 (point))
1514 t)
1515 (< (current-column) numc)) 1510 (< (current-column) numc))
1516 (if (checkdoc-autofix-ask-replace 1511 (if (checkdoc-autofix-ask-replace
1517 p (1+ p) 1512 p (1+ p)
@@ -1526,9 +1521,7 @@ may require more formatting")
1526 (if msg 1521 (if msg
1527 (checkdoc-create-error msg s (save-excursion 1522 (checkdoc-create-error msg s (save-excursion
1528 (goto-char s) 1523 (goto-char s)
1529 (end-of-line) 1524 (line-end-position))))))))
1530 (point)))
1531 nil) ))))
1532 ;; Continuation of above. Make sure our sentence is capitalized. 1525 ;; Continuation of above. Make sure our sentence is capitalized.
1533 (save-excursion 1526 (save-excursion
1534 (skip-chars-forward "\"\\*") 1527 (skip-chars-forward "\"\\*")
@@ -1628,7 +1621,7 @@ function,command,variable,option or symbol." ms1))))))
1628 (if (and (< (point) e) (> (current-column) 80)) 1621 (if (and (< (point) e) (> (current-column) 80))
1629 (checkdoc-create-error 1622 (checkdoc-create-error
1630 "Some lines are over 80 columns wide" 1623 "Some lines are over 80 columns wide"
1631 s (save-excursion (goto-char s) (end-of-line) (point)) )))) 1624 s (save-excursion (goto-char s) (line-end-position))))))
1632 ;; Here we deviate to tests based on a variable or function. 1625 ;; Here we deviate to tests based on a variable or function.
1633 ;; We must do this before checking for symbols in quotes because there 1626 ;; We must do this before checking for symbols in quotes because there
1634 ;; is a chance that just such a symbol might really be an argument. 1627 ;; is a chance that just such a symbol might really be an argument.
@@ -1773,9 +1766,8 @@ function,command,variable,option or symbol." ms1))))))
1773 (end-of-line) 1766 (end-of-line)
1774 ;; check string-continuation 1767 ;; check string-continuation
1775 (if (checkdoc-char= (preceding-char) ?\\) 1768 (if (checkdoc-char= (preceding-char) ?\\)
1776 (progn (forward-line 1) 1769 (line-end-position 2)
1777 (end-of-line))) 1770 (point))))
1778 (point)))
1779 (rs nil) replace original (case-fold-search t)) 1771 (rs nil) replace original (case-fold-search t))
1780 (while (and (not rs) 1772 (while (and (not rs)
1781 (re-search-forward 1773 (re-search-forward
@@ -2253,8 +2245,8 @@ Code:, and others referenced in the style guide."
2253 (insert ";;; " fn fe " --- " (read-string "Summary: ") "\n")) 2245 (insert ";;; " fn fe " --- " (read-string "Summary: ") "\n"))
2254 (checkdoc-create-error 2246 (checkdoc-create-error
2255 "The first line should be of the form: \";;; package --- Summary\"" 2247 "The first line should be of the form: \";;; package --- Summary\""
2256 (point-min) (save-excursion (goto-char (point-min)) (end-of-line) 2248 (point-min) (save-excursion (goto-char (point-min))
2257 (point)))) 2249 (line-end-position))))
2258 nil)) 2250 nil))
2259 (setq 2251 (setq
2260 err 2252 err