Anonymous avatar Anonymous committed 850f70f

2002-07-25 Ville Skyttä <ville.skytta@xemacs.org>;

* xslide.el: Docstring nit fixes.
(xsl-electric-slash): Don't match <?xml, <!DOCTYPE or <!ENTITY.

Comments (0)

Files changed (2)

+2002-07-25  Ville Skyttä  <ville.skytta@xemacs.org>
+
+	* xslide.el: Docstring nit fixes.
+	(xsl-electric-slash): Don't match <?xml, <!DOCTYPE or <!ENTITY.
+
 2002-05-09  Steve Youngs  <youngs@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.02 released.
 ;;;; xslide.el --- XSL Integrated Development Environment
-;; Id: xslide.el,v 1.5 2001/11/16 22:00:22 menteith Exp $
+;; $Id$
 
 ;; Copyright (C) 1998, 1999, 2000, 2001 Tony Graham
 
 ;; Author: Tony Graham <tkg@menteith.com>
 ;; Contributors: Simon Brooke, Girard Milmeister, Norman Walsh,
-;;               Moritz Maass, Lassi Tuura, Simon Wright, KURODA Akira
+;;               Moritz Maass, Lassi Tuura, Simon Wright, KURODA Akira,
+;;               Ville Skyttä
 ;; Created: 21 August 1998
-;; Version: Revision: 1.5 $
+;; Version: $Revision$
 ;; Keywords: languages, xsl, xml
 
 ;;; This file is not part of GNU Emacs.
   "Version number of xslide XSL mode.")
 
 (defun xslide-version ()
-  "Returns the value of the variable xslide-version."
+  "Return the value of the variable `xslide-version'."
   xslide-version)
 
 (defconst xslide-maintainer-address "xslide-bug@menteith.com")
 ;; Variables
 
 (defvar xsl-indent-tabs-mode nil
-  "*Initial value of indent-tabs-mode on entering xsl-mode")
+  "*Initial value of `indent-tabs-mode' on entering `xsl-mode'.")
 
 (defvar xsl-default-filespec "*.xsl"
   "*Inital prompt value for `xsl-etags''s FILESPEC argument.")
   "*Non-nil disables case insensitive searches by `xsl-grep'.")
 
 (defvar xsl-comment-start "<!--"
-  "*Comment start character sequence")
+  "*Comment start character sequence.")
 
 (defvar xsl-comment-end "-->"
-  "*Comment end character sequence")
+  "*Comment end character sequence.")
 
 (defvar xsl-comment-max-column 70
-  "*Maximum column number for text in a comment")
+  "*Maximum column number for text in a comment.")
 
 (defcustom xsl-initial-stylesheet-file (locate-library "xslide-initial.xsl" t)
-  "*File containing initial stylesheet inserted into empty XSL buffers"
+  "*File containing initial stylesheet inserted into empty XSL buffers."
   :type '(choice (file :must-match t) (const :tag "No initial stylesheet" nil))
   :group 'xsl)
 
 (defcustom xsl-initial-stylesheet-initial-point 0
-  "*Initial position of point in initial stylesheet"
+  "*Initial position of point in initial stylesheet."
   :type '(integer)
   :group 'xsl)
 
 	 (xsl-font-lock-region-point-max)))))
 
 (defun xsl-electric-apos ()
-  "Function called when \"'\" is pressed in XSL mode"
+  "Function called when \"'\" is pressed in XSL mode."
   (interactive)
   (insert "'")
   (if (looking-at "\\([\"/})]\\|$\\)")
 	(insert "'"))))
 
 (defun xsl-electric-quote ()
-  "Function called when '\"' is pressed in XSL mode"
+  "Function called when '\"' is pressed in XSL mode."
   (interactive)
   (insert "\"")
   (if (looking-at "\\(['/})]\\|$\\)")
 	(insert "\""))))
 
 (defun xsl-electric-lsqb ()
-  "Function called when \"[\" is pressed in XSL mode"
+  "Function called when \"[\" is pressed in XSL mode."
   (interactive)
   (insert "[")
   (if (looking-at "\\([\"'/})]\\|$\\)")
 	(insert "]"))))
 
 (defun xsl-electric-lpar ()
-  "Function called when \"(\" is pressed in XSL mode"
+  "Function called when \"(\" is pressed in XSL mode."
   (interactive)
   (insert "(")
   (if (looking-at "\\([\]\"'/}]\\|$\\)")
 	(insert ")"))))
 
 (defun xsl-electric-lcub ()
-  "Function called when \"{\" is pressed in XSL mode"
+  "Function called when \"{\" is pressed in XSL mode."
   (interactive)
   (insert "{")
   (if (looking-at "\\([\])\"'/}]\\|$\\)")
 	(insert "}"))))
 
 (defun xsl-electric-less-than ()
-  "Function called when \"<\" is pressed in XSL mode"
+  "Function called when \"<\" is pressed in XSL mode."
   (interactive)
   (insert "<")
   (xsl-electric-tab))
 
 (defun xsl-match-opening-tag (a)
-  "Function called to match the next opening tag to a closing tag"
+  "Function called to match the next opening tag to a closing tag."
   (if (looking-at "</")
       (catch 'start-tag
         (while (re-search-backward
     nil)
 )
 (defun xsl-electric-slash ()
-  "Function called when \"/\" is pressed in XSL mode"
+  "Function called when \"/\" is pressed in XSL mode."
   (interactive)
   (insert "/")
   (xsl-electric-tab)
 			((looking-at "<!--[^-]*\\(-[^-]+\\)*-->"))
 			;; skip CDATA sections
 			((looking-at "<!\\[CDATA\\["))
+			;; ...and the XML declaration, DOCTYPE and ENTITY stuff
+			((looking-at
+                          "<\\(\\?xml\\|!\\(DOCTYPE\\|ENTITY\\)\\)[ \t\n\r]"))
 			((looking-at "<\\([^/> \n\t]+\\)")
 ;;			 (message "Start tag: %s" (match-string 1))
 			 (throw 'start-tag (match-string 1)))
 		     (xsl-font-lock-region-point-max)))))))))
 
 (defun xsl-electric-return ()
+  "Function called when RET is pressed in XSL mode."
   (interactive)
   (insert "\n")
   (xsl-electric-tab))
 
 
 (defun xsl-close-open-tab-p nil
-  "Return 'T' if the current line contains more right than left angle-brackets"
+  "Return t if the current line contains more right than left angle-brackets."
   (save-excursion
     (beginning-of-line)
     (let ((open 0))
   )
 
 (defun xsl-calculate-indent ()
-  "Calculate what the indent should be for the current line"
+  "Calculate what the indent should be for the current line."
   (let* ((limit   (point))
  	 (name    "[^<>=\"' \t\n]+")
  	 (string  "\\(\"[^<>\"]*\"\\|'[^<>']*'\\)")
 
 (defun xsl-insert-tag (tag)
   "Insert a tag, reading tag name in minibuffer with completion."
-  (interactive 
+  (interactive
    (list
     (completing-read "Tag: " xsl-all-elements-alist)))
   ;;  (xsl-find-context-of (point))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defun xsl-insert-template (match)
-  "Insert a template"
+  "Insert a template."
   (interactive "smatch=")
   (xsl-electric-tab)
   (insert (format "<xsl:template match=\"%s\">\n" match))
 ;; imenu stuff
 
 (defun xsl-sort-alist (alist)
-  "Sort an alist"
+  "Sort an alist."
   (sort
    alist
    (lambda (a b) (string< (car a) (car b)))))
 
 (defun xsl-imenu-create-index-function ()
-  "Create an alist of elements, etc. suitable for use with imenu."
+  "Create an alist of elements, etc. suitable for use with `imenu'."
   (interactive)
   (let ((template-alist '())
 	(mode-alist '())
 xsl-default-filespec, but `xsl-grep' also maintains a history of
 FILESPEC arguments so you can easily re-use a previous value.  The
 history is shared with `xsl-etags' so you can re-use the same FILESPEC
-with both functions.
-"
+with both functions."
   (interactive
    (list
     (xsl-read-from-minibuffer "Pattern: "
 
 Font lock mode:
 
-Turning on font lock mode causes various XSL syntactic structures to be 
+Turning on font lock mode causes various XSL syntactic structures to be
 hightlighted. To turn this on whenever you visit an XSL file, add
 the following to your .emacs file:
   \(add-hook 'xsl-mode-hook 'turn-on-font-lock\)
   (make-local-variable 'indent-line-function)
   (setq indent-line-function `xsl-electric-tab)
 ;;  (make-local-variable 'font-lock-defaults)
-;;  (setq font-lock-defaults 
+;;  (setq font-lock-defaults
 ;;	'(xsl-font-lock-keywords nil t ((?- . "w")
 ;;					(?_ . "w")
 ;;					(?. . "w"))))
        (reporter-submit-bug-report
 	xslide-maintainer-address
 	(concat "xslide.el " xslide-version)
-	(list 
+	(list
 	 )
 	nil
 	nil
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.