unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Patch: Texinfo M-x auto-insert
@ 2007-10-03 14:13 Aaron Hawley
  2007-10-06  1:52 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Hawley @ 2007-10-03 14:13 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Attached is a patch against autoinsert.el that adds support to M-x
auto-insert for Texinfo files.  It is based on the "Emacs Lisp Header"
action in autoinsert.el.  The Texinfo source is based on material in the
"Sample
Texinfo files" section of the Texinfo manual.  auto-insert will prompt the
user for a title and a short description, then inserts 73 lines of Texinfo
source.

I chose not to insert the stock Texinfo file suggested for GNU manuals,
since the majority of Texinfo files started this way will probably not be
GNU manuals.

However, the file does license the document under the GNU FDL with no
invariant sections or cover texts.  It provides an FDL copyright notice and
"@include"s fdl.texi as an appending section.  A Texinfo comment explains
that the fdl.texi is available from the GNU Web site.

Thanks for Emacs,
/a

-- 
Modern man suffers from a kind of poverty of the spirit which
stands in glaring contrast to his scientific and technological
abundance. We've learned to fly the air like birds, we've learned
to swim the seas as fish, yet we haven't learned to walk the
earth as brothers and sisters. -- Dr. Martin King

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: autoinsert.el-texinfo.diff --]
[-- Type: text/x-patch; name="autoinsert.el-texinfo.diff", Size: 2654 bytes --]

--- autoinsert.el	25 Sep 2007 10:42:46 -0000	1.51
+++ autoinsert.el	3 Oct 2007 14:05:21 -0000
@@ -212,7 +212,88 @@
 \(provide '"
        (file-name-sans-extension (file-name-nondirectory (buffer-file-name)))
        ")
-\;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n"))
+\;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n")
+    (("\\.texi\\(nfo\\)?\\'" . "Texinfo file skeleton")
+     "Title: "
+     "\\input texinfo   @c -*-texinfo-*-
+@c %**start of header
+@setfilename "
+     (file-name-sans-extension
+      (file-name-nondirectory (buffer-file-name))) ".info\n"
+      "@settitle " str "
+@c %**end of header
+@copying\n"
+      (setq short-description (read-string "Short description: "))
+      ".\n\n"
+      "Copyright @copyright{} " (substring (current-time-string) -4) "  "
+      (getenv "ORGANIZATION") | (progn user-full-name) "
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, and no Cover Texts.  A copy of the license is
+included in the section entitled ``GNU Free Documentation License.''
+
+A copy of the license is also available from the Free Software
+Foundation Web site at @url{http://www.gnu.org/licenses/fdl.html}.
+
+@end quotation
+
+The document was typeset with
+@uref{http://www.texinfo.org/, GNU Texinfo}.
+
+@end copying
+
+@titlepage
+@title " str "
+@subtitle " short-description "
+@author " (getenv "ORGANIZATION") | (progn user-full-name)
+     " <" (progn user-mail-address) ">
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@c Output the table of the contents at the beginning.
+@contents
+
+@ifnottex
+@node Top
+@top " str "
+
+@insertcopying
+@end ifnottex
+
+@c Generate the nodes for this menu with `C-c C-u C-m'.
+@menu
+@end menu
+
+@c Update all node entries with `C-c C-u C-n'.
+@c Insert new nodes with `C-c C-c n'.
+@node Chapter One
+@chapter Chapter One
+
+" _ "
+
+@node Copying This Manual
+@appendix Copying This Manual
+
+@menu
+* GNU Free Documentation License::  License for copying this manual.
+@end menu
+
+@c Get fdl.texi from http://www.gnu.org/licenses/fdl.html
+@include fdl.texi
+
+@node Index
+@unnumbered Index
+
+@printindex cp
+
+@bye
+
+@c " (file-name-nondirectory (buffer-file-name)) " ends here\n"))
   "A list specifying text to insert by default into a new file.
 Elements look like (CONDITION . ACTION) or ((CONDITION . DESCRIPTION) . ACTION).
 CONDITION may be a regexp that must match the new file's name, or it may be

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch: Texinfo M-x auto-insert
  2007-10-03 14:13 Patch: Texinfo M-x auto-insert Aaron Hawley
@ 2007-10-06  1:52 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2007-10-06  1:52 UTC (permalink / raw)
  To: Aaron Hawley; +Cc: bug-gnu-emacs

Aaron Hawley wrote:

> Attached is a patch against autoinsert.el that adds support to M-x
> auto-insert for Texinfo files. 

Thanks; installed.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-06  1:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-03 14:13 Patch: Texinfo M-x auto-insert Aaron Hawley
2007-10-06  1:52 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).