From: kaoru Date: Fri, 14 Jul 2000 08:50:46 +0000 (+0000) Subject: * WL-MK (wl-texinfo-format-file): require ptexinfmt. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29032d5ec6f01039855af72e6d722e0c6350c5fe;p=elisp%2Fwanderlust.git * WL-MK (wl-texinfo-format-file): require ptexinfmt. * utils/ptexinfmt.el: provide feature. --- diff --git a/ChangeLog b/ChangeLog index f1d5b12..3151d07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-07-14 TAKAHASHI Kaoru + + * WL-MK (wl-texinfo-format-file): require ptexinfmt. + * utils/ptexinfmt.el: provide feature. + 2000-07-13 TAKAHASHI Kaoru * utils/ptexinfmt.el: New file. diff --git a/WL-MK b/WL-MK index 09cb8f7..3cbe79c 100644 --- a/WL-MK +++ b/WL-MK @@ -3,8 +3,6 @@ ;;; ;;; Original by OKUNISHI Fujikazu ;;; Modified by Yuuichi Teranishi -;;; -;;; Time-stamp: <2000-03-30 15:55:13 teranisi> ;;;;;;;;;;;;;;;;;;;;; DO NOT EDIT THIS FILE ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; INTERNAL USE ONLY ;;;;;;;;;;;;;;;;;;;;; @@ -249,15 +247,8 @@ (let (obuf beg) (find-file (expand-file-name texifile DOCDIR)) (setq obuf (current-buffer)) - ;; texinfmt.el 2.37 or earlier can't format @direntry - (require 'texinfmt) - (unless (fboundp 'texinfo-format-direntry) - (goto-char (point-min)) - (when (re-search-forward "^@direntry" nil t) - (replace-match "@ifinfo\nSTART-INFO-DIR-ENTRY")) - (when (re-search-forward "^@end direntry" nil t) - (replace-match "END-INFO-DIR-ENTRY\n@end ifinfo")) - (set-buffer-modified-p nil)) + ;; Support old texinfmt.el + (require 'ptexinfmt) ;; We can't know file names if splitted. (texinfo-format-buffer t) ;; Emacs20.2's default is 'raw-text-unix. diff --git a/utils/ptexinfmt.el b/utils/ptexinfmt.el index bf001c6..127c8b5 100644 --- a/utils/ptexinfmt.el +++ b/utils/ptexinfmt.el @@ -35,6 +35,8 @@ (require 'poe) (require 'broken) +(provide 'ptexinfmt) + ;;; Fix broken facility ;; @var (broken-facility texinfo-format-var @@ -46,7 +48,7 @@ (insert "@var{@asis{foo}}\n") (texinfo-format-expand-region (point-min) (point-max)) t)) - (error nil))) + (error nil))) (when-broken texinfo-format-var (defun texinfo-format-var () @@ -72,14 +74,24 @@ (texinfo-discard-command) (insert "*Note ") (let ((fname (or (nth 1 args) (nth 2 args)))) - (if (null (or fname (nth 3 args))) - (insert (car args) "::") - (insert (or fname (car args)) ": ") - (if (nth 3 args) - (insert "(" (nth 3 args) ")")) - (and (car args) (insert (car args)))))))) + (if (null (or fname (nth 3 args))) + (insert (car args) "::") + (insert (or fname (car args)) ": ") + (if (nth 3 args) + (insert "(" (nth 3 args) ")")) + (and (car args) (insert (car args)))))))) ;;; Directory File +;; @direcategory +(put 'dircategory 'texinfo-format 'texinfo-format-dircategory) +(defun-maybe texinfo-format-dircategory () + (let ((str (texinfo-parse-arg-discard))) + (delete-region (point) + (progn + (skip-chars-forward " ") + (point))) + (insert "INFO-DIR-SECTION " str "\n"))) + ;; @direntry (put 'direntry 'texinfo-format 'texinfo-format-direntry) (defun-maybe texinfo-format-direntry () @@ -93,16 +105,6 @@ (insert "END-INFO-DIR-ENTRY\n\n") (texinfo-pop-stack 'direntry)) -;; @direcategory -(put 'dircategory 'texinfo-format 'texinfo-format-dircategory) -(defun-maybe texinfo-format-dircategory () - (let ((str (texinfo-parse-arg-discard))) - (delete-region (point) - (progn - (skip-chars-forward " ") - (point))) - (insert "INFO-DIR-SECTION " str "\n"))) - ;;; Menus ;; @detailmenu ... @end detailmenu @@ -139,7 +141,8 @@ (defun-maybe texinfo-format-option () "Insert ` ... ' around arg unless inside a table; in that case, no quotes." ;; `looking-at-backward' not available in v. 18.57, 20.2 - (if (not (search-backward "\010" ; searched-for character is a control-H + ;; searched-for character is a control-H + (if (not (search-backward "\010" (save-excursion (beginning-of-line) (point)) t)) (insert "`" (texinfo-parse-arg-discard) "'") @@ -161,7 +164,7 @@ otherwise, insert URL-TITLE followed by URL in parentheses." (texinfo-discard-command) ;; if url-title (if (nth 1 args) - (insert (nth 1 args) " (" (nth 0 args) ")") + (insert (nth 1 args) " (" (nth 0 args) ")") (insert "`" (nth 0 args) "'")) (goto-char texinfo-command-start))) @@ -179,8 +182,8 @@ otherwise, insert URL-TITLE followed by URL in parentheses." (put 'endifnotinfo 'texinfo-format 'texinfo-discard-line) (defun-maybe texinfo-format-ifnotinfo () (delete-region texinfo-command-start - (progn (re-search-forward "@end ifnotinfo[ \t]*\n") - (point)))) + (progn (re-search-forward "@end ifnotinfo[ \t]*\n") + (point)))) ;;; Defining New Texinfo Commands @@ -188,7 +191,7 @@ otherwise, insert URL-TITLE followed by URL in parentheses." (put 'alias 'texinfo-format 'texinfo-alias) (defun-maybe texinfo-alias () (let ((start (1- (point))) - args) + args) (skip-chars-forward " ") (save-excursion (end-of-line) (setq texinfo-command-end (point))) (if (not (looking-at "\\([^=]+\\)=\\(.*\\)")) @@ -217,149 +220,149 @@ otherwise, insert URL-TITLE followed by URL in parentheses." ;;; Accents and so on -;; @pounds{} ==> # Pounds Sterling +;; @pounds{} ==> # Pounds Sterling (put 'pounds 'texinfo-format 'texinfo-format-pounds) (defun-maybe texinfo-format-pounds () (texinfo-parse-arg-discard) (insert "#")) -;; @OE{} ==> OE French-OE-ligature +;; @OE{} ==> OE French-OE-ligature (put 'OE 'texinfo-format 'texinfo-format-French-OE-ligature) (defun-maybe texinfo-format-French-OE-ligature () - (insert "OE" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "OE" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @oe{} ==> oe +;; @oe{} ==> oe (put 'oe 'texinfo-format 'texinfo-format-French-oe-ligature) -(defun-maybe texinfo-format-French-oe-ligature () ; lower case - (insert "oe" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) +(defun-maybe texinfo-format-French-oe-ligature () ; lower case + (insert "oe" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @AA{} ==> AA Scandinavian-A-with-circle +;; @AA{} ==> AA Scandinavian-A-with-circle (put 'AA 'texinfo-format 'texinfo-format-Scandinavian-A-with-circle) (defun-maybe texinfo-format-Scandinavian-A-with-circle () - (insert "AA" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "AA" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @aa{} ==> aa +;; @aa{} ==> aa (put 'aa 'texinfo-format 'texinfo-format-Scandinavian-a-with-circle) -(defun-maybe texinfo-format-Scandinavian-a-with-circle () ; lower case - (insert "aa" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) +(defun-maybe texinfo-format-Scandinavian-a-with-circle () ; lower case + (insert "aa" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @AE{} ==> AE Latin-Scandinavian-AE +;; @AE{} ==> AE Latin-Scandinavian-AE (put 'AE 'texinfo-format 'texinfo-format-Latin-Scandinavian-AE) (defun-maybe texinfo-format-Latin-Scandinavian-AE () - (insert "AE" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "AE" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @ae{} ==> ae +;; @ae{} ==> ae (put 'ae 'texinfo-format 'texinfo-format-Latin-Scandinavian-ae) -(defun-maybe texinfo-format-Latin-Scandinavian-ae () ; lower case - (insert "ae" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) +(defun-maybe texinfo-format-Latin-Scandinavian-ae () ; lower case + (insert "ae" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @ss{} ==> ss German-sharp-S +;; @ss{} ==> ss German-sharp-S (put 'ss 'texinfo-format 'texinfo-format-German-sharp-S) (defun-maybe texinfo-format-German-sharp-S () - (insert "ss" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "ss" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @questiondown{} ==> ? upside-down-question-mark +;; @questiondown{} ==> ? upside-down-question-mark (put 'questiondown 'texinfo-format 'texinfo-format-upside-down-question-mark) (defun-maybe texinfo-format-upside-down-question-mark () - (insert "?" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "?" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @exclamdown{} ==> ! upside-down-exclamation-mark +;; @exclamdown{} ==> ! upside-down-exclamation-mark (put 'exclamdown 'texinfo-format 'texinfo-format-upside-down-exclamation-mark) (defun-maybe texinfo-format-upside-down-exclamation-mark () - (insert "!" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "!" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @L{} ==> L/ Polish suppressed-L (Lslash) +;; @L{} ==> L/ Polish suppressed-L (Lslash) (put 'L 'texinfo-format 'texinfo-format-Polish-suppressed-L) (defun-maybe texinfo-format-Polish-suppressed-L () - (insert (texinfo-parse-arg-discard) "/L") - (goto-char texinfo-command-start)) + (insert (texinfo-parse-arg-discard) "/L") + (goto-char texinfo-command-start)) -;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case) +;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case) (put 'l 'texinfo-format 'texinfo-format-Polish-suppressed-l-lower-case) (defun-maybe texinfo-format-Polish-suppressed-l-lower-case () - (insert (texinfo-parse-arg-discard) "/l") - (goto-char texinfo-command-start)) + (insert (texinfo-parse-arg-discard) "/l") + (goto-char texinfo-command-start)) -;; @O{} ==> O/ Scandinavian O-with-slash +;; @O{} ==> O/ Scandinavian O-with-slash (put 'O 'texinfo-format 'texinfo-format-Scandinavian-O-with-slash) (defun-maybe texinfo-format-Scandinavian-O-with-slash () - (insert (texinfo-parse-arg-discard) "O/") - (goto-char texinfo-command-start)) + (insert (texinfo-parse-arg-discard) "O/") + (goto-char texinfo-command-start)) -;; @o{} ==> o/ Scandinavian O-with-slash (lower case) +;; @o{} ==> o/ Scandinavian O-with-slash (lower case) (put 'o 'texinfo-format 'texinfo-format-Scandinavian-o-with-slash-lower-case) (defun-maybe texinfo-format-Scandinavian-o-with-slash-lower-case () - (insert (texinfo-parse-arg-discard) "o/") - (goto-char texinfo-command-start)) + (insert (texinfo-parse-arg-discard) "o/") + (goto-char texinfo-command-start)) -;; @,{c} ==> c, cedilla accent +;; @,{c} ==> c, cedilla accent (put ', 'texinfo-format 'texinfo-format-cedilla-accent) (defun-maybe texinfo-format-cedilla-accent () - (insert (texinfo-parse-arg-discard) ",") + (insert (texinfo-parse-arg-discard) ",") (goto-char texinfo-command-start)) -;; @dotaccent{o} ==> .o overdot-accent +;; @dotaccent{o} ==> .o overdot-accent (put 'dotaccent 'texinfo-format 'texinfo-format-overdot-accent) (defun-maybe texinfo-format-overdot-accent () - (insert "." (texinfo-parse-arg-discard)) + (insert "." (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) -;; @ubaraccent{o} ==> _o underbar-accent +;; @ubaraccent{o} ==> _o underbar-accent (put 'ubaraccent 'texinfo-format 'texinfo-format-underbar-accent) (defun-maybe texinfo-format-underbar-accent () - (insert "_" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "_" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @udotaccent{o} ==> o-. underdot-accent +;; @udotaccent{o} ==> o-. underdot-accent (put 'udotaccent 'texinfo-format 'texinfo-format-underdot-accent) (defun-maybe texinfo-format-underdot-accent () - (insert (texinfo-parse-arg-discard) "-.") - (goto-char texinfo-command-start)) + (insert (texinfo-parse-arg-discard) "-.") + (goto-char texinfo-command-start)) -;; @H{o} ==> ""o long Hungarian umlaut +;; @H{o} ==> ""o long Hungarian umlaut (put 'H 'texinfo-format 'texinfo-format-long-Hungarian-umlaut) (defun-maybe texinfo-format-long-Hungarian-umlaut () - (insert "\"\"" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "\"\"" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @ringaccent{o} ==> *o ring accent +;; @ringaccent{o} ==> *o ring accent (put 'ringaccent 'texinfo-format 'texinfo-format-ring-accent) (defun-maybe texinfo-format-ring-accent () - (insert "*" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "*" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @tieaccent{oo} ==> [oo tie after accent +;; @tieaccent{oo} ==> [oo tie after accent (put 'tieaccent 'texinfo-format 'texinfo-format-tie-after-accent) (defun-maybe texinfo-format-tie-after-accent () - (insert "[" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "[" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @u{o} ==> (o breve accent +;; @u{o} ==> (o breve accent (put 'u 'texinfo-format 'texinfo-format-breve-accent) (defun-maybe texinfo-format-breve-accent () - (insert "(" (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert "(" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) -;; @v{o} ==> i dotless i and dotless j +;; @dotless{i} ==> i dotless i and dotless j (put 'dotless 'texinfo-format 'texinfo-format-dotless) (defun-maybe texinfo-format-dotless () - (insert (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) + (insert (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) ;;; ptexinfmt.el ends here