X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/41b7f8bc6c4511ab6fcf7f6b1f9e7fdcd8592821..b57c1741abfb95da1dc6c165339551daff2ca3e1:/lisp/textmodes/texinfmt.el diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index cb87c1198f..55be7fe9df 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -1,7 +1,7 @@ ;;; texinfmt.el --- format Texinfo files into Info files -;; Copyright (C) 1985-1986, 1988, 1990-1998, 2000-2012 -;; Free Software Foundation, Inc. +;; Copyright (C) 1985-1986, 1988, 1990-1998, 2000-2016 Free Software +;; Foundation, Inc. ;; Maintainer: Robert J. Chassell ;; Keywords: maint, tex, docs @@ -34,7 +34,7 @@ If optional argument HERE is non-nil, insert info at point." (interactive "P") (let ((version-string - (format "Version of \`texinfmt.el\': %s" texinfmt-version))) + (format-message "Version of `texinfmt.el': %s" texinfmt-version))) (if here (insert version-string) (if (called-interactively-p 'interactive) @@ -330,25 +330,24 @@ converted to Info is stored in a temporary buffer." (let ((arg (texinfo-parse-arg-discard))) (insert " " texinfo-region-buffer-name - " buffer for: `") + (format-message " buffer for: `")) (insert (file-name-nondirectory (expand-file-name arg))) - (insert "', -*-Text-*-\n"))) + (insert (format-message "', -*-Text-*-\n")))) ;; Else no `@setfilename' line (insert " " texinfo-region-buffer-name " buffer -*-Text-*-\n")) - (insert "produced by `texinfo-format-region'\n" + (insert (format-message "produced by `texinfo-format-region'\n") "from a region in: " (if (buffer-file-name input-buffer) - (concat "`" - (file-name-sans-versions - (file-name-nondirectory - (buffer-file-name input-buffer))) - "'") - (concat "buffer `" (buffer-name input-buffer) "'")) - "\nusing `texinfmt.el' version " - texinfmt-version - ".\n\n") + (format-message "`%s'" + (file-name-sans-versions + (file-name-nondirectory + (buffer-file-name input-buffer)))) + (format-message "buffer `%s'" (buffer-name input-buffer))) + (format-message "\nusing `texinfmt.el' version ") + texinfmt-version + ".\n\n") ;; Now convert for real. (goto-char (point-min)) @@ -479,19 +478,18 @@ if large. You can use `Info-split' to do this manually." ;; Insert info about how this file was made. (insert "Info file: " texinfo-format-filename ", -*-Text-*-\n" - "produced by `texinfo-format-buffer'\n" + (format-message "produced by `texinfo-format-buffer'\n") ;; Date string removed so that regression testing is easier. ;; "on " ;; (insert (format-time-string "%e %b %Y")) " " "from file" (if (buffer-file-name input-buffer) - (concat " `" + (format-message " `%s'" (file-name-sans-versions (file-name-nondirectory - (buffer-file-name input-buffer))) - "'") - (concat "buffer `" (buffer-name input-buffer) "'")) - "\nusing `texinfmt.el' version " + (buffer-file-name input-buffer)))) + (format-message "buffer `%s'" (buffer-name input-buffer))) + (format-message "\nusing `texinfmt.el' version ") texinfmt-version ".\n\n") ;; Return data for indices. @@ -893,7 +891,7 @@ commands." ;; @ is followed by a command-word; find the end of the word. (setq texinfo-command-start (1- (point))) (if (= (char-syntax (following-char)) ?w) - (forward-word 1) + (forward-word-strictly 1) (forward-char 1)) (setq texinfo-command-end (point)) ;; Detect the case of two @-commands in a row; @@ -1045,7 +1043,7 @@ Leave point after argument." (setq texinfo-command-end (point))) (t (error - "Invalid `texinfo-optional-braces-discard' format \(need braces?\)"))) + "Invalid `texinfo-optional-braces-discard' format (need braces?)"))) (delete-region texinfo-command-start texinfo-command-end))) (defun texinfo-format-parse-line-args () @@ -1192,7 +1190,7 @@ Leave point after argument." (forward-paragraph) (let ((end (point))) (if (save-excursion - (backward-word 1) + (backward-word-strictly 1) (search-forward "@refill" end t)) (setq anchor-string "@anchor-yes-refill") (setq anchor-string "@anchor-no-refill"))) @@ -1287,7 +1285,7 @@ Leave point after argument." (put 'uref 'texinfo-format 'texinfo-format-uref) (defun texinfo-format-uref () "Format URL and optional URL-TITLE. -Insert ` ... ' around URL if no URL-TITLE argument; +Insert \\=` ... \\=' around URL if no URL-TITLE argument; otherwise, insert URL-TITLE followed by URL in parentheses." (let ((args (texinfo-format-parse-args))) (texinfo-discard-command) @@ -2005,7 +2003,7 @@ commands that are defined in texinfo.tex for printed output. (error "In @multitable, @columnfractions misspelled")) ;; Case 1: @columnfractions .25 .3 .45 ((looking-at "@columnfractions") - (forward-word 1) + (forward-word-strictly 1) (while (not (eolp)) (push (truncate (1- @@ -2120,7 +2118,7 @@ This command is executed when texinfmt sees @item inside @multitable." ;; Delete the @tab command, including the @-sign (delete-region (point) - (progn (forward-word -1) (1- (point))))) + (progn (forward-word-strictly -1) (1- (point))))) (point))) ;; Set fill-column *wider* than needed to produce inter-column space (setq fill-column (+ 1 @@ -2338,7 +2336,7 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image." ;; Write a `@definfoenclose' command on a line and follow it with three ;; arguments separated by commas (commas are used as separators in an ;; `@node' line in the same way). The first argument to -;; `@definfoenclose' is the @-command name \(without the `@'\); the +;; `@definfoenclose' is the @-command name (without the `@'); the ;; second argument is the Info start delimiter string; and the third ;; argument is the Info end delimiter string. The latter two arguments ;; enclose the highlighted text in the Info file. A delimiter string @@ -2447,7 +2445,7 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image." ;; not lead to inserted ` ... ' in a table, but does elsewhere. (put 'option 'texinfo-format 'texinfo-format-option) (defun texinfo-format-option () - "Insert ` ... ' around arg unless inside a table; in that case, no quotes." + "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 "" ; searched-for character is a control-H (line-beginning-position) @@ -2493,8 +2491,8 @@ surrounded by in angle brackets." 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?`!`." +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)))) @@ -3127,7 +3125,7 @@ Default is to leave paragraph indentation as is." ;; (put '\` 'texinfo-format 'texinfo-format-grave-accent) ;; (defun texinfo-format-grave-accent () ;; (texinfo-discard-command) -;; (insert "\`")) +;; (insert "`")) ;; ;; @' ==> ' acute accent ;; (put '\' 'texinfo-format 'texinfo-format-acute-accent)