diff options
author | Miles Bader <miles@gnu.org> | 2007-07-31 05:50:45 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-07-31 05:50:45 +0000 |
commit | 9899d01a0ccec166e04caa60657a44e614be50cd (patch) | |
tree | 6f7874938065fd9808765059213ff7a94ab3268b /lisp/progmodes | |
parent | 96157d113ae5828cc280488211610db1960d572c (diff) | |
parent | 2f12b713116a4e15b4744fc78d5f0dbb57fcd1ca (diff) | |
download | emacs-9899d01a0ccec166e04caa60657a44e614be50cd.tar.gz |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 824-838)
- Update from CVS
- Merge from emacs--rel--22
- Remove lisp/erc/erc-nicklist.el
- Update some .arch-inventory files
- Fix void function definition error in cus-edit.el
- Restore lisp/emacs-lisp/cl-loaddefs.el
* emacs--rel--22 (patch 70-83)
- Update from CVS
- Remove lisp/erc/erc-nicklist.el
- Update some .arch-inventory files
- Indicate that emacs--devo--0--patch-834 does not need to be applied
- Merge from gnus--rel--5.10
- Restore lisp/emacs-lisp/cl-loaddefs.el
* gnus--rel--5.10 (patch 239-241)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-28
Diffstat (limited to 'lisp/progmodes')
79 files changed, 844 insertions, 292 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 9581fd436b3..c9a69005eaf 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -13,7 +13,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/ada-prj.el b/lisp/progmodes/ada-prj.el index 10a5b670c54..7cff0158f8a 100644 --- a/lisp/progmodes/ada-prj.el +++ b/lisp/progmodes/ada-prj.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/ada-stmt.el b/lisp/progmodes/ada-stmt.el index 483a54df13b..a881753a0ab 100644 --- a/lisp/progmodes/ada-stmt.el +++ b/lisp/progmodes/ada-stmt.el @@ -3,12 +3,27 @@ ;; Copyright (C) 1987, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ;; 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -;; This file is part of GNU Emacs. - ;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert <ebert@waporo.muc.de> ;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org> ;; Keywords: languages, ada +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + ;;; Commentary: ;; This file is now automatically loaded from ada-mode.el, and creates a submenu ;; in Ada/ on the menu bar. diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index 9c239ee6dbb..e8db3d51c2a 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -13,7 +13,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 3b7a2015af5..7fbeeab6eea 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el index 3ca8c671e8c..d38e6170a23 100644 --- a/lisp/progmodes/asm-mode.el +++ b/lisp/progmodes/asm-mode.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index 1d08b094351..e01579917f6 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index f9e44d784f1..40dd3b5831e 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el @@ -18,7 +18,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index b3e0e381135..997e6c44f1a 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el index b2f793c0b1c..5a69df4e457 100644 --- a/lisp/progmodes/cc-bytecomp.el +++ b/lisp/progmodes/cc-bytecomp.el @@ -13,7 +13,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 079ebb02622..48fa7d99f5a 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -18,7 +18,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-compat.el b/lisp/progmodes/cc-compat.el index 07433b9630b..81739f5adf1 100644 --- a/lisp/progmodes/cc-compat.el +++ b/lisp/progmodes/cc-compat.el @@ -15,7 +15,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 8c10df649de..e932456fa91 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -18,7 +18,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 717016af7ea..44463a07f15 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -18,7 +18,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 0df09eda481..60bb3cfb977 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -13,7 +13,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 906cbfb19a7..c5d9c162520 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -18,7 +18,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -2875,6 +2875,14 @@ way." (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits)) (defconst c-emacs-variable-inits (cc-eval-when-compile c-emacs-variable-inits)) +;; Make the `c-lang-setvar' variables buffer local in the current buffer. +;; These are typically standard emacs variables such as `comment-start'. +(defmacro c-make-emacs-variables-local () + `(progn + ,@(mapcar (lambda (init) + `(make-local-variable ',(car init))) + (cdr c-emacs-variable-inits)))) + (defun c-make-init-lang-vars-fun (mode) "Create a function that initializes all the language dependent variables for the given mode. @@ -2898,6 +2906,7 @@ accomplish that conveniently." ;; that could be in the result from `cl-macroexpand-all'. (let ((c-buffer-is-cc-mode ',mode) current-var source-eval) + (c-make-emacs-variables-local) (condition-case err (if (eq c-version-sym ',c-version-sym) @@ -2956,6 +2965,7 @@ accomplish that conveniently." (init (append (cdr c-emacs-variable-inits) (cdr c-lang-variable-inits))) current-var) + (c-make-emacs-variables-local) (condition-case err (while init diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index 514945c269d..95359689b9f 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -17,7 +17,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index dcbcc618dca..8669a41c2f0 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -17,7 +17,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -154,21 +154,12 @@ (defun c-leave-cc-mode-mode () (setq c-buffer-is-cc-mode nil)) -;; Make the `c-lang-setvar' variables buffer local in the current buffer. -;; These are typically standard emacs variables such as `comment-start'. -(defmacro c-make-emacs-variables-local () - `(progn - ,@(mapcar (lambda (init) - `(make-local-variable ',(car init))) - (cdr c-emacs-variable-inits)))) - (defun c-init-language-vars-for (mode) "Initialize the language variables for one of the language modes directly supported by CC Mode. This can be used instead of the `c-init-language-vars' macro if the language you want to use is one of those, rather than a derived language defined through the language variable system (see \"cc-langs.el\")." - (c-make-emacs-variables-local) (cond ((eq mode 'c-mode) (c-init-language-vars c-mode)) ((eq mode 'c++-mode) (c-init-language-vars c++-mode)) ((eq mode 'objc-mode) (c-init-language-vars objc-mode)) diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 228269b67bf..c5b9b063812 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -18,7 +18,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-subword.el b/lisp/progmodes/cc-subword.el index a6a365d316b..68ecd3a0515 100644 --- a/lisp/progmodes/cc-subword.el +++ b/lisp/progmodes/cc-subword.el @@ -6,7 +6,7 @@ ;; 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) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; This program is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 8d28cba79ad..a80833c0043 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -18,7 +18,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 756979b3d78..06f464b29ce 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el index 03fb90d992c..4722f0ca4ae 100644 --- a/lisp/progmodes/cmacexp.el +++ b/lisp/progmodes/cmacexp.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 0c57e6f55b1..2710066c2cd 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -167,6 +167,10 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):[0-9]+:[0-9]+:\\)?\ \\( warning\\)?" 1 2 3 (4)) + (maven + ;; Maven is a popular build tool for Java. Maven is Free Software. + "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3) + (bash "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) @@ -1101,8 +1105,7 @@ Returns the compilation buffer created." (unless (getenv "EMACS") (list "EMACS=t")) (list "INSIDE_EMACS=t") - (copy-sequence process-environment))) - (start-process (symbol-function 'start-process))) + (copy-sequence process-environment)))) (set (make-local-variable 'compilation-arguments) (list command mode name-function highlight-regexp)) (set (make-local-variable 'revert-buffer-function) @@ -1123,22 +1126,14 @@ Returns the compilation buffer created." ;; comint uses `start-file-process'. (get-buffer-process (with-no-warnings - (comint-exec outbuf (downcase mode-name) - shell-file-name nil `("-c" ,command)))) - ;; Redefine temporarily `start-process' in order to - ;; handle remote compilation. - (fset 'start-process - (lambda (name buffer program &rest program-args) - (apply - (if (file-remote-p default-directory) - 'start-file-process - start-process) - name buffer program program-args))) - (unwind-protect - (start-process-shell-command (downcase mode-name) - outbuf command) - ;; Unwindform: Reset original definition of `start-process'. - (fset 'start-process start-process))))) + (comint-exec + outbuf (downcase mode-name) + (if (file-remote-p default-directory) + "/bin/sh" + shell-file-name) + `("-c" ,command)))) + (start-file-process-shell-command (downcase mode-name) + outbuf command)))) ;; Make the buffer's mode line show process state. (setq mode-line-process '(":%s")) (set-process-sentinel proc 'compilation-sentinel) @@ -2055,9 +2050,9 @@ The file-structure looks like this: ;; compilation-error-list) to point-min, but that was only meaningful for ;; the internal uses of compilation-forget-errors: all calls from external ;; packages seem to be followed by a move of compilation-parsing-end to - ;; something equivalent to point-max. So we speculatively move + ;; something equivalent to point-max. So we heuristically move ;; compilation-current-error to point-max (since the external package - ;; won't know that it should do it). --stef + ;; won't know that it should do it). --Stef (setq compilation-current-error nil) (let* ((proc (get-buffer-process (current-buffer))) (mark (if proc (process-mark proc))) @@ -2068,7 +2063,12 @@ The file-structure looks like this: ;; we need to put ours just before the insertion point rather ;; than at the insertion point. If that's not possible, then ;; don't use a marker. --Stef - (if (> pos (point-min)) (copy-marker (1- pos)) pos)))) + (if (> pos (point-min)) (copy-marker (1- pos)) pos))) + ;; Again, since this command is used in buffers that contain several + ;; compilations, to set the beginning of "this compilation", it's a good + ;; place to reset compilation-auto-jump-to-next. + (set (make-local-variable 'compilation-auto-jump-to-next) + compilation-auto-jump-to-first-error)) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.gcov\\'" . compilation-mode)) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index a07fb5ee44f..d1dc0e875c4 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 65ed00e6d6e..e85c4752412 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el index 8f710bf20bc..8ecf4119825 100644 --- a/lisp/progmodes/cwarn.el +++ b/lisp/progmodes/cwarn.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el index bdec1bf9ef4..887416f9069 100644 --- a/lisp/progmodes/dcl-mode.el +++ b/lisp/progmodes/dcl-mode.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el index 2402f48d7ea..99f03f8a545 100644 --- a/lisp/progmodes/delphi.el +++ b/lisp/progmodes/delphi.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify it under ;; the terms of the GNU General Public License as published by the Free -;; Software Foundation; either version 2, or (at your option) any later +;; Software Foundation; either version 3, or (at your option) any later ;; version. ;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY diff --git a/lisp/progmodes/ebnf-abn.el b/lisp/progmodes/ebnf-abn.el index 48de29808b6..44034bde3d5 100644 --- a/lisp/progmodes/ebnf-abn.el +++ b/lisp/progmodes/ebnf-abn.el @@ -6,13 +6,13 @@ ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Keywords: wp, ebnf, PostScript -;; Version: 1.1 +;; Version: 1.2 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -589,6 +589,12 @@ See documentation for variable `ebnf-abn-lex'." ;; close EPS file ((and ebnf-eps-executing (= (following-char) ?\])) (ebnf-eps-remove-context (ebnf-abn-eps-filename))) + ;; EPS header + ((and ebnf-eps-executing (= (following-char) ?H)) + (ebnf-eps-header-comment (ebnf-abn-eps-filename))) + ;; EPS footer + ((and ebnf-eps-executing (= (following-char) ?F)) + (ebnf-eps-footer-comment (ebnf-abn-eps-filename))) ;; any other action in comment (t (setq ebnf-action (aref ebnf-comment-table (following-char))) diff --git a/lisp/progmodes/ebnf-bnf.el b/lisp/progmodes/ebnf-bnf.el index 443e2c23cd5..8f6ecd99d24 100644 --- a/lisp/progmodes/ebnf-bnf.el +++ b/lisp/progmodes/ebnf-bnf.el @@ -6,13 +6,13 @@ ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Keywords: wp, ebnf, PostScript -;; Version: 1.9 +;; Version: 1.10 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -537,6 +537,12 @@ See documentation for variable `ebnf-bnf-lex'." ;; close EPS file ((and ebnf-eps-executing (= (following-char) ?\])) (ebnf-eps-remove-context (ebnf-bnf-eps-filename))) + ;; EPS header + ((and ebnf-eps-executing (= (following-char) ?H)) + (ebnf-eps-header-comment (ebnf-bnf-eps-filename))) + ;; EPS footer + ((and ebnf-eps-executing (= (following-char) ?F)) + (ebnf-eps-footer-comment (ebnf-bnf-eps-filename))) ;; any other action in comment (t (setq ebnf-action (aref ebnf-comment-table (following-char))) diff --git a/lisp/progmodes/ebnf-dtd.el b/lisp/progmodes/ebnf-dtd.el index f4c57ea2818..855dd3813b8 100644 --- a/lisp/progmodes/ebnf-dtd.el +++ b/lisp/progmodes/ebnf-dtd.el @@ -6,13 +6,13 @@ ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Keywords: wp, ebnf, PostScript -;; Version: 1.0 +;; Version: 1.1 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -1306,6 +1306,12 @@ See documentation for variable `ebnf-dtd-lex'." ;; close EPS file ((and ebnf-eps-executing (= (following-char) ?\])) (ebnf-eps-remove-context (ebnf-dtd-eps-filename))) + ;; EPS header + ((and ebnf-eps-executing (= (following-char) ?H)) + (ebnf-eps-header-comment (ebnf-dtd-eps-filename))) + ;; EPS footer + ((and ebnf-eps-executing (= (following-char) ?F)) + (ebnf-eps-footer-comment (ebnf-dtd-eps-filename))) ;; any other action in comment (t (setq ebnf-action (aref ebnf-comment-table (following-char)))) diff --git a/lisp/progmodes/ebnf-ebx.el b/lisp/progmodes/ebnf-ebx.el index d506e9cc54d..90acb3b0b0c 100644 --- a/lisp/progmodes/ebnf-ebx.el +++ b/lisp/progmodes/ebnf-ebx.el @@ -6,13 +6,13 @@ ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Keywords: wp, ebnf, PostScript -;; Version: 1.1 +;; Version: 1.2 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -539,6 +539,12 @@ See documentation for variable `ebnf-ebx-lex'." ;; close EPS file ((and ebnf-eps-executing (= (following-char) ?\])) (ebnf-eps-remove-context (ebnf-ebx-eps-filename))) + ;; EPS header + ((and ebnf-eps-executing (= (following-char) ?H)) + (ebnf-eps-header-comment (ebnf-ebx-eps-filename))) + ;; EPS footer + ((and ebnf-eps-executing (= (following-char) ?F)) + (ebnf-eps-footer-comment (ebnf-ebx-eps-filename))) ;; any other action in comment (t (setq ebnf-action (aref ebnf-comment-table (following-char)))) diff --git a/lisp/progmodes/ebnf-iso.el b/lisp/progmodes/ebnf-iso.el index 2e666328390..9b670b4dbfe 100644 --- a/lisp/progmodes/ebnf-iso.el +++ b/lisp/progmodes/ebnf-iso.el @@ -1,18 +1,18 @@ ;;; ebnf-iso.el --- parser for ISO EBNF ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 -;; Free Software Foundation, Inc. +;; Free Software Foundation, Inc. ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Keywords: wp, ebnf, PostScript -;; Version: 1.8 +;; Version: 1.9 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -504,6 +504,12 @@ See documentation for variable `ebnf-iso-lex'." ;; close EPS file ((and ebnf-eps-executing (= (following-char) ?\])) (ebnf-eps-remove-context (ebnf-iso-eps-filename))) + ;; EPS header + ((and ebnf-eps-executing (= (following-char) ?H)) + (ebnf-eps-header-comment (ebnf-iso-eps-filename))) + ;; EPS footer + ((and ebnf-eps-executing (= (following-char) ?F)) + (ebnf-eps-footer-comment (ebnf-iso-eps-filename))) ;; any other action in comment (t (setq ebnf-action (aref ebnf-comment-table (following-char)))) diff --git a/lisp/progmodes/ebnf-otz.el b/lisp/progmodes/ebnf-otz.el index bcf8032318c..c4f9fdcd8c1 100644 --- a/lisp/progmodes/ebnf-otz.el +++ b/lisp/progmodes/ebnf-otz.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/ebnf-yac.el b/lisp/progmodes/ebnf-yac.el index 5defea14d50..c1b00bdddfc 100644 --- a/lisp/progmodes/ebnf-yac.el +++ b/lisp/progmodes/ebnf-yac.el @@ -6,13 +6,13 @@ ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Keywords: wp, ebnf, PostScript -;; Version: 1.3 +;; Version: 1.4 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -459,6 +459,12 @@ See documentation for variable `ebnf-yac-lex'." ;; close EPS file ((and ebnf-eps-executing (= (following-char) ?\])) (ebnf-eps-remove-context (ebnf-yac-eps-filename))) + ;; EPS header + ((and ebnf-eps-executing (= (following-char) ?H)) + (ebnf-eps-header-comment (ebnf-yac-eps-filename))) + ;; EPS footer + ((and ebnf-eps-executing (= (following-char) ?F)) + (ebnf-eps-footer-comment (ebnf-yac-eps-filename))) ;; any other action in comment (t (setq ebnf-action (aref ebnf-comment-table (following-char)))) diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 55f61222796..be25293c643 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -1,19 +1,19 @@ ;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 -;; Free Software Foundation, Inc. +;; Free Software Foundation, Inc. ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> ;; Keywords: wp, ebnf, PostScript -;; Version: 4.3 +;; Version: 4.4 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -26,8 +26,8 @@ ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. -(defconst ebnf-version "4.3" - "ebnf2ps.el, v 4.3 <2006/09/26 vinicius> +(defconst ebnf-version "4.4" + "ebnf2ps.el, v 4.4 <2007/02/12 vinicius> Vinicius's last change version. When reporting bugs, please also report the version of Emacs, if any, that ebnf2ps was running with. @@ -448,6 +448,24 @@ Please send all bug fixes and enhancements to ;; `ebnf-eps-region' execution. ;; It's an error to try to close a not opened EPS file. ;; +;; ;Hheader generate a header in current EPS file. The header string can +;; have the following formats: +;; +;; %% prints a % character. +;; +;; %H prints the `ebnf-eps-header' (which see) value. +;; +;; %F prints the `ebnf-eps-footer' (which see) value. +;; +;; Any other format is ignored, that is, if, for example, it's +;; used %s then %s characters are stripped out from the header. +;; If header is an empty string, no header is generated until a +;; non-empty header is specified or `ebnf-eps-header' has a +;; non-empty string value. +;; +;; ;Ffooter generate a footer in current EPS file. Similar to ;H action +;; comment. +;; ;; So if you have: ;; ;; (setq ebnf-horizontal-orientation nil) @@ -546,6 +564,16 @@ Please send all bug fixes and enhancements to ;; The production A is generated in both files ebnf--AA.eps and ebnf--BB.eps. ;; ;; +;; Log Messages +;; ------------ +;; +;; The buffer *Ebnf2ps Log* is where the ebnf2ps log messages are inserted. +;; These messages are intended to help debugging ebnf2ps. +;; +;; The log messages are enabled by `ebnf-log' option (which see). The default +;; value is nil, that is, no log messages are generated. +;; +;; ;; Utilities ;; --------- ;; @@ -723,6 +751,14 @@ Please send all bug fixes and enhancements to ;; ;; `ebnf-eps-prefix' Specify EPS prefix file name. ;; +;; `ebnf-eps-header-font' Specify EPS header font. +;; +;; `ebnf-eps-header' Specify EPS header. +;; +;; `ebnf-eps-footer-font' Specify EPS footer font. +;; +;; `ebnf-eps-footer' Specify EPS footer. +;; ;; `ebnf-use-float-format' Non-nil means use `%f' float format. ;; ;; `ebnf-stop-on-error' Non-nil means signal error and stop. @@ -735,6 +771,8 @@ Please send all bug fixes and enhancements to ;; `ebnf-optimize' Non-nil means optimize syntactic chart ;; of rules. ;; +;; `ebnf-log' Non-nil means generate log messages. +;; ;; To set the above options you may: ;; ;; a) insert the code in your ~/.emacs, like: @@ -787,6 +825,9 @@ Please send all bug fixes and enhancements to ;; To help to handle this situation, ebnf2ps has the following commands to ;; handle styles: ;; +;; `ebnf-find-style' Return style definition if NAME is already defined; +;; otherwise, return nil. +;; ;; `ebnf-insert-style' Insert a new style NAME with inheritance INHERITS and ;; values VALUES. ;; @@ -1879,6 +1920,126 @@ See `ebnf-eps-buffer' and `ebnf-eps-region' commands." :group 'ebnf2ps) +(defcustom ebnf-eps-header-font '(11 Helvetica "Black" "White" bold) + "*Specify EPS header font. + +See documentation for `ebnf-production-font'. + +See `ebnf-eps-buffer' and `ebnf-eps-region' commands." + :type '(list :tag "EPS Header Font" + (number :tag "Font Size") + (symbol :tag "Font Name") + (choice :tag "Foreground Color" + (string :tag "Name") + (other :tag "Default" nil)) + (choice :tag "Background Color" + (string :tag "Name") + (other :tag "Default" nil)) + (repeat :tag "Font Attributes" :inline t + (choice (const bold) (const italic) + (const underline) (const strikeout) + (const overline) (const shadow) + (const box) (const outline)))) + :version "22" + :group 'ebnf2ps) + + +(defcustom ebnf-eps-header nil + "*Specify EPS header. + +The value should be a string, a symbol or nil. + +String is inserted unchanged. + +For symbol bounded to a function, the function is called and should return a +string. For symbol bounded to a value, the value should be a string. + +If symbol is unbounded, it is silently ignored. + +Empty string or nil mean that no header will be generated. + +Note that when the header action comment (;H in EBNF syntax) is specified, the +string in the header action comment is processed and, if it returns a non-empty +string, it's used to generate the header. The header action comment accepts +the following formats: + + %% prints a % character. + + %H prints the `ebnf-eps-header' value. + + %F prints the `ebnf-eps-footer' (which see) value. + +Any other format is ignored, that is, if, for example, it's used %s then %s +characters are stripped out from the header. If header action comment is an +empty string, no header is generated until a non-empty header is specified or +`ebnf-eps-header' has a non-empty string value." + :type '(repeat (choice :menu-tag "EPS Header" + :tag "EPS Header" + string symbol (const :tag "No Header" nil ))) + :version "22" + :group 'ebnf2ps) + + +(defcustom ebnf-eps-footer-font '(7 Helvetica "Black" "White" bold) + "*Specify EPS footer font. + +See documentation for `ebnf-production-font'. + +See `ebnf-eps-buffer' and `ebnf-eps-region' commands." + :type '(list :tag "EPS Footer Font" + (number :tag "Font Size") + (symbol :tag "Font Name") + (choice :tag "Foreground Color" + (string :tag "Name") + (other :tag "Default" nil)) + (choice :tag "Background Color" + (string :tag "Name") + (other :tag "Default" nil)) + (repeat :tag "Font Attributes" :inline t + (choice (const bold) (const italic) + (const underline) (const strikeout) + (const overline) (const shadow) + (const box) (const outline)))) + :version "22" + :group 'ebnf2ps) + + +(defcustom ebnf-eps-footer nil + "*Specify EPS footer. + +The value should be a string, a symbol or nil. + +String is inserted unchanged. + +For symbol bounded to a function, the function is called and should return a +string. For symbol bounded to a value, the value should be a string. + +If symbol is unbounded, it is silently ignored. + +Empty string or nil mean that no footer will be generated. + +Note that when the footer action comment (;F in EBNF syntax) is specified, the +string in the footer action comment is processed and, if it returns a non-empty +string, it's used to generate the footer. The footer action comment accepts +the following formats: + + %% prints a % character. + + %H prints the `ebnf-eps-header' (which see) value. + + %F prints the `ebnf-eps-footer' value. + +Any other format is ignored, that is, if, for example, it's used %s then %s +characters are stripped out from the footer. If footer action comment is an +empty string, no footer is generated until a non-empty footer is specified or +`ebnf-eps-footer' has a non-empty string value." + :type '(repeat (choice :menu-tag "EPS Footer" + :tag "EPS Footer" + string symbol (const :tag "No Footer" nil ))) + :version "22" + :group 'ebnf2ps) + + (defcustom ebnf-entry-percentage 0.5 ; middle "*Specify entry height on alternatives. @@ -2019,6 +2180,16 @@ The above optimizations are specially useful when `ebnf-syntax' is `yacc'." :version "20" :group 'ebnf-optimization) + +(defcustom ebnf-log nil + "*Non-nil means generate log messages. + +The log messages are generated into the buffer *Ebnf2ps Log*. +These messages are intended to help debugging ebnf2ps." + :type 'boolean + :version "22" + :group 'ebnf2ps) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; To make this file smaller, some commands go in a separate file. @@ -2063,6 +2234,7 @@ See also `ebnf-print-buffer'." (interactive (list (read-file-name "Directory containing EBNF files (print): " nil default-directory))) + (ebnf-log-header "(ebnf-print-directory %S)" directory) (ebnf-directory 'ebnf-print-buffer directory)) @@ -2075,6 +2247,7 @@ killed after process termination. See also `ebnf-print-buffer'." (interactive "fEBNF file to generate PostScript and print from: ") + (ebnf-log-header "(ebnf-print-file %S %S)" file do-not-kill-buffer-when-done) (ebnf-file 'ebnf-print-buffer file do-not-kill-buffer-when-done)) @@ -2091,6 +2264,7 @@ is nil, send the image to the printer. If FILENAME is a string, save the PostScript image in a file with that name. If FILENAME is a number, prompt the user for the name of the file to save in." (interactive (list (ps-print-preprint current-prefix-arg))) + (ebnf-log-header "(ebnf-print-buffer %S)" filename) (ebnf-print-region (point-min) (point-max) filename)) @@ -2099,6 +2273,7 @@ number, prompt the user for the name of the file to save in." "Generate and print a PostScript syntactic chart image of the region. Like `ebnf-print-buffer', but prints just the current region." (interactive (list (point) (mark) (ps-print-preprint current-prefix-arg))) + (ebnf-log-header "(ebnf-print-region %S %S %S)" from to filename) (run-hooks 'ebnf-hook) (or (ebnf-spool-region from to) (ps-do-despool filename))) @@ -2117,6 +2292,7 @@ See also `ebnf-spool-buffer'." (interactive (list (read-file-name "Directory containing EBNF files (spool): " nil default-directory))) + (ebnf-log-header "(ebnf-spool-directory %S)" directory) (ebnf-directory 'ebnf-spool-buffer directory)) @@ -2129,6 +2305,7 @@ killed after process termination. See also `ebnf-spool-buffer'." (interactive "fEBNF file to generate PostScript and spool from: ") + (ebnf-log-header "(ebnf-spool-file %S %S)" file do-not-kill-buffer-when-done) (ebnf-file 'ebnf-spool-buffer file do-not-kill-buffer-when-done)) @@ -2140,6 +2317,7 @@ local buffer to be sent to the printer later. Use the command `ebnf-despool' to send the spooled images to the printer." (interactive) + (ebnf-log-header "(ebnf-spool-buffer)") (ebnf-spool-region (point-min) (point-max))) @@ -2150,6 +2328,7 @@ Like `ebnf-spool-buffer', but spools just the current region. Use the command `ebnf-despool' to send the spooled images to the printer." (interactive "r") + (ebnf-log-header "(ebnf-spool-region %S)" from to) (ebnf-generate-region from to 'ebnf-generate)) @@ -2166,6 +2345,7 @@ See also `ebnf-eps-buffer'." (interactive (list (read-file-name "Directory containing EBNF files (EPS): " nil default-directory))) + (ebnf-log-header "(ebnf-eps-directory %S)" directory) (ebnf-directory 'ebnf-eps-buffer directory)) @@ -2178,6 +2358,7 @@ killed after EPS generation. See also `ebnf-eps-buffer'." (interactive "fEBNF file to generate EPS file from: ") + (ebnf-log-header "(ebnf-eps-file %S %S)" file do-not-kill-buffer-when-done) (ebnf-file 'ebnf-eps-buffer file do-not-kill-buffer-when-done)) @@ -2200,8 +2381,9 @@ The EPS file name has the following form: file name used in this case will be \"ebnf--A_B_+_C.eps\". WARNING: This function does *NOT* ask any confirmation to override existing - files." + files." (interactive) + (ebnf-log-header "(ebnf-eps-buffer)") (ebnf-eps-region (point-min) (point-max))) @@ -2224,8 +2406,9 @@ The EPS file name has the following form: file name used in this case will be \"ebnf--A_B_+_C.eps\". WARNING: This function does *NOT* ask any confirmation to override existing - files." + files." (interactive "r") + (ebnf-log-header "(ebnf-eps-region %S %S)" from to) (let ((ebnf-eps-executing t)) (ebnf-generate-region from to 'ebnf-generate-eps))) @@ -2247,6 +2430,7 @@ See also `ebnf-syntax-buffer'." (interactive (list (read-file-name "Directory containing EBNF files (syntax): " nil default-directory))) + (ebnf-log-header "(ebnf-syntax-directory %S)" directory) (ebnf-directory 'ebnf-syntax-buffer directory)) @@ -2259,6 +2443,7 @@ killed after syntax checking. See also `ebnf-syntax-buffer'." (interactive "fEBNF file to check syntax: ") + (ebnf-log-header "(ebnf-syntax-file %S %S)" file do-not-kill-buffer-when-done) (ebnf-file 'ebnf-syntax-buffer file do-not-kill-buffer-when-done)) @@ -2266,13 +2451,15 @@ See also `ebnf-syntax-buffer'." (defun ebnf-syntax-buffer () "Do a syntactic analysis of the current buffer." (interactive) + (ebnf-log-header "(ebnf-syntax-buffer)") (ebnf-syntax-region (point-min) (point-max))) ;;;###autoload (defun ebnf-syntax-region (from to) - "Do a syntactic analysis of region." + "Do a syntactic analysis of a region." (interactive "r") + (ebnf-log-header "(ebnf-syntax-region %S %S)" from to) (ebnf-generate-region from to nil)) @@ -2287,6 +2474,8 @@ See also `ebnf-syntax-buffer'." " ;;; ebnf2ps.el version %s +;;; Emacs version %S + \(setq ebnf-special-show-delimiter %S ebnf-special-font %s ebnf-special-shape %s @@ -2333,20 +2522,28 @@ See also `ebnf-syntax-buffer'." ebnf-iso-normalize-p %S ebnf-file-suffix-regexp %S ebnf-eps-prefix %S + ebnf-eps-header-font %s + ebnf-eps-header %s + ebnf-eps-footer-font %s + ebnf-eps-footer %s ebnf-entry-percentage %S ebnf-color-p %S ebnf-line-width %S ebnf-line-color %S + ebnf-arrow-extra-width %S + ebnf-arrow-scale %S ebnf-debug-ps %S ebnf-use-float-format %S ebnf-stop-on-error %S ebnf-yac-ignore-error-recovery %S ebnf-ignore-empty-rule %S - ebnf-optimize %S) + ebnf-optimize %S + ebnf-log %S) ;;; ebnf2ps.el - end of settings " ebnf-version + emacs-version ebnf-special-show-delimiter (ps-print-quote ebnf-special-font) (ps-print-quote ebnf-special-shape) @@ -2393,16 +2590,23 @@ See also `ebnf-syntax-buffer'." ebnf-iso-normalize-p ebnf-file-suffix-regexp ebnf-eps-prefix + (ps-print-quote ebnf-eps-header-font) + (ps-print-quote ebnf-eps-header) + (ps-print-quote ebnf-eps-footer-font) + (ps-print-quote ebnf-eps-footer) ebnf-entry-percentage ebnf-color-p ebnf-line-width ebnf-line-color + ebnf-arrow-extra-width + ebnf-arrow-scale ebnf-debug-ps ebnf-use-float-format ebnf-stop-on-error ebnf-yac-ignore-error-recovery ebnf-ignore-empty-rule - ebnf-optimize)) + ebnf-optimize + ebnf-log)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2465,6 +2669,10 @@ See also `ebnf-syntax-buffer'." ebnf-iso-normalize-p ebnf-file-suffix-regexp ebnf-eps-prefix + ebnf-eps-header-font + ebnf-eps-header + ebnf-eps-footer-font + ebnf-eps-footer ebnf-entry-percentage ebnf-color-p ebnf-line-width @@ -2528,6 +2736,10 @@ See also `ebnf-syntax-buffer'." (ebnf-iso-normalize-p . nil) (ebnf-file-suffix-regexp . "\.[Bb][Nn][Ff]$") (ebnf-eps-prefix . "ebnf--") + (ebnf-eps-header-font . '(11 Helvetica "Black" "White" bold)) + (ebnf-eps-header . nil) + (ebnf-eps-footer-font . '(7 Helvetica "Black" "White" bold)) + (ebnf-eps-footer . nil) (ebnf-entry-percentage . 0.5) (ebnf-color-p . (or (fboundp 'x-color-values) ; Emacs (fboundp 'color-instance-rgb-components))) ; XEmacs @@ -2601,6 +2813,15 @@ Don't use this variable directly. Use functions `ebnf-insert-style', ;;;###autoload +(defun ebnf-find-style (name) + "Return style definition if NAME is already defined; otherwise, return nil. + +See `ebnf-style-database' documentation." + (interactive "SStyle name: ") + (assoc name ebnf-style-database)) + + +;;;###autoload (defun ebnf-insert-style (name inherits &rest values) "Insert a new style NAME with inheritance INHERITS and values VALUES. @@ -2735,18 +2956,20 @@ See `ebnf-style-database' documentation." ;; Internal variables -(defvar ebnf-eps-buffer-name " *EPS*") -(defvar ebnf-parser-func nil) -(defvar ebnf-eps-executing nil) -(defvar ebnf-eps-upper-x 0.0) +(defvar ebnf-eps-buffer-name " *EPS*") +(defvar ebnf-parser-func nil) +(defvar ebnf-eps-executing nil) +(defvar ebnf-eps-header-comment nil) +(defvar ebnf-eps-footer-comment nil) +(defvar ebnf-eps-upper-x 0.0) (make-variable-buffer-local 'ebnf-eps-upper-x) -(defvar ebnf-eps-upper-y 0.0) +(defvar ebnf-eps-upper-y 0.0) (make-variable-buffer-local 'ebnf-eps-upper-y) -(defvar ebnf-eps-prod-width 0.0) +(defvar ebnf-eps-prod-width 0.0) (make-variable-buffer-local 'ebnf-eps-prod-width) -(defvar ebnf-eps-max-height 0.0) +(defvar ebnf-eps-max-height 0.0) (make-variable-buffer-local 'ebnf-eps-max-height) -(defvar ebnf-eps-max-width 0.0) +(defvar ebnf-eps-max-width 0.0) (make-variable-buffer-local 'ebnf-eps-max-width) @@ -2756,6 +2979,23 @@ See `ebnf-style-database' documentation." See section \"Actions in Comments\" in ebnf2ps documentation.") +(defvar ebnf-eps-file-alist nil +"Alist associating file name with EPS header and footer. + +Each element has the following form: + + (EPS-FILENAME HEADER FOOTER) + +EPS-FILENAME is the EPS file name. +HEADER is the header string or nil. +FOOTER is the footer string or nil. + +It's generated during parsing and used during EPS generation. + +See `ebnf-eps-context' and section \"Actions in Comments\" in ebnf2ps +documentation.") + + (defvar ebnf-eps-production-list nil "Alist associating production name with EPS file name list. @@ -2800,41 +3040,43 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and `ebnf-chart-shape'.") -(defvar ebnf-limit nil) -(defvar ebnf-action nil) -(defvar ebnf-action-list nil) +(defvar ebnf-limit nil) +(defvar ebnf-action nil) +(defvar ebnf-action-list nil) -(defvar ebnf-default-p nil) +(defvar ebnf-default-p nil) -(defvar ebnf-font-height-P 0) -(defvar ebnf-font-height-T 0) -(defvar ebnf-font-height-NT 0) -(defvar ebnf-font-height-S 0) -(defvar ebnf-font-height-E 0) -(defvar ebnf-font-height-R 0) -(defvar ebnf-font-width-P 0) -(defvar ebnf-font-width-T 0) -(defvar ebnf-font-width-NT 0) -(defvar ebnf-font-width-S 0) -(defvar ebnf-font-width-E 0) -(defvar ebnf-font-width-R 0) -(defvar ebnf-space-T 0) -(defvar ebnf-space-NT 0) -(defvar ebnf-space-S 0) -(defvar ebnf-space-E 0) -(defvar ebnf-space-R 0) +(defvar ebnf-font-height-P 0) +(defvar ebnf-font-height-T 0) +(defvar ebnf-font-height-NT 0) +(defvar ebnf-font-height-S 0) +(defvar ebnf-font-height-E 0) +(defvar ebnf-font-height-R 0) +(defvar ebnf-font-width-P 0) +(defvar ebnf-font-width-T 0) +(defvar ebnf-font-width-NT 0) +(defvar ebnf-font-width-S 0) +(defvar ebnf-font-width-E 0) +(defvar ebnf-font-width-R 0) +(defvar ebnf-space-T 0) +(defvar ebnf-space-NT 0) +(defvar ebnf-space-S 0) +(defvar ebnf-space-E 0) +(defvar ebnf-space-R 0) -(defvar ebnf-basic-width 0) -(defvar ebnf-basic-height 0) -(defvar ebnf-vertical-space 0) -(defvar ebnf-horizontal-space 0) +(defvar ebnf-basic-width-extra 0) +(defvar ebnf-basic-width 0) +(defvar ebnf-basic-height 0) +(defvar ebnf-basic-empty-height 0) +(defvar ebnf-vertical-space 0) +(defvar ebnf-horizontal-space 0) -(defvar ebnf-settings nil) -(defvar ebnf-fonts-required nil) +(defvar ebnf-settings nil) +(defvar ebnf-fonts-required nil) (defconst ebnf-debug @@ -3179,8 +3421,8 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and % --- Flow Stuff -% height prepare_height |- line_height corner_height corner_height -/prepare_height +% height prepare-height |- line_height corner_height corner_height +/prepare-height {dup 0 gt {T sub hT} {T add hT neg}ifelse @@ -3206,7 +3448,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and {0.5 mul dup 1 corner_RA 0 corner_RD} - {prepare_height + {prepare-height 1 corner_RA exch 0 exch rlineto 0 corner_RD @@ -3227,7 +3469,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and % \\ % - /LLoop -{prepare_height +{prepare-height 3 corner_LA exch 0 exch rlineto 0 corner_RD @@ -3252,7 +3494,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and {0.5 mul dup 1 corner_LA 0 corner_LD} - {prepare_height + {prepare-height 1 corner_LA exch 0 exch rlineto 0 corner_LD @@ -3273,7 +3515,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and % / % - /RLoop -{prepare_height +{prepare-height 1 corner_RA exch 0 exch rlineto 0 corner_LD @@ -4064,6 +4306,113 @@ end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Header & Footer + + +(defun ebnf-eps-header-footer (value) + ;; evaluate header/footer value + ;; return a string or nil + (let ((tmp (if (symbolp value) + (cond ((fboundp value) (funcall value)) + ((boundp value) (symbol-value value)) + (t nil)) + value))) + (and (stringp tmp) tmp))) + + +(defun ebnf-eps-header () + ;; evaluate header value + (ebnf-eps-header-footer ebnf-eps-header)) + + +(defun ebnf-eps-footer () + ;; evaluate footer value + (ebnf-eps-header-footer ebnf-eps-footer)) + + +;; hacked fom `ps-output-string-prim' (ps-print.el) +(defun ebnf-eps-string (string) + (let* ((str (string-as-unibyte string)) + (len (length str)) + (index 0) + (new "(") ; insert start-string delimiter + start special) + ;; Find and quote special characters as necessary for PS + ;; This skips everything except control chars, non-ASCII chars, (, ) and \. + (while (setq start (string-match "[^]-~ -'*-[]" str index)) + (setq special (aref str start) + new (concat new + (substring str index start) + (if (and (<= 0 special) (<= special 255)) + (aref ps-string-escape-codes special) + ;; insert hexadecimal representation if character + ;; code is out of range + (format "\\%04X" special))) + index (1+ start))) + (concat new + (and (< index len) + (substring str index len)) + ")"))) ; insert end-string delimiter + + +(defun ebnf-eps-header-footer-comment (str) + ;; parse header/footer comment string + (let ((len (1- (length str))) + (index 0) + new start fmt) + (while (setq start (string-match "%" str index)) + (setq fmt (if (< start len) (aref str (1+ start)) ?\?) + new (concat new + (substring str index start) + (cond ((= fmt ?%) "%") + ((= fmt ?H) (ebnf-eps-header)) + ((= fmt ?F) (ebnf-eps-footer)) + (t nil) + )) + index (+ start 2))) + (ebnf-eps-string (concat new + (and (<= index len) + (substring str index (1+ len))))))) + + +(defun ebnf-eps-header-footer-p (value) + ;; return t if value is non-nil and is not an empty string + (not (or (null value) + (and (stringp value) (string= value ""))))) + + +(defun ebnf-eps-header-comment (str) + ;; set header comment if header is on + (when (ebnf-eps-header-footer-p ebnf-eps-header) + (setq ebnf-eps-header-comment (ebnf-eps-header-footer-comment str)))) + + +(defun ebnf-eps-footer-comment (str) + ;; set footer comment if footer is on + (when (ebnf-eps-header-footer-p ebnf-eps-footer) + (setq ebnf-eps-footer-comment (ebnf-eps-header-footer-comment str)))) + + +(defun ebnf-eps-header-footer-file (filename) + ;; associate header and footer with a filename + (let ((filehf (assoc filename ebnf-eps-file-alist)) + (header (or ebnf-eps-header-comment (ebnf-eps-header))) + (footer (or ebnf-eps-footer-comment (ebnf-eps-footer)))) + (if (null filehf) + (setq ebnf-eps-file-alist (cons (list filename header footer) + ebnf-eps-file-alist)) + (setcar (nthcdr 1 filehf) header) + (setcar (nthcdr 2 filehf) footer)))) + + +(defun ebnf-eps-header-footer-set (filename) + ;; set header and footer from a filename + (let ((header-footer (assoc filename ebnf-eps-file-alist))) + (setq ebnf-eps-header-comment (nth 1 header-footer) + ebnf-eps-footer-comment (nth 2 header-footer)))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Formatting @@ -4513,7 +4862,9 @@ end (if sep (let ((ebnf-direction "L")) (ebnf-node-generation sep)) - (ebnf-empty-alternative (- width ebnf-horizontal-space)))) + (ebnf-empty-alternative (- width + ebnf-horizontal-space + ebnf-basic-width-extra)))) (ps-output "EOS\n")) @@ -4528,7 +4879,7 @@ end (if node-sep (- (ebnf-node-height node-sep) (ebnf-node-entry node-sep)) - 0)))) + ebnf-basic-empty-height)))) (ps-output (ebnf-format-float entry (+ (- (ebnf-node-height node-list) list-entry) @@ -4540,7 +4891,9 @@ end (if (ebnf-node-separator zero-or-more) (let ((ebnf-direction "L")) (ebnf-node-generation (ebnf-node-separator zero-or-more))) - (ebnf-empty-alternative (- width ebnf-horizontal-space)))) + (ebnf-empty-alternative (- width + ebnf-horizontal-space + ebnf-basic-width-extra)))) (ps-output "EOS\n")) @@ -4662,7 +5015,9 @@ killed after process termination." (defun ebnf-eps-filename (str) (let* ((len (length str)) (stri 0) - (new (make-string len ?\s))) + ;; to keep compatibility with Emacs 20 & 21: + ;; DO NOT REPLACE `?\ ' BY `?\s' + (new (make-string len ?\ ))) (while (< stri len) (aset new stri (aref ebnf-map-name (aref str stri))) (setq stri (1+ stri))) @@ -4723,6 +5078,7 @@ killed after process termination." (defun ebnf-parse-and-sort (start) + (ebnf-log "(ebnf-parse-and-sort %S)" start) (ebnf-begin-job) (let ((tree (funcall ebnf-parser-func start))) (if ebnf-sort-production @@ -4861,7 +5217,10 @@ killed after process termination." ebnf-action nil ebnf-default-p nil ebnf-eps-context nil + ebnf-eps-file-alist nil ebnf-eps-production-list nil + ebnf-eps-header-comment nil + ebnf-eps-footer-comment nil ebnf-eps-upper-x 0.0 ebnf-eps-upper-y 0.0 ebnf-font-height-P (ebnf-font-height ebnf-production-font) @@ -4882,10 +5241,14 @@ killed after process termination." ebnf-space-E (* ebnf-font-height-E 0.5) ebnf-space-R (* ebnf-font-height-R 0.5)) (let ((basic (+ ebnf-font-height-T ebnf-font-height-NT))) - (setq ebnf-basic-width (* basic 0.5) - ebnf-horizontal-space (+ basic basic) - ebnf-basic-height ebnf-basic-width - ebnf-vertical-space ebnf-basic-width) + (setq ebnf-basic-width (* basic 0.5) + ebnf-horizontal-space (+ basic basic) + ebnf-basic-empty-height (* ebnf-basic-width 0.5) + ebnf-basic-height ebnf-basic-width + ebnf-vertical-space ebnf-basic-width + ebnf-basic-width-extra (- ebnf-basic-width + ebnf-arrow-extra-width + 0.1)) ; error factor ;; ensures value is greater than zero (or (and (numberp ebnf-production-horizontal-space) (> ebnf-production-horizontal-space 0.0)) @@ -4893,7 +5256,18 @@ killed after process termination." ;; ensures value is greater than zero (or (and (numberp ebnf-production-vertical-space) (> ebnf-production-vertical-space 0.0)) - (setq ebnf-production-vertical-space basic)))) + (setq ebnf-production-vertical-space basic))) + (ebnf-log "(ebnf-begin-job)") + (ebnf-log " ebnf-arrow-extra-width ............ : %7.3f" ebnf-arrow-extra-width) + (ebnf-log " ebnf-arrow-scale .................. : %7.3f" ebnf-arrow-scale) + (ebnf-log " ebnf-basic-width-extra ............ : %7.3f" ebnf-basic-width-extra) + (ebnf-log " ebnf-basic-width .................. : %7.3f (T)" ebnf-basic-width) + (ebnf-log " ebnf-horizontal-space ............. : %7.3f (4T)" ebnf-horizontal-space) + (ebnf-log " ebnf-basic-empty-height ........... : %7.3f (hT)" ebnf-basic-empty-height) + (ebnf-log " ebnf-basic-height ................. : %7.3f (T)" ebnf-basic-height) + (ebnf-log " ebnf-vertical-space ............... : %7.3f (T)" ebnf-vertical-space) + (ebnf-log " ebnf-production-horizontal-space .. : %7.3f (2T)" ebnf-production-horizontal-space) + (ebnf-log " ebnf-production-vertical-space .... : %7.3f (2T)" ebnf-production-vertical-space)) (defsubst ebnf-shape-value (sym alist) @@ -4916,6 +5290,7 @@ killed after process termination." (progn ;; adjust creator comment (end-of-line) + ;; (backward-char) (insert " & ebnf2ps v" ebnf-version) ;; insert ebnf settings & engine (goto-char (point-max)) @@ -4928,6 +5303,7 @@ killed after process termination." (when (buffer-modified-p buffer) (save-excursion (set-buffer buffer) + (ebnf-eps-header-footer-set filename) (setq ebnf-eps-upper-x (max ebnf-eps-upper-x ebnf-eps-max-width) ebnf-eps-upper-y (if (zerop ebnf-eps-upper-y) ebnf-eps-max-height @@ -4954,7 +5330,9 @@ killed after process termination." ebnf-non-terminal-font ebnf-special-font ebnf-except-font - ebnf-repeat-font))) + ebnf-repeat-font + ebnf-eps-header-font + ebnf-eps-footer-font))) "\n%%+ font "))) "\n%%Pages: 0\n%%EndComments\n\n%%BeginProlog\n" ebnf-eps-prologue) @@ -4980,6 +5358,42 @@ killed after process termination." (setq ebnf-settings (concat "\n\n% === begin EBNF settings\n\n" + (format "/Header %s def\n" + (or ebnf-eps-header-comment "()")) + (format "/Footer %s def\n" + (or ebnf-eps-footer-comment "()")) + ;; header + (format "/ShowHeader %s def\n" + (ebnf-boolean + (ebnf-eps-header-footer-p ebnf-eps-header))) + (format "/fH %s /%s DefFont\n" + (ebnf-format-float + (ebnf-font-size ebnf-eps-header-font)) + (ebnf-font-name-select ebnf-eps-header-font)) + (ebnf-format-color "/ForegroundH %s def %% %s\n" + (ebnf-font-foreground ebnf-eps-header-font) + "Black") + (ebnf-format-color "/BackgroundH %s def %% %s\n" + (ebnf-font-background ebnf-eps-header-font) + "White") + (format "/EffectH %d def\n" + (ebnf-font-attributes ebnf-eps-header-font)) + ;; footer + (format "/ShowFooter %s def\n" + (ebnf-boolean + (ebnf-eps-header-footer-p ebnf-eps-footer))) + (format "/fF %s /%s DefFont\n" + (ebnf-format-float + (ebnf-font-size ebnf-eps-footer-font)) + (ebnf-font-name-select ebnf-eps-footer-font)) + (ebnf-format-color "/ForegroundF %s def %% %s\n" + (ebnf-font-foreground ebnf-eps-footer-font) + "Black") + (ebnf-format-color "/BackgroundF %s def %% %s\n" + (ebnf-font-background ebnf-eps-footer-font) + "White") + (format "/EffectF %d def\n" + (ebnf-font-attributes ebnf-eps-footer-font)) ;; production (format "/fP %s /%s DefFont\n" (ebnf-format-float (ebnf-font-size ebnf-production-font)) @@ -5136,6 +5550,7 @@ killed after process termination." (defun ebnf-dimensions (tree) + (ebnf-log "(ebnf-dimensions tree)") (let ((ebnf-total (length tree)) (ebnf-nprod 0)) (mapcar 'ebnf-production-dimension tree)) @@ -5149,6 +5564,7 @@ killed after process termination." ;; [production width-fun dim-fun entry height width name production action] (defun ebnf-production-dimension (production) + (ebnf-log "(ebnf-production-dimension production)") (ebnf-message-info "Calculating dimensions") (ebnf-node-dimension-func (ebnf-node-production production)) (let* ((prod (ebnf-node-production production)) @@ -5162,11 +5578,17 @@ killed after process termination." (ebnf-node-height production height) (ebnf-node-width production (+ (ebnf-node-width prod) ebnf-line-width - ebnf-horizontal-space)))) + ebnf-horizontal-space + ebnf-basic-width-extra))) + (ebnf-log " production name : %S" (ebnf-node-name production)) + (ebnf-log " production entry : %7.3f" (ebnf-node-entry production)) + (ebnf-log " production height : %7.3f" (ebnf-node-height production)) + (ebnf-log " production width : %7.3f" (ebnf-node-width production))) ;; [terminal width-fun dim-fun entry height width name] (defun ebnf-terminal-dimension (terminal) + (ebnf-log "(ebnf-terminal-dimension terminal)") (ebnf-terminal-dimension1 terminal ebnf-font-height-T ebnf-font-width-T @@ -5175,6 +5597,7 @@ killed after process termination." ;; [non-terminal width-fun dim-fun entry height width name] (defun ebnf-non-terminal-dimension (non-terminal) + (ebnf-log "(ebnf-non-terminal-dimension non-terminal)") (ebnf-terminal-dimension1 non-terminal ebnf-font-height-NT ebnf-font-width-NT @@ -5183,6 +5606,7 @@ killed after process termination." ;; [special width-fun dim-fun entry height width name] (defun ebnf-special-dimension (special) + (ebnf-log "(ebnf-special-dimension special)") (ebnf-terminal-dimension1 special ebnf-font-height-S ebnf-font-width-S @@ -5194,9 +5618,16 @@ killed after process termination." (len (length (ebnf-node-name node)))) (ebnf-node-entry node (* height 0.5)) (ebnf-node-height node height) - (ebnf-node-width node (+ ebnf-basic-width ebnf-arrow-extra-width space + (ebnf-node-width node (+ ebnf-basic-width + ebnf-arrow-extra-width + space (* len font-width) - space ebnf-basic-width)))) + space + ebnf-basic-width))) + (ebnf-log " name : %S" (ebnf-node-name node)) + (ebnf-log " entry : %7.3f" (ebnf-node-entry node)) + (ebnf-log " height : %7.3f" (ebnf-node-height node)) + (ebnf-log " width : %7.3f" (ebnf-node-width node))) (defconst ebnf-null-vector (vector t t t 0.0 0.0 0.0)) @@ -5204,6 +5635,7 @@ killed after process termination." ;; [repeat width-fun dim-fun entry height width times element] (defun ebnf-repeat-dimension (repeat) + (ebnf-log "(ebnf-repeat-dimension repeat)") (let ((times (ebnf-node-name repeat)) (element (ebnf-node-separator repeat))) (if element @@ -5218,11 +5650,15 @@ killed after process termination." ebnf-arrow-extra-width ebnf-space-R ebnf-space-R ebnf-space-R ebnf-horizontal-space - (* (length times) ebnf-font-width-R))))) + (* (length times) ebnf-font-width-R)))) + (ebnf-log " repeat entry : %7.3f" (ebnf-node-entry repeat)) + (ebnf-log " repeat height : %7.3f" (ebnf-node-height repeat)) + (ebnf-log " repeat width : %7.3f" (ebnf-node-width repeat))) ;; [except width-fun dim-fun entry height width element element] (defun ebnf-except-dimension (except) + (ebnf-log "(ebnf-except-dimension except)") (let ((factor (ebnf-node-list except)) (element (ebnf-node-separator except))) (ebnf-node-dimension-func factor) @@ -5241,11 +5677,15 @@ killed after process termination." ebnf-space-E ebnf-space-E ebnf-space-E ebnf-space-E ebnf-font-width-E - ebnf-horizontal-space)))) + ebnf-horizontal-space))) + (ebnf-log " except entry : %7.3f" (ebnf-node-entry except)) + (ebnf-log " except height : %7.3f" (ebnf-node-height except)) + (ebnf-log " except width : %7.3f" (ebnf-node-width except))) ;; [alternative width-fun dim-fun entry height width list] (defun ebnf-alternative-dimension (alternative) + (ebnf-log "(ebnf-alternative-dimension alternative)") (let ((body (ebnf-node-list alternative)) (lis (ebnf-node-list alternative))) (while lis @@ -5270,23 +5710,33 @@ killed after process termination." (- (ebnf-node-height tail) (ebnf-node-entry tail)))))) (ebnf-node-height alternative height) - (ebnf-node-width alternative (+ width ebnf-horizontal-space)) - (ebnf-node-list alternative body)))) + (ebnf-node-width alternative (+ width + ebnf-horizontal-space + ebnf-basic-width-extra)) + (ebnf-node-list alternative body))) + (ebnf-log " alternative entry : %7.3f" (ebnf-node-entry alternative)) + (ebnf-log " alternative height : %7.3f" (ebnf-node-height alternative)) + (ebnf-log " alternative width : %7.3f" (ebnf-node-width alternative))) ;; [optional width-fun dim-fun entry height width element] (defun ebnf-optional-dimension (optional) + (ebnf-log "(ebnf-optional-dimension optional)") (let ((body (ebnf-node-list optional))) (ebnf-node-dimension-func body) (ebnf-node-entry optional (ebnf-node-entry body)) (ebnf-node-height optional (+ (ebnf-node-height body) ebnf-vertical-space)) (ebnf-node-width optional (+ (ebnf-node-width body) - ebnf-horizontal-space)))) + ebnf-horizontal-space))) + (ebnf-log " optional entry : %7.3f" (ebnf-node-entry optional)) + (ebnf-log " optional height : %7.3f" (ebnf-node-height optional)) + (ebnf-log " optional width : %7.3f" (ebnf-node-width optional))) ;; [one-or-more width-fun dim-fun entry height width element separator] (defun ebnf-one-or-more-dimension (or-more) + (ebnf-log "(ebnf-one-or-more-dimension or-more)") (let ((list-part (ebnf-node-list or-more)) (sep-part (ebnf-node-separator or-more))) (ebnf-node-dimension-func list-part) @@ -5294,7 +5744,7 @@ killed after process termination." (ebnf-node-dimension-func sep-part)) (let ((height (+ (if sep-part (ebnf-node-height sep-part) - 0.0) + ebnf-basic-empty-height) ebnf-vertical-space (ebnf-node-height list-part))) (width (max (if sep-part @@ -5304,14 +5754,21 @@ killed after process termination." (when sep-part (ebnf-adjust-width list-part width) (ebnf-adjust-width sep-part width)) - (ebnf-node-entry or-more (+ (- height (ebnf-node-height list-part)) + (ebnf-node-entry or-more (+ (- height + (ebnf-node-height list-part)) (ebnf-node-entry list-part))) (ebnf-node-height or-more height) - (ebnf-node-width or-more (+ width ebnf-horizontal-space))))) + (ebnf-node-width or-more (+ width + ebnf-horizontal-space + ebnf-basic-width-extra)))) + (ebnf-log " one-or-more entry : %7.3f" (ebnf-node-entry or-more)) + (ebnf-log " one-or-more height : %7.3f" (ebnf-node-height or-more)) + (ebnf-log " one-or-more width : %7.3f" (ebnf-node-width or-more))) ;; [zero-or-more width-fun dim-fun entry height width element separator] (defun ebnf-zero-or-more-dimension (or-more) + (ebnf-log "(ebnf-zero-or-more-dimension or-more)") (let ((list-part (ebnf-node-list or-more)) (sep-part (ebnf-node-separator or-more))) (ebnf-node-dimension-func list-part) @@ -5319,7 +5776,7 @@ killed after process termination." (ebnf-node-dimension-func sep-part)) (let ((height (+ (if sep-part (ebnf-node-height sep-part) - 0.0) + ebnf-basic-empty-height) ebnf-vertical-space (ebnf-node-height list-part) ebnf-vertical-space)) @@ -5332,11 +5789,17 @@ killed after process termination." (ebnf-adjust-width sep-part width)) (ebnf-node-entry or-more height) (ebnf-node-height or-more height) - (ebnf-node-width or-more (+ width ebnf-horizontal-space))))) + (ebnf-node-width or-more (+ width + ebnf-horizontal-space + ebnf-basic-width-extra)))) + (ebnf-log " zero-or-more entry : %7.3f" (ebnf-node-entry or-more)) + (ebnf-log " zero-or-more height : %7.3f" (ebnf-node-height or-more)) + (ebnf-log " zero-or-more width : %7.3f" (ebnf-node-width or-more))) ;; [sequence width-fun dim-fun entry height width list] (defun ebnf-sequence-dimension (sequence) + (ebnf-log "(ebnf-sequence-dimension sequence)") (let ((above 0.0) (below 0.0) (width 0.0) @@ -5352,7 +5815,10 @@ killed after process termination." width (+ width (ebnf-node-width node)))) (ebnf-node-entry sequence above) (ebnf-node-height sequence (+ above below)) - (ebnf-node-width sequence width))) + (ebnf-node-width sequence width)) + (ebnf-log " sequence entry : %7.3f" (ebnf-node-entry sequence)) + (ebnf-log " sequence height : %7.3f" (ebnf-node-height sequence)) + (ebnf-log " sequence width : %7.3f" (ebnf-node-width sequence))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -5494,7 +5960,8 @@ killed after process termination." (let ((filename (ebnf-eps-filename name))) (if (member filename ebnf-eps-context) (error "Try to open an already opened EPS file: %s" filename) - (setq ebnf-eps-context (cons filename ebnf-eps-context))))) + (setq ebnf-eps-context (cons filename ebnf-eps-context))) + (ebnf-eps-header-footer-file filename))) (defun ebnf-eps-remove-context (name) @@ -5505,14 +5972,16 @@ killed after process termination." (defun ebnf-eps-add-production (header) - (and ebnf-eps-executing - ebnf-eps-context - (let ((prod (assoc header ebnf-eps-production-list))) - (if prod - (setcdr prod (append ebnf-eps-context (cdr prod))) - (setq ebnf-eps-production-list - (cons (cons header (ebnf-dup-list ebnf-eps-context)) - ebnf-eps-production-list)))))) + (when ebnf-eps-executing + (if ebnf-eps-context + (let ((prod (assoc header ebnf-eps-production-list))) + (if prod + (setcdr prod (ebnf-dup-list + (append ebnf-eps-context (cdr prod)))) + (setq ebnf-eps-production-list + (cons (cons header (ebnf-dup-list ebnf-eps-context)) + ebnf-eps-production-list)))) + (ebnf-eps-header-footer-file (ebnf-eps-filename header))))) (defun ebnf-dup-list (old) @@ -5567,7 +6036,9 @@ killed after process termination." (defun ebnf-trim-right (str) (let* ((len (1- (length str))) (index len)) - (while (and (> index 0) (= (aref str index) ?\s)) + ;; to keep compatibility with Emacs 20 & 21: + ;; DO NOT REPLACE `?\ ' BY `?\s' + (while (and (> index 0) (= (aref str index) ?\ )) (setq index (1- index))) (if (= index len) str @@ -5579,12 +6050,12 @@ killed after process termination." (defun ebnf-make-empty (&optional width) - (vector 'ebnf-generate-empty - 'ignore - 'ignore - 0.0 - 0.0 - (or width ebnf-horizontal-space))) + (vector 'ebnf-generate-empty ; 0 generator + 'ignore ; 1 width fun + 'ignore ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + (or width ebnf-horizontal-space))) ; 5 width (defun ebnf-make-terminal (name) @@ -5606,19 +6077,19 @@ killed after process termination." (defun ebnf-make-terminal1 (name gen-func dim-func) - (vector gen-func - 'ignore - dim-func - 0.0 - 0.0 - 0.0 - (let ((len (length name))) + (vector gen-func ; 0 generatore + 'ignore ; 1 width fun + dim-func ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + (let ((len (length name))) ; 6 name (cond ((> len 3) name) ((= len 3) (concat name " ")) ((= len 2) (concat " " name " ")) ((= len 1) (concat " " name " ")) (t " "))) - ebnf-default-p)) + ebnf-default-p)) ; 7 is default? (defun ebnf-make-one-or-more (list-part &optional sep-part) @@ -5636,70 +6107,71 @@ killed after process termination." (defun ebnf-make-or-more1 (gen-func dim-func list-part sep-part) - (vector gen-func - 'ebnf-element-width - dim-func - 0.0 - 0.0 - 0.0 - (if (listp list-part) + (vector gen-func ; 0 generator + 'ebnf-element-width ; 1 width fun + dim-func ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + (if (listp list-part) ; 6 element (ebnf-make-sequence list-part) list-part) - (if (and sep-part (listp sep-part)) + (if (and sep-part (listp sep-part)) ; 7 separator (ebnf-make-sequence sep-part) sep-part))) (defun ebnf-make-production (name prod action) - (vector 'ebnf-generate-production - 'ignore - 'ebnf-production-dimension - 0.0 - 0.0 - 0.0 - name - prod - action)) + (vector 'ebnf-generate-production ; 0 generator + 'ignore ; 1 width fun + 'ebnf-production-dimension ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + name ; 6 production name + prod ; 7 production body + action)) ; 8 production action (defun ebnf-make-alternative (body) - (vector 'ebnf-generate-alternative - 'ebnf-alternative-width - 'ebnf-alternative-dimension - 0.0 - 0.0 - 0.0 - body)) + (vector 'ebnf-generate-alternative ; 0 generator + 'ebnf-alternative-width ; 1 width fun + 'ebnf-alternative-dimension ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + body)) ; 6 alternative list (defun ebnf-make-optional (body) - (vector 'ebnf-generate-optional - 'ebnf-alternative-width - 'ebnf-optional-dimension - 0.0 - 0.0 - 0.0 - body)) + (vector 'ebnf-generate-optional ; 0 generator + 'ebnf-alternative-width ; 1 width fun + 'ebnf-optional-dimension ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + body)) ; 6 optional element (defun ebnf-make-except (factor exception) - (vector 'ebnf-generate-except - 'ignore - 'ebnf-except-dimension - 0.0 - 0.0 - 0.0 - factor - exception)) + (vector 'ebnf-generate-except ; 0 generator + 'ignore ; 1 width fun + 'ebnf-except-dimension ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + factor ; 6 base element + exception)) ; 7 exception element (defun ebnf-make-repeat (times primary &optional upper) - (vector 'ebnf-generate-repeat - 'ignore - 'ebnf-repeat-dimension - 0.0 - 0.0 - 0.0 + (vector 'ebnf-generate-repeat ; 0 generator + 'ignore ; 1 width fun + 'ebnf-repeat-dimension ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + ; 6 times (cond ((and times upper) ; L * U, L * L (if (string= times upper) (if (string= times "") @@ -5712,27 +6184,27 @@ killed after process termination." (concat "* " upper)) (t ; * " * ")) - primary)) + primary)) ; 7 element (defun ebnf-make-sequence (seq) - (vector 'ebnf-generate-sequence - 'ebnf-sequence-width - 'ebnf-sequence-dimension - 0.0 - 0.0 - 0.0 - seq)) + (vector 'ebnf-generate-sequence ; 0 generator + 'ebnf-sequence-width ; 1 width fun + 'ebnf-sequence-dimension ; 2 dimension fun + 0.0 ; 3 entry + 0.0 ; 4 height + 0.0 ; 5 width + seq)) ; 6 sequence (defun ebnf-make-dup-sequence (node seq) - (vector 'ebnf-generate-sequence - 'ebnf-sequence-width - 'ebnf-sequence-dimension - (ebnf-node-entry node) - (ebnf-node-height node) - (ebnf-node-width node) - seq)) + (vector 'ebnf-generate-sequence ; 0 generator + 'ebnf-sequence-width ; 1 width fun + 'ebnf-sequence-dimension ; 2 dimension fun + (ebnf-node-entry node) ; 3 entry + (ebnf-node-height node) ; 4 height + (ebnf-node-width node) ; 5 width + seq)) ; 6 sequence ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -5819,13 +6291,17 @@ killed after process termination." (defun ebnf-token-alternative (body sequence) (if (null body) (if (cdr sequence) + ;; no alternative sequence - (cons (car sequence) + ;; empty element + (cons (car sequence) ; token (ebnf-make-empty))) - (cons (car sequence) + (cons (car sequence) ; token (let ((seq (cdr sequence))) (if (and (= (length body) 1) (null seq)) + ;; alternative with one element (car body) + ;; a real alternative (ebnf-make-alternative (nreverse (if seq (cons seq body) body)))))))) @@ -5860,6 +6336,28 @@ killed after process termination." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Log message + + +(defun ebnf-log-header (format-str &rest args) + (when ebnf-log + (apply + 'ebnf-log + (concat + "\n\n===============================================================\n\n" + format-str) + args))) + + +(defun ebnf-log (format-str &rest args) + (when ebnf-log + (save-excursion + (set-buffer (get-buffer-create "*Ebnf2ps Log*")) + (goto-char (point-max)) + (insert (apply 'format format-str args) "\n")))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; To make this file smaller, some commands go in a separate file. ;; But autoload them here to make the separation invisible. diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index d3e00888889..b9f0986c33e 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index eecd4682fd1..196c22b4a08 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index 932c1f32ec5..3f46b0bbbe3 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 9ee4b515eed..6c704916c65 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 7e353247b04..a6407a3ffa6 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index cb843b4ecd8..b9865613765 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 7bc904f8319..8f6be334465 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el index 580d8d9e4bf..c2aa2dbb3ac 100644 --- a/lisp/progmodes/glasses.el +++ b/lisp/progmodes/glasses.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index fd93015ab2c..bafe42b950f 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 97144fec83b..2131aebe2a8 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 8096dee59e2..bb791b18c1b 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 7720b441700..bb0a3c634dd 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -13,7 +13,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el index 9c47cf96e2b..77a38f6016d 100644 --- a/lisp/progmodes/icon.el +++ b/lisp/progmodes/icon.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el index 030f4a9f0c4..d005c6de63e 100644 --- a/lisp/progmodes/idlw-complete-structtag.el +++ b/lisp/progmodes/idlw-complete-structtag.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index 030b785acdf..e7f0fa1677a 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -12,7 +12,7 @@ ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 3b9fb5a896a..f903d490565 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -14,7 +14,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/idlw-toolbar.el b/lisp/progmodes/idlw-toolbar.el index ddf08755544..2d143a3ddaa 100644 --- a/lisp/progmodes/idlw-toolbar.el +++ b/lisp/progmodes/idlw-toolbar.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 4c58919ec1f..1e600d6c456 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -14,7 +14,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 02d44e55019..57142c0c043 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el index 01f9ecbc7a3..c69b7a13cb9 100644 --- a/lisp/progmodes/ld-script.el +++ b/lisp/progmodes/ld-script.el @@ -10,7 +10,7 @@ ;; 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) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; This program is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el index bd31f731693..831d0fd5bb9 100644 --- a/lisp/progmodes/m4-mode.el +++ b/lisp/progmodes/m4-mode.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 6178e7e47cd..d3caaf36fc9 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -13,7 +13,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/mantemp.el b/lisp/progmodes/mantemp.el index 2084f364d55..63661eeb27d 100644 --- a/lisp/progmodes/mantemp.el +++ b/lisp/progmodes/mantemp.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, but diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 8215befc1de..a2fd9cdab04 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 146b228453e..60dcdc625a8 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -3,27 +3,29 @@ ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 ;; Free Software Foundation, Inc. -;; 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, write to the Free -;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301 USA - ;; Author: Pieter E.J. Pareit <pieter.pareit@gmail.com> ;; Maintainer: Pieter E.J. Pareit <pieter.pareit@gmail.com> ;; Created: 09 Nov 2002 ;; Version: 0.1 ;; Keywords: Knuth mix mixal asm mixvm "The Art Of Computer Programming" +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + ;;; Commentary: ;; Major mode for the mix asm language. ;; The mix asm language is described in "The Art Of Computer Programming". diff --git a/lisp/progmodes/octave-hlp.el b/lisp/progmodes/octave-hlp.el index 5c2bd2f34ee..744d4cf13bf 100644 --- a/lisp/progmodes/octave-hlp.el +++ b/lisp/progmodes/octave-hlp.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el index b46510b5ac9..83d99ab8bee 100644 --- a/lisp/progmodes/octave-inf.el +++ b/lisp/progmodes/octave-inf.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index be56d388330..adc1b44edaa 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index 3fe57e00c7a..02fdbbbf050 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 75920a43aa7..cfef0eedfe4 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -15,7 +15,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index cb451791dbe..7cff1bc516e 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el index db4cd2dd339..40eca7c1bd1 100644 --- a/lisp/progmodes/ps-mode.el +++ b/lisp/progmodes/ps-mode.el @@ -13,7 +13,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 26fc122631d..c3caa7e397c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -1359,7 +1359,7 @@ buffer for a list of commands.)" (path (getenv "PYTHONPATH")) (process-environment ; to import emacs.py (cons (concat "PYTHONPATH=" data-directory - (if path (concat ":" path))) + (if path (concat path-separator path))) process-environment))) (apply 'make-comint-in-buffer "Python" (if new (generate-new-buffer "*Python*") "*Python*") diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index a112cee62bb..5bf7cb1e9eb 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 8a8d23db169..f6ef646069b 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el index 89074dc8fe0..db5d6552c84 100644 --- a/lisp/progmodes/simula.el +++ b/lisp/progmodes/simula.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index a3401dccbcb..1187129bb33 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -14,7 +14,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 0495b683bad..c7576a27114 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -12,7 +12,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el index c70ec7eab6c..9aaee22b9a9 100644 --- a/lisp/progmodes/vera-mode.el +++ b/lisp/progmodes/vera-mode.el @@ -19,7 +19,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index c549d066b64..a1bd32a313d 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -19,7 +19,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 5b5c13342ad..2762e8dbd55 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -11,7 +11,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index d2ec1781a54..0beca9e985e 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, |