;; Modified by Yamaoka not to use APEL functions.
+;; Unimplemented command:
+;; @abbr
+;; @float, @caption, @shortcaption, @listoffloats
+;; @deftypecv[x]
+;; @headitem
+;; @comma{}
+;; @quotation (optional arguments)
+;; @acronym (optional argument)
+;; @dofirstparagraphindent
+;; @indent
+;; @verbatiminclude
+;; @\
+;; @definfoenclose
+;; @deftypeivar
+;; @deftypeop
+
;;; Code:
(require 'backquote)
;;; Broken
(defvar ptexinfmt-disable-broken-notice-flag t
"If non-nil disable notice, when call `ptexinfmt-broken-facility'.
-This is NO-NOTICE argument in `ptexinfmt-broken-facility'.")
+This is last argument in `ptexinfmt-broken-facility'.")
(put 'ptexinfmt-broken-facility 'lisp-indent-function 'defun)
(defmacro ptexinfmt-broken-facility (facility docstring assertion
- &optional no-notice)
+ &optional dummy)
"Declare a symbol FACILITY is broken if ASSERTION is nil.
-DOCSTRING will be printed if ASSERTION is nil and NO-NOTICE is nil."
+DOCSTRING will be printed if ASSERTION is nil and
+`ptexinfmt-disable-broken-notice-flag' is nil."
(` (let ((facility '(, facility))
(docstring (, docstring))
(assertion (eval '(, assertion))))
(if assertion
nil
(put facility 'broken-docstring docstring)
- (if (, no-notice)
+ (if ptexinfmt-disable-broken-notice-flag
nil
(message "BROKEN FACILITY DETECTED: %s" docstring))))))
;;; (string< texinfmt-version "2.37 of 24 May 1997")
(boundp 'MULE) (not (featurep 'meadow))) ; Mule for Windows
nil
- t)
- ptexinfmt-disable-broken-notice-flag)
+ t))
;; @var
(ptexinfmt-broken-facility texinfo-format-var
(insert "@var{@asis{foo}}\n")
(texinfo-format-expand-region (point-min) (point-max))
t))
- (error nil))
- ptexinfmt-disable-broken-notice-flag)
+ (error nil)))
;; @xref
(ptexinfmt-broken-facility texinfo-format-xref
(insert "@xref{, xref, , file}\n")
(texinfo-format-expand-region (point-min) (point-max))
t))
- (error nil))
- ptexinfmt-disable-broken-notice-flag)
+ (error nil)))
;; @uref
(ptexinfmt-broken-facility texinfo-format-uref
(with-temp-buffer
(let (texinfo-enclosure-list texinfo-alias-list)
(texinfo-mode)
- (insert "@uref{mailto:foo@@bar.com}\n")
+ (insert "@uref{mailto:foo@@noncommand.example.com}\n")
(texinfo-format-expand-region (point-min) (point-max))
t))
- (error nil))
- ptexinfmt-disable-broken-notice-flag)
+ (error nil)))
;; @multitable
(ptexinfmt-broken-facility texinfo-multitable-widths
nil
t)))
;; function definition is void
- t)
- ptexinfmt-disable-broken-notice-flag)
+ t))
(ptexinfmt-broken-facility texinfo-multitable-item
"`texinfo-multitable-item' unsupport wide-char."
- (not (get 'texinfo-multitable-widths 'broken))
- ptexinfmt-disable-broken-notice-flag)
+ (not (get 'texinfo-multitable-widths 'broken)))
;;; Hardcopy and HTML (discard)
(put 'page 'texinfo-format 'texinfo-discard-line)
(put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg)
+;; @slanted{} (makeinfo 4.8 or later)
+(put 'slanted 'texinfo-format 'texinfo-format-noop)
+
+;; @tie{} (makeinfo 4.3 or later)
+(put 'tie 'texinfo-format 'texinfo-format-tie)
+(ptexinfmt-defun-if-void texinfo-format-tie ()
+ (texinfo-parse-arg-discard)
+ (insert " "))
\f
;;; Directory File
(put 'ifnotplaintext 'texinfo-format 'texinfo-discard-line)
(put 'ifnotplaintext 'texinfo-end 'texinfo-discard-command)
+;; @ifnotdocbook ... @end ifnotdocbook (makeinfo 4.7 or later)
+(put 'ifnotdocbook 'texinfo-format 'texinfo-discard-line)
+(put 'ifnotdocbook 'texinfo-end 'texinfo-discard-command)
+
;; @ifnotinfo ... @end ifnotinfo (makeinfo 3.11 or later)
(put 'ifnotinfo 'texinfo-format 'texinfo-format-ifnotinfo)
(progn (re-search-forward "@end html[ \t]*\n")
(point))))
+;; @docbook ... @end docbook (makeinfo 4.7 or later)
+(put 'docbook 'texinfo-format 'texinfo-format-docbook)
+(ptexinfmt-defun-if-void texinfo-format-docbook ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end docbook[ \t]*\n")
+ (point))))
+
;; @ifhtml ... @end ifhtml (makeinfo 3.8 or later)
(put 'ifhtml 'texinfo-format 'texinfo-format-ifhtml)
(defun texinfo-format-ifhtml ()
(progn (re-search-forward "@end ifplaintext[ \t]*\n")
(point))))
+;; @ifdocbook ... @end ifdocbook (makeinfo 4.7 or later)
+(put 'ifdocbook 'texinfo-format 'texinfo-format-ifdocbook)
+(ptexinfmt-defun-if-void texinfo-format-ifdocbook ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end ifdocbook[ \t]*\n")
+ (point))))
+
\f
;;; Marking
-;; @url, @env, @command
-(put 'url 'texinfo-format 'texinfo-format-code)
+;; @indicateurl, @url, @env, @command,
(put 'env 'texinfo-format 'texinfo-format-code)
(put 'command 'texinfo-format 'texinfo-format-code)
+(put 'indicateurl 'texinfo-format 'texinfo-format-code)
+(put 'url 'texinfo-format 'texinfo-format-uref) ; Texinfo 4.7
+
;; @acronym
(put 'acronym 'texinfo-format 'texinfo-format-var)
;; @option
(put 'option 'texinfo-format 'texinfo-format-option)
-(defun texinfo-format-option ()
+(ptexinfmt-defun-if-void 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
;; searched-for character is a control-H
(insert (texinfo-parse-arg-discard)))
(goto-char texinfo-command-start))
+;; @verb{<char>TEXT<char>} (makeinfo 4.1 or later)
+(put 'verb 'texinfo-format 'texinfo-format-verb)
+(ptexinfmt-defun-if-void texinfo-format-verb ()
+ "Format text between non-quoted unique delimiter characters verbatim.
+Enclose the verbatim text, including the delimiters, in braces. Print
+text exactly as written (but not the delimiters) in a fixed-width.
+
+For example, @verb\{|@|\} results in @ and
+@verb\{+@'e?`!`+} results in @'e?`!`."
+
+ (let ((delimiter (buffer-substring-no-properties
+ (1+ texinfo-command-end) (+ 2 texinfo-command-end))))
+ (unless (looking-at "{")
+ (error "Not found: @verb start brace"))
+ (delete-region texinfo-command-start (+ 2 texinfo-command-end))
+ (search-forward delimiter))
+ (delete-backward-char 1)
+ (unless (looking-at "}")
+ (error "Not found: @verb end brace"))
+ (delete-char 1))
\f
+;;; @LaTeX, @registeredsymbol{}
+(put 'LaTeX 'texinfo-format 'texinfo-format-LaTeX)
+(ptexinfmt-defun-if-void texinfo-format-LaTeX ()
+ (texinfo-parse-arg-discard)
+ (insert "LaTeX"))
+
+(put 'registeredsymbol 'texinfo-format 'texinfo-format-registeredsymbol)
+(ptexinfmt-defun-if-void texinfo-format-registeredsymbol ()
+ (texinfo-parse-arg-discard)
+ (insert "(R)"))
+
;;; Accents and Special characters
;; @pounds{} ==> # Pounds Sterling
(put 'pounds 'texinfo-format 'texinfo-format-pounds)
(texinfo-parse-arg-discard)
(insert "#"))
+;; @ordf{} ==> a Spanish feminine
+(put 'ordf 'texinfo-format 'texinfo-format-ordf)
+(ptexinfmt-defun-if-void texinfo-format-ordf ()
+ (texinfo-parse-arg-discard)
+ (insert "o"))
+
+;; @ordm{} ==> o Spanish masculine
+(put 'ordm 'texinfo-format 'texinfo-format-ordm)
+(ptexinfmt-defun-if-void texinfo-format-ordm ()
+ (texinfo-parse-arg-discard)
+ (insert "o"))
+
;; @OE{} ==> OE French-OE-ligature
(put 'OE 'texinfo-format 'texinfo-format-French-OE-ligature)
(ptexinfmt-defun-if-void texinfo-format-French-OE-ligature ()
(ptexinfmt-defun-if-void texinfo-format-soft-hyphen ()
(texinfo-discard-command))
+;; @/
+(put '\/ 'texinfo-format 'texinfo-format-\/)
+(ptexinfmt-defun-if-void texinfo-format-\/ ()
+ (texinfo-discard-command))
+
\f
;;; Cross References
;; @ref, @xref
(unless (null (nth 0 args))
(insert (nth 0 args)))))))
-;; @uref
+;; @uref{URL [,TEXT] [,REPLACEMENT]}
(put 'uref 'texinfo-format 'texinfo-format-uref)
(ptexinfmt-defun-if-broken texinfo-format-uref ()
"Format URL and optional URL-TITLE.
(texinfo-discard-command))))
\f
+;;; Indent
+;; @exampleindent INDENT (makeinfo 4.0 or later)
+
+;; @paragraphindent INDENT (makeinfo 4.0 or later)
+;; INDENT: asis, 0, n
+
+;; @firstparagraphindent WORD (makeinfo 4.6 or later)
+;; WORD: none, insert
+
+
+\f
;;; Special
-;; @image{FILENAME, [WIDTH], [HEIGHT]}
+;; @image{FILENAME [, WIDTH] [, HEIGHT]}
(put 'image 'texinfo-format 'texinfo-format-image)
(ptexinfmt-defun-if-void texinfo-format-image ()
;; I don't know makeinfo parse FILENAME.
(message "Reading included file: %s...done" filename)))
-;; @exampleindent
-
-
\f
;;; @multitable ... @end multitable
(ptexinfmt-defvar-if-void texinfo-extra-inter-column-width 0