]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/scribe.el
Some fixes to follow coding conventions in files maintained by FSF.
[gnu-emacs] / lisp / textmodes / scribe.el
index d664292c3d115304c0f140abc3e07735ea6c4991..d1b5aedf3c6887cd0237427ab7a67b6423a78891 100644 (file)
@@ -1,25 +1,26 @@
-;;; scribe.el --- scribe mode, and its idiosyncratic commands.
+;;; scribe.el --- scribe mode, and its idiosyncratic commands
 
 ;; Copyright (C) 1985 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: wp
 
-;; This file might become part of GNU Emacs.
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
-;; but without any warranty.  No author or distributor
-;; accepts responsibility to anyone for the consequences of using it
-;; or for whether it serves any particular purpose or works at all,
-;; unless he says so in writing.
-
-;; Everyone is granted permission to copy, modify and redistribute
-;; GNU Emacs, but only under the conditions described in the
-;; document "GNU Emacs copying permission notice".   An exact copy
-;; of the document is supposed to have been given to you along with
-;; GNU Emacs so that you can know how you may redistribute it all.
-;; It should be in a file named COPYING.  Among other things, the
-;; copyright notice and this notice must be preserved on all copies.
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
 
 ;;; Code:
 
+(defgroup scribe nil
+  "Scribe mode."
+  :prefix "scribe-"
+  :group 'wp)
+
 (defvar scribe-mode-syntax-table nil
   "Syntax table used while in scribe mode.")
 
 (defvar scribe-mode-abbrev-table nil
   "Abbrev table used while in scribe mode.")
 
-(defvar scribe-fancy-paragraphs nil
-  "*Non-NIL makes Scribe mode use a different style of paragraph separation.")
+(defcustom scribe-fancy-paragraphs nil
+  "*Non-NIL makes Scribe mode use a different style of paragraph separation."
+  :type 'boolean
+  :group 'scribe)
 
-(defvar scribe-electric-quote nil
-  "*Non-NIL makes insert of double quote use `` or '' depending on context.")
+(defcustom scribe-electric-quote nil
+  "*Non-NIL makes insert of double quote use `` or '' depending on context."
+  :type 'boolean
+  :group 'scribe)
 
-(defvar scribe-electric-parenthesis nil
+(defcustom scribe-electric-parenthesis nil
   "*Non-NIL makes parenthesis char ( (]}> ) automatically insert its close
-if typed after an @Command form.")
+if typed after an @Command form."
+  :type 'boolean
+  :group 'scribe)
 
 (defconst scribe-open-parentheses "[({<"
   "Open parenthesis characters for Scribe.")
@@ -86,21 +98,21 @@ These should match up with `scribe-open-parenthesis'.")
   (define-key scribe-mode-map "[" 'scribe-parenthesis)
   (define-key scribe-mode-map "{" 'scribe-parenthesis)
   (define-key scribe-mode-map "<" 'scribe-parenthesis)
-  (define-key scribe-mode-map "\^cc" 'scribe-chapter)
-  (define-key scribe-mode-map "\^cS" 'scribe-section)
-  (define-key scribe-mode-map "\^cs" 'scribe-subsection)
-  (define-key scribe-mode-map "\^ce" 'scribe-insert-environment)
-  (define-key scribe-mode-map "\^c\^e" 'scribe-bracket-region-be)
-  (define-key scribe-mode-map "\^c[" 'scribe-begin)
-  (define-key scribe-mode-map "\^c]" 'scribe-end)
-  (define-key scribe-mode-map "\^ci" 'scribe-italicize-word)
-  (define-key scribe-mode-map "\^cb" 'scribe-bold-word)
-  (define-key scribe-mode-map "\^cu" 'scribe-underline-word))
+  (define-key scribe-mode-map "\C-c\C-c" 'scribe-chapter)
+  (define-key scribe-mode-map "\C-c\C-t" 'scribe-section)
+  (define-key scribe-mode-map "\C-c\C-s" 'scribe-subsection)
+  (define-key scribe-mode-map "\C-c\C-v" 'scribe-insert-environment)
+  (define-key scribe-mode-map "\C-c\C-e" 'scribe-bracket-region-be)
+  (define-key scribe-mode-map "\C-c[" 'scribe-begin)
+  (define-key scribe-mode-map "\C-c]" 'scribe-end)
+  (define-key scribe-mode-map "\C-c\C-i" 'scribe-italicize-word)
+  (define-key scribe-mode-map "\C-c\C-b" 'scribe-bold-word)
+  (define-key scribe-mode-map "\C-c\C-u" 'scribe-underline-word))
 
 ;;;###autoload
 (defun scribe-mode ()
   "Major mode for editing files of Scribe (a text formatter) source.
-Scribe-mode is similar text-mode, with a few extra commands added.
+Scribe-mode is similar to text-mode, with a few extra commands added.
 \\{scribe-mode-map}
 
 Interesting variables:
@@ -130,14 +142,16 @@ scribe-electric-parenthesis
   (make-local-variable 'comment-end)
   (setq comment-end "]")
   (make-local-variable 'paragraph-start)
-  (setq paragraph-start (concat "\\(^[\n\f]\\)\\|\\(^@\\w+["
+  (setq paragraph-start (concat "\\([\n\f]\\)\\|\\(@\\w+["
                                 scribe-open-parentheses
                                "].*["
                                 scribe-close-parentheses
                                "]$\\)"))
   (make-local-variable 'paragraph-separate)
   (setq paragraph-separate (if scribe-fancy-paragraphs
-                              paragraph-start "^$"))
+                              paragraph-start "$"))
+  (make-local-variable 'sentence-end)
+  (setq sentence-end "\\([.?!]\\|@:\\)[]\"')}]*\\($\\| $\\|\t\\|  \\)[ \t\n]*")
   (make-local-variable 'compile-command)
   (setq compile-command (concat "scribe " (buffer-file-name)))
   (set-syntax-table scribe-mode-syntax-table)
@@ -319,4 +333,6 @@ preceding text is of the form @Command."
          (save-excursion
            (insert (aref scribe-close-parentheses paren-char)))))))
 
+(provide 'scribe)
+
 ;;; scribe.el ends here