aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-09-23 15:00:31 -0400
committerChong Yidong2010-09-23 15:00:31 -0400
commit266a86bd7fedf743225c2497956b73ecb2245196 (patch)
tree7d0c8b128070eac293ce2606acb4e55de5843ba8
parent29cdc13ed61e5a64ba30df1030029898a26b7947 (diff)
parentaf3ccb5cc061bccab1c9b024ea444d01c0767767 (diff)
downloademacs-266a86bd7fedf743225c2497956b73ecb2245196.tar.gz
emacs-266a86bd7fedf743225c2497956b73ecb2245196.zip
Merge changes from emacs-23 branch
-rw-r--r--doc/lispintro/ChangeLog6
-rw-r--r--doc/lispintro/cons-1.eps9
-rw-r--r--doc/lispintro/cons-2.eps9
-rw-r--r--doc/lispintro/cons-2a.eps9
-rw-r--r--doc/lispintro/cons-3.eps9
-rw-r--r--doc/lispintro/cons-4.eps9
-rw-r--r--doc/lispintro/cons-5.eps9
-rw-r--r--doc/lispintro/lambda-1.eps9
-rw-r--r--doc/lispintro/lambda-2.eps9
-rw-r--r--doc/lispintro/lambda-3.eps9
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS.232
-rw-r--r--etc/srecode/java.srt2
-rw-r--r--lisp/ChangeLog1057
-rw-r--r--lisp/calculator.el5
-rw-r--r--lisp/calendar/appt.el71
-rw-r--r--lisp/calendar/diary-lib.el16
-rw-r--r--lisp/calendar/solar.el6
-rw-r--r--lisp/cedet/ChangeLog1436
-rw-r--r--lisp/cedet/cedet-cscope.el26
-rw-r--r--lisp/cedet/cedet-global.el31
-rw-r--r--lisp/cedet/cedet-idutils.el25
-rw-r--r--lisp/cedet/cedet.el14
-rw-r--r--lisp/cedet/ede.el947
-rw-r--r--lisp/cedet/ede/auto.el128
-rw-r--r--lisp/cedet/ede/autoconf-edit.el64
-rw-r--r--lisp/cedet/ede/base.el636
-rw-r--r--lisp/cedet/ede/cpp-root.el27
-rw-r--r--lisp/cedet/ede/custom.el215
-rw-r--r--lisp/cedet/ede/dired.el8
-rw-r--r--lisp/cedet/ede/emacs.el14
-rw-r--r--lisp/cedet/ede/files.el147
-rw-r--r--lisp/cedet/ede/generic.el442
-rw-r--r--lisp/cedet/ede/linux.el14
-rw-r--r--lisp/cedet/ede/locate.el28
-rw-r--r--lisp/cedet/ede/pconf.el6
-rw-r--r--lisp/cedet/ede/pmake.el27
-rw-r--r--lisp/cedet/ede/proj-archive.el2
-rw-r--r--lisp/cedet/ede/proj-aux.el2
-rw-r--r--lisp/cedet/ede/proj-elisp.el6
-rw-r--r--lisp/cedet/ede/proj-info.el6
-rw-r--r--lisp/cedet/ede/proj-misc.el4
-rw-r--r--lisp/cedet/ede/proj-obj.el90
-rw-r--r--lisp/cedet/ede/proj-prog.el64
-rw-r--r--lisp/cedet/ede/proj-shared.el20
-rw-r--r--lisp/cedet/ede/proj.el38
-rw-r--r--lisp/cedet/ede/project-am.el435
-rw-r--r--lisp/cedet/ede/shell.el2
-rw-r--r--lisp/cedet/ede/simple.el12
-rw-r--r--lisp/cedet/ede/speedbar.el2
-rw-r--r--lisp/cedet/ede/srecode.el4
-rw-r--r--lisp/cedet/pulse.el44
-rw-r--r--lisp/cedet/semantic.el9
-rw-r--r--lisp/cedet/semantic/analyze.el15
-rw-r--r--lisp/cedet/semantic/analyze/complete.el67
-rw-r--r--lisp/cedet/semantic/analyze/debug.el43
-rw-r--r--lisp/cedet/semantic/analyze/refs.el50
-rw-r--r--lisp/cedet/semantic/bovine/c.el205
-rw-r--r--lisp/cedet/semantic/complete.el82
-rw-r--r--lisp/cedet/semantic/ctxt.el18
-rw-r--r--lisp/cedet/semantic/db-file.el2
-rw-r--r--lisp/cedet/semantic/db-find.el25
-rw-r--r--lisp/cedet/semantic/db-global.el2
-rw-r--r--lisp/cedet/semantic/db-typecache.el45
-rw-r--r--lisp/cedet/semantic/db.el35
-rw-r--r--lisp/cedet/semantic/decorate.el2
-rw-r--r--lisp/cedet/semantic/decorate/include.el25
-rw-r--r--lisp/cedet/semantic/dep.el3
-rw-r--r--lisp/cedet/semantic/doc.el3
-rw-r--r--lisp/cedet/semantic/fw.el11
-rw-r--r--lisp/cedet/semantic/grammar.el6
-rw-r--r--lisp/cedet/semantic/html.el1
-rw-r--r--lisp/cedet/semantic/ia.el113
-rw-r--r--lisp/cedet/semantic/idle.el443
-rw-r--r--lisp/cedet/semantic/imenu.el2
-rw-r--r--lisp/cedet/semantic/lex-spp.el69
-rw-r--r--lisp/cedet/semantic/scope.el11
-rw-r--r--lisp/cedet/semantic/sort.el4
-rw-r--r--lisp/cedet/semantic/symref.el22
-rw-r--r--lisp/cedet/semantic/symref/grep.el30
-rw-r--r--lisp/cedet/semantic/symref/list.el234
-rw-r--r--lisp/cedet/semantic/tag.el24
-rw-r--r--lisp/cedet/semantic/texi.el8
-rw-r--r--lisp/cedet/semantic/util-modes.el91
-rw-r--r--lisp/cedet/semantic/util.el75
-rw-r--r--lisp/cedet/semantic/wisent/python-wy.el20
-rw-r--r--lisp/cedet/srecode.el2
-rw-r--r--lisp/cedet/srecode/compile.el129
-rw-r--r--lisp/cedet/srecode/cpp.el82
-rw-r--r--lisp/cedet/srecode/dictionary.el303
-rw-r--r--lisp/cedet/srecode/fields.el16
-rw-r--r--lisp/cedet/srecode/find.el88
-rw-r--r--lisp/cedet/srecode/getset.el3
-rw-r--r--lisp/cedet/srecode/insert.el162
-rw-r--r--lisp/cedet/srecode/map.el10
-rw-r--r--lisp/cedet/srecode/mode.el84
-rw-r--r--lisp/cedet/srecode/semantic.el10
-rw-r--r--lisp/cedet/srecode/table.el13
-rw-r--r--lisp/cedet/srecode/texi.el11
-rw-r--r--lisp/emacs-lisp/eieio.el299
-rw-r--r--lisp/emacs-lisp/float-sup.el16
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/message.el10
-rw-r--r--lisp/isearch.el24
-rw-r--r--lisp/net/net-utils.el6
-rw-r--r--lisp/newcomment.el3
-rw-r--r--lisp/play/bubbles.el2
-rw-r--r--lisp/textmodes/artist.el2
-rw-r--r--lisp/url/ChangeLog4
-rw-r--r--lisp/url/url-cache.el3
-rw-r--r--src/ChangeLog9
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/syntax.c11
113 files changed, 6070 insertions, 3250 deletions
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog
index 1ab06891961..ff227a1f119 100644
--- a/doc/lispintro/ChangeLog
+++ b/doc/lispintro/ChangeLog
@@ -1,3 +1,9 @@
12010-09-21 Glenn Morris <rgm@gnu.org>
2
3 * cons-1.eps, cons-2.eps, cons-2a.eps, cons-3.eps, cons-4.eps:
4 * cons-5.eps, lambda-1.eps, lambda-2.eps, lambda-3.eps:
5 Add first line EPSF magic comment. (Bug#7064)
6
12010-06-23 Glenn Morris <rgm@gnu.org> 72010-06-23 Glenn Morris <rgm@gnu.org>
2 8
3 * emacs-lisp-intro.texi: Untabify. 9 * emacs-lisp-intro.texi: Untabify.
diff --git a/doc/lispintro/cons-1.eps b/doc/lispintro/cons-1.eps
index fbae699e21b..42c350139da 100644
--- a/doc/lispintro/cons-1.eps
+++ b/doc/lispintro/cons-1.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 35 711 289 757 2%%BoundingBox: 35 711 289 757
3%%Title: cons-cell-diagram1 3%%Title: cons-cell-diagram1
4%%CreationDate: Wed Mar 8 14:26:58 1995 4%%CreationDate: Wed Mar 8 14:26:58 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/cons-2.eps b/doc/lispintro/cons-2.eps
index 703a842e046..8ae9d8a9190 100644
--- a/doc/lispintro/cons-2.eps
+++ b/doc/lispintro/cons-2.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 15 712 321 775 2%%BoundingBox: 15 712 321 775
3%%Title: cons-cell-diagram2 3%%Title: cons-cell-diagram2
4%%CreationDate: Wed Mar 8 14:26:39 1995 4%%CreationDate: Wed Mar 8 14:26:39 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/cons-2a.eps b/doc/lispintro/cons-2a.eps
index 4d2ae666590..916417adf9c 100644
--- a/doc/lispintro/cons-2a.eps
+++ b/doc/lispintro/cons-2a.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 15 702 300 767 2%%BoundingBox: 15 702 300 767
3%%Title: cons-cell-diagram2a 3%%Title: cons-cell-diagram2a
4%%CreationDate: Tue Mar 14 15:09:30 1995 4%%CreationDate: Tue Mar 14 15:09:30 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/cons-3.eps b/doc/lispintro/cons-3.eps
index b1aa60c1c99..f6fddf0a32a 100644
--- a/doc/lispintro/cons-3.eps
+++ b/doc/lispintro/cons-3.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: -1 691 324 757 2%%BoundingBox: -1 691 324 757
3%%Title: cons-cell-diagram3 3%%Title: cons-cell-diagram3
4%%CreationDate: Wed Mar 8 14:25:41 1995 4%%CreationDate: Wed Mar 8 14:25:41 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/cons-4.eps b/doc/lispintro/cons-4.eps
index c61b47bcbce..77389632dfd 100644
--- a/doc/lispintro/cons-4.eps
+++ b/doc/lispintro/cons-4.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 6 681 355 758 2%%BoundingBox: 6 681 355 758
3%%Title: cons-cell-diagram4 3%%Title: cons-cell-diagram4
4%%CreationDate: Wed Mar 8 14:25:06 1995 4%%CreationDate: Wed Mar 8 14:25:06 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/cons-5.eps b/doc/lispintro/cons-5.eps
index 87c7f645b5e..67423d5354e 100644
--- a/doc/lispintro/cons-5.eps
+++ b/doc/lispintro/cons-5.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 15 680 305 764 2%%BoundingBox: 15 680 305 764
3%%Title: cons-cell-diagram5 3%%Title: cons-cell-diagram5
4%%CreationDate: Wed Mar 8 14:27:28 1995 4%%CreationDate: Wed Mar 8 14:27:28 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/lambda-1.eps b/doc/lispintro/lambda-1.eps
index f48bdf20ff7..3510c40e005 100644
--- a/doc/lispintro/lambda-1.eps
+++ b/doc/lispintro/lambda-1.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 33 710 173 759 2%%BoundingBox: 33 710 173 759
3%%Title: lambda-diagram1 3%%Title: lambda-diagram1
4%%CreationDate: Wed Mar 8 14:31:53 1995 4%%CreationDate: Wed Mar 8 14:31:53 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/lambda-2.eps b/doc/lispintro/lambda-2.eps
index 923d09657b8..f60c2b56ad3 100644
--- a/doc/lispintro/lambda-2.eps
+++ b/doc/lispintro/lambda-2.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 33 730 240 777 2%%BoundingBox: 33 730 240 777
3%%Title: lambda-diagram2 3%%Title: lambda-diagram2
4%%CreationDate: Wed Mar 8 14:33:09 1995 4%%CreationDate: Wed Mar 8 14:33:09 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/doc/lispintro/lambda-3.eps b/doc/lispintro/lambda-3.eps
index be7c0538e32..67c55093e7f 100644
--- a/doc/lispintro/lambda-3.eps
+++ b/doc/lispintro/lambda-3.eps
@@ -1,14 +1,11 @@
1%! 1%!PS-Adobe-3.0 EPSF-3.0
2%%BoundingBox: 33 728 211 777 2%%BoundingBox: 33 728 211 777
3%%Title: lambda-diagram3 3%%Title: lambda-diagram3
4%%CreationDate: Wed Mar 8 14:33:49 1995 4%%CreationDate: Wed Mar 8 14:33:49 1995
5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) 5%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
6%
7% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
8%
9 6
10% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
11% Free Software Foundation, Inc. 8% 2008, 2009, 2010 Free Software Foundation, Inc.
12% 9%
13% This file is part of GNU Emacs. 10% This file is part of GNU Emacs.
14% 11%
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 84754efb148..5b78767cfda 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12010-09-21 Eric Ludlam <zappo@gnu.org>
2
3 * srecode/java.srt: Make NAME be a prompt.
4
12010-09-13 Michael Albinus <michael.albinus@gmx.de> 52010-09-13 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * NEWS: Some Tramp methods are discontinued. 7 * NEWS: Some Tramp methods are discontinued.
diff --git a/etc/NEWS.23 b/etc/NEWS.23
index e63767d891c..bee89d368b5 100644
--- a/etc/NEWS.23
+++ b/etc/NEWS.23
@@ -40,6 +40,8 @@ This can be used in place of the default appt-message-warning-time.
40 40
41* Lisp changes in Emacs 23.3 41* Lisp changes in Emacs 23.3
42 42
43** `e' and `pi' are now called `float-e' and `float-pi'.
44 The old names are obsolete.
43** The use of unintern without an obarray arg is declared obsolete. 45** The use of unintern without an obarray arg is declared obsolete.
44 46
45** New function byte-to-string, like char-to-string but for bytes. 47** New function byte-to-string, like char-to-string but for bytes.
diff --git a/etc/srecode/java.srt b/etc/srecode/java.srt
index c449f0d77c9..d4cc986a323 100644
--- a/etc/srecode/java.srt
+++ b/etc/srecode/java.srt
@@ -83,7 +83,7 @@ public Class {{?NAME}} {{#PARENTS}}{{#FIRST}}extends {{/FIRST}}{{#NOTFIRST}}impl
83template include :blank 83template include :blank
84"An include statement." 84"An include statement."
85---- 85----
86import {{NAME}}; 86import {{?NAME}};
87---- 87----
88 88
89context misc 89context misc
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 36775118554..5261f3f30d2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,76 @@
12010-09-23 Glenn Morris <rgm@gnu.org> 12010-09-23 Glenn Morris <rgm@gnu.org>
2 2
3 * isearch.el (isearch-lazy-highlight-cleanup)
4 (isearch-lazy-highlight-initial-delay)
5 (isearch-lazy-highlight-interval)
6 (isearch-lazy-highlight-max-at-a-time, isearch-lazy-highlight-face):
7 * net/net-utils.el (ipconfig-program-options):
8 Move aliases to options before the associated definitions.
9
102010-09-23 Stefan Monnier <monnier@iro.umontreal.ca>
11
12 * newcomment.el (comment-normalize-vars): Better test validity of
13 comment-end-skip.
14
152010-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
16
17 * emacs-lisp/float-sup.el (float-pi): New name for `pi'.
18 (float-e): New name for `e'.
19 (degrees-to-radians, radians-to-degrees):
20 * calendar/solar.el (solar-longitude):
21 * calculator.el (calculator-registers, calculator-funcall):
22 * textmodes/artist.el (artist-spray-random-points):
23 * play/bubbles.el (bubbles--initialize-images): Use new names.
24
252010-09-19 Eric M. Ludlam <zappo@gnu.org>
26
27 Update to CEDET 1.0's version of EIEIO.
28
29 * emacs-lisp/eieio.el (eieio-specialized-key-to-generic-key):
30 New function.
31 (eieio-defmethod, eieio-generic-form, eieio-generic-call): Use it.
32 (eieio-default-eval-maybe): Eval val instead of unquoting only.
33 (class-precedence-list): If class is nil, return nil.
34 (eieio-generic-call): If class of first input arg is nil, don't
35 look up static methods, and do check for primary methods.
36 (initialize-instance): See if the default needs to be evaluated
37 during the constructor.
38 (eieio-perform-slot-validation-for-default): Don't do the check
39 for values that will eventually be evaluated.
40 (eieio-eval-default-p): New function.
41 (eieio-default-eval-maybe): Use it.
42
432010-07-03 Jan Moringen <jan.moringen@uni-bielefeld.de>
44
45 * emacs-lisp/eieio.el (eieio-defclass): Allow :c3
46 method-invocation-order.
47 (eieio-c3-candidate, eieio-c3-merge-lists): New functions.
48 (eieio-class-precedence-dfs): Compute class precedence list using
49 dfs algorithm.
50 (eieio-class-precedence-bfs): Compute class precedence list using
51 bfs algorithm.
52 (eieio-class-precedence-c3): Compute class precedence list using
53 c3 algorithm.
54 (class-precedence-list): New function.
55 (eieiomt-method-list, eieiomt-sym-optimize): Use it.
56 (inconsistent-class-hierarchy): New error symbol.
57 (call-next-method): Stow the replacement argument list for future
58 call-next-method invocations.
59
602010-09-23 Glenn Morris <rgm@gnu.org>
61
62 * calendar/appt.el (appt-check): If not displaying the diary,
63 use (diary 1) to only get the entries we need.
64 (appt-make-list): Sort diary-list-entries, if we cannot guarantee
65 that it is in day order. (Bug#7019)
66
67 * calendar/appt.el (appt-check): Rather than showing the diary,
68 just turn off invisible display, and only if needed.
69
70 * calendar/diary-lib.el (diary-list-entries): Doc fix. (Bug#7019)
71
722010-09-23 Glenn Morris <rgm@gnu.org>
73
3 * emacs-lisp/bytecomp.el (byte-compile-file-form-defvar): 74 * emacs-lisp/bytecomp.el (byte-compile-file-form-defvar):
4 (byte-compile-defvar, byte-compile-cl-warn): 75 (byte-compile-defvar, byte-compile-cl-warn):
5 Start warnings with lower-case, like the majority. 76 Start warnings with lower-case, like the majority.
@@ -2465,8 +2536,6 @@
2465 2536
2466 * help-fns.el (find-lisp-object-file-name): Doc fix (bug#6494). 2537 * help-fns.el (find-lisp-object-file-name): Doc fix (bug#6494).
2467 2538
2468 * cedet/semantic/db-file.el (object-write): Fix typo in docstring.
2469
2470 * time.el (display-time-day-and-date): Remove spurious * in docstring. 2539 * time.el (display-time-day-and-date): Remove spurious * in docstring.
2471 (display-time-world-buffer-name, display-time-world-mode-map): 2540 (display-time-world-buffer-name, display-time-world-mode-map):
2472 Fix typos in docstrings. 2541 Fix typos in docstrings.
@@ -3654,12 +3723,6 @@
3654 3723
3655 * international/mule.el (make-translation-table-from-vector): Doc fix. 3724 * international/mule.el (make-translation-table-from-vector): Doc fix.
3656 3725
36572010-06-03 Eric Ludlam <zappo@gnu.org>
3658
3659 * cedet/semantic/lex-spp.el
3660 (semantic-lex-spp-table-write-slot-value): Instead of erroring on
3661 invalid values during save, just save a nil (Bug#6324).
3662
36632010-06-03 Glenn Morris <rgm@gnu.org> 37262010-06-03 Glenn Morris <rgm@gnu.org>
3664 3727
3665 * desktop.el (desktop-clear-preserve-buffers): 3728 * desktop.el (desktop-clear-preserve-buffers):
@@ -3768,11 +3831,6 @@
3768 * vc-bzr.el (vc-bzr-revision-completion-table): Apply 3831 * vc-bzr.el (vc-bzr-revision-completion-table): Apply
3769 `file-directory-p' to the filename part rather than to the whole text. 3832 `file-directory-p' to the filename part rather than to the whole text.
3770 3833
37712010-05-31 Jonathan Marchand <jonathlela@gmail.com> (tiny change)
3772
3773 * cedet/ede/cpp-root.el (ede-set-project-variables): Fix feature name
3774 (bug#6231).
3775
37762010-05-31 Stefan Monnier <monnier@iro.umontreal.ca> 38342010-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
3777 3835
3778 * man.el (Man-completion-table): Let the user type "-k " (bug#6319). 3836 * man.el (Man-completion-table): Let the user type "-k " (bug#6319).
@@ -4923,67 +4981,6 @@
4923 (filter-buffer-substring-functions): New variable. 4981 (filter-buffer-substring-functions): New variable.
4924 (filter-buffer-substring): Use it. Remove unused arg `noprops'. 4982 (filter-buffer-substring): Use it. Remove unused arg `noprops'.
4925 4983
4926 Use a mode-line spec rather than a static string in Semantic.
4927 * cedet/semantic/util-modes.el:
4928 (semantic-minor-modes-format): New var to replace...
4929 (semantic-minor-modes-status): Remove.
4930 (semantic-mode-line-update): Construct a mode-line spec rather than
4931 a static string so that mouse buttons can be used on individual minor
4932 modes and so that semantic-mode-line-update only needs to be called
4933 when global settings are changed.
4934 (semantic-add-minor-mode, semantic-toggle-minor-mode-globally):
4935 Call semantic-mode-line-update.
4936 (semantic-toggle-minor-mode-globally): Don't assume mode is on
4937 minor-mode-alist, check semantic-minor-mode-alist as well.
4938 (semantic-stickyfunc-mode, semantic-show-parser-state-auto-marker)
4939 (semantic-show-parser-state-marker, semantic-show-parser-state-mode)
4940 (semantic-show-unmatched-syntax-mode, semantic-highlight-edits-mode):
4941 * cedet/semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
4942 * cedet/semantic/idle.el (semantic-idle-scheduler-mode)
4943 (define-semantic-idle-service, semantic-idle-summary-mode):
4944 * cedet/semantic/decorate/mode.el (semantic-decoration-mode):
4945 Don't call semantic-mode-line-update any more.
4946
49472010-05-02 Stefan Monnier <monnier@iro.umontreal.ca>
4948
4949 Use define-minor-mode in CEDET where applicable.
4950
4951 * cedet/srecode/mode.el (srecode-minor-mode,global-srecode-minor-mode):
4952 Use define-minor-mode.
4953
4954 * cedet/semantic/util-modes.el (semantic-add-minor-mode):
4955 Remove unused arg `keymap' and code redundant with define-minor-mode.
4956 (semantic-toggle-minor-mode-globally): Only handle arg -1 and 1.
4957 (semantic-stickyfunc-mode, global-semantic-show-unmatched-syntax-mode)
4958 (semantic-highlight-func-mode, global-semantic-show-parser-state-mode)
4959 (global-semantic-highlight-edits-mode, semantic-highlight-edits-mode)
4960 (semantic-show-unmatched-syntax-mode, semantic-show-parser-state-mode)
4961 (global-semantic-stickyfunc-mode, global-semantic-highlight-func-mode):
4962 Use define-minor-mode.
4963 (semantic-stickyfunc-mode-setup, semantic-highlight-edits-mode-setup)
4964 (semantic-show-unmatched-syntax-mode-setup)
4965 (semantic-show-parser-state-mode-setup)
4966 (semantic-highlight-func-mode-setup): Inline into sole caller.
4967
4968 * cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
4969 (semantic-mru-bookmark-mode): Use define-minor-mode.
4970 (semantic-mru-bookmark-mode-setup): Inline into sole caller.
4971
4972 * cedet/semantic/idle.el (define-semantic-idle-service):
4973 Use define-minor-mode and inline setup function into its sole caller.
4974 (semantic-idle-scheduler-mode-setup)
4975 (semantic-idle-summary-mode-setup): Inline into sole caller.
4976 (global-semantic-idle-scheduler-mode, semantic-idle-scheduler-mode):
4977 Use define-minor-mode.
4978
4979 * cedet/semantic/decorate/mode.el (global-semantic-decoration-mode)
4980 (semantic-decoration-mode): Use define-minor-mode.
4981 (semantic-decoration-mode-setup): Inline into sole caller.
4982
4983 * cedet/ede/dired.el (ede-dired-minor-mode): Initialize in declaration.
4984 (ede-dired-minor-mode): Use define-minor-mode and derived-mode-p.
4985 (ede-dired-add-to-target): Use dolist.
4986
49872010-05-01 Toru TSUNEYOSHI <t_tuneyosi@hotmail.com> 49842010-05-01 Toru TSUNEYOSHI <t_tuneyosi@hotmail.com>
4988 Michael Albinus <michael.albinus@gmx.de> 4985 Michael Albinus <michael.albinus@gmx.de>
4989 4986
@@ -5026,11 +5023,6 @@
5026 * minibuffer.el (tags-completion-at-point-function): New function. 5023 * minibuffer.el (tags-completion-at-point-function): New function.
5027 (completion-at-point-functions): Use it. 5024 (completion-at-point-functions): Use it.
5028 5025
5029 * cedet/semantic.el (semantic-completion-at-point-function):
5030 New function.
5031 (semantic-mode): Use semantic-completion-at-point-function for
5032 completion-at-point-functions instead.
5033
5034 * progmodes/etags.el (complete-tag): Revert last change. 5026 * progmodes/etags.el (complete-tag): Revert last change.
5035 5027
50362010-04-29 Alan Mackenzie <acm@muc.de> 50282010-04-29 Alan Mackenzie <acm@muc.de>
@@ -5057,12 +5049,6 @@
5057 5049
5058 * progmodes/etags.el (complete-tag): Move to minibuffer.el. 5050 * progmodes/etags.el (complete-tag): Move to minibuffer.el.
5059 5051
5060 * cedet/semantic.el (semantic-mode): When enabled, add
5061 semantic-ia-complete-symbol to completion-at-point-functions.
5062
5063 * cedet/semantic/ia.el (semantic-ia-complete-symbol): Return nil
5064 if Semantic is not active.
5065
50662010-04-28 Michael Albinus <michael.albinus@gmx.de> 50522010-04-28 Michael Albinus <michael.albinus@gmx.de>
5067 5053
5068 * net/tramp.el (tramp-remote-selinux-p): New defun. 5054 * net/tramp.el (tramp-remote-selinux-p): New defun.
@@ -5348,11 +5334,6 @@
5348 (vc-bzr-shelve-apply-and-keep, vc-bzr-shelve-snapshot): 5334 (vc-bzr-shelve-apply-and-keep, vc-bzr-shelve-snapshot):
5349 Don't use *vc-bzr-shelve*. 5335 Don't use *vc-bzr-shelve*.
5350 5336
53512010-04-19 Chong Yidong <cyd@stupidchicken.com>
5352
5353 * cedet/ede/pmake.el (ede-proj-makefile-insert-variables):
5354 Don't destroy list before using it.
5355
53562010-04-19 Dan Nicolaescu <dann@ics.uci.edu> 53372010-04-19 Dan Nicolaescu <dann@ics.uci.edu>
5357 5338
5358 Fix the version number for added files. 5339 Fix the version number for added files.
@@ -5895,12 +5876,6 @@
5895 * emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli 5876 * emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli
5896 Zaretskii. 5877 Zaretskii.
5897 5878
58982010-04-02 Juanma Barranquero <lekktu@gmail.com>
5899
5900 * cedet/semantic/imenu.el (semantic-imenu-bucketize-type-members)
5901 (semantic-create-imenu-directory-index): Fix typos in docstrings.
5902 (semantic-imenu-goto-function): Reflow docstring.
5903
59042010-04-02 Juri Linkov <juri@jurta.org> 58792010-04-02 Juri Linkov <juri@jurta.org>
5905 5880
5906 * ehelp.el (electric-help-orig-major-mode): 5881 * ehelp.el (electric-help-orig-major-mode):
@@ -6115,8 +6090,6 @@
6115 * faces.el (set-face-attribute): Fix typo in docstring. 6090 * faces.el (set-face-attribute): Fix typo in docstring.
6116 (face-valid-attribute-values): Reflow docstring. 6091 (face-valid-attribute-values): Reflow docstring.
6117 6092
6118 * cedet/srecode/table.el (srecode-template-table): Fix docstring typo.
6119
61202010-03-24 Glenn Morris <rgm@gnu.org> 60932010-03-24 Glenn Morris <rgm@gnu.org>
6121 6094
6122 * textmodes/flyspell.el (sgml-lexical-context): Autoload it (Bug#5752). 6095 * textmodes/flyspell.el (sgml-lexical-context): Autoload it (Bug#5752).
@@ -6189,11 +6162,6 @@
6189 (tramp-open-connection-setup-interactive-shell): Remove workaround 6162 (tramp-open-connection-setup-interactive-shell): Remove workaround
6190 for OpenSolaris bug, it is not needed anymore. 6163 for OpenSolaris bug, it is not needed anymore.
6191 6164
61922010-03-24 Eric M. Ludlam <zappo@gnu.org>
6193
6194 * cedet/semantic/imenu.el: New file, from the CEDET repository
6195 (Bug#5412).
6196
61972010-03-24 Glenn Morris <rgm@gnu.org> 61652010-03-24 Glenn Morris <rgm@gnu.org>
6198 6166
6199 * emacs-lisp/cl-macs.el (defsubst*): Add autoload cookie. (Bug#4427) 6167 * emacs-lisp/cl-macs.el (defsubst*): Add autoload cookie. (Bug#4427)
@@ -6220,11 +6188,6 @@
6220 6188
6221 * log-edit.el (log-edit-before-checkin-process): Doc fix. 6189 * log-edit.el (log-edit-before-checkin-process): Doc fix.
6222 6190
6223 * cedet/semantic/bovine/c.el (semantic-c-describe-environment):
6224 Consistently check ede-object is bound throughout.
6225
6226 * cedet/ede/project-am.el (ede-shell-run-something): Declare.
6227
62282010-03-23 Sam Steingold <sds@gnu.org> 61912010-03-23 Sam Steingold <sds@gnu.org>
6229 6192
6230 Fix bug#5620: recalculate all markers on compilation buffer 6193 Fix bug#5620: recalculate all markers on compilation buffer
@@ -6661,11 +6624,6 @@
6661 (vc-git-show-log-entry): Use prog1. 6624 (vc-git-show-log-entry): Use prog1.
6662 (vc-git-after-dir-status-stage): Remove unused var `remaining'. 6625 (vc-git-after-dir-status-stage): Remove unused var `remaining'.
6663 6626
66642010-03-06 Glenn Morris <rgm@gnu.org>
6665
6666 * cedet/semantic/grammar.el (semantic-grammar-header-template):
6667 Update template copyright to GPLv3+.
6668
66692010-03-05 Stefan Monnier <monnier@iro.umontreal.ca> 66272010-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
6670 6628
6671 * man.el (Man-files-regexp): Tighten up the regexp (bug#5686). 6629 * man.el (Man-files-regexp): Tighten up the regexp (bug#5686).
@@ -6732,9 +6690,6 @@
6732 6690
6733 * textmodes/reftex-toc.el (reftex-toc-promote-prepare): 6691 * textmodes/reftex-toc.el (reftex-toc-promote-prepare):
6734 * emacs-lisp/elint.el (elint-add-required-env): 6692 * emacs-lisp/elint.el (elint-add-required-env):
6735 * cedet/semantic/db-find.el
6736 (semanticdb-find-translate-path-brutish-default):
6737 * cedet/ede/make.el (ede-make-check-version):
6738 * calendar/icalendar.el (icalendar--add-diary-entry): 6693 * calendar/icalendar.el (icalendar--add-diary-entry):
6739 * calc/calcalg2.el (math-tracing-integral): 6694 * calc/calcalg2.el (math-tracing-integral):
6740 * files.el (recover-session-finish): Use with-current-buffer 6695 * files.el (recover-session-finish): Use with-current-buffer
@@ -6899,12 +6854,6 @@
6899 6854
6900 * doc-view.el (doc-view): Add to data custom group. 6855 * doc-view.el (doc-view): Add to data custom group.
6901 6856
6902 * cedet/data-debug.el (data-debug): Move to extensions group.
6903
6904 * cedet/ede.el (ede):
6905 * cedet/srecode.el (srecode):
6906 * cedet/semantic.el (semantic): Put in tools and extensions group.
6907
6908 * nxml/nxml-mode.el (nxml-faces): Remove from font-lock-faces group. 6857 * nxml/nxml-mode.el (nxml-faces): Remove from font-lock-faces group.
6909 6858
6910 * textmodes/flyspell.el (flyspell-word): Obey the offset specified 6859 * textmodes/flyspell.el (flyspell-word): Obey the offset specified
@@ -6941,10 +6890,6 @@
6941 6890
6942 * outline.el (outline-head-from-level): 6891 * outline.el (outline-head-from-level):
6943 * simple.el (with-wrapper-hook): 6892 * simple.el (with-wrapper-hook):
6944 * cedet/ede.el (ede-run-target, project-delete-target)
6945 (project-dist-files, ede-name, ede-documentation, ede-parent-project)
6946 (ede-adebug-project, ede-adebug-project-parent)
6947 (ede-adebug-project-root):
6948 * emacs-lisp/elint.el (elint-extra-errors, elint-current-buffer) 6893 * emacs-lisp/elint.el (elint-extra-errors, elint-current-buffer)
6949 (elint-defun, elint-buffer-env, elint-top-form-logged) 6894 (elint-defun, elint-buffer-env, elint-top-form-logged)
6950 (elint-unbound-variable): 6895 (elint-unbound-variable):
@@ -7393,70 +7338,10 @@
7393 7338
73942010-01-18 Juanma Barranquero <lekktu@gmail.com> 73392010-01-18 Juanma Barranquero <lekktu@gmail.com>
7395 7340
7396 * cedet/ede/locate.el (ede-locate-file-in-project)
7397 (ede-locate-file-in-project-impl): Fix typos in docstrings.
7398 (ede-enable-locate-on-project): Fix typos in error messages.
7399
7400 * cedet/semantic/util-modes.el (semantic-unmatched-syntax-face)
7401 (semantic-stickyfunc-old-hlf, semantic-stickyfunc-header-line-format)
7402 (semantic-stickyfunc-sticky-classes, semantic-highlight-func-mode-setup)
7403 (semantic-stickyfunc-fetch-stickyline): Fix typos in docstrings.
7404 (semantic-stickyfunc-popup-menu, semantic-highlight-func-popup-menu):
7405 Fix typos in menu help.
7406
7407 * emacs-lisp/chart.el (chart-file-count, chart-rmail-from): 7341 * emacs-lisp/chart.el (chart-file-count, chart-rmail-from):
7408 Fix typos in chart titles. 7342 Fix typos in chart titles.
7409 7343
7410 * whitespace.el (whitespace-style, global-whitespace-newline-mode): 7344 * whitespace.el (whitespace-style, global-whitespace-newline-mode):
7411 * cedet/semantic.el (semantic-require-version, semantic--buffer-cache)
7412 (semantic-unmatched-syntax-cache-check, semantic-unmatched-syntax-hook)
7413 (semantic--before-fetch-tags-hook, semantic-new-buffer-fcn-was-run)
7414 (semantic--umatched-syntax-needs-refresh-p, semantic-elapsed-time)
7415 (semantic-parse-stream, semantic-parse-region)
7416 (semantic-parse-region-default, semantic--set-buffer-cache)
7417 (semantic-minimum-working-buffer-size, semantic-refresh-tags-safe)
7418 (semantic-bovinate-toplevel, semantic-load-system-cache-loaded)
7419 (semantic-default-submodes):
7420 * cedet/semantic/db-ebrowse.el (semanticdb-table-ebrowse)
7421 (semanticdb-create-ebrowse-database)
7422 (semanticdb-find-tags-for-completion-method)
7423 (semanticdb-find-tags-by-class-method)
7424 (semanticdb-deep-find-tags-by-name-method)
7425 (semanticdb-deep-find-tags-for-completion-method):
7426 * cedet/semantic/db-el.el (semanticdb-elisp-mapatom-collector)
7427 (semanticdb-find-tags-by-name-method, emacs-lisp-mode)
7428 (semanticdb-find-tags-for-completion-method)
7429 (semanticdb-find-tags-by-class-method)
7430 (semanticdb-deep-find-tags-for-completion-method):
7431 * cedet/semantic/db-find.el (semanticdb-find-translate-path)
7432 (semanticdb-find-need-cache-update-p, semanticdb-find-result-with-nil-p)
7433 (semanticdb-find-scanned-include-tags, semanticdb-find-tags-collector)
7434 (semanticdb-find-tags-by-name-method)
7435 (semanticdb-find-tags-by-name-regexp-method)
7436 (semanticdb-find-tags-for-completion-method)
7437 (semanticdb-find-tags-by-class-method)
7438 (semanticdb-find-tags-external-children-of-type-method)
7439 (semanticdb-find-tags-subclasses-of-type-method)
7440 (semanticdb-deep-find-tags-by-name-method)
7441 (semanticdb-deep-find-tags-by-name-regexp-method)
7442 (semanticdb-deep-find-tags-for-completion-method):
7443 * cedet/semantic/db-global.el (semanticdb-enable-gnu-global-hook)
7444 (semanticdb-enable-gnu-global-in-buffer)
7445 (semanticdb-find-tags-for-completion-method)
7446 (semanticdb-deep-find-tags-by-name-method)
7447 (semanticdb-deep-find-tags-for-completion-method):
7448 * cedet/semantic/db-javascript.el (semanticdb-javascript-tags)
7449 (javascript-mode, semanticdb-find-translate-path)
7450 (semanticdb-find-tags-for-completion-method)
7451 (semanticdb-find-tags-by-class-method)
7452 (semanticdb-deep-find-tags-by-name-method)
7453 (semanticdb-deep-find-tags-for-completion-method)
7454 (semanticdb-find-tags-external-children-of-type-method):
7455 * cedet/semantic/idle.el (semantic-idle-work-core-handler)
7456 (define-semantic-idle-service, semantic-idle-summary-useful-context-p)
7457 (global-semantic-idle-scheduler-mode):
7458 * cedet/srecode/dictionary.el (srecode-field-value)
7459 (srecode-dictionary-add-section-dictionary):
7460 * emacs-lisp/eieio.el (eieio-error-unsupported-class-tags) 7345 * emacs-lisp/eieio.el (eieio-error-unsupported-class-tags)
7461 (eieio-generic-form, eieio-help-mode-augmentation-maybee, eieio-browse) 7346 (eieio-generic-form, eieio-help-mode-augmentation-maybee, eieio-browse)
7462 (describe-class, eieio-describe-generic, describe-generic): 7347 (describe-class, eieio-describe-generic, describe-generic):
@@ -7508,13 +7393,8 @@
7508 7393
7509 * calc/calc.el (calc-command-flags): Give it an initial value. 7394 * calc/calc.el (calc-command-flags): Give it an initial value.
7510 7395
75112010-01-17 Glenn Morris <rgm@gnu.org>
7512
7513 * cedet/semantic/idle.el (semantic-idle-work-for-one-buffer): Doc fix.
7514
75152010-01-17 Juanma Barranquero <lekktu@gmail.com> 73962010-01-17 Juanma Barranquero <lekktu@gmail.com>
7516 7397
7517 * cedet/semantic.el (semantic-mode):
7518 * files.el (minibuffer-with-setup-hook): 7398 * files.el (minibuffer-with-setup-hook):
7519 * textmodes/artist.el (artist-mt, artist-key-undraw-continously) 7399 * textmodes/artist.el (artist-mt, artist-key-undraw-continously)
7520 (artist-key-draw-continously, artist-key-do-continously-continously) 7400 (artist-key-draw-continously, artist-key-do-continously-continously)
@@ -7546,17 +7426,6 @@
7546 7426
75472010-01-16 Mario Lang <mlang@delysid.org> 74272010-01-16 Mario Lang <mlang@delysid.org>
7548 7428
7549 * cedet/ede/cpp-root.el (ede-cpp-root-project):
7550 * cedet/ede/files.el (ede-expand-filename):
7551 * cedet/ede/simple.el (ede-simple-project):
7552 * cedet/semantic/complete.el (semantic-complete-read-tag-engine)
7553 (semantic-complete-inline-tag-engine):
7554 * cedet/semantic/db-el.el (semanticdb-equivalent-mode):
7555 * cedet/semantic/db-global.el (semanticdb-equivalent-mode):
7556 * cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
7557 * cedet/semantic/db.el (semanticdb-equivalent-mode):
7558 * cedet/semantic/decorate/include.el (semantic-decoration-unknown-include-describe):
7559 * cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
7560 * emacs-lisp/chart.el (chart-translate-namezone): 7429 * emacs-lisp/chart.el (chart-translate-namezone):
7561 * textmodes/artist.el (artist-compute-popup-menu-table): 7430 * textmodes/artist.el (artist-compute-popup-menu-table):
7562 Remove duplicated words in doc-strings. 7431 Remove duplicated words in doc-strings.
@@ -7585,13 +7454,6 @@
7585 * find-cmd.el (find-constituents): 7454 * find-cmd.el (find-constituents):
7586 * vc-arch.el (vc-arch-root): 7455 * vc-arch.el (vc-arch-root):
7587 * window.el (window-body-height, pop-up-frames): 7456 * window.el (window-body-height, pop-up-frames):
7588 * cedet/semantic/edit.el (semantic-reparse-needed-change-hook)
7589 (semantic-no-reparse-needed-change-hook):
7590 * cedet/srecode/insert.el (srecode-resolve-argument-list)
7591 (srecode-template-inserter-blank, srecode-template-inserter-variable)
7592 (srecode-template-inserter-ask, srecode-template-inserter-width)
7593 (srecode-template-inserter-section-start)
7594 (srecode-template-inserter-section-end, srecode-insert-method):
7595 * emacs-lisp/eieio-base.el (eieio-singleton, slot-missing): 7457 * emacs-lisp/eieio-base.el (eieio-singleton, slot-missing):
7596 * progmodes/ada-stmt.el (ada-if): 7458 * progmodes/ada-stmt.el (ada-if):
7597 * progmodes/gdb-ui.el (gdb-jsonify-buffer): 7459 * progmodes/gdb-ui.el (gdb-jsonify-buffer):
@@ -7662,36 +7524,6 @@
7662 * mail/emacsbug.el (report-emacs-bug-pretest-address): Set 7524 * mail/emacsbug.el (report-emacs-bug-pretest-address): Set
7663 it to bug-gnu-emacs rather than emacs-pretest-bug. 7525 it to bug-gnu-emacs rather than emacs-pretest-bug.
7664 7526
76652010-01-12 Juanma Barranquero <lekktu@gmail.com>
7666
7667 * cedet/data-debug.el (data-debug): Fix customization group reference.
7668
76692010-01-12 Juanma Barranquero <lekktu@gmail.com>
7670
7671 * cedet/semantic/analyze.el (semantic-analyze-push-error)
7672 (semantic-analyze-context, semantic-analyze-context-assignment)
7673 (semantic-analyze-find-tag-sequence, semantic-analyze-find-tag):
7674 * cedet/semantic/java.el (java-mode, semantic-tag-include-filename)
7675 (semantic-java-doc-keywords-map):
7676 * cedet/semantic/bovine/c.el (c-mode, semantic-c-member-of-autocast)
7677 (semantic-lex-c-nested-namespace-ignore-second, semantic-parse-region)
7678 (semantic-c-parse-lexical-token, semantic-c-debug-mode-init-pch)
7679 (semantic-c-classname, semantic-format-tag-uml-prototype)
7680 (semantic-c-dereference-namespace, semantic-analyze-type-constants):
7681 * cedet/semantic/bovine/el.el (semantic-elisp-form-to-doc-string)
7682 (semantic-emacs-lisp-obsoleted-doc, semantic-up-context)
7683 (semantic-get-local-variables, semantic-end-of-command)
7684 (semantic-beginning-of-command, semantic-ctxt-current-class-list)
7685 (lisp-mode):
7686 * cedet/semantic/bovine/make.el (makefile-mode):
7687 * cedet/semantic/wisent/python.el (wisent-python-string-re)
7688 (wisent-python-implicit-line-joining-p, wisent-python-forward-string)
7689 (wisent-python-lex-beginning-of-line, wisent-python-lex-end-of-line)
7690 (semantic-lex, semantic-get-local-variables, python-mode):
7691 * cedet/semantic/wisent/python-wy.el (wisent-python-wy--keyword-table):
7692 * cedet/srecode/extract.el (srecode-extract-state-set)
7693 (srecode-extract-method): Fix typos in docstrings.
7694
76952010-01-11 Sam Steingold <sds@gnu.org> 75272010-01-11 Sam Steingold <sds@gnu.org>
7696 7528
7697 * imenu.el (imenu-default-create-index-function): Detect infinite 7529 * imenu.el (imenu-default-create-index-function): Detect infinite
@@ -7750,17 +7582,9 @@
7750 7582
77512010-01-10 Chong Yidong <cyd@stupidchicken.com> 75832010-01-10 Chong Yidong <cyd@stupidchicken.com>
7752 7584
7753 * cedet/semantic.el (semantic-new-buffer-setup-functions):
7754 Add python parser.
7755
7756 * Makefile.in (ELCFILES): Add wisent/python-wy.el and 7585 * Makefile.in (ELCFILES): Add wisent/python-wy.el and
7757 wisent/python.el. 7586 wisent/python.el.
7758 7587
77592010-01-10 Richard Kim <emacs18@gmail.com>
7760
7761 * cedet/semantic/wisent/python-wy.el:
7762 * cedet/semantic/wisent/python.el: New files.
7763
77642010-01-09 Chong Yidong <cyd@stupidchicken.com> 75882010-01-09 Chong Yidong <cyd@stupidchicken.com>
7765 7589
7766 * man.el (Man-goto-section): Signal error if the section is not 7590 * man.el (Man-goto-section): Signal error if the section is not
@@ -7944,9 +7768,6 @@
7944 7768
7945 * mpc.el (mpc-playlist-delete): Fix typo in error messages. 7769 * mpc.el (mpc-playlist-delete): Fix typo in error messages.
7946 7770
7947 * cedet/semantic/db-typecache.el (semanticdb-typecache-find-default):
7948 Fix typo in docstring.
7949
7950 * net/imap-hash.el (imap-hash-make): Doc fix. 7771 * net/imap-hash.el (imap-hash-make): Doc fix.
7951 (imap-hash-test): Fix typo in error message; reflow docstring. 7772 (imap-hash-test): Fix typo in error message; reflow docstring.
7952 (imap-hash-p, imap-hash-get, imap-hash-put, imap-hash-make-message) 7773 (imap-hash-p, imap-hash-get, imap-hash-put, imap-hash-make-message)
@@ -8175,14 +7996,6 @@
8175 `Info-display-images-node', and not put the `invisible' property 7996 `Info-display-images-node', and not put the `invisible' property
8176 in this case. 7997 in this case.
8177 7998
81782009-12-14 Chong Yidong <cyd@stupidchicken.com>
8179
8180 * cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
8181 (semantic-mru-bookmark-mode): Doc fixes.
8182
8183 * cedet/semantic/db.el (semanticdb-cache-get): Use error instead
8184 of assert.
8185
81862009-12-13 Glenn Morris <rgm@gnu.org> 79992009-12-13 Glenn Morris <rgm@gnu.org>
8187 8000
8188 * mail/emacsbug.el (message-sort-headers): Define for compiler. 8001 * mail/emacsbug.el (message-sort-headers): Define for compiler.
@@ -8600,9 +8413,6 @@
8600 * bindings.el (complete-symbol): Call semantic-ia-complete-symbol 8413 * bindings.el (complete-symbol): Call semantic-ia-complete-symbol
8601 if possible. 8414 if possible.
8602 8415
8603 * cedet/semantic/ia.el (semantic-ia-complete-symbol):
8604 Make argument optional.
8605
8606 * shell.el (shell): Require ansi-color (Bug#5113). 8416 * shell.el (shell): Require ansi-color (Bug#5113).
8607 8417
8608 * ansi-color.el (ansi-color-for-comint-mode): Default to t. 8418 * ansi-color.el (ansi-color-for-comint-mode): Default to t.
@@ -8630,24 +8440,6 @@
8630 (Info-mode-menu): Add `Info-virtual-index' to the menu. 8440 (Info-mode-menu): Add `Info-virtual-index' to the menu.
8631 (Info-mode): Add `Info-virtual-index' to the docstring. 8441 (Info-mode): Add `Info-virtual-index' to the docstring.
8632 8442
86332009-12-05 Eric Ludlam <zappo@gnu.org>
8634
8635 * cedet/semantic/bovine/c.el (semantic-c-describe-environment):
8636 Describe project macro symbols.
8637
8638 * cedet/semantic/complete.el (semantic-complete-do-completion):
8639 Don't call semantic-collector-current-exact-match.
8640
8641 * cedet/ede.el (ede-apply-preprocessor-map): Accept lists of
8642 ede-objects as targets.
8643
8644 * cedet/ede/pmake.el (ede-proj-makefile-insert-variables): Output
8645 a target's object list even if compiler vars are already in the
8646 Makefile.
8647
8648 * cedet/ede/emacs.el (ede-preprocessor-map): Add config.h to the
8649 list of headers producing necessary macros.
8650
86512009-12-05 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> 84432009-12-05 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
8652 8444
8653 * textmodes/bibtex.el (bibtex-map-entries): Use marker to keep 8445 * textmodes/bibtex.el (bibtex-map-entries): Use marker to keep
@@ -9530,9 +9322,6 @@
9530 * bookmark.el (bookmark-bmenu-hide-filenames): Remove assignment to 9322 * bookmark.el (bookmark-bmenu-hide-filenames): Remove assignment to
9531 deleted variable bookmark-bmenu-bookmark-column. 9323 deleted variable bookmark-bmenu-bookmark-column.
9532 9324
9533 * cedet/semantic/idle.el (global-semantic-idle-scheduler-mode):
9534 Move after definition of global-semantic-idle-tag-highlight-mode.
9535
95362009-11-24 Stefan Monnier <monnier@iro.umontreal.ca> 93252009-11-24 Stefan Monnier <monnier@iro.umontreal.ca>
9537 9326
9538 * bookmark.el (bookmark-bmenu-search): Clear echo area when exiting. 9327 * bookmark.el (bookmark-bmenu-search): Clear echo area when exiting.
@@ -9597,56 +9386,6 @@
9597 * dired-x.el (dired-guess-shell-alist-default): 9386 * dired-x.el (dired-guess-shell-alist-default):
9598 Support xz format. (Bug#4953) 9387 Support xz format. (Bug#4953)
9599 9388
96002009-11-22 Chong Yidong <cyd@stupidchicken.com>
9601
9602 * cedet/srecode/map.el (srecode-get-maps):
9603 * cedet/semantic/wisent/wisent.el (wisent-parse-toggle-verbose-flag):
9604 * cedet/semantic/wisent/comp.el (wisent-toggle-verbose-flag):
9605 * cedet/semantic/decorate/mode.el (semantic-decoration-mode)
9606 (semantic-toggle-decoration-style):
9607 * cedet/semantic/decorate/include.el
9608 (semantic-decoration-include-describe)
9609 (semantic-decoration-unknown-include-describe)
9610 (semantic-decoration-unparsed-include-describe)
9611 (semantic-decoration-all-include-summary):
9612 * cedet/semantic/bovine/c.el (semantic-c-debug-mode-init):
9613 * cedet/semantic/analyze/complete.el
9614 (semantic-analyze-possible-completions):
9615 * cedet/semantic/util-modes.el (semantic-highlight-edits-mode)
9616 (semantic-show-unmatched-syntax-mode)
9617 (semantic-show-parser-state-mode, semantic-stickyfunc-mode)
9618 (semantic-highlight-func-mode):
9619 * cedet/semantic/util.el (semantic-describe-buffer):
9620 * cedet/semantic/symref.el (semantic-symref-find-references-by-name)
9621 (semantic-symref-find-tags-by-name)
9622 (semantic-symref-find-tags-by-regexp)
9623 (semantic-symref-find-tags-by-completion)
9624 (semantic-symref-find-file-references-by-name)
9625 (semantic-symref-find-text):
9626 * cedet/semantic/senator.el (senator-copy-tag, senator-kill-tag)
9627 (senator-yank-tag):
9628 * cedet/semantic/scope.el (semantic-calculate-scope):
9629 * cedet/semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
9630 * cedet/semantic/idle.el (semantic-idle-scheduler-mode)
9631 (define-semantic-idle-service):
9632 * cedet/semantic/complete.el (semantic-complete-analyze-inline)
9633 (semantic-complete-analyze-inline-idle):
9634 * cedet/semantic/analyze.el (semantic-analyze-current-context):
9635 * cedet/mode-local.el (describe-mode-local-bindings)
9636 (describe-mode-local-bindings-in-mode):
9637 * cedet/ede/make.el (ede-make-check-version):
9638 * cedet/ede/locate.el (ede-enable-locate-on-project):
9639 * cedet/cedet-idutils.el (cedet-idutils-expand-filename)
9640 (cedet-idutils-version-check):
9641 * cedet/cedet-global.el (cedet-gnu-global-expand-filename)
9642 (cedet-gnu-global-version-check):
9643 * cedet/cedet-cscope.el (cedet-cscope-expand-filename)
9644 (cedet-cscope-version-check): Use called-interactively-p instead
9645 of interactive-p.
9646
9647 * cedet/semantic/ia.el (semantic-ia-completion-format-tag-function):
9648 Use semantic-format-tag-prototype.
9649
96502009-11-22 Michael Kifer <kifer@cs.stonybrook.edu> 93892009-11-22 Michael Kifer <kifer@cs.stonybrook.edu>
9651 9390
9652 * emulation/viper-cmd.el: Use viper-last-command-char instead of 9391 * emulation/viper-cmd.el: Use viper-last-command-char instead of
@@ -9673,12 +9412,6 @@
9673 * progmodes/subword.el (subword-mode-map): Fix subword-mode-map 9412 * progmodes/subword.el (subword-mode-map): Fix subword-mode-map
9674 generation from word-movement command names. 9413 generation from word-movement command names.
9675 9414
96762009-11-21 Chong Yidong <cyd@stupidchicken.com>
9677
9678 * cedet/semantic/complete.el (semantic-complete-read-tag-engine)
9679 (semantic-complete-jump-local, semantic-complete-jump):
9680 Improve prompt string.
9681
96822009-11-21 Jan Djärv <jan.h.d@swipnet.se> 94152009-11-21 Jan Djärv <jan.h.d@swipnet.se>
9683 9416
9684 * cus-start.el (all): Add native condition for font-use-system-font. 9417 * cus-start.el (all): Add native condition for font-use-system-font.
@@ -9765,13 +9498,6 @@
9765 (bookmark-bmenu-search): New command. 9498 (bookmark-bmenu-search): New command.
9766 (bookmark-bmenu-mode-map): Bind it. 9499 (bookmark-bmenu-mode-map): Bind it.
9767 9500
97682009-11-20 Chong Yidong <cyd@stupidchicken.com>
9769
9770 * cedet/semantic/complete.el (semantic-complete-inline-map): Doc fix.
9771
9772 * cedet/semantic/idle.el (define-semantic-idle-service)
9773 (semantic-idle-summary-mode, semantic-idle-completions): Doc fix.
9774
97752009-11-20 Tassilo Horn <tassilo@member.fsf.org> 95012009-11-20 Tassilo Horn <tassilo@member.fsf.org>
9776 9502
9777 * progmodes/cc-cmds.el: declare-functioned forward-subword and 9503 * progmodes/cc-cmds.el: declare-functioned forward-subword and
@@ -9818,17 +9544,6 @@
9818 9544
9819 * Makefile.in (ELCFILES): Regenerate. 9545 * Makefile.in (ELCFILES): Regenerate.
9820 9546
98212009-11-20 Chong Yidong <cyd@stupidchicken.com>
9822
9823 * cedet/cedet.el (cedet-menu-map): Re-order menu items.
9824
9825 * cedet/semantic.el: Enable idle-mode menu items only if
9826 global-semantic-idle-scheduler-mode is enabled.
9827 (semantic-default-submodes): Doc fix.
9828
9829 * cedet/semantic/idle.el (global-semantic-idle-scheduler-mode):
9830 When turning off, disable other idle modes.
9831
98322009-11-20 Jay Belanger <jay.p.belanger@gmail.com> 95472009-11-20 Jay Belanger <jay.p.belanger@gmail.com>
9833 9548
9834 * calc/calc.el (calc-set-mode-line): 9549 * calc/calc.el (calc-set-mode-line):
@@ -10135,13 +9850,6 @@
10135 * strokes.el (strokes-update-window-configuration): Make strokes 9850 * strokes.el (strokes-update-window-configuration): Make strokes
10136 buffer current before erasing (Bug#4906). 9851 buffer current before erasing (Bug#4906).
10137 9852
10138 * cedet/semantic/idle.el (semantic-idle-summary-mode)
10139 (semantic-idle-summary-mode): Define using define-minor-mode
10140 instead of define-semantic-idle-service.
10141 (semantic-idle-summary-mode): New function.
10142 (semantic-idle-summary-mode-setup): Use pre-command-hook to ensure
10143 that mouse motion does not reset the echo area.
10144
101452009-11-15 Juri Linkov <juri@jurta.org> 98532009-11-15 Juri Linkov <juri@jurta.org>
10146 9854
10147 * simple.el (set-mark-default-inactive): Add :type, :group 9855 * simple.el (set-mark-default-inactive): Add :type, :group
@@ -10510,9 +10218,6 @@
10510 10218
105112009-11-08 Chong Yidong <cyd@stupidchicken.com> 102192009-11-08 Chong Yidong <cyd@stupidchicken.com>
10512 10220
10513 * cedet/semantic/ctxt.el (semantic-get-local-variables): Disable
10514 the progress reporter entirely.
10515
10516 * emulation/cua-base.el: Add CUA property to some CC mode commands 10221 * emulation/cua-base.el: Add CUA property to some CC mode commands
10517 (Bug#4100). 10222 (Bug#4100).
10518 10223
@@ -10795,79 +10500,6 @@
10795 10500
10796 * emacs-lisp/autoload.el (generated-autoload-feature): Remove. 10501 * emacs-lisp/autoload.el (generated-autoload-feature): Remove.
10797 (autoload-rubric): Don't use any more. 10502 (autoload-rubric): Don't use any more.
10798 * cedet/semantic/fw.el (semantic/loaddefs):
10799 * cedet/srecode.el (srecode/loaddefs):
10800 * cedet/ede.el (ede/loaddefs): Load rather than require.
10801 * cedet/ede/cpp-root.el:
10802 * cedet/ede/emacs.el:
10803 * cedet/ede/files.el:
10804 * cedet/ede/linux.el:
10805 * cedet/ede/locate.el:
10806 * cedet/ede/make.el:
10807 * cedet/ede/shell.el:
10808 * cedet/ede/speedbar.el:
10809 * cedet/ede/system.el:
10810 * cedet/ede/util.el:
10811 * cedet/semantic/analyze.el:
10812 * cedet/semantic/bovine.el:
10813 * cedet/semantic/complete.el:
10814 * cedet/semantic/ctxt.el:
10815 * cedet/semantic/db-file.el:
10816 * cedet/semantic/db-find.el:
10817 * cedet/semantic/db-global.el:
10818 * cedet/semantic/db-mode.el:
10819 * cedet/semantic/db-typecache.el:
10820 * cedet/semantic/db.el:
10821 * cedet/semantic/debug.el:
10822 * cedet/semantic/dep.el:
10823 * cedet/semantic/doc.el:
10824 * cedet/semantic/edit.el:
10825 * cedet/semantic/find.el:
10826 * cedet/semantic/format.el:
10827 * cedet/semantic/html.el:
10828 * cedet/semantic/ia-sb.el:
10829 * cedet/semantic/ia.el:
10830 * cedet/semantic/idle.el:
10831 * cedet/semantic/lex-spp.el:
10832 * cedet/semantic/lex.el:
10833 * cedet/semantic/mru-bookmark.el:
10834 * cedet/semantic/scope.el:
10835 * cedet/semantic/senator.el:
10836 * cedet/semantic/sort.el:
10837 * cedet/semantic/symref.el:
10838 * cedet/semantic/tag-file.el:
10839 * cedet/semantic/tag-ls.el:
10840 * cedet/semantic/tag-write.el:
10841 * cedet/semantic/tag.el:
10842 * cedet/semantic/util-modes.el:
10843 * cedet/semantic/analyze/complete.el:
10844 * cedet/semantic/analyze/refs.el:
10845 * cedet/semantic/bovine/c.el:
10846 * cedet/semantic/bovine/gcc.el:
10847 * cedet/semantic/bovine/make.el:
10848 * cedet/semantic/bovine/scm.el:
10849 * cedet/semantic/decorate/include.el:
10850 * cedet/semantic/decorate/mode.el:
10851 * cedet/semantic/symref/cscope.el:
10852 * cedet/semantic/symref/global.el:
10853 * cedet/semantic/symref/grep.el:
10854 * cedet/semantic/symref/idutils.el:
10855 * cedet/semantic/symref/list.el:
10856 * cedet/semantic/wisent/java-tags.el:
10857 * cedet/semantic/wisent/javascript.el:
10858 * cedet/srecode/compile.el:
10859 * cedet/srecode/cpp.el:
10860 * cedet/srecode/document.el:
10861 * cedet/srecode/el.el:
10862 * cedet/srecode/expandproto.el:
10863 * cedet/srecode/getset.el:
10864 * cedet/srecode/insert.el:
10865 * cedet/srecode/java.el:
10866 * cedet/srecode/map.el:
10867 * cedet/srecode/mode.el:
10868 * cedet/srecode/template.el:
10869 * cedet/srecode/texi.el: Remove the file-local setting of
10870 generated-autoload-feature.
10871 10503
10872 * emacs-lisp/byte-run.el (define-obsolete-variable-alias): Use dolist, 10504 * emacs-lisp/byte-run.el (define-obsolete-variable-alias): Use dolist,
10873 and only put a prop if it is non-nil. 10505 and only put a prop if it is non-nil.
@@ -10884,8 +10516,6 @@
10884 10516
108852009-11-03 Glenn Morris <rgm@gnu.org> 105172009-11-03 Glenn Morris <rgm@gnu.org>
10886 10518
10887 * cedet/mode-local.el (with-mode-local): Doc fix.
10888
10889 * emacs-lisp/bytecomp.el (byte-compile-file-form-defvar) 10519 * emacs-lisp/bytecomp.el (byte-compile-file-form-defvar)
10890 (byte-compile-file-form-define-abbrev-table) 10520 (byte-compile-file-form-define-abbrev-table)
10891 (byte-compile-file-form-custom-declare-variable) 10521 (byte-compile-file-form-custom-declare-variable)
@@ -11007,12 +10637,6 @@
11007 * menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu 10637 * menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
11008 items. 10638 items.
11009 10639
11010 * cedet/cedet.el (cedet-menu-map): Remove Semantic and EDE menu
11011 items.
11012
11013 * cedet/ede.el (ede-minor-mode):
11014 * cedet/semantic.el (semantic-mode): Toggle menu separators.
11015
110162009-10-31 Stefan Monnier <monnier@iro.umontreal.ca> 106402009-10-31 Stefan Monnier <monnier@iro.umontreal.ca>
11017 10641
11018 * textmodes/two-column.el (2C-split): 10642 * textmodes/two-column.el (2C-split):
@@ -11166,89 +10790,12 @@
11166 (byte-compile-variable-ref, byte-compile-setq-default): 10790 (byte-compile-variable-ref, byte-compile-setq-default):
11167 Respect `constants' member of byte-compile-warnings. 10791 Respect `constants' member of byte-compile-warnings.
11168 10792
11169 * cedet/semantic/tag.el (semantic--tag-link-list-to-buffer):
11170 Use mapc rather than mapcar because the return value is never used.
11171
11172 * cedet/srecode/template.el, cedet/semantic/wisent/javascript.el:
11173 * cedet/semantic/wisent/java-tags.el, cedet/semantic/texi.el:
11174 * cedet/semantic/html.el:
11175 Suppress harmless warnings about setting up semantic-imenu (not
11176 part of Emacs) variables.
11177
111782009-10-30 Stefan Monnier <monnier@iro.umontreal.ca> 107932009-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
11179 10794
11180 * vc-bzr.el (vc-bzr-revision-keywords): New var. 10795 * vc-bzr.el (vc-bzr-revision-keywords): New var.
11181 (vc-bzr-revision-completion-table): Use it to fix completion of "s:" 10796 (vc-bzr-revision-completion-table): Use it to fix completion of "s:"
11182 to "submit:". 10797 to "submit:".
11183 10798
11184 * cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
11185 * cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
11186 * cedet/semantic/symref/grep.el (semantic-symref-perform-search):
11187 * cedet/semantic/bovine/gcc.el (semantic-gcc-query):
11188 * cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
11189 * cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
11190 (semantic-analyzer-debug-global-symbol)
11191 (semantic-analyzer-debug-missing-innertype)
11192 (semantic-analyzer-debug-insert-include-summary):
11193 * cedet/semantic/util.el (semantic-file-tag-table):
11194 (semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
11195 (semantic-recursive-find-nonterminal-by-name):
11196 * cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
11197 * cedet/semantic/tag-file.el (semantic-prototype-file):
11198 * cedet/semantic/symref.el (semantic-symref-parse-tool-output):
11199 * cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
11200 * cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
11201 * cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
11202 (semantic-idle-summary-maybe-highlight):
11203 * cedet/semantic/ia-sb.el (semantic-ia-speedbar)
11204 (semantic-ia-sb-tag-info):
11205 * cedet/semantic/grammar.el (semantic-analyze-possible-completions):
11206 * cedet/semantic/find.el (semantic-brute-find-tag-by-position):
11207 * cedet/semantic/ede-grammar.el (project-compile-target):
11208 (ede-proj-makefile-insert-variables):
11209 * cedet/semantic/debug.el (semantic-debug-set-parser-location):
11210 (semantic-debug-set-source-location, semantic-debug-interface-layout)
11211 (semantic-debug-mode, semantic-debug):
11212 * cedet/semantic/db.el (semanticdb-needs-refresh-p):
11213 * cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
11214 * cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
11215 * cedet/semantic/db-find.el (semanticdb-find-log-new-search)
11216 (semanticdb-find-translate-path-includes--internal)
11217 (semanticdb-reset-log, semanticdb-find-log-activity):
11218 * cedet/semantic/db-file.el (object-write):
11219 * cedet/semantic/db-el.el (semanticdb-equivalent-mode):
11220 * cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
11221 (semanticdb-create-ebrowse-database):
11222 * cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
11223 * cedet/semantic/complete.el (semantic-displayor-focus-request)
11224 (semantic-collector-calculate-completions-raw)
11225 (semantic-complete-read-tag-analyzer):
11226 * cedet/semantic/analyze.el (semantic-analyze-pulse):
11227 * cedet/ede/util.el (ede-update-version-in-source):
11228 * cedet/ede/proj.el (project-delete-target):
11229 * cedet/ede/proj-elisp.el (ede-update-version-in-source)
11230 (ede-proj-flush-autoconf):
11231 * cedet/ede/pconf.el (ede-proj-configure-synchronize)
11232 (ede-proj-configure-synchronize):
11233 * cedet/ede/locate.el (ede-locate-file-in-project-impl):
11234 * cedet/ede/linux.el (ede-linux-version):
11235 * cedet/ede/emacs.el (ede-emacs-version):
11236 * cedet/ede/dired.el (ede-dired-add-to-target):
11237 * cedet/ede.el (ede-buffer-header-file, ede-find-target)
11238 (ede-buffer-documentation-files, ede-project-buffers, ede-set)
11239 (ede-target-buffers, ede-buffers, ede-make-project-local-variable):
11240 * cedet/cedet-idutils.el (cedet-idutils-fnid-call):
11241 (cedet-idutils-lid-call, cedet-idutils-expand-filename)
11242 (cedet-idutils-version-check):
11243 * cedet/cedet-global.el (cedet-gnu-global-call):
11244 (cedet-gnu-global-expand-filename, cedet-gnu-global-root)
11245 (cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
11246 * cedet/cedet-cscope.el (cedet-cscope-call)
11247 (cedet-cscope-expand-filename, cedet-cscope-version-check):
11248 Use with-current-buffer.
11249 * cedet/ede.el (ede-make-project-local-variable)
11250 (ede-set-project-variables, ede-set): Use dolist.
11251
112522009-10-30 Dan Nicolaescu <dann@ics.uci.edu> 107992009-10-30 Dan Nicolaescu <dann@ics.uci.edu>
11253 10800
11254 * textmodes/ispell.el (ispell-skip-region-alist): 10801 * textmodes/ispell.el (ispell-skip-region-alist):
@@ -11292,16 +10839,6 @@
11292 (calc-embedded-finish-command, calc-embedded-stack-change): 10839 (calc-embedded-finish-command, calc-embedded-stack-change):
11293 * calc/calc-aent.el (calcAlg-enter): Use with-current-buffer. 10840 * calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
11294 10841
11295 * cedet/mode-local.el (make-obsolete-overload): Add `when' argument.
11296 (overload-docstring-extension): Use that info.
11297 * cedet/semantic/fw.el (semantic-alias-obsolete): Pass the `when' info.
11298 * cedet/semantic/idle.el (semantic-eldoc-current-symbol-info):
11299 * cedet/semantic/tag-ls.el (semantic-nonterminal-protection)
11300 (semantic-nonterminal-abstract, semantic-nonterminal-leaf)
11301 (semantic-nonterminal-full-name): Add the new `when' info.
11302 * cedet/semantic/decorate/mode.el (semantic/decorate): Require CL for
11303 `assert'.
11304
11305 * pcomplete.el (pcomplete-comint-setup): If there's a choice, replace 10842 * pcomplete.el (pcomplete-comint-setup): If there's a choice, replace
11306 shell-dynamic-complete-filename in preference to 10843 shell-dynamic-complete-filename in preference to
11307 comint-dynamic-complete-filename. 10844 comint-dynamic-complete-filename.
@@ -11442,36 +10979,6 @@
11442 * bookmark.el (bookmark-bmenu-list): Don't use switch-to-buffer if 10979 * bookmark.el (bookmark-bmenu-list): Don't use switch-to-buffer if
11443 we're inside a dedicated or minibuffer window. 10980 we're inside a dedicated or minibuffer window.
11444 10981
114452009-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11446
11447 * cedet/semantic/fw.el (semantic-alias-obsolete)
11448 (semantic-varalias-obsolete): Make the `when' arg mandatory.
11449 (define-mode-overload-implementation):
11450 * cedet/semantic/decorate/mode.el (semantic-decorate-pending-decoration-hooks):
11451 * cedet/semantic/wisent.el (wisent-lex-make-token-table):
11452 * cedet/semantic/util.el (semantic-file-token-stream)
11453 (semantic-something-to-stream):
11454 * cedet/semantic/tag.el (semantic-tag-make-assoc-list)
11455 (semantic-expand-nonterminal):
11456 * cedet/semantic/tag-file.el (semantic-find-nonterminal)
11457 (semantic-find-dependency, semantic-find-nonterminal)
11458 (semantic-find-dependency):
11459 * cedet/semantic/lex.el (semantic-flex-start, semantic-flex-end)
11460 (semantic-flex-text, semantic-flex-make-keyword-table)
11461 (semantic-flex-keyword-p, semantic-flex-keyword-put)
11462 (semantic-flex-keyword-get, semantic-flex-map-keywords)
11463 (semantic-flex-keywords, semantic-flex-buffer, semantic-flex-list):
11464 * cedet/semantic/java.el (semantic-java-prototype-nonterminal):
11465 * cedet/semantic/idle.el (semantic-before-idle-scheduler-reparse-hooks)
11466 (semantic-after-idle-scheduler-reparse-hooks):
11467 * cedet/semantic/edit.el (semantic-edits-incremental-reparse-failed-hooks):
11468 * cedet/semantic/db-mode.el (semanticdb-mode-hooks):
11469 * cedet/semantic.el (semantic-toplevel-bovine-table)
11470 (semantic-toplevel-bovine-cache)
11471 (semantic-before-toplevel-bovination-hook, semantic-init-hooks)
11472 (semantic-init-mode-hooks, semantic-init-db-hooks)
11473 (semantic-bovination-working-type): Provide the `when' arg.
11474
114752009-10-24 Karl Fogel <kfogel@red-bean.com> 109822009-10-24 Karl Fogel <kfogel@red-bean.com>
11476 10983
11477 * bookmark.el: Update documentation, especially documentation 10984 * bookmark.el: Update documentation, especially documentation
@@ -11500,15 +11007,6 @@
11500 * files.el (delete-directory): Delete symlinks to directories with 11007 * files.el (delete-directory): Delete symlinks to directories with
11501 delete-file (Bug#4739). 11008 delete-file (Bug#4739).
11502 11009
115032009-10-24 Chong Yidong <cyd@stupidchicken.com>
11504
11505 * cedet/semantic/util.el (semantic-recursive-find-nonterminal-by-name):
11506 * cedet/semantic/tag.el (semantic-token-type-parent): Add WHEN
11507 argument to make-obsolete.
11508
11509 * cedet/semantic/fw.el (semantic-alias-obsolete)
11510 (semantic-varalias-obsolete): Add optional WHEN argument.
11511
115122009-10-24 Dan Nicolaescu <dann@ics.uci.edu> 110102009-10-24 Dan Nicolaescu <dann@ics.uci.edu>
11513 11011
11514 * vc.el (vc-backend-for-registration): Rename from 11012 * vc.el (vc-backend-for-registration): Rename from
@@ -11710,16 +11208,6 @@
11710 11208
11711 * help-fns.el: Don't require help-mode (to avoid bootstrap issues). 11209 * help-fns.el: Don't require help-mode (to avoid bootstrap issues).
11712 11210
117132009-10-21 Eric Ludlam <zappo@gnu.org>
11714
11715 * cedet/semantic/bovine/c.el (semantic-c-debug-mode-init)
11716 (semantic-c-debug-mode-init-pch): New functions.
11717 (semantic-c-debug-mode-init-last-mode): New var.
11718 (semantic-c-parse-lexical-token): Use them.
11719
11720 * cedet/semantic/lex-spp.el (semantic-lex-spp-anlyzer-do-replace):
11721 When extracting the argument list, limit only by point-max.
11722
117232009-10-21 Michael Albinus <michael.albinus@gmx.de> 112112009-10-21 Michael Albinus <michael.albinus@gmx.de>
11724 11212
11725 * net/tramp-smb.el (tramp-smb-get-stat-capability): New defun. 11213 * net/tramp-smb.el (tramp-smb-get-stat-capability): New defun.
@@ -11834,81 +11322,6 @@
11834 (tar-header-block-tokenize): Decode the username and groupname. 11322 (tar-header-block-tokenize): Decode the username and groupname.
11835 (tar-chown-entry, tar-chgrp-entry): Encode the names (bug#4730). 11323 (tar-chown-entry, tar-chgrp-entry): Encode the names (bug#4730).
11836 11324
118372009-10-17 Chong Yidong <cyd@stupidchicken.com>
11838
11839 * cedet/srecode/srt.el:
11840 * cedet/srecode/compile.el:
11841 * cedet/semantic/mru-bookmark.el:
11842 * cedet/semantic/debug.el:
11843 * cedet/semantic/complete.el:
11844 * cedet/semantic/analyze.el: Require CL when compiling.
11845
118462009-10-17 Eric Ludlam <zappo@gnu.org>
11847
11848 * cedet/semantic/scope.el
11849 (semantic-analyze-scoped-inherited-tag-map): Wrap calculation of
11850 tmpscope so that the regular scope will continue to work.
11851
11852 * cedet/semantic/idle.el (semantic-idle-tag-highlight):
11853 Use semantic-idle-summary-highlight-face as the highlighting.
11854
11855 * emacs-lisp/eieio-base.el (eieio-persistent-save): If buffer
11856 contains multibyte characters, choose first applicable coding
11857 system automatically.
11858
11859 * cedet/ede/project-am.el (project-run-target): New method.
11860 (project-run-target): New method.
11861
11862 * cedet/ede.el (ede-target): Add run target menu item.
11863 (ede-project, ede-minor-keymap): Add ede-run-target binding.
11864 (ede-run-target): New function.
11865 (ede-target::project-run-target): New method.
11866
11867 * cedet/ede/proj.el (project-run-target): New method.
11868
11869 * cedet/ede/proj-shared.el (ede-gcc-libtool-shared-compiler)
11870 (ede-g++-libtool-shared-compiler): Remove SHELL. Remove COMMANDS.
11871 Add :rules.
11872 (ede-proj-target-makefile-shared-object): Only libtool compilers
11873 now available. Add linkers for libtool.
11874 (ede-cc-linker-libtool, ede-g++-linker-libtool): New.
11875 (ede-proj-makefile-target-name): Always use .la extension.
11876
11877 * cedet/ede/proj-prog.el (project-run-target): New method.
11878
11879 * cedet/ede/proj-obj.el (ede-cc-linker): Rename from ede-gcc-linker.
11880 (ede-g++-linker): Change Change link lines.
11881
11882 * cedet/ede/pmake.el (ede-pmake-insert-variable-shared):
11883 When searching for old variables, go to the end of the buffer and
11884 search backward from there.
11885 (ede-proj-makefile-automake-insert-subdirs)
11886 (ede-proj-makefile-automake-insert-extradist): New methods.
11887 (ede-proj-makefile-create): Use them.
11888
11889 * cedet/ede/pconf.el (ede-proj-configure-test-required-file):
11890 Force FILE to expand to the current target. Use file-exists-p to
11891 check that it exists.
11892
11893 * cedet/ede/linux.el (ede-linux-version): Don't call "head".
11894 (ede-linux-load): Wrap dir in file-name-as-directory.
11895 Set :version slot.
11896
11897 * cedet/ede/files.el (ede-get-locator-object): When enabling
11898 locate, do so on "top".
11899
11900 * cedet/ede/emacs.el (ede-emacs-file-existing): Wrap "dir" in
11901 file-name-as-directory during compare.
11902 (ede-emacs-version): Return Emacs/XEmacs differentiator.
11903 Get version number from different places. Don't call egrep.
11904 (ede-emacs-load): Set :version slot. Call file-name-as-directory
11905 to set the directory.
11906
11907 * cedet/ede/shell.el: New file.
11908
11909 * cedet/inversion.el (inversion-decoders): Allow for stray . in
11910 alpha/beta variants.
11911
119122009-10-17 Stefan Monnier <monnier@iro.umontreal.ca> 113252009-10-17 Stefan Monnier <monnier@iro.umontreal.ca>
11913 11326
11914 * international/mule-cmds.el (select-safe-coding-system): If the file 11327 * international/mule-cmds.el (select-safe-coding-system): If the file
@@ -11916,9 +11329,6 @@
11916 11329
119172009-10-17 Glenn Morris <rgm@gnu.org> 113302009-10-17 Glenn Morris <rgm@gnu.org>
11918 11331
11919 * cedet/semantic/grammar.el (semantic-grammar--lex-delim-spec):
11920 All errors should have messages.
11921
11922 * foldout.el (foldout-mouse-swallow-events): 11332 * foldout.el (foldout-mouse-swallow-events):
11923 * gs.el (gs-load-image): Replace obsolete forms of sit-for, sleep-for. 11333 * gs.el (gs-load-image): Replace obsolete forms of sit-for, sleep-for.
11924 11334
@@ -12217,16 +11627,6 @@
12217 * calendar/calendar.el (calendar-split-width-threshold): New option. 11627 * calendar/calendar.el (calendar-split-width-threshold): New option.
12218 (calendar-basic-setup): Use calendar-split-width-threshold. 11628 (calendar-basic-setup): Use calendar-split-width-threshold.
12219 11629
122202009-10-10 Sascha Wilde <wilde@sha-bang.de>
12221
12222 * cedet/ede/proj-shared.el (ede-proj-makefile-target-name):
12223 Use .la for Automake.
12224
122252009-10-09 Chong Yidong <cyd@stupidchicken.com>
12226
12227 * cedet/ede/pconf.el (ede-proj-configure-synchronize):
12228 Use "autoreconf -i". Suggested by Andreas Schwab.
12229
122302009-10-09 Juanma Barranquero <lekktu@gmail.com> 116302009-10-09 Juanma Barranquero <lekktu@gmail.com>
12231 11631
12232 * international/mule-cmds.el (ucs-names): Exclude new "Enclosed 11632 * international/mule-cmds.el (ucs-names): Exclude new "Enclosed
@@ -12255,13 +11655,6 @@
12255 (bookmark-jump-other-window): Just invoke bookmark-jump with new 11655 (bookmark-jump-other-window): Just invoke bookmark-jump with new
12256 argument now, so the two function's behaviors will match. (Bug#3645) 11656 argument now, so the two function's behaviors will match. (Bug#3645)
12257 11657
122582009-10-08 Chong Yidong <cyd@stupidchicken.com>
12259
12260 * cedet/ede/proj.el (project-make-dist, project-compile-project):
12261 Fix filename test.
12262 (ede-proj-dist-makefile): Use expand-file-name instead of concat
12263 to expand file names.
12264
122652009-10-08 Michael Albinus <michael.albinus@gmx.de> 116582009-10-08 Michael Albinus <michael.albinus@gmx.de>
12266 11659
12267 * net/tramp.el (tramp-file-name-real-user, tramp-file-name-domain) 11660 * net/tramp.el (tramp-file-name-real-user, tramp-file-name-domain)
@@ -12273,15 +11666,6 @@
12273 (tramp-smb-handle-expand-file-name): Implement "~" expansion. 11666 (tramp-smb-handle-expand-file-name): Implement "~" expansion.
12274 (tramp-smb-maybe-open-connection): Flush the cache only if necessary. 11667 (tramp-smb-maybe-open-connection): Flush the cache only if necessary.
12275 11668
122762009-10-08 Chong Yidong <cyd@stupidchicken.com>
12277
12278 * cedet/ede/proj-obj.el (ede-gcc-linker): New var.
12279 (ede-proj-target-makefile-objectcode): Use it.
12280
12281 * cedet/ede/source.el (ede-want-any-source-files-p)
12282 (ede-want-any-auxiliary-files-p, ede-want-any-files-p):
12283 Return search result. This error was introduced while merging.
12284
122852009-10-07 Juanma Barranquero <lekktu@gmail.com> 116692009-10-07 Juanma Barranquero <lekktu@gmail.com>
12286 11670
12287 * makefile.w32-in (WINS_UPDATES): Fix typo in previous change. 11671 * makefile.w32-in (WINS_UPDATES): Fix typo in previous change.
@@ -12556,26 +11940,6 @@
12556 (Info-bookmark-jump): Document with a doc string, not just a comment. 11940 (Info-bookmark-jump): Document with a doc string, not just a comment.
12557 (Bug#4203) 11941 (Bug#4203)
12558 11942
125592009-10-04 Chong Yidong <cyd@stupidchicken.com>
12560
12561 * cedet/semantic.el (semantic-new-buffer-setup-functions): New option.
12562 (semantic-new-buffer-fcn): Call parser setup functions here.
12563 (semantic-mode): Don't call parser setup functions here, it's done
12564 in semantic-new-buffer-fcn now.
12565 (semantic-mode): Parse all existing buffers when enabled.
12566
12567 * cedet/srecode/compile.el (srecode-compile-file):
12568 Call semantic-new-buffer-fcn if the buffer has not been parsed.
12569
125702009-10-04 Chong Yidong <cyd@stupidchicken.com>
12571
12572 * cedet/ede/pmake.el (ede-pmake-insert-variable-once): Delete.
12573
12574 * cedet/ede/proj-comp.el: Don't require ede/pmake at toplevel.
12575 (proj-comp-insert-variable-once): New macro, renamed from
12576 ede-pmake-insert-variable-once in ede/pmake.edl.
12577 (ede-proj-makefile-insert-variables): Use it.
12578
125792009-10-04 Michael Albinus <michael.albinus@gmx.de> 119432009-10-04 Michael Albinus <michael.albinus@gmx.de>
12580 11944
12581 * files.el (copy-directory): New defun. 11945 * files.el (copy-directory): New defun.
@@ -12584,35 +11948,12 @@
12584 11948
125852009-10-04 Juanma Barranquero <lekktu@gmail.com> 119492009-10-04 Juanma Barranquero <lekktu@gmail.com>
12586 11950
12587 * cedet/ede/makefile-edit.el (makefile-beginning-of-command)
12588 (makefile-end-of-command):
12589 * cedet/srecode/srt-mode.el (semantic-beginning-of-context)
12590 (semantic-end-of-context): Fix previous change. Doc fixes.
12591
125922009-10-04 Juanma Barranquero <lekktu@gmail.com>
12593
12594 * files-x.el (modify-dir-local-variable) 11951 * files-x.el (modify-dir-local-variable)
12595 (copy-dir-locals-to-file-locals-prop-line): 11952 (copy-dir-locals-to-file-locals-prop-line): Fix typos in
12596 * cedet/ede/makefile-edit.el (makefile-beginning-of-command) 11953 docstrings.
12597 (makefile-end-of-command):
12598 * cedet/semantic/lex.el (semantic-lex-token):
12599 * cedet/semantic/analyze/fcn.el
12600 (semantic-analyze-dereference-metatype-1):
12601 * cedet/semantic/bovine/c.el (semantic-lex-cpp-define)
12602 (semantic-lex-cpp-undef):
12603 * cedet/semantic/wisent/wisent.el (wisent-skip-block):
12604 * cedet/srecode/srt-mode.el (semantic-beginning-of-context)
12605 (semantic-end-of-context): Fix typos in docstrings.
12606 11954
12607 * recentf.el (recentf-unload-function): New function. 11955 * recentf.el (recentf-unload-function): New function.
12608 11956
126092009-10-04 Chong Yidong <cyd@stupidchicken.com>
12610
12611 * cedet/ede.el (ede-project-placeholder-cache-file):
12612 * cedet/semantic/db-file.el (semanticdb-default-save-directory):
12613 * cedet/srecode/map.el (srecode-map-save-file):
12614 Use locate-user-emacs-file. Suggested by Juanma Barranquero.
12615
126162009-10-04 Glenn Morris <rgm@gnu.org> 119572009-10-04 Glenn Morris <rgm@gnu.org>
12617 11958
12618 * window.el (window-full-height-p): Add doc string. 11959 * window.el (window-full-height-p): Add doc string.
@@ -12621,51 +11962,6 @@
12621 11962
12622 * window.el (window-full-height-p): New function. (Bug#4543) 11963 * window.el (window-full-height-p): New function. (Bug#4543)
12623 11964
126242009-10-03 Chong Yidong <cyd@stupidchicken.com>
12625
12626 * cedet/srecode/insert.el: Require srecode/args.
12627
12628 * cedet/srecode/args.el: Require srecode/dictionary instead of
12629 srecode/insert.
12630
12631 * cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
12632
12633 * files.el (auto-mode-alist): Add .srt and Project.ede.
12634
12635 * cedet/semantic.el (semantic-mode):
12636 Handle srecode-template-mode-hook as well.
12637 (semantic-mode): Use js-mode-hook for Javascript hook.
12638
12639 * cedet/srecode/template.el: Remove hook variable.
12640
12641 * cedet/ede/proj-comp.el: Require ede/pmake when compiling.
12642
12643 * cedet/ede.el (ede-target-forms-menu): Don't enable if no
12644 projects exist.
12645 (ede-project-placeholder-cache-file): Default to a file in
12646 user-emacs-directory.
12647
12648 * cedet/srecode/map.el (srecode-map-base-template-dir): Look for
12649 templates in data-directory.
12650 (srecode-map-save-file): Default to a file in user-emacs-directory.
12651
12652 * cedet/ede/srecode.el (ede-srecode-setup): Use default templates
12653 directory.
12654
126552009-09-30 Eric Ludlam <zappo@gnu.org>
12656
12657 * cedet/semantic/util-modes.el (semantic-highlight-func-mode):
12658 Doc fix.
12659
12660 * cedet/ede/proj-comp.el (ede-proj-makefile-insert-variables):
12661 Only insert each variable once.
12662
12663 * cedet/ede/pmake.el (ede-pmake-insert-variable-once): New macro.
12664 (ede-pmake-insert-variable-shared): Use it.
12665
12666 * cedet/ede/cpp-root.el (ede-preprocessor-map): Do not deref table
12667 for lexical table iff table is nil.
12668
126692009-10-03 Dan Nicolaescu <dann@ics.uci.edu> 119652009-10-03 Dan Nicolaescu <dann@ics.uci.edu>
12670 11966
12671 * vc.el: Remove commented out code. 11967 * vc.el: Remove commented out code.
@@ -12685,9 +11981,6 @@
12685 the frame is wide. 11981 the frame is wide.
12686 (calendar-generate-window): Test for shrinkability rather than width. 11982 (calendar-generate-window): Test for shrinkability rather than width.
12687 11983
12688 * cedet/semantic/db-find.el (data-debug-insert-tag-list): Comment out
12689 declaration, currently false.
12690
12691 * mail/rmail.el (rmail-generate-viewer-buffer): Be more careful about 11984 * mail/rmail.el (rmail-generate-viewer-buffer): Be more careful about
12692 reusing existing buffers, in case we happen to visit two files with the 11985 reusing existing buffers, in case we happen to visit two files with the
12693 same basename. (Bug#4593) 11986 same basename. (Bug#4593)
@@ -12957,142 +12250,10 @@
12957 * emacs-lisp/eieio.el (defclass, eieio-defclass-autoload) 12250 * emacs-lisp/eieio.el (defclass, eieio-defclass-autoload)
12958 (eieio-copy-parents-into-subclass, make-instance, class-children) 12251 (eieio-copy-parents-into-subclass, make-instance, class-children)
12959 (eieio-generic-form): 12252 (eieio-generic-form):
12960 * cedet/cedet-files.el (cedet-directory-name-to-file-name):
12961 * cedet/cedet-idutils.el (cedet-idutils-search)
12962 (cedet-idutils-expand-filename, cedet-idutils-support-for-directory)
12963 (cedet-idutils-version-check):
12964 * cedet/cedet.el (cedet-version):
12965 * cedet/data-debug.el (data-debug-insert-overlay-button)
12966 (data-debug-insert-overlay-list-button)
12967 (data-debug-insert-buffer-button)
12968 (data-debug-insert-buffer-list-button)
12969 (data-debug-insert-process-button, data-debug-insert-ring-button)
12970 (data-debug-insert-widget, data-debug-insert-stuff-list-button)
12971 (data-debug-insert-stuff-vector-button)
12972 (data-debug-insert-symbol-button, data-debug-insert-string)
12973 (data-debug-insert-number, data-debug-insert-lambda-expression)
12974 (data-debug-insert-nil, data-debug-insert-simple-thing)
12975 (data-debug-insert-custom, data-debug-edebug-expr):
12976 * cedet/ede.el (ede-auto-add-method, ede-project-class-files)
12977 (global-ede-mode-map, ede-new, ede-debug-target)
12978 (ede-customize-current-target, ede-buffers, ede-map-buffers, ede-set):
12979 * cedet/semantic.el (semantic-minimum-working-buffer-size)
12980 (semantic-fetch-tags, semantic-submode-list)
12981 (semantic-default-submodes):
12982 * cedet/ede/source.el (ede-source-match):
12983 * cedet/ede/project-am.el (project-am-type-alist, project-add-file)
12984 (project-am-package-info):
12985 * cedet/ede/proj.el (ede-proj-target, project-new-target):
12986 * cedet/ede/proj-elisp.el (ede-proj-tweak-autoconf):
12987 * cedet/ede/proj-comp.el (ede-current-build-list):
12988 * cedet/ede/makefile-edit.el (makefile-move-to-macro):
12989 * cedet/ede/files.el (ede-toplevel-project-or-nil):
12990 * cedet/ede/cpp-root.el (initialize-instance):
12991 * cedet/ede/autoconf-edit.el (autoconf-find-last-macro)
12992 (autoconf-parameter-strip, autoconf-insert-new-macro):
12993 * cedet/semantic/wisent.el (wisent-lex-eoi):
12994 * cedet/semantic/util-modes.el (global-semantic-show-parser-state-mode)
12995 (semantic-show-parser-state-mode):
12996 * cedet/semantic/texi.el (semantic-texi-environment-regexp):
12997 * cedet/semantic/tag.el (semantic-tag-new-variable)
12998 (semantic-tag-class, semantic-tag-new-variable, semantic-tag-copy)
12999 (semantic--tag-deep-copy-attributes, semantic--tag-deep-copy-value)
13000 (semantic--tag-deep-copy-tag-list)
13001 (semantic-tag-components-with-overlays-default):
13002 * cedet/semantic/symref.el (semantic-symref-find-text):
13003 * cedet/semantic/senator.el (senator-yank-tag)
13004 (senator-transpose-tags-up):
13005 * cedet/semantic/scope.el (semantic-analyze-scoped-tags-default)
13006 (semantic-analyze-scoped-inherited-tags, semantic-scope-find):
13007 * cedet/semantic/sb.el (semantic-sb-autoexpand-length):
13008 * cedet/semantic/lex.el (semantic-lex-comment-regex)
13009 (semantic-lex-maximum-depth, define-lex, semantic-lex-token)
13010 (semantic-lex-unterminated-syntax-protection, define-lex-analyzer):
13011 * cedet/semantic/lex-spp.el
13012 (semantic-lex-spp-dynamic-macro-symbol-obarray-stack)
13013 (semantic-lex-spp-symbol, semantic-lex-spp-one-token-to-txt):
13014 * cedet/semantic/idle.el
13015 (semantic-idle-summary-current-symbol-info-brutish)
13016 (semantic-idle-summary-current-symbol-info-default):
13017 * cedet/semantic/grammar.el (semantic-grammar-recreate-package)
13018 (semantic--grammar-macro-compl-dict):
13019 * cedet/semantic/grammar-wy.el (semantic-grammar-wy--parse-table):
13020 * cedet/semantic/format.el (semantic-format-tag-custom-list)
13021 (semantic-format-tag-canonical-name-default):
13022 * cedet/semantic/find.el (semantic-find-tag-by-overlay-in-region)
13023 (semantic-find-tags-for-completion)
13024 (semantic-find-tags-by-scope-protection-default)
13025 (semantic-deep-find-tags-for-completion):
13026 * cedet/semantic/edit.el
13027 (semantic-edits-incremental-reparse-failed-hook)
13028 (semantic-edits-verbose-flag, semantic-edits-assert-valid-region)
13029 (semantic-edits-splice-remove, semantic-edits-splice-replace):
13030 * cedet/semantic/doc.el (semantic-documentation-comment-preceeding-tag):
13031 * cedet/semantic/dep.el (semantic-dependency-include-path):
13032 * cedet/semantic/db.el (semanticdb-default-find-index-class)
13033 (semanticdb-match-any-mode, semanticdb-with-match-any-mode)
13034 (semanticdb-project-roots):
13035 * cedet/semantic/db-find.el (semanticdb-implied-include-tags)
13036 (semanticdb-find-adebug-insert-scanned-tag-cons)
13037 (semanticdb-find-log-buffer-name, semanticdb-find-result-mapc)
13038 (semanticdb-brute-deep-find-tags-for-completion):
13039 * cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-add-tree-to-table):
13040 * cedet/semantic/ctxt.el (semantic-beginning-of-context-default)
13041 (semantic-end-of-context-default)
13042 (semantic-ctxt-current-function-default)
13043 (semantic-ctxt-scoped-types-default):
13044 * cedet/semantic/complete.el (semantic-complete-read-tag-engine)
13045 (semantic-complete-inline-tag-engine)
13046 (semantic-complete-inline-custom-type)
13047 (semantic-complete-read-tag-analyzer):
13048 * cedet/semantic/chart.el (semantic-chart-tags-by-class)
13049 (semantic-chart-database-size):
13050 * cedet/semantic/analyze.el (semantic-analyze-current-symbol)
13051 (semantic-analyze-current-context):
13052 * cedet/semantic/symref/list.el (semantic-symref)
13053 (semantic-symref-hide-buffer, semantic-symref-symbol):
13054 * cedet/semantic/symref/grep.el (semantic-symref-grep-use-template):
13055 * cedet/semantic/symref/filter.el (semantic-symref-hits-in-region):
13056 * cedet/semantic/bovine/el.el (semantic-elisp-form-to-doc-string):
13057 * cedet/semantic/bovine/c.el (semantic-lex-c-preprocessor-symbol-map)
13058 (semantic-c-parse-token-hack-depth, semantic-c--template-name-1)
13059 (semantic-c-dereference-template):
13060 * cedet/semantic/analyze/refs.el (semantic--analyze-refs-full-lookup)
13061 (semantic--analyze-refs-full-lookup-with-parents)
13062 (semantic--analyze-refs-full-lookup-simple):
13063 * cedet/semantic/analyze/complete.el
13064 (semantic-analyze-possible-completions):
13065 * cedet/srecode/table.el (srecode-mode-table-new):
13066 * cedet/srecode/srt.el (srecode-read-variable-name):
13067 * cedet/srecode/srt-mode.el (srecode-macro-help, srecode-in-macro-p):
13068 * cedet/srecode/semantic.el (srecode-semantic-handle-:tag)
13069 (srecode-semantic-handle-:tagtype, srecode-semantic-insert-tag):
13070 * cedet/srecode/map.el (srecode-current-map):
13071 * cedet/srecode/insert.el (srecode-insert)
13072 (srecode-insert-variable-secondname-handler, srecode-insert-method)
13073 (srecode-template-inserter-point-override)
13074 (srecode-insert-include-lookup):
13075 * cedet/srecode/getset.el (srecode-auto-choose-class):
13076 * cedet/srecode/extract.el (srecode-inserter-extract):
13077 * cedet/srecode/document.el
13078 (srecode-document-autocomment-return-last-alist)
13079 (srecode-document-autocomment-param-type-alist)
13080 (srecode-document-insert-function-comment)
13081 (srecode-document-insert-variable-one-line-comment)
13082 (srecode-document-function-name-comment):
13083 * cedet/srecode/dictionary.el (srecode-create-dictionary)
13084 (srecode-compound-toString):
13085 * cedet/srecode/compile.el (srecode-flush-active-templates):
13086 * cedet/srecode/args.el (srecode-semantic-handle-:blank):
13087 Doc/message fixes.
13088 12253
13089 * vc-cvs.el (vc-cvs-parse-entry): Be more careful with the 12254 * vc-cvs.el (vc-cvs-parse-entry): Be more careful with the
13090 match-data. (Bug#4555). 12255 match-data. (Bug#4555).
13091 12256
13092 * cedet/semantic/bovine/gcc.el
13093 (semantic-c-reset-preprocessor-symbol-map): Fix declaration.
13094 (semantic-gcc-get-include-paths, semantic-gcc-setup-data): Doc fixes.
13095
13096 * emacs-lisp/check-declare.el (check-declare-scan): Read the declaration 12257 * emacs-lisp/check-declare.el (check-declare-scan): Read the declaration
13097 rather than parsing it as a regexp. This relaxes the layout 12258 rather than parsing it as a regexp. This relaxes the layout
13098 requirements and makes errors easier to detect. 12259 requirements and makes errors easier to detect.
@@ -13107,41 +12268,8 @@
13107 * term/w32-win.el (setup-default-fontset, set-fontset-font): 12268 * term/w32-win.el (setup-default-fontset, set-fontset-font):
13108 Remove unused declarations. 12269 Remove unused declarations.
13109 12270
131102009-10-01 Juanma Barranquero <lekktu@gmail.com>
13111
13112 * cedet/semantic/wisent/javat-wy.el
13113 (wisent-java-tags-wy--keyword-table): Use \000 instead of literal ^@.
13114
131152009-09-30 Juanma Barranquero <lekktu@gmail.com>
13116
13117 * cedet/srecode/expandproto.el: Fix provide statement.
13118
131192009-09-30 Eric Ludlam <zappo@gnu.org>
13120
13121 * emacs-lisp/eieio.el (boolean-p): Delete.
13122
131232009-09-30 Sascha Wilde <wilde@sha-bang.de>
13124
13125 * cedet/ede/srecode.el: Fix provide statement.
13126
131272009-09-30 Glenn Morris <rgm@gnu.org> 122712009-09-30 Glenn Morris <rgm@gnu.org>
13128 12272
13129 * cedet/ede/proj.el (ede-proj-target-makefile-miscelaneous):
13130 * cedet/ede/proj-aux.el (ede-aux-source):
13131 * cedet/ede/proj-misc.el (ede-proj-target-makefile-miscelaneous)
13132 (ede-misc-source):
13133 * cedet/semantic/mru-bookmark.el (semantic-mrub-completing-read)
13134 (semantic-mrub-switch-tags): Fix doc typos.
13135
13136 * cedet/semantic/db-global.el (data-debug-new-buffer)
13137 (data-debug-insert-thing): Remove unneeded declarations (one broken).
13138 (semanticdb-enable-gnu-global-databases): Fix prompt typo.
13139
13140 * cedet/semantic/analyze/fcn.el (semantic-scope-find): Fix declaration.
13141
13142 * cedet/semantic/bovine/gcc.el (semantic-gcc-setup): Replace runtime
13143 use of CL function `remove-if-not'.
13144
13145 * emacs-lisp/authors.el (authors-ignored-files): Add "js2-mode.el". 12273 * emacs-lisp/authors.el (authors-ignored-files): Add "js2-mode.el".
13146 12274
13147 * emacs-lisp/elint.el (elint-init-form): Report declarations where the 12275 * emacs-lisp/elint.el (elint-init-form): Report declarations where the
@@ -13179,16 +12307,6 @@
13179 12307
131802009-09-29 Glenn Morris <rgm@gnu.org> 123082009-09-29 Glenn Morris <rgm@gnu.org>
13181 12309
13182 * cedet/semantic/symref/idutils.el:
13183 * cedet/semantic/symref/list.el: Relicense under GPLv3+.
13184
13185 * cedet/ede/srecode.el (srecode-resolve-arguments): Fix declaration.
13186
13187 * cedet/semantic/complete.el (semantic-displayor-focus-abstract-child-p):
13188 * cedet/semantic/tag-file.el (semanticdb-table-child-p):
13189 * cedet/srecode/compile.el (srecode-template-inserter-newline-child-p):
13190 Mark declarations not understood by check-declare.
13191
13192 * emacs-lisp/check-declare.el (check-declare-locate): Remove pointless 12310 * emacs-lisp/check-declare.el (check-declare-locate): Remove pointless
13193 file-name-nondirectory call preventing location of cedet files. 12311 file-name-nondirectory call preventing location of cedet files.
13194 (check-declare-verify): Use literal search rather than re-search. 12312 (check-declare-verify): Use literal search rather than re-search.
@@ -13226,15 +12344,6 @@
13226 12344
13227 * Makefile.in (ELCFILES): Add CEDET files. 12345 * Makefile.in (ELCFILES): Add CEDET files.
13228 12346
132292009-09-28 Eric Ludlam <zappo@gnu.org>
13230
13231 CEDET (development tools) package merged.
13232
13233 * cedet/*.el:
13234 * cedet/ede/*.el:
13235 * cedet/semantic/*.el:
13236 * cedet/srecode/*.el: New files.
13237
132382009-09-28 Michael Albinus <michael.albinus@gmx.de> 123472009-09-28 Michael Albinus <michael.albinus@gmx.de>
13239 12348
13240 * Makefile.in (ELCFILES): Add net/tramp-imap.elc. 12349 * Makefile.in (ELCFILES): Add net/tramp-imap.elc.
@@ -13248,26 +12357,6 @@
13248 12357
13249 * net/tramp-imap.el: New package. 12358 * net/tramp-imap.el: New package.
13250 12359
132512009-09-28 Eric Ludlam <zappo@gnu.org>
13252
13253 * emacs-lisp/chart.el:
13254 * emacs-lisp/eieio-base.el:
13255 * emacs-lisp/eieio-comp.el:
13256 * emacs-lisp/eieio-custom.el:
13257 * emacs-lisp/eieio-datadebug.el:
13258 * emacs-lisp/eieio-opt.el:
13259 * emacs-lisp/eieio-speedbar.el:
13260 * emacs-lisp/eieio.el: New files.
13261
13262 * cedet/cedet-cscope.el:
13263 * cedet/cedet-files.el:
13264 * cedet/cedet-global.el:
13265 * cedet/cedet-idutils.el:
13266 * cedet/data-debug.el:
13267 * cedet/inversion.el:
13268 * cedet/mode-local.el:
13269 * cedet/pulse.el: New files.
13270
132712009-09-27 Vinicius Jose Latorre <viniciusjl@ig.com.br> 123602009-09-27 Vinicius Jose Latorre <viniciusjl@ig.com.br>
13272 12361
13273 * whitespace.el (whitespace-trailing-regexp) 12362 * whitespace.el (whitespace-trailing-regexp)
diff --git a/lisp/calculator.el b/lisp/calculator.el
index a20efdbc122..d03b2082bdb 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -369,7 +369,8 @@ documentation for an example.")
369Used for repeating operations in calculator-repR/L.") 369Used for repeating operations in calculator-repR/L.")
370 370
371(defvar calculator-registers ; use user-bindings first 371(defvar calculator-registers ; use user-bindings first
372 (append calculator-user-registers (list (cons ?e e) (cons ?p pi))) 372 (append calculator-user-registers
373 (list (cons ?e float-e) (cons ?p float-pi)))
373 "The association list of calculator register values.") 374 "The association list of calculator register values.")
374 375
375(defvar calculator-saved-global-map nil 376(defvar calculator-saved-global-map nil
@@ -1300,7 +1301,7 @@ arguments."
1300 (calculator-funcall __f__ x y)))) 1301 (calculator-funcall __f__ x y))))
1301 (fset 'D (function 1302 (fset 'D (function
1302 (lambda (x) 1303 (lambda (x)
1303 (if calculator-deg (/ (* x 180) pi) x)))) 1304 (if calculator-deg (/ (* x 180) float-pi) x))))
1304 (unwind-protect (eval f) 1305 (unwind-protect (eval f)
1305 (if Fbound (fset 'F Fsave) (fmakunbound 'F)) 1306 (if Fbound (fset 'F Fsave) (fmakunbound 'F))
1306 (if Dbound (fset 'D Dsave) (fmakunbound 'D))))) 1307 (if Dbound (fset 'D Dsave) (fmakunbound 'D)))))
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index ea419aee52d..18f7a36012f 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -334,30 +334,42 @@ displayed in a window:
334 (if (or force ; eg initialize, diary save 334 (if (or force ; eg initialize, diary save
335 (null appt-prev-comp-time) ; first check 335 (null appt-prev-comp-time) ; first check
336 (< cur-comp-time appt-prev-comp-time)) ; new day 336 (< cur-comp-time appt-prev-comp-time)) ; new day
337 (condition-case nil 337 (ignore-errors
338 (if appt-display-diary 338 (if appt-display-diary
339 (let ((diary-hook 339 (let ((diary-hook
340 (if (assoc 'appt-make-list diary-hook) 340 (if (assoc 'appt-make-list diary-hook)
341 diary-hook 341 diary-hook
342 (cons 'appt-make-list diary-hook)))) 342 (cons 'appt-make-list diary-hook))))
343 (diary)) 343 (diary))
344 (let* ((diary-display-function 'appt-make-list) 344 (let* ((diary-display-function 'appt-make-list)
345 (d-buff (find-buffer-visiting diary-file)) 345 (d-buff (find-buffer-visiting diary-file))
346 (selective 346 (selective
347 (if d-buff ; diary buffer exists 347 (if d-buff ; diary buffer exists
348 (with-current-buffer d-buff 348 (with-current-buffer d-buff
349 diary-selective-display)))) 349 diary-selective-display)))
350 ;; FIXME why not using diary-list-entries with 350 d-buff2)
351 ;; non-nil LIST-ONLY? 351 ;; Not displaying the diary, so we can ignore
352 (diary) 352 ;; diary-number-of-entries. Since appt.el only
353 ;; If the diary buffer existed before this command, 353 ;; works on a daily basis, no need for more entries.
354 ;; restore its display state. Otherwise, kill it. 354 ;; FIXME why not using diary-list-entries with
355 (if d-buff 355 ;; non-nil LIST-ONLY?
356 ;; Displays the diary buffer. 356 (diary 1)
357 (or selective (diary-show-all-entries)) 357 ;; If the diary buffer existed before this command,
358 (and (setq d-buff (find-buffer-visiting diary-file)) 358 ;; restore its display state. Otherwise, kill it.
359 (kill-buffer d-buff))))) 359 (and (setq d-buff2 (find-buffer-visiting diary-file))
360 (error nil))) 360 (if d-buff
361 (or selective
362 (with-current-buffer d-buff2
363 (if diary-selective-display
364 ;; diary-show-all-entries displays
365 ;; the diary buffer.
366 (diary-unhide-everything))))
367 ;; FIXME does not kill any included diary files.
368 ;; The real issue is that (diary) should not
369 ;; have the side effect of visiting all the
370 ;; diary files. It is not really appt.el's job to
371 ;; clean up this mess...
372 (kill-buffer d-buff2)))))))
361 (setq appt-prev-comp-time cur-comp-time 373 (setq appt-prev-comp-time cur-comp-time
362 appt-mode-string nil 374 appt-mode-string nil
363 appt-display-count nil) 375 appt-display-count nil)
@@ -573,6 +585,17 @@ appointment package (if it is not already active)."
573 (let ((entry-list diary-entries-list) 585 (let ((entry-list diary-entries-list)
574 (new-time-string "") 586 (new-time-string "")
575 time-string) 587 time-string)
588 ;; Below, we assume diary-entries-list was in date
589 ;; order. It is, unless something on
590 ;; diary-list-entries-hook has changed it, eg
591 ;; diary-include-other-files (bug#7019). It must be
592 ;; in date order if number = 1.
593 (and diary-list-entries-hook
594 appt-display-diary
595 (not (eq diary-number-of-entries 1))
596 (not (memq (car (last diary-list-entries-hook))
597 '(diary-sort-entries sort-diary-entries)))
598 (setq entry-list (sort entry-list 'diary-entry-compare)))
576 ;; Skip diary entries for dates before today. 599 ;; Skip diary entries for dates before today.
577 (while (and entry-list 600 (while (and entry-list
578 (calendar-date-compare 601 (calendar-date-compare
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 46926050362..219e489a2eb 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -711,14 +711,26 @@ The arguments are DATE and NUMBER; the entries selected are those
711for NUMBER days starting with date DATE. The other entries are hidden 711for NUMBER days starting with date DATE. The other entries are hidden
712using overlays. If NUMBER is less than 1, this function does nothing. 712using overlays. If NUMBER is less than 1, this function does nothing.
713 713
714Returns a list of all relevant diary entries found, if any, in order by date. 714Returns a list of all relevant diary entries found.
715The list entries have the form ((MONTH DAY YEAR) STRING SPECIFIER) where 715The list entries have the form ((MONTH DAY YEAR) STRING SPECIFIER) where
716\(MONTH DAY YEAR) is the date of the entry, STRING is the entry text, and 716\(MONTH DAY YEAR) is the date of the entry, STRING is the entry text, and
717SPECIFIER is the applicability. If the variable `diary-list-include-blanks' 717SPECIFIER is the applicability. If the variable `diary-list-include-blanks'
718is non-nil, this list includes a dummy diary entry consisting of the empty 718is non-nil, this list includes a dummy diary entry consisting of the empty
719string for a date with no diary entries. 719string for a date with no diary entries.
720 720
721After the list is prepared, the following hooks are run: 721If entries are being produced for multiple dates (i.e., NUMBER > 1),
722then this function normally returns the entries from any given
723diary file in date order. The entries for any given day are in
724the order in which they were found in the file, not necessarily
725in time-of-day order. Note that any functions present on the
726hooks (see below) may add entries, or change the order. For
727example, `diary-include-other-diary-files' adds entries from any
728include files that it finds to the end of the original list. The
729entries from each file will be in date order, but the overall
730list will not be. If you want the entire list to be in time order,
731add `diary-sort-entries' to the end of `diary-list-entries-hook'.
732
733After the initial list is prepared, the following hooks are run:
722 734
723 `diary-nongregorian-listing-hook' can cull dates from the diary 735 `diary-nongregorian-listing-hook' can cull dates from the diary
724 and each included file, for example to process Islamic diary 736 and each included file, for example to process Islamic diary
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 8cf831f9945..b7a728461f0 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -753,12 +753,12 @@ The values of `calendar-daylight-savings-starts',
753 (sin (mod 753 (sin (mod
754 (+ (cadr x) 754 (+ (cadr x)
755 (* (nth 2 x) U)) 755 (* (nth 2 x) U))
756 (* 2 pi))))) 756 (* 2 float-pi)))))
757 solar-data-list))))) 757 solar-data-list)))))
758 (aberration 758 (aberration
759 (* 0.0000001 (- (* 17 (cos (+ 3.10 (* 62830.14 U)))) 973))) 759 (* 0.0000001 (- (* 17 (cos (+ 3.10 (* 62830.14 U)))) 973)))
760 (A1 (mod (+ 2.18 (* U (+ -3375.70 (* 0.36 U)))) (* 2 pi))) 760 (A1 (mod (+ 2.18 (* U (+ -3375.70 (* 0.36 U)))) (* 2 float-pi)))
761 (A2 (mod (+ 3.51 (* U (+ 125666.39 (* 0.10 U)))) (* 2 pi))) 761 (A2 (mod (+ 3.51 (* U (+ 125666.39 (* 0.10 U)))) (* 2 float-pi)))
762 (nutation (* -0.0000001 (+ (* 834 (sin A1)) (* 64 (sin A2)))))) 762 (nutation (* -0.0000001 (+ (* 834 (sin A1)) (* 64 (sin A2))))))
763 (mod (radians-to-degrees (+ longitude aberration nutation)) 360.0))) 763 (mod (radians-to-degrees (+ longitude aberration nutation)) 360.0)))
764 764
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
new file mode 100644
index 00000000000..fb2fa1c9c05
--- /dev/null
+++ b/lisp/cedet/ChangeLog
@@ -0,0 +1,1436 @@
12010-09-21 Eric Ludlam <zappo@gnu.org>
2
3 Synch SRecode to CEDET 1.0.
4
5 * pulse.el (pulse-momentary-highlight-overlay): If pulse-flag is
6 'never, disable all pulsing.
7
8 * cedet.el (cedet-version):
9 * srecode.el (srecode-version): Bump version to 1.0.
10
11 * srecode/texi.el (srecode-texi-insert-tag-as-doc): New function.
12 (semantic-insert-foreign-tag): Use it.
13
14 * srecode/mode.el (srecode-bind-insert): Call
15 srecode-load-tables-for-mode.
16 (srecode-minor-mode-templates-menu): Do not list templates that
17 are not in the current project.
18 (srecode-menu-bar): Add binding for srecode-macro-help.
19
20 * srecode/table.el (srecode-template-table): Add :project slot.
21 (srecode-dump): Dump it.
22
23 * srecode/map.el (srecode-map-update-map): Make map loading more
24 robust.
25
26 * srecode/insert.el (srecode-insert-fcn): Merge template
27 dictionary before resolving arguments.
28 (srecode-insert-method-helper): Add error checking to make sure
29 that we only have dictionaries.
30 (srecode-insert-method): Check template nesting depth when using
31 point inserter override.
32 (srecode-insert-method): Install override with depth limit.
33
34 * srecode/getset.el (srecode-insert-getset): Force tag table
35 update. Don't query the class if it is empty.
36
37 * srecode/find.el (srecode-template-get-table)
38 (srecode-template-get-table-for-binding)
39 (srecode-all-template-hash): Skip if not in current project.
40 (srecode-template-table-in-project-p): New method.
41
42 * srecode/fields.el (srecode-fields-exit-confirmation): New option.
43 (srecode-field-exit-ask): Use it.
44
45 * srecode/dictionary.el (srecode-dictionary-add-template-table):
46 Do not add variables in tables not for the current project.
47 (srecode-compound-toString): Handle cases where the default value
48 is another compound value.
49 (srecode-dictionary-lookup-name): New optional argument
50 NON-RECURSIVE, which inhibits visiting dictionary parents.
51 (srecode-dictionary-add-section-dictionary)
52 (srecode-dictionary-merge): New optional argument FORCE adds
53 values even if an identically named entry exists.
54 (srecode-dictionary-add-entries): New method.
55 (srecode-create-dictionaries-from-tags): New function.
56
57 * srecode/cpp.el (srecode-cpp): New defgroup.
58 (srecode-cpp-namespaces): New option.
59 (srecode-semantic-handle-:using-namespaces)
60 (srecode-cpp-apply-templates): New functions.
61 (srecode-semantic-apply-tag-to-dict): Handle template parameters
62 by calling `srecode-cpp-apply-templates'.
63
64 * srecode/compile.el (srecode-compile-templates): Fix directory
65 compare of built-in templates. Give built-ins lower piority.
66 Support special variable "project".
67 (srecode-compile-template-table): Set :project slot of new tables.
68 (srecode-compile-one-template-tag): Use
69 srecode-create-dictionaries-from-tags.
70
712010-09-21 Eric Ludlam <zappo@gnu.org>
72
73 Synch EDE to CEDET 1.0.
74
75 * cedet-idutils.el (cedet-idutils-make-command): New option.
76 (cedet-idutils-mkid-call):
77 (cedet-idutils-create/update-database): New functions.
78
79 * cedet-cscope.el (cedet-cscope-create):
80 (cedet-cscope-create/update-database): New functions.
81 (cedet-cscope-support-for-directory): Make interactive.
82
83 * cedet-global.el (cedet-global-gtags-command): New option.
84 (cedet-gnu-global-gtags-call)
85 (cedet-gnu-global-create/update-database): New functions.
86
87 * ede.el (ede-save-cache): Fix recentf-exclude expression.
88 (ede-make-dist): Always use toplevel project.
89 (ede-buffer-object): If we fail to find an object in the current
90 project, loop upward looking for a match. If no target is found,
91 use most local project.
92 (ede-buffer-belongs-to-target-p)
93 (ede-buffer-belongs-to-project-p): New functions.
94 (ede-initialize-state-current-buffer): New function.
95 (ede-target-forms-menu, ede-project-buffers): Use them.
96 (ede-minor-mode, ede-reset-all-buffers): Use it.
97 (project-interactive-select-target, project-add-file): Don't use
98 ede-project-force-load.
99 (ede-buffer-object): New arg PROJSYM.
100 (ede-minor-mode): Remove ede-directory-project-p test.
101 (ede-initialize-state-current-buffer): Don't test for
102 ede-directory-project-p if there is a matching open project.
103 (ede-customize-forms-menu): Prevent error if there is no project.
104 (ede-load-project-file): Set ede-constructing to the thing being
105 constructed, instead of t.
106 (ede-project-force-load): Deleted.
107
108 * ede/base.el:
109 * ede/auto.el:
110 * ede/custom.el: New files.
111
112 * ede/autoconf-edit.el (autoconf-find-last-macro)
113 (autoconf-parameters-for-macro): Parse multiline parameters of
114 macros. Optionally ignore case and at bol for macro.
115 (autoconf-parameter-strip): Use greedy match for newlines.
116 (autoconf-new-automake-string): Deleted.
117 (autoconf-new-program): Use SRecode to fill an empty file.
118
119 * ede/cpp-root.el (ede-create-lots-of-projects-under-dir): New
120 function.
121
122 * ede/files.el (ede-flush-project-hash): New command.
123 (ede-convert-path): Add optional PROJECT arg.
124 (ede-directory-project-p): Obey ".ede-ignore".
125 (ede-expand-filename-local)
126 (ede-expand-filename-impl-via-subproj): New methods.
127 (ede-expand-filename-impl): Use them.
128 (ede-project-root, ede-project-root-directory): Move to
129 ede/auto.el.
130
131 * ede/locate.el (ede-locate-flush-hash):
132 (ede-locate-create/update-root-database): New methods.
133 (initialize-instance): Use ede-locate-flush-hash.
134
135 * ede/pmake.el (ede-proj-makefile-insert-variables): If this is
136 the top project and not a metasubproject, set TOP to CURDIR.
137 (ede-proj-makefile-insert-variables): Output a target's object
138 list whether or not the vars are already in the Makefile.
139 (ede-pmake-insert-variable-once): New macro.
140
141 * ede/project-am.el (project-am-with-makefile-current): Add
142 recentf-exclude.
143 (project-am-load-makefile): Obey an optional suggested name.
144 (project-am-expand-subdirlist): New function.
145 (project-am-makefile::project-rescan): Use it. Combine SUBDIRS
146 and DIST_SUBDIRS.
147 (project-am-meta-type-alist): A list to scan better Makefile.am
148 (project-am-scan-for-targets): Scan also over
149 project-am-meta-type-alist.
150 (ede-system-include-path): Simple implementation.
151 (ede-find-target): Deleted. EDE core takes care of this.
152 (ede-buffer-mine): Create the searched filename as relative.
153 (project-am-load): Simplify, using autoconf-edit.
154 (project-am-extract-package-info): Fix separators.
155
156 * ede/proj.el (project-run-target): New method.
157 (project-make-dist, project-compile-project): Use
158 ede-proj-automake-p to determine which kind of compile to use.
159 (project-rescan): Call ede-load-project-file.
160 (ede-buffer-mine): Add more file names that belong to the project.
161 (ede-proj-compilers): Improve error message.
162
163 * ede/proj-obj.el (ede-ld-linker): Use the LDDEPS variable.
164 (ede-source-c++): Add more C++ extensions.
165 (ede-proj-target-makefile-objectcode): Quote initforms. Support
166 lex and yacc.
167
168 * ede/proj-prog.el (ede-proj-makefile-insert-rules): Removed.
169 (ede-proj-makefile-insert-variables): New, add LDDEPS.
170 (ede-proj-makefile-insert-automake-post-variables): Add LDADD
171 variable. Use ldlibs-local slot. Add a -l to ldlibs strings.
172 (ede-proj-target-makefile-program): Swap order of two slots so
173 they show up in the same order as in the command line.
174 (ede-proj-target-makefile-program): Add ldlibs-local slot.
175
176 * ede/proj-shared.el (ede-g++-libtool-shared-compiler): Fix
177 inference rule to use cpp files.
178 (ede-proj-target-makefile-shared-object): Quote initforms.
179
180 * ede/proj-misc.el (ede-proj-target-makefile-miscelaneous):
181 * ede/proj-info.el (ede-proj-target-makefile-info):
182 * ede/proj-aux.el (ede-proj-target-aux):
183 * ede/proj-archive.el (ede-proj-target-makefile-archive):
184 * ede/proj-elisp.el (ede-proj-target-elisp)
185 (ede-proj-target-elisp-autoloads): Quote initforms.
186
187 * ede/srecode.el (ede-srecode-setup): Load autoconf templates.
188
189 * ede/shell.el (ede-shell-buffer): Fix buffer name.
190
191 * ede/pconf.el (ede-proj-configure-synchronize): If user events
192 occur while waiting for the compile process to finish, pull them
193 in and discard those events.
194
1952010-09-19 Eric Ludlam <zappo@gnu.org>
196
197 Synch Semantic to CEDET 1.0.
198
199 * semantic.el (semantic-version): Update to 2.0.
200 (semantic-mode-map): Add "," and "m" bindings.
201 (navigate-menu): Update.
202
203 * semantic/symref.el (semantic-symref-calculate-rootdir):
204 New function.
205 (semantic-symref-detect-symref-tool): Use it.
206
207 * semantic/symref/grep.el (semantic-symref-grep-shell): New var.
208 (semantic-symref-perform-search): Use it. Calculate root dir with
209 semantic-symref-calculate-rootdir.
210 (semantic-symref-derive-find-filepatterns): Improve error message.
211
212 * semantic/symref/list.el
213 (semantic-symref-results-mode-map): New bindings.
214 (semantic-symref-auto-expand-results): New option.
215 (semantic-symref-results-dump): Obey auto-expand.
216 (semantic-symref-list-expand-all, semantic-symref-regexp)
217 (semantic-symref-list-contract-all)
218 (semantic-symref-list-map-open-hits)
219 (semantic-symref-list-update-open-hits)
220 (semantic-symref-list-create-macro-on-open-hit)
221 (semantic-symref-list-call-macro-on-open-hits): New functions.
222 (semantic-symref-list-menu-entries)
223 (semantic-symref-list-menu): New vars.
224 (semantic-symref-list-map-open-hits): Move cursor to beginning of
225 match before calling the mapped function.
226
227 * semantic/doc.el
228 (semantic-documentation-comment-preceeding-tag): Do nothing if the
229 mode doesn't provide comment-start-skip.
230
231 * semantic/scope.el
232 (semantic-analyze-scope-nested-tags-default): Strip duplicates.
233 (semantic-analyze-scoped-inherited-tag-map): Take the tag we are
234 looking for as part of the scoped tags list.
235
236 * semantic/html.el (semantic-default-html-setup): Add
237 senator-step-at-tag-classes.
238
239 * semantic/decorate/include.el
240 (semantic-decoration-on-unknown-includes): Change light bgcolor.
241 (semantic-decoration-on-includes-highlight-default): Check that
242 the include tag has a postion.
243
244 * semantic/complete.el (semantic-collector-local-members):
245 (semantic-complete-read-tag-local-members)
246 (semantic-complete-jump-local-members): New class and functions.
247 (semantic-complete-self-insert): Save excursion before completing.
248
249 * semantic/analyze/complete.el
250 (semantic-analyze-possible-completions-default): If no completions
251 are found, return the raw by-name-only completion list. Add FLAGS
252 arguments. Add support for 'no-tc (type constraint) and
253 'no-unique, or no stripping duplicates.
254 (semantic-analyze-possible-completions-default): Add FLAGS arg.
255
256 * semantic/util-modes.el
257 (semantic-stickyfunc-show-only-functions-p): New option.
258 (semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
259 the very first line in a buffer.
260
261 * semantic/util.el (semantic-hack-search)
262 (semantic-recursive-find-nonterminal-by-name)
263 (semantic-current-tag-interactive): Deleted.
264 (semantic-describe-buffer): Fix expand-nonterminal. Add
265 lex-syntax-mods, type relation separator char, and command
266 separation char.
267 (semantic-sanity-check): Only message if called interactively.
268
269 * semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
270 :filename property and the tag position.
271
272 * semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
273 Add recursion limit.
274
275 * semantic/imenu.el (semantic-imenu-bucketize-type-members):
276 Make this buffer local, not the obsoleted variable.
277
278 * semantic/idle.el: Add breadcrumbs support.
279 (semantic-idle-summary-current-symbol-info-default)
280 (semantic-idle-tag-highlight)
281 (semantic-idle-completion-list-default): Use
282 semanticdb-without-unloaded-file-searches for speed, and to
283 conform to the controls that specify if the idle timer is supposed
284 to be parsing unparsed includes.
285 (semantic-idle-symbol-highlight-face)
286 (semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
287 Callers changed.
288 (semantic-idle-work-parse-neighboring-files-flag): Default to nil.
289 (semantic-idle-work-update-headers-flag): New var.
290 (semantic-idle-work-for-one-buffer): Use it.
291 (semantic-idle-local-symbol-highlight): Rename from
292 semantic-idle-tag-highlight.
293 (semantic-idle-truncate-long-summaries): New option.
294
295 * semantic/ia.el (semantic-ia-cache)
296 (semantic-ia-get-completions): Deleted. Callers changed.
297 (semantic-ia-show-variants): New command.
298 (semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
299 (semantic-ia-show-summary): If there isn't anything to show, say so.
300
301 * semantic/grammar.el (semantic-grammar-create-package):
302 Save the buffer even in batch mode.
303
304 * semantic/fw.el
305 (semanticdb-without-unloaded-file-searches): New macro.
306
307 * semantic/dep.el (semantic-dependency-find-file-on-path):
308 Fix case dereferencing ede-object when it is a list.
309
310 * semantic/db-typecache.el (semanticdb-expand-nested-tag)
311 (semanticdb-typecache-faux-namespace): New functions.
312 (semanticdb-typecache-file-tags)
313 (semanticdb-typecache-merge-streams): Use them.
314 (semanticdb-typecache-file-tags): When deriving tags from a file,
315 give the mode a chance to monkey with the tag copy.
316 (semanticdb-typecache-find-default): Wrap find in save-excursion.
317 (semanticdb-typecache-find-by-name-helper): Merge found names down.
318
319 * semantic/db-global.el
320 (semanticdb-enable-gnu-global-in-buffer): Don't show messages if
321 GNU Global is not available and we don't want to throw an error.
322
323 * semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
324 When trying to normalize the tag to a buffer, don't error if
325 set-buffer method doesn't exist.
326
327 * semantic/db-file.el (semanticdb-save-db): Simplify msg.
328
329 * semantic/db.el (semanticdb-refresh-table): If forcing a
330 refresh on a file not in a buffer, use semantic-find-file-noselect
331 and delete the buffer after use.
332 (semanticdb-current-database-list): When calculating root via
333 hooks, force it through true-filename and skip the list of
334 possible roots.
335
336 * semantic/ctxt.el (semantic-ctxt-imported-packages): New.
337
338 * semantic/analyze/debug.el
339 (semantic-analyzer-debug-insert-tag): Reset standard output to
340 current buffer.
341 (semantic-analyzer-debug-global-symbol)
342 (semantic-analyzer-debug-missing-innertype): Change "prefix" to
343 "symbol" in messages.
344
345 * semantic/analyze/refs.el: (semantic-analyze-refs-impl)
346 (semantic-analyze-refs-proto): When calculating value, make sure
347 the found tag is 'similar' to the originating tag.
348 (semantic--analyze-refs-find-tags-with-parent): Attempt to
349 identify matches via imported symbols of parents.
350 (semantic--analyze-refs-full-lookup-with-parents): Do a deep
351 search during the brute search.
352
353 * semantic/analyze.el
354 (semantic-analyze-find-tag-sequence-default): Be robust to
355 calculated scopes being nil.
356
357 * semantic/bovine/c.el (semantic-c-describe-environment): Add
358 project macro symbol array.
359 (semantic-c-parse-lexical-token): Add recursion limit.
360 (semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
361 New overrides.
362 (semantic-expand-c-tag-namelist): Split a full type from a typedef
363 out to its own tag.
364 (semantic-expand-c-tag-namelist): Do not split out a typedef'd
365 inline type if it is an anonymous type.
366 (semantic-c-reconstitute-token): Use the optional initializers as
367 a clue that some function is probably a constructor. When
368 defining the type of these constructors, split the parent name,
369 and use only the class part, if applicable.
370
371 * semantic/bovine/c-by.el:
372 * semantic/wisent/python-wy.el: Regenerate.
373
3742010-07-20 Juanma Barranquero <lekktu@gmail.com>
375
376 * semantic/db-file.el (object-write): Fix typo in docstring.
377
3782010-06-03 Eric Ludlam <zappo@gnu.org>
379
380 * semantic/lex-spp.el
381 (semantic-lex-spp-table-write-slot-value): Instead of erroring on
382 invalid values during save, just save a nil (Bug#6324).
383
3842010-05-31 Jonathan Marchand <jonathlela@gmail.com> (tiny change)
385
386 * ede/cpp-root.el (ede-set-project-variables): Fix feature name
387 (bug#6231).
388
3892010-05-02 Stefan Monnier <monnier@iro.umontreal.ca>
390
391 Use a mode-line spec rather than a static string in Semantic.
392 * semantic/util-modes.el:
393 (semantic-minor-modes-format): New var to replace...
394 (semantic-minor-modes-status): Remove.
395 (semantic-mode-line-update): Construct a mode-line spec rather than
396 a static string so that mouse buttons can be used on individual minor
397 modes and so that semantic-mode-line-update only needs to be called
398 when global settings are changed.
399 (semantic-add-minor-mode, semantic-toggle-minor-mode-globally):
400 Call semantic-mode-line-update.
401 (semantic-toggle-minor-mode-globally): Don't assume mode is on
402 minor-mode-alist, check semantic-minor-mode-alist as well.
403 (semantic-stickyfunc-mode, semantic-show-parser-state-auto-marker)
404 (semantic-show-parser-state-marker, semantic-show-parser-state-mode)
405 (semantic-show-unmatched-syntax-mode, semantic-highlight-edits-mode):
406 * semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
407 * semantic/idle.el (semantic-idle-scheduler-mode)
408 (define-semantic-idle-service, semantic-idle-summary-mode):
409 * semantic/decorate/mode.el (semantic-decoration-mode):
410 Don't call semantic-mode-line-update any more.
411
4122010-05-02 Stefan Monnier <monnier@iro.umontreal.ca>
413
414 Use define-minor-mode in CEDET where applicable.
415
416 * srecode/mode.el (srecode-minor-mode,global-srecode-minor-mode):
417 Use define-minor-mode.
418
419 * semantic/util-modes.el (semantic-add-minor-mode):
420 Remove unused arg `keymap' and code redundant with define-minor-mode.
421 (semantic-toggle-minor-mode-globally): Only handle arg -1 and 1.
422 (semantic-stickyfunc-mode, global-semantic-show-unmatched-syntax-mode)
423 (semantic-highlight-func-mode, global-semantic-show-parser-state-mode)
424 (global-semantic-highlight-edits-mode, semantic-highlight-edits-mode)
425 (semantic-show-unmatched-syntax-mode, semantic-show-parser-state-mode)
426 (global-semantic-stickyfunc-mode, global-semantic-highlight-func-mode):
427 Use define-minor-mode.
428 (semantic-stickyfunc-mode-setup, semantic-highlight-edits-mode-setup)
429 (semantic-show-unmatched-syntax-mode-setup)
430 (semantic-show-parser-state-mode-setup)
431 (semantic-highlight-func-mode-setup): Inline into sole caller.
432
433 * semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
434 (semantic-mru-bookmark-mode): Use define-minor-mode.
435 (semantic-mru-bookmark-mode-setup): Inline into sole caller.
436
437 * semantic/idle.el (define-semantic-idle-service):
438 Use define-minor-mode and inline setup function into its sole caller.
439 (semantic-idle-scheduler-mode-setup)
440 (semantic-idle-summary-mode-setup): Inline into sole caller.
441 (global-semantic-idle-scheduler-mode, semantic-idle-scheduler-mode):
442 Use define-minor-mode.
443
444 * semantic/decorate/mode.el (global-semantic-decoration-mode)
445 (semantic-decoration-mode): Use define-minor-mode.
446 (semantic-decoration-mode-setup): Inline into sole caller.
447
448 * ede/dired.el (ede-dired-minor-mode): Initialize in declaration.
449 (ede-dired-minor-mode): Use define-minor-mode and derived-mode-p.
450 (ede-dired-add-to-target): Use dolist.
451
4522010-04-18 Chong Yidong <cyd@stupidchicken.com>
453
454 * ede/pmake.el (ede-proj-makefile-insert-variables):
455 Don't destroy list before using it.
456
4572010-04-29 Chong Yidong <cyd@stupidchicken.com>
458
459 * semantic.el (semantic-completion-at-point-function):
460 New function.
461 (semantic-mode): Use semantic-completion-at-point-function for
462 completion-at-point-functions instead.
463
4642010-04-28 Chong Yidong <cyd@stupidchicken.com>
465
466 * semantic.el (semantic-mode): When enabled, add
467 semantic-ia-complete-symbol to completion-at-point-functions.
468
469 * semantic/ia.el (semantic-ia-complete-symbol): Return nil
470 if Semantic is not active.
471
4722010-04-19 Chong Yidong <cyd@stupidchicken.com>
473
474 * ede/pmake.el (ede-proj-makefile-insert-variables):
475 Don't destroy list before using it.
476
4772010-04-02 Juanma Barranquero <lekktu@gmail.com>
478
479 * semantic/imenu.el (semantic-imenu-bucketize-type-members)
480 (semantic-create-imenu-directory-index): Fix typos in docstrings.
481 (semantic-imenu-goto-function): Reflow docstring.
482
4832010-03-24 Juanma Barranquero <lekktu@gmail.com>
484
485 * srecode/table.el (srecode-template-table): Fix docstring typo.
486
4872010-03-24 Glenn Morris <rgm@gnu.org>
488
489 * semantic/bovine/c.el (semantic-c-describe-environment):
490 Consistently check ede-object is bound throughout.
491
492 * ede/project-am.el (ede-shell-run-something): Declare.
493
4942010-03-13 Eric M. Ludlam <zappo@gnu.org>
495
496 * semantic/imenu.el: New file, from the CEDET repository
497 (Bug#5412).
498
4992010-03-06 Glenn Morris <rgm@gnu.org>
500
501 * semantic/grammar.el (semantic-grammar-header-template):
502 Update template copyright to GPLv3+.
503
5042010-02-28 Chong Yidong <cyd@stupidchicken.com>
505
506 * semantic/db-find.el
507 (semanticdb-find-translate-path-brutish-default):
508 * ede/make.el (ede-make-check-version): Use
509 with-current-buffer instead of save-excursion.
510
5112010-02-16 Chong Yidong <cyd@stupidchicken.com>
512
513 * data-debug.el (data-debug): Move to extensions group.
514
515 * ede.el (ede):
516 * srecode.el (srecode):
517 * semantic.el (semantic): Put in tools and extensions group.
518
5192010-02-14 Juanma Barranquero <lekktu@gmail.com>
520
521 * ede.el (ede-run-target, project-delete-target)
522 (project-dist-files, ede-name, ede-documentation, ede-parent-project)
523 (ede-adebug-project, ede-adebug-project-parent)
524 (ede-adebug-project-root): Fix typos in docstrings.
525
5262010-01-18 Juanma Barranquero <lekktu@gmail.com>
527
528 * ede/locate.el (ede-locate-file-in-project)
529 (ede-locate-file-in-project-impl): Fix typos in docstrings.
530 (ede-enable-locate-on-project): Fix typos in error messages.
531
532 * semantic/util-modes.el (semantic-unmatched-syntax-face)
533 (semantic-stickyfunc-old-hlf, semantic-stickyfunc-header-line-format)
534 (semantic-stickyfunc-sticky-classes, semantic-highlight-func-mode-setup)
535 (semantic-stickyfunc-fetch-stickyline): Fix typos in docstrings.
536 (semantic-stickyfunc-popup-menu, semantic-highlight-func-popup-menu):
537 Fix typos in menu help.
538
539 * semantic.el (semantic-require-version, semantic--buffer-cache)
540 (semantic-unmatched-syntax-cache-check, semantic-unmatched-syntax-hook)
541 (semantic--before-fetch-tags-hook, semantic-new-buffer-fcn-was-run)
542 (semantic--umatched-syntax-needs-refresh-p, semantic-elapsed-time)
543 (semantic-parse-stream, semantic-parse-region)
544 (semantic-parse-region-default, semantic--set-buffer-cache)
545 (semantic-minimum-working-buffer-size, semantic-refresh-tags-safe)
546 (semantic-bovinate-toplevel, semantic-load-system-cache-loaded)
547 (semantic-default-submodes):
548 * semantic/db-ebrowse.el (semanticdb-table-ebrowse)
549 (semanticdb-create-ebrowse-database)
550 (semanticdb-find-tags-for-completion-method)
551 (semanticdb-find-tags-by-class-method)
552 (semanticdb-deep-find-tags-by-name-method)
553 (semanticdb-deep-find-tags-for-completion-method):
554 * semantic/db-el.el (semanticdb-elisp-mapatom-collector)
555 (semanticdb-find-tags-by-name-method, emacs-lisp-mode)
556 (semanticdb-find-tags-for-completion-method)
557 (semanticdb-find-tags-by-class-method)
558 (semanticdb-deep-find-tags-for-completion-method):
559 * semantic/db-find.el (semanticdb-find-translate-path)
560 (semanticdb-find-need-cache-update-p, semanticdb-find-result-with-nil-p)
561 (semanticdb-find-scanned-include-tags, semanticdb-find-tags-collector)
562 (semanticdb-find-tags-by-name-method)
563 (semanticdb-find-tags-by-name-regexp-method)
564 (semanticdb-find-tags-for-completion-method)
565 (semanticdb-find-tags-by-class-method)
566 (semanticdb-find-tags-external-children-of-type-method)
567 (semanticdb-find-tags-subclasses-of-type-method)
568 (semanticdb-deep-find-tags-by-name-method)
569 (semanticdb-deep-find-tags-by-name-regexp-method)
570 (semanticdb-deep-find-tags-for-completion-method):
571 * semantic/db-global.el (semanticdb-enable-gnu-global-hook)
572 (semanticdb-enable-gnu-global-in-buffer)
573 (semanticdb-find-tags-for-completion-method)
574 (semanticdb-deep-find-tags-by-name-method)
575 (semanticdb-deep-find-tags-for-completion-method):
576 * semantic/db-javascript.el (semanticdb-javascript-tags)
577 (javascript-mode, semanticdb-find-translate-path)
578 (semanticdb-find-tags-for-completion-method)
579 (semanticdb-find-tags-by-class-method)
580 (semanticdb-deep-find-tags-by-name-method)
581 (semanticdb-deep-find-tags-for-completion-method)
582 (semanticdb-find-tags-external-children-of-type-method):
583 * semantic/idle.el (semantic-idle-work-core-handler)
584 (define-semantic-idle-service, semantic-idle-summary-useful-context-p)
585 (global-semantic-idle-scheduler-mode):
586 * srecode/dictionary.el (srecode-field-value)
587 (srecode-dictionary-add-section-dictionary):
588 Fix typos in docstrings.
589
5902010-01-17 Glenn Morris <rgm@gnu.org>
591
592 * semantic/idle.el (semantic-idle-work-for-one-buffer): Doc fix.
593
5942010-01-17 Juanma Barranquero <lekktu@gmail.com>
595
596 * semantic.el (semantic-mode): Fix typos in docstrings.
597
5982010-01-16 Mario Lang <mlang@delysid.org>
599
600 * ede/cpp-root.el (ede-cpp-root-project):
601 * ede/files.el (ede-expand-filename):
602 * ede/simple.el (ede-simple-project):
603 * semantic/complete.el (semantic-complete-read-tag-engine)
604 (semantic-complete-inline-tag-engine):
605 * semantic/db-el.el (semanticdb-equivalent-mode):
606 * semantic/db-global.el (semanticdb-equivalent-mode):
607 * semantic/db-javascript.el (semanticdb-equivalent-mode):
608 * semantic/db.el (semanticdb-equivalent-mode):
609 * semantic/decorate/include.el (semantic-decoration-unknown-include-describe):
610 * semantic/idle.el (semantic-idle-work-for-one-buffer):
611 Remove duplicated words in doc-strings.
612
6132010-01-14 Juanma Barranquero <lekktu@gmail.com>
614
615 * semantic/edit.el (semantic-reparse-needed-change-hook)
616 (semantic-no-reparse-needed-change-hook):
617 * srecode/insert.el (srecode-resolve-argument-list)
618 (srecode-template-inserter-blank, srecode-template-inserter-variable)
619 (srecode-template-inserter-ask, srecode-template-inserter-width)
620 (srecode-template-inserter-section-start)
621 (srecode-template-inserter-section-end, srecode-insert-method):
622
6232010-01-12 Juanma Barranquero <lekktu@gmail.com>
624
625 * data-debug.el (data-debug): Fix customization group reference.
626
6272010-01-12 Juanma Barranquero <lekktu@gmail.com>
628
629 * semantic/analyze.el (semantic-analyze-push-error)
630 (semantic-analyze-context, semantic-analyze-context-assignment)
631 (semantic-analyze-find-tag-sequence, semantic-analyze-find-tag):
632 * semantic/java.el (java-mode, semantic-tag-include-filename)
633 (semantic-java-doc-keywords-map):
634 * semantic/bovine/c.el (c-mode, semantic-c-member-of-autocast)
635 (semantic-lex-c-nested-namespace-ignore-second, semantic-parse-region)
636 (semantic-c-parse-lexical-token, semantic-c-debug-mode-init-pch)
637 (semantic-c-classname, semantic-format-tag-uml-prototype)
638 (semantic-c-dereference-namespace, semantic-analyze-type-constants):
639 * semantic/bovine/el.el (semantic-elisp-form-to-doc-string)
640 (semantic-emacs-lisp-obsoleted-doc, semantic-up-context)
641 (semantic-get-local-variables, semantic-end-of-command)
642 (semantic-beginning-of-command, semantic-ctxt-current-class-list)
643 (lisp-mode):
644 * semantic/bovine/make.el (makefile-mode):
645 * semantic/wisent/python.el (wisent-python-string-re)
646 (wisent-python-implicit-line-joining-p, wisent-python-forward-string)
647 (wisent-python-lex-beginning-of-line, wisent-python-lex-end-of-line)
648 (semantic-lex, semantic-get-local-variables, python-mode):
649 * semantic/wisent/python-wy.el (wisent-python-wy--keyword-table):
650 * srecode/extract.el (srecode-extract-state-set)
651 (srecode-extract-method): Fix typos in docstrings.
652
6532010-01-10 Chong Yidong <cyd@stupidchicken.com>
654
655 * semantic.el (semantic-new-buffer-setup-functions):
656 Add python parser.
657
6582010-01-10 Richard Kim <emacs18@gmail.com>
659
660 * semantic/wisent/python-wy.el:
661 * semantic/wisent/python.el: New files.
662
6632010-01-02 Juanma Barranquero <lekktu@gmail.com>
664
665 * semantic/db-typecache.el (semanticdb-typecache-find-default):
666 Fix typo in docstring.
667
6682009-12-14 Chong Yidong <cyd@stupidchicken.com>
669
670 * semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
671 (semantic-mru-bookmark-mode): Doc fixes.
672
673 * semantic/db.el (semanticdb-cache-get): Use error instead
674 of assert.
675
6762009-12-05 Chong Yidong <cyd@stupidchicken.com>
677
678 * semantic/ia.el (semantic-ia-complete-symbol):
679 Make argument optional.
680
6812009-12-05 Eric Ludlam <zappo@gnu.org>
682
683 * semantic/bovine/c.el (semantic-c-describe-environment):
684 Describe project macro symbols.
685
686 * semantic/complete.el (semantic-complete-do-completion):
687 Don't call semantic-collector-current-exact-match.
688
689 * ede.el (ede-apply-preprocessor-map): Accept lists of
690 ede-objects as targets.
691
692 * ede/pmake.el (ede-proj-makefile-insert-variables): Output
693 a target's object list even if compiler vars are already in the
694 Makefile.
695
696 * ede/emacs.el (ede-preprocessor-map): Add config.h to the
697 list of headers producing necessary macros.
698
6992009-11-24 Glenn Morris <rgm@gnu.org>
700
701 * semantic/idle.el (global-semantic-idle-scheduler-mode):
702 Move after definition of global-semantic-idle-tag-highlight-mode.
703
7042009-11-22 Chong Yidong <cyd@stupidchicken.com>
705
706 * srecode/map.el (srecode-get-maps):
707 * semantic/wisent/wisent.el (wisent-parse-toggle-verbose-flag):
708 * semantic/wisent/comp.el (wisent-toggle-verbose-flag):
709 * semantic/decorate/mode.el (semantic-decoration-mode)
710 (semantic-toggle-decoration-style):
711 * semantic/decorate/include.el
712 (semantic-decoration-include-describe)
713 (semantic-decoration-unknown-include-describe)
714 (semantic-decoration-unparsed-include-describe)
715 (semantic-decoration-all-include-summary):
716 * semantic/bovine/c.el (semantic-c-debug-mode-init):
717 * semantic/analyze/complete.el
718 (semantic-analyze-possible-completions):
719 * semantic/util-modes.el (semantic-highlight-edits-mode)
720 (semantic-show-unmatched-syntax-mode)
721 (semantic-show-parser-state-mode, semantic-stickyfunc-mode)
722 (semantic-highlight-func-mode):
723 * semantic/util.el (semantic-describe-buffer):
724 * semantic/symref.el (semantic-symref-find-references-by-name)
725 (semantic-symref-find-tags-by-name)
726 (semantic-symref-find-tags-by-regexp)
727 (semantic-symref-find-tags-by-completion)
728 (semantic-symref-find-file-references-by-name)
729 (semantic-symref-find-text):
730 * semantic/senator.el (senator-copy-tag, senator-kill-tag)
731 (senator-yank-tag):
732 * semantic/scope.el (semantic-calculate-scope):
733 * semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
734 * semantic/idle.el (semantic-idle-scheduler-mode)
735 (define-semantic-idle-service):
736 * semantic/complete.el (semantic-complete-analyze-inline)
737 (semantic-complete-analyze-inline-idle):
738 * semantic/analyze.el (semantic-analyze-current-context):
739 * mode-local.el (describe-mode-local-bindings)
740 (describe-mode-local-bindings-in-mode):
741 * ede/make.el (ede-make-check-version):
742 * ede/locate.el (ede-enable-locate-on-project):
743 * cedet-idutils.el (cedet-idutils-expand-filename)
744 (cedet-idutils-version-check):
745 * cedet-global.el (cedet-gnu-global-expand-filename)
746 (cedet-gnu-global-version-check):
747 * cedet-cscope.el (cedet-cscope-expand-filename)
748 (cedet-cscope-version-check): Use called-interactively-p instead
749 of interactive-p.
750
751 * semantic/ia.el (semantic-ia-completion-format-tag-function):
752 Use semantic-format-tag-prototype.
753
7542009-11-21 Chong Yidong <cyd@stupidchicken.com>
755
756 * semantic/complete.el (semantic-complete-read-tag-engine)
757 (semantic-complete-jump-local, semantic-complete-jump):
758 Improve prompt string.
759
7602009-11-20 Chong Yidong <cyd@stupidchicken.com>
761
762 * semantic/complete.el (semantic-complete-inline-map): Doc fix.
763
764 * semantic/idle.el (define-semantic-idle-service)
765 (semantic-idle-summary-mode, semantic-idle-completions): Doc fix.
766
7672009-11-20 Chong Yidong <cyd@stupidchicken.com>
768
769 * cedet.el (cedet-menu-map): Re-order menu items.
770
771 * semantic.el: Enable idle-mode menu items only if
772 global-semantic-idle-scheduler-mode is enabled.
773 (semantic-default-submodes): Doc fix.
774
775 * semantic/idle.el (global-semantic-idle-scheduler-mode):
776 When turning off, disable other idle modes.
777
7782009-11-15 Chong Yidong <cyd@stupidchicken.com>
779
780 * semantic/idle.el (semantic-idle-summary-mode)
781 (semantic-idle-summary-mode): Define using define-minor-mode
782 instead of define-semantic-idle-service.
783 (semantic-idle-summary-mode): New function.
784 (semantic-idle-summary-mode-setup): Use pre-command-hook to ensure
785 that mouse motion does not reset the echo area.
786
7872009-11-08 Chong Yidong <cyd@stupidchicken.com>
788
789 * semantic/ctxt.el (semantic-get-local-variables): Disable
790 the progress reporter entirely.
791
7922009-11-03 Stefan Monnier <monnier@iro.umontreal.ca>
793
794 * semantic/fw.el (semantic/loaddefs):
795 * srecode.el (srecode/loaddefs):
796 * ede.el (ede/loaddefs): Load rather than require.
797 * ede/cpp-root.el:
798 * ede/emacs.el:
799 * ede/files.el:
800 * ede/linux.el:
801 * ede/locate.el:
802 * ede/make.el:
803 * ede/shell.el:
804 * ede/speedbar.el:
805 * ede/system.el:
806 * ede/util.el:
807 * semantic/analyze.el:
808 * semantic/bovine.el:
809 * semantic/complete.el:
810 * semantic/ctxt.el:
811 * semantic/db-file.el:
812 * semantic/db-find.el:
813 * semantic/db-global.el:
814 * semantic/db-mode.el:
815 * semantic/db-typecache.el:
816 * semantic/db.el:
817 * semantic/debug.el:
818 * semantic/dep.el:
819 * semantic/doc.el:
820 * semantic/edit.el:
821 * semantic/find.el:
822 * semantic/format.el:
823 * semantic/html.el:
824 * semantic/ia-sb.el:
825 * semantic/ia.el:
826 * semantic/idle.el:
827 * semantic/lex-spp.el:
828 * semantic/lex.el:
829 * semantic/mru-bookmark.el:
830 * semantic/scope.el:
831 * semantic/senator.el:
832 * semantic/sort.el:
833 * semantic/symref.el:
834 * semantic/tag-file.el:
835 * semantic/tag-ls.el:
836 * semantic/tag-write.el:
837 * semantic/tag.el:
838 * semantic/util-modes.el:
839 * semantic/analyze/complete.el:
840 * semantic/analyze/refs.el:
841 * semantic/bovine/c.el:
842 * semantic/bovine/gcc.el:
843 * semantic/bovine/make.el:
844 * semantic/bovine/scm.el:
845 * semantic/decorate/include.el:
846 * semantic/decorate/mode.el:
847 * semantic/symref/cscope.el:
848 * semantic/symref/global.el:
849 * semantic/symref/grep.el:
850 * semantic/symref/idutils.el:
851 * semantic/symref/list.el:
852 * semantic/wisent/java-tags.el:
853 * semantic/wisent/javascript.el:
854 * srecode/compile.el:
855 * srecode/cpp.el:
856 * srecode/document.el:
857 * srecode/el.el:
858 * srecode/expandproto.el:
859 * srecode/getset.el:
860 * srecode/insert.el:
861 * srecode/java.el:
862 * srecode/map.el:
863 * srecode/mode.el:
864 * srecode/template.el:
865 * srecode/texi.el: Remove the file-local setting of
866 generated-autoload-feature.
867
8682009-11-03 Glenn Morris <rgm@gnu.org>
869
870 * mode-local.el (with-mode-local): Doc fix.
871
8722009-10-31 Chong Yidong <cyd@stupidchicken.com>
873
874 * cedet.el (cedet-menu-map): Remove Semantic and EDE menu
875 items.
876
877 * ede.el (ede-minor-mode):
878 * semantic.el (semantic-mode): Toggle menu separators.
879
8802009-10-31 Glenn Morris <rgm@gnu.org>
881
882 * semantic/tag.el (semantic--tag-link-list-to-buffer):
883 Use mapc rather than mapcar because the return value is never used.
884
885 * srecode/template.el, semantic/wisent/javascript.el:
886 * semantic/wisent/java-tags.el, semantic/texi.el:
887 * semantic/html.el:
888 Suppress harmless warnings about setting up semantic-imenu (not
889 part of Emacs) variables.
890
8912009-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
892
893 * srecode/srt-mode.el (semantic-analyze-possible-completions):
894 * semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
895 * semantic/symref/grep.el (semantic-symref-perform-search):
896 * semantic/bovine/gcc.el (semantic-gcc-query):
897 * semantic/bovine/c.el (semantic-c-parse-lexical-token):
898 * semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
899 (semantic-analyzer-debug-global-symbol)
900 (semantic-analyzer-debug-missing-innertype)
901 (semantic-analyzer-debug-insert-include-summary):
902 * semantic/util.el (semantic-file-tag-table):
903 (semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
904 (semantic-recursive-find-nonterminal-by-name):
905 * semantic/tag-ls.el (semantic-tag-calculate-parent-default):
906 * semantic/tag-file.el (semantic-prototype-file):
907 * semantic/symref.el (semantic-symref-parse-tool-output):
908 * semantic/sb.el (semantic-sb-fetch-tag-table):
909 * semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
910 * semantic/idle.el (semantic-idle-work-for-one-buffer):
911 (semantic-idle-summary-maybe-highlight):
912 * semantic/ia-sb.el (semantic-ia-speedbar)
913 (semantic-ia-sb-tag-info):
914 * semantic/grammar.el (semantic-analyze-possible-completions):
915 * semantic/find.el (semantic-brute-find-tag-by-position):
916 * semantic/ede-grammar.el (project-compile-target):
917 (ede-proj-makefile-insert-variables):
918 * semantic/debug.el (semantic-debug-set-parser-location):
919 (semantic-debug-set-source-location, semantic-debug-interface-layout)
920 (semantic-debug-mode, semantic-debug):
921 * semantic/db.el (semanticdb-needs-refresh-p):
922 * semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
923 * semantic/db-javascript.el (semanticdb-equivalent-mode):
924 * semantic/db-find.el (semanticdb-find-log-new-search)
925 (semanticdb-find-translate-path-includes--internal)
926 (semanticdb-reset-log, semanticdb-find-log-activity):
927 * semantic/db-file.el (object-write):
928 * semantic/db-el.el (semanticdb-equivalent-mode):
929 * semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
930 (semanticdb-create-ebrowse-database):
931 * semantic/db-debug.el (semanticdb-table-sanity-check):
932 * semantic/complete.el (semantic-displayor-focus-request)
933 (semantic-collector-calculate-completions-raw)
934 (semantic-complete-read-tag-analyzer):
935 * semantic/analyze.el (semantic-analyze-pulse):
936 * ede/util.el (ede-update-version-in-source):
937 * ede/proj.el (project-delete-target):
938 * ede/proj-elisp.el (ede-update-version-in-source)
939 (ede-proj-flush-autoconf):
940 * ede/pconf.el (ede-proj-configure-synchronize)
941 (ede-proj-configure-synchronize):
942 * ede/locate.el (ede-locate-file-in-project-impl):
943 * ede/linux.el (ede-linux-version):
944 * ede/emacs.el (ede-emacs-version):
945 * ede/dired.el (ede-dired-add-to-target):
946 * ede.el (ede-buffer-header-file, ede-find-target)
947 (ede-buffer-documentation-files, ede-project-buffers, ede-set)
948 (ede-target-buffers, ede-buffers, ede-make-project-local-variable):
949 * cedet-idutils.el (cedet-idutils-fnid-call):
950 (cedet-idutils-lid-call, cedet-idutils-expand-filename)
951 (cedet-idutils-version-check):
952 * cedet-global.el (cedet-gnu-global-call):
953 (cedet-gnu-global-expand-filename, cedet-gnu-global-root)
954 (cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
955 * cedet-cscope.el (cedet-cscope-call)
956 (cedet-cscope-expand-filename, cedet-cscope-version-check):
957 Use with-current-buffer.
958 * ede.el (ede-make-project-local-variable)
959 (ede-set-project-variables, ede-set): Use dolist.
960
9612009-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
962
963 * mode-local.el (make-obsolete-overload): Add `when' argument.
964 (overload-docstring-extension): Use that info.
965 * semantic/fw.el (semantic-alias-obsolete): Pass the `when' info.
966 * semantic/idle.el (semantic-eldoc-current-symbol-info):
967 * semantic/tag-ls.el (semantic-nonterminal-protection)
968 (semantic-nonterminal-abstract, semantic-nonterminal-leaf)
969 (semantic-nonterminal-full-name): Add the new `when' info.
970 * semantic/decorate/mode.el (semantic/decorate): Require CL for
971 `assert'.
972
9732009-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
974
975 * semantic/fw.el (semantic-alias-obsolete)
976 (semantic-varalias-obsolete): Make the `when' arg mandatory.
977 (define-mode-overload-implementation):
978 * semantic/decorate/mode.el (semantic-decorate-pending-decoration-hooks):
979 * semantic/wisent.el (wisent-lex-make-token-table):
980 * semantic/util.el (semantic-file-token-stream)
981 (semantic-something-to-stream):
982 * semantic/tag.el (semantic-tag-make-assoc-list)
983 (semantic-expand-nonterminal):
984 * semantic/tag-file.el (semantic-find-nonterminal)
985 (semantic-find-dependency, semantic-find-nonterminal)
986 (semantic-find-dependency):
987 * semantic/lex.el (semantic-flex-start, semantic-flex-end)
988 (semantic-flex-text, semantic-flex-make-keyword-table)
989 (semantic-flex-keyword-p, semantic-flex-keyword-put)
990 (semantic-flex-keyword-get, semantic-flex-map-keywords)
991 (semantic-flex-keywords, semantic-flex-buffer, semantic-flex-list):
992 * semantic/java.el (semantic-java-prototype-nonterminal):
993 * semantic/idle.el (semantic-before-idle-scheduler-reparse-hooks)
994 (semantic-after-idle-scheduler-reparse-hooks):
995 * semantic/edit.el (semantic-edits-incremental-reparse-failed-hooks):
996 * semantic/db-mode.el (semanticdb-mode-hooks):
997 * semantic.el (semantic-toplevel-bovine-table)
998 (semantic-toplevel-bovine-cache)
999 (semantic-before-toplevel-bovination-hook, semantic-init-hooks)
1000 (semantic-init-mode-hooks, semantic-init-db-hooks)
1001 (semantic-bovination-working-type): Provide the `when' arg.
1002
10032009-10-24 Chong Yidong <cyd@stupidchicken.com>
1004
1005 * semantic/util.el (semantic-recursive-find-nonterminal-by-name):
1006 * semantic/tag.el (semantic-token-type-parent): Add WHEN
1007 argument to make-obsolete.
1008
1009 * semantic/fw.el (semantic-alias-obsolete)
1010 (semantic-varalias-obsolete): Add optional WHEN argument.
1011
10122009-10-21 Eric Ludlam <zappo@gnu.org>
1013
1014 * semantic/bovine/c.el (semantic-c-debug-mode-init)
1015 (semantic-c-debug-mode-init-pch): New functions.
1016 (semantic-c-debug-mode-init-last-mode): New var.
1017 (semantic-c-parse-lexical-token): Use them.
1018
1019 * semantic/lex-spp.el (semantic-lex-spp-anlyzer-do-replace):
1020 When extracting the argument list, limit only by point-max.
1021
10222009-10-17 Chong Yidong <cyd@stupidchicken.com>
1023
1024 * srecode/srt.el:
1025 * srecode/compile.el:
1026 * semantic/mru-bookmark.el:
1027 * semantic/debug.el:
1028 * semantic/complete.el:
1029 * semantic/analyze.el: Require CL when compiling.
1030
10312009-10-17 Eric Ludlam <zappo@gnu.org>
1032
1033 * semantic/scope.el
1034 (semantic-analyze-scoped-inherited-tag-map): Wrap calculation of
1035 tmpscope so that the regular scope will continue to work.
1036
1037 * semantic/idle.el (semantic-idle-tag-highlight):
1038 Use semantic-idle-summary-highlight-face as the highlighting.
1039
1040 * emacs-lisp/eieio-base.el (eieio-persistent-save): If buffer
1041 contains multibyte characters, choose first applicable coding
1042 system automatically.
1043
1044 * ede/project-am.el (project-run-target): New method.
1045 (project-run-target): New method.
1046
1047 * ede.el (ede-target): Add run target menu item.
1048 (ede-project, ede-minor-keymap): Add ede-run-target binding.
1049 (ede-run-target): New function.
1050 (ede-target::project-run-target): New method.
1051
1052 * ede/proj.el (project-run-target): New method.
1053
1054 * ede/proj-shared.el (ede-gcc-libtool-shared-compiler)
1055 (ede-g++-libtool-shared-compiler): Remove SHELL. Remove COMMANDS.
1056 Add :rules.
1057 (ede-proj-target-makefile-shared-object): Only libtool compilers
1058 now available. Add linkers for libtool.
1059 (ede-cc-linker-libtool, ede-g++-linker-libtool): New.
1060 (ede-proj-makefile-target-name): Always use .la extension.
1061
1062 * ede/proj-prog.el (project-run-target): New method.
1063
1064 * ede/proj-obj.el (ede-cc-linker): Rename from ede-gcc-linker.
1065 (ede-g++-linker): Change Change link lines.
1066
1067 * ede/pmake.el (ede-pmake-insert-variable-shared):
1068 When searching for old variables, go to the end of the buffer and
1069 search backward from there.
1070 (ede-proj-makefile-automake-insert-subdirs)
1071 (ede-proj-makefile-automake-insert-extradist): New methods.
1072 (ede-proj-makefile-create): Use them.
1073
1074 * ede/pconf.el (ede-proj-configure-test-required-file):
1075 Force FILE to expand to the current target. Use file-exists-p to
1076 check that it exists.
1077
1078 * ede/linux.el (ede-linux-version): Don't call "head".
1079 (ede-linux-load): Wrap dir in file-name-as-directory.
1080 Set :version slot.
1081
1082 * ede/files.el (ede-get-locator-object): When enabling
1083 locate, do so on "top".
1084
1085 * ede/emacs.el (ede-emacs-file-existing): Wrap "dir" in
1086 file-name-as-directory during compare.
1087 (ede-emacs-version): Return Emacs/XEmacs differentiator.
1088 Get version number from different places. Don't call egrep.
1089 (ede-emacs-load): Set :version slot. Call file-name-as-directory
1090 to set the directory.
1091
1092 * ede/shell.el: New file.
1093
1094 * inversion.el (inversion-decoders): Allow for stray . in
1095 alpha/beta variants.
1096
10972009-10-17 Glenn Morris <rgm@gnu.org>
1098
1099 * semantic/grammar.el (semantic-grammar--lex-delim-spec):
1100 All errors should have messages.
1101
11022009-10-10 Sascha Wilde <wilde@sha-bang.de>
1103
1104 * ede/proj-shared.el (ede-proj-makefile-target-name):
1105 Use .la for Automake.
1106
11072009-10-09 Chong Yidong <cyd@stupidchicken.com>
1108
1109 * ede/pconf.el (ede-proj-configure-synchronize):
1110 Use "autoreconf -i". Suggested by Andreas Schwab.
1111
11122009-10-08 Chong Yidong <cyd@stupidchicken.com>
1113
1114 * ede/proj.el (project-make-dist, project-compile-project):
1115 Fix filename test.
1116 (ede-proj-dist-makefile): Use expand-file-name instead of concat
1117 to expand file names.
1118
11192009-10-08 Chong Yidong <cyd@stupidchicken.com>
1120
1121 * ede/proj-obj.el (ede-gcc-linker): New var.
1122 (ede-proj-target-makefile-objectcode): Use it.
1123
1124 * ede/source.el (ede-want-any-source-files-p)
1125 (ede-want-any-auxiliary-files-p, ede-want-any-files-p):
1126 Return search result. This error was introduced while merging.
1127
11282009-10-04 Chong Yidong <cyd@stupidchicken.com>
1129
1130 * semantic.el (semantic-new-buffer-setup-functions): New option.
1131 (semantic-new-buffer-fcn): Call parser setup functions here.
1132 (semantic-mode): Don't call parser setup functions here, it's done
1133 in semantic-new-buffer-fcn now.
1134 (semantic-mode): Parse all existing buffers when enabled.
1135
1136 * srecode/compile.el (srecode-compile-file):
1137 Call semantic-new-buffer-fcn if the buffer has not been parsed.
1138
11392009-10-04 Chong Yidong <cyd@stupidchicken.com>
1140
1141 * ede/pmake.el (ede-pmake-insert-variable-once): Delete.
1142
1143 * ede/proj-comp.el: Don't require ede/pmake at toplevel.
1144 (proj-comp-insert-variable-once): New macro, renamed from
1145 ede-pmake-insert-variable-once in ede/pmake.edl.
1146 (ede-proj-makefile-insert-variables): Use it.
1147
11482009-10-04 Juanma Barranquero <lekktu@gmail.com>
1149
1150 * ede/makefile-edit.el (makefile-beginning-of-command)
1151 (makefile-end-of-command):
1152 * srecode/srt-mode.el (semantic-beginning-of-context)
1153 (semantic-end-of-context): Fix previous change. Doc fixes.
1154
11552009-10-04 Juanma Barranquero <lekktu@gmail.com>
1156
1157 * ede/makefile-edit.el (makefile-beginning-of-command)
1158 (makefile-end-of-command):
1159 * semantic/lex.el (semantic-lex-token):
1160 * semantic/analyze/fcn.el
1161 (semantic-analyze-dereference-metatype-1):
1162 * semantic/bovine/c.el (semantic-lex-cpp-define)
1163 (semantic-lex-cpp-undef):
1164 * semantic/wisent/wisent.el (wisent-skip-block):
1165 * srecode/srt-mode.el (semantic-beginning-of-context)
1166 (semantic-end-of-context): Fix typos in docstrings.
1167
11682009-10-04 Chong Yidong <cyd@stupidchicken.com>
1169
1170 * ede.el (ede-project-placeholder-cache-file):
1171 * semantic/db-file.el (semanticdb-default-save-directory):
1172 * srecode/map.el (srecode-map-save-file):
1173 Use locate-user-emacs-file. Suggested by Juanma Barranquero.
1174
11752009-10-03 Chong Yidong <cyd@stupidchicken.com>
1176
1177 * srecode/insert.el: Require srecode/args.
1178
1179 * srecode/args.el: Require srecode/dictionary instead of
1180 srecode/insert.
1181
1182 * srecode/srt-mode.el (srecode-template-mode): Doc fix.
1183
1184 * files.el (auto-mode-alist): Add .srt and Project.ede.
1185
1186 * semantic.el (semantic-mode):
1187 Handle srecode-template-mode-hook as well.
1188 (semantic-mode): Use js-mode-hook for Javascript hook.
1189
1190 * srecode/template.el: Remove hook variable.
1191
1192 * ede/proj-comp.el: Require ede/pmake when compiling.
1193
1194 * ede.el (ede-target-forms-menu): Don't enable if no
1195 projects exist.
1196 (ede-project-placeholder-cache-file): Default to a file in
1197 user-emacs-directory.
1198
1199 * srecode/map.el (srecode-map-base-template-dir): Look for
1200 templates in data-directory.
1201 (srecode-map-save-file): Default to a file in user-emacs-directory.
1202
1203 * ede/srecode.el (ede-srecode-setup): Use default templates
1204 directory.
1205
12062009-09-30 Eric Ludlam <zappo@gnu.org>
1207
1208 * semantic/util-modes.el (semantic-highlight-func-mode):
1209 Doc fix.
1210
1211 * ede/proj-comp.el (ede-proj-makefile-insert-variables):
1212 Only insert each variable once.
1213
1214 * ede/pmake.el (ede-pmake-insert-variable-once): New macro.
1215 (ede-pmake-insert-variable-shared): Use it.
1216
1217 * ede/cpp-root.el (ede-preprocessor-map): Do not deref table
1218 for lexical table iff table is nil.
1219
12202009-10-01 Glenn Morris <rgm@gnu.org>
1221
1222 * semantic/bovine/gcc.el
1223 (semantic-c-reset-preprocessor-symbol-map): Fix declaration.
1224 (semantic-gcc-get-include-paths, semantic-gcc-setup-data): Doc fixes.
1225
12262009-10-03 Glenn Morris <rgm@gnu.org>
1227
1228 * semantic/db-find.el (data-debug-insert-tag-list): Comment out
1229 declaration, currently false.
1230
12312009-10-01 Glenn Morris <rgm@gnu.org>
1232
1233 * cedet-files.el (cedet-directory-name-to-file-name):
1234 * cedet-idutils.el (cedet-idutils-search)
1235 (cedet-idutils-expand-filename, cedet-idutils-support-for-directory)
1236 (cedet-idutils-version-check):
1237 * cedet.el (cedet-version):
1238 * data-debug.el (data-debug-insert-overlay-button)
1239 (data-debug-insert-overlay-list-button)
1240 (data-debug-insert-buffer-button)
1241 (data-debug-insert-buffer-list-button)
1242 (data-debug-insert-process-button, data-debug-insert-ring-button)
1243 (data-debug-insert-widget, data-debug-insert-stuff-list-button)
1244 (data-debug-insert-stuff-vector-button)
1245 (data-debug-insert-symbol-button, data-debug-insert-string)
1246 (data-debug-insert-number, data-debug-insert-lambda-expression)
1247 (data-debug-insert-nil, data-debug-insert-simple-thing)
1248 (data-debug-insert-custom, data-debug-edebug-expr):
1249 * ede.el (ede-auto-add-method, ede-project-class-files)
1250 (global-ede-mode-map, ede-new, ede-debug-target)
1251 (ede-customize-current-target, ede-buffers, ede-map-buffers, ede-set):
1252 * semantic.el (semantic-minimum-working-buffer-size)
1253 (semantic-fetch-tags, semantic-submode-list)
1254 (semantic-default-submodes):
1255 * ede/source.el (ede-source-match):
1256 * ede/project-am.el (project-am-type-alist, project-add-file)
1257 (project-am-package-info):
1258 * ede/proj.el (ede-proj-target, project-new-target):
1259 * ede/proj-elisp.el (ede-proj-tweak-autoconf):
1260 * ede/proj-comp.el (ede-current-build-list):
1261 * ede/makefile-edit.el (makefile-move-to-macro):
1262 * ede/files.el (ede-toplevel-project-or-nil):
1263 * ede/cpp-root.el (initialize-instance):
1264 * ede/autoconf-edit.el (autoconf-find-last-macro)
1265 (autoconf-parameter-strip, autoconf-insert-new-macro):
1266 * semantic/wisent.el (wisent-lex-eoi):
1267 * semantic/util-modes.el (global-semantic-show-parser-state-mode)
1268 (semantic-show-parser-state-mode):
1269 * semantic/texi.el (semantic-texi-environment-regexp):
1270 * semantic/tag.el (semantic-tag-new-variable)
1271 (semantic-tag-class, semantic-tag-new-variable, semantic-tag-copy)
1272 (semantic--tag-deep-copy-attributes, semantic--tag-deep-copy-value)
1273 (semantic--tag-deep-copy-tag-list)
1274 (semantic-tag-components-with-overlays-default):
1275 * semantic/symref.el (semantic-symref-find-text):
1276 * semantic/senator.el (senator-yank-tag)
1277 (senator-transpose-tags-up):
1278 * semantic/scope.el (semantic-analyze-scoped-tags-default)
1279 (semantic-analyze-scoped-inherited-tags, semantic-scope-find):
1280 * semantic/sb.el (semantic-sb-autoexpand-length):
1281 * semantic/lex.el (semantic-lex-comment-regex)
1282 (semantic-lex-maximum-depth, define-lex, semantic-lex-token)
1283 (semantic-lex-unterminated-syntax-protection, define-lex-analyzer):
1284 * semantic/lex-spp.el
1285 (semantic-lex-spp-dynamic-macro-symbol-obarray-stack)
1286 (semantic-lex-spp-symbol, semantic-lex-spp-one-token-to-txt):
1287 * semantic/idle.el
1288 (semantic-idle-summary-current-symbol-info-brutish)
1289 (semantic-idle-summary-current-symbol-info-default):
1290 * semantic/grammar.el (semantic-grammar-recreate-package)
1291 (semantic--grammar-macro-compl-dict):
1292 * semantic/grammar-wy.el (semantic-grammar-wy--parse-table):
1293 * semantic/format.el (semantic-format-tag-custom-list)
1294 (semantic-format-tag-canonical-name-default):
1295 * semantic/find.el (semantic-find-tag-by-overlay-in-region)
1296 (semantic-find-tags-for-completion)
1297 (semantic-find-tags-by-scope-protection-default)
1298 (semantic-deep-find-tags-for-completion):
1299 * semantic/edit.el
1300 (semantic-edits-incremental-reparse-failed-hook)
1301 (semantic-edits-verbose-flag, semantic-edits-assert-valid-region)
1302 (semantic-edits-splice-remove, semantic-edits-splice-replace):
1303 * semantic/doc.el (semantic-documentation-comment-preceeding-tag):
1304 * semantic/dep.el (semantic-dependency-include-path):
1305 * semantic/db.el (semanticdb-default-find-index-class)
1306 (semanticdb-match-any-mode, semanticdb-with-match-any-mode)
1307 (semanticdb-project-roots):
1308 * semantic/db-find.el (semanticdb-implied-include-tags)
1309 (semanticdb-find-adebug-insert-scanned-tag-cons)
1310 (semanticdb-find-log-buffer-name, semanticdb-find-result-mapc)
1311 (semanticdb-brute-deep-find-tags-for-completion):
1312 * semantic/db-ebrowse.el (semanticdb-ebrowse-add-tree-to-table):
1313 * semantic/ctxt.el (semantic-beginning-of-context-default)
1314 (semantic-end-of-context-default)
1315 (semantic-ctxt-current-function-default)
1316 (semantic-ctxt-scoped-types-default):
1317 * semantic/complete.el (semantic-complete-read-tag-engine)
1318 (semantic-complete-inline-tag-engine)
1319 (semantic-complete-inline-custom-type)
1320 (semantic-complete-read-tag-analyzer):
1321 * semantic/chart.el (semantic-chart-tags-by-class)
1322 (semantic-chart-database-size):
1323 * semantic/analyze.el (semantic-analyze-current-symbol)
1324 (semantic-analyze-current-context):
1325 * semantic/symref/list.el (semantic-symref)
1326 (semantic-symref-hide-buffer, semantic-symref-symbol):
1327 * semantic/symref/grep.el (semantic-symref-grep-use-template):
1328 * semantic/symref/filter.el (semantic-symref-hits-in-region):
1329 * semantic/bovine/el.el (semantic-elisp-form-to-doc-string):
1330 * semantic/bovine/c.el (semantic-lex-c-preprocessor-symbol-map)
1331 (semantic-c-parse-token-hack-depth, semantic-c--template-name-1)
1332 (semantic-c-dereference-template):
1333 * semantic/analyze/refs.el (semantic--analyze-refs-full-lookup)
1334 (semantic--analyze-refs-full-lookup-with-parents)
1335 (semantic--analyze-refs-full-lookup-simple):
1336 * semantic/analyze/complete.el
1337 (semantic-analyze-possible-completions):
1338 * srecode/table.el (srecode-mode-table-new):
1339 * srecode/srt.el (srecode-read-variable-name):
1340 * srecode/srt-mode.el (srecode-macro-help, srecode-in-macro-p):
1341 * srecode/semantic.el (srecode-semantic-handle-:tag)
1342 (srecode-semantic-handle-:tagtype, srecode-semantic-insert-tag):
1343 * srecode/map.el (srecode-current-map):
1344 * srecode/insert.el (srecode-insert)
1345 (srecode-insert-variable-secondname-handler, srecode-insert-method)
1346 (srecode-template-inserter-point-override)
1347 (srecode-insert-include-lookup):
1348 * srecode/getset.el (srecode-auto-choose-class):
1349 * srecode/extract.el (srecode-inserter-extract):
1350 * srecode/document.el
1351 (srecode-document-autocomment-return-last-alist)
1352 (srecode-document-autocomment-param-type-alist)
1353 (srecode-document-insert-function-comment)
1354 (srecode-document-insert-variable-one-line-comment)
1355 (srecode-document-function-name-comment):
1356 * srecode/dictionary.el (srecode-create-dictionary)
1357 (srecode-compound-toString):
1358 * srecode/compile.el (srecode-flush-active-templates):
1359 * srecode/args.el (srecode-semantic-handle-:blank):
1360 Doc/message fixes.
1361
13622009-10-01 Juanma Barranquero <lekktu@gmail.com>
1363
1364 * semantic/wisent/javat-wy.el
1365 (wisent-java-tags-wy--keyword-table): Use \000 instead of literal ^@.
1366
13672009-09-30 Juanma Barranquero <lekktu@gmail.com>
1368
1369 * srecode/expandproto.el: Fix provide statement.
1370
13712009-09-30 Eric Ludlam <zappo@gnu.org>
1372
1373 * emacs-lisp/eieio.el (boolean-p): Delete.
1374
13752009-09-30 Sascha Wilde <wilde@sha-bang.de>
1376
1377 * ede/srecode.el: Fix provide statement.
1378
13792009-09-30 Glenn Morris <rgm@gnu.org>
1380
1381 * ede/proj.el (ede-proj-target-makefile-miscelaneous):
1382 * ede/proj-aux.el (ede-aux-source):
1383 * ede/proj-misc.el (ede-proj-target-makefile-miscelaneous)
1384 (ede-misc-source):
1385 * semantic/mru-bookmark.el (semantic-mrub-completing-read)
1386 (semantic-mrub-switch-tags): Fix doc typos.
1387
1388 * semantic/db-global.el (data-debug-new-buffer)
1389 (data-debug-insert-thing): Remove unneeded declarations (one broken).
1390 (semanticdb-enable-gnu-global-databases): Fix prompt typo.
1391
1392 * semantic/analyze/fcn.el (semantic-scope-find): Fix declaration.
1393
1394 * semantic/bovine/gcc.el (semantic-gcc-setup): Replace runtime
1395 use of CL function `remove-if-not'.
1396
13972009-09-29 Glenn Morris <rgm@gnu.org>
1398
1399 * semantic/symref/idutils.el:
1400 * semantic/symref/list.el: Relicense under GPLv3+.
1401
1402 * ede/srecode.el (srecode-resolve-arguments): Fix declaration.
1403
1404 * semantic/complete.el (semantic-displayor-focus-abstract-child-p):
1405 * semantic/tag-file.el (semanticdb-table-child-p):
1406 * srecode/compile.el (srecode-template-inserter-newline-child-p):
1407 Mark declarations not understood by check-declare.
1408
14092009-09-28 Eric Ludlam <zappo@gnu.org>
1410
1411 CEDET (development tools) package merged.
1412
1413 * *.el:
1414 * ede/*.el:
1415 * semantic/*.el:
1416 * srecode/*.el: New files.
1417
14182009-09-28 Eric Ludlam <zappo@gnu.org>
1419
1420 * emacs-lisp/chart.el:
1421 * emacs-lisp/eieio-base.el:
1422 * emacs-lisp/eieio-comp.el:
1423 * emacs-lisp/eieio-custom.el:
1424 * emacs-lisp/eieio-datadebug.el:
1425 * emacs-lisp/eieio-opt.el:
1426 * emacs-lisp/eieio-speedbar.el:
1427 * emacs-lisp/eieio.el: New files.
1428
1429 * cedet-cscope.el:
1430 * cedet-files.el:
1431 * cedet-global.el:
1432 * cedet-idutils.el:
1433 * data-debug.el:
1434 * inversion.el:
1435 * mode-local.el:
1436 * pulse.el: New files.
diff --git a/lisp/cedet/cedet-cscope.el b/lisp/cedet/cedet-cscope.el
index 18cb7071d5c..211c7fb4b01 100644
--- a/lisp/cedet/cedet-cscope.el
+++ b/lisp/cedet/cedet-cscope.el
@@ -73,6 +73,12 @@ SCOPE is the scope of the search, such as 'project or 'subdirs."
73 ) 73 )
74 (cedet-cscope-call (list "-d" "-L" idx searchtext)))) 74 (cedet-cscope-call (list "-d" "-L" idx searchtext))))
75 75
76(defun cedet-cscope-create (flags)
77 "Create a CScope database at the current directory.
78FLAGS are additional flags to pass to cscope beyond the
79options -cR."
80 (cedet-cscope-call (append (list "-cR") flags)))
81
76(defun cedet-cscope-call (flags) 82(defun cedet-cscope-call (flags)
77 "Call CScope with the list of FLAGS." 83 "Call CScope with the list of FLAGS."
78 (let ((b (get-buffer-create "*CEDET CScope*")) 84 (let ((b (get-buffer-create "*CEDET CScope*"))
@@ -113,13 +119,19 @@ Return a fully qualified filename."
113If DIR is not supplied, use the current default directory. 119If DIR is not supplied, use the current default directory.
114This works by running cscope on a bogus symbol, and looking for 120This works by running cscope on a bogus symbol, and looking for
115the error code." 121the error code."
122 (interactive "DDirectory: ")
116 (save-excursion 123 (save-excursion
117 (let ((default-directory (or dir default-directory))) 124 (let ((default-directory (or dir default-directory)))
118 (set-buffer (cedet-cscope-call (list "-d" "-L" "-7" "moose"))) 125 (set-buffer (cedet-cscope-call (list "-d" "-L" "-7" "moose")))
119 (goto-char (point-min)) 126 (goto-char (point-min))
120 (if (looking-at "[^ \n]*cscope: ") 127 (let ((ans (looking-at "[^ \n]*cscope: ")))
121 nil 128 (if (called-interactively-p 'interactive)
122 t)))) 129 (if ans
130 (message "No support for CScope in %s" default-directory)
131 (message "CScope is supported in %s" default-directory))
132 (if ans
133 nil
134 t))))))
123 135
124(defun cedet-cscope-version-check (&optional noerror) 136(defun cedet-cscope-version-check (&optional noerror)
125 "Check the version of the installed CScope command. 137 "Check the version of the installed CScope command.
@@ -151,6 +163,14 @@ return nil."
151 (message "CScope %s - Good enough for CEDET." rev)) 163 (message "CScope %s - Good enough for CEDET." rev))
152 t))))) 164 t)))))
153 165
166(defun cedet-cscope-create/update-database (&optional dir)
167 "Create a CScope database in DIR.
168CScope will automatically choose incremental rebuild if
169there is already a database in DIR."
170 (interactive "DDirectory: ")
171 (let ((default-directory dir))
172 (cedet-cscope-create nil)))
173
154(provide 'cedet-cscope) 174(provide 'cedet-cscope)
155 175
156;; arch-tag: 9973f1ad-f13b-4399-bc67-7f488478d78d 176;; arch-tag: 9973f1ad-f13b-4399-bc67-7f488478d78d
diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el
index b98bd316935..da4e618a749 100644
--- a/lisp/cedet/cedet-global.el
+++ b/lisp/cedet/cedet-global.el
@@ -34,6 +34,12 @@
34 :type 'string 34 :type 'string
35 :group 'cedet) 35 :group 'cedet)
36 36
37(defcustom cedet-global-gtags-command "gtags"
38 "Command name for the GNU Global gtags executable.
39GTAGS is used to create the tags table queried by the 'global' command."
40 :type 'string
41 :group 'cedet)
42
37;;; Code: 43;;; Code:
38(defun cedet-gnu-global-search (searchtext texttype type scope) 44(defun cedet-gnu-global-search (searchtext texttype type scope)
39 "Perform a search with GNU Global, return the created buffer. 45 "Perform a search with GNU Global, return the created buffer.
@@ -76,6 +82,19 @@ SCOPE is the scope of the search, such as 'project or 'subdirs."
76 flags) 82 flags)
77 b)) 83 b))
78 84
85(defun cedet-gnu-global-gtags-call (flags)
86 "Create GNU Global TAGS using gtags with FLAGS."
87 (let ((b (get-buffer-create "*CEDET Global gtags*"))
88 (cd default-directory)
89 )
90 (with-current-buffer b
91 (setq default-directory cd)
92 (erase-buffer))
93 (apply 'call-process cedet-global-gtags-command
94 nil b nil
95 flags)
96 b))
97
79(defun cedet-gnu-global-expand-filename (filename) 98(defun cedet-gnu-global-expand-filename (filename)
80 "Expand the FILENAME with GNU Global. 99 "Expand the FILENAME with GNU Global.
81Return a fully qualified filename." 100Return a fully qualified filename."
@@ -153,6 +172,18 @@ return nil."
153 ;; Return the results 172 ;; Return the results
154 (nreverse hits)))) 173 (nreverse hits))))
155 174
175(defun cedet-gnu-global-create/update-database (&optional dir)
176 "Create a GNU Global database in DIR.
177If a database already exists, then just update it."
178 (interactive "DDirectory: ")
179 (let ((root (cedet-gnu-global-root dir)))
180 (if root (setq dir root))
181 (let ((default-directory dir))
182 (cedet-gnu-global-gtags-call
183 (when root
184 '("-i");; Incremental update flag.
185 )))))
186
156(provide 'cedet-global) 187(provide 'cedet-global)
157 188
158;; arch-tag: 0d0d3ac2-91ef-4820-bb2b-1d59ccf38392 189;; arch-tag: 0d0d3ac2-91ef-4820-bb2b-1d59ccf38392
diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el
index 44c325b78cd..627a458b657 100644
--- a/lisp/cedet/cedet-idutils.el
+++ b/lisp/cedet/cedet-idutils.el
@@ -44,6 +44,11 @@
44 :type 'string 44 :type 'string
45 :group 'cedet) 45 :group 'cedet)
46 46
47(defcustom cedet-idutils-make-command "mkid"
48 "Command name for the ID Utils executable for creating token databases."
49 :type 'string
50 :group 'cedet)
51
47(defun cedet-idutils-search (searchtext texttype type scope) 52(defun cedet-idutils-search (searchtext texttype type scope)
48 "Perform a search with ID Utils, return the created buffer. 53 "Perform a search with ID Utils, return the created buffer.
49SEARCHTEXT is text to find. 54SEARCHTEXT is text to find.
@@ -105,6 +110,20 @@ Return the created buffer with with program output."
105 flags) 110 flags)
106 b)) 111 b))
107 112
113(defun cedet-idutils-mkid-call (flags)
114 "Call ID Utils mkid with the list of FLAGS.
115Return the created buffer with with program output."
116 (let ((b (get-buffer-create "*CEDET mkid*"))
117 (cd default-directory)
118 )
119 (with-current-buffer b
120 (setq default-directory cd)
121 (erase-buffer))
122 (apply 'call-process cedet-idutils-make-command
123 nil b nil
124 flags)
125 b))
126
108;;; UTIL CALLS 127;;; UTIL CALLS
109;; 128;;
110(defun cedet-idutils-expand-filename (filename) 129(defun cedet-idutils-expand-filename (filename)
@@ -172,6 +191,12 @@ return nil."
172 (message "ID Utils %s - Good enough for CEDET." rev)) 191 (message "ID Utils %s - Good enough for CEDET." rev))
173 t))))) 192 t)))))
174 193
194(defun cedet-idutils-create/update-database (&optional dir)
195 "Create an IDUtils database in DIR.
196IDUtils must start from scratch when updating a database."
197 (interactive "DDirectory: ")
198 (let ((default-directory dir))
199 (cedet-idutils-mkid-call nil)))
175 200
176(provide 'cedet-idutils) 201(provide 'cedet-idutils)
177 202
diff --git a/lisp/cedet/cedet.el b/lisp/cedet/cedet.el
index 6a6d09fda69..80a092ab9ea 100644
--- a/lisp/cedet/cedet.el
+++ b/lisp/cedet/cedet.el
@@ -36,19 +36,19 @@
36 36
37(declare-function inversion-find-version "inversion") 37(declare-function inversion-find-version "inversion")
38 38
39(defconst cedet-version "1.0pre7" 39(defconst cedet-version "1.0"
40 "Current version of CEDET.") 40 "Current version of CEDET.")
41 41
42(defconst cedet-packages 42(defconst cedet-packages
43 `( 43 `(
44 ;;PACKAGE MIN-VERSION 44 ;;PACKAGE MIN-VERSION
45 (cedet ,cedet-version) 45 (cedet ,cedet-version)
46 (eieio "1.2") 46 (eieio "1.3")
47 (semantic "2.0pre7") 47 (semantic "2.0")
48 (srecode "1.0pre7") 48 (srecode "1.0")
49 (ede "1.0pre7") 49 (ede "1.0")
50 (speedbar "1.0.3")) 50 (speedbar "1.0"))
51 "Table of CEDET packages to install.") 51 "Table of CEDET packages installed.")
52 52
53(defvar cedet-menu-map ;(make-sparse-keymap "CEDET menu") 53(defvar cedet-menu-map ;(make-sparse-keymap "CEDET menu")
54 (let ((map (make-sparse-keymap "CEDET menu"))) 54 (let ((map (make-sparse-keymap "CEDET menu")))
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 807c7797668..fbe66d12202 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -44,24 +44,24 @@
44(require 'eieio) 44(require 'eieio)
45(require 'eieio-speedbar) 45(require 'eieio-speedbar)
46(require 'ede/source) 46(require 'ede/source)
47(require 'ede/base)
48(require 'ede/auto)
49
47(load "ede/loaddefs" nil 'nomessage) 50(load "ede/loaddefs" nil 'nomessage)
48 51
52(declare-function ede-commit-project "ede/custom")
49(declare-function ede-convert-path "ede/files") 53(declare-function ede-convert-path "ede/files")
50(declare-function ede-directory-get-open-project "ede/files") 54(declare-function ede-directory-get-open-project "ede/files")
51(declare-function ede-directory-get-toplevel-open-project "ede/files") 55(declare-function ede-directory-get-toplevel-open-project "ede/files")
52(declare-function ede-directory-project-p "ede/files") 56(declare-function ede-directory-project-p "ede/files")
53(declare-function ede-find-subproject-for-directory "ede/files") 57(declare-function ede-find-subproject-for-directory "ede/files")
54(declare-function ede-project-directory-remove-hash "ede/files") 58(declare-function ede-project-directory-remove-hash "ede/files")
55(declare-function ede-project-root "ede/files")
56(declare-function ede-project-root-directory "ede/files")
57(declare-function ede-toplevel "ede/files") 59(declare-function ede-toplevel "ede/files")
58(declare-function ede-toplevel-project "ede/files") 60(declare-function ede-toplevel-project "ede/files")
59(declare-function ede-up-directory "ede/files") 61(declare-function ede-up-directory "ede/files")
60(declare-function data-debug-new-buffer "data-debug")
61(declare-function data-debug-insert-object-slots "eieio-datadebug")
62(declare-function semantic-lex-make-spp-table "semantic/lex-spp") 62(declare-function semantic-lex-make-spp-table "semantic/lex-spp")
63 63
64(defconst ede-version "1.0pre7" 64(defconst ede-version "1.0"
65 "Current version of the Emacs EDE.") 65 "Current version of the Emacs EDE.")
66 66
67;;; Code: 67;;; Code:
@@ -95,314 +95,6 @@ target willing to take the file. 'never means never perform the check."
95 :group 'ede 95 :group 'ede
96 :type 'sexp) ; make this be a list of options some day 96 :type 'sexp) ; make this be a list of options some day
97 97
98
99;;; Top level classes for projects and targets
100
101(defclass ede-project-autoload ()
102 ((name :initarg :name
103 :documentation "Name of this project type")
104 (file :initarg :file
105 :documentation "The lisp file belonging to this class.")
106 (proj-file :initarg :proj-file
107 :documentation "Name of a project file of this type.")
108 (proj-root :initarg :proj-root
109 :type function
110 :documentation "A function symbol to call for the project root.
111This function takes no arguments, and returns the current directories
112root, if available. Leave blank to use the EDE directory walking
113routine instead.")
114 (initializers :initarg :initializers
115 :initform nil
116 :documentation
117 "Initializers passed to the project object.
118These are used so there can be multiple types of projects
119associated with a single object class, based on the initilizeres used.")
120 (load-type :initarg :load-type
121 :documentation "Fn symbol used to load this project file.")
122 (class-sym :initarg :class-sym
123 :documentation "Symbol representing the project class to use.")
124 (new-p :initarg :new-p
125 :initform t
126 :documentation
127 "Non-nil if this is an option when a user creates a project.")
128 )
129 "Class representing minimal knowledge set to run preliminary EDE functions.
130When more advanced functionality is needed from a project type, that projects
131type is required and the load function used.")
132
133(defvar ede-project-class-files
134 (list
135 (ede-project-autoload "edeproject-makefile"
136 :name "Make" :file 'ede/proj
137 :proj-file "Project.ede"
138 :load-type 'ede-proj-load
139 :class-sym 'ede-proj-project)
140 (ede-project-autoload "edeproject-automake"
141 :name "Automake" :file 'ede/proj
142 :proj-file "Project.ede"
143 :initializers '(:makefile-type Makefile.am)
144 :load-type 'ede-proj-load
145 :class-sym 'ede-proj-project)
146 (ede-project-autoload "automake"
147 :name "automake" :file 'ede/project-am
148 :proj-file "Makefile.am"
149 :load-type 'project-am-load
150 :class-sym 'project-am-makefile
151 :new-p nil)
152 (ede-project-autoload "cpp-root"
153 :name "CPP ROOT" :file 'ede/cpp-root
154 :proj-file 'ede-cpp-root-project-file-for-dir
155 :proj-root 'ede-cpp-root-project-root
156 :load-type 'ede-cpp-root-load
157 :class-sym 'ede-cpp-root
158 :new-p nil)
159 (ede-project-autoload "emacs"
160 :name "EMACS ROOT" :file 'ede/emacs
161 :proj-file "src/emacs.c"
162 :proj-root 'ede-emacs-project-root
163 :load-type 'ede-emacs-load
164 :class-sym 'ede-emacs-project
165 :new-p nil)
166 (ede-project-autoload "linux"
167 :name "LINUX ROOT" :file 'ede/linux
168 :proj-file "scripts/ver_linux"
169 :proj-root 'ede-linux-project-root
170 :load-type 'ede-linux-load
171 :class-sym 'ede-linux-project
172 :new-p nil)
173 (ede-project-autoload "simple-overlay"
174 :name "Simple" :file 'ede/simple
175 :proj-file 'ede-simple-projectfile-for-dir
176 :load-type 'ede-simple-load
177 :class-sym 'ede-simple-project))
178 "List of vectors defining how to determine what type of projects exist.")
179
180;;; Generic project information manager objects
181
182(defclass ede-target (eieio-speedbar-directory-button)
183 ((buttonface :initform speedbar-file-face) ;override for superclass
184 (name :initarg :name
185 :type string
186 :custom string
187 :label "Name"
188 :group (default name)
189 :documentation "Name of this target.")
190 ;; @todo - I think this should be "dir", and not "path".
191 (path :initarg :path
192 :type string
193 ;:custom string
194 ;:label "Path to target"
195 ;:group (default name)
196 :documentation "The path to the sources of this target.
197Relative to the path of the project it belongs to.")
198 (source :initarg :source
199 :initform nil
200 ;; I'd prefer a list of strings.
201 :type list
202 :custom (repeat (string :tag "File"))
203 :label "Source Files"
204 :group (default source)
205 :documentation "Source files in this target.")
206 (versionsource :initarg :versionsource
207 :initform nil
208 :type list
209 :custom (repeat (string :tag "File"))
210 :label "Source Files with Version String"
211 :group (source)
212 :documentation
213 "Source files with a version string in them.
214These files are checked for a version string whenever the EDE version
215of the master project is changed. When strings are found, the version
216previously there is updated.")
217 ;; Class level slots
218 ;;
219; (takes-compile-command :allocation :class
220; :initarg :takes-compile-command
221; :type boolean
222; :initform nil
223; :documentation
224; "Non-nil if this target requires a user approved command.")
225 (sourcetype :allocation :class
226 :type list ;; list of symbols
227 :documentation
228 "A list of `ede-sourcecode' objects this class will handle.
229This is used to match target objects with the compilers they can use, and
230which files this object is interested in."
231 :accessor ede-object-sourcecode)
232 (keybindings :allocation :class
233 :initform (("D" . ede-debug-target))
234 :documentation
235"Keybindings specialized to this type of target."
236 :accessor ede-object-keybindings)
237 (menu :allocation :class
238 :initform ( [ "Debug target" ede-debug-target
239 (and ede-object
240 (obj-of-class-p ede-object ede-target)) ]
241 )
242 [ "Run target" ede-run-target
243 (and ede-object
244 (obj-of-class-p ede-object ede-target)) ]
245 :documentation "Menu specialized to this type of target."
246 :accessor ede-object-menu)
247 )
248 "A top level target to build.")
249
250(defclass ede-project-placeholder (eieio-speedbar-directory-button)
251 ((name :initarg :name
252 :initform "Untitled"
253 :type string
254 :custom string
255 :label "Name"
256 :group (default name)
257 :documentation "The name used when generating distribution files.")
258 (version :initarg :version
259 :initform "1.0"
260 :type string
261 :custom string
262 :label "Version"
263 :group (default name)
264 :documentation "The version number used when distributing files.")
265 (directory :type string
266 :initarg :directory
267 :documentation "Directory this project is associated with.")
268 (dirinode :documentation "The inode id for :directory.")
269 (file :type string
270 :initarg :file
271 :documentation "File name where this project is stored.")
272 (rootproject ; :initarg - no initarg, don't save this slot!
273 :initform nil
274 :type (or null ede-project-placeholder-child)
275 :documentation "Pointer to our root project.")
276 )
277 "Placeholder object for projects not loaded into memory.
278Projects placeholders will be stored in a user specific location
279and querying them will cause the actual project to get loaded.")
280
281(defclass ede-project (ede-project-placeholder)
282 ((subproj :initform nil
283 :type list
284 :documentation "Sub projects controlled by this project.
285For Automake based projects, each directory is treated as a project.")
286 (targets :initarg :targets
287 :type list
288 :custom (repeat (object :objectcreatefcn ede-new-target-custom))
289 :label "Local Targets"
290 :group (targets)
291 :documentation "List of top level targets in this project.")
292 (locate-obj :type (or null ede-locate-base-child)
293 :documentation
294 "A locate object to use as a backup to `ede-expand-filename'.")
295 (tool-cache :initarg :tool-cache
296 :type list
297 :custom (repeat object)
298 :label "Tool: "
299 :group tools
300 :documentation "List of tool cache configurations in this project.
301This allows any tool to create, manage, and persist project-specific settings.")
302 (mailinglist :initarg :mailinglist
303 :initform ""
304 :type string
305 :custom string
306 :label "Mailing List Address"
307 :group name
308 :documentation
309 "An email address where users might send email for help.")
310 (web-site-url :initarg :web-site-url
311 :initform ""
312 :type string
313 :custom string
314 :label "Web Site URL"
315 :group name
316 :documentation "URL to this projects web site.
317This is a URL to be sent to a web site for documentation.")
318 (web-site-directory :initarg :web-site-directory
319 :initform ""
320 :custom string
321 :label "Web Page Directory"
322 :group name
323 :documentation
324 "A directory where web pages can be found by Emacs.
325For remote locations use a path compatible with ange-ftp or EFS.
326You can also use TRAMP for use with rcp & scp.")
327 (web-site-file :initarg :web-site-file
328 :initform ""
329 :custom string
330 :label "Web Page File"
331 :group name
332 :documentation
333 "A file which contains the home page for this project.
334This file can be relative to slot `web-site-directory'.
335This can be a local file, use ange-ftp, EFS, or TRAMP.")
336 (ftp-site :initarg :ftp-site
337 :initform ""
338 :type string
339 :custom string
340 :label "FTP site"
341 :group name
342 :documentation
343 "FTP site where this project's distribution can be found.
344This FTP site should be in Emacs form, as needed by `ange-ftp', but can
345also be of a form used by TRAMP for use with scp, or rcp.")
346 (ftp-upload-site :initarg :ftp-upload-site
347 :initform ""
348 :type string
349 :custom string
350 :label "FTP Upload site"
351 :group name
352 :documentation
353 "FTP Site to upload new distributions to.
354This FTP site should be in Emacs form as needed by `ange-ftp'.
355If this slot is nil, then use `ftp-site' instead.")
356 (configurations :initarg :configurations
357 :initform ("debug" "release")
358 :type list
359 :custom (repeat string)
360 :label "Configuration Options"
361 :group (settings)
362 :documentation "List of available configuration types.
363Individual target/project types can form associations between a configuration,
364and target specific elements such as build variables.")
365 (configuration-default :initarg :configuration-default
366 :initform "debug"
367 :custom string
368 :label "Current Configuration"
369 :group (settings)
370 :documentation "The default configuration.")
371 (local-variables :initarg :local-variables
372 :initform nil
373 :custom (repeat (cons (sexp :tag "Variable")
374 (sexp :tag "Value")))
375 :label "Project Local Variables"
376 :group (settings)
377 :documentation "Project local variables")
378 (keybindings :allocation :class
379 :initform (("D" . ede-debug-target)
380 ("R" . ede-run-target))
381 :documentation "Keybindings specialized to this type of target."
382 :accessor ede-object-keybindings)
383 (menu :allocation :class
384 :initform
385 (
386 [ "Update Version" ede-update-version ede-object ]
387 [ "Version Control Status" ede-vc-project-directory ede-object ]
388 [ "Edit Project Homepage" ede-edit-web-page
389 (and ede-object (oref (ede-toplevel) web-site-file)) ]
390 [ "Browse Project URL" ede-web-browse-home
391 (and ede-object
392 (not (string= "" (oref (ede-toplevel) web-site-url)))) ]
393 "--"
394 [ "Rescan Project Files" ede-rescan-toplevel t ]
395 [ "Edit Projectfile" ede-edit-file-target
396 (and ede-object
397 (or (listp ede-object)
398 (not (obj-of-class-p ede-object ede-project)))) ]
399 )
400 :documentation "Menu specialized to this type of target."
401 :accessor ede-object-menu)
402 )
403 "Top level EDE project specification.
404All specific project types must derive from this project."
405 :method-invocation-order :depth-first)
406 98
407;;; Management variables 99;;; Management variables
408 100
@@ -431,109 +123,13 @@ This object's class determines how to compile and debug from a buffer.")
431If `ede-object' is nil, then commands will operate on this object.") 123If `ede-object' is nil, then commands will operate on this object.")
432 124
433(defvar ede-constructing nil 125(defvar ede-constructing nil
434 "Non nil when constructing a project hierarchy.") 126 "Non nil when constructing a project hierarchy.
127If the project is being constructed from an autoload, then the
128value is the autoload object being used.")
435 129
436(defvar ede-deep-rescan nil 130(defvar ede-deep-rescan nil
437 "Non nil means scan down a tree, otherwise rescans are top level only. 131 "Non nil means scan down a tree, otherwise rescans are top level only.
438Do not set this to non-nil globally. It is used internally.") 132Do not set this to non-nil globally. It is used internally.")
439
440;;; The EDE persistent cache.
441;;
442(defcustom ede-project-placeholder-cache-file
443 (locate-user-emacs-file "ede-projects.el" ".projects.ede")
444 "File containing the list of projects EDE has viewed."
445 :group 'ede
446 :type 'file)
447
448(defvar ede-project-cache-files nil
449 "List of project files EDE has seen before.")
450
451(defun ede-save-cache ()
452 "Save a cache of EDE objects that Emacs has seen before."
453 (interactive)
454 (let ((p ede-projects)
455 (c ede-project-cache-files)
456 (recentf-exclude '(ignore))
457 )
458 (condition-case nil
459 (progn
460 (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
461 (erase-buffer)
462 (insert ";; EDE project cache file.
463;; This contains a list of projects you have visited.\n(")
464 (while p
465 (when (and (car p) (ede-project-p p))
466 (let ((f (oref (car p) file)))
467 (when (file-exists-p f)
468 (insert "\n \"" f "\""))))
469 (setq p (cdr p)))
470 (while c
471 (insert "\n \"" (car c) "\"")
472 (setq c (cdr c)))
473 (insert "\n)\n")
474 (condition-case nil
475 (save-buffer 0)
476 (error
477 (message "File %s could not be saved."
478 ede-project-placeholder-cache-file)))
479 (kill-buffer (current-buffer))
480 )
481 (error
482 (message "File %s could not be read."
483 ede-project-placeholder-cache-file))
484
485 )))
486
487(defun ede-load-cache ()
488 "Load the cache of EDE projects."
489 (save-excursion
490 (let ((cachebuffer nil))
491 (condition-case nil
492 (progn
493 (setq cachebuffer
494 (find-file-noselect ede-project-placeholder-cache-file t))
495 (set-buffer cachebuffer)
496 (goto-char (point-min))
497 (let ((c (read (current-buffer)))
498 (new nil)
499 (p ede-projects))
500 ;; Remove loaded projects from the cache.
501 (while p
502 (setq c (delete (oref (car p) file) c))
503 (setq p (cdr p)))
504 ;; Remove projects that aren't on the filesystem
505 ;; anymore.
506 (while c
507 (when (file-exists-p (car c))
508 (setq new (cons (car c) new)))
509 (setq c (cdr c)))
510 ;; Save it
511 (setq ede-project-cache-files (nreverse new))))
512 (error nil))
513 (when cachebuffer (kill-buffer cachebuffer))
514 )))
515
516;;; Important macros for doing commands.
517;;
518(defmacro ede-with-projectfile (obj &rest forms)
519 "For the project in which OBJ resides, execute FORMS."
520 (list 'save-window-excursion
521 (list 'let* (list
522 (list 'pf
523 (list 'if (list 'obj-of-class-p
524 obj 'ede-target)
525 ;; @todo -I think I can change
526 ;; this to not need ede-load-project-file
527 ;; but I'm not sure how to test well.
528 (list 'ede-load-project-file
529 (list 'oref obj 'path))
530 obj))
531 '(dbka (get-file-buffer (oref pf file))))
532 '(if (not dbka) (find-file (oref pf file))
533 (switch-to-buffer dbka))
534 (cons 'progn forms)
535 '(if (not dbka) (kill-buffer (current-buffer))))))
536(put 'ede-with-projectfile 'lisp-indent-function 1)
537 133
538 134
539;;; Prompting 135;;; Prompting
@@ -611,6 +207,18 @@ Argument LIST-O-O is the list of objects to choose from."
611 :enable ede-object 207 :enable ede-object
612 :visible global-ede-mode)) 208 :visible global-ede-mode))
613 209
210(defun ede-buffer-belongs-to-target-p ()
211 "Return non-nil if this buffer belongs to at least one target."
212 (let ((obj ede-object))
213 (if (consp obj)
214 (setq obj (car obj)))
215 (and obj (obj-of-class-p obj ede-target))))
216
217(defun ede-buffer-belongs-to-project-p ()
218 "Return non-nil if this buffer belongs to at least one target."
219 (if (or (null ede-object) (consp ede-object)) nil
220 (obj-of-class-p ede-object ede-project)))
221
614(defun ede-menu-obj-of-class-p (class) 222(defun ede-menu-obj-of-class-p (class)
615 "Return non-nil if some member of `ede-object' is a child of CLASS." 223 "Return non-nil if some member of `ede-object' is a child of CLASS."
616 (if (listp ede-object) 224 (if (listp ede-object)
@@ -672,9 +280,7 @@ Argument MENU-DEF is the menu definition to use."
672 (and (ede-current-project) 280 (and (ede-current-project)
673 (oref (ede-current-project) targets)) ] 281 (oref (ede-current-project) targets)) ]
674 [ "Remove File" ede-remove-file 282 [ "Remove File" ede-remove-file
675 (and ede-object 283 (ede-buffer-belongs-to-project-p) ]
676 (or (listp ede-object)
677 (not (obj-of-class-p ede-object ede-project)))) ]
678 "-") 284 "-")
679 (if (not obj) 285 (if (not obj)
680 nil 286 nil
@@ -718,7 +324,7 @@ Argument MENU-DEF is the definition of the current menu."
718 (let* ((obj (ede-current-project)) 324 (let* ((obj (ede-current-project))
719 targ) 325 targ)
720 (when obj 326 (when obj
721 (setq targ (when (slot-boundp obj 'targets) 327 (setq targ (when (and obj (slot-boundp obj 'targets))
722 (oref obj targets))) 328 (oref obj targets)))
723 ;; Make custom menus for everything here. 329 ;; Make custom menus for everything here.
724 (append (list 330 (append (list
@@ -804,31 +410,49 @@ provided `global-ede-mode' is enabled."
804 (eq major-mode 'vc-dired-mode)) 410 (eq major-mode 'vc-dired-mode))
805 (ede-dired-minor-mode (if ede-minor-mode 1 -1))) 411 (ede-dired-minor-mode (if ede-minor-mode 1 -1)))
806 (ede-minor-mode 412 (ede-minor-mode
807 (if (and (not ede-constructing) 413 (if (not ede-constructing)
808 (ede-directory-project-p default-directory t)) 414 (ede-initialize-state-current-buffer)
809 (let* ((ROOT nil)
810 (proj (ede-directory-get-open-project default-directory
811 'ROOT)))
812 (when (not proj)
813 ;; @todo - this could be wasteful.
814 (setq proj (ede-load-project-file default-directory 'ROOT)))
815 (setq ede-object-project proj)
816 (setq ede-object-root-project
817 (or ROOT (ede-project-root proj)))
818 (setq ede-object (ede-buffer-object))
819 (if (and (not ede-object) ede-object-project)
820 (ede-auto-add-to-target))
821 (ede-apply-target-options))
822 ;; If we fail to have a project here, turn it back off. 415 ;; If we fail to have a project here, turn it back off.
823 (ede-minor-mode -1))))) 416 (ede-minor-mode -1)))))
824 417
418(defun ede-initialize-state-current-buffer ()
419 "Initialize the current buffer's state for EDE.
420Sets buffer local variables for EDE."
421 (let* ((ROOT nil)
422 (proj (ede-directory-get-open-project default-directory
423 'ROOT)))
424 (when (or proj ROOT
425 (ede-directory-project-p default-directory t))
426
427 (when (not proj)
428 ;; @todo - this could be wasteful.
429 (setq proj (ede-load-project-file default-directory 'ROOT)))
430
431 (setq ede-object (ede-buffer-object (current-buffer)
432 'ede-object-project))
433
434 (setq ede-object-root-project
435 (or ROOT (ede-project-root ede-object-project)))
436
437 (if (and (not ede-object) ede-object-project)
438 (ede-auto-add-to-target))
439
440 (ede-apply-target-options))))
441
825(defun ede-reset-all-buffers (onoff) 442(defun ede-reset-all-buffers (onoff)
826 "Reset all the buffers due to change in EDE. 443 "Reset all the buffers due to change in EDE.
827ONOFF indicates enabling or disabling the mode." 444ONOFF indicates enabling or disabling the mode."
828 (let ((b (buffer-list))) 445 (let ((b (buffer-list)))
829 (while b 446 (while b
830 (when (buffer-file-name (car b)) 447 (when (buffer-file-name (car b))
831 (ede-buffer-object (car b)) 448 (with-current-buffer (car b)
449 ;; Reset all state variables
450 (setq ede-object nil
451 ede-object-project nil
452 ede-object-root-project nil)
453 ;; Now re-initialize this buffer.
454 (ede-initialize-state-current-buffer)
455 )
832 ) 456 )
833 (setq b (cdr b))))) 457 (setq b (cdr b)))))
834 458
@@ -967,6 +591,7 @@ Optional argument NAME is the name to give this project."
967 r) 591 r)
968 ) 592 )
969 nil t))) 593 nil t)))
594 (require 'ede/custom)
970 ;; Make sure we have a valid directory 595 ;; Make sure we have a valid directory
971 (when (not (file-exists-p default-directory)) 596 (when (not (file-exists-p default-directory))
972 (error "Cannot create project in non-existent directory %s" default-directory)) 597 (error "Cannot create project in non-existent directory %s" default-directory))
@@ -1014,20 +639,6 @@ Optional argument NAME is the name to give this project."
1014 "Add into PROJ-A, the subproject PROJ-B." 639 "Add into PROJ-A, the subproject PROJ-B."
1015 (oset proj-a subproj (cons proj-b (oref proj-a subproj)))) 640 (oset proj-a subproj (cons proj-b (oref proj-a subproj))))
1016 641
1017(defmethod ede-subproject-relative-path ((proj ede-project) &optional parent-in)
1018 "Get a path name for PROJ which is relative to the parent project.
1019If PARENT is specified, then be relative to the PARENT project.
1020Specifying PARENT is useful for sub-sub projects relative to the root project."
1021 (let* ((parent (or parent-in (ede-parent-project proj)))
1022 (dir (file-name-directory (oref proj file))))
1023 (if (and parent (not (eq parent proj)))
1024 (file-relative-name dir (file-name-directory (oref parent file)))
1025 "")))
1026
1027(defmethod ede-subproject-p ((proj ede-project))
1028 "Return non-nil if PROJ is a sub project."
1029 (ede-parent-project proj))
1030
1031(defun ede-invoke-method (sym &rest args) 642(defun ede-invoke-method (sym &rest args)
1032 "Invoke method SYM on the current buffer's project object. 643 "Invoke method SYM on the current buffer's project object.
1033ARGS are additional arguments to pass to method sym." 644ARGS are additional arguments to pass to method sym."
@@ -1162,175 +773,9 @@ Optional argument FORCE forces the file to be removed without asking."
1162(defun ede-make-dist () 773(defun ede-make-dist ()
1163 "Create a distribution from the current project." 774 "Create a distribution from the current project."
1164 (interactive) 775 (interactive)
1165 (let ((ede-object (ede-current-project))) 776 (let ((ede-object (ede-toplevel)))
1166 (ede-invoke-method 'project-make-dist))) 777 (ede-invoke-method 'project-make-dist)))
1167 778
1168;;; Customization
1169;;
1170;; Routines for customizing projects and targets.
1171
1172(defvar eieio-ede-old-variables nil
1173 "The old variables for a project.")
1174
1175(defalias 'customize-project 'ede-customize-project)
1176(defun ede-customize-project (&optional group)
1177 "Edit fields of the current project through EIEIO & Custom.
1178Optional GROUP specifies the subgroup of slots to customize."
1179 (interactive "P")
1180 (require 'eieio-custom)
1181 (let* ((ov (oref (ede-current-project) local-variables))
1182 (cp (ede-current-project))
1183 (group (if group (eieio-read-customization-group cp))))
1184 (eieio-customize-object cp group)
1185 (make-local-variable 'eieio-ede-old-variables)
1186 (setq eieio-ede-old-variables ov)))
1187
1188(defalias 'customize-target 'ede-customize-current-target)
1189(defun ede-customize-current-target(&optional group)
1190 "Edit fields of the current target through EIEIO & Custom.
1191Optional argument OBJ is the target object to customize.
1192Optional argument GROUP is the slot group to display."
1193 (interactive "P")
1194 (require 'eieio-custom)
1195 (if (not (obj-of-class-p ede-object ede-target))
1196 (error "Current file is not part of a target"))
1197 (let ((group (if group (eieio-read-customization-group ede-object))))
1198 (ede-customize-target ede-object group)))
1199
1200(defun ede-customize-target (obj group)
1201 "Edit fields of the current target through EIEIO & Custom.
1202Optional argument OBJ is the target object to customize.
1203Optional argument GROUP is the slot group to display."
1204 (require 'eieio-custom)
1205 (if (and obj (not (obj-of-class-p obj ede-target)))
1206 (error "No logical target to customize"))
1207 (eieio-customize-object obj (or group 'default)))
1208;;; Target Sorting
1209;;
1210;; Target order can be important, but custom doesn't support a way
1211;; to resort items in a list. This function by David Engster allows
1212;; targets to be re-arranged.
1213
1214(defvar ede-project-sort-targets-order nil
1215 "Variable for tracking target order in `ede-project-sort-targets'.")
1216
1217(defun ede-project-sort-targets ()
1218 "Create a custom-like buffer for sorting targets of current project."
1219 (interactive)
1220 (let ((proj (ede-current-project))
1221 (count 1)
1222 current order)
1223 (switch-to-buffer (get-buffer-create "*EDE sort targets*"))
1224 (erase-buffer)
1225 (setq ede-object-project proj)
1226 (widget-create 'push-button
1227 :notify (lambda (&rest ignore)
1228 (let ((targets (oref ede-object-project targets))
1229 cur newtargets)
1230 (while (setq cur (pop ede-project-sort-targets-order))
1231 (setq newtargets (append newtargets
1232 (list (nth cur targets)))))
1233 (oset ede-object-project targets newtargets))
1234 (ede-commit-project ede-object-project)
1235 (kill-buffer))
1236 " Accept ")
1237 (widget-insert " ")
1238 (widget-create 'push-button
1239 :notify (lambda (&rest ignore)
1240 (kill-buffer))
1241 " Cancel ")
1242 (widget-insert "\n\n")
1243 (setq ede-project-sort-targets-order nil)
1244 (mapc (lambda (x)
1245 (add-to-ordered-list
1246 'ede-project-sort-targets-order
1247 x x))
1248 (number-sequence 0 (1- (length (oref proj targets)))))
1249 (ede-project-sort-targets-list)
1250 (use-local-map widget-keymap)
1251 (widget-setup)
1252 (goto-char (point-min))))
1253
1254(defun ede-project-sort-targets-list ()
1255 "Sort the target list while using `ede-project-sort-targets'."
1256 (save-excursion
1257 (let ((count 0)
1258 (targets (oref ede-object-project targets))
1259 (inhibit-read-only t)
1260 (inhibit-modification-hooks t))
1261 (goto-char (point-min))
1262 (forward-line 2)
1263 (delete-region (point) (point-max))
1264 (while (< count (length targets))
1265 (if (> count 0)
1266 (widget-create 'push-button
1267 :notify `(lambda (&rest ignore)
1268 (let ((cur ede-project-sort-targets-order))
1269 (add-to-ordered-list
1270 'ede-project-sort-targets-order
1271 (nth ,count cur)
1272 (1- ,count))
1273 (add-to-ordered-list
1274 'ede-project-sort-targets-order
1275 (nth (1- ,count) cur) ,count))
1276 (ede-project-sort-targets-list))
1277 " Up ")
1278 (widget-insert " "))
1279 (if (< count (1- (length targets)))
1280 (widget-create 'push-button
1281 :notify `(lambda (&rest ignore)
1282 (let ((cur ede-project-sort-targets-order))
1283 (add-to-ordered-list
1284 'ede-project-sort-targets-order
1285 (nth ,count cur) (1+ ,count))
1286 (add-to-ordered-list
1287 'ede-project-sort-targets-order
1288 (nth (1+ ,count) cur) ,count))
1289 (ede-project-sort-targets-list))
1290 " Down ")
1291 (widget-insert " "))
1292 (widget-insert (concat " " (number-to-string (1+ count)) ".: "
1293 (oref (nth (nth count ede-project-sort-targets-order)
1294 targets) name) "\n"))
1295 (setq count (1+ count))))))
1296
1297;;; Customization hooks
1298;;
1299;; These hooks are used when finishing up a customization.
1300(defmethod eieio-done-customizing ((proj ede-project))
1301 "Call this when a user finishes customizing PROJ."
1302 (let ((ov eieio-ede-old-variables)
1303 (nv (oref proj local-variables)))
1304 (setq eieio-ede-old-variables nil)
1305 (while ov
1306 (if (not (assoc (car (car ov)) nv))
1307 (save-excursion
1308 (mapc (lambda (b)
1309 (set-buffer b)
1310 (kill-local-variable (car (car ov))))
1311 (ede-project-buffers proj))))
1312 (setq ov (cdr ov)))
1313 (mapc (lambda (b) (ede-set-project-variables proj b))
1314 (ede-project-buffers proj))))
1315
1316(defmethod eieio-done-customizing ((target ede-target))
1317 "Call this when a user finishes customizing TARGET."
1318 nil)
1319
1320(defmethod ede-commit-project ((proj ede-project))
1321 "Commit any change to PROJ to its file."
1322 nil
1323 )
1324
1325
1326;;; EDE project placeholder methods
1327;;
1328(defmethod ede-project-force-load ((this ede-project-placeholder))
1329 "Make sure the placeholder THIS is replaced with the real thing.
1330Return the new object created in its place."
1331 this
1332 )
1333
1334 779
1335;;; EDE project target baseline methods. 780;;; EDE project target baseline methods.
1336;; 781;;
@@ -1343,9 +788,9 @@ Return the new object created in its place."
1343;; methods based on those below. 788;; methods based on those below.
1344 789
1345(defmethod project-interactive-select-target ((this ede-project-placeholder) prompt) 790(defmethod project-interactive-select-target ((this ede-project-placeholder) prompt)
1346 ; checkdoc-params: (prompt) 791 ; checkdoc-params: (prompt)
1347 "Make sure placeholder THIS is replaced with the real thing, and pass through." 792 "Make sure placeholder THIS is replaced with the real thing, and pass through."
1348 (project-interactive-select-target (ede-project-force-load this) prompt)) 793 (project-interactive-select-target this prompt))
1349 794
1350(defmethod project-interactive-select-target ((this ede-project) prompt) 795(defmethod project-interactive-select-target ((this ede-project) prompt)
1351 "Interactively query for a target that exists in project THIS. 796 "Interactively query for a target that exists in project THIS.
@@ -1354,9 +799,9 @@ Argument PROMPT is the prompt to use when querying the user for a target."
1354 (cdr (assoc (completing-read prompt ob nil t) ob)))) 799 (cdr (assoc (completing-read prompt ob nil t) ob))))
1355 800
1356(defmethod project-add-file ((this ede-project-placeholder) file) 801(defmethod project-add-file ((this ede-project-placeholder) file)
1357 ; checkdoc-params: (file) 802 ; checkdoc-params: (file)
1358 "Make sure placeholder THIS is replaced with the real thing, and pass through." 803 "Make sure placeholder THIS is replaced with the real thing, and pass through."
1359 (project-add-file (ede-project-force-load this) file)) 804 (project-add-file this file))
1360 805
1361(defmethod project-add-file ((ot ede-target) file) 806(defmethod project-add-file ((ot ede-target) file)
1362 "Add the current buffer into project project target OT. 807 "Add the current buffer into project project target OT.
@@ -1413,132 +858,6 @@ Argument COMMAND is the command to use for compiling the target."
1413(defmethod project-rescan ((this ede-project)) 858(defmethod project-rescan ((this ede-project))
1414 "Rescan the EDE proj project THIS." 859 "Rescan the EDE proj project THIS."
1415 (error "Rescanning a project is not supported by %s" (object-name this))) 860 (error "Rescanning a project is not supported by %s" (object-name this)))
1416
1417;;; Default methods for EDE classes
1418;;
1419;; These are methods which you might want to override, but there is
1420;; no need to in most situations because they are either a) simple, or
1421;; b) cosmetic.
1422
1423(defmethod ede-name ((this ede-target))
1424 "Return the name of THIS target."
1425 (oref this name))
1426
1427(defmethod ede-target-name ((this ede-target))
1428 "Return the name of THIS target, suitable for make or debug style commands."
1429 (oref this name))
1430
1431(defmethod ede-name ((this ede-project))
1432 "Return a short-name for THIS project file.
1433Do this by extracting the lowest directory name."
1434 (oref this name))
1435
1436(defmethod ede-description ((this ede-project))
1437 "Return a description suitable for the minibuffer about THIS."
1438 (format "Project %s: %d subprojects, %d targets."
1439 (ede-name this) (length (oref this subproj))
1440 (length (oref this targets))))
1441
1442(defmethod ede-description ((this ede-target))
1443 "Return a description suitable for the minibuffer about THIS."
1444 (format "Target %s: with %d source files."
1445 (ede-name this) (length (oref this source))))
1446
1447(defmethod ede-want-file-p ((this ede-target) file)
1448 "Return non-nil if THIS target wants FILE."
1449 ;; By default, all targets reference the source object, and let it decide.
1450 (let ((src (ede-target-sourcecode this)))
1451 (while (and src (not (ede-want-file-p (car src) file)))
1452 (setq src (cdr src)))
1453 src))
1454
1455(defmethod ede-want-file-source-p ((this ede-target) file)
1456 "Return non-nil if THIS target wants FILE."
1457 ;; By default, all targets reference the source object, and let it decide.
1458 (let ((src (ede-target-sourcecode this)))
1459 (while (and src (not (ede-want-file-source-p (car src) file)))
1460 (setq src (cdr src)))
1461 src))
1462
1463(defun ede-header-file ()
1464 "Return the header file for the current buffer.
1465Not all buffers need headers, so return nil if no applicable."
1466 (if ede-object
1467 (ede-buffer-header-file ede-object (current-buffer))
1468 nil))
1469
1470(defmethod ede-buffer-header-file ((this ede-project) buffer)
1471 "Return nil, projects don't have header files."
1472 nil)
1473
1474(defmethod ede-buffer-header-file ((this ede-target) buffer)
1475 "There are no default header files in EDE.
1476Do a quick check to see if there is a Header tag in this buffer."
1477 (with-current-buffer buffer
1478 (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t)
1479 (buffer-substring-no-properties (match-beginning 1)
1480 (match-end 1))
1481 (let ((src (ede-target-sourcecode this))
1482 (found nil))
1483 (while (and src (not found))
1484 (setq found (ede-buffer-header-file (car src) (buffer-file-name))
1485 src (cdr src)))
1486 found))))
1487
1488(defun ede-documentation-files ()
1489 "Return the documentation files for the current buffer.
1490Not all buffers need documentations, so return nil if no applicable.
1491Some projects may have multiple documentation files, so return a list."
1492 (if ede-object
1493 (ede-buffer-documentation-files ede-object (current-buffer))
1494 nil))
1495
1496(defmethod ede-buffer-documentation-files ((this ede-project) buffer)
1497 "Return all documentation in project THIS based on BUFFER."
1498 ;; Find the info node.
1499 (ede-documentation this))
1500
1501(defmethod ede-buffer-documentation-files ((this ede-target) buffer)
1502 "Check for some documentation files for THIS.
1503Also do a quick check to see if there is a Documentation tag in this BUFFER."
1504 (with-current-buffer buffer
1505 (if (re-search-forward "::Documentation:: \\([a-zA-Z0-9.]+\\)" nil t)
1506 (buffer-substring-no-properties (match-beginning 1)
1507 (match-end 1))
1508 ;; Check the master project
1509 (let ((cp (ede-toplevel)))
1510 (ede-buffer-documentation-files cp (current-buffer))))))
1511
1512(defmethod ede-documentation ((this ede-project))
1513 "Return a list of files that provide documentation.
1514Documentation is not for object THIS, but is provided by THIS for other
1515files in the project."
1516 (let ((targ (oref this targets))
1517 (proj (oref this subproj))
1518 (found nil))
1519 (while targ
1520 (setq found (append (ede-documentation (car targ)) found)
1521 targ (cdr targ)))
1522 (while proj
1523 (setq found (append (ede-documentation (car proj)) found)
1524 proj (cdr proj)))
1525 found))
1526
1527(defmethod ede-documentation ((this ede-target))
1528 "Return a list of files that provide documentation.
1529Documentation is not for object THIS, but is provided by THIS for other
1530files in the project."
1531 nil)
1532
1533(defun ede-html-documentation-files ()
1534 "Return a list of HTML documentation files associated with this project."
1535 (ede-html-documentation (ede-toplevel))
1536 )
1537
1538(defmethod ede-html-documentation ((this ede-project))
1539 "Return a list of HTML files provided by project THIS."
1540
1541 )
1542 861
1543(defun ede-ecb-project-paths () 862(defun ede-ecb-project-paths ()
1544 "Return a list of all paths for all active EDE projects. 863 "Return a list of all paths for all active EDE projects.
@@ -1550,24 +869,8 @@ This functions is meant for use with ECB."
1550 d) 869 d)
1551 p (cdr p))) 870 p (cdr p)))
1552 d)) 871 d))
1553 872
1554;;; EDE project-autoload methods 873;;; PROJECT LOADING/TRACKING
1555;;
1556(defmethod ede-dir-to-projectfile ((this ede-project-autoload) dir)
1557 "Return a full file name of project THIS found in DIR.
1558Return nil if the project file does not exist."
1559 (let* ((d (file-name-as-directory dir))
1560 (root (ede-project-root-directory this d))
1561 (pf (oref this proj-file))
1562 (f (cond ((stringp pf)
1563 (expand-file-name pf (or root d)))
1564 ((and (symbolp pf) (fboundp pf))
1565 (funcall pf (or root d)))))
1566 )
1567 (when (and f (file-exists-p f))
1568 f)))
1569
1570;;; EDE basic functions
1571;; 874;;
1572(defun ede-add-project-to-global-list (proj) 875(defun ede-add-project-to-global-list (proj)
1573 "Add the project PROJ to the master list of projects. 876 "Add the project PROJ to the master list of projects.
@@ -1603,7 +906,7 @@ Optional ROOTRETURN will return the root project for DIR."
1603 (if p (ede-load-project-file p) 906 (if p (ede-load-project-file p)
1604 nil) 907 nil)
1605 ;; recomment as we go 908 ;; recomment as we go
1606 ;nil 909 ;;nil
1607 )) 910 ))
1608 ;; Do nothing if we are buiding an EDE project already 911 ;; Do nothing if we are buiding an EDE project already
1609 (ede-constructing 912 (ede-constructing
@@ -1612,7 +915,7 @@ Optional ROOTRETURN will return the root project for DIR."
1612 (t 915 (t
1613 (setq toppath (ede-toplevel-project path)) 916 (setq toppath (ede-toplevel-project path))
1614 ;; We found the top-most directory. Check to see if we already 917 ;; We found the top-most directory. Check to see if we already
1615 ;; have an object defining it's project. 918 ;; have an object defining its project.
1616 (setq pfc (ede-directory-project-p toppath t)) 919 (setq pfc (ede-directory-project-p toppath t))
1617 920
1618 ;; See if it's been loaded before 921 ;; See if it's been loaded before
@@ -1620,7 +923,7 @@ Optional ROOTRETURN will return the root project for DIR."
1620 ede-projects)) 923 ede-projects))
1621 (if (not o) 924 (if (not o)
1622 ;; If not, get it now. 925 ;; If not, get it now.
1623 (let ((ede-constructing t)) 926 (let ((ede-constructing pfc))
1624 (setq o (funcall (oref pfc load-type) toppath)) 927 (setq o (funcall (oref pfc load-type) toppath))
1625 (when (not o) 928 (when (not o)
1626 (error "Project type error: :load-type failed to create a project")) 929 (error "Project type error: :load-type failed to create a project"))
@@ -1649,9 +952,14 @@ Optional ROOTRETURN will return the root project for DIR."
1649 (delete (oref found file) ede-project-cache-files))) 952 (delete (oref found file) ede-project-cache-files)))
1650 found))))) 953 found)))))
1651 954
955;;; PROJECT ASSOCIATIONS
956;;
957;; Moving between relative projects. Associating between buffers and
958;; projects.
959
1652(defun ede-parent-project (&optional obj) 960(defun ede-parent-project (&optional obj)
1653 "Return the project belonging to the parent directory. 961 "Return the project belonging to the parent directory.
1654Returns nil if there is no previous directory. 962Return nil if there is no previous directory.
1655Optional argument OBJ is an object to find the parent of." 963Optional argument OBJ is an object to find the parent of."
1656 (let* ((proj (or obj ede-object-project)) ;; Current project. 964 (let* ((proj (or obj ede-object-project)) ;; Current project.
1657 (root (if obj (ede-project-root obj) 965 (root (if obj (ede-project-root obj)
@@ -1701,17 +1009,38 @@ If optional DIR is provided, get the project for DIR instead."
1701 ;; Return what we found. 1009 ;; Return what we found.
1702 ans)) 1010 ans))
1703 1011
1704(defun ede-buffer-object (&optional buffer) 1012(defun ede-buffer-object (&optional buffer projsym)
1705 "Return the target object for BUFFER. 1013 "Return the target object for BUFFER.
1706This function clears cached values and recalculates." 1014This function clears cached values and recalculates.
1015Optional PROJSYM is a symbol, which will be set to the project
1016that contains the target that becomes buffer's object."
1707 (save-excursion 1017 (save-excursion
1708 (if (not buffer) (setq buffer (current-buffer))) 1018 (if (not buffer) (setq buffer (current-buffer)))
1709 (set-buffer buffer) 1019 (set-buffer buffer)
1710 (setq ede-object nil) 1020 (setq ede-object nil)
1711 (let ((po (ede-current-project))) 1021 (let* ((localpo (ede-current-project))
1712 (if po (setq ede-object (ede-find-target po buffer)))) 1022 (po localpo)
1713 (if (= (length ede-object) 1) 1023 (top (ede-toplevel po)))
1714 (setq ede-object (car ede-object))) 1024 (if po (setq ede-object (ede-find-target po buffer)))
1025 ;; If we get nothing, go with the backup plan of slowly
1026 ;; looping upward
1027 (while (and (not ede-object) (not (eq po top)))
1028 (setq po (ede-parent-project po))
1029 (if po (setq ede-object (ede-find-target po buffer))))
1030 ;; Filter down to 1 project if there are dups.
1031 (if (= (length ede-object) 1)
1032 (setq ede-object (car ede-object)))
1033 ;; Track the project, if needed.
1034 (when (and projsym (symbolp projsym))
1035 (if ede-object
1036 ;; If we found a target, then PO is the
1037 ;; project to use.
1038 (set projsym po)
1039 ;; If there is no ede-object, then the projsym
1040 ;; is whichever part of the project is most local.
1041 (set projsym localpo))
1042 ))
1043 ;; Return our findings.
1715 ede-object)) 1044 ede-object))
1716 1045
1717(defmethod ede-target-in-project-p ((proj ede-project) target) 1046(defmethod ede-target-in-project-p ((proj ede-project) target)
@@ -1738,14 +1067,6 @@ could become slow in time."
1738 projs (cdr projs))) 1067 projs (cdr projs)))
1739 ans)) 1068 ans))
1740 1069
1741(defun ede-maybe-checkout (&optional buffer)
1742 "Check BUFFER out of VC if necessary."
1743 (save-excursion
1744 (if buffer (set-buffer buffer))
1745 (if (and buffer-read-only vc-mode
1746 (y-or-n-p "Checkout Makefile.am from VC? "))
1747 (vc-toggle-read-only))))
1748
1749(defmethod ede-find-target ((proj ede-project) buffer) 1070(defmethod ede-find-target ((proj ede-project) buffer)
1750 "Fetch the target in PROJ belonging to BUFFER or nil." 1071 "Fetch the target in PROJ belonging to BUFFER or nil."
1751 (with-current-buffer buffer 1072 (with-current-buffer buffer
@@ -1786,7 +1107,7 @@ This includes buffers controlled by a specific target of PROJECT."
1786 (pl nil)) 1107 (pl nil))
1787 (while bl 1108 (while bl
1788 (with-current-buffer (car bl) 1109 (with-current-buffer (car bl)
1789 (if (and ede-object (eq (ede-current-project) project)) 1110 (if (ede-buffer-belongs-to-project-p)
1790 (setq pl (cons (car bl) pl)))) 1111 (setq pl (cons (car bl) pl))))
1791 (setq bl (cdr bl))) 1112 (setq bl (cdr bl)))
1792 pl)) 1113 pl))
@@ -1857,6 +1178,16 @@ See also `ede-map-subprojects'."
1857Return the first non-nil value returned by PROC." 1178Return the first non-nil value returned by PROC."
1858 (eval (cons 'or (ede-map-targets this proc)))) 1179 (eval (cons 'or (ede-map-targets this proc))))
1859 1180
1181;;; VC Handling
1182;;
1183(defun ede-maybe-checkout (&optional buffer)
1184 "Check BUFFER out of VC if necessary."
1185 (save-excursion
1186 (if buffer (set-buffer buffer))
1187 (if (and buffer-read-only vc-mode
1188 (y-or-n-p "Checkout Makefile.am from VC? "))
1189 (vc-toggle-read-only))))
1190
1860 1191
1861;;; Some language specific methods. 1192;;; Some language specific methods.
1862;; 1193;;
@@ -1913,7 +1244,7 @@ Return the first non-nil value returned by PROC."
1913 (with-current-buffer buffer 1244 (with-current-buffer buffer
1914 (dolist (v (oref project local-variables)) 1245 (dolist (v (oref project local-variables))
1915 (make-local-variable (car v)) 1246 (make-local-variable (car v))
1916 ;; set it's value here? 1247 ;; set its value here?
1917 (set (car v) (cdr v))))) 1248 (set (car v) (cdr v)))))
1918 1249
1919(defun ede-set (variable value &optional proj) 1250(defun ede-set (variable value &optional proj)
@@ -1936,60 +1267,6 @@ is the project to use, instead of `ede-current-project'."
1936 "Commit change to local variables in PROJ." 1267 "Commit change to local variables in PROJ."
1937 nil) 1268 nil)
1938 1269
1939
1940;;; Accessors for more complex types where oref is inappropriate.
1941;;
1942(defmethod ede-target-sourcecode ((this ede-target))
1943 "Return the sourcecode objects which THIS permits."
1944 (let ((sc (oref this sourcetype))
1945 (rs nil))
1946 (while (and (listp sc) sc)
1947 (setq rs (cons (symbol-value (car sc)) rs)
1948 sc (cdr sc)))
1949 rs))
1950
1951
1952;;; Debugging.
1953
1954(defun ede-adebug-project ()
1955 "Run adebug against the current EDE project.
1956Display the results as a debug list."
1957 (interactive)
1958 (require 'data-debug)
1959 (when (ede-current-project)
1960 (data-debug-new-buffer "*Analyzer ADEBUG*")
1961 (data-debug-insert-object-slots (ede-current-project) "")
1962 ))
1963
1964(defun ede-adebug-project-parent ()
1965 "Run adebug against the current EDE parent project.
1966Display the results as a debug list."
1967 (interactive)
1968 (require 'data-debug)
1969 (when (ede-parent-project)
1970 (data-debug-new-buffer "*Analyzer ADEBUG*")
1971 (data-debug-insert-object-slots (ede-parent-project) "")
1972 ))
1973
1974(defun ede-adebug-project-root ()
1975 "Run adebug against the current EDE parent project.
1976Display the results as a debug list."
1977 (interactive)
1978 (require 'data-debug)
1979 (when (ede-toplevel)
1980 (data-debug-new-buffer "*Analyzer ADEBUG*")
1981 (data-debug-insert-object-slots (ede-toplevel) "")
1982 ))
1983
1984;;; Hooks & Autoloads
1985;;
1986;; These let us watch various activities, and respond appropriately.
1987
1988;; (add-hook 'edebug-setup-hook
1989;; (lambda ()
1990;; (def-edebug-spec ede-with-projectfile
1991;; (form def-body))))
1992
1993(provide 'ede) 1270(provide 'ede)
1994 1271
1995;; Include this last because it depends on ede. 1272;; Include this last because it depends on ede.
diff --git a/lisp/cedet/ede/auto.el b/lisp/cedet/ede/auto.el
new file mode 100644
index 00000000000..52e0e3c3cf3
--- /dev/null
+++ b/lisp/cedet/ede/auto.el
@@ -0,0 +1,128 @@
1;;; ede/auto.el --- Autoload features for EDE
2
3;; Copyright (C) 2010 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <zappo@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23;;
24;; EDE Autoloads are a way to refer to different project types without
25;; loading those projects into Emacs.
26;;
27;; These routines are used to detect a project in a filesystem before
28;; handing over control to the usual EDE project system.
29
30;;; Code:
31
32(require 'eieio)
33
34(defclass ede-project-autoload ()
35 ((name :initarg :name
36 :documentation "Name of this project type")
37 (file :initarg :file
38 :documentation "The lisp file belonging to this class.")
39 (proj-file :initarg :proj-file
40 :documentation "Name of a project file of this type.")
41 (proj-root :initarg :proj-root
42 :type function
43 :documentation "A function symbol to call for the project root.
44This function takes no arguments, and returns the current directories
45root, if available. Leave blank to use the EDE directory walking
46routine instead.")
47 (initializers :initarg :initializers
48 :initform nil
49 :documentation
50 "Initializers passed to the project object.
51These are used so there can be multiple types of projects
52associated with a single object class, based on the initilizeres used.")
53 (load-type :initarg :load-type
54 :documentation "Fn symbol used to load this project file.")
55 (class-sym :initarg :class-sym
56 :documentation "Symbol representing the project class to use.")
57 (new-p :initarg :new-p
58 :initform t
59 :documentation
60 "Non-nil if this is an option when a user creates a project.")
61 )
62 "Class representing minimal knowledge set to run preliminary EDE functions.
63When more advanced functionality is needed from a project type, that projects
64type is required and the load function used.")
65
66(defvar ede-project-class-files
67 (list
68 (ede-project-autoload "edeproject-makefile"
69 :name "Make" :file 'ede/proj
70 :proj-file "Project.ede"
71 :load-type 'ede-proj-load
72 :class-sym 'ede-proj-project)
73 (ede-project-autoload "edeproject-automake"
74 :name "Automake" :file 'ede/proj
75 :proj-file "Project.ede"
76 :initializers '(:makefile-type Makefile.am)
77 :load-type 'ede-proj-load
78 :class-sym 'ede-proj-project)
79 (ede-project-autoload "automake"
80 :name "automake" :file 'ede/project-am
81 :proj-file "Makefile.am"
82 :load-type 'project-am-load
83 :class-sym 'project-am-makefile
84 :new-p nil))
85 "List of vectors defining how to determine what type of projects exist.")
86
87;;; EDE project-autoload methods
88;;
89(defmethod ede-project-root ((this ede-project-autoload))
90 "If a project knows its root, return it here.
91Allows for one-project-object-for-a-tree type systems."
92 nil)
93
94(defmethod ede-project-root-directory ((this ede-project-autoload)
95 &optional file)
96 "If a project knows its root, return it here.
97Allows for one-project-object-for-a-tree type systems.
98Optional FILE is the file to test. If there is no FILE, use
99the current buffer."
100 (when (not file)
101 (setq file default-directory))
102 (when (slot-boundp this :proj-root)
103 (let ((rootfcn (oref this proj-root)))
104 (when rootfcn
105 (condition-case nil
106 (funcall rootfcn file)
107 (error
108 (funcall rootfcn)))
109 ))))
110
111(defmethod ede-dir-to-projectfile ((this ede-project-autoload) dir)
112 "Return a full file name of project THIS found in DIR.
113Return nil if the project file does not exist."
114 (let* ((d (file-name-as-directory dir))
115 (root (ede-project-root-directory this d))
116 (pf (oref this proj-file))
117 (f (cond ((stringp pf)
118 (expand-file-name pf (or root d)))
119 ((and (symbolp pf) (fboundp pf))
120 (funcall pf (or root d)))))
121 )
122 (when (and f (file-exists-p f))
123 f)))
124
125
126(provide 'ede/auto)
127
128;;; ede/auto.el ends here
diff --git a/lisp/cedet/ede/autoconf-edit.el b/lisp/cedet/ede/autoconf-edit.el
index 3973fc7f6af..df976bf17af 100644
--- a/lisp/cedet/ede/autoconf-edit.el
+++ b/lisp/cedet/ede/autoconf-edit.el
@@ -27,20 +27,8 @@
27 27
28;;; Code: 28;;; Code:
29(require 'autoconf) 29(require 'autoconf)
30 30(declare-function ede-srecode-setup "ede/srecode")
31(defvar autoconf-new-automake-string 31(declare-function ede-srecode-insert "ede/srecode")
32 "dnl Process this file with autoconf to produce a configure script
33
34AC_INIT(%s)
35AM_INIT_AUTOMAKE([%s], 0)
36AM_CONFIG_HEADER(config.h)
37
38dnl End the configure script.
39AC_OUTPUT(Makefile, [date > stamp-h] )\n"
40 "This string is used to initialize a new configure.in.
41The default is designed to be used with automake.
42The first %s will be filled with the test file.
43The second %s will be filled with the program name.")
44 32
45(defun autoconf-new-program (rootdir program testfile) 33(defun autoconf-new-program (rootdir program testfile)
46 "Initialize a new configure.in in ROOTDIR for PROGRAM using TESTFILE. 34 "Initialize a new configure.in in ROOTDIR for PROGRAM using TESTFILE.
@@ -49,6 +37,7 @@ PROGRAM is the program to be configured.
49TESTFILE is the file used with AC_INIT. 37TESTFILE is the file used with AC_INIT.
50configure the initial configure script using `autoconf-new-automake-string'" 38configure the initial configure script using `autoconf-new-automake-string'"
51 (interactive "DRoot Dir: \nsProgram: \nsTest File: ") 39 (interactive "DRoot Dir: \nsProgram: \nsTest File: ")
40 (require 'ede/srecode)
52 (if (bufferp rootdir) 41 (if (bufferp rootdir)
53 (set-buffer rootdir) 42 (set-buffer rootdir)
54 (let ((cf1 (expand-file-name "configure.in" rootdir)) 43 (let ((cf1 (expand-file-name "configure.in" rootdir))
@@ -62,7 +51,12 @@ configure the initial configure script using `autoconf-new-automake-string'"
62 (find-file cf2))) 51 (find-file cf2)))
63 ;; Note, we only ask about overwrite if a string/path is specified. 52 ;; Note, we only ask about overwrite if a string/path is specified.
64 (erase-buffer) 53 (erase-buffer)
65 (insert (format autoconf-new-automake-string testfile program))) 54 (ede-srecode-setup)
55 (ede-srecode-insert
56 "file:ede-empty"
57 "TEST_FILE" testfile
58 "PROGRAM" program)
59 )
66 60
67(defvar autoconf-preferred-macro-order 61(defvar autoconf-preferred-macro-order
68 '("AC_INIT" 62 '("AC_INIT"
@@ -151,42 +145,44 @@ From the autoconf manual:
151 (beginning-of-line) 145 (beginning-of-line)
152 (looking-at (concat "\\(A[CM]_" macro "\\|" macro "\\)")))) 146 (looking-at (concat "\\(A[CM]_" macro "\\|" macro "\\)"))))
153 147
154(defun autoconf-find-last-macro (macro) 148(defun autoconf-find-last-macro (macro &optional ignore-bol)
155 "Move to the last occurrence of MACRO in FILE, and return that point. 149 "Move to the last occurrence of MACRO in FILE, and return that point.
156The last macro is usually the one in which we would like to insert more 150The last macro is usually the one in which we would like to insert more
157items such as CHECK_HEADERS." 151items such as CHECK_HEADERS."
158 (let ((op (point))) 152 (let ((op (point)) (atbol (if ignore-bol "" "^")))
159 (goto-char (point-max)) 153 (goto-char (point-max))
160 (if (re-search-backward (concat "^" (regexp-quote macro) "\\s-*\\((\\|$\\)") nil t) 154 (if (re-search-backward (concat atbol (regexp-quote macro) "\\s-*\\((\\|$\\)") nil t)
161 (progn 155 (progn
162 (beginning-of-line) 156 (unless ignore-bol (beginning-of-line))
163 (point)) 157 (point))
164 (goto-char op) 158 (goto-char op)
165 nil))) 159 nil)))
166 160
167(defun autoconf-parameter-strip (param) 161(defun autoconf-parameter-strip (param)
168 "Strip the parameter PARAM of whitespace and miscellaneous characters." 162 "Strip the parameter PARAM of whitespace and miscellaneous characters."
169 (when (string-match "^\\s-*\\[?\\s-*" param) 163 ;; force greedy match for \n.
164 (when (string-match "\\`\n*\\s-*\\[?\\s-*" param)
170 (setq param (substring param (match-end 0)))) 165 (setq param (substring param (match-end 0))))
171 (when (string-match "\\s-*\\]?\\s-*$" param) 166 (when (string-match "\\s-*\\]?\\s-*\\'" param)
172 (setq param (substring param 0 (match-beginning 0)))) 167 (setq param (substring param 0 (match-beginning 0))))
173 param) 168 param)
174 169
175(defun autoconf-parameters-for-macro (macro) 170(defun autoconf-parameters-for-macro (macro &optional ignore-bol ignore-case)
176 "Retrieve the parameters to MACRO. 171 "Retrieve the parameters to MACRO.
177Returns a list of the arguments passed into MACRO as strings." 172Returns a list of the arguments passed into MACRO as strings."
178 (save-excursion 173 (let ((case-fold-search ignore-case))
179 (when (autoconf-find-last-macro macro) 174 (save-excursion
180 (forward-sexp 1) 175 (when (autoconf-find-last-macro macro ignore-bol)
181 (mapcar 176 (forward-sexp 1)
182 #'autoconf-parameter-strip 177 (mapcar
183 (when (looking-at "(") 178 #'autoconf-parameter-strip
184 (let* ((start (+ (point) 1)) 179 (when (looking-at "(")
185 (end (save-excursion 180 (let* ((start (+ (point) 1))
186 (forward-sexp 1) 181 (end (save-excursion
187 (- (point) 1))) 182 (forward-sexp 1)
188 (ans (buffer-substring-no-properties start end))) 183 (- (point) 1)))
189 (split-string ans "," t))))))) 184 (ans (buffer-substring-no-properties start end)))
185 (split-string ans "," t))))))))
190 186
191(defun autoconf-position-for-macro (macro) 187(defun autoconf-position-for-macro (macro)
192 "Position the cursor where a new MACRO could be inserted. 188 "Position the cursor where a new MACRO could be inserted.
diff --git a/lisp/cedet/ede/base.el b/lisp/cedet/ede/base.el
new file mode 100644
index 00000000000..f1f24ed339f
--- /dev/null
+++ b/lisp/cedet/ede/base.el
@@ -0,0 +1,636 @@
1;;; ede/base.el --- Baseclasses for EDE.
2
3;; Copyright (C) 2010 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <zappo@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23;;
24;; Baseclasses for EDE.
25;;
26;; Contains all the base structures needed by EDE.
27
28;;; Code:
29(require 'eieio)
30(require 'eieio-speedbar)
31(require 'ede/auto)
32
33;; Defined in ede.el:
34(defvar ede-projects)
35(defvar ede-object)
36(defvar ede-object-root-project)
37
38(declare-function data-debug-new-buffer "data-debug")
39(declare-function data-debug-insert-object-slots "eieio-datadebug")
40(declare-function ede-parent-project "ede" (&optional obj))
41(declare-function ede-current-project "ede" (&optional dir))
42
43;;; TARGET
44;;
45;; The TARGET is an entity in a project that knows about files
46;; and features of those files.
47
48(defclass ede-target (eieio-speedbar-directory-button)
49 ((buttonface :initform speedbar-file-face) ;override for superclass
50 (name :initarg :name
51 :type string
52 :custom string
53 :label "Name"
54 :group (default name)
55 :documentation "Name of this target.")
56 ;; @todo - I think this should be "dir", and not "path".
57 (path :initarg :path
58 :type string
59 ;:custom string
60 ;:label "Path to target"
61 ;:group (default name)
62 :documentation "The path to the sources of this target.
63Relative to the path of the project it belongs to.")
64 (source :initarg :source
65 :initform nil
66 ;; I'd prefer a list of strings.
67 :type list
68 :custom (repeat (string :tag "File"))
69 :label "Source Files"
70 :group (default source)
71 :documentation "Source files in this target.")
72 (versionsource :initarg :versionsource
73 :initform nil
74 :type list
75 :custom (repeat (string :tag "File"))
76 :label "Source Files with Version String"
77 :group (source)
78 :documentation
79 "Source files with a version string in them.
80These files are checked for a version string whenever the EDE version
81of the master project is changed. When strings are found, the version
82previously there is updated.")
83 ;; Class level slots
84 ;;
85 (sourcetype :allocation :class
86 :type list ;; list of symbols
87 :documentation
88 "A list of `ede-sourcecode' objects this class will handle.
89This is used to match target objects with the compilers they can use, and
90which files this object is interested in."
91 :accessor ede-object-sourcecode)
92 (keybindings :allocation :class
93 :initform (("D" . ede-debug-target))
94 :documentation
95"Keybindings specialized to this type of target."
96 :accessor ede-object-keybindings)
97 (menu :allocation :class
98 :initform ( [ "Debug target" ede-debug-target
99 (ede-buffer-belongs-to-target-p) ]
100 [ "Run target" ede-run-target
101 (ede-buffer-belongs-to-target-p) ]
102 )
103 :documentation "Menu specialized to this type of target."
104 :accessor ede-object-menu)
105 )
106 "A target is a structure that describes a file set that produces something.
107Targets, as with 'Make', is an entity that will manage a file set
108and knows how to compile or otherwise transform those files into some
109other desired outcome.")
110
111;;; PROJECT/PLACEHOLDER
112;;
113;; Project placeholders are minimum parts of a project used
114;; by the project cache. The project cache can refer to these placeholders,
115;; and swap them out with the real-deal when that project is loaded.
116;;
117(defclass ede-project-placeholder (eieio-speedbar-directory-button)
118 ((name :initarg :name
119 :initform "Untitled"
120 :type string
121 :custom string
122 :label "Name"
123 :group (default name)
124 :documentation "The name used when generating distribution files.")
125 (version :initarg :version
126 :initform "1.0"
127 :type string
128 :custom string
129 :label "Version"
130 :group (default name)
131 :documentation "The version number used when distributing files.")
132 (directory :type string
133 :initarg :directory
134 :documentation "Directory this project is associated with.")
135 (dirinode :documentation "The inode id for :directory.")
136 (file :type string
137 :initarg :file
138 :documentation "File name where this project is stored.")
139 (rootproject ; :initarg - no initarg, don't save this slot!
140 :initform nil
141 :type (or null ede-project-placeholder-child)
142 :documentation "Pointer to our root project.")
143 )
144 "Placeholder object for projects not loaded into memory.
145Projects placeholders will be stored in a user specific location
146and querying them will cause the actual project to get loaded.")
147
148;;; PROJECT
149;;
150;; An EDE project controls a set of TARGETS, and can also contain
151;; multiple SUBPROJECTS.
152;;
153;; The project defines a set of features that need to be built from
154;; files, in addition as to controlling what to do with the file set,
155;; such as creating distributions, compilation, and web sites.
156;;
157;; Projects can also affect how EDE works, by changing what appears in
158;; the EDE menu, or how some keys are bound.
159;;
160(defclass ede-project (ede-project-placeholder)
161 ((subproj :initform nil
162 :type list
163 :documentation "Sub projects controlled by this project.
164For Automake based projects, each directory is treated as a project.")
165 (targets :initarg :targets
166 :type list
167 :custom (repeat (object :objectcreatefcn ede-new-target-custom))
168 :label "Local Targets"
169 :group (targets)
170 :documentation "List of top level targets in this project.")
171 (locate-obj :type (or null ede-locate-base-child)
172 :documentation
173 "A locate object to use as a backup to `ede-expand-filename'.")
174 (tool-cache :initarg :tool-cache
175 :type list
176 :custom (repeat object)
177 :label "Tool: "
178 :group tools
179 :documentation "List of tool cache configurations in this project.
180This allows any tool to create, manage, and persist project-specific settings.")
181 (mailinglist :initarg :mailinglist
182 :initform ""
183 :type string
184 :custom string
185 :label "Mailing List Address"
186 :group name
187 :documentation
188 "An email address where users might send email for help.")
189 (web-site-url :initarg :web-site-url
190 :initform ""
191 :type string
192 :custom string
193 :label "Web Site URL"
194 :group name
195 :documentation "URL to this projects web site.
196This is a URL to be sent to a web site for documentation.")
197 (web-site-directory :initarg :web-site-directory
198 :initform ""
199 :custom string
200 :label "Web Page Directory"
201 :group name
202 :documentation
203 "A directory where web pages can be found by Emacs.
204For remote locations use a path compatible with ange-ftp or EFS.
205You can also use TRAMP for use with rcp & scp.")
206 (web-site-file :initarg :web-site-file
207 :initform ""
208 :custom string
209 :label "Web Page File"
210 :group name
211 :documentation
212 "A file which contains the home page for this project.
213This file can be relative to slot `web-site-directory'.
214This can be a local file, use ange-ftp, EFS, or TRAMP.")
215 (ftp-site :initarg :ftp-site
216 :initform ""
217 :type string
218 :custom string
219 :label "FTP site"
220 :group name
221 :documentation
222 "FTP site where this project's distribution can be found.
223This FTP site should be in Emacs form, as needed by `ange-ftp', but can
224also be of a form used by TRAMP for use with scp, or rcp.")
225 (ftp-upload-site :initarg :ftp-upload-site
226 :initform ""
227 :type string
228 :custom string
229 :label "FTP Upload site"
230 :group name
231 :documentation
232 "FTP Site to upload new distributions to.
233This FTP site should be in Emacs form as needed by `ange-ftp'.
234If this slot is nil, then use `ftp-site' instead.")
235 (configurations :initarg :configurations
236 :initform ("debug" "release")
237 :type list
238 :custom (repeat string)
239 :label "Configuration Options"
240 :group (settings)
241 :documentation "List of available configuration types.
242Individual target/project types can form associations between a configuration,
243and target specific elements such as build variables.")
244 (configuration-default :initarg :configuration-default
245 :initform "debug"
246 :custom string
247 :label "Current Configuration"
248 :group (settings)
249 :documentation "The default configuration.")
250 (local-variables :initarg :local-variables
251 :initform nil
252 :custom (repeat (cons (sexp :tag "Variable")
253 (sexp :tag "Value")))
254 :label "Project Local Variables"
255 :group (settings)
256 :documentation "Project local variables")
257 (keybindings :allocation :class
258 :initform (("D" . ede-debug-target)
259 ("R" . ede-run-target))
260 :documentation "Keybindings specialized to this type of target."
261 :accessor ede-object-keybindings)
262 (menu :allocation :class
263 :initform
264 (
265 [ "Update Version" ede-update-version ede-object ]
266 [ "Version Control Status" ede-vc-project-directory ede-object ]
267 [ "Edit Project Homepage" ede-edit-web-page
268 (and ede-object (oref (ede-toplevel) web-site-file)) ]
269 [ "Browse Project URL" ede-web-browse-home
270 (and ede-object
271 (not (string= "" (oref (ede-toplevel) web-site-url)))) ]
272 "--"
273 [ "Rescan Project Files" ede-rescan-toplevel t ]
274 [ "Edit Projectfile" ede-edit-file-target
275 (ede-buffer-belongs-to-project-p) ]
276 )
277 :documentation "Menu specialized to this type of target."
278 :accessor ede-object-menu)
279 )
280 "Top level EDE project specification.
281All specific project types must derive from this project."
282 :method-invocation-order :depth-first)
283
284;;; Important macros for doing commands.
285;;
286(defmacro ede-with-projectfile (obj &rest forms)
287 "For the project in which OBJ resides, execute FORMS."
288 (list 'save-window-excursion
289 (list 'let* (list
290 (list 'pf
291 (list 'if (list 'obj-of-class-p
292 obj 'ede-target)
293 ;; @todo -I think I can change
294 ;; this to not need ede-load-project-file
295 ;; but I'm not sure how to test well.
296 (list 'ede-load-project-file
297 (list 'oref obj 'path))
298 obj))
299 '(dbka (get-file-buffer (oref pf file))))
300 '(if (not dbka) (find-file (oref pf file))
301 (switch-to-buffer dbka))
302 (cons 'progn forms)
303 '(if (not dbka) (kill-buffer (current-buffer))))))
304(put 'ede-with-projectfile 'lisp-indent-function 1)
305
306;;; The EDE persistent cache.
307;;
308;; The cache is a way to mark where all known projects live without
309;; loading those projects into memory, or scanning for them each time
310;; emacs starts.
311;;
312(defcustom ede-project-placeholder-cache-file
313 (locate-user-emacs-file "ede-projects.el" ".projects.ede")
314 "File containing the list of projects EDE has viewed."
315 :group 'ede
316 :type 'file)
317
318(defvar ede-project-cache-files nil
319 "List of project files EDE has seen before.")
320
321(defun ede-save-cache ()
322 "Save a cache of EDE objects that Emacs has seen before."
323 (interactive)
324 (let ((p ede-projects)
325 (c ede-project-cache-files)
326 (recentf-exclude '( (lambda (f) t) ))
327 )
328 (condition-case nil
329 (progn
330 (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
331 (erase-buffer)
332 (insert ";; EDE project cache file.
333;; This contains a list of projects you have visited.\n(")
334 (while p
335 (when (and (car p) (ede-project-p p))
336 (let ((f (oref (car p) file)))
337 (when (file-exists-p f)
338 (insert "\n \"" f "\""))))
339 (setq p (cdr p)))
340 (while c
341 (insert "\n \"" (car c) "\"")
342 (setq c (cdr c)))
343 (insert "\n)\n")
344 (condition-case nil
345 (save-buffer 0)
346 (error
347 (message "File %s could not be saved."
348 ede-project-placeholder-cache-file)))
349 (kill-buffer (current-buffer))
350 )
351 (error
352 (message "File %s could not be read."
353 ede-project-placeholder-cache-file))
354
355 )))
356
357(defun ede-load-cache ()
358 "Load the cache of EDE projects."
359 (save-excursion
360 (let ((cachebuffer nil))
361 (condition-case nil
362 (progn
363 (setq cachebuffer
364 (find-file-noselect ede-project-placeholder-cache-file t))
365 (set-buffer cachebuffer)
366 (goto-char (point-min))
367 (let ((c (read (current-buffer)))
368 (new nil)
369 (p ede-projects))
370 ;; Remove loaded projects from the cache.
371 (while p
372 (setq c (delete (oref (car p) file) c))
373 (setq p (cdr p)))
374 ;; Remove projects that aren't on the filesystem
375 ;; anymore.
376 (while c
377 (when (file-exists-p (car c))
378 (setq new (cons (car c) new)))
379 (setq c (cdr c)))
380 ;; Save it
381 (setq ede-project-cache-files (nreverse new))))
382 (error nil))
383 (when cachebuffer (kill-buffer cachebuffer))
384 )))
385
386;;; Get the cache usable.
387
388;; @TODO - Remove this cache setup, or use this for something helpful.
389;;(add-hook 'kill-emacs-hook 'ede-save-cache)
390;;(when (not noninteractive)
391;; ;; No need to load the EDE cache if we aren't interactive.
392;; ;; This occurs during batch byte-compiling of other tools.
393;; (ede-load-cache))
394
395
396;;; METHODS
397;;
398;; The methods in ede-base handle project related behavior, and DO NOT
399;; related to EDE mode commands directory, such as keybindings.
400;;
401;; Mode related methods are in ede.el. These methods are related
402;; project specific activities not directly tied to a keybinding.
403(defmethod ede-subproject-relative-path ((proj ede-project) &optional parent-in)
404 "Get a path name for PROJ which is relative to the parent project.
405If PARENT is specified, then be relative to the PARENT project.
406Specifying PARENT is useful for sub-sub projects relative to the root project."
407 (let* ((parent (or parent-in (ede-parent-project proj)))
408 (dir (file-name-directory (oref proj file))))
409 (if (and parent (not (eq parent proj)))
410 (file-relative-name dir (file-name-directory (oref parent file)))
411 "")))
412
413(defmethod ede-subproject-p ((proj ede-project))
414 "Return non-nil if PROJ is a sub project."
415 ;; @TODO - Use this in more places, and also pay attention to
416 ;; metasubproject in ede-proj.el
417 (ede-parent-project proj))
418
419
420;;; Default descriptive methods for EDE classes
421;;
422;; These are methods which you might want to override, but there is
423;; no need to in most situations because they are either a) simple, or
424;; b) cosmetic.
425
426(defmethod ede-name ((this ede-target))
427 "Return the name of THIS target."
428 (oref this name))
429
430(defmethod ede-target-name ((this ede-target))
431 "Return the name of THIS target, suitable for make or debug style commands."
432 (oref this name))
433
434(defmethod ede-name ((this ede-project))
435 "Return a short-name for THIS project file.
436Do this by extracting the lowest directory name."
437 (oref this name))
438
439(defmethod ede-description ((this ede-project))
440 "Return a description suitable for the minibuffer about THIS."
441 (format "Project %s: %d subprojects, %d targets."
442 (ede-name this) (length (oref this subproj))
443 (length (oref this targets))))
444
445(defmethod ede-description ((this ede-target))
446 "Return a description suitable for the minibuffer about THIS."
447 (format "Target %s: with %d source files."
448 (ede-name this) (length (oref this source))))
449
450;;; HEADERS/DOC
451;;
452;; Targets and projects are often associated with other files, such as
453;; header files, documentation files and the like. Have strong
454;; associations can make useful user commands to quickly navigate
455;; between the files base on their assocaitions.
456;;
457(defun ede-header-file ()
458 "Return the header file for the current buffer.
459Not all buffers need headers, so return nil if no applicable."
460 (if ede-object
461 (ede-buffer-header-file ede-object (current-buffer))
462 nil))
463
464(defmethod ede-buffer-header-file ((this ede-project) buffer)
465 "Return nil, projects don't have header files."
466 nil)
467
468(defmethod ede-buffer-header-file ((this ede-target) buffer)
469 "There are no default header files in EDE.
470Do a quick check to see if there is a Header tag in this buffer."
471 (with-current-buffer buffer
472 (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t)
473 (buffer-substring-no-properties (match-beginning 1)
474 (match-end 1))
475 (let ((src (ede-target-sourcecode this))
476 (found nil))
477 (while (and src (not found))
478 (setq found (ede-buffer-header-file (car src) (buffer-file-name))
479 src (cdr src)))
480 found))))
481
482(defun ede-documentation-files ()
483 "Return the documentation files for the current buffer.
484Not all buffers need documentations, so return nil if no applicable.
485Some projects may have multiple documentation files, so return a list."
486 (if ede-object
487 (ede-buffer-documentation-files ede-object (current-buffer))
488 nil))
489
490(defmethod ede-buffer-documentation-files ((this ede-project) buffer)
491 "Return all documentation in project THIS based on BUFFER."
492 ;; Find the info node.
493 (ede-documentation this))
494
495(defmethod ede-buffer-documentation-files ((this ede-target) buffer)
496 "Check for some documentation files for THIS.
497Also do a quick check to see if there is a Documentation tag in this BUFFER."
498 (with-current-buffer buffer
499 (if (re-search-forward "::Documentation:: \\([a-zA-Z0-9.]+\\)" nil t)
500 (buffer-substring-no-properties (match-beginning 1)
501 (match-end 1))
502 ;; Check the master project
503 (let ((cp (ede-toplevel)))
504 (ede-buffer-documentation-files cp (current-buffer))))))
505
506(defmethod ede-documentation ((this ede-project))
507 "Return a list of files that provide documentation.
508Documentation is not for object THIS, but is provided by THIS for other
509files in the project."
510 (let ((targ (oref this targets))
511 (proj (oref this subproj))
512 (found nil))
513 (while targ
514 (setq found (append (ede-documentation (car targ)) found)
515 targ (cdr targ)))
516 (while proj
517 (setq found (append (ede-documentation (car proj)) found)
518 proj (cdr proj)))
519 found))
520
521(defmethod ede-documentation ((this ede-target))
522 "Return a list of files that provide documentation.
523Documentation is not for object THIS, but is provided by THIS for other
524files in the project."
525 nil)
526
527(defun ede-html-documentation-files ()
528 "Return a list of HTML documentation files associated with this project."
529 (ede-html-documentation (ede-toplevel))
530 )
531
532(defmethod ede-html-documentation ((this ede-project))
533 "Return a list of HTML files provided by project THIS."
534
535 )
536
537;;; Default "WANT" methods.
538;;
539;; These methods are used to determine if a target "wants", or could
540;; somehow handle a file, or some source type.
541;;
542(defmethod ede-want-file-p ((this ede-target) file)
543 "Return non-nil if THIS target wants FILE."
544 ;; By default, all targets reference the source object, and let it decide.
545 (let ((src (ede-target-sourcecode this)))
546 (while (and src (not (ede-want-file-p (car src) file)))
547 (setq src (cdr src)))
548 src))
549
550(defmethod ede-want-file-source-p ((this ede-target) file)
551 "Return non-nil if THIS target wants FILE."
552 ;; By default, all targets reference the source object, and let it decide.
553 (let ((src (ede-target-sourcecode this)))
554 (while (and src (not (ede-want-file-source-p (car src) file)))
555 (setq src (cdr src)))
556 src))
557
558(defmethod ede-target-sourcecode ((this ede-target))
559 "Return the sourcecode objects which THIS permits."
560 (let ((sc (oref this sourcetype))
561 (rs nil))
562 (while (and (listp sc) sc)
563 (setq rs (cons (symbol-value (car sc)) rs)
564 sc (cdr sc)))
565 rs))
566
567
568;;; Debugging.
569;;
570(defun ede-adebug-project ()
571 "Run adebug against the current EDE project.
572Display the results as a debug list."
573 (interactive)
574 (require 'data-debug)
575 (when (ede-current-project)
576 (data-debug-new-buffer "*Analyzer ADEBUG*")
577 (data-debug-insert-object-slots (ede-current-project) "")
578 ))
579
580(defun ede-adebug-project-parent ()
581 "Run adebug against the current EDE parent project.
582Display the results as a debug list."
583 (interactive)
584 (require 'data-debug)
585 (when (ede-parent-project)
586 (data-debug-new-buffer "*Analyzer ADEBUG*")
587 (data-debug-insert-object-slots (ede-parent-project) "")
588 ))
589
590(defun ede-adebug-project-root ()
591 "Run adebug against the current EDE parent project.
592Display the results as a debug list."
593 (interactive)
594 (require 'data-debug)
595 (when (ede-toplevel)
596 (data-debug-new-buffer "*Analyzer ADEBUG*")
597 (data-debug-insert-object-slots (ede-toplevel) "")
598 ))
599
600
601
602;;; TOPLEVEL PROJECT
603;;
604;; The toplevel project is a way to identify the EDE structure that belongs
605;; to the top of a project.
606
607(defun ede-toplevel (&optional subproj)
608 "Return the ede project which is the root of the current project.
609Optional argument SUBPROJ indicates a subproject to start from
610instead of the current project."
611 (or ede-object-root-project
612 (let* ((cp (or subproj (ede-current-project))))
613 (or (and cp (ede-project-root cp))
614 (progn
615 (while (ede-parent-project cp)
616 (setq cp (ede-parent-project cp)))
617 cp)))))
618
619
620;;; Hooks & Autoloads
621;;
622;; These let us watch various activities, and respond appropriately.
623
624;; (add-hook 'edebug-setup-hook
625;; (lambda ()
626;; (def-edebug-spec ede-with-projectfile
627;; (form def-body))))
628
629(provide 'ede/base)
630
631;; Local variables:
632;; generated-autoload-file: "loaddefs.el"
633;; generated-autoload-load-name: "ede/base"
634;; End:
635
636;;; ede/base.el ends here
diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el
index cae4d090a39..5ef3323cfd5 100644
--- a/lisp/cedet/ede/cpp-root.el
+++ b/lisp/cedet/ede/cpp-root.el
@@ -237,6 +237,18 @@ ROOTPROJ is nil, since there is only one project."
237 ;; Snoop through our master list. 237 ;; Snoop through our master list.
238 (ede-cpp-root-file-existing dir)) 238 (ede-cpp-root-file-existing dir))
239 239
240;;;###autoload
241(add-to-list 'ede-project-class-files
242 (ede-project-autoload "cpp-root"
243 :name "CPP ROOT"
244 :file 'ede-cpp-root
245 :proj-file 'ede-cpp-root-project-file-for-dir
246 :proj-root 'ede-cpp-root-project-root
247 :load-type 'ede-cpp-root-load
248 :class-sym 'ede-cpp-root
249 :new-p nil)
250 t)
251
240;;; CLASSES 252;;; CLASSES
241;; 253;;
242;; EDE sets up projects with two kinds of objects. 254;; EDE sets up projects with two kinds of objects.
@@ -504,6 +516,21 @@ Also set up the lexical preprocessor map."
504 "Get the pre-processor map for project THIS." 516 "Get the pre-processor map for project THIS."
505 (ede-preprocessor-map (ede-target-parent this))) 517 (ede-preprocessor-map (ede-target-parent this)))
506 518
519;;; Quick Hack
520(defun ede-create-lots-of-projects-under-dir (dir projfile &rest attributes)
521 "Create a bunch of projects under directory DIR.
522PROJFILE is a file name sans directory that indicates a subdirectory
523is a project directory.
524Generic ATTRIBUTES, such as :include-path can be added.
525Note: This needs some work."
526 (let ((files (directory-files dir t)))
527 (dolist (F files)
528 (if (file-exists-p (expand-file-name projfile F))
529 `(ede-cpp-root-project (file-name-nondirectory F)
530 :name (file-name-nondirectory F)
531 :file (expand-file-name projfile F)
532 attributes)))))
533
507(provide 'ede/cpp-root) 534(provide 'ede/cpp-root)
508 535
509;; Local variables: 536;; Local variables:
diff --git a/lisp/cedet/ede/custom.el b/lisp/cedet/ede/custom.el
new file mode 100644
index 00000000000..d823e015840
--- /dev/null
+++ b/lisp/cedet/ede/custom.el
@@ -0,0 +1,215 @@
1;;; ede.el --- customization of EDE projects.
2
3;; Copyright (C) 2010 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <zappo@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23;;
24;; Customization commands/hooks for EDE.
25;;
26;; EIEIO supports customizing objects, and EDE uses this to allow
27;; users to change basic settings in their projects.
28;;
29
30;;; Code:
31;;; Customization
32;;
33;; Routines for customizing projects and targets.
34
35(require 'ede)
36(eval-when-compile (require 'eieio-custom))
37
38(defvar eieio-ede-old-variables nil
39 "The old variables for a project.")
40
41;;; Customization Commands
42;;
43;; These commands initialize custoization of EDE control objects.
44
45;;;###autoload
46(defun ede-customize-project ()
47 "Edit fields of the current project through EIEIO & Custom."
48 (interactive)
49 (require 'eieio-custom)
50 (let* ((ov (oref (ede-current-project) local-variables))
51 (cp (ede-current-project)))
52 (ede-customize cp)
53 (make-local-variable 'eieio-ede-old-variables)
54 (setq eieio-ede-old-variables ov)))
55
56;;;###autoload
57(defalias 'customize-project 'ede-customize-project)
58
59;;;###autoload
60(defun ede-customize-current-target()
61 "Edit fields of the current target through EIEIO & Custom."
62 (interactive)
63 (require 'eieio-custom)
64 (if (not (obj-of-class-p ede-object ede-target))
65 (error "Current file is not part of a target"))
66 (ede-customize-target ede-object))
67
68;;;###autoload
69(defalias 'customize-target 'ede-customize-current-target)
70
71(defun ede-customize-target (obj)
72 "Edit fields of the current target through EIEIO & Custom.
73OBJ is the target object to customize."
74 (require 'eieio-custom)
75 (if (and obj (not (obj-of-class-p obj ede-target)))
76 (error "No logical target to customize"))
77 (ede-customize obj))
78
79(defmethod ede-customize ((proj ede-project))
80 "Customize the EDE project PROJ."
81 (eieio-customize-object proj 'default))
82
83(defmethod ede-customize ((target ede-target))
84 "Customize the EDE TARGET."
85 (eieio-customize-object target 'default))
86
87;;; Target Sorting
88;;
89;; Target order can be important, but custom doesn't support a way
90;; to resort items in a list. This function by David Engster allows
91;; targets to be re-arranged.
92
93(defvar ede-project-sort-targets-order nil
94 "Variable for tracking target order in `ede-project-sort-targets'.")
95
96;;;###autoload
97(defun ede-project-sort-targets ()
98 "Create a custom-like buffer for sorting targets of current project."
99 (interactive)
100 (let ((proj (ede-current-project))
101 (count 1)
102 current order)
103 (switch-to-buffer (get-buffer-create "*EDE sort targets*"))
104 (erase-buffer)
105 (setq ede-object-project proj)
106 (widget-create 'push-button
107 :notify (lambda (&rest ignore)
108 (let ((targets (oref ede-object-project targets))
109 cur newtargets)
110 (while (setq cur (pop ede-project-sort-targets-order))
111 (setq newtargets (append newtargets
112 (list (nth cur targets)))))
113 (oset ede-object-project targets newtargets))
114 (ede-commit-project ede-object-project)
115 (kill-buffer))
116 " Accept ")
117 (widget-insert " ")
118 (widget-create 'push-button
119 :notify (lambda (&rest ignore)
120 (kill-buffer))
121 " Cancel ")
122 (widget-insert "\n\n")
123 (setq ede-project-sort-targets-order nil)
124 (mapc (lambda (x)
125 (add-to-ordered-list
126 'ede-project-sort-targets-order
127 x x))
128 (number-sequence 0 (1- (length (oref proj targets)))))
129 (ede-project-sort-targets-list)
130 (use-local-map widget-keymap)
131 (widget-setup)
132 (goto-char (point-min))))
133
134(defun ede-project-sort-targets-list ()
135 "Sort the target list while using `ede-project-sort-targets'."
136 (save-excursion
137 (let ((count 0)
138 (targets (oref ede-object-project targets))
139 (inhibit-read-only t)
140 (inhibit-modification-hooks t))
141 (goto-char (point-min))
142 (forward-line 2)
143 (delete-region (point) (point-max))
144 (while (< count (length targets))
145 (if (> count 0)
146 (widget-create 'push-button
147 :notify `(lambda (&rest ignore)
148 (let ((cur ede-project-sort-targets-order))
149 (add-to-ordered-list
150 'ede-project-sort-targets-order
151 (nth ,count cur)
152 (1- ,count))
153 (add-to-ordered-list
154 'ede-project-sort-targets-order
155 (nth (1- ,count) cur) ,count))
156 (ede-project-sort-targets-list))
157 " Up ")
158 (widget-insert " "))
159 (if (< count (1- (length targets)))
160 (widget-create 'push-button
161 :notify `(lambda (&rest ignore)
162 (let ((cur ede-project-sort-targets-order))
163 (add-to-ordered-list
164 'ede-project-sort-targets-order
165 (nth ,count cur) (1+ ,count))
166 (add-to-ordered-list
167 'ede-project-sort-targets-order
168 (nth (1+ ,count) cur) ,count))
169 (ede-project-sort-targets-list))
170 " Down ")
171 (widget-insert " "))
172 (widget-insert (concat " " (number-to-string (1+ count)) ".: "
173 (oref (nth (nth count ede-project-sort-targets-order)
174 targets) name) "\n"))
175 (setq count (1+ count))))))
176
177;;; Customization hooks
178;;
179;; These hooks are used when finishing up a customization.
180(defmethod eieio-done-customizing ((proj ede-project))
181 "Call this when a user finishes customizing PROJ."
182 (let ((ov eieio-ede-old-variables)
183 (nv (oref proj local-variables)))
184 (setq eieio-ede-old-variables nil)
185 (while ov
186 (if (not (assoc (car (car ov)) nv))
187 (save-excursion
188 (mapc (lambda (b)
189 (set-buffer b)
190 (kill-local-variable (car (car ov))))
191 (ede-project-buffers proj))))
192 (setq ov (cdr ov)))
193 (mapc (lambda (b) (ede-set-project-variables proj b))
194 (ede-project-buffers proj))))
195
196;; These two methods should be implemented by subclasses of
197;; project and targets in order to account for user specified
198;; changes.
199(defmethod eieio-done-customizing ((target ede-target))
200 "Call this when a user finishes customizing TARGET."
201 nil)
202
203(defmethod ede-commit-project ((proj ede-project))
204 "Commit any change to PROJ to its file."
205 nil
206 )
207
208(provide 'ede/custom)
209
210;; Local variables:
211;; generated-autoload-file: "loaddefs.el"
212;; generated-autoload-load-name: "ede/custom"
213;; End:
214
215;;; ede/custom.el ends here
diff --git a/lisp/cedet/ede/dired.el b/lisp/cedet/ede/dired.el
index 82784740615..59644a03ec8 100644
--- a/lisp/cedet/ede/dired.el
+++ b/lisp/cedet/ede/dired.el
@@ -76,11 +76,11 @@ negative, force off."
76 "Add files to Target: ")))) 76 "Add files to Target: "))))
77 (dolist (file (dired-get-marked-files t)) 77 (dolist (file (dired-get-marked-files t))
78 (project-add-file target file) 78 (project-add-file target file)
79 ;; Find the buffer for this files, and set it's ede-object 79 ;; Find the buffer for this files, and set its ede-object
80 (if (get-file-buffer file) 80 (if (get-file-buffer file)
81 (with-current-buffer (get-file-buffer file) 81 (with-current-buffer (get-file-buffer file)
82 (setq ede-object nil) 82 (setq ede-object nil)
83 (setq ede-object (ede-buffer-object (current-buffer))))))) 83 (setq ede-object (ede-buffer-object (current-buffer)))))))
84 84
85(provide 'ede/dired) 85(provide 'ede/dired)
86 86
diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el
index 45cbce27409..7038a78f892 100644
--- a/lisp/cedet/ede/emacs.el
+++ b/lisp/cedet/ede/emacs.el
@@ -133,6 +133,18 @@ ROOTPROJ is nil, since there is only one project."
133 ) 133 )
134 ) 134 )
135 135
136;;;###autoload
137(add-to-list 'ede-project-class-files
138 (ede-project-autoload "emacs"
139 :name "EMACS ROOT"
140 :file 'ede-emacs
141 :proj-file "src/emacs.c"
142 :proj-root 'ede-emacs-project-root
143 :load-type 'ede-emacs-load
144 :class-sym 'ede-emacs-project
145 :new-p nil)
146 t)
147
136(defclass ede-emacs-target-c (ede-target) 148(defclass ede-emacs-target-c (ede-target)
137 () 149 ()
138 "EDE Emacs Project target for C code. 150 "EDE Emacs Project target for C code.
@@ -150,7 +162,7 @@ All directories need at least one target.")
150 162
151(defmethod initialize-instance ((this ede-emacs-project) 163(defmethod initialize-instance ((this ede-emacs-project)
152 &rest fields) 164 &rest fields)
153 "Make sure the :file is fully expanded." 165 "Make sure the targets slot is bound."
154 (call-next-method) 166 (call-next-method)
155 (unless (slot-boundp this 'targets) 167 (unless (slot-boundp this 'targets)
156 (oset this :targets nil))) 168 (oset this :targets nil)))
diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el
index 2f86b766158..87145d8c8a1 100644
--- a/lisp/cedet/ede/files.el
+++ b/lisp/cedet/ede/files.el
@@ -38,6 +38,7 @@
38(declare-function ede-locate-file-in-hash "ede/locate") 38(declare-function ede-locate-file-in-hash "ede/locate")
39(declare-function ede-locate-add-file-to-hash "ede/locate") 39(declare-function ede-locate-add-file-to-hash "ede/locate")
40(declare-function ede-locate-file-in-project "ede/locate") 40(declare-function ede-locate-file-in-project "ede/locate")
41(declare-function ede-locate-flush-hash "ede/locate")
41 42
42(defvar ede--disable-inode nil 43(defvar ede--disable-inode nil
43 "Set to 't' to simulate systems w/out inode support.") 44 "Set to 't' to simulate systems w/out inode support.")
@@ -57,44 +58,29 @@ the current EDE project."
57 (ede-project-root-directory (ede-current-project)))) 58 (ede-project-root-directory (ede-current-project))))
58 (find-file fname))) 59 (find-file fname)))
59 60
61(defun ede-flush-project-hash ()
62 "Flush the file locate hash for the current project."
63 (interactive)
64 (require 'ede/locate)
65 (let* ((loc (ede-get-locator-object (ede-current-project))))
66 (ede-locate-flush-hash loc)))
67
60;;; Placeholders for ROOT directory scanning on base objects 68;;; Placeholders for ROOT directory scanning on base objects
61;; 69;;
62(defmethod ede-project-root ((this ede-project-placeholder)) 70(defmethod ede-project-root ((this ede-project-placeholder))
63 "If a project knows it's root, return it here. 71 "If a project knows its root, return it here.
64Allows for one-project-object-for-a-tree type systems." 72Allows for one-project-object-for-a-tree type systems."
65 (oref this rootproject)) 73 (oref this rootproject))
66 74
67(defmethod ede-project-root-directory ((this ede-project-placeholder) 75(defmethod ede-project-root-directory ((this ede-project-placeholder)
68 &optional file) 76 &optional file)
69 "If a project knows it's root, return it here. 77 "If a project knows its root, return it here.
70Allows for one-project-object-for-a-tree type systems. 78Allows for one-project-object-for-a-tree type systems.
71Optional FILE is the file to test. It is ignored in preference 79Optional FILE is the file to test. It is ignored in preference
72of the anchor file for the project." 80of the anchor file for the project."
73 (file-name-directory (expand-file-name (oref this file)))) 81 (file-name-directory (expand-file-name (oref this file))))
74 82
75 83
76(defmethod ede-project-root ((this ede-project-autoload))
77 "If a project knows it's root, return it here.
78Allows for one-project-object-for-a-tree type systems."
79 nil)
80
81(defmethod ede-project-root-directory ((this ede-project-autoload)
82 &optional file)
83 "If a project knows it's root, return it here.
84Allows for one-project-object-for-a-tree type systems.
85Optional FILE is the file to test. If there is no FILE, use
86the current buffer."
87 (when (not file)
88 (setq file default-directory))
89 (when (slot-boundp this :proj-root)
90 (let ((rootfcn (oref this proj-root)))
91 (when rootfcn
92 (condition-case nil
93 (funcall rootfcn file)
94 (error
95 (funcall rootfcn)))
96 ))))
97
98(defmethod ede--project-inode ((proj ede-project-placeholder)) 84(defmethod ede--project-inode ((proj ede-project-placeholder))
99 "Get the inode of the directory project PROJ is in." 85 "Get the inode of the directory project PROJ is in."
100 (if (slot-boundp proj 'dirinode) 86 (if (slot-boundp proj 'dirinode)
@@ -262,27 +248,30 @@ Do this whenever a new project is created, as opposed to loaded."
262(defun ede-directory-project-p (dir &optional force) 248(defun ede-directory-project-p (dir &optional force)
263 "Return a project description object if DIR has a project. 249 "Return a project description object if DIR has a project.
264Optional argument FORCE means to ignore a hash-hit of 'nomatch. 250Optional argument FORCE means to ignore a hash-hit of 'nomatch.
265This depends on an up to date `ede-project-class-files' variable." 251This depends on an up to date `ede-project-class-files' variable.
266 (let* ((dirtest (expand-file-name dir)) 252Any directory that contains the file .ede-ignore will allways
267 (match (ede-directory-project-from-hash dirtest))) 253return nil."
268 (cond 254 (when (not (file-exists-p (expand-file-name ".ede-ignore" dir)))
269 ((and (eq match 'nomatch) (not force)) 255 (let* ((dirtest (expand-file-name dir))
270 nil) 256 (match (ede-directory-project-from-hash dirtest)))
271 ((and match (not (eq match 'nomatch))) 257 (cond
272 match) 258 ((and (eq match 'nomatch) (not force))
273 (t 259 nil)
274 (let ((types ede-project-class-files) 260 ((and match (not (eq match 'nomatch)))
275 (ret nil)) 261 match)
276 ;; Loop over all types, loading in the first type that we find. 262 (t
277 (while (and types (not ret)) 263 (let ((types ede-project-class-files)
278 (if (ede-dir-to-projectfile (car types) dirtest) 264 (ret nil))
279 (progn 265 ;; Loop over all types, loading in the first type that we find.
280 ;; We found one! Require it now since we will need it. 266 (while (and types (not ret))
281 (require (oref (car types) file)) 267 (if (ede-dir-to-projectfile (car types) dirtest)
282 (setq ret (car types)))) 268 (progn
283 (setq types (cdr types))) 269 ;; We found one! Require it now since we will need it.
284 (ede-directory-project-add-description-to-hash dirtest (or ret 'nomatch)) 270 (require (oref (car types) file))
285 ret))))) 271 (setq ret (car types))))
272 (setq types (cdr types)))
273 (ede-directory-project-add-description-to-hash dirtest (or ret 'nomatch))
274 ret))))))
286 275
287;;; TOPLEVEL 276;;; TOPLEVEL
288;; 277;;
@@ -324,7 +313,7 @@ nil is returned if the current directory is not a part of a project."
324 ;; If PROJ didn't know, or there is no PROJ, then 313 ;; If PROJ didn't know, or there is no PROJ, then
325 314
326 ;; Loop up to the topmost project, and then load that single 315 ;; Loop up to the topmost project, and then load that single
327 ;; project, and it's sub projects. When we are done, identify the 316 ;; project, and its sub projects. When we are done, identify the
328 ;; sub-project object belonging to file. 317 ;; sub-project object belonging to file.
329 (while (and (not ans) newpath proj) 318 (while (and (not ans) newpath proj)
330 (setq toppath newpath 319 (setq toppath newpath
@@ -338,24 +327,6 @@ nil is returned if the current directory is not a part of a project."
338 ) 327 )
339 (or ans toppath)))))) 328 (or ans toppath))))))
340 329
341;;; TOPLEVEL PROJECT
342;;
343;; The toplevel project is a way to identify the EDE structure that belongs
344;; to the top of a project.
345
346(defun ede-toplevel (&optional subproj)
347 "Return the ede project which is the root of the current project.
348Optional argument SUBPROJ indicates a subproject to start from
349instead of the current project."
350 (or ede-object-root-project
351 (let* ((cp (or subproj (ede-current-project)))
352 )
353 (or (and cp (ede-project-root cp))
354 (progn
355 (while (ede-parent-project cp)
356 (setq cp (ede-parent-project cp)))
357 cp)))))
358
359;;; DIRECTORY CONVERSION STUFF 330;;; DIRECTORY CONVERSION STUFF
360;; 331;;
361(defmethod ede-convert-path ((this ede-project) path) 332(defmethod ede-convert-path ((this ede-project) path)
@@ -372,11 +343,13 @@ Argument THIS is the project to convert PATH to."
372 (substring fptf (match-end 0)) 343 (substring fptf (match-end 0))
373 (error "Cannot convert relativize path %s" fp)))))) 344 (error "Cannot convert relativize path %s" fp))))))
374 345
375(defmethod ede-convert-path ((this ede-target) path) 346(defmethod ede-convert-path ((this ede-target) path &optional project)
376 "Convert path in a standard way for a given project. 347 "Convert path in a standard way for a given project.
377Default to making it project relative. 348Default to making it project relative.
378Argument THIS is the project to convert PATH to." 349Argument THIS is the project to convert PATH to.
379 (let ((proj (ede-target-parent this))) 350Optional PROJECT is the project that THIS belongs to. Associating
351a target to a project is expensive, so using this can speed things up."
352 (let ((proj (or project (ede-target-parent this))))
380 (if proj 353 (if proj
381 (let ((p (ede-convert-path proj path)) 354 (let ((p (ede-convert-path proj path))
382 (lp (or (oref this path) ""))) 355 (lp (or (oref this path) "")))
@@ -406,7 +379,8 @@ FILENAME should be just a filename which occurs in a directory controlled
406by this project. 379by this project.
407Optional argument FORCE forces the default filename to be provided even if it 380Optional argument FORCE forces the default filename to be provided even if it
408doesn't exist. 381doesn't exist.
409If FORCE equals 'newfile, then the cache is ignored." 382If FORCE equals 'newfile, then the cache is ignored and a new file in THIS
383is returned."
410 (require 'ede/locate) 384 (require 'ede/locate)
411 (let* ((loc (ede-get-locator-object this)) 385 (let* ((loc (ede-get-locator-object this))
412 (ha (ede-locate-file-in-hash loc filename)) 386 (ha (ede-locate-file-in-hash loc filename))
@@ -467,17 +441,8 @@ doesn't exist."
467 (proj (oref this subproj)) 441 (proj (oref this subproj))
468 (found nil)) 442 (found nil))
469 ;; find it Locally. 443 ;; find it Locally.
470 (setq found 444 (setq found (or (ede-expand-filename-local this filename)
471 (cond ((file-exists-p (expand-file-name filename path)) 445 (ede-expand-filename-impl-via-subproj this filename)))
472 (expand-file-name filename path))
473 ((file-exists-p (expand-file-name (concat "include/" filename) path))
474 (expand-file-name (concat "include/" filename) path))
475 (t
476 (while (and (not found) proj)
477 (setq found (when (car proj)
478 (ede-expand-filename (car proj) filename))
479 proj (cdr proj)))
480 found)))
481 ;; Use an external locate tool. 446 ;; Use an external locate tool.
482 (when (not found) 447 (when (not found)
483 (require 'ede/locate) 448 (require 'ede/locate)
@@ -485,6 +450,30 @@ doesn't exist."
485 ;; Return it 450 ;; Return it
486 found)) 451 found))
487 452
453(defmethod ede-expand-filename-local ((this ede-project) filename)
454 "Expand filename locally to project THIS with filesystem tests."
455 (let ((path (ede-project-root-directory this)))
456 (cond ((file-exists-p (expand-file-name filename path))
457 (expand-file-name filename path))
458 ((file-exists-p (expand-file-name (concat "include/" filename) path))
459 (expand-file-name (concat "include/" filename) path)))))
460
461(defmethod ede-expand-filename-impl-via-subproj ((this ede-project) filename)
462 "Return a fully qualified file name based on project THIS.
463FILENAME should be just a filename which occurs in a directory controlled
464by this project."
465 (let ((proj (list (ede-toplevel this)))
466 (found nil))
467 ;; find it Locally.
468 (while (and (not found) proj)
469 (let ((thisproj (car proj)))
470 (setq proj (append (cdr proj) (oref thisproj subproj)))
471 (setq found (when thisproj
472 (ede-expand-filename-local thisproj filename)))
473 ))
474 ;; Return it
475 found))
476
488(defmethod ede-expand-filename ((this ede-target) filename &optional force) 477(defmethod ede-expand-filename ((this ede-target) filename &optional force)
489 "Return a fully qualified file name based on target THIS. 478 "Return a fully qualified file name based on target THIS.
490FILENAME should be a filename which occurs in a directory in which THIS works. 479FILENAME should be a filename which occurs in a directory in which THIS works.
diff --git a/lisp/cedet/ede/generic.el b/lisp/cedet/ede/generic.el
new file mode 100644
index 00000000000..68517f27b6a
--- /dev/null
+++ b/lisp/cedet/ede/generic.el
@@ -0,0 +1,442 @@
1;;; ede/generic.el --- Base Support for generic build systems
2
3;; Copyright (C) 2010 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23;;
24;; There are a lot of build systems out there, and EDE can't support
25;; them all fully. The ede-generic.el system is the base for
26;; supporting alternate build systems in a simple way, automatically.
27;;
28;; The structure is for the ede-generic baseclass, which is augmented
29;; by simple sub-classes that can be created by users on an as needed
30;; basis. The generic system will have targets for many language
31;; types, and create the targets on an as needed basis. All
32;; sub-project types will recycle the same generic target types.
33;;
34;; The generic target types will only be implemented for languages
35;; where having EDE support actually matters, with a single MISC to
36;; represent anything else.
37;;
38;; TOO MANY PROJECTS DETECTED:
39;;
40;; If enabling ede-generic support starts identifying too many
41;; projects, drop a file called `.ede-ignore' into any directory where
42;; you do not want a project to be.
43;;
44;; Customization:
45;;
46;; Since these projects are all so increadibly generic, a user will
47;; need to configure some aspects of the project by hand. In order to
48;; enable this without configuring the project objects directly (which
49;; are auto-generated) a special ede-generic-confg object is defined to
50;; hold the basics. Generic projects will identify and use these
51;; config files.
52;;
53;; Adding support for new projects:
54;;
55;; To add support to EDE Generic for new project types is very quick.
56;; See the end of this file for examples such as CMake and SCons.
57;;
58;; Support consists of one class for your project, specifying the file
59;; name used by the project system you want to support. It also
60;; should implement th method `ede-generic-setup-configuration' to
61;; prepopulate the configurable portion of the generic project with
62;; build details.
63;;
64;; Lastly, call `ede-generic-new-autoloader' to setup your project so
65;; EDE can use it.
66;;
67;; Adding support for new types of source code:
68;;
69;; Sources of different types are supported with a simple class which
70;; subclasses `ede-generic-target'. The slots `shortname' and
71;; `extension' should be given new initial values.
72;;
73;; Optionally, any target method used by EDE can then be overriden.
74;; The ede-generic-target-c-cpp has some example methods setting up
75;; the pre-processor map and system include path.
76;;
77;; NOTE: It is not necessary to modify ede-generic.el to add any of
78;; the above described support features.
79
80(require 'eieio-opt)
81(require 'ede)
82(require 'semantic/db)
83
84;;; Code:
85;;
86;; Start with the configuration system
87(defclass ede-generic-config (eieio-persistent)
88 ((extension :initform ".ede")
89 (file-header-line :initform ";; EDE Generic Project Configuration")
90 (project :initform nil
91 :documentation
92 "The project this config is bound to.")
93 ;; Generic customizations
94 (build-command :initarg :build-command
95 :initform "make -k"
96 :type string
97 :custom string
98 :group (default build)
99 :documentation
100 "Command used for building this project.")
101 (debug-command :initarg :debug-command
102 :initform "gdb "
103 :type string
104 :custom string
105 :group (default build)
106 :documentation
107 "Command used for debugging this project.")
108 ;; C target customixations
109 (c-include-path :initarg :c-include-path
110 :initform nil
111 :type list
112 :custom (repeat (string :tag "Path"))
113 :group c
114 :documentation
115 "The include path used by C/C++ projects.")
116 (c-preprocessor-table :initarg :c-preprocessor-table
117 :initform nil
118 :type list
119 :custom (repeat (cons (string :tag "Macro")
120 (string :tag "Value")))
121 :group c
122 :documentation
123 "Preprocessor Symbols for this project.")
124 (c-preprocessor-files :initarg :c-preprocessor-files
125 :initform nil
126 :type list
127 :custom (repeat (string :tag "Include File")))
128 )
129 "User Configuration object for a generic project.")
130
131(defun ede-generic-load (dir &optional rootproj)
132 "Return a Generic Project object if there is a match.
133Return nil if there isn't one.
134Argument DIR is the directory it is created for.
135ROOTPROJ is nil, since there is only one project."
136 ;; Doesn't already exist, so lets make one.
137 (let* ((alobj ede-constructing)
138 (this nil))
139 (when (not alobj) (error "Cannot load generic project without the autoload instance"))
140
141 (setq this
142 (funcall (oref alobj class-sym)
143 (symbol-name (oref alobj class-sym))
144 :name (file-name-nondirectory
145 (directory-file-name dir))
146 :version "1.0"
147 :directory (file-name-as-directory dir)
148 :file (expand-file-name (oref alobj :proj-file)) ))
149 (ede-add-project-to-global-list this)
150 ))
151
152;;; Base Classes for the system
153(defclass ede-generic-target (ede-target)
154 ((shortname :initform ""
155 :type string
156 :allocation :class
157 :documentation
158 "Something prepended to the target name.")
159 (extension :initform ""
160 :type string
161 :allocation :class
162 :documentation
163 "Regular expression representing the extension used for this target.
164subclasses of this base target will override the default value.")
165 )
166 "Baseclass for all targets belonging to the generic ede system."
167 :abstract t)
168
169(defclass ede-generic-project (ede-project)
170 ((buildfile :initform ""
171 :type string
172 :allocation :class
173 :documentation "The file name that identifies a project of this type.
174The class allocated value is replace by different sub classes.")
175 (config :initform nil
176 :type (or null ede-generic-config)
177 :documentation
178 "The configuration object for this project.")
179 )
180 "The baseclass for all generic EDE project types."
181 :abstract t)
182
183(defmethod initialize-instance ((this ede-generic-project)
184 &rest fields)
185 "Make sure the targets slot is bound."
186 (call-next-method)
187 (unless (slot-boundp this 'targets)
188 (oset this :targets nil))
189 )
190
191(defmethod ede-generic-get-configuration ((proj ede-generic-project))
192 "Return the configuration for the project PROJ."
193 (let ((config (oref proj config)))
194 (when (not config)
195 (let ((fname (expand-file-name "EDEConfig.el"
196 (oref proj :directory))))
197 (if (file-exists-p fname)
198 ;; Load in the configuration
199 (setq config (eieio-persistent-read fname))
200 ;; Create a new one.
201 (setq config (ede-generic-config
202 "Configuration"
203 :file fname))
204 ;; Set initial values based on project.
205 (ede-generic-setup-configuration proj config))
206 ;; Link things together.
207 (oset proj config config)
208 (oset config project proj)))
209 config))
210
211(defmethod ede-generic-setup-configuration ((proj ede-generic-project) config)
212 "Default configuration setup method."
213 nil)
214
215(defmethod ede-commit-project ((proj ede-generic-project))
216 "Commit any change to PROJ to its file."
217 (let ((config (ede-generic-get-configuration proj)))
218 (ede-commit config)))
219
220;;; A list of different targets
221(defclass ede-generic-target-c-cpp (ede-generic-target)
222 ((shortname :initform "C/C++")
223 (extension :initform "\\([ch]\\(pp\\|xx\\|\\+\\+\\)?\\|cc\\|hh\\|CC?\\)"))
224 "EDE Generic Project target for C and C++ code.
225All directories need at least one target.")
226
227(defclass ede-generic-target-el (ede-generic-target)
228 ((shortname :initform "ELisp")
229 (extension :initform "el"))
230 "EDE Generic Project target for Emacs Lisp code.
231All directories need at least one target.")
232
233(defclass ede-generic-target-fortran (ede-generic-target)
234 ((shortname :initform "Fortran")
235 (extension :initform "[fF]9[05]\\|[fF]\\|for"))
236 "EDE Generic Project target for Fortran code.
237All directories need at least one target.")
238
239(defclass ede-generic-target-texi (ede-generic-target)
240 ((shortname :initform "Texinfo")
241 (extension :initform "texi"))
242 "EDE Generic Project target for texinfo code.
243All directories need at least one target.")
244
245;; MISC must always be last since it will always match the file.
246(defclass ede-generic-target-misc (ede-generic-target)
247 ((shortname :initform "Misc")
248 (extension :initform ""))
249 "EDE Generic Project target for Misc files.
250All directories need at least one target.")
251
252;;; Automatic target aquisition.
253(defun ede-generic-find-matching-target (class dir targets)
254 "Find a target that is a CLASS and is in DIR in the list of TARGETS."
255 (let ((match nil))
256 (dolist (T targets)
257 (when (and (object-of-class-p T class)
258 (string= (oref T :path) dir))
259 (setq match T)
260 ))
261 match))
262
263(defmethod ede-find-target ((proj ede-generic-project) buffer)
264 "Find an EDE target in PROJ for BUFFER.
265If one doesn't exist, create a new one for this directory."
266 (let* ((ext (file-name-extension (buffer-file-name buffer)))
267 (classes (eieio-build-class-alist 'ede-generic-target t))
268 (cls nil)
269 (targets (oref proj targets))
270 (dir default-directory)
271 (ans nil)
272 )
273 ;; Pick a matching class type.
274 (when ext
275 (dolist (C classes)
276 (let* ((classsym (intern (car C)))
277 (extreg (oref classsym extension)))
278 (when (and (not (string= extreg ""))
279 (string-match (concat "^" extreg "$") ext))
280 (setq cls classsym)))))
281 (when (not cls) (setq cls 'ede-generic-target-misc))
282 ;; find a pre-existing matching target
283 (setq ans (ede-generic-find-matching-target cls dir targets))
284 ;; Create a new instance if there wasn't one
285 (when (not ans)
286 (setq ans (make-instance
287 cls
288 :name (oref cls shortname)
289 :path dir
290 :source nil))
291 (object-add-to-list proj :targets ans)
292 )
293 ans))
294
295;;; C/C++ support
296(defmethod ede-preprocessor-map ((this ede-generic-target-c-cpp))
297 "Get the pre-processor map for some generic C code."
298 (let* ((proj (ede-target-parent this))
299 (root (ede-project-root proj))
300 (config (ede-generic-get-configuration proj))
301 filemap
302 )
303 ;; Preprocessor files
304 (dolist (G (oref config :c-preprocessor-files))
305 (let ((table (semanticdb-file-table-object
306 (ede-expand-filename root G))))
307 (when table
308 (when (semanticdb-needs-refresh-p table)
309 (semanticdb-refresh-table table))
310 (setq filemap (append filemap (oref table lexical-table)))
311 )))
312 ;; The core table
313 (setq filemap (append filemap (oref config :c-preprocessor-table)))
314
315 filemap
316 ))
317
318(defmethod ede-system-include-path ((this ede-generic-target-c-cpp))
319 "Get the system include path used by project THIS."
320 (let* ((proj (ede-target-parent this))
321 (config (ede-generic-get-configuration proj)))
322 (oref config c-include-path)))
323
324;;; Customization
325;;
326(defmethod ede-customize ((proj ede-generic-project))
327 "Customize the EDE project PROJ."
328 (let ((config (ede-generic-get-configuration proj)))
329 (eieio-customize-object config)))
330
331(defmethod ede-customize ((target ede-generic-target))
332 "Customize the EDE TARGET."
333 ;; Nothing unique for the targets, use the project.
334 (ede-customize-project))
335
336(defmethod eieio-done-customizing ((config ede-generic-config))
337 "Called when EIEIO is done customizing the configuration object.
338We need to go back through the old buffers, and update them with
339the new configuration."
340 (ede-commit config)
341 ;; Loop over all the open buffers, and re-apply.
342 (ede-map-targets
343 (oref config project)
344 (lambda (target)
345 (ede-map-target-buffers
346 target
347 (lambda (b)
348 (with-current-buffer b
349 (ede-apply-target-options)))))))
350
351(defmethod ede-commit ((config ede-generic-config))
352 "Commit all changes to the configuration to disk."
353 (eieio-persistent-save config))
354
355;;; Creating Derived Projects:
356;;
357;; Derived projects need an autoloader so that EDE can find the
358;; different projects on disk.
359(defun ede-generic-new-autoloader (internal-name external-name
360 projectfile class)
361 "Add a new EDE Autoload instance for identifying a generic project.
362INTERNAL-NAME is a long name that identifies thsi project type.
363EXTERNAL-NAME is a shorter human readable name to describe the project.
364PROJECTFILE is a file name that identifies a project of this type to EDE, such as
365a Makefile, or SConstruct file.
366CLASS is the EIEIO class that is used to track this project. It should subclass
367the class `ede-generic-project' project."
368 (add-to-list 'ede-project-class-files
369 (ede-project-autoload internal-name
370 :name external-name
371 :file 'ede-generic
372 :proj-file projectfile
373 :load-type 'ede-generic-load
374 :class-sym class
375 :new-p nil)
376 ;; Generics must go at the end, since more specific types
377 ;; can create Makefiles also.
378 t))
379
380;;;###autoload
381(defun ede-enable-generic-projects ()
382 "Enable generic project loaders."
383 (interactive)
384 (ede-generic-new-autoloader "edeproject-makefile" "Make"
385 "Makefile" 'ede-generic-makefile-project)
386 (ede-generic-new-autoloader "edeproject-scons" "SCons"
387 "SConstruct" 'ede-generic-scons-project)
388 (ede-generic-new-autoloader "edeproject-cmake" "CMake"
389 "CMakeLists" 'ede-generic-cmake-project)
390 )
391
392
393;;; SPECIFIC TYPES OF GENERIC BUILDS
394;;
395
396;;; MAKEFILE
397
398(defclass ede-generic-makefile-project (ede-generic-project)
399 ((buildfile :initform "Makefile")
400 )
401 "Generic Project for makefiles.")
402
403(defmethod ede-generic-setup-configuration ((proj ede-generic-makefile-project) config)
404 "Setup a configuration for Make."
405 (oset config build-command "make -k")
406 (oset config debug-command "gdb ")
407 )
408
409
410;;; SCONS
411(defclass ede-generic-scons-project (ede-generic-project)
412 ((buildfile :initform "SConstruct")
413 )
414 "Generic Project for scons.")
415
416(defmethod ede-generic-setup-configuration ((proj ede-generic-scons-project) config)
417 "Setup a configuration for SCONS."
418 (oset config build-command "scons")
419 (oset config debug-command "gdb ")
420 )
421
422
423;;; CMAKE
424(defclass ede-generic-cmake-project (ede-generic-project)
425 ((buildfile :initform "CMakeLists")
426 )
427 "Generic Project for cmake.")
428
429(defmethod ede-generic-setup-configuration ((proj ede-generic-cmake-project) config)
430 "Setup a configuration for CMake."
431 (oset config build-command "cmake")
432 (oset config debug-command "gdb ")
433 )
434
435(provide 'ede/generic)
436
437;; Local variables:
438;; generated-autoload-file: "loaddefs.el"
439;; generated-autoload-load-name: "ede/generic"
440;; End:
441
442;;; ede/generic.el ends here
diff --git a/lisp/cedet/ede/linux.el b/lisp/cedet/ede/linux.el
index 451c1ea5212..456a0e552d9 100644
--- a/lisp/cedet/ede/linux.el
+++ b/lisp/cedet/ede/linux.el
@@ -112,6 +112,18 @@ ROOTPROJ is nil, since there is only one project."
112 ) 112 )
113 ) 113 )
114 114
115;;;###autoload
116(add-to-list 'ede-project-class-files
117 (ede-project-autoload "linux"
118 :name "LINUX ROOT"
119 :file 'ede-linux
120 :proj-file "scripts/ver_linux"
121 :proj-root 'ede-linux-project-root
122 :load-type 'ede-linux-load
123 :class-sym 'ede-linux-project
124 :new-p nil)
125 t)
126
115(defclass ede-linux-target-c (ede-target) 127(defclass ede-linux-target-c (ede-target)
116 () 128 ()
117 "EDE Linux Project target for C code. 129 "EDE Linux Project target for C code.
@@ -124,7 +136,7 @@ All directories need at least one target.")
124 136
125(defmethod initialize-instance ((this ede-linux-project) 137(defmethod initialize-instance ((this ede-linux-project)
126 &rest fields) 138 &rest fields)
127 "Make sure the :file is fully expanded." 139 "Make sure the targets slot is bound."
128 (call-next-method) 140 (call-next-method)
129 (unless (slot-boundp this 'targets) 141 (unless (slot-boundp this 'targets)
130 (oset this :targets nil))) 142 (oset this :targets nil)))
diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el
index 099e193f010..c2ca81c668b 100644
--- a/lisp/cedet/ede/locate.el
+++ b/lisp/cedet/ede/locate.el
@@ -121,7 +121,7 @@ based on `ede-locate-setup-options'."
121 ;; Basic setup. 121 ;; Basic setup.
122 (call-next-method) 122 (call-next-method)
123 ;; Make sure we have a hash table. 123 ;; Make sure we have a hash table.
124 (oset loc hash (make-hash-table :test 'equal)) 124 (ede-locate-flush-hash loc)
125 ) 125 )
126 126
127(defmethod ede-locate-ok-in-project :static ((loc ede-locate-base) 127(defmethod ede-locate-ok-in-project :static ((loc ede-locate-base)
@@ -129,6 +129,10 @@ based on `ede-locate-setup-options'."
129 "Is it ok to use this project type under ROOT." 129 "Is it ok to use this project type under ROOT."
130 t) 130 t)
131 131
132(defmethod ede-locate-flush-hash ((loc ede-locate-base))
133 "For LOC, flush hashtable and start from scratch."
134 (oset loc hash (make-hash-table :test 'equal)))
135
132(defmethod ede-locate-file-in-hash ((loc ede-locate-base) 136(defmethod ede-locate-file-in-hash ((loc ede-locate-base)
133 filestring) 137 filestring)
134 "For LOC, is the file FILESTRING in our hashtable?" 138 "For LOC, is the file FILESTRING in our hashtable?"
@@ -160,6 +164,13 @@ that created this EDE locate object."
160 nil 164 nil
161 ) 165 )
162 166
167(defmethod ede-locate-create/update-root-database :STATIC
168 ((loc ede-locate-base) root)
169 "Create or update the database for the current project.
170You cannot create projects for the baseclass."
171 (error "Cannot create/update a database of type %S"
172 (object-name loc)))
173
163;;; LOCATE 174;;; LOCATE
164;; 175;;
165;; Using the standard unix "locate" command. 176;; Using the standard unix "locate" command.
@@ -242,6 +253,11 @@ that created this EDE locate object."
242 (let ((default-directory (oref loc root))) 253 (let ((default-directory (oref loc root)))
243 (cedet-gnu-global-expand-filename filesubstring))) 254 (cedet-gnu-global-expand-filename filesubstring)))
244 255
256(defmethod ede-locate-create/update-root-database :STATIC
257 ((loc ede-locate-global) root)
258 "Create or update the GNU Global database for the current project."
259 (cedet-gnu-global-create/update-database root))
260
245;;; IDUTILS 261;;; IDUTILS
246;; 262;;
247(defclass ede-locate-idutils (ede-locate-base) 263(defclass ede-locate-idutils (ede-locate-base)
@@ -280,6 +296,11 @@ that created this EDE locate object."
280 (let ((default-directory (oref loc root))) 296 (let ((default-directory (oref loc root)))
281 (cedet-idutils-expand-filename filesubstring))) 297 (cedet-idutils-expand-filename filesubstring)))
282 298
299(defmethod ede-locate-create/update-root-database :STATIC
300 ((loc ede-locate-idutils) root)
301 "Create or update the GNU Global database for the current project."
302 (cedet-idutils-create/update-database root))
303
283;;; CSCOPE 304;;; CSCOPE
284;; 305;;
285(defclass ede-locate-cscope (ede-locate-base) 306(defclass ede-locate-cscope (ede-locate-base)
@@ -315,6 +336,11 @@ that created this EDE locate object."
315 (let ((default-directory (oref loc root))) 336 (let ((default-directory (oref loc root)))
316 (cedet-cscope-expand-filename filesubstring))) 337 (cedet-cscope-expand-filename filesubstring)))
317 338
339(defmethod ede-locate-create/update-root-database :STATIC
340 ((loc ede-locate-cscope) root)
341 "Create or update the GNU Global database for the current project."
342 (cedet-cscope-create/update-database root))
343
318(provide 'ede/locate) 344(provide 'ede/locate)
319 345
320;; Local variables: 346;; Local variables:
diff --git a/lisp/cedet/ede/pconf.el b/lisp/cedet/ede/pconf.el
index f9a1fb44f15..0983aeb16b8 100644
--- a/lisp/cedet/ede/pconf.el
+++ b/lisp/cedet/ede/pconf.el
@@ -126,7 +126,11 @@ don't do it. A value of nil means to just do it.")
126 126
127 (while compilation-in-progress 127 (while compilation-in-progress
128 (accept-process-output) 128 (accept-process-output)
129 (sit-for 1)) 129 ;; If sit for indicates that input is waiting, then
130 ;; read and discard whatever it is that is going on.
131 (when (not (sit-for 1))
132 (read-event nil nil .1)
133 ))
130 134
131 (with-current-buffer "*compilation*" 135 (with-current-buffer "*compilation*"
132 (goto-char (point-max)) 136 (goto-char (point-max))
diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el
index 19c4b26edcd..94874d031b7 100644
--- a/lisp/cedet/ede/pmake.el
+++ b/lisp/cedet/ede/pmake.el
@@ -262,6 +262,18 @@ Execute BODY in a location where a value can be placed."
262 (goto-char (point-max)))) 262 (goto-char (point-max))))
263(put 'ede-pmake-insert-variable-shared 'lisp-indent-function 1) 263(put 'ede-pmake-insert-variable-shared 'lisp-indent-function 1)
264 264
265(defmacro ede-pmake-insert-variable-once (varname &rest body)
266 "Add VARNAME into the current Makefile if it doesn't exist.
267Execute BODY in a location where a value can be placed."
268 `(let ((addcr t) (v ,varname))
269 (unless (re-search-backward (concat "^" v "\\s-*=") nil t)
270 (insert v "=")
271 ,@body
272 (if addcr (insert "\n"))
273 (goto-char (point-max)))
274 ))
275(put 'ede-pmake-insert-variable-once 'lisp-indent-function 1)
276
265;;; SOURCE VARIABLE NAME CONSTRUCTION 277;;; SOURCE VARIABLE NAME CONSTRUCTION
266 278
267(defsubst ede-pmake-varname (obj) 279(defsubst ede-pmake-varname (obj)
@@ -369,10 +381,14 @@ NOTE: Not yet in use! This is part of an SRecode conversion of
369 conf-table)) 381 conf-table))
370 (let* ((top "") 382 (let* ((top "")
371 (tmp this)) 383 (tmp this))
384 ;; Use relative paths for subdirs.
372 (while (ede-parent-project tmp) 385 (while (ede-parent-project tmp)
373 (setq tmp (ede-parent-project tmp) 386 (setq tmp (ede-parent-project tmp)
374 top (concat "../" top))) 387 top (concat "../" top)))
375 (insert "\ntop=" top)) 388 ;; If this is the top, then use CURDIR.
389 (if (and (not (oref this metasubproject)) (string= top ""))
390 (insert "\ntop=\"$(CURDIR)\"/")
391 (insert "\ntop=" top)))
376 (insert "\nede_FILES=" (file-name-nondirectory (oref this file)) " " 392 (insert "\nede_FILES=" (file-name-nondirectory (oref this file)) " "
377 (file-name-nondirectory (ede-proj-dist-makefile this)) "\n")) 393 (file-name-nondirectory (ede-proj-dist-makefile this)) "\n"))
378 394
@@ -425,14 +441,13 @@ sources variable."
425 (link (ede-proj-linkers this)) 441 (link (ede-proj-linkers this))
426 (name (ede-proj-makefile-target-name this)) 442 (name (ede-proj-makefile-target-name this))
427 (src (oref this source))) 443 (src (oref this source)))
444 (ede-proj-makefile-insert-object-variables (car comp) name src)
428 (dolist (obj comp) 445 (dolist (obj comp)
429 (ede-compiler-only-once obj 446 (ede-compiler-only-once obj
430 (ede-proj-makefile-insert-variables obj))) 447 (ede-proj-makefile-insert-variables obj)))
431 (ede-proj-makefile-insert-object-variables (car comp) name src) 448 (dolist (linker link)
432 (while link 449 (ede-linker-only-once linker
433 (ede-linker-only-once (car link) 450 (ede-proj-makefile-insert-variables linker)))))
434 (ede-proj-makefile-insert-variables (car link)))
435 (setq link (cdr link)))))
436 451
437(defmethod ede-proj-makefile-insert-automake-pre-variables 452(defmethod ede-proj-makefile-insert-automake-pre-variables
438 ((this ede-proj-target)) 453 ((this ede-proj-target))
diff --git a/lisp/cedet/ede/proj-archive.el b/lisp/cedet/ede/proj-archive.el
index 3057f967b0f..2d4620ea47c 100644
--- a/lisp/cedet/ede/proj-archive.el
+++ b/lisp/cedet/ede/proj-archive.el
@@ -29,7 +29,7 @@
29 29
30(defclass ede-proj-target-makefile-archive 30(defclass ede-proj-target-makefile-archive
31 (ede-proj-target-makefile-objectcode) 31 (ede-proj-target-makefile-objectcode)
32 ((availablelinkers :initform (ede-archive-linker))) 32 ((availablelinkers :initform '(ede-archive-linker)))
33 "This target generates an object code archive.") 33 "This target generates an object code archive.")
34 34
35(defvar ede-archive-linker 35(defvar ede-archive-linker
diff --git a/lisp/cedet/ede/proj-aux.el b/lisp/cedet/ede/proj-aux.el
index 26bc9540e82..4f00d6ea60b 100644
--- a/lisp/cedet/ede/proj-aux.el
+++ b/lisp/cedet/ede/proj-aux.el
@@ -29,7 +29,7 @@
29 29
30;;; Code: 30;;; Code:
31(defclass ede-proj-target-aux (ede-proj-target) 31(defclass ede-proj-target-aux (ede-proj-target)
32 ((sourcetype :initform (ede-aux-source))) 32 ((sourcetype :initform '(ede-aux-source)))
33 "This target consists of aux files such as READMEs and COPYING.") 33 "This target consists of aux files such as READMEs and COPYING.")
34 34
35(defvar ede-aux-source 35(defvar ede-aux-source
diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el
index ecdefb2a522..879f36ff4e2 100644
--- a/lisp/cedet/ede/proj-elisp.el
+++ b/lisp/cedet/ede/proj-elisp.el
@@ -36,8 +36,8 @@
36 ((menu :initform nil) 36 ((menu :initform nil)
37 (keybindings :initform nil) 37 (keybindings :initform nil)
38 (phony :initform t) 38 (phony :initform t)
39 (sourcetype :initform (ede-source-emacs)) 39 (sourcetype :initform '(ede-source-emacs))
40 (availablecompilers :initform (ede-emacs-compiler ede-xemacs-compiler)) 40 (availablecompilers :initform '(ede-emacs-compiler ede-xemacs-compiler))
41 (aux-packages :initarg :aux-packages 41 (aux-packages :initarg :aux-packages
42 :initform nil 42 :initform nil
43 :type list 43 :type list
@@ -259,7 +259,7 @@ is found, such as a `-version' variable, or the standard header."
259;; Autoload generators 259;; Autoload generators
260;; 260;;
261(defclass ede-proj-target-elisp-autoloads (ede-proj-target-elisp) 261(defclass ede-proj-target-elisp-autoloads (ede-proj-target-elisp)
262 ((availablecompilers :initform (ede-emacs-cedet-autogen-compiler)) 262 ((availablecompilers :initform '(ede-emacs-cedet-autogen-compiler))
263 (aux-packages :initform ("cedet-autogen")) 263 (aux-packages :initform ("cedet-autogen"))
264 (phony :initform t) 264 (phony :initform t)
265 (autoload-file :initarg :autoload-file 265 (autoload-file :initarg :autoload-file
diff --git a/lisp/cedet/ede/proj-info.el b/lisp/cedet/ede/proj-info.el
index 667d6d0bff9..1e9060fe315 100644
--- a/lisp/cedet/ede/proj-info.el
+++ b/lisp/cedet/ede/proj-info.el
@@ -31,9 +31,9 @@
31(defclass ede-proj-target-makefile-info (ede-proj-target-makefile) 31(defclass ede-proj-target-makefile-info (ede-proj-target-makefile)
32 ((menu :initform nil) 32 ((menu :initform nil)
33 (keybindings :initform nil) 33 (keybindings :initform nil)
34 (availablecompilers :initform (ede-makeinfo-compiler 34 (availablecompilers :initform '(ede-makeinfo-compiler
35 ede-texi2html-compiler)) 35 ede-texi2html-compiler))
36 (sourcetype :initform (ede-makeinfo-source)) 36 (sourcetype :initform '(ede-makeinfo-source))
37 (mainmenu :initarg :mainmenu 37 (mainmenu :initarg :mainmenu
38 :initform "" 38 :initform ""
39 :type string 39 :type string
diff --git a/lisp/cedet/ede/proj-misc.el b/lisp/cedet/ede/proj-misc.el
index 9c25dafe102..34a10859fdd 100644
--- a/lisp/cedet/ede/proj-misc.el
+++ b/lisp/cedet/ede/proj-misc.el
@@ -35,8 +35,8 @@
35 35
36;; FIXME this isn't how you spell "miscellaneous". :( 36;; FIXME this isn't how you spell "miscellaneous". :(
37(defclass ede-proj-target-makefile-miscelaneous (ede-proj-target-makefile) 37(defclass ede-proj-target-makefile-miscelaneous (ede-proj-target-makefile)
38 ((sourcetype :initform (ede-misc-source)) 38 ((sourcetype :initform '(ede-misc-source))
39 (availablecompilers :initform (ede-misc-compile)) 39 (availablecompilers :initform '(ede-misc-compile))
40 (submakefile :initarg :submakefile 40 (submakefile :initarg :submakefile
41 :initform "" 41 :initform ""
42 :type string 42 :type string
diff --git a/lisp/cedet/ede/proj-obj.el b/lisp/cedet/ede/proj-obj.el
index 241ace2f167..6be76f1f11b 100644
--- a/lisp/cedet/ede/proj-obj.el
+++ b/lisp/cedet/ede/proj-obj.el
@@ -39,28 +39,32 @@
39 (configuration-variables :initform ("debug" . (("CFLAGS" . "-g") 39 (configuration-variables :initform ("debug" . (("CFLAGS" . "-g")
40 ("LDFLAGS" . "-g")))) 40 ("LDFLAGS" . "-g"))))
41 ;; @TODO - add an include path. 41 ;; @TODO - add an include path.
42 (availablecompilers :initform (ede-gcc-compiler 42 (availablecompilers :initform '(ede-gcc-compiler
43 ede-g++-compiler 43 ede-g++-compiler
44 ede-gfortran-compiler 44 ede-gfortran-compiler
45 ede-gfortran-module-compiler 45 ede-gfortran-module-compiler
46 ;; More C and C++ compilers, plus 46 ede-lex-compiler
47 ;; fortran or pascal can be added here 47 ede-yacc-compiler
48 )) 48 ;; More C and C++ compilers, plus
49 (availablelinkers :initform (ede-g++-linker 49 ;; fortran or pascal can be added here
50 ede-cc-linker 50 ))
51 ede-gfortran-linker 51 (availablelinkers :initform '(ede-g++-linker
52 ede-ld-linker 52 ede-cc-linker
53 ;; Add more linker thingies here. 53 ede-ld-linker
54 )) 54 ede-gfortran-linker
55 (sourcetype :initform (ede-source-c 55 ;; Add more linker thingies here.
56 ede-source-c++ 56 ))
57 ede-source-f77 57 (sourcetype :initform '(ede-source-c
58 ede-source-f90 58 ede-source-c++
59 ;; ede-source-other 59 ede-source-f77
60 ;; This object should take everything that 60 ede-source-f90
61 ;; gets compiled into objects like fortran 61 ede-source-lex
62 ;; and pascal. 62 ede-source-yacc
63 )) 63 ;; ede-source-other
64 ;; This object should take everything that
65 ;; gets compiled into objects like fortran
66 ;; and pascal.
67 ))
64 ) 68 )
65 "Abstract class for Makefile based object code generating targets. 69 "Abstract class for Makefile based object code generating targets.
66Belonging to this group assumes you could make a .o from an element source 70Belonging to this group assumes you could make a .o from an element source
@@ -115,15 +119,15 @@ file.")
115 :name "cc" 119 :name "cc"
116 :sourcetype '(ede-source-c) 120 :sourcetype '(ede-source-c)
117 :variables '(("C_LINK" . "$(CC) $(CFLAGS) $(LDFLAGS) -L.")) 121 :variables '(("C_LINK" . "$(CC) $(CFLAGS) $(LDFLAGS) -L."))
118 :commands '("$(C_LINK) -o $@ $^") 122 :commands '("$(C_LINK) -o $@ $^ $(LDDEPS)")
119 :objectextention "") 123 :objectextention "")
120 "Linker for C sourcecode.") 124 "Linker for C sourcecode.")
121 125
122(defvar ede-source-c++ 126(defvar ede-source-c++
123 (ede-sourcecode "ede-source-c++" 127 (ede-sourcecode "ede-source-c++"
124 :name "C++" 128 :name "C++"
125 :sourcepattern "\\.\\(cpp\\|cc\\|cxx\\)$" 129 :sourcepattern "\\.\\(c\\(pp?\\|c\\|xx\\|++\\)\\|C\\\(PP\\)?\\)$"
126 :auxsourcepattern "\\.\\(hpp\\|hh?\\|hxx\\)$" 130 :auxsourcepattern "\\.\\(hpp?\\|hh?\\|hxx\\|H\\)$"
127 :garbagepattern '("*.o" "*.obj" ".deps/*.P" ".lo")) 131 :garbagepattern '("*.o" "*.obj" ".deps/*.P" ".lo"))
128 "C++ source code definition.") 132 "C++ source code definition.")
129 133
@@ -158,11 +162,43 @@ file.")
158 ;; Only use this linker when c++ exists. 162 ;; Only use this linker when c++ exists.
159 :sourcetype '(ede-source-c++) 163 :sourcetype '(ede-source-c++)
160 :variables '(("CXX_LINK" . "$(CXX) $(CFLAGS) $(LDFLAGS) -L.")) 164 :variables '(("CXX_LINK" . "$(CXX) $(CFLAGS) $(LDFLAGS) -L."))
161 :commands '("$(CXX_LINK) -o $@ $^") 165 :commands '("$(CXX_LINK) -o $@ $^ $(LDDEPS)")
162 :autoconf '("AC_PROG_CXX") 166 :autoconf '("AC_PROG_CXX")
163 :objectextention "") 167 :objectextention "")
164 "Linker needed for c++ programs.") 168 "Linker needed for c++ programs.")
165 169
170;;; LEX
171(defvar ede-source-lex
172 (ede-sourcecode "ede-source-lex"
173 :name "lex"
174 :sourcepattern "\\.l\\(l\\|pp\\|++\\)")
175 "Lex source code definition.
176No garbage pattern since it creates C or C++ code.")
177
178(defvar ede-lex-compiler
179 (ede-object-compiler
180 "ede-lex-compiler"
181 ;; Can we support regular makefiles too??
182 :autoconf '("AC_PROG_LEX")
183 :sourcetype '(ede-source-lex))
184 "Compiler used for Lexical source.")
185
186;;; YACC
187(defvar ede-source-yacc
188 (ede-sourcecode "ede-source-yacc"
189 :name "yacc"
190 :sourcepattern "\\.y\\(y\\|pp\\|++\\)")
191 "Yacc source code definition.
192No garbage pattern since it creates C or C++ code.")
193
194(defvar ede-yacc-compiler
195 (ede-object-compiler
196 "ede-yacc-compiler"
197 ;; Can we support regular makefiles too??
198 :autoconf '("AC_PROG_YACC")
199 :sourcetype '(ede-source-yacc))
200 "Compiler used for yacc/bison grammar files source.")
201
166;;; Fortran Compiler/Linker 202;;; Fortran Compiler/Linker
167;; 203;;
168;; Contributed by David Engster 204;; Contributed by David Engster
@@ -233,7 +269,7 @@ file.")
233 :name "ld" 269 :name "ld"
234 :variables '(("LD" . "ld") 270 :variables '(("LD" . "ld")
235 ("LD_LINK" . "$(LD) $(LDFLAGS) -L.")) 271 ("LD_LINK" . "$(LD) $(LDFLAGS) -L."))
236 :commands '("$(LD_LINK) -o $@ $^") 272 :commands '("$(LD_LINK) -o $@ $^ $(LDDEPS)")
237 :objectextention "") 273 :objectextention "")
238 "Linker needed for c++ programs.") 274 "Linker needed for c++ programs.")
239 275
diff --git a/lisp/cedet/ede/proj-prog.el b/lisp/cedet/ede/proj-prog.el
index 2c0237e41c2..9b06dc007b3 100644
--- a/lisp/cedet/ede/proj-prog.el
+++ b/lisp/cedet/ede/proj-prog.el
@@ -34,14 +34,14 @@
34;;; Code: 34;;; Code:
35(defclass ede-proj-target-makefile-program 35(defclass ede-proj-target-makefile-program
36 (ede-proj-target-makefile-objectcode) 36 (ede-proj-target-makefile-objectcode)
37 ((ldlibs :initarg :ldlibs 37 ((ldlibs-local :initarg :ldlibs-local
38 :initform nil 38 :initform nil
39 :type list 39 :type list
40 :custom (repeat (string :tag "Library")) 40 :custom (repeat (string :tag "Local Library"))
41 :documentation 41 :documentation
42 "Libraries, such as \"m\" or \"Xt\" which this program depends on. 42 "Libraries that are part of this project.
43The linker flag \"-l\" is automatically prepended. Do not include a \"lib\" 43The full path to these libraries should be specified, such as:
44prefix, or a \".so\" suffix. 44../lib/libMylib.la or ../ar/myArchive.a
45 45
46Note: Currently only used for Automake projects." 46Note: Currently only used for Automake projects."
47 ) 47 )
@@ -51,10 +51,21 @@ Note: Currently only used for Automake projects."
51 :custom (repeat (string :tag "Link Flag")) 51 :custom (repeat (string :tag "Link Flag"))
52 :documentation 52 :documentation
53 "Additional flags to add when linking this target. 53 "Additional flags to add when linking this target.
54Use ldlibs to add addition libraries. Use this to specify specific 54Use this to specify specific options to the linker.
55options to the linker. 55A Common use may be to add -L to specify in-project locations of libraries
56specified with ldlibs.")
57 (ldlibs :initarg :ldlibs
58 :initform nil
59 :type list
60 :custom (repeat (string :tag "Library"))
61 :documentation
62 "Libraries, such as \"m\" or \"Xt\" which this program depends on.
63The linker flag \"-l\" is automatically prepended. Do not include a \"lib\"
64prefix, or a \".so\" suffix.
65Use the 'ldflags' slot to specify where in-project libraries might be.
56 66
57Note: Not currently used. This bug needs to be fixed.") 67Note: Currently only used for Automake projects."
68 )
58 ) 69 )
59 "This target is an executable program.") 70 "This target is an executable program.")
60 71
@@ -70,27 +81,24 @@ Note: Not currently used. This bug needs to be fixed.")
70 "Insert bin_PROGRAMS variables needed by target THIS." 81 "Insert bin_PROGRAMS variables needed by target THIS."
71 (ede-pmake-insert-variable-shared 82 (ede-pmake-insert-variable-shared
72 (concat (ede-name this) "_LDADD") 83 (concat (ede-name this) "_LDADD")
73 (mapc (lambda (c) (insert " -l" c)) (oref this ldlibs))) 84 (mapc (lambda (l) (insert " " l)) (oref this ldlibs-local))
74 ;; For other targets THIS depends on 85 (mapc (lambda (c) (insert " " c)) (oref this ldflags))
75 ;; 86 (when (oref this ldlibs)
76 ;; NOTE: FIX THIS 87 (mapc (lambda (d) (insert " -l" d)) (oref this ldlibs)))
77 ;; 88 )
78 ;;(ede-pmake-insert-variable-shared
79 ;; (concat (ede-name this) "_DEPENDENCIES")
80 ;; (mapcar (lambda (d) (insert d)) (oref this FOOOOOOOO)))
81 (call-next-method)) 89 (call-next-method))
82 90
83(defmethod ede-proj-makefile-insert-rules ((this ede-proj-target-makefile-program)) 91(defmethod ede-proj-makefile-insert-variables ((this ede-proj-target-makefile-program))
84 "Insert rules needed by THIS target." 92 "Insert variables needed by the compiler THIS."
85 (let ((ede-proj-compiler-object-linkflags 93 (call-next-method)
86 (mapconcat 'identity (oref this ldflags) " "))) 94 (let ((lf (mapconcat 'identity (oref this ldflags) " ")))
87 (with-slots (ldlibs) this 95 (with-slots (ldlibs) this
88 (if ldlibs 96 (if ldlibs
89 (setq ede-proj-compiler-object-linkflags 97 (setq lf
90 (concat ede-proj-compiler-object-linkflags 98 (concat lf " -l" (mapconcat 'identity ldlibs " -l")))))
91 " -l" 99 ;; LDFLAGS as needed.
92 (mapconcat 'identity ldlibs " -l"))))) 100 (when (and lf (not (string= "" lf)))
93 (call-next-method))) 101 (ede-pmake-insert-variable-once "LDDEPS" (insert lf)))))
94 102
95(defmethod project-debug-target ((obj ede-proj-target-makefile-program)) 103(defmethod project-debug-target ((obj ede-proj-target-makefile-program))
96 "Debug a program target OBJ." 104 "Debug a program target OBJ."
diff --git a/lisp/cedet/ede/proj-shared.el b/lisp/cedet/ede/proj-shared.el
index 46a8a480b52..e1111f9f38b 100644
--- a/lisp/cedet/ede/proj-shared.el
+++ b/lisp/cedet/ede/proj-shared.el
@@ -34,15 +34,15 @@
34;;; Code: 34;;; Code:
35(defclass ede-proj-target-makefile-shared-object 35(defclass ede-proj-target-makefile-shared-object
36 (ede-proj-target-makefile-program) 36 (ede-proj-target-makefile-program)
37 ((availablecompilers :initform (ede-gcc-libtool-shared-compiler 37 ((availablecompilers :initform '(ede-gcc-libtool-shared-compiler
38 ;;ede-gcc-shared-compiler 38 ;;ede-gcc-shared-compiler
39 ede-g++-libtool-shared-compiler 39 ede-g++-libtool-shared-compiler
40 ;;ede-g++-shared-compiler 40 ;;ede-g++-shared-compiler
41 )) 41 ))
42 (availablelinkers :initform (ede-cc-linker-libtool 42 (availablelinkers :initform '(ede-cc-linker-libtool
43 ede-g++-linker-libtool 43 ede-g++-linker-libtool
44 ;; Add more linker thingies here. 44 ;; Add more linker thingies here.
45 )) 45 ))
46 (ldflags :custom (repeat (string :tag "Libtool flag")) 46 (ldflags :custom (repeat (string :tag "Libtool flag"))
47 :documentation 47 :documentation
48 "Additional flags to add when linking this shared library. 48 "Additional flags to add when linking this shared library.
@@ -124,7 +124,7 @@ Use ldlibs to add addition libraries.")
124 :rules (list (ede-makefile-rule 124 :rules (list (ede-makefile-rule
125 "c++-inference-rule-libtool" 125 "c++-inference-rule-libtool"
126 :target "%.o" 126 :target "%.o"
127 :dependencies "%.c" 127 :dependencies "%.cpp"
128 :rules '("@echo '$(LTCOMPILE) -o $@ $<'; \\" 128 :rules '("@echo '$(LTCOMPILE) -o $@ $<'; \\"
129 "$(LTCOMPILE) -o $@ $<" 129 "$(LTCOMPILE) -o $@ $<"
130 ) 130 )
diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el
index 3cdf42dc841..41887431d31 100644
--- a/lisp/cedet/ede/proj.el
+++ b/lisp/cedet/ede/proj.el
@@ -29,7 +29,6 @@
29;; rebuild. The targets provided in ede-proj can be augmented with 29;; rebuild. The targets provided in ede-proj can be augmented with
30;; additional target types inherited directly from `ede-proj-target'. 30;; additional target types inherited directly from `ede-proj-target'.
31 31
32;; (eval-and-compile '(require 'ede))
33(require 'ede/proj-comp) 32(require 'ede/proj-comp)
34(require 'ede/make) 33(require 'ede/make)
35 34
@@ -336,7 +335,9 @@ Argument TARGET is the project we are completing customization on."
336 (or (string= (file-name-nondirectory (oref this file)) f) 335 (or (string= (file-name-nondirectory (oref this file)) f)
337 (string= (ede-proj-dist-makefile this) f) 336 (string= (ede-proj-dist-makefile this) f)
338 (string-match "Makefile\\(\\.\\(in\\|am\\)\\)?$" f) 337 (string-match "Makefile\\(\\.\\(in\\|am\\)\\)?$" f)
339 (string-match "config\\(ure\\.in\\|\\.stutus\\)?$" f) 338 (string-match "config\\(ure\\.\\(in\\|ac\\)\\|\\.status\\)?$" f)
339 (string-match "config.h\\(\\.in\\)?" f)
340 (member f '("AUTHORS" "NEWS" "COPYING" "INSTALL" "README"))
340 ))) 341 )))
341 342
342(defmethod ede-buffer-mine ((this ede-proj-target) buffer) 343(defmethod ede-buffer-mine ((this ede-proj-target) buffer)
@@ -398,11 +399,11 @@ Argument TARGET is the project we are completing customization on."
398 :source nil))) 399 :source nil)))
399 400
400(defmethod project-delete-target ((this ede-proj-target)) 401(defmethod project-delete-target ((this ede-proj-target))
401 "Delete the current target THIS from it's parent project." 402 "Delete the current target THIS from its parent project."
402 (let ((p (ede-current-project)) 403 (let ((p (ede-current-project))
403 (ts (oref this source))) 404 (ts (oref this source)))
404 ;; Loop across all sources. If it exists in a buffer, 405 ;; Loop across all sources. If it exists in a buffer,
405 ;; clear it's object. 406 ;; clear its object.
406 (while ts 407 (while ts
407 (let* ((default-directory (oref this path)) 408 (let* ((default-directory (oref this path))
408 (b (get-file-buffer (car ts)))) 409 (b (get-file-buffer (car ts))))
@@ -413,7 +414,7 @@ Argument TARGET is the project we are completing customization on."
413 (setq ede-object nil) 414 (setq ede-object nil)
414 (ede-apply-object-keymap)))))) 415 (ede-apply-object-keymap))))))
415 (setq ts (cdr ts))) 416 (setq ts (cdr ts)))
416 ;; Remove THIS from it's parent. 417 ;; Remove THIS from its parent.
417 ;; The two vectors should be pointer equivalent. 418 ;; The two vectors should be pointer equivalent.
418 (oset p targets (delq this (oref p targets))) 419 (oset p targets (delq this (oref p targets)))
419 (ede-proj-save (ede-current-project)))) 420 (ede-proj-save (ede-current-project))))
@@ -447,15 +448,13 @@ FILE must be massaged by `ede-convert-path'."
447 448
448(defmethod project-make-dist ((this ede-proj-project)) 449(defmethod project-make-dist ((this ede-proj-project))
449 "Build a distribution for the project based on THIS target." 450 "Build a distribution for the project based on THIS target."
450 ;; I'm a lazy bum, so I'll make a makefile for doing this sort
451 ;; of thing, and rely only on that small section of code.
452 (let ((pm (ede-proj-dist-makefile this)) 451 (let ((pm (ede-proj-dist-makefile this))
453 (df (project-dist-files this))) 452 (df (project-dist-files this)))
454 (if (and (file-exists-p (car df)) 453 (if (and (file-exists-p (car df))
455 (not (y-or-n-p "Dist file already exists. Rebuild? "))) 454 (not (y-or-n-p "Dist file already exists. Rebuild? ")))
456 (error "Try `ede-update-version' before making a distribution")) 455 (error "Try `ede-update-version' before making a distribution"))
457 (ede-proj-setup-buildenvironment this) 456 (ede-proj-setup-buildenvironment this)
458 (if (string= (file-name-nondirectory pm) "Makefile.am") 457 (if (ede-proj-automake-p this)
459 (setq pm (expand-file-name "Makefile" 458 (setq pm (expand-file-name "Makefile"
460 (file-name-directory pm)))) 459 (file-name-directory pm))))
461 (compile (concat ede-make-command " -f " pm " dist")))) 460 (compile (concat ede-make-command " -f " pm " dist"))))
@@ -473,7 +472,7 @@ Argument COMMAND is the command to use when compiling."
473 (let ((pm (ede-proj-dist-makefile proj)) 472 (let ((pm (ede-proj-dist-makefile proj))
474 (default-directory (file-name-directory (oref proj file)))) 473 (default-directory (file-name-directory (oref proj file))))
475 (ede-proj-setup-buildenvironment proj) 474 (ede-proj-setup-buildenvironment proj)
476 (if (string= (file-name-nondirectory pm) "Makefile.am") 475 (if (ede-proj-automake-p proj)
477 (setq pm (expand-file-name "Makefile" 476 (setq pm (expand-file-name "Makefile"
478 (file-name-directory pm)))) 477 (file-name-directory pm))))
479 (compile (concat ede-make-command" -f " pm " all")))) 478 (compile (concat ede-make-command" -f " pm " all"))))
@@ -539,7 +538,15 @@ Converts all symbols into the objects to be used."
539 (if (ede-want-any-source-files-p (symbol-value (car st)) sources) 538 (if (ede-want-any-source-files-p (symbol-value (car st)) sources)
540 (let ((c (ede-proj-find-compiler avail (car st)))) 539 (let ((c (ede-proj-find-compiler avail (car st))))
541 (if c (setq comp (cons c comp))))) 540 (if c (setq comp (cons c comp)))))
542 (setq st (cdr st))))) 541 (setq st (cdr st)))
542 ;; Provide a good error msg.
543 (unless comp
544 (error "Could not find compiler match for source code extension \"%s\".
545You may need to add support for this type of file."
546 (if sources
547 (file-name-extension (car sources))
548 "")))
549 ))
543 ;; Return the disovered compilers 550 ;; Return the disovered compilers
544 comp))) 551 comp)))
545 552
@@ -664,18 +671,9 @@ Optional argument FORCE will force items to be regenerated."
664 (let ((root (or (ede-project-root this) this)) 671 (let ((root (or (ede-project-root this) this))
665 ) 672 )
666 (setq ede-projects (delq root ede-projects)) 673 (setq ede-projects (delq root ede-projects))
667 (ede-proj-load (ede-project-root-directory root)) 674 (ede-load-project-file (ede-project-root-directory root))
668 )) 675 ))
669 676
670(defmethod project-rescan ((this ede-proj-target) readstream)
671 "Rescan target THIS from the read list READSTREAM."
672 (setq readstream (cdr (cdr readstream))) ;; constructor/name
673 (while readstream
674 (let ((tag (car readstream))
675 (val (car (cdr readstream))))
676 (eieio-oset this tag val))
677 (setq readstream (cdr (cdr readstream)))))
678
679(provide 'ede/proj) 677(provide 'ede/proj)
680 678
681;; arch-tag: eb8a40f8-0d2c-41c4-b273-af04101d1cdf 679;; arch-tag: eb8a40f8-0d2c-41c4-b273-af04101d1cdf
diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el
index 3eb1f9c2183..ccfb1a242b4 100644
--- a/lisp/cedet/ede/project-am.el
+++ b/lisp/cedet/ede/project-am.el
@@ -30,27 +30,19 @@
30;; fashion. 30;; fashion.
31;; 31;;
32;; project-am uses the structure defined in all good GNU projects with 32;; project-am uses the structure defined in all good GNU projects with
33;; the Automake file as it's base template, and then maintains that 33;; the Automake file as its base template, and then maintains that
34;; information during edits, automatically updating the automake file 34;; information during edits, automatically updating the automake file
35;; where appropriate. 35;; where appropriate.
36 36
37
38;; (eval-and-compile
39;; ;; Compatibility for makefile mode.
40;; (condition-case nil
41;; (require 'makefile "make-mode")
42;; (error (require 'make-mode "make-mode")))
43
44;; ;; Requiring the .el files prevents incomplete builds.
45;; (require 'eieio "eieio.el")
46;; (require 'ede "ede.el"))
47
48(require 'make-mode) 37(require 'make-mode)
49(require 'ede) 38(require 'ede)
50(require 'ede/make) 39(require 'ede/make)
51(require 'ede/makefile-edit) 40(require 'ede/makefile-edit)
41(require 'semantic/find) ;; for semantic-find-tags-by-...
42(require 'ede/autoconf-edit)
52 43
53(declare-function autoconf-parameters-for-macro "ede/autoconf-edit") 44(declare-function autoconf-parameters-for-macro "ede/autoconf-edit")
45(declare-function ede-shell-run-something "ede/shell")
54(eval-when-compile (require 'compile)) 46(eval-when-compile (require 'compile))
55 47
56;;; Code: 48;;; Code:
@@ -104,7 +96,7 @@
104 ;; ("ltlibcustom" project-am-lib ".*?_LTLIBRARIES" t) 96 ;; ("ltlibcustom" project-am-lib ".*?_LTLIBRARIES" t)
105 ) 97 )
106 "Alist of type names and the type of object to create for them. 98 "Alist of type names and the type of object to create for them.
107Each entry is of th form: 99Each entry is of the form:
108 (EMACSNAME CLASS AUTOMAKEVAR INDIRECT) 100 (EMACSNAME CLASS AUTOMAKEVAR INDIRECT)
109where EMACSNAME is a name for Emacs to use. 101where EMACSNAME is a name for Emacs to use.
110CLASS is the EDE target class to represent the target. 102CLASS is the EDE target class to represent the target.
@@ -113,6 +105,23 @@ AUTOMAKEVAR is the Automake variable to identify. This cannot be a
113INDIRECT is optional. If it is non-nil, then the variable in 105INDIRECT is optional. If it is non-nil, then the variable in
114question lists other variables that need to be looked up.") 106question lists other variables that need to be looked up.")
115 107
108
109(defconst project-am-meta-type-alist
110 '((project-am-program "_PROGRAMS$" t)
111 (project-am-lib "_\\(LIBS\\|LIBRARIES\\|LTLIBRARIES\\)$" t)
112
113 ;; direct primary target use a dummy object (man target)
114 ;; update to: * 3.3 Uniform in automake-1.11 info node.
115 (project-am-man "_\\(DATA\\|HEADERS\\|PYTHON\\|JAVA\\|SCRIPTS\\|MANS\\|TEXINFOS\\)$" nil)
116 )
117 "Alist of meta-target type, each entry has form:
118 (CLASS REGEXPVAR INDIRECT)
119where CLASS is the EDE target class for target.
120REGEXPVAR is the regexp used in `semantic-find-tags-by-name-regexp'.
121INDIRECT is optional. If it is non-nil, then the variable in it have
122other meta-variable based on this name.")
123
124
116(defclass project-am-target (ede-target) 125(defclass project-am-target (ede-target)
117 nil 126 nil
118 "Base target class for everything in project-am.") 127 "Base target class for everything in project-am.")
@@ -291,16 +300,6 @@ buffer being in order to provide a smart default target type."
291 ;; Rescan the object in this makefile. 300 ;; Rescan the object in this makefile.
292 (project-rescan ede-object)))) 301 (project-rescan ede-object))))
293 302
294;(defun project-am-rescan-toplevel ()
295; "Rescan all projects in which the current buffer resides."
296; (interactive)
297; (let* ((tlof (project-am-find-topmost-level default-directory))
298; (tlo (project-am-load tlof))
299; (ede-deep-rescan t)) ; scan deep in this case.
300; ;; tlo is the top level object for whatever file we are in
301; ;; or nil. If we have an object, call the rescan method.
302; (if tlo (project-am-rescan tlo))))
303
304;; 303;;
305;; NOTE TO SELF 304;; NOTE TO SELF
306;; 305;;
@@ -406,6 +405,7 @@ Argument COMMAND is the command to use for compiling the target."
406 405
407(defmethod project-run-target ((obj project-am-objectcode)) 406(defmethod project-run-target ((obj project-am-objectcode))
408 "Run the current project target in comint buffer." 407 "Run the current project target in comint buffer."
408 (require 'ede/shell)
409 (let ((tb (get-buffer-create " *padt*")) 409 (let ((tb (get-buffer-create " *padt*"))
410 (dd (oref obj path)) 410 (dd (oref obj path))
411 (cmd nil)) 411 (cmd nil))
@@ -429,45 +429,17 @@ Argument COMMAND is the command to use for compiling the target."
429 429
430;;; Project loading and saving 430;;; Project loading and saving
431;; 431;;
432(defun project-am-load (project &optional rootproj) 432(defun project-am-load (directory &optional rootproj)
433 "Read an automakefile PROJECT into our data structure. 433 "Read an automakefile DIRECTORY into our data structure.
434Make sure that the tree down to our makefile is complete so that there
435is cohesion in the project. Return the project file (or sub-project).
436If a given set of projects has already been loaded, then do nothing 434If a given set of projects has already been loaded, then do nothing
437but return the project for the directory given. 435but return the project for the directory given.
438Optional ROOTPROJ is the root EDE project." 436Optional ROOTPROJ is the root EDE project."
439 ;; @TODO - rationalize this to the newer EDE way of doing things. 437 (let* ((ede-constructiong t)
440 (setq project (expand-file-name project)) 438 (amo (object-assoc (expand-file-name "Makefile.am" directory)
441 (let* ((ede-constructing t) 439 'file ede-projects)))
442 (fn (project-am-find-topmost-level (file-name-as-directory project))) 440 (when (not amo)
443 (amo nil) 441 (setq amo (project-am-load-makefile directory)))
444 (trimmed (if (string-match (regexp-quote fn) 442 amo))
445 project)
446 (replace-match "" t t project)
447 ""))
448 (subdir nil))
449 (setq amo (object-assoc (expand-file-name "Makefile.am" fn)
450 'file ede-projects))
451 (if amo
452 (error "Synchronous error in ede/project-am objects")
453 (let ((project-am-constructing t))
454 (setq amo (project-am-load-makefile fn))))
455 (if (not amo)
456 nil
457 ;; Now scan down from amo, and find the current directory
458 ;; from the PROJECT file.
459 (while (< 0 (length trimmed))
460 (if (string-match "\\([a-zA-Z0-9.-]+\\)/" trimmed)
461 (setq subdir (match-string 0 trimmed)
462 trimmed (replace-match "" t t trimmed))
463 (error "Error scanning down path for project"))
464 (setq amo (project-am-subtree
465 amo
466 (expand-file-name "Makefile.am"
467 (expand-file-name subdir fn)))
468 fn (expand-file-name subdir fn)))
469 amo)
470 ))
471 443
472(defun project-am-find-topmost-level (dir) 444(defun project-am-find-topmost-level (dir)
473 "Find the topmost automakefile starting with DIR." 445 "Find the topmost automakefile starting with DIR."
@@ -488,17 +460,19 @@ Kill the makefile if it was not loaded before the load."
488 (fb nil) 460 (fb nil)
489 (kb (get-file-buffer fn))) 461 (kb (get-file-buffer fn)))
490 (if (not (file-exists-p fn)) 462 (if (not (file-exists-p fn))
491 nil 463 nil
492 (save-excursion 464 (save-excursion
493 (if kb (setq fb kb) 465 (if kb (setq fb kb)
494 ;; We need to find-file this thing, but don't use 466 ;; We need to find-file this thing, but don't use
495 ;; any semantic features. 467 ;; any semantic features.
496 (let ((semantic-init-hook nil)) 468 (let ((semantic-init-hook nil)
497 (setq fb (find-file-noselect fn))) 469 (recentf-exclude '( (lambda (f) t) ))
498 ) 470 )
499 (set-buffer fb) 471 (setq fb (find-file-noselect fn)))
500 (prog1 ,@forms 472 )
501 (if (not kb) (kill-buffer (current-buffer)))))))) 473 (set-buffer fb)
474 (prog1 ,@forms
475 (if (not kb) (kill-buffer (current-buffer))))))))
502(put 'project-am-with-makefile-current 'lisp-indent-function 1) 476(put 'project-am-with-makefile-current 'lisp-indent-function 1)
503 477
504(add-hook 'edebug-setup-hook 478(add-hook 'edebug-setup-hook
@@ -507,14 +481,18 @@ Kill the makefile if it was not loaded before the load."
507 (form def-body)))) 481 (form def-body))))
508 482
509 483
510(defun project-am-load-makefile (path) 484(defun project-am-load-makefile (path &optional suggestedname)
511 "Convert PATH into a project Makefile, and return its project object. 485 "Convert PATH into a project Makefile, and return its project object.
512It does not check for existing project objects. Use `project-am-load'." 486It does not check for existing project objects. Use `project-am-load'.
487Optional argument SUGGESTEDNAME will be the project name.
488This is used when subprojects are made in named subdirectories."
513 (project-am-with-makefile-current path 489 (project-am-with-makefile-current path
514 (if (and ede-object (project-am-makefile-p ede-object)) 490 (if (and ede-object (project-am-makefile-p ede-object))
515 ede-object 491 ede-object
516 (let* ((pi (project-am-package-info path)) 492 (let* ((pi (project-am-package-info path))
517 (pn (or (nth 0 pi) (project-am-last-dir fn))) 493 (sfn (when suggestedname
494 (project-am-last-dir suggestedname)))
495 (pn (or sfn (nth 0 pi) (project-am-last-dir fn)))
518 (ver (or (nth 1 pi) "0.0")) 496 (ver (or (nth 1 pi) "0.0"))
519 (bug (nth 2 pi)) 497 (bug (nth 2 pi))
520 (cof (nth 3 pi)) 498 (cof (nth 3 pi))
@@ -532,21 +510,6 @@ It does not check for existing project objects. Use `project-am-load'."
532 ampf)))) 510 ampf))))
533 511
534;;; Methods: 512;;; Methods:
535(defmethod ede-find-target ((amf project-am-makefile) buffer)
536 "Fetch the target belonging to BUFFER."
537 (or (call-next-method)
538 (let ((targ (oref amf targets))
539 (sobj (oref amf subproj))
540 (obj nil))
541 (while (and targ (not obj))
542 (if (ede-buffer-mine (car targ) buffer)
543 (setq obj (car targ)))
544 (setq targ (cdr targ)))
545 (while (and sobj (not obj))
546 (setq obj (project-am-buffer-object (car sobj) buffer)
547 sobj (cdr sobj)))
548 obj)))
549
550(defmethod project-targets-for-file ((proj project-am-makefile)) 513(defmethod project-targets-for-file ((proj project-am-makefile))
551 "Return a list of targets the project PROJ." 514 "Return a list of targets the project PROJ."
552 (oref proj targets)) 515 (oref proj targets))
@@ -556,44 +519,110 @@ It does not check for existing project objects. Use `project-am-load'."
556CURRPROJ is the current project being scanned. 519CURRPROJ is the current project being scanned.
557DIR is the directory to apply to new targets." 520DIR is the directory to apply to new targets."
558 (let* ((otargets (oref currproj targets)) 521 (let* ((otargets (oref currproj targets))
522 ;; `ntargets' results in complete targets list
523 ;; not only the new targets by diffing.
559 (ntargets nil) 524 (ntargets nil)
560 (tmp nil) 525 (tmp nil)
561 ) 526 )
562 (mapc 527
563 ;; Map all the different types 528 (mapc
564 (lambda (typecar) 529 ;; Map all the different types
565 (let ((macro (nth 2 typecar)) 530 (lambda (typecar)
566 (class (nth 1 typecar)) 531 (let ((macro (nth 2 typecar))
567 (indirect (nth 3 typecar)) 532 (class (nth 1 typecar))
568 ;(name (car typecar)) 533 (indirect (nth 3 typecar))
569 )
570 (if indirect
571 ;; Map all the found objects
572 (mapc (lambda (lstcar)
573 (setq tmp (object-assoc lstcar 'name otargets))
574 (when (not tmp)
575 (setq tmp (apply class lstcar :name lstcar
576 :path dir nil)))
577 (project-rescan tmp)
578 (setq ntargets (cons tmp ntargets)))
579 (makefile-macro-file-list macro))
580 ;; Non-indirect will have a target whos sources
581 ;; are actual files, not names of other targets.
582 (let ((files (makefile-macro-file-list macro)))
583 (when files
584 (setq tmp (object-assoc macro 'name otargets))
585 (when (not tmp)
586 (setq tmp (apply class macro :name macro
587 :path dir nil)))
588 (project-rescan tmp)
589 (setq ntargets (cons tmp ntargets))
590 ))
591 ) 534 )
592 )) 535 (if indirect
593 project-am-type-alist) 536 ;; Map all the found objects
594 ntargets)) 537 (mapc (lambda (lstcar)
538 (setq tmp (object-assoc lstcar 'name otargets))
539 (when (not tmp)
540 (setq tmp (apply class lstcar :name lstcar
541 :path dir nil)))
542 (project-rescan tmp)
543 (setq ntargets (cons tmp ntargets)))
544 (makefile-macro-file-list macro))
545 ;; Non-indirect will have a target whos sources
546 ;; are actual files, not names of other targets.
547 (let ((files (makefile-macro-file-list macro)))
548 (when files
549 (setq tmp (object-assoc macro 'name otargets))
550 (when (not tmp)
551 (setq tmp (apply class macro :name macro
552 :path dir nil)))
553 (project-rescan tmp)
554 (setq ntargets (cons tmp ntargets))
555 ))
556 )
557 ))
558 project-am-type-alist)
559
560 ;; At now check variables for meta-target regexp
561 ;; We have to check ntargets to avoid useless rescan.
562 ;; Also we have check otargets to prevent duplication.
563 (mapc
564 (lambda (typecar)
565 (let ((class (nth 0 typecar))
566 (metaregex (nth 1 typecar))
567 (indirect (nth 2 typecar)))
568 (if indirect
569 ;; Map all the found objects
570 (mapc
571 (lambda (lstcar)
572 (unless (object-assoc lstcar 'name ntargets)
573 (or
574 (setq tmp (object-assoc lstcar 'name otargets))
575 (setq tmp (apply class lstcar :name lstcar
576 :path dir nil)))
577 (project-rescan tmp)
578 (setq ntargets (cons tmp ntargets))))
579 ;; build a target list to map over
580 (let (atargets)
581 (dolist (TAG
582 (semantic-find-tags-by-name-regexp
583 metaregex (semantic-find-tags-by-class
584 'variable (semantic-fetch-tags))))
585 ;; default-value have to be a list
586 (when (cadr (assoc ':default-value TAG))
587 (setq atargets
588 (append
589 (nreverse (cadr (assoc ':default-value TAG)))
590 atargets))))
591 (nreverse atargets)))
592
593 ;; else not indirect, TODO: FIX various direct meta type in a sane way.
594 (dolist (T (semantic-find-tags-by-name-regexp
595 metaregex (semantic-find-tags-by-class
596 'variable (semantic-fetch-tags))))
597 (unless (setq tmp (object-assoc (car T) 'name ntargets))
598 (or (setq tmp (object-assoc (car T) 'name otargets))
599 ;; we are really new
600 (setq tmp (apply class (car T) :name (car T)
601 :path dir nil)))
602 (project-rescan tmp)
603 (setq ntargets (cons tmp ntargets))))
604 )))
605 project-am-meta-type-alist)
606 ntargets))
607
608(defun project-am-expand-subdirlist (place subdirs)
609 "Store in PLACE the SUBDIRS expanded from variables.
610Strip out duplicates, and recurse on variables."
611 (mapc (lambda (sp)
612 (let ((var (makefile-extract-varname-from-text sp)))
613 (if var
614 ;; If it is a variable, expand that variable, and keep going.
615 (project-am-expand-subdirlist
616 place (makefile-macro-file-list var))
617 ;; Else, add SP in if it isn't a dup.
618 (if (member sp (symbol-value place))
619 nil ; don't do it twice.
620 (set place (cons sp (symbol-value place))) ;; add
621 ))))
622 subdirs)
623 )
595 624
596(defmethod project-rescan ((this project-am-makefile)) 625(defmethod project-rescan ((this project-am-makefile) &optional suggestedname)
597 "Rescan the makefile for all targets and sub targets." 626 "Rescan the makefile for all targets and sub targets."
598 (project-am-with-makefile-current (file-name-directory (oref this file)) 627 (project-am-with-makefile-current (file-name-directory (oref this file))
599 ;;(message "Scanning %s..." (oref this file)) 628 ;;(message "Scanning %s..." (oref this file))
@@ -603,10 +632,10 @@ DIR is the directory to apply to new targets."
603 (bug (nth 2 pi)) 632 (bug (nth 2 pi))
604 (cof (nth 3 pi)) 633 (cof (nth 3 pi))
605 (osubproj (oref this subproj)) 634 (osubproj (oref this subproj))
606 (csubproj (or 635 ;; 1/30/10 - We need to append these two lists together,
607 ;; If DIST_SUBDIRS doesn't exist, then go for the 636 ;; then strip out duplicates. Expanding this list (via
608 ;; static list of SUBDIRS. The DIST version should 637 ;; references to other variables should also strip out dups
609 ;; contain SUBDIRS plus extra stuff. 638 (csubproj (append
610 (makefile-macro-file-list "DIST_SUBDIRS") 639 (makefile-macro-file-list "DIST_SUBDIRS")
611 (makefile-macro-file-list "SUBDIRS"))) 640 (makefile-macro-file-list "SUBDIRS")))
612 (csubprojexpanded nil) 641 (csubprojexpanded nil)
@@ -617,79 +646,57 @@ DIR is the directory to apply to new targets."
617 (tmp nil) 646 (tmp nil)
618 (ntargets (project-am-scan-for-targets this dir)) 647 (ntargets (project-am-scan-for-targets this dir))
619 ) 648 )
620 649 (if suggestedname
621 (and pn (string= (directory-file-name 650 (oset this name (project-am-last-dir suggestedname))
622 (oref this directory)) 651 ;; Else, setup toplevel project info.
623 (directory-file-name 652 (and pn (string= (directory-file-name
624 (project-am-find-topmost-level 653 (oref this directory))
625 (oref this directory)))) 654 (directory-file-name
626 (oset this name pn) 655 (project-am-find-topmost-level
627 (and pv (oset this version pv)) 656 (oref this directory))))
628 (and bug (oset this mailinglist bug)) 657 (oset this name pn)
629 (oset this configureoutputfiles cof)) 658 (and pv (oset this version pv))
630 659 (and bug (oset this mailinglist bug))
631; ;; LISP is different. Here there is only one kind of lisp (that I know of 660 (oset this configureoutputfiles cof)))
632; ;; anyway) so it doesn't get mapped when it is found.
633; (if (makefile-move-to-macro "lisp_LISP")
634; (let ((tmp (project-am-lisp "lisp"
635; :name "lisp"
636; :path dir)))
637; (project-rescan tmp)
638; (setq ntargets (cons tmp ntargets))))
639;
640 ;; Now that we have this new list, chuck the old targets 661 ;; Now that we have this new list, chuck the old targets
641 ;; and replace it with the new list of targets I just created. 662 ;; and replace it with the new list of targets I just created.
642 (oset this targets (nreverse ntargets)) 663 (oset this targets (nreverse ntargets))
643 ;; We still have a list of targets. For all buffers, make sure 664 ;; We still have a list of targets. For all buffers, make sure
644 ;; their object still exists! 665 ;; their object still exists!
645
646 ;; FIGURE THIS OUT 666 ;; FIGURE THIS OUT
647 667 (project-am-expand-subdirlist 'csubprojexpanded csubproj)
648 (mapc (lambda (sp)
649 (let ((var (makefile-extract-varname-from-text sp))
650 )
651 (if (not var)
652 (setq csubprojexpanded (cons sp csubprojexpanded))
653 ;; If it is a variable, expand that variable, and keep going.
654 (let ((varexp (makefile-macro-file-list var)))
655 (dolist (V varexp)
656 (setq csubprojexpanded (cons V csubprojexpanded)))))
657 ))
658 csubproj)
659
660 ;; Ok, now lets look at all our sub-projects. 668 ;; Ok, now lets look at all our sub-projects.
661 (mapc (lambda (sp) 669 (mapc (lambda (sp)
662 (let* ((subdir (file-name-as-directory 670 (let* ((subdir (file-name-as-directory
663 (expand-file-name 671 (expand-file-name
664 sp (file-name-directory (oref this :file))))) 672 sp (file-name-directory (oref this :file)))))
665 (submake (expand-file-name 673 (submake (expand-file-name
666 "Makefile.am" 674 "Makefile.am"
667 subdir))) 675 subdir)))
668 (if (string= submake (oref this :file)) 676 (if (string= submake (oref this :file))
669 nil ;; don't recurse.. please! 677 nil ;; don't recurse.. please!
670 678 ;; For each project id found, see if we need to recycle,
671 ;; For each project id found, see if we need to recycle, 679 ;; and if we do not, then make a new one. Check the deep
672 ;; and if we do not, then make a new one. Check the deep 680 ;; rescan value for behavior patterns.
673 ;; rescan value for behavior patterns. 681 (setq tmp (object-assoc
674 (setq tmp (object-assoc 682 submake
675 submake 683 'file osubproj))
676 'file osubproj)) 684 (if (not tmp)
677 (if (not tmp) 685 (setq tmp
678 (setq tmp 686 (condition-case nil
679 (condition-case nil 687 ;; In case of problem, ignore it.
680 ;; In case of problem, ignore it. 688 (project-am-load-makefile subdir subdir)
681 (project-am-load-makefile subdir) 689 (error nil)))
682 (error nil))) 690 ;; If we have tmp, then rescan it only if deep mode.
683 ;; If we have tmp, then rescan it only if deep mode. 691 (if ede-deep-rescan
684 (if ede-deep-rescan 692 (project-rescan tmp subdir)))
685 (project-rescan tmp))) 693 ;; Tac tmp onto our list of things to keep, but only
686 ;; Tac tmp onto our list of things to keep, but only 694 ;; if tmp was found.
687 ;; if tmp was found. 695 (when tmp
688 (when tmp 696 ;;(message "Adding %S" (object-print tmp))
689 ;;(message "Adding %S" (object-print tmp)) 697 (setq nsubproj (cons tmp nsubproj)))))
690 (setq nsubproj (cons tmp nsubproj))))) 698 )
691 ) 699 (nreverse csubprojexpanded))
692 (nreverse csubprojexpanded))
693 (oset this subproj nsubproj) 700 (oset this subproj nsubproj)
694 ;; All elements should be updated now. 701 ;; All elements should be updated now.
695 ))) 702 )))
@@ -698,12 +705,16 @@ DIR is the directory to apply to new targets."
698(defmethod project-rescan ((this project-am-program)) 705(defmethod project-rescan ((this project-am-program))
699 "Rescan object THIS." 706 "Rescan object THIS."
700 (oset this :source (makefile-macro-file-list (project-am-macro this))) 707 (oset this :source (makefile-macro-file-list (project-am-macro this)))
708 (unless (oref this :source)
709 (oset this :source (list (concat (oref this :name) ".c"))))
701 (oset this :ldadd (makefile-macro-file-list 710 (oset this :ldadd (makefile-macro-file-list
702 (concat (oref this :name) "_LDADD")))) 711 (concat (oref this :name) "_LDADD"))))
703 712
704(defmethod project-rescan ((this project-am-lib)) 713(defmethod project-rescan ((this project-am-lib))
705 "Rescan object THIS." 714 "Rescan object THIS."
706 (oset this :source (makefile-macro-file-list (project-am-macro this)))) 715 (oset this :source (makefile-macro-file-list (project-am-macro this)))
716 (unless (oref this :source)
717 (oset this :source (list (concat (file-name-sans-extension (oref this :name)) ".c")))))
707 718
708(defmethod project-rescan ((this project-am-texinfo)) 719(defmethod project-rescan ((this project-am-texinfo))
709 "Rescan object THIS." 720 "Rescan object THIS."
@@ -728,19 +739,6 @@ DIR is the directory to apply to new targets."
728(defmethod project-rescan ((this project-am-extra-dist)) 739(defmethod project-rescan ((this project-am-extra-dist))
729 "Rescan object THIS." 740 "Rescan object THIS."
730 (oset this :source (makefile-macro-file-list "EXTRA_DIST"))) 741 (oset this :source (makefile-macro-file-list "EXTRA_DIST")))
731 ;; NOTE: The below calls 'file' then checks that it is some sort of
732 ;; text file. The file command may not be available on all platforms
733 ;; and some files may not exist yet. (ie - auto-generated)
734
735 ;;(mapc
736 ;; (lambda (f)
737 ;; ;; prevent garbage to be parsed, could we use :aux ?
738 ;; (if (and (not (member f (oref this :source)))
739 ;; (string-match-p "ASCII\\|text"
740 ;; (shell-command-to-string
741 ;; (concat "file " f))))
742 ;; (oset this :source (cons f (oref this :source)))))
743 ;; (makefile-macro-file-list "EXTRA_DIST")))
744 742
745(defmethod project-am-macro ((this project-am-objectcode)) 743(defmethod project-am-macro ((this project-am-objectcode))
746 "Return the default macro to 'edit' for this object type." 744 "Return the default macro to 'edit' for this object type."
@@ -810,22 +808,24 @@ nil means that this buffer belongs to no-one."
810 808
811(defmethod ede-buffer-mine ((this project-am-objectcode) buffer) 809(defmethod ede-buffer-mine ((this project-am-objectcode) buffer)
812 "Return t if object THIS lays claim to the file in BUFFER." 810 "Return t if object THIS lays claim to the file in BUFFER."
813 (member (file-name-nondirectory (buffer-file-name buffer)) 811 (member (file-relative-name (buffer-file-name buffer) (oref this :path))
814 (oref this :source))) 812 (oref this :source)))
815 813
816(defmethod ede-buffer-mine ((this project-am-texinfo) buffer) 814(defmethod ede-buffer-mine ((this project-am-texinfo) buffer)
817 "Return t if object THIS lays claim to the file in BUFFER." 815 "Return t if object THIS lays claim to the file in BUFFER."
818 (let ((bfn (buffer-file-name buffer))) 816 (let ((bfn (file-relative-name (buffer-file-name buffer)
819 (or (string= (oref this :name) (file-name-nondirectory bfn)) 817 (oref this :path))))
820 (member (file-name-nondirectory bfn) (oref this :include))))) 818 (or (string= (oref this :name) bfn)
819 (member bfn (oref this :include)))))
821 820
822(defmethod ede-buffer-mine ((this project-am-man) buffer) 821(defmethod ede-buffer-mine ((this project-am-man) buffer)
823 "Return t if object THIS lays claim to the file in BUFFER." 822 "Return t if object THIS lays claim to the file in BUFFER."
824 (string= (oref this :name) (buffer-file-name buffer))) 823 (string= (oref this :name)
824 (file-relative-name (buffer-file-name buffer) (oref this :path))))
825 825
826(defmethod ede-buffer-mine ((this project-am-lisp) buffer) 826(defmethod ede-buffer-mine ((this project-am-lisp) buffer)
827 "Return t if object THIS lays claim to the file in BUFFER." 827 "Return t if object THIS lays claim to the file in BUFFER."
828 (member (file-name-nondirectory (buffer-file-name buffer)) 828 (member (file-relative-name (buffer-file-name buffer) (oref this :path))
829 (oref this :source))) 829 (oref this :source)))
830 830
831(defmethod project-am-subtree ((ampf project-am-makefile) subdir) 831(defmethod project-am-subtree ((ampf project-am-makefile) subdir)
@@ -956,7 +956,6 @@ Kill the Configure buffer if it was not already in a buffer."
956 (cond 956 (cond
957 ;; Try configure.in or configure.ac 957 ;; Try configure.in or configure.ac
958 (conf-in 958 (conf-in
959 (require 'ede/autoconf-edit)
960 (project-am-with-config-current conf-in 959 (project-am-with-config-current conf-in
961 (let ((aci (autoconf-parameters-for-macro "AC_INIT")) 960 (let ((aci (autoconf-parameters-for-macro "AC_INIT"))
962 (aia (autoconf-parameters-for-macro "AM_INIT_AUTOMAKE")) 961 (aia (autoconf-parameters-for-macro "AM_INIT_AUTOMAKE"))
@@ -982,7 +981,7 @@ Kill the Configure buffer if it was not already in a buffer."
982 (t acf)))) 981 (t acf))))
983 (if (> (length outfiles) 1) 982 (if (> (length outfiles) 1)
984 (setq configfiles outfiles) 983 (setq configfiles outfiles)
985 (setq configfiles (split-string (car outfiles) " " t))) 984 (setq configfiles (split-string (car outfiles) "\\s-" t)))
986 ) 985 )
987 )) 986 ))
988 ) 987 )
@@ -1007,6 +1006,18 @@ Calculates the info with `project-am-extract-package-info'."
1007 (when top (setq dir (oref top :directory))) 1006 (when top (setq dir (oref top :directory)))
1008 (project-am-extract-package-info dir))) 1007 (project-am-extract-package-info dir)))
1009 1008
1009;; for simple per project include path extension
1010(defmethod ede-system-include-path ((this project-am-makefile))
1011 "Return `project-am-localvars-include-path', usually local variable
1012per file or in .dir-locals.el or similar."
1013 (bound-and-true-p project-am-localvars-include-path))
1014
1015(defmethod ede-system-include-path ((this project-am-target))
1016 "Return `project-am-localvars-include-path', usually local variable
1017per file or in .dir-locals.el or similar."
1018 (bound-and-true-p project-am-localvars-include-path))
1019
1020
1010(provide 'ede/project-am) 1021(provide 'ede/project-am)
1011 1022
1012;; arch-tag: 528db935-f186-4240-b647-e305c5b784a2 1023;; arch-tag: 528db935-f186-4240-b647-e305c5b784a2
diff --git a/lisp/cedet/ede/shell.el b/lisp/cedet/ede/shell.el
index edc75f42dee..d967a878350 100644
--- a/lisp/cedet/ede/shell.el
+++ b/lisp/cedet/ede/shell.el
@@ -70,7 +70,7 @@ COMMAND is a text string representing the thing to be run."
70(defmethod ede-shell-buffer ((target ede-target)) 70(defmethod ede-shell-buffer ((target ede-target))
71 "Get the buffer for running shell commands for TARGET." 71 "Get the buffer for running shell commands for TARGET."
72 (let ((name (ede-name target))) 72 (let ((name (ede-name target)))
73 (get-buffer-create (format "*EDE Shell %s" name)))) 73 (get-buffer-create (format "*EDE Shell %s*" name))))
74 74
75(provide 'ede/shell) 75(provide 'ede/shell)
76 76
diff --git a/lisp/cedet/ede/simple.el b/lisp/cedet/ede/simple.el
index e0a526e9ead..a1ac52c29a1 100644
--- a/lisp/cedet/ede/simple.el
+++ b/lisp/cedet/ede/simple.el
@@ -21,6 +21,10 @@
21 21
22;;; Commentary: 22;;; Commentary:
23;; 23;;
24;; NOTE: EDE Simple Projects are considered obsolete. Use generic
25;; projects instead. They have much better automatic support and
26;; simpler configuration.
27;;
24;; A vast majority of projects use non-EDE project techniques, such 28;; A vast majority of projects use non-EDE project techniques, such
25;; as hand written Makefiles, or other IDE's. 29;; as hand written Makefiles, or other IDE's.
26;; 30;;
@@ -41,6 +45,14 @@
41 45
42;;; Code: 46;;; Code:
43 47
48(add-to-list 'ede-project-class-files
49 (ede-project-autoload "simple-overlay"
50 :name "Simple" :file 'ede-simple
51 :proj-file 'ede-simple-projectfile-for-dir
52 :load-type 'ede-simple-load
53 :class-sym 'ede-simple-project)
54 t)
55
44(defcustom ede-simple-save-directory "~/.ede" 56(defcustom ede-simple-save-directory "~/.ede"
45 "*Directory where simple EDE project overlays are saved." 57 "*Directory where simple EDE project overlays are saved."
46 :group 'ede 58 :group 'ede
diff --git a/lisp/cedet/ede/speedbar.el b/lisp/cedet/ede/speedbar.el
index 3a961787f9a..466705175ed 100644
--- a/lisp/cedet/ede/speedbar.el
+++ b/lisp/cedet/ede/speedbar.el
@@ -108,7 +108,7 @@ Argument DIR is the directory from which to derive the list of objects."
108;;; Some special commands useful in EDE 108;;; Some special commands useful in EDE
109;; 109;;
110(defun ede-speedbar-remove-file-from-target () 110(defun ede-speedbar-remove-file-from-target ()
111 "Remove the file at point from it's target." 111 "Remove the file at point from its target."
112 (interactive) 112 (interactive)
113 (if (stringp (speedbar-line-token)) 113 (if (stringp (speedbar-line-token))
114 (progn 114 (progn
diff --git a/lisp/cedet/ede/srecode.el b/lisp/cedet/ede/srecode.el
index d68c620a1ab..3b131dd3753 100644
--- a/lisp/cedet/ede/srecode.el
+++ b/lisp/cedet/ede/srecode.el
@@ -43,7 +43,9 @@
43 (srecode-map-update-map t) 43 (srecode-map-update-map t)
44 ;; We don't call this unless we need it. Load in the templates. 44 ;; We don't call this unless we need it. Load in the templates.
45 (srecode-load-tables-for-mode 'makefile-mode) 45 (srecode-load-tables-for-mode 'makefile-mode)
46 (srecode-load-tables-for-mode 'makefile-mode 'ede)) 46 (srecode-load-tables-for-mode 'makefile-mode 'ede)
47 (srecode-load-tables-for-mode 'autoconf-mode)
48 (srecode-load-tables-for-mode 'autoconf-mode 'ede))
47 49
48(defmacro ede-srecode-insert-with-dictionary (template &rest forms) 50(defmacro ede-srecode-insert-with-dictionary (template &rest forms)
49 "Insert TEMPLATE after executing FORMS with a dictionary. 51 "Insert TEMPLATE after executing FORMS with a dictionary.
diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
index ce11c18e609..593f196982b 100644
--- a/lisp/cedet/pulse.el
+++ b/lisp/cedet/pulse.el
@@ -3,6 +3,7 @@
3;;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 3;;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 4
5;; Author: Eric M. Ludlam <eric@siege-engine.com> 5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6;; Version: 1.0
6 7
7;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
8 9
@@ -57,10 +58,14 @@
57 (error nil))) 58 (error nil)))
58 59
59(defcustom pulse-flag (pulse-available-p) 60(defcustom pulse-flag (pulse-available-p)
60 "*Non-nil means to pulse the overlay face for momentary highlighting. 61 "Whether to use pulsing for momentary highlighting.
61Pulsing involves a bright highlight that slowly shifts to the background 62Pulsing involves a bright highlight that slowly shifts to the
62color. Non-nil just means to highlight with an unchanging color for a short 63background color.
63time. 64
65If the value is nil, highlight with an unchanging color until a
66key is pressed.
67If the value is `never', do no coloring at all.
68Any other value means to the default pulsing behavior.
64 69
65If `pulse-flag' is non-nil, but `pulse-available-p' is nil, then 70If `pulse-flag' is non-nil, but `pulse-available-p' is nil, then
66this flag is ignored." 71this flag is ignored."
@@ -178,22 +183,23 @@ Be sure to call `pulse-reset-face' after calling pulse."
178Optional argument FACE specifies the fact to do the highlighting." 183Optional argument FACE specifies the fact to do the highlighting."
179 (overlay-put o 'original-face (overlay-get o 'face)) 184 (overlay-put o 'original-face (overlay-get o 'face))
180 (add-to-list 'pulse-momentary-overlay o) 185 (add-to-list 'pulse-momentary-overlay o)
181 (if (or (not pulse-flag) (not (pulse-available-p))) 186 (if (eq pulse-flag 'never)
182 ;; Provide a face... clear on next command 187 nil
183 (progn 188 (if (or (not pulse-flag) (not (pulse-available-p)))
184 (overlay-put o 'face (or face 'pulse-highlight-start-face)) 189 ;; Provide a face... clear on next command
185 (add-hook 'pre-command-hook
186 'pulse-momentary-unhighlight)
187 )
188 ;; pulse it.
189 (unwind-protect
190 (progn 190 (progn
191 (overlay-put o 'face 'pulse-highlight-face) 191 (overlay-put o 'face (or face 'pulse-highlight-start-face))
192 ;; The pulse function puts FACE onto 'pulse-highlight-face. 192 (add-hook 'pre-command-hook
193 ;; Thus above we put our face on the overlay, but pulse 193 'pulse-momentary-unhighlight))
194 ;; with a reference face needed for the color. 194 ;; pulse it.
195 (pulse face)) 195 (unwind-protect
196 (pulse-momentary-unhighlight)))) 196 (progn
197 (overlay-put o 'face 'pulse-highlight-face)
198 ;; The pulse function puts FACE onto 'pulse-highlight-face.
199 ;; Thus above we put our face on the overlay, but pulse
200 ;; with a reference face needed for the color.
201 (pulse face))
202 (pulse-momentary-unhighlight)))))
197 203
198(defun pulse-momentary-unhighlight () 204(defun pulse-momentary-unhighlight ()
199 "Unhighlight a line recently highlighted." 205 "Unhighlight a line recently highlighted."
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index f5d3f54f205..ede96e39183 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -5,7 +5,7 @@
5 5
6;; Author: Eric M. Ludlam <zappo@gnu.org> 6;; Author: Eric M. Ludlam <zappo@gnu.org>
7;; Keywords: syntax tools 7;; Keywords: syntax tools
8;; Version: 2.0pre7 8;; Version: 2.0
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -39,7 +39,7 @@
39(require 'semantic/tag) 39(require 'semantic/tag)
40(require 'semantic/lex) 40(require 'semantic/lex)
41 41
42(defvar semantic-version "2.0pre7" 42(defvar semantic-version "2.0"
43 "Current version of Semantic.") 43 "Current version of Semantic.")
44 44
45(declare-function inversion-test "inversion") 45(declare-function inversion-test "inversion")
@@ -876,6 +876,7 @@ Throw away all the old tags, and recreate the tag database."
876 ;; (define-key km "i" 'senator-isearch-toggle-semantic-mode) 876 ;; (define-key km "i" 'senator-isearch-toggle-semantic-mode)
877 (define-key map "\C-c,j" 'semantic-complete-jump-local) 877 (define-key map "\C-c,j" 'semantic-complete-jump-local)
878 (define-key map "\C-c,J" 'semantic-complete-jump) 878 (define-key map "\C-c,J" 'semantic-complete-jump)
879 (define-key map "\C-c,m" 'semantic-complete-jump-local-members)
879 (define-key map "\C-c,g" 'semantic-symref-symbol) 880 (define-key map "\C-c,g" 'semantic-symref-symbol)
880 (define-key map "\C-c,G" 'semantic-symref) 881 (define-key map "\C-c,G" 'semantic-symref)
881 (define-key map "\C-c,p" 'senator-previous-tag) 882 (define-key map "\C-c,p" 'senator-previous-tag)
@@ -886,6 +887,7 @@ Throw away all the old tags, and recreate the tag database."
886 (define-key map "\C-c,\M-w" 'senator-copy-tag) 887 (define-key map "\C-c,\M-w" 'senator-copy-tag)
887 (define-key map "\C-c,\C-y" 'senator-yank-tag) 888 (define-key map "\C-c,\C-y" 'senator-yank-tag)
888 (define-key map "\C-c,r" 'senator-copy-tag-to-register) 889 (define-key map "\C-c,r" 'senator-copy-tag-to-register)
890 (define-key map "\C-c,," 'semantic-force-refresh)
889 (define-key map [?\C-c ?, up] 'senator-transpose-tags-up) 891 (define-key map [?\C-c ?, up] 'senator-transpose-tags-up)
890 (define-key map [?\C-c ?, down] 'senator-transpose-tags-down) 892 (define-key map [?\C-c ?, down] 'senator-transpose-tags-down)
891 (define-key map "\C-c,l" 'semantic-analyze-possible-completions) 893 (define-key map "\C-c,l" 'semantic-analyze-possible-completions)
@@ -951,6 +953,9 @@ Throw away all the old tags, and recreate the tag database."
951 (define-key navigate-menu [semantic-complete-jump] 953 (define-key navigate-menu [semantic-complete-jump]
952 '(menu-item "Find Tag Globally..." semantic-complete-jump 954 '(menu-item "Find Tag Globally..." semantic-complete-jump
953 :help "Read a tag name and find it in the current project")) 955 :help "Read a tag name and find it in the current project"))
956 (define-key navigate-menu [semantic-complete-jump-local-members]
957 '(menu-item "Find Local Members ..." semantic-complete-jump-local-members
958 :help "Read a tag name and find a local member with that name"))
954 (define-key navigate-menu [semantic-complete-jump-local] 959 (define-key navigate-menu [semantic-complete-jump-local]
955 '(menu-item "Find Tag in This Buffer..." semantic-complete-jump-local 960 '(menu-item "Find Tag in This Buffer..." semantic-complete-jump-local
956 :help "Read a tag name and find it in this buffer")) 961 :help "Read a tag name and find it in this buffer"))
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el
index 72e43fe0f82..4009685683b 100644
--- a/lisp/cedet/semantic/analyze.el
+++ b/lisp/cedet/semantic/analyze.el
@@ -253,7 +253,7 @@ Optional argument THROWSYM specifies a symbol the throw on non-recoverable error
253 (tag nil) ; tag return list 253 (tag nil) ; tag return list
254 (tagtype nil) ; tag types return list 254 (tagtype nil) ; tag types return list
255 (fname nil) 255 (fname nil)
256 (miniscope (clone scope)) 256 (miniscope (when scope (clone scope)))
257 ) 257 )
258 ;; First order check. Is this wholely contained in the typecache? 258 ;; First order check. Is this wholely contained in the typecache?
259 (setq tmp (semanticdb-typecache-find sequence)) 259 (setq tmp (semanticdb-typecache-find sequence))
@@ -297,11 +297,12 @@ Optional argument THROWSYM specifies a symbol the throw on non-recoverable error
297 ;; and we can use it directly. 297 ;; and we can use it directly.
298 (cond ((semantic-tag-of-class-p tmp 'type) 298 (cond ((semantic-tag-of-class-p tmp 'type)
299 ;; update the miniscope when we need to analyze types directly. 299 ;; update the miniscope when we need to analyze types directly.
300 (let ((rawscope 300 (when miniscope
301 (apply 'append 301 (let ((rawscope
302 (mapcar 'semantic-tag-type-members 302 (apply 'append
303 tagtype)))) 303 (mapcar 'semantic-tag-type-members
304 (oset miniscope fullscope rawscope)) 304 tagtype))))
305 (oset miniscope fullscope rawscope)))
305 ;; Now analayze the type to remove metatypes. 306 ;; Now analayze the type to remove metatypes.
306 (or (semantic-analyze-type tmp miniscope) 307 (or (semantic-analyze-type tmp miniscope)
307 tmp)) 308 tmp))
@@ -351,7 +352,7 @@ Optional argument SCOPE specifies a scope object which has
351additional tags which are in SCOPE and do not need prefixing to 352additional tags which are in SCOPE and do not need prefixing to
352find. 353find.
353 354
354This is a wrapper on top of semanticdb, semanticdb-typecache, 355This is a wrapper on top of semanticdb, semanticdb typecache,
355semantic-scope, and semantic search functions. Almost all 356semantic-scope, and semantic search functions. Almost all
356searches use the same arguments." 357searches use the same arguments."
357 (let ((namelst (if (consp name) name ;; test if pre-split. 358 (let ((namelst (if (consp name) name ;; test if pre-split.
diff --git a/lisp/cedet/semantic/analyze/complete.el b/lisp/cedet/semantic/analyze/complete.el
index 959bae407b1..7f0c7d8a22a 100644
--- a/lisp/cedet/semantic/analyze/complete.el
+++ b/lisp/cedet/semantic/analyze/complete.el
@@ -63,11 +63,15 @@ Used as options when completing.")
63;;; MAIN completion calculator 63;;; MAIN completion calculator
64;; 64;;
65;;;###autoload 65;;;###autoload
66(define-overloadable-function semantic-analyze-possible-completions (context) 66(define-overloadable-function semantic-analyze-possible-completions (context &rest flags)
67 "Return a list of semantic tags which are possible completions. 67 "Return a list of semantic tags which are possible completions.
68CONTEXT is either a position (such as point), or a precalculated 68CONTEXT is either a position (such as point), or a precalculated
69context. Passing in a context is useful if the caller also needs 69context. Passing in a context is useful if the caller also needs
70to access parts of the analysis. 70to access parts of the analysis.
71The remaining FLAGS arguments are passed to the mode specific completion engine.
72Bad flags should be ignored by modes that don't use them.
73See `semantic-analyze-possible-completions-default' for details on the default FLAGS.
74
71Completions run through the following filters: 75Completions run through the following filters:
72 * Elements currently in scope 76 * Elements currently in scope
73 * Constants currently in scope 77 * Constants currently in scope
@@ -98,9 +102,13 @@ in a buffer."
98 (get-buffer-window "*Possible Completions*"))) 102 (get-buffer-window "*Possible Completions*")))
99 ans))) 103 ans)))
100 104
101(defun semantic-analyze-possible-completions-default (context) 105(defun semantic-analyze-possible-completions-default (context &optional flags)
102 "Default method for producing smart completions. 106 "Default method for producing smart completions.
103Argument CONTEXT is an object specifying the locally derived context." 107Argument CONTEXT is an object specifying the locally derived context.
108The optional argument FLAGS changes which return options are returned.
109FLAGS can be any number of:
110 'no-tc - do not apply data-type constraint.
111 'no-unique - do not apply unique by name filtering."
104 (let* ((a context) 112 (let* ((a context)
105 (desired-type (semantic-analyze-type-constraint a)) 113 (desired-type (semantic-analyze-type-constraint a))
106 (desired-class (oref a prefixclass)) 114 (desired-class (oref a prefixclass))
@@ -109,8 +117,13 @@ Argument CONTEXT is an object specifying the locally derived context."
109 (completetext nil) 117 (completetext nil)
110 (completetexttype nil) 118 (completetexttype nil)
111 (scope (oref a scope)) 119 (scope (oref a scope))
112 (localvar (oref scope localvar)) 120 (localvar (when scope (oref scope localvar)))
113 (c nil)) 121 (origc nil)
122 (c nil)
123 (any nil)
124 (do-typeconstraint (not (memq 'no-tc flags)))
125 (do-unique (not (memq 'no-unique flags)))
126 )
114 127
115 ;; Calculate what our prefix string is so that we can 128 ;; Calculate what our prefix string is so that we can
116 ;; find all our matching text. 129 ;; find all our matching text.
@@ -160,33 +173,36 @@ Argument CONTEXT is an object specifying the locally derived context."
160 ;; Argument list and local variables 173 ;; Argument list and local variables
161 (semantic-find-tags-for-completion completetext localvar) 174 (semantic-find-tags-for-completion completetext localvar)
162 ;; The current scope 175 ;; The current scope
163 (semantic-find-tags-for-completion completetext (oref scope fullscope)) 176 (semantic-find-tags-for-completion completetext (when scope (oref scope fullscope)))
164 ;; The world 177 ;; The world
165 (semantic-analyze-find-tags-by-prefix completetext)) 178 (semantic-analyze-find-tags-by-prefix completetext))
166 ) 179 )
167 ) 180 )
168 181
169 (let ((origc c) 182 (let ((loopc c)
170 (dtname (semantic-tag-name desired-type))) 183 (dtname (semantic-tag-name desired-type)))
171 184
185 ;; Save off our first batch of completions
186 (setq origc c)
187
172 ;; Reset c. 188 ;; Reset c.
173 (setq c nil) 189 (setq c nil)
174 190
175 ;; Loop over all the found matches, and catagorize them 191 ;; Loop over all the found matches, and catagorize them
176 ;; as being possible features. 192 ;; as being possible features.
177 (while origc 193 (while (and loopc do-typeconstraint)
178 194
179 (cond 195 (cond
180 ;; Strip operators 196 ;; Strip operators
181 ((semantic-tag-get-attribute (car origc) :operator-flag) 197 ((semantic-tag-get-attribute (car loopc) :operator-flag)
182 nil 198 nil
183 ) 199 )
184 200
185 ;; If we are completing from within some prefix, 201 ;; If we are completing from within some prefix,
186 ;; then we want to exclude constructors and destructors 202 ;; then we want to exclude constructors and destructors
187 ((and completetexttype 203 ((and completetexttype
188 (or (semantic-tag-get-attribute (car origc) :constructor-flag) 204 (or (semantic-tag-get-attribute (car loopc) :constructor-flag)
189 (semantic-tag-get-attribute (car origc) :destructor-flag))) 205 (semantic-tag-get-attribute (car loopc) :destructor-flag)))
190 nil 206 nil
191 ) 207 )
192 208
@@ -197,17 +213,17 @@ Argument CONTEXT is an object specifying the locally derived context."
197 ;; Ok, we now have a completion list based on the text we found 213 ;; Ok, we now have a completion list based on the text we found
198 ;; we want to complete on. Now filter that stream against the 214 ;; we want to complete on. Now filter that stream against the
199 ;; type we want to search for. 215 ;; type we want to search for.
200 ((string= dtname (semantic-analyze-type-to-name (semantic-tag-type (car origc)))) 216 ((string= dtname (semantic-analyze-type-to-name (semantic-tag-type (car loopc))))
201 (setq c (cons (car origc) c)) 217 (setq c (cons (car loopc) c))
202 ) 218 )
203 219
204 ;; Now anything that is a compound type which could contain 220 ;; Now anything that is a compound type which could contain
205 ;; additional things which are of the desired type 221 ;; additional things which are of the desired type
206 ((semantic-tag-type (car origc)) 222 ((semantic-tag-type (car loopc))
207 (let ((att (semantic-analyze-tag-type (car origc) scope)) 223 (let ((att (semantic-analyze-tag-type (car loopc) scope))
208 ) 224 )
209 (if (and att (semantic-tag-type-members att)) 225 (if (and att (semantic-tag-type-members att))
210 (setq c (cons (car origc) c)))) 226 (setq c (cons (car loopc) c))))
211 ) 227 )
212 228
213 ) ; cond 229 ) ; cond
@@ -215,11 +231,11 @@ Argument CONTEXT is an object specifying the locally derived context."
215 231
216 ;; No desired type, no other restrictions. Just add. 232 ;; No desired type, no other restrictions. Just add.
217 (t 233 (t
218 (setq c (cons (car origc) c))) 234 (setq c (cons (car loopc) c)))
219 235
220 ); cond 236 ); cond
221 237
222 (setq origc (cdr origc))) 238 (setq loopc (cdr loopc)))
223 239
224 (when desired-type 240 (when desired-type
225 ;; Some types, like the enum in C, have special constant values that 241 ;; Some types, like the enum in C, have special constant values that
@@ -241,15 +257,16 @@ Argument CONTEXT is an object specifying the locally derived context."
241 (when desired-class 257 (when desired-class
242 (setq c (semantic-analyze-tags-of-class-list c desired-class))) 258 (setq c (semantic-analyze-tags-of-class-list c desired-class)))
243 259
244 ;; Pull out trash. 260 (if do-unique
245 ;; NOTE TO SELF: Is this too slow? 261 (if c
246 ;; OTHER NOTE: Do we not want to strip duplicates by name and 262 ;; Pull out trash.
247 ;; only by position? When are duplicate by name but not by tag 263 ;; NOTE TO SELF: Is this too slow?
248 ;; useful? 264 (setq c (semantic-unique-tag-table-by-name c))
249 (setq c (semantic-unique-tag-table-by-name c)) 265 (setq c (semantic-unique-tag-table-by-name origc)))
266 (when (not c)
267 (setq c origc)))
250 268
251 ;; All done! 269 ;; All done!
252
253 c)) 270 c))
254 271
255(provide 'semantic/analyze/complete) 272(provide 'semantic/analyze/complete)
diff --git a/lisp/cedet/semantic/analyze/debug.el b/lisp/cedet/semantic/analyze/debug.el
index 1f253214fcb..490b57bf83a 100644
--- a/lisp/cedet/semantic/analyze/debug.el
+++ b/lisp/cedet/semantic/analyze/debug.el
@@ -54,6 +54,8 @@
54 54
55 )) 55 ))
56 56
57;; @TODO - If this happens, but the last found type is
58;; a datatype, then the below is wrong
57(defun semantic-analyzer-debug-found-prefix (ctxt) 59(defun semantic-analyzer-debug-found-prefix (ctxt)
58 "Debug the prefix found by the analyzer output CTXT." 60 "Debug the prefix found by the analyzer output CTXT."
59 (let* ((pf (oref ctxt prefix)) 61 (let* ((pf (oref ctxt prefix))
@@ -97,7 +99,7 @@ Argument COMP are possible completions here."
97 ) 99 )
98 (with-output-to-temp-buffer (help-buffer) 100 (with-output-to-temp-buffer (help-buffer)
99 (with-current-buffer standard-output 101 (with-current-buffer standard-output
100 (princ "Unable to find prefix ") 102 (princ "Unable to find symbol ")
101 (princ prefix) 103 (princ prefix)
102 (princ ".\n\n") 104 (princ ".\n\n")
103 105
@@ -217,7 +219,7 @@ Argument COMP are possible completions here."
217 (when (not dt) (error "Missing Innertype debugger is confused")) 219 (when (not dt) (error "Missing Innertype debugger is confused"))
218 (with-output-to-temp-buffer (help-buffer) 220 (with-output-to-temp-buffer (help-buffer)
219 (with-current-buffer standard-output 221 (with-current-buffer standard-output
220 (princ "Cannot find prefix \"") 222 (princ "Cannot find symbol \"")
221 (princ prefixitem) 223 (princ prefixitem)
222 (princ "\" in datatype: 224 (princ "\" in datatype:
223 ") 225 ")
@@ -550,24 +552,25 @@ PARENT is a possible parent (by nesting) tag."
550 (let ((str (semantic-format-tag-prototype tag parent))) 552 (let ((str (semantic-format-tag-prototype tag parent)))
551 (if (and (semantic-tag-with-position-p tag) 553 (if (and (semantic-tag-with-position-p tag)
552 (semantic-tag-file-name tag)) 554 (semantic-tag-file-name tag))
553 (insert-button str 555 (with-current-buffer standard-output
554 'mouse-face 'custom-button-pressed-face 556 (insert-button str
555 'tag tag 557 'mouse-face 'custom-button-pressed-face
556 'action 558 'tag tag
557 `(lambda (button) 559 'action
558 (let ((buff nil) 560 `(lambda (button)
559 (pnt nil)) 561 (let ((buff nil)
560 (save-excursion 562 (pnt nil))
561 (semantic-go-to-tag 563 (save-excursion
562 (button-get button 'tag)) 564 (semantic-go-to-tag
563 (setq buff (current-buffer)) 565 (button-get button 'tag))
564 (setq pnt (point))) 566 (setq buff (current-buffer))
565 (if (get-buffer-window buff) 567 (setq pnt (point)))
566 (select-window (get-buffer-window buff)) 568 (if (get-buffer-window buff)
567 (pop-to-buffer buff t)) 569 (select-window (get-buffer-window buff))
568 (goto-char pnt) 570 (pop-to-buffer buff t))
569 (pulse-line-hook-function))) 571 (goto-char pnt)
570 ) 572 (pulse-line-hook-function)))
573 ))
571 (princ "\"") 574 (princ "\"")
572 (princ str) 575 (princ str)
573 (princ "\"")) 576 (princ "\""))
diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el
index 0ccde88ff4a..ec903f0afcc 100644
--- a/lisp/cedet/semantic/analyze/refs.el
+++ b/lisp/cedet/semantic/analyze/refs.el
@@ -104,6 +104,7 @@ Use `semantic-analyze-current-tag' to debug this fcn."
104 "Return the implementations derived in the reference analyzer REFS. 104 "Return the implementations derived in the reference analyzer REFS.
105Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer." 105Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer."
106 (let ((allhits (oref refs rawsearchdata)) 106 (let ((allhits (oref refs rawsearchdata))
107 (tag (oref refs :tag))
107 (impl nil) 108 (impl nil)
108 ) 109 )
109 (semanticdb-find-result-mapc 110 (semanticdb-find-result-mapc
@@ -113,7 +114,8 @@ Optional argument IN-BUFFER indicates that the returned tag should be in an acti
113 (aT (cdr ans)) 114 (aT (cdr ans))
114 (aDB (car ans)) 115 (aDB (car ans))
115 ) 116 )
116 (when (not (semantic-tag-prototype-p aT)) 117 (when (and (not (semantic-tag-prototype-p aT))
118 (semantic-tag-similar-p tag aT :prototype-flag :parent))
117 (when in-buffer (save-excursion (semantic-go-to-tag aT aDB))) 119 (when in-buffer (save-excursion (semantic-go-to-tag aT aDB)))
118 (push aT impl)))) 120 (push aT impl))))
119 allhits) 121 allhits)
@@ -123,6 +125,7 @@ Optional argument IN-BUFFER indicates that the returned tag should be in an acti
123 "Return the prototypes derived in the reference analyzer REFS. 125 "Return the prototypes derived in the reference analyzer REFS.
124Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer." 126Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer."
125 (let ((allhits (oref refs rawsearchdata)) 127 (let ((allhits (oref refs rawsearchdata))
128 (tag (oref refs :tag))
126 (proto nil)) 129 (proto nil))
127 (semanticdb-find-result-mapc 130 (semanticdb-find-result-mapc
128 (lambda (T DB) 131 (lambda (T DB)
@@ -131,7 +134,8 @@ Optional argument IN-BUFFER indicates that the returned tag should be in an acti
131 (aT (cdr ans)) 134 (aT (cdr ans))
132 (aDB (car ans)) 135 (aDB (car ans))
133 ) 136 )
134 (when (semantic-tag-prototype-p aT) 137 (when (and (semantic-tag-prototype-p aT)
138 (semantic-tag-similar-p tag aT :prototype-flag :parent))
135 (when in-buffer (save-excursion (semantic-go-to-tag aT aDB))) 139 (when in-buffer (save-excursion (semantic-go-to-tag aT aDB)))
136 (push aT proto)))) 140 (push aT proto))))
137 allhits) 141 allhits)
@@ -142,8 +146,8 @@ Optional argument IN-BUFFER indicates that the returned tag should be in an acti
142(defun semantic--analyze-refs-full-lookup (tag scope) 146(defun semantic--analyze-refs-full-lookup (tag scope)
143 "Perform a full lookup for all occurrences of TAG in the current project. 147 "Perform a full lookup for all occurrences of TAG in the current project.
144TAG should be the tag currently under point. 148TAG should be the tag currently under point.
145PARENT is the list of tags that are parents to TAG by 149SCOPE is the scope the cursor is in. From this a list of parents is
146containment, as opposed to reference." 150derived. If SCOPE does not have parents, then only a simple lookup is done."
147 (if (not (oref scope parents)) 151 (if (not (oref scope parents))
148 ;; If this tag has some named parent, but is not 152 ;; If this tag has some named parent, but is not
149 (semantic--analyze-refs-full-lookup-simple tag) 153 (semantic--analyze-refs-full-lookup-simple tag)
@@ -177,20 +181,36 @@ CLASS is the class of the tag that ought to be returned."
177 ans)) 181 ans))
178 182
179(defun semantic--analyze-refs-find-tags-with-parent (find-results parents) 183(defun semantic--analyze-refs-find-tags-with-parent (find-results parents)
180 "Find in FIND-RESULTS all tags with PARNTS. 184 "Find in FIND-RESULTS all tags with PARENTS.
181NAME is the name of the tag needing finding. 185NAME is the name of the tag needing finding.
182PARENTS is a list of names." 186PARENTS is a list of names."
183 (let ((ans nil)) 187 (let ((ans nil) (usingnames nil))
188 ;; Loop over the find-results passed in.
184 (semanticdb-find-result-mapc 189 (semanticdb-find-result-mapc
185 (lambda (tag db) 190 (lambda (tag db)
186 (let* ((p (semantic-tag-named-parent tag)) 191 (let* ((p (semantic-tag-named-parent tag))
187 (ps (when (stringp p) 192 (ps (when (stringp p) (semantic-analyze-split-name p))))
188 (semantic-analyze-split-name p))))
189 (when (stringp ps) (setq ps (list ps))) 193 (when (stringp ps) (setq ps (list ps)))
190 (when (and ps (equal ps parents)) 194 (when ps
191 ;; We could optimize this, but it seems unlikely. 195 ;; If there is a perfect match, then use it.
192 (push (list db tag) ans)) 196 (if (equal ps parents)
193 )) 197 (push (list db tag) ans))
198 ;; No match, find something from our list of using names.
199 ;; Do we need to split UN?
200 (save-excursion
201 (semantic-go-to-tag tag db)
202 (setq usingnames nil)
203 (let ((imports (semantic-ctxt-imported-packages)))
204 ;; Derive the names from all the using statements.
205 (mapc (lambda (T)
206 (setq usingnames
207 (cons (semantic-format-tag-name-from-anything T) usingnames)))
208 imports))
209 (dolist (UN usingnames)
210 (when (equal (cons UN ps) parents)
211 (push (list db tag) ans)
212 (setq usingnames (cdr usingnames))))
213 ))))
194 find-results) 214 find-results)
195 ans)) 215 ans))
196 216
@@ -206,7 +226,7 @@ TAG should be the tag currently under point."
206 ;; Find all hits for the first parent name. 226 ;; Find all hits for the first parent name.
207 (brute (semanticdb-find-tags-collector 227 (brute (semanticdb-find-tags-collector
208 (lambda (table tags) 228 (lambda (table tags)
209 (semanticdb-find-tags-by-name-method table name tags) 229 (semanticdb-deep-find-tags-by-name-method table name tags)
210 ) 230 )
211 nil nil t)) 231 nil nil t))
212 ;; Prime the answer. 232 ;; Prime the answer.
@@ -214,6 +234,7 @@ TAG should be the tag currently under point."
214 ) 234 )
215 ;; First parent is already search to initialize "brute". 235 ;; First parent is already search to initialize "brute".
216 (setq plist (cdr plist)) 236 (setq plist (cdr plist))
237
217 ;; Go through the list of parents, and try to find matches. 238 ;; Go through the list of parents, and try to find matches.
218 ;; As we cycle through plist, for each level look for NAME, 239 ;; As we cycle through plist, for each level look for NAME,
219 ;; and compare the named-parent, and also dive into the next item of 240 ;; and compare the named-parent, and also dive into the next item of
@@ -253,7 +274,8 @@ Only works for tags in the global namespace."
253 (lambda (table tags) 274 (lambda (table tags)
254 (semanticdb-find-tags-by-name-method table name tags) 275 (semanticdb-find-tags-by-name-method table name tags)
255 ) 276 )
256 nil nil t)) 277 nil ;; This may need to be the entire project??
278 nil t))
257 ) 279 )
258 280
259 (when (and (not brute) (not noerror)) 281 (when (and (not brute) (not noerror))
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index aab87f7eb25..03d370401af 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -39,6 +39,7 @@
39(declare-function semantic-brute-find-tag-by-attribute "semantic/find") 39(declare-function semantic-brute-find-tag-by-attribute "semantic/find")
40(declare-function semanticdb-minor-mode-p "semantic/db-mode") 40(declare-function semanticdb-minor-mode-p "semantic/db-mode")
41(declare-function semanticdb-needs-refresh-p "semantic/db") 41(declare-function semanticdb-needs-refresh-p "semantic/db")
42(declare-function semanticdb-typecache-faux-namespace "semantic/db-typecache")
42(declare-function c-forward-conditional "cc-cmds") 43(declare-function c-forward-conditional "cc-cmds")
43(declare-function ede-system-include-path "ede") 44(declare-function ede-system-include-path "ede")
44 45
@@ -158,7 +159,7 @@ part of the preprocessor map.")
158Each entry is a cons cell like this: 159Each entry is a cons cell like this:
159 ( \"KEYWORD\" . \"REPLACEMENT\" ) 160 ( \"KEYWORD\" . \"REPLACEMENT\" )
160Where KEYWORD is the macro that gets replaced in the lexical phase, 161Where KEYWORD is the macro that gets replaced in the lexical phase,
161and REPLACEMENT is a string that is inserted in it's place. Empty string 162and REPLACEMENT is a string that is inserted in its place. Empty string
162implies that the lexical analyzer will discard KEYWORD when it is encountered. 163implies that the lexical analyzer will discard KEYWORD when it is encountered.
163 164
164Alternately, it can be of the form: 165Alternately, it can be of the form:
@@ -295,6 +296,7 @@ Moves completely over balanced #if blocks."
295 (cond 296 (cond
296 ((looking-at "^\\s-*#\\s-*if") 297 ((looking-at "^\\s-*#\\s-*if")
297 ;; We found a nested if. Skip it. 298 ;; We found a nested if. Skip it.
299 ;; @TODO - can we use the new c-scan-conditionals
298 (c-forward-conditional 1)) 300 (c-forward-conditional 1))
299 ((looking-at "^\\s-*#\\s-*elif") 301 ((looking-at "^\\s-*#\\s-*elif")
300 ;; We need to let the preprocessor analize this one. 302 ;; We need to let the preprocessor analize this one.
@@ -348,7 +350,6 @@ Uses known macro tables in SPP to determine what block to skip."
348 ;; (message "%s %s yes" ift sym) 350 ;; (message "%s %s yes" ift sym)
349 (beginning-of-line) 351 (beginning-of-line)
350 (setq pt (point)) 352 (setq pt (point))
351 ;;(c-forward-conditional 1)
352 ;; This skips only a section of a conditional. Once that section 353 ;; This skips only a section of a conditional. Once that section
353 ;; is opened, encountering any new #else or related conditional 354 ;; is opened, encountering any new #else or related conditional
354 ;; should be skipped. 355 ;; should be skipped.
@@ -356,8 +357,8 @@ Uses known macro tables in SPP to determine what block to skip."
356 (setq semantic-lex-end-point (point)) 357 (setq semantic-lex-end-point (point))
357 (semantic-push-parser-warning (format "Skip #%s %s" ift sym) 358 (semantic-push-parser-warning (format "Skip #%s %s" ift sym)
358 pt (point)) 359 pt (point))
359;; (semantic-lex-push-token 360 ;; (semantic-lex-push-token
360;; (semantic-lex-token 'c-preprocessor-skip pt (point))) 361 ;; (semantic-lex-token 'c-preprocessor-skip pt (point)))
361 nil) 362 nil)
362 ;; Else, don't ignore it, but do handle the internals. 363 ;; Else, don't ignore it, but do handle the internals.
363 ;;(message "%s %s no" ift sym) 364 ;;(message "%s %s no" ift sym)
@@ -703,58 +704,60 @@ the regular parser."
703 (symtext (semantic-lex-token-text lexicaltoken)) 704 (symtext (semantic-lex-token-text lexicaltoken))
704 (macros (get-text-property 0 'macros symtext)) 705 (macros (get-text-property 0 'macros symtext))
705 ) 706 )
706 (with-current-buffer buf 707 (if (> semantic-c-parse-token-hack-depth 5)
707 (erase-buffer) 708 nil
708 (when (not (eq major-mode mode)) 709 (with-current-buffer buf
709 (save-match-data 710 (erase-buffer)
710 711 (when (not (eq major-mode mode))
711 ;; Protect against user hooks throwing errors. 712 (save-match-data
712 (condition-case nil 713
713 (funcall mode) 714 ;; Protect against user hooks throwing errors.
714 (error 715 (condition-case nil
715 (if (y-or-n-p 716 (funcall mode)
716 (format "There was an error initializing %s in buffer \"%s\". Debug your hooks? " 717 (error
717 mode (buffer-name))) 718 (if (y-or-n-p
718 (semantic-c-debug-mode-init mode) 719 (format "There was an error initializing %s in buffer \"%s\". Debug your hooks? "
719 (message "Macro parsing state may be broken...") 720 mode (buffer-name)))
720 (sit-for 1)))) 721 (semantic-c-debug-mode-init mode)
721 ) ; save match data 722 (message "Macro parsing state may be broken...")
722 723 (sit-for 1))))
723 ;; Hack in mode-local 724 ) ; save match data
724 (activate-mode-local-bindings) 725
725 ;; CHEATER! The following 3 lines are from 726 ;; Hack in mode-local
726 ;; `semantic-new-buffer-fcn', but we don't want to turn 727 (activate-mode-local-bindings)
727 ;; on all the other annoying modes for this little task. 728 ;; CHEATER! The following 3 lines are from
728 (setq semantic-new-buffer-fcn-was-run t) 729 ;; `semantic-new-buffer-fcn', but we don't want to turn
729 (semantic-lex-init) 730 ;; on all the other annoying modes for this little task.
730 (semantic-clear-toplevel-cache) 731 (setq semantic-new-buffer-fcn-was-run t)
731 (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook 732 (semantic-lex-init)
732 t) 733 (semantic-clear-toplevel-cache)
733 ) 734 (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
734 ;; Get the macro symbol table right. 735 t)
735 (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms) 736 )
736 ;; (message "%S" macros) 737 ;; Get the macro symbol table right.
737 (dolist (sym macros) 738 (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms)
738 (semantic-lex-spp-symbol-set (car sym) (cdr sym))) 739 ;; (message "%S" macros)
739 740 (dolist (sym macros)
740 (insert symtext) 741 (semantic-lex-spp-symbol-set (car sym) (cdr sym)))
741 742
742 (setq stream 743 (insert symtext)
743 (semantic-parse-region-default 744
744 (point-min) (point-max) nonterminal depth returnonerror)) 745 (setq stream
745 746 (semantic-parse-region-default
746 ;; Clean up macro symbols 747 (point-min) (point-max) nonterminal depth returnonerror))
747 (dolist (sym macros) 748
748 (semantic-lex-spp-symbol-remove (car sym))) 749 ;; Clean up macro symbols
749 750 (dolist (sym macros)
750 ;; Convert the text of the stream. 751 (semantic-lex-spp-symbol-remove (car sym)))
751 (dolist (tag stream) 752
752 ;; Only do two levels here 'cause I'm lazy. 753 ;; Convert the text of the stream.
753 (semantic--tag-set-overlay tag (list start end)) 754 (dolist (tag stream)
754 (dolist (stag (semantic-tag-components-with-overlays tag)) 755 ;; Only do two levels here 'cause I'm lazy.
755 (semantic--tag-set-overlay stag (list start end)) 756 (semantic--tag-set-overlay tag (list start end))
756 )) 757 (dolist (stag (semantic-tag-components-with-overlays tag))
757 ) 758 (semantic--tag-set-overlay stag (list start end))
759 ))
760 ))
758 stream)) 761 stream))
759 762
760(defvar semantic-c-debug-mode-init-last-mode nil 763(defvar semantic-c-debug-mode-init-last-mode nil
@@ -920,8 +923,34 @@ now.
920 ;; of type "typedef". 923 ;; of type "typedef".
921 ;; Each elt of NAME is ( STARS NAME ) 924 ;; Each elt of NAME is ( STARS NAME )
922 (let ((vl nil) 925 (let ((vl nil)
923 (names (semantic-tag-name tag))) 926 (names (semantic-tag-name tag))
927 (super (semantic-tag-get-attribute tag :superclasses))
928 (addlast nil))
929
930 (when (and (semantic-tag-of-type-p tag "typedef")
931 (semantic-tag-of-class-p super 'type)
932 (semantic-tag-type-members super))
933 ;; This is a typedef of a real type. Extract
934 ;; the super class, and stick it into the tags list.
935 (setq addlast super)
936
937 ;; Clone super and remove the members IFF super has a name.
938 ;; Note: anonymous struct/enums that are typedef'd shouldn't
939 ;; exist in the top level type list, so they will appear only
940 ;; in the :typedef slot of the typedef.
941 (setq super (semantic-tag-clone super))
942 (if (not (string= (semantic-tag-name super) ""))
943 (semantic-tag-put-attribute super :members nil)
944 (setq addlast nil))
945
946 ;; Add in props to the full superclass.
947 (when addlast
948 (semantic--tag-copy-properties tag addlast)
949 (semantic--tag-set-overlay addlast (semantic-tag-overlay tag)))
950 )
951
924 (while names 952 (while names
953
925 (setq vl (cons (semantic-tag-new-type 954 (setq vl (cons (semantic-tag-new-type
926 (nth 1 (car names)) ; name 955 (nth 1 (car names)) ; name
927 "typedef" 956 "typedef"
@@ -938,16 +967,18 @@ now.
938 ;; is expanded out as. Just the 967 ;; is expanded out as. Just the
939 ;; name shows up as a parent of this 968 ;; name shows up as a parent of this
940 ;; typedef. 969 ;; typedef.
941 :typedef 970 :typedef super
942 (semantic-tag-get-attribute tag :superclasses)
943 ;;(semantic-tag-type-superclasses tag) 971 ;;(semantic-tag-type-superclasses tag)
944 :documentation 972 :documentation
945 (semantic-tag-docstring tag)) 973 (semantic-tag-docstring tag))
946 vl)) 974 vl))
947 (semantic--tag-copy-properties tag (car vl)) 975 (semantic--tag-copy-properties tag (car vl))
948 (semantic--tag-set-overlay (car vl) 976 (semantic--tag-set-overlay (car vl) (semantic-tag-overlay tag))
949 (semantic-tag-overlay tag))
950 (setq names (cdr names))) 977 (setq names (cdr names)))
978
979 ;; Add typedef superclass last.
980 (when addlast (setq vl (cons addlast vl)))
981
951 vl)) 982 vl))
952 ((and (listp (car tag)) 983 ((and (listp (car tag))
953 (semantic-tag-of-class-p (car tag) 'variable)) 984 (semantic-tag-of-class-p (car tag) 'variable))
@@ -999,6 +1030,7 @@ Optional argument STAR and REF indicate the number of * and & in the typedef."
999 (car tokenpart))) 1030 (car tokenpart)))
1000 (and (stringp (car (nth 2 tokenpart))) 1031 (and (stringp (car (nth 2 tokenpart)))
1001 (string= (car (nth 2 tokenpart)) (car tokenpart))) 1032 (string= (car (nth 2 tokenpart)) (car tokenpart)))
1033 (nth 10 tokenpart) ; initializers
1002 ) 1034 )
1003 (not (car (nth 3 tokenpart))))) 1035 (not (car (nth 3 tokenpart)))))
1004 (fcnpointer (string-match "^\\*" (car tokenpart))) 1036 (fcnpointer (string-match "^\\*" (car tokenpart)))
@@ -1029,7 +1061,10 @@ Optional argument STAR and REF indicate the number of * and & in the typedef."
1029 (semantic-tag-new-type 1061 (semantic-tag-new-type
1030 ;; name 1062 ;; name
1031 (or (car semantic-c-classname) 1063 (or (car semantic-c-classname)
1032 (car (nth 2 tokenpart))) 1064 (let ((split (semantic-analyze-split-name-c-mode
1065 (car (nth 2 tokenpart)))))
1066 (if (stringp split) split
1067 (car (last split)))))
1033 ;; type 1068 ;; type
1034 (or (cdr semantic-c-classname) 1069 (or (cdr semantic-c-classname)
1035 "class") 1070 "class")
@@ -1580,6 +1615,48 @@ DO NOT return the list of tags encompassing point."
1580 tagreturn 1615 tagreturn
1581 )) 1616 ))
1582 1617
1618(define-mode-local-override semantic-ctxt-imported-packages c++-mode (&optional point)
1619 "Return the list of using tag types in scope of POINT."
1620 (when point (goto-char (point)))
1621 (let ((tagsaroundpoint (semantic-find-tag-by-overlay))
1622 (namereturn nil)
1623 (tmp nil)
1624 )
1625 ;; Collect using statements from the top level.
1626 (setq tmp (semantic-find-tags-by-class 'using (current-buffer)))
1627 (dolist (T tmp) (setq namereturn (cons (semantic-tag-type T) namereturn)))
1628 ;; Move through the tags around point looking for more using statements
1629 (while (cdr tagsaroundpoint) ; don't search the last one
1630 (setq tmp (semantic-find-tags-by-class 'using (semantic-tag-components (car tagsaroundpoint))))
1631 (dolist (T tmp) (setq namereturn (cons (semantic-tag-type T) namereturn)))
1632 (setq tagsaroundpoint (cdr tagsaroundpoint))
1633 )
1634 namereturn))
1635
1636(define-mode-local-override semanticdb-expand-nested-tag c++-mode (tag)
1637 "Expand TAG if it has a fully qualified name.
1638For types with a :parent, create faux namespaces to put TAG into."
1639 (let ((p (semantic-tag-get-attribute tag :parent)))
1640 (if (and p (semantic-tag-of-class-p tag 'type))
1641 ;; Expand the tag
1642 (let ((s (semantic-analyze-split-name p))
1643 (newtag (semantic-tag-copy tag nil t)))
1644 ;; Erase the qualified name.
1645 (semantic-tag-put-attribute newtag :parent nil)
1646 ;; Fixup the namespace name
1647 (setq s (if (stringp s) (list s) (nreverse s)))
1648 ;; Loop over all the parents, creating the nested
1649 ;; namespace.
1650 (require 'semantic/db-typecache)
1651 (dolist (namespace s)
1652 (setq newtag (semanticdb-typecache-faux-namespace
1653 namespace (list newtag)))
1654 )
1655 ;; Return the last created namespace.
1656 newtag)
1657 ;; Else, return tag unmodified.
1658 tag)))
1659
1583(define-mode-local-override semantic-get-local-variables c++-mode () 1660(define-mode-local-override semantic-get-local-variables c++-mode ()
1584 "Do what `semantic-get-local-variables' does, plus add `this' if needed." 1661 "Do what `semantic-get-local-variables' does, plus add `this' if needed."
1585 (let* ((origvar (semantic-get-local-variables-default)) 1662 (let* ((origvar (semantic-get-local-variables-default))
@@ -1759,7 +1836,9 @@ DO NOT return the list of tags encompassing point."
1759 (princ "\n") 1836 (princ "\n")
1760 )) 1837 ))
1761 1838
1762 (when (arrayp semantic-lex-spp-project-macro-symbol-obarray) 1839 (when (and (boundp 'ede-object)
1840 ede-object
1841 (arrayp semantic-lex-spp-project-macro-symbol-obarray))
1763 (princ "\n Project symbol map:\n") 1842 (princ "\n Project symbol map:\n")
1764 (when (and (boundp 'ede-object) ede-object) 1843 (when (and (boundp 'ede-object) ede-object)
1765 (princ " Your project symbol map is derived from the EDE object:\n ") 1844 (princ " Your project symbol map is derived from the EDE object:\n ")
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index d72b12083a0..1f8ee260ade 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -1206,6 +1206,27 @@ Uses semanticdb for searching all tags in the current project."
1206 (require 'semantic/db-find) 1206 (require 'semantic/db-find)
1207 (semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path))) 1207 (semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path)))
1208 1208
1209;;; Current Datatype member search.
1210(defclass semantic-collector-local-members (semantic-collector-project-abstract)
1211 ((scope :initform nil
1212 :type (or null semantic-scope-cache)
1213 :documentation
1214 "The scope the local members are being completed from."))
1215 "Completion engine for tags in a project.")
1216
1217(defmethod semantic-collector-calculate-completions-raw
1218 ((obj semantic-collector-local-members) prefix completionlist)
1219 "Calculate the completions for prefix from completionlist."
1220 (let* ((scope (or (oref obj scope)
1221 (oset obj scope (semantic-calculate-scope))))
1222 (localstuff (oref scope scope)))
1223 (list
1224 (cons
1225 (oref scope :table)
1226 (semantic-find-tags-for-completion prefix localstuff)))))
1227 ;(semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path))))
1228
1229;;; Smart completion collector
1209(defclass semantic-collector-analyze-completions (semantic-collector-abstract) 1230(defclass semantic-collector-analyze-completions (semantic-collector-abstract)
1210 ((context :initarg :context 1231 ((context :initarg :context
1211 :type semantic-analyze-context 1232 :type semantic-analyze-context
@@ -1800,6 +1821,28 @@ HISTORY is a symbol representing a variable to store the history in."
1800 history) 1821 history)
1801 ) 1822 )
1802 1823
1824(defun semantic-complete-read-tag-local-members (prompt &optional
1825 default-tag
1826 initial-input
1827 history)
1828 "Ask for a tag by name from the local type members.
1829Available tags are from the the current scope.
1830Completion options are presented in a traditional way, with highlighting
1831to resolve same-name collisions.
1832PROMPT is a string to prompt with.
1833DEFAULT-TAG is a semantic tag or string to use as the default value.
1834If INITIAL-INPUT is non-nil, insert it in the minibuffer initially.
1835HISTORY is a symbol representing a variable to store the history in."
1836 (semantic-complete-read-tag-engine
1837 (semantic-collector-local-members prompt :buffer (current-buffer))
1838 (semantic-displayor-traditional-with-focus-highlight "simple")
1839 ;;(semantic-displayor-tooltip "simple")
1840 prompt
1841 default-tag
1842 initial-input
1843 history)
1844 )
1845
1803(defun semantic-complete-read-tag-project (prompt &optional 1846(defun semantic-complete-read-tag-project (prompt &optional
1804 default-tag 1847 default-tag
1805 initial-input 1848 initial-input
@@ -1979,7 +2022,7 @@ completion works."
1979 2022
1980;;;###autoload 2023;;;###autoload
1981(defun semantic-complete-jump-local () 2024(defun semantic-complete-jump-local ()
1982 "Jump to a semantic symbol." 2025 "Jump to a local semantic symbol."
1983 (interactive) 2026 (interactive)
1984 (let ((tag (semantic-complete-read-tag-buffer-deep "Jump to symbol: "))) 2027 (let ((tag (semantic-complete-read-tag-buffer-deep "Jump to symbol: ")))
1985 (when (semantic-tag-p tag) 2028 (when (semantic-tag-p tag)
@@ -2005,6 +2048,23 @@ completion works."
2005 (semantic-tag-name tag))))) 2048 (semantic-tag-name tag)))))
2006 2049
2007;;;###autoload 2050;;;###autoload
2051(defun semantic-complete-jump-local-members ()
2052 "Jump to a semantic symbol."
2053 (interactive)
2054 (let* ((tag (semantic-complete-read-tag-local-members "Jump to symbol: ")))
2055 (when (semantic-tag-p tag)
2056 (let ((start (condition-case nil (semantic-tag-start tag)
2057 (error nil))))
2058 (unless start
2059 (error "Tag %s has no location" (semantic-format-tag-prototype tag)))
2060 (push-mark)
2061 (goto-char start)
2062 (semantic-momentary-highlight-tag tag)
2063 (message "%S: %s "
2064 (semantic-tag-class tag)
2065 (semantic-tag-name tag))))))
2066
2067;;;###autoload
2008(defun semantic-complete-analyze-and-replace () 2068(defun semantic-complete-analyze-and-replace ()
2009 "Perform prompt completion to do in buffer completion. 2069 "Perform prompt completion to do in buffer completion.
2010`semantic-analyze-possible-completions' is used to determine the 2070`semantic-analyze-possible-completions' is used to determine the
@@ -2075,15 +2135,17 @@ use `semantic-complete-analyze-inline' to complete."
2075 2135
2076 ;; Prepare for doing completion, but exit quickly if there is keyboard 2136 ;; Prepare for doing completion, but exit quickly if there is keyboard
2077 ;; input. 2137 ;; input.
2078 (when (and (not (semantic-exit-on-input 'csi 2138 (when (save-window-excursion
2079 (semantic-fetch-tags) 2139 (save-excursion
2080 (semantic-throw-on-input 'csi) 2140 (and (not (semantic-exit-on-input 'csi
2081 nil)) 2141 (semantic-fetch-tags)
2082 (= arg 1) 2142 (semantic-throw-on-input 'csi)
2083 (not (semantic-exit-on-input 'csi 2143 nil))
2084 (semantic-analyze-current-context) 2144 (= arg 1)
2085 (semantic-throw-on-input 'csi) 2145 (not (semantic-exit-on-input 'csi
2086 nil))) 2146 (semantic-analyze-current-context)
2147 (semantic-throw-on-input 'csi)
2148 nil)))))
2087 (condition-case nil 2149 (condition-case nil
2088 (semantic-complete-analyze-inline) 2150 (semantic-complete-analyze-inline)
2089 ;; Ignore errors. Seems likely that we'll get some once in a while. 2151 ;; Ignore errors. Seems likely that we'll get some once in a while.
diff --git a/lisp/cedet/semantic/ctxt.el b/lisp/cedet/semantic/ctxt.el
index 3561bc7bea1..b158adffc14 100644
--- a/lisp/cedet/semantic/ctxt.el
+++ b/lisp/cedet/semantic/ctxt.el
@@ -599,12 +599,18 @@ that may or may not have a name.)")
599 "Return a list of scoped types by name for the current context at POINT. 599 "Return a list of scoped types by name for the current context at POINT.
600This is very different for various languages, and does nothing unless 600This is very different for various languages, and does nothing unless
601overridden." 601overridden."
602 (if point (goto-char point)) 602 nil)
603 (let ((case-fold-search semantic-case-fold)) 603
604 ;; We need to look at TYPES within the bounds of locally parse arguments. 604(define-overloadable-function semantic-ctxt-imported-packages (&optional point)
605 ;; C needs to find using statements and the like too. Bleh. 605 "Return a list of package tags or names which are being imported at POINT.
606 nil 606The return value is a list of strings which are package names
607 )) 607that are implied in code. Thus a C++ symbol:
608 foo::bar();
609where there is a statement such as:
610 using baz;
611means that the first symbol might be:
612 baz::foo::bar();"
613 nil)
608 614
609(provide 'semantic/ctxt) 615(provide 'semantic/ctxt)
610 616
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el
index 95d634920b5..3c96290cc93 100644
--- a/lisp/cedet/semantic/db-file.el
+++ b/lisp/cedet/semantic/db-file.el
@@ -245,7 +245,7 @@ If DB is not specified, then use the current database."
245 ;; @todo - It should ask if we are not called from a hook. 245 ;; @todo - It should ask if we are not called from a hook.
246 ;; How? 246 ;; How?
247 (if (or supress-questions 247 (if (or supress-questions
248 (y-or-n-p (format "Skip Error: %S ?" (car (cdr foo))))) 248 (y-or-n-p (format "Skip Error: %s ?" (car (cdr foo)))))
249 (message "Save Error: %S: %s" (car (cdr foo)) 249 (message "Save Error: %S: %s" (car (cdr foo))
250 objname) 250 objname)
251 (error "%S" (car (cdr foo)))))))) 251 (error "%S" (car (cdr foo))))))))
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index 4c2626ca8bd..b266fc8bdfc 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -202,7 +202,7 @@ This class will cache data derived during various searches.")
202 (when (oref idx type-cache) 202 (when (oref idx type-cache)
203 (semantic-reset (oref idx type-cache))) 203 (semantic-reset (oref idx type-cache)))
204 ;; Clear the scope. Scope doesn't have the data it needs to track 204 ;; Clear the scope. Scope doesn't have the data it needs to track
205 ;; it's own reset. 205 ;; its own reset.
206 (semantic-scope-reset-cache) 206 (semantic-scope-reset-cache)
207 ) 207 )
208 208
@@ -262,13 +262,13 @@ This class will cache data derived during various searches.")
262 "Translate PATH into a list of semantic tables. 262 "Translate PATH into a list of semantic tables.
263Path translation involves identifying the PATH input argument 263Path translation involves identifying the PATH input argument
264in one of the following ways: 264in one of the following ways:
265 nil - Take the current buffer, and use it's include list 265 nil - Take the current buffer, and use its include list
266 buffer - Use that buffer's include list. 266 buffer - Use that buffer's include list.
267 filename - Use that file's include list. If the file is not 267 filename - Use that file's include list. If the file is not
268 in a buffer, see of there is a semanticdb table for it. If 268 in a buffer, see of there is a semanticdb table for it. If
269 not, read that file into a buffer. 269 not, read that file into a buffer.
270 tag - Get that tag's buffer of file file. See above. 270 tag - Get that tag's buffer of file file. See above.
271 table - Search that table, and it's include list. 271 table - Search that table, and its include list.
272 find result - Search the results of a previous find. 272 find result - Search the results of a previous find.
273 273
274In addition, once the base path is found, there is the possibility of 274In addition, once the base path is found, there is the possibility of
@@ -1006,9 +1006,14 @@ is still made current."
1006 (when norm 1006 (when norm
1007 ;; The normalized tags can now be found based on that 1007 ;; The normalized tags can now be found based on that
1008 ;; tags table. 1008 ;; tags table.
1009 (semanticdb-set-buffer (car norm)) 1009 (condition-case foo
1010 ;; Now reset ans 1010 (progn
1011 (setq ans (cdr norm)) 1011 (semanticdb-set-buffer (car norm))
1012 ;; Now reset ans
1013 (setq ans (cdr norm)))
1014 ;; Don't error for this case, but don't store
1015 ;; the thing either.
1016 (no-method-definition nil))
1012 )) 1017 ))
1013 ) 1018 )
1014 ;; Return the tag. 1019 ;; Return the tag.
@@ -1019,10 +1024,10 @@ is still made current."
1019FCN takes two arguments. The first is a TAG, and the 1024FCN takes two arguments. The first is a TAG, and the
1020second is a DB from whence TAG originated. 1025second is a DB from whence TAG originated.
1021Returns result." 1026Returns result."
1022 (mapc (lambda (sublst) 1027 (mapc (lambda (sublst-icky)
1023 (mapc (lambda (tag) 1028 (mapc (lambda (tag-icky)
1024 (funcall fcn tag (car sublst))) 1029 (funcall fcn tag-icky (car sublst-icky)))
1025 (cdr sublst))) 1030 (cdr sublst-icky)))
1026 result) 1031 result)
1027 result) 1032 result)
1028 1033
diff --git a/lisp/cedet/semantic/db-global.el b/lisp/cedet/semantic/db-global.el
index 444efbd17e0..3d827b9ede0 100644
--- a/lisp/cedet/semantic/db-global.el
+++ b/lisp/cedet/semantic/db-global.el
@@ -93,7 +93,7 @@ if optional DONT-ERR-IF-NOT-AVAILABLE is non-nil; else throw an error."
93 '(omniscience)) 93 '(omniscience))
94 ) 94 )
95 (if dont-err-if-not-available 95 (if dont-err-if-not-available
96 (message "No Global support in %s" default-directory) 96 nil; (message "No Global support in %s" default-directory)
97 (error "No Global support in %s" default-directory)) 97 (error "No Global support in %s" default-directory))
98 )) 98 ))
99 99
diff --git a/lisp/cedet/semantic/db-typecache.el b/lisp/cedet/semantic/db-typecache.el
index d7c4f0a5abd..71b15fdf82a 100644
--- a/lisp/cedet/semantic/db-typecache.el
+++ b/lisp/cedet/semantic/db-typecache.el
@@ -217,6 +217,14 @@ Adds a filename and copies the tags."
217 (semanticdb-full-filename table) 217 (semanticdb-full-filename table)
218 tags)) 218 tags))
219 219
220(defun semanticdb-typecache-faux-namespace (name members)
221 "Create a new namespace tag with NAME and a set of MEMBERS.
222The new tag will be a faux tag, used as a placeholder in a typecache."
223 (let ((tag (semantic-tag-new-type name "namespace" members nil)))
224 ;; Make sure we mark this as a fake tag.
225 (semantic-tag-set-faux tag)
226 tag))
227
220(defun semanticdb-typecache-merge-streams (cache1 cache2) 228(defun semanticdb-typecache-merge-streams (cache1 cache2)
221 "Merge into CACHE1 and CACHE2 together. The Caches will be merged in place." 229 "Merge into CACHE1 and CACHE2 together. The Caches will be merged in place."
222 (if (or (and (not cache1) (not cache2)) 230 (if (or (and (not cache1) (not cache2))
@@ -256,23 +264,22 @@ Adds a filename and copies the tags."
256 (setq ans (cons next ans)) 264 (setq ans (cons next ans))
257 ;; ELSE - We have a NAME match. 265 ;; ELSE - We have a NAME match.
258 (setq type (semantic-tag-type next)) 266 (setq type (semantic-tag-type next))
259 (if (semantic-tag-of-type-p prev type) ; Are they the same datatype 267 (if (or (semantic-tag-of-type-p prev type) ; Are they the same datatype
268 (semantic-tag-faux-p prev)
269 (semantic-tag-faux-p next) ; or either a faux tag?
270 )
260 ;; Same Class, we can do a merge. 271 ;; Same Class, we can do a merge.
261 (cond 272 (cond
262 ((and (semantic-tag-of-class-p next 'type) 273 ((and (semantic-tag-of-class-p next 'type)
263 (string= type "namespace")) 274 (string= type "namespace"))
264 ;; Namespaces - merge the children together. 275 ;; Namespaces - merge the children together.
265 (setcar ans 276 (setcar ans
266 (semantic-tag-new-type 277 (semanticdb-typecache-faux-namespace
267 (semantic-tag-name prev) ; - they are the same 278 (semantic-tag-name prev) ; - they are the same
268 "namespace" ; - we know this as fact
269 (semanticdb-typecache-merge-streams 279 (semanticdb-typecache-merge-streams
270 (semanticdb-typecache-safe-tag-members prev) 280 (semanticdb-typecache-safe-tag-members prev)
271 (semanticdb-typecache-safe-tag-members next)) 281 (semanticdb-typecache-safe-tag-members next))
272 nil ; - no attributes
273 )) 282 ))
274 ;; Make sure we mark this as a fake tag.
275 (semantic-tag-set-faux (car ans))
276 ) 283 )
277 ((semantic-tag-prototype-p next) 284 ((semantic-tag-prototype-p next)
278 ;; NEXT is a prototype... so keep previous. 285 ;; NEXT is a prototype... so keep previous.
@@ -299,6 +306,12 @@ Adds a filename and copies the tags."
299;;; Refresh / Query API 306;;; Refresh / Query API
300;; 307;;
301;; Queries that can be made for the typecache. 308;; Queries that can be made for the typecache.
309(define-overloadable-function semanticdb-expand-nested-tag (tag)
310 "Expand TAG from fully qualified names.
311If TAG has fully qualified names, expand it to a series of nested
312namespaces instead."
313 tag)
314
302(defmethod semanticdb-typecache-file-tags ((table semanticdb-abstract-table)) 315(defmethod semanticdb-typecache-file-tags ((table semanticdb-abstract-table))
303 "No tags available from non-file based tables." 316 "No tags available from non-file based tables."
304 nil) 317 nil)
@@ -313,10 +326,13 @@ all included files."
313 326
314 ;; Make sure our file-tags list is up to date. 327 ;; Make sure our file-tags list is up to date.
315 (when (not (oref cache filestream)) 328 (when (not (oref cache filestream))
316 (let ((tags (semantic-find-tags-by-class 'type table))) 329 (let ((tags (semantic-find-tags-by-class 'type table))
330 (exptags nil))
317 (when tags 331 (when tags
318 (setq tags (semanticdb-typecache-safe-tag-list tags table)) 332 (setq tags (semanticdb-typecache-safe-tag-list tags table))
319 (oset cache filestream (semanticdb-typecache-merge-streams tags nil))))) 333 (dolist (T tags)
334 (push (semanticdb-expand-nested-tag T) exptags))
335 (oset cache filestream (semanticdb-typecache-merge-streams exptags nil)))))
320 336
321 ;; Return our cache. 337 ;; Return our cache.
322 (oref cache filestream) 338 (oref cache filestream)
@@ -372,6 +388,7 @@ a master list."
372;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 388;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
373 389
374;;; Search Routines 390;;; Search Routines
391;;
375;;;###autoload 392;;;###autoload
376(define-overloadable-function semanticdb-typecache-find (type &optional path find-file-match) 393(define-overloadable-function semanticdb-typecache-find (type &optional path find-file-match)
377 "Search the typecache for TYPE in PATH. 394 "Search the typecache for TYPE in PATH.
@@ -386,16 +403,20 @@ TYPE is the datatype to find.
386PATH is the search path, which should be one table object. 403PATH is the search path, which should be one table object.
387If FIND-FILE-MATCH is non-nil, then force the file belonging to the 404If FIND-FILE-MATCH is non-nil, then force the file belonging to the
388found tag to be loaded." 405found tag to be loaded."
389 (semanticdb-typecache-find-method (or path semanticdb-current-table) 406 (if (not (and (featurep 'semanticdb) semanticdb-current-database))
390 type find-file-match)) 407 nil ;; No DB, no search
408 (save-excursion
409 (semanticdb-typecache-find-method (or path semanticdb-current-table)
410 type find-file-match))))
391 411
392(defun semanticdb-typecache-find-by-name-helper (name table) 412(defun semanticdb-typecache-find-by-name-helper (name table)
393 "Find the tag with NAME in TABLE, which is from a typecache. 413 "Find the tag with NAME in TABLE, which is from a typecache.
394If more than one tag has NAME in TABLE, we will prefer the tag that 414If more than one tag has NAME in TABLE, we will prefer the tag that
395is of class 'type." 415is of class 'type."
396 (let* ((names (semantic-find-tags-by-name name table)) 416 (let* ((names (semantic-find-tags-by-name name table))
397 (types (semantic-find-tags-by-class 'type names))) 417 (nmerge (semanticdb-typecache-merge-streams names nil))
398 (or (car-safe types) (car-safe names)))) 418 (types (semantic-find-tags-by-class 'type nmerge)))
419 (or (car-safe types) (car-safe nmerge))))
399 420
400(defmethod semanticdb-typecache-find-method ((table semanticdb-abstract-table) 421(defmethod semanticdb-typecache-find-method ((table semanticdb-abstract-table)
401 type find-file-match) 422 type find-file-match)
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index 3f638a212f0..3ce774b0a99 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -542,10 +542,25 @@ Optional argument FORCE will force a refresh even if the file in question
542is not in a buffer. Avoid using FORCE for most uses, as an old cache 542is not in a buffer. Avoid using FORCE for most uses, as an old cache
543may be sufficient for the general case. Forced updates can be slow. 543may be sufficient for the general case. Forced updates can be slow.
544This will call `semantic-fetch-tags' if that file is in memory." 544This will call `semantic-fetch-tags' if that file is in memory."
545 (when (or (semanticdb-in-buffer-p obj) force) 545 (cond
546 ;;
547 ;; Already in a buffer, just do it.
548 ((semanticdb-in-buffer-p obj)
549 (semanticdb-set-buffer obj)
550 (semantic-fetch-tags))
551 ;;
552 ;; Not in a buffer. Forcing a load.
553 (force
554 ;; Patch from Iain Nicol. --
555 ;; @TODO: I wonder if there is a way to recycle
556 ;; semanticdb-create-table-for-file-not-in-buffer
546 (save-excursion 557 (save-excursion
547 (semanticdb-set-buffer obj) 558 (let ((buff (semantic-find-file-noselect
548 (semantic-fetch-tags)))) 559 (semanticdb-full-filename obj))))
560 (set-buffer buff)
561 (semantic-fetch-tags)
562 ;; Kill off the buffer if it didn't exist when we were called.
563 (kill-buffer buff))))))
549 564
550(defmethod semanticdb-needs-refresh-p ((obj semanticdb-table)) 565(defmethod semanticdb-needs-refresh-p ((obj semanticdb-table))
551 "Return non-nil of OBJ's tag list is out of date. 566 "Return non-nil of OBJ's tag list is out of date.
@@ -808,12 +823,14 @@ Always append `semanticdb-project-system-databases' if
808 (setq root (run-hook-with-args-until-success 823 (setq root (run-hook-with-args-until-success
809 'semanticdb-project-root-functions 824 'semanticdb-project-root-functions
810 dir)) 825 dir))
811 ;; Find roots based on strings 826 (if root
812 (while (and roots (not root)) 827 (setq root (file-truename root))
813 (let ((r (file-truename (car roots)))) 828 ;; Else, Find roots based on strings
814 (if (string-match (concat "^" (regexp-quote r)) dir) 829 (while roots
815 (setq root r))) 830 (let ((r (file-truename (car roots))))
816 (setq roots (cdr roots))) 831 (if (string-match (concat "^" (regexp-quote r)) dir)
832 (setq root r)))
833 (setq roots (cdr roots))))
817 834
818 ;; If no roots are found, use this directory. 835 ;; If no roots are found, use this directory.
819 (unless root (setq root dir)) 836 (unless root (setq root dir))
diff --git a/lisp/cedet/semantic/decorate.el b/lisp/cedet/semantic/decorate.el
index 314ca2bf46d..f28ce1741f1 100644
--- a/lisp/cedet/semantic/decorate.el
+++ b/lisp/cedet/semantic/decorate.el
@@ -45,7 +45,7 @@ Optional FACE specifies the face to use."
45 )) 45 ))
46 46
47(defun semantic-unhighlight-tag (tag) 47(defun semantic-unhighlight-tag (tag)
48 "Unhighlight TAG, restoring it's previous face." 48 "Unhighlight TAG, restoring its previous face."
49 (let ((o (semantic-tag-overlay tag))) 49 (let ((o (semantic-tag-overlay tag)))
50 (semantic-overlay-put o 'face (car (semantic-overlay-get o 'old-face))) 50 (semantic-overlay-put o 'face (car (semantic-overlay-get o 'old-face)))
51 (semantic-overlay-put o 'old-face (cdr (semantic-overlay-get o 'old-face))) 51 (semantic-overlay-put o 'old-face (cdr (semantic-overlay-get o 'old-face)))
diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/decorate/include.el
index 94273dcfaf7..3d6013b7339 100644
--- a/lisp/cedet/semantic/decorate/include.el
+++ b/lisp/cedet/semantic/decorate/include.el
@@ -118,7 +118,7 @@ Used by the decoration style: `semantic-decoration-on-includes'."
118 '((((class color) (background dark)) 118 '((((class color) (background dark))
119 (:background "#900000")) 119 (:background "#900000"))
120 (((class color) (background light)) 120 (((class color) (background light))
121 (:background "#ff5050"))) 121 (:background "#fff0f0")))
122 "*Face used to show includes that cannot be found. 122 "*Face used to show includes that cannot be found.
123Used by the decoration style: `semantic-decoration-on-unknown-includes'." 123Used by the decoration style: `semantic-decoration-on-unknown-includes'."
124 :group 'semantic-faces) 124 :group 'semantic-faces)
@@ -302,16 +302,19 @@ This mode provides a nice context menu on the include statements."
302 ) 302 )
303 )) 303 ))
304 304
305 (let ((ol (semantic-decorate-tag tag 305 ;; @TODO - if not a tag w/ a position, we need to get one. How?
306 (semantic-tag-start tag) 306
307 (semantic-tag-end tag) 307 (when (semantic-tag-with-position-p tag)
308 face)) 308 (let ((ol (semantic-decorate-tag tag
309 ) 309 (semantic-tag-start tag)
310 (semantic-overlay-put ol 'mouse-face 'highlight) 310 (semantic-tag-end tag)
311 (semantic-overlay-put ol 'keymap map) 311 face))
312 (semantic-overlay-put ol 'help-echo 312 )
313 "Header File : mouse-3 - Context menu") 313 (semantic-overlay-put ol 'mouse-face 'highlight)
314 ))) 314 (semantic-overlay-put ol 'keymap map)
315 (semantic-overlay-put ol 'help-echo
316 "Header File : mouse-3 - Context menu")
317 ))))
315 318
316;;; Regular Include Functions 319;;; Regular Include Functions
317;; 320;;
diff --git a/lisp/cedet/semantic/dep.el b/lisp/cedet/semantic/dep.el
index b36e25c6220..c05650caec7 100644
--- a/lisp/cedet/semantic/dep.el
+++ b/lisp/cedet/semantic/dep.el
@@ -208,7 +208,8 @@ provided mode, not from the current major mode."
208 mode 'semantic-dependency-system-include-path)) 208 mode 'semantic-dependency-system-include-path))
209 (edesys (when (and (featurep 'ede) ede-minor-mode 209 (edesys (when (and (featurep 'ede) ede-minor-mode
210 ede-object) 210 ede-object)
211 (ede-system-include-path ede-object))) 211 (ede-system-include-path
212 (if (listp ede-object) (car ede-object) ede-object))))
212 (locp (mode-local-value 213 (locp (mode-local-value
213 mode 'semantic-dependency-include-path)) 214 mode 'semantic-dependency-include-path))
214 (found nil)) 215 (found nil))
diff --git a/lisp/cedet/semantic/doc.el b/lisp/cedet/semantic/doc.el
index c8a3c12e1b2..aca01bd9830 100644
--- a/lisp/cedet/semantic/doc.el
+++ b/lisp/cedet/semantic/doc.el
@@ -78,7 +78,8 @@ just the lexical token and not the string."
78 (start (if starttag 78 (start (if starttag
79 (semantic-tag-end starttag) 79 (semantic-tag-end starttag)
80 (point-min)))) 80 (point-min))))
81 (when (re-search-backward comment-start-skip start t) 81 (when (and comment-start-skip
82 (re-search-backward comment-start-skip start t))
82 ;; We found a comment that doesn't belong to the body 83 ;; We found a comment that doesn't belong to the body
83 ;; of a function. 84 ;; of a function.
84 (semantic-doc-snarf-comment-for-tag nosnarf))) 85 (semantic-doc-snarf-comment-for-tag nosnarf)))
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index b7e5f7f7a0e..49790861632 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -310,6 +310,17 @@ FILE, NOWARN, RAWFILE, and WILDCARDS are passed into `find-file-noselect'"
310 (find-file-noselect file nowarn rawfile wildcards))) 310 (find-file-noselect file nowarn rawfile wildcards)))
311 )) 311 ))
312 312
313;;; Database restriction settings
314;;
315(defmacro semanticdb-without-unloaded-file-searches (forms)
316 "Execute FORMS with `unloaded' removed from the current throttle."
317 `(let ((semanticdb-find-default-throttle
318 (if (featurep 'semanticdb-find)
319 (remq 'unloaded semanticdb-find-default-throttle)
320 nil)))
321 ,forms))
322(put 'semanticdb-without-unloaded-file-searches 'lisp-indent-function 1)
323
313 324
314;; ;;; Editor goodies ;-) 325;; ;;; Editor goodies ;-)
315;; ;; 326;; ;;
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 8f5d1cd3e14..65365768f98 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -928,6 +928,12 @@ Lisp code."
928 ;; If running interactively, eval declarations and epilogue 928 ;; If running interactively, eval declarations and epilogue
929 ;; code, then pop to the buffer visiting the generated file. 929 ;; code, then pop to the buffer visiting the generated file.
930 (eval-region (point) (point-max)) 930 (eval-region (point) (point-max))
931 ;; Loop over the defvars and eval them explicitly to force
932 ;; them to be evaluated and ready to use.
933 (goto-char (point-min))
934 (while (re-search-forward "(defvar " nil t)
935 (eval-defun nil))
936 ;; Move cursor to a logical spot in the generated code.
931 (goto-char (point-min)) 937 (goto-char (point-min))
932 (pop-to-buffer (current-buffer)) 938 (pop-to-buffer (current-buffer))
933 ;; The generated code has been evaluated and updated into 939 ;; The generated code has been evaluated and updated into
diff --git a/lisp/cedet/semantic/html.el b/lisp/cedet/semantic/html.el
index 1a7ada02e34..7597370dff5 100644
--- a/lisp/cedet/semantic/html.el
+++ b/lisp/cedet/semantic/html.el
@@ -243,6 +243,7 @@ tag with greater section value than LEVEL is found."
243 semantic-imenu-bucketize-file nil 243 semantic-imenu-bucketize-file nil
244 semantic-imenu-bucketize-type-members nil 244 semantic-imenu-bucketize-type-members nil
245 senator-step-at-start-end-tag-classes '(section) 245 senator-step-at-start-end-tag-classes '(section)
246 senator-step-at-tag-classes '(section)
246 semantic-stickyfunc-sticky-classes '(section) 247 semantic-stickyfunc-sticky-classes '(section)
247 ) 248 )
248 (semantic-install-function-overrides 249 (semantic-install-function-overrides
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el
index 710b52f37d6..c7e1458fa3f 100644
--- a/lisp/cedet/semantic/ia.el
+++ b/lisp/cedet/semantic/ia.el
@@ -40,7 +40,8 @@
40(require 'pulse) 40(require 'pulse)
41(eval-when-compile 41(eval-when-compile
42 (require 'semantic/analyze) 42 (require 'semantic/analyze)
43 (require 'semantic/analyze/refs)) 43 (require 'semantic/analyze/refs)
44 (require 'semantic/find))
44 45
45(declare-function imenu--mouse-menu "imenu") 46(declare-function imenu--mouse-menu "imenu")
46 47
@@ -57,14 +58,6 @@
57 :group 'semantic 58 :group 'semantic
58 :type semantic-format-tag-custom-list) 59 :type semantic-format-tag-custom-list)
59 60
60(defvar semantic-ia-cache nil
61 "Cache of the last completion request.
62Of the form ( POINT . COMPLETIONS ) where POINT is a location in the
63buffer where the completion was requested. COMPLETONS is the list
64of semantic tag names that provide logical completions from that
65location.")
66(make-variable-buffer-local 'semantic-ia-cache)
67
68;;; COMPLETION HELPER 61;;; COMPLETION HELPER
69;; 62;;
70;; This overload function handles inserting a tag 63;; This overload function handles inserting a tag
@@ -86,23 +79,16 @@ location.")
86 (insert "(")) 79 (insert "("))
87 (t nil)))) 80 (t nil))))
88 81
89(declare-function semantic-analyze-possible-completions 82(defalias 'semantic-ia-get-completions 'semantic-ia-get-completions-deprecated
90 "semantic/analyze/complete") 83 "`Semantic-ia-get-completions' is obsolete.
91 84Use `semantic-analyze-possible-completions' instead.")
92(defun semantic-ia-get-completions (context point) 85
93 "Fetch the completion of CONTEXT at POINT. 86(defun semantic-ia-get-completions-deprecated (context point)
94Supports caching." 87 "A function to help transition away from `semantic-ia-get-completions'.
95 ;; Cache the current set of symbols so that we can get at 88Return completions based on CONTEXT at POINT.
96 ;; them quickly the second time someone presses the 89You should not use this, nor the aliased version.
97 ;; complete button. 90Use `semantic-analyze-possible-completions' instead."
98 (let ((symbols 91 (semantic-analyze-possible-completions context))
99 (if (and semantic-ia-cache
100 (= point (car semantic-ia-cache)))
101 (cdr semantic-ia-cache)
102 (semantic-analyze-possible-completions context))))
103 ;; Set the cache
104 (setq semantic-ia-cache (cons point symbols))
105 symbols))
106 92
107;;;###autoload 93;;;###autoload
108(defun semantic-ia-complete-symbol (&optional pos) 94(defun semantic-ia-complete-symbol (&optional pos)
@@ -119,7 +105,7 @@ Completion options are calculated with `semantic-analyze-possible-completions'."
119 ;; 105 ;;
120 ;; The second step derives completions from that context. 106 ;; The second step derives completions from that context.
121 (let* ((a (semantic-analyze-current-context pos)) 107 (let* ((a (semantic-analyze-current-context pos))
122 (syms (semantic-ia-get-completions a pos)) 108 (syms (semantic-analyze-possible-completions a))
123 (pre (car (reverse (oref a prefix))))) 109 (pre (car (reverse (oref a prefix)))))
124 ;; If PRE was actually an already completed symbol, it doesn't 110 ;; If PRE was actually an already completed symbol, it doesn't
125 ;; come in as a string, but as a tag instead. 111 ;; come in as a string, but as a tag instead.
@@ -173,7 +159,7 @@ Completion options are calculated with `semantic-analyze-possible-completions'."
173 "Pop up a tooltip for completion at POINT." 159 "Pop up a tooltip for completion at POINT."
174 (interactive "d") 160 (interactive "d")
175 (let* ((a (semantic-analyze-current-context point)) 161 (let* ((a (semantic-analyze-current-context point))
176 (syms (semantic-ia-get-completions a point)) 162 (syms (semantic-analyze-possible-completions a))
177 (x (mod (- (current-column) (window-hscroll)) 163 (x (mod (- (current-column) (window-hscroll))
178 (window-width))) 164 (window-width)))
179 (y (save-excursion 165 (y (save-excursion
@@ -212,8 +198,48 @@ Completion options are calculated with `semantic-analyze-possible-completions'."
212 ;; tag associated with the current context. 198 ;; tag associated with the current context.
213 (semantic-analyze-interesting-tag ctxt))) 199 (semantic-analyze-interesting-tag ctxt)))
214 ) 200 )
215 (when pf 201 (if pf
216 (message "%s" (semantic-format-tag-summarize pf nil t))))) 202 (message "%s" (semantic-format-tag-summarize pf nil t))
203 (message "No summary info availalble"))))
204
205;;; Variants
206;;
207;; Show all variants for the symbol under point.
208
209;;;###autoload
210(defun semantic-ia-show-variants (point)
211 "Display a list of all variants for the symbol under POINT."
212 (interactive "P")
213 (let* ((ctxt (semantic-analyze-current-context point))
214 (comp nil))
215
216 ;; We really want to look at the function if we are on an
217 ;; argument. Are there some additional rules we care about for
218 ;; changing the CTXT we look at?
219 (when (semantic-analyze-context-functionarg-p ctxt)
220 (goto-char (cdr (oref ctxt bounds)))
221 (setq ctxt (semantic-analyze-current-context (point))))
222
223 ;; Get the "completion list", but remove ALL filters to get the master list
224 ;; of all the possible things.
225 (setq comp (semantic-analyze-possible-completions ctxt 'no-unique 'no-tc))
226
227 ;; Special case for a single type. List the constructors?
228 (when (and (= (length comp) 1) (semantic-tag-of-class-p (car comp) 'type))
229 (setq comp (semantic-find-tags-by-name (semantic-tag-name (car comp))
230 (semantic-tag-type-members (car comp)))))
231
232 ;; Display the results.
233 (cond ((= (length comp) 0)
234 (message "No Variants found."))
235 ((= (length comp) 1)
236 (message "%s" (semantic-format-tag-summarize (car comp) nil t)))
237 (t
238 (with-output-to-temp-buffer "*Symbol Variants*"
239 (semantic-analyze-princ-sequence comp "" (current-buffer)))
240 (shrink-window-if-larger-than-buffer
241 (get-buffer-window "*Symbol Variants*")))
242 )))
217 243
218;;; FAST Jump 244;;; FAST Jump
219;; 245;;
@@ -354,18 +380,21 @@ See `semantic-ia-fast-jump' for details on how it works.
354 ;; The default tries to find a comment in front of the tag 380 ;; The default tries to find a comment in front of the tag
355 ;; and then strings off comment prefixes. 381 ;; and then strings off comment prefixes.
356 (let ((doc (semantic-documentation-for-tag (car pf)))) 382 (let ((doc (semantic-documentation-for-tag (car pf))))
357 (with-output-to-temp-buffer "*TAG DOCUMENTATION*" 383 (if (or (null doc) (string= doc ""))
358 (princ "Tag: ") 384 (message "Doc unavailable for: %s"
359 (princ (semantic-format-tag-prototype (car pf))) 385 (semantic-format-tag-prototype (car pf)))
360 (princ "\n") 386 (with-output-to-temp-buffer "*TAG DOCUMENTATION*"
361 (princ "\n") 387 (princ "Tag: ")
362 (princ "Snarfed Documentation: ") 388 (princ (semantic-format-tag-prototype (car pf)))
363 (princ "\n") 389 (princ "\n")
364 (princ "\n") 390 (princ "\n")
365 (if doc 391 (princ "Snarfed Documentation: ")
366 (princ doc) 392 (princ "\n")
367 (princ " Documentation unavailable.")) 393 (princ "\n")
368 ))) 394 (if doc
395 (princ doc)
396 (princ " Documentation unavailable."))
397 ))))
369 (t 398 (t
370 (message "Unknown tag."))) 399 (message "Unknown tag.")))
371 )) 400 ))
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index a2db3b549d6..585ad693dc8 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -49,6 +49,7 @@
49(defvar eldoc-last-message) 49(defvar eldoc-last-message)
50(declare-function eldoc-message "eldoc") 50(declare-function eldoc-message "eldoc")
51(declare-function semantic-analyze-interesting-tag "semantic/analyze") 51(declare-function semantic-analyze-interesting-tag "semantic/analyze")
52(declare-function semantic-analyze-unsplit-name "semantic/analyze/fcn")
52(declare-function semantic-complete-analyze-inline-idle "semantic/complete") 53(declare-function semantic-complete-analyze-inline-idle "semantic/complete")
53(declare-function semanticdb-deep-find-tags-by-name "semantic/db-find") 54(declare-function semanticdb-deep-find-tags-by-name "semantic/db-find")
54(declare-function semanticdb-save-all-db-idle "semantic/db") 55(declare-function semanticdb-save-all-db-idle "semantic/db")
@@ -294,12 +295,18 @@ call additional functions registered with the timer calls."
294;; 295;;
295;; Unlike the shorter timer, the WORK timer will kick of tasks that 296;; Unlike the shorter timer, the WORK timer will kick of tasks that
296;; may take a long time to complete. 297;; may take a long time to complete.
297(defcustom semantic-idle-work-parse-neighboring-files-flag t 298(defcustom semantic-idle-work-parse-neighboring-files-flag nil
298 "*Non-nil means to parse files in the same dir as the current buffer. 299 "*Non-nil means to parse files in the same dir as the current buffer.
299Disable to prevent lots of excessive parsing in idle time." 300Disable to prevent lots of excessive parsing in idle time."
300 :group 'semantic 301 :group 'semantic
301 :type 'boolean) 302 :type 'boolean)
302 303
304(defcustom semantic-idle-work-update-headers-flag nil
305 "*Non-nil means to parse through header files in idle time.
306Disable to prevent idle time parsing of many files. If completion
307is called that work will be done then instead."
308 :group 'semantic
309 :type 'boolean)
303 310
304(defun semantic-idle-work-for-one-buffer (buffer) 311(defun semantic-idle-work-for-one-buffer (buffer)
305 "Do long-processing work for BUFFER. 312 "Do long-processing work for BUFFER.
@@ -312,6 +319,9 @@ Returns t if all processing succeeded."
312 (semantic-idle-scheduler-refresh-tags) 319 (semantic-idle-scheduler-refresh-tags)
313 t) 320 t)
314 321
322 ;; Option to disable this work.
323 semantic-idle-work-update-headers-flag
324
315 ;; Force all our include files to get read in so we 325 ;; Force all our include files to get read in so we
316 ;; are ready to provide good smart completion and idle 326 ;; are ready to provide good smart completion and idle
317 ;; summary information 327 ;; summary information
@@ -603,6 +613,11 @@ turned on in every Semantic-supported buffer.")
603;;; SUMMARY MODE 613;;; SUMMARY MODE
604;; 614;;
605;; A mode similar to eldoc using semantic 615;; A mode similar to eldoc using semantic
616(defcustom semantic-idle-truncate-long-summaries t
617 "Truncate summaries that are too long to fit in the minibuffer.
618This can prevent minibuffer resizing in idle time."
619 :group 'semantic
620 :type 'boolean)
606 621
607(defcustom semantic-idle-summary-function 622(defcustom semantic-idle-summary-function
608 'semantic-format-tag-summarize-with-file 623 'semantic-format-tag-summarize-with-file
@@ -654,21 +669,16 @@ Use the semantic analyzer to find the symbol information."
654 "Return a string message describing the current context. 669 "Return a string message describing the current context.
655This function will disable loading of previously unloaded files 670This function will disable loading of previously unloaded files
656by semanticdb as a time-saving measure." 671by semanticdb as a time-saving measure."
657 (let ( 672 (semanticdb-without-unloaded-file-searches
658 (semanticdb-find-default-throttle 673 (save-excursion
659 (if (featurep 'semantic/db-find) 674 ;; use whichever has success first.
660 (remq 'unloaded semanticdb-find-default-throttle) 675 (or
661 nil)) 676 (semantic-idle-summary-current-symbol-keyword)
662 ) 677
663 (save-excursion 678 (semantic-idle-summary-current-symbol-info-context)
664 ;; use whicever has success first. 679
665 (or 680 (semantic-idle-summary-current-symbol-info-brutish)
666 (semantic-idle-summary-current-symbol-keyword) 681 ))))
667
668 (semantic-idle-summary-current-symbol-info-context)
669
670 (semantic-idle-summary-current-symbol-info-brutish)
671 ))))
672 682
673(defvar semantic-idle-summary-out-of-context-faces 683(defvar semantic-idle-summary-out-of-context-faces
674 '( 684 '(
@@ -732,6 +742,14 @@ current tag to display information."
732 (let ((w (1- (window-width (minibuffer-window))))) 742 (let ((w (1- (window-width (minibuffer-window)))))
733 (if (> (length str) w) 743 (if (> (length str) w)
734 (setq str (substring str 0 w))))) 744 (setq str (substring str 0 w)))))
745 ;; I borrowed some bits from eldoc to shorten the
746 ;; message.
747 (when semantic-idle-truncate-long-summaries
748 (let ((ea-width (1- (window-width (minibuffer-window))))
749 (strlen (length str)))
750 (when (> strlen ea-width)
751 (setq str (substring str 0 ea-width)))))
752 ;; Display it
735 (eldoc-message str)))) 753 (eldoc-message str))))
736 754
737(define-minor-mode semantic-idle-summary-mode 755(define-minor-mode semantic-idle-summary-mode
@@ -791,12 +809,12 @@ turned on in every Semantic-supported buffer."
791;; of all uses of the symbol that is under the cursor. 809;; of all uses of the symbol that is under the cursor.
792;; 810;;
793;; This is to mimic the Eclipse tool of a similar nature. 811;; This is to mimic the Eclipse tool of a similar nature.
794(defvar semantic-idle-summary-highlight-face 'region 812(defvar semantic-idle-symbol-highlight-face 'region
795 "Face used for the summary highlight.") 813 "Face used for highlighting local symbols.")
796 814
797(defun semantic-idle-summary-maybe-highlight (tag) 815(defun semantic-idle-symbol-maybe-highlight (tag)
798 "Perhaps add highlighting onto TAG. 816 "Perhaps add highlighting to the symbol represented by TAG.
799TAG was found as the thing under point. If it happens to be 817TAG was found as the symbol under point. If it happens to be
800visible, then highlight it." 818visible, then highlight it."
801 (require 'pulse) 819 (require 'pulse)
802 (let* ((region (when (and (semantic-tag-p tag) 820 (let* ((region (when (and (semantic-tag-p tag)
@@ -817,12 +835,12 @@ visible, then highlight it."
817 (point) (get-buffer-window (current-buffer) 'visible)) 835 (point) (get-buffer-window (current-buffer) 'visible))
818 (if (< (semantic-overlay-end region) (point-at-eol)) 836 (if (< (semantic-overlay-end region) (point-at-eol))
819 (pulse-momentary-highlight-overlay 837 (pulse-momentary-highlight-overlay
820 region semantic-idle-summary-highlight-face) 838 region semantic-idle-symbol-highlight-face)
821 ;; Not the same 839 ;; Not the same
822 (pulse-momentary-highlight-region 840 (pulse-momentary-highlight-region
823 (semantic-overlay-start region) 841 (semantic-overlay-start region)
824 (point-at-eol) 842 (point-at-eol)
825 semantic-idle-summary-highlight-face))) 843 semantic-idle-symbol-highlight-face)))
826 )) 844 ))
827 ((vectorp region) 845 ((vectorp region)
828 (let ((start (aref region 0)) 846 (let ((start (aref region 0))
@@ -842,17 +860,19 @@ visible, then highlight it."
842 (pulse-momentary-highlight-region 860 (pulse-momentary-highlight-region
843 start (if (<= end (point-at-eol)) end 861 start (if (<= end (point-at-eol)) end
844 (point-at-eol)) 862 (point-at-eol))
845 semantic-idle-summary-highlight-face))) 863 semantic-idle-symbol-highlight-face)))
846 )))) 864 ))))
847 nil)) 865 nil))
848 866
849(define-semantic-idle-service semantic-idle-tag-highlight 867(define-semantic-idle-service semantic-idle-local-symbol-highlight
850 "Highlight the tag, and references of the symbol under point. 868 "Highlight the tag and symbol references of the symbol under point.
851Call `semantic-analyze-current-context' to find the reference tag. 869Call `semantic-analyze-current-context' to find the reference tag.
852Call `semantic-symref-hits-in-region' to identify local references." 870Call `semantic-symref-hits-in-region' to identify local references."
853 (require 'pulse) 871 (require 'pulse)
854 (when (semantic-idle-summary-useful-context-p) 872 (when (semantic-idle-summary-useful-context-p)
855 (let* ((ctxt (semantic-analyze-current-context)) 873 (let* ((ctxt
874 (semanticdb-without-unloaded-file-searches
875 (semantic-analyze-current-context)))
856 (Hbounds (when ctxt (oref ctxt bounds))) 876 (Hbounds (when ctxt (oref ctxt bounds)))
857 (target (when ctxt (car (reverse (oref ctxt prefix))))) 877 (target (when ctxt (car (reverse (oref ctxt prefix)))))
858 (tag (semantic-current-tag)) 878 (tag (semantic-current-tag))
@@ -862,7 +882,7 @@ Call `semantic-symref-hits-in-region' to identify local references."
862 (when ctxt 882 (when ctxt
863 ;; Highlight the original tag? Protect against problems. 883 ;; Highlight the original tag? Protect against problems.
864 (condition-case nil 884 (condition-case nil
865 (semantic-idle-summary-maybe-highlight target) 885 (semantic-idle-symbol-maybe-highlight target)
866 (error nil)) 886 (error nil))
867 ;; Identify all hits in this current tag. 887 ;; Identify all hits in this current tag.
868 (when (semantic-tag-p target) 888 (when (semantic-tag-p target)
@@ -871,7 +891,7 @@ Call `semantic-symref-hits-in-region' to identify local references."
871 target (lambda (start end prefix) 891 target (lambda (start end prefix)
872 (when (/= start (car Hbounds)) 892 (when (/= start (car Hbounds))
873 (pulse-momentary-highlight-region 893 (pulse-momentary-highlight-region
874 start end semantic-idle-summary-highlight-face)) 894 start end semantic-idle-symbol-highlight-face))
875 (semantic-throw-on-input 'symref-highlight) 895 (semantic-throw-on-input 'symref-highlight)
876 ) 896 )
877 (semantic-tag-start tag) 897 (semantic-tag-start tag)
@@ -891,7 +911,7 @@ If ARG is positive or nil, enable, if it is negative, disable."
891 ;; When turning off, disable other idle modes. 911 ;; When turning off, disable other idle modes.
892 (when (null global-semantic-idle-scheduler-mode) 912 (when (null global-semantic-idle-scheduler-mode)
893 (global-semantic-idle-summary-mode -1) 913 (global-semantic-idle-summary-mode -1)
894 (global-semantic-idle-tag-highlight-mode -1) 914 (global-semantic-idle-local-symbol-highlight-mode -1)
895 (global-semantic-idle-completions-mode -1)) 915 (global-semantic-idle-completions-mode -1))
896 (semantic-toggle-minor-mode-globally 916 (semantic-toggle-minor-mode-globally
897 'semantic-idle-scheduler-mode 917 'semantic-idle-scheduler-mode
@@ -903,25 +923,23 @@ If ARG is positive or nil, enable, if it is negative, disable."
903;; This mode uses tooltips to display a (hopefully) short list of possible 923;; This mode uses tooltips to display a (hopefully) short list of possible
904;; completions available for the text under point. It provides 924;; completions available for the text under point. It provides
905;; NO provision for actually filling in the values from those completions. 925;; NO provision for actually filling in the values from those completions.
926(defun semantic-idle-completions-end-of-symbol-p ()
927 "Return non-nil if the cursor is at the END of a symbol.
928If the cursor is in the middle of a symbol, then we shouldn't be
929doing fancy completions."
930 (not (looking-at "\\w\\|\\s_")))
906 931
907(defun semantic-idle-completion-list-default () 932(defun semantic-idle-completion-list-default ()
908 "Calculate and display a list of completions." 933 "Calculate and display a list of completions."
909 (when (semantic-idle-summary-useful-context-p) 934 (when (and (semantic-idle-summary-useful-context-p)
935 (semantic-idle-completions-end-of-symbol-p))
910 ;; This mode can be fragile. Ignore problems. 936 ;; This mode can be fragile. Ignore problems.
911 ;; If something doesn't do what you expect, run 937 ;; If something doesn't do what you expect, run
912 ;; the below command by hand instead. 938 ;; the below command by hand instead.
913 (condition-case nil 939 (condition-case nil
914 (let ( 940 (semanticdb-without-unloaded-file-searches
915 ;; Don't go loading in oodles of header libraries in 941 ;; Use idle version.
916 ;; IDLE time. 942 (semantic-complete-analyze-inline-idle)
917 (semanticdb-find-default-throttle
918 (if (featurep 'semantic/db-find)
919 (remq 'unloaded semanticdb-find-default-throttle)
920 nil))
921 )
922 ;; Use idle version.
923 (require 'semantic/complete)
924 (semantic-complete-analyze-inline-idle)
925 ) 943 )
926 (error nil)) 944 (error nil))
927 )) 945 ))
@@ -949,6 +967,347 @@ completion.
949 ;; Add the ability to override sometime. 967 ;; Add the ability to override sometime.
950 (semantic-idle-completion-list-default)) 968 (semantic-idle-completion-list-default))
951 969
970
971;;; Breadcrumbs for tag under point
972;;
973;; Service that displays a breadcrumbs indication of the tag under
974;; point and its parents in the header or mode line.
975;;
976
977(defcustom semantic-idle-breadcrumbs-display-function
978 #'semantic-idle-breadcrumbs--display-in-header-line
979 "Function to display the tag under point in idle time.
980This function should take a list of Semantic tags as its only
981argument. The tags are sorted according to their nesting order,
982starting with the outermost tag. The function should call
983`semantic-idle-breadcrumbs-format-tag-list-function' to convert
984the tag list into a string."
985 :group 'semantic
986 :type '(choice
987 (const :tag "Display in header line"
988 semantic-idle-breadcrumbs--display-in-header-line)
989 (const :tag "Display in mode line"
990 semantic-idle-breadcrumbs--display-in-mode-line)
991 (function :tag "Other function")))
992
993(defcustom semantic-idle-breadcrumbs-format-tag-list-function
994 #'semantic-idle-breadcrumbs--format-linear
995 "Function to format the list of tags containing point.
996This function should take a list of Semantic tags and an optional
997maximum length of the produced string as its arguments. The
998maximum length is a hint and can be ignored. When the maximum
999length is omitted, an unconstrained string should be
1000produced. The tags are sorted according to their nesting order,
1001starting with the outermost tag. Single tags should be formatted
1002using `semantic-idle-breadcrumbs-format-tag-function' unless
1003special formatting is required."
1004 :group 'semantic
1005 :type '(choice
1006 (const :tag "Format tags as list, innermost last"
1007 semantic-idle-breadcrumbs--format-linear)
1008 (const :tag "Innermost tag with details, followed by remaining tags"
1009 semantic-idle-breadcrumbs--format-innermost-first)
1010 (function :tag "Other function")))
1011
1012(defcustom semantic-idle-breadcrumbs-format-tag-function
1013 #'semantic-format-tag-abbreviate
1014 "Function to call to format information about tags.
1015This function should take a single argument, a Semantic tag, and
1016return a string to display.
1017Some useful functions are found in `semantic-format-tag-functions'."
1018 :group 'semantic
1019 :type semantic-format-tag-custom-list)
1020
1021(defcustom semantic-idle-breadcrumbs-separator 'mode-specific
1022 "Specify how to separate tags in the breadcrumbs string.
1023An arbitrary string or a mode-specific scope nesting
1024string (like, for example, \"::\" in C++, or \".\" in Java) can
1025be used."
1026 :group 'semantic
1027 :type '(choice
1028 (const :tag "Use mode specific separator"
1029 mode-specific)
1030 (string :tag "Specify separator string")))
1031
1032(defcustom semantic-idle-breadcrumbs-header-line-prefix
1033 semantic-stickyfunc-indent-string ;; TODO not optimal
1034 "String used to indent the breadcrumbs string.
1035Customize this string to match the space used by scrollbars and
1036fringe."
1037 :group 'semantic
1038 :type 'string)
1039
1040(defvar semantic-idle-breadcrumbs-popup-menu nil
1041 "Menu used when a tag displayed by `semantic-idle-breadcrumbs-mode' is clicked.")
1042
1043(defun semantic-idle-breadcrumbs--popup-menu (event)
1044 "Popup a menu that displays things to do to the clicked tag.
1045Argument EVENT describes the event that caused this function to
1046be called."
1047 (interactive "e")
1048 (let ((old-window (selected-window))
1049 (window (semantic-event-window event)))
1050 (select-window window t)
1051 (semantic-popup-menu semantic-idle-breadcrumbs-popup-menu)
1052 (select-window old-window)))
1053
1054(defmacro semantic-idle-breadcrumbs--tag-function (function)
1055 "Return lambda expression calling FUNCTION when called from a popup."
1056 `(lambda (event)
1057 (interactive "e")
1058 (let* ((old-window (selected-window))
1059 (window (semantic-event-window event))
1060 (column (car (nth 6 (nth 1 event)))) ;; TODO semantic-event-column?
1061 (tag (progn
1062 (select-window window t)
1063 (plist-get
1064 (text-properties-at column header-line-format)
1065 'tag))))
1066 (,function tag)
1067 (select-window old-window)))
1068 )
1069
1070;; TODO does this work for mode-line case?
1071(defvar semantic-idle-breadcrumbs-popup-map
1072 (let ((map (make-sparse-keymap)))
1073 ;; mouse-1 goes to clicked tag
1074 (define-key map
1075 [ header-line mouse-1 ]
1076 (semantic-idle-breadcrumbs--tag-function
1077 semantic-go-to-tag))
1078 ;; mouse-3 pops up a context menu
1079 (define-key map
1080 [ header-line mouse-3 ]
1081 'semantic-idle-breadcrumbs--popup-menu)
1082 map)
1083 "Keymap for semantic idle breadcrumbs minor mode.")
1084
1085(easy-menu-define
1086 semantic-idle-breadcrumbs-popup-menu
1087 semantic-idle-breadcrumbs-popup-map
1088 "Semantic Breadcrumbs Mode Menu"
1089 (list
1090 "Breadcrumb Tag"
1091 (semantic-menu-item
1092 (vector
1093 "Go to Tag"
1094 (semantic-idle-breadcrumbs--tag-function
1095 semantic-go-to-tag)
1096 :active t
1097 :help "Jump to this tag"))
1098 ;; TODO these entries need minor changes (optional tag argument) in
1099 ;; senator-copy-tag etc
1100 ;; (semantic-menu-item
1101 ;; (vector
1102 ;; "Copy Tag"
1103 ;; (semantic-idle-breadcrumbs--tag-function
1104 ;; senator-copy-tag)
1105 ;; :active t
1106 ;; :help "Copy this tag"))
1107 ;; (semantic-menu-item
1108 ;; (vector
1109 ;; "Kill Tag"
1110 ;; (semantic-idle-breadcrumbs--tag-function
1111 ;; senator-kill-tag)
1112 ;; :active t
1113 ;; :help "Kill tag text to the kill ring, and copy the tag to
1114 ;; the tag ring"))
1115 ;; (semantic-menu-item
1116 ;; (vector
1117 ;; "Copy Tag to Register"
1118 ;; (semantic-idle-breadcrumbs--tag-function
1119 ;; senator-copy-tag-to-register)
1120 ;; :active t
1121 ;; :help "Copy this tag"))
1122 ;; (semantic-menu-item
1123 ;; (vector
1124 ;; "Narrow to Tag"
1125 ;; (semantic-idle-breadcrumbs--tag-function
1126 ;; senator-narrow-to-defun)
1127 ;; :active t
1128 ;; :help "Narrow to the bounds of the current tag"))
1129 ;; (semantic-menu-item
1130 ;; (vector
1131 ;; "Fold Tag"
1132 ;; (semantic-idle-breadcrumbs--tag-function
1133 ;; senator-fold-tag-toggle)
1134 ;; :active t
1135 ;; :style 'toggle
1136 ;; :selected '(let ((tag (semantic-current-tag)))
1137 ;; (and tag (semantic-tag-folded-p tag)))
1138 ;; :help "Fold the current tag to one line"))
1139 "---"
1140 (semantic-menu-item
1141 (vector
1142 "About this Header Line"
1143 (lambda ()
1144 (interactive)
1145 (describe-function 'semantic-idle-breadcrumbs-mode))
1146 :active t
1147 :help "Display help about this header line."))
1148 )
1149 )
1150
1151(define-semantic-idle-service semantic-idle-breadcrumbs
1152 "Display breadcrumbs for the tag under point and its parents."
1153 (let* ((scope (semantic-calculate-scope))
1154 (tag-list (if scope
1155 ;; If there is a scope, extract the tag and its
1156 ;; parents.
1157 (append (oref scope parents)
1158 (when (oref scope tag)
1159 (list (oref scope tag))))
1160 ;; Fall back to tags by overlay
1161 (semantic-find-tag-by-overlay))))
1162 ;; Display the tags.
1163 (funcall semantic-idle-breadcrumbs-display-function tag-list)))
1164
1165(defun semantic-idle-breadcrumbs--display-in-header-line (tag-list)
1166 "Display the tags in TAG-LIST in the header line of their buffer."
1167 (let ((width (- (nth 2 (window-edges))
1168 (nth 0 (window-edges)))))
1169 ;; Format TAG-LIST and put the formatted string into the header
1170 ;; line.
1171 (setq header-line-format
1172 (concat
1173 semantic-idle-breadcrumbs-header-line-prefix
1174 (if tag-list
1175 (semantic-idle-breadcrumbs--format-tag-list
1176 tag-list
1177 (- width
1178 (length semantic-idle-breadcrumbs-header-line-prefix)))
1179 (propertize
1180 "<not on tags>"
1181 'face
1182 'font-lock-comment-face)))))
1183
1184 ;; Update the header line.
1185 (force-mode-line-update))
1186
1187(defun semantic-idle-breadcrumbs--display-in-mode-line (tag-list)
1188 "Display the tags in TAG-LIST in the mode line of their buffer.
1189TODO THIS FUNCTION DOES NOT WORK YET."
1190
1191 (error "This function does not work yet")
1192
1193 (let ((width (- (nth 2 (window-edges))
1194 (nth 0 (window-edges)))))
1195 (setq mode-line-format
1196 (semantic-idle-breadcrumbs--format-tag-list tag-list width)))
1197
1198 (force-mode-line-update))
1199
1200(defun semantic-idle-breadcrumbs--format-tag-list (tag-list max-length)
1201 "Format TAG-LIST using configured functions respecting MAX-LENGTH.
1202If the initial formatting result is longer than MAX-LENGTH, it is
1203shortened at the beginning."
1204 ;; Format TAG-LIST using the configured formatting function.
1205 (let* ((complete-format (funcall
1206 semantic-idle-breadcrumbs-format-tag-list-function
1207 tag-list max-length))
1208 ;; Determine length of complete format.
1209 (complete-length (length complete-format)))
1210 ;; Shorten string if necessary.
1211 (if (<= complete-length max-length)
1212 complete-format
1213 (concat "... "
1214 (substring
1215 complete-format
1216 (- complete-length (- max-length 4))))))
1217 )
1218
1219(defun semantic-idle-breadcrumbs--format-linear
1220 (tag-list &optional max-length)
1221 "Format TAG-LIST as a linear list, starting with the outermost tag.
1222MAX-LENGTH is not used."
1223 (require 'semantic/analyze/fcn)
1224 (let* ((format-pieces (mapcar
1225 #'semantic-idle-breadcrumbs--format-tag
1226 tag-list))
1227 ;; Format tag list, putting configured separators between the
1228 ;; tags.
1229 (complete-format (cond
1230 ;; Mode specific separator.
1231 ((eq semantic-idle-breadcrumbs-separator
1232 'mode-specific)
1233 (semantic-analyze-unsplit-name format-pieces))
1234
1235 ;; Custom separator.
1236 ((stringp semantic-idle-breadcrumbs-separator)
1237 (mapconcat
1238 #'identity
1239 format-pieces
1240 semantic-idle-breadcrumbs-separator)))))
1241 complete-format)
1242 )
1243
1244(defun semantic-idle-breadcrumbs--format-innermost-first
1245 (tag-list &optional max-length)
1246 "Format TAG-LIST placing the innermost tag first, separated from its parents.
1247If MAX-LENGTH is non-nil, the innermost tag is shortened."
1248 (let* (;; Separate and format remaining tags. Calculate length of
1249 ;; resulting string.
1250 (rest-tags (butlast tag-list))
1251 (rest-format (if rest-tags
1252 (concat
1253 " | "
1254 (semantic-idle-breadcrumbs--format-linear
1255 rest-tags))
1256 ""))
1257 (rest-length (length rest-format))
1258 ;; Format innermost tag and calculate length of resulting
1259 ;; string.
1260 (inner-format (semantic-idle-breadcrumbs--format-tag
1261 (car (last tag-list))
1262 #'semantic-format-tag-prototype))
1263 (inner-length (length inner-format))
1264 ;; Calculate complete length and shorten string for innermost
1265 ;; tag if MAX-LENGTH is non-nil and the complete string is
1266 ;; too long.
1267 (complete-length (+ inner-length rest-length))
1268 (inner-short (if (and max-length
1269 (<= complete-length max-length))
1270 inner-format
1271 (concat (substring
1272 inner-format
1273 0
1274 (- inner-length
1275 (- complete-length max-length)
1276 4))
1277 " ..."))))
1278 ;; Concat both parts.
1279 (concat inner-short rest-format))
1280 )
1281
1282(defun semantic-idle-breadcrumbs--format-tag (tag &optional format-function)
1283 "Format TAG using the configured function or FORMAT-FUNCTION.
1284This function also adds text properties for help-echo, mouse
1285highlighting and a keymap."
1286 (let ((formatted (funcall
1287 (or format-function
1288 semantic-idle-breadcrumbs-format-tag-function)
1289 tag nil t)))
1290 (add-text-properties
1291 0 (length formatted)
1292 (list
1293 'tag
1294 tag
1295 'help-echo
1296 (format
1297 "Tag %s
1298Type: %s
1299mouse-1: jump to tag
1300mouse-3: popup context menu"
1301 (semantic-tag-name tag)
1302 (semantic-tag-class tag))
1303 'mouse-face
1304 'highlight
1305 'keymap
1306 semantic-idle-breadcrumbs-popup-map)
1307 formatted)
1308 formatted))
1309
1310
952(provide 'semantic/idle) 1311(provide 'semantic/idle)
953 1312
954;; Local variables: 1313;; Local variables:
diff --git a/lisp/cedet/semantic/imenu.el b/lisp/cedet/semantic/imenu.el
index 9ce986553aa..e38b50bcd57 100644
--- a/lisp/cedet/semantic/imenu.el
+++ b/lisp/cedet/semantic/imenu.el
@@ -99,7 +99,7 @@ A nil value means to keep them in the same order.
99Overriden to nil if `semantic-imenu-bucketize-file' is nil." 99Overriden to nil if `semantic-imenu-bucketize-file' is nil."
100 :group 'semantic-imenu 100 :group 'semantic-imenu
101 :type 'boolean) 101 :type 'boolean)
102(make-variable-buffer-local 'semantic-imenu-bucketize-type-parts) 102(make-variable-buffer-local 'semantic-imenu-bucketize-type-members)
103(semantic-varalias-obsolete 'semantic-imenu-bucketize-type-parts 103(semantic-varalias-obsolete 'semantic-imenu-bucketize-type-parts
104 'semantic-imenu-bucketize-type-members "23.2") 104 'semantic-imenu-bucketize-type-members "23.2")
105 105
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index 58ad681008c..88b77e50e1d 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -864,42 +864,45 @@ and variable state from the current buffer."
864 semantic-lex-spp-expanded-macro-stack 864 semantic-lex-spp-expanded-macro-stack
865 )) 865 ))
866 ) 866 )
867 (with-current-buffer buf 867 (if (> semantic-lex-spp-hack-depth 5)
868 (erase-buffer) 868 nil
869 ;; Below is a painful hack to make sure everything is setup correctly. 869 (with-current-buffer buf
870 (when (not (eq major-mode mode)) 870 (erase-buffer)
871 (save-match-data 871 ;; Below is a painful hack to make sure everything is setup correctly.
872 872 (when (not (eq major-mode mode))
873 ;; Protect against user-hooks that throw errors. 873 (save-match-data
874 (condition-case nil 874
875 (funcall mode) 875 ;; Protect against user-hooks that throw errors.
876 (error nil)) 876 (condition-case nil
877 877 (funcall mode)
878 ;; Hack in mode-local 878 (error nil))
879 (activate-mode-local-bindings) 879
880 ;; CHEATER! The following 3 lines are from 880 ;; Hack in mode-local
881 ;; `semantic-new-buffer-fcn', but we don't want to turn 881 (activate-mode-local-bindings)
882 ;; on all the other annoying modes for this little task. 882
883 (setq semantic-new-buffer-fcn-was-run t) 883 ;; CHEATER! The following 3 lines are from
884 (semantic-lex-init) 884 ;; `semantic-new-buffer-fcn', but we don't want to turn
885 (semantic-clear-toplevel-cache) 885 ;; on all the other annoying modes for this little task.
886 (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook 886 (setq semantic-new-buffer-fcn-was-run t)
887 t) 887 (semantic-lex-init)
888 )) 888 (semantic-clear-toplevel-cache)
889 (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
890 t)
891 ))
889 892
890 ;; Second Cheat: copy key variables regarding macro state from the 893 ;; Second Cheat: copy key variables regarding macro state from the
891 ;; the originating buffer we are parsing. We need to do this every time 894 ;; the originating buffer we are parsing. We need to do this every time
892 ;; since the state changes. 895 ;; since the state changes.
893 (dolist (V important-vars) 896 (dolist (V important-vars)
894 (set V (semantic-buffer-local-value V origbuff))) 897 (set V (semantic-buffer-local-value V origbuff)))
895 (insert text) 898 (insert text)
896 (goto-char (point-min)) 899 (goto-char (point-min))
897 900
898 (setq fresh-toks (semantic-lex-spp-stream-for-macro (point-max)))) 901 (setq fresh-toks (semantic-lex-spp-stream-for-macro (point-max))))
899 902
900 (dolist (tok fresh-toks) 903 (dolist (tok fresh-toks)
901 (when (memq (semantic-lex-token-class tok) '(symbol semantic-list)) 904 (when (memq (semantic-lex-token-class tok) '(symbol semantic-list))
902 (setq toks (cons tok toks)))) 905 (setq toks (cons tok toks)))))
903 906
904 (nreverse toks))) 907 (nreverse toks)))
905 908
diff --git a/lisp/cedet/semantic/scope.el b/lisp/cedet/semantic/scope.el
index 6da2e9d779a..f2472ef9410 100644
--- a/lisp/cedet/semantic/scope.el
+++ b/lisp/cedet/semantic/scope.el
@@ -67,7 +67,7 @@
67 :documentation 67 :documentation
68 "The list of types currently in scope. 68 "The list of types currently in scope.
69For C++, this would contain anonymous namespaces known, and 69For C++, this would contain anonymous namespaces known, and
70anything labled by a `using' statement.") 70anything labeled by a `using' statement.")
71 (parents :initform nil 71 (parents :initform nil
72 :documentation 72 :documentation
73 "List of parents in scope w/in the body of this function. 73 "List of parents in scope w/in the body of this function.
@@ -239,8 +239,11 @@ are from nesting data types."
239 ) 239 )
240 ;; In case of arg lists or some-such, throw out non-types. 240 ;; In case of arg lists or some-such, throw out non-types.
241 (while (and stack (not (semantic-tag-of-class-p pparent 'type))) 241 (while (and stack (not (semantic-tag-of-class-p pparent 'type)))
242 (setq stack (cdr stack) 242 (setq stack (cdr stack) pparent (car (cdr stack))))
243 pparent (car (cdr stack)))) 243
244 ;; Remove duplicates
245 (while (member pparent scopetypes)
246 (setq stack (cdr stack) pparent (car (cdr stack))))
244 247
245 ;; Step 1: 248 ;; Step 1:
246 ;; Analyze the stack of tags we are nested in as parents. 249 ;; Analyze the stack of tags we are nested in as parents.
@@ -611,7 +614,7 @@ whose tags can be searched when needed, OR it may be a scope object."
611 ;; to do any of the stuff related to variables and what-not. 614 ;; to do any of the stuff related to variables and what-not.
612 (setq tmpscope (semantic-scope-cache "mini")) 615 (setq tmpscope (semantic-scope-cache "mini"))
613 (let* ( ;; Step 1: 616 (let* ( ;; Step 1:
614 (scopetypes (semantic-analyze-scoped-types (point))) 617 (scopetypes (cons type (semantic-analyze-scoped-types (point))))
615 (parents (semantic-analyze-scope-nested-tags (point) scopetypes)) 618 (parents (semantic-analyze-scope-nested-tags (point) scopetypes))
616 ;;(parentinherited (semantic-analyze-scope-lineage-tags parents scopetypes)) 619 ;;(parentinherited (semantic-analyze-scope-lineage-tags parents scopetypes))
617 (lscope nil) 620 (lscope nil)
diff --git a/lisp/cedet/semantic/sort.el b/lisp/cedet/semantic/sort.el
index 1cbb6787460..064ef19ab9a 100644
--- a/lisp/cedet/semantic/sort.el
+++ b/lisp/cedet/semantic/sort.el
@@ -463,7 +463,7 @@ include the default behavior, and merely extend your own."
463 ) 463 )
464 464
465(defun semantic-tag-external-member-parent-default (tag) 465(defun semantic-tag-external-member-parent-default (tag)
466 "Return the name of TAGs parent only if TAG is not defined in it's parent." 466 "Return the name of TAGs parent only if TAG is not defined in its parent."
467 ;; Use only the extra spec because a type has a parent which 467 ;; Use only the extra spec because a type has a parent which
468 ;; means something completely different. 468 ;; means something completely different.
469 (let ((tp (semantic-tag-get-attribute tag :parent))) 469 (let ((tp (semantic-tag-get-attribute tag :parent)))
@@ -473,7 +473,7 @@ include the default behavior, and merely extend your own."
473(define-overloadable-function semantic-tag-external-member-p (parent tag) 473(define-overloadable-function semantic-tag-external-member-p (parent tag)
474 "Return non-nil if PARENT is the parent of TAG. 474 "Return non-nil if PARENT is the parent of TAG.
475TAG is an external member of PARENT when it is somehow tagged 475TAG is an external member of PARENT when it is somehow tagged
476as having PARENT as it's parent. 476as having PARENT as its parent.
477PARENT and TAG must both be semantic tags. 477PARENT and TAG must both be semantic tags.
478 478
479The default behavior, if not overridden with 479The default behavior, if not overridden with
diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el
index f1e3f9a5d95..d36beffc95f 100644
--- a/lisp/cedet/semantic/symref.el
+++ b/lisp/cedet/semantic/symref.el
@@ -71,6 +71,7 @@
71(declare-function data-debug-insert-object-slots "eieio-datadebug") 71(declare-function data-debug-insert-object-slots "eieio-datadebug")
72(declare-function ede-toplevel "ede/files") 72(declare-function ede-toplevel "ede/files")
73(declare-function ede-project-root-directory "ede/files") 73(declare-function ede-project-root-directory "ede/files")
74(declare-function ede-up-directory "ede/files")
74 75
75;;; Code: 76;;; Code:
76(defvar semantic-symref-tool 'detect 77(defvar semantic-symref-tool 'detect
@@ -98,16 +99,27 @@ is supported.
98 99
99If no tools are supported, then 'grep is assumed.") 100If no tools are supported, then 'grep is assumed.")
100 101
102(defun semantic-symref-calculate-rootdir ()
103 "Calculate the root directory for a symref search.
104Start with and EDE project, or use the default directory."
105 (let* ((rootproj (when (and (featurep 'ede) ede-minor-mode)
106 (ede-toplevel)))
107 (rootdirbase (if rootproj
108 (ede-project-root-directory rootproj)
109 default-directory)))
110 (if (and rootproj (condition-case nil
111 ;; Hack for subprojects.
112 (oref rootproj :metasubproject)
113 (error nil)))
114 (ede-up-directory rootdirbase)
115 rootdirbase)))
116
101(defun semantic-symref-detect-symref-tool () 117(defun semantic-symref-detect-symref-tool ()
102 "Detect the symref tool to use for the current buffer." 118 "Detect the symref tool to use for the current buffer."
103 (if (not (eq semantic-symref-tool 'detect)) 119 (if (not (eq semantic-symref-tool 'detect))
104 semantic-symref-tool 120 semantic-symref-tool
105 ;; We are to perform a detection for the right tool to use. 121 ;; We are to perform a detection for the right tool to use.
106 (let* ((rootproj (when (and (featurep 'ede) ede-minor-mode) 122 (let* ((rootdir (semantic-symref-calculate-rootdir))
107 (ede-toplevel)))
108 (rootdir (if rootproj
109 (ede-project-root-directory rootproj)
110 default-directory))
111 (tools semantic-symref-tool-alist)) 123 (tools semantic-symref-tool-alist))
112 (while (and tools (eq semantic-symref-tool 'detect)) 124 (while (and tools (eq semantic-symref-tool 'detect))
113 (when (funcall (car (car tools)) rootdir) 125 (when (funcall (car (car tools)) rootdir)
diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el
index b326062e97d..521babc1f6e 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -30,10 +30,6 @@
30(require 'semantic/symref) 30(require 'semantic/symref)
31(require 'grep) 31(require 'grep)
32 32
33(defvar ede-minor-mode)
34(declare-function ede-toplevel "ede/files")
35(declare-function ede-project-root-directory "ede/files")
36
37;;; Code: 33;;; Code:
38 34
39;;; GREP 35;;; GREP
@@ -86,7 +82,7 @@ Optional argument MODE specifies the `major-mode' to test."
86 " -o ") 82 " -o ")
87 " \\)")) 83 " \\)"))
88 (t 84 (t
89 (error "Configuration for `semantic-symref-tool-grep' needed for %s" major-mode)) 85 (error "Customize `semantic-symref-filepattern-alist' for %s" major-mode))
90 ))) 86 )))
91 87
92(defvar semantic-symref-grep-expand-keywords 88(defvar semantic-symref-grep-expand-keywords
@@ -119,6 +115,12 @@ GREPPATTERN is the pattern used by grep."
119 ;;(message "New command: %s" cmd) 115 ;;(message "New command: %s" cmd)
120 cmd)) 116 cmd))
121 117
118(defcustom semantic-symref-grep-shell "sh"
119 "The shell command to use for executing find/grep.
120This shell should support pipe redirect syntax."
121 :group 'semantic
122 :type 'string)
123
122(defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep)) 124(defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep))
123 "Perform a search with Grep." 125 "Perform a search with Grep."
124 ;; Grep doesn't support some types of searches. 126 ;; Grep doesn't support some types of searches.
@@ -129,19 +131,7 @@ GREPPATTERN is the pattern used by grep."
129 ;; Find the root of the project, and do a find-grep... 131 ;; Find the root of the project, and do a find-grep...
130 (let* (;; Find the file patterns to use. 132 (let* (;; Find the file patterns to use.
131 (pat (cdr (assoc major-mode semantic-symref-filepattern-alist))) 133 (pat (cdr (assoc major-mode semantic-symref-filepattern-alist)))
132 (rootdir (cond 134 (rootdir (semantic-symref-calculate-rootdir))
133 ;; Project root via EDE.
134 ((eq (oref tool :searchscope) 'project)
135 (let ((rootproj (when (and (featurep 'ede) ede-minor-mode)
136 (ede-toplevel))))
137 (if rootproj
138 (ede-project-root-directory rootproj)
139 default-directory)))
140 ;; Calculate the target files as just in
141 ;; this directory... cause I'm lazy.
142 ((eq (oref tool :searchscope) 'target)
143 default-directory)
144 ))
145 (filepattern (semantic-symref-derive-find-filepatterns)) 135 (filepattern (semantic-symref-derive-find-filepatterns))
146 ;; Grep based flags. 136 ;; Grep based flags.
147 (grepflags (cond ((eq (oref tool :resulttype) 'file) 137 (grepflags (cond ((eq (oref tool :resulttype) 'file)
@@ -168,10 +158,10 @@ GREPPATTERN is the pattern used by grep."
168 (let ((cmd (concat "find " default-directory " -type f " filepattern " -print0 " 158 (let ((cmd (concat "find " default-directory " -type f " filepattern " -print0 "
169 "| xargs -0 grep -H " grepflags "-e " greppat))) 159 "| xargs -0 grep -H " grepflags "-e " greppat)))
170 ;;(message "Old command: %s" cmd) 160 ;;(message "Old command: %s" cmd)
171 (call-process "sh" nil b nil "-c" cmd) 161 (call-process semantic-symref-grep-shell nil b nil "-c" cmd)
172 ) 162 )
173 (let ((cmd (semantic-symref-grep-use-template rootdir filepattern grepflags greppat))) 163 (let ((cmd (semantic-symref-grep-use-template rootdir filepattern grepflags greppat)))
174 (call-process "sh" nil b nil "-c" cmd)) 164 (call-process semantic-symref-grep-shell nil b nil "-c" cmd))
175 )) 165 ))
176 (setq ans (semantic-symref-parse-tool-output tool b)) 166 (setq ans (semantic-symref-parse-tool-output tool b))
177 ;; Return the answer 167 ;; Return the answer
diff --git a/lisp/cedet/semantic/symref/list.el b/lisp/cedet/semantic/symref/list.el
index cfc032af9ad..9e0ee2a1b5b 100644
--- a/lisp/cedet/semantic/symref/list.el
+++ b/lisp/cedet/semantic/symref/list.el
@@ -33,6 +33,7 @@
33 33
34(require 'semantic/symref) 34(require 'semantic/symref)
35(require 'semantic/complete) 35(require 'semantic/complete)
36(require 'semantic/senator)
36(require 'pulse) 37(require 'pulse)
37 38
38;;; Code: 39;;; Code:
@@ -42,9 +43,9 @@
42 "Find references to the current tag. 43 "Find references to the current tag.
43This command uses the currently configured references tool within the 44This command uses the currently configured references tool within the
44current project to find references to the current tag. The 45current project to find references to the current tag. The
45references are the organized by file and the name of the function 46references are organized by file and the name of the function
46they are used in. 47they are used in.
47Display the references in`semantic-symref-results-mode'." 48Display the references in `semantic-symref-results-mode'."
48 (interactive) 49 (interactive)
49 (semantic-fetch-tags) 50 (semantic-fetch-tags)
50 (let ((ct (semantic-current-tag)) 51 (let ((ct (semantic-current-tag))
@@ -65,6 +66,24 @@ Display the references in`semantic-symref-results-mode'."
65 "Find references to the symbol SYM. 66 "Find references to the symbol SYM.
66This command uses the currently configured references tool within the 67This command uses the currently configured references tool within the
67current project to find references to the input SYM. The 68current project to find references to the input SYM. The
69references are organized by file and the name of the function
70they are used in.
71Display the references in `semantic-symref-results-mode'."
72 (interactive (list (semantic-tag-name (semantic-complete-read-tag-buffer-deep
73 "Symrefs for: "))))
74 (semantic-fetch-tags)
75 (let ((res nil)
76 )
77 ;; Gather results and tags
78 (message "Gathering References...")
79 (setq res (semantic-symref-find-references-by-name sym))
80 (semantic-symref-produce-list-on-results res sym)))
81
82;;;###autoload
83(defun semantic-symref-regexp (sym)
84 "Find references to the a symbol regexp SYM.
85This command uses the currently configured references tool within the
86current project to find references to the input SYM. The
68references are the organized by file and the name of the function 87references are the organized by file and the name of the function
69they are used in. 88they are used in.
70Display the references in`semantic-symref-results-mode'." 89Display the references in`semantic-symref-results-mode'."
@@ -75,7 +94,7 @@ Display the references in`semantic-symref-results-mode'."
75 ) 94 )
76 ;; Gather results and tags 95 ;; Gather results and tags
77 (message "Gathering References...") 96 (message "Gathering References...")
78 (setq res (semantic-symref-find-references-by-name sym)) 97 (setq res (semantic-symref-find-text sym))
79 (semantic-symref-produce-list-on-results res sym))) 98 (semantic-symref-produce-list-on-results res sym)))
80 99
81 100
@@ -110,11 +129,59 @@ Display the references in`semantic-symref-results-mode'."
110 (define-key km "n" 'semantic-symref-list-next-line) 129 (define-key km "n" 'semantic-symref-list-next-line)
111 (define-key km "p" 'semantic-symref-list-prev-line) 130 (define-key km "p" 'semantic-symref-list-prev-line)
112 (define-key km "q" 'semantic-symref-hide-buffer) 131 (define-key km "q" 'semantic-symref-hide-buffer)
132 (define-key km "\C-c\C-e" 'semantic-symref-list-expand-all)
133 (define-key km "\C-c\C-r" 'semantic-symref-list-contract-all)
134 (define-key km "R" 'semantic-symref-list-rename-open-hits)
135 (define-key km "(" 'semantic-symref-list-create-macro-on-open-hit)
136 (define-key km "E" 'semantic-symref-list-call-macro-on-open-hits)
113 km) 137 km)
114 "Keymap used in `semantic-symref-results-mode'.") 138 "Keymap used in `semantic-symref-results-mode'.")
115 139
140(defvar semantic-symref-list-menu-entries
141 (list
142 "Symref"
143 (semantic-menu-item
144 ["Toggle Line Open"
145 semantic-symref-list-toggle-showing
146 :active t
147 :help "Toggle the current line open or closed."
148 ])
149 (semantic-menu-item
150 ["Expand All Entries"
151 semantic-symref-list-expand-all
152 :active t
153 :help "Expand every expandable entry."
154 ])
155 (semantic-menu-item
156 ["Contract All Entries"
157 semantic-symref-list-contract-all
158 :active t
159 :help "Close every expandable entry."
160 ])
161 (semantic-menu-item
162 ["Rename Symbol in Open hits"
163 semantic-symref-list-rename-open-hits
164 :active t
165 :help "Rename the searched for symbol in all hits that are currently open."
166 ])
167 )
168 "Menu entries for the Semantic Symref list mode.")
169
170(defvar semantic-symref-list-menu nil
171 "Menu keymap build from `semantic-symref-results-mode'.")
172
173(easy-menu-define semantic-symref-list-menu
174 semantic-symref-results-mode-map
175 "Symref Mode Menu"
176 semantic-symref-list-menu-entries)
177
178(defcustom semantic-symref-auto-expand-results nil
179 "Non-nil to expand symref results on buffer creation."
180 :group 'semantic-symref
181 :type 'boolean)
182
116(defcustom semantic-symref-results-mode-hook nil 183(defcustom semantic-symref-results-mode-hook nil
117 "*Hook run when `semantic-symref-results-mode' starts." 184 "Hook run when `semantic-symref-results-mode' starts."
118 :group 'semantic-symref 185 :group 'semantic-symref
119 :type 'hook) 186 :type 'hook)
120 187
@@ -189,6 +256,10 @@ Some useful functions are found in `semantic-format-tag-functions'."
189 256
190 )) 257 ))
191 258
259 ;; Auto expand
260 (when semantic-symref-auto-expand-results
261 (semantic-symref-list-expand-all))
262
192 ;; Clean up the mess 263 ;; Clean up the mess
193 (toggle-read-only 1) 264 (toggle-read-only 1)
194 (set-buffer-modified-p nil) 265 (set-buffer-modified-p nil)
@@ -305,7 +376,8 @@ BUTTON is the button that was clicked."
305 (win (selected-window)) 376 (win (selected-window))
306 ) 377 )
307 (switch-to-buffer-other-window buff) 378 (switch-to-buffer-other-window buff)
308 (with-no-warnings (goto-line line)) 379 (goto-char (point-min))
380 (forward-line (1- line))
309 (pulse-momentary-highlight-one-line (point)) 381 (pulse-momentary-highlight-one-line (point))
310 (when (eq last-command-event ?\s) (select-window win)) 382 (when (eq last-command-event ?\s) (select-window win))
311 ) 383 )
@@ -323,6 +395,158 @@ BUTTON is the button that was clicked."
323 (forward-line -1) 395 (forward-line -1)
324 (back-to-indentation)) 396 (back-to-indentation))
325 397
398(defun semantic-symref-list-expand-all ()
399 "Expand all the nodes in the current buffer."
400 (interactive)
401 (let ((start (make-marker)))
402 (move-marker start (point))
403 (goto-char (point-min))
404 (while (re-search-forward "\\[[+]\\]" nil t)
405 (semantic-symref-list-toggle-showing))
406 ;; Restore position
407 (goto-char start)))
408
409(defun semantic-symref-list-contract-all ()
410 "Expand all the nodes in the current buffer."
411 (interactive)
412 (let ((start (make-marker)))
413 (move-marker start (point))
414 (goto-char (point-min))
415 (while (re-search-forward "\\[[-]\\]" nil t)
416 (semantic-symref-list-toggle-showing))
417 ;; Restore position
418 (goto-char start)))
419
420;;; UTILS
421;;
422;; List mode utils for understadning the current line
423
424(defun semantic-symref-list-on-hit-p ()
425 "Return the line number if the cursor is on a buffer line with a hit.
426Hits are the line of code from the buffer, not the tag summar or file lines."
427 (save-excursion
428 (end-of-line)
429 (let* ((ol (car (semantic-overlays-at (1- (point)))))) ;; trust this for now
430 (when ol (semantic-overlay-get ol 'line)))))
431
432
433;;; Keyboard Macros on a Hit
434;;
435;; Record a macro on a hit, and store in a special way for execution later.
436(defun semantic-symref-list-create-macro-on-open-hit ()
437 "Record a keyboard macro at the location of the hit in the current list.
438Under point should be one hit for the active keyword. Move
439cursor to the beginning of that symbol, then record a macro as if
440`kmacro-start-macro' was pressed. Use `kmacro-end-macro',
441{kmacro-end-macro} to end the macro, and return to the symbol found list."
442 (interactive)
443 (let* ((oldsym (oref (oref semantic-symref-current-results
444 :created-by)
445 :searchfor))
446 (ol (save-excursion
447 (end-of-line)
448 (car (semantic-overlays-at (1- (point))))))
449 (tag (when ol (semantic-overlay-get ol 'tag)))
450 (line (when ol (semantic-overlay-get ol 'line))))
451 (when (not line)
452 (error "Cannot create macro on a non-hit line"))
453 ;; Go there, and do something useful.
454 (switch-to-buffer-other-window (semantic-tag-buffer tag))
455 (goto-char (point-min))
456 (forward-line (1- line))
457 (when (not (re-search-forward (regexp-quote oldsym) (point-at-eol) t))
458 (error "Cannot find hit. Cannot record macro"))
459 (goto-char (match-beginning 0))
460 ;; Cursor is now in the right location. Start recording a macro.
461 (kmacro-start-macro nil)
462 ;; Notify the user
463 (message "Complete with C-x ). Use E in the symref buffer to call this macro.")))
464
465(defun semantic-symref-list-call-macro-on-open-hits ()
466 "Call the most recently created keyboard macro on each hit.
467Cursor is placed at the beginning of the symbol found, even if
468there is more than one symbol on the current line. The
469previously recorded macro is then executed."
470 (interactive)
471 (save-window-excursion
472 (let ((count (semantic-symref-list-map-open-hits
473 (lambda ()
474 (switch-to-buffer (current-buffer))
475 (kmacro-call-macro nil)))))
476 (semantic-symref-list-update-open-hits)
477 (message "Executed Macro %d times." count))))
478
479;;; REFACTORING EDITS
480;;
481;; Utilities and features for refactoring across a list of hits.
482;;
483(defun semantic-symref-list-rename-open-hits (newname)
484 "Rename the discovered symbol references to NEWNAME.
485Only renames the locations that are open in the symref list.
486Closed items will be skipped."
487 (interactive
488 (list (read-string "Rename to: "
489 (oref (oref semantic-symref-current-results
490 :created-by)
491 :searchfor))))
492 (let ((count (semantic-symref-list-map-open-hits
493 (lambda () (replace-match newname nil t)))))
494 (semantic-symref-list-update-open-hits)
495 (message "Renamed %d occurances." count)))
496
497;;; REFACTORING UTILITIES
498;;
499;; Refactoring tools want to operate on only the "good" stuff the
500;; user selected.
501(defun semantic-symref-list-map-open-hits (function)
502 "For every open hit in the symref buffer, perform FUNCTION.
503The `match-data' will be set to a successful hit of the searched for symbol.
504Return the number of occurances FUNCTION was operated upon."
505
506 ;; First Pass in this function - a straight rename.
507 ;; Second Pass - Allow context specification based on
508 ;; class members. (Not Done)
509
510 (let ((oldsym (oref (oref semantic-symref-current-results
511 :created-by)
512 :searchfor))
513 (count 0))
514 (save-excursion
515 (goto-char (point-min))
516 (while (not (eobp))
517 ;; Is this line a "hit" line?
518 (let* ((ol (car (semantic-overlays-at (1- (point))))) ;; trust this for now
519 (tag (when ol (semantic-overlay-get ol 'tag)))
520 (line (when ol (semantic-overlay-get ol 'line))))
521 (when line
522 ;; The "line" means we have an open hit.
523 (with-current-buffer (semantic-tag-buffer tag)
524 (goto-char (point-min))
525 (forward-line (1- line))
526 (beginning-of-line)
527 (while (re-search-forward (regexp-quote oldsym) (point-at-eol) t)
528 (setq count (1+ count))
529 (save-excursion ;; Leave cursor after the matched name.
530 (goto-char (match-beginning 0)) ;; Go to beginning of that sym
531 (funcall function))))))
532 ;; Go to the next line
533 (forward-line 1)
534 (end-of-line)))
535 count))
536
537(defun semantic-symref-list-update-open-hits ()
538 "Update the text for all the open hits in the symref list."
539 (save-excursion
540 (goto-char (point-min))
541 (while (re-search-forward "\\[-\\]" nil t)
542 (end-of-line)
543 (let* ((ol (car (semantic-overlays-at (1- (point))))) ;; trust this for now
544 (tag (when ol (semantic-overlay-get ol 'tag))))
545 ;; If there is a tag, then close/open it.
546 (when tag
547 (semantic-symref-list-toggle-showing)
548 (semantic-symref-list-toggle-showing))))))
549
326(provide 'semantic/symref/list) 550(provide 'semantic/symref/list)
327 551
328;; Local variables: 552;; Local variables:
diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el
index c324d5cfb46..e9094fcb051 100644
--- a/lisp/cedet/semantic/tag.el
+++ b/lisp/cedet/semantic/tag.el
@@ -687,18 +687,24 @@ This function is for internal use only."
687;; 687;;
688(defun semantic-tag-deep-copy-one-tag (tag &optional filter) 688(defun semantic-tag-deep-copy-one-tag (tag &optional filter)
689 "Make a deep copy of TAG, applying FILTER to each child-tag. 689 "Make a deep copy of TAG, applying FILTER to each child-tag.
690Properties and overlay info are not copied. 690No properties are copied except for :filename.
691FILTER takes TAG as an argument, and should returns a semantic-tag. 691Overlay will be a vector.
692FILTER takes TAG as an argument, and should return a `semantic-tag'.
692It is safe for FILTER to modify the input tag and return it." 693It is safe for FILTER to modify the input tag and return it."
693 (when (not filter) (setq filter 'identity)) 694 (when (not filter) (setq filter 'identity))
694 (when (not (semantic-tag-p tag)) 695 (when (not (semantic-tag-p tag))
695 (signal 'wrong-type-argument (list tag 'semantic-tag-p))) 696 (signal 'wrong-type-argument (list tag 'semantic-tag-p)))
696 (funcall filter (list (semantic-tag-name tag) 697 (let ((ol (semantic-tag-overlay tag))
697 (semantic-tag-class tag) 698 (fn (semantic-tag-file-name tag)))
698 (semantic--tag-deep-copy-attributes 699 (funcall filter (list (semantic-tag-name tag)
699 (semantic-tag-attributes tag) filter) 700 (semantic-tag-class tag)
700 nil 701 (semantic--tag-deep-copy-attributes
701 nil))) 702 (semantic-tag-attributes tag) filter)
703 ;; Only copy the filename property
704 (when fn (list :filename fn))
705 ;; Only setup a vector if we had an overlay.
706 (when ol (vector (semantic-tag-start tag)
707 (semantic-tag-end tag)))))))
702 708
703(defun semantic--tag-deep-copy-attributes (attrs &optional filter) 709(defun semantic--tag-deep-copy-attributes (attrs &optional filter)
704 "Make a deep copy of ATTRS, applying FILTER to each child-tag. 710 "Make a deep copy of ATTRS, applying FILTER to each child-tag.
@@ -877,7 +883,7 @@ That is the value of the `:throws' attribute."
877 "Return the parent of the function that TAG describes. 883 "Return the parent of the function that TAG describes.
878That is the value of the `:parent' attribute. 884That is the value of the `:parent' attribute.
879A function has a parent if it is a method of a class, and if the 885A function has a parent if it is a method of a class, and if the
880function does not appear in body of it's parent class." 886function does not appear in body of its parent class."
881 (semantic-tag-named-parent tag)) 887 (semantic-tag-named-parent tag))
882 888
883(defsubst semantic-tag-function-destructor-p (tag) 889(defsubst semantic-tag-function-destructor-p (tag)
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el
index e6ab498ea04..2879998a1a8 100644
--- a/lisp/cedet/semantic/texi.el
+++ b/lisp/cedet/semantic/texi.el
@@ -591,12 +591,16 @@ Note: TYPE not yet implemented."
591;; ;; Test for doc string 591;; ;; Test for doc string
592;; (unless docstring 592;; (unless docstring
593;; (error "Could not find documentation for %s" (semantic-tag-name tag))) 593;; (error "Could not find documentation for %s" (semantic-tag-name tag)))
594;;
595;; (require 'srecode)
596;; (require 'srecode-texi)
597;;
594;; ;; If we have a string, do the replacement. 598;; ;; If we have a string, do the replacement.
595;; (delete-region (semantic-tag-start tag) 599;; (delete-region (semantic-tag-start tag)
596;; (semantic-tag-end tag)) 600;; (semantic-tag-end tag))
597;; ;; Use useful functions from the docaument library. 601;; ;; Use useful functions from the docaument library.
598;; (require 'document) 602;; (srecode-texi-insert-tag-as-doc doctag)
599;; (document-insert-texinfo doctag (semantic-tag-buffer doctag)) 603;; ;(semantic-insert-foreign-tag doctag)
600;; )) 604;; ))
601 605
602;; (defun semantic-texi-update-doc-from-source (&optional tag) 606;; (defun semantic-texi-update-doc-from-source (&optional tag)
diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el
index 9f53dffea98..ccfdc1c906e 100644
--- a/lisp/cedet/semantic/util-modes.el
+++ b/lisp/cedet/semantic/util-modes.el
@@ -743,6 +743,13 @@ minor mode is enabled."
743 "List of tag classes which stickyfunc will display in the header line.") 743 "List of tag classes which stickyfunc will display in the header line.")
744(make-variable-buffer-local 'semantic-stickyfunc-sticky-classes) 744(make-variable-buffer-local 'semantic-stickyfunc-sticky-classes)
745 745
746(defcustom semantic-stickyfunc-show-only-functions-p nil
747 "Non-nil means don't show lines that aren't part of a tag.
748If this is nil, then comments or other text between tags that is
7491 line above the top of the current window will be shown."
750 :group 'semantic
751 :type 'boolean)
752
746(defun semantic-stickyfunc-tag-to-stick () 753(defun semantic-stickyfunc-tag-to-stick ()
747 "Return the tag to stick at the current point." 754 "Return the tag to stick at the current point."
748 (let ((tags (nreverse (semantic-find-tag-by-overlay (point))))) 755 (let ((tags (nreverse (semantic-find-tag-by-overlay (point)))))
@@ -759,45 +766,51 @@ minor mode is enabled."
759 "Make the function at the top of the current window sticky. 766 "Make the function at the top of the current window sticky.
760Capture its function declaration, and place it in the header line. 767Capture its function declaration, and place it in the header line.
761If there is no function, disable the header line." 768If there is no function, disable the header line."
762 (let ((str 769 (save-excursion
763 (save-excursion 770 (goto-char (window-start (selected-window)))
764 (goto-char (window-start (selected-window))) 771 (let* ((noshow (bobp))
765 (forward-line -1) 772 (str
766 (end-of-line) 773 (progn
767 ;; Capture this function 774 (forward-line -1)
768 (let* ((tag (semantic-stickyfunc-tag-to-stick))) 775 (end-of-line)
769 ;; TAG is nil if there was nothing of the appropriate type there. 776 ;; Capture this function
770 (if (not tag) 777 (let* ((tag (semantic-stickyfunc-tag-to-stick)))
771 ;; Set it to be the text under the header line 778 ;; TAG is nil if there was nothing of the appropriate type there.
772 (buffer-substring (point-at-bol) (point-at-eol)) 779 (if (not tag)
773 ;; Get it 780 ;; Set it to be the text under the header line
774 (goto-char (semantic-tag-start tag)) 781 (if noshow
775 ;; Klaus Berndl <klaus.berndl@sdm.de>: 782 ""
776 ;; goto the tag name; this is especially needed for languages 783 (if semantic-stickyfunc-show-only-functions-p ""
777 ;; like c++ where a often used style is like: 784 (buffer-substring (point-at-bol) (point-at-eol))
778 ;; void 785 ))
779 ;; ClassX::methodM(arg1...) 786 ;; Go get the first line of this tag.
780 ;; { 787 (goto-char (semantic-tag-start tag))
781 ;; ... 788 ;; Klaus Berndl <klaus.berndl@sdm.de>:
782 ;; } 789 ;; goto the tag name; this is especially needed for languages
783 ;; Without going to the tag-name we would get"void" in the 790 ;; like c++ where a often used style is like:
784 ;; header line which is IMHO not really useful 791 ;; void
785 (search-forward (semantic-tag-name tag) nil t) 792 ;; ClassX::methodM(arg1...)
786 (buffer-substring (point-at-bol) (point-at-eol)) 793 ;; {
787 )))) 794 ;; ...
788 (start 0)) 795 ;; }
789 (while (string-match "%" str start) 796 ;; Without going to the tag-name we would get"void" in the
790 (setq str (replace-match "%%" t t str 0) 797 ;; header line which is IMHO not really useful
791 start (1+ (match-end 0))) 798 (search-forward (semantic-tag-name tag) nil t)
792 ) 799 (buffer-substring (point-at-bol) (point-at-eol))
793 ;; In 21.4 (or 22.1) the heder doesn't expand tabs. Hmmmm. 800 ))))
794 ;; We should replace them here. 801 (start 0))
795 ;; 802 (while (string-match "%" str start)
796 ;; This hack assumes that tabs are kept smartly at tab boundaries 803 (setq str (replace-match "%%" t t str 0)
797 ;; instead of in a tab boundary where it might only represent 4 spaces. 804 start (1+ (match-end 0)))
798 (while (string-match "\t" str start) 805 )
799 (setq str (replace-match " " t t str 0))) 806 ;; In 21.4 (or 22.1) the header doesn't expand tabs. Hmmmm.
800 str)) 807 ;; We should replace them here.
808 ;;
809 ;; This hack assumes that tabs are kept smartly at tab boundaries
810 ;; instead of in a tab boundary where it might only represent 4 spaces.
811 (while (string-match "\t" str start)
812 (setq str (replace-match " " t t str 0)))
813 str)))
801 814
802(defun semantic-stickyfunc-menu (event) 815(defun semantic-stickyfunc-menu (event)
803 "Popup a menu that can help a user understand stickyfunc-mode. 816 "Popup a menu that can help a user understand stickyfunc-mode.
diff --git a/lisp/cedet/semantic/util.el b/lisp/cedet/semantic/util.el
index 86c3517fb54..2b3f53a49d3 100644
--- a/lisp/cedet/semantic/util.el
+++ b/lisp/cedet/semantic/util.el
@@ -132,44 +132,6 @@ buffer, or a filename. If SOMETHING is nil return nil."
132(semantic-alias-obsolete 'semantic-something-to-stream 132(semantic-alias-obsolete 'semantic-something-to-stream
133 'semantic-something-to-tag-table "23.2") 133 'semantic-something-to-tag-table "23.2")
134 134
135;;; Recursive searching through dependency trees
136;;
137;; This will depend on the general searching APIS defined above.
138;; but will add full recursion through the dependencies list per
139;; stream.
140(defun semantic-recursive-find-nonterminal-by-name (name buffer)
141 "Recursively find the first occurrence of NAME.
142Start search with BUFFER. Recurse through all dependencies till found.
143The return item is of the form (BUFFER TOKEN) where BUFFER is the buffer
144in which TOKEN (the token found to match NAME) was found.
145
146THIS ISN'T USED IN SEMANTIC. DELETE ME SOON."
147 (with-current-buffer buffer
148 (let* ((stream (semantic-fetch-tags))
149 (includelist (or (semantic-find-tags-by-class 'include stream)
150 "empty.silly.thing"))
151 (found (semantic-find-first-tag-by-name name stream))
152 (unfound nil))
153 (while (and (not found) includelist)
154 (let ((fn (semantic-dependency-tag-file (car includelist))))
155 (if (and fn (not (member fn unfound)))
156 (with-current-buffer (save-match-data
157 (find-file-noselect fn))
158 (message "Scanning %s" (buffer-file-name))
159 (setq stream (semantic-fetch-tags))
160 (setq found (semantic-find-first-tag-by-name name stream))
161 (if found
162 (setq found (cons (current-buffer) (list found)))
163 (setq includelist
164 (append includelist
165 (semantic-find-tags-by-class
166 'include stream))))
167 (setq unfound (cons fn unfound)))))
168 (setq includelist (cdr includelist)))
169 found)))
170(make-obsolete 'semantic-recursive-find-nonterminal-by-name
171 "Do not use this function." "23.2")
172
173;;; Completion APIs 135;;; Completion APIs
174;; 136;;
175;; These functions provide minibuffer reading/completion for lists of 137;; These functions provide minibuffer reading/completion for lists of
@@ -315,11 +277,12 @@ If TAG is not specified, use the tag at point."
315 (princ "Buffer specific configuration items:\n") 277 (princ "Buffer specific configuration items:\n")
316 (let ((vars '(major-mode 278 (let ((vars '(major-mode
317 semantic-case-fold 279 semantic-case-fold
318 semantic-expand-nonterminal 280 semantic-tag-expand-function
319 semantic-parser-name 281 semantic-parser-name
320 semantic-parse-tree-state 282 semantic-parse-tree-state
321 semantic-lex-analyzer 283 semantic-lex-analyzer
322 semantic-lex-reset-hooks 284 semantic-lex-reset-hooks
285 semantic-lex-syntax-modifications
323 ))) 286 )))
324 (dolist (V vars) 287 (dolist (V vars)
325 (semantic-describe-buffer-var-helper V buff))) 288 (semantic-describe-buffer-var-helper V buff)))
@@ -334,7 +297,8 @@ If TAG is not specified, use the tag at point."
334 semantic-after-toplevel-cache-change-hook 297 semantic-after-toplevel-cache-change-hook
335 semantic-before-toplevel-cache-flush-hook 298 semantic-before-toplevel-cache-flush-hook
336 semantic-dump-parse 299 semantic-dump-parse
337 300 semantic-type-relation-separator-character
301 semantic-command-separation-character
338 ))) 302 )))
339 (dolist (V vars) 303 (dolist (V vars)
340 (semantic-describe-buffer-var-helper V buff))) 304 (semantic-describe-buffer-var-helper V buff)))
@@ -344,34 +308,6 @@ If TAG is not specified, use the tag at point."
344 ))) 308 )))
345 ) 309 )
346 310
347(defun semantic-current-tag-interactive (p)
348 "Display the current token.
349Argument P is the point to search from in the current buffer."
350 (interactive "d")
351 (require 'semantic/find)
352 (let ((tok (semantic-brute-find-innermost-tag-by-position
353 p (current-buffer))))
354 (message (mapconcat 'semantic-abbreviate-nonterminal tok ","))
355 (car tok))
356 )
357
358(defun semantic-hack-search ()
359 "Display info about something under the cursor using generic methods."
360 (interactive)
361 (require 'semantic/find)
362 (let ((strm (cdr (semantic-fetch-tags)))
363 (res nil))
364 (setq res (semantic-brute-find-tag-by-position (point) strm))
365 (if res
366 (progn
367 (pop-to-buffer "*SEMANTIC HACK RESULTS*")
368 (require 'pp)
369 (erase-buffer)
370 (insert (pp-to-string res) "\n")
371 (goto-char (point-min))
372 (shrink-window-if-larger-than-buffer))
373 (message "nil"))))
374
375(defun semantic-assert-valid-token (tok) 311(defun semantic-assert-valid-token (tok)
376 "Assert that TOK is a valid token." 312 "Assert that TOK is a valid token."
377 (if (semantic-tag-p tok) 313 (if (semantic-tag-p tok)
@@ -415,7 +351,8 @@ NOTFIRST indicates that this was not the first call in the recursive use."
415 'unmatched))) 351 'unmatched)))
416 (setq o (cons (car over) o))) 352 (setq o (cons (car over) o)))
417 (setq over (cdr over))) 353 (setq over (cdr over)))
418 (message "Remaining overlays: %S" o))) 354 (when (called-interactively-p 'any)
355 (message "Remaining overlays: %S" o))))
419 over) 356 over)
420 357
421;;; Interactive commands (from Senator). 358;;; Interactive commands (from Senator).
diff --git a/lisp/cedet/semantic/wisent/python-wy.el b/lisp/cedet/semantic/wisent/python-wy.el
index 29b0626ffa6..264ebe9bb7b 100644
--- a/lisp/cedet/semantic/wisent/python-wy.el
+++ b/lisp/cedet/semantic/wisent/python-wy.el
@@ -35,6 +35,7 @@
35(defconst wisent-python-wy--keyword-table 35(defconst wisent-python-wy--keyword-table
36 (semantic-lex-make-keyword-table 36 (semantic-lex-make-keyword-table
37 '(("and" . AND) 37 '(("and" . AND)
38 ("as" . AS)
38 ("assert" . ASSERT) 39 ("assert" . ASSERT)
39 ("break" . BREAK) 40 ("break" . BREAK)
40 ("class" . CLASS) 41 ("class" . CLASS)
@@ -72,6 +73,7 @@
72 ("pass" summary "Statement that does nothing") 73 ("pass" summary "Statement that does nothing")
73 ("or" summary "Binary logical 'or' operator") 74 ("or" summary "Binary logical 'or' operator")
74 ("not" summary "Unary boolean negation operator") 75 ("not" summary "Unary boolean negation operator")
76 ("lambda" summary "Create anonymous function")
75 ("is" summary "Binary operator that tests for object equality") 77 ("is" summary "Binary operator that tests for object equality")
76 ("in" summary "Part of 'for' statement ") 78 ("in" summary "Part of 'for' statement ")
77 ("import" summary "Load specified modules") 79 ("import" summary "Load specified modules")
@@ -86,10 +88,11 @@
86 ("elif" summary "Shorthand for 'else if' following an 'if' statement") 88 ("elif" summary "Shorthand for 'else if' following an 'if' statement")
87 ("del" summary "Delete specified objects, i.e., undo what assignment did") 89 ("del" summary "Delete specified objects, i.e., undo what assignment did")
88 ("def" summary "Define a new function") 90 ("def" summary "Define a new function")
89 ("continue" summary "Skip to the next interation of enclosing 'for' or 'while' loop") 91 ("continue" summary "Skip to the next iteration of enclosing 'for' or 'while' loop")
90 ("class" summary "Define a new class") 92 ("class" summary "Define a new class")
91 ("break" summary "Terminate 'for' or 'while' loop") 93 ("break" summary "Terminate 'for' or 'while' loop")
92 ("assert" summary "Raise AssertionError exception if <expr> is false") 94 ("assert" summary "Raise AssertionError exception if <expr> is false")
95 ("as" summary "EXPR as NAME makes value of EXPR available as variable NAME")
93 ("and" summary "Logical AND binary operator ... "))) 96 ("and" summary "Logical AND binary operator ... ")))
94 "Table of language keywords.") 97 "Table of language keywords.")
95 98
@@ -172,7 +175,7 @@
172 (eval-when-compile 175 (eval-when-compile
173 (require 'semantic/wisent/comp)) 176 (require 'semantic/wisent/comp))
174 (wisent-compile-grammar 177 (wisent-compile-grammar
175 '((BACKSLASH NEWLINE INDENT DEDENT INDENT_BLOCK PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK LTLTEQ GTGTEQ EXPEQ DIVDIVEQ DIVDIV LTLT GTGT EXPONENT EQ GE LE PLUSEQ MINUSEQ MULTEQ DIVEQ MODEQ AMPEQ OREQ HATEQ LTGT NE HAT LT GT AMP MULT DIV MOD PLUS MINUS PERIOD TILDE BAR COLON SEMICOLON COMMA ASSIGN BACKQUOTE STRING_LITERAL NUMBER_LITERAL NAME AND ASSERT BREAK CLASS CONTINUE DEF DEL ELIF ELSE EXCEPT EXEC FINALLY FOR FROM GLOBAL IF IMPORT IN IS LAMBDA NOT OR PASS PRINT RAISE RETURN TRY WHILE YIELD) 178 '((BACKSLASH NEWLINE INDENT DEDENT INDENT_BLOCK PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK LTLTEQ GTGTEQ EXPEQ DIVDIVEQ DIVDIV LTLT GTGT EXPONENT EQ GE LE PLUSEQ MINUSEQ MULTEQ DIVEQ MODEQ AMPEQ OREQ HATEQ LTGT NE HAT LT GT AMP MULT DIV MOD PLUS MINUS PERIOD TILDE BAR COLON SEMICOLON COMMA ASSIGN BACKQUOTE STRING_LITERAL NUMBER_LITERAL NAME AND AS ASSERT BREAK CLASS CONTINUE DEF DEL ELIF ELSE EXCEPT EXEC FINALLY FOR FROM GLOBAL IF IMPORT IN IS LAMBDA NOT OR PASS PRINT RAISE RETURN TRY WHILE YIELD)
176 nil 179 nil
177 (goal 180 (goal
178 ((NEWLINE)) 181 ((NEWLINE))
@@ -280,6 +283,9 @@
280 ((testlist) 283 ((testlist)
281 nil)) 284 nil))
282 (yield_stmt 285 (yield_stmt
286 ((YIELD)
287 (wisent-raw-tag
288 (semantic-tag-new-code $1 nil)))
283 ((YIELD testlist) 289 ((YIELD testlist)
284 (wisent-raw-tag 290 (wisent-raw-tag
285 (semantic-tag-new-code $1 nil)))) 291 (semantic-tag-new-code $1 nil))))
@@ -320,14 +326,14 @@
320 ((import_as_name_list COMMA import_as_name) 326 ((import_as_name_list COMMA import_as_name)
321 nil)) 327 nil))
322 (import_as_name 328 (import_as_name
323 ((NAME name_name_opt) 329 ((NAME as_name_opt)
324 nil)) 330 nil))
325 (dotted_as_name 331 (dotted_as_name
326 ((dotted_name name_name_opt))) 332 ((dotted_name as_name_opt)))
327 (name_name_opt 333 (as_name_opt
328 (nil) 334 (nil)
329 ((NAME NAME) 335 ((AS NAME)
330 nil)) 336 (identity $2)))
331 (dotted_name 337 (dotted_name
332 ((NAME)) 338 ((NAME))
333 ((dotted_name PERIOD NAME) 339 ((dotted_name PERIOD NAME)
diff --git a/lisp/cedet/srecode.el b/lisp/cedet/srecode.el
index d6c218f2b5a..f27a2028b92 100644
--- a/lisp/cedet/srecode.el
+++ b/lisp/cedet/srecode.el
@@ -41,7 +41,7 @@
41(require 'mode-local) 41(require 'mode-local)
42(load "srecode/loaddefs" nil 'nomessage) 42(load "srecode/loaddefs" nil 'nomessage)
43 43
44(defvar srecode-version "1.0pre7" 44(defvar srecode-version "1.0"
45 "Current version of the Semantic Recoder.") 45 "Current version of the Semantic Recoder.")
46 46
47;;; Code: 47;;; Code:
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 3caab23e31f..de9b6f56de3 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -35,19 +35,17 @@
35(require 'semantic) 35(require 'semantic)
36(require 'eieio) 36(require 'eieio)
37(require 'eieio-base) 37(require 'eieio-base)
38(require 'srecode)
39(require 'srecode/table) 38(require 'srecode/table)
39(require 'srecode/dictionary)
40 40
41(declare-function srecode-template-inserter-newline-child-p "srecode/insert" 41(declare-function srecode-template-inserter-newline-child-p "srecode/insert"
42 t t) 42 t t)
43(declare-function srecode-create-section-dictionary "srecode/dictionary")
44(declare-function srecode-dictionary-compound-variable "srecode/dictionary")
45 43
46;;; Code: 44;;; Code:
47 45
48;;; Template Class 46;;; Template Class
49;; 47;;
50;; Templatets describe a patter of text that can be inserted into a 48;; Templates describe a pattern of text that can be inserted into a
51;; buffer. 49;; buffer.
52;; 50;;
53(defclass srecode-template (eieio-named) 51(defclass srecode-template (eieio-named)
@@ -213,6 +211,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
213 (mode nil) 211 (mode nil)
214 (application nil) 212 (application nil)
215 (priority nil) 213 (priority nil)
214 (project nil)
216 (vars nil) 215 (vars nil)
217 ) 216 )
218 217
@@ -256,6 +255,8 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
256 (setq application (read firstvalue))) 255 (setq application (read firstvalue)))
257 ((string= name "priority") 256 ((string= name "priority")
258 (setq priority (read firstvalue))) 257 (setq priority (read firstvalue)))
258 ((string= name "project")
259 (setq project firstvalue))
259 (t 260 (t
260 ;; Assign this into some table of variables. 261 ;; Assign this into some table of variables.
261 (setq vars (cons (cons name firstvalue) vars)) 262 (setq vars (cons (cons name firstvalue) vars))
@@ -297,12 +298,19 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
297 ;; Calculate priority 298 ;; Calculate priority
298 ;; 299 ;;
299 (if (not priority) 300 (if (not priority)
300 (let ((d (file-name-directory (buffer-file-name))) 301 (let ((d (expand-file-name (file-name-directory (buffer-file-name))))
301 (sd (file-name-directory (locate-library "srecode"))) 302 (sd (expand-file-name (file-name-directory (locate-library "srecode"))))
302 (defaultdelta (if (eq mode 'default) 20 0))) 303 (defaultdelta (if (eq mode 'default) 0 10)))
303 (if (string= d sd) 304 ;; @TODO : WHEN INTEGRATING INTO EMACS
304 (setq priority (+ 80 defaultdelta)) 305 ;; The location of Emacs default templates needs to be specified
305 (setq priority (+ 30 defaultdelta))) 306 ;; here to also have a lower priority.
307 (if (string-match (concat "^" sd) d)
308 (setq priority (+ 30 defaultdelta))
309 ;; If the user created template is for a project, then
310 ;; don't add as much as if it is unique to just some user.
311 (if (stringp project)
312 (setq priority (+ 50 defaultdelta))
313 (setq priority (+ 80 defaultdelta))))
306 (message "Templates %s has estimated priority of %d" 314 (message "Templates %s has estimated priority of %d"
307 (file-name-nondirectory (buffer-file-name)) 315 (file-name-nondirectory (buffer-file-name))
308 priority)) 316 priority))
@@ -311,56 +319,56 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
311 priority)) 319 priority))
312 320
313 ;; Save it up! 321 ;; Save it up!
314 (srecode-compile-template-table table mode priority application vars) 322 (srecode-compile-template-table table mode priority application project vars)
315 ) 323 )
316) 324)
317 325
318(defun srecode-compile-one-template-tag (tag STATE) 326(defun srecode-compile-one-template-tag (tag state)
319 "Compile a template tag TAG into an srecode template class. 327 "Compile a template tag TAG into a srecode template object.
320STATE is the current compile state as an object `srecode-compile-state'." 328STATE is the current compile state as an object of class
321 (require 'srecode/dictionary) 329`srecode-compile-state'."
322 (let* ((context (oref STATE context)) 330 (let* ((context (oref state context))
323 (codeout (srecode-compile-split-code 331 (code (cdr (srecode-compile-split-code
324 tag (semantic-tag-get-attribute tag :code) 332 tag (semantic-tag-get-attribute tag :code)
325 STATE)) 333 state)))
326 (code (cdr codeout)) 334 (args (semantic-tag-function-arguments tag))
327 (args (semantic-tag-function-arguments tag)) 335 (binding (semantic-tag-get-attribute tag :binding))
328 (binding (semantic-tag-get-attribute tag :binding)) 336 (dict-tags (semantic-tag-get-attribute tag :dictionaries))
329 (rawdicts (semantic-tag-get-attribute tag :dictionaries)) 337 (root-dict (when dict-tags
330 (sdicts (srecode-create-section-dictionary rawdicts STATE)) 338 (srecode-create-dictionaries-from-tags
331 (addargs nil) 339 dict-tags state)))
332 ) 340 (addargs))
333; (message "Compiled %s to %d codes with %d args and %d prompts." 341 ;; Examine arguments.
334; (semantic-tag-name tag) 342 (dolist (arg args)
335; (length code) 343 (let ((symbol (intern arg)))
336; (length args) 344 (push symbol addargs)
337; (length prompts)) 345
338 (while args 346 ;; If we have a wrap, then put wrap inserters on both ends of
339 (setq addargs (cons (intern (car args)) addargs)) 347 ;; the code.
340 (when (eq (car addargs) :blank) 348 (when (eq symbol :blank)
341 ;; If we have a wrap, then put wrap inserters on both 349 (setq code (append
342 ;; ends of the code. 350 (list (srecode-compile-inserter
343 (setq code (append 351 "BLANK"
344 (list (srecode-compile-inserter "BLANK" 352 "\r"
345 "\r" 353 state
346 STATE 354 :secondname nil
347 :secondname nil 355 :where 'begin))
348 :where 'begin)) 356 code
349 code 357 (list (srecode-compile-inserter
350 (list (srecode-compile-inserter "BLANK" 358 "BLANK"
351 "\r" 359 "\r"
352 STATE 360 state
353 :secondname nil 361 :secondname nil
354 :where 'end)) 362 :where 'end)))))))
355 ))) 363
356 (setq args (cdr args))) 364 ;; Construct and return the template object.
357 (srecode-template (semantic-tag-name tag) 365 (srecode-template (semantic-tag-name tag)
358 :context context 366 :context context
359 :args (nreverse addargs) 367 :args (nreverse addargs)
360 :dictionary sdicts 368 :dictionary root-dict
361 :binding binding 369 :binding binding
362 :code code) 370 :code code))
363 )) 371 )
364 372
365(defun srecode-compile-do-hard-newline-p (comp) 373(defun srecode-compile-do-hard-newline-p (comp)
366 "Examine COMP to decide if the upcoming newline should be hard. 374 "Examine COMP to decide if the upcoming newline should be hard.
@@ -514,12 +522,13 @@ to the inserter constructor."
514 (if (not new) (error "SRECODE: Unknown macro code %S" key)) 522 (if (not new) (error "SRECODE: Unknown macro code %S" key))
515 new))) 523 new)))
516 524
517(defun srecode-compile-template-table (templates mode priority application vars) 525(defun srecode-compile-template-table (templates mode priority application project vars)
518 "Compile a list of TEMPLATES into an semantic recode table. 526 "Compile a list of TEMPLATES into an semantic recode table.
519The table being compiled is for MODE, or the string \"default\". 527The table being compiled is for MODE, or the string \"default\".
520PRIORITY is a numerical value that indicates this tables location 528PRIORITY is a numerical value that indicates this tables location
521in an ordered search. 529in an ordered search.
522APPLICATION is the name of the application these templates belong to. 530APPLICATION is the name of the application these templates belong to.
531PROJECT is a directory name which these templates scope to.
523A list of defined variables VARS provides a variable table." 532A list of defined variables VARS provides a variable table."
524 (let ((namehash (make-hash-table :test 'equal 533 (let ((namehash (make-hash-table :test 'equal
525 :size (length templates))) 534 :size (length templates)))
@@ -549,6 +558,9 @@ A list of defined variables VARS provides a variable table."
549 558
550 (setq lp (cdr lp)))) 559 (setq lp (cdr lp))))
551 560
561 (when (stringp project)
562 (setq project (expand-file-name project)))
563
552 (let* ((table (srecode-mode-table-new mode (buffer-file-name) 564 (let* ((table (srecode-mode-table-new mode (buffer-file-name)
553 :templates (nreverse templates) 565 :templates (nreverse templates)
554 :namehash namehash 566 :namehash namehash
@@ -556,7 +568,8 @@ A list of defined variables VARS provides a variable table."
556 :variables vars 568 :variables vars
557 :major-mode mode 569 :major-mode mode
558 :priority priority 570 :priority priority
559 :application application)) 571 :application application
572 :project project))
560 (tmpl (oref table templates))) 573 (tmpl (oref table templates)))
561 ;; Loop over all the templates, and xref. 574 ;; Loop over all the templates, and xref.
562 (while tmpl 575 (while tmpl
diff --git a/lisp/cedet/srecode/cpp.el b/lisp/cedet/srecode/cpp.el
index ceaa6fba3aa..7fe2bdaa410 100644
--- a/lisp/cedet/srecode/cpp.el
+++ b/lisp/cedet/srecode/cpp.el
@@ -26,6 +26,27 @@
26 26
27;;; Code: 27;;; Code:
28 28
29(require 'srecode)
30(require 'srecode/dictionary)
31(require 'srecode/semantic)
32(require 'semantic/tag)
33
34;;; Customization
35;;
36
37(defgroup srecode-cpp nil
38 "C++-specific Semantic Recoder settings."
39 :group 'srecode)
40
41(defcustom srecode-cpp-namespaces
42 '("std" "boost")
43 "List expansion candidates for the :using-namespaces argument.
44A dictionary entry of the named PREFIX_NAMESPACE with the value
45NAMESPACE:: is created for each namespace unless the current
46buffer contains a using NAMESPACE; statement "
47 :group 'srecode-cpp
48 :type '(repeat string))
49
29;;; :cpp ARGUMENT HANDLING 50;;; :cpp ARGUMENT HANDLING
30;; 51;;
31;; When a :cpp argument is required, fill the dictionary with 52;; When a :cpp argument is required, fill the dictionary with
@@ -33,10 +54,6 @@
33;; 54;;
34;; Error if not in a C++ mode. 55;; Error if not in a C++ mode.
35 56
36(require 'srecode)
37(require 'srecode/dictionary)
38(require 'srecode/semantic)
39
40;;;###autoload 57;;;###autoload
41(defun srecode-semantic-handle-:cpp (dict) 58(defun srecode-semantic-handle-:cpp (dict)
42 "Add macros into the dictionary DICT based on the current c++ file. 59 "Add macros into the dictionary DICT based on the current c++ file.
@@ -59,6 +76,23 @@ HEADER - Shown section if in a header file."
59 ) 76 )
60 ) 77 )
61 78
79(defun srecode-semantic-handle-:using-namespaces (dict)
80 "Add macros into the dictionary DICT based on used namespaces.
81Adds the following:
82PREFIX_NAMESPACE - for each NAMESPACE in `srecode-cpp-namespaces'."
83 (let ((tags (semantic-find-tags-by-class
84 'using (semantic-fetch-tags))))
85 (dolist (name srecode-cpp-namespaces)
86 (let ((variable (format "PREFIX_%s" (upcase name)))
87 (prefix (format "%s::" name)))
88 (srecode-dictionary-set-value dict variable prefix)
89 (dolist (tag tags)
90 (when (and (eq (semantic-tag-get-attribute tag :kind)
91 'namespace)
92 (string= (semantic-tag-name tag) name))
93 (srecode-dictionary-set-value dict variable ""))))))
94 )
95
62(define-mode-local-override srecode-semantic-apply-tag-to-dict 96(define-mode-local-override srecode-semantic-apply-tag-to-dict
63 c++-mode (tag-wrapper dict) 97 c++-mode (tag-wrapper dict)
64 "Apply C++ specific features from TAG-WRAPPER into DICT. 98 "Apply C++ specific features from TAG-WRAPPER into DICT.
@@ -97,6 +131,7 @@ special behavior for tag of classes include, using and function."
97 (srecode-semantic-tag (semantic-tag-name value-tag) 131 (srecode-semantic-tag (semantic-tag-name value-tag)
98 :prime value-tag) 132 :prime value-tag)
99 value-dict)) 133 value-dict))
134
100 ;; Discriminate using statements referring to namespaces and 135 ;; Discriminate using statements referring to namespaces and
101 ;; types. 136 ;; types.
102 (when (eq (semantic-tag-get-attribute tag :kind) 'namespace) 137 (when (eq (semantic-tag-get-attribute tag :kind) 'namespace)
@@ -111,7 +146,8 @@ special behavior for tag of classes include, using and function."
111 ;; when they make sense. My best bet would be 146 ;; when they make sense. My best bet would be
112 ;; (semantic-tag-function-parent tag), but it is not there, when 147 ;; (semantic-tag-function-parent tag), but it is not there, when
113 ;; the function is defined in the scope of a class. 148 ;; the function is defined in the scope of a class.
114 (let ((member 't) 149 (let ((member t)
150 (templates (semantic-tag-get-attribute tag :template))
115 (modifiers (semantic-tag-modifiers tag))) 151 (modifiers (semantic-tag-modifiers tag)))
116 152
117 ;; Add modifiers into the dictionary 153 ;; Add modifiers into the dictionary
@@ -120,6 +156,9 @@ special behavior for tag of classes include, using and function."
120 dict "MODIFIERS"))) 156 dict "MODIFIERS")))
121 (srecode-dictionary-set-value modifier-dict "NAME" modifier))) 157 (srecode-dictionary-set-value modifier-dict "NAME" modifier)))
122 158
159 ;; Add templates into child dictionaries.
160 (srecode-cpp-apply-templates dict templates)
161
123 ;; When the function is a member function, it can have 162 ;; When the function is a member function, it can have
124 ;; additional modifiers. 163 ;; additional modifiers.
125 (when member 164 (when member
@@ -133,11 +172,40 @@ special behavior for tag of classes include, using and function."
133 ;; entry. 172 ;; entry.
134 (when (semantic-tag-get-attribute tag :pure-virtual-flag) 173 (when (semantic-tag-get-attribute tag :pure-virtual-flag)
135 (srecode-dictionary-show-section dict "PURE")) 174 (srecode-dictionary-show-section dict "PURE"))
136 ) 175 )))
137 )) 176
177 ;;
178 ;; CLASS
179 ;;
180 ((eq class 'type)
181 ;; For classes, add template parameters.
182 (when (or (semantic-tag-of-type-p tag "class")
183 (semantic-tag-of-type-p tag "struct"))
184
185 ;; Add templates into child dictionaries.
186 (let ((templates (semantic-tag-get-attribute tag :template)))
187 (srecode-cpp-apply-templates dict templates))))
138 )) 188 ))
139 ) 189 )
140 190
191
192;;; Helper functions
193;;
194
195(defun srecode-cpp-apply-templates (dict templates)
196 "Add section dictionaries for TEMPLATES to DICT."
197 (when templates
198 (let ((templates-dict (srecode-dictionary-add-section-dictionary
199 dict "TEMPLATES")))
200 (dolist (template templates)
201 (let ((template-dict (srecode-dictionary-add-section-dictionary
202 templates-dict "ARGS")))
203 (srecode-semantic-apply-tag-to-dict
204 (srecode-semantic-tag (semantic-tag-name template)
205 :prime template)
206 template-dict)))))
207 )
208
141(provide 'srecode/cpp) 209(provide 'srecode/cpp)
142 210
143;; Local variables: 211;; Local variables:
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el
index 8d168a7f339..cd97c880595 100644
--- a/lisp/cedet/srecode/dictionary.el
+++ b/lisp/cedet/srecode/dictionary.el
@@ -37,6 +37,7 @@
37(declare-function srecode-compile-parse-inserter "srecode/compile") 37(declare-function srecode-compile-parse-inserter "srecode/compile")
38(declare-function srecode-dump-code-list "srecode/compile") 38(declare-function srecode-dump-code-list "srecode/compile")
39(declare-function srecode-load-tables-for-mode "srecode/find") 39(declare-function srecode-load-tables-for-mode "srecode/find")
40(declare-function srecode-template-table-in-project-p "srecode/find")
40(declare-function srecode-insert-code-stream "srecode/insert") 41(declare-function srecode-insert-code-stream "srecode/insert")
41(declare-function data-debug-new-buffer "data-debug") 42(declare-function data-debug-new-buffer "data-debug")
42(declare-function data-debug-insert-object-slots "eieio-datadebug") 43(declare-function data-debug-insert-object-slots "eieio-datadebug")
@@ -157,40 +158,49 @@ buffer's table.
157If BUFFER-OR-PARENT is t, then this dictionary should not be 158If BUFFER-OR-PARENT is t, then this dictionary should not be
158associated with a buffer or parent." 159associated with a buffer or parent."
159 (save-excursion 160 (save-excursion
161 ;; Handle the parent
160 (let ((parent nil) 162 (let ((parent nil)
161 (buffer nil) 163 (buffer nil)
162 (origin nil) 164 (origin nil)
163 (initfrombuff nil)) 165 (initfrombuff nil))
164 (cond ((bufferp buffer-or-parent) 166 (cond
165 (set-buffer buffer-or-parent) 167 ;; Parent is a buffer
166 (setq buffer buffer-or-parent 168 ((bufferp buffer-or-parent)
167 origin (buffer-name buffer-or-parent) 169 (set-buffer buffer-or-parent)
168 initfrombuff t)) 170 (setq buffer buffer-or-parent
169 ((srecode-dictionary-child-p buffer-or-parent) 171 origin (buffer-name buffer-or-parent)
170 (setq parent buffer-or-parent 172 initfrombuff t))
171 buffer (oref buffer-or-parent buffer) 173
172 origin (concat (object-name buffer-or-parent) " in " 174 ;; Parent is another dictionary
173 (if buffer (buffer-name buffer) 175 ((srecode-dictionary-child-p buffer-or-parent)
174 "no buffer"))) 176 (setq parent buffer-or-parent
175 (when buffer 177 buffer (oref buffer-or-parent buffer)
176 (set-buffer buffer))) 178 origin (concat (object-name buffer-or-parent) " in "
177 ((eq buffer-or-parent t) 179 (if buffer (buffer-name buffer)
178 (setq buffer nil 180 "no buffer")))
179 origin "Unspecified Origin")) 181 (when buffer
180 (t 182 (set-buffer buffer)))
181 (setq buffer (current-buffer) 183
182 origin (concat "Unspecified. Assume " 184 ;; No parent
183 (buffer-name buffer)) 185 ((eq buffer-or-parent t)
184 initfrombuff t) 186 (setq buffer nil
185 ) 187 origin "Unspecified Origin"))
186 ) 188
189 ;; Default to unspecified parent
190 (t
191 (setq buffer (current-buffer)
192 origin (concat "Unspecified. Assume "
193 (buffer-name buffer))
194 initfrombuff t)))
195
196 ;; Create the new dictionary object.
187 (let ((dict (srecode-dictionary 197 (let ((dict (srecode-dictionary
188 major-mode 198 major-mode
189 :buffer buffer 199 :buffer buffer
190 :parent parent 200 :parent parent
191 :namehash (make-hash-table :test 'equal 201 :namehash (make-hash-table :test 'equal
192 :size 20) 202 :size 20)
193 :origin origin))) 203 :origin origin)))
194 ;; Only set up the default variables if we are being built 204 ;; Only set up the default variables if we are being built
195 ;; directroy for a particular buffer. 205 ;; directroy for a particular buffer.
196 (when initfrombuff 206 (when initfrombuff
@@ -211,34 +221,37 @@ associated with a buffer or parent."
211TPL is an object representing a compiled template file." 221TPL is an object representing a compiled template file."
212 (when tpl 222 (when tpl
213 (let ((tabs (oref tpl :tables))) 223 (let ((tabs (oref tpl :tables)))
224 (require 'srecode/find) ; For srecode-template-table-in-project-p
214 (while tabs 225 (while tabs
215 (let ((vars (oref (car tabs) variables))) 226 (when (srecode-template-table-in-project-p (car tabs))
216 (while vars 227 (let ((vars (oref (car tabs) variables)))
217 (srecode-dictionary-set-value 228 (while vars
218 dict (car (car vars)) (cdr (car vars))) 229 (srecode-dictionary-set-value
219 (setq vars (cdr vars)))) 230 dict (car (car vars)) (cdr (car vars)))
220 (setq tabs (cdr tabs)))))) 231 (setq vars (cdr vars)))))
232 (setq tabs (cdr tabs))))))
221 233
222 234
223(defmethod srecode-dictionary-set-value ((dict srecode-dictionary) 235(defmethod srecode-dictionary-set-value ((dict srecode-dictionary)
224 name value) 236 name value)
225 "In dictionary DICT, set NAME to have VALUE." 237 "In dictionary DICT, set NAME to have VALUE."
226 ;; Validate inputs 238 ;; Validate inputs
227 (if (not (stringp name)) 239 (unless (stringp name)
228 (signal 'wrong-type-argument (list name 'stringp))) 240 (signal 'wrong-type-argument (list name 'stringp)))
241
229 ;; Add the value. 242 ;; Add the value.
230 (with-slots (namehash) dict 243 (with-slots (namehash) dict
231 (puthash name value namehash)) 244 (puthash name value namehash))
232 ) 245 )
233 246
234(defmethod srecode-dictionary-add-section-dictionary ((dict srecode-dictionary) 247(defmethod srecode-dictionary-add-section-dictionary ((dict srecode-dictionary)
235 name &optional show-only) 248 name &optional show-only force)
236 "In dictionary DICT, add a section dictionary for section macro NAME. 249 "In dictionary DICT, add a section dictionary for section macro NAME.
237Return the new dictionary. 250Return the new dictionary.
238 251
239You can add several dictionaries to the same section macro. 252You can add several dictionaries to the same section entry.
240For each dictionary added to a macro, the block of codes in the 253For each dictionary added to a variable, the block of codes in
241template will be repeated. 254the template will be repeated.
242 255
243If optional argument SHOW-ONLY is non-nil, then don't add a new dictionary 256If optional argument SHOW-ONLY is non-nil, then don't add a new dictionary
244if there is already one in place. Also, don't add FIRST/LAST entries. 257if there is already one in place. Also, don't add FIRST/LAST entries.
@@ -255,10 +268,11 @@ which will enable SECTIONS to be enabled.
255Adding a new dictionary will alter these values in previously 268Adding a new dictionary will alter these values in previously
256inserted dictionaries." 269inserted dictionaries."
257 ;; Validate inputs 270 ;; Validate inputs
258 (if (not (stringp name)) 271 (unless (stringp name)
259 (signal 'wrong-type-argument (list name 'stringp))) 272 (signal 'wrong-type-argument (list name 'stringp)))
273
260 (let ((new (srecode-create-dictionary dict)) 274 (let ((new (srecode-create-dictionary dict))
261 (ov (srecode-dictionary-lookup-name dict name))) 275 (ov (srecode-dictionary-lookup-name dict name t)))
262 276
263 (when (not show-only) 277 (when (not show-only)
264 ;; Setup the FIRST/NOTFIRST and LAST/NOTLAST entries. 278 ;; Setup the FIRST/NOTFIRST and LAST/NOTLAST entries.
@@ -275,7 +289,9 @@ inserted dictionaries."
275 (srecode-dictionary-show-section new "LAST")) 289 (srecode-dictionary-show-section new "LAST"))
276 ) 290 )
277 291
278 (when (or (not show-only) (null ov)) 292 (when (or force
293 (not show-only)
294 (null ov))
279 (srecode-dictionary-set-value dict name (append ov (list new)))) 295 (srecode-dictionary-set-value dict name (append ov (list new))))
280 ;; Return the new sub-dictionary. 296 ;; Return the new sub-dictionary.
281 new)) 297 new))
@@ -283,8 +299,9 @@ inserted dictionaries."
283(defmethod srecode-dictionary-show-section ((dict srecode-dictionary) name) 299(defmethod srecode-dictionary-show-section ((dict srecode-dictionary) name)
284 "In dictionary DICT, indicate that the section NAME should be exposed." 300 "In dictionary DICT, indicate that the section NAME should be exposed."
285 ;; Validate inputs 301 ;; Validate inputs
286 (if (not (stringp name)) 302 (unless (stringp name)
287 (signal 'wrong-type-argument (list name 'stringp))) 303 (signal 'wrong-type-argument (list name 'stringp)))
304
288 ;; Showing a section is just like making a section dictionary, but 305 ;; Showing a section is just like making a section dictionary, but
289 ;; with no dictionary values to add. 306 ;; with no dictionary values to add.
290 (srecode-dictionary-add-section-dictionary dict name t) 307 (srecode-dictionary-add-section-dictionary dict name t)
@@ -294,51 +311,120 @@ inserted dictionaries."
294 "In dictionary DICT, indicate that the section NAME should be hidden." 311 "In dictionary DICT, indicate that the section NAME should be hidden."
295 ;; We need to find the has value, and then delete it. 312 ;; We need to find the has value, and then delete it.
296 ;; Validate inputs 313 ;; Validate inputs
297 (if (not (stringp name)) 314 (unless (stringp name)
298 (signal 'wrong-type-argument (list name 'stringp))) 315 (signal 'wrong-type-argument (list name 'stringp)))
316
299 ;; Add the value. 317 ;; Add the value.
300 (with-slots (namehash) dict 318 (with-slots (namehash) dict
301 (remhash name namehash)) 319 (remhash name namehash))
302 nil) 320 nil)
303 321
304(defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict) 322(defmethod srecode-dictionary-add-entries ((dict srecode-dictionary)
305 "Merge into DICT the dictionary entries from OTHERDICT." 323 entries &optional state)
324 "Add ENTRIES to DICT.
325
326ENTRIES is a list of even length of dictionary entries to
327add. ENTRIES looks like this:
328
329 (NAME_1 VALUE_1 NAME_2 VALUE_2 ...)
330
331The following rules apply:
332 * NAME_N is a string
333and for values
334 * If VALUE_N is t, the section NAME_N is shown.
335 * If VALUE_N is a string, an ordinary value is inserted.
336 * If VALUE_N is a dictionary, it is inserted as entry NAME_N.
337 * Otherwise, a compound variable is created for VALUE_N.
338
339The optional argument STATE has to non-nil when compound values
340are inserted. An error is signaled if ENTRIES contains compound
341values but STATE is nil."
342 (while entries
343 (let ((name (nth 0 entries))
344 (value (nth 1 entries)))
345 (cond
346 ;; Value is t; show a section.
347 ((eq value t)
348 (srecode-dictionary-show-section dict name))
349
350 ;; Value is a simple string; create an ordinary dictionary
351 ;; entry
352 ((stringp value)
353 (srecode-dictionary-set-value dict name value))
354
355 ;; Value is a dictionary; insert as child dictionary.
356 ((srecode-dictionary-child-p value)
357 (srecode-dictionary-merge
358 (srecode-dictionary-add-section-dictionary dict name)
359 value t))
360
361 ;; Value is some other object; create a compound value.
362 (t
363 (unless state
364 (error "Cannot insert compound values without state."))
365
366 (srecode-dictionary-set-value
367 dict name
368 (srecode-dictionary-compound-variable
369 name :value value :state state)))))
370 (setq entries (nthcdr 2 entries)))
371 dict)
372
373(defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict
374 &optional force)
375 "Merge into DICT the dictionary entries from OTHERDICT.
376Unless the optional argument FORCE is non-nil, values in DICT are
377not modified, even if there are values of the same names in
378OTHERDICT."
306 (when otherdict 379 (when otherdict
307 (maphash 380 (maphash
308 (lambda (key entry) 381 (lambda (key entry)
309 ;; Only merge in the new values if there was no old value. 382 ;; The new values is only merged in if there was no old value
383 ;; or FORCE is non-nil.
384 ;;
310 ;; This protects applications from being whacked, and basically 385 ;; This protects applications from being whacked, and basically
311 ;; makes these new section dictionary entries act like 386 ;; makes these new section dictionary entries act like
312 ;; "defaults" instead of overrides. 387 ;; "defaults" instead of overrides.
313 (when (not (srecode-dictionary-lookup-name dict key)) 388 (when (or force
314 (cond ((and (listp entry) (srecode-dictionary-p (car entry))) 389 (not (srecode-dictionary-lookup-name dict key t)))
315 ;; A list of section dictionaries. 390 (cond
316 ;; We need to merge them in. 391 ;; A list of section dictionaries. We need to merge them in.
317 (while entry 392 ((and (listp entry)
318 (let ((new-sub-dict 393 (srecode-dictionary-p (car entry)))
319 (srecode-dictionary-add-section-dictionary 394 (dolist (sub-dict entry)
320 dict key))) 395 (srecode-dictionary-merge
321 (srecode-dictionary-merge new-sub-dict (car entry))) 396 (srecode-dictionary-add-section-dictionary
322 (setq entry (cdr entry))) 397 dict key t t)
323 ) 398 sub-dict force)))
324 399
325 (t 400 ;; Other values can be set directly.
326 (srecode-dictionary-set-value dict key entry))) 401 (t
327 )) 402 (srecode-dictionary-set-value dict key entry)))))
328 (oref otherdict namehash)))) 403 (oref otherdict namehash))))
329 404
330(defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary) 405(defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary)
331 name) 406 name &optional non-recursive)
332 "Return information about the current DICT's value for NAME." 407 "Return information about DICT's value for NAME.
408DICT is a dictionary, and NAME is a string that is treated as the
409name of an entry in the dictionary. If such an entry exists, its
410value is returned. Otherwise, nil is returned. Normally, the
411lookup is recursive in the sense that the parent of DICT is
412searched for NAME if it is not found in DICT. This recursive
413lookup can be disabled by the optional argument NON-RECURSIVE.
414
415This function derives values for some special NAMEs, such as
416'FIRST' and 'LAST'."
333 (if (not (slot-boundp dict 'namehash)) 417 (if (not (slot-boundp dict 'namehash))
334 nil 418 nil
335 ;; Get the value of this name from the dictionary 419 ;; Get the value of this name from the dictionary or its parent
336 (or (with-slots (namehash) dict 420 ;; unless the lookup should be non-recursive.
337 (gethash name namehash)) 421 (with-slots (namehash parent) dict
338 (and (not (member name '("FIRST" "LAST" "NOTFIRST" "NOTLAST"))) 422 (or (gethash name namehash)
339 (oref dict parent) 423 (and (not non-recursive)
340 (srecode-dictionary-lookup-name (oref dict parent) name)) 424 (not (member name '("FIRST" "LAST" "NOTFIRST" "NOTLAST")))
341 ))) 425 parent
426 (srecode-dictionary-lookup-name parent name)))))
427 )
342 428
343(defmethod srecode-root-dictionary ((dict srecode-dictionary)) 429(defmethod srecode-root-dictionary ((dict srecode-dictionary))
344 "For dictionary DICT, return the root dictionary. 430 "For dictionary DICT, return the root dictionary.
@@ -431,10 +517,22 @@ inserted with a new editable field.")
431 (start (point)) 517 (start (point))
432 (name (oref sti :object-name))) 518 (name (oref sti :object-name)))
433 519
434 (if (or (not dv) (string= dv "")) 520 (cond
435 (insert name) 521 ;; No default value.
436 (insert dv)) 522 ((not dv) (insert name))
437 523 ;; A compound value as the default? Recurse.
524 ((srecode-dictionary-compound-value-child-p dv)
525 (srecode-compound-toString dv function dictionary))
526 ;; A string that is empty? Use the name.
527 ((and (stringp dv) (string= dv ""))
528 (insert name))
529 ;; Insert strings
530 ((stringp dv) (insert dv))
531 ;; Some other issue
532 (t
533 (error "Unknown default value for value %S" name)))
534
535 ;; Create a field from the inserter.
438 (srecode-field name :name name 536 (srecode-field name :name name
439 :start start 537 :start start
440 :end (point) 538 :end (point)
@@ -482,6 +580,53 @@ STATE is the current compiler state."
482 (setq sectiondicts (cdr sectiondicts))) 580 (setq sectiondicts (cdr sectiondicts)))
483 new))) 581 new)))
484 582
583(defun srecode-create-dictionaries-from-tags (tags state)
584 "Create a dictionary with entries according to TAGS.
585
586TAGS should be in the format produced by the template file
587grammar. That is
588
589TAGS = (ENTRY_1 ENTRY_2 ...)
590
591where
592
593ENTRY_N = (NAME ENTRY_N_1 ENTRY_N_2 ...) | TAG
594
595where TAG is a semantic tag of class 'variable. The (NAME ... )
596form creates a child dictionary which is stored under the name
597NAME. The TAG form creates a value entry or section dictionary
598entry whose name is the name of the tag.
599
600STATE is the current compiler state."
601 (let ((dict (srecode-create-dictionary t))
602 (entries (apply #'append
603 (mapcar
604 (lambda (entry)
605 (cond
606 ;; Entry is a tag
607 ((semantic-tag-p entry)
608 (let ((name (semantic-tag-name entry))
609 (value (semantic-tag-variable-default entry)))
610 (list name
611 (if (and (listp value)
612 (= (length value) 1)
613 (stringp (car value)))
614 (car value)
615 value))))
616
617 ;; Entry is a nested dictionary
618 (t
619 (let ((name (car entry))
620 (entries (cdr entry)))
621 (list name
622 (srecode-create-dictionaries-from-tags
623 entries state))))))
624 tags))))
625 (srecode-dictionary-add-entries
626 dict entries state)
627 dict)
628 )
629
485;;; DUMP DICTIONARY 630;;; DUMP DICTIONARY
486;; 631;;
487;; Make a dictionary, and dump it's contents. 632;; Make a dictionary, and dump it's contents.
diff --git a/lisp/cedet/srecode/fields.el b/lisp/cedet/srecode/fields.el
index 347538aa871..0cfc2953792 100644
--- a/lisp/cedet/srecode/fields.el
+++ b/lisp/cedet/srecode/fields.el
@@ -35,6 +35,8 @@
35;; Each field has 2 overlays. The second overlay allows control in 35;; Each field has 2 overlays. The second overlay allows control in
36;; the character just after the field, but does not highlight it. 36;; the character just after the field, but does not highlight it.
37 37
38;; @TODO - Cancel an old field array if a new one is about to be created!
39
38;; Keep this library independent of SRecode proper. 40;; Keep this library independent of SRecode proper.
39(require 'eieio) 41(require 'eieio)
40 42
@@ -43,6 +45,10 @@
43 "While inserting a set of fields, collect in this variable. 45 "While inserting a set of fields, collect in this variable.
44Once an insertion set is done, these fields will be activated.") 46Once an insertion set is done, these fields will be activated.")
45 47
48
49;;; Customization
50;;
51
46(defface srecode-field-face 52(defface srecode-field-face
47 '((((class color) (background dark)) 53 '((((class color) (background dark))
48 (:underline "green")) 54 (:underline "green"))
@@ -51,6 +57,11 @@ Once an insertion set is done, these fields will be activated.")
51 "*Face used to specify editable fields from a template." 57 "*Face used to specify editable fields from a template."
52 :group 'semantic-faces) 58 :group 'semantic-faces)
53 59
60(defcustom srecode-fields-exit-confirmation nil
61 "Ask for confirmation before leaving field editing mode."
62 :group 'srecode
63 :type 'boolean)
64
54;;; BASECLASS 65;;; BASECLASS
55;; 66;;
56;; Fields and the template region share some basic overlay features. 67;; Fields and the template region share some basic overlay features.
@@ -237,7 +248,7 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO."
237 (remove-hook 'post-command-hook 'srecode-field-post-command t) 248 (remove-hook 'post-command-hook 'srecode-field-post-command t)
238 (if (srecode-point-in-region-p ar) 249 (if (srecode-point-in-region-p ar)
239 nil ;; Keep going 250 nil ;; Keep going
240 ;; We moved out of the temlate. Cancel the edits. 251 ;; We moved out of the template. Cancel the edits.
241 (srecode-delete ar))) 252 (srecode-delete ar)))
242 )) 253 ))
243 254
@@ -429,7 +440,8 @@ PRE-LEN is used in the after mode for the length of the changed text."
429(defun srecode-field-exit-ask () 440(defun srecode-field-exit-ask ()
430 "Ask if the user wants to exit field-editing mini-mode." 441 "Ask if the user wants to exit field-editing mini-mode."
431 (interactive) 442 (interactive)
432 (when (y-or-n-p "Exit field-editing mode? ") 443 (when (or (not srecode-fields-exit-confirmation)
444 (y-or-n-p "Exit field-editing mode? "))
433 (srecode-delete (srecode-active-template-region)))) 445 (srecode-delete (srecode-active-template-region))))
434 446
435 447
diff --git a/lisp/cedet/srecode/find.el b/lisp/cedet/srecode/find.el
index 1a3057fda0e..9c5a897fc4f 100644
--- a/lisp/cedet/srecode/find.el
+++ b/lisp/cedet/srecode/find.el
@@ -92,6 +92,23 @@ all template files for that application will be loaded."
92 )) 92 ))
93 )) 93 ))
94 94
95;;; PROJECT
96;;
97;; Find if a template table has a project set, and if so, is the
98;; current buffer in that project.
99(defmethod srecode-template-table-in-project-p ((tab srecode-template-table))
100 "Return non-nil if the table TAB can be used in the current project.
101If TAB has a :project set, check that the directories match.
102If TAB is nil, then always return t."
103 (let ((proj (oref tab :project)))
104 ;; Return t if the project wasn't set.
105 (if (not proj) t
106 ;; If the project directory was set, lets check it.
107 (let ((dd (expand-file-name default-directory))
108 (projexp (regexp-quote (directory-file-name proj))))
109 (if (string-match (concat "^" projexp) dd)
110 t nil)))))
111
95;;; SEARCH 112;;; SEARCH
96;; 113;;
97;; Find a given template based on name, and features of the current 114;; Find a given template based on name, and features of the current
@@ -103,13 +120,14 @@ all template files for that application will be loaded."
103Optional argument CONTEXT specifies that the template should part 120Optional argument CONTEXT specifies that the template should part
104of a particular context. 121of a particular context.
105The APPLICATION argument is unused." 122The APPLICATION argument is unused."
106 (if context 123 (when (srecode-template-table-in-project-p tab)
107 ;; If a context is specified, then look it up there. 124 (if context
108 (let ((ctxth (gethash context (oref tab contexthash)))) 125 ;; If a context is specified, then look it up there.
109 (when ctxth 126 (let ((ctxth (gethash context (oref tab contexthash))))
110 (gethash template-name ctxth))) 127 (when ctxth
111 ;; No context, perhaps a merged name? 128 (gethash template-name ctxth)))
112 (gethash template-name (oref tab namehash)))) 129 ;; No context, perhaps a merged name?
130 (gethash template-name (oref tab namehash)))))
113 131
114(defmethod srecode-template-get-table ((tab srecode-mode-table) 132(defmethod srecode-template-get-table ((tab srecode-mode-table)
115 template-name &optional 133 template-name &optional
@@ -144,32 +162,33 @@ tables that do not belong to an application will be searched."
144 "Find in the template name in table TAB, the template with BINDING. 162 "Find in the template name in table TAB, the template with BINDING.
145Optional argument CONTEXT specifies that the template should part 163Optional argument CONTEXT specifies that the template should part
146of a particular context." 164of a particular context."
147 (let* ((keyout nil) 165 (when (srecode-template-table-in-project-p tab)
148 (hashfcn (lambda (key value) 166 (let* ((keyout nil)
149 (when (and (slot-boundp value 'binding) 167 (hashfcn (lambda (key value)
150 (oref value binding) 168 (when (and (slot-boundp value 'binding)
151 (= (aref (oref value binding) 0) binding)) 169 (oref value binding)
152 (setq keyout key)))) 170 (= (aref (oref value binding) 0) binding))
153 (contextstr (cond ((listp context) 171 (setq keyout key))))
154 (car-safe context)) 172 (contextstr (cond ((listp context)
155 ((stringp context) 173 (car-safe context))
156 context) 174 ((stringp context)
157 (t nil))) 175 context)
158 ) 176 (t nil)))
159 (if context 177 )
160 (let ((ctxth (gethash contextstr (oref tab contexthash)))) 178 (if context
161 (when ctxth 179 (let ((ctxth (gethash contextstr (oref tab contexthash))))
162 ;; If a context is specified, then look it up there. 180 (when ctxth
163 (maphash hashfcn ctxth) 181 ;; If a context is specified, then look it up there.
164 ;; Context hashes EXCLUDE the context prefix which 182 (maphash hashfcn ctxth)
165 ;; we need to include, so concat it here 183 ;; Context hashes EXCLUDE the context prefix which
166 (when keyout 184 ;; we need to include, so concat it here
167 (setq keyout (concat contextstr ":" keyout))) 185 (when keyout
168 ))) 186 (setq keyout (concat contextstr ":" keyout)))
169 (when (not keyout) 187 )))
170 ;; No context, or binding in context. Try full hash. 188 (when (not keyout)
171 (maphash hashfcn (oref tab namehash))) 189 ;; No context, or binding in context. Try full hash.
172 keyout)) 190 (maphash hashfcn (oref tab namehash)))
191 keyout)))
173 192
174(defmethod srecode-template-get-table-for-binding 193(defmethod srecode-template-get-table-for-binding
175 ((tab srecode-mode-table) binding &optional context application) 194 ((tab srecode-mode-table) binding &optional context application)
@@ -220,7 +239,8 @@ Optional argument HASH is the hash table to fill in."
220 ) 239 )
221 (while tabs 240 (while tabs
222 ;; Exclude templates for a perticular application. 241 ;; Exclude templates for a perticular application.
223 (when (not (oref (car tabs) :application)) 242 (when (and (not (oref (car tabs) :application))
243 (srecode-template-table-in-project-p (car tabs)))
224 (maphash (lambda (key temp) 244 (maphash (lambda (key temp)
225 (puthash key temp mhash) 245 (puthash key temp mhash)
226 ) 246 )
diff --git a/lisp/cedet/srecode/getset.el b/lisp/cedet/srecode/getset.el
index 87266bf2475..a90f3a6d67a 100644
--- a/lisp/cedet/srecode/getset.el
+++ b/lisp/cedet/srecode/getset.el
@@ -55,8 +55,9 @@ will be derived."
55 (error "No templates for inserting get/set")) 55 (error "No templates for inserting get/set"))
56 56
57 ;; Step 1: Try to derive the tag for the class we will use 57 ;; Step 1: Try to derive the tag for the class we will use
58 (semantic-fetch-tags)
58 (let* ((class (or class-in (srecode-auto-choose-class (point)))) 59 (let* ((class (or class-in (srecode-auto-choose-class (point))))
59 (tagstart (semantic-tag-start class)) 60 (tagstart (when class (semantic-tag-start class)))
60 (inclass (eq (semantic-current-tag-of-class 'type) class)) 61 (inclass (eq (semantic-current-tag-of-class 'type) class))
61 (field nil) 62 (field nil)
62 ) 63 )
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index 4ee6d467009..843b577e1eb 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -26,6 +26,9 @@
26;; Manage the insertion process for a template. 26;; Manage the insertion process for a template.
27;; 27;;
28 28
29(eval-when-compile
30 (require 'cl)) ;; for `lexical-let'
31
29(require 'srecode/compile) 32(require 'srecode/compile)
30(require 'srecode/find) 33(require 'srecode/find)
31(require 'srecode/dictionary) 34(require 'srecode/dictionary)
@@ -49,7 +52,7 @@ Possible values are:
49NOTE: The field feature does not yet work with XEmacs." 52NOTE: The field feature does not yet work with XEmacs."
50 :group 'srecode 53 :group 'srecode
51 :type '(choice (const :tag "Ask" ask) 54 :type '(choice (const :tag "Ask" ask)
52 (cons :tag "Field" field))) 55 (const :tag "Field" field)))
53 56
54(defvar srecode-insert-with-fields-in-progress nil 57(defvar srecode-insert-with-fields-in-progress nil
55 "Non-nil means that we are actively inserting a template with fields.") 58 "Non-nil means that we are actively inserting a template with fields.")
@@ -86,7 +89,6 @@ DICT-ENTRIES are additional dictionary values to add."
86 (car dict-entries) 89 (car dict-entries)
87 (car (cdr dict-entries))) 90 (car (cdr dict-entries)))
88 (setq dict-entries (cdr (cdr dict-entries)))) 91 (setq dict-entries (cdr (cdr dict-entries))))
89 ;;(srecode-resolve-arguments temp newdict)
90 (srecode-insert-fcn temp newdict) 92 (srecode-insert-fcn temp newdict)
91 ;; Don't put code here. We need to return the end-mark 93 ;; Don't put code here. We need to return the end-mark
92 ;; for this insertion step. 94 ;; for this insertion step.
@@ -100,6 +102,10 @@ has set everything up already."
100 ;; Perform the insertion. 102 ;; Perform the insertion.
101 (let ((standard-output (or stream (current-buffer))) 103 (let ((standard-output (or stream (current-buffer)))
102 (end-mark nil)) 104 (end-mark nil))
105 ;; Merge any template entries into the input dictionary.
106 (when (slot-boundp template 'dictionary)
107 (srecode-dictionary-merge dictionary (oref template dictionary)))
108
103 (unless skipresolver 109 (unless skipresolver
104 ;; Make sure the semantic tags are up to date. 110 ;; Make sure the semantic tags are up to date.
105 (semantic-fetch-tags) 111 (semantic-fetch-tags)
@@ -110,7 +116,7 @@ has set everything up already."
110 ;; If there is a buffer, turn off various hooks. This will cause 116 ;; If there is a buffer, turn off various hooks. This will cause
111 ;; the mod hooks to be buffered up during the insert, but 117 ;; the mod hooks to be buffered up during the insert, but
112 ;; prevent tools like font-lock from fontifying mid-template. 118 ;; prevent tools like font-lock from fontifying mid-template.
113 ;; Especialy important during insertion of complex comments that 119 ;; Especially important during insertion of complex comments that
114 ;; cause the new font-lock to comment-color stuff after the inserted 120 ;; cause the new font-lock to comment-color stuff after the inserted
115 ;; comment. 121 ;; comment.
116 ;; 122 ;;
@@ -239,6 +245,9 @@ ST can be a class, or an object."
239(defmethod srecode-insert-method ((st srecode-template) dictionary) 245(defmethod srecode-insert-method ((st srecode-template) dictionary)
240 "Insert the srecoder template ST." 246 "Insert the srecoder template ST."
241 ;; Merge any template entries into the input dictionary. 247 ;; Merge any template entries into the input dictionary.
248 ;; This may happen twice since some templates arguments need
249 ;; these dictionary values earlier, but these values always
250 ;; need merging for template inserting in other templates.
242 (when (slot-boundp st 'dictionary) 251 (when (slot-boundp st 'dictionary)
243 (srecode-dictionary-merge dictionary (oref st dictionary))) 252 (srecode-dictionary-merge dictionary (oref st dictionary)))
244 ;; Do an insertion. 253 ;; Do an insertion.
@@ -264,7 +273,7 @@ Use DICTIONARY to resolve any macros."
264;; Specific srecode inserters. 273;; Specific srecode inserters.
265;; The base class is from srecode-compile. 274;; The base class is from srecode-compile.
266;; 275;;
267;; Each inserter handles various macro codes from the temlate. 276;; Each inserter handles various macro codes from the template.
268;; The `code' slot specifies a character used to identify which 277;; The `code' slot specifies a character used to identify which
269;; inserter is to be created. 278;; inserter is to be created.
270;; 279;;
@@ -471,7 +480,7 @@ If SECONDNAME is nil, return VALUE."
471 ;; (setq val (format "%S" val)))) 480 ;; (setq val (format "%S" val))))
472 )) 481 ))
473 ;; Output the dumb thing unless the type of thing specifically 482 ;; Output the dumb thing unless the type of thing specifically
474 ;; did the inserting forus. 483 ;; did the inserting for us.
475 (when do-princ 484 (when do-princ
476 (princ val)))) 485 (princ val))))
477 486
@@ -498,7 +507,8 @@ If there is no entry, prompt the user for the value to use.
498The prompt text used is derived from the previous PROMPT command in the 507The prompt text used is derived from the previous PROMPT command in the
499template file.") 508template file.")
500 509
501(defmethod srecode-inserter-apply-state ((ins srecode-template-inserter-ask) STATE) 510(defmethod srecode-inserter-apply-state
511 ((ins srecode-template-inserter-ask) STATE)
502 "For the template inserter INS, apply information from STATE. 512 "For the template inserter INS, apply information from STATE.
503Loop over the prompts to see if we have a match." 513Loop over the prompts to see if we have a match."
504 (let ((prompts (oref STATE prompts)) 514 (let ((prompts (oref STATE prompts))
@@ -669,7 +679,13 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
669 ) 679 )
670 680
671(defvar srecode-template-inserter-point-override nil 681(defvar srecode-template-inserter-point-override nil
672 "When non-nil, the point inserter will do this function instead.") 682 "Point-positioning method for the SRecode template inserter.
683When nil, perform normal point-positioning behavior.
684When the value is a cons cell (DEPTH . FUNCTION), call FUNCTION
685instead, unless the template nesting depth, measured
686by (length (oref srecode-template active)), is greater than
687DEPTH.")
688
673 689
674(defclass srecode-template-inserter-point (srecode-template-inserter) 690(defclass srecode-template-inserter-point (srecode-template-inserter)
675 ((key :initform ?^ 691 ((key :initform ?^
@@ -702,15 +718,20 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
702 dictionary) 718 dictionary)
703 "Insert the STI inserter. 719 "Insert the STI inserter.
704Save point in the class allocated 'point' slot. 720Save point in the class allocated 'point' slot.
705If `srecode-template-inserter-point-override' then this generalized 721If `srecode-template-inserter-point-override' non-nil then this
706marker will do something else. See `srecode-template-inserter-include-wrap' 722generalized marker will do something else. See
707as an example." 723`srecode-template-inserter-include-wrap' as an example."
708 (if srecode-template-inserter-point-override 724 ;; If `srecode-template-inserter-point-override' is non-nil, its car
725 ;; is the maximum template nesting depth for which the override is
726 ;; valid. Compare this to the actual template nesting depth and
727 ;; maybe use the override function which is stored in the cdr.
728 (if (and srecode-template-inserter-point-override
729 (<= (length (oref srecode-template active))
730 (car srecode-template-inserter-point-override)))
709 ;; Disable the old override while we do this. 731 ;; Disable the old override while we do this.
710 (let ((over srecode-template-inserter-point-override) 732 (let ((over (cdr srecode-template-inserter-point-override))
711 (srecode-template-inserter-point-override nil)) 733 (srecode-template-inserter-point-override nil))
712 (funcall over dictionary) 734 (funcall over dictionary))
713 )
714 (oset sti point (point-marker)) 735 (oset sti point (point-marker))
715 )) 736 ))
716 737
@@ -751,9 +772,15 @@ Loops over the embedded CODE which was saved here during compilation.
751The template to insert is stored in SLOT." 772The template to insert is stored in SLOT."
752 (let ((dicts (srecode-dictionary-lookup-name 773 (let ((dicts (srecode-dictionary-lookup-name
753 dictionary (oref sti :object-name)))) 774 dictionary (oref sti :object-name))))
775 (when (not (listp dicts))
776 (error "Cannot insert section %S from non-section variable."
777 (oref sti :object-name)))
754 ;; If there is no section dictionary, then don't output anything 778 ;; If there is no section dictionary, then don't output anything
755 ;; from this section. 779 ;; from this section.
756 (while dicts 780 (while dicts
781 (when (not (srecode-dictionary-p (car dicts)))
782 (error "Cannot insert section %S from non-section variable."
783 (oref sti :object-name)))
757 (srecode-insert-subtemplate sti (car dicts) slot) 784 (srecode-insert-subtemplate sti (car dicts) slot)
758 (setq dicts (cdr dicts))))) 785 (setq dicts (cdr dicts)))))
759 786
@@ -853,39 +880,44 @@ this template instance."
853 ;; If there was no template name, throw an error 880 ;; If there was no template name, throw an error
854 (if (not templatenamepart) 881 (if (not templatenamepart)
855 (error "Include macro %s needs a template name" (oref sti :object-name))) 882 (error "Include macro %s needs a template name" (oref sti :object-name)))
856 ;; Find the template by name, and save it. 883
857 (if (or (not (slot-boundp sti 'includedtemplate)) 884 ;; NOTE: We used to cache the template and not look it up a second time,
858 (not (oref sti includedtemplate))) 885 ;; but changes in the template tables can change which template is
859 (let ((tmpl (srecode-template-get-table (srecode-table) 886 ;; eventually discovered, so now we always lookup that template.
860 templatenamepart)) 887
861 (active (oref srecode-template active)) 888 ;; Calculate and store the discovered template
862 ctxt) 889 (let ((tmpl (srecode-template-get-table (srecode-table)
890 templatenamepart))
891 (active (oref srecode-template active))
892 ctxt)
893 (when (not tmpl)
894 ;; If it isn't just available, scan back through
895 ;; the active template stack, searching for a matching
896 ;; context.
897 (while (and (not tmpl) active)
898 (setq ctxt (oref (car active) context))
899 (setq tmpl (srecode-template-get-table (srecode-table)
900 templatenamepart
901 ctxt))
863 (when (not tmpl) 902 (when (not tmpl)
864 ;; If it isn't just available, scan back through 903 (when (slot-boundp (car active) 'table)
865 ;; the active template stack, searching for a matching 904 (let ((app (oref (oref (car active) table) application)))
866 ;; context. 905 (when app
867 (while (and (not tmpl) active) 906 (setq tmpl (srecode-template-get-table
868 (setq ctxt (oref (car active) context)) 907 (srecode-table)
869 (setq tmpl (srecode-template-get-table (srecode-table) 908 templatenamepart
870 templatenamepart 909 ctxt app)))
871 ctxt)) 910 )))
872 (when (not tmpl) 911 (setq active (cdr active)))
873 (when (slot-boundp (car active) 'table) 912 (when (not tmpl)
874 (let ((app (oref (oref (car active) table) application))) 913 ;; If it wasn't in this context, look to see if it
875 (when app 914 ;; defines it's own context
876 (setq tmpl (srecode-template-get-table 915 (setq tmpl (srecode-template-get-table (srecode-table)
877 (srecode-table) 916 templatenamepart)))
878 templatenamepart 917 )
879 ctxt app))) 918
880 ))) 919 ;; Store the found template into this object for later use.
881 (setq active (cdr active))) 920 (oset sti :includedtemplate tmpl))
882 (when (not tmpl)
883 ;; If it wasn't in this context, look to see if it
884 ;; defines its own context
885 (setq tmpl (srecode-template-get-table (srecode-table)
886 templatenamepart)))
887 )
888 (oset sti :includedtemplate tmpl)))
889 921
890 (if (not (oref sti includedtemplate)) 922 (if (not (oref sti includedtemplate))
891 ;; @todo - Call into a debugger to help find the template in question. 923 ;; @todo - Call into a debugger to help find the template in question.
@@ -955,23 +987,31 @@ insert the section it wraps into the location in the included
955template where a ^ inserter occurs." 987template where a ^ inserter occurs."
956 ;; Step 1: Look up the included inserter 988 ;; Step 1: Look up the included inserter
957 (srecode-insert-include-lookup sti dictionary) 989 (srecode-insert-include-lookup sti dictionary)
958 ;; Step 2: Temporarilly override the point inserter. 990 ;; Step 2: Temporarily override the point inserter.
959 (let* ((vaguely-unique-name sti) 991 ;; We bind `srecode-template-inserter-point-override' to a cons cell
960 (srecode-template-inserter-point-override 992 ;; (DEPTH . FUNCTION) that has the maximum template nesting depth,
961 (lambda (dict2) 993 ;; for which the override is valid, in DEPTH and a lambda function
962 (if (srecode-dictionary-lookup-name 994 ;; which implements the wrap insertion behavior in FUNCTION. The
963 dict2 (oref vaguely-unique-name :object-name)) 995 ;; maximum valid nesting depth is just the current depth + 1.
964 ;; Insert our sectional part with looping. 996 (let ((srecode-template-inserter-point-override
965 (srecode-insert-method-helper 997 (lexical-let ((inserter1 sti))
966 vaguely-unique-name dict2 'template) 998 (cons
967 ;; Insert our sectional part just once. 999 ;; DEPTH
968 (srecode-insert-subtemplate vaguely-unique-name 1000 (+ (length (oref srecode-template active)) 1)
969 dict2 'template)) 1001 ;; FUNCTION
970 ))) 1002 (lambda (dict)
1003 (let ((srecode-template-inserter-point-override nil))
1004 (if (srecode-dictionary-lookup-name
1005 dict (oref inserter1 :object-name))
1006 ;; Insert our sectional part with looping.
1007 (srecode-insert-method-helper
1008 inserter1 dict 'template)
1009 ;; Insert our sectional part just once.
1010 (srecode-insert-subtemplate
1011 inserter1 dict 'template))))))))
971 ;; Do a regular insertion for an include, but with our override in 1012 ;; Do a regular insertion for an include, but with our override in
972 ;; place. 1013 ;; place.
973 (call-next-method) 1014 (call-next-method)))
974 ))
975 1015
976(provide 'srecode/insert) 1016(provide 'srecode/insert)
977 1017
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el
index af96037944b..3a833ca8bb3 100644
--- a/lisp/cedet/srecode/map.el
+++ b/lisp/cedet/srecode/map.el
@@ -295,8 +295,14 @@ if that file is NEW, otherwise assume the mode has not changed."
295 295
296 ;; 2) Do we not have a current map? If so load. 296 ;; 2) Do we not have a current map? If so load.
297 (when (not srecode-current-map) 297 (when (not srecode-current-map)
298 (setq srecode-current-map 298 (condition-case nil
299 (eieio-persistent-read srecode-map-save-file)) 299 (setq srecode-current-map
300 (eieio-persistent-read srecode-map-save-file))
301 (error
302 ;; There was an error loading the old map. Create a new one.
303 (setq srecode-current-map
304 (srecode-map "SRecode Map"
305 :file srecode-map-save-file))))
300 ) 306 )
301 307
302 ) 308 )
diff --git a/lisp/cedet/srecode/mode.el b/lisp/cedet/srecode/mode.el
index f1590ed5ec0..32bf665d06c 100644
--- a/lisp/cedet/srecode/mode.el
+++ b/lisp/cedet/srecode/mode.el
@@ -112,7 +112,13 @@
112 ["Dump Dictionary" 112 ["Dump Dictionary"
113 srecode-dictionary-dump 113 srecode-dictionary-dump
114 :active t 114 :active t
115 :help "Calculate a dump a dictionary for point." 115 :help "Calculate and dump a dictionary for point."
116 ])
117 (semantic-menu-item
118 ["Show Macro Help"
119 srecode-macro-help
120 :active t
121 :help "Display the different types of macros available."
116 ]) 122 ])
117 ) 123 )
118 ) 124 )
@@ -196,43 +202,44 @@ MENU-DEF is the menu to bind this into."
196 (setq context (car-safe (srecode-calculate-context))) 202 (setq context (car-safe (srecode-calculate-context)))
197 203
198 (while subtab 204 (while subtab
199 (setq ltab (oref (car subtab) templates)) 205 (when (srecode-template-table-in-project-p (car subtab))
200 (while ltab 206 (setq ltab (oref (car subtab) templates))
201 (setq temp (car ltab)) 207 (while ltab
202 208 (setq temp (car ltab))
203 ;; Do something with this template. 209
204 210 ;; Do something with this template.
205 (let* ((ctxt (oref temp context)) 211
206 (ctxtcons (assoc ctxt alltabs)) 212 (let* ((ctxt (oref temp context))
207 (bind (if (slot-boundp temp 'binding) 213 (ctxtcons (assoc ctxt alltabs))
208 (oref temp binding))) 214 (bind (if (slot-boundp temp 'binding)
209 (name (object-name-string temp))) 215 (oref temp binding)))
210 216 (name (object-name-string temp)))
211 (when (not ctxtcons) 217
212 (if (string= context ctxt) 218 (when (not ctxtcons)
213 ;; If this context is not in the current list of contexts 219 (if (string= context ctxt)
214 ;; is equal to the current context, then manage the 220 ;; If this context is not in the current list of contexts
215 ;; active list instead 221 ;; is equal to the current context, then manage the
216 (setq active 222 ;; active list instead
217 (setq ctxtcons (or active (cons ctxt nil)))) 223 (setq active
218 ;; This is not an active context, add it to alltabs. 224 (setq ctxtcons (or active (cons ctxt nil))))
219 (setq ctxtcons (cons ctxt nil)) 225 ;; This is not an active context, add it to alltabs.
220 (setq alltabs (cons ctxtcons alltabs)))) 226 (setq ctxtcons (cons ctxt nil))
221 227 (setq alltabs (cons ctxtcons alltabs))))
222 (let ((new (vector 228
223 (if bind 229 (let ((new (vector
224 (concat name " (" bind ")") 230 (if bind
225 name) 231 (concat name " (" bind ")")
226 `(lambda () (interactive) 232 name)
227 (srecode-insert (concat ,ctxt ":" ,name))) 233 `(lambda () (interactive)
228 t))) 234 (srecode-insert (concat ,ctxt ":" ,name)))
229 235 t)))
230 (setcdr ctxtcons (cons 236
231 new 237 (setcdr ctxtcons (cons
232 (cdr ctxtcons))))) 238 new
233 239 (cdr ctxtcons)))))
234 (setq ltab (cdr ltab))) 240
235 (setq subtab (cdr subtab))) 241 (setq ltab (cdr ltab))))
242 (setq subtab (cdr subtab)))
236 243
237 ;; Now create the menu 244 ;; Now create the menu
238 (easy-menu-filter-return 245 (easy-menu-filter-return
@@ -273,6 +280,7 @@ MENU-DEF is the menu to bind this into."
273This command will insert whichever srecode template has a binding 280This command will insert whichever srecode template has a binding
274to the current key." 281to the current key."
275 (interactive) 282 (interactive)
283 (srecode-load-tables-for-mode major-mode)
276 (let* ((k last-command-event) 284 (let* ((k last-command-event)
277 (ctxt (srecode-calculate-context)) 285 (ctxt (srecode-calculate-context))
278 ;; Find the template with the binding K 286 ;; Find the template with the binding K
diff --git a/lisp/cedet/srecode/semantic.el b/lisp/cedet/srecode/semantic.el
index ae96b86a9bc..fd8419add67 100644
--- a/lisp/cedet/srecode/semantic.el
+++ b/lisp/cedet/srecode/semantic.el
@@ -91,7 +91,7 @@ The hook is called with two arguments, the TAG and DICT
91to be augmented.") 91to be augmented.")
92 92
93(define-overload srecode-semantic-apply-tag-to-dict (tagobj dict) 93(define-overload srecode-semantic-apply-tag-to-dict (tagobj dict)
94 "Insert fewatures of TAGOBJ into the dictionary DICT. 94 "Insert features of TAGOBJ into the dictionary DICT.
95TAGOBJ is an object of class `srecode-semantic-tag'. This class 95TAGOBJ is an object of class `srecode-semantic-tag'. This class
96is a compound inserter value. 96is a compound inserter value.
97DICT is a dictionary object. 97DICT is a dictionary object.
@@ -195,7 +195,7 @@ variable default values, and other things."
195;;; :tag ARGUMENT HANDLING 195;;; :tag ARGUMENT HANDLING
196;; 196;;
197;; When a :tag argument is required, identify the current :tag, 197;; When a :tag argument is required, identify the current :tag,
198;; and apply it's parts into the dictionary. 198;; and apply its parts into the dictionary.
199(defun srecode-semantic-handle-:tag (dict) 199(defun srecode-semantic-handle-:tag (dict)
200 "Add macros into the dictionary DICT based on the current :tag." 200 "Add macros into the dictionary DICT based on the current :tag."
201 ;; We have a tag, start adding "stuff" into the dictionary. 201 ;; We have a tag, start adding "stuff" into the dictionary.
@@ -305,8 +305,8 @@ or `code'.
305 305
306For various conditions, this function looks for a template with 306For various conditions, this function looks for a template with
307the name CLASS-tag, where CLASS is the tag class. If it cannot 307the name CLASS-tag, where CLASS is the tag class. If it cannot
308find that, it will look for that template in the 308find that, it will look for that template in the `declaration'
309`declaration'context (if the current context was not `declaration'). 309context (if the current context was not `declaration').
310 310
311If PROTOTYPE is specified, it will first look for templates with 311If PROTOTYPE is specified, it will first look for templates with
312the name CLASS-tag-prototype, or CLASS-prototype as above. 312the name CLASS-tag-prototype, or CLASS-prototype as above.
@@ -382,7 +382,7 @@ as `function' will leave point where code might be inserted."
382 (error "Cannot find template %s in %s for inserting tag %S" 382 (error "Cannot find template %s in %s for inserting tag %S"
383 errtype top (semantic-format-tag-summarize tag))) 383 errtype top (semantic-format-tag-summarize tag)))
384 384
385 ;; Resolve Arguments 385 ;; Resolve arguments
386 (let ((srecode-semantic-selected-tag tag)) 386 (let ((srecode-semantic-selected-tag tag))
387 (srecode-resolve-arguments temp dict)) 387 (srecode-resolve-arguments temp dict))
388 388
diff --git a/lisp/cedet/srecode/table.el b/lisp/cedet/srecode/table.el
index 3d22922d551..2c95d4f6412 100644
--- a/lisp/cedet/srecode/table.el
+++ b/lisp/cedet/srecode/table.el
@@ -31,6 +31,7 @@
31(require 'srecode) 31(require 'srecode)
32 32
33(declare-function srecode-load-tables-for-mode "srecode/find") 33(declare-function srecode-load-tables-for-mode "srecode/find")
34(declare-function srecode-template-table-in-project-p "srecode/find")
34 35
35;;; Code: 36;;; Code:
36 37
@@ -74,6 +75,12 @@ Emacs Lisp code to fill in the dictionary.")
74When there are multiple template files with similar names, templates with 75When there are multiple template files with similar names, templates with
75the highest priority are scanned last, allowing them to override values in 76the highest priority are scanned last, allowing them to override values in
76previous template files.") 77previous template files.")
78 (project :initarg :project
79 :type (or null string)
80 :documentation
81 "Scope some project files to a specific project.
82The value is a directory which forms the root of a particular project,
83or a subset of a particular project.")
77 ;; 84 ;;
78 ;; Parsed Data from the template file 85 ;; Parsed Data from the template file
79 ;; 86 ;;
@@ -224,6 +231,12 @@ Use PREDICATE is the same as for the `sort' function."
224 (when (oref tab :application) 231 (when (oref tab :application)
225 (princ "\nApplication: ") 232 (princ "\nApplication: ")
226 (princ (oref tab :application))) 233 (princ (oref tab :application)))
234 (when (oref tab :project)
235 (require 'srecode/find) ; For srecode-template-table-in-project-p
236 (princ "\nProject Directory: ")
237 (princ (oref tab :project))
238 (when (not (srecode-template-table-in-project-p tab))
239 (princ "\n ** Not Usable in this file. **")))
227 (princ "\n\nVariables:\n") 240 (princ "\n\nVariables:\n")
228 (let ((vars (oref tab variables))) 241 (let ((vars (oref tab variables)))
229 (while vars 242 (while vars
diff --git a/lisp/cedet/srecode/texi.el b/lisp/cedet/srecode/texi.el
index 2c8d1a7204c..30ba91cadf9 100644
--- a/lisp/cedet/srecode/texi.el
+++ b/lisp/cedet/srecode/texi.el
@@ -175,10 +175,17 @@ Adds the following:
175 175
176(define-mode-local-override semantic-insert-foreign-tag 176(define-mode-local-override semantic-insert-foreign-tag
177 texinfo-mode (foreign-tag) 177 texinfo-mode (foreign-tag)
178 "Insert TAG from a foreign buffer in TAGFILE. 178 "Insert FOREIGN-TAG from a foreign buffer in TAGFILE.
179Assume TAGFILE is a source buffer, and create a documentation 179Assume TAGFILE is a source buffer, and create a documentation
180thingy from it using the `document' tool." 180thingy from it using the `document' tool."
181 (let ((srecode-semantic-selected-tag foreign-tag)) 181 (srecode-texi-insert-tag-as-doc foreign-tag))
182
183(defun srecode-texi-insert-tag-as-doc (tag)
184 "Insert TAG into the current buffer with SRecode."
185 (when (not (eq major-mode 'texinfo-mode))
186 (error "Can only insert tags into texinfo in texinfo mode"))
187 (let ((srecode-semantic-selected-tag tag))
188 (srecode-load-tables-for-mode major-mode)
182 ;; @todo - choose of the many types of tags to insert, 189 ;; @todo - choose of the many types of tags to insert,
183 ;; or put all that logic into srecode. 190 ;; or put all that logic into srecode.
184 (srecode-insert "declaration:function"))) 191 (srecode-insert "declaration:function")))
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 34fb5b9c9fc..048093b858d 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -5,7 +5,7 @@
5;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 5;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 6
7;; Author: Eric M. Ludlam <zappo@gnu.org> 7;; Author: Eric M. Ludlam <zappo@gnu.org>
8;; Version: 0.2 8;; Version: 1.3
9;; Keywords: OO, lisp 9;; Keywords: OO, lisp
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -31,6 +31,11 @@
31;; Emacs running environment. 31;; Emacs running environment.
32;; 32;;
33;; See eieio.texi for complete documentation on using this package. 33;; See eieio.texi for complete documentation on using this package.
34;;
35;; Note: the implementation of the c3 algorithm is based on:
36;; Kim Barrett et al.: A Monotonic Superclass Linearization for Dylan
37;; Retrieved from:
38;; http://192.220.96.201/dylan/linearization-oopsla96.html
34 39
35;; There is funny stuff going on with typep and deftype. This 40;; There is funny stuff going on with typep and deftype. This
36;; is the only way I seem to be able to make this stuff load properly. 41;; is the only way I seem to be able to make this stuff load properly.
@@ -44,7 +49,7 @@
44 (require 'cl) 49 (require 'cl)
45 (require 'eieio-comp)) 50 (require 'eieio-comp))
46 51
47(defvar eieio-version "1.2" 52(defvar eieio-version "1.3"
48 "Current version of EIEIO.") 53 "Current version of EIEIO.")
49 54
50(defun eieio-version () 55(defun eieio-version ()
@@ -79,7 +84,7 @@
79 "*This hook is executed, then cleared each time `defclass' is called.") 84 "*This hook is executed, then cleared each time `defclass' is called.")
80 85
81(defvar eieio-error-unsupported-class-tags nil 86(defvar eieio-error-unsupported-class-tags nil
82 "*Non-nil to throw an error if an encountered tag us unsupported. 87 "Non-nil to throw an error if an encountered tag is unsupported.
83This may prevent classes from CLOS applications from being used with EIEIO 88This may prevent classes from CLOS applications from being used with EIEIO
84since EIEIO does not support all CLOS tags.") 89since EIEIO does not support all CLOS tags.")
85 90
@@ -170,6 +175,13 @@ Stored outright without modifications or stripping.")
170(defconst method-generic-after 6 "Index into generic :after tag on a method.") 175(defconst method-generic-after 6 "Index into generic :after tag on a method.")
171(defconst method-num-slots 7 "Number of indexes into a method's vector.") 176(defconst method-num-slots 7 "Number of indexes into a method's vector.")
172 177
178(defsubst eieio-specialized-key-to-generic-key (key)
179 "Convert a specialized KEY into a generic method key."
180 (cond ((eq key method-static) 0) ;; don't convert
181 ((< key method-num-lists) (+ key 3)) ;; The conversion
182 (t key) ;; already generic.. maybe.
183 ))
184
173;; How to specialty compile stuff. 185;; How to specialty compile stuff.
174(autoload 'byte-compile-file-form-defmethod "eieio-comp" 186(autoload 'byte-compile-file-form-defmethod "eieio-comp"
175 "This function is used to byte compile methods in a nice way.") 187 "This function is used to byte compile methods in a nice way.")
@@ -243,8 +255,7 @@ Methods with only primary implementations are executed in an optimized way."
243 )) 255 ))
244 256
245(defmacro class-option-assoc (list option) 257(defmacro class-option-assoc (list option)
246 "Return from LIST the found OPTION. 258 "Return from LIST the found OPTION, or nil if it doesn't exist."
247Return nil if it doesn't exist."
248 `(car-safe (cdr (memq ,option ,list)))) 259 `(car-safe (cdr (memq ,option ,list))))
249 260
250(defmacro class-option (class option) 261(defmacro class-option (class option)
@@ -518,7 +529,7 @@ See `defclass' for more information."
518 529
519 ;; Make sure the method invocation order is a valid value. 530 ;; Make sure the method invocation order is a valid value.
520 (let ((io (class-option-assoc options :method-invocation-order))) 531 (let ((io (class-option-assoc options :method-invocation-order)))
521 (when (and io (not (member io '(:depth-first :breadth-first)))) 532 (when (and io (not (member io '(:depth-first :breadth-first :c3))))
522 (error "Method invocation order %s is not allowed" io) 533 (error "Method invocation order %s is not allowed" io)
523 )) 534 ))
524 535
@@ -800,11 +811,11 @@ See `defclass' for more information."
800(defun eieio-perform-slot-validation-for-default (slot spec value skipnil) 811(defun eieio-perform-slot-validation-for-default (slot spec value skipnil)
801 "For SLOT, signal if SPEC does not match VALUE. 812 "For SLOT, signal if SPEC does not match VALUE.
802If SKIPNIL is non-nil, then if VALUE is nil return t instead." 813If SKIPNIL is non-nil, then if VALUE is nil return t instead."
803 (let ((val (eieio-default-eval-maybe value))) 814 (if (and (not (eieio-eval-default-p value))
804 (if (and (not eieio-skip-typecheck) 815 (not eieio-skip-typecheck)
805 (not (and skipnil (null val))) 816 (not (and skipnil (null value)))
806 (not (eieio-perform-slot-validation spec val))) 817 (not (eieio-perform-slot-validation spec value)))
807 (signal 'invalid-slot-type (list slot spec val))))) 818 (signal 'invalid-slot-type (list slot spec value))))
808 819
809(defun eieio-add-new-slot (newc a d doc type cust label custg print prot init alloc 820(defun eieio-add-new-slot (newc a d doc type cust label custg print prot init alloc
810 &optional defaultoverride skipnil) 821 &optional defaultoverride skipnil)
@@ -1340,7 +1351,7 @@ Summary:
1340 (if (= key -1) 1351 (if (= key -1)
1341 (signal 'wrong-type-argument (list :static 'non-class-arg))) 1352 (signal 'wrong-type-argument (list :static 'non-class-arg)))
1342 ;; generics are higher 1353 ;; generics are higher
1343 (setq key (+ key 3))) 1354 (setq key (eieio-specialized-key-to-generic-key key)))
1344 ;; Put this lambda into the symbol so we can find it 1355 ;; Put this lambda into the symbol so we can find it
1345 (if (byte-code-function-p (car-safe body)) 1356 (if (byte-code-function-p (car-safe body))
1346 (eieiomt-add method (car-safe body) key argclass) 1357 (eieiomt-add method (car-safe body) key argclass)
@@ -1516,13 +1527,21 @@ Fills in OBJ's SLOT with its default value."
1516 (eieio-default-eval-maybe val)) 1527 (eieio-default-eval-maybe val))
1517 obj cl 'oref-default)))) 1528 obj cl 'oref-default))))
1518 1529
1530(defsubst eieio-eval-default-p (val)
1531 "Whether the default value VAL should be evaluated for use."
1532 (and (consp val) (symbolp (car val)) (fboundp (car val))))
1533
1519(defun eieio-default-eval-maybe (val) 1534(defun eieio-default-eval-maybe (val)
1520 "Check VAL, and return what `oref-default' would provide." 1535 "Check VAL, and return what `oref-default' would provide."
1521 ;; check for quoted things, and unquote them 1536 (cond
1522 (if (and (listp val) (eq (car val) 'quote)) 1537 ;; Is it a function call? If so, evaluate it.
1523 (car (cdr val)) 1538 ((eieio-eval-default-p val)
1524 ;; return it verbatim 1539 (eval val))
1525 val)) 1540 ;;;; check for quoted things, and unquote them
1541 ;;((and (consp val) (eq (car val) 'quote))
1542 ;; (car (cdr val)))
1543 ;; return it verbatim
1544 (t val)))
1526 1545
1527;;; Object Set macros 1546;;; Object Set macros
1528;; 1547;;
@@ -1677,6 +1696,116 @@ The CLOS function `class-direct-subclasses' is aliased to this function."
1677 (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class))) 1696 (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
1678 (class-children-fast class)) 1697 (class-children-fast class))
1679 1698
1699(defun eieio-c3-candidate (class remaining-inputs)
1700 "Returns CLASS if it can go in the result now, otherwise nil"
1701 ;; Ensure CLASS is not in any position but the first in any of the
1702 ;; element lists of REMAINING-INPUTS.
1703 (and (not (let ((found nil))
1704 (while (and remaining-inputs (not found))
1705 (setq found (member class (cdr (car remaining-inputs)))
1706 remaining-inputs (cdr remaining-inputs)))
1707 found))
1708 class))
1709
1710(defun eieio-c3-merge-lists (reversed-partial-result remaining-inputs)
1711 "Merge REVERSED-PARTIAL-RESULT REMAINING-INPUTS in a consistent order, if possible.
1712If a consistent order does not exist, signal an error."
1713 (if (let ((tail remaining-inputs)
1714 (found nil))
1715 (while (and tail (not found))
1716 (setq found (car tail) tail (cdr tail)))
1717 (not found))
1718 ;; If all remaining inputs are empty lists, we are done.
1719 (nreverse reversed-partial-result)
1720 ;; Otherwise, we try to find the next element of the result. This
1721 ;; is achieved by considering the first element of each
1722 ;; (non-empty) input list and accepting a candidate if it is
1723 ;; consistent with the rests of the input lists.
1724 (let* ((found nil)
1725 (tail remaining-inputs)
1726 (next (progn
1727 (while (and tail (not found))
1728 (setq found (and (car tail)
1729 (eieio-c3-candidate (caar tail)
1730 remaining-inputs))
1731 tail (cdr tail)))
1732 found)))
1733 (if next
1734 ;; The graph is consistent so far, add NEXT to result and
1735 ;; merge input lists, dropping NEXT from their heads where
1736 ;; applicable.
1737 (eieio-c3-merge-lists
1738 (cons next reversed-partial-result)
1739 (mapcar (lambda (l) (if (eq (first l) next) (rest l) l))
1740 remaining-inputs))
1741 ;; The graph is inconsistent, give up
1742 (signal 'inconsistent-class-hierarchy (list remaining-inputs))))))
1743
1744(defun eieio-class-precedence-dfs (class)
1745 "Return all parents of CLASS in depth-first order."
1746 (let* ((parents (class-parents-fast class))
1747 (classes (copy-sequence
1748 (apply #'append
1749 (list class)
1750 (or
1751 (mapcar
1752 (lambda (parent)
1753 (cons parent
1754 (eieio-class-precedence-dfs parent)))
1755 parents)
1756 '((eieio-default-superclass))))))
1757 (tail classes))
1758 ;; Remove duplicates.
1759 (while tail
1760 (setcdr tail (delq (car tail) (cdr tail)))
1761 (setq tail (cdr tail)))
1762 classes))
1763
1764(defun eieio-class-precedence-bfs (class)
1765 "Return all parents of CLASS in breadth-first order."
1766 (let ((result)
1767 (queue (or (class-parents-fast class)
1768 '(eieio-default-superclass))))
1769 (while queue
1770 (let ((head (pop queue)))
1771 (unless (member head result)
1772 (push head result)
1773 (unless (eq head 'eieio-default-superclass)
1774 (setq queue (append queue (or (class-parents-fast head)
1775 '(eieio-default-superclass))))))))
1776 (cons class (nreverse result)))
1777 )
1778
1779(defun eieio-class-precedence-c3 (class)
1780 "Return all parents of CLASS in c3 order."
1781 (let ((parents (class-parents-fast class)))
1782 (eieio-c3-merge-lists
1783 (list class)
1784 (append
1785 (or
1786 (mapcar
1787 (lambda (x)
1788 (eieio-class-precedence-c3 x))
1789 parents)
1790 '((eieio-default-superclass)))
1791 (list parents))))
1792 )
1793
1794(defun class-precedence-list (class)
1795 "Return (transitively closed) list of parents of CLASS.
1796The order, in which the parents are returned depends on the
1797method invocation orders of the involved classes."
1798 (if (or (null class) (eq class 'eieio-default-superclass))
1799 nil
1800 (case (class-method-invocation-order class)
1801 (:depth-first
1802 (eieio-class-precedence-dfs class))
1803 (:breadth-first
1804 (eieio-class-precedence-bfs class))
1805 (:c3
1806 (eieio-class-precedence-c3 class))))
1807 )
1808
1680;; Official CLOS functions. 1809;; Official CLOS functions.
1681(defalias 'class-direct-superclasses 'class-parents) 1810(defalias 'class-direct-superclasses 'class-parents)
1682(defalias 'class-direct-subclasses 'class-children) 1811(defalias 'class-direct-subclasses 'class-children)
@@ -1714,7 +1843,8 @@ The CLOS function `class-direct-subclasses' is aliased to this function."
1714 p (cdr p))) 1843 p (cdr p)))
1715 (if child t))) 1844 (if child t)))
1716 1845
1717(defun object-slots (obj) "Return list of slots available in OBJ." 1846(defun object-slots (obj)
1847 "Return list of slots available in OBJ."
1718 (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj))) 1848 (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
1719 (aref (class-v (object-class-fast obj)) class-public-a)) 1849 (aref (class-v (object-class-fast obj)) class-public-a))
1720 1850
@@ -2008,14 +2138,26 @@ This should only be called from a generic function."
2008 keys (append (make-list (length tlambdas) method-before) keys)) 2138 keys (append (make-list (length tlambdas) method-before) keys))
2009 ) 2139 )
2010 2140
2011 ;; If there were no methods found, then there could be :static methods. 2141 (if mclass
2012 (when (not lambdas) 2142 ;; For the case of a class,
2143 ;; if there were no methods found, then there could be :static methods.
2144 (when (not lambdas)
2145 (setq tlambdas
2146 (eieio-generic-form method method-static mclass))
2147 (setq lambdas (cons tlambdas lambdas)
2148 keys (cons method-static keys)
2149 primarymethodlist ;; Re-use even with bad name here
2150 (eieiomt-method-list method method-static mclass)))
2151 ;; For the case of no class (ie - mclass == nil) then there may
2152 ;; be a primary method.
2013 (setq tlambdas 2153 (setq tlambdas
2014 (eieio-generic-form method method-static mclass)) 2154 (eieio-generic-form method method-primary nil))
2015 (setq lambdas (cons tlambdas lambdas) 2155 (when tlambdas
2016 keys (cons method-static keys) 2156 (setq lambdas (cons tlambdas lambdas)
2017 primarymethodlist ;; Re-use even with bad name here 2157 keys (cons method-primary keys)
2018 (eieiomt-method-list method method-static mclass))) 2158 primarymethodlist
2159 (eieiomt-method-list method method-primary nil)))
2160 )
2019 2161
2020 (run-hook-with-args 'eieio-pre-method-execution-hooks 2162 (run-hook-with-args 'eieio-pre-method-execution-hooks
2021 primarymethodlist) 2163 primarymethodlist)
@@ -2142,37 +2284,23 @@ CLASS is the starting class to search from in the method tree.
2142If CLASS is nil, then an empty list of methods should be returned." 2284If CLASS is nil, then an empty list of methods should be returned."
2143 ;; Note: eieiomt - the MT means MethodTree. See more comments below 2285 ;; Note: eieiomt - the MT means MethodTree. See more comments below
2144 ;; for the rest of the eieiomt methods. 2286 ;; for the rest of the eieiomt methods.
2145 (let ((lambdas nil) 2287
2146 (mclass (list class))) 2288 ;; Collect lambda expressions stored for the class and its parent
2147 (while mclass 2289 ;; classes.
2148 ;; Note: a nil can show up in the class list once we start 2290 (let (lambdas)
2149 ;; searching through the method tree. 2291 (dolist (ancestor (class-precedence-list class))
2150 (when (car mclass) 2292 ;; Lookup the form to use for the PRIMARY object for the next level
2151 ;; lookup the form to use for the PRIMARY object for the next level 2293 (let ((tmpl (eieio-generic-form method key ancestor)))
2152 (let ((tmpl (eieio-generic-form method key (car mclass)))) 2294 (when (and tmpl
2153 (when (or (not lambdas) 2295 (or (not lambdas)
2154 ;; This prevents duplicates coming out of the 2296 ;; This prevents duplicates coming out of the
2155 ;; class method optimizer. Perhaps we should 2297 ;; class method optimizer. Perhaps we should
2156 ;; just not optimize before/afters? 2298 ;; just not optimize before/afters?
2157 (not (eq (car tmpl) (car (car lambdas))))) 2299 (not (member tmpl lambdas))))
2158 (setq lambdas (cons tmpl lambdas)) 2300 (push tmpl lambdas))))
2159 (if (null (car lambdas)) 2301
2160 (setq lambdas (cdr lambdas)))))) 2302 ;; Return collected lambda. For :after methods, return in current
2161 ;; Add new classes to mclass. Since our input might not be a class 2303 ;; order (most general class last); Otherwise, reverse order.
2162 ;; protect against that.
2163 (if (car mclass)
2164 ;; If there is a class, append any methods it may provide
2165 ;; to the remainder of the class list.
2166 (let ((io (class-method-invocation-order (car mclass))))
2167 (if (eq io :depth-first)
2168 ;; Depth first.
2169 (setq mclass (append (eieiomt-next (car mclass)) (cdr mclass)))
2170 ;; Breadth first.
2171 (setq mclass (append (cdr mclass) (eieiomt-next (car mclass)))))
2172 )
2173 ;; Advance to next entry in mclass if it is nil.
2174 (setq mclass (cdr mclass)))
2175 )
2176 (if (eq key method-after) 2304 (if (eq key method-after)
2177 lambdas 2305 lambdas
2178 (nreverse lambdas)))) 2306 (nreverse lambdas))))
@@ -2206,6 +2334,7 @@ Use `next-method-p' to find out if there is a next method to call."
2206 (apply 'no-next-method (car newargs) (cdr newargs)) 2334 (apply 'no-next-method (car newargs) (cdr newargs))
2207 (let* ((eieio-generic-call-next-method-list 2335 (let* ((eieio-generic-call-next-method-list
2208 (cdr eieio-generic-call-next-method-list)) 2336 (cdr eieio-generic-call-next-method-list))
2337 (eieio-generic-call-arglst newargs)
2209 (scoped-class (cdr next)) 2338 (scoped-class (cdr next))
2210 (fcn (car next)) 2339 (fcn (car next))
2211 ) 2340 )
@@ -2298,32 +2427,18 @@ nil for superclasses. This function performs no type checking!"
2298 2427
2299(defun eieiomt-sym-optimize (s) 2428(defun eieiomt-sym-optimize (s)
2300 "Find the next class above S which has a function body for the optimizer." 2429 "Find the next class above S which has a function body for the optimizer."
2301 ;; (message "Optimizing %S" s) 2430 ;; Set the value to nil in case there is no nearest cell.
2302 (let* ((es (intern-soft (symbol-name s))) ;external symbol of class 2431 (set s nil)
2303 (io (class-method-invocation-order es)) 2432 ;; Find the nearest cell that has a function body. If we find one,
2304 (ov nil) 2433 ;; we replace the nil from above.
2305 (cont t)) 2434 (let ((external-symbol (intern-soft (symbol-name s))))
2306 ;; This converts ES from a single symbol to a list of parent classes. 2435 (catch 'done
2307 (setq es (eieiomt-next es)) 2436 (dolist (ancestor (rest (class-precedence-list external-symbol)))
2308 ;; Loop over ES, then its children individually. 2437 (let ((ov (intern-soft (symbol-name ancestor)
2309 ;; We can have multiple hits only at one level of the parent tree. 2438 eieiomt-optimizing-obarray)))
2310 (while (and es cont) 2439 (when (fboundp ov)
2311 (setq ov (intern-soft (symbol-name (car es)) eieiomt-optimizing-obarray)) 2440 (set s ov) ;; store ov as our next symbol
2312 (if (fboundp ov) 2441 (throw 'done ancestor)))))))
2313 (progn
2314 (set s ov) ;store ov as our next symbol
2315 (setq cont nil))
2316 (if (eq io :depth-first)
2317 ;; Pre-pend the subclasses of (car es) so we get
2318 ;; DEPTH FIRST optimization.
2319 (setq es (append (eieiomt-next (car es)) (cdr es)))
2320 ;; Else, we are breadth first.
2321 ;; (message "Class %s is breadth first" es)
2322 (setq es (append (cdr es) (eieiomt-next (car es))))
2323 )))
2324 ;; If there is no nearest call, then set our value to nil
2325 (if (not es) (set s nil))
2326 ))
2327 2442
2328(defun eieio-generic-form (method key class) 2443(defun eieio-generic-form (method key class)
2329 "Return the lambda form belonging to METHOD using KEY based upon CLASS. 2444 "Return the lambda form belonging to METHOD using KEY based upon CLASS.
@@ -2332,7 +2447,7 @@ no form, but has a parent class, then trace to that parent class.
2332The first time a form is requested from a symbol, an optimized path 2447The first time a form is requested from a symbol, an optimized path
2333is memorized for faster future use." 2448is memorized for faster future use."
2334 (let ((emto (aref (get method 'eieio-method-obarray) 2449 (let ((emto (aref (get method 'eieio-method-obarray)
2335 (if class key (+ key 3))))) 2450 (if class key (eieio-specialized-key-to-generic-key key)))))
2336 (if (class-p class) 2451 (if (class-p class)
2337 ;; 1) find our symbol 2452 ;; 1) find our symbol
2338 (let ((cs (intern-soft (symbol-name class) emto))) 2453 (let ((cs (intern-soft (symbol-name class) emto)))
@@ -2365,7 +2480,7 @@ is memorized for faster future use."
2365 nil))) 2480 nil)))
2366 ;; for a generic call, what is a list, is the function body we want. 2481 ;; for a generic call, what is a list, is the function body we want.
2367 (let ((emtl (aref (get method 'eieio-method-tree) 2482 (let ((emtl (aref (get method 'eieio-method-tree)
2368 (if class key (+ key 3))))) 2483 (if class key (eieio-specialized-key-to-generic-key key)))))
2369 (if emtl 2484 (if emtl
2370 ;; The car of EMTL is supposed to be a class, which in this 2485 ;; The car of EMTL is supposed to be a class, which in this
2371 ;; case is nil, so skip it. 2486 ;; case is nil, so skip it.
@@ -2430,6 +2545,11 @@ This is usually a symbol that starts with `:'."
2430(put 'unbound-slot 'error-conditions '(unbound-slot error nil)) 2545(put 'unbound-slot 'error-conditions '(unbound-slot error nil))
2431(put 'unbound-slot 'error-message "Unbound slot") 2546(put 'unbound-slot 'error-message "Unbound slot")
2432 2547
2548(intern "inconsistent-class-hierarchy")
2549(put 'inconsistent-class-hierarchy 'error-conditions
2550 '(inconsistent-class-hierarchy error nil))
2551(put 'inconsistent-class-hierarchy 'error-message "Inconsistent class hierarchy")
2552
2433;;; Here are some CLOS items that need the CL package 2553;;; Here are some CLOS items that need the CL package
2434;; 2554;;
2435 2555
@@ -2525,6 +2645,17 @@ dynamically set from SLOTS."
2525 (slot (aref scoped-class class-public-a)) 2645 (slot (aref scoped-class class-public-a))
2526 (defaults (aref scoped-class class-public-d))) 2646 (defaults (aref scoped-class class-public-d)))
2527 (while slot 2647 (while slot
2648 ;; For each slot, see if we need to evaluate it.
2649 ;;
2650 ;; Paul Landes said in an email:
2651 ;; > CL evaluates it if it can, and otherwise, leaves it as
2652 ;; > the quoted thing as you already have. This is by the
2653 ;; > Sonya E. Keene book and other things I've look at on the
2654 ;; > web.
2655 (let ((dflt (eieio-default-eval-maybe (car defaults))))
2656 (when (not (eq dflt (car defaults)))
2657 (eieio-oset this (car slot) dflt) ))
2658 ;; Next.
2528 (setq slot (cdr slot) 2659 (setq slot (cdr slot)
2529 defaults (cdr defaults)))) 2660 defaults (cdr defaults))))
2530 ;; Shared initialize will parse our slots for us. 2661 ;; Shared initialize will parse our slots for us.
diff --git a/lisp/emacs-lisp/float-sup.el b/lisp/emacs-lisp/float-sup.el
index 6bdc9073ddf..48add9f1ffa 100644
--- a/lisp/emacs-lisp/float-sup.el
+++ b/lisp/emacs-lisp/float-sup.el
@@ -35,25 +35,25 @@
35 35
36;; provide an easy hook to tell if we are running with floats or not. 36;; provide an easy hook to tell if we are running with floats or not.
37;; define pi and e via math-lib calls. (much less prone to killer typos.) 37;; define pi and e via math-lib calls. (much less prone to killer typos.)
38(defconst pi (* 4 (atan 1)) "The value of Pi (3.1415926...).") 38(defconst float-pi (* 4 (atan 1)) "The value of Pi (3.1415926...).")
39(defconst pi float-pi "Obsolete since Emacs-23.3. Use `float-pi' instead.")
39 40
40;; It's too inconvenient to make `e' a constant because it's used as 41(defconst float-e (exp 1) "The value of e (2.7182818...).")
41;; a temporary variable all the time. 42(defvar e float-e "Obsolete since Emacs-23.3. Use `float-e' instead.")
42(defvar e (exp 1) "The value of e (2.7182818...).")
43 43
44(defconst degrees-to-radians (/ pi 180.0) 44(defconst degrees-to-radians (/ float-pi 180.0)
45 "Degrees to radian conversion constant.") 45 "Degrees to radian conversion constant.")
46(defconst radians-to-degrees (/ 180.0 pi) 46(defconst radians-to-degrees (/ 180.0 float-pi)
47 "Radian to degree conversion constant.") 47 "Radian to degree conversion constant.")
48 48
49;; these expand to a single multiply by a float when byte compiled 49;; these expand to a single multiply by a float when byte compiled
50 50
51(defmacro degrees-to-radians (x) 51(defmacro degrees-to-radians (x)
52 "Convert ARG from degrees to radians." 52 "Convert ARG from degrees to radians."
53 (list '* (/ pi 180.0) x)) 53 (list '* degrees-to-radians x))
54(defmacro radians-to-degrees (x) 54(defmacro radians-to-degrees (x)
55 "Convert ARG from radians to degrees." 55 "Convert ARG from radians to degrees."
56 (list '* (/ 180.0 pi) x)) 56 (list '* radians-to-degrees x))
57 57
58(provide 'lisp-float-type) 58(provide 'lisp-float-type)
59 59
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 3ca70cabe50..6a77152b104 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12010-09-21 Glenn Morris <rgm@gnu.org>
2
3 * message.el (message-output): Use gnus-output-to-rmail if a buffer is
4 visiting the fcc file in rmail-mode.
5
12010-09-23 Lars Magne Ingebrigtsen <larsi@gnus.org> 62010-09-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 7
3 * nnimap.el (nnimap-update-info): Sync non-standard flags from the 8 * nnimap.el (nnimap-update-info): Sync non-standard flags from the
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 13706ae55f8..243e0ddadff 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -5349,8 +5349,14 @@ Otherwise, generate and save a value for `canlock-password' first."
5349 5349
5350(defun message-output (filename) 5350(defun message-output (filename)
5351 "Append this article to Unix/babyl mail file FILENAME." 5351 "Append this article to Unix/babyl mail file FILENAME."
5352 (if (and (file-readable-p filename) 5352 (if (or (and (file-readable-p filename)
5353 (mail-file-babyl-p filename)) 5353 (mail-file-babyl-p filename))
5354 ;; gnus-output-to-mail does the wrong thing with live, mbox
5355 ;; Rmail buffers in Emacs 23.
5356 ;; http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597255
5357 (let ((buff (find-buffer-visiting filename)))
5358 (and buff (with-current-buffer buff
5359 (eq major-mode 'rmail-mode)))))
5354 (gnus-output-to-rmail filename t) 5360 (gnus-output-to-rmail filename t)
5355 (gnus-output-to-mail filename t))) 5361 (gnus-output-to-mail filename t)))
5356 5362
diff --git a/lisp/isearch.el b/lisp/isearch.el
index ea3476dca06..98032c29ba7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -275,30 +275,37 @@ and `lazy-highlight-interval')."
275 :group 'isearch 275 :group 'isearch
276 :group 'matching) 276 :group 'matching)
277 277
278(define-obsolete-variable-alias 'isearch-lazy-highlight-cleanup
279 'lazy-highlight-cleanup
280 "22.1")
281
278(defcustom lazy-highlight-cleanup t 282(defcustom lazy-highlight-cleanup t
279 "Controls whether to remove extra highlighting after a search. 283 "Controls whether to remove extra highlighting after a search.
280If this is nil, extra highlighting can be \"manually\" removed with 284If this is nil, extra highlighting can be \"manually\" removed with
281\\[lazy-highlight-cleanup]." 285\\[lazy-highlight-cleanup]."
282 :type 'boolean 286 :type 'boolean
283 :group 'lazy-highlight) 287 :group 'lazy-highlight)
284(define-obsolete-variable-alias 'isearch-lazy-highlight-cleanup 288
285 'lazy-highlight-cleanup 289(define-obsolete-variable-alias 'isearch-lazy-highlight-initial-delay
290 'lazy-highlight-initial-delay
286 "22.1") 291 "22.1")
287 292
288(defcustom lazy-highlight-initial-delay 0.25 293(defcustom lazy-highlight-initial-delay 0.25
289 "Seconds to wait before beginning to lazily highlight all matches." 294 "Seconds to wait before beginning to lazily highlight all matches."
290 :type 'number 295 :type 'number
291 :group 'lazy-highlight) 296 :group 'lazy-highlight)
292(define-obsolete-variable-alias 'isearch-lazy-highlight-initial-delay 297
293 'lazy-highlight-initial-delay 298(define-obsolete-variable-alias 'isearch-lazy-highlight-interval
299 'lazy-highlight-interval
294 "22.1") 300 "22.1")
295 301
296(defcustom lazy-highlight-interval 0 ; 0.0625 302(defcustom lazy-highlight-interval 0 ; 0.0625
297 "Seconds between lazily highlighting successive matches." 303 "Seconds between lazily highlighting successive matches."
298 :type 'number 304 :type 'number
299 :group 'lazy-highlight) 305 :group 'lazy-highlight)
300(define-obsolete-variable-alias 'isearch-lazy-highlight-interval 306
301 'lazy-highlight-interval 307(define-obsolete-variable-alias 'isearch-lazy-highlight-max-at-a-time
308 'lazy-highlight-max-at-a-time
302 "22.1") 309 "22.1")
303 310
304(defcustom lazy-highlight-max-at-a-time 20 311(defcustom lazy-highlight-max-at-a-time 20
@@ -309,9 +316,6 @@ A value of nil means highlight all matches."
309 :type '(choice (const :tag "All" nil) 316 :type '(choice (const :tag "All" nil)
310 (integer :tag "Some")) 317 (integer :tag "Some"))
311 :group 'lazy-highlight) 318 :group 'lazy-highlight)
312(define-obsolete-variable-alias 'isearch-lazy-highlight-max-at-a-time
313 'lazy-highlight-max-at-a-time
314 "22.1")
315 319
316(defface lazy-highlight 320(defface lazy-highlight
317 '((((class color) (min-colors 88) (background light)) 321 '((((class color) (min-colors 88) (background light))
@@ -327,10 +331,10 @@ A value of nil means highlight all matches."
327 :group 'lazy-highlight 331 :group 'lazy-highlight
328 :group 'basic-faces) 332 :group 'basic-faces)
329(define-obsolete-face-alias 'isearch-lazy-highlight-face 'lazy-highlight "22.1") 333(define-obsolete-face-alias 'isearch-lazy-highlight-face 'lazy-highlight "22.1")
330(defvar lazy-highlight-face 'lazy-highlight)
331(define-obsolete-variable-alias 'isearch-lazy-highlight-face 334(define-obsolete-variable-alias 'isearch-lazy-highlight-face
332 'lazy-highlight-face 335 'lazy-highlight-face
333 "22.1") 336 "22.1")
337(defvar lazy-highlight-face 'lazy-highlight)
334 338
335;; Define isearch help map. 339;; Define isearch help map.
336 340
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 94a1af42455..b69c571ddf5 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -99,6 +99,9 @@ These options can be used to limit how many ICMP packets are emitted."
99 :group 'net-utils 99 :group 'net-utils
100 :type 'string) 100 :type 'string)
101 101
102(define-obsolete-variable-alias 'ipconfig-program-options
103 'ifconfig-program-options "22.2")
104
102(defcustom ifconfig-program-options 105(defcustom ifconfig-program-options
103 (list 106 (list
104 (if (eq system-type 'windows-nt) 107 (if (eq system-type 'windows-nt)
@@ -113,9 +116,6 @@ These options can be used to limit how many ICMP packets are emitted."
113 :type 'string 116 :type 'string
114 :version "23.1") 117 :version "23.1")
115 118
116(define-obsolete-variable-alias 'ipconfig-program-options
117 'ifconfig-program-options "22.2")
118
119(defcustom iwconfig-program-options nil 119(defcustom iwconfig-program-options nil
120 "Options for the iwconfig program." 120 "Options for the iwconfig program."
121 :group 'net-utils 121 :group 'net-utils
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 957bab0d275..8daf24d549f 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -319,7 +319,8 @@ the variables are properly set."
319 "+\\)[ \t]*"))) 319 "+\\)[ \t]*")))
320 (unless (and comment-end-skip 320 (unless (and comment-end-skip
321 ;; In case comment-end has changed since last time. 321 ;; In case comment-end has changed since last time.
322 (string-match comment-end-skip comment-end)) 322 (string-match comment-end-skip
323 (if (string= "" comment-end) "\n" comment-end)))
323 (let ((ce (if (string= "" comment-end) "\n" 324 (let ((ce (if (string= "" comment-end) "\n"
324 (comment-string-strip comment-end t t)))) 325 (comment-string-strip comment-end t t))))
325 (set (make-local-variable 'comment-end-skip) 326 (set (make-local-variable 'comment-end-skip)
diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index 91968b02bc8..69620aeaca2 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -1377,7 +1377,7 @@ Return t if new char is non-empty."
1377 (g (nth 1 crgb)) 1377 (g (nth 1 crgb))
1378 (b (nth 2 crgb)) 1378 (b (nth 2 crgb))
1379 (brightness (/ (+ r g b) 3.0 256 256)) 1379 (brightness (/ (+ r g b) 3.0 256 256))
1380 (val (sin (* brightness (/ pi 2)))) 1380 (val (sin (* brightness (/ float-pi 2))))
1381 (rr (* red val)) 1381 (rr (* red val))
1382 (gg (* green val)) 1382 (gg (* green val))
1383 (bb (* blue val)) 1383 (bb (* blue val))
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index 41145afb766..bca7eed00d2 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -2939,7 +2939,7 @@ Blanks in the rendered text overwrite any text in the buffer."
2939Returns a list of points. Each point is on the form (X1 . Y1)." 2939Returns a list of points. Each point is on the form (X1 . Y1)."
2940 (let ((points)) 2940 (let ((points))
2941 (while (> n 0) 2941 (while (> n 0)
2942 (let* ((angle (* (random 359) (/ pi 180))) 2942 (let* ((angle (* (random 359) (/ float-pi 180)))
2943 (dist (random radius)) 2943 (dist (random radius))
2944 (point (cons (round (* dist (cos angle))) 2944 (point (cons (round (* dist (cos angle)))
2945 (round (* dist (sin angle)))))) 2945 (round (* dist (sin angle))))))
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 02e135bf7a4..0d1645b25c3 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,5 +1,9 @@
12010-09-23 Glenn Morris <rgm@gnu.org> 12010-09-23 Glenn Morris <rgm@gnu.org>
2 2
3 * url-cache.el (url-is-cached): Doc fix.
4
52010-09-23 Glenn Morris <rgm@gnu.org>
6
3 * url-cache.el (url-cache-expired): Don't autoload. 7 * url-cache.el (url-cache-expired): Don't autoload.
4 Tweak previous change. 8 Tweak previous change.
5 (url-cache-expire-time): Doc fix. 9 (url-cache-expire-time): Doc fix.
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 418a8e22672..53222cbc4e6 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -83,7 +83,8 @@ FILE can be created or overwritten."
83 83
84;;;###autoload 84;;;###autoload
85(defun url-is-cached (url) 85(defun url-is-cached (url)
86 "Return non-nil if the URL is cached." 86 "Return non-nil if the URL is cached.
87The actual return value is the last modification time of the cache file."
87 (let* ((fname (url-cache-create-filename url)) 88 (let* ((fname (url-cache-create-filename url))
88 (attribs (file-attributes fname))) 89 (attribs (file-attributes fname)))
89 (and fname ; got a filename 90 (and fname ; got a filename
diff --git a/src/ChangeLog b/src/ChangeLog
index 39f7d3ab393..60a25316cb1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12010-09-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * syntax.c (back_comment): Detect the case where a 1-char comment
4 starter is also the 2nd char of a 2-char comment ender.
5
62010-09-23 Jan Djärv <jan.h.d@swipnet.se>
7
8 * gtkutil.c (xg_tool_bar_menu_proxy): Set gtk-menu-items to TRUE.
9
12010-09-23 Eli Zaretskii <eliz@gnu.org> 102010-09-23 Eli Zaretskii <eliz@gnu.org>
2 11
3 * editfns.c (transpose_markers, update_buffer_properties) 12 * editfns.c (transpose_markers, update_buffer_properties)
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 9356250eb71..f82be62965d 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3716,6 +3716,8 @@ xg_tool_bar_menu_proxy (GtkToolItem *toolitem, gpointer user_data)
3716 GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton)); 3716 GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton));
3717 GtkImageType store_type = gtk_image_get_storage_type (wimage); 3717 GtkImageType store_type = gtk_image_get_storage_type (wimage);
3718 3718
3719 g_object_set (G_OBJECT (settings), "gtk-menu-images", TRUE, NULL);
3720
3719 if (store_type == GTK_IMAGE_STOCK) 3721 if (store_type == GTK_IMAGE_STOCK)
3720 { 3722 {
3721 gchar *stock_id; 3723 gchar *stock_id;
diff --git a/src/syntax.c b/src/syntax.c
index f0a7dca42dc..5f836b0e8cf 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -559,6 +559,7 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
559 { 559 {
560 int temp_byte, prev_syntax; 560 int temp_byte, prev_syntax;
561 int com2start, com2end; 561 int com2start, com2end;
562 int comstart;
562 563
563 /* Move back and examine a character. */ 564 /* Move back and examine a character. */
564 DEC_BOTH (from, from_byte); 565 DEC_BOTH (from, from_byte);
@@ -578,7 +579,8 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
578 || SYNTAX_FLAGS_COMMENT_NESTED (syntax)) == comnested); 579 || SYNTAX_FLAGS_COMMENT_NESTED (syntax)) == comnested);
579 com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax) 580 com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax)
580 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax)); 581 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax));
581 582 comstart = (com2start || code == Scomment);
583
582 /* Nasty cases with overlapping 2-char comment markers: 584 /* Nasty cases with overlapping 2-char comment markers:
583 - snmp-mode: -- c -- foo -- c -- 585 - snmp-mode: -- c -- foo -- c --
584 --- c -- 586 --- c --
@@ -589,15 +591,16 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
589 /// */ 591 /// */
590 592
591 /* If a 2-char comment sequence partly overlaps with another, 593 /* If a 2-char comment sequence partly overlaps with another,
592 we don't try to be clever. */ 594 we don't try to be clever. E.g. |*| in C, or }% in modes that
593 if (from > stop && (com2end || com2start)) 595 have %..\n and %{..}%. */
596 if (from > stop && (com2end || comstart))
594 { 597 {
595 int next = from, next_byte = from_byte, next_c, next_syntax; 598 int next = from, next_byte = from_byte, next_c, next_syntax;
596 DEC_BOTH (next, next_byte); 599 DEC_BOTH (next, next_byte);
597 UPDATE_SYNTAX_TABLE_BACKWARD (next); 600 UPDATE_SYNTAX_TABLE_BACKWARD (next);
598 next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte); 601 next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte);
599 next_syntax = SYNTAX_WITH_FLAGS (next_c); 602 next_syntax = SYNTAX_WITH_FLAGS (next_c);
600 if (((com2start || comnested) 603 if (((comstart || comnested)
601 && SYNTAX_FLAGS_COMEND_SECOND (syntax) 604 && SYNTAX_FLAGS_COMEND_SECOND (syntax)
602 && SYNTAX_FLAGS_COMEND_FIRST (next_syntax)) 605 && SYNTAX_FLAGS_COMEND_FIRST (next_syntax))
603 || ((com2end || comnested) 606 || ((com2end || comnested)