;;; scribe.el --- scribe mode, and its idiosyncratic commands.
+;; Copyright (C) 1985 Free Software Foundation, Inc.
+
;; Maintainer: FSF
-;; Last-Modified: 09 May 1991
+;; Keywords: wp
-;; Copyright (C) 1985 Free Software Foundation, Inc.
+;; This file is part of GNU Emacs.
-;; This file might become 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;; A major mode for editing source in written for the Scribe text formatter.
+;; Knows about Scribe syntax and standard layout rules. The command to
+;; run Scribe on a buffer is bogus; someone interested should fix it.
;;; Code:
"Open parenthesis characters for Scribe.")
(defconst scribe-close-parentheses "])}>"
- "Close parenthesis characters for Scribe. These should match up with
-scribe-open-parenthesis.")
+ "Close parenthesis characters for Scribe.
+These should match up with `scribe-open-parenthesis'.")
(if (null scribe-mode-syntax-table)
(let ((st (syntax-table)))
(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 ()
(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)
(call-interactively 'compile))
(defun scribe-envelop-word (string count)
- "Surround current word with Scribe construct @STRING[...]. COUNT
-specifies how many words to surround. A negative count means to skip
-backward."
+ "Surround current word with Scribe construct @STRING[...].
+COUNT specifies how many words to surround. A negative count means
+to skip backward."
(let ((spos (point)) (epos (point)) (ccoun 0) noparens)
(if (not (zerop count))
(progn (if (= (char-syntax (preceding-char)) ?w)
(forward-char -1))
(defun scribe-insert-quote (count)
- "If scribe-electric-quote is non-NIL, insert ``, '' or \" according
+ "Insert ``, '' or \" according to preceding character.
+If `scribe-electric-quote' is non-NIL, insert ``, '' or \" according
to preceding character. With numeric arg N, always insert N \" characters.
Else just insert \"."
(interactive "P")