# HG changeset patch # User ht # Date 1445520534 -3600 # Node ID 0e4eb9db8a93efcb6125924d49ecafa2f1986cc8 # Parent 5f3a215f12eb87f996160c37e04284a3dd9c785b after debugging use with GNU Emacs diff -r 5f3a215f12eb -r 0e4eb9db8a93 common-init.el Binary file common-init.el has changed diff -r 5f3a215f12eb -r 0e4eb9db8a93 pers-init.el --- a/pers-init.el Mon Aug 29 08:51:09 2005 +0100 +++ b/pers-init.el Thu Oct 22 14:28:54 2015 +0100 @@ -59,9 +59,9 @@ (require 'mdn-extras) (setq auto-mode-alist (append '(("/perl/" . perl-mode) - ("\\.scm$" . lisp-mode)) + ("\\.scm$" . scheme-mode)) auto-mode-alist)) -(setq inferior-lisp-program "scheme") +(setq inferior-lisp-program "/c/Progra~1/ChezSc~1.4/bin/i3nt/petite") ;;; for scheme (put 'letrec 'lisp-indent-function 1) (put 'case 'lisp-indent-function 1) @@ -140,26 +140,26 @@ (progn (add-hook 'sh-mode-hook '(lambda () (font-lock-mode 1))) - (setq lsl-mode-hook '(lambda () + (add-hook 'lsl-mode-hook '(lambda () (font-lock-mode 1))) - (setq perl-mode-hook '(lambda () + (add-hook 'perl-mode-hook '(lambda () (font-lock-mode 1))) - (setq emacs-lisp-mode-hook '(lambda () + (add-hook 'emacs-lisp-mode-hook '(lambda () (font-lock-mode 1))) - (setq lisp-mode-hook '(lambda () + (add-hook 'lisp-mode-hook '(lambda () (font-lock-mode 1))) - (setq sgml-mode-hook '(lambda () + (add-hook 'sgml-mode-hook '(lambda () (if (not (boundp 'sgml-font-lock-keywords)) (load "sgml-font-lock-keywords" t t)) (setq adaptive-fill-mode nil) (font-lock-mode 1) )) - (setq c-mode-hook '(lambda () + (add-hook 'c-mode-hook '(lambda () (font-lock-mode 1))) - (setq c++-mode-hook '(lambda () + (add-hook 'c++-mode-hook '(lambda () (font-lock-mode 1))) - (setq scheme-mode-hook + (add-hook 'scheme-mode-hook '(lambda () (setq scheme-font-lock-keywords @@ -168,28 +168,33 @@ (load "lisp-font-lock-keywords" t t)) lisp-font-lock-keywords)) (font-lock-mode 1))) - (setq python-mode-hook '(lambda () + (add-hook 'python-mode-hook '(lambda () (font-lock-mode 1))) (setq py-python-command "//c/Program Files/Python22/python") (setq sgml-insert-missing-element-comment nil) - (load "psgml" nil t) - (load "psgml-edit" nil t) - ;; (load "xml-hack" nil t) -; (setq sgml-catalog-files '("CATALOG" "f:/lib/sgml/catalog")) + (condition-case nil + (progn + (load "psgml" nil t) + (load "psgml-edit" nil t) + ;; (load "xml-hack" nil t) + ;;(setq sgml-catalog-files '("CATALOG" "f:/lib/sgml/catalog" + ) +(error nil)) (if (string-match "i386" (emacs-version)) (progn (defun win32-get-clipboard-data-cmd () (interactive)(insert (win32-get-clipboard-data))) (global-set-key "\C-x\C-y" 'win32-get-clipboard-data-cmd))) ;; gnus - (setq nnml-directory (expand-file-name "/home/ht/MT/ht/mail/Mail")) + (setq nnml-directory (expand-file-name "/home/ht/mail/Mail")) +; (setq mail-signature t) (setq gnus-message-archive-method '(nnfolder "archive" - (nnfolder-directory "/home/ht/MT/ht/mail/cpy") - (nnfolder-active-file "/home/ht/MT/ht/mail/cpy/active") + (nnfolder-directory "/home/ht/mail/cpy") + (nnfolder-active-file "/home/ht/mail/cpy/active") (nnfolder-get-new-mail nil) (nnfolder-inhibit-expiry t))) - (load "gnus-init" nil t) + ;; loading gnus postponed to e.g. mail-from-delphix, q.v. ; (require 'gnus-min) )) @@ -407,9 +412,114 @@ (site-caseq (laptop (defun system-name () "francis.markup.co.uk"))) -(cd (user-home-directory)) -(site-caseq (laptop (if (= (device-pixel-width (selected-device)) 1600) - ;; we're on a big external monitor - (progn - (set-frame-pixel-size (selected-frame) 900 1140) - (set-frame-position (selected-frame) -3 -20))))) +(cd (if (fboundp 'user-home-directory) + (user-home-directory) + (getenv "HOME"))) +(site-caseq (laptop + (if (fboundp 'device-pixel-width) + (let ((pw (device-pixel-width (selected-device)))) + (cond ((= pw 1680) + ;; we're on a big external monitor + (set-frame-pixel-size (selected-frame) 900 960) + (set-frame-position (selected-frame) -3 -20)) + ((= (device-pixel-height (selected-device)) 768) + ;; we're on a narrow cinema-ratio laptop + (set-frame-pixel-size (selected-frame) 690 710) + (set-frame-position (selected-frame) -5 -26)) + ((= (device-pixel-height (selected-device)) 900) + ;; we're on a cinema-ratio laptop + (set-frame-pixel-size (selected-frame) 800 820) + (set-frame-position (selected-frame) -3 -20)) + ((= pw 1600) + ;; we're on a big external monitor + (set-frame-pixel-size (selected-frame) 900 1120) + (set-frame-position (selected-frame) -3 -20)) + ((= pw 1280) + (set-frame-pixel-size (selected-frame) 700 960) + (set-frame-position (selected-frame) -3 -20))))))) + +;;; make dired list directories first +(defadvice dired-insert-directory (before my-dired-insert-directory + (dir-or-list switches &optional wildcard full-p)) + (setq switches (concat switches " --group-directories-first"))) + +(ad-activate 'dired-insert-directory) + +;;; moved from custom.el, where they don't work +(setq + ecb-layout-name "leftright1" + ecb-layout-window-sizes '(("leftright1" + (ecb-directories-buffer-name 0.1474358974358974 . 0.3620689655172414) + (ecb-sources-buffer-name 0.1474358974358974 . 0.3275862068965517) + (ecb-history-buffer-name 0.1474358974358974 . 0.3103448275862069) + (ecb-methods-buffer-name 0.2051282051282051 . 1.0))) + ecb-options-version "2.40" + ecb-show-tags '((default + (include collapsed nil) + (parent collapsed nil) + (type flattened nil) + (variable collapsed name) + (function flattened name) + (label hidden nil) + (t collapsed nil)) + (c++-mode + (include collapsed nil) + (parent collapsed nil) + (type flattened nil) + (variable collapsed access) + (function flattened access) + (function collapsed access) + (label hidden nil) + (t collapsed nil)) + (c-mode + (include collapsed nil) + (parent collapsed nil) + (type flattened nil) + (variable collapsed access) + (function flattened access) + (function collapsed access) + (label hidden nil) + (t collapsed nil)) + (bovine-grammar-mode + (keyword collapsed name) + (token collapsed name) + (nonterminal flattened name) + (rule flattened name) + (t collapsed nil)) + (wisent-grammar-mode + (keyword collapsed name) + (token collapsed name) + (nonterminal flattened name) + (rule flattened name) + (t collapsed nil)) + (texinfo-mode + (section flattened nil) + (def collapsed name) + (t collapsed nil))) + ecb-source-file-regexps '((".*" + ("\\(^\\(\\.\\|#\\)\\|\\(~$\\|\\.\\(elc\\|obj\\|o\\|class\\|lib\\|dll\\|a\\|so\\|cache\\|pyc\\)$\\)\\)") + ("^\\.\\(emacs\\|gnus\\)$"))) + ecb-sources-exclude-cvsignore '(".*") + ediff-diff-options "--binary -b -w -B " + efs-ftp-program-name "/c/Windows/System32/ftp" + efs-ftp-flush-command "help help" + efs-tmp-name-template "C:\\Cygwin\\tmp\\efs" +; efs-ftp-program-name "/usr/bin/ftp" + efs-use-passive-mode nil + gnus-treat-display-picons nil + ispell-local-dictionary "british" + ispell-program-name "aspell" + jde-ant-buildfile "build.xml" + jde-ant-enable-find t + jde-ant-read-target t + jde-auto-parse-buffer-interval 60 + jde-db-option-application-args '("-err" "err.xml" "id.xpdl") + jde-enable-abbrev-mode t + jde-gen-cflow-if '("(if (jde-parse-comment-or-quoted-p)" " '(l \"if\")" " '(l '> \"if\" jde-gen-conditional-padding-1 " " \"(\" jde-gen-conditional-padding-2 (p \"if-clause: \" clause)" " jde-gen-conditional-padding-2 \")\"" " (if jde-gen-k&r " " jde-gen-conditional-padding-3 " " '>'n)" " \"{\"'>'n'>'r'n" " \"}\"" " (if jde-gen-comments " " '(l \" // end of if (\" (s clause) \")\"))" " '>'n'> )" " )") + jde-gen-cflow-try-catch '("(if (jde-parse-comment-or-quoted-p)" " '(l \"try\")" " '(l '> \"try \"" " (if jde-gen-k&r " " ()" " 'n)" " \"{\"'>'n'>'r'n" " \"}\" '>" " (if jde-gen-k&r " " jde-gen-conditional-padding-3 " " 'n)" " \"catch\" jde-gen-conditional-padding-1 " " \"(\" jde-gen-conditional-padding-2 (p \"catch what: \" clause) \" e\"" " jde-gen-conditional-padding-2 \")\" '>" " (if jde-gen-k&r " " jde-gen-conditional-padding-3 " " 'n)" " \"{\"'>'n'>'p'n" " \"}\"" " (if jde-gen-comments " " '(l \" // end of try-catch\"))" " '>'n'> )" " )") + jde-global-classpath '("/home/ht/MT/source/debug:/home/ht/MT/source/3rdparty/jh.jar:/home/ht/MT/source/3rdparty/jsearch.jar") + jde-jdk '("1.6.0") + jde-jdk-registry '(("1.6.0" . "/c/Program Files/Java/jdk1.6.0_23") + ("1.5.0" . "/c/Program Files/j2sdk1.5.0")) + fill-indent-according-to-mode t + ) diff -r 5f3a215f12eb -r 0e4eb9db8a93 xquery-mode.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xquery-mode.el Thu Oct 22 14:28:54 2015 +0100 @@ -0,0 +1,264 @@ +;;; xquery-mode.el --- A simple mode for editing xquery programs +;; Time-stamp: <2005-03-26 18:05:39 sacharya> + +;;; Copyright (C) 2005 Suraj Acharya + +;; Author: Suraj Acharya + +;; This file is not part of GNU Emacs. + +;; xquery-mode.el 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 software 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: +;;; + +(require 'nxml-mode) +(require 'generic-mode) +;;; Code: +(define-generic-mode 'xquery-mode + '(("(:" . ":)") ("!-" . "->")) + '("xquery" "version" "encoding" "at" "module" "namespace" "child" "descendant" "parent" "attribute" "self" "descendant-or-self" "ancestor" "following-sibling" "preceding-sibling" "following" "preceding" "ancestor-or-self" "declare" "function" "option" "ordering" "ordered" "unordered" "default" "order" "external" "or" "and" "div" "idiv" "mod" "in" "construction" "satisfies" "return" "then" "else" "boundary-space" "base-uri" "preserve" "strip" "copy-namespaces" "no-preserve" "inherit" "no-inherit" "to" "where" "collation" "intersect" "union" "except" "as" "case" "instance" "of" "castable" "item" "element" "schema-element" "schema-attribute" "processing-instruction" "comment" "text" "empty" "import" "schema" "is" "eq" "ne" "gt" "ge" "lt" "le" "some" "every" "for" "let" "cast" "treat" "validate" "document-node" "document" "node" "if" "typeswitch" "by" "stable" "ascending" "descending" "greatest" "least" "variable") ;keywords + '(("\\(\\$\\w+\\)" 1 font-lock-variable-name-face) ;; \\(\\s_\\|\\w\\) + ("\\(\\w*:?\\w+\\)\\s *(" 1 font-lock-function-name-face) + ("\\(<\\)\\(/?\\)\\(\\w*\\)\\(:?\\)\\(\\w+\\).*?\\(/?\\)\\(>\\)" + (1 'nxml-tag-delimiter-face) + (2 'nxml-tag-slash-face) + (3 'nxml-element-prefix-face) + (4 'nxml-element-colon-face) + (5 'nxml-element-local-name-face) + (6 'nxml-tag-slash-face) + (7 'nxml-tag-delimiter-face) + ) + ("\\(\\w*\\)\\(:?\\)\\(\\w+\\)=\\([\"']\\)\\(.*?\\)\\([\"']\\)" + (1 'nxml-attribute-prefix-face) + (2 'nxml-attribute-colon-face) + (3 'nxml-attribute-local-name-face) + (4 'nxml-attribute-value-delimiter-face) + (5 'nxml-attribute-value-face) + (6 'nxml-attribute-value-delimiter-face)) + ("\\(/\\)\\(\\w*\\)\\(:?\\)\\(\\w+\\)" + (1 font-lock-constant-face) + (2 font-lock-constant-face) + (3 font-lock-constant-face) + (4 font-lock-constant-face) + ) + ("as\\s +\\(\\w*:?\\w+\\)" + (1 font-lock-type-face) + ) + ) ;font-lock-list + '(".xq[ml]?$") ;auto-mode-list + '(xquery-set-indent-function xquery-set-up-syntax-table) ;function list + "A Major mode for editing xquery." + ) + + + +(defun xquery-set-indent-function () + "Set the indent function for xquery mode." + (setq nxml-prolog-end (point-min)) + (setq nxml-scan-end (copy-marker (point-min) nil)) + (set (make-local-variable 'indent-line-function) 'xquery-indent-line) + (make-local-variable 'forward-sexp-function) + (setq forward-sexp-function 'xquery-forward-sexp) + ;;(local-set-key "/" 'nxml-electric-slash) + ) + +(defun xquery-forward-sexp (&optional arg) + "Xquery forward s-expresssion. +This function is not very smart, it tries to use +`nxml-forward-balanced-item' if it sees '>' or '<' characters in +the direction you are going, and uses the regular `forward-sexp' +otherwise. " + (if (> arg 0) + (progn + (if (looking-at "[ \t]*<") + (nxml-forward-balanced-item arg) + (let ((forward-sexp-function nil)) (forward-sexp arg)))) + (if (looking-back ">[ \t]*") + (nxml-forward-balanced-item arg) + (let ((forward-sexp-function nil)) (forward-sexp arg)))) + ) + + +(defun xquery-set-up-syntax-table () + "Allow the hypen character to be recognized as part of a xquery symbol." + (modify-syntax-entry ?- "w" (syntax-table)) + (modify-syntax-entry ?/ "." (syntax-table)) + ;; set-up the syntax table correctly for parentheis type characters + (modify-syntax-entry ?\{ "(}" (syntax-table)) + (modify-syntax-entry ?\} "){" (syntax-table)) + (modify-syntax-entry ?\[ "(]" (syntax-table)) + (modify-syntax-entry ?\] ")]" (syntax-table)) + (modify-syntax-entry ?\( "()1" (syntax-table)) + (modify-syntax-entry ?\) ")(4" (syntax-table)) + ;;(modify-syntax-entry ?\< "(>" (syntax-table)) + ;;(modify-syntax-entry ?\> ")<" (syntax-table)) + ;; xquery comments are like (: :) -- handled above at mode decl + ;;(modify-syntax-entry ?\: ".23" (syntax-table)) + ) + + + +(defun xquery-indent-line () + "Indent current line as xquery code." + (interactive) + (let ((savep (> (current-column) (current-indentation))) + (indent (condition-case err (max (xquery-calculate-indentation) 0) + (error (message "%S" err))))) + (if savep + (save-excursion (indent-line-to indent)) + (indent-line-to indent)))) + +(defvar xquery-start-block-regexp "[ \t]*\\((\|{\\|for\\|let\\|where\\|return\\|if\\|else\\|typeswitch\\|declare[ \t]+function\\|.*[({]$\\)" + "A regular expression which indicates that a xquery block is starting.") + +(defvar xquery-flwr-block-regexp "[ \t]*\\(for\\|let\\|where\\|return\\|order\\|stable\\s *order\\)") + +(defvar xquery-indent-size 2 + "The size of each indent level.") + +(defvar xquery-indent-debug nil) + +(defun xquery-toggle-debug-indent () + "Toggle the debug flag used in `xquery-calculate-indentation'. " + (interactive) + (setq xquery-indent-debug (not xquery-indent-debug)) + (message (concat "xquery-indent-debug is " (if xquery-indent-debug "en" "dis") "abled")) + ) + +(defun xquery-calculate-indentation () + "Return the column to which the current line should be indented." + (beginning-of-line) + (if (bobp) + 0 ; First line is always non-indented + (skip-chars-forward " \t") + (cond + ;; do nothing if this is a comment + ((eq (get-text-property (point) 'face) 'font-lock-comment-face) (current-indentation)) + + ((looking-at "\\( pos (point-min)) + (save-excursion + (goto-char pos) + (backward-char 1) + (looking-at (concat "\\(?:" regexp +"\\)\\'")))) + (setq pos (1- pos))) + (save-excursion + (goto-char pos) + (looking-at (concat "\\(?:" regexp "\\)\\'"))))) + (not (null pos)))))) + +(defun xquery-previous-non-empty-line () + "Move to the last non-empty line." + (re-search-backward "\\S " (point-min) t) + ) + +(provide 'xquery-mode) + +;;; xquery-mode.el ends here