(require 'poe)
(require 'broken)
+(provide 'ptexinfmt)
+
;;; Fix broken facility
;; @var
(broken-facility texinfo-format-var
(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 ()
(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 ()
(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
(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) "'")
(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)))
(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
(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 "\\([^=]+\\)=\\(.*\\)"))
;;; 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} ==> <o hacek accent
+;; @v{o} ==> <o hacek accent
(put 'v 'texinfo-format 'texinfo-format-hacek-accent)
(defun-maybe texinfo-format-hacek-accent ()
- (insert "<" (texinfo-parse-arg-discard))
- (goto-char texinfo-command-start))
+ (insert "<" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
-;; @dotless{i} ==> 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