diff --git a/.gitignore b/.gitignore index df9101c40d..2d08f72d57 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ oddmuse/* image-dired/ elim/ elpa-to-submit/nxhtml/etc/schema/xhtml-loader.rnc~ -tramp \ No newline at end of file +tramp +\#* diff --git a/README.markdown b/README.markdown index 387bcad2c4..1482720767 100644 --- a/README.markdown +++ b/README.markdown @@ -19,16 +19,19 @@ screencast](http://peepcode.com/products/meet-emacs) helpful. The ## Installation -1. Install Emacs (at least version 22) +1. Install GNU Emacs (at least version 22, 23 is preferred) Use your package manager if you have one. Otherwise, Mac users should get it [from Apple](http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html). Windows users can get it [from GNU](http://ftp.gnu.org/gnu/emacs/windows/emacs-22.3-bin-i386.zip). -2. Move the directory containing this file to ~/.emacs.d [1] - (If you already have a directory at ~/.emacs.d move it out of the way and put this there instead.) +2. Move the directory containing this file to ~/.emacs.d + (If you already have a directory at ~/.emacs.d move it out of the + way and put this there instead.) 3. Launch Emacs! -If you are missing some autoloads after an update (should manifest -itself as "void function: foobar" errors) try M-x regen-autoloads. +If you find yourself missing some autoloads after an update (which +should manifest itself as "void function: foobar" errors) try M-x +regen-autoloads. After some updates an M-x recompile-init will be +necessary; this should be noted in the commit messages. If you want to keep your regular ~/.emacs.d in place and just launch a single instance using the starter kit, try the following invocation: @@ -86,6 +89,14 @@ packages. If you run into problems with such a package, try removing everything from inside the elpa/ directory and invoking M-x starter-kit-elpa-install in a fresh instance. +## Variants of Emacs + +The Starter Kit is designed to work with GNU Emacs version 22 or +greater. Using it with forks or other variants is not supported. It +probably won't work with XEmacs, though some have reported getting it +to work with Aquamacs. However, since Aquamacs is not portable, +it's difficult to test in it. + ## Contributing If you know your way around Emacs, please try out the starter kit as a diff --git a/TODO b/TODO index 709ada020b..0afd8d9764 100644 --- a/TODO +++ b/TODO @@ -2,15 +2,11 @@ TODO: Submit the packages in starter-kit-elpa.el to ELPA. -Greg Newman is working on Python helpers. - -maybe include: -* should yasnippet be included in rinari? - to write/finish: * submit ruby fixes to flymake which-func-mode in ruby? Bug fixes: -get jabber.el to automatically disconnect when suspending/hibernating (via dbus) \ No newline at end of file +get jabber.el to automatically disconnect when suspending/hibernating (via dbus) +same with rcirc.el \ No newline at end of file diff --git a/elpa-to-submit/cssh.el b/elpa-to-submit/cssh.el deleted file mode 100644 index 4fb01e4714..0000000000 --- a/elpa-to-submit/cssh.el +++ /dev/null @@ -1,428 +0,0 @@ -;;; cssh.el --- clusterssh implementation for emacs -;; -;; Copyright (C) 2008 Dimitri Fontaine -;; -;; Author: Dimitri Fontaine -;; URL: http://pgsql.tapoueh.org/elisp -;; Version: 0.1 -;; Created: 2008-09-26 -;; Keywords: ClusterSSH ssh cssh -;; -;; This file is NOT part of GNU Emacs. -;; -;; Emacs Integration: -;; (require 'cssh) -;; -;; cssh bindings to open ClusterSSH controler in cssh-mode on some buffers: -;; -;; C-= asks remote hostname then opens a term and ssh to it -;; C-= from IBuffer mode opens ClusterSSH controler on marked buffers -;; C-u C-= asks for the name of the ClusterSSH controler buffer -;; C-M-= matches given regexp against ssh known_hosts and open -;; buffers in which ssh is typed -;; C-u C-M-= asks for a name before -;; -;; -;; TODO -;; * add some more documentation -;; * implement a char mode where each key typed is directly sent -;; * implement a toggle to switch from and to char and line mode -;; - -(require 'pcmpl-ssh) -(require 'ibuffer) -(require 'term) - -(defgroup cssh nil "ClusterSSH mode customization group" - :group 'convenience) - -(defcustom split-horizontally-first t - "Do we first split horizontally or vertically" - :group 'cssh - :options '(t nil)) - -(defcustom cssh-prompt "cssh> " - "cssh buffer prompt" - :group 'cssh) - -(defcustom cssh-default-buffer-name "*cssh*" - "cssh default buffer name, the one in cssh major mode" - :group 'cssh) - -(defun turn-on-cssh-binding () - (local-set-key (kbd "C-=") 'cssh-interactive-start)) - -(add-hook 'ibuffer-mode-hook 'turn-on-cssh-binding) - -(global-set-key (kbd "C-M-=") 'cssh-regexp-host-start) - -(defun ssh-term-remote-open () - "Opens a M-x term and type in ssh remotehost with given hostname" - (interactive) - (let* - ((ssh-term-remote-host - (completing-read "Remote host: " (pcmpl-ssh-hosts))) - (ssh-command (concat "ssh " ssh-term-remote-host)) - (ssh-buffer-name (concat "*" ssh-command "*"))) - - (if (get-buffer ssh-buffer-name) - (switch-to-buffer ssh-buffer-name) - - (ansi-term "/bin/bash" ssh-command) - (set-buffer (get-buffer ssh-buffer-name)) - (insert (concat "TERM=screen " ssh-command)) - (term-send-input)))) - -(global-set-key (kbd "C-=") 'ssh-term-remote-open) - - -;;; -;;; open cssh windows and create buffers from a regexp -;;; the regexp matches host names as in pcmpl-ssh-hosts -;;; -(defun cssh-regexp-host-start (&optional cssh-buffer-name) - "start ClusterSSH for all mathing hosts in known_hosts" - (interactive - (list - (and current-prefix-arg - (read-buffer "ClusterSSH buffer name: " - (generate-new-buffer-name cssh-default-buffer-name))))) - (setq cssh-buffer-name - (or cssh-buffer-name cssh-default-buffer-name)) - - (let* ((re (read-from-minibuffer "Host regexp: ")) - (cssh-buffer-list '())) - - (dolist (elt (pcmpl-ssh-hosts) cssh-buffer-list) - (when (string-match re elt) - (let* ((buffer-ssh-command (concat "ssh " elt)) - (buffer-name (concat "*" buffer-ssh-command "*"))) - - (unless (get-buffer buffer-name) - (ansi-term "/bin/bash" buffer-ssh-command) - (with-current-buffer buffer-name - (insert (concat "TERM=screen " buffer-ssh-command)))) - - (add-to-list 'cssh-buffer-list (get-buffer buffer-name))))) - - (message "%S" cssh-buffer-list) - - (cssh-open cssh-buffer-name cssh-buffer-list) - (cssh-send-string ""))) - -;;; -;;; ibuffer interaction: open cssh mode for marked buffers -;;; -(defun cssh-interactive-start (&optional cssh-buffer-name) - "start ClusterSSH from current iBuffer marked buffers list" - (interactive - (list - (and current-prefix-arg - (read-buffer "ClusterSSH buffer name: " - (generate-new-buffer-name cssh-default-buffer-name))))) - (setq cssh-buffer-name - (or cssh-buffer-name cssh-default-buffer-name)) - - (cssh-init-from-ibuffer-marked-buffers cssh-buffer-name)) - -(defun cssh-init-from-ibuffer-marked-buffers (cssh-buffer-name) - "open cssh global input frame and the buffers windows from -marked ibuffers buffers" - (let* ((buffers-all-in-term-mode t) - (marked-buffers (ibuffer-get-marked-buffers))) - - (dolist (elt marked-buffers) - (progn - (message (buffer-name elt)) - ;;(select-window (get-buffer-window elt)) - (with-current-buffer elt - (when (not (eq major-mode 'term-mode)) - (progn - (setq buffers-all-in-term-mode nil) - (message "ClusterSSH only supports Term mode buffers")))))) - - (when buffers-all-in-term-mode - (cssh-open cssh-buffer-name marked-buffers)))) - -;;; -;;; Entry point -;;; -(defun cssh-open (cssh-buffer-name buffer-list) - "open the cssh global input frame then the ssh buffer windows" - - (cond ((endp buffer-list) - (ssh-term-remote-open)) - - ((eq 1 (length buffer-list)) - (set-window-buffer (selected-window) (car buffer-list))) - - (t - (set-window-buffer - (selected-window) (get-buffer-create cssh-buffer-name)) - - ;; make the controler buffer then split the window - (let* ((cssh-controler (split-window-vertically -4))) - ;; switch to css-mode, which make-local-variable cssh-buffer-list - ;; which we overwrite - (set-buffer cssh-buffer-name) - (cssh-mode) - (setq cssh-buffer-list buffer-list) - - ;; create the windows needed to host our buffer-list - (cssh-nsplit-window buffer-list) - - ;; now place the user into the cssh-controler and prompt him - (select-window cssh-controler) - (insert (concat "\n" cssh-prompt)) - - ;; return the buffer list - cssh-buffer-list)))) - -;;; -;;; cssh editing mode -;;; -(defvar cssh-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [up] 'cssh-send-up) - (define-key map [down] 'cssh-send-down) - (define-key map [tab] 'cssh-send-tab) - (define-key map (kbd "RET") 'cssh-send-input) - (define-key map (kbd "C-j") 'cssh-send-input) - (define-key map (kbd "C-m") 'cssh-send-input) - (define-key map (kbd "C-c") 'cssh-cancel-input) - (define-key map (kbd "C-l") 'cssh-clear) - (define-key map (kbd "C-d") 'cssh-eof) - (define-key map (kbd "C-=") 'cssh-reopen) - (define-key map (kbd "C-!") 'cssh-reconnect-ssh) - map) - "Keymap for `cssh-mode'.") - -;;;###autoload -(define-derived-mode cssh-mode fundamental-mode "ClusterSSH" - "A major mode for controlling multiple terms at once." - :group 'cssh - (make-local-variable 'cssh-buffer-list)) - -;; -;; Input functions -;; -(defun cssh-send-string (string) - "generic function to send input to the terms" - - (dolist (elt cssh-buffer-list) - ;; FIXME: get rid of artefacts elements in cssh-buffer-list - (when (bufferp elt) - (with-current-buffer elt - (insert string) - (term-send-input))))) - -(defun cssh-send-defun (term-fun) - "generic function to apply term function to the terms" - - (dolist (elt cssh-buffer-list) - ;; FIXME: get rid of artefacts elements in cssh-buffer-list - (when (bufferp elt) - (with-current-buffer elt - (funcall term-fun))))) - -(defun cssh-send-up () - (interactive) - (cssh-send-defun 'term-send-up)) - -(defun cssh-send-down () - (interactive) - (cssh-send-defun 'term-send-down)) - -(defun cssh-send-tab () - (interactive) - (cssh-send-string - (buffer-substring (+ (length cssh-prompt) (line-beginning-position)) - (line-end-position))) - (cssh-send-string "\C-i")) - -(defun cssh-cancel-input () - (interactive) - (cssh-send-string "\C-c") - (insert (concat "\n" cssh-prompt))) - -(defun cssh-send-input () - "send current line content to all cssh-mode buffers" - (interactive) - (cssh-send-string - (buffer-substring (+ (length cssh-prompt) (line-beginning-position)) - (line-end-position))) - (insert (concat "\n" cssh-prompt))) - -(defun cssh-clear () - (interactive) - (cssh-send-string "\C-l")) - -(defun cssh-eof () - (interactive) - (cssh-send-string "\C-d")) - -(defun cssh-reopen () - (interactive) - (cssh-open (buffer-name) cssh-buffer-list)) - -(defun cssh-reconnect-ssh (&optional clear) - (interactive "P") - (when (consp clear) (cssh-clear)) - - (dolist (elt cssh-buffer-list) - ;; FIXME: get rid of artefacts elements in cssh-buffer-list - (when (bufferp elt) - (let* ((elt-name (buffer-name elt)) - (buffer-ssh-command (substring elt-name 1 -1))) - (with-current-buffer elt - (insert (concat "TERM=screen " buffer-ssh-command)) - (term-send-input)))))) - -;;; -;;; Window splitting code -;;; -(defun cssh-split-window (&optional backward? &optional size) - "split current window either vertically or horizontally -depending on split-preference value" - (let* ((go-horizontal - (if backward? (not split-horizontally-first) - split-horizontally-first))) - - (if size - (if go-horizontal - (split-window-horizontally size) - (split-window-vertically size)) - - (if go-horizontal - (split-window-horizontally) - (split-window-vertically))))) - -(defun cssh-get-third-size (backward? left top right bottom) - "Given a window edges and a direction" - (let* ((go-horizontal - (if backward? (not split-horizontally-first) - split-horizontally-first))) - - (/ (+ 1 (if go-horizontal (- right left) (- bottom top))) 3))) - -(defun cssh-nsplit-window (buffer-list &optional backward?) - "split current window into n windows" - (let* ((w (selected-window)) - (n (length buffer-list))) - - (cond ((= n 2) - ;; if at least one of the list elements is a buffer, it's final - ;; recursion and we always prefer to maximize line length - (let* ((w1 (cssh-split-window (if (or (bufferp (car buffer-list)) - (bufferp (cadr buffer-list))) - ;; force to split horizontally first - split-horizontally-first - backward?)))) - - (when (bufferp (car buffer-list)) - (set-window-buffer w (car buffer-list))) - - (when (bufferp (cadr buffer-list)) - (set-window-buffer w1 (cadr buffer-list))) - - (list w w1))) - - ((= n 3) - ;; if at least one of the list elements is a buffer, it's final - ;; recursion and we always prefer to maximize line length - (let* ((edges (window-edges)) - (direction (if (or (bufferp (car buffer-list)) - (bufferp (cadr buffer-list)) - (bufferp (cadr (cdr buffer-list)))) - ;; force to split horizontally first - split-horizontally-first - backward?)) - (size (apply #'cssh-get-third-size - (cons direction edges))) - (w1 (cssh-split-window direction size)) - (w2 (progn (select-window w1) - (cssh-split-window direction size)))) - - (when (bufferp (car buffer-list)) - (set-window-buffer w (car buffer-list))) - - (when (bufferp (cadr buffer-list)) - (set-window-buffer w1 (cadr buffer-list))) - - (when (bufferp (cadr (cdr buffer-list))) - (set-window-buffer w2 (cadr (cdr buffer-list)))) - - (list w w1 w2))) - - ((= n 5) - ;; cut in half then split one half in 2 and the other in 3 - ;; cut in half then split other parts by n/2 - ;; gives cssh-nsplit-window any 2 elements list - (let* ((halves (cssh-nsplit-window '(1 2) backward?))) - - (select-window (nth 1 halves)) - - (let* ((h1l - (cssh-nsplit-window - (butlast buffer-list 3) (not backward?)))) - - (select-window w) - (append h1l - (cssh-nsplit-window - (last buffer-list 3) (not backward?)))))) - - ((= 0 (% n 2)) - ;; cut in half then split other parts by n/2 - ;; gives cssh-nsplit-window any 2 elements list - (let* ((halves (cssh-nsplit-window '(1 2) backward?))) - - (select-window (nth 1 halves)) - - (let* ((h1l - (cssh-nsplit-window - (butlast buffer-list (/ n 2)) (not backward?)))) - - (select-window w) - (append h1l - (cssh-nsplit-window - (last buffer-list (/ n 2)) (not backward?)))))) - - ((= 0 (% n 3)) - ;; cut in three parts then re split - (let* ((thirds (cssh-nsplit-window '(1 2 3) backward?))) - - (select-window (nth 1 thirds)) - - (let* ((t1l (cssh-nsplit-window - ;; take the first third of the list - (butlast (butlast buffer-list (/ n 3)) (/ n 3)) - (not backward?)))) - - (select-window (nth 2 thirds)) - - (let* ((t2l (cssh-nsplit-window - ;; take the second third of the list - (last (butlast buffer-list (/ n 3)) (/ n 3)) - (not backward?)))) - - (select-window w) - (append t1l - t2l - (cssh-nsplit-window - ;; take the last third of the list - (last buffer-list (/ n 3)) (not backward?))))))) - - ;; n is not divisible by either 2 or 3, produce some more windows - ;; than necessary - ((= 0 (% (+ 1 n) 2)) - (cssh-nsplit-window (cons 1 buffer-list))) - - ((= 0 (% (+ 1 n) 3)) - (cssh-nsplit-window (cons 1 buffer-list))) - - (t (message "error: number of windows not a multiple of 2 or 3.")) - ) - ) -) - -(provide 'cssh) diff --git a/elpa-to-submit/espresso.el b/elpa-to-submit/espresso.el index fb8addf651..34f84498db 100644 --- a/elpa-to-submit/espresso.el +++ b/elpa-to-submit/espresso.el @@ -4,8 +4,8 @@ ;; Author: Karl Landstrom ;; Author: Daniel Colascione ;; Maintainer: Daniel Colascione -;; Version: 8 -;; Date: 2009-05-22 +;; Version: 9 +;; Date: 2009-07-25 ;; Keywords: languages, oop, javascript ;; This file is free software; you can redistribute it and/or modify @@ -507,7 +507,7 @@ messages." (let ((keymap (make-sparse-keymap))) (mapc (lambda (key) (define-key keymap key #'espresso-insert-and-indent)) - '("+" "-" "/" "*" "{" "}" "(" ")" ":" ";" ",")) + '("+" "-" "*" "{" "}" "(" ")" ":" ";" ",")) (define-key keymap [(control ?c) (meta ?:)] #'espresso-js-eval) (define-key keymap [(control ?c) (control ?j)] #'espresso-set-js-context) (define-key keymap [(control meta ?x)] #'espresso-eval-defun) @@ -910,22 +910,37 @@ pitem of the function we went to the beginning of." (when pstate (goto-char (espresso--pitem-h-begin (car pstate)))))) -(defun espresso--beginning-of-defun () +(defun espresso--beginning-of-defun (&optional arg) "Used as beginning-of-defun-function" - ;; If we're just past the end of a function, the user probably wants - ;; to go to the beginning of *that* function - (when (eq (char-before) ?}) - (backward-char)) + (setq arg (or arg 1)) + (while (and (not (eobp)) (< arg 0)) + (incf arg) + (when (and (not espresso-flat-functions) + (or (eq (espresso-syntactic-context) 'function) + (espresso--function-prologue-beginning))) + (espresso--end-of-defun)) + + (if (espresso--re-search-forward + "\\_" nil t) + (goto-char (espresso--function-prologue-beginning)) + (goto-char (point-max)))) + + (while (> arg 0) + (decf arg) + ;; If we're just past the end of a function, the user probably wants + ;; to go to the beginning of *that* function + (when (eq (char-before) ?}) + (backward-char)) - (let ((prologue-begin (espresso--function-prologue-beginning))) - (cond ((and prologue-begin (< prologue-begin (point))) - (goto-char prologue-begin)) + (let ((prologue-begin (espresso--function-prologue-beginning))) + (cond ((and prologue-begin (< prologue-begin (point))) + (goto-char prologue-begin)) - (espresso-flat-functions - (espresso--beginning-of-defun-flat)) - (t - (espresso--beginning-of-defun-nested))))) + (espresso-flat-functions + (espresso--beginning-of-defun-flat)) + (t + (espresso--beginning-of-defun-nested)))))) (defun espresso--flush-caches (&optional beg ignored) "Flush syntax cache info after position BEG. BEG defaults to @@ -1213,6 +1228,7 @@ given item ends instead of parsing all the way to LIMIT." (defun espresso--end-of-defun-nested () "Internal helper for espresso--end-of-defun" + (message "test") (let* (pitem (this-end (save-excursion (and (setq pitem (espresso--beginning-of-defun-nested)) @@ -1236,26 +1252,37 @@ given item ends instead of parsing all the way to LIMIT." ;; ... or eob. (goto-char (point-max)))))) -(defun espresso--end-of-defun () +(defun espresso--end-of-defun (&optional arg) "Used as end-of-defun-function" - ;; look for function backward. if we're inside it, go to that - ;; function's end. otherwise, search for the next function's end and - ;; go there - (if espresso-flat-functions - (espresso--end-of-defun-flat) - - ;; if we're doing nested functions, see whether we're in the - ;; prologue. If we are, go to the end of the function; otherwise, - ;; call espresso--end-of-defun-nested to do the real work - (let ((prologue-begin (espresso--function-prologue-beginning))) - (cond ((and prologue-begin (<= prologue-begin (point))) - (goto-char prologue-begin) - (re-search-forward "\\_ arg 0) + (decf arg) + ;; look for function backward. if we're inside it, go to that + ;; function's end. otherwise, search for the next function's end and + ;; go there + (if espresso-flat-functions + (espresso--end-of-defun-flat) + + ;; if we're doing nested functions, see whether we're in the + ;; prologue. If we are, go to the end of the function; otherwise, + ;; call espresso--end-of-defun-nested to do the real work + (let ((prologue-begin (espresso--function-prologue-beginning))) + (cond ((and prologue-begin (<= prologue-begin (point))) + (goto-char prologue-begin) + (re-search-forward "\\_ ;; Keywords: hypermedia, extensions @@ -36,14 +36,17 @@ ;; the same manner. `M-x htmlize-many-files-dired' does the same for ;; files marked in a dired buffer. -;; htmlize supports two types of HTML output, selected by setting -;; `htmlize-output-type': `css' and `font'. In `css' mode, htmlize -;; uses cascading style sheets to specify colors; it generates classes -;; that correspond to Emacs faces and uses ... -;; to color parts of text. In this mode, the produced HTML is valid -;; under the 4.01 strict DTD, as confirmed by the W3C validator. In -;; `font' mode, htmlize uses ... to colorize -;; HTML, which is not standard-compliant, but works better in older +;; htmlize supports three types of HTML output, selected by setting +;; `htmlize-output-type': `css', `inline-css', and `font'. In `css' +;; mode, htmlize uses cascading style sheets to specify colors; it +;; generates classes that correspond to Emacs faces and uses ... to color parts of text. In this mode, the +;; produced HTML is valid under the 4.01 strict DTD, as confirmed by +;; the W3C validator. `inline-css' is like `css', except the CSS is +;; put directly in the STYLE attribute of the SPAN element, making it +;; possible to paste the generated HTML to other documents. In `font' +;; mode, htmlize uses ... to colorize HTML, +;; which is not standard-compliant, but works better in older ;; browsers. `css' mode is the default. ;; You can also use htmlize from your Emacs Lisp code. When called @@ -57,7 +60,7 @@ ;; fix it. I relied heavily on the presence of CL extensions, ;; especially for cross-emacs compatibility; please don't try to ;; remove that particular dependency. When byte-compiling under GNU -;; Emacs, you're likely to get lots of warnings; just ignore them. +;; Emacs, you're likely to get some warnings; just ignore them. ;; The latest version should be available at: ;; @@ -71,11 +74,12 @@ ;; Thanks go to the multitudes of people who have sent reports and ;; contributed comments, suggestions, and fixes. They include Ron ;; Gut, Bob Weiner, Toni Drabik, Peter Breton, Thomas Vogels, Juri -;; Linkov, and many others. +;; Linkov, Maciek Pasternacki, and many others. ;; User quotes: "You sir, are a sick, sick, _sick_ person. :)" ;; -- Bill Perry, author of Emacs/W3 + ;;; Code: (require 'cl) @@ -92,7 +96,7 @@ ;; `cl' is loaded. (load "cl-extra"))) -(defconst htmlize-version "1.30") +(defconst htmlize-version "1.36") ;; Incantations to make custom stuff work without customize, e.g. on ;; XEmacs 19.14 or GNU Emacs 19.34. @@ -121,18 +125,24 @@ :group 'htmlize) (defcustom htmlize-output-type 'css - "*Output type of generated HTML. Legal values are `css' and `font'. + "*Output type of generated HTML, one of `css', `inline-css', or `font'. When set to `css' (the default), htmlize will generate a style sheet with description of faces, and use it in the HTML document, specifying the faces in the actual text with . +When set to `inline-css', the style will be generated as above, but +placed directly in the STYLE attribute of the span ELEMENT: . This makes it easier to paste the resulting HTML to +other documents. + When set to `font', the properties will be set using layout tags , , , , and . `css' output is normally preferred, but `font' is still useful for -supporting old, pre-CSS browsers, or for easy embedding of colorized -text in foreign HTML documents (no style sheet to carry around)." - :type '(choice (const css) (const font)) +supporting old, pre-CSS browsers, and both `inline-css' and `font' for +easier embedding of colorized text in foreign HTML documents (no style +sheet to carry around)." + :type '(choice (const css) (const inline-css) (const font)) :group 'htmlize) (defcustom htmlize-generate-hyperlinks t @@ -160,11 +170,14 @@ do your own hyperlinkification from htmlize-after-hook.)" (defcustom htmlize-replace-form-feeds t "*Non-nil means replace form feeds in source code with HTML separators. -Form feeds are the ^L characters sometimes used to separate sections of -source code. If this variable is set to `t', form feed characters are -retained in HTML, but followed by the
separator. If this is a -string, it specifies the replacement string, the default being -\"\\^L\\n
\". +Form feeds are the ^L characters at line beginnings that are sometimes +used to separate sections of source code. If this variable is set to +`t', form feed characters are replaced with the
separator. If this +is a string, it specifies the replacement to use. Note that
 is
+temporarily closed before the separator is inserted, so the default
+replacement is effectively \"

\".  If you specify
+another replacement, don't forget to close and reopen the 
 if you
+want the output to remain valid HTML.
 
 If you need more elaborate processing, set this to nil and use
 htmlize-after-hook."
@@ -231,6 +244,16 @@ default setting; don't change it unless you know what you're doing."
   :type 'sexp
   :group 'htmlize)
 
+(defcustom htmlize-ignore-face-size 'absolute
+  "*Whether face size should be ignored when generating HTML.
+If this is nil, face sizes are used.  If set to t, sizes are ignored
+If set to `absolute', only absolute size specifications are ignored.
+Please note that font sizes only work with CSS-based output types."
+  :type '(choice (const :tag "Don't ignore" nil)
+		 (const :tag "Ignore all" t)
+		 (const :tag "Ignore absolute" absolute))
+  :group 'htmlize)
+
 (defcustom htmlize-css-name-prefix ""
   "*The prefix used for CSS names.
 The CSS names that htmlize generates from face names are often too
@@ -279,6 +302,8 @@ output.")
 
 (defvar htmlize-file-hook nil
   "Hook run by `htmlize-file' after htmlizing a file, but before saving it.")
+
+(defvar htmlize-buffer-places)
 
 ;;; Some cross-Emacs compatibility.
 
@@ -801,6 +826,7 @@ If no rgb.txt file is found, return nil."
 (defstruct htmlize-fstruct
   foreground				; foreground color, #rrggbb
   background				; background color, #rrggbb
+  size					; size
   boldp					; whether face is bold
   italicp				; whether face is italic
   underlinep				; whether face is underlined
@@ -816,6 +842,8 @@ If no rgb.txt file is found, return nil."
      (setf (htmlize-fstruct-foreground fstruct) (htmlize-color-to-rgb value)))
     (:background
      (setf (htmlize-fstruct-background fstruct) (htmlize-color-to-rgb value)))
+    (:height
+     (setf (htmlize-fstruct-size fstruct) value))
     (:weight
      (when (string-match (symbol-name value) "bold")
        (setf (htmlize-fstruct-boldp fstruct) t)))
@@ -833,6 +861,17 @@ If no rgb.txt file is found, return nil."
     (:strike-through
      (setf (htmlize-fstruct-strikep fstruct) value))))
 
+(defun htmlize-face-size (face)
+  ;; The size (height) of FACE, taking inheritance into account.
+  ;; Only works in Emacs 21 and later.
+  (let ((size-list
+	 (loop
+	  for f = face then (face-attribute f :inherit)
+	  until (or (not f) (eq f 'unspecified))
+	  for h = (face-attribute f :height)
+	  collect (if (eq h 'unspecified) nil h))))
+    (reduce 'htmlize-merge-size (cons nil size-list))))
+
 (defun htmlize-face-to-fstruct (face)
   "Convert Emacs face FACE to fstruct."
   (let ((fstruct (make-htmlize-fstruct
@@ -862,9 +901,19 @@ If no rgb.txt file is found, return nil."
 	     (let ((value (if (>= emacs-major-version 22)
 			      ;; Use the INHERIT arg in GNU Emacs 22.
 			      (face-attribute face attr nil t)
-			    (face-attribute face attr))))
+			    ;; Otherwise, fake it.
+			    (let ((face face))
+			      (while (and (eq (face-attribute face attr)
+					      'unspecified)
+					  (not (eq (face-attribute face :inherit)
+						   'unspecified)))
+				(setq face (face-attribute face :inherit)))
+			      (face-attribute face attr)))))
 	       (when (and value (not (eq value 'unspecified)))
-		 (htmlize-face-emacs21-attr fstruct attr value)))))
+		 (htmlize-face-emacs21-attr fstruct attr value))))
+	   (let ((size (htmlize-face-size face)))
+	     (unless (eql size 1.0) 	; ignore non-spec
+	       (setf (htmlize-fstruct-size fstruct) size))))
 	  (t
 	   ;; Older GNU Emacs.  Some of these functions are only
 	   ;; available under Emacs 20+, hence the guards.
@@ -901,6 +950,46 @@ If no rgb.txt file is found, return nil."
 	    name))
     fstruct))
 
+(defmacro htmlize-copy-attr-if-set (attr-list dest source)
+  ;; Expand the code of the type
+  ;; (and (htmlize-fstruct-ATTR source)
+  ;;      (setf (htmlize-fstruct-ATTR dest) (htmlize-fstruct-ATTR source)))
+  ;; for the given list of boolean attributes.
+  (cons 'progn
+	(loop for attr in attr-list
+	      for attr-sym = (intern (format "htmlize-fstruct-%s" attr))
+	      collect `(and (,attr-sym ,source)
+			    (setf (,attr-sym ,dest) (,attr-sym ,source))))))
+
+(defun htmlize-merge-size (merged next)
+  ;; Calculate the size of the merge of MERGED and NEXT.
+  (cond ((null merged)     next)
+	((integerp next)   next)
+	((null next)       merged)
+	((floatp merged)   (* merged next))
+	((integerp merged) (round (* merged next)))))
+
+(defun htmlize-merge-two-faces (merged next)
+  (htmlize-copy-attr-if-set
+   (foreground background boldp italicp underlinep overlinep strikep)
+   merged next)
+  (setf (htmlize-fstruct-size merged)
+	(htmlize-merge-size (htmlize-fstruct-size merged)
+			    (htmlize-fstruct-size next)))
+  merged)
+
+(defun htmlize-merge-faces (fstruct-list)
+  (cond ((null fstruct-list)
+	 ;; Nothing to do, return a dummy face.
+	 (make-htmlize-fstruct))
+	((null (cdr fstruct-list))
+	 ;; Optimize for the common case of a single face, simply
+	 ;; return it.
+	 (car fstruct-list))
+	(t
+	 (reduce #'htmlize-merge-two-faces
+		 (cons (make-htmlize-fstruct) fstruct-list)))))
+
 ;; GNU Emacs 20+ supports attribute lists in `face' properties.  For
 ;; example, you can use `(:foreground "red" :weight bold)' as an
 ;; overlay's "face", or you can even use a list of such lists, etc.
@@ -1139,13 +1228,63 @@ property and by buffer overlays that specify `face'."
   ;; Return METHOD's function definition for the current output type.
   ;; The returned object can be safely funcalled.
   (let ((sym (intern (format "htmlize-%s-%s" htmlize-output-type method))))
-    (indirect-function (if (fboundp sym) sym 'ignore))))
+    (indirect-function (if (fboundp sym)
+			   sym
+			 (let ((default (intern (concat "htmlize-default-"
+							(symbol-name method)))))
+			   (if (fboundp default)
+			       default
+			     'ignore))))))
+
+(defvar htmlize-memoization-table (make-hash-table :test 'equal))
+
+(defmacro htmlize-memoize (key generator)
+  "Return the value of GENERATOR, memoized as KEY.
+That means that GENERATOR will be evaluated and returned the first time
+it's called with the same value of KEY.  All other times, the cached
+\(memoized) value will be returned."
+  (let ((value (gensym)))
+    `(let ((,value (gethash ,key htmlize-memoization-table)))
+       (unless ,value
+	 (setq ,value ,generator)
+	 (setf (gethash ,key htmlize-memoization-table) ,value))
+       ,value)))
 
-;;; CSS based output support.
+;;; Default methods.
+
+(defun htmlize-default-doctype ()
+  nil					; no doc-string
+  ;; According to DTDs published by the W3C, it is illegal to embed
+  ;;  in 
.  This makes sense in general, but is bad for
+  ;; htmlize's intended usage of  to specify the document color.
+
+  ;; To make generated HTML legal, htmlize's `font' mode used to
+  ;; specify the SGML declaration of "HTML Pro" DTD here.  HTML Pro
+  ;; aka Silmaril DTD was a project whose goal was to produce a GPL'ed
+  ;; DTD that would encompass all the incompatible HTML extensions
+  ;; procured by Netscape, MSIE, and other players in the field.
+  ;; Apparently the project got abandoned, the last available version
+  ;; being "Draft 0 Revision 11" from January 1997, as documented at
+  ;; .
+
+  ;; Since by now HTML Pro is remembered by none but the most die-hard
+  ;; early-web-days nostalgics and used by not even them, there is no
+  ;; use in specifying it.  So we return the standard HTML 4.0
+  ;; declaration, which makes generated HTML technically illegal.  If
+  ;; you have a problem with that, use the `css' engine designed to
+  ;; create fully conforming HTML.
+
+  ""
+
+  ;; Now-abandoned HTML Pro declaration.
+  ;""
+  )
 
-(defun htmlize-css-doctype ()
+(defun htmlize-default-body-tag (face-map)
   nil					; no doc-string
-  "")
+  "")
+
+;;; CSS based output support.
 
 ;; Internal function; not a method.
 (defun htmlize-css-specs (fstruct)
@@ -1157,6 +1296,12 @@ property and by buffer overlays that specify `face'."
       (push (format "background-color: %s;"
 		    (htmlize-fstruct-background fstruct))
 	    result))
+    (let ((size (htmlize-fstruct-size fstruct)))
+      (when (and size (not (eq htmlize-ignore-face-size t)))
+	(cond ((floatp size)
+	       (push (format "font-size: %d%%;" (* 100 size)) result))
+	      ((not (eq htmlize-ignore-face-size 'absolute))
+	       (push (format "font-size: %spt;" (/ size 10.0)) result)))))
     (when (htmlize-fstruct-boldp fstruct)
       (push "font-weight: bold;" result))
     (when (htmlize-fstruct-italicp fstruct)
@@ -1215,77 +1360,59 @@ property and by buffer overlays that specify `face'."
     (ignore fstruct)			; shut up the byte-compiler
     (princ "" buffer)))
 
+;; `inline-css' output support.
+
+(defun htmlize-inline-css-body-tag (face-map)
+  (format ""
+	  (mapconcat #'identity (htmlize-css-specs (gethash 'default face-map))
+		     " ")))
+
+(defun htmlize-inline-css-insert-text (text fstruct-list buffer)
+  (let* ((merged (htmlize-merge-faces fstruct-list))
+	 (style (htmlize-memoize
+		 merged
+		 (let ((specs (htmlize-css-specs merged)))
+		   (and specs
+			(mapconcat #'identity (htmlize-css-specs merged) " "))))))
+    (when style
+      (princ "" buffer))
+    (princ text buffer)
+    (when style
+      (princ "" buffer))))
+
 ;;; `font' tag based output support.
 
-(defun htmlize-font-doctype ()
-  nil					; no doc-string
-
-  ;; According to DTDs published by the W3C, it is illegal to embed
-  ;;  in 
.  This makes sense in general, but is bad for
-  ;; htmlize's intended usage of  to specify the document color.
-
-  ;; To make generated HTML legal, htmlize.el used to specify the SGML
-  ;; declaration of "HTML Pro" DTD here.  HTML Pro aka Silmaril DTD
-  ;; was a project whose goal was to produce a GPL'ed DTD that would
-  ;; encompass all the incompatible HTML extensions procured by
-  ;; Netscape, MSIE, and other players in the field.  Apparently the
-  ;; project got abandoned, the last available version being "Draft 0
-  ;; Revision 11" from January 1997, as documented at
-  ;; .
-
-  ;; Since by now (2005) HTML Pro is remembered by none but the most
-  ;; die-hard early-web-days nostalgics and used by not even them,
-  ;; there is no use in specifying it.  So we return the standard HTML
-  ;; 4.0 declaration, which makes generated HTML technically illegal.
-  ;; If you have a problem with that, use the `css' generation engine
-  ;; which I believe creates fully conforming HTML.
-
-  ""
-
-  ;; Now-abandoned HTML Pro declaration.
-  ;""
-  )
-
 (defun htmlize-font-body-tag (face-map)
   (let ((fstruct (gethash 'default face-map)))
     (format ""
 	    (htmlize-fstruct-foreground fstruct)
 	    (htmlize-fstruct-background fstruct))))
-
+       
 (defun htmlize-font-insert-text (text fstruct-list buffer)
   ;; In `font' mode, we use the traditional HTML means of altering
   ;; presentation:  tag for colors,  for bold,  for
   ;; underline, and  for strike-through.
-  (let (bold italic underline strike fg)
-    ;; Merge the face attributes.
-    (dolist (fstruct fstruct-list)
-      ;; A non-null boolean attribute in any face sets the attribute.
-      (and (htmlize-fstruct-boldp fstruct)      (setq bold t))
-      (and (htmlize-fstruct-italicp fstruct)    (setq italic t))
-      (and (htmlize-fstruct-underlinep fstruct) (setq underline t))
-      (and (htmlize-fstruct-strikep fstruct)    (setq strike t))
-      ;; The foreground/background of the last face in the list wins.
-      (and (htmlize-fstruct-foreground fstruct)
-	   (setq fg (htmlize-fstruct-foreground fstruct))))
-
-    ;; Generate the markup that reflects the merged attributes.
-    (princ (concat
-	    (and fg        (format "" fg))
-	    (and bold      "")
-	    (and italic    "")
-	    (and underline "")
-	    (and strike    ""))
-	   buffer)
-    ;; Print the text.
+  (let* ((merged (htmlize-merge-faces fstruct-list))
+	 (markup (htmlize-memoize
+		  merged
+		  (cons (concat
+			 (and (htmlize-fstruct-foreground merged)
+			      (format "" (htmlize-fstruct-foreground merged)))
+			 (and (htmlize-fstruct-boldp merged)      "")
+			 (and (htmlize-fstruct-italicp merged)    "")
+			 (and (htmlize-fstruct-underlinep merged) "")
+			 (and (htmlize-fstruct-strikep merged)    ""))
+			(concat
+			 (and (htmlize-fstruct-strikep merged)    "")
+			 (and (htmlize-fstruct-underlinep merged) "")
+			 (and (htmlize-fstruct-italicp merged)    "")
+			 (and (htmlize-fstruct-boldp merged)      "")
+			 (and (htmlize-fstruct-foreground merged) ""))))))
+    (princ (car markup) buffer)
     (princ text buffer)
-    ;; Close the tags we've opened.
-    (princ (concat
-	    (and strike    "")
-	    (and underline "")
-	    (and italic    "")
-	    (and bold      "")
-	    (and fg        ""))
-	   buffer)))
+    (princ (cdr markup) buffer)))
 
 (defun htmlize-buffer-1 ()
   ;; Internal function; don't call it from outside this file.  Htmlize
@@ -1300,6 +1427,7 @@ property and by buffer overlays that specify `face'."
     ;; in advance.
     (htmlize-ensure-fontified)
     (clrhash htmlize-extended-character-cache)
+    (clrhash htmlize-memoization-table)
     (let* ((buffer-faces (htmlize-faces-in-buffer))
 	   (face-map (htmlize-make-face-map (adjoin 'default buffer-faces)))
 	   ;; Generate the new buffer.  It's important that it inherits
@@ -1309,6 +1437,9 @@ property and by buffer overlays that specify `face'."
 					      (file-name-nondirectory
 					       (buffer-file-name)))
 					   "*html*")))
+	   ;; Having a dummy value in the plist allows writing simply
+	   ;; (plist-put places foo bar).
+	   (places '(nil nil))
 	   (title (if (buffer-file-name)
 		      (file-name-nondirectory (buffer-file-name))
 		    (buffer-name))))
@@ -1318,7 +1449,9 @@ property and by buffer overlays that specify `face'."
 	(insert (htmlize-method doctype) ?\n
 		(format "\n"
 			htmlize-version htmlize-output-type)
-		"\n  \n"
+		"\n  ")
+	(plist-put places 'head-start (point-marker))
+	(insert "\n"
 		"    " (htmlize-protect-string title) "\n"
 		(if htmlize-html-charset
 		    (format (concat "    "
-		"\n  "
-		(or (htmlize-method body-tag face-map)
-		    "")
-		"\n    
\n"))
+	(insert "  ")
+	(plist-put places 'head-end (point-marker))
+	(insert "\n  ")
+	(plist-put places 'body-start (point-marker))
+	(insert (htmlize-method body-tag face-map)
+		"\n    ")
+	(plist-put places 'content-start (point-marker))
+	(insert "
\n"))
       (let ((insert-text-method
 	     ;; Get the inserter method, so we can funcall it inside
 	     ;; the loop.  Not calling `htmlize-method' in the loop
@@ -1379,20 +1515,24 @@ property and by buffer overlays that specify `face'."
 
       ;; Insert the epilog and post-process the buffer.
       (with-current-buffer htmlbuf
-	(insert "
\n \n\n") + (insert "
") + (plist-put places 'content-end (point-marker)) + (insert "\n ") + (plist-put places 'body-end (point-marker)) + (insert "\n\n") (when htmlize-generate-hyperlinks (htmlize-make-hyperlinks)) (htmlize-defang-local-variables) (when htmlize-replace-form-feeds - ;; Change each "^L\n" to "^L\n
". + ;; Change each "\n^L" to "
". (goto-char (point-min)) (let ((source ;; ^L has already been escaped, so search for that. - (htmlize-protect-string "\^L\n")) + (htmlize-protect-string "\n\^L")) (replacement (if (stringp htmlize-replace-form-feeds) htmlize-replace-form-feeds - "\^L\n
"))) + "

")))
 	    (while (search-forward source nil t)
 	      (replace-match replacement t t))))
 	(goto-char (point-min))
@@ -1400,6 +1540,7 @@ property and by buffer overlays that specify `face'."
 	  ;; What sucks about this is that the minor modes, most notably
 	  ;; font-lock-mode, won't be initialized.  Oh well.
 	  (funcall htmlize-html-major-mode))
+	(set (make-local-variable 'htmlize-buffer-places) places)
 	(run-hooks 'htmlize-after-hook)
 	(buffer-enable-undo))
       htmlbuf)))
@@ -1484,6 +1625,19 @@ See `htmlize-buffer' for details."
       (switch-to-buffer htmlbuf))
     htmlbuf))
 
+(defun htmlize-region-for-paste (beg end)
+  "Htmlize the region and return just the HTML as a string.
+This forces the `inline-css' style and only returns the HTML body,
+but without the BODY tag.  This should make it useful for inserting
+the text to another HTML buffer."
+  (let* ((htmlize-output-type 'inline-css)
+	 (htmlbuf (htmlize-region beg end)))
+    (unwind-protect
+	(with-current-buffer htmlbuf
+	  (buffer-substring (plist-get htmlize-buffer-places 'content-start)
+			    (plist-get htmlize-buffer-places 'content-end)))
+      (kill-buffer htmlbuf))))
+
 (defun htmlize-make-file-name (file)
   "Make an HTML file name from FILE.
 
diff --git a/elpa-to-submit/nxhtml/related/javascript-mozlab.el b/elpa-to-submit/nxhtml/alts/javascript-mozlab.el
similarity index 100%
rename from elpa-to-submit/nxhtml/related/javascript-mozlab.el
rename to elpa-to-submit/nxhtml/alts/javascript-mozlab.el
diff --git a/elpa-to-submit/nxhtml/related/js2-font-lock-new.el b/elpa-to-submit/nxhtml/alts/js2-font-lock-new.el
similarity index 100%
rename from elpa-to-submit/nxhtml/related/js2-font-lock-new.el
rename to elpa-to-submit/nxhtml/alts/js2-font-lock-new.el
diff --git a/elpa-to-submit/nxhtml/related/js2-font-lock.el b/elpa-to-submit/nxhtml/alts/js2-font-lock.el
similarity index 100%
rename from elpa-to-submit/nxhtml/related/js2-font-lock.el
rename to elpa-to-submit/nxhtml/alts/js2-font-lock.el
diff --git a/elpa-to-submit/nxhtml/related/js2-mumamo.el b/elpa-to-submit/nxhtml/alts/js2-mumamo.el
similarity index 100%
rename from elpa-to-submit/nxhtml/related/js2-mumamo.el
rename to elpa-to-submit/nxhtml/alts/js2-mumamo.el
diff --git a/elpa-to-submit/nxhtml/related/js2-new.el b/elpa-to-submit/nxhtml/alts/js2-new.el
similarity index 100%
rename from elpa-to-submit/nxhtml/related/js2-new.el
rename to elpa-to-submit/nxhtml/alts/js2-new.el
diff --git a/elpa-to-submit/nxhtml/alts/php-mode-1.5.0.el b/elpa-to-submit/nxhtml/alts/php-mode-1.5.0.el
new file mode 100644
index 0000000000..e5de2d7e4e
--- /dev/null
+++ b/elpa-to-submit/nxhtml/alts/php-mode-1.5.0.el
@@ -0,0 +1,319 @@
+
+
+
+
+
+
+
+
+
+
+
+
+SourceForge.net Repository - [php-mode] Index of /
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/elpa-to-submit/nxhtml/alts/php-mode-2008-10-23.el b/elpa-to-submit/nxhtml/alts/php-mode-2008-10-23.el
new file mode 100644
index 0000000000..c0be94969d
--- /dev/null
+++ b/elpa-to-submit/nxhtml/alts/php-mode-2008-10-23.el
@@ -0,0 +1,1118 @@
+;;; php-mode.el --- major mode for editing PHP code
+
+;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad
+;;               2008 Aaron S. Hawley
+
+;; Maintainer: Aaron S. Hawley 
+;; Author: Turadg Aleahmad, 1999-2004
+;; Keywords: php languages oop
+;; Created: 1999-05-17
+;; Modified: 2008-10-20
+;; X-URL:   http://php-mode.sourceforge.net/
+
+(defconst php-mode-version-number "1.4.1-alpha"
+  "PHP Mode version number.")
+
+;;; License
+
+;; 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 3
+;; of the License, 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 this file; if not, write to the Free Software
+;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Usage
+
+;; Put this file in your Emacs lisp path (eg. site-lisp) and add to
+;; your .emacs file:
+;;
+;;   (require 'php-mode)
+
+;; To use abbrev-mode, add lines like this:
+;;   (add-hook 'php-mode-hook
+;;     '(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends")))
+
+;; To make php-mode compatible with html-mode, see http://php-mode.sf.net
+
+;; Many options available under Help:Customize
+;; Options specific to php-mode are in
+;;  Programming/Languages/Php
+;; Since it inherits much functionality from c-mode, look there too
+;;  Programming/Languages/C
+
+;;; Commentary:
+
+;; PHP mode is a major mode for editing PHP 3 and 4 source code.  It's
+;; an extension of C mode; thus it inherits all C mode's navigation
+;; functionality.  But it colors according to the PHP grammar and indents
+;; according to the PEAR coding guidelines.  It also includes a couple
+;; handy IDE-type features such as documentation search and a source
+;; and class browser.
+
+
+;;; Contributors: (in chronological order)
+
+;; Juanjo, Torsten Martinsen, Vinai Kopp, Sean Champ, Doug Marcey,
+;; Kevin Blake, Rex McMaster, Mathias Meyer, Boris Folgmann, Roland
+;; Rosenfeld, Fred Yankowski, Craig Andrews, John Keller, Ryan
+;; Sammartino, ppercot, Valentin Funk, Stig Bakken, Gregory Stark,
+;; Chris Morris, Nils Rennebarth, Gerrit Riessen, Eric Mc Sween,
+;; Ville Skytta, Giacomo Tesio, Lennart Borgman, Stefan Monnier,
+;; Aaron S. Hawley, Ian Eure, Bill Lovett, Dias Badekas
+
+;;; Changelog:
+
+;; 1.4
+;;   Updated GNU GPL to version 3.  Ported to Emacs 22 (CC mode
+;;   5.31). M-x php-mode-version shows version.  Provide end-of-defun
+;;   beginning-of-defun functionality. Support add-log library.
+;;   Fix __CLASS__ constant (Ian Eure).  Allow imenu to see visibility
+;;   declarations -- "private", "public", "protected". (Bill Lovett)
+;;
+;; 1.3
+;;   Changed the definition of # using a tip from Stefan
+;;   Monnier to correct highlighting and indentation. (Lennart Borgman)
+;;   Changed the highlighting of the HTML part. (Lennart Borgman)
+;;
+;; 1.2
+;;   Implemented php-show-arglist, C-. (Engelke Eschner)
+;;   Implemented php-complete-function, M-tab (Engelke Eschner)
+;;   Re-enabled # comment detection in GNU Emacs (Urban Müller)
+;;   Fixed some keybindings and default settings (Engelke Eschner)
+;;
+;; 1.1
+;;   Added PHP5 support (Giacomo Tesio)
+;;     known problem: doesn't highlight after first 'implements'
+;;   Better XEmacs compatibility (imenu, regexp, and comments!) (Ville Skytta)
+;;   Improvement to php-conditional-key regexp (Eric Mc Sween)
+
+;; 1.05
+;;   Incorporated speedbar defs by Gerrit Riessen
+;;   Add "foreach" to conditional introducing keywords (Nils Rennebarth)
+;;   Cleared the Changelog
+;;   Moved contribution credits into comments above
+
+
+;;; Code:
+
+(require 'speedbar)
+(require 'font-lock)
+(require 'cc-mode)
+(require 'custom)
+(require 'etags)
+(eval-when-compile
+  (require 'regexp-opt))
+
+;; Local variables
+(defgroup php nil
+  "Major mode `php-mode' for editing PHP code."
+  :prefix "php-"
+  :group 'languages)
+
+(defcustom php-default-face 'default
+  "Default face in `php-mode' buffers."
+  :type 'face
+  :group 'php)
+
+(defcustom php-speedbar-config t
+  "When set to true automatically configures Speedbar to observe PHP files.
+Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s34]?\\)\""
+  :type 'boolean
+  :set (lambda (sym val)
+         (set-default sym val)
+         (if (and val (boundp 'speedbar))
+             (speedbar-add-supported-extension
+	      "\\.\\(inc\\|php[s34]?\\|phtml\\)")))
+  :group 'php)
+
+(defcustom php-mode-speedbar-open nil
+  "Normally `php-mode' starts with the speedbar closed.
+Turning this on will open it whenever `php-mode' is loaded."
+  :type 'boolean
+  :set (lambda (sym val)
+         (set-default sym val)
+         (when val
+             (speedbar 1)))
+  :group 'php)
+
+(defvar php-imenu-generic-expression
+ '(
+   ("All Functions"
+    "^\\s-*\\(?:\\(?:abstract\\|final\\|private\\|protected\\|public\\|static\\)\\s-+\\)*function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1)
+   ("Classes"
+    "^\\s-*class\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*" 1)
+   ("Public Methods"
+    "^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?public\\s-+\\(?:static\\s-+\\)?function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1)
+   ("Protected Methods"
+    "^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?protected\\s-+\\(?:static\\s-+\\)?function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1)
+   ("Private Methods"
+    "^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?private\\s-+\\(?:static\\s-+\\)?function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1)
+   )
+ "Imenu generic expression for PHP Mode. See `imenu-generic-expression'."
+ )
+
+(defcustom php-manual-url "http://www.php.net/manual/en/"
+  "URL at which to find PHP manual.
+You can replace \"en\" with your ISO language code."
+  :type 'string
+  :group 'php)
+
+(defcustom php-search-url "http://www.php.net/"
+  "URL at which to search for documentation on a word"
+  :type 'string
+  :group 'php)
+
+(defcustom php-completion-file ""
+  "Path to the file which contains the function names known to PHP"
+  :type 'string
+  :group 'php)
+
+(defcustom php-manual-path ""
+  "Path to the directory which contains the PHP manual"
+  :type 'string
+  :group 'php)
+
+;;;###NOautoload
+(defcustom php-file-patterns '("\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'")
+  "List of file patterns for which to automatically invoke `php-mode'."
+  :type '(repeat (regexp :tag "Pattern"))
+  :set (lambda (sym val)
+         (set-default sym val)
+         (let ((php-file-patterns-temp val))
+           (while php-file-patterns-temp
+             (add-to-list 'auto-mode-alist
+                          (cons (car php-file-patterns-temp) 'php-mode))
+             (setq php-file-patterns-temp (cdr php-file-patterns-temp)))))
+  :group 'php)
+
+(defcustom php-mode-hook nil
+  "List of functions to be executed on entry to `php-mode'."
+  :type 'hook
+  :group 'php)
+
+(defcustom php-mode-pear-hook nil
+  "Hook called when a PHP PEAR file is opened with `php-mode'."
+  :type 'hook
+  :group 'php)
+
+(defcustom php-mode-force-pear nil
+  "Normally PEAR coding rules are enforced only when the filename contains \"PEAR\"
+Turning this on will force PEAR rules on all PHP files."
+  :type 'boolean
+  :group 'php)
+
+(defconst php-mode-modified "2008-10-20"
+  "PHP Mode build date.")
+
+(defun php-mode-version ()
+  "Display string describing the version of PHP mode"
+  (interactive)
+  (message "PHP mode %s of %s"
+	   php-mode-version-number php-mode-modified))
+
+(defconst php-beginning-of-defun-regexp
+  "^\\s-*\\(?:\\(?:abstract\\|final\\|private\\|protected\\|public\\|static\\)\\s-+\\)*function\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*("
+  "Regular expression for a PHP function.")
+
+(defun php-beginning-of-defun (&optional arg)
+  "Move to the beginning of the ARGth PHP function from point.
+Implements PHP version of `beginning-of-defun-function'."
+  (interactive "p")
+  (let ((arg (or arg 1)))
+    (while (> arg 0)
+      (re-search-backward php-beginning-of-defun-regexp
+			  nil 'noerror)
+      (setq arg (1- arg)))
+    (while (< arg 0)
+      (end-of-line 1)
+      (let ((opoint (point)))
+	(beginning-of-defun 1)
+	(forward-list 2)
+	(forward-line 1)
+	(if (eq opoint (point))
+	    (re-search-forward php-beginning-of-defun-regexp
+			       nil 'noerror))
+	(setq arg (1+ arg))))))
+
+(defun php-end-of-defun (&optional arg)
+  "Move the end of the ARGth PHP function from point.
+Implements PHP befsion of `end-of-defun-function'
+
+See `php-beginning-of-defun'."
+  (interactive "p")
+  (php-beginning-of-defun (- (or arg 1))))
+
+
+(defvar php-completion-table nil
+  "Obarray of tag names defined in current tags table and functions know to PHP.")
+
+(defvar php-warned-bad-indent nil)
+(make-variable-buffer-local 'php-warned-bad-indent)
+
+;; Do it but tell it is not good if html tags in buffer.
+(defun php-check-html-for-indentation ()
+  (let ((html-tag-re "^\\s-*")
+        (here (point)))
+    (if (not (or (re-search-forward html-tag-re (line-end-position) t)
+                 (re-search-backward html-tag-re (line-beginning-position) t)))
+        t
+      (goto-char here)
+      (setq php-warned-bad-indent t)
+      (lwarn 'php-indent :warning
+	     "\n\t%s\n\t%s\n\t%s\n"
+	     "Indentation fails badly with mixed HTML and PHP."
+	     "Look for an Emacs Lisp library that supports \"multiple"
+	     "major modes\" like mumamo, mmm-mode or multi-mode.")
+      nil)))
+
+(defun php-cautious-indent-region (start end &optional quiet)
+  (if (or php-warned-bad-indent
+          (php-check-html-for-indentation))
+      (funcall 'c-indent-region start end quiet)))
+
+(defun php-cautious-indent-line ()
+  (if (or php-warned-bad-indent
+          (php-check-html-for-indentation))
+      (funcall 'c-indent-line)))
+
+(defconst php-tags '("" "[^_]?")
+    '(1 font-lock-constant-face))
+
+   ;; Fontify keywords
+   (cons
+    (concat "[^_$]?\\<\\(" php-keywords "\\)\\>[^_]?")
+    '(1 font-lock-keyword-face))
+
+   ;; Fontify keywords and targets, and case default tags.
+   (list "[^_$]?\\<\\(break\\|case\\|continue\\)\\>\\s-*\\(-?\\(?:\\sw\\|\\s_\\)+\\)?"
+	 '(1 font-lock-keyword-face) '(2 font-lock-constant-face t t))
+   ;; This must come after the one for keywords and targets.
+   '(":" ("^\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*:\\s-*$"
+	  (beginning-of-line) (end-of-line)
+	  (1 font-lock-constant-face)))
+
+   ;; treat 'print' as keyword only when not used like a function name
+   '("\\[^_]?" (1 font-lock-keyword-face))
+
+   ;; Fontify PHP tag
+   (cons php-tags-key font-lock-preprocessor-face)
+
+   ;; Fontify ASP-style tag
+   '("<\\%\\(=\\)?" . font-lock-preprocessor-face)
+   '("\\%>" . font-lock-preprocessor-face)
+
+   )
+  "Subdued level highlighting for PHP mode.")
+
+(defconst php-font-lock-keywords-2
+  (append
+   php-font-lock-keywords-1
+   (list
+
+    ;; class declaration
+    '("[^_]?\\<\\(class\\|interface\\)\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
+      (1 font-lock-keyword-face) (2 font-lock-type-face nil t))
+    ;; handle several words specially, to include following word,
+    ;; thereby excluding it from unknown-symbol checks later
+    ;; FIX to handle implementing multiple
+    ;; currently breaks on "class Foo implements Bar, Baz"
+    '("\\<\\(new\\|extends\\|implements\\)\\s-+\\$?\\(\\(?:\\sw\\|\\s_\\)+\\)"
+      (1 font-lock-keyword-face) (2 font-lock-type-face))
+
+    ;; function declaration
+    '("\\<\\(function\\)\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*("
+      (1 font-lock-keyword-face)
+      (2 font-lock-function-name-face nil t))
+
+    ;; class hierarchy
+    '("[^_$]?\\<\\(self\\|parent\\)\\>[^_]?" (1 font-lock-constant-face nil nil))
+
+    ;; method and variable features
+    '("\\<\\(private\\|protected\\|public\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
+      (1 font-lock-keyword-face))
+
+    ;; method features
+    '("^\\s-*\\(abstract\\|static\\|final\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
+      (1 font-lock-keyword-face))
+
+    ;; variable features
+    '("^\\s-*\\(static\\|const\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
+      (1 font-lock-keyword-face))
+    ))
+  "Medium level highlighting for PHP mode.")
+
+(defconst php-font-lock-keywords-3
+  (append
+   php-font-lock-keywords-2
+   (list
+
+    ;;  or  for HTML
+    ;;'(" ]*>" . font-lock-constant-face)
+    ;;'("]*" . font-lock-constant-face)
+    ;;'("
+    '("<[^>]*\\(>\\)" (1 font-lock-constant-face))
+
+    ;; HTML tags
+    '("\\(<[a-z]+\\)[[:space:]]+\\([a-z:]+=\\)[^>]*?" (1 font-lock-constant-face) (2 font-lock-constant-face) )
+    '("\"[[:space:]]+\\([a-z:]+=\\)" (1 font-lock-constant-face))
+
+    ;; HTML entities
+    ;;'("&\\w+;" . font-lock-variable-name-face)
+
+    ;; warn about '$' immediately after ->
+    '("\\$\\(?:\\sw\\|\\s_\\)+->\\s-*\\(\\$\\)\\(\\(?:\\sw\\|\\s_\\)+\\)"
+      (1 font-lock-warning-face) (2 php-default-face))
+
+    ;; warn about $word.word -- it could be a valid concatenation,
+    ;; but without any spaces we'll assume $word->word was meant.
+    '("\\$\\(?:\\sw\\|\\s_\\)+\\(\\.\\)\\sw"
+      1 font-lock-warning-face)
+
+    ;; Warn about ==> instead of =>
+    '("==+>" . font-lock-warning-face)
+
+    ;; exclude casts from bare-word treatment (may contain spaces)
+    `(,(concat "(\\s-*\\(" php-types "\\)\\s-*)")
+      1 font-lock-type-face)
+
+    ;; PHP5: function declarations may contain classes as parameters type
+    `(,(concat "[(,]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-+&?\\$\\(?:\\sw\\|\\s_\\)+\\>")
+      1 font-lock-type-face)
+
+    ;; Fontify variables and function calls
+    '("\\$\\(this\\|that\\)\\W" (1 font-lock-constant-face nil nil))
+    `(,(concat "\\$\\(" php-superglobals "\\)\\W")
+      (1 font-lock-constant-face nil nil)) ; $_GET & co
+    '("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face)) ; $variable
+    '("->\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face t t)) ; ->variable
+    '("->\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" . (1 php-default-face t t)) ; ->function_call
+    '("\\(\\(?:\\sw\\|\\s_\\)+\\)::\\(?:\\sw\\|\\s_\\)+\\s-*(?" . (1 font-lock-type-face)) ; class::member
+    '("::\\(\\(?:\\sw\\|\\s_\\)+\\>[^(]\\)" . (1 php-default-face)) ; class::constant
+    '("\\<\\(?:\\sw\\|\\s_\\)+\\s-*[[(]" . php-default-face)	; word( or word[
+    '("\\<[0-9]+" . php-default-face)		; number (also matches word)
+
+    ;; Warn on any words not already fontified
+    '("\\<\\(?:\\sw\\|\\s_\\)+\\>" . font-lock-warning-face)
+
+    ))
+  "Gauchy level highlighting for PHP mode.")
+
+;; Create "php-default-face" symbol for GNU Emacs so that both XEmacs
+;; and GNU emacs can refer to the default face.
+(unless (boundp 'php-default-face)
+   (defvar php-default-face 'php-default-face))
+
+;; Create faces for XEmacs
+(when (featurep 'xemacs)
+  (unless (boundp 'font-lock-keyword-face)
+    (copy-face 'bold 'font-lock-keyword-face))
+  (unless (boundp 'font-lock-constant-face)
+    (copy-face 'font-lock-keyword-face 'font-lock-constant-face)))
+
+(provide 'php-mode)
+
+;;; php-mode.el ends here
diff --git a/elpa-to-submit/nxhtml/related/smarty-mode-vdebout.el b/elpa-to-submit/nxhtml/alts/smarty-mode-vdebout.el
similarity index 100%
rename from elpa-to-submit/nxhtml/related/smarty-mode-vdebout.el
rename to elpa-to-submit/nxhtml/alts/smarty-mode-vdebout.el
diff --git a/elpa-to-submit/nxhtml/related/snippet.el b/elpa-to-submit/nxhtml/alts/snippet.el
similarity index 100%
rename from elpa-to-submit/nxhtml/related/snippet.el
rename to elpa-to-submit/nxhtml/alts/snippet.el
diff --git a/elpa-to-submit/nxhtml/autostart.el b/elpa-to-submit/nxhtml/autostart.el
index a46c4bdb08..5e837de4a8 100644
--- a/elpa-to-submit/nxhtml/autostart.el
+++ b/elpa-to-submit/nxhtml/autostart.el
@@ -1,9 +1,11 @@
+(setq message-log-max t)
+(setq debug-on-error t)
 ;;; autostart.el --- Load nxhtml
 ;;
 ;; Author: By: Lennart Borgman
-;; Created: Fri Dec 15 10:22:41 2006
+;; Created: Fri Dec 15 2006
 ;; Version:
-;; Last-Updated: 2008-03-06T23:49:43+0100 Thu
+;; Last-Updated: 2009-04-30 Thu
 ;; Keywords:
 ;; Compatibility:
 ;;
@@ -40,45 +42,145 @@
 ;;; Code:
 
 (message "Nxml/Nxhtml Autostart.el loading ...")
+(defconst nxhtml-load-time-start (float-time))
 
-;; ;; In case an old Emacs 22 beta is used, ie mostly for Debian/Ubuntu
-;; ;; at the moment. Suggested by Hadron Quark, thanks.
-;; (unless (fboundp 'define-globalized-minor-mode)
-;;   (defalias 'define-globalized-minor-mode 'define-global-minor-mode))
-
-(defvar nxhtml-install-dir
-  (file-name-directory (if load-file-name load-file-name buffer-file-name))
+(defconst nxhtml-install-dir
+  (file-name-directory (or load-file-name
+                           (when (boundp 'bytecomp-filename) bytecomp-filename)
+                           buffer-file-name))
   "Installation directory for nXhtml.")
+;; (setq nxhtml-install-dir (file-name-directory
+;;                           (or load-file-name
+;;                               (when (boundp 'bytecomp-filename) bytecomp-filename)
+;;                               buffer-file-name)))
+
+;; (defun nxhtml-custom-load-and-get-value (symbol)
+;;   (custom-load-symbol symbol)
+;;   (symbol-value symbol))
+
+(defun nxhtml-custom-autoload (symbol load &optional noset)
+  "Like `custom-autoload', but also run :set for defcustoms etc."
+  ;; Fix-me: is-boundp is currently always t because of the order in
+  ;; loaddefs.
+  (let* ((is-boundp (prog1 (boundp symbol)
+                      (custom-autoload symbol load noset)))
+         (standard (get symbol 'standard-value))
+         (saved (get symbol 'saved-value))
+         ;; Fix-me: property custom-set etc are not available
+         (custom-set (get symbol 'custom-set))
+         (custom-initialize (get symbol 'custom-initialize))
+         (set (or custom-set 'custom-set-default))) ;; Fix-me: initialize
+    ;;(message "nx:symbol = %s, standard/saved=%s/%s, custom-set=%s, boundp=%s,val=%s" symbol standard saved custom-set is-boundp (when is-boundp (symbol-value symbol)))
+    (setq custom-set t) ;; Not available here
+    (when (or custom-initialize
+              (and saved
+                   (not (equal (car saved) (symbol-value symbol)))
+                   custom-set))
+      ;;(message "nx:custom-load-symbol %s" symbol)
+      (funcall set symbol (car saved))
+      (custom-load-symbol symbol)
+      )))
+
+(defun nxhtml-list-loaded-features ()
+  (interactive)
+  (let ((buf (when (called-interactively-p)
+               (get-buffer-create "*nXhtml loaded features*"))))
+    (if buf
+        (with-current-buffer buf (erase-buffer))
+      (message "")
+      (message "=== Loaded at nxhtml/autostart.el end:"))
+    (dolist (feature '(
+                       as-external
+                       html-chklnk
+                       html-imenu
+                       html-move
+                       html-pagetoc
+                       html-quote
+                       html-site
+                       html-toc
+                       html-upl
+                       html-wtoc
+                       inlimg
+                       mumamo
+                       nxhtml-bug
+                       nxhtml-menu
+                       nxhtml-mode
+                       nxhtml-mumamo
+                       nxhtml-strval
+                       nxhtml
+                       nxhtml-js
+                       nxml-where
+                       outline-magic
+                       rngalt
+                       tidy-xhtml
+                       xhtml-help
+                       ))
+      (when (featurep feature)
+        (if buf
+            (with-current-buffer buf
+              (insert (format "(feature '%s)=%s\n" feature (featurep feature))))
+          (message "(feature '%s)=%s" feature (featurep feature)))))
+    (if buf
+        (display-buffer buf)
+      (message ""))))
 
 (unless (featurep 'nxhtml-autostart)
-  ;; Provide the feature to avoid loading looping on error.
+  ;; Provide the feature here to avoid loading looping on error.
   (provide 'nxhtml-autostart)
-  ;; Use the css-mode that comes with Emacs if there is one.
-  ;; Fix-me: remove this loading later:
-  (when (fboundp 'css-mode) (require 'css-mode))
-  (let* ((util-dir (file-name-as-directory
-                    (expand-file-name "util"
-                                      nxhtml-install-dir)))
-         (related-dir (file-name-as-directory
-                       (expand-file-name "related"
-                                         nxhtml-install-dir))))
-    (add-to-list 'load-path util-dir)
+
+  (if (< emacs-major-version 23)
+      (load (expand-file-name "autostart22" nxhtml-install-dir))
+    ;; Check that the nxml-mode included with Emacs is used. There
+    ;; has been some problems on Debian with this.
+    (let ((nxml-mode-file (locate-library "nxml-mode"))
+          (help-file      (locate-library "help")))
+      (unless (string= (expand-file-name ".." help-file)
+                       (expand-file-name "../.." nxml-mode-file))
+        (error "Wrong nxml-mode=%s used, please use the one that comes with Emacs" nxml-mode-file))))
+
+  (let* ((util-dir (file-name-as-directory (expand-file-name "util" nxhtml-install-dir)))
+         (related-dir (file-name-as-directory (expand-file-name "related" nxhtml-install-dir)))
+         (nxhtml-dir (file-name-as-directory (expand-file-name "nxhtml" nxhtml-install-dir)))
+         (company-dir (file-name-as-directory (expand-file-name "util/company-mode" nxhtml-install-dir)))
+         (tests-dir (file-name-as-directory (expand-file-name "tests" nxhtml-install-dir))))
+    (add-to-list 'load-path nxhtml-dir)
     (add-to-list 'load-path related-dir)
+    (add-to-list 'load-path util-dir)
+    (add-to-list 'load-path nxhtml-install-dir)
+    (add-to-list 'load-path company-dir)
+    (add-to-list 'load-path tests-dir)
+
+    (message "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
 
     ;; Autoloading etc
-    (require 'as-external)
-    (load (expand-file-name "nxhtml-loaddefs.el" nxhtml-install-dir))
-    ;; Use the nxml-mode that comes with Emacs if available:
-    (unless (fboundp 'nxml-mode)
-      (load (expand-file-name "nxml-mode-20041004/rng-auto"
-                              nxhtml-install-dir)))
+
+    ;; Fix-me: Why must as-external be loaded? Why doesn't it work in batch?
+    ;;(unless noninteractive (require 'as-external))
+
+    (load (expand-file-name "nxhtml-loaddefs" nxhtml-install-dir))
+    (message "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
+    ;; Turn on `nxhtml-global-minor-mode' unconditionally
+    (nxhtml-global-minor-mode 1)
+    (message "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
     ;; Patch the rnc include paths
-    (load-file (expand-file-name "etc/schema/schema-path-patch.el"
-                                 nxhtml-install-dir))
-    (rncpp-patch-xhtml-loader)
+    (when (fboundp 'nxml-mode)
+      (load (expand-file-name "etc/schema/schema-path-patch"
+                              nxhtml-install-dir))
+      (rncpp-patch-xhtml-loader))
+    (message "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
     ;; Load nXhtml
-    (load (expand-file-name "nxhtml/nxhtml-autoload"
-                            nxhtml-install-dir))))
+    (load (expand-file-name "nxhtml/nxhtml-autoload" nxhtml-install-dir)))
+    (message "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
+  ;; Tell what have been loaded of nXhtml:
+  (nxhtml-list-loaded-features)
+
+  ;; How long time did it all take?
+  (message "Nxml/Nxhtml Autostart.el loaded in %.1f seconds" (- (float-time) nxhtml-load-time-start))
+  )
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; autostart.el ends here
diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml-anything-1.el b/elpa-to-submit/nxhtml/autostart22.el
similarity index 54%
rename from elpa-to-submit/nxhtml/nxhtml/nxhtml-anything-1.el
rename to elpa-to-submit/nxhtml/autostart22.el
index f6ff5a853c..5784add9c8 100644
--- a/elpa-to-submit/nxhtml/nxhtml/nxhtml-anything-1.el
+++ b/elpa-to-submit/nxhtml/autostart22.el
@@ -1,22 +1,26 @@
-;;; nxhtml-anything-1.el ---
+;;; autostart22.el --- Example of autostart file for Emacs22
 ;;
 ;; Author: Lennart Borgman (lennart O borgman A gmail O com)
-;; Created: 2008-08-07T14:34:20+0200 Thu
+;; Created: 2009-01-01 Thu
 ;; Version:
-;; Last-Updated:
+;; Last-Updated: 2009-01-05 Mon
 ;; URL:
 ;; Keywords:
 ;; Compatibility:
 ;;
 ;; Features that might be required by this library:
 ;;
-;;   None
+;;   This file is for Emacs 22 only.
 ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 ;;; Commentary:
 ;;
+;; Change this file according to the path of your nxml-mode dir. If
+;; you do not use nxml-mode then just use autostart.el.
 ;;
+;; NOTICE: You need to enter the path to your nxml-mode installation
+;; below.
 ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -44,30 +48,23 @@
 ;;
 ;;; Code:
 
-;; Found this on the web. Maybe this could be an alternative completion function?
-(require 'anything)
-(defmacro nxhtml-with-anything-sources (sources &rest body)
-  (let ((saved-anything-souces (gensym)))
-    `(let ((,saved-anything-souces anything-sources))
-       (unwind-protect
-           (let ((anything-sources ,sources))
-             ,@body)
-         (setq anything-sources ,saved-anything-souces)))))
+(let ((debug-on-error t))
+  (unless (= emacs-major-version 22)
+    (error "This file is for Emacs 22 only"))
 
-(defadvice popcmp-completing-read (around popcml-with-anything)
-  (let* ((table (ad-get-arg 1))
-         (alt-sets (apply 'append (mapcar 'cdr (ad-get-arg 9))));(apply 'append (mapcar 'cdr nxhtml-tag-sets)))
-         (cands (cond ((not (listp table)) alt-sets)
-                      (t table)))
-         (source
-          `((name . "nxhtml-completion")
-            (candidates . ,cands)
-            (action . (("select" . (lambda (candidate)
-                                     (setq ad-return-value candidate))))))))
-    (nxhtml-with-anything-sources (list source)
-      (anything))))
+  (defalias 'Custom-mode 'custom-mode)
 
+  (let* ((this-file (or load-file-name buffer-file-name))
+         (this-dir (file-name-directory this-file))
+         ;; FIX-ME: Download nXml (since it is not included in Emacs
+         ;; 22) and place the path to rng-auto.el in your downloaded
+         ;; nXml HERE:
+         (rng-auto-file (or (locate-library "rng-auto.el")
+                            (concat this-dir "../nxml-mode/rng-auto.el"))))
+    (unless (file-exists-p rng-auto-file)
+      (error "Can't find rng-auto.el, please edit %s" this-file))
+    (load rng-auto-file)))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; nxhtml-anything-1.el ends here
+;;; autostart22.el ends here
diff --git a/elpa-to-submit/nxhtml/emacs22.cmd b/elpa-to-submit/nxhtml/emacs22.cmd
new file mode 100644
index 0000000000..d50ac962c7
--- /dev/null
+++ b/elpa-to-submit/nxhtml/emacs22.cmd
@@ -0,0 +1 @@
+c:\emacs\emacs-22.3\bin\emacs.exe -Q --debug-init -l autostart.el
diff --git a/elpa-to-submit/nxhtml/etc/img/pause/pause.jpg b/elpa-to-submit/nxhtml/etc/img/pause/pause.jpg
new file mode 100644
index 0000000000..ff920756c4
Binary files /dev/null and b/elpa-to-submit/nxhtml/etc/img/pause/pause.jpg differ
diff --git a/elpa-to-submit/nxhtml/etc/img/pause/pause2.jpg b/elpa-to-submit/nxhtml/etc/img/pause/pause2.jpg
new file mode 100644
index 0000000000..6411344afe
Binary files /dev/null and b/elpa-to-submit/nxhtml/etc/img/pause/pause2.jpg differ
diff --git a/elpa-to-submit/nxhtml/etc/schema/rncpp-patch-files.done b/elpa-to-submit/nxhtml/etc/schema/rncpp-patch-files.done
deleted file mode 100644
index 2383bff5d8..0000000000
--- a/elpa-to-submit/nxhtml/etc/schema/rncpp-patch-files.done
+++ /dev/null
@@ -1 +0,0 @@
-2008-0818T16:43:47+0200
\ No newline at end of file
diff --git a/elpa-to-submit/nxhtml/etc/schema/schema-path-patch.el b/elpa-to-submit/nxhtml/etc/schema/schema-path-patch.el
index d2962b9780..a6d59fc432 100644
--- a/elpa-to-submit/nxhtml/etc/schema/schema-path-patch.el
+++ b/elpa-to-submit/nxhtml/etc/schema/schema-path-patch.el
@@ -45,8 +45,6 @@
 ;;
 ;;; Code:
 
-;;(eval-when-compile (require 'cl))
-
 (defvar rncpp-this-dir
   (file-name-as-directory
    (file-name-directory
@@ -66,28 +64,6 @@
       (error "Can't find schema-dir=%s" schema-dir))
     schema-dir))
 
-;; (defun rncpp-patch-file (file)
-;;   (let ((schema-dir (rncpp-get-nxml-schema-dir))
-;;         relative-inc-file
-;;         absolute-inc-file
-;;         (buf (find-file-noselect file))
-;;         file-dir
-;;         )
-;;     (with-current-buffer buf
-;;       (setq file-dir (file-name-directory buffer-file-name))
-;;       (widen)
-;;       (goto-char (point-min))
-;;       (setq absolute-inc-file (expand-file-name "xhtml.rnc" schema-dir))
-;;       (assert (file-exists-p absolute-inc-file) t)
-;;       (setq relative-inc-file
-;;             (file-relative-name absolute-inc-file file-dir))
-;;       (assert (file-exists-p relative-inc-file) t)
-;;       (when (re-search-forward "include \"\\(.*[^a-zA-Z0-9-]xhtml.rnc\\)\"" nil t)
-;;         (replace-match relative-inc-file t t nil 1)
-;;         (basic-save-buffer)
-;;         (kill-buffer (current-buffer))
-;;         (message "Patched %s" file)))))
-
 ;; Use xhtml-loader.rnc (an idea from Bryan Waite):
 (defun rncpp-patch-xhtml-loader ()
   "Patch xhtml-loader.rnc so genshi and mjt rnc files works."
@@ -99,7 +75,7 @@
          (schema-relative-dir (file-relative-name schema-dir))
          (loader-string (concat "include \""
                                 schema-relative-dir
-                                "xhtml.rnc\"")))
+                                "xhtml.rnc\"\n")))
     (when loader-buf (kill-buffer loader-buf))
     (setq loader-buf (find-file-noselect loader-path))
     (with-current-buffer loader-buf
@@ -115,28 +91,5 @@
       (basic-save-buffer)
       (kill-buffer (current-buffer)))))
 
-;; (defun rncpp-patch-files (&optional no-check-done)
-;;   "Patch rnc files in this directory.
-;; This will make the includes from here point to those that
-;; `nxml-mode' use."
-;;   (interactive (list t))
-;;   (let ((default-directory rncpp-this-dir)
-;;         (done nil)
-;;         (done-mark "rncpp-patch-files.done"))
-;;     (message "Patching rnc files path in %s" default-directory)
-;;     (unless no-check-done
-;;       (setq done (file-exists-p done-mark)))
-;;     (if done
-;;         (message "... patching was already done")
-;;       (rncpp-patch-file "mjt.rnc")
-;;       (rncpp-patch-file "qtmstr-xhtml.rnc")
-;;       (with-current-buffer (find-file-noselect done-mark)
-;;         (insert (format-time-string "%Y-%m%dT%T%z"))
-;;         (basic-save-buffer)
-;;         (kill-buffer (current-buffer)))
-;;       (message "... ready patching"))))
-
-;;(rncpp-patch-files)
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; schema-path-patch.el ends here
diff --git a/elpa-to-submit/nxhtml/nxhtml-loaddefs.el b/elpa-to-submit/nxhtml/nxhtml-loaddefs.el
index da62fd54f3..3c4419161d 100644
--- a/elpa-to-submit/nxhtml/nxhtml-loaddefs.el
+++ b/elpa-to-submit/nxhtml/nxhtml-loaddefs.el
@@ -3,9 +3,31 @@
 ;; This file should be updated by `nxhtmlmaint-get-file-autoloads',
 ;; `nxhtmlmaint-get-dir-autoloads' or `nxhtmlmaint-get-all-autoloads'.
 
+;;;### (autoloads (html-pagetoc-rebuild-toc html-pagetoc-insert-toc)
+;;;;;;  "../nxhtml/html-pagetoc" "nxhtml/html-pagetoc.el" (18974
+;;;;;;  59066))
+;;; Generated autoloads from nxhtml/html-pagetoc.el
+
+(autoload 'html-pagetoc-insert-toc "../nxhtml/html-pagetoc" "\
+Inserts a table of contents for the current html file.
+The html header tags h1-h6 found in the file are inserted into
+this table.  MIN-LEVEL and MAX-LEVEL specifies the minimum and
+maximum level of h1-h6 to include.  They should be integers.
+
+\(fn &optional MIN-LEVEL MAX-LEVEL)" t nil)
+
+(autoload 'html-pagetoc-rebuild-toc "../nxhtml/html-pagetoc" "\
+Update the table of contents inserted by `html-pagetoc-insert-toc'.
+
+\(fn)" t nil)
+
+(defconst html-pagetoc-menu-map (let ((map (make-sparse-keymap))) (define-key map [html-pagetoc-rebuild-toc] (list 'menu-item "Update Page TOC" 'html-pagetoc-rebuild-toc)) (define-key map [html-pagetoc-insert-style-guide] (list 'menu-item "Insert CSS Style for Page TOC" 'html-pagetoc-insert-style-guide)) (define-key map [html-pagetoc-insert-toc] (list 'menu-item "Insert Page TOC" 'html-pagetoc-insert-toc)) map))
+
+;;;***
+
 ;;;### (autoloads (html-site-query-replace html-site-rgrep html-site-find-file
 ;;;;;;  html-site-dired-current html-site-set-site html-site-buffer-or-dired-file-name)
-;;;;;;  "../nxhtml/html-site" "nxhtml/html-site.el" (18658 47798))
+;;;;;;  "../nxhtml/html-site" "nxhtml/html-site.el" (18790 45398))
 ;;; Generated autoloads from nxhtml/html-site.el
 
 (autoload 'html-site-buffer-or-dired-file-name "../nxhtml/html-site" "\
@@ -41,33 +63,137 @@ Query replace in current site's files.
 
 ;;;***
 
-;;;### (autoloads (inlimg-toggle-img-display inlimg-mode) "../nxhtml/inlimg"
-;;;;;;  "nxhtml/inlimg.el" (18658 47798))
-;;; Generated autoloads from nxhtml/inlimg.el
+;;;### (autoloads nil "../nxhtml/html-toc" "nxhtml/html-toc.el" (18974
+;;;;;;  59066))
+;;; Generated autoloads from nxhtml/html-toc.el
 
-(autoload 'inlimg-mode "../nxhtml/inlimg" "\
-Display  images inline.
-Images are displayed below the  tag using the margins in
-`inlimg-margins'.  The whole image or a slice of it may be
-displayed, see `inlimg-slice'.
+(defconst html-toc-menu-map (let ((map (make-sparse-keymap))) (define-key map [html-toc-browse-frames-file] (list 'menu-item "Browse Frames File" 'html-toc-browse-frames-file)) (define-key map [html-toc-write-frames-file] (list 'menu-item "Write Frames File" 'html-toc-write-frames-file)) (define-key map [html-toc-write-toc-file] (list 'menu-item "Write TOC File for Frames" 'html-toc-write-toc-file)) (define-key map [html-toc-sep1] (list 'menu-item "--")) (define-key map [html-toc-edit-pages-file] (list 'menu-item "Edit List of Pages for TOC" 'html-site-edit-pages-file)) (define-key map [html-toc-create-pages-file] (list 'menu-item "Write List of Pages for TOC" 'html-toc-create-pages-file)) map))
 
-See also the command `inlimg-toggle-img-display'.
+;;;***
+
+;;;### (autoloads (html-upl-ediff-file html-upl-edit-remote-file-with-toc
+;;;;;;  html-upl-edit-remote-file html-upl-upload-file html-upl-remote-dired
+;;;;;;  html-upl-upload-site html-upl-upload-site-with-toc) "../nxhtml/html-upl"
+;;;;;;  "nxhtml/html-upl.el" (18969 63118))
+;;; Generated autoloads from nxhtml/html-upl.el
 
-\(fn &optional ARG)" t nil)
+(autoload 'html-upl-upload-site-with-toc "../nxhtml/html-upl" "\
+Not documented
 
-(autoload 'inlimg-toggle-img-display "../nxhtml/inlimg" "\
-Toggle display of img image at point POINT.
-See also the command `inlimg-mode'.
+\(fn)" t nil)
 
-\(fn POINT)" t nil)
+(autoload 'html-upl-upload-site "../nxhtml/html-upl" "\
+Not documented
+
+\(fn)" t nil)
+
+(autoload 'html-upl-remote-dired "../nxhtml/html-upl" "\
+Start dired for remote directory or its parent/ancestor.
+
+\(fn DIRNAME)" t nil)
+
+(autoload 'html-upl-upload-file "../nxhtml/html-upl" "\
+Upload a single file in a site.
+For the definition of a site see `html-site-current'.
+
+\(fn FILENAME)" t nil)
+
+(autoload 'html-upl-edit-remote-file "../nxhtml/html-upl" "\
+Not documented
+
+\(fn)" t nil)
+
+(autoload 'html-upl-edit-remote-file-with-toc "../nxhtml/html-upl" "\
+Not documented
+
+\(fn)" t nil)
+
+(autoload 'html-upl-ediff-file "../nxhtml/html-upl" "\
+Run ediff on local and remote file.
+FILENAME could be either the remote or the local file.
+
+\(fn FILENAME)" t nil)
 
 ;;;***
 
-;;;### (autoloads (nxhtml-validation-header-mode nxhtml-mode) "../nxhtml/nxhtml"
-;;;;;;  "nxhtml/nxhtml.el" (18735 15066))
+;;;### (autoloads (nxhtml-features-check nxhtml-customize) "../nxhtml/nxhtml"
+;;;;;;  "nxhtml/nxhtml.el" (19063 47343))
 ;;; Generated autoloads from nxhtml/nxhtml.el
 
-(autoload 'nxhtml-mode "../nxhtml/nxhtml" "\
+(autoload 'nxhtml-customize "../nxhtml/nxhtml" "\
+Customize nXhtml.
+
+\(fn)" t nil)
+
+(autoload 'nxhtml-features-check "../nxhtml/nxhtml" "\
+Check if external modules used by nXhtml are found.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtml-report-bug) "../nxhtml/nxhtml-bug" "nxhtml/nxhtml-bug.el"
+;;;;;;  (18775 60002))
+;;; Generated autoloads from nxhtml/nxhtml-bug.el
+
+(autoload 'nxhtml-report-bug "../nxhtml/nxhtml-bug" "\
+Report a bug in nXhtml.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtml-overview nxhtml-global-minor-mode nxhtml-browse-region
+;;;;;;  nxhtml-browse-file nxhtml-edit-with-gimp) "../nxhtml/nxhtml-menu"
+;;;;;;  "nxhtml/nxhtml-menu.el" (19064 18624))
+;;; Generated autoloads from nxhtml/nxhtml-menu.el
+
+(autoload 'nxhtml-edit-with-gimp "../nxhtml/nxhtml-menu" "\
+Edit with GIMP buffer or file at point.
+
+\(fn)" t nil)
+
+(autoload 'nxhtml-browse-file "../nxhtml/nxhtml-menu" "\
+View file in web browser.
+
+\(fn FILE)" t nil)
+
+(autoload 'nxhtml-browse-region "../nxhtml/nxhtml-menu" "\
+View region in web browser.
+
+\(fn)" t nil)
+
+(defvar nxhtml-global-minor-mode nil "\
+Non-nil if Nxhtml-Global minor mode is enabled.
+See the command `nxhtml-global-minor-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `nxhtml-global-minor-mode'.")
+
+(nxhtml-custom-autoload 'nxhtml-global-minor-mode "../nxhtml/nxhtml-menu" nil)
+
+(autoload 'nxhtml-global-minor-mode "../nxhtml/nxhtml-menu" "\
+Toggle Nxhtml minor mode in every possible buffer.
+With prefix ARG, turn Nxhtml-Global minor mode on if and only if ARG is positive.
+Nxhtml minor mode is enabled in all buffers where `nxhtml-maybe-turn-on-minor-mode' would do it.
+See `nxhtml-minor-mode' for more information on Nxhtml minor mode.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'nxhtml-overview "../nxhtml/nxhtml-menu" "\
+Show a HTML page with an overview of nXhtml.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtml-validation-header-mode nxhtml-short-tag-help
+;;;;;;  nxhtml-mode) "../nxhtml/nxhtml-mode" "nxhtml/nxhtml-mode.el"
+;;;;;;  (19061 60294))
+;;; Generated autoloads from nxhtml/nxhtml-mode.el
+
+(when (fboundp 'nxml-mode)
+(autoload 'nxhtml-mode "../nxhtml/nxhtml-mode" "\
 Major mode for editing XHTML documents.
 It is based on `nxml-mode' and adds some features that are useful
 when editing XHTML files.\\
@@ -169,9 +295,15 @@ point in the mumamo chunk you want to know the key bindings in.
   with this if you have followed the installation instructions
   for nXhtml.
 
-\(fn)" t nil)
+\(fn)" t nil))
 
-(autoload 'nxhtml-validation-header-mode "../nxhtml/nxhtml" "\
+(autoload 'nxhtml-short-tag-help "../nxhtml/nxhtml-mode" "\
+Display description of tag TAG.  If TAG is omitted, try tag at point.
+
+\(fn TAG)" t nil)
+
+(when (fboundp 'nxml-mode)
+(autoload 'nxhtml-validation-header-mode "../nxhtml/nxhtml-mode" "\
 If on use a Fictive XHTML Validation Header for the buffer.
 See `nxhtml-set-validation-header' for information about Fictive XHTML Validation Headers.
 
@@ -180,50 +312,10 @@ This mode may be turned on automatically in two ways:
   `nxthml-mode' may ask you if you want to turn this mode on if
   needed.
 - You can also choose to have it turned on automatically whenever
-  mumamo is used, see `nxhtml-validation-header-if-mumamo' for
-  further information.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;;;### (autoloads (nxhtml-report-bug) "../nxhtml/nxhtml-bug" "nxhtml/nxhtml-bug.el"
-;;;;;;  (18654 33920))
-;;; Generated autoloads from nxhtml/nxhtml-bug.el
-
-(autoload 'nxhtml-report-bug "../nxhtml/nxhtml-bug" "\
-Report a bug in nXhtml.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (nxhtml-global-minor-mode nxhtml-minor-mode) "../nxhtml/nxhtml-menu"
-;;;;;;  "nxhtml/nxhtml-menu.el" (18671 42692))
-;;; Generated autoloads from nxhtml/nxhtml-menu.el
-
-(autoload 'nxhtml-minor-mode "../nxhtml/nxhtml-menu" "\
-Minor mode to turn on some key and menu bindings.
-See `nxhtml-mode' for more information.
-
-\(fn &optional ARG)" t nil)
-
-(defvar nxhtml-global-minor-mode nil "\
-Non-nil if Nxhtml-Global minor mode is enabled.
-See the command `nxhtml-global-minor-mode' for a description of this minor mode.
-Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `nxhtml-global-minor-mode'.")
-
-(custom-autoload 'nxhtml-global-minor-mode "../nxhtml/nxhtml-menu" nil)
-
-(autoload 'nxhtml-global-minor-mode "../nxhtml/nxhtml-menu" "\
-Toggle Nxhtml minor mode in every possible buffer.
-With prefix ARG, turn Nxhtml-Global minor mode on if and only if ARG is positive.
-Nxhtml minor mode is enabled in all buffers where `nxhtml-maybe-turn-on-minor-mode' would do it.
-See `nxhtml-minor-mode' for more information on Nxhtml minor mode.
+  a mumamo multi major mode is used, see
+  `nxhtml-validation-header-if-mumamo' for further information.
 
-\(fn &optional ARG)" t nil)
+\(fn &optional ARG)" t nil))
 
 ;;;***
 
@@ -231,12 +323,14 @@ See `nxhtml-minor-mode' for more information on Nxhtml minor mode.
 ;;;;;;  eruby-nxhtml-mumamo-mode jsp-nxhtml-mumamo-mode smarty-nxhtml-mumamo-mode
 ;;;;;;  mjt-nxhtml-mumamo-mode genshi-nxhtml-mumamo-mode django-nxhtml-mumamo-mode
 ;;;;;;  embperl-nxhtml-mumamo-mode nxhtml-mumamo-mode) "../nxhtml/nxhtml-mumamo"
-;;;;;;  "nxhtml/nxhtml-mumamo.el" (18764 14404))
+;;;;;;  "nxhtml/nxhtml-mumamo.el" (18982 33732))
 ;;; Generated autoloads from nxhtml/nxhtml-mumamo.el
 
 (autoload 'nxhtml-mumamo-mode "../nxhtml/nxhtml-mumamo" "\
 Turn on multiple major modes for (X)HTML with main mode `nxhtml-mode'.
-This covers inlined style and javascript and PHP." t)
+This covers inlined style and javascript and PHP.
+
+See also `mumamo-alt-php-tags-mode'." t)
 
 (autoload 'embperl-nxhtml-mumamo-mode "../nxhtml/nxhtml-mumamo" "\
 Turn on multiple major modes for Embperl files with main mode `nxhtml-mode'.
@@ -277,7 +371,7 @@ This also covers inlined style and javascript." t)
 ;;;***
 
 ;;;### (autoloads (nxml-where-global-mode nxml-where-mode) "../nxhtml/nxml-where"
-;;;;;;  "nxhtml/nxml-where.el" (18658 47798))
+;;;;;;  "nxhtml/nxml-where.el" (19061 60294))
 ;;; Generated autoloads from nxhtml/nxml-where.el
 
 (autoload 'nxml-where-mode "../nxhtml/nxml-where" "\
@@ -292,7 +386,7 @@ Setting this variable directly does not take effect;
 either customize it (see the info node `Easy Customization')
 or call the function `nxml-where-global-mode'.")
 
-(custom-autoload 'nxml-where-global-mode "../nxhtml/nxml-where" nil)
+(nxhtml-custom-autoload 'nxml-where-global-mode "../nxhtml/nxml-where" nil)
 
 (autoload 'nxml-where-global-mode "../nxhtml/nxml-where" "\
 Toggle Nxml-Where mode in every possible buffer.
@@ -302,6 +396,51 @@ See `nxml-where-mode' for more information on Nxml-Where mode.
 
 \(fn &optional ARG)" t nil)
 
+;;;***
+
+;;;### (autoloads (rngalt-set-validation-header) "../nxhtml/rngalt"
+;;;;;;  "nxhtml/rngalt.el" (18982 33732))
+;;; Generated autoloads from nxhtml/rngalt.el
+
+(autoload 'rngalt-set-validation-header "../nxhtml/rngalt" "\
+Not documented
+
+\(fn START-OF-DOC)" nil nil)
+
+;;;***
+
+;;;### (autoloads (tidy-build-menu) "../nxhtml/tidy-xhtml" "nxhtml/tidy-xhtml.el"
+;;;;;;  (19039 48498))
+;;; Generated autoloads from nxhtml/tidy-xhtml.el
+
+(autoload 'tidy-build-menu "../nxhtml/tidy-xhtml" "\
+Set up the tidy menu in MAP.
+Used to set up a Tidy menu in your favourite mode.
+
+\(fn &optional MAP)" t nil)
+
+;;;***
+
+;;;### (autoloads (xhtml-help-show-tag-ref xhtml-help-tag-at-point
+;;;;;;  xhtml-help-show-css-ref) "../nxhtml/xhtml-help" "nxhtml/xhtml-help.el"
+;;;;;;  (19036 37218))
+;;; Generated autoloads from nxhtml/xhtml-help.el
+
+(autoload 'xhtml-help-show-css-ref "../nxhtml/xhtml-help" "\
+Show CSS reference for CSS property name at point.
+
+\(fn)" t nil)
+
+(autoload 'xhtml-help-tag-at-point "../nxhtml/xhtml-help" "\
+Get xhtml tag name at or before point.
+
+\(fn)" nil nil)
+
+(autoload 'xhtml-help-show-tag-ref "../nxhtml/xhtml-help" "\
+Show xhtml reference for tag name at or before point.
+
+\(fn)" t nil)
+
 ;;;***
 
 ;;;### (autoloads (csharp-mode) "../related/csharp-mode" "related/csharp-mode.el"
@@ -321,18 +460,6 @@ Key bindings:
 
 \(fn)" t nil)
 
-;;;***
-
-;;;### (autoloads (css-mode) "../related/css-mode" "related/css-mode.el"
-;;;;;;  (18248 47980))
-;;; Generated autoloads from related/css-mode.el
- (add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
-
-(autoload 'css-mode "../related/css-mode" "\
-Major mode to edit Cascading Style Sheets.
-
-\(fn)" t nil)
-
 ;;;***
 
 ;;;### (autoloads (django-mode) "../related/django" "related/django.el"
@@ -347,26 +474,26 @@ This mode only provides syntax highlighting.
 
 ;;;***
 
-;;;### (autoloads (javascript-mode) "../related/javascript" "related/javascript.el"
-;;;;;;  (18418 45624))
-;;; Generated autoloads from related/javascript.el
+;;;### (autoloads (espresso-mode) "../related/espresso" "related/espresso.el"
+;;;;;;  (19039 48498))
+;;; Generated autoloads from related/espresso.el
 
-(autoload 'javascript-mode "../related/javascript" "\
+(autoload 'espresso-mode "../related/espresso" "\
 Major mode for editing JavaScript source text.
 
 Key bindings:
 
-\\{javascript-mode-map}
+\\{espresso-mode-map}
 
 \(fn)" t nil)
 
 ;;;***
 
-;;;### (autoloads (javascript-mode) "../related/javascript-mozlab"
-;;;;;;  "related/javascript-mozlab.el" (18562 39536))
-;;; Generated autoloads from related/javascript-mozlab.el
+;;;### (autoloads (javascript-mode) "../related/javascript" "related/javascript.el"
+;;;;;;  (18946 55162))
+;;; Generated autoloads from related/javascript.el
 
-(autoload 'javascript-mode "../related/javascript-mozlab" "\
+(autoload 'javascript-mode "../related/javascript" "\
 Major mode for editing JavaScript source text.
 
 Key bindings:
@@ -375,46 +502,10 @@ Key bindings:
 
 \(fn)" t nil)
 
-;;;***
-
-;;;### (autoloads (js2-mode) "../related/js2" "related/js2.el" (18624
-;;;;;;  30036))
-;;; Generated autoloads from related/js2.el
- (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
-
-(autoload 'js2-mode "../related/js2" "\
-Major mode for editing JavaScript code.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (js2-mode) "../related/js2-mumamo" "related/js2-mumamo.el"
-;;;;;;  (18496 38616))
-;;; Generated autoloads from related/js2-mumamo.el
- (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
-
-(autoload 'js2-mode "../related/js2-mumamo" "\
-Major mode for editing JavaScript code.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (js2-mode) "../related/js2-new" "related/js2-new.el"
-;;;;;;  (18455 47788))
-;;; Generated autoloads from related/js2-new.el
- (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
-
-(autoload 'js2-mode "../related/js2-new" "\
-Major mode for editing JavaScript code.
-
-\(fn)" t nil)
-
 ;;;***
 
 ;;;### (autoloads (inferior-moz-mode moz-minor-mode) "../related/moz"
-;;;;;;  "related/moz.el" (18654 33920))
+;;;;;;  "related/moz.el" (19048 2102))
 ;;; Generated autoloads from related/moz.el
 
 (autoload 'moz-minor-mode "../related/moz" "\
@@ -441,443 +532,98 @@ Major mode for interacting with Firefox via MozRepl.
 
 ;;;***
 
-;;;### (autoloads (php-mode php-file-patterns) "../related/php-mode"
-;;;;;;  "related/php-mode.el" (18735 15066))
-;;; Generated autoloads from related/php-mode.el
-
-(defvar php-file-patterns '("\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'") "\
-List of file patterns for which to automatically invoke `php-mode'.")
-
-(custom-autoload 'php-file-patterns "../related/php-mode" nil)
-
-(autoload 'php-mode "../related/php-mode" "\
-Major mode for editing PHP code.
-
-\\{php-mode-map}
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (php-mode php-file-patterns) "../related/php-mode-2008-10-23"
-;;;;;;  "related/php-mode-2008-10-23.el" (18688 64648))
-;;; Generated autoloads from related/php-mode-2008-10-23.el
-
-(defvar php-file-patterns '("\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'") "\
-List of file patterns for which to automatically invoke `php-mode'.")
-
-(custom-autoload 'php-file-patterns "../related/php-mode-2008-10-23" nil)
-
-(autoload 'php-mode "../related/php-mode-2008-10-23" "\
-Major mode for editing PHP code.
-
-\\{php-mode-map}
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (smarty-mode) "../related/smarty-mode" "related/smarty-mode.el"
-;;;;;;  (18317 23898))
-;;; Generated autoloads from related/smarty-mode.el
-
-(autoload 'smarty-mode "../related/smarty-mode" "\
-Mode for editing php smarty files.
-Smarty Mode is a GNU XEmacs major mode for editing Smarty templates.
-
-1 Introduction
-**************
-
-Smarty-Mode is a mode allowing easy edit of Smarty templates:
-highlight, templates, navigation into source files...
-
-
-
-Features (new features in bold) :
-
-   * Completion
-
-   * Customizable
-
-   * Highlight
-
-   * Menu
-
-   * Stuttering
-
-   * Templates
-        - Built-in Functions
-
-        - User Functions
-
-        - Variable Modifiers
-
-        - Plugin (Functions)
-             * Smarty Formtool
-
-             * Smarty Paginate
-
-             * Smarty Validate
-
-        - Plugin (Variable Modifiers)
-             * AlternativeDateModifierPlugin
-
-             * B2Smilies
-
-             * BBCodePlugin
-
-        - Fonctions Non-Smarty
+;;;### (autoloads (global-mozadd-mirror-mode mozadd-mirror-mode global-mozadd-refresh-edited-on-save-mode
+;;;;;;  mozadd-refresh-edited-on-save-mode) "../related/mozadd" "related/mozadd.el"
+;;;;;;  (19063 53089))
+;;; Generated autoloads from related/mozadd.el
 
+(autoload 'mozadd-refresh-edited-on-save-mode "../related/mozadd" "\
+Refresh mozadd edited file in Firefox when saving file.
+The mozadd edited file is the file in the last buffer visited in
+`mozadd-mirror-mode'.
 
+You can use this for example when you edit CSS files.
 
-This manual describes Smarty Mode version 0.0.4.
-
-3 Customization
-***************
-
-This chapter describes the differents parameters and functions that
-you can change to customize Smarty Mode.  To do that, open a Smarty
-file, click on the Smarty menu and choose Options then Browse
-Options....
-
-3.1 Parameters
-==============
-
-3.1.1 Mode
-----------
-
-Smarty Mode has 2 modes allowing to simplify the writing of Smarty
-templates. You can enable/disable each mode individually.
-
-`smarty-electric-mode'
-     Type: boolean
-     Default value: `t'
-     Description: If `t'; enable automatic generation of template.
-     If `nil'; template generators can still be invoked through key
-     bindings and menu. Is indicated in the modeline by \"/e\" after
-     the mode name and can be toggled by `smarty-electric-mode'.
-
-`smarty-stutter-mode'
-     Type: boolean
-     Default value: `t'
-     Description: If `t'; enable the stuttering. Is indicated in the
-     modeline by \"/s\" after the mode name and can be toggled by
-     `smarty-stutter-mode'.
-
-3.1.2 Menu
-----------
-
-Smarty Mode has also 1 menu that you can enable/disable. The menu
-Sources is specific to each Smarty files opened.
-
-`smarty-source-file-menu'
-     Type: boolean
-     Default value: `t'
-     Description: If `t'; the Sources menu is enabled. This menu
-     contains the list of Smarty file located in the current
-     directory. The Sources menu scans the directory when a file is
-     opened.
-
-3.1.3 Menu
-----------
-
-`smarty-highlight-plugin-functions'
-     Type: boolean
-     Default value: `t'
-     Description: If `t'; the functions described in the smarty
-     plugins are highlighted.
-
-3.1.4 Templates
----------------
-
-3.1.4.1 Header
-..............
-
-`smarty-file-header'
-     Type: string
-     Default value: `\"\"'
-     Description: String or file to insert as file header. If the
-     string specifies an existing file name the contents of the file
-     is inserted; otherwise the string itself is inserted as file
-     header.
-     Type `C-j' for newlines.
-     The follonwing keywords are supported:
-     : replaced by the file name.
-     : replaced by the user name and email address.
-     : replaced by `user-login-name'.
-     : replaced by `smarty-company-name' content.
-     : replaced by the current date.
-     : replaced by the current year.
-     : replaced by `smarty-copyright-string' content.
-     : final cursor position.
-
-`smarty-file-footer'
-     Type: string
-     Default value: `\"\"'
-     Description: String or file to insert as file footer.  See
-     `smarty-file-header'
-
-`smarty-company-name'
-     Type: string
-     Default value: `\"\"'
-     Description: Name of the company to insert in file header.
-
-`smarty-copyright-string'
-     Type: string
-     Default value: `\"\"'
-     Description: Coryright string to insert in file header.
-
-`smarty-date-format'
-     Type: string
-     Default value: `\"%Y-%m-%d\"'
-     Description: Date format.
-
-`smarty-modify-date-prefix-string'
-     Type: string
-     Default value: `\"\"'
-     Description: Prefix string of modification date in Smarty file
-     header.
-
-`smarty-modify-date-on-saving'
-     Type: bool
-     Default value: `nil'
-     Description: If `t'; update the modification date when the
-     buffer is saved.
-
-3.1.5 Miscellaneous
--------------------
-
-`smarty-left-delimiter'
-     Type: string
-     Default value: `\"\"'
-     Description: Left escaping delimiter for Smarty templates.
-
-`smarty-right-delimiter'
-     Type: string
-     Default value: `\"\"'
-     Description: Right escaping delimiter for Smarty templates.
-
-`smarty-intelligent-tab'
-     Type: bool
-     Default value: `t'
-     Description: If `t'; TAB does indentation; completion and insert
-     tabulations. If `nil'; TAB does only indentation.
-
-`smarty-word-completion-in-minibuffer'
-     Type: bool
-     Default value: `t'
-     Description: If `t'; enable completion in the minibuffer.
-
-`smarty-word-completion-case-sensitive'
-     Type: bool
-     Default value: `nil'
-     Description: If `t'; completion is case sensitive.
-
-3.2 Functions
-=============
-
-3.2.1 Mode
-----------
-
-`smarty-electric-mode'
-     Menu: Smarty -> Options -> Mode -> Electric Mode
-     Keybinding: `C-c C-m C-e'
-     Description: This functions is used to enable/disable the
-     electric mode.
-
-`smarty-stutter-mode'
-     Menu: Smarty -> Options -> Mode -> Stutter Mode
-     Keybinding: `C-c C-m C-s'
-     Description: This function is used to enable/disable the stutter
-     mode.
-
-4 Menus
-*******
-
-There are 2 menus: Smarty and Sources. All theses menus can be
-accessed from the menubar or from the right click. This chapter
-describes each menus.
-
-4.1 Smarty
-==========
-
-This is the main menu of Smarty Mode. It allows an easy access to the
-main features of the Smarty Mode: Templates (see *Note Templates::)
-and Options (see *Note Customization::).
-
-This menu contains also 3 functions that are discussed in the next
-part.
-
-4.1.1 Functions
----------------
-\\
-`smarty-show-messages'
-     Menu: Smarty -> Show Messages
-     Keybinding: `C-c M-m' \\[smarty-show-messages]
-     Description: This function opens the *Messages* buffer to
-     display previous error messages.
-
-`smarty-doc-mode'
-     Menu: Smarty -> Smarty Mode Documentation
-     Keybinding: `C-c C-h' \\[smarty-doc-mode]
-     Description: This function opens the *Help* buffer and prints in
-     it the Smarty Mode documentation.
-
-`smarty-version'
-     Menu: Smarty -> Version
-     Keybinding: `C-c C-v'
-     Description: This function displays in the minibuffer the
-     current Smarty Mode version with the timestamp.
-
-4.2 Sources
-===========
-
-The Sources menu shows the Smarty files in the current directory. If
-you add or delete a file in the current directory, you need to
-refresh the menu.
-
-4.2.1 Customization
--------------------
-
-`smarty-source-file-menu'
-     Type: boolean
-     Default value: `t'
-     Description: If `t'; the Sources menu is enabled. This menu
-     contains the list of Smarty file located in the current
-     directory. The Sources menu scans the directory when a file is
-     opened.
-
-4.2.2 Functions
----------------
-
-`smarty-add-source-files-menu'
-     Menu: Sources -> *Rescan*
-     Keybinding: `C-c C-s C-u'
-     Description: This function is used to refresh the Sources menu.
-
-5 Stuttering
-************
-
-The stutter mode is a mode that affects a function to a key. For
-example, when you use the `ENTER' key, the associated function will
-create a new line and indent it.
-
-5.1 Customization
-=================
-
-`smarty-stutter-mode'
-     Type: boolean
-     Default value: `t'
-     Description: If `t'; enable the stuttering. Is indicated in the
-     modeline by \"/s\" after the mode name and can be toggled by
-     `smarty-stutter-mode'.
-
-5.2 Functions
-=============
-
-`SPACE'
-     If in comment, indent the comment and add new line if necessary.
-     In other case, add a space.
-
-`('
-     If the previous character is a `(', the `((' will be replaced by
-     `['.
-     If the previous character is a `[', the `[(' will be replaced by
-     `{'.
-     In other case, insert a `('.
-
-`)'
-     If the previous character is a `)', the `))' will be replaced by
-     `]'.
-     If the previous character is a `]', the `])' will be replaced by
-     `}'.
-     In other case, insert a `)'.
-
-6 Templates
-***********
+The mozadd edited file must be shown in Firefox and visible.
 
-In the Smarty Mode, the Smarty functions (like if, while, for, fopen,
-fclose) are predefined in functions called \"Templates\".
+\(fn &optional ARG)" t nil)
 
-Each template can be invoked by the function name or by using the
- key after the Smarty function name in the buffer (Note, using
-`M-' disable the template).
+(defvar global-mozadd-refresh-edited-on-save-mode nil "\
+Non-nil if Global-Mozadd-Refresh-Edited-On-Save mode is enabled.
+See the command `global-mozadd-refresh-edited-on-save-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-mozadd-refresh-edited-on-save-mode'.")
 
-A template can be aborted by using the `C-g' or by lefting empty the
-tempate prompt (in the minibuffer).
+(nxhtml-custom-autoload 'global-mozadd-refresh-edited-on-save-mode "../related/mozadd" nil)
 
-6.1 Customization
-=================
+(autoload 'global-mozadd-refresh-edited-on-save-mode "../related/mozadd" "\
+Toggle Mozadd-Refresh-Edited-On-Save mode in every possible buffer.
+With prefix ARG, turn Global-Mozadd-Refresh-Edited-On-Save mode on if and only if ARG is positive.
+Mozadd-Refresh-Edited-On-Save mode is enabled in all buffers where `(lambda nil (when (or (derived-mode-p (quote css-mode)) (mozadd-html-buffer-file-p)) (mozadd-refresh-edited-on-save-mode 1)))' would do it.
+See `mozadd-refresh-edited-on-save-mode' for more information on Mozadd-Refresh-Edited-On-Save mode.
 
-`smarty-electric-mode'
-     Type: boolean
-     Default value: `t'
-     Description: If `t'; enable automatic generation of template.
-     If `nil'; template generators can still be invoked through key
-     bindings and menu. Is indicated in the modeline by \"/e\" after
-     the mode name and can be toggled by `smarty-electric-mode'.
+\(fn &optional ARG)" t nil)
 
-For a complete description of the template customizable variables,
-see *Note Cu01-Pa01-Template::
+(autoload 'mozadd-mirror-mode "../related/mozadd" "\
+Mirror content of current file buffer immediately in Firefox.
+When you turn on this mode the file will be opened in Firefox.
+Every change you make in the buffer will trigger a redraw in
+Firefox - regardless of if you save the file or not.
 
-6.2 Functions
-=============
+For the mirroring to work the edited file must be shown in
+Firefox and visible.
 
-6.2.1 Smarty Functions
-----------------------
+If `nxml-where-mode' is on the marks will also be shown in
+Firefox as CSS outline style.  You can customize the style
+through the option `mozadd-xml-path-outline-style'.
 
-For Smarty functions, see PDF or HTML documentation.
+See also `mozadd-refresh-edited-on-save-mode'.
 
-6.2.2 Non-Smarty Functions
---------------------------
+\(fn &optional ARG)" t nil)
 
-`smarty-template-header'
-     Menu: Smarty -> Templates -> Insert Header
-     Keybinding: `C-c C-t C-h'
-     Description: This function is used to insert a header in the
-     current buffer.
+(defvar global-mozadd-mirror-mode nil "\
+Non-nil if Global-Mozadd-Mirror mode is enabled.
+See the command `global-mozadd-mirror-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-mozadd-mirror-mode'.")
 
-`smarty-template-footer'
-     Menu: Smarty -> Templates -> Insert Footer
-     Keybinding: `C-c C-t C-f'
-     Description: This function is used to insert a footer in the
-     current buffer.
+(nxhtml-custom-autoload 'global-mozadd-mirror-mode "../related/mozadd" nil)
 
-`smarty-template-insert-date'
-     Menu: Smarty -> Templates -> Insert Date
-     Keybinding: `C-c C-t C-d i'
-     Description: This function is used to insert the date in the
-     current buffer.
+(autoload 'global-mozadd-mirror-mode "../related/mozadd" "\
+Toggle Mozadd-Mirror mode in every possible buffer.
+With prefix ARG, turn Global-Mozadd-Mirror mode on if and only if ARG is positive.
+Mozadd-Mirror mode is enabled in all buffers where `(lambda nil (when (mozadd-html-buffer-file-p) (mozadd-mirror-mode 1)))' would do it.
+See `mozadd-mirror-mode' for more information on Mozadd-Mirror mode.
 
-`smarty-template-modify'
-     Menu: Smarty -> Templates -> Modify Date
-     Keybinding: `C-c C-t C-d m'
-     Description: This function is used to modify the last
-     modification date in the current buffer.
+\(fn &optional ARG)" t nil)
 
-7 Bugs, Help
-************
+;;;***
+
+;;;### (autoloads (php-mode php-file-patterns) "../related/php-mode"
+;;;;;;  "related/php-mode.el" (19032 52516))
+;;; Generated autoloads from related/php-mode.el
 
-   * To report bugs: Bugtracker
-     (http://bugtracker.morinie.fr/lisp/set_project.php?project_id=2)
+(defvar php-file-patterns '("\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'") "\
+List of file patterns for which to automatically invoke `php-mode'.")
 
-   * To obtain help you can post on the dedicated forum: Forum
-     (http://forum.morinie.fr/lisp/)
+(nxhtml-custom-autoload 'php-file-patterns "../related/php-mode" nil)
 
-8 Key bindings
-**************
+(autoload 'php-mode "../related/php-mode" "\
+Major mode for editing PHP code.
 
-\\{smarty-mode-map}
+\\{php-mode-map}
 
 \(fn)" t nil)
 
 ;;;***
 
-;;;### (autoloads (smarty-mode) "../related/smarty-mode-vdebout"
-;;;;;;  "related/smarty-mode-vdebout.el" (18295 31440))
-;;; Generated autoloads from related/smarty-mode-vdebout.el
+;;;### (autoloads (smarty-mode) "../related/smarty-mode" "related/smarty-mode.el"
+;;;;;;  (19039 48498))
+;;; Generated autoloads from related/smarty-mode.el
 
-(autoload 'smarty-mode "../related/smarty-mode-vdebout" "\
+(autoload 'smarty-mode "../related/smarty-mode" "\
 Smarty Mode
 ***********
 
@@ -911,6 +657,10 @@ Features (new features in bold) :
         - Variable Modifiers
 
         - Plugin (Functions)
+             * BlockRepeatPlugin
+
+             * ClipCache
+
              * Smarty Formtool
 
              * Smarty Paginate
@@ -928,7 +678,7 @@ Features (new features in bold) :
 
 
 
-This manual describes Smarty Mode version 0.0.4.
+This manual describes Smarty Mode version 0.0.5.
 
 2 Installation
 **************
@@ -957,12 +707,12 @@ installed.
 
 Two internet address to download Smarty Mode :
 
-   * Principal: Smarty-Mode 0.0.4
-     (http://deboutv.free.fr/lisp/smarty/download/smarty-0.0.4.tar.gz)
+   * Principal: Smarty-Mode 0.0.5
+     (http://deboutv.free.fr/lisp/smarty/download/smarty-0.0.5.tar.gz)
      (http://deboutv.free.fr/lisp/smarty/)
 
-   * Secondary: Smarty-Mode 0.0.4
-     (http://www.morinie.fr/lisp/smarty/download/smarty-0.0.4.tar.gz)
+   * Secondary: Smarty-Mode 0.0.5
+     (http://www.morinie.fr/lisp/smarty/download/smarty-0.0.5.tar.gz)
      (http://www.morinie.fr/lisp/smarty/)
 
    * Old releases: Smarty-Mode
@@ -984,7 +734,7 @@ installation directory.
 
 Example:
      cd /usr/local/share/lisp
-     tar zxvf smarty-0.0.4.tar.gz
+     tar zxvf smarty-0.0.5.tar.gz
 Now you have a `smarty' directory in the installation directory. This
 directory contains 2 files `smarty-mode.el' and `smarty-mode.elc' and
 another directory `docs' containing the documentation.
@@ -1007,7 +757,7 @@ directory to remove the old release.
 Example:
      cd /usr/local/share/lisp
      rm -rf smarty
-     tar zxvf smarty-0.0.4.tar.gz
+     tar zxvf smarty-0.0.5.tar.gz
 
 2.4 Invoke Smarty-Mode
 ======================
@@ -1382,7 +1132,7 @@ Major mode for editing Template Toolkit files.
 
 ;;;### (autoloads (wikipedia-draft-buffer wikipedia-draft-page wikipedia-draft
 ;;;;;;  wikipedia-mode) "../related/wikipedia-mode" "related/wikipedia-mode.el"
-;;;;;;  (18401 44650))
+;;;;;;  (18790 45400))
 ;;; Generated autoloads from related/wikipedia-mode.el
 
 (autoload 'wikipedia-mode "../related/wikipedia-mode" "\
@@ -1488,7 +1238,7 @@ wikipedia-draft-data-file.
 ;;;***
 
 ;;;### (autoloads (ert-run-tests-interactively ert-deftest) "../tests/ert"
-;;;;;;  "tests/ert.el" (18614 1898))
+;;;;;;  "tests/ert.el" (18775 60002))
 ;;; Generated autoloads from tests/ert.el
 
 (autoload 'ert-deftest "../tests/ert" "\
@@ -1504,7 +1254,7 @@ Run the tests specified by SELECTOR and display the results in a buffer.
 ;;;***
 
 ;;;### (autoloads (nxhtmltest-run-Q) "../tests/nxhtmltest-Q" "tests/nxhtmltest-Q.el"
-;;;;;;  (18762 63688))
+;;;;;;  (18781 14068))
 ;;; Generated autoloads from tests/nxhtmltest-Q.el
 
 (autoload 'nxhtmltest-run-Q "../tests/nxhtmltest-Q" "\
@@ -1516,7 +1266,7 @@ See `nxhtmltest-run' for more information about the tests.
 ;;;***
 
 ;;;### (autoloads (nxhtmltest-run nxhtmltest-run-indent) "../tests/nxhtmltest-suites"
-;;;;;;  "tests/nxhtmltest-suites.el" (18764 7444))
+;;;;;;  "tests/nxhtmltest-suites.el" (19062 23630))
 ;;; Generated autoloads from tests/nxhtmltest-suites.el
 
 (autoload 'nxhtmltest-run-indent "../tests/nxhtmltest-suites" "\
@@ -1536,11 +1286,24 @@ fail (they corresponds to known errors in nXhtml/Emacs):
 
 \(fn)" t nil)
 
+;;;***
+
+;;;### (autoloads (appmenu-add) "appmenu" "util/appmenu.el" (18977
+;;;;;;  25246))
+;;; Generated autoloads from util/appmenu.el
+
+(autoload 'appmenu-add "appmenu" "\
+Add entry to `appmenu-alist'.
+Add an entry to this list with ID, PRIORITY, TEST, TITLE and
+DEFINITION as explained there.
+
+\(fn ID PRIORITY TEST TITLE DEFINITION)" nil nil)
+
 ;;;***
 
 ;;;### (autoloads (as-external-mode as-external-for-wiki as-external-for-mail
 ;;;;;;  as-external-for-xhtml) "as-external" "util/as-external.el"
-;;;;;;  (18686 30854))
+;;;;;;  (19063 48015))
 ;;; Generated autoloads from util/as-external.el
 
 (autoload 'as-external-for-xhtml "as-external" "\
@@ -1586,24 +1349,529 @@ Setting this variable directly does not take effect;
 either customize it (see the info node `Easy Customization')
 or call the function `as-external-mode'.")
 
-(custom-autoload 'as-external-mode "as-external" nil)
+(nxhtml-custom-autoload 'as-external-mode "as-external" nil)
+
+(autoload 'as-external-mode "as-external" "\
+If non-nil check if Emacs is called as external editor.
+When Emacs is called as an external editor for example to edit
+text areas on a web page viewed with Firefox this library tries
+to help to setup the buffer in a useful way. It may for example
+set major and minor modes for the buffer.
+
+This can for example be useful when blogging or writing comments
+on blogs.
+
+See `as-external-alist' for more information.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (chart-make-chart chart-complete) "chart" "util/chart.el"
+;;;;;;  (19063 39536))
+;;; Generated autoloads from util/chart.el
+
+(autoload 'chart-complete "chart" "\
+Not documented
+
+\(fn)" t nil)
+
+(autoload 'chart-make-chart "chart" "\
+Try to make a new chart.
+If region is active then make a new chart from data in the
+selected region.
+
+Else if current buffer is in `chart-mode' then do it from the
+chart specifications in this buffer.  Otherwise create a new
+buffer and initialize it with `chart-mode'.
+
+If the chart specifications are complete enough to make a chart
+then do it and show the resulting chart image.  If not then tell
+user what is missing.
+
+NOTE: This is beta, no alpha code. It is not ready.
+
+Below are some examples.  To test them mark an example and do
+
+  M-x chart-make-chart
+
+* Example, simple x-y chart:
+
+  Output-file: \"~/temp-chart.png\"
+  Size: 200 200
+  Data: 3 8 5 | 10 20 30
+  Type: line-chart-xy
+
+* Example, pie:
+
+  Output-file: \"~/temp-depression.png\"
+  Size: 400 200
+  Data:
+  2,160,000
+  3,110,000
+  1,510,000
+  73,600
+  775,000
+  726,000
+  8,180,000
+  419,000
+  Type: pie-3-dimensional
+  Chart-title: \"Depression hits on Google\"
+  Legends:
+  \"SSRI\"
+  | \"Psychotherapy\"
+  | \"CBT\"
+  | \"IPT\"
+  | \"Psychoanalysis\"
+  | \"Mindfulness\"
+  | \"Meditation\"
+  | \"Exercise\"
+
+
+* Example, pie:
+
+  Output-file: \"~/temp-panic.png\"
+  Size: 400 200
+  Data:
+  979,000
+  969,000
+  500,000
+  71,900
+  193,000
+  154,000
+  2,500,000
+  9,310,000
+  Type: pie-3-dimensional
+  Chart-title: \"Depression hits on Google\"
+  Legends:
+  \"SSRI\"
+  | \"Psychotherapy\"
+  | \"CBT\"
+  | \"IPT\"
+  | \"Psychoanalysis\"
+  | \"Mindfulness\"
+  | \"Meditation\"
+  | \"Exercise\"
+
+
+* Example using raw:
+
+  Output-file: \"~/temp-chart-slipsen-kostar.png\"
+  Size: 400 130
+  Data: 300 1000 30000
+  Type: bar-chart-horizontal
+  Chart-title: \"Vad killen i slips tjänar jämfört med dig och mig\"
+  Google-chart-raw: \"&chds=0,30000&chco=00cd00|ff4500|483d8b&chxt=y,x&chxl=0:|Killen+i+slips|Partiledarna|Du+och+jag&chf=bg,s,ffd700\"
+
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (global-company-mode company-mode) "company-mode/company"
+;;;;;;  "util/company-mode/company.el" (19063 31164))
+;;; Generated autoloads from util/company-mode/company.el
+
+(autoload 'company-mode "company-mode/company" "\
+\"complete anything\"; in in-buffer completion framework.
+Completion starts automatically, depending on the values
+`company-idle-delay' and `company-minimum-prefix-length'.
+
+Completion can be controlled with the commands:
+`company-complete-common', `company-complete-selection', `company-complete',
+`company-select-next', `company-select-previous'.  If these commands are
+called before `company-idle-delay', completion will also start.
+
+Completions can be searched with `company-search-candidates' or
+`company-filter-candidates'.  These can be used while completion is
+inactive, as well.
+
+The completion data is retrieved using `company-backends' and displayed using
+`company-frontends'.  If you want to start a specific back-end, call it
+interactively or use `company-begin-backend'.
+
+regular keymap (`company-mode-map'):
+
+\\{company-mode-map}
+keymap during active completions (`company-active-map'):
+
+\\{company-active-map}
+
+\(fn &optional ARG)" t nil)
+
+(defvar global-company-mode nil "\
+Non-nil if Global-Company mode is enabled.
+See the command `global-company-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-company-mode'.")
+
+(nxhtml-custom-autoload 'global-company-mode "company-mode/company" nil)
+
+(autoload 'global-company-mode "company-mode/company" "\
+Toggle Company mode in every possible buffer.
+With prefix ARG, turn Global-Company mode on if and only if ARG is positive.
+Company mode is enabled in all buffers where `(lambda nil (when (catch (quote cm) (dolist (mode company-major-modes) (when (derived-mode-p mode) (throw (quote cm) t)))) (company-mode 1)))' would do it.
+See `company-mode' for more information on Company mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-abbrev) "company-mode/company-abbrev"
+;;;;;;  "util/company-mode/company-abbrev.el" (19039 49090))
+;;; Generated autoloads from util/company-mode/company-abbrev.el
+
+(autoload 'company-abbrev "company-mode/company-abbrev" "\
+A `company-mode' completion back-end for abbrev.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-css) "company-mode/company-css" "util/company-mode/company-css.el"
+;;;;;;  (19048 2102))
+;;; Generated autoloads from util/company-mode/company-css.el
+
+(autoload 'company-css "company-mode/company-css" "\
+A `company-mode' completion back-end for `css-mode'.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-dabbrev) "company-mode/company-dabbrev"
+;;;;;;  "util/company-mode/company-dabbrev.el" (19039 49092))
+;;; Generated autoloads from util/company-mode/company-dabbrev.el
+
+(autoload 'company-dabbrev "company-mode/company-dabbrev" "\
+A dabbrev-like `company-mode' completion back-end.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-dabbrev-code) "company-mode/company-dabbrev-code"
+;;;;;;  "util/company-mode/company-dabbrev-code.el" (19039 49092))
+;;; Generated autoloads from util/company-mode/company-dabbrev-code.el
+
+(autoload 'company-dabbrev-code "company-mode/company-dabbrev-code" "\
+A dabbrev-like `company-mode' back-end for code.
+The back-end looks for all symbols in the current buffer that aren't in
+comments or strings.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-elisp) "company-mode/company-elisp" "util/company-mode/company-elisp.el"
+;;;;;;  (19039 49092))
+;;; Generated autoloads from util/company-mode/company-elisp.el
+
+(autoload 'company-elisp "company-mode/company-elisp" "\
+A `company-mode' completion back-end for `emacs-lisp-mode'.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-etags) "company-mode/company-etags" "util/company-mode/company-etags.el"
+;;;;;;  (19039 49092))
+;;; Generated autoloads from util/company-mode/company-etags.el
+
+(autoload 'company-etags "company-mode/company-etags" "\
+A `company-mode' completion back-end for etags.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-files) "company-mode/company-files" "util/company-mode/company-files.el"
+;;;;;;  (19039 49092))
+;;; Generated autoloads from util/company-mode/company-files.el
+
+(autoload 'company-files "company-mode/company-files" "\
+a `company-mode' completion back-end existing file names.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-gtags) "company-mode/company-gtags" "util/company-mode/company-gtags.el"
+;;;;;;  (19039 49092))
+;;; Generated autoloads from util/company-mode/company-gtags.el
+
+(autoload 'company-gtags "company-mode/company-gtags" "\
+A `company-mode' completion back-end for GNU Global.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-ispell) "company-mode/company-ispell"
+;;;;;;  "util/company-mode/company-ispell.el" (19039 49092))
+;;; Generated autoloads from util/company-mode/company-ispell.el
+
+(autoload 'company-ispell "company-mode/company-ispell" "\
+A `company-mode' completion back-end using ispell.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-keywords) "company-mode/company-keywords"
+;;;;;;  "util/company-mode/company-keywords.el" (19039 49092))
+;;; Generated autoloads from util/company-mode/company-keywords.el
+
+(autoload 'company-keywords "company-mode/company-keywords" "\
+A `company-mode' back-end for programming language keywords.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-choose) "company-mode/company-nograb"
+;;;;;;  "util/company-mode/company-nograb.el" (19045 31314))
+;;; Generated autoloads from util/company-mode/company-nograb.el
+
+(autoload 'company-choose "company-mode/company-nograb" "\
+Not documented
+
+\(fn CANDIDATES)" nil nil)
+
+;;;***
+
+;;;### (autoloads (company-nxml) "company-mode/company-nxml" "util/company-mode/company-nxml.el"
+;;;;;;  (19039 49092))
+;;; Generated autoloads from util/company-mode/company-nxml.el
+
+(autoload 'company-nxml "company-mode/company-nxml" "\
+A `company-mode' completion back-end for `nxml-mode'.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-oddmuse) "company-mode/company-oddmuse"
+;;;;;;  "util/company-mode/company-oddmuse.el" (19039 49092))
+;;; Generated autoloads from util/company-mode/company-oddmuse.el
+
+(autoload 'company-oddmuse "company-mode/company-oddmuse" "\
+A `company-mode' completion back-end for `oddmuse-mode'.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-predictive) "company-mode/company-predictive"
+;;;;;;  "util/company-mode/company-predictive.el" (19060 15106))
+;;; Generated autoloads from util/company-mode/company-predictive.el
+
+(autoload 'company-predictive "company-mode/company-predictive" "\
+A predictive-like `company-mode' completion back-end.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-pysmell) "company-mode/company-pysmell"
+;;;;;;  "util/company-mode/company-pysmell.el" (19040 9010))
+;;; Generated autoloads from util/company-mode/company-pysmell.el
+
+(autoload 'company-pysmell "company-mode/company-pysmell" "\
+A `company-mode' completion back-end for pysmell.
+This requires pysmell.el and pymacs.el.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-semantic) "company-mode/company-semantic"
+;;;;;;  "util/company-mode/company-semantic.el" (19061 60296))
+;;; Generated autoloads from util/company-mode/company-semantic.el
+
+(autoload 'company-semantic "company-mode/company-semantic" "\
+A `company-mode' completion back-end using CEDET Semantic.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-tempo) "company-mode/company-tempo" "util/company-mode/company-tempo.el"
+;;;;;;  (19039 49092))
+;;; Generated autoloads from util/company-mode/company-tempo.el
+
+(autoload 'company-tempo "company-mode/company-tempo" "\
+A `company-mode' completion back-end for tempo.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (company-xcode) "company-mode/company-xcode" "util/company-mode/company-xcode.el"
+;;;;;;  (19039 49092))
+;;; Generated autoloads from util/company-mode/company-xcode.el
+
+(autoload 'company-xcode "company-mode/company-xcode" "\
+A `company-mode' completion back-end for Xcode projects.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+;;;***
+
+;;;### (autoloads (css-color-mode css-color-global-mode css-color)
+;;;;;;  "css-color" "util/css-color.el" (18969 63118))
+;;; Generated autoloads from util/css-color.el
+
+(let ((loads (get 'css-color 'custom-loads))) (if (member '"css-color" loads) nil (put 'css-color 'custom-loads (cons '"css-color" loads))))
+
+(defvar css-color-global-mode nil "\
+Non-nil if Css-Color-Global mode is enabled.
+See the command `css-color-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `css-color-global-mode'.")
+
+(nxhtml-custom-autoload 'css-color-global-mode "css-color" nil)
+
+(autoload 'css-color-global-mode "css-color" "\
+Toggle Css-Color mode in every possible buffer.
+With prefix ARG, turn Css-Color-Global mode on if and only if ARG is positive.
+Css-Color mode is enabled in all buffers where `css-color-turn-on-in-buffer' would do it.
+See `css-color-mode' for more information on Css-Color mode.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'css-color-mode "css-color" "\
+Show hex color literals with the given color as background.
+In this mode hexadecimal colour specifications like #3253ff are
+displayed with the specified colour as background.
+
+Certain keys are bound to special colour editing commands when
+point is at a hexadecimal colour:
+
+\\{css-color-map}
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (css-palette-global-mode css-palette css-palette-mode)
+;;;;;;  "css-palette" "util/css-palette.el" (18795 27308))
+;;; Generated autoloads from util/css-palette.el
+
+(autoload 'css-palette-mode "css-palette" "\
+Minor mode for palettes in CSS.
+
+The mode `css-palette-mode' acts on the first COLORS declaration in your
+  file of the form:
+
+COLORS:
+\(
+c0 \"#6f5d25\"	;tainted sand
+c1 \"#000000\"	;Black
+c2 \"#cca42b\"	;goldenslumber
+c3 \"#6889cb\"	;far off sky
+c4 \"#fff\"	;strange aeons
+)
+
+Such declarations should appear inside a block comment, in order
+  to be parsed properly by the LISP reader.
+
+Type \\[css-palette-update-all], and any occurence of
+
+  color: #f55; /*[c3]*/
+
+will be updated with
+
+  color: #6899cb; /*[c3]*/
+
+The following commands are available to insert key-value pairs
+  and palette declarations:
+  \\{css-palette-mode-map}
+
+You can extend or redefine the types of palettes by defining a
+  new palette specification of the form (PATTERN REGEXP
+  REF-FOLLOWS-VALUE), named according to the naming scheme
+  css-palette:my-type, where
+
+PATTERN is a pattern containing two (%s) format directives which
+  will be filled in with the variable and its value,
+
+REGEXP is a regular expression to match a value - variable
+  pattern,
+
+and REF-FOLLOWS-VALUE defined whether or not the reference comes
+  after the value. This allows for more flexibility.
+
+Note that, although the w3c spec at URL
+  `http://www.w3.org/TR/CSS2/syndata.html#comments' says that
+  comments \" may occur anywhere between tokens, and their
+  contents have no influence on the rendering\", Internet
+  Explorer does not think so. Better keep all your comments after
+  a \"statement\", as per the default. This means `css-palette'
+  is ill-suited for use within shorthands.
+
+See variable `css-palette:colors' for an example of a palette
+  type.
+
+The extension mechanism means that palette types can be used to
+  contain arbitrary key-value mappings.
+
+Besides the colors palette, css-palette defines the palette
+  definition variables `css-palette:colors-outside' and
+  `css-palette:files', for colors with the reference outside and
+  for file url()'s respectively.
+
+You can fine-control which palette types css-palette should look
+  at via the variable `css-palette-types'.
+
+\(fn &optional ARG)" t nil)
+
+(let ((loads (get 'css-palette 'custom-loads))) (if (member '"css-palette" loads) nil (put 'css-palette 'custom-loads (cons '"css-palette" loads))))
+
+(defvar css-palette-global-mode nil "\
+Non-nil if Css-Palette-Global mode is enabled.
+See the command `css-palette-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `css-palette-global-mode'.")
+
+(nxhtml-custom-autoload 'css-palette-global-mode "css-palette" nil)
+
+(autoload 'css-palette-global-mode "css-palette" "\
+Toggle Css-Palette mode in every possible buffer.
+With prefix ARG, turn Css-Palette-Global mode on if and only if ARG is positive.
+Css-Palette mode is enabled in all buffers where `css-palette-turn-on-in-buffer' would do it.
+See `css-palette-mode' for more information on Css-Palette mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (cusnu-export-my-skin-options customize-for-new-user)
+;;;;;;  "cus-new-user" "util/cus-new-user.el" (19061 60294))
+;;; Generated autoloads from util/cus-new-user.el
 
-(autoload 'as-external-mode "as-external" "\
-If non-nil check for if Emacs is used as external editor.
-When Emacs is used as an external editor for example to edit text
-areas on a web page viewed with Firefox this library tries to
-help to setup the buffer in a useful way. It may for example set
-major and minor modes for the buffer.
+(autoload 'customize-for-new-user "cus-new-user" "\
+Show special customization page for new user.
 
-See `as-external-alist' for more information.
+\(fn &optional NAME)" t nil)
 
-\(fn &optional ARG)" t nil)
+(autoload 'cusnu-export-my-skin-options "cus-new-user" "\
+Export to file FILE custom options in `cusnu-my-skin-options'.
+The options is exported to elisp code that other users can run to
+set the options that you have added to `cusnu-my-skin-options'.
+
+For more information about this see `cusnu-export-cust-group'.
+
+\(fn FILE)" t nil)
 
 ;;;***
 
 ;;;### (autoloads (freemind-to-org-mode freemind-from-org-sparse-tree
 ;;;;;;  freemind-from-org-mode freemind-from-org-mode-node freemind-show)
-;;;;;;  "freemind" "util/freemind.el" (18659 17016))
+;;;;;;  "freemind" "util/freemind.el" (19063 39026))
 ;;; Generated autoloads from util/freemind.el
 
 (autoload 'freemind-show "freemind" "\
@@ -1652,10 +1920,65 @@ Not documented
 
 \(fn FILE-NAME)" nil nil)
 
+;;;***
+
+;;;### (autoloads (gpl-mode) "gpl" "util/gpl.el" (18795 27308))
+;;; Generated autoloads from util/gpl.el
+
+(autoload 'gpl-mode "gpl" "\
+Mode for font-locking and editing color palettes of the GPL format.
+
+Such palettes are used and produced by free software applications
+such as the GIMP, Inkscape, Scribus, Agave and on-line tools such
+as http://colourlovers.com.
+
+You can also use
+URL `http://niels.kicks-ass.org/public/elisp/css-palette.el' to import
+such palette into a css-file as hexadecimal color palette.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (hfyview-frame hfyview-window hfyview-region hfyview-buffer)
+;;;;;;  "hfyview" "util/hfyview.el" (19063 39203))
+;;; Generated autoloads from util/hfyview.el
+
+(autoload 'hfyview-buffer "hfyview" "\
+Convert buffer to html preserving faces and show in web browser.
+With command prefix also show created HTML source in other window.
+
+\(fn ARG)" t nil)
+
+(autoload 'hfyview-region "hfyview" "\
+Convert region to html preserving faces and show in web browser.
+With command prefix also show created HTML source in other window.
+
+\(fn ARG)" t nil)
+
+(autoload 'hfyview-window "hfyview" "\
+Convert window to html preserving faces and show in web browser.
+With command prefix also show created HTML source in other window.
+
+\(fn ARG)" t nil)
+
+(autoload 'hfyview-frame "hfyview" "\
+Convert frame to html preserving faces and show in web browser.
+Make an XHTML view of the current Emacs frame. Put it in a buffer
+named *hfyview-frame* and show that buffer in a web browser.
+
+If WHOLE-BUFFERS is non-nil then the whole content of the buffers
+is shown in the XHTML page, otherwise just the part that is
+visible currently on the frame.
+
+With command prefix also show created HTML source in other window.
+
+\(fn WHOLE-BUFFERS)" t nil)
+
 ;;;***
 
 ;;;### (autoloads (html-write-mode) "html-write" "util/html-write.el"
-;;;;;;  (18692 35034))
+;;;;;;  (18790 45400))
 ;;; Generated autoloads from util/html-write.el
 
 (autoload 'html-write-mode "html-write" "\
@@ -1672,6 +1995,11 @@ rendered text.
 See the customization group `html-write' for more information about
 faces.
 
+The following keys are defined when you are on a tag handled by
+this minor mode:
+
+\\{html-write-keymap}
+
 IMPORTANT: Most commands you use works also on the text that is
 hidden.  The movement commands is an exception, but as soon as
 you edit the buffer you may also change the hidden parts.
@@ -1680,11 +2008,88 @@ you edit the buffer you may also change the hidden parts.
 
 ;;;***
 
-;;;### (autoloads (majmodpri-apply-priorities majmodpri-sort-lists
-;;;;;;  majmodpri) "majmodpri" "util/majmodpri.el" (18654 33920))
-;;; Generated autoloads from util/majmodpri.el
+;;;### (autoloads (htmlfontify-buffer) "htmlfontify" "util/htmlfontify.el"
+;;;;;;  (18790 45400))
+;;; Generated autoloads from util/htmlfontify.el
 
-(let ((loads (get 'majmodpri 'custom-loads))) (if (member '"majmodpri" loads) nil (put 'majmodpri 'custom-loads (cons '"majmodpri" loads))))
+(autoload 'htmlfontify-buffer "htmlfontify" "\
+Create a new buffer, named for the current buffer + a .html extension,
+containing an inline css-stylesheet and formatted css-markup html
+that reproduces the look of the current emacs buffer as closely
+as possible.
+
+Dangerous characters in the existing buffer are turned into html
+entities, so you should even be able to do html-within-html
+fontified display.
+
+You should, however, note that random control or eight-bit
+characters such as ^L () or ¤ (\244) won't get mapped yet.
+
+If the SRCDIR and FILE arguments are set, lookup etags derived
+entries in the `hfy-tags-cache' and add html anchors and
+hyperlinks as appropriate.
+
+\(fn &optional SRCDIR FILE)" t nil)
+
+;;;***
+
+;;;### (autoloads (inlimg-toggle-slicing inlimg-toggle-display inlimg-global-mode
+;;;;;;  inlimg-mode) "inlimg" "util/inlimg.el" (19045 31314))
+;;; Generated autoloads from util/inlimg.el
+
+(autoload 'inlimg-mode "inlimg" "\
+Display images inline.
+Search buffer for image tags.  Display found images.
+
+Image tags are setup per major mode in `inlimg-mode-specs'.
+
+Images are displayed on a line below the tag referencing them.
+The whole image or a slice of it may be displayed, see
+`inlimg-slice'.  Margins relative text are specified in
+`inlimg-margins'.
+
+See also the commands `inlimg-toggle-display' and
+`inlimg-toggle-slicing'.
+
+Note: This minor mode uses `font-lock-mode'.
+
+\(fn &optional ARG)" t nil)
+
+(defvar inlimg-global-mode nil "\
+Non-nil if Inlimg-Global mode is enabled.
+See the command `inlimg-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `inlimg-global-mode'.")
+
+(nxhtml-custom-autoload 'inlimg-global-mode "inlimg" nil)
+
+(autoload 'inlimg-global-mode "inlimg" "\
+Toggle Inlimg mode in every possible buffer.
+With prefix ARG, turn Inlimg-Global mode on if and only if ARG is positive.
+Inlimg mode is enabled in all buffers where `inlimg--global-turn-on' would do it.
+See `inlimg-mode' for more information on Inlimg mode.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'inlimg-toggle-display "inlimg" "\
+Toggle display of image at point POINT.
+See also the command `inlimg-mode'.
+
+\(fn POINT)" t nil)
+
+(autoload 'inlimg-toggle-slicing "inlimg" "\
+Toggle slicing of image at point POINT.
+See also the command `inlimg-mode'.
+
+\(fn POINT)" t nil)
+
+;;;***
+
+;;;### (autoloads (majmodpri majmodpri-apply-priorities majmodpri-apply
+;;;;;;  majmodpri-sort-lists) "majmodpri" "util/majmodpri.el" (19061
+;;;;;;  60294))
+;;; Generated autoloads from util/majmodpri.el
 
 (autoload 'majmodpri-sort-lists "majmodpri" "\
 Sort the list used when selecting major mode.
@@ -1699,6 +2104,14 @@ See also `majmodpri-apply-priorities'.
 
 \(fn)" t nil)
 
+(autoload 'majmodpri-apply "majmodpri" "\
+Sort major mode lists and apply to existing buffers.
+Note: This function is suitable to add to
+`desktop-after-read-hook'. It will restore the multi major modes
+in buffers.
+
+\(fn)" nil nil)
+
 (autoload 'majmodpri-apply-priorities "majmodpri" "\
 Apply major mode priorities.
 First run `majmodpri-sort-lists' and then if CHANGE-MODES is
@@ -1707,10 +2120,12 @@ before applying.
 
 \(fn CHANGE-MODES)" t nil)
 
+(let ((loads (get 'majmodpri 'custom-loads))) (if (member '"majmodpri" loads) nil (put 'majmodpri 'custom-loads (cons '"majmodpri" loads))))
+
 ;;;***
 
-;;;### (autoloads (mlinks-mode) "mlinks" "util/mlinks.el" (18685
-;;;;;;  3334))
+;;;### (autoloads (mlinks-mode) "mlinks" "util/mlinks.el" (19061
+;;;;;;  60296))
 ;;; Generated autoloads from util/mlinks.el
 
 (autoload 'mlinks-mode "mlinks" "\
@@ -1742,15 +2157,33 @@ By default the link moved to will be active, see
 
 \(fn &optional ARG)" t nil)
 
+;;;***
+
+;;;### (autoloads (mumamo-multi-major-modep mumamo-mark-for-refontification)
+;;;;;;  "mumamo" "util/mumamo.el" (19064 6796))
+;;; Generated autoloads from util/mumamo.el
+
+(autoload 'mumamo-mark-for-refontification "mumamo" "\
+Mark region between MIN and MAX for refontification.
+
+\(fn MIN MAX)" nil nil)
+
+(autoload 'mumamo-multi-major-modep "mumamo" "\
+Return t if VALUE is a multi major mode function.
+
+\(fn VALUE)" nil nil)
+
 ;;;***
 
 ;;;### (autoloads (mako-html-mumamo-mode org-mumamo-mode asp-html-mumamo-mode
 ;;;;;;  noweb2-mumamo-mode csound-sgml-mumamo-mode laszlo-nxml-mumamo-mode
-;;;;;;  metapost-mumamo-mode cperl-mumamo-mode perl-mumamo-mode eruby-html-mumamo-mode
-;;;;;;  eruby-mumamo-mode jsp-html-mumamo-mode smarty-html-mumamo-mode
-;;;;;;  mjt-html-mumamo-mode genshi-html-mumamo-mode django-html-mumamo-mode
-;;;;;;  embperl-html-mumamo-mode nxml-mumamo-mode html-mumamo-mode)
-;;;;;;  "mumamo-fun" "util/mumamo-fun.el" (18764 14316))
+;;;;;;  metapost-mumamo-mode ruby-heredoc-mumamo-mode python-heredoc-mumamo-mode
+;;;;;;  cperl-heredoc-mumamo-mode perl-heredoc-mumamo-mode php-heredoc-mumamo-mode
+;;;;;;  sh-heredoc-mumamo-mode eruby-html-mumamo-mode eruby-mumamo-mode
+;;;;;;  jsp-html-mumamo-mode smarty-html-mumamo-mode mjt-html-mumamo-mode
+;;;;;;  genshi-html-mumamo-mode django-html-mumamo-mode embperl-html-mumamo-mode
+;;;;;;  nxml-mumamo-mode html-mumamo-mode) "mumamo-fun" "util/mumamo-fun.el"
+;;;;;;  (19061 60296))
 ;;; Generated autoloads from util/mumamo-fun.el
 
 (autoload 'html-mumamo-mode "mumamo-fun" "\
@@ -1759,7 +2192,9 @@ This covers inlined style and javascript and PHP." t)
 
 (autoload 'nxml-mumamo-mode "mumamo-fun" "\
 Turn on multiple major modes for (X)HTML with main mode `nxml-mode'.
-This covers inlined style and javascript and PHP." t)
+This covers inlined style and javascript and PHP.
+
+See also `mumamo-alt-php-tags-mode'." t)
 
 (autoload 'embperl-html-mumamo-mode "mumamo-fun" "\
 Turn on multiple major modes for Embperl files with main mode `html-mode'.
@@ -1802,11 +2237,32 @@ Current major-mode will be used as the main major mode." t)
 Turn on multiple major modes for eRuby with main mode `html-mode'.
 This also covers inlined style and javascript." t)
 
-(autoload 'perl-mumamo-mode "mumamo-fun" "\
-Turn on multiple major modes for Perl Here Document." t)
+(autoload 'sh-heredoc-mumamo-mode "mumamo-fun" "\
+Turn on multiple major modes for sh heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(autoload 'php-heredoc-mumamo-mode "mumamo-fun" "\
+Turn on multiple major modes for PHP heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(autoload 'perl-heredoc-mumamo-mode "mumamo-fun" "\
+Turn on multiple major modes for Perl heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(autoload 'cperl-heredoc-mumamo-mode "mumamo-fun" "\
+Turn on multiple major modes for Perl heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes.
 
-(autoload 'cperl-mumamo-mode "mumamo-fun" "\
-Turn on multiple major modes for Perl Here Document." t)
+Note: I have seen some problems with this.  Use
+`perl-mumamo-mode' instead for now." t)
+
+(autoload 'python-heredoc-mumamo-mode "mumamo-fun" "\
+Turn on multiple major modes for Perl heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(autoload 'ruby-heredoc-mumamo-mode "mumamo-fun" "\
+Turn on multiple major modes for Ruby heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
 
 (autoload 'metapost-mumamo-mode "mumamo-fun" "\
 Turn on multiple major modes for MetaPost." t)
@@ -1835,17 +2291,80 @@ This also covers inlined style and javascript." t)
 
 ;;;***
 
-;;;### (autoloads (info-open-file grep-query-replace emacs-Q-nxhtml
-;;;;;;  emacs-Q emacs--debug-init emacs-buffer-file emacs ourcomments-ido-buffer-raise-frame
+;;;### (autoloads (mumamo-add-region) "mumamo-regions" "util/mumamo-regions.el"
+;;;;;;  (19056 34298))
+;;; Generated autoloads from util/mumamo-regions.el
+
+(autoload 'mumamo-add-region "mumamo-regions" "\
+Add a mumamo region.
+Mumamo regions are like another layer of chunks above the normal chunks.
+They does not affect the normal chunks, but they overrides them.
+
+To create a mumamo region first select a visible region and then
+call this function.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (n-back-game) "n-back" "util/n-back.el" (19063
+;;;;;;  38663))
+;;; Generated autoloads from util/n-back.el
+
+(autoload 'n-back-game "n-back" "\
+Emacs n-Back game.
+This game is supposed to increase your working memory and fluid
+intelligence.
+
+In this game something is shown for half a second on the screen
+and maybe a sound is played.  You should then answer if parts of
+it is the same as you have seen or heard before.  This is
+repeated for about 20 trials.
+
+You answer with the keys shown in the bottom window.
+
+In the easiest version of the game you should answer if you have
+just seen or heard what is shown now.  By default the game gets
+harder as you play it with success.  Then first the number of
+items presented in a trial grows.  After that it gets harder by
+that you have to somehow remember not the last item, but the item
+before that (or even earlier). That is what \"n-Back\" stands
+for.
+
+Note that remember does not really mean remember clearly.  The
+game is for training your brain getting used to keep those things
+in the working memory, maybe as a cross-modal unit.  You are
+supposed to just nearly be able to do what you do in the game.
+And you are supposed to have fun, that is what your brain like.
+
+You should probably not overdue this. Half an hour a day playing
+might be an optimal time according to some people.
+
+The game is shamelessly modeled after Brain Workshop, see URL
+`http://brainworkshop.sourceforge.net/' just for the fun of
+getting it into Emacs.  The game resembles but it not the same as
+that used in the report by Jaeggi mentioned at the above URL.
+
+Not all features in Brain Workshop are implemented here, but some
+new are maybe ... - and you have it available here in Emacs.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (ourcomments-warning ourcomments-M-x-menu-mode
+;;;;;;  use-custom-style info-open-file grep-query-replace emacs-Q-nxhtml
+;;;;;;  emacs-Q emacs--no-desktop emacs--debug-init emacs-buffer-file
+;;;;;;  emacs emacs-restart ourcomments-ido-ctrl-tab ourcomments-ido-buffer-raise-frame
 ;;;;;;  ourcomments-ido-buffer-other-frame ourcomments-ido-buffer-other-window
 ;;;;;;  describe-symbol describe-defstruct describe-custom-group
-;;;;;;  describe-command ourcomments-ediff-files find-emacs-other-file
-;;;;;;  better-fringes-mode wrap-to-fill-column-mode wrap-to-fill-left-marg-modes
-;;;;;;  wrap-to-fill-left-marg describe-key-and-map-briefly ourcomments-move-end-of-line
-;;;;;;  ourcomments-move-beginning-of-line major-modep multi-major-modep
-;;;;;;  major-or-multi-majorp unfill-individual-paragraphs unfill-region
-;;;;;;  unfill-paragraph define-toggle popup-menu-at-point) "ourcomments-util"
-;;;;;;  "util/ourcomments-util.el" (18764 17429))
+;;;;;;  narrow-to-comment describe-command ourcomments-ediff-files
+;;;;;;  find-emacs-other-file better-fringes-mode wrap-to-fill-column-mode
+;;;;;;  wrap-to-fill-left-marg-modes wrap-to-fill-left-marg describe-key-and-map-briefly
+;;;;;;  ourcomments-move-end-of-line ourcomments-move-beginning-of-line
+;;;;;;  major-modep major-or-multi-majorp unfill-individual-paragraphs
+;;;;;;  unfill-region unfill-paragraph define-toggle popup-menu-at-point)
+;;;;;;  "ourcomments-util" "util/ourcomments-util.el" (19063 48876))
 ;;; Generated autoloads from util/ourcomments-util.el
 
 (autoload 'popup-menu-at-point "ourcomments-util" "\
@@ -1902,11 +2421,6 @@ Not documented
 
 \(fn VALUE)" nil nil)
 
-(autoload 'multi-major-modep "ourcomments-util" "\
-Return t if VALUE is a multi major mode function.
-
-\(fn VALUE)" nil nil)
-
 (autoload 'major-modep "ourcomments-util" "\
 Return t if VALUE is a major mode function.
 
@@ -1919,17 +2433,17 @@ A major mode lisp function." :complete-function (lambda nil (interactive) (lisp-
 Move point to beginning of line or indentation.
 See `beginning-of-line' for ARG.
 
-If `physical-line-mode' is on then the visual line beginning is
-first tried.
+If `line-move-visual' is non-nil then the visual line beginning
+is first tried.
 
 \(fn ARG)" t nil)
 
 (autoload 'ourcomments-move-end-of-line "ourcomments-util" "\
-Move point to end of line or indentation.
+Move point to end of line or after last non blank char.
 See `end-of-line' for ARG.
 
-If `physical-line-mode' is on then the visual line ending is
-first tried.
+Similar to `ourcomments-move-beginning-of-line' but for end of
+line.
 
 \(fn ARG)" t nil)
 
@@ -1953,12 +2467,12 @@ Used by `wrap-to-fill-column-mode'. If nil then center the
 display columns. Otherwise it should be a number which will be
 the left margin.")
 
-(custom-autoload 'wrap-to-fill-left-marg "ourcomments-util" t)
+(nxhtml-custom-autoload 'wrap-to-fill-left-marg "ourcomments-util" t)
 
 (defvar wrap-to-fill-left-marg-modes '(text-mode fundamental-mode) "\
 Major modes where `wrap-to-fill-left-margin' may be nil.")
 
-(custom-autoload 'wrap-to-fill-left-marg-modes "ourcomments-util" t)
+(nxhtml-custom-autoload 'wrap-to-fill-left-marg-modes "ourcomments-util" t)
 
 (autoload 'wrap-to-fill-column-mode "ourcomments-util" "\
 Use `fill-column' display columns in buffer windows.
@@ -1985,7 +2499,7 @@ Setting this variable directly does not take effect;
 either customize it (see the info node `Easy Customization')
 or call the function `better-fringes-mode'.")
 
-(custom-autoload 'better-fringes-mode "ourcomments-util" nil)
+(nxhtml-custom-autoload 'better-fringes-mode "ourcomments-util" nil)
 
 (autoload 'better-fringes-mode "ourcomments-util" "\
 Choose another fringe bitmap color and bottom angle.
@@ -2010,7 +2524,13 @@ In directory DEF-DIR run `ediff-files' on files FILE-A and FILE-B.
 The purpose of this function is to make it eaiser to start
 `ediff-files' from a shell through Emacs Client.
 
-This is used in EmacsW32 in the file ediff.cmd.
+This is used in EmacsW32 in the file ediff.cmd where Emacs Client
+is called like this:
+
+  @%emacs_client% -e \"(setq default-directory \\\"%emacs_cd%\\\")\"
+  @%emacs_client% -n  -e \"(ediff-files \\\"%f1%\\\" \\\"%f2%\\\")\"
+
+It can of course be done in a similar way with other shells.
 
 \(fn DEF-DIR FILE-A FILE-B)" nil nil)
 
@@ -2019,6 +2539,11 @@ Like `describe-function', but prompts only for interactive commands.
 
 \(fn COMMAND)" t nil)
 
+(autoload 'narrow-to-comment "ourcomments-util" "\
+Not documented
+
+\(fn)" t nil)
+
 (autoload 'describe-custom-group "ourcomments-util" "\
 Describe customization group SYMBOL.
 
@@ -2051,6 +2576,30 @@ Raise frame showing buffer.
 
 \(fn)" t nil)
 
+(defvar ourcomments-ido-ctrl-tab nil "\
+Enable buffer switching using C-Tab with function `ido-mode'.
+This changes buffer switching with function `ido-mode' the
+following way:
+
+- You can use C-Tab.
+
+- You can show the selected buffer in three ways independent of
+  how you entered function `ido-mode' buffer switching:
+
+  * S-return: other window
+  * C-return: other frame
+  * M-return: raise frame
+
+Those keys are selected to at least be a little bit reminiscent
+of those in for example common web browsers.")
+
+(nxhtml-custom-autoload 'ourcomments-ido-ctrl-tab "ourcomments-util" nil)
+
+(autoload 'emacs-restart "ourcomments-util" "\
+Restart Emacs and start `server-mode' if on before.
+
+\(fn)" t nil)
+
 (autoload 'emacs "ourcomments-util" "\
 Start a new Emacs.
 
@@ -2058,7 +2607,8 @@ Start a new Emacs.
 
 (autoload 'emacs-buffer-file "ourcomments-util" "\
 Start a new Emacs showing current buffer file.
-If there is no buffer file start with `dired'.
+Go to the current line and column in that file.
+If there is no buffer file then instead start with `dired'.
 
 \(fn)" t nil)
 
@@ -2067,6 +2617,11 @@ Not documented
 
 \(fn)" t nil)
 
+(autoload 'emacs--no-desktop "ourcomments-util" "\
+Not documented
+
+\(fn)" t nil)
+
 (autoload 'emacs-Q "ourcomments-util" "\
 Start new Emacs without any customization whatsoever.
 
@@ -2090,10 +2645,93 @@ Open an info file in `Info-mode'.
 
 \(fn INFO-FILE)" t nil)
 
+(autoload 'use-custom-style "ourcomments-util" "\
+Setup like in `Custom-mode', but without things specific to Custom.
+
+\(fn)" nil nil)
+
+(defvar ourcomments-M-x-menu-mode nil "\
+Non-nil if Ourcomments-M-X-Menu mode is enabled.
+See the command `ourcomments-M-x-menu-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `ourcomments-M-x-menu-mode'.")
+
+(nxhtml-custom-autoload 'ourcomments-M-x-menu-mode "ourcomments-util" nil)
+
+(autoload 'ourcomments-M-x-menu-mode "ourcomments-util" "\
+Add commands started from Emacs menus to M-x history.
+The purpose of this is to make it easier to redo them and easier
+to learn how to do them from the command line (which is often
+faster if you know how to do it).
+
+Only commands that are not already in M-x history are added.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'ourcomments-warning "ourcomments-util" "\
+Not documented
+
+\(fn FORMAT-STRING &rest ARGS)" nil nil)
+
+;;;***
+
+;;;### (autoloads (pause-mode) "pause" "util/pause.el" (19064 18015))
+;;; Generated autoloads from util/pause.el
+
+(defvar pause-mode nil "\
+Non-nil if Pause mode is enabled.
+See the command `pause-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `pause-mode'.")
+
+(nxhtml-custom-autoload 'pause-mode "pause" nil)
+
+(autoload 'pause-mode "pause" "\
+This minor mode tries to make you take a break!
+To customize it see:
+
+ `pause-after-minutes'
+ `pause-text-color'
+ `pause-prompt1-color'
+ `pause-prompt2-color'
+ `pause-message-color'
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (global-pointback-mode pointback-mode) "pointback"
+;;;;;;  "util/pointback.el" (19023 47096))
+;;; Generated autoloads from util/pointback.el
+
+(autoload 'pointback-mode "pointback" "\
+Restore previous window point when switching back to a buffer.
+
+\(fn &optional ARG)" t nil)
+
+(defvar global-pointback-mode nil "\
+Non-nil if Global-Pointback mode is enabled.
+See the command `global-pointback-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-pointback-mode'.")
+
+(nxhtml-custom-autoload 'global-pointback-mode "pointback" nil)
+
+(autoload 'global-pointback-mode "pointback" "\
+Toggle Pointback mode in every possible buffer.
+With prefix ARG, turn Global-Pointback mode on if and only if ARG is positive.
+Pointback mode is enabled in all buffers where `pointback-on' would do it.
+See `pointback-mode' for more information on Pointback mode.
+
+\(fn &optional ARG)" t nil)
+
 ;;;***
 
-;;;### (autoloads (rnc-mode) "rnc-mode" "util/rnc-mode.el" (18654
-;;;;;;  33922))
+;;;### (autoloads (rnc-mode) "rnc-mode" "util/rnc-mode.el" (18775
+;;;;;;  60004))
 ;;; Generated autoloads from util/rnc-mode.el
 
 (autoload 'rnc-mode "rnc-mode" "\
@@ -2104,10 +2742,63 @@ Major mode for editing RELAX NG Compact Syntax schemas.
 
 ;;;***
 
-;;;### (autoloads (tabkey2-mode) "tabkey2" "util/tabkey2.el" (18662
-;;;;;;  2982))
+;;;### (autoloads (search-form) "search-form" "util/search-form.el"
+;;;;;;  (18778 14464))
+;;; Generated autoloads from util/search-form.el
+
+(autoload 'search-form "search-form" "\
+Display a form for search and replace.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (sex-mode) "sex-mode" "util/sex-mode.el" (19039
+;;;;;;  48498))
+;;; Generated autoloads from util/sex-mode.el
+
+(defvar sex-mode nil "\
+Non-nil if Sex mode is enabled.
+See the command `sex-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `sex-mode'.")
+
+(nxhtml-custom-autoload 'sex-mode "sex-mode" nil)
+
+(autoload 'sex-mode "sex-mode" "\
+Open certain files in external programs.
+See `sex-get-file-open-cmd' for how to determine which files to
+open by external applications.  Note that this selection is
+nearly the same as in `org-mode'.  The main difference is that
+the fallback always is to open a file in Emacs. (This is
+necessary to avoid to disturb many of Emacs operations.)
+
+This affects all functions that opens files, like `find-file',
+`find-file-noselect' etc.
+
+However it does not affect files opened through Emacs client.
+
+Urls can also be handled, see `sex-handle-urls'.
+
+When opening a file with the shell a (temporary) dummy buffer is
+created in Emacs with major mode `sex-file-mode' and an external
+program is called to handle the file.  How this dummy buffer is
+handled is governed by `sex-keep-dummy-buffer'.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (tabkey2-mode tabkey2-emma-without-tabkey2) "tabkey2"
+;;;;;;  "util/tabkey2.el" (19048 2102))
 ;;; Generated autoloads from util/tabkey2.el
 
+(autoload 'tabkey2-emma-without-tabkey2 "tabkey2" "\
+Not documented
+
+\(fn)" nil nil)
+
 (defvar tabkey2-mode nil "\
 Non-nil if Tabkey2 mode is enabled.
 See the command `tabkey2-mode' for a description of this minor mode.
@@ -2115,7 +2806,7 @@ Setting this variable directly does not take effect;
 either customize it (see the info node `Easy Customization')
 or call the function `tabkey2-mode'.")
 
-(custom-autoload 'tabkey2-mode "tabkey2" nil)
+(nxhtml-custom-autoload 'tabkey2-mode "tabkey2" nil)
 
 (autoload 'tabkey2-mode "tabkey2" "\
 More fun with Tab key number two (completion etc).
@@ -2168,21 +2859,56 @@ be opened in your webbrowser with WORD looked up.
 
 ;;;***
 
-;;;### (autoloads (udev-cedet-update) "udev-cedet" "util/udev-cedet.el"
-;;;;;;  (18654 33922))
+;;;### (autoloads (udev-call-first-step) "udev" "util/udev.el" (19061
+;;;;;;  60296))
+;;; Generated autoloads from util/udev.el
+
+(autoload 'udev-call-first-step "udev" "\
+Set up and call first step.
+Set up buffer LOG-BUFFER to be used for log messages and
+controling of the execution of the functions in list STEPS which
+are executed one after another.
+
+Write HEADER at the end of LOG-BUFFER.
+
+Call first step.
+
+If FINISH-FUN non-nil it should be a function. This is called
+after last step with LOG-BUFFER as parameter.
+
+\(fn LOG-BUFFER STEPS HEADER FINISH-FUN)" nil nil)
+
+;;;***
+
+;;;### (autoloads (udev-cedet-utest udev-cedet-customize-startup
+;;;;;;  udev-cedet-update) "udev-cedet" "util/udev-cedet.el" (19061
+;;;;;;  38124))
 ;;; Generated autoloads from util/udev-cedet.el
 
 (autoload 'udev-cedet-update "udev-cedet" "\
-Fetch and install CEDET from the devel sources.
+Fetch and install CEDET from the development sources.
 To determine where to store the sources see `udev-cedet-dir'.
 For how to start CEDET see `udev-cedet-load-cedet'.
 
+Note that if you install CEDET yourself you should not use this function.
+
+\(fn)" t nil)
+
+(autoload 'udev-cedet-customize-startup "udev-cedet" "\
+Customize CEDET dev nXhtml startup group.
+
+\(fn)" t nil)
+
+(autoload 'udev-cedet-utest "udev-cedet" "\
+Start CEDET unit tests.
+These runs in a fresh Emacs.
+
 \(fn)" t nil)
 
 ;;;***
 
-;;;### (autoloads (udev-ecb-update) "udev-ecb" "util/udev-ecb.el"
-;;;;;;  (18654 33922))
+;;;### (autoloads (udev-ecb-customize-startup udev-ecb-update) "udev-ecb"
+;;;;;;  "util/udev-ecb.el" (19061 60296))
 ;;; Generated autoloads from util/udev-ecb.el
 
 (autoload 'udev-ecb-update "udev-ecb" "\
@@ -2192,10 +2918,15 @@ For how to start ECB see `udev-ecb-load-ecb'.
 
 \(fn)" t nil)
 
+(autoload 'udev-ecb-customize-startup "udev-ecb" "\
+Customize ECB dev nXhtml startup group.
+
+\(fn)" t nil)
+
 ;;;***
 
 ;;;### (autoloads (udev-rinari-update) "udev-rinari" "util/udev-rinari.el"
-;;;;;;  (18654 44936))
+;;;;;;  (19025 6424))
 ;;; Generated autoloads from util/udev-rinari.el
 
 (autoload 'udev-rinari-update "udev-rinari" "\
@@ -2208,7 +2939,7 @@ see `udev-rinari-dir' and `udev-rinari-load-rinari'.
 ;;;***
 
 ;;;### (autoloads (viper-tutorial) "viper-tut" "util/viper-tut.el"
-;;;;;;  (18685 3334))
+;;;;;;  (19063 44564))
 ;;; Generated autoloads from util/viper-tut.el
 
 (autoload 'viper-tutorial "viper-tut" "\
@@ -2223,10 +2954,118 @@ later.
 
 \(fn PART &optional DONT-ASK-FOR-REVERT)" t nil)
 
+;;;***
+
+;;;### (autoloads (vline-global-mode vline-mode) "vline" "util/vline.el"
+;;;;;;  (18973 28380))
+;;; Generated autoloads from util/vline.el
+
+(autoload 'vline-mode "vline" "\
+Display vertical line mode.
+
+\(fn &optional ARG)" t nil)
+
+(defvar vline-global-mode nil "\
+Non-nil if Vline-Global mode is enabled.
+See the command `vline-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `vline-global-mode'.")
+
+(nxhtml-custom-autoload 'vline-global-mode "vline" nil)
+
+(autoload 'vline-global-mode "vline" "\
+Display vertical line mode as globally.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (winsav-switch-config winsav-save-full-config winsav-save-mode
+;;;;;;  winsav-put-window-tree) "winsav" "util/winsav.el" (19063
+;;;;;;  42266))
+;;; Generated autoloads from util/winsav.el
+
+(autoload 'winsav-put-window-tree "winsav" "\
+Put window structure SAVED-TREE into WINDOW.
+Restore a structure SAVED-TREE returned from
+`winsav-get-window-tree' into window WINDOW.
+
+If COPY-WIN-OVL is non-nil then overlays having a 'window
+property pointing to one of the windows in SAVED-TREE where this
+window still is shown will be copied to a new overlay with
+'window property pointing to the corresponding new window.
+
+If WIN-OVL-ALL-BUFS is non-nil then all buffers will be searched
+for overlays with a 'window property of the kind above.
+
+At the very end of this function the hook `winsav-after-put' is
+run.
+
+\(fn SAVED-TREE WINDOW &optional COPY-WIN-OVL WIN-OVL-ALL-BUFS)" nil nil)
+
+(defvar winsav-save-mode nil "\
+Non-nil if Winsav-Save mode is enabled.
+See the command `winsav-save-mode' for a description of this minor mode.")
+
+(nxhtml-custom-autoload 'winsav-save-mode "winsav" nil)
+
+(autoload 'winsav-save-mode "winsav" "\
+Toggle winsav configuration saving mode.
+With numeric ARG, turn winsav saving on if ARG is positive, off
+otherwise.
+
+When this mode is turned on, winsav configurations are saved from
+one session to another.  A winsav configuration consists of
+frames, windows and visible buffers configurations plus
+optionally buffers and files managed by the functions used by
+option `desktop-save-mode'
+
+By default this is integrated with `desktop-save-mode'.  If
+`desktop-save-mode' is on and `winsav-handle-also-desktop' is
+non-nil then save and restore also desktop.
+
+See the command `winsav-switch-config' for more information and
+other possibilities.
+
+Note: If you want to avoid saving when you exit just turn off
+this minor mode.
+
+For information about what is saved and restored and how to save
+and restore additional information see the function
+`winsav-save-configuration'.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'winsav-save-full-config "winsav" "\
+Saved current winsav configuration in directory DIRNAME.
+Then change to this configuration.
+
+See also `winsav-switch-config'.
+
+\(fn DIRNAME)" nil nil)
+
+(autoload 'winsav-switch-config "winsav" "\
+Change to winsav configuration in directory DIRNAME.
+If DIRNAME is the current winsav configuration directory then
+offer to save it or restore it from saved values.
+
+Otherwise, before switching offer to save the current winsav
+configuration.  Then finally switch to the new winsav
+configuration, creating it if it does not exist.
+
+If option `desktop-save-mode' is on then buffers and files are also
+restored and saved the same way.
+
+See also option `winsav-save-mode' and command
+`winsav-tell-configuration'.
+
+\(fn DIRNAME)" t nil)
+
 ;;;***
 
 ;;;### (autoloads (winsize-save-window-configuration winsize-balance-siblings
-;;;;;;  resize-windows) "winsize" "util/winsize.el" (18761 37866))
+;;;;;;  resize-windows) "winsize" "util/winsize.el" (19063 37855))
 ;;; Generated autoloads from util/winsize.el
 
 (autoload 'resize-windows "winsize" "\
@@ -2298,12 +3137,12 @@ windows.  To make this indication more prominent the text in the
 selected window is marked with the face hold in the variable
 `winsize-selected-window-face'.
 
-The option `juris-way' decides how the borders to move are
-selected. If this option is non-nil then the right or bottom
+The option `winsize-juris-way' decides how the borders to move
+are selected. If this option is non-nil then the right or bottom
 border are the ones that are moved with the arrow keys and the
 opposite border with shift arrow keys.
 
-If `juris-way' is nil then the following apply:
+If `winsize-juris-way' is nil then the following apply:
 
 As you select other borders or move to new a window the mouse
 pointer is moved inside the selected window to show which borders
@@ -2427,45 +3266,52 @@ Not documented
 
 ;;;***
 
-;;;### (autoloads nil nil ("autostart.el" "etc/schema/schema-path-patch.el"
-;;;;;;  "nxhtml/html-chklnk.el" "nxhtml/html-imenu.el" "nxhtml/html-move.el"
-;;;;;;  "nxhtml/html-pagetoc.el" "nxhtml/html-quote.el" "nxhtml/html-toc.el"
-;;;;;;  "nxhtml/html-upl.el" "nxhtml/html-wtoc.el" "nxhtml/nxhtml-anything-1.el"
-;;;;;;  "nxhtml/nxhtml-autoload.el" "nxhtml/nxhtml-js.el" "nxhtml/nxhtml-strval.el"
-;;;;;;  "nxhtml/outline-magic.el" "nxhtml/rngalt.el" "nxhtml/test-c-m.el"
-;;;;;;  "nxhtml/test-cust.el" "nxhtml/tests.el" "nxhtml/tidy-xhtml.el"
-;;;;;;  "nxhtml/wtest.el" "nxhtml/xhtml-help.el" "related/cgi+.el"
-;;;;;;  "related/find-recursive-orig.el" "related/find-recursive.el"
-;;;;;;  "related/flymake-helpers.el" "related/flymake-js.el" "related/flymake-keys.el"
-;;;;;;  "related/flymake-php.el" "related/flymu.el" "related/fold-dwim.el"
-;;;;;;  "related/js2-font-lock-new.el" "related/js2-font-lock.el"
-;;;;;;  "related/php-imenu.el" "related/php-mode-1.5.0.el" "related/snippet.el"
-;;;;;;  "tests/angus77-setup-jde.el" "tests/elunit.el" "tests/emacstest-suites.el"
-;;;;;;  "tests/ert-080729.el" "tests/ert2.el" "tests/inemacs/bug1013.el"
-;;;;;;  "tests/nxhtmltest-helpers.el" "tests/temp-test.el" "util/appmenu-fold.el"
-;;;;;;  "util/appmenu.el" "util/buffer-bg.el" "util/bw-rnc-load/schema-find.el"
-;;;;;;  "util/chart.el" "util/color-test-sent.el" "util/color-test.el"
-;;;;;;  "util/custsets.el" "util/ecb-batch-compile.el" "util/elunit.el"
-;;;;;;  "util/ffip.el" "util/fmode.el" "util/from-osxkeys.el" "util/fupd.el"
-;;;;;;  "util/half-qwerty.el" "util/hexcolor.el" "util/hfy-test.el"
-;;;;;;  "util/hfyview.el" "util/hl-needed.el" "util/htmlfontify.21.el"
-;;;;;;  "util/htmlfontify.el" "util/mumamo-aspnet.el" "util/mumamo-test.el"
-;;;;;;  "util/mumamo-trace.el" "util/mumamo.el" "util/new-key-seq-widget.el"
-;;;;;;  "util/nxml-mode-os-additions.el" "util/ocr-user.el" "util/org-panel.el"
-;;;;;;  "util/pause.el" "util/physical-line.el" "util/popcmp.el"
-;;;;;;  "util/rebind.el" "util/rxi.el" "util/search-form.el" "util/sex-mode.el"
-;;;;;;  "util/udev-nxhtml.el" "util/udev.el" "util/useful-commands.el"
-;;;;;;  "util/vline.el" "util/whelp.el" "util/winsav.el" "util/zen-mode.el")
-;;;;;;  (18766 53631 796000))
-
-;;;***
-
-;;;### (autoloads (nxhtmlmaint-get-all-autoloads) "../nxhtml-maintenance"
-;;;;;;  "nxhtml-maintenance.el" (18766 50614))
-;;; Generated autoloads from nxhtml-maintenance.el
-
-(autoload 'nxhtmlmaint-get-all-autoloads "../nxhtml-maintenance" "\
-Not documented
+;;;### (autoloads nil nil ("autostart.el" "autostart22.el" "etc/schema/schema-path-patch.el"
+;;;;;;  "nxhtml/doc/cedet-build.el" "nxhtml/html-chklnk.el" "nxhtml/html-imenu.el"
+;;;;;;  "nxhtml/html-move.el" "nxhtml/html-quote.el" "nxhtml/html-wtoc.el"
+;;;;;;  "nxhtml/nxhtml-autoload.el" "nxhtml/nxhtml-strval.el" "nxhtml/nxhtmljs.el"
+;;;;;;  "nxhtml/outline-magic.el" "nxhtml/wtest.el" "related/flymake-helpers.el"
+;;;;;;  "related/flymake-js.el" "related/flymake-keys.el" "related/flymake-php.el"
+;;;;;;  "related/flymu.el" "related/fold-dwim.el" "related/javascript-old.el"
+;;;;;;  "related/php-imenu.el" "tests/angus77-setup-jde.el" "tests/emacstest-suites.el"
+;;;;;;  "tests/ert2.el" "tests/hfy-test.el" "tests/inemacs/bug1013.el"
+;;;;;;  "tests/mumamo-test.el" "tests/nxhtmltest-helpers.el" "tests/temp-test.el"
+;;;;;;  "util/appmenu-fold.el" "util/buffer-bg.el" "util/company-mode/company-autoloads.el"
+;;;;;;  "util/company-mode/company-eclim.el" "util/company-mode/company-pkg.el"
+;;;;;;  "util/company-mode/company-ropemacs.el" "util/company-mode/company-start.el"
+;;;;;;  "util/custsets.el" "util/ecb-batch-compile.el" "util/ffip.el"
+;;;;;;  "util/fmode.el" "util/fupd.el" "util/hl-needed.el" "util/htmlfontify.21.el"
+;;;;;;  "util/key-cat.el" "util/mumamo-aspnet.el" "util/mumamo-trace.el"
+;;;;;;  "util/new-key-seq-widget.el" "util/nxml-mode-os-additions.el"
+;;;;;;  "util/ocr-user.el" "util/org-panel.el" "util/popcmp.el" "util/rebind.el"
+;;;;;;  "util/rxi.el" "util/udev-nxhtml.el" "util/useful-commands.el"
+;;;;;;  "util/whelp.el" "util/zen-mode.el") (19064 20991 718000))
+
+;;;***
+
+;;;### (autoloads (nxhtmlmaint-byte-uncompile-all nxhtmlmaint-start-byte-compilation)
+;;;;;;  "../nxhtmlmaint" "nxhtmlmaint.el" (19062 21392))
+;;; Generated autoloads from nxhtmlmaint.el
+
+(autoload 'nxhtmlmaint-start-byte-compilation "../nxhtmlmaint" "\
+Start byte compilation of nXhtml in new Emacs instance.
+Byte compiling in general makes elisp code run 5-10 times faster
+which is quite noticeable when you use nXhtml.
+
+This will also update the file nxhtml-loaddefs.el.
+
+You must restart Emacs to use the byte compiled files.
+
+If for some reason the byte compiled files does not work you can
+remove then with `nxhtmlmaint-byte-uncompile-all'.
+
+\(fn)" t nil)
+
+(autoload 'nxhtmlmaint-byte-uncompile-all "../nxhtmlmaint" "\
+Delete byte compiled files in nXhtml.
+This will also update the file nxhtml-loaddefs.el.
+
+See `nxhtmlmaint-start-byte-compilation' for byte compiling.
 
 \(fn)" t nil)
 
diff --git a/elpa-to-submit/nxhtml/nxhtml-maintenance.el b/elpa-to-submit/nxhtml/nxhtml-maintenance.el
deleted file mode 100644
index 397c6d06a2..0000000000
--- a/elpa-to-submit/nxhtml/nxhtml-maintenance.el
+++ /dev/null
@@ -1,186 +0,0 @@
-;;; nxhtml-maintenance.el --- Some maintenance helpers
-;;
-;; Author: Lennart Borgman (lennart O borgman A gmail O com)
-;; Created: 2008-09-27T15:29:35+0200 Sat
-;; Version:
-;; Last-Updated:
-;; URL:
-;; Keywords:
-;; Compatibility:
-;;
-;; Features that might be required by this library:
-;;
-;;   None
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;;
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Change log:
-;;
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; This program 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 program 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 this program; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
-;; Floor, Boston, MA 02110-1301, USA.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Code:
-
-(defvar nxhtmlmaint-dir
-  (file-name-directory (if load-file-name load-file-name buffer-file-name))
-  "Maintenance directory for nXhtml.")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; Autoload helpers
-
-(defun nxhtmlmaint-autoloads-file ()
-  (file-truename (expand-file-name "nxhtml-loaddefs.el" nxhtmlmaint-dir)))
-
-(defun nxhtmlmaint-util-dir ()
-  (file-truename (file-name-as-directory
-                  (expand-file-name "util" nxhtmlmaint-dir))))
-
-(defvar nxhtmlmaint-autoload-default-directory (nxhtmlmaint-util-dir))
-
-(defun nxhtmlmaint-initialize-autoloads-file ()
-  (with-current-buffer (find-file-noselect generated-autoload-file)
-    (when (= 0 (buffer-size))
-      (insert ";; Autoloads for nXthml
-;;
-;; This file should be updated by `nxhtmlmaint-get-file-autoloads',
-;; `nxhtmlmaint-get-dir-autoloads' or `nxhtmlmaint-get-all-autoloads'.")
-    (basic-save-buffer))))
-
-(defun nxmtmlmaint-advice-autoload (on)
-  (if on
-      (progn
-        (ad-activate 'autoload-file-load-name)
-        (ad-activate 'make-autoload))
-    (ad-deactivate 'autoload-file-load-name)
-    (ad-deactivate 'make-autoload)))
-
-(defun nxhtmlmaint-get-file-autoloads (file)
-  (interactive (list (buffer-file-name)))
-  (let* ((generated-autoload-file (nxhtmlmaint-autoloads-file))
-         (emacs-lisp-mode-hook nil)
-         (default-directory (nxhtmlmaint-util-dir)))
-    (nxhtmlmaint-initialize-autoloads-file)
-    ;; Get the autoloads using advice
-    (nxmtmlmaint-advice-autoload t)
-    (update-file-autoloads file nil)
-    (nxmtmlmaint-advice-autoload nil)
-    ;; Display
-    (display-buffer (find-file-noselect generated-autoload-file))))
-
-(defun nxhtmlmaint-get-dir-autoloads (dir)
-  (interactive (list (or (when (buffer-file-name)
-                           (file-name-directory (buffer-file-name)))
-                         default-directory)))
-  (let* ((generated-autoload-file (nxhtmlmaint-autoloads-file))
-         (emacs-lisp-mode-hook nil)
-         (auto-buf (find-file-noselect generated-autoload-file)))
-    (nxhtmlmaint-initialize-autoloads-file)
-    ;; Get the autoloads using advice
-    (nxmtmlmaint-advice-autoload t)
-    ;; Fix-me: Loop instead, some files must be avoided.
-    (update-directory-autoloads dir)
-    (nxmtmlmaint-advice-autoload nil)
-    ;; Display
-    (display-buffer (find-file-noselect generated-autoload-file))))
-
-(defun nxhtmlmaint-get-tree-autoloads (root)
-  (interactive (list (or (when (buffer-file-name)
-                           (file-name-directory (buffer-file-name)))
-                         default-directory)))
-  (nxhtmlmaint-get-dir-autoloads root)
-  (message "----- ROOT=%s" root)
-  (let* ((files (directory-files root))
-         (sub-dirs (mapcar (lambda (file)
-                             (when (and (not (member file '("." "..")))
-                                        (not (member file '("nxml-mode-20041004" "old")))
-                                        (not (member file '("in")))
-                                        (file-directory-p (expand-file-name file root)))
-                               file))
-                           files)))
-    (setq sub-dirs (delq nil sub-dirs))
-    (message "sub-dirs=%s" sub-dirs)
-    (dolist (dir sub-dirs)
-      (let ((full-dir (expand-file-name dir root)))
-        (unless (string= full-dir nxhtmlmaint-dir)
-          (nxhtmlmaint-get-tree-autoloads full-dir))))))
-
-;;;###autoload
-(defun nxhtmlmaint-get-all-autoloads ()
-  (interactive)
-  (let ((auto-buf (find-file-noselect (nxhtmlmaint-autoloads-file))))
-    (with-current-buffer auto-buf
-      (erase-buffer)
-      (basic-save-buffer)))
-  (nxhtmlmaint-get-tree-autoloads nxhtmlmaint-dir))
-
-(defun nxhtmlmaint-autoload-file-load-name (file)
-  (let ((name (if nxhtmlmaint-autoload-default-directory
-                  (file-relative-name
-                   file nxhtmlmaint-autoload-default-directory)
-                (file-name-nondirectory file))))
-    (if (string-match "\\.elc?\\(\\.\\|\\'\\)" name)
-        (substring name 0 (match-beginning 0))
-      name)))
-
-(defadvice autoload-file-load-name (around
-                                    nxhtmlmaint-advice-autoload-file-load-name
-                                    ;;activate
-                                    compile)
-  (setq ad-return-value (nxhtmlmaint-autoload-file-load-name (ad-get-arg 0))))
-
-(defun nxhtmlmaint-make-autoload (form file)
-  ;;(message "form=%S" form)
-  (if (or (not (listp form))
-          (not (eq 'define-mumamo-multi-major-mode (car form))))
-      ad-return-value
-    (if ad-return-value
-        ad-return-value
-      ;; Fix-me: Maybe expand??
-      (let ((name (nth 1 form))
-            (doc  (nth 2 form)))
-        `(autoload ',name ,file ,doc t)
-        ))))
-
-(defadvice make-autoload (after
-                          nxhtmlmaint-advice-make-autoload
-                          ;;activate
-                          compile)
-  (setq ad-return-value
-        (nxhtmlmaint-make-autoload (ad-get-arg 0)
-                                             (ad-get-arg 1))))
-
-(defun generate-library-autoloads (library)
-  "Insert at point autoloads for Emacs library LIBRARY.
-  Works like `generate-file-autoloads', but for a library."
-  (interactive
-   (list (completing-read "Generate autoloads for library: "
-                          'locate-file-completion
-                          (cons load-path (get-load-suffixes)))))
-  (let ((file (locate-library library)))
-    (generate-file-autoloads file)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; nxhtml-maintenance.el ends here
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/cedet-build.el b/elpa-to-submit/nxhtml/nxhtml/doc/cedet-build.el
new file mode 100644
index 0000000000..f49197f8be
--- /dev/null
+++ b/elpa-to-submit/nxhtml/nxhtml/doc/cedet-build.el
@@ -0,0 +1,55 @@
+(setq debug-on-error t)
+(setq debug-on-error t)
+(setq debug-on-error t)
+(setq debug-on-error t)
+;;; cedet-build.el<2> --- 
+;; 
+;; Author: Lennart Borgman (lennart O borgman A gmail O com)
+;; Created: 2009-01-05 Mon
+;; Version: 
+;; Last-Updated: 
+;; URL: 
+;; Keywords: 
+;; Compatibility: 
+;; 
+;; Features that might be required by this library:
+;;
+;;   None
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 
+;;; Commentary: 
+;; 
+;; 
+;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 
+;;; Change log:
+;; 
+;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 
+;; This program 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 program 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 this program; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+;; Floor, Boston, MA 02110-1301, USA.
+;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 
+;;; Code:
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; cedet-build.el<2> ends here
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/Las_Medulas.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/Las_Medulas.jpg
new file mode 100644
index 0000000000..694a2c5a08
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/Las_Medulas.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/Thumbs.db b/elpa-to-submit/nxhtml/nxhtml/doc/img/Thumbs.db
index 3e94de46d0..60618792b1 100644
Binary files a/elpa-to-submit/nxhtml/nxhtml/doc/img/Thumbs.db and b/elpa-to-submit/nxhtml/nxhtml/doc/img/Thumbs.db differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/Toco_toucan.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/Toco_toucan.jpg
new file mode 100644
index 0000000000..269886c070
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/Toco_toucan.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/bacchante2.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/bacchante2.jpg
new file mode 100644
index 0000000000..a736099335
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/bacchante2.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.jpg
new file mode 100644
index 0000000000..a7352a686e
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.png b/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.png
new file mode 100644
index 0000000000..8d606370bc
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.png differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.xcf b/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.xcf
new file mode 100644
index 0000000000..9260725dde
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/butterflies.xcf differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/continue-play.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/continue-play.jpg
new file mode 100644
index 0000000000..587113ee38
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/continue-play.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/divine2.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/divine2.jpg
new file mode 100644
index 0000000000..6a8ea51584
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/divine2.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/fun-brain-2.png b/elpa-to-submit/nxhtml/nxhtml/doc/img/fun-brain-2.png
new file mode 100644
index 0000000000..a24f0f4730
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/fun-brain-2.png differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/giraffe.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/giraffe.jpg
new file mode 100644
index 0000000000..6bf9b57ef9
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/giraffe.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/healthy_feet2.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/healthy_feet2.jpg
new file mode 100644
index 0000000000..ed3ab6f8ee
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/healthy_feet2.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/raindrops2.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/raindrops2.jpg
new file mode 100644
index 0000000000..04d0610fe4
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/raindrops2.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/rembrandt-self-portrait.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/rembrandt-self-portrait.jpg
new file mode 100644
index 0000000000..26895984e0
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/rembrandt-self-portrait.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/img/volga.jpg b/elpa-to-submit/nxhtml/nxhtml/doc/img/volga.jpg
new file mode 100644
index 0000000000..c11e93cf24
Binary files /dev/null and b/elpa-to-submit/nxhtml/nxhtml/doc/img/volga.jpg differ
diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml-changes.html b/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml-changes.html
index 27baab6dff..5e04c61b38 100644
--- a/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml-changes.html
+++ b/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml-changes.html
@@ -27,6 +27,9 @@
     background-position: 0 -35px;
     color: yellow;
 }
+.bugfix {
+    background-color: #ffd700;
+}
 
 
   
@@ -263,6 +266,38 @@ 

nXhtml Changes

v1.59 v1.60 v1.61 + v1.62 + v1.63 + v1.64 + v1.65 + v1.66 + v1.67 + v1.68 + v1.69 + v1.70 + v1.71 + v1.72 + v1.73 + v1.74 + v1.75 + v1.76 + v1.77 + v1.78 + v1.79 + v1.80 + v1.81 + v1.82 + v1.83 + v1.84 + v1.85 + v1.86 + v1.87 + v1.88 + v1.89 + v1.90 + v1.91 + v1.92 + v1.93
@@ -1673,7 +1708,7 @@

nXhtml Changes

  • - Changed top directory name from nxml to nxhtml

    This will of course case some problems if you do not @@ -2264,8 +2299,10 @@

    nXhtml Changes

    Fixed bug 290364, see below about MuMaMo important changes.
  • -
  • Fixed bug 304569.
  • +
  • Fixed bug 272526.
  • Fixed bug 292393.
  • +
  • Fixed bug 300946.
  • +
  • Fixed bug 304569.
  • Added some support for editing gmail messages in as-external.el (to be used with It's All Text for @@ -2303,24 +2340,725 @@

    nXhtml Changes

    do.

    - I have done first part of this rewrite. Chunk - dividing is now always done from the beginning. - However the routines actually finding the chunks - still looks both upwards and downwards. I will try - to remove this unnecessary complexity later. + I have done first part of this rewrite and I hope + chunk dividing can not loop any more. Chunk dividing + is now always done from the beginning. However the + routines actually finding the chunks still looks + both upwards and downwards. I will try to remove + this unnecessary complexity later. +

    +
  • +
+
+
1.62
+
+
    +
  • + MuMaMo: +
      +
    • + Fixed bugs in chunk creation that caused args out + of range at buffer end. +
    • +
    +
  • +
  • + Autoloading caused wrong libraries to load (for + example javascript from mozdev). Fixed. +
  • +
+
+
1.63
+
+
    +
  • + Removed find-recursive.el since there is no use for it + any more and it interferes with emacs-rails. (It was + initally a bug fixs for emacs-rails.) +
  • +
  • + Fixed bugs in html-write-mode. +
  • +
  • + Used the new routines for finding chunks also during + xml validation and syntax-ppss. +
  • +
+
+
1.64
+
+
    +
  • + MuMaMo: nxml was not turned off properly when + switching from a multi major mode that used nxml-mode + or nxhtml-mode. Fixed. This was especially troublesome + for Emacs 22 users where multi major modes based on + nxhtml-mode does not always work. +
  • +
  • + Majmodpri.el: Added a defcustom to give multi major + modes based on nxhtm-mode or nxml-mode lower + priority. This is on by default in Emacs 22. +
  • +
+
+
1.65
+
+
    +
  • Fixed a bug in nxml-where.el.
  • +
  • + Fixed a minor bug in majmodpri.el. It did not work if + magic-mode-alist contained anonymous functions. + (Thanks from Niels Giesen.) +
  • +
  • + Fixed a bug in pause.el and added some mindfulness to it. +
  • +
  • + Adjusted ourcomments-move-beginning-of-line (and dito + for end) to the new line-move-visual in Emacs 23. + Moved physical-line.el to old subdir since it is now + obsolete. +
  • +
  • + Made it possible to byte compile nXhtml. +

    + To do that use + M-x nxhtmlmaint-start-byte-compilation. +

    +

    + A lot of code changes to make byte compilation + possible without a lot of warnings. Most changes + where just moving code around, but some where bug + fixes. +

    +
  • +
+
+
1.66
+
+
    +
  • + Further work on byte compiling. +
  • +
  • + Tried to fix some problem with defadvice in + ourcomments-util.el. +
  • +
  • + Tried to finish the command M-x search-form. +
  • +
  • + When no chunk is found (border case) then set the + major mode to the main major mode for the current + multi major mode. +
  • +
+
+
1.67
+
+
    +
  • + Removed css.el since it is in Emacs 22.2 and later. +
  • +
+
+
1.68
+
+
    +
  • + Fixed bugs related to byte compilation. This should + now work for both Emacs 22 and 23. Also added a menu + entry for byte compilation. +
  • +
  • + Removed nXml from the distribution to make it + smaller. nXml comes with Emacs 23 (not yet released of + course). For Emacs 22 users see EmacsWiki about where + to get nXml. +

    + Adding nXml to Emacs 22 startup should be done by + using the file nxhtml/autostart22.el. +

    +

    + NOTE 1: if you want to use nxhtml-mode in + multi major modes in Emacs 22 (not recommended) you + must also customize majmodpri-no-nxml. +

    +

    + NOTE 2: The major mode nxhtml-mode as a + major-mode works however very well also in Emacs 22. +

    +
  • +
+
+
1.69
+
+
    +
  • + Chunks were unnecessary deleted and recreated after a + change even if all changes where within one + chunk. This could make editing very slow. Fixed. +
  • +
  • + Search for rng-auto.el in path. (Emacs 22 only.) +
  • +
+
+
1.70
+
+
    +
  • + Validation could not be turned on in multi major + modes. Fixed. +
  • +
+
+
1.71
+
+
    +
  • + Fixed the problem that showed up in the file + nxhtml/tests/in/kubica-freezing-i.html which could + make Emacs freeze. +
  • +
+
+
1.72
+
+
    +
  • + Somehow I dropped this: Search for rng-auto.el in + path. (Emacs 22 only.) Don't ask me how. Fixed again. +
  • +
+
+
1.73
+
+
    +
  • + Worked a bit more on byte compilation and elisp + libraries loading. If you byte compile nXhtml it will + now load very few modules by default. It loads more + modules if you don't. +
  • +
  • + Added chart.el, a small elisp library to create charts. + This works by calling google charts library. + Chart.el is a bit beta, eh alpha, but still useful I believe. +
  • +
+
+
1.74
+
+
    +
  • + Found and fixed a bug in fictive XML validation + headers. This bug depended on the load order of + libraries. +
  • +
  • + Fixed a small bug in nxml-where-mode. +
  • +
+
+
1.75
+
+
    +
  • + Included css-color.el, css-palette.el and gpl.el from Niels Giesen. + (This replaces hexcolor.el which is no longer in nXhtml.) +
  • +
+
+
1.76 -- Released 2009-02-26
+
+
    +
  • + Fixed a long standing bug in XML validation. (I had + forgot to set the defadvice return value in defadvice + rng-set-initial-state in rngalt.el - I wonder why I + did not get any bug reports about this...) +
  • +
  • + css-color.el: bug fix for mIxEd case color names. +
  • +
  • + freemind.el: bug fixes. +
  • +
+
+
1.77 -- Never released!
+
+
    +
  • + Fixed numerous bugs, please + see nXhtml bug tracker + and dito question and answers. +
  • +
  • + Added some missing autoloads. +
  • +
  • + Tried to fix some smaller troubles with Viper when + changing chunk. +
  • +
  • + Menus for Tidy were broken. Fixed. +
  • +
  • + Added a test that the nxml-mode libraries included + in Emacs are used and not the old ones. (If I + understand it correctly this might have been a problem + for Debian/Ubuntu Emacs 23 snap-shots users where the + old nxml-mode has been a left over from earlier + snap-shots where it was needed.) +
  • +
  • + MuMaMo: +
      +
    • + Chunks are now always created from top to bottom. + This should make chunk creation more stable. + It also opens up for chunks in chunks in the future. + (The code still needs work...) +
    • +
    +
  • +
  • + majmodpri.el: +
      +
    • + To restore multi major modes in files loaded by + desktop-save-mode the new + function majmodpri-apply can be added + to desktop-after-read-hook. +
    • +
    • + New default for majmodpri-sort-after-load: + Sort after loading certain features/libraries that + are known to change auto-mode-alist and + apply to current buffer. This new default should + hopefully make major mode selection less + confusing. +
    • +
    +
  • +
  • + winsav.el: +
      +
    • + Added save and restore between Emacs sessions for frame configuration. + I am not sure how this works with special frames yet, but I have tested this with oneonone.el and it seems to work. + Dedicated windows should also work. +
    • +
    • + Added saving and restoring of named frame configurations. +
    • +
    +
  • +
  • + javascript.el: +
      +
    • + Updated to Karl's newest version (and added my additions). +
    • +
    +
  • +
  • + Added library usb-setup.el that might help a bit with + using Emacs from an USB stick. +
  • +
  • + Updated smarty-mode.el to the latest version. +
  • +
  • + Happy brain + Added an n-back game for your brain (and mine). + Just do M-x n-back-game to start it. +
  • +
+
+
1.78 -- Released 2009-05-28
+
+
    +
  • + nXhtml version 1.78 is the + release of the previous beta (which had number + 1.77 and existed in many versions). +
  • +
+
+
1.79
+
+
    +
  • + Added a function to simplify adding for example font + lock keywords for major modes used in multi major + mode: mumamo-refresh-multi-font-lock. +
  • +
+
+
1.80 -- Released 2009-06-02
+
+
    +
  • + Fixed a (rather serious) bug and cleaned up. +
  • +
  • + Added mumamo regions. Mumamo regions are temporary + mumamo chunks that you set up by selecting a region + and telling you want that in a new major mode. To use + this feature look in the nXhtml menu under Chunks - + Region Chunks. +
  • +
+
+
1.81 -- Released 2009-06-19
+
+
    +
  • + Added the minor mode mumamo-alt-php-tags-mode + that lets you work more easily with <?php tags in + strings while you are still able to use XHTML + completion. (I added something looking rather similare + earlier, but removed it again because of difficulties + with undo. They are now fixed in Emacs and this should + be safe.) +
  • +
  • + Added support for hi-lock, but please be aware that + chunk overlays hides background marking that hi-lock + does... - so you must use marking that changes + foreground part of face. +
  • +
+
+
1.82 -- Released 2009-06-23
+
+
    +
  • + Find and fixed some bugs when + I tried to fix bug 388729. Not sure I fixed that + bug though. +
  • +
+
+
1.83 -- Released 2009-06-24
+
+
    +
  • + Fontification disappeared for example in *grep* buffer. Fixed. +
  • +
+
+
1.84 -- Released 2009-06-30
+
+
    +
  • + MuMaMo: +
      +
    • + Worked around bug in Emacs + 22.3 where c-after-change was left in + after-change-functions. (This makes no + difference in Emacs 23.) +
    • +
    • + Fixed a bug that occured + after deletion of whole chunks. +
    • +
    +
  • +
+
+
1.85 -- Released 2009-07-04
+
+
    +
  • + MuMaMo: +
      +
    • + Corrected various mostly + minor bugs, like indent-line-function which + where globally set to + mumamo-indent-line. Corrected. +
    • +
    • + Forgot to finish the implementation of support for + font-lock-add-keywords. Done. +
    • +
    • + Added some faces hi-mumamo-* to use with hi-lock, + but unfortunately they are not very + visible. Suggestions are welcome. +
    • +
    +
  • +
  • + CEDET and ECB: +
      +
    • + Made the routines for fetching and installing CEDET and ECB + from the development sources work again. +
    • +
    • + Added support for ECB in winsav-save-mode. Though I suspect it need some rework... +
    • +
    +
  • +
  • + Added pointback.el, found on EmacsWiki. This is just + so missing in Emacs... +
  • +
+
+
1.86 -- Released 2009-07-05
+
+
    +
  • + Made the fetching and installing of CEDET and ECB a + bit better. +
  • +
+
+
1.87 -- Released 2009-07-08
+
+
    +
  • + Some enhancements to winsav.el and menuacc.el. +
  • +
  • + MuMaMo: +
      +
    • + Added heredoc for some modes. They are currently + kind of hidden since they are only available in + multiple major modes that offer just heredocs. + The implemented heredoc multi major modes are + + sh-mumamo-heredoc-mode, + php-mumamo-heredoc-mode, + perl-mumamo-heredoc-mode, + cperl-mumamo-heredoc-mode, + python-mumamo-heredoc-mode and + ruby-mumamo-heredoc-mode. +
    • +
    +
  • +
+
+
1.88 -- Never released, only betas
+
+
    +
  • + MuMaMo: +
      +
    • + + Background colors could not be removed by + setting mumamo-background-coloring. + Fixed, but please notice that this variable now + is a number. + +
    • +
    • + Support for chunks in chunks. +
    • +
    • + Removed string-match-p which does not exist in Emacs 22. +
    • +
    • + + mumamo-alt-php-tags-mode hardly survived major mode + changes. Rescued. + +
    • +
    • + + Added possibility to display chunk info in + window margins as an alternative/addon to + colored chunks. + +
    • +
    • + + Fixed a bug in n-back.el that prevented the game to be used on Emacs 22. + +
    • +
    +
  • +
  • + Bug fixes and changes to udev for CEDET and ECB. (Udev + is a little utility to fetch and install dev sources.) +
      +
    • + + Changed default directory for installing CEDET and + ECB to be under ~/.emacs.d/udev/. + +
    • +
    • + + Several bug fixes for udev. + It should now work again (it did not if you compiled nXhtml). + +
    • +
    +
  • +
  • + Added support + for Company + Mode style completion. Temporary included a copy + of Company Mode with bug fixes and changes needed for + nXhtml and Viper. It also include a lot of other + small features (which I hope can be included in + Company Mode). On of these is integration + with Predictive + Mode. (You have to get Predictive Mode + yourself. If you want to install it on MS Windows I + recommend using the latest version of Cygwin. A + smaller change to the Makefile is required, there is + one absolute path you probably want to remove.) +

    + Note: I thought that I should make Company Mode the default completion style. + However there are still some problem so I kept the old default completion style. +

    +
  • +
  • + TabKey2: +
      +
    • + Added support for Company Mode. +
    • +
    • + Made completion only occur at word ends. +
    • +
    +
  • +
  • + Added support + for anything + style completion in XHTML completion. +
  • +
  • + Added support in inlimg-mode to show images in org-mode. + (Also made inlimg-mode use font lock which makes it more reliable.) +
  • +
  • + Included espresso-mode (with some possible bug fixes). Not yet the default for Javascript. +
  • +
  • +

    + Added simple functions for mirroring html files in + Firefox as typing. This works - at least for small + files. There is also support for automatic update + of Firefox when saving CSS files. +

    +

    + This is a simple framework for communicating with + MozRepl which enqueues requests, waiting for + response prompt before sending next requests. + Maybe this can be used to make + some more efficient routines than those I have + written here. Any takers?

    +

    + For larger files (like this one) this version is + rather slow since it always changes the whole DOM. +

    +
  • +
  • + + Rewrote nxml-where-mode to be more efficient and + fixed some minor bugs. It can now also be used with + MozRepl to track position in file. + +
  • +
  • + + Made winsav-save-mode remember maximized state and + forget about empty non-file buffers. + +
  • +
  • + + Added workaround for Emacs bug 4015 on w32. + +
  • +
  • + Added ourcomments-M-x-menu-mode which adds + menu commands to M-x history. +
  • +
+
+
1.89 -- Released 2009-08-04
+
+
    +
  • + The release version of all the fixes in beta 1.88. +
  • +
+
+
1.90 -- Released 2009-08-04
+
+
    +
  • + + Made wrap-to-fill-column-mode cooperate a bit with + mumamo-margin-info-mode. + +
  • +
  • + Made an inventory of utilities in nXhtml and made some + of them more visible in the menus. +
  • +
+
+
1.91 -- Released 2009-08-04
+
+
    +
  • + + Mumamo bug fix for bug reported on Emacs wiki today. + Inline scripts end tag could not be in column one if + previous line had a // style js comment. + +
  • +
+
+
1.92 -- Released 2009-08-04
+
+
    +
  • + + An Emacs bug that sometimes prevent changing local keymap in a timer hit us. + Made a workaround. + +
  • +
+
+
1.93 -- Released 2009-08-04
+
+
    +
  • + + Minor bug in menus gave major problem. Fixed - I hope. +
+ + + - - diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml.html b/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml.html index 3c1b9118a0..1438fb32b0 100644 --- a/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml.html +++ b/elpa-to-submit/nxhtml/nxhtml/doc/nxhtml.html @@ -104,13 +104,13 @@
- @@ -298,6 +299,10 @@

The Quick Guide

After this files with extensions for example .html will open in nxhtml-mode.

+

+ To make nXhtml run faster you can also byte compile the files. + You do that with M-x nxhtmlmaint-start-byte-compilation. +

The nXhtml Menu
@@ -412,6 +417,32 @@

The Quick Guide

for this in the nXhtml menu.

+
Keyboard shortcuts (aka keybindings in Emacs)
+
+

+ When you start to use a new program you often wonder + about which keybindings there are to use. If you have + not used Emacs before you may feel quite lost because + you have looked in all documentation and you have not + seen any list of keybindings. +

+

+ Well, that is how it often is in Emacs. Get use to it ... +

+

+ But do not panic. Because there is help, probably even + better than you are used to - in Emacs dynamic help + system. A help system that change if you for example add + a keybinding yourself. Try the command C-h b (or F1 + b). This list all the keybindings (in their priority + order) that are active where you are in Emacs. +

+

+ You can also try C-h m which gives information about + minor modes and the current major mode. There is + sometimes information about the keybindings there too. +

+
Some More You Can Do ...

@@ -778,7 +809,8 @@

Why Are Colors Different in Multiple Modes?

More Multiple Modes

- nXhtml handles for example embedded style sheets the same way as PHP: + nXhtml mode handles for example embedded style sheets the + same way as it handles PHP chunks:

+

And Other Goodies...

+

+ There are a lot of other things in the package too, please + see the nXhtml menu in Emacs. You can for example find a + n-back-game (if you do not know what it is now, do not + worry, just try it and you will learn - and understand why I + put it there). +

diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/test.html b/elpa-to-submit/nxhtml/nxhtml/doc/test.html new file mode 100644 index 0000000000..4bb801d020 --- /dev/null +++ b/elpa-to-submit/nxhtml/nxhtml/doc/test.html @@ -0,0 +1,204 @@ + + + + + + + + + + +

Example of htmlfontify.el output

+ +

+ The following is an example of the output you can get with htmlfontify.el. + The version used here is shipped with nXhtml. + (A new version from the original author is on its way.) +

+ + + + + + + + + + + +
Emacs Icon (patched)  Emacs - Frame Dump
+ + + + +
+ + + + +
+ +
+                    ;; This buffer is for notes you don't want to save, and for Lisp evaluation.
+                    ;; If you want to create a file, visit that file with C-x C-f,
+                    ;; then enter the text in that file's own buffer.
+                  
+
+
-- (Unix)-- *scratch* (Lisp Interaction w32 Abbrev hs) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+ + + + +
cadr is a compiled Lisp function in `subr.el'.
+                (cadr x)
+
+                Return the car of the cdr of x.
+
+                [back]
+                
+ +
+
-- (Unix)%% *Help* (Help w32 View Abbrev) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+
+  M-x  hfyview-frame
+ + diff --git a/elpa-to-submit/nxhtml/nxhtml/doc/wd/grapes/nxhtml-grapes.css b/elpa-to-submit/nxhtml/nxhtml/doc/wd/grapes/nxhtml-grapes.css index 863040f462..a241c1e38a 100644 --- a/elpa-to-submit/nxhtml/nxhtml/doc/wd/grapes/nxhtml-grapes.css +++ b/elpa-to-submit/nxhtml/nxhtml/doc/wd/grapes/nxhtml-grapes.css @@ -72,6 +72,10 @@ acronym {font-weight: bold; border-bottom: 1px dashed #000; cursor: help} p, li, dt, dd { margin-right: 1em; } +dt { + margin-top: 1em; + margin-bottom: 0.5em; +} li ul li { margin-right: 0; } diff --git a/elpa-to-submit/nxhtml/nxhtml/html-chklnk.el b/elpa-to-submit/nxhtml/nxhtml/html-chklnk.el index 312f6d414e..9e84d27ac9 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-chklnk.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-chklnk.el @@ -47,14 +47,17 @@ (eval-when-compile (add-to-list 'load-path default-directory load-path)) (eval-when-compile - (let ((load-path load-path) - (this-dir (file-name-directory - (if load-file-name load-file-name buffer-file-name)))) - (add-to-list 'load-path (expand-file-name "../../lisp" this-dir)) - (require 'w32shell nil t))) + (when (> emacs-major-version 22) + (let* ((load-path load-path) + (this-file (or load-file-name + (when (boundp 'bytecomp-filename) bytecomp-filename) + buffer-file-name)) + (this-dir (file-name-directory this-file))) + (add-to-list 'load-path (expand-file-name "../../lisp" this-dir)) + (require 'w32shell nil t)))) -(require 'html-site) +(eval-when-compile (require 'html-site)) (require 'compile) (defgroup html-chklnk nil diff --git a/elpa-to-submit/nxhtml/nxhtml/html-imenu.el b/elpa-to-submit/nxhtml/nxhtml/html-imenu.el index b26558f36c..98cccce783 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-imenu.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-imenu.el @@ -38,6 +38,8 @@ ;;; Code: +(eval-when-compile (require 'imenu)) + (defvar html-imenu-title "Index" "*Title of the menu which will be added to the menubar.") diff --git a/elpa-to-submit/nxhtml/nxhtml/html-move.el b/elpa-to-submit/nxhtml/nxhtml/html-move.el index 0942f8c478..3a2c88fb63 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-move.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-move.el @@ -55,7 +55,7 @@ ;;; Code: (eval-when-compile (add-to-list 'load-path default-directory load-path)) -(require 'html-site) +(eval-when-compile (require 'html-site)) (require 'url-parse) (defun html-move-make-new-url (old-url from-dir to-dir) diff --git a/elpa-to-submit/nxhtml/nxhtml/html-pagetoc.el b/elpa-to-submit/nxhtml/nxhtml/html-pagetoc.el index 73ad4282ff..43c8fd8a95 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-pagetoc.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-pagetoc.el @@ -115,6 +115,7 @@ See `html-pagetoc-tocheads'." (setq header (cdr th)))) header))) +;;;###autoload (defun html-pagetoc-insert-toc (&optional min-level max-level) "Inserts a table of contents for the current html file. The html header tags h1-h6 found in the file are inserted into @@ -285,6 +286,7 @@ the table of contents." (message "Please edit the style guide!") ) +;;;###autoload (defun html-pagetoc-rebuild-toc () "Update the table of contents inserted by `html-pagetoc-insert-toc'." (interactive) @@ -319,6 +321,7 @@ the table of contents." (delete-region start-toc end-toc) (html-pagetoc-insert-toc old-min old-max )))))))) +;;;###autoload (defconst html-pagetoc-menu-map (let ((map (make-sparse-keymap))) (define-key map [html-pagetoc-rebuild-toc] diff --git a/elpa-to-submit/nxhtml/nxhtml/html-site.el b/elpa-to-submit/nxhtml/nxhtml/html-site.el index e8540fadb8..2c37cd2048 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-site.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-site.el @@ -52,8 +52,11 @@ ;; TODO: maybe use browse-url-filename-alist +(eval-when-compile (require 'ourcomments-util)) (eval-when-compile (require 'cl)) -;;(eval-when-compile (load-library "cl-macs")) +(eval-when-compile (require 'dired)) +(eval-when-compile (require 'ffip)) +(eval-when-compile (require 'grep)) ;;(defvar html-site-list) ;; Silence compiler ;;(defvar html-site-current) ;; Silence compiler @@ -209,9 +212,9 @@ See `rgrep' for the arguments REGEXP and FILES." (interactive (let ((parameters (dir-replace-read-parameters t t))) ;; Delete element 3 - (length parameters) + ;;(length parameters) (setcdr (nthcdr 2 parameters) (nthcdr 4 parameters)) - (length parameters) + ;;(length parameters) parameters)) ;; fix-me: ask for site (when (called-interactively-p) @@ -719,7 +722,9 @@ Use the entry with this name in `html-site-list'." ;; Provide here to be able to load the files in any order (provide 'html-site) -(require 'html-upl nil t) + +(eval-when-compile (require 'html-upl nil t)) + (defvar html-site-mode-menu-map (let ((map (make-sparse-keymap "html-site-mode-menu-map"))) diff --git a/elpa-to-submit/nxhtml/nxhtml/html-toc.el b/elpa-to-submit/nxhtml/nxhtml/html-toc.el index 2c18840ebe..6a9db1a76d 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-toc.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-toc.el @@ -52,9 +52,9 @@ (eval-when-compile (require 'cl)) (eval-when-compile (add-to-list 'load-path default-directory load-path)) -(require 'fupd) +(eval-when-compile (require 'fupd)) ;;(require 'html-move) -(require 'html-site) +(eval-when-compile (require 'html-site)) ;;(require 'dom) (require 'xml) @@ -341,6 +341,7 @@ You may also want to look at `html-wtoc-write-pages-with-toc'." (save-buffer)) frames-file))) +;;;###autoload (defconst html-toc-menu-map (let ((map (make-sparse-keymap))) (define-key map [html-toc-browse-frames-file] diff --git a/elpa-to-submit/nxhtml/nxhtml/html-upl.el b/elpa-to-submit/nxhtml/nxhtml/html-upl.el index d0fc3daf74..47ef108b04 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-upl.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-upl.el @@ -46,7 +46,7 @@ ;; ;;; Code: (eval-when-compile (add-to-list 'load-path default-directory load-path)) -(require 'html-site) +(eval-when-compile (require 'html-site)) (defgroup html-upl nil "Customization group for html-upl." @@ -89,9 +89,12 @@ The tools for html-upl includes: nil))) (browse-url url))) +;;;###autoload (defun html-upl-upload-site-with-toc () (interactive) (html-upl-upload-site1 t)) + +;;;###autoload (defun html-upl-upload-site () (interactive) (html-upl-upload-site1 nil)) @@ -139,6 +142,7 @@ The tools for html-upl includes: (unless (and host (< 0 (length host))) (error "Site %s has no ftp host defined" html-site-current)))) +;;;###autoload (defun html-upl-remote-dired (dirname) "Start dired for remote directory or its parent/ancestor." (interactive (list @@ -187,6 +191,7 @@ The tools for html-upl includes: (when to-parent (message "Remote dir not found, showing ancestor %s" to-parent))))) +;;;###autoload (defun html-upl-upload-file (filename) "Upload a single file in a site. For the definition of a site see `html-site-current'." @@ -227,9 +232,12 @@ For the definition of a site see `html-site-current'." (message "Upload ready") ))) +;;;###autoload (defun html-upl-edit-remote-file () (interactive) (html-upl-edit-remote-file1 nil)) + +;;;###autoload (defun html-upl-edit-remote-file-with-toc () (interactive) (html-upl-edit-remote-file1 t)) @@ -251,6 +259,7 @@ For the definition of a site see `html-site-current'." ) (find-file remote-file))) +;;;###autoload (defun html-upl-ediff-file (filename) "Run ediff on local and remote file. FILENAME could be either the remote or the local file." diff --git a/elpa-to-submit/nxhtml/nxhtml/html-wtoc.el b/elpa-to-submit/nxhtml/nxhtml/html-wtoc.el index 0bae4914c7..42472a6996 100644 --- a/elpa-to-submit/nxhtml/nxhtml/html-wtoc.el +++ b/elpa-to-submit/nxhtml/nxhtml/html-wtoc.el @@ -46,7 +46,7 @@ ;;; Code: (eval-when-compile (add-to-list 'load-path default-directory load-path)) -(require 'html-toc) +(eval-when-compile (require 'html-toc)) (defgroup html-wtoc nil "Customization group for html-wtoc." diff --git a/elpa-to-submit/nxhtml/nxhtml/inlimg.el b/elpa-to-submit/nxhtml/nxhtml/inlimg.el deleted file mode 100644 index a6b1fba0c6..0000000000 --- a/elpa-to-submit/nxhtml/nxhtml/inlimg.el +++ /dev/null @@ -1,335 +0,0 @@ -;;; inlimg.el --- Display images inline -;; -;; Author: Lennart Borgman (lennart O borgman A gmail O com) -;; Created: 2008-09-27 -(defconst inlimg:version "0.5") ;; Version: -;; Last-Updated: 2008-09-27T13:26:46+0200 Sat -;; URL: -;; Keywords: -;; Compatibility: -;; -;; Features that might be required by this library: -;; -;; None -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;; Display images inline. By default it can handle image referenced in -;; inline. -;; -;; See `inlimg-mode' and `inlimg-toggle-img-display'. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Change log: -;; -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; This program 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 program 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 this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Code: - -(defvar inlimg-img-regexp - (rx (or (and ""))) - (1+ space)) - "src=\"" - (group (1+ (not (any "\"")))) - "\"" - (*? anything) - "/>") - (and "url(" - ?\" - (group (1+ (not (any "\"")))) - ?\" - ")" - ) - ))) - -(defgroup inlimg nil - "Customization group for inlimg." - :group 'nxhtml) - -(defcustom inlimg-margins '(50 . 5) - "Margins when displaying image." - :type '(cons (integer :tag "Left margin") - (integer :tag "Top margin")) - :set (lambda (sym val) - (set-default sym val) - (when (fboundp 'inlimg-update-all-buffers) - (inlimg-update-all-buffers))) - :group 'inlimg) - -(defcustom inlimg-slice '(0 0 400 100) - "How to slice images." - :type '(choice (const :tag "Show whole images" nil) - (list :tag "Show slice of image" - (integer :tag "Top") - (integer :tag "Left") - (integer :tag "Width") - (integer :tag "Height"))) - :set (lambda (sym val) - (set-default sym val) - (when (fboundp 'inlimg-update-all-buffers) - (inlimg-update-all-buffers))) - :group 'inlimg) - -(defface inlimg-img-tag '((t :inherit 'lazy-highlight)) - "Face added to img tag when displaying image." - :group 'inlimg) - -(defface inlimg-img-remote '((t :inherit 'isearch-fail)) - "Face used for notes telling image is remote." - :group 'inlimg) - -(defface inlimg-img-missing '((t :inherit 'trailing-whitespace)) - "Face used for notes telling image is missing." - :group 'inlimg) - -(defun inlimg-next (pt display-image) - "Display or hide next image after point PT. -If DISPLAY-IMAGE is non-nil then display image, otherwise hide it. - -Return non-nil if an img tag was found." - (let (src beg end end-str img ovl remote beg-face) - (goto-char pt) - (when (setq res (re-search-forward inlimg-img-regexp nil t)) - (setq src (or (match-string-no-properties 1) - (match-string-no-properties 2))) - (setq beg (match-beginning 0)) - (setq end (match-end 0)) - (setq end-str (buffer-substring-no-properties (- end 2) end)) - (setq beg-face (get-text-property beg 'face)) - (setq remote (string-match "^https?://" src)) - (if display-image - (unless (memq beg-face '(font-lock-comment-face font-lock-string-face)) - (setq ovl (make-overlay beg end)) - (overlay-put ovl 'inlimg-img t) - (overlay-put ovl 'priority 100) - (overlay-put ovl 'face 'inlimg-img-tag) - (overlay-put ovl 'keymap inlimg-img-keymap) - (overlay-put ovl 'image-file (expand-file-name src)) - (if (or remote (not (file-exists-p src))) - (mumamo-with-buffer-prepared-for-jit-lock - (put-text-property (- end 2) (- end 1) - 'display - end-str ;;"/>" - ) - (put-text-property (- end 1) end - 'display - (propertize (if remote - " Image is on the web " - " Image not found ") - 'face - (if remote - 'inlimg-img-remote - ;;'custom-invalid - ;;'match - 'inlimg-img-missing)))) - ;; Get src value before macro since buffer-file-name is nil inside. - (setq src (expand-file-name - src - (file-name-directory (buffer-file-name)))) - (mumamo-with-buffer-prepared-for-jit-lock - (put-text-property (- end 2) (- end 1) - 'display - ;;"/>\n" - (concat end-str "\n") - ) - (setq img (create-image src nil nil - :relief 5 - :margin inlimg-margins)) - (when inlimg-slice - (let* ((sizes (image-size img t)) - (width (car sizes)) - (height (cdr sizes)) - (sl-left (nth 0 inlimg-slice)) - (sl-top (nth 1 inlimg-slice)) - (sl-width (nth 2 inlimg-slice)) - (sl-height (nth 3 inlimg-slice)) - ) - (when (> sl-left width) (setq sl-left 0)) - (when (> (+ sl-left sl-width) width) - (setq sl-width (- width sl-left))) - (when (> sl-top height) (setq sl-top 0)) - (when (> (+ sl-top sl-height) height) - (setq sl-height (- height sl-top))) - (setq img (list img)) - (setq img (cons - (append '(slice) - inlimg-slice - (list sl-top sl-left sl-width sl-height) - nil) - img)))) - (put-text-property (- end 1) end - 'display img)))) - (mumamo-with-buffer-prepared-for-jit-lock - (put-text-property (- end 2) end - 'display nil))) - (mumamo-with-buffer-prepared-for-jit-lock - (put-text-property (- end 2) end - 'inlimg-display display-image))) - res)) - -(defvar inlimg-img-keymap - (let ((map (make-sparse-keymap))) - (define-key map [(control ?c) ?+] 'inlimg-toggle-img-display) - map)) - -(eval-after-load 'gimp - '(gimp-add-point-bindings inlimg-img-keymap)) - -(defvar inlimg-timer nil) -(make-variable-buffer-local 'inlimg-timer) -(put 'inlimg-timer 'permanent-local t) - -(defun inlimg-cancel-timer () - "Cancel timer for displaying/hiding images." - (when inlimg-timer - (cancel-timer inlimg-timer) - (setq inlimg-timer nil))) - -(defun inlimg-request-update (start end) - "Request update of images display between START and END." - (inlimg-cancel-timer) - (setq inlimg-timer - (run-with-idle-timer idle-update-delay - nil - 'inlimg-update-in-timer - start - end - (current-buffer)))) - -(defun inlimg-update-in-timer (start end buffer) - "Update image display between START and END in buffer BUFFER." - (with-current-buffer buffer - (let ((here (point)) - res - ovls - prop-pos1 - prop-pos2) - (save-restriction - (widen) - (goto-char start) - (setq ovls (overlays-in start end)) - (dolist (ovl ovls) - (when (overlay-get ovl 'inlimg-img) - (delete-overlay ovl))) - (goto-char start) - (setq prop-pos1 start) - (mumamo-with-buffer-prepared-for-jit-lock - (while (setq prop-pos1 - (next-single-property-change prop-pos1 'inlimg-display)) - (put-text-property prop-pos1 (+ 2 prop-pos1) 'inlimg-display nil) - (put-text-property prop-pos1 (+ 2 prop-pos1) 'display nil))) - (goto-char start) - (setq res (save-match-data - (inlimg-next (point) inlimg-mode)))) - (when (and res - (< res end)) - (inlimg-request-update res end)) - (goto-char here)))) - -(defun inlimg-after-change (beg end pre-len) - "Actions to take after a change in buffer. -This is put in `after-change-functions'. For BEG, END and -PRE-LEN see that function." - (let ((here (point))) - (goto-char beg) - (setq beg (line-beginning-position -2)) - (goto-char end) - (setq end (line-end-position 3)) - (inlimg-request-update beg end))) - -(defun inlimg-update-whole-buffer () - "Request update of image display in the current buffer." - (save-restriction - (widen) - (inlimg-request-update (point-min) (point-max)))) - -(defun inlimg-update-all-buffers () - "Request update of image display in all buffers. -Update image display in all buffers where the option -`inlimg-mode' is on." - (dolist (buff (buffer-list)) - (with-current-buffer buff - (when inlimg-mode - (inlimg-update-whole-buffer))))) - -;;;###autoload -(define-minor-mode inlimg-mode - "Display images inline. -Images are displayed below the tag using the margins in -`inlimg-margins'. The whole image or a slice of it may be -displayed, see `inlimg-slice'. - -See also the command `inlimg-toggle-img-display'." - :keymap nil - :group 'inlimg - (if inlimg-mode - (add-hook 'after-change-functions 'inlimg-after-change nil t) - (remove-hook 'after-change-functions 'inlimg-after-change t)) - (inlimg-cancel-timer) - (inlimg-update-whole-buffer)) -(put 'inlimg-mode 'permanent-local t) - -;;;###autoload -(defun inlimg-toggle-img-display (point) - "Toggle display of img image at point POINT. -See also the command `inlimg-mode'." - (interactive (list (point))) - (save-match-data - (let ((here (point)) - img-start - img-end - (ovls (overlays-at (point))) - iovl - ) - (dolist (ovl ovls) - (when (overlay-get ovl 'inlimg-img) - (setq iovl ovl))) - (if iovl - (progn - (setq img-start (overlay-start iovl)) - (setq img-end (- (overlay-end iovl) 2))) - (skip-chars-backward "^<") - (unless (and (> (point) (point-min)) - (= ?\< (char-before)) - (progn - (backward-char) - (looking-at inlimg-img-regexp))) - (goto-char here) - (error "No image here")) - (setq img-start (point)) - (setq img-end (- (match-end 0) 2))) - (setq is-displayed (get-text-property img-end 'inlimg-display)) - (inlimg-next img-start (not is-displayed)) - (when (and iovl - (not inlimg-mode) - is-displayed) - (delete-overlay iovl)) - (goto-char here)))) - - -(provide 'inlimg) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; inlimg.el ends here diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml-autoload.el b/elpa-to-submit/nxhtml/nxhtml/nxhtml-autoload.el index 9d840c4c2f..6cd46294ec 100644 --- a/elpa-to-submit/nxhtml/nxhtml/nxhtml-autoload.el +++ b/elpa-to-submit/nxhtml/nxhtml/nxhtml-autoload.el @@ -45,123 +45,45 @@ ;; ;;; Code: -;;(require 'ourcomments-util) - -(unless (featurep 'nxml-enc) - ;; This is for the case when nXml is included in Emacs - (require 'nxml-mode)) - -(if (not (or (featurep 'nxml-enc) ;; nXml not in Emacs - (featurep 'nxml-mode))) ;; nXml in Emacs - (progn - (lwarn - '(nxhtml-autoload) - :emergency - (concat - "\n\n\nERROR: nxml not loaded!\n\n" - " Please load nxml before loading nxhtml!\n" - " Load nxml by loading rng-auto.el in the nxml distribution.\n\n\n\n")) - (sit-for 10)) - - (add-to-list 'load-path - (file-name-directory - (if load-file-name load-file-name buffer-file-name))) - - ;;(autoload 'nxhtml-report-bug "nxhtml-bug" "Report a bug in nXhtml." t) - ;;(autoload 'nxhtml-mode "nxhtml" "Major mode for editing XHTML documents." t) - ;;(autoload 'nxhtml-global-minor-mode "nxhtml-menu" "Toggle `nxhtml-minor-mode' in every buffer." t) - ;;(autoload 'gimp-edit-buffer "gimp" "Edit image file in current buffer with GIMP." t) - ;;(autoload 'gimp-edit-file "gimp" "Edit file with GIMP." t) - ;; Testing - (let* ((this-dir (file-name-directory (if load-file-name load-file-name buffer-file-name))) - (test-q-file (expand-file-name "../tests/nxhtmltest-Q.el" this-dir)) - (test-file (expand-file-name "../tests/nxhtmltest-suites.el" this-dir))) - ;;(autoload 'nxhtmltest-run-Q test-q-file "Run all tests defined for nXhtml in fresh Emacs." t) - ;;(autoload 'nxhtmltest-run test-file "Run all tests defined for nXhtml." t) - ;;(autoload 'nxhtmltest-run-indent test-file "Run all indentation tests defined for nXhtml." t) - ) - - ;; (require 'fmode) - ;; (fmode-replace-default-mode 'html-mode 'nxhtml-mode) - ;; (fmode-replace-default-mode 'xml-mode 'nxml-mode) - - ;; Replaced all the major mode file stuff here with majmodpri and - ;; just adding to auto-mode-alist etc: - ;;(require 'majmodpri) - - ;; Add entries similar to those that are already there for html-mode - ;; and xml-mode. - (dolist (mode-list '(auto-mode-alist magic-fallback-mode-alist)) - (dolist (rec (symbol-value mode-list)) - (when (eq (cdr rec) 'html-mode) - (add-to-list mode-list (cons (car rec) 'nxhtml-mode))) - (when (eq (cdr rec) 'html-mode) - (add-to-list mode-list (cons (car rec) 'nxhtml-mumamo-mode))) - (when (eq (cdr rec) 'html-mode) - (add-to-list mode-list (cons (car rec) 'html-mumamo-mode))) - (when (eq (cdr rec) 'xml-mode) - (add-to-list mode-list (cons (car rec) 'nxml-mode))) - )) - - ;;(require 'html-site) - ;;(require 'nxhtml-menu) - - ;;; Change below if you need to: - ;;(autoload 'rnc-mode "rnc-mode" "Major mode for editing RELAX NG" t) - ;;(autoload 'css-mode "css-mode" "Mode for editing css files" t) - ;;(autoload 'javascript-mode "javascript" "Mode for JavaScript" t) - ;;(autoload 'js2-fl-mode "js2-font-lock-new" "Mode for JavaScript" t) - ;;(autoload 'php-mode "php-mode" "Mode for editing php files" t) - ;;(autoload 'smarty-mode "smarty-mode" "Mode for editing php smarty files" t) - ;;(autoload 'csharp-mode "csharp-mode" "Mode for editing C# code" t) - ;;(autoload 'django-mode "django" "Simple Django mode for use with mumamo." t) - (eval-after-load 'nxml-mode - '(progn - (define-key nxml-mode-map [C-M-left] 'nxml-backward-element) - (define-key nxml-mode-map [C-M-right] 'nxml-forward-element) - (define-key nxml-mode-map [C-M-up] 'nxml-backward-up-element) - (define-key nxml-mode-map [C-M-down] 'nxml-down-element))) - - ;; MozLab support, for more info see moz.el - ;;(autoload 'inferior-moz-mode "moz" "MozRepl Inferior Mode" t) - ;;(autoload 'moz-minor-mode "moz" "MozRepl Minor Mode" t) - (defun javascript-moz-setup () (moz-minor-mode 1)) - (add-hook 'javascript-mode-hook 'javascript-moz-setup) - (add-hook 'js2-fl-mode 'javascript-moz-setup) - - ;; Development versions support - ;;(autoload 'udev-rinari-update "udev-rinari" "Fetch and install rinari from the devel sources." t) - ;;(autoload 'udev-cedet-update "udev-cedet" "Fetch and install CEDET from the devel sources." t) - ;;(autoload 'udev-ecb-update "udev-ecb" "Fetch and install ECB from the devel sources." t) - - ;;(require 'mumamo-fun) - ;;(require 'nxhtml-mumamo) - ;;(require 'as-external) - ) - -;; (setq magic-mode-alist nil) -;; (defcustom nxhtml-magic-mode-alist -;; '( - +(message "nxhtml-autoload starting ... (hm, should maybe be renamed ...)") + +(eval-when-compile (require 'majmodpri)) +(eval-when-compile (require 'moz)) + +;;; Convenient moving by tags: +(eval-after-load 'nxml-mode + '(progn + (define-key nxml-mode-map [C-M-left] 'nxml-backward-element) + (define-key nxml-mode-map [C-M-right] 'nxml-forward-element) + (define-key nxml-mode-map [C-M-up] 'nxml-backward-up-element) + (define-key nxml-mode-map [C-M-down] 'nxml-down-element))) + +;; MozLab support, for more info see moz.el +;;(autoload 'inferior-moz-mode "moz" "MozRepl Inferior Mode" t) +;;(autoload 'moz-minor-mode "moz" "MozRepl Minor Mode" t) +(defun javascript-moz-setup () (moz-minor-mode 1)) +(add-hook 'javascript-mode-hook 'javascript-moz-setup) +;;(add-hook 'js2-fl-mode-hook 'javascript-moz-setup) + + +;; Add nXhtml entries similar to those that are already there for +;; html-mode and xml-mode. +(dolist (mode-list '(auto-mode-alist magic-fallback-mode-alist magic-mode-alist)) + (dolist (rec (symbol-value mode-list)) + (when (eq (cdr rec) 'html-mode) + (add-to-list mode-list (cons (car rec) 'nxhtml-mode))) + (when (eq (cdr rec) 'html-mode) + (add-to-list mode-list (cons (car rec) 'nxhtml-mumamo-mode))) + ;; (when (eq (cdr rec) 'html-mode) + ;; (add-to-list mode-list (cons (car rec) 'html-mumamo-mode))) + (when (eq (cdr rec) 'xml-mode) + (add-to-list mode-list (cons (car rec) 'nxml-mode))) + )) + +;; Add multi major mode entries. (add-to-list 'magic-mode-alist '("\\(?:.\\|\n\\)\\{,200\\}xmlns:py=\"http://genshi.edgewall.org/\"" . genshi-nxhtml-mumamo-mode)) -;;; ) -;;; "List to add to `magic-mode-alist'. -;;; Works similar to `nxhtml-auto-mode-alist'. Note that -;;; `magic-mode-alist' is the first thing tried when choosing a major -;;; mode." -;;; :type '(repeat (cons :tag "Enter file name pattern and major mode" -;;; (regexp :tag "Regexp for file name") -;;; (major-mode-function :tag "Major mode"))) -;;; :set (lambda (sym val) -;;; (set-default sym val) -;;; (dolist (v val) -;;; (add-to-list 'magic-mode-alist v))) -;;; :group 'nxhtml) - -;; (defcustom nxhtml-auto-mode-alist -;; '( (add-to-list 'auto-mode-alist '("\\.htm\\'" . nxhtml-mumamo-mode)) (add-to-list 'auto-mode-alist '("\\.html\\'" . nxhtml-mumamo-mode)) (add-to-list 'auto-mode-alist '("\\.xhtm\\'" . nxhtml-mumamo-mode)) @@ -179,50 +101,34 @@ (add-to-list 'auto-mode-alist '("\\.erb\\'" . eruby-nxhtml-mumamo-mode)) (add-to-list 'auto-mode-alist '("\\.phps\\'" . smarty-nxhtml-mumamo-mode)) (add-to-list 'auto-mode-alist '("\\.epl\\'" . embperl-nxhtml-mumamo-mode)) -(add-to-list 'auto-mode-alist '("\\.lzx\\'" . laszlo-nxml-mumamo-mode)) (add-to-list 'auto-mode-alist '("\\.ghtml\\'" . genshi-nxhtml-mumamo-mode)) + +;; Add html-mumamo style entry if there is an nxhtml-mumamo style entry. +(save-match-data + (dolist (mode-list '(auto-mode-alist magic-fallback-mode-alist magic-mode-alist)) + (dolist (rec (symbol-value mode-list)) + (let* ((mode (cdr rec)) + (name (when (symbolp mode) (symbol-name mode))) + nxmode) + (when (and name + (string-match "nxhtml-mumamo" name)) + (setq name (replace-regexp-in-string "nxhtml-mumamo" "html-mumamo" name t t)) + (setq nxmode (intern-soft name)) + (when nxmode + (add-to-list mode-list (cons (car rec) nxmode)))))))) + +(add-to-list 'auto-mode-alist '("\\.lzx\\'" . laszlo-nxml-mumamo-mode)) (add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode)) (add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode)) (add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode)) -;;; ) -;;; "List to add to `auto-mode-alist'. -;;; This list is added to `auto-mode-alist' when loading -;;; nxhtml-autostart.el and will therefore help Emacs to determine -;;; which major mode a file will be opened in. - -;;; Please notice that `mumamo-mode' may override this choice of -;;; major mode when setting the chunk family. The chunk family then -;;; determines the major mode. The chunk family is set from -;;; `mumamo-filenames-list'. You may want to synch the two list, but -;;; it is not necessary. However not synching may perhaps lead to -;;; surpricing results. To synch the lists means that the mode in -;;; this list should correspond to the main major mode in the mumamo -;;; chunk family. - -;;; * Note: This variable (nxhtml-auto-mode-alist) is just for your -;;; convenience. Probably most users normally just adds to -;;; `auto-mode-alist' in their .emacs with lines like - -;;; \(add-to-list 'auto-mode-alist '(\"\\.x?html?\\'\" . nxhtml-mode)) - -;;; but doing something like that here would make it impossible to -;;; customize that easily for you." -;;; ;;:type '(alist :key-type regexp :tag "hej" :value-type major-mode-function) -;;; :type '(repeat (cons :tag "Enter file name pattern and major mode" -;;; (regexp :tag "Regexp for file name") -;;; (major-mode-function :tag "Major mode"))) -;;; ;;(command :tag "Major mode"))) -;;; :set (lambda (sym val) -;;; (set-default sym val) -;;; (dolist (v val) -;;; (add-to-list 'auto-mode-alist v))) -;;; :group 'nxhtml) (majmodpri-sort-lists) (defvar nxhtml-src-dir (file-name-directory (if load-file-name load-file-name buffer-file-name))) -(provide `nxhtml-autoload) +(message "nxhtml-autoload finished") + +(provide 'nxhtml-autoload) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; nxhtml-autoload.el ends here diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml-bug.el b/elpa-to-submit/nxhtml/nxhtml/nxhtml-bug.el index a1820294e2..c415332fb4 100644 --- a/elpa-to-submit/nxhtml/nxhtml/nxhtml-bug.el +++ b/elpa-to-submit/nxhtml/nxhtml/nxhtml-bug.el @@ -44,6 +44,8 @@ ;; ;;; Code: +(eval-when-compile (require 'nxhtml-menu)) + (require 'sendmail) ;;(require 'emacsbug) diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml-menu.el b/elpa-to-submit/nxhtml/nxhtml/nxhtml-menu.el index c57568cafc..7cf6a01002 100644 --- a/elpa-to-submit/nxhtml/nxhtml/nxhtml-menu.el +++ b/elpa-to-submit/nxhtml/nxhtml/nxhtml-menu.el @@ -1,1121 +1,1390 @@ -;;; nxhtml-menu.el --- Defines menus for nXhtml -;; -;; Author: Lennart Borgman (lennart O borgman A gmail O com) -;; Created: Sat Apr 21 13:49:41 2007 -(defconst nxhtml-menu:version "1.61") ;;Version: -;; Last-Updated: 2008-08-26T23:28:00+0200 Tue -;; URL: -;; Keywords: -;; Compatibility: -;; -;; Features that might be required by this library: -;; -;; `compile', `flymake', `flymake-js', `flymake-php', `hexcolor', -;; `tool-bar', `xhtml-help'. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;; Menus for nXhtml to be used in different major modes. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Change log: -;; -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; This program 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 program 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 this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Code: - -(require 'hexcolor) -(require 'flymake) -(require 'flymake-php) -(require 'flymake-js) - -(defun nxhtml-nxhtml-in-buffer () - ;;(message "nxhtml-nxhtml-in-buffer ()") - (or (derived-mode-p 'nxhtml-mode) - (when (and (boundp 'mumamo-multi-major-mode) - mumamo-multi-major-mode) - (let ((major-mode (mumamo-main-major-mode))) - (derived-mode-p 'nxhtml-mode))))) - -(defun nxhtml-nxml-in-buffer () - ;;(message "nxhtml-nxml-in-buffer ()") - (or (derived-mode-p 'nxml-mode) - (when (and (boundp 'mumamo-multi-major-mode) - mumamo-multi-major-mode) - (let ((major-mode (mumamo-main-major-mode))) - (derived-mode-p 'nxml-mode))))) - -(defun nxhtml-html-in-buffer () - ;;(message "nxhtml-html-in-buffer ()") - (or (derived-mode-p 'html-mode) - (when (and (boundp 'mumamo-multi-major-mode) - mumamo-multi-major-mode) - (let ((major-mode (mumamo-main-major-mode))) - (derived-mode-p 'html-mode))) - (nxhtml-nxhtml-in-buffer))) - -(defun nxhtml-nxml-html-in-buffer () - ;;(message "nxhtml-nxml-html-in-buffer") - (or (derived-mode-p 'html-mode) - (when (and (boundp 'mumamo-multi-major-mode) - mumamo-multi-major-mode) - (let ((major-mode (mumamo-main-major-mode))) - (derived-mode-p 'html-mode))) - (nxhtml-nxml-in-buffer))) - -(defun nxhtml-this-file-can-have-toc (&optional file) - (unless file - (setq file (html-site-buffer-or-dired-file-name))) - (and (nxhtml-buffer-possibly-local-viewable file) - (html-site-current-merge-dir) - (html-site-current-ensure-file-in-site file))) - -(defun nxhtml-buffer-possibly-local-viewable (&optional file) - ;;(message "nxhtml-buffer-possibly-local-viewable ()") - (unless file - (setq file (html-site-buffer-or-dired-file-name))) - (or (and file - (member (file-name-extension file) - '("html" "htm" "gif" "png"))))) - -(defun nxhtml-buffer-possibly-remote-viewable () - ;;(message "nxhtml-buffer-possibly-remote-viewable ()") - ;; Fix-me - (let* ((fmt "nxhtml-buffer-possibly-remote-viewable.dgffv: %s") - (file (or buffer-file-name - (and (derived-mode-p 'dired-mode) - (condition-case err - (dired-get-file-for-visit) - (error - (message fmt (error-message-string err)) - nil)))))) - (and (featurep 'html-upl) - file - (member (downcase (file-name-extension file)) - '("html" "htm" "gif" "png" "pl" "php"))))) - -(defun nxhtml-insert-menu-dynamically (real-binding) - ;;(message "nxhtml-insert-menu-dynamically (%s)" real-binding) - (when (and (symbolp real-binding) - (boundp real-binding)) - (symbol-value real-binding))) - -(defun nxhtml-menu-image-file () - (or (get-char-property (point) 'image-file) - buffer-file-name)) - -(defun nxhtml-gimp-can-edit () - (gimp-can-edit (nxhtml-menu-image-file))) - -(defun nxhtml-edit-with-gimp () - "Edit with GIMP buffer or file at point." - (interactive) - (gimp-edit-file (nxhtml-menu-image-file))) - -(defconst nxhtml-minor-mode-menu-map - (let ((map (make-sparse-keymap "nxhtml-minor-mode-menu"))) - - (let ((help-map (make-sparse-keymap))) - (define-key help-map [emacs-Q-nxhtml] - (list 'menu-item "Start 'emacs -Q' and load nXhtml" 'emacs-Q-nxhtml)) - (define-key help-map [nxhtmltest-run] - (list 'menu-item "Run nXhtml Tests in Current Emacs" 'nxhtmltest-run)) - (define-key help-map [nxhtmltest-run-Q] - (list 'menu-item "Run nXhtml Tests in a Fresh Emacs" 'nxhtmltest-run-Q)) - (define-key help-map [nxhtml-report-bug] - (list 'menu-item "Report a Bug in nXhtml ..." 'nxhtml-report-bug)) - (define-key help-map [nxhtml-help-separator2] (list 'menu-item "--")) - (define-key help-map [nxhtml-features-check] - (list 'menu-item "Check Optional Features" 'nxhtml-features-check)) - (define-key help-map [nxhtml-customize] - (list 'menu-item "Customize nXhtml ..." 'nxhtml-customize)) -;;; (define-key help-map [nxhtml-quick-customize] -;;; (list 'menu-item "Quick Customize nXhtml ..." 'nxhtml-quick-customize)) - (define-key help-map [nxhtml-help-separator3] (list 'menu-item "--")) -;;; (define-key help-map [nxhtml-help] -;;; (list 'menu-item "nXhtml Help" 'nxhtml-help)) - (define-key help-map [nxhtml-tutorials] - (list 'menu-item "nXhtml Tutorials" 'nxhtml-tutorials)) - (define-key help-map [nxhtml-overview] - (list 'menu-item (concat "nXhtml Version " nxhtml-menu:version " Overview") 'nxhtml-overview)) - (define-key help-map [nxhtml-welcome] - (list 'menu-item "Welcome to nXhtml" 'nxhtml-welcome)) - (define-key map [nxhtml-help-map] - (list 'menu-item "nXhtml Help and Setup" help-map)) - (define-key map [nxhtml-info-separator] (list 'menu-item "--")) - ) - - - - - (let ((tools-map (make-sparse-keymap))) - (define-key map [nxhtml-tools-map] - (list 'menu-item "Tools" tools-map - :visible `(not (derived-mode-p 'dired-mode)) - )) - (let ((fill-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-filling] - (list 'menu-item "Writing Text" fill-map)) - (define-key fill-map [nxhtml-unfill-paragraph] - (list 'menu-item "Unfill Paragraph" 'unfill-paragraph)) - (define-key fill-map [nxhtml-fill-paragraph] - (list 'menu-item "Fill Paragraph" 'fill-paragraph)) - (define-key fill-map [nxhtml-wrap-to-fill-separator] - (list 'menu-item "--" nil)) - (define-key fill-map [nxhtml-html-write-mode] - (list 'menu-item "HTML Write Mode" - 'html-write-mode - :button '(:toggle . (and (boundp 'html-write-mode) - html-write-mode)))) - (define-key fill-map [nxhtml-wrap-to-fill-column-mode] - (list 'menu-item "Wrap To Fill Column Mode" - 'wrap-to-fill-column-mode - :button '(:toggle . wrap-to-fill-column-mode))) - ) - (define-key tools-map [nxhtml-ecb-separator] - (list 'menu-item "--" nil)) - (let ((ecb-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-ecb-map] - (list 'menu-item "ECB" ecb-map)) - (define-key ecb-map [nxhtml-rinari-homepage] - (list 'menu-item "ECB Home Page" - (lambda () - "Open ECB home page in your web browser." - (interactive) - (browse-url "http://ecb.sourceforge.net/")))) - (define-key ecb-map [nxhtml-ecb-home-separator] - (list 'menu-item "--" nil)) - (define-key ecb-map [nxhtml-update-ecb] - (list 'menu-item "Fetch/update ECB dev sources" - 'udev-ecb-update)) - (define-key ecb-map [nxhtml-custom-ecb] - (list 'menu-item "Customize ECB dev startup" - (lambda () (interactive) - (require 'udev-ecb) - (customize-group-other-window 'udev-ecb)))) - (define-key ecb-map [nxhtml-custom-important-ecb] - (list 'menu-item "Customize important ECB things" - (lambda () (interactive) - (customize-group-other-window 'ecb-most-important)) - :enable (featurep 'ecb))) - ) - ;;(define-key tools-map [nxhtml-cedet-separator] (list 'menu-item "--" nil)) - (let ((cedet-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-cedet-map] - (list 'menu-item "CEDET" cedet-map)) - (define-key cedet-map [nxhtml-rinari-homepage] - (list 'menu-item "CEDET Home Page" - (lambda () - "Open CEDET home page in your web browser." - (interactive) - (browse-url "http://cedet.sourceforge.net/")))) - (define-key cedet-map [nxhtml-cedet-home-separator] - (list 'menu-item "--" nil)) - (define-key cedet-map [nxhtml-update-cedet] - (list 'menu-item "Fetch/update CEDET dev sources" - 'udev-cedet-update)) - (define-key cedet-map [nxhtml-custom-cedet] - (list 'menu-item "Customize CEDET dev startup" - (lambda () (interactive) - (require 'udev-cedet) - (customize-group-other-window 'udev-cedet)))) - ) - (let ((rinari-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-rinari-map] - (list 'menu-item "Rinari" rinari-map)) - (define-key rinari-map [nxhtml-rinari-homepage] - (list 'menu-item "Rinari Home Page" - (lambda () - "Open Rinari home page in your web browser." - (interactive) - (browse-url "http://rubyforge.org/projects/rinari/")))) - (define-key rinari-map [nxhtml-rinari-home-separator] - (list 'menu-item "--" nil)) - (define-key rinari-map [nxhtml-update-rinari] - (list 'menu-item "Fetch/update Rinari dev sources" - 'udev-rinari-update)) - (define-key rinari-map [nxhtml-custom-rinari] - (list 'menu-item "Customize Rinari startup" - (lambda () (interactive) - (require 'udev-rinari) - (customize-group-other-window 'udev-rinari)))) - ) - (let ((mozrepl-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-mozrepl-map] - (list 'menu-item "MozRepl for Javascript" mozrepl-map - )) - (define-key mozrepl-map [nxhtml-mozrepl-home-page] - (list 'menu-item "MozLab/MozRepl Home Page" - (lambda () - "Open MozLab/MozRepl home page in your web browser." - (interactive) - (browse-url "http://hyperstruct.net/projects/mozlab")))) - (define-key mozrepl-map [nxhtml-mozrepl-separator2] - (list 'menu-item "--" nil)) - (define-key mozrepl-map [nxhtml-mozrepl-run-mozilla] - (list 'menu-item "Display/Start MozRepl Process" 'run-mozilla - :enable '(and (boundp 'moz-minor-mode) moz-minor-mode))) - (define-key mozrepl-map [nxhtml-mozrepl-separator1] - (list 'menu-item "--" nil)) - (define-key mozrepl-map [nxhtml-mozrepl-save-and-send] - (list 'menu-item "Save Buffer and Send it" 'moz-save-buffer-and-send - :enable '(or (not (boundp 'mumamo-multi-major-mode)) - (not mumamo-multi-major-mode)))) - - - - (define-key mozrepl-map [nxhtml-mozrepl-send-defun-and-go] - (list 'menu-item "Send Current Function, Go to MozRepl" - 'moz-send-defun-and-go - :enable '(and (boundp 'moz-minor-mode) moz-minor-mode))) - (define-key mozrepl-map [nxhtml-mozrepl-send-defun] - (list 'menu-item "Send Current Function" 'moz-send-defun - :enable '(and (boundp 'moz-minor-mode) moz-minor-mode))) - (define-key mozrepl-map [nxhtml-mozrepl-send-region] - (list 'menu-item "Send the Region" 'moz-send-region - :enable '(and mark-active - (boundp 'moz-minor-mode) moz-minor-mode))) - ) - (define-key tools-map [nxhtml-majpri-separator] - (list 'menu-item "--" nil)) - (let ((majpri-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-majpri-map] - (list 'menu-item "Major Modes Priorities" majpri-map)) - (define-key majpri-map [nxhtml-majpri-act] - (list 'menu-item "Apply Major Modes Priorities" - 'majmodpri-apply-priorities)) - (define-key majpri-map [nxhtml-majpri-cust] - (list 'menu-item "Customize Major Mode Priorities" - (lambda () (interactive) - (customize-group-other-window 'majmodpri)))) - ) - (define-key tools-map [nxhtml-tidy-separator] - (list 'menu-item "--" nil)) - (define-key tools-map [nxhtml-tidy-map] - (list 'menu-item "Tidy XHTML" 'tidy-menu-symbol - :filter 'nxhtml-insert-menu-dynamically - :visible '(featurep 'tidy-xhtml) - :enable '(and (featurep 'tidy-xhtml) - (or (derived-mode-p 'html-mode) - (nxhtml-nxhtml-in-buffer))))) - (define-key tools-map [nxhtml-flymake] - (list 'menu-item "Flymake Mode" 'flymake-mode - :button '(:toggle . flymake-mode) - :enable '(and buffer-file-name - (flymake-get-init-function buffer-file-name) - ))) - (let ((flyspell-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-flyspell-map] - (list 'menu-item "Flyspell" flyspell-map)) - (define-key flyspell-map [nxhtml-flyspell-goto-next] - (list 'menu-item "Flyspell Go To Next Error" 'flyspell-goto-next-error - :enable 'flyspell-mode)) - (define-key flyspell-map [nxhtml-flyspell-region] - (list 'menu-item "Flyspell Region" 'flyspell-region - :enable 'flyspell-mode)) - (define-key flyspell-map [nxhtml-flyspell-div-1] - (list 'menu-item "--")) - (define-key flyspell-map [nxhtml-flyspell] - (list 'menu-item "Flyspell Mode" 'flyspell-mode - :button '(:toggle . flyspell-mode))) - ) - (define-key tools-map [nxhtml-flyspell-separator] - (list 'menu-item "--")) - (let ((img-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-img-map] - (list 'menu-item "Images" img-map)) - (define-key img-map [nxhtml-gimp-edit] - (list 'menu-item "Edit with GIMP" 'nxhtml-edit-with-gimp - :enable '(nxhtml-gimp-can-edit))) - (define-key img-map [nxhtml-gimp-separator] - (list 'menu-item "--")) - (define-key img-map [nxhtml-inlimg-toggle-img] - (list 'menu-item "Toggle Display of Image" 'inlimg-toggle-img-display)) - (define-key img-map [nxhtml-inlimg-mode] - (list 'menu-item "Show Images" 'inlimg-mode - :button '(:toggle . (and (boundp 'inlimg-mode) inlimg-mode))))) - (define-key tools-map [nxhtml-img-separator] - (list 'menu-item "--")) - (let ((some-help-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-some-help-map] - (list 'menu-item "Help for Item at Point" some-help-map)) - (define-key some-help-map [nxhtml-css-help] - (list 'menu-item "CSS Help" 'xhtml-help-show-css-ref - :enable '(featurep 'xhtml-help))) - (define-key some-help-map [nxhtml-tag-help] - (list 'menu-item "XHTML Tag Help" 'nxhtml-short-tag-help - :enable '(featurep 'xhtml-help)))) - - (let ((hexclr-map (make-sparse-keymap))) - (define-key tools-map [nxhtml-hexcolor] - (list 'menu-item "Color Help" hexclr-map)) - (define-key hexclr-map [nxhtml-hexcolor-mode] - (list 'menu-item "Hex Color Mode" - 'hexcolor-mode - :filter 'nxhtml-insert-menu-dynamically - :enable '(and font-lock-mode - (or (not (boundp 'mumamo-multi-major-mode)) - (not mumamo-multi-major-mode)) - (featurep 'hexcolor)) - :button '(:toggle . (and (boundp 'hexcolor-mode) hexcolor-mode)))) - (define-key hexclr-map [nxhtml-hexcolor-test] - (list 'menu-item "Color Test" 'hexcolor-test - :enable '(featurep 'hexcolor)))) - - (let ((where-map (make-sparse-keymap))) - (define-key tools-map [nxml-where] - (list 'menu-item "XML Path" where-map - :enable '(and (fboundp 'nxml-where-mode) - (or (derived-mode-p 'nxml-mode) - (nxhtml-nxhtml-in-buffer))))) - (define-key where-map [nxml-where-id] - (list 'menu-item "Show tag ids in path" 'nxml-where-tag+id-toggle - :enable '(boundp 'nxml-where-tag+id) - :button '(:toggle . (and (boundp 'nxml-where-tag+id) - nxml-where-tag+id)))) - (define-key where-map [nxml-where-header] - (list 'menu-item "Show XML path in header" 'nxml-where-header-toggle - :enable '(boundp 'nxml-where-header) - :button '(:toggle . (and (boundp 'nxml-where-header) - 'nxml-where-header)))) - (define-key where-map [nxml-where-marks] - (list 'menu-item "Show XML path marks" 'nxml-where-marks-toggle - :enable '(boundp 'nxml-where-marks) - :button '(:toggle . (and (boundp 'nxml-where-marks) - nxml-where-marks)))) - (define-key where-map [where-separator] (list 'menu-item "--")) - (define-key where-map [nxml-where-global-toggle] - (list 'menu-item "Show XML path" 'nxml-where-global-mode - :button '(:toggle . nxml-where-global-mode))) - (define-key where-map [nxml-where-toggle] - (list 'menu-item "Show XML path in buffer" 'nxml-where-mode - :button '(:toggle . (and (boundp 'nxml-where-mode) - nxml-where-mode)))) - )) - - (let ((quick-map (make-sparse-keymap))) - (define-key map [nxhtml-quick-map] - (list 'menu-item "Quick Inserts etc" quick-map - :visible '(or (derived-mode-p 'html-mode) - (nxhtml-nxhtml-in-buffer)))) - (let ((sometoc-map (make-sparse-keymap))) - (let ((toc-map (make-sparse-keymap))) - (define-key sometoc-map [nxhtml-toc-map] - (list 'menu-item "For Site" toc-map - :enable '(featurep 'html-toc))) - (define-key toc-map [nxhtml-html-wtoc] - (list 'menu-item "Merge Pages and TOC" - 'html-wtoc-write-pages-with-toc - :enable '(and (html-site-current-page-list)))) - (define-key toc-map [nxthml-html-toc] - (list 'menu-item "With Frames" 'html-toc-menu-map - :filter 'nxhtml-insert-menu-dynamically))) - (define-key sometoc-map [nxhtml-html-pagetoc] - (list 'menu-item "For Page" 'html-pagetoc-menu-map - :filter 'nxhtml-insert-menu-dynamically - :enable '(featurep 'html-pagetoc))) - (define-key quick-map [nxhtml-sometoc-map] - (list 'menu-item "Table of Contents" sometoc-map - :visible '(or (derived-mode-p 'html-mode) - (nxhtml-nxhtml-in-buffer))))) - (define-key quick-map [nxhtml-quick-sep-1] - (list 'menu-item "--")) - (define-key quick-map [nxhtml-spec-chars] - (list 'menu-item "Insert special character" - 'nxml-insert-named-char)) - (define-key quick-map [nxhtml-css-rollover] - (list 'menu-item "Insert CSS Rollover Images" - 'nxhtml-rollover-insert-2v))) - - (define-key map [nxhtml-help-tools-separator] - ;; Notice that removing nil below gives an error that is quite - ;; hard to catch: - ;; - ;; Wrong type argument: arrayp, not - (list 'menu-item "--" nil - :visible `(not (derived-mode-p 'dired-mode)) - )) - - - (let ((upl-map (make-sparse-keymap "html-upl"))) - (define-key map [nxhtml-upl-map] - (list 'menu-item "File Transfer" upl-map - :enable '(featurep 'html-upl))) - (define-key upl-map [nxhtml-upl-remote-dired] - (list 'menu-item "Remote Dired" 'html-upl-remote-dired)) - (define-key upl-map [nxhtml-upl-dired-sep] (list 'menu-item "--")) - (define-key upl-map [nxhtml-upl-edit-remote-wtoc] - (list 'menu-item "Edit Remote File With TOC" 'html-upl-edit-remote-file-with-toc - :visible '(nxhtml-this-file-can-have-toc))) - (define-key upl-map [nxhtml-upl-edit-remote] - (list 'menu-item "Edit Remote File" 'html-upl-edit-remote-file)) - (define-key upl-map [nxhtml-upl-ediff-file] - (list 'menu-item "Ediff Remote/Local Files" 'html-upl-ediff-file)) - (define-key upl-map [nxhtml-upl-sep] (list 'menu-item "--")) - (define-key upl-map [nxhtml-upl-upload-site-with-toc] - (list 'menu-item "Upload Site with TOC" 'html-upl-upload-site-with-toc - :visible '(and (html-site-current-merge-dir) - (html-site-current-ensure-file-in-site file)))) - (define-key upl-map [nxhtml-upl-upload-site] - (list 'menu-item "Upload Site" 'html-upl-upload-site)) - (define-key upl-map [nxhtml-upl-upload-file] - (list 'menu-item "Upload Single File" 'html-upl-upload-file)) - ) - - - (let ((browse-map (make-sparse-keymap))) - (define-key map [nxhtml-browse-map] - (list 'menu-item "Browse" browse-map - '(or buffer-file-name - (eq major-mode 'nxhtml-mode)) - :enable '(nxhtml-buffer-possibly-local-viewable))) - (define-key browse-map [nxhtml-browse-region] - (list 'menu-item "Browse the Region Only" 'nxhtml-browse-region - :enable 'mark-active)) - (define-key browse-map [nxhtml-upl-sep3] (list 'menu-item "--")) - (define-key browse-map [nxhtml-upl-browse-remote-wtoc] - (list 'menu-item "Browse Uploaded File With TOC" 'html-upl-browse-remote-with-toc - :visible '(and (nxhtml-buffer-possibly-local-viewable) - (featurep 'html-wtoc) - (html-site-current-merge-dir) - (html-site-current-ensure-file-in-site file) - (nxhtml-buffer-possibly-remote-viewable) - ))) - (define-key browse-map [nxhtml-upl-browse-remote-frame-file] - (list 'menu-item "Browse Uploaded Frames File" 'html-upl-browse-remote-frames - :enable '(nxhtml-buffer-possibly-remote-viewable))) - (define-key browse-map [nxhtml-upl-browse-remote] - (list 'menu-item "Browse Uploaded File" 'html-upl-browse-remote - :enable '(nxhtml-buffer-possibly-remote-viewable))) - (define-key browse-map [nxhtml-upl-sep2] - (list 'menu-item "--")) - (define-key browse-map [nxhtml-browse-merged-file] - (list 'menu-item "Browse File With TOC" 'html-wtoc-browse-page-with-toc - :visible '(and (nxhtml-buffer-possibly-local-viewable) - (featurep 'html-wtoc) - (html-site-current-merge-dir) - (html-site-current-ensure-file-in-site file) - ))) - (define-key browse-map [nxhtml-browse-frame-file] - (list 'menu-item "Browse Frames File" 'html-toc-browse-frames-file - :enable '(and (featurep 'html-toc) - (nxhtml-buffer-possibly-local-viewable)))) - (define-key browse-map [nxhtml-browse-file] - (list 'menu-item "Browse File" 'nxhtml-browse-file - :enable '(nxhtml-buffer-possibly-local-viewable))) - ) - - - (let ((link-map (make-sparse-keymap))) - - (define-key link-map [nxhtml-chklnk] - (list 'menu-item "Check Links" 'html-chklnk-check-site-links - :enable '(featurep 'html-chklnk))) - - (let ((move-map (make-sparse-keymap))) - (define-key move-map [html-move-buffer-file] - (list 'menu-item "Move Buffer File" 'html-move-buffer-file - :help "Move buffer file and update links" - :enable '(and buffer-file-name - (featurep 'html-move)))) - (define-key link-map [move-map] - (list 'menu-item "Moving Files" move-map)) - (define-key link-map [move-map-separator] (list 'menu-item "--")) - ) - - - (define-key link-map [nxhtml-paste-link] - (list 'menu-item "Paste Saved Relative Link" 'nxhtml-paste-link - :help "Paste link" - :enable '(and (boundp 'nxhtml-saved-link-file) - nxhtml-saved-link-file))) - (define-key link-map [nxhtml-paste-link-as-a-tag] - (list 'menu-item "Paste Saved Relative Link as " 'nxhtml-paste-link-as-a-tag - :help "Paste link as tag" - :enable '(and (boundp 'nxhtml-saved-link-file) - nxhtml-saved-link-file - (nxhtml-nxml-html-in-buffer)))) - (define-key link-map [nxhtml-save-link-to-here] - (list 'menu-item "Save Relative Link to Current File" 'nxhtml-save-link-to-here - :help "Save link info for current file" - :enable 'buffer-file-name)) - - (define-key link-map [nxhtml-separator-1] (list 'menu-item "--")) - (define-key link-map [mlinks-goto-link-other-frame] - (list 'menu-item "Follow MLink Link in New Frame" 'mlinks-goto-other-frame - :enable '(and (boundp 'mlinks-mode) - mlinks-mode) - :help "Follow MLinks Link in New Frame")) - (define-key link-map [mlinks-goto-link-other-window] - (list 'menu-item "Follow MLink Link in Other Window" 'mlinks-goto-other-window - :enable '(and (boundp 'mlinks-mode) - mlinks-mode) - :help "Follow MLinks Link in Other Window")) - (define-key link-map [mlinks-goto-link] - (list 'menu-item "Follow MLink Link" 'mlinks-goto - :enable '(and (boundp 'mlinks-mode) - mlinks-mode) - :help "Follow MLinks Link")) - (define-key link-map [nxhtml-separator-follow-mlink] (list 'menu-item "--")) - (define-key link-map [mlinks-next-link] - (list 'menu-item "Next MLink Link" 'mlinks-forward-link - :enable '(and (boundp 'mlinks-mode) - mlinks-mode) - :help "Go to next MLinks link")) - (define-key link-map [mlinks-prev-link] - (list 'menu-item "Previous MLink Link" 'mlinks-backward-link - :enable '(and (boundp 'mlinks-mode) - mlinks-mode) - :help "Go to previous MLinks link")) - -;; (define-key link-map [nxhtml-next-href] -;; (list 'menu-item "Next Link" 'nxhtml-next-href -;; :help "Go to next href field")) -;; (define-key link-map [nxhtml-prev-href] -;; (list 'menu-item "Previous Link" 'nxhtml-prev-href -;; :help "Go to previous href field")) - - (define-key map [nxhtml-link-map] - (list 'menu-item "Links" link-map - :visible `(not (derived-mode-p 'dired-mode)) - ))) - - - (let ((site-map (make-sparse-keymap))) - (define-key map [nxhtml-site-map] - (list 'menu-item "Site" site-map)) - (define-key site-map [html-site-global-mode] - (list 'menu-item "HTML Site Global Mode" - 'html-site-global-mode - :button '(:toggle . (and (boundp 'html-site-global-mode) - html-site-global-mode)))) - (define-key site-map [nxhtml-site-separator] (list 'menu-item "--")) - (define-key site-map [nxhtml-customize-site-list] - (list 'menu-item "Edit Sites" (lambda () (interactive) - (customize-option-other-window 'html-site-list)))) - (define-key site-map [nxhtml-set-site] - (list 'menu-item "Set Current Site" 'html-site-set-site)) - (define-key site-map [nxhtml-site-separator-1] (list 'menu-item "--")) - (define-key site-map [nxhtml-dired-site-top] - (list 'menu-item "Dired Site" 'html-site-dired-current)) - (define-key site-map [nxhtml-find-site-file] - (list 'menu-item "Find File in Site" 'html-site-find-file)) - (define-key site-map [nxhtml-site-search-separator] - (list 'menu-item "--" nil)) - (define-key site-map [nxhtml-replace-in-site] - (list 'menu-item "Replace in Site Files" 'html-site-query-replace)) - (define-key site-map [nxhtml-rgrep-in-site] - (list 'menu-item "Search Site Files" 'html-site-rgrep)) - ) - - (define-key map [nxhtml-insert-separator] - (list 'menu-item "--" nil - :visible `(not (derived-mode-p 'dired-mode)) - )) - (let ((chunk-map (make-sparse-keymap))) - (define-key map [nxhtml-chunk-map] - (list 'menu-item "Chunk" chunk-map - :visible `(not (derived-mode-p 'dired-mode)) - :enable '(and (boundp 'mumamo-multi-major-mode) - mumamo-multi-major-mode))) - (define-key chunk-map [mumamo-mark-chunk] - (list 'menu-item "Mark Chunk" - 'mumamo-mark-chunk)) - (define-key chunk-map [nxhtml-separator-mark-chunk] (list 'menu-item "--")) - (define-key chunk-map [mumamo-backward-chunk] - (list 'menu-item "Backward Chunk" - 'mumamo-backward-chunk)) - (define-key chunk-map [mumamo-forward-chunk] - (list 'menu-item "Forward Chunk" - 'mumamo-forward-chunk))) - (let ((tag-map (make-sparse-keymap))) - (define-key map [nxhtml-tag-map] - (list 'menu-item "Move by Tag" tag-map - :visible '(or (derived-mode-p 'nxml-mode) - (derived-mode-p 'sgml-mode)) - :enable '(or (derived-mode-p 'nxml-mode) - (nxhtml-nxhtml-in-buffer)))) - (define-key tag-map [nxml-forward-par] - (list 'menu-item "Forward Paragraph" - 'nxml-forward-paragraph)) - (define-key tag-map [nxml-backward-par] - (list 'menu-item "Backward Paragraph" - 'nxml-backward-paragraph)) - (define-key tag-map [nxml-insert-separator-move2] (list 'menu-item "--")) - (define-key tag-map [nxml-down] - (list 'menu-item "Forward Into Tag" - 'nxml-down-element)) - (define-key tag-map [nxml-backward-up] - (list 'menu-item "Backward Out of Tag" - 'nxml-backward-up-element)) - (define-key tag-map [nxml-insert-separator-move] (list 'menu-item "--")) - (define-key tag-map [nxml-forward] - (list 'menu-item "Forward Balanced Tag" - 'nxml-forward-element)) - (define-key tag-map [nxml-backward] - (list 'menu-item "Backward Balanced Tag" - 'nxml-backward-element)) - ) - - (let ((cmpl-map (make-sparse-keymap))) - (define-key map [nxhtml-cmpl-map] - (list 'menu-item "Completion and Validation" cmpl-map - ;; :enable '(or (derived-mode-p 'nxml-mode) (nxhtml-nxhtml-in-buffer)) - :visible `(not (derived-mode-p 'dired-mode)) - )) - (let ((val-map (make-sparse-keymap))) - (define-key cmpl-map [nxhtml-cmpl-val-map] - (list 'menu-item "Validation Helpers (for php etc)" val-map - :enable '(nxhtml-nxhtml-in-buffer) - :visible '(nxhtml-nxml-html-in-buffer))) -;;; (define-key val-map [nxhtml-strval-mode] -;;; (list 'menu-item "Allow attr=\"\" etc" -;;; 'nxhtml-strval-mode -;;; :button '(:toggle . nxhtml-strval-mode))) - (define-key val-map [nxhtml-toggle-warnings] - (list 'menu-item "Hide Validation Errors" - 'nxhtml-toggle-visible-warnings - :button '(:toggle . (not (nxhtml-warnings-are-visible))) - )) - (define-key val-map [nxhtml-error-separator] (list 'menu-item "--")) - (define-key val-map [nxhtml-remove-saved-validation-header] - (list 'menu-item "Remove File's Fictive XHTML Validation Header" - 'nxhtml-remove-saved-validation-header - ;; Fix-me: maybe a better enable here? - :enable 'nxhtml-validation-header-mode)) - (define-key val-map [nxhtml-save-validation-header] - (list 'menu-item "Save File's Fictive XHTML Validation Header" - 'nxhtml-save-validation-header - :enable 'nxhtml-validation-header-mode)) - (define-key val-map [nxhtml-set-validation-header] - (list 'menu-item "Choose Fictive XHTML Validation Header for Buffer" - 'nxhtml-set-validation-header)) - (define-key val-map [nxhtml-update-validation-header] - (list 'menu-item "Update Fictive XHTML Validation Header for Buffer" - 'nxhtml-update-validation-header)) - (define-key val-map [nxhtml-use-saved-val-separator] (list 'menu-item "--")) -;;; (let ((afic-map (make-sparse-keymap))) -;;; (define-key val-map [nxhtml-afic-map] -;;; (list 'menu-item "Automatic Fictive XHTML Validation Header" afic-map)) -;;; (define-key afic-map [nxhtml-validation-header-mumamo-set] -;;; (list 'menu-item "Customize Automatic XHTML Validation Turn On" -;;; (lambda () (interactive) (customize-option 'nxhtml-validation-header-mumamo-modes)))) -;;; (define-key afic-map [nxhtml-validation-header-mumamo] -;;; (list 'menu-item "Turn on Fictive XHTML Validation Header with MuMaMo" -;;; 'nxhtml-validation-header-if-mumamo-toggle -;;; :button '(:toggle . nxhtml-validation-header-if-mumamo)))) - (define-key val-map [nxhtml-show-validation-header] - (list 'menu-item "Display Fictive XHTML Validation Header" - 'rngalt-display-validation-header-toggle - :help-echo "Displays the Fictive XHTML validation header (if any) at top of buffer" - :button '(:toggle . rngalt-display-validation-header))) - (define-key val-map [nxhtml-recheck-validation-header] - (list 'menu-item "Recheck Fictive XHTML Validation Header in Buffer" - 'nxhtml-recheck-validation-header - :enable 'nxhtml-validation-header-mode)) - (define-key val-map [nxhtml-validation-header-mode] - (list 'menu-item "Use Fictive XHTML Validation Header in Buffer" - 'nxhtml-validation-header-mode - :button '(:toggle . nxhtml-validation-header-mode))) - ) - (define-key cmpl-map [nxhtml-validation-separator] - (list 'menu-item "--" nil - :visible '(nxhtml-nxml-html-in-buffer))) - (let ((style-map (make-sparse-keymap))) - (define-key cmpl-map [nxhtml-cmpl-style-map] - (list 'menu-item "Completion Style" style-map - :visible '(nxhtml-nxml-html-in-buffer) - :enable '(nxhtml-nxhtml-in-buffer))) - ;;(defun nxhtml-nxml-html-in-buffer () - (define-key style-map [popcmp-with-help] - (list 'menu-item "Show Short Help Beside Alternatives" - 'popcmp-short-help-beside-alts-toggle - :button '(:toggle . popcmp-short-help-beside-alts))) - (define-key style-map [nxhtml-tag-do-also] - (list 'menu-item "Complete Tag Extras" - 'nxhtml-tag-do-also-toggle - :button '(:toggle . nxhtml-tag-do-also))) - (define-key style-map [popcmp-group-alternatives] - (list 'menu-item "Group Alternatives" - 'popcmp-group-alternatives-toggle - :button '(:toggle . popcmp-group-alternatives))) - (define-key style-map [popcmp-popup-completion] - (list 'menu-item "Popup Style Completion" - 'popcmp-popup-completion-toggle - :button '(:toggle . popcmp-popup-completion))) - ) - (define-key cmpl-map [nxhtml-cmpl-separator] - (list 'menu-item "--" nil - :visible '(nxhtml-nxml-html-in-buffer))) - (define-key cmpl-map [nxhtml-untag-element] - (list 'menu-item "Untag Element" 'nxml-untag-element - :enable '(nxhtml-nxhtml-in-buffer) - :visible '(nxhtml-nxml-html-in-buffer))) - (define-key cmpl-map [rngalt-finish-element] - (list 'menu-item "Insert End Tag" 'rngalt-finish-element - :enable '(nxhtml-nxhtml-in-buffer) - :visible '(nxhtml-nxml-html-in-buffer))) - (define-key cmpl-map [nxhtml-complete] - (list 'menu-item "Complete tag, attribute etc" 'nxml-complete - :enable '(nxhtml-nxml-in-buffer) - :visible '(nxhtml-nxml-html-in-buffer))) - (define-key cmpl-map [nxhtml-tab-complete-div] - (list 'menu-item "--" nil - :visible '(nxhtml-nxml-html-in-buffer))) - (define-key cmpl-map [nxhtml-tab-complete] - (list 'menu-item "Indent and then Complete" 'tabkey2-first)) - ) - - map)) - -(defvar nxhtml-minor-mode-map - (let ((map (make-sparse-keymap))) - (require 'xhtml-help nil t) - (when (featurep 'xhtml-help) - (define-key map [(control ?c) ?? ?x] 'nxhtml-short-tag-help) - (define-key map [(control ?c) ?? ?c] 'xhtml-help-show-css-ref) - ) - (define-key map [(control ?c) ?_] 'nxhtml-toggle-visible-warnings) - (define-key map [menu-bar nxhtml-minor-mode] - (list 'menu-item "nXhtml" nxhtml-minor-mode-menu-map)) - map)) - -;;;###autoload -(define-minor-mode nxhtml-minor-mode - "Minor mode to turn on some key and menu bindings. -See `nxhtml-mode' for more information." - :keymap nxhtml-minor-mode-map - :group 'nxhtml - ;;(if nxhtml-minor-mode (message "+++> Turning on nxhtml-minor-mode") (message "---> Turning off nxhtml-minor-mode")) - ) -;;(put 'nxhtml-minor-mode 'permanent-local t) - -(defcustom nxhtml-minor-mode-modes - '( - nxhtml-mode - nxml-mode - html-mode - sgml-mode - xml-mode - php-mode - css-mode - javascript-mode - java-mode ;; jsp - image-mode - ;; - dired-mode - ) - "List for turning on `nxhtml-minor-mode'. -If the buffer's major modes is any of those in this list then -`nxhtml-global-minor-mode' will turn on `nxhtml-minor-mode' in -the buffer." - :type '(repeat (symbol :tag "Major mode")) - :group 'nxhtml) - -(defun nxhtml-maybe-turn-on-minor-mode () - "Maybe turn on `nxhtml-minor-mode'. -See `nxhtml-minor-mode-modes'." - (unless (or (minibufferp (current-buffer)) - (string= " " (substring (buffer-name) 0 1)) - (string= "*" (substring (buffer-name) 0 1)) - ) - (let ((on (and (boundp 'mumamo-multi-major-mode) - mumamo-multi-major-mode))) - (dolist (major nxhtml-minor-mode-modes) - (when (derived-mode-p major) - (setq on t))) -;; (when (string= "php" (file-name-extension (buffer-file-name))) -;; (lwarn 't :warning "on=%s, major-mode=%s" on major-mode)) - (when on - (nxhtml-minor-mode 1))))) - -;;;###autoload -(define-globalized-minor-mode nxhtml-global-minor-mode - nxhtml-minor-mode - nxhtml-maybe-turn-on-minor-mode - :require 'nxhtml-menu - :group 'nxhtml) -(custom-reevaluate-setting 'nxhtml-global-minor-mode) -(when nxhtml-global-minor-mode (nxhtml-global-minor-mode 1)) - - -(defun nxhtml-docfile () - (let* ((libfile (locate-library "nxhtml")) - (docfile (expand-file-name "doc/nxhtml.html" - (file-name-directory libfile)))) - docfile)) - -(defun nxhtml-docfile-url () - (concat "file://" (nxhtml-docfile))) - -(defun nxhtml-overview () - "Show a HTML page with an overview of nXhtml." - (interactive) - (browse-url (nxhtml-docfile-url))) - -(defun nxhtml-tutorials () - "Show a HTML page with a list of tutorials for nXhtml'." - (interactive) - (browse-url "http://ourcomments.org/Emacs/nXhtml/tut/tutorials.html")) - -(defun nxhtml-custom-valfaced (value &optional bgcolor) - (let ((v (if (sequencep value) - (copy-seq value) - value)) - (bgcolor (if bgcolor bgcolor "RGB:FF/FF/AA"))) - (put-text-property 0 (length v) - 'face (list - 'bold - (cons 'background-color bgcolor) - ) - v) - v)) -(defun nxhtml-custom-insert-nxhtml-row (symbol nxhtml-value description) - (let ((desc (if description - (format "%s (%s)" description symbol) - (format "%s" (custom-unlispify-tag-name symbol))))) - (widget-insert " " description " (") - (nxhtml-custom-describe-defun symbol) - (widget-insert "): " - (nxhtml-custom-valfaced - (format "%s" (symbol-value symbol)) - (if (eq (symbol-value symbol) - nxhtml-value) - "GreenYellow" - "gainsboro")) - "\n"))) - -(defun nxhtml-custom-h1(title &optional divider top-newline) - (let ((s title)) - (put-text-property 0 (length s) - 'face '(:weight bold - :height 1.4 - :foreground "DarkGreen" - ;;:underline t - ) - s) - (when top-newline (widget-insert "\n")) - ;;(when divider (widget-insert (nxhtml-custom-divider (length s)))) - (widget-insert s) - )) - -(defun widget-button-notify (widget &rest ignore) - (apply (widget-get widget 'function) (widget-get widget 'data))) - -(defun widget-insert-link (txt function data) - (widget-insert-button txt function data - :button-face 'link - :mouse-face 'highlight - :button-prefix "" - :button-suffix "")) - -(defun widget-insert-button (txt function data &rest keywords) - (let ((btn (apply 'widget-create - (append - '(push-button - :notify - widget-button-notify) - keywords - (list txt))))) - (widget-put btn 'data data) - (widget-put btn 'function function))) - -(defun nxhtml-custom-url-link (txt url) - (let ((plain-url (substring-no-properties url))) - (unless (equal txt url) - (put-text-property 0 (length txt) 'help-echo plain-url txt)) - (put-text-property 0 (length txt) 'mouse-face 'highlight txt) - (widget-insert-link txt 'browse-url (list url)))) - -(defun nxhtml-custom-describe-defun (sym &optional help) - (let ((txt (symbol-name sym))) - (when help - (put-text-property 0 (length txt) 'help-echo help txt)) - (put-text-property 0 (length txt) 'mouse-face 'highlight txt) - (widget-insert-link txt 'describe-function (list sym)))) - -;; (defun nxhtml-quick-customize (&optional same-window) -;; "Show page for Quick Customize of nXhtml." -;; (interactive) -;; (require 'nxhtml) -;; (require 'custom) -;; (require 'cus-edit) -;; (if same-window -;; (switch-to-buffer "*Quick Customize nXhtml*") -;; (switch-to-buffer-other-window "*Quick Customize nXhtml*")) -;; (kill-all-local-variables) -;; (custom-mode) -;; (let ((inhibit-read-only t)) -;; (erase-buffer)) -;; (let ((sFound "found") -;; (sError "error")) -;; (put-text-property 0 (length sFound) -;; 'face '(bold -;; (foreground-color . "green")) sFound) -;; (put-text-property 0 (length sError) -;; 'face '(bold -;; (foreground-color . "red")) sError) -;; (let* ( -;; (default-used "(not set yet - default used)") -;; ) -;; (nxhtml-custom-h1 "Quick Customize for nXhtml" t) -;; (widget-insert " - -;; This page is for a quick and easy setup of some ") -;; (nxhtml-custom-url-link "nXhtml" (nxhtml-docfile-url)) -;; (widget-insert " features -;; that I did not want to turn on by default since they alter what -;; happens when you open a file. I suggest however that you turn -;; them on since they are quite useful if you just understands what -;; is happening. - -;; The values you set here are saved so that they will be used next -;; time you start Emacs too.") -;; ;;(widget-insert-link "customize nXhtml" 'customize-group (list 'nxhtml)) -;; (widget-insert "\n\n") - -;; (nxhtml-custom-insert-nxhtml-row 'nxhtml-global-minor-mode t "Show the nXhtml menu in all relevant buffers\n\t") -;; ;;(nxhtml-custom-insert-nxhtml-row 'mumamo-global-mode t "Turn on Multiple Major Mode in all relevant buffers\n\t") -;; ;;(nxhtml-custom-insert-nxhtml-row 'mlinks-global-mode t "Make link of lins, for example href=\"...\"\n\t") -;; ;;(nxhtml-custom-insert-nxhtml-row 'indent-region-mode t "Use TAB to indent region when it is selected\n\t") - -;; (widget-insert "\n") -;; (widget-insert-button " Turn them all on " -;; (lambda () -;; (nxhtml-quick-all t) -;; (nxhtml-quick-customize t)) -;; nil) -;; (widget-insert " ") -;; (widget-insert-button " Turn them all off " -;; (lambda () -;; (nxhtml-quick-all nil) -;; (nxhtml-quick-customize t)) -;; nil) -;; (beginning-of-line) -;; ))) - -;; (defun nxhtml-quick-all (on) -;; (custom-set-and-prepare-save 'nxhtml-global-minor-mode on) -;; ;;(custom-set-and-prepare-save 'mumamo-global-mode on) -;; (custom-set-and-prepare-save 'indent-region-mode on) -;; (when custom-file -;; (custom-save-all))) - -(defun custom-set-and-prepare-save (symbol value) - "Set SYMBOL to VALUE and add to customize. -Both the current value and the value to save is set, but -`custom-save-all' must be called to save customization." - (customize-set-variable symbol value) - (customize-set-value symbol value) - (customize-mark-to-save symbol)) - - -;;(nxhtml-quick-customize) - -(defun nxhtml-welcome () - "Show welcome information." - (interactive) - (require 'cus-edit) - (let* ((bufnam "*nXhtml Welcome*") - (oldbuf (get-buffer bufnam)) - (curwin (selected-window))) - (switch-to-buffer-other-window bufnam) - (unless oldbuf - (let ((inhibit-read-only t) - (here (point))) - (custom-mode) - (setq cursor-in-non-selected-windows nil) - (nxhtml-custom-h1 "Welcome to nXhtml - a package for web editing" t) - (insert "\n\n") - (setq here (point)) - (insert "If you have not done it already it might " - "be a good time to read at least The Quick Guide in the ") - (nxhtml-custom-url-link "nXhtml overview" (nxhtml-docfile-url)) - (insert " now.\n\n") - (fill-region here (point)) - (setq here (point)) - (insert "And oh, wait! If you are new to Emacs too you might want " - "to take a quick ") - (nxhtml-custom-url-link - "Emacs tour" - "http://www.gnu.org/software/emacs/tour/") - (insert ". And then perhaps the Emacs tutorial " - "(which is in the Help menu above).\n\n") - (fill-region here (point)) - (setq here (point)) - -;;; (insert " - -;;; To make the use of nXhtml as smooth as possible I also recommend -;;; that you go to ") - -;;; (widget-insert-link "Quick Customize nXhtml" -;;; (lambda () -;;; (nxhtml-quick-customize)) -;;; nil) - -;;; (insert " and follow the instructions -;;; there.") - - (unless (nxhtml-skip-welcome) - (insert "Click to ") - (widget-insert-link "remove this message" - (lambda () - (customize-option 'nxhtml-skip-welcome)) - nil) - (insert " at startup. (This page is still " - "available in the nXhtml menu, at the bottom.)")) - (fill-region here (point)) - (setq here (point)) - (goto-char (point-min)))) - (select-window curwin))) - -(defcustom nxhtml-skip-welcome nil - "Turn this on to always skip the nXhtml welcome message." - :type 'boolean - :group 'nxhtml) - -(defun nxhtml-skip-welcome () - "Return t if nXhtml welcome message should be skipped. -If nil then the message will be shown when you open the first -file using nxhtml-mode." - (or nxhtml-skip-welcome - (and nxhtml-global-minor-mode - ;;mumamo-global-mode - ;;indent-region-mode - ))) - -(defun nxhtml-say-welcome-unless-skip () - (unless (nxhtml-skip-welcome) - (nxhtml-welcome))) - -;; Show welcome screen once after loading nxhtml: -(eval-after-load 'nxhtml - ;; Use a short delay if something like desktop is used: - '(run-with-idle-timer 0.5 nil 'nxhtml-say-welcome-unless-skip)) - -(provide 'nxhtml-menu) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; nxhtml-menu.el ends here +;;; nxhtml-menu.el --- Defines menus for nXhtml +;; +;; Author: Lennart Borgman (lennart O borgman A gmail O com) +;; Created: Sat Apr 21 2007 +(defconst nxhtml-menu:version "1.93") ;;Version: +;; Last-Updated: 2009-05-29 Fri +;; URL: +;; Keywords: +;; Compatibility: +;; +;; Features that might be required by this library: +;; + ;; `appmenu', `appmenu-fold', `apropos', `backquote', `button', + ;; `bytecomp', `cl', `comint', `compile', `css-color', `cus-edit', + ;; `cus-face', `cus-load', `cus-start', `dired', `easymenu', + ;; `ediff', `ediff-diff', `ediff-help', `ediff-init', `ediff-merg', + ;; `ediff-mult', `ediff-util', `ediff-wind', `ffip', `flymake', + ;; `flymake-js', `flymake-php', `flyspell', `fold-dwim', `gimp', + ;; `grep', `help-mode', `hideshow', `html-imenu', `html-quote', + ;; `html-site', `html-upl', `ido', `ietf-drums', `imenu', `ispell', + ;; `loadhist', `mail-parse', `mail-prsvr', `mailcap', `mlinks', + ;; `mm-util', `mumamo', `nxhtml-mode', `nxml-enc', `nxml-glyph', + ;; `nxml-mode', `nxml-ns', `nxml-outln', `nxml-parse', `nxml-rap', + ;; `nxml-util', `ourcomments-util', `outline', `popcmp', `qp', + ;; `recentf', `rfc2045', `rfc2047', `rfc2231', `ring', `rng-dt', + ;; `rng-loc', `rng-match', `rng-nxml', `rng-parse', `rng-pttrn', + ;; `rng-uri', `rng-util', `rng-valid', `rngalt', `rx', + ;; `setup-helper', `sgml-mode', `tidy-xhtml', `time-date', `timer', + ;; `timezone', `tls', `tool-bar', `tree-widget', `typesetter', + ;; `udev', `udev-cedet', `udev-ecb', `udev-rinari', `url', + ;; `url-auth', `url-c', `url-cookie', `url-expand', `url-gw', + ;; `url-history', `url-http', `url-methods', `url-parse', + ;; `url-privacy', `url-proxy', `url-util', `url-vars', `view', + ;; `w32-reg-iface', `w32-regdat', `wid-edit', `xmltok'. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: +;; +;; Menus for nXhtml to be used in different major modes. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Change log: +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; This program 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 program 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 this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cus-edit)) +(eval-when-compile (require 'dired)) +(eval-when-compile (require 'gimp)) +(eval-when-compile (require 'html-site)) +(eval-when-compile (when (fboundp 'nxml-mode) (require 'nxhtml-mode))) +(eval-when-compile (require 'css-color)) +(eval-when-compile (require 'flymake)) +(eval-when-compile (require 'flymake-php)) +(eval-when-compile (require 'flymake-js)) +(eval-when-compile (require 'udev-ecb)) +(eval-when-compile (require 'udev-cedet)) +(eval-when-compile (require 'udev-rinari)) + +(defun nxhtml-nxhtml-in-buffer () + (or (derived-mode-p 'nxhtml-mode) + (when (and (boundp 'mumamo-multi-major-mode) + mumamo-multi-major-mode) + (let ((major-mode (mumamo-main-major-mode))) + (derived-mode-p 'nxhtml-mode))))) + +(defun nxhtml-nxml-in-buffer () + (or (derived-mode-p 'nxml-mode) + (when (and (boundp 'mumamo-multi-major-mode) + mumamo-multi-major-mode) + (let ((major-mode (mumamo-main-major-mode))) + (derived-mode-p 'nxml-mode))))) + +(defun nxhtml-html-in-buffer () + (or (derived-mode-p 'html-mode) + (when (and (boundp 'mumamo-multi-major-mode) + mumamo-multi-major-mode) + (let ((major-mode (mumamo-main-major-mode))) + (derived-mode-p 'html-mode))) + (nxhtml-nxhtml-in-buffer))) + +(defun nxhtml-nxml-html-in-buffer () + (or (derived-mode-p 'html-mode) + (when (and (boundp 'mumamo-multi-major-mode) + mumamo-multi-major-mode) + (let ((major-mode (mumamo-main-major-mode))) + (derived-mode-p 'html-mode))) + (nxhtml-nxml-in-buffer))) + +(defun nxhtml-this-file-can-have-toc (&optional file) + (unless file + (setq file (html-site-buffer-or-dired-file-name))) + (and (nxhtml-buffer-possibly-local-viewable file) + (html-site-current-merge-dir) + (html-site-current-ensure-file-in-site file))) + +(defun nxhtml-buffer-possibly-local-viewable (&optional file) + (unless file + (setq file (html-site-buffer-or-dired-file-name))) + (or (and file + (member (file-name-extension file) + '("html" "htm" "gif" "png"))))) + +(defun nxhtml-buffer-possibly-remote-viewable () + ;; Fix-me + (let* ((fmt "nxhtml-buffer-possibly-remote-viewable.dgffv: %s") + (file (or buffer-file-name + (and (derived-mode-p 'dired-mode) + (condition-case err + (dired-get-file-for-visit) + (error + (message fmt (error-message-string err)) + nil)))))) + (and (featurep 'html-upl) + file + (member (downcase (file-name-extension file)) + '("html" "htm" "gif" "png" "pl" "php"))))) + +(defun nxhtml-insert-menu-dynamically (real-binding) + (when (and (symbolp real-binding) + (boundp real-binding)) + (symbol-value real-binding))) + +(defun nxhtml-menu-image-file () + (or (get-char-property (point) 'image-file) + buffer-file-name)) + +(defun nxhtml-gimp-can-edit () + (gimp-can-edit (nxhtml-menu-image-file))) + +;;;###autoload +(defun nxhtml-edit-with-gimp () + "Edit with GIMP buffer or file at point." + (interactive) + (gimp-edit-file (nxhtml-menu-image-file))) + +;;;###autoload +(defun nxhtml-browse-file (file) + "View file in web browser." + (interactive (list + (or (html-site-buffer-or-dired-file-name) + (read-file-name "File: ")))) + (let* ((buf (if (buffer-file-name) + (current-buffer) + (find-buffer-visiting file))) + (use-temp (and (buffer-file-name) + (or (and (boundp 'nxhtml-current-validation-header) + nxhtml-current-validation-header) + (buffer-modified-p) + (not buffer-file-name) + (not (file-exists-p buffer-file-name))))) + (file-to-browse file)) + (when use-temp + (setq file-to-browse (nxhtml-save-browseable-temp-file nil nil use-temp))) + ;; Fix-me: Workaround for Emacs bug on w32 + ;; http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4015 + (if (eq system-type 'windows-nt) + (w32-shell-execute "open" file nil 1) + (browse-url-of-file file)) + )) + +;;;###autoload +(defun nxhtml-browse-region () + "View region in web browser." + (interactive) + (unless mark-active + (error "The region is not active")) + (browse-url (nxhtml-save-browseable-temp-file (region-beginning) (region-end)))) + +;;(defvar nxhtml-browseable-buffer-name "*nXhtml Browsing Buffer*") +(defvar nxhtml-browseable-buffer-file "~/.temp-nxhtml-browse.htm") +;; Fix-me: Handle base href here! +(defun nxhtml-save-browseable-temp-file (start end &optional doit-anyway) + "Return a temporary file for viewing in web browser." + ;; When using this either region should be active or there should be + ;; a validation header or both. + (or doit-anyway + (and start end) ;mark-active + (and (boundp 'nxhtml-validation-header-mode) + nxhtml-validation-header-mode + nxhtml-current-validation-header) + (error "Neither region nor validation header")) + (save-excursion + (let ((curbuf (current-buffer)) + (view-buffer (find-file-noselect nxhtml-browseable-buffer-file)) + header + content) + ;; Get header and content + (save-restriction + (widen) + (setq header + (if nxhtml-validation-header-mode + (let* ((key nxhtml-current-validation-header) + (rec (unless (listp key) + (assoc key nxhtml-validation-headers))) + (header (cdr rec))) + header) + (if (and doit-anyway (not start)) + "" + (goto-char (point-min)) + (save-match-data + (let ((body (re-search-forward "]*>"))) + (if body + (buffer-substring-no-properties (point-min) (match-end 0)) + "")))))) + (setq content + (if start + (buffer-substring-no-properties start end) + (buffer-substring-no-properties (point-min) (point-max)))) + ) + ;; Switch to view buffer + (set-buffer view-buffer) + ;; (unless buffer-file-name + ;; (set-visited-file-name nxhtml-browseable-buffer-file) + ;; (rename-buffer nxhtml-valhead-view-buffer-name)) + (erase-buffer) + (insert header content) + ;;(when (fboundp 'emacsw32-eol-set) (emacsw32-eol-set nil)) + (nxhtml-mode) + (save-buffer) + ;;(current-buffer) + (kill-buffer view-buffer) + (expand-file-name nxhtml-browseable-buffer-file) + ))) + + + +(defconst nxhtml-minor-mode-menu-map + (let ((map (make-sparse-keymap "nxhtml-minor-mode-menu"))) + + (let ((help-map (make-sparse-keymap))) + (define-key help-map [emacs-Q-nxhtml] + (list 'menu-item "Start 'emacs -Q' and load nXhtml" 'emacs-Q-nxhtml)) + (define-key help-map [nxhtmltest-run] + (list 'menu-item "Run nXhtml Tests in Current Emacs" 'nxhtmltest-run)) + (define-key help-map [nxhtmltest-run-Q] + (list 'menu-item "Run nXhtml Tests in a Fresh Emacs" 'nxhtmltest-run-Q)) + (define-key help-map [nxhtml-report-bug] + (list 'menu-item "Report a Bug in nXhtml ..." 'nxhtml-report-bug)) + (define-key help-map [nxhtml-help-separator2] (list 'menu-item "--")) + (define-key help-map [nxhtml-byte-compile-nxhtml] + (list 'menu-item "Byte Compile nXhtml" 'nxhtmlmaint-start-byte-compilation)) + (define-key help-map [nxhtml-features-check] + (list 'menu-item "Check Optional Features" 'nxhtml-features-check)) + (define-key help-map [nxhtml-customize] + (list 'menu-item "Customize nXhtml ..." 'nxhtml-customize)) +;;; (define-key help-map [nxhtml-quick-customize] +;;; (list 'menu-item "Quick Customize nXhtml ..." 'nxhtml-quick-customize)) + (define-key help-map [nxhtml-help-separator3] (list 'menu-item "--")) +;;; (define-key help-map [nxhtml-help] +;;; (list 'menu-item "nXhtml Help" 'nxhtml-help)) + (define-key help-map [nxhtml-tutorials] + (list 'menu-item "nXhtml Tutorials" 'nxhtml-tutorials)) + (define-key help-map [nxhtml-overview] + (list 'menu-item (concat "nXhtml Version " nxhtml-menu:version " Overview") 'nxhtml-overview)) + (define-key help-map [nxhtml-welcome] + (list 'menu-item "Welcome to nXhtml" 'nxhtml-welcome)) + (define-key map [nxhtml-help-map] + (list 'menu-item "nXhtml Help and Setup" help-map)) + (define-key map [nxhtml-info-separator] (list 'menu-item "--")) + ) + + + + + (let ((tools-map (make-sparse-keymap))) + (define-key map [nxhtml-tools-map] + (list 'menu-item "Tools" tools-map + :visible `(not (derived-mode-p 'dired-mode)) + )) + (define-key tools-map [nxhtml-last-resort] + (list 'menu-item "Last Resort" 'n-back-game)) + (define-key tools-map [nxhtml-pause] + (list 'menu-item "Life Reminder" 'pause-mode + :button '(:toggle . (and (boundp 'pause-mode) + pause-mode)))) + (define-key tools-map [nxhtml-last-resort-separator] + (list 'menu-item "--" nil)) + (define-key tools-map [nxhtml-viper-tut] + (list 'menu-item "Viper try-out tutorial" + 'viper-tutorial)) + (define-key tools-map [nxhtml-menu-to-m-x] + (list 'menu-item "Add Menu Commands to M-x history" + 'ourcomments-M-x-menu-mode + :button '(:toggle . (and (boundp 'ourcomments-M-x-menu-mode) + ourcomments-M-x-menu-mode)))) + (define-key tools-map [nxhtml-next-last-resort-separator] + (list 'menu-item "--" nil)) + (let ((fill-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-filling] + (list 'menu-item "Writing Text" fill-map)) + (define-key fill-map [nxhtml-unfill-paragraph] + (list 'menu-item "Unfill Paragraph" 'unfill-paragraph)) + (define-key fill-map [nxhtml-fill-paragraph] + (list 'menu-item "Fill Paragraph" 'fill-paragraph)) + (define-key fill-map [nxhtml-wrap-to-fill-separator] + (list 'menu-item "--" nil)) + (define-key fill-map [nxhtml-html-write-mode] + (list 'menu-item "HTML Write Mode" + 'html-write-mode + :button '(:toggle . (and (boundp 'html-write-mode) + html-write-mode)))) + (define-key fill-map [nxhtml-wrap-to-fill-column-mode] + (list 'menu-item "Wrap To Fill Column Mode" + 'wrap-to-fill-column-mode + :button '(:toggle . (and (boundp 'wrap-to-fill-column-mode) + wrap-to-fill-column-mode)))) + ) + + (define-key tools-map [nxhtml-ecb-separator] + (list 'menu-item "--" nil)) + + + (let ((ecb-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-ecb-map] + (list 'menu-item "ECB" ecb-map)) + (define-key ecb-map [nxhtml-custom-important-ecb] + (list 'menu-item "Customize important ECB things" + (lambda () + "Customize group `ecb-most-important'." + (interactive) + (customize-group-other-window 'ecb-most-important)) + :enable '(featurep 'ecb))) + (define-key ecb-map [nxhtml-ecb-mode] + (list 'menu-item "ECB Minor Mode" + 'ecb-minor-mode + :button '(:toggle . (and (boundp 'ecb-minor-mode) + ecb-minor-mode)) + :enable '(boundp 'ecb-minor-mode))) + (define-key ecb-map [nxhtml-ecb-show-help] + (list 'menu-item "ECB Help" + 'ecb-show-help + :enable '(fboundp 'ecb-show-help))) + (define-key ecb-map [nxhtml-ecb-custom-separator] + (list 'menu-item "--" nil)) + (define-key ecb-map [nxhtml-custom-ecb] + (list 'menu-item "Customize ECB dev startup from nXhtml" + 'udev-ecb-customize-startup)) + (define-key ecb-map [nxhtml-update-ecb] + (list 'menu-item "Fetch/update ECB dev sources" + 'udev-ecb-update)) + (define-key ecb-map [nxhtml-ecb-home-separator] + (list 'menu-item "--" nil)) + (define-key ecb-map [nxhtml-rinari-homepage] + (list 'menu-item "ECB Home Page" + (lambda () + "Open ECB home page in your web browser." + (interactive) + (browse-url "http://ecb.sourceforge.net/")))) + ) + + + (let ((cedet-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-cedet-map] + (list 'menu-item "CEDET" cedet-map)) + (define-key cedet-map [nxhtml-custom-cedet] + (list 'menu-item "Customize CEDET dev startup from nXhtml" + 'udev-cedet-customize-startup)) + (define-key cedet-map [nxhtml-cedet-utest] + (list 'menu-item "Run CEDET unit tests" + 'udev-cedet-utest)) + (define-key cedet-map [nxhtml-update-cedet] + (list 'menu-item "Fetch/update and install CEDET dev sources" + 'udev-cedet-update)) + (define-key cedet-map [nxhtml-cedet-home-separator] + (list 'menu-item "--" nil)) + (define-key cedet-map [nxhtml-rinari-homepage] + (list 'menu-item "CEDET Home Page" + (lambda () + "Open CEDET home page in your web browser." + (interactive) + (browse-url "http://cedet.sourceforge.net/")))) + ) + + + (let ((rinari-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-rinari-map] + (list 'menu-item "Rinari" rinari-map)) + (define-key rinari-map [nxhtml-custom-rinari] + (list 'menu-item "Customize Rinari startup from nXhtml" + (lambda () + "Customize Rinari dev nXhtml startup options." + (interactive) + (customize-group-other-window 'udev-rinari)))) + (define-key rinari-map [nxhtml-update-rinari] + (list 'menu-item "Fetch/update Rinari dev sources" + 'udev-rinari-update)) + (define-key rinari-map [nxhtml-rinari-home-separator] + (list 'menu-item "--" nil)) + (define-key rinari-map [nxhtml-rinari-homepage] + (list 'menu-item "Rinari Home Page" + (lambda () + "Open Rinari home page in your web browser." + (interactive) + (browse-url "http://rubyforge.org/projects/rinari/")))) + ) + (let ((mozrepl-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-mozrepl-map] + (list 'menu-item "MozRepl - control Firefox" mozrepl-map)) + + (let ((mozrepl-low-map (make-sparse-keymap))) + (define-key mozrepl-map [nxhtml-mozrepl-map] + (list 'menu-item "MozRepl Basic Functions" mozrepl-low-map)) + (define-key mozrepl-low-map [nxhtml-mozrepl-run-mozilla] + (list 'menu-item "Display/Start MozRepl Process" 'run-mozilla + :enable '(fboundp 'moz-minor-mode))) + (define-key mozrepl-low-map [nxhtml-mozrepl-separator1] + (list 'menu-item "--" nil)) + (define-key mozrepl-low-map [nxhtml-mozrepl-save-and-send] + (list 'menu-item "Save Buffer and Send it" 'moz-save-buffer-and-send + :enable '(or (not (boundp 'mumamo-multi-major-mode)) + (not mumamo-multi-major-mode)))) + (define-key mozrepl-low-map [nxhtml-mozrepl-send-defun-and-go] + (list 'menu-item "Send Current Function, Go to MozRepl" + 'moz-send-defun-and-go + :enable '(and (boundp 'moz-minor-mode) moz-minor-mode))) + (define-key mozrepl-low-map [nxhtml-mozrepl-send-defun] + (list 'menu-item "Send Current Function" 'moz-send-defun + :enable '(and (boundp 'moz-minor-mode) moz-minor-mode))) + (define-key mozrepl-low-map [nxhtml-mozrepl-send-region] + (list 'menu-item "Send the Region" 'moz-send-region + :enable '(and mark-active + (boundp 'moz-minor-mode) moz-minor-mode)))) + + (define-key mozrepl-map [nxhtml-mozrepl-separator2] + (list 'menu-item "--" nil)) + (define-key mozrepl-map [nxhtml-mozrepl-refresh] + (list 'menu-item "Refresh Firefox on Save" 'mozadd-refresh-edited-on-save-mode + :button '(:toggle . (and (boundp 'mozadd-refresh-edited-on-save-mode) + mozadd-refresh-edited-on-save-mode)))) + (define-key mozrepl-map [nxhtml-mozrepl-mirror] + (list 'menu-item "Mirror Buffer in Firefox" 'mozadd-mirror-mode + :button '(:toggle . (and (boundp 'mozadd-mirror-mode) + mozadd-mirror-mode)))) + (define-key mozrepl-map [nxhtml-mozrepl-separator3] + (list 'menu-item "--" nil)) + (define-key mozrepl-map [nxhtml-mozrepl-home-page] + (list 'menu-item "MozLab/MozRepl Home Page" + (lambda () + "Open MozLab/MozRepl home page in your web browser." + (interactive) + (browse-url "http://hyperstruct.net/projects/mozlab")))) + ) + + (define-key tools-map [nxhtml-frame-win-separator] + (list 'menu-item "--" nil)) + (let ((frame-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-frame-map] + (list 'menu-item "Windows and Frames" frame-map)) + (define-key frame-map [nxhtml-winsav-mode] + (list 'menu-item "Save/restore Frames and Windows" + 'winsav-save-mode + :button '(:toggle . (and (boundp 'winsav-save-mode) + winsav-save-mode)))) + (define-key frame-map [nxhtml-resize-windows] + (list 'menu-item "Resize Windows" + 'resize-windows))) + + (define-key tools-map [nxhtml-majpri-separator] + (list 'menu-item "--" nil)) + (define-key tools-map [nxhtml-as-external] + (list 'menu-item "External Editor Setup" + 'as-external-mode + :button '(:toggle . (and (boundp 'as-external-mode) + as-external-mode)))) + (define-key tools-map [nxhtml-sex-mode] + (list 'menu-item "Open files in External Apps" + 'sex-mode + :button '(:toggle . (and (boundp 'sex-mode) + sex-mode)))) + (let ((majpri-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-majpri-map] + (list 'menu-item "Major Modes Priorities" majpri-map)) + (define-key majpri-map [nxhtml-majpri-act] + (list 'menu-item "Apply Major Modes Priorities" + 'majmodpri-apply-priorities)) + (define-key majpri-map [nxhtml-majpri-cust] + (list 'menu-item "Customize Major Mode Priorities" + (lambda () + "Customize group Major Mode priorities." + (interactive) + (customize-group-other-window 'majmodpri)))) + ) + (define-key tools-map [nxhtml-tidy-separator] + (list 'menu-item "--" nil)) + (define-key tools-map [nxhtml-tidy-map] + (list 'menu-item "Tidy XHTML" 'tidy-menu-symbol + :filter 'nxhtml-insert-menu-dynamically + :visible '(and (fboundp 'tidy-build-menu) + (tidy-build-menu)) + :enable '(and (fboundp 'tidy-build-menu) + (tidy-build-menu) + (or (derived-mode-p 'html-mode) + (nxhtml-nxhtml-in-buffer))))) + (define-key tools-map [nxhtml-flymake] + (list 'menu-item "Flymake Mode" 'flymake-mode + :button '(:toggle . (and (boundp 'flymake-mode) + flymake-mode)) + :enable '(and buffer-file-name + (fboundp 'flymake-get-init-function) + (flymake-get-init-function buffer-file-name) + ))) + (let ((flyspell-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-flyspell-map] + (list 'menu-item "Flyspell" flyspell-map)) + (define-key flyspell-map [nxhtml-flyspell-goto-next] + (list 'menu-item "Flyspell Go To Next Error" 'flyspell-goto-next-error + :enable 'flyspell-mode)) + (define-key flyspell-map [nxhtml-flyspell-region] + (list 'menu-item "Flyspell Region" 'flyspell-region + :enable 'flyspell-mode)) + (define-key flyspell-map [nxhtml-flyspell-div-1] + (list 'menu-item "--")) + (define-key flyspell-map [nxhtml-flyspell] + (list 'menu-item "Flyspell Mode" 'flyspell-mode + :button '(:toggle . (and (boundp flyspell-mode) + flyspell-mode)))) + ) + (define-key tools-map [nxhtml-flyspell-separator] + (list 'menu-item "--")) + (let ((img-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-img-map] + (list 'menu-item "Images" img-map)) + (define-key img-map [nxhtml-chart] + (list 'menu-item "Make Chart" 'chart-make-chart)) + (define-key img-map [nxhtml-chart-separator] (list 'menu-item "--")) + (define-key img-map [nxhtml-gimp-edit] + (list 'menu-item "Edit with GIMP" 'nxhtml-edit-with-gimp + :enable '(nxhtml-gimp-can-edit))) + (define-key img-map [nxhtml-gimp-separator] (list 'menu-item "--")) + (define-key img-map [nxhtml-inlimg-toggle-display] + (list 'menu-item "Toggle Display of Image" 'inlimg-toggle-display)) + (define-key img-map [nxhtml-inlimg-toggle-slicing] + (list 'menu-item "Toggle Slicing of Image" 'inlimg-toggle-slicing)) + (define-key img-map [nxhtml-inlimg-mode] + (list 'menu-item "Show Images" 'inlimg-mode + :button '(:toggle . (and (boundp 'inlimg-mode) + inlimg-mode))))) + (define-key tools-map [nxhtml-img-separator] + (list 'menu-item "--")) + (let ((some-help-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-some-help-map] + (list 'menu-item "Help for Item at Point" some-help-map)) + (define-key some-help-map [nxhtml-css-help] + (list 'menu-item "CSS Help" 'xhtml-help-show-css-ref)) + (define-key some-help-map [nxhtml-tag-help] + (list 'menu-item "XHTML Tag Help" 'nxhtml-short-tag-help))) + + (let ((cssclr-map (make-sparse-keymap))) + (define-key tools-map [nxhtml-css-color] + (list 'menu-item "Color Help" cssclr-map)) + (define-key cssclr-map [nxhtml-css-color-mode] + (list 'menu-item "Css Color Mode" 'css-color-mode + :enable '(and font-lock-mode + (or (not (boundp 'mumamo-multi-major-mode)) + (not mumamo-multi-major-mode)) + (featurep 'css-color)) + :button '(:toggle . (and (boundp 'css-color-mode) + css-color-mode)))) + (define-key cssclr-map [nxhtml-css-color-test] + (list 'menu-item "Color Test" 'css-color-test + :enable '(featurep 'css-color)))) + + (let ((where-map (make-sparse-keymap))) + (define-key tools-map [nxml-where] + (list 'menu-item "XML Path" where-map + :enable '(and (fboundp 'nxml-where-mode) + (or (derived-mode-p 'nxml-mode) + (nxhtml-nxhtml-in-buffer))))) + (define-key where-map [nxhtml-nxml-where-cust] + (list 'menu-item "Customize display of XML Path" + (lambda () + "Customize XML path, ie group `nxml-where'." + (interactive) + (customize-group-other-window 'nxml-where)))) + (define-key where-map [where-separator-2] (list 'menu-item "--")) + (define-key where-map [nxml-where-inner] + (list 'menu-item "Show inly inner tag" 'nxml-where-only-inner-toggle + :enable '(boundp 'nxml-where-only-inner) + :button '(:toggle . (and (boundp 'nxml-where-only-inner) + nxml-where-only-inner)))) + (define-key where-map [nxml-where-id] + (list 'menu-item "Show tag ids in path" 'nxml-where-tag+id-toggle + :enable '(boundp 'nxml-where-tag+id) + :button '(:toggle . (and (boundp 'nxml-where-tag+id) + nxml-where-tag+id)))) + (define-key where-map [nxml-where-header] + (list 'menu-item "Show XML path in header" 'nxml-where-header-toggle + :enable '(boundp 'nxml-where-header) + :button '(:toggle . (and (boundp 'nxml-where-header) + 'nxml-where-header)))) + (define-key where-map [nxml-where-marks] + (list 'menu-item "Show XML path marks" 'nxml-where-marks-toggle + :enable '(boundp 'nxml-where-marks) + :button '(:toggle . (and (boundp 'nxml-where-marks) + nxml-where-marks)))) + (define-key where-map [where-separator] (list 'menu-item "--")) + (define-key where-map [nxml-where-global-toggle] + (list 'menu-item "Show XML path" 'nxml-where-global-mode + :button '(:toggle . (and (boundp 'nxml-where-global-mode) + nxml-where-global-mode)))) + (define-key where-map [nxml-where-toggle] + (list 'menu-item "Show XML path in buffer" 'nxml-where-mode + :button '(:toggle . (and (boundp 'nxml-where-mode) + nxml-where-mode)))) + )) + + (let ((quick-map (make-sparse-keymap))) + (define-key map [nxhtml-quick-map] + (list 'menu-item "Quick Inserts etc" quick-map + :visible '(or (derived-mode-p 'html-mode) + (nxhtml-nxhtml-in-buffer)))) + (let ((sometoc-map (make-sparse-keymap))) + (let ((toc-map (make-sparse-keymap))) + (define-key sometoc-map [nxhtml-toc-map] + (list 'menu-item "For Site" toc-map + :enable '(featurep 'html-toc))) + (define-key toc-map [nxhtml-html-wtoc] + (list 'menu-item "Merge Pages and TOC" + 'html-wtoc-write-pages-with-toc + :enable '(and (html-site-current-page-list)))) + (define-key toc-map [nxthml-html-toc] + (list 'menu-item "With Frames" 'html-toc-menu-map + :filter 'nxhtml-insert-menu-dynamically))) + (define-key sometoc-map [nxhtml-html-pagetoc] + (list 'menu-item "For Page" 'html-pagetoc-menu-map + :enable (boundp 'html-pagetoc-menu-map) + :filter 'nxhtml-insert-menu-dynamically + )) + (define-key quick-map [nxhtml-sometoc-map] + (list 'menu-item "Table of Contents" sometoc-map + :visible '(or (derived-mode-p 'html-mode) + (nxhtml-nxhtml-in-buffer))))) + (define-key quick-map [nxhtml-quick-sep-1] + (list 'menu-item "--")) + (define-key quick-map [nxhtml-spec-chars] + (list 'menu-item "Insert special character" + 'nxml-insert-named-char)) + (define-key quick-map [nxhtml-css-rollover] + (list 'menu-item "Insert CSS Rollover Images" + 'nxhtml-rollover-insert-2v))) + + (define-key map [nxhtml-help-tools-separator] + ;; Notice that removing nil below gives an error that is quite + ;; hard to catch: + ;; + ;; Wrong type argument: arrayp, not + (list 'menu-item "--" nil + :visible `(not (derived-mode-p 'dired-mode)) + )) + + + (let ((upl-map (make-sparse-keymap "html-upl"))) + (define-key map [nxhtml-upl-map] + (list 'menu-item "File Transfer" upl-map + ;;:enable '(featurep 'html-upl))) + :enable '(fboundp 'html-upl-upload-file))) + (define-key upl-map [nxhtml-upl-remote-dired] + (list 'menu-item "Remote Dired" 'html-upl-remote-dired)) + (define-key upl-map [nxhtml-upl-dired-sep] (list 'menu-item "--")) + (define-key upl-map [nxhtml-upl-edit-remote-wtoc] + (list 'menu-item "Edit Remote File With TOC" 'html-upl-edit-remote-file-with-toc + :visible '(nxhtml-this-file-can-have-toc))) + (define-key upl-map [nxhtml-upl-edit-remote] + (list 'menu-item "Edit Remote File" 'html-upl-edit-remote-file)) + (define-key upl-map [nxhtml-upl-ediff-file] + (list 'menu-item "Ediff Remote/Local Files" 'html-upl-ediff-file)) + (define-key upl-map [nxhtml-upl-sep] (list 'menu-item "--")) + (define-key upl-map [nxhtml-upl-upload-site-with-toc] + (list 'menu-item "Upload Site with TOC" 'html-upl-upload-site-with-toc + :visible '(and (html-site-current-merge-dir) + (html-site-current-ensure-file-in-site file)))) + (define-key upl-map [nxhtml-upl-upload-site] + (list 'menu-item "Upload Site" 'html-upl-upload-site)) + (define-key upl-map [nxhtml-upl-upload-file] + (list 'menu-item "Upload Single File" 'html-upl-upload-file)) + ) + + + (let ((browse-map (make-sparse-keymap))) + (define-key map [nxhtml-browse-map] + (list 'menu-item "Browse" browse-map + '(or buffer-file-name + (eq major-mode 'nxhtml-mode)) + :enable '(nxhtml-buffer-possibly-local-viewable))) + (define-key browse-map [nxhtml-browse-region] + (list 'menu-item "Browse the Region Only" 'nxhtml-browse-region + :enable 'mark-active)) + (define-key browse-map [nxhtml-upl-sep3] (list 'menu-item "--")) + (define-key browse-map [nxhtml-upl-browse-remote-wtoc] + (list 'menu-item "Browse Uploaded File With TOC" 'html-upl-browse-remote-with-toc + :visible '(and (nxhtml-buffer-possibly-local-viewable) + (featurep 'html-wtoc) + (html-site-current-merge-dir) + (html-site-current-ensure-file-in-site file) + (nxhtml-buffer-possibly-remote-viewable) + ))) + (define-key browse-map [nxhtml-upl-browse-remote-frame-file] + (list 'menu-item "Browse Uploaded Frames File" 'html-upl-browse-remote-frames + :enable '(nxhtml-buffer-possibly-remote-viewable))) + (define-key browse-map [nxhtml-upl-browse-remote] + (list 'menu-item "Browse Uploaded File" 'html-upl-browse-remote + :enable '(nxhtml-buffer-possibly-remote-viewable))) + (define-key browse-map [nxhtml-upl-sep2] + (list 'menu-item "--")) + (define-key browse-map [nxhtml-browse-merged-file] + (list 'menu-item "Browse File With TOC" 'html-wtoc-browse-page-with-toc + :visible '(and (nxhtml-buffer-possibly-local-viewable) + (featurep 'html-wtoc) + (html-site-current-merge-dir) + (html-site-current-ensure-file-in-site file) + ))) + (define-key browse-map [nxhtml-browse-frame-file] + (list 'menu-item "Browse Frames File" 'html-toc-browse-frames-file + :enable '(and (featurep 'html-toc) + (nxhtml-buffer-possibly-local-viewable)))) + (define-key browse-map [nxhtml-browse-file] + (list 'menu-item "Browse File" 'nxhtml-browse-file + :enable '(nxhtml-buffer-possibly-local-viewable))) + ) + + + (let ((link-map (make-sparse-keymap))) + + (define-key link-map [nxhtml-chklnk] + (list 'menu-item "Check Links" 'html-chklnk-check-site-links + :enable '(featurep 'html-chklnk))) + + (let ((move-map (make-sparse-keymap))) + (define-key move-map [html-move-buffer-file] + (list 'menu-item "Move Buffer File" 'html-move-buffer-file + :help "Move buffer file and update links" + :enable '(and buffer-file-name + (featurep 'html-move)))) + (define-key link-map [move-map] + (list 'menu-item "Moving Files" move-map)) + (define-key link-map [move-map-separator] (list 'menu-item "--")) + ) + + + (define-key link-map [nxhtml-paste-link] + (list 'menu-item "Paste Saved Relative Link" 'nxhtml-paste-link + :help "Paste link" + :enable '(and (boundp 'nxhtml-saved-link-file) + nxhtml-saved-link-file))) + (define-key link-map [nxhtml-paste-link-as-a-tag] + (list 'menu-item "Paste Saved Relative Link as " 'nxhtml-paste-link-as-a-tag + :help "Paste link as tag" + :enable '(and (boundp 'nxhtml-saved-link-file) + nxhtml-saved-link-file + (nxhtml-nxml-html-in-buffer)))) + (define-key link-map [nxhtml-save-link-to-here] + (list 'menu-item "Save Relative Link to Current File" 'nxhtml-save-link-to-here + :help "Save link info for current file" + :enable 'buffer-file-name)) + + (define-key link-map [nxhtml-separator-1] (list 'menu-item "--")) + (define-key link-map [mlinks-goto-link-other-frame] + (list 'menu-item "Follow MLink Link in New Frame" 'mlinks-goto-other-frame + :enable '(and (boundp 'mlinks-mode) + mlinks-mode) + :help "Follow MLinks Link in New Frame")) + (define-key link-map [mlinks-goto-link-other-window] + (list 'menu-item "Follow MLink Link in Other Window" 'mlinks-goto-other-window + :enable '(and (boundp 'mlinks-mode) + mlinks-mode) + :help "Follow MLinks Link in Other Window")) + (define-key link-map [mlinks-goto-link] + (list 'menu-item "Follow MLink Link" 'mlinks-goto + :enable '(and (boundp 'mlinks-mode) + mlinks-mode) + :help "Follow MLinks Link")) + (define-key link-map [nxhtml-separator-follow-mlink] (list 'menu-item "--")) + (define-key link-map [mlinks-next-link] + (list 'menu-item "Next MLink Link" 'mlinks-forward-link + :enable '(and (boundp 'mlinks-mode) + mlinks-mode) + :help "Go to next MLinks link")) + (define-key link-map [mlinks-prev-link] + (list 'menu-item "Previous MLink Link" 'mlinks-backward-link + :enable '(and (boundp 'mlinks-mode) + mlinks-mode) + :help "Go to previous MLinks link")) + +;; (define-key link-map [nxhtml-next-href] +;; (list 'menu-item "Next Link" 'nxhtml-next-href +;; :help "Go to next href field")) +;; (define-key link-map [nxhtml-prev-href] +;; (list 'menu-item "Previous Link" 'nxhtml-prev-href +;; :help "Go to previous href field")) + + (define-key map [nxhtml-link-map] + (list 'menu-item "Links" link-map + :visible `(not (derived-mode-p 'dired-mode)) + ))) + + + (let ((site-map (make-sparse-keymap))) + (define-key map [nxhtml-site-map] + (list 'menu-item "Site" site-map)) + (define-key site-map [html-site-global-mode] + (list 'menu-item "HTML Site Global Mode" + 'html-site-global-mode + :button '(:toggle . (and (boundp 'html-site-global-mode) + html-site-global-mode)))) + (define-key site-map [nxhtml-site-separator] (list 'menu-item "--")) + (define-key site-map [nxhtml-customize-site-list] + (list 'menu-item "Edit Sites" (lambda () + "Customize option `html-size-list'." + (interactive) + (customize-option-other-window 'html-site-list)))) + (define-key site-map [nxhtml-set-site] + (list 'menu-item "Set Current Site" 'html-site-set-site)) + (define-key site-map [nxhtml-site-separator-1] (list 'menu-item "--")) + (define-key site-map [nxhtml-dired-site-top] + (list 'menu-item "Dired Site" 'html-site-dired-current)) + (define-key site-map [nxhtml-find-site-file] + (list 'menu-item "Find File in Site" 'html-site-find-file)) + (define-key site-map [nxhtml-site-search-separator] + (list 'menu-item "--" nil)) + (define-key site-map [nxhtml-replace-in-site] + (list 'menu-item "Replace in Site Files" 'html-site-query-replace)) + (define-key site-map [nxhtml-rgrep-in-site] + (list 'menu-item "Search Site Files" 'html-site-rgrep)) + ) + + (define-key map [nxhtml-insert-separator] + (list 'menu-item "--" nil + :visible `(not (derived-mode-p 'dired-mode)) + )) + (let ((chunk-map (make-sparse-keymap))) + (define-key map [nxhtml-chunk-map] + (list 'menu-item "Chunks" chunk-map + :visible `(not (derived-mode-p 'dired-mode)) + :enable '(and (boundp 'mumamo-multi-major-mode) + mumamo-multi-major-mode))) + (define-key chunk-map [nxhtml-customize-mumamo] + (list 'menu-item "Customize MuMaMo" + (lambda () (interactive) (customize-group-other-window 'mumamo)))) + (define-key chunk-map [nxhtml-list-mumamo] + (list 'menu-item "List defined Multi Major Modes" + 'mumamo-list-defined-multi-major-modes)) + (define-key chunk-map [nxhtml-chunks-separator2] + (list 'menu-item "--" nil)) + (define-key chunk-map [nxhtml-chunk-margin-info] + (list 'menu-item "Display chunk info in margin" + 'mumamo-margin-info-global-mode + :button '(:toggle . (and (boundp 'mumamo-margin-info-global-mode) + mumamo-margin-info-global-mode)))) + (define-key chunk-map [nxhtml-chunks-separator1] + (list 'menu-item "--" nil)) + (let ((region-map (make-sparse-keymap))) + (define-key chunk-map [nxhtml-region-map] + (list 'menu-item "Make Chunks from Visible Region" region-map)) + (define-key region-map [mumamo-clear-all-regions] + (list 'menu-item "Clear Region Chunks" + 'mumamo-clear-all-regions + :enable '(fboundp 'mumamo-clear-all-regions))) + (define-key region-map [mumamo-add-region] + (list 'menu-item "Add Region Chunk" + 'mumamo-add-region))) + (define-key chunk-map [nxhtml-region-separator] + (list 'menu-item "--" nil)) + (define-key chunk-map [mumamo-mark-chunk] + (list 'menu-item "Mark Chunk" + 'mumamo-mark-chunk)) + (define-key chunk-map [nxhtml-separator-mark-chunk] (list 'menu-item "--")) + (define-key chunk-map [mumamo-backward-chunk] + (list 'menu-item "Backward Chunk" + 'mumamo-backward-chunk)) + (define-key chunk-map [mumamo-forward-chunk] + (list 'menu-item "Forward Chunk" + 'mumamo-forward-chunk))) + (let ((tag-map (make-sparse-keymap))) + (define-key map [nxhtml-tag-map] + (list 'menu-item "Move by Tag" tag-map + :visible '(or (derived-mode-p 'nxml-mode) + (derived-mode-p 'sgml-mode)) + :enable '(or (derived-mode-p 'nxml-mode) + (nxhtml-nxhtml-in-buffer)))) + (define-key tag-map [nxml-forward-par] + (list 'menu-item "Forward Paragraph" + 'nxml-forward-paragraph)) + (define-key tag-map [nxml-backward-par] + (list 'menu-item "Backward Paragraph" + 'nxml-backward-paragraph)) + (define-key tag-map [nxml-insert-separator-move2] (list 'menu-item "--")) + (define-key tag-map [nxml-down] + (list 'menu-item "Forward Into Tag" + 'nxml-down-element)) + (define-key tag-map [nxml-backward-up] + (list 'menu-item "Backward Out of Tag" + 'nxml-backward-up-element)) + (define-key tag-map [nxml-insert-separator-move] (list 'menu-item "--")) + (define-key tag-map [nxml-forward] + (list 'menu-item "Forward Balanced Tag" + 'nxml-forward-element)) + (define-key tag-map [nxml-backward] + (list 'menu-item "Backward Balanced Tag" + 'nxml-backward-element)) + ) + + (let ((cmpl-map (make-sparse-keymap))) + (define-key map [nxhtml-cmpl-map] + (list 'menu-item "Completion and Validation" cmpl-map + ;; :enable '(or (derived-mode-p 'nxml-mode) (nxhtml-nxhtml-in-buffer)) + :visible `(not (derived-mode-p 'dired-mode)) + )) + (let ((val-map (make-sparse-keymap))) + (define-key cmpl-map [nxhtml-cmpl-val-map] + (list 'menu-item "Validation Helpers (for php etc)" val-map + :enable '(nxhtml-nxhtml-in-buffer) + :visible '(nxhtml-nxml-html-in-buffer))) +;;; (define-key val-map [nxhtml-strval-mode] +;;; (list 'menu-item "Allow attr=\"\" etc" +;;; 'nxhtml-strval-mode +;;; :button '(:toggle . nxhtml-strval-mode))) + (define-key val-map [mumamo-alt-php-tags] + (list 'menu-item "Use (?php" + 'mumamo-alt-php-tags-mode + :button '(:toggle . (and (boundp 'mumamo-alt-php-tags-mode) + mumamo-alt-php-tags-mode)))) + (define-key val-map [mumamo-alt-tags-separator] (list 'menu-item "--")) + (define-key val-map [nxhtml-toggle-warnings] + (list 'menu-item "Hide Validation Errors" + 'nxhtml-toggle-visible-warnings + :button '(:toggle . (not (nxhtml-warnings-are-visible))) + )) + (define-key val-map [nxhtml-error-separator] (list 'menu-item "--")) + (define-key val-map [nxhtml-remove-saved-validation-header] + (list 'menu-item "Remove File's Fictive XHTML Validation Header" + 'nxhtml-remove-saved-validation-header + ;; Fix-me: maybe a better enable here? + :enable 'nxhtml-validation-header-mode)) + (define-key val-map [nxhtml-save-validation-header] + (list 'menu-item "Save File's Fictive XHTML Validation Header" + 'nxhtml-save-validation-header + :enable 'nxhtml-validation-header-mode)) + (define-key val-map [nxhtml-set-validation-header] + (list 'menu-item "Choose Fictive XHTML Validation Header for Buffer" + 'nxhtml-set-validation-header)) + (define-key val-map [nxhtml-update-validation-header] + (list 'menu-item "Update Fictive XHTML Validation Header for Buffer" + 'nxhtml-update-validation-header)) + (define-key val-map [nxhtml-use-saved-val-separator] (list 'menu-item "--")) +;;; (let ((afic-map (make-sparse-keymap))) +;;; (define-key val-map [nxhtml-afic-map] +;;; (list 'menu-item "Automatic Fictive XHTML Validation Header" afic-map)) +;;; (define-key afic-map [nxhtml-validation-header-mumamo-set] +;;; (list 'menu-item "Customize Automatic XHTML Validation Turn On" +;;; (lambda () (interactive) (customize-option 'nxhtml-validation-header-mumamo-modes)))) +;;; (define-key afic-map [nxhtml-validation-header-mumamo] +;;; (list 'menu-item "Turn on Fictive XHTML Validation Header with MuMaMo" +;;; 'nxhtml-validation-header-if-mumamo-toggle +;;; :button '(:toggle . nxhtml-validation-header-if-mumamo)))) + (define-key val-map [nxhtml-show-validation-header] + (list 'menu-item "Display Fictive XHTML Validation Header" + 'rngalt-display-validation-header-toggle + :help-echo "Displays the Fictive XHTML validation header (if any) at top of buffer" + :button '(:toggle . (and (boundp 'rngalt-display-validation-header) + rngalt-display-validation-header)))) + (define-key val-map [nxhtml-recheck-validation-header] + (list 'menu-item "Recheck Fictive XHTML Validation Header in Buffer" + 'nxhtml-recheck-validation-header + :enable 'nxhtml-validation-header-mode)) + (define-key val-map [nxhtml-validation-header-mode] + (list 'menu-item "Use Fictive XHTML Validation Header in Buffer" + 'nxhtml-validation-header-mode + :button '(:toggle . (and (boundp 'nxhtml-validation-header-mode) + nxhtml-validation-header-mode)))) + ) + (define-key cmpl-map [nxhtml-validation-separator] + (list 'menu-item "--" nil + :visible '(nxhtml-nxml-html-in-buffer))) + (let ((style-map (make-sparse-keymap))) + (define-key cmpl-map [nxhtml-cmpl-style-map] + (list 'menu-item "Completion Style" style-map + :visible '(nxhtml-nxml-html-in-buffer) + :enable '(nxhtml-nxhtml-in-buffer))) + (define-key style-map [popcmp-customize] + (list 'menu-item "Customize Completion Style" + (lambda () (interactive) (customize-group-other-window 'popcmp)))) + (define-key style-map [popcmp-style-div2] + (list 'menu-item "--")) + ;;(defun nxhtml-nxml-html-in-buffer () + (define-key style-map [popcmp-with-help] + (list 'menu-item "Show Short Help Beside Alternatives" + 'popcmp-short-help-beside-alts-toggle + :button '(:toggle . (and (boundp 'popcmp-short-help-beside-alts) + popcmp-short-help-beside-alts)))) + (define-key style-map [nxhtml-tag-do-also] + (list 'menu-item "Complete Tag Extras" + 'nxhtml-tag-do-also-toggle + :button '(:toggle . (and (boundp 'nxhtml-tag-do-also) + nxhtml-tag-do-also)))) + (define-key style-map [popcmp-group-alternatives] + (list 'menu-item "Group Alternatives" + 'popcmp-group-alternatives-toggle + :button '(:toggle . (and (boundp 'popcmp-group-alternatives) + popcmp-group-alternatives)))) + (define-key style-map [popcmp-style-div1] + (list 'menu-item "--")) + (define-key style-map [popcmp-anything-completion] + (list 'menu-item "Anything Style Completion" + (lambda () (interactive) (customize-set-variable 'popcmp-completion-style 'anything)) + :enable `(fboundp 'anything) + :button `(:radio . (eq popcmp-completion-style 'anything)))) + (define-key style-map [popcmp-emacs-completion] + (list 'menu-item "Emacs Default Style Completion" + (lambda () (interactive) (customize-set-variable 'popcmp-completion-style 'emacs-default)) + :button `(:radio . (eq popcmp-completion-style 'emacs-default)))) + (define-key style-map [popcmp-popup-completion] + (list 'menu-item "Popup Style Completion" + (lambda () (interactive) (customize-set-variable 'popcmp-completion-style 'popcmp-popup)) + :button `(:radio . (eq popcmp-completion-style 'popcmp-popup)))) + (define-key style-map [popcmp-company-completion] + (list 'menu-item "Company Mode Style Completion" + (lambda () (interactive) (customize-set-variable 'popcmp-completion-style 'company-mode)) + :enable `(fboundp 'company-mode) + :button `(:radio . (eq popcmp-completion-style 'company-mode)))) + ) + (define-key cmpl-map [nxhtml-cmpl-separator] + (list 'menu-item "--" nil + :visible '(nxhtml-nxml-html-in-buffer))) + (define-key cmpl-map [nxhtml-untag-element] + (list 'menu-item "Untag Element" 'nxml-untag-element + :enable '(nxhtml-nxhtml-in-buffer) + :visible '(nxhtml-nxml-html-in-buffer))) + (define-key cmpl-map [rngalt-finish-element] + (list 'menu-item "Insert End Tag" 'rngalt-finish-element + :enable '(nxhtml-nxhtml-in-buffer) + :visible '(nxhtml-nxml-html-in-buffer))) + (define-key cmpl-map [nxhtml-complete] + (list 'menu-item "Complete tag, attribute etc" 'nxml-complete + :enable '(nxhtml-nxml-in-buffer) + :visible '(nxhtml-nxml-html-in-buffer))) + (define-key cmpl-map [nxhtml-tab-complete-div] + (list 'menu-item "--" nil + :visible '(nxhtml-nxml-html-in-buffer))) + (define-key cmpl-map [nxhtml-tab-complete] + (list 'menu-item "Indent and then Complete" 'tabkey2-first)) + ) + + map)) + +(defvar nxhtml-minor-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [(control ?c) ?? ?x] 'nxhtml-short-tag-help) + (define-key map [(control ?c) ?? ?c] 'xhtml-help-show-css-ref) + (define-key map [(control ?c) ?_] 'nxhtml-toggle-visible-warnings) + (define-key map [menu-bar nxhtml-minor-mode] + (list 'menu-item "nXhtml" nxhtml-minor-mode-menu-map)) + map)) + +(define-minor-mode nxhtml-minor-mode + "Minor mode to turn on some key and menu bindings. +See `nxhtml-mode' for more information." + :keymap nxhtml-minor-mode-map + :group 'nxhtml + ) +;;(put 'nxhtml-minor-mode 'permanent-local t) + +(defcustom nxhtml-minor-mode-modes + '( + nxhtml-mode + nxml-mode + html-mode + sgml-mode + xml-mode + php-mode + css-mode + javascript-mode + java-mode ;; jsp + image-mode + ;; + dired-mode + ) + "List for turning on `nxhtml-minor-mode'. +If the buffer's major modes is any of those in this list then +`nxhtml-global-minor-mode' will turn on `nxhtml-minor-mode' in +the buffer." + :type '(repeat (symbol :tag "Major mode")) + :group 'nxhtml) + +(defun nxhtml-maybe-turn-on-minor-mode () + "Maybe turn on `nxhtml-minor-mode'. +See `nxhtml-minor-mode-modes'." + (unless (or (minibufferp (current-buffer)) + (string= " " (substring (buffer-name) 0 1)) + (string= "*" (substring (buffer-name) 0 1)) + ) + (let ((on (and (boundp 'mumamo-multi-major-mode) + mumamo-multi-major-mode))) + (dolist (major nxhtml-minor-mode-modes) + (when (derived-mode-p major) + (setq on t))) +;; (when (string= "php" (file-name-extension (buffer-file-name))) +;; (lwarn 't :warning "on=%s, major-mode=%s" on major-mode)) + (when on + (nxhtml-minor-mode 1))))) + +;;;###autoload +(define-globalized-minor-mode nxhtml-global-minor-mode + nxhtml-minor-mode + nxhtml-maybe-turn-on-minor-mode + ;;:require 'nxhtml-menu + :group 'nxhtml) +;;(message "nxhtml-menu:here A") +;;(custom-reevaluate-setting 'nxhtml-global-minor-mode) +;;(message "nxhtml-menu:here B") +;;(when nxhtml-global-minor-mode (nxhtml-global-minor-mode 1)) +;;(message "nxhtml-menu:here C") + + +(defun nxhtml-docfile () + (let* ((libfile (locate-library "nxhtml")) + (docfile (expand-file-name "doc/nxhtml.html" + (file-name-directory libfile)))) + docfile)) + +(defun nxhtml-docfile-url () + (concat "file://" (nxhtml-docfile))) + +;;;###autoload +(defun nxhtml-overview () + "Show a HTML page with an overview of nXhtml." + (interactive) + (browse-url (nxhtml-docfile-url))) + +(defun nxhtml-tutorials () + "Show a HTML page with a list of tutorials for nXhtml'." + (interactive) + (browse-url "http://ourcomments.org/Emacs/nXhtml/tut/tutorials.html")) + +(defun nxhtml-custom-valfaced (value &optional bgcolor) + (let ((v (if (sequencep value) + (copy-seq value) + value)) + (bgcolor (if bgcolor bgcolor "RGB:FF/FF/AA"))) + (put-text-property 0 (length v) + 'face (list + 'bold + (cons 'background-color bgcolor) + ) + v) + v)) +(defun nxhtml-custom-insert-nxhtml-row (symbol nxhtml-value description) + (let ((desc (if description + (format "%s (%s)" description symbol) + (format "%s" (custom-unlispify-tag-name symbol))))) + (widget-insert " " description " (") + (nxhtml-custom-describe-defun symbol) + (widget-insert "): " + (nxhtml-custom-valfaced + (format "%s" (symbol-value symbol)) + (if (eq (symbol-value symbol) + nxhtml-value) + "GreenYellow" + "gainsboro")) + "\n"))) + +(defun nxhtml-custom-h1(title &optional divider top-newline) + (let ((s title)) + (put-text-property 0 (length s) + 'face '(:weight bold + :height 1.4 + :foreground "DarkGreen" + ;;:underline t + ) + s) + (when top-newline (widget-insert "\n")) + ;;(when divider (widget-insert (nxhtml-custom-divider (length s)))) + (widget-insert s) + )) + +(defun widget-button-notify (widget &rest ignore) + (apply (widget-get widget 'function) (widget-get widget 'data))) + +(defun widget-insert-link (txt function data) + (widget-insert-button txt function data + :button-face 'link + :mouse-face 'highlight + :button-prefix "" + :button-suffix "")) + +(defun widget-insert-button (txt function data &rest keywords) + (let ((btn (apply 'widget-create + (append + '(push-button + :notify + widget-button-notify) + keywords + (list txt))))) + (widget-put btn 'data data) + (widget-put btn 'function function))) + +(defun nxhtml-custom-url-link (txt url) + (let ((plain-url (substring-no-properties url))) + (unless (equal txt url) + (put-text-property 0 (length txt) 'help-echo plain-url txt)) + (put-text-property 0 (length txt) 'mouse-face 'highlight txt) + (widget-insert-link txt 'browse-url (list url)))) + +(defun nxhtml-custom-describe-defun (sym &optional help) + (let ((txt (symbol-name sym))) + (when help + (put-text-property 0 (length txt) 'help-echo help txt)) + (put-text-property 0 (length txt) 'mouse-face 'highlight txt) + (widget-insert-link txt 'describe-function (list sym)))) + +;; (defun nxhtml-quick-customize (&optional same-window) +;; "Show page for Quick Customize of nXhtml." +;; (interactive) +;; (require 'nxhtml) +;; (require 'custom) +;; (require 'cus-edit) +;; (if same-window +;; (switch-to-buffer "*Quick Customize nXhtml*") +;; (switch-to-buffer-other-window "*Quick Customize nXhtml*")) +;; (kill-all-local-variables) +;; (custom-mode) +;; (let ((inhibit-read-only t)) +;; (erase-buffer)) +;; (let ((sFound "found") +;; (sError "error")) +;; (put-text-property 0 (length sFound) +;; 'face '(bold +;; (foreground-color . "green")) sFound) +;; (put-text-property 0 (length sError) +;; 'face '(bold +;; (foreground-color . "red")) sError) +;; (let* ( +;; (default-used "(not set yet - default used)") +;; ) +;; (nxhtml-custom-h1 "Quick Customize for nXhtml" t) +;; (widget-insert " + +;; This page is for a quick and easy setup of some ") +;; (nxhtml-custom-url-link "nXhtml" (nxhtml-docfile-url)) +;; (widget-insert " features +;; that I did not want to turn on by default since they alter what +;; happens when you open a file. I suggest however that you turn +;; them on since they are quite useful if you just understands what +;; is happening. + +;; The values you set here are saved so that they will be used next +;; time you start Emacs too.") +;; ;;(widget-insert-link "customize nXhtml" 'customize-group (list 'nxhtml)) +;; (widget-insert "\n\n") + +;; (nxhtml-custom-insert-nxhtml-row 'nxhtml-global-minor-mode t "Show the nXhtml menu in all relevant buffers\n\t") +;; ;;(nxhtml-custom-insert-nxhtml-row 'mumamo-global-mode t "Turn on Multiple Major Mode in all relevant buffers\n\t") +;; ;;(nxhtml-custom-insert-nxhtml-row 'mlinks-global-mode t "Make link of lins, for example href=\"...\"\n\t") +;; ;;(nxhtml-custom-insert-nxhtml-row 'indent-region-mode t "Use TAB to indent region when it is selected\n\t") + +;; (widget-insert "\n") +;; (widget-insert-button " Turn them all on " +;; (lambda () +;; (nxhtml-quick-all t) +;; (nxhtml-quick-customize t)) +;; nil) +;; (widget-insert " ") +;; (widget-insert-button " Turn them all off " +;; (lambda () +;; (nxhtml-quick-all nil) +;; (nxhtml-quick-customize t)) +;; nil) +;; (beginning-of-line) +;; ))) + +;; (defun nxhtml-quick-all (on) +;; (custom-set-and-prepare-save 'nxhtml-global-minor-mode on) +;; ;;(custom-set-and-prepare-save 'mumamo-global-mode on) +;; (custom-set-and-prepare-save 'indent-region-mode on) +;; (when custom-file +;; (custom-save-all))) + +(defun custom-set-and-prepare-save (symbol value) + "Set SYMBOL to VALUE and add to customize. +Both the current value and the value to save is set, but +`custom-save-all' must be called to save customization." + (customize-set-variable symbol value) + (customize-set-value symbol value) + (customize-mark-to-save symbol)) + + +;;(nxhtml-quick-customize) + +(defun nxhtml-welcome () + "Show welcome information." + (interactive) + (require 'cus-edit) + (let* ((bufnam "*nXhtml Welcome*") + (oldbuf (get-buffer bufnam)) + (curwin (selected-window))) + (switch-to-buffer-other-window bufnam) + (unless oldbuf + (let ((inhibit-read-only t) + (here (point))) + (Custom-mode) + (nxhtml-minor-mode 1) + (setq cursor-in-non-selected-windows nil) + (nxhtml-custom-h1 "Welcome to nXhtml - a package for web editing" t) + (insert "\n\n") + (setq here (point)) + (insert "If you have not done it already it might " + "be a good time to read at least The Quick Guide in the ") + (nxhtml-custom-url-link "nXhtml overview" (nxhtml-docfile-url)) + (insert " now.\n\n") + (fill-region here (point)) + (setq here (point)) + (insert "And oh, wait! If you are new to Emacs too you might want " + "to take a quick ") + (nxhtml-custom-url-link + "Emacs tour" + "http://www.gnu.org/software/emacs/tour/") + (insert ". And then perhaps the Emacs tutorial " + "(which is in the Help menu above).\n\n") + (fill-region here (point)) + (setq here (point)) + + (unless (nxhtml-skip-welcome) + (insert "Click to ") + (widget-insert-link "remove this message" + (lambda () + "Customize `nxhtml-skip-welcome'." + (customize-option 'nxhtml-skip-welcome)) + nil) + (insert " at startup. (This page is still " + "available in the nXhtml menu, at the bottom.)")) + (fill-region here (point)) + (setq here (point)) + (goto-char (point-min)))) + (select-window curwin))) + +(defcustom nxhtml-skip-welcome nil + "Turn this on to always skip the nXhtml welcome message." + :type 'boolean + :group 'nxhtml) + +(defun nxhtml-skip-welcome () + "Return t if nXhtml welcome message should be skipped. +If nil then the message will be shown when you open the first +file using nxhtml-mode." + (or nxhtml-skip-welcome + (and nxhtml-global-minor-mode + ;;mumamo-global-mode + ;;indent-region-mode + ))) + +(defun nxhtml-say-welcome-unless-skip () + (condition-case err + (unless (nxhtml-skip-welcome) + (save-match-data + (nxhtml-welcome))) + (error (message "ERROR nxhtml-say-welcome-unless-skip: %s" err)))) + +;; Show welcome screen once after loading nxhtml: +;;(unless (boundp 'bytecomp-filename) +(eval-when '(load) + (eval-after-load 'nxhtml + ;; Use a short delay if something like desktop is used: + '(run-with-idle-timer 0.5 nil 'nxhtml-say-welcome-unless-skip))) + +(provide 'nxhtml-menu) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; nxhtml-menu.el ends here diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml-mode.el b/elpa-to-submit/nxhtml/nxhtml/nxhtml-mode.el new file mode 100644 index 0000000000..9b1ab802bf --- /dev/null +++ b/elpa-to-submit/nxhtml/nxhtml/nxhtml-mode.el @@ -0,0 +1,2779 @@ +;;; nxhtml-mode.el --- Edit XHTML files + +;; Copyright (C) 2005-2008 by Lennart Borgman +;; Parts are from Peter Heslin (see below) + +;; Author: Lennart Borgman +;; Created: 2005-08-05 +;;Version: +;; Last-Updated: 2008-12-28 Sun +;; Keywords: languages +;; +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: +;; +;; The purpose of nxhtml.el is to add some features that are useful +;; when editing XHTML files to nxml-mode. For more information see +;; `nxhtml-mode'. +;; +;; +;; Usage: +;; +;; See the file readme.txt in the directory above this file. Or, if +;; you do not have that follow the instructions below. + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; History: +;; +;; 2006-04-25: Added completion for href, src etc. Removed xhtmlin. + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; This file is not part of Emacs +;; +;; This program 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 program 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 this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +(eval-when-compile (require 'mumamo)) +(eval-when-compile + (require 'cl) + (require 'appmenu-fold) + (require 'xhtml-help) + ;;(require 'nxhtml-menu) + (require 'fold-dwim) + (require 'typesetter nil t) + ;;(require 'outline) + (unless (or (< emacs-major-version 23) + (featurep 'nxhtml-autostart)) + (let ((efn (expand-file-name + "../autostart.el" + (file-name-directory + (or load-file-name + (when (boundp 'bytecomp-filename) bytecomp-filename) + buffer-file-name))))) + (message "efn=%s" efn) + (load efn)) + (require 'rng-valid) + (require 'rng-nxml) + (require 'html-toc nil t) + (require 'html-pagetoc nil t))) + +(require 'typesetter nil t) +(require 'button) +(require 'loadhist) +(require 'nxml-mode) + +;; Require nxml things conditionally to silence byte compiler under +;; Emacs 22. +(require 'rngalt) + +(require 'url-parse) +(require 'url-expand) +(require 'popcmp) +(eval-when-compile (require 'html-imenu)) +(eval-when-compile (require 'tidy-xhtml)) +(eval-when-compile (require 'html-quote)) + +(defun nxhtml-version () + "Show nxthml version." + (interactive) + (message "nXhtml mode version %s" nxhtml-menu:version)) + +;;(defun nxhtml-nxml-fontify-attribute (att &optional namespace-declaration) +;;"Holds the original `nxml-fontify-attribute' function.") +;;(fset 'nxhtml-nxml-fontify-attribute (symbol-function 'nxml-fontify-attribute)) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Folding etc. This part is taken from +;; http://www.emacswiki.org/cgi-bin/wiki/NxmlModeForXHTML and was +;; originally written by Peter Heslin. It requires fold-dwim.el. + +(defun nxhtml-setup-for-fold-dwim () + (make-local-variable 'outline-regexp) + (setq outline-regexp "\\s *<\\([h][1-6]\\|html\\|body\\|head\\)\\b") + (make-local-variable 'outline-level) + (setq outline-level 'nxhtml-outline-level) + (outline-minor-mode 1) + (hs-minor-mode 1) + (add-to-list 'hs-special-modes-alist + '(nxhtml-mode + "" + "") + t)) + ((eq where 'in-xml-attr-val) + (let (attr + delimiter + val) + (save-excursion + (save-match-data + (re-search-forward "\\=[^<> \t\r\n\"]*" nil t))) + (let* ((name-start (match-beginning 1)) + (name-end (match-end 1)) + (colon (match-beginning 2)) + (attr (buffer-substring-no-properties name-start + (or colon name-end))) + (value-start (1+ (match-beginning 3))) + (tag (save-excursion + (when (search-backward-regexp "<[[:alpha:]]+" nil t) + (match-string 0)))) + (init (buffer-substring-no-properties value-start (point)))) + (setq delimiter (char-before value-start)) + (cond ((string= "encoding" attr) + ;; Give a default that works in browsers today + (setq val (nxhtml-coding-systems-complete + init + (symbol-name nxhtml-default-encoding)))) + ((string= "version" attr) + (setq val "1.0"))) + (when val + (insert val) + t) + ))) + ((or (memq where '(in-text + after-validation-header + in-empty-page))) + (rngalt-complete-tag-region-prepare) + (insert "<") + (condition-case err + (nxhtml-redisplay-complete) + (quit + (message "%s" (error-message-string err)) + (undo-start) + (undo-more 1) + (rngalt-complete-tag-region-cleanup))) + t) + (t + ;;(message "LAST TRY where=%s" (nxhtml-check-where))(sit-for 1) + nil) + )))) + +(defun nxhtml-img-tag-do-also () + (insert "alt=\"") + (rngalt-validate) + (insert (read-string "Alt attribute: ") + "\" ") + (insert "src=\"") + (rngalt-validate) + (let ((src (nxhtml-read-url nil nil 'nxhtml-image-url-predicate "Image"))) + (insert src) + (insert "\"") + (when (file-exists-p src) + (let ((sizes (image-size (create-image (expand-file-name src)) t))) + (insert + " width=\"" (format "%d" (car sizes)) "\"" + " height=\"" (format "%d" (cdr sizes)) "\"") + ))) + (unless (save-match-data (looking-at "[^<]\\{,200\\}>")) + (insert " />"))) + +(defun nxhtml-redisplay-complete () + (rngalt-validate) + (rng-cancel-timers) + (message "") + (redisplay t) + (nxml-complete) + (rng-activate-timers)) + +(defun nxhtml-read-from-minibuffer (prompt &optional + initial-contents keymap + read hist default-value + inherit-input-method) + (rng-cancel-timers) + (message "") + (let ((res (read-from-minibuffer prompt initial-contents keymap + read hist default-value inherit-input-method))) + (rng-activate-timers) + res)) + +(defun nxhtml-meta-tag-do-also () + (let ((type (popcmp-completing-read + "Type: " + '( + ;;"Refresh/Redirect" + "HTTP Message Headers" + "Robot Rules" + "Description for Search Engines" + )))) + (cond + ((string= type "Description for Search Engines") + (insert " name=\"Description\"") + (insert " content=\"") + (insert (nxhtml-read-from-minibuffer "Description: ")) + (insert "\" />")) + ((string= type "Robot Rules") + (insert " name=\"Robots\"") + (insert " content=\"") + (nxhtml-redisplay-complete) + (insert " />")) + ((string= type "HTTP Message Headers") + (insert " http-equiv=\"") + (nxhtml-redisplay-complete) + (insert " content=\"") + (insert (nxhtml-read-from-minibuffer "Content: ")) + (insert "\" />"))))) + +(defun nxhtml-style-tag-do-also () + (insert "type=\"text/css\"") + (insert " media=\"") + (nxhtml-redisplay-complete) + (insert ">") + (indent-according-to-mode) + (insert "\n/* ") + (indent-according-to-mode) + (insert "\n") + (end-of-line -2)) + +(defun nxhtml-script-tag-do-also () + (let ((type (popcmp-completing-read + "Type: " + '("Inlined" + "Linked")))) + (cond + ((string= type "Inlined") + (insert "type=\"text/javascript\">") + (indent-according-to-mode) + (insert "\n// ") + (indent-according-to-mode) + (insert "\n") + (indent-according-to-mode) + (end-of-line -1)) + ((string= type "Linked") + (insert "type=\"text/javascript\"") + (insert " src=\"") + (nxhtml-redisplay-complete) + (insert ">"))))) + +(defun nxhtml-link-tag-do-also () + (let ((type (popcmp-completing-read "Type: " + '( + "Other" + "Shortcut icon" + "Style sheet" + )))) + (cond + ((string= type "Style sheet") + (insert " rel=\"Stylesheet\" ") + (insert "type=\"text/css\" ") + (insert "href=\"") + (nxhtml-redisplay-complete) + (insert " media=\"") + (nxhtml-redisplay-complete) + (insert " />")) + ((string= type "Shortcut icon") + (insert " rel=\"Shortcut Icon\" ") + (insert "href=\"") + (nxhtml-redisplay-complete) + (insert " />")) + (t + (insert " ") + (nxhtml-redisplay-complete) + )))) + +(defun nxhtml-input-tag-do-also () + (insert " ") + (rngalt-validate) + ;; type= + (insert "type=\"") + (nxhtml-redisplay-complete) + (insert " ") + + (let* ((choice (save-match-data + (when (looking-back "type=\"\\(.*\\)\" ") + (match-string 1))))) + ;;(insert "type=\"" choice "\" ") + (rngalt-validate) + ;;(message "choice=%s" choice)(sit-for 2) + ;; name= + (when (member choice '("button" "checkbox" "file" "hidden" "image" + "password" "radio" "text")) + (insert "name=\"" + (read-string "Name (name): ") + "\" ") + (rngalt-validate)) + ;; checked= + (when (member choice '("checkbox" "radio")) + (when (y-or-n-p "Checked? (checked): ") + (insert "checked=\"checked\" ") + (rngalt-validate))) + ;; disabled= + (unless (string= choice "hidden") + (unless (y-or-n-p "Enabled? : ") + (insert "disabled=\"disabled\" ") + (rngalt-validate))) + ;; readonly= + (when (string= choice "text") + (when (y-or-n-p "Readonly? (readonly): ") + (insert "readonly=\"readonly\" ")) + (rngalt-validate)) + (when (string= choice "file") + ;; accept= + (require 'mailcap) + (condition-case err + (let ((prompt (concat + "Accept mime type, RET to stop (" + "C-g to skip" + "): ")) + (mime " ") + mimes + (types (when (boundp 'mailcap-mime-extensions) + (mapcar (lambda (elt) + (cdr elt)) + mailcap-mime-extensions)))) + (while (< 0 (length mime)) + (setq mime + (if types + (completing-read prompt types) + (read-string prompt))) + (when (< 0 (length mime)) + (if mimes + (setq mimes (concat mimes "," mime)) + (setq mimes mime)))) + (when (and mimes + (< 0 (length mimes))) + (insert "accept=\"" mimes "\" "))) + (quit (message "Skipped accept attribute"))) + (rngalt-validate)) + (when (string= choice "image") + ;; alt= + (insert "alt=\"") + (rngalt-validate) + (insert (read-string "Alt attribute: ") + "\" ") + (rngalt-validate) + ;; src= + (insert "src=\"") + (rngalt-validate) + (let ((src (nxhtml-read-url nil nil 'nxhtml-image-url-predicate "Image"))) + (insert src) + (insert "\" ")) + (rngalt-validate)) + ;; value= + (cond + ((member choice '("button" "reset" "submit")) + (nxhtml-do-also-value "Label")) + ((member choice '("checkbox" "radio")) + (nxhtml-do-also-value "Result")) + ((member choice '("hidden" "password" "text")) + (nxhtml-do-also-value "Value")) + ) + (insert "/>") + ;;(message "type=%s" choice)(sit-for 2) + )) + +(defun nxhtml-do-also-value (label) + (let ((v (read-string (concat label " (value): ")))) + (when (and v + (< 0 (length v))) + (insert " value=\"" v "\" ")))) + +(defun nxhtml-form-tag-do-also () + (insert "action=\"") + (rngalt-validate) + (let ((src (nxhtml-read-url nil nil nil "Action"))) + (insert src "\" ")) + ) + +(defconst nxhtml-complete-tag-do-also + '(("a" + (lambda () + (insert " href=\"") + (rngalt-validate) + (insert (nxhtml-read-url t)) + (insert "\""))) + ("form" nxhtml-form-tag-do-also) + ("img" nxhtml-img-tag-do-also) + ("input" nxhtml-input-tag-do-also) + ("link" nxhtml-link-tag-do-also) + ("script" nxhtml-script-tag-do-also) + ("style" nxhtml-style-tag-do-also) + ("meta" nxhtml-meta-tag-do-also) + ) + "List of functions to call at tag completion. +Each element of the list have the form + + \(TAG-NAME TAG-FUN) + +If `nxhtml-tag-do-also' is non-nil then TAG-FUN is called after +by `nxml-complete' (with the special setup of this function for +`nxhtml-mode') when completing a tag with the name TAG-NAME. + +The list is handled as an association list, ie only the first +occurence of a tag name is used.") + +(defun nxhtml-complete-tag-do-also-for-state-completion (dummy-completed) + "Add this to state completion functions completed hook." + (when (and nxhtml-tag-do-also + (derived-mode-p 'nxhtml-mode)) + ;; Find out tag + (let ((tag nil)) + (save-match-data + ;;(when (looking-back "<\\([a-z]+\\)[[:blank:]]+") + (when (looking-back "<\\([a-z]+\\)") + (setq tag (match-string 1)))) + (when tag + (insert " ") + (nxhtml-complete-tag-do-also tag))))) + +(defun nxhtml-complete-tag-do-also (tag) + ;; First required attributes: + (let ((tagrec (assoc tag nxhtml-complete-tag-do-also))) + (when tagrec + (funcall (cadr tagrec)))) + ) + +(defun nxhtml-turn-onoff-tag-do-also (on) + (add-hook 'nxhtml-mode-hook 'nxhtml-check-tag-do-also) + (dolist (b (buffer-list)) + (when (with-current-buffer b + (eq major-mode 'nxhtml-mode)) + (if on + (progn + (add-hook 'rngalt-complete-tag-hooks 'nxhtml-complete-tag-do-also t t) + ) + (remove-hook 'rngalt-complete-tag-hooks 'nxhtml-complete-tag-do-also t) + )))) + +(define-toggle nxhtml-tag-do-also t + "When completing tag names do some more if non-nil. +For some tag names additional things can be done at completion to +speed writing up. For example for an tag `nxhtml-mode' +can prompt for src attribute and add width and height attributes +if this attribute points to a local file. + +You can add additional elisp code for completing to +`nxhtml-complete-tag-do-also'." + :set (lambda (symbol value) + (set-default symbol value) + (nxhtml-turn-onoff-tag-do-also value)) + :group 'nxhtml) + +(defun nxhtml-check-tag-do-also () + (when nxhtml-tag-do-also + (nxhtml-turn-onoff-tag-do-also t))) + + +;;;###autoload +(define-minor-mode nxhtml-validation-header-mode + "If on use a Fictive XHTML Validation Header for the buffer. +See `nxhtml-set-validation-header' for information about Fictive XHTML Validation Headers. + +This mode may be turned on automatically in two ways: +- If you try to do completion of a XHTML tag or attribute then + `nxthml-mode' may ask you if you want to turn this mode on if + needed. +- You can also choose to have it turned on automatically whenever + a mumamo multi major mode is used, see + `nxhtml-validation-header-if-mumamo' for further information." + :global nil + :lighter " VH" + :group 'nxhtml + (if nxhtml-validation-header-mode + (progn + (unless nxhtml-current-validation-header + (setq nxhtml-current-validation-header + (nxhtml-get-default-validation-header))) + ;;(message "nxhtml-current-validation-header=%s" nxhtml-current-validation-header) + (if nxhtml-current-validation-header + (progn + (nxhtml-apply-validation-header) + (add-hook 'change-major-mode-hook 'nxhtml-vhm-change-major nil t) + (when (and (boundp 'mumamo-multi-major-mode) mumamo-multi-major-mode) + (add-hook 'mumamo-change-major-mode-hook 'nxhtml-vhm-mumamo-change-major nil t) + (add-hook 'mumamo-after-change-major-mode-hook 'nxhtml-vhm-mumamo-after-change-major nil t))) + (run-with-idle-timer 0 nil 'nxhtml-validation-header-empty (current-buffer)))) + (rngalt-set-validation-header nil) + (setq nxhtml-current-validation-header nil) + (remove-hook 'after-change-major-mode-hook 'nxhtml-vhm-after-change-major t) + (when (and (boundp 'mumamo-multi-major-mode) mumamo-multi-major-mode) + (remove-hook 'mumamo-change-major-mode-hook 'nxhtml-vhm-mumamo-change-major t) + (remove-hook 'mumamo-after-change-major-mode-hook 'nxhtml-vhm-mumamo-after-change-major t)))) + +(defun nxhtml-can-insert-page-here () + (and (not nxhtml-validation-header-mode) + (= 1 (point)) + (or (= 0 (buffer-size)) + (save-restriction + (widen) + (save-match-data + (looking-at (rx buffer-start + (0+ space) + buffer-end))))))) + +(defun nxhtml-complete-first-try () + (when (nxhtml-can-insert-page-here) + (nxhtml-empty-page-completion))) + +(defun nxhtml-completing-read-tag (prompt + table + &optional predicate require-match + initial-input hist def inherit-input-method) + (let ((popcmp-in-buffer-allowed t)) + (popcmp-completing-read prompt + table + predicate require-match + initial-input hist def inherit-input-method + nxhtml-help-tag + nxhtml-tag-sets))) + +(defun nxhtml-add-required-to-attr-set (tag) + (let ((missing (when tag + (rngalt-get-missing-required-attr + (nxthml-is-single-tag tag))))) + (if (not missing) + nxhtml-attr-sets + (cons (cons "Required" missing) + nxhtml-attr-sets)))) + +(defun nxhtml-get-tag-specific-attr-help (tag) + (append (cdr (assoc tag nxhtml-help-attribute-name-tag)) nxhtml-help-attribute-name) + ) + +(defconst nxhtml-in-start-tag-regex + ;;(defconst rng-in-start-tag-name-regex + (replace-regexp-in-string + "w" + xmltok-ncname-regexp + ;; Not entirely correct since < could be part of attribute value: + "<\\(w\\(?::w?\\)?\\)+ [^<]*" + t + t)) + +(defun nxhtml-completing-read-attribute-name (prompt + table + &optional predicate require-match + initial-input hist def inherit-input-method) + (let* ((tag (save-match-data + ;;(when (looking-back "<\\([a-z1-6]+\\) [^<]*") + (when (looking-back nxhtml-in-start-tag-regex) + (match-string 1)))) + (attr-sets (nxhtml-add-required-to-attr-set tag)) + (help-attr (nxhtml-get-tag-specific-attr-help tag)) + (popcmp-in-buffer-allowed t) + ) + (popcmp-completing-read prompt + table + predicate require-match + initial-input hist def inherit-input-method + help-attr + attr-sets))) + +(defun nxhtml-completing-read-attribute-value (prompt + table + &optional predicate require-match + initial-input hist def inherit-input-method) + (let (val) + (if table + (let ((popcmp-in-buffer-allowed t)) + (setq val (popcmp-completing-read prompt table + predicate require-match + initial-input hist def inherit-input-method))) + (let* (init + delimiter + (lt-pos (save-excursion (search-backward "<" nil t))) + (in-attr-val + (save-excursion + (re-search-backward rng-in-attribute-value-regex lt-pos t))) + (in-xml-attr-val + (unless in-attr-val + (save-excursion + (re-search-backward nxhtml-in-xml-attribute-value-regex lt-pos t)))) + ) + (when (or in-attr-val in-xml-attr-val) + ;;(save-match-data (save-excursion (re-search-forward "\\=[^<> \t\r\n\"]*" nil t))) + (let* ((name-start (match-beginning 1)) + (name-end (match-end 1)) + (colon (match-beginning 2)) + (attr (buffer-substring-no-properties name-start + (or colon name-end))) + (value-start (1+ (match-beginning 3))) + tag-start-end + (tag (save-excursion + (when (search-backward-regexp "<[[:alpha:]]+" nil t) + (setq tag-start-end (match-end 0)) + (match-string-no-properties 0))))) + (setq init (buffer-substring-no-properties value-start (point))) + (setq delimiter (char-before value-start)) + (if in-xml-attr-val + (error "in-xml-attr-val should not be true here!") + ;; (cond ((string= "encoding" attr) + ;; ;; Give a default that works in browsers today + ;; (setq val (nxhtml-coding-systems-complete + ;; init + ;; (symbol-name nxhtml-default-encoding)))) + ;; ((string= "version" attr) + ;; (setq val "1.0"))) + (cond ((string= "rel" attr) + (cond ((string= " + + + + Fictive XHTML Validation Header + + +" + ) + ("head-iso-8859-1" . + " + + + +" + ) + ("html-iso-8859-1" . + " + + +" + ) + ;; ("doctype-iso-8859-1" . + ;; " + ;; + ;; " + ;; ) + ;; ("xml-iso-8859-1" . + ;; " + ;; " + ;; ) + + ("body-utf-8" . + " + + + + Fictive XHTML Validation Header + + +" + ) + ("head-utf-8" . + " + + + +" + ) + ("head-closed-utf-8" . + " + + + + + +" + ) + ("html-utf-8" . + " + + +" + ) + ;; ("doctype-utf-8" . + ;; " + ;; + ;; " + ;; ) + ;; ("xml-utf-8" . + ;; " + ;; " + ;; ) + ) + "Fictive XHTML validation headers. +Used by `nxhtml-set-validation-header'." + :type '(alist :key-type string :value-type string) + :group 'nxhtml) + +(defcustom nxhtml-default-validation-header nil + "Default Fictive XHTML validation header. +Must be nil or one of the key values in +`nxhtml-validation-headers'." + :type 'string + :set (lambda (sym val) + (if (or (null val) + (assoc val nxhtml-validation-headers)) + (set-default sym val) + (lwarn 'nxhtml-default-validation-header + :warning "There is no Fictive XHTML Validation Header named %s" val))) + :group 'nxhtml) + +(defun nxhtml-must-have-validation-headers () + (unless nxhtml-validation-headers + (error + "No XHTML validation headers. Please customize nxhtml-validation-headers."))) + +(defvar nxhtml-set-validation-header-hist nil) + +(defcustom nxhtml-guess-validation-header-alist + ;;(rx line-start (0+ blank) "" . "head-closed-utf-8") + ("^[[:blank:]]* nh 1) + (completing-read "XHTML validation header: " + nxhtml-validation-headers + nil + t + default + nxhtml-set-validation-header-hist) + (if (not (y-or-n-p "Only one XHTML validation header is defined. Define more? ")) + default + (customize-option 'nxhtml-validation-headers) + 'adding))))) + ;;(lwarn 'svh2 :warning "key=%s" key) + (or key + (setq key (nxhtml-get-default-validation-header)) + (setq key (cons 'schema "XHTML"))) + (unless (eq key 'adding) + (setq nxhtml-current-validation-header key) + (nxhtml-validation-header-mode 1) + (nxhtml-apply-validation-header))) + +(defun nxhtml-apply-validation-header () + (when nxhtml-current-validation-header + (setq rngalt-major-mode + (if (and (boundp 'mumamo-multi-major-mode) mumamo-multi-major-mode) + (mumamo-main-major-mode) + major-mode)) + (let* ((key nxhtml-current-validation-header) + (rec (unless (listp key) + (assoc key nxhtml-validation-headers))) + (header (cdr rec))) + (if (listp key) + (let ((schema-file (rng-locate-schema-file (cdr key)))) + (unless schema-file + (error "Could not locate schema for type id `%s'" key)) ;type-id)) + (rng-set-schema-file-1 schema-file)) + (rngalt-set-validation-header header) + )))) + +(defun nxhtml-update-validation-header () + "Update the validation header in the buffer as needed." + (interactive) + (let ((mode-on nxhtml-validation-header-mode)) + (when mode-on (nxhtml-validation-header-mode 0)) + (setq nxhtml-current-validation-header nil) + (when mode-on (nxhtml-validation-header-mode 1)))) + +(defun nxhtml-vhm-change-major () + "Turn off `nxhtml-validation-header-mode' after change major." + ;;(message "nxhtml-vhm-change-major here") + (unless (and (boundp 'mumamo-multi-major-mode) mumamo-multi-major-mode) + (setq nxhtml-current-validation-header nil)) + (run-with-idle-timer 0 nil 'nxhtml-validation-header-empty (current-buffer))) +(put 'nxhtml-vhm-change-mode 'permanent-local-hook t) + +(defun nxhtml-recheck-validation-header () + "Just turn off and on again `nxhtml-validation-header-mode'. +This will adjust the XHTML validation to the code currently in +the buffer." + (interactive) + (nxhtml-validation-header-mode -1) + (nxhtml-validation-header-mode 1)) + +(defun nxhtml-validation-header-empty (buffer) + "Turn off validation header mode. +This is called because there was no validation header." + (with-current-buffer buffer + (unless nxhtml-current-validation-header + ;;(message "nxhtml-validation-header-empty") + (save-match-data ;; runs in timer + (nxhtml-validation-header-mode -1)) + ;;(message "No validation header was needed") + ))) + +(defun nxhtml-turn-on-validation-header-mode () + "Turn on `nxhtml-validation-header-mode'." + (nxhtml-validation-header-mode 1)) + + +(defun nxhtml-vhm-mumamo-change-major () + (put 'rngalt-validation-header 'permanent-local t) + (put 'nxhtml-validation-header-mode 'permanent-local t) + (put 'nxhtml-current-validation-header 'permanent-local t) + ;;(put 'nxhtml-validation-header-mode-major-mode 'permanent-local t) + ;;(setq nxhtml-validation-header-mode-major-mode mumamo-set-major-running) + ) + +(defun nxhtml-vhm-mumamo-after-change-major () + (put 'rngalt-validation-header 'permanent-local nil) + (put 'nxhtml-validation-header-mode 'permanent-local nil) + (put 'nxhtml-current-validation-header 'permanent-local nil) + ;;(put 'nxhtml-validation-header-mode-major-mode 'permanent-local nil) + ) + +(defcustom nxhtml-validation-headers-check 'html + "Defines what check the function with the same name does. +The function returns true if the condition here is met." + :type '(choice :tag "Add Fictive XHTML Validation Header if:" + (const :tag "If buffer contains html" html) + (const :tag "If buffer contains html or is empty" html-empty)) + :group 'nxhtml) + +;; (defun nxhtml-validation-headers-check (buffer) +;; "Return non-nil if buffer contains a html tag or is empty. +;; This is for use with `nxhtml-validation-header-filenames'. + +;; The variable `nxhtml-validation-headers-check' determines how the +;; check is made." +;; (if (= 0 (buffer-size buffer)) +;; (eq 'html-empty nxhtml-validation-headers-check) +;; (save-match-data +;; (save-restriction +;; (let ((here (point)) +;; (html nil)) +;; (goto-char (point-min)) +;; (setq html (re-search-forward "" nil t)) +;; (goto-char here) +;; html))))) + +;; (defcustom nxhtml-validation-header-filenames +;; '( +;; ("\.php\\'" nxhtml-validation-headers-check) +;; ("\.rhtml\\'" nxhtml-validation-headers-check) +;; ("\.jsp\\'" nxhtml-validation-headers-check) +;; ) +;; "Alist for turning on `nxhtml-validation-mode'. +;; The entries in the list should have the form + +;; \(FILE-REGEXP CHECK-FUNCION) + +;; If buffer file name matches the regexp FILE-REGEXP and the +;; function CHECK-FUNCTION returns non-nil when called with the +;; buffer as an argument \(or CHECK-FUNCTION is nil) then +;; `nxhtml-global-validation-header-mode' will turn on +;; `nxhtml-validation-header-mode' in buffer. + +;; The function `nxhtml-validation-headers-check' may be a useful +;; value for CHECK-FUNCTION. + +;; See also `nxhtml-maybe-turn-on-validation-header'." +;; :type '(alist :key-type regexp :tag "File name regexp" +;; :value-type (group (choice (const :tag "No more check" nil) +;; (function :tag "Check buffer with")))) +;; :group 'nxhtml) + + + +;; (defun nxhtml-maybe-turn-on-validation-header () +;; "Maybe turn on `nxhtml-validation-header-mode' in buffer. +;; This is called by `nxhtml-global-validation-header-mode'. + +;; See `nxhtml-validation-header-filenames' for how the check +;; is made." +;; (or (and (or (and mumamo-mode +;; (eq (mumamo-main-major-mode) 'nxhtml-mode)) +;; (eq major-mode 'nxhtml-mode)) +;; rngalt-validation-header +;; nxhtml-current-validation-header +;; nxhtml-validation-header-mode +;; (progn +;; ;;(lwarn 'maybe :warning "quick, buffer=%s" (current-buffer)) +;; (nxhtml-validation-header-mode 1) +;; t)) +;; (when (buffer-file-name) +;; (unless (or ;;nxhtml-validation-header-mode +;; (minibufferp (current-buffer)) +;; (string= " " (substring (buffer-name) 0 1)) +;; (string= "*" (substring (buffer-name) 0 1)) +;; ) +;; (when (catch 'turn-on +;; (save-match-data +;; (dolist (rec nxhtml-validation-header-filenames) +;; (when (string-match (car rec) (buffer-file-name)) +;; (let ((fun (nth 1 rec))) +;; (if (not fun) +;; (progn +;; ;;(lwarn 't :warning "matched %s to %s, nil" (car rec) (buffer-file-name)) +;; (throw 'turn-on t)) +;; (when (funcall fun (current-buffer)) +;; ;;(lwarn 't :warning "matched %s to %s" (car rec) (buffer-file-name)) +;; (throw 'turn-on t)))))))) +;; ;;(lwarn 't :warning "turn on %s, buffer=%s" major-mode (current-buffer)) +;; (nxhtml-validation-header-mode 1)))))) + + +;; ;; Fix-me: Is this really the way to do it? Would it not be better to +;; ;; tie this to mumamo-mode in the turn on hook there? After all +;; ;; validation headers are probably not used unless mumamo-mode is on. +;; (define-globalized-minor-mode nxhtml-global-validation-header-mode +;; nxhtml-validation-header-mode +;; nxhtml-maybe-turn-on-validation-header +;; :group 'nxhtml) +;; ;; The problem with global minor modes: +;; (when (and nxhtml-global-validation-header-mode +;; (not (boundp 'define-global-minor-mode-bug))) +;; (nxhtml-global-validation-header-mode 1)) + + +(defcustom nxhtml-validation-header-mumamo-modes + '(nxhtml-mode) + "Main major modes for which to turn on validation header. +Turn on Fictive XHTML Validation Header if main major mode for the +used mumamo multi major mode is any of those in this list. + +See `mumamo-defined-turn-on-functions' for information about +mumamo multi major modes." + :type '(repeat (function :tag "Main major mode in mumamo")) + :group 'nxhtml) + +(defun nxhtml-add-validation-header-if-mumamo () + "Maybe turn on validation header. +See `nxhtml-validation-header-if-mumamo' for more information." + ;;(nxhtml-validation-headers-check (current-buffer)) + (when (and (fboundp 'mumamo-main-major-mode) + (memq (mumamo-main-major-mode) nxhtml-validation-header-mumamo-modes)) + (nxhtml-validation-header-mode 1))) + +(define-toggle nxhtml-validation-header-if-mumamo nil + "Add a fictive validation header when mumamo is used. +If this variable is t then add a Fictive XHTML Validation Header +\(see `nxhtml-validation-header-mode') in buffer when mumamo is +used. However do this only if `mumamo-main-major-mode' is one of +those in `nxhtml-validation-header-mumamo-modes'. + +Changing this variable through custom adds/removes the function +`nxhtml-add-validation-header-if-mumamo' to +`mumamo-turn-on-hook'." + :set '(lambda (sym val) + (set-default sym val) + (if val + (add-hook 'mumamo-turn-on-hook 'nxhtml-add-validation-header-if-mumamo) + (remove-hook 'mumamo-turn-on-hook 'nxhtml-add-validation-header-if-mumamo))) + :group 'nxhtml) + +(defun nxhtml-warnings-are-visible () + (get 'rng-error 'face)) + +(defvar nxhtml-old-rng-error-face nil) +(defun nxhtml-toggle-visible-warnings () + "Toggle the red underline on validation errors. +Those can be quite disturbing when using mumamo multi major modes +because there will probably be many validation errors in for +example a php buffer, since unfortunately the validation routines +in `rng-validate-mode' from `nxml-mode' tries to validate the +whole buffer as XHTML. + +Also, because of a \(normally unimportant) bug in Emacs 22, +the red underline that marks an error will sometimes span several +lines instead of just marking a single character as it +should. \(This bug is a problem with overlays in Emacs 22.)" + (interactive) + (let ((face (get 'rng-error 'face))) + (if face + (progn + (setq nxhtml-old-rng-error-face (get 'rng-error 'face)) + (put 'rng-error 'face nil)) + (put 'rng-error 'face nxhtml-old-rng-error-face)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Bug corrections +;; (defun nxml-indent-line () +;; "Indent current line as XML." +;; (let ((indent (nxml-compute-indent)) +;; (from-end (- (point-max) (point)))) +;; (when indent +;; (beginning-of-line) +;; (let ((bol (point))) +;; (skip-chars-forward " \t") +;; ;; There is a problem with some lines, try a quick fix: +;; (when (and (= 0 indent) +;; (not (eq (char-after) ?<))) +;; (save-excursion +;; (save-match-data +;; (when (re-search-backward "^<" nil t) +;; (when (search-forward " ") +;; (setq indent (current-column)))))) +;; (when (= 0 indent) +;; (setq indent nxml-child-indent))) +;; ;; And sometimes nxml-compute-indent get very upset, check for +;; ;; that: +;; (let ((here (point))) +;; (beginning-of-line 0) +;; (back-to-indentation) +;; (when (and (= indent (current-column)) +;; (eq (char-after) ?\")) +;; (setq indent 0)) +;; (goto-char here)) +;; (unless (= (current-column) indent) +;; (delete-region bol (point)) +;; (indent-to indent))) +;; (when (> (- (point-max) from-end) (point)) +;; (goto-char (- (point-max) from-end)))))) + + +;; FIX-ME: untag should be in nxml-mode.el since it is in no way +;; specific to nxhtml-mode, but I do not want to change nxml-mode.el +;; at the moment. + +(defcustom nxml-untag-select 'yes + "Decide whether to select an element untagged by `nxml-untag-element'. +If this variable is 'yes the element is selected after untagging +the element. The mark is set at the end of the element and point +at the beginning of the element. + +If this variable is 'no then the element is not selected and +point is not moved. If it is 'ask the user is asked what to do." + :type '(choice (const :tag "Yes" yes) + (const :tag "No" no) + (const :tag "Ask" ask)) + :group 'nxml) + +(defun nxml-untag-element (arg) + "Remove start and end tag from current element. +The mark is by default set to the end of the former element and +point is moved to the beginning. Mark is also activated so that +it is easy to surround the former element with a new tag. + +Whether to select the old element is controlled by +`nxml-untag-select'. The meaning of the values 'yes and 'no for +this variable is flipped by using a universal argument. + +Note: If you want to `undo' the untag and you use +`transient-mark-mode' then you must first do something so that +the region is not highlighted (for example C-g)." + (interactive "*P") + (let ((here (point-marker)) + el-start + el-start-end + el-end + el-end-end + (select t)) + (nxml-backward-up-element) + (setq el-start (point)) + (nxml-forward-balanced-item) + (setq el-start-end (point)) + (goto-char el-start) + (nxml-forward-element) + (setq el-end-end (point-marker)) + (nxml-backward-single-balanced-item) + (setq el-end (point)) + (delete-region el-end el-end-end) + (delete-region el-start el-start-end) + ;; Select the element or not? + (if (eq nxml-untag-select 'ask) + (setq select (y-or-n-p "Select the old element? ")) + (when (eq nxml-untag-select 'no) + (setq select nil)) + (when arg + (setq select (not select)))) + (if (not select) + (goto-char here) + (goto-char el-end-end) + (push-mark nil t t) + (setq mark-active t) + (setq deactivate-mark nil) + (goto-char el-start)))) + +(defun nxhtml-rollover-insert-2v () + "Insert CSS rollover images. +The upper half of the image will be used when mouse is out and +the lower half when mouse is over the image. + +Only CSS is used for the rollover. The CSS code is written to the +header part of the file if possible, otherwise it is copied to +the kill ring/clipboard. + +The CSS code is built from a template file and the image size. + +This might be used for example for creating a menu with +alternatives vertically or horizontally. + +Usage example: + + If you want to make a small button style menu with images you + can start like this: + + + + Then put point at the X above (this is just a mark, should not + be in your code) and call this function. + + It will add some CSS code to in the header of your file. You + may want to tweak this a little bit, see below (or place it + somewhere else). It may look like this: + + #mylinks a { + /* Image */ + display: block; + background: transparent url(\"img/mybutton.png\") 0 0 no-repeat; + overflow: hidden; + width: 200px; + /* Text placement and size, etc */ + text-align: center; + /* You may need to change top and bottom padding depending + on font size. */ + padding-top: 11px; + font-size: 12px; + padding-bottom: 9px; + text-decoration: none; + white-space: nowrap; + border: none; + } + #mylinks a:hover { + background-position: 0 -35px; + } + #mylinks li { + display: inline; + padding: 0; + margin: 0; + float: none; + } + +For an example of usage see the file nxhtml.html that comes with +nXhtml and can be opened from the nXhtml menu under + + nXhtml / nXhtml Help and Setup / nXhtml version nn Overview" + (interactive) + ;; Fix-me: not quite ready yet, but should work OK." + (save-excursion + (let* ((tag (progn + (search-forward ">" nil t) + (unless (re-search-backward (rx "<" + (1+ (any "a-zA-Z:")) + (1+ (not (any ">"))) + " id=\"" + (submatch (+? anything)) + "\"") + nil t) + (error "Can't find tag with id backwards")) + (match-string-no-properties 0))) + (tagid (match-string-no-properties 1)) + (tagovl (let ((ovl (make-overlay + (match-beginning 0) (match-end 0)))) + (overlay-put ovl 'face 'highlight) + ovl)) + (head-end (save-excursion (search-backward "\n" + css + "\n\n") + (select-window this-window)) + (kill-new css) + (message "No place to insert CSS, copied to clipboard instead")))) + (delete-overlay tagovl) + )))) + +;; Fix-me: image border 0 +;; Fix-me: SSI +;; Fix-me: Better a tag completion, target etc. +;; Fix-me: image map - is that possible now? +;; Fix-me: Special chars - completing on &? Or popup? Use nxml-insert-named-char +;; Fix-me: Quick table insert? A form? +;; Fix-me: Quick object insert? (applet is depreceated) +;; Fix-me: Better meta insert? Quick meta? +;; Fix-me: Quick div! Better div completion with position: static, +;; relative, absolute and fixed - with some explanations. +;; Fix-me: Quick hr? +;; Fix-me: Import CSS? Export CSS? +;; Fix-me: Use nxhtml-js.el? +;; Fix-me: Scroll bar colors etc? See 1stPage. +;; body { +;; scrollbar-arrow-color: #FF6699; +;; scrollbar-3dlight-color: #00FF33; +;; scrollbar-highlight-color: #66FFFF; +;; scrollbar-face-color: #6699FF; +;; scrollbar-shadow-color: #6633CC; +;; scrollbar-darkshadow-color: #660099; +;; scrollbar-track-color: #CC6633; +;; } +;; Fix-me: More quick menus: http://www.cssplay.co.uk/menus/ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(provide 'nxhtml-mode) + +;;; nxhtml-mode.el ends here diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml-mumamo.el b/elpa-to-submit/nxhtml/nxhtml/nxhtml-mumamo.el index 32459f1835..91a2e89b4a 100644 --- a/elpa-to-submit/nxhtml/nxhtml/nxhtml-mumamo.el +++ b/elpa-to-submit/nxhtml/nxhtml/nxhtml-mumamo.el @@ -3,14 +3,14 @@ ;; Author: Lennart Borgman (lennart O borgman A gmail O com) ;; Created: 2008-03-10T19:04:20+0100 Mon (defconst nxhtml-mumamo:version "0.5") -;; Last-Updated: x +;; Last-Updated: 2009-01-06 Tue ;; URL: ;; Keywords: ;; Compatibility: ;; ;; Features that might be required by this library: ;; -;; None + ;; `backquote', `bytecomp', `mumamo', `mumamo-fun'. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -44,6 +44,9 @@ ;; ;;; Code: +(eval-when-compile (require 'cl)) +(eval-when-compile (require 'nxhtml)) +(eval-when-compile (require 'rng-valid nil t)) (require 'mumamo-fun) ;; (defgroup nxhtml-auto-val-head nil @@ -75,10 +78,12 @@ ;;;###autoload (define-mumamo-multi-major-mode nxhtml-mumamo-mode "Turn on multiple major modes for (X)HTML with main mode `nxhtml-mode'. -This covers inlined style and javascript and PHP." +This covers inlined style and javascript and PHP. + +See also `mumamo-alt-php-tags-mode'." ("nXhtml Family" nxhtml-mode (mumamo-chunk-xml-pi - ;;mumamo-chunk-xml-pi2 + mumamo-chunk-alt-php mumamo-chunk-inlined-style mumamo-chunk-inlined-script mumamo-chunk-style= @@ -150,6 +155,7 @@ This also covers inlined style and javascript." (mumamo-chunk-genshi% mumamo-chunk-genshi$ mumamo-chunk-xml-pi + mumamo-chunk-alt-php mumamo-chunk-inlined-style mumamo-chunk-inlined-script mumamo-chunk-style= @@ -191,7 +197,6 @@ This also covers inlined style and javascript." ( mumamo-chunk-mjt$ mumamo-chunk-xml-pi - ;;mumamo-chunk-xml-pi2 mumamo-chunk-inlined-style mumamo-chunk-inlined-script mumamo-chunk-style= diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml.el b/elpa-to-submit/nxhtml/nxhtml/nxhtml.el index 2a8848ea43..5658bf37f1 100644 --- a/elpa-to-submit/nxhtml/nxhtml/nxhtml.el +++ b/elpa-to-submit/nxhtml/nxhtml/nxhtml.el @@ -1,115 +1,64 @@ -;;; nxhtml.el --- Edit XHTML files - -;; Copyright (C) 2005-2008 by Lennart Borgman -;; Parts are from Peter Heslin (see below) - -;; Author: Lennart Borgman -;; Created: 2005-08-05 -;;(defconst nxhtml:version "1.45") ;;Version: -;; Last-Updated: 2008-09-30T11:46:26+0200 Tue -;; Keywords: languages +;;; nxhtml.el --- Keeping nXhtml together +;; +;; Author: Lennart Borgman (lennart O borgman A gmail O com) +;; Created: 2009-01-01 Thu +;; Version: +;; Last-Updated: +;; URL: +;; Keywords: +;; Compatibility: ;; +;; Features that might be required by this library: ;; +;; None ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Commentary: ;; -;; The purpose of nxhtml.el is to add some features that are useful -;; when editing XHTML files to nxml-mode. For more information see -;; `nxhtml-mode'. -;; -;; -;; Usage: -;; -;; See the file readme.txt in the directory above this file. Or, if -;; you do not have that follow the instructions below. -;; -;; Put this file in `load-path'. In your .emacs: -;; -;; ;; Load nxml according to the instructions, ie something like: -;; (load "your-path/nxml-mode-20041004/rng-auto.el") -;; -;; ;; Then autoload nxhtml-mode: -;; (autoload 'nxhtml-mode "nxhtml" "Mode for editing XHTML files - based on nxml-mode." t) -;; -;; ;; For file associations you can use: -;; (majmodpri-apply-priorities t) ;; ;; -;; Tip: Why not put all these in a .nxml file that you load in your -;; .emacs? - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -;;; History: +;;; Change log: ;; -;; 2006-04-25: Added completion for href, src etc. Removed xhtmlin. - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -;; This file is not part of Emacs +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; This program 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. +;; published by the Free Software Foundation; either version 2, or +;; (at your option) any later version. ;; -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; This program 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 this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - - +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Code: -(eval-when-compile - (require 'cl) - (unless (featurep 'nxhtml-autostart) - (let ((efn (expand-file-name - "../autostart.el" - (file-name-directory - (if load-file-name - load-file-name - (buffer-file-name)))))) - (load efn)) - (require 'rng-valid) - (require 'rng-nxml) - (require 'html-toc nil t) - (require 'html-pagetoc nil t))) - -(require 'button) -(require 'loadhist) -(require 'nxml-mode) -(require 'url-parse) -(require 'url-expand) -(require 'popcmp) -(require 'rngalt) -(require 'html-imenu) -(require 'fold-dwim) -(require 'tidy-xhtml) -;;(require 'nxhtml-menu) -(require 'html-quote) -;;(require 'nxhtml-mumamo) +(defgroup nxhtml nil + "Customization of `nxhtml-mode'." + :group 'nxml) -(defun nxhtml-version () - "Show nxthml version." +;;;###autoload +(defun nxhtml-customize () + "Customize nXhtml." (interactive) - (message "nXhtml mode version %s" nxhtml-menu:version)) + (customize-group 'nxhtml)) -(defgroup nxhtml nil - "Customization of nxhtml-mode." - :group 'nxml) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Features + +;; Fix-me: add help links (defvar nxhtml-req-features (let ((req-features '( @@ -128,6 +77,7 @@ (html-move "Moving files in web sites" "html-move.el" "0.31") (html-toc "Web site TOC" "html-toc.el" "0.4") (html-wtoc "Merge pages and web Site TOC" "html-wtoc.el" "0.2") + (html-write "Show as italic etc" "html-write.el" "0.6") "General" (mumamo "Multiple major modes in buffer" "mumamo.el" "0.73") (majmodpri "Major mode priorities" "majmodpri.el" "0.5") @@ -135,17 +85,29 @@ (fold-dwim "Folding on headers and tags" "fold-dwim.el" "1.3") (appmenu "General popup menu" "appmenu.el" "0.53") (appmenu-fold "Popup menu entries for folding" "appmenu-fold.el" "0.51" appmenu fold-dwim) + (winsize "Resizing and window handling" "winsize.el" "0.98") + (winsav "Save/restore for windows/frames" "winsav.el" "0.77") + (viper-tut "Viper try-out tutorial" "viper-tut.el" "0.2") + (ourcomments-util "Some minor utilities" "ourcomments-util.el" "0.25") "External applications / Emacs as dito" (as-external "Emacs as an external editor" "as-external.el" "0.5") (sex-mode "Send to EXternal program" "sex-mode.el" "0.71") + (freemind "Export/import freemind maps" "freemind.el" "0.60") + (hfyview "Print with browser/copy to html" "hfyview.el" "0.63") + (mozadd "Mirroring in Firefox" "mozadd.el" "0.2") "Images and Colors" (gimp "Edit images with GIMP" "gimp.el" "0.2") - (hexcolor "Hex color help functions" "hexcolor.el" "0.51") + (inlimg "Inline images" "inlimg.el" "0.7") + (css-color "Css color help functions" "css-color.el" "0.02") + (chart "Easy google charts" "chart.el" "0.2") "Fetching and using elisp from repositories" - (udev "Fetch and load from elisp repostories" "udev.el" "0.5") + (udev "Fetch and from elisp repostories" "udev.el" "0.5") (udev-cedet "CEDET fetcher and loader" "udev-cedet.el" "0.2") (udev-ecb "ECB fetcher and loader" "udev-ecb.el" "0.2") (udev-rinari "Rinari fetcher and loader" "udev-rinari.el" "0.2") + "Games and life" + (pause "Take a break! I wish you some fun!" "pause.el" "0.64") + (n-back "n-back game for fun and brain" "n-back.el" "0.5") ) )) req-features)) @@ -169,14 +131,12 @@ (defun nxhtml-feature-insert (ok msg) (put-text-property 0 (length msg) - 'face (list - (cons 'foreground-color - (if ok "RGB:00/cc/00" - "RGB:cc/00/00"))) + 'face (if ok font-lock-type-face font-lock-warning-face) msg) (insert msg)) (defun nxhtml-feature-check (feat-entry silent) + (require 'loadhist) (let ((feature (nth 0 feat-entry)) (description (nth 1 feat-entry)) (file (nth 2 feat-entry)) @@ -229,31 +189,37 @@ description file)))) ok)) +;; Fix-me: move help here from `nxhtml-mode'? + +;;;###autoload (defun nxhtml-features-check () "Check if external modules used by nXhtml are found." (interactive) - (switch-to-buffer-other-window (get-buffer-create "*nXhtml Optional Features Check*") t) - (help-mode) - (setq buffer-read-only t) - (let ((inhibit-read-only t)) - (erase-buffer) - (let ((s (concat "Elisp modules used by nXhtml version " nxhtml-menu:version ":"))) - (put-text-property 0 (length s) - 'face '( :weight bold :height 1.4) - s) - (insert s "\n\n")) - ;;(nxhtml-load-req-features) - (dolist (feat-entry nxhtml-req-features) - (if (stringp feat-entry) - (insert "==== " (propertize feat-entry 'face 'font-lock-comment-face 'face '(:weight bold)) "\n") - (nxhtml-feature-check feat-entry nil))) - (goto-char (point-min)) - (while (search-forward-regexp "[-a-zA-Z0-9]+\\.el" nil t) - (nxhtml-make-library-link - (match-beginning 0) - (match-end 0))) - (goto-char (point-min))) - (set-buffer-modified-p nil)) + (with-output-to-temp-buffer (help-buffer) + (help-setup-xref (list #'nxhtml-features-check) (interactive-p)) + (with-current-buffer (help-buffer) + (nxhtml-minor-mode 1) + (erase-buffer) + (let ((s (concat "Elisp modules used by nXhtml version " nxhtml-menu:version ":"))) + (put-text-property 0 (length s) + 'face '( :weight bold :height 1.4) + s) + (insert s "\n\n")) + (nxhtml-load-req-features) + (nxhtml-load-req-features) + (nxhtml-load-req-features) + (nxhtml-load-req-features) + (dolist (feat-entry nxhtml-req-features) + (if (stringp feat-entry) + (insert "==== " (propertize feat-entry 'face 'font-lock-comment-face 'face '(:weight bold)) "\n") + (nxhtml-feature-check feat-entry nil))) + (goto-char (point-min)) + (while (search-forward-regexp "[-a-zA-Z0-9]+\\.el" nil t) + (nxhtml-make-library-link + (match-beginning 0) + (match-end 0))) + (goto-char (point-min))) + (set-buffer-modified-p nil))) (defun nxhtml-all-features-found () (let ((all t)) @@ -264,59 +230,9 @@ (setq all nil)))) all)) -;;(defun nxhtml-nxml-fontify-attribute (att &optional namespace-declaration) -;;"Holds the original `nxml-fontify-attribute' function.") -;;(fset 'nxhtml-nxml-fontify-attribute (symbol-function 'nxml-fontify-attribute)) - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Folding etc. This part is taken from -;; http://www.emacswiki.org/cgi-bin/wiki/NxmlModeForXHTML and was -;; originally written by Peter Heslin. It requires fold-dwim.el. - -(when (featurep 'fold-dwim) - - (defun nxhtml-setup-for-fold-dwim () - (make-local-variable 'outline-regexp) - (setq outline-regexp "\\s *<\\([h][1-6]\\|html\\|body\\|head\\)\\b") - (make-local-variable 'outline-level) - (setq outline-level 'nxhtml-outline-level) - (outline-minor-mode 1) - (hs-minor-mode 1) - (add-to-list 'hs-special-modes-alist - '(nxhtml-mode - "" - "") - t)) - ((eq where 'in-xml-attr-val) - (let (attr - delimiter - val) - (save-excursion - (save-match-data - (re-search-forward "\\=[^<> \t\r\n\"]*" nil t))) - (let* ((name-start (match-beginning 1)) - (name-end (match-end 1)) - (colon (match-beginning 2)) - (attr (buffer-substring-no-properties name-start - (or colon name-end))) - (value-start (1+ (match-beginning 3))) - (tag (save-excursion - (when (search-backward-regexp "<[[:alpha:]]+" nil t) - (match-string 0)))) - (init (buffer-substring-no-properties value-start (point)))) - (setq delimiter (char-before value-start)) - (cond ((string= "encoding" attr) - ;; Give a default that works in browsers today - (setq val (nxhtml-coding-systems-complete - init - (symbol-name nxhtml-default-encoding)))) - ((string= "version" attr) - (setq val "1.0"))) - (when val - (insert val) - t) - ))) - ((or (memq where '(in-text - after-validation-header - in-empty-page))) - (rngalt-complete-tag-region-prepare) - (insert "<") - (condition-case err - (nxhtml-redisplay-complete) - (quit - (message "%s" (error-message-string err)) - (undo-start) - (undo-more 1) - (rngalt-complete-tag-region-cleanup))) - t) - (t - ;;(message "LAST TRY where=%s" (nxhtml-check-where))(sit-for 1) - nil) - )))) - -(defun nxhtml-img-tag-do-also () - (insert "alt=\"") - (rngalt-validate) - (insert (read-string "Alt attribute: ") - "\" ") - (insert "src=\"") - (rngalt-validate) - (let ((src (nxhtml-read-url nil nil 'nxhtml-image-url-predicate "Image"))) - (insert src) - (insert "\"") - (when (file-exists-p src) - (let ((sizes (image-size (create-image (expand-file-name src)) t))) - (insert - " width=\"" (format "%d" (car sizes)) "\"" - " height=\"" (format "%d" (cdr sizes)) "\"") - ))) - (unless (save-match-data (looking-at "[^<]\\{,200\\}>")) - (insert " />"))) - -(defun nxhtml-redisplay-complete () - (rngalt-validate) - (rng-cancel-timers) - (message "") - (redisplay t) - (nxml-complete) - (rng-activate-timers)) - -(defun nxhtml-read-from-minibuffer (prompt &optional - initial-contents keymap - read hist default-value - inherit-input-method) - (rng-cancel-timers) - (message "") - (let ((res (read-from-minibuffer prompt initial-contents keymap - read hist default-value inherit-input-method))) - (rng-activate-timers) - res)) - -(defun nxhtml-meta-tag-do-also () - (let ((type (popcmp-completing-read - "Type: " - '( - ;;"Refresh/Redirect" - "HTTP Message Headers" - "Robot Rules" - "Description for Search Engines" - )))) - (cond - ((string= type "Description for Search Engines") - (insert " name=\"Description\"") - (insert " content=\"") - (insert (nxhtml-read-from-minibuffer "Description: ")) - (insert "\" />")) - ((string= type "Robot Rules") - (insert " name=\"Robots\"") - (insert " content=\"") - (nxhtml-redisplay-complete) - (insert " />")) - ((string= type "HTTP Message Headers") - (insert " http-equiv=\"") - (nxhtml-redisplay-complete) - (insert " content=\"") - (insert (nxhtml-read-from-minibuffer "Content: ")) - (insert "\" />"))))) - -(defun nxhtml-style-tag-do-also () - (insert "type=\"text/css\"") - (insert " media=\"") - (nxhtml-redisplay-complete) - (insert ">") - (indent-according-to-mode) - (insert "\n/* ") - (indent-according-to-mode) - (insert "\n") - (end-of-line -2)) - -(defun nxhtml-script-tag-do-also () - (let ((type (popcmp-completing-read - "Type: " - '("Inlined" - "Linked")))) - (cond - ((string= type "Inlined") - (insert "type=\"text/javascript\">") - (indent-according-to-mode) - (insert "\n// ") - (indent-according-to-mode) - (insert "\n") - (indent-according-to-mode) - (end-of-line -1)) - ((string= type "Linked") - (insert "type=\"text/javascript\"") - (insert " src=\"") - (nxhtml-redisplay-complete) - (insert ">"))))) - -(defun nxhtml-link-tag-do-also () - (let ((type (popcmp-completing-read "Type: " - '( - "Other" - "Shortcut icon" - "Style sheet" - )))) - (cond - ((string= type "Style sheet") - (insert " rel=\"Stylesheet\" ") - (insert "type=\"text/css\" ") - (insert "href=\"") - (nxhtml-redisplay-complete) - (insert " media=\"") - (nxhtml-redisplay-complete) - (insert " />")) - ((string= type "Shortcut icon") - (insert " rel=\"Shortcut Icon\" ") - (insert "href=\"") - (nxhtml-redisplay-complete) - (insert " />")) - (t - (insert " ") - (nxhtml-redisplay-complete) - )))) - -(defun nxhtml-input-tag-do-also () - (insert " ") - (rngalt-validate) - ;; type= - (insert "type=\"") - (nxhtml-redisplay-complete) - (insert " ") - - (let* ((choice (save-match-data - (when (looking-back "type=\"\\(.*\\)\" ") - (match-string 1))))) - ;;(insert "type=\"" choice "\" ") - (rngalt-validate) - ;;(message "choice=%s" choice)(sit-for 2) - ;; name= - (when (member choice '("button" "checkbox" "file" "hidden" "image" - "password" "radio" "text")) - (insert "name=\"" - (read-string "Name (name): ") - "\" ") - (rngalt-validate)) - ;; checked= - (when (member choice '("checkbox" "radio")) - (when (y-or-n-p "Checked? (checked): ") - (insert "checked=\"checked\" ") - (rngalt-validate))) - ;; disabled= - (unless (string= choice "hidden") - (unless (y-or-n-p "Enabled? : ") - (insert "disabled=\"disabled\" ") - (rngalt-validate))) - ;; readonly= - (when (string= choice "text") - (when (y-or-n-p "Readonly? (readonly): ") - (insert "readonly=\"readonly\" ")) - (rngalt-validate)) - (when (string= choice "file") - ;; accept= - (require 'mailcap) - (condition-case err - (let ((prompt (concat - "Accept mime type, RET to stop (" - "C-g to skip" - "): ")) - (mime " ") - mimes - (types (when (boundp 'mailcap-mime-extensions) - (mapcar (lambda (elt) - (cdr elt)) - mailcap-mime-extensions)))) - (while (< 0 (length mime)) - (setq mime - (if types - (completing-read prompt types) - (read-string prompt))) - (when (< 0 (length mime)) - (if mimes - (setq mimes (concat mimes "," mime)) - (setq mimes mime)))) - (when (and mimes - (< 0 (length mimes))) - (insert "accept=\"" mimes "\" "))) - (quit (message "Skipped accept attribute"))) - (rngalt-validate)) - (when (string= choice "image") - ;; alt= - (insert "alt=\"") - (rngalt-validate) - (insert (read-string "Alt attribute: ") - "\" ") - (rngalt-validate) - ;; src= - (insert "src=\"") - (rngalt-validate) - (let ((src (nxhtml-read-url nil nil 'nxhtml-image-url-predicate "Image"))) - (insert src) - (insert "\" ")) - (rngalt-validate)) - ;; value= - (cond - ((member choice '("button" "reset" "submit")) - (nxhtml-do-also-value "Label")) - ((member choice '("checkbox" "radio")) - (nxhtml-do-also-value "Result")) - ((member choice '("hidden" "password" "text")) - (nxhtml-do-also-value "Value")) - ) - (insert "/>") - ;;(message "type=%s" choice)(sit-for 2) - )) - -(defun nxhtml-do-also-value (label) - (let ((v (read-string (concat label " (value): ")))) - (when (and v - (< 0 (length v))) - (insert " value=\"" v "\" ")))) - -(defun nxhtml-form-tag-do-also () - (insert "action=\"") - (rngalt-validate) - (let ((src (nxhtml-read-url nil nil nil "Action"))) - (insert src "\" ")) - ) - -(defconst nxhtml-complete-tag-do-also - '(("a" - (lambda () - (insert " href=\"") - (rngalt-validate) - (insert (nxhtml-read-url t)) - (insert "\""))) - ("form" nxhtml-form-tag-do-also) - ("img" nxhtml-img-tag-do-also) - ("input" nxhtml-input-tag-do-also) - ("link" nxhtml-link-tag-do-also) - ("script" nxhtml-script-tag-do-also) - ("style" nxhtml-style-tag-do-also) - ("meta" nxhtml-meta-tag-do-also) - ) - "List of functions to call at tag completion. -Each element of the list have the form - - \(TAG-NAME TAG-FUN) - -If `nxhtml-tag-do-also' is non-nil then TAG-FUN is called after -by `nxml-complete' (with the special setup of this function for -`nxhtml-mode') when completing a tag with the name TAG-NAME. - -The list is handled as an association list, ie only the first -occurence of a tag name is used.") - - -(defun nxhtml-complete-tag-do-also (tag) - ;; First required attributes: - (let ((tagrec (assoc tag nxhtml-complete-tag-do-also))) - (when tagrec - (funcall (cadr tagrec)))) - ) - -(defun nxhtml-check-tag-do-also () - (when nxhtml-tag-do-also - (nxhtml-turn-onoff-tag-do-also t))) - -(defun nxhtml-turn-onoff-tag-do-also (on) - (add-hook 'nxhtml-mode-hook 'nxhtml-check-tag-do-also) - (dolist (b (buffer-list)) - (when (with-current-buffer b - (eq major-mode 'nxhtml-mode)) - (if on - (progn - (add-hook 'rngalt-complete-tag-hooks 'nxhtml-complete-tag-do-also t t) - ) - (remove-hook 'rngalt-complete-tag-hooks 'nxhtml-complete-tag-do-also t) - )))) - -(define-toggle nxhtml-tag-do-also t - "When completing tag names do some more if non-nil. -For some tag names additional things can be done at completion to -speed writing up. For example for an tag `nxhtml-mode' -can prompt for src attribute and add width and height attributes -if this attribute points to a local file. - -You can add additional elisp code for completing to -`nxhtml-complete-tag-do-also'." - :set (lambda (symbol value) - (set-default symbol value) - (nxhtml-turn-onoff-tag-do-also value)) - :group 'nxhtml) - -(defun nxhtml-can-insert-page-here () - (and (not nxhtml-validation-header-mode) - (= 1 (point)) - (or (= 0 (buffer-size)) - (save-restriction - (widen) - (save-match-data - (looking-at (rx buffer-start - (0+ space) - buffer-end))))))) - -(defun nxhtml-complete-first-try () - (when (nxhtml-can-insert-page-here) - (nxhtml-empty-page-completion))) - -(defun nxhtml-completing-read-tag (prompt - table - &optional predicate require-match - initial-input hist def inherit-input-method) - (popcmp-completing-read prompt - table - predicate require-match - initial-input hist def inherit-input-method - nxhtml-help-tag - nxhtml-tag-sets)) - -(defun nxhtml-add-required-to-attr-set (tag) - (let ((missing (when tag - (rngalt-get-missing-required-attr - (nxthml-is-single-tag tag))))) - (if (not missing) - nxhtml-attr-sets - (cons (cons "Required" missing) - nxhtml-attr-sets)))) - -(defun nxhtml-get-tag-specific-attr-help (tag) - (append (cdr (assoc tag nxhtml-help-attribute-name-tag)) nxhtml-help-attribute-name) - ) - -(defconst nxhtml-in-start-tag-regex -;;(defconst rng-in-start-tag-name-regex - (replace-regexp-in-string - "w" - xmltok-ncname-regexp - ;; Not entirely correct since < could be part of attribute value: - "<\\(w\\(?::w?\\)?\\)+ [^<]*" - t - t)) - -(defun nxhtml-completing-read-attribute-name (prompt - table - &optional predicate require-match - initial-input hist def inherit-input-method) - (let* ((tag (save-match-data - ;;(when (looking-back "<\\([a-z1-6]+\\) [^<]*") - (when (looking-back nxhtml-in-start-tag-regex) - (match-string 1)))) - (attr-sets (nxhtml-add-required-to-attr-set tag)) - (help-attr (nxhtml-get-tag-specific-attr-help tag)) - ) - (popcmp-completing-read prompt - table - predicate require-match - initial-input hist def inherit-input-method - help-attr - attr-sets))) - -(defun nxhtml-completing-read-attribute-value (prompt - table - &optional predicate require-match - initial-input hist def inherit-input-method) - (let (val) - (if table - (setq val (popcmp-completing-read prompt table - predicate require-match - initial-input hist def inherit-input-method)) - (let* (init - delimiter - (lt-pos (save-excursion (search-backward "<" nil t))) - (in-attr-val - (save-excursion - (re-search-backward rng-in-attribute-value-regex lt-pos t))) - (in-xml-attr-val - (unless in-attr-val - (save-excursion - (re-search-backward nxhtml-in-xml-attribute-value-regex lt-pos t)))) - ) - (when (or in-attr-val in-xml-attr-val) - ;;(save-match-data (save-excursion (re-search-forward "\\=[^<> \t\r\n\"]*" nil t))) - (let* ((name-start (match-beginning 1)) - (name-end (match-end 1)) - (colon (match-beginning 2)) - (attr (buffer-substring-no-properties name-start - (or colon name-end))) - (value-start (1+ (match-beginning 3))) - tag-start-end - (tag (save-excursion - (when (search-backward-regexp "<[[:alpha:]]+" nil t) - (setq tag-start-end (match-end 0)) - (match-string-no-properties 0))))) - (setq init (buffer-substring-no-properties value-start (point))) - (setq delimiter (char-before value-start)) - (if in-xml-attr-val - (error "in-xml-attr-val should not be true here!") - ;; (cond ((string= "encoding" attr) - ;; ;; Give a default that works in browsers today - ;; (setq val (nxhtml-coding-systems-complete - ;; init - ;; (symbol-name nxhtml-default-encoding)))) - ;; ((string= "version" attr) - ;; (setq val "1.0"))) - (cond ((string= "rel" attr) - (cond ((string= " - - - - Fictive XHTML Validation Header - - -" - ) - ("head-iso-8859-1" . - " - - - -" - ) - ("html-iso-8859-1" . - " - - -" - ) -;; ("doctype-iso-8859-1" . -;; " -;; -;; " -;; ) -;; ("xml-iso-8859-1" . -;; " -;; " -;; ) - - ("body-utf-8" . - " - - - - Fictive XHTML Validation Header - - -" - ) - ("head-utf-8" . - " - - - -" - ) - ("head-closed-utf-8" . - " - - - - - -" - ) - ("html-utf-8" . - " - - -" - ) -;; ("doctype-utf-8" . -;; " -;; -;; " -;; ) -;; ("xml-utf-8" . -;; " -;; " -;; ) - ) - "Fictive XHTML validation headers. -Used by `nxhtml-set-validation-header'." - :type '(alist :key-type string :value-type string) - :group 'nxhtml) - -(defcustom nxhtml-default-validation-header nil - "Default Fictive XHTML validation header. -Must be nil or one of the key values in -`nxhtml-validation-headers'." - :type 'string - :set (lambda (sym val) - (if (or (null val) - (assoc val nxhtml-validation-headers)) - (set-default sym val) - (lwarn 'nxhtml-default-validation-header - :warning "There is no Fictive XHTML Validation Header named %s" val))) - :group 'nxhtml) - -(defun nxhtml-must-have-validation-headers () - (unless nxhtml-validation-headers - (error - "No XHTML validation headers. Please customize nxhtml-validation-headers."))) - -(defvar nxhtml-set-validation-header-hist nil) - -(defvar nxhtml-current-validation-header nil) -(make-variable-buffer-local 'nxhtml-current-validation-header) -(put 'nxhtml-current-validation-header 'permanent-local t) - -(defcustom nxhtml-guess-validation-header-alist - ;;(rx line-start (0+ blank) "" . "head-closed-utf-8") - ("^[[:blank:]]* nh 1) - (completing-read "XHTML validation header: " - nxhtml-validation-headers - nil - t - default - nxhtml-set-validation-header-hist) - (if (not (y-or-n-p "Only one XHTML validation header is defined. Define more? ")) - default - (customize-option 'nxhtml-validation-headers) - 'adding))))) - ;;(lwarn 'svh2 :warning "key=%s" key) - (or key - (setq key (nxhtml-get-default-validation-header)) - (setq key (cons 'schema "XHTML"))) - (unless (eq key 'adding) - (setq nxhtml-current-validation-header key) - (nxhtml-validation-header-mode 1) - (nxhtml-apply-validation-header))) - -(defun nxhtml-apply-validation-header () - (when nxhtml-current-validation-header - (setq rngalt-major-mode - (if mumamo-multi-major-mode - (mumamo-main-major-mode) - major-mode)) - (let* ((key nxhtml-current-validation-header) - (rec (unless (listp key) - (assoc key nxhtml-validation-headers))) - (header (cdr rec))) - (if (listp key) - (let ((schema-file (rng-locate-schema-file (cdr key)))) - (unless schema-file - (error "Could not locate schema for type id `%s'" key)) ;type-id)) - (rng-set-schema-file-1 schema-file)) - (rngalt-set-validation-header header) - )))) - -(defun nxhtml-update-validation-header () - "Update the validation header in the buffer as needed." - (interactive) - (let ((mode-on nxhtml-validation-header-mode)) - (when mode-on (nxhtml-validation-header-mode 0)) - (setq nxhtml-current-validation-header nil) - (when mode-on (nxhtml-validation-header-mode 1)))) - -;;;###autoload -(define-minor-mode nxhtml-validation-header-mode - "If on use a Fictive XHTML Validation Header for the buffer. -See `nxhtml-set-validation-header' for information about Fictive XHTML Validation Headers. - -This mode may be turned on automatically in two ways: -- If you try to do completion of a XHTML tag or attribute then - `nxthml-mode' may ask you if you want to turn this mode on if - needed. -- You can also choose to have it turned on automatically whenever - mumamo is used, see `nxhtml-validation-header-if-mumamo' for - further information." - :global nil - :lighter " VH" - :group 'nxhtml - (if nxhtml-validation-header-mode - (progn - (unless nxhtml-current-validation-header - (setq nxhtml-current-validation-header - (nxhtml-get-default-validation-header))) - ;;(message "nxhtml-current-validation-header=%s" nxhtml-current-validation-header) - (if nxhtml-current-validation-header - (progn - (nxhtml-apply-validation-header) - (add-hook 'change-major-mode-hook 'nxhtml-vhm-change-major nil t) - (when (featurep 'mumamo) - (add-hook 'mumamo-change-major-mode-hook 'nxhtml-vhm-mumamo-change-major nil t) - (add-hook 'mumamo-after-change-major-mode-hook 'nxhtml-vhm-mumamo-after-change-major nil t))) - (run-with-idle-timer 0 nil 'nxhtml-validation-header-empty (current-buffer)))) - (rngalt-set-validation-header nil) - (setq nxhtml-current-validation-header nil) - (remove-hook 'after-change-major-mode-hook 'nxhtml-vhm-after-change-major t) - (when (featurep 'mumamo) - (remove-hook 'mumamo-change-major-mode-hook 'nxhtml-vhm-mumamo-change-major t) - (remove-hook 'mumamo-after-change-major-mode-hook 'nxhtml-vhm-mumamo-after-change-major t)))) - -(defun nxhtml-vhm-change-major () - "Turn off `nxhtml-validation-header-mode' after change major." - ;;(message "nxhtml-vhm-change-major here") - (unless mumamo-multi-major-mode - (setq nxhtml-current-validation-header nil)) - (run-with-idle-timer 0 nil 'nxhtml-validation-header-empty (current-buffer))) -(put 'nxhtml-vhm-change-mode 'permanent-local-hook t) - -(defun nxhtml-recheck-validation-header () - "Just turn off and on again `nxhtml-validation-header-mode'. -This will adjust the XHTML validation to the code currently in -the buffer." - (interactive) - (nxhtml-validation-header-mode -1) - (nxhtml-validation-header-mode 1)) - -(defun nxhtml-validation-header-empty (buffer) - "Turn off validation header mode. -This is called because there was no validation header." - (with-current-buffer buffer - (unless nxhtml-current-validation-header - ;;(message "nxhtml-validation-header-empty") - (nxhtml-validation-header-mode -1) - ;;(message "No validation header was needed") - ))) - -(defun nxhtml-turn-on-validation-header-mode () - "Turn on `nxhtml-validation-header-mode'." - (nxhtml-validation-header-mode 1)) - -;;(defvar nxhtml-browseable-buffer-name "*nXhtml Browsing Buffer*") -(defvar nxhtml-browseable-buffer-file "~/.temp-nxhtml-browse.htm") -;; Fix-me: Handle base href here! -(defun nxhtml-save-browseable-temp-file (start end &optional doit-anyway) - "Return a temporary file for viewing in web browser." - ;; When using this either region should be active or there should be - ;; a validation header or both. - (or doit-anyway - (and start end) ;mark-active - (and nxhtml-validation-header-mode - nxhtml-current-validation-header) - (error "Neither region nor validation header")) - (save-excursion - (let ((curbuf (current-buffer)) - (view-buffer (find-file-noselect nxhtml-browseable-buffer-file)) - header - content) - ;; Get header and content - (save-restriction - (widen) - (setq header - (if nxhtml-validation-header-mode - (let* ((key nxhtml-current-validation-header) - (rec (unless (listp key) - (assoc key nxhtml-validation-headers))) - (header (cdr rec))) - header) - (goto-char (point-min)) - (save-match-data - (let ((body (re-search-forward "]*>"))) - (if body - (buffer-substring-no-properties (point-min) (match-end 0)) - ""))))) - (setq content - (if start - (buffer-substring-no-properties start end) - (buffer-substring-no-properties (point-min) (point-max)))) - ) - ;; Switch to view buffer - (set-buffer view-buffer) -;; (unless buffer-file-name -;; (set-visited-file-name nxhtml-browseable-buffer-file) -;; (rename-buffer nxhtml-valhead-view-buffer-name)) - (erase-buffer) - (insert header content) - ;;(when (fboundp 'emacsw32-eol-set) (emacsw32-eol-set nil)) - (nxhtml-mode) - (save-buffer) - ;;(current-buffer) - (kill-buffer view-buffer) - (expand-file-name nxhtml-browseable-buffer-file) - ))) - - -(defun nxhtml-vhm-mumamo-change-major () - (put 'rngalt-validation-header 'permanent-local t) - (put 'nxhtml-validation-header-mode 'permanent-local t) - (put 'nxhtml-current-validation-header 'permanent-local t) - (put 'nxhtml-validation-header-mode-major-mode 'permanent-local t) - (setq nxhtml-validation-header-mode-major-mode mumamo-set-major-running) - ) - -(defun nxhtml-vhm-mumamo-after-change-major () - (put 'rngalt-validation-header 'permanent-local nil) - (put 'nxhtml-validation-header-mode 'permanent-local nil) - (put 'nxhtml-current-validation-header 'permanent-local nil) - (put 'nxhtml-validation-header-mode-major-mode 'permanent-local nil) - ) - -(defcustom nxhtml-validation-headers-check 'html - "Defines what check the function with the same name does. -The function returns true if the condition here is met." - :type '(choice :tag "Add Fictive XHTML Validation Header if:" - (const :tag "If buffer contains html" html) - (const :tag "If buffer contains html or is empty" html-empty)) - :group 'nxhtml) - -;; (defun nxhtml-validation-headers-check (buffer) -;; "Return non-nil if buffer contains a html tag or is empty. -;; This is for use with `nxhtml-validation-header-filenames'. - -;; The variable `nxhtml-validation-headers-check' determines how the -;; check is made." -;; (if (= 0 (buffer-size buffer)) -;; (eq 'html-empty nxhtml-validation-headers-check) -;; (save-match-data -;; (save-restriction -;; (let ((here (point)) -;; (html nil)) -;; (goto-char (point-min)) -;; (setq html (re-search-forward "" nil t)) -;; (goto-char here) -;; html))))) - -;; (defcustom nxhtml-validation-header-filenames -;; '( -;; ("\.php\\'" nxhtml-validation-headers-check) -;; ("\.rhtml\\'" nxhtml-validation-headers-check) -;; ("\.jsp\\'" nxhtml-validation-headers-check) -;; ) -;; "Alist for turning on `nxhtml-validation-mode'. -;; The entries in the list should have the form - -;; \(FILE-REGEXP CHECK-FUNCION) - -;; If buffer file name matches the regexp FILE-REGEXP and the -;; function CHECK-FUNCTION returns non-nil when called with the -;; buffer as an argument \(or CHECK-FUNCTION is nil) then -;; `nxhtml-global-validation-header-mode' will turn on -;; `nxhtml-validation-header-mode' in buffer. - -;; The function `nxhtml-validation-headers-check' may be a useful -;; value for CHECK-FUNCTION. - -;; See also `nxhtml-maybe-turn-on-validation-header'." -;; :type '(alist :key-type regexp :tag "File name regexp" -;; :value-type (group (choice (const :tag "No more check" nil) -;; (function :tag "Check buffer with")))) -;; :group 'nxhtml) - - - -;; (defun nxhtml-maybe-turn-on-validation-header () -;; "Maybe turn on `nxhtml-validation-header-mode' in buffer. -;; This is called by `nxhtml-global-validation-header-mode'. - -;; See `nxhtml-validation-header-filenames' for how the check -;; is made." -;; (or (and (or (and mumamo-mode -;; (eq (mumamo-main-major-mode) 'nxhtml-mode)) -;; (eq major-mode 'nxhtml-mode)) -;; rngalt-validation-header -;; nxhtml-current-validation-header -;; nxhtml-validation-header-mode -;; (progn -;; ;;(lwarn 'maybe :warning "quick, buffer=%s" (current-buffer)) -;; (nxhtml-validation-header-mode 1) -;; t)) -;; (when (buffer-file-name) -;; (unless (or ;;nxhtml-validation-header-mode -;; (minibufferp (current-buffer)) -;; (string= " " (substring (buffer-name) 0 1)) -;; (string= "*" (substring (buffer-name) 0 1)) -;; ) -;; (when (catch 'turn-on -;; (save-match-data -;; (dolist (rec nxhtml-validation-header-filenames) -;; (when (string-match (car rec) (buffer-file-name)) -;; (let ((fun (nth 1 rec))) -;; (if (not fun) -;; (progn -;; ;;(lwarn 't :warning "matched %s to %s, nil" (car rec) (buffer-file-name)) -;; (throw 'turn-on t)) -;; (when (funcall fun (current-buffer)) -;; ;;(lwarn 't :warning "matched %s to %s" (car rec) (buffer-file-name)) -;; (throw 'turn-on t)))))))) -;; ;;(lwarn 't :warning "turn on %s, buffer=%s" major-mode (current-buffer)) -;; (nxhtml-validation-header-mode 1)))))) - - -;; ;; Fix-me: Is this really the way to do it? Would it not be better to -;; ;; tie this to mumamo-mode in the turn on hook there? After all -;; ;; validation headers are probably not used unless mumamo-mode is on. -;; (define-globalized-minor-mode nxhtml-global-validation-header-mode -;; nxhtml-validation-header-mode -;; nxhtml-maybe-turn-on-validation-header -;; :group 'nxhtml) -;; ;; The problem with global minor modes: -;; (when (and nxhtml-global-validation-header-mode -;; (not (boundp 'define-global-minor-mode-bug))) -;; (nxhtml-global-validation-header-mode 1)) - - -(defcustom nxhtml-validation-header-mumamo-modes - '(nxhtml-mode) - "Main major modes for which to turn on validation header. -Turn on Fictive XHTML Validation Header if main major mode for the -used mumamo chunk family is any of those in this list. - -See `mumamo-set-chunk-family' for information about mumamo chunk -families." - :type '(repeat (function :tag "Main major mode in mumamo")) - :group 'nxhtml) - -(defun nxhtml-add-validation-header-if-mumamo () - "Maybe turn on validation header. -See `nxhtml-validation-header-if-mumamo' for more information." - ;;(nxhtml-validation-headers-check (current-buffer)) - (when (memq (mumamo-main-major-mode) nxhtml-validation-header-mumamo-modes) - (nxhtml-validation-header-mode 1))) - -(define-toggle nxhtml-validation-header-if-mumamo nil - "Add a fictive validation header when mumamo is used. -If this variable is t then add a Fictive XHTML Validation Header -\(see `nxhtml-validation-header-mode') in buffer when mumamo is -used. However do this only if `mumamo-main-major-mode' is one of -those in `nxhtml-validation-header-mumamo-modes'. - -Changing this variable through custom adds/removes the function -`nxhtml-add-validation-header-if-mumamo' to -`mumamo-turn-on-hook'." - :set '(lambda (sym val) - (set-default sym val) - (if val - (add-hook 'mumamo-turn-on-hook 'nxhtml-add-validation-header-if-mumamo) - (remove-hook 'mumamo-turn-on-hook 'nxhtml-add-validation-header-if-mumamo))) - :group 'nxhtml) - -(defun nxhtml-warnings-are-visible () - (get 'rng-error 'face)) - -(defvar nxhtml-old-rng-error-face nil) -(defun nxhtml-toggle-visible-warnings () - "Toggle the red underline on validation errors. -Those can be quite disturbing when using mumamo because there -will probably be many validation errors in for example a php -buffer, since unfortunately the validation routines in -`rng-validate-mode' from `nxml-mode' tries to validate the whole -buffer as XHTML. - -Also, because of a \(normally unimportant) bug in Emacs 22, -the red underline that marks an error will sometimes span several -lines instead of just marking a single character as it -should. \(This bug is a problem with overlays in Emacs 22.)" - (interactive) - (let ((face (get 'rng-error 'face))) - (if face - (progn - (setq nxhtml-old-rng-error-face (get 'rng-error 'face)) - (put 'rng-error 'face nil)) - (put 'rng-error 'face nxhtml-old-rng-error-face)))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Bug corrections -;; (defun nxml-indent-line () -;; "Indent current line as XML." -;; (let ((indent (nxml-compute-indent)) -;; (from-end (- (point-max) (point)))) -;; (when indent -;; (beginning-of-line) -;; (let ((bol (point))) -;; (skip-chars-forward " \t") -;; ;; There is a problem with some lines, try a quick fix: -;; (when (and (= 0 indent) -;; (not (eq (char-after) ?<))) -;; (save-excursion -;; (save-match-data -;; (when (re-search-backward "^<" nil t) -;; (when (search-forward " ") -;; (setq indent (current-column)))))) -;; (when (= 0 indent) -;; (setq indent nxml-child-indent))) -;; ;; And sometimes nxml-compute-indent get very upset, check for -;; ;; that: -;; (let ((here (point))) -;; (beginning-of-line 0) -;; (back-to-indentation) -;; (when (and (= indent (current-column)) -;; (eq (char-after) ?\")) -;; (setq indent 0)) -;; (goto-char here)) -;; (unless (= (current-column) indent) -;; (delete-region bol (point)) -;; (indent-to indent))) -;; (when (> (- (point-max) from-end) (point)) -;; (goto-char (- (point-max) from-end)))))) - - -;; FIX-ME: untag should be in nxml-mode.el since it is in no way -;; specific to nxhtml-mode, but I do not want to change nxml-mode.el -;; at the moment. - -(defcustom nxml-untag-select 'yes - "Decide whether to select an element untagged by `nxml-untag-element'. -If this variable is 'yes the element is selected after untagging -the element. The mark is set at the end of the element and point -at the beginning of the element. - -If this variable is 'no then the element is not selected and -point is not moved. If it is 'ask the user is asked what to do." - :type '(choice (const :tag "Yes" yes) - (const :tag "No" no) - (const :tag "Ask" ask)) - :group 'nxml) - -(defun nxml-untag-element (arg) - "Remove start and end tag from current element. -The mark is by default set to the end of the former element and -point is moved to the beginning. Mark is also activated so that -it is easy to surround the former element with a new tag. - -Whether to select the old element is controlled by -`nxml-untag-select'. The meaning of the values 'yes and 'no for -this variable is flipped by using a universal argument. - -Note: If you want to `undo' the untag and you use -`transient-mark-mode' then you must first do something so that -the region is not highlighted (for example C-g)." - (interactive "*P") - (let ((here (point-marker)) - el-start - el-start-end - el-end - el-end-end - (select t)) - (nxml-backward-up-element) - (setq el-start (point)) - (nxml-forward-balanced-item) - (setq el-start-end (point)) - (goto-char el-start) - (nxml-forward-element) - (setq el-end-end (point-marker)) - (nxml-backward-single-balanced-item) - (setq el-end (point)) - (delete-region el-end el-end-end) - (delete-region el-start el-start-end) - ;; Select the element or not? - (if (eq nxml-untag-select 'ask) - (setq select (y-or-n-p "Select the old element? ")) - (when (eq nxml-untag-select 'no) - (setq select nil)) - (when arg - (setq select (not select)))) - (if (not select) - (goto-char here) - (goto-char el-end-end) - (push-mark nil t t) - (setq mark-active t) - (setq deactivate-mark nil) - (goto-char el-start)))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Misc (defun nxhtml-update-mark-today (date-str) "Update marks for today's date. @@ -2882,213 +325,9 @@ The mark has this form (submatch (0+ anything)) "") nil t) - (replace-match date-str nil nil nil 1)) - (goto-char here))) - -(defun nxhtml-rollover-insert-2v () - "Insert CSS rollover images. -The upper half of the image will be used when mouse is out and -the lower half when mouse is over the image. - -Only CSS is used for the rollover. The CSS code is written to the -header part of the file if possible, otherwise it is copied to -the kill ring/clipboard. - -The CSS code is built from a template file and the image size. - -This might be used for example for creating a menu with -alternatives vertically or horizontally. - -Usage example: - - If you want to make a small button style menu with images you - can start like this: - -
-
+ (replace-match date-str nil nil nil 1)))) - Then put point at the X above (this is just a mark, should not - be in your code) and call this function. - It will add some CSS code to in the header of your file. You - may want to tweak this a little bit, see below (or place it - somewhere else). It may look like this: - - #mylinks a { - /* Image */ - display: block; - background: transparent url(\"img/mybutton.png\") 0 0 no-repeat; - overflow: hidden; - width: 200px; - /* Text placement and size, etc */ - text-align: center; - /* You may need to change top and bottom padding depending - on font size. */ - padding-top: 11px; - font-size: 12px; - padding-bottom: 9px; - text-decoration: none; - white-space: nowrap; - border: none; - } - #mylinks a:hover { - background-position: 0 -35px; - } - #mylinks li { - display: inline; - padding: 0; - margin: 0; - float: none; - } - -For an example of usage see the file nxhtml.html that comes with -nXhtml and can be opened from the nXhtml menu under - - nXhtml / nXhtml Help and Setup / nXhtml version nn Overview" - (interactive) -;; Fix-me: not quite ready yet, but should work OK." - (save-excursion - (let* ((tag (progn - (search-forward ">" nil t) - (unless (re-search-backward (rx "<" - (1+ (any "a-zA-Z:")) - (1+ (not (any ">"))) - " id=\"" - (submatch (+? anything)) - "\"") - nil t) - (error "Can't find tag with id backwards")) - (match-string-no-properties 0))) - (tagid (match-string-no-properties 1)) - (tagovl (let ((ovl (make-overlay - (match-beginning 0) (match-end 0)))) - (overlay-put ovl 'face 'highlight) - ovl)) - (head-end (save-excursion (search-backward "
\n" - css - "\n\n") - (select-window this-window)) - (kill-new css) - (message "No place to insert CSS, copied to clipboard instead")))) - (delete-overlay tagovl) - )))) - -;; Fix-me: image border 0 -;; Fix-me: SSI -;; Fix-me: Better a tag completion, target etc. -;; Fix-me: image map - is that possible now? -;; Fix-me: Special chars - completing on &? Or popup? Use nxml-insert-named-char -;; Fix-me: Quick table insert? A form? -;; Fix-me: Quick object insert? (applet is depreceated) -;; Fix-me: Better meta insert? Quick meta? -;; Fix-me: Quick div! Better div completion with position: static, -;; relative, absolute and fixed - with some explanations. -;; Fix-me: Quick hr? -;; Fix-me: Import CSS? Export CSS? -;; Fix-me: Use nxhtml-js.el? -;; Fix-me: Scroll bar colors etc? See 1stPage. -;; body { -;; scrollbar-arrow-color: #FF6699; -;; scrollbar-3dlight-color: #00FF33; -;; scrollbar-highlight-color: #66FFFF; -;; scrollbar-face-color: #6699FF; -;; scrollbar-shadow-color: #6633CC; -;; scrollbar-darkshadow-color: #660099; -;; scrollbar-track-color: #CC6633; -;; } -;; Fix-me: Built with nXhtml button! -;; Fix-me: More quick menus: http://www.cssplay.co.uk/menus/ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'nxhtml) - +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; nxhtml.el ends here diff --git a/elpa-to-submit/nxhtml/nxhtml/nxhtml-js.el b/elpa-to-submit/nxhtml/nxhtml/nxhtmljs.el similarity index 87% rename from elpa-to-submit/nxhtml/nxhtml/nxhtml-js.el rename to elpa-to-submit/nxhtml/nxhtml/nxhtmljs.el index 8eed104bcb..b7f3a67f9f 100644 --- a/elpa-to-submit/nxhtml/nxhtml/nxhtml-js.el +++ b/elpa-to-submit/nxhtml/nxhtml/nxhtmljs.el @@ -1,9 +1,9 @@ ;;; nxhtml-js.el --- Javascript support functions ;; ;; Author: Lennart Borgman (lennart O borgman A gmail O com) -;; Created: Sat Apr 28 01:51:17 2007 -;; Version: 0.0 -;; Lxast-Updated: +;; Created: Sat Apr 28 2007 +;; Version: 0.1 +;; Last-Updated: 2008-12-28 Sun ;; URL: ;; Keywords: ;; Compatibility: @@ -44,6 +44,9 @@ ;; ;;; Code: +(eval-when-compile (require 'nxhtml)) +(eval-when-compile (require 'nxhtml-mode)) + (defun nxhtml-add-link (type src silent) ;; (catch 'exit @@ -122,13 +125,23 @@ files that comes with nXhtml are linked to directly." (goto-char (point-min)) (when (search-forward nxhtml-smoothgallery-mark nil t) (back-to-indentation) - (when (looking-at (rx - "
"))) - ) - "\">" (eval nxhtml-smoothgallery-mark) - )) + (when (looking-at + ;; (rx + ;; "
"))) + ;; ) + ;; "\">" (eval nxhtml-smoothgallery-mark)) + ;;(concat "
]+\\)\">" nxhtml-smoothgallery-mark) + (rx-to-string + `(and + "
"))) + ) + "\">" + ,nxhtml-smoothgallery-mark)) + ) (cons (copy-marker (match-beginning 0)) (buffer-substring-no-properties @@ -143,11 +156,11 @@ files that comes with nXhtml are linked to directly." (search-forward jsmark nil t))) (defun nxhtml-smoothgallery-add (point-name) - (interactive (list - (let ((old-name (nxhtml-smoothgallery-find))) - (if old-name - old-name - "myGallery")))) + (interactive "i") + (unless point-name + (setq point-name (nxhtml-smoothgallery-find)) + (unless point-name + (setq point-name "myGallery"))) (let ((name (if (consp point-name) (cdr point-name) point-name)) @@ -195,7 +208,7 @@ files that comes with nXhtml are linked to directly." (unless thumbsrc (setq thumbsrc imgsrc)) (let ((gallery (nxhtml-smoothgallery-find))) (unless gallery - (setq gallery (nxhtml-smoothgallery-add))) + (setq gallery (nxhtml-smoothgallery-add nil))) (goto-char (car gallery)) (end-of-line) (insert-and-indent " diff --git a/elpa-to-submit/nxhtml/nxhtml/nxml-where.el b/elpa-to-submit/nxhtml/nxhtml/nxml-where.el index ba10c889fd..0625cb8a56 100644 --- a/elpa-to-submit/nxhtml/nxhtml/nxml-where.el +++ b/elpa-to-submit/nxhtml/nxhtml/nxml-where.el @@ -48,113 +48,108 @@ ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. +(eval-when-compile (require 'cl)) +(eval-when-compile (require 'mumamo)) (eval-when-compile - (require 'cl) (unless (featurep 'nxhtml-autostart) (let ((efn (expand-file-name "../autostart.el"))) (load efn)) (require 'nxml-mode))) -(defvar nxml-where-once-update-timer nil) -(make-variable-buffer-local 'nxml-where-once-update-timer) -(put 'nxml-where-once-update-timer 'permanent-local t) +(defun nxml-where-error-message (format-string &rest args) + (with-current-buffer (get-buffer-create "*Messages*") + (let ((start (1+ (point-max)))) + (apply 'message format-string args) + (goto-char (point-max)) + (backward-char) + ;; fix-me: got some error here: + ;;(put-text-property start (point) 'face 'highlight) + ))) + +(defvar nxml-where-last-point nil + "Where point was last time marking finished. +Ie we should not restart marking if point is still there and no +changes have occured.") +(make-variable-buffer-local 'nxml-where-last-point) +(put 'nxml-where-last-point 'permanent-local t) -(defun nxml-where-cancel-once () - (when (timerp nxml-where-once-update-timer) - (cancel-timer nxml-where-once-update-timer) - (setq nxml-where-once-update-timer nil))) +(defvar nxml-where-last-finished nil + "Non-nil then marking is finished.") +(make-variable-buffer-local 'nxml-where-last-finished) +(put 'nxml-where-last-finished 'permanent-local t) -(defun nxml-where-start-second-in-timer (next-point buffer) - ;;(message "start second") - (condition-case err - (setq nxml-where-once-update-timer - (run-with-idle-timer idle-update-delay - nil - 'nxml-where-do-marking-in-timer - next-point - buffer)) - (error - (nxml-where-error-message - "nxml-where-start-second error %s" err)))) +(defvar nxml-where-last-added nil) +(make-variable-buffer-local 'nxml-where-last-added) +(put 'nxml-where-last-added 'permanent-local t) -(defun nxml-where-update-buffers () - (when (boundp 'nxml-where-mode) - (dolist (buf (buffer-list)) - (when nxml-where-mode - (nxml-where-mode -1) - (nxml-where-mode 1))))) +(defvar nxml-where-path nil + "The current where path. +This is a list where the records have the form -(defun nxml-where-restart-update () - (condition-case err - (unless (and nxml-where-last-point - (= nxml-where-last-point (point))) - ;;(message "\n restart-update: this-command=%s, nxml-where-last-point=%s, point=%s" this-command nxml-where-last-point (point)) - (setq nxml-where-last-point nil) - (setq nxml-where-last-finished nil) - (nxml-where-cancel-once) - (setq nxml-where-once-update-timer - (run-with-idle-timer - (* 0.2 idle-update-delay) - nil - 'nxml-where-start-update-in-timer - (current-buffer)))) - (error - (nxml-where-error-message - "%s" (error-message-string err))))) -(put 'nxml-where-restart-update 'permanent-local-hook t) + \(START END TAG-STR OVERLAY)") +(make-variable-buffer-local 'nxml-where-path) +(put 'nxml-where-path 'permanent-local t) -(defun nxml-where-stop-updating () - (remove-hook 'post-command-hook 'nxml-where-restart-update t)) +(defvar nxml-where-new-path nil + "The new where path. +This is a list where the records have the form -(defun nxml-where-setup-updating () - (nxml-where-clear-path) - (setq nxml-where-last-added nil) - (setq nxml-where-last-point nil) - (when (and nxml-where-header - (not nxml-where-only-inner)) - (setq header-line-format "Started nxml-where-mode ...")) - ;;(nxml-where-restart-update) - (add-hook 'post-command-hook 'nxml-where-restart-update nil t)) + \(START END TAG-STR OVERLAY)") +(make-variable-buffer-local 'nxml-where-new-path) +(put 'nxml-where-new-path 'permanent-local t) + +(defvar nxml-where-once-update-timer nil) +(make-variable-buffer-local 'nxml-where-once-update-timer) +(put 'nxml-where-once-update-timer 'permanent-local t) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Custom options (defgroup nxml-where nil "Customization group for nxml-where." :group 'nxhtml :group 'nxml) -(define-toggle nxml-where-tag+id t - "Show tags + id in path if non-nil. -If nil show only tag names." +(define-toggle nxml-where-only-inner nil + "Mark only inner-most tag." :set (lambda (sym val) (set-default sym val) - (nxml-where-update-buffers)) + (when (fboundp 'nxml-where-update-buffers) + (nxml-where-update-buffers))) :group 'nxml-where) (define-toggle nxml-where-header t "Show header with XML-path if non-nil." :set (lambda (sym val) (set-default sym val) - (nxml-where-update-buffers)) + (when (fboundp 'nxml-where-update-buffers) + (nxml-where-update-buffers))) :group 'nxml-where) -(define-toggle nxml-where-marks t - "Show marks in buffer for XML-path if non-nil." +(define-toggle nxml-where-tag+id t + "Show tags + id in path if non-nil. +If nil show only tag names." :set (lambda (sym val) (set-default sym val) - (nxml-where-update-buffers)) + (when (fboundp 'nxml-where-update-buffers) + (nxml-where-update-buffers))) :group 'nxml-where) -(define-toggle nxml-where-only-inner nil - "Mark only inner-most tag." +(define-toggle nxml-where-marks t + "Show marks in buffer for XML-path if non-nil." :set (lambda (sym val) (set-default sym val) - (nxml-where-update-buffers)) + (when (fboundp 'nxml-where-update-buffers) + (nxml-where-update-buffers))) :group 'nxml-where) (define-toggle nxml-where-only-tags-with-id t "Show only tags with id in the header line." :set (lambda (sym val) (set-default sym val) - (nxml-where-update-buffers)) + (when (fboundp 'nxml-where-update-buffers) + (nxml-where-update-buffers))) :group 'nxml-where) (defface nxml-where-marking @@ -167,7 +162,8 @@ If nil show only tag names." :type 'face :set (lambda (sym val) (set-default sym val) - (nxml-where-update-buffers)) + (when (fboundp 'nxml-where-update-buffers) + (nxml-where-update-buffers))) :group 'nxml-where) (defcustom nxml-where-header-attributes '("id" "name") @@ -175,7 +171,8 @@ If nil show only tag names." :type '(repeat string) :set (lambda (sym val) (set-default sym val) - (nxml-where-update-buffers)) + (when (fboundp 'nxml-where-update-buffers) + (nxml-where-update-buffers))) :group 'nxml-where) (defcustom nxml-where-widen t @@ -184,16 +181,11 @@ If nil show only tag names." :group 'nxml-where) -(defvar nxml-where-saved-header-line-format nil) -(make-variable-buffer-local 'nxml-where-saved-header-line-format) -(put 'nxml-where-saved-header-line-format 'permanent-local t) -(defun nxml-where-save-header-line-format () - (unless nxml-where-saved-header-line-format - (setq nxml-where-saved-header-line-format header-line-format))) -(defun nxml-where-restore-header-line-format () - (setq header-line-format nxml-where-saved-header-line-format)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Modes (defvar nxml-where-modes '(nxml-mode nxhtml-mode)) @@ -204,21 +196,33 @@ If nil show only tag names." (let ((major-mode (mumamo-main-major-mode))) (derived-mode-p 'nxml-mode))))) +(defun nxml-where-setup-updating () + (nxml-where-clear-old-path 0 "setup") + (setq nxml-where-last-added nil) + (setq nxml-where-last-point nil) + (when (and nxml-where-header + (not nxml-where-only-inner)) + (setq header-line-format "Started nxml-where-mode ...")) + ;;(nxml-where-restart-update) + (add-hook 'post-command-hook 'nxml-where-restart-update nil t)) + (defun nxml-where-mode-start () ;;(message "START") (unless (nxml-where-is-nxml) (error "Can't display XML path since major mode is not nxml-mode child.")) - (add-hook 'after-change-major-mode-hook - 'nxml-where-turn-off-unless-nxml nil t) + (add-hook 'after-change-major-mode-hook 'nxml-where-turn-off-unless-nxml nil t) + (add-hook 'after-change-functions 'nxml-where-after-change nil t) (nxml-where-save-header-line-format) (nxml-where-setup-updating)) (defun nxml-where-mode-stop () ;;(message "STOP") + (remove-hook 'after-change-major-mode-hook 'nxml-where-turn-off-unless-nxml t) + (remove-hook 'after-change-functions 'nxml-where-after-change t) (nxml-where-stop-updating) (nxml-where-unmark-forward-element) (nxml-where-restore-header-line-format) - (nxml-where-clear-path)) + (nxml-where-clear-old-path 0 "stop")) (defun nxml-where-turn-off-unless-nxml () (unless (nxml-where-is-nxml) @@ -242,8 +246,12 @@ If nil show only tag names." "Turn on `nxml-where-mode' if possible. This is possible if `major-mode' in the buffer is derived from `nxml-mode'." - (when (derived-mode-p 'nxml-mode) - (nxml-where-mode 1))) + (when (or (derived-mode-p 'nxml-mode) + (and mumamo-multi-major-mode + (let ((major-mode (mumamo-main-major-mode))) + (derived-mode-p 'nxml-mode)))) + (unless nxml-where-mode + (nxml-where-mode 1)))) ;;;###autoload (define-globalized-minor-mode nxml-where-global-mode nxml-where-mode @@ -254,34 +262,130 @@ This is possible if `major-mode' in the buffer is derived from (not (boundp 'define-global-minor-mode-bug))) (nxml-where-global-mode 1)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Auto updating + +(defvar nxhtml-where-hook nil + "Normal hook run when marking has changed.") + (defun nxml-where-start-update-in-timer (buffer) + "First checks post command." ;;(message "nxml-where-start-update buffer=%s (bufferp buffer)=%s" buffer (bufferp buffer)) + (when (and (bufferp buffer) + (buffer-live-p buffer)) + (with-current-buffer buffer + (let ((here (point))) + (save-match-data + (condition-case err + (progn + ;;(unless nxml-where-marks (nxml-where-clear-old-path)) + (unless (and nxml-where-header + (not nxml-where-only-inner)) + (setq header-line-format nil)) + (when (and nxml-where-mode + (or nxml-where-header nxml-where-marks)) + (nxml-where-do-marking nil buffer))) + (error + (nxml-where-error-message + "nxml-where-start-update-in-timer error: %s" err))) + (goto-char here)))))) + +(defun nxml-where-continue-marking-in-timer (this-point buffer) + "Continue unfinished marking after last restart. +Ie we have run at least once post command." + ;;(message "continue-marking-in-timer %s %s" this-point buffer) + (with-current-buffer buffer + (let ((here (point))) + (condition-case err + (save-match-data ;; runs in timer + (nxml-where-do-marking this-point buffer)) + (error + (nxml-where-error-message + "nxml-where-do-marking error: %s" + err))) + (goto-char here)))) + +(defun nxml-where-start-continue-in-timer (next-point buffer) + ;;(message "start second") + (condition-case err + (setq nxml-where-once-update-timer + (run-with-idle-timer idle-update-delay + nil + 'nxml-where-continue-marking-in-timer + next-point + buffer)) + (error + (nxml-where-error-message + "nxml-where-start-second error %s" err)))) + +(defun nxml-where-restart-update () + "Restart update, runs in `post-command-hook'." + ;;(message "restart-update") (condition-case err - (when (and (bufferp buffer) - (buffer-live-p buffer)) - (with-current-buffer buffer - (unless nxml-where-marks (nxml-where-clear-path)) - (unless nxml-where-header (setq header-line-format nil)) - (when (and nxml-where-mode - (or nxml-where-header nxml-where-marks)) - (nxml-where-do-marking nil buffer)))) + (save-match-data ;; runs in timer + (unless (and nxml-where-last-point + (= nxml-where-last-point (point))) + (setq nxml-where-last-point nil) + (setq nxml-where-last-finished nil) + (nxml-where-cancel-once) + (setq nxml-where-once-update-timer + (run-with-idle-timer + (* 0.2 idle-update-delay) + nil + 'nxml-where-start-update-in-timer + (current-buffer))))) (error (nxml-where-error-message - "nxml-where-start-update-in-timer error: %s" err)))) + "%s" (error-message-string err))))) +(put 'nxml-where-restart-update 'permanent-local-hook t) -(defvar nxml-where-get-id-pattern - (rx space - (eval (cons 'or nxml-where-header-attributes)) - (0+ space) - ?= - (0+ space) - ?\" - (0+ (not (any ?\"))) - ?\" - )) +(defvar nxml-where-first-change-pos nil) +(make-variable-buffer-local 'nxml-where-first-change-pos) +(put 'nxml-where-first-change-pos 'permanent-local t) + +(defun nxml-where-after-change (beg end len) + (setq nxml-where-last-point nil) + (setq nxml-where-first-change-pos + (min beg + (or nxml-where-first-change-pos + beg)))) + +(defun nxml-where-cancel-once () + (when (timerp nxml-where-once-update-timer) + (cancel-timer nxml-where-once-update-timer) + (setq nxml-where-once-update-timer nil))) + +(defun nxml-where-update-buffers () + (when (boundp 'nxml-where-mode) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when nxml-where-mode + (nxml-where-mode -1) + (nxml-where-mode 1)))))) + +(defun nxml-where-stop-updating () + (remove-hook 'post-command-hook 'nxml-where-restart-update t)) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Marking + +(defconst nxml-where-get-id-pattern + (rx-to-string + `(and + space + ,(cons 'or nxml-where-header-attributes) + (0+ space) + ?= + (0+ space) + ?\" + (0+ (not (any ?\"))) + ?\") + t)) (defvar nxml-where-tag+id-pattern - ;;(insert ;; ------------------- (rx ?< (submatch (1+ (char "-a-z0-9:")) @@ -297,46 +401,35 @@ This is possible if `major-mode' in the buffer is derived from ) (0+ space) (opt ?/) - ?>) - ;;) ;; ------------------- - ) + ?>)) -;; (defun nxml-where-mark (start end) -;; (let (ovl -;; (ovls (overlays-at start))) -;; (dolist (o ovls) -;; (when (and (eq (overlay-get o 'face) nxml-where-marking) -;; (= start (overlay-start o)) -;; (= end (overlay-end o))) -;; (setq ovl o))) -;; (unless ovl -;; (setq ovl (make-overlay start end)) -;; (overlay-put ovl 'face nxml-where-marking) -;; (move-overlay ovl start end)) -;; ovl)) (defvar nxml-where-forward-element nil) (make-variable-buffer-local 'nxml-where-forward-element) (put 'nxml-where-forward-element 'permanent-local t) (defun nxml-where-unmark-forward-element () - ;;(message "unmark-for %s" nxml-where-forward-element) + "Unmark currently marked end tag." (when nxml-where-forward-element - (let ((ovl (nth 1 nxml-where-forward-element))) - (when (overlayp ovl) (delete-overlay ovl))) + (let* ((ovl (nth 1 nxml-where-forward-element)) + (str (when ovl (buffer-substring-no-properties (overlay-start ovl) (overlay-end ovl))))) + (when (overlayp ovl) + ;;(message "unmark-forward-element:delete-overlay %s %s" str ovl) + (delete-overlay ovl))) (setq nxml-where-forward-element nil))) (defun nxml-where-mark-forward-element (start-tag) - ;;(message "point 0 = %s, start-tag=%s fe=%s" (point) start-tag nxml-where-forward-element) - ;;(message " path=%s" nxml-where-path) - (unless (and nxml-where-forward-element + "Mark the end tag matching START-TAG." + ;;(message "nxml-where-forward-element=%s" nxml-where-forward-element) + (unless (and start-tag + nxml-where-forward-element (nth 1 nxml-where-forward-element) (= (nth 0 nxml-where-forward-element) start-tag)) - ;;(message "h3re") + ;;(message "before unmark") (nxml-where-unmark-forward-element) - (save-restriction - ;;(message "point 1 = %s" (point)) + ;;(message "after unmark") + (when start-tag (let ((here (point)) (end-of-narrow (progn @@ -348,300 +441,224 @@ This is possible if `major-mode' in the buffer is derived from end-of-narrow)) (setq end-of-narrow (min (point-max) end-of-narrow)) - (narrow-to-region here end-of-narrow) - (condition-case err - (progn - ;;(message "point X forw= %s" (point)) - (nxml-forward-element) - (when (looking-back "") - (setq start (match-beginning 0)) - (setq end (point)) - (setq ovl (make-overlay start end)) - (overlay-put ovl 'face nxml-where-marking))) - (error - (let ((msg (error-message-string err))) - (unless (string= msg "Start-tag has no end-tag") - (message "nxml-where-mark-forw: %s" str))))) - (widen) + (save-restriction + (narrow-to-region start-tag end-of-narrow) + (condition-case err + (progn + (goto-char start-tag) + (nxml-forward-element) + (when (looking-back "") + (setq start (match-beginning 0)) + (setq end (point)) + (setq ovl (make-overlay start end)) + (overlay-put ovl 'nxml-where t) + (overlay-put ovl 'face nxml-where-marking))) + (error + (let ((msg (error-message-string err))) + (unless (string= msg "Start-tag has no end-tag") + (message "nxml-where-mark-forw: %s" msg)))))) (goto-char here) ;;(message "point 2 = %s" (point)) (setq nxml-where-forward-element (list start-tag ovl)))))) -(defvar nxml-where-path nil) -(make-variable-buffer-local 'nxml-where-path) -(put 'nxml-where-path 'permanent-local t) (defun nxml-where-make-rec (tag-start tag-end tag-str buf) ;;(message "nxml-where-make-rec %s %s %s %s" tag-start tag-end tag-str buf) - (let ((ovls (overlays-at tag-start))) + (let ((ovls (overlays-at tag-start)) + str) (dolist (ovl ovls) - (when (equal (overlay-get ovl 'face) nxml-where-marking) - (nxml-where-error-message "old ovl=%s" ovl)))) + (when (overlay-get ovl 'nxml-where) + (setq str (buffer-substring-no-properties (overlay-start ovl) (overlay-end ovl))) + (message "==================================================") + (nxml-where-error-message "old ovl=%s %S" ovl str) + (message "old: nxml-where-path=%s" nxml-where-path) + (message "old: nxml-where-new-path=%s" nxml-where-new-path) + ))) (let ((ovl (when buf (make-overlay tag-start tag-end)))) - (when ovl (overlay-put ovl 'face nxml-where-marking)) + (when ovl + (overlay-put ovl 'nxml-where t) + (overlay-put ovl 'face nxml-where-marking)) (list tag-start tag-end tag-str ovl))) -(defun nxml-where-delete-rec (rec) - ;;(message "delete-overlay rec=%s" rec) - (let ((ovl (nth 3 rec))) - (when ovl +(defun nxml-where-delete-rec (rec from) + (let* ((ovl (nth 3 rec)) + (str (when ovl + (buffer-substring-no-properties (overlay-start ovl) (overlay-end ovl))))) + (when (and ovl (overlay-buffer ovl)) (assert (overlayp ovl) t) - ;;(message "delete-overlay %s" ovl) - (delete-overlay ovl)))) - -(defvar nxml-where-last-point nil) -(make-variable-buffer-local 'nxml-where-last-point) -(put 'nxml-where-last-point 'permanent-local t) + ;;(message "delete-rec:delete-overlay %s %s (%s)" str ovl from) + (delete-overlay ovl) + ;;(message "after delete=%s" ovl) + ))) -(defvar nxml-where-last-finished nil) -(make-variable-buffer-local 'nxml-where-last-finished) -(put 'nxml-where-last-finished 'permanent-local t) - -(defvar nxml-where-last-added nil) -(make-variable-buffer-local 'nxml-where-last-added) -(put 'nxml-where-last-added 'permanent-local t) -(defun nxml-where-clear-path () +(defun nxml-where-clear-old-path (end-of-interest from) + "Clear all marking below END-OF-INTEREST. +Update `nxml-where-path accordingly." (setq nxml-where-last-added nil) - (nxml-where-update-where-path -1 nil nil nil)) - -(defun nxml-where-update-where-path (tag-start tag-end tag-str buffer) - ;;(message "nxml-where-last-added=%s" nxml-where-last-added) - ;; - ;; Fix-me: Deletion is not handled correctly when moving quickly. - (when nxml-where-only-inner - (setq nxml-where-path - (mapcar (lambda (rec) - (if (and (= tag-start (nth 0 rec)) - (= tag-end (nth 0 rec)) - (string= tag-str (nth 2 rec))) - rec - (nxml-where-delete-rec rec) - nil)) - nxml-where-path)) - (setq nxml-where-path (delq nil nxml-where-path))) - (unless nxml-where-last-added - ;; Trim off everything below tag-start. - (let ((ptr nxml-where-path) - prev-ptr - old-rec - tail) - (while (and ptr - (<= (nth 0 (car ptr)) (1+ tag-start))) - (setq prev-ptr ptr) - (setq ptr (cdr ptr))) - ;;(message "trimming tag-start=%s, tag-end=%s, tail ptr at=%s, nxml-where-last-added=%s" tag-start tag-end (caar ptr) nxml-where-last-added) - (when ptr - ;;(setq tail (cdr ptr)) - (setq tail ptr) - (if prev-ptr - (setcdr prev-ptr nil) - (setq nxml-where-path nil))) - ;; Clean up tail - ;;(message "tail=%s" tail) - (dolist (rec tail) - (nxml-where-delete-rec rec)))) - ;; If tag-end is nil we are just clearing - (when tag-end - (let (result) - ;; Check we are sane - (if (or (not nxml-where-last-added) - (< tag-start (nth 0 nxml-where-last-added))) - (setq nxml-where-last-added t) - ;;(message "nxml-where internal error: tag-start below last added, %s < %s" tag-start nxml-where-last-added) - (setq nxml-where-last-added nil)) - (when nxml-where-last-added - ;; Find out where to insert - (let ((ptr nxml-where-path) - prev-ptr - old-rec - new-rec) - ;;(message "before while ptr=%s" ptr) - (while (and ptr (< (nth 0 (car ptr)) tag-start)) - (setq prev-ptr ptr) - (setq ptr (cdr ptr)) - ) - ;; Is this now the same as the old value? - ;;(message "Same? ptr=%s" ptr) - (if (and ptr - (= tag-start (nth 0 (car ptr))) - (= tag-end (nth 1 (car ptr)))) - (progn - ;;(message "vvvvvvvvvvvvvvvvv") - ;;(message "ready tag-start=%s-%s tag-str=%s nxml-where-last-added=%s" tag-start tag-end tag-str nxml-where-last-added) - (when (eq nxml-where-last-added t) - (setq nxml-where-last-added (car (last nxml-where-path)))) - ;; Clean up between here and last added. Unfortunately - ;; we can't catch everything here. We need to walk up - ;; the list to check, but that takes some time so do - ;; not do that here. - ;; - ;; Fix-me: implement the walk up above. - - ;;(message "trimming 2 tag-start=%s, tag-end=%s, ptr at=%s, nxml-where-last-added=%s" tag-start tag-end (caar ptr) nxml-where-last-added) - ;;(message "ptr 1=%s" ptr) - (while (and ptr ;; Not needed, but just in case to prevent looping ... - (cdr ptr) - (not (eq nxml-where-last-added (cadr ptr)))) - ;; Delete entry after ptr. - ;;(message "ptr=%s" ptr) - (setq old-rec (cadr ptr)) - (nxml-where-delete-rec old-rec) - (setcdr ptr (cddr ptr)) - ) - (setq nxml-where-last-finished t) - (setq result 'ready)) - (setq new-rec (nxml-where-make-rec tag-start tag-end tag-str buffer)) - (setq nxml-where-last-added new-rec) - (if (not prev-ptr) - (setq nxml-where-path (cons new-rec nxml-where-path)) - (setcdr prev-ptr (cons new-rec (cdr prev-ptr)))) - (setq result 'continue)))) - ;;(message "Mark forward path=%s" nxml-where-path) - (nxml-where-mark-forward-element (caar (last nxml-where-path))) - result))) - -;;(nxhtmltest-nxml-where-adding) -;;(global-set-key [f9] 'nxhtmltest-nxml-where-adding) -(defun nxhtmltest-nxml-where-add1 (rec) - (let* ((tag-start (nth 0 rec)) - (tag-end (nth 1 rec)) - (tag-str (nth 2 rec)) - (res - (nxml-where-update-where-path tag-start tag-end tag-str nil))) - (message "*** (%s %s %s) => %s, last=%s" tag-start tag-end tag-str res nxml-where-last-added) - (message "nxml-where-path=%s" nxml-where-path) - )) - -(defun nxhtmltest-nxml-where-adding () - (interactive) - (let ((nxml-where-path nil) - (nxml-where-last-added nil) - rec) - (message "=====================") - (assert (equal nxml-where-path nil) t) - (nxhtmltest-nxml-where-add1 (setq rec '(50 55 "" nil))) - (assert (equal nxml-where-path `(,rec)) t) - (nxhtmltest-nxml-where-add1 (setq rec '(30 35 "" nil))) - (assert (equal nxml-where-path `(,rec - (50 55 "" nil))) t) - (message "------ A") (setq nxml-where-last-added nil) - (nxhtmltest-nxml-where-add1 (setq rec '(50 55 "" nil))) - (assert (equal nxml-where-path `((30 35 "" nil) - (50 55 "" nil))) t) - (message "------ B") (setq nxml-where-last-added nil) - (nxhtmltest-nxml-where-add1 (setq rec '(50 55 ""))) - (assert (equal nxml-where-path `((30 35 "" nil) - (50 55 "" nil))) t) - (nxhtmltest-nxml-where-add1 (setq rec '(30 35 "" nil))) - (assert (equal nxml-where-path `((30 35 "" nil) - (50 55 "" nil))) t) - (message "------ C") (setq nxml-where-last-added nil) - (nxhtmltest-nxml-where-add1 (setq rec '(40 45 "" nil))) - (assert (equal nxml-where-path `((30 35 "" nil) - ,rec)) t) - (nxhtmltest-nxml-where-add1 (setq rec '(50 55 "" nil))) - (assert (eq nxml-where-last-added nil) t) - (message "---- Clear") - (nxml-where-clear-path) - (assert (eq nxml-where-path nil) t) - )) + ;;(message "++++++ clear A: %s (%s)" end-of-interest from) + (setq nxml-where-path (cons 'dummy nxml-where-path)) + (let ((path nxml-where-path)) + ;;(message "path 1=%s" path) + (while (cdr path) + ;;(message "path 2=%s" path) + (when (> (nth 1 (cadr path)) end-of-interest) + (dolist (p (cdr path)) + (nxml-where-delete-rec p "clear")) + (setcdr path nil)) + (setq path (cdr path)))) + (setq nxml-where-path (cdr nxml-where-path))) + +(defun nxml-where-clear-new-path () + (dolist (new nxml-where-new-path) + (nxml-where-delete-rec new "clear new")) + (setq nxml-where-new-path nil) + ;;(message "clear B:nxml-where-path=%s" nxml-where-path) + ) -(defun nxml-where-do-marking-in-timer (this-point buffer) - (condition-case err - (nxml-where-do-marking this-point buffer) - (error - (nxml-where-error-message - "nxml-where-do-marking error: %s" - err)))) -;; (nxml-where-error-message "%s" "something") -(defun nxml-where-error-message (format-string &rest args) - (with-current-buffer (get-buffer-create "*Messages*") - (let ((start (1+ (point-max)))) - (apply 'message format-string args) - (goto-char (point-max)) - (backward-char) - (put-text-property start (point) - 'face 'highlight)))) +(defun nxml-where-update-where-path (tag-start tag-end tag-str buffer) + "Update where path with given tag. +The tag is between TAG-START and TAG-END and the string to +display for it in the header-line is TAG-STR. This is in buffer +BUFFER." + ;; Delete old marks below tag-start: + (nxml-where-clear-old-path (+ tag-end 0) (format "update-where-path, tag-start=%s" tag-start)) + ;; Is this now the same as the old value? + (let ((last-old (last nxml-where-path)) + new-rec + result) + ;;(message "update: %s %s %s %s, last-old=%s" tag-start tag-end tag-str buffer last-old) + (if (and last-old + (= tag-start (nth 0 (car last-old))) + (= tag-end (nth 1 (car last-old)))) + (progn + (setq result 'ready)) + (when nxml-where-only-inner + ;;(message "last-old=%S, nwp=%S, nwnp=%S" last-old nxml-where-path nxml-where-new-path) + (setq last-old (car (last nxml-where-path))) + (when last-old + (setq nxml-where-path nil) + (nxml-where-delete-rec last-old "only-inner"))) + (setq new-rec (nxml-where-make-rec tag-start tag-end tag-str buffer)) + (setq nxml-where-last-added new-rec) + (setq nxml-where-new-path (cons new-rec nxml-where-new-path)) + (setq result 'continue)) + result)) (defun nxml-where-do-marking (this-point buffer) - ;;(message "nxml-where-do-marking %s %s, point=%s" this-point buffer (point)) - (with-current-buffer buffer - (save-restriction - (when nxml-where-widen (widen)) - (let (ovl - (here (point)) - next-point - (is-first (not this-point)) - same-as-last) - ;; If on beginning of tag step forward one char. - (unless (or (eobp) - this-point - (not (eq ?< (char-after)))) - (forward-char)) - (unless this-point (setq nxml-where-last-added nil)) - (unless this-point (setq this-point (point))) - (goto-char this-point) - (setq next-point - (catch 'cnext-point - ;; Are we ready? - (condition-case err - (nxml-backward-up-element) - (error - (if (equal err '(error "No parent element")) - (throw 'cnext-point nil) - (nxml-where-error-message "nxml-where error: %S" err) - (throw 'cnext-point "uh?")))) - ;; Is this the first call - (when is-first - ;;(message "is-first=%s, (last nxml-where-path=%s" is-first (last nxml-where-path)) - (setq same-as-last - (and nxml-where-path - nxml-where-last-finished - (= (point) (caar (last nxml-where-path))))) - (when same-as-last - (throw 'cnext-point 'same-as-last))) - (save-match-data - (when (looking-at nxml-where-tag+id-pattern) - (let ((start (point)) - (end (match-end 0)) - (tag (match-string-no-properties 1)) - (all (match-string-no-properties 0)) - result) - (when nxml-where-tag+id - (when (string-match nxml-where-get-id-pattern all) - (setq tag (concat tag (match-string 0 all))))) - (setq tag (concat "<" tag ">")) - (setq result (nxml-where-update-where-path start end tag t)) - (when (or (eq result 'ready) - nxml-where-only-inner) - (throw 'cnext-point nil)) - ;;(message "here 2") - ))) - (throw 'cnext-point (max (1- (point)) (point-min))))) - ;) - (goto-char here) - ;;(message "next-point=%s" next-point) - (if next-point - (cond - ((stringp next-point) (message "%s" next-point) ;; Some error - (when nxml-where-header (setq header-line-format next-point))) - ((eq 'same-as-last next-point) - nil) - (t - (unless nxml-where-only-inner - (setq nxml-where-once-update-timer - (run-with-timer (* 0.2 idle-update-delay) - nil - 'nxml-where-start-second-in-timer - next-point (current-buffer)))))) - (setq nxml-where-last-point (point)) - (when (and nxml-where-header - (not nxml-where-only-inner)) - (nxml-where-write-header))))))) - -(defun nxml-where-write-header () + "Do marking. +If THIS-POINT is nil then it is the first marking post command in +buffer BUFFER. In that case start from current point, otherwise +from THIS-POINT. + +Go up to previous tag. Then check if this is the same tag where +we started last time and ran to completion. If so just finish. + +Otherwise check this tag. If not ready after that then restart +this command with arg THIS-POINT set to right before this tag." + ;;(message "****************nxml-where-do-marking %s %s, point=%s" this-point buffer (point)) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (save-restriction + (when nxml-where-widen (widen)) + (let ((here (point)) + next-point + (is-first (not this-point)) + (end-of-interest (if nxml-where-first-change-pos + (min (point) nxml-where-first-change-pos) + ;; Check for tag at point + (catch 'eoi + (let (ovl) + (dolist (ovl (overlays-at (point))) + (when (overlay-get ovl 'nxml-where) + (throw 'eoi (overlay-end ovl))))) + (point))))) + ;; If on beginning of tag step forward one char. + (unless (or (eobp) + this-point + (not (eq ?< (char-after)))) + (forward-char)) + (when this-point (goto-char this-point)) + (setq next-point + (catch 'cnext-point + (progn + (condition-case err + (nxml-backward-up-element) + (error + (if (equal err '(error "No parent element")) + (let (rec) + ;;(message "------------ No parent element") + (dolist (rec nxml-where-path) + (nxml-where-delete-rec rec "no parent")) + (setq nxml-where-path nil) + (throw 'cnext-point nil)) ;; <---- remember... + (nxml-where-error-message "nxml-where error: %S" err) + (throw 'cnext-point "uh?")))) + ;; Is this the first call + ;;(message ";; Is this the first call, %s" is-first) + (when is-first + (when (and nxml-where-path + nxml-where-last-finished + (= (point) (caar (last nxml-where-path)))) + (throw 'cnext-point 'same-as-last)) + ;;(setq nxml-where-new-path nil) + (setq nxml-where-last-added nil) + ;; Delete those parts we can't trust or don't + ;; need any more. Fix-me, Note: this is different + ;; dependent on if some buffer changes occured. + (nxml-where-clear-old-path end-of-interest (format "is-first,p=%s" (point))) + (nxml-where-clear-new-path)) + ;;(message "looking-at") + (when (looking-at nxml-where-tag+id-pattern) + (let ((start (point)) + (end (match-end 0)) + (tag (match-string-no-properties 1)) + (all (match-string-no-properties 0))) + (when nxml-where-tag+id + (when (string-match nxml-where-get-id-pattern all) + (setq tag (concat tag (match-string 0 all))))) + (setq tag (concat "<" tag ">")) + (when (or (eq 'ready + (nxml-where-update-where-path start end tag t)) + nxml-where-only-inner) + ;;(message "throw 'cp nil") + (throw 'cnext-point nil)))) + (throw 'cnext-point (max (1- (point)) (point-min)))))) + (goto-char here) + (if next-point + (cond + ((stringp next-point) (message "%s" next-point) ;; Some error + (when nxml-where-header (setq header-line-format next-point))) + ((eq 'same-as-last next-point) + nil) + (t + (unless nxml-where-only-inner + (setq nxml-where-once-update-timer + (run-with-timer (* 0.2 idle-update-delay) + nil + 'nxml-where-start-continue-in-timer + next-point (current-buffer)))))) + (if nxml-where-path + (setcdr (last nxml-where-path) nxml-where-new-path) + (setq nxml-where-path nxml-where-new-path)) + (setq nxml-where-new-path nil) + ;;(message "nxml-where-path=%s" nxml-where-path) + (nxml-where-mark-forward-element (caar (last nxml-where-path))) + (setq nxml-where-last-finished t) + (setq nxml-where-first-change-pos nil) + (run-hooks 'nxhtml-where-hook) + (setq nxml-where-last-point (point)) + (when (and nxml-where-header + (not nxml-where-only-inner)) + (nxml-where-insert-header)))))))) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Header path + +(defun nxml-where-insert-header () (let ((path (mapcar (lambda (elt) (nth 2 elt)) nxml-where-path))) @@ -672,6 +689,18 @@ This is possible if `major-mode' in the buffer is derived from (when nxml-where-header (setq header-line-format header))))) +(defvar nxml-where-saved-header-line-format nil) +(make-variable-buffer-local 'nxml-where-saved-header-line-format) +(put 'nxml-where-saved-header-line-format 'permanent-local t) + +(defun nxml-where-save-header-line-format () + (unless nxml-where-saved-header-line-format + (setq nxml-where-saved-header-line-format header-line-format))) + +(defun nxml-where-restore-header-line-format () + (setq header-line-format nxml-where-saved-header-line-format)) + + (provide 'nxml-where) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/elpa-to-submit/nxhtml/nxhtml/old/.nosearch b/elpa-to-submit/nxhtml/nxhtml/old/.nosearch deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/elpa-to-submit/nxhtml/nxhtml/old/html-inlined.el b/elpa-to-submit/nxhtml/nxhtml/old/html-inlined.el deleted file mode 100644 index a73a4217c8..0000000000 --- a/elpa-to-submit/nxhtml/nxhtml/old/html-inlined.el +++ /dev/null @@ -1,356 +0,0 @@ -;; html-inlined.el --- narrow/widen embedded blocks of css etc -;; -;; Copyright (C) 2005 by P J Heslin -;; -;; Author: Peter Heslin -;; Additions by: Lennart Borgman -(defconst html-inlined:version "2.2") ;; Version: -;; -;; This program 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 program 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, 675 Massachusettes Ave, -;; Cambridge, MA 02139, USA. - -;;; Commentary: -;; -;; When using html-mode, nxhtml-mode or nxml-mode to edit (X)HTML, -;; this file enables you to narrow the visible buffer to show just a -;; php/javascript/visual basic script block, or a css style block, and -;; then to switch from html-mode or nxml-mode to the appropriate mode -;; for that block. When finished editing that block, it enables you -;; easily to show the whole buffer and switch back to the original -;; mode again. -;; -;; The user interface consists of a single keystroke: by default, C-c %. -;; To change it, customize the value of 'html-inlined-key. In html-mode -;; or nxml-mode, this key looks to see if the cursor is inside a -;; script/style block, and if it is, it narrows the buffer to that -;; block and switches to the appropriate mode. Hit the same key again -;; to go back to editing the whole file in the original mode. -;; -;; This file used to be called nxml-script.el, when it only supported -;; nxml-mode; now it has been completely rewritten and made a bit more -;; general, so it can be used with any major mode for editing (X)HTML. -;; -;; Based on html-script.el: -;; URL: http://www.dur.ac.uk/p.j.heslin/Software/Emacs/Download/html-script.el -;; The original idea was taken from html-helper-mode.el - -;;; Installation: -;; -;; To install, put this file in your load-path, and require it via -;; your .emacs. -;; -;; (require 'html-inlined) -;; (html-inlined-add-key-to-modes) -;; -;; There are various customizations available, including a list of -;; modes in which to install html-inlined (defaults to html-mode and -;; nxml-mode). -;; -;; You also need to have the relevant autoloads set up for the script -;; modes you want to use, like so: -;; -;; (autoload 'php-mode "php-mode" "PHP mode" t) -;; -;; Supported major modes for script/style blocks include php-mode, -;; css-mode, javascript-generic-mode, jde-mode, visual-basic-mode. -;; -;; You might also need to tell emacs to open .php, .jsp and such files -;; in html-mode or nxml-mode, like so: -;; -;; (setq auto-mode-alist (cons '("\\.php[34]?$" . nxml-mode) auto-mode-alist)) -;; -;; BUGS: -;; -;; I regularly use only CSS and PHP, very occasionally Javascript, and -;; Visual Basic not at all, and so the code for these last two has not -;; been tested. -;; -;; Changes: -;; -;; 1.0 First public release of nxml-script.el -;; -;; 2.0 Changed name to html-inlined.el and completely rewritten. -;; Removed 'nxml-script-function and 'nxml-script-region-function, as -;; too confusing. Various user customization variables have changed. -;; -;; 2.1 Bugfix for javascript and vbscript and added ecmascript mode -- -;; thanks to Mark Takacs. -;; -;; 2.2 -;; 2006-02-08 Lennart Borgman -;; * Renamed to html-inlined.el -;; * (html-inlined-install-modes): Added nxhtml-mode -;; * (html-inlined-narrow, html-inlined-narrow-handler): -;; Only inner part of script or css tag shown in narrowed state. -;; * (html-inlined-indentation, html-inlined-indent-line-function-orig, -;; html-inlined-indent-line): Support for indentation - -(eval-when-compile (require 'cl)) - -(defgroup html-inlined nil - "Narrow \(X)HTML documents to script blocks and widen again" - :tag "Narrow (X)HTML documents to script blocks and widen again" - :group 'hypermedia - :prefix "html-inlined-") - -(defcustom html-inlined-install-modes '(nxml-mode nxhtmlmode html-mode) - "A list of modes in which to install a binding for html-inlined. -The key to bind is defined by html-inlined-key" - :group 'html-inlined) - -(defvar html-inlined-inlined-keymap nil) - -(defun html-inlined-make-inlined-keymap(inlined-key) - (let ((m (make-sparse-keymap))) - (define-key m inlined-key 'html-inlined-widen) - (define-key m [(control ?x) ?n ?w] 'html-inlined-widen) - (setq html-inlined-inlined-keymap m))) - -(defcustom html-inlined-key [(control c) ?%] - "Key to use to toggle narrowing and widening" - :set (lambda(symbol value) - (set-default symbol value) - (html-inlined-make-inlined-keymap value)) - :group 'html-inlined) - -(defcustom html-inlined-regions - '( - ;; Those two seems better to handle other ways: - ;;("<%" "%>" visual-basic-mode) - ;;("<\\?" "\\?>" php-mode c-mode) - - ("" "" css-mode c-mode) - ("" "" css-mode c-mode) - ("[ \t]style=\"" "\"" css-mode c-mode) - ("" "" visual-basic-mode) - ("" "" visual-basic-mode) - ("" "" - ecmascript-mode jde-mode java-mode javascript-generic-mode c-mode) - ("" "" - ecmascript-mode jde-mode java-mode javascript-generic-mode c-mode) - ;;("\s-on[a-z]+=\"javascript:" "\"" - ("[ \t]on[a-z]+=\"javascript:" "\"" - ecmascript-mode jde-mode java-mode javascript-generic-mode c-mode) - ) - "Define script regions. Each entry should consist of a list of - a starting regexp, an ending regexp, and a list of modes to try - for that region in that order." - :group 'html-inlined) - -(defvar html-inlined-start-regexp - (concat "\\(" (mapconcat (lambda (x) (car x)) html-inlined-regions "\\|") "\\)")) - -(defvar html-inlined-original-mode nil) -(make-variable-buffer-local 'html-inlined-original-mode) -;; This immunizes it against kill-all-local-variables, which is run -;; when the new major-mode is called. -(put 'html-inlined-original-mode 'permanent-local t) - -(defvar html-inlined-original-header nil) -(make-variable-buffer-local 'html-inlined-original-header) -(put 'html-inlined-original-header 'permanent-local t) - - -(defvar html-inlined-indentation nil) -(make-variable-buffer-local 'html-inlined-indentation) -(put 'html-inlined-indentation 'permanent-local t) - - -(defun html-inlined-find-indentation(narrow-start) - (setq html-inlined-indentation 0) - (save-excursion - (goto-char narrow-start) - (setq html-inlined-indentation (current-indentation))) - html-inlined-indentation) - -(defvar html-inlined-indent-line-function-orig nil) -(make-variable-buffer-local 'html-inlined-indent-line-function-orig) -(put 'html-inlined-indent-line-function-orig 'permanent-local t) - -(defcustom html-indent-inline-indentation 4 - "Extra indentation for inlined part." - :group 'html-inlined - :type 'integer) - -(fset 'html-inlined-indent-to-orig (symbol-function 'indent-to)) -(defun html-inlined-indent-line(&optional something) - (interactive) - (let ((is-first-line - (save-excursion - (beginning-of-line) - (string-match "\\`[ \n\r]*\\'" - (buffer-substring-no-properties - (point-min)(point)))))) - (if is-first-line - (save-excursion - (beginning-of-line) - (let ((start-of-line (point))) - (skip-syntax-forward "\\s-") - (delete-region start-of-line (point))) - (indent-to (+ html-inlined-indentation html-inlined-indentation) 0)) -;; ;; This does not work?? -;; (flet ((indent-to (column &optional minimum) -;; (let ((colnew -;; (if (= 0 column) -;; (+ column html-inlined-indentation html-inlined-indentation) -;; column))) -;; (message "flet ind-to: cn=%s" colnew)(sit-for 2) -;; (html-inlined-indent-to-orig colnew)))) - (beginning-of-line) - (funcall html-inlined-indent-line-function-orig) - ;; If 0 then it was not a relative indentation: - (when (= 0 (current-indentation)) - (indent-to (+ html-inlined-indentation - html-indent-inline-indentation)))))) - -(defvar html-inlined-mode-map - (let ((map (make-sparse-keymap)) - (menu-map (make-sparse-keymap))) - (define-key map [tab] 'html-inlined-indent-line) - (define-key menu-map [html-inlined-back] - (list 'menu-item "Back to whole file" 'html-inlined-widen)) - (define-key map [menu-bar inlined-mode] - (list 'menu-item "Inlined" menu-map)) - map)) - -(define-minor-mode html-inlined-mode - "Temporary mode for keymap when editing inlined code." - :keymap 'html-inlined-mode-map) - -(defun html-inlined-narrow () - (interactive) - (save-match-data - (let* ((orig (point)) - (case-fold-search t) - (handler-list - (if (re-search-backward html-inlined-start-regexp nil t) - (loop for x in html-inlined-regions - when (looking-at (car x)) return x - finally return nil) - nil))) - (if handler-list - (progn - (html-inlined-find-indentation (point)) - (html-inlined-narrow-handler orig handler-list (match-beginning 0))) - (message "Not in an inlined region.") - (goto-char orig))))) - -(defvar html-inlined-overlay nil) -(make-variable-buffer-local 'html-inlined-overlay) -(put 'html-inlined-overlay 'permanent-local t) -(defvar html-inlined-overlay-markers-face - (list - (cons 'background-color "OliveDrab3"))) - -(defun html-inlined-narrow-handler (orig arg-list start) - (let ((is-attr (not (memq ?< (append (car arg-list) nil))))) - (if is-attr - (beginning-of-line 1) - (beginning-of-line 2)) - (let ((start-str - (if is-attr - (buffer-substring (point) (match-end 0)) - (buffer-substring (match-beginning 0) (point)))) - end-str - (ending-re (cadr arg-list)) - (modes (cddr arg-list)) - (beg (if is-attr - (match-end 0) - (point))) - end - (case-fold-search t)) - (when is-attr (goto-char orig)) - (if (re-search-forward ending-re nil t) - (if (>= (point) orig) - (progn - (setq html-inlined-original-mode major-mode) - (setq html-inlined-original-header header-line-format) - (when (overlayp html-inlined-overlay) - (delete-overlay html-inlined-overlay)) - (if is-attr - (setq end (1- (point))) - (beginning-of-line) - (setq end (point))) - (goto-char orig) - (setq html-inlined-overlay (make-overlay - beg end - nil - nil t)) - (let ((s start-str)) - (put-text-property 0 (length s) - 'face html-inlined-overlay-markers-face - s) - (overlay-put html-inlined-overlay 'before-string s)) - ;; Add to blanks to avoid a bug that lets the cursor pass the after-string - ;; Suggested by Kim Storm 2006-03-21 - (let ((s (concat (buffer-substring (match-beginning 0) - (save-excursion - (goto-char (match-end 0)) - (beginning-of-line 2) - (point))) - " "))) - (put-text-property 0 (- (length s) 2) - 'face html-inlined-overlay-markers-face - s) - ;;(put-text-property 0 1 'cursor t s) - (overlay-put html-inlined-overlay 'after-string s)) - ;; Kim suggests that this should hold the cursor in the "after-string", but it does not work - ;; (though Kim's example work???): - (put-text-property 0 1 'cursor t (overlay-get html-inlined-overlay 'after-string)) - (overlay-put html-inlined-overlay 'keymap html-inlined-inlined-keymap) - ;;(narrow-to-region beg end) - (loop for x in modes when (fboundp x) do (funcall x) and return nil - finally do (error "html-inlined: no relevant mode found.")) - (narrow-to-region beg end) - (setq html-inlined-indent-line-function-orig indent-line-function) - (setq indent-line-function 'html-inlined-indent-line) - (setq indent-region-function nil) - (html-inlined-mode t) - (setq header-line-format - (replace-regexp-in-string - "%" "%%" - (concat - "%%%% Editing inlined code -- use " - (key-description html-inlined-key) - " to edit whole file again %%%% "))) - ) - (message "No inlined code or style found here.")) - (message "No inlined code or style here.")) - (goto-char orig) - ))) - -(defun html-inlined-widen () - (interactive) - (when (overlayp html-inlined-overlay) - (delete-overlay html-inlined-overlay)) - (widen) - (scroll-down 1) - (html-inlined-mode 0) - (funcall html-inlined-original-mode) - (setq header-line-format html-inlined-original-header) - (setq html-inlined-original-mode nil)) - -(defun html-inlined-install-narrow-key () - (local-set-key html-inlined-key 'html-inlined-narrow)) - -(defun html-inlined-add-key-to-modes() - "Add `html-inlined-key' to supported major modes." - (dolist (x html-inlined-install-modes) - (add-hook - (intern (concat (symbol-name x) "-hook")) - 'html-inlined-install-narrow-key))) - -(provide 'html-inlined) - diff --git a/elpa-to-submit/nxhtml/nxhtml/old/nxhpcmpl.el b/elpa-to-submit/nxhtml/nxhtml/old/nxhpcmpl.el deleted file mode 100644 index 7ab47bfe3d..0000000000 --- a/elpa-to-submit/nxhtml/nxhtml/old/nxhpcmpl.el +++ /dev/null @@ -1,477 +0,0 @@ -;;; nxhpcmpl.el --- Popup completion -;; -;; Author: Lennart Borgman -;; Created: Thu Dec 28 23:23:21 2006 -(setq nxhpcmpl:version "0.50") ;; Version: -;; Lxast-Updated: Fri Dec 29 01:42:55 2006 (3600 +0100) -;; Keywords: -;; Compatibility: -;; -;; Features that might be required by this library: -;; -;; None -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;; Functions for pop style completion for nxhtml-mode. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Change log: -;; -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; This program 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 program 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 this program; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Code: - -(require 'appmenu) - -(defun nxhpcmpl-complete () - "Complete the string before point using the current schema. -Return non-nil if in a context it understands." - (interactive) - ;;(message "where=%s" (nxhtml-check-where)) (sit-for 1) - (unless (eq 'in-tag-start (nxhtml-check-where)) - (error "Not in start tag")) - (and rng-validate-mode - (let ((lt-pos (save-excursion (search-backward "<" nil t))) - xmltok-dtd) - (and lt-pos - (= (rng-set-state-after lt-pos) lt-pos) - (or (nxhpcmpl-complete-tag lt-pos) -;; t -;; (rng-complete-end-tag lt-pos) -;; (rng-complete-attribute-name lt-pos) -;; (rng-complete-attribute-value lt-pos) - ))))) - -(defun nxhpcmpl-complete-tag (lt-pos) - (let (rng-complete-extra-strings) - (when (and (= lt-pos (1- (point))) - rng-complete-end-tags-after-< - rng-open-elements - (not (eq (car rng-open-elements) t)) - (or rng-collecting-text - (rng-match-save - (rng-match-end-tag)))) - (setq rng-complete-extra-strings - (cons (concat "/" - (if (caar rng-open-elements) - (concat (caar rng-open-elements) - ":" - (cdar rng-open-elements)) - (cdar rng-open-elements))) - rng-complete-extra-strings))) - (when (save-excursion - (re-search-backward rng-in-start-tag-name-regex - lt-pos - t)) - (and rng-collecting-text (rng-flush-text)) -;; (let ((completion -;; (let ((rng-complete-target-names -;; (rng-match-possible-start-tag-names)) -;; (rng-complete-name-attribute-flag nil)) - (let* ((orig (buffer-substring-no-properties (1+ lt-pos) (point))) - (rng-complete-target-names - (rng-match-possible-start-tag-names)) - (rng-complete-name-attribute-flag nil) - my-list - (olen (length orig))) - ;;(message "orig=%s, l=%s" orig olen)(sit-for 1) - (dolist (alt (rng-generate-qname-list)) - (when (string= orig - (if (> (length alt) olen) - (substring alt 0 olen) - alt)) - (setq my-list (cons alt my-list)))) - ;;(message "qnl=%s" (rng-generate-qname-list))(sit-for 2) - ;;(message "myl=%s" my-list) - ;;(message "%s" (try-completion "a" 'rng-complete-qname-function nil))(sit-for 2) - ;;(rng-complete-before-point (1+ lt-pos) 'rng-complete-qname-function "Tag: " nil 'rng-tag-history) - (let ((sets nil) - s-cdr) - (dolist (tg my-list) - (let (found) - (dolist (s nxhpcmpl-tag-sets) - (when (member tg (cdr s)) - (setq found t) - (let ((sets-entry (assq (car s) sets))) - (unless sets-entry - (setq sets (cons (list (car s)) sets)) - (setq sets-entry (assq (car s) sets))) - (setcdr sets-entry (cons tg (cdr sets-entry)))))) - (unless found - (let ((sets-entry (assq 'unsorted sets))) - (unless sets-entry - (setq sets (cons (list 'unsorted) sets)) - (setq sets-entry (assq 'unsorted sets))) - (setcdr sets-entry (cons tg (cdr sets-entry))))))) - (setq sets (sort sets (lambda(a b) - (string< (format "%s" b) - (format "%s" a))))) - (dolist (s sets) - (setcdr s (reverse (cdr s)))) - ;;(message "sets=%s" sets) - (let ((pop-map (make-sparse-keymap "Insert Tag"))) - (dolist (s sets) - (let ((k (make-sparse-keymap))) - (dolist (tg (cdr s)) - ;;(message "tg=%s" tg) - (define-key k - (read (format "[nx-%s]" tg)) - (list 'menu-item - (format "%s" (let ((h (gethash tg nxhtml-completion-hash))) - (if h h tg))) - `(lambda() - (interactive) - (unless (looking-back (concat "<" ,orig)) - (error "Not looking at %s" ,orig)) - (delete-char (- (length (match-string 0)))) - (insert "<" ,tg) - ;;(message "e=%s" ,tg) - ) - :value tg))) - (define-key pop-map - (read (format "[nxp-%s]" (car s))) - (list 'menu-item - (capitalize (format "%s" (car s))) - k)))) - ;;(message "pm=%s" pop-map) - (let ((where (appmenu-point-to-coord (point))) - (ret t)) - (condition-case err - (progn - (popup-menu pop-map where) - t) - (quit nil))))))))) - -(defconst nxhpcmpl-tag-sets nil) - -(defun nxhpcmpl-make-tag-sets(elt) - (let* ((group (nth 0 elt)) - (tag (nth 2 elt)) - (saved-grp (assq group nxhpcmpl-tag-sets)) - tmp - name - ) - (dolist (c (cdr (append tag nil))) - (unless name - (if (memq c '(?\ ?>)) - (setq name (concat (reverse tmp))) - (setq tmp (cons c tmp))))) - (unless name - (setq name (concat (reverse tmp)))) - ;;(message "group=%s, sg=%s, name=%s, tag=%s" group saved-grp name tag) - (if saved-grp - (let ((saved-cdr (cdr saved-grp))) - (unless (member name saved-cdr) - (setcdr saved-grp (cons name (cdr saved-grp))))) - (setq nxhpcmpl-tag-sets (cons (list group name) nxhpcmpl-tag-sets))) - )) - -(mapcar - 'nxhpcmpl-make-tag-sets - '( - ;;entities - (entity "\C-c#" "&#" "Ascii Code" ("&#" (r "Ascii: ") ";")) - (entity "\C-c\"" """ "Quotation mark" (""")) - (entity "\C-c$" "®" "Registered" ("®")) - (entity "\C-c@" "©" "Copyright" ("©")) - (entity "\C-c-" "­" "Soft Hyphen" ("­")) - (entity "\C-c " " " "Nonbreaking Space" (" ")) - (entity "\C-c&" "&" "Ampersand" ("&")) - (entity "\C-c>" ">" "Greater Than" (">")) - (entity "\C-c<" "<" "Less Than" ("<")) - ;; letters with accents common in italian - (entity nil "à" "a` (&à)" ("à")) - (entity nil "è" "e` (&è)" ("è")) - (entity nil "é" "e' (&é)" ("é")) - (entity nil "ò" "o` (&ò)" ("ò")) - (entity nil "ì" "i` (&ì)" ("ì")) - (entity nil "ù" "u` (&ù)" ("ù")) - - ;; logical styles - (logical nil "" "Blockquote" - ("
" (r "Quote: ") "
")) - (logical "c" "" "Code" - ("" (r "Code: ") "")) - (logical "x" "" "Sample" - ("" (r "Sample code") "")) - (logical "r" "" "Citation" - ("" (r "Citation: ") "")) - (logical "k" "" "Keyboard Input" - ("" (r "Keyboard: ") "")) - (logical "v" "" "Variable" - ("" (r "Variable: ") "")) - (logical "d" "" "Definition" - ("" (r "Definition: ") "")) - (logical "a" "
" "Address" - ("
" r "
")) - (logical "e" "" "Emphasized" - ("" (r "Text: ") "")) - (logical "s" "" "Strong" - ("" (r "Text: ") "")) - (logical "p" "
"		"Preformatted"
-	    ("
" (r "Text: ") "
")) - - ;;physical styles - (physical nil "") - (physical nil "") - (physical "s" "" "Strikethru" - ("" (r "Text: ") "")) - (physical "u" "" "Underline" - ("" (r "Text: ") "")) - (physical "i" "" "Italic" - ("" (r "Text: ") "")) - (physical "b" "" "Bold" - ("" (r "Text: ") "")) - (physical "f" "" "Fixed" - ("" (r "Text: ") "")) - (physical "c" "
" "Center" - ("
" (r "Text: ") "
")) - -;; html4.0 stuff, omitted - -; (physical "5" "" 'r "")) -; (physical "l" "" 'r "")) - - - (scripting nil "" "Header 6" - ("
" (r "Header: ") "
")) - (structure "5" "
" "Header 5" - ("
" (r "Header: ") "
")) - (structure "4" "

" "Header 4" - ("

" (r "Header: ") "

")) - (structure "3" "

" "Header 3" - ("

" (r "Header: ") "

")) - (structure "2" "

" "Header 2" - ("

" (r "Header: ") "

")) - (structure "1" "

" "Header 1" - ("

" (r "Header: ") "

")) - - ;; forms - (form nil "" "Option" - (& "
+ + +{% endblock %} + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-a-notabs.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-a-notabs.html new file mode 100644 index 0000000000..61b64e3fa8 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-a-notabs.html @@ -0,0 +1,57 @@ +{% load transdigest helpers %} + + + + + + + + + {% block title %}{% translate "WELCOME_TO_POINTTEC" %}{% endblock %} + + + + + + {% block htmlhead %} + + {% endblock %} + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-b.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-b.html new file mode 100644 index 0000000000..89ac466591 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-b.html @@ -0,0 +1,55 @@ + + + + + + + + {% block title %}{% translate "WELCOME_TO_POINTTEC" %}{% endblock %} + + + + + + {% block htmlhead %} + + {% endblock %} + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-c.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-c.html new file mode 100644 index 0000000000..f797466190 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-c.html @@ -0,0 +1,52 @@ + + + + + + + {% block title %}{% translate "WELCOME_TO_POINTTEC" %}{% endblock %} + + + + + + {% block htmlhead %} + + {% endblock %} + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-d.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-d.html new file mode 100644 index 0000000000..f40fdf6217 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-d.html @@ -0,0 +1,51 @@ + + + + + + {% block title %}{% translate "WELCOME_TO_POINTTEC" %}{% endblock %} + + + + + + {% block htmlhead %} + + {% endblock %} + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-e.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-e.html new file mode 100644 index 0000000000..62aafe76e5 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-e.html @@ -0,0 +1,50 @@ + + + + + + {% block title %}{% translate "WELCOME_TO_POINTTEC" %}{% endblock %} + + + + + + {% block htmlhead %} + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-f.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-f.html new file mode 100644 index 0000000000..ac73f84b2f --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-f.html @@ -0,0 +1,49 @@ + + + + + + {% block title %}{% translate "WELCOME_TO_POINTTEC" %}{% endblock %} + + + + + + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-g.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-g.html new file mode 100644 index 0000000000..9d302ce89c --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-g.html @@ -0,0 +1,39 @@ + + + + + + + + + + + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-h.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-h.html new file mode 100644 index 0000000000..5a0a166375 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-h.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-i.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-i.html new file mode 100644 index 0000000000..66ed32f53e --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-i.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-j.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-j.html new file mode 100644 index 0000000000..e1beacd49c --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-j.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-k.html b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-k.html new file mode 100644 index 0000000000..9dc91e1947 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing-k.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing.txt b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing.txt new file mode 100644 index 0000000000..dc3a6cf0a4 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/kubica-080516-freezing.txt @@ -0,0 +1,10 @@ +The problem seems to have to do with the { block pagestyle } thing +below. If that is removed then the freezing does not happen. + + + + + + + + + + + + + + + + + + <?php echoMessage("website.title")?> + + + + + +
+ + + + + +
+ + <?php echoMessage(" title="">
+ + +
+ +
+ +
+ + '; + createNavigationLinks("navlinks",1); + echo '
'; + echo '
'; + } + + if(isDemo()){ + echo '
'; + echoMessage("admin.demo"); + echo "
"; + } + + ?> + + + +
diff --git a/elpa-to-submit/nxhtml/tests/in/rr-address-090304.php b/elpa-to-submit/nxhtml/tests/in/rr-address-090304.php new file mode 100644 index 0000000000..34cbe259d5 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/rr-address-090304.php @@ -0,0 +1,4 @@ +
+ +Exhibitors button +
\ No newline at end of file diff --git a/elpa-to-submit/nxhtml/tests/in/rr-address-nxhtml.err b/elpa-to-submit/nxhtml/tests/in/rr-address-nxhtml.err new file mode 100644 index 0000000000..f06b0a05ec Binary files /dev/null and b/elpa-to-submit/nxhtml/tests/in/rr-address-nxhtml.err differ diff --git a/elpa-to-submit/nxhtml/tests/in/temp3.html b/elpa-to-submit/nxhtml/tests/in/temp3.html new file mode 100644 index 0000000000..276b754db8 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/temp3.html @@ -0,0 +1,44 @@ + + + + + News and Notes about nXhtml + + + + +
+ +
+

To nXhtml main page

+ +

News and Notes about nXhtml

+ +
+ +
Thanks for testing!
+
diff --git a/elpa-to-submit/nxhtml/tests/in/wiki-080708-ind-problem.rhtml b/elpa-to-submit/nxhtml/tests/in/wiki-080708-ind-problem.rhtml index a75331a451..d51d116674 100644 --- a/elpa-to-submit/nxhtml/tests/in/wiki-080708-ind-problem.rhtml +++ b/elpa-to-submit/nxhtml/tests/in/wiki-080708-ind-problem.rhtml @@ -1,5 +1,5 @@ <%= t("Hola") %> - <%= link_to name, target %> + <%= ink_to name, target %> <% if quiero do %> <%= do_something_nifty(with_me) %> <% end %> diff --git a/elpa-to-submit/nxhtml/tests/in/wiki-090804-js.html b/elpa-to-submit/nxhtml/tests/in/wiki-090804-js.html new file mode 100644 index 0000000000..2762ed954d --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/wiki-090804-js.html @@ -0,0 +1,32 @@ + + + + + + + + + + +some stuff

+

some other stuff

+ + + +EOTHTML; + +?> + + diff --git a/elpa-to-submit/nxhtml/tests/in/zn-090529-doxysample.php b/elpa-to-submit/nxhtml/tests/in/zn-090529-doxysample.php new file mode 100644 index 0000000000..3eddd90db3 --- /dev/null +++ b/elpa-to-submit/nxhtml/tests/in/zn-090529-doxysample.php @@ -0,0 +1,37 @@ + + * @date Fri May 29 15:28:06 2009 + * + * @brief Example file commented with Doxygen (via doxymacs) + * + * Longer description of what this file is + * Possibly multiline + */ + + +/** + * Echos the parameter + * + * @param text Text to echo + * + * @return EOL message + */ +function say($text) +{ + echo $text; + return "I spoketh."; +} +?> + +
+This is HTML, so the following has no special meaning: +/** + * Fake comment + * + * @param whatever Foo + * + * @return bar + */ +
diff --git a/elpa-to-submit/nxhtml/util/mumamo-test.el b/elpa-to-submit/nxhtml/tests/mumamo-test.el similarity index 68% rename from elpa-to-submit/nxhtml/util/mumamo-test.el rename to elpa-to-submit/nxhtml/tests/mumamo-test.el index 60337341a6..198e242d7e 100644 --- a/elpa-to-submit/nxhtml/util/mumamo-test.el +++ b/elpa-to-submit/nxhtml/tests/mumamo-test.el @@ -25,6 +25,10 @@ ;; ;;; Code: +;;(eval-when-compile (require 'mumamo)) +(require 'mumamo) +(require 'whelp) + ;;;;;;; TESTS, run in fundamental-mode buffer (defvar mumamo-test-mode-keymap @@ -35,6 +39,9 @@ (define-key map [f3] 'mumamo-test-create-chunk-at-point) map)) +(defvar mumamo-test-current-chunk-family nil) +(make-variable-buffer-local 'mumamo-test-current-chunk-family) + (define-minor-mode mumamo-test-mode "For testing creating mumamo-mode chunks. When this mode is on the following keys are defined: @@ -56,29 +63,27 @@ When this mode is on the following keys are defined: ) (defun mumamo-test-tell-bindings () - (let ((s "mumamo-test-mode is on, use F3/shift-F3 for simple testing")) - (put-text-property 0 (length s) - 'face 'font-lock-warning-face - s) - (message "%s" s))) + (save-match-data ;; runs in timer + (let ((s "mumamo-test-mode is on, use F3/shift-F3 for simple testing")) + (put-text-property 0 (length s) + 'face 'font-lock-warning-face + s) + (message "%s" s)))) ;;(mumamo-test-mode 1) -(defun mumamo-test-fontify-buffer () - (interactive) - (unless mumamo-current-chunk-family - (mumamo-select-chunk-family)) - (when mumamo-mode - (mumamo-mode 0)) - (save-excursion - (mumamo-remove-all-chunk-overlays) - (mumamo-save-buffer-state nil - (put-text-property (point-min) (point-max) 'face nil)) - (mumamo-fontify-buffer))) - -(defvar mumamo-test-current-chunk-family nil) -(make-variable-buffer-local 'mumamo-test-current-chunk-family) +;; (defun mumamo-test-fontify-buffer () +;; (interactive) +;; (unless mumamo-current-chunk-family +;; (mumamo-select-chunk-family)) +;; ;;(when mumamo-mode (mumamo-mode 0)) +;; (when mumamo-multi-major-mode (mumamo-turn-off-actions)) +;; (save-excursion +;; (mumamo-remove-all-chunk-overlays) +;; (mumamo-save-buffer-state nil +;; (put-text-property (point-min) (point-max) 'face nil)) +;; (mumamo-fontify-buffer))) (defun mumamo-test-create-chunk-at-point () (interactive) @@ -94,15 +99,18 @@ When this mode is on the following keys are defined: chunk chunk2) (mumamo-save-buffer-state nil - (setq chunk (mumamo-create-chunk-at here))) - (setq chunk2 (mumamo-get-chunk-at here)) + ;;(setq chunk (mumamo-create-chunk-at here))) + (setq chunk (mumamo-find-chunks here "test1"))) + ;;(setq chunk2 (mumamo-get-chunk-at here)) + (setq chunk2 (mumamo-find-chunks here "set chunk2")) ;;(message "mumamo-test-create-chunk-at-point.chunk 1=%s" chunk) ;;(lwarn 'test-create-chunk-at :warning "chunk=%s, chunk2=%s" chunk chunk2) ;;(when (overlay-buffer chunk) (assert (eq chunk chunk2)) ;;) ;;(message "mumamo-test-create-chunk-at-point.chunk 2=%s" chunk) - (syntax-ppss-flush-cache (1- (overlay-start chunk))) + ;;(syntax-ppss-flush-cache (1- (overlay-start chunk))) + (syntax-ppss-flush-cache (overlay-start chunk)) (let ((start (overlay-start chunk)) (end (overlay-end chunk))) ;;(setq syntax-ppss-last (cons 319 (parse-partial-sexp 1 1))) @@ -114,7 +122,9 @@ When this mode is on the following keys are defined: ;;(message "mumamo-test-create-chunk-at-point.chunk 4=%s" chunk) chunk ;;(message "test 2.debugger=%s" debugger) - (mumamo-get-chunk-at here)))) + ;;(mumamo-get-chunk-at here) + (mumamo-find-chunks here "return value") + ))) (defun mumamo-test-create-chunks-at-all-points () (interactive) @@ -122,7 +132,8 @@ When this mode is on the following keys are defined: (let (last-ovl this-ovl) (while (< (point) (point-max)) - (setq this-ovl (mumamo-test-create-chunk-at-point)) + ;;(setq this-ovl (mumamo-test-create-chunk-at-point)) + (setq this-ovl (mumamo-find-chunks (point) "test loop")) ;;(message "this-ovl=%s" this-ovl) (sit-for 0.01) ;;(sit-for 0) @@ -146,45 +157,56 @@ When this mode is on the following keys are defined: (mumamo-fontify-region (point-min) (point-max) t))) ;; Fix-me: can't byte compile: -(defun mumamo-test-easy-make () - (interactive) - (let ((start-str "--Start Submode:") - (end-str "--End Submode--") - (start-reg nil)) - (setq start-reg (rx - (eval start-str) - (0+ space) - (submatch - (0+ (any "a-z-"))) - (0+ space) - "--" - )) - (mumamo-easy-make-chunk-fun testchunk - start-str - start-reg - end-str)) - (setq mumamo-current-chunk-family - (list "testing" - 'text-mode - (list - 'testchunk - )))) +;; (defun mumamo-test-easy-make () +;; (interactive) +;; (let ((start-str "--Start Submode:") +;; (end-str "--End Submode--") +;; (start-reg nil)) +;; (setq start-reg +;; ;; (rx +;; ;; (eval start-str) +;; ;; (0+ space) +;; ;; (submatch +;; ;; (0+ (any "a-z-"))) +;; ;; (0+ space) +;; ;; "--" +;; ;; ) +;; (rx-to-string +;; `(and +;; ,start-str +;; (0+ space) +;; (submatch +;; (0+ (any "a-z-"))) +;; (0+ space) +;; "--" +;; )) +;; ) +;; (mumamo-easy-make-chunk-fun testchunk +;; start-str +;; start-reg +;; end-str)) +;; (setq mumamo-current-chunk-family +;; (list "testing" +;; 'text-mode +;; (list +;; 'testchunk +;; )))) -(defun mumamo-test-emb-perl () - (interactive) - (let ((start-str "[-") - (end-str "-]") - (start-reg nil)) - (mumamo-easy-make-chunk-fun testchunk-ep - start-str - start-reg - end-str)) - (setq mumamo-current-chunk-family - (list "emb perl test" - 'perl-mode - (list - 'testchunk-ep - )))) +;; (defun mumamo-test-emb-perl () +;; (interactive) +;; (let ((start-str "[-") +;; (end-str "-]") +;; (start-reg nil)) +;; (mumamo-easy-make-chunk-fun testchunk-ep +;; start-str +;; start-reg +;; end-str)) +;; (setq mumamo-current-chunk-family +;; (list "emb perl test" +;; 'perl-mode +;; (list +;; 'testchunk-ep +;; )))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -227,17 +249,17 @@ When this mode is on the following keys are defined: ;; (dbg-ret (mapconcat 'identity (nthcdr 6 debugger-lines) "\n"))) ;; (concat errmsg "\n" dbg-ret)))))) -(defun mumamo-test3-debug() - (interactive) - (message "%s" - (mumamo-get-backtrace - (mumamo-test-major-mode-init 'php-mode)))) +;; (defun mumamo-test3-debug() +;; (interactive) +;; (message "%s" +;; (mumamo-get-backtrace +;; (mumamo-test-major-mode-init 'php-mode)))) -(defun mumamo-test2-debug() - (interactive) - (mumamo-condition-case var - (mumamo-test-major-mode-init 'php-mode) - handlers)) +;; (defun mumamo-test2-debug() +;; (interactive) +;; (mumamo-condition-case var +;; (mumamo-test-major-mode-init 'php-mode) +;; handlers)) (defun mumamo-test-debug() (interactive) @@ -274,7 +296,7 @@ Send the traceback you get, if any, together with the message in the message buffer when reporting the error." (interactive "CMajor mode: ") (with-temp-buffer - (setq mumamo-explicitly-turned-on-off t) + ;;(setq mumamo-explicitly-turned-on-off t) (setq debug-on-error t) (funcall major))) diff --git a/elpa-to-submit/nxhtml/tests/nxhtmltest-Q.el b/elpa-to-submit/nxhtml/tests/nxhtmltest-Q.el index 7b51f8e91e..665281f3eb 100644 --- a/elpa-to-submit/nxhtml/tests/nxhtmltest-Q.el +++ b/elpa-to-submit/nxhtml/tests/nxhtmltest-Q.el @@ -44,9 +44,17 @@ ;; ;;; Code: +(require 'cl) +(require 'ourcomments-util) -(defvar nxhtmltest-bin-Q - (file-name-directory (if load-file-name load-file-name buffer-file-name))) +(eval-and-compile + (defvar nxhtmltest-bin-Q + (file-name-directory (or load-file-name + (when 'bytecomp-filename bytecomp-filename) + buffer-file-name))) + + (add-to-list 'load-path nxhtmltest-bin-Q) + (require 'nxhtmltest-helpers)) ;;;###autoload (defun nxhtmltest-run-Q () diff --git a/elpa-to-submit/nxhtml/tests/nxhtmltest-helpers.el b/elpa-to-submit/nxhtml/tests/nxhtmltest-helpers.el index 6122b168fc..7916359535 100644 --- a/elpa-to-submit/nxhtml/tests/nxhtmltest-helpers.el +++ b/elpa-to-submit/nxhtml/tests/nxhtmltest-helpers.el @@ -44,17 +44,15 @@ ;; ;;; Code: +(eval-when-compile (require 'cl)) (require 'ert2) (defun nxhtmltest-mumamo-error-messages () - (ert-get-messages "^MuMaMo error")) + (ert-get-messages "^MU:MuMaMo error")) (defun nxhtmltest-should-no-mumamo-errors () (ert-should (not (nxhtmltest-mumamo-error-messages)))) -(defun nxhtmltest-mumamo-error-messages () - (ert-get-messages "^MuMaMo error")) - (defun nxhtmltest-should-no-nxml-errors () (ert-should (not (ert-get-messages "Internal nXML mode error")))) @@ -103,10 +101,14 @@ (defun nxhtmltest-fontify-as-usual (seconds prompt-mark) (font-lock-mode 1) - (font-lock-wait (nxhtmltest-be-really-idle seconds prompt-mark))) + ;; This does not work now since I deleted the function below: + (error "font-lock-wait not defined") + ;;(font-lock-wait (nxhtmltest-be-really-idle seconds prompt-mark)) + ) (defun nxhtmltest-fontify-w-timers-handlers () - (dolist (timer (copy-list timer-idle-list)) + ;;(dolist (timer (copy-list timer-idle-list)) + (dolist (timer (copy-sequence timer-idle-list)) (timer-event-handler timer)) (redisplay t)) diff --git a/elpa-to-submit/nxhtml/tests/nxhtmltest-suites.el b/elpa-to-submit/nxhtml/tests/nxhtmltest-suites.el index af73f54f9d..9a9db12169 100644 --- a/elpa-to-submit/nxhtml/tests/nxhtmltest-suites.el +++ b/elpa-to-submit/nxhtml/tests/nxhtmltest-suites.el @@ -42,7 +42,14 @@ ;; ;;; Code: -(eval-when-compile (require 'cl)) +;;(eval-when-compile (require 'cl)) +(require 'cl) +(require 'mumamo) +(require 'nxhtml) +(require 'nxhtml-mumamo) +(when (fboundp 'nxml-mode) + (require 'rng-valid) + (require 'rngalt)) (setq debug-on-error t) @@ -67,11 +74,11 @@ (when (file-directory-p distr-in) (setq nxhtmltest-files-root distr-in))) -(setq nxhtmltest-update-method - ;;'font-lock-wait - 'font-lock-run-timers - ;;'font-lock-fontify-buffer - ) +;; (setq nxhtmltest-update-method +;; ;;'font-lock-wait +;; 'font-lock-run-timers +;; ;;'font-lock-fontify-buffer +;; ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Define tests using ert.el @@ -80,7 +87,7 @@ "Test for bug 300946 in Launchpad. See URL `https://bugs.launchpad.net/nxhtml/+bug/300946'. This is a test for the file attached by Chris on 2008-12-02." - (ert-with-temp-buffer-include-file "bug-290364.php" + (ert-with-temp-buffer-include-file "bug-300946-index.html" (add-hook 'ert-simulate-command-post-hook 'nxhtmltest-should-no-mumamo-errors nil t) @@ -89,8 +96,8 @@ a test for the file attached by Chris on 2008-12-02." )) (ert-deftest nxhtml-ert-indent-bug290364 () - "Test for bug 271497 in Launchpad. -See URL `https://bugs.launchpad.net/nxhtml/+bug/271497'. + "Test for bug 290364 in Launchpad. +See URL `https://bugs.launchpad.net/nxhtml/+bug/290364'. Note: If this test fails Emacs loops. Therefore the whole test is included in a when clause so you can avoid it easily." @@ -106,6 +113,7 @@ is included in a when clause so you can avoid it easily." (ert-deftest nxhtml-ert-indent-bug271497 () "Test for bug 271497 in Launchpad. +This is a bug in Emacs 22. It should work in Emacs 23 though. See URL `https://bugs.launchpad.net/nxhtml/+bug/271497'." (ert-with-temp-buffer-include-file "bug271497.txt" (add-hook 'ert-simulate-command-post-hook @@ -113,17 +121,34 @@ See URL `https://bugs.launchpad.net/nxhtml/+bug/271497'." nil t) (load-file (ert-get-test-file-name "bug271497.el")) (ert-simulate-command '(bug271497-mumamo) t) - (font-lock-mode 1) + ;;(font-lock-mode 1) + (nxhtmltest-fontify-default-way 2 "trans") (ert-simulate-command '(goto-char 42) t) + (message "after goto-char 42") (let ((ac42 after-change-functions) ac88) (ert-simulate-command '(goto-char 88) t) + (message "after goto-char 88") (setq ac88 after-change-functions) (ert-should (not (equal ac88 ac42)))))) (ert-deftest nxhtml-ert-indent-question43320 () "Test for question 43320 in Launchpad. -See URL `https://answers.launchpad.net/nxhtml/+question/43320'." +See URL `https://answers.launchpad.net/nxhtml/+question/43320'. + +Note: This fails in Emacs 22, but should work in Emacs 23." +;; I did see some problem here: + +;; - nXhtml 081222 + unpatched Emacs 081219 => ok +;; - nXhtml 081222 + unpatched Emacs 081124 => ok +;; - nXhtml 081222 + patched Emacs 081219 => ok + +;; - nXhtml 081222 + patched Emacs 081124 => ok, but it fails if I +;; use `nxhtmltest-run-Q'! I e, it fails if the autostart.el from +;; the nxhtml dir in 081222 is used - but not if the copy in +;; c:/EmacsW32 is used??? Which turned out to be if the old +;; php-mode was used ... + (ert-with-temp-buffer-include-file "question43320.html" (add-hook 'ert-simulate-command-post-hook 'nxhtmltest-should-no-mumamo-errors @@ -145,7 +170,9 @@ See URL `https://answers.launchpad.net/nxhtml/+question/43320'." (goto-line 22) (ert-should (= 6 (current-indentation))) (goto-line 25) (ert-should (= 4 (current-indentation))) (goto-line 8) (indent-line-to 0) + ;;(message "before indent-for-tab-command") (ert-simulate-command '(indent-for-tab-command) t) + ;;(message "after indent-for-tab-command") (ert-should (= 8 (current-indentation))) ;; (set (make-local-variable 'mumamo-submode-indent-offset-0) 0) @@ -180,9 +207,9 @@ See URL `https://answers.launchpad.net/nxhtml/+question/43320'." (ert-deftest nxhtml-ert-xhtml-1.0-transitional () "Test XHTML 1.0 Transitional with `nxhtml-mumamo-mode'. -This test should fail because there is currently no rng schema -for transitional. The schema for strict is used instead and the -file is invalid then." +NOTICE: This test SHOULD FAIL because there is currently no rng +schema for transitional. The schema for strict is used instead +and the file is invalid then." (ert-with-temp-buffer-include-file "lg-080813-label.html" (nxhtml-mumamo-mode) (nxhtmltest-fontify-default-way 2 "trans") @@ -193,11 +220,12 @@ file is invalid then." ;;; (ert-should ;;; (not (eq (get-char-property 398 'category) ;;; 'rng-error))) - (ert-should - (= 0 rng-error-count)) (ert-should (eq (get-text-property 398 'face) - 'font-lock-function-name-face)))) + 'font-lock-function-name-face)) + (ert-should-not + (= 0 rng-error-count)) + )) (ert-deftest nxhtml-ert-genshi-valid-in-genshi () (ert-with-temp-buffer-include-file "genshi-auto-mode.html" @@ -208,7 +236,8 @@ file is invalid then." (ert-should (eq font-lock-mode t)) (ert-should (eq major-mode 'nxhtml-genshi-mode)) (ert-should - (eq mumamo-multi-major-mode 'genshi-nxhtml-mumamo-mode)) + (memq mumamo-multi-major-mode '(genshi-nxhtml-mumamo-mode + genshi-html-mumamo-mode))) (nxhtmltest-fontify-default-way 2 "sheit") (rng-validate-mode 1) (rngalt-validate) @@ -244,7 +273,8 @@ file is invalid then." (nxhtmltest-should-no-mumamo-errors) (ert-should (with-current-buffer buf1 - (eq mumamo-multi-major-mode 'genshi-nxhtml-mumamo-mode))) + (memq mumamo-multi-major-mode '(genshi-nxhtml-mumamo-mode + genshi-html-mumamo-mode)))) (kill-buffer buf1))) (ert-deftest nxhtml-ert-genshi-auto-mode () @@ -260,7 +290,8 @@ file is invalid then." (nxhtmltest-should-no-mumamo-errors) (ert-should (with-current-buffer buf1 - (eq mumamo-multi-major-mode 'genshi-nxhtml-mumamo-mode))) + (memq mumamo-multi-major-mode '(genshi-nxhtml-mumamo-mode + genshi-html-mumamo-mode)))) (kill-buffer buf1))) (ert-deftest nxhtml-ert-opened-modified () @@ -297,6 +328,7 @@ file is invalid then." (nxhtmltest-fontify-default-way 2 "hili") (goto-char 44) (nxhtmltest-should-no-mumamo-errors) + (message "face at 44=%s" (get-text-property 44 'face)) (ert-should (eq (get-text-property 44 'face) 'font-lock-function-name-face)))) @@ -319,6 +351,12 @@ file is invalid then." (ert-should (= (current-indentation) 0))))) (ert-deftest nxhtml-ert-indent-wiki-080708-ind-problem-a () + "From a report on EmacsWiki. +NOTICE: This SHOULD FAIL. There is currently no support for the +kind of indentation needed here. + +Notice 2: For some reason I sometimes get the error overlayp, nil +here." (ert-with-temp-buffer-include-file "wiki-080708-ind-problem.rhtml" (require 'ruby-mode nil t) (if (not (featurep 'ruby-mode)) @@ -333,7 +371,7 @@ file is invalid then." (goto-line 3) ;; Test (nxhtmltest-should-no-mumamo-errors) - (ert-should (= (current-indentation) 2))))) + (ert-should-not (= (current-indentation) 2))))) (ert-deftest nxhtml-ert-sheit-2007-12-26 () (ert-with-temp-buffer-include-file "sheit-2007-12-26.php" diff --git a/elpa-to-submit/nxhtml/util/appmenu-fold.el b/elpa-to-submit/nxhtml/util/appmenu-fold.el index ade4a6ae7f..8ca3811a1b 100644 --- a/elpa-to-submit/nxhtml/util/appmenu-fold.el +++ b/elpa-to-submit/nxhtml/util/appmenu-fold.el @@ -49,6 +49,7 @@ ;;; Code: (require 'fold-dwim nil t) +(eval-when-compile (require 'appmenu)) (when (featurep 'fold-dwim) diff --git a/elpa-to-submit/nxhtml/util/appmenu.el b/elpa-to-submit/nxhtml/util/appmenu.el index 6b528ebf83..d3b019a89b 100644 --- a/elpa-to-submit/nxhtml/util/appmenu.el +++ b/elpa-to-submit/nxhtml/util/appmenu.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2008 by Lennart Borgman -;; Author: Lennart Borgman +;; Author: Lennart Borgman ;; Created: Thu Jan 05 14:00:26 2006 (defconst appmenu:version "0.62") ;; Version: ;; Last-Updated: 2008-06-15T17:54:40+0200 Sun @@ -78,7 +78,7 @@ The entries in this list are lists: \(ID PRIORITY TEST TITLE DEFINITION) -ID is a uniqure identity. +ID is a unique identity. PRIORITY is a number or a variable whose value is a number telling where to put this entry when showing the menu. @@ -106,6 +106,7 @@ For an example of use see mlinks.el.") (when (symbolp priB) (setq priB (symbol-value priB))) (< priA priB)))))) +;;;###autoload (defun appmenu-add (id priority test title definition) "Add entry to `appmenu-alist'. Add an entry to this list with ID, PRIORITY, TEST, TITLE and @@ -134,42 +135,59 @@ DEFINITION as explained there." ml)) (defvar appmenu-mouse-only - '(flyspell-correct-word)) + '((flyspell-correct-word appmenu-flyspell-correct-word-before-point))) + +(defun appmenu-flyspell-correct-word-before-point () + "Pop up a menu of possible corrections for misspelled word before point. +Special version for AppMenu." + (interactive) + (flyspell-correct-word-before-point)) + +(defcustom appmenu-at-any-point '(ispell-word) + "Commands that may work at any point in a buffer. +Some important but not too often used commands that may be useful +for most points in a buffer." + :group 'appmenu) (defun appmenu-make-menu-for-point () - "Construct a menu based on point keymap." + "Construct a menu based on point. +This includes some known commands for point and keymap at +point." (let ((point-map (get-char-property (point) 'keymap)) - funs + (funs appmenu-at-any-point) (map (make-sparse-keymap "At point")) (num 0) last-prefix this-prefix) + ;; Known for any point (when point-map (let ((map-fun (lambda (key fun) (if (keymapp fun) (map-keymap map-fun fun) (when (and (symbolp fun) - (fboundp fun) - (not (memq fun appmenu-mouse-only))) - (add-to-list 'funs fun)))))) - (map-keymap map-fun point-map)) - (dolist (fun funs) - (let ((desc (when fun (documentation fun)))) - (when desc - (setq desc (car (split-string desc "[\n]"))) - ;;(lwarn t :warning "pk: %s, %s" fun desc) - (setq this-prefix - (car (split-string (symbol-name fun) "[-]"))) - (when (and last-prefix - (not (string= last-prefix this-prefix))) - (define-key map - (vector (intern (format "appmenu-point-div-%s" num))) - (list 'menu-item "--"))) - (setq last-prefix this-prefix) - (setq num (1+ num)) + (fboundp fun)) + (let ((mouse-only (assq fun appmenu-mouse-only))) + (when mouse-only + (setq fun (cadr mouse-only))) + (add-to-list 'funs fun))))))) + (map-keymap map-fun point-map))) + (dolist (fun funs) + (let ((desc (when fun (documentation fun)))) + (when desc + (setq desc (car (split-string desc "[\n]"))) + ;;(lwarn t :warning "pk: %s, %s" fun desc) + (setq this-prefix + (car (split-string (symbol-name fun) "[-]"))) + (when (and last-prefix + (not (string= last-prefix this-prefix))) (define-key map - (vector (intern (format "appmenu-point-%s" num))) - (list 'menu-item desc fun)))))) + (vector (intern (format "appmenu-point-div-%s" num))) + (list 'menu-item "--"))) + (setq last-prefix this-prefix) + (setq num (1+ num)) + (define-key map + (vector (intern (format "appmenu-point-%s" num))) + (list 'menu-item desc fun))))) (when (> num 0) map))) (defun appmenu-map () diff --git a/elpa-to-submit/nxhtml/util/as-external.el b/elpa-to-submit/nxhtml/util/as-external.el index 25ba48768a..7777d4ce37 100644 --- a/elpa-to-submit/nxhtml/util/as-external.el +++ b/elpa-to-submit/nxhtml/util/as-external.el @@ -3,14 +3,14 @@ ;; Author: Lennart Borgman (lennart O borgman A gmail O com) ;; Created: Mon Jun 25 19:02:49 2007 (defconst as-external:version "0.6") ;;Version: -;; Last-Updated: 2008-09-30T11:44:43+0200 Tue +;; Last-Updated: 2009-08-04 Tue ;; URL: ;; Keywords: ;; Compatibility: ;; ;; Features that might be required by this library: ;; -;; `server'. +;; None ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -61,7 +61,16 @@ ;; ;;; Code: -(require 'server) +(eval-when-compile (require 'cl)) +(eval-when-compile (require 'html-write)) +(eval-when-compile (require 'mumamo)) +(eval-when-compile (require 'ourcomments-util)) +(eval-when-compile + (when (featurep 'nxml-mode) + (require 'nxhtml) + (require 'nxhtml-mumamo))) +(eval-when-compile (require 'wikipedia-mode)) +(eval-when-compile (require 'server)) (defgroup as-external nil "Settings related to Emacs as external editor." @@ -146,11 +155,13 @@ blog. Therefore turn on these: Also bypass the question for line end conversion when using emacsw32-eol." (interactive) - (if (not (fboundp 'nxhtml-mumamo-mode)) + ;;(if (not (fboundp 'nxhtml-mumamo-mode)) + (if (not (fboundp 'nxhtml-mode)) (as-external-fall-back "Can't find nXhtml") - (nxhtml-mumamo-mode) + ;;(nxhtml-mumamo-mode) + (nxhtml-mode) (nxhtml-validation-header-mode 1) - (mumamo-post-command) + ;;(mumamo-post-command) (set (make-local-variable 'wrap-to-fill-left-marg-modes) '(nxhtml-mode fundamental-mode)) (wrap-to-fill-column-mode 1) @@ -220,11 +231,14 @@ See also `as-external-mode'." ;;;###autoload (define-minor-mode as-external-mode - "If non-nil check for if Emacs is used as external editor. -When Emacs is used as an external editor for example to edit text -areas on a web page viewed with Firefox this library tries to -help to setup the buffer in a useful way. It may for example set -major and minor modes for the buffer. + "If non-nil check if Emacs is called as external editor. +When Emacs is called as an external editor for example to edit +text areas on a web page viewed with Firefox this library tries +to help to setup the buffer in a useful way. It may for example +set major and minor modes for the buffer. + +This can for example be useful when blogging or writing comments +on blogs. See `as-external-alist' for more information." :global t @@ -235,6 +249,7 @@ See `as-external-alist' for more information." as-external-its-all-text-regexp (cons as-external-its-all-text-coding as-external-its-all-text-coding)))) + ;;(message "as-external-mode=%s" as-external-mode) (if as-external-mode (progn (add-to-list 'file-coding-system-alist coding-entry) diff --git a/elpa-to-submit/nxhtml/util/bw-rnc-load/mjt.rnc b/elpa-to-submit/nxhtml/util/bw-rnc-load/mjt.rnc deleted file mode 100644 index b37f01adf8..0000000000 --- a/elpa-to-submit/nxhtml/util/bw-rnc-load/mjt.rnc +++ /dev/null @@ -1,74 +0,0 @@ -include "xhtml-loader.rnc" - -MjtAll.attrib = - attribute mjt.def { Text.datatype }?, - attribute mjt.when { Text.datatype }?, - attribute mjt.otherwise { Text.datatype }?, - attribute mjt.for { Text.datatype }?, - attribute mjt.if { Text.datatype }?, - attribute mjt.elif { Text.datatype }?, - attribute mjt.else { Text.datatype }?, - attribute mjt.script { Text.datatype }?, - attribute mjt.choose { Text.datatype }?, - attribute mjt.replace { Text.datatype }?, - attribute mjt.content { Text.datatype }?, - attribute mjt.strip { Text.datatype }?, - attribute mjt.src { Text.datatype }?, - attribute mjt.style { Text.datatype }?, - attribute mjt.class { Text.datatype }?, - attribute mjt.id { Text.datatype }?, - attribute mjt.attrs { Text.datatype }?, - attribute mjt.task { Text.datatype }? - - -a.attlist &= - attribute mjt.onblur { Script.datatype }?, - attribute mjt.onfocus { Script.datatype }? -area.attlist &= - attribute mjt.onblur { Script.datatype }?, - attribute mjt.onfocus { Script.datatype }? -form.attlist &= - attribute mjt.onreset { Script.datatype }?, - attribute mjt.onsubmit { Script.datatype }? -body.attlist &= - attribute mjt.onload { Script.datatype }?, - attribute mjt.onunload { Script.datatype }? -label.attlist &= - attribute mjt.onblur { Script.datatype }?, - attribute mjt.onfocus { Script.datatype }? -input.attlist &= - attribute mjt.onblur { Script.datatype }?, - attribute mjt.onchange { Script.datatype }?, - attribute mjt.onfocus { Script.datatype }?, - attribute mjt.onselect { Script.datatype }? -select.attlist &= - attribute mjt.onblur { Script.datatype }?, - attribute mjt.onchange { Script.datatype }?, - attribute mjt.onfocus { Script.datatype }? -textarea.attlist &= - attribute mjt.onblur { Script.datatype }?, - attribute mjt.onchange { Script.datatype }?, - attribute mjt.onfocus { Script.datatype }?, - attribute mjt.onselect { Script.datatype }? -button.attlist &= - attribute mjt.onblur { Script.datatype }?, - attribute mjt.onfocus { Script.datatype }? - -MjtEvents.attrib = - attribute mjt.onclick { Script.datatype }?, - attribute mjt.ondblclick { Script.datatype }?, - attribute mjt.onmousedown { Script.datatype }?, - attribute mjt.onmouseup { Script.datatype }?, - attribute mjt.onmouseover { Script.datatype }?, - attribute mjt.onmousemove { Script.datatype }?, - attribute mjt.onmouseout { Script.datatype }?, - attribute mjt.onkeypress { Script.datatype }?, - attribute mjt.onkeydown { Script.datatype }?, - attribute mjt.onkeyup { Script.datatype }? - - -Common.attrib &= MjtAll.attrib -CommonIdRequired.attrib &= MjtAll.attrib - -Common.attrib &= MjtEvents.attrib -CommonIdRequired.attrib &= MjtEvents.attrib diff --git a/elpa-to-submit/nxhtml/util/bw-rnc-load/qtmstr-xhtml.rnc b/elpa-to-submit/nxhtml/util/bw-rnc-load/qtmstr-xhtml.rnc deleted file mode 100644 index 61ab89eec5..0000000000 --- a/elpa-to-submit/nxhtml/util/bw-rnc-load/qtmstr-xhtml.rnc +++ /dev/null @@ -1,58 +0,0 @@ -namespace py = "http://genshi.edgewall.org/" -namespace xi = "http://www.w3.org/2001/XInclude" - -include "genshi.rnc" -include "xinclude.rnc" -include "xhtml-loader.rnc" - -start |= head|body|p|\div|h1|h2|h3|h4|h5|h6|hr|pre|dl|ol|ul|table|form - -Common.attrib &= genshi.attrib -head.attlist &= genshi.attrib -html.attlist &= genshi.attrib - -Head.class = base | isindex | link | meta | script | title | style | - if-head | for-head | def-head | with-head - -Head.model = Head.class* - -head.content &= Head.model* - -if-inline = element py:if { genshi.if.attlist, Inline.model } -if-block = element py:if { genshi.if.attlist, Block.model } -if-head = element py:if { genshi.if.attlist, Head.model } -for-inline = element py:for { genshi.for.attlist, Inline.model } -for-block = element py:for { genshi.for.attlist, Block.model } -for-head = element py:for { genshi.for.attlist, Head.model } -def-inline = element py:def { genshi.def.attlist, Inline.model } -def-block = element py:def { genshi.def.attlist, Block.model } -def-head = element py:def { genshi.def.attlist, Head.model } -with-inline = element py:with { genshi.with.attlist, Inline.model } -with-block = element py:with { genshi.with.attlist, Block.model } -with-head = element py:with { genshi.with.attlist, Head.model } - -Inline.class |= if-inline | for-inline | def-inline | with-inline -Block.class |= if-block | for-block | def-block | with-block - -xi-inline = element xi:include { - xinclude.include.attlist, - element xi:fallback { genshi.attrib, - (xi-inline | Inline.model)* - }? - } - -xi-block = element xi:include { xinclude.include.attlist, - element xi:fallback { genshi.attrib, - (xi-block | Block.model)* - }? - } - -xi-head = element xi:include { xinclude.include.attlist, - element xi:fallback { genshi.attrib, - (xi-head | Head.model)* - }? - } - -Inline.class |= xi-inline -Block.class |= xi-block -Head.class |= xi-head diff --git a/elpa-to-submit/nxhtml/util/bw-rnc-load/schema-find.el b/elpa-to-submit/nxhtml/util/bw-rnc-load/schema-find.el deleted file mode 100644 index 8fe12b3482..0000000000 --- a/elpa-to-submit/nxhtml/util/bw-rnc-load/schema-find.el +++ /dev/null @@ -1,18 +0,0 @@ - -(defun find-nxml (lst) - (if (null lst) - nil - (if (string-match "nxml" (car lst)) - (car lst) - (find-nxml (cdr lst))))) -find-nxml - - -(defun check-loader () - (let ((loader-path "./emacs/site-lisp/nxhtml/etc/schema/xhtml-loader.rnc")) - (if (file-exists-p loader-path) - nil - (progn (find-file loader-path) - (insert (concat "include \"" (find-nxml load-path) "/../../etc/schema/xhtml.rnc\"")) - (save-buffer) - (kill-this-buffer))))) diff --git a/elpa-to-submit/nxhtml/util/bw-rnc-load/xinclude.rnc b/elpa-to-submit/nxhtml/util/bw-rnc-load/xinclude.rnc deleted file mode 100644 index c45cf0ca81..0000000000 --- a/elpa-to-submit/nxhtml/util/bw-rnc-load/xinclude.rnc +++ /dev/null @@ -1,11 +0,0 @@ -namespace xi = "http://www.w3.org/2001/XInclude" -namespace local = "" - -xinclude.include.attlist = - attribute href { xsd:anyURI }?, - attribute parse { xsd:string }?, - attribute xpointer { xsd:string }?, - attribute encoding { xsd:string }?, - attribute accept { xsd:string }?, - attribute accept-language { xsd:string }? - diff --git a/elpa-to-submit/nxhtml/util/chart.el b/elpa-to-submit/nxhtml/util/chart.el index 5d0107beec..110da361b0 100644 --- a/elpa-to-submit/nxhtml/util/chart.el +++ b/elpa-to-submit/nxhtml/util/chart.el @@ -1,8 +1,8 @@ ;;; chart.el --- Google charts (and maybe other) ;; ;; Author: Lennart Borgman (lennart O borgman A gmail O com) -;; Created: 2008-04-06T15:09:33+0200 Sun -;; Version: +;; Created: 2008-04-06 Sun +(defconst chart:version "0.2") ;; Version: ;; Last-Updated: ;; URL: ;; Keywords: @@ -73,6 +73,85 @@ (symbol-name (car rec))) chart-types)) +(defvar chart-mode-keywords-and-states + '(("Output-file:" (accept file-name)) + ("Size:" (accept number)) + ("Data:" (accept number)) + ("Type:" (accept chart-type)) + )) + +(defvar chart-mode-keywords + (mapcar (lambda (rec) + (car rec)) + chart-mode-keywords-and-states)) + +;; Fix-me: I started to implement a parser, but I think I will drop it +;; and wait for Semantic to be easily available instead. Or just use +;; Calc/Org Tables. + +(defvar chart-intermediate-states + '((end-or-label (or end-of-file label)) + )) + +(defvar chart-extra-keywords-and-states + '( + ;;("Provider:") + ("Colors:") + ("Solid-fill:") + ("Linear-gradient:") + ("Linear-stripes:") + ("Chart-title:" (and string end-or-label)) + ("Legends:" (accept string)) + ("Axis-types:") + ("Axis-labels:") + ("Axis-ranges:") + ("Axis-styles:") + ("Bar-thickness:") + ("Bar-chart-zero-line:") + ("Bar-chart-zero-line-2:") + ("Line-styles-1:") + ("Line-styles-2:") + ("Grid-lines:") + ("Shape-markers:") + ("Range-markers:") + )) + +(defvar chart-extra-keywords + (mapcar (lambda (rec) + (car rec)) + chart-extra-keywords-and-states)) + +(defvar chart-raw-keywords-and-states + '( + ("Google-chart-raw:" (accept string)) + )) + +(defvar chart-raw-keywords + (mapcar (lambda (rec) + (car rec)) + chart-raw-keywords-and-states)) + +(defvar chart-mode-keywords-re (regexp-opt chart-mode-keywords)) +(defvar chart-extra-keywords-re (regexp-opt chart-extra-keywords)) +(defvar chart-types-keywords-re (regexp-opt chart-types-keywords)) +(defvar chart-raw-keywords-re (regexp-opt chart-raw-keywords)) + +(defvar chart-font-lock-keywords + `((,chart-mode-keywords-re . font-lock-keyword-face) + (,chart-extra-keywords-re . font-lock-variable-name-face) + (,chart-types-keywords-re . font-lock-function-name-face) + (,chart-raw-keywords-re . font-lock-preprocessor-face) + )) + +(defvar chart-font-lock-defaults + '(chart-font-lock-keywords nil t)) + +(defvar chart-mode-syntax-table + (let ((table (make-syntax-table))) + (modify-syntax-entry ?\n "> " table) + (modify-syntax-entry ?\; "< " table) + table)) + (defun chart-create (provider out-file size data type title legends &optional extras) "Create a chart image. @@ -181,7 +260,8 @@ be a list (list COLOR START-INDEX END-INDEX) " - (interactive) + (message "(chart-create %s %s %s %s %s %s %s" provider out-file size data type + title legends) (unless (symbolp type) (error "Argument TYPE should be a symbol")) (unless (assoc type chart-types) @@ -217,19 +297,20 @@ be a list (number-to-string num) (concat str "," (number-to-string num))))) str)) - (rec-scale (cdr rec)) + (rec-scale (cadr rec)) (rec-min (car rec-scale)) (rec-max (cdr rec-scale)) (scale-str (when rec-scale (format "%s,%s" rec-min rec-max))) ) (if (not numbers) - (progn - (setq numbers (concat "&chd=t:" number-str)) - (when scale-str - (setq scales (concat "&chds=" scale-str)))) - (setq numbers (concat numbers "|" number-str))) - (when scale-str - (setq scales (concat scales "," scale-str))))) + (progn + (setq numbers (concat "&chd=t:" number-str)) + (when (or scale-str + (memq g-type '(p p3 gom))) + (setq scales (concat "&chds=" scale-str)))) + (setq numbers (concat numbers "|" number-str)) + (when scale-str + (setq scales (concat scales "," scale-str)))))) (setq url (concat url numbers)) (when scales (setq url (concat url scales))) ;; fix-me: encode the url @@ -239,7 +320,7 @@ be a list (arg (if (memq g-type '(p p3 gom)) "&chl=" "&chdl="))) - (setq url (concat url arg url-legends)))) + (setq url (concat url arg url-legends)))) (dolist (extra extras) (let ((extra-type (car extra)) (extra-value (cdr extra))) @@ -266,7 +347,12 @@ be a list (buffer-substring-no-properties (point) (point-max)) (view-buffer-other-window (current-buffer)) (error "Bad content")))) - (let* ((fname (expand-file-name out-file)) + (let* ((is-html (string-match-p "" content)) + (fname (progn + (when is-html + (setq out-file (concat (file-name-sans-extension out-file) ".html"))) + (expand-file-name out-file) + )) (do-it (or (not (file-exists-p fname)) (y-or-n-p (concat "File " fname " exists. Replace it? ")))) @@ -276,64 +362,23 @@ be a list (when buf (kill-buffer buf)) (with-temp-file fname (insert content)) - (view-file-other-window fname) + (if (not is-html) + (view-file-other-window fname) + (chart-show-last-error-file fname)) (select-window this-window))))) (t (error "Unknown provider: %s" provider))) ) -(defvar chart-mode-keywords - '("Output-file:" - ;;"Provider:" - "Size:" "Data:" "Type:") - ) - -(defvar chart-extra-keywords - '( - "Colors:" - "Solid-fill:" - "Linear-gradient:" - "Linear-stripes:" - "Chart-title:" - "Legends:" - "Axis-types:" - "Axis-labels:" - "Axis-ranges:" - "Axis-styles:" - "Bar-thickness:" - "Bar-chart-zero-line:" - "Bar-chart-zero-line-2:" - "Line-styles-1:" - "Line-styles-2:" - "Grid-lines:" - "Shape-markers:" - "Range-markers:" - )) - -(defvar chart-raw-keywords - '( - "Google-chart-raw:" - )) - -(defvar chart-mode-keywords-re (regexp-opt chart-mode-keywords)) -(defvar chart-extra-keywords-re (regexp-opt chart-extra-keywords)) -(defvar chart-types-keywords-re (regexp-opt chart-types-keywords)) -(defvar chart-raw-keywords-re (regexp-opt chart-raw-keywords)) - -(defvar chart-font-lock-keywords - `((,chart-mode-keywords-re . font-lock-keyword-face) - (,chart-extra-keywords-re . font-lock-variable-name-face) - (,chart-types-keywords-re . font-lock-function-name-face) - (,chart-raw-keywords-re . font-lock-preprocessor-face) - )) - -(defvar chart-font-lock-defaults - '(chart-font-lock-keywords nil t)) - -(defvar chart-mode-syntax-table - (let ((table (make-syntax-table))) - (modify-syntax-entry ?\n "> " table) - (modify-syntax-entry ?\; "< " table) - table)) +(defun chart-show-last-error-file (fname) + (interactive) + (with-output-to-temp-buffer (help-buffer) + (help-setup-xref (list #'chart-show-last-error-file fname) (interactive-p)) + (with-current-buffer (help-buffer) + (insert "Error, see ") + (insert-text-button "result error page" + 'action + `(lambda (btn) + (browse-url ,fname)))))) (defvar chart-mode-map (let ((map (make-sparse-keymap))) @@ -353,6 +398,7 @@ be a list collection))))) collection)) +;;;###autoload (defun chart-complete () (interactive) (let* ((here (point)) @@ -372,16 +418,17 @@ be a list res) (when state (cond - ((equal state '(accept number)) - (setq res nil) - (setq msg (propertize "Needs a number here!" - 'face 'secondary-selection))) - ((equal state 'need-label) + ((or (= (current-column) 0) + (equal state 'need-label)) (setq collection (append (chart-missing-keywords) chart-extra-keywords chart-raw-keywords nil)) (setq prompt "Label: ")) + ((equal state '(accept number)) + (setq res nil) + (setq msg (propertize "Needs a number here!" + 'face 'secondary-selection))) ((equal state '(accept chart-type)) (setq collection chart-types-keywords) (setq prompt "Chart type: ")) @@ -410,6 +457,7 @@ be a list par-provider par-size par-data par-data-temp + par-data-min par-data-max par-type par-title par-legends @@ -419,183 +467,198 @@ be a list pos-state (state 'need-label) (problems - (catch 'problems - (save-restriction - (widen) - (if want-pos-state - (unless (re-search-backward chart-mode-keywords-re nil t) - (goto-char (point-min))) - (goto-char (point-min))) - (let (this-keyword - this-start - this-end - params - token - token-pos - next-token - found-labels - current-label) - (while (or token - (progn - (setq pos-state state) - (setq token-before-pos (point)) - (condition-case err - (setq token (read (current-buffer))) - (error - (if (eq (car err) 'end-of-file) - (unless (eq state 'need-label) - (throw 'problems (format "Unexpected end, state=%s" state))) - (throw 'problems - (error-message-string err))))))) - (message "token=%s, label=%s, state=%s" token current-label state) - (when (and want-pos-state - (>= (point) want-pos-state)) - (when (= (point) want-pos-state) - ;; right after item - (setq pos-state nil)) - (goto-char here) - (throw 'pos-state pos-state)) - (cond ;; state - ;; Label - ((eq state 'need-label) - (unless (symbolp token) - (throw 'problems (format "Expected label, got %s" token))) - (unless (member (symbol-name token) - (append chart-mode-keywords - chart-extra-keywords - chart-raw-keywords - nil)) - (throw 'problems (format "Unknown label %s" token))) - (when (member (symbol-name token) found-labels) - (throw 'problems (format "Label %s defined twice" token))) - (setq current-label token) - (setq found-labels (cons current-label found-labels)) - (setq token nil) - ;;(setq state 'need-value) - (case current-label - ('Output-file: - (setq state '(accept file-name))) - ('Size: - (setq state '(accept number))) - ('Data: - (setq state '(accept number))) - ('Type: - (setq state '(accept chart-type))) - ('Chart-title: - (setq state '(accept string))) - ('Legends: - (setq state '(accept string))) - ('Google-chart-raw: - (setq state '(accept string))) - )) - ;;;; Values - ;; Alt - ((equal state '(accept '| symbol)) - (if (eq '| token) - (case current-label - ('Legends: - (setq token nil) - (setq state '(accept string))) - (t (error "internal error, current-label=%s, state=%s" current-label state))) - (if (symbolp token) + (catch 'problems + (save-restriction + ;;(widen) + (if want-pos-state + (unless (re-search-backward chart-mode-keywords-re nil t) + (goto-char (point-min))) + (goto-char (point-min))) + (let (this-keyword + this-start + this-end + params + token + token-pos + next-token + found-labels + current-label) + (while (or token (progn - ;;(setq token nil) - (setq state 'need-label)) - (throw 'problems (format "Expected | or label, got %s" token))))) - ;; Strings - ((equal state '(accept string)) - (unless (stringp token) - (throw 'problems "Expected string")) - (case current-label - ('Chart-title: - (setq par-title token) - (setq token nil) - (setq state 'need-label)) - ('Legends: - (setq par-legends (reverse (cons token par-legends))) - (setq token nil) - (setq state '(accept '| symbol))) - ('Google-chart-raw: - (setq par-google-raw token) - (setq token nil) - (setq state '(accept '| symbol))) - (t (error "internal error, current-label=%s, state=%s" current-label state)))) - ;; Output file - ((equal state '(accept file-name)) - (unless (stringp token) - (throw 'problems "Expected file name string")) - (assert (eq current-label 'Output-file:)) - (setq par-output-file token) - (setq token nil) - (setq state 'need-label)) - ;; Numbers - ((equal state '(accept number)) - (unless (numberp token) - (throw 'problems "Expected number")) - (case current-label - ('Size: - (if (not par-size) - (progn - (setq par-size token) - (setq token nil) - (setq state '(accept number 'x 'X))) - (setq par-size (cons par-size token)) - (setq token nil) - (setq state 'need-label))) - ('Data: - ;;(assert (not par-data-temp)) - (setq par-data-temp (cons token par-data-temp)) - (setq token nil) - (setq state '(accept number ', '| symbol)) - ) - (t (error "internal error, state=%s, current-label=%s" state current-label))) - ) - ;; Numbers or | - ((equal state '(accept number ', '| symbol)) - (if (numberp token) - (progn - (setq par-data-temp (cons token par-data-temp)) - (setq token nil)) - (if (eq ', token) + (setq pos-state state) + (setq token-before-pos (point)) + (condition-case err + (setq token (read (current-buffer))) + (error + (if (eq (car err) 'end-of-file) + (unless (or (eq state 'need-label) + (member '(quote |) state)) + (throw 'problems (format "Unexpected end, state=%s" state))) + (throw 'problems + (error-message-string err))))))) + (message "token=%s, label=%s, state=%s" token current-label state) + (when (and want-pos-state + (>= (point) want-pos-state)) + (when (= (point) want-pos-state) + ;; right after item + (setq pos-state nil)) + (goto-char here) + (throw 'pos-state pos-state)) + (when (and (listp state) (memq 'number state)) + (unless (numberp token) + (save-match-data + (let ((token-str (format "%s" token))) + (setq token-str (replace-regexp-in-string "\\([0-9]\\),\\([0-9]\\)" "\\1\\2" token-str)) + (when (string-match-p "^[0-9]+$" token-str) + (setq token (string-to-number token-str))))))) + (cond ;; state + ;; Label + ((eq state 'need-label) + (unless (symbolp token) + (throw 'problems (format "Expected label, got %s" token))) + (unless (member (symbol-name token) + (append chart-mode-keywords + chart-extra-keywords + chart-raw-keywords + nil)) + (throw 'problems (format "Unknown label %s" token))) + (when (member (symbol-name token) found-labels) + (throw 'problems (format "Label %s defined twice" token))) + (setq current-label token) + (setq found-labels (cons current-label found-labels)) + (setq token nil) + ;;(setq state 'need-value) + (case current-label + ('Output-file: + (setq state '(accept file-name))) + ('Size: + (setq state '(accept number))) + ('Data: + (setq state '(accept number))) + ('Type: + (setq state '(accept chart-type))) + ('Chart-title: + (setq state '(accept string))) + ('Legends: + (setq state '(accept string))) + ('Google-chart-raw: + (setq state '(accept string))) + )) + ;;;; Values + ;; Alt + ((equal state '(accept '| symbol)) + (if (eq '| token) + (case current-label + ('Legends: (setq token nil) - (if (or (eq '| token) - (symbolp token)) - (progn - (unless par-data-temp - (throw 'problems "Empty data set")) - (setq par-data (cons (list (reverse par-data-temp)) par-data)) - (setq par-data-temp nil) - (if (not (eq '| token)) - (setq state 'need-label) - (setq state '(accept number)) - (setq token nil))) - (throw 'problems "Expected | or EOF") - )))) - ;; Numbers or x/X - ((equal state '(accept number 'x 'X)) - (assert (eq current-label 'Size:)) - (let ((is-n (numberp token)) - (is-x (memq token '(x X)))) - (unless (or is-n is-x) - (throw 'problems "Expected X or number")) - (if is-x + (setq state '(accept string))) + (t (error "internal error, current-label=%s, state=%s" current-label state))) + (if (symbolp token) + (progn + ;;(setq token nil) + (setq state 'need-label)) + (throw 'problems (format "Expected | or label, got %s" token))))) + ;; Strings + ((equal state '(accept string)) + (unless (stringp token) + (throw 'problems "Expected string")) + (case current-label + ('Chart-title: + (setq par-title token) + (setq token nil) + (setq state 'need-label)) + ('Legends: + (setq par-legends (cons token par-legends)) + (setq token nil) + (setq state '(accept '| symbol))) + ('Google-chart-raw: + (setq par-google-raw token) + (setq token nil) + (setq state 'need-label)) + (t (error "internal error, current-label=%s, state=%s" current-label state)))) + ;; Output file + ((equal state '(accept file-name)) + (unless (stringp token) + (throw 'problems "Expected file name string")) + (assert (eq current-label 'Output-file:)) + (setq par-output-file token) + (setq token nil) + (setq state 'need-label)) + ;; Numbers + ((equal state '(accept number)) + (unless (numberp token) + (throw 'problems "Expected number")) + (case current-label + ('Size: + (if (not par-size) (progn + (setq par-size token) (setq token nil) - (setq state '(accept number))) + (setq state '(accept number 'x 'X))) (setq par-size (cons par-size token)) (setq token nil) - (setq state 'need-label)))) - ;; Chart type - ((equal state '(accept chart-type)) - (setq par-type token) - (unless (assoc par-type chart-types) - (throw 'problems (format "Unknown chart type: %s" par-type))) - (setq token nil) - (setq state 'need-label)) - (t (error "internal error, state=%s" state)))))) - ;; fix-me here - - nil))) + (setq state 'need-label))) + ('Data: + ;;(assert (not par-data-temp)) + (setq par-data-temp (cons token par-data-temp)) + (setq par-data-min token) + (setq par-data-max token) + (setq token nil) + (setq state '(accept number ', '| symbol)) + ) + (t (error "internal error, state=%s, current-label=%s" state current-label))) + ) + ;; Numbers or | + ((equal state '(accept number ', '| symbol)) + (if (numberp token) + (progn + (setq par-data-min (if par-data-min (min par-data-min token) token)) + (setq par-data-max (if par-data-max (max par-data-max token) token)) + (setq par-data-temp (cons token par-data-temp)) + (message "par-data-min/max=%s/%s, token=%s -- %s" par-data-min par-data-max token par-data-temp) + (setq token nil)) + (if (eq ', token) + (setq token nil) + (if (or (eq '| token) + (symbolp token)) + (progn + (unless par-data-temp + (throw 'problems "Empty data set")) + (setq par-data (cons (list (reverse par-data-temp) (cons par-data-min par-data-max)) par-data)) + (setq par-data-temp nil) + (setq par-data-min nil) + (setq par-data-max nil) + (if (not (eq '| token)) + (setq state 'need-label) + (setq state '(accept number)) + (setq token nil))) + (throw 'problems "Expected | or EOF") + )))) + ;; Numbers or x/X + ((equal state '(accept number 'x 'X)) + (assert (eq current-label 'Size:)) + (let ((is-n (numberp token)) + (is-x (memq token '(x X)))) + (unless (or is-n is-x) + (throw 'problems "Expected X or number")) + (if is-x + (progn + (setq token nil) + (setq state '(accept number))) + (setq par-size (cons par-size token)) + (setq token nil) + (setq state 'need-label)))) + ;; Chart type + ((equal state '(accept chart-type)) + (setq par-type token) + (unless (assoc par-type chart-types) + (throw 'problems (format "Unknown chart type: %s" par-type))) + (setq token nil) + (setq state 'need-label)) + (t (error "internal error, state=%s" state)))))) + ;; fix-me here + + nil))) (when want-pos-state (goto-char here) (throw 'pos-state state)) @@ -611,10 +674,12 @@ be a list (nth 0 problems) token-before-pos))) (goto-char where) - (message msg)) + (skip-chars-forward " \t") + (error msg)) (goto-char here) ;;(defun chart-create (out-file provider size data type &rest extras) (setq par-provider 'google) + (setq par-legends (nreverse par-legends)) (let ((extras nil)) (when par-google-raw (setq extras (cons (cons 'GOOGLE-RAW par-google-raw) extras))) @@ -622,12 +687,131 @@ be a list par-data par-type par-title par-legends extras)) nil))) +;;;###autoload (defun chart-make-chart () + "Try to make a new chart. +If region is active then make a new chart from data in the +selected region. + +Else if current buffer is in `chart-mode' then do it from the +chart specifications in this buffer. Otherwise create a new +buffer and initialize it with `chart-mode'. + +If the chart specifications are complete enough to make a chart +then do it and show the resulting chart image. If not then tell +user what is missing. + +NOTE: This is beta, no alpha code. It is not ready. + +Below are some examples. To test them mark an example and do + + M-x chart-make-chart + +* Example, simple x-y chart: + + Output-file: \"~/temp-chart.png\" + Size: 200 200 + Data: 3 8 5 | 10 20 30 + Type: line-chart-xy + +* Example, pie: + + Output-file: \"~/temp-depression.png\" + Size: 400 200 + Data: + 2,160,000 + 3,110,000 + 1,510,000 + 73,600 + 775,000 + 726,000 + 8,180,000 + 419,000 + Type: pie-3-dimensional + Chart-title: \"Depression hits on Google\" + Legends: + \"SSRI\" + | \"Psychotherapy\" + | \"CBT\" + | \"IPT\" + | \"Psychoanalysis\" + | \"Mindfulness\" + | \"Meditation\" + | \"Exercise\" + + +* Example, pie: + + Output-file: \"~/temp-panic.png\" + Size: 400 200 + Data: + 979,000 + 969,000 + 500,000 + 71,900 + 193,000 + 154,000 + 2,500,000 + 9,310,000 + Type: pie-3-dimensional + Chart-title: \"Depression hits on Google\" + Legends: + \"SSRI\" + | \"Psychotherapy\" + | \"CBT\" + | \"IPT\" + | \"Psychoanalysis\" + | \"Mindfulness\" + | \"Meditation\" + | \"Exercise\" + + +* Example using raw: + + Output-file: \"~/temp-chart-slipsen-kostar.png\" + Size: 400 130 + Data: 300 1000 30000 + Type: bar-chart-horizontal + Chart-title: \"Vad killen i slips tjänar jämfört med dig och mig\" + Google-chart-raw: \"&chds=0,30000&chco=00cd00|ff4500|483d8b&chxt=y,x&chxl=0:|Killen+i+slips|Partiledarna|Du+och+jag&chf=bg,s,ffd700\" + + +" (interactive) + (if mark-active + (let* ((rb (region-beginning)) + (re (region-end)) + (data (buffer-substring-no-properties rb re)) + (buf (generate-new-buffer "*Chart from region*"))) + (switch-to-buffer buf) + (insert data) + (chart-mode)) + (unless (eq major-mode 'chart-mode) + (switch-to-buffer (generate-new-buffer "*Chart*")) + (chart-mode))) (chart-get-state nil)) +;; (defun chart-from-region (min max) +;; "Try to make a new chart from data in selected region. +;; See `chart-mode' for examples you can test with this function." +;; (interactive "r") +;; (unless mark-active (error "No region selected")) +;; (let* ((rb (region-beginning)) +;; (re (region-end)) +;; (data (buffer-substring-no-properties rb re)) +;; (buf (generate-new-buffer "*Chart from region*"))) +;; (switch-to-buffer buf) +;; (insert data) +;; (chart-mode) +;; (chart-get-state nil))) + (define-derived-mode chart-mode fundamental-mode "Chart" - "Mode for specifying charts." + "Mode for specifying charts. +\\{chart-mode-map} + +To make a chart see `chart-make-chart'. + +" (set (make-local-variable 'font-lock-defaults) chart-font-lock-defaults) (set (make-local-variable 'comment-start) ";") ;; Look within the line for a ; following an even number of backslashes @@ -642,17 +826,18 @@ be a list (set (make-local-variable 'comment-use-global-state) t) (set-syntax-table chart-mode-syntax-table) (when (looking-at (rx buffer-start (0+ whitespace) buffer-end)) - (insert ";; Type C-c C-c to make a chart\n")) + (insert ";; Type C-c C-c to make a chart, M-Tab to complete\n")) (let ((missing (chart-missing-keywords))) (when missing (save-excursion (goto-char (point-max)) (dolist (miss missing) - (insert "\n\n" miss)))))) + (insert "\n" miss " ")))))) ;; Tests -;;(chart-create 'google "temp.png" '(200 . 150) '(((90 70) . nil)) 'p3 '(colors "FFFFFF" "00FF00")) +;;(chart-create 'google "temp.png" '(200 . 150) '(((90 70) . nil)) 'pie-3-dimensional "test title" nil '((colors "FFFFFF" "00FF00"))) +;; Fix-me (add-to-list 'auto-mode-alist '("\\.mx-chart\\'" . chart-mode)) (provide 'chart) diff --git a/elpa-to-submit/nxhtml/util/color-test-sent.el b/elpa-to-submit/nxhtml/util/color-test-sent.el deleted file mode 100644 index b8142afd7f..0000000000 --- a/elpa-to-submit/nxhtml/util/color-test-sent.el +++ /dev/null @@ -1,149 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; For wid-edit.el - -(defun widget-color-validate (widget) - (let ((value (widget-value widget))) - (unless - ;; Drews suggestion is to use display-color-p instead, but - ;; unfortunately this does not match #rgb: - ;;(display-color-p value) - (color-defined-p value) - (widget-put widget :error (format "Invalid color: %S" value)) - widget))) - -(defun widget-color-match (widget value) - (and (stringp value) - (color-defined-p value))) - -(define-widget 'color 'string - "Choose a color (with sample)." - :format "%{%t%}: %v (%{sample%})\n" - :size 30 - :tag "Color" - :match 'widget-color-match - :validate 'widget-color-validate - :value "black" - :complete 'widget-color-complete - :sample-face-get 'widget-color-sample-face-get - :notify 'widget-color-notify - :action 'widget-color-action) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; For custom.el - -;; Borrowed from `set-variable'. It might be useful in -;; `custom-variable-type': -(defun custom-get-type (variable) - "Get the :type declaration used when creating custom VARIABLE." - (and (custom-variable-p variable) - (not (get variable 'custom-type)) - (custom-load-symbol variable)) - (get variable 'custom-type)) - -;; external values = those stored in the variables -;; internal values = those shown in "buffer widgets" - -;; This function tests the same way `set-variable' does it. However -;; `set-variable' also does (require 'cus-edit), shouldn't that be -;; (require 'wid-edit)? -(defun custom-type-value-p (value custom-type) - "Return non-nil if VALUE matches CUSTOM-TYPE. -CUSTOM-TYPE could be anything that can be used for the :type -keyword in `defcustom'. - -See `custom-get-type' for how to get CUSTOM-TYPE from a -custom variable." - (require 'wid-edit) ;; for widget-convert, but why is not that in widget.el? - (let* ((widget (widget-convert custom-type))) - (widget-apply widget :match value))) - - ;;(match-fun (widget-get widget :match)) - ;;(valid-fun (widget-get widget :validate)) -;; (if nil ;(listp custom-type) -;; ;; Fix-me: Some type of conversion of the list must be -;; ;; done. And it actually looks like :validate must be -;; ;; used. Otherwise the children here get called with the -;; ;; :match and that does nothing for simple type. (What is -;; ;; match actually useful for??) -;; (progn -;; (widget-apply widget :match value) -;; ) -;; (let ((int-val (widget-apply widget :value-to-internal value))) -;; (widget-put widget :value int-val) -;; (with-current-buffer (get-buffer-create "temp dummy") -;; (lwarn t :warning "result=%s" (widget-choice-value-create widget))) -;; ;;(null (widget-apply widget :validate)) -;; )))) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Tests - -;; (custom-type-value-p "something" 'color) -;; (custom-type-value-p "#f" 'color) -;; (custom-type-value-p "#fff" 'color) -;; (custom-type-value-p "red" 'color) -;; (custom-get-type 'test-color) -;; (setq test-color "bla") -;; (setq test-color "black") - -(defcustom test-color "red" - "color test" - :type 'color) - -;; (customize-option 'test-color) -;; (custom-get-type 'test-more) -;; (custom-type-value-p "something" (custom-get-type 'test-more)) -;; (custom-type-value-p "some[" (custom-get-type 'test-more)) -;; (custom-type-value-p 10 (custom-get-type 'test-more)) -;; (custom-type-value-p 1.0 (custom-get-type 'test-more)) -(defcustom test-more "b[" - "choice and regexp text" - :type '(choice (integer) - (regexp))) - - -;; (custom-get-type 'ks-test7) -;; (custom-type-value-p ks-test7 'key-sequence) - - -(defcustom ks-test7 - [(control ?a) ?2] - "" - :type 'key-sequence - ) - -(defcustom ks-test8 - [(control ?a) ?2] - "testing internal/external with a choice" - :type '(choice (key-sequence) - (color)) - ) -;; (customize-option 'ks-test8) -;; (custom-get-type 'ks-test8) -;; (setq ks-test8 [(control ?a) ?2]) -;; (setq ks-test8 "reda") -;; (setq ks-test8 8) -;; (custom-type-value-p ks-test8 'key-sequence) -;; (custom-type-value-p ks-test8 (custom-get-type 'ks-test8)) - - -;; (insert (format "%S" (symbol-plist 'ks-test8))) -;; (standard-value ([(control 97) 50]) -;; variable-documentation "testing internal/external with a choice" -;; custom-type (choice (key-sequence) (color)) -;; custom-requests nil -;; backup-value (8) -;; variable-comment nil -;; customized-value nil -;; customized-variable-comment nil) - -(defun test8 () - (let ((widget (widget-convert (custom-get-type 'ks-test8)))) - (widget-choice-match widget ks-test8) - (widget-choice-match widget 8) - (widget-apply widget :match 8) - (widget-apply widget :match ks-test8) - )) -;; (test8) diff --git a/elpa-to-submit/nxhtml/util/color-test.el b/elpa-to-submit/nxhtml/util/color-test.el deleted file mode 100644 index 47b9c8056c..0000000000 --- a/elpa-to-submit/nxhtml/util/color-test.el +++ /dev/null @@ -1,154 +0,0 @@ - -(defun color-digits-p (color) - (save-match-data - (string-match (rx bos - "#" - (1+ (repeat 3 3 hex-digit)) - eos) - color))) - -(defun widget-color-validate (widget) - (let ((value (widget-value widget))) - (unless (color-defined-p value) - (widget-put widget :error (format "Invalid color: %S" value)) - widget))) - -(define-widget 'color 'editable-field - "Choose a color (with sample)." - :format "%{%t%}: %v (%{sample%})\n" - :size 30 - :tag "Color" - :validate 'widget-color-validate - :value "black" - :complete 'widget-color-complete - :sample-face-get 'widget-color-sample-face-get - :notify 'widget-color-notify - :action 'widget-color-action) - -(defun custom-type-is-super (super-type base-type) - (unless (get super-type 'widget-type) (error "Not a widget type: %s" super-type)) - (unless (get base-type 'widget-type) (error "Not a widget type: %s" base-type)) - (let ((found nil) - (type super-type)) - (while (and (not found) type) - (setq found (eq type base-type)) - (unless found - (setq type (car (get type 'widget-type))))) - found)) -;; (custom-type-simple-is-super 'color 'string) -;; (custom-type-simple-is-super 'color 'editable-field) - -(defun custom-type-symbol-p (symbol custom-type) - "Return t if value of SYMBOL should fit CUSTOM-TYPE." - (let ((found nil) - (type (get symbol 'custom-type))) - ;; Fix-me: How should different things that are not directly - ;; value-related be handled? - (while (and (not found) type) - (setq found (equal type custom-type)) - (unless nil ;found - (if (symbolp type) - (setq found (custom-type-simple-is-super type custom-type)) - (unless (symbolp custom-type) - (let ((symbol-comp-type (car type)) - (symbol-childs (cdr type)) - (custom-comp-type (car custom-type)) - (custom-childs (cdr custom-type))) - (setq found - (and (eq symbol-comp-type custom-comp-type) - (let ((ok t)) - (while (and ok symbol-childs custom-childs) - (setq ok (custom-type-symbol-p (caar symbol-childs) (caar custom-childs))) - (setq symbol-childs (cdr symbol-childs)) - (setq custom-childs (cdr custom-childs))) - ok))) - ))))) - found)) - -;; (custom-type-p 'test-color 'color) -;; (custom-type-symbol-p 'bar (get 'bar 'custom-type)) -;; (custom-type-value-p bar (get 'bar 'custom-type)) -;; (custom-type-value-p "b" (get 'bar 'custom-type)) -;; (custom-type-value-p 10 (get 'bar 'custom-type)) -;; (custom-type-value-p 'b (get 'bar 'custom-type)) - -;;(insert (format "%S" (symbol-plist 'bar))) -;;(standard-value ("b") variable-documentation "yyyyyyy" custom-type (choice (integer :tag "WWWWWWWWW") (string :tag "ZZZZZZZZZZZZZ")) custom-requests nil) - -;; (custom-get-type 'bar) -;; (defvar bar-var 'bar) -;; (custom-get-type bar-var) -;; (custom-get-type 'bar-var) -;; (custom-variable-p bar) -;; (custom-variable-type 'bar) -;; (custom-variable-type bar-var) -;; (custom-variable-type 'bar-var) - -;; Borrowed from `set-variable'. It might be useful in -;; `custom-variable-type': -(defun custom-get-type (variable) - "Get the :type declaration from custom VARIABLE." - (and (custom-variable-p variable) - (not (get variable 'custom-type)) - (custom-load-symbol variable)) - (get variable 'custom-type)) - -;; This function tests the same way as `set-variable' does and could -;; be used there. However `set-variable' does (require 'cus-edit), -;; shouldn't that be (require 'wid-edit)? -(defun custom-type-value-p (value custom-type) - "Return non-nil if VALUE matches CUSTOM-TYPE. -CUSTOM-TYPE could be anything that can be used for the :type -keyword in `defcustom'. - -See `custom-get-type' for how to get CUSTOM-TYPE form a -custom variable." - (require 'wid-edit) - (let ((widget (widget-convert custom-type))) - (widget-apply widget :match value))) - -(defun custom-type-p (val-or-sym custom-type) - "Return non-nil if VAL-OR-SYM fits CUSTOM-TYPE. -VAL-OR-SYM may be either a variable or a symbol. If it is a -variable then return non-nil if the value fits custom type -CUSTOM-TYPE. - -If it is a symbol then return non-nil if the values this symbol's -variable can have fits CUSTOM-TYPE." - (if (symbolp val-or-sym) - (custom-type-symbol-p val-or-sym custom-type) - (custom-type-value-p val-or-sym custom-type))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Tests - -;; (custom-type-p 'test-color 'color) -;; (custom-type-p 'test-color 'edit) -;; (custom-type-p 'test-color 'editable-field) -;; (custom-type-p test-color 'color) -;; (get 'test-color 'custom-type) -;; (setq test-color "bla") -;; (setq test-color "black") - -(defcustom test-color "black" - "color test" - :type 'color) - -(defun max-color-length() - (let ((len 0) - (longest "")) - (mapc (lambda (color) - (when (< len (length color)) - (setq len (length color)) - (setq longest color))) - x-colors) - (cons len longest))) -;; (max-color-length) - -(defcustom bar "b[" "yyyyyyy" - :type '(choice (integer :tag "WWWWWWWWW") - (regexp :tag "ZZZZZZZZZZZZZ"))) - -;; (custom-type-symbol-p 'bar (get 'bar 'custom-type)) - - diff --git a/elpa-to-submit/nxhtml/util/company-mode/README.txt b/elpa-to-submit/nxhtml/util/company-mode/README.txt new file mode 100644 index 0000000000..af3d7f5f51 --- /dev/null +++ b/elpa-to-submit/nxhtml/util/company-mode/README.txt @@ -0,0 +1 @@ +This is a temporary copy for my changes of company-mode. diff --git a/elpa-to-submit/nxhtml/util/company-mode/company-abbrev.el b/elpa-to-submit/nxhtml/util/company-mode/company-abbrev.el new file mode 100644 index 0000000000..89d87a6eab --- /dev/null +++ b/elpa-to-submit/nxhtml/util/company-mode/company-abbrev.el @@ -0,0 +1,43 @@ +;;; company-abbrev.el --- a company-mode completion back-end for abbrev +;; +;; Copyright (C) 2009 Nikolaj Schumacher +;; +;; This file is part of company 0.4.3. +;; +;; This program 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 +;; of the License, or (at your option) any later version. +;; +;; This program 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 this program. If not, see . + +(require 'company) +(eval-when-compile (require 'cl)) +(require 'abbrev) + +(defun company-abbrev-insert (match) + "Replace MATCH with the expanded abbrev." + (expand-abbrev)) + +;;;###autoload +(defun company-abbrev (command &optional arg &rest ignored) + "A `company-mode' completion back-end for abbrev." + (interactive (list 'interactive)) + (case command + ('interactive (company-begin-backend 'company-abbrev + 'company-abbrev-insert)) + ('prefix (company-grab-symbol)) + ('candidates (nconc + (delete "" (all-completions arg global-abbrev-table)) + (delete "" (all-completions arg local-abbrev-table)))) + ('meta (abbrev-expansion arg)) + ('require-match t))) + +(provide 'company-abbrev) +;;; company-abbrev.el ends here diff --git a/elpa-to-submit/nxhtml/util/company-mode/company-autoloads.el b/elpa-to-submit/nxhtml/util/company-mode/company-autoloads.el new file mode 100644 index 0000000000..b9f4010727 --- /dev/null +++ b/elpa-to-submit/nxhtml/util/company-mode/company-autoloads.el @@ -0,0 +1,229 @@ +;;; company-autoloads.el --- automatically extracted autoloads +;; +;;; Code: + + +;;;### (autoloads (company-mode) "company" "company.el" (19036 64075)) +;;; Generated autoloads from company.el + +(autoload 'company-mode "company" "\ +\"complete anything\"; in in-buffer completion framework. +Completion starts automatically, depending on the values +`company-idle-delay' and `company-minimum-prefix-length'. + +Completion can be controlled with the commands: +`company-complete-common', `company-complete-selection', `company-complete', +`company-select-next', `company-select-previous'. If these commands are +called before `company-idle-delay', completion will also start. + +Completions can be searched with `company-search-candidates' or +`company-filter-candidates'. These can be used while completion is +inactive, as well. + +The completion data is retrieved using `company-backends' and displayed using +`company-frontends'. If you want to start a specific back-end, call it +interactively or use `company-begin-backend'. + +regular keymap (`company-mode-map'): + +\\{company-mode-map} +keymap during active completions (`company-active-map'): + +\\{company-active-map} + +\(fn &optional ARG)" t nil) + +;;;*** + +;;;### (autoloads (company-abbrev) "company-abbrev" "company-abbrev.el" +;;;;;; (19036 64074)) +;;; Generated autoloads from company-abbrev.el + +(autoload 'company-abbrev "company-abbrev" "\ +A `company-mode' completion back-end for abbrev. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-css) "company-css" "company-css.el" (19036 +;;;;;; 64074)) +;;; Generated autoloads from company-css.el + +(autoload 'company-css "company-css" "\ +A `company-mode' completion back-end for `css-mode'. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-dabbrev) "company-dabbrev" "company-dabbrev.el" +;;;;;; (19036 64074)) +;;; Generated autoloads from company-dabbrev.el + +(autoload 'company-dabbrev "company-dabbrev" "\ +A dabbrev-like `company-mode' completion back-end. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-dabbrev-code) "company-dabbrev-code" "company-dabbrev-code.el" +;;;;;; (19036 64074)) +;;; Generated autoloads from company-dabbrev-code.el + +(autoload 'company-dabbrev-code "company-dabbrev-code" "\ +A dabbrev-like `company-mode' back-end for code. +The back-end looks for all symbols in the current buffer that aren't in +comments or strings. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-elisp) "company-elisp" "company-elisp.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-elisp.el + +(autoload 'company-elisp "company-elisp" "\ +A `company-mode' completion back-end for `emacs-lisp-mode'. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-etags) "company-etags" "company-etags.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-etags.el + +(autoload 'company-etags "company-etags" "\ +A `company-mode' completion back-end for etags. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-files) "company-files" "company-files.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-files.el + +(autoload 'company-files "company-files" "\ +a `company-mode' completion back-end existing file names. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-gtags) "company-gtags" "company-gtags.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-gtags.el + +(autoload 'company-gtags "company-gtags" "\ +A `company-mode' completion back-end for GNU Global. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-ispell) "company-ispell" "company-ispell.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-ispell.el + +(autoload 'company-ispell "company-ispell" "\ +A `company-mode' completion back-end using ispell. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-keywords) "company-keywords" "company-keywords.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-keywords.el + +(autoload 'company-keywords "company-keywords" "\ +A `company-mode' back-end for programming language keywords. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-nxml) "company-nxml" "company-nxml.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-nxml.el + +(autoload 'company-nxml "company-nxml" "\ +A `company-mode' completion back-end for `nxml-mode'. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-oddmuse) "company-oddmuse" "company-oddmuse.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-oddmuse.el + +(autoload 'company-oddmuse "company-oddmuse" "\ +A `company-mode' completion back-end for `oddmuse-mode'. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-pysmell) "company-pysmell" "company-pysmell.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-pysmell.el + +(autoload 'company-pysmell "company-pysmell" "\ +A `company-mode' completion back-end for pysmell. +This requires pysmell.el and pymacs.el. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-semantic) "company-semantic" "company-semantic.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-semantic.el + +(autoload 'company-semantic "company-semantic" "\ +A `company-mode' completion back-end using CEDET Semantic. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-tempo) "company-tempo" "company-tempo.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-tempo.el + +(autoload 'company-tempo "company-tempo" "\ +A `company-mode' completion back-end for tempo. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads (company-xcode) "company-xcode" "company-xcode.el" +;;;;;; (19036 64075)) +;;; Generated autoloads from company-xcode.el + +(autoload 'company-xcode "company-xcode" "\ +A `company-mode' completion back-end for Xcode projects. + +\(fn COMMAND &optional ARG &rest IGNORED)" t nil) + +;;;*** + +;;;### (autoloads nil nil ("company-eclim.el" "company-pkg.el" "company-ropemacs.el") +;;;;;; (19036 64075 906000)) + +;;;*** + +(provide 'company-autoloads) +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; coding: utf-8 +;; End: +;;; company-autoloads.el ends here diff --git a/elpa-to-submit/nxhtml/util/company-mode/company-css.el b/elpa-to-submit/nxhtml/util/company-mode/company-css.el new file mode 100644 index 0000000000..cff27ab7e1 --- /dev/null +++ b/elpa-to-submit/nxhtml/util/company-mode/company-css.el @@ -0,0 +1,355 @@ +;;; company-css.el --- a company-mode completion back-end for css-mode +;; +;; Copyright (C) 2009 Nikolaj Schumacher +;; +;; This file is part of company 0.4.3. +;; +;; This program 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 +;; of the License, or (at your option) any later version. +;; +;; This program 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 this program. If not, see . + +(require 'company) +(eval-when-compile (require 'cl)) + +(defconst company-css-property-alist + ;; see http://www.w3.org/TR/CSS21/propidx.html + '(("azimuth" angle "left-side" "far-left" "left" "center-left" "center" + "center-right" "right" "far-right" "right-side" "behind" "leftwards" + "rightwards") + ("background" background-color background-image background-repeat + background-attachment background-position) + ("background-attachment" "scroll" "fixed") + ("background-color" color "transparent") + ("background-image" uri "none") + ("background-position" percentage length "left" "center" "right" percentage + length "top" "center" "bottom" "left" "center" "right" "top" "center" + "bottom") + ("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat") + ("border" border-width border-style border-color) + ("border-bottom" border) + ("border-bottom-color" border-color) + ("border-bottom-style" border-style) + ("border-bottom-width" border-width) + ("border-collapse" "collapse" "separate") + ("border-color" color "transparent") + ("border-left" border) + ("border-left-color" border-color) + ("border-left-style" border-style) + ("border-left-width" border-width) + ("border-right" border) + ("border-right-color" border-color) + ("border-right-style" border-style) + ("border-right-width" border-width) + ("border-spacing" length length) + ("border-style" border-style) + ("border-top" border) + ("border-top-color" border-color) + ("border-top-style" border-style) + ("border-top-width" border-width) + ("border-width" border-width) + ("bottom" length percentage "auto") + ("caption-side" "top" "bottom") + ("clear" "none" "left" "right" "both") + ("clip" shape "auto") + ("color" color) + ("content" "normal" "none" string uri counter "attr()" "open-quote" + "close-quote" "no-open-quote" "no-close-quote") + ("counter-increment" identifier integer "none") + ("counter-reset" identifier integer "none") + ("cue" cue-before cue-after) + ("cue-after" uri "none") + ("cue-before" uri "none") + ("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize" + "ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize" + "w-resize" "text" "wait" "help" "progress") + ("direction" "ltr" "rtl") + ("display" "inline" "block" "list-item" "run-in" "inline-block" "table" + "inline-table" "table-row-group" "table-header-group" "table-footer-group" + "table-row" "table-column-group" "table-column" "table-cell" + "table-caption" "none") + ("elevation" angle "below" "level" "above" "higher" "lower") + ("empty-cells" "show" "hide") + ("float" "left" "right" "none") + ("font" font-style font-variant font-weight font-size "/" line-height + font-family "caption" "icon" "menu" "message-box" "small-caption" + "status-bar") + ("font-family" family-name generic-family) + ("font-size" absolute-size relative-size length percentage) + ("font-style" "normal" "italic" "oblique") + ("font-variant" "normal" "small-caps") + ("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400" + "500" "600" "700" "800" "900") + ("height" length percentage "auto") + ("left" length percentage "auto") + ("letter-spacing" "normal" length) + ("line-height" "normal" number length percentage) + ("list-style" list-style-type list-style-position list-style-image) + ("list-style-image" uri "none") + ("list-style-position" "inside" "outside") + ("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero" + "lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin" + "armenian" "georgian" "lower-alpha" "upper-alpha" "none") + ("margin" margin-width) + ("margin-bottom" margin-width) + ("margin-left" margin-width) + ("margin-right" margin-width) + ("margin-top" margin-width) + ("max-height" length percentage "none") + ("max-width" length percentage "none") + ("min-height" length percentage) + ("min-width" length percentage) + ("orphans" integer) + ("outline" outline-color outline-style outline-width) + ("outline-color" color "invert") + ("outline-style" border-style) + ("outline-width" border-width) + ("overflow" "visible" "hidden" "scroll" "auto") + ("padding" padding-width) + ("padding-bottom" padding-width) + ("padding-left" padding-width) + ("padding-right" padding-width) + ("padding-top" padding-width) + ("page-break-after" "auto" "always" "avoid" "left" "right") + ("page-break-before" "auto" "always" "avoid" "left" "right") + ("page-break-inside" "avoid" "auto") + ("pause" time percentage) + ("pause-after" time percentage) + ("pause-before" time percentage) + ("pitch" frequency "x-low" "low" "medium" "high" "x-high") + ("pitch-range" number) + ("play-during" uri "mix" "repeat" "auto" "none") + ("position" "static" "relative" "absolute" "fixed") + ("quotes" string string "none") + ("richness" number) + ("right" length percentage "auto") + ("speak" "normal" "none" "spell-out") + ("speak-header" "once" "always") + ("speak-numeral" "digits" "continuous") + ("speak-punctuation" "code" "none") + ("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster" + "slower") + ("stress" number) + ("table-layout" "auto" "fixed") + ("text-align" "left" "right" "center" "justify") + ("text-decoration" "none" "underline" "overline" "line-through" "blink") + ("text-indent" length percentage) + ("text-transform" "capitalize" "uppercase" "lowercase" "none") + ("top" length percentage "auto") + ("unicode-bidi" "normal" "embed" "bidi-override") + ("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle" + "bottom" "text-bottom" percentage length) + ("visibility" "visible" "hidden" "collapse") + ("voice-family" specific-voice generic-voice "*" specific-voice + generic-voice) + ("volume" number percentage "silent" "x-soft" "soft" "medium" "loud" + "x-loud") + ("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line") + ("widows" integer) + ("width" length percentage "auto") + ("word-spacing" "normal" length) + ("z-index" "auto" integer)) + "A list of CSS properties and their possible values.") + +(defconst company-css-value-classes + '((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large" + "xx-large") + (border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove" + "ridge" "inset" "outset") + (color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy" + "olive" "orange" "purple" "red" "silver" "teal" "white" "yellow") + (counter "counter(,)") + (family-name "Courier" "Helvetica" "Times") + (generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace") + (generic-voice "male" "female" "child") + (margin-width "auto") ;; length percentage + (relative-size "larger" "smaller") + (shape "rect(,,,)") + (uri "url()")) + "A list of CSS property value classes and their contents.") +;; missing, because not completable +;; +;;