.
. - Added oacs-format-includes to place all include attribubtes on a
. separate line.
.
. - Made oacs-format-empty-lines more flexible by taking a COUNT
. parameter. It now replaces multiple empty lines by COUNT empty
. lines. Mostly used with a COUNT of 2 for a single empty line or 1 to
. remove empty lines altogether.
.
. - Report the number of lines added to the error log upon refreshing.
.
. modified files:
. oacs-error-log.el oacs-format.el
.
.
. 2004-04-02 18:35:36 GMT Bart Teeuwisse patch-24
.
. Summary:
. Added oacs-revert-log
. Revision:
. oacs--devo--1.0--patch-24
.
. - Added oacs-revert-log linked to key stroke M-o rl.
. - Fixed missing ' in oacs-dbg.
. - Removed debug message from oacs-mmm-ify-log-region.
.
. modified files:
. oacs-abbrevs.el oacs-error-log.el oacs.el
.
.
. 2004-03-16 20:06:47 GMT Bart Teeuwisse patch-23
.
. Summary:
. MMM-ify only the new addition when reverting
. Revision:
. oacs--devo--1.0--patch-23
.
. - MMM-ify only the newly added text written to the log when reverting.
.
. - If the cursor (POINT) was at the end of the buffer then move the
. POINT to the end of the buffer after reverting.
.
. - Added a history variable for server names.
.
. modified files:
. oacs-error-log.el oacs.el
.
.
. 2004-03-15 19:57:57 GMT Bart Teeuwisse patch-22
.
. Summary:
. Added hilighting of db_ procs inside quotes
. Revision:
. oacs--devo--1.0--patch-22
.
. - Hi Bart - it would be useful to hilight the sql of db_* proc calls
. inside quotes as well as braces - if you ever have any $ variables
. (eg. for extra where clauses) you are forced into using quotes.
.
. --
. Mark Aufflick
.
. modified files:
. oacs-mmm.el
.
.
. 2004-03-12 21:31:46 GMT Bart Teeuwisse patch-21
.
. Summary:
. Added M-o ml key binding to oacs-monitor-error-log
. Revision:
. oacs--devo--1.0--patch-21
.
. - Added M-o ml to OACS menu as well as global key map so that
. the log can be called from any buffer, not only OACS buffers.
.
. modified files:
. oacs-error-log.el oacs.el
.
.
. 2004-03-11 21:24:39 GMT Bart Teeuwisse patch-20
.
. Summary:
. Added nsd-error-mode for AOLServer logs
. Revision:
. oacs--devo--1.0--patch-20
.
. - Added a modified version of nsd-error-mode (from nsd.el).
. The new version opens the entire buffer instead of tailing
. from the moment the log file is opened.
.
. - Nsd-Error has similar highlighting. Supports execution of
. queries w/ bind variables.
.
. - Use M-x customize-option oacs-error-log-dirs to list directories
. that should be searched for AOLServer error logs.
.
. - Use M-x oacs-monitor-error-log to open an error log file and monitor
. the changes to the log.
.
. - Fixed M-o om key mapping to oacs-occur-dbg.
.
. new files:
. oacs-error-log.el
.
. modified files:
. oacs.el
.
.
. 2004-03-11 01:20:45 GMT Bart Teeuwisse patch-19
.
. Summary:
. Fixed Imenu regular expressions
. Revision:
. oacs--devo--1.0--patch-19
.
. - The tailing whitespace expression in oacs-imenu-tcl-expression
. lacked a backslash.
.
. modified files:
. oacs-abbrevs.el oacs.el
.
.
. 2004-03-10 21:06:07 GMT Bart Teeuwisse patch-18
.
. Summary:
. Added Imenu support
. Revision:
. oacs--devo--1.0--patch-18
.
. - Imenu adds extra facilities for mode-specific buffer indexes in menu
. form. Documentation is scant, see
. http://www.emacswiki.org/cgi-bin/wiki/ImenuMode and the Imenu node
. in the Emacs info file.
.
. - Imenu adds an Index menu to the menu bar with shortcuts to Tcl
. procedures and SQL functions, packages, sequences and tables.
.
. - Imenu is also available from Ctrl+Right mouse click.
.
. - Imenu support is in addition to M-o od. The two methods differ in
. that Imenu categorizes definitions and sorts them by name where as
. M-o od lists definitions in the order they appear in the file.
.
. - And last but not least, Speedbar (M-x speedbar) also uses Imenu.
.
. - Added M-o fp to ADP pages sub mode.
.
. modified files:
. oacs.el
.
.
. 2004-03-05 17:54:08 GMT Bart Teeuwisse patch-17
.
. Summary:
. @arch-tag -> @arch-tag:
. Revision:
. oacs--devo--1.0--patch-17
.
. - The GNU Arch tag should end with a colon (:).
.
. modified files:
. oacs-abbrevs.el
.
.
. 2004-03-05 01:31:55 GMT Bart Teeuwisse patch-16
.
. Summary:
. Oops, creation-date should have been oacs-creation-date
. Revision:
. oacs--devo--1.0--patch-16
.
. - Emacs auto-complete must have tricked me.
.
. modified files:
. oacs-headers.el
.
.
. 2004-03-05 01:17:24 GMT Bart Teeuwisse patch-15
.
. Summary:
. Menu update plus M-o o p -> M-o o d change
. Revision:
. oacs--devo--1.0--patch-15
.
. - Added oacs-occur-functions, oacs-occur-queries.
.
. - Mapped M-o o d to oacs-occur-proc, oacs-occur-functions and
. oacs-occur-queries. Oacs-occur-proc was previously bound to
. M-o o p. However, with the addition of new sub-mode specific
. procedures to find local definitions the mapping has been
. changed. The last 'd' in the key map stands for 'Definition'.
.
. - Updated abbreviations for SQL sub-mode.
.
. - Updated OACS menu. Added all known abbreviations to the insert
. sub-menu for sub-modes Tcl, SQL and XQL.
.
. - Moved @creation-date to a separate procedure.
.
. modified files:
. oacs-abbrevs.el oacs-headers.el oacs-occur.el oacs.el
.
.
. 2004-03-04 00:45:11 GMT Bart Teeuwisse patch-14
.
. Summary:
. Another patch to get the layout right
. Revision:
. oacs--devo--1.0--patch-14
.
. - More header template tweaking.
.
. - Also tweaked the oacs-sql-template regexp for compatibility with
. ACS>
.
. modified files:
. oacs-headers.el
.
.
. 2004-03-04 00:25:45 GMT Bart Teeuwisse patch-13
.
. Summary:
. Fixed a few layout glitzes
. Revision:
. oacs--devo--1.0--patch-13
.
. - Ben Bytheway reported a few layout glitzes.
.
. modified files:
. oacs-headers.el
.
.
. 2004-03-03 23:20:16 GMT Bart Teeuwisse patch-12
.
. Summary:
. Added GNU Arch support & refined abbreviations
. Revision:
. oacs--devo--1.0--patch-12
.
. - Using octopy I accidentally committed only 1 file.
.
. - Added @arch-tag to all header templates. Added oarch to
. abbreviations.
.
. - Refined abbreviation code. Moved common portions to separate
. procedures.
.
. - Added OpenACS form debug message to log form errors in hidden form
. variables. These errors would otherwise go unnoticed. Added odbgf to
. abbreviations.
.
. - Added both oarch and odbgf to the OACS->Insert menu.
.
. modified files:
. oacs-headers.el
.
.
. 2004-03-03 23:17:03 GMT Bart Teeuwisse patch-11
.
. Summary:
. Added GNU Arch support & refined abbreviations
. Revision:
. oacs--devo--1.0--patch-11
.
. - Added @arch-tag to all header templates. Added oarch to
. abbreviations.
.
. - Refined abbreviation code. Moved common portions to separate
. procedures.
.
. - Added OpenACS form debug message to log form errors in hidden form
. variables. These errors would otherwise go unnoticed. Added odbgf to
. abbreviations.
.
. - Added both oarch and odbgf to the OACS->Insert menu.
.
. modified files:
. oacs-abbrevs.el
.
.
. 2004-03-03 02:39:13 GMT Bart Teeuwisse patch-10
.
. Summary:
. Added find-file-at-point to Tcl submode
. Revision:
. oacs--devo--1.0--patch-10
.
. - Added find-file-at-point to Tcl submode
.
. modified files:
. oacs.el
.
.
. 2004-02-24 03:17:22 GMT Bart Teeuwisse patch-9
.
. Summary:
. Made OACS menu also a popup menu
. Revision:
. oacs--devo--1.0--patch-9
.
. - Linked the OACS menu to Ctrl+Shift+Right Mouse click.
.
. modified files:
. oacs.el
.
.
. 2004-02-24 02:54:49 GMT Bart Teeuwisse patch-8
.
. Summary:
. Oops, odbgh is called oacs-dbg-headers
. Revision:
. oacs--devo--1.0--patch-8
.
. - The procedure is called oacs-dbg-headers and not odbgh.
.
.
. modified files:
. oacs-abbrevs.el
.
.
. 2004-02-24 02:50:27 GMT Bart Teeuwisse patch-7
.
. Summary:
. Fix odbgh menu item
. Revision:
. oacs--devo--1.0--patch-7
.
. - The odbgh menu item was inadvertently linked to odbg rather then
. odbgh.
.
. modified files:
. oacs-abbrevs.el
.
.
. 2004-02-24 02:41:27 GMT Bart Teeuwisse patch-6
.
. Summary:
. Added OACS to menu bar.
. Revision:
. oacs--devo--1.0--patch-6
.
. - Added sub mode aware OACS menu to Emacs menu bar.
. - SQL sub mode also activates in /sql dir in addition to /sql/oracle
. and /sql/postgresql dirs.
.
. modified files:
. oacs-abbrevs.el oacs.el
.
.
. 2004-02-21 00:07:14 GMT Bart Teeuwisse patch-5
.
. Summary:
. Added oacs-inc-template
. Revision:
. oacs--devo--1.0--patch-5
.
. Added a header template for files. Contains a brief
. description, @author, @creation-date and @cvs-id.
.
. Also asks for required and optional parameters so that the
. can enforce a minimal API.
.
. modified files:
. oacs-headers.el oacs.el
.
.
. 2004-02-20 22:22:10 GMT Bart Teeuwisse patch-4
.
. Summary:
. Fix typo
. Revision:
. oacs--devo--1.0--patch-4
.
. Jon Griffen also reported a typo in the prompt for focus.
.
. modified files:
. oacs-headers.el
.
.
. 2004-02-20 22:17:49 GMT Bart Teeuwisse patch-3
.
. Summary:
. Fix for MMM-mode
. Revision:
. oacs--devo--1.0--patch-3
.
. Jon Griffin reported the following error:
.
. Also, I can't get into mmm-mode in the xql files, I think the
. error is: Wrong type argument: stringp, nil
.
. Which turned out to be a case unaccounted for in oacs-mode-on.
.
. modified files:
. oacs.el
.
.
. 2004-02-20 01:11:53 GMT Bart Teeuwisse patch-2
.
. Summary:
. Turned OACS into a Minor Mode
. Revision:
. oacs--devo--1.0--patch-2
.
. - Step one in turning OACS into a Minor Mode.
. - Key mappings via oacs-mode-map.
. - Mappings tuned to oacs sub-mode.
. - Know sub-modes: adp, log, sql, tcl, xql
.
. modified files:
. oacs-abbrevs.el oacs-comment.el oacs-format.el oacs-headers.el
. oacs-occur.el oacs.el
.
.
. 2004-02-04 05:09:09 GMT Bart Teeuwisse patch-1
.
. Summary:
. Added installation instructions
. Revision:
. oacs--devo--1.0--patch-1
.
. - Added installation instructions for Emacs OACS.
.
.
. new files:
. INSTALL.txt
.
.
. 2004-02-03 01:16:48 GMT Bart Teeuwisse base-0
.
. Summary:
. Initial import
. Revision:
. oacs--devo--1.0--base-0
.
. Initial version of Emacs OACS.
.
. OpenACS lacked a good Integrated Development Environment and as I use
. Emacs for almost everything it was only natural to fill the void. The
. Emacs OACS module is an extension to GNU Emacs, the extensible,
. customizable, self-documenting real-time display editor.
.
.
. new files:
. oacs-abbrevs.el oacs-comment.el oacs-format.el oacs-headers.el
. oacs-mmm.el oacs-occur.el oacs-psgml.el oacs.el
.
.
}
W
oacs/.bzr/weaves/bf/ 0000755 0001750 0001750 00000000000 10412346077 013163 5 ustar dave dave oacs/.bzr/weaves/bf/INSTALL.txt-20060328214111-89438b811a2a5e24.weave 0000644 0001750 0001750 00000004464 10412346077 021601 0 ustar dave dave # bzr weave file v5
i
1 d86da06735dc46f0d2d85e4f278c89d0999372d3
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
i 0
1 316da5177c799da4c0fabda3b2b0e456ca1b1c0a
n bart.teeuwisse@thecodemill.biz-20060328215936-0846583a2b57289d
w
{ 0
. Installing Emacs OACS
.
.
. 1) Create a subdirectory called oacs in the emacs site-lisp
. directory. On most systems the full path to site-lisp is:
.
. /usr/share/emacs/site-lisp
.
. If the site-lisp directory is in a different location on your
. system then use your full path instead from here on in these
. installation instructions.
.
. If you use Bazaar NG you can follow the development of Emacs OACS by
. creating a local copy of the development branch like so:
.
[ 1
. bzr pull --remember http://thecodemill.biz/repository/oacs
] 1
{ 1
. bzr get http://thecodemill.biz/repository/oacs
}
.
. If you install from an Emacs OACS tarball copy all extracted files
. to the oacs directory.
[ 1
.
] 1
.
. 2) Install the Emacs nXML mode or the PSGML mode. PSGML is the default
. XML mode handler of OACS. Set the oacs-preferred-xml-mode variable
. to nxml to use nXML mode instead. nXML mode in my opinion is
. superior but your milage may varry.
.
. PSGML mode is available from:
.
. http://psgml.sourceforge.net/
.
. Follow the included installation instructions.
.
. Alternatively, Debian users can use:
.
. apt-get install psgml
.
. nXML mode is available from:
.
. http://thaiopensource.com/nxml-mode/
.
. 3) Install the Emacs MMM mode. MMM is available from:
.
. http://mmm-mode.sourceforge.net/
.
. Alternatively, Debian users can use:
.
. apt-get install mmm-mode
.
.
. 4) Recommended but not required. Install color-occur by copying
.
. http://www.emacswiki.org/elisp/color-occur.el
.
. to the Emacs site-lisp directory.
.
.
. 5) Put the following line in your .emacs file:
.
. (add-to-list 'load-path "/usr/share/emacs/site-lisp/oacs")
. (require 'oacs)
.
.
. 6) Customize the following Emacs variables
.
. user-full-name
. user-mail-address
.
. Type M-x customize-variable followed by the name of the variable to
. change their value. Be sure to save the new value for future
. sessions.
.
.
. 7) Restart Emacs.
.
.
. 8) Enjoy!
}
W
oacs/.bzr/weaves/14/ 0000755 0001750 0001750 00000000000 10412346101 013004 5 ustar dave dave oacs/.bzr/weaves/14/adpmaster.rnc-20060328214111-4a6ccf2779cb92fb.weave 0000644 0001750 0001750 00000000524 10412346101 022540 0 ustar dave dave # bzr weave file v5
i
1 5b63f5afc9a2e0605653233f9571195b546f4c19
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. start |= master
. master = element master {
. master.attlist,
. master.content
. }
. master.attlist = attribute src {
. Text.datatype
. }?
. master.content = property*, Block.model
}
W
oacs/.bzr/weaves/0e/ 0000755 0001750 0001750 00000000000 10412346102 013065 5 ustar dave dave oacs/.bzr/weaves/0e/adpproperty.rnc-20060328214111-755f263cbdd4f8dd.weave 0000644 0001750 0001750 00000000414 10412346102 023211 0 ustar dave dave # bzr weave file v5
i
1 7b3ec307f8de1762dd5e2b563f705f3ac34c674e
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. property = element property { property.attlist, Inline.model }
. property.attlist =
. attribute name { Text.datatype }?
.
}
W
oacs/.bzr/weaves/42/ 0000755 0001750 0001750 00000000000 10412346104 013010 5 ustar dave dave oacs/.bzr/weaves/42/adp.rnc-20060328214111-f423b119b0b0d2ff.weave 0000644 0001750 0001750 00000000461 10412346104 021222 0 ustar dave dave # bzr weave file v5
i
1 e7c789bca4dbe7b6b629ae7963746d92b03dc86c
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. # ADP
.
. default namespace = ""
.
. include "/usr/share/emacs/site-lisp/nxml-mode/schema/xhtml.rnc"
. include "adp-master.rnc"
. include "adp-property.rnc"
.
}
W
oacs/.bzr/weaves/46/ 0000755 0001750 0001750 00000000000 10412346113 013014 5 ustar dave dave oacs/.bzr/weaves/46/oacsabbrevs.el-20060328214111-3766515f3e004663.weave 0000644 0001750 0001750 00000024543 10412346106 022243 0 ustar dave dave # bzr weave file v5
i
1 37e4412a4ba2c3ef467ece7ceefcbd8582b45003
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-abbrevs.el --- OACS abbreviations
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: extensions, tools, convenience
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; OACS abbreviations for procedure definitions, debug messages, etc.
.
. ;;; Code:
.
. (defun oacs-initial ()
. "Return the developer's initials followed by a space"
. (concat
. (mapconcat (function (lambda (str)
. (substring str 0 1)))
. (split-string user-full-name) nil) " "))
.
. (defun oacs-remove-dbg ()
. "Remove OACS debug messages from the current buffer"
. (interactive)
. (save-excursion
. (goto-char (point-min))
. (query-replace-regexp (concat "^\\s-*ns_log.*\"\\(
. " (oacs-initial) "-\\{80\\}\\(
. " (oacs-initial) ".*\\)*\\)\\{2\\}\"
. ") "" nil nil nil)))
.
. (define-skeleton oacs-proc
. "Declare an improved Tcl procedure."
. nil
. "ad_proc " (completing-read
. "Type of procedure: "
. '(("-public" 0) ("-private" 1))
. nil t nil 'oacs-proc-type-history 'oacs-proc-type) " "
. (read-string "Procedure name: " nil 'oacs-proc-name-history) | _
. " {" \n >
. (while (not (equal (setq parameter (read-string "Parameter definition: " nil 'oacs-parameter-history)) ""))
. (skeleton-insert '(nil parameter \n >))
. (push parameter oacs-proc-parameters)
. )| _
. "} {" > \n
. > _ \n \n
. > '(oacs-author) \n
. > '(oacs-creation-date) \n \n
. (let* ((oacs-proc-parameters (nreverse oacs-proc-parameters)))
. (while (setq parameter (pop oacs-proc-parameters))
. (skeleton-insert '(nil
. > "@param "
. (if (string-match "\\([a-zA-Z_0-9]+\\)" parameter)
. (match-string 1 parameter))
. "\n\n" )
. )
. )
. )
. (setq oacs-proc-parameters nil)
. > "@return " \n \n
. > "@error " ?\n
. "} {" \n ?\n
. "}" \n \n
. )
.
. (define-skeleton oacs-author
. "Insert the OpenACS @author tag"
. nil
. "@author " user-full-name " (" user-mail-address ")"
. )
.
. (define-skeleton oacs-cvs-id
. "Insert the OpenACS @cvs-id tag"
. nil
. "@cvs-id $Id$"
. )
.
. (define-skeleton oacs-creation-date
. "Insert the OpenACS @creation-date tag"
. nil
. "@creation-date " (format-time-string "%Y-%m-%d" (current-time)))
.
. (define-skeleton oacs-author-stamp
. "Insert an AUTHOR DATE stamp. Where AUTHOR is the capitalized user
. name and DATE is the current date of the form %Y-%m-%d"
. nil
. (upcase (user-login-name)) " " (format-time-string "%Y-%m-%d" (current-time)))
.
. (define-skeleton oacs-dbg-log
. "Insert the AOLServer log statement and logging level."
. nil
. "ns_log " (completing-read
. "Type of log message: "
. '(("bug" 0) ("debug" 1) ("error" 2) ("fatal" 3) ("notice" 4) ("warning" 5))
. nil t nil 'oacs-dbg-type-history 'oacs-dbg-severity) " "
. "\"" ?\n)
.
. (define-skeleton oacs-dbg-head
. "Insert the common head of OpenACS debug messages."
. nil
. (oacs-initial) "--------------------------------------------------------------------------------" ?\n
. (oacs-initial) (upcase (user-login-name)) " debugging "
. (save-excursion
. (let ((current-point (point))
. (regexp "^\\s-*\\(ad_\\|doc_\\)?proc\\(\\s-+-\\w+\\)*\\s-+\\(\\(:*\\w_?\\)+\\)")
. (bound (re-search-backward "^}\\s-*$" nil t)))
.
. ; Restore point to the location before searching backwards fo
. ; the last line of the previous proc.
.
. (goto-char current-point)
.
. ; Search backwards for the declaration of a Tcl procedure but
. ; don't go beyond a line starting with a closing bracket as the
. ; assumption is that the last closing bracket of procedures
. ; always is the first character of the line.
.
. (if (re-search-backward regexp bound t)
. (concat "procedure " (match-string 3))
. (buffer-file-name))))
. | _ ?\n
. (oacs-initial) "--------------------------------------------------------------------------------")
.
. (define-skeleton oacs-dbg-tail
. "Insert the common tail of OpenACS debug messages."
. nil
. (oacs-initial) "--------------------------------------------------------------------------------")
.
. (define-skeleton oacs-dbg
. "Insert an OpenACS debuging message to write selected variable to
. the AOLServer log."
. nil
. '(oacs-dbg-log)
. '(oacs-dbg-head)
. ("Paramater name: " ?\n (oacs-initial) str " = '${" str "}'")
. _ ?\n
. '(oacs-dbg-tail) "\""
. )
.
. (define-skeleton oacs-dbg-headers
. "Insert an OpenACS debug message which writes all headers and form
. variables to the AOLServer log."
. nil
. "set oacs:msg \"" ?\n
. > '(oacs-dbg-head) ?\n
. > (oacs-initial) "Headers:\"" ?\n
. > "set oacs:headers [ns_conn headers]" \n
. > "for {set oacs:i 0} {${oacs:i} < [ns_set size ${oacs:headers}]} {incr oacs:i} {" \n
. > "set oacs:key [ns_set key ${oacs:headers} ${oacs:i}]" \n
. > "set oacs:value [ns_set value ${oacs:headers} ${oacs:i}]" \n
. > "append oacs:msg \"" \n
. > (oacs-initial) " ${oacs:key} = '${oacs:value}'\"" ?\n
. > -4 "}" ?\n
. > "append oacs:msg \"" \n (oacs-initial) \n
. > (oacs-initial) "Form variables:\"" ?\n
. > "set oacs:form [ns_getform]" \n
. > "for {set oacs:i 0} {${oacs:i} < [ns_set size ${oacs:form}]} {incr oacs:i} {" \n
. > "set oacs:key [ns_set key ${oacs:form} ${oacs:i}]" \n
. > "set oacs:value [ns_set value ${oacs:form} ${oacs:i}]" \n
. > "append oacs:msg \"" \n
. > (oacs-initial) " ${oacs:key} = '${oacs:value}'\"" ?\n
. > -4 "}" \n
. > "append oacs:msg \"" \n
. > '(oacs-dbg-tail) "\"" \n
. > '(oacs-dbg-log) "${oacs:msg}\"" ?\n
. )
.
. (define-skeleton oacs-dbg-form
. "Insert an OpenACS debug message which records form errors to the
. AOLServer log. Requires a variable named 'form_id' with the name of
. the OpenACS form. Recommended practice:
.
. set form_id my_form
. template::form create $form_id
. template::element create $form_id my_element \
. ...."
. nil
. "if {[info exists ${form_id}:error]} {" ?\n
. > '(oacs-dbg-log)
. > '(oacs-dbg-head) ?\n
. > (oacs-initial) "${form_id}:error = '[array get ${form_id}:error]'" ?\n
. > '(oacs-dbg-tail) "\"" ?\n
. > -4 "}"
. )
.
. (define-skeleton oacs-template-form
. "Insert a template::form declaration."
. nil
. "set form_id " (read-string "Form name: ") ?\n
. > "template::form create $form_id"
. )
.
. ;;; Associate OpenACS Tcl abbreviations with tcl-mode
. (define-abbrev-table 'tcl-mode-abbrev-table '(
. ("oauthor" "" oacs-author 0)
. ("ocreation" "" oacs-creation-date 0)
. ("ocvs" "" oacs-cvs-id 0)
. ("odbg" "" oacs-dbg 0)
. ("odbgf" "" oacs-dbg-form 0)
. ("odbgh" "" oacs-dbg-headers 0)
. ("oproc" "" oacs-proc 0)
. ("ostamp" "" oacs-author-stamp 0)
. ("oform" "" oacs-template-form 0)
. ))
.
. ;;; Associate OpenACS SQL abbreviations with sql-mode
. (define-abbrev-table 'sql-mode-abbrev-table '(
. ("oauthor" "" oacs-author 0)
. ("ocreation" "" oacs-creation-date 0)
. ("ocvs" "" oacs-cvs-id 0)
. ("ostamp" "" oacs-author-stamp 0)
. ))
.
. (defun define-insert-map (map sub-mode)
. "Define the appropriate sub menu MAP to the OACS menu bar for the abbreviations
. available to the sub mode SUB-MODE."
. (case sub-mode
. (tcl
. (define-key map [insert-ostamp]
. '(menu-item "ostamp" oacs-author-stamp
. :help "Insert an AUTHOR DATE stamp at point"))
. (define-key map [insert-oproc]
. '(menu-item "oproc" oacs-proc
. :help "Insert ad_proc at point"))
. (define-key map [insert-odbgh]
. '(menu-item "odbgh" oacs-dbg-headers
. :help "Insert personal HTTP headers & form variables debug message at point"))
. (define-key map [insert-odbgf]
. '(menu-item "odbgf" oacs-dbg-form
. :help "Insert personal form template debug message at point"))
. (define-key map [insert-odbg]
. '(menu-item "odbg" oacs-dbg
. :help "Insert personal debug message at point"))
. (define-key map [insert-ocvs]
. '(menu-item "ocvs" oacs-cvs-id
. :help "Insert @cvs-id at point"))
. (define-key map [insert-creation]
. '(menu-item "ocreation" oacs-creation-date
. :help "Insert @creation-date at point"))
. (define-key map [insert-oauthor]
. '(menu-item "oauthor" oacs-author
. :help "Insert @author at point"))
. )
. (sql
. (define-key map [insert-ostamp]
. '(menu-item "ostamp" oacs-author-stamp
. :help "Insert an AUTHOR DATE stamp at point"))
. (define-key map [insert-ocvs]
. '(menu-item "ocvs" oacs-cvs-id
. :help "Insert @cvs-id at point"))
. (define-key map [insert-creation]
. '(menu-item "ocreation" oacs-creation-date
. :help "Insert @creation-date at point"))
. (define-key map [insert-oauthor]
. '(menu-item "oauthor" oacs-author
. :help "Insert @author at point"))
. )
. (xql
. (define-key map [insert-ostamp]
. '(menu-item "ostamp" oacs-author-stamp
. :help "Insert an AUTHOR DATE stamp at point"))
. (define-key map [insert-ocvs]
. '(menu-item "ocvs" oacs-cvs-id
. :help "Insert @cvs-id at point"))
. (define-key map [insert-creation]
. '(menu-item "ocreation" oacs-creation-date
. :help "Insert @creation-date at point"))
. (define-key map [insert-oauthor]
. '(menu-item "oauthor" oacs-author
. :help "Insert @author at point"))
. )))
.
. ;;; Always activate the minor abbrev-mode in major tcl-mode
. (add-hook 'tcl-mode-hook 'abbrev-mode)
.
. (provide 'oacs-abbrevs)
. ;;; oacs-abbrevs.el ends here
}
W
oacs/.bzr/weaves/46/oacsformat.el-20060328214111-11b3965b046bd098.weave 0000644 0001750 0001750 00000030230 10412346113 022227 0 ustar dave dave # bzr weave file v5
i
1 3ece8bb20449b2608865900866903cbd64559869
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-format.el --- OACS formatting extensions
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: convenience, tools, extensions
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; OACS formatting extensions to re-format Tcl, Html, Sql, or Adp code.
.
. ;;; Code:
.
. ;; HTML/ADP format tools
.
. (defun oacs-quote-tags ()
. "Quote unquoted HTML/XML tags"
. (save-excursion
. (replace-regexp "=\\([^\\\"][^ >]*?[^\\\"]\\|[^\\\"]\\)\\([ >]\\)" "=\"\\1\"\\2" nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-empty-element-tags ()
. "Add missing / to empty element tags"
. (save-excursion
. (replace-regexp "\\(<\\(img\\|input\\|maste\\|includ\\|formwidget\\|formhelp\\)[^>]*?[^/]\\)>" "\\1 />" nil (point-min) (point-max))
. (replace-regexp " " " " nil (point-min) (point-max))
. (replace-regexp " " " " nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-separate-tags ()
. "Place adjacent tags on separate lines"
. (save-excursion
. (replace-regexp ">\\s-*<" ">
. <" nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-includes ()
. "Place all include attribubtes on a separate line."
. (save-excursion
. (goto-char (point-min))
. (while (search-forward-regexp "" nil t))
. )
. )
. )
.
. (defun oacs-format-html ()
. "Format an HTML page"
. (interactive)
. (oacs-quote-tags)
. (oacs-format-empty-lines 1)
. (oacs-format-empty-element-tags)
. (oacs-format-separate-tags)
. (oacs-format-includes)
. (indent-region (point-min) (point-max) nil)
. )
.
. (defun oacs-format-empty-lines (count)
. "Replace multiple empty lines by COUNT empty lines. Mostly used with
. a COUNT of 2 for a single empty line or 1 to remove empty lines
. altogether."
. (save-excursion
. (replace-regexp "\\(
. \\s-*\\)\\{2,\\}" (make-string count ?\n) nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-comments ()
. "Make sure that comments are filed and both preceded and followed by
. an empty line."
. (save-excursion
.
. ;; Preceed all comments with an empty line.
.
. (replace-regexp "\\(^[^#]*\\(?:\\w\\|}\\).*
. \\)\\(\\s-*#\\)" "\\1
. \\2" nil (point-min) (point-max))
.
. ;; Proceed all comments with an empty line.
.
. (replace-regexp "\\(^\\s-*#.*
. \\)\\(\\s-*\\b[^#
. ]\\)" "\\1
. \\2" nil (point-min) (point-max))
.
. ;; Remove comments line w/o any text, just #'s and
. ;; whitespaces. They would interfere with the next step: filling
. ;; the paragraphs.
.
. (replace-regexp "^\\s-*#+\\s-*
. " "" nil (point-min) (point-max))
.
. ;; Remove all leading #'s
.
. (replace-regexp "#+\\s-*$" "" nil (point-min) (point-max))
.
. ;; Replace multiple #'s to a single #
.
. (replace-regexp "##+" "#" nil (point-min) (point-max))
.
. ;; Fill all comment paragraphs.
.
. (goto-char (point-min))
. (while (search-forward-regexp "^\\s-*#" nil t)
. (backward-sentence)
. (if (not (equal (point) (point-min)))
. (fill-paragraph nil)
. )
. (forward-paragraph)
. )
. )
. )
.
. (defun oacs-format-query-as ()
. "Place the keyword as on the same line as the field being selected"
. (save-excursion
. (replace-regexp "\\(
. \\|\\s-\\)+as\\b" " as" nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-operators ()
. "Place the operators =, ==, =>, < and > on the same line as the
. field(s) being compared/assigned. "
. (save-excursion
. (replace-regexp "\\(
. \\|\\s-\\)+\\(=\\|>\\|<\\)" " \\2" nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-logical-operators ()
. "Place logical operators || and && at the beginning of a new line."
. (save-excursion
. (replace-regexp "^\\(.*?\\w.*?\\)\\(||\\|&&\\)\\s-*\\\\?\\s-*\n?\\s-+" "\\1
. \\2 " nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-brackets ()
. "Remove spaces before and after brackets."
. (save-excursion
.
. ;; Remove spaces between ]}, }}, }] and ]] as well as leading
. ;; spaces before ] or }.
.
. (replace-regexp "\\(]\\|\\b\\|}\\)\\s-+\\(}\\|]\\)" "\\1\\2" nil (point-min) (point-max))
.
. ;; Remove spaces trailing }.
.
. (replace-regexp "\\({\\|\\[\\)\\s-+" "\\1" nil (point-min) (point-max))
.
. ;; Remove empty lines before a closing brace.
.
. (replace-regexp "\\(
. \\s-*\\)+\\(
. \\s-*}\\)" "\\2" nil (point-min) (point-max))
.
. ;; Place closing db_* } bracket at end of query instead of a new line.
.
. (replace-regexp "\\(db_.*{[^\\}]*\\)
. \\s-*}" "\\1}" nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-proc-call ()
. "Replace multiple spaces before a [ bracket by a single space and
. remove all trailing spaces. Replace all spaces before the closing ]
. bracket. And place named parameters on a separate line."
. (save-excursion
. (replace-regexp "\\(\\s-\\)+\\(\\[\\)\\(\\s-*\\)" " \\2" nil (point-min) (point-max))
. (replace-regexp "\\(\\s-\\)+\\(\\]\\)" "\\2" nil (point-min) (point-max))
. (goto-char (point-min))
. (while (search-forward-regexp "\\[" nil t)
. (replace-regexp "\\([^\\\\]\\b\\)\\(
. \\|\\s-\\)+-" "\\1 \\\\
. -" nil (point) (search-forward-regexp "\\]" nil t))
. )
. (indent-region (point-min) (point-max) nil)
. )
. )
.
. (defun oacs-format-proc ()
. "Format layout of ad_proc, proc and proc_doc."
. (let ((proc "\\(?:^\\s-*\\(?:ad_\\)?proc\\(?:_doc\\)?\\)"))
. (save-excursion
.
. ;; Place an empty line below the ad_proc, proc or proc_doc
. ;; definition.
.
. (replace-regexp
. (concat "\\("
. proc
. ".*{\\)
.
. +\\([^
. ]\\)") "\\1
. \\2" nil (point-min) (point-max))
.
. ;; Remove leading and trailing empty lines around } {
.
. (replace-regexp "\\(
. +\\)\\(} \\(?:-properties \\)?{\\)\\(
. *\\)" "
. \\2
. " nil (point-min) (point-max))
. )
. )
. )
.
. (defun oacs-format-proc-parameters ()
. "Format procedure parameters. Each parameter is placed on a new line."
. (save-excursion
. (goto-char (point-min))
. (while (search-forward-regexp "^\\s-*\\(?:ad_\\)?proc\\(?:_doc\\)?.*?{" nil t)
. (match-end 0)
. (backward-char)
. (let ((start (point))
. (end (save-excursion
. (forward-sexp)
. (point))))
. (save-restriction
. (forward-char)
. (narrow-to-region start end)
. (if (not (looking-at "\n"))
. (insert "\n")
. )
. (while (condition-case nil
. (progn
. (forward-sexp)
. t)
. (error nil))
. (if (not (looking-at "\n"))
. (insert "\n")
. )
. )
. )
. )
. )
. )
. )
.
. (defun oacs-format-page-contract ()
. "Remove empty lines below ad_page_contract."
. (save-excursion
. (replace-regexp "\\(ad_page_contract {\\)\\(
. +\\)" "\\1
. " nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-set ()
. "Remove superfluous spaces in 'set' and ad_page_contract
. initialization instructions."
. (save-excursion
. (replace-regexp "set\\s-+\\([^ ]+\\)\\s-\\{2,\\}" "set \\1 " nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-+{[^ ]+\\)\\s-\\{2,\\}" "\\1 " nil (point-min) (point-max))
. )
. )
.
. (defun oacs-replace-return ()
. "Replace return with ad-script-abort."
. (save-excursion
. (query-replace-regexp "^\\(\\s-*\\)return;?$" "\\1ad_script_abort" nil (point-min) (point-max))
. )
. )
.
. (defun oacs-format-tcl ()
. "Format a Tcl page"
. (interactive)
. (save-excursion
. (goto-char (point-min))
. (delete-trailing-whitespace)
. (oacs-format-empty-lines 2)
. (oacs-format-proc)
. (oacs-format-proc-parameters)
. (oacs-format-comments)
. (oacs-format-query-as)
. (oacs-format-operators)
. (oacs-format-logical-operators)
. (oacs-format-brackets)
. (oacs-format-proc-call)
. (oacs-format-page-contract)
. (oacs-format-set)
. (indent-region (point-min) (point-max) nil)
. (mmm-parse-buffer)
. )
. )
.
. (defun oacs-format-sql-comments ()
. "Make sure that SQL comments are filed and both preceded and followed by
. an empty line."
. (save-excursion
.
. ;; Preceed all comments with an empty line.
.
. (replace-regexp "\\(^[^-]*\\(?:\\w\\|}\\).*
. \\)\\(\\s-*--\\)" "\\1
. \\2" nil (point-min) (point-max))
.
. ;; Proceed all comments with an empty line.
.
. (replace-regexp "\\(^\\s-*--.*
. \\)\\(\\s-*\\b[^-
. ]\\)" "\\1
. \\2" nil (point-min) (point-max))
.
. ;; Fill all comment paragraphs. Commented out because filling
. ;; comments in sql.el doesn't work too well.
.
. ;; (goto-char (point-min))
. ;; (while (search-forward-regexp "^\\s-*--" nil t)
. ;; (backward-sentence)
. ;; (if (not (equal (point) (point-min)))
. ;; (fill-paragraph nil)
. ;; )
. ;; (forward-paragraph)
. ;; )
. )
. )
.
. (defun oacs-format-sql ()
. "Format a SQL script"
. (interactive)
. (save-excursion
. (replace-regexp "^\\(\\s-\\|-\\)\\{4,\\}
. " "" nil (point-min) (point-max))
. (replace-regexp "^.*?---.*?
. " "" nil (point-min) (point-max))
. (replace-regexp "(\\s-*\\(.*?\\)\\s-*)" "(\\1)" nil (point-min) (point-max))
. (replace-regexp "\\(\\s-\\|
. \\)+then" " then" nil (point-min) (point-max))
. (replace-regexp "\\(\\s-\\|
. \\)+default " " default " nil (point-min) (point-max))
. (replace-regexp "\\s-+in\\s-+" " in " nil (point-min) (point-max))
. (replace-regexp "\\s-+=>\\s-+" " => " nil (point-min) (point-max))
. (replace-regexp "\\(\\w\\)\\s-\\{2,\\}\\(\\w\\|=\\|!\\)" "\\1 \\2" nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-*\\)\\(select.*\\)\\s-+\\(into \\)" "\\1\\2
. \\1\\3" nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-*\\)\\(select.*[^)]\\)
. \\s-*\\(into\\)" "\\1\\2
. \\1\\3" nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-*\\)\\(into.*[^)]\\)
. \\s-*\\(from\\)" "\\1\\2
. \\1\\3" nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-*\\)\\(\\(delete\\|from\\).*[^)]\\)
. \\s-*\\(where\\)" "\\1\\2
. \\1\\4" nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-*\\)\\(update.*[^)]\\)
. \\s-*\\(set\\)" "\\1\\2
. \\1\\3" nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-*\\)\\(set.*[^)]\\)
. \\s-*\\(where\\)" "\\1\\2
. \\1\\3" nil (point-min) (point-max))
. (replace-regexp "^\\(\\s-*\\)\\(\\(where\\|and\\|or\\).*[^)]\\)
. \\s-*\\(and\\|or\\)" "\\1\\2
. \\1\\4" nil (point-min) (point-max))
. (replace-regexp "\\(if.*,\\)
. \\s-*" "\\1 " nil (point-min) (point-max))
. (untabify (point-min) (point-max))
. (replace-regexp "^\\s-\\{10\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
. (replace-regexp "^\\s-\\{9\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
. (replace-regexp "^\\s-\\{7\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
. (replace-regexp "^\\s-\\{6\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
. (replace-regexp "^\\s-\\{3\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
. (replace-regexp "^\\s-\\{5\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
. (oacs-format-sql-comments)
. (oacs-format-empty-lines 2)
. )
. )
.
. (provide 'oacs-format)
. ;;; oacs-format.el ends here
}
W
oacs/.bzr/weaves/18/ 0000755 0001750 0001750 00000000000 10412346107 013016 5 ustar dave dave oacs/.bzr/weaves/18/oacscomment.el-20060328214111-7c05f1b576f69e1a.weave 0000644 0001750 0001750 00000007150 10412346107 022560 0 ustar dave dave # bzr weave file v5
i
1 7ced8065dde2d084ecdf0135832f519df270d657
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-comment.el --- OACS tcl comment adaptation
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: convenience, tools, extensions
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; Adapt the Tcl comment functions so that ad_proc documentation text
. ;; is classified as comments and can be formatted using auto-fill and
. ;; M-q.
.
. ;;; Code:
.
. (defadvice tcl-in-comment (after tcl-in-comment)
. "Classify ad_proc documentation text as comments so that
. tcl-do-fill-paragraph also can be used on the documentation text."
. (save-excursion
. (let ((bound (point))
. (start (if (not (search-backward-regexp "}[ \t]+{" nil t 2))
. (goto-char (point-min))
. )))
. (if (search-forward-regexp "^\\s-*\\(\\(ad_\\)?proc\\(_doc\\)?\\|ad_library\\).*{" bound t)
. (setq ad-return-value t)
. )
. )
. )
. )
. (ad-activate 'tcl-in-comment)
.
. (defadvice tcl-do-fill-paragraph (around fill-proc-documentation)
. "Comment the documentation of ad_proc or proc_doc so that
. tcl-do-fill-paragraph can fill the documentation paragraphs. Uncomment
. the documentation after filling the paragraph."
. (save-excursion
. (let ((bound (point))
.
. ;; Locate the last but one section separator, or if there is
. ;; none start from the top of the buffer.
.
. (start (if (not (search-backward-regexp "}[ \t]+{" nil t 2))
. (goto-char (point-min))
. )))
.
. ;; Check if there is a proc definition between the section
. ;; separator and the current location.
.
. (if (not (search-forward-regexp "^\\s-*\\(\\(ad_\\)?proc\\(_doc\\)?\\|ad_library\\).*{" bound t))
.
. ;; The current location is NOT in a proc documentation
. ;; section. Execute tcl-do-fill-paragraph w/o massaging the
. ;; paragraph first.
.
. (progn
. (goto-char bound)
. ad-do-it)
.
. ;; The current location is in a proc documentation
. ;; section. Comment the section before running
. ;; tcl-do-fill-paragraph. Uncomment the section after filling
. ;; the paragraph.
.
. (goto-char bound)
. (backward-up-list)
. (comment-region (save-excursion
. (forward-to-indentation 1)
. (point))
. (save-excursion
. (forward-sexp)
. (backward-char)
. (point)))
. (goto-char bound)
. ad-do-it
. (goto-char bound)
. (backward-up-list)
. (uncomment-region (save-excursion
. (forward-to-indentation 1)
. (point))
. (save-excursion
. (forward-sexp)
. (backward-char)
. (point)))
. )
. )
. )
. )
. (ad-activate 'tcl-do-fill-paragraph)
.
. ;;; Always activate the minor tcl-auto-fill-mode in major tcl-mode
. (add-hook 'tcl-mode-hook 'tcl-auto-fill-mode)
.
. (provide 'oacs-comment)
. ;;; oacs-comment.el ends here
}
W
oacs/.bzr/weaves/57/ 0000755 0001750 0001750 00000000000 10412346111 013014 5 ustar dave dave oacs/.bzr/weaves/57/oacserrorlog.el-20060328214111-b829e130a95a3d52.weave 0000644 0001750 0001750 00000011147 10412346111 022656 0 ustar dave dave # bzr weave file v5
i
1 5ab3b90764c98ac7cbde30e1f542a883ea89cfce
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-error-log.el --- Monitor an AOLServer error log.
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: tools, processes, extensions
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. (define-generic-mode 'nsd-error-mode
. nil
. '("Bug" "Debug" "Error" "Fatal" "Notice" "Warning")
. '(("^\\(\\[.*\\]\\)" . font-lock-string-face)
. ("\\([^:]:\\{1,1\\}[A-Za-z_0-9]+\\)" . font-lock-variable-name-face)
. ("sql(.*?):\\([^[]*\\)" . font-lock-function-name-face))
. nil
. (list
. (lambda ()))
. "Major mode for AOLServer error logs.
.
. If you turn on font-lock-mode, you also get nice highlighting.")
.
. (defun oacs-monitor-error-log ()
. "Monitor an AOLServer error log in a buffer. SERVER is the name of the AOLServer.
.
. The logfile must be called SERVER-error.log. The directories
. oacs-error-log-dirs are sought until one containing a logfile is found.
.
. The buffer is put in Major mode NSD and Minor mode OACS."
. (interactive)
. (let* ((server (read-string
. "Server: " nil 'oacs-error-log-history))
. (error-basename (concat server "-error.log"))
. (error-log-dirs oacs-error-log-dirs)
. (error-log-dir nil)
. (error-log "/*"))
.
. ;; Switch to buffer if the log is already open. If not locate the
. ;; log file and open.
.
. (when (not (get-buffer error-basename))
. (while (and error-log-dirs (not (file-readable-p error-log)))
. (setq error-log-dir (file-name-as-directory (car error-log-dirs)))
. (setq error-log (concat error-log-dir error-basename))
. (message "Trying %s" error-log)
. (setq error-log-dirs (cdr error-log-dirs)))
. (if (not (file-readable-p error-log))
. (error "No logfile for %s found" server))
.
. ;; Open the located error log in nsd-error-mode and move to the
. ;; end of the log. Then turn auto-revert-mode on.
.
. (message "Monitoring %s" error-log)
. (find-file error-log)
. (goto-char (point-max))
. (nsd-error-mode)
. (auto-revert-mode 1)
.
. ;; MMM-ify the region that was just added to the log.
.
. (setq oacs-error-log-prev-point-max (point-max))
. (set-buffer error-basename)
. (add-hook 'after-revert-hook 'oacs-mmm-ify-log-region 1)
. (setq default-directory error-log-dir))
. (set-window-buffer (selected-window) (get-buffer-create error-basename))))
.
. (defun oacs-mmm-ify-log-region ()
. "MMM-ify the region that was just added to the AOLserver error
. log. Move the POINT to the end of the buffer if the POINT was at the
. end of the buffer before reverting."
. (if (and oacs-mmm-ify-log
. (< oacs-error-log-prev-point-max (point-max)))
. (progn
. (count-lines-region oacs-error-log-prev-point-max (point-max))
. (mmm-parse-region oacs-error-log-prev-point-max (point-max))
. (if (eq oacs-error-log-prev-point-max (point))
. (goto-char (point-max)))
. (setq oacs-error-log-prev-point-max (point-max)))))
.
. (defun oacs-revert-log ()
. "Revert the buffer to the log file on disk without asking for
. confirmation"
. (interactive)
. (revert-buffer nil t))
.
. ;; Add global map so that a log can be opened from any Emacs buffer.
.
. (global-set-key "\M-oml" 'oacs-monitor-error-log)
.
. ;; Associate log files in the error log directories with
. ;; nsd-error-mode
.
. (let* ((error-log-dirs oacs-error-log-dirs))
. (while (and error-log-dirs)
. (add-to-list 'auto-mode-alist (cons (concat (car error-log-dirs) ".*error\\.log") 'nsd-error-mode))
. (setq error-log-dirs (cdr error-log-dirs))))
.
. ;; Also associate Daemontools backup log files with Nsd-error-mode.
.
. (add-to-list 'auto-mode-alist '("@.*\\.s" . nsd-error-mode))
.
. (provide 'oacs-error-log)
. ;;; oacs-error-log.el ends here
}
W
oacs/.bzr/weaves/d5/ 0000755 0001750 0001750 00000000000 10412346115 013075 5 ustar dave dave oacs/.bzr/weaves/d5/oacsheaders.el-20060328214111-8a6cf86308f162d6.weave 0000644 0001750 0001750 00000015630 10412346115 022536 0 ustar dave dave # bzr weave file v5
i
1 bdd667883182ab2ad7fd65df1b699f9be3df8e01
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-headers.el --- OACS auto insert headers extension
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: convenience, extensions, tools
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; OACS auto insert headers. Insert standard headers when creating new
. ;; OpenACS files.
.
. ;;; Code:
.
. ;;; Auto insert headers when creating new OpenACS files.
. (require 'autoinsert)
. (auto-insert-mode)
. (setq auto-insert-query nil)
. (define-auto-insert "\.adp$" 'oacs-adp-template)
. (define-auto-insert "www/.*\.tcl$" 'oacs-tcl-template)
. (define-auto-insert "resources/.*\.tcl$" 'oacs-tcl-template)
. (define-auto-insert (concat oacs-base-dir ".*/lib/.*\.tcl$") 'oacs-inc-template)
. (define-auto-insert "tcl/.*\.tcl$" 'oacs-lib-template)
. (define-auto-insert "\.vuh$" 'oacs-vuh-template)
. (define-auto-insert "\.xql$" 'oacs-xql-template)
. (define-auto-insert "sql/[^/]*/?.*\.sql$" 'oacs-sql-template)
.
. (defun oacs-file-name ()
. "Get the file name of the current buffer relative to the OpenACS
. base dir."
. (let ((file-name (buffer-file-name)))
. (if (string-match (concat oacs-base-dir "/[^/]*/") file-name)
. (substring file-name (match-end 0))
. )
. ))
.
. ;;; Skeleton definitions.
. (define-skeleton oacs-adp-template
. "Insert master tag with selected property tags into a new .adp page"
. nil
. "" \n >
. (if (string-equal (setq v1 (read-string "Title: (empty is none) " "@title@")) "")
. ""
. (concat ""v1"")) & \n >
. (if (string-equal (setq v1 (read-string "Header stuff: (empty is none) " "@header_stuff@")) "")
. ""
. (concat ""v1"")) & \n >
. (if (string-equal (setq v1 (read-string "Context: (empty is none) " "@context@")) "")
. ""
. (concat ""v1"")) & \n >
. (if (string-equal (setq v1 (read-string "Focus: (empty is none) " "@focus@")) "")
. ""
. (concat ""v1"")) & \n ?\n
. _
. )
.
. (define-skeleton oacs-tcl-template
. "Declare the Tcl part of OpenACS web page."
. "Brief documentation: "
. "# " (oacs-file-name) \n \n
. "ad_page_contract {" \n \n
. > str | _ \n \n
. > '(oacs-author) ?\n
. > '(oacs-creation-date) ?\n
. (if (not (null oacs-insert-cvs-id))
. (skeleton-insert '(nil
. > '(oacs-cvs-id) ?\n)))
. > -4 "} {" \n
. > _ ?\n
. "} -properties {
. } -validate {
. } -errors {
. }
.
. "
. )
.
. (define-skeleton oacs-lib-template
. "Declare an OpenACS Tcl library."
. nil
. "# " (oacs-file-name) \n \n
. "ad_library {" \n \n
. > _ \n \n
. > '(oacs-author) ?\n
. > '(oacs-creation-date) ?\n
. (if (not (null oacs-insert-cvs-id))
. (skeleton-insert '(nil
. > '(oacs-cvs-id) ?\n)))
. > -4 "}" \n \n
. )
.
. (define-skeleton oacs-inc-template
. "Declare a OpenACS page."
. "Brief documentation: "
. "# " (oacs-file-name) ?\n
. "#" ?\n
. "# " str | _ ?\n
. "#" ?\n
. "# " '(oacs-author) ?\n >
. "# " '(oacs-creation-date) ?\n
. (if (not (null oacs-insert-cvs-id))
. (skeleton-insert '(nil
. "# " '(oacs-cvs-id) ?\n)))
. ?\n
. "foreach required_param {"
. (while (not (equal (setq parameter (read-string "Required parameter: " nil 'oacs-parameter-history)) ""))
. (skeleton-insert '(nil parameter " "))
. ) & -1
. "} {" \n
. "if {![info exists $required_param]} {" \n
. "return -code error \"$required_param is a required parameter.\"" \n
. -4 "}" \n
. -4 "}" \n
. "foreach optional_param {"
. (while (not (equal (setq parameter (read-string "Optional parameter: " nil 'oacs-parameter-history)) ""))
. (skeleton-insert '(nil parameter " "))
. ) & -1
. "} {" \n
. "if {![info exists $optional_param]} {" \n
. "set $optional_param {}" \n
. -4 "}" \n
. -4 "}"\n
. _
. )
.
. (define-skeleton oacs-vuh-template
. "Declare a .VUH OpenACS web page."
. "Brief documentation: "
. "# " (oacs-file-name) ?\n
. "#" ?\n
. "# " str | _ ?\n
. "#" ?\n
. "# " '(oacs-author) ?\n >
. "# " '(oacs-creation-date) ?\n
. (if (not (null oacs-insert-cvs-id))
. (skeleton-insert '(nil
. "# " '(oacs-cvs-id) ?\n)))
. ?\n
. _
. )
.
. (define-skeleton oacs-xql-template
. "Declare an OpenACS xql query definition file."
. nil
. "" ?\n
. (if oacs-tdom-installed
. (concat "")) \n
. (concat "") \n
. "" \n
. "" \n
. (if (not (null oacs-insert-cvs-id))
. (skeleton-insert '(nil
. "" \n \n)))
. "" \n
. (if (string-match ".*-oracle.xql$" (buffer-file-name))
. (skeleton-insert '(nil
. \n \n
. > "" \n
. > "oracle" \n
. ""
. (read-string "Oracle version: " oacs-oracle-version 'oacs-oracle-version-history)
. "" \n
. -2 "" \n &"\n")
. )
. )
. (if (string-match ".*-postgresql.xql$" (buffer-file-name))
. (skeleton-insert '(nil
. \n \n
. > "" \n
. > "postgresql" \n
. ""
. (read-string "PostgreSQL version: " oacs-postgresql-version 'oacs-postgres-version-history)
. "" \n
. -2 "" \n &"\n")
. )
. )
. > _ ?\n
. "" \n
. )
.
. (define-skeleton oacs-sql-template
. "Declare an OpenACS sql data model definition file."
. nil
. "-- " \n
. "-- " (oacs-file-name) ?\n
. "-- " \n
. "-- " '(oacs-author) ?\n
. "-- " '(oacs-creation-date) ?\n
. (if (not (null oacs-insert-cvs-id))
. (skeleton-insert '(nil
. "-- " '(oacs-cvs-id) ?\n)))
. "--" \n \n
. _
. )
.
. (provide 'oacs-headers)
. ;;; oacs-headers.el ends here
}
W
oacs/.bzr/weaves/9d/ 0000755 0001750 0001750 00000000000 10412346117 013103 5 ustar dave dave oacs/.bzr/weaves/9d/oacsmmm.el-20060328214111-5853ebdb1fb7a866.weave 0000644 0001750 0001750 00000015313 10412346117 022052 0 ustar dave dave # bzr weave file v5
i
1 c72496adaee26af6755a0f20920eaf85a99835ac
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-mmm.el --- OACS MMM extension
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: convenience, extensions, tools
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; Part of the Emacs OACS module. See oacs.el for more information.
.
. ;;; Code:
.
. ;;; Multiple Majort Mode support for embedded sql in xql files.
. (require 'mmm-auto)
. (require 'mmm-mode)
.
. ;;; Most useful value for mmm-global-mode, is the symbol `maybe',which
. ;; causes MMM Mode to turn itself on in precisely those buffers where
. ;; it would be useful.
. (setq mmm-global-mode 'maybe)
.
. ;;; Same background color in submode as major mode
. (setq mmm-submode-decoration-level '0)
.
. ;;; Automatically select mmm and embedded-sql for XQL files.
. (mmm-add-mode-ext-class nil ".xql" 'oacs-xql-embedded-sql)
.
. ;;; Define oacs-xql-embedded-sql mode
. (mmm-add-classes
. '((oacs-xql-embedded-sql
. :submode sql-mode
. :face mmm-declaration-submode-face
. :front ""
. :back ""
. :creation-hook oacs-xql-query-bind-and-send-hook)))
.
. ;;; Automatically select mmm and embedded-sql for AOLserver log files.
. (if oacs-mmm-ify-log
. (mmm-add-mode-ext-class nil ".log" 'oacs-log-embedded-sql))
.
. ;;; Define log-embedded-sql mode
. (mmm-add-classes
. '((oacs-log-embedded-sql
. :submode sql-mode
. :face mmm-declaration-submode-face
. :front "sql(.*?):\\s-*\\b"
. :back "\\b\\s-+\\["
. :creation-hook oacs-log-query-bind-and-send-hook)))
.
. ;;; Define oacs-tcl-embedded-sql mode
. (mmm-add-classes
. '((oacs-tcl-embedded-sql
. :submode sql-mode
. :face mmm-declaration-submode-face
. :front "db_\\(\\w\\|_\\)+\\(\\s-+\\(\\w\\|_\\)+\\)+\\s-+\\({\\|\"\\)"
. :back "\\(}\\|\"\\)")))
. (mmm-add-mode-ext-class 'tcl-mode nil 'oacs-tcl-embedded-sql)
.
. ;;; Use 'oacs-query-bind-and-send when in oacs-log-embedded-sql mode
. (defun oacs-log-query-bind-and-send-hook ()
. "Use oacs-query-bind-and-send for `comint-input-sender'."
. (add-to-list 'mmm-save-local-variables '(comint-input-sender region))
. (setq comint-input-sender 'oacs-query-bind-and-send)
. (add-to-list 'mmm-save-local-variables '(paragraph-start region))
. (setq paragraph-start "^\\[.*\\|^\\s-+'")
. (setq paragraph-separate "^\\[.*$")
. )
.
. ;;; Use 'oacs-query-bind-and-send when in oacs-xql-embedded-sql mode
. (defun oacs-xql-query-bind-and-send-hook ()
. "Use oacs-query-bind-and-send for `comint-input-sender'."
. (add-to-list 'mmm-save-local-variables '(comint-input-sender region (xml-mode)))
. (setq comint-input-sender 'oacs-query-bind-and-send)
. )
.
. ;;; .vuh files are really Tcl files
. (add-to-list 'auto-mode-alist '("\\.vuh" . tcl-mode))
.
. (defun oacs-query-bind-and-send (proc string)
. "Send to PROC input STRING, maybe replacing bind variables.
. Placeholders are words starting with a colon like :this and may
. contain underscores like :so_and_so. This function is used for
. `comint-input-sender' in `sql-postgres`, `sql-oracle` and `sql-mode`."
. (message "%s" string)
. (while (string-match "[ =]:\\(\\(\\sw\\|_\\)+\\)" string)
. (setq string (replace-match
. (concat
. "'" (read-from-minibuffer
. (format "Enter value for %s: " (match-string 1 string))
. nil nil nil sql-placeholder-history) "'")
. t t string)))
. (comint-send-string proc string)
. (comint-send-string proc "\n"))
.
. (defadvice sql-mode (after sql-mode)
. "Use oacs-query-bind-and-send for `comint-input-sender'."
. (make-variable-buffer-local 'comint-input-sender)
. (setq comint-input-sender 'oacs-query-bind-and-send)
. )
. (ad-activate 'sql-mode)
.
. (defadvice sql-oracle (after sql-oracle)
. "Use oacs-query-bind-and-send for `comint-input-sender'."
. (make-variable-buffer-local 'comint-input-sender)
. (setq comint-input-sender 'oacs-query-bind-and-send)
. )
. (ad-activate 'sql-oracle)
.
. (defadvice sql-postgres (after sql-postgres)
. "Use oacs-query-bind-and-send for `comint-input-sender'."
. (make-variable-buffer-local 'comint-input-sender)
. (setq comint-input-sender 'oacs-query-bind-and-send)
. )
. (ad-activate 'sql-postgres)
.
. ;;; Redefine sql-send-region so that is uses the comint-input-sender.
. (require 'sql)
. (defun sql-send-region (start end)
. "Send a region to the SQL process."
. (interactive "r")
. (if (buffer-live-p sql-buffer)
. (save-excursion
. (let ((string (buffer-substring start end)))
. (if (string-match ";$" string)
. ()
. (setq string (concat string ";")))
. (if (string-match "\n$" string)
. ()
. (setq string (concat string "\n")))
. (funcall comint-input-sender sql-buffer string)
. (message "Sent string to buffer %s." (buffer-name sql-buffer)))
. (if sql-pop-to-buffer-after-send-region
. (pop-to-buffer sql-buffer)
. (display-buffer sql-buffer)))
. (message "%s" "No SQL process started.")))
.
. ;;; Store the region send the SQLi process in the history of the SQLi
. ;; buffer.
. (defadvice sql-send-region (after sql-store-in-history)
. "The region sent to the SQLi process is also stored in the history."
. (let ((history (buffer-substring-no-properties start end)))
. (save-excursion
. (set-buffer sql-buffer)
. (if (and (funcall comint-input-filter history)
. (or (null comint-input-ignoredups)
. (not (ring-p comint-input-ring))
. (ring-empty-p comint-input-ring)
. (not (string-equal (ring-ref comint-input-ring 0)
. history))))
. (ring-insert comint-input-ring history))
. (setq comint-save-input-ring-index comint-input-ring-index)
. (setq comint-input-ring-index nil))))
. (ad-activate 'sql-send-region)
.
. (provide 'oacs-mmm)
. ;;; oacs-mmm.el ends here
}
W
oacs/.bzr/weaves/b3/ 0000755 0001750 0001750 00000000000 10412346136 013074 5 ustar dave dave oacs/.bzr/weaves/b3/oacsnxml.el-20060328214111-dc826926cd3d0861.weave 0000644 0001750 0001750 00000002736 10412346120 022067 0 ustar dave dave # bzr weave file v5
i
1 55e9d2790cd1b9707c5e4dc16a98966a27242a91
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-nxml.el --- OACS NXML extension
.
. ;; Copyright (C) 2004 Free Software Foundation, Inc.
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: extensions, convenience, tools
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; Part of the Emacs OACS module. See oacs.el for more information.
.
. ;;; Code:
.
. ;; nXML mode
. (load "rng-auto.el")
.
. (setq auto-mode-alist
. (append (list '("\\.adp" . nxml-mode)
. '("\\.xql" . nxml-mode)
. '("\\.info" . nxml-mode))
. auto-mode-alist))
.
. (provide 'oacs-nxml)
. ;;; oacs-nxml.el ends here
}
W
oacs/.bzr/weaves/b3/schemas.xml-20060328214111-f959242ef0757ba0.weave 0000644 0001750 0001750 00000001003 10412346136 022060 0 ustar dave dave # bzr weave file v5
i
1 2b072382d12600f0b1f764be4d6bda3fc9167002
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
.
.
.
.
.
.
.
.
.
.
.
.
.
}
W
oacs/.bzr/weaves/cf/ 0000755 0001750 0001750 00000000000 10412346122 013153 5 ustar dave dave oacs/.bzr/weaves/cf/oacsoccur.el-20060328214111-7d45db9d0ee0de5e.weave 0000644 0001750 0001750 00000006101 10412346122 022577 0 ustar dave dave # bzr weave file v5
i
1 be3927f4ffa788e7e35561b1ea604738a6e33044
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-occur.el --- OACS occur extensions
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: convenience, extensions, tools
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; OACS occur extensions to quickly locate debug messages, procedure
. ;; definitions in OpenACS code or error log.
.
. ;; Uses color occur if available. Color occur is highly recommended
. ;; but not required. Download from:
.
. ;; http://www.emacswiki.org/elisp/color-occur.el
.
. ;;; Code:
.
. ;; Load color-occur if available.
. (condition-case nil
. (require 'color-occur)
. (error nil))
.
. (defun oacs-occur-dbg (&optional level)
. "Find occurances of your dbg messages."
. (interactive)
. (occur
. (concat "^\\[[^\\w
. ]*" level "
. -*
. " (upcase (user-login-name)) "[^\\[]*" nil)
. )
. )
.
. (defun oacs-occur-dbg-bug ()
. (interactive)
. (oacs-occur-dbg " Bug: ")
. "Find occurances of your bug level dbg messages."
. )
.
. (defun oacs-occur-dbg-debug ()
. (interactive)
. (oacs-occur-dbg " Debug: ")
. "Find occurances of your debug level dbg messages."
. )
.
. (defun oacs-occur-dbg-error ()
. (interactive)
. (oacs-occur-dbg " Error: ")
. "Find occurances of your error level dbg messages."
. )
.
. (defun oacs-occur-dbg-fatal ()
. "Find occurances of your fatal level dbg messages."
. (interactive)
. (oacs-occur-dbg " Fatal: ")
. )
.
. (defun oacs-occur-dbg-notice ()
. "Find occurances of your notice level dbg messages."
. (interactive)
. (oacs-occur-dbg " Notice: ")
. )
.
. (defun oacs-occur-dbg-warning ()
. "Find occurances of your warning level dbg messages."
. (interactive)
. (oacs-occur-dbg " Warning: ")
. )
.
. (defun oacs-occur-proc ()
. "Find occurances of ad_proc, proc, or doc_proc definitions."
. (interactive)
. (occur "^\\s-*\\(ad_\\|doc_\\)?proc\\b")
. )
.
. (defun oacs-occur-function ()
. "Find occurances of function definitions."
. (interactive)
. (occur "^\\s-*function\\s-+[^ ]+\\s-+(" nil)
. )
.
. (defun oacs-occur-query ()
. "Find occurances of query definitions."
. (interactive)
. (occur "^[ ]*<\\(full\\|partial\\)query" nil)
. )
.
. (provide 'oacs-occur)
. ;;; oacs-occur.el ends here
}
W
oacs/.bzr/weaves/ca/ 0000755 0001750 0001750 00000000000 10412346130 013145 5 ustar dave dave oacs/.bzr/weaves/ca/oacspsgml.el-20060328214111-2afef53a5a80bfe0.weave 0000644 0001750 0001750 00000010163 10412346130 022567 0 ustar dave dave # bzr weave file v5
i
1 13dba4e7ea966ae6112d907c69acc4decb9c70e1
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-psgml.el --- OACS PSGML extension
.
. ;; Copyright (C) 2004 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: extensions, convenience, tools
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; Part of the Emacs OACS module. See oacs.el for more information.
.
. ;;; Code:
.
. (require 'psgml)
. (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t)
. (autoload 'xml-mode "psgml" "Major mode to edit XML files." t)
. (add-to-list 'auto-mode-alist '("\\.html" . sgml-mode))
. (add-to-list 'auto-mode-alist '("\\.htm" . sgml-mode))
. (add-to-list 'auto-mode-alist '("\\.adp" . xml-mode))
. (add-to-list 'auto-mode-alist '("\\.xml" . xml-mode))
. (add-to-list 'auto-mode-alist '("\\.xql" . xml-mode))
. (add-to-list 'auto-mode-alist '("\\.info" . xml-mode))
. (add-to-list 'sgml-markup-faces
. '((start-tag . font-lock-function-name-face)
. (end-tag . font-lock-function-name-face)
. (comment . font-lock-comment-face)
. (pi . bold)
. (sgml . bold)
. (doctype . bold)
. (entity . font-lock-type-face)
. (shortref . font-lock-function-name-face))
. )
. (setq sgml-set-face t)
. (setq-default sgml-indent-data t)
. (setq-default sgml-ignore-undefined-elements nil)
. (setq-default sgml-auto-activate-dtd t)
. (add-to-list 'sgml-custom-dtd
. '("XQL 1.0"
. "\n" ))
. (add-to-list 'sgml-custom-dtd
. '("XHTML 1.1"
. "\n"))
. (add-to-list 'sgml-custom-dtd
. '("XHTML 1.0 Frameset"
. "\n" ))
. (add-to-list 'sgml-custom-dtd
. '("XHTML 1.0 Strict"
. "\n" ))
. (add-to-list 'sgml-custom-dtd
. '("XHTML 1.0 Transitional"
. "\n" ))
. (add-to-list 'sgml-custom-dtd
. '("Package 1.0"
. "\n" ))
. (add-to-list 'sgml-custom-dtd
. '("HTML 4.01 Frameset"
. ""))
. (add-to-list 'sgml-custom-dtd
. '("HTML 4.01 Strict"
. ""))
. (add-to-list 'sgml-custom-dtd
. '("HTML 4.01 Transitional"
. ""))
. (add-to-list 'sgml-custom-dtd
. '("HTML 3.2"
. ""))
.
. (provide 'oacs-psgml)
. ;;; oacs-psgml.el ends here
}
W
oacs/.bzr/weaves/82/ 0000755 0001750 0001750 00000000000 10412346132 013015 5 ustar dave dave oacs/.bzr/weaves/82/oacsvars.el-20060328214111-034297ee45ef5713.weave 0000644 0001750 0001750 00000012441 10412346132 021730 0 ustar dave dave # bzr weave file v5
i
1 58fb2967e7afeccc29e63c992a1e9fdc7328f1d3
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs-vars.el --- Oacs customizable and global variables
.
. ;; Copyright (C) 2005 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: extensions
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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 oacs nil
. "OpenACS extensions."
. :version "21.1"
. :link '(emacs-commentary-link "oacs")
. :link '(url-link "http://www.thecodemill.biz/")
. :group 'convenience)
.
. (defcustom oacs-tdom-installed "t"
. "Is tDOM installed on the OpenACS site?"
. :type 'boolean
. :group 'oacs)
.
. (defcustom oacs-base-dir "/web"
. "Base directory of a OpenACS installation."
. :type 'string
. :group 'oacs)
.
. (defcustom oacs-dbg-severity "notice"
. "Default severity for oacs-dbg."
. :type 'string
. :group 'oacs)
.
. (defcustom oacs-oracle-version "8.1.6"
. "Default Oracle database version."
. :type 'string
. :group 'oacs)
.
. (defcustom oacs-postgresql-version "7.2"
. "Default PostgreSQL database version."
. :type 'string
. :group 'oacs)
.
. (defcustom oacs-proc-type "-public"
. "Default procedure type for oacs-proc."
. :type 'string
. :group 'oacs)
.
. (defcustom oacs-mode-prefix-key [(meta ?o)]
. "Prefix key for the OACS Minor Mode Keymap."
. :type 'vector
. :group 'oacs)
.
. (defcustom oacs-error-log-dirs (quote ("/var/log/aolserver"))
. "List of directories that might contain AOLServer error logs."
. :type '(repeat string)
. :group 'oacs)
.
. (defcustom oacs-mmm-ify-log "t"
. "Use MMM mode in the AOLserver server logs? MMM tends to be very
. slow on large log files."
. :type 'boolean
. :group 'oacs)
.
. (defcustom oacs-preferred-xml-mode 'psgml
. "Preferred XML mode handler. Psgml or Nxml."
. :type '(choice (const :tag "Psgml-mode" :value psgml)
. (const :tag "Nxml-mode" :value nxml))
. :group 'oacs)
.
. (defcustom oacs-insert-cvs-id "t"
. "Insert @cvsid $Id$?"
. :type 'boolean
. :group 'oacs)
.
. (defvar oacs-proc-type-history nil
. "History of ad_proc procedure types")
.
. (defvar oacs-proc-name-history nil
. "History of ad_proc procedure names")
.
. (defvar oacs-parameter-history nil
. "History of ad_proc parameters")
.
. (defvar oacs-proc-parameters nil
. "List of parameters entered by the user when defining an ad_proc.")
.
. (defvar oacs-dbg-type-history nil
. "History of debugging severities")
.
. (defvar oacs-oracle-version-history nil
. "History of Oracle database versions")
.
. (defvar oacs-postgres-version-history nil
. "History of PostgreSQL database versions")
.
. (defvar oacs-error-log-history nil
. "History of AOLserver error log files")
.
. (defvar oacs-error-log-prev-point-max nil
. "The location of the end of the error log at the end of the previous
. update of the error log. Used to MMM-ify only the new addition to the
. log.")
.
. (defvar oacs-mode nil
. "Toggle OACS Minor Mode.")
.
. (defvar oacs-mode-map nil
. "Keymap for OACS Minor Mode.")
.
. (defvar oacs-imenu-tcl-expression
. '(
. ("Procedures (-warn)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(public\\|private\\|depreciated\\)\\s-+\\)*-warn\\s-+\\(-\\(public\\|private\\|depreciated\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
. ("Procedures (-public)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(warn\\|private\\|depreciated\\)\\s-+\\)*-public\\s-+\\(-\\(warn\\|private\\|depreciated\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
. ("Procedures (-private)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(warn\\|public\\|depreciated\\)\\s-+\\)*-private\\s-+\\(-\\(warn\\|public\\|depreciated\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
. ("Procedures (-depreciated)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(warn\\|public\\|private\\)\\s-+\\)*-depreciated\\s-+\\(-\\(warn\\|public\\|private\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
. (nil "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-[^ ]*\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 4)
. )
. "Value for `imenu-generic-expression' for Tcl files in Oacs Minor Mode.")
.
. (defvar oacs-imenu-sql-expression
. '(
. ("Tables" "^\\s-*create\\s-+table\\s-+\\(\\(\\w\\|_\\)+\\)" 1)
. ("Sequences" "^\\s-*create\\s-+sequence\\s-+\\(\\(\\w\\|_\\)+\\)" 1)
. ("Packages" "^\\s-*create\\s-+\\(or\\s-+replace\\s-+\\)?package\\s-+\\(.*\\)$" 2)
. ("Functions" "^\\s-*create\\s-+\\(or\\s-+replace\\s-+\\)?function\\s-+\\(\\(\\w\\|_\\)+\\)" 2)
. )
. "Value for `imenu-generic-expression' for SQL files in Oacs Minor Mode.")
.
. (provide 'oacs-vars)
. ;;; oacs-vars.el ends here
}
W
oacs/.bzr/weaves/50/ 0000755 0001750 0001750 00000000000 10412346134 013012 5 ustar dave dave oacs/.bzr/weaves/50/oacs.el-20060328214111-1e9b9c8da324da27.weave 0000644 0001750 0001750 00000032041 10412346134 021241 0 ustar dave dave # bzr weave file v5
i
1 7d851a51e1378a6f2425fdef186f74f925965981
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. ;;; oacs.el --- OpenACS extensions
.
. ;; Copyright (C) 2003 the Code Mill
.
. ;; Author: Bart Teeuwisse
. ;; Keywords: abbrev, extensions, convenience, tools
.
. ;; This file 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.
.
. ;; This file is distributed in the hope that it will be useful,
. ;; 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:
.
. ;; The latest version of oacs is always available from:
. ;;
. ;; - http://www.thecodemill.biz/services/oacs/
. ;;
. ;; Oacs depends on the psgml/nxml and mmm modules to be
. ;; installed. Psgml and mmm are available from sourceforge.net:
. ;;
. ;; - http://psgml.sourceforge.net/
. ;; - http://mmm-mode.sourceforge.net/
. ;;
. ;; Nxml is an alternative to psgml and available from:
. ;;
. ;;
. ;; Psgml/nxml can be installed along side one another. Oacs defaults
. ;; to psgml if both are installed unless oacs-preferred-xml-mode is set
. ;; to nxml.
. ;;
. ;; Color-occur is not required but highly recommended. Especially in
. ;; combination with the various M-oo* keystrokes. (See oacs-occur.el)
. ;;
. ;; - http://www.emacswiki.org/elisp/color-occur.el
. ;;
. ;; Besides oacs specific variables, oacs uses the common Emacs
. ;; variables:
. ;;
. ;; - user-full-name
. ;; - user-mail-address
. ;;
. ;; Set them in your .emacs file and your full name and e-mail address
. ;; will be included in all OpenACS headers.
. ;;
. ;; Oacs adds several DTDs to psgml, which in order to use need to be
. ;; installed. The set consists of common HTML DTDs as well as a DTD
. ;; for the OpenACS specific XQL format. You can find a complete set as
. ;; added by oacs at:
. ;;
. ;; - http://www.thecodemill.biz/repository/oacs-dtds.tgz
. ;;
. ;; Installation instructions are included in the archive. If you
. ;; prefer nxml over psgml install XXX instead. Download XXX from:
. ;;
. ;; - http://www.thecodemill.biz/repository/oacs-XXX.tgz
. ;;
. ;; Oacs variables can be customized using:
. ;;
. ;; - M-x customize-group oacs
. ;;
. ;; Oacs is intended to have as little side effects as
. ;; possible. However, it does set various psgml and mmm
. ;; variables. Should they clash with your preferences simply remove
. ;; them from oacs.
.
. ;;; Code:
.
. ;; Load preferred XML mode. Should psgml fail to load -perhaps because
. ;; psgml wasn't installed- then fall back on Nxml mode.
.
. (require 'oacs-vars)
. (if (equal oacs-preferred-xml-mode 'psgml)
. (condition-case nil
. (require 'oacs-psgml)
. (error (require 'oacs-nxml)))
. (require 'oacs-nxml))
. (require 'oacs-mmm)
. (require 'oacs-format)
. (require 'oacs-occur)
. (require 'oacs-headers)
. (require 'oacs-abbrevs)
. (require 'oacs-comment)
. (require 'oacs-error-log)
.
. (defun oacs-mode (&optional arg)
. "Minor mode for editing OpenACS files.
.
. Commands Available:
. \\
. \\{oacs-mode-map}
.
. "
. (interactive "P")
. (if (if arg (> (prefix-numeric-value arg) 0) (not oacs-mode))
. (oacs-mode-on)
. (oacs-mode-off)))
. (add-to-list 'minor-mode-alist '(oacs-mode " OACS"))
.
. (defun oacs-mode-on ()
. "Turn on OACS Mode. See `oacs-mode'."
. (unless oacs-mode
. (let ((file-name (buffer-file-name)) sub-mode)
.
. ;; Is the file an OpenACS file?
.
. (if (stringp file-name)
. (case major-mode
. (nsd-error-mode
. (setq sub-mode 'log))
. (tcl-mode
. (if (or (string-match "\.vuh$" file-name)
. (string-match "www/.*\.tcl$" file-name)
. (string-match "resources/.*\.tcl$" file-name)
. (string-match "lib/.*\.tcl$" file-name)
. (string-match "tcl/.*\.tcl$" file-name))
. (setq sub-mode 'tcl)))
. ((list xml-mode nxml-mode)
. (if (string-match "\.adp$" file-name)
. (setq sub-mode 'adp)
. (if (string-match "\.xql$" file-name)
. (setq sub-mode 'xql))))
. (sql-mode
. (if (string-match "sql/[^/]*/?.*\.sql$" file-name)
. (setq sub-mode 'sql)))))
.
. ;; Activate OACS sub mode if the file is an OpenACS file.
.
. (if sub-mode
. (progn
. (make-local-variable 'oacs-mode)
. (make-local-variable 'oacs-mode-map)
. (setq oacs-mode t)
. (oacs-define-keymap sub-mode)
.
. ;; Only Tcl library files can use the Index menu and the
. ;; which function mode.
.
. (if (and (stringp file-name)
. (string-match "tcl/.*\.tcl$" file-name))
. (progn
.
. ;; Overwrite the tcl-imenu-create-index-function,
. ;; use the oacs-imenu-generic-expression insted.
.
. (setq imenu-create-index-function 'imenu-default-create-index-function)
. (set (make-local-variable 'imenu-generic-expression)
. oacs-imenu-tcl-expression)
. (which-function-mode 1)))
. (run-hooks 'oacs-mode-hook))))))
.
. (defun oacs-mode-off ()
. "Turn off OACS Mode. See `oacs-mode'."
. (when oacs-mode
. (setq oacs-mode nil)))
.
. (defun oacs-define-keymap (sub-mode)
. "Map OACS key sequences to functions."
. (let ((map (make-sparse-keymap))
. (menu-map (make-sparse-keymap "OACS"))
. (menu-list-map (make-sparse-keymap "List"))
. (menu-insert-map (make-sparse-keymap "Insert"))
. (oacs-mode-prefix-map (make-sparse-keymap)))
. (define-key oacs-mode-prefix-map "ml" 'oacs-monitor-error-log)
. (define-key menu-map [monitor]
. '(menu-item "Monitor server log" oacs-monitor-error-log
. :help "Monitor an AOLServer error log"))
. (define-key oacs-mode-prefix-map "oo" 'occur)
. (define-key menu-list-map [occur]
. '(menu-item "Occurrences" occur
. :help "List occurrences of a regexp in this buffer"))
. (define-key oacs-mode-prefix-map "ta" 'tags-apropos)
. (define-key menu-list-map [tags-apropos]
. '(menu-item "Tags Apropos" tags-apropos
. :help "Search the tagged definitions for a regexp"))
.
. ;; Sort Imenu alphabetic.
.
. (set (make-local-variable 'imenu-sort-function)
. 'imenu--sort-by-name)
.
. (case sub-mode
. (adp
. (define-key oacs-mode-prefix-map "fb" 'oacs-format-html)
. (define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
. (define-key menu-map [format-buffer]
. '(menu-item "Format buffer" oacs-format-html
. :help "Reformat this buffer to a consistant style"))
. (define-key menu-map [find-file]
. '(menu-item "Find file @ point" find-file-at-point
. :help "Open file, guessing a default from text around point")))
. (log
. (define-key oacs-mode-prefix-map "rl" 'oacs-revert-log)
. (define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
. (define-key oacs-mode-prefix-map "om" 'oacs-occur-dbg)
. (define-key oacs-mode-prefix-map "ob" 'oacs-occur-dbg-bug)
. (define-key oacs-mode-prefix-map "od" 'oacs-occur-dbg-debug)
. (define-key oacs-mode-prefix-map "oe" 'oacs-occur-dbg-error)
. (define-key oacs-mode-prefix-map "of" 'oacs-occur-dbg-fatal)
. (define-key oacs-mode-prefix-map "on" 'oacs-occur-dbg-notice)
. (define-key oacs-mode-prefix-map "ow" 'oacs-occur-dbg-warning)
. (define-key menu-map [revert-log]
. '(menu-item "Revert log" oacs-revert-log
. :help "Revert the buffer to the log file"))
. (define-key menu-map [find-file]
. '(menu-item "Find file @ point" find-file-at-point
. :help "Open file, guessing a default from text around point"))
. (define-key menu-list-map [occur-dbg]
. '(menu-item "All messages" oacs-occur-dbg
. :help "List all YOUR messages in the log"))
. (define-key menu-list-map [occur-dbg-bug]
. '(menu-item "Bug messages" oacs-occur-dbg-bug
. :help "List all YOUR bug level messages in the log"))
. (define-key menu-list-map [occur-dbg-debug]
. '(menu-item "Debug messages" oacs-occur-dbg-debug
. :help "List all YOUR debug level messages in the log"))
. (define-key menu-list-map [occur-dbg-error]
. '(menu-item "Error messages" oacs-occur-dbg-error
. :help "List all YOUR error level messages in the log"))
. (define-key menu-list-map [occur-dbg-fatal]
. '(menu-item "Fatal messages" oacs-occur-dbg-fatal
. :help "List all YOUR fatal level messages in the log"))
. (define-key menu-list-map [occur-dbg-notice]
. '(menu-item "Notice messages" oacs-occur-dbg-notice
. :help "List all YOUR notice level messages in the log"))
. (define-key menu-list-map [occur-dbg-warning]
. '(menu-item "Warning messages" oacs-occur-dbg-warning
. :help "List all YOUR warning level messages in the log")))
. (sql
. (define-key oacs-mode-prefix-map "od" 'oacs-occur-function)
. (define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
. (define-key oacs-mode-prefix-map "fb" 'oacs-format-sql)
. (define-key menu-list-map [occur-function]
. '(menu-item "Function definitions" oacs-occur-function
. :help "List all function definitions in this buffer"))
. (define-key menu-map [find-file]
. '(menu-item "Find file @ point" find-file-at-point
. :help "Open file, guessing a default from text around point"))
. (define-key menu-map [format-buffer]
. '(menu-item "Format buffer" oacs-format-sql
. :help "Reformat this buffer to a consistant style"))
. (set (make-local-variable 'imenu-generic-expression)
. oacs-imenu-sql-expression))
. (tcl
. (define-key oacs-mode-prefix-map "od" 'oacs-occur-proc)
. (define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
. (define-key oacs-mode-prefix-map "fb" 'oacs-format-tcl)
. (define-key oacs-mode-prefix-map "rd" 'oacs-remove-dbg)
. (define-key menu-list-map [occur-proc]
. '(menu-item "Procedure definitions" oacs-occur-proc
. :help "List all ad_procs, doc_procs and procs in this buffer"))
. (define-key menu-map [format-buffer]
. '(menu-item "Format buffer" oacs-format-tcl
. :help "Reformat this buffer to a consistant style"))
. (define-key menu-map [find-file]
. '(menu-item "Find file @ point" find-file-at-point
. :help "Open file, guessing a default from text around point"))
. (define-key menu-map [remove-dbg]
. '(menu-item "Remove OACS debug messages" oacs-remove-dbg
. :help "Remove OACS debug messages from this buffer"))
. (define-insert-map menu-insert-map sub-mode))
. (xql
. (define-key oacs-mode-prefix-map "od" 'oacs-occur-query)
. (define-key menu-list-map [occur-query]
. '(menu-item "Query definitions" oacs-occur-query
. :help "List all query definitions in this buffer"))
. (define-insert-map menu-insert-map sub-mode)))
.
. ;; Add the prefix key to the key sequences.
.
. (define-key map oacs-mode-prefix-key oacs-mode-prefix-map)
.
. ;; Redefine the OACS menu in the menu bar.
.
. (define-key map [menu-bar oacs] (cons "OACS" menu-map))
.
. ;; Only add sub menus if they contain menu items.
.
. (if (not (equal menu-list-map (make-sparse-keymap "List")))
. (progn
. (define-key map [menu-bar oacs list] (cons "List" menu-list-map))
. (define-key map [C-S-down-mouse-3] menu-list-map)))
. (if (not (equal menu-insert-map (make-sparse-keymap "Insert")))
. (progn
. (define-key map [menu-bar oacs insert] (cons "Insert" menu-insert-map))
. (define-key map [C-S-down-mouse-3] menu-insert-map)))
.
. ;; Link the OACS menu to Ctrl+Shift+Right mouse click.
.
. (define-key map [C-S-down-mouse-3] menu-map)
.
. ;; Copy the working maps over to the global maps.
.
. (setq oacs-mode-map map))
.
. ;; Activate the key sequence upon enabling OACS minor mode.
.
. (make-local-variable 'minor-mode-map-alist)
. (add-to-list 'minor-mode-map-alist (cons 'oacs-mode oacs-mode-map)))
.
. ;; Activate the minor oacs-mode in major tcl-mode. The oacs-mode
. ;; function checks to see if the tcl file is in an OpenACS directory
. ;; before enabling oacs-mode.
.
. (add-hook 'tcl-mode-hook 'oacs-mode)
.
. ;; Activate the minor oacs-mode in major modes also used by
. ;; OpenACS. See above tcl-mode-hook comments.
.
. (add-hook 'sql-mode-hook 'oacs-mode)
. (add-hook 'xml-mode-hook 'oacs-mode)
. (add-hook 'nxml-mode-hook 'oacs-mode)
. (add-hook 'nsd-error-mode-hook 'oacs-mode)
.
. ;; Add Index Imenu to menu bar for major modes: Tcl, SQL. The main XML
. ;; modes (PSGML and nXML) don't support Imenu.
.
. (add-hook 'tcl-mode-hook 'imenu-add-menubar-index)
. (add-hook 'sql-mode-hook 'imenu-add-menubar-index)
.
. (provide 'oacs)
. ;;; oacs.el ends here
.
}
W
oacs/.bzr/weaves/32/ 0000755 0001750 0001750 00000000000 10412346144 013013 5 ustar dave dave oacs/.bzr/weaves/32/xql.rnc-20060328214111-b63e0f838b0a121b.weave 0000644 0001750 0001750 00000001061 10412346144 021202 0 ustar dave dave # bzr weave file v5
i
1 85fc9541267300fbbbc498181ee329756d478d43
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
w
{ 0
. # XQL
.
. default namespace = ""
.
. element queryset {
. element rdbms {
. element type {"oracle" | "postgresql" },
. element version { text }
. }?,
. ( element fullquery {
. attribute name { text },
. element querytext { text }
. }
. | element partialquery {
. attribute name { text },
. element querytext { text }
. }
. )*
. }
}
W
oacs/.bzr/branch-format 0000644 0001750 0001750 00000000033 10412346062 013736 0 ustar dave dave Bazaar-NG branch, format 6
oacs/.bzr/README 0000644 0001750 0001750 00000000122 10412346062 012147 0 ustar dave dave This is a Bazaar-NG control directory.
Do not change any files in this directory.
oacs/.bzr/revision-history 0000644 0001750 0001750 00000000175 10412346147 014563 0 ustar dave dave bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
bart.teeuwisse@thecodemill.biz-20060328215936-0846583a2b57289d oacs/.bzr/branch-name 0000644 0001750 0001750 00000000000 10412346062 013360 0 ustar dave dave oacs/.bzr/branch-lock 0000644 0001750 0001750 00000000000 10412346150 013366 0 ustar dave dave oacs/.bzr/pending-merges 0000644 0001750 0001750 00000000000 10412346062 014111 0 ustar dave dave oacs/.bzr/inventory 0000644 0001750 0001750 00000003124 10412346150 013252 0 ustar dave dave
oacs/.bzr/inventory.weave 0000644 0001750 0001750 00000011431 10412346146 014365 0 ustar dave dave # bzr weave file v5
i
1 8aaf81ddcd901c9519212be1b0ef289d76419a51
n bart.teeuwisse@thecodemill.biz-20060328215716-62eee86f6a7e59b3
i 0
1 e2950ae474934b091f52e1ab067323ed08b13525
n bart.teeuwisse@thecodemill.biz-20060328215936-0846583a2b57289d
w
{ 0
.
.
.
[ 1
.
] 1
{ 1
.
}
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
}
W
oacs/.bzr/ancestry.weave 0000644 0001750 0001750 00000000030 10412346062 014146 0 ustar dave dave # bzr weave file v5
w
W
oacs/.bzr/stat-cache 0000644 0001750 0001750 00000000025 10412346147 013234 0 ustar dave dave ### bzr hashcache v5
oacs/.bzr/parent 0000644 0001750 0001750 00000000050 10412346150 012501 0 ustar dave dave http://thecodemill.biz/repository/oacs/
oacs/oacs.el 0000644 0001750 0001750 00000030372 10412346150 011673 0 ustar dave dave ;;; oacs.el --- OpenACS extensions
;; Copyright (C) 2003 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: abbrev, extensions, convenience, tools
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; The latest version of oacs is always available from:
;;
;; - http://www.thecodemill.biz/services/oacs/
;;
;; Oacs depends on the psgml/nxml and mmm modules to be
;; installed. Psgml and mmm are available from sourceforge.net:
;;
;; - http://psgml.sourceforge.net/
;; - http://mmm-mode.sourceforge.net/
;;
;; Nxml is an alternative to psgml and available from:
;;
;;
;; Psgml/nxml can be installed along side one another. Oacs defaults
;; to psgml if both are installed unless oacs-preferred-xml-mode is set
;; to nxml.
;;
;; Color-occur is not required but highly recommended. Especially in
;; combination with the various M-oo* keystrokes. (See oacs-occur.el)
;;
;; - http://www.emacswiki.org/elisp/color-occur.el
;;
;; Besides oacs specific variables, oacs uses the common Emacs
;; variables:
;;
;; - user-full-name
;; - user-mail-address
;;
;; Set them in your .emacs file and your full name and e-mail address
;; will be included in all OpenACS headers.
;;
;; Oacs adds several DTDs to psgml, which in order to use need to be
;; installed. The set consists of common HTML DTDs as well as a DTD
;; for the OpenACS specific XQL format. You can find a complete set as
;; added by oacs at:
;;
;; - http://www.thecodemill.biz/repository/oacs-dtds.tgz
;;
;; Installation instructions are included in the archive. If you
;; prefer nxml over psgml install XXX instead. Download XXX from:
;;
;; - http://www.thecodemill.biz/repository/oacs-XXX.tgz
;;
;; Oacs variables can be customized using:
;;
;; - M-x customize-group oacs
;;
;; Oacs is intended to have as little side effects as
;; possible. However, it does set various psgml and mmm
;; variables. Should they clash with your preferences simply remove
;; them from oacs.
;;; Code:
;; Load preferred XML mode. Should psgml fail to load -perhaps because
;; psgml wasn't installed- then fall back on Nxml mode.
(require 'oacs-vars)
(if (equal oacs-preferred-xml-mode 'psgml)
(condition-case nil
(require 'oacs-psgml)
(error (require 'oacs-nxml)))
(require 'oacs-nxml))
(require 'oacs-mmm)
(require 'oacs-format)
(require 'oacs-occur)
(require 'oacs-headers)
(require 'oacs-abbrevs)
(require 'oacs-comment)
(require 'oacs-error-log)
(defun oacs-mode (&optional arg)
"Minor mode for editing OpenACS files.
Commands Available:
\\
\\{oacs-mode-map}
"
(interactive "P")
(if (if arg (> (prefix-numeric-value arg) 0) (not oacs-mode))
(oacs-mode-on)
(oacs-mode-off)))
(add-to-list 'minor-mode-alist '(oacs-mode " OACS"))
(defun oacs-mode-on ()
"Turn on OACS Mode. See `oacs-mode'."
(unless oacs-mode
(let ((file-name (buffer-file-name)) sub-mode)
;; Is the file an OpenACS file?
(if (stringp file-name)
(case major-mode
(nsd-error-mode
(setq sub-mode 'log))
(tcl-mode
(if (or (string-match "\.vuh$" file-name)
(string-match "www/.*\.tcl$" file-name)
(string-match "resources/.*\.tcl$" file-name)
(string-match "lib/.*\.tcl$" file-name)
(string-match "tcl/.*\.tcl$" file-name))
(setq sub-mode 'tcl)))
((list xml-mode nxml-mode)
(if (string-match "\.adp$" file-name)
(setq sub-mode 'adp)
(if (string-match "\.xql$" file-name)
(setq sub-mode 'xql))))
(sql-mode
(if (string-match "sql/[^/]*/?.*\.sql$" file-name)
(setq sub-mode 'sql)))))
;; Activate OACS sub mode if the file is an OpenACS file.
(if sub-mode
(progn
(make-local-variable 'oacs-mode)
(make-local-variable 'oacs-mode-map)
(setq oacs-mode t)
(oacs-define-keymap sub-mode)
;; Only Tcl library files can use the Index menu and the
;; which function mode.
(if (and (stringp file-name)
(string-match "tcl/.*\.tcl$" file-name))
(progn
;; Overwrite the tcl-imenu-create-index-function,
;; use the oacs-imenu-generic-expression insted.
(setq imenu-create-index-function 'imenu-default-create-index-function)
(set (make-local-variable 'imenu-generic-expression)
oacs-imenu-tcl-expression)
(which-function-mode 1)))
(run-hooks 'oacs-mode-hook))))))
(defun oacs-mode-off ()
"Turn off OACS Mode. See `oacs-mode'."
(when oacs-mode
(setq oacs-mode nil)))
(defun oacs-define-keymap (sub-mode)
"Map OACS key sequences to functions."
(let ((map (make-sparse-keymap))
(menu-map (make-sparse-keymap "OACS"))
(menu-list-map (make-sparse-keymap "List"))
(menu-insert-map (make-sparse-keymap "Insert"))
(oacs-mode-prefix-map (make-sparse-keymap)))
(define-key oacs-mode-prefix-map "ml" 'oacs-monitor-error-log)
(define-key menu-map [monitor]
'(menu-item "Monitor server log" oacs-monitor-error-log
:help "Monitor an AOLServer error log"))
(define-key oacs-mode-prefix-map "oo" 'occur)
(define-key menu-list-map [occur]
'(menu-item "Occurrences" occur
:help "List occurrences of a regexp in this buffer"))
(define-key oacs-mode-prefix-map "ta" 'tags-apropos)
(define-key menu-list-map [tags-apropos]
'(menu-item "Tags Apropos" tags-apropos
:help "Search the tagged definitions for a regexp"))
;; Sort Imenu alphabetic.
(set (make-local-variable 'imenu-sort-function)
'imenu--sort-by-name)
(case sub-mode
(adp
(define-key oacs-mode-prefix-map "fb" 'oacs-format-html)
(define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
(define-key menu-map [format-buffer]
'(menu-item "Format buffer" oacs-format-html
:help "Reformat this buffer to a consistant style"))
(define-key menu-map [find-file]
'(menu-item "Find file @ point" find-file-at-point
:help "Open file, guessing a default from text around point")))
(log
(define-key oacs-mode-prefix-map "rl" 'oacs-revert-log)
(define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
(define-key oacs-mode-prefix-map "om" 'oacs-occur-dbg)
(define-key oacs-mode-prefix-map "ob" 'oacs-occur-dbg-bug)
(define-key oacs-mode-prefix-map "od" 'oacs-occur-dbg-debug)
(define-key oacs-mode-prefix-map "oe" 'oacs-occur-dbg-error)
(define-key oacs-mode-prefix-map "of" 'oacs-occur-dbg-fatal)
(define-key oacs-mode-prefix-map "on" 'oacs-occur-dbg-notice)
(define-key oacs-mode-prefix-map "ow" 'oacs-occur-dbg-warning)
(define-key menu-map [revert-log]
'(menu-item "Revert log" oacs-revert-log
:help "Revert the buffer to the log file"))
(define-key menu-map [find-file]
'(menu-item "Find file @ point" find-file-at-point
:help "Open file, guessing a default from text around point"))
(define-key menu-list-map [occur-dbg]
'(menu-item "All messages" oacs-occur-dbg
:help "List all YOUR messages in the log"))
(define-key menu-list-map [occur-dbg-bug]
'(menu-item "Bug messages" oacs-occur-dbg-bug
:help "List all YOUR bug level messages in the log"))
(define-key menu-list-map [occur-dbg-debug]
'(menu-item "Debug messages" oacs-occur-dbg-debug
:help "List all YOUR debug level messages in the log"))
(define-key menu-list-map [occur-dbg-error]
'(menu-item "Error messages" oacs-occur-dbg-error
:help "List all YOUR error level messages in the log"))
(define-key menu-list-map [occur-dbg-fatal]
'(menu-item "Fatal messages" oacs-occur-dbg-fatal
:help "List all YOUR fatal level messages in the log"))
(define-key menu-list-map [occur-dbg-notice]
'(menu-item "Notice messages" oacs-occur-dbg-notice
:help "List all YOUR notice level messages in the log"))
(define-key menu-list-map [occur-dbg-warning]
'(menu-item "Warning messages" oacs-occur-dbg-warning
:help "List all YOUR warning level messages in the log")))
(sql
(define-key oacs-mode-prefix-map "od" 'oacs-occur-function)
(define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
(define-key oacs-mode-prefix-map "fb" 'oacs-format-sql)
(define-key menu-list-map [occur-function]
'(menu-item "Function definitions" oacs-occur-function
:help "List all function definitions in this buffer"))
(define-key menu-map [find-file]
'(menu-item "Find file @ point" find-file-at-point
:help "Open file, guessing a default from text around point"))
(define-key menu-map [format-buffer]
'(menu-item "Format buffer" oacs-format-sql
:help "Reformat this buffer to a consistant style"))
(set (make-local-variable 'imenu-generic-expression)
oacs-imenu-sql-expression))
(tcl
(define-key oacs-mode-prefix-map "od" 'oacs-occur-proc)
(define-key oacs-mode-prefix-map "fp" 'find-file-at-point)
(define-key oacs-mode-prefix-map "fb" 'oacs-format-tcl)
(define-key oacs-mode-prefix-map "rd" 'oacs-remove-dbg)
(define-key menu-list-map [occur-proc]
'(menu-item "Procedure definitions" oacs-occur-proc
:help "List all ad_procs, doc_procs and procs in this buffer"))
(define-key menu-map [format-buffer]
'(menu-item "Format buffer" oacs-format-tcl
:help "Reformat this buffer to a consistant style"))
(define-key menu-map [find-file]
'(menu-item "Find file @ point" find-file-at-point
:help "Open file, guessing a default from text around point"))
(define-key menu-map [remove-dbg]
'(menu-item "Remove OACS debug messages" oacs-remove-dbg
:help "Remove OACS debug messages from this buffer"))
(define-insert-map menu-insert-map sub-mode))
(xql
(define-key oacs-mode-prefix-map "od" 'oacs-occur-query)
(define-key menu-list-map [occur-query]
'(menu-item "Query definitions" oacs-occur-query
:help "List all query definitions in this buffer"))
(define-insert-map menu-insert-map sub-mode)))
;; Add the prefix key to the key sequences.
(define-key map oacs-mode-prefix-key oacs-mode-prefix-map)
;; Redefine the OACS menu in the menu bar.
(define-key map [menu-bar oacs] (cons "OACS" menu-map))
;; Only add sub menus if they contain menu items.
(if (not (equal menu-list-map (make-sparse-keymap "List")))
(progn
(define-key map [menu-bar oacs list] (cons "List" menu-list-map))
(define-key map [C-S-down-mouse-3] menu-list-map)))
(if (not (equal menu-insert-map (make-sparse-keymap "Insert")))
(progn
(define-key map [menu-bar oacs insert] (cons "Insert" menu-insert-map))
(define-key map [C-S-down-mouse-3] menu-insert-map)))
;; Link the OACS menu to Ctrl+Shift+Right mouse click.
(define-key map [C-S-down-mouse-3] menu-map)
;; Copy the working maps over to the global maps.
(setq oacs-mode-map map))
;; Activate the key sequence upon enabling OACS minor mode.
(make-local-variable 'minor-mode-map-alist)
(add-to-list 'minor-mode-map-alist (cons 'oacs-mode oacs-mode-map)))
;; Activate the minor oacs-mode in major tcl-mode. The oacs-mode
;; function checks to see if the tcl file is in an OpenACS directory
;; before enabling oacs-mode.
(add-hook 'tcl-mode-hook 'oacs-mode)
;; Activate the minor oacs-mode in major modes also used by
;; OpenACS. See above tcl-mode-hook comments.
(add-hook 'sql-mode-hook 'oacs-mode)
(add-hook 'xml-mode-hook 'oacs-mode)
(add-hook 'nxml-mode-hook 'oacs-mode)
(add-hook 'nsd-error-mode-hook 'oacs-mode)
;; Add Index Imenu to menu bar for major modes: Tcl, SQL. The main XML
;; modes (PSGML and nXML) don't support Imenu.
(add-hook 'tcl-mode-hook 'imenu-add-menubar-index)
(add-hook 'sql-mode-hook 'imenu-add-menubar-index)
(provide 'oacs)
;;; oacs.el ends here
oacs/xql.rnc 0000644 0001750 0001750 00000000576 10412346150 011737 0 ustar dave dave # XQL
default namespace = ""
element queryset {
element rdbms {
element type {"oracle" | "postgresql" },
element version { text }
}?,
( element fullquery {
attribute name { text },
element querytext { text }
}
| element partialquery {
attribute name { text },
element querytext { text }
}
)*
}
oacs/adp.rnc 0000644 0001750 0001750 00000000224 10412346150 011665 0 ustar dave dave # ADP
default namespace = ""
include "/usr/share/emacs/site-lisp/nxml-mode/schema/xhtml.rnc"
include "adp-master.rnc"
include "adp-property.rnc"
oacs/Changelog 0000644 0001750 0001750 00000035642 10412346150 012243 0 ustar dave dave # do not edit -- automatically generated by arch changelog
# arch-tag: automatic-ChangeLog--bart-arch@thecodemill.biz--2004/oacs--devo--1.0
#
2005-01-25 03:47:40 GMT Bart Teeuwisse version-0
Summary:
New version in bart-arch@thecodemill.biz--2005/oacs--devo--1.0
Revision:
oacs--devo--1.0--version-0
modified files:
Changelog
2004-07-29 20:46:00 GMT Bart Teeuwisse patch-31
Summary:
Added oacs-remove-dbg
Revision:
oacs--devo--1.0--patch-31
- Added oacs-remove-dbg, a function to remove OACS debug message from
the current buffer.
- Fixed key map to tags-apropos: M-ta
- Fixed debug header. Will correctly refer to proc name when in a
proc, ad_proc or doc_proc. If not it references the file.
modified files:
Changelog oacs-abbrevs.el oacs.el
2004-07-13 17:55:24 GMT Bart Teeuwisse patch-30
Summary:
Fixed INSTALL.txt
Revision:
oacs--devo--1.0--patch-30
- From Jade Rubick:
tla -A bart-arch@thecodemill.biz--2004 oacs--devo--1.0 \
/usr/share/emacs/site-lisp/oacs
should be
tla get -A bart-arch@thecodemill.biz--2004 oacs--devo--1.0 \
/usr/share/emacs/site-lisp/oacs
modified files:
Changelog INSTALL.txt
2004-06-10 05:34:56 GMT Bart Teeuwisse patch-29
Summary:
Fixup debug messages w/ initials
Revision:
oacs--devo--1.0--patch-29
- Fixup debug messages w/ initials
- Added Changelog
- Added M-o ta mapped to tags-apropos
- Made oacs-mmm-ify-log-region local to buffer
new files:
Changelog
modified files:
oacs-abbrevs.el oacs-error-log.el oacs.el
2004-04-29 10:20:14 GMT Bart Teeuwisse patch-28
Summary:
Print debug messages w/ initials
Revision:
oacs--devo--1.0--patch-28
- Start each line in an OACS debug message w/ the developers initials.
This allows for easy extraction of error messages from the error log
by tools like daemontools's multilog.
- Added oacs-base-dir to the oacs-inc-template auto insert regexp so
that the regexp doesn't fire when the path to the base dir includes
/lib/.
modified files:
oacs-abbrevs.el oacs-headers.el
2004-04-21 18:46:05 GMT Bart Teeuwisse patch-27
Summary:
NSD Error log improvements
Revision:
oacs--devo--1.0--patch-27
- Made MMM-ifying the error log optional as MMM tends
to be very slow in large files. Even when restricting
MMM to a region.
- Associate error.log files in directories of the list
of possible AOLserver directories with NSD error log
mode.
- Tweaked the oacs-log-embedded-sql regexps to match
the output of nsoracle version 2.7.
- Added M-ofp (find-file-at-point) to NSD error log mode.
modified files:
oacs-error-log.el oacs-mmm.el oacs.el
2004-04-18 04:50:05 GMT Bart Teeuwisse patch-26
Summary:
Fixed escaping error in search string.
Revision:
oacs--devo--1.0--patch-26
- The search expression in oacs-format-separate-tags used a single \
instead of doubles.
modified files:
oacs-format.el
2004-04-17 05:07:15 GMT Bart Teeuwisse patch-25
Summary:
More HTML formating work
Revision:
oacs--devo--1.0--patch-25
- Added oacs-format-separate-tags to separate adjacent
tags. E.g.
- Added oacs-format-includes to place all include attribubtes on a
separate line.
- Made oacs-format-empty-lines more flexible by taking a COUNT
parameter. It now replaces multiple empty lines by COUNT empty
lines. Mostly used with a COUNT of 2 for a single empty line or 1 to
remove empty lines altogether.
- Report the number of lines added to the error log upon refreshing.
modified files:
oacs-error-log.el oacs-format.el
2004-04-02 18:35:36 GMT Bart Teeuwisse patch-24
Summary:
Added oacs-revert-log
Revision:
oacs--devo--1.0--patch-24
- Added oacs-revert-log linked to key stroke M-o rl.
- Fixed missing ' in oacs-dbg.
- Removed debug message from oacs-mmm-ify-log-region.
modified files:
oacs-abbrevs.el oacs-error-log.el oacs.el
2004-03-16 20:06:47 GMT Bart Teeuwisse patch-23
Summary:
MMM-ify only the new addition when reverting
Revision:
oacs--devo--1.0--patch-23
- MMM-ify only the newly added text written to the log when reverting.
- If the cursor (POINT) was at the end of the buffer then move the
POINT to the end of the buffer after reverting.
- Added a history variable for server names.
modified files:
oacs-error-log.el oacs.el
2004-03-15 19:57:57 GMT Bart Teeuwisse patch-22
Summary:
Added hilighting of db_ procs inside quotes
Revision:
oacs--devo--1.0--patch-22
- Hi Bart - it would be useful to hilight the sql of db_* proc calls
inside quotes as well as braces - if you ever have any $ variables
(eg. for extra where clauses) you are forced into using quotes.
--
Mark Aufflick
modified files:
oacs-mmm.el
2004-03-12 21:31:46 GMT Bart Teeuwisse patch-21
Summary:
Added M-o ml key binding to oacs-monitor-error-log
Revision:
oacs--devo--1.0--patch-21
- Added M-o ml to OACS menu as well as global key map so that
the log can be called from any buffer, not only OACS buffers.
modified files:
oacs-error-log.el oacs.el
2004-03-11 21:24:39 GMT Bart Teeuwisse patch-20
Summary:
Added nsd-error-mode for AOLServer logs
Revision:
oacs--devo--1.0--patch-20
- Added a modified version of nsd-error-mode (from nsd.el).
The new version opens the entire buffer instead of tailing
from the moment the log file is opened.
- Nsd-Error has similar highlighting. Supports execution of
queries w/ bind variables.
- Use M-x customize-option oacs-error-log-dirs to list directories
that should be searched for AOLServer error logs.
- Use M-x oacs-monitor-error-log to open an error log file and monitor
the changes to the log.
- Fixed M-o om key mapping to oacs-occur-dbg.
new files:
oacs-error-log.el
modified files:
oacs.el
2004-03-11 01:20:45 GMT Bart Teeuwisse patch-19
Summary:
Fixed Imenu regular expressions
Revision:
oacs--devo--1.0--patch-19
- The tailing whitespace expression in oacs-imenu-tcl-expression
lacked a backslash.
modified files:
oacs-abbrevs.el oacs.el
2004-03-10 21:06:07 GMT Bart Teeuwisse patch-18
Summary:
Added Imenu support
Revision:
oacs--devo--1.0--patch-18
- Imenu adds extra facilities for mode-specific buffer indexes in menu
form. Documentation is scant, see
http://www.emacswiki.org/cgi-bin/wiki/ImenuMode and the Imenu node
in the Emacs info file.
- Imenu adds an Index menu to the menu bar with shortcuts to Tcl
procedures and SQL functions, packages, sequences and tables.
- Imenu is also available from Ctrl+Right mouse click.
- Imenu support is in addition to M-o od. The two methods differ in
that Imenu categorizes definitions and sorts them by name where as
M-o od lists definitions in the order they appear in the file.
- And last but not least, Speedbar (M-x speedbar) also uses Imenu.
- Added M-o fp to ADP pages sub mode.
modified files:
oacs.el
2004-03-05 17:54:08 GMT Bart Teeuwisse patch-17
Summary:
@arch-tag -> @arch-tag:
Revision:
oacs--devo--1.0--patch-17
- The GNU Arch tag should end with a colon (:).
modified files:
oacs-abbrevs.el
2004-03-05 01:31:55 GMT Bart Teeuwisse patch-16
Summary:
Oops, creation-date should have been oacs-creation-date
Revision:
oacs--devo--1.0--patch-16
- Emacs auto-complete must have tricked me.
modified files:
oacs-headers.el
2004-03-05 01:17:24 GMT Bart Teeuwisse patch-15
Summary:
Menu update plus M-o o p -> M-o o d change
Revision:
oacs--devo--1.0--patch-15
- Added oacs-occur-functions, oacs-occur-queries.
- Mapped M-o o d to oacs-occur-proc, oacs-occur-functions and
oacs-occur-queries. Oacs-occur-proc was previously bound to
M-o o p. However, with the addition of new sub-mode specific
procedures to find local definitions the mapping has been
changed. The last 'd' in the key map stands for 'Definition'.
- Updated abbreviations for SQL sub-mode.
- Updated OACS menu. Added all known abbreviations to the insert
sub-menu for sub-modes Tcl, SQL and XQL.
- Moved @creation-date to a separate procedure.
modified files:
oacs-abbrevs.el oacs-headers.el oacs-occur.el oacs.el
2004-03-04 00:45:11 GMT Bart Teeuwisse patch-14
Summary:
Another patch to get the layout right
Revision:
oacs--devo--1.0--patch-14
- More header template tweaking.
- Also tweaked the oacs-sql-template regexp for compatibility with
ACS>
modified files:
oacs-headers.el
2004-03-04 00:25:45 GMT Bart Teeuwisse patch-13
Summary:
Fixed a few layout glitzes
Revision:
oacs--devo--1.0--patch-13
- Ben Bytheway reported a few layout glitzes.
modified files:
oacs-headers.el
2004-03-03 23:20:16 GMT Bart Teeuwisse patch-12
Summary:
Added GNU Arch support & refined abbreviations
Revision:
oacs--devo--1.0--patch-12
- Using octopy I accidentally committed only 1 file.
- Added @arch-tag to all header templates. Added oarch to
abbreviations.
- Refined abbreviation code. Moved common portions to separate
procedures.
- Added OpenACS form debug message to log form errors in hidden form
variables. These errors would otherwise go unnoticed. Added odbgf to
abbreviations.
- Added both oarch and odbgf to the OACS->Insert menu.
modified files:
oacs-headers.el
2004-03-03 23:17:03 GMT Bart Teeuwisse patch-11
Summary:
Added GNU Arch support & refined abbreviations
Revision:
oacs--devo--1.0--patch-11
- Added @arch-tag to all header templates. Added oarch to
abbreviations.
- Refined abbreviation code. Moved common portions to separate
procedures.
- Added OpenACS form debug message to log form errors in hidden form
variables. These errors would otherwise go unnoticed. Added odbgf to
abbreviations.
- Added both oarch and odbgf to the OACS->Insert menu.
modified files:
oacs-abbrevs.el
2004-03-03 02:39:13 GMT Bart Teeuwisse patch-10
Summary:
Added find-file-at-point to Tcl submode
Revision:
oacs--devo--1.0--patch-10
- Added find-file-at-point to Tcl submode
modified files:
oacs.el
2004-02-24 03:17:22 GMT Bart Teeuwisse patch-9
Summary:
Made OACS menu also a popup menu
Revision:
oacs--devo--1.0--patch-9
- Linked the OACS menu to Ctrl+Shift+Right Mouse click.
modified files:
oacs.el
2004-02-24 02:54:49 GMT Bart Teeuwisse patch-8
Summary:
Oops, odbgh is called oacs-dbg-headers
Revision:
oacs--devo--1.0--patch-8
- The procedure is called oacs-dbg-headers and not odbgh.
modified files:
oacs-abbrevs.el
2004-02-24 02:50:27 GMT Bart Teeuwisse patch-7
Summary:
Fix odbgh menu item
Revision:
oacs--devo--1.0--patch-7
- The odbgh menu item was inadvertently linked to odbg rather then
odbgh.
modified files:
oacs-abbrevs.el
2004-02-24 02:41:27 GMT Bart Teeuwisse patch-6
Summary:
Added OACS to menu bar.
Revision:
oacs--devo--1.0--patch-6
- Added sub mode aware OACS menu to Emacs menu bar.
- SQL sub mode also activates in /sql dir in addition to /sql/oracle
and /sql/postgresql dirs.
modified files:
oacs-abbrevs.el oacs.el
2004-02-21 00:07:14 GMT Bart Teeuwisse patch-5
Summary:
Added oacs-inc-template
Revision:
oacs--devo--1.0--patch-5
Added a header template for files. Contains a brief
description, @author, @creation-date and @cvs-id.
Also asks for required and optional parameters so that the
can enforce a minimal API.
modified files:
oacs-headers.el oacs.el
2004-02-20 22:22:10 GMT Bart Teeuwisse patch-4
Summary:
Fix typo
Revision:
oacs--devo--1.0--patch-4
Jon Griffen also reported a typo in the prompt for focus.
modified files:
oacs-headers.el
2004-02-20 22:17:49 GMT Bart Teeuwisse patch-3
Summary:
Fix for MMM-mode
Revision:
oacs--devo--1.0--patch-3
Jon Griffin reported the following error:
Also, I can't get into mmm-mode in the xql files, I think the
error is: Wrong type argument: stringp, nil
Which turned out to be a case unaccounted for in oacs-mode-on.
modified files:
oacs.el
2004-02-20 01:11:53 GMT Bart Teeuwisse patch-2
Summary:
Turned OACS into a Minor Mode
Revision:
oacs--devo--1.0--patch-2
- Step one in turning OACS into a Minor Mode.
- Key mappings via oacs-mode-map.
- Mappings tuned to oacs sub-mode.
- Know sub-modes: adp, log, sql, tcl, xql
modified files:
oacs-abbrevs.el oacs-comment.el oacs-format.el oacs-headers.el
oacs-occur.el oacs.el
2004-02-04 05:09:09 GMT Bart Teeuwisse patch-1
Summary:
Added installation instructions
Revision:
oacs--devo--1.0--patch-1
- Added installation instructions for Emacs OACS.
new files:
INSTALL.txt
2004-02-03 01:16:48 GMT Bart Teeuwisse base-0
Summary:
Initial import
Revision:
oacs--devo--1.0--base-0
Initial version of Emacs OACS.
OpenACS lacked a good Integrated Development Environment and as I use
Emacs for almost everything it was only natural to fill the void. The
Emacs OACS module is an extension to GNU Emacs, the extensible,
customizable, self-documenting real-time display editor.
new files:
oacs-abbrevs.el oacs-comment.el oacs-format.el oacs-headers.el
oacs-mmm.el oacs-occur.el oacs-psgml.el oacs.el
oacs/.bzrignore 0000644 0001750 0001750 00000000010 10412346150 012410 0 ustar dave dave *.cache
oacs/schemas.xml 0000644 0001750 0001750 00000000534 10412346150 012566 0 ustar dave dave
oacs/oacs-mmm.el 0000644 0001750 0001750 00000014346 10412346150 012462 0 ustar dave dave ;;; oacs-mmm.el --- OACS MMM extension
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: convenience, extensions, tools
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; Part of the Emacs OACS module. See oacs.el for more information.
;;; Code:
;;; Multiple Majort Mode support for embedded sql in xql files.
(require 'mmm-auto)
(require 'mmm-mode)
;;; Most useful value for mmm-global-mode, is the symbol `maybe',which
;; causes MMM Mode to turn itself on in precisely those buffers where
;; it would be useful.
(setq mmm-global-mode 'maybe)
;;; Same background color in submode as major mode
(setq mmm-submode-decoration-level '0)
;;; Automatically select mmm and embedded-sql for XQL files.
(mmm-add-mode-ext-class nil ".xql" 'oacs-xql-embedded-sql)
;;; Define oacs-xql-embedded-sql mode
(mmm-add-classes
'((oacs-xql-embedded-sql
:submode sql-mode
:face mmm-declaration-submode-face
:front ""
:back ""
:creation-hook oacs-xql-query-bind-and-send-hook)))
;;; Automatically select mmm and embedded-sql for AOLserver log files.
(if oacs-mmm-ify-log
(mmm-add-mode-ext-class nil ".log" 'oacs-log-embedded-sql))
;;; Define log-embedded-sql mode
(mmm-add-classes
'((oacs-log-embedded-sql
:submode sql-mode
:face mmm-declaration-submode-face
:front "sql(.*?):\\s-*\\b"
:back "\\b\\s-+\\["
:creation-hook oacs-log-query-bind-and-send-hook)))
;;; Define oacs-tcl-embedded-sql mode
(mmm-add-classes
'((oacs-tcl-embedded-sql
:submode sql-mode
:face mmm-declaration-submode-face
:front "db_\\(\\w\\|_\\)+\\(\\s-+\\(\\w\\|_\\)+\\)+\\s-+\\({\\|\"\\)"
:back "\\(}\\|\"\\)")))
(mmm-add-mode-ext-class 'tcl-mode nil 'oacs-tcl-embedded-sql)
;;; Use 'oacs-query-bind-and-send when in oacs-log-embedded-sql mode
(defun oacs-log-query-bind-and-send-hook ()
"Use oacs-query-bind-and-send for `comint-input-sender'."
(add-to-list 'mmm-save-local-variables '(comint-input-sender region))
(setq comint-input-sender 'oacs-query-bind-and-send)
(add-to-list 'mmm-save-local-variables '(paragraph-start region))
(setq paragraph-start "^\\[.*\\|^\\s-+'")
(setq paragraph-separate "^\\[.*$")
)
;;; Use 'oacs-query-bind-and-send when in oacs-xql-embedded-sql mode
(defun oacs-xql-query-bind-and-send-hook ()
"Use oacs-query-bind-and-send for `comint-input-sender'."
(add-to-list 'mmm-save-local-variables '(comint-input-sender region (xml-mode)))
(setq comint-input-sender 'oacs-query-bind-and-send)
)
;;; .vuh files are really Tcl files
(add-to-list 'auto-mode-alist '("\\.vuh" . tcl-mode))
(defun oacs-query-bind-and-send (proc string)
"Send to PROC input STRING, maybe replacing bind variables.
Placeholders are words starting with a colon like :this and may
contain underscores like :so_and_so. This function is used for
`comint-input-sender' in `sql-postgres`, `sql-oracle` and `sql-mode`."
(message "%s" string)
(while (string-match "[ =]:\\(\\(\\sw\\|_\\)+\\)" string)
(setq string (replace-match
(concat
"'" (read-from-minibuffer
(format "Enter value for %s: " (match-string 1 string))
nil nil nil sql-placeholder-history) "'")
t t string)))
(comint-send-string proc string)
(comint-send-string proc "\n"))
(defadvice sql-mode (after sql-mode)
"Use oacs-query-bind-and-send for `comint-input-sender'."
(make-variable-buffer-local 'comint-input-sender)
(setq comint-input-sender 'oacs-query-bind-and-send)
)
(ad-activate 'sql-mode)
(defadvice sql-oracle (after sql-oracle)
"Use oacs-query-bind-and-send for `comint-input-sender'."
(make-variable-buffer-local 'comint-input-sender)
(setq comint-input-sender 'oacs-query-bind-and-send)
)
(ad-activate 'sql-oracle)
(defadvice sql-postgres (after sql-postgres)
"Use oacs-query-bind-and-send for `comint-input-sender'."
(make-variable-buffer-local 'comint-input-sender)
(setq comint-input-sender 'oacs-query-bind-and-send)
)
(ad-activate 'sql-postgres)
;;; Redefine sql-send-region so that is uses the comint-input-sender.
(require 'sql)
(defun sql-send-region (start end)
"Send a region to the SQL process."
(interactive "r")
(if (buffer-live-p sql-buffer)
(save-excursion
(let ((string (buffer-substring start end)))
(if (string-match ";$" string)
()
(setq string (concat string ";")))
(if (string-match "\n$" string)
()
(setq string (concat string "\n")))
(funcall comint-input-sender sql-buffer string)
(message "Sent string to buffer %s." (buffer-name sql-buffer)))
(if sql-pop-to-buffer-after-send-region
(pop-to-buffer sql-buffer)
(display-buffer sql-buffer)))
(message "%s" "No SQL process started.")))
;;; Store the region send the SQLi process in the history of the SQLi
;; buffer.
(defadvice sql-send-region (after sql-store-in-history)
"The region sent to the SQLi process is also stored in the history."
(let ((history (buffer-substring-no-properties start end)))
(save-excursion
(set-buffer sql-buffer)
(if (and (funcall comint-input-filter history)
(or (null comint-input-ignoredups)
(not (ring-p comint-input-ring))
(ring-empty-p comint-input-ring)
(not (string-equal (ring-ref comint-input-ring 0)
history))))
(ring-insert comint-input-ring history))
(setq comint-save-input-ring-index comint-input-ring-index)
(setq comint-input-ring-index nil))))
(ad-activate 'sql-send-region)
(provide 'oacs-mmm)
;;; oacs-mmm.el ends here
oacs/INSTALL.txt 0000644 0001750 0001750 00000003505 10412346150 012271 0 ustar dave dave Installing Emacs OACS
1) Create a subdirectory called oacs in the emacs site-lisp
directory. On most systems the full path to site-lisp is:
/usr/share/emacs/site-lisp
If the site-lisp directory is in a different location on your
system then use your full path instead from here on in these
installation instructions.
If you use Bazaar NG you can follow the development of Emacs OACS by
creating a local copy of the development branch like so:
bzr get http://thecodemill.biz/repository/oacs
If you install from an Emacs OACS tarball copy all extracted files
to the oacs directory.
2) Install the Emacs nXML mode or the PSGML mode. PSGML is the default
XML mode handler of OACS. Set the oacs-preferred-xml-mode variable
to nxml to use nXML mode instead. nXML mode in my opinion is
superior but your milage may varry.
PSGML mode is available from:
http://psgml.sourceforge.net/
Follow the included installation instructions.
Alternatively, Debian users can use:
apt-get install psgml
nXML mode is available from:
http://thaiopensource.com/nxml-mode/
3) Install the Emacs MMM mode. MMM is available from:
http://mmm-mode.sourceforge.net/
Alternatively, Debian users can use:
apt-get install mmm-mode
4) Recommended but not required. Install color-occur by copying
http://www.emacswiki.org/elisp/color-occur.el
to the Emacs site-lisp directory.
5) Put the following line in your .emacs file:
(add-to-list 'load-path "/usr/share/emacs/site-lisp/oacs")
(require 'oacs)
6) Customize the following Emacs variables
user-full-name
user-mail-address
Type M-x customize-variable followed by the name of the variable to
change their value. Be sure to save the new value for future
sessions.
7) Restart Emacs.
8) Enjoy!
oacs/oacs-vars.el 0000644 0001750 0001750 00000011554 10412346150 012645 0 ustar dave dave ;;; oacs-vars.el --- Oacs customizable and global variables
;; Copyright (C) 2005 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: extensions
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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 oacs nil
"OpenACS extensions."
:version "21.1"
:link '(emacs-commentary-link "oacs")
:link '(url-link "http://www.thecodemill.biz/")
:group 'convenience)
(defcustom oacs-tdom-installed "t"
"Is tDOM installed on the OpenACS site?"
:type 'boolean
:group 'oacs)
(defcustom oacs-base-dir "/web"
"Base directory of a OpenACS installation."
:type 'string
:group 'oacs)
(defcustom oacs-dbg-severity "notice"
"Default severity for oacs-dbg."
:type 'string
:group 'oacs)
(defcustom oacs-oracle-version "8.1.6"
"Default Oracle database version."
:type 'string
:group 'oacs)
(defcustom oacs-postgresql-version "7.2"
"Default PostgreSQL database version."
:type 'string
:group 'oacs)
(defcustom oacs-proc-type "-public"
"Default procedure type for oacs-proc."
:type 'string
:group 'oacs)
(defcustom oacs-mode-prefix-key [(meta ?o)]
"Prefix key for the OACS Minor Mode Keymap."
:type 'vector
:group 'oacs)
(defcustom oacs-error-log-dirs (quote ("/var/log/aolserver"))
"List of directories that might contain AOLServer error logs."
:type '(repeat string)
:group 'oacs)
(defcustom oacs-mmm-ify-log "t"
"Use MMM mode in the AOLserver server logs? MMM tends to be very
slow on large log files."
:type 'boolean
:group 'oacs)
(defcustom oacs-preferred-xml-mode 'psgml
"Preferred XML mode handler. Psgml or Nxml."
:type '(choice (const :tag "Psgml-mode" :value psgml)
(const :tag "Nxml-mode" :value nxml))
:group 'oacs)
(defcustom oacs-insert-cvs-id "t"
"Insert @cvsid $Id$?"
:type 'boolean
:group 'oacs)
(defvar oacs-proc-type-history nil
"History of ad_proc procedure types")
(defvar oacs-proc-name-history nil
"History of ad_proc procedure names")
(defvar oacs-parameter-history nil
"History of ad_proc parameters")
(defvar oacs-proc-parameters nil
"List of parameters entered by the user when defining an ad_proc.")
(defvar oacs-dbg-type-history nil
"History of debugging severities")
(defvar oacs-oracle-version-history nil
"History of Oracle database versions")
(defvar oacs-postgres-version-history nil
"History of PostgreSQL database versions")
(defvar oacs-error-log-history nil
"History of AOLserver error log files")
(defvar oacs-error-log-prev-point-max nil
"The location of the end of the error log at the end of the previous
update of the error log. Used to MMM-ify only the new addition to the
log.")
(defvar oacs-mode nil
"Toggle OACS Minor Mode.")
(defvar oacs-mode-map nil
"Keymap for OACS Minor Mode.")
(defvar oacs-imenu-tcl-expression
'(
("Procedures (-warn)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(public\\|private\\|depreciated\\)\\s-+\\)*-warn\\s-+\\(-\\(public\\|private\\|depreciated\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
("Procedures (-public)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(warn\\|private\\|depreciated\\)\\s-+\\)*-public\\s-+\\(-\\(warn\\|private\\|depreciated\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
("Procedures (-private)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(warn\\|public\\|depreciated\\)\\s-+\\)*-private\\s-+\\(-\\(warn\\|public\\|depreciated\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
("Procedures (-depreciated)" "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-\\(warn\\|public\\|private\\)\\s-+\\)*-depreciated\\s-+\\(-\\(warn\\|public\\|private\\)\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 7)
(nil "^\\s-*\\(ad_\\|_doc_\\)?proc\\s-+\\(\\(-[^ ]*\\s-+\\)*\\([^{ ]*\\)\\)\\s-*" 4)
)
"Value for `imenu-generic-expression' for Tcl files in Oacs Minor Mode.")
(defvar oacs-imenu-sql-expression
'(
("Tables" "^\\s-*create\\s-+table\\s-+\\(\\(\\w\\|_\\)+\\)" 1)
("Sequences" "^\\s-*create\\s-+sequence\\s-+\\(\\(\\w\\|_\\)+\\)" 1)
("Packages" "^\\s-*create\\s-+\\(or\\s-+replace\\s-+\\)?package\\s-+\\(.*\\)$" 2)
("Functions" "^\\s-*create\\s-+\\(or\\s-+replace\\s-+\\)?function\\s-+\\(\\(\\w\\|_\\)+\\)" 2)
)
"Value for `imenu-generic-expression' for SQL files in Oacs Minor Mode.")
(provide 'oacs-vars)
;;; oacs-vars.el ends here
oacs/oacs-nxml.el 0000644 0001750 0001750 00000002403 10412346150 012641 0 ustar dave dave ;;; oacs-nxml.el --- OACS NXML extension
;; Copyright (C) 2004 Free Software Foundation, Inc.
;; Author: Bart Teeuwisse
;; Keywords: extensions, convenience, tools
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; Part of the Emacs OACS module. See oacs.el for more information.
;;; Code:
;; nXML mode
(load "rng-auto.el")
(setq auto-mode-alist
(append (list '("\\.adp" . nxml-mode)
'("\\.xql" . nxml-mode)
'("\\.info" . nxml-mode))
auto-mode-alist))
(provide 'oacs-nxml)
;;; oacs-nxml.el ends here
oacs/oacs-psgml.el 0000644 0001750 0001750 00000007476 10412346150 013024 0 ustar dave dave ;;; oacs-psgml.el --- OACS PSGML extension
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: extensions, convenience, tools
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; Part of the Emacs OACS module. See oacs.el for more information.
;;; Code:
(require 'psgml)
(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t)
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t)
(add-to-list 'auto-mode-alist '("\\.html" . sgml-mode))
(add-to-list 'auto-mode-alist '("\\.htm" . sgml-mode))
(add-to-list 'auto-mode-alist '("\\.adp" . xml-mode))
(add-to-list 'auto-mode-alist '("\\.xml" . xml-mode))
(add-to-list 'auto-mode-alist '("\\.xql" . xml-mode))
(add-to-list 'auto-mode-alist '("\\.info" . xml-mode))
(add-to-list 'sgml-markup-faces
'((start-tag . font-lock-function-name-face)
(end-tag . font-lock-function-name-face)
(comment . font-lock-comment-face)
(pi . bold)
(sgml . bold)
(doctype . bold)
(entity . font-lock-type-face)
(shortref . font-lock-function-name-face))
)
(setq sgml-set-face t)
(setq-default sgml-indent-data t)
(setq-default sgml-ignore-undefined-elements nil)
(setq-default sgml-auto-activate-dtd t)
(add-to-list 'sgml-custom-dtd
'("XQL 1.0"
"\n" ))
(add-to-list 'sgml-custom-dtd
'("XHTML 1.1"
"\n"))
(add-to-list 'sgml-custom-dtd
'("XHTML 1.0 Frameset"
"\n" ))
(add-to-list 'sgml-custom-dtd
'("XHTML 1.0 Strict"
"\n" ))
(add-to-list 'sgml-custom-dtd
'("XHTML 1.0 Transitional"
"\n" ))
(add-to-list 'sgml-custom-dtd
'("Package 1.0"
"\n" ))
(add-to-list 'sgml-custom-dtd
'("HTML 4.01 Frameset"
""))
(add-to-list 'sgml-custom-dtd
'("HTML 4.01 Strict"
""))
(add-to-list 'sgml-custom-dtd
'("HTML 4.01 Transitional"
""))
(add-to-list 'sgml-custom-dtd
'("HTML 3.2"
""))
(provide 'oacs-psgml)
;;; oacs-psgml.el ends here
oacs/oacs-occur.el 0000644 0001750 0001750 00000005340 10412346150 013001 0 ustar dave dave ;;; oacs-occur.el --- OACS occur extensions
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: convenience, extensions, tools
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; OACS occur extensions to quickly locate debug messages, procedure
;; definitions in OpenACS code or error log.
;; Uses color occur if available. Color occur is highly recommended
;; but not required. Download from:
;; http://www.emacswiki.org/elisp/color-occur.el
;;; Code:
;; Load color-occur if available.
(condition-case nil
(require 'color-occur)
(error nil))
(defun oacs-occur-dbg (&optional level)
"Find occurances of your dbg messages."
(interactive)
(occur
(concat "^\\[[^\\w
]*" level "
-*
" (upcase (user-login-name)) "[^\\[]*" nil)
)
)
(defun oacs-occur-dbg-bug ()
(interactive)
(oacs-occur-dbg " Bug: ")
"Find occurances of your bug level dbg messages."
)
(defun oacs-occur-dbg-debug ()
(interactive)
(oacs-occur-dbg " Debug: ")
"Find occurances of your debug level dbg messages."
)
(defun oacs-occur-dbg-error ()
(interactive)
(oacs-occur-dbg " Error: ")
"Find occurances of your error level dbg messages."
)
(defun oacs-occur-dbg-fatal ()
"Find occurances of your fatal level dbg messages."
(interactive)
(oacs-occur-dbg " Fatal: ")
)
(defun oacs-occur-dbg-notice ()
"Find occurances of your notice level dbg messages."
(interactive)
(oacs-occur-dbg " Notice: ")
)
(defun oacs-occur-dbg-warning ()
"Find occurances of your warning level dbg messages."
(interactive)
(oacs-occur-dbg " Warning: ")
)
(defun oacs-occur-proc ()
"Find occurances of ad_proc, proc, or doc_proc definitions."
(interactive)
(occur "^\\s-*\\(ad_\\|doc_\\)?proc\\b")
)
(defun oacs-occur-function ()
"Find occurances of function definitions."
(interactive)
(occur "^\\s-*function\\s-+[^ ]+\\s-+(" nil)
)
(defun oacs-occur-query ()
"Find occurances of query definitions."
(interactive)
(occur "^[ ]*<\\(full\\|partial\\)query" nil)
)
(provide 'oacs-occur)
;;; oacs-occur.el ends here
oacs/adp-master.rnc 0000644 0001750 0001750 00000000265 10412346150 013163 0 ustar dave dave start |= master
master = element master {
master.attlist,
master.content
}
master.attlist = attribute src {
Text.datatype
}?
master.content = property*, Block.model
oacs/oacs-format.el 0000644 0001750 0001750 00000026375 10412346150 013171 0 ustar dave dave ;;; oacs-format.el --- OACS formatting extensions
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: convenience, tools, extensions
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; OACS formatting extensions to re-format Tcl, Html, Sql, or Adp code.
;;; Code:
;; HTML/ADP format tools
(defun oacs-quote-tags ()
"Quote unquoted HTML/XML tags"
(save-excursion
(replace-regexp "=\\([^\\\"][^ >]*?[^\\\"]\\|[^\\\"]\\)\\([ >]\\)" "=\"\\1\"\\2" nil (point-min) (point-max))
)
)
(defun oacs-format-empty-element-tags ()
"Add missing / to empty element tags"
(save-excursion
(replace-regexp "\\(<\\(img\\|input\\|maste\\|includ\\|formwidget\\|formhelp\\)[^>]*?[^/]\\)>" "\\1 />" nil (point-min) (point-max))
(replace-regexp " " " " nil (point-min) (point-max))
(replace-regexp " " " " nil (point-min) (point-max))
)
)
(defun oacs-format-separate-tags ()
"Place adjacent tags on separate lines"
(save-excursion
(replace-regexp ">\\s-*<" ">
<" nil (point-min) (point-max))
)
)
(defun oacs-format-includes ()
"Place all include attribubtes on a separate line."
(save-excursion
(goto-char (point-min))
(while (search-forward-regexp "" nil t))
)
)
)
(defun oacs-format-html ()
"Format an HTML page"
(interactive)
(oacs-quote-tags)
(oacs-format-empty-lines 1)
(oacs-format-empty-element-tags)
(oacs-format-separate-tags)
(oacs-format-includes)
(indent-region (point-min) (point-max) nil)
)
(defun oacs-format-empty-lines (count)
"Replace multiple empty lines by COUNT empty lines. Mostly used with
a COUNT of 2 for a single empty line or 1 to remove empty lines
altogether."
(save-excursion
(replace-regexp "\\(
\\s-*\\)\\{2,\\}" (make-string count ?\n) nil (point-min) (point-max))
)
)
(defun oacs-format-comments ()
"Make sure that comments are filed and both preceded and followed by
an empty line."
(save-excursion
;; Preceed all comments with an empty line.
(replace-regexp "\\(^[^#]*\\(?:\\w\\|}\\).*
\\)\\(\\s-*#\\)" "\\1
\\2" nil (point-min) (point-max))
;; Proceed all comments with an empty line.
(replace-regexp "\\(^\\s-*#.*
\\)\\(\\s-*\\b[^#
]\\)" "\\1
\\2" nil (point-min) (point-max))
;; Remove comments line w/o any text, just #'s and
;; whitespaces. They would interfere with the next step: filling
;; the paragraphs.
(replace-regexp "^\\s-*#+\\s-*
" "" nil (point-min) (point-max))
;; Remove all leading #'s
(replace-regexp "#+\\s-*$" "" nil (point-min) (point-max))
;; Replace multiple #'s to a single #
(replace-regexp "##+" "#" nil (point-min) (point-max))
;; Fill all comment paragraphs.
(goto-char (point-min))
(while (search-forward-regexp "^\\s-*#" nil t)
(backward-sentence)
(if (not (equal (point) (point-min)))
(fill-paragraph nil)
)
(forward-paragraph)
)
)
)
(defun oacs-format-query-as ()
"Place the keyword as on the same line as the field being selected"
(save-excursion
(replace-regexp "\\(
\\|\\s-\\)+as\\b" " as" nil (point-min) (point-max))
)
)
(defun oacs-format-operators ()
"Place the operators =, ==, =>, < and > on the same line as the
field(s) being compared/assigned. "
(save-excursion
(replace-regexp "\\(
\\|\\s-\\)+\\(=\\|>\\|<\\)" " \\2" nil (point-min) (point-max))
)
)
(defun oacs-format-logical-operators ()
"Place logical operators || and && at the beginning of a new line."
(save-excursion
(replace-regexp "^\\(.*?\\w.*?\\)\\(||\\|&&\\)\\s-*\\\\?\\s-*\n?\\s-+" "\\1
\\2 " nil (point-min) (point-max))
)
)
(defun oacs-format-brackets ()
"Remove spaces before and after brackets."
(save-excursion
;; Remove spaces between ]}, }}, }] and ]] as well as leading
;; spaces before ] or }.
(replace-regexp "\\(]\\|\\b\\|}\\)\\s-+\\(}\\|]\\)" "\\1\\2" nil (point-min) (point-max))
;; Remove spaces trailing }.
(replace-regexp "\\({\\|\\[\\)\\s-+" "\\1" nil (point-min) (point-max))
;; Remove empty lines before a closing brace.
(replace-regexp "\\(
\\s-*\\)+\\(
\\s-*}\\)" "\\2" nil (point-min) (point-max))
;; Place closing db_* } bracket at end of query instead of a new line.
(replace-regexp "\\(db_.*{[^\\}]*\\)
\\s-*}" "\\1}" nil (point-min) (point-max))
)
)
(defun oacs-format-proc-call ()
"Replace multiple spaces before a [ bracket by a single space and
remove all trailing spaces. Replace all spaces before the closing ]
bracket. And place named parameters on a separate line."
(save-excursion
(replace-regexp "\\(\\s-\\)+\\(\\[\\)\\(\\s-*\\)" " \\2" nil (point-min) (point-max))
(replace-regexp "\\(\\s-\\)+\\(\\]\\)" "\\2" nil (point-min) (point-max))
(goto-char (point-min))
(while (search-forward-regexp "\\[" nil t)
(replace-regexp "\\([^\\\\]\\b\\)\\(
\\|\\s-\\)+-" "\\1 \\\\
-" nil (point) (search-forward-regexp "\\]" nil t))
)
(indent-region (point-min) (point-max) nil)
)
)
(defun oacs-format-proc ()
"Format layout of ad_proc, proc and proc_doc."
(let ((proc "\\(?:^\\s-*\\(?:ad_\\)?proc\\(?:_doc\\)?\\)"))
(save-excursion
;; Place an empty line below the ad_proc, proc or proc_doc
;; definition.
(replace-regexp
(concat "\\("
proc
".*{\\)
+\\([^
]\\)") "\\1
\\2" nil (point-min) (point-max))
;; Remove leading and trailing empty lines around } {
(replace-regexp "\\(
+\\)\\(} \\(?:-properties \\)?{\\)\\(
*\\)" "
\\2
" nil (point-min) (point-max))
)
)
)
(defun oacs-format-proc-parameters ()
"Format procedure parameters. Each parameter is placed on a new line."
(save-excursion
(goto-char (point-min))
(while (search-forward-regexp "^\\s-*\\(?:ad_\\)?proc\\(?:_doc\\)?.*?{" nil t)
(match-end 0)
(backward-char)
(let ((start (point))
(end (save-excursion
(forward-sexp)
(point))))
(save-restriction
(forward-char)
(narrow-to-region start end)
(if (not (looking-at "\n"))
(insert "\n")
)
(while (condition-case nil
(progn
(forward-sexp)
t)
(error nil))
(if (not (looking-at "\n"))
(insert "\n")
)
)
)
)
)
)
)
(defun oacs-format-page-contract ()
"Remove empty lines below ad_page_contract."
(save-excursion
(replace-regexp "\\(ad_page_contract {\\)\\(
+\\)" "\\1
" nil (point-min) (point-max))
)
)
(defun oacs-format-set ()
"Remove superfluous spaces in 'set' and ad_page_contract
initialization instructions."
(save-excursion
(replace-regexp "set\\s-+\\([^ ]+\\)\\s-\\{2,\\}" "set \\1 " nil (point-min) (point-max))
(replace-regexp "^\\(\\s-+{[^ ]+\\)\\s-\\{2,\\}" "\\1 " nil (point-min) (point-max))
)
)
(defun oacs-replace-return ()
"Replace return with ad-script-abort."
(save-excursion
(query-replace-regexp "^\\(\\s-*\\)return;?$" "\\1ad_script_abort" nil (point-min) (point-max))
)
)
(defun oacs-format-tcl ()
"Format a Tcl page"
(interactive)
(save-excursion
(goto-char (point-min))
(delete-trailing-whitespace)
(oacs-format-empty-lines 2)
(oacs-format-proc)
(oacs-format-proc-parameters)
(oacs-format-comments)
(oacs-format-query-as)
(oacs-format-operators)
(oacs-format-logical-operators)
(oacs-format-brackets)
(oacs-format-proc-call)
(oacs-format-page-contract)
(oacs-format-set)
(indent-region (point-min) (point-max) nil)
(mmm-parse-buffer)
)
)
(defun oacs-format-sql-comments ()
"Make sure that SQL comments are filed and both preceded and followed by
an empty line."
(save-excursion
;; Preceed all comments with an empty line.
(replace-regexp "\\(^[^-]*\\(?:\\w\\|}\\).*
\\)\\(\\s-*--\\)" "\\1
\\2" nil (point-min) (point-max))
;; Proceed all comments with an empty line.
(replace-regexp "\\(^\\s-*--.*
\\)\\(\\s-*\\b[^-
]\\)" "\\1
\\2" nil (point-min) (point-max))
;; Fill all comment paragraphs. Commented out because filling
;; comments in sql.el doesn't work too well.
;; (goto-char (point-min))
;; (while (search-forward-regexp "^\\s-*--" nil t)
;; (backward-sentence)
;; (if (not (equal (point) (point-min)))
;; (fill-paragraph nil)
;; )
;; (forward-paragraph)
;; )
)
)
(defun oacs-format-sql ()
"Format a SQL script"
(interactive)
(save-excursion
(replace-regexp "^\\(\\s-\\|-\\)\\{4,\\}
" "" nil (point-min) (point-max))
(replace-regexp "^.*?---.*?
" "" nil (point-min) (point-max))
(replace-regexp "(\\s-*\\(.*?\\)\\s-*)" "(\\1)" nil (point-min) (point-max))
(replace-regexp "\\(\\s-\\|
\\)+then" " then" nil (point-min) (point-max))
(replace-regexp "\\(\\s-\\|
\\)+default " " default " nil (point-min) (point-max))
(replace-regexp "\\s-+in\\s-+" " in " nil (point-min) (point-max))
(replace-regexp "\\s-+=>\\s-+" " => " nil (point-min) (point-max))
(replace-regexp "\\(\\w\\)\\s-\\{2,\\}\\(\\w\\|=\\|!\\)" "\\1 \\2" nil (point-min) (point-max))
(replace-regexp "^\\(\\s-*\\)\\(select.*\\)\\s-+\\(into \\)" "\\1\\2
\\1\\3" nil (point-min) (point-max))
(replace-regexp "^\\(\\s-*\\)\\(select.*[^)]\\)
\\s-*\\(into\\)" "\\1\\2
\\1\\3" nil (point-min) (point-max))
(replace-regexp "^\\(\\s-*\\)\\(into.*[^)]\\)
\\s-*\\(from\\)" "\\1\\2
\\1\\3" nil (point-min) (point-max))
(replace-regexp "^\\(\\s-*\\)\\(\\(delete\\|from\\).*[^)]\\)
\\s-*\\(where\\)" "\\1\\2
\\1\\4" nil (point-min) (point-max))
(replace-regexp "^\\(\\s-*\\)\\(update.*[^)]\\)
\\s-*\\(set\\)" "\\1\\2
\\1\\3" nil (point-min) (point-max))
(replace-regexp "^\\(\\s-*\\)\\(set.*[^)]\\)
\\s-*\\(where\\)" "\\1\\2
\\1\\3" nil (point-min) (point-max))
(replace-regexp "^\\(\\s-*\\)\\(\\(where\\|and\\|or\\).*[^)]\\)
\\s-*\\(and\\|or\\)" "\\1\\2
\\1\\4" nil (point-min) (point-max))
(replace-regexp "\\(if.*,\\)
\\s-*" "\\1 " nil (point-min) (point-max))
(untabify (point-min) (point-max))
(replace-regexp "^\\s-\\{10\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
(replace-regexp "^\\s-\\{9\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
(replace-regexp "^\\s-\\{7\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
(replace-regexp "^\\s-\\{6\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
(replace-regexp "^\\s-\\{3\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
(replace-regexp "^\\s-\\{5\\}\\(\\w\\|-\\)" " \\1" nil (point-min) (point-max))
(oacs-format-sql-comments)
(oacs-format-empty-lines 2)
)
)
(provide 'oacs-format)
;;; oacs-format.el ends here
oacs/oacs-comment.el 0000644 0001750 0001750 00000006401 10412346150 013327 0 ustar dave dave ;;; oacs-comment.el --- OACS tcl comment adaptation
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: convenience, tools, extensions
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; Adapt the Tcl comment functions so that ad_proc documentation text
;; is classified as comments and can be formatted using auto-fill and
;; M-q.
;;; Code:
(defadvice tcl-in-comment (after tcl-in-comment)
"Classify ad_proc documentation text as comments so that
tcl-do-fill-paragraph also can be used on the documentation text."
(save-excursion
(let ((bound (point))
(start (if (not (search-backward-regexp "}[ \t]+{" nil t 2))
(goto-char (point-min))
)))
(if (search-forward-regexp "^\\s-*\\(\\(ad_\\)?proc\\(_doc\\)?\\|ad_library\\).*{" bound t)
(setq ad-return-value t)
)
)
)
)
(ad-activate 'tcl-in-comment)
(defadvice tcl-do-fill-paragraph (around fill-proc-documentation)
"Comment the documentation of ad_proc or proc_doc so that
tcl-do-fill-paragraph can fill the documentation paragraphs. Uncomment
the documentation after filling the paragraph."
(save-excursion
(let ((bound (point))
;; Locate the last but one section separator, or if there is
;; none start from the top of the buffer.
(start (if (not (search-backward-regexp "}[ \t]+{" nil t 2))
(goto-char (point-min))
)))
;; Check if there is a proc definition between the section
;; separator and the current location.
(if (not (search-forward-regexp "^\\s-*\\(\\(ad_\\)?proc\\(_doc\\)?\\|ad_library\\).*{" bound t))
;; The current location is NOT in a proc documentation
;; section. Execute tcl-do-fill-paragraph w/o massaging the
;; paragraph first.
(progn
(goto-char bound)
ad-do-it)
;; The current location is in a proc documentation
;; section. Comment the section before running
;; tcl-do-fill-paragraph. Uncomment the section after filling
;; the paragraph.
(goto-char bound)
(backward-up-list)
(comment-region (save-excursion
(forward-to-indentation 1)
(point))
(save-excursion
(forward-sexp)
(backward-char)
(point)))
(goto-char bound)
ad-do-it
(goto-char bound)
(backward-up-list)
(uncomment-region (save-excursion
(forward-to-indentation 1)
(point))
(save-excursion
(forward-sexp)
(backward-char)
(point)))
)
)
)
)
(ad-activate 'tcl-do-fill-paragraph)
;;; Always activate the minor tcl-auto-fill-mode in major tcl-mode
(add-hook 'tcl-mode-hook 'tcl-auto-fill-mode)
(provide 'oacs-comment)
;;; oacs-comment.el ends here
oacs/oacs-abbrevs.el 0000644 0001750 0001750 00000023220 10412346150 013307 0 ustar dave dave ;;; oacs-abbrevs.el --- OACS abbreviations
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: extensions, tools, convenience
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; OACS abbreviations for procedure definitions, debug messages, etc.
;;; Code:
(defun oacs-initial ()
"Return the developer's initials followed by a space"
(concat
(mapconcat (function (lambda (str)
(substring str 0 1)))
(split-string user-full-name) nil) " "))
(defun oacs-remove-dbg ()
"Remove OACS debug messages from the current buffer"
(interactive)
(save-excursion
(goto-char (point-min))
(query-replace-regexp (concat "^\\s-*ns_log.*\"\\(
" (oacs-initial) "-\\{80\\}\\(
" (oacs-initial) ".*\\)*\\)\\{2\\}\"
") "" nil nil nil)))
(define-skeleton oacs-proc
"Declare an improved Tcl procedure."
nil
"ad_proc " (completing-read
"Type of procedure: "
'(("-public" 0) ("-private" 1))
nil t nil 'oacs-proc-type-history 'oacs-proc-type) " "
(read-string "Procedure name: " nil 'oacs-proc-name-history) | _
" {" \n >
(while (not (equal (setq parameter (read-string "Parameter definition: " nil 'oacs-parameter-history)) ""))
(skeleton-insert '(nil parameter \n >))
(push parameter oacs-proc-parameters)
)| _
"} {" > \n
> _ \n \n
> '(oacs-author) \n
> '(oacs-creation-date) \n \n
(let* ((oacs-proc-parameters (nreverse oacs-proc-parameters)))
(while (setq parameter (pop oacs-proc-parameters))
(skeleton-insert '(nil
> "@param "
(if (string-match "\\([a-zA-Z_0-9]+\\)" parameter)
(match-string 1 parameter))
"\n\n" )
)
)
)
(setq oacs-proc-parameters nil)
> "@return " \n \n
> "@error " ?\n
"} {" \n ?\n
"}" \n \n
)
(define-skeleton oacs-author
"Insert the OpenACS @author tag"
nil
"@author " user-full-name " (" user-mail-address ")"
)
(define-skeleton oacs-cvs-id
"Insert the OpenACS @cvs-id tag"
nil
"@cvs-id $Id$"
)
(define-skeleton oacs-creation-date
"Insert the OpenACS @creation-date tag"
nil
"@creation-date " (format-time-string "%Y-%m-%d" (current-time)))
(define-skeleton oacs-author-stamp
"Insert an AUTHOR DATE stamp. Where AUTHOR is the capitalized user
name and DATE is the current date of the form %Y-%m-%d"
nil
(upcase (user-login-name)) " " (format-time-string "%Y-%m-%d" (current-time)))
(define-skeleton oacs-dbg-log
"Insert the AOLServer log statement and logging level."
nil
"ns_log " (completing-read
"Type of log message: "
'(("bug" 0) ("debug" 1) ("error" 2) ("fatal" 3) ("notice" 4) ("warning" 5))
nil t nil 'oacs-dbg-type-history 'oacs-dbg-severity) " "
"\"" ?\n)
(define-skeleton oacs-dbg-head
"Insert the common head of OpenACS debug messages."
nil
(oacs-initial) "--------------------------------------------------------------------------------" ?\n
(oacs-initial) (upcase (user-login-name)) " debugging "
(save-excursion
(let ((current-point (point))
(regexp "^\\s-*\\(ad_\\|doc_\\)?proc\\(\\s-+-\\w+\\)*\\s-+\\(\\(:*\\w_?\\)+\\)")
(bound (re-search-backward "^}\\s-*$" nil t)))
; Restore point to the location before searching backwards fo
; the last line of the previous proc.
(goto-char current-point)
; Search backwards for the declaration of a Tcl procedure but
; don't go beyond a line starting with a closing bracket as the
; assumption is that the last closing bracket of procedures
; always is the first character of the line.
(if (re-search-backward regexp bound t)
(concat "procedure " (match-string 3))
(buffer-file-name))))
| _ ?\n
(oacs-initial) "--------------------------------------------------------------------------------")
(define-skeleton oacs-dbg-tail
"Insert the common tail of OpenACS debug messages."
nil
(oacs-initial) "--------------------------------------------------------------------------------")
(define-skeleton oacs-dbg
"Insert an OpenACS debuging message to write selected variable to
the AOLServer log."
nil
'(oacs-dbg-log)
'(oacs-dbg-head)
("Paramater name: " ?\n (oacs-initial) str " = '${" str "}'")
_ ?\n
'(oacs-dbg-tail) "\""
)
(define-skeleton oacs-dbg-headers
"Insert an OpenACS debug message which writes all headers and form
variables to the AOLServer log."
nil
"set oacs:msg \"" ?\n
> '(oacs-dbg-head) ?\n
> (oacs-initial) "Headers:\"" ?\n
> "set oacs:headers [ns_conn headers]" \n
> "for {set oacs:i 0} {${oacs:i} < [ns_set size ${oacs:headers}]} {incr oacs:i} {" \n
> "set oacs:key [ns_set key ${oacs:headers} ${oacs:i}]" \n
> "set oacs:value [ns_set value ${oacs:headers} ${oacs:i}]" \n
> "append oacs:msg \"" \n
> (oacs-initial) " ${oacs:key} = '${oacs:value}'\"" ?\n
> -4 "}" ?\n
> "append oacs:msg \"" \n (oacs-initial) \n
> (oacs-initial) "Form variables:\"" ?\n
> "set oacs:form [ns_getform]" \n
> "for {set oacs:i 0} {${oacs:i} < [ns_set size ${oacs:form}]} {incr oacs:i} {" \n
> "set oacs:key [ns_set key ${oacs:form} ${oacs:i}]" \n
> "set oacs:value [ns_set value ${oacs:form} ${oacs:i}]" \n
> "append oacs:msg \"" \n
> (oacs-initial) " ${oacs:key} = '${oacs:value}'\"" ?\n
> -4 "}" \n
> "append oacs:msg \"" \n
> '(oacs-dbg-tail) "\"" \n
> '(oacs-dbg-log) "${oacs:msg}\"" ?\n
)
(define-skeleton oacs-dbg-form
"Insert an OpenACS debug message which records form errors to the
AOLServer log. Requires a variable named 'form_id' with the name of
the OpenACS form. Recommended practice:
set form_id my_form
template::form create $form_id
template::element create $form_id my_element \
...."
nil
"if {[info exists ${form_id}:error]} {" ?\n
> '(oacs-dbg-log)
> '(oacs-dbg-head) ?\n
> (oacs-initial) "${form_id}:error = '[array get ${form_id}:error]'" ?\n
> '(oacs-dbg-tail) "\"" ?\n
> -4 "}"
)
(define-skeleton oacs-template-form
"Insert a template::form declaration."
nil
"set form_id " (read-string "Form name: ") ?\n
> "template::form create $form_id"
)
;;; Associate OpenACS Tcl abbreviations with tcl-mode
(define-abbrev-table 'tcl-mode-abbrev-table '(
("oauthor" "" oacs-author 0)
("ocreation" "" oacs-creation-date 0)
("ocvs" "" oacs-cvs-id 0)
("odbg" "" oacs-dbg 0)
("odbgf" "" oacs-dbg-form 0)
("odbgh" "" oacs-dbg-headers 0)
("oproc" "" oacs-proc 0)
("ostamp" "" oacs-author-stamp 0)
("oform" "" oacs-template-form 0)
))
;;; Associate OpenACS SQL abbreviations with sql-mode
(define-abbrev-table 'sql-mode-abbrev-table '(
("oauthor" "" oacs-author 0)
("ocreation" "" oacs-creation-date 0)
("ocvs" "" oacs-cvs-id 0)
("ostamp" "" oacs-author-stamp 0)
))
(defun define-insert-map (map sub-mode)
"Define the appropriate sub menu MAP to the OACS menu bar for the abbreviations
available to the sub mode SUB-MODE."
(case sub-mode
(tcl
(define-key map [insert-ostamp]
'(menu-item "ostamp" oacs-author-stamp
:help "Insert an AUTHOR DATE stamp at point"))
(define-key map [insert-oproc]
'(menu-item "oproc" oacs-proc
:help "Insert ad_proc at point"))
(define-key map [insert-odbgh]
'(menu-item "odbgh" oacs-dbg-headers
:help "Insert personal HTTP headers & form variables debug message at point"))
(define-key map [insert-odbgf]
'(menu-item "odbgf" oacs-dbg-form
:help "Insert personal form template debug message at point"))
(define-key map [insert-odbg]
'(menu-item "odbg" oacs-dbg
:help "Insert personal debug message at point"))
(define-key map [insert-ocvs]
'(menu-item "ocvs" oacs-cvs-id
:help "Insert @cvs-id at point"))
(define-key map [insert-creation]
'(menu-item "ocreation" oacs-creation-date
:help "Insert @creation-date at point"))
(define-key map [insert-oauthor]
'(menu-item "oauthor" oacs-author
:help "Insert @author at point"))
)
(sql
(define-key map [insert-ostamp]
'(menu-item "ostamp" oacs-author-stamp
:help "Insert an AUTHOR DATE stamp at point"))
(define-key map [insert-ocvs]
'(menu-item "ocvs" oacs-cvs-id
:help "Insert @cvs-id at point"))
(define-key map [insert-creation]
'(menu-item "ocreation" oacs-creation-date
:help "Insert @creation-date at point"))
(define-key map [insert-oauthor]
'(menu-item "oauthor" oacs-author
:help "Insert @author at point"))
)
(xql
(define-key map [insert-ostamp]
'(menu-item "ostamp" oacs-author-stamp
:help "Insert an AUTHOR DATE stamp at point"))
(define-key map [insert-ocvs]
'(menu-item "ocvs" oacs-cvs-id
:help "Insert @cvs-id at point"))
(define-key map [insert-creation]
'(menu-item "ocreation" oacs-creation-date
:help "Insert @creation-date at point"))
(define-key map [insert-oauthor]
'(menu-item "oauthor" oacs-author
:help "Insert @author at point"))
)))
;;; Always activate the minor abbrev-mode in major tcl-mode
(add-hook 'tcl-mode-hook 'abbrev-mode)
(provide 'oacs-abbrevs)
;;; oacs-abbrevs.el ends here
oacs/oacs-headers.el 0000644 0001750 0001750 00000014543 10412346150 013306 0 ustar dave dave ;;; oacs-headers.el --- OACS auto insert headers extension
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: convenience, extensions, tools
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
;; OACS auto insert headers. Insert standard headers when creating new
;; OpenACS files.
;;; Code:
;;; Auto insert headers when creating new OpenACS files.
(require 'autoinsert)
(auto-insert-mode)
(setq auto-insert-query nil)
(define-auto-insert "\.adp$" 'oacs-adp-template)
(define-auto-insert "www/.*\.tcl$" 'oacs-tcl-template)
(define-auto-insert "resources/.*\.tcl$" 'oacs-tcl-template)
(define-auto-insert (concat oacs-base-dir ".*/lib/.*\.tcl$") 'oacs-inc-template)
(define-auto-insert "tcl/.*\.tcl$" 'oacs-lib-template)
(define-auto-insert "\.vuh$" 'oacs-vuh-template)
(define-auto-insert "\.xql$" 'oacs-xql-template)
(define-auto-insert "sql/[^/]*/?.*\.sql$" 'oacs-sql-template)
(defun oacs-file-name ()
"Get the file name of the current buffer relative to the OpenACS
base dir."
(let ((file-name (buffer-file-name)))
(if (string-match (concat oacs-base-dir "/[^/]*/") file-name)
(substring file-name (match-end 0))
)
))
;;; Skeleton definitions.
(define-skeleton oacs-adp-template
"Insert master tag with selected property tags into a new .adp page"
nil
"" \n >
(if (string-equal (setq v1 (read-string "Title: (empty is none) " "@title@")) "")
""
(concat ""v1"")) & \n >
(if (string-equal (setq v1 (read-string "Header stuff: (empty is none) " "@header_stuff@")) "")
""
(concat ""v1"")) & \n >
(if (string-equal (setq v1 (read-string "Context: (empty is none) " "@context@")) "")
""
(concat ""v1"")) & \n >
(if (string-equal (setq v1 (read-string "Focus: (empty is none) " "@focus@")) "")
""
(concat ""v1"")) & \n ?\n
_
)
(define-skeleton oacs-tcl-template
"Declare the Tcl part of OpenACS web page."
"Brief documentation: "
"# " (oacs-file-name) \n \n
"ad_page_contract {" \n \n
> str | _ \n \n
> '(oacs-author) ?\n
> '(oacs-creation-date) ?\n
(if (not (null oacs-insert-cvs-id))
(skeleton-insert '(nil
> '(oacs-cvs-id) ?\n)))
> -4 "} {" \n
> _ ?\n
"} -properties {
} -validate {
} -errors {
}
"
)
(define-skeleton oacs-lib-template
"Declare an OpenACS Tcl library."
nil
"# " (oacs-file-name) \n \n
"ad_library {" \n \n
> _ \n \n
> '(oacs-author) ?\n
> '(oacs-creation-date) ?\n
(if (not (null oacs-insert-cvs-id))
(skeleton-insert '(nil
> '(oacs-cvs-id) ?\n)))
> -4 "}" \n \n
)
(define-skeleton oacs-inc-template
"Declare a OpenACS page."
"Brief documentation: "
"# " (oacs-file-name) ?\n
"#" ?\n
"# " str | _ ?\n
"#" ?\n
"# " '(oacs-author) ?\n >
"# " '(oacs-creation-date) ?\n
(if (not (null oacs-insert-cvs-id))
(skeleton-insert '(nil
"# " '(oacs-cvs-id) ?\n)))
?\n
"foreach required_param {"
(while (not (equal (setq parameter (read-string "Required parameter: " nil 'oacs-parameter-history)) ""))
(skeleton-insert '(nil parameter " "))
) & -1
"} {" \n
"if {![info exists $required_param]} {" \n
"return -code error \"$required_param is a required parameter.\"" \n
-4 "}" \n
-4 "}" \n
"foreach optional_param {"
(while (not (equal (setq parameter (read-string "Optional parameter: " nil 'oacs-parameter-history)) ""))
(skeleton-insert '(nil parameter " "))
) & -1
"} {" \n
"if {![info exists $optional_param]} {" \n
"set $optional_param {}" \n
-4 "}" \n
-4 "}"\n
_
)
(define-skeleton oacs-vuh-template
"Declare a .VUH OpenACS web page."
"Brief documentation: "
"# " (oacs-file-name) ?\n
"#" ?\n
"# " str | _ ?\n
"#" ?\n
"# " '(oacs-author) ?\n >
"# " '(oacs-creation-date) ?\n
(if (not (null oacs-insert-cvs-id))
(skeleton-insert '(nil
"# " '(oacs-cvs-id) ?\n)))
?\n
_
)
(define-skeleton oacs-xql-template
"Declare an OpenACS xql query definition file."
nil
"" ?\n
(if oacs-tdom-installed
(concat "")) \n
(concat "") \n
"" \n
"" \n
(if (not (null oacs-insert-cvs-id))
(skeleton-insert '(nil
"" \n \n)))
"" \n
(if (string-match ".*-oracle.xql$" (buffer-file-name))
(skeleton-insert '(nil
\n \n
> "" \n
> "oracle" \n
""
(read-string "Oracle version: " oacs-oracle-version 'oacs-oracle-version-history)
"" \n
-2 "" \n &"\n")
)
)
(if (string-match ".*-postgresql.xql$" (buffer-file-name))
(skeleton-insert '(nil
\n \n
> "" \n
> "postgresql" \n
""
(read-string "PostgreSQL version: " oacs-postgresql-version 'oacs-postgres-version-history)
"" \n
-2 "" \n &"\n")
)
)
> _ ?\n
"" \n
)
(define-skeleton oacs-sql-template
"Declare an OpenACS sql data model definition file."
nil
"-- " \n
"-- " (oacs-file-name) ?\n
"-- " \n
"-- " '(oacs-author) ?\n
"-- " '(oacs-creation-date) ?\n
(if (not (null oacs-insert-cvs-id))
(skeleton-insert '(nil
"-- " '(oacs-cvs-id) ?\n)))
"--" \n \n
_
)
(provide 'oacs-headers)
;;; oacs-headers.el ends here
oacs/adp-property.rnc 0000644 0001750 0001750 00000000167 10412346150 013555 0 ustar dave dave property = element property { property.attlist, Inline.model }
property.attlist =
attribute name { Text.datatype }?
oacs/oacs-error-log.el 0000644 0001750 0001750 00000010346 10412346150 013600 0 ustar dave dave ;;; oacs-error-log.el --- Monitor an AOLServer error log.
;; Copyright (C) 2004 the Code Mill
;; Author: Bart Teeuwisse
;; Keywords: tools, processes, extensions
;; This file 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.
;; This file is distributed in the hope that it will be useful,
;; 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:
(define-generic-mode 'nsd-error-mode
nil
'("Bug" "Debug" "Error" "Fatal" "Notice" "Warning")
'(("^\\(\\[.*\\]\\)" . font-lock-string-face)
("\\([^:]:\\{1,1\\}[A-Za-z_0-9]+\\)" . font-lock-variable-name-face)
("sql(.*?):\\([^[]*\\)" . font-lock-function-name-face))
nil
(list
(lambda ()))
"Major mode for AOLServer error logs.
If you turn on font-lock-mode, you also get nice highlighting.")
(defun oacs-monitor-error-log ()
"Monitor an AOLServer error log in a buffer. SERVER is the name of the AOLServer.
The logfile must be called SERVER-error.log. The directories
oacs-error-log-dirs are sought until one containing a logfile is found.
The buffer is put in Major mode NSD and Minor mode OACS."
(interactive)
(let* ((server (read-string
"Server: " nil 'oacs-error-log-history))
(error-basename (concat server "-error.log"))
(error-log-dirs oacs-error-log-dirs)
(error-log-dir nil)
(error-log "/*"))
;; Switch to buffer if the log is already open. If not locate the
;; log file and open.
(when (not (get-buffer error-basename))
(while (and error-log-dirs (not (file-readable-p error-log)))
(setq error-log-dir (file-name-as-directory (car error-log-dirs)))
(setq error-log (concat error-log-dir error-basename))
(message "Trying %s" error-log)
(setq error-log-dirs (cdr error-log-dirs)))
(if (not (file-readable-p error-log))
(error "No logfile for %s found" server))
;; Open the located error log in nsd-error-mode and move to the
;; end of the log. Then turn auto-revert-mode on.
(message "Monitoring %s" error-log)
(find-file error-log)
(goto-char (point-max))
(nsd-error-mode)
(auto-revert-mode 1)
;; MMM-ify the region that was just added to the log.
(setq oacs-error-log-prev-point-max (point-max))
(set-buffer error-basename)
(add-hook 'after-revert-hook 'oacs-mmm-ify-log-region 1)
(setq default-directory error-log-dir))
(set-window-buffer (selected-window) (get-buffer-create error-basename))))
(defun oacs-mmm-ify-log-region ()
"MMM-ify the region that was just added to the AOLserver error
log. Move the POINT to the end of the buffer if the POINT was at the
end of the buffer before reverting."
(if (and oacs-mmm-ify-log
(< oacs-error-log-prev-point-max (point-max)))
(progn
(count-lines-region oacs-error-log-prev-point-max (point-max))
(mmm-parse-region oacs-error-log-prev-point-max (point-max))
(if (eq oacs-error-log-prev-point-max (point))
(goto-char (point-max)))
(setq oacs-error-log-prev-point-max (point-max)))))
(defun oacs-revert-log ()
"Revert the buffer to the log file on disk without asking for
confirmation"
(interactive)
(revert-buffer nil t))
;; Add global map so that a log can be opened from any Emacs buffer.
(global-set-key "\M-oml" 'oacs-monitor-error-log)
;; Associate log files in the error log directories with
;; nsd-error-mode
(let* ((error-log-dirs oacs-error-log-dirs))
(while (and error-log-dirs)
(add-to-list 'auto-mode-alist (cons (concat (car error-log-dirs) ".*error\\.log") 'nsd-error-mode))
(setq error-log-dirs (cdr error-log-dirs))))
;; Also associate Daemontools backup log files with Nsd-error-mode.
(add-to-list 'auto-mode-alist '("@.*\\.s" . nsd-error-mode))
(provide 'oacs-error-log)
;;; oacs-error-log.el ends here
| |