aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-05-16 12:58:56 +0300
committerEli Zaretskii2013-05-16 12:58:56 +0300
commita9519e2685d19b13ce4e3e1ba13f97569013627e (patch)
tree6a9e0e35514c400749f23c891e9a95577fb9bfc1
parent3946d31b7bcf2a7dceacb86598823360f457cd19 (diff)
parent2d4bf34b5b83b3728b2fb18a72536f3e14afcf34 (diff)
downloademacs-a9519e2685d19b13ce4e3e1ba13f97569013627e.tar.gz
emacs-a9519e2685d19b13ce4e3e1ba13f97569013627e.zip
Merge from trunk.
-rw-r--r--ChangeLog12
-rw-r--r--Makefile.in12
-rw-r--r--admin/ChangeLog10
-rw-r--r--admin/cus-test.el57
-rwxr-xr-xadmin/quick-install-emacs8
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/search.texi2
-rw-r--r--doc/lispref/ChangeLog16
-rw-r--r--doc/lispref/help.texi11
-rw-r--r--doc/lispref/loading.texi2
-rw-r--r--etc/.gitignore1
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS9
-rw-r--r--etc/PROBLEMS2
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lib-src/makefile.w32-in4
-rw-r--r--lib/sig2str.c12
-rw-r--r--lib/stdio.in.h14
-rw-r--r--lisp/ChangeLog145
-rw-r--r--lisp/cedet/ChangeLog6
-rw-r--r--lisp/cedet/semantic/symref/list.el6
-rw-r--r--lisp/comint.el9
-rw-r--r--lisp/completion.el1
-rw-r--r--lisp/cus-dep.el38
-rw-r--r--lisp/cus-start.el3
-rw-r--r--lisp/emulation/tpu-edt.el2
-rw-r--r--lisp/erc/ChangeLog8
-rw-r--r--lisp/erc/erc-list.el6
-rw-r--r--lisp/erc/erc-menu.el4
-rw-r--r--lisp/erc/erc-ring.el4
-rw-r--r--lisp/eshell/esh-opt.el11
-rw-r--r--lisp/faces.el1
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/shr-color.el4
-rw-r--r--lisp/international/ccl.el9
-rw-r--r--lisp/isearch.el25
-rw-r--r--lisp/jit-lock.el2
-rw-r--r--lisp/loadup.el30
-rw-r--r--lisp/master.el12
-rw-r--r--lisp/minibuffer.el1
-rw-r--r--lisp/nxml/nxml-mode.el52
-rw-r--r--lisp/nxml/nxml-rap.el86
-rw-r--r--lisp/nxml/rng-valid.el53
-rw-r--r--lisp/nxml/xmltok.el290
-rw-r--r--lisp/obsolete/old-whitespace.el8
-rw-r--r--lisp/org/org-pcomplete.el1
-rw-r--r--lisp/pcmpl-linux.el7
-rw-r--r--lisp/progmodes/octave.el45
-rw-r--r--lisp/progmodes/subword.el2
-rw-r--r--lisp/progmodes/vhdl-mode.el813
-rw-r--r--lisp/shell.el7
-rw-r--r--lisp/simple.el18
-rw-r--r--lisp/term/vt100.el1
-rw-r--r--lisp/term/xterm.el2
-rw-r--r--lisp/textmodes/refill.el10
-rw-r--r--lisp/textmodes/rst.el2
-rw-r--r--lisp/type-break.el4
-rw-r--r--lisp/url/ChangeLog4
-rw-r--r--lisp/url/url-news.el7
-rw-r--r--m4/manywarnings.m46
-rw-r--r--m4/warnings.m415
-rw-r--r--msdos/ChangeLog4
-rw-r--r--msdos/sed1x.inp2
-rw-r--r--nt/ChangeLog4
-rw-r--r--nt/README.W322
-rw-r--r--nt/makefile.w32-in4
-rw-r--r--src/ChangeLog28
-rw-r--r--src/Makefile.in2
-rw-r--r--src/doc.c4
-rw-r--r--src/lisp.h6
-rw-r--r--src/lread.c2
-rw-r--r--src/makefile.w32-in2
-rw-r--r--src/process.c454
73 files changed, 1387 insertions, 1077 deletions
diff --git a/ChangeLog b/ChangeLog
index 97c307f3817..ce2014288e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
12013-05-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 Merge from gnulib, incorporating:
4 2013-05-15 manywarnings: update for GCC 4.8.0
5 2013-05-15 stdio: use __REDIRECT for fwrite, fwrite_unlocked
6 2013-05-15 sig2str, stdio, warnings: port to clang
7
82013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9
10 * Makefile.in (install-doc): DOC file is not version specific any more.
11 * .bzrignore: Don't ignore DOC-* any more.
12
12013-05-13 Paul Eggert <eggert@cs.ucla.edu> 132013-05-13 Paul Eggert <eggert@cs.ucla.edu>
2 14
3 * configure.ac (LD_SWITCH_SYSTEM_TEMACS): OpenBSD needs -nopie. 15 * configure.ac (LD_SWITCH_SYSTEM_TEMACS): OpenBSD needs -nopie.
diff --git a/Makefile.in b/Makefile.in
index 13b452d30d1..583aa99f83d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -608,10 +608,6 @@ install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTR
608## guaranteed to do the right thing; eg if we are root and tar is 608## guaranteed to do the right thing; eg if we are root and tar is
609## preserving source permissions. 609## preserving source permissions.
610 610
611## We install only the relevant DOC file if possible
612## (ie DOC-${version}.buildnumber), otherwise DOC-${version}*.
613## (Note "otherwise" is inaccurate since 2009-08-23.)
614
615## Note that install-arch-indep deletes and recreates the entire 611## Note that install-arch-indep deletes and recreates the entire
616## installed etc/ directory, so we need it to run before this does. 612## installed etc/ directory, so we need it to run before this does.
617install-doc: src install-arch-indep 613install-doc: src install-arch-indep
@@ -619,13 +615,7 @@ install-doc: src install-arch-indep
619 umask 022; ${MKDIR_P} $(DESTDIR)${docdir} ; \ 615 umask 022; ${MKDIR_P} $(DESTDIR)${docdir} ; \
620 if [ `cd ./etc; /bin/pwd` != `cd $(DESTDIR)${docdir}; /bin/pwd` ]; \ 616 if [ `cd ./etc; /bin/pwd` != `cd $(DESTDIR)${docdir}; /bin/pwd` ]; \
621 then \ 617 then \
622 fullversion=`./src/emacs --version | sed -n '1 s/GNU Emacs *//p'`; \ 618 docfile="DOC"; \
623 if [ -f "./etc/DOC-$${fullversion}" ]; \
624 then \
625 docfile="DOC-$${fullversion}"; \
626 else \
627 docfile="DOC"; \
628 fi; \
629 echo "Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \ 619 echo "Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \
630 ${INSTALL_DATA} etc/$${docfile} $(DESTDIR)${docdir}/$${docfile}; \ 620 ${INSTALL_DATA} etc/$${docfile} $(DESTDIR)${docdir}/$${docfile}; \
631 $(set_installuser); \ 621 $(set_installuser); \
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 5ae948ad192..221d5c0586c 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,13 @@
12013-05-16 Glenn Morris <rgm@gnu.org>
2
3 * cus-test.el (cus-test-cus-load-groups): New function.
4 (cus-test-get-options): Add option to return groups.
5 (cus-test-noloads): Also check custom groups.
6
72013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8
9 * quick-install-emacs: Don't prune DOC-* files a any more.
10
12013-05-14 Glenn Morris <rgm@gnu.org> 112013-05-14 Glenn Morris <rgm@gnu.org>
2 12
3 * cus-test.el (cus-test-get-lisp-files): Ignore obsolete/. 13 * cus-test.el (cus-test-get-lisp-files): Ignore obsolete/.
diff --git a/admin/cus-test.el b/admin/cus-test.el
index e68ee7744e7..6b8ec9abe02 100644
--- a/admin/cus-test.el
+++ b/admin/cus-test.el
@@ -232,17 +232,38 @@ The detected problematic options are stored in `cus-test-errors'."
232 (length cus-test-tested-variables)) 232 (length cus-test-tested-variables))
233 (cus-test-errors-display)) 233 (cus-test-errors-display))
234 234
235(defun cus-test-get-options (regexp) 235(defun cus-test-cus-load-groups (&optional cus-load)
236 "Return a list of custom options matching REGEXP." 236 "Return a list of current custom groups.
237 (let (found) 237If CUS-LOAD is non-nil, include groups from cus-load.el."
238 (append (mapcar 'cdr custom-current-group-alist)
239 (if cus-load
240 (with-temp-buffer
241 (insert-file-contents (locate-library "cus-load.el"))
242 (search-forward "(put '")
243 (beginning-of-line)
244 (let (res)
245 (while (and (looking-at "^(put '\\(\\S-+\\)")
246 (zerop (forward-line 1)))
247 (push (intern (match-string 1)) res))
248 res)))))
249
250(defun cus-test-get-options (regexp &optional group)
251 "Return a list of custom options matching REGEXP.
252If GROUP is non-nil, return groups rather than options.
253If GROUP is `cus-load', include groups listed in cus-loads as well as
254currently defined groups."
255 (let ((groups (if group (cus-test-cus-load-groups (eq group 'cus-load))))
256 found)
238 (mapatoms 257 (mapatoms
239 (lambda (symbol) 258 (lambda (symbol)
240 (and 259 (and
241 (or 260 (if group
242 ;; (user-variable-p symbol) 261 (memq symbol groups)
243 (get symbol 'standard-value) 262 (or
244 ;; (get symbol 'saved-value) 263 ;; (user-variable-p symbol)
245 (get symbol 'custom-type)) 264 (get symbol 'standard-value)
265 ;; (get symbol 'saved-value)
266 (get symbol 'custom-type)))
246 (string-match regexp (symbol-name symbol)) 267 (string-match regexp (symbol-name symbol))
247 (not (member symbol cus-test-skip-list)) 268 (not (member symbol cus-test-skip-list))
248 (push symbol found)))) 269 (push symbol found))))
@@ -492,17 +513,17 @@ It is suitable for batch mode. E.g., invoke
492 513
493in the Emacs source directory." 514in the Emacs source directory."
494 (interactive) 515 (interactive)
495 (let (cus-loaded) 516 (let ((groups-loaded (cus-test-get-options "" 'cus-load))
517 cus-loaded groups-not-loaded)
496 518
497 (message "Running %s" 'cus-test-load-custom-loads) 519 (message "Running %s" 'cus-test-load-custom-loads)
498 (cus-test-load-custom-loads) 520 (cus-test-load-custom-loads)
499 (setq cus-loaded 521 (setq cus-loaded (cus-test-get-options ""))
500 (cus-test-get-options ""))
501 522
502 (message "Running %s" 'cus-test-load-libs) 523 (message "Running %s" 'cus-test-load-libs)
503 (cus-test-load-libs "all") 524 (cus-test-load-libs "all")
504 (setq cus-test-vars-not-cus-loaded 525 (setq cus-test-vars-not-cus-loaded (cus-test-get-options "")
505 (cus-test-get-options "")) 526 groups-not-loaded (cus-test-get-options "" t))
506 527
507 (dolist (o cus-loaded) 528 (dolist (o cus-loaded)
508 (setq cus-test-vars-not-cus-loaded 529 (setq cus-test-vars-not-cus-loaded
@@ -512,7 +533,15 @@ in the Emacs source directory."
512 (message "No options not loaded by custom-load-symbol found") 533 (message "No options not loaded by custom-load-symbol found")
513 (message "The following options were not loaded by custom-load-symbol:") 534 (message "The following options were not loaded by custom-load-symbol:")
514 (cus-test-message 535 (cus-test-message
515 (sort cus-test-vars-not-cus-loaded 'string<))))) 536 (sort cus-test-vars-not-cus-loaded 'string<)))
537
538 (dolist (o groups-loaded)
539 (setq groups-not-loaded (delete o groups-not-loaded)))
540
541 (if (not groups-not-loaded)
542 (message "No groups not in cus-load.el found")
543 (message "The following groups are not in cus-load.el:")
544 (cus-test-message (sort groups-not-loaded 'string<)))))
516 545
517(provide 'cus-test) 546(provide 'cus-test)
518 547
diff --git a/admin/quick-install-emacs b/admin/quick-install-emacs
index e74a2a5af49..98bd61f839d 100755
--- a/admin/quick-install-emacs
+++ b/admin/quick-install-emacs
@@ -105,8 +105,8 @@ and build directories reside.
105 105
106Optionally, $me can also remove old versions of 106Optionally, $me can also remove old versions of
107automatically generated files that are version-specific (such as the 107automatically generated files that are version-specific (such as the
108versioned emacs executables in the \`src' directory, and the DOC-* files 108versioned emacs executables in the \`src' directory).
109in the \`etc' directory). The latter action is called \`pruning,' and 109The latter action is called \`pruning,' and
110can be enabled using the \`-p' or \`--prune' options. 110can be enabled using the \`-p' or \`--prune' options.
111EOF 111EOF
112 exit 0 112 exit 0
@@ -209,10 +209,6 @@ maybe_mkdir "$DST_INFO"
209 209
210PRUNED="" 210PRUNED=""
211if test x"$PRUNE" != xno; then 211if test x"$PRUNE" != xno; then
212 for D in `ls -1t $BUILD/etc/DOC-* | sed 1d`; do
213 echo $REMOVE_CMD $D
214 PRUNED="$PRUNED $D"
215 done
216 for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do 212 for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do
217 echo $REMOVE_CMD $D 213 echo $REMOVE_CMD $D
218 PRUNED="$PRUNED $D" 214 PRUNED="$PRUNED $D"
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 1d72ba18860..14e9be8ba84 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12013-05-15 Juri Linkov <juri@jurta.org>
2
3 * search.texi (Repeat Isearch): Mention key `RET' to finish
4 editing the string. (Bug#13348)
5
12013-05-14 Glenn Morris <rgm@gnu.org> 62013-05-14 Glenn Morris <rgm@gnu.org>
2 7
3 * ack.texi (Acknowledgments): Don't mention obsolete sup-mouse.el. 8 * ack.texi (Acknowledgments): Don't mention obsolete sup-mouse.el.
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 377264223a5..e146177255e 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -175,7 +175,7 @@ element in the minibuffer, where you can edit it.
175 175
176@kindex M-e @r{(Incremental search)} 176@kindex M-e @r{(Incremental search)}
177 To edit the current search string in the minibuffer without 177 To edit the current search string in the minibuffer without
178replacing it with items from the search ring, type @kbd{M-e}. Type 178replacing it with items from the search ring, type @kbd{M-e}. Type @key{RET},
179@kbd{C-s} or @kbd{C-r} to finish editing the string and search for it. 179@kbd{C-s} or @kbd{C-r} to finish editing the string and search for it.
180 180
181@node Error in Isearch 181@node Error in Isearch
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 1a6fd5eca0d..249a2f21ccb 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * loading.texi (Autoload):
4 * help.texi (Documentation Basics, Accessing Documentation)
5 (Accessing Documentation, Accessing Documentation): DOC-* is now DOC.
6
12013-04-23 Glenn Morris <rgm@gnu.org> 72013-04-23 Glenn Morris <rgm@gnu.org>
2 8
3 * internals.texi (Writing Emacs Primitives): Remove obvious example. 9 * internals.texi (Writing Emacs Primitives): Remove obvious example.
@@ -24,8 +30,8 @@
242013-04-06 Chong Yidong <cyd@gnu.org> 302013-04-06 Chong Yidong <cyd@gnu.org>
25 31
26 * display.texi (Faces): Minor clarifications. 32 * display.texi (Faces): Minor clarifications.
27 (Defining Faces): Clarify default vs custom face specs. Document 33 (Defining Faces): Clarify default vs custom face specs.
28 face-spec-set. 34 Document face-spec-set.
29 35
30 * display.texi (Overlay Properties): 36 * display.texi (Overlay Properties):
31 * text.texi (Special Properties): Use the "anonymous face" 37 * text.texi (Special Properties): Use the "anonymous face"
@@ -2050,8 +2056,8 @@
2050 2056
20512012-02-04 Chong Yidong <cyd@gnu.org> 20572012-02-04 Chong Yidong <cyd@gnu.org>
2052 2058
2053 * functions.texi (What Is a Function): Add closures. Mention 2059 * functions.texi (What Is a Function): Add closures.
2054 "return value" terminology. Add xref for command-execute. 2060 Mention "return value" terminology. Add xref for command-execute.
2055 Remove unused "keystroke command" terminology. 2061 Remove unused "keystroke command" terminology.
2056 (Lambda Expressions): Give a different example than in the 2062 (Lambda Expressions): Give a different example than in the
2057 following subsection. Add xref to Anonymous Functions. 2063 following subsection. Add xref to Anonymous Functions.
@@ -11598,7 +11604,7 @@
11598 11604
115992002-05-13 Kim F. Storm <storm@cua.dk> 116052002-05-13 Kim F. Storm <storm@cua.dk>
11600 11606
11601 * variables.texi (Intro to Buffer-Local): Updated warning and 11607 * variables.texi (Intro to Buffer-Local): Update warning and
11602 example relating to changing buffer inside let. 11608 example relating to changing buffer inside let.
11603 11609
116042002-03-10 Jan Djärv <jan.h.d@swipnet.se> 116102002-03-10 Jan Djärv <jan.h.d@swipnet.se>
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 9fe069b84d0..aa77ba1f36d 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -93,13 +93,12 @@ When you define a variable with a @code{defvar} or related form
93(@pxref{Defining Variables}), the documentation is stored in the 93(@pxref{Defining Variables}), the documentation is stored in the
94variable's @code{variable-documentation} property. 94variable's @code{variable-documentation} property.
95 95
96@cindex @file{DOC-@var{version}} (documentation) file 96@cindex @file{DOC} (documentation) file
97@item 97@item
98To save memory, the documentation for preloaded functions and 98To save memory, the documentation for preloaded functions and
99variables (including primitive functions and autoloaded functions) is 99variables (including primitive functions and autoloaded functions) is
100not kept in memory, but in the file 100not kept in memory, but in the file
101@file{emacs/etc/DOC-@var{version}}, where @var{version} is the Emacs 101@file{emacs/etc/DOC}).
102version number (@pxref{Version Info}).
103 102
104@item 103@item
105When a function or variable is loaded from a byte-compiled file during 104When a function or variable is loaded from a byte-compiled file during
@@ -126,7 +125,7 @@ customization groups (but for function documentation, use the
126@code{documentation} command, below). 125@code{documentation} command, below).
127 126
128If the value recorded in the property list refers to a documentation 127If the value recorded in the property list refers to a documentation
129string stored in a @file{DOC-@var{version}} file or a byte-compiled 128string stored in a @file{DOC} file or a byte-compiled
130file, it looks up that string and returns it. If the property value 129file, it looks up that string and returns it. If the property value
131isn't @code{nil}, isn't a string, and doesn't refer to text in a file, 130isn't @code{nil}, isn't a string, and doesn't refer to text in a file,
132then it is evaluated as a Lisp expression to obtain a string. 131then it is evaluated as a Lisp expression to obtain a string.
@@ -296,12 +295,12 @@ memory in the function definitions and variable property lists.
296Emacs reads the file @var{filename} from the @file{emacs/etc} directory. 295Emacs reads the file @var{filename} from the @file{emacs/etc} directory.
297When the dumped Emacs is later executed, the same file will be looked 296When the dumped Emacs is later executed, the same file will be looked
298for in the directory @code{doc-directory}. Usually @var{filename} is 297for in the directory @code{doc-directory}. Usually @var{filename} is
299@code{"DOC-@var{version}"}. 298@code{"DOC"}.
300@end defun 299@end defun
301 300
302@defvar doc-directory 301@defvar doc-directory
303This variable holds the name of the directory which should contain the 302This variable holds the name of the directory which should contain the
304file @code{"DOC-@var{version}"} that contains documentation strings for 303file @code{"DOC"} that contains documentation strings for
305built-in and preloaded functions and variables. 304built-in and preloaded functions and variables.
306 305
307In most cases, this is the same as @code{data-directory}. They may be 306In most cases, this is the same as @code{data-directory}. They may be
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 51a060bc6c6..5c92307f7d5 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -483,7 +483,7 @@ For example,
483@noindent 483@noindent
484In this case, @code{"prolog"} is the name of the file to load, 169681 484In this case, @code{"prolog"} is the name of the file to load, 169681
485refers to the documentation string in the 485refers to the documentation string in the
486@file{emacs/etc/DOC-@var{version}} file (@pxref{Documentation Basics}), 486@file{emacs/etc/DOC} file (@pxref{Documentation Basics}),
487@code{t} means the function is interactive, and @code{nil} that it is 487@code{t} means the function is interactive, and @code{nil} that it is
488not a macro or a keymap. 488not a macro or a keymap.
489@end defun 489@end defun
diff --git a/etc/.gitignore b/etc/.gitignore
index 618d09438f8..8e12acbee0c 100644
--- a/etc/.gitignore
+++ b/etc/.gitignore
@@ -1,3 +1,2 @@
1DOC 1DOC
2DOC-*
3icons/ 2icons/
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 46564aeebcd..f4f17ac29cf 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * .gitignore: Don't ignore DOC-* any more.
4
12013-05-07 Paul Eggert <eggert@cs.ucla.edu> 52013-05-07 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295) 7 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
diff --git a/etc/NEWS b/etc/NEWS
index 144adf15506..5f238988820 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -282,6 +282,12 @@ when possible.
282*** Handlers for `file-acl' and `set-file-acl' for remote machines 282*** Handlers for `file-acl' and `set-file-acl' for remote machines
283which support POSIX ACLs. 283which support POSIX ACLs.
284 284
285** VHDL mode
286
287*** New options: `vhdl-actual-generic-name', `vhdl-beautify-options'.
288
289*** New commands: `vhdl-fix-statement-region', `vhdl-fix-statement-buffer'.
290
285** Woman 291** Woman
286 292
287*** The commands `woman-default-faces' and `woman-monochrome-faces' 293*** The commands `woman-default-faces' and `woman-monochrome-faces'
@@ -327,6 +333,9 @@ It is layered as:
327 333
328* Incompatible Lisp Changes in Emacs 24.4 334* Incompatible Lisp Changes in Emacs 24.4
329 335
336** Default process filers and sentinels are not nil any more.
337Instead they default to a function which does what the nil value used to do.
338
330** `read-event' does not return decoded chars in ttys any more. 339** `read-event' does not return decoded chars in ttys any more.
331Just as was the case in Emacs-22 and before, decoding of tty input according to 340Just as was the case in Emacs-22 and before, decoding of tty input according to
332keyboard-coding-system is not performed in read-event any more. But contrary 341keyboard-coding-system is not performed in read-event any more. But contrary
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 0cfc0ad0c14..7556c23daee 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -551,7 +551,7 @@ with CEDET 1.0pre4) or later.
551 551
552*** Self-documentation messages are garbled. 552*** Self-documentation messages are garbled.
553 553
554This means that the file `etc/DOC-...' doesn't properly correspond 554This means that the file `etc/DOC' doesn't properly correspond
555with the Emacs executable. Redumping Emacs and then installing the 555with the Emacs executable. Redumping Emacs and then installing the
556corresponding pair of files should fix the problem. 556corresponding pair of files should fix the problem.
557 557
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index bd7618e0a82..63108cae9a9 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * makefile.w32-in ($(DOC)): Use DOC rather than DOC-X.
4
12013-05-06 Paul Eggert <eggert@cs.ucla.edu> 52013-05-06 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * make-docfile.c (search_lisp_doc_at_eol) [DEBUG]: Fix typo, 7 * make-docfile.c (search_lisp_doc_at_eol) [DEBUG]: Fix typo,
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 5ec559ff985..9656a3badec 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -292,10 +292,10 @@ $(DOC): stamp_BLD $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(l
292 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1) 292 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
293 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2) 293 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
294 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT) 294 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT)
295 $(CP) $(DOC) ../etc/DOC-X 295 $(CP) $(DOC) ../etc/DOC
296 - mkdir "../src/$(OBJDIR)" 296 - mkdir "../src/$(OBJDIR)"
297 - mkdir "../src/$(OBJDIR)/etc" 297 - mkdir "../src/$(OBJDIR)/etc"
298 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X 298 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC
299 299
300{$(BLD)}.$(O){$(BLD)}.exe: 300{$(BLD)}.$(O){$(BLD)}.exe:
301 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS) 301 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
diff --git a/lib/sig2str.c b/lib/sig2str.c
index 8b36e2facf0..6ead2a71d13 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -325,21 +325,25 @@ sig2str (int signum, char *signame)
325 { 325 {
326 int rtmin = SIGRTMIN; 326 int rtmin = SIGRTMIN;
327 int rtmax = SIGRTMAX; 327 int rtmax = SIGRTMAX;
328 int base, delta;
328 329
329 if (! (rtmin <= signum && signum <= rtmax)) 330 if (! (rtmin <= signum && signum <= rtmax))
330 return -1; 331 return -1;
331 332
332 if (signum <= rtmin + (rtmax - rtmin) / 2) 333 if (signum <= rtmin + (rtmax - rtmin) / 2)
333 { 334 {
334 int delta = signum - rtmin; 335 strcpy (signame, "RTMIN");
335 sprintf (signame, delta ? "RTMIN+%d" : "RTMIN", delta); 336 base = rtmin;
336 } 337 }
337 else 338 else
338 { 339 {
339 int delta = rtmax - signum; 340 strcpy (signame, "RTMAX");
340 sprintf (signame, delta ? "RTMAX-%d" : "RTMAX", delta); 341 base = rtmax;
341 } 342 }
342 343
344 delta = signum - base;
345 if (delta != 0)
346 sprintf (signame + 5, "%+d", delta);
343 return 0; 347 return 0;
344 } 348 }
345} 349}
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index d6af99ca77d..06cbad00d3d 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -579,13 +579,23 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, 579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
580 which sometimes causes an unwanted diagnostic for fwrite calls. 580 which sometimes causes an unwanted diagnostic for fwrite calls.
581 This affects only function declaration attributes under certain 581 This affects only function declaration attributes under certain
582 versions of gcc, and is not needed for C++. */ 582 versions of gcc and clang, and is not needed for C++. */
583# if (0 < __USE_FORTIFY_LEVEL \ 583# if (0 < __USE_FORTIFY_LEVEL \
584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ 584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ 585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
586 && !defined __cplusplus) 586 && !defined __cplusplus)
587# undef fwrite 587# undef fwrite
588# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; }) 588# undef fwrite_unlocked
589extern size_t __REDIRECT (rpl_fwrite,
590 (const void *__restrict, size_t, size_t,
591 FILE *__restrict),
592 fwrite);
593extern size_t __REDIRECT (rpl_fwrite_unlocked,
594 (const void *__restrict, size_t, size_t,
595 FILE *__restrict),
596 fwrite_unlocked);
597# define fwrite rpl_fwrite
598# define fwrite_unlocked rpl_fwrite_unlocked
589# endif 599# endif
590# endif 600# endif
591_GL_CXXALIASWARN (fwrite); 601_GL_CXXALIASWARN (fwrite);
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ffcd36f4af1..e6f56664a52 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,142 @@
12013-05-16 Leo Liu <sdl.web@gmail.com>
2
3 * progmodes/octave.el (octave-indent-defun): Mark obsolete.
4 (octave-mode-menu, octave-mode-map): Remove its uses.
5
62013-05-16 Reto Zimmermann <reto@gnu.org>
7
8 Sync with upstream vhdl mode v3.34.2.
9 * progmodes/vhdl-mode.el: Use `push' throughout.
10 (vhdl-version, vhdl-time-stamp, vhdl-doc-release-notes): Update.
11 (vhdl-compiler-alist): Replace "\t\n" by "\\t\\n".
12 Add IBM & Quartus compiler. Enhance entry for ADVance MS compiler.
13 (vhdl-actual-generic-name): New option to derive actual generic name.
14 (vhdl-port-paste-signals): Replace formal by actual generics.
15 (vhdl-beautify): New name for old group vhdl-align. Update users.
16 (vhdl-beautify-options): New option.
17 (vhdl-last-input-event): New compat alias. Use throughout.
18 (vhdl-goto-line): Replace user level function `goto-line'.
19 (vhdl-mode-map): Add bindings for vhdl-fix-statement-region,
20 vhdl-fix-statement-buffer.
21 (vhdl-create-mode-menu): Add some entries.
22 (vhdl-align-region-groups): Respect vhdl-beautify-options.
23 (vhdl-align-inline-comment-region-1): Handle "--" inside string.
24 (vhdl-fixup-whitespace-region): Handle symbols at EOL.
25 (vhdl-fix-statement-region, vhdl-fix-statement-buffer): New commands,
26 to force statements on one line.
27 (vhdl-remove-trailing-spaces-region):
28 New, split from vhdl-remove-trailing-spaces.
29 (vhdl-beautify-region): Fix statements, trailing spaces, ^M character.
30 Respect vhdl-beautify-options.
31 (vhdl-update-sensitivity-list-buffer): If non-interactive save buffer.
32 (vhdl-update-sensitivity-list): Not add with index if exists without.
33 Not include array index with signal. Ignore keywords in comments.
34 (vhdl-get-visible-signals): Regexp tweaks.
35 (vhdl-template-component-inst): Handle empty library.
36 (vhdl-template-type): Add template for 'enum' type.
37 (vhdl-port-paste-generic-map, vhdl-port-paste-constants):
38 Use vhdl-replace-string.
39 (vhdl-port-paste-signals): Use vhdl-prepare-search-1.
40 (vhdl-speedbar-mode-map): Rename from vhdl-speedbar-key-map.
41 (vhdl-speedbar-initialize): Update for above name change.
42 (vhdl-compose-wire-components): Fix in handling of constants.
43 (vhdl-error-regexp-emacs-alist): New variable.
44 (vhdl-error-regexp-add-emacs): New function;
45 adds support for new compile.el (Emacs 22+)
46 (vhdl-generate-makefile-1): Change target order for single lib. units.
47 Allow use of absolute file names.
48
492013-05-16 Leo Liu <sdl.web@gmail.com>
50
51 * simple.el (prog-indent-sexp): Indent enclosing defun.
52
532013-05-15 Glenn Morris <rgm@gnu.org>
54
55 * cus-start.el (show-trailing-whitespace): Move to editing basics.
56 * faces.el (trailing-whitespace): Don't use whitespace-faces group.
57 * obsolete/old-whitespace.el (whitespace-faces): Remove group.
58 (whitespace-highlight): Move to whitespace group.
59
60 * comint.el (comint-source):
61 * pcmpl-linux.el (pcmpl-linux):
62 * shell.el (shell-faces):
63 * eshell/esh-opt.el (eshell-opt):
64 * international/ccl.el (ccl): Remove empty custom groups.
65
66 * completion.el (dynamic-completion-mode):
67 * jit-lock.el (jit-lock-debug-mode):
68 * minibuffer.el (completion-in-region-mode):
69 * type-break.el (type-break-mode-line-message-mode)
70 (type-break-query-mode):
71 * emulation/tpu-edt.el (tpu-edt-mode):
72 * progmodes/subword.el (global-subword-mode, global-superword-mode):
73 * progmodes/vhdl-mode.el (vhdl-electric-mode, vhdl-stutter-mode):
74 * term/vt100.el (vt100-wide-mode): Specify explicit :group.
75
76 * term/xterm.el (xterm): Change parent group to terminals.
77
78 * master.el (master): Remove empty custom group.
79 (master-mode): Remove unused :group argument.
80 * textmodes/refill.el (refill): Remove empty custom group.
81 (refill-mode): Remove unused :group argument.
82
83 * textmodes/rst.el (rst-compile-toolsets): Use rst-compile group.
84
85 * cus-dep.el: Provide a feature.
86 (custom-make-dependencies): Ignore dotfiles (dir-locals).
87 Don't mistakenly ignore files whose basenames match a basename
88 from preloaded-file-list (eg cedet/ede/simple.el).
89 Add a fallback method for getting :group.
90
912013-05-15 Juri Linkov <juri@jurta.org>
92
93 * isearch.el (isearch-char-by-name): Rename from
94 `isearch-insert-char-by-name'. Doc fix.
95 (isearch-forward): Mention `isearch-char-by-name' in
96 the docstring. (Bug#13348)
97
98 * isearch.el (minibuffer-local-isearch-map): Bind "\r" to
99 `exit-minibuffer' instead of
100 `isearch-nonincremental-exit-minibuffer'.
101 (isearch-edit-string): Remove mention of
102 `isearch-nonincremental-exit-minibuffer' from docstring.
103 (isearch-nonincremental-exit-minibuffer): Mark as obsolete.
104 (isearch-forward-exit-minibuffer)
105 (isearch-reverse-exit-minibuffer): Add docstring. (Bug#13348)
106
1072013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
108
109 * loadup.el: Just use unversioned DOC.
110
111 * nxml/nxml-mode.el: Treat unclosed <[[, <?, comment, and other
112 literals as extending to EOB.
113 (nxml-last-fontify-end): Remove unused variable.
114 (nxml-after-change1): Use with-silent-modifications.
115 (nxml-extend-after-change-region): Simplify.
116 (nxml-extend-after-change-region1): Remove function.
117 (nxml-after-change1): Don't adjust for dependent regions.
118 (nxml-fontify-matcher): Simplify.
119 * nxml/xmltok.el (xmltok-dependent-regions): Remove variable.
120 (xmltok-add-dependent): Remove function.
121 (xmltok-scan-after-lt, xmltok-scan-after-processing-instruction-open)
122 (xmltok-scan-after-comment-open, xmltok-scan-prolog-literal)
123 (xmltok-scan-prolog-after-processing-instruction-open): Treat
124 unclosed <[[, <?, comment, and other literals as extending to EOB.
125 * nxml/rng-valid.el (rng-mark-xmltok-dependent-regions)
126 (rng-mark-xmltok-dependent-region, rng-dependent-region-changed):
127 Remove functions.
128 (rng-do-some-validation-1): Don't mark dependent regions.
129 * nxml/nxml-rap.el (nxml-adjust-start-for-dependent-regions)
130 (nxml-mark-parse-dependent-regions, nxml-mark-parse-dependent-region)
131 (nxml-clear-dependent-regions): Remove functions.
132 (nxml-scan-after-change, nxml-scan-prolog, nxml-tokenize-forward)
133 (nxml-ensure-scan-up-to-date):
134 Don't clear&mark dependent regions.
135
12013-05-15 Leo Liu <sdl.web@gmail.com> 1362013-05-15 Leo Liu <sdl.web@gmail.com>
2 137
3 * progmodes/octave.el (octave-goto-function-definition): Improve 138 * progmodes/octave.el (octave-goto-function-definition):
4 and fix callers. 139 Improve and fix callers.
5 140
62013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 1412013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7 142
@@ -277,7 +412,8 @@
277 their declaration. 412 their declaration.
278 (vhdl-mode-syntax-table-init): Remove. 413 (vhdl-mode-syntax-table-init): Remove.
279 414
280 * progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on last change. 415 * progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on
416 last change.
281 417
282 * progmodes/ld-script.el (ld-script-mode-syntax-table): Use symbol 418 * progmodes/ld-script.el (ld-script-mode-syntax-table): Use symbol
283 syntax for "_". 419 syntax for "_".
@@ -292,7 +428,8 @@
292 Handle a _ with symbol syntax. 428 Handle a _ with symbol syntax.
293 (autoconf-mode): Don't change the syntax-table for imenu and font-lock. 429 (autoconf-mode): Don't change the syntax-table for imenu and font-lock.
294 430
295 * progmodes/ada-mode.el (ada-mode-abbrev-table): Consolidate declaration. 431 * progmodes/ada-mode.el (ada-mode-abbrev-table):
432 Consolidate declaration.
296 (ada-mode-syntax-table, ada-mode-symbol-syntax-table): Initialize in 433 (ada-mode-syntax-table, ada-mode-symbol-syntax-table): Initialize in
297 the declaration. 434 the declaration.
298 (ada-create-syntax-table): Remove. 435 (ada-create-syntax-table): Remove.
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 6d62e92bb76..0474559fe9e 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,9 @@
12013-05-15 Glenn Morris <rgm@gnu.org>
2
3 * semantic/symref/list.el (semantic-symref-auto-expand-results)
4 (semantic-symref-results-mode-hook)
5 (semantic-symref-results-summary-function): Fix :group.
6
12013-05-14 Glenn Morris <rgm@gnu.org> 72013-05-14 Glenn Morris <rgm@gnu.org>
2 8
3 * ede/simple.el, semantic/java.el: Set generated-autoload-load-name. 9 * ede/simple.el, semantic/java.el: Set generated-autoload-load-name.
diff --git a/lisp/cedet/semantic/symref/list.el b/lisp/cedet/semantic/symref/list.el
index 2391e59e1f4..c1f0a092afc 100644
--- a/lisp/cedet/semantic/symref/list.el
+++ b/lisp/cedet/semantic/symref/list.el
@@ -178,12 +178,12 @@ Display the references in`semantic-symref-results-mode'."
178 178
179(defcustom semantic-symref-auto-expand-results nil 179(defcustom semantic-symref-auto-expand-results nil
180 "Non-nil to expand symref results on buffer creation." 180 "Non-nil to expand symref results on buffer creation."
181 :group 'semantic-symref 181 :group 'semantic-symref-results-mode
182 :type 'boolean) 182 :type 'boolean)
183 183
184(defcustom semantic-symref-results-mode-hook nil 184(defcustom semantic-symref-results-mode-hook nil
185 "Hook run when `semantic-symref-results-mode' starts." 185 "Hook run when `semantic-symref-results-mode' starts."
186 :group 'semantic-symref 186 :group 'semantic-symref-results-mode
187 :type 'hook) 187 :type 'hook)
188 188
189(defvar semantic-symref-current-results nil 189(defvar semantic-symref-current-results nil
@@ -217,7 +217,7 @@ RESULTS is an object of class `semantic-symref-results'."
217(defcustom semantic-symref-results-summary-function 'semantic-format-tag-prototype 217(defcustom semantic-symref-results-summary-function 'semantic-format-tag-prototype
218 "*Function to use when creating items in Imenu. 218 "*Function to use when creating items in Imenu.
219Some useful functions are found in `semantic-format-tag-functions'." 219Some useful functions are found in `semantic-format-tag-functions'."
220 :group 'semantic-symref 220 :group 'semantic-symref-results-mode
221 :type semantic-format-tag-custom-list) 221 :type semantic-format-tag-custom-list)
222 222
223(defun semantic-symref-results-dump (results) 223(defun semantic-symref-results-dump (results)
diff --git a/lisp/comint.el b/lisp/comint.el
index c796f4fda31..956e8f86ccb 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -148,10 +148,11 @@
148 "Completion facilities in comint." 148 "Completion facilities in comint."
149 :group 'comint) 149 :group 'comint)
150 150
151(defgroup comint-source nil 151;; Unused.
152 "Source finding facilities in comint." 152;;; (defgroup comint-source nil
153 :prefix "comint-" 153;;; "Source finding facilities in comint."
154 :group 'comint) 154;;; :prefix "comint-"
155;;; :group 'comint)
155 156
156(defvar comint-prompt-regexp "^" 157(defvar comint-prompt-regexp "^"
157 "Regexp to recognize prompts in the inferior process. 158 "Regexp to recognize prompts in the inferior process.
diff --git a/lisp/completion.el b/lisp/completion.el
index 974d59c9af5..3fbc3c05fb4 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -2342,6 +2342,7 @@ With a prefix argument ARG, enable the mode if ARG is positive,
2342and disable it otherwise. If called from Lisp, enable the mode 2342and disable it otherwise. If called from Lisp, enable the mode
2343if ARG is omitted or nil." 2343if ARG is omitted or nil."
2344 :global t 2344 :global t
2345 :group 'completion
2345 ;; This is always good, not specific to dynamic-completion-mode. 2346 ;; This is always good, not specific to dynamic-completion-mode.
2346 (define-key function-key-map [C-return] [?\C-\r]) 2347 (define-key function-key-map [C-return] [?\C-\r])
2347 2348
diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el
index 12a3211a0b0..4c8a9773c3a 100644
--- a/lisp/cus-dep.el
+++ b/lisp/cus-dep.el
@@ -61,16 +61,14 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
61 ;; the args as directories after we are done. 61 ;; the args as directories after we are done.
62 (while (setq subdir (pop command-line-args-left)) 62 (while (setq subdir (pop command-line-args-left))
63 (message "Directory %s" subdir) 63 (message "Directory %s" subdir)
64 (let ((files (directory-files subdir nil "\\`[^=].*\\.el\\'")) 64 (let ((files (directory-files subdir nil "\\`[^=.].*\\.el\\'"))
65 (default-directory (expand-file-name subdir)) 65 (default-directory (expand-file-name subdir))
66 (preloaded (concat "\\`" 66 (preloaded (concat "\\`\\(\\./+\\)?"
67 (regexp-opt (mapcar 67 (regexp-opt preloaded-file-list t)
68 'file-name-base
69 preloaded-file-list) t)
70 "\\.el\\'"))) 68 "\\.el\\'")))
71 (dolist (file files) 69 (dolist (file files)
72 (unless (or (string-match custom-dependencies-no-scan-regexp file) 70 (unless (or (string-match custom-dependencies-no-scan-regexp file)
73 (string-match preloaded file) 71 (string-match preloaded (format "%s/%s" subdir file))
74 (not (file-exists-p file))) 72 (not (file-exists-p file)))
75 (erase-buffer) 73 (erase-buffer)
76 (kill-all-local-variables) 74 (kill-all-local-variables)
@@ -91,13 +89,30 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
91 (while (re-search-forward 89 (while (re-search-forward
92 "^(def\\(custom\\|face\\|group\\)" nil t) 90 "^(def\\(custom\\|face\\|group\\)" nil t)
93 (beginning-of-line) 91 (beginning-of-line)
94 (let ((expr (read (current-buffer)))) 92 (let ((type (match-string 1))
93 (expr (read (current-buffer))))
95 (condition-case nil 94 (condition-case nil
96 (let ((custom-dont-initialize t)) 95 (let ((custom-dont-initialize t))
97 ;; Why do we need to eval just for the name? 96 ;; Eval to get the 'custom-group, -tag,
98 (eval expr) 97 ;; -version, group-documentation etc properties.
99 (put (nth 1 expr) 'custom-where name)) 98 (put (nth 1 expr) 'custom-where name)
100 (error nil)))) 99 (eval expr))
100 ;; Eval failed for some reason. Eg maybe the
101 ;; defcustom uses something defined earlier
102 ;; in the file (we haven't loaded the file).
103 ;; In most cases, we can still get the :group.
104 (error
105 (ignore-errors
106 (let ((group (cadr (memq :group expr))))
107 (and group
108 (eq (car group) 'quote)
109 (custom-add-to-group
110 (cadr group)
111 (nth 1 expr)
112 (intern (format "custom-%s"
113 (if (equal type "custom")
114 "variable"
115 type)))))))))))
101 (error nil))))))))) 116 (error nil)))))))))
102 (message "Generating %s..." generated-custom-dependencies-file) 117 (message "Generating %s..." generated-custom-dependencies-file)
103 (set-buffer (find-file-noselect generated-custom-dependencies-file)) 118 (set-buffer (find-file-noselect generated-custom-dependencies-file))
@@ -187,5 +202,6 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
187 (message "Generating %s...done" generated-custom-dependencies-file)) 202 (message "Generating %s...done" generated-custom-dependencies-file))
188 203
189 204
205(provide 'cus-dep)
190 206
191;;; cus-dep.el ends here 207;;; cus-dep.el ends here
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 43d71ceec95..cf94b6300dd 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -449,7 +449,8 @@ since it could result in memory overflow and make Emacs crash."
449 (other :tag "Always (t)" :value t)) 449 (other :tag "Always (t)" :value t))
450 "24.3") 450 "24.3")
451 ;; xdisp.c 451 ;; xdisp.c
452 (show-trailing-whitespace whitespace-faces boolean nil 452 ;; The whitespace group is for whitespace.el.
453 (show-trailing-whitespace editing-basics boolean nil
453 :safe booleanp) 454 :safe booleanp)
454 (scroll-step windows integer) 455 (scroll-step windows integer)
455 (scroll-conservatively windows integer) 456 (scroll-conservatively windows integer)
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index 6ec6ad810a4..1ec0ecc943c 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -983,7 +983,7 @@ and the total number of lines in the buffer."
983With a prefix argument ARG, enable the mode if ARG is positive, 983With a prefix argument ARG, enable the mode if ARG is positive,
984and disable it otherwise. If called from Lisp, enable the mode 984and disable it otherwise. If called from Lisp, enable the mode
985if ARG is omitted or nil." 985if ARG is omitted or nil."
986 :global t 986 :global t :group 'tpu
987 (if tpu-edt-mode (tpu-edt-on) (tpu-edt-off))) 987 (if tpu-edt-mode (tpu-edt-on) (tpu-edt-off)))
988 988
989(defalias 'TPU-EDT-MODE 'tpu-edt-mode) 989(defalias 'TPU-EDT-MODE 'tpu-edt-mode)
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index f2c1dbe2367..f4293c8f083 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,11 @@
12013-05-15 Glenn Morris <rgm@gnu.org>
2
3 * erc-list.el (erc-list):
4 * erc-menu.el (erc-menu):
5 * erc-ring.el (erc-ring): Define custom groups, for define-erc-module.
6
7 * erc-list.el: Provide a feature.
8
12013-05-09 Glenn Morris <rgm@gnu.org> 92013-05-09 Glenn Morris <rgm@gnu.org>
2 10
3 * erc-desktop-notifications.el (erc-notifications-icon): 11 * erc-desktop-notifications.el (erc-notifications-icon):
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index 3d78c1b7b9f..f11dd98ca37 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -30,6 +30,10 @@
30 30
31(require 'erc) 31(require 'erc)
32 32
33(defgroup erc-list nil
34 "Support for the /list command."
35 :group 'erc)
36
33;; This is implicitly the width of the channel name column. Pick 37;; This is implicitly the width of the channel name column. Pick
34;; something small enough that the topic has a chance of being 38;; something small enough that the topic has a chance of being
35;; readable, but long enough that most channel names won't make for 39;; readable, but long enough that most channel names won't make for
@@ -214,6 +218,8 @@ to RFC and send the LIST header (#321) at start of list transmission."
214 "")))) 218 ""))))
215(put 'erc-cmd-LIST 'do-not-parse-args t) 219(put 'erc-cmd-LIST 'do-not-parse-args t)
216 220
221(provide 'erc-list)
222
217;;; erc-list.el ends here 223;;; erc-list.el ends here
218;; 224;;
219;; Local Variables: 225;; Local Variables:
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el
index 70c9ae65427..ab11df92063 100644
--- a/lisp/erc/erc-menu.el
+++ b/lisp/erc/erc-menu.el
@@ -30,6 +30,10 @@
30(require 'erc) 30(require 'erc)
31(require 'easymenu) 31(require 'easymenu)
32 32
33(defgroup erc-menu nil
34 "ERC menu support."
35 :group 'erc)
36
33(defvar erc-menu-definition 37(defvar erc-menu-definition
34 (list "ERC" 38 (list "ERC"
35 ["Connect to server..." erc t] 39 ["Connect to server..." erc t]
diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el
index ac5aaf23bc3..b4244eaa4a6 100644
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -38,6 +38,10 @@
38(require 'comint) 38(require 'comint)
39(require 'ring) 39(require 'ring)
40 40
41(defgroup erc-ring nil
42 "An input ring for ERC."
43 :group 'erc)
44
41;;;###autoload (autoload 'erc-ring-mode "erc-ring" nil t) 45;;;###autoload (autoload 'erc-ring-mode "erc-ring" nil t)
42(define-erc-module ring nil 46(define-erc-module ring nil
43 "Stores input in a ring so that previous commands and messages can 47 "Stores input in a ring so that previous commands and messages can
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el
index 6044759f8df..6a37f97bf20 100644
--- a/lisp/eshell/esh-opt.el
+++ b/lisp/eshell/esh-opt.el
@@ -27,11 +27,12 @@
27 27
28(eval-when-compile (require 'esh-ext)) 28(eval-when-compile (require 'esh-ext))
29 29
30(defgroup eshell-opt nil 30;; Unused.
31 "The options processing code handles command argument parsing for 31;;; (defgroup eshell-opt nil
32Eshell commands implemented in Lisp." 32;;; "The options processing code handles command argument parsing for
33 :tag "Command options processing" 33;;; Eshell commands implemented in Lisp."
34 :group 'eshell) 34;;; :tag "Command options processing"
35;;; :group 'eshell)
35 36
36;;; User Functions: 37;;; User Functions:
37 38
diff --git a/lisp/faces.el b/lisp/faces.el
index 6b4441e2814..d570140e7e6 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2292,7 +2292,6 @@ terminal type to a different value."
2292 (t :inverse-video t)) 2292 (t :inverse-video t))
2293 "Basic face for highlighting trailing whitespace." 2293 "Basic face for highlighting trailing whitespace."
2294 :version "21.1" 2294 :version "21.1"
2295 :group 'whitespace-faces ; like `show-trailing-whitespace'
2296 :group 'basic-faces) 2295 :group 'basic-faces)
2297 2296
2298(defface escape-glyph 2297(defface escape-glyph
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index fba0cd8fea7..1c76a179afd 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12013-05-15 Glenn Morris <rgm@gnu.org>
2
3 * shr-color.el (shr-color-visible-luminance-min)
4 (shr-color-visible-distance-min): Use shr-color group.
5
12013-05-11 Glenn Morris <rgm@gnu.org> 62013-05-11 Glenn Morris <rgm@gnu.org>
2 7
3 * gnus-vm.el: Make it loadable without VM. 8 * gnus-vm.el: Make it loadable without VM.
diff --git a/lisp/gnus/shr-color.el b/lisp/gnus/shr-color.el
index 0b320a21ad9..21f1fc4f004 100644
--- a/lisp/gnus/shr-color.el
+++ b/lisp/gnus/shr-color.el
@@ -36,14 +36,14 @@
36(defcustom shr-color-visible-luminance-min 40 36(defcustom shr-color-visible-luminance-min 40
37 "Minimum luminance distance between two colors to be considered visible. 37 "Minimum luminance distance between two colors to be considered visible.
38Must be between 0 and 100." 38Must be between 0 and 100."
39 :group 'shr 39 :group 'shr-color
40 :type 'number) 40 :type 'number)
41 41
42(defcustom shr-color-visible-distance-min 5 42(defcustom shr-color-visible-distance-min 5
43 "Minimum color distance between two colors to be considered visible. 43 "Minimum color distance between two colors to be considered visible.
44This value is used to compare result for `ciede2000'. It's an 44This value is used to compare result for `ciede2000'. It's an
45absolute value without any unit." 45absolute value without any unit."
46 :group 'shr 46 :group 'shr-color
47 :type 'integer) 47 :type 'integer)
48 48
49(defconst shr-color-html-colors-alist 49(defconst shr-color-html-colors-alist
diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el
index 39f2b79587b..7b79a1dd1f9 100644
--- a/lisp/international/ccl.el
+++ b/lisp/international/ccl.el
@@ -43,10 +43,11 @@
43 43
44;;; Code: 44;;; Code:
45 45
46(defgroup ccl nil 46;; Unused.
47 "CCL (Code Conversion Language) compiler." 47;;; (defgroup ccl nil
48 :prefix "ccl-" 48;;; "CCL (Code Conversion Language) compiler."
49 :group 'i18n) 49;;; :prefix "ccl-"
50;;; :group 'i18n)
50 51
51(defconst ccl-command-table 52(defconst ccl-command-table
52 [if branch loop break repeat write-repeat write-read-repeat 53 [if branch loop break repeat write-repeat write-read-repeat
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 72a125fcecb..fe73bf7d6a4 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -47,7 +47,7 @@
47;; modify the search string before executing the search. There are 47;; modify the search string before executing the search. There are
48;; three commands to terminate the editing: C-s and C-r exit the 48;; three commands to terminate the editing: C-s and C-r exit the
49;; minibuffer and search forward and reverse respectively, while C-m 49;; minibuffer and search forward and reverse respectively, while C-m
50;; exits and does a nonincremental search. 50;; exits and searches in the last search direction.
51 51
52;; Exiting immediately from isearch uses isearch-edit-string instead 52;; Exiting immediately from isearch uses isearch-edit-string instead
53;; of nonincremental-search, if search-nonincremental-instead is non-nil. 53;; of nonincremental-search, if search-nonincremental-instead is non-nil.
@@ -515,12 +515,12 @@ This is like `describe-bindings', but displays only Isearch keys."
515 (define-key map "\M-so" 'isearch-occur) 515 (define-key map "\M-so" 'isearch-occur)
516 (define-key map "\M-shr" 'isearch-highlight-regexp) 516 (define-key map "\M-shr" 'isearch-highlight-regexp)
517 517
518 ;; The key translations defined in the C-x 8 prefix should insert 518 ;; The key translations defined in the C-x 8 prefix should add
519 ;; characters into the search string. See iso-transl.el. 519 ;; characters to the search string. See iso-transl.el.
520 (define-key map "\C-x" nil) 520 (define-key map "\C-x" nil)
521 (define-key map [?\C-x t] 'isearch-other-control-char) 521 (define-key map [?\C-x t] 'isearch-other-control-char)
522 (define-key map "\C-x8" nil) 522 (define-key map "\C-x8" nil)
523 (define-key map "\C-x8\r" 'isearch-insert-char-by-name) 523 (define-key map "\C-x8\r" 'isearch-char-by-name)
524 524
525 map) 525 map)
526 "Keymap for `isearch-mode'.") 526 "Keymap for `isearch-mode'.")
@@ -528,7 +528,7 @@ This is like `describe-bindings', but displays only Isearch keys."
528(defvar minibuffer-local-isearch-map 528(defvar minibuffer-local-isearch-map
529 (let ((map (make-sparse-keymap))) 529 (let ((map (make-sparse-keymap)))
530 (set-keymap-parent map minibuffer-local-map) 530 (set-keymap-parent map minibuffer-local-map)
531 (define-key map "\r" 'isearch-nonincremental-exit-minibuffer) 531 (define-key map "\r" 'exit-minibuffer)
532 (define-key map "\M-\t" 'isearch-complete-edit) 532 (define-key map "\M-\t" 'isearch-complete-edit)
533 (define-key map "\C-s" 'isearch-forward-exit-minibuffer) 533 (define-key map "\C-s" 'isearch-forward-exit-minibuffer)
534 (define-key map "\C-r" 'isearch-reverse-exit-minibuffer) 534 (define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
@@ -679,6 +679,8 @@ Type \\[isearch-yank-kill] to yank the last string of killed text.
679Type \\[isearch-yank-pop] to replace string just yanked into search prompt 679Type \\[isearch-yank-pop] to replace string just yanked into search prompt
680 with string killed before it. 680 with string killed before it.
681Type \\[isearch-quote-char] to quote control character to search for it. 681Type \\[isearch-quote-char] to quote control character to search for it.
682Type \\[isearch-char-by-name] to add a character to search by Unicode name,\
683 with completion.
682\\[isearch-abort] while searching or when search has failed cancels input\ 684\\[isearch-abort] while searching or when search has failed cancels input\
683 back to what has 685 back to what has
684 been found successfully. 686 been found successfully.
@@ -1273,7 +1275,6 @@ You can update the global isearch variables by setting new values to
1273The following additional command keys are active while editing. 1275The following additional command keys are active while editing.
1274\\<minibuffer-local-isearch-map> 1276\\<minibuffer-local-isearch-map>
1275\\[exit-minibuffer] to resume incremental searching with the edited string. 1277\\[exit-minibuffer] to resume incremental searching with the edited string.
1276\\[isearch-nonincremental-exit-minibuffer] to do one nonincremental search.
1277\\[isearch-forward-exit-minibuffer] to resume isearching forward. 1278\\[isearch-forward-exit-minibuffer] to resume isearching forward.
1278\\[isearch-reverse-exit-minibuffer] to resume isearching backward. 1279\\[isearch-reverse-exit-minibuffer] to resume isearching backward.
1279\\[isearch-complete-edit] to complete the search string using the search ring." 1280\\[isearch-complete-edit] to complete the search string using the search ring."
@@ -1307,13 +1308,18 @@ The following additional command keys are active while editing.
1307 (interactive) 1308 (interactive)
1308 (setq isearch-nonincremental t) 1309 (setq isearch-nonincremental t)
1309 (exit-minibuffer)) 1310 (exit-minibuffer))
1311;; Changing the value of `isearch-nonincremental' has no effect here,
1312;; because `isearch-edit-string' ignores this change. Thus marked as obsolete.
1313(make-obsolete 'isearch-nonincremental-exit-minibuffer 'exit-minibuffer "24.4")
1310 1314
1311(defun isearch-forward-exit-minibuffer () 1315(defun isearch-forward-exit-minibuffer ()
1316 "Resume isearching forward from the minibuffer that edits the search string."
1312 (interactive) 1317 (interactive)
1313 (setq isearch-new-forward t) 1318 (setq isearch-new-forward t)
1314 (exit-minibuffer)) 1319 (exit-minibuffer))
1315 1320
1316(defun isearch-reverse-exit-minibuffer () 1321(defun isearch-reverse-exit-minibuffer ()
1322 "Resume isearching backward from the minibuffer that edits the search string."
1317 (interactive) 1323 (interactive)
1318 (setq isearch-new-forward nil) 1324 (setq isearch-new-forward nil)
1319 (exit-minibuffer)) 1325 (exit-minibuffer))
@@ -1866,11 +1872,12 @@ Subword is used when `subword-mode' is activated. "
1866 (lambda () (let ((inhibit-field-text-motion t)) 1872 (lambda () (let ((inhibit-field-text-motion t))
1867 (line-end-position (if (eolp) 2 1)))))) 1873 (line-end-position (if (eolp) 2 1))))))
1868 1874
1869(defun isearch-insert-char-by-name () 1875(defun isearch-char-by-name ()
1870 "Read a character by its Unicode name and insert it into search string." 1876 "Read a character by its Unicode name and add it to the search string.
1877Completion is available like in `read-char-by-name' used by `insert-char'."
1871 (interactive) 1878 (interactive)
1872 (with-isearch-suspended 1879 (with-isearch-suspended
1873 (let ((char (read-char-by-name "Insert character (Unicode name or hex): "))) 1880 (let ((char (read-char-by-name "Add character to search (Unicode name or hex): ")))
1874 (when char 1881 (when char
1875 (setq isearch-new-string (concat isearch-string (string char)) 1882 (setq isearch-new-string (concat isearch-string (string char))
1876 isearch-new-message (concat isearch-message 1883 isearch-new-message (concat isearch-message
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 9359a65a1b8..9d700a5ed82 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -258,7 +258,7 @@ the variable `jit-lock-stealth-nice'."
258When this minor mode is enabled, jit-lock runs as little code as possible 258When this minor mode is enabled, jit-lock runs as little code as possible
259during redisplay and moves the rest to a timer, where things 259during redisplay and moves the rest to a timer, where things
260like `debug-on-error' and Edebug can be used." 260like `debug-on-error' and Edebug can be used."
261 :global t 261 :global t :group 'jit-lock
262 (when jit-lock-defer-timer 262 (when jit-lock-defer-timer
263 (cancel-timer jit-lock-defer-timer) 263 (cancel-timer jit-lock-defer-timer)
264 (setq jit-lock-defer-timer nil)) 264 (setq jit-lock-defer-timer nil))
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 7509689e2b7..5764cdec7eb 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -308,32 +308,10 @@
308(message "Finding pointers to doc strings...") 308(message "Finding pointers to doc strings...")
309(if (or (equal (nth 3 command-line-args) "dump") 309(if (or (equal (nth 3 command-line-args) "dump")
310 (equal (nth 4 command-line-args) "dump")) 310 (equal (nth 4 command-line-args) "dump"))
311 (let ((name emacs-version)) 311 (Snarf-documentation "DOC")
312 (while (string-match "[^-+_.a-zA-Z0-9]+" name) 312 (condition-case nil
313 (setq name (concat (downcase (substring name 0 (match-beginning 0))) 313 (Snarf-documentation "DOC")
314 "-" 314 (error nil)))
315 (substring name (match-end 0)))))
316 (if (memq system-type '(ms-dos windows-nt))
317 (let ((name1 (expand-file-name
318 (if (fboundp 'x-create-frame) "DOC-X" "DOC")
319 "../etc")))
320 ;; There will be no DOC-X on MS-Windows when we build
321 ;; using the Posix Makefile's. In that case, we want
322 ;; to create DOC-XX.YY.ZZ, as on Unix.
323 (if (file-exists-p name1)
324 (setq name name1)
325 (setq name (concat (expand-file-name "../etc/DOC-") name))
326 (if (file-exists-p name)
327 (delete-file name))
328 (copy-file (expand-file-name "../etc/DOC") name t)))
329 (setq name (concat (expand-file-name "../etc/DOC-") name))
330 (if (file-exists-p name)
331 (delete-file name))
332 (copy-file (expand-file-name "../etc/DOC") name t))
333 (Snarf-documentation (file-name-nondirectory name)))
334 (condition-case nil
335 (Snarf-documentation "DOC")
336 (error nil)))
337(message "Finding pointers to doc strings...done") 315(message "Finding pointers to doc strings...done")
338 316
339;; Note: You can cause additional libraries to be preloaded 317;; Note: You can cause additional libraries to be preloaded
diff --git a/lisp/master.el b/lisp/master.el
index 368bb0d58d5..4a536ca5cda 100644
--- a/lisp/master.el
+++ b/lisp/master.el
@@ -53,10 +53,11 @@
53 53
54;;; Code: 54;;; Code:
55 55
56(defgroup master nil 56;; Unused.
57 "Support for master/slave relationships between buffers." 57;;; (defgroup master nil
58 :version "22.1" 58;;; "Support for master/slave relationships between buffers."
59 :group 'convenience) 59;;; :version "22.1"
60;;; :group 'convenience)
60 61
61;; Variables that don't need initialization. 62;; Variables that don't need initialization.
62 63
@@ -84,7 +85,8 @@ using the following commands:
84The slave buffer is stored in the buffer-local variable `master-of'. 85The slave buffer is stored in the buffer-local variable `master-of'.
85You can set this variable using `master-set-slave'. You can show 86You can set this variable using `master-set-slave'. You can show
86yourself the value of `master-of' by calling `master-show-slave'." 87yourself the value of `master-of' by calling `master-show-slave'."
87 :group 'master 88 ;; Not global, so no effect.
89;;; :group 'master
88 :keymap 90 :keymap
89 '(("\C-c\C-n" . master-says-scroll-up) 91 '(("\C-c\C-n" . master-says-scroll-up)
90 ("\C-c\C-p" . master-says-scroll-down) 92 ("\C-c\C-p" . master-says-scroll-down)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index ef949f7482e..a5d79a415f6 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1856,6 +1856,7 @@ With a prefix argument ARG, enable the modemode if ARG is
1856positive, and disable it otherwise. If called from Lisp, enable 1856positive, and disable it otherwise. If called from Lisp, enable
1857the mode if ARG is omitted or nil." 1857the mode if ARG is omitted or nil."
1858 :global t 1858 :global t
1859 :group 'minibuffer
1859 (setq completion-in-region--data nil) 1860 (setq completion-in-region--data nil)
1860 ;; (remove-hook 'pre-command-hook #'completion-in-region--prech) 1861 ;; (remove-hook 'pre-command-hook #'completion-in-region--prech)
1861 (remove-hook 'post-command-hook #'completion-in-region--postch) 1862 (remove-hook 'post-command-hook #'completion-in-region--postch)
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 44271a689cf..c45196f0316 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -352,11 +352,6 @@ Use `nxml-parent-document-set' to set it.")
352See the function `xmltok-forward-prolog' for more information.") 352See the function `xmltok-forward-prolog' for more information.")
353(make-variable-buffer-local 'nxml-prolog-regions) 353(make-variable-buffer-local 'nxml-prolog-regions)
354 354
355(defvar nxml-last-fontify-end nil
356 "Position where fontification last ended.
357It is nil if the buffer changed since the last fontification.")
358(make-variable-buffer-local 'nxml-last-fontify-end)
359
360(defvar nxml-degraded nil 355(defvar nxml-degraded nil
361 "Non-nil if currently operating in degraded mode. 356 "Non-nil if currently operating in degraded mode.
362Degraded mode is enabled when an internal error is encountered in the 357Degraded mode is enabled when an internal error is encountered in the
@@ -538,7 +533,6 @@ Many aspects this mode can be customized using
538 (save-excursion 533 (save-excursion
539 (save-restriction 534 (save-restriction
540 (widen) 535 (widen)
541 (nxml-clear-dependent-regions (point-min) (point-max))
542 (setq nxml-scan-end (copy-marker (point-min) nil)) 536 (setq nxml-scan-end (copy-marker (point-min) nil))
543 (with-silent-modifications 537 (with-silent-modifications
544 (nxml-clear-inside (point-min) (point-max)) 538 (nxml-clear-inside (point-min) (point-max))
@@ -583,12 +577,9 @@ Many aspects this mode can be customized using
583 ;; Clean up fontification. 577 ;; Clean up fontification.
584 (save-excursion 578 (save-excursion
585 (widen) 579 (widen)
586 (let ((inhibit-read-only t) 580 (with-silent-modifications
587 (buffer-undo-list t)
588 (modified (buffer-modified-p)))
589 (nxml-with-invisible-motion 581 (nxml-with-invisible-motion
590 (remove-text-properties (point-min) (point-max) '(face))) 582 (remove-text-properties (point-min) (point-max) '(face)))))
591 (set-buffer-modified-p modified)))
592 (remove-hook 'change-major-mode-hook 'nxml-cleanup t)) 583 (remove-hook 'change-major-mode-hook 'nxml-cleanup t))
593 584
594(defun nxml-degrade (context err) 585(defun nxml-degrade (context err)
@@ -638,10 +629,6 @@ the full extent of the area needing refontification.
638For bookkeeping, call this function even when fontification is 629For bookkeeping, call this function even when fontification is
639disabled." 630disabled."
640 (let ((pre-change-end (+ start pre-change-length))) 631 (let ((pre-change-end (+ start pre-change-length)))
641 (setq start
642 (nxml-adjust-start-for-dependent-regions start
643 end
644 pre-change-length))
645 ;; If the prolog might have changed, rescan the prolog 632 ;; If the prolog might have changed, rescan the prolog
646 (when (<= start 633 (when (<= start
647 ;; Add 2 so as to include the < and following char that 634 ;; Add 2 so as to include the < and following char that
@@ -902,26 +889,16 @@ Called with `font-lock-beg' and `font-lock-end' dynamically bound."
902 889
903(defun nxml-extend-after-change-region (start end pre-change-length) 890(defun nxml-extend-after-change-region (start end pre-change-length)
904 (unless nxml-degraded 891 (unless nxml-degraded
905 (setq nxml-last-fontify-end nil) 892 (nxml-with-degradation-on-error
906 (let ((region (nxml-with-degradation-on-error 893 'nxml-extend-after-change-region
907 'nxml-extend-after-change-region 894 (save-excursion
908 (save-excursion 895 (save-restriction
909 (save-restriction 896 (widen)
910 (widen) 897 (save-match-data
911 (save-match-data 898 (nxml-with-invisible-motion
912 (nxml-with-invisible-motion 899 (with-silent-modifications
913 (with-silent-modifications 900 (nxml-after-change1
914 (nxml-extend-after-change-region1 901 start end pre-change-length)))))))))
915 start end pre-change-length)))))))))
916 (if (consp region) region))))
917
918(defun nxml-extend-after-change-region1 (start end pre-change-length)
919 (let* ((region (nxml-after-change1 start end pre-change-length))
920 (font-lock-beg (car region))
921 (font-lock-end (cdr region)))
922
923 (nxml-extend-region)
924 (cons font-lock-beg font-lock-end)))
925 902
926(defun nxml-fontify-matcher (bound) 903(defun nxml-fontify-matcher (bound)
927 "Called as font-lock keyword matcher." 904 "Called as font-lock keyword matcher."
@@ -936,13 +913,12 @@ Called with `font-lock-beg' and `font-lock-end' dynamically bound."
936 (nxml-fontify-prolog) 913 (nxml-fontify-prolog)
937 (goto-char nxml-prolog-end)) 914 (goto-char nxml-prolog-end))
938 915
939 (let (xmltok-dependent-regions 916 (let (xmltok-errors)
940 xmltok-errors)
941 (while (and (nxml-tokenize-forward) 917 (while (and (nxml-tokenize-forward)
942 (<= (point) bound)) ; Intervals are open-ended. 918 (<= (point) bound)) ; Intervals are open-ended.
943 (nxml-apply-fontify-rule))) 919 (nxml-apply-fontify-rule)))
944 920
945 (setq nxml-last-fontify-end (point))) 921 )
946 922
947 ;; Since we did the fontification internally, tell font-lock to not 923 ;; Since we did the fontification internally, tell font-lock to not
948 ;; do anything itself. 924 ;; do anything itself.
diff --git a/lisp/nxml/nxml-rap.el b/lisp/nxml/nxml-rap.el
index 5bc4d74456b..ac4e9ac4cd9 100644
--- a/lisp/nxml/nxml-rap.el
+++ b/lisp/nxml/nxml-rap.el
@@ -69,18 +69,6 @@
69;; typical proportion of comments, CDATA sections and processing 69;; typical proportion of comments, CDATA sections and processing
70;; instructions is small relative to other things. Secondly, to scan 70;; instructions is small relative to other things. Secondly, to scan
71;; we just search for the regexp <[!?]. 71;; we just search for the regexp <[!?].
72;;
73;; One problem is unclosed comments, processing instructions and CDATA
74;; sections. Suppose, for example, we encounter a <!-- but there's no
75;; matching -->. This is not an unexpected situation if the user is
76;; creating a comment. It is not helpful to treat the whole of the
77;; file starting from the <!-- onwards as a single unclosed comment
78;; token. Instead we treat just the <!-- as a piece of not well-formed
79;; markup and continue. The problem is that if at some later stage a
80;; --> gets added to the buffer after the unclosed <!--, we will need
81;; to reparse the buffer starting from the <!--. We need to keep
82;; track of these reparse dependencies; they are called dependent
83;; regions in the code.
84 72
85;;; Code: 73;;; Code:
86 74
@@ -144,8 +132,7 @@ any 'inside' regions and at the beginning of a token."
144 (if (>= start nxml-scan-end) 132 (if (>= start nxml-scan-end)
145 nxml-scan-end 133 nxml-scan-end
146 (let ((inside-remove-start start) 134 (let ((inside-remove-start start)
147 xmltok-errors 135 xmltok-errors)
148 xmltok-dependent-regions)
149 (while (or (when (xmltok-forward-special (min end nxml-scan-end)) 136 (while (or (when (xmltok-forward-special (min end nxml-scan-end))
150 (when (memq xmltok-type 137 (when (memq xmltok-type
151 '(comment 138 '(comment
@@ -169,9 +156,7 @@ any 'inside' regions and at the beginning of a token."
169 (when inside-end 156 (when inside-end
170 (setq end inside-end) 157 (setq end inside-end)
171 t)))) 158 t))))
172 (nxml-clear-inside inside-remove-start end) 159 (nxml-clear-inside inside-remove-start end))
173 (nxml-clear-dependent-regions start end)
174 (nxml-mark-parse-dependent-regions))
175 (when (> end nxml-scan-end) 160 (when (> end nxml-scan-end)
176 (set-marker nxml-scan-end end)) 161 (set-marker nxml-scan-end end))
177 end)) 162 end))
@@ -182,63 +167,14 @@ any 'inside' regions and at the beginning of a token."
182(defun nxml-scan-prolog () 167(defun nxml-scan-prolog ()
183 (goto-char (point-min)) 168 (goto-char (point-min))
184 (let (xmltok-dtd 169 (let (xmltok-dtd
185 xmltok-errors 170 xmltok-errors)
186 xmltok-dependent-regions)
187 (setq nxml-prolog-regions (xmltok-forward-prolog)) 171 (setq nxml-prolog-regions (xmltok-forward-prolog))
188 (setq nxml-prolog-end (point)) 172 (setq nxml-prolog-end (point))
189 (nxml-clear-inside (point-min) nxml-prolog-end) 173 (nxml-clear-inside (point-min) nxml-prolog-end))
190 (nxml-clear-dependent-regions (point-min) nxml-prolog-end)
191 (nxml-mark-parse-dependent-regions))
192 (when (< nxml-scan-end nxml-prolog-end) 174 (when (< nxml-scan-end nxml-prolog-end)
193 (set-marker nxml-scan-end nxml-prolog-end))) 175 (set-marker nxml-scan-end nxml-prolog-end)))
194 176
195 177
196;;; Dependent regions
197
198(defun nxml-adjust-start-for-dependent-regions (start end pre-change-length)
199 (let ((overlays (overlays-in (1- start) start))
200 (adjusted-start start))
201 (while overlays
202 (let* ((overlay (car overlays))
203 (ostart (overlay-start overlay)))
204 (when (and (eq (overlay-get overlay 'category) 'nxml-dependent)
205 (< ostart adjusted-start))
206 (let ((funargs (overlay-get overlay 'nxml-funargs)))
207 (when (apply (car funargs)
208 (append (list start
209 end
210 pre-change-length
211 ostart
212 (overlay-end overlay))
213 (cdr funargs)))
214 (setq adjusted-start ostart)))))
215 (setq overlays (cdr overlays)))
216 adjusted-start))
217
218(defun nxml-mark-parse-dependent-regions ()
219 (while xmltok-dependent-regions
220 (apply 'nxml-mark-parse-dependent-region
221 (car xmltok-dependent-regions))
222 (setq xmltok-dependent-regions
223 (cdr xmltok-dependent-regions))))
224
225(defun nxml-mark-parse-dependent-region (fun start end &rest args)
226 (let ((overlay (make-overlay start end nil t t)))
227 (overlay-put overlay 'category 'nxml-dependent)
228 (overlay-put overlay 'nxml-funargs (cons fun args))))
229
230(put 'nxml-dependent 'evaporate t)
231
232(defun nxml-clear-dependent-regions (start end)
233 (let ((overlays (overlays-in start end)))
234 (while overlays
235 (let* ((overlay (car overlays))
236 (category (overlay-get overlay 'category)))
237 (when (and (eq category 'nxml-dependent)
238 (<= start (overlay-start overlay)))
239 (delete-overlay overlay)))
240 (setq overlays (cdr overlays)))))
241
242;;; Random access parsing 178;;; Random access parsing
243 179
244(defun nxml-token-after () 180(defun nxml-token-after ()
@@ -286,17 +222,14 @@ Sets variables like `nxml-token-after'."
286 (point))) 222 (point)))
287 223
288(defun nxml-tokenize-forward () 224(defun nxml-tokenize-forward ()
289 (let (xmltok-dependent-regions 225 (let (xmltok-errors)
290 xmltok-errors)
291 (when (and (xmltok-forward) 226 (when (and (xmltok-forward)
292 (> (point) nxml-scan-end)) 227 (> (point) nxml-scan-end))
293 (cond ((memq xmltok-type '(comment 228 (cond ((memq xmltok-type '(comment
294 cdata-section 229 cdata-section
295 processing-instruction)) 230 processing-instruction))
296 (with-silent-modifications 231 (with-silent-modifications
297 (nxml-set-inside (1+ xmltok-start) (point) xmltok-type))) 232 (nxml-set-inside (1+ xmltok-start) (point) xmltok-type))))
298 (xmltok-dependent-regions
299 (nxml-mark-parse-dependent-regions)))
300 (set-marker nxml-scan-end (point))) 233 (set-marker nxml-scan-end (point)))
301 xmltok-type)) 234 xmltok-type))
302 235
@@ -304,7 +237,7 @@ Sets variables like `nxml-token-after'."
304 "Move point backwards outside any 'inside' regions or tags. 237 "Move point backwards outside any 'inside' regions or tags.
305Point will not move past `nxml-prolog-end'. 238Point will not move past `nxml-prolog-end'.
306Point will either be at BOUND or a '<' character starting a tag 239Point will either be at BOUND or a '<' character starting a tag
307outside any 'inside' regions. Ignores dependent regions. 240outside any 'inside' regions.
308As a precondition, point must be >= BOUND." 241As a precondition, point must be >= BOUND."
309 (nxml-move-outside-backwards) 242 (nxml-move-outside-backwards)
310 (when (not (equal (char-after) ?<)) 243 (when (not (equal (char-after) ?<))
@@ -331,8 +264,7 @@ Leave point unmoved if it is not inside anything special."
331 (when (< nxml-scan-end pos) 264 (when (< nxml-scan-end pos)
332 (save-excursion 265 (save-excursion
333 (goto-char nxml-scan-end) 266 (goto-char nxml-scan-end)
334 (let (xmltok-errors 267 (let (xmltok-errors)
335 xmltok-dependent-regions)
336 (while (when (xmltok-forward-special pos) 268 (while (when (xmltok-forward-special pos)
337 (when (memq xmltok-type 269 (when (memq xmltok-type
338 '(comment 270 '(comment
@@ -346,8 +278,6 @@ Leave point unmoved if it is not inside anything special."
346 t 278 t
347 (setq pos (point)) 279 (setq pos (point))
348 nil))) 280 nil)))
349 (nxml-clear-dependent-regions nxml-scan-end pos)
350 (nxml-mark-parse-dependent-regions)
351 (set-marker nxml-scan-end pos)))))) 281 (set-marker nxml-scan-end pos))))))
352 282
353;;; Element scanning 283;;; Element scanning
diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el
index e1140980813..fb8bd037bdc 100644
--- a/lisp/nxml/rng-valid.el
+++ b/lisp/nxml/rng-valid.el
@@ -530,7 +530,6 @@ Return t if there is work to do, nil otherwise."
530 xmltok-replacement 530 xmltok-replacement
531 xmltok-attributes 531 xmltok-attributes
532 xmltok-namespace-attributes 532 xmltok-namespace-attributes
533 xmltok-dependent-regions
534 xmltok-errors) 533 xmltok-errors)
535 (when (= (point) 1) 534 (when (= (point) 1)
536 (let ((regions (xmltok-forward-prolog))) 535 (let ((regions (xmltok-forward-prolog)))
@@ -566,7 +565,6 @@ Return t if there is work to do, nil otherwise."
566 ;; do this before setting rng-validate-up-to-date-end 565 ;; do this before setting rng-validate-up-to-date-end
567 ;; in case we get a quit 566 ;; in case we get a quit
568 (rng-mark-xmltok-errors) 567 (rng-mark-xmltok-errors)
569 (rng-mark-xmltok-dependent-regions)
570 (setq rng-validate-up-to-date-end 568 (setq rng-validate-up-to-date-end
571 (marker-position rng-conditional-up-to-date-end)) 569 (marker-position rng-conditional-up-to-date-end))
572 (rng-clear-conditional-region) 570 (rng-clear-conditional-region)
@@ -591,7 +589,6 @@ Return t if there is work to do, nil otherwise."
591 (when (not have-remaining-chars) 589 (when (not have-remaining-chars)
592 (rng-process-end-document)) 590 (rng-process-end-document))
593 (rng-mark-xmltok-errors) 591 (rng-mark-xmltok-errors)
594 (rng-mark-xmltok-dependent-regions)
595 (setq rng-validate-up-to-date-end pos) 592 (setq rng-validate-up-to-date-end pos)
596 (when rng-conditional-up-to-date-end 593 (when rng-conditional-up-to-date-end
597 (cond ((<= rng-conditional-up-to-date-end pos) 594 (cond ((<= rng-conditional-up-to-date-end pos)
@@ -661,57 +658,9 @@ Return t if there is work to do, nil otherwise."
661 ;; if overlays left over from a previous use 658 ;; if overlays left over from a previous use
662 ;; of rng-validate-mode that ended with a change of mode 659 ;; of rng-validate-mode that ended with a change of mode
663 (when rng-error-count 660 (when rng-error-count
664 (setq rng-error-count (1- rng-error-count))))) 661 (setq rng-error-count (1- rng-error-count)))))))
665 ((and (eq category 'rng-dependent)
666 (<= beg (overlay-start overlay)))
667 (delete-overlay overlay))))
668 (setq overlays (cdr overlays)))))) 662 (setq overlays (cdr overlays))))))
669 663
670;;; Dependent regions
671
672(defun rng-mark-xmltok-dependent-regions ()
673 (while xmltok-dependent-regions
674 (apply 'rng-mark-xmltok-dependent-region
675 (car xmltok-dependent-regions))
676 (setq xmltok-dependent-regions
677 (cdr xmltok-dependent-regions))))
678
679(defun rng-mark-xmltok-dependent-region (fun start end &rest args)
680 (let ((overlay (make-overlay start end nil t t)))
681 (overlay-put overlay 'category 'rng-dependent)
682 (overlay-put overlay 'rng-funargs (cons fun args))))
683
684(put 'rng-dependent 'evaporate t)
685(put 'rng-dependent 'modification-hooks '(rng-dependent-region-changed))
686(put 'rng-dependent 'insert-behind-hooks '(rng-dependent-region-changed))
687
688(defun rng-dependent-region-changed (overlay
689 after-p
690 change-start
691 change-end
692 &optional pre-change-length)
693 (when (and after-p
694 ;; Emacs sometimes appears to call deleted overlays
695 (overlay-start overlay)
696 (let ((funargs (overlay-get overlay 'rng-funargs)))
697 (save-match-data
698 (save-excursion
699 (save-restriction
700 (widen)
701 (apply (car funargs)
702 (append (list change-start
703 change-end
704 pre-change-length
705 (overlay-start overlay)
706 (overlay-end overlay))
707 (cdr funargs))))))))
708 (rng-after-change-function (overlay-start overlay)
709 change-end
710 (+ pre-change-length
711 (- (overlay-start overlay)
712 change-start)))
713 (delete-overlay overlay)))
714
715;;; Error state 664;;; Error state
716 665
717(defun rng-mark-xmltok-errors () 666(defun rng-mark-xmltok-errors ()
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index 03f05abac43..b80335362a1 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -132,33 +132,6 @@ from referencing the entity in element content and AR is either nil,
132meaning the replacement text included a <, or a string which is the 132meaning the replacement text included a <, or a string which is the
133normalized attribute value.") 133normalized attribute value.")
134 134
135(defvar xmltok-dependent-regions nil
136 "List of descriptors of regions that a parsed token depends on.
137
138A token depends on a region if the region occurs after the token and a
139change in the region may require the token to be reparsed. This only
140happens with markup that is not well-formed. For example, if a <?
141occurs without a matching ?>, then the <? is returned as a
142not-well-formed token. However, this token is dependent on region
143from the end of the token to the end of the buffer: if this ever
144contains ?> then the buffer must be reparsed from the <?.
145
146A region descriptor is a list (FUN START END ARG ...), where FUN is a
147function to be called when the region changes, START and END are
148integers giving the start and end of the region, and ARG... are
149additional arguments to be passed to FUN. FUN will be called with 5
150arguments followed by the additional arguments if any: the position of
151the start of the changed area in the region, the position of the end
152of the changed area in the region, the length of the changed area
153before the change, the position of the start of the region, the
154position of the end of the region. FUN must return non-nil if the
155region needs reparsing. FUN will be called in a `save-excursion'
156with match-data saved.
157
158`xmltok-forward', `xmltok-forward-special' and `xmltok-forward-prolog'
159may add entries to the beginning of this list, but will not clear it.
160`xmltok-forward' and `xmltok-forward-special' will only add entries
161when returning tokens of type not-well-formed.")
162 135
163(defvar xmltok-errors nil 136(defvar xmltok-errors nil
164 "List of errors detected by `xmltok-forward' and `xmltok-forward-prolog'. 137 "List of errors detected by `xmltok-forward' and `xmltok-forward-prolog'.
@@ -176,7 +149,6 @@ indicating the position of the error.")
176 xmltok-replacement 149 xmltok-replacement
177 xmltok-attributes 150 xmltok-attributes
178 xmltok-namespace-attributes 151 xmltok-namespace-attributes
179 xmltok-dependent-regions
180 xmltok-errors) 152 xmltok-errors)
181 ,@body)) 153 ,@body))
182 154
@@ -298,14 +270,6 @@ and VALUE-END, otherwise a STRING giving the value."
298 (or end (point))) 270 (or end (point)))
299 xmltok-errors))) 271 xmltok-errors)))
300 272
301(defun xmltok-add-dependent (fun &optional start end &rest args)
302 (setq xmltok-dependent-regions
303 (cons (cons fun
304 (cons (or start xmltok-start)
305 (cons (or end (point-max))
306 args)))
307 xmltok-dependent-regions)))
308
309(defun xmltok-forward () 273(defun xmltok-forward ()
310 (setq xmltok-start (point)) 274 (setq xmltok-start (point))
311 (let* ((case-fold-search nil) 275 (let* ((case-fold-search nil)
@@ -684,14 +648,8 @@ Return the type of the token."
684 (setq xmltok-type 'empty-element)) 648 (setq xmltok-type 'empty-element))
685 ((xmltok-after-lt start cdata-section-open) 649 ((xmltok-after-lt start cdata-section-open)
686 (setq xmltok-type 650 (setq xmltok-type
687 (if (search-forward "]]>" nil t) 651 (progn (search-forward "]]>" nil 'move)
688 'cdata-section 652 'cdata-section)))
689 (xmltok-add-error "No closing ]]>")
690 (xmltok-add-dependent 'xmltok-unclosed-reparse-p
691 nil
692 nil
693 "]]>")
694 'not-well-formed)))
695 ((xmltok-after-lt start processing-instruction-question) 653 ((xmltok-after-lt start processing-instruction-question)
696 (xmltok-scan-after-processing-instruction-open)) 654 (xmltok-scan-after-processing-instruction-open))
697 ((xmltok-after-lt start comment-open) 655 ((xmltok-after-lt start comment-open)
@@ -758,68 +716,44 @@ Return the type of the token."
758;; xmltok-scan-prolog-after-processing-instruction-open 716;; xmltok-scan-prolog-after-processing-instruction-open
759;; XXX maybe should include rest of line (up to any <,>) in unclosed PI 717;; XXX maybe should include rest of line (up to any <,>) in unclosed PI
760(defun xmltok-scan-after-processing-instruction-open () 718(defun xmltok-scan-after-processing-instruction-open ()
761 (cond ((not (search-forward "?>" nil t)) 719 (search-forward "?>" nil 'move)
762 (xmltok-add-error "No closing ?>" 720 (cond ((not (save-excursion
763 xmltok-start 721 (goto-char (+ 2 xmltok-start))
764 (+ xmltok-start 2)) 722 (and (looking-at (xmltok-ncname regexp))
765 (xmltok-add-dependent 'xmltok-unclosed-reparse-p 723 (setq xmltok-name-end (match-end 0)))))
766 nil 724 (setq xmltok-name-end (+ xmltok-start 2))
767 nil 725 (xmltok-add-error "<? not followed by name"
768 "?>") 726 (+ xmltok-start 2)
769 (setq xmltok-type 'not-well-formed)) 727 (+ xmltok-start 3)))
770 (t 728 ((not (or (memq (char-after xmltok-name-end)
771 (cond ((not (save-excursion 729 '(?\n ?\t ?\r ? ))
772 (goto-char (+ 2 xmltok-start)) 730 (= xmltok-name-end (- (point) 2))))
773 (and (looking-at (xmltok-ncname regexp)) 731 (xmltok-add-error "Target not followed by whitespace"
774 (setq xmltok-name-end (match-end 0))))) 732 xmltok-name-end
775 (setq xmltok-name-end (+ xmltok-start 2)) 733 (1+ xmltok-name-end)))
776 (xmltok-add-error "<? not followed by name" 734 ((and (= xmltok-name-end (+ xmltok-start 5))
777 (+ xmltok-start 2) 735 (save-excursion
778 (+ xmltok-start 3))) 736 (goto-char (+ xmltok-start 2))
779 ((not (or (memq (char-after xmltok-name-end) 737 (let ((case-fold-search t))
780 '(?\n ?\t ?\r ? )) 738 (looking-at "xml"))))
781 (= xmltok-name-end (- (point) 2)))) 739 (xmltok-add-error "Processing instruction target is xml"
782 (xmltok-add-error "Target not followed by whitespace" 740 (+ xmltok-start 2)
783 xmltok-name-end 741 (+ xmltok-start 5))))
784 (1+ xmltok-name-end))) 742 (setq xmltok-type 'processing-instruction))
785 ((and (= xmltok-name-end (+ xmltok-start 5))
786 (save-excursion
787 (goto-char (+ xmltok-start 2))
788 (let ((case-fold-search t))
789 (looking-at "xml"))))
790 (xmltok-add-error "Processing instruction target is xml"
791 (+ xmltok-start 2)
792 (+ xmltok-start 5))))
793 (setq xmltok-type 'processing-instruction))))
794 743
795(defun xmltok-scan-after-comment-open () 744(defun xmltok-scan-after-comment-open ()
796 (setq xmltok-type 745 (let ((found-- (search-forward "--" nil 'move)))
797 (cond ((not (search-forward "--" nil t)) 746 (setq xmltok-type
798 (xmltok-add-error "No closing -->") 747 (cond ((or (eq (char-after) ?>) (not found--))
799 (xmltok-add-dependent 'xmltok-unclosed-reparse-p 748 (goto-char (1+ (point)))
800 nil 749 'comment)
801 nil 750 (t
802 ;; not --> because 751 ;; just include the <!-- in the token
803 ;; -- is not allowed 752 (goto-char (+ xmltok-start 4))
804 ;; in comments in XML 753 ;; Need do this after the goto-char because
805 "--") 754 ;; marked error should just apply to <!--
806 'not-well-formed) 755 (xmltok-add-error "First following `--' not followed by `>'")
807 ((eq (char-after) ?>) 756 'not-well-formed)))))
808 (goto-char (1+ (point)))
809 'comment)
810 (t
811 (xmltok-add-dependent
812 'xmltok-semi-closed-reparse-p
813 nil
814 (point)
815 "--"
816 2)
817 ;; just include the <!-- in the token
818 (goto-char (+ xmltok-start 4))
819 ;; Need do this after the goto-char because
820 ;; marked error should just apply to <!--
821 (xmltok-add-error "First following `--' not followed by `>'")
822 'not-well-formed))))
823 757
824(defun xmltok-scan-attributes () 758(defun xmltok-scan-attributes ()
825 (let ((recovering nil) 759 (let ((recovering nil)
@@ -1124,7 +1058,7 @@ comment, processing-instruction-left, processing-instruction-right,
1124markup-declaration-open, markup-declaration-close, 1058markup-declaration-open, markup-declaration-close,
1125internal-subset-open, internal-subset-close, hash-name, keyword, 1059internal-subset-open, internal-subset-close, hash-name, keyword,
1126literal, encoding-name. 1060literal, encoding-name.
1127Adds to `xmltok-errors' and `xmltok-dependent-regions' as appropriate." 1061Adds to `xmltok-errors' as appropriate."
1128 (let ((case-fold-search nil) 1062 (let ((case-fold-search nil)
1129 xmltok-start 1063 xmltok-start
1130 xmltok-type 1064 xmltok-type
@@ -1148,7 +1082,6 @@ Adds to `xmltok-errors' and `xmltok-dependent-regions' as appropriate."
1148 (1- xmltok-internal-subset-start) 1082 (1- xmltok-internal-subset-start)
1149 xmltok-internal-subset-start)) 1083 xmltok-internal-subset-start))
1150 (xmltok-parse-entities) 1084 (xmltok-parse-entities)
1151 ;; XXX prune dependent-regions for those entirely in prolog
1152 (nreverse xmltok-prolog-regions))) 1085 (nreverse xmltok-prolog-regions)))
1153 1086
1154(defconst xmltok-bad-xml-decl-regexp 1087(defconst xmltok-bad-xml-decl-regexp
@@ -1648,95 +1581,68 @@ If LIMIT is non-nil, then do not consider characters beyond LIMIT."
1648 (end (save-excursion 1581 (end (save-excursion
1649 (goto-char safe-end) 1582 (goto-char safe-end)
1650 (search-forward delim nil t)))) 1583 (search-forward delim nil t))))
1651 (or (cond ((not end) 1584 (cond ((or (not end)
1652 (xmltok-add-dependent 'xmltok-unclosed-reparse-p 1585 (save-excursion
1653 nil 1586 (goto-char end)
1654 nil 1587 (looking-at "[ \t\r\n>%[]")))
1655 delim) 1588 (goto-char end))
1656 nil) 1589 ((eq (1+ safe-end) end)
1657 ((save-excursion 1590 (goto-char end)
1658 (goto-char end) 1591 (xmltok-add-error (format "Missing space after %s" delim)
1659 (looking-at "[ \t\r\n>%[]")) 1592 safe-end)))
1660 (goto-char end) 1593 (setq xmltok-type 'literal)))
1661 (setq xmltok-type 'literal))
1662 ((eq (1+ safe-end) end)
1663 (goto-char end)
1664 (xmltok-add-error (format "Missing space after %s" delim)
1665 safe-end)
1666 (setq xmltok-type 'literal))
1667 (t
1668 (xmltok-add-dependent 'xmltok-semi-closed-reparse-p
1669 xmltok-start
1670 (1+ end)
1671 delim
1672 1)
1673 nil))
1674 (progn
1675 (xmltok-add-error (format "Missing closing %s" delim))
1676 (goto-char safe-end)
1677 (skip-chars-backward " \t\r\n")
1678 (setq xmltok-type 'not-well-formed)))))
1679 1594
1680(defun xmltok-scan-prolog-after-processing-instruction-open () 1595(defun xmltok-scan-prolog-after-processing-instruction-open ()
1681 (cond ((not (search-forward "?>" nil t)) 1596 (search-forward "?>" nil 'move)
1682 (xmltok-add-error "No closing ?>" 1597 (let* ((end (point))
1683 xmltok-start 1598 (target
1684 (+ xmltok-start 2)) 1599 (save-excursion
1685 (xmltok-add-dependent 'xmltok-unclosed-reparse-p 1600 (goto-char (+ xmltok-start 2))
1686 nil 1601 (and (looking-at (xmltok-ncname regexp))
1687 nil 1602 (or (memq (char-after (match-end 0))
1688 "?>") 1603 '(?\n ?\t ?\r ? ))
1689 (setq xmltok-type 'not-well-formed)) 1604 (= (match-end 0) (- end 2)))
1690 (t 1605 (match-string-no-properties 0)))))
1691 (let* ((end (point)) 1606 (cond ((not target)
1692 (target 1607 (xmltok-add-error "\
1693 (save-excursion
1694 (goto-char (+ xmltok-start 2))
1695 (and (looking-at (xmltok-ncname regexp))
1696 (or (memq (char-after (match-end 0))
1697 '(?\n ?\t ?\r ? ))
1698 (= (match-end 0) (- end 2)))
1699 (match-string-no-properties 0)))))
1700 (cond ((not target)
1701 (xmltok-add-error "\
1702Processing instruction does not start with a name" 1608Processing instruction does not start with a name"
1703 (+ xmltok-start 2) 1609 (+ xmltok-start 2)
1704 (+ xmltok-start 3))) 1610 (+ xmltok-start 3)))
1705 ((not (and (= (length target) 3) 1611 ((not (and (= (length target) 3)
1706 (let ((case-fold-search t)) 1612 (let ((case-fold-search t))
1707 (string-match "xml" target))))) 1613 (string-match "xml" target)))))
1708 ((= xmltok-start 1) 1614 ((= xmltok-start 1)
1709 (xmltok-add-error "Invalid XML declaration" 1615 (xmltok-add-error "Invalid XML declaration"
1710 xmltok-start 1616 xmltok-start
1711 (point))) 1617 (point)))
1712 ((save-excursion 1618 ((save-excursion
1713 (goto-char xmltok-start) 1619 (goto-char xmltok-start)
1714 (looking-at (xmltok-xml-declaration regexp))) 1620 (looking-at (xmltok-xml-declaration regexp)))
1715 (xmltok-add-error "XML declaration not at beginning of file" 1621 (xmltok-add-error "XML declaration not at beginning of file"
1716 xmltok-start 1622 xmltok-start
1717 (point))) 1623 (point)))
1718 (t 1624 (t
1719 (xmltok-add-error "Processing instruction has target of xml" 1625 (xmltok-add-error "Processing instruction has target of xml"
1720 (+ xmltok-start 2) 1626 (+ xmltok-start 2)
1721 (+ xmltok-start 5)))) 1627 (+ xmltok-start 5))))
1722 (xmltok-add-prolog-region 'processing-instruction-left 1628 (xmltok-add-prolog-region 'processing-instruction-left
1723 xmltok-start 1629 xmltok-start
1724 (+ xmltok-start 1630 (+ xmltok-start
1725 2 1631 2
1726 (if target 1632 (if target
1727 (length target) 1633 (length target)
1728 0))) 1634 0)))
1729 (xmltok-add-prolog-region 'processing-instruction-right 1635 (xmltok-add-prolog-region 'processing-instruction-right
1730 (if target 1636 (if target
1731 (save-excursion 1637 (save-excursion
1732 (goto-char (+ xmltok-start 1638 (goto-char (+ xmltok-start
1733 (length target) 1639 (length target)
1734 2)) 1640 2))
1735 (skip-chars-forward " \t\r\n") 1641 (skip-chars-forward " \t\r\n")
1736 (point)) 1642 (point))
1737 (+ xmltok-start 2)) 1643 (+ xmltok-start 2))
1738 (point))) 1644 (point)))
1739 (setq xmltok-type 'processing-instruction)))) 1645 (setq xmltok-type 'processing-instruction))
1740 1646
1741(defun xmltok-parse-entities () 1647(defun xmltok-parse-entities ()
1742 (let ((todo xmltok-dtd)) 1648 (let ((todo xmltok-dtd))
diff --git a/lisp/obsolete/old-whitespace.el b/lisp/obsolete/old-whitespace.el
index c421836dd84..359c22c50ea 100644
--- a/lisp/obsolete/old-whitespace.el
+++ b/lisp/obsolete/old-whitespace.el
@@ -288,12 +288,6 @@ To disable timer scans, set this to zero."
288 :type 'boolean 288 :type 'boolean
289 :group 'whitespace) 289 :group 'whitespace)
290 290
291(defgroup whitespace-faces nil
292 "Faces used in whitespace."
293 :prefix "whitespace-"
294 :group 'whitespace
295 :group 'faces)
296
297(defface whitespace-highlight '((((class color) (background light)) 291(defface whitespace-highlight '((((class color) (background light))
298 (:background "green1")) 292 (:background "green1"))
299 (((class color) (background dark)) 293 (((class color) (background dark))
@@ -305,7 +299,7 @@ To disable timer scans, set this to zero."
305 (background dark)) 299 (background dark))
306 (:background "white"))) 300 (:background "white")))
307 "Face used for highlighting the bogus whitespaces that exist in the buffer." 301 "Face used for highlighting the bogus whitespaces that exist in the buffer."
308 :group 'whitespace-faces) 302 :group 'whitespace)
309(define-obsolete-face-alias 'whitespace-highlight-face 303(define-obsolete-face-alias 'whitespace-highlight-face
310 'whitespace-highlight "22.1") 304 'whitespace-highlight "22.1")
311 305
diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el
index e2b5dd9fb3b..7ae80b02e2f 100644
--- a/lisp/org/org-pcomplete.el
+++ b/lisp/org/org-pcomplete.el
@@ -46,6 +46,7 @@
46 46
47;;;; Customization variables 47;;;; Customization variables
48 48
49;; Unused. Cf org-completion.
49(defgroup org-complete nil 50(defgroup org-complete nil
50 "Outline-based notes management and organizer." 51 "Outline-based notes management and organizer."
51 :tag "Org" 52 :tag "Org"
diff --git a/lisp/pcmpl-linux.el b/lisp/pcmpl-linux.el
index 7e7bfe28713..a946f0885ac 100644
--- a/lisp/pcmpl-linux.el
+++ b/lisp/pcmpl-linux.el
@@ -31,9 +31,10 @@
31 31
32(require 'pcomplete) 32(require 'pcomplete)
33 33
34(defgroup pcmpl-linux nil 34;; Unused.
35 "Functions for dealing with GNU/Linux completions." 35;;; (defgroup pcmpl-linux nil
36 :group 'pcomplete) 36;;; "Functions for dealing with GNU/Linux completions."
37;;; :group 'pcomplete)
37 38
38;; Functions: 39;; Functions:
39 40
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 49c9c30d313..ab2f570cccb 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -98,8 +98,6 @@ parenthetical grouping.")
98 (let ((map (make-sparse-keymap))) 98 (let ((map (make-sparse-keymap)))
99 (define-key map "\M-." 'octave-find-definition) 99 (define-key map "\M-." 'octave-find-definition)
100 (define-key map "\M-\C-j" 'octave-indent-new-comment-line) 100 (define-key map "\M-\C-j" 'octave-indent-new-comment-line)
101 ;; C-c C-q is also used by cc modes for similar command
102 (define-key map "\C-c\C-q" 'octave-indent-defun)
103 (define-key map "\C-c\C-p" 'octave-previous-code-line) 101 (define-key map "\C-c\C-p" 'octave-previous-code-line)
104 (define-key map "\C-c\C-n" 'octave-next-code-line) 102 (define-key map "\C-c\C-n" 'octave-next-code-line)
105 (define-key map "\C-c\C-a" 'octave-beginning-of-line) 103 (define-key map "\C-c\C-a" 'octave-beginning-of-line)
@@ -134,27 +132,26 @@ parenthetical grouping.")
134 "Menu for Octave mode." 132 "Menu for Octave mode."
135 '("Octave" 133 '("Octave"
136 ("Lines" 134 ("Lines"
137 ["Previous Code Line" octave-previous-code-line t] 135 ["Previous Code Line" octave-previous-code-line t]
138 ["Next Code Line" octave-next-code-line t] 136 ["Next Code Line" octave-next-code-line t]
139 ["Begin of Continuation" octave-beginning-of-line t] 137 ["Begin of Continuation" octave-beginning-of-line t]
140 ["End of Continuation" octave-end-of-line t] 138 ["End of Continuation" octave-end-of-line t]
141 ["Split Line at Point" octave-indent-new-comment-line t]) 139 ["Split Line at Point" octave-indent-new-comment-line t])
142 ("Blocks" 140 ("Blocks"
143 ["Mark Block" octave-mark-block t] 141 ["Mark Block" octave-mark-block t]
144 ["Close Block" smie-close-block t]) 142 ["Close Block" smie-close-block t])
145 ("Functions" 143 ("Functions"
146 ["Indent Function" octave-indent-defun t] 144 ["Insert Function" octave-insert-defun t]
147 ["Insert Function" octave-insert-defun t] 145 ["Update function file comment" octave-update-function-file-comment t])
148 ["Update function file comment" octave-update-function-file-comment t])
149 "-" 146 "-"
150 ("Debug" 147 ("Debug"
151 ["Send Current Line" octave-send-line t] 148 ["Send Current Line" octave-send-line t]
152 ["Send Current Block" octave-send-block t] 149 ["Send Current Block" octave-send-block t]
153 ["Send Current Function" octave-send-defun t] 150 ["Send Current Function" octave-send-defun t]
154 ["Send Region" octave-send-region t] 151 ["Send Region" octave-send-region t]
155 ["Show Process Buffer" octave-show-process-buffer t] 152 ["Show Process Buffer" octave-show-process-buffer t]
156 ["Hide Process Buffer" octave-hide-process-buffer t] 153 ["Hide Process Buffer" octave-hide-process-buffer t]
157 ["Kill Process" octave-kill-process t]) 154 ["Kill Process" octave-kill-process t])
158 "-" 155 "-"
159 ["Indent Line" indent-according-to-mode t] 156 ["Indent Line" indent-according-to-mode t]
160 ["Complete Symbol" completion-at-point t] 157 ["Complete Symbol" completion-at-point t]
@@ -1111,14 +1108,8 @@ The new line is properly indented."
1111 (insert (concat " " octave-continuation-string)) 1108 (insert (concat " " octave-continuation-string))
1112 (reindent-then-newline-and-indent)))) 1109 (reindent-then-newline-and-indent))))
1113 1110
1114(defun octave-indent-defun () 1111(define-obsolete-function-alias
1115 "Properly indent the Octave function which contains point." 1112 'octave-indent-defun 'prog-indent-sexp "24.4")
1116 (interactive)
1117 (save-excursion
1118 (mark-defun)
1119 (message "Indenting function...")
1120 (indent-region (point) (mark) nil))
1121 (message "Indenting function...done."))
1122 1113
1123 1114
1124;;; Motion 1115;;; Motion
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index 6cb4713885e..256695acc9f 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -148,6 +148,7 @@ as words.
148 148
149;;;###autoload 149;;;###autoload
150(define-global-minor-mode global-subword-mode subword-mode 150(define-global-minor-mode global-subword-mode subword-mode
151 :group 'convenience
151 (lambda () (subword-mode 1))) 152 (lambda () (subword-mode 1)))
152 153
153(defun subword-forward (&optional arg) 154(defun subword-forward (&optional arg)
@@ -301,6 +302,7 @@ edit them as words.
301 302
302;;;###autoload 303;;;###autoload
303(define-global-minor-mode global-superword-mode superword-mode 304(define-global-minor-mode global-superword-mode superword-mode
305 :group 'convenience
304 (lambda () (superword-mode 1))) 306 (lambda () (superword-mode 1)))
305 307
306 308
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 1a7ecb5ef87..8b61ae400d2 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -13,10 +13,10 @@
13;; filed in the Emacs bug reporting system against this file, a copy 13;; filed in the Emacs bug reporting system against this file, a copy
14;; of the bug report be sent to the maintainer's email address. 14;; of the bug report be sent to the maintainer's email address.
15 15
16(defconst vhdl-version "3.33.28" 16(defconst vhdl-version "3.34.2"
17 "VHDL Mode version number.") 17 "VHDL Mode version number.")
18 18
19(defconst vhdl-time-stamp "2010-09-22" 19(defconst vhdl-time-stamp "2012-11-21"
20 "VHDL Mode time stamp for last update.") 20 "VHDL Mode time stamp for last update.")
21 21
22;; This file is part of GNU Emacs. 22;; This file is part of GNU Emacs.
@@ -72,8 +72,7 @@
72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73;; Emacs Versions 73;; Emacs Versions
74 74
75;; supported: GNU Emacs 20.X/21.X/22.X,23.X, XEmacs 20.X/21.X 75;; this updated version was only tested on: GNU Emacs 20.4
76;; tested on: GNU Emacs 20.4/21.3/22.1,23.X, XEmacs 21.1 (marginally)
77 76
78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79;; Installation 78;; Installation
@@ -84,7 +83,7 @@
84;; or into an arbitrary directory that is added to the load path by the 83;; or into an arbitrary directory that is added to the load path by the
85;; following line in your Emacs start-up file `.emacs': 84;; following line in your Emacs start-up file `.emacs':
86 85
87;; (setq load-path (cons (expand-file-name "<directory-name>") load-path)) 86;; (push (expand-file-name "<directory-name>") load-path)
88 87
89;; If you already have the compiled `vhdl-mode.elc' file, put it in the same 88;; If you already have the compiled `vhdl-mode.elc' file, put it in the same
90;; directory. Otherwise, byte-compile the source file: 89;; directory. Otherwise, byte-compile the source file:
@@ -96,7 +95,7 @@
96;; (not required in Emacs 20 and higher): 95;; (not required in Emacs 20 and higher):
97 96
98;; (autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t) 97;; (autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t)
99;; (setq auto-mode-alist (cons '("\\.vhdl?\\'" . vhdl-mode) auto-mode-alist)) 98;; (push '("\\.vhdl?\\'" . vhdl-mode) auto-mode-alist)
100 99
101;; More detailed installation instructions are included in the official 100;; More detailed installation instructions are included in the official
102;; VHDL Mode distribution. 101;; VHDL Mode distribution.
@@ -130,6 +129,7 @@
130;; Emacs 21+ handling 129;; Emacs 21+ handling
131(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not (featurep 'xemacs))) 130(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not (featurep 'xemacs)))
132 "Non-nil if GNU Emacs 21, 22, ... is used.") 131 "Non-nil if GNU Emacs 21, 22, ... is used.")
132;; Emacs 22+ handling
133(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not (featurep 'xemacs))) 133(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not (featurep 'xemacs)))
134 "Non-nil if GNU Emacs 22, ... is used.") 134 "Non-nil if GNU Emacs 22, ... is used.")
135 135
@@ -210,22 +210,25 @@ Overrides local variable `indent-tabs-mode'."
210 210
211(defcustom vhdl-compiler-alist 211(defcustom vhdl-compiler-alist
212 '( 212 '(
213 ;; 60: docal <= false;
214 ;; ^^^^^
215 ;; [Error] Assignment error: variable is illegal target of signal assignment
213 ("ADVance MS" "vacom" "-work \\1" "make" "-f \\1" 216 ("ADVance MS" "vacom" "-work \\1" "make" "-f \\1"
214 nil "valib \\1; vamap \\2 \\1" "./" "work/" "Makefile" "adms" 217 nil "valib \\1; vamap \\2 \\1" "./" "work/" "Makefile" "adms"
215 ("\\s-\\([0-9]+\\):" 0 1 0) ("Compiling file \\(.+\\)" 1) 218 ("^\\s-+\\([0-9]+\\):\\s-+" nil 1 nil) ("Compiling file \\(.+\\)" 1)
216 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif" 219 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif"
217 "PACK/\\1.vif" "BODY/\\1.vif" upcase)) 220 "PACK/\\1.vif" "BODY/\\1.vif" upcase))
218 ;; Aldec 221 ;; Aldec
219 ;; COMP96 ERROR COMP96_0078: "Unknown identifier "Addr_Bits"." "<filename>" 40 30 222 ;; COMP96 ERROR COMP96_0018: "Identifier expected." "test.vhd" 66 3
220 ("Aldec" "vcom" "-93 -work \\1" "make" "-f \\1" 223 ("Aldec" "vcom" "-work \\1" "make" "-f \\1"
221 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "aldec" 224 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "aldec"
222 (".+?[ \t]+\\(?:ERROR\\)[^:]+:.+?\\(?:.+\"\\(.+?\\)\"[ \t]+\\([0-9]+\\)\\)" 1 2 0) ("" 0) 225 (".* ERROR [^:]+: \".*\" \"\\([^ \\t\\n]+\\)\" \\([0-9]+\\) \\([0-9]+\\)" 1 2 3) ("" 0)
223 nil) 226 nil)
224 ;; Cadence Leapfrog: cv -file test.vhd 227 ;; Cadence Leapfrog: cv -file test.vhd
225 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared 228 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared
226 ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1" 229 ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1"
227 nil "mkdir \\1" "./" "work/" "Makefile" "leapfrog" 230 nil "mkdir \\1" "./" "work/" "Makefile" "leapfrog"
228 ("duluth: \\*E,[0-9]+ (\\(.+\\),\\([0-9]+\\)):" 1 2 0) ("" 0) 231 ("duluth: \\*E,[0-9]+ (\\([^ \\t\\n]+\\),\\([0-9]+\\)):" 1 2 nil) ("" 0)
229 ("\\1/entity" "\\2/\\1" "\\1/configuration" 232 ("\\1/entity" "\\2/\\1" "\\1/configuration"
230 "\\1/package" "\\1/body" downcase)) 233 "\\1/package" "\\1/body" downcase))
231 ;; Cadence Affirma NC vhdl: ncvhdl test.vhd 234 ;; Cadence Affirma NC vhdl: ncvhdl test.vhd
@@ -233,21 +236,27 @@ Overrides local variable `indent-tabs-mode'."
233 ;; (PLL_400X_TOP) is not declared [10.3]. 236 ;; (PLL_400X_TOP) is not declared [10.3].
234 ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1" 237 ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1"
235 nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl" 238 nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl"
236 ("ncvhdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) 239 ("ncvhdl_p: \\*E,\\w+ (\\([^ \\t\\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0)
237 ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db" 240 ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db"
238 "\\1/package/pc.db" "\\1/body/pc.db" downcase)) 241 "\\1/package/pc.db" "\\1/body/pc.db" downcase))
239 ;; ghdl vhdl: ghdl test.vhd 242 ;; ghdl vhdl: ghdl test.vhd
240 ("GHDL" "ghdl" "-i --workdir=\\1 --ieee=synopsys -fexplicit " "make" "-f \\1" 243 ("GHDL" "ghdl" "-i --workdir=\\1 --ieee=synopsys -fexplicit " "make" "-f \\1"
241 nil "mkdir \\1" "./" "work/" "Makefile" "ghdl" 244 nil "mkdir \\1" "./" "work/" "Makefile" "ghdl"
242 ("ghdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) 245 ("ghdl_p: \\*E,\\w+ (\\([^ \\t\\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0)
243 ("\\1/entity" "\\2/\\1" "\\1/configuration" 246 ("\\1/entity" "\\2/\\1" "\\1/configuration"
244 "\\1/package" "\\1/body" downcase)) 247 "\\1/package" "\\1/body" downcase))
248 ;; IBM Compiler
249 ;; 00 COACHDL* | [CCHDL-1]: File: adder.vhd, line.column: 120.6
250 ("IBM Compiler" "g2tvc" "-src" "precomp" "\\1"
251 nil "mkdir \\1" "./" "work/" "Makefile" "ibm"
252 ("[0-9]+ COACHDL.*: File: \\([^ \\t\\n]+\\), line.column: \\([0-9]+\\).\\([0-9]+\\)" 1 2 3) (" " 0)
253 nil)
245 ;; Ikos Voyager: analyze test.vhd 254 ;; Ikos Voyager: analyze test.vhd
246 ;; analyze test.vhd 255 ;; analyze test.vhd
247 ;; E L4/C5: this library unit is inaccessible 256 ;; E L4/C5: this library unit is inaccessible
248 ("Ikos" "analyze" "-l \\1" "make" "-f \\1" 257 ("Ikos" "analyze" "-l \\1" "make" "-f \\1"
249 nil "mkdir \\1" "./" "work/" "Makefile" "ikos" 258 nil "mkdir \\1" "./" "work/" "Makefile" "ikos"
250 ("E L\\([0-9]+\\)/C\\([0-9]+\\):" 0 1 2) 259 ("E L\\([0-9]+\\)/C\\([0-9]+\\):" nil 1 2)
251 ("^analyze +\\(.+ +\\)*\\(.+\\)$" 2) 260 ("^analyze +\\(.+ +\\)*\\(.+\\)$" 2)
252 nil) 261 nil)
253 ;; ModelSim, Model Technology: vcom test.vhd 262 ;; ModelSim, Model Technology: vcom test.vhd
@@ -257,29 +266,39 @@ Overrides local variable `indent-tabs-mode'."
257 ;; ** Error: adder.vhd(190): Unknown identifier: ctl_numb 266 ;; ** Error: adder.vhd(190): Unknown identifier: ctl_numb
258 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1" 267 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1"
259 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim" 268 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim"
260 ("\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\[[0-9]+\]\\)? \\(.+\\)(\\([0-9]+\\)):" 3 4 0) ("" 0) 269 ("\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\[[0-9]+\]\\)? \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 3 4 nil) ("" 0)
261 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" 270 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat"
262 "\\1/_primary.dat" "\\1/body.dat" downcase)) 271 "\\1/_primary.dat" "\\1/body.dat" downcase))
263 ;; ProVHDL, Synopsys LEDA: provhdl -w work -f test.vhd 272 ;; ProVHDL, Synopsys LEDA: provhdl -w work -f test.vhd
264 ;; test.vhd:34: error message 273 ;; test.vhd:34: error message
265 ("LEDA ProVHDL" "provhdl" "-w \\1 -f" "make" "-f \\1" 274 ("LEDA ProVHDL" "provhdl" "-w \\1 -f" "make" "-f \\1"
266 nil "mkdir \\1" "./" "work/" "Makefile" "provhdl" 275 nil "mkdir \\1" "./" "work/" "Makefile" "provhdl"
267 ("\\([^ \t\n]+\\):\\([0-9]+\\): " 1 2 0) ("" 0) 276 ("\\([^ \\t\\n]+\\):\\([0-9]+\\): " 1 2 nil) ("" 0)
268 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif" 277 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif"
269 "PACK/\\1.vif" "BODY/BODY-\\1.vif" upcase)) 278 "PACK/\\1.vif" "BODY/BODY-\\1.vif" upcase))
279 ;; Quartus compiler
280 ;; Error: VHDL error at dvi2sdi.vhd(473): object k2_alto_out_lvl is used
281 ;; Error: Verilog HDL syntax error at otsuif_v1_top.vhd(147) near text
282 ;; Error: VHDL syntax error at otsuif_v1_top.vhd(147): clk_ is an illegal
283 ;; Error: VHDL Use Clause error at otsuif_v1_top.vhd(455): design library
284 ;; Warning: VHDL Process Statement warning at dvi2sdi_tst.vhd(172): ...
285 ("Quartus" "make" "-work \\1" "make" "-f \\1"
286 nil "mkdir \\1" "./" "work/" "Makefile" "quartus"
287 ("\\(Error\\|Warning\\): .* \\([^ \\t\\n]+\\)(\\([0-9]+\\))" 2 3 nil) ("" 0)
288 nil)
270 ;; QuickHDL, Mentor Graphics: qvhcom test.vhd 289 ;; QuickHDL, Mentor Graphics: qvhcom test.vhd
271 ;; ERROR: test.vhd(24): near "dnd": expecting: END 290 ;; ERROR: test.vhd(24): near "dnd": expecting: END
272 ;; WARNING[4]: test.vhd(30): A space is required between ... 291 ;; WARNING[4]: test.vhd(30): A space is required between ...
273 ("QuickHDL" "qvhcom" "-work \\1" "make" "-f \\1" 292 ("QuickHDL" "qvhcom" "-work \\1" "make" "-f \\1"
274 nil "mkdir \\1" "./" "work/" "Makefile" "quickhdl" 293 nil "mkdir \\1" "./" "work/" "Makefile" "quickhdl"
275 ("\\(ERROR\\|WARNING\\)[^:]*: \\(.+\\)(\\([0-9]+\\)):" 2 3 0) ("" 0) 294 ("\\(ERROR\\|WARNING\\)[^:]*: \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 2 3 nil) ("" 0)
276 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" 295 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat"
277 "\\1/_primary.dat" "\\1/body.dat" downcase)) 296 "\\1/_primary.dat" "\\1/body.dat" downcase))
278 ;; Savant: scram -publish-cc test.vhd 297 ;; Savant: scram -publish-cc test.vhd
279 ;; test.vhd:87: _set_passed_through_out_port(IIR_Boolean) not defined for 298 ;; test.vhd:87: _set_passed_through_out_port(IIR_Boolean) not defined for
280 ("Savant" "scram" "-publish-cc -design-library-name \\1" "make" "-f \\1" 299 ("Savant" "scram" "-publish-cc -design-library-name \\1" "make" "-f \\1"
281 nil "mkdir \\1" "./" "work._savant_lib/" "Makefile" "savant" 300 nil "mkdir \\1" "./" "work._savant_lib/" "Makefile" "savant"
282 ("\\([^ \t\n]+\\):\\([0-9]+\\): " 1 2 0) ("" 0) 301 ("\\([^ \\t\\n]+\\):\\([0-9]+\\): " 1 2 nil) ("" 0)
283 ("\\1_entity.vhdl" "\\2_secondary_units._savant_lib/\\2_\\1.vhdl" 302 ("\\1_entity.vhdl" "\\2_secondary_units._savant_lib/\\2_\\1.vhdl"
284 "\\1_config.vhdl" "\\1_package.vhdl" 303 "\\1_config.vhdl" "\\1_package.vhdl"
285 "\\1_secondary_units._savant_lib/\\1_package_body.vhdl" downcase)) 304 "\\1_secondary_units._savant_lib/\\1_package_body.vhdl" downcase))
@@ -287,39 +306,39 @@ Overrides local variable `indent-tabs-mode'."
287 ;; Error: CSVHDL0002: test.vhd: (line 97): Invalid prefix 306 ;; Error: CSVHDL0002: test.vhd: (line 97): Invalid prefix
288 ("Simili" "vhdlp" "-work \\1" "make" "-f \\1" 307 ("Simili" "vhdlp" "-work \\1" "make" "-f \\1"
289 nil "mkdir \\1" "./" "work/" "Makefile" "simili" 308 nil "mkdir \\1" "./" "work/" "Makefile" "simili"
290 ("\\(Error\\|Warning\\): \\w+: \\(.+\\): (line \\([0-9]+\\)): " 2 3 0) ("" 0) 309 ("\\(Error\\|Warning\\): \\w+: \\([^ \\t\\n]+\\): (line \\([0-9]+\\)): " 2 3 nil) ("" 0)
291 ("\\1/prim.var" "\\2/_\\1.var" "\\1/prim.var" 310 ("\\1/prim.var" "\\2/_\\1.var" "\\1/prim.var"
292 "\\1/prim.var" "\\1/_body.var" downcase)) 311 "\\1/prim.var" "\\1/_body.var" downcase))
293 ;; Speedwave (Innoveda): analyze -libfile vsslib.ini -src test.vhd 312 ;; Speedwave (Innoveda): analyze -libfile vsslib.ini -src test.vhd
294 ;; ERROR[11]::File test.vhd Line 100: Use of undeclared identifier 313 ;; ERROR[11]::File test.vhd Line 100: Use of undeclared identifier
295 ("Speedwave" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" 314 ("Speedwave" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
296 nil "mkdir \\1" "./" "work/" "Makefile" "speedwave" 315 nil "mkdir \\1" "./" "work/" "Makefile" "speedwave"
297 ("^ *ERROR\[[0-9]+\]::File \\(.+\\) Line \\([0-9]+\\):" 1 2 0) ("" 0) 316 ("^ *ERROR\[[0-9]+\]::File \\([^ \\t\\n]+\\) Line \\([0-9]+\\):" 1 2 nil) ("" 0)
298 nil) 317 nil)
299 ;; Synopsys, VHDL Analyzer (sim): vhdlan -nc test.vhd 318 ;; Synopsys, VHDL Analyzer (sim): vhdlan -nc test.vhd
300 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context. 319 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context.
301 ("Synopsys" "vhdlan" "-nc -work \\1" "make" "-f \\1" 320 ("Synopsys" "vhdlan" "-nc -work \\1" "make" "-f \\1"
302 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys" 321 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys"
303 ("\\*\\*Error: vhdlan,[0-9]+ \\(.+\\)(\\([0-9]+\\)):" 1 2 0) ("" 0) 322 ("\\*\\*Error: vhdlan,[0-9]+ \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 1 2 nil) ("" 0)
304 ("\\1.sim" "\\2__\\1.sim" "\\1.sim" "\\1.sim" "\\1__.sim" upcase)) 323 ("\\1.sim" "\\2__\\1.sim" "\\1.sim" "\\1.sim" "\\1__.sim" upcase))
305 ;; Synopsys, VHDL Analyzer (syn): vhdlan -nc -spc test.vhd 324 ;; Synopsys, VHDL Analyzer (syn): vhdlan -nc -spc test.vhd
306 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context. 325 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context.
307 ("Synopsys Design Compiler" "vhdlan" "-nc -spc -work \\1" "make" "-f \\1" 326 ("Synopsys Design Compiler" "vhdlan" "-nc -spc -work \\1" "make" "-f \\1"
308 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys_dc" 327 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys_dc"
309 ("\\*\\*Error: vhdlan,[0-9]+ \\(.+\\)(\\([0-9]+\\)):" 1 2 0) ("" 0) 328 ("\\*\\*Error: vhdlan,[0-9]+ \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 1 2 nil) ("" 0)
310 ("\\1.syn" "\\2__\\1.syn" "\\1.syn" "\\1.syn" "\\1__.syn" upcase)) 329 ("\\1.syn" "\\2__\\1.syn" "\\1.syn" "\\1.syn" "\\1__.syn" upcase))
311 ;; Synplify: 330 ;; Synplify:
312 ;; @W:"test.vhd":57:8:57:9|Optimizing register bit count_x(5) to a constant 0 331 ;; @W:"test.vhd":57:8:57:9|Optimizing register bit count_x(5) to a constant 0
313 ("Synplify" "n/a" "n/a" "make" "-f \\1" 332 ("Synplify" "n/a" "n/a" "make" "-f \\1"
314 nil "mkdir \\1" "./" "work/" "Makefile" "synplify" 333 nil "mkdir \\1" "./" "work/" "Makefile" "synplify"
315 ("@[EWN]:\"\\(.+\\)\":\\([0-9]+\\):\\([0-9]+\\):" 1 2 3) ("" 0) 334 ("@[EWN]:\"\\([^ \\t\\n]+\\)\":\\([0-9]+\\):\\([0-9]+\\):" 1 2 3) ("" 0)
316 nil) 335 nil)
317 ;; Vantage: analyze -libfile vsslib.ini -src test.vhd 336 ;; Vantage: analyze -libfile vsslib.ini -src test.vhd
318 ;; Compiling "test.vhd" line 1... 337 ;; Compiling "test.vhd" line 1...
319 ;; **Error: LINE 49 *** No aggregate value is valid in this context. 338 ;; **Error: LINE 49 *** No aggregate value is valid in this context.
320 ("Vantage" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" 339 ("Vantage" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
321 nil "mkdir \\1" "./" "work/" "Makefile" "vantage" 340 nil "mkdir \\1" "./" "work/" "Makefile" "vantage"
322 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0) 341 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil)
323 ("^ *Compiling \"\\(.+\\)\" " 1) 342 ("^ *Compiling \"\\(.+\\)\" " 1)
324 nil) 343 nil)
325 ;; VeriBest: vc vhdl test.vhd 344 ;; VeriBest: vc vhdl test.vhd
@@ -329,21 +348,21 @@ Overrides local variable `indent-tabs-mode'."
329 ;; [Error] Name BITA is unknown 348 ;; [Error] Name BITA is unknown
330 ("VeriBest" "vc" "vhdl" "make" "-f \\1" 349 ("VeriBest" "vc" "vhdl" "make" "-f \\1"
331 nil "mkdir \\1" "./" "work/" "Makefile" "veribest" 350 nil "mkdir \\1" "./" "work/" "Makefile" "veribest"
332 ("^ +\\([0-9]+\\): +[^ ]" 0 1 0) ("" 0) 351 ("^ +\\([0-9]+\\): +[^ ]" nil 1 nil) ("" 0)
333 nil) 352 nil)
334 ;; Viewlogic: analyze -libfile vsslib.ini -src test.vhd 353 ;; Viewlogic: analyze -libfile vsslib.ini -src test.vhd
335 ;; Compiling "test.vhd" line 1... 354 ;; Compiling "test.vhd" line 1...
336 ;; **Error: LINE 49 *** No aggregate value is valid in this context. 355 ;; **Error: LINE 49 *** No aggregate value is valid in this context.
337 ("Viewlogic" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" 356 ("Viewlogic" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
338 nil "mkdir \\1" "./" "work/" "Makefile" "viewlogic" 357 nil "mkdir \\1" "./" "work/" "Makefile" "viewlogic"
339 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0) 358 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil)
340 ("^ *Compiling \"\\(.+\\)\" " 1) 359 ("^ *Compiling \"\\(.+\\)\" " 1)
341 nil) 360 nil)
342 ;; Xilinx XST: 361 ;; Xilinx XST:
343 ;; ERROR:HDLParsers:164 - "test.vhd" Line 3. parse error 362 ;; ERROR:HDLParsers:164 - "test.vhd" Line 3. parse error
344 ("Xilinx XST" "xflow" "" "make" "-f \\1" 363 ("Xilinx XST" "xflow" "" "make" "-f \\1"
345 nil "mkdir \\1" "./" "work/" "Makefile" "xilinx" 364 nil "mkdir \\1" "./" "work/" "Makefile" "xilinx"
346 ("^ERROR:HDLParsers:[0-9]+ - \"\\(.+\\)\" Line \\([0-9]+\\)\." 1 2 0) ("" 0) 365 ("^ERROR:HDLParsers:[0-9]+ - \"\\([^ \\t\\n]+\\)\" Line \\([0-9]+\\)\." 1 2 nil) ("" 0)
347 nil) 366 nil)
348 ) 367 )
349 "List of available VHDL compilers and their properties. 368 "List of available VHDL compilers and their properties.
@@ -429,9 +448,13 @@ NOTE: Activate new error and file message regexps and reflect the new setting
429 (string :tag "ID string ") 448 (string :tag "ID string ")
430 (list :tag "Error message" :indent 4 449 (list :tag "Error message" :indent 4
431 (regexp :tag "Regexp ") 450 (regexp :tag "Regexp ")
432 (integer :tag "File subexp index") 451 (choice :tag "File subexp "
452 (integer :tag "Index")
453 (const :tag "No file name" nil))
433 (integer :tag "Line subexp index") 454 (integer :tag "Line subexp index")
434 (integer :tag "Column subexp idx")) 455 (choice :tag "Column subexp "
456 (integer :tag "Index")
457 (const :tag "No column number" nil)))
435 (list :tag "File message" :indent 4 458 (list :tag "File message" :indent 4
436 (regexp :tag "Regexp ") 459 (regexp :tag "Regexp ")
437 (integer :tag "File subexp index")) 460 (integer :tag "File subexp index"))
@@ -450,6 +473,7 @@ NOTE: Activate new error and file message regexps and reflect the new setting
450 (const :tag "Downcase" downcase)))))) 473 (const :tag "Downcase" downcase))))))
451 :set (lambda (variable value) 474 :set (lambda (variable value)
452 (vhdl-custom-set variable value 'vhdl-update-mode-menu)) 475 (vhdl-custom-set variable value 'vhdl-update-mode-menu))
476 :version "24.4"
453 :group 'vhdl-compile) 477 :group 'vhdl-compile)
454 478
455(defcustom vhdl-compiler "GHDL" 479(defcustom vhdl-compiler "GHDL"
@@ -457,7 +481,7 @@ NOTE: Activate new error and file message regexps and reflect the new setting
457Select a compiler name from the ones defined in option `vhdl-compiler-alist'." 481Select a compiler name from the ones defined in option `vhdl-compiler-alist'."
458 :type (let ((alist vhdl-compiler-alist) list) 482 :type (let ((alist vhdl-compiler-alist) list)
459 (while alist 483 (while alist
460 (setq list (cons (list 'const (caar alist)) list)) 484 (push (list 'const (caar alist)) list)
461 (setq alist (cdr alist))) 485 (setq alist (cdr alist)))
462 (append '(choice) (nreverse list))) 486 (append '(choice) (nreverse list)))
463 :group 'vhdl-compile) 487 :group 'vhdl-compile)
@@ -602,7 +626,7 @@ NOTE: Reflect the new setting in the choice list of option `vhdl-project'
602 (list :tag "Compiler" :indent 6 626 (list :tag "Compiler" :indent 6
603 ,(let ((alist vhdl-compiler-alist) list) 627 ,(let ((alist vhdl-compiler-alist) list)
604 (while alist 628 (while alist
605 (setq list (cons (list 'const (caar alist)) list)) 629 (push (list 'const (caar alist)) list)
606 (setq alist (cdr alist))) 630 (setq alist (cdr alist)))
607 (append '(choice :tag "Compiler name") 631 (append '(choice :tag "Compiler name")
608 (nreverse list))) 632 (nreverse list)))
@@ -637,7 +661,7 @@ headers and the source files/directories to be scanned in the hierarchy
637browser. The current project can also be changed temporarily in the menu." 661browser. The current project can also be changed temporarily in the menu."
638 :type (let ((alist vhdl-project-alist) list) 662 :type (let ((alist vhdl-project-alist) list)
639 (while alist 663 (while alist
640 (setq list (cons (list 'const (caar alist)) list)) 664 (push (list 'const (caar alist)) list)
641 (setq alist (cdr alist))) 665 (setq alist (cdr alist)))
642 (append '(choice (const :tag "None" nil) (const :tag "--")) 666 (append '(choice (const :tag "None" nil) (const :tag "--"))
643 (nreverse list))) 667 (nreverse list)))
@@ -1268,6 +1292,18 @@ The comments and empty lines between groups of ports are pasted:
1268 (const :tag "Always" always)) 1292 (const :tag "Always" always))
1269 :group 'vhdl-port) 1293 :group 'vhdl-port)
1270 1294
1295(defcustom vhdl-actual-generic-name '(".*" . "\\&")
1296 (concat
1297 "Specifies how actual generic names are obtained from formal generic names.
1298In a component instantiation, an actual generic name can be
1299obtained by modifying the formal generic name (e.g. attaching or stripping
1300off a substring)."
1301 vhdl-name-doc-string)
1302 :type '(cons (regexp :tag "From regexp")
1303 (string :tag "To string "))
1304 :group 'vhdl-port
1305 :version "24.4")
1306
1271(defcustom vhdl-actual-port-name '(".*" . "\\&") 1307(defcustom vhdl-actual-port-name '(".*" . "\\&")
1272 (concat 1308 (concat
1273 "Specifies how actual port names are obtained from formal port names. 1309 "Specifies how actual port names are obtained from formal port names.
@@ -1469,21 +1505,21 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
1469(defvar end-comment-column) 1505(defvar end-comment-column)
1470 1506
1471 1507
1472(defgroup vhdl-align nil 1508(defgroup vhdl-beautify nil
1473 "Customizations for alignment." 1509 "Customizations for beautification."
1474 :group 'vhdl) 1510 :group 'vhdl)
1475 1511
1476(defcustom vhdl-auto-align t 1512(defcustom vhdl-auto-align t
1477 "Non-nil means align some templates automatically after generation." 1513 "Non-nil means align some templates automatically after generation."
1478 :type 'boolean 1514 :type 'boolean
1479 :group 'vhdl-align) 1515 :group 'vhdl-beautify)
1480 1516
1481(defcustom vhdl-align-groups t 1517(defcustom vhdl-align-groups t
1482 "Non-nil means align groups of code lines separately. 1518 "Non-nil means align groups of code lines separately.
1483A group of code lines is a region of consecutive lines between two lines that 1519A group of code lines is a region of consecutive lines between two lines that
1484match the regexp in option `vhdl-align-group-separate'." 1520match the regexp in option `vhdl-align-group-separate'."
1485 :type 'boolean 1521 :type 'boolean
1486 :group 'vhdl-align) 1522 :group 'vhdl-beautify)
1487 1523
1488(defcustom vhdl-align-group-separate "^\\s-*$" 1524(defcustom vhdl-align-group-separate "^\\s-*$"
1489 "Regexp for matching a line that separates groups of lines for alignment. 1525 "Regexp for matching a line that separates groups of lines for alignment.
@@ -1491,7 +1527,7 @@ Examples:
1491 \"^\\s-*$\": matches an empty line 1527 \"^\\s-*$\": matches an empty line
1492 \"^\\s-*\\(--.*\\)?$\": matches an empty line or a comment-only line" 1528 \"^\\s-*\\(--.*\\)?$\": matches an empty line or a comment-only line"
1493 :type 'regexp 1529 :type 'regexp
1494 :group 'vhdl-align) 1530 :group 'vhdl-beautify)
1495 1531
1496(defcustom vhdl-align-same-indent t 1532(defcustom vhdl-align-same-indent t
1497 "Non-nil means align blocks with same indent separately. 1533 "Non-nil means align blocks with same indent separately.
@@ -1500,7 +1536,18 @@ blocks of same indent which are aligned separately (except for argument/port
1500lists). This gives nicer alignment in most cases. 1536lists). This gives nicer alignment in most cases.
1501Option `vhdl-align-groups' still applies within these blocks." 1537Option `vhdl-align-groups' still applies within these blocks."
1502 :type 'boolean 1538 :type 'boolean
1503 :group 'vhdl-align) 1539 :group 'vhdl-beautify)
1540
1541(defcustom vhdl-beautify-options '(t t t t t)
1542 "List of options for beautifying code. Allows to disable individual
1543features of code beautification."
1544 :type '(list (boolean :tag "Whitespace cleanup ")
1545 (boolean :tag "Single statement per line")
1546 (boolean :tag "Indentation ")
1547 (boolean :tag "Alignment ")
1548 (boolean :tag "Case fixing "))
1549 :group 'vhdl-beautify
1550 :version "24.4")
1504 1551
1505 1552
1506(defgroup vhdl-highlight nil 1553(defgroup vhdl-highlight nil
@@ -1846,7 +1893,7 @@ useful in large files where syntax-based indentation gets very slow."
1846 :group 'vhdl-misc) 1893 :group 'vhdl-misc)
1847 1894
1848(defcustom vhdl-indent-comment-like-next-code-line t 1895(defcustom vhdl-indent-comment-like-next-code-line t
1849 "*Non-nil means comment lines are indented like the following code line. 1896 "Non-nil means comment lines are indented like the following code line.
1850Otherwise, comment lines are indented like the preceding code line. 1897Otherwise, comment lines are indented like the preceding code line.
1851Indenting comment lines like the following code line gives nicer indentation 1898Indenting comment lines like the following code line gives nicer indentation
1852when comments precede the code that they refer to." 1899when comments precede the code that they refer to."
@@ -2067,7 +2114,7 @@ your style, only those that are different from the default.")
2067 (lambda (var) 2114 (lambda (var)
2068 (cons var (symbol-value var)))) 2115 (cons var (symbol-value var))))
2069 varlist)))) 2116 varlist))))
2070 (setq vhdl-style-alist (cons default vhdl-style-alist)))) 2117 (push default vhdl-style-alist)))
2071 2118
2072(defvar vhdl-mode-hook nil 2119(defvar vhdl-mode-hook nil
2073 "Hook called by `vhdl-mode'.") 2120 "Hook called by `vhdl-mode'.")
@@ -2084,10 +2131,11 @@ your style, only those that are different from the default.")
2084(require 'hippie-exp) 2131(require 'hippie-exp)
2085 2132
2086;; optional (minimize warning messages during compile) 2133;; optional (minimize warning messages during compile)
2134(unless (featurep 'xemacs)
2087(eval-when-compile 2135(eval-when-compile
2088 (require 'font-lock) 2136 (require 'font-lock)
2089 (require 'ps-print) 2137 (require 'ps-print)
2090 (require 'speedbar)) 2138 (require 'speedbar)))
2091 2139
2092 2140
2093;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2187,6 +2235,17 @@ Ignore byte-compiler warnings you might see."
2187(unless (fboundp 'member-ignore-case) 2235(unless (fboundp 'member-ignore-case)
2188 (defalias 'member-ignore-case 'member)) 2236 (defalias 'member-ignore-case 'member))
2189 2237
2238;; `last-input-char' obsolete in Emacs 24, `last-input-event' different
2239;; behavior in XEmacs
2240(defvar vhdl-last-input-event)
2241(if (featurep 'xemacs)
2242 (defvaralias 'vhdl-last-input-event 'last-input-char)
2243 (defvaralias 'vhdl-last-input-event 'last-input-event))
2244
2245;; `help-print-return-message' changed to `print-help-return-message' in Emacs
2246;;;(unless (fboundp 'help-print-return-message)
2247;;; (defalias 'help-print-return-message 'print-help-return-message))
2248
2190;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2249;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2191;; Compatibility with older VHDL Mode versions 2250;; Compatibility with older VHDL Mode versions
2192 2251
@@ -2207,7 +2266,7 @@ Ignore byte-compiler warnings you might see."
2207 (vhdl-warning (apply 'format args) t) 2266 (vhdl-warning (apply 'format args) t)
2208 (unless vhdl-warnings 2267 (unless vhdl-warnings
2209 (vhdl-run-when-idle .1 nil 'vhdl-print-warnings)) 2268 (vhdl-run-when-idle .1 nil 'vhdl-print-warnings))
2210 (setq vhdl-warnings (cons (apply 'format args) vhdl-warnings)))) 2269 (push (apply 'format args) vhdl-warnings)))
2211 2270
2212(defun vhdl-warning (string &optional nobeep) 2271(defun vhdl-warning (string &optional nobeep)
2213 "Print out warning STRING and beep." 2272 "Print out warning STRING and beep."
@@ -2241,7 +2300,7 @@ Ignore byte-compiler warnings you might see."
2241 (let ((old-alist vhdl-model-alist) 2300 (let ((old-alist vhdl-model-alist)
2242 new-alist) 2301 new-alist)
2243 (while old-alist 2302 (while old-alist
2244 (setq new-alist (cons (append (car old-alist) '("")) new-alist)) 2303 (push (append (car old-alist) '("")) new-alist)
2245 (setq old-alist (cdr old-alist))) 2304 (setq old-alist (cdr old-alist)))
2246 (setq vhdl-model-alist (nreverse new-alist))) 2305 (setq vhdl-model-alist (nreverse new-alist)))
2247 (customize-save-variable 'vhdl-model-alist vhdl-model-alist)) 2306 (customize-save-variable 'vhdl-model-alist vhdl-model-alist))
@@ -2251,7 +2310,7 @@ Ignore byte-compiler warnings you might see."
2251 (let ((old-alist vhdl-project-alist) 2310 (let ((old-alist vhdl-project-alist)
2252 new-alist) 2311 new-alist)
2253 (while old-alist 2312 (while old-alist
2254 (setq new-alist (cons (append (car old-alist) '("")) new-alist)) 2313 (push (append (car old-alist) '("")) new-alist)
2255 (setq old-alist (cdr old-alist))) 2314 (setq old-alist (cdr old-alist)))
2256 (setq vhdl-project-alist (nreverse new-alist))) 2315 (setq vhdl-project-alist (nreverse new-alist)))
2257 (customize-save-variable 'vhdl-project-alist vhdl-project-alist)) 2316 (customize-save-variable 'vhdl-project-alist vhdl-project-alist))
@@ -2339,7 +2398,6 @@ Ignore byte-compiler warnings you might see."
2339 (unless (get 'speedbar-indentation-width 'saved-value) 2398 (unless (get 'speedbar-indentation-width 'saved-value)
2340 (setq speedbar-indentation-width 2))) 2399 (setq speedbar-indentation-width 2)))
2341 2400
2342
2343;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2401;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2344;;; Help functions / inline substitutions / macros 2402;;; Help functions / inline substitutions / macros
2345;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2403;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2487,7 +2545,7 @@ conversion."
2487 2545
2488(defun vhdl-delete (elt list) 2546(defun vhdl-delete (elt list)
2489 "Delete by side effect the first occurrence of ELT as a member of LIST." 2547 "Delete by side effect the first occurrence of ELT as a member of LIST."
2490 (setq list (cons nil list)) 2548 (push nil list)
2491 (let ((list1 list)) 2549 (let ((list1 list))
2492 (while (and (cdr list1) (not (equal elt (cadr list1)))) 2550 (while (and (cdr list1) (not (equal elt (cadr list1))))
2493 (setq list1 (cdr list1))) 2551 (setq list1 (cdr list1)))
@@ -2535,6 +2593,11 @@ conversion."
2535 (set-buffer (marker-buffer marker))) 2593 (set-buffer (marker-buffer marker)))
2536 (goto-char marker)) 2594 (goto-char marker))
2537 2595
2596(defun vhdl-goto-line (line)
2597 "Use this instead of calling user level function `goto-line'."
2598 (goto-char (point-min))
2599 (forward-line (1- line)))
2600
2538(defun vhdl-menu-split (list title) 2601(defun vhdl-menu-split (list title)
2539 "Split menu LIST into several submenus, if number of 2602 "Split menu LIST into several submenus, if number of
2540elements > `vhdl-menu-max-size'." 2603elements > `vhdl-menu-max-size'."
@@ -2545,19 +2608,19 @@ elements > `vhdl-menu-max-size'."
2545 (menuno 1) 2608 (menuno 1)
2546 (i 0)) 2609 (i 0))
2547 (while remain 2610 (while remain
2548 (setq sublist (cons (car remain) sublist)) 2611 (push (car remain) sublist)
2549 (setq remain (cdr remain)) 2612 (setq remain (cdr remain))
2550 (setq i (+ i 1)) 2613 (setq i (+ i 1))
2551 (if (= i vhdl-menu-max-size) 2614 (if (= i vhdl-menu-max-size)
2552 (progn 2615 (progn
2553 (setq result (cons (cons (format "%s %s" title menuno) 2616 (push (cons (format "%s %s" title menuno)
2554 (nreverse sublist)) result)) 2617 (nreverse sublist)) result)
2555 (setq i 0) 2618 (setq i 0)
2556 (setq menuno (+ menuno 1)) 2619 (setq menuno (+ menuno 1))
2557 (setq sublist '())))) 2620 (setq sublist '()))))
2558 (and sublist 2621 (and sublist
2559 (setq result (cons (cons (format "%s %s" title menuno) 2622 (push (cons (format "%s %s" title menuno)
2560 (nreverse sublist)) result))) 2623 (nreverse sublist)) result))
2561 (nreverse result)) 2624 (nreverse result))
2562 list)) 2625 list))
2563 2626
@@ -2792,6 +2855,8 @@ STRING are replaced by `-' and substrings are converted to lower case."
2792 (define-key vhdl-mode-map "\C-c\C-l\C-o" 'vhdl-line-open) 2855 (define-key vhdl-mode-map "\C-c\C-l\C-o" 'vhdl-line-open)
2793 (define-key vhdl-mode-map "\C-c\C-l\C-g" 'goto-line) 2856 (define-key vhdl-mode-map "\C-c\C-l\C-g" 'goto-line)
2794 (define-key vhdl-mode-map "\C-c\C-l\C-c" 'vhdl-comment-uncomment-line) 2857 (define-key vhdl-mode-map "\C-c\C-l\C-c" 'vhdl-comment-uncomment-line)
2858 (define-key vhdl-mode-map "\C-c\C-x\C-s" 'vhdl-fix-statement-region)
2859 (define-key vhdl-mode-map "\C-c\C-x\M-s" 'vhdl-fix-statement-buffer)
2795 (define-key vhdl-mode-map "\C-c\C-x\C-p" 'vhdl-fix-clause) 2860 (define-key vhdl-mode-map "\C-c\C-x\C-p" 'vhdl-fix-clause)
2796 (define-key vhdl-mode-map "\C-c\C-x\M-c" 'vhdl-fix-case-region) 2861 (define-key vhdl-mode-map "\C-c\C-x\M-c" 'vhdl-fix-case-region)
2797 (define-key vhdl-mode-map "\C-c\C-x\C-c" 'vhdl-fix-case-buffer) 2862 (define-key vhdl-mode-map "\C-c\C-x\C-c" 'vhdl-fix-case-buffer)
@@ -3499,6 +3564,9 @@ STRING are replaced by `-' and substrings are converted to lower case."
3499 ["Whitespace Region" vhdl-fixup-whitespace-region (mark)] 3564 ["Whitespace Region" vhdl-fixup-whitespace-region (mark)]
3500 ["Whitespace Buffer" vhdl-fixup-whitespace-buffer t] 3565 ["Whitespace Buffer" vhdl-fixup-whitespace-buffer t]
3501 "--" 3566 "--"
3567 ["Statement Region" vhdl-fix-statement-region (mark)]
3568 ["Statement Buffer" vhdl-fix-statement-buffer t]
3569 "--"
3502 ["Trailing Spaces Buffer" vhdl-remove-trailing-spaces t]) 3570 ["Trailing Spaces Buffer" vhdl-remove-trailing-spaces t])
3503 ("Update" 3571 ("Update"
3504 ["Sensitivity List" vhdl-update-sensitivity-list-process t] 3572 ["Sensitivity List" vhdl-update-sensitivity-list-process t]
@@ -3807,6 +3875,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
3807 ["Always" 3875 ["Always"
3808 (customize-set-variable 'vhdl-include-group-comments 'always) 3876 (customize-set-variable 'vhdl-include-group-comments 'always)
3809 :style radio :selected (eq 'always vhdl-include-group-comments)]) 3877 :style radio :selected (eq 'always vhdl-include-group-comments)])
3878 ["Actual Generic Name..." (customize-option 'vhdl-actual-generic-name) t]
3810 ["Actual Port Name..." (customize-option 'vhdl-actual-port-name) t] 3879 ["Actual Port Name..." (customize-option 'vhdl-actual-port-name) t]
3811 ["Instance Name..." (customize-option 'vhdl-instance-name) t] 3880 ["Instance Name..." (customize-option 'vhdl-instance-name) t]
3812 ("Testbench" 3881 ("Testbench"
@@ -3903,7 +3972,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
3903 ["End Comment Column..." (customize-option 'vhdl-end-comment-column) t] 3972 ["End Comment Column..." (customize-option 'vhdl-end-comment-column) t]
3904 "--" 3973 "--"
3905 ["Customize Group..." (customize-group 'vhdl-comment) t]) 3974 ["Customize Group..." (customize-group 'vhdl-comment) t])
3906 ("Align" 3975 ("Beautify"
3907 ["Auto Align Templates" 3976 ["Auto Align Templates"
3908 (customize-set-variable 'vhdl-auto-align (not vhdl-auto-align)) 3977 (customize-set-variable 'vhdl-auto-align (not vhdl-auto-align))
3909 :style toggle :selected vhdl-auto-align] 3978 :style toggle :selected vhdl-auto-align]
@@ -3911,13 +3980,14 @@ STRING are replaced by `-' and substrings are converted to lower case."
3911 (customize-set-variable 'vhdl-align-groups (not vhdl-align-groups)) 3980 (customize-set-variable 'vhdl-align-groups (not vhdl-align-groups))
3912 :style toggle :selected vhdl-align-groups] 3981 :style toggle :selected vhdl-align-groups]
3913 ["Group Separation String..." 3982 ["Group Separation String..."
3914 (customize-set-variable 'vhdl-align-group-separate) t] 3983 (customize-option 'vhdl-align-group-separate) t]
3915 ["Align Lines with Same Indent" 3984 ["Align Lines with Same Indent"
3916 (customize-set-variable 'vhdl-align-same-indent 3985 (customize-set-variable 'vhdl-align-same-indent
3917 (not vhdl-align-same-indent)) 3986 (not vhdl-align-same-indent))
3918 :style toggle :selected vhdl-align-same-indent] 3987 :style toggle :selected vhdl-align-same-indent]
3988 ["Beautify Options..." (customize-option 'vhdl-beautify-options) t]
3919 "--" 3989 "--"
3920 ["Customize Group..." (customize-group 'vhdl-align) t]) 3990 ["Customize Group..." (customize-group 'vhdl-beautify) t])
3921 ("Highlight" 3991 ("Highlight"
3922 ["Highlighting On/Off..." 3992 ["Highlighting On/Off..."
3923 (customize-option 3993 (customize-option
@@ -4181,14 +4251,13 @@ The directory of the current source file is scanned."
4181 (setq found nil) 4251 (setq found nil)
4182 (while file-list 4252 (while file-list
4183 (setq found t) 4253 (setq found t)
4184 (setq menu-list (cons (vector (car file-list) 4254 (push (vector (car file-list) (list 'find-file (car file-list)) t)
4185 (list 'find-file (car file-list)) t) 4255 menu-list)
4186 menu-list))
4187 (setq file-list (cdr file-list))) 4256 (setq file-list (cdr file-list)))
4188 (setq menu-list (vhdl-menu-split menu-list "Sources")) 4257 (setq menu-list (vhdl-menu-split menu-list "Sources"))
4189 (when found (setq menu-list (cons "--" menu-list))) 4258 (when found (push "--" menu-list))
4190 (setq menu-list (cons ["*Rescan*" vhdl-add-source-files-menu t] menu-list)) 4259 (push ["*Rescan*" vhdl-add-source-files-menu t] menu-list)
4191 (setq menu-list (cons "Sources" menu-list)) 4260 (push "Sources" menu-list)
4192 ;; Create menu 4261 ;; Create menu
4193 (easy-menu-add menu-list) 4262 (easy-menu-add menu-list)
4194 (easy-menu-define vhdl-sources-menu newmap 4263 (easy-menu-define vhdl-sources-menu newmap
@@ -4572,7 +4641,7 @@ Usage:
4572 option `vhdl-index-menu' to non-nil) or made accessible as a mouse menu 4641 option `vhdl-index-menu' to non-nil) or made accessible as a mouse menu
4573 (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to your start-up 4642 (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to your start-up
4574 file) for browsing the file contents (is not populated if buffer is 4643 file) for browsing the file contents (is not populated if buffer is
4575 larger than `font-lock-maximum-size'). Also, a source file menu can be 4644 larger than 256000). Also, a source file menu can be
4576 added (set option `vhdl-source-file-menu' to non-nil) for browsing the 4645 added (set option `vhdl-source-file-menu' to non-nil) for browsing the
4577 current directory for VHDL source files. 4646 current directory for VHDL source files.
4578 4647
@@ -4699,7 +4768,7 @@ Usage:
4699 automatically recognized as VHDL source files. To add an extension 4768 automatically recognized as VHDL source files. To add an extension
4700 \".xxx\", add the following line to your Emacs start-up file (`.emacs'): 4769 \".xxx\", add the following line to your Emacs start-up file (`.emacs'):
4701 4770
4702 \(setq auto-mode-alist (cons '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist)) 4771 \(push '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist)
4703 4772
4704 4773
4705 HINTS: 4774 HINTS:
@@ -7270,7 +7339,7 @@ indentation change."
7270 (beginning-of-line 2) 7339 (beginning-of-line 2)
7271 (setq syntax (vhdl-get-syntactic-context))))) 7340 (setq syntax (vhdl-get-syntactic-context)))))
7272 (when is-comment 7341 (when is-comment
7273 (setq syntax (cons (cons 'comment nil) syntax))) 7342 (push (cons 'comment nil) syntax))
7274 (apply '+ (mapcar 'vhdl-get-offset syntax))) 7343 (apply '+ (mapcar 'vhdl-get-offset syntax)))
7275 ;; indent like previous nonblank line 7344 ;; indent like previous nonblank line
7276 (save-excursion (beginning-of-line) 7345 (save-excursion (beginning-of-line)
@@ -7381,7 +7450,7 @@ ENDPOS is encountered."
7381 7450
7382 7451
7383;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7452;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7384;;; Alignment, whitespace fixup, beautifying 7453;;; Alignment, beautifying
7385;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7454;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7386 7455
7387(defconst vhdl-align-alist 7456(defconst vhdl-align-alist
@@ -7597,7 +7666,8 @@ the token in MATCH."
7597 (when vhdl-progress-interval 7666 (when vhdl-progress-interval
7598 (setq vhdl-progress-info (vector (count-lines (point-min) beg) 7667 (setq vhdl-progress-info (vector (count-lines (point-min) beg)
7599 (count-lines (point-min) end) 0)))) 7668 (count-lines (point-min) end) 0))))
7600 (vhdl-fixup-whitespace-region beg end t) 7669 (when (nth 0 vhdl-beautify-options)
7670 (vhdl-fixup-whitespace-region beg end t))
7601 (goto-char beg) 7671 (goto-char beg)
7602 (if (not vhdl-align-groups) 7672 (if (not vhdl-align-groups)
7603 ;; align entire region 7673 ;; align entire region
@@ -7721,14 +7791,14 @@ the token in MATCH."
7721 ;; search for comment start positions and lengths 7791 ;; search for comment start positions and lengths
7722 (while (< (point) end) 7792 (while (< (point) end)
7723 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) 7793 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
7724 (looking-at "^\\(.*[^ \t\n\r\f-]+\\)\\s-*\\(--.*\\)$") 7794 (looking-at "^\\(.*?[^ \t\n\r\f-]+\\)\\s-*\\(--.*\\)$")
7725 (not (save-excursion (goto-char (match-beginning 2)) 7795 (not (save-excursion (goto-char (match-beginning 2))
7726 (vhdl-in-literal)))) 7796 (vhdl-in-literal))))
7727 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing)) 7797 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing))
7728 (setq length (- (match-end 2) (match-beginning 2))) 7798 (setq length (- (match-end 2) (match-beginning 2)))
7729 (setq start-max (max start start-max)) 7799 (setq start-max (max start start-max))
7730 (setq length-max (max length length-max)) 7800 (setq length-max (max length length-max))
7731 (setq comment-list (cons (cons start length) comment-list))) 7801 (push (cons start length) comment-list))
7732 (beginning-of-line 2)) 7802 (beginning-of-line 2))
7733 (setq comment-list 7803 (setq comment-list
7734 (sort comment-list (function (lambda (a b) (> (car a) (car b)))))) 7804 (sort comment-list (function (lambda (a b) (> (car a) (car b))))))
@@ -7739,14 +7809,14 @@ the token in MATCH."
7739 (unless (or (= (caar comment-list) (car start-list)) 7809 (unless (or (= (caar comment-list) (car start-list))
7740 (<= (+ (car start-list) (cdar comment-list)) 7810 (<= (+ (car start-list) (cdar comment-list))
7741 end-comment-column)) 7811 end-comment-column))
7742 (setq start-list (cons (caar comment-list) start-list))) 7812 (push (caar comment-list) start-list))
7743 (setq comment-list (cdr comment-list))) 7813 (setq comment-list (cdr comment-list)))
7744 ;; align lines as nicely as possible 7814 ;; align lines as nicely as possible
7745 (goto-char beg) 7815 (goto-char beg)
7746 (while (< (point) end) 7816 (while (< (point) end)
7747 (setq cur-start nil) 7817 (setq cur-start nil)
7748 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) 7818 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
7749 (or (and (looking-at "^\\(.*[^ \t\n\r\f-]+\\)\\(\\s-*\\)\\(--.*\\)$") 7819 (or (and (looking-at "^\\(.*?[^ \t\n\r\f-]+\\)\\(\\s-*\\)\\(--.*\\)$")
7750 (not (save-excursion 7820 (not (save-excursion
7751 (goto-char (match-beginning 3)) 7821 (goto-char (match-beginning 3))
7752 (vhdl-in-literal)))) 7822 (vhdl-in-literal))))
@@ -7872,7 +7942,7 @@ end of line, do nothing in comments and strings."
7872 (replace-match "\\2"))) 7942 (replace-match "\\2")))
7873 ;; surround operator symbols by one space 7943 ;; surround operator symbols by one space
7874 (goto-char beg) 7944 (goto-char beg)
7875 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\)\\|\\(\\([^/:<>=]\\)\\(:\\|\\??=\\|\\??<<\\|\\??>>\\|\\??<\\|\\??>\\|:=\\|\\??<=\\|\\??>=\\|=>\\|\\??/=\\|\\?\\?\\)\\([^=>]\\|$\\)\\)" end t) 7945 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\)\\|\\(\\([^/:<>=\n]\\)\\(:\\|\\??=\\|\\??<<\\|\\??>>\\|\\??<\\|\\??>\\|:=\\|\\??<=\\|\\??>=\\|=>\\|\\??/=\\|\\?\\?\\)\\([^=>\n]\\|$\\)\\)" end t)
7876 (if (or (match-string 1) 7946 (if (or (match-string 1)
7877 (<= (match-beginning 0) ; not if at boi 7947 (<= (match-beginning 0) ; not if at boi
7878 (save-excursion (back-to-indentation) (point)))) 7948 (save-excursion (back-to-indentation) (point))))
@@ -7906,6 +7976,154 @@ end of line, do nothing in comments."
7906 (vhdl-fixup-whitespace-region (point-min) (point-max))) 7976 (vhdl-fixup-whitespace-region (point-min) (point-max)))
7907 7977
7908;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7978;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7979;; Case fixing
7980
7981(defun vhdl-fix-case-region-1 (beg end upper-case word-regexp &optional count)
7982 "Convert all words matching WORD-REGEXP in region to lower or upper case,
7983depending on parameter UPPER-CASE."
7984 (let ((case-replace nil)
7985 (last-update 0))
7986 (vhdl-prepare-search-2
7987 (save-excursion
7988 (goto-char end)
7989 (setq end (point-marker))
7990 (goto-char beg)
7991 (while (re-search-forward word-regexp end t)
7992 (or (vhdl-in-literal)
7993 (if upper-case
7994 (upcase-word -1)
7995 (downcase-word -1)))
7996 (when (and count vhdl-progress-interval (not noninteractive)
7997 (< vhdl-progress-interval
7998 (- (nth 1 (current-time)) last-update)))
7999 (message "Fixing case... (%2d%s)"
8000 (+ (* count 20) (/ (* 20 (- (point) beg)) (- end beg)))
8001 "%")
8002 (setq last-update (nth 1 (current-time)))))
8003 (goto-char end)))))
8004
8005(defun vhdl-fix-case-region (beg end &optional arg)
8006 "Convert all VHDL words in region to lower or upper case, depending on
8007options vhdl-upper-case-{keywords,types,attributes,enum-values}."
8008 (interactive "r\nP")
8009 (vhdl-fix-case-region-1
8010 beg end vhdl-upper-case-keywords vhdl-keywords-regexp 0)
8011 (vhdl-fix-case-region-1
8012 beg end vhdl-upper-case-types vhdl-types-regexp 1)
8013 (vhdl-fix-case-region-1
8014 beg end vhdl-upper-case-attributes (concat "'" vhdl-attributes-regexp) 2)
8015 (vhdl-fix-case-region-1
8016 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3)
8017 (vhdl-fix-case-region-1
8018 beg end vhdl-upper-case-constants vhdl-constants-regexp 4)
8019 (when vhdl-progress-interval (message "Fixing case...done")))
8020
8021(defun vhdl-fix-case-buffer ()
8022 "Convert all VHDL words in buffer to lower or upper case, depending on
8023options vhdl-upper-case-{keywords,types,attributes,enum-values}."
8024 (interactive)
8025 (vhdl-fix-case-region (point-min) (point-max)))
8026
8027(defun vhdl-fix-case-word (&optional arg)
8028 "Convert word after cursor to upper case if necessary."
8029 (interactive "p")
8030 (save-excursion
8031 (when arg (backward-word 1))
8032 (vhdl-prepare-search-1
8033 (when (and vhdl-upper-case-keywords
8034 (looking-at vhdl-keywords-regexp))
8035 (upcase-word 1))
8036 (when (and vhdl-upper-case-types
8037 (looking-at vhdl-types-regexp))
8038 (upcase-word 1))
8039 (when (and vhdl-upper-case-attributes
8040 (looking-at vhdl-attributes-regexp))
8041 (upcase-word 1))
8042 (when (and vhdl-upper-case-enum-values
8043 (looking-at vhdl-enum-values-regexp))
8044 (upcase-word 1))
8045 (when (and vhdl-upper-case-constants
8046 (looking-at vhdl-constants-regexp))
8047 (upcase-word 1)))))
8048
8049;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8050;; Fix statements
8051;; - force each statement to be on a separate line except when on same line
8052;; with 'end' keyword
8053
8054(defun vhdl-fix-statement-region (beg end &optional arg)
8055 "Force statements in region on separate line except when on same line
8056with 'end' keyword (necessary for correct indentation).
8057Currently supported keywords: 'begin', 'if'."
8058 (interactive "r\nP")
8059 (vhdl-prepare-search-2
8060 (let (point)
8061 (save-excursion
8062 (goto-char end)
8063 (setq end (point-marker))
8064 (goto-char beg)
8065 ;; `begin' keyword
8066 (while (re-search-forward
8067 "^\\s-*[^ \t\n].*?\\(\\<begin\\>\\)\\(.*\\<end\\>\\)?" end t)
8068 (goto-char (match-end 0))
8069 (setq point (point-marker))
8070 (when (and (match-string 1)
8071 (or (not (match-string 2))
8072 (save-excursion (goto-char (match-end 2))
8073 (vhdl-in-literal)))
8074 (not (save-excursion (goto-char (match-beginning 1))
8075 (vhdl-in-literal))))
8076 (goto-char (match-beginning 1))
8077 (insert "\n")
8078 (indent-according-to-mode))
8079 (goto-char point))
8080 (goto-char beg)
8081 ;; `for', `if' keywords
8082 (while (re-search-forward "\\<\\(for\\|if\\)\\>" end t)
8083 (goto-char (match-end 1))
8084 (setq point (point-marker))
8085 ;; exception: in literal or preceded by `end' or label
8086 (when (and (not (save-excursion (goto-char (match-beginning 1))
8087 (vhdl-in-literal)))
8088 (save-excursion
8089 (beginning-of-line 1)
8090 (save-match-data
8091 (and (re-search-forward "^\\s-*\\([^ \t\n].*\\)"
8092 (match-beginning 1) t)
8093 (not (string-match
8094 "\\(\\<end\\>\\|\\<wait\\>\\|\\w+\\s-*:\\)\\s-*$"
8095 (match-string 1)))))))
8096 (goto-char (match-beginning 1))
8097 (insert "\n")
8098 (indent-according-to-mode))
8099 (goto-char point))))))
8100
8101(defun vhdl-fix-statement-buffer ()
8102 "Force statements in buffer on separate line except when on same line
8103with 'end' keyword (necessary for correct indentation)."
8104 (interactive)
8105 (vhdl-fix-statement-region (point-min) (point-max)))
8106
8107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8108;; Trailing spaces
8109
8110(defun vhdl-remove-trailing-spaces-region (beg end &optional arg)
8111 "Remove trailing spaces in region."
8112 (interactive "r\nP")
8113 (save-excursion
8114 (goto-char end)
8115 (setq end (point-marker))
8116 (goto-char beg)
8117 (while (re-search-forward "[ \t]+$" end t)
8118 (unless (vhdl-in-literal)
8119 (replace-match "" nil nil)))))
8120
8121(defun vhdl-remove-trailing-spaces ()
8122 "Remove trailing spaces in buffer."
8123 (interactive)
8124 (vhdl-remove-trailing-spaces-region (point-min) (point-max)))
8125
8126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7909;; Beautify 8127;; Beautify
7910 8128
7911(defun vhdl-beautify-region (beg end) 8129(defun vhdl-beautify-region (beg end)
@@ -7915,10 +8133,17 @@ case fixing to a region. Calls functions `vhdl-indent-buffer',
7915`vhdl-fix-case-buffer'." 8133`vhdl-fix-case-buffer'."
7916 (interactive "r") 8134 (interactive "r")
7917 (setq end (save-excursion (goto-char end) (point-marker))) 8135 (setq end (save-excursion (goto-char end) (point-marker)))
7918 (vhdl-indent-region beg end) 8136 (save-excursion ; remove DOS EOL characters in UNIX file
8137 (goto-char beg)
8138 (while (search-forward " " nil t)
8139 (replace-match "" nil t)))
8140 (when (nth 0 vhdl-beautify-options) (vhdl-fixup-whitespace-region beg end t))
8141 (when (nth 1 vhdl-beautify-options) (vhdl-fix-statement-region beg end))
8142 (when (nth 2 vhdl-beautify-options) (vhdl-indent-region beg end))
7919 (let ((vhdl-align-groups t)) 8143 (let ((vhdl-align-groups t))
7920 (vhdl-align-region beg end)) 8144 (when (nth 3 vhdl-beautify-options) (vhdl-align-region beg end)))
7921 (vhdl-fix-case-region beg end)) 8145 (when (nth 4 vhdl-beautify-options) (vhdl-fix-case-region beg end))
8146 (when (nth 0 vhdl-beautify-options) (vhdl-remove-trailing-spaces-region beg end)))
7922 8147
7923(defun vhdl-beautify-buffer () 8148(defun vhdl-beautify-buffer ()
7924 "Beautify buffer by applying indentation, whitespace fixup, alignment, and 8149 "Beautify buffer by applying indentation, whitespace fixup, alignment, and
@@ -8014,7 +8239,8 @@ buffer."
8014 (while (re-search-forward "^\\s-*\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?process\\>" nil t) 8239 (while (re-search-forward "^\\s-*\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?process\\>" nil t)
8015 (goto-char (match-beginning 0)) 8240 (goto-char (match-beginning 0))
8016 (condition-case nil (vhdl-update-sensitivity-list) (error ""))) 8241 (condition-case nil (vhdl-update-sensitivity-list) (error "")))
8017 (message "Updating sensitivity lists...done")))) 8242 (message "Updating sensitivity lists...done")))
8243 (when noninteractive (save-buffer)))
8018 8244
8019(defun vhdl-update-sensitivity-list () 8245(defun vhdl-update-sensitivity-list ()
8020 "Update sensitivity list." 8246 "Update sensitivity list."
@@ -8040,57 +8266,57 @@ buffer."
8040 (scan-regions-list 8266 (scan-regions-list
8041 '(;; right-hand side of signal/variable assignment 8267 '(;; right-hand side of signal/variable assignment
8042 ;; (special case: "<=" is relational operator in a condition) 8268 ;; (special case: "<=" is relational operator in a condition)
8043 ((re-search-forward "[<:]=" proc-end t) 8269 ((vhdl-re-search-forward "[<:]=" proc-end t)
8044 (re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t)) 8270 (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t))
8045 ;; if condition 8271 ;; if condition
8046 ((re-search-forward "^\\s-*if\\>" proc-end t) 8272 ((vhdl-re-search-forward "^\\s-*if\\>" proc-end t)
8047 (re-search-forward "\\<then\\>" proc-end t)) 8273 (vhdl-re-search-forward "\\<then\\>" proc-end t))
8048 ;; elsif condition 8274 ;; elsif condition
8049 ((re-search-forward "\\<elsif\\>" proc-end t) 8275 ((vhdl-re-search-forward "\\<elsif\\>" proc-end t)
8050 (re-search-forward "\\<then\\>" proc-end t)) 8276 (vhdl-re-search-forward "\\<then\\>" proc-end t))
8051 ;; while loop condition 8277 ;; while loop condition
8052 ((re-search-forward "^\\s-*while\\>" proc-end t) 8278 ((vhdl-re-search-forward "^\\s-*while\\>" proc-end t)
8053 (re-search-forward "\\<loop\\>" proc-end t)) 8279 (vhdl-re-search-forward "\\<loop\\>" proc-end t))
8054 ;; exit/next condition 8280 ;; exit/next condition
8055 ((re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t) 8281 ((vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t)
8056 (re-search-forward ";" proc-end t)) 8282 (vhdl-re-search-forward ";" proc-end t))
8057 ;; assert condition 8283 ;; assert condition
8058 ((re-search-forward "\\<assert\\>" proc-end t) 8284 ((vhdl-re-search-forward "\\<assert\\>" proc-end t)
8059 (re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t)) 8285 (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t))
8060 ;; case expression 8286 ;; case expression
8061 ((re-search-forward "^\\s-*case\\>" proc-end t) 8287 ((vhdl-re-search-forward "^\\s-*case\\>" proc-end t)
8062 (re-search-forward "\\<is\\>" proc-end t)) 8288 (vhdl-re-search-forward "\\<is\\>" proc-end t))
8063 ;; parameter list of procedure call, array index 8289 ;; parameter list of procedure call, array index
8064 ((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t) 8290 ((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t)
8065 (1- (point))) 8291 (1- (point)))
8066 (progn (backward-char) (forward-sexp) 8292 (progn (backward-char) (forward-sexp)
8067 (while (looking-at "(") (forward-sexp)) (point))))) 8293 (while (looking-at "(") (forward-sexp)) (point)))))
8068 name field read-list sens-list signal-list 8294 name field read-list sens-list signal-list tmp-list
8069 sens-beg sens-end beg end margin) 8295 sens-beg sens-end beg end margin)
8070 ;; scan for signals in old sensitivity list 8296 ;; scan for signals in old sensitivity list
8071 (goto-char proc-beg) 8297 (goto-char proc-beg)
8072 (re-search-forward "\\<process\\>" proc-mid t) 8298 (vhdl-re-search-forward "\\<process\\>" proc-mid t)
8073 (if (not (looking-at "[ \t\n\r\f]*(")) 8299 (if (not (looking-at "[ \t\n\r\f]*("))
8074 (setq sens-beg (point)) 8300 (setq sens-beg (point))
8075 (setq sens-beg (re-search-forward "\\([ \t\n\r\f]*\\)([ \t\n\r\f]*" nil t)) 8301 (setq sens-beg (vhdl-re-search-forward "\\([ \t\n\r\f]*\\)([ \t\n\r\f]*" nil t))
8076 (goto-char (match-end 1)) 8302 (goto-char (match-end 1))
8077 (forward-sexp) 8303 (forward-sexp)
8078 (setq sens-end (1- (point))) 8304 (setq sens-end (1- (point)))
8079 (goto-char sens-beg) 8305 (goto-char sens-beg)
8080 (while (and (re-search-forward "\\(\\w+\\)" sens-end t) 8306 (while (and (vhdl-re-search-forward "\\(\\w+\\)" sens-end t)
8081 (setq sens-list 8307 (setq sens-list
8082 (cons (downcase (match-string 0)) sens-list)) 8308 (cons (downcase (match-string 0)) sens-list))
8083 (re-search-forward "\\s-*,\\s-*" sens-end t)))) 8309 (vhdl-re-search-forward "\\s-*,\\s-*" sens-end t))))
8084 (setq signal-list (append visible-list sens-list)) 8310 (setq signal-list (append visible-list sens-list))
8085 ;; search for sequential parts 8311 ;; search for sequential parts
8086 (goto-char proc-mid) 8312 (goto-char proc-mid)
8087 (while (setq beg (re-search-forward "^\\s-*\\(els\\)?if\\>" proc-end t)) 8313 (while (setq beg (re-search-forward "^\\s-*\\(els\\)?if\\>" proc-end t))
8088 (setq end (re-search-forward "\\<then\\>" proc-end t)) 8314 (setq end (vhdl-re-search-forward "\\<then\\>" proc-end t))
8089 (when (re-search-backward "\\('event\\|\\<\\(falling\\|rising\\)_edge\\)\\>" beg t) 8315 (when (vhdl-re-search-backward "\\('event\\|\\<\\(falling\\|rising\\)_edge\\)\\>" beg t)
8090 (goto-char end) 8316 (goto-char end)
8091 (backward-word 1) 8317 (backward-word 1)
8092 (vhdl-forward-sexp) 8318 (vhdl-forward-sexp)
8093 (setq seq-region-list (cons (cons end (point)) seq-region-list)) 8319 (push (cons end (point)) seq-region-list)
8094 (beginning-of-line))) 8320 (beginning-of-line)))
8095 ;; scan for signals read in process 8321 ;; scan for signals read in process
8096 (while scan-regions-list 8322 (while scan-regions-list
@@ -8107,15 +8333,35 @@ buffer."
8107 (and tmp-list (< (point) (cdar tmp-list)))))) 8333 (and tmp-list (< (point) (cdar tmp-list))))))
8108 (while (vhdl-re-search-forward "[^'\".]\\<\\([a-zA-Z]\\w*\\)\\(\\(\\.\\w+\\|[ \t\n\r\f]*([^)]*)\\)*\\)[ \t\n\r\f]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t) 8334 (while (vhdl-re-search-forward "[^'\".]\\<\\([a-zA-Z]\\w*\\)\\(\\(\\.\\w+\\|[ \t\n\r\f]*([^)]*)\\)*\\)[ \t\n\r\f]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t)
8109 (setq name (match-string 1)) 8335 (setq name (match-string 1))
8336 ;; get array index range
8110 (when vhdl-array-index-record-field-in-sensitivity-list 8337 (when vhdl-array-index-record-field-in-sensitivity-list
8111 (setq field (match-string 2))) 8338 (setq field (match-string 2))
8339 ;; not use if it includes a variable name
8340 (save-match-data
8341 (setq tmp-list visible-list)
8342 (while (and field tmp-list)
8343 (when (string-match
8344 (concat "\\<" (car tmp-list) "\\>") field)
8345 (setq field nil))
8346 (setq tmp-list (cdr tmp-list)))))
8112 (when (and (not (match-string 6)) ; not when formal parameter 8347 (when (and (not (match-string 6)) ; not when formal parameter
8113 (not (and (match-string 5) ; not event attribute 8348 (not (and (match-string 5) ; not event attribute
8114 (not (member (downcase (match-string 5)) 8349 (not (member (downcase (match-string 5))
8115 '("event" "last_event" "transaction"))))) 8350 '("event" "last_event" "transaction")))))
8116 (member (downcase name) signal-list)) 8351 (member (downcase name) signal-list))
8117 (unless (member-ignore-case (concat name field) read-list) 8352 ;; not add if name or name+field already exists
8118 (setq read-list (cons (concat name field) read-list)))) 8353 (unless
8354 (or (member-ignore-case name read-list)
8355 (member-ignore-case (concat name field) read-list))
8356 (push (concat name field) read-list))
8357 (setq tmp-list read-list)
8358 ;; remove existing name+field if name is added
8359 (save-match-data
8360 (while tmp-list
8361 (when (string-match (concat "^" name field "[(.]")
8362 (car tmp-list))
8363 (setq read-list (delete (car tmp-list) read-list)))
8364 (setq tmp-list (cdr tmp-list)))))
8119 (goto-char (match-end 1))))) 8365 (goto-char (match-end 1)))))
8120 (setq scan-regions-list (cdr scan-regions-list))) 8366 (setq scan-regions-list (cdr scan-regions-list)))
8121 ;; update sensitivity list 8367 ;; update sensitivity list
@@ -8171,7 +8417,7 @@ buffer."
8171 (while (< (point) end) 8417 (while (< (point) end)
8172 (when (looking-at "signal[ \t\n\r\f]+") 8418 (when (looking-at "signal[ \t\n\r\f]+")
8173 (goto-char (match-end 0))) 8419 (goto-char (match-end 0)))
8174 (while (looking-at "\\(\\w+\\)[ \t\n\r\f,]+") 8420 (while (looking-at "\\([a-zA-Z]\\w*\\)[ \t\n\r\f,]+")
8175 (setq signal-list 8421 (setq signal-list
8176 (cons (downcase (match-string 1)) signal-list)) 8422 (cons (downcase (match-string 1)) signal-list))
8177 (goto-char (match-end 0)) 8423 (goto-char (match-end 0))
@@ -8190,12 +8436,12 @@ buffer."
8190 (when (= 0 (nth 0 (parse-partial-sexp beg (point)))) 8436 (when (= 0 (nth 0 (parse-partial-sexp beg (point))))
8191 (if (match-string 2) 8437 (if (match-string 2)
8192 ;; scan signal name 8438 ;; scan signal name
8193 (while (looking-at "[ \t\n\r\f,]+\\(\\w+\\)") 8439 (while (looking-at "[ \t\n\r\f,]+\\([a-zA-Z]\\w*\\)")
8194 (setq signal-list 8440 (setq signal-list
8195 (cons (downcase (match-string 1)) signal-list)) 8441 (cons (downcase (match-string 1)) signal-list))
8196 (goto-char (match-end 0))) 8442 (goto-char (match-end 0)))
8197 ;; scan alias name, check is alias of (declared) signal 8443 ;; scan alias name, check is alias of (declared) signal
8198 (when (and (looking-at "[ \t\n\r\f]+\\(\\w+\\)[^;]*\\<is[ \t\n\r\f]+\\(\\w+\\)") 8444 (when (and (looking-at "[ \t\n\r\f]+\\([a-zA-Z]\\w*\\)[^;]*\\<is[ \t\n\r\f]+\\([a-zA-Z]\\w*\\)")
8199 (member (downcase (match-string 2)) signal-list)) 8445 (member (downcase (match-string 2)) signal-list))
8200 (setq signal-list 8446 (setq signal-list
8201 (cons (downcase (match-string 1)) signal-list)) 8447 (cons (downcase (match-string 1)) signal-list))
@@ -8283,19 +8529,6 @@ buffer."
8283 (goto-char end) 8529 (goto-char end)
8284 (insert ")"))))))) 8530 (insert ")")))))))
8285 8531
8286;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8287;; Miscellaneous
8288
8289(defun vhdl-remove-trailing-spaces ()
8290 "Remove trailing spaces in the whole buffer."
8291 (interactive)
8292 (save-match-data
8293 (save-excursion
8294 (goto-char (point-min))
8295 (while (re-search-forward "[ \t]+$" (point-max) t)
8296 (unless (vhdl-in-literal)
8297 (replace-match "" nil nil))))))
8298
8299 8532
8300;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 8533;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8301;;; Electrification 8534;;; Electrification
@@ -8327,14 +8560,14 @@ project is defined."
8327With a prefix argument ARG, enable the mode if ARG is positive, 8560With a prefix argument ARG, enable the mode if ARG is positive,
8328and disable it otherwise. If called from Lisp, enable it if ARG 8561and disable it otherwise. If called from Lisp, enable it if ARG
8329is omitted or nil." 8562is omitted or nil."
8330 :global t) 8563 :global t :group 'vhdl-mode)
8331 8564
8332(define-minor-mode vhdl-stutter-mode 8565(define-minor-mode vhdl-stutter-mode
8333 "Toggle VHDL stuttering mode. 8566 "Toggle VHDL stuttering mode.
8334With a prefix argument ARG, enable the mode if ARG is positive, 8567With a prefix argument ARG, enable the mode if ARG is positive,
8335and disable it otherwise. If called from Lisp, enable it if ARG 8568and disable it otherwise. If called from Lisp, enable it if ARG
8336is omitted or nil." 8569is omitted or nil."
8337 :global t) 8570 :global t :group 'vhdl-mode)
8338 8571
8339;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 8572;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8340;; Stuttering 8573;; Stuttering
@@ -8391,7 +8624,7 @@ is omitted or nil."
8391(defun vhdl-electric-quote (count) "'' --> \"" 8624(defun vhdl-electric-quote (count) "'' --> \""
8392 (interactive "p") 8625 (interactive "p")
8393 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8626 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8394 (if (= (preceding-char) last-input-event) 8627 (if (= (preceding-char) vhdl-last-input-event)
8395 (progn (delete-char -1) (insert-char ?\" 1)) 8628 (progn (delete-char -1) (insert-char ?\" 1))
8396 (insert-char ?\' 1)) 8629 (insert-char ?\' 1))
8397 (self-insert-command count))) 8630 (self-insert-command count)))
@@ -8399,7 +8632,7 @@ is omitted or nil."
8399(defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '" 8632(defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '"
8400 (interactive "p") 8633 (interactive "p")
8401 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8634 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8402 (cond ((= (preceding-char) last-input-event) 8635 (cond ((= (preceding-char) vhdl-last-input-event)
8403 (progn (delete-char -1) 8636 (progn (delete-char -1)
8404 (unless (eq (preceding-char) ? ) (insert " ")) 8637 (unless (eq (preceding-char) ? ) (insert " "))
8405 (insert ": ") 8638 (insert ": ")
@@ -8413,7 +8646,7 @@ is omitted or nil."
8413(defun vhdl-electric-comma (count) "',,' --> ' <= '" 8646(defun vhdl-electric-comma (count) "',,' --> ' <= '"
8414 (interactive "p") 8647 (interactive "p")
8415 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8648 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8416 (cond ((= (preceding-char) last-input-event) 8649 (cond ((= (preceding-char) vhdl-last-input-event)
8417 (progn (delete-char -1) 8650 (progn (delete-char -1)
8418 (unless (eq (preceding-char) ? ) (insert " ")) 8651 (unless (eq (preceding-char) ? ) (insert " "))
8419 (insert "<= "))) 8652 (insert "<= ")))
@@ -8423,7 +8656,7 @@ is omitted or nil."
8423(defun vhdl-electric-period (count) "'..' --> ' => '" 8656(defun vhdl-electric-period (count) "'..' --> ' => '"
8424 (interactive "p") 8657 (interactive "p")
8425 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8658 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8426 (cond ((= (preceding-char) last-input-event) 8659 (cond ((= (preceding-char) vhdl-last-input-event)
8427 (progn (delete-char -1) 8660 (progn (delete-char -1)
8428 (unless (eq (preceding-char) ? ) (insert " ")) 8661 (unless (eq (preceding-char) ? ) (insert " "))
8429 (insert "=> "))) 8662 (insert "=> ")))
@@ -8433,7 +8666,7 @@ is omitted or nil."
8433(defun vhdl-electric-equal (count) "'==' --> ' == '" 8666(defun vhdl-electric-equal (count) "'==' --> ' == '"
8434 (interactive "p") 8667 (interactive "p")
8435 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8668 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8436 (cond ((= (preceding-char) last-input-event) 8669 (cond ((= (preceding-char) vhdl-last-input-event)
8437 (progn (delete-char -1) 8670 (progn (delete-char -1)
8438 (unless (eq (preceding-char) ? ) (insert " ")) 8671 (unless (eq (preceding-char) ? ) (insert " "))
8439 (insert "== "))) 8672 (insert "== ")))
@@ -8704,12 +8937,13 @@ since these are almost equivalent)."
8704 "[COMPONENT | ENTITY | CONFIGURATION]" " " t)) 8937 "[COMPONENT | ENTITY | CONFIGURATION]" " " t))
8705 (setq unit (upcase (or unit ""))) 8938 (setq unit (upcase (or unit "")))
8706 (cond ((equal unit "ENTITY") 8939 (cond ((equal unit "ENTITY")
8707 (vhdl-template-field "library name" "." nil nil nil nil 8940 (let ((begin (point)))
8941 (vhdl-template-field "library name" "." t begin (point) nil
8708 (vhdl-work-library)) 8942 (vhdl-work-library))
8709 (vhdl-template-field "entity name" "(") 8943 (vhdl-template-field "entity name" "(")
8710 (if (vhdl-template-field "[architecture name]" nil t) 8944 (if (vhdl-template-field "[architecture name]" nil t)
8711 (insert ")") 8945 (insert ")")
8712 (delete-char -1))) 8946 (delete-char -1))))
8713 ((equal unit "CONFIGURATION") 8947 ((equal unit "CONFIGURATION")
8714 (vhdl-template-field "library name" "." nil nil nil nil 8948 (vhdl-template-field "library name" "." nil nil nil nil
8715 (vhdl-work-library)) 8949 (vhdl-work-library))
@@ -9845,7 +10079,7 @@ otherwise."
9845 (let ((definition 10079 (let ((definition
9846 (upcase 10080 (upcase
9847 (or (vhdl-template-field 10081 (or (vhdl-template-field
9848 "[scalar type | ARRAY | RECORD | ACCESS | FILE]" nil t) 10082 "[scalar type | ARRAY | RECORD | ACCESS | FILE | ENUM]" nil t)
9849 "")))) 10083 ""))))
9850 (cond ((equal definition "") 10084 (cond ((equal definition "")
9851 (delete-char -4) 10085 (delete-char -4)
@@ -9863,6 +10097,11 @@ otherwise."
9863 ((equal definition "FILE") 10097 ((equal definition "FILE")
9864 (vhdl-insert-keyword " OF ") 10098 (vhdl-insert-keyword " OF ")
9865 (vhdl-template-field "type" ";")) 10099 (vhdl-template-field "type" ";"))
10100 ((equal definition "ENUM")
10101 (kill-word -1)
10102 (insert "(")
10103 (setq end-pos (point-marker))
10104 (insert ");"))
9866 (t (insert ";"))) 10105 (t (insert ";")))
9867 (when mid-pos 10106 (when mid-pos
9868 (setq end-pos (point-marker)) 10107 (setq end-pos (point-marker))
@@ -10909,7 +11148,7 @@ but not if inside a comment or quote."
10909 (backward-word 1) 11148 (backward-word 1)
10910 (vhdl-case-word 1) 11149 (vhdl-case-word 1)
10911 (delete-char 1)) 11150 (delete-char 1))
10912 (let ((invoke-char last-command-event) 11151 (let ((invoke-char vhdl-last-input-event)
10913 (abbrev-mode -1) 11152 (abbrev-mode -1)
10914 (vhdl-template-invoked-by-hook t)) 11153 (vhdl-template-invoked-by-hook t))
10915 (let ((caught (catch 'abort 11154 (let ((caught (catch 'abort
@@ -11633,7 +11872,8 @@ reflected in a subsequent paste operation."
11633 ;; paste formal and actual generic 11872 ;; paste formal and actual generic
11634 (insert (car (nth 0 generic)) " => " 11873 (insert (car (nth 0 generic)) " => "
11635 (if no-constants 11874 (if no-constants
11636 (car (nth 0 generic)) 11875 (vhdl-replace-string vhdl-actual-generic-name
11876 (car (nth 0 generic)))
11637 (or (nth 2 generic) ""))) 11877 (or (nth 2 generic) "")))
11638 (setq generic-list (cdr generic-list)) 11878 (setq generic-list (cdr generic-list))
11639 (insert (if generic-list "," ")")) 11879 (insert (if generic-list "," ")"))
@@ -11776,7 +12016,7 @@ reflected in a subsequent paste operation."
11776 ;; paste generic constants 12016 ;; paste generic constants
11777 (setq name (nth 0 generic)) 12017 (setq name (nth 0 generic))
11778 (when name 12018 (when name
11779 (insert (car name)) 12019 (insert (vhdl-replace-string vhdl-actual-generic-name (car name)))
11780 ;; paste type 12020 ;; paste type
11781 (insert " : " (nth 1 generic)) 12021 (insert " : " (nth 1 generic))
11782 ;; paste initialization 12022 ;; paste initialization
@@ -11802,7 +12042,7 @@ reflected in a subsequent paste operation."
11802 (message "Pasting port as signals...") 12042 (message "Pasting port as signals...")
11803 (unless no-indent (indent-according-to-mode)) 12043 (unless no-indent (indent-according-to-mode))
11804 (let ((margin (current-indentation)) 12044 (let ((margin (current-indentation))
11805 start port names 12045 start port names type generic-list port-name constant-name pos
11806 (port-list (nth 2 vhdl-port-list))) 12046 (port-list (nth 2 vhdl-port-list)))
11807 (when port-list 12047 (when port-list
11808 (setq start (point)) 12048 (setq start (point))
@@ -11822,7 +12062,21 @@ reflected in a subsequent paste operation."
11822 (setq names (cdr names)) 12062 (setq names (cdr names))
11823 (when names (insert ", "))) 12063 (when names (insert ", ")))
11824 ;; paste type 12064 ;; paste type
11825 (insert " : " (nth 3 port)) 12065 (setq type (nth 3 port))
12066 (setq generic-list (nth 1 vhdl-port-list))
12067 (vhdl-prepare-search-1
12068 (setq pos 0)
12069 ;; replace formal by actual generics
12070 (while generic-list
12071 (setq port-name (car (nth 0 (car generic-list))))
12072 (while (string-match (concat "\\<" port-name "\\>") type pos)
12073 (setq constant-name
12074 (save-match-data (vhdl-replace-string
12075 vhdl-actual-generic-name port-name)))
12076 (setq type (replace-match constant-name t nil type))
12077 (setq pos (match-end 0)))
12078 (setq generic-list (cdr generic-list))))
12079 (insert " : " type)
11826 ;; paste initialization (inputs only) 12080 ;; paste initialization (inputs only)
11827 (when (and initialize (nth 2 port) (equal "IN" (upcase (nth 2 port)))) 12081 (when (and initialize (nth 2 port) (equal "IN" (upcase (nth 2 port))))
11828 (insert " := " 12082 (insert " := "
@@ -12411,77 +12665,6 @@ expressions (e.g. for index ranges of types and signals)."
12411 try-expand-list-all-buffers))) 12665 try-expand-list-all-buffers)))
12412 12666
12413;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12667;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12414;; Case fixing
12415
12416(defun vhdl-fix-case-region-1 (beg end upper-case word-regexp &optional count)
12417 "Convert all words matching WORD-REGEXP in region to lower or upper case,
12418depending on parameter UPPER-CASE."
12419 (let ((case-replace nil)
12420 (last-update 0))
12421 (vhdl-prepare-search-2
12422 (save-excursion
12423 (goto-char end)
12424 (setq end (point-marker))
12425 (goto-char beg)
12426 (while (re-search-forward word-regexp end t)
12427 (or (vhdl-in-literal)
12428 (if upper-case
12429 (upcase-word -1)
12430 (downcase-word -1)))
12431 (when (and count vhdl-progress-interval (not noninteractive)
12432 (< vhdl-progress-interval
12433 (- (nth 1 (current-time)) last-update)))
12434 (message "Fixing case... (%2d%s)"
12435 (+ (* count 20) (/ (* 20 (- (point) beg)) (- end beg)))
12436 "%")
12437 (setq last-update (nth 1 (current-time)))))
12438 (goto-char end)))))
12439
12440(defun vhdl-fix-case-region (beg end &optional arg)
12441 "Convert all VHDL words in region to lower or upper case, depending on
12442options vhdl-upper-case-{keywords,types,attributes,enum-values}."
12443 (interactive "r\nP")
12444 (vhdl-fix-case-region-1
12445 beg end vhdl-upper-case-keywords vhdl-keywords-regexp 0)
12446 (vhdl-fix-case-region-1
12447 beg end vhdl-upper-case-types vhdl-types-regexp 1)
12448 (vhdl-fix-case-region-1
12449 beg end vhdl-upper-case-attributes (concat "'" vhdl-attributes-regexp) 2)
12450 (vhdl-fix-case-region-1
12451 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3)
12452 (vhdl-fix-case-region-1
12453 beg end vhdl-upper-case-constants vhdl-constants-regexp 4)
12454 (when vhdl-progress-interval (message "Fixing case...done")))
12455
12456(defun vhdl-fix-case-buffer ()
12457 "Convert all VHDL words in buffer to lower or upper case, depending on
12458options vhdl-upper-case-{keywords,types,attributes,enum-values}."
12459 (interactive)
12460 (vhdl-fix-case-region (point-min) (point-max)))
12461
12462(defun vhdl-fix-case-word (&optional arg)
12463 "Convert word after cursor to upper case if necessary."
12464 (interactive "p")
12465 (save-excursion
12466 (when arg (backward-word 1))
12467 (vhdl-prepare-search-1
12468 (when (and vhdl-upper-case-keywords
12469 (looking-at vhdl-keywords-regexp))
12470 (upcase-word 1))
12471 (when (and vhdl-upper-case-types
12472 (looking-at vhdl-types-regexp))
12473 (upcase-word 1))
12474 (when (and vhdl-upper-case-attributes
12475 (looking-at vhdl-attributes-regexp))
12476 (upcase-word 1))
12477 (when (and vhdl-upper-case-enum-values
12478 (looking-at vhdl-enum-values-regexp))
12479 (upcase-word 1))
12480 (when (and vhdl-upper-case-constants
12481 (looking-at vhdl-constants-regexp))
12482 (upcase-word 1)))))
12483
12484;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12485;; Line handling functions 12668;; Line handling functions
12486 12669
12487(defun vhdl-current-line () 12670(defun vhdl-current-line ()
@@ -12635,7 +12818,7 @@ it works within comments too."
12635 ;; print results 12818 ;; print results
12636 (message "\n\ 12819 (message "\n\
12637File statistics: \"%s\"\n\ 12820File statistics: \"%s\"\n\
12638---------------------\n\ 12821-----------------------\n\
12639# statements : %5d\n\ 12822# statements : %5d\n\
12640# code lines : %5d\n\ 12823# code lines : %5d\n\
12641# empty lines : %5d\n\ 12824# empty lines : %5d\n\
@@ -13486,9 +13669,9 @@ hierarchy otherwise.")
13486 (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t) 13669 (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t)
13487 (equal "USE" (upcase (match-string 1)))) 13670 (equal "USE" (upcase (match-string 1))))
13488 (when (looking-at "^[ \t]*use[ \t\n\r\f]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+") 13671 (when (looking-at "^[ \t]*use[ \t\n\r\f]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+")
13489 (setq lib-alist (cons (cons (match-string-no-properties 1) 13672 (push (cons (match-string-no-properties 1)
13490 (vhdl-match-string-downcase 2)) 13673 (vhdl-match-string-downcase 2))
13491 lib-alist)))))) 13674 lib-alist)))))
13492 lib-alist)) 13675 lib-alist))
13493 13676
13494(defun vhdl-scan-directory-contents (name &optional project update num-string 13677(defun vhdl-scan-directory-contents (name &optional project update num-string
@@ -13534,7 +13717,7 @@ hierarchy otherwise.")
13534 file-tmp-list) 13717 file-tmp-list)
13535 (while file-list 13718 (while file-list
13536 (unless (string-match file-exclude-regexp (car file-list)) 13719 (unless (string-match file-exclude-regexp (car file-list))
13537 (setq file-tmp-list (cons (car file-list) file-tmp-list))) 13720 (push (car file-list) file-tmp-list))
13538 (setq file-list (cdr file-list))) 13721 (setq file-list (cdr file-list)))
13539 (setq file-list (nreverse file-tmp-list)))) 13722 (setq file-list (nreverse file-tmp-list))))
13540 ;; do for all files 13723 ;; do for all files
@@ -13569,7 +13752,7 @@ hierarchy otherwise.")
13569 "Entity declared twice (used 1.): \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)" 13752 "Entity declared twice (used 1.): \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
13570 ent-name (nth 1 ent-entry) (nth 2 ent-entry) 13753 ent-name (nth 1 ent-entry) (nth 2 ent-entry)
13571 file-name (vhdl-current-line)) 13754 file-name (vhdl-current-line))
13572 (setq ent-list (cons ent-key ent-list)) 13755 (push ent-key ent-list)
13573 (aput 'ent-alist ent-key 13756 (aput 'ent-alist ent-key
13574 (list ent-name file-name (vhdl-current-line) 13757 (list ent-name file-name (vhdl-current-line)
13575 (nth 3 ent-entry) (nth 4 ent-entry) 13758 (nth 3 ent-entry) (nth 4 ent-entry)
@@ -13621,7 +13804,7 @@ hierarchy otherwise.")
13621 "Configuration declared twice (used 1.): \"%s\" of \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)" 13804 "Configuration declared twice (used 1.): \"%s\" of \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
13622 conf-name ent-name (nth 1 conf-entry) 13805 conf-name ent-name (nth 1 conf-entry)
13623 (nth 2 conf-entry) file-name conf-line) 13806 (nth 2 conf-entry) file-name conf-line)
13624 (setq conf-list (cons conf-key conf-list)) 13807 (push conf-key conf-list)
13625 ;; scan for subconfigurations and subentities 13808 ;; scan for subconfigurations and subentities
13626 (while (re-search-forward "^[ \t]*for[ \t\n\r\f]+\\(\\w+\\([ \t\n\r\f]*,[ \t\n\r\f]*\\w+\\)*\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\(\\w+\\)[ \t\n\r\f]+" end-of-unit t) 13809 (while (re-search-forward "^[ \t]*for[ \t\n\r\f]+\\(\\w+\\([ \t\n\r\f]*,[ \t\n\r\f]*\\w+\\)*\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\(\\w+\\)[ \t\n\r\f]+" end-of-unit t)
13627 (setq inst-comp-key (vhdl-match-string-downcase 3) 13810 (setq inst-comp-key (vhdl-match-string-downcase 3)
@@ -13684,8 +13867,8 @@ hierarchy otherwise.")
13684 (setq func-alist (nreverse func-alist)) 13867 (setq func-alist (nreverse func-alist))
13685 (setq comp-alist (nreverse comp-alist)) 13868 (setq comp-alist (nreverse comp-alist))
13686 (if is-body 13869 (if is-body
13687 (setq pack-body-list (cons pack-key pack-body-list)) 13870 (push pack-key pack-body-list)
13688 (setq pack-list (cons pack-key pack-list))) 13871 (push pack-key pack-list))
13689 (aput 13872 (aput
13690 'pack-alist pack-key 13873 'pack-alist pack-key
13691 (if is-body 13874 (if is-body
@@ -13939,7 +14122,7 @@ of PROJECT."
13939 (let ((case-fold-search nil)) 14122 (let ((case-fold-search nil))
13940 (while dir-list 14123 (while dir-list
13941 (unless (string-match file-exclude-regexp (car dir-list)) 14124 (unless (string-match file-exclude-regexp (car dir-list))
13942 (setq dir-list-tmp (cons (car dir-list) dir-list-tmp))) 14125 (push (car dir-list) dir-list-tmp))
13943 (setq dir-list (cdr dir-list))) 14126 (setq dir-list (cdr dir-list)))
13944 (setq dir-list (nreverse dir-list-tmp)))) 14127 (setq dir-list (nreverse dir-list-tmp))))
13945 (message "Collecting source files...done") 14128 (message "Collecting source files...done")
@@ -14331,7 +14514,7 @@ if required."
14331;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14514;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14332;; Add hierarchy browser functionality to speedbar 14515;; Add hierarchy browser functionality to speedbar
14333 14516
14334(defvar vhdl-speedbar-key-map nil 14517(defvar vhdl-speedbar-mode-map nil
14335 "Keymap used when in the VHDL hierarchy browser mode.") 14518 "Keymap used when in the VHDL hierarchy browser mode.")
14336 14519
14337(defvar vhdl-speedbar-menu-items nil 14520(defvar vhdl-speedbar-menu-items nil
@@ -14359,24 +14542,24 @@ if required."
14359 (speedbar-item-info . vhdl-speedbar-item-info) 14542 (speedbar-item-info . vhdl-speedbar-item-info)
14360 (speedbar-line-directory . vhdl-speedbar-line-project))) 14543 (speedbar-line-directory . vhdl-speedbar-line-project)))
14361 ;; keymap 14544 ;; keymap
14362 (unless vhdl-speedbar-key-map 14545 (unless vhdl-speedbar-mode-map
14363 (setq vhdl-speedbar-key-map (speedbar-make-specialized-keymap)) 14546 (setq vhdl-speedbar-mode-map (speedbar-make-specialized-keymap))
14364 (define-key vhdl-speedbar-key-map "e" 'speedbar-edit-line) 14547 (define-key vhdl-speedbar-mode-map "e" 'speedbar-edit-line)
14365 (define-key vhdl-speedbar-key-map "\C-m" 'speedbar-edit-line) 14548 (define-key vhdl-speedbar-mode-map "\C-m" 'speedbar-edit-line)
14366 (define-key vhdl-speedbar-key-map "+" 'speedbar-expand-line) 14549 (define-key vhdl-speedbar-mode-map "+" 'speedbar-expand-line)
14367 (define-key vhdl-speedbar-key-map "=" 'speedbar-expand-line) 14550 (define-key vhdl-speedbar-mode-map "=" 'speedbar-expand-line)
14368 (define-key vhdl-speedbar-key-map "-" 'vhdl-speedbar-contract-level) 14551 (define-key vhdl-speedbar-mode-map "-" 'vhdl-speedbar-contract-level)
14369 (define-key vhdl-speedbar-key-map "_" 'vhdl-speedbar-contract-all) 14552 (define-key vhdl-speedbar-mode-map "_" 'vhdl-speedbar-contract-all)
14370 (define-key vhdl-speedbar-key-map "C" 'vhdl-speedbar-port-copy) 14553 (define-key vhdl-speedbar-mode-map "C" 'vhdl-speedbar-port-copy)
14371 (define-key vhdl-speedbar-key-map "P" 'vhdl-speedbar-place-component) 14554 (define-key vhdl-speedbar-mode-map "P" 'vhdl-speedbar-place-component)
14372 (define-key vhdl-speedbar-key-map "F" 'vhdl-speedbar-configuration) 14555 (define-key vhdl-speedbar-mode-map "F" 'vhdl-speedbar-configuration)
14373 (define-key vhdl-speedbar-key-map "A" 'vhdl-speedbar-select-mra) 14556 (define-key vhdl-speedbar-mode-map "A" 'vhdl-speedbar-select-mra)
14374 (define-key vhdl-speedbar-key-map "K" 'vhdl-speedbar-make-design) 14557 (define-key vhdl-speedbar-mode-map "K" 'vhdl-speedbar-make-design)
14375 (define-key vhdl-speedbar-key-map "R" 'vhdl-speedbar-rescan-hierarchy) 14558 (define-key vhdl-speedbar-mode-map "R" 'vhdl-speedbar-rescan-hierarchy)
14376 (define-key vhdl-speedbar-key-map "S" 'vhdl-save-caches) 14559 (define-key vhdl-speedbar-mode-map "S" 'vhdl-save-caches)
14377 (let ((key 0)) 14560 (let ((key 0))
14378 (while (<= key 9) 14561 (while (<= key 9)
14379 (define-key vhdl-speedbar-key-map (int-to-string key) 14562 (define-key vhdl-speedbar-mode-map (int-to-string key)
14380 `(lambda () (interactive) (vhdl-speedbar-set-depth ,key))) 14563 `(lambda () (interactive) (vhdl-speedbar-set-depth ,key)))
14381 (setq key (1+ key))))) 14564 (setq key (1+ key)))))
14382 (define-key speedbar-mode-map "h" 14565 (define-key speedbar-mode-map "h"
@@ -14429,10 +14612,10 @@ if required."
14429 ["Save Caches" vhdl-save-caches vhdl-updated-project-list]))) 14612 ["Save Caches" vhdl-save-caches vhdl-updated-project-list])))
14430 ;; hook-ups 14613 ;; hook-ups
14431 (speedbar-add-expansion-list 14614 (speedbar-add-expansion-list
14432 '("vhdl directory" vhdl-speedbar-menu-items vhdl-speedbar-key-map 14615 '("vhdl directory" vhdl-speedbar-menu-items vhdl-speedbar-mode-map
14433 vhdl-speedbar-display-directory)) 14616 vhdl-speedbar-display-directory))
14434 (speedbar-add-expansion-list 14617 (speedbar-add-expansion-list
14435 '("vhdl project" vhdl-speedbar-menu-items vhdl-speedbar-key-map 14618 '("vhdl project" vhdl-speedbar-menu-items vhdl-speedbar-mode-map
14436 vhdl-speedbar-display-projects)) 14619 vhdl-speedbar-display-projects))
14437 (setq speedbar-stealthy-function-list 14620 (setq speedbar-stealthy-function-list
14438 (append 14621 (append
@@ -14719,15 +14902,15 @@ otherwise use cached data."
14719 (setq arch-alist (nth 4 (car ent-alist))) 14902 (setq arch-alist (nth 4 (car ent-alist)))
14720 (setq subunit-alist nil) 14903 (setq subunit-alist nil)
14721 (while arch-alist 14904 (while arch-alist
14722 (setq subunit-alist (cons (caar arch-alist) subunit-alist)) 14905 (push (caar arch-alist) subunit-alist)
14723 (setq arch-alist (cdr arch-alist))) 14906 (setq arch-alist (cdr arch-alist)))
14724 (setq unit-alist (cons (list (caar ent-alist) subunit-alist) unit-alist)) 14907 (push (list (caar ent-alist) subunit-alist) unit-alist)
14725 (setq ent-alist (cdr ent-alist))) 14908 (setq ent-alist (cdr ent-alist)))
14726 (while conf-alist 14909 (while conf-alist
14727 (setq unit-alist (cons (list (caar conf-alist)) unit-alist)) 14910 (push (list (caar conf-alist)) unit-alist)
14728 (setq conf-alist (cdr conf-alist))) 14911 (setq conf-alist (cdr conf-alist)))
14729 (while pack-alist 14912 (while pack-alist
14730 (setq unit-alist (cons (list (caar pack-alist)) unit-alist)) 14913 (push (list (caar pack-alist)) unit-alist)
14731 (setq pack-alist (cdr pack-alist))) 14914 (setq pack-alist (cdr pack-alist)))
14732 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist) 14915 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
14733 (vhdl-speedbar-refresh) 14916 (vhdl-speedbar-refresh)
@@ -15367,7 +15550,7 @@ NO-POSITION non-nil means do not re-position cursor."
15367 (concat (speedbar-line-directory indent) token)))) 15550 (concat (speedbar-line-directory indent) token))))
15368 (while oldl 15551 (while oldl
15369 (if (not (string-match (concat "^" (regexp-quote td)) (car oldl))) 15552 (if (not (string-match (concat "^" (regexp-quote td)) (car oldl)))
15370 (setq newl (cons (car oldl) newl))) 15553 (push (car oldl) newl))
15371 (setq oldl (cdr oldl))) 15554 (setq oldl (cdr oldl)))
15372 (setq speedbar-shown-directories (nreverse newl))) 15555 (setq speedbar-shown-directories (nreverse newl)))
15373 (speedbar-change-expand-button-char ?+) 15556 (speedbar-change-expand-button-char ?+)
@@ -15474,7 +15657,7 @@ NO-POSITION non-nil means do not re-position cursor."
15474 (setq dir (car path-list)) 15657 (setq dir (car path-list))
15475 (string-match "\\(-r \\)?\\(\\([^?*]*[/\\]\\)*\\)" dir) 15658 (string-match "\\(-r \\)?\\(\\([^?*]*[/\\]\\)*\\)" dir)
15476 (if (file-directory-p (match-string 2 dir)) 15659 (if (file-directory-p (match-string 2 dir))
15477 (setq path-list-1 (cons dir path-list-1)) 15660 (push dir path-list-1)
15478 (vhdl-warning-when-idle "No such directory: \"%s\"" (match-string 2 dir))) 15661 (vhdl-warning-when-idle "No such directory: \"%s\"" (match-string 2 dir)))
15479 (setq path-list (cdr path-list))) 15662 (setq path-list (cdr path-list)))
15480 ;; resolve path wildcards 15663 ;; resolve path wildcards
@@ -15496,13 +15679,13 @@ NO-POSITION non-nil means do not re-position cursor."
15496 dir-list) 15679 dir-list)
15497 (while all-list 15680 (while all-list
15498 (when (file-directory-p (car all-list)) 15681 (when (file-directory-p (car all-list))
15499 (setq dir-list (cons (car all-list) dir-list))) 15682 (push (car all-list) dir-list))
15500 (setq all-list (cdr all-list))) 15683 (setq all-list (cdr all-list)))
15501 dir-list)) 15684 dir-list))
15502 (cdr path-list-1)))) 15685 (cdr path-list-1))))
15503 (string-match "\\(-r \\)?\\(.*\\)[/\\].*" dir) 15686 (string-match "\\(-r \\)?\\(.*\\)[/\\].*" dir)
15504 (when (file-directory-p (match-string 2 dir)) 15687 (when (file-directory-p (match-string 2 dir))
15505 (setq path-list-2 (cons dir path-list-2))) 15688 (push dir path-list-2))
15506 (setq path-list-1 (cdr path-list-1)))) 15689 (setq path-list-1 (cdr path-list-1))))
15507 (nreverse path-list-2))) 15690 (nreverse path-list-2)))
15508 15691
@@ -15527,8 +15710,7 @@ is already shown in a buffer."
15527 (let ((buffer (get-file-buffer (car token)))) 15710 (let ((buffer (get-file-buffer (car token))))
15528 (speedbar-find-file-in-frame (car token)) 15711 (speedbar-find-file-in-frame (car token))
15529 (when (or vhdl-speedbar-jump-to-unit buffer) 15712 (when (or vhdl-speedbar-jump-to-unit buffer)
15530 (goto-char (point-min)) 15713 (vhdl-goto-line (cdr token))
15531 (forward-line (1- (cdr token)))
15532 (recenter)) 15714 (recenter))
15533 (vhdl-speedbar-update-current-unit t t) 15715 (vhdl-speedbar-update-current-unit t t)
15534 (speedbar-set-timer dframe-update-speed) 15716 (speedbar-set-timer dframe-update-speed)
@@ -15546,8 +15728,7 @@ is already shown in a buffer."
15546 (let ((token (get-text-property 15728 (let ((token (get-text-property
15547 (match-beginning 3) 'speedbar-token))) 15729 (match-beginning 3) 'speedbar-token)))
15548 (vhdl-visit-file (car token) t 15730 (vhdl-visit-file (car token) t
15549 (progn (goto-char (point-min)) 15731 (progn (vhdl-goto-line (cdr token))
15550 (forward-line (1- (cdr token)))
15551 (end-of-line) 15732 (end-of-line)
15552 (if is-entity 15733 (if is-entity
15553 (vhdl-port-copy) 15734 (vhdl-port-copy)
@@ -16000,7 +16181,7 @@ component instantiation."
16000 (or (aget generic-alist (match-string 2) t) 16181 (or (aget generic-alist (match-string 2) t)
16001 (error "ERROR: Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name)) 16182 (error "ERROR: Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
16002 (cdar generic-alist)))) 16183 (cdar generic-alist))))
16003 (setq constant-alist (cons constant-entry constant-alist)) 16184 (push constant-entry constant-alist)
16004 (setq constant-name (downcase constant-name)) 16185 (setq constant-name (downcase constant-name))
16005 (if (or (member constant-name single-list) 16186 (if (or (member constant-name single-list)
16006 (member constant-name multi-list)) 16187 (member constant-name multi-list))
@@ -16020,7 +16201,7 @@ component instantiation."
16020 (or (aget port-alist (match-string 2) t) 16201 (or (aget port-alist (match-string 2) t)
16021 (error "ERROR: Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name)) 16202 (error "ERROR: Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
16022 (cdar port-alist)))) 16203 (cdar port-alist))))
16023 (setq signal-alist (cons signal-entry signal-alist)) 16204 (push signal-entry signal-alist)
16024 (setq signal-name (downcase signal-name)) 16205 (setq signal-name (downcase signal-name))
16025 (if (equal (upcase (nth 2 signal-entry)) "IN") 16206 (if (equal (upcase (nth 2 signal-entry)) "IN")
16026 ;; input signal 16207 ;; input signal
@@ -16054,8 +16235,8 @@ component instantiation."
16054 (unless (match-string 1) 16235 (unless (match-string 1)
16055 (setq port-alist (cdr port-alist))) 16236 (setq port-alist (cdr port-alist)))
16056 (vhdl-forward-syntactic-ws)) 16237 (vhdl-forward-syntactic-ws))
16057 (setq inst-alist (cons (list inst-name (nreverse constant-alist) 16238 (push (list inst-name (nreverse constant-alist)
16058 (nreverse signal-alist)) inst-alist))) 16239 (nreverse signal-alist)) inst-alist))
16059 ;; prepare signal insertion 16240 ;; prepare signal insertion
16060 (vhdl-goto-marker arch-decl-pos) 16241 (vhdl-goto-marker arch-decl-pos)
16061 (forward-line 1) 16242 (forward-line 1)
@@ -16122,6 +16303,7 @@ component instantiation."
16122 (while constant-alist 16303 (while constant-alist
16123 (setq constant-name (downcase (caar constant-alist)) 16304 (setq constant-name (downcase (caar constant-alist))
16124 constant-entry (car constant-alist)) 16305 constant-entry (car constant-alist))
16306 (unless (string-match "^[0-9]+" constant-name)
16125 (cond ((member constant-name written-list) 16307 (cond ((member constant-name written-list)
16126 nil) 16308 nil)
16127 ((member constant-name multi-list) 16309 ((member constant-name multi-list)
@@ -16138,7 +16320,7 @@ component instantiation."
16138 (setq generic-end-pos 16320 (setq generic-end-pos
16139 (vhdl-compose-insert-generic constant-entry)) 16321 (vhdl-compose-insert-generic constant-entry))
16140 (setq generic-inst-pos (point-marker)) 16322 (setq generic-inst-pos (point-marker))
16141 (add-to-list 'written-list constant-name))) 16323 (add-to-list 'written-list constant-name))))
16142 (setq constant-alist (cdr constant-alist))) 16324 (setq constant-alist (cdr constant-alist)))
16143 (when (/= constant-temp-pos generic-inst-pos) 16325 (when (/= constant-temp-pos generic-inst-pos)
16144 (vhdl-goto-marker (vhdl-max-marker constant-temp-pos generic-pos)) 16326 (vhdl-goto-marker (vhdl-max-marker constant-temp-pos generic-pos))
@@ -16298,8 +16480,7 @@ current project/directory."
16298 ;; insert component declarations 16480 ;; insert component declarations
16299 (while ent-alist 16481 (while ent-alist
16300 (vhdl-visit-file (nth 2 (car ent-alist)) nil 16482 (vhdl-visit-file (nth 2 (car ent-alist)) nil
16301 (progn (goto-char (point-min)) 16483 (progn (vhdl-goto-line (nth 3 (car ent-alist)))
16302 (forward-line (1- (nth 3 (car ent-alist))))
16303 (end-of-line) 16484 (end-of-line)
16304 (vhdl-port-copy))) 16485 (vhdl-port-copy)))
16305 (goto-char component-pos) 16486 (goto-char component-pos)
@@ -16555,12 +16736,12 @@ no project is defined."
16555 (setq sublist (nth 11 (car commands-alist))) 16736 (setq sublist (nth 11 (car commands-alist)))
16556 (unless (or (equal "" (car sublist)) 16737 (unless (or (equal "" (car sublist))
16557 (assoc (car sublist) regexp-alist)) 16738 (assoc (car sublist) regexp-alist))
16558 (setq regexp-alist (cons (list (nth 0 sublist) 16739 (push (list (nth 0 sublist)
16559 (if (= 0 (nth 1 sublist)) 16740 (if (and (featurep 'xemacs) (not (nth 1 sublist)))
16560 (if (featurep 'xemacs) 9 nil) 16741 9
16561 (nth 1 sublist)) 16742 (nth 1 sublist))
16562 (nth 2 sublist) (nth 3 sublist)) 16743 (nth 2 sublist) (nth 3 sublist))
16563 regexp-alist))) 16744 regexp-alist))
16564 (setq commands-alist (cdr commands-alist))) 16745 (setq commands-alist (cdr commands-alist)))
16565 (setq compilation-error-regexp-alist 16746 (setq compilation-error-regexp-alist
16566 (append compilation-error-regexp-alist (nreverse regexp-alist)))) 16747 (append compilation-error-regexp-alist (nreverse regexp-alist))))
@@ -16573,7 +16754,7 @@ no project is defined."
16573 (setq sublist (nth 12 (car commands-alist))) 16754 (setq sublist (nth 12 (car commands-alist)))
16574 (unless (or (equal "" (car sublist)) 16755 (unless (or (equal "" (car sublist))
16575 (assoc (car sublist) regexp-alist)) 16756 (assoc (car sublist) regexp-alist))
16576 (setq regexp-alist (cons sublist regexp-alist))) 16757 (push sublist regexp-alist))
16577 (setq commands-alist (cdr commands-alist))) 16758 (setq commands-alist (cdr commands-alist)))
16578 (setq compilation-file-regexp-alist 16759 (setq compilation-file-regexp-alist
16579 (append compilation-file-regexp-alist (nreverse regexp-alist)))))) 16760 (append compilation-file-regexp-alist (nreverse regexp-alist))))))
@@ -16702,6 +16883,42 @@ specified by a target."
16702 (compile (concat (if (equal command "") "make" command) 16883 (compile (concat (if (equal command "") "make" command)
16703 " " options " " vhdl-make-target)))) 16884 " " options " " vhdl-make-target))))
16704 16885
16886;; Emacs 22+ setup
16887(defvar vhdl-error-regexp-emacs-alist
16888 ;; Get regexps from `vhdl-compiler-alist'
16889 (let ((compiler-alist vhdl-compiler-alist)
16890 (error-regexp-alist '((vhdl-directory "^ *Compiling \"\\(.+\\)\"" 1))))
16891 (while compiler-alist
16892 ;; add error message regexps
16893 (setq error-regexp-alist
16894 (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ? ?- (downcase (nth 0 (car compiler-alist)))))))
16895 (nth 11 (car compiler-alist)))
16896 error-regexp-alist))
16897 ;; add filename regexps
16898 (when (/= 0 (nth 1 (nth 12 (car compiler-alist))))
16899 (setq error-regexp-alist
16900 (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ? ?- (downcase (nth 0 (car compiler-alist)))) "-file")))
16901 (nth 12 (car compiler-alist)))
16902 error-regexp-alist)))
16903 (setq compiler-alist (cdr compiler-alist)))
16904 error-regexp-alist)
16905 "List of regexps for VHDL compilers. For Emacs 22+.")
16906
16907;; Add error regexps using compilation-mode-hook.
16908(defun vhdl-error-regexp-add-emacs ()
16909 "Set up Emacs compile for VHDL."
16910 (interactive)
16911 (when (and (boundp 'compilation-error-regexp-alist-alist)
16912 (not (assoc 'vhdl-modelsim compilation-error-regexp-alist-alist)))
16913 (mapcar
16914 (lambda (item)
16915 (push (car item) compilation-error-regexp-alist)
16916 (push item compilation-error-regexp-alist-alist))
16917 vhdl-error-regexp-emacs-alist)))
16918
16919(when vhdl-emacs-22
16920 (add-hook 'compilation-mode-hook 'vhdl-error-regexp-add-emacs))
16921
16705;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16922;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16706;; Makefile generation 16923;; Makefile generation
16707 16924
@@ -16724,7 +16941,7 @@ specified by a target."
16724 (let (pack-list) 16941 (let (pack-list)
16725 (while lib-alist 16942 (while lib-alist
16726 (when (equal (downcase (caar lib-alist)) (downcase work-library)) 16943 (when (equal (downcase (caar lib-alist)) (downcase work-library))
16727 (setq pack-list (cons (cdar lib-alist) pack-list))) 16944 (push (cdar lib-alist) pack-list))
16728 (setq lib-alist (cdr lib-alist))) 16945 (setq lib-alist (cdr lib-alist)))
16729 pack-list)) 16946 pack-list))
16730 16947
@@ -16776,8 +16993,10 @@ specified by a target."
16776 (setq ent-entry (car ent-alist) 16993 (setq ent-entry (car ent-alist)
16777 ent-key (nth 0 ent-entry)) 16994 ent-key (nth 0 ent-entry))
16778 (when (nth 2 ent-entry) 16995 (when (nth 2 ent-entry)
16779 (setq ent-file-name (file-relative-name 16996 (setq ent-file-name (if vhdl-compile-absolute-path
16780 (nth 2 ent-entry) compile-directory) 16997 (nth 2 ent-entry)
16998 (file-relative-name (nth 2 ent-entry)
16999 compile-directory))
16781 arch-alist (nth 4 ent-entry) 17000 arch-alist (nth 4 ent-entry)
16782 lib-alist (nth 6 ent-entry) 17001 lib-alist (nth 6 ent-entry)
16783 rule (aget rule-alist ent-file-name) 17002 rule (aget rule-alist ent-file-name)
@@ -16787,9 +17006,9 @@ specified by a target."
16787 subcomp-list nil) 17006 subcomp-list nil)
16788 (setq tmp-key (vhdl-replace-string 17007 (setq tmp-key (vhdl-replace-string
16789 ent-regexp (funcall adjust-case ent-key))) 17008 ent-regexp (funcall adjust-case ent-key)))
16790 (setq unit-list (cons (cons ent-key tmp-key) unit-list)) 17009 (push (cons ent-key tmp-key) unit-list)
16791 ;; rule target for this entity 17010 ;; rule target for this entity
16792 (setq target-list (cons ent-key target-list)) 17011 (push ent-key target-list)
16793 ;; rule dependencies for all used packages 17012 ;; rule dependencies for all used packages
16794 (setq pack-list (vhdl-get-packages lib-alist work-library)) 17013 (setq pack-list (vhdl-get-packages lib-alist work-library))
16795 (setq depend-list (append depend-list pack-list)) 17014 (setq depend-list (append depend-list pack-list))
@@ -16801,8 +17020,10 @@ specified by a target."
16801 (setq arch-entry (car arch-alist) 17020 (setq arch-entry (car arch-alist)
16802 arch-key (nth 0 arch-entry) 17021 arch-key (nth 0 arch-entry)
16803 ent-arch-key (concat ent-key "-" arch-key) 17022 ent-arch-key (concat ent-key "-" arch-key)
16804 arch-file-name (file-relative-name (nth 2 arch-entry) 17023 arch-file-name (if vhdl-compile-absolute-path
16805 compile-directory) 17024 (nth 2 arch-entry)
17025 (file-relative-name (nth 2 arch-entry)
17026 compile-directory))
16806 inst-alist (nth 4 arch-entry) 17027 inst-alist (nth 4 arch-entry)
16807 lib-alist (nth 5 arch-entry) 17028 lib-alist (nth 5 arch-entry)
16808 rule (aget rule-alist arch-file-name) 17029 rule (aget rule-alist arch-file-name)
@@ -16813,11 +17034,11 @@ specified by a target."
16813 (funcall adjust-case (concat arch-key " " ent-key)))) 17034 (funcall adjust-case (concat arch-key " " ent-key))))
16814 (setq unit-list 17035 (setq unit-list
16815 (cons (cons ent-arch-key tmp-key) unit-list)) 17036 (cons (cons ent-arch-key tmp-key) unit-list))
16816 (setq second-list (cons ent-arch-key second-list)) 17037 (push ent-arch-key second-list)
16817 ;; rule target for this architecture 17038 ;; rule target for this architecture
16818 (setq target-list (cons ent-arch-key target-list)) 17039 (push ent-arch-key target-list)
16819 ;; rule dependency for corresponding entity 17040 ;; rule dependency for corresponding entity
16820 (setq depend-list (cons ent-key depend-list)) 17041 (push ent-key depend-list)
16821 ;; rule dependencies for contained component instantiations 17042 ;; rule dependencies for contained component instantiations
16822 (while inst-alist 17043 (while inst-alist
16823 (setq inst-entry (car inst-alist)) 17044 (setq inst-entry (car inst-alist))
@@ -16835,9 +17056,8 @@ specified by a target."
16835 ;; add rule 17056 ;; add rule
16836 (aput 'rule-alist arch-file-name (list target-list depend-list)) 17057 (aput 'rule-alist arch-file-name (list target-list depend-list))
16837 (setq arch-alist (cdr arch-alist))) 17058 (setq arch-alist (cdr arch-alist)))
16838 (setq prim-list (cons (list ent-key second-list 17059 (push (list ent-key second-list (append subcomp-list all-pack-list))
16839 (append subcomp-list all-pack-list)) 17060 prim-list))
16840 prim-list)))
16841 (setq ent-alist (cdr ent-alist))) 17061 (setq ent-alist (cdr ent-alist)))
16842 (setq ent-alist tmp-list) 17062 (setq ent-alist tmp-list)
16843 ;; rules for all configurations 17063 ;; rules for all configurations
@@ -16845,8 +17065,10 @@ specified by a target."
16845 (while conf-alist 17065 (while conf-alist
16846 (setq conf-entry (car conf-alist) 17066 (setq conf-entry (car conf-alist)
16847 conf-key (nth 0 conf-entry) 17067 conf-key (nth 0 conf-entry)
16848 conf-file-name (file-relative-name 17068 conf-file-name (if vhdl-compile-absolute-path
16849 (nth 2 conf-entry) compile-directory) 17069 (nth 2 conf-entry)
17070 (file-relative-name (nth 2 conf-entry)
17071 compile-directory))
16850 ent-key (nth 4 conf-entry) 17072 ent-key (nth 4 conf-entry)
16851 arch-key (nth 5 conf-entry) 17073 arch-key (nth 5 conf-entry)
16852 inst-alist (nth 6 conf-entry) 17074 inst-alist (nth 6 conf-entry)
@@ -16857,9 +17079,9 @@ specified by a target."
16857 subcomp-list (list ent-key)) 17079 subcomp-list (list ent-key))
16858 (setq tmp-key (vhdl-replace-string 17080 (setq tmp-key (vhdl-replace-string
16859 conf-regexp (funcall adjust-case conf-key))) 17081 conf-regexp (funcall adjust-case conf-key)))
16860 (setq unit-list (cons (cons conf-key tmp-key) unit-list)) 17082 (push (cons conf-key tmp-key) unit-list)
16861 ;; rule target for this configuration 17083 ;; rule target for this configuration
16862 (setq target-list (cons conf-key target-list)) 17084 (push conf-key target-list)
16863 ;; rule dependency for corresponding entity and architecture 17085 ;; rule dependency for corresponding entity and architecture
16864 (setq depend-list 17086 (setq depend-list
16865 (cons ent-key (cons (concat ent-key "-" arch-key) depend-list))) 17087 (cons ent-key (cons (concat ent-key "-" arch-key) depend-list)))
@@ -16877,16 +17099,14 @@ specified by a target."
16877 (setq depend-list (cons inst-ent-key depend-list) 17099 (setq depend-list (cons inst-ent-key depend-list)
16878 subcomp-list (cons inst-ent-key subcomp-list))) 17100 subcomp-list (cons inst-ent-key subcomp-list)))
16879; (when comp-arch-key 17101; (when comp-arch-key
16880; (setq depend-list (cons (concat comp-ent-key "-" comp-arch-key) 17102; (push (concat comp-ent-key "-" comp-arch-key) depend-list))
16881; depend-list)))
16882 (when inst-conf-key 17103 (when inst-conf-key
16883 (setq depend-list (cons inst-conf-key depend-list) 17104 (setq depend-list (cons inst-conf-key depend-list)
16884 subcomp-list (cons inst-conf-key subcomp-list)))) 17105 subcomp-list (cons inst-conf-key subcomp-list))))
16885 (setq inst-alist (cdr inst-alist))) 17106 (setq inst-alist (cdr inst-alist)))
16886 ;; add rule 17107 ;; add rule
16887 (aput 'rule-alist conf-file-name (list target-list depend-list)) 17108 (aput 'rule-alist conf-file-name (list target-list depend-list))
16888 (setq prim-list (cons (list conf-key nil (append subcomp-list pack-list)) 17109 (push (list conf-key nil (append subcomp-list pack-list)) prim-list)
16889 prim-list))
16890 (setq conf-alist (cdr conf-alist))) 17110 (setq conf-alist (cdr conf-alist)))
16891 (setq conf-alist tmp-list) 17111 (setq conf-alist tmp-list)
16892 ;; rules for all packages 17112 ;; rules for all packages
@@ -16896,16 +17116,18 @@ specified by a target."
16896 pack-key (nth 0 pack-entry) 17116 pack-key (nth 0 pack-entry)
16897 pack-body-key nil) 17117 pack-body-key nil)
16898 (when (nth 2 pack-entry) 17118 (when (nth 2 pack-entry)
16899 (setq pack-file-name (file-relative-name (nth 2 pack-entry) 17119 (setq pack-file-name (if vhdl-compile-absolute-path
16900 compile-directory) 17120 (nth 2 pack-entry)
17121 (file-relative-name (nth 2 pack-entry)
17122 compile-directory))
16901 lib-alist (nth 6 pack-entry) lib-body-alist (nth 10 pack-entry) 17123 lib-alist (nth 6 pack-entry) lib-body-alist (nth 10 pack-entry)
16902 rule (aget rule-alist pack-file-name) 17124 rule (aget rule-alist pack-file-name)
16903 target-list (nth 0 rule) depend-list (nth 1 rule)) 17125 target-list (nth 0 rule) depend-list (nth 1 rule))
16904 (setq tmp-key (vhdl-replace-string 17126 (setq tmp-key (vhdl-replace-string
16905 pack-regexp (funcall adjust-case pack-key))) 17127 pack-regexp (funcall adjust-case pack-key)))
16906 (setq unit-list (cons (cons pack-key tmp-key) unit-list)) 17128 (push (cons pack-key tmp-key) unit-list)
16907 ;; rule target for this package 17129 ;; rule target for this package
16908 (setq target-list (cons pack-key target-list)) 17130 (push pack-key target-list)
16909 ;; rule dependencies for all used packages 17131 ;; rule dependencies for all used packages
16910 (setq pack-list (vhdl-get-packages lib-alist work-library)) 17132 (setq pack-list (vhdl-get-packages lib-alist work-library))
16911 (setq depend-list (append depend-list pack-list)) 17133 (setq depend-list (append depend-list pack-list))
@@ -16915,8 +17137,10 @@ specified by a target."
16915 ;; rules for this package's body 17137 ;; rules for this package's body
16916 (when (nth 7 pack-entry) 17138 (when (nth 7 pack-entry)
16917 (setq pack-body-key (concat pack-key "-body") 17139 (setq pack-body-key (concat pack-key "-body")
16918 pack-body-file-name (file-relative-name (nth 7 pack-entry) 17140 pack-body-file-name (if vhdl-compile-absolute-path
16919 compile-directory) 17141 (nth 7 pack-entry)
17142 (file-relative-name (nth 7 pack-entry)
17143 compile-directory))
16920 rule (aget rule-alist pack-body-file-name) 17144 rule (aget rule-alist pack-body-file-name)
16921 target-list (nth 0 rule) 17145 target-list (nth 0 rule)
16922 depend-list (nth 1 rule)) 17146 depend-list (nth 1 rule))
@@ -16925,9 +17149,9 @@ specified by a target."
16925 (setq unit-list 17149 (setq unit-list
16926 (cons (cons pack-body-key tmp-key) unit-list)) 17150 (cons (cons pack-body-key tmp-key) unit-list))
16927 ;; rule target for this package's body 17151 ;; rule target for this package's body
16928 (setq target-list (cons pack-body-key target-list)) 17152 (push pack-body-key target-list)
16929 ;; rule dependency for corresponding package declaration 17153 ;; rule dependency for corresponding package declaration
16930 (setq depend-list (cons pack-key depend-list)) 17154 (push pack-key depend-list)
16931 ;; rule dependencies for all used packages 17155 ;; rule dependencies for all used packages
16932 (setq pack-list (vhdl-get-packages lib-body-alist work-library)) 17156 (setq pack-list (vhdl-get-packages lib-body-alist work-library))
16933 (setq depend-list (append depend-list pack-list)) 17157 (setq depend-list (append depend-list pack-list))
@@ -17050,16 +17274,16 @@ specified by a target."
17050 (unless (equal unit-key unit-name) 17274 (unless (equal unit-key unit-name)
17051 (insert " \\\n" unit-name)) 17275 (insert " \\\n" unit-name))
17052 (insert " :" 17276 (insert " :"
17053 " \\\n\t\t" (nth 2 vhdl-makefile-default-targets) 17277 " \\\n\t\t" (nth 2 vhdl-makefile-default-targets))
17054 " \\\n\t\t$(UNIT-" work-library "-" unit-key ")")
17055 (while second-list
17056 (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")")
17057 (setq second-list (cdr second-list)))
17058 (while subcomp-list 17278 (while subcomp-list
17059 (when (and (assoc (car subcomp-list) unit-list) 17279 (when (and (assoc (car subcomp-list) unit-list)
17060 (not (equal unit-key (car subcomp-list)))) 17280 (not (equal unit-key (car subcomp-list))))
17061 (insert " \\\n\t\t" (car subcomp-list))) 17281 (insert " \\\n\t\t" (car subcomp-list)))
17062 (setq subcomp-list (cdr subcomp-list))) 17282 (setq subcomp-list (cdr subcomp-list)))
17283 (insert " \\\n\t\t$(UNIT-" work-library "-" unit-key ")")
17284 (while second-list
17285 (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")")
17286 (setq second-list (cdr second-list)))
17063 (insert "\n") 17287 (insert "\n")
17064 (setq prim-list (cdr prim-list))) 17288 (setq prim-list (cdr prim-list)))
17065 ;; insert rule for each library unit file 17289 ;; insert rule for each library unit file
@@ -17198,6 +17422,7 @@ specified by a target."
17198 'vhdl-include-direction-comments 17422 'vhdl-include-direction-comments
17199 'vhdl-include-type-comments 17423 'vhdl-include-type-comments
17200 'vhdl-include-group-comments 17424 'vhdl-include-group-comments
17425 'vhdl-actual-generic-name
17201 'vhdl-actual-port-name 17426 'vhdl-actual-port-name
17202 'vhdl-instance-name 17427 'vhdl-instance-name
17203 'vhdl-testbench-entity-name 17428 'vhdl-testbench-entity-name
@@ -17280,13 +17505,21 @@ specified by a target."
17280 17505
17281(defconst vhdl-doc-release-notes nil 17506(defconst vhdl-doc-release-notes nil
17282 "\ 17507 "\
17283Release Notes for VHDL Mode 3.33 17508Release Notes for VHDL Mode 3.34
17284================================ 17509================================
17285 17510
17286 - New Features 17511- Added support for GNU Emacs 22/23/24:
17287 - User Options 17512 - Compilation error parsing fixed for new `compile.el' package.
17513
17514- Port translation: Derive actual generic name from formal generic name.
17515
17516- New user options:
17517 `vhdl-actual-generic-name': Specify how actual generic names are obtained.
17288 17518
17289 17519
17520Release Notes for VHDL Mode 3.33
17521================================
17522
17290New Features 17523New Features
17291------------ 17524------------
17292 17525
diff --git a/lisp/shell.el b/lisp/shell.el
index d09d7aee43f..51a0ffc4fe8 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -111,9 +111,10 @@
111 "Directory support in shell mode." 111 "Directory support in shell mode."
112 :group 'shell) 112 :group 'shell)
113 113
114(defgroup shell-faces nil 114;; Unused.
115 "Faces in shell buffers." 115;;; (defgroup shell-faces nil
116 :group 'shell) 116;;; "Faces in shell buffers."
117;;; :group 'shell)
117 118
118;;;###autoload 119;;;###autoload
119(defcustom shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") 120(defcustom shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe")
diff --git a/lisp/simple.el b/lisp/simple.el
index e4bde7c358c..f81b02b0acf 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -380,12 +380,18 @@ Other major modes are defined by comparison with this one."
380 map) 380 map)
381 "Keymap used for programming modes.") 381 "Keymap used for programming modes.")
382 382
383(defun prog-indent-sexp () 383(defun prog-indent-sexp (&optional defun)
384 "Indent the expression after point." 384 "Indent the expression after point.
385 (interactive) 385When interactively called with prefix, indent the enclosing defun
386 (let ((start (point)) 386instead."
387 (end (save-excursion (forward-sexp 1) (point)))) 387 (interactive "P")
388 (indent-region start end nil))) 388 (save-excursion
389 (when defun
390 (end-of-line)
391 (beginning-of-defun))
392 (let ((start (point))
393 (end (progn (forward-sexp 1) (point))))
394 (indent-region start end nil))))
389 395
390(define-derived-mode prog-mode fundamental-mode "Prog" 396(define-derived-mode prog-mode fundamental-mode "Prog"
391 "Major mode for editing programming language source code." 397 "Major mode for editing programming language source code."
diff --git a/lisp/term/vt100.el b/lisp/term/vt100.el
index 782924086df..2453f479eda 100644
--- a/lisp/term/vt100.el
+++ b/lisp/term/vt100.el
@@ -46,6 +46,7 @@ With a prefix argument ARG, switch to 132-column mode if ARG is
46positive, and 80-column mode otherwise. If called from Lisp, 46positive, and 80-column mode otherwise. If called from Lisp,
47switch to 132-column mode if ARG is omitted or nil." 47switch to 132-column mode if ARG is omitted or nil."
48 :global t :init-value (= (frame-width) 132) 48 :global t :init-value (= (frame-width) 132)
49 :group 'terminals
49 (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l")) 50 (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l"))
50 (set-frame-width terminal-frame (if vt100-wide-mode 132 80))) 51 (set-frame-width terminal-frame (if vt100-wide-mode 132 80)))
51 52
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index da437c178b6..05a129225ee 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -27,7 +27,7 @@
27(defgroup xterm nil 27(defgroup xterm nil
28 "XTerm support." 28 "XTerm support."
29 :version "24.1" 29 :version "24.1"
30 :group 'environment) 30 :group 'terminals)
31 31
32(defcustom xterm-extra-capabilities 'check 32(defcustom xterm-extra-capabilities 'check
33 "Whether Xterm supports some additional, more modern, features. 33 "Whether Xterm supports some additional, more modern, features.
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index f6a2c7eca05..ebbc6ee0afb 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -83,9 +83,10 @@
83 83
84;;; Code: 84;;; Code:
85 85
86(defgroup refill nil 86;; Unused.
87 "Refilling paragraphs on changes." 87;;; (defgroup refill nil
88 :group 'fill) 88;;; "Refilling paragraphs on changes."
89;;; :group 'fill)
89 90
90(defvar refill-ignorable-overlay nil 91(defvar refill-ignorable-overlay nil
91 "Portion of the most recently filled paragraph not needing filling. 92 "Portion of the most recently filled paragraph not needing filling.
@@ -222,7 +223,8 @@ characters only cause refilling if they would cause
222auto-filling. 223auto-filling.
223 224
224For true \"word wrap\" behavior, use `visual-line-mode' instead." 225For true \"word wrap\" behavior, use `visual-line-mode' instead."
225 :group 'refill 226 ;; Not global, so no effect.
227;;; :group 'refill
226 :lighter " Refill" 228 :lighter " Refill"
227 :keymap '(("\177" . backward-delete-char-untabify)) 229 :keymap '(("\177" . backward-delete-char-untabify))
228 ;; Remove old state if necessary 230 ;; Remove old state if necessary
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index b3503c6c982..01981175e1d 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -3932,7 +3932,7 @@ string)) to be used for converting the document."
3932 (choice :tag "Command options" 3932 (choice :tag "Command options"
3933 (const :tag "No options" nil) 3933 (const :tag "No options" nil)
3934 (string :tag "Options")))) 3934 (string :tag "Options"))))
3935 :group 'rst 3935 :group 'rst-compile
3936 :package-version "1.2.0") 3936 :package-version "1.2.0")
3937(rst-testcover-defcustom) 3937(rst-testcover-defcustom)
3938 3938
diff --git a/lisp/type-break.el b/lisp/type-break.el
index e4fa02f9fe6..b4e4be31955 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -418,7 +418,7 @@ Variables controlling the display of messages in the mode line include:
418 `global-mode-string' 418 `global-mode-string'
419 `type-break-mode-line-break-message' 419 `type-break-mode-line-break-message'
420 `type-break-mode-line-warning'" 420 `type-break-mode-line-warning'"
421 :global t) 421 :global t :group 'type-break)
422 422
423(define-minor-mode type-break-query-mode 423(define-minor-mode type-break-query-mode
424 "Toggle typing break queries. 424 "Toggle typing break queries.
@@ -428,7 +428,7 @@ enable them if ARG is omitted or nil.
428 428
429The user may also enable or disable this mode simply by setting 429The user may also enable or disable this mode simply by setting
430the variable of the same name." 430the variable of the same name."
431 :global t) 431 :global t :group 'type-break)
432 432
433 433
434;;; session file functions 434;;; session file functions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index f8f24de6b68..4c63c548f79 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,7 @@
12013-05-15 Glenn Morris <rgm@gnu.org>
2
3 * url-news.el (url-news): Remove empty custom group.
4
12013-02-16 Glenn Morris <rgm@gnu.org> 52013-02-16 Glenn Morris <rgm@gnu.org>
2 6
3 * url-http.el (url-http-wait-for-headers-change-function): 7 * url-http.el (url-http-wait-for-headers-change-function):
diff --git a/lisp/url/url-news.el b/lisp/url/url-news.el
index 391974d79f8..d4532626183 100644
--- a/lisp/url/url-news.el
+++ b/lisp/url/url-news.el
@@ -28,9 +28,10 @@
28(autoload 'url-warn "url") 28(autoload 'url-warn "url")
29(autoload 'gnus-group-read-ephemeral-group "gnus-group") 29(autoload 'gnus-group-read-ephemeral-group "gnus-group")
30 30
31(defgroup url-news nil 31;; Unused.
32 "News related options." 32;;; (defgroup url-news nil
33 :group 'url) 33;;; "News related options."
34;;; :group 'url)
34 35
35(defun url-news-open-host (host port user pass) 36(defun url-news-open-host (host port user pass)
36 (if (fboundp 'nnheader-init-server-buffer) 37 (if (fboundp 'nnheader-init-server-buffer)
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 45a30afda70..be6d4c91c50 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -98,6 +98,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
98 -W \ 98 -W \
99 -Wabi \ 99 -Wabi \
100 -Waddress \ 100 -Waddress \
101 -Waggressive-loop-optimizations \
101 -Wall \ 102 -Wall \
102 -Warray-bounds \ 103 -Warray-bounds \
103 -Wattributes \ 104 -Wattributes \
@@ -125,7 +126,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
125 -Wformat-security \ 126 -Wformat-security \
126 -Wformat-y2k \ 127 -Wformat-y2k \
127 -Wformat-zero-length \ 128 -Wformat-zero-length \
128 -Wformat=2 \
129 -Wfree-nonheap-object \ 129 -Wfree-nonheap-object \
130 -Wignored-qualifiers \ 130 -Wignored-qualifiers \
131 -Wimplicit \ 131 -Wimplicit \
@@ -143,9 +143,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
143 -Wmissing-braces \ 143 -Wmissing-braces \
144 -Wmissing-declarations \ 144 -Wmissing-declarations \
145 -Wmissing-field-initializers \ 145 -Wmissing-field-initializers \
146 -Wmissing-format-attribute \
147 -Wmissing-include-dirs \ 146 -Wmissing-include-dirs \
148 -Wmissing-noreturn \
149 -Wmissing-parameter-type \ 147 -Wmissing-parameter-type \
150 -Wmissing-prototypes \ 148 -Wmissing-prototypes \
151 -Wmudflap \ 149 -Wmudflap \
@@ -166,6 +164,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
166 -Wpointer-sign \ 164 -Wpointer-sign \
167 -Wpointer-to-int-cast \ 165 -Wpointer-to-int-cast \
168 -Wpragmas \ 166 -Wpragmas \
167 -Wreturn-local-addr \
169 -Wreturn-type \ 168 -Wreturn-type \
170 -Wsequence-point \ 169 -Wsequence-point \
171 -Wshadow \ 170 -Wshadow \
@@ -187,7 +186,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
187 -Wtype-limits \ 186 -Wtype-limits \
188 -Wuninitialized \ 187 -Wuninitialized \
189 -Wunknown-pragmas \ 188 -Wunknown-pragmas \
190 -Wunreachable-code \
191 -Wunsafe-loop-optimizations \ 189 -Wunsafe-loop-optimizations \
192 -Wunused \ 190 -Wunused \
193 -Wunused-but-set-parameter \ 191 -Wunused-but-set-parameter \
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index 4b2ac385019..184873283bb 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,4 +1,4 @@
1# warnings.m4 serial 7 1# warnings.m4 serial 8
2dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_COMPILER_OPTION_IF],
27AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl 27AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
28AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ 28AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
29 gl_save_compiler_FLAGS="$gl_Flags" 29 gl_save_compiler_FLAGS="$gl_Flags"
30 gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $1"]) 30 gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors $1"])
31 AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], 31 AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
32 [AS_VAR_SET(gl_Warn, [yes])], 32 [AS_VAR_SET(gl_Warn, [yes])],
33 [AS_VAR_SET(gl_Warn, [no])]) 33 [AS_VAR_SET(gl_Warn, [no])])
@@ -38,6 +38,14 @@ AS_VAR_POPDEF([gl_Flags])dnl
38AS_VAR_POPDEF([gl_Warn])dnl 38AS_VAR_POPDEF([gl_Warn])dnl
39]) 39])
40 40
41# gl_UNKNOWN_WARNINGS_ARE_ERRORS
42# ------------------------------
43# Clang doesn't complain about unknown warning options unless one also
44# specifies -Wunknown-warning-option -Werror. Detect this.
45AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
46[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
47 [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
48 [gl_unknown_warnings_are_errors=])])
41 49
42# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS], 50# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
43# [PROGRAM = AC_LANG_PROGRAM()]) 51# [PROGRAM = AC_LANG_PROGRAM()])
@@ -47,7 +55,8 @@ AS_VAR_POPDEF([gl_Warn])dnl
47# 55#
48# If VARIABLE is a variable name, AC_SUBST it. 56# If VARIABLE is a variable name, AC_SUBST it.
49AC_DEFUN([gl_WARN_ADD], 57AC_DEFUN([gl_WARN_ADD],
50[gl_COMPILER_OPTION_IF([$1], 58[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
59gl_COMPILER_OPTION_IF([$1],
51 [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])], 60 [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
52 [], 61 [],
53 [$3]) 62 [$3])
diff --git a/msdos/ChangeLog b/msdos/ChangeLog
index 87a135cad2d..0214b6bc98b 100644
--- a/msdos/ChangeLog
+++ b/msdos/ChangeLog
@@ -1,3 +1,7 @@
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * sed1x.inp: Don't rewrite DOC any more.
4
12013-02-08 Paul Eggert <eggert@cs.ucla.edu> 52013-02-08 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * sedlibmk.inp: Sync with changes in lib/Makefile.in. 7 * sedlibmk.inp: Sync with changes in lib/Makefile.in.
diff --git a/msdos/sed1x.inp b/msdos/sed1x.inp
index 9134bc73d28..dacfee6d385 100644
--- a/msdos/sed1x.inp
+++ b/msdos/sed1x.inp
@@ -17,7 +17,7 @@
17# ---------------------------------------------------------------------- 17# ----------------------------------------------------------------------
18s!^ cd \${oldXMenudir}; \${MAKE}.*$! ${MAKE} -C ${oldXMenudir}.! 18s!^ cd \${oldXMenudir}; \${MAKE}.*$! ${MAKE} -C ${oldXMenudir}.!
19s!^ @true *$! @rem! 19s!^ @true *$! @rem!
20s/DOC/DOC-X/g 20#s/DOC/DOC-X/g
21/^OLDXMENU *=/s!=.*!= ${oldXMenudir}libXMenu11.a! 21/^OLDXMENU *=/s!=.*!= ${oldXMenudir}libXMenu11.a!
22/^LIBXMENU *=/s!= *!= ${OLDXMENU}! 22/^LIBXMENU *=/s!= *!= ${OLDXMENU}!
23/^LIBX_OTHER *=/s!= *!= ${LIBXT} ${LIBX_EXTRA}! 23/^LIBX_OTHER *=/s!= *!= ${LIBXT} ${LIBX_EXTRA}!
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 2a602be59c9..b66871e319b 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,7 @@
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * makefile.w32-in (clean, top-distclean): DOC-X doesn't exist any more.
4
12013-05-08 Juanma Barranquero <lekktu@gmail.com> 52013-05-08 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * config.nt: Sync with autogen/config.in. 7 * config.nt: Sync with autogen/config.in.
diff --git a/nt/README.W32 b/nt/README.W32
index 19c148bbf0b..a2881ce1914 100644
--- a/nt/README.W32
+++ b/nt/README.W32
@@ -29,7 +29,7 @@ See the end of the file for license conditions.
29 Along with this file should be six subdirectories (bin, etc, info, 29 Along with this file should be six subdirectories (bin, etc, info,
30 lisp, leim, site-lisp). If you have downloaded the barebin 30 lisp, leim, site-lisp). If you have downloaded the barebin
31 distribution, then it will contain only the bin directory and the 31 distribution, then it will contain only the bin directory and the
32 built in documentation in etc/DOC-X, the rest of the subdirectories 32 built in documentation in etc/DOC, the rest of the subdirectories
33 are in the src distribution, which the barebin distribution is 33 are in the src distribution, which the barebin distribution is
34 designed to be used with. 34 designed to be used with.
35 35
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
index 0c2f6324188..79ca22bf44e 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -315,7 +315,7 @@ clean: clean-other-dirs-$(MAKETYPE)
315 - $(DEL) $(COMPILER_TEMP_FILES) 315 - $(DEL) $(COMPILER_TEMP_FILES)
316 - $(DEL_TREE) $(OBJDIR) 316 - $(DEL_TREE) $(OBJDIR)
317 - $(DEL) stamp_BLD 317 - $(DEL) stamp_BLD
318 - $(DEL) ../etc/DOC ../etc/DOC-X 318 - $(DEL) ../etc/DOC
319 319
320clean-other-dirs-nmake: 320clean-other-dirs-nmake:
321 cd ..\lib 321 cd ..\lib
@@ -375,7 +375,7 @@ top-distclean:
375 - $(DEL_TREE) oo 375 - $(DEL_TREE) oo
376 - $(DEL_TREE) oo-spd 376 - $(DEL_TREE) oo-spd
377 - $(DEL) stamp_BLD 377 - $(DEL) stamp_BLD
378 - $(DEL) ../etc/DOC ../etc/DOC-X 378 - $(DEL) ../etc/DOC
379 - $(DEL) config.log Makefile 379 - $(DEL) config.log Makefile
380 - $(DEL) ../README.W32 380 - $(DEL) ../README.W32
381 381
diff --git a/src/ChangeLog b/src/ChangeLog
index 0b4ccb0708a..c45ec824919 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,33 @@
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * makefile.w32-in (DOC): Use just "DOC".
4
5 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
6
7 * process.c: Export default filters and sentinels to Elisp.
8 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
9 New constants.
10 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
11 (Fset_process_sentinel, Fformat_network_address):
12 Default to them instead of nil.
13 (server_accept_connection): Sentinels can't be nil any more.
14 (read_and_dispose_of_process_output): New function, extracted from
15 read_process_output.
16 (read_process_output): Use it; filters can't be nil.
17 (Finternal_default_process_filter): New function, extracted from
18 read_process_output.
19 (exec_sentinel_unwind): Remove function.
20 (exec_sentinel): Don't zilch sentinel while running.
21 (status_notify): Sentinels can't be nil.
22 (Finternal_default_process_sentinel): New function extracted from
23 status_notify.
24 (setup_process_coding_systems): Default filter is not nil any more.
25 (syms_of_process): Export new Elisp functions and initialize
26 new constants.
27 * lisp.h (make_lisp_proc): New function.
28
292013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
30
3 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart. 31 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
4 32
52013-05-14 Eli Zaretskii <eliz@gnu.org> 332013-05-14 Eli Zaretskii <eliz@gnu.org>
diff --git a/src/Makefile.in b/src/Makefile.in
index 2e1764723ec..c7a18363a5a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -555,7 +555,7 @@ clean: mostlyclean
555## It should remove all files generated during a compilation/bootstrap, 555## It should remove all files generated during a compilation/bootstrap,
556## but not things like config.status or TAGS. 556## but not things like config.status or TAGS.
557bootstrap-clean: clean 557bootstrap-clean: clean
558 rm -f epaths.h config.h config.stamp stamp-h1 stamp-oldxmenu ../etc/DOC-* 558 rm -f epaths.h config.h config.stamp stamp-h1 stamp-oldxmenu
559 if test -f ./.gdbinit; then \ 559 if test -f ./.gdbinit; then \
560 mv ./.gdbinit ./.gdbinit.save; \ 560 mv ./.gdbinit ./.gdbinit.save; \
561 if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \ 561 if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \
diff --git a/src/doc.c b/src/doc.c
index 770cb1eb646..e45481944f0 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -58,7 +58,7 @@ read_bytecode_char (bool unreadflag)
58} 58}
59 59
60/* Extract a doc string from a file. FILEPOS says where to get it. 60/* Extract a doc string from a file. FILEPOS says where to get it.
61 If it is an integer, use that position in the standard DOC-... file. 61 If it is an integer, use that position in the standard DOC file.
62 If it is (FILE . INTEGER), use FILE as the file name 62 If it is (FILE . INTEGER), use FILE as the file name
63 and INTEGER as the position in that file. 63 and INTEGER as the position in that file.
64 But if INTEGER is negative, make it positive. 64 But if INTEGER is negative, make it positive.
@@ -608,7 +608,7 @@ the same file name is found in the `doc-directory'. */)
608 while (*beg && c_isspace (*beg)) ++beg; 608 while (*beg && c_isspace (*beg)) ++beg;
609 609
610 for (end = beg; *end && ! c_isspace (*end); ++end) 610 for (end = beg; *end && ! c_isspace (*end); ++end)
611 if (*end == '/') beg = end+1; /* skip directory part */ 611 if (*end == '/') beg = end + 1; /* Skip directory part. */
612 612
613 len = end - beg; 613 len = end - beg;
614 if (len > 4 && end[-4] == '.' && end[-3] == 'o') 614 if (len > 4 && end[-4] == '.' && end[-3] == 'o')
diff --git a/src/lisp.h b/src/lisp.h
index e2c24eed352..79d32c90f73 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -585,10 +585,12 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
585 (eassert (KBOARD_OBJFWDP (a)), &((a)->u_kboard_objfwd)) 585 (eassert (KBOARD_OBJFWDP (a)), &((a)->u_kboard_objfwd))
586 586
587/* Pseudovector types. */ 587/* Pseudovector types. */
588 588struct Lisp_Process;
589LISP_INLINE Lisp_Object make_lisp_proc (struct Lisp_Process *p)
590{ return make_lisp_ptr (p, Lisp_Vectorlike); }
589#define XPROCESS(a) (eassert (PROCESSP (a)), \ 591#define XPROCESS(a) (eassert (PROCESSP (a)), \
590 (struct Lisp_Process *) XUNTAG (a, Lisp_Vectorlike)) 592 (struct Lisp_Process *) XUNTAG (a, Lisp_Vectorlike))
591#define XWINDOW(a) (eassert (WINDOWP (a)), \ 593#define XWINDOW(a) (eassert (WINDOWP (a)), \
592 (struct window *) XUNTAG (a, Lisp_Vectorlike)) 594 (struct window *) XUNTAG (a, Lisp_Vectorlike))
593#define XTERMINAL(a) (eassert (TERMINALP (a)), \ 595#define XTERMINAL(a) (eassert (TERMINALP (a)), \
594 (struct terminal *) XUNTAG (a, Lisp_Vectorlike)) 596 (struct terminal *) XUNTAG (a, Lisp_Vectorlike))
diff --git a/src/lread.c b/src/lread.c
index 15821662fc8..3ca644bb45b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3557,7 +3557,7 @@ read_list (bool flag, Lisp_Object readcharfun)
3557 { 3557 {
3558 if (NILP (Vdoc_file_name)) 3558 if (NILP (Vdoc_file_name))
3559 /* We have not yet called Snarf-documentation, so assume 3559 /* We have not yet called Snarf-documentation, so assume
3560 this file is described in the DOC-MM.NN file 3560 this file is described in the DOC file
3561 and Snarf-documentation will fill in the right value later. 3561 and Snarf-documentation will fill in the right value later.
3562 For now, replace the whole list with 0. */ 3562 For now, replace the whole list with 0. */
3563 doc_reference = 1; 3563 doc_reference = 1;
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 3484d6c70c8..272b053ed12 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -41,7 +41,7 @@ TRES = $(BLD)/emacs.res
41TLASTLIB = $(BLD)/lastfile.$(A) 41TLASTLIB = $(BLD)/lastfile.$(A)
42GNULIB = ../lib/$(BLD)/libgnu.$(A) 42GNULIB = ../lib/$(BLD)/libgnu.$(A)
43 43
44DOC = $(OBJDIR)/etc/DOC-X 44DOC = $(OBJDIR)/etc/DOC
45 45
46FULL_LINK_FLAGS = $(LINK_FLAGS) $(TEMACS_EXTRA_LINK) 46FULL_LINK_FLAGS = $(LINK_FLAGS) $(TEMACS_EXTRA_LINK)
47 47
diff --git a/src/process.c b/src/process.c
index 911a30bc808..46385fa096b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -174,6 +174,8 @@ static Lisp_Object QClocal, QCremote, QCcoding;
174static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; 174static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
175static Lisp_Object QCsentinel, QClog, QCoptions, QCplist; 175static Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
176static Lisp_Object Qlast_nonmenu_event; 176static Lisp_Object Qlast_nonmenu_event;
177static Lisp_Object Qinternal_default_process_sentinel;
178static Lisp_Object Qinternal_default_process_filter;
177 179
178#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork)) 180#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork))
179#define NETCONN1_P(p) (EQ (p->type, Qnetwork)) 181#define NETCONN1_P(p) (EQ (p->type, Qnetwork))
@@ -359,7 +361,7 @@ pset_encoding_buf (struct Lisp_Process *p, Lisp_Object val)
359static void 361static void
360pset_filter (struct Lisp_Process *p, Lisp_Object val) 362pset_filter (struct Lisp_Process *p, Lisp_Object val)
361{ 363{
362 p->filter = val; 364 p->filter = NILP (val) ? Qinternal_default_process_filter : val;
363} 365}
364static void 366static void
365pset_log (struct Lisp_Process *p, Lisp_Object val) 367pset_log (struct Lisp_Process *p, Lisp_Object val)
@@ -384,7 +386,7 @@ pset_plist (struct Lisp_Process *p, Lisp_Object val)
384static void 386static void
385pset_sentinel (struct Lisp_Process *p, Lisp_Object val) 387pset_sentinel (struct Lisp_Process *p, Lisp_Object val)
386{ 388{
387 p->sentinel = val; 389 p->sentinel = NILP (val) ? Qinternal_default_process_sentinel : val;
388} 390}
389static void 391static void
390pset_status (struct Lisp_Process *p, Lisp_Object val) 392pset_status (struct Lisp_Process *p, Lisp_Object val)
@@ -700,6 +702,8 @@ make_process (Lisp_Object name)
700 } 702 }
701 name = name1; 703 name = name1;
702 pset_name (p, name); 704 pset_name (p, name);
705 pset_sentinel (p, Qinternal_default_process_sentinel);
706 pset_filter (p, Qinternal_default_process_filter);
703 XSETPROCESS (val, p); 707 XSETPROCESS (val, p);
704 Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist); 708 Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist);
705 return val; 709 return val;
@@ -979,10 +983,10 @@ DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
979 983
980DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, 984DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter,
981 2, 2, 0, 985 2, 2, 0,
982 doc: /* Give PROCESS the filter function FILTER; nil means no filter. 986 doc: /* Give PROCESS the filter function FILTER; nil means default.
983A value of t means stop accepting output from the process. 987A value of t means stop accepting output from the process.
984 988
985When a process has a filter, its buffer is not used for output. 989When a process has a non-default filter, its buffer is not used for output.
986Instead, each time it does output, the entire string of output is 990Instead, each time it does output, the entire string of output is
987passed to the filter. 991passed to the filter.
988 992
@@ -1008,6 +1012,9 @@ The string argument is normally a multibyte string, except:
1008 (debug) 1012 (debug)
1009 (set-process-filter process ...) */ 1013 (set-process-filter process ...) */
1010 1014
1015 if (NILP (filter))
1016 filter = Qinternal_default_process_filter;
1017
1011 if (p->infd >= 0) 1018 if (p->infd >= 0)
1012 { 1019 {
1013 if (EQ (filter, Qt) && !EQ (p->status, Qlisten)) 1020 if (EQ (filter, Qt) && !EQ (p->status, Qlisten))
@@ -1033,7 +1040,7 @@ The string argument is normally a multibyte string, except:
1033 1040
1034DEFUN ("process-filter", Fprocess_filter, Sprocess_filter, 1041DEFUN ("process-filter", Fprocess_filter, Sprocess_filter,
1035 1, 1, 0, 1042 1, 1, 0,
1036 doc: /* Returns the filter function of PROCESS; nil if none. 1043 doc: /* Return the filter function of PROCESS.
1037See `set-process-filter' for more info on filter functions. */) 1044See `set-process-filter' for more info on filter functions. */)
1038 (register Lisp_Object process) 1045 (register Lisp_Object process)
1039{ 1046{
@@ -1043,7 +1050,7 @@ See `set-process-filter' for more info on filter functions. */)
1043 1050
1044DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, 1051DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel,
1045 2, 2, 0, 1052 2, 2, 0,
1046 doc: /* Give PROCESS the sentinel SENTINEL; nil for none. 1053 doc: /* Give PROCESS the sentinel SENTINEL; nil for default.
1047The sentinel is called as a function when the process changes state. 1054The sentinel is called as a function when the process changes state.
1048It gets two arguments: the process, and a string describing the change. */) 1055It gets two arguments: the process, and a string describing the change. */)
1049 (register Lisp_Object process, Lisp_Object sentinel) 1056 (register Lisp_Object process, Lisp_Object sentinel)
@@ -1053,6 +1060,9 @@ It gets two arguments: the process, and a string describing the change. */)
1053 CHECK_PROCESS (process); 1060 CHECK_PROCESS (process);
1054 p = XPROCESS (process); 1061 p = XPROCESS (process);
1055 1062
1063 if (NILP (sentinel))
1064 sentinel = Qinternal_default_process_sentinel;
1065
1056 pset_sentinel (p, sentinel); 1066 pset_sentinel (p, sentinel);
1057 if (NETCONN1_P (p) || SERIALCONN1_P (p)) 1067 if (NETCONN1_P (p) || SERIALCONN1_P (p))
1058 pset_childp (p, Fplist_put (p->childp, QCsentinel, sentinel)); 1068 pset_childp (p, Fplist_put (p->childp, QCsentinel, sentinel));
@@ -1061,7 +1071,7 @@ It gets two arguments: the process, and a string describing the change. */)
1061 1071
1062DEFUN ("process-sentinel", Fprocess_sentinel, Sprocess_sentinel, 1072DEFUN ("process-sentinel", Fprocess_sentinel, Sprocess_sentinel,
1063 1, 1, 0, 1073 1, 1, 0,
1064 doc: /* Return the sentinel of PROCESS; nil if none. 1074 doc: /* Return the sentinel of PROCESS.
1065See `set-process-sentinel' for more info on sentinels. */) 1075See `set-process-sentinel' for more info on sentinels. */)
1066 (register Lisp_Object process) 1076 (register Lisp_Object process)
1067{ 1077{
@@ -1378,8 +1388,8 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1378 pset_plist (XPROCESS (proc), Qnil); 1388 pset_plist (XPROCESS (proc), Qnil);
1379 pset_type (XPROCESS (proc), Qreal); 1389 pset_type (XPROCESS (proc), Qreal);
1380 pset_buffer (XPROCESS (proc), buffer); 1390 pset_buffer (XPROCESS (proc), buffer);
1381 pset_sentinel (XPROCESS (proc), Qnil); 1391 pset_sentinel (XPROCESS (proc), Qinternal_default_process_sentinel);
1382 pset_filter (XPROCESS (proc), Qnil); 1392 pset_filter (XPROCESS (proc), Qinternal_default_process_filter);
1383 pset_command (XPROCESS (proc), Flist (nargs - 2, args + 2)); 1393 pset_command (XPROCESS (proc), Flist (nargs - 2, args + 2));
1384 1394
1385#ifdef HAVE_GNUTLS 1395#ifdef HAVE_GNUTLS
@@ -4039,7 +4049,8 @@ server_accept_connection (Lisp_Object server, int channel)
4039 process name of the server process concatenated with the caller 4049 process name of the server process concatenated with the caller
4040 identification. */ 4050 identification. */
4041 4051
4042 if (!NILP (ps->filter) && !EQ (ps->filter, Qt)) 4052 if (!(EQ (ps->filter, Qinternal_default_process_filter)
4053 || EQ (ps->filter, Qt)))
4043 buffer = Qnil; 4054 buffer = Qnil;
4044 else 4055 else
4045 { 4056 {
@@ -4108,7 +4119,7 @@ server_accept_connection (Lisp_Object server, int channel)
4108 /* Setup coding system for new process based on server process. 4119 /* Setup coding system for new process based on server process.
4109 This seems to be the proper thing to do, as the coding system 4120 This seems to be the proper thing to do, as the coding system
4110 of the new process should reflect the settings at the time the 4121 of the new process should reflect the settings at the time the
4111 server socket was opened; not the current settings. */ 4122 server socket was opened; not the current settings. */
4112 4123
4113 pset_decode_coding_system (p, ps->decode_coding_system); 4124 pset_decode_coding_system (p, ps->decode_coding_system);
4114 pset_encode_coding_system (p, ps->encode_coding_system); 4125 pset_encode_coding_system (p, ps->encode_coding_system);
@@ -4127,11 +4138,10 @@ server_accept_connection (Lisp_Object server, int channel)
4127 (STRINGP (host) ? host : build_string ("-")), 4138 (STRINGP (host) ? host : build_string ("-")),
4128 build_string ("\n"))); 4139 build_string ("\n")));
4129 4140
4130 if (!NILP (p->sentinel)) 4141 exec_sentinel (proc,
4131 exec_sentinel (proc, 4142 concat3 (build_string ("open from "),
4132 concat3 (build_string ("open from "), 4143 (STRINGP (host) ? host : build_string ("-")),
4133 (STRINGP (host) ? host : build_string ("-")), 4144 build_string ("\n")));
4134 build_string ("\n")));
4135} 4145}
4136 4146
4137/* This variable is different from waiting_for_input in keyboard.c. 4147/* This variable is different from waiting_for_input in keyboard.c.
@@ -4263,8 +4273,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4263 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) 4273 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
4264 break; 4274 break;
4265 4275
4266 /* Compute time from now till when time limit is up */ 4276 /* Compute time from now till when time limit is up. */
4267 /* Exit if already run out */ 4277 /* Exit if already run out. */
4268 if (nsecs < 0) 4278 if (nsecs < 0)
4269 { 4279 {
4270 /* A negative timeout means 4280 /* A negative timeout means
@@ -4871,8 +4881,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4871 } 4881 }
4872 } 4882 }
4873#endif /* NON_BLOCKING_CONNECT */ 4883#endif /* NON_BLOCKING_CONNECT */
4874 } /* end for each file descriptor */ 4884 } /* End for each file descriptor. */
4875 } /* end while exit conditions not met */ 4885 } /* End while exit conditions not met. */
4876 4886
4877 unbind_to (count, Qnil); 4887 unbind_to (count, Qnil);
4878 4888
@@ -4907,6 +4917,11 @@ read_process_output_error_handler (Lisp_Object error_val)
4907 return Qt; 4917 return Qt;
4908} 4918}
4909 4919
4920static void
4921read_and_dispose_of_process_output (struct Lisp_Process *p, char *chars,
4922 ssize_t nbytes,
4923 struct coding_system *coding);
4924
4910/* Read pending output from the process channel, 4925/* Read pending output from the process channel,
4911 starting with our buffered-ahead character if we have one. 4926 starting with our buffered-ahead character if we have one.
4912 Yield number of decoded characters read. 4927 Yield number of decoded characters read.
@@ -4923,9 +4938,7 @@ read_process_output (Lisp_Object proc, register int channel)
4923{ 4938{
4924 register ssize_t nbytes; 4939 register ssize_t nbytes;
4925 char *chars; 4940 char *chars;
4926 register Lisp_Object outstream;
4927 register struct Lisp_Process *p = XPROCESS (proc); 4941 register struct Lisp_Process *p = XPROCESS (proc);
4928 register ptrdiff_t opoint;
4929 struct coding_system *coding = proc_decode_coding_system[channel]; 4942 struct coding_system *coding = proc_decode_coding_system[channel];
4930 int carryover = p->decoding_carryover; 4943 int carryover = p->decoding_carryover;
4931 int readmax = 4096; 4944 int readmax = 4096;
@@ -5013,122 +5026,144 @@ read_process_output (Lisp_Object proc, register int channel)
5013 friends don't expect current-buffer to be changed from under them. */ 5026 friends don't expect current-buffer to be changed from under them. */
5014 record_unwind_current_buffer (); 5027 record_unwind_current_buffer ();
5015 5028
5016 /* Read and dispose of the process output. */ 5029 read_and_dispose_of_process_output (p, chars, nbytes, coding);
5017 outstream = p->filter; 5030
5018 if (!NILP (outstream)) 5031 /* Handling the process output should not deactivate the mark. */
5019 { 5032 Vdeactivate_mark = odeactivate;
5020 Lisp_Object text; 5033
5021 bool outer_running_asynch_code = running_asynch_code; 5034 unbind_to (count, Qnil);
5022 int waiting = waiting_for_user_input_p; 5035 return nbytes;
5036}
5037
5038static void
5039read_and_dispose_of_process_output (struct Lisp_Process *p, char *chars,
5040 ssize_t nbytes,
5041 struct coding_system *coding)
5042{
5043 Lisp_Object outstream = p->filter;
5044 Lisp_Object text;
5045 bool outer_running_asynch_code = running_asynch_code;
5046 int waiting = waiting_for_user_input_p;
5023 5047
5024 /* No need to gcpro these, because all we do with them later 5048 /* No need to gcpro these, because all we do with them later
5025 is test them for EQness, and none of them should be a string. */ 5049 is test them for EQness, and none of them should be a string. */
5026#if 0 5050#if 0
5027 Lisp_Object obuffer, okeymap; 5051 Lisp_Object obuffer, okeymap;
5028 XSETBUFFER (obuffer, current_buffer); 5052 XSETBUFFER (obuffer, current_buffer);
5029 okeymap = BVAR (current_buffer, keymap); 5053 okeymap = BVAR (current_buffer, keymap);
5030#endif 5054#endif
5031 5055
5032 /* We inhibit quit here instead of just catching it so that 5056 /* We inhibit quit here instead of just catching it so that
5033 hitting ^G when a filter happens to be running won't screw 5057 hitting ^G when a filter happens to be running won't screw
5034 it up. */ 5058 it up. */
5035 specbind (Qinhibit_quit, Qt); 5059 specbind (Qinhibit_quit, Qt);
5036 specbind (Qlast_nonmenu_event, Qt); 5060 specbind (Qlast_nonmenu_event, Qt);
5037
5038 /* In case we get recursively called,
5039 and we already saved the match data nonrecursively,
5040 save the same match data in safely recursive fashion. */
5041 if (outer_running_asynch_code)
5042 {
5043 Lisp_Object tem;
5044 /* Don't clobber the CURRENT match data, either! */
5045 tem = Fmatch_data (Qnil, Qnil, Qnil);
5046 restore_search_regs ();
5047 record_unwind_save_match_data ();
5048 Fset_match_data (tem, Qt);
5049 }
5050 5061
5051 /* For speed, if a search happens within this code, 5062 /* In case we get recursively called,
5052 save the match data in a special nonrecursive fashion. */ 5063 and we already saved the match data nonrecursively,
5053 running_asynch_code = 1; 5064 save the same match data in safely recursive fashion. */
5065 if (outer_running_asynch_code)
5066 {
5067 Lisp_Object tem;
5068 /* Don't clobber the CURRENT match data, either! */
5069 tem = Fmatch_data (Qnil, Qnil, Qnil);
5070 restore_search_regs ();
5071 record_unwind_save_match_data ();
5072 Fset_match_data (tem, Qt);
5073 }
5054 5074
5055 decode_coding_c_string (coding, (unsigned char *) chars, nbytes, Qt); 5075 /* For speed, if a search happens within this code,
5056 text = coding->dst_object; 5076 save the match data in a special nonrecursive fashion. */
5057 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5077 running_asynch_code = 1;
5058 /* A new coding system might be found. */
5059 if (!EQ (p->decode_coding_system, Vlast_coding_system_used))
5060 {
5061 pset_decode_coding_system (p, Vlast_coding_system_used);
5062 5078
5063 /* Don't call setup_coding_system for 5079 decode_coding_c_string (coding, (unsigned char *) chars, nbytes, Qt);
5064 proc_decode_coding_system[channel] here. It is done in 5080 text = coding->dst_object;
5065 detect_coding called via decode_coding above. */ 5081 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5082 /* A new coding system might be found. */
5083 if (!EQ (p->decode_coding_system, Vlast_coding_system_used))
5084 {
5085 pset_decode_coding_system (p, Vlast_coding_system_used);
5066 5086
5067 /* If a coding system for encoding is not yet decided, we set 5087 /* Don't call setup_coding_system for
5068 it as the same as coding-system for decoding. 5088 proc_decode_coding_system[channel] here. It is done in
5089 detect_coding called via decode_coding above. */
5069 5090
5070 But, before doing that we must check if 5091 /* If a coding system for encoding is not yet decided, we set
5071 proc_encode_coding_system[p->outfd] surely points to a 5092 it as the same as coding-system for decoding.
5072 valid memory because p->outfd will be changed once EOF is
5073 sent to the process. */
5074 if (NILP (p->encode_coding_system)
5075 && proc_encode_coding_system[p->outfd])
5076 {
5077 pset_encode_coding_system
5078 (p, coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
5079 setup_coding_system (p->encode_coding_system,
5080 proc_encode_coding_system[p->outfd]);
5081 }
5082 }
5083 5093
5084 if (coding->carryover_bytes > 0) 5094 But, before doing that we must check if
5095 proc_encode_coding_system[p->outfd] surely points to a
5096 valid memory because p->outfd will be changed once EOF is
5097 sent to the process. */
5098 if (NILP (p->encode_coding_system)
5099 && proc_encode_coding_system[p->outfd])
5085 { 5100 {
5086 if (SCHARS (p->decoding_buf) < coding->carryover_bytes) 5101 pset_encode_coding_system
5087 pset_decoding_buf (p, make_uninit_string (coding->carryover_bytes)); 5102 (p, coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
5088 memcpy (SDATA (p->decoding_buf), coding->carryover, 5103 setup_coding_system (p->encode_coding_system,
5089 coding->carryover_bytes); 5104 proc_encode_coding_system[p->outfd]);
5090 p->decoding_carryover = coding->carryover_bytes;
5091 } 5105 }
5092 if (SBYTES (text) > 0) 5106 }
5093 /* FIXME: It's wrong to wrap or not based on debug-on-error, and
5094 sometimes it's simply wrong to wrap (e.g. when called from
5095 accept-process-output). */
5096 internal_condition_case_1 (read_process_output_call,
5097 Fcons (outstream,
5098 Fcons (proc, Fcons (text, Qnil))),
5099 !NILP (Vdebug_on_error) ? Qnil : Qerror,
5100 read_process_output_error_handler);
5101
5102 /* If we saved the match data nonrecursively, restore it now. */
5103 restore_search_regs ();
5104 running_asynch_code = outer_running_asynch_code;
5105 5107
5106 /* Restore waiting_for_user_input_p as it was 5108 if (coding->carryover_bytes > 0)
5107 when we were called, in case the filter clobbered it. */ 5109 {
5108 waiting_for_user_input_p = waiting; 5110 if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
5111 pset_decoding_buf (p, make_uninit_string (coding->carryover_bytes));
5112 memcpy (SDATA (p->decoding_buf), coding->carryover,
5113 coding->carryover_bytes);
5114 p->decoding_carryover = coding->carryover_bytes;
5115 }
5116 if (SBYTES (text) > 0)
5117 /* FIXME: It's wrong to wrap or not based on debug-on-error, and
5118 sometimes it's simply wrong to wrap (e.g. when called from
5119 accept-process-output). */
5120 internal_condition_case_1 (read_process_output_call,
5121 Fcons (outstream,
5122 Fcons (make_lisp_proc (p),
5123 Fcons (text, Qnil))),
5124 !NILP (Vdebug_on_error) ? Qnil : Qerror,
5125 read_process_output_error_handler);
5126
5127 /* If we saved the match data nonrecursively, restore it now. */
5128 restore_search_regs ();
5129 running_asynch_code = outer_running_asynch_code;
5130
5131 /* Restore waiting_for_user_input_p as it was
5132 when we were called, in case the filter clobbered it. */
5133 waiting_for_user_input_p = waiting;
5109 5134
5110#if 0 /* Call record_asynch_buffer_change unconditionally, 5135#if 0 /* Call record_asynch_buffer_change unconditionally,
5111 because we might have changed minor modes or other things 5136 because we might have changed minor modes or other things
5112 that affect key bindings. */ 5137 that affect key bindings. */
5113 if (! EQ (Fcurrent_buffer (), obuffer) 5138 if (! EQ (Fcurrent_buffer (), obuffer)
5114 || ! EQ (current_buffer->keymap, okeymap)) 5139 || ! EQ (current_buffer->keymap, okeymap))
5115#endif 5140#endif
5116 /* But do it only if the caller is actually going to read events. 5141 /* But do it only if the caller is actually going to read events.
5117 Otherwise there's no need to make him wake up, and it could 5142 Otherwise there's no need to make him wake up, and it could
5118 cause trouble (for example it would make sit_for return). */ 5143 cause trouble (for example it would make sit_for return). */
5119 if (waiting_for_user_input_p == -1) 5144 if (waiting_for_user_input_p == -1)
5120 record_asynch_buffer_change (); 5145 record_asynch_buffer_change ();
5121 } 5146}
5147
5148DEFUN ("internal-default-process-filter", Finternal_default_process_filter,
5149 Sinternal_default_process_filter, 2, 2, 0,
5150 doc: /* Function used as default process filter. */)
5151 (Lisp_Object proc, Lisp_Object text)
5152{
5153 struct Lisp_Process *p;
5154 ptrdiff_t opoint;
5122 5155
5123 /* If no filter, write into buffer if it isn't dead. */ 5156 CHECK_PROCESS (proc);
5124 else if (!NILP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer))) 5157 p = XPROCESS (proc);
5158 CHECK_STRING (text);
5159
5160 if (!NILP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer)))
5125 { 5161 {
5126 Lisp_Object old_read_only; 5162 Lisp_Object old_read_only;
5127 ptrdiff_t old_begv, old_zv; 5163 ptrdiff_t old_begv, old_zv;
5128 ptrdiff_t old_begv_byte, old_zv_byte; 5164 ptrdiff_t old_begv_byte, old_zv_byte;
5129 ptrdiff_t before, before_byte; 5165 ptrdiff_t before, before_byte;
5130 ptrdiff_t opoint_byte; 5166 ptrdiff_t opoint_byte;
5131 Lisp_Object text;
5132 struct buffer *b; 5167 struct buffer *b;
5133 5168
5134 Fset_buffer (p->buffer); 5169 Fset_buffer (p->buffer);
@@ -5161,31 +5196,6 @@ read_process_output (Lisp_Object proc, register int channel)
5161 if (! (BEGV <= PT && PT <= ZV)) 5196 if (! (BEGV <= PT && PT <= ZV))
5162 Fwiden (); 5197 Fwiden ();
5163 5198
5164 decode_coding_c_string (coding, (unsigned char *) chars, nbytes, Qt);
5165 text = coding->dst_object;
5166 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5167 /* A new coding system might be found. See the comment in the
5168 similar code in the previous `if' block. */
5169 if (!EQ (p->decode_coding_system, Vlast_coding_system_used))
5170 {
5171 pset_decode_coding_system (p, Vlast_coding_system_used);
5172 if (NILP (p->encode_coding_system)
5173 && proc_encode_coding_system[p->outfd])
5174 {
5175 pset_encode_coding_system
5176 (p, coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
5177 setup_coding_system (p->encode_coding_system,
5178 proc_encode_coding_system[p->outfd]);
5179 }
5180 }
5181 if (coding->carryover_bytes > 0)
5182 {
5183 if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
5184 pset_decoding_buf (p, make_uninit_string (coding->carryover_bytes));
5185 memcpy (SDATA (p->decoding_buf), coding->carryover,
5186 coding->carryover_bytes);
5187 p->decoding_carryover = coding->carryover_bytes;
5188 }
5189 /* Adjust the multibyteness of TEXT to that of the buffer. */ 5199 /* Adjust the multibyteness of TEXT to that of the buffer. */
5190 if (NILP (BVAR (current_buffer, enable_multibyte_characters)) 5200 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
5191 != ! STRING_MULTIBYTE (text)) 5201 != ! STRING_MULTIBYTE (text))
@@ -5230,18 +5240,13 @@ read_process_output (Lisp_Object proc, register int channel)
5230 if (old_begv != BEGV || old_zv != ZV) 5240 if (old_begv != BEGV || old_zv != ZV)
5231 Fnarrow_to_region (make_number (old_begv), make_number (old_zv)); 5241 Fnarrow_to_region (make_number (old_begv), make_number (old_zv));
5232 5242
5233
5234 bset_read_only (current_buffer, old_read_only); 5243 bset_read_only (current_buffer, old_read_only);
5235 SET_PT_BOTH (opoint, opoint_byte); 5244 SET_PT_BOTH (opoint, opoint_byte);
5236 } 5245 }
5237 /* Handling the process output should not deactivate the mark. */ 5246 return Qnil;
5238 Vdeactivate_mark = odeactivate;
5239
5240 unbind_to (count, Qnil);
5241 return nbytes;
5242} 5247}
5243 5248
5244/* Sending data to subprocess */ 5249/* Sending data to subprocess. */
5245 5250
5246/* In send_process, when a write fails temporarily, 5251/* In send_process, when a write fails temporarily,
5247 wait_reading_process_output is called. It may execute user code, 5252 wait_reading_process_output is called. It may execute user code,
@@ -6188,13 +6193,6 @@ deliver_child_signal (int sig)
6188 6193
6189 6194
6190static Lisp_Object 6195static Lisp_Object
6191exec_sentinel_unwind (Lisp_Object data)
6192{
6193 pset_sentinel (XPROCESS (XCAR (data)), XCDR (data));
6194 return Qnil;
6195}
6196
6197static Lisp_Object
6198exec_sentinel_error_handler (Lisp_Object error_val) 6196exec_sentinel_error_handler (Lisp_Object error_val)
6199{ 6197{
6200 cmd_error_internal (error_val, "error in process sentinel: "); 6198 cmd_error_internal (error_val, "error in process sentinel: ");
@@ -6231,13 +6229,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6231 record_unwind_current_buffer (); 6229 record_unwind_current_buffer ();
6232 6230
6233 sentinel = p->sentinel; 6231 sentinel = p->sentinel;
6234 if (NILP (sentinel))
6235 return;
6236 6232
6237 /* Zilch the sentinel while it's running, to avoid recursive invocations;
6238 assure that it gets restored no matter how the sentinel exits. */
6239 pset_sentinel (p, Qnil);
6240 record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel));
6241 /* Inhibit quit so that random quits don't screw up a running filter. */ 6233 /* Inhibit quit so that random quits don't screw up a running filter. */
6242 specbind (Qinhibit_quit, Qt); 6234 specbind (Qinhibit_quit, Qt);
6243 specbind (Qlast_nonmenu_event, Qt); /* Why? --Stef */ 6235 specbind (Qlast_nonmenu_event, Qt); /* Why? --Stef */
@@ -6295,7 +6287,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6295static void 6287static void
6296status_notify (struct Lisp_Process *deleting_process) 6288status_notify (struct Lisp_Process *deleting_process)
6297{ 6289{
6298 register Lisp_Object proc, buffer; 6290 register Lisp_Object proc;
6299 Lisp_Object tail, msg; 6291 Lisp_Object tail, msg;
6300 struct gcpro gcpro1, gcpro2; 6292 struct gcpro gcpro1, gcpro2;
6301 6293
@@ -6333,8 +6325,6 @@ status_notify (struct Lisp_Process *deleting_process)
6333 && p != deleting_process 6325 && p != deleting_process
6334 && read_process_output (proc, p->infd) > 0); 6326 && read_process_output (proc, p->infd) > 0);
6335 6327
6336 buffer = p->buffer;
6337
6338 /* Get the text to use for the message. */ 6328 /* Get the text to use for the message. */
6339 if (p->raw_status_new) 6329 if (p->raw_status_new)
6340 update_status (p); 6330 update_status (p);
@@ -6355,66 +6345,83 @@ status_notify (struct Lisp_Process *deleting_process)
6355 } 6345 }
6356 6346
6357 /* The actions above may have further incremented p->tick. 6347 /* The actions above may have further incremented p->tick.
6358 So set p->update_tick again 6348 So set p->update_tick again so that an error in the sentinel will
6359 so that an error in the sentinel will not cause 6349 not cause this code to be run again. */
6360 this code to be run again. */
6361 p->update_tick = p->tick; 6350 p->update_tick = p->tick;
6362 /* Now output the message suitably. */ 6351 /* Now output the message suitably. */
6363 if (!NILP (p->sentinel)) 6352 exec_sentinel (proc, msg);
6364 exec_sentinel (proc, msg);
6365 /* Don't bother with a message in the buffer
6366 when a process becomes runnable. */
6367 else if (!EQ (symbol, Qrun) && !NILP (buffer))
6368 {
6369 Lisp_Object tem;
6370 struct buffer *old = current_buffer;
6371 ptrdiff_t opoint, opoint_byte;
6372 ptrdiff_t before, before_byte;
6373
6374 /* Avoid error if buffer is deleted
6375 (probably that's why the process is dead, too) */
6376 if (!BUFFER_LIVE_P (XBUFFER (buffer)))
6377 continue;
6378 Fset_buffer (buffer);
6379
6380 opoint = PT;
6381 opoint_byte = PT_BYTE;
6382 /* Insert new output into buffer
6383 at the current end-of-output marker,
6384 thus preserving logical ordering of input and output. */
6385 if (XMARKER (p->mark)->buffer)
6386 Fgoto_char (p->mark);
6387 else
6388 SET_PT_BOTH (ZV, ZV_BYTE);
6389
6390 before = PT;
6391 before_byte = PT_BYTE;
6392
6393 tem = BVAR (current_buffer, read_only);
6394 bset_read_only (current_buffer, Qnil);
6395 insert_string ("\nProcess ");
6396 { /* FIXME: temporary kludge */
6397 Lisp_Object tem2 = p->name; Finsert (1, &tem2); }
6398 insert_string (" ");
6399 Finsert (1, &msg);
6400 bset_read_only (current_buffer, tem);
6401 set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
6402
6403 if (opoint >= before)
6404 SET_PT_BOTH (opoint + (PT - before),
6405 opoint_byte + (PT_BYTE - before_byte));
6406 else
6407 SET_PT_BOTH (opoint, opoint_byte);
6408
6409 set_buffer_internal (old);
6410 }
6411 } 6353 }
6412 } /* end for */ 6354 } /* end for */
6413 6355
6414 update_mode_lines++; /* in case buffers use %s in mode-line-format */ 6356 update_mode_lines++; /* In case buffers use %s in mode-line-format. */
6415 UNGCPRO; 6357 UNGCPRO;
6416} 6358}
6417 6359
6360DEFUN ("internal-default-process-sentinel", Finternal_default_process_sentinel,
6361 Sinternal_default_process_sentinel, 2, 2, 0,
6362 doc: /* Function used as default sentinel for processes. */)
6363 (Lisp_Object proc, Lisp_Object msg)
6364{
6365 Lisp_Object buffer, symbol;
6366 struct Lisp_Process *p;
6367 CHECK_PROCESS (proc);
6368 p = XPROCESS (proc);
6369 buffer = p->buffer;
6370 symbol = p->status;
6371 if (CONSP (symbol))
6372 symbol = XCAR (symbol);
6373
6374 if (!EQ (symbol, Qrun) && !NILP (buffer))
6375 {
6376 Lisp_Object tem;
6377 struct buffer *old = current_buffer;
6378 ptrdiff_t opoint, opoint_byte;
6379 ptrdiff_t before, before_byte;
6380
6381 /* Avoid error if buffer is deleted
6382 (probably that's why the process is dead, too). */
6383 if (!BUFFER_LIVE_P (XBUFFER (buffer)))
6384 return Qnil;
6385 Fset_buffer (buffer);
6386
6387 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
6388 msg = (code_convert_string_norecord
6389 (msg, Vlocale_coding_system, 1));
6390
6391 opoint = PT;
6392 opoint_byte = PT_BYTE;
6393 /* Insert new output into buffer
6394 at the current end-of-output marker,
6395 thus preserving logical ordering of input and output. */
6396 if (XMARKER (p->mark)->buffer)
6397 Fgoto_char (p->mark);
6398 else
6399 SET_PT_BOTH (ZV, ZV_BYTE);
6400
6401 before = PT;
6402 before_byte = PT_BYTE;
6403
6404 tem = BVAR (current_buffer, read_only);
6405 bset_read_only (current_buffer, Qnil);
6406 insert_string ("\nProcess ");
6407 { /* FIXME: temporary kludge. */
6408 Lisp_Object tem2 = p->name; Finsert (1, &tem2); }
6409 insert_string (" ");
6410 Finsert (1, &msg);
6411 bset_read_only (current_buffer, tem);
6412 set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
6413
6414 if (opoint >= before)
6415 SET_PT_BOTH (opoint + (PT - before),
6416 opoint_byte + (PT_BYTE - before_byte));
6417 else
6418 SET_PT_BOTH (opoint, opoint_byte);
6419
6420 set_buffer_internal (old);
6421 }
6422 return Qnil;
6423}
6424
6418 6425
6419DEFUN ("set-process-coding-system", Fset_process_coding_system, 6426DEFUN ("set-process-coding-system", Fset_process_coding_system,
6420 Sset_process_coding_system, 1, 3, 0, 6427 Sset_process_coding_system, 1, 3, 0,
@@ -6606,13 +6613,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
6606 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) 6613 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
6607 break; 6614 break;
6608 6615
6609 /* Compute time from now till when time limit is up */ 6616 /* Compute time from now till when time limit is up. */
6610 /* Exit if already run out */ 6617 /* Exit if already run out. */
6611 if (nsecs < 0) 6618 if (nsecs < 0)
6612 { 6619 {
6613 /* A negative timeout means 6620 /* A negative timeout means
6614 gobble output available now 6621 gobble output available now
6615 but don't wait at all. */ 6622 but don't wait at all. */
6616 6623
6617 timeout = make_emacs_time (0, 0); 6624 timeout = make_emacs_time (0, 0);
6618 } 6625 }
@@ -6805,9 +6812,8 @@ setup_process_coding_systems (Lisp_Object process)
6805 if (!proc_decode_coding_system[inch]) 6812 if (!proc_decode_coding_system[inch])
6806 proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system)); 6813 proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system));
6807 coding_system = p->decode_coding_system; 6814 coding_system = p->decode_coding_system;
6808 if (! NILP (p->filter)) 6815 if (EQ (p->filter, Qinternal_default_process_filter)
6809 ; 6816 && BUFFERP (p->buffer))
6810 else if (BUFFERP (p->buffer))
6811 { 6817 {
6812 if (NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters))) 6818 if (NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters)))
6813 coding_system = raw_text_coding_system (coding_system); 6819 coding_system = raw_text_coding_system (coding_system);
@@ -6916,7 +6922,7 @@ kill_buffer_processes (Lisp_Object buffer)
6916 6922
6917DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, 6923DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p,
6918 Swaiting_for_user_input_p, 0, 0, 0, 6924 Swaiting_for_user_input_p, 0, 0, 0,
6919 doc: /* Returns non-nil if Emacs is waiting for input from the user. 6925 doc: /* Return non-nil if Emacs is waiting for input from the user.
6920This is intended for use by asynchronous process output filters and sentinels. */) 6926This is intended for use by asynchronous process output filters and sentinels. */)
6921 (void) 6927 (void)
6922{ 6928{
@@ -7222,6 +7228,10 @@ syms_of_process (void)
7222 DEFSYM (Qcutime, "cutime"); 7228 DEFSYM (Qcutime, "cutime");
7223 DEFSYM (Qcstime, "cstime"); 7229 DEFSYM (Qcstime, "cstime");
7224 DEFSYM (Qctime, "ctime"); 7230 DEFSYM (Qctime, "ctime");
7231 DEFSYM (Qinternal_default_process_sentinel,
7232 "internal-default-process-sentinel");
7233 DEFSYM (Qinternal_default_process_filter,
7234 "internal-default-process-filter");
7225 DEFSYM (Qpri, "pri"); 7235 DEFSYM (Qpri, "pri");
7226 DEFSYM (Qnice, "nice"); 7236 DEFSYM (Qnice, "nice");
7227 DEFSYM (Qthcount, "thcount"); 7237 DEFSYM (Qthcount, "thcount");
@@ -7317,6 +7327,8 @@ The variable takes effect when `start-process' is called. */);
7317 defsubr (&Ssignal_process); 7327 defsubr (&Ssignal_process);
7318 defsubr (&Swaiting_for_user_input_p); 7328 defsubr (&Swaiting_for_user_input_p);
7319 defsubr (&Sprocess_type); 7329 defsubr (&Sprocess_type);
7330 defsubr (&Sinternal_default_process_sentinel);
7331 defsubr (&Sinternal_default_process_filter);
7320 defsubr (&Sset_process_coding_system); 7332 defsubr (&Sset_process_coding_system);
7321 defsubr (&Sprocess_coding_system); 7333 defsubr (&Sprocess_coding_system);
7322 defsubr (&Sset_process_filter_multibyte); 7334 defsubr (&Sset_process_filter_multibyte);