auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-devel] checkdoc patch


From: Masayuki Ataka
Subject: [AUCTeX-devel] checkdoc patch
Date: Sat, 27 Jan 2007 01:16:21 +0900 (JST)

Hi,

Ikumi-San runs `M-x checkdoc' in tex.el, tex-buf.el and latex.el,
and sent me a patch, which is attached at the end of this mail.
# He also added the definition of `plain-TeX-mode-hook',
# which is defined implicitly, and added small code fixes, too.

His patch seems good to me.
If no objection, I'll commit this.

regards,
---
email: address@hidden
Name:: Masayuki Ataka // (Japan)


--- tex.el-11.84        Tue Jan  9 06:55:56 2007
+++ tex.el      Thu Jan 18 17:40:57 2007
@@ -1,7 +1,7 @@
 ;;; tex.el --- Support for TeX documents.
 
 ;; Copyright (C) 1985, 1986, 1987, 1991, 1993, 1994, 1996, 1997, 1999, 2000,
-;;   2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
 ;; Keywords: tex
@@ -89,7 +89,7 @@
   "*Command used to print a file.
 
 First `%p' is expanded to the printer name, then ordinary expansion is
-performed as specified in `TeX-expand-list'.  If it is `nil',
+performed as specified in `TeX-expand-list'.  If it is nil,
 then customization is requested."
   :group 'TeX-command
   :type '(choice (string :tag "Print command")
@@ -133,7 +133,7 @@
   "*Command used to show the status of a printer queue.
 
 First `%p' is expanded to the printer name, then ordinary expansion is
-performed as specified in `TeX-expand-list'.  If this is `nil',
+performed as specified in `TeX-expand-list'.  If this is nil,
 the printer has no corresponding command."
   :group 'TeX-command
   :type '(choice (string :tag "Queue check command")
@@ -254,8 +254,7 @@
 mode.  If it should only be present in some modes, specify a list with
 the respective mode names.
 
-Any additional elements get just transferred to the respective menu entries.
-"
+Any additional elements get just transferred to the respective menu entries."
   :group 'TeX-command
   :type '(repeat (group :value ("" "" TeX-run-command nil t)
                        (string :tag "Name")
@@ -356,7 +355,7 @@
 The first element of each entry is the printer name.
 
 The second element is the command used to print to this
-printer.  It defaults to the value of `TeX-print-command' when `nil'.
+printer.  It defaults to the value of `TeX-print-command' when nil.
 
 The third element is the command used to examine the print queue for
 this printer.  It defaults to the value of `TeX-queue-command' similarly.
@@ -883,7 +882,7 @@
 If CHANGED is non-nil, it indicates which global mode
 may have changed so that all corresponding buffers
 without a local value might get their name updated.
-A value ot `t' will thus update all buffer names.
+A value of t will thus update all buffer names.
 
 If LOCAL is non-nil and CHANGED is buffer-local, only
 a local change has been performed and only the local
@@ -2466,6 +2465,11 @@
 
 ;;; Plain TeX mode
 
+(defcustom plain-TeX-mode-hook nil
+  "A hook run in plain TeX mode buffers."
+  :type 'hook
+  :group 'TeX-misc)
+
 ;;;###autoload
 (defun TeX-plain-tex-mode ()
   "Major mode in AUCTeX for editing plain TeX files.
@@ -2902,7 +2906,7 @@
   (make-variable-buffer-local 'TeX-auto-x-regexp-list)
 
 (defun TeX-regexp-group-count (regexp)
-  "Return number of groups in a regexp.  This is not foolproof:
+  "Return number of groups in a REGEXP.  This is not foolproof:
 you should not use something like `[\\(]' for a character range."
   (let (start (n 0))
     (while (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\([^?]"
@@ -3202,7 +3206,7 @@
                                   (nth 1 format-spec))))
                         (if (eq TeX-kpathsea-path-delimiter t)
                             (throw 'no-kpathsea
-                                   (setq kpathsea-path-delimiter nil))
+                                   (setq TeX-kpathsea-path-delimiter nil))
                           (error "kpsewhich error")))))
               result)
           (when (eq TeX-kpathsea-path-delimiter t)
--- tex-buf.el-11.84    Mon Oct 16 08:53:26 2006
+++ tex-buf.el  Thu Jan 18 17:41:04 2007
@@ -1,7 +1,7 @@
 ;;; tex-buf.el --- External commands for AUCTeX.
 
 ;; Copyright (C) 1991, 1993, 1996, 2001, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
 ;; Keywords: tex, wp
@@ -158,11 +158,11 @@
 
 If the master file for the document has a header, it is written to the
 temporary file before the region itself.  The document's header is all
-text before TeX-header-end.
+text before `TeX-header-end'.
 
 If the master file for the document has a trailer, it is written to
 the temporary file before the region itself.  The document's trailer is
-all text after TeX-trailer-start."
+all text after `TeX-trailer-start'."
   (interactive "P")
   ;; Note that TeX-command-region-begin is not a marker when called
   ;; from TeX-command-buffer.
@@ -183,7 +183,7 @@
   "Run TeX on the current buffer.
 
 Query the user for a command to run on the temporary file specified by
-the variable TeX-region.  The region file file be recreated from the
+the variable `TeX-region'.  The region file file be recreated from the
 visible part of the buffer.
 
 If a prefix argument OVERRIDE-CONFIRM is given, confirmation will
@@ -232,7 +232,7 @@
 
 (defun TeX-next-error (reparse)
   "Find the next error in the TeX output buffer.
-Prefix by C-u to start from the beginning of the errors."
+With \\[universal-argument] prefix, start from the beginning of the errors."
   (interactive "P")
   (if (null (TeX-active-buffer))
       (next-error reparse)
@@ -324,7 +324,7 @@
 (defun TeX-check-files (derived originals extensions)
   "Check that DERIVED is newer than any of the ORIGINALS.
 Try each original with each member of EXTENSIONS, in all directories
-in TeX-check-path."
+in `TeX-check-path'."
   (let ((found nil)
        (regexp (concat "\\`\\("
                        (mapconcat (lambda (dir)
@@ -394,7 +394,7 @@
       default)))
 
 (defvar TeX-command-next nil
-  "The default command next time TeX-command is invoked.")
+  "The default command next time `TeX-command' is invoked.")
 
  (make-variable-buffer-local 'TeX-command-next)
 
@@ -443,7 +443,7 @@
     ""))
 
 (defun TeX-output-extension ()
-  "Get the extension of the current TeX output file"
+  "Get the extension of the current TeX output file."
   (if (listp TeX-output-extension)
       (car TeX-output-extension)
     (or (TeX-process-get-variable (TeX-active-master)
@@ -523,7 +523,9 @@
     (setq mode-name name)
     (if TeX-show-compilation
        (display-buffer buffer)
-      (message "Type `C-c C-l' to display results of compilation."))
+      (message "Type `%s' to display results of compilation."
+              (substitute-command-keys
+               "\\<TeX-mode-map>\\[TeX-recenter-output-buffer]")))
     (setq TeX-parse-function 'TeX-parse-command)
     (setq TeX-command-default default)
     (setq TeX-sentinel-function
@@ -547,7 +549,7 @@
                    TeX-shell-command-option command))))
 
 (defun TeX-run-set-command (name command)
-  "Remember TeX command to use to NAME and set corresponding output extension"
+  "Remember TeX command to use to NAME and set corresponding output extension."
   (setq TeX-command-default name
        TeX-output-extension (if TeX-PDF-mode "pdf" "dvi"))
   (let ((case-fold-search t)
@@ -687,7 +689,7 @@
   "Run TeX interactively.
 Run command in a buffer (in comint-shell-mode) so that it accepts user
 interaction. If you return to the file buffer after the TeX run,
-Error parsing on C-x ` should work with a bit of luck."
+Error parsing on \\[next-error] should work with a bit of luck."
   (TeX-run-set-command name command)
   (require 'comint)
   (let ((default TeX-command-default)
@@ -807,7 +809,7 @@
 
 
 (defvar TeX-sentinel-default-function (lambda (process name))
-  "Default for TeX-sentinel-function. To be set in major mode.
+  "Default for `TeX-sentinel-function'.  To be set in major mode.
 Hook to cleanup TeX command buffer after temination of PROCESS.
 NAME is the name of the process.")
 
@@ -821,7 +823,7 @@
     (setq TeX-command-next TeX-command-Show)))
 
 (defun TeX-current-pages ()
-  ;; String indictating the number of pages formatted.
+  "Return string indictating the number of pages formatted."
   (cond ((null TeX-current-page)
         "some pages.")
        ((string-match "[^0-9]1[^0-9]" TeX-current-page)
@@ -845,8 +847,9 @@
   (if process (TeX-format-mode-line process))
   (if (re-search-forward "^\\(!\\|.*:[0-9]+:\\) " nil t)
       (progn
-       (message (concat name " errors in `" (buffer-name)
-                        "'. Use C-c ` to display."))
+       (message "%s errors in `%s'. Use %s to display." name (buffer-name)
+                (substitute-command-keys
+                 "\\<TeX-mode-map>\\[TeX-next-error]"))
        (setq TeX-command-next TeX-command-default)
        ;; error reported to TeX-error-report-switches
        (setq TeX-error-report-switches
@@ -939,8 +942,10 @@
     ;; Tell the user their number so that she sees whether the
     ;; situation is getting better or worse.
     (message (concat "BibTeX finished with %s %s. "
-                    "Type `C-c C-l' to display output.")
-            (match-string 1) (match-string 2)))
+                    "Type `%s' to display output.")
+            (match-string 1) (match-string 2)
+            (substitute-command-keys
+             "\\<TeX-mode-map>\\[TeX-recenter-output-buffer]")))
    (t
     (message (concat "BibTeX finished successfully. "
                     "Run LaTeX again to get citations right."))))
@@ -1163,7 +1168,7 @@
   file)
 
 (defun TeX-region-create (file region original offset)
-  "Create a new file named FILE with the string REGION
+  "Create a new file named FILE with the string REGION.
 The region is taken from ORIGINAL starting at line OFFSET.
 
 The current buffer and master file is searched, in order to ensure
@@ -1275,7 +1280,7 @@
                 TeX-region))))
 
 (defcustom TeX-region "_region_"
-  "*Base name for temporary file for use with TeX-region."
+  "*Base name of temporary file for `TeX-command-region' and 
`TeX-command-buffer'."
   :group 'TeX-command
   :type 'string)
 
@@ -1289,12 +1294,12 @@
  (make-variable-buffer-local 'TeX-error-point)
 
 (defvar TeX-error-file nil
-  "Stack of files in which errors have occured")
+  "Stack of files in which errors have occured.")
 
  (make-variable-buffer-local 'TeX-error-file)
 
 (defvar TeX-error-offset nil
-  "Add this to any line numbers from TeX.  Stack like TeX-error-file.")
+  "Add this to any line numbers from TeX.  Stack like `TeX-error-file'.")
 
  (make-variable-buffer-local 'TeX-error-offset)
 
@@ -1315,11 +1320,10 @@
 
 (defun TeX-parse-TeX (reparse)
   "Find the next error produced by running TeX.
-Prefix by C-u to start from the beginning of the errors.
+With \\[universal-argument] prefix, start from the beginning of the errors.
 
 If the file occurs in an included file, the file is loaded (if not
 already in an Emacs buffer) and the cursor is placed at the error."
-
   (let ((old-buffer (current-buffer))
        (default-major-mode major-mode))
     (pop-to-buffer (TeX-active-buffer))
@@ -1652,7 +1656,7 @@
 enumerated list, has received a number greater than 26. Either you're
 making a very long list or you've been resetting counter values.
 
-2. Footnotes are being ``numbered'' with letters or footnote symbols 
+2. Footnotes are being ``numbered'' with letters or footnote symbols
 and LaTeX has run out of letters or symbols. This is probably caused
 by too many \\thanks commands.")
 
@@ -2014,10 +2018,10 @@
 
     (".*" . "No help available"))      ; end definition
 "A list of the form (\"err-regexp\" . \"context\") used by function
-\\{TeX-help-error} to display help-text on an error message or warning.
+`TeX-help-error' to display help-text on an error message or warning.
 err-regexp should be a regular expression matching the error message
 given from TeX/LaTeX, and context should be some lines describing that
-error"
+error."
   :group 'TeX-output
   :type '(repeat (cons :tag "Entry"
                       (regexp :tag "Match")
--- latex.el-11.84      Fri Dec 29 22:40:48 2006
+++ latex.el    Fri Jan 19 07:16:07 2007
@@ -1,7 +1,7 @@
 ;;; latex.el --- Support for LaTeX documents.
 
 ;; Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
-;;   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;;   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
 ;; Keywords: tex
@@ -1583,8 +1583,8 @@
                (setq options (funcall var))
              (when (symbol-value var)
                (setq options
-                     (mapconcat 'identity 
-                                (TeX-completing-read-multiple 
+                     (mapconcat 'identity
+                                (TeX-completing-read-multiple
                                  "Options: " (mapcar 'list (symbol-value var)))
                                 ","))))
          (setq options (read-string "Options: ")))
@@ -1605,7 +1605,7 @@
   "List of the non-local TeX input files.
 
 Initialized once at the first time you prompt for an input file.
-May be reset with `C-u \\[TeX-normal-mode]'.")
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
 
 (defun TeX-arg-input-file (optionel &optional prompt local)
   "Prompt for a tex or sty file.
@@ -1640,7 +1640,7 @@
   "Association list of BibTeX style files.
 
 Initialized once at the first time you prompt for an input file.
-May be reset with `C-u \\[TeX-normal-mode]'.")
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
 
 (defun TeX-arg-bibstyle (optional &optional prompt)
   "Prompt for a BibTeX style file."
@@ -1665,7 +1665,7 @@
   "Association list of BibTeX files.
 
 Initialized once at the first time you prompt for an BibTeX file.
-May be reset with `C-u \\[TeX-normal-mode]'.")
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
 
 (defun TeX-arg-bibliography (optional &optional prompt)
   "Prompt for a BibTeX database file."
@@ -3081,8 +3081,7 @@
          (looking-at (concat "^[ \t]*" TeX-comment-start-regexp
                              "\\(" TeX-comment-start-regexp "\\|[ \t]\\)*")))
        (setq has-comment t
-             comment-fill-prefix (buffer-substring-no-properties
-                                  (match-beginning 0) (match-end 0))))
+             comment-fill-prefix (TeX-match-buffer 0)))
        ;; A line with some code, followed by a comment?
        ((and (setq code-comment-start (save-excursion
                                        (beginning-of-line)
@@ -3213,7 +3212,7 @@
               (make-string (current-column) ?\ ))
             (progn
               (looking-at (concat TeX-comment-start-regexp "+[ \t]*"))
-              (buffer-substring (match-beginning 0) (match-end 0)))))
+              (TeX-match-buffer 0))))
       (fill-region-as-paragraph beg (line-beginning-position 2)
                                justify-flag  nil
                                (save-excursion
@@ -4281,8 +4280,6 @@
     (insert "{\\cal " (char-to-string char) "}"))
   (if dollar (insert "$")))
 
-(provide 'latex)
-
 ;;; Keymap
 
 (defvar LaTeX-mode-map
@@ -5224,15 +5221,13 @@
        (search-forward-regexp
         "\\documentstyle\\[\\([^]]*\\)\\]{\\([^}]*\\)}"
         (point-max) t)
-       (setq optstr (buffer-substring-no-properties (match-beginning 1) 
(match-end 1))
-             docstyle (buffer-substring-no-properties (match-beginning 2)
-             (match-end 2))
+       (setq optstr (TeX-match-buffer 1)
+             docstyle (TeX-match-buffer 2)
              optlist (TeX-split-string "," optstr))
       (if (search-forward-regexp
           "\\documentstyle{\\([^}]*\\)}"
           (point-max) t)
-         (setq docstyle (buffer-substring-no-properties (match-beginning 1)
-         (match-end 1)))
+         (setq docstyle (TeX-match-buffer 1))
        (error "No documentstyle defined")))
     (beginning-of-line 1)
     (setq docline (point))
@@ -5261,5 +5256,7 @@
        (while (re-search-forward "\\\\blackandwhite{" nil t)
       (replace-match "\\\\input{" nil nil)))))
   (TeX-normal-mode nil))
+
+(provide 'latex)
 
 ;;; latex.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]