User: adrian
Date: 05/09/25 22:02:24
Modified: packages/xemacs-packages/texinfo ChangeLog texinfmt.el
texinfo.el
Log:
packages: Fix printindex handling (found by xemacs.texi test case) in texinfm.el, minor sync with GNU Emacs
-------------------- ChangeLog entries follow: --------------------
xemacs-packages/texinfo/ChangeLog addition:
2005-09-25 Adrian Aichner <adrian(a)xemacs.org>
* texinfmt.el: Minor sync with GNU Emacs texinfmt-version "2.41 of
1 Mar 2005".
* texinfmt.el (texinfmt-version): New.
* texinfmt.el (texinfo-format-buffer): Restore use of
coding-system-for-write (sync)
* texinfmt.el (texinfo-pre-format-hook): New.
* texinfmt.el (texinfo-format-region): Run texinfo-pre-format-hook
(sync).
* texinfmt.el (texinfo-format-buffer-1): Use buffer-disable-undo
(sync).
* texinfmt.el (texinfo-append-refill): Generalize refill regexp
(sync).
* texinfmt.el (texinfo-paragraphindent): Use string-to-number (sync).
* texinfmt.el (texinfo-format-printindex): My genuine fix for
Message-ID: <9ea6aaa80503091939552b5e23(a)mail.gmail.com>.
* texinfmt.el (texinfo-print-index): Adjust index entry format (sync).
* texinfo.el: Minor sync with GNU Emacs.
* texinfo.el (texinfo): Typo fix sync.
* texinfo.el (texinfo-mode-hook): New. Not used yet.
* texinfo.el (texinfo-imenu-generic-expression): Typo fix sync.
* texinfo.el (texinfo-environments): Ditto.
* texinfo.el (texinfo-environment-regexp): Ditto.
* texinfo.el (texinfo-font-lock-keywords): Ditto.
* texinfo.el (texinfo-insert-quote): Ditto.
* texinfo.el (texinfo-show-structure): Ditto.
Revision Changes Path
1.38 +28 -0 XEmacs/packages/xemacs-packages/texinfo/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/texinfo/ChangeLog,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -p -r1.37 -r1.38
--- ChangeLog 2005/03/26 19:13:57 1.37
+++ ChangeLog 2005/09/25 20:02:22 1.38
@@ -1,3 +1,31 @@
+2005-09-25 Adrian Aichner <adrian(a)xemacs.org>
+
+ * texinfmt.el: Minor sync with GNU Emacs texinfmt-version "2.41 of
+ 1 Mar 2005".
+ * texinfmt.el (texinfmt-version): New.
+ * texinfmt.el (texinfo-format-buffer): Restore use of
+ coding-system-for-write (sync)
+ * texinfmt.el (texinfo-pre-format-hook): New.
+ * texinfmt.el (texinfo-format-region): Run texinfo-pre-format-hook
+ (sync).
+ * texinfmt.el (texinfo-format-buffer-1): Use buffer-disable-undo
+ (sync).
+ * texinfmt.el (texinfo-append-refill): Generalize refill regexp
+ (sync).
+ * texinfmt.el (texinfo-paragraphindent): Use string-to-number (sync).
+ * texinfmt.el (texinfo-format-printindex): My genuine fix for
+ Message-ID: <9ea6aaa80503091939552b5e23(a)mail.gmail.com>.
+ * texinfmt.el (texinfo-print-index): Adjust index entry format (sync).
+ * texinfo.el: Minor sync with GNU Emacs.
+ * texinfo.el (texinfo): Typo fix sync.
+ * texinfo.el (texinfo-mode-hook): New. Not used yet.
+ * texinfo.el (texinfo-imenu-generic-expression): Typo fix sync.
+ * texinfo.el (texinfo-environments): Ditto.
+ * texinfo.el (texinfo-environment-regexp): Ditto.
+ * texinfo.el (texinfo-font-lock-keywords): Ditto.
+ * texinfo.el (texinfo-insert-quote): Ditto.
+ * texinfo.el (texinfo-show-structure): Ditto.
+
2005-03-26 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.29 released.
1.15 +30 -21 XEmacs/packages/xemacs-packages/texinfo/texinfmt.el
Index: texinfmt.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/texinfo/texinfmt.el,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- texinfmt.el 2005/03/25 17:09:05 1.14
+++ texinfmt.el 2005/09/25 20:02:23 1.15
@@ -48,6 +48,8 @@
(defmacro defcustom (var value doc &rest ignore)
`(defvar ,var ,value ,doc)))
+(defvar texinfmt-version "2.41 of 1 Mar 2005")
+
(or (fboundp 'match-string-no-properties) ;; XEmacs: not in 21.4
(defun match-string-no-properties (num &optional string)
"Return string of text matched by last search, without text properties.
@@ -142,11 +144,9 @@ Non-nil argument (prefix, if interactive
and don't split the file if large. You can use Info-tagify and
Info-split to do these manually."
(interactive "P")
- (let ((lastmessage "Formatting Info file..."))
- ;; XEmacs change.
- ;; FSF Emacs 20.4 hungs up waiting for coding-system if Texinfo file
- ;; contains non ASCII character.
-;;; (coding-system-for-write buffer-file-coding-system))
+ (let ((lastmessage "Formatting Info file...")
+ ;; XEmacs change removed here 2005-09-25.
+ (coding-system-for-write buffer-file-coding-system))
(message lastmessage)
(widen)
(texinfo-format-buffer-1)
@@ -163,6 +163,11 @@ Info-split to do these manually."
(defvar texinfo-region-buffer-name "*Info Region*"
"*Name of the temporary buffer used by \\[texinfo-format-region].")
+(defvar texinfo-pre-format-hook nil
+ "Hook called before the conversion of the Texinfo file to Info format.
+The functions on this hook are called with argument BUFFER, the buffer
+containing the Texinfo file.")
+
;; These come from tex-mode.el.
(defvar tex-start-of-header)
(defvar tex-end-of-header)
@@ -244,6 +249,7 @@ converted to Info is stored in a tempora
input-buffer
(max region-beginning header-end)
region-end)
+ (run-hook-with-args 'texinfo-pre-format-hook input-buffer)
;; Make sure region ends in a newline.
(or (= (preceding-char) ?\n)
(insert "\n"))
@@ -410,6 +416,7 @@ if large. You can use Info-split to do
(find-file outfile)
(texinfo-mode)
(erase-buffer)
+ (buffer-disable-undo)
(message "Formatting Info file: %s" outfile)
(setq texinfo-format-filename
@@ -419,6 +426,7 @@ if large. You can use Info-split to do
(set-syntax-table texinfo-format-syntax-table)
(insert-buffer-substring input-buffer)
+ (run-hook-with-args 'texinfo-pre-format-hook input-buffer)
(message "Converting %s to Info format..." (buffer-name input-buffer))
;; Insert @include files so `texinfo-raise-lower-sections' can
@@ -670,16 +678,16 @@ Do not append @refill to paragraphs cont
;; 4. Else go to end of paragraph and insert @refill
(forward-paragraph)
(forward-line -1)
- (let ((line-beg (point)))
- (end-of-line)
- (delete-region
- (point)
- (save-excursion (skip-chars-backward " \t") (point)))
- (forward-char 1)
- (unless (re-search-backward "@c[ \t\n]\\|@comment[ \t\n]" line-beg t)
- (forward-char -1))
- (unless (re-search-backward "@refill\\|@bye" line-beg t)
- (insert "@refill")))
+ (let ((line-beg (point)))
+ (end-of-line)
+ (delete-region
+ (point)
+ (save-excursion (skip-chars-backward " \t") (point)))
+ (forward-char 1)
+ (unless (re-search-backward "@c[ \t\n]\\|@comment[ \t\n]" line-beg t)
+ (forward-char -1))
+ (unless (re-search-backward "@refill\\|^[ \t]*@" line-beg t)
+ (insert "@refill")))
(forward-line 1))))))
@@ -2856,7 +2864,7 @@ Default is to leave the number of spaces
(let ((arg (texinfo-parse-arg-discard)))
(if (string= "asis" arg)
(setq texinfo-paragraph-indent "asis")
- (setq texinfo-paragraph-indent (string-to-int arg)))))
+ (setq texinfo-paragraph-indent (string-to-number arg)))))
(put 'refill 'texinfo-format 'texinfo-format-refill)
(defun texinfo-format-refill ()
@@ -3062,14 +3070,15 @@ Default is to leave paragraph indentatio
(let ((indexelts (symbol-value
(cdr (assoc (texinfo-parse-arg-discard)
texinfo-indexvar-alist))))
- opoint)
+ opoint npoint)
(insert "\n* Menu:\n\n")
(setq opoint (point))
(texinfo-print-index nil indexelts)
-
+ (setq npoint (point))
(if (memq system-type '(vax-vms windows-nt ms-dos))
- (texinfo-sort-region opoint (point))
- (shell-command-on-region opoint (point) "sort -fd" 1))))
+ (texinfo-sort-region opoint npoint)
+ (shell-command-on-region opoint npoint "sort -fd" 1))
+ (goto-char npoint)))
(defun texinfo-print-index (file indexelts)
(while indexelts
@@ -3083,7 +3092,7 @@ Default is to leave paragraph indentatio
(indent-to 54)
(insert
(if (nth 2 (car indexelts))
- (format " %d." (nth 2 (car indexelts)))
+ (format " (line %3d)" (1+ (nth 2 (car indexelts))))
"")
"\n"))
;; index entries from @include'd file
1.7 +12 -7 XEmacs/packages/xemacs-packages/texinfo/texinfo.el
Index: texinfo.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/texinfo/texinfo.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- texinfo.el 2004/11/08 02:16:19 1.6
+++ texinfo.el 2005/09/25 20:02:23 1.7
@@ -39,7 +39,7 @@
(eval-when-compile (require 'tex-mode) (require 'cl) (require 'regexp-opt))
(defgroup texinfo nil
- "Texinfo Mode"
+ "Texinfo Mode."
:group 'docs)
;;;###autoload
@@ -54,6 +54,12 @@
:type 'string
:group 'texinfo)
+(defcustom texinfo-mode-hook nil
+ "Normal hook run when entering Texinfo mode."
+ :type 'hook
+ :options '(turn-on-auto-fill flyspell-mode)
+ :group 'texinfo)
+
;;; Autoloads:
@@ -304,7 +310,6 @@ chapter."
(defvar texinfo-imenu-generic-expression
'((nil "^@\\(node\\|anchor\\)[ \t]+\\([^,\n]*\\)" 2)
("Chapters" "^@chapter[ \t]+\\(.*\\)$" 1))
-
"Imenu generic expression for Texinfo mode. See `imenu-generic-expression'.")
(defvar texinfo-font-lock-syntactic-keywords
@@ -325,11 +330,11 @@ chapter."
"macro" "menu" "multitable" "quotation" "smalldisplay"
"smallexample" "smallformat" "smalllisp" "table" "tex"
"titlepage" "verbatim" "vtable")
- "List of TeXinfo environments.")
+ "List of Texinfo environments.")
(defconst texinfo-environment-regexp
(concat "^@" (regexp-opt (cons "end" texinfo-environments) t) "\\>")
- "Regexp for environment-like TexInfo list commands.
+ "Regexp for environment-like Texinfo list commands.
Subexpression 1 is what goes into the corresponding `@end' statement.")
(defface texinfo-heading-face
@@ -364,7 +369,7 @@ Subexpression 1 is what goes into the co
;; 1 (texinfo-clone-environment (match-beginning 1) (match-end 1)) keep)
(,(concat "^@" (regexp-opt (mapcar 'car texinfo-section-list) t)
".*\n") 0 texinfo-heading-face t))
- "Additional expressions to highlight in TeXinfo mode.")
+ "Additional expressions to highlight in Texinfo mode.")
(defun texinfo-clone-environment (start end)
(let ((endp nil))
@@ -672,7 +677,7 @@ Puts point on a blank line between them.
(not (match-end 1)))))
(defun texinfo-insert-quote (&optional arg)
- "Insert the appropriate quote mark for TeXinfo.
+ "Insert the appropriate quote mark for Texinfo.
Usually inserts the value of `texinfo-open-quote' (normally ``) or
`texinfo-close-quote' (normally ''), depending on the context.
With prefix argument or inside @code or @example, inserts a plain \"."
@@ -901,7 +906,7 @@ to jump to the corresponding spot in the
(progn
(beginning-of-line)
(buffer-substring (point) (progn (end-of-line) (point)))))
- ;; else point is located before before any section command
+ ;; else point is located before any section command.
(setq current-location "tex")))
;; Second, create and format an *Occur* buffer
(save-excursion