aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrégoire Jadi2013-06-12 17:06:09 +0200
committerGrégoire Jadi2013-06-12 17:06:09 +0200
commit32a590b04a10f6bbe92bc1519b9e5ba2d32cfabc (patch)
tree578be4eb2757a0716f252a269adc49fa9406556d
parent5c77269b59c8d8d88fa91ec2c949294db1bb2131 (diff)
parente6fa6da6899bf1b4877b96c450eae3934085d560 (diff)
downloademacs-32a590b04a10f6bbe92bc1519b9e5ba2d32cfabc.tar.gz
emacs-32a590b04a10f6bbe92bc1519b9e5ba2d32cfabc.zip
Merge branch 'jave-xwidget' into xwidget
-rw-r--r--ChangeLog62
-rw-r--r--INSTALL2
-rw-r--r--Makefile.in27
-rw-r--r--admin/ChangeLog7
-rw-r--r--admin/grammars/srecode-template.wy6
-rw-r--r--admin/notes/bzr45
-rw-r--r--autogen/Makefile.in4
-rw-r--r--autogen/config.in15
-rwxr-xr-xautogen/configure183
-rw-r--r--configure.ac95
-rw-r--r--doc/emacs/ChangeLog43
-rw-r--r--doc/emacs/cmdargs.texi4
-rw-r--r--doc/emacs/display.texi48
-rw-r--r--doc/emacs/emacs.texi16
-rw-r--r--doc/emacs/maintaining.texi17
-rw-r--r--doc/emacs/programs.texi2
-rw-r--r--doc/emacs/search.texi40
-rw-r--r--doc/lispref/ChangeLog24
-rw-r--r--doc/lispref/compile.texi12
-rw-r--r--doc/lispref/files.texi53
-rw-r--r--doc/lispref/functions.texi5
-rw-r--r--doc/misc/ChangeLog15
-rw-r--r--doc/misc/epa.texi5
-rw-r--r--doc/misc/eshell.texi27
-rw-r--r--doc/misc/gnus.texi15
-rw-r--r--etc/ChangeLog21
-rw-r--r--etc/NEWS69
-rw-r--r--etc/srecode/c.srt2
-rw-r--r--etc/themes/tsdh-dark-theme.el4
-rw-r--r--etc/tutorials/TUTORIAL.ru8
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lib-src/Makefile.in2
-rw-r--r--lib/c-ctype.h3
-rw-r--r--lib/sig2str.h8
-rw-r--r--lib/verify.h4
-rw-r--r--lisp/ChangeLog756
-rw-r--r--lisp/ChangeLog.26
-rw-r--r--lisp/Makefile.in5
-rw-r--r--lisp/allout.el2
-rw-r--r--lisp/autorevert.el57
-rw-r--r--lisp/bindings.el1
-rw-r--r--lisp/cedet/ChangeLog93
-rw-r--r--lisp/cedet/ede.el21
-rw-r--r--lisp/cedet/ede/base.el66
-rw-r--r--lisp/cedet/ede/cpp-root.el5
-rw-r--r--lisp/cedet/ede/proj.el2
-rw-r--r--lisp/cedet/semantic.el3
-rw-r--r--lisp/cedet/semantic/analyze/fcn.el2
-rw-r--r--lisp/cedet/semantic/bovine/c.el2
-rw-r--r--lisp/cedet/semantic/bovine/el.el9
-rw-r--r--lisp/cedet/semantic/complete.el2
-rw-r--r--lisp/cedet/semantic/ctxt.el83
-rw-r--r--lisp/cedet/semantic/db.el2
-rw-r--r--lisp/cedet/semantic/decorate/mode.el44
-rw-r--r--lisp/cedet/semantic/ede-grammar.el2
-rw-r--r--lisp/cedet/semantic/edit.el5
-rw-r--r--lisp/cedet/semantic/grammar.el5
-rw-r--r--lisp/cedet/semantic/idle.el54
-rw-r--r--lisp/cedet/semantic/lex.el2
-rw-r--r--lisp/cedet/semantic/wisent/python.el14
-rw-r--r--lisp/cedet/srecode/args.el1
-rw-r--r--lisp/cedet/srecode/compile.el28
-rw-r--r--lisp/cedet/srecode/java.el1
-rw-r--r--lisp/cedet/srecode/srt-wy.el6
-rw-r--r--lisp/emacs-lisp/bytecomp.el189
-rw-r--r--lisp/emacs-lisp/cconv.el15
-rw-r--r--lisp/emacs-lisp/cl-lib.el4
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el11
-rw-r--r--lisp/emacs-lisp/cl-macs.el50
-rw-r--r--lisp/emacs-lisp/edebug.el5
-rw-r--r--lisp/emacs-lisp/eieio-base.el1
-rw-r--r--lisp/emacs-lisp/eieio-core.el2264
-rw-r--r--lisp/emacs-lisp/eieio.el2234
-rw-r--r--lisp/emacs-lisp/generic.el89
-rw-r--r--lisp/emacs-lisp/lisp-mode.el11
-rw-r--r--lisp/emacs-lisp/lisp.el104
-rw-r--r--lisp/emacs-lisp/macroexp.el15
-rw-r--r--lisp/emacs-lisp/package-x.el63
-rw-r--r--lisp/emacs-lisp/package.el378
-rw-r--r--lisp/emacs-lisp/smie.el178
-rw-r--r--lisp/emacs-lisp/syntax.el13
-rw-r--r--lisp/emacs-lisp/trace.el12
-rw-r--r--lisp/emulation/cua-gmrk.el6
-rw-r--r--lisp/emulation/cua-rect.el3
-rw-r--r--lisp/epa.el27
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/erc-backend.el3
-rw-r--r--lisp/eshell/em-cmpl.el16
-rw-r--r--lisp/eshell/em-dirs.el3
-rw-r--r--lisp/eshell/em-script.el7
-rw-r--r--lisp/eshell/em-term.el76
-rw-r--r--lisp/eshell/esh-ext.el17
-rw-r--r--lisp/eshell/esh-mode.el7
-rw-r--r--lisp/finder.el3
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/gnus/ChangeLog133
-rw-r--r--lisp/gnus/eww.el349
-rw-r--r--lisp/gnus/gnus-art.el104
-rw-r--r--lisp/gnus/gnus-ems.el8
-rw-r--r--lisp/gnus/gnus-group.el7
-rw-r--r--lisp/gnus/gnus-sum.el18
-rw-r--r--lisp/gnus/gnus.el3
-rw-r--r--lisp/gnus/gravatar.el2
-rw-r--r--lisp/gnus/mm-view.el20
-rw-r--r--lisp/gnus/nnimap.el1
-rw-r--r--lisp/gnus/nnmail.el10
-rw-r--r--lisp/gnus/registry.el376
-rw-r--r--lisp/gnus/shr.el63
-rw-r--r--lisp/gnus/sieve-manage.el248
-rw-r--r--lisp/gnus/sieve.el13
-rw-r--r--lisp/gnus/spam-stat.el3
-rw-r--r--lisp/gnus/spam.el13
-rw-r--r--lisp/help-fns.el21
-rw-r--r--lisp/help-mode.el4
-rw-r--r--lisp/hi-lock.el38
-rw-r--r--lisp/ido.el108
-rw-r--r--lisp/ielm.el15
-rw-r--r--lisp/image.el7
-rw-r--r--lisp/international/mule-conf.el1
-rw-r--r--lisp/isearch.el91
-rw-r--r--lisp/ldefs-boot.el583
-rw-r--r--lisp/loadup.el1
-rw-r--r--lisp/minibuffer.el16
-rw-r--r--lisp/net/net-utils.el4
-rw-r--r--lisp/net/rlogin.el27
-rw-r--r--lisp/net/tls.el5
-rw-r--r--lisp/newcomment.el44
-rw-r--r--lisp/obsolete/sym-comp.el11
-rw-r--r--lisp/paren.el296
-rw-r--r--lisp/pcmpl-gnu.el3
-rw-r--r--lisp/progmodes/cc-bytecomp.el16
-rw-r--r--lisp/progmodes/cc-cmds.el1
-rw-r--r--lisp/progmodes/cc-defs.el14
-rw-r--r--lisp/progmodes/cc-engine.el7
-rw-r--r--lisp/progmodes/cc-fonts.el1
-rw-r--r--lisp/progmodes/cc-mode.el5
-rw-r--r--lisp/progmodes/cc-vars.el23
-rw-r--r--lisp/progmodes/cfengine.el10
-rw-r--r--lisp/progmodes/compile.el6
-rw-r--r--lisp/progmodes/cperl-mode.el8
-rw-r--r--lisp/progmodes/gdb-mi.el2
-rw-r--r--lisp/progmodes/idlwave.el92
-rw-r--r--lisp/progmodes/octave.el192
-rw-r--r--lisp/progmodes/perl-mode.el49
-rw-r--r--lisp/progmodes/prog-mode.el119
-rw-r--r--lisp/progmodes/prolog.el44
-rw-r--r--lisp/progmodes/python.el5
-rw-r--r--lisp/progmodes/ruby-mode.el110
-rw-r--r--lisp/progmodes/tcl.el2
-rw-r--r--lisp/replace.el166
-rw-r--r--lisp/simple.el28
-rw-r--r--lisp/skeleton.el12
-rw-r--r--lisp/subr.el479
-rw-r--r--lisp/term/ns-win.el5
-rw-r--r--lisp/vc/log-view.el40
-rw-r--r--lisp/vc/vc.el28
-rw-r--r--nextstep/ChangeLog4
-rw-r--r--nextstep/templates/Info-gnustep.plist.in14
-rw-r--r--nt/ChangeLog46
-rw-r--r--nt/INSTALL.MSYS82
-rw-r--r--nt/Makefile.in4
-rw-r--r--nt/config.nt9
-rw-r--r--nt/epaths.nt6
-rw-r--r--nt/inc/sys/time.h14
-rw-r--r--src/.gdbinit21
-rw-r--r--src/ChangeLog443
-rw-r--r--src/ChangeLog.32
-rw-r--r--src/Makefile.in32
-rw-r--r--src/alloc.c17
-rw-r--r--src/bidi.c14
-rw-r--r--src/data.c61
-rw-r--r--src/dispextern.h3
-rw-r--r--src/doc.c4
-rw-r--r--src/emacs.c12
-rw-r--r--src/epaths.in6
-rw-r--r--src/eval.c485
-rw-r--r--src/fileio.c21
-rw-r--r--src/frame.c7
-rw-r--r--src/frame.h2
-rw-r--r--src/gfilenotify.c283
-rw-r--r--src/keyboard.c83
-rw-r--r--src/keymap.c45
-rw-r--r--src/lisp.h117
-rw-r--r--src/lisp.mk1
-rw-r--r--src/nsfns.m71
-rw-r--r--src/nsfont.m42
-rw-r--r--src/nsimage.m4
-rw-r--r--src/nsmenu.m70
-rw-r--r--src/nsselect.m3
-rw-r--r--src/nsterm.h44
-rw-r--r--src/nsterm.m212
-rw-r--r--src/process.c44
-rw-r--r--src/process.h3
-rw-r--r--src/profiler.c17
-rw-r--r--src/puresize.h4
-rw-r--r--src/syssignal.h4
-rw-r--r--src/term.c9
-rw-r--r--src/termhooks.h2
-rw-r--r--src/w32.c2
-rw-r--r--src/w32console.c16
-rw-r--r--src/w32inevt.c8
-rw-r--r--src/w32notify.c2
-rw-r--r--src/w32term.c7
-rw-r--r--src/w32term.h2
-rw-r--r--src/window.c7
-rw-r--r--src/xdisp.c97
-rw-r--r--src/xgselect.c15
-rw-r--r--test/ChangeLog9
-rw-r--r--test/automated/ruby-mode-tests.el20
-rw-r--r--test/indent/octave.m2
210 files changed, 9192 insertions, 5458 deletions
diff --git a/ChangeLog b/ChangeLog
index b07c8d702fa..bad19f32a91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,59 @@
12013-06-11 Paul Eggert <eggert@cs.ucla.edu>
2
3 --without-all should imply --with-file-notification=no. (Bug#14569)
4 * configure.ac (with_file_notification): Default to $with_features.
5
62013-06-09 Paul Eggert <eggert@cs.ucla.edu>
7
8 Merge from gnulib, incorporating:
9 2013-06-02 sig2str: port to C++
10 2013-05-29 c-ctype, regex, verify: port to gcc -std=c90 -pedantic
11
122013-06-08 Jan Djärv <jan.h.d@swipnet.se>
13
14 * configure.ac (HAVE_GLIB): Only set XGSELOBJ if HAVE_NS = no.
15 (with_file_notification): Don't set to gfile if with_ns = yes.
16
172013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
18
19 * Makefile.in (msys_to_w32): Modify to support d:\foo file names.
20 (msys_lisppath_to_w32, msys_prefix_subst, msys_sed_sh_escape):
21 New variables.
22 (epaths-force-w32): Use them. (Bug#14513)
23
242013-06-03 Michael Albinus <michael.albinus@gmx.de>
25
26 * configure.ac (HAVE_GFILENOTIFY): Check for gio >= 2.24.
27
282013-06-03 Eli Zaretskii <eliz@gnu.org>
29
30 * configure.ac (HAVE_GFILENOTIFY): Do not change $LIBS.
31 (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): Substitute.
32
332013-06-03 Jan Djärv <jan.h.d@swipnet.se>
34
35 * configure.ac (HAVE_GLIB): Add GLib check. Set XGSELOBJ if GLib is
36 used. Remove xgselect.o from XOBJ.
37
382013-06-03 Michael Albinus <michael.albinus@gmx.de>
39
40 * configure.ac (file-notification): New option, replaces inotify option.
41 (HAVE_W32): Remove w32notify.o.
42 (with_file_notification): Add checks for glib and w32. Adapt check
43 for inotify.
44 (Summary): Add entry for file notification.
45
46 * autogen/config.in: Add entries for HAVE_GFILENOTIFY,
47 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
48
492013-06-02 Juanma Barranquero <lekktu@gmail.com>
50
51 * .bzrignore: Ignore dirs libexec/, share/ and var/.
52
532013-05-29 Xue Fuqiao <xfq.free@gmail.com>
54
55 * INSTALL: Fix description.
56
12013-05-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 572013-05-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 58
3 * configure.ac (HAVE_XRANDR): Check availability of 59 * configure.ac (HAVE_XRANDR): Check availability of
@@ -73,7 +129,7 @@
73 129
742013-05-07 Paul Eggert <eggert@cs.ucla.edu> 1302013-05-07 Paul Eggert <eggert@cs.ucla.edu>
75 131
76 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295) 132 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
77 * configure.ac: Remove -with-acl option, since Gnulib does that for 133 * configure.ac: Remove -with-acl option, since Gnulib does that for
78 us now. 134 us now.
79 (LIBACL_LIBS): Remove; no longer needed. 135 (LIBACL_LIBS): Remove; no longer needed.
@@ -445,7 +501,7 @@
445 501
4462012-12-14 Paul Eggert <eggert@cs.ucla.edu> 5022012-12-14 Paul Eggert <eggert@cs.ucla.edu>
447 503
448 Fix permissions bugs with setgid directories etc. (Bug#13125) 504 Fix permissions bugs with setgid directories etc. (Bug#13125)
449 * configure.ac (BSD4_2): Remove; no longer needed. 505 * configure.ac (BSD4_2): Remove; no longer needed.
450 506
4512012-12-13 Glenn Morris <rgm@gnu.org> 5072012-12-13 Glenn Morris <rgm@gnu.org>
@@ -2135,7 +2191,7 @@
2135 2191
21362012-02-05 Christoph Scholtes <cschol2112@googlemail.com> 21922012-02-05 Christoph Scholtes <cschol2112@googlemail.com>
2137 2193
2138 * make-dist (README.W32): Include file in source tarball. (Bug#9750) 2194 * make-dist (README.W32): Include file in source tarball. (Bug#9750)
2139 2195
2140 * lib/makefile.w32-in (PRAGMA_SYSTEM_HEADER): Move to platform 2196 * lib/makefile.w32-in (PRAGMA_SYSTEM_HEADER): Move to platform
2141 specific makefiles to support getopt_.h generation with MSVC. 2197 specific makefiles to support getopt_.h generation with MSVC.
diff --git a/INSTALL b/INSTALL
index 925c8b2de71..28660998721 100644
--- a/INSTALL
+++ b/INSTALL
@@ -212,7 +212,7 @@ The names of the packages that you need varies according to the
212GNU/Linux distribution that you use, and the options that you want to 212GNU/Linux distribution that you use, and the options that you want to
213configure Emacs with. On Debian-based systems, you can install all the 213configure Emacs with. On Debian-based systems, you can install all the
214packages needed to build the installed version of Emacs with a command 214packages needed to build the installed version of Emacs with a command
215like `apt-get build-dep emacs23'. On Red Hat systems, the 215like `apt-get build-dep emacs24'. On Red Hat systems, the
216corresponding command is `yum-builddep emacs'. 216corresponding command is `yum-builddep emacs'.
217 217
218 218
diff --git a/Makefile.in b/Makefile.in
index 583aa99f83d..de406453983 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -318,14 +318,37 @@ epaths-force: FRC
318 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \ 318 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
319 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h 319 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
320 320
321# Convert MSYS-style /x/foo file name into x:/foo that Windows can grok. 321# Convert MSYS-style /x/foo or Windows-style x:\foo file names
322msys_to_w32=sed -e 's,^/\([A-Za-z]\)/,\1:/,' 322# into x:/foo that Windows can grok.
323msys_to_w32=sed -e 's,\\\\,/,g' -e 's,^/\([A-Za-z]\)/,\1:/,'
324
325# Transform directory search path and its components. Original can
326# be MSYS or Windows style. Set path separator to ";", directory
327# separator to "/" and transform MSYS-style "/c/" to "c:/".
328# Remove empty path components and escape semicolons.
329msys_lisppath_to_w32=sed -e 's,\\\\,/,g' \
330 -e 's,\(^\|[:;]\)\([A-Za-z]\):/,\1/\2/,g' \
331 -e 's/:/;/g' -e 's,\(^\|;\)/\([A-Za-z]\)/,\1\2:/,g' \
332 -e 's/;\+/;/g' -e 's/^;//' -e 's/;$$//' -e 's/;/\\\\;/g'
333
334# Replace "${prefix}" with '%emacs_dir%' (which expands to install
335# directory at runtime).
336msys_prefix_subst=sed -e 's!\(^\|;\)'"$${prefixpattern}"'\([;/]\|$$\)!\1%emacs_dir%\2!g'
337
338# Quote Sed special characters (except backslash and newline) with
339# a double backslash.
340msys_sed_sh_escape=sed -e 's/[];$$*.^[]/\\\\&/g'
323 341
324# The w32 build needs a slightly different editing, and it uses 342# The w32 build needs a slightly different editing, and it uses
325# nt/epaths.nt as the template. 343# nt/epaths.nt as the template.
344# Use the value of ${locallisppath} supplied by `configure',
345# to support the --enable-locallisppath argument.
326epaths-force-w32: FRC 346epaths-force-w32: FRC
327 @(w32srcdir=`echo "${srcdir}" | ${msys_to_w32}` ; \ 347 @(w32srcdir=`echo "${srcdir}" | ${msys_to_w32}` ; \
348 prefixpattern=`echo '${prefix}' | ${msys_to_w32} | ${msys_sed_sh_escape}` ; \
349 locallisppath=`echo '${locallisppath}' | ${msys_lisppath_to_w32} | ${msys_prefix_subst}` ; \
328 sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \ 350 sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \
351 -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${locallisppath}"'";' \
329 -e '/^.*#/s/@VER@/${version}/g' \ 352 -e '/^.*#/s/@VER@/${version}/g' \
330 -e '/^.*#/s/@CFG@/${configuration}/g' \ 353 -e '/^.*#/s/@CFG@/${configuration}/g' \
331 -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \ 354 -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 221d5c0586c..ac6031fa205 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,10 @@
12013-06-02 Eric Ludlam <zappo@gnu.org>
2
3 * grammars/srecode-template.wy (variable): Accept a single number
4 as a variable value. Allows the 'priority' to be set to a number.
5 (wisent-srecode-template-lexer): Move number up so it can be
6 created.
7
12013-05-16 Glenn Morris <rgm@gnu.org> 82013-05-16 Glenn Morris <rgm@gnu.org>
2 9
3 * cus-test.el (cus-test-cus-load-groups): New function. 10 * cus-test.el (cus-test-cus-load-groups): New function.
diff --git a/admin/grammars/srecode-template.wy b/admin/grammars/srecode-template.wy
index de9bf351ac6..fd3f61905d3 100644
--- a/admin/grammars/srecode-template.wy
+++ b/admin/grammars/srecode-template.wy
@@ -125,6 +125,10 @@ opt-read-fcn
125variable 125variable
126 : SET symbol insertable-string-list newline 126 : SET symbol insertable-string-list newline
127 (VARIABLE-TAG $2 nil $3) 127 (VARIABLE-TAG $2 nil $3)
128 | SET symbol number newline
129 ;; This so a common error w/ priority works.
130 ;; Note that "number" still has a string value in the lexer.
131 (VARIABLE-TAG $2 nil (list $3))
128 | SHOW symbol newline 132 | SHOW symbol newline
129 (VARIABLE-TAG $2 nil t) 133 (VARIABLE-TAG $2 nil t)
130 ; 134 ;
@@ -260,8 +264,8 @@ It ignores whitespace, newlines and comments."
260 srecode-template-separator-block 264 srecode-template-separator-block
261 srecode-template-wy--<keyword>-keyword-analyzer 265 srecode-template-wy--<keyword>-keyword-analyzer
262 srecode-template-property-analyzer 266 srecode-template-property-analyzer
263 srecode-template-wy--<symbol>-regexp-analyzer
264 srecode-template-wy--<number>-regexp-analyzer 267 srecode-template-wy--<number>-regexp-analyzer
268 srecode-template-wy--<symbol>-regexp-analyzer
265 srecode-template-wy--<string>-sexp-analyzer 269 srecode-template-wy--<string>-sexp-analyzer
266 srecode-template-wy--<punctuation>-string-analyzer 270 srecode-template-wy--<punctuation>-string-analyzer
267 semantic-lex-default-action 271 semantic-lex-default-action
diff --git a/admin/notes/bzr b/admin/notes/bzr
index f35ff95f9d6..8f7d0d94fa8 100644
--- a/admin/notes/bzr
+++ b/admin/notes/bzr
@@ -316,3 +316,48 @@ When finished, use
316 bzr bisect reset 316 bzr bisect reset
317 317
318or simply delete the entire branch if you created it just for this. 318or simply delete the entire branch if you created it just for this.
319
320* Commit emails
321
322** Old method: bzr-hookless-email
323https://launchpad.net/bzr-hookless-email
324
325Runs hourly via cron. Must ask Savannah admins to enable/disable it
326for each branch. Stores the last revision that it mailed as
327last_revision_mailed in branch.conf on the server. Breaks with bzr 2.6:
328
329http://lists.gnu.org/archive/html/savannah-hackers-public/2013-05/msg00000.html
330
331Fix from https://bugs.launchpad.net/bzr-hookless-email/+bug/988195
332only partially works. Breaks again on every merge commit:
333
334https://lists.ubuntu.com/archives/bazaar/2013q2/075520.html
335http://lists.gnu.org/archive/html/savannah-hackers-public/2013-05/msg00024.html
336
337You can force it to skip the merge commit by changing the value for
338last_revision_mailed, eg:
339
340bzr config last_revision_mailed=xfq.free@gmail.com-20130603233720-u1aumaxvf3o0rlai -d bzr+ssh://USERNAME@bzr.savannah.gnu.org/emacs/trunk/
341
342** New method: bzr-email plugin
343https://launchpad.net/bzr-email
344http://lists.gnu.org/archive/html/savannah-hackers-public/2013-06/msg00007.html
345
346Runs on commit. Projects can enable it themselves by using `bzr
347config' to set post_commit_to option for a branch. See `bzr help email'
348(if you have the plugin installed) for other options.
349
350Note: if you have the bzr-email plugin installed locally, then when
351you commit to the Emacs repository it will also try to send a commit
352email from your local machine. If your machine is not configured to
353send external mail, this will just fail. In any case, you may prefer
354to either remove the plugin from your machine, or disable it for Emacs
355branches. You can do this either by editing branch.conf in your Emacs
356branches, to override the server setting (untested; not sure this
357works), or by adding an entry to ~/.bazaar/locations.conf:
358
359 [bzr+ssh://USERNAME@bzr.savannah.gnu.org/emacs/*/]
360 post_commit_to = ""
361
362You have to use locations.conf rather than bazaar.conf because the
363latter has a lower priority than branch.conf.
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index 140a3558951..99805dd1fe8 100644
--- a/autogen/Makefile.in
+++ b/autogen/Makefile.in
@@ -437,6 +437,8 @@ GCONF_CFLAGS = @GCONF_CFLAGS@
437GCONF_LIBS = @GCONF_LIBS@ 437GCONF_LIBS = @GCONF_LIBS@
438GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ 438GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
439GETOPT_H = @GETOPT_H@ 439GETOPT_H = @GETOPT_H@
440GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
441GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
440GMALLOC_OBJ = @GMALLOC_OBJ@ 442GMALLOC_OBJ = @GMALLOC_OBJ@
441GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ 443GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
442GNULIB_ATOLL = @GNULIB_ATOLL@ 444GNULIB_ATOLL = @GNULIB_ATOLL@
@@ -941,6 +943,7 @@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
941NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ 943NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
942NEXT_TIME_H = @NEXT_TIME_H@ 944NEXT_TIME_H = @NEXT_TIME_H@
943NEXT_UNISTD_H = @NEXT_UNISTD_H@ 945NEXT_UNISTD_H = @NEXT_UNISTD_H@
946NOTIFY_OBJ = @NOTIFY_OBJ@
944NS_OBJ = @NS_OBJ@ 947NS_OBJ = @NS_OBJ@
945NS_OBJC_OBJ = @NS_OBJC_OBJ@ 948NS_OBJC_OBJ = @NS_OBJC_OBJ@
946NTDIR = @NTDIR@ 949NTDIR = @NTDIR@
@@ -1132,6 +1135,7 @@ WINT_T_SUFFIX = @WINT_T_SUFFIX@
1132XARGS_LIMIT = @XARGS_LIMIT@ 1135XARGS_LIMIT = @XARGS_LIMIT@
1133XFT_CFLAGS = @XFT_CFLAGS@ 1136XFT_CFLAGS = @XFT_CFLAGS@
1134XFT_LIBS = @XFT_LIBS@ 1137XFT_LIBS = @XFT_LIBS@
1138XGSELOBJ = @XGSELOBJ@
1135XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ 1139XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
1136XINERAMA_LIBS = @XINERAMA_LIBS@ 1140XINERAMA_LIBS = @XINERAMA_LIBS@
1137XMENU_OBJ = @XMENU_OBJ@ 1141XMENU_OBJ = @XMENU_OBJ@
diff --git a/autogen/config.in b/autogen/config.in
index 63abe8c9e16..cbbcd19aa04 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -547,9 +547,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
547/* Define to 1 if you have the `get_current_dir_name' function. */ 547/* Define to 1 if you have the `get_current_dir_name' function. */
548#undef HAVE_GET_CURRENT_DIR_NAME 548#undef HAVE_GET_CURRENT_DIR_NAME
549 549
550/* Define to 1 if using GFile. */
551#undef HAVE_GFILENOTIFY
552
550/* Define to 1 if you have a gif (or ungif) library. */ 553/* Define to 1 if you have a gif (or ungif) library. */
551#undef HAVE_GIF 554#undef HAVE_GIF
552 555
556/* Define to 1 if GLib is linked in. */
557#undef HAVE_GLIB
558
553/* Define if using GnuTLS. */ 559/* Define if using GnuTLS. */
554#undef HAVE_GNUTLS 560#undef HAVE_GNUTLS
555 561
@@ -1033,9 +1039,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1033/* Define to 1 if you have the <sys/bitypes.h> header file. */ 1039/* Define to 1 if you have the <sys/bitypes.h> header file. */
1034#undef HAVE_SYS_BITYPES_H 1040#undef HAVE_SYS_BITYPES_H
1035 1041
1036/* Define to 1 if you have the <sys/inotify.h> header file. */
1037#undef HAVE_SYS_INOTIFY_H
1038
1039/* Define to 1 if you have the <sys/inttypes.h> header file. */ 1042/* Define to 1 if you have the <sys/inttypes.h> header file. */
1040#undef HAVE_SYS_INTTYPES_H 1043#undef HAVE_SYS_INTTYPES_H
1041 1044
@@ -1140,6 +1143,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1140/* Define to 1 if you have the <vfork.h> header file. */ 1143/* Define to 1 if you have the <vfork.h> header file. */
1141#undef HAVE_VFORK_H 1144#undef HAVE_VFORK_H
1142 1145
1146/* Define to 1 to use w32notify. */
1147#undef HAVE_W32NOTIFY
1148
1143/* Define to 1 if you have the <wchar.h> header file. */ 1149/* Define to 1 if you have the <wchar.h> header file. */
1144#undef HAVE_WCHAR_H 1150#undef HAVE_WCHAR_H
1145 1151
@@ -1496,6 +1502,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1496/* Define to nonzero if you want access control list support. */ 1502/* Define to nonzero if you want access control list support. */
1497#undef USE_ACL 1503#undef USE_ACL
1498 1504
1505/* Define to 1 if using file notifications. */
1506#undef USE_FILE_NOTIFY
1507
1499/* Define to 1 if using GTK. */ 1508/* Define to 1 if using GTK. */
1500#undef USE_GTK 1509#undef USE_GTK
1501 1510
diff --git a/autogen/configure b/autogen/configure
index f7a67c56fef..cc2fafb3803 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -1288,6 +1288,7 @@ canonical
1288configuration 1288configuration
1289version 1289version
1290copyright 1290copyright
1291XGSELOBJ
1291KRB4LIB 1292KRB4LIB
1292DESLIB 1293DESLIB
1293KRB5LIB 1294KRB5LIB
@@ -1325,6 +1326,9 @@ FONTCONFIG_LIBS
1325FONTCONFIG_CFLAGS 1326FONTCONFIG_CFLAGS
1326LIBXMU 1327LIBXMU
1327LIBXTR6 1328LIBXTR6
1329NOTIFY_OBJ
1330GFILENOTIFY_LIBS
1331GFILENOTIFY_CFLAGS
1328LIBGNUTLS_LIBS 1332LIBGNUTLS_LIBS
1329LIBGNUTLS_CFLAGS 1333LIBGNUTLS_CFLAGS
1330LIBSELINUX_LIBS 1334LIBSELINUX_LIBS
@@ -1529,7 +1533,7 @@ with_gconf
1529with_gsettings 1533with_gsettings
1530with_selinux 1534with_selinux
1531with_gnutls 1535with_gnutls
1532with_inotify 1536with_file_notification
1533with_makeinfo 1537with_makeinfo
1534with_compress_info 1538with_compress_info
1535with_pkg_config_prog 1539with_pkg_config_prog
@@ -2257,7 +2261,9 @@ Optional Packages:
2257 --without-gsettings don't compile with GSettings support 2261 --without-gsettings don't compile with GSettings support
2258 --without-selinux don't compile with SELinux support 2262 --without-selinux don't compile with SELinux support
2259 --without-gnutls don't use -lgnutls for SSL/TLS support 2263 --without-gnutls don't use -lgnutls for SSL/TLS support
2260 --without-inotify don't compile with inotify (file-watch) support 2264 --with-file-notification=LIB
2265 use a file notification library (LIB one of: yes,
2266 gfile, inotify, w32, no)
2261 --without-makeinfo don't require makeinfo for building manuals 2267 --without-makeinfo don't require makeinfo for building manuals
2262 --without-compress-info don't compress the installed Info pages 2268 --without-compress-info don't compress the installed Info pages
2263 --with-pkg-config-prog=FILENAME 2269 --with-pkg-config-prog=FILENAME
@@ -4332,11 +4338,24 @@ else
4332fi 4338fi
4333 4339
4334 4340
4335# Check whether --with-inotify was given. 4341
4336if test "${with_inotify+set}" = set; then : 4342# Check whether --with-file-notification was given.
4337 withval=$with_inotify; 4343if test "${with_file_notification+set}" = set; then :
4344 withval=$with_file_notification; case "${withval}" in
4345 y | ye | yes ) val=yes ;;
4346 n | no ) val=no ;;
4347 g | gf | gfi | gfil | gfile ) val=gfile ;;
4348 i | in | ino | inot | inoti | inotif | inotify ) val=inotify ;;
4349 w | w3 | w32 ) val=w32 ;;
4350 * ) as_fn_error "\`--with-file-notification=$withval' is invalid;
4351this option's value should be \`yes', \`no', \`gfile', \`inotify' or \`w32'.
4352\`yes' is a synonym for \`w32' on MS-Windows, and for \`gfile' otherwise." "$LINENO" 5
4353 ;;
4354 esac
4355 with_file_notification=$val
4356
4338else 4357else
4339 with_inotify=$with_features 4358 with_file_notification=yes
4340fi 4359fi
4341 4360
4342 4361
@@ -10236,7 +10255,6 @@ fi
10236 W32_RES_LINK="-Wl,emacs.res" 10255 W32_RES_LINK="-Wl,emacs.res"
10237 else 10256 else
10238 W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" 10257 W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
10239 W32_OBJ="$W32_OBJ w32notify.o"
10240 W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" 10258 W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
10241 W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10" 10259 W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"
10242 W32_RES_LINK="\$(EMACSRES)" 10260 W32_RES_LINK="\$(EMACSRES)"
@@ -12007,33 +12025,125 @@ fi
12007 12025
12008 12026
12009 12027
12010if test "${with_inotify}" = "yes"; then 12028NOTIFY_OBJ=
12011 for ac_header in sys/inotify.h 12029NOTIFY_SUMMARY=no
12012do : 12030
12013 ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" 12031if test "${with_file_notification}" = "yes"; then
12032 if test "${opsys}" = "mingw32"; then
12033 with_file_notification=w32
12034 else
12035 if test "${with_ns}" != yes; then
12036 with_file_notification=gfile
12037 fi
12038 fi
12039fi
12040
12041if test "${with_file_notification}" = "gfile"; then
12042
12043 succeeded=no
12044
12045 if test "$PKG_CONFIG" = "no" ; then
12046 HAVE_GFILENOTIFY=no
12047 else
12048 PKG_CONFIG_MIN_VERSION=0.9.0
12049 if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
12050 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 >= 2.24" >&5
12051$as_echo_n "checking for gio-2.0 >= 2.24... " >&6; }
12052
12053 if "$PKG_CONFIG" --exists "gio-2.0 >= 2.24" 2>&5 &&
12054 GFILENOTIFY_CFLAGS=`"$PKG_CONFIG" --cflags "gio-2.0 >= 2.24" 2>&5` &&
12055 GFILENOTIFY_LIBS=`"$PKG_CONFIG" --libs "gio-2.0 >= 2.24" 2>&5`; then
12056 edit_cflags="
12057 s,///*,/,g
12058 s/^/ /
12059 s/ -I/ $isystem/g
12060 s/^ //
12061 "
12062 GFILENOTIFY_CFLAGS=`$as_echo "$GFILENOTIFY_CFLAGS" | sed -e "$edit_cflags"`
12063 GFILENOTIFY_LIBS=`$as_echo "$GFILENOTIFY_LIBS" | sed -e 's,///*,/,g'`
12064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes CFLAGS='$GFILENOTIFY_CFLAGS' LIBS='$GFILENOTIFY_LIBS'" >&5
12065$as_echo "yes CFLAGS='$GFILENOTIFY_CFLAGS' LIBS='$GFILENOTIFY_LIBS'" >&6; }
12066 succeeded=yes
12067 else
12068 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12069$as_echo "no" >&6; }
12070 GFILENOTIFY_CFLAGS=""
12071 GFILENOTIFY_LIBS=""
12072 ## If we have a custom action on failure, don't print errors, but
12073 ## do set a variable so people can do so. Do it in a subshell
12074 ## to capture any diagnostics in invoking pkg-config.
12075 GFILENOTIFY_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gio-2.0 >= 2.24") 2>&1`
12076
12077 fi
12078
12079
12080
12081 else
12082 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
12083 echo "*** See http://www.freedesktop.org/software/pkgconfig"
12084 fi
12085 fi
12086
12087 if test $succeeded = yes; then
12088 HAVE_GFILENOTIFY=yes
12089 else
12090 HAVE_GFILENOTIFY=no
12091 fi
12092
12093 if test "$HAVE_GFILENOTIFY" = "yes"; then
12094
12095$as_echo "#define HAVE_GFILENOTIFY 1" >>confdefs.h
12096
12097 NOTIFY_OBJ=gfilenotify.o
12098 NOTIFY_SUMMARY="yes -lgio (gfile)"
12099 fi
12100fi
12101if test "${with_file_notification}" = "inotify"; then
12102 ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
12014if test "x$ac_cv_header_sys_inotify_h" = x""yes; then : 12103if test "x$ac_cv_header_sys_inotify_h" = x""yes; then :
12015 cat >>confdefs.h <<_ACEOF
12016#define HAVE_SYS_INOTIFY_H 1
12017_ACEOF
12018 12104
12019fi 12105fi
12020 12106
12021done
12022 12107
12023 if test "$ac_cv_header_sys_inotify_h" = yes ; then 12108 if test "$ac_cv_header_sys_inotify_h" = yes ; then
12024 ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1" 12109 ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1"
12025if test "x$ac_cv_func_inotify_init1" = x""yes; then : 12110if test "x$ac_cv_func_inotify_init1" = x""yes; then :
12026 12111
12027fi 12112fi
12028 12113
12114 if test "$ac_cv_func_inotify_init1" = yes; then
12115
12116$as_echo "#define HAVE_INOTIFY 1" >>confdefs.h
12117
12118 NOTIFY_OBJ=inotify.o
12119 NOTIFY_SUMMARY="yes -lglibc (inotify)"
12120 fi
12121 fi
12122fi
12123if test "${with_file_notification}" = "w32"; then
12124 ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
12125if test "x$ac_cv_header_windows_h" = x""yes; then :
12126
12127fi
12128
12129
12130 if test "$ac_cv_header_windows_h" = yes ; then
12131
12132$as_echo "#define HAVE_W32NOTIFY 1" >>confdefs.h
12133
12134 NOTIFY_OBJ=w32notify.o
12135 NOTIFY_SUMMARY="yes (w32)"
12029 fi 12136 fi
12030fi 12137fi
12031if test "$ac_cv_func_inotify_init1" = yes; then 12138if test -n "$NOTIFY_OBJ"; then
12032 12139
12033$as_echo "#define HAVE_INOTIFY 1" >>confdefs.h 12140$as_echo "#define USE_FILE_NOTIFY 1" >>confdefs.h
12034 12141
12035fi 12142fi
12036 12143
12144
12145
12146
12037HAVE_XAW3D=no 12147HAVE_XAW3D=no
12038LUCID_LIBW= 12148LUCID_LIBW=
12039if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then 12149if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
@@ -16061,6 +16171,40 @@ fi
16061done 16171done
16062 16172
16063 16173
16174XGSELOBJ=
16175{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GLib is linked in" >&5
16176$as_echo_n "checking whether GLib is linked in... " >&6; }
16177cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16178/* end confdefs.h. */
16179#include <glib.h>
16180
16181int
16182main ()
16183{
16184g_print ("Hello world");
16185 ;
16186 return 0;
16187}
16188_ACEOF
16189if ac_fn_c_try_link "$LINENO"; then :
16190 links_glib=yes
16191else
16192 links_glib=no
16193fi
16194rm -f core conftest.err conftest.$ac_objext \
16195 conftest$ac_exeext conftest.$ac_ext
16196{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $links_glib" >&5
16197$as_echo "$links_glib" >&6; }
16198if test "${links_glib}" = "yes"; then
16199
16200$as_echo "#define HAVE_GLIB 1" >>confdefs.h
16201
16202 if test "$HAVE_NS" = no;then
16203 XGSELOBJ=xgselect.o
16204 fi
16205fi
16206
16207
16064{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 16208{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
16065$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } 16209$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
16066if test "${emacs_cv_langinfo_codeset+set}" = set; then : 16210if test "${emacs_cv_langinfo_codeset+set}" = set; then :
@@ -17025,7 +17169,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then
17025$as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h 17169$as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h
17026 17170
17027 XMENU_OBJ=xmenu.o 17171 XMENU_OBJ=xmenu.o
17028 XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o" 17172 XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o"
17029 FONT_OBJ=xfont.o 17173 FONT_OBJ=xfont.o
17030 if test "$HAVE_XFT" = "yes"; then 17174 if test "$HAVE_XFT" = "yes"; then
17031 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o" 17175 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
@@ -28413,6 +28557,7 @@ echo " Does Emacs use -lgpm? ${HAVE_GPM}"
28413echo " Does Emacs use -ldbus? ${HAVE_DBUS}" 28557echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
28414echo " Does Emacs use -lgconf? ${HAVE_GCONF}" 28558echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
28415echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" 28559echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}"
28560echo " Does Emacs use a file notification library? ${NOTIFY_SUMMARY}"
28416echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" 28561echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}"
28417echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" 28562echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}"
28418echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" 28563echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}"
diff --git a/configure.ac b/configure.ac
index a518bf75254..4a676ba6b6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -200,7 +200,23 @@ OPTION_DEFAULT_ON([gconf],[don't compile with GConf support])
200OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support]) 200OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support])
201OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support]) 201OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support])
202OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support]) 202OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support])
203OPTION_DEFAULT_ON([inotify],[don't compile with inotify (file-watch) support]) 203
204AC_ARG_WITH([file-notification],[AS_HELP_STRING([--with-file-notification=LIB],
205 [use a file notification library (LIB one of: yes, gfile, inotify, w32, no)])],
206 [ case "${withval}" in
207 y | ye | yes ) val=yes ;;
208 n | no ) val=no ;;
209 g | gf | gfi | gfil | gfile ) val=gfile ;;
210 i | in | ino | inot | inoti | inotif | inotify ) val=inotify ;;
211 w | w3 | w32 ) val=w32 ;;
212 * ) AC_MSG_ERROR([`--with-file-notification=$withval' is invalid;
213this option's value should be `yes', `no', `gfile', `inotify' or `w32'.
214`yes' is a synonym for `w32' on MS-Windows, and for `gfile' otherwise.])
215 ;;
216 esac
217 with_file_notification=$val
218 ],
219 [with_file_notification=$with_features])
204 220
205OPTION_DEFAULT_OFF([xwidgets],[enable use of some gtk widgets it Emacs buffers]) 221OPTION_DEFAULT_OFF([xwidgets],[enable use of some gtk widgets it Emacs buffers])
206 222
@@ -1670,7 +1686,6 @@ if test "${HAVE_W32}" = "yes"; then
1670 W32_RES_LINK="-Wl,emacs.res" 1686 W32_RES_LINK="-Wl,emacs.res"
1671 else 1687 else
1672 W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" 1688 W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
1673 W32_OBJ="$W32_OBJ w32notify.o"
1674 W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" 1689 W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
1675 W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10" 1690 W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"
1676 W32_RES_LINK="\$(EMACSRES)" 1691 W32_RES_LINK="\$(EMACSRES)"
@@ -2333,16 +2348,60 @@ fi
2333AC_SUBST(LIBGNUTLS_LIBS) 2348AC_SUBST(LIBGNUTLS_LIBS)
2334AC_SUBST(LIBGNUTLS_CFLAGS) 2349AC_SUBST(LIBGNUTLS_CFLAGS)
2335 2350
2351NOTIFY_OBJ=
2352NOTIFY_SUMMARY=no
2353
2354dnl Set defaults of $with_file_notification.
2355if test "${with_file_notification}" = "yes"; then
2356 if test "${opsys}" = "mingw32"; then
2357 with_file_notification=w32
2358 else
2359 if test "${with_ns}" != yes; then
2360 with_file_notification=gfile
2361 fi
2362 fi
2363fi
2364
2365dnl g_file_monitor exists since glib 2.18. G_FILE_MONITOR_EVENT_MOVED
2366dnl has been added in glib 2.24. It has been tested under
2367dnl GNU/Linux only. We take precedence over inotify, but this makes
2368dnl only sense when glib has been compiled with inotify support. How
2369dnl to check?
2370if test "${with_file_notification}" = "gfile"; then
2371 PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.24, HAVE_GFILENOTIFY=yes, HAVE_GFILENOTIFY=no)
2372 if test "$HAVE_GFILENOTIFY" = "yes"; then
2373 AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
2374 NOTIFY_OBJ=gfilenotify.o
2375 NOTIFY_SUMMARY="yes -lgio (gfile)"
2376 fi
2377fi
2336dnl inotify is only available on GNU/Linux. 2378dnl inotify is only available on GNU/Linux.
2337if test "${with_inotify}" = "yes"; then 2379if test "${with_file_notification}" = "inotify"; then
2338 AC_CHECK_HEADERS(sys/inotify.h) 2380 AC_CHECK_HEADER(sys/inotify.h)
2339 if test "$ac_cv_header_sys_inotify_h" = yes ; then 2381 if test "$ac_cv_header_sys_inotify_h" = yes ; then
2340 AC_CHECK_FUNC(inotify_init1) 2382 AC_CHECK_FUNC(inotify_init1)
2383 if test "$ac_cv_func_inotify_init1" = yes; then
2384 AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.])
2385 NOTIFY_OBJ=inotify.o
2386 NOTIFY_SUMMARY="yes -lglibc (inotify)"
2387 fi
2388 fi
2389fi
2390dnl MS Windows native file monitor is available for mingw32 only.
2391if test "${with_file_notification}" = "w32"; then
2392 AC_CHECK_HEADER(windows.h)
2393 if test "$ac_cv_header_windows_h" = yes ; then
2394 AC_DEFINE(HAVE_W32NOTIFY, 1, [Define to 1 to use w32notify.])
2395 NOTIFY_OBJ=w32notify.o
2396 NOTIFY_SUMMARY="yes (w32)"
2341 fi 2397 fi
2342fi 2398fi
2343if test "$ac_cv_func_inotify_init1" = yes; then 2399if test -n "$NOTIFY_OBJ"; then
2344 AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) 2400 AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.])
2345fi 2401fi
2402AC_SUBST(NOTIFY_OBJ)
2403AC_SUBST(GFILENOTIFY_CFLAGS)
2404AC_SUBST(GFILENOTIFY_LIBS)
2346 2405
2347dnl Do not put whitespace before the #include statements below. 2406dnl Do not put whitespace before the #include statements below.
2348dnl Older compilers (eg sunos4 cc) choke on it. 2407dnl Older compilers (eg sunos4 cc) choke on it.
@@ -3596,6 +3655,25 @@ AC_FUNC_FORK
3596 3655
3597AC_CHECK_FUNCS(snprintf) 3656AC_CHECK_FUNCS(snprintf)
3598 3657
3658dnl Check this late. It depends on what other libraries (lrsvg, Gtk+ etc)
3659dnl Emacs uses.
3660XGSELOBJ=
3661AC_MSG_CHECKING([whether GLib is linked in])
3662AC_LINK_IFELSE([AC_LANG_PROGRAM(
3663 [[#include <glib.h>
3664 ]],
3665 [[g_print ("Hello world");]])],
3666 [links_glib=yes],
3667 [links_glib=no])
3668AC_MSG_RESULT([$links_glib])
3669if test "${links_glib}" = "yes"; then
3670 AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.])
3671 if test "$HAVE_NS" = no;then
3672 XGSELOBJ=xgselect.o
3673 fi
3674fi
3675AC_SUBST(XGSELOBJ)
3676
3599dnl Adapted from Haible's version. 3677dnl Adapted from Haible's version.
3600AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset, 3678AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
3601 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], 3679 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
@@ -4382,7 +4460,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then
4382 AC_DEFINE(HAVE_X_WINDOWS, 1, 4460 AC_DEFINE(HAVE_X_WINDOWS, 1,
4383 [Define to 1 if you want to use the X window system.]) 4461 [Define to 1 if you want to use the X window system.])
4384 XMENU_OBJ=xmenu.o 4462 XMENU_OBJ=xmenu.o
4385 XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o" 4463 XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o"
4386 FONT_OBJ=xfont.o 4464 FONT_OBJ=xfont.o
4387 if test "$HAVE_XFT" = "yes"; then 4465 if test "$HAVE_XFT" = "yes"; then
4388 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o" 4466 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
@@ -4721,6 +4799,7 @@ echo " Does Emacs use -lgpm? ${HAVE_GPM}"
4721echo " Does Emacs use -ldbus? ${HAVE_DBUS}" 4799echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
4722echo " Does Emacs use -lgconf? ${HAVE_GCONF}" 4800echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
4723echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" 4801echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}"
4802echo " Does Emacs use a file notification library? ${NOTIFY_SUMMARY}"
4724echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" 4803echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}"
4725echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" 4804echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}"
4726echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" 4805echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}"
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 14e9be8ba84..6f2d9517df7 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,46 @@
12013-06-11 Glenn Morris <rgm@gnu.org>
2
3 * maintaining.texi (VC Directory Commands): Copyedit.
4 (Branches): Put back milder version of pre 2013-06-07 text.
5
62013-06-07 Xue Fuqiao <xfq.free@gmail.com>
7
8 * maintaining.texi (Branches): Remove text copied from other sources.
9
102013-06-05 Alan Mackenzie <acm@muc.de>
11
12 * search.texi (Isearch Scroll): Rename to "Not Exiting Isearch".
13 (Not Exiting Isearch): Document new user option
14 `isearch-allow-prefix'. (Bug#9706)
15
162013-06-03 Juri Linkov <juri@jurta.org>
17
18 * display.texi (Highlight Interactively): Add global keybindings
19 with the key prefix `M-s h'. Document old command `highlight-phrase'.
20 Document new command `highlight-symbol-at-point'.
21
222013-06-02 Xue Fuqiao <xfq.free@gmail.com>
23
24 * maintaining.texi (Branches): Add motivations for branching.
25 (VC Mode Line): Fix typo.
26 (VC Directory Commands): Mention `vc-dir-hide-up-to-date' with
27 prefix argument.
28
292013-06-02 Michael Albinus <michael.albinus@gmx.de>
30
31 * cmdargs.texi (General Variables): Use "unix:path=/dev/null" as
32 dummy value for $DBUS_SESSION_BUS_ADDRESS. It also suppresses
33 autolaunching of the D-Bus session bus.
34
352013-06-01 Glenn Morris <rgm@gnu.org>
36
37 * programs.texi (Semantic): Fix typo.
38
392013-05-30 Xue Fuqiao <xfq.free@gmail.com>
40
41 * maintaining.texi (Types of Log File): Supplement some
42 information of change log files.
43
12013-05-15 Juri Linkov <juri@jurta.org> 442013-05-15 Juri Linkov <juri@jurta.org>
2 45
3 * search.texi (Repeat Isearch): Mention key `RET' to finish 46 * search.texi (Repeat Isearch): Mention key `RET' to finish
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index e285104b5de..3dc64fdd127 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -438,8 +438,8 @@ when you specify a relative directory name.
438@item DBUS_SESSION_BUS_ADDRESS 438@item DBUS_SESSION_BUS_ADDRESS
439Used by D-Bus when Emacs is compiled with it. Usually, there is no 439Used by D-Bus when Emacs is compiled with it. Usually, there is no
440need to change it. Setting it to a dummy address, like 440need to change it. Setting it to a dummy address, like
441@samp{unix:path=/tmp/foo}, suppresses connections to the D-Bus session 441@samp{unix:path=/dev/null}, suppresses connections to the D-Bus session
442bus. 442bus as well as autolaunching the D-Bus session bus if not running yet.
443@item EMACSDATA 443@item EMACSDATA
444Directory for the architecture-independent files that come with Emacs. 444Directory for the architecture-independent files that come with Emacs.
445This is used to initialize the variable @code{data-directory}. 445This is used to initialize the variable @code{data-directory}.
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index f5ec8946e1b..482d7e7741a 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -903,14 +903,16 @@ that you specify explicitly the regular expressions to highlight. You
903control them with these commands: 903control them with these commands:
904 904
905@table @kbd 905@table @kbd
906@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET} 906@item M-s h r @var{regexp} @key{RET} @var{face} @key{RET}
907@itemx C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
908@kindex M-s h r
907@kindex C-x w h 909@kindex C-x w h
908@findex highlight-regexp 910@findex highlight-regexp
909Highlight text that matches @var{regexp} using face @var{face} 911Highlight text that matches @var{regexp} using face @var{face}
910(@code{highlight-regexp}). The highlighting will remain as long as 912(@code{highlight-regexp}). The highlighting will remain as long as
911the buffer is loaded. For example, to highlight all occurrences of 913the buffer is loaded. For example, to highlight all occurrences of
912the word ``whim'' using the default face (a yellow background) 914the word ``whim'' using the default face (a yellow background)
913@kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for 915@kbd{M-s h r whim @key{RET} @key{RET}}. Any face can be used for
914highlighting, Hi Lock provides several of its own and these are 916highlighting, Hi Lock provides several of its own and these are
915pre-loaded into a list of default values. While being prompted 917pre-loaded into a list of default values. While being prompted
916for a face use @kbd{M-n} and @kbd{M-p} to cycle through them. 918for a face use @kbd{M-n} and @kbd{M-p} to cycle through them.
@@ -918,7 +920,9 @@ for a face use @kbd{M-n} and @kbd{M-p} to cycle through them.
918You can use this command multiple times, specifying various regular 920You can use this command multiple times, specifying various regular
919expressions to highlight in different ways. 921expressions to highlight in different ways.
920 922
921@item C-x w r @var{regexp} @key{RET} 923@item M-s h u @var{regexp} @key{RET}
924@itemx C-x w r @var{regexp} @key{RET}
925@kindex M-s h u
922@kindex C-x w r 926@kindex C-x w r
923@findex unhighlight-regexp 927@findex unhighlight-regexp
924Unhighlight @var{regexp} (@code{unhighlight-regexp}). 928Unhighlight @var{regexp} (@code{unhighlight-regexp}).
@@ -926,13 +930,15 @@ Unhighlight @var{regexp} (@code{unhighlight-regexp}).
926If you invoke this from the menu, you select the expression to 930If you invoke this from the menu, you select the expression to
927unhighlight from a list. If you invoke this from the keyboard, you 931unhighlight from a list. If you invoke this from the keyboard, you
928use the minibuffer. It will show the most recently added regular 932use the minibuffer. It will show the most recently added regular
929expression; use @kbd{M-p} to show the next older expression and 933expression; use @kbd{M-n} to show the next older expression and
930@kbd{M-n} to select the next newer expression. (You can also type the 934@kbd{M-p} to select the next newer expression. (You can also type the
931expression by hand, with completion.) When the expression you want to 935expression by hand, with completion.) When the expression you want to
932unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit 936unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit
933the minibuffer and unhighlight it. 937the minibuffer and unhighlight it.
934 938
935@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET} 939@item M-s h l @var{regexp} @key{RET} @var{face} @key{RET}
940@itemx C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
941@kindex M-s h l
936@kindex C-x w l 942@kindex C-x w l
937@findex highlight-lines-matching-regexp 943@findex highlight-lines-matching-regexp
938@cindex lines, highlighting 944@cindex lines, highlighting
@@ -940,7 +946,31 @@ the minibuffer and unhighlight it.
940Highlight entire lines containing a match for @var{regexp}, using face 946Highlight entire lines containing a match for @var{regexp}, using face
941@var{face} (@code{highlight-lines-matching-regexp}). 947@var{face} (@code{highlight-lines-matching-regexp}).
942 948
943@item C-x w b 949@item M-s h p @var{phrase} @key{RET} @var{face} @key{RET}
950@itemx C-x w p @var{phrase} @key{RET} @var{face} @key{RET}
951@kindex M-s h p
952@kindex C-x w p
953@findex highlight-phrase
954@cindex phrase, highlighting
955@cindex highlighting phrase
956Highlight matches of @var{phrase}, using face @var{face}
957(@code{highlight-phrase}). @var{phrase} can be any regexp,
958but spaces will be replaced by matches to whitespace and
959initial lower-case letters will become case insensitive.
960
961@item M-s h .
962@itemx C-x w .
963@kindex M-s h .
964@kindex C-x w .
965@findex highlight-symbol-at-point
966@cindex symbol, highlighting
967@cindex highlighting symbol at point
968Highlight the symbol found near point without prompting, using the next
969available face automatically (@code{highlight-symbol-at-point}).
970
971@item M-s h w
972@itemx C-x w b
973@kindex M-s h w
944@kindex C-x w b 974@kindex C-x w b
945@findex hi-lock-write-interactive-patterns 975@findex hi-lock-write-interactive-patterns
946Insert all the current highlighting regexp/face pairs into the buffer 976Insert all the current highlighting regexp/face pairs into the buffer
@@ -952,7 +982,9 @@ These patterns are extracted from the comments, if appropriate, if you
952invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while 982invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while
953Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}). 983Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}).
954 984
955@item C-x w i 985@item M-s h f
986@itemx C-x w i
987@kindex M-s h f
956@kindex C-x w i 988@kindex C-x w i
957@findex hi-lock-find-patterns 989@findex hi-lock-find-patterns
958Extract regexp/face pairs from comments in the current buffer 990Extract regexp/face pairs from comments in the current buffer
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index d2ec2154024..e2d0b0eebf6 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -396,14 +396,14 @@ Searching and Replacement
396 396
397Incremental Search 397Incremental Search
398 398
399* Basic Isearch:: Basic incremental search commands. 399* Basic Isearch:: Basic incremental search commands.
400* Repeat Isearch:: Searching for the same string again. 400* Repeat Isearch:: Searching for the same string again.
401* Error in Isearch:: When your string is not found. 401* Error in Isearch:: When your string is not found.
402* Special Isearch:: Special input in incremental search. 402* Special Isearch:: Special input in incremental search.
403* Isearch Yank:: Commands that grab text into the search string 403* Isearch Yank:: Commands that grab text into the search string
404 or else edit the search string. 404 or else edit the search string.
405* Isearch Scroll:: Scrolling during an incremental search. 405* Not Exiting Isearch:: Prefix argument and scrolling commands.
406* Isearch Minibuffer:: Incremental search of the minibuffer history. 406* Isearch Minibuffer:: Incremental search of the minibuffer history.
407 407
408Replacement Commands 408Replacement Commands
409 409
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index c8d9e9f2087..1b6374a4133 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -342,7 +342,9 @@ before version control systems.
342modification log for the entire system, which makes change log files 342modification log for the entire system, which makes change log files
343somewhat redundant. One advantage that they retain is that it is 343somewhat redundant. One advantage that they retain is that it is
344sometimes useful to be able to view the transaction history of a 344sometimes useful to be able to view the transaction history of a
345single directory separately from those of other directories. 345single directory separately from those of other directories. Another
346advantage is that commit logs can't be fixed in many version control
347systems.
346 348
347 A project maintained with version control can use just the version 349 A project maintained with version control can use just the version
348control log, or it can use both kinds of logs. It can handle some 350control log, or it can use both kinds of logs. It can handle some
@@ -377,7 +379,7 @@ merge-based version control system, a @samp{-} character indicates
377that the work file is unmodified, and @samp{:} indicates that it has 379that the work file is unmodified, and @samp{:} indicates that it has
378been modified. @samp{!} indicates that the file contains conflicts as 380been modified. @samp{!} indicates that the file contains conflicts as
379result of a recent merge operation (@pxref{Merging}), or that the file 381result of a recent merge operation (@pxref{Merging}), or that the file
380was removed from the version control. Finally, @samp{?} means that 382was removed from the version control. Finally, @samp{?} means that
381the file is under version control, but is missing from the working 383the file is under version control, but is missing from the working
382tree. 384tree.
383 385
@@ -1201,7 +1203,8 @@ files and directories.
1201 1203
1202@item x 1204@item x
1203Hide files with @samp{up-to-date} status 1205Hide files with @samp{up-to-date} status
1204(@code{vc-dir-hide-up-to-date}). 1206(@code{vc-dir-hide-up-to-date}). With a prefix argument, hide items
1207whose state is that of the item at point.
1205@end table 1208@end table
1206 1209
1207@findex vc-dir-mark 1210@findex vc-dir-mark
@@ -1264,10 +1267,10 @@ bring them back at a later time).
1264@cindex branch (version control) 1267@cindex branch (version control)
1265 1268
1266 One use of version control is to support multiple independent lines 1269 One use of version control is to support multiple independent lines
1267of development, which are called @dfn{branches}. Branches are used 1270of development, which are called @dfn{branches}. Amongst other
1268for maintaining separate ``stable'' and ``development'' versions of a 1271things, branches can be used for maintaining separate ``stable'' and
1269program, and for developing unrelated features in isolation from one 1272``development'' versions of a program, and for developing unrelated
1270another. 1273features in isolation from one another.
1271 1274
1272 VC's support for branch operations is currently fairly limited. For 1275 VC's support for branch operations is currently fairly limited. For
1273decentralized version control systems, it provides commands for 1276decentralized version control systems, it provides commands for
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 459221a9088..70eecf1c97b 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1356,7 +1356,7 @@ the menu item named @samp{Source Code Parsers (Semantic)} in the
1356@samp{Tools} menu. This enables Semantic mode, a global minor mode. 1356@samp{Tools} menu. This enables Semantic mode, a global minor mode.
1357 1357
1358 When Semantic mode is enabled, Emacs automatically attempts to 1358 When Semantic mode is enabled, Emacs automatically attempts to
1359parses each file you visit. Currently, Semantic understands C, C++, 1359parse each file you visit. Currently, Semantic understands C, C++,
1360Scheme, Javascript, Java, HTML, and Make. Within each parsed buffer, 1360Scheme, Javascript, Java, HTML, and Make. Within each parsed buffer,
1361the following commands are available: 1361the following commands are available:
1362 1362
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index e146177255e..ead7c3cbf16 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -52,14 +52,14 @@ Incremental search backward (@code{isearch-backward}).
52@end table 52@end table
53 53
54@menu 54@menu
55* Basic Isearch:: Basic incremental search commands. 55* Basic Isearch:: Basic incremental search commands.
56* Repeat Isearch:: Searching for the same string again. 56* Repeat Isearch:: Searching for the same string again.
57* Error in Isearch:: When your string is not found. 57* Error in Isearch:: When your string is not found.
58* Special Isearch:: Special input in incremental search. 58* Special Isearch:: Special input in incremental search.
59* Isearch Yank:: Commands that grab text into the search string 59* Isearch Yank:: Commands that grab text into the search string
60 or else edit the search string. 60 or else edit the search string.
61* Isearch Scroll:: Scrolling during an incremental search. 61* Not Exiting Isearch:: Prefix argument and scrolling commands.
62* Isearch Minibuffer:: Incremental search of the minibuffer history. 62* Isearch Minibuffer:: Incremental search of the minibuffer history.
63@end menu 63@end menu
64 64
65@node Basic Isearch 65@node Basic Isearch
@@ -332,9 +332,28 @@ alternative method to add the character after point is to enter the
332minibuffer with @kbd{M-e} (@pxref{Repeat Isearch}) and type @kbd{C-f} 332minibuffer with @kbd{M-e} (@pxref{Repeat Isearch}) and type @kbd{C-f}
333at the end of the search string in the minibuffer. 333at the end of the search string in the minibuffer.
334 334
335@node Isearch Scroll 335@node Not Exiting Isearch
336@subsection Scrolling During Incremental Search 336@subsection Not Exiting Incremental Search
337 337
338This subsection describes two categories of commands which you can
339type without exiting the current incremental search, even though they
340are not themselves part of incremental search.
341
342@table @asis
343@item Prefix Arguments
344@vindex isearch-allow-prefix
345 In incremental search, when you enter a prefix argument
346(@pxref{Arguments}), by default it will apply either to the next
347action in the search or to the command that exits the search.
348
349 In previous versions of Emacs, entering a prefix argument always
350terminated the search. You can revert to this behavior by setting the
351variable @code{isearch-allow-prefix} to @code{nil}.
352
353 When @code{isearch-allow-scroll} is non-@code{nil} (see below),
354prefix arguments always have the default behavior described above.
355
356@item Scrolling Commands
338@vindex isearch-allow-scroll 357@vindex isearch-allow-scroll
339 Normally, scrolling commands exit incremental search. If you change 358 Normally, scrolling commands exit incremental search. If you change
340the variable @code{isearch-allow-scroll} to a non-@code{nil} value, 359the variable @code{isearch-allow-scroll} to a non-@code{nil} value,
@@ -366,6 +385,7 @@ This feature can be applied to any command that doesn't permanently
366change point, the buffer contents, the match data, the current buffer, 385change point, the buffer contents, the match data, the current buffer,
367or the selected window and frame. The command must not itself attempt 386or the selected window and frame. The command must not itself attempt
368an incremental search. 387an incremental search.
388@end table
369 389
370@node Isearch Minibuffer 390@node Isearch Minibuffer
371@subsection Searching the Minibuffer 391@subsection Searching the Minibuffer
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 249a2f21ccb..259bf9a78a6 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,27 @@
12013-06-11 Xue Fuqiao <xfq.free@gmail.com>
2
3 * files.texi (File Name Expansion): Make the example more
4 intuitive.
5
62013-06-10 Paul Eggert <eggert@cs.ucla.edu>
7
8 Documentation fix for 'ls' and hard links.
9 * compile.texi (Compilation Functions):
10 * files.texi (File Attributes, Changing Files):
11 Use current format for GNU 'ls' output.
12 (File Attributes): Fix problem introduced in previous change:
13 the link count is the number of hard links, not the number
14 of hard links + 1.
15
162013-06-10 Xue Fuqiao <xfq.free@gmail.com>
17
18 * files.texi (File Attributes): Fix typo.
19
202013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
21
22 * functions.texi (Lambda Expressions): Lambda expressions don't
23 evaluate to themselves in general (bug#11782).
24
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 252013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 26
3 * loading.texi (Autoload): 27 * loading.texi (Autoload):
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 522a88da61e..95f7341c19c 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -181,8 +181,8 @@ after compiling it. Interactively, @var{load} is the prefix argument.
181 181
182@example 182@example
183@group 183@group
184% ls -l push* 184$ ls -l push*
185-rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el 185-rw-r--r-- 1 lewis lewis 791 Oct 5 20:31 push.el
186@end group 186@end group
187 187
188@group 188@group
@@ -191,9 +191,9 @@ after compiling it. Interactively, @var{load} is the prefix argument.
191@end group 191@end group
192 192
193@group 193@group
194% ls -l push* 194$ ls -l push*
195-rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el 195-rw-r--r-- 1 lewis lewis 791 Oct 5 20:31 push.el
196-rw-rw-rw- 1 lewis 638 Oct 8 20:25 push.elc 196-rw-rw-rw- 1 lewis lewis 638 Oct 8 20:25 push.elc
197@end group 197@end group
198@end example 198@end example
199@end deffn 199@end deffn
@@ -232,7 +232,7 @@ If @var{noforce} is non-@code{nil}, this function does not recompile
232files that have an up-to-date @samp{.elc} file. 232files that have an up-to-date @samp{.elc} file.
233 233
234@example 234@example
235% emacs -batch -f batch-byte-compile *.el 235$ emacs -batch -f batch-byte-compile *.el
236@end example 236@end example
237@end defun 237@end defun
238 238
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 971e38f20b7..704ecfb6446 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1139,8 +1139,8 @@ both others and group, and that the sticky bit is set.
1139@end group 1139@end group
1140 1140
1141@group 1141@group
1142% ls -l diffs 1142$ ls -l diffs
1143 -rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs 1143-rw-rw-rw- 1 lewis lewis 3063 Oct 30 16:00 diffs
1144@end group 1144@end group
1145@end example 1145@end example
1146 1146
@@ -1166,17 +1166,17 @@ target. However, they both recursively follow symbolic links at all
1166levels of parent directories. 1166levels of parent directories.
1167 1167
1168@defun file-nlinks filename 1168@defun file-nlinks filename
1169This functions returns the number of names (i.e., hard links) that 1169This function returns the number of names (i.e., hard links) that
1170file @var{filename} has. If the file does not exist, then this function 1170file @var{filename} has. If the file does not exist, this function
1171returns @code{nil}. Note that symbolic links have no effect on this 1171returns @code{nil}. Note that symbolic links have no effect on this
1172function, because they are not considered to be names of the files they 1172function, because they are not considered to be names of the files
1173link to. 1173they link to.
1174 1174
1175@example 1175@example
1176@group 1176@group
1177% ls -l foo* 1177$ ls -l foo*
1178-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo 1178-rw-rw-rw- 2 rms rms 4 Aug 19 01:27 foo
1179-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo1 1179-rw-rw-rw- 2 rms rms 4 Aug 19 01:27 foo1
1180@end group 1180@end group
1181 1181
1182@group 1182@group
@@ -1477,9 +1477,9 @@ In the first part of the following example, we list two files,
1477 1477
1478@example 1478@example
1479@group 1479@group
1480% ls -li fo* 1480$ ls -li fo*
148181908 -rw-rw-rw- 1 rms 29 Aug 18 20:32 foo 148181908 -rw-rw-rw- 1 rms rms 29 Aug 18 20:32 foo
148284302 -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3 148284302 -rw-rw-rw- 1 rms rms 24 Aug 18 20:31 foo3
1483@end group 1483@end group
1484@end example 1484@end example
1485 1485
@@ -1494,10 +1494,10 @@ the files again. This shows two names for one file, @file{foo} and
1494@end group 1494@end group
1495 1495
1496@group 1496@group
1497% ls -li fo* 1497$ ls -li fo*
149881908 -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo 149881908 -rw-rw-rw- 2 rms rms 29 Aug 18 20:32 foo
149981908 -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo2 149981908 -rw-rw-rw- 2 rms rms 29 Aug 18 20:32 foo2
150084302 -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3 150084302 -rw-rw-rw- 1 rms rms 24 Aug 18 20:31 foo3
1501@end group 1501@end group
1502@end example 1502@end example
1503 1503
@@ -1519,10 +1519,10 @@ contents of @file{foo3} are lost.
1519@end group 1519@end group
1520 1520
1521@group 1521@group
1522% ls -li fo* 1522$ ls -li fo*
152381908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo 152381908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo
152481908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo2 152481908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo2
152581908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo3 152581908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo3
1526@end group 1526@end group
1527@end example 1527@end example
1528 1528
@@ -2105,10 +2105,6 @@ start with @samp{~}.) Otherwise, the current buffer's value of
2105(expand-file-name "foo" "/usr/spool/") 2105(expand-file-name "foo" "/usr/spool/")
2106 @result{} "/usr/spool/foo" 2106 @result{} "/usr/spool/foo"
2107@end group 2107@end group
2108@group
2109(expand-file-name "$HOME/foo")
2110 @result{} "/xcssun/users/rms/lewis/$HOME/foo"
2111@end group
2112@end example 2108@end example
2113 2109
2114If the part of the combined file name before the first slash is 2110If the part of the combined file name before the first slash is
@@ -2142,7 +2138,14 @@ This is for the sake of filesystems that have the concept of a
2142@file{/../} is interpreted exactly the same as @file{/}. 2138@file{/../} is interpreted exactly the same as @file{/}.
2143 2139
2144Note that @code{expand-file-name} does @emph{not} expand environment 2140Note that @code{expand-file-name} does @emph{not} expand environment
2145variables; only @code{substitute-in-file-name} does that. 2141variables; only @code{substitute-in-file-name} does that:
2142
2143@example
2144@group
2145(expand-file-name "$HOME/foo")
2146 @result{} "/xcssun/users/rms/lewis/$HOME/foo"
2147@end group
2148@end example
2146 2149
2147Note also that @code{expand-file-name} does not follow symbolic links 2150Note also that @code{expand-file-name} does not follow symbolic links
2148at any level. This results in a difference between the way 2151at any level. This results in a difference between the way
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 999923f5b84..7768c147827 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -196,9 +196,8 @@ an example:
196@end example 196@end example
197 197
198@noindent 198@noindent
199In Emacs Lisp, such a list is valid as an expression---it evaluates to 199In Emacs Lisp, such a list is a valid expression which evaluates to
200itself. But its main use is not to be evaluated as an expression, but 200a function object.
201to be called as a function.
202 201
203 A lambda expression, by itself, has no name; it is an @dfn{anonymous 202 A lambda expression, by itself, has no name; it is an @dfn{anonymous
204function}. Although lambda expressions can be used this way 203function}. Although lambda expressions can be used this way
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 8ee12718980..4cae3d0a478 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,18 @@
12013-06-10 Aidan Gauland <aidalgol@amuri.net>
2
3 * eshell.texi (Input/Output): Expand to cover new visual-command
4 options, eshell-visual-subcommands and eshell-visual-options.
5 Divide into separate Visual Commands and Redirection sections.
6
72013-06-10 Glenn Morris <rgm@gnu.org>
8
9 * epa.texi (Cryptographic operations on files): Update epa-decrypt-file.
10
112013-06-04 Katsumi Yamaoka <yamaoka@jpl.org>
12
13 * gnus.texi (Article Date):
14 Fix description of gnus-article-update-date-headers.
15
12013-05-28 Xue Fuqiao <xfq.free@gmail.com> 162013-05-28 Xue Fuqiao <xfq.free@gmail.com>
2 17
3 * erc.texi (Special Features): ERC is being maintained within 18 * erc.texi (Special Features): ERC is being maintained within
diff --git a/doc/misc/epa.texi b/doc/misc/epa.texi
index e21851ef37a..adc63cc0bdb 100644
--- a/doc/misc/epa.texi
+++ b/doc/misc/epa.texi
@@ -240,8 +240,9 @@ you answered yes, it will let you select the signing keys.
240@node Cryptographic operations on files 240@node Cryptographic operations on files
241@section Cryptographic operations on files 241@section Cryptographic operations on files
242 242
243@deffn Command epa-decrypt-file file 243@deffn Command epa-decrypt-file file &optional output
244Decrypt @var{file}. 244Decrypt @var{file}. If you do not specify the name @var{output} to
245use for the decrypted file, this function prompts for the value to use.
245@end deffn 246@end deffn
246 247
247@deffn Command epa-verify-file file 248@deffn Command epa-verify-file file
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index dca95da2d10..0da422fe14f 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -701,14 +701,25 @@ groups ``eshell-glob'' and ``eshell-pred''.
701@node Input/Output 701@node Input/Output
702@chapter Input/Output 702@chapter Input/Output
703Since Eshell does not communicate with a terminal like most command 703Since Eshell does not communicate with a terminal like most command
704shells, IO is a little different. If you try to run programs from 704shells, IO is a little different.
705within Eshell that are not line-oriented, such as programs that use 705
706ncurses, you will just get garbage output, since the Eshell buffer is 706@section Visual Commands
707not a terminal emulator. Eshell solves this problem by running 707If you try to run programs from within Eshell that are not
708specified commands in Emacs's terminal emulator; to let Eshell know 708line-oriented, such as programs that use ncurses, you will just get
709which commands need to be run in a terminal, add them to the list 709garbage output, since the Eshell buffer is not a terminal emulator.
710@var{eshell-visual-commands}. 710Eshell solves this problem by running such programs in Emacs's
711 711terminal emulator.
712
713Programs that need a terminal to display output properly are referred
714to in this manual as ``visual commands,'' because they are not simply
715line-oriented. You must tell Eshell which commands are visual, by
716adding them to @var{eshell-visual-commands}; for commands that are
717visual for only certain @emph{sub}-commands -- e.g. @samp{git log} but
718not @samp{git status} -- use @var{eshell-visual-subcommands}; and for
719commands that are visual only when passed certain options, use
720@var{eshell-visual-options}.
721
722@section Redirection
712Redirection is mostly the same in Eshell as it is in other command 723Redirection is mostly the same in Eshell as it is in other command
713shells. The output redirection operators @code{>} and @code{>>} as 724shells. The output redirection operators @code{>} and @code{>>} as
714well as pipes are supported, but there is not yet any support for 725well as pipes are supported, but there is not yet any support for
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index a7a9647fd81..b4d786c4d45 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -9517,18 +9517,9 @@ Say how much time has elapsed between the article was posted and now
9517Date: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago 9517Date: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago
9518@end example 9518@end example
9519 9519
9520This line is updated continually by default. The frequency (in 9520To make this line updated continually, set the
9521seconds) is controlled by the @code{gnus-article-update-date-headers} 9521@code{gnus-article-update-date-headers} variable to the frequency in
9522variable. 9522seconds (the default is @code{nil}).
9523
9524If you wish to switch updating off, say:
9525
9526@vindex gnus-article-update-date-headers
9527@lisp
9528(setq gnus-article-update-date-headers nil)
9529@end lisp
9530
9531in your @file{~/.gnus.el} file.
9532 9523
9533@item W T o 9524@item W T o
9534@kindex W T o (Summary) 9525@kindex W T o (Summary)
diff --git a/etc/ChangeLog b/etc/ChangeLog
index c92720bccc8..f80c1b6973c 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,24 @@
12013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * NEWS: Document new prog-mode symbol prettify support.
4
52013-06-03 Tassilo Horn <tsdh@gnu.org>
6
7 * NEWS: Document eshell visual subcommands and options.
8
92013-06-02 Eric Ludlam <zappo@gnu.org>
10
11 * srecode/c.srt (header_guard): Add :c parameter so it works
12 standalone
13
142013-06-01 Alex Ott <alexott@gmail.com>
15
16 * tutorials/TUTORIAL.ru: Fix incorrectly translated wording.
17
182013-05-31 Tassilo Horn <tsdh@gnu.org>
19
20 * themes/tsdh-dark-theme.el (tsdh-dark): Refine mode-line faces.
21
12013-05-25 Xue Fuqiao <xfq.free@gmail.com> 222013-05-25 Xue Fuqiao <xfq.free@gmail.com>
2 23
3 * refcards/refcard.tex: Refine some entries. (Bug#14087) 24 * refcards/refcard.tex: Refine some entries. (Bug#14087)
diff --git a/etc/NEWS b/etc/NEWS
index 80546ce985a..1e6088fe671 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -28,6 +28,12 @@ This happens by default if a suitable support library is found at
28build time, like libacl on GNU/Linux. To prevent this, use the 28build time, like libacl on GNU/Linux. To prevent this, use the
29configure option `--disable-acl'. 29configure option `--disable-acl'.
30 30
31** Emacs can be compiled with file notification support.
32The configure option `--with-file-notification=LIB' enables file
33notification support in Emacs. This option's value should be `yes',
34`no', `gfile', `inotify' or `w32'. `yes' is a synonym for `w32' on
35MS-Windows, and for `gfile' otherwise. The default value is `yes'.
36
31** The configure option --with-crt-dir has been removed. 37** The configure option --with-crt-dir has been removed.
32It is no longer needed, as the crt*.o files are no longer linked 38It is no longer needed, as the crt*.o files are no longer linked
33specially. 39specially.
@@ -39,6 +45,18 @@ MS-Windows. The Windows-specific configure.bat and makefile.w32-in
39files are deprecated. See the file nt/INSTALL.MSYS for detailed 45files are deprecated. See the file nt/INSTALL.MSYS for detailed
40instructions. 46instructions.
41 47
48Using the Posix configure script and Makefile's also means a change in
49the directory structure of the Emacs installation on Windows. It is
50now the same as on GNU and Unix systems. In particular, the auxiliary
51programs, such as cmdproxy.exe and hexl.exe, are in
52libexec/emacs/VERSION/i686-pc-mingw32 (where VERSION is the Emacs
53version), version-independent site-lisp is in share/emacs/site-lisp,
54version-specific Lisp files are in share/emacs/VERSION/lisp and in
55share/emacs/VERSION/site-lisp, Info docs are in share/info, and data
56files are in share/emacs/VERSION/etc. (Emacs knows about all these
57directories and will find the files in there automatically; there's no
58need to set any variables due to this change.)
59
42 60
43* Startup Changes in Emacs 24.4 61* Startup Changes in Emacs 24.4
44 62
@@ -117,6 +135,18 @@ You can pick the name of the function and the variables with `C-x 4 a'.
117 135
118* Changes in Specialized Modes and Packages in Emacs 24.4 136* Changes in Specialized Modes and Packages in Emacs 24.4
119 137
138** `eshell' now supports visual subcommands and options
139Eshell has been able to handle "visual" commands (interactive,
140non-line oriented commands such as top that require display
141capabilities not provided by eshell) by running them in an Emacs
142terminal emulator. See `eshell-visual-commands'.
143
144This feature has been extended to subcommands and options that make a
145usually line-oriented command a visual command. Typical examples are
146"git log" and "git <command> --help" which display their output in a
147pager by default. See `eshell-visual-subcommands' and
148`eshell-visual-options'.
149
120** `remember' can now store notes in separates files 150** `remember' can now store notes in separates files
121You can use the new function `remember-store-in-files' within the 151You can use the new function `remember-store-in-files' within the
122`remember-handler-functions' option. 152`remember-handler-functions' option.
@@ -236,14 +266,36 @@ callers to fit the image to a frame other than the selected frame.
236entries displayed by `Info-index-next', `Info-virtual-index' and 266entries displayed by `Info-index-next', `Info-virtual-index' and
237`info-apropos'. 267`info-apropos'.
238 268
269** Hi-Lock
270
271*** New option `hi-lock-auto-select-face'. When non-nil, hi-lock commands
272will cycle through faces in `hi-lock-face-defaults' without prompting.
273
274+++
275*** New global command `M-s h .' (`highlight-symbol-at-point')
276highlights the symbol found near point without prompting,
277using the next face automatically.
278
239** Search and Replace 279** Search and Replace
240 280
281*** New global command `M-s .' (`isearch-forward-symbol-at-point')
282starts a symbol (identifier) incremental search forward with the
283symbol found near point added to the search string initially.
284
241*** `C-x 8 RET' in Isearch mode reads a character by its Unicode name 285*** `C-x 8 RET' in Isearch mode reads a character by its Unicode name
242and adds it to the search string. 286and adds it to the search string.
243 287
288*** `M-s i' in Isearch mode toggles the variable `isearch-invisible'
289between nil and the value of the option `search-invisible' (or `open'
290when it's nil).
291
244*** `query-replace' skips invisible text when `search-invisible' is nil, 292*** `query-replace' skips invisible text when `search-invisible' is nil,
245and opens overlays with hidden text when `search-invisible' is `open'. 293and opens overlays with hidden text when `search-invisible' is `open'.
246 294
295+++
296*** By default, prefix arguments do not now terminate Isearch mode.
297Set `isearch-allow-prefix' to nil to restore old behavior.
298
247** MH-E has been updated to MH-E version 8.5. 299** MH-E has been updated to MH-E version 8.5.
248See MH-E-NEWS for details. 300See MH-E-NEWS for details.
249 301
@@ -348,7 +400,11 @@ It is layered as:
348 400
349* Incompatible Lisp Changes in Emacs 24.4 401* Incompatible Lisp Changes in Emacs 24.4
350 402
351** Default process filers and sentinels are not nil any more. 403** overriding-terminal-local-map does not replace the local keymaps any more.
404It used to disable the minor mode, major mode, and text-property keymaps,
405whereas now it simply has higher precedence.
406
407** Default process filters and sentinels are not nil any more.
352Instead they default to a function which does what the nil value used to do. 408Instead they default to a function which does what the nil value used to do.
353 409
354** `read-event' does not return decoded chars in ttys any more. 410** `read-event' does not return decoded chars in ttys any more.
@@ -389,6 +445,7 @@ file using `set-file-extended-attributes'.
389*** `minibuffer-completion-contents' 445*** `minibuffer-completion-contents'
390*** `isearch-nonincremental-exit-minibuffer' 446*** `isearch-nonincremental-exit-minibuffer'
391*** `isearch-filter-visible' 447*** `isearch-filter-visible'
448*** `generic-make-keywords-list'
392 449
393** `with-wrapper-hook' is obsoleted by `add-function'. 450** `with-wrapper-hook' is obsoleted by `add-function'.
394The few hooks that used with-wrapper-hook are replaced as follows: 451The few hooks that used with-wrapper-hook are replaced as follows:
@@ -402,8 +459,9 @@ The few hooks that used with-wrapper-hook are replaced as follows:
402** Support for filesystem notifications. 459** Support for filesystem notifications.
403Emacs now supports notifications of filesystem changes, such as 460Emacs now supports notifications of filesystem changes, such as
404creation, modification, and deletion of files. This requires the 461creation, modification, and deletion of files. This requires the
405'inotify' API on GNU/Linux systems. On MS-Windows systems, this is 462`glib' API, or the 'inotify' API (on GNU/Linux systems only). On
406supported for Windows XP and newer versions. 463MS-Windows systems, this is supported for Windows XP and newer
464versions.
407 465
408** Changes in autorevert.el 466** Changes in autorevert.el
409 467
@@ -2785,6 +2843,11 @@ should be derived.
2785modes, e.g. (add-hook 'prog-mode-hook 'flyspell-prog-mode) to enable 2843modes, e.g. (add-hook 'prog-mode-hook 'flyspell-prog-mode) to enable
2786on-the-fly spell checking for comments and strings. 2844on-the-fly spell checking for comments and strings.
2787 2845
2846**** New option, `prog-prettify-symbols' lets the user control symbol
2847prettify (replacing a string like "lambda" with the Greek lambda
2848character. The mode derived from `prog-mode' must call
2849`prog-prettify-install' with its own custom alist, which can be empty.
2850
2788*** New hook `change-major-mode-after-body-hook', run by 2851*** New hook `change-major-mode-after-body-hook', run by
2789`run-mode-hooks' just before any other mode hooks. 2852`run-mode-hooks' just before any other mode hooks.
2790 2853
diff --git a/etc/srecode/c.srt b/etc/srecode/c.srt
index 479f5c9b33d..03e4c369307 100644
--- a/etc/srecode/c.srt
+++ b/etc/srecode/c.srt
@@ -44,7 +44,7 @@ template empty :time :user :file :c
44{{/HEADER}} 44{{/HEADER}}
45---- 45----
46 46
47template header_guard :file :blank 47template header_guard :file :blank :c
48---- 48----
49#ifndef {{FILENAME_SYMBOL:upcase}} 49#ifndef {{FILENAME_SYMBOL:upcase}}
50#define {{FILENAME_SYMBOL:upcase}} 1 50#define {{FILENAME_SYMBOL:upcase}} 1
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index 7b0c711f3b4..cd76f22aab1 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -73,8 +73,8 @@ Used and created by Tassilo Horn.")
73 '(magit-section-title ((t (:inherit magit-header :background "dark slate blue")))) 73 '(magit-section-title ((t (:inherit magit-header :background "dark slate blue"))))
74 '(menu ((t (:background "gray30" :foreground "gray70")))) 74 '(menu ((t (:background "gray30" :foreground "gray70"))))
75 '(minibuffer-prompt ((t (:background "yellow" :foreground "medium blue" :box (:line-width -1 :color "red" :style released-button) :weight bold)))) 75 '(minibuffer-prompt ((t (:background "yellow" :foreground "medium blue" :box (:line-width -1 :color "red" :style released-button) :weight bold))))
76 '(mode-line ((t (:box (:line-width 1 :color "red") :family "DejaVu Sans")))) 76 '(mode-line ((t (:background "gray30" :box (:line-width 1 :color "red") :family "DejaVu Sans"))))
77 '(mode-line-inactive ((t (:inherit mode-line :foreground "dim gray")))) 77 '(mode-line-inactive ((t (:inherit mode-line :foreground "dark gray"))))
78 '(org-agenda-date ((t (:inherit org-agenda-structure))) t) 78 '(org-agenda-date ((t (:inherit org-agenda-structure))) t)
79 '(org-agenda-date-today ((t (:inherit org-agenda-date :underline t))) t) 79 '(org-agenda-date-today ((t (:inherit org-agenda-date :underline t))) t)
80 '(org-agenda-date-weekend ((t (:inherit org-agenda-date :foreground "green"))) t) 80 '(org-agenda-date-weekend ((t (:inherit org-agenda-date :foreground "green"))) t)
diff --git a/etc/tutorials/TUTORIAL.ru b/etc/tutorials/TUTORIAL.ru
index ec8461adb3c..a0032f78af4 100644
--- a/etc/tutorials/TUTORIAL.ru
+++ b/etc/tutorials/TUTORIAL.ru
@@ -259,9 +259,9 @@ META. ĐœÑ‹ Ñ€ĐµĐºĐ¾Đ¼ĐµĐ½Đ´ÑƒĐµĐ¼ Đ¿Ñ€Đ¸Đ²Ñ‹ĐºĐ½ÑƒÑ‚ÑŒ Đº иÑĐ¿Đ¾Đ»ÑŒĐ·Đ¾Đ²Đ°Đ½
259Đ³Đ¾Đ²Đ¾Ñ€ÑÑ‰ĐµĐµ Đ¾ Ñ‚Đ¾Đ¼, ĐºĐ°ĐºĐ°Ñ ĐºĐ¾Đ¼Đ°Đ½Đ´Đ° Đ²Ñ‹Đ·Ñ‹Đ²Đ°ĐµÑ‚ÑÑ, и Đ·Đ°Đ¿Ñ€Đ¾ÑĐ¸Ñ‚ у Đ²Đ°Ñ, Ñ…Đ¾Ñ‚Đ¸Ñ‚Đµ ли Đ²Ñ‹ 259Đ³Đ¾Đ²Đ¾Ñ€ÑÑ‰ĐµĐµ Đ¾ Ñ‚Đ¾Đ¼, ĐºĐ°ĐºĐ°Ñ ĐºĐ¾Đ¼Đ°Đ½Đ´Đ° Đ²Ñ‹Đ·Ñ‹Đ²Đ°ĐµÑ‚ÑÑ, и Đ·Đ°Đ¿Ñ€Đ¾ÑĐ¸Ñ‚ у Đ²Đ°Ñ, Ñ…Đ¾Ñ‚Đ¸Ñ‚Đµ ли Đ²Ñ‹
260Đ¿Ñ€Đ¾Đ´Đ¾Đ»Đ¶Đ°Ñ‚ÑŒ Ñ€Đ°Đ±Đ¾Ñ‚Ñƒ и Đ²Ñ‹Đ¿Đ¾Đ»Đ½Đ¸Ñ‚ÑŒ Đ´Đ°Đ½Đ½ÑƒÑ ĐºĐ¾Đ¼Đ°Đ½Đ´Ñƒ. 260Đ¿Ñ€Đ¾Đ´Đ¾Đ»Đ¶Đ°Ñ‚ÑŒ Ñ€Đ°Đ±Đ¾Ñ‚Ñƒ и Đ²Ñ‹Đ¿Đ¾Đ»Đ½Đ¸Ñ‚ÑŒ Đ´Đ°Đ½Đ½ÑƒÑ ĐºĐ¾Đ¼Đ°Đ½Đ´Ñƒ.
261 261
262Đ•Ñли Đ²Ñ‹ Đ´ĐµĐ¹ÑÑ‚Đ²Đ¸Ñ‚ĐµĐ»ÑŒĐ½Đ¾ Đ¿Đ¾Đ¿Ñ€Đ¾Đ±Đ¾Đ²Đ°Ñ‚ÑŒ Đ²Ñ‹Đ¿Đ¾Đ»Đ½Đ¸Ñ‚ÑŒ Ñту ĐºĐ¾Đ¼Đ°Đ½Đ´Ñƒ, Ñ‚Đ¾ Đ½Đ°Đ¶Đ¼Đ¸Ñ‚Đµ ĐºĐ»Đ°Đ²Đ¸ÑˆÑƒ 262Đ•Ñли Đ²Ñ‹ Đ´ĐµĐ¹ÑÑ‚Đ²Đ¸Ñ‚ĐµĐ»ÑŒĐ½Đ¾ Ñ…Đ¾Ñ‚Đ¸Ñ‚Đµ Đ²Ñ‹Đ¿Đ¾Đ»Đ½Đ¸Ñ‚ÑŒ Ñту ĐºĐ¾Đ¼Đ°Đ½Đ´Ñƒ, Ñ‚Đ¾ Đ½Đ°Đ¶Đ¼Đ¸Ñ‚Đµ ĐºĐ»Đ°Đ²Đ¸ÑˆÑƒ
263<SPC> (Đ¿Ñ€Đ¾Đ±ĐµĐ») Đ² Đ¾Ñ‚Đ²ĐµÑ‚ Đ½Đ° Đ·Đ°Đ´Đ°Đ½Đ½Ñ‹Đ¹ Đ²Đ¾Đ¿Ñ€Đ¾Ñ. ĐĐ±Ñ‹Ñ‡Đ½Đ¾, еÑли Đ²Ñ‹ Đ½Đµ Ñ…Đ¾Ñ‚Đ¸Ñ‚Đµ 263<SPC> (Đ¿Ñ€Đ¾Đ±ĐµĐ») Đ² Đ¾Ñ‚Đ²ĐµÑ‚ Đ½Đ° Đ·Đ°Đ´Đ°Đ½Đ½Ñ‹Đ¹ Đ²Đ¾Đ¿Ñ€Đ¾Ñ. РеÑли Đ²Ñ‹ Đ½Đµ Ñ…Đ¾Ñ‚Đ¸Ñ‚Đµ Đ²Ñ‹Đ¿Đ¾Đ»Đ½Đ¸Ñ‚ÑŒ
264Đ²Ñ‹Đ¿Đ¾Đ»Đ½Ñть Đ·Đ°Đ¿Ñ€ĐµÑ‰ĐµĐ½Đ½ÑƒÑ ĐºĐ¾Đ¼Đ°Đ½Đ´Ñƒ, Ñ‚Đ¾ Đ¾Ñ‚Đ²ĐµÑ‚ÑŒÑ‚Đµ Đ½Đ° Đ²Đ¾Đ¿Ñ€Đ¾Ñ Đ½Đ°Đ¶Đ°Ñ‚Đ¸ĐµĐ¼ ĐºĐ»Đ°Đ²Đ¸ÑˆĐ¸ "n". 264Đ·Đ°Đ¿Ñ€ĐµÑ‰ĐµĐ½Đ½ÑƒÑ ĐºĐ¾Đ¼Đ°Đ½Đ´Ñƒ, Ñ‚Đ¾ Đ¾Ñ‚Đ²ĐµÑ‚ÑŒÑ‚Đµ Đ½Đ° Đ²Đ¾Đ¿Ñ€Đ¾Ñ Đ½Đ°Đ¶Đ°Ñ‚Đ¸ĐµĐ¼ ĐºĐ»Đ°Đ²Đ¸ÑˆĐ¸ "n".
265 265
266>> ĐĐ°Đ¶Đ¼Đ¸Ñ‚Đµ `C-x C-l' ("Đ·Đ°Đ¿Ñ€ĐµÑ‰ĐµĐ½Đ½Đ°Ñ" ĐºĐ¾Đ¼Đ°Đ½Đ´Đ°), а Đ¿Đ¾Ñ‚Đ¾Đ¼ Đ¾Ñ‚Đ²ĐµÑ‚ÑŒÑ‚Đµ "n" Đ½Đ° 266>> ĐĐ°Đ¶Đ¼Đ¸Ñ‚Đµ `C-x C-l' ("Đ·Đ°Đ¿Ñ€ĐµÑ‰ĐµĐ½Đ½Đ°Ñ" ĐºĐ¾Đ¼Đ°Đ½Đ´Đ°), а Đ¿Đ¾Ñ‚Đ¾Đ¼ Đ¾Ñ‚Đ²ĐµÑ‚ÑŒÑ‚Đµ "n" Đ½Đ°
267 Đ·Đ°Đ´Đ°Đ½Đ½Ñ‹Đ¹ Đ²Đ¾Đ¿Ñ€Đ¾Ñ. 267 Đ·Đ°Đ´Đ°Đ½Đ½Ñ‹Đ¹ Đ²Đ¾Đ¿Ñ€Đ¾Ñ.
@@ -284,7 +284,7 @@ Emacs Đ¼Đ¾Đ¶ĐµÑ‚ Đ¾Ñ‚Đ¾Đ±Ñ€Đ°Đ¶Đ°Ñ‚ÑŒ Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ² Đ½ĐµÑĐºĐ¾Đ»ÑŒĐºĐ¸
284>> ĐŸĐµÑ€ĐµĐ¼ĐµÑÑ‚Đ¸Ñ‚Đµ ĐºÑƒÑ€ÑĐ¾Ñ€ Đ½Đ° Ñту ÑÑ‚Ñ€Đ¾ĐºÑƒ и Đ½Đ°Đ¶Đ¼Đ¸Ñ‚Đµ C-u 0 C-l. 284>> ĐŸĐµÑ€ĐµĐ¼ĐµÑÑ‚Đ¸Ñ‚Đµ ĐºÑƒÑ€ÑĐ¾Ñ€ Đ½Đ° Ñту ÑÑ‚Ñ€Đ¾ĐºÑƒ и Đ½Đ°Đ¶Đ¼Đ¸Ñ‚Đµ C-u 0 C-l.
285 285
286>> ĐĐ°Đ±ĐµÑ€Đ¸Ñ‚Đµ C-h k C-f. 286>> ĐĐ°Đ±ĐµÑ€Đ¸Ñ‚Đµ C-h k C-f.
287 ĐŸĐ¾ÑĐ¼Đ¾Ñ‚Ñ€Đ¸Ñ‚Đµ, ĐºĐ°Đº Ñ‚ĐµĐºÑƒÑ‰ĐµĐµ Đ¾ĐºĐ½Đ¾ ÑĐ¾Đ¶Đ¼ĐµÑ‚ÑÑ, ĐºĐ¾Đ³Đ´Đ° Đ¿Đ¾ÑĐ²Đ¸Ñ‚ÑÑ Đ½Đ¾Đ²Đ¾Đµ Đ¾ĐºĐ½Đ¾ и 287 ĐĐ°Đ¼ĐµÑ‚ÑŒÑ‚Đµ ĐºĐ°Đº Ñ‚ĐµĐºÑƒÑ‰ĐµĐµ Đ¾ĐºĐ½Đ¾ ÑƒĐ¼ĐµĐ½ÑŒÑˆĐ¸Ñ‚ÑÑ, ĐºĐ¾Đ³Đ´Đ° Đ¿Đ¾ÑĐ²Đ¸Ñ‚ÑÑ Đ½Đ¾Đ²Đ¾Đµ Đ¾ĐºĐ½Đ¾ и
288 Đ¾Ñ‚Đ¾Đ±Ñ€Đ°Đ·Đ¸Ñ‚ Đ´Đ¾ĐºÑƒĐ¼ĐµĐ½Ñ‚Đ°Ñ†Đ¸Ñ Đ´Đ»Ñ ÑĐ¾Ñ‡ĐµÑ‚Đ°Đ½Đ¸Ñ ĐºĐ»Đ°Đ²Đ¸Ñˆ C-f. 288 Đ¾Ñ‚Đ¾Đ±Ñ€Đ°Đ·Đ¸Ñ‚ Đ´Đ¾ĐºÑƒĐ¼ĐµĐ½Ñ‚Đ°Ñ†Đ¸Ñ Đ´Đ»Ñ ÑĐ¾Ñ‡ĐµÑ‚Đ°Đ½Đ¸Ñ ĐºĐ»Đ°Đ²Đ¸Ñˆ C-f.
289 289
290>> ĐĐ°Đ±ĐµÑ€Đ¸Ñ‚Đµ C-x 1 и Đ¿Đ¾ÑĐ¼Đ¾Ñ‚Ñ€Đ¸Ñ‚Đµ, ĐºĐ°Đº Đ¾ĐºĐ½Đ¾ Ñ Đ´Đ¾ĐºÑƒĐ¼ĐµĐ½Ñ‚Đ°Ñ†Đ¸ĐµĐ¹ иÑÑ‡ĐµĐ·Đ½ĐµÑ‚. 290>> ĐĐ°Đ±ĐµÑ€Đ¸Ñ‚Đµ C-x 1 и Đ¿Đ¾ÑĐ¼Đ¾Ñ‚Ñ€Đ¸Ñ‚Đµ, ĐºĐ°Đº Đ¾ĐºĐ½Đ¾ Ñ Đ´Đ¾ĐºÑƒĐ¼ĐµĐ½Ñ‚Đ°Ñ†Đ¸ĐµĐ¹ иÑÑ‡ĐµĐ·Đ½ĐµÑ‚.
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index e565983e147..e1025fc5f6b 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
12013-05-29 Eli Zaretskii <eliz@gnu.org>
2
3 * Makefile.in (mostlyclean): Remove *.res files.
4
12013-05-18 Paul Eggert <eggert@cs.ucla.edu> 52013-05-18 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 Port --enable-gcc-warnings to clang. 7 Port --enable-gcc-warnings to clang.
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index e0acea867b7..f32333fe765 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -278,7 +278,7 @@ uninstall:
278 fi 278 fi
279 279
280mostlyclean: 280mostlyclean:
281 -rm -f core *.o 281 -rm -f core *.o *.res
282 282
283clean: mostlyclean 283clean: mostlyclean
284 -rm -f ${EXE_FILES} 284 -rm -f ${EXE_FILES}
diff --git a/lib/c-ctype.h b/lib/c-ctype.h
index 3a66440ae9e..ad589b5c209 100644
--- a/lib/c-ctype.h
+++ b/lib/c-ctype.h
@@ -136,7 +136,8 @@ extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
136extern int c_toupper (int c) _GL_ATTRIBUTE_CONST; 136extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
137 137
138 138
139#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS 139#if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \
140 && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS)
140 141
141/* ASCII optimizations. */ 142/* ASCII optimizations. */
142 143
diff --git a/lib/sig2str.h b/lib/sig2str.h
index d16be98c076..df6bfd39e3d 100644
--- a/lib/sig2str.h
+++ b/lib/sig2str.h
@@ -27,9 +27,17 @@
27/* Size of a buffer needed to hold a signal name like "HUP". */ 27/* Size of a buffer needed to hold a signal name like "HUP". */
28# define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1) 28# define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1)
29 29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
30int sig2str (int, char *); 34int sig2str (int, char *);
31int str2sig (char const *, int *); 35int str2sig (char const *, int *);
32 36
37#ifdef __cplusplus
38}
39#endif
40
33#endif 41#endif
34 42
35/* An upper bound on signal numbers allowed by the system. */ 43/* An upper bound on signal numbers allowed by the system. */
diff --git a/lib/verify.h b/lib/verify.h
index cb8e90b5427..03492efcd3f 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -31,7 +31,9 @@
31 Use this only with GCC. If we were willing to slow 'configure' 31 Use this only with GCC. If we were willing to slow 'configure'
32 down we could also use it with other compilers, but since this 32 down we could also use it with other compilers, but since this
33 affects only the quality of diagnostics, why bother? */ 33 affects only the quality of diagnostics, why bother? */
34# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus 34# if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
35 && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
36 && !defined __cplusplus)
35# define _GL_HAVE__STATIC_ASSERT 1 37# define _GL_HAVE__STATIC_ASSERT 1
36# endif 38# endif
37/* The condition (99 < __GNUC__) is temporary, until we know about the 39/* The condition (99 < __GNUC__) is temporary, until we know about the
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9f9302680be..ae429db7a7a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,12 +1,688 @@
12013-06-12 Glenn Morris <rgm@gnu.org>
2
3 * ido.el (ido-delete-ignored-files): Remove.
4 (ido-wide-find-dirs-or-files, ido-make-file-list-1):
5 Go back to calling ido-ignore-item-p directly.
6
72013-06-12 Eyal Lotem <eyal.lotem@gmail.com> (tiny change)
8
9 * ido.el (ido-wide-find-dirs-or-files): Respect ido-case-fold.
10
11 * ido.el (ido-delete-ignored-files): New function,
12 split from ido-make-file-list-1.
13 (ido-wide-find-dirs-or-files): Maybe ignore files. (Bug#13003)
14 (ido-make-file-list-1): Use ido-delete-ignored-files.
15
162013-06-12 Leo Liu <sdl.web@gmail.com>
17
18 * progmodes/octave.el (inferior-octave-startup)
19 (inferior-octave-completion-table)
20 (inferior-octave-track-window-width-change)
21 (octave-eldoc-function-signatures, octave-help)
22 (octave-find-definition): Use single quoted strings.
23 (inferior-octave-startup-args): Change default value.
24 (inferior-octave-startup): Do not hard code "-i" and
25 "--no-line-editing".
26 (inferior-octave-resync-dirs): Add optional arg NOERROR.
27 (inferior-octave-directory-tracker): Use it.
28 (octave-goto-function-definition): Robustify.
29 (octave-help): Support highlighting operators in 'See also'.
30 (octave-find-definition): Find subfunctions only in Octave mode.
31
322013-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
33
34 * help-fns.el (help-fns--compiler-macro): If the handler function is
35 named, then put a link to it.
36 * help-mode.el (help-function-cmacro): Adjust regexp for cl-lib names.
37 * emacs-lisp/cl-macs.el (cl--compiler-macro-typep): New function.
38 (cl-typep): Use it.
39 (cl-eval-when): Simplify debug spec.
40 (cl-define-compiler-macro): Use eval-and-compile. Give a name to the
41 compiler-macro function instead of setting `compiler-macro-file'.
42
432013-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
44 Daniel Hackney <dan@haxney.org>
45
46 First part of Daniel Hackney's patch to package.el.
47 * emacs-lisp/package.el: Use defstruct.
48 (package-desc): New, main struct.
49 (package--bi-desc, package--ac-desc): New structs, used to describe the
50 format in external files.
51 (package-desc-vers): Replace with package-desc-version accessor.
52 (package-desc-doc): Replace with package-desc-summary accessor.
53 (package-activate-1): Remove `package' arg since the pkg-vec now
54 includes the name.
55 (define-package): Use package-desc-from-define.
56 (package-unpack-single): Change file-name arg to be a symbol.
57 (package--add-to-archive-contents): Use package-desc-create and new
58 accessor functions to package--ac-desc.
59 (package-buffer-info, package-tar-file-info): Return a package-desc.
60 (package-install-from-buffer): Remove `type' argument. Change pkg-info
61 arg to be a package-desc.
62 (package-install-file): Adjust accordingly. Use \' to match EOS.
63 (package--from-builtin): New function.
64 (describe-package-1, package-menu--generate): Use it.
65 (package--make-autoloads-and-compile): Change name arg to be a symbol.
66 (package-generate-autoloads): Idem and return the name of the file.
67 * emacs-lisp/package-x.el (package-upload-buffer-internal):
68 Change pkg-info arg to be a package-desc.
69 Use package-make-ac-desc.
70 (package-upload-file): Use \' to match EOS.
71 * finder.el (finder-compile-keywords): Use package-make-builtin.
72
732013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
74
75 * vc/vc.el (vc-deduce-fileset): Change error message.
76 (vc-read-backend): New function.
77 (vc-next-action): Use it.
78
79 * subr.el (function-arity): Remove (mistakenly added) (bug#14590).
80
81 * progmodes/prolog.el (prolog-make-keywords-regexp): Remove.
82 (prolog-font-lock-keywords): Use regexp-opt instead.
83 Don't manually highlight strings.
84 (prolog-mode-variables): Simplify comment-start-skip.
85 (prolog-consult-compile): Use display-buffer. Remove unused old-filter.
86
87 * emacs-lisp/generic.el (generic--normalise-comments)
88 (generic-set-comment-syntax, generic-set-comment-vars): New functions.
89 (generic-mode-set-comments): Use them.
90 (generic-bracket-support): Use setq-local.
91 (generic-make-keywords-list): Declare obsolete.
92
932013-06-11 Glenn Morris <rgm@gnu.org>
94
95 * emacs-lisp/lisp-mode.el (lisp-mode-variables):
96 Prettify after setting font-lock-defaults. (Bug#14574)
97
982013-06-11 Juanma Barranquero <lekktu@gmail.com>
99
100 * replace.el (query-replace, occur-read-regexp-defaults-function)
101 (replace-search):
102 * subr.el (declare-function, number-sequence, local-set-key)
103 (substitute-key-definition, locate-user-emacs-file)
104 (with-silent-modifications, split-string, eval-after-load):
105 Fix typos, remove unneeded backslashes and reflow some docstrings.
106
1072013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
108
109 * international/mule-conf.el (file-coding-system-alist): Use utf-8 as
110 default for Elisp files.
111
1122013-06-11 Glenn Morris <rgm@gnu.org>
113
114 * vc/log-view.el (log-view-mode-map): Inherit from special-mode-map,
115 although define-derived-mode was doing this anyway. (Bug#14583)
116
1172013-06-10 Juanma Barranquero <lekktu@gmail.com>
118
119 * allout.el (allout-encryption-plaintext-sanitization-regexps):
120 Fix make-variable-buffer-local call to refer to the correct variable.
121
1222013-06-10 Aidan Gauland <aidalgol@amuri.net>
123
124 * eshell/em-term.el (eshell-visual-commands)
125 (eshell-visual-subcommands, eshell-visual-options):
126 Add summary line to docstrings. Add cross-references.
127
1282013-06-10 Glenn Morris <rgm@gnu.org>
129
130 * epa.el (epa-read-file-name): New function. (Bug#14510)
131 (epa-decrypt-file): Make plain-file optional. Use epa-read-file-name.
132
1332013-06-09 Aidan Gauland <aidalgol@amuri.net>
134
135 * eshell/em-term.el (eshell-visual-command-p): Fix bug that caused
136 output redirection to be ignored with visual commands.
137
1382013-06-09 Aidan Gauland <aidalgol@amuri.net>
139
140 * eshell/em-term.el (eshell-visual-command-p): New function.
141 (eshell-term-initialize): Move long lambda to separate function
142 eshell-visual-command-p.
143 * eshell/em-dirs.el (eshell-dirs-initialise):
144 * eshell/em-script.el (eshell-script-initialize):
145 Add missing #' to lambda.
146
1472013-06-08 Leo Liu <sdl.web@gmail.com>
148
149 * progmodes/octave.el (octave-add-log-current-defun): New function.
150 (octave-mode): Set add-log-current-defun-function.
151 (octave-goto-function-definition): Do not move point if not found.
152 (octave-find-definition): Enhance to try subfunctions first.
153
1542013-06-08 Glenn Morris <rgm@gnu.org>
155
156 * emacs-lisp/bytecomp.el (byte-compile-char-before)
157 (byte-compile-backward-char, byte-compile-backward-word):
158 Improve previous change, to handle non-explicit nil.
159
1602013-06-07 Stefan Monnier <monnier@iro.umontreal.ca>
161
162 * emacs-lisp/smie.el: Improve show-paren-mode behavior.
163 (smie--opener/closer-at-point): New function.
164 (smie--matching-block-data): Use it. Don't match from right after an
165 opener or right before a closer. Obey smie-blink-matching-inners.
166 Don't signal a mismatch for repeated inners like "switch..case..case".
167
1682013-06-07 Leo Liu <sdl.web@gmail.com>
169
170 * progmodes/octave.el (octave-mode): Set comment-use-global-state
171 to t. (Bug#14303)
172 (octave-function-header-regexp): Fix. (Bug#14570)
173 (octave-help-mode-finish-hook, octave-help-mode-finish):
174 Remove. Just use temp-buffer-show-hook.
175
176 * newcomment.el (comment-search-backward): Revert last change.
177 (Bug#14434)
178
179 * emacs-lisp/smie.el (smie--matching-block-data): Minor simplification.
180
1812013-06-07 Eli Zaretskii <eliz@gnu.org>
182
183 * Makefile.in (TAGS TAGS-LISP): Pass the (long) list of *.el files
184 through xargs, to avoid failure due to MS-Windows limitations on
185 command-line length.
186
1872013-06-06 Glenn Morris <rgm@gnu.org>
188
189 * font-lock.el (lisp-font-lock-keywords-2):
190 Treat user-error like error.
191
192 * emacs-lisp/bytecomp.el (byte-compile-char-before)
193 (byte-compile-backward-char, byte-compile-backward-word):
194 Handle explicit nil arguments. (Bug#14565)
195
1962013-06-05 Alan Mackenzie <acm@muc.de>
197
198 * isearch.el (isearch-allow-prefix): New user option.
199 (isearch-other-meta-char): Don't exit isearch when a prefix
200 argument is typed whilst `isearch-allow-prefix' is non-nil.
201 (Bug#9706)
202
2032013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
204
205 * autorevert.el (auto-revert-notify-handler): Use memq.
206 Hide assertion failure.
207
208 * skeleton.el: Use cl-lib.
209 (skeleton-further-elements): Use defvar-local.
210 (skeleton-insert): Use cl-progv.
211
2122013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
213
214 * progmodes/prog-mode.el (prog-prettify-symbols)
215 (prog-prettify-install): Update docstrings.
216
2172013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
218
219 * simple.el: Move all the prog-mode code to prog-mode.el.
220 * progmodes/prog-mode.el: New file.
221 * loadup.el: Add prog-mode.el.
222
2232013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
224
225 * simple.el (prog-prettify-symbols): Add version.
226 (prog-prettify-install): Add convenience function to prettify symbols.
227
228 * progmodes/perl-mode.el (perl--augmented-font-lock-keywords)
229 (perl--augmented-font-lock-keywords-1)
230 (perl--augmented-font-lock-keywords-2, perl-mode): Remove unneeded
231 variables and use it.
232
233 * progmodes/cfengine.el (cfengine3--augmented-font-lock-keywords)
234 (cfengine3-mode): Remove unneeded variable and use it.
235
236 * emacs-lisp/lisp-mode.el (lisp--augmented-font-lock-keywords)
237 (lisp--augmented-font-lock-keywords-1)
238 (lisp--augmented-font-lock-keywords-2, lisp-mode-variables):
239 Remove unneeded variables and use it.
240
2412013-06-05 JoĂ£o TĂ¡vora <joaotavora@gmail.com>
242
243 * net/tls.el (open-tls-stream): Remove unneeded buffer contents up
244 to point when opening the connection. (Bug#14380)
245
2462013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
247
248 * subr.el (load-history-regexp, load-history-filename-element)
249 (eval-after-load, after-load-functions, do-after-load-evaluation)
250 (eval-next-after-load, display-delayed-warnings)
251 (collapse-delayed-warnings, delayed-warnings-hook): Move after the
252 definition of save-match-data.
253 (overriding-local-map): Remove accidental obsolescence declaration.
254
255 * emacs-lisp/edebug.el (edebug-result): Move before first use.
256
2572013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
258
259 Generalize symbol prettify support to prog-mode and implement it
260 for perl-mode, cfengine3-mode, and emacs-lisp-mode.
261 * simple.el (prog-prettify-symbols-alist, prog-prettify-symbols)
262 (prog--prettify-font-lock-compose-symbol)
263 (prog-prettify-font-lock-symbols-keywords): New variables and
264 functions to support symbol prettification.
265 * emacs-lisp/lisp-mode.el (lisp--augmented-font-lock-keywords)
266 (lisp--augmented-font-lock-keywords-1)
267 (lisp--augmented-font-lock-keywords-2, lisp-mode-variables)
268 (lisp--prettify-symbols-alist): Implement prettify of lambda.
269 * progmodes/cfengine.el (cfengine3--augmented-font-lock-keywords)
270 (cfengine3--prettify-symbols-alist, cfengine3-mode):
271 Implement prettify of -> => :: strings.
272 * progmodes/perl-mode.el (perl-prettify-symbols)
273 (perl--font-lock-compose-symbol)
274 (perl--font-lock-symbols-keywords): Move to prog-mode.
275 (perl--prettify-symbols-alist): Prettify -> => :: strings.
276 (perl-font-lock-keywords-1)
277 (perl-font-lock-keywords-2): Remove explicit prettify support.
278 (perl--augmented-font-lock-keywords)
279 (perl--augmented-font-lock-keywords-1)
280 (perl--augmented-font-lock-keywords-2, perl-mode):
281 Implement prettify support.
282
2832013-06-05 Leo Liu <sdl.web@gmail.com>
284
285 Re-implement smie matching block highlight using
286 show-paren-data-function. (Bug#14395)
287 * emacs-lisp/smie.el (smie-matching-block-highlight)
288 (smie--highlight-matching-block-overlay)
289 (smie--highlight-matching-block-lastpos)
290 (smie-highlight-matching-block)
291 (smie-highlight-matching-block-mode): Remove.
292 (smie--matching-block-data-cache): New variable.
293 (smie--matching-block-data): New function.
294 (smie-setup): Use smie--matching-block-data for
295 show-paren-data-function.
296
297 * progmodes/octave.el (octave-mode-menu): Fix.
298 (octave-find-definition): Skip garbage lines.
299
3002013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
301
302 Fix compilation error with simultaneous dynamic+lexical scoping.
303 Add warning when a defvar appears after the first let-binding.
304 * emacs-lisp/bytecomp.el (byte-compile-lexical-variables): New var.
305 (byte-compile-close-variables): Initialize it.
306 (byte-compile--declare-var): New function.
307 (byte-compile-file-form-defvar)
308 (byte-compile-file-form-define-abbrev-table)
309 (byte-compile-file-form-custom-declare-variable): Use it.
310 (byte-compile-make-lambda-lexenv): Change the argument. Simplify.
311 (byte-compile-lambda): Share call to byte-compile-arglist-vars.
312 (byte-compile-bind): Handle dynamic bindings that shadow
313 lexical bindings.
314 (byte-compile-unbind): Make arg non-optional.
315 (byte-compile-let): Simplify.
316 * emacs-lisp/cconv.el (byte-compile-lexical-variables): Declare var.
317 (cconv--analyse-function, cconv-analyse-form): Populate it.
318 Protect byte-compile-bound-variables to limit the scope of defvars.
319 (cconv-analyse-form): Add missing rule for (defvar <foo>).
320 Remove unneeded rule for `declare'.
321
322 * emacs-lisp/cl-macs.el (cl--compiler-macro-adjoin): Use macroexp-let2
323 so as to avoid depending on cl-adjoin at run-time.
324 * emacs-lisp/cl-lib.el (cl-pushnew): Use backquotes.
325
326 * emacs-lisp/macroexp.el (macroexp--compiling-p): New function.
327 (macroexp--warn-and-return): Use it.
328
3292013-06-05 Leo Liu <sdl.web@gmail.com>
330
331 * eshell/esh-mode.el (eshell-mode): Fix key bindings.
332
3332013-06-04 Leo Liu <sdl.web@gmail.com>
334
335 * progmodes/compile.el (compile-goto-error): Add optional arg NOMSG.
336 (compilation-auto-jump): Suppress the "Mark set" message to give
337 way to exit message.
338
3392013-06-04 Alan Mackenzie <acm@muc.de>
340
341 Remove faulty optimisation from indentation calculation.
342 * progmodes/cc-engine.el (c-guess-basic-syntax): Don't calculate
343 search limit based on 2000 characters back from indent-point.
344
3452013-06-03 Tassilo Horn <tsdh@gnu.org>
346
347 * eshell/em-term.el (cl-lib): Require `cl-lib'.
348
3492013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
350
351 * emacs-lisp/lisp.el: Use lexical-binding.
352 (lisp--local-variables-1, lisp--local-variables): New functions.
353 (lisp--local-variables-completion-table): New var.
354 (lisp-completion-at-point): Use it complete let-bound vars.
355
356 * emacs-lisp/lisp-mode.el (eval-sexp-add-defvars): Expand macros
357 eagerly (bug#14422).
358
3592013-06-03 Michael Albinus <michael.albinus@gmx.de>
360
361 * autorevert.el (auto-revert-notify-enabled)
362 (auto-revert-notify-rm-watch, auto-revert-notify-add-watch)
363 (auto-revert-notify-event-p, auto-revert-notify-event-file-name)
364 (auto-revert-notify-handler): Handle also gfilenotify.
365
366 * subr.el (file-notify-handle-event): New defun. Replacing ...
367 (inotify-event-p, inotify-handle-event, w32notify-handle-event):
368 Remove.
369
3702013-06-03 Juri Linkov <juri@jurta.org>
371
372 * bindings.el (search-map): Bind `highlight-symbol-at-point' to
373 `M-s h .'. (Bug#14427)
374
375 * hi-lock.el (highlight-symbol-at-point): New alias for the new
376 command `hi-lock-face-symbol-at-point'.
377 (hi-lock-face-symbol-at-point): New command.
378 (hi-lock-map): Bind `highlight-symbol-at-point' to `C-x w .'.
379 (hi-lock-menu): Add `highlight-symbol-at-point'.
380 (hi-lock-mode): Doc fix.
381
382 * isearch.el (isearch-forward-symbol-at-point): New command.
383 (search-map): Bind `isearch-forward-symbol-at-point' to `M-s .'.
384 (isearch-highlight-regexp): Add a regexp which matches
385 words/symbols for word/symbol mode.
386
387 * subr.el (find-tag-default-bounds): New function with the body
388 mostly moved from `find-tag-default'.
389 (find-tag-default): Move most code to `find-tag-default-bounds',
390 call it and apply `buffer-substring-no-properties' afterwards.
391
3922013-06-03 Tassilo Horn <tsdh@gnu.org>
393
394 * eshell/em-term.el (eshell-term-initialize):
395 Use `cl-intersection' rather than `intersection'.
396
3972013-06-02 Xue Fuqiao <xfq.free@gmail.com>
398
399 * vc/log-view.el: Doc fix.
400 (log-view-mode-map): Copy keymap from `special-mode-map'.
401
4022013-06-02 Eric Ludlam <zappo@gnu.org>
403
404 * emacs-lisp/eieio.el (eieio--defalias, eieio-hook)
405 (eieio-error-unsupported-class-tags, eieio-skip-typecheck)
406 (eieio-optimize-primary-methods-flag, eieio-initializing-object)
407 (eieio-unbound, eieio-default-superclass)
408 (eieio--define-field-accessors, method-static, method-before)
409 (method-primary, method-after, method-num-lists)
410 (method-generic-before, method-generic-primary)
411 (method-generic-after, method-num-slots)
412 (eieio-specialized-key-to-generic-key)
413 (eieio--check-type, class-v, class-p)
414 (eieio-class-name, define-obsolete-function-alias)
415 (eieio-class-parents-fast, eieio-class-children-fast)
416 (same-class-fast-p, class-constructor, generic-p)
417 (generic-primary-only-p, generic-primary-only-one-p)
418 (class-option-assoc, class-option, eieio-object-p)
419 (class-abstract-p, class-method-invocation-order)
420 (eieio-defclass-autoload-map, eieio-defclass-autoload)
421 (eieio-class-un-autoload, eieio-defclass)
422 (eieio-eval-default-p, eieio-perform-slot-validation-for-default)
423 (eieio-add-new-slot, eieio-copy-parents-into-subclass)
424 (eieio--defgeneric-init-form, eieio-defgeneric-form)
425 (eieio-defgeneric-reset-generic-form)
426 (eieio-defgeneric-form-primary-only)
427 (eieio-defgeneric-reset-generic-form-primary-only)
428 (eieio-defgeneric-form-primary-only-one)
429 (eieio-defgeneric-reset-generic-form-primary-only-one)
430 (eieio-unbind-method-implementations)
431 (eieio--defmethod, eieio--typep)
432 (eieio-perform-slot-validation, eieio-validate-slot-value)
433 (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound)
434 (eieio-oref, eieio-oref-default, eieio-default-eval-maybe)
435 (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p)
436 (eieio-slot-name-index, eieio-class-slot-name-index)
437 (eieio-set-defaults, eieio-initarg-to-attribute)
438 (eieio-attribute-to-initarg, eieio-c3-candidate)
439 (eieio-c3-merge-lists, eieio-class-precedence-c3)
440 (eieio-class-precedence-dfs, eieio-class-precedence-bfs)
441 (eieio-class-precedence-list, eieio-generic-call-methodname)
442 (eieio-generic-call-arglst, eieio-generic-call-key)
443 (eieio-generic-call-next-method-list)
444 (eieio-pre-method-execution-functions, eieio-generic-call)
445 (eieio-generic-call-primary-only, eieiomt-method-list)
446 (eieiomt-optimizing-obarray, eieiomt-install)
447 (eieiomt-add, eieiomt-next, eieiomt-sym-optimize)
448 (eieio-generic-form, eieio-defmethod, make-obsolete)
449 (eieio-defgeneric, make-obsolete): Move to eieio-core.el
450 (defclass): Remove `eval-and-compile' from macro.
451 (call-next-method, shared-initialize): Instead of using
452 `scoped-class' variable, use new eieio--scoped-class, and
453 eieio--with-scoped-class.
454 (initialize-instance): Rename local variable 'scoped-class' to
455 'this-class' to remove ambiguitity from old global.
456
457 * emacs-lisp/eieio-core.el: New file. Derived from key parts of
458 eieio.el.
459 (eieio--scoped-class-stack): New variable
460 (eieio--scoped-class): New fcn
461 (eieio--with-scoped-class): New scoping macro.
462 (eieio-defclass): Use pushnew instead of add-to-list.
463 (eieio-defgeneric-form-primary-only-one, eieio-oset-default)
464 (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call)
465 (eieio-generic-call-primary-only, eieiomt-add): Instead of using
466 `scoped-class' variable, use new eieio--scoped-class, and
467 eieio--with-scoped-class.
468
469 * emacs-lisp/eieio-base.el (cl-lib): Require during compile.
470
4712013-06-02 Tassilo Horn <tsdh@gnu.org>
472
473 * eshell/esh-ext.el (eshell-external-command): Pass args to
474 `eshell-find-interpreter'.
475 (eshell-find-interpreter): Add new second parameter ARGS.
476
477 * eshell/em-script.el (eshell-script-initialize): Add second arg
478 to the function added as MATCH to `eshell-interpreter-alist'.
479
480 * eshell/em-dirs.el (eshell-dirs-initialize): Add second arg to
481 the function added as MATCH to `eshell-interpreter-alist'.
482
483 * eshell/em-term.el (eshell-visual-subcommands): New defcustom.
484 (eshell-visual-options): New defcustom.
485 (eshell-escape-control-x): Adapt docstring.
486 (eshell-term-initialize): Test `eshell-visual-subcommands' and
487 `eshell-visual-options' in addition to `eshell-visual-commands'.
488 (eshell-exec-visual): Pass args to `eshell-find-interpreter'.
489
4902013-06-01 FabiĂ¡n Ezequiel Gallina <fgallina@gnu.org>
491
492 * progmodes/python.el (python-indent-block-enders): Add break,
493 continue and raise keywords.
494
4952013-06-01 Glenn Morris <rgm@gnu.org>
496
497 * pcmpl-gnu.el (pcomplete/tar): Check obsolete variable is bound.
498
499 Plain (f)boundp silences compilation warnings since Emacs 22.1.
500 * progmodes/cc-cmds.el (delete-forward-p):
501 * progmodes/cc-defs.el (buffer-syntactic-context-depth):
502 * progmodes/cc-engine.el (buffer-syntactic-context):
503 * progmodes/cc-fonts.el (face-property-instance):
504 * progmodes/cc-mode.el (set-keymap-parents):
505 * progmodes/cc-vars.el (get-char-table): No need for cc-bytecomp-defun.
506 * progmodes/cc-defs.el (c-set-region-active, c-beginning-of-defun-1)
507 * progmodes/cc-mode.el (c-make-inherited-keymap): Use plain fboundp.
508 * progmodes/cc-defs.el (zmacs-region-stays, zmacs-regions)
509 (lookup-syntax-properties): Remove unecessary cc-bytecomp-defvar.
510
511 * progmodes/cc-vars.el (other): Emacs has this widget since
512 at least 21.1, so don't (re)define it.
513
514 * eshell/em-cmpl.el (eshell-cmpl-initialize):
515 Replace the obsolete alias pcomplete-arg-quote-list.
516
5172013-06-01 Leo Liu <sdl.web@gmail.com>
518
519 * progmodes/octave.el (octave-mode-syntax-table): Give `.'
520 punctuation syntax.
521 (inferior-octave-minimal-columns)
522 (inferior-octave-last-column-width): New variables.
523 (inferior-octave-track-window-width-change): New function.
524 (inferior-octave-mode): Adjust column width so that Octave output,
525 for example from 'ls', can fit into the window nicely.
526
5272013-05-31 Dmitry Gutov <dgutov@yandex.ru>
528
529 * progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p):
530 Highlight expansions inside regexp literals.
531
5322013-05-31 Glenn Morris <rgm@gnu.org>
533
534 * obsolete/sym-comp.el (symbol-complete):
535 Replace obsolete completion-annotate-function.
536
537 * progmodes/cc-vars.el (c-make-macro-with-semi-re): Silence compiler.
538
5392013-05-31 Dmitry Gutov <dgutov@yandex.ru>
540
541 * progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p):
542 New function, checks if point is inside a literal that allows
543 expression expansion.
544 (ruby-syntax-propertize-expansion): Use it.
545 (ruby-syntax-propertize-function): Bind `case-fold-search' to nil
546 around the body.
547
5482013-05-30 Juri Linkov <juri@jurta.org>
549
550 * isearch.el (isearch-mode-map): Bind `isearch-toggle-invisible'
551 to "\M-si".
552 (isearch-invisible): New variable.
553 (isearch-forward): Doc fix.
554 (isearch-mode): Set `isearch-invisible'
555 to the value of `search-invisible'.
556 (isearch-toggle-case-fold): Doc fix.
557 (isearch-toggle-invisible): New command.
558 (isearch-query-replace): Let-bind `search-invisible'
559 to the value of `isearch-invisible'.
560 (isearch-search): Use `isearch-invisible' instead of
561 `search-invisible'. Let-bind `search-invisible'
562 to the value of `isearch-invisible'. (Bug#11378)
563
5642013-05-30 Juri Linkov <juri@jurta.org>
565
566 * replace.el (perform-replace): Avoid `isearch-range-invisible'
567 call when `query-flag' is nil and `search-invisible' is non-nil.
568 (Bug#11746)
569
5702013-05-30 Glenn Morris <rgm@gnu.org>
571
572 * progmodes/gdb-mi.el (gdb-wait-for-pending): Fix typo.
573
574 * progmodes/cc-bytecomp.el (cc-bytecomp-noruntime-functions): New.
575 (cc-require): Suppress spurious "noruntime" warnings.
576 (cc-require-when-compile): Use fboundp, for sake of compiler.
577
578 * progmodes/cc-mode.el: Move load of cc-vars before that of
579 cc-langs (which in turn loads cc-vars), to quieten compiler.
580
5812013-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
582
583 * paren.el: Simplify the code.
584 (show-paren-mode): Always start the timer.
585 (show-paren--idle-timer): Rename from show-paren-idle-timer.
586 (show-paren--overlay, show-paren--overlay-1): Rename from
587 show-paren-overlay and show-paren-overlay-1, and initialize to an
588 overlay rather than to nil.
589 (show-paren-function): Misc cleanup and simplifications.
590
5912013-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
592
593 * paren.el (show-paren-data-function): New hook.
594 (show-paren--default): New function, extracted from show-paren-function.
595 (show-paren-function): Use show-paren-data-function.
596
5972013-05-30 Glenn Morris <rgm@gnu.org>
598
599 * ielm.el (ielm-map, ielm-complete-symbol):
600 Use completion-at-point rather than obsolete functions.
601 (inferior-emacs-lisp-mode): Doc fix.
602 Set completion-at-point-functions, rather than
603 comint-dynamic-complete-functions.
604
605 * eshell/em-cmpl.el (eshell-complete-lisp-symbol): New function.
606 (eshell-cmpl-initialize, eshell-complete-parse-arguments):
607 Replace obsolete lisp-complete-symbol with eshell-complete-lisp-symbol.
608
609 * image.el (image-animated-p): Tweak definition.
610
611 * net/rlogin.el (rlogin-program, rlogin-explicit-args): Default to ssh.
612 (rlogin-process-connection-type): Tweak default. Add set-after.
613 (rlogin-host): Doc fix.
614 (rlogin): Tweak prompt.
615 (rlogin-tab-or-complete): Use completion-at-point rather than alias.
616
617 * net/net-utils.el (nslookup-mode-map, ftp-mode-map):
618 * progmodes/tcl.el (inferior-tcl-mode-map):
619 Use completion-at-point rather than obsolete alias.
620
621 * emacs-lisp/eieio.el (eieio-eval-default-p): Move before use.
622
623 * minibuffer.el (read-file-name-completion-ignore-case):
624 Move before completion--in-region, for eager macro expansion.
625
6262013-05-29 Juri Linkov <juri@jurta.org>
627
628 * replace.el (occur-engine): Rename `globalcount' to `global-lines'
629 for total count of matching lines. Add `global-matches' for total
630 count of matches. Rename `matches' to `lines' for count of
631 matching lines. Add `matches' for count of matches.
632 Rename `lines' to `curr-line' for line count. Rename `prev-lines'
633 to `prev-line' for line number of prev match endpt.
634 Increment `matches' for every match. Print the number of
635 matching lines in the header.
636 (occur-context-lines): Rename `lines' to `curr-line'.
637 Rename `prev-lines' to `prev-line'. (Bug#14017)
638
6392013-05-29 Juri Linkov <juri@jurta.org>
640
641 * replace.el (perform-replace): Add `skip-read-only-count',
642 `skip-filtered-count', `skip-invisible-count' let-bound to 0.
643 Increment them for corresponding conditions and report the number
644 of skipped occurrences in the final message. (Bug#11746)
645 (query-replace, query-replace-regexp, query-replace-regexp-eval)
646 (replace-string, replace-regexp): Doc fix.
647
6482013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
649
650 * emacs-lisp/trace.el (trace--read-args): Provide a default.
651
652 * emacs-lisp/lisp-mode.el (lisp-mode-shared-map): Inherit from
653 prog-mode-map (bug#14504).
654
6552013-05-29 Leo Liu <sdl.web@gmail.com>
656
657 * progmodes/octave.el (octave-indent-comment): Tweak regexps.
658 (octave-help): Small simplification.
659
660 * emacs-lisp/smie.el (smie-highlight-matching-block): Always turn
661 off the highlight first.
662
6632013-05-29 Glenn Morris <rgm@gnu.org>
664
665 * progmodes/idlwave.el (idlwave-concatenate-rinfo-lists):
666 Handle idlwave-last-system-routine-info-cons-cell being nil.
667
668 * progmodes/idlwave.el (idlwave-scan-user-lib-files)
669 (idlwave-write-paths): Simplify via with-temp-buffer.
670
671 * emulation/cua-gmrk.el: Also load cua-base, cua-rect at run time.
672 * emulation/cua-rect.el: Also load cua-base at run time.
673
674 * progmodes/cperl-mode.el (imenu-choose-buffer-index)
675 (file-of-tag, etags-snarf-tag, etags-goto-tag-location): Declare.
676 (cperl-imenu-on-info): Require imenu.
677
12013-05-28 Alan Mackenzie <acm@muc.de> 6782013-05-28 Alan Mackenzie <acm@muc.de>
2 679
3 Handle "capitalised keywords" correctly. 680 Handle "capitalised keywords" correctly.
4 * progmodes/cc-mode.el (c-after-change): bind case-fold-search to 681 * progmodes/cc-mode.el (c-after-change): Bind case-fold-search to nil.
5 nil.
6 682
72013-05-28 Aidan Gauland <aidalgol@amuri.net> 6832013-05-28 Aidan Gauland <aidalgol@amuri.net>
8 684
9 * eshell/em-unix.el: Added -r option to cp 685 * eshell/em-unix.el: Add -r option to cp.
10 686
112013-05-28 Glenn Morris <rgm@gnu.org> 6872013-05-28 Glenn Morris <rgm@gnu.org>
12 688
@@ -1517,7 +2193,7 @@
1517 2193
1518 * emacs-lisp/syntax.el (syntax-propertize-multiline): 2194 * emacs-lisp/syntax.el (syntax-propertize-multiline):
1519 Use `syntax-multiline' text property consistently instead of 2195 Use `syntax-multiline' text property consistently instead of
1520 `font-lock-multiline'. (bug#14237). 2196 `font-lock-multiline'. (Bug#14237)
1521 2197
15222013-04-26 Glenn Morris <rgm@gnu.org> 21982013-04-26 Glenn Morris <rgm@gnu.org>
1523 2199
@@ -1705,9 +2381,9 @@
1705 2381
17062013-04-21 Xue Fuqiao <xfq.free@gmail.com> 23822013-04-21 Xue Fuqiao <xfq.free@gmail.com>
1707 2383
1708 * comint.el: (comint-dynamic-complete-functions, comint-mode-map): 2384 * comint.el (comint-dynamic-complete-functions, comint-mode-map):
1709 `comint-dynamic-complete' is obsolete since 24.1, replaced by 2385 `comint-dynamic-complete' is obsolete since 24.1, replaced by
1710 `completion-at-point'. (Bug#13774) 2386 `completion-at-point'. (Bug#13774)
1711 2387
1712 * startup.el (normal-no-mouse-startup-screen): Bug fix, the 2388 * startup.el (normal-no-mouse-startup-screen): Bug fix, the
1713 default key binding for `describe-distribution' has been moved to 2389 default key binding for `describe-distribution' has been moved to
@@ -1736,7 +2412,8 @@
1736 2412
1737 * comint.el (comint-redirect-original-filter-function): Remove. 2413 * comint.el (comint-redirect-original-filter-function): Remove.
1738 (comint-redirect-cleanup, comint-redirect-send-command-to-process): 2414 (comint-redirect-cleanup, comint-redirect-send-command-to-process):
1739 * vc/vc-cvs.el (vc-cvs-annotate-process-filter,vc-cvs-annotate-command): 2415 * vc/vc-cvs.el (vc-cvs-annotate-process-filter)
2416 (vc-cvs-annotate-command):
1740 * progmodes/octave-inf.el (inferior-octave-send-list-and-digest): 2417 * progmodes/octave-inf.el (inferior-octave-send-list-and-digest):
1741 * progmodes/prolog.el (prolog-consult-compile): 2418 * progmodes/prolog.el (prolog-consult-compile):
1742 * progmodes/gdb-mi.el (gdb, gdb--check-interpreter): 2419 * progmodes/gdb-mi.el (gdb, gdb--check-interpreter):
@@ -2177,9 +2854,8 @@
2177 2854
21782013-04-03 Alan Mackenzie <acm@muc.de> 28552013-04-03 Alan Mackenzie <acm@muc.de>
2179 2856
2180 Handle `parse-partial-sexp' landing inside a comment opener 2857 Handle `parse-partial-sexp' landing inside a comment opener (Bug#13244).
2181 (Bug#13244). Also adapt to the new values of element 7 of a parse 2858 Also adapt to the new values of element 7 of a parse state.
2182 state.
2183 2859
2184 * progmodes/cc-engine.el (c-state-pp-to-literal): New optional 2860 * progmodes/cc-engine.el (c-state-pp-to-literal): New optional
2185 parameter `not-in-delimiter'. Handle being inside comment opener. 2861 parameter `not-in-delimiter'. Handle being inside comment opener.
@@ -2815,7 +3491,7 @@
28152013-03-08 Jambunathan K <kjambunathan@gmail.com> 34912013-03-08 Jambunathan K <kjambunathan@gmail.com>
2816 3492
2817 * hi-lock.el (hi-lock-read-regexp-defaults-function): New var. 3493 * hi-lock.el (hi-lock-read-regexp-defaults-function): New var.
2818 (hi-lock-read-regexp-defaults): New defun. 3494 (hi-lock-read-regexp-defaults): New defun.
2819 (hi-lock-line-face-buffer, hi-lock-face-buffer) 3495 (hi-lock-line-face-buffer, hi-lock-face-buffer)
2820 (hi-lock-face-phrase-buffer): Propagate above change. 3496 (hi-lock-face-phrase-buffer): Propagate above change.
2821 Update docstring (bug#13892). 3497 Update docstring (bug#13892).
@@ -2871,7 +3547,7 @@
2871 3547
2872 Correct the position of point in some line-up functions. 3548 Correct the position of point in some line-up functions.
2873 * progmodes/cc-align.el (c-lineup-whitesmith-in-block) 3549 * progmodes/cc-align.el (c-lineup-whitesmith-in-block)
2874 (c-lineup-assignments, c-lineup-gcc-asm-reg ): take position of 3550 (c-lineup-assignments, c-lineup-gcc-asm-reg ): Take position of
2875 point at column 0 rather than at a random place in the line. 3551 point at column 0 rather than at a random place in the line.
2876 3552
28772013-03-05 Michael Albinus <michael.albinus@gmx.de> 35532013-03-05 Michael Albinus <michael.albinus@gmx.de>
@@ -4406,7 +5082,7 @@
44062013-01-12 Eli Zaretskii <eliz@gnu.org> 50822013-01-12 Eli Zaretskii <eliz@gnu.org>
4407 5083
4408 * autorevert.el (auto-revert-notify-handler): Fix filtering of 5084 * autorevert.el (auto-revert-notify-handler): Fix filtering of
4409 file notification by ACTION. For filtering by file name, compare 5085 file notification by ACTION. For filtering by file name, compare
4410 only the non-directory part of the file name. 5086 only the non-directory part of the file name.
4411 5087
44122013-01-12 Stefan Monnier <monnier@iro.umontreal.ca> 50882013-01-12 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -4489,7 +5165,7 @@
44892013-01-11 Julien Danjou <julien@danjou.info> 51652013-01-11 Julien Danjou <julien@danjou.info>
4490 5166
4491 * color.el (color-rgb-to-hsv): Fix conversion computing in case min and 5167 * color.el (color-rgb-to-hsv): Fix conversion computing in case min and
4492 max are almost equal. Also return the correct value for V which is 5168 max are almost equal. Also return the correct value for V which is
4493 already between 0 and 1. 5169 already between 0 and 1.
4494 5170
44952013-01-11 Dmitry Antipov <dmantipov@yandex.ru> 51712013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
@@ -4943,7 +5619,7 @@
49432012-12-31 JĂ¼rgen Hötzel <juergen@archlinux.org> 56192012-12-31 JĂ¼rgen Hötzel <juergen@archlinux.org>
4944 5620
4945 * net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors 5621 * net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
4946 (No device connected, invalid device name). (Bug #13299) 5622 (No device connected, invalid device name). (Bug #13299)
4947 5623
49482012-12-31 Martin Rudalics <rudalics@gmx.at> 56242012-12-31 Martin Rudalics <rudalics@gmx.at>
4949 5625
@@ -5328,7 +6004,7 @@
5328 6004
53292012-12-14 Paul Eggert <eggert@cs.ucla.edu> 60052012-12-14 Paul Eggert <eggert@cs.ucla.edu>
5330 6006
5331 Fix permissions bugs with setgid directories etc. (Bug#13125) 6007 Fix permissions bugs with setgid directories etc. (Bug#13125)
5332 * files.el (backup-buffer): Don't rely on 9th output of 6008 * files.el (backup-buffer): Don't rely on 9th output of
5333 file-attributes, as it's now a placeholder. Instead, use the new 6009 file-attributes, as it's now a placeholder. Instead, use the new
5334 optional arg of file-ownership-preserved-p. 6010 optional arg of file-ownership-preserved-p.
@@ -5786,7 +6462,7 @@
5786 * textmodes/ispell.el (ispell-init-process) 6462 * textmodes/ispell.el (ispell-init-process)
5787 (ispell-start-process, ispell-internal-change-dictionary): 6463 (ispell-start-process, ispell-internal-change-dictionary):
5788 Make sure personal dictionary name is expanded after initial 6464 Make sure personal dictionary name is expanded after initial
5789 `default-directory' value. Use expanded strings for 6465 `default-directory' value. Use expanded strings for
5790 keep/restart checks and for value (Bug#13019). 6466 keep/restart checks and for value (Bug#13019).
5791 6467
57922012-12-03 Jay Belanger <jay.p.belanger@gmail.com> 64682012-12-03 Jay Belanger <jay.p.belanger@gmail.com>
@@ -6468,7 +7144,7 @@
6468 7144
6469 * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1): 7145 * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1):
6470 Don't signal an error with a score that is too low to add to the 7146 Don't signal an error with a score that is too low to add to the
6471 list of top scores. (Bug#12779) 7147 list of top scores. (Bug#12779)
6472 7148
64732012-11-17 Chong Yidong <cyd@gnu.org> 71492012-11-17 Chong Yidong <cyd@gnu.org>
6474 7150
@@ -6537,7 +7213,7 @@
6537 7213
6538 * window.el (record-window-buffer) 7214 * window.el (record-window-buffer)
6539 (display-buffer-record-window): When copying the markers to 7215 (display-buffer-record-window): When copying the markers to
6540 window-point preserve window-point-insertion-type. (Bug#12588) 7216 window-point preserve window-point-insertion-type. (Bug#12588)
6541 7217
65422012-11-16 Glenn Morris <rgm@gnu.org> 72182012-11-16 Glenn Morris <rgm@gnu.org>
6543 7219
@@ -6625,8 +7301,8 @@
6625 (ad-advice-definition): Redefine as functions. 7301 (ad-advice-definition): Redefine as functions.
6626 (ad-advice-classes): Move before first use. 7302 (ad-advice-classes): Move before first use.
6627 (ad-make-origname, ad-set-orig-definition, ad-clear-orig-definition) 7303 (ad-make-origname, ad-set-orig-definition, ad-clear-orig-definition)
6628 (ad-make-mapped-call, ad-make-advised-docstring,ad-make-plain-docstring) 7304 (ad-make-mapped-call, ad-make-advised-docstring)
6629 (ad--defalias-fset): Remove functions. 7305 (ad-make-plain-docstring, ad--defalias-fset): Remove functions.
6630 (ad-make-advicefunname, ad-clear-advicefunname-definition): New funs. 7306 (ad-make-advicefunname, ad-clear-advicefunname-definition): New funs.
6631 (ad-get-orig-definition): Rewrite. 7307 (ad-get-orig-definition): Rewrite.
6632 (ad-make-advised-definition-docstring): Change base docstring. 7308 (ad-make-advised-definition-docstring): Change base docstring.
@@ -6878,7 +7554,7 @@
6878 7554
68792012-11-09 Vincent BelaĂ¯che <vincentb1@users.sourceforge.net> 75552012-11-09 Vincent BelaĂ¯che <vincentb1@users.sourceforge.net>
6880 7556
6881 * ses.el: symbol to coordinate mapping is made by symbol property 7557 * ses.el: Symbol to coordinate mapping is made by symbol property
6882 `ses-cell'. This means that the same mapping is done for all SES 7558 `ses-cell'. This means that the same mapping is done for all SES
6883 sheets. That is good enough for cells with standard A1 names, but 7559 sheets. That is good enough for cells with standard A1 names, but
6884 not for named cell. So a hash map is added for the latter. 7560 not for named cell. So a hash map is added for the latter.
@@ -6974,7 +7650,7 @@
6974 buffer and calls `ispell-buffer' with debugging enabled. 7650 buffer and calls `ispell-buffer' with debugging enabled.
6975 7651
6976 * textmodes/ispell.el (ispell-region): Do not prefix sent string by 7652 * textmodes/ispell.el (ispell-region): Do not prefix sent string by
6977 comment in autoconf mode. (Bug#12768) 7653 comment in autoconf mode. (Bug#12768)
6978 7654
69792012-11-06 Dmitry Antipov <dmantipov@yandex.ru> 76552012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
6980 7656
@@ -8119,13 +8795,13 @@
8119 8795
8120 * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure 8796 * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure
8121 that entries with whitespace at various places are found. 8797 that entries with whitespace at various places are found.
8122 Doc fix. Include entries that are cross-referenced from cited entries. 8798 Doc fix. Include entries that are cross-referenced from cited entries.
8123 Include @String definitions in the resulting bib file. Add header 8799 Include @String definitions in the resulting bib file. Add header
8124 and footer defined in `reftex-create-bibtex-header' and 8800 and footer defined in `reftex-create-bibtex-header' and
8125 `reftex-create-bibtex-footer'. 8801 `reftex-create-bibtex-footer'.
8126 (reftex-do-citation): Make it possible again to insert 8802 (reftex-do-citation): Make it possible again to insert
8127 non-existent entries. Save match data when asking for optional 8803 non-existent entries. Save match data when asking for optional
8128 arguments. Return all keys, not just the first one. 8804 arguments. Return all keys, not just the first one.
8129 (reftex-all-used-citation-keys): Fix regexp to correctly extract 8805 (reftex-all-used-citation-keys): Fix regexp to correctly extract
8130 all citations in the same line. 8806 all citations in the same line.
8131 (reftex-parse-bibtex-entry): Accept additional optional argument 8807 (reftex-parse-bibtex-entry): Accept additional optional argument
@@ -8185,7 +8861,7 @@
8185 8861
8186 * textmodes/reftex-sel.el 8862 * textmodes/reftex-sel.el
8187 (reftex-select-cycle-ref-style-internal): Adapt to new structure 8863 (reftex-select-cycle-ref-style-internal): Adapt to new structure
8188 of `reftex-ref-style-alist'. Remove code for testing macro type. 8864 of `reftex-ref-style-alist'. Remove code for testing macro type.
8189 (reftex-select-toggle-varioref) 8865 (reftex-select-toggle-varioref)
8190 (reftex-select-toggle-fancyref): Remove. 8866 (reftex-select-toggle-fancyref): Remove.
8191 (reftex-select-cycle-ref-style-internal) 8867 (reftex-select-cycle-ref-style-internal)
@@ -8727,7 +9403,7 @@
8727 9403
8728 * textmodes/bibtex.el (bibtex-autokey-transcriptions): 9404 * textmodes/bibtex.el (bibtex-autokey-transcriptions):
8729 Transcribe also LaTeX hyphenation. 9405 Transcribe also LaTeX hyphenation.
8730 (bibtex-reformat): Bug fix. Do not quote twice the elements of 9406 (bibtex-reformat): Bug fix. Do not quote twice the elements of
8731 bibtex-reformat-previous-options. 9407 bibtex-reformat-previous-options.
8732 9408
87332012-09-23 Roland Winkler <winkler@gnu.org> 94092012-09-23 Roland Winkler <winkler@gnu.org>
@@ -10813,7 +11489,7 @@
10813 * progmodes/python.el (python-shell-send-setup-max-wait): Delete var. 11489 * progmodes/python.el (python-shell-send-setup-max-wait): Delete var.
10814 (python-shell-make-comint): accept-process-output at startup. 11490 (python-shell-make-comint): accept-process-output at startup.
10815 (run-python-internal): Set inferior-python-mode-hook to nil. 11491 (run-python-internal): Set inferior-python-mode-hook to nil.
10816 (python-shell-internal-get-or-create-process): call sit-for. 11492 (python-shell-internal-get-or-create-process): Call sit-for.
10817 (python-preoutput-result): Add obsolete alias. 11493 (python-preoutput-result): Add obsolete alias.
10818 (python-shell-internal-send-string): Use it. 11494 (python-shell-internal-send-string): Use it.
10819 (python-shell-send-setup-code): Remove call to 11495 (python-shell-send-setup-code): Remove call to
@@ -11005,7 +11681,7 @@
110052012-07-27 FabiĂ¡n Ezequiel Gallina <fgallina@cuca> 116812012-07-27 FabiĂ¡n Ezequiel Gallina <fgallina@cuca>
11006 11682
11007 Consistent completion in inferior python with emacs -nw. 11683 Consistent completion in inferior python with emacs -nw.
11008 * progmodes/python.el (inferior-python-mode): replace "<tab>" 11684 * progmodes/python.el (inferior-python-mode): Replace "<tab>"
11009 binding in inferior-python-mode-map with "\t". 11685 binding in inferior-python-mode-map with "\t".
11010 (python-shell-completion-complete-at-point) 11686 (python-shell-completion-complete-at-point)
11011 (python-completion-complete-at-point): Remove interactive spec. 11687 (python-completion-complete-at-point): Remove interactive spec.
@@ -11754,7 +12430,7 @@
11754 (xml-name-start-char-re, xml-name-char-re, xml-name-re) 12430 (xml-name-start-char-re, xml-name-char-re, xml-name-re)
11755 (xml-names-re, xml-nmtoken-re, xml-nmtokens-re, xml-char-ref-re) 12431 (xml-names-re, xml-nmtoken-re, xml-nmtokens-re, xml-char-ref-re)
11756 (xml-entity-ref, xml-pe-reference-re) 12432 (xml-entity-ref, xml-pe-reference-re)
11757 (xml-reference-re,xml-att-value-re, xml-tokenized-type-re) 12433 (xml-reference-re, xml-att-value-re, xml-tokenized-type-re)
11758 (xml-notation-type-re, xml-enumeration-re, xml-enumerated-type-re) 12434 (xml-notation-type-re, xml-enumeration-re, xml-enumerated-type-re)
11759 (xml-att-type-re, xml-default-decl-re, xml-att-def-re) 12435 (xml-att-type-re, xml-default-decl-re, xml-att-def-re)
11760 (xml-entity-value-re): Use syntax references in regexps where 12436 (xml-entity-value-re): Use syntax references in regexps where
@@ -18569,8 +19245,8 @@
18569 19245
18570 * progmodes/verilog-mode.el (verilog-read-defines): Fix reading 19246 * progmodes/verilog-mode.el (verilog-read-defines): Fix reading
18571 parameters with embedded comments. Reported by Ray Stevens. 19247 parameters with embedded comments. Reported by Ray Stevens.
18572 (verilog-calc-1, verilog-fork-wait-re) (verilog-forward-sexp, 19248 (verilog-calc-1, verilog-fork-wait-re, verilog-forward-sexp)
18573 verilog-wait-fork-re): Fix indentation of "wait fork", bug407. 19249 (verilog-wait-fork-re): Fix indentation of "wait fork", bug407.
18574 Reported by Tim Holt. 19250 Reported by Tim Holt.
18575 (verilog-auto): Fix AUTOing a upper module then AUTOing module 19251 (verilog-auto): Fix AUTOing a upper module then AUTOing module
18576 instantiated by upper module causing wrong expansion until AUTOed a 19252 instantiated by upper module causing wrong expansion until AUTOed a
@@ -20139,7 +20815,7 @@
20139 20815
201402011-10-07 Chong Yidong <cyd@stupidchicken.com> 208162011-10-07 Chong Yidong <cyd@stupidchicken.com>
20141 20817
20142 * bindings.el ([M-left],[M-right]): Bind to left-word and 20818 * bindings.el ([M-left], [M-right]): Bind to left-word and
20143 right-word respectively. 20819 right-word respectively.
20144 20820
201452011-10-07 Glenn Morris <rgm@gnu.org> 208212011-10-07 Glenn Morris <rgm@gnu.org>
@@ -25461,15 +26137,15 @@
254612011-05-10 Jim Meyering <meyering@redhat.com> 261372011-05-10 Jim Meyering <meyering@redhat.com>
25462 26138
25463 Fix doubled-word typos. 26139 Fix doubled-word typos.
25464 * international/quail.el (quail-insert-kbd-layout): and and -> and 26140 * international/quail.el (quail-insert-kbd-layout): and and -> and.
25465 * kermit.el: and and -> and 26141 * kermit.el: and and -> and.
25466 * net/ldap.el (ldap-search-internal): to to -> to 26142 * net/ldap.el (ldap-search-internal): to to -> to.
25467 * progmodes/vhdl-mode.el (vhdl-offsets-alist): Likewise. 26143 * progmodes/vhdl-mode.el (vhdl-offsets-alist): Likewise.
25468 * progmodes/js.el (js-mode): and and -> and 26144 * progmodes/js.el (js-mode): and and -> and.
25469 * textmodes/artist.el (artist-move-to-xy): at at -> at 26145 * textmodes/artist.el (artist-move-to-xy): at at -> at.
25470 (artist-draw-region-trim-line-endings): if if -> if 26146 (artist-draw-region-trim-line-endings): if if -> if.
25471 And Safetyc -> Safety. 26147 And Safetyc -> Safety.
25472 * textmodes/reftex-dcr.el (reftex-view-crossref): at at -> at a 26148 * textmodes/reftex-dcr.el (reftex-view-crossref): at at -> at a.
25473 26149
254742011-05-10 Glenn Morris <rgm@gnu.org> 261502011-05-10 Glenn Morris <rgm@gnu.org>
25475 Stefan Monnier <monnier@iro.umontreal.ca> 26151 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/lisp/ChangeLog.2 b/lisp/ChangeLog.2
index 3832f342d6f..fddc98a612d 100644
--- a/lisp/ChangeLog.2
+++ b/lisp/ChangeLog.2
@@ -777,7 +777,7 @@
777 777
7781987-12-21 Richard Stallman (rms@frosted-flakes) 7781987-12-21 Richard Stallman (rms@frosted-flakes)
779 779
780 * window.el (split-widow-{vertically,horizontally}): 780 * window.el (split-window-{vertically,horizontally}):
781 Make the arg optional. 781 Make the arg optional.
782 782
7831987-12-09 Richard Stallman (rms@frosted-flakes) 7831987-12-09 Richard Stallman (rms@frosted-flakes)
@@ -1392,7 +1392,7 @@
1392 * shell.el: Minor doc fixes. 1392 * shell.el: Minor doc fixes.
1393 1393
1394 * rmail.el (rmail-get-new-mail): 1394 * rmail.el (rmail-get-new-mail):
1395 Handle errors competently. (Don't attempt to 1395 Handle errors competently. (Don't attempt to
1396 handle them, rather than botching the job) 1396 handle them, rather than botching the job)
1397 1397
1398 * rmail.el (rmail-insert-inbox-text): 1398 * rmail.el (rmail-insert-inbox-text):
@@ -3032,7 +3032,7 @@
3032 3032
3033 Rename "kill" -> "delete" for both function-names and documentation. 3033 Rename "kill" -> "delete" for both function-names and documentation.
3034 3034
3035 Define C-d as Buffer-menu-delete-backwards. (also in ebuff-menu) 3035 Define C-d as Buffer-menu-delete-backwards (also in ebuff-menu).
3036 3036
3037 Save space: Merge buffer-menu-{execute,do-saves,do-kills}. 3037 Save space: Merge buffer-menu-{execute,do-saves,do-kills}.
3038 3038
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 4884213daeb..61449b66c9b 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -209,8 +209,9 @@ update-authors:
209 $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir) 209 $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir)
210 210
211TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) 211TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
212 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \ 212 rm -f $@; touch $@; \
213 ${ETAGS} -o $@ $$els 213 echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,," | \
214 xargs $(XARGS_LIMIT) ${ETAGS} -a -o $@
214 215
215# The src/Makefile.in has its own set of dependencies and when they decide 216# The src/Makefile.in has its own set of dependencies and when they decide
216# that one Lisp file needs to be re-compiled, we had better recompile it as 217# that one Lisp file needs to be re-compiled, we had better recompile it as
diff --git a/lisp/allout.el b/lisp/allout.el
index 5a9b03b7a0e..1e4134b3ccf 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -1561,7 +1561,7 @@ Each value can be a regexp or a list with a regexp followed by a
1561substitution string. If it's just a regexp, all its matches are removed 1561substitution string. If it's just a regexp, all its matches are removed
1562before the text is encrypted. If it's a regexp and a substitution, the 1562before the text is encrypted. If it's a regexp and a substitution, the
1563substitution is used against the regexp matches, a la `replace-match'.") 1563substitution is used against the regexp matches, a la `replace-match'.")
1564(make-variable-buffer-local 'allout-encryption-text-removal-regexps) 1564(make-variable-buffer-local 'allout-encryption-plaintext-sanitization-regexps)
1565;;;_ = allout-encryption-ciphertext-rejection-regexps 1565;;;_ = allout-encryption-ciphertext-rejection-regexps
1566(defvar allout-encryption-ciphertext-rejection-regexps nil 1566(defvar allout-encryption-ciphertext-rejection-regexps nil
1567 "Variable for regexps matching plaintext to remove before encryption. 1567 "Variable for regexps matching plaintext to remove before encryption.
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index a2ce6017b21..4a6d4cb4cc0 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -271,7 +271,7 @@ This variable becomes buffer local when set in any fashion.")
271 :version "24.4") 271 :version "24.4")
272 272
273(defconst auto-revert-notify-enabled 273(defconst auto-revert-notify-enabled
274 (or (featurep 'inotify) (featurep 'w32notify)) 274 (or (featurep 'gfilenotify) (featurep 'inotify) (featurep 'w32notify))
275 "Non-nil when Emacs has been compiled with file notification support.") 275 "Non-nil when Emacs has been compiled with file notification support.")
276 276
277(defcustom auto-revert-use-notify auto-revert-notify-enabled 277(defcustom auto-revert-use-notify auto-revert-notify-enabled
@@ -502,9 +502,12 @@ will use an up-to-date value of `auto-revert-interval'"
502 (puthash key value auto-revert-notify-watch-descriptor-hash-list) 502 (puthash key value auto-revert-notify-watch-descriptor-hash-list)
503 (remhash key auto-revert-notify-watch-descriptor-hash-list) 503 (remhash key auto-revert-notify-watch-descriptor-hash-list)
504 (ignore-errors 504 (ignore-errors
505 (funcall (if (fboundp 'inotify-rm-watch) 505 (funcall
506 'inotify-rm-watch 'w32notify-rm-watch) 506 (cond
507 auto-revert-notify-watch-descriptor))))) 507 ((fboundp 'gfile-rm-watch) 'gfile-rm-watch)
508 ((fboundp 'inotify-rm-watch) 'inotify-rm-watch)
509 ((fboundp 'w32notify-rm-watch) 'w32notify-rm-watch))
510 auto-revert-notify-watch-descriptor)))))
508 auto-revert-notify-watch-descriptor-hash-list) 511 auto-revert-notify-watch-descriptor-hash-list)
509 (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch)) 512 (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch))
510 (setq auto-revert-notify-watch-descriptor nil 513 (setq auto-revert-notify-watch-descriptor nil
@@ -519,12 +522,18 @@ will use an up-to-date value of `auto-revert-interval'"
519 522
520 (when (and buffer-file-name auto-revert-use-notify 523 (when (and buffer-file-name auto-revert-use-notify
521 (not auto-revert-notify-watch-descriptor)) 524 (not auto-revert-notify-watch-descriptor))
522 (let ((func (if (fboundp 'inotify-add-watch) 525 (let ((func
523 'inotify-add-watch 'w32notify-add-watch)) 526 (cond
524 ;; `attrib' is needed for file modification time. 527 ((fboundp 'gfile-add-watch) 'gfile-add-watch)
525 (aspect (if (fboundp 'inotify-add-watch) 528 ((fboundp 'inotify-add-watch) 'inotify-add-watch)
526 '(attrib create modify moved-to) '(size last-write-time))) 529 ((fboundp 'w32notify-add-watch) 'w32notify-add-watch)))
527 (file (if (fboundp 'inotify-add-watch) 530 (aspect
531 (cond
532 ((fboundp 'gfile-add-watch) '(watch-mounts))
533 ;; `attrib' is needed for file modification time.
534 ((fboundp 'inotify-add-watch) '(attrib create modify moved-to))
535 ((fboundp 'w32notify-add-watch) '(size last-write-time))))
536 (file (if (or (fboundp 'gfile-add-watch) (fboundp 'inotify-add-watch))
528 (directory-file-name (expand-file-name default-directory)) 537 (directory-file-name (expand-file-name default-directory))
529 (buffer-file-name)))) 538 (buffer-file-name))))
530 (setq auto-revert-notify-watch-descriptor 539 (setq auto-revert-notify-watch-descriptor
@@ -545,10 +554,13 @@ will use an up-to-date value of `auto-revert-interval'"
545 554
546(defun auto-revert-notify-event-p (event) 555(defun auto-revert-notify-event-p (event)
547 "Check that event is a file notification event." 556 "Check that event is a file notification event."
548 (cond ((featurep 'inotify) 557 (and (listp event)
549 (and (listp event) (= (length event) 4))) 558 (cond ((featurep 'gfilenotify)
550 ((featurep 'w32notify) 559 (and (>= (length event) 3) (stringp (nth 2 event))))
551 (and (listp event) (= (length event) 3) (stringp (nth 2 event)))))) 560 ((featurep 'inotify)
561 (= (length event) 4))
562 ((featurep 'w32notify)
563 (and (= (length event) 3) (stringp (nth 2 event)))))))
552 564
553(defun auto-revert-notify-event-descriptor (event) 565(defun auto-revert-notify-event-descriptor (event)
554 "Return watch descriptor of file notification event, or nil." 566 "Return watch descriptor of file notification event, or nil."
@@ -561,11 +573,12 @@ will use an up-to-date value of `auto-revert-interval'"
561(defun auto-revert-notify-event-file-name (event) 573(defun auto-revert-notify-event-file-name (event)
562 "Return file name of file notification event, or nil." 574 "Return file name of file notification event, or nil."
563 (and (auto-revert-notify-event-p event) 575 (and (auto-revert-notify-event-p event)
564 (cond ((featurep 'inotify) (nth 3 event)) 576 (cond ((featurep 'gfilenotify) (nth 2 event))
577 ((featurep 'inotify) (nth 3 event))
565 ((featurep 'w32notify) (nth 2 event))))) 578 ((featurep 'w32notify) (nth 2 event)))))
566 579
567(defun auto-revert-notify-handler (event) 580(defun auto-revert-notify-handler (event)
568 "Handle an event returned from file notification." 581 "Handle an EVENT returned from file notification."
569 (when (auto-revert-notify-event-p event) 582 (when (auto-revert-notify-event-p event)
570 (let* ((descriptor (auto-revert-notify-event-descriptor event)) 583 (let* ((descriptor (auto-revert-notify-event-descriptor event))
571 (action (auto-revert-notify-event-action event)) 584 (action (auto-revert-notify-event-action event))
@@ -576,12 +589,20 @@ will use an up-to-date value of `auto-revert-interval'"
576 ;; Check, that event is meant for us. 589 ;; Check, that event is meant for us.
577 ;; TODO: Filter events which stop watching, like `move' or `removed'. 590 ;; TODO: Filter events which stop watching, like `move' or `removed'.
578 (cl-assert descriptor) 591 (cl-assert descriptor)
579 (when (featurep 'inotify) 592 (cond
593 ((featurep 'gfilenotify)
594 (cl-assert (memq action '(attribute-changed changed created deleted
595 ;; FIXME: I keep getting this action, so I
596 ;; added it here, but I have no idea what
597 ;; I'm doing. --Stef
598 changes-done-hint))
599 t))
600 ((featurep 'inotify)
580 (cl-assert (or (memq 'attrib action) 601 (cl-assert (or (memq 'attrib action)
581 (memq 'create action) 602 (memq 'create action)
582 (memq 'modify action) 603 (memq 'modify action)
583 (memq 'moved-to action)))) 604 (memq 'moved-to action))))
584 (when (featurep 'w32notify) (cl-assert (eq 'modified action))) 605 ((featurep 'w32notify) (cl-assert (eq 'modified action))))
585 ;; Since we watch a directory, a file name must be returned. 606 ;; Since we watch a directory, a file name must be returned.
586 (cl-assert (stringp file)) 607 (cl-assert (stringp file))
587 (dolist (buffer buffers) 608 (dolist (buffer buffers)
diff --git a/lisp/bindings.el b/lisp/bindings.el
index fe0eabb77af..2013c079820 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -894,6 +894,7 @@ if `inhibit-field-text-motion' is non-nil."
894(define-key search-map "hr" 'highlight-regexp) 894(define-key search-map "hr" 'highlight-regexp)
895(define-key search-map "hp" 'highlight-phrase) 895(define-key search-map "hp" 'highlight-phrase)
896(define-key search-map "hl" 'highlight-lines-matching-regexp) 896(define-key search-map "hl" 'highlight-lines-matching-regexp)
897(define-key search-map "h." 'highlight-symbol-at-point)
897(define-key search-map "hu" 'unhighlight-regexp) 898(define-key search-map "hu" 'unhighlight-regexp)
898(define-key search-map "hf" 'hi-lock-find-patterns) 899(define-key search-map "hf" 'hi-lock-find-patterns)
899(define-key search-map "hw" 'hi-lock-write-interactive-patterns) 900(define-key search-map "hw" 'hi-lock-write-interactive-patterns)
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 25f966362ce..98548a919d5 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,96 @@
12013-06-02 Eric Ludlam <zappo@gnu.org>
2
3 * semantic/edit.el (semantic-change-function): Use
4 `save-match-data' around running hooks.
5
6 * semantic/decorate/mode.el
7 (semantic-decorate-style-predicate-default)
8 (semantic-decorate-style-highlighter-default): New.
9 (semantic-decoration-mode): Do not require
10 `semantic/decorate/include' anymore.
11 (semantic-toggle-decoration-style): Error if an unknown decoration
12 style is toggled.
13 (define-semantic-decoration-style): Add new :load option. When
14 :load is specified, add autoload tokens for the definition
15 functions so that code is loaded when the mode is used.
16 (semantic-decoration-on-includes): New autoload definition for
17 highlighting includes.
18
19 * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc
20 characters to appear after the tested variable.
21
22 * semantic/ede-grammar.el (project-compile-target): Calculate full
23 src name via ede-expand-filename instead of the crutch of the
24 current buffer. Enables this target to compile in batch mode.
25
26 * semantic/idle.el
27 (semantic-idle-symbol-maybe-highlight): Wrap highlighting of
28 remote symbol with `save-excursion'.
29 (semantic-idle-scheduler-work-parse-neighboring-files): Instead of
30 using directory-files on each found mode pattern, collect all the
31 patterns for the current mode, and then for each file, see if it
32 matches any of them. If it does, parse the file. (Patch
33 inspiration from Tomasz Gajewski.)
34
35 * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
36 (semantic-ctxt-current-symbol-default): New.
37
38 * semantic/bovine/el.el (semantic-default-elisp-setup): Add
39 autoload cookie. Explain existence.
40 (footer): Add local variable for loaddefs.
41
42 * semantic/db.el (semanticdb-file-table-object): Add new filter,
43 only checking for regular files too.
44
45 * semantic/wisent/python.el
46 (semantic-format-tag-abbreviate): New override. Cuts back on size
47 of code tags.
48
49 * srecode/compile.el (srecode-compile-templates): Fix warning
50 punctuation. Remove status messages to clean up testing output
51
52 * ede/base.el (ede-project-placeholder-cache-file): Update doc to
53 mention 'nil' value.
54 (ede-save-cache): Disable cache save if file is nil.
55
56 * ede.el (ede-initialize-state-current-buffer): Flush deleted
57 projects.
58 (global-ede-mode): Always append our find-file-hook to the end.
59 (ede-flush-deleted-projects): New command.
60
61 * ede/cpp-root.el (ede-preprocessor-map): Protect against init
62 problems.
63
64 * ede/proj.el (ede-proj-target): Added a new "custom" option for
65 custom symbols representing a compiler or linker instead of
66 restricting things to only the predefined compilers and linkers.
67
682013-06-02 David Engster <dengste@eml.cc>
69
70 * semantic.el (semantic-mode-map): To avoid showing showing
71 Development menu twice, only disable menu item if menu-bar is
72 actually enabled, otherwise the popup 'global menu' might display
73 a disabled Development menu.
74
75 * srecode/srt-wy.el: Regenerate.
76
772013-06-02 Pete Beardmore <elbeardmorez@msn.com>
78
79 * semantic/complete.el
80 (semantic-displayor-show-request): Fix which slot in obj is set to
81 the max tags.
82
832013-06-01 Glenn Morris <rgm@gnu.org>
84
85 * semantic/grammar.el (semantic-grammar-complete):
86 Replace the obsolete function lisp-complete-symbol.
87
88 * semantic/analyze/fcn.el (semantic-tag-similar-p): Autoload.
89
90 * srecode/args.el, srecode/java.el: Require ede.
91
92 * semantic/lex.el (semantic-lex-make-type-table): Fix transposed args.
93
12013-05-24 Glenn Morris <rgm@gnu.org> 942013-05-24 Glenn Morris <rgm@gnu.org>
2 95
3 * semantic/bovine/grammar.el (bovine-make-parsers): 96 * semantic/bovine/grammar.el (bovine-make-parsers):
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 5fecd8b994f..3483d541122 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -494,6 +494,11 @@ provided `global-ede-mode' is enabled."
494(defun ede-initialize-state-current-buffer () 494(defun ede-initialize-state-current-buffer ()
495 "Initialize the current buffer's state for EDE. 495 "Initialize the current buffer's state for EDE.
496Sets buffer local variables for EDE." 496Sets buffer local variables for EDE."
497 ;; due to inode recycling, make sure we don't
498 ;; we flush projects deleted off the system.
499 (ede-flush-deleted-projects)
500
501 ;; Init the buffer.
497 (let* ((ROOT nil) 502 (let* ((ROOT nil)
498 (proj (ede-directory-get-open-project default-directory 503 (proj (ede-directory-get-open-project default-directory
499 'ROOT)) 504 'ROOT))
@@ -569,7 +574,9 @@ an EDE controlled project."
569 (add-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p) 574 (add-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p)
570 (add-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil) 575 (add-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil)
571 (add-hook 'ecb-source-path-functions 'ede-ecb-project-paths) 576 (add-hook 'ecb-source-path-functions 'ede-ecb-project-paths)
572 (add-hook 'find-file-hook 'ede-turn-on-hook) 577 ;; Append our hook to the end. This allows mode-local to finish
578 ;; it's stuff before we start doing misc file loads, etc.
579 (add-hook 'find-file-hook 'ede-turn-on-hook t)
573 (add-hook 'dired-mode-hook 'ede-turn-on-hook) 580 (add-hook 'dired-mode-hook 'ede-turn-on-hook)
574 (add-hook 'kill-emacs-hook 'ede-save-cache) 581 (add-hook 'kill-emacs-hook 'ede-save-cache)
575 (ede-load-cache) 582 (ede-load-cache)
@@ -1057,6 +1064,18 @@ On success, return the added project."
1057 (add-to-list 'ede-projects proj) 1064 (add-to-list 'ede-projects proj)
1058 proj) 1065 proj)
1059 1066
1067(defun ede-flush-deleted-projects ()
1068 "Scan the projects list for projects which no longer exist.
1069Flush the dead projects from the project cache."
1070 (interactive)
1071 (let ((dead nil))
1072 (dolist (P ede-projects)
1073 (when (not (file-exists-p (oref P :file)))
1074 (add-to-list 'dead P)))
1075 (dolist (D dead)
1076 (setq ede-projects (remove D ede-projects)))
1077 ))
1078
1060(defun ede-load-project-file (dir &optional rootreturn) 1079(defun ede-load-project-file (dir &optional rootreturn)
1061 "Project file independent way to read a project in from DIR. 1080 "Project file independent way to read a project in from DIR.
1062Optional ROOTRETURN will return the root project for DIR." 1081Optional ROOTRETURN will return the root project for DIR."
diff --git a/lisp/cedet/ede/base.el b/lisp/cedet/ede/base.el
index 5302ac3207a..a94ce8f1868 100644
--- a/lisp/cedet/ede/base.el
+++ b/lisp/cedet/ede/base.el
@@ -306,7 +306,8 @@ All specific project types must derive from this project."
306;; 306;;
307(defcustom ede-project-placeholder-cache-file 307(defcustom ede-project-placeholder-cache-file
308 (locate-user-emacs-file "ede-projects.el" ".projects.ede") 308 (locate-user-emacs-file "ede-projects.el" ".projects.ede")
309 "File containing the list of projects EDE has viewed." 309 "File containing the list of projects EDE has viewed.
310If set to nil, then the cache is not saved."
310 :group 'ede 311 :group 'ede
311 :type 'file) 312 :type 'file)
312 313
@@ -316,38 +317,39 @@ All specific project types must derive from this project."
316(defun ede-save-cache () 317(defun ede-save-cache ()
317 "Save a cache of EDE objects that Emacs has seen before." 318 "Save a cache of EDE objects that Emacs has seen before."
318 (interactive) 319 (interactive)
319 (let ((p ede-projects) 320 (when ede-project-placeholder-cache-file
320 (c ede-project-cache-files) 321 (let ((p ede-projects)
321 (recentf-exclude '( (lambda (f) t) )) 322 (c ede-project-cache-files)
322 ) 323 (recentf-exclude '( (lambda (f) t) ))
323 (condition-case nil
324 (progn
325 (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
326 (erase-buffer)
327 (insert ";; EDE project cache file.
328;; This contains a list of projects you have visited.\n(")
329 (while p
330 (when (and (car p) (ede-project-p p))
331 (let ((f (oref (car p) file)))
332 (when (file-exists-p f)
333 (insert "\n \"" f "\""))))
334 (setq p (cdr p)))
335 (while c
336 (insert "\n \"" (car c) "\"")
337 (setq c (cdr c)))
338 (insert "\n)\n")
339 (condition-case nil
340 (save-buffer 0)
341 (error
342 (message "File %s could not be saved."
343 ede-project-placeholder-cache-file)))
344 (kill-buffer (current-buffer))
345 ) 324 )
346 (error 325 (condition-case nil
347 (message "File %s could not be read." 326 (progn
348 ede-project-placeholder-cache-file)) 327 (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
349 328 (erase-buffer)
350 ))) 329 (insert ";; EDE project cache file.
330;; This contains a list of projects you have visited.\n(")
331 (while p
332 (when (and (car p) (ede-project-p p))
333 (let ((f (oref (car p) file)))
334 (when (file-exists-p f)
335 (insert "\n \"" f "\""))))
336 (setq p (cdr p)))
337 (while c
338 (insert "\n \"" (car c) "\"")
339 (setq c (cdr c)))
340 (insert "\n)\n")
341 (condition-case nil
342 (save-buffer 0)
343 (error
344 (message "File %s could not be saved."
345 ede-project-placeholder-cache-file)))
346 (kill-buffer (current-buffer))
347 )
348 (error
349 (message "File %s could not be read."
350 ede-project-placeholder-cache-file))
351
352 ))))
351 353
352(defun ede-load-cache () 354(defun ede-load-cache ()
353 "Load the cache of EDE projects." 355 "Load the cache of EDE projects."
diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el
index 47ba16ade7f..719289765a3 100644
--- a/lisp/cedet/ede/cpp-root.el
+++ b/lisp/cedet/ede/cpp-root.el
@@ -507,7 +507,10 @@ This is for project include paths and spp source files."
507 (lambda (F) 507 (lambda (F)
508 (let* ((expfile (ede-expand-filename root F)) 508 (let* ((expfile (ede-expand-filename root F))
509 (table (when expfile 509 (table (when expfile
510 (semanticdb-file-table-object expfile))) 510 ;; Disable EDE init on preprocessor file load
511 ;; otherwise we recurse, cause errs, etc.
512 (let ((ede-constructing t))
513 (semanticdb-file-table-object expfile))))
511 ) 514 )
512 (cond 515 (cond
513 ((not (file-exists-p expfile)) 516 ((not (file-exists-p expfile))
diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el
index 702e35f0b1f..99a5978b005 100644
--- a/lisp/cedet/ede/proj.el
+++ b/lisp/cedet/ede/proj.el
@@ -104,6 +104,7 @@ distributed, and each should have a corresponding rule to build it.")
104 :initform nil 104 :initform nil
105 :type (or null symbol) 105 :type (or null symbol)
106 :custom (choice (const :tag "None" nil) 106 :custom (choice (const :tag "None" nil)
107 (symbol :tag "Custom Compiler Symbol")
107 :slotofchoices availablecompilers) 108 :slotofchoices availablecompilers)
108 :label "Compiler for building sources" 109 :label "Compiler for building sources"
109 :group make 110 :group make
@@ -116,6 +117,7 @@ of these compiler resources, and global customization thereof.")
116 :initform nil 117 :initform nil
117 :type (or null symbol) 118 :type (or null symbol)
118 :custom (choice (const :tag "None" nil) 119 :custom (choice (const :tag "None" nil)
120 (symbol :tag "Custom Linker Symbol")
119 :slotofchoices availablelinkers) 121 :slotofchoices availablelinkers)
120 :label "Linker for combining intermediate object files." 122 :label "Linker for combining intermediate object files."
121 :group make 123 :group make
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index 3c93a8794b1..909902a71fe 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -899,7 +899,8 @@ Throw away all the old tags, and recreate the tag database."
899 ;; and Semantic are both enabled. Is there a better way? 899 ;; and Semantic are both enabled. Is there a better way?
900 (define-key map [menu-bar cedet-menu] 900 (define-key map [menu-bar cedet-menu]
901 (list 'menu-item "Development" cedet-menu-map 901 (list 'menu-item "Development" cedet-menu-map
902 :enable (quote (not (bound-and-true-p global-ede-mode))))) 902 :enable (quote (not (and menu-bar-mode
903 (bound-and-true-p global-ede-mode))))))
903 ;; (define-key km "-" 'senator-fold-tag) 904 ;; (define-key km "-" 'senator-fold-tag)
904 ;; (define-key km "+" 'senator-unfold-tag) 905 ;; (define-key km "+" 'senator-unfold-tag)
905 map)) 906 map))
diff --git a/lisp/cedet/semantic/analyze/fcn.el b/lisp/cedet/semantic/analyze/fcn.el
index 42bc482a1df..4300c89c9df 100644
--- a/lisp/cedet/semantic/analyze/fcn.el
+++ b/lisp/cedet/semantic/analyze/fcn.el
@@ -245,6 +245,8 @@ used by the analyzer debugger."
245 (semantic-scope-set-typecache scope nil) 245 (semantic-scope-set-typecache scope nil)
246 ))))) 246 )))))
247 247
248(autoload 'semantic-tag-similar-p "semantic/tag-ls")
249
248(defun semantic-analyze-dereference-metatype-stack (type scope &optional type-declaration) 250(defun semantic-analyze-dereference-metatype-stack (type scope &optional type-declaration)
249 "Dereference metatypes repeatedly until we hit a real TYPE. 251 "Dereference metatypes repeatedly until we hit a real TYPE.
250Uses `semantic-analyze-dereference-metatype'. 252Uses `semantic-analyze-dereference-metatype'.
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index 2f8cf08af3e..3c991ea8555 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -529,7 +529,7 @@ code to parse."
529(define-lex-regex-analyzer semantic-lex-c-ifdef 529(define-lex-regex-analyzer semantic-lex-c-ifdef
530 "Code blocks wrapped up in #ifdef. 530 "Code blocks wrapped up in #ifdef.
531Uses known macro tables in SPP to determine what block to skip." 531Uses known macro tables in SPP to determine what block to skip."
532 "^\\s-*#\\s-*\\(ifndef\\|ifdef\\)\\s-+\\(\\(\\sw\\|\\s_\\)+\\)$" 532 "^\\s-*#\\s-*\\(ifndef\\|ifdef\\)\\s-+\\(\\(\\sw\\|\\s_\\)+\\)\\([ \t\C-m].*\\)?$"
533 (semantic-c-do-lex-ifdef)) 533 (semantic-c-do-lex-ifdef))
534 534
535(defun semantic-c-do-lex-ifdef () 535(defun semantic-c-do-lex-ifdef ()
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index a8ddbe106f7..07e0e08bbaf 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -940,8 +940,11 @@ ELisp variables can be pretty long, so track this one too.")
940(define-child-mode lisp-mode emacs-lisp-mode 940(define-child-mode lisp-mode emacs-lisp-mode
941 "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'.") 941 "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'.")
942 942
943;;;###autoload
943(defun semantic-default-elisp-setup () 944(defun semantic-default-elisp-setup ()
944 "Setup hook function for Emacs Lisp files and Semantic." 945 "Setup hook function for Emacs Lisp files and Semantic."
946 ;; This is here mostly to get this file loaded when a .el file is
947 ;; loaded into Emacs.
945 ) 948 )
946 949
947(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup) 950(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup)
@@ -960,6 +963,12 @@ ELisp variables can be pretty long, so track this one too.")
960 '(require 'semantic/db-el) 963 '(require 'semantic/db-el)
961 ) 964 )
962 965
966
963(provide 'semantic/bovine/el) 967(provide 'semantic/bovine/el)
964 968
969;; Local variables:
970;; generated-autoload-file: "../loaddefs.el"
971;; generated-autoload-load-name: "semantic/bovine/el"
972;; End:
973
965;;; semantic/bovine/el.el ends here 974;;; semantic/bovine/el.el ends here
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index 6c2b97a677a..b42e24fb9c0 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -1667,7 +1667,7 @@ Display mechanism using tooltip for a list of possible completions.")
1667 (setq msg "..."))) 1667 (setq msg "...")))
1668 ((eq mode 'verbose) 1668 ((eq mode 'verbose)
1669 ;; Always show extended match set. 1669 ;; Always show extended match set.
1670 (oset obj max-tags semantic-displayor-tooltip-max-tags) 1670 (oset obj max-tags-initial semantic-displayor-tooltip-max-tags)
1671 (setq max-tags semantic-displayor-tooltip-max-tags))) 1671 (setq max-tags semantic-displayor-tooltip-max-tags)))
1672 (unless msg 1672 (unless msg
1673 (oset obj shown t) 1673 (oset obj shown t)
diff --git a/lisp/cedet/semantic/ctxt.el b/lisp/cedet/semantic/ctxt.el
index 2c0b428c195..629bbdee561 100644
--- a/lisp/cedet/semantic/ctxt.el
+++ b/lisp/cedet/semantic/ctxt.el
@@ -357,6 +357,87 @@ beginning and end of a command."
357 (def-edebug-spec semantic-with-buffer-narrowed-to-command 357 (def-edebug-spec semantic-with-buffer-narrowed-to-command
358 (def-body)))) 358 (def-body))))
359 359
360(define-overloadable-function semantic-ctxt-end-of-symbol (&optional point)
361 "Move point to the end of the current symbol under POINT.
362This skips forward over symbols in a complex reference.
363For example, in the C statement:
364 this.that().entry;
365
366If the cursor is on 'this', will move point to the ; after entry.")
367
368(defun semantic-ctxt-end-of-symbol-default (&optional point)
369 "Move point to the end of the current symbol under POINT.
370This will move past type/field names when applicable.
371Depends on `semantic-type-relation-separator-character', and will
372work on C like languages."
373 (if point (goto-char point))
374 (let* ((fieldsep1 (mapconcat (lambda (a) (regexp-quote a))
375 semantic-type-relation-separator-character
376 "\\|"))
377 ;; NOTE: The [ \n] expression below should used \\s-, but that
378 ;; doesn't work in C since \n means end-of-comment, and isn't
379 ;; really whitespace.
380 (fieldsep (concat "[ \t\n\r]*\\(" fieldsep1 "\\)[ \t\n\r]*\\(\\w\\|\\s_\\)"))
381 (case-fold-search semantic-case-fold)
382 (continuesearch t)
383 (end nil)
384 )
385 (with-syntax-table semantic-lex-syntax-table
386 (cond ((looking-at "\\w\\|\\s_")
387 ;; In the middle of a symbol, move to the end.
388 (forward-sexp 1))
389 ((looking-at fieldsep1)
390 ;; We are in a fine spot.. do nothing.
391 nil
392 )
393 ((save-excursion
394 (and (condition-case nil
395 (progn (forward-sexp -1)
396 (forward-sexp 1)
397 t)
398 (error nil))
399 (looking-at fieldsep1)))
400 (setq symlist (list ""))
401 (forward-sexp -1)
402 ;; Skip array expressions.
403 (while (looking-at "\\s(") (forward-sexp -1))
404 (forward-sexp 1))
405 )
406 ;; Set the current end marker.
407 (setq end (point))
408
409 ;; Cursor is at the safe end of some symbol. Look until we
410 ;; find the logical end of this current complex symbol.
411 (condition-case nil
412 (while continuesearch
413 ;; If there are functional arguments, arrays, etc, skip them.
414 (when (looking-at "\\s(")
415 (forward-sexp 1))
416
417 ;; If there is a field separator, then skip that, plus
418 ;; the next expected symbol.
419 (if (not (looking-at fieldsep1))
420 ;; We hit the end.
421 (error nil)
422
423 ;; Skip the separator and the symbol.
424 (goto-char (match-end 0))
425
426 (if (looking-at "\\w\\|\\s_")
427 ;; Skip symbols
428 (forward-sexp 1)
429 ;; No symbol, exit the search...
430 (setq continuesearch nil))
431
432 (setq end (point)))
433
434 ;; Cont...
435 )
436
437 ;; Restore position if we go to far....
438 (error (goto-char end)) )
439
440 )))
360 441
361(define-overloadable-function semantic-ctxt-current-symbol (&optional point) 442(define-overloadable-function semantic-ctxt-current-symbol (&optional point)
362 "Return the current symbol the cursor is on at POINT in a list. 443 "Return the current symbol the cursor is on at POINT in a list.
@@ -391,7 +472,7 @@ Depends on `semantic-type-relation-separator-character'."
391 ;; In the middle of a symbol, move to the end. 472 ;; In the middle of a symbol, move to the end.
392 (forward-sexp 1)) 473 (forward-sexp 1))
393 ((looking-at fieldsep1) 474 ((looking-at fieldsep1)
394 ;; We are in a find spot.. do nothing. 475 ;; We are in a fine spot.. do nothing.
395 nil 476 nil
396 ) 477 )
397 ((save-excursion 478 ((save-excursion
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index e8784c4f85c..8d9cfcccd7d 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -899,7 +899,7 @@ If file does not have tags available, and DONTLOAD is nil,
899then load the tags for FILE, and create a new table object for it. 899then load the tags for FILE, and create a new table object for it.
900DONTLOAD does not affect the creation of new database objects." 900DONTLOAD does not affect the creation of new database objects."
901 ;; (message "Object Translate: %s" file) 901 ;; (message "Object Translate: %s" file)
902 (when (and file (file-exists-p file)) 902 (when (and file (file-exists-p file) (file-regular-p file))
903 (let* ((default-directory (file-name-directory file)) 903 (let* ((default-directory (file-name-directory file))
904 (tab (semanticdb-file-table-object-from-hash file)) 904 (tab (semanticdb-file-table-object-from-hash file))
905 (fullfile nil)) 905 (fullfile nil))
diff --git a/lisp/cedet/semantic/decorate/mode.el b/lisp/cedet/semantic/decorate/mode.el
index fc791f52da1..a4aa535eb1a 100644
--- a/lisp/cedet/semantic/decorate/mode.el
+++ b/lisp/cedet/semantic/decorate/mode.el
@@ -64,6 +64,14 @@ add items to this list."
64 "Return the STYLE's highlighter function." 64 "Return the STYLE's highlighter function."
65 (intern (format "%s-highlight" style))) 65 (intern (format "%s-highlight" style)))
66 66
67(defsubst semantic-decorate-style-predicate-default (style)
68 "Return the STYLE's predicate function."
69 (intern (format "%s-p-default" style)))
70
71(defsubst semantic-decorate-style-highlighter-default (style)
72 "Return the STYLE's highlighter function."
73 (intern (format "%s-highlight-default" style)))
74
67;;; Base decoration API 75;;; Base decoration API
68;; 76;;
69(defsubst semantic-decoration-p (object) 77(defsubst semantic-decoration-p (object)
@@ -265,8 +273,6 @@ minor mode is enabled."
265 (semantic-make-local-hook 'semantic-after-toplevel-cache-change-hook) 273 (semantic-make-local-hook 'semantic-after-toplevel-cache-change-hook)
266 (add-hook 'semantic-after-toplevel-cache-change-hook 274 (add-hook 'semantic-after-toplevel-cache-change-hook
267 'semantic-decorate-tags-after-full-reparse nil t) 275 'semantic-decorate-tags-after-full-reparse nil t)
268 ;; Decorate includes by default
269 (require 'semantic/decorate/include)
270 ;; Add decorations to available tags. The above hooks ensure 276 ;; Add decorations to available tags. The above hooks ensure
271 ;; that new tags will be decorated when they become available. 277 ;; that new tags will be decorated when they become available.
272 (semantic-decorate-add-decorations (semantic-fetch-available-tags))) 278 (semantic-decorate-add-decorations (semantic-fetch-available-tags)))
@@ -325,6 +331,8 @@ Return non-nil if the decoration style is enabled."
325 (flag (if arg 331 (flag (if arg
326 (> (prefix-numeric-value arg) 0) 332 (> (prefix-numeric-value arg) 0)
327 (not (cdr style))))) 333 (not (cdr style)))))
334 (when (null style)
335 (error "Unknown decoration style %s" name))
328 (unless (eq (cdr style) flag) 336 (unless (eq (cdr style) flag)
329 ;; Store the new flag. 337 ;; Store the new flag.
330 (setcdr style flag) 338 (setcdr style flag)
@@ -368,7 +376,8 @@ DOC is a documentation string describing the decoration style NAME.
368It is appended to auto-generated doc strings. 376It is appended to auto-generated doc strings.
369An Optional list of FLAGS can also be specified. Flags are: 377An Optional list of FLAGS can also be specified. Flags are:
370 :enabled <value> - specify the default enabled value for NAME. 378 :enabled <value> - specify the default enabled value for NAME.
371 379 :load <value> - specify a feature (as a string) with the rest of
380 the definition for decoration mode NAME.
372 381
373This defines two new overload functions respectively called `NAME-p' 382This defines two new overload functions respectively called `NAME-p'
374and `NAME-highlight', for which you must provide a default 383and `NAME-highlight', for which you must provide a default
@@ -386,9 +395,14 @@ To add other kind of decorations on a tag, `NAME-highlight' must use
386decoration API found in this library." 395decoration API found in this library."
387 (let ((predicate (semantic-decorate-style-predicate name)) 396 (let ((predicate (semantic-decorate-style-predicate name))
388 (highlighter (semantic-decorate-style-highlighter name)) 397 (highlighter (semantic-decorate-style-highlighter name))
398 (predicatedef (semantic-decorate-style-predicate-default name))
399 (highlighterdef (semantic-decorate-style-highlighter-default name))
389 (defaultenable (if (plist-member flags :enabled) 400 (defaultenable (if (plist-member flags :enabled)
390 (plist-get flags :enabled) 401 (plist-get flags :enabled)
391 t)) 402 t))
403 (loadfile (if (plist-member flags :load)
404 (plist-get flags :load)
405 nil))
392 ) 406 )
393 `(progn 407 `(progn
394 ;; Clear the menu cache so that new items are added when 408 ;; Clear the menu cache so that new items are added when
@@ -408,7 +422,19 @@ decoration API found in this library."
408 (add-to-list 'semantic-decoration-styles 422 (add-to-list 'semantic-decoration-styles
409 (cons ',(symbol-name name) 423 (cons ',(symbol-name name)
410 ,defaultenable)) 424 ,defaultenable))
411 ))) 425 ;; If there is a load file, then create the autoload tokens for
426 ;; those functions to load the token, but only if the fsym
427 ;; doesn't exist yet.
428 (when (stringp ,loadfile)
429 (unless (fboundp ',predicatedef)
430 (autoload ',predicatedef ',loadfile "Return non-nil to decorate TAG."
431 nil 'function))
432
433 (unless (fboundp ',highlighterdef)
434 (autoload ',highlighterdef ',loadfile "Decorate TAG."
435 nil 'function))
436 ))
437 ))
412 438
413;;; Predefined decoration styles 439;;; Predefined decoration styles
414;; 440;;
@@ -514,6 +540,16 @@ Use a primary decoration."
514 (semantic-set-tag-face 540 (semantic-set-tag-face
515 tag 'semantic-decoration-on-protected-members-face)) 541 tag 'semantic-decoration-on-protected-members-face))
516 542
543;;; Decoration Modes in other files
544;;
545(define-semantic-decoration-style semantic-decoration-on-includes
546 "Highlight class members that are includes.
547This mode provides a nice context menu on the include statements."
548 :enabled t
549 :load "semantic/decorate/include")
550
551
552
517(provide 'semantic/decorate/mode) 553(provide 'semantic/decorate/mode)
518 554
519;; Local variables: 555;; Local variables:
diff --git a/lisp/cedet/semantic/ede-grammar.el b/lisp/cedet/semantic/ede-grammar.el
index cb2a1faaac0..17859e232a3 100644
--- a/lisp/cedet/semantic/ede-grammar.el
+++ b/lisp/cedet/semantic/ede-grammar.el
@@ -146,7 +146,7 @@ Lays claim to all -by.el, and -wy.el files."
146 (let* ((package (semantic-grammar-create-package)) 146 (let* ((package (semantic-grammar-create-package))
147 (fname (progn (string-match ".*/\\(.+\\.el\\)" package) 147 (fname (progn (string-match ".*/\\(.+\\.el\\)" package)
148 (match-string 1 package))) 148 (match-string 1 package)))
149 (src (with-current-buffer fname (buffer-file-name))) 149 (src (ede-expand-filename obj fname))
150 (csrc (concat (file-name-sans-extension src) ".elc"))) 150 (csrc (concat (file-name-sans-extension src) ".elc")))
151 (if (< emacs-major-version 24) 151 (if (< emacs-major-version 24)
152 ;; Does not have `byte-recompile-file' 152 ;; Does not have `byte-recompile-file'
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index b0540af373d..a27eab5404c 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -141,8 +141,9 @@ Argument START, END, and LENGTH specify the bounds of the change."
141 (setq semantic-unmatched-syntax-cache-check t) 141 (setq semantic-unmatched-syntax-cache-check t)
142 (let ((inhibit-point-motion-hooks t) 142 (let ((inhibit-point-motion-hooks t)
143 ) 143 )
144 (run-hook-with-args 'semantic-change-functions start end length) 144 (save-match-data
145 )) 145 (run-hook-with-args 'semantic-change-functions start end length)
146 )))
146 147
147(defun semantic-changes-in-region (start end &optional buffer) 148(defun semantic-changes-in-region (start end &optional buffer)
148 "Find change overlays which exist in whole or in part between START and END. 149 "Find change overlays which exist in whole or in part between START and END.
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 2d53c857c1e..ce658cd5d54 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1484,7 +1484,10 @@ expression then Lisp symbols are completed."
1484 (interactive) 1484 (interactive)
1485 (if (semantic-grammar-in-lisp-p) 1485 (if (semantic-grammar-in-lisp-p)
1486 ;; We are in lisp code. Do lisp completion. 1486 ;; We are in lisp code. Do lisp completion.
1487 (lisp-complete-symbol) 1487 (let ((completion-at-point-functions
1488 (append '(lisp-completion-at-point)
1489 completion-at-point-functions)))
1490 (completion-at-point))
1488 ;; We are not in lisp code. Do rule completion. 1491 ;; We are not in lisp code. Do rule completion.
1489 (let* ((nonterms (semantic-find-tags-by-class 'nonterminal (current-buffer))) 1492 (let* ((nonterms (semantic-find-tags-by-class 'nonterminal (current-buffer)))
1490 (sym (car (semantic-ctxt-current-symbol))) 1493 (sym (car (semantic-ctxt-current-symbol)))
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 9899ab974f7..6c223c2b9f2 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -434,16 +434,27 @@ datasets."
434 434
435(defun semantic-idle-scheduler-work-parse-neighboring-files () 435(defun semantic-idle-scheduler-work-parse-neighboring-files ()
436 "Parse all the files in similar directories to buffers being edited." 436 "Parse all the files in similar directories to buffers being edited."
437 ;; Let's check to see if EDE matters. 437 ;; Let's tell EDE to ignore all the files we're about to load
438 (let ((ede-auto-add-method 'never)) 438 (let ((ede-auto-add-method 'never)
439 (dolist (a auto-mode-alist) 439 (matching-auto-mode-patterns nil))
440 (when (eq (cdr a) major-mode) 440 ;; Collect all patterns matching files of the same mode we edit.
441 (dolist (file (directory-files default-directory t (car a) t)) 441 (mapc (lambda (pat) (and (eq (cdr pat) major-mode)
442 (semantic-throw-on-input 'parsing-mode-buffers) 442 (push (car pat) matching-auto-mode-patterns)))
443 (save-excursion 443 auto-mode-alist)
444 (semanticdb-file-table-object file) 444 ;; Loop over all files, and if one matches our mode, we force its
445 )))) 445 ;; table to load.
446 )) 446 (dolist (file (directory-files default-directory t ".*" t))
447 (catch 'found
448 (mapc (lambda (pat)
449 (semantic-throw-on-input 'parsing-mode-buffers)
450 ;; We use string-match instead of passing the pattern
451 ;; into directory files, because some patterns don't
452 ;; work with directory files.
453 (and (string-match pat file)
454 (save-excursion
455 (semanticdb-file-table-object file))
456 (throw 'found t)))
457 matching-auto-mode-patterns)))))
447 458
448 459
449;;; REPARSING 460;;; REPARSING
@@ -840,17 +851,18 @@ visible, then highlight it."
840 ) 851 )
841 (cond ((semantic-overlay-p region) 852 (cond ((semantic-overlay-p region)
842 (with-current-buffer (semantic-overlay-buffer region) 853 (with-current-buffer (semantic-overlay-buffer region)
843 (goto-char (semantic-overlay-start region)) 854 (save-excursion
844 (when (pos-visible-in-window-p 855 (goto-char (semantic-overlay-start region))
845 (point) (get-buffer-window (current-buffer) 'visible)) 856 (when (pos-visible-in-window-p
846 (if (< (semantic-overlay-end region) (point-at-eol)) 857 (point) (get-buffer-window (current-buffer) 'visible))
847 (pulse-momentary-highlight-overlay 858 (if (< (semantic-overlay-end region) (point-at-eol))
848 region semantic-idle-symbol-highlight-face) 859 (pulse-momentary-highlight-overlay
849 ;; Not the same 860 region semantic-idle-symbol-highlight-face)
850 (pulse-momentary-highlight-region 861 ;; Not the same
851 (semantic-overlay-start region) 862 (pulse-momentary-highlight-region
852 (point-at-eol) 863 (semantic-overlay-start region)
853 semantic-idle-symbol-highlight-face))) 864 (point-at-eol)
865 semantic-idle-symbol-highlight-face))))
854 )) 866 ))
855 ((vectorp region) 867 ((vectorp region)
856 (let ((start (aref region 0)) 868 (let ((start (aref region 0))
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el
index ba862479be5..feead78985c 100644
--- a/lisp/cedet/semantic/lex.el
+++ b/lisp/cedet/semantic/lex.el
@@ -437,7 +437,7 @@ PROPSPECS must be a list of (TYPE PROPERTY VALUE)."
437 (if default 437 (if default
438 (message 438 (message
439 "*Warning* default value of <%s> tokens changed to %S, was %S" 439 "*Warning* default value of <%s> tokens changed to %S, was %S"
440 type default token)) 440 type token default))
441 (setq default token))) 441 (setq default token)))
442 ;; Ensure the default matching spec is the first one. 442 ;; Ensure the default matching spec is the first one.
443 (semantic-lex-type-set type (cons default (nreverse alist)))) 443 (semantic-lex-type-set type (cons default (nreverse alist))))
diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el
index 8ca398ef271..719868f7635 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -485,6 +485,20 @@ Return a list as per `semantic-ctxt-current-symbol'.
485Return nil if there is nothing relevant." 485Return nil if there is nothing relevant."
486 nil) 486 nil)
487 487
488;;; Tag Formatting
489;;
490(define-mode-local-override semantic-format-tag-abbreviate python-mode (tag &optional parent color)
491 "Format an abbreviated tag for python.
492Shortens 'code' tags, but passes through for others."
493 (cond ((semantic-tag-of-class-p tag 'code)
494 ;; Just take the first line.
495 (let ((name (semantic-tag-name tag)))
496 (when (string-match "\n" name)
497 (setq name (substring name 0 (match-beginning 0))))
498 name))
499 (t
500 (semantic-format-tag-abbreviate-default tag parent color))))
501
488;;; Enable Semantic in `python-mode'. 502;;; Enable Semantic in `python-mode'.
489;; 503;;
490 504
diff --git a/lisp/cedet/srecode/args.el b/lisp/cedet/srecode/args.el
index d6798f7523d..6bc78295fa7 100644
--- a/lisp/cedet/srecode/args.el
+++ b/lisp/cedet/srecode/args.el
@@ -26,6 +26,7 @@
26;; a set of simple arguments for srecode templates. 26;; a set of simple arguments for srecode templates.
27 27
28(require 'srecode/dictionary) 28(require 'srecode/dictionary)
29(require 'ede)
29 30
30;;; Code: 31;;; Code:
31 32
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 0d68036c433..542fd49f8e5 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -200,10 +200,11 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
200 "Compile a semantic recode template file into a mode-local variable." 200 "Compile a semantic recode template file into a mode-local variable."
201 (interactive) 201 (interactive)
202 (unless (semantic-active-p) 202 (unless (semantic-active-p)
203 (error "You have to activate semantic-mode to compile SRecode templates.")) 203 (error "You have to activate semantic-mode to compile SRecode templates"))
204 (require 'srecode/insert) 204 (require 'srecode/insert)
205 (message "Compiling template %s..." 205 (when (called-interactively-p 'interactive)
206 (file-name-nondirectory (buffer-file-name))) 206 (message "Compiling template %s..."
207 (file-name-nondirectory (buffer-file-name))))
207 (let ((tags (semantic-fetch-tags)) 208 (let ((tags (semantic-fetch-tags))
208 (tag nil) 209 (tag nil)
209 (class nil) 210 (class nil)
@@ -288,10 +289,11 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
288 ) 289 )
289 ;; Continue 290 ;; Continue
290 (setq tags (cdr tags))) 291 (setq tags (cdr tags)))
291 292
292 ;; MSG - Before install since nreverse whacks our list. 293 ;; MSG - Before install since nreverse whacks our list.
293 (message "%d templates compiled for %s" 294 (when (called-interactively-p 'interactive)
294 (length table) mode) 295 (message "%d templates compiled for %s"
296 (length table) mode))
295 297
296 ;; 298 ;;
297 ;; APPLY TO MODE 299 ;; APPLY TO MODE
@@ -316,12 +318,14 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
316 (if (stringp project) 318 (if (stringp project)
317 (setq priority (+ 50 defaultdelta)) 319 (setq priority (+ 50 defaultdelta))
318 (setq priority (+ 80 defaultdelta)))) 320 (setq priority (+ 80 defaultdelta))))
319 (message "Templates %s has estimated priority of %d" 321 (when (called-interactively-p 'interactive)
320 (file-name-nondirectory (buffer-file-name)) 322 (message "Templates %s has estimated priority of %d"
321 priority)) 323 (file-name-nondirectory (buffer-file-name))
322 (message "Compiling templates %s priority %d... done!" 324 priority)))
323 (file-name-nondirectory (buffer-file-name)) 325 (when (called-interactively-p 'interactive)
324 priority)) 326 (message "Compiling templates %s priority %d... done!"
327 (file-name-nondirectory (buffer-file-name))
328 priority)))
325 329
326 ;; Save it up! 330 ;; Save it up!
327 (srecode-compile-template-table table mode priority application framework project vars) 331 (srecode-compile-template-table table mode priority application framework project vars)
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el
index 29a8465c45c..1b8922c2746 100644
--- a/lisp/cedet/srecode/java.el
+++ b/lisp/cedet/srecode/java.el
@@ -27,6 +27,7 @@
27 27
28(require 'srecode/dictionary) 28(require 'srecode/dictionary)
29(require 'semantic/find) 29(require 'semantic/find)
30(require 'ede)
30 31
31;;;###autoload 32;;;###autoload
32(defun srecode-semantic-handle-:java (dict) 33(defun srecode-semantic-handle-:java (dict)
diff --git a/lisp/cedet/srecode/srt-wy.el b/lisp/cedet/srecode/srt-wy.el
index 5560d35a70c..450f57d943c 100644
--- a/lisp/cedet/srecode/srt-wy.el
+++ b/lisp/cedet/srecode/srt-wy.el
@@ -131,6 +131,10 @@
131 ((SET symbol insertable-string-list newline) 131 ((SET symbol insertable-string-list newline)
132 (wisent-raw-tag 132 (wisent-raw-tag
133 (semantic-tag-new-variable $2 nil $3))) 133 (semantic-tag-new-variable $2 nil $3)))
134 ((SET symbol number newline)
135 (wisent-raw-tag
136 (semantic-tag-new-variable $2 nil
137 (list $3))))
134 ((SHOW symbol newline) 138 ((SHOW symbol newline)
135 (wisent-raw-tag 139 (wisent-raw-tag
136 (semantic-tag-new-variable $2 nil t)))) 140 (semantic-tag-new-variable $2 nil t))))
@@ -290,8 +294,8 @@ It ignores whitespace, newlines and comments."
290 srecode-template-separator-block 294 srecode-template-separator-block
291 srecode-template-wy--<keyword>-keyword-analyzer 295 srecode-template-wy--<keyword>-keyword-analyzer
292 srecode-template-property-analyzer 296 srecode-template-property-analyzer
293 srecode-template-wy--<symbol>-regexp-analyzer
294 srecode-template-wy--<number>-regexp-analyzer 297 srecode-template-wy--<number>-regexp-analyzer
298 srecode-template-wy--<symbol>-regexp-analyzer
295 srecode-template-wy--<string>-sexp-analyzer 299 srecode-template-wy--<string>-sexp-analyzer
296 srecode-template-wy--<punctuation>-string-analyzer 300 srecode-template-wy--<punctuation>-string-analyzer
297 semantic-lex-default-action 301 semantic-lex-default-action
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c910acdbc14..e603f76f41d 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -411,6 +411,9 @@ specify different fields to sort on."
411(defvar byte-compile-bound-variables nil 411(defvar byte-compile-bound-variables nil
412 "List of dynamic variables bound in the context of the current form. 412 "List of dynamic variables bound in the context of the current form.
413This list lives partly on the stack.") 413This list lives partly on the stack.")
414(defvar byte-compile-lexical-variables nil
415 "List of variables that have been treated as lexical.
416Filled in `cconv-analyse-form' but initialized and consulted here.")
414(defvar byte-compile-const-variables nil 417(defvar byte-compile-const-variables nil
415 "List of variables declared as constants during compilation of this file.") 418 "List of variables declared as constants during compilation of this file.")
416(defvar byte-compile-free-references) 419(defvar byte-compile-free-references)
@@ -1489,6 +1492,7 @@ extra args."
1489 (byte-compile--outbuffer nil) 1492 (byte-compile--outbuffer nil)
1490 (byte-compile-function-environment nil) 1493 (byte-compile-function-environment nil)
1491 (byte-compile-bound-variables nil) 1494 (byte-compile-bound-variables nil)
1495 (byte-compile-lexical-variables nil)
1492 (byte-compile-const-variables nil) 1496 (byte-compile-const-variables nil)
1493 (byte-compile-free-references nil) 1497 (byte-compile-free-references nil)
1494 (byte-compile-free-assignments nil) 1498 (byte-compile-free-assignments nil)
@@ -2245,15 +2249,24 @@ list that represents a doc string reference.
2245 2249
2246(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar) 2250(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar)
2247(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar) 2251(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar)
2248(defun byte-compile-file-form-defvar (form) 2252
2249 (when (and (symbolp (nth 1 form)) 2253(defun byte-compile--declare-var (sym)
2250 (not (string-match "[-*/:$]" (symbol-name (nth 1 form)))) 2254 (when (and (symbolp sym)
2255 (not (string-match "[-*/:$]" (symbol-name sym)))
2251 (byte-compile-warning-enabled-p 'lexical)) 2256 (byte-compile-warning-enabled-p 'lexical))
2252 (byte-compile-warn "global/dynamic var `%s' lacks a prefix" 2257 (byte-compile-warn "global/dynamic var `%s' lacks a prefix"
2253 (nth 1 form))) 2258 sym))
2254 (push (nth 1 form) byte-compile-bound-variables) 2259 (when (memq sym byte-compile-lexical-variables)
2255 (if (eq (car form) 'defconst) 2260 (setq byte-compile-lexical-variables
2256 (push (nth 1 form) byte-compile-const-variables)) 2261 (delq sym byte-compile-lexical-variables))
2262 (byte-compile-warn "Variable `%S' declared after its first use" sym))
2263 (push sym byte-compile-bound-variables))
2264
2265(defun byte-compile-file-form-defvar (form)
2266 (let ((sym (nth 1 form)))
2267 (byte-compile--declare-var sym)
2268 (if (eq (car form) 'defconst)
2269 (push sym byte-compile-const-variables)))
2257 (if (and (null (cddr form)) ;No `value' provided. 2270 (if (and (null (cddr form)) ;No `value' provided.
2258 (eq (car form) 'defvar)) ;Just a declaration. 2271 (eq (car form) 'defvar)) ;Just a declaration.
2259 nil 2272 nil
@@ -2267,7 +2280,7 @@ list that represents a doc string reference.
2267 'byte-compile-file-form-define-abbrev-table) 2280 'byte-compile-file-form-define-abbrev-table)
2268(defun byte-compile-file-form-define-abbrev-table (form) 2281(defun byte-compile-file-form-define-abbrev-table (form)
2269 (if (eq 'quote (car-safe (car-safe (cdr form)))) 2282 (if (eq 'quote (car-safe (car-safe (cdr form))))
2270 (push (car-safe (cdr (cadr form))) byte-compile-bound-variables)) 2283 (byte-compile--declare-var (car-safe (cdr (cadr form)))))
2271 (byte-compile-keep-pending form)) 2284 (byte-compile-keep-pending form))
2272 2285
2273(put 'custom-declare-variable 'byte-hunk-handler 2286(put 'custom-declare-variable 'byte-hunk-handler
@@ -2275,7 +2288,7 @@ list that represents a doc string reference.
2275(defun byte-compile-file-form-custom-declare-variable (form) 2288(defun byte-compile-file-form-custom-declare-variable (form)
2276 (when (byte-compile-warning-enabled-p 'callargs) 2289 (when (byte-compile-warning-enabled-p 'callargs)
2277 (byte-compile-nogroup-warn form)) 2290 (byte-compile-nogroup-warn form))
2278 (push (nth 1 (nth 1 form)) byte-compile-bound-variables) 2291 (byte-compile--declare-var (nth 1 (nth 1 form)))
2279 (byte-compile-keep-pending form)) 2292 (byte-compile-keep-pending form))
2280 2293
2281(put 'require 'byte-hunk-handler 'byte-compile-file-form-require) 2294(put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
@@ -2576,19 +2589,16 @@ If FORM is a lambda or a macro, byte-compile it as a function."
2576 "Return a list of the variables in the lambda argument list ARGLIST." 2589 "Return a list of the variables in the lambda argument list ARGLIST."
2577 (remq '&rest (remq '&optional arglist))) 2590 (remq '&rest (remq '&optional arglist)))
2578 2591
2579(defun byte-compile-make-lambda-lexenv (form) 2592(defun byte-compile-make-lambda-lexenv (args)
2580 "Return a new lexical environment for a lambda expression FORM." 2593 "Return a new lexical environment for a lambda expression FORM."
2581 ;; See if this is a closure or not 2594 (let* ((lexenv nil)
2582 (let ((args (byte-compile-arglist-vars (cadr form)))) 2595 (stackpos 0))
2583 (let ((lexenv nil)) 2596 ;; Add entries for each argument.
2584 ;; Fill in the initial stack contents 2597 (dolist (arg args)
2585 (let ((stackpos 0)) 2598 (push (cons arg stackpos) lexenv)
2586 ;; Add entries for each argument 2599 (setq stackpos (1+ stackpos)))
2587 (dolist (arg args) 2600 ;; Return the new lexical environment.
2588 (push (cons arg stackpos) lexenv) 2601 lexenv))
2589 (setq stackpos (1+ stackpos)))
2590 ;; Return the new lexical environment
2591 lexenv))))
2592 2602
2593(defun byte-compile-make-args-desc (arglist) 2603(defun byte-compile-make-args-desc (arglist)
2594 (let ((mandatory 0) 2604 (let ((mandatory 0)
@@ -2626,9 +2636,9 @@ for symbols generated by the byte compiler itself."
2626 (byte-compile-set-symbol-position 'lambda)) 2636 (byte-compile-set-symbol-position 'lambda))
2627 (byte-compile-check-lambda-list (nth 1 fun)) 2637 (byte-compile-check-lambda-list (nth 1 fun))
2628 (let* ((arglist (nth 1 fun)) 2638 (let* ((arglist (nth 1 fun))
2639 (arglistvars (byte-compile-arglist-vars arglist))
2629 (byte-compile-bound-variables 2640 (byte-compile-bound-variables
2630 (append (and (not lexical-binding) 2641 (append (if (not lexical-binding) arglistvars)
2631 (byte-compile-arglist-vars arglist))
2632 byte-compile-bound-variables)) 2642 byte-compile-bound-variables))
2633 (body (cdr (cdr fun))) 2643 (body (cdr (cdr fun)))
2634 (doc (if (stringp (car body)) 2644 (doc (if (stringp (car body))
@@ -2676,7 +2686,8 @@ for symbols generated by the byte compiler itself."
2676 ;; args (since lambda expressions should be 2686 ;; args (since lambda expressions should be
2677 ;; closed by now). 2687 ;; closed by now).
2678 (and lexical-binding 2688 (and lexical-binding
2679 (byte-compile-make-lambda-lexenv fun)) 2689 (byte-compile-make-lambda-lexenv
2690 arglistvars))
2680 reserved-csts))) 2691 reserved-csts)))
2681 ;; Build the actual byte-coded function. 2692 ;; Build the actual byte-coded function.
2682 (cl-assert (eq 'byte-code (car-safe compiled))) 2693 (cl-assert (eq 'byte-code (car-safe compiled)))
@@ -3435,32 +3446,38 @@ discarding."
3435(byte-defop-compiler (/ byte-quo) byte-compile-quo) 3446(byte-defop-compiler (/ byte-quo) byte-compile-quo)
3436(byte-defop-compiler nconc) 3447(byte-defop-compiler nconc)
3437 3448
3449;; Is this worth it? Both -before and -after are written in C.
3438(defun byte-compile-char-before (form) 3450(defun byte-compile-char-before (form)
3439 (cond ((= 2 (length form)) 3451 (cond ((or (= 1 (length form))
3452 (and (= 2 (length form)) (not (nth 1 form))))
3453 (byte-compile-form '(char-after (1- (point)))))
3454 ((= 2 (length form))
3440 (byte-compile-form (list 'char-after (if (numberp (nth 1 form)) 3455 (byte-compile-form (list 'char-after (if (numberp (nth 1 form))
3441 (1- (nth 1 form)) 3456 (1- (nth 1 form))
3442 `(1- ,(nth 1 form)))))) 3457 `(1- (or ,(nth 1 form)
3443 ((= 1 (length form)) 3458 (point)))))))
3444 (byte-compile-form '(char-after (1- (point)))))
3445 (t (byte-compile-subr-wrong-args form "0-1")))) 3459 (t (byte-compile-subr-wrong-args form "0-1"))))
3446 3460
3447;; backward-... ==> forward-... with negated argument. 3461;; backward-... ==> forward-... with negated argument.
3462;; Is this worth it? Both -backward and -forward are written in C.
3448(defun byte-compile-backward-char (form) 3463(defun byte-compile-backward-char (form)
3449 (cond ((= 2 (length form)) 3464 (cond ((or (= 1 (length form))
3465 (and (= 2 (length form)) (not (nth 1 form))))
3466 (byte-compile-form '(forward-char -1)))
3467 ((= 2 (length form))
3450 (byte-compile-form (list 'forward-char (if (numberp (nth 1 form)) 3468 (byte-compile-form (list 'forward-char (if (numberp (nth 1 form))
3451 (- (nth 1 form)) 3469 (- (nth 1 form))
3452 `(- ,(nth 1 form)))))) 3470 `(- (or ,(nth 1 form) 1))))))
3453 ((= 1 (length form))
3454 (byte-compile-form '(forward-char -1)))
3455 (t (byte-compile-subr-wrong-args form "0-1")))) 3471 (t (byte-compile-subr-wrong-args form "0-1"))))
3456 3472
3457(defun byte-compile-backward-word (form) 3473(defun byte-compile-backward-word (form)
3458 (cond ((= 2 (length form)) 3474 (cond ((or (= 1 (length form))
3475 (and (= 2 (length form)) (not (nth 1 form))))
3476 (byte-compile-form '(forward-word -1)))
3477 ((= 2 (length form))
3459 (byte-compile-form (list 'forward-word (if (numberp (nth 1 form)) 3478 (byte-compile-form (list 'forward-word (if (numberp (nth 1 form))
3460 (- (nth 1 form)) 3479 (- (nth 1 form))
3461 `(- ,(nth 1 form)))))) 3480 `(- (or ,(nth 1 form) 1))))))
3462 ((= 1 (length form))
3463 (byte-compile-form '(forward-word -1)))
3464 (t (byte-compile-subr-wrong-args form "0-1")))) 3481 (t (byte-compile-subr-wrong-args form "0-1"))))
3465 3482
3466(defun byte-compile-list (form) 3483(defun byte-compile-list (form)
@@ -3862,9 +3879,8 @@ that suppresses all warnings during execution of BODY."
3862 "Emit byte-codes to push the initialization value for CLAUSE on the stack. 3879 "Emit byte-codes to push the initialization value for CLAUSE on the stack.
3863Return the offset in the form (VAR . OFFSET)." 3880Return the offset in the form (VAR . OFFSET)."
3864 (let* ((var (if (consp clause) (car clause) clause))) 3881 (let* ((var (if (consp clause) (car clause) clause)))
3865 ;; We record the stack position even of dynamic bindings and 3882 ;; We record the stack position even of dynamic bindings; we'll put
3866 ;; variables in non-stack lexical environments; we'll put 3883 ;; them in the proper place later.
3867 ;; them in the proper place below.
3868 (prog1 (cons var byte-compile-depth) 3884 (prog1 (cons var byte-compile-depth)
3869 (if (consp clause) 3885 (if (consp clause)
3870 (byte-compile-form (cadr clause)) 3886 (byte-compile-form (cadr clause))
@@ -3882,33 +3898,41 @@ Return the offset in the form (VAR . OFFSET)."
3882INIT-LEXENV should be a lexical-environment alist describing the 3898INIT-LEXENV should be a lexical-environment alist describing the
3883positions of the init value that have been pushed on the stack. 3899positions of the init value that have been pushed on the stack.
3884Return non-nil if the TOS value was popped." 3900Return non-nil if the TOS value was popped."
3885 ;; The presence of lexical bindings mean that we may have to 3901 ;; The mix of lexical and dynamic bindings mean that we may have to
3886 ;; juggle things on the stack, to move them to TOS for 3902 ;; juggle things on the stack, to move them to TOS for
3887 ;; dynamic binding. 3903 ;; dynamic binding.
3888 (cond ((not (byte-compile-not-lexical-var-p var)) 3904 (if (and lexical-binding (not (byte-compile-not-lexical-var-p var)))
3889 ;; VAR is a simple stack-allocated lexical variable 3905 ;; VAR is a simple stack-allocated lexical variable.
3890 (push (assq var init-lexenv) 3906 (progn (push (assq var init-lexenv)
3891 byte-compile--lexical-environment) 3907 byte-compile--lexical-environment)
3892 nil) 3908 nil)
3893 ((eq var (caar init-lexenv)) 3909 ;; VAR should be dynamically bound.
3894 ;; VAR is dynamic and is on the top of the 3910 (while (assq var byte-compile--lexical-environment)
3895 ;; stack, so we can just bind it like usual 3911 ;; This dynamic binding shadows a lexical binding.
3896 (byte-compile-dynamic-variable-bind var) 3912 (setq byte-compile--lexical-environment
3897 t) 3913 (remq (assq var byte-compile--lexical-environment)
3898 (t 3914 byte-compile--lexical-environment)))
3899 ;; VAR is dynamic, but we have to get its 3915 (cond
3900 ;; value out of the middle of the stack 3916 ((eq var (caar init-lexenv))
3901 (let ((stack-pos (cdr (assq var init-lexenv)))) 3917 ;; VAR is dynamic and is on the top of the
3902 (byte-compile-stack-ref stack-pos) 3918 ;; stack, so we can just bind it like usual.
3903 (byte-compile-dynamic-variable-bind var) 3919 (byte-compile-dynamic-variable-bind var)
3904 ;; Now we have to store nil into its temporary 3920 t)
3905 ;; stack position to avoid problems with GC 3921 (t
3906 (byte-compile-push-constant nil) 3922 ;; VAR is dynamic, but we have to get its
3907 (byte-compile-stack-set stack-pos)) 3923 ;; value out of the middle of the stack.
3908 nil))) 3924 (let ((stack-pos (cdr (assq var init-lexenv))))
3909 3925 (byte-compile-stack-ref stack-pos)
3910(defun byte-compile-unbind (clauses init-lexenv 3926 (byte-compile-dynamic-variable-bind var)
3911 &optional preserve-body-value) 3927 ;; Now we have to store nil into its temporary
3928 ;; stack position so it doesn't prevent the value from being GC'd.
3929 ;; FIXME: Not worth the trouble.
3930 ;; (byte-compile-push-constant nil)
3931 ;; (byte-compile-stack-set stack-pos)
3932 )
3933 nil))))
3934
3935(defun byte-compile-unbind (clauses init-lexenv preserve-body-value)
3912 "Emit byte-codes to unbind the variables bound by CLAUSES. 3936 "Emit byte-codes to unbind the variables bound by CLAUSES.
3913CLAUSES is a `let'-style variable binding list. INIT-LEXENV should be a 3937CLAUSES is a `let'-style variable binding list. INIT-LEXENV should be a
3914lexical-environment alist describing the positions of the init value that 3938lexical-environment alist describing the positions of the init value that
@@ -3916,7 +3940,7 @@ have been pushed on the stack. If PRESERVE-BODY-VALUE is true,
3916then an additional value on the top of the stack, above any lexical binding 3940then an additional value on the top of the stack, above any lexical binding
3917slots, is preserved, so it will be on the top of the stack after all 3941slots, is preserved, so it will be on the top of the stack after all
3918binding slots have been popped." 3942binding slots have been popped."
3919 ;; Unbind dynamic variables 3943 ;; Unbind dynamic variables.
3920 (let ((num-dynamic-bindings 0)) 3944 (let ((num-dynamic-bindings 0))
3921 (dolist (clause clauses) 3945 (dolist (clause clauses)
3922 (unless (assq (if (consp clause) (car clause) clause) 3946 (unless (assq (if (consp clause) (car clause) clause)
@@ -3927,14 +3951,15 @@ binding slots have been popped."
3927 ;; Pop lexical variables off the stack, possibly preserving the 3951 ;; Pop lexical variables off the stack, possibly preserving the
3928 ;; return value of the body. 3952 ;; return value of the body.
3929 (when init-lexenv 3953 (when init-lexenv
3930 ;; INIT-LEXENV contains all init values left on the stack 3954 ;; INIT-LEXENV contains all init values left on the stack.
3931 (byte-compile-discard (length init-lexenv) preserve-body-value))) 3955 (byte-compile-discard (length init-lexenv) preserve-body-value)))
3932 3956
3933(defun byte-compile-let (form) 3957(defun byte-compile-let (form)
3934 "Generate code for the `let' form FORM." 3958 "Generate code for the `let' or `let*' form FORM."
3935 (let ((clauses (cadr form)) 3959 (let ((clauses (cadr form))
3936 (init-lexenv nil)) 3960 (init-lexenv nil)
3937 (when (eq (car form) 'let) 3961 (is-let (eq (car form) 'let)))
3962 (when is-let
3938 ;; First compute the binding values in the old scope. 3963 ;; First compute the binding values in the old scope.
3939 (dolist (var clauses) 3964 (dolist (var clauses)
3940 (push (byte-compile-push-binding-init var) init-lexenv))) 3965 (push (byte-compile-push-binding-init var) init-lexenv)))
@@ -3946,28 +3971,20 @@ binding slots have been popped."
3946 ;; For `let', do it in reverse order, because it makes no 3971 ;; For `let', do it in reverse order, because it makes no
3947 ;; semantic difference, but it is a lot more efficient since the 3972 ;; semantic difference, but it is a lot more efficient since the
3948 ;; values are now in reverse order on the stack. 3973 ;; values are now in reverse order on the stack.
3949 (dolist (var (if (eq (car form) 'let) (reverse clauses) clauses)) 3974 (dolist (var (if is-let (reverse clauses) clauses))
3950 (unless (eq (car form) 'let) 3975 (unless is-let
3951 (push (byte-compile-push-binding-init var) init-lexenv)) 3976 (push (byte-compile-push-binding-init var) init-lexenv))
3952 (let ((var (if (consp var) (car var) var))) 3977 (let ((var (if (consp var) (car var) var)))
3953 (cond ((null lexical-binding) 3978 (if (byte-compile-bind var init-lexenv)
3954 ;; If there are no lexical bindings, we can do things simply. 3979 (pop init-lexenv))))
3955 (byte-compile-dynamic-variable-bind var))
3956 ((byte-compile-bind var init-lexenv)
3957 (pop init-lexenv)))))
3958 ;; Emit the body. 3980 ;; Emit the body.
3959 (let ((init-stack-depth byte-compile-depth)) 3981 (let ((init-stack-depth byte-compile-depth))
3960 (byte-compile-body-do-effect (cdr (cdr form))) 3982 (byte-compile-body-do-effect (cdr (cdr form)))
3961 ;; Unbind the variables. 3983 ;; Unbind both lexical and dynamic variables.
3962 (if lexical-binding 3984 (cl-assert (or (eq byte-compile-depth init-stack-depth)
3963 ;; Unbind both lexical and dynamic variables. 3985 (eq byte-compile-depth (1+ init-stack-depth))))
3964 (progn 3986 (byte-compile-unbind clauses init-lexenv
3965 (cl-assert (or (eq byte-compile-depth init-stack-depth) 3987 (> byte-compile-depth init-stack-depth))))))
3966 (eq byte-compile-depth (1+ init-stack-depth))))
3967 (byte-compile-unbind clauses init-lexenv (> byte-compile-depth
3968 init-stack-depth)))
3969 ;; Unbind dynamic variables.
3970 (byte-compile-out 'byte-unbind (length clauses)))))))
3971 3988
3972 3989
3973 3990
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index ee84a9f69ba..761e33c059d 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -81,7 +81,6 @@
81;; and other oddities. 81;; and other oddities.
82;; - new byte codes for unwind-protect, catch, and condition-case so that 82;; - new byte codes for unwind-protect, catch, and condition-case so that
83;; closures aren't needed at all. 83;; closures aren't needed at all.
84;; - inline source code of different binding mode by first compiling it.
85;; - a reference to a var that is known statically to always hold a constant 84;; - a reference to a var that is known statically to always hold a constant
86;; should be turned into a byte-constant rather than a byte-stack-ref. 85;; should be turned into a byte-constant rather than a byte-stack-ref.
87;; Hmm... right, that's called constant propagation and could be done here, 86;; Hmm... right, that's called constant propagation and could be done here,
@@ -95,6 +94,7 @@
95 94
96;; (defmacro dlet (binders &rest body) 95;; (defmacro dlet (binders &rest body)
97;; ;; Works in both lexical and non-lexical mode. 96;; ;; Works in both lexical and non-lexical mode.
97;; (declare (indent 1) (debug let))
98;; `(progn 98;; `(progn
99;; ,@(mapcar (lambda (binder) 99;; ,@(mapcar (lambda (binder)
100;; `(defvar ,(if (consp binder) (car binder) binder))) 100;; `(defvar ,(if (consp binder) (car binder) binder)))
@@ -489,6 +489,7 @@ places where they originally did not directly appear."
489(unless (fboundp 'byte-compile-not-lexical-var-p) 489(unless (fboundp 'byte-compile-not-lexical-var-p)
490 ;; Only used to test the code in non-lexbind Emacs. 490 ;; Only used to test the code in non-lexbind Emacs.
491 (defalias 'byte-compile-not-lexical-var-p 'boundp)) 491 (defalias 'byte-compile-not-lexical-var-p 'boundp))
492(defvar byte-compile-lexical-variables)
492 493
493(defun cconv--analyse-use (vardata form varkind) 494(defun cconv--analyse-use (vardata form varkind)
494 "Analyze the use of a variable. 495 "Analyze the use of a variable.
@@ -530,6 +531,7 @@ FORM is the parent form that binds this var."
530 ;; outside of it. 531 ;; outside of it.
531 (envcopy 532 (envcopy
532 (mapcar (lambda (vdata) (list (car vdata) nil nil nil nil)) env)) 533 (mapcar (lambda (vdata) (list (car vdata) nil nil nil nil)) env))
534 (byte-compile-bound-variables byte-compile-bound-variables)
533 (newenv envcopy)) 535 (newenv envcopy))
534 ;; Push it before recursing, so cconv-freevars-alist contains entries in 536 ;; Push it before recursing, so cconv-freevars-alist contains entries in
535 ;; the order they'll be used by closure-convert-rec. 537 ;; the order they'll be used by closure-convert-rec.
@@ -541,6 +543,7 @@ FORM is the parent form that binds this var."
541 (format "Argument %S is not a lexical variable" arg))) 543 (format "Argument %S is not a lexical variable" arg)))
542 ((eq ?& (aref (symbol-name arg) 0)) nil) ;Ignore &rest, &optional, ... 544 ((eq ?& (aref (symbol-name arg) 0)) nil) ;Ignore &rest, &optional, ...
543 (t (let ((varstruct (list arg nil nil nil nil))) 545 (t (let ((varstruct (list arg nil nil nil nil)))
546 (cl-pushnew arg byte-compile-lexical-variables)
544 (push (cons (list arg) (cdr varstruct)) newvars) 547 (push (cons (list arg) (cdr varstruct)) newvars)
545 (push varstruct newenv))))) 548 (push varstruct newenv)))))
546 (dolist (form body) ;Analyze body forms. 549 (dolist (form body) ;Analyze body forms.
@@ -579,6 +582,7 @@ and updates the data stored in ENV."
579 (let ((orig-env env) 582 (let ((orig-env env)
580 (newvars nil) 583 (newvars nil)
581 (var nil) 584 (var nil)
585 (byte-compile-bound-variables byte-compile-bound-variables)
582 (value nil)) 586 (value nil))
583 (dolist (binder binders) 587 (dolist (binder binders)
584 (if (not (consp binder)) 588 (if (not (consp binder))
@@ -592,6 +596,7 @@ and updates the data stored in ENV."
592 (cconv-analyse-form value (if (eq letsym 'let*) env orig-env))) 596 (cconv-analyse-form value (if (eq letsym 'let*) env orig-env)))
593 597
594 (unless (byte-compile-not-lexical-var-p var) 598 (unless (byte-compile-not-lexical-var-p var)
599 (cl-pushnew var byte-compile-lexical-variables)
595 (let ((varstruct (list var nil nil nil nil))) 600 (let ((varstruct (list var nil nil nil nil)))
596 (push (cons binder (cdr varstruct)) newvars) 601 (push (cons binder (cdr varstruct)) newvars)
597 (push varstruct env)))) 602 (push varstruct env))))
@@ -616,7 +621,8 @@ and updates the data stored in ENV."
616 621
617 (`((lambda . ,_) . ,_) ; First element is lambda expression. 622 (`((lambda . ,_) . ,_) ; First element is lambda expression.
618 (byte-compile-log-warning 623 (byte-compile-log-warning
619 "Use of deprecated ((lambda ...) ...) form" t :warning) 624 (format "Use of deprecated ((lambda %s ...) ...) form" (nth 1 (car form)))
625 t :warning)
620 (dolist (exp `((function ,(car form)) . ,(cdr form))) 626 (dolist (exp `((function ,(car form)) . ,(cdr form)))
621 (cconv-analyse-form exp env))) 627 (cconv-analyse-form exp env)))
622 628
@@ -645,6 +651,7 @@ and updates the data stored in ENV."
645 (`(track-mouse . ,body) 651 (`(track-mouse . ,body)
646 (cconv--analyse-function () body env form)) 652 (cconv--analyse-function () body env form))
647 653
654 (`(defvar ,var) (push var byte-compile-bound-variables))
648 (`(,(or `defconst `defvar) ,var ,value . ,_) 655 (`(,(or `defconst `defvar) ,var ,value . ,_)
649 (push var byte-compile-bound-variables) 656 (push var byte-compile-bound-variables)
650 (cconv-analyse-form value env)) 657 (cconv-analyse-form value env))
@@ -668,7 +675,9 @@ and updates the data stored in ENV."
668 ;; seem worth the trouble. 675 ;; seem worth the trouble.
669 (dolist (form forms) (cconv-analyse-form form nil))) 676 (dolist (form forms) (cconv-analyse-form form nil)))
670 677
671 (`(declare . ,_) nil) ;The args don't contain code. 678 ;; `declare' should now be macro-expanded away (and if they're not, we're
679 ;; in trouble because they *can* contain code nowadays).
680 ;; (`(declare . ,_) nil) ;The args don't contain code.
672 681
673 (`(,_ . ,body-forms) ; First element is a function or whatever. 682 (`(,_ . ,body-forms) ; First element is a function or whatever.
674 (dolist (form body-forms) (cconv-analyse-form form env))) 683 (dolist (form body-forms) (cconv-analyse-form form env)))
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index f3bf70b0190..52f123c83ec 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -156,8 +156,8 @@ an element already on the list.
156 ;; earlier and should have triggered them already. 156 ;; earlier and should have triggered them already.
157 (with-no-warnings ,place) 157 (with-no-warnings ,place)
158 (setq ,place (cons ,var ,place)))) 158 (setq ,place (cons ,var ,place))))
159 (list 'setq place (cl-list* 'cl-adjoin x place keys))) 159 `(setq ,place (cl-adjoin ,x ,place ,@keys)))
160 (cl-list* 'cl-callf2 'cl-adjoin x place keys))) 160 `(cl-callf2 cl-adjoin ,x ,place ,@keys)))
161 161
162(defun cl--set-elt (seq n val) 162(defun cl--set-elt (seq n val)
163 (if (listp seq) (setcar (nthcdr n seq) val) (aset seq n val))) 163 (if (listp seq) (setcar (nthcdr n seq) val) (aset seq n val)))
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index af19db63f30..a06abb03b95 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'.
267;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when 267;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
268;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp 268;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
269;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) 269;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
270;;;;;; "cl-macs" "cl-macs.el" "b839ad3781c4f2f849df0639b4eba166") 270;;;;;; "cl-macs" "cl-macs.el" "fd824d987086eafec0b1cb2efa8312f4")
271;;; Generated autoloads from cl-macs.el 271;;; Generated autoloads from cl-macs.el
272 272
273(autoload 'cl--compiler-macro-list* "cl-macs" "\ 273(autoload 'cl--compiler-macro-list* "cl-macs" "\
@@ -699,9 +699,10 @@ OPTION is either a single keyword or (KEYWORD VALUE) where
699KEYWORD can be one of :conc-name, :constructor, :copier, :predicate, 699KEYWORD can be one of :conc-name, :constructor, :copier, :predicate,
700:type, :named, :initial-offset, :print-function, or :include. 700:type, :named, :initial-offset, :print-function, or :include.
701 701
702Each SLOT may instead take the form (SLOT SLOT-OPTS...), where 702Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where
703SLOT-OPTS are keyword-value pairs for that slot. Currently, only 703SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
704one keyword is supported, `:read-only'. If this has a non-nil 704pairs for that slot.
705Currently, only one keyword is supported, `:read-only'. If this has a non-nil
705value, that slot cannot be set via `setf'. 706value, that slot cannot be set via `setf'.
706 707
707\(fn NAME SLOTS...)" nil t) 708\(fn NAME SLOTS...)" nil t)
@@ -724,6 +725,8 @@ TYPE is a Common Lisp-style type specifier.
724 725
725\(fn OBJECT TYPE)" nil nil) 726\(fn OBJECT TYPE)" nil nil)
726 727
728(eval-and-compile (put 'cl-typep 'compiler-macro #'cl--compiler-macro-typep))
729
727(autoload 'cl-check-type "cl-macs" "\ 730(autoload 'cl-check-type "cl-macs" "\
728Verify that FORM is of type TYPE; signal an error if not. 731Verify that FORM is of type TYPE; signal an error if not.
729STRING is an optional description of the desired type. 732STRING is an optional description of the desired type.
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 4aae2c6efe5..34957d86796 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -584,7 +584,7 @@ If `load' is in WHEN, BODY is evaluated when loaded after top-level compile.
584If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level. 584If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level.
585 585
586\(fn (WHEN...) BODY...)" 586\(fn (WHEN...) BODY...)"
587 (declare (indent 1) (debug ((&rest &or "compile" "load" "eval") body))) 587 (declare (indent 1) (debug (sexp body)))
588 (if (and (fboundp 'cl--compiling-file) (cl--compiling-file) 588 (if (and (fboundp 'cl--compiling-file) (cl--compiling-file)
589 (not cl--not-toplevel) (not (boundp 'for-effect))) ;Horrible kludge. 589 (not cl--not-toplevel) (not (boundp 'for-effect))) ;Horrible kludge.
590 (let ((comp (or (memq 'compile when) (memq :compile-toplevel when))) 590 (let ((comp (or (memq 'compile when) (memq :compile-toplevel when)))
@@ -2276,9 +2276,10 @@ OPTION is either a single keyword or (KEYWORD VALUE) where
2276KEYWORD can be one of :conc-name, :constructor, :copier, :predicate, 2276KEYWORD can be one of :conc-name, :constructor, :copier, :predicate,
2277:type, :named, :initial-offset, :print-function, or :include. 2277:type, :named, :initial-offset, :print-function, or :include.
2278 2278
2279Each SLOT may instead take the form (SLOT SLOT-OPTS...), where 2279Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where
2280SLOT-OPTS are keyword-value pairs for that slot. Currently, only 2280SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
2281one keyword is supported, `:read-only'. If this has a non-nil 2281pairs for that slot.
2282Currently, only one keyword is supported, `:read-only'. If this has a non-nil
2282value, that slot cannot be set via `setf'. 2283value, that slot cannot be set via `setf'.
2283 2284
2284\(fn NAME SLOTS...)" 2285\(fn NAME SLOTS...)"
@@ -2574,9 +2575,16 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc."
2574(defun cl-typep (object type) ; See compiler macro below. 2575(defun cl-typep (object type) ; See compiler macro below.
2575 "Check that OBJECT is of type TYPE. 2576 "Check that OBJECT is of type TYPE.
2576TYPE is a Common Lisp-style type specifier." 2577TYPE is a Common Lisp-style type specifier."
2578 (declare (compiler-macro cl--compiler-macro-typep))
2577 (let ((cl--object object)) ;; Yuck!! 2579 (let ((cl--object object)) ;; Yuck!!
2578 (eval (cl--make-type-test 'cl--object type)))) 2580 (eval (cl--make-type-test 'cl--object type))))
2579 2581
2582(defun cl--compiler-macro-typep (form val type)
2583 (if (macroexp-const-p type)
2584 (macroexp-let2 macroexp-copyable-p temp val
2585 (cl--make-type-test temp (cl--const-expr-val type)))
2586 form))
2587
2580;;;###autoload 2588;;;###autoload
2581(defmacro cl-check-type (form type &optional string) 2589(defmacro cl-check-type (form type &optional string)
2582 "Verify that FORM is of type TYPE; signal an error if not. 2590 "Verify that FORM is of type TYPE; signal an error if not.
@@ -2635,19 +2643,13 @@ and then returning foo."
2635 (let ((p args) (res nil)) 2643 (let ((p args) (res nil))
2636 (while (consp p) (push (pop p) res)) 2644 (while (consp p) (push (pop p) res))
2637 (setq args (nconc (nreverse res) (and p (list '&rest p))))) 2645 (setq args (nconc (nreverse res) (and p (list '&rest p)))))
2638 `(cl-eval-when (compile load eval) 2646 (let ((fname (make-symbol (concat (symbol-name func) "--cmacro"))))
2639 (put ',func 'compiler-macro 2647 `(eval-and-compile
2640 (cl-function (lambda ,(if (memq '&whole args) (delq '&whole args) 2648 ;; Name the compiler-macro function, so that `symbol-file' can find it.
2641 (cons '_cl-whole-arg args)) 2649 (cl-defun ,fname ,(if (memq '&whole args) (delq '&whole args)
2642 ,@body))) 2650 (cons '_cl-whole-arg args))
2643 ;; This is so that describe-function can locate 2651 ,@body)
2644 ;; the macro definition. 2652 (put ',func 'compiler-macro #',fname))))
2645 (let ((file ,(or buffer-file-name
2646 (and (boundp 'byte-compile-current-file)
2647 (stringp byte-compile-current-file)
2648 byte-compile-current-file))))
2649 (if file (put ',func 'compiler-macro-file
2650 (purecopy (file-name-nondirectory file)))))))
2651 2653
2652;;;###autoload 2654;;;###autoload
2653(defun cl-compiler-macroexpand (form) 2655(defun cl-compiler-macroexpand (form)
@@ -2763,22 +2765,16 @@ surrounded by (cl-block NAME ...).
2763 2765
2764;;;###autoload 2766;;;###autoload
2765(defun cl--compiler-macro-adjoin (form a list &rest keys) 2767(defun cl--compiler-macro-adjoin (form a list &rest keys)
2766 (if (and (cl--simple-expr-p a) (cl--simple-expr-p list) 2768 (if (memq :key keys) form
2767 (not (memq :key keys))) 2769 (macroexp-let2 macroexp-copyable-p va a
2768 `(if (cl-member ,a ,list ,@keys) ,list (cons ,a ,list)) 2770 (macroexp-let2 macroexp-copyable-p vlist list
2769 form)) 2771 `(if (cl-member ,va ,vlist ,@keys) ,vlist (cons ,va ,vlist))))))
2770 2772
2771(defun cl--compiler-macro-get (_form sym prop &optional def) 2773(defun cl--compiler-macro-get (_form sym prop &optional def)
2772 (if def 2774 (if def
2773 `(cl-getf (symbol-plist ,sym) ,prop ,def) 2775 `(cl-getf (symbol-plist ,sym) ,prop ,def)
2774 `(get ,sym ,prop))) 2776 `(get ,sym ,prop)))
2775 2777
2776(cl-define-compiler-macro cl-typep (&whole form val type)
2777 (if (macroexp-const-p type)
2778 (macroexp-let2 macroexp-copyable-p temp val
2779 (cl--make-type-test temp (cl--const-expr-val type)))
2780 form))
2781
2782(dolist (y '(cl-first cl-second cl-third cl-fourth 2778(dolist (y '(cl-first cl-second cl-third cl-fourth
2783 cl-fifth cl-sixth cl-seventh 2779 cl-fifth cl-sixth cl-seventh
2784 cl-eighth cl-ninth cl-tenth 2780 cl-eighth cl-ninth cl-tenth
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 867f079ce5f..319af588eac 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -472,6 +472,8 @@ the option `edebug-all-forms'."
472(or (fboundp 'edebug-original-eval-defun) 472(or (fboundp 'edebug-original-eval-defun)
473 (defalias 'edebug-original-eval-defun (symbol-function 'eval-defun))) 473 (defalias 'edebug-original-eval-defun (symbol-function 'eval-defun)))
474 474
475(defvar edebug-result) ; The result of the function call returned by body.
476
475;; We should somehow arrange to be able to do this 477;; We should somehow arrange to be able to do this
476;; without actually replacing the eval-defun command. 478;; without actually replacing the eval-defun command.
477(defun edebug-eval-defun (edebug-it) 479(defun edebug-eval-defun (edebug-it)
@@ -487,7 +489,7 @@ With a prefix argument, instrument the code for Edebug.
487 489
488Setting option `edebug-all-defs' to a non-nil value reverses the meaning 490Setting option `edebug-all-defs' to a non-nil value reverses the meaning
489of the prefix argument. Code is then instrumented when this function is 491of the prefix argument. Code is then instrumented when this function is
490invoked without a prefix argument 492invoked without a prefix argument.
491 493
492If acting on a `defun' for FUNCTION, and the function was instrumented, 494If acting on a `defun' for FUNCTION, and the function was instrumented,
493`Edebug: FUNCTION' is printed in the minibuffer. If not instrumented, 495`Edebug: FUNCTION' is printed in the minibuffer. If not instrumented,
@@ -2106,7 +2108,6 @@ expressions; a `progn' form will be returned enclosing these forms."
2106(defvar edebug-coverage) ; the coverage results of each expression of function. 2108(defvar edebug-coverage) ; the coverage results of each expression of function.
2107 2109
2108(defvar edebug-buffer) ; which buffer the function is in. 2110(defvar edebug-buffer) ; which buffer the function is in.
2109(defvar edebug-result) ; the result of the function call returned by body
2110(defvar edebug-outside-executing-macro) 2111(defvar edebug-outside-executing-macro)
2111(defvar edebug-outside-defining-kbd-macro) 2112(defvar edebug-outside-defining-kbd-macro)
2112 2113
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index c8ae3f4bf1a..21190446624 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -31,6 +31,7 @@
31;;; Code: 31;;; Code:
32 32
33(require 'eieio) 33(require 'eieio)
34(eval-when-compile (require 'cl)) ;FIXME: Use cl-lib!
34 35
35;;; eieio-instance-inheritor 36;;; eieio-instance-inheritor
36;; 37;;
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
new file mode 100644
index 00000000000..da475638bb7
--- /dev/null
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -0,0 +1,2264 @@
1;;; eieio-core.el --- Core implementation for eieio
2
3;; Copyright (C) 1995-1996, 1998-2013 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <zappo@gnu.org>
6;; Version: 1.4
7;; Keywords: OO, lisp
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software: you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24;;; Commentary:
25;;
26;; The "core" part of EIEIO is the implementation for the object
27;; system (such as eieio-defclass, or eieio-defmethod) but not the
28;; base classes for the object system, which are defined in EIEIO.
29;;
30;; See the commentary for eieio.el for more about EIEIO itself.
31
32;;; Code:
33
34(eval-when-compile (require 'cl)) ;FIXME: Use cl-lib!
35
36;; Compatibility
37(if (fboundp 'compiled-function-arglist)
38
39 ;; XEmacs can only access a compiled functions arglist like this:
40 (defalias 'eieio-compiled-function-arglist 'compiled-function-arglist)
41
42 ;; Emacs doesn't have this function, but since FUNC is a vector, we can just
43 ;; grab the appropriate element.
44 (defun eieio-compiled-function-arglist (func)
45 "Return the argument list for the compiled function FUNC."
46 (aref func 0))
47
48 )
49
50(put 'eieio--defalias 'byte-hunk-handler
51 #'byte-compile-file-form-defalias) ;;(get 'defalias 'byte-hunk-handler)
52(defun eieio--defalias (name body)
53 "Like `defalias', but with less side-effects.
54More specifically, it has no side-effects at all when the new function
55definition is the same (`eq') as the old one."
56 (unless (and (fboundp name)
57 (eq (symbol-function name) body))
58 (defalias name body)))
59
60;;;
61;; A few functions that are better in the official EIEIO src, but
62;; used from the core.
63(declare-function slot-unbound "eieio")
64(declare-function slot-missing "eieio")
65(declare-function child-of-class-p "eieio")
66
67
68;;;
69;; Variable declarations.
70;;
71(defvar eieio-hook nil
72 "This hook is executed, then cleared each time `defclass' is called.")
73
74(defvar eieio-error-unsupported-class-tags nil
75 "Non-nil to throw an error if an encountered tag is unsupported.
76This may prevent classes from CLOS applications from being used with EIEIO
77since EIEIO does not support all CLOS tags.")
78
79(defvar eieio-skip-typecheck nil
80 "If non-nil, skip all slot typechecking.
81Set this to t permanently if a program is functioning well to get a
82small speed increase. This variable is also used internally to handle
83default setting for optimization purposes.")
84
85(defvar eieio-optimize-primary-methods-flag t
86 "Non-nil means to optimize the method dispatch on primary methods.")
87
88(defvar eieio-initializing-object nil
89 "Set to non-nil while initializing an object.")
90
91(defconst eieio-unbound
92 (if (and (boundp 'eieio-unbound) (symbolp eieio-unbound))
93 eieio-unbound
94 (make-symbol "unbound"))
95 "Uninterned symbol representing an unbound slot in an object.")
96
97;; This is a bootstrap for eieio-default-superclass so it has a value
98;; while it is being built itself.
99(defvar eieio-default-superclass nil)
100
101;;;
102;; Class currently in scope.
103;;
104;; When invoking methods, the running method needs to know which class
105;; is currently in scope. Generally this is the class of the method
106;; being called, but 'call-next-method' needs to query this state,
107;; and change it to be then next super class up.
108;;
109;; Thus, the scoped class is a stack that needs to be managed.
110
111(defvar eieio--scoped-class-stack nil
112 "A stack of the classes currently in scope during method invocation.")
113
114(defun eieio--scoped-class ()
115 "Return the class currently in scope, or nil."
116 (car-safe eieio--scoped-class-stack))
117
118(defmacro eieio--with-scoped-class (class &rest forms)
119 "Set CLASS as the currently scoped class while executing FORMS."
120 `(unwind-protect
121 (progn
122 (push ,class eieio--scoped-class-stack)
123 ,@forms)
124 (pop eieio--scoped-class-stack)))
125(put 'eieio--with-scoped-class 'lisp-indent-function 1)
126
127;;;
128;; Field Accessors
129;;
130(defmacro eieio--define-field-accessors (prefix fields)
131 (declare (indent 1))
132 (let ((index 0)
133 (defs '()))
134 (dolist (field fields)
135 (let ((doc (if (listp field)
136 (prog1 (cadr field) (setq field (car field))))))
137 (push `(defmacro ,(intern (format "eieio--%s-%s" prefix field)) (x)
138 ,@(if doc (list (format (if (string-match "\n" doc)
139 "Return %s" "Return %s of a %s.")
140 doc prefix)))
141 (list 'aref x ,index))
142 defs)
143 (setq index (1+ index))))
144 `(eval-and-compile
145 ,@(nreverse defs)
146 (defconst ,(intern (format "eieio--%s-num-slots" prefix)) ,index))))
147
148(eieio--define-field-accessors class
149 (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
150 (symbol "symbol (self-referencing)")
151 parent children
152 (symbol-obarray "obarray permitting fast access to variable position indexes")
153 ;; @todo
154 ;; the word "public" here is leftovers from the very first version.
155 ;; Get rid of it!
156 (public-a "class attribute index")
157 (public-d "class attribute defaults index")
158 (public-doc "class documentation strings for attributes")
159 (public-type "class type for a slot")
160 (public-custom "class custom type for a slot")
161 (public-custom-label "class custom group for a slot")
162 (public-custom-group "class custom group for a slot")
163 (public-printer "printer for a slot")
164 (protection "protection for a slot")
165 (initarg-tuples "initarg tuples list")
166 (class-allocation-a "class allocated attributes")
167 (class-allocation-doc "class allocated documentation")
168 (class-allocation-type "class allocated value type")
169 (class-allocation-custom "class allocated custom descriptor")
170 (class-allocation-custom-label "class allocated custom descriptor")
171 (class-allocation-custom-group "class allocated custom group")
172 (class-allocation-printer "class allocated printer for a slot")
173 (class-allocation-protection "class allocated protection list")
174 (class-allocation-values "class allocated value vector")
175 (default-object-cache "what a newly created object would look like.
176This will speed up instantiation time as only a `copy-sequence' will
177be needed, instead of looping over all the values and setting them
178from the default.")
179 (options "storage location of tagged class options.
180Stored outright without modifications or stripping.")))
181
182(eieio--define-field-accessors object
183 (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
184 (class "class struct defining OBJ")
185 name))
186
187;; FIXME: The constants below should have an `eieio-' prefix added!!
188
189(defconst method-static 0 "Index into :static tag on a method.")
190(defconst method-before 1 "Index into :before tag on a method.")
191(defconst method-primary 2 "Index into :primary tag on a method.")
192(defconst method-after 3 "Index into :after tag on a method.")
193(defconst method-num-lists 4 "Number of indexes into methods vector in which groups of functions are kept.")
194(defconst method-generic-before 4 "Index into generic :before tag on a method.")
195(defconst method-generic-primary 5 "Index into generic :primary tag on a method.")
196(defconst method-generic-after 6 "Index into generic :after tag on a method.")
197(defconst method-num-slots 7 "Number of indexes into a method's vector.")
198
199(defsubst eieio-specialized-key-to-generic-key (key)
200 "Convert a specialized KEY into a generic method key."
201 (cond ((eq key method-static) 0) ;; don't convert
202 ((< key method-num-lists) (+ key 3)) ;; The conversion
203 (t key) ;; already generic.. maybe.
204 ))
205
206
207;;; Important macros used internally in eieio.
208;;
209(defmacro eieio--check-type (type obj)
210 (unless (symbolp obj)
211 (error "eieio--check-type wants OBJ to be a variable"))
212 `(if (not ,(cond
213 ((eq 'or (car-safe type))
214 `(or ,@(mapcar (lambda (type) `(,type ,obj)) (cdr type))))
215 (t `(,type ,obj))))
216 (signal 'wrong-type-argument (list ',type ,obj))))
217
218(defmacro class-v (class)
219 "Internal: Return the class vector from the CLASS symbol."
220 ;; No check: If eieio gets this far, it has probably been checked already.
221 `(get ,class 'eieio-class-definition))
222
223(defmacro class-p (class)
224 "Return t if CLASS is a valid class vector.
225CLASS is a symbol."
226 ;; this new method is faster since it doesn't waste time checking lots of
227 ;; things.
228 `(condition-case nil
229 (eq (aref (class-v ,class) 0) 'defclass)
230 (error nil)))
231
232(defun eieio-class-name (class) "Return a Lisp like symbol name for CLASS."
233 (eieio--check-type class-p class)
234 ;; I think this is supposed to return a symbol, but to me CLASS is a symbol,
235 ;; and I wanted a string. Arg!
236 (format "#<class %s>" (symbol-name class)))
237(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4")
238
239(defmacro eieio-class-parents-fast (class)
240 "Return parent classes to CLASS with no check."
241 `(eieio--class-parent (class-v ,class)))
242
243(defmacro eieio-class-children-fast (class) "Return child classes to CLASS with no check."
244 `(eieio--class-children (class-v ,class)))
245
246(defmacro same-class-fast-p (obj class)
247 "Return t if OBJ is of class-type CLASS with no error checking."
248 `(eq (eieio--object-class ,obj) ,class))
249
250(defmacro class-constructor (class)
251 "Return the symbol representing the constructor of CLASS."
252 `(eieio--class-symbol (class-v ,class)))
253
254(defmacro generic-p (method)
255 "Return t if symbol METHOD is a generic function.
256Only methods have the symbol `eieio-method-obarray' as a property
257\(which contains a list of all bindings to that method type.)"
258 `(and (fboundp ,method) (get ,method 'eieio-method-obarray)))
259
260(defun generic-primary-only-p (method)
261 "Return t if symbol METHOD is a generic function with only primary methods.
262Only methods have the symbol `eieio-method-obarray' as a property (which
263contains a list of all bindings to that method type.)
264Methods with only primary implementations are executed in an optimized way."
265 (and (generic-p method)
266 (let ((M (get method 'eieio-method-tree)))
267 (and (< 0 (length (aref M method-primary)))
268 (not (aref M method-static))
269 (not (aref M method-before))
270 (not (aref M method-after))
271 (not (aref M method-generic-before))
272 (not (aref M method-generic-primary))
273 (not (aref M method-generic-after))))
274 ))
275
276(defun generic-primary-only-one-p (method)
277 "Return t if symbol METHOD is a generic function with only primary methods.
278Only methods have the symbol `eieio-method-obarray' as a property (which
279contains a list of all bindings to that method type.)
280Methods with only primary implementations are executed in an optimized way."
281 (and (generic-p method)
282 (let ((M (get method 'eieio-method-tree)))
283 (and (= 1 (length (aref M method-primary)))
284 (not (aref M method-static))
285 (not (aref M method-before))
286 (not (aref M method-after))
287 (not (aref M method-generic-before))
288 (not (aref M method-generic-primary))
289 (not (aref M method-generic-after))))
290 ))
291
292(defmacro class-option-assoc (list option)
293 "Return from LIST the found OPTION, or nil if it doesn't exist."
294 `(car-safe (cdr (memq ,option ,list))))
295
296(defmacro class-option (class option)
297 "Return the value stored for CLASS' OPTION.
298Return nil if that option doesn't exist."
299 `(class-option-assoc (eieio--class-options (class-v ,class)) ',option))
300
301(defmacro eieio-object-p (obj)
302 "Return non-nil if OBJ is an EIEIO object."
303 `(condition-case nil
304 (let ((tobj ,obj))
305 (and (eq (aref tobj 0) 'object)
306 (class-p (eieio--object-class tobj))))
307 (error nil)))
308(defalias 'object-p 'eieio-object-p)
309
310(defmacro class-abstract-p (class)
311 "Return non-nil if CLASS is abstract.
312Abstract classes cannot be instantiated."
313 `(class-option ,class :abstract))
314
315(defmacro class-method-invocation-order (class)
316 "Return the invocation order of CLASS.
317Abstract classes cannot be instantiated."
318 `(or (class-option ,class :method-invocation-order)
319 :breadth-first))
320
321
322
323;;;
324;; Class Creation
325
326(defvar eieio-defclass-autoload-map (make-vector 7 nil)
327 "Symbol map of superclasses we find in autoloads.")
328
329;; We autoload this because it's used in `make-autoload'.
330;;;###autoload
331(defun eieio-defclass-autoload (cname superclasses filename doc)
332 "Create autoload symbols for the EIEIO class CNAME.
333SUPERCLASSES are the superclasses that CNAME inherits from.
334DOC is the docstring for CNAME.
335This function creates a mock-class for CNAME and adds it into
336SUPERCLASSES as children.
337It creates an autoload function for CNAME's constructor."
338 ;; Assume we've already debugged inputs.
339
340 (let* ((oldc (when (class-p cname) (class-v cname)))
341 (newc (make-vector eieio--class-num-slots nil))
342 )
343 (if oldc
344 nil ;; Do nothing if we already have this class.
345
346 ;; Create the class in NEWC, but don't fill anything else in.
347 (aset newc 0 'defclass)
348 (setf (eieio--class-symbol newc) cname)
349
350 (let ((clear-parent nil))
351 ;; No parents?
352 (when (not superclasses)
353 (setq superclasses '(eieio-default-superclass)
354 clear-parent t)
355 )
356
357 ;; Hook our new class into the existing structures so we can
358 ;; autoload it later.
359 (dolist (SC superclasses)
360
361
362 ;; TODO - If we create an autoload that is in the map, that
363 ;; map needs to be cleared!
364
365
366 ;; Does our parent exist?
367 (if (not (class-p SC))
368
369 ;; Create a symbol for this parent, and then store this
370 ;; parent on that symbol.
371 (let ((sym (intern (symbol-name SC) eieio-defclass-autoload-map)))
372 (if (not (boundp sym))
373 (set sym (list cname))
374 (add-to-list sym cname))
375 )
376
377 ;; We have a parent, save the child in there.
378 (when (not (member cname (eieio--class-children (class-v SC))))
379 (setf (eieio--class-children (class-v SC))
380 (cons cname (eieio--class-children (class-v SC))))))
381
382 ;; save parent in child
383 (setf (eieio--class-parent newc) (cons SC (eieio--class-parent newc)))
384 )
385
386 ;; turn this into a usable self-pointing symbol
387 (set cname cname)
388
389 ;; Store the new class vector definition into the symbol. We need to
390 ;; do this first so that we can call defmethod for the accessor.
391 ;; The vector will be updated by the following while loop and will not
392 ;; need to be stored a second time.
393 (put cname 'eieio-class-definition newc)
394
395 ;; Clear the parent
396 (if clear-parent (setf (eieio--class-parent newc) nil))
397
398 ;; Create an autoload on top of our constructor function.
399 (autoload cname filename doc nil nil)
400 (autoload (intern (concat (symbol-name cname) "-p")) filename "" nil nil)
401 (autoload (intern (concat (symbol-name cname) "-child-p")) filename "" nil nil)
402 (autoload (intern (concat (symbol-name cname) "-list-p")) filename "" nil nil)
403
404 ))))
405
406(defsubst eieio-class-un-autoload (cname)
407 "If class CNAME is in an autoload state, load its file."
408 (when (eq (car-safe (symbol-function cname)) 'autoload)
409 (load-library (car (cdr (symbol-function cname))))))
410
411(defun eieio-defclass (cname superclasses slots options-and-doc)
412 ;; FIXME: Most of this should be moved to the `defclass' macro.
413 "Define CNAME as a new subclass of SUPERCLASSES.
414SLOTS are the slots residing in that class definition, and options or
415documentation OPTIONS-AND-DOC is the toplevel documentation for this class.
416See `defclass' for more information."
417 ;; Run our eieio-hook each time, and clear it when we are done.
418 ;; This way people can add hooks safely if they want to modify eieio
419 ;; or add definitions when eieio is loaded or something like that.
420 (run-hooks 'eieio-hook)
421 (setq eieio-hook nil)
422
423 (eieio--check-type listp superclasses)
424
425 (let* ((pname superclasses)
426 (newc (make-vector eieio--class-num-slots nil))
427 (oldc (when (class-p cname) (class-v cname)))
428 (groups nil) ;; list of groups id'd from slots
429 (options nil)
430 (clearparent nil))
431
432 (aset newc 0 'defclass)
433 (setf (eieio--class-symbol newc) cname)
434
435 ;; If this class already existed, and we are updating its structure,
436 ;; make sure we keep the old child list. This can cause bugs, but
437 ;; if no new slots are created, it also saves time, and prevents
438 ;; method table breakage, particularly when the users is only
439 ;; byte compiling an EIEIO file.
440 (if oldc
441 (setf (eieio--class-children newc) (eieio--class-children oldc))
442 ;; If the old class did not exist, but did exist in the autoload map, then adopt those children.
443 ;; This is like the above, but deals with autoloads nicely.
444 (let ((sym (intern-soft (symbol-name cname) eieio-defclass-autoload-map)))
445 (when sym
446 (condition-case nil
447 (setf (eieio--class-children newc) (symbol-value sym))
448 (error nil))
449 (unintern (symbol-name cname) eieio-defclass-autoload-map)
450 ))
451 )
452
453 (cond ((and (stringp (car options-and-doc))
454 (/= 1 (% (length options-and-doc) 2)))
455 (error "Too many arguments to `defclass'"))
456 ((and (symbolp (car options-and-doc))
457 (/= 0 (% (length options-and-doc) 2)))
458 (error "Too many arguments to `defclass'"))
459 )
460
461 (setq options
462 (if (stringp (car options-and-doc))
463 (cons :documentation options-and-doc)
464 options-and-doc))
465
466 (if pname
467 (progn
468 (while pname
469 (if (and (car pname) (symbolp (car pname)))
470 (if (not (class-p (car pname)))
471 ;; bad class
472 (error "Given parent class %s is not a class" (car pname))
473 ;; good parent class...
474 ;; save new child in parent
475 (when (not (member cname (eieio--class-children (class-v (car pname)))))
476 (setf (eieio--class-children (class-v (car pname)))
477 (cons cname (eieio--class-children (class-v (car pname))))))
478 ;; Get custom groups, and store them into our local copy.
479 (mapc (lambda (g) (pushnew g groups :test #'equal))
480 (class-option (car pname) :custom-groups))
481 ;; save parent in child
482 (setf (eieio--class-parent newc) (cons (car pname) (eieio--class-parent newc))))
483 (error "Invalid parent class %s" pname))
484 (setq pname (cdr pname)))
485 ;; Reverse the list of our parents so that they are prioritized in
486 ;; the same order as specified in the code.
487 (setf (eieio--class-parent newc) (nreverse (eieio--class-parent newc))) )
488 ;; If there is nothing to loop over, then inherit from the
489 ;; default superclass.
490 (unless (eq cname 'eieio-default-superclass)
491 ;; adopt the default parent here, but clear it later...
492 (setq clearparent t)
493 ;; save new child in parent
494 (if (not (member cname (eieio--class-children (class-v 'eieio-default-superclass))))
495 (setf (eieio--class-children (class-v 'eieio-default-superclass))
496 (cons cname (eieio--class-children (class-v 'eieio-default-superclass)))))
497 ;; save parent in child
498 (setf (eieio--class-parent newc) (list eieio-default-superclass))))
499
500 ;; turn this into a usable self-pointing symbol
501 (set cname cname)
502
503 ;; These two tests must be created right away so we can have self-
504 ;; referencing classes. ei, a class whose slot can contain only
505 ;; pointers to itself.
506
507 ;; Create the test function
508 (let ((csym (intern (concat (symbol-name cname) "-p"))))
509 (fset csym
510 (list 'lambda (list 'obj)
511 (format "Test OBJ to see if it an object of type %s" cname)
512 (list 'and '(eieio-object-p obj)
513 (list 'same-class-p 'obj cname)))))
514
515 ;; Make sure the method invocation order is a valid value.
516 (let ((io (class-option-assoc options :method-invocation-order)))
517 (when (and io (not (member io '(:depth-first :breadth-first :c3))))
518 (error "Method invocation order %s is not allowed" io)
519 ))
520
521 ;; Create a handy child test too
522 (let ((csym (intern (concat (symbol-name cname) "-child-p"))))
523 (fset csym
524 `(lambda (obj)
525 ,(format
526 "Test OBJ to see if it an object is a child of type %s"
527 cname)
528 (and (eieio-object-p obj)
529 (object-of-class-p obj ,cname))))
530
531 ;; Create a handy list of the class test too
532 (let ((csym (intern (concat (symbol-name cname) "-list-p"))))
533 (fset csym
534 `(lambda (obj)
535 ,(format
536 "Test OBJ to see if it a list of objects which are a child of type %s"
537 cname)
538 (when (listp obj)
539 (let ((ans t)) ;; nil is valid
540 ;; Loop over all the elements of the input list, test
541 ;; each to make sure it is a child of the desired object class.
542 (while (and obj ans)
543 (setq ans (and (eieio-object-p (car obj))
544 (object-of-class-p (car obj) ,cname)))
545 (setq obj (cdr obj)))
546 ans)))))
547
548 ;; When using typep, (typep OBJ 'myclass) returns t for objects which
549 ;; are subclasses of myclass. For our predicates, however, it is
550 ;; important for EIEIO to be backwards compatible, where
551 ;; myobject-p, and myobject-child-p are different.
552 ;; "cl" uses this technique to specify symbols with specific typep
553 ;; test, so we can let typep have the CLOS documented behavior
554 ;; while keeping our above predicate clean.
555
556 ;; It would be cleaner to use `defsetf' here, but that requires cl
557 ;; at runtime.
558 (put cname 'cl-deftype-handler
559 (list 'lambda () `(list 'satisfies (quote ,csym)))))
560
561 ;; Before adding new slots, let's add all the methods and classes
562 ;; in from the parent class.
563 (eieio-copy-parents-into-subclass newc superclasses)
564
565 ;; Store the new class vector definition into the symbol. We need to
566 ;; do this first so that we can call defmethod for the accessor.
567 ;; The vector will be updated by the following while loop and will not
568 ;; need to be stored a second time.
569 (put cname 'eieio-class-definition newc)
570
571 ;; Query each slot in the declaration list and mangle into the
572 ;; class structure I have defined.
573 (while slots
574 (let* ((slot1 (car slots))
575 (name (car slot1))
576 (slot (cdr slot1))
577 (acces (plist-get slot ':accessor))
578 (init (or (plist-get slot ':initform)
579 (if (member ':initform slot) nil
580 eieio-unbound)))
581 (initarg (plist-get slot ':initarg))
582 (docstr (plist-get slot ':documentation))
583 (prot (plist-get slot ':protection))
584 (reader (plist-get slot ':reader))
585 (writer (plist-get slot ':writer))
586 (alloc (plist-get slot ':allocation))
587 (type (plist-get slot ':type))
588 (custom (plist-get slot ':custom))
589 (label (plist-get slot ':label))
590 (customg (plist-get slot ':group))
591 (printer (plist-get slot ':printer))
592
593 (skip-nil (class-option-assoc options :allow-nil-initform))
594 )
595
596 (if eieio-error-unsupported-class-tags
597 (let ((tmp slot))
598 (while tmp
599 (if (not (member (car tmp) '(:accessor
600 :initform
601 :initarg
602 :documentation
603 :protection
604 :reader
605 :writer
606 :allocation
607 :type
608 :custom
609 :label
610 :group
611 :printer
612 :allow-nil-initform
613 :custom-groups)))
614 (signal 'invalid-slot-type (list (car tmp))))
615 (setq tmp (cdr (cdr tmp))))))
616
617 ;; Clean up the meaning of protection.
618 (cond ((or (eq prot 'public) (eq prot :public)) (setq prot nil))
619 ((or (eq prot 'protected) (eq prot :protected)) (setq prot 'protected))
620 ((or (eq prot 'private) (eq prot :private)) (setq prot 'private))
621 ((eq prot nil) nil)
622 (t (signal 'invalid-slot-type (list ':protection prot))))
623
624 ;; Make sure the :allocation parameter has a valid value.
625 (if (not (or (not alloc) (eq alloc :class) (eq alloc :instance)))
626 (signal 'invalid-slot-type (list ':allocation alloc)))
627
628 ;; The default type specifier is supposed to be t, meaning anything.
629 (if (not type) (setq type t))
630
631 ;; Label is nil, or a string
632 (if (not (or (null label) (stringp label)))
633 (signal 'invalid-slot-type (list ':label label)))
634
635 ;; Is there an initarg, but allocation of class?
636 (if (and initarg (eq alloc :class))
637 (message "Class allocated slots do not need :initarg"))
638
639 ;; intern the symbol so we can use it blankly
640 (if initarg (set initarg initarg))
641
642 ;; The customgroup should be a list of symbols
643 (cond ((null customg)
644 (setq customg '(default)))
645 ((not (listp customg))
646 (setq customg (list customg))))
647 ;; The customgroup better be a symbol, or list of symbols.
648 (mapc (lambda (cg)
649 (if (not (symbolp cg))
650 (signal 'invalid-slot-type (list ':group cg))))
651 customg)
652
653 ;; First up, add this slot into our new class.
654 (eieio-add-new-slot newc name init docstr type custom label customg printer
655 prot initarg alloc 'defaultoverride skip-nil)
656
657 ;; We need to id the group, and store them in a group list attribute.
658 (mapc (lambda (cg) (pushnew cg groups :test 'equal)) customg)
659
660 ;; Anyone can have an accessor function. This creates a function
661 ;; of the specified name, and also performs a `defsetf' if applicable
662 ;; so that users can `setf' the space returned by this function.
663 (if acces
664 (progn
665 (eieio--defmethod
666 acces (if (eq alloc :class) :static :primary) cname
667 `(lambda (this)
668 ,(format
669 "Retrieves the slot `%s' from an object of class `%s'"
670 name cname)
671 (if (slot-boundp this ',name)
672 (eieio-oref this ',name)
673 ;; Else - Some error? nil?
674 nil)))
675
676 (if (fboundp 'gv-define-setter)
677 ;; FIXME: We should move more of eieio-defclass into the
678 ;; defclass macro so we don't have to use `eval' and require
679 ;; `gv' at run-time.
680 (eval `(gv-define-setter ,acces (eieio--store eieio--object)
681 (list 'eieio-oset eieio--object '',name
682 eieio--store)))
683 ;; Provide a setf method. It would be cleaner to use
684 ;; defsetf, but that would require CL at runtime.
685 (put acces 'setf-method
686 `(lambda (widget)
687 (let* ((--widget-sym-- (make-symbol "--widget--"))
688 (--store-sym-- (make-symbol "--store--")))
689 (list
690 (list --widget-sym--)
691 (list widget)
692 (list --store-sym--)
693 (list 'eieio-oset --widget-sym-- '',name
694 --store-sym--)
695 (list 'getfoo --widget-sym--))))))))
696
697 ;; If a writer is defined, then create a generic method of that
698 ;; name whose purpose is to set the value of the slot.
699 (if writer
700 (eieio--defmethod
701 writer nil cname
702 `(lambda (this value)
703 ,(format "Set the slot `%s' of an object of class `%s'"
704 name cname)
705 (setf (slot-value this ',name) value))))
706 ;; If a reader is defined, then create a generic method
707 ;; of that name whose purpose is to access this slot value.
708 (if reader
709 (eieio--defmethod
710 reader nil cname
711 `(lambda (this)
712 ,(format "Access the slot `%s' from object of class `%s'"
713 name cname)
714 (slot-value this ',name))))
715 )
716 (setq slots (cdr slots)))
717
718 ;; Now that everything has been loaded up, all our lists are backwards!
719 ;; Fix that up now.
720 (setf (eieio--class-public-a newc) (nreverse (eieio--class-public-a newc)))
721 (setf (eieio--class-public-d newc) (nreverse (eieio--class-public-d newc)))
722 (setf (eieio--class-public-doc newc) (nreverse (eieio--class-public-doc newc)))
723 (setf (eieio--class-public-type newc)
724 (apply 'vector (nreverse (eieio--class-public-type newc))))
725 (setf (eieio--class-public-custom newc) (nreverse (eieio--class-public-custom newc)))
726 (setf (eieio--class-public-custom-label newc) (nreverse (eieio--class-public-custom-label newc)))
727 (setf (eieio--class-public-custom-group newc) (nreverse (eieio--class-public-custom-group newc)))
728 (setf (eieio--class-public-printer newc) (nreverse (eieio--class-public-printer newc)))
729 (setf (eieio--class-protection newc) (nreverse (eieio--class-protection newc)))
730 (setf (eieio--class-initarg-tuples newc) (nreverse (eieio--class-initarg-tuples newc)))
731
732 ;; The storage for class-class-allocation-type needs to be turned into
733 ;; a vector now.
734 (setf (eieio--class-class-allocation-type newc)
735 (apply 'vector (eieio--class-class-allocation-type newc)))
736
737 ;; Also, take class allocated values, and vectorize them for speed.
738 (setf (eieio--class-class-allocation-values newc)
739 (apply 'vector (eieio--class-class-allocation-values newc)))
740
741 ;; Attach slot symbols into an obarray, and store the index of
742 ;; this slot as the variable slot in this new symbol. We need to
743 ;; know about primes, because obarrays are best set in vectors of
744 ;; prime number length, and we also need to make our vector small
745 ;; to save space, and also optimal for the number of items we have.
746 (let* ((cnt 0)
747 (pubsyms (eieio--class-public-a newc))
748 (prots (eieio--class-protection newc))
749 (l (length pubsyms))
750 (vl (let ((primes '( 3 5 7 11 13 17 19 23 29 31 37 41 43 47
751 53 59 61 67 71 73 79 83 89 97 101 )))
752 (while (and primes (< (car primes) l))
753 (setq primes (cdr primes)))
754 (car primes)))
755 (oa (make-vector vl 0))
756 (newsym))
757 (while pubsyms
758 (setq newsym (intern (symbol-name (car pubsyms)) oa))
759 (set newsym cnt)
760 (setq cnt (1+ cnt))
761 (if (car prots) (put newsym 'protection (car prots)))
762 (setq pubsyms (cdr pubsyms)
763 prots (cdr prots)))
764 (setf (eieio--class-symbol-obarray newc) oa)
765 )
766
767 ;; Create the constructor function
768 (if (class-option-assoc options :abstract)
769 ;; Abstract classes cannot be instantiated. Say so.
770 (let ((abs (class-option-assoc options :abstract)))
771 (if (not (stringp abs))
772 (setq abs (format "Class %s is abstract" cname)))
773 (fset cname
774 `(lambda (&rest stuff)
775 ,(format "You cannot create a new object of type %s" cname)
776 (error ,abs))))
777
778 ;; Non-abstract classes need a constructor.
779 (fset cname
780 `(lambda (newname &rest slots)
781 ,(format "Create a new object with name NAME of class type %s" cname)
782 (apply 'constructor ,cname newname slots)))
783 )
784
785 ;; Set up a specialized doc string.
786 ;; Use stored value since it is calculated in a non-trivial way
787 (put cname 'variable-documentation
788 (class-option-assoc options :documentation))
789
790 ;; Save the file location where this class is defined.
791 (let ((fname (if load-in-progress
792 load-file-name
793 buffer-file-name)))
794 (when fname
795 (when (string-match "\\.elc\\'" fname)
796 (setq fname (substring fname 0 (1- (length fname)))))
797 (put cname 'class-location fname)))
798
799 ;; We have a list of custom groups. Store them into the options.
800 (let ((g (class-option-assoc options :custom-groups)))
801 (mapc (lambda (cg) (pushnew cg g :test 'equal)) groups)
802 (if (memq :custom-groups options)
803 (setcar (cdr (memq :custom-groups options)) g)
804 (setq options (cons :custom-groups (cons g options)))))
805
806 ;; Set up the options we have collected.
807 (setf (eieio--class-options newc) options)
808
809 ;; if this is a superclass, clear out parent (which was set to the
810 ;; default superclass eieio-default-superclass)
811 (if clearparent (setf (eieio--class-parent newc) nil))
812
813 ;; Create the cached default object.
814 (let ((cache (make-vector (+ (length (eieio--class-public-a newc)) 3)
815 nil)))
816 (aset cache 0 'object)
817 (setf (eieio--object-class cache) cname)
818 (setf (eieio--object-name cache) 'default-cache-object)
819 (let ((eieio-skip-typecheck t))
820 ;; All type-checking has been done to our satisfaction
821 ;; before this call. Don't waste our time in this call..
822 (eieio-set-defaults cache t))
823 (setf (eieio--class-default-object-cache newc) cache))
824
825 ;; Return our new class object
826 ;; newc
827 cname
828 ))
829
830(defsubst eieio-eval-default-p (val)
831 "Whether the default value VAL should be evaluated for use."
832 (and (consp val) (symbolp (car val)) (fboundp (car val))))
833
834(defun eieio-perform-slot-validation-for-default (slot spec value skipnil)
835 "For SLOT, signal if SPEC does not match VALUE.
836If SKIPNIL is non-nil, then if VALUE is nil return t instead."
837 (if (and (not (eieio-eval-default-p value))
838 (not eieio-skip-typecheck)
839 (not (and skipnil (null value)))
840 (not (eieio-perform-slot-validation spec value)))
841 (signal 'invalid-slot-type (list slot spec value))))
842
843(defun eieio-add-new-slot (newc a d doc type cust label custg print prot init alloc
844 &optional defaultoverride skipnil)
845 "Add into NEWC attribute A.
846If A already exists in NEWC, then do nothing. If it doesn't exist,
847then also add in D (default), DOC, TYPE, CUST, LABEL, CUSTG, PRINT, PROT, and INIT arg.
848Argument ALLOC specifies if the slot is allocated per instance, or per class.
849If optional DEFAULTOVERRIDE is non-nil, then if A exists in NEWC,
850we must override its value for a default.
851Optional argument SKIPNIL indicates if type checking should be skipped
852if default value is nil."
853 ;; Make sure we duplicate those items that are sequences.
854 (condition-case nil
855 (if (sequencep d) (setq d (copy-sequence d)))
856 ;; This copy can fail on a cons cell with a non-cons in the cdr. Let's skip it if it doesn't work.
857 (error nil))
858 (if (sequencep type) (setq type (copy-sequence type)))
859 (if (sequencep cust) (setq cust (copy-sequence cust)))
860 (if (sequencep custg) (setq custg (copy-sequence custg)))
861
862 ;; To prevent override information w/out specification of storage,
863 ;; we need to do this little hack.
864 (if (member a (eieio--class-class-allocation-a newc)) (setq alloc ':class))
865
866 (if (or (not alloc) (and (symbolp alloc) (eq alloc ':instance)))
867 ;; In this case, we modify the INSTANCE version of a given slot.
868
869 (progn
870
871 ;; Only add this element if it is so-far unique
872 (if (not (member a (eieio--class-public-a newc)))
873 (progn
874 (eieio-perform-slot-validation-for-default a type d skipnil)
875 (setf (eieio--class-public-a newc) (cons a (eieio--class-public-a newc)))
876 (setf (eieio--class-public-d newc) (cons d (eieio--class-public-d newc)))
877 (setf (eieio--class-public-doc newc) (cons doc (eieio--class-public-doc newc)))
878 (setf (eieio--class-public-type newc) (cons type (eieio--class-public-type newc)))
879 (setf (eieio--class-public-custom newc) (cons cust (eieio--class-public-custom newc)))
880 (setf (eieio--class-public-custom-label newc) (cons label (eieio--class-public-custom-label newc)))
881 (setf (eieio--class-public-custom-group newc) (cons custg (eieio--class-public-custom-group newc)))
882 (setf (eieio--class-public-printer newc) (cons print (eieio--class-public-printer newc)))
883 (setf (eieio--class-protection newc) (cons prot (eieio--class-protection newc)))
884 (setf (eieio--class-initarg-tuples newc) (cons (cons init a) (eieio--class-initarg-tuples newc)))
885 )
886 ;; When defaultoverride is true, we are usually adding new local
887 ;; attributes which must override the default value of any slot
888 ;; passed in by one of the parent classes.
889 (when defaultoverride
890 ;; There is a match, and we must override the old value.
891 (let* ((ca (eieio--class-public-a newc))
892 (np (member a ca))
893 (num (- (length ca) (length np)))
894 (dp (if np (nthcdr num (eieio--class-public-d newc))
895 nil))
896 (tp (if np (nth num (eieio--class-public-type newc))))
897 )
898 (if (not np)
899 (error "EIEIO internal error overriding default value for %s"
900 a)
901 ;; If type is passed in, is it the same?
902 (if (not (eq type t))
903 (if (not (equal type tp))
904 (error
905 "Child slot type `%s' does not match inherited type `%s' for `%s'"
906 type tp a)))
907 ;; If we have a repeat, only update the initarg...
908 (unless (eq d eieio-unbound)
909 (eieio-perform-slot-validation-for-default a tp d skipnil)
910 (setcar dp d))
911 ;; If we have a new initarg, check for it.
912 (when init
913 (let* ((inits (eieio--class-initarg-tuples newc))
914 (inita (rassq a inits)))
915 ;; Replace the CAR of the associate INITA.
916 ;;(message "Initarg: %S replace %s" inita init)
917 (setcar inita init)
918 ))
919
920 ;; PLN Tue Jun 26 11:57:06 2007 : The protection is
921 ;; checked and SHOULD match the superclass
922 ;; protection. Otherwise an error is thrown. However
923 ;; I wonder if a more flexible schedule might be
924 ;; implemented.
925 ;;
926 ;; EML - We used to have (if prot... here,
927 ;; but a prot of 'nil means public.
928 ;;
929 (let ((super-prot (nth num (eieio--class-protection newc)))
930 )
931 (if (not (eq prot super-prot))
932 (error "Child slot protection `%s' does not match inherited protection `%s' for `%s'"
933 prot super-prot a)))
934 ;; End original PLN
935
936 ;; PLN Tue Jun 26 11:57:06 2007 :
937 ;; Do a non redundant combination of ancient custom
938 ;; groups and new ones.
939 (when custg
940 (let* ((groups
941 (nthcdr num (eieio--class-public-custom-group newc)))
942 (list1 (car groups))
943 (list2 (if (listp custg) custg (list custg))))
944 (if (< (length list1) (length list2))
945 (setq list1 (prog1 list2 (setq list2 list1))))
946 (dolist (elt list2)
947 (unless (memq elt list1)
948 (push elt list1)))
949 (setcar groups list1)))
950 ;; End PLN
951
952 ;; PLN Mon Jun 25 22:44:34 2007 : If a new cust is
953 ;; set, simply replaces the old one.
954 (when cust
955 ;; (message "Custom type redefined to %s" cust)
956 (setcar (nthcdr num (eieio--class-public-custom newc)) cust))
957
958 ;; If a new label is specified, it simply replaces
959 ;; the old one.
960 (when label
961 ;; (message "Custom label redefined to %s" label)
962 (setcar (nthcdr num (eieio--class-public-custom-label newc)) label))
963 ;; End PLN
964
965 ;; PLN Sat Jun 30 17:24:42 2007 : when a new
966 ;; doc is specified, simply replaces the old one.
967 (when doc
968 ;;(message "Documentation redefined to %s" doc)
969 (setcar (nthcdr num (eieio--class-public-doc newc))
970 doc))
971 ;; End PLN
972
973 ;; If a new printer is specified, it simply replaces
974 ;; the old one.
975 (when print
976 ;; (message "printer redefined to %s" print)
977 (setcar (nthcdr num (eieio--class-public-printer newc)) print))
978
979 )))
980 ))
981
982 ;; CLASS ALLOCATED SLOTS
983 (let ((value (eieio-default-eval-maybe d)))
984 (if (not (member a (eieio--class-class-allocation-a newc)))
985 (progn
986 (eieio-perform-slot-validation-for-default a type value skipnil)
987 ;; Here we have found a :class version of a slot. This
988 ;; requires a very different approach.
989 (setf (eieio--class-class-allocation-a newc) (cons a (eieio--class-class-allocation-a newc)))
990 (setf (eieio--class-class-allocation-doc newc) (cons doc (eieio--class-class-allocation-doc newc)))
991 (setf (eieio--class-class-allocation-type newc) (cons type (eieio--class-class-allocation-type newc)))
992 (setf (eieio--class-class-allocation-custom newc) (cons cust (eieio--class-class-allocation-custom newc)))
993 (setf (eieio--class-class-allocation-custom-label newc) (cons label (eieio--class-class-allocation-custom-label newc)))
994 (setf (eieio--class-class-allocation-custom-group newc) (cons custg (eieio--class-class-allocation-custom-group newc)))
995 (setf (eieio--class-class-allocation-protection newc) (cons prot (eieio--class-class-allocation-protection newc)))
996 ;; Default value is stored in the 'values section, since new objects
997 ;; can't initialize from this element.
998 (setf (eieio--class-class-allocation-values newc) (cons value (eieio--class-class-allocation-values newc))))
999 (when defaultoverride
1000 ;; There is a match, and we must override the old value.
1001 (let* ((ca (eieio--class-class-allocation-a newc))
1002 (np (member a ca))
1003 (num (- (length ca) (length np)))
1004 (dp (if np
1005 (nthcdr num
1006 (eieio--class-class-allocation-values newc))
1007 nil))
1008 (tp (if np (nth num (eieio--class-class-allocation-type newc))
1009 nil)))
1010 (if (not np)
1011 (error "EIEIO internal error overriding default value for %s"
1012 a)
1013 ;; If type is passed in, is it the same?
1014 (if (not (eq type t))
1015 (if (not (equal type tp))
1016 (error
1017 "Child slot type `%s' does not match inherited type `%s' for `%s'"
1018 type tp a)))
1019 ;; EML - Note: the only reason to override a class bound slot
1020 ;; is to change the default, so allow unbound in.
1021
1022 ;; If we have a repeat, only update the value...
1023 (eieio-perform-slot-validation-for-default a tp value skipnil)
1024 (setcar dp value))
1025
1026 ;; PLN Tue Jun 26 11:57:06 2007 : The protection is
1027 ;; checked and SHOULD match the superclass
1028 ;; protection. Otherwise an error is thrown. However
1029 ;; I wonder if a more flexible schedule might be
1030 ;; implemented.
1031 (let ((super-prot
1032 (car (nthcdr num (eieio--class-class-allocation-protection newc)))))
1033 (if (not (eq prot super-prot))
1034 (error "Child slot protection `%s' does not match inherited protection `%s' for `%s'"
1035 prot super-prot a)))
1036 ;; Do a non redundant combination of ancient custom groups
1037 ;; and new ones.
1038 (when custg
1039 (let* ((groups
1040 (nthcdr num (eieio--class-class-allocation-custom-group newc)))
1041 (list1 (car groups))
1042 (list2 (if (listp custg) custg (list custg))))
1043 (if (< (length list1) (length list2))
1044 (setq list1 (prog1 list2 (setq list2 list1))))
1045 (dolist (elt list2)
1046 (unless (memq elt list1)
1047 (push elt list1)))
1048 (setcar groups list1)))
1049
1050 ;; PLN Sat Jun 30 17:24:42 2007 : when a new
1051 ;; doc is specified, simply replaces the old one.
1052 (when doc
1053 ;;(message "Documentation redefined to %s" doc)
1054 (setcar (nthcdr num (eieio--class-class-allocation-doc newc))
1055 doc))
1056 ;; End PLN
1057
1058 ;; If a new printer is specified, it simply replaces
1059 ;; the old one.
1060 (when print
1061 ;; (message "printer redefined to %s" print)
1062 (setcar (nthcdr num (eieio--class-class-allocation-printer newc)) print))
1063
1064 ))
1065 ))
1066 ))
1067
1068(defun eieio-copy-parents-into-subclass (newc parents)
1069 "Copy into NEWC the slots of PARENTS.
1070Follow the rules of not overwriting early parents when applying to
1071the new child class."
1072 (let ((ps (eieio--class-parent newc))
1073 (sn (class-option-assoc (eieio--class-options newc)
1074 ':allow-nil-initform)))
1075 (while ps
1076 ;; First, duplicate all the slots of the parent.
1077 (let ((pcv (class-v (car ps))))
1078 (let ((pa (eieio--class-public-a pcv))
1079 (pd (eieio--class-public-d pcv))
1080 (pdoc (eieio--class-public-doc pcv))
1081 (ptype (eieio--class-public-type pcv))
1082 (pcust (eieio--class-public-custom pcv))
1083 (plabel (eieio--class-public-custom-label pcv))
1084 (pcustg (eieio--class-public-custom-group pcv))
1085 (printer (eieio--class-public-printer pcv))
1086 (pprot (eieio--class-protection pcv))
1087 (pinit (eieio--class-initarg-tuples pcv))
1088 (i 0))
1089 (while pa
1090 (eieio-add-new-slot newc
1091 (car pa) (car pd) (car pdoc) (aref ptype i)
1092 (car pcust) (car plabel) (car pcustg)
1093 (car printer)
1094 (car pprot) (car-safe (car pinit)) nil nil sn)
1095 ;; Increment each value.
1096 (setq pa (cdr pa)
1097 pd (cdr pd)
1098 pdoc (cdr pdoc)
1099 i (1+ i)
1100 pcust (cdr pcust)
1101 plabel (cdr plabel)
1102 pcustg (cdr pcustg)
1103 printer (cdr printer)
1104 pprot (cdr pprot)
1105 pinit (cdr pinit))
1106 )) ;; while/let
1107 ;; Now duplicate all the class alloc slots.
1108 (let ((pa (eieio--class-class-allocation-a pcv))
1109 (pdoc (eieio--class-class-allocation-doc pcv))
1110 (ptype (eieio--class-class-allocation-type pcv))
1111 (pcust (eieio--class-class-allocation-custom pcv))
1112 (plabel (eieio--class-class-allocation-custom-label pcv))
1113 (pcustg (eieio--class-class-allocation-custom-group pcv))
1114 (printer (eieio--class-class-allocation-printer pcv))
1115 (pprot (eieio--class-class-allocation-protection pcv))
1116 (pval (eieio--class-class-allocation-values pcv))
1117 (i 0))
1118 (while pa
1119 (eieio-add-new-slot newc
1120 (car pa) (aref pval i) (car pdoc) (aref ptype i)
1121 (car pcust) (car plabel) (car pcustg)
1122 (car printer)
1123 (car pprot) nil ':class sn)
1124 ;; Increment each value.
1125 (setq pa (cdr pa)
1126 pdoc (cdr pdoc)
1127 pcust (cdr pcust)
1128 plabel (cdr plabel)
1129 pcustg (cdr pcustg)
1130 printer (cdr printer)
1131 pprot (cdr pprot)
1132 i (1+ i))
1133 ))) ;; while/let
1134 ;; Loop over each parent class
1135 (setq ps (cdr ps)))
1136 ))
1137
1138
1139;;; CLOS methods and generics
1140;;
1141
1142(defun eieio--defgeneric-init-form (method doc-string)
1143 "Form to use for the initial definition of a generic."
1144 (cond
1145 ((or (not (fboundp method))
1146 (eq 'autoload (car-safe (symbol-function method))))
1147 ;; Make sure the method tables are installed.
1148 (eieiomt-install method)
1149 ;; Construct the actual body of this function.
1150 (eieio-defgeneric-form method doc-string))
1151 ((generic-p method) (symbol-function method)) ;Leave it as-is.
1152 (t (error "You cannot create a generic/method over an existing symbol: %s"
1153 method))))
1154
1155(defun eieio-defgeneric-form (method doc-string)
1156 "The lambda form that would be used as the function defined on METHOD.
1157All methods should call the same EIEIO function for dispatch.
1158DOC-STRING is the documentation attached to METHOD."
1159 `(lambda (&rest local-args)
1160 ,doc-string
1161 (eieio-generic-call (quote ,method) local-args)))
1162
1163(defsubst eieio-defgeneric-reset-generic-form (method)
1164 "Setup METHOD to call the generic form."
1165 (let ((doc-string (documentation method)))
1166 (fset method (eieio-defgeneric-form method doc-string))))
1167
1168(defun eieio-defgeneric-form-primary-only (method doc-string)
1169 "The lambda form that would be used as the function defined on METHOD.
1170All methods should call the same EIEIO function for dispatch.
1171DOC-STRING is the documentation attached to METHOD."
1172 `(lambda (&rest local-args)
1173 ,doc-string
1174 (eieio-generic-call-primary-only (quote ,method) local-args)))
1175
1176(defsubst eieio-defgeneric-reset-generic-form-primary-only (method)
1177 "Setup METHOD to call the generic form."
1178 (let ((doc-string (documentation method)))
1179 (fset method (eieio-defgeneric-form-primary-only method doc-string))))
1180
1181(defun eieio-defgeneric-form-primary-only-one (method doc-string
1182 class
1183 impl
1184 )
1185 "The lambda form that would be used as the function defined on METHOD.
1186All methods should call the same EIEIO function for dispatch.
1187DOC-STRING is the documentation attached to METHOD.
1188CLASS is the class symbol needed for private method access.
1189IMPL is the symbol holding the method implementation."
1190 ;; NOTE: I tried out byte compiling this little fcn. Turns out it
1191 ;; is faster to execute this for not byte-compiled. ie, install this,
1192 ;; then measure calls going through here. I wonder why.
1193 (require 'bytecomp)
1194 (let ((byte-compile-warnings nil))
1195 (byte-compile
1196 `(lambda (&rest local-args)
1197 ,doc-string
1198 ;; This is a cool cheat. Usually we need to look up in the
1199 ;; method table to find out if there is a method or not. We can
1200 ;; instead make that determination at load time when there is
1201 ;; only one method. If the first arg is not a child of the class
1202 ;; of that one implementation, then clearly, there is no method def.
1203 (if (not (eieio-object-p (car local-args)))
1204 ;; Not an object. Just signal.
1205 (signal 'no-method-definition
1206 (list ',method local-args))
1207
1208 ;; We do have an object. Make sure it is the right type.
1209 (if ,(if (eq class eieio-default-superclass)
1210 nil ; default superclass means just an obj. Already asked.
1211 `(not (child-of-class-p (eieio--object-class (car local-args))
1212 ',class)))
1213
1214 ;; If not the right kind of object, call no applicable
1215 (apply 'no-applicable-method (car local-args)
1216 ',method local-args)
1217
1218 ;; It is ok, do the call.
1219 ;; Fill in inter-call variables then evaluate the method.
1220 (let ((eieio-generic-call-next-method-list nil)
1221 (eieio-generic-call-key method-primary)
1222 (eieio-generic-call-methodname ',method)
1223 (eieio-generic-call-arglst local-args)
1224 )
1225 (eieio--with-scoped-class ',class
1226 ,(if (< emacs-major-version 24)
1227 `(apply ,(list 'quote impl) local-args)
1228 `(apply #',impl local-args)))
1229 ;(,impl local-args)
1230 )))))))
1231
1232(defsubst eieio-defgeneric-reset-generic-form-primary-only-one (method)
1233 "Setup METHOD to call the generic form."
1234 (let* ((doc-string (documentation method))
1235 (M (get method 'eieio-method-tree))
1236 (entry (car (aref M method-primary)))
1237 )
1238 (fset method (eieio-defgeneric-form-primary-only-one
1239 method doc-string
1240 (car entry)
1241 (cdr entry)
1242 ))))
1243
1244(defun eieio-unbind-method-implementations (method)
1245 "Make the generic method METHOD have no implementations.
1246It will leave the original generic function in place,
1247but remove reference to all implementations of METHOD."
1248 (put method 'eieio-method-tree nil)
1249 (put method 'eieio-method-obarray nil))
1250
1251(defun eieio--defmethod (method kind argclass code)
1252 "Work part of the `defmethod' macro defining METHOD with ARGS."
1253 (let ((key
1254 ;; Find optional keys.
1255 (cond ((memq kind '(:BEFORE :before)) method-before)
1256 ((memq kind '(:AFTER :after)) method-after)
1257 ((memq kind '(:STATIC :static)) method-static)
1258 ((memq kind '(:PRIMARY :primary nil)) method-primary)
1259 ;; Primary key.
1260 ;; (t method-primary)
1261 (t (error "Unknown method kind %S" kind)))))
1262 ;; Make sure there is a generic (when called from defclass).
1263 (eieio--defalias
1264 method (eieio--defgeneric-init-form
1265 method (or (documentation code)
1266 (format "Generically created method `%s'." method))))
1267 ;; Create symbol for property to bind to. If the first arg is of
1268 ;; the form (varname vartype) and `vartype' is a class, then
1269 ;; that class will be the type symbol. If not, then it will fall
1270 ;; under the type `primary' which is a non-specific calling of the
1271 ;; function.
1272 (if argclass
1273 (if (not (class-p argclass))
1274 (error "Unknown class type %s in method parameters"
1275 argclass))
1276 ;; Generics are higher.
1277 (setq key (eieio-specialized-key-to-generic-key key)))
1278 ;; Put this lambda into the symbol so we can find it.
1279 (eieiomt-add method code key argclass)
1280 )
1281
1282 (when eieio-optimize-primary-methods-flag
1283 ;; Optimizing step:
1284 ;;
1285 ;; If this method, after this setup, only has primary methods, then
1286 ;; we can setup the generic that way.
1287 (if (generic-primary-only-p method)
1288 ;; If there is only one primary method, then we can go one more
1289 ;; optimization step.
1290 (if (generic-primary-only-one-p method)
1291 (eieio-defgeneric-reset-generic-form-primary-only-one method)
1292 (eieio-defgeneric-reset-generic-form-primary-only method))
1293 (eieio-defgeneric-reset-generic-form method)))
1294
1295 method)
1296
1297;;; Slot type validation
1298
1299;; This is a hideous hack for replacing `typep' from cl-macs, to avoid
1300;; requiring the CL library at run-time. It can be eliminated if/when
1301;; `typep' is merged into Emacs core.
1302(defun eieio--typep (val type)
1303 (if (symbolp type)
1304 (cond ((get type 'cl-deftype-handler)
1305 (eieio--typep val (funcall (get type 'cl-deftype-handler))))
1306 ((eq type t) t)
1307 ((eq type 'null) (null val))
1308 ((eq type 'atom) (atom val))
1309 ((eq type 'float) (and (numberp val) (not (integerp val))))
1310 ((eq type 'real) (numberp val))
1311 ((eq type 'fixnum) (integerp val))
1312 ((memq type '(character string-char)) (characterp val))
1313 (t
1314 (let* ((name (symbol-name type))
1315 (namep (intern (concat name "p"))))
1316 (if (fboundp namep)
1317 (funcall `(lambda () (,namep val)))
1318 (funcall `(lambda ()
1319 (,(intern (concat name "-p")) val)))))))
1320 (cond ((get (car type) 'cl-deftype-handler)
1321 (eieio--typep val (apply (get (car type) 'cl-deftype-handler)
1322 (cdr type))))
1323 ((memq (car type) '(integer float real number))
1324 (and (eieio--typep val (car type))
1325 (or (memq (cadr type) '(* nil))
1326 (if (consp (cadr type))
1327 (> val (car (cadr type)))
1328 (>= val (cadr type))))
1329 (or (memq (caddr type) '(* nil))
1330 (if (consp (car (cddr type)))
1331 (< val (caar (cddr type)))
1332 (<= val (car (cddr type)))))))
1333 ((memq (car type) '(and or not))
1334 (eval (cons (car type)
1335 (mapcar (lambda (x)
1336 `(eieio--typep (quote ,val) (quote ,x)))
1337 (cdr type)))))
1338 ((memq (car type) '(member member*))
1339 (memql val (cdr type)))
1340 ((eq (car type) 'satisfies)
1341 (funcall `(lambda () (,(cadr type) val))))
1342 (t (error "Bad type spec: %s" type)))))
1343
1344(defun eieio-perform-slot-validation (spec value)
1345 "Return non-nil if SPEC does not match VALUE."
1346 (or (eq spec t) ; t always passes
1347 (eq value eieio-unbound) ; unbound always passes
1348 (eieio--typep value spec)))
1349
1350(defun eieio-validate-slot-value (class slot-idx value slot)
1351 "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
1352Checks the :type specifier.
1353SLOT is the slot that is being checked, and is only used when throwing
1354an error."
1355 (if eieio-skip-typecheck
1356 nil
1357 ;; Trim off object IDX junk added in for the object index.
1358 (setq slot-idx (- slot-idx 3))
1359 (let ((st (aref (eieio--class-public-type (class-v class)) slot-idx)))
1360 (if (not (eieio-perform-slot-validation st value))
1361 (signal 'invalid-slot-type (list class slot st value))))))
1362
1363(defun eieio-validate-class-slot-value (class slot-idx value slot)
1364 "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
1365Checks the :type specifier.
1366SLOT is the slot that is being checked, and is only used when throwing
1367an error."
1368 (if eieio-skip-typecheck
1369 nil
1370 (let ((st (aref (eieio--class-class-allocation-type (class-v class))
1371 slot-idx)))
1372 (if (not (eieio-perform-slot-validation st value))
1373 (signal 'invalid-slot-type (list class slot st value))))))
1374
1375(defun eieio-barf-if-slot-unbound (value instance slotname fn)
1376 "Throw a signal if VALUE is a representation of an UNBOUND slot.
1377INSTANCE is the object being referenced. SLOTNAME is the offending
1378slot. If the slot is ok, return VALUE.
1379Argument FN is the function calling this verifier."
1380 (if (and (eq value eieio-unbound) (not eieio-skip-typecheck))
1381 (slot-unbound instance (eieio--object-class instance) slotname fn)
1382 value))
1383
1384
1385;;; Get/Set slots in an object.
1386;;
1387(defun eieio-oref (obj slot)
1388 "Return the value in OBJ at SLOT in the object vector."
1389 (eieio--check-type (or eieio-object-p class-p) obj)
1390 (eieio--check-type symbolp slot)
1391 (if (class-p obj) (eieio-class-un-autoload obj))
1392 (let* ((class (if (class-p obj) obj (eieio--object-class obj)))
1393 (c (eieio-slot-name-index class obj slot)))
1394 (if (not c)
1395 ;; It might be missing because it is a :class allocated slot.
1396 ;; Let's check that info out.
1397 (if (setq c (eieio-class-slot-name-index class slot))
1398 ;; Oref that slot.
1399 (aref (eieio--class-class-allocation-values (class-v class)) c)
1400 ;; The slot-missing method is a cool way of allowing an object author
1401 ;; to intercept missing slot definitions. Since it is also the LAST
1402 ;; thing called in this fn, its return value would be retrieved.
1403 (slot-missing obj slot 'oref)
1404 ;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
1405 )
1406 (eieio--check-type eieio-object-p obj)
1407 (eieio-barf-if-slot-unbound (aref obj c) obj slot 'oref))))
1408
1409
1410(defun eieio-oref-default (obj slot)
1411 "Do the work for the macro `oref-default' with similar parameters.
1412Fills in OBJ's SLOT with its default value."
1413 (eieio--check-type (or eieio-object-p class-p) obj)
1414 (eieio--check-type symbolp slot)
1415 (let* ((cl (if (eieio-object-p obj) (eieio--object-class obj) obj))
1416 (c (eieio-slot-name-index cl obj slot)))
1417 (if (not c)
1418 ;; It might be missing because it is a :class allocated slot.
1419 ;; Let's check that info out.
1420 (if (setq c
1421 (eieio-class-slot-name-index cl slot))
1422 ;; Oref that slot.
1423 (aref (eieio--class-class-allocation-values (class-v cl))
1424 c)
1425 (slot-missing obj slot 'oref-default)
1426 ;;(signal 'invalid-slot-name (list (class-name cl) slot))
1427 )
1428 (eieio-barf-if-slot-unbound
1429 (let ((val (nth (- c 3) (eieio--class-public-d (class-v cl)))))
1430 (eieio-default-eval-maybe val))
1431 obj cl 'oref-default))))
1432
1433(defun eieio-default-eval-maybe (val)
1434 "Check VAL, and return what `oref-default' would provide."
1435 (cond
1436 ;; Is it a function call? If so, evaluate it.
1437 ((eieio-eval-default-p val)
1438 (eval val))
1439 ;;;; check for quoted things, and unquote them
1440 ;;((and (consp val) (eq (car val) 'quote))
1441 ;; (car (cdr val)))
1442 ;; return it verbatim
1443 (t val)))
1444
1445(defun eieio-oset (obj slot value)
1446 "Do the work for the macro `oset'.
1447Fills in OBJ's SLOT with VALUE."
1448 (eieio--check-type eieio-object-p obj)
1449 (eieio--check-type symbolp slot)
1450 (let ((c (eieio-slot-name-index (eieio--object-class obj) obj slot)))
1451 (if (not c)
1452 ;; It might be missing because it is a :class allocated slot.
1453 ;; Let's check that info out.
1454 (if (setq c
1455 (eieio-class-slot-name-index (eieio--object-class obj) slot))
1456 ;; Oset that slot.
1457 (progn
1458 (eieio-validate-class-slot-value (eieio--object-class obj) c value slot)
1459 (aset (eieio--class-class-allocation-values (class-v (eieio--object-class obj)))
1460 c value))
1461 ;; See oref for comment on `slot-missing'
1462 (slot-missing obj slot 'oset value)
1463 ;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
1464 )
1465 (eieio-validate-slot-value (eieio--object-class obj) c value slot)
1466 (aset obj c value))))
1467
1468(defun eieio-oset-default (class slot value)
1469 "Do the work for the macro `oset-default'.
1470Fills in the default value in CLASS' in SLOT with VALUE."
1471 (eieio--check-type class-p class)
1472 (eieio--check-type symbolp slot)
1473 (eieio--with-scoped-class class
1474 (let* ((c (eieio-slot-name-index class nil slot)))
1475 (if (not c)
1476 ;; It might be missing because it is a :class allocated slot.
1477 ;; Let's check that info out.
1478 (if (setq c (eieio-class-slot-name-index class slot))
1479 (progn
1480 ;; Oref that slot.
1481 (eieio-validate-class-slot-value class c value slot)
1482 (aset (eieio--class-class-allocation-values (class-v class)) c
1483 value))
1484 (signal 'invalid-slot-name (list (eieio-class-name class) slot)))
1485 (eieio-validate-slot-value class c value slot)
1486 ;; Set this into the storage for defaults.
1487 (setcar (nthcdr (- c 3) (eieio--class-public-d (class-v class)))
1488 value)
1489 ;; Take the value, and put it into our cache object.
1490 (eieio-oset (eieio--class-default-object-cache (class-v class))
1491 slot value)
1492 ))))
1493
1494
1495;;; EIEIO internal search functions
1496;;
1497(defun eieio-slot-originating-class-p (start-class slot)
1498 "Return non-nil if START-CLASS is the first class to define SLOT.
1499This is for testing if the class currently in scope is the class that defines SLOT
1500so that we can protect private slots."
1501 (let ((par (eieio-class-parents-fast start-class))
1502 (ret t))
1503 (if (not par)
1504 t
1505 (while (and par ret)
1506 (if (intern-soft (symbol-name slot)
1507 (eieio--class-symbol-obarray (class-v (car par))))
1508 (setq ret nil))
1509 (setq par (cdr par)))
1510 ret)))
1511
1512(defun eieio-slot-name-index (class obj slot)
1513 "In CLASS for OBJ find the index of the named SLOT.
1514The slot is a symbol which is installed in CLASS by the `defclass'
1515call. OBJ can be nil, but if it is an object, and the slot in question
1516is protected, access will be allowed if OBJ is a child of the currently
1517scoped class.
1518If SLOT is the value created with :initarg instead,
1519reverse-lookup that name, and recurse with the associated slot value."
1520 ;; Removed checks to outside this call
1521 (let* ((fsym (intern-soft (symbol-name slot)
1522 (eieio--class-symbol-obarray (class-v class))))
1523 (fsi (if (symbolp fsym) (symbol-value fsym) nil)))
1524 (if (integerp fsi)
1525 (cond
1526 ((not (get fsym 'protection))
1527 (+ 3 fsi))
1528 ((and (eq (get fsym 'protection) 'protected)
1529 (eieio--scoped-class)
1530 (or (child-of-class-p class (eieio--scoped-class))
1531 (and (eieio-object-p obj)
1532 (child-of-class-p class (eieio--object-class obj)))))
1533 (+ 3 fsi))
1534 ((and (eq (get fsym 'protection) 'private)
1535 (or (and (eieio--scoped-class)
1536 (eieio-slot-originating-class-p (eieio--scoped-class) slot))
1537 eieio-initializing-object))
1538 (+ 3 fsi))
1539 (t nil))
1540 (let ((fn (eieio-initarg-to-attribute class slot)))
1541 (if fn (eieio-slot-name-index class obj fn) nil)))))
1542
1543(defun eieio-class-slot-name-index (class slot)
1544 "In CLASS find the index of the named SLOT.
1545The slot is a symbol which is installed in CLASS by the `defclass'
1546call. If SLOT is the value created with :initarg instead,
1547reverse-lookup that name, and recurse with the associated slot value."
1548 ;; This will happen less often, and with fewer slots. Do this the
1549 ;; storage cheap way.
1550 (let* ((a (eieio--class-class-allocation-a (class-v class)))
1551 (l1 (length a))
1552 (af (memq slot a))
1553 (l2 (length af)))
1554 ;; Slot # is length of the total list, minus the remaining list of
1555 ;; the found slot.
1556 (if af (- l1 l2))))
1557
1558;;;
1559;; Way to assign slots based on a list. Used for constructors, or
1560;; even resetting an object at run-time
1561;;
1562(defun eieio-set-defaults (obj &optional set-all)
1563 "Take object OBJ, and reset all slots to their defaults.
1564If SET-ALL is non-nil, then when a default is nil, that value is
1565reset. If SET-ALL is nil, the slots are only reset if the default is
1566not nil."
1567 (eieio--with-scoped-class (eieio--object-class obj)
1568 (let ((eieio-initializing-object t)
1569 (pub (eieio--class-public-a (class-v (eieio--object-class obj)))))
1570 (while pub
1571 (let ((df (eieio-oref-default obj (car pub))))
1572 (if (or df set-all)
1573 (eieio-oset obj (car pub) df)))
1574 (setq pub (cdr pub))))))
1575
1576(defun eieio-initarg-to-attribute (class initarg)
1577 "For CLASS, convert INITARG to the actual attribute name.
1578If there is no translation, pass it in directly (so we can cheat if
1579need be... May remove that later...)"
1580 (let ((tuple (assoc initarg (eieio--class-initarg-tuples (class-v class)))))
1581 (if tuple
1582 (cdr tuple)
1583 nil)))
1584
1585(defun eieio-attribute-to-initarg (class attribute)
1586 "In CLASS, convert the ATTRIBUTE into the corresponding init argument tag.
1587This is usually a symbol that starts with `:'."
1588 (let ((tuple (rassoc attribute (eieio--class-initarg-tuples (class-v class)))))
1589 (if tuple
1590 (car tuple)
1591 nil)))
1592
1593;;;
1594;; Method Invocation order: C3
1595(defun eieio-c3-candidate (class remaining-inputs)
1596 "Return CLASS if it can go in the result now, otherwise nil"
1597 ;; Ensure CLASS is not in any position but the first in any of the
1598 ;; element lists of REMAINING-INPUTS.
1599 (and (not (let ((found nil))
1600 (while (and remaining-inputs (not found))
1601 (setq found (member class (cdr (car remaining-inputs)))
1602 remaining-inputs (cdr remaining-inputs)))
1603 found))
1604 class))
1605
1606(defun eieio-c3-merge-lists (reversed-partial-result remaining-inputs)
1607 "Merge REVERSED-PARTIAL-RESULT REMAINING-INPUTS in a consistent order, if possible.
1608If a consistent order does not exist, signal an error."
1609 (if (let ((tail remaining-inputs)
1610 (found nil))
1611 (while (and tail (not found))
1612 (setq found (car tail) tail (cdr tail)))
1613 (not found))
1614 ;; If all remaining inputs are empty lists, we are done.
1615 (nreverse reversed-partial-result)
1616 ;; Otherwise, we try to find the next element of the result. This
1617 ;; is achieved by considering the first element of each
1618 ;; (non-empty) input list and accepting a candidate if it is
1619 ;; consistent with the rests of the input lists.
1620 (let* ((found nil)
1621 (tail remaining-inputs)
1622 (next (progn
1623 (while (and tail (not found))
1624 (setq found (and (car tail)
1625 (eieio-c3-candidate (caar tail)
1626 remaining-inputs))
1627 tail (cdr tail)))
1628 found)))
1629 (if next
1630 ;; The graph is consistent so far, add NEXT to result and
1631 ;; merge input lists, dropping NEXT from their heads where
1632 ;; applicable.
1633 (eieio-c3-merge-lists
1634 (cons next reversed-partial-result)
1635 (mapcar (lambda (l) (if (eq (first l) next) (rest l) l))
1636 remaining-inputs))
1637 ;; The graph is inconsistent, give up
1638 (signal 'inconsistent-class-hierarchy (list remaining-inputs))))))
1639
1640(defun eieio-class-precedence-c3 (class)
1641 "Return all parents of CLASS in c3 order."
1642 (let ((parents (eieio-class-parents-fast class)))
1643 (eieio-c3-merge-lists
1644 (list class)
1645 (append
1646 (or
1647 (mapcar
1648 (lambda (x)
1649 (eieio-class-precedence-c3 x))
1650 parents)
1651 '((eieio-default-superclass)))
1652 (list parents))))
1653 )
1654;;;
1655;; Method Invocation Order: Depth First
1656
1657(defun eieio-class-precedence-dfs (class)
1658 "Return all parents of CLASS in depth-first order."
1659 (let* ((parents (eieio-class-parents-fast class))
1660 (classes (copy-sequence
1661 (apply #'append
1662 (list class)
1663 (or
1664 (mapcar
1665 (lambda (parent)
1666 (cons parent
1667 (eieio-class-precedence-dfs parent)))
1668 parents)
1669 '((eieio-default-superclass))))))
1670 (tail classes))
1671 ;; Remove duplicates.
1672 (while tail
1673 (setcdr tail (delq (car tail) (cdr tail)))
1674 (setq tail (cdr tail)))
1675 classes))
1676
1677;;;
1678;; Method Invocation Order: Breadth First
1679(defun eieio-class-precedence-bfs (class)
1680 "Return all parents of CLASS in breadth-first order."
1681 (let ((result)
1682 (queue (or (eieio-class-parents-fast class)
1683 '(eieio-default-superclass))))
1684 (while queue
1685 (let ((head (pop queue)))
1686 (unless (member head result)
1687 (push head result)
1688 (unless (eq head 'eieio-default-superclass)
1689 (setq queue (append queue (or (eieio-class-parents-fast head)
1690 '(eieio-default-superclass))))))))
1691 (cons class (nreverse result)))
1692 )
1693
1694;;;
1695;; Method Invocation Order
1696
1697(defun eieio-class-precedence-list (class)
1698 "Return (transitively closed) list of parents of CLASS.
1699The order, in which the parents are returned depends on the
1700method invocation orders of the involved classes."
1701 (if (or (null class) (eq class 'eieio-default-superclass))
1702 nil
1703 (case (class-method-invocation-order class)
1704 (:depth-first
1705 (eieio-class-precedence-dfs class))
1706 (:breadth-first
1707 (eieio-class-precedence-bfs class))
1708 (:c3
1709 (eieio-class-precedence-c3 class))))
1710 )
1711(define-obsolete-function-alias
1712 'class-precedence-list 'eieio-class-precedence-list "24.4")
1713
1714
1715;;; CLOS generics internal function handling
1716;;
1717(defvar eieio-generic-call-methodname nil
1718 "When using `call-next-method', provides a context on how to do it.")
1719(defvar eieio-generic-call-arglst nil
1720 "When using `call-next-method', provides a context for parameters.")
1721(defvar eieio-generic-call-key nil
1722 "When using `call-next-method', provides a context for the current key.
1723Keys are a number representing :before, :primary, and :after methods.")
1724(defvar eieio-generic-call-next-method-list nil
1725 "When executing a PRIMARY or STATIC method, track the 'next-method'.
1726During executions, the list is first generated, then as each next method
1727is called, the next method is popped off the stack.")
1728
1729(define-obsolete-variable-alias 'eieio-pre-method-execution-hooks
1730 'eieio-pre-method-execution-functions "24.3")
1731(defvar eieio-pre-method-execution-functions nil
1732 "Abnormal hook run just before an EIEIO method is executed.
1733The hook function must accept one argument, the list of forms
1734about to be executed.")
1735
1736(defun eieio-generic-call (method args)
1737 "Call METHOD with ARGS.
1738ARGS provides the context on which implementation to use.
1739This should only be called from a generic function."
1740 ;; We must expand our arguments first as they are always
1741 ;; passed in as quoted symbols
1742 (let ((newargs nil) (mclass nil) (lambdas nil) (tlambdas nil) (keys nil)
1743 (eieio-generic-call-methodname method)
1744 (eieio-generic-call-arglst args)
1745 (firstarg nil)
1746 (primarymethodlist nil))
1747 ;; get a copy
1748 (setq newargs args
1749 firstarg (car newargs))
1750 ;; Is the class passed in autoloaded?
1751 ;; Since class names are also constructors, they can be autoloaded
1752 ;; via the autoload command. Check for this, and load them in.
1753 ;; It is ok if it doesn't turn out to be a class. Probably want that
1754 ;; function loaded anyway.
1755 (if (and (symbolp firstarg)
1756 (fboundp firstarg)
1757 (listp (symbol-function firstarg))
1758 (eq 'autoload (car (symbol-function firstarg))))
1759 (load (nth 1 (symbol-function firstarg))))
1760 ;; Determine the class to use.
1761 (cond ((eieio-object-p firstarg)
1762 (setq mclass (eieio--object-class firstarg)))
1763 ((class-p firstarg)
1764 (setq mclass firstarg))
1765 )
1766 ;; Make sure the class is a valid class
1767 ;; mclass can be nil (meaning a generic for should be used.
1768 ;; mclass cannot have a value that is not a class, however.
1769 (when (and (not (null mclass)) (not (class-p mclass)))
1770 (error "Cannot dispatch method %S on class %S"
1771 method mclass)
1772 )
1773 ;; Now create a list in reverse order of all the calls we have
1774 ;; make in order to successfully do this right. Rules:
1775 ;; 1) Only call generics if scoped-class is not defined
1776 ;; This prevents multiple calls in the case of recursion
1777 ;; 2) Only call static if this is a static method.
1778 ;; 3) Only call specifics if the definition allows for them.
1779 ;; 4) Call in order based on :before, :primary, and :after
1780 (when (eieio-object-p firstarg)
1781 ;; Non-static calls do all this stuff.
1782
1783 ;; :after methods
1784 (setq tlambdas
1785 (if mclass
1786 (eieiomt-method-list method method-after mclass)
1787 (list (eieio-generic-form method method-after nil)))
1788 ;;(or (and mclass (eieio-generic-form method method-after mclass))
1789 ;; (eieio-generic-form method method-after nil))
1790 )
1791 (setq lambdas (append tlambdas lambdas)
1792 keys (append (make-list (length tlambdas) method-after) keys))
1793
1794 ;; :primary methods
1795 (setq tlambdas
1796 (or (and mclass (eieio-generic-form method method-primary mclass))
1797 (eieio-generic-form method method-primary nil)))
1798 (when tlambdas
1799 (setq lambdas (cons tlambdas lambdas)
1800 keys (cons method-primary keys)
1801 primarymethodlist
1802 (eieiomt-method-list method method-primary mclass)))
1803
1804 ;; :before methods
1805 (setq tlambdas
1806 (if mclass
1807 (eieiomt-method-list method method-before mclass)
1808 (list (eieio-generic-form method method-before nil)))
1809 ;;(or (and mclass (eieio-generic-form method method-before mclass))
1810 ;; (eieio-generic-form method method-before nil))
1811 )
1812 (setq lambdas (append tlambdas lambdas)
1813 keys (append (make-list (length tlambdas) method-before) keys))
1814 )
1815
1816 (if mclass
1817 ;; For the case of a class,
1818 ;; if there were no methods found, then there could be :static methods.
1819 (when (not lambdas)
1820 (setq tlambdas
1821 (eieio-generic-form method method-static mclass))
1822 (setq lambdas (cons tlambdas lambdas)
1823 keys (cons method-static keys)
1824 primarymethodlist ;; Re-use even with bad name here
1825 (eieiomt-method-list method method-static mclass)))
1826 ;; For the case of no class (ie - mclass == nil) then there may
1827 ;; be a primary method.
1828 (setq tlambdas
1829 (eieio-generic-form method method-primary nil))
1830 (when tlambdas
1831 (setq lambdas (cons tlambdas lambdas)
1832 keys (cons method-primary keys)
1833 primarymethodlist
1834 (eieiomt-method-list method method-primary nil)))
1835 )
1836
1837 (run-hook-with-args 'eieio-pre-method-execution-functions
1838 primarymethodlist)
1839
1840 ;; Now loop through all occurrences forms which we must execute
1841 ;; (which are happily sorted now) and execute them all!
1842 (let ((rval nil) (lastval nil) (rvalever nil) (found nil))
1843 (while lambdas
1844 (if (car lambdas)
1845 (eieio--with-scoped-class (cdr (car lambdas))
1846 (let* ((eieio-generic-call-key (car keys))
1847 (has-return-val
1848 (or (= eieio-generic-call-key method-primary)
1849 (= eieio-generic-call-key method-static)))
1850 (eieio-generic-call-next-method-list
1851 ;; Use the cdr, as the first element is the fcn
1852 ;; we are calling right now.
1853 (when has-return-val (cdr primarymethodlist)))
1854 )
1855 (setq found t)
1856 ;;(setq rval (apply (car (car lambdas)) newargs))
1857 (setq lastval (apply (car (car lambdas)) newargs))
1858 (when has-return-val
1859 (setq rval lastval
1860 rvalever t))
1861 )))
1862 (setq lambdas (cdr lambdas)
1863 keys (cdr keys)))
1864 (if (not found)
1865 (if (eieio-object-p (car args))
1866 (setq rval (apply 'no-applicable-method (car args) method args)
1867 rvalever t)
1868 (signal
1869 'no-method-definition
1870 (list method args))))
1871 ;; Right Here... it could be that lastval is returned when
1872 ;; rvalever is nil. Is that right?
1873 rval)))
1874
1875(defun eieio-generic-call-primary-only (method args)
1876 "Call METHOD with ARGS for methods with only :PRIMARY implementations.
1877ARGS provides the context on which implementation to use.
1878This should only be called from a generic function.
1879
1880This method is like `eieio-generic-call', but only
1881implementations in the :PRIMARY slot are queried. After many
1882years of use, it appears that over 90% of methods in use
1883have :PRIMARY implementations only. We can therefore optimize
1884for this common case to improve performance."
1885 ;; We must expand our arguments first as they are always
1886 ;; passed in as quoted symbols
1887 (let ((newargs nil) (mclass nil) (lambdas nil)
1888 (eieio-generic-call-methodname method)
1889 (eieio-generic-call-arglst args)
1890 (firstarg nil)
1891 (primarymethodlist nil)
1892 )
1893 ;; get a copy
1894 (setq newargs args
1895 firstarg (car newargs))
1896
1897 ;; Determine the class to use.
1898 (cond ((eieio-object-p firstarg)
1899 (setq mclass (eieio--object-class firstarg)))
1900 ((not firstarg)
1901 (error "Method %s called on nil" method))
1902 ((not (eieio-object-p firstarg))
1903 (error "Primary-only method %s called on something not an object" method))
1904 (t
1905 (error "EIEIO Error: Improperly classified method %s as primary only"
1906 method)
1907 ))
1908 ;; Make sure the class is a valid class
1909 ;; mclass can be nil (meaning a generic for should be used.
1910 ;; mclass cannot have a value that is not a class, however.
1911 (when (null mclass)
1912 (error "Cannot dispatch method %S on class %S" method mclass)
1913 )
1914
1915 ;; :primary methods
1916 (setq lambdas (eieio-generic-form method method-primary mclass))
1917 (setq primarymethodlist ;; Re-use even with bad name here
1918 (eieiomt-method-list method method-primary mclass))
1919
1920 ;; Now loop through all occurrences forms which we must execute
1921 ;; (which are happily sorted now) and execute them all!
1922 (eieio--with-scoped-class (cdr lambdas)
1923 (let* ((rval nil) (lastval nil) (rvalever nil)
1924 (eieio-generic-call-key method-primary)
1925 ;; Use the cdr, as the first element is the fcn
1926 ;; we are calling right now.
1927 (eieio-generic-call-next-method-list (cdr primarymethodlist))
1928 )
1929
1930 (if (or (not lambdas) (not (car lambdas)))
1931
1932 ;; No methods found for this impl...
1933 (if (eieio-object-p (car args))
1934 (setq rval (apply 'no-applicable-method (car args) method args)
1935 rvalever t)
1936 (signal
1937 'no-method-definition
1938 (list method args)))
1939
1940 ;; Do the regular implementation here.
1941
1942 (run-hook-with-args 'eieio-pre-method-execution-functions
1943 lambdas)
1944
1945 (setq lastval (apply (car lambdas) newargs))
1946 (setq rval lastval
1947 rvalever t)
1948 )
1949
1950 ;; Right Here... it could be that lastval is returned when
1951 ;; rvalever is nil. Is that right?
1952 rval))))
1953
1954(defun eieiomt-method-list (method key class)
1955 "Return an alist list of methods lambdas.
1956METHOD is the method name.
1957KEY represents either :before, or :after methods.
1958CLASS is the starting class to search from in the method tree.
1959If CLASS is nil, then an empty list of methods should be returned."
1960 ;; Note: eieiomt - the MT means MethodTree. See more comments below
1961 ;; for the rest of the eieiomt methods.
1962
1963 ;; Collect lambda expressions stored for the class and its parent
1964 ;; classes.
1965 (let (lambdas)
1966 (dolist (ancestor (eieio-class-precedence-list class))
1967 ;; Lookup the form to use for the PRIMARY object for the next level
1968 (let ((tmpl (eieio-generic-form method key ancestor)))
1969 (when (and tmpl
1970 (or (not lambdas)
1971 ;; This prevents duplicates coming out of the
1972 ;; class method optimizer. Perhaps we should
1973 ;; just not optimize before/afters?
1974 (not (member tmpl lambdas))))
1975 (push tmpl lambdas))))
1976
1977 ;; Return collected lambda. For :after methods, return in current
1978 ;; order (most general class last); Otherwise, reverse order.
1979 (if (eq key method-after)
1980 lambdas
1981 (nreverse lambdas))))
1982
1983
1984;;;
1985;; eieio-method-tree : eieiomt-
1986;;
1987;; Stored as eieio-method-tree in property list of a generic method
1988;;
1989;; (eieio-method-tree . [BEFORE PRIMARY AFTER
1990;; genericBEFORE genericPRIMARY genericAFTER])
1991;; and
1992;; (eieio-method-obarray . [BEFORE PRIMARY AFTER
1993;; genericBEFORE genericPRIMARY genericAFTER])
1994;; where the association is a vector.
1995;; (aref 0 -- all static methods.
1996;; (aref 1 -- all methods classified as :before
1997;; (aref 2 -- all methods classified as :primary
1998;; (aref 3 -- all methods classified as :after
1999;; (aref 4 -- a generic classified as :before
2000;; (aref 5 -- a generic classified as :primary
2001;; (aref 6 -- a generic classified as :after
2002;;
2003(defvar eieiomt-optimizing-obarray nil
2004 "While mapping atoms, this contain the obarray being optimized.")
2005
2006(defun eieiomt-install (method-name)
2007 "Install the method tree, and obarray onto METHOD-NAME.
2008Do not do the work if they already exist."
2009 (let ((emtv (get method-name 'eieio-method-tree))
2010 (emto (get method-name 'eieio-method-obarray)))
2011 (if (or (not emtv) (not emto))
2012 (progn
2013 (setq emtv (put method-name 'eieio-method-tree
2014 (make-vector method-num-slots nil))
2015 emto (put method-name 'eieio-method-obarray
2016 (make-vector method-num-slots nil)))
2017 (aset emto 0 (make-vector 11 0))
2018 (aset emto 1 (make-vector 11 0))
2019 (aset emto 2 (make-vector 41 0))
2020 (aset emto 3 (make-vector 11 0))
2021 ))))
2022
2023(defun eieiomt-add (method-name method key class)
2024 "Add to METHOD-NAME the forms METHOD in a call position KEY for CLASS.
2025METHOD-NAME is the name created by a call to `defgeneric'.
2026METHOD are the forms for a given implementation.
2027KEY is an integer (see comment in eieio.el near this function) which
2028is associated with the :static :before :primary and :after tags.
2029It also indicates if CLASS is defined or not.
2030CLASS is the class this method is associated with."
2031 (if (or (> key method-num-slots) (< key 0))
2032 (error "eieiomt-add: method key error!"))
2033 (let ((emtv (get method-name 'eieio-method-tree))
2034 (emto (get method-name 'eieio-method-obarray)))
2035 ;; Make sure the method tables are available.
2036 (if (or (not emtv) (not emto))
2037 (error "Programmer error: eieiomt-add"))
2038 ;; only add new cells on if it doesn't already exist!
2039 (if (assq class (aref emtv key))
2040 (setcdr (assq class (aref emtv key)) method)
2041 (aset emtv key (cons (cons class method) (aref emtv key))))
2042 ;; Add function definition into newly created symbol, and store
2043 ;; said symbol in the correct obarray, otherwise use the
2044 ;; other array to keep this stuff
2045 (if (< key method-num-lists)
2046 (let ((nsym (intern (symbol-name class) (aref emto key))))
2047 (fset nsym method)))
2048 ;; Save the defmethod file location in a symbol property.
2049 (let ((fname (if load-in-progress
2050 load-file-name
2051 buffer-file-name))
2052 loc)
2053 (when fname
2054 (when (string-match "\\.elc$" fname)
2055 (setq fname (substring fname 0 (1- (length fname)))))
2056 (setq loc (get method-name 'method-locations))
2057 (pushnew (list class fname) loc :test 'equal)
2058 (put method-name 'method-locations loc)))
2059 ;; Now optimize the entire obarray
2060 (if (< key method-num-lists)
2061 (let ((eieiomt-optimizing-obarray (aref emto key)))
2062 ;; @todo - Is this overkill? Should we just clear the symbol?
2063 (mapatoms 'eieiomt-sym-optimize eieiomt-optimizing-obarray)))
2064 ))
2065
2066(defun eieiomt-next (class)
2067 "Return the next parent class for CLASS.
2068If CLASS is a superclass, return variable `eieio-default-superclass'.
2069If CLASS is variable `eieio-default-superclass' then return nil.
2070This is different from function `class-parent' as class parent returns
2071nil for superclasses. This function performs no type checking!"
2072 ;; No type-checking because all calls are made from functions which
2073 ;; are safe and do checking for us.
2074 (or (eieio-class-parents-fast class)
2075 (if (eq class 'eieio-default-superclass)
2076 nil
2077 '(eieio-default-superclass))))
2078
2079(defun eieiomt-sym-optimize (s)
2080 "Find the next class above S which has a function body for the optimizer."
2081 ;; Set the value to nil in case there is no nearest cell.
2082 (set s nil)
2083 ;; Find the nearest cell that has a function body. If we find one,
2084 ;; we replace the nil from above.
2085 (let ((external-symbol (intern-soft (symbol-name s))))
2086 (catch 'done
2087 (dolist (ancestor (rest (eieio-class-precedence-list external-symbol)))
2088 (let ((ov (intern-soft (symbol-name ancestor)
2089 eieiomt-optimizing-obarray)))
2090 (when (fboundp ov)
2091 (set s ov) ;; store ov as our next symbol
2092 (throw 'done ancestor)))))))
2093
2094(defun eieio-generic-form (method key class)
2095 "Return the lambda form belonging to METHOD using KEY based upon CLASS.
2096If CLASS is not a class then use `generic' instead. If class has
2097no form, but has a parent class, then trace to that parent class.
2098The first time a form is requested from a symbol, an optimized path
2099is memorized for faster future use."
2100 (let ((emto (aref (get method 'eieio-method-obarray)
2101 (if class key (eieio-specialized-key-to-generic-key key)))))
2102 (if (class-p class)
2103 ;; 1) find our symbol
2104 (let ((cs (intern-soft (symbol-name class) emto)))
2105 (if (not cs)
2106 ;; 2) If there isn't one, then make one.
2107 ;; This can be slow since it only occurs once
2108 (progn
2109 (setq cs (intern (symbol-name class) emto))
2110 ;; 2.1) Cache its nearest neighbor with a quick optimize
2111 ;; which should only occur once for this call ever
2112 (let ((eieiomt-optimizing-obarray emto))
2113 (eieiomt-sym-optimize cs))))
2114 ;; 3) If it's bound return this one.
2115 (if (fboundp cs)
2116 (cons cs (eieio--class-symbol (class-v class)))
2117 ;; 4) If it's not bound then this variable knows something
2118 (if (symbol-value cs)
2119 (progn
2120 ;; 4.1) This symbol holds the next class in its value
2121 (setq class (symbol-value cs)
2122 cs (intern-soft (symbol-name class) emto))
2123 ;; 4.2) The optimizer should always have chosen a
2124 ;; function-symbol
2125 ;;(if (fboundp cs)
2126 (cons cs (eieio--class-symbol (class-v (intern (symbol-name class)))))
2127 ;;(error "EIEIO optimizer: erratic data loss!"))
2128 )
2129 ;; There never will be a funcall...
2130 nil)))
2131 ;; for a generic call, what is a list, is the function body we want.
2132 (let ((emtl (aref (get method 'eieio-method-tree)
2133 (if class key (eieio-specialized-key-to-generic-key key)))))
2134 (if emtl
2135 ;; The car of EMTL is supposed to be a class, which in this
2136 ;; case is nil, so skip it.
2137 (cons (cdr (car emtl)) nil)
2138 nil)))))
2139
2140
2141;;; Here are some special types of errors
2142;;
2143(intern "no-method-definition")
2144(put 'no-method-definition 'error-conditions '(no-method-definition error))
2145(put 'no-method-definition 'error-message "No method definition")
2146
2147(intern "no-next-method")
2148(put 'no-next-method 'error-conditions '(no-next-method error))
2149(put 'no-next-method 'error-message "No next method")
2150
2151(intern "invalid-slot-name")
2152(put 'invalid-slot-name 'error-conditions '(invalid-slot-name error))
2153(put 'invalid-slot-name 'error-message "Invalid slot name")
2154
2155(intern "invalid-slot-type")
2156(put 'invalid-slot-type 'error-conditions '(invalid-slot-type error nil))
2157(put 'invalid-slot-type 'error-message "Invalid slot type")
2158
2159(intern "unbound-slot")
2160(put 'unbound-slot 'error-conditions '(unbound-slot error nil))
2161(put 'unbound-slot 'error-message "Unbound slot")
2162
2163(intern "inconsistent-class-hierarchy")
2164(put 'inconsistent-class-hierarchy 'error-conditions
2165 '(inconsistent-class-hierarchy error nil))
2166(put 'inconsistent-class-hierarchy 'error-message "Inconsistent class hierarchy")
2167
2168;;; Obsolete backward compatibility functions.
2169;; Needed to run byte-code compiled with the EIEIO of Emacs-23.
2170
2171(defun eieio-defmethod (method args)
2172 "Obsolete work part of an old version of the `defmethod' macro."
2173 (let ((key nil) (body nil) (firstarg nil) (argfix nil) (argclass nil) loopa)
2174 ;; find optional keys
2175 (setq key
2176 (cond ((memq (car args) '(:BEFORE :before))
2177 (setq args (cdr args))
2178 method-before)
2179 ((memq (car args) '(:AFTER :after))
2180 (setq args (cdr args))
2181 method-after)
2182 ((memq (car args) '(:STATIC :static))
2183 (setq args (cdr args))
2184 method-static)
2185 ((memq (car args) '(:PRIMARY :primary))
2186 (setq args (cdr args))
2187 method-primary)
2188 ;; Primary key.
2189 (t method-primary)))
2190 ;; Get body, and fix contents of args to be the arguments of the fn.
2191 (setq body (cdr args)
2192 args (car args))
2193 (setq loopa args)
2194 ;; Create a fixed version of the arguments.
2195 (while loopa
2196 (setq argfix (cons (if (listp (car loopa)) (car (car loopa)) (car loopa))
2197 argfix))
2198 (setq loopa (cdr loopa)))
2199 ;; Make sure there is a generic.
2200 (eieio-defgeneric
2201 method
2202 (if (stringp (car body))
2203 (car body) (format "Generically created method `%s'." method)))
2204 ;; create symbol for property to bind to. If the first arg is of
2205 ;; the form (varname vartype) and `vartype' is a class, then
2206 ;; that class will be the type symbol. If not, then it will fall
2207 ;; under the type `primary' which is a non-specific calling of the
2208 ;; function.
2209 (setq firstarg (car args))
2210 (if (listp firstarg)
2211 (progn
2212 (setq argclass (nth 1 firstarg))
2213 (if (not (class-p argclass))
2214 (error "Unknown class type %s in method parameters"
2215 (nth 1 firstarg))))
2216 ;; Generics are higher.
2217 (setq key (eieio-specialized-key-to-generic-key key)))
2218 ;; Put this lambda into the symbol so we can find it.
2219 (if (byte-code-function-p (car-safe body))
2220 (eieiomt-add method (car-safe body) key argclass)
2221 (eieiomt-add method (append (list 'lambda (reverse argfix)) body)
2222 key argclass))
2223 )
2224
2225 (when eieio-optimize-primary-methods-flag
2226 ;; Optimizing step:
2227 ;;
2228 ;; If this method, after this setup, only has primary methods, then
2229 ;; we can setup the generic that way.
2230 (if (generic-primary-only-p method)
2231 ;; If there is only one primary method, then we can go one more
2232 ;; optimization step.
2233 (if (generic-primary-only-one-p method)
2234 (eieio-defgeneric-reset-generic-form-primary-only-one method)
2235 (eieio-defgeneric-reset-generic-form-primary-only method))
2236 (eieio-defgeneric-reset-generic-form method)))
2237
2238 method)
2239(make-obsolete 'eieio-defmethod 'eieio--defmethod "24.1")
2240
2241(defun eieio-defgeneric (method doc-string)
2242 "Obsolete work part of an old version of the `defgeneric' macro."
2243 (if (and (fboundp method) (not (generic-p method))
2244 (or (byte-code-function-p (symbol-function method))
2245 (not (eq 'autoload (car (symbol-function method)))))
2246 )
2247 (error "You cannot create a generic/method over an existing symbol: %s"
2248 method))
2249 ;; Don't do this over and over.
2250 (unless (fboundp 'method)
2251 ;; This defun tells emacs where the first definition of this
2252 ;; method is defined.
2253 `(defun ,method nil)
2254 ;; Make sure the method tables are installed.
2255 (eieiomt-install method)
2256 ;; Apply the actual body of this function.
2257 (fset method (eieio-defgeneric-form method doc-string))
2258 ;; Return the method
2259 'method))
2260(make-obsolete 'eieio-defgeneric nil "24.1")
2261
2262(provide 'eieio-core)
2263
2264;;; eieio-core.el ends here
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 37b1ec5fa94..3cdf1f078bd 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -54,223 +54,7 @@
54 (interactive) 54 (interactive)
55 (message eieio-version)) 55 (message eieio-version))
56 56
57(eval-and-compile 57(require 'eieio-core)
58;; About the above. EIEIO must process its own code when it compiles
59;; itself, thus, by eval-and-compiling ourselves, we solve the problem.
60
61;; Compatibility
62(if (fboundp 'compiled-function-arglist)
63
64 ;; XEmacs can only access a compiled functions arglist like this:
65 (defalias 'eieio-compiled-function-arglist 'compiled-function-arglist)
66
67 ;; Emacs doesn't have this function, but since FUNC is a vector, we can just
68 ;; grab the appropriate element.
69 (defun eieio-compiled-function-arglist (func)
70 "Return the argument list for the compiled function FUNC."
71 (aref func 0))
72
73 )
74
75
76;;;
77;; Variable declarations.
78;;
79
80(defvar eieio-hook nil
81 "This hook is executed, then cleared each time `defclass' is called.")
82
83(defvar eieio-error-unsupported-class-tags nil
84 "Non-nil to throw an error if an encountered tag is unsupported.
85This may prevent classes from CLOS applications from being used with EIEIO
86since EIEIO does not support all CLOS tags.")
87
88(defvar eieio-skip-typecheck nil
89 "If non-nil, skip all slot typechecking.
90Set this to t permanently if a program is functioning well to get a
91small speed increase. This variable is also used internally to handle
92default setting for optimization purposes.")
93
94(defvar eieio-optimize-primary-methods-flag t
95 "Non-nil means to optimize the method dispatch on primary methods.")
96
97(defvar eieio-initializing-object nil
98 "Set to non-nil while initializing an object.")
99
100(defconst eieio-unbound
101 (if (and (boundp 'eieio-unbound) (symbolp eieio-unbound))
102 eieio-unbound
103 (make-symbol "unbound"))
104 "Uninterned symbol representing an unbound slot in an object.")
105
106;; This is a bootstrap for eieio-default-superclass so it has a value
107;; while it is being built itself.
108(defvar eieio-default-superclass nil))
109
110(defmacro eieio--define-field-accessors (prefix fields)
111 (declare (indent 1))
112 (let ((index 0)
113 (defs '()))
114 (dolist (field fields)
115 (let ((doc (if (listp field)
116 (prog1 (cadr field) (setq field (car field))))))
117 (push `(defmacro ,(intern (format "eieio--%s-%s" prefix field)) (x)
118 ,@(if doc (list (format (if (string-match "\n" doc)
119 "Return %s" "Return %s of a %s.")
120 doc prefix)))
121 (list 'aref x ,index))
122 defs)
123 (setq index (1+ index))))
124 `(eval-and-compile
125 ,@(nreverse defs)
126 (defconst ,(intern (format "eieio--%s-num-slots" prefix)) ,index))))
127
128(eieio--define-field-accessors class
129 (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
130 (symbol "symbol (self-referencing)")
131 parent children
132 (symbol-obarray "obarray permitting fast access to variable position indexes")
133 ;; @todo
134 ;; the word "public" here is leftovers from the very first version.
135 ;; Get rid of it!
136 (public-a "class attribute index")
137 (public-d "class attribute defaults index")
138 (public-doc "class documentation strings for attributes")
139 (public-type "class type for a slot")
140 (public-custom "class custom type for a slot")
141 (public-custom-label "class custom group for a slot")
142 (public-custom-group "class custom group for a slot")
143 (public-printer "printer for a slot")
144 (protection "protection for a slot")
145 (initarg-tuples "initarg tuples list")
146 (class-allocation-a "class allocated attributes")
147 (class-allocation-doc "class allocated documentation")
148 (class-allocation-type "class allocated value type")
149 (class-allocation-custom "class allocated custom descriptor")
150 (class-allocation-custom-label "class allocated custom descriptor")
151 (class-allocation-custom-group "class allocated custom group")
152 (class-allocation-printer "class allocated printer for a slot")
153 (class-allocation-protection "class allocated protection list")
154 (class-allocation-values "class allocated value vector")
155 (default-object-cache "what a newly created object would look like.
156This will speed up instantiation time as only a `copy-sequence' will
157be needed, instead of looping over all the values and setting them
158from the default.")
159 (options "storage location of tagged class options.
160Stored outright without modifications or stripping.")))
161
162(eieio--define-field-accessors object
163 (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
164 (class "class struct defining OBJ")
165 name))
166
167(eval-and-compile
168;; FIXME: The constants below should have an `eieio-' prefix added!!
169
170(defconst method-static 0 "Index into :static tag on a method.")
171(defconst method-before 1 "Index into :before tag on a method.")
172(defconst method-primary 2 "Index into :primary tag on a method.")
173(defconst method-after 3 "Index into :after tag on a method.")
174(defconst method-num-lists 4 "Number of indexes into methods vector in which groups of functions are kept.")
175(defconst method-generic-before 4 "Index into generic :before tag on a method.")
176(defconst method-generic-primary 5 "Index into generic :primary tag on a method.")
177(defconst method-generic-after 6 "Index into generic :after tag on a method.")
178(defconst method-num-slots 7 "Number of indexes into a method's vector.")
179
180(defsubst eieio-specialized-key-to-generic-key (key)
181 "Convert a specialized KEY into a generic method key."
182 (cond ((eq key method-static) 0) ;; don't convert
183 ((< key method-num-lists) (+ key 3)) ;; The conversion
184 (t key) ;; already generic.. maybe.
185 ))
186
187
188;;; Important macros used in eieio.
189;;
190(defmacro class-v (class)
191 "Internal: Return the class vector from the CLASS symbol."
192 ;; No check: If eieio gets this far, it's probably been checked already.
193 `(get ,class 'eieio-class-definition))
194
195(defmacro class-p (class)
196 "Return t if CLASS is a valid class vector.
197CLASS is a symbol."
198 ;; this new method is faster since it doesn't waste time checking lots of
199 ;; things.
200 `(condition-case nil
201 (eq (aref (class-v ,class) 0) 'defclass)
202 (error nil)))
203
204(defmacro eieio-object-p (obj)
205 "Return non-nil if OBJ is an EIEIO object."
206 `(condition-case nil
207 (let ((tobj ,obj))
208 (and (eq (aref tobj 0) 'object)
209 (class-p (eieio--object-class tobj))))
210 (error nil)))
211(defalias 'object-p 'eieio-object-p)
212
213(defmacro class-constructor (class)
214 "Return the symbol representing the constructor of CLASS."
215 `(eieio--class-symbol (class-v ,class)))
216
217(defmacro generic-p (method)
218 "Return t if symbol METHOD is a generic function.
219Only methods have the symbol `eieio-method-obarray' as a property
220\(which contains a list of all bindings to that method type.)"
221 `(and (fboundp ,method) (get ,method 'eieio-method-obarray)))
222
223(defun generic-primary-only-p (method)
224 "Return t if symbol METHOD is a generic function with only primary methods.
225Only methods have the symbol `eieio-method-obarray' as a property (which
226contains a list of all bindings to that method type.)
227Methods with only primary implementations are executed in an optimized way."
228 (and (generic-p method)
229 (let ((M (get method 'eieio-method-tree)))
230 (and (< 0 (length (aref M method-primary)))
231 (not (aref M method-static))
232 (not (aref M method-before))
233 (not (aref M method-after))
234 (not (aref M method-generic-before))
235 (not (aref M method-generic-primary))
236 (not (aref M method-generic-after))))
237 ))
238
239(defun generic-primary-only-one-p (method)
240 "Return t if symbol METHOD is a generic function with only primary methods.
241Only methods have the symbol `eieio-method-obarray' as a property (which
242contains a list of all bindings to that method type.)
243Methods with only primary implementations are executed in an optimized way."
244 (and (generic-p method)
245 (let ((M (get method 'eieio-method-tree)))
246 (and (= 1 (length (aref M method-primary)))
247 (not (aref M method-static))
248 (not (aref M method-before))
249 (not (aref M method-after))
250 (not (aref M method-generic-before))
251 (not (aref M method-generic-primary))
252 (not (aref M method-generic-after))))
253 ))
254
255(defmacro class-option-assoc (list option)
256 "Return from LIST the found OPTION, or nil if it doesn't exist."
257 `(car-safe (cdr (memq ,option ,list))))
258
259(defmacro class-option (class option)
260 "Return the value stored for CLASS' OPTION.
261Return nil if that option doesn't exist."
262 `(class-option-assoc (eieio--class-options (class-v ,class)) ',option))
263
264(defmacro class-abstract-p (class)
265 "Return non-nil if CLASS is abstract.
266Abstract classes cannot be instantiated."
267 `(class-option ,class :abstract))
268
269(defmacro class-method-invocation-order (class)
270 "Return the invocation order of CLASS.
271Abstract classes cannot be instantiated."
272 `(or (class-option ,class :method-invocation-order)
273 :breadth-first))
274 58
275 59
276;;; Defining a new class 60;;; Defining a new class
@@ -331,829 +115,8 @@ Options in CLOS not supported in EIEIO:
331 115
332Due to the way class options are set up, you can add any tags you wish, 116Due to the way class options are set up, you can add any tags you wish,
333and reference them using the function `class-option'." 117and reference them using the function `class-option'."
334 ;; We must `eval-and-compile' this so that when we byte compile 118 `(eieio-defclass ',name ',superclass ',slots ',options-and-doc))
335 ;; an eieio program, there is no need to load it ahead of time.
336 ;; It also provides lots of nice debugging errors at compile time.
337 `(eval-and-compile
338 (eieio-defclass ',name ',superclass ',slots ',options-and-doc)))
339
340(defvar eieio-defclass-autoload-map (make-vector 7 nil)
341 "Symbol map of superclasses we find in autoloads.")
342
343;; We autoload this because it's used in `make-autoload'.
344;;;###autoload
345(defun eieio-defclass-autoload (cname superclasses filename doc)
346 "Create autoload symbols for the EIEIO class CNAME.
347SUPERCLASSES are the superclasses that CNAME inherits from.
348DOC is the docstring for CNAME.
349This function creates a mock-class for CNAME and adds it into
350SUPERCLASSES as children.
351It creates an autoload function for CNAME's constructor."
352 ;; Assume we've already debugged inputs.
353
354 (let* ((oldc (when (class-p cname) (class-v cname)))
355 (newc (make-vector eieio--class-num-slots nil))
356 )
357 (if oldc
358 nil ;; Do nothing if we already have this class.
359
360 ;; Create the class in NEWC, but don't fill anything else in.
361 (aset newc 0 'defclass)
362 (setf (eieio--class-symbol newc) cname)
363
364 (let ((clear-parent nil))
365 ;; No parents?
366 (when (not superclasses)
367 (setq superclasses '(eieio-default-superclass)
368 clear-parent t)
369 )
370
371 ;; Hook our new class into the existing structures so we can
372 ;; autoload it later.
373 (dolist (SC superclasses)
374
375
376 ;; TODO - If we create an autoload that is in the map, that
377 ;; map needs to be cleared!
378
379
380 ;; Does our parent exist?
381 (if (not (class-p SC))
382
383 ;; Create a symbol for this parent, and then store this
384 ;; parent on that symbol.
385 (let ((sym (intern (symbol-name SC) eieio-defclass-autoload-map)))
386 (if (not (boundp sym))
387 (set sym (list cname))
388 (add-to-list sym cname))
389 )
390
391 ;; We have a parent, save the child in there.
392 (when (not (member cname (eieio--class-children (class-v SC))))
393 (setf (eieio--class-children (class-v SC))
394 (cons cname (eieio--class-children (class-v SC))))))
395
396 ;; save parent in child
397 (setf (eieio--class-parent newc) (cons SC (eieio--class-parent newc)))
398 )
399
400 ;; turn this into a usable self-pointing symbol
401 (set cname cname)
402
403 ;; Store the new class vector definition into the symbol. We need to
404 ;; do this first so that we can call defmethod for the accessor.
405 ;; The vector will be updated by the following while loop and will not
406 ;; need to be stored a second time.
407 (put cname 'eieio-class-definition newc)
408
409 ;; Clear the parent
410 (if clear-parent (setf (eieio--class-parent newc) nil))
411
412 ;; Create an autoload on top of our constructor function.
413 (autoload cname filename doc nil nil)
414 (autoload (intern (concat (symbol-name cname) "-p")) filename "" nil nil)
415 (autoload (intern (concat (symbol-name cname) "-child-p")) filename "" nil nil)
416 (autoload (intern (concat (symbol-name cname) "-list-p")) filename "" nil nil)
417
418 ))))
419
420(defsubst eieio-class-un-autoload (cname)
421 "If class CNAME is in an autoload state, load its file."
422 (when (eq (car-safe (symbol-function cname)) 'autoload)
423 (load-library (car (cdr (symbol-function cname))))))
424
425(defmacro eieio--check-type (type obj)
426 (unless (symbolp obj)
427 (error "eieio--check-type wants OBJ to be a variable"))
428 `(if (not ,(cond
429 ((eq 'or (car-safe type))
430 `(or ,@(mapcar (lambda (type) `(,type ,obj)) (cdr type))))
431 (t `(,type ,obj))))
432 (signal 'wrong-type-argument (list ',type ,obj))))
433
434(defun eieio-defclass (cname superclasses slots options-and-doc)
435 ;; FIXME: Most of this should be moved to the `defclass' macro.
436 "Define CNAME as a new subclass of SUPERCLASSES.
437SLOTS are the slots residing in that class definition, and options or
438documentation OPTIONS-AND-DOC is the toplevel documentation for this class.
439See `defclass' for more information."
440 ;; Run our eieio-hook each time, and clear it when we are done.
441 ;; This way people can add hooks safely if they want to modify eieio
442 ;; or add definitions when eieio is loaded or something like that.
443 (run-hooks 'eieio-hook)
444 (setq eieio-hook nil)
445
446 (eieio--check-type listp superclasses)
447
448 (let* ((pname superclasses)
449 (newc (make-vector eieio--class-num-slots nil))
450 (oldc (when (class-p cname) (class-v cname)))
451 (groups nil) ;; list of groups id'd from slots
452 (options nil)
453 (clearparent nil))
454
455 (aset newc 0 'defclass)
456 (setf (eieio--class-symbol newc) cname)
457
458 ;; If this class already existed, and we are updating its structure,
459 ;; make sure we keep the old child list. This can cause bugs, but
460 ;; if no new slots are created, it also saves time, and prevents
461 ;; method table breakage, particularly when the users is only
462 ;; byte compiling an EIEIO file.
463 (if oldc
464 (setf (eieio--class-children newc) (eieio--class-children oldc))
465 ;; If the old class did not exist, but did exist in the autoload map, then adopt those children.
466 ;; This is like the above, but deals with autoloads nicely.
467 (let ((sym (intern-soft (symbol-name cname) eieio-defclass-autoload-map)))
468 (when sym
469 (condition-case nil
470 (setf (eieio--class-children newc) (symbol-value sym))
471 (error nil))
472 (unintern (symbol-name cname) eieio-defclass-autoload-map)
473 ))
474 )
475
476 (cond ((and (stringp (car options-and-doc))
477 (/= 1 (% (length options-and-doc) 2)))
478 (error "Too many arguments to `defclass'"))
479 ((and (symbolp (car options-and-doc))
480 (/= 0 (% (length options-and-doc) 2)))
481 (error "Too many arguments to `defclass'"))
482 )
483
484 (setq options
485 (if (stringp (car options-and-doc))
486 (cons :documentation options-and-doc)
487 options-and-doc))
488
489 (if pname
490 (progn
491 (while pname
492 (if (and (car pname) (symbolp (car pname)))
493 (if (not (class-p (car pname)))
494 ;; bad class
495 (error "Given parent class %s is not a class" (car pname))
496 ;; good parent class...
497 ;; save new child in parent
498 (when (not (member cname (eieio--class-children (class-v (car pname)))))
499 (setf (eieio--class-children (class-v (car pname)))
500 (cons cname (eieio--class-children (class-v (car pname))))))
501 ;; Get custom groups, and store them into our local copy.
502 (mapc (lambda (g) (add-to-list 'groups g))
503 (class-option (car pname) :custom-groups))
504 ;; save parent in child
505 (setf (eieio--class-parent newc) (cons (car pname) (eieio--class-parent newc))))
506 (error "Invalid parent class %s" pname))
507 (setq pname (cdr pname)))
508 ;; Reverse the list of our parents so that they are prioritized in
509 ;; the same order as specified in the code.
510 (setf (eieio--class-parent newc) (nreverse (eieio--class-parent newc))) )
511 ;; If there is nothing to loop over, then inherit from the
512 ;; default superclass.
513 (unless (eq cname 'eieio-default-superclass)
514 ;; adopt the default parent here, but clear it later...
515 (setq clearparent t)
516 ;; save new child in parent
517 (if (not (member cname (eieio--class-children (class-v 'eieio-default-superclass))))
518 (setf (eieio--class-children (class-v 'eieio-default-superclass))
519 (cons cname (eieio--class-children (class-v 'eieio-default-superclass)))))
520 ;; save parent in child
521 (setf (eieio--class-parent newc) (list eieio-default-superclass))))
522
523 ;; turn this into a usable self-pointing symbol
524 (set cname cname)
525
526 ;; These two tests must be created right away so we can have self-
527 ;; referencing classes. ei, a class whose slot can contain only
528 ;; pointers to itself.
529
530 ;; Create the test function
531 (let ((csym (intern (concat (symbol-name cname) "-p"))))
532 (fset csym
533 (list 'lambda (list 'obj)
534 (format "Test OBJ to see if it an object of type %s" cname)
535 (list 'and '(eieio-object-p obj)
536 (list 'same-class-p 'obj cname)))))
537
538 ;; Make sure the method invocation order is a valid value.
539 (let ((io (class-option-assoc options :method-invocation-order)))
540 (when (and io (not (member io '(:depth-first :breadth-first :c3))))
541 (error "Method invocation order %s is not allowed" io)
542 ))
543
544 ;; Create a handy child test too
545 (let ((csym (intern (concat (symbol-name cname) "-child-p"))))
546 (fset csym
547 `(lambda (obj)
548 ,(format
549 "Test OBJ to see if it an object is a child of type %s"
550 cname)
551 (and (eieio-object-p obj)
552 (object-of-class-p obj ,cname))))
553
554 ;; Create a handy list of the class test too
555 (let ((csym (intern (concat (symbol-name cname) "-list-p"))))
556 (fset csym
557 `(lambda (obj)
558 ,(format
559 "Test OBJ to see if it a list of objects which are a child of type %s"
560 cname)
561 (when (listp obj)
562 (let ((ans t)) ;; nil is valid
563 ;; Loop over all the elements of the input list, test
564 ;; each to make sure it is a child of the desired object class.
565 (while (and obj ans)
566 (setq ans (and (eieio-object-p (car obj))
567 (object-of-class-p (car obj) ,cname)))
568 (setq obj (cdr obj)))
569 ans)))))
570
571 ;; When using typep, (typep OBJ 'myclass) returns t for objects which
572 ;; are subclasses of myclass. For our predicates, however, it is
573 ;; important for EIEIO to be backwards compatible, where
574 ;; myobject-p, and myobject-child-p are different.
575 ;; "cl" uses this technique to specify symbols with specific typep
576 ;; test, so we can let typep have the CLOS documented behavior
577 ;; while keeping our above predicate clean.
578
579 ;; It would be cleaner to use `defsetf' here, but that requires cl
580 ;; at runtime.
581 (put cname 'cl-deftype-handler
582 (list 'lambda () `(list 'satisfies (quote ,csym)))))
583
584 ;; Before adding new slots, let's add all the methods and classes
585 ;; in from the parent class.
586 (eieio-copy-parents-into-subclass newc superclasses)
587
588 ;; Store the new class vector definition into the symbol. We need to
589 ;; do this first so that we can call defmethod for the accessor.
590 ;; The vector will be updated by the following while loop and will not
591 ;; need to be stored a second time.
592 (put cname 'eieio-class-definition newc)
593
594 ;; Query each slot in the declaration list and mangle into the
595 ;; class structure I have defined.
596 (while slots
597 (let* ((slot1 (car slots))
598 (name (car slot1))
599 (slot (cdr slot1))
600 (acces (plist-get slot ':accessor))
601 (init (or (plist-get slot ':initform)
602 (if (member ':initform slot) nil
603 eieio-unbound)))
604 (initarg (plist-get slot ':initarg))
605 (docstr (plist-get slot ':documentation))
606 (prot (plist-get slot ':protection))
607 (reader (plist-get slot ':reader))
608 (writer (plist-get slot ':writer))
609 (alloc (plist-get slot ':allocation))
610 (type (plist-get slot ':type))
611 (custom (plist-get slot ':custom))
612 (label (plist-get slot ':label))
613 (customg (plist-get slot ':group))
614 (printer (plist-get slot ':printer))
615
616 (skip-nil (class-option-assoc options :allow-nil-initform))
617 )
618
619 (if eieio-error-unsupported-class-tags
620 (let ((tmp slot))
621 (while tmp
622 (if (not (member (car tmp) '(:accessor
623 :initform
624 :initarg
625 :documentation
626 :protection
627 :reader
628 :writer
629 :allocation
630 :type
631 :custom
632 :label
633 :group
634 :printer
635 :allow-nil-initform
636 :custom-groups)))
637 (signal 'invalid-slot-type (list (car tmp))))
638 (setq tmp (cdr (cdr tmp))))))
639
640 ;; Clean up the meaning of protection.
641 (cond ((or (eq prot 'public) (eq prot :public)) (setq prot nil))
642 ((or (eq prot 'protected) (eq prot :protected)) (setq prot 'protected))
643 ((or (eq prot 'private) (eq prot :private)) (setq prot 'private))
644 ((eq prot nil) nil)
645 (t (signal 'invalid-slot-type (list ':protection prot))))
646
647 ;; Make sure the :allocation parameter has a valid value.
648 (if (not (or (not alloc) (eq alloc :class) (eq alloc :instance)))
649 (signal 'invalid-slot-type (list ':allocation alloc)))
650
651 ;; The default type specifier is supposed to be t, meaning anything.
652 (if (not type) (setq type t))
653
654 ;; Label is nil, or a string
655 (if (not (or (null label) (stringp label)))
656 (signal 'invalid-slot-type (list ':label label)))
657
658 ;; Is there an initarg, but allocation of class?
659 (if (and initarg (eq alloc :class))
660 (message "Class allocated slots do not need :initarg"))
661
662 ;; intern the symbol so we can use it blankly
663 (if initarg (set initarg initarg))
664
665 ;; The customgroup should be a list of symbols
666 (cond ((null customg)
667 (setq customg '(default)))
668 ((not (listp customg))
669 (setq customg (list customg))))
670 ;; The customgroup better be a symbol, or list of symbols.
671 (mapc (lambda (cg)
672 (if (not (symbolp cg))
673 (signal 'invalid-slot-type (list ':group cg))))
674 customg)
675
676 ;; First up, add this slot into our new class.
677 (eieio-add-new-slot newc name init docstr type custom label customg printer
678 prot initarg alloc 'defaultoverride skip-nil)
679
680 ;; We need to id the group, and store them in a group list attribute.
681 (mapc (lambda (cg) (add-to-list 'groups cg)) customg)
682
683 ;; Anyone can have an accessor function. This creates a function
684 ;; of the specified name, and also performs a `defsetf' if applicable
685 ;; so that users can `setf' the space returned by this function.
686 (if acces
687 (progn
688 (eieio--defmethod
689 acces (if (eq alloc :class) :static :primary) cname
690 `(lambda (this)
691 ,(format
692 "Retrieves the slot `%s' from an object of class `%s'"
693 name cname)
694 (if (slot-boundp this ',name)
695 (eieio-oref this ',name)
696 ;; Else - Some error? nil?
697 nil)))
698
699 (if (fboundp 'gv-define-setter)
700 ;; FIXME: We should move more of eieio-defclass into the
701 ;; defclass macro so we don't have to use `eval' and require
702 ;; `gv' at run-time.
703 (eval `(gv-define-setter ,acces (eieio--store eieio--object)
704 (list 'eieio-oset eieio--object '',name
705 eieio--store)))
706 ;; Provide a setf method. It would be cleaner to use
707 ;; defsetf, but that would require CL at runtime.
708 (put acces 'setf-method
709 `(lambda (widget)
710 (let* ((--widget-sym-- (make-symbol "--widget--"))
711 (--store-sym-- (make-symbol "--store--")))
712 (list
713 (list --widget-sym--)
714 (list widget)
715 (list --store-sym--)
716 (list 'eieio-oset --widget-sym-- '',name
717 --store-sym--)
718 (list 'getfoo --widget-sym--))))))))
719
720 ;; If a writer is defined, then create a generic method of that
721 ;; name whose purpose is to set the value of the slot.
722 (if writer
723 (eieio--defmethod
724 writer nil cname
725 `(lambda (this value)
726 ,(format "Set the slot `%s' of an object of class `%s'"
727 name cname)
728 (setf (slot-value this ',name) value))))
729 ;; If a reader is defined, then create a generic method
730 ;; of that name whose purpose is to access this slot value.
731 (if reader
732 (eieio--defmethod
733 reader nil cname
734 `(lambda (this)
735 ,(format "Access the slot `%s' from object of class `%s'"
736 name cname)
737 (slot-value this ',name))))
738 )
739 (setq slots (cdr slots)))
740
741 ;; Now that everything has been loaded up, all our lists are backwards!
742 ;; Fix that up now.
743 (setf (eieio--class-public-a newc) (nreverse (eieio--class-public-a newc)))
744 (setf (eieio--class-public-d newc) (nreverse (eieio--class-public-d newc)))
745 (setf (eieio--class-public-doc newc) (nreverse (eieio--class-public-doc newc)))
746 (setf (eieio--class-public-type newc)
747 (apply 'vector (nreverse (eieio--class-public-type newc))))
748 (setf (eieio--class-public-custom newc) (nreverse (eieio--class-public-custom newc)))
749 (setf (eieio--class-public-custom-label newc) (nreverse (eieio--class-public-custom-label newc)))
750 (setf (eieio--class-public-custom-group newc) (nreverse (eieio--class-public-custom-group newc)))
751 (setf (eieio--class-public-printer newc) (nreverse (eieio--class-public-printer newc)))
752 (setf (eieio--class-protection newc) (nreverse (eieio--class-protection newc)))
753 (setf (eieio--class-initarg-tuples newc) (nreverse (eieio--class-initarg-tuples newc)))
754
755 ;; The storage for class-class-allocation-type needs to be turned into
756 ;; a vector now.
757 (setf (eieio--class-class-allocation-type newc)
758 (apply 'vector (eieio--class-class-allocation-type newc)))
759
760 ;; Also, take class allocated values, and vectorize them for speed.
761 (setf (eieio--class-class-allocation-values newc)
762 (apply 'vector (eieio--class-class-allocation-values newc)))
763
764 ;; Attach slot symbols into an obarray, and store the index of
765 ;; this slot as the variable slot in this new symbol. We need to
766 ;; know about primes, because obarrays are best set in vectors of
767 ;; prime number length, and we also need to make our vector small
768 ;; to save space, and also optimal for the number of items we have.
769 (let* ((cnt 0)
770 (pubsyms (eieio--class-public-a newc))
771 (prots (eieio--class-protection newc))
772 (l (length pubsyms))
773 (vl (let ((primes '( 3 5 7 11 13 17 19 23 29 31 37 41 43 47
774 53 59 61 67 71 73 79 83 89 97 101 )))
775 (while (and primes (< (car primes) l))
776 (setq primes (cdr primes)))
777 (car primes)))
778 (oa (make-vector vl 0))
779 (newsym))
780 (while pubsyms
781 (setq newsym (intern (symbol-name (car pubsyms)) oa))
782 (set newsym cnt)
783 (setq cnt (1+ cnt))
784 (if (car prots) (put newsym 'protection (car prots)))
785 (setq pubsyms (cdr pubsyms)
786 prots (cdr prots)))
787 (setf (eieio--class-symbol-obarray newc) oa)
788 )
789
790 ;; Create the constructor function
791 (if (class-option-assoc options :abstract)
792 ;; Abstract classes cannot be instantiated. Say so.
793 (let ((abs (class-option-assoc options :abstract)))
794 (if (not (stringp abs))
795 (setq abs (format "Class %s is abstract" cname)))
796 (fset cname
797 `(lambda (&rest stuff)
798 ,(format "You cannot create a new object of type %s" cname)
799 (error ,abs))))
800
801 ;; Non-abstract classes need a constructor.
802 (fset cname
803 `(lambda (newname &rest slots)
804 ,(format "Create a new object with name NAME of class type %s" cname)
805 (apply 'constructor ,cname newname slots)))
806 )
807
808 ;; Set up a specialized doc string.
809 ;; Use stored value since it is calculated in a non-trivial way
810 (put cname 'variable-documentation
811 (class-option-assoc options :documentation))
812
813 ;; Save the file location where this class is defined.
814 (let ((fname (if load-in-progress
815 load-file-name
816 buffer-file-name))
817 loc)
818 (when fname
819 (when (string-match "\\.elc\\'" fname)
820 (setq fname (substring fname 0 (1- (length fname)))))
821 (put cname 'class-location fname)))
822
823 ;; We have a list of custom groups. Store them into the options.
824 (let ((g (class-option-assoc options :custom-groups)))
825 (mapc (lambda (cg) (add-to-list 'g cg)) groups)
826 (if (memq :custom-groups options)
827 (setcar (cdr (memq :custom-groups options)) g)
828 (setq options (cons :custom-groups (cons g options)))))
829
830 ;; Set up the options we have collected.
831 (setf (eieio--class-options newc) options)
832
833 ;; if this is a superclass, clear out parent (which was set to the
834 ;; default superclass eieio-default-superclass)
835 (if clearparent (setf (eieio--class-parent newc) nil))
836
837 ;; Create the cached default object.
838 (let ((cache (make-vector (+ (length (eieio--class-public-a newc)) 3)
839 nil)))
840 (aset cache 0 'object)
841 (setf (eieio--object-class cache) cname)
842 (setf (eieio--object-name cache) 'default-cache-object)
843 (let ((eieio-skip-typecheck t))
844 ;; All type-checking has been done to our satisfaction
845 ;; before this call. Don't waste our time in this call..
846 (eieio-set-defaults cache t))
847 (setf (eieio--class-default-object-cache newc) cache))
848
849 ;; Return our new class object
850 ;; newc
851 cname
852 ))
853 119
854(defun eieio-perform-slot-validation-for-default (slot spec value skipnil)
855 "For SLOT, signal if SPEC does not match VALUE.
856If SKIPNIL is non-nil, then if VALUE is nil return t instead."
857 (if (and (not (eieio-eval-default-p value))
858 (not eieio-skip-typecheck)
859 (not (and skipnil (null value)))
860 (not (eieio-perform-slot-validation spec value)))
861 (signal 'invalid-slot-type (list slot spec value))))
862
863(defun eieio-add-new-slot (newc a d doc type cust label custg print prot init alloc
864 &optional defaultoverride skipnil)
865 "Add into NEWC attribute A.
866If A already exists in NEWC, then do nothing. If it doesn't exist,
867then also add in D (default), DOC, TYPE, CUST, LABEL, CUSTG, PRINT, PROT, and INIT arg.
868Argument ALLOC specifies if the slot is allocated per instance, or per class.
869If optional DEFAULTOVERRIDE is non-nil, then if A exists in NEWC,
870we must override its value for a default.
871Optional argument SKIPNIL indicates if type checking should be skipped
872if default value is nil."
873 ;; Make sure we duplicate those items that are sequences.
874 (condition-case nil
875 (if (sequencep d) (setq d (copy-sequence d)))
876 ;; This copy can fail on a cons cell with a non-cons in the cdr. Let's skip it if it doesn't work.
877 (error nil))
878 (if (sequencep type) (setq type (copy-sequence type)))
879 (if (sequencep cust) (setq cust (copy-sequence cust)))
880 (if (sequencep custg) (setq custg (copy-sequence custg)))
881
882 ;; To prevent override information w/out specification of storage,
883 ;; we need to do this little hack.
884 (if (member a (eieio--class-class-allocation-a newc)) (setq alloc ':class))
885
886 (if (or (not alloc) (and (symbolp alloc) (eq alloc ':instance)))
887 ;; In this case, we modify the INSTANCE version of a given slot.
888
889 (progn
890
891 ;; Only add this element if it is so-far unique
892 (if (not (member a (eieio--class-public-a newc)))
893 (progn
894 (eieio-perform-slot-validation-for-default a type d skipnil)
895 (setf (eieio--class-public-a newc) (cons a (eieio--class-public-a newc)))
896 (setf (eieio--class-public-d newc) (cons d (eieio--class-public-d newc)))
897 (setf (eieio--class-public-doc newc) (cons doc (eieio--class-public-doc newc)))
898 (setf (eieio--class-public-type newc) (cons type (eieio--class-public-type newc)))
899 (setf (eieio--class-public-custom newc) (cons cust (eieio--class-public-custom newc)))
900 (setf (eieio--class-public-custom-label newc) (cons label (eieio--class-public-custom-label newc)))
901 (setf (eieio--class-public-custom-group newc) (cons custg (eieio--class-public-custom-group newc)))
902 (setf (eieio--class-public-printer newc) (cons print (eieio--class-public-printer newc)))
903 (setf (eieio--class-protection newc) (cons prot (eieio--class-protection newc)))
904 (setf (eieio--class-initarg-tuples newc) (cons (cons init a) (eieio--class-initarg-tuples newc)))
905 )
906 ;; When defaultoverride is true, we are usually adding new local
907 ;; attributes which must override the default value of any slot
908 ;; passed in by one of the parent classes.
909 (when defaultoverride
910 ;; There is a match, and we must override the old value.
911 (let* ((ca (eieio--class-public-a newc))
912 (np (member a ca))
913 (num (- (length ca) (length np)))
914 (dp (if np (nthcdr num (eieio--class-public-d newc))
915 nil))
916 (tp (if np (nth num (eieio--class-public-type newc))))
917 )
918 (if (not np)
919 (error "EIEIO internal error overriding default value for %s"
920 a)
921 ;; If type is passed in, is it the same?
922 (if (not (eq type t))
923 (if (not (equal type tp))
924 (error
925 "Child slot type `%s' does not match inherited type `%s' for `%s'"
926 type tp a)))
927 ;; If we have a repeat, only update the initarg...
928 (unless (eq d eieio-unbound)
929 (eieio-perform-slot-validation-for-default a tp d skipnil)
930 (setcar dp d))
931 ;; If we have a new initarg, check for it.
932 (when init
933 (let* ((inits (eieio--class-initarg-tuples newc))
934 (inita (rassq a inits)))
935 ;; Replace the CAR of the associate INITA.
936 ;;(message "Initarg: %S replace %s" inita init)
937 (setcar inita init)
938 ))
939
940 ;; PLN Tue Jun 26 11:57:06 2007 : The protection is
941 ;; checked and SHOULD match the superclass
942 ;; protection. Otherwise an error is thrown. However
943 ;; I wonder if a more flexible schedule might be
944 ;; implemented.
945 ;;
946 ;; EML - We used to have (if prot... here,
947 ;; but a prot of 'nil means public.
948 ;;
949 (let ((super-prot (nth num (eieio--class-protection newc)))
950 )
951 (if (not (eq prot super-prot))
952 (error "Child slot protection `%s' does not match inherited protection `%s' for `%s'"
953 prot super-prot a)))
954 ;; End original PLN
955
956 ;; PLN Tue Jun 26 11:57:06 2007 :
957 ;; Do a non redundant combination of ancient custom
958 ;; groups and new ones.
959 (when custg
960 (let* ((groups
961 (nthcdr num (eieio--class-public-custom-group newc)))
962 (list1 (car groups))
963 (list2 (if (listp custg) custg (list custg))))
964 (if (< (length list1) (length list2))
965 (setq list1 (prog1 list2 (setq list2 list1))))
966 (dolist (elt list2)
967 (unless (memq elt list1)
968 (push elt list1)))
969 (setcar groups list1)))
970 ;; End PLN
971
972 ;; PLN Mon Jun 25 22:44:34 2007 : If a new cust is
973 ;; set, simply replaces the old one.
974 (when cust
975 ;; (message "Custom type redefined to %s" cust)
976 (setcar (nthcdr num (eieio--class-public-custom newc)) cust))
977
978 ;; If a new label is specified, it simply replaces
979 ;; the old one.
980 (when label
981 ;; (message "Custom label redefined to %s" label)
982 (setcar (nthcdr num (eieio--class-public-custom-label newc)) label))
983 ;; End PLN
984
985 ;; PLN Sat Jun 30 17:24:42 2007 : when a new
986 ;; doc is specified, simply replaces the old one.
987 (when doc
988 ;;(message "Documentation redefined to %s" doc)
989 (setcar (nthcdr num (eieio--class-public-doc newc))
990 doc))
991 ;; End PLN
992
993 ;; If a new printer is specified, it simply replaces
994 ;; the old one.
995 (when print
996 ;; (message "printer redefined to %s" print)
997 (setcar (nthcdr num (eieio--class-public-printer newc)) print))
998
999 )))
1000 ))
1001
1002 ;; CLASS ALLOCATED SLOTS
1003 (let ((value (eieio-default-eval-maybe d)))
1004 (if (not (member a (eieio--class-class-allocation-a newc)))
1005 (progn
1006 (eieio-perform-slot-validation-for-default a type value skipnil)
1007 ;; Here we have found a :class version of a slot. This
1008 ;; requires a very different approach.
1009 (setf (eieio--class-class-allocation-a newc) (cons a (eieio--class-class-allocation-a newc)))
1010 (setf (eieio--class-class-allocation-doc newc) (cons doc (eieio--class-class-allocation-doc newc)))
1011 (setf (eieio--class-class-allocation-type newc) (cons type (eieio--class-class-allocation-type newc)))
1012 (setf (eieio--class-class-allocation-custom newc) (cons cust (eieio--class-class-allocation-custom newc)))
1013 (setf (eieio--class-class-allocation-custom-label newc) (cons label (eieio--class-class-allocation-custom-label newc)))
1014 (setf (eieio--class-class-allocation-custom-group newc) (cons custg (eieio--class-class-allocation-custom-group newc)))
1015 (setf (eieio--class-class-allocation-protection newc) (cons prot (eieio--class-class-allocation-protection newc)))
1016 ;; Default value is stored in the 'values section, since new objects
1017 ;; can't initialize from this element.
1018 (setf (eieio--class-class-allocation-values newc) (cons value (eieio--class-class-allocation-values newc))))
1019 (when defaultoverride
1020 ;; There is a match, and we must override the old value.
1021 (let* ((ca (eieio--class-class-allocation-a newc))
1022 (np (member a ca))
1023 (num (- (length ca) (length np)))
1024 (dp (if np
1025 (nthcdr num
1026 (eieio--class-class-allocation-values newc))
1027 nil))
1028 (tp (if np (nth num (eieio--class-class-allocation-type newc))
1029 nil)))
1030 (if (not np)
1031 (error "EIEIO internal error overriding default value for %s"
1032 a)
1033 ;; If type is passed in, is it the same?
1034 (if (not (eq type t))
1035 (if (not (equal type tp))
1036 (error
1037 "Child slot type `%s' does not match inherited type `%s' for `%s'"
1038 type tp a)))
1039 ;; EML - Note: the only reason to override a class bound slot
1040 ;; is to change the default, so allow unbound in.
1041
1042 ;; If we have a repeat, only update the value...
1043 (eieio-perform-slot-validation-for-default a tp value skipnil)
1044 (setcar dp value))
1045
1046 ;; PLN Tue Jun 26 11:57:06 2007 : The protection is
1047 ;; checked and SHOULD match the superclass
1048 ;; protection. Otherwise an error is thrown. However
1049 ;; I wonder if a more flexible schedule might be
1050 ;; implemented.
1051 (let ((super-prot
1052 (car (nthcdr num (eieio--class-class-allocation-protection newc)))))
1053 (if (not (eq prot super-prot))
1054 (error "Child slot protection `%s' does not match inherited protection `%s' for `%s'"
1055 prot super-prot a)))
1056 ;; Do a non redundant combination of ancient custom groups
1057 ;; and new ones.
1058 (when custg
1059 (let* ((groups
1060 (nthcdr num (eieio--class-class-allocation-custom-group newc)))
1061 (list1 (car groups))
1062 (list2 (if (listp custg) custg (list custg))))
1063 (if (< (length list1) (length list2))
1064 (setq list1 (prog1 list2 (setq list2 list1))))
1065 (dolist (elt list2)
1066 (unless (memq elt list1)
1067 (push elt list1)))
1068 (setcar groups list1)))
1069
1070 ;; PLN Sat Jun 30 17:24:42 2007 : when a new
1071 ;; doc is specified, simply replaces the old one.
1072 (when doc
1073 ;;(message "Documentation redefined to %s" doc)
1074 (setcar (nthcdr num (eieio--class-class-allocation-doc newc))
1075 doc))
1076 ;; End PLN
1077
1078 ;; If a new printer is specified, it simply replaces
1079 ;; the old one.
1080 (when print
1081 ;; (message "printer redefined to %s" print)
1082 (setcar (nthcdr num (eieio--class-class-allocation-printer newc)) print))
1083
1084 ))
1085 ))
1086 ))
1087
1088(defun eieio-copy-parents-into-subclass (newc parents)
1089 "Copy into NEWC the slots of PARENTS.
1090Follow the rules of not overwriting early parents when applying to
1091the new child class."
1092 (let ((ps (eieio--class-parent newc))
1093 (sn (class-option-assoc (eieio--class-options newc)
1094 ':allow-nil-initform)))
1095 (while ps
1096 ;; First, duplicate all the slots of the parent.
1097 (let ((pcv (class-v (car ps))))
1098 (let ((pa (eieio--class-public-a pcv))
1099 (pd (eieio--class-public-d pcv))
1100 (pdoc (eieio--class-public-doc pcv))
1101 (ptype (eieio--class-public-type pcv))
1102 (pcust (eieio--class-public-custom pcv))
1103 (plabel (eieio--class-public-custom-label pcv))
1104 (pcustg (eieio--class-public-custom-group pcv))
1105 (printer (eieio--class-public-printer pcv))
1106 (pprot (eieio--class-protection pcv))
1107 (pinit (eieio--class-initarg-tuples pcv))
1108 (i 0))
1109 (while pa
1110 (eieio-add-new-slot newc
1111 (car pa) (car pd) (car pdoc) (aref ptype i)
1112 (car pcust) (car plabel) (car pcustg)
1113 (car printer)
1114 (car pprot) (car-safe (car pinit)) nil nil sn)
1115 ;; Increment each value.
1116 (setq pa (cdr pa)
1117 pd (cdr pd)
1118 pdoc (cdr pdoc)
1119 i (1+ i)
1120 pcust (cdr pcust)
1121 plabel (cdr plabel)
1122 pcustg (cdr pcustg)
1123 printer (cdr printer)
1124 pprot (cdr pprot)
1125 pinit (cdr pinit))
1126 )) ;; while/let
1127 ;; Now duplicate all the class alloc slots.
1128 (let ((pa (eieio--class-class-allocation-a pcv))
1129 (pdoc (eieio--class-class-allocation-doc pcv))
1130 (ptype (eieio--class-class-allocation-type pcv))
1131 (pcust (eieio--class-class-allocation-custom pcv))
1132 (plabel (eieio--class-class-allocation-custom-label pcv))
1133 (pcustg (eieio--class-class-allocation-custom-group pcv))
1134 (printer (eieio--class-class-allocation-printer pcv))
1135 (pprot (eieio--class-class-allocation-protection pcv))
1136 (pval (eieio--class-class-allocation-values pcv))
1137 (i 0))
1138 (while pa
1139 (eieio-add-new-slot newc
1140 (car pa) (aref pval i) (car pdoc) (aref ptype i)
1141 (car pcust) (car plabel) (car pcustg)
1142 (car printer)
1143 (car pprot) nil ':class sn)
1144 ;; Increment each value.
1145 (setq pa (cdr pa)
1146 pdoc (cdr pdoc)
1147 pcust (cdr pcust)
1148 plabel (cdr plabel)
1149 pcustg (cdr pcustg)
1150 printer (cdr printer)
1151 pprot (cdr pprot)
1152 i (1+ i))
1153 ))) ;; while/let
1154 ;; Loop over each parent class
1155 (setq ps (cdr ps)))
1156 ))
1157 120
1158;;; CLOS style implementation of object creators. 121;;; CLOS style implementation of object creators.
1159;; 122;;
@@ -1187,17 +150,6 @@ a string."
1187 150
1188;;; CLOS methods and generics 151;;; CLOS methods and generics
1189;; 152;;
1190
1191(put 'eieio--defalias 'byte-hunk-handler
1192 #'byte-compile-file-form-defalias) ;;(get 'defalias 'byte-hunk-handler)
1193(defun eieio--defalias (name body)
1194 "Like `defalias', but with less side-effects.
1195More specifically, it has no side-effects at all when the new function
1196definition is the same (`eq') as the old one."
1197 (unless (and (fboundp name)
1198 (eq (symbol-function name) body))
1199 (defalias name body)))
1200
1201(defmacro defgeneric (method args &optional doc-string) 153(defmacro defgeneric (method args &optional doc-string)
1202 "Create a generic function METHOD. 154 "Create a generic function METHOD.
1203DOC-STRING is the base documentation for this class. A generic 155DOC-STRING is the base documentation for this class. A generic
@@ -1209,115 +161,6 @@ top level documentation to a method."
1209 `(eieio--defalias ',method 161 `(eieio--defalias ',method
1210 (eieio--defgeneric-init-form ',method ,doc-string))) 162 (eieio--defgeneric-init-form ',method ,doc-string)))
1211 163
1212(defun eieio--defgeneric-init-form (method doc-string)
1213 "Form to use for the initial definition of a generic."
1214 (cond
1215 ((or (not (fboundp method))
1216 (eq 'autoload (car-safe (symbol-function method))))
1217 ;; Make sure the method tables are installed.
1218 (eieiomt-install method)
1219 ;; Construct the actual body of this function.
1220 (eieio-defgeneric-form method doc-string))
1221 ((generic-p method) (symbol-function method)) ;Leave it as-is.
1222 (t (error "You cannot create a generic/method over an existing symbol: %s"
1223 method))))
1224
1225(defun eieio-defgeneric-form (method doc-string)
1226 "The lambda form that would be used as the function defined on METHOD.
1227All methods should call the same EIEIO function for dispatch.
1228DOC-STRING is the documentation attached to METHOD."
1229 `(lambda (&rest local-args)
1230 ,doc-string
1231 (eieio-generic-call (quote ,method) local-args)))
1232
1233(defsubst eieio-defgeneric-reset-generic-form (method)
1234 "Setup METHOD to call the generic form."
1235 (let ((doc-string (documentation method)))
1236 (fset method (eieio-defgeneric-form method doc-string))))
1237
1238(defun eieio-defgeneric-form-primary-only (method doc-string)
1239 "The lambda form that would be used as the function defined on METHOD.
1240All methods should call the same EIEIO function for dispatch.
1241DOC-STRING is the documentation attached to METHOD."
1242 `(lambda (&rest local-args)
1243 ,doc-string
1244 (eieio-generic-call-primary-only (quote ,method) local-args)))
1245
1246(defsubst eieio-defgeneric-reset-generic-form-primary-only (method)
1247 "Setup METHOD to call the generic form."
1248 (let ((doc-string (documentation method)))
1249 (fset method (eieio-defgeneric-form-primary-only method doc-string))))
1250
1251(defun eieio-defgeneric-form-primary-only-one (method doc-string
1252 class
1253 impl
1254 )
1255 "The lambda form that would be used as the function defined on METHOD.
1256All methods should call the same EIEIO function for dispatch.
1257DOC-STRING is the documentation attached to METHOD.
1258CLASS is the class symbol needed for private method access.
1259IMPL is the symbol holding the method implementation."
1260 ;; NOTE: I tried out byte compiling this little fcn. Turns out it
1261 ;; is faster to execute this for not byte-compiled. ie, install this,
1262 ;; then measure calls going through here. I wonder why.
1263 (require 'bytecomp)
1264 (let ((byte-compile-warnings nil))
1265 (byte-compile
1266 `(lambda (&rest local-args)
1267 ,doc-string
1268 ;; This is a cool cheat. Usually we need to look up in the
1269 ;; method table to find out if there is a method or not. We can
1270 ;; instead make that determination at load time when there is
1271 ;; only one method. If the first arg is not a child of the class
1272 ;; of that one implementation, then clearly, there is no method def.
1273 (if (not (eieio-object-p (car local-args)))
1274 ;; Not an object. Just signal.
1275 (signal 'no-method-definition
1276 (list ',method local-args))
1277
1278 ;; We do have an object. Make sure it is the right type.
1279 (if ,(if (eq class eieio-default-superclass)
1280 nil ; default superclass means just an obj. Already asked.
1281 `(not (child-of-class-p (eieio--object-class (car local-args))
1282 ',class)))
1283
1284 ;; If not the right kind of object, call no applicable
1285 (apply 'no-applicable-method (car local-args)
1286 ',method local-args)
1287
1288 ;; It is ok, do the call.
1289 ;; Fill in inter-call variables then evaluate the method.
1290 (let ((scoped-class ',class)
1291 (eieio-generic-call-next-method-list nil)
1292 (eieio-generic-call-key method-primary)
1293 (eieio-generic-call-methodname ',method)
1294 (eieio-generic-call-arglst local-args)
1295 )
1296 ,(if (< emacs-major-version 24)
1297 `(apply ,(list 'quote impl) local-args)
1298 `(apply #',impl local-args))
1299 ;(,impl local-args)
1300 )))))))
1301
1302(defsubst eieio-defgeneric-reset-generic-form-primary-only-one (method)
1303 "Setup METHOD to call the generic form."
1304 (let* ((doc-string (documentation method))
1305 (M (get method 'eieio-method-tree))
1306 (entry (car (aref M method-primary)))
1307 )
1308 (fset method (eieio-defgeneric-form-primary-only-one
1309 method doc-string
1310 (car entry)
1311 (cdr entry)
1312 ))))
1313
1314(defun eieio-unbind-method-implementations (method)
1315 "Make the generic method METHOD have no implementations.
1316It will leave the original generic function in place,
1317but remove reference to all implementations of METHOD."
1318 (put method 'eieio-method-tree nil)
1319 (put method 'eieio-method-obarray nil))
1320
1321(defmacro defmethod (method &rest args) 164(defmacro defmethod (method &rest args)
1322 "Create a new METHOD through `defgeneric' with ARGS. 165 "Create a new METHOD through `defgeneric' with ARGS.
1323 166
@@ -1358,139 +201,6 @@ Summary:
1358 (format "Generically created method `%s'." method))) 201 (format "Generically created method `%s'." method)))
1359 (eieio--defmethod ',method ',key ',class #',code)))) 202 (eieio--defmethod ',method ',key ',class #',code))))
1360 203
1361(defun eieio--defmethod (method kind argclass code)
1362 "Work part of the `defmethod' macro defining METHOD with ARGS."
1363 (let ((key
1364 ;; Find optional keys.
1365 (cond ((memq kind '(:BEFORE :before)) method-before)
1366 ((memq kind '(:AFTER :after)) method-after)
1367 ((memq kind '(:STATIC :static)) method-static)
1368 ((memq kind '(:PRIMARY :primary nil)) method-primary)
1369 ;; Primary key.
1370 ;; (t method-primary)
1371 (t (error "Unknown method kind %S" kind)))))
1372 ;; Make sure there is a generic (when called from defclass).
1373 (eieio--defalias
1374 method (eieio--defgeneric-init-form
1375 method (or (documentation code)
1376 (format "Generically created method `%s'." method))))
1377 ;; Create symbol for property to bind to. If the first arg is of
1378 ;; the form (varname vartype) and `vartype' is a class, then
1379 ;; that class will be the type symbol. If not, then it will fall
1380 ;; under the type `primary' which is a non-specific calling of the
1381 ;; function.
1382 (if argclass
1383 (if (not (class-p argclass))
1384 (error "Unknown class type %s in method parameters"
1385 argclass))
1386 ;; Generics are higher.
1387 (setq key (eieio-specialized-key-to-generic-key key)))
1388 ;; Put this lambda into the symbol so we can find it.
1389 (eieiomt-add method code key argclass)
1390 )
1391
1392 (when eieio-optimize-primary-methods-flag
1393 ;; Optimizing step:
1394 ;;
1395 ;; If this method, after this setup, only has primary methods, then
1396 ;; we can setup the generic that way.
1397 (if (generic-primary-only-p method)
1398 ;; If there is only one primary method, then we can go one more
1399 ;; optimization step.
1400 (if (generic-primary-only-one-p method)
1401 (eieio-defgeneric-reset-generic-form-primary-only-one method)
1402 (eieio-defgeneric-reset-generic-form-primary-only method))
1403 (eieio-defgeneric-reset-generic-form method)))
1404
1405 method)
1406
1407;;; Slot type validation
1408
1409;; This is a hideous hack for replacing `typep' from cl-macs, to avoid
1410;; requiring the CL library at run-time. It can be eliminated if/when
1411;; `typep' is merged into Emacs core.
1412(defun eieio--typep (val type)
1413 (if (symbolp type)
1414 (cond ((get type 'cl-deftype-handler)
1415 (eieio--typep val (funcall (get type 'cl-deftype-handler))))
1416 ((eq type t) t)
1417 ((eq type 'null) (null val))
1418 ((eq type 'atom) (atom val))
1419 ((eq type 'float) (and (numberp val) (not (integerp val))))
1420 ((eq type 'real) (numberp val))
1421 ((eq type 'fixnum) (integerp val))
1422 ((memq type '(character string-char)) (characterp val))
1423 (t
1424 (let* ((name (symbol-name type))
1425 (namep (intern (concat name "p"))))
1426 (if (fboundp namep)
1427 (funcall `(lambda () (,namep val)))
1428 (funcall `(lambda ()
1429 (,(intern (concat name "-p")) val)))))))
1430 (cond ((get (car type) 'cl-deftype-handler)
1431 (eieio--typep val (apply (get (car type) 'cl-deftype-handler)
1432 (cdr type))))
1433 ((memq (car type) '(integer float real number))
1434 (and (eieio--typep val (car type))
1435 (or (memq (cadr type) '(* nil))
1436 (if (consp (cadr type))
1437 (> val (car (cadr type)))
1438 (>= val (cadr type))))
1439 (or (memq (caddr type) '(* nil))
1440 (if (consp (car (cddr type)))
1441 (< val (caar (cddr type)))
1442 (<= val (car (cddr type)))))))
1443 ((memq (car type) '(and or not))
1444 (eval (cons (car type)
1445 (mapcar (lambda (x)
1446 `(eieio--typep (quote ,val) (quote ,x)))
1447 (cdr type)))))
1448 ((memq (car type) '(member member*))
1449 (memql val (cdr type)))
1450 ((eq (car type) 'satisfies)
1451 (funcall `(lambda () (,(cadr type) val))))
1452 (t (error "Bad type spec: %s" type)))))
1453
1454(defun eieio-perform-slot-validation (spec value)
1455 "Return non-nil if SPEC does not match VALUE."
1456 (or (eq spec t) ; t always passes
1457 (eq value eieio-unbound) ; unbound always passes
1458 (eieio--typep value spec)))
1459
1460(defun eieio-validate-slot-value (class slot-idx value slot)
1461 "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
1462Checks the :type specifier.
1463SLOT is the slot that is being checked, and is only used when throwing
1464an error."
1465 (if eieio-skip-typecheck
1466 nil
1467 ;; Trim off object IDX junk added in for the object index.
1468 (setq slot-idx (- slot-idx 3))
1469 (let ((st (aref (eieio--class-public-type (class-v class)) slot-idx)))
1470 (if (not (eieio-perform-slot-validation st value))
1471 (signal 'invalid-slot-type (list class slot st value))))))
1472
1473(defun eieio-validate-class-slot-value (class slot-idx value slot)
1474 "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
1475Checks the :type specifier.
1476SLOT is the slot that is being checked, and is only used when throwing
1477an error."
1478 (if eieio-skip-typecheck
1479 nil
1480 (let ((st (aref (eieio--class-class-allocation-type (class-v class))
1481 slot-idx)))
1482 (if (not (eieio-perform-slot-validation st value))
1483 (signal 'invalid-slot-type (list class slot st value))))))
1484
1485(defun eieio-barf-if-slot-unbound (value instance slotname fn)
1486 "Throw a signal if VALUE is a representation of an UNBOUND slot.
1487INSTANCE is the object being referenced. SLOTNAME is the offending
1488slot. If the slot is ok, return VALUE.
1489Argument FN is the function calling this verifier."
1490 (if (and (eq value eieio-unbound) (not eieio-skip-typecheck))
1491 (slot-unbound instance (eieio-object-class instance) slotname fn)
1492 value))
1493
1494;;; Get/Set slots in an object. 204;;; Get/Set slots in an object.
1495;; 205;;
1496(defmacro oref (obj slot) 206(defmacro oref (obj slot)
@@ -1499,28 +209,6 @@ Slot is the name of the slot when created by `defclass' or the label
1499created by the :initarg tag." 209created by the :initarg tag."
1500 `(eieio-oref ,obj (quote ,slot))) 210 `(eieio-oref ,obj (quote ,slot)))
1501 211
1502(defun eieio-oref (obj slot)
1503 "Return the value in OBJ at SLOT in the object vector."
1504 (eieio--check-type (or eieio-object-p class-p) obj)
1505 (eieio--check-type symbolp slot)
1506 (if (class-p obj) (eieio-class-un-autoload obj))
1507 (let* ((class (if (class-p obj) obj (eieio--object-class obj)))
1508 (c (eieio-slot-name-index class obj slot)))
1509 (if (not c)
1510 ;; It might be missing because it is a :class allocated slot.
1511 ;; Let's check that info out.
1512 (if (setq c (eieio-class-slot-name-index class slot))
1513 ;; Oref that slot.
1514 (aref (eieio--class-class-allocation-values (class-v class)) c)
1515 ;; The slot-missing method is a cool way of allowing an object author
1516 ;; to intercept missing slot definitions. Since it is also the LAST
1517 ;; thing called in this fn, its return value would be retrieved.
1518 (slot-missing obj slot 'oref)
1519 ;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
1520 )
1521 (eieio--check-type eieio-object-p obj)
1522 (eieio-barf-if-slot-unbound (aref obj c) obj slot 'oref))))
1523
1524(defalias 'slot-value 'eieio-oref) 212(defalias 'slot-value 'eieio-oref)
1525(defalias 'set-slot-value 'eieio-oset) 213(defalias 'set-slot-value 'eieio-oset)
1526 214
@@ -1531,45 +219,6 @@ tag. SLOT can be the slot name, or the tag specified by the :initarg
1531tag in the `defclass' call." 219tag in the `defclass' call."
1532 `(eieio-oref-default ,obj (quote ,slot))) 220 `(eieio-oref-default ,obj (quote ,slot)))
1533 221
1534(defun eieio-oref-default (obj slot)
1535 "Do the work for the macro `oref-default' with similar parameters.
1536Fills in OBJ's SLOT with its default value."
1537 (eieio--check-type (or eieio-object-p class-p) obj)
1538 (eieio--check-type symbolp slot)
1539 (let* ((cl (if (eieio-object-p obj) (eieio--object-class obj) obj))
1540 (c (eieio-slot-name-index cl obj slot)))
1541 (if (not c)
1542 ;; It might be missing because it is a :class allocated slot.
1543 ;; Let's check that info out.
1544 (if (setq c
1545 (eieio-class-slot-name-index cl slot))
1546 ;; Oref that slot.
1547 (aref (eieio--class-class-allocation-values (class-v cl))
1548 c)
1549 (slot-missing obj slot 'oref-default)
1550 ;;(signal 'invalid-slot-name (list (class-name cl) slot))
1551 )
1552 (eieio-barf-if-slot-unbound
1553 (let ((val (nth (- c 3) (eieio--class-public-d (class-v cl)))))
1554 (eieio-default-eval-maybe val))
1555 obj cl 'oref-default))))
1556
1557(defsubst eieio-eval-default-p (val)
1558 "Whether the default value VAL should be evaluated for use."
1559 (and (consp val) (symbolp (car val)) (fboundp (car val))))
1560
1561(defun eieio-default-eval-maybe (val)
1562 "Check VAL, and return what `oref-default' would provide."
1563 (cond
1564 ;; Is it a function call? If so, evaluate it.
1565 ((eieio-eval-default-p val)
1566 (eval val))
1567 ;;;; check for quoted things, and unquote them
1568 ;;((and (consp val) (eq (car val) 'quote))
1569 ;; (car (cdr val)))
1570 ;; return it verbatim
1571 (t val)))
1572
1573;;; Handy CLOS macros 222;;; Handy CLOS macros
1574;; 223;;
1575(defmacro with-slots (spec-list object &rest body) 224(defmacro with-slots (spec-list object &rest body)
@@ -1607,13 +256,6 @@ variable name of the same name as the slot."
1607(define-obsolete-function-alias 256(define-obsolete-function-alias
1608 'object-class-fast #'eieio--object-class "24.4") 257 'object-class-fast #'eieio--object-class "24.4")
1609 258
1610(defun eieio-class-name (class) "Return a Lisp like symbol name for CLASS."
1611 (eieio--check-type class-p class)
1612 ;; I think this is supposed to return a symbol, but to me CLASS is a symbol,
1613 ;; and I wanted a string. Arg!
1614 (format "#<class %s>" (symbol-name class)))
1615(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4")
1616
1617(defun eieio-object-name (obj &optional extra) 259(defun eieio-object-name (obj &optional extra)
1618 "Return a Lisp like symbol string for object OBJ. 260 "Return a Lisp like symbol string for object OBJ.
1619If EXTRA, include that in the string returned to represent the symbol." 261If EXTRA, include that in the string returned to represent the symbol."
@@ -1650,10 +292,6 @@ If EXTRA, include that in the string returned to represent the symbol."
1650(define-obsolete-function-alias 292(define-obsolete-function-alias
1651 'object-class-name 'eieio-object-class-name "24.4") 293 'object-class-name 'eieio-object-class-name "24.4")
1652 294
1653(defmacro eieio-class-parents-fast (class)
1654 "Return parent classes to CLASS with no check."
1655 `(eieio--class-parent (class-v ,class)))
1656
1657(defun eieio-class-parents (class) 295(defun eieio-class-parents (class)
1658 "Return parent classes to CLASS. (overload of variable). 296 "Return parent classes to CLASS. (overload of variable).
1659 297
@@ -1662,130 +300,14 @@ The CLOS function `class-direct-superclasses' is aliased to this function."
1662 (eieio-class-parents-fast class)) 300 (eieio-class-parents-fast class))
1663(define-obsolete-function-alias 'class-parents #'eieio-class-parents "24.4") 301(define-obsolete-function-alias 'class-parents #'eieio-class-parents "24.4")
1664 302
1665(defmacro eieio-class-children-fast (class) "Return child classes to CLASS with no check."
1666 `(eieio--class-children (class-v ,class)))
1667
1668(defun eieio-class-children (class) 303(defun eieio-class-children (class)
1669 "Return child classes to CLASS. 304 "Return child classes to CLASS.
1670
1671The CLOS function `class-direct-subclasses' is aliased to this function." 305The CLOS function `class-direct-subclasses' is aliased to this function."
1672 (eieio--check-type class-p class) 306 (eieio--check-type class-p class)
1673 (eieio-class-children-fast class)) 307 (eieio-class-children-fast class))
1674(define-obsolete-function-alias 308(define-obsolete-function-alias
1675 'class-children #'eieio-class-children "24.4") 309 'class-children #'eieio-class-children "24.4")
1676 310
1677(defun eieio-c3-candidate (class remaining-inputs)
1678 "Return CLASS if it can go in the result now, otherwise nil"
1679 ;; Ensure CLASS is not in any position but the first in any of the
1680 ;; element lists of REMAINING-INPUTS.
1681 (and (not (let ((found nil))
1682 (while (and remaining-inputs (not found))
1683 (setq found (member class (cdr (car remaining-inputs)))
1684 remaining-inputs (cdr remaining-inputs)))
1685 found))
1686 class))
1687
1688(defun eieio-c3-merge-lists (reversed-partial-result remaining-inputs)
1689 "Merge REVERSED-PARTIAL-RESULT REMAINING-INPUTS in a consistent order, if possible.
1690If a consistent order does not exist, signal an error."
1691 (if (let ((tail remaining-inputs)
1692 (found nil))
1693 (while (and tail (not found))
1694 (setq found (car tail) tail (cdr tail)))
1695 (not found))
1696 ;; If all remaining inputs are empty lists, we are done.
1697 (nreverse reversed-partial-result)
1698 ;; Otherwise, we try to find the next element of the result. This
1699 ;; is achieved by considering the first element of each
1700 ;; (non-empty) input list and accepting a candidate if it is
1701 ;; consistent with the rests of the input lists.
1702 (let* ((found nil)
1703 (tail remaining-inputs)
1704 (next (progn
1705 (while (and tail (not found))
1706 (setq found (and (car tail)
1707 (eieio-c3-candidate (caar tail)
1708 remaining-inputs))
1709 tail (cdr tail)))
1710 found)))
1711 (if next
1712 ;; The graph is consistent so far, add NEXT to result and
1713 ;; merge input lists, dropping NEXT from their heads where
1714 ;; applicable.
1715 (eieio-c3-merge-lists
1716 (cons next reversed-partial-result)
1717 (mapcar (lambda (l) (if (eq (first l) next) (rest l) l))
1718 remaining-inputs))
1719 ;; The graph is inconsistent, give up
1720 (signal 'inconsistent-class-hierarchy (list remaining-inputs))))))
1721
1722(defun eieio-class-precedence-dfs (class)
1723 "Return all parents of CLASS in depth-first order."
1724 (let* ((parents (eieio-class-parents-fast class))
1725 (classes (copy-sequence
1726 (apply #'append
1727 (list class)
1728 (or
1729 (mapcar
1730 (lambda (parent)
1731 (cons parent
1732 (eieio-class-precedence-dfs parent)))
1733 parents)
1734 '((eieio-default-superclass))))))
1735 (tail classes))
1736 ;; Remove duplicates.
1737 (while tail
1738 (setcdr tail (delq (car tail) (cdr tail)))
1739 (setq tail (cdr tail)))
1740 classes))
1741
1742(defun eieio-class-precedence-bfs (class)
1743 "Return all parents of CLASS in breadth-first order."
1744 (let ((result)
1745 (queue (or (eieio-class-parents-fast class)
1746 '(eieio-default-superclass))))
1747 (while queue
1748 (let ((head (pop queue)))
1749 (unless (member head result)
1750 (push head result)
1751 (unless (eq head 'eieio-default-superclass)
1752 (setq queue (append queue (or (eieio-class-parents-fast head)
1753 '(eieio-default-superclass))))))))
1754 (cons class (nreverse result)))
1755 )
1756
1757(defun eieio-class-precedence-c3 (class)
1758 "Return all parents of CLASS in c3 order."
1759 (let ((parents (eieio-class-parents-fast class)))
1760 (eieio-c3-merge-lists
1761 (list class)
1762 (append
1763 (or
1764 (mapcar
1765 (lambda (x)
1766 (eieio-class-precedence-c3 x))
1767 parents)
1768 '((eieio-default-superclass)))
1769 (list parents))))
1770 )
1771
1772(defun eieio-class-precedence-list (class)
1773 "Return (transitively closed) list of parents of CLASS.
1774The order, in which the parents are returned depends on the
1775method invocation orders of the involved classes."
1776 (if (or (null class) (eq class 'eieio-default-superclass))
1777 nil
1778 (case (class-method-invocation-order class)
1779 (:depth-first
1780 (eieio-class-precedence-dfs class))
1781 (:breadth-first
1782 (eieio-class-precedence-bfs class))
1783 (:c3
1784 (eieio-class-precedence-c3 class))))
1785 )
1786(define-obsolete-function-alias
1787 'class-precedence-list 'eieio-class-precedence-list "24.4")
1788
1789;; Official CLOS functions. 311;; Official CLOS functions.
1790(define-obsolete-function-alias 312(define-obsolete-function-alias
1791 'class-direct-superclasses #'eieio-class-parents "24.4") 313 'class-direct-superclasses #'eieio-class-parents "24.4")
@@ -1797,10 +319,6 @@ method invocation orders of the involved classes."
1797 `(car (eieio-class-parents ,class))) 319 `(car (eieio-class-parents ,class)))
1798(define-obsolete-function-alias 'class-parent #'eieio-class-parent "24.4") 320(define-obsolete-function-alias 'class-parent #'eieio-class-parent "24.4")
1799 321
1800(defmacro same-class-fast-p (obj class)
1801 "Return t if OBJ is of class-type CLASS with no error checking."
1802 `(eq (eieio--object-class ,obj) ,class))
1803
1804(defun same-class-p (obj class) "Return t if OBJ is of class-type CLASS." 322(defun same-class-p (obj class) "Return t if OBJ is of class-type CLASS."
1805 (eieio--check-type class-p class) 323 (eieio--check-type class-p class)
1806 (eieio--check-type eieio-object-p obj) 324 (eieio--check-type eieio-object-p obj)
@@ -1848,29 +366,6 @@ SLOT is the slot name as specified in `defclass' or the tag created
1848with in the :initarg slot. VALUE can be any Lisp object." 366with in the :initarg slot. VALUE can be any Lisp object."
1849 `(eieio-oset ,obj (quote ,slot) ,value)) 367 `(eieio-oset ,obj (quote ,slot) ,value))
1850 368
1851(defun eieio-oset (obj slot value)
1852 "Do the work for the macro `oset'.
1853Fills in OBJ's SLOT with VALUE."
1854 (eieio--check-type eieio-object-p obj)
1855 (eieio--check-type symbolp slot)
1856 (let ((c (eieio-slot-name-index (eieio--object-class obj) obj slot)))
1857 (if (not c)
1858 ;; It might be missing because it is a :class allocated slot.
1859 ;; Let's check that info out.
1860 (if (setq c
1861 (eieio-class-slot-name-index (eieio--object-class obj) slot))
1862 ;; Oset that slot.
1863 (progn
1864 (eieio-validate-class-slot-value (eieio--object-class obj) c value slot)
1865 (aset (eieio--class-class-allocation-values (class-v (eieio--object-class obj)))
1866 c value))
1867 ;; See oref for comment on `slot-missing'
1868 (slot-missing obj slot 'oset value)
1869 ;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
1870 )
1871 (eieio-validate-slot-value (eieio--object-class obj) c value slot)
1872 (aset obj c value))))
1873
1874(defmacro oset-default (class slot value) 369(defmacro oset-default (class slot value)
1875 "Set the default slot in CLASS for SLOT to VALUE. 370 "Set the default slot in CLASS for SLOT to VALUE.
1876The default value is usually set with the :initform tag during class 371The default value is usually set with the :initform tag during class
@@ -1878,32 +373,6 @@ creation. This allows users to change the default behavior of classes
1878after they are created." 373after they are created."
1879 `(eieio-oset-default ,class (quote ,slot) ,value)) 374 `(eieio-oset-default ,class (quote ,slot) ,value))
1880 375
1881(defun eieio-oset-default (class slot value)
1882 "Do the work for the macro `oset-default'.
1883Fills in the default value in CLASS' in SLOT with VALUE."
1884 (eieio--check-type class-p class)
1885 (eieio--check-type symbolp slot)
1886 (let* ((scoped-class class)
1887 (c (eieio-slot-name-index class nil slot)))
1888 (if (not c)
1889 ;; It might be missing because it is a :class allocated slot.
1890 ;; Let's check that info out.
1891 (if (setq c (eieio-class-slot-name-index class slot))
1892 (progn
1893 ;; Oref that slot.
1894 (eieio-validate-class-slot-value class c value slot)
1895 (aset (eieio--class-class-allocation-values (class-v class)) c
1896 value))
1897 (signal 'invalid-slot-name (list (eieio-class-name class) slot)))
1898 (eieio-validate-slot-value class c value slot)
1899 ;; Set this into the storage for defaults.
1900 (setcar (nthcdr (- c 3) (eieio--class-public-d (class-v class)))
1901 value)
1902 ;; Take the value, and put it into our cache object.
1903 (eieio-oset (eieio--class-default-object-cache (class-v class))
1904 slot value)
1905 )))
1906
1907;;; CLOS queries into classes and slots 376;;; CLOS queries into classes and slots
1908;; 377;;
1909(defun slot-boundp (object slot) 378(defun slot-boundp (object slot)
@@ -2019,337 +488,9 @@ If SLOT is unbound, do nothing."
2019 (if (not (slot-boundp object slot)) 488 (if (not (slot-boundp object slot))
2020 nil 489 nil
2021 (eieio-oset object slot (delete item (eieio-oref object slot))))) 490 (eieio-oset object slot (delete item (eieio-oref object slot)))))
2022
2023;;; EIEIO internal search functions
2024;;
2025(defun eieio-slot-originating-class-p (start-class slot)
2026 "Return non-nil if START-CLASS is the first class to define SLOT.
2027This is for testing if `scoped-class' is the class that defines SLOT
2028so that we can protect private slots."
2029 (let ((par (eieio-class-parents start-class))
2030 (ret t))
2031 (if (not par)
2032 t
2033 (while (and par ret)
2034 (if (intern-soft (symbol-name slot)
2035 (eieio--class-symbol-obarray (class-v (car par))))
2036 (setq ret nil))
2037 (setq par (cdr par)))
2038 ret)))
2039
2040(defun eieio-slot-name-index (class obj slot)
2041 "In CLASS for OBJ find the index of the named SLOT.
2042The slot is a symbol which is installed in CLASS by the `defclass'
2043call. OBJ can be nil, but if it is an object, and the slot in question
2044is protected, access will be allowed if OBJ is a child of the currently
2045`scoped-class'.
2046If SLOT is the value created with :initarg instead,
2047reverse-lookup that name, and recurse with the associated slot value."
2048 ;; Removed checks to outside this call
2049 (let* ((fsym (intern-soft (symbol-name slot)
2050 (eieio--class-symbol-obarray (class-v class))))
2051 (fsi (if (symbolp fsym) (symbol-value fsym) nil)))
2052 (if (integerp fsi)
2053 (cond
2054 ((not (get fsym 'protection))
2055 (+ 3 fsi))
2056 ((and (eq (get fsym 'protection) 'protected)
2057 (bound-and-true-p scoped-class)
2058 (or (child-of-class-p class scoped-class)
2059 (and (eieio-object-p obj)
2060 (child-of-class-p class (eieio-object-class obj)))))
2061 (+ 3 fsi))
2062 ((and (eq (get fsym 'protection) 'private)
2063 (or (and (bound-and-true-p scoped-class)
2064 (eieio-slot-originating-class-p scoped-class slot))
2065 eieio-initializing-object))
2066 (+ 3 fsi))
2067 (t nil))
2068 (let ((fn (eieio-initarg-to-attribute class slot)))
2069 (if fn (eieio-slot-name-index class obj fn) nil)))))
2070
2071(defun eieio-class-slot-name-index (class slot)
2072 "In CLASS find the index of the named SLOT.
2073The slot is a symbol which is installed in CLASS by the `defclass'
2074call. If SLOT is the value created with :initarg instead,
2075reverse-lookup that name, and recurse with the associated slot value."
2076 ;; This will happen less often, and with fewer slots. Do this the
2077 ;; storage cheap way.
2078 (let* ((a (eieio--class-class-allocation-a (class-v class)))
2079 (l1 (length a))
2080 (af (memq slot a))
2081 (l2 (length af)))
2082 ;; Slot # is length of the total list, minus the remaining list of
2083 ;; the found slot.
2084 (if af (- l1 l2))))
2085
2086;;; CLOS generics internal function handling
2087;;
2088(defvar eieio-generic-call-methodname nil
2089 "When using `call-next-method', provides a context on how to do it.")
2090(defvar eieio-generic-call-arglst nil
2091 "When using `call-next-method', provides a context for parameters.")
2092(defvar eieio-generic-call-key nil
2093 "When using `call-next-method', provides a context for the current key.
2094Keys are a number representing :before, :primary, and :after methods.")
2095(defvar eieio-generic-call-next-method-list nil
2096 "When executing a PRIMARY or STATIC method, track the 'next-method'.
2097During executions, the list is first generated, then as each next method
2098is called, the next method is popped off the stack.")
2099
2100(define-obsolete-variable-alias 'eieio-pre-method-execution-hooks
2101 'eieio-pre-method-execution-functions "24.3")
2102(defvar eieio-pre-method-execution-functions nil
2103 "Abnormal hook run just before an EIEIO method is executed.
2104The hook function must accept one argument, the list of forms
2105about to be executed.")
2106
2107(defun eieio-generic-call (method args)
2108 "Call METHOD with ARGS.
2109ARGS provides the context on which implementation to use.
2110This should only be called from a generic function."
2111 ;; We must expand our arguments first as they are always
2112 ;; passed in as quoted symbols
2113 (let ((newargs nil) (mclass nil) (lambdas nil) (tlambdas nil) (keys nil)
2114 (eieio-generic-call-methodname method)
2115 (eieio-generic-call-arglst args)
2116 (firstarg nil)
2117 (primarymethodlist nil))
2118 ;; get a copy
2119 (setq newargs args
2120 firstarg (car newargs))
2121 ;; Is the class passed in autoloaded?
2122 ;; Since class names are also constructors, they can be autoloaded
2123 ;; via the autoload command. Check for this, and load them in.
2124 ;; It's ok if it doesn't turn out to be a class. Probably want that
2125 ;; function loaded anyway.
2126 (if (and (symbolp firstarg)
2127 (fboundp firstarg)
2128 (listp (symbol-function firstarg))
2129 (eq 'autoload (car (symbol-function firstarg))))
2130 (load (nth 1 (symbol-function firstarg))))
2131 ;; Determine the class to use.
2132 (cond ((eieio-object-p firstarg)
2133 (setq mclass (eieio--object-class firstarg)))
2134 ((class-p firstarg)
2135 (setq mclass firstarg))
2136 )
2137 ;; Make sure the class is a valid class
2138 ;; mclass can be nil (meaning a generic for should be used.
2139 ;; mclass cannot have a value that is not a class, however.
2140 (when (and (not (null mclass)) (not (class-p mclass)))
2141 (error "Cannot dispatch method %S on class %S"
2142 method mclass)
2143 )
2144 ;; Now create a list in reverse order of all the calls we have
2145 ;; make in order to successfully do this right. Rules:
2146 ;; 1) Only call generics if scoped-class is not defined
2147 ;; This prevents multiple calls in the case of recursion
2148 ;; 2) Only call static if this is a static method.
2149 ;; 3) Only call specifics if the definition allows for them.
2150 ;; 4) Call in order based on :before, :primary, and :after
2151 (when (eieio-object-p firstarg)
2152 ;; Non-static calls do all this stuff.
2153
2154 ;; :after methods
2155 (setq tlambdas
2156 (if mclass
2157 (eieiomt-method-list method method-after mclass)
2158 (list (eieio-generic-form method method-after nil)))
2159 ;;(or (and mclass (eieio-generic-form method method-after mclass))
2160 ;; (eieio-generic-form method method-after nil))
2161 )
2162 (setq lambdas (append tlambdas lambdas)
2163 keys (append (make-list (length tlambdas) method-after) keys))
2164
2165 ;; :primary methods
2166 (setq tlambdas
2167 (or (and mclass (eieio-generic-form method method-primary mclass))
2168 (eieio-generic-form method method-primary nil)))
2169 (when tlambdas
2170 (setq lambdas (cons tlambdas lambdas)
2171 keys (cons method-primary keys)
2172 primarymethodlist
2173 (eieiomt-method-list method method-primary mclass)))
2174
2175 ;; :before methods
2176 (setq tlambdas
2177 (if mclass
2178 (eieiomt-method-list method method-before mclass)
2179 (list (eieio-generic-form method method-before nil)))
2180 ;;(or (and mclass (eieio-generic-form method method-before mclass))
2181 ;; (eieio-generic-form method method-before nil))
2182 )
2183 (setq lambdas (append tlambdas lambdas)
2184 keys (append (make-list (length tlambdas) method-before) keys))
2185 )
2186
2187 (if mclass
2188 ;; For the case of a class,
2189 ;; if there were no methods found, then there could be :static methods.
2190 (when (not lambdas)
2191 (setq tlambdas
2192 (eieio-generic-form method method-static mclass))
2193 (setq lambdas (cons tlambdas lambdas)
2194 keys (cons method-static keys)
2195 primarymethodlist ;; Re-use even with bad name here
2196 (eieiomt-method-list method method-static mclass)))
2197 ;; For the case of no class (ie - mclass == nil) then there may
2198 ;; be a primary method.
2199 (setq tlambdas
2200 (eieio-generic-form method method-primary nil))
2201 (when tlambdas
2202 (setq lambdas (cons tlambdas lambdas)
2203 keys (cons method-primary keys)
2204 primarymethodlist
2205 (eieiomt-method-list method method-primary nil)))
2206 )
2207
2208 (run-hook-with-args 'eieio-pre-method-execution-functions
2209 primarymethodlist)
2210
2211 ;; Now loop through all occurrences forms which we must execute
2212 ;; (which are happily sorted now) and execute them all!
2213 (let ((rval nil) (lastval nil) (rvalever nil) (found nil))
2214 (while lambdas
2215 (if (car lambdas)
2216 (let* ((scoped-class (cdr (car lambdas)))
2217 (eieio-generic-call-key (car keys))
2218 (has-return-val
2219 (or (= eieio-generic-call-key method-primary)
2220 (= eieio-generic-call-key method-static)))
2221 (eieio-generic-call-next-method-list
2222 ;; Use the cdr, as the first element is the fcn
2223 ;; we are calling right now.
2224 (when has-return-val (cdr primarymethodlist)))
2225 )
2226 (setq found t)
2227 ;;(setq rval (apply (car (car lambdas)) newargs))
2228 (setq lastval (apply (car (car lambdas)) newargs))
2229 (when has-return-val
2230 (setq rval lastval
2231 rvalever t))
2232 ))
2233 (setq lambdas (cdr lambdas)
2234 keys (cdr keys)))
2235 (if (not found)
2236 (if (eieio-object-p (car args))
2237 (setq rval (apply 'no-applicable-method (car args) method args)
2238 rvalever t)
2239 (signal
2240 'no-method-definition
2241 (list method args))))
2242 ;; Right Here... it could be that lastval is returned when
2243 ;; rvalever is nil. Is that right?
2244 rval)))
2245
2246(defun eieio-generic-call-primary-only (method args)
2247 "Call METHOD with ARGS for methods with only :PRIMARY implementations.
2248ARGS provides the context on which implementation to use.
2249This should only be called from a generic function.
2250
2251This method is like `eieio-generic-call', but only
2252implementations in the :PRIMARY slot are queried. After many
2253years of use, it appears that over 90% of methods in use
2254have :PRIMARY implementations only. We can therefore optimize
2255for this common case to improve performance."
2256 ;; We must expand our arguments first as they are always
2257 ;; passed in as quoted symbols
2258 (let ((newargs nil) (mclass nil) (lambdas nil)
2259 (eieio-generic-call-methodname method)
2260 (eieio-generic-call-arglst args)
2261 (firstarg nil)
2262 (primarymethodlist nil)
2263 )
2264 ;; get a copy
2265 (setq newargs args
2266 firstarg (car newargs))
2267
2268 ;; Determine the class to use.
2269 (cond ((eieio-object-p firstarg)
2270 (setq mclass (eieio--object-class firstarg)))
2271 ((not firstarg)
2272 (error "Method %s called on nil" method))
2273 ((not (eieio-object-p firstarg))
2274 (error "Primary-only method %s called on something not an object" method))
2275 (t
2276 (error "EIEIO Error: Improperly classified method %s as primary only"
2277 method)
2278 ))
2279 ;; Make sure the class is a valid class
2280 ;; mclass can be nil (meaning a generic for should be used.
2281 ;; mclass cannot have a value that is not a class, however.
2282 (when (null mclass)
2283 (error "Cannot dispatch method %S on class %S" method mclass)
2284 )
2285
2286 ;; :primary methods
2287 (setq lambdas (eieio-generic-form method method-primary mclass))
2288 (setq primarymethodlist ;; Re-use even with bad name here
2289 (eieiomt-method-list method method-primary mclass))
2290
2291 ;; Now loop through all occurrences forms which we must execute
2292 ;; (which are happily sorted now) and execute them all!
2293 (let* ((rval nil) (lastval nil) (rvalever nil)
2294 (scoped-class (cdr lambdas))
2295 (eieio-generic-call-key method-primary)
2296 ;; Use the cdr, as the first element is the fcn
2297 ;; we are calling right now.
2298 (eieio-generic-call-next-method-list (cdr primarymethodlist))
2299 )
2300
2301 (if (or (not lambdas) (not (car lambdas)))
2302
2303 ;; No methods found for this impl...
2304 (if (eieio-object-p (car args))
2305 (setq rval (apply 'no-applicable-method (car args) method args)
2306 rvalever t)
2307 (signal
2308 'no-method-definition
2309 (list method args)))
2310
2311 ;; Do the regular implementation here.
2312
2313 (run-hook-with-args 'eieio-pre-method-execution-functions
2314 lambdas)
2315
2316 (setq lastval (apply (car lambdas) newargs))
2317 (setq rval lastval
2318 rvalever t)
2319 )
2320 491
2321 ;; Right Here... it could be that lastval is returned when 492;;;
2322 ;; rvalever is nil. Is that right? 493;; Method Calling Functions
2323 rval)))
2324
2325(defun eieiomt-method-list (method key class)
2326 "Return an alist list of methods lambdas.
2327METHOD is the method name.
2328KEY represents either :before, or :after methods.
2329CLASS is the starting class to search from in the method tree.
2330If CLASS is nil, then an empty list of methods should be returned."
2331 ;; Note: eieiomt - the MT means MethodTree. See more comments below
2332 ;; for the rest of the eieiomt methods.
2333
2334 ;; Collect lambda expressions stored for the class and its parent
2335 ;; classes.
2336 (let (lambdas)
2337 (dolist (ancestor (eieio-class-precedence-list class))
2338 ;; Lookup the form to use for the PRIMARY object for the next level
2339 (let ((tmpl (eieio-generic-form method key ancestor)))
2340 (when (and tmpl
2341 (or (not lambdas)
2342 ;; This prevents duplicates coming out of the
2343 ;; class method optimizer. Perhaps we should
2344 ;; just not optimize before/afters?
2345 (not (member tmpl lambdas))))
2346 (push tmpl lambdas))))
2347
2348 ;; Return collected lambda. For :after methods, return in current
2349 ;; order (most general class last); Otherwise, reverse order.
2350 (if (eq key method-after)
2351 lambdas
2352 (nreverse lambdas))))
2353 494
2354(defun next-method-p () 495(defun next-method-p ()
2355 "Return non-nil if there is a next method. 496 "Return non-nil if there is a next method.
@@ -2367,7 +508,7 @@ If REPLACEMENT-ARGS is non-nil, then use them instead of
2367arguments passed in at the top level. 508arguments passed in at the top level.
2368 509
2369Use `next-method-p' to find out if there is a next method to call." 510Use `next-method-p' to find out if there is a next method to call."
2370 (if (not (bound-and-true-p scoped-class)) 511 (if (not (eieio--scoped-class))
2371 (error "`call-next-method' not called within a class specific method")) 512 (error "`call-next-method' not called within a class specific method"))
2372 (if (and (/= eieio-generic-call-key method-primary) 513 (if (and (/= eieio-generic-call-key method-primary)
2373 (/= eieio-generic-call-key method-static)) 514 (/= eieio-generic-call-key method-static))
@@ -2381,231 +522,10 @@ Use `next-method-p' to find out if there is a next method to call."
2381 (let* ((eieio-generic-call-next-method-list 522 (let* ((eieio-generic-call-next-method-list
2382 (cdr eieio-generic-call-next-method-list)) 523 (cdr eieio-generic-call-next-method-list))
2383 (eieio-generic-call-arglst newargs) 524 (eieio-generic-call-arglst newargs)
2384 (scoped-class (cdr next))
2385 (fcn (car next)) 525 (fcn (car next))
2386 ) 526 )
2387 (apply fcn newargs) 527 (eieio--with-scoped-class (cdr next)
2388 )))) 528 (apply fcn newargs)) ))))
2389
2390;;;
2391;; eieio-method-tree : eieiomt-
2392;;
2393;; Stored as eieio-method-tree in property list of a generic method
2394;;
2395;; (eieio-method-tree . [BEFORE PRIMARY AFTER
2396;; genericBEFORE genericPRIMARY genericAFTER])
2397;; and
2398;; (eieio-method-obarray . [BEFORE PRIMARY AFTER
2399;; genericBEFORE genericPRIMARY genericAFTER])
2400;; where the association is a vector.
2401;; (aref 0 -- all static methods.
2402;; (aref 1 -- all methods classified as :before
2403;; (aref 2 -- all methods classified as :primary
2404;; (aref 3 -- all methods classified as :after
2405;; (aref 4 -- a generic classified as :before
2406;; (aref 5 -- a generic classified as :primary
2407;; (aref 6 -- a generic classified as :after
2408;;
2409(defvar eieiomt-optimizing-obarray nil
2410 "While mapping atoms, this contain the obarray being optimized.")
2411
2412(defun eieiomt-install (method-name)
2413 "Install the method tree, and obarray onto METHOD-NAME.
2414Do not do the work if they already exist."
2415 (let ((emtv (get method-name 'eieio-method-tree))
2416 (emto (get method-name 'eieio-method-obarray)))
2417 (if (or (not emtv) (not emto))
2418 (progn
2419 (setq emtv (put method-name 'eieio-method-tree
2420 (make-vector method-num-slots nil))
2421 emto (put method-name 'eieio-method-obarray
2422 (make-vector method-num-slots nil)))
2423 (aset emto 0 (make-vector 11 0))
2424 (aset emto 1 (make-vector 11 0))
2425 (aset emto 2 (make-vector 41 0))
2426 (aset emto 3 (make-vector 11 0))
2427 ))))
2428
2429(defun eieiomt-add (method-name method key class)
2430 "Add to METHOD-NAME the forms METHOD in a call position KEY for CLASS.
2431METHOD-NAME is the name created by a call to `defgeneric'.
2432METHOD are the forms for a given implementation.
2433KEY is an integer (see comment in eieio.el near this function) which
2434is associated with the :static :before :primary and :after tags.
2435It also indicates if CLASS is defined or not.
2436CLASS is the class this method is associated with."
2437 (if (or (> key method-num-slots) (< key 0))
2438 (error "eieiomt-add: method key error!"))
2439 (let ((emtv (get method-name 'eieio-method-tree))
2440 (emto (get method-name 'eieio-method-obarray)))
2441 ;; Make sure the method tables are available.
2442 (if (or (not emtv) (not emto))
2443 (error "Programmer error: eieiomt-add"))
2444 ;; only add new cells on if it doesn't already exist!
2445 (if (assq class (aref emtv key))
2446 (setcdr (assq class (aref emtv key)) method)
2447 (aset emtv key (cons (cons class method) (aref emtv key))))
2448 ;; Add function definition into newly created symbol, and store
2449 ;; said symbol in the correct obarray, otherwise use the
2450 ;; other array to keep this stuff
2451 (if (< key method-num-lists)
2452 (let ((nsym (intern (symbol-name class) (aref emto key))))
2453 (fset nsym method)))
2454 ;; Save the defmethod file location in a symbol property.
2455 (let ((fname (if load-in-progress
2456 load-file-name
2457 buffer-file-name))
2458 loc)
2459 (when fname
2460 (when (string-match "\\.elc$" fname)
2461 (setq fname (substring fname 0 (1- (length fname)))))
2462 (setq loc (get method-name 'method-locations))
2463 (add-to-list 'loc
2464 (list class fname))
2465 (put method-name 'method-locations loc)))
2466 ;; Now optimize the entire obarray
2467 (if (< key method-num-lists)
2468 (let ((eieiomt-optimizing-obarray (aref emto key)))
2469 ;; @todo - Is this overkill? Should we just clear the symbol?
2470 (mapatoms 'eieiomt-sym-optimize eieiomt-optimizing-obarray)))
2471 ))
2472
2473(defun eieiomt-next (class)
2474 "Return the next parent class for CLASS.
2475If CLASS is a superclass, return variable `eieio-default-superclass'.
2476If CLASS is variable `eieio-default-superclass' then return nil.
2477This is different from function `class-parent' as class parent returns
2478nil for superclasses. This function performs no type checking!"
2479 ;; No type-checking because all calls are made from functions which
2480 ;; are safe and do checking for us.
2481 (or (eieio-class-parents-fast class)
2482 (if (eq class 'eieio-default-superclass)
2483 nil
2484 '(eieio-default-superclass))))
2485
2486(defun eieiomt-sym-optimize (s)
2487 "Find the next class above S which has a function body for the optimizer."
2488 ;; Set the value to nil in case there is no nearest cell.
2489 (set s nil)
2490 ;; Find the nearest cell that has a function body. If we find one,
2491 ;; we replace the nil from above.
2492 (let ((external-symbol (intern-soft (symbol-name s))))
2493 (catch 'done
2494 (dolist (ancestor (rest (eieio-class-precedence-list external-symbol)))
2495 (let ((ov (intern-soft (symbol-name ancestor)
2496 eieiomt-optimizing-obarray)))
2497 (when (fboundp ov)
2498 (set s ov) ;; store ov as our next symbol
2499 (throw 'done ancestor)))))))
2500
2501(defun eieio-generic-form (method key class)
2502 "Return the lambda form belonging to METHOD using KEY based upon CLASS.
2503If CLASS is not a class then use `generic' instead. If class has
2504no form, but has a parent class, then trace to that parent class.
2505The first time a form is requested from a symbol, an optimized path
2506is memorized for faster future use."
2507 (let ((emto (aref (get method 'eieio-method-obarray)
2508 (if class key (eieio-specialized-key-to-generic-key key)))))
2509 (if (class-p class)
2510 ;; 1) find our symbol
2511 (let ((cs (intern-soft (symbol-name class) emto)))
2512 (if (not cs)
2513 ;; 2) If there isn't one, then make one.
2514 ;; This can be slow since it only occurs once
2515 (progn
2516 (setq cs (intern (symbol-name class) emto))
2517 ;; 2.1) Cache its nearest neighbor with a quick optimize
2518 ;; which should only occur once for this call ever
2519 (let ((eieiomt-optimizing-obarray emto))
2520 (eieiomt-sym-optimize cs))))
2521 ;; 3) If it's bound return this one.
2522 (if (fboundp cs)
2523 (cons cs (eieio--class-symbol (class-v class)))
2524 ;; 4) If it's not bound then this variable knows something
2525 (if (symbol-value cs)
2526 (progn
2527 ;; 4.1) This symbol holds the next class in its value
2528 (setq class (symbol-value cs)
2529 cs (intern-soft (symbol-name class) emto))
2530 ;; 4.2) The optimizer should always have chosen a
2531 ;; function-symbol
2532 ;;(if (fboundp cs)
2533 (cons cs (eieio--class-symbol (class-v (intern (symbol-name class)))))
2534 ;;(error "EIEIO optimizer: erratic data loss!"))
2535 )
2536 ;; There never will be a funcall...
2537 nil)))
2538 ;; for a generic call, what is a list, is the function body we want.
2539 (let ((emtl (aref (get method 'eieio-method-tree)
2540 (if class key (eieio-specialized-key-to-generic-key key)))))
2541 (if emtl
2542 ;; The car of EMTL is supposed to be a class, which in this
2543 ;; case is nil, so skip it.
2544 (cons (cdr (car emtl)) nil)
2545 nil)))))
2546
2547;;;
2548;; Way to assign slots based on a list. Used for constructors, or
2549;; even resetting an object at run-time
2550;;
2551(defun eieio-set-defaults (obj &optional set-all)
2552 "Take object OBJ, and reset all slots to their defaults.
2553If SET-ALL is non-nil, then when a default is nil, that value is
2554reset. If SET-ALL is nil, the slots are only reset if the default is
2555not nil."
2556 (let ((scoped-class (eieio--object-class obj))
2557 (eieio-initializing-object t)
2558 (pub (eieio--class-public-a (class-v (eieio--object-class obj)))))
2559 (while pub
2560 (let ((df (eieio-oref-default obj (car pub))))
2561 (if (or df set-all)
2562 (eieio-oset obj (car pub) df)))
2563 (setq pub (cdr pub)))))
2564
2565(defun eieio-initarg-to-attribute (class initarg)
2566 "For CLASS, convert INITARG to the actual attribute name.
2567If there is no translation, pass it in directly (so we can cheat if
2568need be... May remove that later...)"
2569 (let ((tuple (assoc initarg (eieio--class-initarg-tuples (class-v class)))))
2570 (if tuple
2571 (cdr tuple)
2572 nil)))
2573
2574(defun eieio-attribute-to-initarg (class attribute)
2575 "In CLASS, convert the ATTRIBUTE into the corresponding init argument tag.
2576This is usually a symbol that starts with `:'."
2577 (let ((tuple (rassoc attribute (eieio--class-initarg-tuples (class-v class)))))
2578 (if tuple
2579 (car tuple)
2580 nil)))
2581
2582
2583;;; Here are some special types of errors
2584;;
2585(intern "no-method-definition")
2586(put 'no-method-definition 'error-conditions '(no-method-definition error))
2587(put 'no-method-definition 'error-message "No method definition")
2588
2589(intern "no-next-method")
2590(put 'no-next-method 'error-conditions '(no-next-method error))
2591(put 'no-next-method 'error-message "No next method")
2592
2593(intern "invalid-slot-name")
2594(put 'invalid-slot-name 'error-conditions '(invalid-slot-name error))
2595(put 'invalid-slot-name 'error-message "Invalid slot name")
2596
2597(intern "invalid-slot-type")
2598(put 'invalid-slot-type 'error-conditions '(invalid-slot-type error nil))
2599(put 'invalid-slot-type 'error-message "Invalid slot type")
2600
2601(intern "unbound-slot")
2602(put 'unbound-slot 'error-conditions '(unbound-slot error nil))
2603(put 'unbound-slot 'error-message "Unbound slot")
2604
2605(intern "inconsistent-class-hierarchy")
2606(put 'inconsistent-class-hierarchy 'error-conditions
2607 '(inconsistent-class-hierarchy error nil))
2608(put 'inconsistent-class-hierarchy 'error-message "Inconsistent class hierarchy")
2609 529
2610;;; Here are some CLOS items that need the CL package 530;;; Here are some CLOS items that need the CL package
2611;; 531;;
@@ -2678,7 +598,7 @@ Called from the constructor routine.")
2678(defmethod shared-initialize ((obj eieio-default-superclass) slots) 598(defmethod shared-initialize ((obj eieio-default-superclass) slots)
2679 "Set slots of OBJ with SLOTS which is a list of name/value pairs. 599 "Set slots of OBJ with SLOTS which is a list of name/value pairs.
2680Called from the constructor routine." 600Called from the constructor routine."
2681 (let ((scoped-class (eieio--object-class obj))) 601 (eieio--with-scoped-class (eieio--object-class obj)
2682 (while slots 602 (while slots
2683 (let ((rn (eieio-initarg-to-attribute (eieio--object-class obj) 603 (let ((rn (eieio-initarg-to-attribute (eieio--object-class obj)
2684 (car slots)))) 604 (car slots))))
@@ -2700,27 +620,27 @@ call `shared-initialize' yourself, or you can call `call-next-method'
2700to have this constructor called automatically. If these steps are 620to have this constructor called automatically. If these steps are
2701not taken, then new objects of your class will not have their values 621not taken, then new objects of your class will not have their values
2702dynamically set from SLOTS." 622dynamically set from SLOTS."
2703 ;; First, see if any of our defaults are `lambda', and 623 ;; First, see if any of our defaults are `lambda', and
2704 ;; re-evaluate them and apply the value to our slots. 624 ;; re-evaluate them and apply the value to our slots.
2705 (let* ((scoped-class (class-v (eieio--object-class this))) 625 (let* ((this-class (class-v (eieio--object-class this)))
2706 (slot (eieio--class-public-a scoped-class)) 626 (slot (eieio--class-public-a this-class))
2707 (defaults (eieio--class-public-d scoped-class))) 627 (defaults (eieio--class-public-d this-class)))
2708 (while slot 628 (while slot
2709 ;; For each slot, see if we need to evaluate it. 629 ;; For each slot, see if we need to evaluate it.
2710 ;; 630 ;;
2711 ;; Paul Landes said in an email: 631 ;; Paul Landes said in an email:
2712 ;; > CL evaluates it if it can, and otherwise, leaves it as 632 ;; > CL evaluates it if it can, and otherwise, leaves it as
2713 ;; > the quoted thing as you already have. This is by the 633 ;; > the quoted thing as you already have. This is by the
2714 ;; > Sonya E. Keene book and other things I've look at on the 634 ;; > Sonya E. Keene book and other things I've look at on the
2715 ;; > web. 635 ;; > web.
2716 (let ((dflt (eieio-default-eval-maybe (car defaults)))) 636 (let ((dflt (eieio-default-eval-maybe (car defaults))))
2717 (when (not (eq dflt (car defaults))) 637 (when (not (eq dflt (car defaults)))
2718 (eieio-oset this (car slot) dflt) )) 638 (eieio-oset this (car slot) dflt) ))
2719 ;; Next. 639 ;; Next.
2720 (setq slot (cdr slot) 640 (setq slot (cdr slot)
2721 defaults (cdr defaults)))) 641 defaults (cdr defaults))))
2722 ;; Shared initialize will parse our slots for us. 642 ;; Shared initialize will parse our slots for us.
2723 (shared-initialize this slots)) 643 (shared-initialize this slots))
2724 644
2725(defgeneric slot-missing (object slot-name operation &optional new-value) 645(defgeneric slot-missing (object slot-name operation &optional new-value)
2726 "Method invoked when an attempt to access a slot in OBJECT fails.") 646 "Method invoked when an attempt to access a slot in OBJECT fails.")
@@ -2940,102 +860,6 @@ This may create or delete slots, but does not affect the return value
2940of `eq'." 860of `eq'."
2941 (error "EIEIO: `change-class' is unimplemented")) 861 (error "EIEIO: `change-class' is unimplemented"))
2942 862
2943)
2944
2945;;; Obsolete backward compatibility functions.
2946;; Needed to run byte-code compiled with the EIEIO of Emacs-23.
2947
2948(defun eieio-defmethod (method args)
2949 "Obsolete work part of an old version of the `defmethod' macro."
2950 (let ((key nil) (body nil) (firstarg nil) (argfix nil) (argclass nil) loopa)
2951 ;; find optional keys
2952 (setq key
2953 (cond ((memq (car args) '(:BEFORE :before))
2954 (setq args (cdr args))
2955 method-before)
2956 ((memq (car args) '(:AFTER :after))
2957 (setq args (cdr args))
2958 method-after)
2959 ((memq (car args) '(:STATIC :static))
2960 (setq args (cdr args))
2961 method-static)
2962 ((memq (car args) '(:PRIMARY :primary))
2963 (setq args (cdr args))
2964 method-primary)
2965 ;; Primary key.
2966 (t method-primary)))
2967 ;; Get body, and fix contents of args to be the arguments of the fn.
2968 (setq body (cdr args)
2969 args (car args))
2970 (setq loopa args)
2971 ;; Create a fixed version of the arguments.
2972 (while loopa
2973 (setq argfix (cons (if (listp (car loopa)) (car (car loopa)) (car loopa))
2974 argfix))
2975 (setq loopa (cdr loopa)))
2976 ;; Make sure there is a generic.
2977 (eieio-defgeneric
2978 method
2979 (if (stringp (car body))
2980 (car body) (format "Generically created method `%s'." method)))
2981 ;; create symbol for property to bind to. If the first arg is of
2982 ;; the form (varname vartype) and `vartype' is a class, then
2983 ;; that class will be the type symbol. If not, then it will fall
2984 ;; under the type `primary' which is a non-specific calling of the
2985 ;; function.
2986 (setq firstarg (car args))
2987 (if (listp firstarg)
2988 (progn
2989 (setq argclass (nth 1 firstarg))
2990 (if (not (class-p argclass))
2991 (error "Unknown class type %s in method parameters"
2992 (nth 1 firstarg))))
2993 ;; Generics are higher.
2994 (setq key (eieio-specialized-key-to-generic-key key)))
2995 ;; Put this lambda into the symbol so we can find it.
2996 (if (byte-code-function-p (car-safe body))
2997 (eieiomt-add method (car-safe body) key argclass)
2998 (eieiomt-add method (append (list 'lambda (reverse argfix)) body)
2999 key argclass))
3000 )
3001
3002 (when eieio-optimize-primary-methods-flag
3003 ;; Optimizing step:
3004 ;;
3005 ;; If this method, after this setup, only has primary methods, then
3006 ;; we can setup the generic that way.
3007 (if (generic-primary-only-p method)
3008 ;; If there is only one primary method, then we can go one more
3009 ;; optimization step.
3010 (if (generic-primary-only-one-p method)
3011 (eieio-defgeneric-reset-generic-form-primary-only-one method)
3012 (eieio-defgeneric-reset-generic-form-primary-only method))
3013 (eieio-defgeneric-reset-generic-form method)))
3014
3015 method)
3016(make-obsolete 'eieio-defmethod 'eieio--defmethod "24.1")
3017
3018(defun eieio-defgeneric (method doc-string)
3019 "Obsolete work part of an old version of the `defgeneric' macro."
3020 (if (and (fboundp method) (not (generic-p method))
3021 (or (byte-code-function-p (symbol-function method))
3022 (not (eq 'autoload (car (symbol-function method)))))
3023 )
3024 (error "You cannot create a generic/method over an existing symbol: %s"
3025 method))
3026 ;; Don't do this over and over.
3027 (unless (fboundp 'method)
3028 ;; This defun tells emacs where the first definition of this
3029 ;; method is defined.
3030 `(defun ,method nil)
3031 ;; Make sure the method tables are installed.
3032 (eieiomt-install method)
3033 ;; Apply the actual body of this function.
3034 (fset method (eieio-defgeneric-form method doc-string))
3035 ;; Return the method
3036 'method))
3037(make-obsolete 'eieio-defgeneric nil "24.1")
3038
3039;;; Interfacing with edebug 863;;; Interfacing with edebug
3040;; 864;;
3041(defun eieio-edebug-prin1-to-string (object &optional noescape) 865(defun eieio-edebug-prin1-to-string (object &optional noescape)
diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el
index dd5ff0ec694..cb86a554335 100644
--- a/lisp/emacs-lisp/generic.el
+++ b/lisp/emacs-lisp/generic.el
@@ -93,6 +93,8 @@
93 93
94;;; Code: 94;;; Code:
95 95
96(eval-when-compile (require 'pcase))
97
96;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
97;; Internal Variables 99;; Internal Variables
98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -224,18 +226,11 @@ Some generic modes are defined in `generic-x.el'."
224 (funcall (intern mode))) 226 (funcall (intern mode)))
225 227
226;;; Comment Functionality 228;;; Comment Functionality
227(defun generic-mode-set-comments (comment-list)
228 "Set up comment functionality for generic mode."
229 (let ((st (make-syntax-table))
230 (chars nil)
231 (comstyles))
232 (make-local-variable 'comment-start)
233 (make-local-variable 'comment-start-skip)
234 (make-local-variable 'comment-end)
235 229
236 ;; Go through all the comments 230(defun generic--normalise-comments (comment-list)
231 (let ((normalized '()))
237 (dolist (start comment-list) 232 (dolist (start comment-list)
238 (let (end (comstyle "")) 233 (let (end)
239 ;; Normalize 234 ;; Normalize
240 (when (consp start) 235 (when (consp start)
241 (setq end (cdr start)) 236 (setq end (cdr start))
@@ -244,58 +239,79 @@ Some generic modes are defined in `generic-x.el'."
244 (cond 239 (cond
245 ((characterp end) (setq end (char-to-string end))) 240 ((characterp end) (setq end (char-to-string end)))
246 ((zerop (length end)) (setq end "\n"))) 241 ((zerop (length end)) (setq end "\n")))
242 (push (cons start end) normalized)))
243 (nreverse normalized)))
247 244
248 ;; Setup the vars for `comment-region' 245(defun generic-set-comment-syntax (st comment-list)
249 (if comment-start 246 "Set up comment functionality for generic mode."
250 ;; We have already setup a comment-style, so use style b 247 (let ((chars nil)
251 (progn 248 (comstyles)
252 (setq comstyle "b") 249 (comstyle "")
253 (setq comment-start-skip 250 (comment-start nil))
254 (concat comment-start-skip "\\|" (regexp-quote start) "+\\s-*"))) 251
255 ;; First comment-style 252 ;; Go through all the comments.
256 (setq comment-start start) 253 (pcase-dolist (`(,start . ,end) comment-list)
257 (setq comment-end (if (string-equal end "\n") "" end)) 254 (let ((comstyle
258 (setq comment-start-skip (concat (regexp-quote start) "+\\s-*"))) 255 ;; Reuse comstyles if necessary.
259
260 ;; Reuse comstyles if necessary
261 (setq comstyle
262 (or (cdr (assoc start comstyles)) 256 (or (cdr (assoc start comstyles))
263 (cdr (assoc end comstyles)) 257 (cdr (assoc end comstyles))
264 comstyle)) 258 ;; Otherwise, use a style not yet in use.
259 (if (not (rassoc "" comstyles)) "")
260 (if (not (rassoc "b" comstyles)) "b")
261 "c")))
265 (push (cons start comstyle) comstyles) 262 (push (cons start comstyle) comstyles)
266 (push (cons end comstyle) comstyles) 263 (push (cons end comstyle) comstyles)
267 264
268 ;; Setup the syntax table 265 ;; Setup the syntax table.
269 (if (= (length start) 1) 266 (if (= (length start) 1)
270 (modify-syntax-entry (string-to-char start) 267 (modify-syntax-entry (aref start 0)
271 (concat "< " comstyle) st) 268 (concat "< " comstyle) st)
272 (let ((c0 (elt start 0)) (c1 (elt start 1))) 269 (let ((c0 (aref start 0)) (c1 (aref start 1)))
273 ;; Store the relevant info but don't update yet 270 ;; Store the relevant info but don't update yet.
274 (push (cons c0 (concat (cdr (assoc c0 chars)) "1")) chars) 271 (push (cons c0 (concat (cdr (assoc c0 chars)) "1")) chars)
275 (push (cons c1 (concat (cdr (assoc c1 chars)) 272 (push (cons c1 (concat (cdr (assoc c1 chars))
276 (concat "2" comstyle))) chars))) 273 (concat "2" comstyle))) chars)))
277 (if (= (length end) 1) 274 (if (= (length end) 1)
278 (modify-syntax-entry (string-to-char end) 275 (modify-syntax-entry (aref end 0)
279 (concat ">" comstyle) st) 276 (concat ">" comstyle) st)
280 (let ((c0 (elt end 0)) (c1 (elt end 1))) 277 (let ((c0 (aref end 0)) (c1 (aref end 1)))
281 ;; Store the relevant info but don't update yet 278 ;; Store the relevant info but don't update yet.
282 (push (cons c0 (concat (cdr (assoc c0 chars)) 279 (push (cons c0 (concat (cdr (assoc c0 chars))
283 (concat "3" comstyle))) chars) 280 (concat "3" comstyle))) chars)
284 (push (cons c1 (concat (cdr (assoc c1 chars)) "4")) chars))))) 281 (push (cons c1 (concat (cdr (assoc c1 chars)) "4")) chars)))))
285 282
286 ;; Process the chars that were part of a 2-char comment marker 283 ;; Process the chars that were part of a 2-char comment marker
284 (with-syntax-table st ;For `char-syntax'.
287 (dolist (cs (nreverse chars)) 285 (dolist (cs (nreverse chars))
288 (modify-syntax-entry (car cs) 286 (modify-syntax-entry (car cs)
289 (concat (char-to-string (char-syntax (car cs))) 287 (concat (char-to-string (char-syntax (car cs)))
290 " " (cdr cs)) 288 " " (cdr cs))
291 st)) 289 st)))))
290
291(defun generic-set-comment-vars (comment-list)
292 (when comment-list
293 (setq-local comment-start (caar comment-list))
294 (setq-local comment-end
295 (let ((end (cdar comment-list)))
296 (if (string-equal end "\n") "" end)))
297 (setq-local comment-start-skip
298 (concat (regexp-opt (mapcar #'car comment-list))
299 "+[ \t]*"))
300 (setq-local comment-end-skip
301 (concat "[ \t]*" (regexp-opt (mapcar #'cdr comment-list))))))
302
303(defun generic-mode-set-comments (comment-list)
304 "Set up comment functionality for generic mode."
305 (let ((st (make-syntax-table))
306 (comment-list (generic--normalise-comments comment-list)))
307 (generic-set-comment-syntax st comment-list)
308 (generic-set-comment-vars comment-list)
292 (set-syntax-table st))) 309 (set-syntax-table st)))
293 310
294(defun generic-bracket-support () 311(defun generic-bracket-support ()
295 "Imenu support for [KEYWORD] constructs found in INF, INI and Samba files." 312 "Imenu support for [KEYWORD] constructs found in INF, INI and Samba files."
296 (setq imenu-generic-expression 313 (setq-local imenu-generic-expression '((nil "^\\[\\(.*\\)\\]" 1)))
297 '((nil "^\\[\\(.*\\)\\]" 1)) 314 (setq-local imenu-case-fold-search t))
298 imenu-case-fold-search t))
299 315
300;;;###autoload 316;;;###autoload
301(defun generic-make-keywords-list (keyword-list face &optional prefix suffix) 317(defun generic-make-keywords-list (keyword-list face &optional prefix suffix)
@@ -306,6 +322,7 @@ expression that matches these keywords and concatenates it with
306PREFIX and SUFFIX. Then it returns a construct based on this 322PREFIX and SUFFIX. Then it returns a construct based on this
307regular expression that can be used as an element of 323regular expression that can be used as an element of
308`font-lock-keywords'." 324`font-lock-keywords'."
325 (declare (obsolete regexp-opt "24.4"))
309 (unless (listp keyword-list) 326 (unless (listp keyword-list)
310 (error "Keywords argument must be a list of strings")) 327 (error "Keywords argument must be a list of strings"))
311 (list (concat prefix "\\_<" 328 (list (concat prefix "\\_<"
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 8d74afac285..cbd8854e7d6 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -225,11 +225,13 @@ font-lock keywords will not be case sensitive."
225 (setq-local syntax-begin-function 'beginning-of-defun) 225 (setq-local syntax-begin-function 'beginning-of-defun)
226 (setq font-lock-defaults 226 (setq font-lock-defaults
227 `((lisp-font-lock-keywords 227 `((lisp-font-lock-keywords
228 lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) 228 lisp-font-lock-keywords-1
229 lisp-font-lock-keywords-2)
229 nil ,keywords-case-insensitive nil nil 230 nil ,keywords-case-insensitive nil nil
230 (font-lock-mark-block-function . mark-defun) 231 (font-lock-mark-block-function . mark-defun)
231 (font-lock-syntactic-face-function 232 (font-lock-syntactic-face-function
232 . lisp-font-lock-syntactic-face-function)))) 233 . lisp-font-lock-syntactic-face-function)))
234 (prog-prettify-install lisp--prettify-symbols-alist))
233 235
234(defun lisp-outline-level () 236(defun lisp-outline-level ()
235 "Lisp mode `outline-level' function." 237 "Lisp mode `outline-level' function."
@@ -266,6 +268,7 @@ font-lock keywords will not be case sensitive."
266 268
267(defvar lisp-mode-shared-map 269(defvar lisp-mode-shared-map
268 (let ((map (make-sparse-keymap))) 270 (let ((map (make-sparse-keymap)))
271 (set-keymap-parent map prog-mode-map)
269 (define-key map "\e\C-q" 'indent-sexp) 272 (define-key map "\e\C-q" 'indent-sexp)
270 (define-key map "\177" 'backward-delete-char-untabify) 273 (define-key map "\177" 'backward-delete-char-untabify)
271 ;; This gets in the way when viewing a Lisp file in view-mode. As 274 ;; This gets in the way when viewing a Lisp file in view-mode. As
@@ -447,6 +450,9 @@ All commands in `lisp-mode-shared-map' are inherited by this map.")
447 :type 'hook 450 :type 'hook
448 :group 'lisp) 451 :group 'lisp)
449 452
453(defconst lisp--prettify-symbols-alist
454 '(("lambda" . ?λ)))
455
450(define-derived-mode emacs-lisp-mode prog-mode "Emacs-Lisp" 456(define-derived-mode emacs-lisp-mode prog-mode "Emacs-Lisp"
451 "Major mode for editing Lisp code to run in Emacs. 457 "Major mode for editing Lisp code to run in Emacs.
452Commands: 458Commands:
@@ -808,6 +814,7 @@ With argument, print output into current buffer."
808(defun eval-sexp-add-defvars (exp &optional pos) 814(defun eval-sexp-add-defvars (exp &optional pos)
809 "Prepend EXP with all the `defvar's that precede it in the buffer. 815 "Prepend EXP with all the `defvar's that precede it in the buffer.
810POS specifies the starting position where EXP was found and defaults to point." 816POS specifies the starting position where EXP was found and defaults to point."
817 (setq exp (macroexpand-all exp)) ;Eager macro-expansion.
811 (if (not lexical-binding) 818 (if (not lexical-binding)
812 exp 819 exp
813 (save-excursion 820 (save-excursion
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index b221d2f823d..a31bef2391d 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -1,4 +1,4 @@
1;;; lisp.el --- Lisp editing commands for Emacs 1;;; lisp.el --- Lisp editing commands for Emacs -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1985-1986, 1994, 2000-2013 Free Software Foundation, 3;; Copyright (C) 1985-1986, 1994, 2000-2013 Free Software Foundation,
4;; Inc. 4;; Inc.
@@ -262,9 +262,9 @@ is called as a function to find the defun's beginning."
262 ;; convention, fallback on the old implementation. 262 ;; convention, fallback on the old implementation.
263 (wrong-number-of-arguments 263 (wrong-number-of-arguments
264 (if (> arg 0) 264 (if (> arg 0)
265 (dotimes (i arg) 265 (dotimes (_ arg)
266 (funcall beginning-of-defun-function)) 266 (funcall beginning-of-defun-function))
267 (dotimes (i (- arg)) 267 (dotimes (_ (- arg))
268 (funcall end-of-defun-function)))))) 268 (funcall end-of-defun-function))))))
269 269
270 ((or defun-prompt-regexp open-paren-in-column-0-is-defun-start) 270 ((or defun-prompt-regexp open-paren-in-column-0-is-defun-start)
@@ -442,7 +442,7 @@ it marks the next defun after the ones already marked."
442 (beginning-of-defun)) 442 (beginning-of-defun))
443 (re-search-backward "^\n" (- (point) 1) t))))) 443 (re-search-backward "^\n" (- (point) 1) t)))))
444 444
445(defun narrow-to-defun (&optional arg) 445(defun narrow-to-defun (&optional _arg)
446 "Make text outside current defun invisible. 446 "Make text outside current defun invisible.
447The defun visible is the one that contains point or follows point. 447The defun visible is the one that contains point or follows point.
448Optional ARG is ignored." 448Optional ARG is ignored."
@@ -662,10 +662,96 @@ considered."
662 (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data) 662 (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)
663 (plist-get plist :predicate)))))) 663 (plist-get plist :predicate))))))
664 664
665 665(defun lisp--local-variables-1 (vars sexp)
666(defun lisp-completion-at-point (&optional predicate) 666 "Return the vars locally bound around the witness, or nil if not found."
667 (let (res)
668 (while
669 (unless
670 (setq res
671 (pcase sexp
672 (`(,(or `let `let*) ,bindings)
673 (let ((vars vars))
674 (when (eq 'let* (car sexp))
675 (dolist (binding (cdr (reverse bindings)))
676 (push (or (car-safe binding) binding) vars)))
677 (lisp--local-variables-1
678 vars (car (cdr-safe (car (last bindings)))))))
679 (`(,(or `let `let*) ,bindings . ,body)
680 (let ((vars vars))
681 (dolist (binding bindings)
682 (push (or (car-safe binding) binding) vars))
683 (lisp--local-variables-1 vars (car (last body)))))
684 (`(lambda ,_) (setq sexp nil))
685 (`(lambda ,args . ,body)
686 (lisp--local-variables-1
687 (append args vars) (car (last body))))
688 (`(condition-case ,_ ,e) (lisp--local-variables-1 vars e))
689 (`(condition-case ,v ,_ . ,catches)
690 (lisp--local-variables-1
691 (cons v vars) (cdr (car (last catches)))))
692 (`(,_ . ,_)
693 (lisp--local-variables-1 vars (car (last sexp))))
694 (`lisp--witness--lisp (or vars '(nil)))
695 (_ nil)))
696 (setq sexp (ignore-errors (butlast sexp)))))
697 res))
698
699(defun lisp--local-variables ()
700 "Return a list of locally let-bound variables at point."
701 (save-excursion
702 (skip-syntax-backward "w_")
703 (let* ((ppss (syntax-ppss))
704 (txt (buffer-substring-no-properties (or (car (nth 9 ppss)) (point))
705 (or (nth 8 ppss) (point))))
706 (closer ()))
707 (dolist (p (nth 9 ppss))
708 (push (cdr (syntax-after p)) closer))
709 (setq closer (apply #'string closer))
710 (let* ((sexp (car (read-from-string
711 (concat txt "lisp--witness--lisp" closer))))
712 (macroexpand-advice (lambda (expander form &rest args)
713 (condition-case nil
714 (apply expander form args)
715 (error form))))
716 (sexp
717 (unwind-protect
718 (progn
719 (advice-add 'macroexpand :around macroexpand-advice)
720 (macroexpand-all sexp))
721 (advice-remove 'macroexpand macroexpand-advice)))
722 (vars (lisp--local-variables-1 nil sexp)))
723 (delq nil
724 (mapcar (lambda (var)
725 (and (symbolp var)
726 (not (string-match (symbol-name var) "\\`[&_]"))
727 ;; Eliminate uninterned vars.
728 (intern-soft var)
729 var))
730 vars))))))
731
732(defvar lisp--local-variables-completion-table
733 ;; Use `defvar' rather than `defconst' since defconst would purecopy this
734 ;; value, which would doubly fail: it would fail because purecopy can't
735 ;; handle the recursive bytecode object, and it would fail because it would
736 ;; move `lastpos' and `lastvars' to pure space where they'd be immutable!
737 (let ((lastpos nil) (lastvars nil))
738 (letrec ((hookfun (lambda ()
739 (setq lastpos nil)
740 (remove-hook 'post-command-hook hookfun))))
741 (completion-table-dynamic
742 (lambda (_string)
743 (save-excursion
744 (skip-syntax-backward "_w")
745 (let ((newpos (cons (point) (current-buffer))))
746 (unless (equal lastpos newpos)
747 (add-hook 'post-command-hook hookfun)
748 (setq lastpos newpos)
749 (setq lastvars
750 (mapcar #'symbol-name (lisp--local-variables))))))
751 lastvars)))))
752
753(defun lisp-completion-at-point (&optional _predicate)
667 "Function used for `completion-at-point-functions' in `emacs-lisp-mode'." 754 "Function used for `completion-at-point-functions' in `emacs-lisp-mode'."
668 ;; FIXME: the `end' could be after point?
669 (with-syntax-table emacs-lisp-mode-syntax-table 755 (with-syntax-table emacs-lisp-mode-syntax-table
670 (let* ((pos (point)) 756 (let* ((pos (point))
671 (beg (condition-case nil 757 (beg (condition-case nil
@@ -691,7 +777,9 @@ considered."
691 ;; use it to provide a more specific completion table in some 777 ;; use it to provide a more specific completion table in some
692 ;; cases. E.g. filter out keywords that are not understood by 778 ;; cases. E.g. filter out keywords that are not understood by
693 ;; the macro/function being called. 779 ;; the macro/function being called.
694 (list nil obarray ;Could be anything. 780 (list nil (completion-table-in-turn
781 lisp--local-variables-completion-table
782 obarray) ;Could be anything.
695 :annotation-function 783 :annotation-function
696 (lambda (str) (if (fboundp (intern-soft str)) " <f>"))) 784 (lambda (str) (if (fboundp (intern-soft str)) " <f>")))
697 ;; Looks like a funcall position. Let's double check. 785 ;; Looks like a funcall position. Let's double check.
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 6bb796434fd..e8b513fcd3e 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -111,15 +111,20 @@ and also to avoid outputting the warning during normal execution."
111 (funcall (eval (cadr form))) 111 (funcall (eval (cadr form)))
112 (byte-compile-constant nil))) 112 (byte-compile-constant nil)))
113 113
114(defun macroexp--compiling-p ()
115 "Return non-nil if we're macroexpanding for the compiler."
116 ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this
117 ;; macro-expansion will be processed by the byte-compiler, we check
118 ;; circumstantial evidence.
119 (member '(declare-function . byte-compile-macroexpand-declare-function)
120 macroexpand-all-environment))
121
122
114(defun macroexp--warn-and-return (msg form) 123(defun macroexp--warn-and-return (msg form)
115 (let ((when-compiled (lambda () (byte-compile-log-warning msg t)))) 124 (let ((when-compiled (lambda () (byte-compile-log-warning msg t))))
116 (cond 125 (cond
117 ((null msg) form) 126 ((null msg) form)
118 ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this 127 ((macroexp--compiling-p)
119 ;; macro-expansion will be processed by the byte-compiler, we check
120 ;; circumstantial evidence.
121 ((member '(declare-function . byte-compile-macroexpand-declare-function)
122 macroexpand-all-environment)
123 `(progn 128 `(progn
124 (macroexp--funcall-if-compiled ',when-compiled) 129 (macroexp--funcall-if-compiled ',when-compiled)
125 ,form)) 130 ,form))
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index a3ce1672a63..17919d9bbeb 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -162,9 +162,11 @@ DESCRIPTION is the text of the news item."
162 description 162 description
163 archive-url)) 163 archive-url))
164 164
165(defun package-upload-buffer-internal (pkg-info extension &optional archive-url) 165(declare-function lm-commentary "lisp-mnt" (&optional file))
166
167(defun package-upload-buffer-internal (pkg-desc extension &optional archive-url)
166 "Upload a package whose contents are in the current buffer. 168 "Upload a package whose contents are in the current buffer.
167PKG-INFO is the package info, see `package-buffer-info'. 169PKG-DESC is the `package-desc'.
168EXTENSION is the file extension, a string. It can be either 170EXTENSION is the file extension, a string. It can be either
169\"el\" or \"tar\". 171\"el\" or \"tar\".
170 172
@@ -196,18 +198,18 @@ if it exists."
196 (error "Aborted"))) 198 (error "Aborted")))
197 (save-excursion 199 (save-excursion
198 (save-restriction 200 (save-restriction
199 (let* ((file-type (cond 201 (let* ((file-type (package-desc-kind pkg-desc))
200 ((equal extension "el") 'single) 202 (pkg-name (package-desc-name pkg-desc))
201 ((equal extension "tar") 'tar) 203 (requires (package-desc-reqs pkg-desc))
202 (t (error "Unknown extension `%s'" extension)))) 204 (desc (if (eq (package-desc-summary pkg-desc)
203 (file-name (aref pkg-info 0)) 205 package--default-summary)
204 (pkg-name (intern file-name))
205 (requires (aref pkg-info 1))
206 (desc (if (string= (aref pkg-info 2) "")
207 (read-string "Description of package: ") 206 (read-string "Description of package: ")
208 (aref pkg-info 2))) 207 (package-desc-summary pkg-desc)))
209 (pkg-version (aref pkg-info 3)) 208 (pkg-version (package-desc-version pkg-desc))
210 (commentary (aref pkg-info 4)) 209 (commentary
210 (pcase file-type
211 (`single (lm-commentary))
212 (`tar nil))) ;; FIXME: Get it from the README file.
211 (split-version (version-to-list pkg-version)) 213 (split-version (version-to-list pkg-version))
212 (pkg-buffer (current-buffer))) 214 (pkg-buffer (current-buffer)))
213 215
@@ -215,7 +217,8 @@ if it exists."
215 ;; from `package-archive-upload-base' otherwise. 217 ;; from `package-archive-upload-base' otherwise.
216 (let ((contents (or (package--archive-contents-from-url archive-url) 218 (let ((contents (or (package--archive-contents-from-url archive-url)
217 (package--archive-contents-from-file))) 219 (package--archive-contents-from-file)))
218 (new-desc (vector split-version requires desc file-type))) 220 (new-desc (package-make-ac-desc
221 split-version requires desc file-type)))
219 (if (> (car contents) package-archive-version) 222 (if (> (car contents) package-archive-version)
220 (error "Unrecognized archive version %d" (car contents))) 223 (error "Unrecognized archive version %d" (car contents)))
221 (let ((elt (assq pkg-name (cdr contents)))) 224 (let ((elt (assq pkg-name (cdr contents))))
@@ -232,6 +235,7 @@ if it exists."
232 ;; this and the package itself. For now we assume ELPA is 235 ;; this and the package itself. For now we assume ELPA is
233 ;; writable via file primitives. 236 ;; writable via file primitives.
234 (let ((print-level nil) 237 (let ((print-level nil)
238 (print-quoted t)
235 (print-length nil)) 239 (print-length nil))
236 (write-region (concat (pp-to-string contents) "\n") 240 (write-region (concat (pp-to-string contents) "\n")
237 nil 241 nil
@@ -241,29 +245,29 @@ if it exists."
241 ;; If there is a commentary section, write it. 245 ;; If there is a commentary section, write it.
242 (when commentary 246 (when commentary
243 (write-region commentary nil 247 (write-region commentary nil
244 (expand-file-name 248 (expand-file-name
245 (concat (symbol-name pkg-name) "-readme.txt") 249 (concat (symbol-name pkg-name) "-readme.txt")
246 package-archive-upload-base))) 250 package-archive-upload-base)))
247 251
248 (set-buffer pkg-buffer) 252 (set-buffer pkg-buffer)
249 (write-region (point-min) (point-max) 253 (write-region (point-min) (point-max)
250 (expand-file-name 254 (expand-file-name
251 (concat file-name "-" pkg-version "." extension) 255 (format "%s-%s.%s" pkg-name pkg-version extension)
252 package-archive-upload-base) 256 package-archive-upload-base)
253 nil nil nil 'excl) 257 nil nil nil 'excl)
254 258
255 ;; Write a news entry. 259 ;; Write a news entry.
256 (and package-update-news-on-upload 260 (and package-update-news-on-upload
257 archive-url 261 archive-url
258 (package--update-news (concat file-name "." extension) 262 (package--update-news (format "%s.%s" pkg-name extension)
259 pkg-version desc archive-url)) 263 pkg-version desc archive-url))
260 264
261 ;; special-case "package": write a second copy so that the 265 ;; special-case "package": write a second copy so that the
262 ;; installer can easily find the latest version. 266 ;; installer can easily find the latest version.
263 (if (string= file-name "package") 267 (if (eq pkg-name 'package)
264 (write-region (point-min) (point-max) 268 (write-region (point-min) (point-max)
265 (expand-file-name 269 (expand-file-name
266 (concat file-name "." extension) 270 (format "%s.%s" pkg-name extension)
267 package-archive-upload-base) 271 package-archive-upload-base)
268 nil nil nil 'ask)))))))) 272 nil nil nil 'ask))))))))
269 273
@@ -275,8 +279,8 @@ destination, prompt for one."
275 (save-excursion 279 (save-excursion
276 (save-restriction 280 (save-restriction
277 ;; Find the package in this buffer. 281 ;; Find the package in this buffer.
278 (let ((pkg-info (package-buffer-info))) 282 (let ((pkg-desc (package-buffer-info)))
279 (package-upload-buffer-internal pkg-info "el"))))) 283 (package-upload-buffer-internal pkg-desc "el")))))
280 284
281(defun package-upload-file (file) 285(defun package-upload-file (file)
282 "Upload the Emacs Lisp package FILE to the package archive. 286 "Upload the Emacs Lisp package FILE to the package archive.
@@ -288,12 +292,13 @@ destination, prompt for one."
288 (interactive "fPackage file name: ") 292 (interactive "fPackage file name: ")
289 (with-temp-buffer 293 (with-temp-buffer
290 (insert-file-contents-literally file) 294 (insert-file-contents-literally file)
291 (let ((info (cond 295 (let ((pkg-desc
292 ((string-match "\\.tar$" file) (package-tar-file-info file)) 296 (cond
293 ((string-match "\\.el$" file) (package-buffer-info)) 297 ((string-match "\\.tar\\'" file) (package-tar-file-info file))
294 (t (error "Unrecognized extension `%s'" 298 ((string-match "\\.el\\'" file) (package-buffer-info))
295 (file-name-extension file)))))) 299 (t (error "Unrecognized extension `%s'"
296 (package-upload-buffer-internal info (file-name-extension file))))) 300 (file-name-extension file))))))
301 (package-upload-buffer-internal pkg-desc (file-name-extension file)))))
297 302
298(defun package-gnus-summary-upload () 303(defun package-gnus-summary-upload ()
299 "Upload a package contained in the current *Article* buffer. 304 "Upload a package contained in the current *Article* buffer.
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 41b635bbe30..d5176abded0 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -170,6 +170,8 @@
170 170
171;;; Code: 171;;; Code:
172 172
173(eval-when-compile (require 'cl-lib))
174
173(require 'tabulated-list) 175(require 'tabulated-list)
174 176
175(defgroup package nil 177(defgroup package nil
@@ -262,11 +264,8 @@ Lower version numbers than this will probably be understood as well.")
262;; We don't prime the cache since it tends to get out of date. 264;; We don't prime the cache since it tends to get out of date.
263(defvar package-archive-contents nil 265(defvar package-archive-contents nil
264 "Cache of the contents of the Emacs Lisp Package Archive. 266 "Cache of the contents of the Emacs Lisp Package Archive.
265This is an alist mapping package names (symbols) to package 267This is an alist mapping package names (symbols) to
266descriptor vectors. These are like the vectors for `package-alist' 268`package--desc' structures.")
267but have extra entries: one which is 'tar for tar packages and
268'single for single-file packages, and one which is the name of
269the archive from which it came.")
270(put 'package-archive-contents 'risky-local-variable t) 269(put 'package-archive-contents 'risky-local-variable t)
271 270
272(defcustom package-user-dir (locate-user-emacs-file "elpa") 271(defcustom package-user-dir (locate-user-emacs-file "elpa")
@@ -297,6 +296,62 @@ contrast, `package-user-dir' contains packages for personal use."
297 :group 'package 296 :group 'package
298 :version "24.1") 297 :version "24.1")
299 298
299(defvar package--default-summary "No description available.")
300
301(cl-defstruct (package-desc
302 ;; Rename the default constructor from `make-package-desc'.
303 (:constructor package-desc-create)
304 ;; Has the same interface as the old `define-package',
305 ;; which is still used in the "foo-pkg.el" files. Extra
306 ;; options can be supported by adding additional keys.
307 (:constructor
308 package-desc-from-define
309 (name-string version-string &optional summary requirements
310 &key kind archive
311 &aux
312 (name (intern name-string))
313 (version (version-to-list version-string))
314 (reqs (mapcar #'(lambda (elt)
315 (list (car elt)
316 (version-to-list (cadr elt))))
317 (if (eq 'quote (car requirements))
318 (nth 1 requirements)
319 requirements))))))
320 "Structure containing information about an individual package.
321
322Slots:
323
324`name' Name of the package, as a symbol.
325
326`version' Version of the package, as a version list.
327
328`summary' Short description of the package, typically taken from
329the first line of the file.
330
331`reqs' Requirements of the package. A list of (PACKAGE
332VERSION-LIST) naming the dependent package and the minimum
333required version.
334
335`kind' The distribution format of the package. Currently, it is
336either `single' or `tar'.
337
338`archive' The name of the archive (as a string) whence this
339package came."
340 name
341 version
342 (summary package--default-summary)
343 reqs
344 kind
345 archive)
346
347;; Package descriptor format used in finder-inf.el and package--builtins.
348(cl-defstruct (package--bi-desc
349 (:constructor package-make-builtin (version summary))
350 (:type vector))
351 version
352 reqs
353 summary)
354
300;; The value is precomputed in finder-inf.el, but don't load that 355;; The value is precomputed in finder-inf.el, but don't load that
301;; until it's needed (i.e. when `package-initialize' is called). 356;; until it's needed (i.e. when `package-initialize' is called).
302(defvar package--builtins nil 357(defvar package--builtins nil
@@ -305,27 +360,14 @@ The actual value is initialized by loading the library
305`finder-inf'; this is not done until it is needed, e.g. by the 360`finder-inf'; this is not done until it is needed, e.g. by the
306function `package-built-in-p'. 361function `package-built-in-p'.
307 362
308Each element has the form (PKG . DESC), where PKG is a package 363Each element has the form (PKG . PACKAGE-BI-DESC), where PKG is a package
309name (a symbol) and DESC is a vector that describes the package. 364name (a symbol) and DESC is a `package--bi-desc' structure.")
310The vector DESC has the form [VERSION-LIST REQS DOCSTRING].
311 VERSION-LIST is a version list.
312 REQS is a list of packages required by the package, each
313 requirement having the form (NAME VL), where NAME is a string
314 and VL is a version list.
315 DOCSTRING is a brief description of the package.")
316(put 'package--builtins 'risky-local-variable t) 365(put 'package--builtins 'risky-local-variable t)
317 366
318(defvar package-alist nil 367(defvar package-alist nil
319 "Alist of all packages available for activation. 368 "Alist of all packages available for activation.
320Each element has the form (PKG . DESC), where PKG is a package 369Each element has the form (PKG . DESC), where PKG is a package
321name (a symbol) and DESC is a vector that describes the package. 370name (a symbol) and DESC is a `package-desc' structure.
322
323The vector DESC has the form [VERSION-LIST REQS DOCSTRING].
324 VERSION-LIST is a version list.
325 REQS is a list of packages required by the package, each
326 requirement having the form (NAME VL) where NAME is a string
327 and VL is a version list.
328 DOCSTRING is a brief description of the package.
329 371
330This variable is set automatically by `package-load-descriptor', 372This variable is set automatically by `package-load-descriptor',
331called via `package-initialize'. To change which packages are 373called via `package-initialize'. To change which packages are
@@ -339,7 +381,10 @@ loaded and/or activated, customize `package-load-list'.")
339(defvar package-obsolete-alist nil 381(defvar package-obsolete-alist nil
340 "Representation of obsolete packages. 382 "Representation of obsolete packages.
341Like `package-alist', but maps package name to a second alist. 383Like `package-alist', but maps package name to a second alist.
342The inner alist is keyed by version.") 384The inner alist is keyed by version.
385
386Each element of the list is (NAME . VERSION-ALIST), where each
387entry in VERSION-ALIST is (VERSION-LIST . PACKAGE-DESC).")
343(put 'package-obsolete-alist 'risky-local-variable t) 388(put 'package-obsolete-alist 'risky-local-variable t)
344 389
345(defun package-version-join (vlist) 390(defun package-version-join (vlist)
@@ -430,26 +475,16 @@ the package by calling `package-load-descriptor'."
430 ;; Actually load the descriptor: 475 ;; Actually load the descriptor:
431 (package-load-descriptor dir subdir)))) 476 (package-load-descriptor dir subdir))))
432 477
433(defsubst package-desc-vers (desc) 478(define-obsolete-function-alias 'package-desc-vers 'package-desc-version "24.4")
434 "Extract version from a package description vector."
435 (aref desc 0))
436 479
437(defsubst package-desc-reqs (desc) 480(define-obsolete-function-alias 'package-desc-doc 'package-desc-summary "24.4")
438 "Extract requirements from a package description vector."
439 (aref desc 1))
440 481
441(defsubst package-desc-doc (desc)
442 "Extract doc string from a package description vector."
443 (aref desc 2))
444
445(defsubst package-desc-kind (desc)
446 "Extract the kind of download from an archive package description vector."
447 (aref desc 3))
448 482
449(defun package--dir (name version) 483(defun package--dir (name version)
484 ;; FIXME: Keep this as a field in the package-desc.
450 "Return the directory where a package is installed, or nil if none. 485 "Return the directory where a package is installed, or nil if none.
451NAME and VERSION are both strings." 486NAME is a symbol and VERSION is a string."
452 (let* ((subdir (concat name "-" version)) 487 (let* ((subdir (format "%s-%s" name version))
453 (dir-list (cons package-user-dir package-directory-list)) 488 (dir-list (cons package-user-dir package-directory-list))
454 pkg-dir) 489 pkg-dir)
455 (while dir-list 490 (while dir-list
@@ -460,9 +495,9 @@ NAME and VERSION are both strings."
460 (setq dir-list (cdr dir-list))))) 495 (setq dir-list (cdr dir-list)))))
461 pkg-dir)) 496 pkg-dir))
462 497
463(defun package-activate-1 (package pkg-vec) 498(defun package-activate-1 (pkg-desc)
464 (let* ((name (symbol-name package)) 499 (let* ((name (package-desc-name pkg-desc))
465 (version-str (package-version-join (package-desc-vers pkg-vec))) 500 (version-str (package-version-join (package-desc-version pkg-desc)))
466 (pkg-dir (package--dir name version-str))) 501 (pkg-dir (package--dir name version-str)))
467 (unless pkg-dir 502 (unless pkg-dir
468 (error "Internal error: unable to find directory for `%s-%s'" 503 (error "Internal error: unable to find directory for `%s-%s'"
@@ -475,8 +510,8 @@ NAME and VERSION are both strings."
475 (push pkg-dir Info-directory-list)) 510 (push pkg-dir Info-directory-list))
476 ;; Add to load path, add autoloads, and activate the package. 511 ;; Add to load path, add autoloads, and activate the package.
477 (push pkg-dir load-path) 512 (push pkg-dir load-path)
478 (load (expand-file-name (concat name "-autoloads") pkg-dir) nil t) 513 (load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t)
479 (push package package-activated-list) 514 (push name package-activated-list)
480 ;; Don't return nil. 515 ;; Don't return nil.
481 t)) 516 t))
482 517
@@ -489,7 +524,12 @@ specifying the minimum acceptable version."
489 (version-list-<= min-version (version-to-list emacs-version)) 524 (version-list-<= min-version (version-to-list emacs-version))
490 (let ((elt (assq package package--builtins))) 525 (let ((elt (assq package package--builtins)))
491 (and elt (version-list-<= min-version 526 (and elt (version-list-<= min-version
492 (package-desc-vers (cdr elt))))))) 527 (package--bi-desc-version (cdr elt)))))))
528
529(defun package--from-builtin (bi-desc)
530 (package-desc-create :name (pop bi-desc)
531 :version (package--bi-desc-version bi-desc)
532 :summary (package--bi-desc-summary bi-desc)))
493 533
494;; This function goes ahead and activates a newer version of a package 534;; This function goes ahead and activates a newer version of a package
495;; if an older one was already activated. This is not ideal; we'd at 535;; if an older one was already activated. This is not ideal; we'd at
@@ -504,7 +544,7 @@ Return nil if the package could not be activated."
504 available-version found) 544 available-version found)
505 ;; Check if PACKAGE is available in `package-alist'. 545 ;; Check if PACKAGE is available in `package-alist'.
506 (when pkg-vec 546 (when pkg-vec
507 (setq available-version (package-desc-vers pkg-vec) 547 (setq available-version (package-desc-version pkg-vec)
508 found (version-list-<= min-version available-version))) 548 found (version-list-<= min-version available-version)))
509 (cond 549 (cond
510 ;; If no such package is found, maybe it's built-in. 550 ;; If no such package is found, maybe it's built-in.
@@ -525,7 +565,7 @@ Return nil if the package could not be activated."
525Required package `%s-%s' is unavailable" 565Required package `%s-%s' is unavailable"
526 package (car fail) (package-version-join (cadr fail))) 566 package (car fail) (package-version-join (cadr fail)))
527 ;; If all goes well, activate the package itself. 567 ;; If all goes well, activate the package itself.
528 (package-activate-1 package pkg-vec))))))) 568 (package-activate-1 pkg-vec)))))))
529 569
530(defun package-mark-obsolete (package pkg-vec) 570(defun package-mark-obsolete (package pkg-vec)
531 "Put package on the obsolete list, if not already there." 571 "Put package on the obsolete list, if not already there."
@@ -533,11 +573,11 @@ Required package `%s-%s' is unavailable"
533 (if elt 573 (if elt
534 ;; If this obsolete version does not exist in the list, update 574 ;; If this obsolete version does not exist in the list, update
535 ;; it the list. 575 ;; it the list.
536 (unless (assoc (package-desc-vers pkg-vec) (cdr elt)) 576 (unless (assoc (package-desc-version pkg-vec) (cdr elt))
537 (setcdr elt (cons (cons (package-desc-vers pkg-vec) pkg-vec) 577 (setcdr elt (cons (cons (package-desc-version pkg-vec) pkg-vec)
538 (cdr elt)))) 578 (cdr elt))))
539 ;; Make a new association. 579 ;; Make a new association.
540 (push (cons package (list (cons (package-desc-vers pkg-vec) 580 (push (cons package (list (cons (package-desc-version pkg-vec)
541 pkg-vec))) 581 pkg-vec)))
542 package-obsolete-alist)))) 582 package-obsolete-alist))))
543 583
@@ -555,21 +595,17 @@ REQUIREMENTS is a list of dependencies on other packages.
555EXTRA-PROPERTIES is currently unused." 595EXTRA-PROPERTIES is currently unused."
556 (let* ((name (intern name-string)) 596 (let* ((name (intern name-string))
557 (version (version-to-list version-string)) 597 (version (version-to-list version-string))
558 (new-pkg-desc 598 (new-pkg-desc (cons name
559 (cons name 599 (package-desc-from-define name-string
560 (vector version 600 version-string
561 (mapcar 601 docstring
562 (lambda (elt) 602 requirements)))
563 (list (car elt)
564 (version-to-list (car (cdr elt)))))
565 requirements)
566 docstring)))
567 (old-pkg (assq name package-alist))) 603 (old-pkg (assq name package-alist)))
568 (cond 604 (cond
569 ;; If there's no old package, just add this to `package-alist'. 605 ;; If there's no old package, just add this to `package-alist'.
570 ((null old-pkg) 606 ((null old-pkg)
571 (push new-pkg-desc package-alist)) 607 (push new-pkg-desc package-alist))
572 ((version-list-< (package-desc-vers (cdr old-pkg)) version) 608 ((version-list-< (package-desc-version (cdr old-pkg)) version)
573 ;; Remove the old package and declare it obsolete. 609 ;; Remove the old package and declare it obsolete.
574 (package-mark-obsolete name (cdr old-pkg)) 610 (package-mark-obsolete name (cdr old-pkg))
575 (setq package-alist (cons new-pkg-desc 611 (setq package-alist (cons new-pkg-desc
@@ -577,7 +613,7 @@ EXTRA-PROPERTIES is currently unused."
577 ;; You can have two packages with the same version, e.g. one in 613 ;; You can have two packages with the same version, e.g. one in
578 ;; the system package directory and one in your private 614 ;; the system package directory and one in your private
579 ;; directory. We just let the first one win. 615 ;; directory. We just let the first one win.
580 ((not (version-list-= (package-desc-vers (cdr old-pkg)) version)) 616 ((not (version-list-= (package-desc-version (cdr old-pkg)) version))
581 ;; The package is born obsolete. 617 ;; The package is born obsolete.
582 (package-mark-obsolete name (cdr new-pkg-desc)))))) 618 (package-mark-obsolete name (cdr new-pkg-desc))))))
583 619
@@ -603,14 +639,15 @@ EXTRA-PROPERTIES is currently unused."
603 639
604(defun package-generate-autoloads (name pkg-dir) 640(defun package-generate-autoloads (name pkg-dir)
605 (require 'autoload) ;Load before we let-bind generated-autoload-file! 641 (require 'autoload) ;Load before we let-bind generated-autoload-file!
606 (let* ((auto-name (concat name "-autoloads.el")) 642 (let* ((auto-name (format "%s-autoloads.el" name))
607 ;;(ignore-name (concat name "-pkg.el")) 643 ;;(ignore-name (concat name "-pkg.el"))
608 (generated-autoload-file (expand-file-name auto-name pkg-dir)) 644 (generated-autoload-file (expand-file-name auto-name pkg-dir))
609 (version-control 'never)) 645 (version-control 'never))
610 (package-autoload-ensure-default-file generated-autoload-file) 646 (package-autoload-ensure-default-file generated-autoload-file)
611 (update-directory-autoloads pkg-dir) 647 (update-directory-autoloads pkg-dir)
612 (let ((buf (find-buffer-visiting generated-autoload-file))) 648 (let ((buf (find-buffer-visiting generated-autoload-file)))
613 (when buf (kill-buffer buf))))) 649 (when buf (kill-buffer buf)))
650 auto-name))
614 651
615(defvar tar-parse-info) 652(defvar tar-parse-info)
616(declare-function tar-untar-buffer "tar-mode" ()) 653(declare-function tar-untar-buffer "tar-mode" ())
@@ -644,57 +681,62 @@ untar into a directory named DIR; otherwise, signal an error."
644 ;; FIXME: should we delete PKG-DIR if it exists? 681 ;; FIXME: should we delete PKG-DIR if it exists?
645 (let* ((default-directory (file-name-as-directory package-user-dir))) 682 (let* ((default-directory (file-name-as-directory package-user-dir)))
646 (package-untar-buffer dirname) 683 (package-untar-buffer dirname)
647 (package--make-autoloads-and-compile name pkg-dir)))) 684 (package--make-autoloads-and-compile package pkg-dir))))
648 685
649(defun package--make-autoloads-and-compile (name pkg-dir) 686(defun package--make-autoloads-and-compile (name pkg-dir)
650 "Generate autoloads and do byte-compilation for package named NAME. 687 "Generate autoloads and do byte-compilation for package named NAME.
651PKG-DIR is the name of the package directory." 688PKG-DIR is the name of the package directory."
652 (package-generate-autoloads name pkg-dir) 689 (let ((auto-name (package-generate-autoloads name pkg-dir))
653 (let ((load-path (cons pkg-dir load-path))) 690 (load-path (cons pkg-dir load-path)))
654 ;; We must load the autoloads file before byte compiling, in 691 ;; We must load the autoloads file before byte compiling, in
655 ;; case there are magic cookies to set up non-trivial paths. 692 ;; case there are magic cookies to set up non-trivial paths.
656 (load (expand-file-name (concat name "-autoloads") pkg-dir) nil t) 693 (load auto-name nil t)
694 ;; FIXME: Compilation should be done as a separate, optional, step.
695 ;; E.g. for multi-package installs, we should first install all packages
696 ;; and then compile them.
657 (byte-recompile-directory pkg-dir 0 t))) 697 (byte-recompile-directory pkg-dir 0 t)))
658 698
659(defun package--write-file-no-coding (file-name) 699(defun package--write-file-no-coding (file-name)
660 (let ((buffer-file-coding-system 'no-conversion)) 700 (let ((buffer-file-coding-system 'no-conversion))
661 (write-region (point-min) (point-max) file-name))) 701 (write-region (point-min) (point-max) file-name)))
662 702
663(defun package-unpack-single (file-name version desc requires) 703(defun package-unpack-single (name version desc requires)
664 "Install the contents of the current buffer as a package." 704 "Install the contents of the current buffer as a package."
665 ;; Special case "package". 705 ;; Special case "package". FIXME: Should this still be supported?
666 (if (string= file-name "package") 706 (if (eq name 'package)
667 (package--write-file-no-coding 707 (package--write-file-no-coding
668 (expand-file-name (concat file-name ".el") package-user-dir)) 708 (expand-file-name (format "%s.el" name) package-user-dir))
669 (let* ((pkg-dir (expand-file-name (concat file-name "-" 709 (let* ((pkg-dir (expand-file-name (format "%s-%s" name
670 (package-version-join 710 (package-version-join
671 (version-to-list version))) 711 (version-to-list version)))
672 package-user-dir)) 712 package-user-dir))
673 (el-file (expand-file-name (concat file-name ".el") pkg-dir)) 713 (el-file (expand-file-name (format "%s.el" name) pkg-dir))
674 (pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir))) 714 (pkg-file (expand-file-name (format "%s-pkg.el" name) pkg-dir)))
675 (make-directory pkg-dir t) 715 (make-directory pkg-dir t)
676 (package--write-file-no-coding el-file) 716 (package--write-file-no-coding el-file)
677 (let ((print-level nil) 717 (let ((print-level nil)
718 (print-quoted t)
678 (print-length nil)) 719 (print-length nil))
679 (write-region 720 (write-region
680 (concat 721 (concat
681 (prin1-to-string 722 (prin1-to-string
682 (list 'define-package 723 (list 'define-package
683 file-name 724 (symbol-name name)
684 version 725 version
685 desc 726 desc
686 (list 'quote 727 (when requires ;Don't bother quoting nil.
687 ;; Turn version lists into string form. 728 (list 'quote
688 (mapcar 729 ;; Turn version lists into string form.
689 (lambda (elt) 730 (mapcar
690 (list (car elt) 731 (lambda (elt)
691 (package-version-join (cadr elt)))) 732 (list (car elt)
692 requires)))) 733 (package-version-join (cadr elt))))
734 requires)))))
693 "\n") 735 "\n")
694 nil 736 nil
695 pkg-file 737 pkg-file
696 nil nil nil 'excl)) 738 nil nil nil 'excl))
697 (package--make-autoloads-and-compile file-name pkg-dir)))) 739 (package--make-autoloads-and-compile name pkg-dir))))
698 740
699(defmacro package--with-work-buffer (location file &rest body) 741(defmacro package--with-work-buffer (location file &rest body)
700 "Run BODY in a buffer containing the contents of FILE at LOCATION. 742 "Run BODY in a buffer containing the contents of FILE at LOCATION.
@@ -744,7 +786,7 @@ It will move point to somewhere in the headers."
744 (let ((location (package-archive-base name)) 786 (let ((location (package-archive-base name))
745 (file (concat (symbol-name name) "-" version ".el"))) 787 (file (concat (symbol-name name) "-" version ".el")))
746 (package--with-work-buffer location file 788 (package--with-work-buffer location file
747 (package-unpack-single (symbol-name name) version desc requires)))) 789 (package-unpack-single name version desc requires))))
748 790
749(defun package-download-tar (name version) 791(defun package-download-tar (name version)
750 "Download and install a tar package." 792 "Download and install a tar package."
@@ -762,7 +804,7 @@ MIN-VERSION should be a version list."
762 (let ((pkg-desc (assq package package-alist))) 804 (let ((pkg-desc (assq package package-alist)))
763 (if pkg-desc 805 (if pkg-desc
764 (version-list-<= min-version 806 (version-list-<= min-version
765 (package-desc-vers (cdr pkg-desc))) 807 (package-desc-version (cdr pkg-desc)))
766 ;; Also check built-in packages. 808 ;; Also check built-in packages.
767 (package-built-in-p package min-version)))) 809 (package-built-in-p package min-version))))
768 810
@@ -785,7 +827,7 @@ not included in this list."
785 (unless (package-installed-p next-pkg next-version) 827 (unless (package-installed-p next-pkg next-version)
786 ;; A package is required, but not installed. It might also be 828 ;; A package is required, but not installed. It might also be
787 ;; blocked via `package-load-list'. 829 ;; blocked via `package-load-list'.
788 (let ((pkg-desc (assq next-pkg package-archive-contents)) 830 (let ((pkg-desc (cdr (assq next-pkg package-archive-contents)))
789 hold) 831 hold)
790 (when (setq hold (assq next-pkg package-load-list)) 832 (when (setq hold (assq next-pkg package-load-list))
791 (setq hold (cadr hold)) 833 (setq hold (cadr hold))
@@ -805,17 +847,17 @@ but version %s required"
805 (symbol-name next-pkg) 847 (symbol-name next-pkg)
806 (package-version-join next-version))) 848 (package-version-join next-version)))
807 (unless (version-list-<= next-version 849 (unless (version-list-<= next-version
808 (package-desc-vers (cdr pkg-desc))) 850 (package-desc-version pkg-desc))
809 (error 851 (error
810 "Need package `%s-%s', but only %s is available" 852 "Need package `%s-%s', but only %s is available"
811 (symbol-name next-pkg) (package-version-join next-version) 853 (symbol-name next-pkg) (package-version-join next-version)
812 (package-version-join (package-desc-vers (cdr pkg-desc))))) 854 (package-version-join (package-desc-version pkg-desc))))
813 ;; Move to front, so it gets installed early enough (bug#14082). 855 ;; Move to front, so it gets installed early enough (bug#14082).
814 (setq package-list (cons next-pkg (delq next-pkg package-list))) 856 (setq package-list (cons next-pkg (delq next-pkg package-list)))
815 (setq package-list 857 (setq package-list
816 (package-compute-transaction package-list 858 (package-compute-transaction package-list
817 (package-desc-reqs 859 (package-desc-reqs
818 (cdr pkg-desc)))))))) 860 pkg-desc)))))))
819 package-list) 861 package-list)
820 862
821(defun package-read-from-string (str) 863(defun package-read-from-string (str)
@@ -867,13 +909,29 @@ If the archive version is too new, signal an error."
867 (dolist (package contents) 909 (dolist (package contents)
868 (package--add-to-archive-contents package archive))))) 910 (package--add-to-archive-contents package archive)))))
869 911
912;; Package descriptor objects used inside the "archive-contents" file.
913;; Changing this defstruct implies changing the format of the
914;; "archive-contents" files.
915(cl-defstruct (package--ac-desc
916 (:constructor package-make-ac-desc (version reqs summary kind))
917 (:copier nil)
918 (:type vector))
919 version reqs summary kind)
920
870(defun package--add-to-archive-contents (package archive) 921(defun package--add-to-archive-contents (package archive)
871 "Add the PACKAGE from the given ARCHIVE if necessary. 922 "Add the PACKAGE from the given ARCHIVE if necessary.
872Also, add the originating archive to the end of the package vector." 923PACKAGE should have the form (NAME . PACKAGE--AC-DESC).
873 (let* ((name (car package)) 924Also, add the originating archive to the `package-desc' structure."
874 (version (package-desc-vers (cdr package))) 925 (let* ((name (car package))
875 (entry (cons name 926 (pkg-desc
876 (vconcat (cdr package) (vector archive)))) 927 (package-desc-create
928 :name name
929 :version (package--ac-desc-version (cdr package))
930 :reqs (package--ac-desc-reqs (cdr package))
931 :summary (package--ac-desc-summary (cdr package))
932 :kind (package--ac-desc-kind (cdr package))
933 :archive archive))
934 (entry (cons name pkg-desc))
877 (existing-package (assq name package-archive-contents)) 935 (existing-package (assq name package-archive-contents))
878 (pinned-to-archive (assoc name package-pinned-packages))) 936 (pinned-to-archive (assoc name package-pinned-packages)))
879 (cond ((and pinned-to-archive 937 (cond ((and pinned-to-archive
@@ -881,9 +939,9 @@ Also, add the originating archive to the end of the package vector."
881 (not (equal (cdr pinned-to-archive) archive))) 939 (not (equal (cdr pinned-to-archive) archive)))
882 nil) 940 nil)
883 ((not existing-package) 941 ((not existing-package)
884 (add-to-list 'package-archive-contents entry)) 942 (push entry package-archive-contents))
885 ((version-list-< (package-desc-vers (cdr existing-package)) 943 ((version-list-< (package-desc-version (cdr existing-package))
886 version) 944 (package-desc-version pkg-desc))
887 ;; Replace the entry with this one. 945 ;; Replace the entry with this one.
888 (setq package-archive-contents 946 (setq package-archive-contents
889 (cons entry 947 (cons entry
@@ -902,14 +960,14 @@ using `package-compute-transaction'."
902 ;; `package-load-list', download the held version. 960 ;; `package-load-list', download the held version.
903 (hold (cadr (assq elt package-load-list))) 961 (hold (cadr (assq elt package-load-list)))
904 (v-string (or (and (stringp hold) hold) 962 (v-string (or (and (stringp hold) hold)
905 (package-version-join (package-desc-vers desc)))) 963 (package-version-join (package-desc-version desc))))
906 (kind (package-desc-kind desc))) 964 (kind (package-desc-kind desc)))
907 (cond 965 (cond
908 ((eq kind 'tar) 966 ((eq kind 'tar)
909 (package-download-tar elt v-string)) 967 (package-download-tar elt v-string))
910 ((eq kind 'single) 968 ((eq kind 'single)
911 (package-download-single elt v-string 969 (package-download-single elt v-string
912 (package-desc-doc desc) 970 (package-desc-summary desc)
913 (package-desc-reqs desc))) 971 (package-desc-reqs desc)))
914 (t 972 (t
915 (error "Unknown package kind: %s" (symbol-name kind)))) 973 (error "Unknown package kind: %s" (symbol-name kind))))
@@ -961,17 +1019,7 @@ Otherwise return nil."
961 (error nil)))) 1019 (error nil))))
962 1020
963(defun package-buffer-info () 1021(defun package-buffer-info ()
964 "Return a vector describing the package in the current buffer. 1022 "Return a `package-desc' describing the package in the current buffer.
965The vector has the form
966
967 [FILENAME REQUIRES DESCRIPTION VERSION COMMENTARY]
968
969FILENAME is the file name, a string, sans the \".el\" extension.
970REQUIRES is a list of requirements, each requirement having the
971 form (NAME VER); NAME is a string and VER is a version list.
972DESCRIPTION is the package description, a string.
973VERSION is the version, a string.
974COMMENTARY is the commentary section, a string, or nil if none.
975 1023
976If the buffer does not contain a conforming package, signal an 1024If the buffer does not contain a conforming package, signal an
977error. If there is a package, narrow the buffer to the file's 1025error. If there is a package, narrow the buffer to the file's
@@ -990,25 +1038,18 @@ boundaries."
990 (require 'lisp-mnt) 1038 (require 'lisp-mnt)
991 ;; Use some headers we've invented to drive the process. 1039 ;; Use some headers we've invented to drive the process.
992 (let* ((requires-str (lm-header "package-requires")) 1040 (let* ((requires-str (lm-header "package-requires"))
993 (requires (if requires-str
994 (package-read-from-string requires-str)))
995 ;; Prefer Package-Version; if defined, the package author 1041 ;; Prefer Package-Version; if defined, the package author
996 ;; probably wants us to use it. Otherwise try Version. 1042 ;; probably wants us to use it. Otherwise try Version.
997 (pkg-version 1043 (pkg-version
998 (or (package-strip-rcs-id (lm-header "package-version")) 1044 (or (package-strip-rcs-id (lm-header "package-version"))
999 (package-strip-rcs-id (lm-header "version")))) 1045 (package-strip-rcs-id (lm-header "version")))))
1000 (commentary (lm-commentary)))
1001 (unless pkg-version 1046 (unless pkg-version
1002 (error 1047 (error
1003 "Package lacks a \"Version\" or \"Package-Version\" header")) 1048 "Package lacks a \"Version\" or \"Package-Version\" header"))
1004 ;; Turn string version numbers into list form. 1049 (package-desc-from-define
1005 (setq requires 1050 file-name pkg-version desc
1006 (mapcar 1051 (if requires-str (package-read-from-string requires-str))
1007 (lambda (elt) 1052 :kind 'single))))
1008 (list (car elt)
1009 (version-to-list (car (cdr elt)))))
1010 requires))
1011 (vector file-name requires desc pkg-version commentary))))
1012 1053
1013(defun package-tar-file-info (file) 1054(defun package-tar-file-info (file)
1014 "Find package information for a tar file. 1055 "Find package information for a tar file.
@@ -1025,67 +1066,46 @@ The return result is a vector like `package-buffer-info'."
1025 (pkg-def-contents (shell-command-to-string 1066 (pkg-def-contents (shell-command-to-string
1026 ;; Requires GNU tar. 1067 ;; Requires GNU tar.
1027 (concat "tar -xOf " file " " 1068 (concat "tar -xOf " file " "
1028
1029 pkg-name "-" pkg-version "/" 1069 pkg-name "-" pkg-version "/"
1030 pkg-name "-pkg.el"))) 1070 pkg-name "-pkg.el")))
1031 (pkg-def-parsed (package-read-from-string pkg-def-contents))) 1071 (pkg-def-parsed (package-read-from-string pkg-def-contents)))
1032 (unless (eq (car pkg-def-parsed) 'define-package) 1072 (unless (eq (car pkg-def-parsed) 'define-package)
1033 (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name)) 1073 (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
1034 (let ((name-str (nth 1 pkg-def-parsed)) 1074 (let ((pkg-desc
1035 (version-string (nth 2 pkg-def-parsed)) 1075 (apply #'package-desc-from-define (append (cdr pkg-def-parsed)
1036 (docstring (nth 3 pkg-def-parsed)) 1076 '(:kind tar)))))
1037 (requires (nth 4 pkg-def-parsed)) 1077 (unless (equal pkg-version
1038 (readme (shell-command-to-string 1078 (package-version-join (package-desc-version pkg-desc)))
1039 ;; Requires GNU tar.
1040 (concat "tar -xOf " file " "
1041 pkg-name "-" pkg-version "/README"))))
1042 (unless (equal pkg-version version-string)
1043 (error "Package has inconsistent versions")) 1079 (error "Package has inconsistent versions"))
1044 (unless (equal pkg-name name-str) 1080 (unless (equal pkg-name (symbol-name (package-desc-name pkg-desc)))
1045 (error "Package has inconsistent names")) 1081 (error "Package has inconsistent names"))
1046 ;; Kind of a hack. 1082 pkg-desc))))
1047 (if (string-match ": Not found in archive" readme) 1083
1048 (setq readme nil))
1049 ;; Turn string version numbers into list form.
1050 (if (eq (car requires) 'quote)
1051 (setq requires (car (cdr requires))))
1052 (setq requires
1053 (mapcar (lambda (elt)
1054 (list (car elt)
1055 (version-to-list (cadr elt))))
1056 requires))
1057 (vector pkg-name requires docstring version-string readme)))))
1058 1084
1059;;;###autoload 1085;;;###autoload
1060(defun package-install-from-buffer (pkg-info type) 1086(defun package-install-from-buffer (pkg-desc)
1061 "Install a package from the current buffer. 1087 "Install a package from the current buffer.
1062When called interactively, the current buffer is assumed to be a 1088When called interactively, the current buffer is assumed to be a
1063single .el file that follows the packaging guidelines; see info 1089single .el file that follows the packaging guidelines; see info
1064node `(elisp)Packaging'. 1090node `(elisp)Packaging'.
1065 1091
1066When called from Lisp, PKG-INFO is a vector describing the 1092When called from Lisp, PKG-DESC is a `package-desc' describing the
1067information, of the type returned by `package-buffer-info'; and 1093information)."
1068TYPE is the package type (either `single' or `tar')." 1094 (interactive (list (package-buffer-info)))
1069 (interactive (list (package-buffer-info) 'single))
1070 (save-excursion 1095 (save-excursion
1071 (save-restriction 1096 (save-restriction
1072 (let* ((file-name (aref pkg-info 0)) 1097 (let* ((name (package-desc-name pkg-desc))
1073 (requires (aref pkg-info 1)) 1098 (requires (package-desc-reqs pkg-desc))
1074 (desc (if (string= (aref pkg-info 2) "") 1099 (desc (package-desc-summary pkg-desc))
1075 "No description available." 1100 (pkg-version (package-desc-version pkg-desc)))
1076 (aref pkg-info 2)))
1077 (pkg-version (aref pkg-info 3)))
1078 ;; Download and install the dependencies. 1101 ;; Download and install the dependencies.
1079 (let ((transaction (package-compute-transaction nil requires))) 1102 (let ((transaction (package-compute-transaction nil requires)))
1080 (package-download-transaction transaction)) 1103 (package-download-transaction transaction))
1081 ;; Install the package itself. 1104 ;; Install the package itself.
1082 (cond 1105 (pcase (package-desc-kind pkg-desc)
1083 ((eq type 'single) 1106 (`single (package-unpack-single name pkg-version desc requires))
1084 (package-unpack-single file-name pkg-version desc requires)) 1107 (`tar (package-unpack name pkg-version))
1085 ((eq type 'tar) 1108 (type (error "Unknown type: %S" type)))
1086 (package-unpack (intern file-name) pkg-version))
1087 (t
1088 (error "Unknown type: %s" (symbol-name type))))
1089 ;; Try to activate it. 1109 ;; Try to activate it.
1090 (package-initialize))))) 1110 (package-initialize)))))
1091 1111
@@ -1097,10 +1117,10 @@ The file can either be a tar file or an Emacs Lisp file."
1097 (with-temp-buffer 1117 (with-temp-buffer
1098 (insert-file-contents-literally file) 1118 (insert-file-contents-literally file)
1099 (cond 1119 (cond
1100 ((string-match "\\.el$" file) 1120 ((string-match "\\.el\\'" file)
1101 (package-install-from-buffer (package-buffer-info) 'single)) 1121 (package-install-from-buffer (package-buffer-info)))
1102 ((string-match "\\.tar$" file) 1122 ((string-match "\\.tar\\'" file)
1103 (package-install-from-buffer (package-tar-file-info file) 'tar)) 1123 (package-install-from-buffer (package-tar-file-info file)))
1104 (t (error "Unrecognized extension `%s'" (file-name-extension file)))))) 1124 (t (error "Unrecognized extension `%s'" (file-name-extension file))))))
1105 1125
1106(defun package-delete (name version) 1126(defun package-delete (name version)
@@ -1118,7 +1138,7 @@ The file can either be a tar file or an Emacs Lisp file."
1118(defun package-archive-base (name) 1138(defun package-archive-base (name)
1119 "Return the archive containing the package NAME." 1139 "Return the archive containing the package NAME."
1120 (let ((desc (cdr (assq (intern-soft name) package-archive-contents)))) 1140 (let ((desc (cdr (assq (intern-soft name) package-archive-contents))))
1121 (cdr (assoc (aref desc (- (length desc) 1)) package-archives)))) 1141 (cdr (assoc (package-desc-archive desc) package-archives))))
1122 1142
1123(defun package--download-one-archive (archive file) 1143(defun package--download-one-archive (archive file)
1124 "Retrieve an archive file FILE from ARCHIVE, and cache it. 1144 "Retrieve an archive file FILE from ARCHIVE, and cache it.
@@ -1163,7 +1183,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
1163 (package-read-all-archive-contents) 1183 (package-read-all-archive-contents)
1164 (unless no-activate 1184 (unless no-activate
1165 (dolist (elt package-alist) 1185 (dolist (elt package-alist)
1166 (package-activate (car elt) (package-desc-vers (cdr elt))))) 1186 (package-activate (car elt) (package-desc-version (cdr elt)))))
1167 (setq package--initialized t)) 1187 (setq package--initialized t))
1168 1188
1169 1189
@@ -1210,22 +1230,22 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
1210 (cond 1230 (cond
1211 ;; Loaded packages are in `package-alist'. 1231 ;; Loaded packages are in `package-alist'.
1212 ((setq desc (cdr (assq package package-alist))) 1232 ((setq desc (cdr (assq package package-alist)))
1213 (setq version (package-version-join (package-desc-vers desc))) 1233 (setq version (package-version-join (package-desc-version desc)))
1214 (if (setq pkg-dir (package--dir package-name version)) 1234 (if (setq pkg-dir (package--dir package-name version))
1215 (insert "an installed package.\n\n") 1235 (insert "an installed package.\n\n")
1216 ;; This normally does not happen. 1236 ;; This normally does not happen.
1217 (insert "a deleted package.\n\n"))) 1237 (insert "a deleted package.\n\n")))
1218 ;; Available packages are in `package-archive-contents'. 1238 ;; Available packages are in `package-archive-contents'.
1219 ((setq desc (cdr (assq package package-archive-contents))) 1239 ((setq desc (cdr (assq package package-archive-contents)))
1220 (setq version (package-version-join (package-desc-vers desc)) 1240 (setq version (package-version-join (package-desc-version desc))
1221 archive (aref desc (- (length desc) 1)) 1241 archive (package-desc-archive desc)
1222 installable t) 1242 installable t)
1223 (if built-in 1243 (if built-in
1224 (insert "a built-in package.\n\n") 1244 (insert "a built-in package.\n\n")
1225 (insert "an uninstalled package.\n\n"))) 1245 (insert "an uninstalled package.\n\n")))
1226 (built-in 1246 (built-in
1227 (setq desc (cdr built-in) 1247 (setq desc (package--from-builtin built-in)
1228 version (package-version-join (package-desc-vers desc))) 1248 version (package-version-join (package-desc-version desc)))
1229 (insert "a built-in package.\n\n")) 1249 (insert "a built-in package.\n\n"))
1230 (t 1250 (t
1231 (insert "an orphan package.\n\n"))) 1251 (insert "an orphan package.\n\n")))
@@ -1246,7 +1266,8 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
1246 (insert "'."))) 1266 (insert "'.")))
1247 (installable 1267 (installable
1248 (if built-in 1268 (if built-in
1249 (insert (propertize "Built-in." 'font-lock-face 'font-lock-builtin-face) 1269 (insert (propertize "Built-in."
1270 'font-lock-face 'font-lock-builtin-face)
1250 " Alternate version available") 1271 " Alternate version available")
1251 (insert "Available")) 1272 (insert "Available"))
1252 (insert " from " archive) 1273 (insert " from " archive)
@@ -1261,7 +1282,8 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
1261 'package-symbol package 1282 'package-symbol package
1262 'action 'package-install-button-action))) 1283 'action 'package-install-button-action)))
1263 (built-in 1284 (built-in
1264 (insert (propertize "Built-in." 'font-lock-face 'font-lock-builtin-face))) 1285 (insert (propertize "Built-in."
1286 'font-lock-face 'font-lock-builtin-face)))
1265 (t (insert "Deleted."))) 1287 (t (insert "Deleted.")))
1266 (insert "\n") 1288 (insert "\n")
1267 (and version (> (length version) 0) 1289 (and version (> (length version) 0)
@@ -1286,7 +1308,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
1286 (help-insert-xref-button text 'help-package name)) 1308 (help-insert-xref-button text 'help-package name))
1287 (insert "\n"))) 1309 (insert "\n")))
1288 (insert " " (propertize "Summary" 'font-lock-face 'bold) 1310 (insert " " (propertize "Summary" 'font-lock-face 'bold)
1289 ": " (if desc (package-desc-doc desc)) "\n\n") 1311 ": " (if desc (package-desc-summary desc)) "\n\n")
1290 1312
1291 (if built-in 1313 (if built-in
1292 ;; For built-in packages, insert the commentary. 1314 ;; For built-in packages, insert the commentary.
@@ -1418,10 +1440,10 @@ If the alist stored in the symbol LISTNAME lacks an entry for a
1418package PACKAGE with descriptor DESC, add one. The alist is 1440package PACKAGE with descriptor DESC, add one. The alist is
1419keyed with cons cells (PACKAGE . VERSION-LIST), where PACKAGE is 1441keyed with cons cells (PACKAGE . VERSION-LIST), where PACKAGE is
1420a symbol and VERSION-LIST is a version list." 1442a symbol and VERSION-LIST is a version list."
1421 `(let* ((version (package-desc-vers ,desc)) 1443 `(let* ((version (package-desc-version ,desc))
1422 (key (cons ,package version))) 1444 (key (cons ,package version)))
1423 (unless (assoc key ,listname) 1445 (unless (assoc key ,listname)
1424 (push (list key ,status (package-desc-doc ,desc)) ,listname)))) 1446 (push (list key ,status (package-desc-summary ,desc)) ,listname))))
1425 1447
1426(defun package-menu--generate (remember-pos packages) 1448(defun package-menu--generate (remember-pos packages)
1427 "Populate the Package Menu. 1449 "Populate the Package Menu.
@@ -1444,7 +1466,7 @@ or a list of package names (symbols) to display."
1444 (setq name (car elt)) 1466 (setq name (car elt))
1445 (when (and (not (eq name 'emacs)) ; Hide the `emacs' package. 1467 (when (and (not (eq name 'emacs)) ; Hide the `emacs' package.
1446 (or (eq packages t) (memq name packages))) 1468 (or (eq packages t) (memq name packages)))
1447 (package--push name (cdr elt) "built-in" info-list))) 1469 (package--push name (package--from-builtin elt) "built-in" info-list)))
1448 1470
1449 ;; Available and disabled packages: 1471 ;; Available and disabled packages:
1450 (dolist (elt package-archive-contents) 1472 (dolist (elt package-archive-contents)
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 9e338a0f4be..f9d0fd9366b 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -957,7 +957,7 @@ If non-nil, it will blink not only for \"begin..end\" but also for \"if...else\"
957 (let ((ender (funcall smie-backward-token-function))) 957 (let ((ender (funcall smie-backward-token-function)))
958 (cond 958 (cond
959 ((not (and ender (rassoc ender smie-closer-alist))) 959 ((not (and ender (rassoc ender smie-closer-alist)))
960 ;; This not is one of the begin..end we know how to check. 960 ;; This is not one of the begin..end we know how to check.
961 (blink-matching-check-mismatch start end)) 961 (blink-matching-check-mismatch start end))
962 ((not start) t) 962 ((not start) t)
963 ((eq t (car (rassoc ender smie-closer-alist))) nil) 963 ((eq t (car (rassoc ender smie-closer-alist))) nil)
@@ -1012,6 +1012,9 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'.
1012 (or (eq (char-before) last-command-event) 1012 (or (eq (char-before) last-command-event)
1013 (not (memq (char-before) 1013 (not (memq (char-before)
1014 smie-blink-matching-triggers))) 1014 smie-blink-matching-triggers)))
1015 ;; FIXME: For octave's "switch ... case ... case" we flash
1016 ;; `switch' at the end of the first `case' and we burp
1017 ;; "mismatch" at the end of the second `case'.
1015 (or smie-blink-matching-inners 1018 (or smie-blink-matching-inners
1016 (not (numberp (nth 2 (assoc token smie-grammar)))))) 1019 (not (numberp (nth 2 (assoc token smie-grammar))))))
1017 ;; The major mode might set blink-matching-check-function 1020 ;; The major mode might set blink-matching-check-function
@@ -1021,90 +1024,90 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'.
1021 (let ((blink-matching-check-function #'smie-blink-matching-check)) 1024 (let ((blink-matching-check-function #'smie-blink-matching-check))
1022 (blink-matching-open)))))))) 1025 (blink-matching-open))))))))
1023 1026
1024(defface smie-matching-block-highlight '((t (:inherit highlight))) 1027(defvar-local smie--matching-block-data-cache nil)
1025 "Face used to highlight matching block." 1028
1026 :group 'smie) 1029(defun smie--opener/closer-at-point ()
1027 1030 "Return (OPENER TOKEN START END) or nil.
1028(defvar smie--highlight-matching-block-overlay nil) 1031OPENER is non-nil if TOKEN is an opener and nil if it's a closer."
1029(defvar-local smie--highlight-matching-block-lastpos -1) 1032 (let* ((start (point))
1030 1033 ;; Move to a previous position outside of a token.
1031(defun smie-highlight-matching-block () 1034 (_ (funcall smie-backward-token-function))
1032 (when (and smie-closer-alist 1035 ;; Move to the end of the token before point.
1033 (/= (point) smie--highlight-matching-block-lastpos)) 1036 (btok (funcall smie-forward-token-function))
1034 (unless (overlayp smie--highlight-matching-block-overlay) 1037 (bend (point)))
1035 (setq smie--highlight-matching-block-overlay 1038 (cond
1036 (make-overlay (point) (point)))) 1039 ;; Token before point is a closer?
1037 (setq smie--highlight-matching-block-lastpos (point)) 1040 ((and (>= bend start) (rassoc btok smie-closer-alist))
1038 (let ((beg-of-tok 1041 (funcall smie-backward-token-function)
1039 (lambda (&optional start) 1042 (when (< (point) start)
1040 "Move to the beginning of current token at START." 1043 (prog1 (list nil btok (point) bend)
1041 (let* ((token) 1044 (goto-char bend))))
1042 (start (or start (point))) 1045 ;; Token around point is an opener?
1043 (beg (progn 1046 ((and (> bend start) (assoc btok smie-closer-alist))
1047 (funcall smie-backward-token-function)
1048 (when (<= (point) start) (list t btok (point) bend)))
1049 ((<= bend start)
1050 (let ((atok (funcall smie-forward-token-function))
1051 (aend (point)))
1052 (cond
1053 ((< aend start) nil) ;Hopefully shouldn't happen.
1054 ;; Token after point is a closer?
1055 ((assoc atok smie-closer-alist)
1056 (funcall smie-backward-token-function)
1057 (when (<= (point) start)
1058 (list t atok (point) aend)))))))))
1059
1060(defun smie--matching-block-data (orig &rest args)
1061 "A function suitable for `show-paren-data-function' (which see)."
1062 (if (or (null smie-closer-alist)
1063 (eq (point) (car smie--matching-block-data-cache)))
1064 (or (cdr smie--matching-block-data-cache)
1065 (apply orig args))
1066 (setq smie--matching-block-data-cache (list (point)))
1067 (unless (nth 8 (syntax-ppss))
1068 (condition-case nil
1069 (let ((here (smie--opener/closer-at-point)))
1070 (when (and here
1071 (or smie-blink-matching-inners
1072 (not (numberp
1073 (nth (if (nth 0 here) 1 2)
1074 (assoc (nth 1 here) smie-grammar))))))
1075 (let ((there
1076 (cond
1077 ((car here) ; Opener.
1078 (let ((data (smie-forward-sexp 'halfsexp))
1079 (tend (point)))
1080 (unless (car data)
1044 (funcall smie-backward-token-function) 1081 (funcall smie-backward-token-function)
1045 (forward-comment (point-max)) 1082 (list (member (cons (nth 1 here) (nth 2 data))
1046 (point))) 1083 smie-closer-alist)
1047 (end (progn 1084 (point) tend))))
1048 (setq token (funcall smie-forward-token-function)) 1085 (t ;Closer.
1049 (forward-comment (- (point))) 1086 (let ((data (smie-backward-sexp 'halfsexp))
1050 (point)))) 1087 (htok (nth 1 here)))
1051 (if (and (<= beg start) (<= start end) 1088 (if (car data)
1052 (or (assoc token smie-closer-alist) 1089 (let* ((hprec (nth 2 (assoc htok smie-grammar)))
1053 (rassoc token smie-closer-alist))) 1090 (ttok (nth 2 data))
1054 (progn (goto-char beg) token) 1091 (tprec (nth 1 (assoc ttok smie-grammar))))
1055 (goto-char start) 1092 (when (and (numberp hprec) ;Here is an inner.
1056 nil)))) 1093 (eq hprec tprec))
1057 (highlight 1094 (goto-char (nth 1 data))
1058 (lambda (beg end) 1095 (let ((tbeg (point)))
1059 (move-overlay smie--highlight-matching-block-overlay 1096 (funcall smie-forward-token-function)
1060 beg end (current-buffer)) 1097 (list t tbeg (point)))))
1061 (overlay-put smie--highlight-matching-block-overlay 1098 (let ((tbeg (point)))
1062 'face 'smie-matching-block-highlight)))) 1099 (funcall smie-forward-token-function)
1063 (save-excursion 1100 (list (member (cons (nth 2 data) htok)
1064 (condition-case nil 1101 smie-closer-alist)
1065 (if (nth 8 (syntax-ppss)) 1102 tbeg (point)))))))))
1066 (overlay-put smie--highlight-matching-block-overlay 'face nil) 1103 ;; Update the cache.
1067 (let ((token 1104 (setcdr smie--matching-block-data-cache
1068 (or (funcall beg-of-tok) 1105 (list (nth 2 here) (nth 3 here)
1069 (funcall beg-of-tok 1106 (nth 1 there) (nth 2 there)
1070 (prog1 (point) 1107 (not (nth 0 there)))))))
1071 (funcall smie-forward-token-function)))))) 1108 (scan-error nil))
1072 (cond 1109 (goto-char (car smie--matching-block-data-cache)))
1073 ((assoc token smie-closer-alist) ; opener 1110 (apply #'smie--matching-block-data orig args)))
1074 (forward-sexp 1)
1075 (let ((end (point))
1076 (closer (funcall smie-backward-token-function)))
1077 (when (rassoc closer smie-closer-alist)
1078 (funcall highlight (point) end))))
1079 ((rassoc token smie-closer-alist) ; closer
1080 (funcall smie-forward-token-function)
1081 (forward-sexp -1)
1082 (let ((beg (point))
1083 (opener (funcall smie-forward-token-function)))
1084 (when (assoc opener smie-closer-alist)
1085 (funcall highlight beg (point)))))
1086 (t (overlay-put smie--highlight-matching-block-overlay
1087 'face nil)))))
1088 (scan-error
1089 (overlay-put smie--highlight-matching-block-overlay 'face nil)))))))
1090
1091(defvar smie--highlight-matching-block-timer nil)
1092
1093;;;###autoload
1094(define-minor-mode smie-highlight-matching-block-mode nil
1095 :global t :group 'smie
1096 (when (timerp smie--highlight-matching-block-timer)
1097 (cancel-timer smie--highlight-matching-block-timer))
1098 (setq smie--highlight-matching-block-timer nil)
1099 (if smie-highlight-matching-block-mode
1100 (progn
1101 (remove-hook 'post-self-insert-hook #'smie-blink-matching-open 'local)
1102 (setq smie--highlight-matching-block-timer
1103 (run-with-idle-timer 0.2 t #'smie-highlight-matching-block)))
1104 (when smie--highlight-matching-block-overlay
1105 (delete-overlay smie--highlight-matching-block-overlay)
1106 (setq smie--highlight-matching-block-overlay nil))
1107 (kill-local-variable 'smie--highlight-matching-block-lastpos)))
1108 1111
1109;;; The indentation engine. 1112;;; The indentation engine.
1110 1113
@@ -1802,9 +1805,10 @@ KEYWORDS are additional arguments, which can use the following keywords:
1802 (setq-local smie-closer-alist ca) 1805 (setq-local smie-closer-alist ca)
1803 ;; Only needed for interactive calls to blink-matching-open. 1806 ;; Only needed for interactive calls to blink-matching-open.
1804 (setq-local blink-matching-check-function #'smie-blink-matching-check) 1807 (setq-local blink-matching-check-function #'smie-blink-matching-check)
1805 (unless smie-highlight-matching-block-mode 1808 (add-hook 'post-self-insert-hook
1806 (add-hook 'post-self-insert-hook 1809 #'smie-blink-matching-open 'append 'local)
1807 #'smie-blink-matching-open 'append 'local)) 1810 (add-function :around (local 'show-paren-data-function)
1811 #'smie--matching-block-data)
1808 ;; Setup smie-blink-matching-triggers. Rather than wait for SPC to 1812 ;; Setup smie-blink-matching-triggers. Rather than wait for SPC to
1809 ;; blink, try to blink as soon as we type the last char of a block ender. 1813 ;; blink, try to blink as soon as we type the last char of a block ender.
1810 (let ((closers (sort (mapcar #'cdr smie-closer-alist) #'string-lessp)) 1814 (let ((closers (sort (mapcar #'cdr smie-closer-alist) #'string-lessp))
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 0a4758a9ccd..3e850320133 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -56,12 +56,13 @@
56 ;; syntax-ppss-flush-cache since that would not only flush the cache but also 56 ;; syntax-ppss-flush-cache since that would not only flush the cache but also
57 ;; reset syntax-propertize--done which should not be done in this case). 57 ;; reset syntax-propertize--done which should not be done in this case).
58 "Mode-specific function to apply `syntax-table' text properties. 58 "Mode-specific function to apply `syntax-table' text properties.
59The value of this variable is a function to be called by Font 59It is the work horse of `syntax-propertize', which is called by things like
60Lock mode, prior to performing syntactic fontification on a 60Font-Lock and indentation.
61stretch of text. It is given two arguments, START and END: the 61
62start and end of the text to be fontified. Major modes can 62It is given two arguments, START and END: the start and end of the text to
63specify a custom function to apply `syntax-table' properties to 63which `syntax-table' might need to be applied. Major modes can use this to
64override the default syntax table in special cases. 64override the buffer's syntax table for special syntactic constructs that
65cannot be handled just by the buffer's syntax-table.
65 66
66The specified function may call `syntax-ppss' on any position 67The specified function may call `syntax-ppss' on any position
67before END, but it should not call `syntax-ppss-flush-cache', 68before END, but it should not call `syntax-ppss-flush-cache',
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 42643bf2317..f605c2865c0 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -262,7 +262,17 @@ be printed along with the arguments in the trace."
262 262
263(defun trace--read-args (prompt) 263(defun trace--read-args (prompt)
264 (cons 264 (cons
265 (intern (completing-read prompt obarray 'fboundp t)) 265 (let ((default (function-called-at-point))
266 (beg (string-match ":[ \t]*\\'" prompt)))
267 (intern (completing-read (if default
268 (format
269 "%s (default %s)%s"
270 (substring prompt 0 beg)
271 default
272 (if beg (substring prompt beg) ": "))
273 prompt)
274 obarray 'fboundp t nil nil
275 (if default (symbol-name default)))))
266 (when current-prefix-arg 276 (when current-prefix-arg
267 (list 277 (list
268 (read-buffer "Output to buffer: " trace-buffer) 278 (read-buffer "Output to buffer: " trace-buffer)
diff --git a/lisp/emulation/cua-gmrk.el b/lisp/emulation/cua-gmrk.el
index d2901bb966c..78665624946 100644
--- a/lisp/emulation/cua-gmrk.el
+++ b/lisp/emulation/cua-gmrk.el
@@ -25,10 +25,8 @@
25 25
26;;; Code: 26;;; Code:
27 27
28(eval-when-compile 28(require 'cua-base)
29 (require 'cua-base) 29(require 'cua-rect)
30 (require 'cua-rect)
31 )
32 30
33;;; Global Marker 31;;; Global Marker
34 32
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 220469b1ed9..16d109c6360 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -31,8 +31,7 @@
31 31
32;;; Code: 32;;; Code:
33 33
34(eval-when-compile 34(require 'cua-base)
35 (require 'cua-base))
36 35
37;;; Rectangle support 36;;; Rectangle support
38 37
diff --git a/lisp/epa.el b/lisp/epa.el
index b567df5f40b..14f8879c1c6 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -620,21 +620,24 @@ If SECRET is non-nil, list secret keys instead of public keys."
620 (floor (* (/ current (float total)) 100)))) 620 (floor (* (/ current (float total)) 100))))
621 (message "%s..." prompt)))) 621 (message "%s..." prompt))))
622 622
623(defun epa-read-file-name (input)
624 "Interactively read an output file name based on INPUT file name."
625 (setq input (file-name-sans-extension (expand-file-name input)))
626 (expand-file-name
627 (read-file-name
628 (concat "To file (default " (file-name-nondirectory input) ") ")
629 (file-name-directory input)
630 input)))
631
623;;;###autoload 632;;;###autoload
624(defun epa-decrypt-file (decrypt-file plain-file) 633(defun epa-decrypt-file (decrypt-file &optional plain-file)
625 "Decrypt DECRYPT-FILE into PLAIN-FILE." 634 "Decrypt DECRYPT-FILE into PLAIN-FILE.
635If you do not specify PLAIN-FILE, this functions prompts for the value to use."
626 (interactive 636 (interactive
627 (let (file default-name plain) 637 (let* ((file (read-file-name "File to decrypt: "))
628 (setq file (read-file-name "File to decrypt: ")) 638 (plain (epa-read-file-name file)))
629 (setq default-name (file-name-sans-extension (expand-file-name file)))
630 (setq plain (expand-file-name
631 (read-file-name
632 (concat "To file (default "
633 (file-name-nondirectory default-name)
634 ") ")
635 (file-name-directory default-name)
636 default-name)))
637 (list file plain))) 639 (list file plain)))
640 (or plain-file (setq plain-file (epa-read-file-name decrypt-file)))
638 (setq decrypt-file (expand-file-name decrypt-file)) 641 (setq decrypt-file (expand-file-name decrypt-file))
639 (let ((context (epg-make-context epa-protocol))) 642 (let ((context (epg-make-context epa-protocol)))
640 (epg-context-set-passphrase-callback context 643 (epg-context-set-passphrase-callback context
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 4f5be776b09..76766144c18 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
12013-05-30 Glenn Morris <rgm@gnu.org>
2
3 * erc-backend.el: Require erc at run-time too.
4
12013-05-21 Glenn Morris <rgm@gnu.org> 52013-05-21 Glenn Morris <rgm@gnu.org>
2 6
3 * erc-log.el (erc-network-name): Declare. 7 * erc-log.el (erc-network-name): Declare.
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 3d3ac791f08..4200d4aff7f 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -102,7 +102,8 @@
102;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. 102;; There's a fairly strong mutual dependency between erc.el and erc-backend.el.
103;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the 103;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the
104;; reverse is true: 104;; reverse is true:
105(eval-when-compile (provide 'erc-backend) (require 'erc)) 105(provide 'erc-backend)
106(require 'erc)
106 107
107;;;; Variables and options 108;;;; Variables and options
108 109
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index 426db3232ed..7120f639a70 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -243,6 +243,12 @@ to writing a completion function."
243 243
244;;; Functions: 244;;; Functions:
245 245
246(defun eshell-complete-lisp-symbol ()
247 "Try to complete the text around point as a Lisp symbol."
248 (interactive)
249 (let ((completion-at-point-functions '(lisp-completion-at-point)))
250 (completion-at-point)))
251
246(defun eshell-cmpl-initialize () 252(defun eshell-cmpl-initialize ()
247 "Initialize the completions module." 253 "Initialize the completions module."
248 (set (make-local-variable 'pcomplete-command-completion-function) 254 (set (make-local-variable 'pcomplete-command-completion-function)
@@ -279,17 +285,17 @@ to writing a completion function."
279 eshell-cmpl-restore-window-delay) 285 eshell-cmpl-restore-window-delay)
280 (set (make-local-variable 'pcomplete-use-paring) 286 (set (make-local-variable 'pcomplete-use-paring)
281 eshell-cmpl-use-paring) 287 eshell-cmpl-use-paring)
282 ;; `pcomplete-arg-quote-list' should only be set after all the 288 ;; `comint-file-name-quote-list' should only be set after all the
283 ;; load-hooks for any other extension modules have been run, which 289 ;; load-hooks for any other extension modules have been run, which
284 ;; is true at the time `eshell-mode-hook' is run 290 ;; is true at the time `eshell-mode-hook' is run
285 (add-hook 'eshell-mode-hook 291 (add-hook 'eshell-mode-hook
286 (function 292 (function
287 (lambda () 293 (lambda ()
288 (set (make-local-variable 'pcomplete-arg-quote-list) 294 (set (make-local-variable 'comint-file-name-quote-list)
289 eshell-special-chars-outside-quoting))) nil t) 295 eshell-special-chars-outside-quoting))) nil t)
290 (add-hook 'pcomplete-quote-arg-hook 'eshell-quote-backslash nil t) 296 (add-hook 'pcomplete-quote-arg-hook 'eshell-quote-backslash nil t)
291 (define-key eshell-mode-map [(meta tab)] 'lisp-complete-symbol) 297 (define-key eshell-mode-map [(meta tab)] 'eshell-complete-lisp-symbol)
292 (define-key eshell-mode-map [(meta control ?i)] 'lisp-complete-symbol) 298 (define-key eshell-mode-map [(meta control ?i)] 'eshell-complete-lisp-symbol)
293 (define-key eshell-command-map [(meta ?h)] 'eshell-completion-help) 299 (define-key eshell-command-map [(meta ?h)] 'eshell-completion-help)
294 (define-key eshell-command-map [tab] 'pcomplete-expand-and-complete) 300 (define-key eshell-command-map [tab] 'pcomplete-expand-and-complete)
295 (define-key eshell-command-map [(control ?i)] 301 (define-key eshell-command-map [(control ?i)]
@@ -347,7 +353,7 @@ to writing a completion function."
347 (setq begin (1+ (cadr delim)) 353 (setq begin (1+ (cadr delim))
348 args (eshell-parse-arguments begin end))) 354 args (eshell-parse-arguments begin end)))
349 ((eq (car delim) ?\() 355 ((eq (car delim) ?\()
350 (lisp-complete-symbol) 356 (eshell-complete-lisp-symbol)
351 (throw 'pcompleted t)) 357 (throw 'pcompleted t))
352 (t 358 (t
353 (insert-and-inherit "\t") 359 (insert-and-inherit "\t")
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index c93bbe9ecb1..e8fbe0518ac 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -207,7 +207,8 @@ Thus, this does not include the current directory.")
207 (when eshell-cd-on-directory 207 (when eshell-cd-on-directory
208 (make-local-variable 'eshell-interpreter-alist) 208 (make-local-variable 'eshell-interpreter-alist)
209 (setq eshell-interpreter-alist 209 (setq eshell-interpreter-alist
210 (cons (cons 'eshell-lone-directory-p 210 (cons (cons #'(lambda (file args)
211 (eshell-lone-directory-p file))
211 'eshell-dirs-substitute-cd) 212 'eshell-dirs-substitute-cd)
212 eshell-interpreter-alist))) 213 eshell-interpreter-alist)))
213 214
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index 711b2e21468..b073928738f 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -61,9 +61,10 @@ This includes when running `eshell-command'."
61 "Initialize the script parsing code." 61 "Initialize the script parsing code."
62 (make-local-variable 'eshell-interpreter-alist) 62 (make-local-variable 'eshell-interpreter-alist)
63 (setq eshell-interpreter-alist 63 (setq eshell-interpreter-alist
64 (cons '((lambda (file) 64 (cons (cons #'(lambda (file args)
65 (string= (file-name-nondirectory file) 65 (string= (file-name-nondirectory file)
66 "eshell")) . eshell/source) 66 "eshell"))
67 'eshell/source)
67 eshell-interpreter-alist)) 68 eshell-interpreter-alist))
68 (make-local-variable 'eshell-complex-commands) 69 (make-local-variable 'eshell-complex-commands)
69 (setq eshell-complex-commands 70 (setq eshell-complex-commands
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index e5360f2deb4..2932f443e4f 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -31,6 +31,7 @@
31 31
32;;; Code: 32;;; Code:
33 33
34(require 'cl-lib)
34(require 'esh-util) 35(require 'esh-util)
35(require 'esh-ext) 36(require 'esh-ext)
36(eval-when-compile (require 'eshell)) 37(eval-when-compile (require 'eshell))
@@ -61,10 +62,57 @@ which commands are considered visual in nature."
61 "less" "more" ; M-x view-file 62 "less" "more" ; M-x view-file
62 "lynx" "ncftp" ; w3.el, ange-ftp 63 "lynx" "ncftp" ; w3.el, ange-ftp
63 "pine" "tin" "trn" "elm") ; GNUS!! 64 "pine" "tin" "trn" "elm") ; GNUS!!
64 "A list of commands that present their output in a visual fashion." 65 "A list of commands that present their output in a visual fashion.
66
67Commands listed here are run in a term buffer.
68
69See also `eshell-visual-subcommands' and `eshell-visual-options'."
65 :type '(repeat string) 70 :type '(repeat string)
66 :group 'eshell-term) 71 :group 'eshell-term)
67 72
73(defcustom eshell-visual-subcommands
74 nil
75 "An alist of subcommands that present their output in a visual fashion.
76
77An alist of the form
78
79 ((COMMAND1 SUBCOMMAND1 SUBCOMMAND2...)
80 (COMMAND2 SUBCOMMAND1 ...))
81
82of commands with subcommands that present their output in a
83visual fashion. A likely entry is
84
85 (\"git\" \"log\" \"diff\" \"show\")
86
87because git shows logs and diffs using a pager by default.
88
89See also `eshell-visual-commands' and `eshell-visual-options'."
90 :type '(repeat (cons (string :tag "Command")
91 (repeat (string :tag "Subcommand"))))
92 :version "24.4"
93 :group 'eshell-term)
94
95(defcustom eshell-visual-options
96 nil
97 "An alist of the form
98
99 ((COMMAND1 OPTION1 OPTION2...)
100 (COMMAND2 OPTION1 ...))
101
102of commands with options that present their output in a visual
103fashion. For example, a sensible entry would be
104
105 (\"git\" \"--help\")
106
107because \"git <command> --help\" shows the command's
108documentation with a pager.
109
110See also `eshell-visual-commands' and `eshell-visual-subcommands'."
111 :type '(repeat (cons (string :tag "Command")
112 (repeat (string :tag "Option"))))
113 :version "24.4"
114 :group 'eshell-term)
115
68;; If you change this from term-term-name, you need to ensure that the 116;; If you change this from term-term-name, you need to ensure that the
69;; value you choose exists in the system's terminfo database. (Bug#12485) 117;; value you choose exists in the system's terminfo database. (Bug#12485)
70(defcustom eshell-term-name term-term-name 118(defcustom eshell-term-name term-term-name
@@ -77,8 +125,10 @@ used."
77 125
78(defcustom eshell-escape-control-x t 126(defcustom eshell-escape-control-x t
79 "If non-nil, allow <C-x> to be handled by Emacs key in visual buffers. 127 "If non-nil, allow <C-x> to be handled by Emacs key in visual buffers.
80See the variable `eshell-visual-commands'. If this variable is set to 128See the variables `eshell-visual-commands',
81nil, <C-x> will send that control character to the invoked process." 129`eshell-visual-subcommands', and `eshell-visual-options'. If
130this variable is set to nil, <C-x> will send that control
131character to the invoked process."
82 :type 'boolean 132 :type 'boolean
83 :group 'eshell-term) 133 :group 'eshell-term)
84 134
@@ -92,19 +142,29 @@ nil, <C-x> will send that control character to the invoked process."
92 "Initialize the `term' interface code." 142 "Initialize the `term' interface code."
93 (make-local-variable 'eshell-interpreter-alist) 143 (make-local-variable 'eshell-interpreter-alist)
94 (setq eshell-interpreter-alist 144 (setq eshell-interpreter-alist
95 (cons (cons (function 145 (cons (cons #'eshell-visual-command-p
96 (lambda (command)
97 (member (file-name-nondirectory command)
98 eshell-visual-commands)))
99 'eshell-exec-visual) 146 'eshell-exec-visual)
100 eshell-interpreter-alist))) 147 eshell-interpreter-alist)))
101 148
149(defun eshell-visual-command-p (command args)
150 "Returns non-nil when given a visual command.
151If either COMMAND or a subcommand in ARGS (e.g. git log) is a
152visual command, returns non-nil."
153 (let ((command (file-name-nondirectory command)))
154 (and (eshell-interactive-output-p)
155 (or (member command eshell-visual-commands)
156 (member (car args)
157 (cdr (assoc command eshell-visual-subcommands)))
158 (cl-intersection args
159 (cdr (assoc command eshell-visual-options))
160 :test 'string=)))))
161
102(defun eshell-exec-visual (&rest args) 162(defun eshell-exec-visual (&rest args)
103 "Run the specified PROGRAM in a terminal emulation buffer. 163 "Run the specified PROGRAM in a terminal emulation buffer.
104ARGS are passed to the program. At the moment, no piping of input is 164ARGS are passed to the program. At the moment, no piping of input is
105allowed." 165allowed."
106 (let* (eshell-interpreter-alist 166 (let* (eshell-interpreter-alist
107 (interp (eshell-find-interpreter (car args))) 167 (interp (eshell-find-interpreter (car args) (cdr args)))
108 (program (car interp)) 168 (program (car interp))
109 (args (eshell-flatten-list 169 (args (eshell-flatten-list
110 (eshell-stringify-list (append (cdr interp) 170 (eshell-stringify-list (append (cdr interp)
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index c4e4c000bda..474e536de2e 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -125,9 +125,10 @@ Each member is a cons cell of the form:
125 125
126 (MATCH . INTERPRETER) 126 (MATCH . INTERPRETER)
127 127
128MATCH should be a regexp, which is matched against the command name, 128MATCH should be a regexp, which is matched against the command
129or a function. If either returns a non-nil value, then INTERPRETER 129name, or a function of arity 2 receiving the COMMAND and its
130will be used for that command. 130ARGS (a list). If either returns a non-nil value, then
131INTERPRETER will be used for that command.
131 132
132If INTERPRETER is a string, it will be called as the command name, 133If INTERPRETER is a string, it will be called as the command name,
133with the original command name passed as the first argument, with all 134with the original command name passed as the first argument, with all
@@ -215,6 +216,7 @@ causing the user to wonder if anything's really going on..."
215 (setq args (eshell-stringify-list (eshell-flatten-list args))) 216 (setq args (eshell-stringify-list (eshell-flatten-list args)))
216 (let ((interp (eshell-find-interpreter 217 (let ((interp (eshell-find-interpreter
217 command 218 command
219 args
218 ;; `eshell-find-interpreter' does not work correctly 220 ;; `eshell-find-interpreter' does not work correctly
219 ;; for Tramp file name syntax. But we don't need to 221 ;; for Tramp file name syntax. But we don't need to
220 ;; know the interpreter in that case, therefore the 222 ;; know the interpreter in that case, therefore the
@@ -267,7 +269,7 @@ Return nil, or a list of the form:
267 (list (match-string 1) 269 (list (match-string 1)
268 file))))))) 270 file)))))))
269 271
270(defun eshell-find-interpreter (file &optional no-examine-p) 272(defun eshell-find-interpreter (file args &optional no-examine-p)
271 "Find the command interpreter with which to execute FILE. 273 "Find the command interpreter with which to execute FILE.
272If NO-EXAMINE-P is non-nil, FILE will not be inspected for a script 274If NO-EXAMINE-P is non-nil, FILE will not be inspected for a script
273line of the form #!<interp>." 275line of the form #!<interp>."
@@ -277,8 +279,9 @@ line of the form #!<interp>."
277 (dolist (possible eshell-interpreter-alist) 279 (dolist (possible eshell-interpreter-alist)
278 (cond 280 (cond
279 ((functionp (car possible)) 281 ((functionp (car possible))
280 (and (funcall (car possible) file) 282 (let ((fn (car possible)))
281 (throw 'found (cdr possible)))) 283 (and (funcall fn file args)
284 (throw 'found (cdr possible)))))
282 ((stringp (car possible)) 285 ((stringp (car possible))
283 (and (string-match (car possible) file) 286 (and (string-match (car possible) file)
284 (throw 'found (cdr possible)))) 287 (throw 'found (cdr possible))))
@@ -312,7 +315,7 @@ line of the form #!<interp>."
312 (setq interp (eshell-script-interpreter fullname)) 315 (setq interp (eshell-script-interpreter fullname))
313 (if interp 316 (if interp
314 (setq interp 317 (setq interp
315 (cons (car (eshell-find-interpreter (car interp) t)) 318 (cons (car (eshell-find-interpreter (car interp) args t))
316 (cdr interp))))) 319 (cdr interp)))))
317 (or interp (list fullname))))))) 320 (or interp (list fullname)))))))
318 321
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index ee857cf20f3..5346bd16fd2 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -326,11 +326,8 @@ and the hook `eshell-exit-hook'."
326 (if mode-line-elt 326 (if mode-line-elt
327 (setcar mode-line-elt 'eshell-command-running-string)))) 327 (setcar mode-line-elt 'eshell-command-running-string))))
328 328
329 (define-key eshell-mode-map [return] 'eshell-send-input) 329 (define-key eshell-mode-map "\r" 'eshell-send-input)
330 (define-key eshell-mode-map [(control ?m)] 'eshell-send-input) 330 (define-key eshell-mode-map "\M-\r" 'eshell-queue-input)
331 (define-key eshell-mode-map [(control ?j)] 'eshell-send-input)
332 (define-key eshell-mode-map [(meta return)] 'eshell-queue-input)
333 (define-key eshell-mode-map [(meta control ?m)] 'eshell-queue-input)
334 (define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output) 331 (define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output)
335 (define-key eshell-mode-map [(control ?a)] 'eshell-bol) 332 (define-key eshell-mode-map [(control ?a)] 'eshell-bol)
336 333
diff --git a/lisp/finder.el b/lisp/finder.el
index 3d988b41bde..f6593c554eb 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -206,7 +206,8 @@ from; the default is `load-path'."
206 (setq version (ignore-errors (version-to-list version))) 206 (setq version (ignore-errors (version-to-list version)))
207 (setq entry (assq package package--builtins)) 207 (setq entry (assq package package--builtins))
208 (cond ((null entry) 208 (cond ((null entry)
209 (push (cons package (vector version nil summary)) 209 (push (cons package
210 (package-make-builtin version summary))
210 package--builtins)) 211 package--builtins))
211 ((eq base-name package) 212 ((eq base-name package)
212 (setq desc (cdr entry)) 213 (setq desc (cdr entry))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index d18aea61236..8f4363b0bdf 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2328,7 +2328,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
2328 (1 font-lock-keyword-face) 2328 (1 font-lock-keyword-face)
2329 (2 font-lock-constant-face nil t)) 2329 (2 font-lock-constant-face nil t))
2330 ;; Erroneous structures. 2330 ;; Erroneous structures.
2331 ("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\_>" 1 font-lock-warning-face) 2331 ("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|\\(?:user-\\)?error\\|signal\\)\\_>" 1 font-lock-warning-face)
2332 ;; Words inside \\[] tend to be for `substitute-command-keys'. 2332 ;; Words inside \\[] tend to be for `substitute-command-keys'.
2333 ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]" 2333 ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]"
2334 (1 font-lock-constant-face prepend)) 2334 (1 font-lock-constant-face prepend))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index d475a259113..ac5cdfafca2 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,136 @@
12013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * eww.el (eww-convert-widgets): Make widgets from non-tabular layouts
4 work, too.
5 (eww-tag-select): Implement <select>.
6
72013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de>
8
9 * sieve-manage.el (sieve-manage-open): work with STARTTLS: shorten
10 stream managing functions by using open-protocol-stream to do most of
11 the work. Has the nice benefit of enabling STARTTLS.
12 Wait for capabilities after STARTTLS: following RFC5804, the server
13 sends new capabilities after successfully establishing a TLS connection
14 with the client. The client should update the cached list of
15 capabilities, but we just ignore the answer for now.
16 (sieve-manage-network-p, sieve-manage-network-open)
17 (sieve-manage-starttls-p, sieve-manage-starttls-open)
18 (sieve-manage-forward, sieve-manage-streams)
19 (sieve-manage-stream-alist): Remove unneeded functions neither in the
20 API, nor called by any other function.
21 Enable Multibyte for SieveManage buffers: The parser won't properly
22 handle umlauts and line endings unless multibyte is turned on in the
23 process buffer.
24
252013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
26
27 * eww.el (eww-tag-input): Support password fields.
28 (eww-submit): Support POST.
29
302013-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
31
32 * eww.el (eww-tag-form): Protect against degenerate forms.
33
34 * shr.el (shr-expand-url): Expand URLs that start with a slash
35 correctly.
36
37 * eww.el (eww-submit): Get submit button logic right.
38
39 * shr.el (shr-final-table-render): New variable to signal when we're
40 doing the final table rendering so that we can collect more data at
41 that point.
42
43 * eww.el (eww-submit): Make form submission work.
44 (eww-tag-input): Implement submit buttons.
45 (eww-click-radio): Implement radio and checkboxes.
46 (eww-submit): Handle hidden elements.
47
48 * shr.el (shr-descend): Allow other packages to override (or provide)
49 rendering of elements.
50 (shr-expand-url): Strip query strings from URLs before expanding them.
51
52 * eww.el: Don't require cl-lib.
53 (eww-tag-form): Start form support.
54
55 * eww.el: Start writing a new, tiny web browser.
56 (eww-previous-url): New command.
57 (eww-quit): New command.
58
592013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de>
60
61 * sieve.el: Put point at beginning of buffer when viewing a script.
62 (sieve-open-server): respect the PORT parameter. Show the correct port
63 number in sieve-buffer's header. Fixed code to also work with a string
64 as port specifier. Properly close the connection on pressing 'q'. Make
65 sieve-manage-quit close the connection and process buffer. Also, remove
66 duplicate keybinding for 'q'.
67
682013-06-10 Roy Hashimoto <roy.hashimoto@gmail.com> (tiny change)
69
70 * mm-view.el (mm-pkcs7-signed-magic): Allow newline in the regexp and
71 make it easier to read.
72 (mm-pkcs7-enveloped-magic): Ditto.
73
742013-06-06 Teodor Zlatanov <tzz@lifelogs.com>
75
76 * gnus-ems.el (gnus-image-type-available-p): Test `display-images-p'
77 before `image-type-available-p' to avoid loading the image libraries
78 needlessly.
79
802013-06-04 Katsumi Yamaoka <yamaoka@jpl.org>
81
82 * gnus-art.el (article-date-ut, article-update-date-lapsed): Don't
83 assume Date header begins with "Date", that may be customized into
84 something like "X-Sent" using gnus-article-time-format.
85 (article-transform-date): Allow multi-line Date header.
86
872013-06-02 David Engster <deng@randomsample.de>
88
89 * registry.el (initialize-instance, registry-lookup)
90 (registry-lookup-breaks-before-lexbind, registry-lookup-secondary)
91 (registry-lookup-secondary-value, registry-search, registry-delete)
92 (registry-insert, registry-reindex, registry-size, registry-prune): Do
93 not wrap methods in `eval-and-compile'. This breaks due to latest
94 changes in EIEIO (introduction of eieio-core.el).
95
962013-05-30 Glenn Morris <rgm@gnu.org>
97
98 * nnmail.el (nnmail-fancy-expiry-target):
99 Also bind mail-dont-reply-to-names.
100
101 * spam-stat.el (spam-stat-save):
102 No need to tweak font-lock in temp buffers.
103
104 * shr.el (shr-put-image): Silence compiler.
105
1062013-05-29 Glenn Morris <rgm@gnu.org>
107
108 * gnus-ems.el (set-process-plist): Every supported Emacs has this.
109
110 * gnus-group.el (gnus-sequence-of-unread-articles)
111 (gnus-summary-add-mark, gnus-mark-article-as-read)
112 (gnus-group-make-articles-read): Declare.
113
114 * gnus-sum.el (gnus-parameter-list-identifier)
115 (gnus-article-stop-animations, gnus-stop-downloads)
116 (gnus-article-only-boring-p, article-goto-body)
117 (gnus-flush-original-article-buffer, article-narrow-to-head)
118 (gnus-article-hidden-text-p, gnus-delete-wash-type)
119 (gnus-summary-save-in-pipe, gnus-article-show-summary): Declare.
120
121 * gnus.el: No need to eval-and-compile autoloads.
122
123 * gravatar.el (help-function-arglist): Autoload.
124
125 * nnimap.el (gnus-refer-thread-use-nnir): Declare.
126
127 * nnmail.el (nnmail-fancy-expiry-target): Maybe use mail-dont-reply-to.
128
129 * spam.el: No need to load spam-report when compiling.
130 No need to eval-and-compile autoloads.
131 (spam-report-resend-to): Declare.
132 (spam-report-resend-register-routine): Require 'spam-report.
133
12013-05-24 Julien Danjou <julien@danjou.info> 1342013-05-24 Julien Danjou <julien@danjou.info>
2 135
3 * sieve.el (sieve-setup-buffer): Fix default port value in sieve buffer 136 * sieve.el (sieve-setup-buffer): Fix default port value in sieve buffer
diff --git a/lisp/gnus/eww.el b/lisp/gnus/eww.el
new file mode 100644
index 00000000000..3e799732ecb
--- /dev/null
+++ b/lisp/gnus/eww.el
@@ -0,0 +1,349 @@
1;;; eww.el --- Emacs Web Wowser
2
3;; Copyright (C) 2013 Free Software Foundation, Inc.
4
5;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6;; Keywords: html
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;;; Code:
26
27(eval-when-compile (require 'cl))
28(require 'shr)
29(require 'url)
30(require 'mm-url)
31
32(defvar eww-current-url nil)
33(defvar eww-history nil)
34
35;;;###autoload
36(defun eww (url)
37 "Fetch URL and render the page."
38 (interactive "sUrl: ")
39 (url-retrieve url 'eww-render (list url)))
40
41(defun eww-render (status url &optional point)
42 (let* ((headers (eww-parse-headers))
43 (content-type
44 (mail-header-parse-content-type
45 (or (cdr (assoc "content-type" headers))
46 "text/plain")))
47 (charset (intern
48 (downcase
49 (or (cdr (assq 'charset (cdr content-type)))
50 "utf8"))))
51 (data-buffer (current-buffer)))
52 (unwind-protect
53 (progn
54 (cond
55 ((equal (car content-type) "text/html")
56 (eww-display-html charset url))
57 ((string-match "^image/" (car content-type))
58 (eww-display-image))
59 (t
60 (eww-display-raw charset)))
61 (when point
62 (goto-char point)))
63 (kill-buffer data-buffer))))
64
65(defun eww-parse-headers ()
66 (let ((headers nil))
67 (while (and (not (eobp))
68 (not (eolp)))
69 (when (looking-at "\\([^:]+\\): *\\(.*\\)")
70 (push (cons (downcase (match-string 1))
71 (match-string 2))
72 headers))
73 (forward-line 1))
74 (unless (eobp)
75 (forward-line 1))
76 headers))
77
78(defun eww-display-html (charset url)
79 (unless (eq charset 'utf8)
80 (decode-coding-region (point) (point-max) charset))
81 (let ((document
82 (list
83 'base (list (cons 'href url))
84 (libxml-parse-html-region (point) (point-max)))))
85 (eww-setup-buffer)
86 (setq eww-current-url url)
87 (let ((inhibit-read-only t)
88 (shr-external-rendering-functions
89 '((form . eww-tag-form)
90 (input . eww-tag-input)
91 (select . eww-tag-select))))
92 (shr-insert-document document)
93 (eww-convert-widgets))
94 (goto-char (point-min))))
95
96(defun eww-display-raw (charset)
97 (let ((data (buffer-substring (point) (point-max))))
98 (eww-setup-buffer)
99 (let ((inhibit-read-only t))
100 (insert data))
101 (goto-char (point-min))))
102
103(defun eww-display-image ()
104 (let ((data (buffer-substring (point) (point-max))))
105 (eww-setup-buffer)
106 (let ((inhibit-read-only t))
107 (shr-put-image data nil))
108 (goto-char (point-min))))
109
110(defun eww-setup-buffer ()
111 (pop-to-buffer (get-buffer-create "*eww*"))
112 (remove-overlays)
113 (setq widget-field-list nil)
114 (let ((inhibit-read-only t))
115 (erase-buffer))
116 (eww-mode))
117
118(defvar eww-mode-map
119 (let ((map (make-sparse-keymap)))
120 (suppress-keymap map)
121 (define-key map "q" 'eww-quit)
122 (define-key map "g" 'eww-reload)
123 (define-key map [tab] 'widget-forward)
124 (define-key map [backtab] 'widget-backward)
125 (define-key map [delete] 'scroll-down-command)
126 (define-key map "\177" 'scroll-down-command)
127 (define-key map " " 'scroll-up-command)
128 (define-key map "p" 'eww-previous-url)
129 ;;(define-key map "n" 'eww-next-url)
130 map))
131
132(defun eww-mode ()
133 "Mode for browsing the web.
134
135\\{eww-mode-map}"
136 (interactive)
137 (setq major-mode 'eww-mode
138 mode-name "eww")
139 (set (make-local-variable 'eww-current-url) 'author)
140 (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)
141 ;;(setq buffer-read-only t)
142 (use-local-map eww-mode-map))
143
144(defun eww-browse-url (url &optional new-window)
145 (push (list eww-current-url (point))
146 eww-history)
147 (eww url))
148
149(defun eww-quit ()
150 "Exit the Emacs Web Wowser."
151 (interactive)
152 (setq eww-history nil)
153 (kill-buffer (current-buffer)))
154
155(defun eww-previous-url ()
156 "Go to the previously displayed page."
157 (interactive)
158 (when (zerop (length eww-history))
159 (error "No previous page"))
160 (let ((prev (pop eww-history)))
161 (url-retrieve (car prev) 'eww-render (list (car prev) (cadr prev)))))
162
163(defun eww-reload ()
164 "Reload the current page."
165 (interactive)
166 (url-retrieve eww-current-url 'eww-render
167 (list eww-current-url (point))))
168
169;; Form support.
170
171(defvar eww-form nil)
172
173(defun eww-tag-form (cont)
174 (let ((eww-form
175 (list (assq :method cont)
176 (assq :action cont)))
177 (start (point)))
178 (shr-ensure-paragraph)
179 (shr-generic cont)
180 (shr-ensure-paragraph)
181 (when (> (point) start)
182 (put-text-property start (1+ start)
183 'eww-form eww-form))))
184
185(defun eww-tag-input (cont)
186 (let* ((start (point))
187 (type (downcase (or (cdr (assq :type cont))
188 "text")))
189 (widget
190 (cond
191 ((equal type "submit")
192 (list
193 'push-button
194 :notify 'eww-submit
195 :name (cdr (assq :name cont))
196 :eww-form eww-form
197 (or (cdr (assq :value cont)) "Submit")))
198 ((or (equal type "radio")
199 (equal type "checkbox"))
200 (list 'checkbox
201 :notify 'eww-click-radio
202 :name (cdr (assq :name cont))
203 :checkbox-value (cdr (assq :value cont))
204 :checkbox-type type
205 :eww-form eww-form
206 (cdr (assq :checked cont))))
207 ((equal type "hidden")
208 (list 'hidden
209 :name (cdr (assq :name cont))
210 :value (cdr (assq :value cont))))
211 (t
212 (list
213 'editable-field
214 :size (string-to-number
215 (or (cdr (assq :size cont))
216 "40"))
217 :value (or (cdr (assq :value cont)) "")
218 :secret (and (equal type "password") ?*)
219 :action 'eww-submit
220 :name (cdr (assq :name cont))
221 :eww-form eww-form)))))
222 (if (eq (car widget) 'hidden)
223 (when shr-final-table-render
224 (nconc eww-form (list widget)))
225 (apply 'widget-create widget))
226 (put-text-property start (point) 'eww-widget widget)
227 (insert " ")))
228
229(defun eww-tag-select (cont)
230 (shr-ensure-paragraph)
231 (let ((menu (list 'menu-choice
232 :name (cdr (assq :name cont))
233 :eww-form eww-form))
234 (options nil)
235 (start (point)))
236 (dolist (elem cont)
237 (when (eq (car elem) 'option)
238 (when (cdr (assq :selected (cdr elem)))
239 (nconc menu (list :value
240 (cdr (assq :value (cdr elem))))))
241 (push (list 'item
242 :value (cdr (assq :value (cdr elem)))
243 :tag (cdr (assq 'text (cdr elem))))
244 options)))
245 (nconc menu options)
246 (apply 'widget-create menu)
247 (put-text-property start (point) 'eww-widget menu)
248 (shr-ensure-paragraph)))
249
250(defun eww-click-radio (widget &rest ignore)
251 (let ((form (plist-get (cdr widget) :eww-form))
252 (name (plist-get (cdr widget) :name)))
253 (when (equal (plist-get (cdr widget) :type) "radio")
254 (if (widget-value widget)
255 ;; Switch all the other radio buttons off.
256 (dolist (overlay (overlays-in (point-min) (point-max)))
257 (let ((field (plist-get (overlay-properties overlay) 'button)))
258 (when (and (eq (plist-get (cdr field) :eww-form) form)
259 (equal name (plist-get (cdr field) :name)))
260 (unless (eq field widget)
261 (widget-value-set field nil)))))
262 (widget-value-set widget t)))
263 (eww-fix-widget-keymap)))
264
265(defun eww-submit (widget &rest ignore)
266 (let ((form (plist-get (cdr widget) :eww-form))
267 (first-button t)
268 values)
269 (dolist (overlay (sort (overlays-in (point-min) (point-max))
270 (lambda (o1 o2)
271 (< (overlay-start o1) (overlay-start o2)))))
272 (let ((field (or (plist-get (overlay-properties overlay) 'field)
273 (plist-get (overlay-properties overlay) 'button)
274 (plist-get (overlay-properties overlay) 'eww-hidden))))
275 (when (eq (plist-get (cdr field) :eww-form) form)
276 (let ((name (plist-get (cdr field) :name)))
277 (when name
278 (cond
279 ((eq (car field) 'checkbox)
280 (when (widget-value field)
281 (push (cons name (plist-get (cdr field) :checkbox-value))
282 values)))
283 ((eq (car field) 'eww-hidden)
284 (push (cons name (plist-get (cdr field) :value))
285 values))
286 ((eq (car field) 'push-button)
287 ;; We want the values from buttons if we hit a button,
288 ;; or we're submitting something and this is the first
289 ;; button displayed.
290 (when (or (and (eq (car widget) 'push-button)
291 (eq widget field))
292 (and (not (eq (car widget) 'push-button))
293 (eq (car field) 'push-button)
294 first-button))
295 (setq first-button nil)
296 (push (cons name (widget-value field))
297 values)))
298 (t
299 (push (cons name (widget-value field))
300 values))))))))
301 (dolist (elem form)
302 (when (and (consp elem)
303 (eq (car elem) 'hidden))
304 (push (cons (plist-get (cdr elem) :name)
305 (plist-get (cdr elem) :value))
306 values)))
307 (let ((shr-base eww-current-url))
308 (if (and (stringp (cdr (assq :method form)))
309 (equal (downcase (cdr (assq :method form))) "post"))
310 (let ((url-request-method "POST")
311 (url-request-extra-headers
312 '(("Content-Type" . "application/x-www-form-urlencoded")))
313 (url-request-data (mm-url-encode-www-form-urlencoded values)))
314 (eww-browse-url (shr-expand-url (cdr (assq :action form)))))
315 (eww-browse-url
316 (shr-expand-url
317 (concat
318 (cdr (assq :action form))
319 "?"
320 (mm-url-encode-www-form-urlencoded values))))))))
321
322(defun eww-convert-widgets ()
323 (let ((start (point-min))
324 widget)
325 ;; Some widgets come from different buffers (rendered for tables),
326 ;; so we need to nix out the list of widgets and recreate them.
327 (setq widget-field-list nil
328 widget-field-new nil)
329 (while (setq start (next-single-property-change start 'eww-widget))
330 (setq widget (get-text-property start 'eww-widget))
331 (goto-char start)
332 (let ((end (next-single-property-change start 'eww-widget)))
333 (dolist (overlay (overlays-in start end))
334 (when (or (plist-get (overlay-properties overlay) 'button)
335 (plist-get (overlay-properties overlay) 'field))
336 (delete-overlay overlay)))
337 (delete-region start end))
338 (apply 'widget-create widget))
339 (widget-setup)
340 (eww-fix-widget-keymap)))
341
342(defun eww-fix-widget-keymap ()
343 (dolist (overlay (overlays-in (point-min) (point-max)))
344 (when (plist-get (overlay-properties overlay) 'button)
345 (overlay-put overlay 'local-map widget-keymap))))
346
347(provide 'eww)
348
349;;; eww.el ends here
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 23603bc7722..65f4b76ad19 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3430,15 +3430,13 @@ possible values."
3430 (visible-date (mail-fetch-field "Date")) 3430 (visible-date (mail-fetch-field "Date"))
3431 pos date bface eface) 3431 pos date bface eface)
3432 (save-excursion 3432 (save-excursion
3433 (goto-char (point-min))
3434 (when (re-search-forward "^Date:" nil t)
3435 (setq bface (get-text-property (point-at-bol) 'face)
3436 eface (get-text-property (1- (point-at-eol)) 'face)))
3437 ;; Delete any old Date headers.
3438 (if date-position 3433 (if date-position
3439 (progn 3434 (progn
3440 (goto-char date-position) 3435 (goto-char date-position)
3441 (setq date (get-text-property (point) 'original-date)) 3436 (setq date (get-text-property (point) 'original-date))
3437 (when (looking-at "[^:]+:[\t ]*")
3438 (setq bface (get-text-property (match-beginning 0) 'face)
3439 eface (get-text-property (match-end 0) 'face)))
3442 (delete-region (point) 3440 (delete-region (point)
3443 (progn 3441 (progn
3444 (gnus-article-forward-header) 3442 (gnus-article-forward-header)
@@ -3454,12 +3452,26 @@ possible values."
3454 (narrow-to-region pos (if (search-forward "\n\n" nil t) 3452 (narrow-to-region pos (if (search-forward "\n\n" nil t)
3455 (1+ (match-beginning 0)) 3453 (1+ (match-beginning 0))
3456 (point-max))) 3454 (point-max)))
3457 (goto-char (point-min)) 3455 (while (setq pos (text-property-not-all pos (point-max)
3458 (while (re-search-forward "^Date:" nil t) 3456 'gnus-date-type nil))
3459 (setq date (get-text-property (match-beginning 0) 'original-date)) 3457 (setq date (get-text-property pos 'original-date))
3460 (delete-region (point-at-bol) (progn 3458 (goto-char pos)
3461 (gnus-article-forward-header) 3459 (when (looking-at "[^:]+:[\t ]*")
3462 (point)))) 3460 (setq bface (get-text-property (match-beginning 0) 'face)
3461 eface (get-text-property (match-end 0) 'face)))
3462 (delete-region pos (or (text-property-any pos (point-max)
3463 'gnus-date-type nil)
3464 (point-max))))
3465 (unless date ;; the 1st time
3466 (goto-char (point-min))
3467 (while (re-search-forward "^Date:[\t ]*" nil t)
3468 (setq date (get-text-property (match-beginning 0)
3469 'original-date)
3470 bface (get-text-property (match-beginning 0) 'face)
3471 eface (get-text-property (match-end 0) 'face))
3472 (delete-region (point-at-bol) (progn
3473 (gnus-article-forward-header)
3474 (point)))))
3463 (when (and (not date) 3475 (when (and (not date)
3464 visible-date) 3476 visible-date)
3465 (setq date visible-date)) 3477 (setq date visible-date))
@@ -3476,20 +3488,25 @@ possible values."
3476 (list type)) 3488 (list type))
3477 (t 3489 (t
3478 type))) 3490 type)))
3479 (insert (article-make-date-line date (or this-type 'ut)) "\n") 3491 (goto-char
3480 (forward-line -1) 3492 (prog1
3481 (beginning-of-line) 3493 (point)
3482 (put-text-property (point) (1+ (point)) 3494 (add-text-properties
3483 'original-date date) 3495 (point)
3484 (put-text-property (point) (1+ (point)) 3496 (progn
3485 'gnus-date-type this-type) 3497 (insert (article-make-date-line date (or this-type 'ut)) "\n")
3498 (point))
3499 (list 'original-date date 'gnus-date-type this-type))))
3486 ;; Do highlighting. 3500 ;; Do highlighting.
3487 (when (looking-at "\\([^:]+\\): *\\(.*\\)$") 3501 (when (looking-at
3488 (put-text-property (match-beginning 1) (1+ (match-end 1)) 3502 "\\([^:]+:\\)[\t ]*\\(\\(?:[^\t\n ]+[\t ]+\\)*[^\t\n ]+\\)?")
3489 'face bface) 3503 (put-text-property (match-beginning 1) (match-end 1) 'face bface)
3490 (put-text-property (match-beginning 2) (match-end 2) 3504 (when (match-beginning 2)
3491 'face eface)) 3505 (put-text-property (match-beginning 2) (match-end 2) 'face eface))
3492 (forward-line 1))) 3506 (while (and (zerop (forward-line 1))
3507 (looking-at "[\t ]+\\(\\(?:[^\t\n ]+[\t ]+\\)*[^\t\n ]+\\)?"))
3508 (when (match-beginning 1)
3509 (put-text-property (match-beginning 1) (match-end 1) 'face eface))))))
3493 3510
3494(defun article-make-date-line (date type) 3511(defun article-make-date-line (date type)
3495 "Return a DATE line of TYPE." 3512 "Return a DATE line of TYPE."
@@ -3669,25 +3686,26 @@ function and want to see what the date was before converting."
3669 (when (eq major-mode 'gnus-article-mode) 3686 (when (eq major-mode 'gnus-article-mode)
3670 (let ((old-line (count-lines (point-min) (point))) 3687 (let ((old-line (count-lines (point-min) (point)))
3671 (old-column (- (point) (line-beginning-position))) 3688 (old-column (- (point) (line-beginning-position)))
3672 (window-start 3689 (window-start (window-start w))
3673 (window-start (get-buffer-window (current-buffer))))) 3690 (pos (point-min))
3674 (goto-char (point-min)) 3691 type next end)
3675 (while (re-search-forward "^Date:" nil t) 3692 (while (setq pos (text-property-not-all pos (point-max)
3676 (let ((type (get-text-property (match-beginning 0) 3693 'gnus-date-type nil))
3677 'gnus-date-type))) 3694 (setq next (or (next-single-property-change pos
3678 (when (memq type '(lapsed combined-lapsed user-format)) 3695 'gnus-date-type)
3679 (when (and window-start 3696 (point-max)))
3680 (not (= window-start 3697 (setq type (get-text-property pos 'gnus-date-type))
3681 (save-excursion 3698 (when (memq type '(lapsed combined-lapsed user-defined))
3682 (forward-line 1) 3699 (article-date-ut type t pos)
3683 (point))))) 3700 (setq end (or (next-single-property-change pos
3684 (setq window-start nil)) 3701 'gnus-date-type)
3685 (save-excursion 3702 (point-max)))
3686 (article-date-ut type t (match-beginning 0))) 3703 (when window-start
3687 (forward-line 1) 3704 (if (/= window-start next)
3688 (when window-start 3705 (setq window-start nil)
3689 (set-window-start (get-buffer-window (current-buffer)) 3706 (set-window-start w end)))
3690 (point)))))) 3707 (setq next end))
3708 (setq pos next))
3691 (goto-char (point-min)) 3709 (goto-char (point-min))
3692 (when (> old-column 0) 3710 (when (> old-column 0)
3693 (setq old-line (1- old-line))) 3711 (setq old-line (1- old-line)))
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el
index ac8bb74f1f5..f9ef70f9580 100644
--- a/lisp/gnus/gnus-ems.el
+++ b/lisp/gnus/gnus-ems.el
@@ -165,10 +165,10 @@
165 165
166(defun gnus-image-type-available-p (type) 166(defun gnus-image-type-available-p (type)
167 (and (fboundp 'image-type-available-p) 167 (and (fboundp 'image-type-available-p)
168 (image-type-available-p type)
169 (if (fboundp 'display-images-p) 168 (if (fboundp 'display-images-p)
170 (display-images-p) 169 (display-images-p)
171 t))) 170 t)
171 (image-type-available-p type)))
172 172
173(defun gnus-create-image (file &optional type data-p &rest props) 173(defun gnus-create-image (file &optional type data-p &rest props)
174 (let ((face (plist-get props :face))) 174 (let ((face (plist-get props :face)))
@@ -221,8 +221,8 @@
221 'window-inside-pixel-edges 221 'window-inside-pixel-edges
222 'window-pixel-edges)) 222 'window-pixel-edges))
223 223
224 (if (fboundp 'set-process-plist) 224 (if (or (featurep 'emacs) (fboundp 'set-process-plist))
225 (progn 225 (progn ; these exist since Emacs 22.1
226 (defalias 'gnus-set-process-plist 'set-process-plist) 226 (defalias 'gnus-set-process-plist 'set-process-plist)
227 (defalias 'gnus-process-plist 'process-plist) 227 (defalias 'gnus-process-plist 'process-plist)
228 (defalias 'gnus-process-get 'process-get) 228 (defalias 'gnus-process-get 'process-get)
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 2c45d3c24a1..30ce184ed66 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -3591,6 +3591,8 @@ Cross references (Xref: header) of articles are ignored."
3591 (interactive "P") 3591 (interactive "P")
3592 (gnus-group-catchup-current n 'all)) 3592 (gnus-group-catchup-current n 'all))
3593 3593
3594(declare-function gnus-sequence-of-unread-articles "gnus-sum" (group))
3595
3594(defun gnus-group-catchup (group &optional all) 3596(defun gnus-group-catchup (group &optional all)
3595 "Mark all articles in GROUP as read. 3597 "Mark all articles in GROUP as read.
3596If ALL is non-nil, all articles are marked as read. 3598If ALL is non-nil, all articles are marked as read.
@@ -4493,6 +4495,8 @@ and the second element is the address."
4493 (sort (nconc (gnus-uncompress-range (cdr m)) 4495 (sort (nconc (gnus-uncompress-range (cdr m))
4494 (copy-sequence articles)) '<) t)))))) 4496 (copy-sequence articles)) '<) t))))))
4495 4497
4498(declare-function gnus-summary-add-mark "gnus-sum" (article type))
4499
4496(defun gnus-add-mark (group mark article) 4500(defun gnus-add-mark (group mark article)
4497 "Mark ARTICLE in GROUP with MARK, whether the group is displayed or not." 4501 "Mark ARTICLE in GROUP with MARK, whether the group is displayed or not."
4498 (let ((buffer (gnus-summary-buffer-name group))) 4502 (let ((buffer (gnus-summary-buffer-name group)))
@@ -4657,6 +4661,9 @@ you the groups that have both dormant articles and cached articles."
4657 (let ((gnus-group-list-option 'limit)) 4661 (let ((gnus-group-list-option 'limit))
4658 (gnus-group-list-plus args))) 4662 (gnus-group-list-plus args)))
4659 4663
4664(declare-function gnus-mark-article-as-read "gnu-sum" (article &optional mark))
4665(declare-function gnus-group-make-articles-read "gnus-sum" (group articles))
4666
4660(defun gnus-group-mark-article-read (group article) 4667(defun gnus-group-mark-article-read (group article)
4661 "Mark ARTICLE read." 4668 "Mark ARTICLE read."
4662 (let ((buffer (gnus-summary-buffer-name group)) 4669 (let ((buffer (gnus-summary-buffer-name group))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index f0b17341e77..c8f593ea403 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -5492,6 +5492,8 @@ or a straight list of headers."
5492 (cdr (assq number gnus-newsgroup-scored)) 5492 (cdr (assq number gnus-newsgroup-scored))
5493 (memq number gnus-newsgroup-processable)))))) 5493 (memq number gnus-newsgroup-processable))))))
5494 5494
5495(declare-function gnus-parameter-list-identifier "gnus-art" (name) t)
5496
5495(defun gnus-group-get-list-identifiers (group) 5497(defun gnus-group-get-list-identifiers (group)
5496 "Get list identifier regexp for GROUP." 5498 "Get list identifier regexp for GROUP."
5497 (or (gnus-parameter-list-identifier group) 5499 (or (gnus-parameter-list-identifier group)
@@ -7267,6 +7269,9 @@ If FORCE (the prefix), also save the .newsrc file(s)."
7267 (unless quit-config 7269 (unless quit-config
7268 (setq gnus-newsgroup-name nil))))) 7270 (setq gnus-newsgroup-name nil)))))
7269 7271
7272(declare-function gnus-article-stop-animations "gnus-art" ())
7273(declare-function gnus-stop-downloads "gnus-art" ())
7274
7270(defalias 'gnus-summary-quit 'gnus-summary-exit-no-update) 7275(defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
7271(defun gnus-summary-exit-no-update (&optional no-questions) 7276(defun gnus-summary-exit-no-update (&optional no-questions)
7272 "Quit reading current newsgroup without updating read article info." 7277 "Quit reading current newsgroup without updating read article info."
@@ -7859,6 +7864,8 @@ If UNREAD is non-nil, only unread articles are selected."
7859 (and gnus-auto-select-same 7864 (and gnus-auto-select-same
7860 (gnus-summary-article-subject)))) 7865 (gnus-summary-article-subject))))
7861 7866
7867(declare-function gnus-article-only-boring-p "gnus-art" ())
7868
7862(defun gnus-summary-next-page (&optional lines circular stop) 7869(defun gnus-summary-next-page (&optional lines circular stop)
7863 "Show next page of the selected article. 7870 "Show next page of the selected article.
7864If at the end of the current article, select the next article. 7871If at the end of the current article, select the next article.
@@ -8426,6 +8433,8 @@ If REVERSE (the prefix), limit to articles that don't match."
8426 (interactive "sMatch headers (regexp): \nP") 8433 (interactive "sMatch headers (regexp): \nP")
8427 (gnus-summary-limit-to-bodies match reverse t)) 8434 (gnus-summary-limit-to-bodies match reverse t))
8428 8435
8436(declare-function article-goto-body "gnus-art" ())
8437
8429(defun gnus-summary-limit-to-bodies (match &optional reverse headersp) 8438(defun gnus-summary-limit-to-bodies (match &optional reverse headersp)
8430 "Limit the summary buffer to articles that have bodies that match MATCH. 8439 "Limit the summary buffer to articles that have bodies that match MATCH.
8431If REVERSE (the prefix), limit to articles that don't match." 8440If REVERSE (the prefix), limit to articles that don't match."
@@ -9556,6 +9565,8 @@ to save in."
9556 (ps-spool-buffer-with-faces) 9565 (ps-spool-buffer-with-faces)
9557 (ps-spool-buffer))))) 9566 (ps-spool-buffer)))))
9558 9567
9568(declare-function gnus-flush-original-article-buffer "gnus-art" ())
9569
9559(defun gnus-summary-show-complete-article () 9570(defun gnus-summary-show-complete-article ()
9560 "Show a complete version of the current article. 9571 "Show a complete version of the current article.
9561This is only useful if you're looking at a partial version of the 9572This is only useful if you're looking at a partial version of the
@@ -9679,6 +9690,10 @@ If ARG is a negative number, turn header display off."
9679 t))) 9690 t)))
9680 (gnus-summary-show-article)) 9691 (gnus-summary-show-article))
9681 9692
9693(declare-function article-narrow-to-head "gnus-art" ())
9694(declare-function gnus-article-hidden-text-p "gnus-art" (type))
9695(declare-function gnus-delete-wash-type "gnus-art" (type))
9696
9682(defun gnus-summary-toggle-header (&optional arg) 9697(defun gnus-summary-toggle-header (&optional arg)
9683 "Show the headers if they are hidden, or hide them if they are shown. 9698 "Show the headers if they are hidden, or hide them if they are shown.
9684If ARG is a positive number, show the entire header. 9699If ARG is a positive number, show the entire header.
@@ -11962,6 +11977,8 @@ will not be marked as saved."
11962 (gnus-set-mode-line 'summary) 11977 (gnus-set-mode-line 'summary)
11963 n)) 11978 n))
11964 11979
11980(declare-function gnus-summary-save-in-pipe "gnus-art" (&optional command raw))
11981
11965(defun gnus-summary-pipe-output (&optional n sym) 11982(defun gnus-summary-pipe-output (&optional n sym)
11966 "Pipe the current article to a subprocess. 11983 "Pipe the current article to a subprocess.
11967If N is a positive number, pipe the N next articles. 11984If N is a positive number, pipe the N next articles.
@@ -12914,6 +12931,7 @@ If ALL is a number, fetch this number of articles."
12914 (gnus-summary-position-point)) 12931 (gnus-summary-position-point))
12915 12932
12916;;; Bookmark support for Gnus. 12933;;; Bookmark support for Gnus.
12934(declare-function gnus-article-show-summary "gnus-art" ())
12917(declare-function bookmark-make-record-default 12935(declare-function bookmark-make-record-default
12918 "bookmark" (&optional no-file no-context posn)) 12936 "bookmark" (&optional no-file no-context posn))
12919(declare-function bookmark-prop-get "bookmark" (bookmark prop)) 12937(declare-function bookmark-prop-get "bookmark" (bookmark prop))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index fd6ebf338fa..2c2dbd90c56 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -4243,8 +4243,7 @@ parameters."
4243 (setq valids (cdr valids))) 4243 (setq valids (cdr valids)))
4244 outs)) 4244 outs))
4245 4245
4246(eval-and-compile 4246(autoload 'message-y-or-n-p "message" nil nil 'macro)
4247 (autoload 'message-y-or-n-p "message" nil nil 'macro))
4248 4247
4249(defun gnus-read-group (prompt &optional default) 4248(defun gnus-read-group (prompt &optional default)
4250 "Prompt the user for a group name. 4249 "Prompt the user for a group name.
diff --git a/lisp/gnus/gravatar.el b/lisp/gnus/gravatar.el
index bf6295aa7b8..985ed2c7b0d 100644
--- a/lisp/gnus/gravatar.el
+++ b/lisp/gnus/gravatar.el
@@ -103,6 +103,8 @@ If no image available, return 'error."
103 (gravatar-create-image data nil t) 103 (gravatar-create-image data nil t)
104 'error))) 104 'error)))
105 105
106(autoload 'help-function-arglist "help-fns")
107
106;;;###autoload 108;;;###autoload
107(defun gravatar-retrieve (mail-address cb &optional cbargs) 109(defun gravatar-retrieve (mail-address cb &optional cbargs)
108 "Retrieve MAIL-ADDRESS gravatar and call CB on retrieval. 110 "Retrieve MAIL-ADDRESS gravatar and call CB on retrieval.
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index ac6170a3cdf..b1cba27c335 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -660,14 +660,26 @@ If MODE is not set, try to find mode automatically."
660;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 660;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
661;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } 661;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
662(defvar mm-pkcs7-signed-magic 662(defvar mm-pkcs7-signed-magic
663 "\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\ 663 (concat
664\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x02") 664 "0"
665 "\\(\\(\x80\\)"
666 "\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
667 "\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
668 "\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
669 "\\)"
670 "\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x02"))
665 671
666;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 672;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
667;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } 673;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
668(defvar mm-pkcs7-enveloped-magic 674(defvar mm-pkcs7-enveloped-magic
669 "\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\ 675 (concat
670\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x03") 676 "0"
677 "\\(\\(\x80\\)"
678 "\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
679 "\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
680 "\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
681 "\\)"
682 "\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x03"))
671 683
672(defun mm-view-pkcs7-get-type (handle) 684(defun mm-view-pkcs7-get-type (handle)
673 (mm-with-unibyte-buffer 685 (mm-with-unibyte-buffer
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 9c18bc2cff0..8fdd69b47da 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1642,6 +1642,7 @@ textual parts.")
1642 (setq nnimap-status-string "Read-only server") 1642 (setq nnimap-status-string "Read-only server")
1643 nil) 1643 nil)
1644 1644
1645(defvar gnus-refer-thread-use-nnir) ; gnus-sum
1645(declare-function gnus-fetch-headers "gnus-sum" 1646(declare-function gnus-fetch-headers "gnus-sum"
1646 (articles &optional limit force-new dependencies)) 1647 (articles &optional limit force-new dependencies))
1647 1648
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index a266567987d..5be449e9a6b 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1952,9 +1952,13 @@ If TIME is nil, then return the cutoff time for oldness instead."
1952 ((and (equal header 'to-from) 1952 ((and (equal header 'to-from)
1953 (or (string-match (cadr regexp-target-pair) from) 1953 (or (string-match (cadr regexp-target-pair) from)
1954 (and (string-match (cadr regexp-target-pair) to) 1954 (and (string-match (cadr regexp-target-pair) to)
1955 (let ((rmail-dont-reply-to-names 1955 (let* ((mail-dont-reply-to-names
1956 (message-dont-reply-to-names))) 1956 (message-dont-reply-to-names))
1957 (equal (rmail-dont-reply-to from) ""))))) 1957 (rmail-dont-reply-to-names ; obsolete since 24.1
1958 mail-dont-reply-to-names))
1959 (equal (if (fboundp 'rmail-dont-reply-to)
1960 (rmail-dont-reply-to from)
1961 (mail-dont-reply-to from)) "")))))
1958 (setq target (format-time-string (caddr regexp-target-pair) date))) 1962 (setq target (format-time-string (caddr regexp-target-pair) date)))
1959 ((and (not (equal header 'to-from)) 1963 ((and (not (equal header 'to-from))
1960 (string-match (cadr regexp-target-pair) 1964 (string-match (cadr regexp-target-pair)
diff --git a/lisp/gnus/registry.el b/lisp/gnus/registry.el
index 79f07812b2d..37fe6440743 100644
--- a/lisp/gnus/registry.el
+++ b/lisp/gnus/registry.el
@@ -119,60 +119,59 @@
119 :type hash-table 119 :type hash-table
120 :documentation "The data hashtable."))) 120 :documentation "The data hashtable.")))
121 121
122(eval-and-compile 122(defmethod initialize-instance :AFTER ((this registry-db) slots)
123 (defmethod initialize-instance :AFTER ((this registry-db) slots) 123 "Set value of data slot of THIS after initialization."
124 "Set value of data slot of THIS after initialization." 124 (with-slots (data tracker) this
125 (with-slots (data tracker) this 125 (unless (member :data slots)
126 (unless (member :data slots) 126 (setq data
127 (setq data 127 (make-hash-table :size 10000 :rehash-size 2.0 :test 'equal)))
128 (make-hash-table :size 10000 :rehash-size 2.0 :test 'equal))) 128 (unless (member :tracker slots)
129 (unless (member :tracker slots) 129 (setq tracker (make-hash-table :size 100 :rehash-size 2.0)))))
130 (setq tracker (make-hash-table :size 100 :rehash-size 2.0))))) 130
131 131(defmethod registry-lookup ((db registry-db) keys)
132 (defmethod registry-lookup ((db registry-db) keys) 132 "Search for KEYS in the registry-db THIS.
133 "Search for KEYS in the registry-db THIS.
134Returns an alist of the key followed by the entry in a list, not a cons cell." 133Returns an alist of the key followed by the entry in a list, not a cons cell."
135 (let ((data (oref db :data))) 134 (let ((data (oref db :data)))
136 (delq nil 135 (delq nil
137 (mapcar 136 (mapcar
138 (lambda (k) 137 (lambda (k)
139 (when (gethash k data) 138 (when (gethash k data)
140 (list k (gethash k data)))) 139 (list k (gethash k data))))
141 keys)))) 140 keys))))
142 141
143 (defmethod registry-lookup-breaks-before-lexbind ((db registry-db) keys) 142(defmethod registry-lookup-breaks-before-lexbind ((db registry-db) keys)
144 "Search for KEYS in the registry-db THIS. 143 "Search for KEYS in the registry-db THIS.
145Returns an alist of the key followed by the entry in a list, not a cons cell." 144Returns an alist of the key followed by the entry in a list, not a cons cell."
146 (let ((data (oref db :data))) 145 (let ((data (oref db :data)))
147 (delq nil 146 (delq nil
148 (loop for key in keys 147 (loop for key in keys
149 when (gethash key data) 148 when (gethash key data)
150 collect (list key (gethash key data)))))) 149 collect (list key (gethash key data))))))
151 150
152 (defmethod registry-lookup-secondary ((db registry-db) tracksym 151(defmethod registry-lookup-secondary ((db registry-db) tracksym
153 &optional create) 152 &optional create)
154 "Search for TRACKSYM in the registry-db THIS. 153 "Search for TRACKSYM in the registry-db THIS.
155When CREATE is not nil, create the secondary index hashtable if needed." 154When CREATE is not nil, create the secondary index hashtable if needed."
156 (let ((h (gethash tracksym (oref db :tracker)))) 155 (let ((h (gethash tracksym (oref db :tracker))))
157 (if h 156 (if h
158 h 157 h
159 (when create 158 (when create
160 (puthash tracksym 159 (puthash tracksym
161 (make-hash-table :size 800 :rehash-size 2.0 :test 'equal) 160 (make-hash-table :size 800 :rehash-size 2.0 :test 'equal)
162 (oref db :tracker)) 161 (oref db :tracker))
163 (gethash tracksym (oref db :tracker)))))) 162 (gethash tracksym (oref db :tracker))))))
164 163
165 (defmethod registry-lookup-secondary-value ((db registry-db) tracksym val 164(defmethod registry-lookup-secondary-value ((db registry-db) tracksym val
166 &optional set) 165 &optional set)
167 "Search for TRACKSYM with value VAL in the registry-db THIS. 166 "Search for TRACKSYM with value VAL in the registry-db THIS.
168When SET is not nil, set it for VAL (use t for an empty list)." 167When SET is not nil, set it for VAL (use t for an empty list)."
169 ;; either we're asked for creation or there should be an existing index 168 ;; either we're asked for creation or there should be an existing index
170 (when (or set (registry-lookup-secondary db tracksym)) 169 (when (or set (registry-lookup-secondary db tracksym))
171 ;; set the entry if requested, 170 ;; set the entry if requested,
172 (when set 171 (when set
173 (puthash val (if (eq t set) '() set) 172 (puthash val (if (eq t set) '() set)
174 (registry-lookup-secondary db tracksym t))) 173 (registry-lookup-secondary db tracksym t)))
175 (gethash val (registry-lookup-secondary db tracksym))))) 174 (gethash val (registry-lookup-secondary db tracksym))))
176 175
177(defun registry--match (mode entry check-list) 176(defun registry--match (mode entry check-list)
178 ;; for all members 177 ;; for all members
@@ -194,166 +193,165 @@ When SET is not nil, set it for VAL (use t for an empty list)."
194 (or found 193 (or found
195 (registry--match mode entry (cdr-safe check-list)))))) 194 (registry--match mode entry (cdr-safe check-list))))))
196 195
197(eval-and-compile 196(defmethod registry-search ((db registry-db) &rest spec)
198 (defmethod registry-search ((db registry-db) &rest spec) 197 "Search for SPEC across the registry-db THIS.
199 "Search for SPEC across the registry-db THIS.
200For example calling with :member '(a 1 2) will match entry '((a 3 1)). 198For example calling with :member '(a 1 2) will match entry '((a 3 1)).
201Calling with :all t (any non-nil value) will match all. 199Calling with :all t (any non-nil value) will match all.
202Calling with :regex '\(a \"h.llo\") will match entry '((a \"hullo\" \"bye\"). 200Calling with :regex '\(a \"h.llo\") will match entry '((a \"hullo\" \"bye\").
203The test order is to check :all first, then :member, then :regex." 201The test order is to check :all first, then :member, then :regex."
204 (when db 202 (when db
205 (let ((all (plist-get spec :all)) 203 (let ((all (plist-get spec :all))
206 (member (plist-get spec :member)) 204 (member (plist-get spec :member))
207 (regex (plist-get spec :regex))) 205 (regex (plist-get spec :regex)))
208 (loop for k being the hash-keys of (oref db :data) 206 (loop for k being the hash-keys of (oref db :data)
209 using (hash-values v) 207 using (hash-values v)
210 when (or 208 when (or
211 ;; :all non-nil returns all 209 ;; :all non-nil returns all
212 all 210 all
213 ;; member matching 211 ;; member matching
214 (and member (registry--match :member v member)) 212 (and member (registry--match :member v member))
215 ;; regex matching 213 ;; regex matching
216 (and regex (registry--match :regex v regex))) 214 (and regex (registry--match :regex v regex)))
217 collect k)))) 215 collect k))))
218 216
219 (defmethod registry-delete ((db registry-db) keys assert &rest spec) 217(defmethod registry-delete ((db registry-db) keys assert &rest spec)
220 "Delete KEYS from the registry-db THIS. 218 "Delete KEYS from the registry-db THIS.
221If KEYS is nil, use SPEC to do a search. 219If KEYS is nil, use SPEC to do a search.
222Updates the secondary ('tracked') indices as well. 220Updates the secondary ('tracked') indices as well.
223With assert non-nil, errors out if the key does not exist already." 221With assert non-nil, errors out if the key does not exist already."
224 (let* ((data (oref db :data)) 222 (let* ((data (oref db :data))
225 (keys (or keys 223 (keys (or keys
226 (apply 'registry-search db spec))) 224 (apply 'registry-search db spec)))
227 (tracked (oref db :tracked))) 225 (tracked (oref db :tracked)))
228 226
229 (dolist (key keys) 227 (dolist (key keys)
230 (let ((entry (gethash key data))) 228 (let ((entry (gethash key data)))
231 (when assert 229 (when assert
232 (assert entry nil 230 (assert entry nil
233 "Key %s does not exists in database" key)) 231 "Key %s does not exists in database" key))
234 ;; clean entry from the secondary indices 232 ;; clean entry from the secondary indices
235 (dolist (tr tracked) 233 (dolist (tr tracked)
236 ;; is this tracked symbol indexed? 234 ;; is this tracked symbol indexed?
237 (when (registry-lookup-secondary db tr) 235 (when (registry-lookup-secondary db tr)
238 ;; for every value in the entry under that key... 236 ;; for every value in the entry under that key...
239 (dolist (val (cdr-safe (assq tr entry))) 237 (dolist (val (cdr-safe (assq tr entry)))
240 (let* ((value-keys (registry-lookup-secondary-value 238 (let* ((value-keys (registry-lookup-secondary-value
241 db tr val))) 239 db tr val)))
242 (when (member key value-keys) 240 (when (member key value-keys)
243 ;; override the previous value 241 ;; override the previous value
244 (registry-lookup-secondary-value 242 (registry-lookup-secondary-value
245 db tr val 243 db tr val
246 ;; with the indexed keys MINUS the current key 244 ;; with the indexed keys MINUS the current key
247 ;; (we pass t when the list is empty) 245 ;; (we pass t when the list is empty)
248 (or (delete key value-keys) t))))))) 246 (or (delete key value-keys) t)))))))
249 (remhash key data))) 247 (remhash key data)))
250 keys)) 248 keys))
251 249
252 (defmethod registry-size ((db registry-db)) 250(defmethod registry-size ((db registry-db))
253 "Returns the size of the registry-db object THIS. 251 "Returns the size of the registry-db object THIS.
254This is the key count of the :data slot." 252This is the key count of the :data slot."
255 (hash-table-count (oref db :data))) 253 (hash-table-count (oref db :data)))
256 254
257 (defmethod registry-full ((db registry-db)) 255(defmethod registry-full ((db registry-db))
258 "Checks if registry-db THIS is full." 256 "Checks if registry-db THIS is full."
259 (>= (registry-size db) 257 (>= (registry-size db)
260 (oref db :max-hard))) 258 (oref db :max-hard)))
261 259
262 (defmethod registry-insert ((db registry-db) key entry) 260(defmethod registry-insert ((db registry-db) key entry)
263 "Insert ENTRY under KEY into the registry-db THIS. 261 "Insert ENTRY under KEY into the registry-db THIS.
264Updates the secondary ('tracked') indices as well. 262Updates the secondary ('tracked') indices as well.
265Errors out if the key exists already." 263Errors out if the key exists already."
266 264
267 (assert (not (gethash key (oref db :data))) nil 265 (assert (not (gethash key (oref db :data))) nil
268 "Key already exists in database") 266 "Key already exists in database")
269 267
270 (assert (not (registry-full db)) 268 (assert (not (registry-full db))
271 nil 269 nil
272 "registry max-hard size limit reached") 270 "registry max-hard size limit reached")
273 271
274 ;; store the entry 272 ;; store the entry
275 (puthash key entry (oref db :data)) 273 (puthash key entry (oref db :data))
276 274
277 ;; store the secondary indices 275 ;; store the secondary indices
276 (dolist (tr (oref db :tracked))
277 ;; for every value in the entry under that key...
278 (dolist (val (cdr-safe (assq tr entry)))
279 (let* ((value-keys (registry-lookup-secondary-value db tr val)))
280 (pushnew key value-keys :test 'equal)
281 (registry-lookup-secondary-value db tr val value-keys))))
282 entry)
283
284(defmethod registry-reindex ((db registry-db))
285 "Rebuild the secondary indices of registry-db THIS."
286 (let ((count 0)
287 (expected (* (length (oref db :tracked)) (registry-size db))))
278 (dolist (tr (oref db :tracked)) 288 (dolist (tr (oref db :tracked))
279 ;; for every value in the entry under that key... 289 (let (values)
280 (dolist (val (cdr-safe (assq tr entry))) 290 (maphash
281 (let* ((value-keys (registry-lookup-secondary-value db tr val))) 291 (lambda (key v)
282 (pushnew key value-keys :test 'equal) 292 (incf count)
283 (registry-lookup-secondary-value db tr val value-keys)))) 293 (when (and (< 0 expected)
284 entry) 294 (= 0 (mod count 1000)))
285 295 (message "reindexing: %d of %d (%.2f%%)"
286 (defmethod registry-reindex ((db registry-db)) 296 count expected (/ (* 100 count) expected)))
287 "Rebuild the secondary indices of registry-db THIS." 297 (dolist (val (cdr-safe (assq tr v)))
288 (let ((count 0) 298 (let* ((value-keys (registry-lookup-secondary-value db tr val)))
289 (expected (* (length (oref db :tracked)) (registry-size db)))) 299 (push key value-keys)
290 (dolist (tr (oref db :tracked)) 300 (registry-lookup-secondary-value db tr val value-keys))))
291 (let (values) 301 (oref db :data))))))
292 (maphash 302
293 (lambda (key v) 303(defmethod registry-prune ((db registry-db) &optional sortfun)
294 (incf count) 304 "Prunes the registry-db object THIS.
295 (when (and (< 0 expected)
296 (= 0 (mod count 1000)))
297 (message "reindexing: %d of %d (%.2f%%)"
298 count expected (/ (* 100 count) expected)))
299 (dolist (val (cdr-safe (assq tr v)))
300 (let* ((value-keys (registry-lookup-secondary-value db tr val)))
301 (push key value-keys)
302 (registry-lookup-secondary-value db tr val value-keys))))
303 (oref db :data))))))
304
305 (defmethod registry-prune ((db registry-db) &optional sortfun)
306 "Prunes the registry-db object THIS.
307Removes only entries without the :precious keys if it can, 305Removes only entries without the :precious keys if it can,
308then removes oldest entries first. 306then removes oldest entries first.
309Returns the number of deleted entries. 307Returns the number of deleted entries.
310If SORTFUN is given, tries to keep entries that sort *higher*. 308If SORTFUN is given, tries to keep entries that sort *higher*.
311SORTFUN is passed only the two keys so it must look them up directly." 309SORTFUN is passed only the two keys so it must look them up directly."
312 (dolist (collector '(registry-prune-soft-candidates 310 (dolist (collector '(registry-prune-soft-candidates
313 registry-prune-hard-candidates)) 311 registry-prune-hard-candidates))
314 (let* ((size (registry-size db)) 312 (let* ((size (registry-size db))
315 (collected (funcall collector db)) 313 (collected (funcall collector db))
316 (limit (nth 0 collected)) 314 (limit (nth 0 collected))
317 (candidates (nth 1 collected)) 315 (candidates (nth 1 collected))
318 ;; sort the candidates if SORTFUN was given 316 ;; sort the candidates if SORTFUN was given
319 (candidates (if sortfun (sort candidates sortfun) candidates)) 317 (candidates (if sortfun (sort candidates sortfun) candidates))
320 (candidates-count (length candidates)) 318 (candidates-count (length candidates))
321 ;; are we over max-soft? 319 ;; are we over max-soft?
322 (prune-needed (> size limit))) 320 (prune-needed (> size limit)))
323 321
324 ;; while we have more candidates than we need to remove... 322 ;; while we have more candidates than we need to remove...
325 (while (and (> candidates-count (- size limit)) candidates) 323 (while (and (> candidates-count (- size limit)) candidates)
326 (decf candidates-count) 324 (decf candidates-count)
327 (setq candidates (cdr candidates))) 325 (setq candidates (cdr candidates)))
328 326
329 (registry-delete db candidates nil) 327 (registry-delete db candidates nil)
330 (length candidates)))) 328 (length candidates))))
331 329
332 (defmethod registry-prune-soft-candidates ((db registry-db)) 330(defmethod registry-prune-soft-candidates ((db registry-db))
333 "Collects pruning candidates from the registry-db object THIS. 331 "Collects pruning candidates from the registry-db object THIS.
334Proposes only entries without the :precious keys." 332Proposes only entries without the :precious keys."
335 (let* ((precious (oref db :precious)) 333 (let* ((precious (oref db :precious))
336 (precious-p (lambda (entry-key) 334 (precious-p (lambda (entry-key)
337 (cdr (memq (car entry-key) precious)))) 335 (cdr (memq (car entry-key) precious))))
338 (data (oref db :data)) 336 (data (oref db :data))
339 (limit (oref db :max-soft)) 337 (limit (oref db :max-soft))
340 (candidates (loop for k being the hash-keys of data 338 (candidates (loop for k being the hash-keys of data
341 using (hash-values v) 339 using (hash-values v)
342 when (notany precious-p v) 340 when (notany precious-p v)
343 collect k))) 341 collect k)))
344 (list limit candidates))) 342 (list limit candidates)))
345 343
346 (defmethod registry-prune-hard-candidates ((db registry-db)) 344(defmethod registry-prune-hard-candidates ((db registry-db))
347 "Collects pruning candidates from the registry-db object THIS. 345 "Collects pruning candidates from the registry-db object THIS.
348Proposes any entries over the max-hard limit minus size * prune-factor." 346Proposes any entries over the max-hard limit minus size * prune-factor."
349 (let* ((data (oref db :data)) 347 (let* ((data (oref db :data))
350 ;; prune to (size * prune-factor) below the max-hard limit so 348 ;; prune to (size * prune-factor) below the max-hard limit so
351 ;; we're not pruning all the time 349 ;; we're not pruning all the time
352 (limit (max 0 (- (oref db :max-hard) 350 (limit (max 0 (- (oref db :max-hard)
353 (* (registry-size db) (oref db :prune-factor))))) 351 (* (registry-size db) (oref db :prune-factor)))))
354 (candidates (loop for k being the hash-keys of data 352 (candidates (loop for k being the hash-keys of data
355 collect k))) 353 collect k)))
356 (list limit candidates)))) 354 (list limit candidates)))
357 355
358(provide 'registry) 356(provide 'registry)
359;;; registry.el ends here 357;;; registry.el ends here
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 2d2272d6c11..d9e267e5288 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -114,6 +114,8 @@ cid: URL as the argument.")
114(defvar shr-stylesheet nil) 114(defvar shr-stylesheet nil)
115(defvar shr-base nil) 115(defvar shr-base nil)
116(defvar shr-ignore-cache nil) 116(defvar shr-ignore-cache nil)
117(defvar shr-external-rendering-functions nil)
118(defvar shr-final-table-render nil)
117 119
118(defvar shr-map 120(defvar shr-map
119 (let ((map (make-sparse-keymap))) 121 (let ((map (make-sparse-keymap)))
@@ -291,7 +293,12 @@ size, and full-buffer size."
291 (nreverse result))) 293 (nreverse result)))
292 294
293(defun shr-descend (dom) 295(defun shr-descend (dom)
294 (let ((function (intern (concat "shr-tag-" (symbol-name (car dom))) obarray)) 296 (let ((function
297 (or
298 ;; Allow other packages to override (or provide) rendering
299 ;; of elements.
300 (cdr (assq (car dom) shr-external-rendering-functions))
301 (intern (concat "shr-tag-" (symbol-name (car dom))) obarray)))
295 (style (cdr (assq :style (cdr dom)))) 302 (style (cdr (assq :style (cdr dom))))
296 (shr-stylesheet shr-stylesheet) 303 (shr-stylesheet shr-stylesheet)
297 (start (point))) 304 (start (point)))
@@ -478,20 +485,27 @@ size, and full-buffer size."
478 (not failed))) 485 (not failed)))
479 486
480(defun shr-expand-url (url) 487(defun shr-expand-url (url)
481 (cond 488 (if (or (not url)
482 ;; Absolute URL. 489 (string-match "\\`[a-z]*:" url)
483 ((or (not url) 490 (not shr-base))
484 (string-match "\\`[a-z]*:" url) 491 ;; Absolute URL.
485 (not shr-base)) 492 url
486 url) 493 (let ((base shr-base))
487 ((and (string-match "\\`//" url) 494 ;; Chop off query string.
488 (string-match "\\`[a-z]*:" shr-base)) 495 (when (string-match "^\\([^?]+\\)[?]" base)
489 (concat (match-string 0 shr-base) url)) 496 (setq base (match-string 1 base)))
490 ((and (not (string-match "/\\'" shr-base)) 497 (cond
491 (not (string-match "\\`/" url))) 498 ((and (string-match "\\`//" url)
492 (concat shr-base "/" url)) 499 (string-match "\\`[a-z]*:" base))
493 (t 500 (concat (match-string 0 base) url))
494 (concat shr-base url)))) 501 ((and (not (string-match "/\\'" base))
502 (not (string-match "\\`/" url)))
503 (concat base "/" url))
504 ((and (string-match "\\`/" url)
505 (string-match "\\(\\`[^:]*://[^/]+\\)/" base))
506 (concat (match-string 1 base) url))
507 (t
508 (concat base url))))))
495 509
496(defun shr-ensure-newline () 510(defun shr-ensure-newline ()
497 (unless (zerop (current-column)) 511 (unless (zerop (current-column))
@@ -631,12 +645,13 @@ size, and full-buffer size."
631 (overlay-put overlay 'face 'default))) 645 (overlay-put overlay 'face 'default)))
632 (insert-image image (or alt "*"))) 646 (insert-image image (or alt "*")))
633 (put-text-property start (point) 'image-size size) 647 (put-text-property start (point) 'image-size size)
634 (when (if (fboundp 'image-multi-frame-p) 648 (when (cond ((fboundp 'image-multi-frame-p)
635 ;; Only animate multi-frame things that specify a 649 ;; Only animate multi-frame things that specify a
636 ;; delay; eg animated gifs as opposed to 650 ;; delay; eg animated gifs as opposed to
637 ;; multi-page tiffs. FIXME? 651 ;; multi-page tiffs. FIXME?
638 (cdr (image-multi-frame-p image)) 652 (cdr (image-multi-frame-p image)))
639 (image-animated-p image)) 653 ((fboundp 'image-animated-p)
654 (image-animated-p image)))
640 (image-animate image nil 60))) 655 (image-animate image nil 60)))
641 image) 656 image)
642 (insert alt))) 657 (insert alt)))
@@ -944,7 +959,8 @@ ones, in case fg and bg are nil."
944 plist))) 959 plist)))
945 960
946(defun shr-tag-base (cont) 961(defun shr-tag-base (cont)
947 (setq shr-base (cdr (assq :href cont)))) 962 (setq shr-base (cdr (assq :href cont)))
963 (shr-generic cont))
948 964
949(defun shr-tag-a (cont) 965(defun shr-tag-a (cont)
950 (let ((url (cdr (assq :href cont))) 966 (let ((url (cdr (assq :href cont)))
@@ -1166,7 +1182,8 @@ ones, in case fg and bg are nil."
1166 (frame-width)) 1182 (frame-width))
1167 (setq truncate-lines t)) 1183 (setq truncate-lines t))
1168 ;; Then render the table again with these new "hard" widths. 1184 ;; Then render the table again with these new "hard" widths.
1169 (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)) 1185 (let ((shr-final-table-render t))
1186 (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)))
1170 ;; Finally, insert all the images after the table. The Emacs buffer 1187 ;; Finally, insert all the images after the table. The Emacs buffer
1171 ;; model isn't strong enough to allow us to put the images actually 1188 ;; model isn't strong enough to allow us to put the images actually
1172 ;; into the tables. 1189 ;; into the tables.
diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el
index b96261764e5..23ab24152d9 100644
--- a/lisp/gnus/sieve-manage.el
+++ b/lisp/gnus/sieve-manage.el
@@ -3,6 +3,7 @@
3;; Copyright (C) 2001-2013 Free Software Foundation, Inc. 3;; Copyright (C) 2001-2013 Free Software Foundation, Inc.
4 4
5;; Author: Simon Josefsson <simon@josefsson.org> 5;; Author: Simon Josefsson <simon@josefsson.org>
6;; Albert Krewinkel <tarleb@moltkeplatz.de>
6 7
7;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
8 9
@@ -66,6 +67,7 @@
66;; 2001-10-31 Committed to Oort Gnus. 67;; 2001-10-31 Committed to Oort Gnus.
67;; 2002-07-27 Added DELETESCRIPT. Suggested by Ned Ludd. 68;; 2002-07-27 Added DELETESCRIPT. Suggested by Ned Ludd.
68;; 2002-08-03 Use SASL library. 69;; 2002-08-03 Use SASL library.
70;; 2013-06-05 Enabled STARTTLS support, fixed bit rot.
69 71
70;;; Code: 72;;; Code:
71 73
@@ -82,7 +84,6 @@
82 (require 'sasl) 84 (require 'sasl)
83 (require 'starttls)) 85 (require 'starttls))
84(autoload 'sasl-find-mechanism "sasl") 86(autoload 'sasl-find-mechanism "sasl")
85(autoload 'starttls-open-stream "starttls")
86(autoload 'auth-source-search "auth-source") 87(autoload 'auth-source-search "auth-source")
87 88
88;; User customizable variables: 89;; User customizable variables:
@@ -107,23 +108,6 @@
107 :type 'string 108 :type 'string
108 :group 'sieve-manage) 109 :group 'sieve-manage)
109 110
110(defcustom sieve-manage-streams '(network starttls shell)
111 "Priority of streams to consider when opening connection to server."
112 :group 'sieve-manage)
113
114(defcustom sieve-manage-stream-alist
115 '((network sieve-manage-network-p sieve-manage-network-open)
116 (shell sieve-manage-shell-p sieve-manage-shell-open)
117 (starttls sieve-manage-starttls-p sieve-manage-starttls-open))
118 "Definition of network streams.
119
120\(NAME CHECK OPEN)
121
122NAME names the stream, CHECK is a function returning non-nil if the
123server support the stream and OPEN is a function for opening the
124stream."
125 :group 'sieve-manage)
126
127(defcustom sieve-manage-authenticators '(digest-md5 111(defcustom sieve-manage-authenticators '(digest-md5
128 cram-md5 112 cram-md5
129 scram-md5 113 scram-md5
@@ -156,8 +140,7 @@ for doing the actual authentication."
156 :group 'sieve-manage) 140 :group 'sieve-manage)
157 141
158(defcustom sieve-manage-default-stream 'network 142(defcustom sieve-manage-default-stream 'network
159 "Default stream type to use for `sieve-manage'. 143 "Default stream type to use for `sieve-manage'."
160Must be a name of a stream in `sieve-manage-stream-alist'."
161 :version "24.1" 144 :version "24.1"
162 :type 'symbol 145 :type 'symbol
163 :group 'sieve-manage) 146 :group 'sieve-manage)
@@ -185,17 +168,21 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
185(defvar sieve-manage-capability nil) 168(defvar sieve-manage-capability nil)
186 169
187;; Internal utility functions 170;; Internal utility functions
188 171(defun sieve-manage-make-process-buffer ()
189(defmacro sieve-manage-disable-multibyte () 172 (with-current-buffer
190 "Enable multibyte in the current buffer." 173 (generate-new-buffer (format " *sieve %s:%s*"
191 (unless (featurep 'xemacs) 174 sieve-manage-server
192 '(set-buffer-multibyte nil))) 175 sieve-manage-port))
176 (mapc 'make-local-variable sieve-manage-local-variables)
177 (mm-enable-multibyte)
178 (buffer-disable-undo)
179 (current-buffer)))
193 180
194(defun sieve-manage-erase (&optional p buffer) 181(defun sieve-manage-erase (&optional p buffer)
195 (let ((buffer (or buffer (current-buffer)))) 182 (let ((buffer (or buffer (current-buffer))))
196 (and sieve-manage-log 183 (and sieve-manage-log
197 (with-current-buffer (get-buffer-create sieve-manage-log) 184 (with-current-buffer (get-buffer-create sieve-manage-log)
198 (sieve-manage-disable-multibyte) 185 (mm-enable-multibyte)
199 (buffer-disable-undo) 186 (buffer-disable-undo)
200 (goto-char (point-max)) 187 (goto-char (point-max))
201 (insert-buffer-substring buffer (with-current-buffer buffer 188 (insert-buffer-substring buffer (with-current-buffer buffer
@@ -204,71 +191,32 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
204 (point-max))))))) 191 (point-max)))))))
205 (delete-region (point-min) (or p (point-max)))) 192 (delete-region (point-min) (or p (point-max))))
206 193
207(defun sieve-manage-open-1 (buffer) 194(defun sieve-manage-open-server (server port &optional stream buffer)
195 "Open network connection to SERVER on PORT.
196Return the buffer associated with the connection."
208 (with-current-buffer buffer 197 (with-current-buffer buffer
209 (sieve-manage-erase) 198 (sieve-manage-erase)
210 (setq sieve-manage-state 'initial 199 (setq sieve-manage-state 'initial)
211 sieve-manage-process 200 (destructuring-bind (proc . props)
212 (condition-case () 201 (open-protocol-stream
213 (funcall (nth 2 (assq sieve-manage-stream 202 "SIEVE" buffer server port
214 sieve-manage-stream-alist)) 203 :type stream
215 "sieve" buffer sieve-manage-server sieve-manage-port) 204 :capability-command "CAPABILITY\r\n"
216 ((error quit) nil))) 205 :end-of-command "^\\(OK\\|NO\\).*\n"
217 (when sieve-manage-process 206 :success "^OK.*\n"
218 (while (and (eq sieve-manage-state 'initial) 207 :return-list t
219 (memq (process-status sieve-manage-process) '(open run))) 208 :starttls-function
220 (message "Waiting for response from %s..." sieve-manage-server) 209 '(lambda (capabilities)
221 (accept-process-output sieve-manage-process 1)) 210 (when (string-match "\\bSTARTTLS\\b" capabilities)
222 (message "Waiting for response from %s...done" sieve-manage-server) 211 "STARTTLS\r\n")))
223 (and (memq (process-status sieve-manage-process) '(open run)) 212 (setq sieve-manage-process proc)
224 sieve-manage-process)))) 213 (setq sieve-manage-capability
225 214 (sieve-manage-parse-capability (getf props :capabilities)))
226;; Streams 215 ;; Ignore new capabilities issues after successful STARTTLS
227 216 (when (and (memq stream '(nil network starttls))
228(defun sieve-manage-network-p (buffer) 217 (eq (getf props :type) 'tls))
229 t) 218 (sieve-manage-drop-next-answer))
230 219 (current-buffer))))
231(defun sieve-manage-network-open (name buffer server port)
232 (let* ((port (or port sieve-manage-default-port))
233 (coding-system-for-read sieve-manage-coding-system-for-read)
234 (coding-system-for-write sieve-manage-coding-system-for-write)
235 (process (open-network-stream name buffer server port)))
236 (when process
237 (while (and (memq (process-status process) '(open run))
238 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
239 (goto-char (point-min))
240 (not (sieve-manage-parse-greeting-1)))
241 (accept-process-output process 1)
242 (sit-for 1))
243 (sieve-manage-erase nil buffer)
244 (when (memq (process-status process) '(open run))
245 process))))
246
247(defun sieve-manage-starttls-p (buffer)
248 (condition-case ()
249 (progn
250 (require 'starttls)
251 (call-process "starttls"))
252 (error nil)))
253
254(defun sieve-manage-starttls-open (name buffer server port)
255 (let* ((port (or port sieve-manage-default-port))
256 (coding-system-for-read sieve-manage-coding-system-for-read)
257 (coding-system-for-write sieve-manage-coding-system-for-write)
258 (process (starttls-open-stream name buffer server port))
259 done)
260 (when process
261 (while (and (memq (process-status process) '(open run))
262 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
263 (goto-char (point-min))
264 (not (sieve-manage-parse-greeting-1)))
265 (accept-process-output process 1)
266 (sit-for 1))
267 (sieve-manage-erase nil buffer)
268 (sieve-manage-send "STARTTLS")
269 (starttls-negotiate process))
270 (when (memq (process-status process) '(open run))
271 process)))
272 220
273;; Authenticators 221;; Authenticators
274(defun sieve-sasl-auth (buffer mech) 222(defun sieve-sasl-auth (buffer mech)
@@ -396,63 +344,33 @@ Optional argument AUTH indicates authenticator to use, see
396If nil, chooses the best stream the server is capable of. 344If nil, chooses the best stream the server is capable of.
397Optional argument BUFFER is buffer (buffer, or string naming buffer) 345Optional argument BUFFER is buffer (buffer, or string naming buffer)
398to work in." 346to work in."
399 (or port (setq port sieve-manage-default-port)) 347 (setq sieve-manage-port (or port sieve-manage-default-port))
400 (setq buffer (or buffer (format " *sieve* %s:%s" server port))) 348 (with-current-buffer (or buffer (sieve-manage-make-process-buffer))
401 (with-current-buffer (get-buffer-create buffer) 349 (setq sieve-manage-server (or server
402 (mapc 'make-local-variable sieve-manage-local-variables) 350 sieve-manage-server)
403 (sieve-manage-disable-multibyte) 351 sieve-manage-stream (or stream
404 (buffer-disable-undo) 352 sieve-manage-stream
405 (setq sieve-manage-server (or server sieve-manage-server)) 353 sieve-manage-default-stream)
406 (setq sieve-manage-port port) 354 sieve-manage-auth (or auth
407 (setq sieve-manage-stream (or stream sieve-manage-stream)) 355 sieve-manage-auth))
408 (message "sieve: Connecting to %s..." sieve-manage-server) 356 (message "sieve: Connecting to %s..." sieve-manage-server)
409 (if (let ((sieve-manage-stream 357 (sieve-manage-open-server sieve-manage-server
410 (or sieve-manage-stream sieve-manage-default-stream))) 358 sieve-manage-port
411 (sieve-manage-open-1 buffer)) 359 sieve-manage-stream
412 ;; Choose stream. 360 (current-buffer))
413 (let (stream-changed) 361 (when (sieve-manage-opened (current-buffer))
414 (message "sieve: Connecting to %s...done" sieve-manage-server) 362 ;; Choose authenticator
415 (when (null sieve-manage-stream) 363 (when (and (null sieve-manage-auth)
416 (let ((streams sieve-manage-streams)) 364 (not (eq sieve-manage-state 'auth)))
417 (while (setq stream (pop streams)) 365 (dolist (auth sieve-manage-authenticators)
418 (if (funcall (nth 1 (assq stream 366 (when (funcall (nth 1 (assq auth sieve-manage-authenticator-alist))
419 sieve-manage-stream-alist)) buffer) 367 buffer)
420 (setq stream-changed 368 (setq sieve-manage-auth auth)
421 (not (eq (or sieve-manage-stream 369 (return)))
422 sieve-manage-default-stream) 370 (unless sieve-manage-auth
423 stream)) 371 (error "Couldn't figure out authenticator for server")))
424 sieve-manage-stream stream
425 streams nil)))
426 (unless sieve-manage-stream
427 (error "Couldn't figure out a stream for server"))))
428 (when stream-changed
429 (message "sieve: Reconnecting with stream `%s'..."
430 sieve-manage-stream)
431 (sieve-manage-close buffer)
432 (if (sieve-manage-open-1 buffer)
433 (message "sieve: Reconnecting with stream `%s'...done"
434 sieve-manage-stream)
435 (message "sieve: Reconnecting with stream `%s'...failed"
436 sieve-manage-stream))
437 (setq sieve-manage-capability nil))
438 (if (sieve-manage-opened buffer)
439 ;; Choose authenticator
440 (when (and (null sieve-manage-auth)
441 (not (eq sieve-manage-state 'auth)))
442 (let ((auths sieve-manage-authenticators))
443 (while (setq auth (pop auths))
444 (if (funcall (nth 1 (assq
445 auth
446 sieve-manage-authenticator-alist))
447 buffer)
448 (setq sieve-manage-auth auth
449 auths nil)))
450 (unless sieve-manage-auth
451 (error "Couldn't figure out authenticator for server"))))))
452 (message "sieve: Connecting to %s...failed" sieve-manage-server))
453 (when (sieve-manage-opened buffer)
454 (sieve-manage-erase) 372 (sieve-manage-erase)
455 buffer))) 373 (current-buffer))))
456 374
457(defun sieve-manage-authenticate (&optional buffer) 375(defun sieve-manage-authenticate (&optional buffer)
458 "Authenticate on server in BUFFER. 376 "Authenticate on server in BUFFER.
@@ -544,12 +462,22 @@ If NAME is nil, return the full server list of capabilities."
544 462
545;; Protocol parsing routines 463;; Protocol parsing routines
546 464
465(defun sieve-manage-wait-for-answer ()
466 (let ((pattern "^\\(OK\\|NO\\).*\n")
467 pos)
468 (while (not pos)
469 (setq pos (search-forward-regexp pattern nil t))
470 (goto-char (point-min))
471 (sleep-for 0 50))
472 pos))
473
474(defun sieve-manage-drop-next-answer ()
475 (sieve-manage-wait-for-answer)
476 (sieve-manage-erase))
477
547(defun sieve-manage-ok-p (rsp) 478(defun sieve-manage-ok-p (rsp)
548 (string= (downcase (or (car-safe rsp) "")) "ok")) 479 (string= (downcase (or (car-safe rsp) "")) "ok"))
549 480
550(defsubst sieve-manage-forward ()
551 (or (eobp) (forward-char)))
552
553(defun sieve-manage-is-okno () 481(defun sieve-manage-is-okno ()
554 (when (looking-at (concat 482 (when (looking-at (concat
555 "^\\(OK\\|NO\\)\\( (\\([^)]+\\))\\)?\\( \\(.*\\)\\)?" 483 "^\\(OK\\|NO\\)\\( (\\([^)]+\\))\\)?\\( \\(.*\\)\\)?"
@@ -571,21 +499,15 @@ If NAME is nil, return the full server list of capabilities."
571 (sieve-manage-erase) 499 (sieve-manage-erase)
572 rsp)) 500 rsp))
573 501
574(defun sieve-manage-parse-capability-1 () 502(defun sieve-manage-parse-capability (str)
575 "Accept a managesieve greeting." 503 "Parse managesieve capability string `STR'.
576 (let (str) 504Set variable `sieve-manage-capability' to "
577 (while (setq str (sieve-manage-is-string)) 505 (let ((capas (remove-if #'null
578 (if (eq (char-after) ? ) 506 (mapcar #'split-string-and-unquote
579 (progn 507 (split-string str "\n")))))
580 (sieve-manage-forward) 508 (when (string= "OK" (caar (last capas)))
581 (push (list str (sieve-manage-is-string)) 509 (setq sieve-manage-state 'nonauth))
582 sieve-manage-capability)) 510 capas))
583 (push (list str) sieve-manage-capability))
584 (forward-line)))
585 (when (re-search-forward (concat "^OK.*" sieve-manage-server-eol) nil t)
586 (setq sieve-manage-state 'nonauth)))
587
588(defalias 'sieve-manage-parse-greeting-1 'sieve-manage-parse-capability-1)
589 511
590(defun sieve-manage-is-string () 512(defun sieve-manage-is-string ()
591 (cond ((looking-at "\"\\([^\"]+\\)\"") 513 (cond ((looking-at "\"\\([^\"]+\\)\"")
@@ -639,7 +561,7 @@ If NAME is nil, return the full server list of capabilities."
639 (setq cmdstr (concat cmdstr sieve-manage-client-eol)) 561 (setq cmdstr (concat cmdstr sieve-manage-client-eol))
640 (and sieve-manage-log 562 (and sieve-manage-log
641 (with-current-buffer (get-buffer-create sieve-manage-log) 563 (with-current-buffer (get-buffer-create sieve-manage-log)
642 (sieve-manage-disable-multibyte) 564 (mm-enable-multibyte)
643 (buffer-disable-undo) 565 (buffer-disable-undo)
644 (goto-char (point-max)) 566 (goto-char (point-max))
645 (insert cmdstr))) 567 (insert cmdstr)))
diff --git a/lisp/gnus/sieve.el b/lisp/gnus/sieve.el
index 0e46cb66361..2c11c039d56 100644
--- a/lisp/gnus/sieve.el
+++ b/lisp/gnus/sieve.el
@@ -109,7 +109,6 @@ require \"fileinto\";
109 ;; various 109 ;; various
110 (define-key map "?" 'sieve-help) 110 (define-key map "?" 'sieve-help)
111 (define-key map "h" 'sieve-help) 111 (define-key map "h" 'sieve-help)
112 (define-key map "q" 'kill-buffer)
113 ;; activating 112 ;; activating
114 (define-key map "m" 'sieve-activate) 113 (define-key map "m" 'sieve-activate)
115 (define-key map "u" 'sieve-deactivate) 114 (define-key map "u" 'sieve-deactivate)
@@ -152,6 +151,8 @@ require \"fileinto\";
152(defun sieve-manage-quit () 151(defun sieve-manage-quit ()
153 "Quit." 152 "Quit."
154 (interactive) 153 (interactive)
154 (sieve-manage-close sieve-manage-buffer)
155 (kill-buffer sieve-manage-buffer)
155 (kill-buffer (current-buffer))) 156 (kill-buffer (current-buffer)))
156 157
157(defun sieve-activate (&optional pos) 158(defun sieve-activate (&optional pos)
@@ -206,6 +207,7 @@ require \"fileinto\";
206 (insert sieve-template)) 207 (insert sieve-template))
207 (sieve-mode) 208 (sieve-mode)
208 (setq sieve-buffer-script-name name) 209 (setq sieve-buffer-script-name name)
210 (beginning-of-buffer)
209 (message 211 (message
210 (substitute-command-keys 212 (substitute-command-keys
211 "Press \\[sieve-upload] to upload script to server.")))) 213 "Press \\[sieve-upload] to upload script to server."))))
@@ -256,10 +258,9 @@ Used to bracket operations which move point in the sieve-buffer."
256 (setq buffer-read-only nil) 258 (setq buffer-read-only nil)
257 (erase-buffer) 259 (erase-buffer)
258 (buffer-disable-undo) 260 (buffer-disable-undo)
259 (insert "\ 261 (let* ((port (or port sieve-manage-default-port))
260Server : " server ":" (or port sieve-manage-default-port) " 262 (header (format "Server : %s:%s\n\n" server port)))
261 263 (insert header))
262")
263 (set (make-local-variable 'sieve-buffer-header-end) 264 (set (make-local-variable 'sieve-buffer-header-end)
264 (point-max))) 265 (point-max)))
265 266
@@ -305,7 +306,7 @@ Server : " server ":" (or port sieve-manage-default-port) "
305 (with-current-buffer 306 (with-current-buffer
306 (or ;; open server 307 (or ;; open server
307 (set (make-local-variable 'sieve-manage-buffer) 308 (set (make-local-variable 'sieve-manage-buffer)
308 (sieve-manage-open server)) 309 (sieve-manage-open server port))
309 (error "Error opening server %s" server)) 310 (error "Error opening server %s" server))
310 (sieve-manage-authenticate))) 311 (sieve-manage-authenticate)))
311 312
diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el
index d75e8198842..135bfd48e5f 100644
--- a/lisp/gnus/spam-stat.el
+++ b/lisp/gnus/spam-stat.el
@@ -412,8 +412,7 @@ With a prefix argument save unconditionally."
412 (when (or force spam-stat-dirty) 412 (when (or force spam-stat-dirty)
413 (let ((coding-system-for-write spam-stat-coding-system)) 413 (let ((coding-system-for-write spam-stat-coding-system))
414 (with-temp-file spam-stat-file 414 (with-temp-file spam-stat-file
415 (let ((standard-output (current-buffer)) 415 (let ((standard-output (current-buffer)))
416 (font-lock-maximum-size 0))
417 (insert (format ";-*- coding: %s; -*-\n" spam-stat-coding-system)) 416 (insert (format ";-*- coding: %s; -*-\n" spam-stat-coding-system))
418 (insert (format "(setq spam-stat-ngood %d spam-stat-nbad %d 417 (insert (format "(setq spam-stat-ngood %d spam-stat-nbad %d
419spam-stat (spam-stat-to-hash-table '(" spam-stat-ngood spam-stat-nbad)) 418spam-stat (spam-stat-to-hash-table '(" spam-stat-ngood spam-stat-nbad))
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 725017ca116..8d689bf26bd 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -50,7 +50,6 @@
50;;; for the definitions of group content classification and spam processors 50;;; for the definitions of group content classification and spam processors
51(require 'gnus) 51(require 'gnus)
52 52
53(eval-when-compile (require 'spam-report))
54(eval-when-compile (require 'hashcash)) 53(eval-when-compile (require 'hashcash))
55 54
56;; for nnimap-split-download-body-default 55;; for nnimap-split-download-body-default
@@ -60,11 +59,10 @@
60(autoload 'query-dig "dig") 59(autoload 'query-dig "dig")
61 60
62;; autoload spam-report 61;; autoload spam-report
63(eval-and-compile 62(autoload 'spam-report-gmane "spam-report")
64 (autoload 'spam-report-gmane "spam-report") 63(autoload 'spam-report-gmane-spam "spam-report")
65 (autoload 'spam-report-gmane-spam "spam-report") 64(autoload 'spam-report-gmane-ham "spam-report")
66 (autoload 'spam-report-gmane-ham "spam-report") 65(autoload 'spam-report-resend "spam-report")
67 (autoload 'spam-report-resend "spam-report"))
68 66
69;; autoload gnus-registry 67;; autoload gnus-registry
70(autoload 'gnus-registry-group-count "gnus-registry") 68(autoload 'gnus-registry-group-count "gnus-registry")
@@ -2473,7 +2471,10 @@ With a non-nil REMOVE, remove the ADDRESSES."
2473(defun spam-report-resend-register-ham-routine (articles) 2471(defun spam-report-resend-register-ham-routine (articles)
2474 (spam-report-resend-register-routine articles t)) 2472 (spam-report-resend-register-routine articles t))
2475 2473
2474(defvar spam-report-resend-to)
2475
2476(defun spam-report-resend-register-routine (articles &optional ham) 2476(defun spam-report-resend-register-routine (articles &optional ham)
2477 (require 'spam-report)
2477 (let* ((resend-to-gp 2478 (let* ((resend-to-gp
2478 (if ham 2479 (if ham
2479 (gnus-parameter-ham-resend-to gnus-newsgroup-name) 2480 (gnus-parameter-ham-resend-to gnus-newsgroup-name)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index bdf86016844..86bb67e87c2 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -435,14 +435,19 @@ suitable file is found, return nil."
435 (let ((handler (function-get function 'compiler-macro))) 435 (let ((handler (function-get function 'compiler-macro)))
436 (when handler 436 (when handler
437 (insert "\nThis function has a compiler macro") 437 (insert "\nThis function has a compiler macro")
438 (let ((lib (get function 'compiler-macro-file))) 438 (if (symbolp handler)
439 ;; FIXME: rather than look at the compiler-macro-file property, 439 (progn
440 ;; just look at `handler' itself. 440 (insert (format " `%s'" handler))
441 (when (stringp lib) 441 (save-excursion
442 (insert (format " in `%s'" lib)) 442 (re-search-backward "`\\([^`']+\\)'" nil t)
443 (save-excursion 443 (help-xref-button 1 'help-function handler)))
444 (re-search-backward "`\\([^`']+\\)'" nil t) 444 ;; FIXME: Obsolete since 24.4.
445 (help-xref-button 1 'help-function-cmacro function lib)))) 445 (let ((lib (get function 'compiler-macro-file)))
446 (when (stringp lib)
447 (insert (format " in `%s'" lib))
448 (save-excursion
449 (re-search-backward "`\\([^`']+\\)'" nil t)
450 (help-xref-button 1 'help-function-cmacro function lib)))))
446 (insert ".\n")))) 451 (insert ".\n"))))
447 452
448(defun help-fns--signature (function doc real-def real-function) 453(defun help-fns--signature (function doc real-def real-function)
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index b5aca1a4445..b56adc2a4a9 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -204,7 +204,7 @@ The format is (FUNCTION ARGS...).")
204 (message "Unable to find location in file")))) 204 (message "Unable to find location in file"))))
205 'help-echo (purecopy "mouse-2, RET: find function's definition")) 205 'help-echo (purecopy "mouse-2, RET: find function's definition"))
206 206
207(define-button-type 'help-function-cmacro 207(define-button-type 'help-function-cmacro ; FIXME: Obsolete since 24.4.
208 :supertype 'help-xref 208 :supertype 'help-xref
209 'help-function (lambda (fun file) 209 'help-function (lambda (fun file)
210 (setq file (locate-library file t)) 210 (setq file (locate-library file t))
@@ -213,7 +213,7 @@ The format is (FUNCTION ARGS...).")
213 (pop-to-buffer (find-file-noselect file)) 213 (pop-to-buffer (find-file-noselect file))
214 (goto-char (point-min)) 214 (goto-char (point-min))
215 (if (re-search-forward 215 (if (re-search-forward
216 (format "^[ \t]*(define-compiler-macro[ \t]+%s" 216 (format "^[ \t]*(\\(cl-\\)?define-compiler-macro[ \t]+%s"
217 (regexp-quote (symbol-name fun))) nil t) 217 (regexp-quote (symbol-name fun))) nil t)
218 (forward-line 0) 218 (forward-line 0)
219 (message "Unable to find location in file"))) 219 (message "Unable to find location in file")))
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index e2dc4eac67b..d0a82cd97b0 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -37,18 +37,18 @@
37;; 37;;
38;; In program source code highlight a variable to quickly see all 38;; In program source code highlight a variable to quickly see all
39;; places it is modified or referenced: 39;; places it is modified or referenced:
40;; M-x highlight-regexp ground_contact_switches_closed RET RET 40;; M-x highlight-regexp RET ground_contact_switches_closed RET RET
41;; 41;;
42;; In a shell or other buffer that is showing lots of program 42;; In a shell or other buffer that is showing lots of program
43;; output, highlight the parts of the output you're interested in: 43;; output, highlight the parts of the output you're interested in:
44;; M-x highlight-regexp Total execution time [0-9]+ RET hi-blue-b RET 44;; M-x highlight-regexp RET Total execution time [0-9]+ RET hi-blue-b RET
45;; 45;;
46;; In buffers displaying tables, highlight the lines you're interested in: 46;; In buffers displaying tables, highlight the lines you're interested in:
47;; M-x highlight-lines-matching-regexp January 2000 RET hi-black-b RET 47;; M-x highlight-lines-matching-regexp RET January 2000 RET hi-black-b RET
48;; 48;;
49;; When writing text, highlight personal cliches. This can be 49;; When writing text, highlight personal cliches. This can be
50;; amusing. 50;; amusing.
51;; M-x highlight-phrase as can be seen RET RET 51;; M-x highlight-phrase RET as can be seen RET RET
52;; 52;;
53;; Setup: 53;; Setup:
54;; 54;;
@@ -252,6 +252,10 @@ a library is being loaded.")
252 '(menu-item "Highlight Lines..." highlight-lines-matching-regexp 252 '(menu-item "Highlight Lines..." highlight-lines-matching-regexp
253 :help "Highlight lines containing match of PATTERN (a regexp).")) 253 :help "Highlight lines containing match of PATTERN (a regexp)."))
254 254
255 (define-key-after map [highlight-symbol-at-point]
256 '(menu-item "Highlight Symbol at Point" highlight-symbol-at-point
257 :help "Highlight symbol found near point without prompting."))
258
255 (define-key-after map [unhighlight-regexp] 259 (define-key-after map [unhighlight-regexp]
256 '(menu-item "Remove Highlighting..." unhighlight-regexp 260 '(menu-item "Remove Highlighting..." unhighlight-regexp
257 :help "Remove previously entered highlighting pattern." 261 :help "Remove previously entered highlighting pattern."
@@ -274,6 +278,7 @@ a library is being loaded.")
274 (define-key map "\C-xwl" 'highlight-lines-matching-regexp) 278 (define-key map "\C-xwl" 'highlight-lines-matching-regexp)
275 (define-key map "\C-xwp" 'highlight-phrase) 279 (define-key map "\C-xwp" 'highlight-phrase)
276 (define-key map "\C-xwh" 'highlight-regexp) 280 (define-key map "\C-xwh" 'highlight-regexp)
281 (define-key map "\C-xw." 'highlight-symbol-at-point)
277 (define-key map "\C-xwr" 'unhighlight-regexp) 282 (define-key map "\C-xwr" 'unhighlight-regexp)
278 (define-key map "\C-xwb" 'hi-lock-write-interactive-patterns) 283 (define-key map "\C-xwb" 'hi-lock-write-interactive-patterns)
279 map) 284 map)
@@ -333,6 +338,10 @@ which can be called interactively, are:
333\\[highlight-lines-matching-regexp] REGEXP FACE 338\\[highlight-lines-matching-regexp] REGEXP FACE
334 Highlight lines containing matches of REGEXP in current buffer with FACE. 339 Highlight lines containing matches of REGEXP in current buffer with FACE.
335 340
341\\[highlight-symbol-at-point]
342 Highlight the symbol found near point without prompting, using the next
343 available face automatically.
344
336\\[unhighlight-regexp] REGEXP 345\\[unhighlight-regexp] REGEXP
337 Remove highlighting on matches of REGEXP in current buffer. 346 Remove highlighting on matches of REGEXP in current buffer.
338 347
@@ -490,6 +499,27 @@ highlighting will not update as you type."
490 (unless hi-lock-mode (hi-lock-mode 1)) 499 (unless hi-lock-mode (hi-lock-mode 1))
491 (hi-lock-set-pattern regexp face)) 500 (hi-lock-set-pattern regexp face))
492 501
502;;;###autoload
503(defalias 'highlight-symbol-at-point 'hi-lock-face-symbol-at-point)
504;;;###autoload
505(defun hi-lock-face-symbol-at-point ()
506 "Set face of each match of the symbol at point.
507Use `find-tag-default-as-regexp' to retrieve the symbol at point.
508Use non-nil `hi-lock-auto-select-face' to retrieve the next face
509from `hi-lock-face-defaults' automatically.
510
511Use Font lock mode, if enabled, to highlight symbol at point.
512Otherwise, use overlays for highlighting. If overlays are used,
513the highlighting will not update as you type."
514 (interactive)
515 (let* ((regexp (hi-lock-regexp-okay
516 (find-tag-default-as-regexp)))
517 (hi-lock-auto-select-face t)
518 (face (hi-lock-read-face-name)))
519 (or (facep face) (setq face 'hi-yellow))
520 (unless hi-lock-mode (hi-lock-mode 1))
521 (hi-lock-set-pattern regexp face)))
522
493(defun hi-lock-keyword->face (keyword) 523(defun hi-lock-keyword->face (keyword)
494 (cadr (cadr (cadr keyword)))) ; Keyword looks like (REGEXP (0 'FACE) ...). 524 (cadr (cadr (cadr keyword)))) ; Keyword looks like (REGEXP (0 'FACE) ...).
495 525
diff --git a/lisp/ido.el b/lisp/ido.el
index 8087124765c..47c05b080f7 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3276,14 +3276,18 @@ for first matching file."
3276(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir) 3276(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
3277 ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir") 3277 ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir")
3278 (let ((filenames 3278 (let ((filenames
3279 (split-string 3279 (delq nil
3280 (shell-command-to-string 3280 (mapcar (lambda (name)
3281 (concat "find " 3281 (unless (ido-ignore-item-p name ido-ignore-files t)
3282 (shell-quote-argument dir) 3282 name))
3283 " -name " 3283 (split-string
3284 (shell-quote-argument 3284 (shell-command-to-string
3285 (concat (if prefix "" "*") file "*")) 3285 (concat "find "
3286 " -type " (if finddir "d" "f") " -print")))) 3286 (shell-quote-argument dir)
3287 (if ido-case-fold " -iname " " -name ")
3288 (shell-quote-argument
3289 (concat (if prefix "" "*") file "*"))
3290 " -type " (if finddir "d" "f") " -print"))))))
3287 filename d f 3291 filename d f
3288 res) 3292 res)
3289 (while filenames 3293 (while filenames
@@ -3297,7 +3301,7 @@ for first matching file."
3297 res)) 3301 res))
3298 3302
3299(defun ido-flatten-merged-list (items) 3303(defun ido-flatten-merged-list (items)
3300 ;; Create a list of directory names based on a merged directory list. 3304 "Create a list of directory names based on a merged directory list."
3301 (let (res) 3305 (let (res)
3302 (while items 3306 (while items
3303 (let* ((item (car items)) 3307 (let* ((item (car items))
@@ -3400,7 +3404,7 @@ for first matching file."
3400 res)) 3404 res))
3401 3405
3402(defun ido-make-buffer-list-1 (&optional frame visible) 3406(defun ido-make-buffer-list-1 (&optional frame visible)
3403 ;; Return list of non-ignored buffer names 3407 "Return list of non-ignored buffer names."
3404 (delq nil 3408 (delq nil
3405 (mapcar 3409 (mapcar
3406 (lambda (x) 3410 (lambda (x)
@@ -3410,12 +3414,12 @@ for first matching file."
3410 (buffer-list frame)))) 3414 (buffer-list frame))))
3411 3415
3412(defun ido-make-buffer-list (default) 3416(defun ido-make-buffer-list (default)
3413 ;; Return the current list of buffers. 3417 "Return the current list of buffers.
3414 ;; Currently visible buffers are put at the end of the list. 3418Currently visible buffers are put at the end of the list.
3415 ;; The hook `ido-make-buffer-list-hook' is run after the list has been 3419The hook `ido-make-buffer-list-hook' is run after the list has been
3416 ;; created to allow the user to further modify the order of the buffer names 3420created to allow the user to further modify the order of the buffer names
3417 ;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer, 3421in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
3418 ;; it is put to the start of the list. 3422it is put to the start of the list."
3419 (let* ((ido-current-buffers (ido-get-buffers-in-frames 'current)) 3423 (let* ((ido-current-buffers (ido-get-buffers-in-frames 'current))
3420 (ido-temp-list (ido-make-buffer-list-1 (selected-frame) ido-current-buffers))) 3424 (ido-temp-list (ido-make-buffer-list-1 (selected-frame) ido-current-buffers)))
3421 (if ido-temp-list 3425 (if ido-temp-list
@@ -3457,9 +3461,9 @@ This is to make them appear as if they were \"virtual buffers\"."
3457 (nreverse (mapcar #'car ido-virtual-buffers)))))) 3461 (nreverse (mapcar #'car ido-virtual-buffers))))))
3458 3462
3459(defun ido-make-choice-list (default) 3463(defun ido-make-choice-list (default)
3460 ;; Return the current list of choices. 3464 "Return the current list of choices.
3461 ;; If DEFAULT is non-nil, and corresponds to an element of choices, 3465If DEFAULT is non-nil, and corresponds to an element of choices,
3462 ;; it is put to the start of the list. 3466it is put to the start of the list."
3463 (let ((ido-temp-list ido-choice-list)) 3467 (let ((ido-temp-list ido-choice-list))
3464 (if default 3468 (if default
3465 (progn 3469 (progn
@@ -3471,7 +3475,7 @@ This is to make them appear as if they were \"virtual buffers\"."
3471 ido-temp-list)) 3475 ido-temp-list))
3472 3476
3473(defun ido-to-end (items) 3477(defun ido-to-end (items)
3474 ;; Move the elements from ITEMS to the end of `ido-temp-list' 3478 "Move the elements from ITEMS to the end of `ido-temp-list'."
3475 (mapc 3479 (mapc
3476 (lambda (elem) 3480 (lambda (elem)
3477 (setq ido-temp-list (delq elem ido-temp-list))) 3481 (setq ido-temp-list (delq elem ido-temp-list)))
@@ -3515,8 +3519,8 @@ This is to make them appear as if they were \"virtual buffers\"."
3515 (file-name-all-completions "" dir)))) 3519 (file-name-all-completions "" dir))))
3516 3520
3517(defun ido-file-name-all-completions (dir) 3521(defun ido-file-name-all-completions (dir)
3518 ;; Return name of all files in DIR 3522 "Return name of all files in DIR.
3519 ;; Uses and updates ido-dir-file-cache 3523Uses and updates `ido-dir-file-cache'."
3520 (cond 3524 (cond
3521 ((ido-is-unc-root dir) 3525 ((ido-is-unc-root dir)
3522 (mapcar 3526 (mapcar
@@ -3565,7 +3569,7 @@ This is to make them appear as if they were \"virtual buffers\"."
3565 (ido-file-name-all-completions-1 dir)))) 3569 (ido-file-name-all-completions-1 dir))))
3566 3570
3567(defun ido-remove-cached-dir (dir) 3571(defun ido-remove-cached-dir (dir)
3568 ;; Remove dir from ido-dir-file-cache 3572 "Remove DIR from `ido-dir-file-cache'."
3569 (if (and ido-dir-file-cache 3573 (if (and ido-dir-file-cache
3570 (stringp dir) (> (length dir) 0)) 3574 (stringp dir) (> (length dir) 0))
3571 (let ((cached (assoc dir ido-dir-file-cache))) 3575 (let ((cached (assoc dir ido-dir-file-cache)))
@@ -3574,8 +3578,8 @@ This is to make them appear as if they were \"virtual buffers\"."
3574 3578
3575 3579
3576(defun ido-make-file-list-1 (dir &optional merged) 3580(defun ido-make-file-list-1 (dir &optional merged)
3577 ;; Return list of non-ignored files in DIR 3581 "Return list of non-ignored files in DIR
3578 ;; If MERGED is non-nil, each file is cons'ed with DIR 3582If MERGED is non-nil, each file is cons'ed with DIR."
3579 (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir) 3583 (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir)
3580 (file-directory-p dir)) 3584 (file-directory-p dir))
3581 (delq nil 3585 (delq nil
@@ -3586,11 +3590,11 @@ This is to make them appear as if they were \"virtual buffers\"."
3586 (ido-file-name-all-completions dir))))) 3590 (ido-file-name-all-completions dir)))))
3587 3591
3588(defun ido-make-file-list (default) 3592(defun ido-make-file-list (default)
3589 ;; Return the current list of files. 3593 "Return the current list of files.
3590 ;; Currently visible files are put at the end of the list. 3594Currently visible files are put at the end of the list.
3591 ;; The hook `ido-make-file-list-hook' is run after the list has been 3595The hook `ido-make-file-list-hook' is run after the list has been
3592 ;; created to allow the user to further modify the order of the file names 3596created to allow the user to further modify the order of the file names
3593 ;; in this list. 3597in this list."
3594 (let ((ido-temp-list (ido-make-file-list-1 ido-current-directory))) 3598 (let ((ido-temp-list (ido-make-file-list-1 ido-current-directory)))
3595 (setq ido-temp-list (sort ido-temp-list 3599 (setq ido-temp-list (sort ido-temp-list
3596 (if ido-file-extensions-order 3600 (if ido-file-extensions-order
@@ -3631,8 +3635,8 @@ This is to make them appear as if they were \"virtual buffers\"."
3631 ido-temp-list)) 3635 ido-temp-list))
3632 3636
3633(defun ido-make-dir-list-1 (dir &optional merged) 3637(defun ido-make-dir-list-1 (dir &optional merged)
3634 ;; Return list of non-ignored subdirs in DIR 3638 "Return list of non-ignored subdirs in DIR.
3635 ;; If MERGED is non-nil, each subdir is cons'ed with DIR 3639If MERGED is non-nil, each subdir is cons'ed with DIR."
3636 (and (or (ido-is-tramp-root dir) (file-directory-p dir)) 3640 (and (or (ido-is-tramp-root dir) (file-directory-p dir))
3637 (delq nil 3641 (delq nil
3638 (mapcar 3642 (mapcar
@@ -3642,10 +3646,10 @@ This is to make them appear as if they were \"virtual buffers\"."
3642 (ido-file-name-all-completions dir))))) 3646 (ido-file-name-all-completions dir)))))
3643 3647
3644(defun ido-make-dir-list (default) 3648(defun ido-make-dir-list (default)
3645 ;; Return the current list of directories. 3649 "Return the current list of directories.
3646 ;; The hook `ido-make-dir-list-hook' is run after the list has been 3650The hook `ido-make-dir-list-hook' is run after the list has been
3647 ;; created to allow the user to further modify the order of the 3651created to allow the user to further modify the order of the
3648 ;; directory names in this list. 3652directory names in this list."
3649 (let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory))) 3653 (let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory)))
3650 (setq ido-temp-list (sort ido-temp-list #'ido-file-lessp)) 3654 (setq ido-temp-list (sort ido-temp-list #'ido-file-lessp))
3651 (ido-to-end ;; move . files to end 3655 (ido-to-end ;; move . files to end
@@ -3676,10 +3680,9 @@ This is to make them appear as if they were \"virtual buffers\"."
3676(defvar ido-bufs-in-frame) 3680(defvar ido-bufs-in-frame)
3677 3681
3678(defun ido-get-buffers-in-frames (&optional current) 3682(defun ido-get-buffers-in-frames (&optional current)
3679 ;; Return the list of buffers that are visible in the current frame. 3683 "Return the list of buffers that are visible in the current frame.
3680 ;; If optional argument `current' is given, restrict searching to the 3684If optional argument CURRENT is given, restrict searching to the current
3681 ;; current frame, rather than all frames, regardless of value of 3685frame, rather than all frames, regardless of value of `ido-all-frames'."
3682 ;; `ido-all-frames'.
3683 (let ((ido-bufs-in-frame nil)) 3686 (let ((ido-bufs-in-frame nil))
3684 (walk-windows 'ido-get-bufname nil 3687 (walk-windows 'ido-get-bufname nil
3685 (if current 3688 (if current
@@ -3688,7 +3691,7 @@ This is to make them appear as if they were \"virtual buffers\"."
3688 ido-bufs-in-frame)) 3691 ido-bufs-in-frame))
3689 3692
3690(defun ido-get-bufname (win) 3693(defun ido-get-bufname (win)
3691 ;; Used by `ido-get-buffers-in-frames' to walk through all windows 3694 "Used by `ido-get-buffers-in-frames' to walk through all windows."
3692 (let ((buf (buffer-name (window-buffer win)))) 3695 (let ((buf (buffer-name (window-buffer win))))
3693 (unless (or (member buf ido-bufs-in-frame) 3696 (unless (or (member buf ido-bufs-in-frame)
3694 (member buf ido-ignore-item-temp-list)) 3697 (member buf ido-ignore-item-temp-list))
@@ -3701,7 +3704,7 @@ This is to make them appear as if they were \"virtual buffers\"."
3701;;; FIND MATCHING ITEMS 3704;;; FIND MATCHING ITEMS
3702 3705
3703(defun ido-set-matches-1 (items &optional do-full) 3706(defun ido-set-matches-1 (items &optional do-full)
3704 ;; Return list of matches in items 3707 "Return list of matches in ITEMS."
3705 (let* ((case-fold-search ido-case-fold) 3708 (let* ((case-fold-search ido-case-fold)
3706 (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) 3709 (slash (and (not ido-enable-prefix) (ido-final-slash ido-text)))
3707 (text (if slash (substring ido-text 0 -1) ido-text)) 3710 (text (if slash (substring ido-text 0 -1) ido-text))
@@ -3789,13 +3792,13 @@ This is to make them appear as if they were \"virtual buffers\"."
3789 3792
3790 3793
3791(defun ido-set-matches () 3794(defun ido-set-matches ()
3792 ;; Set `ido-matches' to the list of items matching prompt 3795 "Set `ido-matches' to the list of items matching prompt."
3793 (when ido-rescan 3796 (when ido-rescan
3794 (setq ido-matches (ido-set-matches-1 (reverse ido-cur-list) (not ido-rotate)) 3797 (setq ido-matches (ido-set-matches-1 (reverse ido-cur-list) (not ido-rotate))
3795 ido-rotate nil))) 3798 ido-rotate nil)))
3796 3799
3797(defun ido-ignore-item-p (name re-list &optional ignore-ext) 3800(defun ido-ignore-item-p (name re-list &optional ignore-ext)
3798 ;; Return t if the buffer or file NAME should be ignored. 3801 "Return t if the buffer or file NAME should be ignored."
3799 (or (member name ido-ignore-item-temp-list) 3802 (or (member name ido-ignore-item-temp-list)
3800 (and 3803 (and
3801 ido-process-ignore-lists re-list 3804 ido-process-ignore-lists re-list
@@ -3835,7 +3838,7 @@ This is to make them appear as if they were \"virtual buffers\"."
3835(defvar ido-change-word-sub) 3838(defvar ido-change-word-sub)
3836 3839
3837(defun ido-find-common-substring (items subs) 3840(defun ido-find-common-substring (items subs)
3838 ;; Return common string following SUBS in each element of ITEMS. 3841 "Return common string following SUBS in each element of ITEMS."
3839 (let (res 3842 (let (res
3840 alist 3843 alist
3841 ido-change-word-sub) 3844 ido-change-word-sub)
@@ -3855,8 +3858,8 @@ This is to make them appear as if they were \"virtual buffers\"."
3855 comp)))) 3858 comp))))
3856 3859
3857(defun ido-word-matching-substring (word) 3860(defun ido-word-matching-substring (word)
3858 ;; Return part of WORD before 1st match to `ido-change-word-sub'. 3861 "Return part of WORD before first match to `ido-change-word-sub'.
3859 ;; If `ido-change-word-sub' cannot be found in WORD, return nil. 3862If `ido-change-word-sub' cannot be found in WORD, return nil."
3860 (let ((case-fold-search ido-case-fold)) 3863 (let ((case-fold-search ido-case-fold))
3861 (let ((m (string-match ido-change-word-sub (ido-name word)))) 3864 (let ((m (string-match ido-change-word-sub (ido-name word))))
3862 (if m 3865 (if m
@@ -3865,7 +3868,7 @@ This is to make them appear as if they were \"virtual buffers\"."
3865 nil)))) 3868 nil))))
3866 3869
3867(defun ido-makealist (res) 3870(defun ido-makealist (res)
3868 ;; Return dotted pair (RES . 1). 3871 "Return dotted pair (RES . 1)."
3869 (cons res 1)) 3872 (cons res 1))
3870 3873
3871(defun ido-choose-completion-string (choice &rest ignored) 3874(defun ido-choose-completion-string (choice &rest ignored)
@@ -4048,8 +4051,8 @@ Record command in `command-history' if optional RECORD is non-nil."
4048 4051
4049 4052
4050(defun ido-buffer-window-other-frame (buffer) 4053(defun ido-buffer-window-other-frame (buffer)
4051 ;; Return window pointer if BUFFER is visible in another frame. 4054 "Return window pointer if BUFFER is visible in another frame.
4052 ;; If BUFFER is visible in the current frame, return nil. 4055If BUFFER is visible in the current frame, return nil."
4053 (let ((blist (ido-get-buffers-in-frames 'current))) 4056 (let ((blist (ido-get-buffers-in-frames 'current)))
4054 ;;If the buffer is visible in current frame, return nil 4057 ;;If the buffer is visible in current frame, return nil
4055 (if (member buffer blist) 4058 (if (member buffer blist)
@@ -4533,9 +4536,8 @@ For details of keybindings, see `ido-find-file'."
4533 )))) 4536 ))))
4534 4537
4535(defun ido-completions (name) 4538(defun ido-completions (name)
4536 ;; Return the string that is displayed after the user's text. 4539 "Return the string that is displayed after the user's text.
4537 ;; Modified from `icomplete-completions'. 4540Modified from `icomplete-completions'."
4538
4539 (let* ((comps ido-matches) 4541 (let* ((comps ido-matches)
4540 (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1) 4542 (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
4541 ido-merged-indicator)) 4543 ido-merged-indicator))
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 610cc3ea364..4280a49af6e 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -167,7 +167,7 @@ This variable is buffer-local.")
167 167
168(defvar ielm-map 168(defvar ielm-map
169 (let ((map (make-sparse-keymap))) 169 (let ((map (make-sparse-keymap)))
170 (define-key map "\t" 'comint-dynamic-complete) 170 (define-key map "\t" 'completion-at-point)
171 (define-key map "\C-m" 'ielm-return) 171 (define-key map "\C-m" 'ielm-return)
172 (define-key map "\C-j" 'ielm-send-input) 172 (define-key map "\C-j" 'ielm-send-input)
173 (define-key map "\e\C-x" 'eval-defun) ; for consistency with 173 (define-key map "\e\C-x" 'eval-defun) ; for consistency with
@@ -209,12 +209,13 @@ This variable is buffer-local.")
209 209
210(defun ielm-complete-symbol nil 210(defun ielm-complete-symbol nil
211 "Complete the Lisp symbol before point." 211 "Complete the Lisp symbol before point."
212 ;; A wrapper for lisp-complete symbol that returns non-nil if 212 ;; A wrapper for completion-at-point that returns non-nil if
213 ;; completion has occurred 213 ;; completion has occurred
214 (let* ((btick (buffer-modified-tick)) 214 (let* ((btick (buffer-modified-tick))
215 (cbuffer (get-buffer "*Completions*")) 215 (cbuffer (get-buffer "*Completions*"))
216 (ctick (and cbuffer (buffer-modified-tick cbuffer)))) 216 (ctick (and cbuffer (buffer-modified-tick cbuffer)))
217 (lisp-complete-symbol) 217 (completion-at-point-functions '(lisp-completion-at-point)))
218 (completion-at-point)
218 ;; completion has occurred if: 219 ;; completion has occurred if:
219 (or 220 (or
220 ;; the buffer has been modified 221 ;; the buffer has been modified
@@ -461,7 +462,7 @@ Uses the interface provided by `comint-mode' (which see).
461 Inputs longer than one line are moved to the line following the 462 Inputs longer than one line are moved to the line following the
462 prompt (but see variable `ielm-dynamic-multiline-inputs'). 463 prompt (but see variable `ielm-dynamic-multiline-inputs').
463 464
464* \\[comint-dynamic-complete] completes Lisp symbols (or filenames, within strings), 465* \\[completion-at-point] completes Lisp symbols (or filenames, within strings),
465 or indents the line if there is nothing to complete. 466 or indents the line if there is nothing to complete.
466 467
467The current working buffer may be changed (with a call to `set-buffer', 468The current working buffer may be changed (with a call to `set-buffer',
@@ -498,7 +499,7 @@ Customized bindings may be defined in `ielm-map', which currently contains:
498 (set (make-local-variable 'paragraph-start) comint-prompt-regexp) 499 (set (make-local-variable 'paragraph-start) comint-prompt-regexp)
499 (setq comint-input-sender 'ielm-input-sender) 500 (setq comint-input-sender 'ielm-input-sender)
500 (setq comint-process-echoes nil) 501 (setq comint-process-echoes nil)
501 (set (make-local-variable 'comint-dynamic-complete-functions) 502 (set (make-local-variable 'completion-at-point-functions)
502 '(ielm-tab comint-replace-by-expanded-history 503 '(ielm-tab comint-replace-by-expanded-history
503 ielm-complete-filename ielm-complete-symbol)) 504 ielm-complete-filename ielm-complete-symbol))
504 (set (make-local-variable 'ielm-prompt-internal) ielm-prompt) 505 (set (make-local-variable 'ielm-prompt-internal) ielm-prompt)
@@ -513,8 +514,6 @@ Customized bindings may be defined in `ielm-map', which currently contains:
513 (set (make-local-variable 'indent-line-function) 'ielm-indent-line) 514 (set (make-local-variable 'indent-line-function) 'ielm-indent-line)
514 (set (make-local-variable 'ielm-working-buffer) (current-buffer)) 515 (set (make-local-variable 'ielm-working-buffer) (current-buffer))
515 (set (make-local-variable 'fill-paragraph-function) 'lisp-fill-paragraph) 516 (set (make-local-variable 'fill-paragraph-function) 'lisp-fill-paragraph)
516 (add-hook 'completion-at-point-functions
517 'lisp-completion-at-point nil 'local)
518 517
519 ;; Value holders 518 ;; Value holders
520 (set (make-local-variable '*) nil) 519 (set (make-local-variable '*) nil)
diff --git a/lisp/image.el b/lisp/image.el
index ec7b41bf126..804dc3af5ea 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -624,7 +624,12 @@ in which case you might want to use `image-default-frame-delay'."
624 (setq delay image-default-frame-delay)) 624 (setq delay image-default-frame-delay))
625 (cons images delay)))) 625 (cons images delay))))
626 626
627(define-obsolete-function-alias 'image-animated-p 'image-multi-frame-p "24.4") 627(defun image-animated-p (image)
628 "Like `image-multi-frame-p', but returns nil if no delay is specified."
629 (let ((multi (image-multi-frame-p image)))
630 (and (cdr multi) multi)))
631
632(make-obsolete 'image-animated-p 'image-multi-frame-p "24.4")
628 633
629;; "Destructively"? 634;; "Destructively"?
630(defun image-animate (image &optional index limit) 635(defun image-animate (image &optional index limit)
diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index a31a90d9cfb..48487b850df 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -1508,6 +1508,7 @@ for decoding and encoding files, process I/O, etc."
1508(setq file-coding-system-alist 1508(setq file-coding-system-alist
1509 (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) 1509 (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
1510 '(("\\.elc\\'" . utf-8-emacs) 1510 '(("\\.elc\\'" . utf-8-emacs)
1511 ("\\.el\\'" . utf-8)
1511 ("\\.utf\\(-8\\)?\\'" . utf-8) 1512 ("\\.utf\\(-8\\)?\\'" . utf-8)
1512 ("\\.xml\\'" . xml-find-file-coding-system) 1513 ("\\.xml\\'" . xml-find-file-coding-system)
1513 ;; We use raw-text for reading loaddefs.el so that if it 1514 ;; We use raw-text for reading loaddefs.el so that if it
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5bf2818fadc..d9f8b0891e4 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -198,7 +198,7 @@ skips this match and continues searching for the next match.
198When the list of predicates is empty, `run-hook-with-args-until-failure' 198When the list of predicates is empty, `run-hook-with-args-until-failure'
199returns non-nil that means that the found match is accepted. 199returns non-nil that means that the found match is accepted.
200The property `isearch-message-prefix' put on the predicate's symbol 200The property `isearch-message-prefix' put on the predicate's symbol
201specifies the prefix string displyed in the search message.") 201specifies the prefix string displayed in the search message.")
202(define-obsolete-variable-alias 'isearch-filter-predicate 202(define-obsolete-variable-alias 'isearch-filter-predicate
203 'isearch-filter-predicates 203 'isearch-filter-predicates
204 "24.4") 204 "24.4")
@@ -514,6 +514,7 @@ This is like `describe-bindings', but displays only Isearch keys."
514 (define-key map "\M-e" 'isearch-edit-string) 514 (define-key map "\M-e" 'isearch-edit-string)
515 515
516 (define-key map "\M-sc" 'isearch-toggle-case-fold) 516 (define-key map "\M-sc" 'isearch-toggle-case-fold)
517 (define-key map "\M-si" 'isearch-toggle-invisible)
517 (define-key map "\M-sr" 'isearch-toggle-regexp) 518 (define-key map "\M-sr" 'isearch-toggle-regexp)
518 (define-key map "\M-sw" 'isearch-toggle-word) 519 (define-key map "\M-sw" 'isearch-toggle-word)
519 (define-key map "\M-s_" 'isearch-toggle-symbol) 520 (define-key map "\M-s_" 'isearch-toggle-symbol)
@@ -602,6 +603,11 @@ Each set is a vector of the form:
602;; case in the search string is ignored. 603;; case in the search string is ignored.
603(defvar isearch-case-fold-search nil) 604(defvar isearch-case-fold-search nil)
604 605
606;; search-invisible while searching.
607;; either nil, t, or 'open. 'open means the same as t except that
608;; opens hidden overlays.
609(defvar isearch-invisible search-invisible)
610
605(defvar isearch-last-case-fold-search nil) 611(defvar isearch-last-case-fold-search nil)
606 612
607;; Used to save default value while isearch is active 613;; Used to save default value while isearch is active
@@ -661,6 +667,7 @@ Each set is a vector of the form:
661(define-key esc-map "\C-r" 'isearch-backward-regexp) 667(define-key esc-map "\C-r" 'isearch-backward-regexp)
662(define-key search-map "w" 'isearch-forward-word) 668(define-key search-map "w" 'isearch-forward-word)
663(define-key search-map "_" 'isearch-forward-symbol) 669(define-key search-map "_" 'isearch-forward-symbol)
670(define-key search-map "." 'isearch-forward-symbol-at-point)
664 671
665;; Entry points to isearch-mode. 672;; Entry points to isearch-mode.
666 673
@@ -700,6 +707,7 @@ If you try to exit with the search string still empty, it invokes
700 nonincremental search. 707 nonincremental search.
701 708
702Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity. 709Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity.
710Type \\[isearch-toggle-invisible] to toggle search in invisible text.
703Type \\[isearch-toggle-regexp] to toggle regular-expression mode. 711Type \\[isearch-toggle-regexp] to toggle regular-expression mode.
704Type \\[isearch-toggle-word] to toggle word mode. 712Type \\[isearch-toggle-word] to toggle word mode.
705Type \\[isearch-toggle-symbol] to toggle symbol mode. 713Type \\[isearch-toggle-symbol] to toggle symbol mode.
@@ -799,6 +807,25 @@ as a regexp. See the command `isearch-forward' for more information."
799 (interactive "P\np") 807 (interactive "P\np")
800 (isearch-mode nil (null not-regexp) nil (not no-recursive-edit))) 808 (isearch-mode nil (null not-regexp) nil (not no-recursive-edit)))
801 809
810(defun isearch-forward-symbol-at-point ()
811 "Do incremental search forward for a symbol found near point.
812Like ordinary incremental search except that the symbol found at point
813is added to the search string initially as a regexp surrounded
814by symbol boundary constructs \\_< and \\_>.
815See the command `isearch-forward-symbol' for more information."
816 (interactive)
817 (isearch-forward-symbol nil 1)
818 (let ((bounds (find-tag-default-bounds)))
819 (cond
820 (bounds
821 (when (< (car bounds) (point))
822 (goto-char (car bounds)))
823 (isearch-yank-string
824 (buffer-substring-no-properties (car bounds) (cdr bounds))))
825 (t
826 (setq isearch-error "No symbol at point")
827 (isearch-update)))))
828
802 829
803;; isearch-mode only sets up incremental search for the minor mode. 830;; isearch-mode only sets up incremental search for the minor mode.
804;; All the work is done by the isearch-mode commands. 831;; All the work is done by the isearch-mode commands.
@@ -836,6 +863,7 @@ convert the search string to a regexp used by regexp search functions."
836 isearch-op-fun op-fun 863 isearch-op-fun op-fun
837 isearch-last-case-fold-search isearch-case-fold-search 864 isearch-last-case-fold-search isearch-case-fold-search
838 isearch-case-fold-search case-fold-search 865 isearch-case-fold-search case-fold-search
866 isearch-invisible search-invisible
839 isearch-string "" 867 isearch-string ""
840 isearch-message "" 868 isearch-message ""
841 isearch-cmds nil 869 isearch-cmds nil
@@ -1474,7 +1502,8 @@ value of the variable `isearch-regexp-lax-whitespace'."
1474 (isearch-update)) 1502 (isearch-update))
1475 1503
1476(defun isearch-toggle-case-fold () 1504(defun isearch-toggle-case-fold ()
1477 "Toggle case folding in searching on or off." 1505 "Toggle case folding in searching on or off.
1506Toggles the value of the variable `isearch-case-fold-search'."
1478 (interactive) 1507 (interactive)
1479 (setq isearch-case-fold-search 1508 (setq isearch-case-fold-search
1480 (if isearch-case-fold-search nil 'yes)) 1509 (if isearch-case-fold-search nil 'yes))
@@ -1487,6 +1516,23 @@ value of the variable `isearch-regexp-lax-whitespace'."
1487 (sit-for 1) 1516 (sit-for 1)
1488 (isearch-update)) 1517 (isearch-update))
1489 1518
1519(defun isearch-toggle-invisible ()
1520 "Toggle searching in invisible text on or off.
1521Toggles the variable `isearch-invisible' between values
1522nil and a non-nil value of the option `search-invisible'
1523\(or `open' if `search-invisible' is nil)."
1524 (interactive)
1525 (setq isearch-invisible
1526 (if isearch-invisible nil (or search-invisible 'open)))
1527 (let ((message-log-max nil))
1528 (message "%s%s [match %svisible text]"
1529 (isearch-message-prefix nil isearch-nonincremental)
1530 isearch-message
1531 (if isearch-invisible "in" "")))
1532 (setq isearch-success t isearch-adjusted t)
1533 (sit-for 1)
1534 (isearch-update))
1535
1490 1536
1491;; Word search 1537;; Word search
1492 1538
@@ -1622,6 +1668,7 @@ way to run word replacements from Isearch is `M-s w ... M-%'."
1622 ;; set `search-upper-case' to nil to not call 1668 ;; set `search-upper-case' to nil to not call
1623 ;; `isearch-no-upper-case-p' in `perform-replace' 1669 ;; `isearch-no-upper-case-p' in `perform-replace'
1624 (search-upper-case nil) 1670 (search-upper-case nil)
1671 (search-invisible isearch-invisible)
1625 (replace-lax-whitespace 1672 (replace-lax-whitespace
1626 isearch-lax-whitespace) 1673 isearch-lax-whitespace)
1627 (replace-regexp-lax-whitespace 1674 (replace-regexp-lax-whitespace
@@ -1725,7 +1772,10 @@ and reads its face argument using `hi-lock-read-face-name'."
1725 (isearch-done nil t) 1772 (isearch-done nil t)
1726 (isearch-clean-overlays)) 1773 (isearch-clean-overlays))
1727 (require 'hi-lock nil t) 1774 (require 'hi-lock nil t)
1728 (let ((string (cond (isearch-regexp isearch-string) 1775 (let ((regexp (cond ((functionp isearch-word)
1776 (funcall isearch-word isearch-string))
1777 (isearch-word (word-search-regexp isearch-string))
1778 (isearch-regexp isearch-string)
1729 ((if (and (eq isearch-case-fold-search t) 1779 ((if (and (eq isearch-case-fold-search t)
1730 search-upper-case) 1780 search-upper-case)
1731 (isearch-no-upper-case-p 1781 (isearch-no-upper-case-p
@@ -1741,7 +1791,7 @@ and reads its face argument using `hi-lock-read-face-name'."
1741 (regexp-quote s)))) 1791 (regexp-quote s))))
1742 isearch-string "")) 1792 isearch-string ""))
1743 (t (regexp-quote isearch-string))))) 1793 (t (regexp-quote isearch-string)))))
1744 (hi-lock-face-buffer string (hi-lock-read-face-name))) 1794 (hi-lock-face-buffer regexp (hi-lock-read-face-name)))
1745 (and isearch-recursive-edit (exit-recursive-edit))) 1795 (and isearch-recursive-edit (exit-recursive-edit)))
1746 1796
1747 1797
@@ -2102,6 +2152,15 @@ If nil, scrolling commands will first cancel Isearch mode."
2102 :type 'boolean 2152 :type 'boolean
2103 :group 'isearch) 2153 :group 'isearch)
2104 2154
2155(defcustom isearch-allow-prefix t
2156 "Whether prefix arguments are allowed during incremental search.
2157If non-nil, entering a prefix argument will not terminate the
2158search. This option is ignored \(presumed t) when
2159`isearch-allow-scroll' is set."
2160 :version "24.4"
2161 :type 'boolean
2162 :group 'isearch)
2163
2105(defun isearch-string-out-of-window (isearch-point) 2164(defun isearch-string-out-of-window (isearch-point)
2106 "Test whether the search string is currently outside of the window. 2165 "Test whether the search string is currently outside of the window.
2107Return nil if it's completely visible, or if point is visible, 2166Return nil if it's completely visible, or if point is visible,
@@ -2254,12 +2313,19 @@ Isearch mode."
2254 (setq prefix-arg arg) 2313 (setq prefix-arg arg)
2255 (apply 'isearch-unread keylist) 2314 (apply 'isearch-unread keylist)
2256 (isearch-edit-string)) 2315 (isearch-edit-string))
2257 ;; Handle a scrolling function. 2316 ;; Handle a scrolling function or prefix argument.
2258 ((and isearch-allow-scroll 2317 ((progn
2259 (progn (setq key (isearch-reread-key-sequence-naturally keylist)) 2318 (setq key (isearch-reread-key-sequence-naturally keylist)
2260 (setq keylist (listify-key-sequence key)) 2319 keylist (listify-key-sequence key)
2261 (setq main-event (aref key 0)) 2320 main-event (aref key 0))
2262 (setq scroll-command (isearch-lookup-scroll-key key)))) 2321 (or (and isearch-allow-scroll
2322 (setq scroll-command (isearch-lookup-scroll-key key)))
2323 (and isearch-allow-prefix
2324 (let (overriding-terminal-local-map)
2325 (setq scroll-command (key-binding key))
2326 (memq scroll-command
2327 '(universal-argument
2328 negative-argument digit-argument))))))
2263 ;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a 2329 ;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a
2264 ;; complete key sequence, possibly as modified by function-key-map, 2330 ;; complete key sequence, possibly as modified by function-key-map,
2265 ;; not merely the one or two event fragment which invoked 2331 ;; not merely the one or two event fragment which invoked
@@ -2638,9 +2704,10 @@ update the match data, and return point."
2638 (setq isearch-case-fold-search 2704 (setq isearch-case-fold-search
2639 (isearch-no-upper-case-p isearch-string isearch-regexp))) 2705 (isearch-no-upper-case-p isearch-string isearch-regexp)))
2640 (condition-case lossage 2706 (condition-case lossage
2641 (let ((inhibit-point-motion-hooks search-invisible) 2707 (let ((inhibit-point-motion-hooks isearch-invisible)
2642 (inhibit-quit nil) 2708 (inhibit-quit nil)
2643 (case-fold-search isearch-case-fold-search) 2709 (case-fold-search isearch-case-fold-search)
2710 (search-invisible isearch-invisible)
2644 (retry t)) 2711 (retry t))
2645 (setq isearch-error nil) 2712 (setq isearch-error nil)
2646 (while retry 2713 (while retry
@@ -2836,7 +2903,7 @@ determined by `isearch-range-invisible' unless invisible text can be
2836searched too when `search-invisible' is t." 2903searched too when `search-invisible' is t."
2837 (or (eq search-invisible t) 2904 (or (eq search-invisible t)
2838 (not (isearch-range-invisible beg end)))) 2905 (not (isearch-range-invisible beg end))))
2839(make-obsolete 'isearch-filter-visible 'search-invisible "24.4") 2906(make-obsolete 'isearch-filter-visible 'isearch-invisible "24.4")
2840 2907
2841 2908
2842;; General utilities 2909;; General utilities
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index d2b97986581..6cd20f9c8ca 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -68,7 +68,7 @@ should return a grid vector array that is the new solution.
68;;;*** 68;;;***
69 69
70;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el" 70;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
71;;;;;; (20709 26818 907104 0)) 71;;;;;; (20874 62962 290468 0))
72;;; Generated autoloads from progmodes/ada-mode.el 72;;; Generated autoloads from progmodes/ada-mode.el
73 73
74(autoload 'ada-add-extensions "ada-mode" "\ 74(autoload 'ada-add-extensions "ada-mode" "\
@@ -474,7 +474,7 @@ A replacement function for `newline-and-indent', aligning as it goes.
474 474
475;;;### (autoloads (outlineify-sticky allout-mode allout-mode-p allout-auto-activation 475;;;### (autoloads (outlineify-sticky allout-mode allout-mode-p allout-auto-activation
476;;;;;; allout-setup allout-auto-activation-helper) "allout" "allout.el" 476;;;;;; allout-setup allout-auto-activation-helper) "allout" "allout.el"
477;;;;;; (20709 26818 907104 0)) 477;;;;;; (20892 39729 858825 0))
478;;; Generated autoloads from allout.el 478;;; Generated autoloads from allout.el
479 479
480(autoload 'allout-auto-activation-helper "allout" "\ 480(autoload 'allout-auto-activation-helper "allout" "\
@@ -1245,8 +1245,8 @@ Entering array mode calls the function `array-mode-hook'.
1245 1245
1246;;;*** 1246;;;***
1247 1247
1248;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20777 1248;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20891
1249;;;;;; 63161 848428 0)) 1249;;;;;; 18859 893295 0))
1250;;; Generated autoloads from textmodes/artist.el 1250;;; Generated autoloads from textmodes/artist.el
1251 1251
1252(autoload 'artist-mode "artist" "\ 1252(autoload 'artist-mode "artist" "\
@@ -1554,7 +1554,7 @@ This is similar to `autoarg-mode' but rebinds the keypad keys
1554;;;*** 1554;;;***
1555 1555
1556;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el" 1556;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el"
1557;;;;;; (20709 26818 907104 0)) 1557;;;;;; (20874 62962 290468 0))
1558;;; Generated autoloads from progmodes/autoconf.el 1558;;; Generated autoloads from progmodes/autoconf.el
1559 1559
1560(autoload 'autoconf-mode "autoconf" "\ 1560(autoload 'autoconf-mode "autoconf" "\
@@ -1605,7 +1605,7 @@ insert a template for the file depending on the mode of the buffer.
1605 1605
1606;;;### (autoloads (batch-update-autoloads update-directory-autoloads 1606;;;### (autoloads (batch-update-autoloads update-directory-autoloads
1607;;;;;; update-file-autoloads) "autoload" "emacs-lisp/autoload.el" 1607;;;;;; update-file-autoloads) "autoload" "emacs-lisp/autoload.el"
1608;;;;;; (20709 26818 907104 0)) 1608;;;;;; (20879 27694 495748 0))
1609;;; Generated autoloads from emacs-lisp/autoload.el 1609;;; Generated autoloads from emacs-lisp/autoload.el
1610 1610
1611(put 'generated-autoload-file 'safe-local-variable 'stringp) 1611(put 'generated-autoload-file 'safe-local-variable 'stringp)
@@ -1656,7 +1656,7 @@ should be non-nil).
1656 1656
1657;;;### (autoloads (global-auto-revert-mode turn-on-auto-revert-tail-mode 1657;;;### (autoloads (global-auto-revert-mode turn-on-auto-revert-tail-mode
1658;;;;;; auto-revert-tail-mode turn-on-auto-revert-mode auto-revert-mode) 1658;;;;;; auto-revert-tail-mode turn-on-auto-revert-mode auto-revert-mode)
1659;;;;;; "autorevert" "autorevert.el" (20831 63016 738579 0)) 1659;;;;;; "autorevert" "autorevert.el" (20893 60586 188550 0))
1660;;; Generated autoloads from autorevert.el 1660;;; Generated autoloads from autorevert.el
1661 1661
1662(autoload 'auto-revert-mode "autorevert" "\ 1662(autoload 'auto-revert-mode "autorevert" "\
@@ -2112,7 +2112,7 @@ a reflection.
2112;;;;;; bookmark-save bookmark-write bookmark-delete bookmark-insert 2112;;;;;; bookmark-save bookmark-write bookmark-delete bookmark-insert
2113;;;;;; bookmark-rename bookmark-insert-location bookmark-relocate 2113;;;;;; bookmark-rename bookmark-insert-location bookmark-relocate
2114;;;;;; bookmark-jump-other-window bookmark-jump bookmark-set) "bookmark" 2114;;;;;; bookmark-jump-other-window bookmark-jump bookmark-set) "bookmark"
2115;;;;;; "bookmark.el" (20849 6570 598687 0)) 2115;;;;;; "bookmark.el" (20874 65006 176325 548000))
2116;;; Generated autoloads from bookmark.el 2116;;; Generated autoloads from bookmark.el
2117 (define-key ctl-x-r-map "b" 'bookmark-jump) 2117 (define-key ctl-x-r-map "b" 'bookmark-jump)
2118 (define-key ctl-x-r-map "m" 'bookmark-set) 2118 (define-key ctl-x-r-map "m" 'bookmark-set)
@@ -2313,7 +2313,7 @@ Incremental search of bookmarks, hiding the non-matches as we go.
2313;;;;;; browse-url-xdg-open browse-url-at-mouse browse-url-at-point 2313;;;;;; browse-url-xdg-open browse-url-at-mouse browse-url-at-point
2314;;;;;; browse-url browse-url-of-region browse-url-of-dired-file 2314;;;;;; browse-url browse-url-of-region browse-url-of-dired-file
2315;;;;;; browse-url-of-buffer browse-url-of-file browse-url-browser-function) 2315;;;;;; browse-url-of-buffer browse-url-of-file browse-url-browser-function)
2316;;;;;; "browse-url" "net/browse-url.el" (20709 26818 907104 0)) 2316;;;;;; "browse-url" "net/browse-url.el" (20874 62962 290468 0))
2317;;; Generated autoloads from net/browse-url.el 2317;;; Generated autoloads from net/browse-url.el
2318 2318
2319(defvar browse-url-browser-function 'browse-url-default-browser "\ 2319(defvar browse-url-browser-function 'browse-url-default-browser "\
@@ -2716,7 +2716,7 @@ Like `bug-reference-mode', but only buttonize in comments and strings.
2716;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile 2716;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile
2717;;;;;; compile-defun byte-compile-file byte-recompile-directory 2717;;;;;; compile-defun byte-compile-file byte-recompile-directory
2718;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning) 2718;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning)
2719;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20851 48294 960738 0)) 2719;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20900 33838 319219 0))
2720;;; Generated autoloads from emacs-lisp/bytecomp.el 2720;;; Generated autoloads from emacs-lisp/bytecomp.el
2721(put 'byte-compile-dynamic 'safe-local-variable 'booleanp) 2721(put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
2722(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) 2722(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@@ -2971,8 +2971,8 @@ See Info node `(calc)Defining Functions'.
2971 2971
2972;;;*** 2972;;;***
2973 2973
2974;;;### (autoloads (calculator) "calculator" "calculator.el" (20709 2974;;;### (autoloads (calculator) "calculator" "calculator.el" (20891
2975;;;;;; 26818 907104 0)) 2975;;;;;; 18859 893295 0))
2976;;; Generated autoloads from calculator.el 2976;;; Generated autoloads from calculator.el
2977 2977
2978(autoload 'calculator "calculator" "\ 2978(autoload 'calculator "calculator" "\
@@ -3206,7 +3206,7 @@ the absolute file name of the file if STYLE-NAME is nil.
3206 3206
3207;;;### (autoloads (awk-mode pike-mode idl-mode java-mode objc-mode 3207;;;### (autoloads (awk-mode pike-mode idl-mode java-mode objc-mode
3208;;;;;; c++-mode c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el" 3208;;;;;; c++-mode c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el"
3209;;;;;; (20845 9511 656701 0)) 3209;;;;;; (20903 56820 471502 429000))
3210;;; Generated autoloads from progmodes/cc-mode.el 3210;;; Generated autoloads from progmodes/cc-mode.el
3211 3211
3212(autoload 'c-initialize-cc-mode "cc-mode" "\ 3212(autoload 'c-initialize-cc-mode "cc-mode" "\
@@ -3434,8 +3434,8 @@ and exists only for compatibility reasons.
3434 3434
3435;;;*** 3435;;;***
3436 3436
3437;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (20709 26818 3437;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (20904 30886
3438;;;;;; 907104 0)) 3438;;;;;; 391458 0))
3439;;; Generated autoloads from progmodes/cc-vars.el 3439;;; Generated autoloads from progmodes/cc-vars.el
3440(put 'c-basic-offset 'safe-local-variable 'integerp) 3440(put 'c-basic-offset 'safe-local-variable 'integerp)
3441(put 'c-backslash-column 'safe-local-variable 'integerp) 3441(put 'c-backslash-column 'safe-local-variable 'integerp)
@@ -3445,7 +3445,7 @@ and exists only for compatibility reasons.
3445 3445
3446;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program 3446;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program
3447;;;;;; declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el" 3447;;;;;; declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el"
3448;;;;;; (20709 26818 907104 0)) 3448;;;;;; (20884 7264 412929 442000))
3449;;; Generated autoloads from international/ccl.el 3449;;; Generated autoloads from international/ccl.el
3450 3450
3451(autoload 'ccl-compile "ccl" "\ 3451(autoload 'ccl-compile "ccl" "\
@@ -3776,7 +3776,7 @@ Returns non-nil if any false statements are found.
3776;;;;;; checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer 3776;;;;;; checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
3777;;;;;; checkdoc-eval-current-buffer checkdoc-message-interactive 3777;;;;;; checkdoc-eval-current-buffer checkdoc-message-interactive
3778;;;;;; checkdoc-interactive checkdoc checkdoc-list-of-strings-p) 3778;;;;;; checkdoc-interactive checkdoc checkdoc-list-of-strings-p)
3779;;;;;; "checkdoc" "emacs-lisp/checkdoc.el" (20709 26818 907104 0)) 3779;;;;;; "checkdoc" "emacs-lisp/checkdoc.el" (20893 60586 188550 0))
3780;;; Generated autoloads from emacs-lisp/checkdoc.el 3780;;; Generated autoloads from emacs-lisp/checkdoc.el
3781(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp) 3781(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp)
3782(put 'checkdoc-force-history-flag 'safe-local-variable 'booleanp) 3782(put 'checkdoc-force-history-flag 'safe-local-variable 'booleanp)
@@ -4050,7 +4050,7 @@ and runs the normal hook `command-history-hook'.
4050;;;*** 4050;;;***
4051 4051
4052;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el" 4052;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el"
4053;;;;;; (20709 26818 907104 0)) 4053;;;;;; (20879 27694 495748 0))
4054;;; Generated autoloads from emacs-lisp/cl-indent.el 4054;;; Generated autoloads from emacs-lisp/cl-indent.el
4055 4055
4056(autoload 'common-lisp-indent-function "cl-indent" "\ 4056(autoload 'common-lisp-indent-function "cl-indent" "\
@@ -4221,7 +4221,7 @@ If FRAME cannot display COLOR, return nil.
4221;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list 4221;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
4222;;;;;; comint-redirect-send-command-to-process comint-redirect-send-command 4222;;;;;; comint-redirect-send-command-to-process comint-redirect-send-command
4223;;;;;; comint-run make-comint make-comint-in-buffer) "comint" "comint.el" 4223;;;;;; comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
4224;;;;;; (20864 60326 774861 0)) 4224;;;;;; (20896 36774 886399 0))
4225;;; Generated autoloads from comint.el 4225;;; Generated autoloads from comint.el
4226 4226
4227(defvar comint-output-filter-functions '(ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\ 4227(defvar comint-output-filter-functions '(ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
@@ -4321,7 +4321,7 @@ REGEXP-GROUP is the regular expression group in REGEXP to use.
4321;;;*** 4321;;;***
4322 4322
4323;;;### (autoloads (compare-windows) "compare-w" "vc/compare-w.el" 4323;;;### (autoloads (compare-windows) "compare-w" "vc/compare-w.el"
4324;;;;;; (20721 17977 14204 0)) 4324;;;;;; (20871 33574 214287 0))
4325;;; Generated autoloads from vc/compare-w.el 4325;;; Generated autoloads from vc/compare-w.el
4326 4326
4327(autoload 'compare-windows "compare-w" "\ 4327(autoload 'compare-windows "compare-w" "\
@@ -4539,7 +4539,7 @@ This is the value of `next-error-function' in Compilation buffers.
4539;;;*** 4539;;;***
4540 4540
4541;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el" 4541;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el"
4542;;;;;; (20709 26818 907104 0)) 4542;;;;;; (20884 7264 412929 442000))
4543;;; Generated autoloads from completion.el 4543;;; Generated autoloads from completion.el
4544 4544
4545(defvar dynamic-completion-mode nil "\ 4545(defvar dynamic-completion-mode nil "\
@@ -4792,7 +4792,7 @@ If FIX is non-nil, run `copyright-fix-years' instead.
4792;;;*** 4792;;;***
4793 4793
4794;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode) 4794;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
4795;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20763 30266 231060 4795;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20901 54695 989166
4796;;;;;; 0)) 4796;;;;;; 0))
4797;;; Generated autoloads from progmodes/cperl-mode.el 4797;;; Generated autoloads from progmodes/cperl-mode.el
4798(put 'cperl-indent-level 'safe-local-variable 'integerp) 4798(put 'cperl-indent-level 'safe-local-variable 'integerp)
@@ -4992,7 +4992,7 @@ Run a `perldoc' on the word around point.
4992;;;*** 4992;;;***
4993 4993
4994;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el" 4994;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el"
4995;;;;;; (20762 9398 526093 0)) 4995;;;;;; (20874 65006 672942 217000))
4996;;; Generated autoloads from progmodes/cpp.el 4996;;; Generated autoloads from progmodes/cpp.el
4997 4997
4998(autoload 'cpp-highlight-buffer "cpp" "\ 4998(autoload 'cpp-highlight-buffer "cpp" "\
@@ -5145,7 +5145,7 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings.
5145;;;;;; customize-mode customize customize-push-and-save customize-save-variable 5145;;;;;; customize-mode customize customize-push-and-save customize-save-variable
5146;;;;;; customize-set-variable customize-set-value custom-menu-sort-alphabetically 5146;;;;;; customize-set-variable customize-set-value custom-menu-sort-alphabetically
5147;;;;;; custom-buffer-sort-alphabetically custom-browse-sort-alphabetically) 5147;;;;;; custom-buffer-sort-alphabetically custom-browse-sort-alphabetically)
5148;;;;;; "cus-edit" "cus-edit.el" (20841 12463 538770 0)) 5148;;;;;; "cus-edit" "cus-edit.el" (20874 9766 437572 0))
5149;;; Generated autoloads from cus-edit.el 5149;;; Generated autoloads from cus-edit.el
5150 5150
5151(defvar custom-browse-sort-alphabetically nil "\ 5151(defvar custom-browse-sort-alphabetically nil "\
@@ -5634,8 +5634,8 @@ Create a new data-debug buffer with NAME.
5634 5634
5635;;;*** 5635;;;***
5636 5636
5637;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20709 5637;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20900
5638;;;;;; 26818 907104 0)) 5638;;;;;; 33838 319219 0))
5639;;; Generated autoloads from net/dbus.el 5639;;; Generated autoloads from net/dbus.el
5640 5640
5641(autoload 'dbus-handle-event "dbus" "\ 5641(autoload 'dbus-handle-event "dbus" "\
@@ -5905,7 +5905,7 @@ any selection.
5905;;;*** 5905;;;***
5906 5906
5907;;;### (autoloads (derived-mode-init-mode-variables define-derived-mode) 5907;;;### (autoloads (derived-mode-init-mode-variables define-derived-mode)
5908;;;;;; "derived" "emacs-lisp/derived.el" (20709 26818 907104 0)) 5908;;;;;; "derived" "emacs-lisp/derived.el" (20900 33838 319219 0))
5909;;; Generated autoloads from emacs-lisp/derived.el 5909;;; Generated autoloads from emacs-lisp/derived.el
5910 5910
5911(autoload 'define-derived-mode "derived" "\ 5911(autoload 'define-derived-mode "derived" "\
@@ -5972,7 +5972,7 @@ the first time the mode is used.
5972;;;*** 5972;;;***
5973 5973
5974;;;### (autoloads (describe-char describe-text-properties) "descr-text" 5974;;;### (autoloads (describe-char describe-text-properties) "descr-text"
5975;;;;;; "descr-text.el" (20764 51137 83502 0)) 5975;;;;;; "descr-text.el" (20875 30633 412173 0))
5976;;; Generated autoloads from descr-text.el 5976;;; Generated autoloads from descr-text.el
5977 5977
5978(autoload 'describe-text-properties "descr-text" "\ 5978(autoload 'describe-text-properties "descr-text" "\
@@ -6009,7 +6009,7 @@ relevant to POS.
6009;;;### (autoloads (desktop-revert desktop-save-in-desktop-dir desktop-change-dir 6009;;;### (autoloads (desktop-revert desktop-save-in-desktop-dir desktop-change-dir
6010;;;;;; desktop-load-default desktop-read desktop-remove desktop-save 6010;;;;;; desktop-load-default desktop-read desktop-remove desktop-save
6011;;;;;; desktop-clear desktop-locals-to-save desktop-save-mode) "desktop" 6011;;;;;; desktop-clear desktop-locals-to-save desktop-save-mode) "desktop"
6012;;;;;; "desktop.el" (20860 63270 684173 0)) 6012;;;;;; "desktop.el" (20866 42607 417304 513000))
6013;;; Generated autoloads from desktop.el 6013;;; Generated autoloads from desktop.el
6014 6014
6015(defvar desktop-save-mode nil "\ 6015(defvar desktop-save-mode nil "\
@@ -6232,7 +6232,7 @@ Deuglify broken Outlook (Express) articles and redisplay.
6232;;;*** 6232;;;***
6233 6233
6234;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib" 6234;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
6235;;;;;; "calendar/diary-lib.el" (20709 26818 907104 0)) 6235;;;;;; "calendar/diary-lib.el" (20879 27694 495748 0))
6236;;; Generated autoloads from calendar/diary-lib.el 6236;;; Generated autoloads from calendar/diary-lib.el
6237 6237
6238(autoload 'diary "diary-lib" "\ 6238(autoload 'diary "diary-lib" "\
@@ -6370,7 +6370,7 @@ Optional arguments are passed to `dig-invoke'.
6370 6370
6371;;;### (autoloads (dired-hide-details-mode dired-mode dired-noselect 6371;;;### (autoloads (dired-hide-details-mode dired-mode dired-noselect
6372;;;;;; dired-other-frame dired-other-window dired dired-listing-switches) 6372;;;;;; dired-other-frame dired-other-window dired dired-listing-switches)
6373;;;;;; "dired" "dired.el" (20784 36406 653593 0)) 6373;;;;;; "dired" "dired.el" (20900 33838 319219 0))
6374;;; Generated autoloads from dired.el 6374;;; Generated autoloads from dired.el
6375 6375
6376(defvar dired-listing-switches (purecopy "-al") "\ 6376(defvar dired-listing-switches (purecopy "-al") "\
@@ -6730,8 +6730,8 @@ Locate SOA record and increment the serial field.
6730;;;*** 6730;;;***
6731 6731
6732;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode-maybe 6732;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode-maybe
6733;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (20845 6733;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (20899
6734;;;;;; 9511 656701 0)) 6734;;;;;; 12965 791908 0))
6735;;; Generated autoloads from doc-view.el 6735;;; Generated autoloads from doc-view.el
6736 6736
6737(autoload 'doc-view-mode-p "doc-view" "\ 6737(autoload 'doc-view-mode-p "doc-view" "\
@@ -6805,8 +6805,8 @@ strings when pressed twice. See `double-map' for details.
6805 6805
6806;;;*** 6806;;;***
6807 6807
6808;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20709 26818 6808;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20900 33838
6809;;;;;; 907104 0)) 6809;;;;;; 319219 0))
6810;;; Generated autoloads from play/dunnet.el 6810;;; Generated autoloads from play/dunnet.el
6811 6811
6812(autoload 'dunnet "dunnet" "\ 6812(autoload 'dunnet "dunnet" "\
@@ -6818,7 +6818,7 @@ Switch to *dungeon* buffer and start game.
6818 6818
6819;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap 6819;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
6820;;;;;; define-globalized-minor-mode define-minor-mode) "easy-mmode" 6820;;;;;; define-globalized-minor-mode define-minor-mode) "easy-mmode"
6821;;;;;; "emacs-lisp/easy-mmode.el" (20780 39352 990623 0)) 6821;;;;;; "emacs-lisp/easy-mmode.el" (20900 33838 319219 0))
6822;;; Generated autoloads from emacs-lisp/easy-mmode.el 6822;;; Generated autoloads from emacs-lisp/easy-mmode.el
6823 6823
6824(defalias 'easy-mmode-define-minor-mode 'define-minor-mode) 6824(defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
@@ -7684,8 +7684,8 @@ Toggle edebugging of all forms.
7684;;;;;; ediff-merge-directories-with-ancestor ediff-merge-directories 7684;;;;;; ediff-merge-directories-with-ancestor ediff-merge-directories
7685;;;;;; ediff-directories3 ediff-directory-revisions ediff-directories 7685;;;;;; ediff-directories3 ediff-directory-revisions ediff-directories
7686;;;;;; ediff-buffers3 ediff-buffers ediff-backup ediff-current-file 7686;;;;;; ediff-buffers3 ediff-buffers ediff-backup ediff-current-file
7687;;;;;; ediff-files3 ediff-files) "ediff" "vc/ediff.el" (20709 26818 7687;;;;;; ediff-files3 ediff-files) "ediff" "vc/ediff.el" (20893 60586
7688;;;;;; 907104 0)) 7688;;;;;; 188550 0))
7689;;; Generated autoloads from vc/ediff.el 7689;;; Generated autoloads from vc/ediff.el
7690 7690
7691(autoload 'ediff-files "ediff" "\ 7691(autoload 'ediff-files "ediff" "\
@@ -7928,7 +7928,7 @@ With optional NODE, goes to that node.
7928;;;*** 7928;;;***
7929 7929
7930;;;### (autoloads (ediff-show-registry) "ediff-mult" "vc/ediff-mult.el" 7930;;;### (autoloads (ediff-show-registry) "ediff-mult" "vc/ediff-mult.el"
7931;;;;;; (20709 26818 907104 0)) 7931;;;;;; (20893 60586 188550 0))
7932;;; Generated autoloads from vc/ediff-mult.el 7932;;; Generated autoloads from vc/ediff-mult.el
7933 7933
7934(autoload 'ediff-show-registry "ediff-mult" "\ 7934(autoload 'ediff-show-registry "ediff-mult" "\
@@ -7941,7 +7941,7 @@ Display Ediff's registry.
7941;;;*** 7941;;;***
7942 7942
7943;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe) 7943;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
7944;;;;;; "ediff-util" "vc/ediff-util.el" (20777 63161 848428 0)) 7944;;;;;; "ediff-util" "vc/ediff-util.el" (20893 60586 188550 0))
7945;;; Generated autoloads from vc/ediff-util.el 7945;;; Generated autoloads from vc/ediff-util.el
7946 7946
7947(autoload 'ediff-toggle-multiframe "ediff-util" "\ 7947(autoload 'ediff-toggle-multiframe "ediff-util" "\
@@ -8079,7 +8079,7 @@ Optional argument GROUP is the sub-group of slots to display.
8079 8079
8080;;;### (autoloads (eieio-describe-generic eieio-describe-constructor 8080;;;### (autoloads (eieio-describe-generic eieio-describe-constructor
8081;;;;;; eieio-describe-class eieio-browse) "eieio-opt" "emacs-lisp/eieio-opt.el" 8081;;;;;; eieio-describe-class eieio-browse) "eieio-opt" "emacs-lisp/eieio-opt.el"
8082;;;;;; (20771 24374 643644 0)) 8082;;;;;; (20892 39729 858825 0))
8083;;; Generated autoloads from emacs-lisp/eieio-opt.el 8083;;; Generated autoloads from emacs-lisp/eieio-opt.el
8084 8084
8085(autoload 'eieio-browse "eieio-opt" "\ 8085(autoload 'eieio-browse "eieio-opt" "\
@@ -8474,8 +8474,8 @@ Commands:
8474;;;;;; epa-sign-region epa-verify-cleartext-in-region epa-verify-region 8474;;;;;; epa-sign-region epa-verify-cleartext-in-region epa-verify-region
8475;;;;;; epa-decrypt-armor-in-region epa-decrypt-region epa-encrypt-file 8475;;;;;; epa-decrypt-armor-in-region epa-decrypt-region epa-encrypt-file
8476;;;;;; epa-sign-file epa-verify-file epa-decrypt-file epa-select-keys 8476;;;;;; epa-sign-file epa-verify-file epa-decrypt-file epa-select-keys
8477;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (20762 8477;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (20879
8478;;;;;; 9398 526093 0)) 8478;;;;;; 27694 495748 0))
8479;;; Generated autoloads from epa.el 8479;;; Generated autoloads from epa.el
8480 8480
8481(autoload 'epa-list-keys "epa" "\ 8481(autoload 'epa-list-keys "epa" "\
@@ -8499,9 +8499,9 @@ If SECRET is non-nil, list secret keys instead of public keys.
8499\(fn CONTEXT PROMPT &optional NAMES SECRET)" nil nil) 8499\(fn CONTEXT PROMPT &optional NAMES SECRET)" nil nil)
8500 8500
8501(autoload 'epa-decrypt-file "epa" "\ 8501(autoload 'epa-decrypt-file "epa" "\
8502Decrypt FILE. 8502Decrypt DECRYPT-FILE into PLAIN-FILE.
8503 8503
8504\(fn FILE)" t nil) 8504\(fn DECRYPT-FILE PLAIN-FILE)" t nil)
8505 8505
8506(autoload 'epa-verify-file "epa" "\ 8506(autoload 'epa-verify-file "epa" "\
8507Verify FILE. 8507Verify FILE.
@@ -8805,7 +8805,7 @@ Look at CONFIG and try to expand GROUP.
8805;;;*** 8805;;;***
8806 8806
8807;;;### (autoloads (erc-handle-irc-url erc-tls erc erc-select-read-args) 8807;;;### (autoloads (erc-handle-irc-url erc-tls erc erc-select-read-args)
8808;;;;;; "erc" "erc/erc.el" (20709 26818 907104 0)) 8808;;;;;; "erc" "erc/erc.el" (20891 18859 893295 0))
8809;;; Generated autoloads from erc/erc.el 8809;;; Generated autoloads from erc/erc.el
8810 8810
8811(autoload 'erc-select-read-args "erc" "\ 8811(autoload 'erc-select-read-args "erc" "\
@@ -8912,7 +8912,7 @@ that subcommand.
8912;;;*** 8912;;;***
8913 8913
8914;;;### (autoloads nil "erc-desktop-notifications" "erc/erc-desktop-notifications.el" 8914;;;### (autoloads nil "erc-desktop-notifications" "erc/erc-desktop-notifications.el"
8915;;;;;; (20709 26818 907104 0)) 8915;;;;;; (20874 65006 176325 548000))
8916;;; Generated autoloads from erc/erc-desktop-notifications.el 8916;;; Generated autoloads from erc/erc-desktop-notifications.el
8917(autoload 'erc-notifications-mode "erc-desktop-notifications" "" t) 8917(autoload 'erc-notifications-mode "erc-desktop-notifications" "" t)
8918 8918
@@ -9037,15 +9037,15 @@ system.
9037 9037
9038;;;*** 9038;;;***
9039 9039
9040;;;### (autoloads nil "erc-list" "erc/erc-list.el" (20709 26818 907104 9040;;;### (autoloads nil "erc-list" "erc/erc-list.el" (20884 7264 412929
9041;;;;;; 0)) 9041;;;;;; 442000))
9042;;; Generated autoloads from erc/erc-list.el 9042;;; Generated autoloads from erc/erc-list.el
9043 (autoload 'erc-list-mode "erc-list") 9043 (autoload 'erc-list-mode "erc-list")
9044 9044
9045;;;*** 9045;;;***
9046 9046
9047;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log" 9047;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
9048;;;;;; "erc/erc-log.el" (20709 26818 907104 0)) 9048;;;;;; "erc/erc-log.el" (20891 18859 893295 0))
9049;;; Generated autoloads from erc/erc-log.el 9049;;; Generated autoloads from erc/erc-log.el
9050 (autoload 'erc-log-mode "erc-log" nil t) 9050 (autoload 'erc-log-mode "erc-log" nil t)
9051 9051
@@ -9123,8 +9123,8 @@ Delete dangerous-host interactively to `erc-dangerous-hosts'.
9123 9123
9124;;;*** 9124;;;***
9125 9125
9126;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (20709 26818 907104 9126;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (20884 7264 412929
9127;;;;;; 0)) 9127;;;;;; 442000))
9128;;; Generated autoloads from erc/erc-menu.el 9128;;; Generated autoloads from erc/erc-menu.el
9129 (autoload 'erc-menu-mode "erc-menu" nil t) 9129 (autoload 'erc-menu-mode "erc-menu" nil t)
9130 9130
@@ -9161,7 +9161,7 @@ Interactively select a server to connect to using `erc-server-alist'.
9161;;;*** 9161;;;***
9162 9162
9163;;;### (autoloads (pcomplete/erc-mode/NOTIFY erc-cmd-NOTIFY) "erc-notify" 9163;;;### (autoloads (pcomplete/erc-mode/NOTIFY erc-cmd-NOTIFY) "erc-notify"
9164;;;;;; "erc/erc-notify.el" (20709 26818 907104 0)) 9164;;;;;; "erc/erc-notify.el" (20891 18859 893295 0))
9165;;; Generated autoloads from erc/erc-notify.el 9165;;; Generated autoloads from erc/erc-notify.el
9166 (autoload 'erc-notify-mode "erc-notify" nil t) 9166 (autoload 'erc-notify-mode "erc-notify" nil t)
9167 9167
@@ -9200,8 +9200,8 @@ with args, toggle notify status of people.
9200 9200
9201;;;*** 9201;;;***
9202 9202
9203;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (20709 26818 907104 9203;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (20884 7264 412929
9204;;;;;; 0)) 9204;;;;;; 442000))
9205;;; Generated autoloads from erc/erc-ring.el 9205;;; Generated autoloads from erc/erc-ring.el
9206 (autoload 'erc-ring-mode "erc-ring" nil t) 9206 (autoload 'erc-ring-mode "erc-ring" nil t)
9207 9207
@@ -9398,8 +9398,8 @@ Kill all test buffers that are still live.
9398 9398
9399;;;*** 9399;;;***
9400 9400
9401;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (20709 9401;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (20893
9402;;;;;; 26818 907104 0)) 9402;;;;;; 60586 188550 0))
9403;;; Generated autoloads from eshell/esh-mode.el 9403;;; Generated autoloads from eshell/esh-mode.el
9404 9404
9405(autoload 'eshell-mode "esh-mode" "\ 9405(autoload 'eshell-mode "esh-mode" "\
@@ -9412,7 +9412,7 @@ Emacs shell interactive mode.
9412;;;*** 9412;;;***
9413 9413
9414;;;### (autoloads (eshell-command-result eshell-command eshell) "eshell" 9414;;;### (autoloads (eshell-command-result eshell-command eshell) "eshell"
9415;;;;;; "eshell/eshell.el" (20709 26818 907104 0)) 9415;;;;;; "eshell/eshell.el" (20893 60586 188550 0))
9416;;; Generated autoloads from eshell/eshell.el 9416;;; Generated autoloads from eshell/eshell.el
9417 9417
9418(autoload 'eshell "eshell" "\ 9418(autoload 'eshell "eshell" "\
@@ -10030,7 +10030,7 @@ Display a button for the JPEG DATA.
10030;;;*** 10030;;;***
10031 10031
10032;;;### (autoloads (eudc-try-bbdb-insert eudc-insert-record-at-point-into-bbdb) 10032;;;### (autoloads (eudc-try-bbdb-insert eudc-insert-record-at-point-into-bbdb)
10033;;;;;; "eudc-export" "net/eudc-export.el" (20791 9657 561026 0)) 10033;;;;;; "eudc-export" "net/eudc-export.el" (20871 33574 214287 0))
10034;;; Generated autoloads from net/eudc-export.el 10034;;; Generated autoloads from net/eudc-export.el
10035 10035
10036(autoload 'eudc-insert-record-at-point-into-bbdb "eudc-export" "\ 10036(autoload 'eudc-insert-record-at-point-into-bbdb "eudc-export" "\
@@ -10179,8 +10179,8 @@ This is used only in conjunction with `expand-add-abbrevs'.
10179 10179
10180;;;*** 10180;;;***
10181 10181
10182;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20709 26818 10182;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20886 939
10183;;;;;; 907104 0)) 10183;;;;;; 575794 0))
10184;;; Generated autoloads from progmodes/f90.el 10184;;; Generated autoloads from progmodes/f90.el
10185 10185
10186(autoload 'f90-mode "f90" "\ 10186(autoload 'f90-mode "f90" "\
@@ -10232,11 +10232,11 @@ Variables controlling indentation style and extra features:
10232 Automatic insertion of & at beginning of continuation lines (default t). 10232 Automatic insertion of & at beginning of continuation lines (default t).
10233`f90-smart-end' 10233`f90-smart-end'
10234 From an END statement, check and fill the end using matching block start. 10234 From an END statement, check and fill the end using matching block start.
10235 Allowed values are 'blink, 'no-blink, and nil, which determine 10235 Allowed values are `blink', `no-blink', and nil, which determine
10236 whether to blink the matching beginning (default 'blink). 10236 whether to blink the matching beginning (default `blink').
10237`f90-auto-keyword-case' 10237`f90-auto-keyword-case'
10238 Automatic change of case of keywords (default nil). 10238 Automatic change of case of keywords (default nil).
10239 The possibilities are 'downcase-word, 'upcase-word, 'capitalize-word. 10239 The possibilities are `downcase-word', `upcase-word', `capitalize-word'.
10240`f90-leave-line-no' 10240`f90-leave-line-no'
10241 Do not left-justify line numbers (default nil). 10241 Do not left-justify line numbers (default nil).
10242 10242
@@ -10414,8 +10414,8 @@ Besides the choice of face, it is the same as `buffer-face-mode'.
10414 10414
10415;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue 10415;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
10416;;;;;; feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts 10416;;;;;; feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
10417;;;;;; feedmail-send-it) "feedmail" "mail/feedmail.el" (20759 33211 10417;;;;;; feedmail-send-it) "feedmail" "mail/feedmail.el" (20891 18859
10418;;;;;; 414988 0)) 10418;;;;;; 893295 0))
10419;;; Generated autoloads from mail/feedmail.el 10419;;; Generated autoloads from mail/feedmail.el
10420 10420
10421(autoload 'feedmail-send-it "feedmail" "\ 10421(autoload 'feedmail-send-it "feedmail" "\
@@ -10736,7 +10736,7 @@ use in place of \"-ls\" as the final argument.
10736 10736
10737;;;### (autoloads (ff-mouse-find-other-file-other-window ff-mouse-find-other-file 10737;;;### (autoloads (ff-mouse-find-other-file-other-window ff-mouse-find-other-file
10738;;;;;; ff-find-other-file ff-get-other-file ff-special-constructs) 10738;;;;;; ff-find-other-file ff-get-other-file ff-special-constructs)
10739;;;;;; "find-file" "find-file.el" (20709 26818 907104 0)) 10739;;;;;; "find-file" "find-file.el" (20872 54440 171355 0))
10740;;; Generated autoloads from find-file.el 10740;;; Generated autoloads from find-file.el
10741 10741
10742(defvar ff-special-constructs `((,(purecopy "^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") lambda nil (buffer-substring (match-beginning 2) (match-end 2)))) "\ 10742(defvar ff-special-constructs `((,(purecopy "^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") lambda nil (buffer-substring (match-beginning 2) (match-end 2)))) "\
@@ -11073,8 +11073,8 @@ to get the effect of a C-q.
11073;;;*** 11073;;;***
11074 11074
11075;;;### (autoloads (flymake-find-file-hook flymake-mode-off flymake-mode-on 11075;;;### (autoloads (flymake-find-file-hook flymake-mode-off flymake-mode-on
11076;;;;;; flymake-mode) "flymake" "progmodes/flymake.el" (20717 20920 11076;;;;;; flymake-mode) "flymake" "progmodes/flymake.el" (20896 36774
11077;;;;;; 410005 0)) 11077;;;;;; 886399 0))
11078;;; Generated autoloads from progmodes/flymake.el 11078;;; Generated autoloads from progmodes/flymake.el
11079 11079
11080(autoload 'flymake-mode "flymake" "\ 11080(autoload 'flymake-mode "flymake" "\
@@ -11429,7 +11429,7 @@ and choose the directory as the fortune-file.
11429;;;*** 11429;;;***
11430 11430
11431;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el" 11431;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el"
11432;;;;;; (20851 48294 960738 0)) 11432;;;;;; (20903 57728 956434 133000))
11433;;; Generated autoloads from progmodes/gdb-mi.el 11433;;; Generated autoloads from progmodes/gdb-mi.el
11434 11434
11435(defvar gdb-enable-debug nil "\ 11435(defvar gdb-enable-debug nil "\
@@ -11658,8 +11658,8 @@ DEFAULT-MAP specifies the default key map for ICON-LIST.
11658;;;*** 11658;;;***
11659 11659
11660;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server 11660;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
11661;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (20860 63270 11661;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (20901 54695
11662;;;;;; 684173 0)) 11662;;;;;; 989166 0))
11663;;; Generated autoloads from gnus/gnus.el 11663;;; Generated autoloads from gnus/gnus.el
11664(when (fboundp 'custom-autoload) 11664(when (fboundp 'custom-autoload)
11665 (custom-autoload 'gnus-select-method "gnus")) 11665 (custom-autoload 'gnus-select-method "gnus"))
@@ -11804,7 +11804,7 @@ If CLEAN, obsolete (ignore).
11804;;;*** 11804;;;***
11805 11805
11806;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el" 11806;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
11807;;;;;; (20763 30266 231060 0)) 11807;;;;;; (20874 65006 176325 548000))
11808;;; Generated autoloads from gnus/gnus-art.el 11808;;; Generated autoloads from gnus/gnus-art.el
11809 11809
11810(autoload 'gnus-article-prepare-display "gnus-art" "\ 11810(autoload 'gnus-article-prepare-display "gnus-art" "\
@@ -12005,8 +12005,8 @@ FILE should be a PNG file that's 48x48 and smaller than or equal to
12005;;;*** 12005;;;***
12006 12006
12007;;;### (autoloads (gnus-treat-mail-gravatar gnus-treat-from-gravatar) 12007;;;### (autoloads (gnus-treat-mail-gravatar gnus-treat-from-gravatar)
12008;;;;;; "gnus-gravatar" "gnus/gnus-gravatar.el" (20709 26818 907104 12008;;;;;; "gnus-gravatar" "gnus/gnus-gravatar.el" (20874 65006 176325
12009;;;;;; 0)) 12009;;;;;; 548000))
12010;;; Generated autoloads from gnus/gnus-gravatar.el 12010;;; Generated autoloads from gnus/gnus-gravatar.el
12011 12011
12012(autoload 'gnus-treat-from-gravatar "gnus-gravatar" "\ 12012(autoload 'gnus-treat-from-gravatar "gnus-gravatar" "\
@@ -12024,7 +12024,7 @@ If gravatars are already displayed, remove them.
12024;;;*** 12024;;;***
12025 12025
12026;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group) 12026;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
12027;;;;;; "gnus-group" "gnus/gnus-group.el" (20763 30266 231060 0)) 12027;;;;;; "gnus-group" "gnus/gnus-group.el" (20901 54695 989166 0))
12028;;; Generated autoloads from gnus/gnus-group.el 12028;;; Generated autoloads from gnus/gnus-group.el
12029 12029
12030(autoload 'gnus-fetch-group "gnus-group" "\ 12030(autoload 'gnus-fetch-group "gnus-group" "\
@@ -12042,7 +12042,7 @@ Pop up a frame and enter GROUP.
12042;;;*** 12042;;;***
12043 12043
12044;;;### (autoloads (gnus-html-prefetch-images gnus-article-html) "gnus-html" 12044;;;### (autoloads (gnus-html-prefetch-images gnus-article-html) "gnus-html"
12045;;;;;; "gnus/gnus-html.el" (20709 26818 907104 0)) 12045;;;;;; "gnus/gnus-html.el" (20874 65006 672942 217000))
12046;;; Generated autoloads from gnus/gnus-html.el 12046;;; Generated autoloads from gnus/gnus-html.el
12047 12047
12048(autoload 'gnus-article-html "gnus-html" "\ 12048(autoload 'gnus-article-html "gnus-html" "\
@@ -12226,7 +12226,7 @@ Like `message-reply'.
12226;;;*** 12226;;;***
12227 12227
12228;;;### (autoloads (gnus-notifications) "gnus-notifications" "gnus/gnus-notifications.el" 12228;;;### (autoloads (gnus-notifications) "gnus-notifications" "gnus/gnus-notifications.el"
12229;;;;;; (20709 26818 907104 0)) 12229;;;;;; (20886 939 575794 0))
12230;;; Generated autoloads from gnus/gnus-notifications.el 12230;;; Generated autoloads from gnus/gnus-notifications.el
12231 12231
12232(autoload 'gnus-notifications "gnus-notifications" "\ 12232(autoload 'gnus-notifications "gnus-notifications" "\
@@ -12244,7 +12244,7 @@ This is typically a function to add in
12244 12244
12245;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon 12245;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon
12246;;;;;; gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el" 12246;;;;;; gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el"
12247;;;;;; (20709 26818 907104 0)) 12247;;;;;; (20874 65006 672942 217000))
12248;;; Generated autoloads from gnus/gnus-picon.el 12248;;; Generated autoloads from gnus/gnus-picon.el
12249 12249
12250(autoload 'gnus-treat-from-picon "gnus-picon" "\ 12250(autoload 'gnus-treat-from-picon "gnus-picon" "\
@@ -12385,7 +12385,7 @@ See the documentation for these variables and functions for details.
12385;;;*** 12385;;;***
12386 12386
12387;;;### (autoloads (gnus-update-format) "gnus-spec" "gnus/gnus-spec.el" 12387;;;### (autoloads (gnus-update-format) "gnus-spec" "gnus/gnus-spec.el"
12388;;;;;; (20791 9657 561026 0)) 12388;;;;;; (20893 60586 188550 0))
12389;;; Generated autoloads from gnus/gnus-spec.el 12389;;; Generated autoloads from gnus/gnus-spec.el
12390 12390
12391(autoload 'gnus-update-format "gnus-spec" "\ 12391(autoload 'gnus-update-format "gnus-spec" "\
@@ -12407,7 +12407,7 @@ Declare back end NAME with ABILITIES as a Gnus back end.
12407;;;*** 12407;;;***
12408 12408
12409;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el" 12409;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el"
12410;;;;;; (20856 32301 830403 0)) 12410;;;;;; (20901 54695 989166 0))
12411;;; Generated autoloads from gnus/gnus-sum.el 12411;;; Generated autoloads from gnus/gnus-sum.el
12412 12412
12413(autoload 'gnus-summary-bookmark-jump "gnus-sum" "\ 12413(autoload 'gnus-summary-bookmark-jump "gnus-sum" "\
@@ -12533,7 +12533,7 @@ Like `goto-address-mode', but only for comments and strings.
12533;;;*** 12533;;;***
12534 12534
12535;;;### (autoloads (gravatar-retrieve-synchronously gravatar-retrieve) 12535;;;### (autoloads (gravatar-retrieve-synchronously gravatar-retrieve)
12536;;;;;; "gravatar" "gnus/gravatar.el" (20709 26818 907104 0)) 12536;;;;;; "gravatar" "gnus/gravatar.el" (20901 54695 989166 0))
12537;;; Generated autoloads from gnus/gravatar.el 12537;;; Generated autoloads from gnus/gravatar.el
12538 12538
12539(autoload 'gravatar-retrieve "gravatar" "\ 12539(autoload 'gravatar-retrieve "gravatar" "\
@@ -12551,8 +12551,8 @@ Retrieve MAIL-ADDRESS gravatar and returns it.
12551 12551
12552;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults 12552;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults
12553;;;;;; grep-process-setup grep-setup-hook grep-find-command grep-command 12553;;;;;; grep-process-setup grep-setup-hook grep-find-command grep-command
12554;;;;;; grep-window-height) "grep" "progmodes/grep.el" (20762 9398 12554;;;;;; grep-window-height) "grep" "progmodes/grep.el" (20896 36774
12555;;;;;; 526093 0)) 12555;;;;;; 886399 0))
12556;;; Generated autoloads from progmodes/grep.el 12556;;; Generated autoloads from progmodes/grep.el
12557 12557
12558(defvar grep-window-height nil "\ 12558(defvar grep-window-height nil "\
@@ -12730,8 +12730,8 @@ the form \"WINDOW-ID PIXMAP-ID\". Value is non-nil if successful.
12730;;;*** 12730;;;***
12731 12731
12732;;;### (autoloads (gud-tooltip-mode gdb-script-mode jdb pdb perldb 12732;;;### (autoloads (gud-tooltip-mode gdb-script-mode jdb pdb perldb
12733;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (20851 48294 12733;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (20895 15912
12734;;;;;; 960738 0)) 12734;;;;;; 444844 0))
12735;;; Generated autoloads from progmodes/gud.el 12735;;; Generated autoloads from progmodes/gud.el
12736 12736
12737(autoload 'gud-gdb "gud" "\ 12737(autoload 'gud-gdb "gud" "\
@@ -14402,7 +14402,7 @@ See also the variable `idlwave-shell-prompt-pattern'.
14402;;;*** 14402;;;***
14403 14403
14404;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el" 14404;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
14405;;;;;; (20799 169 640767 0)) 14405;;;;;; (20901 54695 989166 0))
14406;;; Generated autoloads from progmodes/idlwave.el 14406;;; Generated autoloads from progmodes/idlwave.el
14407 14407
14408(autoload 'idlwave-mode "idlwave" "\ 14408(autoload 'idlwave-mode "idlwave" "\
@@ -14536,8 +14536,8 @@ The main features of this mode are
14536;;;;;; ido-find-alternate-file ido-find-file-other-window ido-find-file 14536;;;;;; ido-find-alternate-file ido-find-file-other-window ido-find-file
14537;;;;;; ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer 14537;;;;;; ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
14538;;;;;; ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window 14538;;;;;; ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
14539;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (20831 14539;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (20886
14540;;;;;; 63016 738579 0)) 14540;;;;;; 939 575794 0))
14541;;; Generated autoloads from ido.el 14541;;; Generated autoloads from ido.el
14542 14542
14543(defvar ido-mode nil "\ 14543(defvar ido-mode nil "\
@@ -14796,7 +14796,7 @@ DEF, if non-nil, is the default value.
14796 14796
14797;;;*** 14797;;;***
14798 14798
14799;;;### (autoloads (ielm) "ielm" "ielm.el" (20709 26818 907104 0)) 14799;;;### (autoloads (ielm) "ielm" "ielm.el" (20903 10024 645978 0))
14800;;; Generated autoloads from ielm.el 14800;;; Generated autoloads from ielm.el
14801 14801
14802(autoload 'ielm "ielm" "\ 14802(autoload 'ielm "ielm" "\
@@ -14829,7 +14829,7 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
14829;;;;;; create-image image-type-auto-detected-p image-type-available-p 14829;;;;;; create-image image-type-auto-detected-p image-type-available-p
14830;;;;;; image-type image-type-from-file-name image-type-from-file-header 14830;;;;;; image-type image-type-from-file-name image-type-from-file-header
14831;;;;;; image-type-from-buffer image-type-from-data) "image" "image.el" 14831;;;;;; image-type-from-buffer image-type-from-data) "image" "image.el"
14832;;;;;; (20772 45239 494620 0)) 14832;;;;;; (20903 10024 645978 0))
14833;;; Generated autoloads from image.el 14833;;; Generated autoloads from image.el
14834 14834
14835(autoload 'image-type-from-data "image" "\ 14835(autoload 'image-type-from-data "image" "\
@@ -15230,8 +15230,8 @@ An image file is one whose name has an extension in
15230;;;*** 15230;;;***
15231 15231
15232;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode 15232;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode
15233;;;;;; image-mode) "image-mode" "image-mode.el" (20774 51931 214714 15233;;;;;; image-mode) "image-mode" "image-mode.el" (20899 12965 791908
15234;;;;;; 829000)) 15234;;;;;; 0))
15235;;; Generated autoloads from image-mode.el 15235;;; Generated autoloads from image-mode.el
15236 15236
15237(autoload 'image-mode "image-mode" "\ 15237(autoload 'image-mode "image-mode" "\
@@ -15470,7 +15470,7 @@ of `inferior-lisp-program'). Runs the hooks from
15470;;;;;; Info-goto-emacs-key-command-node Info-goto-emacs-command-node 15470;;;;;; Info-goto-emacs-key-command-node Info-goto-emacs-command-node
15471;;;;;; Info-mode info-finder info-apropos Info-index Info-directory 15471;;;;;; Info-mode info-finder info-apropos Info-index Info-directory
15472;;;;;; Info-on-current-buffer info-standalone info-emacs-bug info-emacs-manual 15472;;;;;; Info-on-current-buffer info-standalone info-emacs-bug info-emacs-manual
15473;;;;;; info info-other-window) "info" "info.el" (20841 12463 538770 15473;;;;;; info info-other-window) "info" "info.el" (20900 33838 319219
15474;;;;;; 0)) 15474;;;;;; 0))
15475;;; Generated autoloads from info.el 15475;;; Generated autoloads from info.el
15476 15476
@@ -16379,7 +16379,7 @@ by `jka-compr-installed'.
16379 16379
16380;;;*** 16380;;;***
16381 16381
16382;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20793 51383 764318 16382;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20895 15912 444844
16383;;;;;; 0)) 16383;;;;;; 0))
16384;;; Generated autoloads from progmodes/js.el 16384;;; Generated autoloads from progmodes/js.el
16385 16385
@@ -16770,7 +16770,7 @@ use either \\[customize] or the function `latin1-display'.")
16770;;;*** 16770;;;***
16771 16771
16772;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el" 16772;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
16773;;;;;; (20709 26818 907104 0)) 16773;;;;;; (20874 62962 290468 0))
16774;;; Generated autoloads from progmodes/ld-script.el 16774;;; Generated autoloads from progmodes/ld-script.el
16775 16775
16776(autoload 'ld-script-mode "ld-script" "\ 16776(autoload 'ld-script-mode "ld-script" "\
@@ -16960,8 +16960,8 @@ Major mode for browsing CVS log output.
16960;;;*** 16960;;;***
16961 16961
16962;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer 16962;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer
16963;;;;;; lpr-command lpr-switches printer-name) "lpr" "lpr.el" (20709 16963;;;;;; lpr-command lpr-switches printer-name) "lpr" "lpr.el" (20878
16964;;;;;; 26818 907104 0)) 16964;;;;;; 6823 881439 0))
16965;;; Generated autoloads from lpr.el 16965;;; Generated autoloads from lpr.el
16966 16966
16967(defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)) "\ 16967(defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)) "\
@@ -17057,7 +17057,7 @@ for further customization of the printer command.
17057;;;*** 17057;;;***
17058 17058
17059;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el" 17059;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el"
17060;;;;;; (20860 63270 684173 0)) 17060;;;;;; (20870 12718 549931 0))
17061;;; Generated autoloads from ls-lisp.el 17061;;; Generated autoloads from ls-lisp.el
17062 17062
17063(defvar ls-lisp-support-shell-wildcards t "\ 17063(defvar ls-lisp-support-shell-wildcards t "\
@@ -17083,8 +17083,8 @@ This function is suitable for execution in an init file.
17083 17083
17084;;;*** 17084;;;***
17085 17085
17086;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (20709 17086;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (20874
17087;;;;;; 26818 907104 0)) 17087;;;;;; 62962 290468 0))
17088;;; Generated autoloads from progmodes/m4-mode.el 17088;;; Generated autoloads from progmodes/m4-mode.el
17089 17089
17090(autoload 'm4-mode "m4-mode" "\ 17090(autoload 'm4-mode "m4-mode" "\
@@ -17249,7 +17249,7 @@ This function normally would be called when the message is sent.
17249;;;### (autoloads (mail-fetch-field mail-unquote-printable-region 17249;;;### (autoloads (mail-fetch-field mail-unquote-printable-region
17250;;;;;; mail-unquote-printable mail-quote-printable-region mail-quote-printable 17250;;;;;; mail-unquote-printable mail-quote-printable-region mail-quote-printable
17251;;;;;; mail-file-babyl-p mail-dont-reply-to-names mail-use-rfc822) 17251;;;;;; mail-file-babyl-p mail-dont-reply-to-names mail-use-rfc822)
17252;;;;;; "mail-utils" "mail/mail-utils.el" (20709 26818 907104 0)) 17252;;;;;; "mail-utils" "mail/mail-utils.el" (20891 18859 893295 0))
17253;;; Generated autoloads from mail/mail-utils.el 17253;;; Generated autoloads from mail/mail-utils.el
17254 17254
17255(defvar mail-use-rfc822 nil "\ 17255(defvar mail-use-rfc822 nil "\
@@ -17444,8 +17444,8 @@ The mail client is taken to be the handler of mailto URLs.
17444 17444
17445;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode 17445;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
17446;;;;;; makefile-gmake-mode makefile-automake-mode makefile-mode) 17446;;;;;; makefile-gmake-mode makefile-automake-mode makefile-mode)
17447;;;;;; "make-mode" "progmodes/make-mode.el" (20748 62911 684442 17447;;;;;; "make-mode" "progmodes/make-mode.el" (20874 65006 672942
17448;;;;;; 0)) 17448;;;;;; 217000))
17449;;; Generated autoloads from progmodes/make-mode.el 17449;;; Generated autoloads from progmodes/make-mode.el
17450 17450
17451(autoload 'makefile-mode "make-mode" "\ 17451(autoload 'makefile-mode "make-mode" "\
@@ -17575,7 +17575,7 @@ Previous contents of that buffer are killed first.
17575;;;*** 17575;;;***
17576 17576
17577;;;### (autoloads (Man-bookmark-jump man-follow man) "man" "man.el" 17577;;;### (autoloads (Man-bookmark-jump man-follow man) "man" "man.el"
17578;;;;;; (20762 9398 526093 0)) 17578;;;;;; (20888 42662 256824 0))
17579;;; Generated autoloads from man.el 17579;;; Generated autoloads from man.el
17580 17580
17581(defalias 'manual-entry 'man) 17581(defalias 'manual-entry 'man)
@@ -17629,8 +17629,8 @@ Default bookmark handler for Man buffers.
17629 17629
17630;;;*** 17630;;;***
17631 17631
17632;;;### (autoloads (master-mode) "master" "master.el" (20709 26818 17632;;;### (autoloads (master-mode) "master" "master.el" (20884 7264
17633;;;;;; 907104 0)) 17633;;;;;; 912957 506000))
17634;;; Generated autoloads from master.el 17634;;; Generated autoloads from master.el
17635 17635
17636(autoload 'master-mode "master" "\ 17636(autoload 'master-mode "master" "\
@@ -17686,7 +17686,7 @@ recursion depth in the minibuffer prompt. This is only useful if
17686;;;;;; message-forward-make-body message-forward message-recover 17686;;;;;; message-forward-make-body message-forward message-recover
17687;;;;;; message-supersede message-cancel-news message-followup message-wide-reply 17687;;;;;; message-supersede message-cancel-news message-followup message-wide-reply
17688;;;;;; message-reply message-news message-mail message-mode) "message" 17688;;;;;; message-reply message-news message-mail message-mode) "message"
17689;;;;;; "gnus/message.el" (20858 21542 723007 0)) 17689;;;;;; "gnus/message.el" (20889 63525 775294 0))
17690;;; Generated autoloads from gnus/message.el 17690;;; Generated autoloads from gnus/message.el
17691 17691
17692(define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook) 17692(define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook)
@@ -17852,7 +17852,7 @@ which specify the range to operate on.
17852;;;*** 17852;;;***
17853 17853
17854;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el" 17854;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el"
17855;;;;;; (20709 26818 907104 0)) 17855;;;;;; (20874 62962 290468 0))
17856;;; Generated autoloads from progmodes/meta-mode.el 17856;;; Generated autoloads from progmodes/meta-mode.el
17857 17857
17858(autoload 'metafont-mode "meta-mode" "\ 17858(autoload 'metafont-mode "meta-mode" "\
@@ -17914,7 +17914,7 @@ redisplayed as output is inserted.
17914 17914
17915;;;### (autoloads (mh-fully-kill-draft mh-send-letter mh-user-agent-compose 17915;;;### (autoloads (mh-fully-kill-draft mh-send-letter mh-user-agent-compose
17916;;;;;; mh-smail-batch mh-smail-other-window mh-smail) "mh-comp" 17916;;;;;; mh-smail-batch mh-smail-other-window mh-smail) "mh-comp"
17917;;;;;; "mh-e/mh-comp.el" (20787 12616 976036 0)) 17917;;;;;; "mh-e/mh-comp.el" (20890 54503 125088 852000))
17918;;; Generated autoloads from mh-e/mh-comp.el 17918;;; Generated autoloads from mh-e/mh-comp.el
17919 17919
17920(autoload 'mh-smail "mh-comp" "\ 17920(autoload 'mh-smail "mh-comp" "\
@@ -18004,8 +18004,8 @@ delete the draft message.
18004 18004
18005;;;*** 18005;;;***
18006 18006
18007;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (20787 12616 18007;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (20874 65006
18008;;;;;; 976036 0)) 18008;;;;;; 672942 217000))
18009;;; Generated autoloads from mh-e/mh-e.el 18009;;; Generated autoloads from mh-e/mh-e.el
18010 18010
18011(put 'mh-progs 'risky-local-variable t) 18011(put 'mh-progs 'risky-local-variable t)
@@ -18391,7 +18391,7 @@ body) or \"attachment\" (separate from the body).
18391;;;*** 18391;;;***
18392 18392
18393;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el" 18393;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el"
18394;;;;;; (20791 9657 561026 0)) 18394;;;;;; (20875 30633 412173 0))
18395;;; Generated autoloads from gnus/mml1991.el 18395;;; Generated autoloads from gnus/mml1991.el
18396 18396
18397(autoload 'mml1991-encrypt "mml1991" "\ 18397(autoload 'mml1991-encrypt "mml1991" "\
@@ -18408,7 +18408,7 @@ body) or \"attachment\" (separate from the body).
18408 18408
18409;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt 18409;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
18410;;;;;; mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt) 18410;;;;;; mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
18411;;;;;; "mml2015" "gnus/mml2015.el" (20780 39352 990623 0)) 18411;;;;;; "mml2015" "gnus/mml2015.el" (20893 60586 188550 0))
18412;;; Generated autoloads from gnus/mml2015.el 18412;;; Generated autoloads from gnus/mml2015.el
18413 18413
18414(autoload 'mml2015-decrypt "mml2015" "\ 18414(autoload 'mml2015-decrypt "mml2015" "\
@@ -18615,7 +18615,7 @@ different buffer menu using the function `msb'.
18615;;;;;; describe-current-coding-system describe-current-coding-system-briefly 18615;;;;;; describe-current-coding-system describe-current-coding-system-briefly
18616;;;;;; describe-coding-system describe-character-set list-charset-chars 18616;;;;;; describe-coding-system describe-character-set list-charset-chars
18617;;;;;; read-charset list-character-sets) "mule-diag" "international/mule-diag.el" 18617;;;;;; read-charset list-character-sets) "mule-diag" "international/mule-diag.el"
18618;;;;;; (20709 26818 907104 0)) 18618;;;;;; (20891 18859 893295 0))
18619;;; Generated autoloads from international/mule-diag.el 18619;;; Generated autoloads from international/mule-diag.el
18620 18620
18621(autoload 'list-character-sets "mule-diag" "\ 18621(autoload 'list-character-sets "mule-diag" "\
@@ -18885,7 +18885,7 @@ per-character basis, this may not be accurate.
18885 18885
18886;;;### (autoloads (advice-member-p advice-remove advice-add remove-function 18886;;;### (autoloads (advice-member-p advice-remove advice-add remove-function
18887;;;;;; advice--add-function add-function advice--buffer-local advice--remove-function) 18887;;;;;; advice--add-function add-function advice--buffer-local advice--remove-function)
18888;;;;;; "nadvice" "emacs-lisp/nadvice.el" (20851 48294 960738 0)) 18888;;;;;; "nadvice" "emacs-lisp/nadvice.el" (20872 54440 171355 0))
18889;;; Generated autoloads from emacs-lisp/nadvice.el 18889;;; Generated autoloads from emacs-lisp/nadvice.el
18890 18890
18891(autoload 'advice--remove-function "nadvice" "\ 18891(autoload 'advice--remove-function "nadvice" "\
@@ -18973,8 +18973,8 @@ of the piece of advice.
18973;;;### (autoloads (network-connection network-connection-to-service 18973;;;### (autoloads (network-connection network-connection-to-service
18974;;;;;; whois-reverse-lookup whois finger ftp run-dig dns-lookup-host 18974;;;;;; whois-reverse-lookup whois finger ftp run-dig dns-lookup-host
18975;;;;;; nslookup nslookup-host ping traceroute route arp netstat 18975;;;;;; nslookup nslookup-host ping traceroute route arp netstat
18976;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (20799 18976;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (20903
18977;;;;;; 169 640767 0)) 18977;;;;;; 10024 645978 0))
18978;;; Generated autoloads from net/net-utils.el 18978;;; Generated autoloads from net/net-utils.el
18979 18979
18980(autoload 'ifconfig "net-utils" "\ 18980(autoload 'ifconfig "net-utils" "\
@@ -19359,8 +19359,8 @@ Return nil if the face cannot display a glyph for N.
19359 19359
19360;;;*** 19360;;;***
19361 19361
19362;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (20813 19362;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (20884
19363;;;;;; 33065 721081 0)) 19363;;;;;; 6711 386198 0))
19364;;; Generated autoloads from nxml/nxml-mode.el 19364;;; Generated autoloads from nxml/nxml-mode.el
19365 19365
19366(autoload 'nxml-mode "nxml-mode" "\ 19366(autoload 'nxml-mode "nxml-mode" "\
@@ -19435,7 +19435,7 @@ the variable `nxml-enabled-unicode-blocks'.
19435;;;*** 19435;;;***
19436 19436
19437;;;### (autoloads (inferior-octave octave-mode) "octave" "progmodes/octave.el" 19437;;;### (autoloads (inferior-octave octave-mode) "octave" "progmodes/octave.el"
19438;;;;;; (20864 60326 774861 0)) 19438;;;;;; (20905 51752 865679 0))
19439;;; Generated autoloads from progmodes/octave.el 19439;;; Generated autoloads from progmodes/octave.el
19440 19440
19441(autoload 'octave-mode "octave" "\ 19441(autoload 'octave-mode "octave" "\
@@ -20203,7 +20203,7 @@ See the command `outline-mode' for more information on this mode.
20203;;;### (autoloads (list-packages describe-package package-initialize 20203;;;### (autoloads (list-packages describe-package package-initialize
20204;;;;;; package-refresh-contents package-install-file package-install-from-buffer 20204;;;;;; package-refresh-contents package-install-file package-install-from-buffer
20205;;;;;; package-install package-enable-at-startup) "package" "emacs-lisp/package.el" 20205;;;;;; package-install package-enable-at-startup) "package" "emacs-lisp/package.el"
20206;;;;;; (20860 63270 684173 0)) 20206;;;;;; (20882 3877 904124 0))
20207;;; Generated autoloads from emacs-lisp/package.el 20207;;; Generated autoloads from emacs-lisp/package.el
20208 20208
20209(defvar package-enable-at-startup t "\ 20209(defvar package-enable-at-startup t "\
@@ -20273,8 +20273,8 @@ The list is displayed in a buffer named `*Packages*'.
20273 20273
20274;;;*** 20274;;;***
20275 20275
20276;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20738 27061 20276;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20903 56815
20277;;;;;; 124069 0)) 20277;;;;;; 695483 0))
20278;;; Generated autoloads from paren.el 20278;;; Generated autoloads from paren.el
20279 20279
20280(defvar show-paren-mode nil "\ 20280(defvar show-paren-mode nil "\
@@ -20314,8 +20314,8 @@ unknown are returned as nil.
20314 20314
20315;;;*** 20315;;;***
20316 20316
20317;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (20746 20317;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (20870
20318;;;;;; 21181 635406 0)) 20318;;;;;; 12718 549931 0))
20319;;; Generated autoloads from progmodes/pascal.el 20319;;; Generated autoloads from progmodes/pascal.el
20320 20320
20321(autoload 'pascal-mode "pascal" "\ 20321(autoload 'pascal-mode "pascal" "\
@@ -20492,7 +20492,7 @@ Completion for the GNU tar utility.
20492;;;*** 20492;;;***
20493 20493
20494;;;### (autoloads (pcomplete/mount pcomplete/umount pcomplete/kill) 20494;;;### (autoloads (pcomplete/mount pcomplete/umount pcomplete/kill)
20495;;;;;; "pcmpl-linux" "pcmpl-linux.el" (20709 26818 907104 0)) 20495;;;;;; "pcmpl-linux" "pcmpl-linux.el" (20884 7264 912957 506000))
20496;;; Generated autoloads from pcmpl-linux.el 20496;;; Generated autoloads from pcmpl-linux.el
20497 20497
20498(autoload 'pcomplete/kill "pcmpl-linux" "\ 20498(autoload 'pcomplete/kill "pcmpl-linux" "\
@@ -20748,7 +20748,7 @@ Global menu used by PCL-CVS.")
20748;;;*** 20748;;;***
20749 20749
20750;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el" 20750;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el"
20751;;;;;; (20709 26818 907104 0)) 20751;;;;;; (20873 17019 382960 343000))
20752;;; Generated autoloads from progmodes/perl-mode.el 20752;;; Generated autoloads from progmodes/perl-mode.el
20753(put 'perl-indent-level 'safe-local-variable 'integerp) 20753(put 'perl-indent-level 'safe-local-variable 'integerp)
20754(put 'perl-continued-statement-offset 'safe-local-variable 'integerp) 20754(put 'perl-continued-statement-offset 'safe-local-variable 'integerp)
@@ -21017,7 +21017,7 @@ Ignores leading comment characters.
21017;;;;;; pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview 21017;;;;;; pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
21018;;;;;; pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript 21018;;;;;; pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
21019;;;;;; pr-ps-directory-preview pr-interface) "printing" "printing.el" 21019;;;;;; pr-ps-directory-preview pr-interface) "printing" "printing.el"
21020;;;;;; (20721 17977 14204 0)) 21020;;;;;; (20891 44219 680764 0))
21021;;; Generated autoloads from printing.el 21021;;; Generated autoloads from printing.el
21022 21022
21023(autoload 'pr-interface "printing" "\ 21023(autoload 'pr-interface "printing" "\
@@ -21654,7 +21654,7 @@ Open profile FILENAME.
21654;;;*** 21654;;;***
21655 21655
21656;;;### (autoloads (run-prolog mercury-mode prolog-mode) "prolog" 21656;;;### (autoloads (run-prolog mercury-mode prolog-mode) "prolog"
21657;;;;;; "progmodes/prolog.el" (20851 48294 960738 0)) 21657;;;;;; "progmodes/prolog.el" (20891 18859 893295 0))
21658;;; Generated autoloads from progmodes/prolog.el 21658;;; Generated autoloads from progmodes/prolog.el
21659 21659
21660(autoload 'prolog-mode "prolog" "\ 21660(autoload 'prolog-mode "prolog" "\
@@ -21753,8 +21753,8 @@ Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number
21753;;;;;; ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer 21753;;;;;; ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
21754;;;;;; ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces 21754;;;;;; ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
21755;;;;;; ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type 21755;;;;;; ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
21756;;;;;; ps-page-dimensions-database) "ps-print" "ps-print.el" (20721 21756;;;;;; ps-page-dimensions-database) "ps-print" "ps-print.el" (20874
21757;;;;;; 17977 14204 0)) 21757;;;;;; 65006 672942 217000))
21758;;; Generated autoloads from ps-print.el 21758;;; Generated autoloads from ps-print.el
21759 21759
21760(defvar ps-page-dimensions-database (purecopy (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list 'letter (* 72 8.5) (* 72 11.0) "Letter") (list 'legal (* 72 8.5) (* 72 14.0) "Legal") (list 'letter-small (* 72 7.68) (* 72 10.16) "LetterSmall") (list 'tabloid (* 72 11.0) (* 72 17.0) "Tabloid") (list 'ledger (* 72 17.0) (* 72 11.0) "Ledger") (list 'statement (* 72 5.5) (* 72 8.5) "Statement") (list 'executive (* 72 7.5) (* 72 10.0) "Executive") (list 'a4small (* 72 7.47) (* 72 10.85) "A4Small") (list 'b4 (* 72 10.125) (* 72 14.33) "B4") (list 'b5 (* 72 7.16) (* 72 10.125) "B5") '(addresslarge 236.0 99.0 "AddressLarge") '(addresssmall 236.0 68.0 "AddressSmall") '(cuthanging13 90.0 222.0 "CutHanging13") '(cuthanging15 90.0 114.0 "CutHanging15") '(diskette 181.0 136.0 "Diskette") '(eurofilefolder 139.0 112.0 "EuropeanFilefolder") '(eurofoldernarrow 526.0 107.0 "EuroFolderNarrow") '(eurofolderwide 526.0 136.0 "EuroFolderWide") '(euronamebadge 189.0 108.0 "EuroNameBadge") '(euronamebadgelarge 223.0 136.0 "EuroNameBadgeLarge") '(filefolder 230.0 37.0 "FileFolder") '(jewelry 76.0 136.0 "Jewelry") '(mediabadge 180.0 136.0 "MediaBadge") '(multipurpose 126.0 68.0 "MultiPurpose") '(retaillabel 90.0 104.0 "RetailLabel") '(shipping 271.0 136.0 "Shipping") '(slide35mm 26.0 104.0 "Slide35mm") '(spine8mm 187.0 26.0 "Spine8mm") '(topcoated 425.19685 136.0 "TopCoatedPaper") '(topcoatedpaper 396.0 136.0 "TopcoatedPaper150") '(vhsface 205.0 127.0 "VHSFace") '(vhsspine 400.0 50.0 "VHSSpine") '(zipdisk 156.0 136.0 "ZipDisk"))) "\ 21760(defvar ps-page-dimensions-database (purecopy (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list 'letter (* 72 8.5) (* 72 11.0) "Letter") (list 'legal (* 72 8.5) (* 72 14.0) "Legal") (list 'letter-small (* 72 7.68) (* 72 10.16) "LetterSmall") (list 'tabloid (* 72 11.0) (* 72 17.0) "Tabloid") (list 'ledger (* 72 17.0) (* 72 11.0) "Ledger") (list 'statement (* 72 5.5) (* 72 8.5) "Statement") (list 'executive (* 72 7.5) (* 72 10.0) "Executive") (list 'a4small (* 72 7.47) (* 72 10.85) "A4Small") (list 'b4 (* 72 10.125) (* 72 14.33) "B4") (list 'b5 (* 72 7.16) (* 72 10.125) "B5") '(addresslarge 236.0 99.0 "AddressLarge") '(addresssmall 236.0 68.0 "AddressSmall") '(cuthanging13 90.0 222.0 "CutHanging13") '(cuthanging15 90.0 114.0 "CutHanging15") '(diskette 181.0 136.0 "Diskette") '(eurofilefolder 139.0 112.0 "EuropeanFilefolder") '(eurofoldernarrow 526.0 107.0 "EuroFolderNarrow") '(eurofolderwide 526.0 136.0 "EuroFolderWide") '(euronamebadge 189.0 108.0 "EuroNameBadge") '(euronamebadgelarge 223.0 136.0 "EuroNameBadgeLarge") '(filefolder 230.0 37.0 "FileFolder") '(jewelry 76.0 136.0 "Jewelry") '(mediabadge 180.0 136.0 "MediaBadge") '(multipurpose 126.0 68.0 "MultiPurpose") '(retaillabel 90.0 104.0 "RetailLabel") '(shipping 271.0 136.0 "Shipping") '(slide35mm 26.0 104.0 "Slide35mm") '(spine8mm 187.0 26.0 "Spine8mm") '(topcoated 425.19685 136.0 "TopCoatedPaper") '(topcoatedpaper 396.0 136.0 "TopcoatedPaper150") '(vhsface 205.0 127.0 "VHSFace") '(vhsspine 400.0 50.0 "VHSSpine") '(zipdisk 156.0 136.0 "ZipDisk"))) "\
@@ -21951,7 +21951,7 @@ If EXTENSION is any other symbol, it is ignored.
21951;;;*** 21951;;;***
21952 21952
21953;;;### (autoloads (python-mode run-python) "python" "progmodes/python.el" 21953;;;### (autoloads (python-mode run-python) "python" "progmodes/python.el"
21954;;;;;; (20850 27430 515630 0)) 21954;;;;;; (20874 65006 672942 217000))
21955;;; Generated autoloads from progmodes/python.el 21955;;; Generated autoloads from progmodes/python.el
21956 21956
21957(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode)) 21957(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode))
@@ -22383,8 +22383,8 @@ matching parts of the target buffer will be highlighted.
22383 22383
22384;;;*** 22384;;;***
22385 22385
22386;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (20799 169 22386;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (20871 33574
22387;;;;;; 640767 0)) 22387;;;;;; 214287 0))
22388;;; Generated autoloads from recentf.el 22388;;; Generated autoloads from recentf.el
22389 22389
22390(defvar recentf-mode nil "\ 22390(defvar recentf-mode nil "\
@@ -22548,8 +22548,8 @@ with a prefix argument, prompt for START-AT and FORMAT.
22548 22548
22549;;;*** 22549;;;***
22550 22550
22551;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (20709 22551;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (20884
22552;;;;;; 26818 907104 0)) 22552;;;;;; 7264 912957 506000))
22553;;; Generated autoloads from textmodes/refill.el 22553;;; Generated autoloads from textmodes/refill.el
22554 22554
22555(autoload 'refill-mode "refill" "\ 22555(autoload 'refill-mode "refill" "\
@@ -22570,8 +22570,8 @@ For true \"word wrap\" behavior, use `visual-line-mode' instead.
22570;;;*** 22570;;;***
22571 22571
22572;;;### (autoloads (reftex-reset-scanning-information reftex-mode 22572;;;### (autoloads (reftex-reset-scanning-information reftex-mode
22573;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20843 54187 22573;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20895 15912
22574;;;;;; 671468 0)) 22574;;;;;; 444844 0))
22575;;; Generated autoloads from textmodes/reftex.el 22575;;; Generated autoloads from textmodes/reftex.el
22576 22576
22577(autoload 'turn-on-reftex "reftex" "\ 22577(autoload 'turn-on-reftex "reftex" "\
@@ -22701,7 +22701,7 @@ Here are all local bindings.
22701;;;*** 22701;;;***
22702 22702
22703;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el" 22703;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el"
22704;;;;;; (20858 21542 723007 0)) 22704;;;;;; (20895 15912 444844 0))
22705;;; Generated autoloads from textmodes/reftex-parse.el 22705;;; Generated autoloads from textmodes/reftex-parse.el
22706 22706
22707(autoload 'reftex-all-document-files "reftex-parse" "\ 22707(autoload 'reftex-all-document-files "reftex-parse" "\
@@ -22713,8 +22713,8 @@ of master file.
22713 22713
22714;;;*** 22714;;;***
22715 22715
22716;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20858 22716;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20895
22717;;;;;; 21542 723007 0)) 22717;;;;;; 15912 444844 0))
22718;;; Generated autoloads from textmodes/reftex-vars.el 22718;;; Generated autoloads from textmodes/reftex-vars.el
22719(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) 22719(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
22720(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) 22720(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
@@ -22755,7 +22755,7 @@ This means the number of non-shy regexp grouping constructs
22755 22755
22756;;;### (autoloads (remember-diary-extract-entries remember-clipboard 22756;;;### (autoloads (remember-diary-extract-entries remember-clipboard
22757;;;;;; remember-other-frame remember) "remember" "textmodes/remember.el" 22757;;;;;; remember-other-frame remember) "remember" "textmodes/remember.el"
22758;;;;;; (20859 42406 744769 0)) 22758;;;;;; (20874 65006 672942 217000))
22759;;; Generated autoloads from textmodes/remember.el 22759;;; Generated autoloads from textmodes/remember.el
22760 22760
22761(autoload 'remember "remember" "\ 22761(autoload 'remember "remember" "\
@@ -22919,8 +22919,8 @@ Make a ring that can contain SIZE elements.
22919 22919
22920;;;*** 22920;;;***
22921 22921
22922;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (20709 26818 22922;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (20903 10024
22923;;;;;; 907104 0)) 22923;;;;;; 645978 0))
22924;;; Generated autoloads from net/rlogin.el 22924;;; Generated autoloads from net/rlogin.el
22925 22925
22926(autoload 'rlogin "rlogin" "\ 22926(autoload 'rlogin "rlogin" "\
@@ -22969,7 +22969,7 @@ variable.
22969;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers 22969;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers
22970;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers 22970;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers
22971;;;;;; rmail-user-mail-address-regexp rmail-movemail-variant-p rmail-spool-directory 22971;;;;;; rmail-user-mail-address-regexp rmail-movemail-variant-p rmail-spool-directory
22972;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20762 9398 526093 22972;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20892 39729 858825
22973;;;;;; 0)) 22973;;;;;; 0))
22974;;; Generated autoloads from mail/rmail.el 22974;;; Generated autoloads from mail/rmail.el
22975 22975
@@ -23259,7 +23259,7 @@ Validation will be enabled if `rng-nxml-auto-validate-flag' is non-nil.
23259;;;*** 23259;;;***
23260 23260
23261;;;### (autoloads (rng-validate-mode) "rng-valid" "nxml/rng-valid.el" 23261;;;### (autoloads (rng-validate-mode) "rng-valid" "nxml/rng-valid.el"
23262;;;;;; (20814 53928 50501 0)) 23262;;;;;; (20884 6711 386198 0))
23263;;; Generated autoloads from nxml/rng-valid.el 23263;;; Generated autoloads from nxml/rng-valid.el
23264 23264
23265(autoload 'rng-validate-mode "rng-valid" "\ 23265(autoload 'rng-validate-mode "rng-valid" "\
@@ -23390,7 +23390,7 @@ Toggle the use of ROT13 encoding for the current window.
23390;;;*** 23390;;;***
23391 23391
23392;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el" 23392;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el"
23393;;;;;; (20709 26818 907104 0)) 23393;;;;;; (20884 7264 912957 506000))
23394;;; Generated autoloads from textmodes/rst.el 23394;;; Generated autoloads from textmodes/rst.el
23395 (add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode))) 23395 (add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode)))
23396 23396
@@ -23421,7 +23421,7 @@ for modes derived from Text mode, like Mail mode.
23421;;;*** 23421;;;***
23422 23422
23423;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el" 23423;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el"
23424;;;;;; (20845 9511 656701 0)) 23424;;;;;; (20905 51752 865679 0))
23425;;; Generated autoloads from progmodes/ruby-mode.el 23425;;; Generated autoloads from progmodes/ruby-mode.el
23426 23426
23427(autoload 'ruby-mode "ruby-mode" "\ 23427(autoload 'ruby-mode "ruby-mode" "\
@@ -23973,7 +23973,7 @@ Semantic mode.
23973;;;*** 23973;;;***
23974 23974
23975;;;### (autoloads (bovine-grammar-mode) "semantic/bovine/grammar" 23975;;;### (autoloads (bovine-grammar-mode) "semantic/bovine/grammar"
23976;;;;;; "cedet/semantic/bovine/grammar.el" (20709 26818 907104 0)) 23976;;;;;; "cedet/semantic/bovine/grammar.el" (20895 15912 444844 0))
23977;;; Generated autoloads from cedet/semantic/bovine/grammar.el 23977;;; Generated autoloads from cedet/semantic/bovine/grammar.el
23978 23978
23979(autoload 'bovine-grammar-mode "semantic/bovine/grammar" "\ 23979(autoload 'bovine-grammar-mode "semantic/bovine/grammar" "\
@@ -23984,7 +23984,7 @@ Major mode for editing Bovine grammars.
23984;;;*** 23984;;;***
23985 23985
23986;;;### (autoloads (wisent-grammar-mode) "semantic/wisent/grammar" 23986;;;### (autoloads (wisent-grammar-mode) "semantic/wisent/grammar"
23987;;;;;; "cedet/semantic/wisent/grammar.el" (20709 26818 907104 0)) 23987;;;;;; "cedet/semantic/wisent/grammar.el" (20879 27694 495748 0))
23988;;; Generated autoloads from cedet/semantic/wisent/grammar.el 23988;;; Generated autoloads from cedet/semantic/wisent/grammar.el
23989 23989
23990(autoload 'wisent-grammar-mode "semantic/wisent/grammar" "\ 23990(autoload 'wisent-grammar-mode "semantic/wisent/grammar" "\
@@ -24591,7 +24591,7 @@ Set up file shadowing.
24591;;;*** 24591;;;***
24592 24592
24593;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el" 24593;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
24594;;;;;; (20709 26818 907104 0)) 24594;;;;;; (20884 7264 912957 506000))
24595;;; Generated autoloads from shell.el 24595;;; Generated autoloads from shell.el
24596 24596
24597(defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\ 24597(defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
@@ -24639,8 +24639,8 @@ Otherwise, one argument `-i' is passed to the shell.
24639 24639
24640;;;*** 24640;;;***
24641 24641
24642;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20845 24642;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20903
24643;;;;;; 9511 656701 0)) 24643;;;;;; 10024 645978 0))
24644;;; Generated autoloads from gnus/shr.el 24644;;; Generated autoloads from gnus/shr.el
24645 24645
24646(autoload 'shr-insert-document "shr" "\ 24646(autoload 'shr-insert-document "shr" "\
@@ -24653,7 +24653,7 @@ DOM should be a parse tree as generated by
24653;;;*** 24653;;;***
24654 24654
24655;;;### (autoloads (sieve-upload-and-kill sieve-upload-and-bury sieve-upload 24655;;;### (autoloads (sieve-upload-and-kill sieve-upload-and-bury sieve-upload
24656;;;;;; sieve-manage) "sieve" "gnus/sieve.el" (20709 26818 907104 24656;;;;;; sieve-manage) "sieve" "gnus/sieve.el" (20896 36774 886399
24657;;;;;; 0)) 24657;;;;;; 0))
24658;;; Generated autoloads from gnus/sieve.el 24658;;; Generated autoloads from gnus/sieve.el
24659 24659
@@ -24885,6 +24885,30 @@ If no conflict maker is found, turn off `smerge-mode'.
24885 24885
24886;;;*** 24886;;;***
24887 24887
24888;;;### (autoloads (smie-highlight-matching-block-mode) "smie" "emacs-lisp/smie.el"
24889;;;;;; (20901 54695 989166 0))
24890;;; Generated autoloads from emacs-lisp/smie.el
24891
24892(defvar smie-highlight-matching-block-mode nil "\
24893Non-nil if Smie-Highlight-Matching-Block mode is enabled.
24894See the command `smie-highlight-matching-block-mode' for a description of this minor mode.
24895Setting this variable directly does not take effect;
24896either customize it (see the info node `Easy Customization')
24897or call the function `smie-highlight-matching-block-mode'.")
24898
24899(custom-autoload 'smie-highlight-matching-block-mode "smie" nil)
24900
24901(autoload 'smie-highlight-matching-block-mode "smie" "\
24902Toggle Smie-Highlight-Matching-Block mode on or off.
24903With a prefix argument ARG, enable Smie-Highlight-Matching-Block mode if ARG is
24904positive, and disable it otherwise. If called from Lisp, enable
24905the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
24906\\{smie-highlight-matching-block-mode-map}
24907
24908\(fn &optional ARG)" t nil)
24909
24910;;;***
24911
24888;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el" 24912;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el"
24889;;;;;; (20726 5184 974741 509000)) 24913;;;;;; (20726 5184 974741 509000))
24890;;; Generated autoloads from gnus/smiley.el 24914;;; Generated autoloads from gnus/smiley.el
@@ -24944,7 +24968,7 @@ Snake mode keybindings:
24944;;;*** 24968;;;***
24945 24969
24946;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el" 24970;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el"
24947;;;;;; (20709 26818 907104 0)) 24971;;;;;; (20891 18859 893295 0))
24948;;; Generated autoloads from net/snmp-mode.el 24972;;; Generated autoloads from net/snmp-mode.el
24949 24973
24950(autoload 'snmp-mode "snmp-mode" "\ 24974(autoload 'snmp-mode "snmp-mode" "\
@@ -25067,8 +25091,8 @@ Pick your favorite shortcuts:
25067 25091
25068;;;### (autoloads (delete-duplicate-lines reverse-region sort-columns 25092;;;### (autoloads (delete-duplicate-lines reverse-region sort-columns
25069;;;;;; sort-regexp-fields sort-fields sort-numeric-fields sort-pages 25093;;;;;; sort-regexp-fields sort-fields sort-numeric-fields sort-pages
25070;;;;;; sort-paragraphs sort-lines sort-subr) "sort" "sort.el" (20709 25094;;;;;; sort-paragraphs sort-lines sort-subr) "sort" "sort.el" (20896
25071;;;;;; 26818 907104 0)) 25095;;;;;; 36774 886399 0))
25072;;; Generated autoloads from sort.el 25096;;; Generated autoloads from sort.el
25073(put 'sort-fold-case 'safe-local-variable 'booleanp) 25097(put 'sort-fold-case 'safe-local-variable 'booleanp)
25074 25098
@@ -25234,16 +25258,19 @@ delete repeated lines only if they are adjacent. It works like the utility
25234this is more efficient in performance and memory usage than when ADJACENT 25258this is more efficient in performance and memory usage than when ADJACENT
25235is nil that uses additional memory to remember previous lines. 25259is nil that uses additional memory to remember previous lines.
25236 25260
25261If KEEP-BLANKS is non-nil (when called interactively with three C-u prefixes),
25262duplicate blank lines are preserved.
25263
25237When called from Lisp and INTERACTIVE is omitted or nil, return the number 25264When called from Lisp and INTERACTIVE is omitted or nil, return the number
25238of deleted duplicate lines, do not print it; if INTERACTIVE is t, the 25265of deleted duplicate lines, do not print it; if INTERACTIVE is t, the
25239function behaves in all respects as if it had been called interactively. 25266function behaves in all respects as if it had been called interactively.
25240 25267
25241\(fn BEG END &optional REVERSE ADJACENT INTERACTIVE)" t nil) 25268\(fn BEG END &optional REVERSE ADJACENT KEEP-BLANKS INTERACTIVE)" t nil)
25242 25269
25243;;;*** 25270;;;***
25244 25271
25245;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (20709 25272;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (20901
25246;;;;;; 26818 907104 0)) 25273;;;;;; 54695 989166 0))
25247;;; Generated autoloads from gnus/spam.el 25274;;; Generated autoloads from gnus/spam.el
25248 25275
25249(autoload 'spam-initialize "spam" "\ 25276(autoload 'spam-initialize "spam" "\
@@ -25259,7 +25286,7 @@ installed through `spam-necessary-extra-headers'.
25259 25286
25260;;;### (autoloads (spam-report-deagentize spam-report-agentize spam-report-url-to-file 25287;;;### (autoloads (spam-report-deagentize spam-report-agentize spam-report-url-to-file
25261;;;;;; spam-report-url-ping-mm-url spam-report-process-queue) "spam-report" 25288;;;;;; spam-report-url-ping-mm-url spam-report-process-queue) "spam-report"
25262;;;;;; "gnus/spam-report.el" (20709 26818 907104 0)) 25289;;;;;; "gnus/spam-report.el" (20874 65006 672942 217000))
25263;;; Generated autoloads from gnus/spam-report.el 25290;;; Generated autoloads from gnus/spam-report.el
25264 25291
25265(autoload 'spam-report-process-queue "spam-report" "\ 25292(autoload 'spam-report-process-queue "spam-report" "\
@@ -25302,7 +25329,7 @@ Spam reports will be queued with the method used when
25302;;;*** 25329;;;***
25303 25330
25304;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar" 25331;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
25305;;;;;; "speedbar.el" (20709 26818 907104 0)) 25332;;;;;; "speedbar.el" (20892 39729 858825 0))
25306;;; Generated autoloads from speedbar.el 25333;;; Generated autoloads from speedbar.el
25307 25334
25308(defalias 'speedbar 'speedbar-frame-mode) 25335(defalias 'speedbar 'speedbar-frame-mode)
@@ -25346,7 +25373,7 @@ Return a vector containing the lines from `spook-phrases-file'.
25346;;;;;; sql-ms sql-ingres sql-solid sql-mysql sql-sqlite sql-informix 25373;;;;;; sql-ms sql-ingres sql-solid sql-mysql sql-sqlite sql-informix
25347;;;;;; sql-sybase sql-oracle sql-product-interactive sql-connect 25374;;;;;; sql-sybase sql-oracle sql-product-interactive sql-connect
25348;;;;;; sql-mode sql-add-product-keywords) "sql" "progmodes/sql.el" 25375;;;;;; sql-mode sql-add-product-keywords) "sql" "progmodes/sql.el"
25349;;;;;; (20797 44848 327754 0)) 25376;;;;;; (20878 6823 881439 0))
25350;;; Generated autoloads from progmodes/sql.el 25377;;; Generated autoloads from progmodes/sql.el
25351 25378
25352(autoload 'sql-add-product-keywords "sql" "\ 25379(autoload 'sql-add-product-keywords "sql" "\
@@ -25985,8 +26012,8 @@ Studlify-case the current buffer.
25985;;;*** 26012;;;***
25986 26013
25987;;;### (autoloads (global-superword-mode superword-mode global-subword-mode 26014;;;### (autoloads (global-superword-mode superword-mode global-subword-mode
25988;;;;;; subword-mode) "subword" "progmodes/subword.el" (20822 48073 26015;;;;;; subword-mode) "subword" "progmodes/subword.el" (20886 47777
25989;;;;;; 524485 0)) 26016;;;;;; 83668 440000))
25990;;; Generated autoloads from progmodes/subword.el 26017;;; Generated autoloads from progmodes/subword.el
25991 26018
25992(autoload 'subword-mode "subword" "\ 26019(autoload 'subword-mode "subword" "\
@@ -26786,8 +26813,8 @@ Connect to the Emacs talk group from the current X display or tty frame.
26786 26813
26787;;;*** 26814;;;***
26788 26815
26789;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20709 26818 26816;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20874 65222
26790;;;;;; 907104 0)) 26817;;;;;; 672942 464000))
26791;;; Generated autoloads from tar-mode.el 26818;;; Generated autoloads from tar-mode.el
26792 26819
26793(autoload 'tar-mode "tar-mode" "\ 26820(autoload 'tar-mode "tar-mode" "\
@@ -26811,7 +26838,7 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
26811;;;*** 26838;;;***
26812 26839
26813;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl" 26840;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
26814;;;;;; "progmodes/tcl.el" (20774 53405 704746 172000)) 26841;;;;;; "progmodes/tcl.el" (20903 10024 645978 0))
26815;;; Generated autoloads from progmodes/tcl.el 26842;;; Generated autoloads from progmodes/tcl.el
26816 26843
26817(autoload 'tcl-mode "tcl" "\ 26844(autoload 'tcl-mode "tcl" "\
@@ -26886,7 +26913,7 @@ Normally input is edited in Emacs and sent a line at a time.
26886;;;*** 26913;;;***
26887 26914
26888;;;### (autoloads (serial-term ansi-term term make-term) "term" "term.el" 26915;;;### (autoloads (serial-term ansi-term term make-term) "term" "term.el"
26889;;;;;; (20712 3008 596088 0)) 26916;;;;;; (20878 6823 881439 0))
26890;;; Generated autoloads from term.el 26917;;; Generated autoloads from term.el
26891 26918
26892(autoload 'make-term "term" "\ 26919(autoload 'make-term "term" "\
@@ -26929,7 +26956,7 @@ use in that buffer.
26929;;;*** 26956;;;***
26930 26957
26931;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el" 26958;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el"
26932;;;;;; (20709 26818 907104 0)) 26959;;;;;; (20878 6823 881439 0))
26933;;; Generated autoloads from emacs-lisp/testcover.el 26960;;; Generated autoloads from emacs-lisp/testcover.el
26934 26961
26935(autoload 'testcover-this-defun "testcover" "\ 26962(autoload 'testcover-this-defun "testcover" "\
@@ -26939,8 +26966,8 @@ Start coverage on function under point.
26939 26966
26940;;;*** 26967;;;***
26941 26968
26942;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20709 26818 26969;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20874 65006
26943;;;;;; 907104 0)) 26970;;;;;; 672942 217000))
26944;;; Generated autoloads from play/tetris.el 26971;;; Generated autoloads from play/tetris.el
26945 26972
26946(autoload 'tetris "tetris" "\ 26973(autoload 'tetris "tetris" "\
@@ -27428,7 +27455,7 @@ Compose Thai characters in the current buffer.
27428 27455
27429;;;### (autoloads (list-at-point number-at-point symbol-at-point 27456;;;### (autoloads (list-at-point number-at-point symbol-at-point
27430;;;;;; sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing) 27457;;;;;; sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
27431;;;;;; "thingatpt" "thingatpt.el" (20822 48073 524485 0)) 27458;;;;;; "thingatpt" "thingatpt.el" (20874 62962 290468 0))
27432;;; Generated autoloads from thingatpt.el 27459;;; Generated autoloads from thingatpt.el
27433 27460
27434(autoload 'forward-thing "thingatpt" "\ 27461(autoload 'forward-thing "thingatpt" "\
@@ -27462,10 +27489,13 @@ Possibilities include `symbol', `list', `sexp', `defun',
27462`filename', `url', `email', `word', `sentence', `whitespace', 27489`filename', `url', `email', `word', `sentence', `whitespace',
27463`line', `number', and `page'. 27490`line', `number', and `page'.
27464 27491
27492When the optional argument NO-PROPERTIES is non-nil,
27493strip text properties from the return value.
27494
27465See the file `thingatpt.el' for documentation on how to define 27495See the file `thingatpt.el' for documentation on how to define
27466a symbol as a valid THING. 27496a symbol as a valid THING.
27467 27497
27468\(fn THING)" nil nil) 27498\(fn THING &optional NO-PROPERTIES)" nil nil)
27469 27499
27470(autoload 'sexp-at-point "thingatpt" "\ 27500(autoload 'sexp-at-point "thingatpt" "\
27471Return the sexp at point, or nil if none is found. 27501Return the sexp at point, or nil if none is found.
@@ -28145,7 +28175,7 @@ holds a keymap.
28145;;;*** 28175;;;***
28146 28176
28147;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el" 28177;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
28148;;;;;; (20709 26818 907104 0)) 28178;;;;;; (20884 7264 412929 442000))
28149;;; Generated autoloads from emulation/tpu-edt.el 28179;;; Generated autoloads from emulation/tpu-edt.el
28150 28180
28151(defvar tpu-edt-mode nil "\ 28181(defvar tpu-edt-mode nil "\
@@ -28225,7 +28255,7 @@ to a tcp server on another machine.
28225 28255
28226;;;### (autoloads (trace-function-background trace-function-foreground 28256;;;### (autoloads (trace-function-background trace-function-foreground
28227;;;;;; trace-values trace-buffer) "trace" "emacs-lisp/trace.el" 28257;;;;;; trace-values trace-buffer) "trace" "emacs-lisp/trace.el"
28228;;;;;; (20842 33318 816618 0)) 28258;;;;;; (20903 10024 645978 0))
28229;;; Generated autoloads from emacs-lisp/trace.el 28259;;; Generated autoloads from emacs-lisp/trace.el
28230 28260
28231(defvar trace-buffer "*trace-output*" "\ 28261(defvar trace-buffer "*trace-output*" "\
@@ -28495,7 +28525,7 @@ First column's text sSs Second column's text
28495 28525
28496;;;### (autoloads (type-break-guesstimate-keystroke-threshold type-break-statistics 28526;;;### (autoloads (type-break-guesstimate-keystroke-threshold type-break-statistics
28497;;;;;; type-break type-break-mode) "type-break" "type-break.el" 28527;;;;;; type-break type-break-mode) "type-break" "type-break.el"
28498;;;;;; (20799 169 640767 0)) 28528;;;;;; (20884 7264 912957 506000))
28499;;; Generated autoloads from type-break.el 28529;;; Generated autoloads from type-break.el
28500 28530
28501(defvar type-break-mode nil "\ 28531(defvar type-break-mode nil "\
@@ -28733,7 +28763,7 @@ which specify the range to operate on.
28733;;;*** 28763;;;***
28734 28764
28735;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el" 28765;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el"
28736;;;;;; (20731 53823 676680 0)) 28766;;;;;; (20895 15912 444844 0))
28737;;; Generated autoloads from mail/unrmail.el 28767;;; Generated autoloads from mail/unrmail.el
28738 28768
28739(autoload 'batch-unrmail "unrmail" "\ 28769(autoload 'batch-unrmail "unrmail" "\
@@ -28767,7 +28797,7 @@ UNSAFEP-VARS is a list of symbols with local bindings.
28767;;;*** 28797;;;***
28768 28798
28769;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url" 28799;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
28770;;;;;; "url/url.el" (20709 26818 907104 0)) 28800;;;;;; "url/url.el" (20893 60586 188550 0))
28771;;; Generated autoloads from url/url.el 28801;;; Generated autoloads from url/url.el
28772 28802
28773(autoload 'url-retrieve "url" "\ 28803(autoload 'url-retrieve "url" "\
@@ -28890,7 +28920,7 @@ Extract FNAM from the local disk cache.
28890;;;*** 28920;;;***
28891 28921
28892;;;### (autoloads (url-dav-vc-registered url-dav-request url-dav-supported-p) 28922;;;### (autoloads (url-dav-vc-registered url-dav-request url-dav-supported-p)
28893;;;;;; "url-dav" "url/url-dav.el" (20709 26818 907104 0)) 28923;;;;;; "url-dav" "url/url-dav.el" (20891 18859 893295 0))
28894;;; Generated autoloads from url/url-dav.el 28924;;; Generated autoloads from url/url-dav.el
28895 28925
28896(autoload 'url-dav-supported-p "url-dav" "\ 28926(autoload 'url-dav-supported-p "url-dav" "\
@@ -28956,7 +28986,7 @@ Might do a non-blocking connection; use `process-status' to check.
28956 28986
28957;;;### (autoloads (url-insert-file-contents url-file-local-copy url-copy-file 28987;;;### (autoloads (url-insert-file-contents url-file-local-copy url-copy-file
28958;;;;;; url-file-handler url-handler-mode) "url-handlers" "url/url-handlers.el" 28988;;;;;; url-file-handler url-handler-mode) "url-handlers" "url/url-handlers.el"
28959;;;;;; (20709 26818 907104 0)) 28989;;;;;; (20892 39729 858825 0))
28960;;; Generated autoloads from url/url-handlers.el 28990;;; Generated autoloads from url/url-handlers.el
28961 28991
28962(defvar url-handler-mode nil "\ 28992(defvar url-handler-mode nil "\
@@ -29098,7 +29128,7 @@ Fetch a data URL (RFC 2397).
29098;;;*** 29128;;;***
29099 29129
29100;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el" 29130;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el"
29101;;;;;; (20709 26818 907104 0)) 29131;;;;;; (20884 7264 912957 506000))
29102;;; Generated autoloads from url/url-news.el 29132;;; Generated autoloads from url/url-news.el
29103 29133
29104(autoload 'url-news "url-news" "\ 29134(autoload 'url-news "url-news" "\
@@ -29832,7 +29862,7 @@ mode-specific menu. `vc-annotate-color-map' and
29832 29862
29833;;;*** 29863;;;***
29834 29864
29835;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20748 62911 684442 29865;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20900 33838 319219
29836;;;;;; 0)) 29866;;;;;; 0))
29837;;; Generated autoloads from vc/vc-arch.el 29867;;; Generated autoloads from vc/vc-arch.el
29838 (defun vc-arch-registered (file) 29868 (defun vc-arch-registered (file)
@@ -29843,8 +29873,8 @@ mode-specific menu. `vc-annotate-color-map' and
29843 29873
29844;;;*** 29874;;;***
29845 29875
29846;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20856 32310 242920 29876;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20900 33838 319219
29847;;;;;; 705000)) 29877;;;;;; 0))
29848;;; Generated autoloads from vc/vc-bzr.el 29878;;; Generated autoloads from vc/vc-bzr.el
29849 29879
29850(defconst vc-bzr-admin-dirname ".bzr" "\ 29880(defconst vc-bzr-admin-dirname ".bzr" "\
@@ -29860,7 +29890,7 @@ Name of the format file in a .bzr directory.")
29860 29890
29861;;;*** 29891;;;***
29862 29892
29863;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20855 45357 683214 29893;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20900 33838 319219
29864;;;;;; 0)) 29894;;;;;; 0))
29865;;; Generated autoloads from vc/vc-cvs.el 29895;;; Generated autoloads from vc/vc-cvs.el
29866(defun vc-cvs-registered (f) 29896(defun vc-cvs-registered (f)
@@ -29872,49 +29902,10 @@ Name of the format file in a .bzr directory.")
29872 29902
29873;;;*** 29903;;;***
29874 29904
29875;;;### (autoloads (vc-dir vc-dir-mode) "vc-dir" "vc/vc-dir.el" (20709 29905;;;### (autoloads (vc-dir) "vc-dir" "vc/vc-dir.el" (20900 33838 319219
29876;;;;;; 26818 907104 0)) 29906;;;;;; 0))
29877;;; Generated autoloads from vc/vc-dir.el 29907;;; Generated autoloads from vc/vc-dir.el
29878 29908
29879(autoload 'vc-dir-mode "vc-dir" "\
29880Major mode for VC directory buffers.
29881Marking/Unmarking key bindings and actions:
29882m - mark a file/directory
29883 - if the region is active, mark all the files in region.
29884 Restrictions: - a file cannot be marked if any parent directory is marked
29885 - a directory cannot be marked if any child file or
29886 directory is marked
29887u - unmark a file/directory
29888 - if the region is active, unmark all the files in region.
29889M - if the cursor is on a file: mark all the files with the same state as
29890 the current file
29891 - if the cursor is on a directory: mark all child files
29892 - with a prefix argument: mark all files
29893U - if the cursor is on a file: unmark all the files with the same state
29894 as the current file
29895 - if the cursor is on a directory: unmark all child files
29896 - with a prefix argument: unmark all files
29897mouse-2 - toggles the mark state
29898
29899VC commands
29900VC commands in the `C-x v' prefix can be used.
29901VC commands act on the marked entries. If nothing is marked, VC
29902commands act on the current entry.
29903
29904Search & Replace
29905S - searches the marked files
29906Q - does a query replace on the marked files
29907M-s a C-s - does an isearch on the marked files
29908M-s a C-M-s - does a regexp isearch on the marked files
29909If nothing is marked, these commands act on the current entry.
29910When a directory is current or marked, the Search & Replace
29911commands act on the child files of that directory that are displayed in
29912the *vc-dir* buffer.
29913
29914\\{vc-dir-mode-map}
29915
29916\(fn)" t nil)
29917
29918(autoload 'vc-dir "vc-dir" "\ 29909(autoload 'vc-dir "vc-dir" "\
29919Show the VC status for \"interesting\" files in and below DIR. 29910Show the VC status for \"interesting\" files in and below DIR.
29920This allows you to mark files and perform VC operations on them. 29911This allows you to mark files and perform VC operations on them.
@@ -29960,7 +29951,7 @@ case, and the process object in the asynchronous case.
29960 29951
29961;;;*** 29952;;;***
29962 29953
29963;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20855 45357 683214 29954;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20900 33838 319219
29964;;;;;; 0)) 29955;;;;;; 0))
29965;;; Generated autoloads from vc/vc-git.el 29956;;; Generated autoloads from vc/vc-git.el
29966 (defun vc-git-registered (file) 29957 (defun vc-git-registered (file)
@@ -29972,7 +29963,7 @@ case, and the process object in the asynchronous case.
29972 29963
29973;;;*** 29964;;;***
29974 29965
29975;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20855 45357 683214 0)) 29966;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20900 33838 319219 0))
29976;;; Generated autoloads from vc/vc-hg.el 29967;;; Generated autoloads from vc/vc-hg.el
29977 (defun vc-hg-registered (file) 29968 (defun vc-hg-registered (file)
29978 "Return non-nil if FILE is registered with hg." 29969 "Return non-nil if FILE is registered with hg."
@@ -29983,7 +29974,7 @@ case, and the process object in the asynchronous case.
29983 29974
29984;;;*** 29975;;;***
29985 29976
29986;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20855 45357 683214 29977;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20900 33838 319219
29987;;;;;; 0)) 29978;;;;;; 0))
29988;;; Generated autoloads from vc/vc-mtn.el 29979;;; Generated autoloads from vc/vc-mtn.el
29989 29980
@@ -30001,7 +29992,7 @@ Name of the monotone directory's format file.")
30001;;;*** 29992;;;***
30002 29993
30003;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc/vc-rcs.el" 29994;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc/vc-rcs.el"
30004;;;;;; (20855 45357 683214 0)) 29995;;;;;; (20900 33838 319219 0))
30005;;; Generated autoloads from vc/vc-rcs.el 29996;;; Generated autoloads from vc/vc-rcs.el
30006 29997
30007(defvar vc-rcs-master-templates (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) "\ 29998(defvar vc-rcs-master-templates (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) "\
@@ -30015,7 +30006,7 @@ For a description of possible values, see `vc-check-master-templates'.")
30015;;;*** 30006;;;***
30016 30007
30017;;;### (autoloads (vc-sccs-master-templates) "vc-sccs" "vc/vc-sccs.el" 30008;;;### (autoloads (vc-sccs-master-templates) "vc-sccs" "vc/vc-sccs.el"
30018;;;;;; (20855 45357 683214 0)) 30009;;;;;; (20900 33838 319219 0))
30019;;; Generated autoloads from vc/vc-sccs.el 30010;;; Generated autoloads from vc/vc-sccs.el
30020 30011
30021(defvar vc-sccs-master-templates (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\ 30012(defvar vc-sccs-master-templates (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\
@@ -30033,7 +30024,7 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
30033 30024
30034;;;*** 30025;;;***
30035 30026
30036;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (20855 45357 683214 30027;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (20900 33838 319219
30037;;;;;; 0)) 30028;;;;;; 0))
30038;;; Generated autoloads from vc/vc-svn.el 30029;;; Generated autoloads from vc/vc-svn.el
30039 (defun vc-svn-registered (f) 30030 (defun vc-svn-registered (f)
@@ -30048,7 +30039,7 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
30048;;;*** 30039;;;***
30049 30040
30050;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el" 30041;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el"
30051;;;;;; (20777 63161 848428 0)) 30042;;;;;; (20893 60586 188550 0))
30052;;; Generated autoloads from progmodes/vera-mode.el 30043;;; Generated autoloads from progmodes/vera-mode.el
30053 (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'") 'vera-mode)) 30044 (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'") 'vera-mode))
30054 30045
@@ -30106,7 +30097,7 @@ Key bindings:
30106;;;*** 30097;;;***
30107 30098
30108;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el" 30099;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el"
30109;;;;;; (20763 30266 231060 0)) 30100;;;;;; (20885 2819 449152 0))
30110;;; Generated autoloads from progmodes/verilog-mode.el 30101;;; Generated autoloads from progmodes/verilog-mode.el
30111 30102
30112(autoload 'verilog-mode "verilog-mode" "\ 30103(autoload 'verilog-mode "verilog-mode" "\
@@ -30245,7 +30236,7 @@ Key bindings specific to `verilog-mode-map' are:
30245;;;*** 30236;;;***
30246 30237
30247;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el" 30238;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
30248;;;;;; (20709 26818 907104 0)) 30239;;;;;; (20892 39729 858825 0))
30249;;; Generated autoloads from progmodes/vhdl-mode.el 30240;;; Generated autoloads from progmodes/vhdl-mode.el
30250 30241
30251(autoload 'vhdl-mode "vhdl-mode" "\ 30242(autoload 'vhdl-mode "vhdl-mode" "\
@@ -30615,7 +30606,7 @@ Usage:
30615 option `vhdl-index-menu' to non-nil) or made accessible as a mouse menu 30606 option `vhdl-index-menu' to non-nil) or made accessible as a mouse menu
30616 (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to your start-up 30607 (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to your start-up
30617 file) for browsing the file contents (is not populated if buffer is 30608 file) for browsing the file contents (is not populated if buffer is
30618 larger than `font-lock-maximum-size'). Also, a source file menu can be 30609 larger than 256000). Also, a source file menu can be
30619 added (set option `vhdl-source-file-menu' to non-nil) for browsing the 30610 added (set option `vhdl-source-file-menu' to non-nil) for browsing the
30620 current directory for VHDL source files. 30611 current directory for VHDL source files.
30621 30612
@@ -30742,7 +30733,7 @@ Usage:
30742 automatically recognized as VHDL source files. To add an extension 30733 automatically recognized as VHDL source files. To add an extension
30743 \".xxx\", add the following line to your Emacs start-up file (`.emacs'): 30734 \".xxx\", add the following line to your Emacs start-up file (`.emacs'):
30744 30735
30745 (setq auto-mode-alist (cons '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist)) 30736 (push '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist)
30746 30737
30747 30738
30748 HINTS: 30739 HINTS:
@@ -31283,7 +31274,7 @@ this is equivalent to `display-warning', using
31283;;;*** 31274;;;***
31284 31275
31285;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el" 31276;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
31286;;;;;; (20791 9657 561026 0)) 31277;;;;;; (20900 33838 319219 0))
31287;;; Generated autoloads from wdired.el 31278;;; Generated autoloads from wdired.el
31288 31279
31289(autoload 'wdired-change-to-wdired-mode "wdired" "\ 31280(autoload 'wdired-change-to-wdired-mode "wdired" "\
@@ -31318,7 +31309,7 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
31318;;;*** 31309;;;***
31319 31310
31320;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el" 31311;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
31321;;;;;; (20725 15032 264919 0)) 31312;;;;;; (20895 15912 444844 0))
31322;;; Generated autoloads from progmodes/which-func.el 31313;;; Generated autoloads from progmodes/which-func.el
31323 (put 'which-func-format 'risky-local-variable t) 31314 (put 'which-func-format 'risky-local-variable t)
31324 (put 'which-func-current 'risky-local-variable t) 31315 (put 'which-func-current 'risky-local-variable t)
@@ -31351,8 +31342,8 @@ in certain major modes.
31351;;;### (autoloads (whitespace-report-region whitespace-report whitespace-cleanup-region 31342;;;### (autoloads (whitespace-report-region whitespace-report whitespace-cleanup-region
31352;;;;;; whitespace-cleanup global-whitespace-toggle-options whitespace-toggle-options 31343;;;;;; whitespace-cleanup global-whitespace-toggle-options whitespace-toggle-options
31353;;;;;; global-whitespace-newline-mode global-whitespace-mode whitespace-newline-mode 31344;;;;;; global-whitespace-newline-mode global-whitespace-mode whitespace-newline-mode
31354;;;;;; whitespace-mode) "whitespace" "whitespace.el" (20831 63016 31345;;;;;; whitespace-mode) "whitespace" "whitespace.el" (20874 65007
31355;;;;;; 738579 0)) 31346;;;;;; 172950 7000))
31356;;; Generated autoloads from whitespace.el 31347;;; Generated autoloads from whitespace.el
31357 31348
31358(autoload 'whitespace-mode "whitespace" "\ 31349(autoload 'whitespace-mode "whitespace" "\
@@ -32065,26 +32056,6 @@ The key bindings are:
32065 32056
32066;;;*** 32057;;;***
32067 32058
32068;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (20709 26818
32069;;;;;; 907104 0))
32070;;; Generated autoloads from net/xesam.el
32071
32072(autoload 'xesam-search "xesam" "\
32073Perform an interactive search.
32074ENGINE is the Xesam search engine to be applied, it must be one of the
32075entries of `xesam-search-engines'. QUERY is the search string in the
32076Xesam user query language. If the search engine does not support
32077the Xesam user query language, a Xesam fulltext search is applied.
32078
32079The default search engine is the first entry in `xesam-search-engines'.
32080Example:
32081
32082 (xesam-search (car (xesam-search-engines)) \"emacs\")
32083
32084\(fn ENGINE QUERY)" t nil)
32085
32086;;;***
32087
32088;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el" 32059;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
32089;;;;;; (20766 6456 368550 0)) 32060;;;;;; (20766 6456 368550 0))
32090;;; Generated autoloads from xml.el 32061;;; Generated autoloads from xml.el
@@ -32143,7 +32114,7 @@ Both features can be combined by providing a cons cell
32143;;;*** 32114;;;***
32144 32115
32145;;;### (autoloads (xmltok-get-declared-encoding-position) "xmltok" 32116;;;### (autoloads (xmltok-get-declared-encoding-position) "xmltok"
32146;;;;;; "nxml/xmltok.el" (20709 26818 907104 0)) 32117;;;;;; "nxml/xmltok.el" (20884 6711 386198 0))
32147;;; Generated autoloads from nxml/xmltok.el 32118;;; Generated autoloads from nxml/xmltok.el
32148 32119
32149(autoload 'xmltok-get-declared-encoding-position "xmltok" "\ 32120(autoload 'xmltok-get-declared-encoding-position "xmltok" "\
@@ -32300,46 +32271,46 @@ Zone out, completely.
32300;;;;;; "emacs-lisp/eieio-base.el" "emacs-lisp/eieio-datadebug.el" 32271;;;;;; "emacs-lisp/eieio-base.el" "emacs-lisp/eieio-datadebug.el"
32301;;;;;; "emacs-lisp/eieio-speedbar.el" "emacs-lisp/eieio.el" "emacs-lisp/find-gc.el" 32272;;;;;; "emacs-lisp/eieio-speedbar.el" "emacs-lisp/eieio.el" "emacs-lisp/find-gc.el"
32302;;;;;; "emacs-lisp/gulp.el" "emacs-lisp/lisp-mnt.el" "emacs-lisp/package-x.el" 32273;;;;;; "emacs-lisp/gulp.el" "emacs-lisp/lisp-mnt.el" "emacs-lisp/package-x.el"
32303;;;;;; "emacs-lisp/regi.el" "emacs-lisp/smie.el" "emacs-lisp/tcover-ses.el" 32274;;;;;; "emacs-lisp/regi.el" "emacs-lisp/tcover-ses.el" "emacs-lisp/tcover-unsafep.el"
32304;;;;;; "emacs-lisp/tcover-unsafep.el" "emulation/cua-gmrk.el" "emulation/cua-rect.el" 32275;;;;;; "emulation/cua-gmrk.el" "emulation/cua-rect.el" "emulation/edt-lk201.el"
32305;;;;;; "emulation/edt-lk201.el" "emulation/edt-mapper.el" "emulation/edt-pc.el" 32276;;;;;; "emulation/edt-mapper.el" "emulation/edt-pc.el" "emulation/edt-vt100.el"
32306;;;;;; "emulation/edt-vt100.el" "emulation/tpu-extras.el" "emulation/viper-cmd.el" 32277;;;;;; "emulation/tpu-extras.el" "emulation/viper-cmd.el" "emulation/viper-ex.el"
32307;;;;;; "emulation/viper-ex.el" "emulation/viper-init.el" "emulation/viper-keym.el" 32278;;;;;; "emulation/viper-init.el" "emulation/viper-keym.el" "emulation/viper-macs.el"
32308;;;;;; "emulation/viper-macs.el" "emulation/viper-mous.el" "emulation/viper-util.el" 32279;;;;;; "emulation/viper-mous.el" "emulation/viper-util.el" "erc/erc-backend.el"
32309;;;;;; "erc/erc-backend.el" "erc/erc-goodies.el" "erc/erc-ibuffer.el" 32280;;;;;; "erc/erc-goodies.el" "erc/erc-ibuffer.el" "erc/erc-lang.el"
32310;;;;;; "erc/erc-lang.el" "eshell/em-alias.el" "eshell/em-banner.el" 32281;;;;;; "eshell/em-alias.el" "eshell/em-banner.el" "eshell/em-basic.el"
32311;;;;;; "eshell/em-basic.el" "eshell/em-cmpl.el" "eshell/em-dirs.el" 32282;;;;;; "eshell/em-cmpl.el" "eshell/em-dirs.el" "eshell/em-glob.el"
32312;;;;;; "eshell/em-glob.el" "eshell/em-hist.el" "eshell/em-ls.el" 32283;;;;;; "eshell/em-hist.el" "eshell/em-ls.el" "eshell/em-pred.el"
32313;;;;;; "eshell/em-pred.el" "eshell/em-prompt.el" "eshell/em-rebind.el" 32284;;;;;; "eshell/em-prompt.el" "eshell/em-rebind.el" "eshell/em-script.el"
32314;;;;;; "eshell/em-script.el" "eshell/em-smart.el" "eshell/em-term.el" 32285;;;;;; "eshell/em-smart.el" "eshell/em-term.el" "eshell/em-tramp.el"
32315;;;;;; "eshell/em-tramp.el" "eshell/em-unix.el" "eshell/em-xtra.el" 32286;;;;;; "eshell/em-unix.el" "eshell/em-xtra.el" "eshell/esh-arg.el"
32316;;;;;; "eshell/esh-arg.el" "eshell/esh-cmd.el" "eshell/esh-ext.el" 32287;;;;;; "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-groups.el"
32317;;;;;; "eshell/esh-groups.el" "eshell/esh-io.el" "eshell/esh-module.el" 32288;;;;;; "eshell/esh-io.el" "eshell/esh-module.el" "eshell/esh-opt.el"
32318;;;;;; "eshell/esh-opt.el" "eshell/esh-proc.el" "eshell/esh-util.el" 32289;;;;;; "eshell/esh-proc.el" "eshell/esh-util.el" "eshell/esh-var.el"
32319;;;;;; "eshell/esh-var.el" "ezimage.el" "foldout.el" "format-spec.el" 32290;;;;;; "ezimage.el" "foldout.el" "format-spec.el" "fringe.el" "generic-x.el"
32320;;;;;; "fringe.el" "generic-x.el" "gnus/compface.el" "gnus/gnus-async.el" 32291;;;;;; "gnus/compface.el" "gnus/gnus-async.el" "gnus/gnus-bcklg.el"
32321;;;;;; "gnus/gnus-bcklg.el" "gnus/gnus-cite.el" "gnus/gnus-cus.el" 32292;;;;;; "gnus/gnus-cite.el" "gnus/gnus-cus.el" "gnus/gnus-demon.el"
32322;;;;;; "gnus/gnus-demon.el" "gnus/gnus-dup.el" "gnus/gnus-eform.el" 32293;;;;;; "gnus/gnus-dup.el" "gnus/gnus-eform.el" "gnus/gnus-ems.el"
32323;;;;;; "gnus/gnus-ems.el" "gnus/gnus-int.el" "gnus/gnus-logic.el" 32294;;;;;; "gnus/gnus-int.el" "gnus/gnus-logic.el" "gnus/gnus-mh.el"
32324;;;;;; "gnus/gnus-mh.el" "gnus/gnus-salt.el" "gnus/gnus-score.el" 32295;;;;;; "gnus/gnus-salt.el" "gnus/gnus-score.el" "gnus/gnus-setup.el"
32325;;;;;; "gnus/gnus-setup.el" "gnus/gnus-srvr.el" "gnus/gnus-topic.el" 32296;;;;;; "gnus/gnus-srvr.el" "gnus/gnus-topic.el" "gnus/gnus-undo.el"
32326;;;;;; "gnus/gnus-undo.el" "gnus/gnus-util.el" "gnus/gnus-uu.el" 32297;;;;;; "gnus/gnus-util.el" "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/gssapi.el"
32327;;;;;; "gnus/gnus-vm.el" "gnus/gssapi.el" "gnus/ietf-drums.el" "gnus/legacy-gnus-agent.el" 32298;;;;;; "gnus/ietf-drums.el" "gnus/legacy-gnus-agent.el" "gnus/mail-parse.el"
32328;;;;;; "gnus/mail-parse.el" "gnus/mail-prsvr.el" "gnus/mail-source.el" 32299;;;;;; "gnus/mail-prsvr.el" "gnus/mail-source.el" "gnus/mailcap.el"
32329;;;;;; "gnus/mailcap.el" "gnus/messcompat.el" "gnus/mm-archive.el" 32300;;;;;; "gnus/messcompat.el" "gnus/mm-archive.el" "gnus/mm-bodies.el"
32330;;;;;; "gnus/mm-bodies.el" "gnus/mm-decode.el" "gnus/mm-util.el" 32301;;;;;; "gnus/mm-decode.el" "gnus/mm-util.el" "gnus/mm-view.el" "gnus/mml-sec.el"
32331;;;;;; "gnus/mm-view.el" "gnus/mml-sec.el" "gnus/mml-smime.el" "gnus/nnagent.el" 32302;;;;;; "gnus/mml-smime.el" "gnus/nnagent.el" "gnus/nnbabyl.el" "gnus/nndir.el"
32332;;;;;; "gnus/nnbabyl.el" "gnus/nndir.el" "gnus/nndraft.el" "gnus/nneething.el" 32303;;;;;; "gnus/nndraft.el" "gnus/nneething.el" "gnus/nngateway.el"
32333;;;;;; "gnus/nngateway.el" "gnus/nnheader.el" "gnus/nnimap.el" "gnus/nnir.el" 32304;;;;;; "gnus/nnheader.el" "gnus/nnimap.el" "gnus/nnir.el" "gnus/nnmail.el"
32334;;;;;; "gnus/nnmail.el" "gnus/nnmaildir.el" "gnus/nnmairix.el" "gnus/nnmbox.el" 32305;;;;;; "gnus/nnmaildir.el" "gnus/nnmairix.el" "gnus/nnmbox.el" "gnus/nnmh.el"
32335;;;;;; "gnus/nnmh.el" "gnus/nnnil.el" "gnus/nnoo.el" "gnus/nnregistry.el" 32306;;;;;; "gnus/nnnil.el" "gnus/nnoo.el" "gnus/nnregistry.el" "gnus/nnrss.el"
32336;;;;;; "gnus/nnrss.el" "gnus/nnspool.el" "gnus/nntp.el" "gnus/nnvirtual.el" 32307;;;;;; "gnus/nnspool.el" "gnus/nntp.el" "gnus/nnvirtual.el" "gnus/nnweb.el"
32337;;;;;; "gnus/nnweb.el" "gnus/registry.el" "gnus/rfc1843.el" "gnus/rfc2045.el" 32308;;;;;; "gnus/registry.el" "gnus/rfc1843.el" "gnus/rfc2045.el" "gnus/rfc2047.el"
32338;;;;;; "gnus/rfc2047.el" "gnus/rfc2104.el" "gnus/rfc2231.el" "gnus/rtree.el" 32309;;;;;; "gnus/rfc2104.el" "gnus/rfc2231.el" "gnus/rtree.el" "gnus/shr-color.el"
32339;;;;;; "gnus/shr-color.el" "gnus/sieve-manage.el" "gnus/smime.el" 32310;;;;;; "gnus/sieve-manage.el" "gnus/smime.el" "gnus/spam-stat.el"
32340;;;;;; "gnus/spam-stat.el" "gnus/spam-wash.el" "hex-util.el" "hfy-cmap.el" 32311;;;;;; "gnus/spam-wash.el" "hex-util.el" "hfy-cmap.el" "ibuf-ext.el"
32341;;;;;; "ibuf-ext.el" "international/cp51932.el" "international/eucjp-ms.el" 32312;;;;;; "international/cp51932.el" "international/eucjp-ms.el" "international/fontset.el"
32342;;;;;; "international/fontset.el" "international/iso-ascii.el" "international/ja-dic-cnv.el" 32313;;;;;; "international/iso-ascii.el" "international/ja-dic-cnv.el"
32343;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "international/uni-bidi.el" 32314;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "international/uni-bidi.el"
32344;;;;;; "international/uni-category.el" "international/uni-combining.el" 32315;;;;;; "international/uni-category.el" "international/uni-combining.el"
32345;;;;;; "international/uni-comment.el" "international/uni-decimal.el" 32316;;;;;; "international/uni-comment.el" "international/uni-decimal.el"
@@ -32427,8 +32398,8 @@ Zone out, completely.
32427;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el" 32398;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
32428;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el" 32399;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el"
32429;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-common-fns.el" 32400;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-common-fns.el"
32430;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (20864 60345 274595 32401;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (20905 51795 339257
32431;;;;;; 113000)) 32402;;;;;; 114000))
32432 32403
32433;;;*** 32404;;;***
32434 32405
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 5764cdec7eb..7fb9526b360 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -210,6 +210,7 @@
210(load "textmodes/page") 210(load "textmodes/page")
211(load "register") 211(load "register")
212(load "textmodes/paragraphs") 212(load "textmodes/paragraphs")
213(load "progmodes/prog-mode")
213(load "emacs-lisp/lisp-mode") 214(load "emacs-lisp/lisp-mode")
214(load "textmodes/text-mode") 215(load "textmodes/text-mode")
215(load "textmodes/fill") 216(load "textmodes/fill")
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index a5d79a415f6..8bcf3afae05 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1796,6 +1796,14 @@ exit."
1796 (cl-assert (<= start (point)) (<= (point) end)) 1796 (cl-assert (<= start (point)) (<= (point) end))
1797 (funcall completion-in-region-function start end collection predicate)) 1797 (funcall completion-in-region-function start end collection predicate))
1798 1798
1799(defcustom read-file-name-completion-ignore-case
1800 (if (memq system-type '(ms-dos windows-nt darwin cygwin))
1801 t nil)
1802 "Non-nil means when reading a file name completion ignores case."
1803 :group 'minibuffer
1804 :type 'boolean
1805 :version "22.1")
1806
1799(defun completion--in-region (start end collection &optional predicate) 1807(defun completion--in-region (start end collection &optional predicate)
1800 (with-wrapper-hook 1808 (with-wrapper-hook
1801 ;; FIXME: Maybe we should use this hook to provide a "display 1809 ;; FIXME: Maybe we should use this hook to provide a "display
@@ -2268,14 +2276,6 @@ except that it passes the file name through `substitute-in-file-name'.")
2268 "The function called by `read-file-name' to do its work. 2276 "The function called by `read-file-name' to do its work.
2269It should accept the same arguments as `read-file-name'.") 2277It should accept the same arguments as `read-file-name'.")
2270 2278
2271(defcustom read-file-name-completion-ignore-case
2272 (if (memq system-type '(ms-dos windows-nt darwin cygwin))
2273 t nil)
2274 "Non-nil means when reading a file name completion ignores case."
2275 :group 'minibuffer
2276 :type 'boolean
2277 :version "22.1")
2278
2279(defcustom insert-default-directory t 2279(defcustom insert-default-directory t
2280 "Non-nil means when reading a filename start with default dir in minibuffer. 2280 "Non-nil means when reading a filename start with default dir in minibuffer.
2281 2281
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 9a6c7b124c7..810d8963ce2 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -497,7 +497,7 @@ If your system's ping continues until interrupted, you can try setting
497 497
498(defvar nslookup-mode-map 498(defvar nslookup-mode-map
499 (let ((map (make-sparse-keymap))) 499 (let ((map (make-sparse-keymap)))
500 (define-key map "\t" 'comint-dynamic-complete) 500 (define-key map "\t" 'completion-at-point)
501 map)) 501 map))
502 502
503;; Using a derived mode gives us keymaps, hooks, etc. 503;; Using a derived mode gives us keymaps, hooks, etc.
@@ -567,7 +567,7 @@ If your system's ping continues until interrupted, you can try setting
567(defvar ftp-mode-map 567(defvar ftp-mode-map
568 (let ((map (make-sparse-keymap))) 568 (let ((map (make-sparse-keymap)))
569 ;; Occasionally useful 569 ;; Occasionally useful
570 (define-key map "\t" 'comint-dynamic-complete) 570 (define-key map "\t" 'completion-at-point)
571 map)) 571 map))
572 572
573(define-derived-mode ftp-mode comint-mode "FTP" 573(define-derived-mode ftp-mode comint-mode "FTP"
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 9ad79d694f8..e8d13254557 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -36,6 +36,11 @@
36 36
37;;; Code: 37;;; Code:
38 38
39;; FIXME?
40;; Maybe this file should be obsolete.
41;; http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00517.html
42;; It only adds rlogin-directory-tracking-mode. Is that useful?
43
39(require 'comint) 44(require 'comint)
40(require 'shell) 45(require 'shell)
41 46
@@ -44,13 +49,15 @@
44 :group 'processes 49 :group 'processes
45 :group 'unix) 50 :group 'unix)
46 51
47(defcustom rlogin-program "rlogin" 52(defcustom rlogin-program "ssh"
48 "Name of program to invoke rlogin" 53 "Name of program to invoke remote login."
54 :version "24.4" ; rlogin -> ssh
49 :type 'string 55 :type 'string
50 :group 'rlogin) 56 :group 'rlogin)
51 57
52(defcustom rlogin-explicit-args nil 58(defcustom rlogin-explicit-args '("-t" "-t")
53 "List of arguments to pass to rlogin on the command line." 59 "List of arguments to pass to `rlogin-program' on the command line."
60 :version "24.4" ; nil -> -t -t
54 :type '(repeat (string :tag "Argument")) 61 :type '(repeat (string :tag "Argument"))
55 :group 'rlogin) 62 :group 'rlogin)
56 63
@@ -62,13 +69,15 @@
62(defcustom rlogin-process-connection-type 69(defcustom rlogin-process-connection-type
63 ;; Solaris 2.x `rlogin' will spew a bunch of ioctl error messages if 70 ;; Solaris 2.x `rlogin' will spew a bunch of ioctl error messages if
64 ;; stdin isn't a tty. 71 ;; stdin isn't a tty.
65 (and (string-match-p "-solaris2" system-configuration) t) 72 (and (string-match "rlogin" rlogin-program)
73 (string-match-p "-solaris2" system-configuration) t)
66 "If non-nil, use a pty for the local rlogin process. 74 "If non-nil, use a pty for the local rlogin process.
67If nil, use a pipe (if pipes are supported on the local system). 75If nil, use a pipe (if pipes are supported on the local system).
68 76
69Generally it is better not to waste ptys on systems which have a static 77Generally it is better not to waste ptys on systems which have a static
70number of them. On the other hand, some implementations of `rlogin' assume 78number of them. On the other hand, some implementations of `rlogin' assume
71a pty is being used, and errors will result from using a pipe instead." 79a pty is being used, and errors will result from using a pipe instead."
80 :set-after '(rlogin-program)
72 :type '(choice (const :tag "pipes" nil) 81 :type '(choice (const :tag "pipes" nil)
73 (other :tag "ptys" t)) 82 (other :tag "ptys" t))
74 :group 'rlogin) 83 :group 'rlogin)
@@ -98,7 +107,7 @@ re-synching of directories."
98(make-variable-buffer-local 'rlogin-directory-tracking-mode) 107(make-variable-buffer-local 'rlogin-directory-tracking-mode)
99 108
100(defcustom rlogin-host nil 109(defcustom rlogin-host nil
101 "The name of the remote host. This variable is buffer-local." 110 "The name of the default remote host. This variable is buffer-local."
102 :type '(choice (const nil) string) 111 :type '(choice (const nil) string)
103 :group 'rlogin) 112 :group 'rlogin)
104 113
@@ -165,7 +174,9 @@ If you wish to change directory tracking styles during a session, use the
165function `rlogin-directory-tracking-mode' rather than simply setting the 174function `rlogin-directory-tracking-mode' rather than simply setting the
166variable." 175variable."
167 (interactive (list 176 (interactive (list
168 (read-from-minibuffer "rlogin arguments (hostname first): " 177 (read-from-minibuffer (format
178 "Arguments for `%s' (hostname first): "
179 (file-name-nondirectory rlogin-program))
169 nil nil nil 'rlogin-history) 180 nil nil nil 'rlogin-history)
170 current-prefix-arg)) 181 current-prefix-arg))
171 (let* ((process-connection-type rlogin-process-connection-type) 182 (let* ((process-connection-type rlogin-process-connection-type)
@@ -297,7 +308,7 @@ local one share the same directories (e.g. through NFS)."
297 "Complete file name if doing directory tracking, or just insert TAB." 308 "Complete file name if doing directory tracking, or just insert TAB."
298 (interactive) 309 (interactive)
299 (if rlogin-directory-tracking-mode 310 (if rlogin-directory-tracking-mode
300 (comint-dynamic-complete) 311 (completion-at-point)
301 (insert "\C-i"))) 312 (insert "\C-i")))
302 313
303(provide 'rlogin) 314(provide 'rlogin)
diff --git a/lisp/net/tls.el b/lisp/net/tls.el
index 7fc314ef088..3d8d8decf47 100644
--- a/lisp/net/tls.el
+++ b/lisp/net/tls.el
@@ -286,7 +286,10 @@ NOT trusted. Accept anyway? " host)))))
286 (format "Host name in certificate doesn't \ 286 (format "Host name in certificate doesn't \
287match `%s'. Connect anyway? " host)))))) 287match `%s'. Connect anyway? " host))))))
288 (setq done nil) 288 (setq done nil)
289 (delete-process process))) 289 (delete-process process))
290 ;; Delete all the informational messages that could confuse
291 ;; future uses of `buffer'.
292 (delete-region (point-min) (point)))
290 (message "Opening TLS connection to `%s'...%s" 293 (message "Opening TLS connection to `%s'...%s"
291 host (if done "done" "failed")) 294 host (if done "done" "failed"))
292 (when use-temp-buffer 295 (when use-temp-buffer
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index e10b96f97f9..bcb5f721ae8 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -485,29 +485,27 @@ and raises an error or returns nil if NOERROR is non-nil."
485Moves point to inside the comment and returns the position of the 485Moves point to inside the comment and returns the position of the
486comment-starter. If no comment is found, moves point to LIMIT 486comment-starter. If no comment is found, moves point to LIMIT
487and raises an error or returns nil if NOERROR is non-nil." 487and raises an error or returns nil if NOERROR is non-nil."
488 (let (found end) 488 ;; FIXME: If a comment-start appears inside a comment, we may erroneously
489 (while (and (not found) 489 ;; stop there. This can be rather bad in general, but since
490 (re-search-backward comment-start-skip limit t)) 490 ;; comment-search-backward is only used to find the comment-column (in
491 (setq end (match-end 0)) 491 ;; comment-set-column) and to find the comment-start string (via
492 (unless (and comment-use-syntax 492 ;; comment-beginning) in indent-new-comment-line, it should be harmless.
493 (nth 8 (syntax-ppss (or (match-end 1) 493 (if (not (re-search-backward comment-start-skip limit t))
494 (match-beginning 0))))) 494 (unless noerror (error "No comment"))
495 (setq found t))) 495 (beginning-of-line)
496 (if (not found) 496 (let* ((end (match-end 0))
497 (unless noerror (error "No comment")) 497 (cs (comment-search-forward end t))
498 (beginning-of-line) 498 (pt (point)))
499 (let ((cs (comment-search-forward end t)) 499 (if (not cs)
500 (pt (point))) 500 (progn (beginning-of-line)
501 (if (not cs) 501 (comment-search-backward limit noerror))
502 (progn (beginning-of-line) 502 (while (progn (goto-char cs)
503 (comment-search-backward limit noerror)) 503 (comment-forward)
504 (while (progn (goto-char cs) 504 (and (< (point) end)
505 (comment-forward) 505 (setq cs (comment-search-forward end t))))
506 (and (< (point) end) 506 (setq pt (point)))
507 (setq cs (comment-search-forward end t)))) 507 (goto-char pt)
508 (setq pt (point))) 508 cs))))
509 (goto-char pt)
510 cs)))))
511 509
512(defun comment-beginning () 510(defun comment-beginning ()
513 "Find the beginning of the enclosing comment. 511 "Find the beginning of the enclosing comment.
diff --git a/lisp/obsolete/sym-comp.el b/lisp/obsolete/sym-comp.el
index 4641ca68544..bd049b85aa2 100644
--- a/lisp/obsolete/sym-comp.el
+++ b/lisp/obsolete/sym-comp.el
@@ -139,12 +139,13 @@ to be set buffer-locally. Variables `symbol-completion-symbol-function',
139 pattern)) 139 pattern))
140 ;; In case the transform needs to access it. 140 ;; In case the transform needs to access it.
141 (symbol-completion-predicate predicate) 141 (symbol-completion-predicate predicate)
142 (completion-annotate-function 142 (completion-extra-properties
143 (if (functionp symbol-completion-transform-function) 143 (if (functionp symbol-completion-transform-function)
144 (lambda (str) 144 '(:annotation-function
145 (car-safe (cdr-safe 145 (lambda (str)
146 (funcall symbol-completion-transform-function 146 (car-safe (cdr-safe
147 str))))))) 147 (funcall symbol-completion-transform-function
148 str))))))))
148 (completion-in-region (- (point) (length pattern)) (point) 149 (completion-in-region (- (point) (length pattern)) (point)
149 completions predicate))) 150 completions predicate)))
150 151
diff --git a/lisp/paren.el b/lisp/paren.el
index a9d3be60622..6f386573b01 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -37,11 +37,6 @@
37 :prefix "show-paren-" 37 :prefix "show-paren-"
38 :group 'paren-matching) 38 :group 'paren-matching)
39 39
40;; This is the overlay used to highlight the matching paren.
41(defvar show-paren-overlay nil)
42;; This is the overlay used to highlight the closeparen right before point.
43(defvar show-paren-overlay-1 nil)
44
45(defcustom show-paren-style 'parenthesis 40(defcustom show-paren-style 'parenthesis
46 "Style used when showing a matching paren. 41 "Style used when showing a matching paren.
47Valid styles are `parenthesis' (meaning show the matching paren), 42Valid styles are `parenthesis' (meaning show the matching paren),
@@ -107,7 +102,14 @@ active, you must toggle the mode off and on again for this to take effect."
107(defvar show-paren-highlight-openparen t 102(defvar show-paren-highlight-openparen t
108 "Non-nil turns on openparen highlighting when matching forward.") 103 "Non-nil turns on openparen highlighting when matching forward.")
109 104
110(defvar show-paren-idle-timer nil) 105(defvar show-paren--idle-timer nil)
106(defvar show-paren--overlay
107 (let ((ol (make-overlay (point) (point) nil t))) (delete-overlay ol) ol)
108 "Overlay used to highlight the matching paren.")
109(defvar show-paren--overlay-1
110 (let ((ol (make-overlay (point) (point) nil t))) (delete-overlay ol) ol)
111 "Overlay used to highlight the paren at point.")
112
111 113
112;;;###autoload 114;;;###autoload
113(define-minor-mode show-paren-mode 115(define-minor-mode show-paren-mode
@@ -120,154 +122,148 @@ Show Paren mode is a global minor mode. When enabled, any
120matching parenthesis is highlighted in `show-paren-style' after 122matching parenthesis is highlighted in `show-paren-style' after
121`show-paren-delay' seconds of Emacs idle time." 123`show-paren-delay' seconds of Emacs idle time."
122 :global t :group 'paren-showing 124 :global t :group 'paren-showing
123 ;; Enable or disable the mechanism. 125 ;; Enable or disable the mechanism.
124 ;; First get rid of the old idle timer. 126 ;; First get rid of the old idle timer.
125 (if show-paren-idle-timer 127 (when show-paren--idle-timer
126 (cancel-timer show-paren-idle-timer)) 128 (cancel-timer show-paren--idle-timer)
127 (setq show-paren-idle-timer nil) 129 (setq show-paren--idle-timer nil))
128 ;; If show-paren-mode is enabled in some buffer now, 130 (setq show-paren--idle-timer (run-with-idle-timer
129 ;; set up a new timer. 131 show-paren-delay t
130 (when (memq t (mapcar (lambda (buffer) 132 #'show-paren-function))
131 (with-current-buffer buffer 133 (unless show-paren-mode
132 show-paren-mode)) 134 (delete-overlay show-paren--overlay)
133 (buffer-list))) 135 (delete-overlay show-paren--overlay-1)))
134 (setq show-paren-idle-timer (run-with-idle-timer 136
135 show-paren-delay t 137(defvar show-paren-data-function #'show-paren--default
136 'show-paren-function))) 138 "Function to find the opener/closer at point and its match.
137 (unless show-paren-mode 139The function is called with no argument and should return either nil
138 (and show-paren-overlay 140if there's no opener/closer at point, or a list of the form
139 (eq (overlay-buffer show-paren-overlay) (current-buffer)) 141\(HERE-BEG HERE-END THERE-BEG THERE-END MISMATCH)
140 (delete-overlay show-paren-overlay)) 142Where HERE-BEG..HERE-END is expected to be around point.")
141 (and show-paren-overlay-1 143
142 (eq (overlay-buffer show-paren-overlay-1) (current-buffer)) 144(defun show-paren--default ()
143 (delete-overlay show-paren-overlay-1)))) 145 (let* ((oldpos (point))
146 (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1)
147 ((eq (syntax-class (syntax-after (point))) 4) 1)))
148 (unescaped
149 (when dir
150 ;; Verify an even number of quoting characters precede the paren.
151 ;; Follow the same logic as in `blink-matching-open'.
152 (= (if (= dir -1) 1 0)
153 (logand 1 (- (point)
154 (save-excursion
155 (if (= dir -1) (forward-char -1))
156 (skip-syntax-backward "/\\")
157 (point)))))))
158 (here-beg (if (eq dir 1) (point) (1- (point))))
159 (here-end (if (eq dir 1) (1+ (point)) (point)))
160 pos mismatch)
161 ;;
162 ;; Find the other end of the sexp.
163 (when unescaped
164 (save-excursion
165 (save-restriction
166 ;; Determine the range within which to look for a match.
167 (when blink-matching-paren-distance
168 (narrow-to-region
169 (max (point-min) (- (point) blink-matching-paren-distance))
170 (min (point-max) (+ (point) blink-matching-paren-distance))))
171 ;; Scan across one sexp within that range.
172 ;; Errors or nil mean there is a mismatch.
173 (condition-case ()
174 (setq pos (scan-sexps (point) dir))
175 (error (setq pos t mismatch t)))
176 ;; Move back the other way and verify we get back to the
177 ;; starting point. If not, these two parens don't really match.
178 ;; Maybe the one at point is escaped and doesn't really count,
179 ;; or one is inside a comment.
180 (when (integerp pos)
181 (unless (condition-case ()
182 (eq (point) (scan-sexps pos (- dir)))
183 (error nil))
184 (setq pos nil)))
185 ;; If found a "matching" paren, see if it is the right
186 ;; kind of paren to match the one we started at.
187 (if (not (integerp pos))
188 (if mismatch (list here-beg here-end nil nil t))
189 (let ((beg (min pos oldpos)) (end (max pos oldpos)))
190 (unless (eq (syntax-class (syntax-after beg)) 8)
191 (setq mismatch
192 (not (or (eq (char-before end)
193 ;; This can give nil.
194 (cdr (syntax-after beg)))
195 (eq (char-after beg)
196 ;; This can give nil.
197 (cdr (syntax-after (1- end))))
198 ;; The cdr might hold a new paren-class
199 ;; info rather than a matching-char info,
200 ;; in which case the two CDRs should match.
201 (eq (cdr (syntax-after (1- end)))
202 (cdr (syntax-after beg)))))))
203 (list here-beg here-end
204 (if (= dir 1) (1- pos) pos)
205 (if (= dir 1) pos (1+ pos))
206 mismatch))))))))
144 207
145;; Find the place to show, if there is one, 208;; Find the place to show, if there is one,
146;; and show it until input arrives. 209;; and show it until input arrives.
147(defun show-paren-function () 210(defun show-paren-function ()
148 (if show-paren-mode 211 (let ((data (and show-paren-mode (funcall show-paren-data-function))))
149 (let* ((oldpos (point)) 212 (if (not data)
150 (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1) 213 (progn
151 ((eq (syntax-class (syntax-after (point))) 4) 1))) 214 ;; If show-paren-mode is nil in this buffer or if not at a paren that
152 (unescaped 215 ;; has a match, turn off any previous paren highlighting.
153 (when dir 216 (delete-overlay show-paren--overlay)
154 ;; Verify an even number of quoting characters precede the paren. 217 (delete-overlay show-paren--overlay-1))
155 ;; Follow the same logic as in `blink-matching-open'. 218
156 (= (if (= dir -1) 1 0) 219 ;; Found something to highlight.
157 (logand 1 (- (point) 220 (let* ((here-beg (nth 0 data))
158 (save-excursion 221 (here-end (nth 1 data))
159 (if (= dir -1) (forward-char -1)) 222 (there-beg (nth 2 data))
160 (skip-syntax-backward "/\\") 223 (there-end (nth 3 data))
161 (point))))))) 224 (mismatch (nth 4 data))
162 pos mismatch face) 225 (face
163 ;; 226 (if mismatch
164 ;; Find the other end of the sexp. 227 (progn
165 (when unescaped 228 (if show-paren-ring-bell-on-mismatch
166 (save-excursion 229 (beep))
167 (save-restriction 230 'show-paren-mismatch)
168 ;; Determine the range within which to look for a match. 231 'show-paren-match)))
169 (when blink-matching-paren-distance 232 ;;
170 (narrow-to-region 233 ;; If matching backwards, highlight the closeparen
171 (max (point-min) (- (point) blink-matching-paren-distance)) 234 ;; before point as well as its matching open.
172 (min (point-max) (+ (point) blink-matching-paren-distance)))) 235 ;; If matching forward, and the openparen is unbalanced,
173 ;; Scan across one sexp within that range. 236 ;; highlight the paren at point to indicate misbalance.
174 ;; Errors or nil mean there is a mismatch. 237 ;; Otherwise, turn off any such highlighting.
175 (condition-case () 238 (if (or (not here-beg)
176 (setq pos (scan-sexps (point) dir)) 239 (and (not show-paren-highlight-openparen)
177 (error (setq pos t mismatch t))) 240 (> here-end (point))
178 ;; Move back the other way and verify we get back to the 241 (integerp there-beg)))
179 ;; starting point. If not, these two parens don't really match. 242 (delete-overlay show-paren--overlay-1)
180 ;; Maybe the one at point is escaped and doesn't really count. 243 (move-overlay show-paren--overlay-1
181 (when (integerp pos) 244 here-beg here-end (current-buffer))
182 (unless (condition-case () 245 ;; Always set the overlay face, since it varies.
183 (eq (point) (scan-sexps pos (- dir))) 246 (overlay-put show-paren--overlay-1 'priority show-paren-priority)
184 (error nil)) 247 (overlay-put show-paren--overlay-1 'face face))
185 (setq pos nil))) 248 ;;
186 ;; If found a "matching" paren, see if it is the right 249 ;; Turn on highlighting for the matching paren, if found.
187 ;; kind of paren to match the one we started at. 250 ;; If it's an unmatched paren, turn off any such highlighting.
188 (when (integerp pos) 251 (if (not there-beg)
189 (let ((beg (min pos oldpos)) (end (max pos oldpos))) 252 (delete-overlay show-paren--overlay)
190 (unless (eq (syntax-class (syntax-after beg)) 8) 253 (if (or (eq show-paren-style 'expression)
191 (setq mismatch 254 (and (eq show-paren-style 'mixed)
192 (not (or (eq (char-before end) 255 (let ((closest (if (< there-beg here-beg)
193 ;; This can give nil. 256 (1- there-end) (1+ there-beg))))
194 (cdr (syntax-after beg))) 257 (not (pos-visible-in-window-p closest)))))
195 (eq (char-after beg) 258 (move-overlay show-paren--overlay
196 ;; This can give nil. 259 (point)
197 (cdr (syntax-after (1- end)))) 260 (if (< there-beg here-beg) there-beg there-end)
198 ;; The cdr might hold a new paren-class 261 (current-buffer))
199 ;; info rather than a matching-char info, 262 (move-overlay show-paren--overlay
200 ;; in which case the two CDRs should match. 263 there-beg there-end (current-buffer)))
201 (eq (cdr (syntax-after (1- end))) 264 ;; Always set the overlay face, since it varies.
202 (cdr (syntax-after beg)))))))))))) 265 (overlay-put show-paren--overlay 'priority show-paren-priority)
203 ;; 266 (overlay-put show-paren--overlay 'face face))))))
204 ;; Highlight the other end of the sexp, or unhighlight if none.
205 (if (not pos)
206 (progn
207 ;; If not at a paren that has a match,
208 ;; turn off any previous paren highlighting.
209 (and show-paren-overlay (overlay-buffer show-paren-overlay)
210 (delete-overlay show-paren-overlay))
211 (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1)
212 (delete-overlay show-paren-overlay-1)))
213 ;;
214 ;; Use the correct face.
215 (if mismatch
216 (progn
217 (if show-paren-ring-bell-on-mismatch
218 (beep))
219 (setq face 'show-paren-mismatch))
220 (setq face 'show-paren-match))
221 ;;
222 ;; If matching backwards, highlight the closeparen
223 ;; before point as well as its matching open.
224 ;; If matching forward, and the openparen is unbalanced,
225 ;; highlight the paren at point to indicate misbalance.
226 ;; Otherwise, turn off any such highlighting.
227 (if (and (not show-paren-highlight-openparen) (= dir 1) (integerp pos))
228 (when (and show-paren-overlay-1
229 (overlay-buffer show-paren-overlay-1))
230 (delete-overlay show-paren-overlay-1))
231 (let ((from (if (= dir 1)
232 (point)
233 (- (point) 1)))
234 (to (if (= dir 1)
235 (+ (point) 1)
236 (point))))
237 (if show-paren-overlay-1
238 (move-overlay show-paren-overlay-1 from to (current-buffer))
239 (setq show-paren-overlay-1 (make-overlay from to nil t)))
240 ;; Always set the overlay face, since it varies.
241 (overlay-put show-paren-overlay-1 'priority show-paren-priority)
242 (overlay-put show-paren-overlay-1 'face face)))
243 ;;
244 ;; Turn on highlighting for the matching paren, if found.
245 ;; If it's an unmatched paren, turn off any such highlighting.
246 (if (not (integerp pos))
247 (when show-paren-overlay (delete-overlay show-paren-overlay))
248 (let ((to (if (or (eq show-paren-style 'expression)
249 (and (eq show-paren-style 'mixed)
250 (not (pos-visible-in-window-p pos))))
251 (point)
252 pos))
253 (from (if (or (eq show-paren-style 'expression)
254 (and (eq show-paren-style 'mixed)
255 (not (pos-visible-in-window-p pos))))
256 pos
257 (save-excursion
258 (goto-char pos)
259 (- (point) dir)))))
260 (if show-paren-overlay
261 (move-overlay show-paren-overlay from to (current-buffer))
262 (setq show-paren-overlay (make-overlay from to nil t))))
263 ;; Always set the overlay face, since it varies.
264 (overlay-put show-paren-overlay 'priority show-paren-priority)
265 (overlay-put show-paren-overlay 'face face))))
266 ;; show-paren-mode is nil in this buffer.
267 (and show-paren-overlay
268 (delete-overlay show-paren-overlay))
269 (and show-paren-overlay-1
270 (delete-overlay show-paren-overlay-1))))
271 267
272(provide 'paren) 268(provide 'paren)
273 269
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el
index 91b146fdc78..fb31984facc 100644
--- a/lisp/pcmpl-gnu.el
+++ b/lisp/pcmpl-gnu.el
@@ -158,7 +158,8 @@
158 "Completion for the GNU tar utility." 158 "Completion for the GNU tar utility."
159 ;; options that end in an equal sign will want further completion... 159 ;; options that end in an equal sign will want further completion...
160 (let (saw-option complete-within) 160 (let (saw-option complete-within)
161 (let ((pcomplete-suffix-list (cons ?= pcomplete-suffix-list))) 161 (let ((pcomplete-suffix-list (if (boundp 'pcomplete-suffix-list)
162 (cons ?= pcomplete-suffix-list))))
162 (while (pcomplete-match "^-" 0) 163 (while (pcomplete-match "^-" 0)
163 (setq saw-option t) 164 (setq saw-option t)
164 (if (pcomplete-match "^--" 0) 165 (if (pcomplete-match "^--" 0)
diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el
index e41455f7883..337a5292417 100644
--- a/lisp/progmodes/cc-bytecomp.el
+++ b/lisp/progmodes/cc-bytecomp.el
@@ -232,6 +232,9 @@ perhaps a `cc-bytecomp-restore-environment' is forgotten somewhere"))
232 (cc-bytecomp-setup-environment) 232 (cc-bytecomp-setup-environment)
233 t)))) 233 t))))
234 234
235(defvar cc-bytecomp-noruntime-functions nil
236 "Saved value of `byte-compile-noruntime-functions'.")
237
235(defmacro cc-require (cc-part) 238(defmacro cc-require (cc-part)
236 "Force loading of the corresponding .el file in the current directory 239 "Force loading of the corresponding .el file in the current directory
237during compilation, but compile in a `require'. Don't use within 240during compilation, but compile in a `require'. Don't use within
@@ -240,7 +243,16 @@ during compilation, but compile in a `require'. Don't use within
240Having cyclic cc-require's will result in infinite recursion. That's 243Having cyclic cc-require's will result in infinite recursion. That's
241somewhat intentional." 244somewhat intentional."
242 `(progn 245 `(progn
243 (eval-when-compile (cc-bytecomp-load (symbol-name ,cc-part))) 246 (eval-when-compile
247 (setq cc-bytecomp-noruntime-functions byte-compile-noruntime-functions)
248 (cc-bytecomp-load (symbol-name ,cc-part)))
249 ;; Hack to suppress spurious "might not be defined at runtime" warnings.
250 ;; The basic issue is that
251 ;; (eval-when-compile (require 'foo))
252 ;; (require 'foo)
253 ;; produces bogus noruntime warnings about functions from foo.
254 (eval-when-compile
255 (setq byte-compile-noruntime-functions cc-bytecomp-noruntime-functions))
244 (require ,cc-part))) 256 (require ,cc-part)))
245 257
246(defmacro cc-provide (feature) 258(defmacro cc-provide (feature)
@@ -266,7 +278,7 @@ somewhat intentional."
266during compilation, but do a compile time `require' otherwise. Don't 278during compilation, but do a compile time `require' otherwise. Don't
267use within `eval-when-compile'." 279use within `eval-when-compile'."
268 `(eval-when-compile 280 `(eval-when-compile
269 (if (and (featurep 'cc-bytecomp) 281 (if (and (fboundp 'cc-bytecomp-is-compiling)
270 (cc-bytecomp-is-compiling)) 282 (cc-bytecomp-is-compiling))
271 (if (or (not load-in-progress) 283 (if (or (not load-in-progress)
272 (not (featurep ,cc-part))) 284 (not (featurep ,cc-part)))
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 0bb804799dc..dc6ed1348d1 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -45,7 +45,6 @@
45(cc-require 'cc-engine) 45(cc-require 'cc-engine)
46 46
47;; Silence the compiler. 47;; Silence the compiler.
48(cc-bytecomp-defun delete-forward-p) ; XEmacs
49(cc-bytecomp-defvar filladapt-mode) ; c-fill-paragraph contains a kludge 48(cc-bytecomp-defvar filladapt-mode) ; c-fill-paragraph contains a kludge
50 ; which looks at this. 49 ; which looks at this.
51 50
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index e7f96767675..b90a01dcb3b 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -48,16 +48,12 @@
48 48
49;; Silence the compiler. 49;; Silence the compiler.
50(cc-bytecomp-defvar c-enable-xemacs-performance-kludge-p) ; In cc-vars.el 50(cc-bytecomp-defvar c-enable-xemacs-performance-kludge-p) ; In cc-vars.el
51(cc-bytecomp-defun buffer-syntactic-context-depth) ; XEmacs
52(cc-bytecomp-defun region-active-p) ; XEmacs 51(cc-bytecomp-defun region-active-p) ; XEmacs
53(cc-bytecomp-defvar zmacs-region-stays) ; XEmacs
54(cc-bytecomp-defvar zmacs-regions) ; XEmacs
55(cc-bytecomp-defvar mark-active) ; Emacs 52(cc-bytecomp-defvar mark-active) ; Emacs
56(cc-bytecomp-defvar deactivate-mark) ; Emacs 53(cc-bytecomp-defvar deactivate-mark) ; Emacs
57(cc-bytecomp-defvar inhibit-point-motion-hooks) ; Emacs 54(cc-bytecomp-defvar inhibit-point-motion-hooks) ; Emacs
58(cc-bytecomp-defvar parse-sexp-lookup-properties) ; Emacs 55(cc-bytecomp-defvar parse-sexp-lookup-properties) ; Emacs
59(cc-bytecomp-defvar text-property-default-nonsticky) ; Emacs 21 56(cc-bytecomp-defvar text-property-default-nonsticky) ; Emacs 21
60(cc-bytecomp-defvar lookup-syntax-properties) ; XEmacs
61(cc-bytecomp-defun string-to-syntax) ; Emacs 21 57(cc-bytecomp-defun string-to-syntax) ; Emacs 21
62 58
63 59
@@ -334,6 +330,8 @@ to it is returned. This function does not modify the point or the mark."
334(defmacro c-region-is-active-p () 330(defmacro c-region-is-active-p ()
335 ;; Return t when the region is active. The determination of region 331 ;; Return t when the region is active. The determination of region
336 ;; activeness is different in both Emacs and XEmacs. 332 ;; activeness is different in both Emacs and XEmacs.
333 ;; FIXME? Emacs has region-active-p since 23.1, so maybe this test
334 ;; should be updated.
337 (if (cc-bytecomp-boundp 'mark-active) 335 (if (cc-bytecomp-boundp 'mark-active)
338 ;; Emacs. 336 ;; Emacs.
339 'mark-active 337 'mark-active
@@ -343,7 +341,7 @@ to it is returned. This function does not modify the point or the mark."
343(defmacro c-set-region-active (activate) 341(defmacro c-set-region-active (activate)
344 ;; Activate the region if ACTIVE is non-nil, deactivate it 342 ;; Activate the region if ACTIVE is non-nil, deactivate it
345 ;; otherwise. Covers the differences between Emacs and XEmacs. 343 ;; otherwise. Covers the differences between Emacs and XEmacs.
346 (if (cc-bytecomp-fboundp 'zmacs-activate-region) 344 (if (fboundp 'zmacs-activate-region)
347 ;; XEmacs. 345 ;; XEmacs.
348 `(if ,activate 346 `(if ,activate
349 (zmacs-activate-region) 347 (zmacs-activate-region)
@@ -707,9 +705,9 @@ be after it."
707 ;; `c-parse-state'. 705 ;; `c-parse-state'.
708 706
709 `(progn 707 `(progn
710 (if (and ,(cc-bytecomp-fboundp 'buffer-syntactic-context-depth) 708 (if (and ,(fboundp 'buffer-syntactic-context-depth)
711 c-enable-xemacs-performance-kludge-p) 709 c-enable-xemacs-performance-kludge-p)
712 ,(when (cc-bytecomp-fboundp 'buffer-syntactic-context-depth) 710 ,(when (fboundp 'buffer-syntactic-context-depth)
713 ;; XEmacs only. This can improve the performance of 711 ;; XEmacs only. This can improve the performance of
714 ;; c-parse-state to between 3 and 60 times faster when 712 ;; c-parse-state to between 3 and 60 times faster when
715 ;; braces are hung. It can also degrade performance by 713 ;; braces are hung. It can also degrade performance by
@@ -1606,7 +1604,7 @@ non-nil, a caret is prepended to invert the set."
1606 (let ((buf (generate-new-buffer " test")) 1604 (let ((buf (generate-new-buffer " test"))
1607 parse-sexp-lookup-properties 1605 parse-sexp-lookup-properties
1608 parse-sexp-ignore-comments 1606 parse-sexp-ignore-comments
1609 lookup-syntax-properties) 1607 lookup-syntax-properties) ; XEmacs
1610 (with-current-buffer buf 1608 (with-current-buffer buf
1611 (set-syntax-table (make-syntax-table)) 1609 (set-syntax-table (make-syntax-table))
1612 1610
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 6a23da1f2cd..9077bdbb513 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -147,9 +147,6 @@
147(cc-require-when-compile 'cc-langs) 147(cc-require-when-compile 'cc-langs)
148(cc-require 'cc-vars) 148(cc-require 'cc-vars)
149 149
150;; Silence the compiler.
151(cc-bytecomp-defun buffer-syntactic-context) ; XEmacs
152
153 150
154;; Make declarations for all the `c-lang-defvar' variables in cc-langs. 151;; Make declarations for all the `c-lang-defvar' variables in cc-langs.
155 152
@@ -9358,10 +9355,6 @@ comment at the start of cc-engine.el for more info."
9358 containing-sexp nil))) 9355 containing-sexp nil)))
9359 (setq lim (1+ containing-sexp)))) 9356 (setq lim (1+ containing-sexp))))
9360 (setq lim (point-min))) 9357 (setq lim (point-min)))
9361 (when (c-beginning-of-macro)
9362 (goto-char indent-point)
9363 (let ((lim1 (c-determine-limit 2000)))
9364 (setq lim (max lim lim1))))
9365 9358
9366 ;; If we're in a parenthesis list then ',' delimits the 9359 ;; If we're in a parenthesis list then ',' delimits the
9367 ;; "statements" rather than being an operator (with the 9360 ;; "statements" rather than being an operator (with the
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 83343b23014..6a4bfd9e875 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -176,7 +176,6 @@
176 'font-lock-negation-char-face)) 176 'font-lock-negation-char-face))
177 177
178(cc-bytecomp-defun face-inverse-video-p) ; Only in Emacs. 178(cc-bytecomp-defun face-inverse-video-p) ; Only in Emacs.
179(cc-bytecomp-defun face-property-instance) ; Only in XEmacs.
180 179
181(defun c-make-inverse-face (oldface newface) 180(defun c-make-inverse-face (oldface newface)
182 ;; Emacs and XEmacs have completely different face manipulation 181 ;; Emacs and XEmacs have completely different face manipulation
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 746b75d962b..74818b7e1ea 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -86,8 +86,8 @@
86 (load "cc-bytecomp" nil t))) 86 (load "cc-bytecomp" nil t)))
87 87
88(cc-require 'cc-defs) 88(cc-require 'cc-defs)
89(cc-require-when-compile 'cc-langs)
90(cc-require 'cc-vars) 89(cc-require 'cc-vars)
90(cc-require-when-compile 'cc-langs)
91(cc-require 'cc-engine) 91(cc-require 'cc-engine)
92(cc-require 'cc-styles) 92(cc-require 'cc-styles)
93(cc-require 'cc-cmds) 93(cc-require 'cc-cmds)
@@ -97,7 +97,6 @@
97 97
98;; Silence the compiler. 98;; Silence the compiler.
99(cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs 99(cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
100(cc-bytecomp-defun set-keymap-parents) ; XEmacs
101(cc-bytecomp-defun run-mode-hooks) ; Emacs 21.1 100(cc-bytecomp-defun run-mode-hooks) ; Emacs 21.1
102 101
103;; We set these variables during mode init, yet we don't require 102;; We set these variables during mode init, yet we don't require
@@ -212,7 +211,7 @@ control). See \"cc-mode.el\" for more info."
212 ((cc-bytecomp-fboundp 'set-keymap-parent) 211 ((cc-bytecomp-fboundp 'set-keymap-parent)
213 (set-keymap-parent map c-mode-base-map)) 212 (set-keymap-parent map c-mode-base-map))
214 ;; XEmacs 213 ;; XEmacs
215 ((cc-bytecomp-fboundp 'set-keymap-parents) 214 ((fboundp 'set-keymap-parents)
216 (set-keymap-parents map c-mode-base-map)) 215 (set-keymap-parents map c-mode-base-map))
217 ;; incompatible 216 ;; incompatible
218 (t (error "CC Mode is incompatible with this version of Emacs"))) 217 (t (error "CC Mode is incompatible with this version of Emacs")))
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index f830cc7edc1..c89402c63a3 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -42,23 +42,25 @@
42 42
43(cc-require 'cc-defs) 43(cc-require 'cc-defs)
44 44
45;; Silence the compiler.
46(cc-bytecomp-defun get-char-table) ; XEmacs
47
48(cc-eval-when-compile 45(cc-eval-when-compile
49 (require 'custom) 46 (require 'custom)
50 (require 'widget)) 47 (require 'widget))
51 48
52;;; Helpers 49;;; Helpers
53 50
54;; This widget exists in newer versions of the Custom library 51
55(or (get 'other 'widget-type) 52;; Emacs has 'other since at least version 21.1.
56 (define-widget 'other 'sexp 53;; FIXME this is probably broken, since the widget is defined
57 "Matches everything, but doesn't let the user edit the value. 54;; in wid-edit, which this file does not load. So we will always
55;; define the widget, even when we don't need to.
56(when (featurep 'xemacs)
57 (or (get 'other 'widget-type)
58 (define-widget 'other 'sexp
59 "Matches everything, but doesn't let the user edit the value.
58Useful as last item in a `choice' widget." 60Useful as last item in a `choice' widget."
59 :tag "Other" 61 :tag "Other"
60 :format "%t%n" 62 :format "%t%n"
61 :value 'other)) 63 :value 'other)))
62 64
63;; The next defun will supersede c-const-symbol. 65;; The next defun will supersede c-const-symbol.
64(eval-and-compile 66(eval-and-compile
@@ -1645,6 +1647,7 @@ and is likely to disappear or change its form soon.")
1645 ;; `c-macro-with-semi-re' (or just copy it if it's already a re). 1647 ;; `c-macro-with-semi-re' (or just copy it if it's already a re).
1646 (setq c-macro-with-semi-re 1648 (setq c-macro-with-semi-re
1647 (and 1649 (and
1650 (boundp 'c-opt-cpp-macro-define)
1648 c-opt-cpp-macro-define 1651 c-opt-cpp-macro-define
1649 (cond 1652 (cond
1650 ((stringp c-macro-names-with-semicolon) 1653 ((stringp c-macro-names-with-semicolon)
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 11eb0eeaf49..01b5faef5b3 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -527,6 +527,11 @@ Intended as the value of `indent-line-function'."
527 ;; Doze path separators. 527 ;; Doze path separators.
528 (modify-syntax-entry ?\\ "." table)) 528 (modify-syntax-entry ?\\ "." table))
529 529
530(defconst cfengine3--prettify-symbols-alist
531 '(("->" . ?→)
532 ("=>" . ?⇒)
533 ("::" . ?∷)))
534
530;;;###autoload 535;;;###autoload
531(define-derived-mode cfengine3-mode prog-mode "CFE3" 536(define-derived-mode cfengine3-mode prog-mode "CFE3"
532 "Major mode for editing CFEngine3 input. 537 "Major mode for editing CFEngine3 input.
@@ -538,8 +543,11 @@ to the action header."
538 (cfengine-common-syntax cfengine3-mode-syntax-table) 543 (cfengine-common-syntax cfengine3-mode-syntax-table)
539 544
540 (set (make-local-variable 'indent-line-function) #'cfengine3-indent-line) 545 (set (make-local-variable 'indent-line-function) #'cfengine3-indent-line)
546
541 (setq font-lock-defaults 547 (setq font-lock-defaults
542 '(cfengine3-font-lock-keywords nil nil nil beginning-of-defun)) 548 '(cfengine3-font-lock-keywords
549 nil nil nil beginning-of-defun))
550 (prog-prettify-install cfengine3--prettify-symbols-alist)
543 551
544 ;; Use defuns as the essential syntax block. 552 ;; Use defuns as the essential syntax block.
545 (set (make-local-variable 'beginning-of-defun-function) 553 (set (make-local-variable 'beginning-of-defun-function)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index d6f136ec92d..d9c482330cc 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1002,7 +1002,7 @@ POS and RES.")
1002 (let ((win (get-buffer-window buffer 0))) 1002 (let ((win (get-buffer-window buffer 0)))
1003 (if win (set-window-point win pos))) 1003 (if win (set-window-point win pos)))
1004 (if compilation-auto-jump-to-first-error 1004 (if compilation-auto-jump-to-first-error
1005 (compile-goto-error)))) 1005 (compile-goto-error nil t))))
1006 1006
1007;; This function is the central driver, called when font-locking to gather 1007;; This function is the central driver, called when font-locking to gather
1008;; all information needed to later jump to corresponding source code. 1008;; all information needed to later jump to corresponding source code.
@@ -2317,7 +2317,7 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)."
2317 2317
2318(defalias 'compile-mouse-goto-error 'compile-goto-error) 2318(defalias 'compile-mouse-goto-error 'compile-goto-error)
2319 2319
2320(defun compile-goto-error (&optional event) 2320(defun compile-goto-error (&optional event nomsg)
2321 "Visit the source for the error message at point. 2321 "Visit the source for the error message at point.
2322Use this command in a compilation log buffer. Sets the mark at point there." 2322Use this command in a compilation log buffer. Sets the mark at point there."
2323 (interactive (list last-input-event)) 2323 (interactive (list last-input-event))
@@ -2328,7 +2328,7 @@ Use this command in a compilation log buffer. Sets the mark at point there."
2328 (if (get-text-property (point) 'compilation-directory) 2328 (if (get-text-property (point) 'compilation-directory)
2329 (dired-other-window 2329 (dired-other-window
2330 (car (get-text-property (point) 'compilation-directory))) 2330 (car (get-text-property (point) 'compilation-directory)))
2331 (push-mark) 2331 (push-mark nil nomsg)
2332 (setq compilation-current-error (point)) 2332 (setq compilation-current-error (point))
2333 (next-error-internal))) 2333 (next-error-internal)))
2334 2334
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 407d4042c39..910e7c49d2a 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -6671,10 +6671,13 @@ Customized by setting variables `cperl-shrink-wrap-info-frame',
6671 (buffer-substring 6671 (buffer-substring
6672 (match-beginning 1) (match-end 1))) 6672 (match-beginning 1) (match-end 1)))
6673 6673
6674(declare-function imenu-choose-buffer-index "imenu" (&optional prompt alist))
6675
6674(defun cperl-imenu-on-info () 6676(defun cperl-imenu-on-info ()
6675 "Shows imenu for Perl Info Buffer. 6677 "Shows imenu for Perl Info Buffer.
6676Opens Perl Info buffer if needed." 6678Opens Perl Info buffer if needed."
6677 (interactive) 6679 (interactive)
6680 (require 'imenu)
6678 (let* ((buffer (current-buffer)) 6681 (let* ((buffer (current-buffer))
6679 imenu-create-index-function 6682 imenu-create-index-function
6680 imenu-prev-index-position-function 6683 imenu-prev-index-position-function
@@ -7134,6 +7137,10 @@ Use as
7134(defvar cperl-hierarchy '(() ()) 7137(defvar cperl-hierarchy '(() ())
7135 "Global hierarchy of classes.") 7138 "Global hierarchy of classes.")
7136 7139
7140;; Follows call to (autoloaded) visit-tags-table.
7141(declare-function file-of-tag "etags" (&optional relative))
7142(declare-function etags-snarf-tag "etags" (&optional use-explicit))
7143
7137(defun cperl-tags-hier-fill () 7144(defun cperl-tags-hier-fill ()
7138 ;; Suppose we are in a tag table cooked by cperl. 7145 ;; Suppose we are in a tag table cooked by cperl.
7139 (goto-char 1) 7146 (goto-char 1)
@@ -7177,6 +7184,7 @@ Use as
7177 (end-of-line)))) 7184 (end-of-line))))
7178 7185
7179(declare-function x-popup-menu "menu.c" (position menu)) 7186(declare-function x-popup-menu "menu.c" (position menu))
7187(declare-function etags-goto-tag-location "etags" (tag-info))
7180 7188
7181(defun cperl-tags-hier-init (&optional update) 7189(defun cperl-tags-hier-init (&optional update)
7182 "Show hierarchical menu of classes and methods. 7190 "Show hierarchical menu of classes and methods.
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index a6ad5736576..0b52302a98d 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -345,7 +345,7 @@ triggers in `gdb-handler-list'."
345 `(run-with-timer 345 `(run-with-timer
346 0.5 nil 346 0.5 nil
347 '(lambda () 347 '(lambda ()
348 (if (not (gdb-find-if (lambda (handler) 348 (if (not (cl-find-if (lambda (handler)
349 (gdb-handler-pending-trigger handler)) 349 (gdb-handler-pending-trigger handler))
350 gdb-handler-list)) 350 gdb-handler-list))
351 (progn ,@body) 351 (progn ,@body)
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index aeaf1acb2ac..ba9a632b949 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -5078,11 +5078,14 @@ Cache to disk for quick recovery."
5078 ;; The sequence here is important because earlier definitions shadow 5078 ;; The sequence here is important because earlier definitions shadow
5079 ;; later ones. We assume that if things in the buffers are newer 5079 ;; later ones. We assume that if things in the buffers are newer
5080 ;; then in the shell of the system, they are meant to be different. 5080 ;; then in the shell of the system, they are meant to be different.
5081 (setcdr idlwave-last-system-routine-info-cons-cell 5081 (let ((temp (append idlwave-buffer-routines
5082 (append idlwave-buffer-routines 5082 idlwave-compiled-routines
5083 idlwave-compiled-routines 5083 idlwave-library-catalog-routines
5084 idlwave-library-catalog-routines 5084 idlwave-user-catalog-routines)))
5085 idlwave-user-catalog-routines)) 5085 ;; Not actually used for anything?
5086 (if idlwave-last-system-routine-info-cons-cell
5087 (setcdr idlwave-last-system-routine-info-cons-cell temp)
5088 (setq idlwave-last-system-routine-info-cons-cell (cons temp nil))))
5086 (setq idlwave-class-alist nil) 5089 (setq idlwave-class-alist nil)
5087 5090
5088 ;; Give a message with information about the number of routines we have. 5091 ;; Give a message with information about the number of routines we have.
@@ -5481,30 +5484,21 @@ directories and save the routine info.
5481 (message "Creating user catalog file...") 5484 (message "Creating user catalog file...")
5482 (kill-buffer "*idlwave-scan.pro*") 5485 (kill-buffer "*idlwave-scan.pro*")
5483 (kill-buffer (get-buffer-create "*IDLWAVE Widget*")) 5486 (kill-buffer (get-buffer-create "*IDLWAVE Widget*"))
5484 (let ((font-lock-maximum-size 0) 5487 (with-temp-buffer
5485 (auto-mode-alist nil)) 5488 (insert ";; IDLWAVE user catalog file\n")
5486 (find-file idlwave-user-catalog-file)) 5489 (insert (format ";; Created %s\n\n" (current-time-string)))
5487 (if (and (boundp 'font-lock-mode) 5490
5488 font-lock-mode) 5491 ;; Define the routine info list
5489 (font-lock-mode 0)) 5492 (insert "\n(setq idlwave-user-catalog-routines\n '(")
5490 (erase-buffer) 5493 (let ((standard-output (current-buffer)))
5491 (insert ";; IDLWAVE user catalog file\n") 5494 (mapc (lambda (x)
5492 (insert (format ";; Created %s\n\n" (current-time-string))) 5495 (insert "\n ")
5493 5496 (prin1 x)
5494 ;; Define the routine info list 5497 (goto-char (point-max)))
5495 (insert "\n(setq idlwave-user-catalog-routines\n '(") 5498 idlwave-user-catalog-routines))
5496 (let ((standard-output (current-buffer))) 5499 (insert (format "))\n\n;;; %s ends here\n"
5497 (mapc (lambda (x) 5500 (file-name-nondirectory idlwave-user-catalog-file)))
5498 (insert "\n ") 5501 (write-region nil nil idlwave-user-catalog-file)))
5499 (prin1 x)
5500 (goto-char (point-max)))
5501 idlwave-user-catalog-routines))
5502 (insert (format "))\n\n;;; %s ends here\n"
5503 (file-name-nondirectory idlwave-user-catalog-file)))
5504 (goto-char (point-min))
5505 ;; Save the buffer
5506 (save-buffer 0)
5507 (kill-buffer (current-buffer)))
5508 (message "Creating user catalog file...done") 5502 (message "Creating user catalog file...done")
5509 (message "Info for %d routines saved in %s" 5503 (message "Info for %d routines saved in %s"
5510 (length idlwave-user-catalog-routines) 5504 (length idlwave-user-catalog-routines)
@@ -5522,31 +5516,23 @@ directories and save the routine info.
5522(defun idlwave-write-paths () 5516(defun idlwave-write-paths ()
5523 (interactive) 5517 (interactive)
5524 (when (and idlwave-path-alist idlwave-system-directory) 5518 (when (and idlwave-path-alist idlwave-system-directory)
5525 (let ((font-lock-maximum-size 0) 5519 (with-temp-buffer
5526 (auto-mode-alist nil)) 5520 (insert ";; IDLWAVE paths\n")
5527 (find-file idlwave-path-file)) 5521 (insert (format ";; Created %s\n\n" (current-time-string)))
5528 (if (and (boundp 'font-lock-mode)
5529 font-lock-mode)
5530 (font-lock-mode 0))
5531 (erase-buffer)
5532 (insert ";; IDLWAVE paths\n")
5533 (insert (format ";; Created %s\n\n" (current-time-string)))
5534 ;; Define the variable which knows the value of "!DIR" 5522 ;; Define the variable which knows the value of "!DIR"
5535 (insert (format "\n(setq idlwave-system-directory \"%s\")\n" 5523 (insert (format "\n(setq idlwave-system-directory \"%s\")\n"
5536 idlwave-system-directory)) 5524 idlwave-system-directory))
5537 5525
5538 ;; Define the variable which contains a list of all scanned directories 5526 ;; Define the variable which contains a list of all scanned directories
5539 (insert "\n(setq idlwave-path-alist\n '(") 5527 (insert "\n(setq idlwave-path-alist\n '(")
5540 (let ((standard-output (current-buffer))) 5528 (let ((standard-output (current-buffer)))
5541 (mapc (lambda (x) 5529 (mapc (lambda (x)
5542 (insert "\n ") 5530 (insert "\n ")
5543 (prin1 x) 5531 (prin1 x)
5544 (goto-char (point-max))) 5532 (goto-char (point-max)))
5545 idlwave-path-alist)) 5533 idlwave-path-alist))
5546 (insert "))\n") 5534 (insert "))\n")
5547 (save-buffer 0) 5535 (write-region nil nil idlwave-path-file))))
5548 (kill-buffer (current-buffer))))
5549
5550 5536
5551(defun idlwave-expand-path (path &optional default-dir) 5537(defun idlwave-expand-path (path &optional default-dir)
5552 ;; Expand parts of path starting with '+' recursively into directory list. 5538 ;; Expand parts of path starting with '+' recursively into directory list.
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 4985f5fb38e..b1936467274 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -89,7 +89,7 @@ Used in `octave-mode' and `inferior-octave-mode' buffers.")
89 89
90(defvar octave-function-header-regexp 90(defvar octave-function-header-regexp
91 (concat "^\\s-*\\_<\\(function\\)\\_>" 91 (concat "^\\s-*\\_<\\(function\\)\\_>"
92 "\\([^=;\n]*=[ \t]*\\|[ \t]*\\)\\(\\(?:\\w\\|\\s_\\)+\\)\\_>") 92 "\\([^=;(\n]*=[ \t]*\\|[ \t]*\\)\\(\\(?:\\w\\|\\s_\\)+\\)\\_>")
93 "Regexp to match an Octave function header. 93 "Regexp to match an Octave function header.
94The string `function' and its name are given by the first and third 94The string `function' and its name are given by the first and third
95parenthetical grouping.") 95parenthetical grouping.")
@@ -153,10 +153,10 @@ parenthetical grouping.")
153 'eldoc-mode)) 153 'eldoc-mode))
154 :style toggle :selected (or eldoc-post-insert-mode eldoc-mode) 154 :style toggle :selected (or eldoc-post-insert-mode eldoc-mode)
155 :help "Display function signatures after typing `SPC' or `('"] 155 :help "Display function signatures after typing `SPC' or `('"]
156 ["Delimiter Matching" smie-highlight-matching-block-mode 156 ["Delimiter Matching" show-paren-mode
157 :style toggle :selected smie-highlight-matching-block-mode 157 :style toggle :selected show-paren-mode
158 :help "Highlight matched pairs such as `if ... end'" 158 :help "Highlight matched pairs such as `if ... end'"
159 :visible (fboundp 'smie-highlight-matching-block-mode)] 159 :visible (fboundp 'smie--matching-block-data)]
160 ["Auto Fill" auto-fill-mode 160 ["Auto Fill" auto-fill-mode
161 :style toggle :selected auto-fill-function 161 :style toggle :selected auto-fill-function
162 :help "Automatic line breaking"] 162 :help "Automatic line breaking"]
@@ -191,10 +191,9 @@ parenthetical grouping.")
191 (modify-syntax-entry ?! "." table) 191 (modify-syntax-entry ?! "." table)
192 (modify-syntax-entry ?\\ "." table) 192 (modify-syntax-entry ?\\ "." table)
193 (modify-syntax-entry ?\' "." table) 193 (modify-syntax-entry ?\' "." table)
194 ;; Was "w" for abbrevs, but now that it's not necessary any more,
195 (modify-syntax-entry ?\` "." table) 194 (modify-syntax-entry ?\` "." table)
195 (modify-syntax-entry ?. "." table)
196 (modify-syntax-entry ?\" "\"" table) 196 (modify-syntax-entry ?\" "\"" table)
197 (modify-syntax-entry ?. "_" table)
198 (modify-syntax-entry ?_ "_" table) 197 (modify-syntax-entry ?_ "_" table)
199 ;; The "b" flag only applies to the second letter of the comstart 198 ;; The "b" flag only applies to the second letter of the comstart
200 ;; and the first letter of the comend, i.e. the "4b" below is ineffective. 199 ;; and the first letter of the comend, i.e. the "4b" below is ineffective.
@@ -446,11 +445,11 @@ Non-nil means always go to the next Octave code line after sending."
446 (back-to-indentation) 445 (back-to-indentation)
447 (cond 446 (cond
448 ((octave-in-string-or-comment-p) nil) 447 ((octave-in-string-or-comment-p) nil)
449 ((looking-at-p "\\s<\\{3,\\}") 448 ((looking-at-p "\\(\\s<\\)\\1\\{2,\\}")
450 0) 449 0)
451 ;; Exclude %{, %} and %!. 450 ;; Exclude %{, %} and %!.
452 ((and (looking-at-p "\\s<\\(?:[^{}!]\\|$\\)") 451 ((and (looking-at-p "\\s<\\(?:[^{}!]\\|$\\)")
453 (not (looking-at-p "\\s<\\s<"))) 452 (not (looking-at-p "\\(\\s<\\)\\1")))
454 (comment-choose-indent))))) 453 (comment-choose-indent)))))
455 454
456 455
@@ -541,6 +540,7 @@ definitions can also be stored in files and used in batch mode."
541 ;; a ";" at those places where it's correct (i.e. outside of parens). 540 ;; a ";" at those places where it's correct (i.e. outside of parens).
542 (setq-local electric-layout-rules '((?\; . after))) 541 (setq-local electric-layout-rules '((?\; . after)))
543 542
543 (setq-local comment-use-global-state t)
544 (setq-local comment-start octave-comment-start) 544 (setq-local comment-start octave-comment-start)
545 (setq-local comment-end "") 545 (setq-local comment-end "")
546 (setq-local comment-start-skip octave-comment-start-skip) 546 (setq-local comment-start-skip octave-comment-start-skip)
@@ -564,6 +564,8 @@ definitions can also be stored in files and used in batch mode."
564 (setq-local imenu-generic-expression octave-mode-imenu-generic-expression) 564 (setq-local imenu-generic-expression octave-mode-imenu-generic-expression)
565 (setq-local imenu-case-fold-search nil) 565 (setq-local imenu-case-fold-search nil)
566 566
567 (setq-local add-log-current-defun-function #'octave-add-log-current-defun)
568
567 (add-hook 'completion-at-point-functions 'octave-completion-at-point nil t) 569 (add-hook 'completion-at-point-functions 'octave-completion-at-point nil t)
568 (add-hook 'before-save-hook 'octave-sync-function-file-names nil t) 570 (add-hook 'before-save-hook 'octave-sync-function-file-names nil t)
569 (setq-local beginning-of-defun-function 'octave-beginning-of-defun) 571 (setq-local beginning-of-defun-function 'octave-beginning-of-defun)
@@ -606,12 +608,13 @@ startup."
606 :group 'octave 608 :group 'octave
607 :version "24.4") 609 :version "24.4")
608 610
609(defcustom inferior-octave-startup-args nil 611(defcustom inferior-octave-startup-args '("-i" "--no-line-editing")
610 "List of command line arguments for the inferior Octave process. 612 "List of command line arguments for the inferior Octave process.
611For example, for suppressing the startup message and using `traditional' 613For example, for suppressing the startup message and using `traditional'
612mode, set this to (\"-q\" \"--traditional\")." 614mode, include \"-q\" and \"--traditional\"."
613 :type '(repeat string) 615 :type '(repeat string)
614 :group 'octave) 616 :group 'octave
617 :version "24.4")
615 618
616(defcustom inferior-octave-mode-hook nil 619(defcustom inferior-octave-mode-hook nil
617 "Hook to be run when Inferior Octave mode is started." 620 "Hook to be run when Inferior Octave mode is started."
@@ -665,6 +668,7 @@ in the Inferior Octave buffer.")
665 :abbrev-table octave-abbrev-table 668 :abbrev-table octave-abbrev-table
666 (setq comint-prompt-regexp inferior-octave-prompt) 669 (setq comint-prompt-regexp inferior-octave-prompt)
667 670
671 (setq-local comment-use-global-state t)
668 (setq-local comment-start octave-comment-start) 672 (setq-local comment-start octave-comment-start)
669 (setq-local comment-end "") 673 (setq-local comment-end "")
670 (setq comment-column 32) 674 (setq comment-column 32)
@@ -676,13 +680,16 @@ in the Inferior Octave buffer.")
676 (setq-local eldoc-documentation-function 'octave-eldoc-function) 680 (setq-local eldoc-documentation-function 'octave-eldoc-function)
677 681
678 (setq comint-input-ring-file-name 682 (setq comint-input-ring-file-name
679 (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist") 683 (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist")
680 comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024)) 684 comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024))
681 (setq-local comint-dynamic-complete-functions 685 (setq-local comint-dynamic-complete-functions
682 inferior-octave-dynamic-complete-functions) 686 inferior-octave-dynamic-complete-functions)
683 (setq-local comint-prompt-read-only inferior-octave-prompt-read-only) 687 (setq-local comint-prompt-read-only inferior-octave-prompt-read-only)
684 (add-hook 'comint-input-filter-functions 688 (add-hook 'comint-input-filter-functions
685 'inferior-octave-directory-tracker nil t) 689 'inferior-octave-directory-tracker nil t)
690 ;; http://thread.gmane.org/gmane.comp.gnu.octave.general/48572
691 (add-hook 'window-configuration-change-hook
692 'inferior-octave-track-window-width-change nil t)
686 (comint-read-input-ring t)) 693 (comint-read-input-ring t))
687 694
688;;;###autoload 695;;;###autoload
@@ -717,13 +724,13 @@ startup file, `~/.emacs-octave'."
717 (substring inferior-octave-buffer 1 -1) 724 (substring inferior-octave-buffer 1 -1)
718 inferior-octave-buffer 725 inferior-octave-buffer
719 inferior-octave-program 726 inferior-octave-program
720 (append (list "-i" "--no-line-editing") 727 (append
721 ;; --no-gui is introduced in Octave > 3.7 728 inferior-octave-startup-args
722 (when (zerop (process-file inferior-octave-program 729 ;; --no-gui is introduced in Octave > 3.7
723 nil nil nil 730 (and (not (member "--no-gui" inferior-octave-startup-args))
724 "--no-gui" "--help")) 731 (zerop (process-file inferior-octave-program
725 (list "--no-gui")) 732 nil nil nil "--no-gui" "--help"))
726 inferior-octave-startup-args)))) 733 '("--no-gui"))))))
727 (set-process-filter proc 'inferior-octave-output-digest) 734 (set-process-filter proc 'inferior-octave-output-digest)
728 (setq inferior-octave-process proc 735 (setq inferior-octave-process proc
729 inferior-octave-output-list nil 736 inferior-octave-output-list nil
@@ -753,10 +760,10 @@ startup file, `~/.emacs-octave'."
753 (inferior-octave-send-list-and-digest (list "PS2\n")) 760 (inferior-octave-send-list-and-digest (list "PS2\n"))
754 (when (string-match "\\(PS2\\|ans\\) = *$" 761 (when (string-match "\\(PS2\\|ans\\) = *$"
755 (car inferior-octave-output-list)) 762 (car inferior-octave-output-list))
756 (inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n"))) 763 (inferior-octave-send-list-and-digest (list "PS2 ('> ');\n")))
757 764
758 (inferior-octave-send-list-and-digest 765 (inferior-octave-send-list-and-digest
759 (list "disp(getenv(\"OCTAVE_SRCDIR\"))\n")) 766 (list "disp (getenv ('OCTAVE_SRCDIR'))\n"))
760 (process-put proc 'octave-srcdir 767 (process-put proc 'octave-srcdir
761 (unless (equal (car inferior-octave-output-list) "") 768 (unless (equal (car inferior-octave-output-list) "")
762 (car inferior-octave-output-list))) 769 (car inferior-octave-output-list)))
@@ -765,19 +772,19 @@ startup file, `~/.emacs-octave'."
765 (inferior-octave-send-list-and-digest 772 (inferior-octave-send-list-and-digest
766 (list "more off;\n" 773 (list "more off;\n"
767 (unless (equal inferior-octave-output-string ">> ") 774 (unless (equal inferior-octave-output-string ">> ")
768 "PS1 (\"\\\\s> \");\n") 775 "PS1 ('\\s> ');\n")
769 (when (and inferior-octave-startup-file 776 (when (and inferior-octave-startup-file
770 (file-exists-p inferior-octave-startup-file)) 777 (file-exists-p inferior-octave-startup-file))
771 (format "source (\"%s\");\n" inferior-octave-startup-file)))) 778 (format "source ('%s');\n" inferior-octave-startup-file))))
772 (when inferior-octave-output-list 779 (when inferior-octave-output-list
773 (insert-before-markers 780 (insert-before-markers
774 (mapconcat 'identity inferior-octave-output-list "\n"))) 781 (mapconcat 'identity inferior-octave-output-list "\n")))
775 782
776 ;; And finally, everything is back to normal. 783 ;; And finally, everything is back to normal.
777 (set-process-filter proc 'comint-output-filter) 784 (set-process-filter proc 'comint-output-filter)
778 ;; Just in case, to be sure a cd in the startup file 785 ;; Just in case, to be sure a cd in the startup file won't have
779 ;; won't have detrimental effects. 786 ;; detrimental effects.
780 (inferior-octave-resync-dirs) 787 (with-demoted-errors (inferior-octave-resync-dirs))
781 ;; Generate a proper prompt, which is critical to 788 ;; Generate a proper prompt, which is critical to
782 ;; `comint-history-isearch-backward-regexp'. Bug#14433. 789 ;; `comint-history-isearch-backward-regexp'. Bug#14433.
783 (comint-send-string proc "\n"))) 790 (comint-send-string proc "\n")))
@@ -793,7 +800,7 @@ startup file, `~/.emacs-octave'."
793 (unless (and (equal (car cache) command) 800 (unless (and (equal (car cache) command)
794 (< (float-time) (+ 5 (cadr cache)))) 801 (< (float-time) (+ 5 (cadr cache))))
795 (inferior-octave-send-list-and-digest 802 (inferior-octave-send-list-and-digest
796 (list (concat "completion_matches (\"" command "\");\n"))) 803 (list (format "completion_matches ('%s');\n" command)))
797 (setq cache (list command (float-time) 804 (setq cache (list command (float-time)
798 (delete-consecutive-dups 805 (delete-consecutive-dups
799 (sort inferior-octave-output-list 'string-lessp))))) 806 (sort inferior-octave-output-list 'string-lessp)))))
@@ -892,8 +899,8 @@ output is passed to the filter `inferior-octave-output-digest'."
892 "Tracks `cd' commands issued to the inferior Octave process. 899 "Tracks `cd' commands issued to the inferior Octave process.
893Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused." 900Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
894 (when inferior-octave-directory-tracker-resync 901 (when inferior-octave-directory-tracker-resync
895 (setq inferior-octave-directory-tracker-resync nil) 902 (or (inferior-octave-resync-dirs 'noerror)
896 (inferior-octave-resync-dirs)) 903 (setq inferior-octave-directory-tracker-resync nil)))
897 (cond 904 (cond
898 ((string-match "^[ \t]*cd[ \t;]*$" string) 905 ((string-match "^[ \t]*cd[ \t;]*$" string)
899 (cd "~")) 906 (cd "~"))
@@ -905,13 +912,35 @@ Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
905 (error-message-string err) 912 (error-message-string err)
906 (match-string 1 string))))))) 913 (match-string 1 string)))))))
907 914
908(defun inferior-octave-resync-dirs () 915(defun inferior-octave-resync-dirs (&optional noerror)
909 "Resync the buffer's idea of the current directory. 916 "Resync the buffer's idea of the current directory.
910This command queries the inferior Octave process about its current 917This command queries the inferior Octave process about its current
911directory and makes this the current buffer's default directory." 918directory and makes this the current buffer's default directory."
912 (interactive) 919 (interactive)
913 (inferior-octave-send-list-and-digest '("disp (pwd ())\n")) 920 (inferior-octave-send-list-and-digest '("disp (pwd ())\n"))
914 (cd (car inferior-octave-output-list))) 921 (condition-case err
922 (progn
923 (cd (car inferior-octave-output-list))
924 t)
925 (error (unless noerror (signal (car err) (cdr err))))))
926
927(defcustom inferior-octave-minimal-columns 80
928 "The minimal column width for the inferior Octave process."
929 :type 'integer
930 :group 'octave
931 :version "24.4")
932
933(defvar inferior-octave-last-column-width nil)
934
935(defun inferior-octave-track-window-width-change ()
936 ;; http://thread.gmane.org/gmane.comp.gnu.octave.general/48572
937 (let ((width (max inferior-octave-minimal-columns (window-width))))
938 (unless (eq inferior-octave-last-column-width width)
939 (setq-local inferior-octave-last-column-width width)
940 (when (and inferior-octave-process
941 (process-live-p inferior-octave-process))
942 (inferior-octave-send-list-and-digest
943 (list (format "putenv ('COLUMNS', '%s');\n" width)))))))
915 944
916 945
917;;; Miscellaneous useful functions 946;;; Miscellaneous useful functions
@@ -955,16 +984,17 @@ directory and makes this the current buffer's default directory."
955 984
956(defun octave-goto-function-definition (fn) 985(defun octave-goto-function-definition (fn)
957 "Go to the function definition of FN in current buffer." 986 "Go to the function definition of FN in current buffer."
958 (goto-char (point-min))
959 (let ((search 987 (let ((search
960 (lambda (re sub) 988 (lambda (re sub)
961 (let (done) 989 (let ((orig (point)) found)
962 (while (and (not done) (re-search-forward re nil t)) 990 (goto-char (point-min))
991 (while (and (not found) (re-search-forward re nil t))
963 (when (and (equal (match-string sub) fn) 992 (when (and (equal (match-string sub) fn)
964 (not (nth 8 (syntax-ppss)))) 993 (not (nth 8 (syntax-ppss))))
965 (setq done t))) 994 (setq found t)))
966 (or done (goto-char (point-min))))))) 995 (unless found (goto-char orig))
967 (pcase (file-name-extension (buffer-file-name)) 996 found))))
997 (pcase (and buffer-file-name (file-name-extension buffer-file-name))
968 (`"cc" (funcall search 998 (`"cc" (funcall search
969 "\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1)) 999 "\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))
970 (t (funcall search octave-function-header-regexp 3))))) 1000 (t (funcall search octave-function-header-regexp 3)))))
@@ -1325,8 +1355,6 @@ The block marked is the one that contains point or follows point."
1325 (forward-line 1)))) 1355 (forward-line 1))))
1326 t))) 1356 t)))
1327 1357
1328;;; Completions
1329
1330(defun octave-completion-at-point () 1358(defun octave-completion-at-point ()
1331 "Find the text to complete and the corresponding table." 1359 "Find the text to complete and the corresponding table."
1332 (let* ((beg (save-excursion (skip-syntax-backward "w_") (point))) 1360 (let* ((beg (save-excursion (skip-syntax-backward "w_") (point)))
@@ -1343,6 +1371,16 @@ The block marked is the one that contains point or follows point."
1343 1371
1344(define-obsolete-function-alias 'octave-complete-symbol 1372(define-obsolete-function-alias 'octave-complete-symbol
1345 'completion-at-point "24.1") 1373 'completion-at-point "24.1")
1374
1375(defun octave-add-log-current-defun ()
1376 "A function for `add-log-current-defun-function' (which see)."
1377 (save-excursion
1378 (end-of-line)
1379 (and (beginning-of-defun)
1380 (re-search-forward octave-function-header-regexp
1381 (line-end-position) t)
1382 (match-string 3))))
1383
1346 1384
1347;;; Electric characters && friends 1385;;; Electric characters && friends
1348(define-skeleton octave-insert-defun 1386(define-skeleton octave-insert-defun
@@ -1367,7 +1405,7 @@ entered without parens)."
1367 "function " > str \n 1405 "function " > str \n
1368 _ \n 1406 _ \n
1369 "endfunction" > \n) 1407 "endfunction" > \n)
1370 1408
1371;;; Communication with the inferior Octave process 1409;;; Communication with the inferior Octave process
1372(defun octave-kill-process () 1410(defun octave-kill-process ()
1373 "Kill inferior Octave process and its buffer." 1411 "Kill inferior Octave process and its buffer."
@@ -1486,9 +1524,7 @@ code line."
1486(defun octave-eldoc-function-signatures (fn) 1524(defun octave-eldoc-function-signatures (fn)
1487 (unless (equal fn (car octave-eldoc-cache)) 1525 (unless (equal fn (car octave-eldoc-cache))
1488 (inferior-octave-send-list-and-digest 1526 (inferior-octave-send-list-and-digest
1489 (list (format "\ 1527 (list (format "print_usage ('%s');\n" fn)))
1490if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
1491 fn fn)))
1492 (let (result) 1528 (let (result)
1493 (dolist (line inferior-octave-output-list) 1529 (dolist (line inferior-octave-output-list)
1494 (when (string-match 1530 (when (string-match
@@ -1585,20 +1621,11 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
1585 (when (or help-xref-stack help-xref-forward-stack) 1621 (when (or help-xref-stack help-xref-forward-stack)
1586 (insert "\n")))) 1622 (insert "\n"))))
1587 1623
1588(defvar octave-help-mode-finish-hook nil
1589 "Octave specific hook for `temp-buffer-show-hook'.")
1590
1591(defun octave-help-mode-finish ()
1592 (when (eq major-mode 'octave-help-mode)
1593 (run-hooks 'octave-help-mode-finish-hook)))
1594
1595(add-hook 'temp-buffer-show-hook 'octave-help-mode-finish)
1596
1597(defun octave-help (fn) 1624(defun octave-help (fn)
1598 "Display the documentation of FN." 1625 "Display the documentation of FN."
1599 (interactive (list (octave-completing-read))) 1626 (interactive (list (octave-completing-read)))
1600 (inferior-octave-send-list-and-digest 1627 (inferior-octave-send-list-and-digest
1601 (list (format "help \"%s\"\n" fn))) 1628 (list (format "help ('%s');\n" fn)))
1602 (let ((lines inferior-octave-output-list) 1629 (let ((lines inferior-octave-output-list)
1603 (inhibit-read-only t)) 1630 (inhibit-read-only t))
1604 (when (string-match "error: \\(.*\\)$" (car lines)) 1631 (when (string-match "error: \\(.*\\)$" (car lines))
@@ -1634,17 +1661,15 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
1634 (help-insert-xref-button (file-relative-name file dir) 1661 (help-insert-xref-button (file-relative-name file dir)
1635 'octave-help-file fn) 1662 'octave-help-file fn)
1636 (insert "'"))) 1663 (insert "'")))
1637 ;; Make 'See also' clickable 1664 ;; Make 'See also' clickable.
1638 (with-syntax-table octave-mode-syntax-table 1665 (with-syntax-table octave-mode-syntax-table
1639 (when (re-search-forward "^\\s-*See also:" nil t) 1666 (when (re-search-forward "^\\s-*See also:" nil t)
1640 (let ((end (or (save-excursion (re-search-forward "^\\s-*$" nil t)) 1667 (let ((end (save-excursion (re-search-forward "^\\s-*$" nil t))))
1641 (point-max)))) 1668 (while (re-search-forward
1642 (while (re-search-forward "\\_<\\(?:\\sw\\|\\s_\\)+\\_>" end t) 1669 ;; Match operators and symbols.
1643 (make-text-button (match-beginning 0) 1670 "\\(?1:\\s.+?\\)\\(?:$\\|[,;]\\|\\s-\\)\\|\\_<\\(?1:\\(?:\\sw\\|\\s_\\)+\\)\\_>"
1644 ;; If the match ends with . exclude it. 1671 end t)
1645 (if (eq (char-before (match-end 0)) ?.) 1672 (make-text-button (match-beginning 1) (match-end 1)
1646 (1- (match-end 0))
1647 (match-end 0))
1648 :type 'octave-help-function))))) 1673 :type 'octave-help-function)))))
1649 (octave-help-mode))))) 1674 (octave-help-mode)))))
1650 1675
@@ -1695,23 +1720,30 @@ If the environment variable OCTAVE_SRCDIR is set, it is searched first."
1695Functions implemented in C++ can be found if 1720Functions implemented in C++ can be found if
1696`octave-source-directories' is set correctly." 1721`octave-source-directories' is set correctly."
1697 (interactive (list (octave-completing-read))) 1722 (interactive (list (octave-completing-read)))
1698 (inferior-octave-send-list-and-digest 1723 (require 'etags)
1699 ;; help NAME is more verbose 1724 (let ((orig (point)))
1700 (list (format "\ 1725 (if (and (derived-mode-p 'octave-mode)
1701if iskeyword(\"%s\") disp(\"`%s' is a keyword\") else which(\"%s\") endif\n" 1726 (octave-goto-function-definition fn))
1702 fn fn fn))) 1727 (ring-insert find-tag-marker-ring (copy-marker orig))
1703 (let* ((line (car inferior-octave-output-list)) 1728 (inferior-octave-send-list-and-digest
1704 (file (when (and line (string-match "from the file \\(.*\\)$" line)) 1729 ;; help NAME is more verbose
1705 (match-string 1 line)))) 1730 (list (format "\
1706 (if (not file) 1731if iskeyword('%s') disp('`%s'' is a keyword') else which('%s') endif\n"
1707 (user-error "%s" (or line (format "`%s' not found" fn))) 1732 fn fn fn)))
1708 (require 'etags) 1733 (let (line file)
1709 (ring-insert find-tag-marker-ring (point-marker)) 1734 ;; Skip garbage lines such as
1710 (setq file (funcall octave-find-definition-filename-function file)) 1735 ;; warning: fmincg.m: possible Matlab-style ....
1711 (when file 1736 (while (and (not file) (consp inferior-octave-output-list))
1712 (find-file file) 1737 (setq line (pop inferior-octave-output-list))
1713 (octave-goto-function-definition fn))))) 1738 (when (string-match "from the file \\(.*\\)$" line)
1714 1739 (setq file (match-string 1 line))))
1740 (if (not file)
1741 (user-error "%s" (or line (format "`%s' not found" fn)))
1742 (ring-insert find-tag-marker-ring (point-marker))
1743 (setq file (funcall octave-find-definition-filename-function file))
1744 (when file
1745 (find-file file)
1746 (octave-goto-function-definition fn)))))))
1715 1747
1716(provide 'octave) 1748(provide 'octave)
1717;;; octave.el ends here 1749;;; octave.el ends here
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 01ac8584e19..1d5052bede4 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -158,44 +158,10 @@
158;; Regexps updated with help from Tom Tromey <tromey@cambric.colorado.edu> and 158;; Regexps updated with help from Tom Tromey <tromey@cambric.colorado.edu> and
159;; Jim Campbell <jec@murzim.ca.boeing.com>. 159;; Jim Campbell <jec@murzim.ca.boeing.com>.
160 160
161(defcustom perl-prettify-symbols t
162 "If non-nil, some symbols will be displayed using Unicode chars."
163 :version "24.4"
164 :type 'boolean)
165
166(defconst perl--prettify-symbols-alist 161(defconst perl--prettify-symbols-alist
167 '(;;("andalso" . ?∧) ("orelse" . ?∨) ("as" . ?≡)("not" . ?¬) 162 '(("->" . ?→)
168 ;;("div" . ?Ă·) ("*" . ?Ă—) ("o" . ?â—‹)
169 ("->" . ?→)
170 ("=>" . ?⇒) 163 ("=>" . ?⇒)
171 ;;("<-" . ?â†) ("<>" . ?≠) (">=" . ?≥) ("<=" . ?≤) ("..." . ?⋯) 164 ("::" . ?∷)))
172 ("::" . ?∷)
173 ))
174
175(defun perl--font-lock-compose-symbol ()
176 "Compose a sequence of ascii chars into a symbol.
177Regexp match data 0 points to the chars."
178 ;; Check that the chars should really be composed into a symbol.
179 (let* ((start (match-beginning 0))
180 (end (match-end 0))
181 (syntaxes (if (eq (char-syntax (char-after start)) ?w)
182 '(?w) '(?. ?\\))))
183 (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
184 (memq (char-syntax (or (char-after end) ?\ )) syntaxes)
185 (nth 8 (syntax-ppss)))
186 ;; No composition for you. Let's actually remove any composition
187 ;; we may have added earlier and which is now incorrect.
188 (remove-text-properties start end '(composition))
189 ;; That's a symbol alright, so add the composition.
190 (compose-region start end (cdr (assoc (match-string 0)
191 perl--prettify-symbols-alist)))))
192 ;; Return nil because we're not adding any face property.
193 nil)
194
195(defun perl--font-lock-symbols-keywords ()
196 (when perl-prettify-symbols
197 `((,(regexp-opt (mapcar 'car perl--prettify-symbols-alist) t)
198 (0 (perl--font-lock-compose-symbol))))))
199 165
200(defconst perl-font-lock-keywords-1 166(defconst perl-font-lock-keywords-1
201 '(;; What is this for? 167 '(;; What is this for?
@@ -243,8 +209,7 @@ Regexp match data 0 points to the chars."
243 ;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'. 209 ;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'.
244 ("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?" 210 ("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?"
245 (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) 211 (1 font-lock-keyword-face) (2 font-lock-constant-face nil t))
246 ("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face) 212 ("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face)))
247 ,@(perl--font-lock-symbols-keywords)))
248 "Gaudy level highlighting for Perl mode.") 213 "Gaudy level highlighting for Perl mode.")
249 214
250(defvar perl-font-lock-keywords perl-font-lock-keywords-1 215(defvar perl-font-lock-keywords perl-font-lock-keywords-1
@@ -685,13 +650,15 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
685 (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *") 650 (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
686 (setq-local comment-indent-function #'perl-comment-indent) 651 (setq-local comment-indent-function #'perl-comment-indent)
687 (setq-local parse-sexp-ignore-comments t) 652 (setq-local parse-sexp-ignore-comments t)
653
688 ;; Tell font-lock.el how to handle Perl. 654 ;; Tell font-lock.el how to handle Perl.
689 (setq font-lock-defaults '((perl-font-lock-keywords 655 (setq font-lock-defaults '((perl-font-lock-keywords
690 perl-font-lock-keywords-1 656 perl-font-lock-keywords-1
691 perl-font-lock-keywords-2) 657 perl-font-lock-keywords-2)
692 nil nil ((?\_ . "w")) nil 658 nil nil ((?\_ . "w")) nil
693 (font-lock-syntactic-face-function 659 (font-lock-syntactic-face-function
694 . perl-font-lock-syntactic-face-function))) 660 . perl-font-lock-syntactic-face-function)))
661 (prog-prettify-install perl--prettify-symbols-alist)
695 (setq-local syntax-propertize-function #'perl-syntax-propertize-function) 662 (setq-local syntax-propertize-function #'perl-syntax-propertize-function)
696 (add-hook 'syntax-propertize-extend-region-functions 663 (add-hook 'syntax-propertize-extend-region-functions
697 #'syntax-propertize-multiline 'append 'local) 664 #'syntax-propertize-multiline 'append 'local)
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
new file mode 100644
index 00000000000..e2700414636
--- /dev/null
+++ b/lisp/progmodes/prog-mode.el
@@ -0,0 +1,119 @@
1;;; prog-mode.el --- Generic major mode for programming -*- lexical-binding: t -*-
2
3;; Copyright (C) 2013 Free Software Foundation, Inc.
4
5;; Maintainer: FSF
6;; Keywords: internal
7;; Package: emacs
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software: you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24;;; Commentary:
25
26;; This major mode is mostly intended as a parent of other programming
27;; modes. All major modes for programming languages should derive from this
28;; mode so that users can put generic customization on prog-mode-hook.
29
30;;; Code:
31
32(eval-when-compile (require 'cl-lib))
33
34(defgroup prog-mode nil
35 "Generic programming mode, from which others derive."
36 :group 'languages)
37
38(defvar prog-mode-map
39 (let ((map (make-sparse-keymap)))
40 (define-key map [?\C-\M-q] 'prog-indent-sexp)
41 map)
42 "Keymap used for programming modes.")
43
44(defun prog-indent-sexp (&optional defun)
45 "Indent the expression after point.
46When interactively called with prefix, indent the enclosing defun
47instead."
48 (interactive "P")
49 (save-excursion
50 (when defun
51 (end-of-line)
52 (beginning-of-defun))
53 (let ((start (point))
54 (end (progn (forward-sexp 1) (point))))
55 (indent-region start end nil))))
56
57(defvar prog-prettify-symbols-alist nil)
58
59(defcustom prog-prettify-symbols nil
60 "Whether symbols should be prettified.
61When set to an alist in the form `((STRING . CHARACTER)...)' it
62will augment the mode's native prettify alist."
63 :type '(choice
64 (const :tag "No thanks" nil)
65 (const :tag "Mode defaults" t)
66 (alist :tag "Mode defaults augmented with your own list"
67 :key-type string :value-type character))
68 :version "24.4")
69
70(defun prog--prettify-font-lock-compose-symbol (alist)
71 "Compose a sequence of ascii chars into a symbol.
72Regexp match data 0 points to the chars."
73 ;; Check that the chars should really be composed into a symbol.
74 (let* ((start (match-beginning 0))
75 (end (match-end 0))
76 (syntaxes (if (eq (char-syntax (char-after start)) ?w)
77 '(?w) '(?. ?\\))))
78 (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
79 (memq (char-syntax (or (char-after end) ?\ )) syntaxes)
80 (nth 8 (syntax-ppss)))
81 ;; No composition for you. Let's actually remove any composition
82 ;; we may have added earlier and which is now incorrect.
83 (remove-text-properties start end '(composition))
84 ;; That's a symbol alright, so add the composition.
85 (compose-region start end (cdr (assoc (match-string 0) alist)))))
86 ;; Return nil because we're not adding any face property.
87 nil)
88
89(defun prog-prettify-font-lock-symbols-keywords ()
90 (when prog-prettify-symbols
91 (let ((alist (append prog-prettify-symbols-alist
92 (if (listp prog-prettify-symbols)
93 prog-prettify-symbols
94 nil))))
95 `((,(regexp-opt (mapcar 'car alist) t)
96 (0 (prog--prettify-font-lock-compose-symbol ',alist)))))))
97
98(defun prog-prettify-install (alist)
99"Install prog-mode support to prettify symbols according to ALIST.
100
101ALIST is in the format `((STRING . CHARACTER)...)' like
102`prog-prettify-symbols'.
103
104Internally, `font-lock-add-keywords' is called."
105 (setq-local prog-prettify-symbols-alist alist)
106 (let ((keywords (prog-prettify-font-lock-symbols-keywords)))
107 (if keywords (font-lock-add-keywords nil keywords))))
108
109;;;###autoload
110(define-derived-mode prog-mode fundamental-mode "Prog"
111 "Major mode for editing programming language source code."
112 (set (make-local-variable 'require-final-newline) mode-require-final-newline)
113 (set (make-local-variable 'parse-sexp-ignore-comments) t)
114 ;; Any programming language is always written left to right.
115 (setq bidi-paragraph-direction 'left-to-right))
116
117(provide 'prog-mode)
118
119;;; prog-mode.el ends here
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 63bd9258d69..0f3c1504ee9 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1149,11 +1149,7 @@ VERSION is of the format (Major . Minor)"
1149 (set (make-local-variable 'comment-start) "%") 1149 (set (make-local-variable 'comment-start) "%")
1150 (set (make-local-variable 'comment-end) "") 1150 (set (make-local-variable 'comment-end) "")
1151 (set (make-local-variable 'comment-add) 1) 1151 (set (make-local-variable 'comment-add) 1)
1152 (set (make-local-variable 'comment-start-skip) 1152 (set (make-local-variable 'comment-start-skip) "\\(?:/\\*+ *\\|%%+ *\\)")
1153 ;; This complex regexp makes sure that comments cannot start
1154 ;; inside quoted atoms or strings
1155 (format "^\\(\\(%s\\|%s\\|[^\n\'\"%%]\\)*\\)\\(/\\*+ *\\|%%+ *\\)"
1156 prolog-quoted-atom-regexp prolog-string-regexp))
1157 (set (make-local-variable 'parens-require-spaces) nil) 1153 (set (make-local-variable 'parens-require-spaces) nil)
1158 ;; Initialize Prolog system specific variables 1154 ;; Initialize Prolog system specific variables
1159 (dolist (var '(prolog-keywords prolog-types prolog-mode-specificators 1155 (dolist (var '(prolog-keywords prolog-types prolog-mode-specificators
@@ -1739,8 +1735,7 @@ This function must be called from the source code buffer."
1739 (real-file buffer-file-name) 1735 (real-file buffer-file-name)
1740 (command-string (prolog-build-prolog-command compilep file 1736 (command-string (prolog-build-prolog-command compilep file
1741 real-file first-line)) 1737 real-file first-line))
1742 (process (get-process "prolog")) 1738 (process (get-process "prolog")))
1743 (old-filter (process-filter process)))
1744 (with-current-buffer buffer 1739 (with-current-buffer buffer
1745 (delete-region (point-min) (point-max)) 1740 (delete-region (point-min) (point-max))
1746 ;; FIXME: Wasn't this supposed to use prolog-inferior-mode? 1741 ;; FIXME: Wasn't this supposed to use prolog-inferior-mode?
@@ -1759,8 +1754,7 @@ This function must be called from the source code buffer."
1759 'prolog-parse-sicstus-compilation-errors)) 1754 'prolog-parse-sicstus-compilation-errors))
1760 (setq buffer-read-only nil) 1755 (setq buffer-read-only nil)
1761 (insert command-string "\n")) 1756 (insert command-string "\n"))
1762 (save-selected-window 1757 (display-buffer buffer)
1763 (pop-to-buffer buffer))
1764 (setq prolog-process-flag t 1758 (setq prolog-process-flag t
1765 prolog-consult-compile-output "" 1759 prolog-consult-compile-output ""
1766 prolog-consult-compile-first-line (if first-line (1- first-line) 0) 1760 prolog-consult-compile-first-line (if first-line (1- first-line) 0)
@@ -1954,20 +1948,6 @@ If COMPILEP is non-nil, compile, otherwise consult."
1954;;------------------------------------------------------------------- 1948;;-------------------------------------------------------------------
1955 1949
1956;; Auxiliary functions 1950;; Auxiliary functions
1957(defun prolog-make-keywords-regexp (keywords &optional protect)
1958 "Create regexp from the list of strings KEYWORDS.
1959If PROTECT is non-nil, surround the result regexp by word breaks."
1960 (let ((regexp
1961 (if (fboundp 'regexp-opt)
1962 ;; Emacs 20
1963 ;; Avoid compile warnings under earlier versions by using eval
1964 (eval '(regexp-opt keywords))
1965 ;; Older Emacsen
1966 (concat (mapconcat 'regexp-quote keywords "\\|")))
1967 ))
1968 (if protect
1969 (concat "\\<\\(" regexp "\\)\\>")
1970 regexp)))
1971 1951
1972(defun prolog-font-lock-object-matcher (bound) 1952(defun prolog-font-lock-object-matcher (bound)
1973 "Find SICStus objects method name for font lock. 1953 "Find SICStus objects method name for font lock.
@@ -2084,20 +2064,16 @@ Argument BOUND is a buffer position limiting searching."
2084 (if (eq prolog-system 'mercury) 2064 (if (eq prolog-system 'mercury)
2085 (concat 2065 (concat
2086 "\\<\\(" 2066 "\\<\\("
2087 (prolog-make-keywords-regexp prolog-keywords-i) 2067 (regexp-opt prolog-keywords-i)
2088 "\\|" 2068 "\\|"
2089 (prolog-make-keywords-regexp 2069 (regexp-opt
2090 prolog-determinism-specificators-i) 2070 prolog-determinism-specificators-i)
2091 "\\)\\>") 2071 "\\)\\>")
2092 (concat 2072 (concat
2093 "^[?:]- *\\(" 2073 "^[?:]- *\\("
2094 (prolog-make-keywords-regexp prolog-keywords-i) 2074 (regexp-opt prolog-keywords-i)
2095 "\\)\\>")) 2075 "\\)\\>"))
2096 1 prolog-builtin-face)) 2076 1 prolog-builtin-face))
2097 (quoted_atom (list prolog-quoted-atom-regexp
2098 2 'font-lock-string-face 'append))
2099 (string (list prolog-string-regexp
2100 1 'font-lock-string-face 'append))
2101 ;; SICStus specific patterns 2077 ;; SICStus specific patterns
2102 (sicstus-object-methods 2078 (sicstus-object-methods
2103 (if (eq prolog-system 'sicstus) 2079 (if (eq prolog-system 'sicstus)
@@ -2107,17 +2083,17 @@ Argument BOUND is a buffer position limiting searching."
2107 (types 2083 (types
2108 (if (eq prolog-system 'mercury) 2084 (if (eq prolog-system 'mercury)
2109 (list 2085 (list
2110 (prolog-make-keywords-regexp prolog-types-i t) 2086 (regexp-opt prolog-types-i 'words)
2111 0 'font-lock-type-face))) 2087 0 'font-lock-type-face)))
2112 (modes 2088 (modes
2113 (if (eq prolog-system 'mercury) 2089 (if (eq prolog-system 'mercury)
2114 (list 2090 (list
2115 (prolog-make-keywords-regexp prolog-mode-specificators-i t) 2091 (regexp-opt prolog-mode-specificators-i 'words)
2116 0 'font-lock-constant-face))) 2092 0 'font-lock-constant-face)))
2117 (directives 2093 (directives
2118 (if (eq prolog-system 'mercury) 2094 (if (eq prolog-system 'mercury)
2119 (list 2095 (list
2120 (prolog-make-keywords-regexp prolog-directives-i t) 2096 (regexp-opt prolog-directives-i 'words)
2121 0 'prolog-warning-face))) 2097 0 'prolog-warning-face)))
2122 ;; Inferior mode specific patterns 2098 ;; Inferior mode specific patterns
2123 (prompt 2099 (prompt
@@ -2211,8 +2187,6 @@ Argument BOUND is a buffer position limiting searching."
2211 (list 2187 (list
2212 head-predicates 2188 head-predicates
2213 head-predicates-1 2189 head-predicates-1
2214 quoted_atom
2215 string
2216 variables 2190 variables
2217 important-elements 2191 important-elements
2218 important-elements-1 2192 important-elements-1
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 641563ae0ab..ccb2dcba42e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -157,7 +157,7 @@
157 157
158;; Skeletons: 6 skeletons are provided for simple inserting of class, 158;; Skeletons: 6 skeletons are provided for simple inserting of class,
159;; def, for, if, try and while. These skeletons are integrated with 159;; def, for, if, try and while. These skeletons are integrated with
160;; dabbrev. If you have `dabbrev-mode' activated and 160;; abbrev. If you have `abbrev-mode' activated and
161;; `python-skeleton-autoinsert' is set to t, then whenever you type 161;; `python-skeleton-autoinsert' is set to t, then whenever you type
162;; the name of any of those defined and hit SPC, they will be 162;; the name of any of those defined and hit SPC, they will be
163;; automatically expanded. As an alternative you can use the defined 163;; automatically expanded. As an alternative you can use the defined
@@ -642,7 +642,8 @@ It makes underscores and dots word constituent chars.")
642These make `python-indent-calculate-indentation' subtract the value of 642These make `python-indent-calculate-indentation' subtract the value of
643`python-indent-offset'.") 643`python-indent-offset'.")
644 644
645(defvar python-indent-block-enders '("return" "pass") 645(defvar python-indent-block-enders
646 '("break" "continue" "pass" "raise" "return")
646 "List of words that mark the end of a block. 647 "List of words that mark the end of a block.
647These make `python-indent-calculate-indentation' subtract the 648These make `python-indent-calculate-indentation' subtract the
648value of `python-indent-offset' when `python-indent-context' is 649value of `python-indent-offset' when `python-indent-context' is
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index a96ee64a229..fa4efe49b7b 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1349,6 +1349,7 @@ If the result is do-end block, it will always be multiline."
1349(declare-function ruby-syntax-propertize-percent-literal "ruby-mode" (limit)) 1349(declare-function ruby-syntax-propertize-percent-literal "ruby-mode" (limit))
1350;; Unusual code layout confuses the byte-compiler. 1350;; Unusual code layout confuses the byte-compiler.
1351(declare-function ruby-syntax-propertize-expansion "ruby-mode" ()) 1351(declare-function ruby-syntax-propertize-expansion "ruby-mode" ())
1352(declare-function ruby-syntax-expansion-allowed-p "ruby-mode" (parse-state))
1352 1353
1353(if (eval-when-compile (fboundp #'syntax-propertize-rules)) 1354(if (eval-when-compile (fboundp #'syntax-propertize-rules))
1354 ;; New code that works independently from font-lock. 1355 ;; New code that works independently from font-lock.
@@ -1380,51 +1381,52 @@ It will be properly highlighted even when the call omits parens.")
1380 1381
1381 (defun ruby-syntax-propertize-function (start end) 1382 (defun ruby-syntax-propertize-function (start end)
1382 "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." 1383 "Syntactic keywords for Ruby mode. See `syntax-propertize-function'."
1383 (goto-char start) 1384 (let (case-fold-search)
1384 (remove-text-properties start end '(ruby-expansion-match-data)) 1385 (goto-char start)
1385 (ruby-syntax-propertize-heredoc end) 1386 (remove-text-properties start end '(ruby-expansion-match-data))
1386 (ruby-syntax-enclosing-percent-literal end) 1387 (ruby-syntax-propertize-heredoc end)
1387 (funcall 1388 (ruby-syntax-enclosing-percent-literal end)
1388 (syntax-propertize-rules 1389 (funcall
1389 ;; $' $" $` .... are variables. 1390 (syntax-propertize-rules
1390 ;; ?' ?" ?` are ascii codes. 1391 ;; $' $" $` .... are variables.
1391 ("\\([?$]\\)[#\"'`]" 1392 ;; ?' ?" ?` are ascii codes.
1392 (1 (unless (save-excursion 1393 ("\\([?$]\\)[#\"'`]"
1393 ;; Not within a string. 1394 (1 (unless (save-excursion
1394 (nth 3 (syntax-ppss (match-beginning 0)))) 1395 ;; Not within a string.
1395 (string-to-syntax "\\")))) 1396 (nth 3 (syntax-ppss (match-beginning 0))))
1396 ;; Regular expressions. Start with matching unescaped slash. 1397 (string-to-syntax "\\"))))
1397 ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" 1398 ;; Regular expressions. Start with matching unescaped slash.
1398 (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) 1399 ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)"
1399 (when (or 1400 (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1)))))
1400 ;; Beginning of a regexp. 1401 (when (or
1401 (and (null (nth 8 state)) 1402 ;; Beginning of a regexp.
1402 (save-excursion 1403 (and (null (nth 8 state))
1403 (forward-char -1) 1404 (save-excursion
1404 (looking-back ruby-syntax-before-regexp-re 1405 (forward-char -1)
1405 (point-at-bol)))) 1406 (looking-back ruby-syntax-before-regexp-re
1406 ;; End of regexp. We don't match the whole 1407 (point-at-bol))))
1407 ;; regexp at once because it can have 1408 ;; End of regexp. We don't match the whole
1408 ;; string interpolation inside, or span 1409 ;; regexp at once because it can have
1409 ;; several lines. 1410 ;; string interpolation inside, or span
1410 (eq ?/ (nth 3 state))) 1411 ;; several lines.
1411 (string-to-syntax "\"/"))))) 1412 (eq ?/ (nth 3 state)))
1412 ;; Expression expansions in strings. We're handling them 1413 (string-to-syntax "\"/")))))
1413 ;; here, so that the regexp rule never matches inside them. 1414 ;; Expression expansions in strings. We're handling them
1414 (ruby-expression-expansion-re 1415 ;; here, so that the regexp rule never matches inside them.
1415 (0 (ignore (ruby-syntax-propertize-expansion)))) 1416 (ruby-expression-expansion-re
1416 ("^=en\\(d\\)\\_>" (1 "!")) 1417 (0 (ignore (ruby-syntax-propertize-expansion))))
1417 ("^\\(=\\)begin\\_>" (1 "!")) 1418 ("^=en\\(d\\)\\_>" (1 "!"))
1418 ;; Handle here documents. 1419 ("^\\(=\\)begin\\_>" (1 "!"))
1419 ((concat ruby-here-doc-beg-re ".*\\(\n\\)") 1420 ;; Handle here documents.
1420 (7 (unless (ruby-singleton-class-p (match-beginning 0)) 1421 ((concat ruby-here-doc-beg-re ".*\\(\n\\)")
1421 (put-text-property (match-beginning 7) (match-end 7) 1422 (7 (unless (ruby-singleton-class-p (match-beginning 0))
1422 'syntax-table (string-to-syntax "\"")) 1423 (put-text-property (match-beginning 7) (match-end 7)
1423 (ruby-syntax-propertize-heredoc end)))) 1424 'syntax-table (string-to-syntax "\""))
1424 ;; Handle percent literals: %w(), %q{}, etc. 1425 (ruby-syntax-propertize-heredoc end))))
1425 ((concat "\\(?:^\\|[[ \t\n<+(,=]\\)" ruby-percent-literal-beg-re) 1426 ;; Handle percent literals: %w(), %q{}, etc.
1426 (1 (prog1 "|" (ruby-syntax-propertize-percent-literal end))))) 1427 ((concat "\\(?:^\\|[[ \t\n<+(,=]\\)" ruby-percent-literal-beg-re)
1427 (point) end)) 1428 (1 (prog1 "|" (ruby-syntax-propertize-percent-literal end)))))
1429 (point) end)))
1428 1430
1429 (defun ruby-syntax-propertize-heredoc (limit) 1431 (defun ruby-syntax-propertize-heredoc (limit)
1430 (let ((ppss (syntax-ppss)) 1432 (let ((ppss (syntax-ppss))
@@ -1496,9 +1498,10 @@ It will be properly highlighted even when the call omits parens.")
1496 (defun ruby-syntax-propertize-expansion () 1498 (defun ruby-syntax-propertize-expansion ()
1497 ;; Save the match data to a text property, for font-locking later. 1499 ;; Save the match data to a text property, for font-locking later.
1498 ;; Set the syntax of all double quotes and backticks to punctuation. 1500 ;; Set the syntax of all double quotes and backticks to punctuation.
1499 (let ((beg (match-beginning 2)) 1501 (let* ((beg (match-beginning 2))
1500 (end (match-end 2))) 1502 (end (match-end 2))
1501 (when (and beg (save-excursion (nth 3 (syntax-ppss beg)))) 1503 (state (and beg (save-excursion (syntax-ppss beg)))))
1504 (when (ruby-syntax-expansion-allowed-p state)
1502 (put-text-property beg (1+ beg) 'ruby-expansion-match-data 1505 (put-text-property beg (1+ beg) 'ruby-expansion-match-data
1503 (match-data)) 1506 (match-data))
1504 (goto-char beg) 1507 (goto-char beg)
@@ -1506,6 +1509,17 @@ It will be properly highlighted even when the call omits parens.")
1506 (put-text-property (match-beginning 0) (match-end 0) 1509 (put-text-property (match-beginning 0) (match-end 0)
1507 'syntax-table (string-to-syntax ".")))))) 1510 'syntax-table (string-to-syntax "."))))))
1508 1511
1512 (defun ruby-syntax-expansion-allowed-p (parse-state)
1513 "Return non-nil if expression expansion is allowed."
1514 (let ((term (nth 3 parse-state)))
1515 (cond
1516 ((memq term '(?\" ?` ?\n ?/)))
1517 ((eq term t)
1518 (save-match-data
1519 (save-excursion
1520 (goto-char (nth 8 parse-state))
1521 (looking-at "%\\(?:[QWrx]\\|\\W\\)")))))))
1522
1509 (defun ruby-syntax-propertize-expansions (start end) 1523 (defun ruby-syntax-propertize-expansions (start end)
1510 (save-excursion 1524 (save-excursion
1511 (goto-char start) 1525 (goto-char start)
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index 9169a433015..3e91aeba9a1 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -266,7 +266,7 @@ quoted for Tcl."
266 ;; Maybe someone has a better set? 266 ;; Maybe someone has a better set?
267 (let ((map (make-sparse-keymap))) 267 (let ((map (make-sparse-keymap)))
268 ;; Will inherit from `comint-mode-map' thanks to define-derived-mode. 268 ;; Will inherit from `comint-mode-map' thanks to define-derived-mode.
269 (define-key map "\t" 'comint-dynamic-complete) 269 (define-key map "\t" 'completion-at-point)
270 (define-key map "\M-?" 'comint-dynamic-list-filename-completions) 270 (define-key map "\M-?" 'comint-dynamic-list-filename-completions)
271 (define-key map "\177" 'backward-delete-char-untabify) 271 (define-key map "\177" 'backward-delete-char-untabify)
272 (define-key map "\M-\C-x" 'tcl-eval-defun) 272 (define-key map "\M-\C-x" 'tcl-eval-defun)
diff --git a/lisp/replace.el b/lisp/replace.el
index 86956a614cd..24cfccf60fd 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -246,10 +246,14 @@ Matching is independent of case if `case-fold-search' is non-nil and
246FROM-STRING has no uppercase letters. Replacement transfers the case 246FROM-STRING has no uppercase letters. Replacement transfers the case
247pattern of the old text to the new text, if `case-replace' and 247pattern of the old text to the new text, if `case-replace' and
248`case-fold-search' are non-nil and FROM-STRING has no uppercase 248`case-fold-search' are non-nil and FROM-STRING has no uppercase
249letters. \(Transferring the case pattern means that if the old text 249letters. (Transferring the case pattern means that if the old text
250matched is all caps, or capitalized, then its replacement is upcased 250matched is all caps, or capitalized, then its replacement is upcased
251or capitalized.) 251or capitalized.)
252 252
253Ignore read-only matches if `query-replace-skip-read-only' is non-nil,
254ignore hidden matches if `search-invisible' is nil, and ignore more
255matches using a non-nil `isearch-filter-predicates'.
256
253If `replace-lax-whitespace' is non-nil, a space or spaces in the string 257If `replace-lax-whitespace' is non-nil, a space or spaces in the string
254to be replaced will match a sequence of whitespace chars defined by the 258to be replaced will match a sequence of whitespace chars defined by the
255regexp in `search-whitespace-regexp'. 259regexp in `search-whitespace-regexp'.
@@ -300,6 +304,10 @@ pattern of the old text to the new text, if `case-replace' and
300all caps, or capitalized, then its replacement is upcased or 304all caps, or capitalized, then its replacement is upcased or
301capitalized.) 305capitalized.)
302 306
307Ignore read-only matches if `query-replace-skip-read-only' is non-nil,
308ignore hidden matches if `search-invisible' is nil, and ignore more
309matches using a non-nil `isearch-filter-predicates'.
310
303If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp 311If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp
304to be replaced will match a sequence of whitespace chars defined by the 312to be replaced will match a sequence of whitespace chars defined by the
305regexp in `search-whitespace-regexp'. 313regexp in `search-whitespace-regexp'.
@@ -380,6 +388,10 @@ that reads REGEXP.
380Preserves case in each replacement if `case-replace' and `case-fold-search' 388Preserves case in each replacement if `case-replace' and `case-fold-search'
381are non-nil and REGEXP has no uppercase letters. 389are non-nil and REGEXP has no uppercase letters.
382 390
391Ignore read-only matches if `query-replace-skip-read-only' is non-nil,
392ignore hidden matches if `search-invisible' is nil, and ignore more
393matches using a non-nil `isearch-filter-predicates'.
394
383If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp 395If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp
384to be replaced will match a sequence of whitespace chars defined by the 396to be replaced will match a sequence of whitespace chars defined by the
385regexp in `search-whitespace-regexp'. 397regexp in `search-whitespace-regexp'.
@@ -470,6 +482,10 @@ are non-nil and FROM-STRING has no uppercase letters.
470\(Preserving case means that if the string matched is all caps, or capitalized, 482\(Preserving case means that if the string matched is all caps, or capitalized,
471then its replacement is upcased or capitalized.) 483then its replacement is upcased or capitalized.)
472 484
485Ignore read-only matches if `query-replace-skip-read-only' is non-nil,
486ignore hidden matches if `search-invisible' is nil, and ignore more
487matches using a non-nil `isearch-filter-predicates'.
488
473If `replace-lax-whitespace' is non-nil, a space or spaces in the string 489If `replace-lax-whitespace' is non-nil, a space or spaces in the string
474to be replaced will match a sequence of whitespace chars defined by the 490to be replaced will match a sequence of whitespace chars defined by the
475regexp in `search-whitespace-regexp'. 491regexp in `search-whitespace-regexp'.
@@ -512,6 +528,10 @@ and TO-STRING is also null.)"
512Preserve case in each match if `case-replace' and `case-fold-search' 528Preserve case in each match if `case-replace' and `case-fold-search'
513are non-nil and REGEXP has no uppercase letters. 529are non-nil and REGEXP has no uppercase letters.
514 530
531Ignore read-only matches if `query-replace-skip-read-only' is non-nil,
532ignore hidden matches if `search-invisible' is nil, and ignore more
533matches using a non-nil `isearch-filter-predicates'.
534
515If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp 535If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp
516to be replaced will match a sequence of whitespace chars defined by the 536to be replaced will match a sequence of whitespace chars defined by the
517regexp in `search-whitespace-regexp'. 537regexp in `search-whitespace-regexp'.
@@ -1155,8 +1175,8 @@ is called only during interactive use.
1155 1175
1156For example, to check for occurrence of symbol at point use 1176For example, to check for occurrence of symbol at point use
1157 1177
1158 \(setq occur-read-regexp-defaults-function 1178 (setq occur-read-regexp-defaults-function
1159 'find-tag-default-as-regexp\).") 1179 'find-tag-default-as-regexp).")
1160 1180
1161(defun occur-read-regexp-defaults () 1181(defun occur-read-regexp-defaults ()
1162 "Return the latest regexp from `regexp-history'. 1182 "Return the latest regexp from `regexp-history'.
@@ -1369,16 +1389,18 @@ See also `multi-occur'."
1369(defun occur-engine (regexp buffers out-buf nlines case-fold 1389(defun occur-engine (regexp buffers out-buf nlines case-fold
1370 title-face prefix-face match-face keep-props) 1390 title-face prefix-face match-face keep-props)
1371 (with-current-buffer out-buf 1391 (with-current-buffer out-buf
1372 (let ((globalcount 0) 1392 (let ((global-lines 0) ;; total count of matching lines
1393 (global-matches 0) ;; total count of matches
1373 (coding nil) 1394 (coding nil)
1374 (case-fold-search case-fold)) 1395 (case-fold-search case-fold))
1375 ;; Map over all the buffers 1396 ;; Map over all the buffers
1376 (dolist (buf buffers) 1397 (dolist (buf buffers)
1377 (when (buffer-live-p buf) 1398 (when (buffer-live-p buf)
1378 (let ((matches 0) ;; count of matched lines 1399 (let ((lines 0) ;; count of matching lines
1379 (lines 1) ;; line count 1400 (matches 0) ;; count of matches
1380 (prev-after-lines nil) ;; context lines of prev match 1401 (curr-line 1) ;; line count
1381 (prev-lines nil) ;; line number of prev match endpt 1402 (prev-line nil) ;; line number of prev match endpt
1403 (prev-after-lines nil) ;; context lines of prev match
1382 (matchbeg 0) 1404 (matchbeg 0)
1383 (origpt nil) 1405 (origpt nil)
1384 (begpt nil) 1406 (begpt nil)
@@ -1399,7 +1421,7 @@ See also `multi-occur'."
1399 (while (not (eobp)) 1421 (while (not (eobp))
1400 (setq origpt (point)) 1422 (setq origpt (point))
1401 (when (setq endpt (re-search-forward regexp nil t)) 1423 (when (setq endpt (re-search-forward regexp nil t))
1402 (setq matches (1+ matches)) ;; increment match count 1424 (setq lines (1+ lines)) ;; increment matching lines count
1403 (setq matchbeg (match-beginning 0)) 1425 (setq matchbeg (match-beginning 0))
1404 ;; Get beginning of first match line and end of the last. 1426 ;; Get beginning of first match line and end of the last.
1405 (save-excursion 1427 (save-excursion
@@ -1408,7 +1430,7 @@ See also `multi-occur'."
1408 (goto-char endpt) 1430 (goto-char endpt)
1409 (setq endpt (line-end-position))) 1431 (setq endpt (line-end-position)))
1410 ;; Sum line numbers up to the first match line. 1432 ;; Sum line numbers up to the first match line.
1411 (setq lines (+ lines (count-lines origpt begpt))) 1433 (setq curr-line (+ curr-line (count-lines origpt begpt)))
1412 (setq marker (make-marker)) 1434 (setq marker (make-marker))
1413 (set-marker marker matchbeg) 1435 (set-marker marker matchbeg)
1414 (setq curstring (occur-engine-line begpt endpt keep-props)) 1436 (setq curstring (occur-engine-line begpt endpt keep-props))
@@ -1417,6 +1439,7 @@ See also `multi-occur'."
1417 (start 0)) 1439 (start 0))
1418 (while (and (< start len) 1440 (while (and (< start len)
1419 (string-match regexp curstring start)) 1441 (string-match regexp curstring start))
1442 (setq matches (1+ matches))
1420 (add-text-properties 1443 (add-text-properties
1421 (match-beginning 0) (match-end 0) 1444 (match-beginning 0) (match-end 0)
1422 (append 1445 (append
@@ -1430,7 +1453,7 @@ See also `multi-occur'."
1430 ;; Generate the string to insert for this match 1453 ;; Generate the string to insert for this match
1431 (let* ((match-prefix 1454 (let* ((match-prefix
1432 ;; Using 7 digits aligns tabs properly. 1455 ;; Using 7 digits aligns tabs properly.
1433 (apply #'propertize (format "%7d:" lines) 1456 (apply #'propertize (format "%7d:" curr-line)
1434 (append 1457 (append
1435 (when prefix-face 1458 (when prefix-face
1436 `(font-lock-face ,prefix-face)) 1459 `(font-lock-face ,prefix-face))
@@ -1470,7 +1493,7 @@ See also `multi-occur'."
1470 ;; The complex multi-line display style. 1493 ;; The complex multi-line display style.
1471 (setq ret (occur-context-lines 1494 (setq ret (occur-context-lines
1472 out-line nlines keep-props begpt endpt 1495 out-line nlines keep-props begpt endpt
1473 lines prev-lines prev-after-lines 1496 curr-line prev-line prev-after-lines
1474 prefix-face)) 1497 prefix-face))
1475 ;; Set first elem of the returned list to `data', 1498 ;; Set first elem of the returned list to `data',
1476 ;; and the second elem to `prev-after-lines'. 1499 ;; and the second elem to `prev-after-lines'.
@@ -1483,28 +1506,34 @@ See also `multi-occur'."
1483 (if endpt 1506 (if endpt
1484 (progn 1507 (progn
1485 ;; Sum line numbers between first and last match lines. 1508 ;; Sum line numbers between first and last match lines.
1486 (setq lines (+ lines (count-lines begpt endpt) 1509 (setq curr-line (+ curr-line (count-lines begpt endpt)
1487 ;; Add 1 for empty last match line since 1510 ;; Add 1 for empty last match line since
1488 ;; count-lines returns 1 line less. 1511 ;; count-lines returns 1 line less.
1489 (if (and (bolp) (eolp)) 1 0))) 1512 (if (and (bolp) (eolp)) 1 0)))
1490 ;; On to the next match... 1513 ;; On to the next match...
1491 (forward-line 1)) 1514 (forward-line 1))
1492 (goto-char (point-max))) 1515 (goto-char (point-max)))
1493 (setq prev-lines (1- lines))) 1516 (setq prev-line (1- curr-line)))
1494 ;; Flush remaining context after-lines. 1517 ;; Flush remaining context after-lines.
1495 (when prev-after-lines 1518 (when prev-after-lines
1496 (with-current-buffer out-buf 1519 (with-current-buffer out-buf
1497 (insert (apply #'concat (occur-engine-add-prefix 1520 (insert (apply #'concat (occur-engine-add-prefix
1498 prev-after-lines prefix-face))))))) 1521 prev-after-lines prefix-face)))))))
1499 (when (not (zerop matches)) ;; is the count zero? 1522 (when (not (zerop lines)) ;; is the count zero?
1500 (setq globalcount (+ globalcount matches)) 1523 (setq global-lines (+ global-lines lines)
1524 global-matches (+ global-matches matches))
1501 (with-current-buffer out-buf 1525 (with-current-buffer out-buf
1502 (goto-char headerpt) 1526 (goto-char headerpt)
1503 (let ((beg (point)) 1527 (let ((beg (point))
1504 end) 1528 end)
1505 (insert (propertize 1529 (insert (propertize
1506 (format "%d match%s%s in buffer: %s\n" 1530 (format "%d match%s%s%s in buffer: %s\n"
1507 matches (if (= matches 1) "" "es") 1531 matches (if (= matches 1) "" "es")
1532 ;; Don't display the same number of lines
1533 ;; and matches in case of 1 match per line.
1534 (if (= lines matches)
1535 "" (format " in %d line%s"
1536 lines (if (= lines 1) "" "s")))
1508 ;; Don't display regexp for multi-buffer. 1537 ;; Don't display regexp for multi-buffer.
1509 (if (> (length buffers) 1) 1538 (if (> (length buffers) 1)
1510 "" (format " for \"%s\"" 1539 "" (format " for \"%s\""
@@ -1519,12 +1548,17 @@ See also `multi-occur'."
1519 `(occur-title ,buf)))) 1548 `(occur-title ,buf))))
1520 (goto-char (point-min))))))) 1549 (goto-char (point-min)))))))
1521 ;; Display total match count and regexp for multi-buffer. 1550 ;; Display total match count and regexp for multi-buffer.
1522 (when (and (not (zerop globalcount)) (> (length buffers) 1)) 1551 (when (and (not (zerop global-lines)) (> (length buffers) 1))
1523 (goto-char (point-min)) 1552 (goto-char (point-min))
1524 (let ((beg (point)) 1553 (let ((beg (point))
1525 end) 1554 end)
1526 (insert (format "%d match%s total for \"%s\":\n" 1555 (insert (format "%d match%s%s total for \"%s\":\n"
1527 globalcount (if (= globalcount 1) "" "es") 1556 global-matches (if (= global-matches 1) "" "es")
1557 ;; Don't display the same number of lines
1558 ;; and matches in case of 1 match per line.
1559 (if (= global-lines global-matches)
1560 "" (format " in %d line%s"
1561 global-lines (if (= global-lines 1) "" "s")))
1528 (query-replace-descr regexp))) 1562 (query-replace-descr regexp)))
1529 (setq end (point)) 1563 (setq end (point))
1530 (add-text-properties beg end (when title-face 1564 (add-text-properties beg end (when title-face
@@ -1536,7 +1570,7 @@ See also `multi-occur'."
1536 ;; buffer. 1570 ;; buffer.
1537 (set-buffer-file-coding-system coding)) 1571 (set-buffer-file-coding-system coding))
1538 ;; Return the number of matches 1572 ;; Return the number of matches
1539 globalcount))) 1573 global-matches)))
1540 1574
1541(defun occur-engine-line (beg end &optional keep-props) 1575(defun occur-engine-line (beg end &optional keep-props)
1542 (if (and keep-props (if (boundp 'jit-lock-mode) jit-lock-mode) 1576 (if (and keep-props (if (boundp 'jit-lock-mode) jit-lock-mode)
@@ -1579,13 +1613,13 @@ See also `multi-occur'."
1579;; Generate context display for occur. 1613;; Generate context display for occur.
1580;; OUT-LINE is the line where the match is. 1614;; OUT-LINE is the line where the match is.
1581;; NLINES and KEEP-PROPS are args to occur-engine. 1615;; NLINES and KEEP-PROPS are args to occur-engine.
1582;; LINES is line count of the current match, 1616;; CURR-LINE is line count of the current match,
1583;; PREV-LINES is line count of the previous match, 1617;; PREV-LINE is line count of the previous match,
1584;; PREV-AFTER-LINES is a list of after-context lines of the previous match. 1618;; PREV-AFTER-LINES is a list of after-context lines of the previous match.
1585;; Generate a list of lines, add prefixes to all but OUT-LINE, 1619;; Generate a list of lines, add prefixes to all but OUT-LINE,
1586;; then concatenate them all together. 1620;; then concatenate them all together.
1587(defun occur-context-lines (out-line nlines keep-props begpt endpt 1621(defun occur-context-lines (out-line nlines keep-props begpt endpt
1588 lines prev-lines prev-after-lines 1622 curr-line prev-line prev-after-lines
1589 &optional prefix-face) 1623 &optional prefix-face)
1590 ;; Find after- and before-context lines of the current match. 1624 ;; Find after- and before-context lines of the current match.
1591 (let ((before-lines 1625 (let ((before-lines
@@ -1601,22 +1635,22 @@ See also `multi-occur'."
1601 1635
1602 (when prev-after-lines 1636 (when prev-after-lines
1603 ;; Don't overlap prev after-lines with current before-lines. 1637 ;; Don't overlap prev after-lines with current before-lines.
1604 (if (>= (+ prev-lines (length prev-after-lines)) 1638 (if (>= (+ prev-line (length prev-after-lines))
1605 (- lines (length before-lines))) 1639 (- curr-line (length before-lines)))
1606 (setq prev-after-lines 1640 (setq prev-after-lines
1607 (butlast prev-after-lines 1641 (butlast prev-after-lines
1608 (- (length prev-after-lines) 1642 (- (length prev-after-lines)
1609 (- lines prev-lines (length before-lines) 1)))) 1643 (- curr-line prev-line (length before-lines) 1))))
1610 ;; Separate non-overlapping context lines with a dashed line. 1644 ;; Separate non-overlapping context lines with a dashed line.
1611 (setq separator "-------\n"))) 1645 (setq separator "-------\n")))
1612 1646
1613 (when prev-lines 1647 (when prev-line
1614 ;; Don't overlap current before-lines with previous match line. 1648 ;; Don't overlap current before-lines with previous match line.
1615 (if (<= (- lines (length before-lines)) 1649 (if (<= (- curr-line (length before-lines))
1616 prev-lines) 1650 prev-line)
1617 (setq before-lines 1651 (setq before-lines
1618 (nthcdr (- (length before-lines) 1652 (nthcdr (- (length before-lines)
1619 (- lines prev-lines 1)) 1653 (- curr-line prev-line 1))
1620 before-lines)) 1654 before-lines))
1621 ;; Separate non-overlapping before-context lines. 1655 ;; Separate non-overlapping before-context lines.
1622 (unless (> nlines 0) 1656 (unless (> nlines 0)
@@ -1840,7 +1874,7 @@ It is called with three arguments, as if it were
1840 1874
1841(defun replace-search (search-string limit regexp-flag delimited-flag 1875(defun replace-search (search-string limit regexp-flag delimited-flag
1842 case-fold-search) 1876 case-fold-search)
1843 "Search for the next occurence of SEARCH-STRING to replace." 1877 "Search for the next occurrence of SEARCH-STRING to replace."
1844 ;; Let-bind global isearch-* variables to values used 1878 ;; Let-bind global isearch-* variables to values used
1845 ;; to search the next replacement. These let-bindings 1879 ;; to search the next replacement. These let-bindings
1846 ;; should be effective both at the time of calling 1880 ;; should be effective both at the time of calling
@@ -1934,6 +1968,9 @@ make, or the user didn't cancel the call."
1934 (keep-going t) 1968 (keep-going t)
1935 (stack nil) 1969 (stack nil)
1936 (replace-count 0) 1970 (replace-count 0)
1971 (skip-read-only-count 0)
1972 (skip-filtered-count 0)
1973 (skip-invisible-count 0)
1937 (nonempty-match nil) 1974 (nonempty-match nil)
1938 (multi-buffer nil) 1975 (multi-buffer nil)
1939 (recenter-last-op nil) ; Start cycling order with initial position. 1976 (recenter-last-op nil) ; Start cycling order with initial position.
@@ -2042,20 +2079,27 @@ make, or the user didn't cancel the call."
2042 (and (/= (nth 0 match) (nth 1 match)) 2079 (and (/= (nth 0 match) (nth 1 match))
2043 match)))))) 2080 match))))))
2044 2081
2045 ;; Optionally ignore matches that have a read-only property. 2082 (cond
2046 (when (and (or (not query-replace-skip-read-only) 2083 ;; Optionally ignore matches that have a read-only property.
2047 (not (text-property-not-all 2084 ((not (or (not query-replace-skip-read-only)
2048 (nth 0 real-match-data) (nth 1 real-match-data) 2085 (not (text-property-not-all
2049 'read-only nil))) 2086 (nth 0 real-match-data) (nth 1 real-match-data)
2050 ;; Optionally filter out matches. 2087 'read-only nil))))
2051 (run-hook-with-args-until-failure 2088 (setq skip-read-only-count (1+ skip-read-only-count)))
2052 'isearch-filter-predicates 2089 ;; Optionally filter out matches.
2053 (nth 0 real-match-data) (nth 1 real-match-data)) 2090 ((not (run-hook-with-args-until-failure
2054 ;; Optionally ignore invisible matches. 2091 'isearch-filter-predicates
2055 (or (eq search-invisible t) 2092 (nth 0 real-match-data) (nth 1 real-match-data)))
2056 (not (isearch-range-invisible 2093 (setq skip-filtered-count (1+ skip-filtered-count)))
2057 (nth 0 real-match-data) (nth 1 real-match-data))))) 2094 ;; Optionally ignore invisible matches.
2058 2095 ((not (or (eq search-invisible t)
2096 ;; Don't open overlays for automatic replacements.
2097 (and (not query-flag) search-invisible)
2098 ;; Open hidden overlays for interactive replacements.
2099 (not (isearch-range-invisible
2100 (nth 0 real-match-data) (nth 1 real-match-data)))))
2101 (setq skip-invisible-count (1+ skip-invisible-count)))
2102 (t
2059 ;; Calculate the replacement string, if necessary. 2103 ;; Calculate the replacement string, if necessary.
2060 (when replacements 2104 (when replacements
2061 (set-match-data real-match-data) 2105 (set-match-data real-match-data)
@@ -2260,13 +2304,31 @@ make, or the user didn't cancel the call."
2260 (match-end 0) 2304 (match-end 0)
2261 (current-buffer)) 2305 (current-buffer))
2262 (match-data t))) 2306 (match-data t)))
2263 stack))))) 2307 stack))))))
2264 2308
2265 (replace-dehighlight)) 2309 (replace-dehighlight))
2266 (or unread-command-events 2310 (or unread-command-events
2267 (message "Replaced %d occurrence%s" 2311 (message "Replaced %d occurrence%s%s"
2268 replace-count 2312 replace-count
2269 (if (= replace-count 1) "" "s"))) 2313 (if (= replace-count 1) "" "s")
2314 (if (> (+ skip-read-only-count
2315 skip-filtered-count
2316 skip-invisible-count) 0)
2317 (format " (skipped %s)"
2318 (mapconcat
2319 'identity
2320 (delq nil (list
2321 (if (> skip-read-only-count 0)
2322 (format "%s read-only"
2323 skip-read-only-count))
2324 (if (> skip-invisible-count 0)
2325 (format "%s invisible"
2326 skip-invisible-count))
2327 (if (> skip-filtered-count 0)
2328 (format "%s filtered out"
2329 skip-filtered-count))))
2330 ", "))
2331 "")))
2270 (or (and keep-going stack) multi-buffer))) 2332 (or (and keep-going stack) multi-buffer)))
2271 2333
2272;;; replace.el ends here 2334;;; replace.el ends here
diff --git a/lisp/simple.el b/lisp/simple.el
index 18a360faa61..15bf8779f56 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -372,34 +372,6 @@ Other major modes are defined by comparison with this one."
372 "Parent major mode from which special major modes should inherit." 372 "Parent major mode from which special major modes should inherit."
373 (setq buffer-read-only t)) 373 (setq buffer-read-only t))
374 374
375;; Major mode meant to be the parent of programming modes.
376
377(defvar prog-mode-map
378 (let ((map (make-sparse-keymap)))
379 (define-key map [?\C-\M-q] 'prog-indent-sexp)
380 map)
381 "Keymap used for programming modes.")
382
383(defun prog-indent-sexp (&optional defun)
384 "Indent the expression after point.
385When interactively called with prefix, indent the enclosing defun
386instead."
387 (interactive "P")
388 (save-excursion
389 (when defun
390 (end-of-line)
391 (beginning-of-defun))
392 (let ((start (point))
393 (end (progn (forward-sexp 1) (point))))
394 (indent-region start end nil))))
395
396(define-derived-mode prog-mode fundamental-mode "Prog"
397 "Major mode for editing programming language source code."
398 (set (make-local-variable 'require-final-newline) mode-require-final-newline)
399 (set (make-local-variable 'parse-sexp-ignore-comments) t)
400 ;; Any programming language is always written left to right.
401 (setq bidi-paragraph-direction 'left-to-right))
402
403;; Making and deleting lines. 375;; Making and deleting lines.
404 376
405(defvar hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard)) 377(defvar hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard))
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 01288b89132..a7eae7464e2 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -31,6 +31,8 @@
31 31
32;;; Code: 32;;; Code:
33 33
34(eval-when-compile (require 'cl-lib))
35
34;; page 1: statement skeleton language definition & interpreter 36;; page 1: statement skeleton language definition & interpreter
35;; page 2: paired insertion 37;; page 2: paired insertion
36;; page 3: mirror-mode, an example for setting up paired insertion 38;; page 3: mirror-mode, an example for setting up paired insertion
@@ -84,13 +86,11 @@ The variables `v1' and `v2' are still set when calling this.")
84 "When non-nil, indent rigidly under current line for element `\\n'. 86 "When non-nil, indent rigidly under current line for element `\\n'.
85Else use mode's `indent-line-function'.") 87Else use mode's `indent-line-function'.")
86 88
87(defvar skeleton-further-elements () 89(defvar-local skeleton-further-elements ()
88 "A buffer-local varlist (see `let') of mode specific skeleton elements. 90 "A buffer-local varlist (see `let') of mode specific skeleton elements.
89These variables are bound while interpreting a skeleton. Their value may 91These variables are bound while interpreting a skeleton. Their value may
90in turn be any valid skeleton element if they are themselves to be used as 92in turn be any valid skeleton element if they are themselves to be used as
91skeleton elements.") 93skeleton elements.")
92(make-variable-buffer-local 'skeleton-further-elements)
93
94 94
95(defvar skeleton-subprompt 95(defvar skeleton-subprompt
96 (substitute-command-keys 96 (substitute-command-keys
@@ -260,8 +260,10 @@ When done with skeleton, but before going back to `_'-point call
260 skeleton-modified skeleton-point resume: help input v1 v2) 260 skeleton-modified skeleton-point resume: help input v1 v2)
261 (setq skeleton-positions nil) 261 (setq skeleton-positions nil)
262 (unwind-protect 262 (unwind-protect
263 (eval `(let ,skeleton-further-elements 263 (cl-progv
264 (skeleton-internal-list skeleton str))) 264 (mapcar #'car skeleton-further-elements)
265 (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements)
266 (skeleton-internal-list skeleton str))
265 (run-hooks 'skeleton-end-hook) 267 (run-hooks 'skeleton-end-hook)
266 (sit-for 0) 268 (sit-for 0)
267 (or (pos-visible-in-window-p beg) 269 (or (pos-visible-in-window-p beg)
diff --git a/lisp/subr.el b/lisp/subr.el
index 23684f02b87..8f290f356da 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1,4 +1,4 @@
1;;; subr.el --- basic lisp subroutines for Emacs -*- coding: utf-8 -*- 1;;; subr.el --- basic lisp subroutines for Emacs -*- coding: utf-8; lexical-binding:t -*-
2 2
3;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2013 Free Software 3;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2013 Free Software
4;; Foundation, Inc. 4;; Foundation, Inc.
@@ -39,13 +39,13 @@ Each element of this list holds the arguments to one call to `defcustom'.")
39 (setq custom-declare-variable-list 39 (setq custom-declare-variable-list
40 (cons arguments custom-declare-variable-list))) 40 (cons arguments custom-declare-variable-list)))
41 41
42(defmacro declare-function (fn file &optional arglist fileonly) 42(defmacro declare-function (_fn _file &optional _arglist _fileonly)
43 "Tell the byte-compiler that function FN is defined, in FILE. 43 "Tell the byte-compiler that function FN is defined, in FILE.
44Optional ARGLIST is the argument list used by the function. The 44Optional ARGLIST is the argument list used by the function.
45FILE argument is not used by the byte-compiler, but by the 45The FILE argument is not used by the byte-compiler, but by the
46`check-declare' package, which checks that FILE contains a 46`check-declare' package, which checks that FILE contains a
47definition for FN. ARGLIST is used by both the byte-compiler and 47definition for FN. ARGLIST is used by both the byte-compiler
48`check-declare' to check for consistency. 48and `check-declare' to check for consistency.
49 49
50FILE can be either a Lisp file (in which case the \".el\" 50FILE can be either a Lisp file (in which case the \".el\"
51extension is optional), or a C file. C files are expanded 51extension is optional), or a C file. C files are expanded
@@ -396,9 +396,9 @@ non-nil."
396(defun number-sequence (from &optional to inc) 396(defun number-sequence (from &optional to inc)
397 "Return a sequence of numbers from FROM to TO (both inclusive) as a list. 397 "Return a sequence of numbers from FROM to TO (both inclusive) as a list.
398INC is the increment used between numbers in the sequence and defaults to 1. 398INC is the increment used between numbers in the sequence and defaults to 1.
399So, the Nth element of the list is \(+ FROM \(* N INC)) where N counts from 399So, the Nth element of the list is (+ FROM (* N INC)) where N counts from
400zero. TO is only included if there is an N for which TO = FROM + N * INC. 400zero. TO is only included if there is an N for which TO = FROM + N * INC.
401If TO is nil or numerically equal to FROM, return \(FROM). 401If TO is nil or numerically equal to FROM, return (FROM).
402If INC is positive and TO is less than FROM, or INC is negative 402If INC is positive and TO is less than FROM, or INC is negative
403and TO is larger than FROM, return nil. 403and TO is larger than FROM, return nil.
404If INC is zero and TO is neither nil nor numerically equal to 404If INC is zero and TO is neither nil nor numerically equal to
@@ -408,11 +408,11 @@ This function is primarily designed for integer arguments.
408Nevertheless, FROM, TO and INC can be integer or float. However, 408Nevertheless, FROM, TO and INC can be integer or float. However,
409floating point arithmetic is inexact. For instance, depending on 409floating point arithmetic is inexact. For instance, depending on
410the machine, it may quite well happen that 410the machine, it may quite well happen that
411\(number-sequence 0.4 0.6 0.2) returns the one element list \(0.4), 411\(number-sequence 0.4 0.6 0.2) returns the one element list (0.4),
412whereas \(number-sequence 0.4 0.8 0.2) returns a list with three 412whereas (number-sequence 0.4 0.8 0.2) returns a list with three
413elements. Thus, if some of the arguments are floats and one wants 413elements. Thus, if some of the arguments are floats and one wants
414to make sure that TO is included, one may have to explicitly write 414to make sure that TO is included, one may have to explicitly write
415TO as \(+ FROM \(* N INC)) or use a variable whose value was 415TO as (+ FROM (* N INC)) or use a variable whose value was
416computed with this exact expression. Alternatively, you can, 416computed with this exact expression. Alternatively, you can,
417of course, also replace TO with a slightly larger value 417of course, also replace TO with a slightly larger value
418\(or a slightly more negative value if INC is negative)." 418\(or a slightly more negative value if INC is negative)."
@@ -784,8 +784,8 @@ KEY is a key sequence; noninteractively, it is a string or vector
784of characters or event types, and non-ASCII characters with codes 784of characters or event types, and non-ASCII characters with codes
785above 127 (such as ISO Latin-1) can be included if you use a vector. 785above 127 (such as ISO Latin-1) can be included if you use a vector.
786 786
787The binding goes in the current buffer's local map, 787The binding goes in the current buffer's local map, which in most
788which in most cases is shared with all other buffers in the same major mode." 788cases is shared with all other buffers in the same major mode."
789 (interactive "KSet key locally: \nCSet key %s locally to command: ") 789 (interactive "KSet key locally: \nCSet key %s locally to command: ")
790 (let ((map (current-local-map))) 790 (let ((map (current-local-map)))
791 (or map 791 (or map
@@ -821,7 +821,7 @@ in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
821 821
822If you don't specify OLDMAP, you can usually get the same results 822If you don't specify OLDMAP, you can usually get the same results
823in a cleaner way with command remapping, like this: 823in a cleaner way with command remapping, like this:
824 \(define-key KEYMAP [remap OLDDEF] NEWDEF) 824 (define-key KEYMAP [remap OLDDEF] NEWDEF)
825\n(fn OLDDEF NEWDEF KEYMAP &optional OLDMAP)" 825\n(fn OLDDEF NEWDEF KEYMAP &optional OLDMAP)"
826 ;; Don't document PREFIX in the doc string because we don't want to 826 ;; Don't document PREFIX in the doc string because we don't want to
827 ;; advertise it. It's meant for recursive calls only. Here's its 827 ;; advertise it. It's meant for recursive calls only. Here's its
@@ -1478,11 +1478,48 @@ ELEMENT is added at the end.
1478 1478
1479The return value is the new value of LIST-VAR. 1479The return value is the new value of LIST-VAR.
1480 1480
1481This is handy to add some elements to configuration variables,
1482but please do not abuse it in Elisp code, where you are usually better off
1483using `push' or `cl-pushnew'.
1484
1481If you want to use `add-to-list' on a variable that is not defined 1485If you want to use `add-to-list' on a variable that is not defined
1482until a certain package is loaded, you should put the call to `add-to-list' 1486until a certain package is loaded, you should put the call to `add-to-list'
1483into a hook function that will be run only after loading the package. 1487into a hook function that will be run only after loading the package.
1484`eval-after-load' provides one way to do this. In some cases 1488`eval-after-load' provides one way to do this. In some cases
1485other hooks, such as major mode hooks, can do the job." 1489other hooks, such as major mode hooks, can do the job."
1490 (declare
1491 (compiler-macro
1492 (lambda (exp)
1493 ;; FIXME: Something like this could be used for `set' as well.
1494 (if (or (not (eq 'quote (car-safe list-var)))
1495 (special-variable-p (cadr list-var))
1496 (and append compare-fn))
1497 exp
1498 (let* ((sym (cadr list-var))
1499 (msg (format "`add-to-list' can't use lexical var `%s'; use `push' or `cl-pushnew'"
1500 sym))
1501 ;; Big ugly hack so we only output a warning during
1502 ;; byte-compilation, and so we can use
1503 ;; byte-compile-not-lexical-var-p to silence the warning
1504 ;; when a defvar has been seen but not yet executed.
1505 (warnfun (lambda ()
1506 ;; FIXME: We should also emit a warning for let-bound
1507 ;; variables with dynamic binding.
1508 (when (assq sym byte-compile--lexical-environment)
1509 (byte-compile-log-warning msg t :error))))
1510 (code
1511 (if append
1512 (macroexp-let2 macroexp-copyable-p x element
1513 `(unless (member ,x ,sym)
1514 (setq ,sym (append ,sym (list ,x)))))
1515 (require 'cl-lib)
1516 `(cl-pushnew ,element ,sym
1517 :test ,(or compare-fn '#'equal)))))
1518 (if (not (macroexp--compiling-p))
1519 code
1520 `(progn
1521 (macroexp--funcall-if-compiled ',warnfun)
1522 ,code)))))))
1486 (if (cond 1523 (if (cond
1487 ((null compare-fn) 1524 ((null compare-fn)
1488 (member element (symbol-value list-var))) 1525 (member element (symbol-value list-var)))
@@ -1710,7 +1747,7 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
1710 (nconc found (list (cons toggle keymap)) rest)) 1747 (nconc found (list (cons toggle keymap)) rest))
1711 (push (cons toggle keymap) minor-mode-map-alist))))))) 1748 (push (cons toggle keymap) minor-mode-map-alist)))))))
1712 1749
1713;;; Load history 1750;;;; Load history
1714 1751
1715(defsubst autoloadp (object) 1752(defsubst autoloadp (object)
1716 "Non-nil if OBJECT is an autoload." 1753 "Non-nil if OBJECT is an autoload."
@@ -1793,173 +1830,6 @@ and the file name is displayed in the echo area."
1793 file)) 1830 file))
1794 1831
1795 1832
1796;;;; Specifying things to do later.
1797
1798(defun load-history-regexp (file)
1799 "Form a regexp to find FILE in `load-history'.
1800FILE, a string, is described in the function `eval-after-load'."
1801 (if (file-name-absolute-p file)
1802 (setq file (file-truename file)))
1803 (concat (if (file-name-absolute-p file) "\\`" "\\(\\`\\|/\\)")
1804 (regexp-quote file)
1805 (if (file-name-extension file)
1806 ""
1807 ;; Note: regexp-opt can't be used here, since we need to call
1808 ;; this before Emacs has been fully started. 2006-05-21
1809 (concat "\\(" (mapconcat 'regexp-quote load-suffixes "\\|") "\\)?"))
1810 "\\(" (mapconcat 'regexp-quote jka-compr-load-suffixes "\\|")
1811 "\\)?\\'"))
1812
1813(defun load-history-filename-element (file-regexp)
1814 "Get the first elt of `load-history' whose car matches FILE-REGEXP.
1815Return nil if there isn't one."
1816 (let* ((loads load-history)
1817 (load-elt (and loads (car loads))))
1818 (save-match-data
1819 (while (and loads
1820 (or (null (car load-elt))
1821 (not (string-match file-regexp (car load-elt)))))
1822 (setq loads (cdr loads)
1823 load-elt (and loads (car loads)))))
1824 load-elt))
1825
1826(put 'eval-after-load 'lisp-indent-function 1)
1827(defun eval-after-load (file form)
1828 "Arrange that if FILE is loaded, FORM will be run immediately afterwards.
1829If FILE is already loaded, evaluate FORM right now.
1830
1831If a matching file is loaded again, FORM will be evaluated again.
1832
1833If FILE is a string, it may be either an absolute or a relative file
1834name, and may have an extension \(e.g. \".el\") or may lack one, and
1835additionally may or may not have an extension denoting a compressed
1836format \(e.g. \".gz\").
1837
1838When FILE is absolute, this first converts it to a true name by chasing
1839symbolic links. Only a file of this name \(see next paragraph regarding
1840extensions) will trigger the evaluation of FORM. When FILE is relative,
1841a file whose absolute true name ends in FILE will trigger evaluation.
1842
1843When FILE lacks an extension, a file name with any extension will trigger
1844evaluation. Otherwise, its extension must match FILE's. A further
1845extension for a compressed format \(e.g. \".gz\") on FILE will not affect
1846this name matching.
1847
1848Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
1849is evaluated at the end of any file that `provide's this feature.
1850If the feature is provided when evaluating code not associated with a
1851file, FORM is evaluated immediately after the provide statement.
1852
1853Usually FILE is just a library name like \"font-lock\" or a feature name
1854like 'font-lock.
1855
1856This function makes or adds to an entry on `after-load-alist'."
1857 ;; Add this FORM into after-load-alist (regardless of whether we'll be
1858 ;; evaluating it now).
1859 (let* ((regexp-or-feature
1860 (if (stringp file)
1861 (setq file (purecopy (load-history-regexp file)))
1862 file))
1863 (elt (assoc regexp-or-feature after-load-alist)))
1864 (unless elt
1865 (setq elt (list regexp-or-feature))
1866 (push elt after-load-alist))
1867 ;; Make sure `form' is evalled in the current lexical/dynamic code.
1868 (setq form `(funcall ',(eval `(lambda () ,form) lexical-binding)))
1869 ;; Is there an already loaded file whose name (or `provide' name)
1870 ;; matches FILE?
1871 (prog1 (if (if (stringp file)
1872 (load-history-filename-element regexp-or-feature)
1873 (featurep file))
1874 (eval form))
1875 (when (symbolp regexp-or-feature)
1876 ;; For features, the after-load-alist elements get run when `provide' is
1877 ;; called rather than at the end of the file. So add an indirection to
1878 ;; make sure that `form' is really run "after-load" in case the provide
1879 ;; call happens early.
1880 (setq form
1881 `(if load-file-name
1882 (let ((fun (make-symbol "eval-after-load-helper")))
1883 (fset fun `(lambda (file)
1884 (if (not (equal file ',load-file-name))
1885 nil
1886 (remove-hook 'after-load-functions ',fun)
1887 ,',form)))
1888 (add-hook 'after-load-functions fun))
1889 ;; Not being provided from a file, run form right now.
1890 ,form)))
1891 ;; Add FORM to the element unless it's already there.
1892 (unless (member form (cdr elt))
1893 (nconc elt (list form))))))
1894
1895(defvar after-load-functions nil
1896 "Special hook run after loading a file.
1897Each function there is called with a single argument, the absolute
1898name of the file just loaded.")
1899
1900(defun do-after-load-evaluation (abs-file)
1901 "Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
1902ABS-FILE, a string, should be the absolute true name of a file just loaded.
1903This function is called directly from the C code."
1904 ;; Run the relevant eval-after-load forms.
1905 (mapc #'(lambda (a-l-element)
1906 (when (and (stringp (car a-l-element))
1907 (string-match-p (car a-l-element) abs-file))
1908 ;; discard the file name regexp
1909 (mapc #'eval (cdr a-l-element))))
1910 after-load-alist)
1911 ;; Complain when the user uses obsolete files.
1912 (when (string-match-p "/obsolete/[^/]*\\'" abs-file)
1913 (run-with-timer 0 nil
1914 (lambda (file)
1915 (message "Package %s is obsolete!"
1916 (substring file 0
1917 (string-match "\\.elc?\\>" file))))
1918 (file-name-nondirectory abs-file)))
1919 ;; Finally, run any other hook.
1920 (run-hook-with-args 'after-load-functions abs-file))
1921
1922(defun eval-next-after-load (file)
1923 "Read the following input sexp, and run it whenever FILE is loaded.
1924This makes or adds to an entry on `after-load-alist'.
1925FILE should be the name of a library, with no directory name."
1926 (declare (obsolete eval-after-load "23.2"))
1927 (eval-after-load file (read)))
1928
1929(defun display-delayed-warnings ()
1930 "Display delayed warnings from `delayed-warnings-list'.
1931Used from `delayed-warnings-hook' (which see)."
1932 (dolist (warning (nreverse delayed-warnings-list))
1933 (apply 'display-warning warning))
1934 (setq delayed-warnings-list nil))
1935
1936(defun collapse-delayed-warnings ()
1937 "Remove duplicates from `delayed-warnings-list'.
1938Collapse identical adjacent warnings into one (plus count).
1939Used from `delayed-warnings-hook' (which see)."
1940 (let ((count 1)
1941 collapsed warning)
1942 (while delayed-warnings-list
1943 (setq warning (pop delayed-warnings-list))
1944 (if (equal warning (car delayed-warnings-list))
1945 (setq count (1+ count))
1946 (when (> count 1)
1947 (setcdr warning (cons (format "%s [%d times]" (cadr warning) count)
1948 (cddr warning)))
1949 (setq count 1))
1950 (push warning collapsed)))
1951 (setq delayed-warnings-list (nreverse collapsed))))
1952
1953;; At present this is only used for Emacs internals.
1954;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html
1955(defvar delayed-warnings-hook '(collapse-delayed-warnings
1956 display-delayed-warnings)
1957 "Normal hook run to process and display delayed warnings.
1958By default, this hook contains functions to consolidate the
1959warnings listed in `delayed-warnings-list', display them, and set
1960`delayed-warnings-list' back to nil.")
1961
1962
1963;;;; Process stuff. 1833;;;; Process stuff.
1964 1834
1965(defun process-lines (program &rest args) 1835(defun process-lines (program &rest args)
@@ -2054,8 +1924,8 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
2054 ;; disable quail's input methods, so although read-key-sequence 1924 ;; disable quail's input methods, so although read-key-sequence
2055 ;; always inherits the input method, in practice read-key does not 1925 ;; always inherits the input method, in practice read-key does not
2056 ;; inherit the input method (at least not if it's based on quail). 1926 ;; inherit the input method (at least not if it's based on quail).
2057 (let ((overriding-terminal-local-map read-key-empty-map) 1927 (let ((overriding-terminal-local-map nil)
2058 (overriding-local-map nil) 1928 (overriding-local-map read-key-empty-map)
2059 (echo-keystrokes 0) 1929 (echo-keystrokes 0)
2060 (old-global-map (current-global-map)) 1930 (old-global-map (current-global-map))
2061 (timer (run-with-idle-timer 1931 (timer (run-with-idle-timer
@@ -2670,7 +2540,7 @@ Set this to nil at your own risk..."
2670(defun locate-user-emacs-file (new-name &optional old-name) 2540(defun locate-user-emacs-file (new-name &optional old-name)
2671 "Return an absolute per-user Emacs-specific file name. 2541 "Return an absolute per-user Emacs-specific file name.
2672If NEW-NAME exists in `user-emacs-directory', return it. 2542If NEW-NAME exists in `user-emacs-directory', return it.
2673Else If OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME. 2543Else if OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
2674Else return NEW-NAME in `user-emacs-directory', creating the 2544Else return NEW-NAME in `user-emacs-directory', creating the
2675directory if it does not exist." 2545directory if it does not exist."
2676 (convert-standard-filename 2546 (convert-standard-filename
@@ -2717,8 +2587,9 @@ customize the variable `user-emacs-directory-warning'."
2717 "Return non-nil if the current buffer is narrowed." 2587 "Return non-nil if the current buffer is narrowed."
2718 (/= (- (point-max) (point-min)) (buffer-size))) 2588 (/= (- (point-max) (point-min)) (buffer-size)))
2719 2589
2720(defun find-tag-default () 2590(defun find-tag-default-bounds ()
2721 "Determine default tag to search for, based on text at point. 2591 "Determine the boundaries of the default tag, based on text at point.
2592Return a cons cell with the beginning and end of the found tag.
2722If there is no plausible default, return nil." 2593If there is no plausible default, return nil."
2723 (let (from to bound) 2594 (let (from to bound)
2724 (when (or (progn 2595 (when (or (progn
@@ -2742,7 +2613,14 @@ If there is no plausible default, return nil."
2742 (< (setq from (point)) bound) 2613 (< (setq from (point)) bound)
2743 (skip-syntax-forward "w_") 2614 (skip-syntax-forward "w_")
2744 (setq to (point))))) 2615 (setq to (point)))))
2745 (buffer-substring-no-properties from to)))) 2616 (cons from to))))
2617
2618(defun find-tag-default ()
2619 "Determine default tag to search for, based on text at point.
2620If there is no plausible default, return nil."
2621 (let ((bounds (find-tag-default-bounds)))
2622 (when bounds
2623 (buffer-substring-no-properties (car bounds) (cdr bounds)))))
2746 2624
2747(defun find-tag-default-as-regexp () 2625(defun find-tag-default-as-regexp ()
2748 "Return regexp that matches the default tag at point. 2626 "Return regexp that matches the default tag at point.
@@ -3353,7 +3231,7 @@ than cosmetic ones, undo data may become corrupted.
3353 3231
3354This macro will run BODY normally, but doesn't count its buffer 3232This macro will run BODY normally, but doesn't count its buffer
3355modifications as being buffer modifications. This affects things 3233modifications as being buffer modifications. This affects things
3356like buffer-modified-p, checking whether the file is locked by 3234like `buffer-modified-p', checking whether the file is locked by
3357someone else, running buffer modification hooks, and other things 3235someone else, running buffer modification hooks, and other things
3358of that nature. 3236of that nature.
3359 3237
@@ -3658,7 +3536,7 @@ which separates, but is not part of, the substrings. If nil it defaults to
3658`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and 3536`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
3659OMIT-NULLS is forced to t. 3537OMIT-NULLS is forced to t.
3660 3538
3661If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so 3539If OMIT-NULLS is t, zero-length substrings are omitted from the list (so
3662that for the default value of SEPARATORS leading and trailing whitespace 3540that for the default value of SEPARATORS leading and trailing whitespace
3663are effectively trimmed). If nil, all zero-length substrings are retained, 3541are effectively trimmed). If nil, all zero-length substrings are retained,
3664which correctly parses CSV format, for example. 3542which correctly parses CSV format, for example.
@@ -3817,6 +3695,173 @@ consisting of STR followed by an invisible left-to-right mark
3817 (concat str (propertize (string ?\x200e) 'invisible t)) 3695 (concat str (propertize (string ?\x200e) 'invisible t))
3818 str)) 3696 str))
3819 3697
3698;;;; Specifying things to do later.
3699
3700(defun load-history-regexp (file)
3701 "Form a regexp to find FILE in `load-history'.
3702FILE, a string, is described in the function `eval-after-load'."
3703 (if (file-name-absolute-p file)
3704 (setq file (file-truename file)))
3705 (concat (if (file-name-absolute-p file) "\\`" "\\(\\`\\|/\\)")
3706 (regexp-quote file)
3707 (if (file-name-extension file)
3708 ""
3709 ;; Note: regexp-opt can't be used here, since we need to call
3710 ;; this before Emacs has been fully started. 2006-05-21
3711 (concat "\\(" (mapconcat 'regexp-quote load-suffixes "\\|") "\\)?"))
3712 "\\(" (mapconcat 'regexp-quote jka-compr-load-suffixes "\\|")
3713 "\\)?\\'"))
3714
3715(defun load-history-filename-element (file-regexp)
3716 "Get the first elt of `load-history' whose car matches FILE-REGEXP.
3717Return nil if there isn't one."
3718 (let* ((loads load-history)
3719 (load-elt (and loads (car loads))))
3720 (save-match-data
3721 (while (and loads
3722 (or (null (car load-elt))
3723 (not (string-match file-regexp (car load-elt)))))
3724 (setq loads (cdr loads)
3725 load-elt (and loads (car loads)))))
3726 load-elt))
3727
3728(put 'eval-after-load 'lisp-indent-function 1)
3729(defun eval-after-load (file form)
3730 "Arrange that if FILE is loaded, FORM will be run immediately afterwards.
3731If FILE is already loaded, evaluate FORM right now.
3732
3733If a matching file is loaded again, FORM will be evaluated again.
3734
3735If FILE is a string, it may be either an absolute or a relative file
3736name, and may have an extension (e.g. \".el\") or may lack one, and
3737additionally may or may not have an extension denoting a compressed
3738format (e.g. \".gz\").
3739
3740When FILE is absolute, this first converts it to a true name by chasing
3741symbolic links. Only a file of this name (see next paragraph regarding
3742extensions) will trigger the evaluation of FORM. When FILE is relative,
3743a file whose absolute true name ends in FILE will trigger evaluation.
3744
3745When FILE lacks an extension, a file name with any extension will trigger
3746evaluation. Otherwise, its extension must match FILE's. A further
3747extension for a compressed format (e.g. \".gz\") on FILE will not affect
3748this name matching.
3749
3750Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
3751is evaluated at the end of any file that `provide's this feature.
3752If the feature is provided when evaluating code not associated with a
3753file, FORM is evaluated immediately after the provide statement.
3754
3755Usually FILE is just a library name like \"font-lock\" or a feature name
3756like 'font-lock.
3757
3758This function makes or adds to an entry on `after-load-alist'."
3759 ;; Add this FORM into after-load-alist (regardless of whether we'll be
3760 ;; evaluating it now).
3761 (let* ((regexp-or-feature
3762 (if (stringp file)
3763 (setq file (purecopy (load-history-regexp file)))
3764 file))
3765 (elt (assoc regexp-or-feature after-load-alist)))
3766 (unless elt
3767 (setq elt (list regexp-or-feature))
3768 (push elt after-load-alist))
3769 ;; Make sure `form' is evalled in the current lexical/dynamic code.
3770 (setq form `(funcall ',(eval `(lambda () ,form) lexical-binding)))
3771 ;; Is there an already loaded file whose name (or `provide' name)
3772 ;; matches FILE?
3773 (prog1 (if (if (stringp file)
3774 (load-history-filename-element regexp-or-feature)
3775 (featurep file))
3776 (eval form))
3777 (when (symbolp regexp-or-feature)
3778 ;; For features, the after-load-alist elements get run when `provide' is
3779 ;; called rather than at the end of the file. So add an indirection to
3780 ;; make sure that `form' is really run "after-load" in case the provide
3781 ;; call happens early.
3782 (setq form
3783 `(if load-file-name
3784 (let ((fun (make-symbol "eval-after-load-helper")))
3785 (fset fun `(lambda (file)
3786 (if (not (equal file ',load-file-name))
3787 nil
3788 (remove-hook 'after-load-functions ',fun)
3789 ,',form)))
3790 (add-hook 'after-load-functions fun))
3791 ;; Not being provided from a file, run form right now.
3792 ,form)))
3793 ;; Add FORM to the element unless it's already there.
3794 (unless (member form (cdr elt))
3795 (nconc elt (list form))))))
3796
3797(defvar after-load-functions nil
3798 "Special hook run after loading a file.
3799Each function there is called with a single argument, the absolute
3800name of the file just loaded.")
3801
3802(defun do-after-load-evaluation (abs-file)
3803 "Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
3804ABS-FILE, a string, should be the absolute true name of a file just loaded.
3805This function is called directly from the C code."
3806 ;; Run the relevant eval-after-load forms.
3807 (mapc #'(lambda (a-l-element)
3808 (when (and (stringp (car a-l-element))
3809 (string-match-p (car a-l-element) abs-file))
3810 ;; discard the file name regexp
3811 (mapc #'eval (cdr a-l-element))))
3812 after-load-alist)
3813 ;; Complain when the user uses obsolete files.
3814 (when (string-match-p "/obsolete/[^/]*\\'" abs-file)
3815 (run-with-timer 0 nil
3816 (lambda (file)
3817 (message "Package %s is obsolete!"
3818 (substring file 0
3819 (string-match "\\.elc?\\>" file))))
3820 (file-name-nondirectory abs-file)))
3821 ;; Finally, run any other hook.
3822 (run-hook-with-args 'after-load-functions abs-file))
3823
3824(defun eval-next-after-load (file)
3825 "Read the following input sexp, and run it whenever FILE is loaded.
3826This makes or adds to an entry on `after-load-alist'.
3827FILE should be the name of a library, with no directory name."
3828 (declare (obsolete eval-after-load "23.2"))
3829 (eval-after-load file (read)))
3830
3831(defun display-delayed-warnings ()
3832 "Display delayed warnings from `delayed-warnings-list'.
3833Used from `delayed-warnings-hook' (which see)."
3834 (dolist (warning (nreverse delayed-warnings-list))
3835 (apply 'display-warning warning))
3836 (setq delayed-warnings-list nil))
3837
3838(defun collapse-delayed-warnings ()
3839 "Remove duplicates from `delayed-warnings-list'.
3840Collapse identical adjacent warnings into one (plus count).
3841Used from `delayed-warnings-hook' (which see)."
3842 (let ((count 1)
3843 collapsed warning)
3844 (while delayed-warnings-list
3845 (setq warning (pop delayed-warnings-list))
3846 (if (equal warning (car delayed-warnings-list))
3847 (setq count (1+ count))
3848 (when (> count 1)
3849 (setcdr warning (cons (format "%s [%d times]" (cadr warning) count)
3850 (cddr warning)))
3851 (setq count 1))
3852 (push warning collapsed)))
3853 (setq delayed-warnings-list (nreverse collapsed))))
3854
3855;; At present this is only used for Emacs internals.
3856;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html
3857(defvar delayed-warnings-hook '(collapse-delayed-warnings
3858 display-delayed-warnings)
3859 "Normal hook run to process and display delayed warnings.
3860By default, this hook contains functions to consolidate the
3861warnings listed in `delayed-warnings-list', display them, and set
3862`delayed-warnings-list' back to nil.")
3863
3864
3820;;;; invisibility specs 3865;;;; invisibility specs
3821 3866
3822(defun add-to-invisibility-spec (element) 3867(defun add-to-invisibility-spec (element)
@@ -4189,32 +4234,6 @@ use `called-interactively-p'."
4189 (declare (obsolete called-interactively-p "23.2")) 4234 (declare (obsolete called-interactively-p "23.2"))
4190 (called-interactively-p 'interactive)) 4235 (called-interactively-p 'interactive))
4191 4236
4192(defun function-arity (f &optional num)
4193 "Return the (MIN . MAX) arity of F.
4194If the maximum arity is infinite, MAX is `many'.
4195F can be a function or a macro.
4196If NUM is non-nil, return non-nil iff F can be called with NUM args."
4197 (if (symbolp f) (setq f (indirect-function f)))
4198 (if (eq (car-safe f) 'macro) (setq f (cdr f)))
4199 (let ((res
4200 (if (subrp f)
4201 (let ((x (subr-arity f)))
4202 (if (eq (cdr x) 'unevalled) (cons (car x) 'many)))
4203 (let* ((args (if (consp f) (cadr f) (aref f 0)))
4204 (max (length args))
4205 (opt (memq '&optional args))
4206 (rest (memq '&rest args))
4207 (min (- max (length opt))))
4208 (if opt
4209 (cons min (if rest 'many (1- max)))
4210 (if rest
4211 (cons (- max (length rest)) 'many)
4212 (cons min max)))))))
4213 (if (not num)
4214 res
4215 (and (>= num (car res))
4216 (or (eq 'many (cdr res)) (<= num (cdr res)))))))
4217
4218(defun set-temporary-overlay-map (map &optional keep-pred) 4237(defun set-temporary-overlay-map (map &optional keep-pred)
4219 "Set MAP as a temporary keymap taking precedence over most other keymaps. 4238 "Set MAP as a temporary keymap taking precedence over most other keymaps.
4220Note that this does NOT take precedence over the \"overriding\" maps 4239Note that this does NOT take precedence over the \"overriding\" maps
@@ -4432,32 +4451,16 @@ convenience wrapper around `make-progress-reporter' and friends.
4432 4451
4433;;;; Support for watching filesystem events. 4452;;;; Support for watching filesystem events.
4434 4453
4435(defun inotify-event-p (event) 4454(defun file-notify-handle-event (event)
4436 "Check if EVENT is an inotify event." 4455 "Handle file system monitoring event.
4437 (and (listp event) 4456If EVENT is a filewatch event, call its callback.
4438 (>= (length event) 3)
4439 (eq (car event) 'file-inotify)))
4440
4441;;;###autoload
4442(defun inotify-handle-event (event)
4443 "Handle inotify file system monitoring event.
4444If EVENT is an inotify filewatch event, call its callback.
4445Otherwise, signal a `filewatch-error'."
4446 (interactive "e")
4447 (unless (inotify-event-p event)
4448 (signal 'filewatch-error (cons "Not a valid inotify event" event)))
4449 (funcall (nth 2 event) (nth 1 event)))
4450
4451(defun w32notify-handle-event (event)
4452 "Handle MS-Windows file system monitoring event.
4453If EVENT is an MS-Windows filewatch event, call its callback.
4454Otherwise, signal a `filewatch-error'." 4457Otherwise, signal a `filewatch-error'."
4455 (interactive "e") 4458 (interactive "e")
4456 (if (and (eq (car event) 'file-w32notify) 4459 (if (and (eq (car event) 'file-notify)
4457 (= (length event) 3)) 4460 (>= (length event) 3))
4458 (funcall (nth 2 event) (nth 1 event)) 4461 (funcall (nth 2 event) (nth 1 event))
4459 (signal 'filewatch-error 4462 (signal 'filewatch-error
4460 (cons "Not a valid MS-Windows file-notify event" event)))) 4463 (cons "Not a valid file-notify event" event))))
4461 4464
4462 4465
4463;;;; Comparing version strings. 4466;;;; Comparing version strings.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 0d4d3aaa26b..0298ad81a34 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -558,6 +558,11 @@ unless the current buffer is a scratch buffer."
558 (other-frame -1)) 558 (other-frame -1))
559 559
560;; If no position specified, make new frame offset by 25 from current. 560;; If no position specified, make new frame offset by 25 from current.
561;; You'd think this was a window manager's job, but apparently without
562;; this, new frames open exactly on top of old ones (?).
563;; http://lists.gnu.org/archive/html/emacs-devel/2010-10/msg00988.html
564;; Note that AFAICS it is not documented that functions on
565;; before-make-frame-hook can access PARAMETERS.
561(defvar parameters) ; dynamically bound in make-frame 566(defvar parameters) ; dynamically bound in make-frame
562(add-hook 'before-make-frame-hook 567(add-hook 'before-make-frame-hook
563 (lambda () 568 (lambda ()
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index b633b7be403..de103c0cdb6 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -1,9 +1,9 @@
1;;; log-view.el --- Major mode for browsing RCS/CVS/SCCS log output -*- lexical-binding: t -*- 1;;; log-view.el --- Major mode for browsing revision log histories -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1999-2013 Free Software Foundation, Inc. 3;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
4 4
5;; Author: Stefan Monnier <monnier@iro.umontreal.ca> 5;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
6;; Keywords: rcs, sccs, cvs, log, vc, tools 6;; Keywords: tools, vc
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
@@ -24,10 +24,12 @@
24 24
25;; Major mode to browse revision log histories. 25;; Major mode to browse revision log histories.
26;; Currently supports the format output by: 26;; Currently supports the format output by:
27;; RCS, SCCS, CVS, Subversion, and DaRCS. 27;; SCCS, RCS, CVS, Subversion, DaRCS, and Mercurial.
28 28
29;; Examples of log output: 29;; Examples of log output:
30 30
31;;;; SCCS:
32
31;;;; RCS/CVS: 33;;;; RCS/CVS:
32 34
33;; ---------------------------- 35;; ----------------------------
@@ -43,8 +45,6 @@
43;; Change release version from 21.4 to 22.1 throughout. 45;; Change release version from 21.4 to 22.1 throughout.
44;; Change development version from 21.3.50 to 22.0.50. 46;; Change development version from 21.3.50 to 22.0.50.
45 47
46;;;; SCCS:
47
48;;;; Subversion: 48;;;; Subversion:
49 49
50;; ------------------------------------------------------------------------ 50;; ------------------------------------------------------------------------
@@ -117,18 +117,25 @@
117(defvar cvs-force-command) 117(defvar cvs-force-command)
118 118
119(defgroup log-view nil 119(defgroup log-view nil
120 "Major mode for browsing log output of RCS/CVS/SCCS." 120 "Major mode for browsing log output of revision log histories."
121 :group 'pcl-cvs 121 :group 'pcl-cvs
122 :prefix "log-view-") 122 :prefix "log-view-")
123 123
124(easy-mmode-defmap log-view-mode-map 124(easy-mmode-defmap log-view-mode-map
125 '( 125 '(
126 ;; FIXME: (copy-keymap special-mode-map) instead 126 ("-" . negative-argument)
127 ("z" . kill-this-buffer) 127 ("0" . digit-argument)
128 ("q" . quit-window) 128 ("1" . digit-argument)
129 ("g" . revert-buffer) 129 ("2" . digit-argument)
130 ("\C-m" . log-view-toggle-entry-display) 130 ("3" . digit-argument)
131 ("4" . digit-argument)
132 ("5" . digit-argument)
133 ("6" . digit-argument)
134 ("7" . digit-argument)
135 ("8" . digit-argument)
136 ("9" . digit-argument)
131 137
138 ("\C-m" . log-view-toggle-entry-display)
132 ("m" . log-view-toggle-mark-entry) 139 ("m" . log-view-toggle-mark-entry)
133 ("e" . log-view-modify-change-comment) 140 ("e" . log-view-modify-change-comment)
134 ("d" . log-view-diff) 141 ("d" . log-view-diff)
@@ -145,6 +152,7 @@
145 ("\M-n" . log-view-file-next) 152 ("\M-n" . log-view-file-next)
146 ("\M-p" . log-view-file-prev)) 153 ("\M-p" . log-view-file-prev))
147 "Log-View's keymap." 154 "Log-View's keymap."
155 :inherit special-mode-map
148 :group 'log-view) 156 :group 'log-view)
149 157
150(easy-menu-define log-view-mode-menu log-view-mode-map 158(easy-menu-define log-view-mode-menu log-view-mode-map
@@ -275,6 +283,7 @@ The match group number 1 should match the revision number itself.")
275(easy-mmode-define-navigation log-view-file log-view-file-re "file") 283(easy-mmode-define-navigation log-view-file log-view-file-re "file")
276 284
277(defun log-view-goto-rev (rev) 285(defun log-view-goto-rev (rev)
286 "Go to revision REV."
278 (goto-char (point-min)) 287 (goto-char (point-min))
279 (ignore-errors 288 (ignore-errors
280 (while (not (equal rev (log-view-current-tag))) 289 (while (not (equal rev (log-view-current-tag)))
@@ -288,6 +297,7 @@ The match group number 1 should match the revision number itself.")
288(defconst log-view-dir-re "^cvs[.ex]* [a-z]+: Logging \\(.+\\)$") 297(defconst log-view-dir-re "^cvs[.ex]* [a-z]+: Logging \\(.+\\)$")
289 298
290(defun log-view-current-file () 299(defun log-view-current-file ()
300 "Return the current file."
291 (save-excursion 301 (save-excursion
292 (forward-line 1) 302 (forward-line 1)
293 (or (re-search-backward log-view-file-re nil t) 303 (or (re-search-backward log-view-file-re nil t)
@@ -340,7 +350,7 @@ if POS is omitted or nil, it defaults to point."
340 350
341(defun log-view-toggle-mark-entry () 351(defun log-view-toggle-mark-entry ()
342 "Toggle the marked state for the log entry at point. 352 "Toggle the marked state for the log entry at point.
343Individual log entries can be marked and unmarked. The marked 353Individual log entries can be marked and unmarked. The marked
344entries are denoted by changing their background color. 354entries are denoted by changing their background color.
345`log-view-get-marked' returns the list of tags for the marked 355`log-view-get-marked' returns the list of tags for the marked
346log entries." 356log entries."
@@ -479,7 +489,8 @@ It assumes that a log entry starts with a line matching
479 (funcall f)))) 489 (funcall f))))
480 490
481(defun log-view-find-revision (pos) 491(defun log-view-find-revision (pos)
482 "Visit the version at point." 492 "Visit the version at POS.
493If called interactively, visit the version at point."
483 (interactive "d") 494 (interactive "d")
484 (unless log-view-per-file-logs 495 (unless log-view-per-file-logs
485 (when (> (length log-view-vc-fileset) 1) 496 (when (> (length log-view-vc-fileset) 1)
@@ -521,7 +532,8 @@ It assumes that a log entry starts with a line matching
521 (log-view-extract-comment))) 532 (log-view-extract-comment)))
522 533
523(defun log-view-annotate-version (pos) 534(defun log-view-annotate-version (pos)
524 "Annotate the version at point." 535 "Annotate the version at POS.
536If called interactively, annotate the version at point."
525 (interactive "d") 537 (interactive "d")
526 (unless log-view-per-file-logs 538 (unless log-view-per-file-logs
527 (when (> (length log-view-vc-fileset) 1) 539 (when (> (length log-view-vc-fileset) 1)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 5e1d27c0ea3..0308dd1ebd4 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -115,10 +115,10 @@
115;; Return non-nil if FILE is registered in this backend. Both this 115;; Return non-nil if FILE is registered in this backend. Both this
116;; function as well as `state' should be careful to fail gracefully 116;; function as well as `state' should be careful to fail gracefully
117;; in the event that the backend executable is absent. It is 117;; in the event that the backend executable is absent. It is
118;; preferable that this function's body is autoloaded, that way only 118;; preferable that this function's *body* is autoloaded, that way only
119;; calling vc-registered does not cause the backend to be loaded 119;; calling vc-registered does not cause the backend to be loaded
120;; (all the vc-FOO-registered functions are called to try to find 120;; (all the vc-FOO-registered functions are called to try to find
121;; the controlling backend for FILE. 121;; the controlling backend for FILE).
122;; 122;;
123;; * state (file) 123;; * state (file)
124;; 124;;
@@ -233,6 +233,7 @@
233;; The implementation should pass the value of vc-register-switches 233;; The implementation should pass the value of vc-register-switches
234;; to the backend command. (Note: in older versions of VC, this 234;; to the backend command. (Note: in older versions of VC, this
235;; command took a single file argument and not a list.) 235;; command took a single file argument and not a list.)
236;; The REV argument is a historical leftover and is never used.
236;; 237;;
237;; - init-revision (file) 238;; - init-revision (file)
238;; 239;;
@@ -999,7 +1000,7 @@ current buffer."
999 nil) 1000 nil)
1000 (list (vc-backend-for-registration (buffer-file-name)) 1001 (list (vc-backend-for-registration (buffer-file-name))
1001 (list buffer-file-name)))) 1002 (list buffer-file-name))))
1002 (t (error "No fileset is available here"))))) 1003 (t (error "File is not under version control")))))
1003 1004
1004(defun vc-dired-deduce-fileset () 1005(defun vc-dired-deduce-fileset ()
1005 (let ((backend (vc-responsible-backend default-directory))) 1006 (let ((backend (vc-responsible-backend default-directory)))
@@ -1041,6 +1042,11 @@ current buffer."
1041 (eq p q) 1042 (eq p q)
1042 (and (member p '(edited added removed)) (member q '(edited added removed))))) 1043 (and (member p '(edited added removed)) (member q '(edited added removed)))))
1043 1044
1045(defun vc-read-backend (prompt)
1046 (intern
1047 (completing-read prompt (mapcar 'symbol-name vc-handled-backends)
1048 nil 'require-match)))
1049
1044;; Here's the major entry point. 1050;; Here's the major entry point.
1045 1051
1046;;;###autoload 1052;;;###autoload
@@ -1099,8 +1105,9 @@ For old-style locking-based version control systems, like RCS:
1099 ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update))) 1105 ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update)))
1100 (cond 1106 (cond
1101 (verbose 1107 (verbose
1102 ;; go to a different revision 1108 ;; Go to a different revision.
1103 (let* ((revision 1109 (let* ((revision
1110 ;; FIXME: Provide completion.
1104 (read-string "Branch, revision, or backend to move to: ")) 1111 (read-string "Branch, revision, or backend to move to: "))
1105 (revision-downcase (downcase revision))) 1112 (revision-downcase (downcase revision)))
1106 (if (member 1113 (if (member
@@ -1161,15 +1168,10 @@ For old-style locking-based version control systems, like RCS:
1161 (message "No files remain to be committed") 1168 (message "No files remain to be committed")
1162 (if (not verbose) 1169 (if (not verbose)
1163 (vc-checkin ready-for-commit backend) 1170 (vc-checkin ready-for-commit backend)
1164 (let* ((revision (read-string "New revision or backend: ")) 1171 (let ((new-backend (vc-read-backend "New backend: ")))
1165 (revision-downcase (downcase revision))) 1172 (if new-backend
1166 (if (member 1173 (dolist (file files)
1167 revision-downcase 1174 (vc-transfer-file file new-backend))))))))
1168 (mapcar (lambda (arg) (downcase (symbol-name arg)))
1169 vc-handled-backends))
1170 (let ((vsym (intern revision-downcase)))
1171 (dolist (file files) (vc-transfer-file file vsym)))
1172 (vc-checkin ready-for-commit backend revision)))))))
1173 ;; locked by somebody else (locking VCSes only) 1175 ;; locked by somebody else (locking VCSes only)
1174 ((stringp state) 1176 ((stringp state)
1175 ;; In the old days, we computed the revision once and used it on 1177 ;; In the old days, we computed the revision once and used it on
diff --git a/nextstep/ChangeLog b/nextstep/ChangeLog
index 909580296e1..d76d832555c 100644
--- a/nextstep/ChangeLog
+++ b/nextstep/ChangeLog
@@ -1,3 +1,7 @@
12013-06-02 Jan Djärv <jan.h.d@swipnet.se>
2
3 * templates/Info-gnustep.plist.in: Add NSDocumentClass EmacsDocument.
4
12013-03-16 Jan Djärv <jan.h.d@swipnet.se> 52013-03-16 Jan Djärv <jan.h.d@swipnet.se>
2 6
3 * Makefile.in (${ns_appdir}): Add touch. 7 * Makefile.in (${ns_appdir}): Add touch.
diff --git a/nextstep/templates/Info-gnustep.plist.in b/nextstep/templates/Info-gnustep.plist.in
index 4ac97e5cde6..42abc235761 100644
--- a/nextstep/templates/Info-gnustep.plist.in
+++ b/nextstep/templates/Info-gnustep.plist.in
@@ -20,7 +20,7 @@
20 NSRole = Application; 20 NSRole = Application;
21 NSTypes = ( 21 NSTypes = (
22 { 22 {
23 NSDocumentClass = ""; 23 NSDocumentClass = "EmacsDocument";
24 NSHumanReadableName = ""; 24 NSHumanReadableName = "";
25 NSIcon = ""; 25 NSIcon = "";
26 NSName = ""; 26 NSName = "";
@@ -30,7 +30,7 @@
30 ); 30 );
31 }, 31 },
32 { 32 {
33 NSDocumentClass = ""; 33 NSDocumentClass = "EmacsDocument";
34 NSHumanReadableName = ""; 34 NSHumanReadableName = "";
35 NSIcon = ""; 35 NSIcon = "";
36 NSName = ""; 36 NSName = "";
@@ -41,7 +41,7 @@
41 ); 41 );
42 }, 42 },
43 { 43 {
44 NSDocumentClass = ""; 44 NSDocumentClass = "EmacsDocument";
45 NSHumanReadableName = ""; 45 NSHumanReadableName = "";
46 NSIcon = ""; 46 NSIcon = "";
47 NSName = ""; 47 NSName = "";
@@ -51,7 +51,7 @@
51 ); 51 );
52 }, 52 },
53 { 53 {
54 NSDocumentClass = ""; 54 NSDocumentClass = "EmacsDocument";
55 NSHumanReadableName = ""; 55 NSHumanReadableName = "";
56 NSIcon = ""; 56 NSIcon = "";
57 NSName = ""; 57 NSName = "";
@@ -64,7 +64,7 @@
64 ); 64 );
65 }, 65 },
66 { 66 {
67 NSDocumentClass = ""; 67 NSDocumentClass = "EmacsDocument";
68 NSHumanReadableName = ""; 68 NSHumanReadableName = "";
69 NSIcon = ""; 69 NSIcon = "";
70 NSName = ""; 70 NSName = "";
@@ -74,7 +74,7 @@
74 ); 74 );
75 }, 75 },
76 { 76 {
77 NSDocumentClass = ""; 77 NSDocumentClass = "EmacsDocument";
78 NSHumanReadableName = ""; 78 NSHumanReadableName = "";
79 NSIcon = ""; 79 NSIcon = "";
80 NSName = ""; 80 NSName = "";
@@ -84,7 +84,7 @@
84 ); 84 );
85 }, 85 },
86 { 86 {
87 NSDocumentClass = ""; 87 NSDocumentClass = "EmacsDocument";
88 NSHumanReadableName = ""; 88 NSHumanReadableName = "";
89 NSIcon = ""; 89 NSIcon = "";
90 NSName = ""; 90 NSName = "";
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 696d320c8bc..baa7003f5ae 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,41 @@
12013-06-07 Eli Zaretskii <eliz@gnu.org>
2
3 * INSTALL.MSYS: mingw-get is not a GUI program (yet).
4 msys-automake is not suitable for MinGW builds. Mention the
5 --enable-locallisppath switch to msysconfig.sh. Suggested by
6 Óscar Fuentes <ofv@wanadoo.es>.
7
82013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
9
10 * epaths.nt (PATH_SITELOADSEARCH): Fix commentary.
11
122013-06-03 Eli Zaretskii <eliz@gnu.org>
13
14 * config.nt: Add HAVE_GFILENOTIFY, HAVE_W32NOTIFY and USE_FILE_NOTIFY.
15
162013-06-03 Eli Zaretskii <eliz@gnu.org>
17
18 * inc/sys/time.h (struct timeval): Remove the _W64 guards.
19
202013-06-01 Eli Zaretskii <eliz@gnu.org>
21
22 * inc/sys/time.h [!_TIMEZONE_DEFINED]: Define _TIMEZONE_DEFINED to
23 avoid multiple definition errors on MinGW64.
24
252013-05-31 Eli Zaretskii <eliz@gnu.org>
26
27 * inc/sys/time.h (gettimeofday): Use '__restrict' instead of
28 'restrict', which is a C99 extension. See
29 http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00588.html
30 and the following discussion for the problem this caused in the
31 old nt/configure.bat build.
32
332013-05-29 Eli Zaretskii <eliz@gnu.org>
34
35 * Makefile.in (emacs.res): Include srcdir when preprocessing
36 resources, for out-of-tree builds.
37 (mostlyclean): Remove *.res files.
38
12013-05-17 Eli Zaretskii <eliz@gnu.org> 392013-05-17 Eli Zaretskii <eliz@gnu.org>
2 40
3 * runemacs.c (WinMain): Support invocation of un-installed 41 * runemacs.c (WinMain): Support invocation of un-installed
@@ -70,7 +108,7 @@
70 108
712013-05-07 Paul Eggert <eggert@cs.ucla.edu> 1092013-05-07 Paul Eggert <eggert@cs.ucla.edu>
72 110
73 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295) 111 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
74 * config.nt (HAVE_ACL_SET_FILE): Rename from HAVE_POSIX_ACL. 112 * config.nt (HAVE_ACL_SET_FILE): Rename from HAVE_POSIX_ACL.
75 * inc/ms-w32.h (EOPNOTSUPP): New macro. 113 * inc/ms-w32.h (EOPNOTSUPP): New macro.
76 114
@@ -598,7 +636,7 @@
598 636
5992012-09-01 Daniel Colascione <dancol@dancol.org> 6372012-09-01 Daniel Colascione <dancol@dancol.org>
600 638
601 * inc/ms-w32.h (TERM_HEADER): Add for refactoring 639 * inc/ms-w32.h (TERM_HEADER): Add for refactoring.
602 640
6032012-08-22 Juanma Barranquero <lekktu@gmail.com> 6412012-08-22 Juanma Barranquero <lekktu@gmail.com>
604 642
@@ -896,8 +934,8 @@
896 (install-other-dirs-nmake, install-other-dirs-gmake): Depend on `all'. 934 (install-other-dirs-nmake, install-other-dirs-gmake): Depend on `all'.
897 (install-shortcuts): Depend on $(INSTALL_DIR)/bin. Copy addpm.exe 935 (install-shortcuts): Depend on $(INSTALL_DIR)/bin. Copy addpm.exe
898 here. 936 here.
899 (maybe-copy-distfiles-CMD, maybe-copy-distfiles-SH, dist): Depend 937 (maybe-copy-distfiles-CMD, maybe-copy-distfiles-SH, dist):
900 on create-tmp-dist-dir. 938 Depend on create-tmp-dist-dir.
901 939
902 * nmake.defs (DIRNAME): New variable. 940 * nmake.defs (DIRNAME): New variable.
903 (IFNOTSAMEDIR): Use $(DIRNAME)_same-dir.tst instead of 941 (IFNOTSAMEDIR): Use $(DIRNAME)_same-dir.tst instead of
diff --git a/nt/INSTALL.MSYS b/nt/INSTALL.MSYS
index e5b121ae868..420b8be75f8 100644
--- a/nt/INSTALL.MSYS
+++ b/nt/INSTALL.MSYS
@@ -52,7 +52,7 @@ Windows 9X as well).
52 You can pass other options to the configure script. Here's a 52 You can pass other options to the configure script. Here's a
53 typical example (for an in-place debug build): 53 typical example (for an in-place debug build):
54 54
55 CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=d:/usr/emacs --enable-checking 55 CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=/d/usr/emacs --enable-checking
56 56
57 3. After the configure script finishes, it should display the 57 3. After the configure script finishes, it should display the
58 resulting configuration. After that, type 58 resulting configuration. After that, type
@@ -92,9 +92,9 @@ Windows 9X as well).
92 92
93** Installing MinGW and MSYS using mingw-get 93** Installing MinGW and MSYS using mingw-get
94 94
95 A nice GUI installer, called mingw-get, is available for those who 95 A nice installer, called mingw-get, is available for those who don't
96 don't like to mess with manual installations. You can download it 96 like to mess with manual installations. You can download it from
97 from here: 97 here:
98 98
99 https://sourceforge.net/projects/mingw/files/Installer/mingw-get/ 99 https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
100 100
@@ -110,7 +110,6 @@ Windows 9X as well).
110 110
111 . msys-base 111 . msys-base
112 . mingw-developer-toolkit 112 . mingw-developer-toolkit
113 . msys-automake
114 113
115 (We recommend that you refrain from installing the MSYS Texinfo 114 (We recommend that you refrain from installing the MSYS Texinfo
116 package, which is part of msys-base, because it might produce mixed 115 package, which is part of msys-base, because it might produce mixed
@@ -188,11 +187,11 @@ Windows 9X as well).
188 187
189 Each package might list other packages as prerequisites on its 188 Each package might list other packages as prerequisites on its
190 download page (under "Runtime requirements"); download those as 189 download page (under "Runtime requirements"); download those as
191 well. (Using the GUI installer mingw-get will fetch those 190 well. (Using the mingw-get installer will fetch those prerequisites
192 prerequisites automatically for you.) A missing prerequisite will 191 automatically for you.) A missing prerequisite will manifest itself
193 manifest itself by the program failing to run and presenting a 192 by the program failing to run and presenting a pop-up dialog that
194 pop-up dialog that states the missing or incompatible DLL; be sure 193 states the missing or incompatible DLL; be sure to find and install
195 to find and install these missing DLLs. 194 these missing DLLs.
196 195
197 Once you think you have MinGW installed, test the installation by 196 Once you think you have MinGW installed, test the installation by
198 building a trivial "hello, world!" program, and make sure that it 197 building a trivial "hello, world!" program, and make sure that it
@@ -228,8 +227,8 @@ Windows 9X as well).
228 repository): Automake and Autoconf. They are available from 227 repository): Automake and Autoconf. They are available from
229 here: 228 here:
230 229
231 http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download 230 http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download
232 http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download 231 http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
233 232
234 MSYS packages are distributed as .tar.lzma compressed archives. To 233 MSYS packages are distributed as .tar.lzma compressed archives. To
235 install the packages manually, we recommend to use the Windows port 234 install the packages manually, we recommend to use the Windows port
@@ -244,7 +243,11 @@ Windows 9X as well).
244 These are snapshot builds of many packages, but you only need 243 These are snapshot builds of many packages, but you only need
245 make.exe from there. The advantage of this make.exe is that it 244 make.exe from there. The advantage of this make.exe is that it
246 supports parallel builds, so you can use "make -j N" to considerably 245 supports parallel builds, so you can use "make -j N" to considerably
247 speed up your builds 246 speed up your builds.
247
248 Several users reported that MSYS 1.0.18 causes Make to hang in
249 parallel builds. If you bump into this, we suggest to downgrade to
250 MSYS 1.0.17, which doesn't have that problem.
248 251
249 For each of these packages, install the 'bin' and 'dll' tarballs of 252 For each of these packages, install the 'bin' and 'dll' tarballs of
250 their latest stable releases. If there's an 'ext' tarball (e.g., 253 their latest stable releases. If there's an 'ext' tarball (e.g.,
@@ -252,11 +255,11 @@ Windows 9X as well).
252 255
253 Each package might list other packages as prerequisites on its 256 Each package might list other packages as prerequisites on its
254 download page (under "Runtime requirements"); download those as 257 download page (under "Runtime requirements"); download those as
255 well. (Using the GUI installer mingw-get will fetch those 258 well. (Using the mingw-get installer will fetch those prerequisites
256 prerequisites automatically for you.) A missing prerequisite will 259 automatically for you.) A missing prerequisite will manifest itself
257 manifest itself by the program failing to run and presenting a 260 by the program failing to run and presenting a pop-up dialog that
258 pop-up dialog that states the missing or incompatible DLL; be sure 261 states the missing or incompatible DLL; be sure to find and install
259 to find and install these missing DLLs. 262 these missing DLLs.
260 263
261 MSYS packages should be installed in a separate tree from MinGW. 264 MSYS packages should be installed in a separate tree from MinGW.
262 For example, use D:\MSYS or D:\usr\MSYS as the top-level directory 265 For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
@@ -325,18 +328,25 @@ Windows 9X as well).
325 ./nt/msysconfig.sh --prefix=PREFIX ... 328 ./nt/msysconfig.sh --prefix=PREFIX ...
326 329
327 Here PREFIX is the place where you eventually want to install Emacs 330 Here PREFIX is the place where you eventually want to install Emacs
328 once built, e.g. d:/usr. We recommend to always use --prefix when 331 once built, e.g. /d/usr. We recommend to always use --prefix when
329 building Emacs on Windows, because the default '/usr/local' is not 332 building Emacs on Windows, because the default '/usr/local' is not
330 appropriate for Windows: it will be mapped by MSYS to something like 333 appropriate for Windows: it will be mapped by MSYS to something like
331 C:\MSYS\local, and it will defeat the purpose of PREFIX, which is to 334 C:\MSYS\local, and it will defeat the purpose of PREFIX, which is to
332 install programs in a single coherent tree resembling Posix systems. 335 install programs in a single coherent tree resembling Posix systems.
333 Such a single-tree installation makes sure all the other programs 336 Such a single-tree installation makes sure all the other programs
334 and packages ported from GNU or Unix systems will work seemlessly 337 and packages ported from GNU or Unix systems will work seamlessly
335 together. Where exactly is the root of that tree on your system is 338 together. Where exactly is the root of that tree on your system is
336 something only you, the user who builds Emacs, can know, and the 339 something only you, the user who builds Emacs, can know, and the
337 Emacs build process cannot guess, because usually there's no 340 Emacs build process cannot guess, because usually there's no
338 '/usr/local' directory on any drive on Windows systems. 341 '/usr/local' directory on any drive on Windows systems.
339 342
343 Do NOT use Windows-style x:/foo/bar file names on the configure
344 script command line; use the MSYS-style /x/foo/bar instead. Using
345 Windows-style file names was reported to cause subtle and hard to
346 figure out problems during the build. This applies both to the
347 command switches, such as --prefix=, and to the absolute file name
348 of msysconfig.sh, if you are building outside of the source tree.
349
340 You can pass additional options to the configure script, for the 350 You can pass additional options to the configure script, for the
341 full list type 351 full list type
342 352
@@ -353,12 +363,21 @@ Windows 9X as well).
353 headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say 363 headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say
354 something like this: 364 something like this:
355 365
356 CPPFLAGS='-Ic:/emacs/libs/libpng-1.2.37-lib/include -Ic:/emacs/libs/jpeg-6b-4-lib/include' ./nt/msysconfig.sh --prefix=PREFIX 366 CPPFLAGS='-I/c/emacs/libs/libpng-1.2.37-lib/include -I/c/emacs/libs/jpeg-6b-4-lib/include' ./nt/msysconfig.sh --prefix=PREFIX
357 367
358 which is quite a mouth-full, especially if you have more directories 368 which is quite a mouth-full, especially if you have more directories
359 to specify... Perhaps you may wish to revisit your installation 369 to specify... Perhaps you may wish to revisit your installation
360 decisions now. 370 decisions now.
361 371
372 If you have a global site-lisp directory from previous Emacs
373 installation, and you want Emacs to continue using it, specify it
374 via the --enable-locallisppath switch to msysconfig.sh, like this:
375
376 ./nt/msysconfig.sh --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp"
377
378 Use the normal MSYS /d/foo/bar style to specify directories by their
379 absolute file names.
380
362 A few frequently used options are needed when you want to produce an 381 A few frequently used options are needed when you want to produce an
363 unoptimized binary with runtime checks enabled: 382 unoptimized binary with runtime checks enabled:
364 383
@@ -418,10 +437,11 @@ Windows 9X as well).
418 437
419 This is simple: just type "make" and sit back, watching the fun. 438 This is simple: just type "make" and sit back, watching the fun.
420 439
421 If you installed a snapshot build of Make, the build will be much 440 If you installed a snapshot build of Make, the build will be much
422 faster if you type "make -j N" instead, where N is the number of 441 faster if you type "make -j N" instead, where N is the number of
423 independent processing units on your machine. E.g., on a core i7 442 independent processing units on your machine. E.g., on a core i7
424 system try using N of 6 or even 8. 443 system try using N of 6 or even 8. (If this hangs, see the notes
444 above about downgrading to MSYS 1.0.17.)
425 445
426 When Make finishes, you can install the produced binaries: 446 When Make finishes, you can install the produced binaries:
427 447
@@ -520,12 +540,12 @@ Windows 9X as well).
520 compatible (for example, that they were built with the same compiler). 540 compatible (for example, that they were built with the same compiler).
521 541
522 Binaries for the image libraries (among many others) can be found at 542 Binaries for the image libraries (among many others) can be found at
523 the GnuWin32 project. PNG, JPEG and TIFF libraries are also 543 the GnuWin32 project. The PNG libraries are also included with GTK,
524 included with GTK, which is installed along with other Free Software 544 which is installed along with other Free Software that requires it.
525 that requires it. Note specifically that, due to some packaging 545 Note specifically that, due to some packaging snafus in the
526 snafus in the GnuWin32-supplied image libraries, you will need to 546 GnuWin32-supplied image libraries, you will need to download
527 download _source_ packages for some of the libraries in order to get 547 _source_ packages for some of the libraries in order to get the
528 the header files necessary for building Emacs with image support. 548 header files necessary for building Emacs with image support.
529 549
530 For PNG images, we recommend to use versions 1.4.x and later of 550 For PNG images, we recommend to use versions 1.4.x and later of
531 libpng, because previous versions had security issues. You can find 551 libpng, because previous versions had security issues. You can find
diff --git a/nt/Makefile.in b/nt/Makefile.in
index 3d5e1ca084c..7f68a1b83ad 100644
--- a/nt/Makefile.in
+++ b/nt/Makefile.in
@@ -168,7 +168,7 @@ uninstall:
168 fi 168 fi
169 169
170mostlyclean: 170mostlyclean:
171 -rm -f core *.o 171 -rm -f core *.o *.res
172 172
173clean: mostlyclean 173clean: mostlyclean
174 -rm -f ${EXE_FILES} 174 -rm -f ${EXE_FILES}
@@ -209,4 +209,4 @@ runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
209 -o runemacs${EXEEXT} 209 -o runemacs${EXEEXT}
210 210
211emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST) 211emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST)
212 ${WINDRES} -O coff -o emacs.res ${srcdir}/emacs.rc 212 ${WINDRES} -I ${srcdir} -O coff -o emacs.res ${srcdir}/emacs.rc
diff --git a/nt/config.nt b/nt/config.nt
index 4380f2b86c5..95b56f2dc64 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -547,6 +547,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
547/* Define to 1 if you have the `gettimeofday' function. */ 547/* Define to 1 if you have the `gettimeofday' function. */
548#define HAVE_GETTIMEOFDAY 1 548#define HAVE_GETTIMEOFDAY 1
549 549
550/* Define to 1 if using GFile. */
551#undef HAVE_GFILENOTIFY
552
550/* Define to 1 if you have the `get_current_dir_name' function. */ 553/* Define to 1 if you have the `get_current_dir_name' function. */
551#undef HAVE_GET_CURRENT_DIR_NAME 554#undef HAVE_GET_CURRENT_DIR_NAME
552 555
@@ -1141,6 +1144,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1141/* Define to 1 if you have the <vfork.h> header file. */ 1144/* Define to 1 if you have the <vfork.h> header file. */
1142#undef HAVE_VFORK_H 1145#undef HAVE_VFORK_H
1143 1146
1147/* Define to 1 to use w32notify. */
1148#define HAVE_W32NOTIFY 1
1149
1144/* Define to 1 if you have the <wchar.h> header file. */ 1150/* Define to 1 if you have the <wchar.h> header file. */
1145#undef HAVE_WCHAR_H 1151#undef HAVE_WCHAR_H
1146 1152
@@ -1497,6 +1503,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1497/* Define to nonzero if you want access control list support. */ 1503/* Define to nonzero if you want access control list support. */
1498#undef USE_ACL 1504#undef USE_ACL
1499 1505
1506/* Define to 1 if using file notifications. */
1507#define USE_FILE_NOTIFY 1
1508
1500/* Define to 1 if using GTK. */ 1509/* Define to 1 if using GTK. */
1501#undef USE_GTK 1510#undef USE_GTK
1502 1511
diff --git a/nt/epaths.nt b/nt/epaths.nt
index 1e418550d52..6e297476528 100644
--- a/nt/epaths.nt
+++ b/nt/epaths.nt
@@ -41,10 +41,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
41#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim" 41#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim"
42 42
43/* Like PATH_LOADSEARCH, but contains the non-standard pieces. 43/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
44 These are the site-lisp directories, typically something like 44 These are the site-lisp directories. Configure sets this to
45 ${locallisppath}, which typically defaults to something like:
45 <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp 46 <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp
46 Configure prepends any $locallisppath, as set by the 47 but can be overridden by the --enable-locallisppath argument.
47 --enable-locallisppath argument.
48 This is combined with PATH_LOADSEARCH to make the default load-path. 48 This is combined with PATH_LOADSEARCH to make the default load-path.
49 If the --no-site-lisp option is used, this piece is excluded. 49 If the --no-site-lisp option is used, this piece is excluded.
50*/ 50*/
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h
index 87ad9d3ff0d..f8fb022d221 100644
--- a/nt/inc/sys/time.h
+++ b/nt/inc/sys/time.h
@@ -8,7 +8,6 @@
8 8
9/* The guards are for MinGW64, which defines these structs on its 9/* The guards are for MinGW64, which defines these structs on its
10 system headers which are included by ms-w32.h. */ 10 system headers which are included by ms-w32.h. */
11#ifndef _W64
12/* Allow inclusion of sys/time.h and winsock2.h in any order. Needed 11/* Allow inclusion of sys/time.h and winsock2.h in any order. Needed
13 for running the configure test, which is only relevant to MinGW. */ 12 for running the configure test, which is only relevant to MinGW. */
14#ifndef _TIMEVAL_DEFINED 13#ifndef _TIMEVAL_DEFINED
@@ -25,9 +24,9 @@ struct timeval
25 ((tvp)->tv_usec cmp (uvp)->tv_usec)) 24 ((tvp)->tv_usec cmp (uvp)->tv_usec))
26#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 25#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
27#endif /* _TIMEVAL_DEFINED */ 26#endif /* _TIMEVAL_DEFINED */
28#endif /* _W64 */
29 27
30#ifndef _TIMEZONE_DEFINED 28#ifndef _TIMEZONE_DEFINED
29#define _TIMEZONE_DEFINED
31struct timezone 30struct timezone
32{ 31{
33 int tz_minuteswest; /* minutes west of Greenwich */ 32 int tz_minuteswest; /* minutes west of Greenwich */
@@ -35,10 +34,15 @@ struct timezone
35}; 34};
36#endif 35#endif
37 36
37
38/* This needs to be compatible with Posix signature, in order to pass 38/* This needs to be compatible with Posix signature, in order to pass
39 the configure test for the type of the second argument. See 39 the configure test for the type of the second argument; see
40 m4/gettimeofday.m4. */ 40 m4/gettimeofday.m4. We use '__restrict' here, rather than
41int gettimeofday (struct timeval *restrict, struct timezone *restrict); 41 'restrict', for the benefit of the old nt/configure.bat build,
42 which does not force the use of -std= switch to GCC, and that
43 causes compilation errors with 'restrict', which is a C99
44 extension. */
45int gettimeofday (struct timeval *__restrict, struct timezone *__restrict);
42 46
43#define ITIMER_REAL 0 47#define ITIMER_REAL 0
44#define ITIMER_PROF 1 48#define ITIMER_PROF 1
diff --git a/src/.gdbinit b/src/.gdbinit
index c4604e6e2b0..1bfc293c466 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -1150,17 +1150,18 @@ Print $ assuming it is a list font (font-spec, font-entity, or font-object).
1150end 1150end
1151 1151
1152define xbacktrace 1152define xbacktrace
1153 set $bt = backtrace_list 1153 set $bt = backtrace_top ()
1154 while $bt 1154 while backtrace_p ($bt)
1155 xgettype ($bt->function) 1155 set $fun = backtrace_function ($bt)
1156 xgettype $fun
1156 if $type == Lisp_Symbol 1157 if $type == Lisp_Symbol
1157 xprintsym ($bt->function) 1158 xprintsym $fun
1158 printf " (0x%x)\n", $bt->args 1159 printf " (0x%x)\n", backtrace_args ($bt)
1159 else 1160 else
1160 xgetptr $bt->function 1161 xgetptr $fun
1161 printf "0x%x ", $ptr 1162 printf "0x%x ", $ptr
1162 if $type == Lisp_Vectorlike 1163 if $type == Lisp_Vectorlike
1163 xgetptr ($bt->function) 1164 xgetptr $fun
1164 set $size = ((struct Lisp_Vector *) $ptr)->header.size 1165 set $size = ((struct Lisp_Vector *) $ptr)->header.size
1165 if ($size & PSEUDOVECTOR_FLAG) 1166 if ($size & PSEUDOVECTOR_FLAG)
1166 output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS) 1167 output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
@@ -1172,7 +1173,7 @@ define xbacktrace
1172 end 1173 end
1173 echo \n 1174 echo \n
1174 end 1175 end
1175 set $bt = $bt->next 1176 set $bt = backtrace_next ($bt)
1176 end 1177 end
1177end 1178end
1178document xbacktrace 1179document xbacktrace
@@ -1220,8 +1221,8 @@ end
1220 1221
1221# Show Lisp backtrace after normal backtrace. 1222# Show Lisp backtrace after normal backtrace.
1222define hookpost-backtrace 1223define hookpost-backtrace
1223 set $bt = backtrace_list 1224 set $bt = backtrace_top ()
1224 if $bt 1225 if backtrace_p ($bt)
1225 echo \n 1226 echo \n
1226 echo Lisp Backtrace:\n 1227 echo Lisp Backtrace:\n
1227 xbacktrace 1228 xbacktrace
diff --git a/src/ChangeLog b/src/ChangeLog
index b1f13e62b40..38eb460359c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,419 @@
12013-06-12 Xue Fuqiao <xfq.free@gmail.com>
2
3 * fileio.c (expand_file_name): Doc fix.
4
52013-06-11 Paul Eggert <eggert@cs.ucla.edu>
6
7 Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
8 * process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
9 Wait for self, not for 0. This can't hurt on GNU or similar
10 system, and may help with Cygwin.
11
12 * keyboard.c: Don't use PROP (...) as an lvalue.
13 (parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
14 Use set_prop (A, B), not PROP (A) = B.
15
162013-06-10 Eli Zaretskii <eliz@gnu.org>
17
18 * xdisp.c (get_it_property): Use it->window instead of generating
19 a Lisp object from it->w.
20
212013-06-09 Eli Zaretskii <eliz@gnu.org>
22
23 * xdisp.c (get_it_property): If it->object is a buffer, pass to
24 get-char-property the window that is being rendered, instead of
25 the buffer, to support window-specific overlays. (Bug#14575)
26 (compute_display_string_pos): When W is NULL, use the current
27 buffer as the object to pass to get-char-property.
28 (Fcurrent_bidi_paragraph_direction): Assign NULL to the window
29 pointer member of the bidi iterator, since no window is pertinent
30 to this function.
31
322013-06-08 Eli Zaretskii <eliz@gnu.org>
33
34 * bidi.c (bidi_fetch_char): Accept additional argument, the window
35 being displayed, and pass it to compute_display_string_pos.
36 (bidi_level_of_next_char, bidi_resolve_explicit_1)
37 (bidi_paragraph_init): All callers changed.
38
39 * xdisp.c (init_from_display_pos, init_iterator)
40 (handle_single_display_spec, next_overlay_string)
41 (get_overlay_strings_1, reseat_1, reseat_to_string)
42 (push_prefix_prop, Fcurrent_bidi_paragraph_direction):
43 Set bidi_it.w member from it->w.
44 (compute_display_string_pos): Accept additional argument, the
45 window being displayed, and pass it to Fget_char_property.
46 (Bug#14575)
47
48 * dispextern.h (struct bidi_it): New member w, the window being
49 displayed.
50 (compute_display_string_pos): Adjust prototype.
51
522013-06-08 Jan Djärv <jan.h.d@swipnet.se>
53
54 * xgselect.c: Remove unneeded include xterm.h.
55
56 * process.c (wait_reading_process_output): Check for NS before GLIB.
57 GLIB may be linked in due to rsvg, but ns_select must be called.
58
59 * xgselect.c (xg_select): Remove call to window_system_available
60 and g_main_context_pending at the top, so Gdk events (i.e. file
61 notify) are processed when Emacs is started with -nw.
62
632013-06-07 Eli Zaretskii <eliz@gnu.org>
64
65 * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
66 (ctagsfiles3): New variable, includes only *.m files.
67 (TAGS): Use an explicit language name in the regular expressions,
68 to avoid transformation of '/SOMETHING' by MSYS to
69 'c:\MSYS\SOMETHING'.
70
712013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
72
73 * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
74
752013-06-06 Eli Zaretskii <eliz@gnu.org>
76
77 * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
78 still need to set the mouse pointer shape and activate help-echo.
79 (Bug#14558)
80
812013-06-06 Paul Eggert <eggert@cs.ucla.edu>
82
83 A few porting etc. fixes for the new file monitor code.
84 See the thread containing
85 <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
86 * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
87 (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
88 (dir_monitor_callback, Fgfile_rm_watch):
89 Use assq_no_quit instead of Fassoc, for speed.
90 (dir_monitor_callback, Fgfile_rm_watch):
91 eassert that the monitor is a fixnum.
92 (dir_monitor_callback): No need for CDR_SAFE.
93 Simplify building of lisp with alternative tails.
94 (Fgfile_add_watch, Fgfile_rm_watch):
95 Do not assume glib functions set errno reliably on failure.
96 (Fgfile_add_watch): Check that the monitor survives the XIL trick,
97 and signal an error otherwise.
98 (Fgfile_rm_watch): Prefer CONSP to !NILP.
99 Use Fdelq instead of Fdelete, for speed.
100
1012013-06-05 Eli Zaretskii <eliz@gnu.org>
102
103 * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
104 don't insist on being invoked on a highlighted tool-bar button.
105 Avoids losing tool-bar functionality when mouse-highlight is nil.
106 (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
107 Don't highlight when mouse-highlight is nil.
108 (note_mouse_highlight): When mouse-highlight is nil, don't return
109 right away; instead, run tool-bar and mode-line highlight
110 subroutine, clear any existing highlight, and revert the mouse
111 pointer to its default shape. (Bug#14558)
112
1132013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
114
115 * lisp.mk (lisp): Add prog-mode.el.
116
1172013-06-05 Paul Eggert <eggert@cs.ucla.edu>
118
119 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
120 * process.c (dummy_handler): New function.
121 (lib_child_handler): New static var.
122 (handle_child_signal): Invoke it.
123 (catch_child_signal): If a library has set up a signal handler,
124 save it into lib_child_handler.
125 (init_process_emacs): If using glib and not on Windows, tickle glib's
126 child-handling code so that it initializes its private SIGCHLD handler.
127 * syssignal.h (SA_SIGINFO): Default to 0.
128 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
129 31; it should no longer be needed now.
130
1312013-06-05 Michael Albinus <michael.albinus@gmx.de>
132
133 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
134
135 * gfilenotify.c (globals_of_gfilenotify): New function.
136 (syms_of_gfilenotify): Move global initialization there.
137
138 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
139
1402013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
141
142 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
143 * keyboard.c (menu_bar_items, tool_bar_items):
144 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
145 not override local keymaps any more.
146
1472013-06-04 Eli Zaretskii <eliz@gnu.org>
148
149 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
150
1512013-06-03 Eli Zaretskii <eliz@gnu.org>
152
153 * w32console.c (initialize_w32_display): Return the dimensions of
154 the console window via 2 additional arguments, not via the current
155 frame. This avoids crashes due to overrunning the bounds of
156 frame's decode_mode_spec_buffer, which is not resized following
157 the change of the frame dimensions from the initial 10x10.
158
159 * w32term.h (w32_initialize_display_info): Adjust prototype.
160
161 * term.c (init_tty): Take dimensions of the frame from the values
162 returned by initialize_w32_display.
163
164 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
165 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
166 (LIBES): Add $(GFILENOTIFY_LIBS).
167
168 * w32inevt.c (handle_file_notifications): Add dummy implementation
169 for !HAVE_W32NOTIFY.
170
171 * w32term.c: Wrap code with HAVE_W32NOTIFY.
172
1732013-06-03 Jan Djärv <jan.h.d@swipnet.se>
174
175 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
176
177 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
178
179 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
180
1812013-06-03 Paul Eggert <eggert@cs.ucla.edu>
182
183 Fix minor problems found by static checking.
184 * data.c (pure_write_error):
185 Use xsignal2, not Fsignal, as Fsignal might return.
186 * eval.c (set_backtrace_debug_on_exit): Now static.
187 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
188 No longer inline. EXTERN_INLINE is needed only for functions
189 defined in .h files. Reindent function header as per GNU style.
190 (backtrace_p, backtrace_top, backtrace_next):
191 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
192 compiler or linker. Add extern decls to pacify gcc -Wall.
193 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
194 Now static.
195 * frame.c (free_monitors): Define only on platforms that need it.
196 * nsterm.m (ns_term_init):
197 * process.c (catch_child_signal):
198 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
199 defined on all porting targets these days.
200 * process.c, process.h (catch_child_signal):
201 Make it extern only if NS_IMPL_GNUSTEP is defined.
202
2032013-06-03 Eli Zaretskii <eliz@gnu.org>
204
205 * w32.c (gettimeofday): Make the signature identical to prototype
206 in nt/inc/sys/time.h.
207
2082013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
209
210 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
211 .gdbinit.
212
213 * keyboard.c (safe_run_hooks_error): Improve error message.
214
215 * data.c (pure_write_error): Add `object' argument.
216 * puresize.h (CHECK_IMPURE): Use it.
217
2182013-06-03 Michael Albinus <michael.albinus@gmx.de>
219
220 * Makefile.in (NOTIFY_OBJ): New variable.
221 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
222
223 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
224 Call syms_of_gfilenotify.
225
226 * gfilenotify.c: New file.
227
228 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
229 and Qfile_w32notify.
230 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
231 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
232
233 * lisp.h: Declare syms_of_gfilenotify.
234
235 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
236
2372013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
238
239 Merge the specpdl and backtrace stacks. Make the structure of the
240 specpdl entries more obvious via a tagged union of structs.
241 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
242 (enum specbind_tag): New enum.
243 (struct specbinding): Make it a tagged union of structs.
244 Add a case for backtrace records.
245 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
246 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
247 (backtrace_debug_on_exit): New accessors.
248 (struct backtrace): Remove.
249 (struct catchtag): Remove backlist field.
250 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
251 Move to eval.c.
252 (Flocal_variable_p): Speed up the common case where the binding is
253 already loaded.
254 * eval.c (backtrace_list): Remove.
255 (set_specpdl_symbol, set_specpdl_old_value): Remove.
256 (set_backtrace_args, set_backtrace_nargs)
257 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
258 (backtrace_next): New functions.
259 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
260 (unwind_to_catch, internal_lisp_condition_case)
261 (internal_condition_case, internal_condition_case_1)
262 (internal_condition_case_2, internal_condition_case_n): Don't bother
263 with backtrace_list any more.
264 (Fsignal): Adjust to new backtrace format.
265 (grow_specpdl): Move up.
266 (record_in_backtrace): New function.
267 (eval_sub, Ffuncall): Use it.
268 (apply_lambda): Adjust to new backtrace format.
269 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
270 data.c.
271 (specbind): Adjust to new specpdl format. Simplify.
272 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
273 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
274 backtrace format.
275 (mark_backtrace): Remove.
276 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
277 * xdisp.c (redisplay_internal): Use record_in_backtrace.
278 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
279 Use mark_specpdl.
280 * profiler.c (record_backtrace): Use get_backtrace.
281 (handle_profiler_signal): Use backtrace_top_function.
282 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
283 accessor functions.
284
2852013-06-02 Jan Djärv <jan.h.d@swipnet.se>
286
287 * process.h (catch_child_signal): Declare.
288
289 * process.c (catch_child_signal): New function.
290 (init_process_emacs): Call it.
291
292 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
293 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
294 NS_IMPL_COCOA.
295 (x_set_cursor_type): Remove declaration.
296 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
297 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
298 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
299 (ns_get_color): Use F suffix on float.
300 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
301 (ns_get_rgb_color): Remove.
302 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
303 (note_mouse_movement): x and y are CGFloat.
304 (ns_draw_fringe_bitmap): Remove unused rowY.
305 Change #if to COCOA && >= 10_6.
306 (ns_draw_window_cursor): Remove unused overspill.
307 (ns_draw_underwave): width and x are EamcsCGFloat.
308 (ns_draw_box): thickness is CGFloat.
309 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
310 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
311 if not in main thread.
312 (ns_get_pending_menu_title, ns_check_menu_open)
313 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
314 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
315 (sendFromMainThread:): New method.
316 (changeFont:): size is CGFloat.
317 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
318 Disable warning about permanent text.
319 (characterIndexForPoint:): Adjust return type depending on GNUStep
320 version.
321 (mouseDown:): delta is CGFloat.
322 (updateFrameSize): Remove unised variable f.
323 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
324 Cast float to EmacsCGFloat.
325 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
326 also to -1 when restoring.
327 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
328 inside NS_IMPL_COCOA.
329 (toggleFullScreen:): Put call to toggleFullScreen inside
330 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
331 (setPosition:portion:whole:): por is CGFloat.
332 (getMouseMotionPart:window:x:y:): Add F suffix to float.
333 (mouseDown:): Use CGFloat.
334 (mouseDragged:): Remove unised variable edge.
335 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
336
337 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
338 of CGFloat differs.
339 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
340 when NS_IMPL_GNUSTEP.
341 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
342 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
343 (EmacsToolbar): Add clearAll. Add tag argument to
344 addDisplayItemWithImage.
345 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
346
347 * nsselect.m (ns_get_local_selection): Remove unused variable type.
348
349 * nsmenu.m (ns_update_menubar): Make static.
350 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
351 (fillWithWidgetValue:): Add cast to SEL for setAction.
352 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
353 (update_frame_tool_bar): Update code for GNUStep.
354 (clearAll): New method.
355 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
356 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
357 Move identifierToItem setObject and activeIdentifiers addObject before
358 call to insertItemWithItemIdentifier.
359 (validateVisibleItems): Fix indentation.
360 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
361 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
362 UtilityWindow to aStyle, remove call to setStyleMask.
363
364 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
365
366 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
367 (ns_charset_covers, ns_get_covering_families, nsfont_open):
368 Use F suffix on floats.
369 (ns_char_width): Returns CGFloat.
370 (ns_ascii_average_width): w is CGFloat instead of float.
371 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
372 DPSxshow.
373 (ns_glyph_metrics): CGFloat instead of float.
374
375 * nsfns.m (x_set_foreground_color, x_set_background_color):
376 Use EmacsCGFloat.
377 (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
378 remove unused variables.
379 (Fns_read_file_name): Keep track if panel is for save.
380 Use ns_filename_from_panel/ns_directory_from_panel.
381 (Fns_list_services): delegate only used for COCOA.
382 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
383 Just return the input if GNUStep.
384 (x_screen_planes): Remove.
385 (Fxw_color_values): Use EmacsCGFloat
386 (Fns_display_monitor_attributes_list): Only get screen number for
387 Cocoa.
388 (getDirectory, getFilename): Removed from EmacsOpenPanel and
389 EmacsSavePanel.
390 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
391 ns_directory_from_panel.
392
3932013-06-01 Paul Eggert <eggert@cs.ucla.edu>
394
395 * process.c (handle_child_signal): Also use WCONTINUED.
396 This is so that list-processes doesn't mistakenly list the process
397 as stopped, when the process has actually been continued and is
398 now running.
399
4002013-05-31 Paul Eggert <eggert@cs.ucla.edu>
401
402 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
403 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
404 not already configured.
405
406 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
407
4082013-05-29 Eli Zaretskii <eliz@gnu.org>
409
410 * Makefile.in (mostlyclean): Remove *.res files.
411
4122013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
413
414 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
415 a buffer (bug#8447).
416
12013-05-27 Eli Zaretskii <eliz@gnu.org> 4172013-05-27 Eli Zaretskii <eliz@gnu.org>
2 418
3 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a 419 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
@@ -25,8 +441,8 @@
25 (struct MonitorInfo): New struct. 441 (struct MonitorInfo): New struct.
26 (free_monitors, make_monitor_attribute_list): Declare. 442 (free_monitors, make_monitor_attribute_list): Declare.
27 443
28 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New 444 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
29 Lisp_Object:s. 445 New Lisp_Object:s.
30 (free_monitors, make_monitor_attribute_list): New functions. 446 (free_monitors, make_monitor_attribute_list): New functions.
31 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes, 447 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
32 Qsource. 448 Qsource.
@@ -80,7 +496,7 @@
802013-05-21 Dmitry Antipov <dmantipov@yandex.ru> 4962013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
81 497
82 * xdisp.c (reseat_at_previous_visible_line_start): 498 * xdisp.c (reseat_at_previous_visible_line_start):
83 Already declared in dispextern.h, so remove it here. 499 Already declared in dispextern.h, so remove it here.
84 (move_it_vertically_backward): Likewise. 500 (move_it_vertically_backward): Likewise.
85 501
862013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 5022013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
@@ -91,7 +507,7 @@
91 Mention `display-monitor-attributes-list' in docstrings. 507 Mention `display-monitor-attributes-list' in docstrings.
92 508
93 * nsfns.m (ns_get_screen): Remove function. All uses removed. 509 * nsfns.m (ns_get_screen): Remove function. All uses removed.
94 (check_ns_display_info): Sync with check_x_display_info in xfns.c. 510 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
95 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version) 511 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
96 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height) 512 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
97 (Fx_display_backing_store, Fx_display_visual_class) 513 (Fx_display_backing_store, Fx_display_visual_class)
@@ -247,7 +663,7 @@
247 663
2482013-05-07 Paul Eggert <eggert@cs.ucla.edu> 6642013-05-07 Paul Eggert <eggert@cs.ucla.edu>
249 665
250 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295) 666 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
251 * Makefile.in (LIB_ACL): New macro. 667 * Makefile.in (LIB_ACL): New macro.
252 (LIBACL_LIBS): Remove. 668 (LIBACL_LIBS): Remove.
253 (LIBES): Use LIB_ACL, not LIBACL_LIBS. 669 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
@@ -2680,11 +3096,10 @@
26802012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change) 30962012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2681 3097
2682 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to 3098 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2683 determine whether scroll bar thumb size should be adjusted or 3099 determine whether scroll bar thumb size should be adjusted or not.
2684 not. Use variable for MOTIF. 3100 Use variable for MOTIF.
2685 3101
2686 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for 3102 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for GTK.
2687 GTK.
2688 3103
26892013-01-13 Jan Djärv <jan.h.d@swipnet.se> 31042013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2690 3105
@@ -3229,7 +3644,7 @@
3229 3644
32302012-12-14 Paul Eggert <eggert@cs.ucla.edu> 36452012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3231 3646
3232 Fix permissions bugs with setgid directories etc. (Bug#13125) 3647 Fix permissions bugs with setgid directories etc. (Bug#13125)
3233 * dired.c (Ffile_attributes): Return t as the 9th attribute, 3648 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3234 to mark it as a placeholder. The old value was often wrong. 3649 to mark it as a placeholder. The old value was often wrong.
3235 The only user of this attribute has been changed to use 3650 The only user of this attribute has been changed to use
@@ -3529,7 +3944,7 @@
3529 Use xputenv instead of setenv or putenv, to detect memory exhaustion. 3944 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3530 * editfns.c (initial_tz): Move static var decl up. 3945 * editfns.c (initial_tz): Move static var decl up.
3531 (tzvalbuf_in_environ): New static var. 3946 (tzvalbuf_in_environ): New static var.
3532 (init_editfns): Initialize these two static vars. 3947 (init_editfns): Initialize these two static vars.
3533 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width. 3948 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3534 Save old TZ value on stack, if it's small. 3949 Save old TZ value on stack, if it's small.
3535 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly; 3950 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
@@ -3808,7 +4223,7 @@
3808 Use execve to avoid need to munge environ (Bug#13054). 4223 Use execve to avoid need to munge environ (Bug#13054).
3809 * callproc.c (Fcall_process): 4224 * callproc.c (Fcall_process):
3810 * process.c (create_process): 4225 * process.c (create_process):
3811 Don't save and restore environ; no longer needed. 4226 Don't save and restore environ; no longer needed.
3812 * callproc.c (child_setup): 4227 * callproc.c (child_setup):
3813 Use execve, not execvp, to preserve environ. 4228 Use execve, not execvp, to preserve environ.
3814 4229
@@ -4330,7 +4745,7 @@
4330 * w32term.c (x_window_to_scroll_bar): Likewise. 4745 * w32term.c (x_window_to_scroll_bar): Likewise.
4331 * window.c (window_list): Likewise. 4746 * window.c (window_list): Likewise.
4332 * xdisp.c (x_consider_frame_title): Likewise. 4747 * xdisp.c (x_consider_frame_title): Likewise.
4333 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise. 4748 * xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
4334 * xfns.c (x_window_to_frame, x_any_window_to_frame) 4749 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4335 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise. 4750 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4336 * xmenu.c (menubar_id_to_frame): Likewise. 4751 * xmenu.c (menubar_id_to_frame): Likewise.
@@ -17562,7 +17977,7 @@
17562 17977
17563 Fix memory allocation problems in Cygwin build (Bug#9273). 17978 Fix memory allocation problems in Cygwin build (Bug#9273).
17564 17979
17565 * unexcw.c ( __malloc_initialized): Declare external variable. 17980 * unexcw.c (__malloc_initialized): Declare external variable.
17566 (fixup_executable): Force the dumped emacs to reinitialize malloc. 17981 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17567 17982
17568 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): 17983 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index 2f798e1f0bc..fb1b96f738c 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -15447,7 +15447,7 @@
15447 * xterm.c (XTread_socket_hook): For X11, on map and unmap events 15447 * xterm.c (XTread_socket_hook): For X11, on map and unmap events
15448 check the window manager hints for iconification status. 15448 check the window manager hints for iconification status.
15449 15449
15450 * xterm.c (x_make_widow_icon): For X11, just request 15450 * xterm.c (x_make_window_icon): For X11, just request
15451 iconification of the window manager. 15451 iconification of the window manager.
15452 15452
154531989-05-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) 154531989-05-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu)
diff --git a/src/Makefile.in b/src/Makefile.in
index 74a5bbcdd1b..3b5c736517f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -156,6 +156,13 @@ SETTINGS_LIBS = @SETTINGS_LIBS@
156## gtkutil.o if USE_GTK, else empty. 156## gtkutil.o if USE_GTK, else empty.
157GTK_OBJ=@GTK_OBJ@ 157GTK_OBJ=@GTK_OBJ@
158 158
159## gfilenotify.o if HAVE_GFILENOTIFY.
160## inotify.o if HAVE_INOTIFY.
161## w32notify.o if HAVE_W32NOTIFY.
162NOTIFY_OBJ = @NOTIFY_OBJ@
163GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
164GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
165
159## -ltermcap, or -lncurses, or -lcurses, or "". 166## -ltermcap, or -lncurses, or -lcurses, or "".
160LIBS_TERMCAP=@LIBS_TERMCAP@ 167LIBS_TERMCAP=@LIBS_TERMCAP@
161## terminfo.o if TERMINFO, else tparam.o. 168## terminfo.o if TERMINFO, else tparam.o.
@@ -200,10 +207,13 @@ LIBXMENU=@LIBXMENU@
200 207
201## xmenu.o if HAVE_X_WINDOWS, else empty. 208## xmenu.o if HAVE_X_WINDOWS, else empty.
202XMENU_OBJ=@XMENU_OBJ@ 209XMENU_OBJ=@XMENU_OBJ@
203## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o if 210## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o if
204## HAVE_X_WINDOWS, else empty. 211## HAVE_X_WINDOWS, else empty.
205XOBJ=@XOBJ@ 212XOBJ=@XOBJ@
206 213
214# xgselect.o if linking with GLib, else empty
215XGSELOBJ=@XGSELOBJ@
216
207TOOLKIT_LIBW=@TOOLKIT_LIBW@ 217TOOLKIT_LIBW=@TOOLKIT_LIBW@
208 218
209## Only used if HAVE_X11, in LIBX_OTHER. 219## Only used if HAVE_X11, in LIBX_OTHER.
@@ -344,7 +354,7 @@ ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \
344 $(WEBKIT_CFLAGS) $(CLUTTER_CFLAGS) $(GIR_CFLAGS) \ 354 $(WEBKIT_CFLAGS) $(CLUTTER_CFLAGS) $(GIR_CFLAGS) \
345 $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \ 355 $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
346 $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \ 356 $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \
347 $(LIBGNUTLS_CFLAGS) \ 357 $(LIBGNUTLS_CFLAGS) $(GFILENOTIFY_CFLAGS) \
348 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) 358 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
349ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS) 359ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
350 360
@@ -370,11 +380,11 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
370 syntax.o $(UNEXEC_OBJ) bytecode.o \ 380 syntax.o $(UNEXEC_OBJ) bytecode.o \
371 process.o gnutls.o callproc.o \ 381 process.o gnutls.o callproc.o \
372 region-cache.o sound.o atimer.o \ 382 region-cache.o sound.o atimer.o \
373 doprnt.o intervals.o textprop.o composite.o xml.o inotify.o \ 383 doprnt.o intervals.o textprop.o composite.o xml.o $(NOTIFY_OBJ) \
374 xwidget.o \ 384 xwidget.o \
375 profiler.o \ 385 profiler.o \
376 $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \ 386 $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
377 $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) 387 $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
378obj = $(base_obj) $(NS_OBJC_OBJ) 388obj = $(base_obj) $(NS_OBJC_OBJ)
379 389
380xwidget.o: xwidget.c xwidget.h 390xwidget.o: xwidget.c xwidget.h
@@ -429,7 +439,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
429 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ 439 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
430 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ 440 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
431 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \ 441 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
432 $(LIB_MATH) 442 $(GFILENOTIFY_LIBS) $(LIB_MATH)
433 443
434all: emacs$(EXEEXT) $(OTHER_FILES) 444all: emacs$(EXEEXT) $(OTHER_FILES)
435.PHONY: all 445.PHONY: all
@@ -557,6 +567,7 @@ mostlyclean:
557 rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT) 567 rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT)
558 rm -f buildobj.h 568 rm -f buildobj.h
559 rm -f globals.h gl-stamp 569 rm -f globals.h gl-stamp
570 rm -f *.res
560clean: mostlyclean 571clean: mostlyclean
561 rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) 572 rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT)
562 -rm -rf $(DEPDIR) 573 -rm -rf $(DEPDIR)
@@ -587,13 +598,16 @@ extraclean: distclean
587## Arrange to make a tags table TAGS-LISP for ../lisp, 598## Arrange to make a tags table TAGS-LISP for ../lisp,
588## plus TAGS for the C files, which includes ../lisp/TAGS by reference. 599## plus TAGS for the C files, which includes ../lisp/TAGS by reference.
589 600
590ctagsfiles1 = [xyzXYZ]*.[hcm] 601ctagsfiles1 = [xyzXYZ]*.[hc]
591ctagsfiles2 = [a-wA-W]*.[hcm] 602ctagsfiles2 = [a-wA-W]*.[hc]
603ctagsfiles3 = [a-zA-Z]*.m
592 604
593TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE) 605TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE)
594 ../lib-src/etags --include=TAGS-LISP --include=$(lwlibdir)/TAGS \ 606 ../lib-src/etags --include=TAGS-LISP --include=$(lwlibdir)/TAGS \
595 --regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \ 607 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
596 $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE) 608 $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE) \
609 --regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
610 $(srcdir)/$(ctagsfiles3)
597frc: 611frc:
598TAGS-LISP: frc 612TAGS-LISP: frc
599 $(MAKE) -f $(lispdir)/Makefile TAGS-LISP ETAGS=../lib-src/etags 613 $(MAKE) -f $(lispdir)/Makefile TAGS-LISP ETAGS=../lib-src/etags
diff --git a/src/alloc.c b/src/alloc.c
index 7a56c78e2ba..cce0fff4fd4 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5165,7 +5165,6 @@ returns nil, because real GC can't be done.
5165See Info node `(elisp)Garbage Collection'. */) 5165See Info node `(elisp)Garbage Collection'. */)
5166 (void) 5166 (void)
5167{ 5167{
5168 struct specbinding *bind;
5169 struct buffer *nextb; 5168 struct buffer *nextb;
5170 char stack_top_variable; 5169 char stack_top_variable;
5171 ptrdiff_t i; 5170 ptrdiff_t i;
@@ -5174,7 +5173,6 @@ See Info node `(elisp)Garbage Collection'. */)
5174 EMACS_TIME start; 5173 EMACS_TIME start;
5175 Lisp_Object retval = Qnil; 5174 Lisp_Object retval = Qnil;
5176 size_t tot_before = 0; 5175 size_t tot_before = 0;
5177 struct backtrace backtrace;
5178 5176
5179 if (abort_on_gc) 5177 if (abort_on_gc)
5180 emacs_abort (); 5178 emacs_abort ();
@@ -5185,12 +5183,7 @@ See Info node `(elisp)Garbage Collection'. */)
5185 return Qnil; 5183 return Qnil;
5186 5184
5187 /* Record this function, so it appears on the profiler's backtraces. */ 5185 /* Record this function, so it appears on the profiler's backtraces. */
5188 backtrace.next = backtrace_list; 5186 record_in_backtrace (Qautomatic_gc, &Qnil, 0);
5189 backtrace.function = Qautomatic_gc;
5190 backtrace.args = &Qnil;
5191 backtrace.nargs = 0;
5192 backtrace.debug_on_exit = 0;
5193 backtrace_list = &backtrace;
5194 5187
5195 check_cons_list (); 5188 check_cons_list ();
5196 5189
@@ -5257,11 +5250,7 @@ See Info node `(elisp)Garbage Collection'. */)
5257 for (i = 0; i < staticidx; i++) 5250 for (i = 0; i < staticidx; i++)
5258 mark_object (*staticvec[i]); 5251 mark_object (*staticvec[i]);
5259 5252
5260 for (bind = specpdl; bind != specpdl_ptr; bind++) 5253 mark_specpdl ();
5261 {
5262 mark_object (bind->symbol);
5263 mark_object (bind->old_value);
5264 }
5265 mark_terminals (); 5254 mark_terminals ();
5266 mark_kboards (); 5255 mark_kboards ();
5267 5256
@@ -5295,7 +5284,6 @@ See Info node `(elisp)Garbage Collection'. */)
5295 mark_object (handler->var); 5284 mark_object (handler->var);
5296 } 5285 }
5297 } 5286 }
5298 mark_backtrace ();
5299#endif 5287#endif
5300 5288
5301#ifdef HAVE_WINDOW_SYSTEM 5289#ifdef HAVE_WINDOW_SYSTEM
@@ -5486,7 +5474,6 @@ See Info node `(elisp)Garbage Collection'. */)
5486 malloc_probe (swept); 5474 malloc_probe (swept);
5487 } 5475 }
5488 5476
5489 backtrace_list = backtrace.next;
5490 return retval; 5477 return retval;
5491} 5478}
5492 5479
diff --git a/src/bidi.c b/src/bidi.c
index c6bea62f67b..c31d208ecbc 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -927,6 +927,7 @@ bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte)
927static int 927static int
928bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos, 928bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos,
929 int *disp_prop, struct bidi_string_data *string, 929 int *disp_prop, struct bidi_string_data *string,
930 struct window *w,
930 bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) 931 bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars)
931{ 932{
932 int ch; 933 int ch;
@@ -940,7 +941,7 @@ bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos,
940 if (charpos < endpos && charpos > *disp_pos) 941 if (charpos < endpos && charpos > *disp_pos)
941 { 942 {
942 SET_TEXT_POS (pos, charpos, bytepos); 943 SET_TEXT_POS (pos, charpos, bytepos);
943 *disp_pos = compute_display_string_pos (&pos, string, frame_window_p, 944 *disp_pos = compute_display_string_pos (&pos, string, w, frame_window_p,
944 disp_prop); 945 disp_prop);
945 } 946 }
946 947
@@ -1045,7 +1046,7 @@ bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos,
1045 && *disp_prop) 1046 && *disp_prop)
1046 { 1047 {
1047 SET_TEXT_POS (pos, charpos + *nchars, bytepos + *ch_len); 1048 SET_TEXT_POS (pos, charpos + *nchars, bytepos + *ch_len);
1048 *disp_pos = compute_display_string_pos (&pos, string, frame_window_p, 1049 *disp_pos = compute_display_string_pos (&pos, string, w, frame_window_p,
1049 disp_prop); 1050 disp_prop);
1050 } 1051 }
1051 1052
@@ -1224,7 +1225,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p)
1224 if (!string_p) 1225 if (!string_p)
1225 pos = BYTE_TO_CHAR (bytepos); 1226 pos = BYTE_TO_CHAR (bytepos);
1226 ch = bidi_fetch_char (pos, bytepos, &disp_pos, &disp_prop, 1227 ch = bidi_fetch_char (pos, bytepos, &disp_pos, &disp_prop,
1227 &bidi_it->string, 1228 &bidi_it->string, bidi_it->w,
1228 bidi_it->frame_window_p, &ch_len, &nchars); 1229 bidi_it->frame_window_p, &ch_len, &nchars);
1229 type = bidi_get_type (ch, NEUTRAL_DIR); 1230 type = bidi_get_type (ch, NEUTRAL_DIR);
1230 1231
@@ -1252,7 +1253,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p)
1252 break; 1253 break;
1253 /* Fetch next character and advance to get past it. */ 1254 /* Fetch next character and advance to get past it. */
1254 ch = bidi_fetch_char (pos, bytepos, &disp_pos, 1255 ch = bidi_fetch_char (pos, bytepos, &disp_pos,
1255 &disp_prop, &bidi_it->string, 1256 &disp_prop, &bidi_it->string, bidi_it->w,
1256 bidi_it->frame_window_p, &ch_len, &nchars); 1257 bidi_it->frame_window_p, &ch_len, &nchars);
1257 pos += nchars; 1258 pos += nchars;
1258 bytepos += ch_len; 1259 bytepos += ch_len;
@@ -1402,7 +1403,8 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it)
1402 a single character u+FFFC. */ 1403 a single character u+FFFC. */
1403 curchar = bidi_fetch_char (bidi_it->charpos, bidi_it->bytepos, 1404 curchar = bidi_fetch_char (bidi_it->charpos, bidi_it->bytepos,
1404 &bidi_it->disp_pos, &bidi_it->disp_prop, 1405 &bidi_it->disp_pos, &bidi_it->disp_prop,
1405 &bidi_it->string, bidi_it->frame_window_p, 1406 &bidi_it->string, bidi_it->w,
1407 bidi_it->frame_window_p,
1406 &bidi_it->ch_len, &bidi_it->nchars); 1408 &bidi_it->ch_len, &bidi_it->nchars);
1407 } 1409 }
1408 bidi_it->ch = curchar; 1410 bidi_it->ch = curchar;
@@ -2194,7 +2196,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
2194 emacs_abort (); 2196 emacs_abort ();
2195 do { 2197 do {
2196 ch = bidi_fetch_char (cpos += nc, bpos += clen, &disp_pos, &dpp, &bs, 2198 ch = bidi_fetch_char (cpos += nc, bpos += clen, &disp_pos, &dpp, &bs,
2197 fwp, &clen, &nc); 2199 bidi_it->w, fwp, &clen, &nc);
2198 if (ch == '\n' || ch == BIDI_EOB) 2200 if (ch == '\n' || ch == BIDI_EOB)
2199 chtype = NEUTRAL_B; 2201 chtype = NEUTRAL_B;
2200 else 2202 else
diff --git a/src/data.c b/src/data.c
index 6622088b648..9f756de014a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -100,9 +100,9 @@ wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
100} 100}
101 101
102void 102void
103pure_write_error (void) 103pure_write_error (Lisp_Object obj)
104{ 104{
105 error ("Attempt to modify read-only object"); 105 xsignal2 (Qerror, build_string ("Attempt to modify read-only object"), obj);
106} 106}
107 107
108void 108void
@@ -1069,40 +1069,6 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
1069 return newval; 1069 return newval;
1070} 1070}
1071 1071
1072/* Return true if SYMBOL currently has a let-binding
1073 which was made in the buffer that is now current. */
1074
1075static bool
1076let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
1077{
1078 struct specbinding *p;
1079
1080 for (p = specpdl_ptr; p > specpdl; )
1081 if ((--p)->func == NULL
1082 && CONSP (p->symbol))
1083 {
1084 struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol));
1085 eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS);
1086 if (symbol == let_bound_symbol
1087 && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer)
1088 return 1;
1089 }
1090
1091 return 0;
1092}
1093
1094static bool
1095let_shadows_global_binding_p (Lisp_Object symbol)
1096{
1097 struct specbinding *p;
1098
1099 for (p = specpdl_ptr; p > specpdl; )
1100 if ((--p)->func == NULL && EQ (p->symbol, symbol))
1101 return 1;
1102
1103 return 0;
1104}
1105
1106/* Store the value NEWVAL into SYMBOL. 1072/* Store the value NEWVAL into SYMBOL.
1107 If buffer/frame-locality is an issue, WHERE specifies which context to use. 1073 If buffer/frame-locality is an issue, WHERE specifies which context to use.
1108 (nil stands for the current buffer/frame). 1074 (nil stands for the current buffer/frame).
@@ -1841,17 +1807,18 @@ BUFFER defaults to the current buffer. */)
1841 XSETBUFFER (tmp, buf); 1807 XSETBUFFER (tmp, buf);
1842 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ 1808 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
1843 1809
1844 for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) 1810 if (EQ (blv->where, tmp)) /* The binding is already loaded. */
1845 { 1811 return blv_found (blv) ? Qt : Qnil;
1846 elt = XCAR (tail); 1812 else
1847 if (EQ (variable, XCAR (elt))) 1813 for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
1848 { 1814 {
1849 eassert (!blv->frame_local); 1815 elt = XCAR (tail);
1850 eassert (blv_found (blv) || !EQ (blv->where, tmp)); 1816 if (EQ (variable, XCAR (elt)))
1851 return Qt; 1817 {
1852 } 1818 eassert (!blv->frame_local);
1853 } 1819 return Qt;
1854 eassert (!blv_found (blv) || !EQ (blv->where, tmp)); 1820 }
1821 }
1855 return Qnil; 1822 return Qnil;
1856 } 1823 }
1857 case SYMBOL_FORWARDED: 1824 case SYMBOL_FORWARDED:
diff --git a/src/dispextern.h b/src/dispextern.h
index 9536d204c43..a0303483803 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1891,6 +1891,7 @@ struct bidi_it {
1891 stuff that is not part of the bidi iterator's state! */ 1891 stuff that is not part of the bidi iterator's state! */
1892 struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */ 1892 struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */
1893 struct bidi_string_data string; /* string to reorder */ 1893 struct bidi_string_data string; /* string to reorder */
1894 struct window *w; /* the window being displayed */
1894 bidi_dir_t paragraph_dir; /* current paragraph direction */ 1895 bidi_dir_t paragraph_dir; /* current paragraph direction */
1895 ptrdiff_t separator_limit; /* where paragraph separator should end */ 1896 ptrdiff_t separator_limit; /* where paragraph separator should end */
1896 unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */ 1897 unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */
@@ -3105,7 +3106,7 @@ extern void reseat_at_previous_visible_line_start (struct it *);
3105extern Lisp_Object lookup_glyphless_char_display (int, struct it *); 3106extern Lisp_Object lookup_glyphless_char_display (int, struct it *);
3106extern ptrdiff_t compute_display_string_pos (struct text_pos *, 3107extern ptrdiff_t compute_display_string_pos (struct text_pos *,
3107 struct bidi_string_data *, 3108 struct bidi_string_data *,
3108 int, int *); 3109 struct window *, int, int *);
3109extern ptrdiff_t compute_display_string_end (ptrdiff_t, 3110extern ptrdiff_t compute_display_string_end (ptrdiff_t,
3110 struct bidi_string_data *); 3111 struct bidi_string_data *);
3111extern void produce_stretch_glyph (struct it *); 3112extern void produce_stretch_glyph (struct it *);
diff --git a/src/doc.c b/src/doc.c
index e45481944f0..155a9891303 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -758,9 +758,7 @@ Otherwise, return a new string, without any text properties. */)
758 or a specified local map (which means search just that and the 758 or a specified local map (which means search just that and the
759 global map). If non-nil, it might come from Voverriding_local_map, 759 global map). If non-nil, it might come from Voverriding_local_map,
760 or from a \\<mapname> construct in STRING itself.. */ 760 or from a \\<mapname> construct in STRING itself.. */
761 keymap = KVAR (current_kboard, Voverriding_terminal_local_map); 761 keymap = Voverriding_local_map;
762 if (NILP (keymap))
763 keymap = Voverriding_local_map;
764 762
765 bsize = SBYTES (string); 763 bsize = SBYTES (string);
766 bufp = buf = xmalloc (bsize); 764 bufp = buf = xmalloc (bsize);
diff --git a/src/emacs.c b/src/emacs.c
index e2889f1adf5..45d679d1706 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1253,9 +1253,15 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1253 tzset (); 1253 tzset ();
1254#endif /* MSDOS */ 1254#endif /* MSDOS */
1255 1255
1256#ifdef HAVE_GFILENOTIFY
1257 globals_of_gfilenotify ();
1258#endif
1259
1256#ifdef WINDOWSNT 1260#ifdef WINDOWSNT
1257 globals_of_w32 (); 1261 globals_of_w32 ();
1262#ifdef HAVE_W32NOTIFY
1258 globals_of_w32notify (); 1263 globals_of_w32notify ();
1264#endif
1259 /* Initialize environment from registry settings. */ 1265 /* Initialize environment from registry settings. */
1260 init_environment (argv); 1266 init_environment (argv);
1261 init_ntproc (dumping); /* must precede init_editfns. */ 1267 init_ntproc (dumping); /* must precede init_editfns. */
@@ -1415,6 +1421,10 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1415 syms_of_gnutls (); 1421 syms_of_gnutls ();
1416#endif 1422#endif
1417 1423
1424#ifdef HAVE_GFILENOTIFY
1425 syms_of_gfilenotify ();
1426#endif /* HAVE_GFILENOTIFY */
1427
1418#ifdef HAVE_INOTIFY 1428#ifdef HAVE_INOTIFY
1419 syms_of_inotify (); 1429 syms_of_inotify ();
1420#endif /* HAVE_INOTIFY */ 1430#endif /* HAVE_INOTIFY */
@@ -1425,7 +1435,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1425 1435
1426#ifdef WINDOWSNT 1436#ifdef WINDOWSNT
1427 syms_of_ntterm (); 1437 syms_of_ntterm ();
1438#ifdef HAVE_W32NOTIFY
1428 syms_of_w32notify (); 1439 syms_of_w32notify ();
1440#endif /* HAVE_W32NOTIFY */
1429#endif /* WINDOWSNT */ 1441#endif /* WINDOWSNT */
1430 1442
1431 syms_of_profiler (); 1443 syms_of_profiler ();
diff --git a/src/epaths.in b/src/epaths.in
index 0cf8cc9ce5b..1f5701e5337 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -30,10 +30,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31 31
32/* Like PATH_LOADSEARCH, but contains the non-standard pieces. 32/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
33 These are the site-lisp directories, typically something like 33 These are the site-lisp directories. Configure sets this to
34 ${locallisppath}, which typically defaults to something like:
34 <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp 35 <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp
35 Configure prepends any $locallisppath, as set by the 36 but can be overridden by the --enable-locallisppath argument.
36 --enable-locallisppath argument.
37 This is combined with PATH_LOADSEARCH to make the default load-path. 37 This is combined with PATH_LOADSEARCH to make the default load-path.
38 If the --no-site-lisp option is used, this piece is excluded. 38 If the --no-site-lisp option is used, this piece is excluded.
39*/ 39*/
diff --git a/src/eval.c b/src/eval.c
index 69483a9b205..d1d074df777 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -32,8 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include "xterm.h" 32#include "xterm.h"
33#endif 33#endif
34 34
35struct backtrace *backtrace_list;
36
37#if !BYTE_MARK_STACK 35#if !BYTE_MARK_STACK
38static 36static
39#endif 37#endif
@@ -105,7 +103,7 @@ static EMACS_INT when_entered_debugger;
105 103
106/* The function from which the last `signal' was called. Set in 104/* The function from which the last `signal' was called. Set in
107 Fsignal. */ 105 Fsignal. */
108 106/* FIXME: We should probably get rid of this! */
109Lisp_Object Vsignaling_function; 107Lisp_Object Vsignaling_function;
110 108
111/* If non-nil, Lisp code must not be run since some part of Emacs is 109/* If non-nil, Lisp code must not be run since some part of Emacs is
@@ -117,20 +115,48 @@ Lisp_Object inhibit_lisp_code;
117static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); 115static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *);
118static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); 116static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
119 117
120/* Functions to set Lisp_Object slots of struct specbinding. */ 118/* Functions to modify slots of backtrace records. */
119
120static void
121set_backtrace_args (struct specbinding *pdl, Lisp_Object *args)
122{ eassert (pdl->kind == SPECPDL_BACKTRACE); pdl->v.bt.args = args; }
123
124static void
125set_backtrace_nargs (struct specbinding *pdl, ptrdiff_t n)
126{ eassert (pdl->kind == SPECPDL_BACKTRACE); pdl->v.bt.nargs = n; }
121 127
122static void 128static void
123set_specpdl_symbol (Lisp_Object symbol) 129set_backtrace_debug_on_exit (struct specbinding *pdl, bool doe)
130{ eassert (pdl->kind == SPECPDL_BACKTRACE); pdl->v.bt.debug_on_exit = doe; }
131
132/* Helper functions to scan the backtrace. */
133
134bool backtrace_p (struct specbinding *) EXTERNALLY_VISIBLE;
135struct specbinding *backtrace_top (void) EXTERNALLY_VISIBLE;
136struct specbinding *backtrace_next (struct specbinding *pdl) EXTERNALLY_VISIBLE;
137
138bool backtrace_p (struct specbinding *pdl)
139{ return pdl >= specpdl; }
140
141struct specbinding *
142backtrace_top (void)
124{ 143{
125 specpdl_ptr->symbol = symbol; 144 struct specbinding *pdl = specpdl_ptr - 1;
145 while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
146 pdl--;
147 return pdl;
126} 148}
127 149
128static void 150struct specbinding *
129set_specpdl_old_value (Lisp_Object oldval) 151backtrace_next (struct specbinding *pdl)
130{ 152{
131 specpdl_ptr->old_value = oldval; 153 pdl--;
154 while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
155 pdl--;
156 return pdl;
132} 157}
133 158
159
134void 160void
135init_eval_once (void) 161init_eval_once (void)
136{ 162{
@@ -151,7 +177,6 @@ init_eval (void)
151 specpdl_ptr = specpdl; 177 specpdl_ptr = specpdl;
152 catchlist = 0; 178 catchlist = 0;
153 handlerlist = 0; 179 handlerlist = 0;
154 backtrace_list = 0;
155 Vquit_flag = Qnil; 180 Vquit_flag = Qnil;
156 debug_on_next_call = 0; 181 debug_on_next_call = 0;
157 lisp_eval_depth = 0; 182 lisp_eval_depth = 0;
@@ -234,7 +259,7 @@ static void
234do_debug_on_call (Lisp_Object code) 259do_debug_on_call (Lisp_Object code)
235{ 260{
236 debug_on_next_call = 0; 261 debug_on_next_call = 0;
237 backtrace_list->debug_on_exit = 1; 262 set_backtrace_debug_on_exit (specpdl_ptr - 1, true);
238 call_debugger (Fcons (code, Qnil)); 263 call_debugger (Fcons (code, Qnil));
239} 264}
240 265
@@ -530,9 +555,8 @@ The return value is BASE-VARIABLE. */)
530 struct specbinding *p; 555 struct specbinding *p;
531 556
532 for (p = specpdl_ptr; p > specpdl; ) 557 for (p = specpdl_ptr; p > specpdl; )
533 if ((--p)->func == NULL 558 if ((--p)->kind >= SPECPDL_LET
534 && (EQ (new_alias, 559 && (EQ (new_alias, specpdl_symbol (p))))
535 CONSP (p->symbol) ? XCAR (p->symbol) : p->symbol)))
536 error ("Don't know how to make a let-bound variable an alias"); 560 error ("Don't know how to make a let-bound variable an alias");
537 } 561 }
538 562
@@ -597,8 +621,9 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
597 struct specbinding *pdl = specpdl_ptr; 621 struct specbinding *pdl = specpdl_ptr;
598 while (pdl > specpdl) 622 while (pdl > specpdl)
599 { 623 {
600 if (EQ ((--pdl)->symbol, sym) && !pdl->func 624 if ((--pdl)->kind >= SPECPDL_LET
601 && EQ (pdl->old_value, Qunbound)) 625 && EQ (specpdl_symbol (pdl), sym)
626 && EQ (specpdl_old_value (pdl), Qunbound))
602 { 627 {
603 message_with_string 628 message_with_string
604 ("Warning: defvar ignored because %s is let-bound", 629 ("Warning: defvar ignored because %s is let-bound",
@@ -937,7 +962,7 @@ usage: (catch TAG BODY...) */)
937 962
938/* Set up a catch, then call C function FUNC on argument ARG. 963/* Set up a catch, then call C function FUNC on argument ARG.
939 FUNC should return a Lisp_Object. 964 FUNC should return a Lisp_Object.
940 This is how catches are done from within C code. */ 965 This is how catches are done from within C code. */
941 966
942Lisp_Object 967Lisp_Object
943internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object arg) 968internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object arg)
@@ -949,7 +974,6 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object
949 c.next = catchlist; 974 c.next = catchlist;
950 c.tag = tag; 975 c.tag = tag;
951 c.val = Qnil; 976 c.val = Qnil;
952 c.backlist = backtrace_list;
953 c.handlerlist = handlerlist; 977 c.handlerlist = handlerlist;
954 c.lisp_eval_depth = lisp_eval_depth; 978 c.lisp_eval_depth = lisp_eval_depth;
955 c.pdlcount = SPECPDL_INDEX (); 979 c.pdlcount = SPECPDL_INDEX ();
@@ -1014,7 +1038,6 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value)
1014#ifdef DEBUG_GCPRO 1038#ifdef DEBUG_GCPRO
1015 gcpro_level = gcprolist ? gcprolist->level + 1 : 0; 1039 gcpro_level = gcprolist ? gcprolist->level + 1 : 0;
1016#endif 1040#endif
1017 backtrace_list = catch->backlist;
1018 lisp_eval_depth = catch->lisp_eval_depth; 1041 lisp_eval_depth = catch->lisp_eval_depth;
1019 1042
1020 sys_longjmp (catch->jmp, 1); 1043 sys_longjmp (catch->jmp, 1);
@@ -1115,7 +1138,6 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
1115 1138
1116 c.tag = Qnil; 1139 c.tag = Qnil;
1117 c.val = Qnil; 1140 c.val = Qnil;
1118 c.backlist = backtrace_list;
1119 c.handlerlist = handlerlist; 1141 c.handlerlist = handlerlist;
1120 c.lisp_eval_depth = lisp_eval_depth; 1142 c.lisp_eval_depth = lisp_eval_depth;
1121 c.pdlcount = SPECPDL_INDEX (); 1143 c.pdlcount = SPECPDL_INDEX ();
@@ -1131,7 +1153,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
1131 1153
1132 /* Note that this just undoes the binding of h.var; whoever 1154 /* Note that this just undoes the binding of h.var; whoever
1133 longjumped to us unwound the stack to c.pdlcount before 1155 longjumped to us unwound the stack to c.pdlcount before
1134 throwing. */ 1156 throwing. */
1135 unbind_to (c.pdlcount, Qnil); 1157 unbind_to (c.pdlcount, Qnil);
1136 return val; 1158 return val;
1137 } 1159 }
@@ -1170,7 +1192,6 @@ internal_condition_case (Lisp_Object (*bfun) (void), Lisp_Object handlers,
1170 1192
1171 c.tag = Qnil; 1193 c.tag = Qnil;
1172 c.val = Qnil; 1194 c.val = Qnil;
1173 c.backlist = backtrace_list;
1174 c.handlerlist = handlerlist; 1195 c.handlerlist = handlerlist;
1175 c.lisp_eval_depth = lisp_eval_depth; 1196 c.lisp_eval_depth = lisp_eval_depth;
1176 c.pdlcount = SPECPDL_INDEX (); 1197 c.pdlcount = SPECPDL_INDEX ();
@@ -1208,7 +1229,6 @@ internal_condition_case_1 (Lisp_Object (*bfun) (Lisp_Object), Lisp_Object arg,
1208 1229
1209 c.tag = Qnil; 1230 c.tag = Qnil;
1210 c.val = Qnil; 1231 c.val = Qnil;
1211 c.backlist = backtrace_list;
1212 c.handlerlist = handlerlist; 1232 c.handlerlist = handlerlist;
1213 c.lisp_eval_depth = lisp_eval_depth; 1233 c.lisp_eval_depth = lisp_eval_depth;
1214 c.pdlcount = SPECPDL_INDEX (); 1234 c.pdlcount = SPECPDL_INDEX ();
@@ -1250,7 +1270,6 @@ internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object),
1250 1270
1251 c.tag = Qnil; 1271 c.tag = Qnil;
1252 c.val = Qnil; 1272 c.val = Qnil;
1253 c.backlist = backtrace_list;
1254 c.handlerlist = handlerlist; 1273 c.handlerlist = handlerlist;
1255 c.lisp_eval_depth = lisp_eval_depth; 1274 c.lisp_eval_depth = lisp_eval_depth;
1256 c.pdlcount = SPECPDL_INDEX (); 1275 c.pdlcount = SPECPDL_INDEX ();
@@ -1294,7 +1313,6 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *),
1294 1313
1295 c.tag = Qnil; 1314 c.tag = Qnil;
1296 c.val = Qnil; 1315 c.val = Qnil;
1297 c.backlist = backtrace_list;
1298 c.handlerlist = handlerlist; 1316 c.handlerlist = handlerlist;
1299 c.lisp_eval_depth = lisp_eval_depth; 1317 c.lisp_eval_depth = lisp_eval_depth;
1300 c.pdlcount = SPECPDL_INDEX (); 1318 c.pdlcount = SPECPDL_INDEX ();
@@ -1362,7 +1380,6 @@ See also the function `condition-case'. */)
1362 = (NILP (error_symbol) ? Fcar (data) : error_symbol); 1380 = (NILP (error_symbol) ? Fcar (data) : error_symbol);
1363 register Lisp_Object clause = Qnil; 1381 register Lisp_Object clause = Qnil;
1364 struct handler *h; 1382 struct handler *h;
1365 struct backtrace *bp;
1366 1383
1367 immediate_quit = 0; 1384 immediate_quit = 0;
1368 abort_on_gc = 0; 1385 abort_on_gc = 0;
@@ -1398,13 +1415,13 @@ See also the function `condition-case'. */)
1398 too. Don't do this when ERROR_SYMBOL is nil, because that 1415 too. Don't do this when ERROR_SYMBOL is nil, because that
1399 is a memory-full error. */ 1416 is a memory-full error. */
1400 Vsignaling_function = Qnil; 1417 Vsignaling_function = Qnil;
1401 if (backtrace_list && !NILP (error_symbol)) 1418 if (!NILP (error_symbol))
1402 { 1419 {
1403 bp = backtrace_list->next; 1420 struct specbinding *pdl = backtrace_next (backtrace_top ());
1404 if (bp && EQ (bp->function, Qerror)) 1421 if (backtrace_p (pdl) && EQ (backtrace_function (pdl), Qerror))
1405 bp = bp->next; 1422 pdl = backtrace_next (pdl);
1406 if (bp) 1423 if (backtrace_p (pdl))
1407 Vsignaling_function = bp->function; 1424 Vsignaling_function = backtrace_function (pdl);
1408 } 1425 }
1409 1426
1410 for (h = handlerlist; h; h = h->next) 1427 for (h = handlerlist; h; h = h->next)
@@ -1901,6 +1918,36 @@ If LEXICAL is t, evaluate using lexical scoping. */)
1901 return unbind_to (count, eval_sub (form)); 1918 return unbind_to (count, eval_sub (form));
1902} 1919}
1903 1920
1921static void
1922grow_specpdl (void)
1923{
1924 register ptrdiff_t count = SPECPDL_INDEX ();
1925 ptrdiff_t max_size = min (max_specpdl_size, PTRDIFF_MAX);
1926 if (max_size <= specpdl_size)
1927 {
1928 if (max_specpdl_size < 400)
1929 max_size = max_specpdl_size = 400;
1930 if (max_size <= specpdl_size)
1931 signal_error ("Variable binding depth exceeds max-specpdl-size", Qnil);
1932 }
1933 specpdl = xpalloc (specpdl, &specpdl_size, 1, max_size, sizeof *specpdl);
1934 specpdl_ptr = specpdl + count;
1935}
1936
1937void
1938record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs)
1939{
1940 eassert (nargs >= UNEVALLED);
1941 if (specpdl_ptr == specpdl + specpdl_size)
1942 grow_specpdl ();
1943 specpdl_ptr->kind = SPECPDL_BACKTRACE;
1944 specpdl_ptr->v.bt.function = function;
1945 specpdl_ptr->v.bt.args = args;
1946 specpdl_ptr->v.bt.nargs = nargs;
1947 specpdl_ptr->v.bt.debug_on_exit = false;
1948 specpdl_ptr++;
1949}
1950
1904/* Eval a sub-expression of the current expression (i.e. in the same 1951/* Eval a sub-expression of the current expression (i.e. in the same
1905 lexical scope). */ 1952 lexical scope). */
1906Lisp_Object 1953Lisp_Object
@@ -1908,7 +1955,6 @@ eval_sub (Lisp_Object form)
1908{ 1955{
1909 Lisp_Object fun, val, original_fun, original_args; 1956 Lisp_Object fun, val, original_fun, original_args;
1910 Lisp_Object funcar; 1957 Lisp_Object funcar;
1911 struct backtrace backtrace;
1912 struct gcpro gcpro1, gcpro2, gcpro3; 1958 struct gcpro gcpro1, gcpro2, gcpro3;
1913 1959
1914 if (SYMBOLP (form)) 1960 if (SYMBOLP (form))
@@ -1946,12 +1992,8 @@ eval_sub (Lisp_Object form)
1946 original_fun = XCAR (form); 1992 original_fun = XCAR (form);
1947 original_args = XCDR (form); 1993 original_args = XCDR (form);
1948 1994
1949 backtrace.next = backtrace_list; 1995 /* This also protects them from gc. */
1950 backtrace.function = original_fun; /* This also protects them from gc. */ 1996 record_in_backtrace (original_fun, &original_args, UNEVALLED);
1951 backtrace.args = &original_args;
1952 backtrace.nargs = UNEVALLED;
1953 backtrace.debug_on_exit = 0;
1954 backtrace_list = &backtrace;
1955 1997
1956 if (debug_on_next_call) 1998 if (debug_on_next_call)
1957 do_debug_on_call (Qt); 1999 do_debug_on_call (Qt);
@@ -2005,8 +2047,8 @@ eval_sub (Lisp_Object form)
2005 gcpro3.nvars = argnum; 2047 gcpro3.nvars = argnum;
2006 } 2048 }
2007 2049
2008 backtrace.args = vals; 2050 set_backtrace_args (specpdl_ptr - 1, vals);
2009 backtrace.nargs = XINT (numargs); 2051 set_backtrace_nargs (specpdl_ptr - 1, XINT (numargs));
2010 2052
2011 val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals); 2053 val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals);
2012 UNGCPRO; 2054 UNGCPRO;
@@ -2027,8 +2069,8 @@ eval_sub (Lisp_Object form)
2027 2069
2028 UNGCPRO; 2070 UNGCPRO;
2029 2071
2030 backtrace.args = argvals; 2072 set_backtrace_args (specpdl_ptr - 1, argvals);
2031 backtrace.nargs = XINT (numargs); 2073 set_backtrace_nargs (specpdl_ptr - 1, XINT (numargs));
2032 2074
2033 switch (i) 2075 switch (i)
2034 { 2076 {
@@ -2118,9 +2160,9 @@ eval_sub (Lisp_Object form)
2118 check_cons_list (); 2160 check_cons_list ();
2119 2161
2120 lisp_eval_depth--; 2162 lisp_eval_depth--;
2121 if (backtrace.debug_on_exit) 2163 if (backtrace_debug_on_exit (specpdl_ptr - 1))
2122 val = call_debugger (Fcons (Qexit, Fcons (val, Qnil))); 2164 val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
2123 backtrace_list = backtrace.next; 2165 specpdl_ptr--;
2124 2166
2125 return val; 2167 return val;
2126} 2168}
@@ -2600,7 +2642,6 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2600 ptrdiff_t numargs = nargs - 1; 2642 ptrdiff_t numargs = nargs - 1;
2601 Lisp_Object lisp_numargs; 2643 Lisp_Object lisp_numargs;
2602 Lisp_Object val; 2644 Lisp_Object val;
2603 struct backtrace backtrace;
2604 register Lisp_Object *internal_args; 2645 register Lisp_Object *internal_args;
2605 ptrdiff_t i; 2646 ptrdiff_t i;
2606 2647
@@ -2614,12 +2655,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2614 error ("Lisp nesting exceeds `max-lisp-eval-depth'"); 2655 error ("Lisp nesting exceeds `max-lisp-eval-depth'");
2615 } 2656 }
2616 2657
2617 backtrace.next = backtrace_list; 2658 /* This also GCPROs them. */
2618 backtrace.function = args[0]; 2659 record_in_backtrace (args[0], &args[1], nargs - 1);
2619 backtrace.args = &args[1]; /* This also GCPROs them. */
2620 backtrace.nargs = nargs - 1;
2621 backtrace.debug_on_exit = 0;
2622 backtrace_list = &backtrace;
2623 2660
2624 /* Call GC after setting up the backtrace, so the latter GCPROs the args. */ 2661 /* Call GC after setting up the backtrace, so the latter GCPROs the args. */
2625 maybe_gc (); 2662 maybe_gc ();
@@ -2744,9 +2781,9 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2744 } 2781 }
2745 check_cons_list (); 2782 check_cons_list ();
2746 lisp_eval_depth--; 2783 lisp_eval_depth--;
2747 if (backtrace.debug_on_exit) 2784 if (backtrace_debug_on_exit (specpdl_ptr - 1))
2748 val = call_debugger (Fcons (Qexit, Fcons (val, Qnil))); 2785 val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
2749 backtrace_list = backtrace.next; 2786 specpdl_ptr--;
2750 return val; 2787 return val;
2751} 2788}
2752 2789
@@ -2778,15 +2815,17 @@ apply_lambda (Lisp_Object fun, Lisp_Object args)
2778 2815
2779 UNGCPRO; 2816 UNGCPRO;
2780 2817
2781 backtrace_list->args = arg_vector; 2818 set_backtrace_args (specpdl_ptr - 1, arg_vector);
2782 backtrace_list->nargs = i; 2819 set_backtrace_nargs (specpdl_ptr - 1, i);
2783 tem = funcall_lambda (fun, numargs, arg_vector); 2820 tem = funcall_lambda (fun, numargs, arg_vector);
2784 2821
2785 /* Do the debug-on-exit now, while arg_vector still exists. */ 2822 /* Do the debug-on-exit now, while arg_vector still exists. */
2786 if (backtrace_list->debug_on_exit) 2823 if (backtrace_debug_on_exit (specpdl_ptr - 1))
2787 tem = call_debugger (Fcons (Qexit, Fcons (tem, Qnil))); 2824 {
2788 /* Don't do it again when we return to eval. */ 2825 /* Don't do it again when we return to eval. */
2789 backtrace_list->debug_on_exit = 0; 2826 set_backtrace_debug_on_exit (specpdl_ptr - 1, false);
2827 tem = call_debugger (Fcons (Qexit, Fcons (tem, Qnil)));
2828 }
2790 SAFE_FREE (); 2829 SAFE_FREE ();
2791 return tem; 2830 return tem;
2792} 2831}
@@ -2936,20 +2975,38 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
2936 return object; 2975 return object;
2937} 2976}
2938 2977
2939static void 2978/* Return true if SYMBOL currently has a let-binding
2940grow_specpdl (void) 2979 which was made in the buffer that is now current. */
2980
2981bool
2982let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
2941{ 2983{
2942 register ptrdiff_t count = SPECPDL_INDEX (); 2984 struct specbinding *p;
2943 ptrdiff_t max_size = min (max_specpdl_size, PTRDIFF_MAX); 2985 Lisp_Object buf = Fcurrent_buffer ();
2944 if (max_size <= specpdl_size) 2986
2945 { 2987 for (p = specpdl_ptr; p > specpdl; )
2946 if (max_specpdl_size < 400) 2988 if ((--p)->kind > SPECPDL_LET)
2947 max_size = max_specpdl_size = 400; 2989 {
2948 if (max_size <= specpdl_size) 2990 struct Lisp_Symbol *let_bound_symbol = XSYMBOL (specpdl_symbol (p));
2949 signal_error ("Variable binding depth exceeds max-specpdl-size", Qnil); 2991 eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS);
2950 } 2992 if (symbol == let_bound_symbol
2951 specpdl = xpalloc (specpdl, &specpdl_size, 1, max_size, sizeof *specpdl); 2993 && EQ (specpdl_where (p), buf))
2952 specpdl_ptr = specpdl + count; 2994 return 1;
2995 }
2996
2997 return 0;
2998}
2999
3000bool
3001let_shadows_global_binding_p (Lisp_Object symbol)
3002{
3003 struct specbinding *p;
3004
3005 for (p = specpdl_ptr; p > specpdl; )
3006 if ((--p)->kind >= SPECPDL_LET && EQ (specpdl_symbol (p), symbol))
3007 return 1;
3008
3009 return 0;
2953} 3010}
2954 3011
2955/* `specpdl_ptr->symbol' is a field which describes which variable is 3012/* `specpdl_ptr->symbol' is a field which describes which variable is
@@ -2985,9 +3042,9 @@ specbind (Lisp_Object symbol, Lisp_Object value)
2985 case SYMBOL_PLAINVAL: 3042 case SYMBOL_PLAINVAL:
2986 /* The most common case is that of a non-constant symbol with a 3043 /* The most common case is that of a non-constant symbol with a
2987 trivial value. Make that as fast as we can. */ 3044 trivial value. Make that as fast as we can. */
2988 set_specpdl_symbol (symbol); 3045 specpdl_ptr->kind = SPECPDL_LET;
2989 set_specpdl_old_value (SYMBOL_VAL (sym)); 3046 specpdl_ptr->v.let.symbol = symbol;
2990 specpdl_ptr->func = NULL; 3047 specpdl_ptr->v.let.old_value = SYMBOL_VAL (sym);
2991 ++specpdl_ptr; 3048 ++specpdl_ptr;
2992 if (!sym->constant) 3049 if (!sym->constant)
2993 SET_SYMBOL_VAL (sym, value); 3050 SET_SYMBOL_VAL (sym, value);
@@ -3000,59 +3057,36 @@ specbind (Lisp_Object symbol, Lisp_Object value)
3000 case SYMBOL_FORWARDED: 3057 case SYMBOL_FORWARDED:
3001 { 3058 {
3002 Lisp_Object ovalue = find_symbol_value (symbol); 3059 Lisp_Object ovalue = find_symbol_value (symbol);
3003 specpdl_ptr->func = 0; 3060 specpdl_ptr->kind = SPECPDL_LET_LOCAL;
3004 set_specpdl_old_value (ovalue); 3061 specpdl_ptr->v.let.symbol = symbol;
3062 specpdl_ptr->v.let.old_value = ovalue;
3063 specpdl_ptr->v.let.where = Fcurrent_buffer ();
3005 3064
3006 eassert (sym->redirect != SYMBOL_LOCALIZED 3065 eassert (sym->redirect != SYMBOL_LOCALIZED
3007 || (EQ (SYMBOL_BLV (sym)->where, 3066 || (EQ (SYMBOL_BLV (sym)->where, Fcurrent_buffer ())));
3008 SYMBOL_BLV (sym)->frame_local ?
3009 Fselected_frame () : Fcurrent_buffer ())));
3010 3067
3011 if (sym->redirect == SYMBOL_LOCALIZED 3068 if (sym->redirect == SYMBOL_LOCALIZED)
3012 || BUFFER_OBJFWDP (SYMBOL_FWD (sym))) 3069 {
3070 if (!blv_found (SYMBOL_BLV (sym)))
3071 specpdl_ptr->kind = SPECPDL_LET_DEFAULT;
3072 }
3073 else if (BUFFER_OBJFWDP (SYMBOL_FWD (sym)))
3013 { 3074 {
3014 Lisp_Object where, cur_buf = Fcurrent_buffer ();
3015
3016 /* For a local variable, record both the symbol and which
3017 buffer's or frame's value we are saving. */
3018 if (!NILP (Flocal_variable_p (symbol, Qnil)))
3019 {
3020 eassert (sym->redirect != SYMBOL_LOCALIZED
3021 || (blv_found (SYMBOL_BLV (sym))
3022 && EQ (cur_buf, SYMBOL_BLV (sym)->where)));
3023 where = cur_buf;
3024 }
3025 else if (sym->redirect == SYMBOL_LOCALIZED
3026 && blv_found (SYMBOL_BLV (sym)))
3027 where = SYMBOL_BLV (sym)->where;
3028 else
3029 where = Qnil;
3030
3031 /* We're not using the `unused' slot in the specbinding
3032 structure because this would mean we have to do more
3033 work for simple variables. */
3034 /* FIXME: The third value `current_buffer' is only used in
3035 let_shadows_buffer_binding_p which is itself only used
3036 in set_internal for local_if_set. */
3037 eassert (NILP (where) || EQ (where, cur_buf));
3038 set_specpdl_symbol (Fcons (symbol, Fcons (where, cur_buf)));
3039
3040 /* If SYMBOL is a per-buffer variable which doesn't have a 3075 /* If SYMBOL is a per-buffer variable which doesn't have a
3041 buffer-local value here, make the `let' change the global 3076 buffer-local value here, make the `let' change the global
3042 value by changing the value of SYMBOL in all buffers not 3077 value by changing the value of SYMBOL in all buffers not
3043 having their own value. This is consistent with what 3078 having their own value. This is consistent with what
3044 happens with other buffer-local variables. */ 3079 happens with other buffer-local variables. */
3045 if (NILP (where) 3080 if (NILP (Flocal_variable_p (symbol, Qnil)))
3046 && sym->redirect == SYMBOL_FORWARDED)
3047 { 3081 {
3048 eassert (BUFFER_OBJFWDP (SYMBOL_FWD (sym))); 3082 specpdl_ptr->kind = SPECPDL_LET_DEFAULT;
3049 ++specpdl_ptr; 3083 ++specpdl_ptr;
3050 Fset_default (symbol, value); 3084 Fset_default (symbol, value);
3051 return; 3085 return;
3052 } 3086 }
3053 } 3087 }
3054 else 3088 else
3055 set_specpdl_symbol (symbol); 3089 specpdl_ptr->kind = SPECPDL_LET;
3056 3090
3057 specpdl_ptr++; 3091 specpdl_ptr++;
3058 set_internal (symbol, value, Qnil, 1); 3092 set_internal (symbol, value, Qnil, 1);
@@ -3067,9 +3101,9 @@ record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg)
3067{ 3101{
3068 if (specpdl_ptr == specpdl + specpdl_size) 3102 if (specpdl_ptr == specpdl + specpdl_size)
3069 grow_specpdl (); 3103 grow_specpdl ();
3070 specpdl_ptr->func = function; 3104 specpdl_ptr->kind = SPECPDL_UNWIND;
3071 set_specpdl_symbol (Qnil); 3105 specpdl_ptr->v.unwind.func = function;
3072 set_specpdl_old_value (arg); 3106 specpdl_ptr->v.unwind.arg = arg;
3073 specpdl_ptr++; 3107 specpdl_ptr++;
3074} 3108}
3075 3109
@@ -3093,41 +3127,50 @@ unbind_to (ptrdiff_t count, Lisp_Object value)
3093 struct specbinding this_binding; 3127 struct specbinding this_binding;
3094 this_binding = *--specpdl_ptr; 3128 this_binding = *--specpdl_ptr;
3095 3129
3096 if (this_binding.func != 0) 3130 switch (this_binding.kind)
3097 (*this_binding.func) (this_binding.old_value);
3098 /* If the symbol is a list, it is really (SYMBOL WHERE
3099 . CURRENT-BUFFER) where WHERE is either nil, a buffer, or a
3100 frame. If WHERE is a buffer or frame, this indicates we
3101 bound a variable that had a buffer-local or frame-local
3102 binding. WHERE nil means that the variable had the default
3103 value when it was bound. CURRENT-BUFFER is the buffer that
3104 was current when the variable was bound. */
3105 else if (CONSP (this_binding.symbol))
3106 { 3131 {
3107 Lisp_Object symbol, where; 3132 case SPECPDL_UNWIND:
3108 3133 (*specpdl_func (&this_binding)) (specpdl_arg (&this_binding));
3109 symbol = XCAR (this_binding.symbol); 3134 break;
3110 where = XCAR (XCDR (this_binding.symbol)); 3135 case SPECPDL_LET:
3111 3136 /* If variable has a trivial value (no forwarding), we can
3112 if (NILP (where)) 3137 just set it. No need to check for constant symbols here,
3113 Fset_default (symbol, this_binding.old_value); 3138 since that was already done by specbind. */
3114 /* If `where' is non-nil, reset the value in the appropriate 3139 if (XSYMBOL (specpdl_symbol (&this_binding))->redirect
3115 local binding, but only if that binding still exists. */ 3140 == SYMBOL_PLAINVAL)
3116 else if (BUFFERP (where) 3141 SET_SYMBOL_VAL (XSYMBOL (specpdl_symbol (&this_binding)),
3117 ? !NILP (Flocal_variable_p (symbol, where)) 3142 specpdl_old_value (&this_binding));
3118 : !NILP (Fassq (symbol, XFRAME (where)->param_alist))) 3143 else
3119 set_internal (symbol, this_binding.old_value, where, 1); 3144 /* NOTE: we only ever come here if make_local_foo was used for
3145 the first time on this var within this let. */
3146 Fset_default (specpdl_symbol (&this_binding),
3147 specpdl_old_value (&this_binding));
3148 break;
3149 case SPECPDL_BACKTRACE:
3150 break;
3151 case SPECPDL_LET_LOCAL:
3152 case SPECPDL_LET_DEFAULT:
3153 { /* If the symbol is a list, it is really (SYMBOL WHERE
3154 . CURRENT-BUFFER) where WHERE is either nil, a buffer, or a
3155 frame. If WHERE is a buffer or frame, this indicates we
3156 bound a variable that had a buffer-local or frame-local
3157 binding. WHERE nil means that the variable had the default
3158 value when it was bound. CURRENT-BUFFER is the buffer that
3159 was current when the variable was bound. */
3160 Lisp_Object symbol = specpdl_symbol (&this_binding);
3161 Lisp_Object where = specpdl_where (&this_binding);
3162 eassert (BUFFERP (where));
3163
3164 if (this_binding.kind == SPECPDL_LET_DEFAULT)
3165 Fset_default (symbol, specpdl_old_value (&this_binding));
3166 /* If this was a local binding, reset the value in the appropriate
3167 buffer, but only if that buffer's binding still exists. */
3168 else if (!NILP (Flocal_variable_p (symbol, where)))
3169 set_internal (symbol, specpdl_old_value (&this_binding),
3170 where, 1);
3171 }
3172 break;
3120 } 3173 }
3121 /* If variable has a trivial value (no forwarding), we can
3122 just set it. No need to check for constant symbols here,
3123 since that was already done by specbind. */
3124 else if (XSYMBOL (this_binding.symbol)->redirect == SYMBOL_PLAINVAL)
3125 SET_SYMBOL_VAL (XSYMBOL (this_binding.symbol),
3126 this_binding.old_value);
3127 else
3128 /* NOTE: we only ever come here if make_local_foo was used for
3129 the first time on this var within this let. */
3130 Fset_default (this_binding.symbol, this_binding.old_value);
3131 } 3174 }
3132 3175
3133 if (NILP (Vquit_flag) && !NILP (quitf)) 3176 if (NILP (Vquit_flag) && !NILP (quitf))
@@ -3153,18 +3196,16 @@ DEFUN ("backtrace-debug", Fbacktrace_debug, Sbacktrace_debug, 2, 2, 0,
3153The debugger is entered when that frame exits, if the flag is non-nil. */) 3196The debugger is entered when that frame exits, if the flag is non-nil. */)
3154 (Lisp_Object level, Lisp_Object flag) 3197 (Lisp_Object level, Lisp_Object flag)
3155{ 3198{
3156 register struct backtrace *backlist = backtrace_list; 3199 struct specbinding *pdl = backtrace_top ();
3157 register EMACS_INT i; 3200 register EMACS_INT i;
3158 3201
3159 CHECK_NUMBER (level); 3202 CHECK_NUMBER (level);
3160 3203
3161 for (i = 0; backlist && i < XINT (level); i++) 3204 for (i = 0; backtrace_p (pdl) && i < XINT (level); i++)
3162 { 3205 pdl = backtrace_next (pdl);
3163 backlist = backlist->next;
3164 }
3165 3206
3166 if (backlist) 3207 if (backtrace_p (pdl))
3167 backlist->debug_on_exit = !NILP (flag); 3208 set_backtrace_debug_on_exit (pdl, !NILP (flag));
3168 3209
3169 return flag; 3210 return flag;
3170} 3211}
@@ -3174,58 +3215,41 @@ DEFUN ("backtrace", Fbacktrace, Sbacktrace, 0, 0, "",
3174Output stream used is value of `standard-output'. */) 3215Output stream used is value of `standard-output'. */)
3175 (void) 3216 (void)
3176{ 3217{
3177 register struct backtrace *backlist = backtrace_list; 3218 struct specbinding *pdl = backtrace_top ();
3178 Lisp_Object tail;
3179 Lisp_Object tem; 3219 Lisp_Object tem;
3180 struct gcpro gcpro1;
3181 Lisp_Object old_print_level = Vprint_level; 3220 Lisp_Object old_print_level = Vprint_level;
3182 3221
3183 if (NILP (Vprint_level)) 3222 if (NILP (Vprint_level))
3184 XSETFASTINT (Vprint_level, 8); 3223 XSETFASTINT (Vprint_level, 8);
3185 3224
3186 tail = Qnil; 3225 while (backtrace_p (pdl))
3187 GCPRO1 (tail);
3188
3189 while (backlist)
3190 { 3226 {
3191 write_string (backlist->debug_on_exit ? "* " : " ", 2); 3227 write_string (backtrace_debug_on_exit (pdl) ? "* " : " ", 2);
3192 if (backlist->nargs == UNEVALLED) 3228 if (backtrace_nargs (pdl) == UNEVALLED)
3193 { 3229 {
3194 Fprin1 (Fcons (backlist->function, *backlist->args), Qnil); 3230 Fprin1 (Fcons (backtrace_function (pdl), *backtrace_args (pdl)),
3231 Qnil);
3195 write_string ("\n", -1); 3232 write_string ("\n", -1);
3196 } 3233 }
3197 else 3234 else
3198 { 3235 {
3199 tem = backlist->function; 3236 tem = backtrace_function (pdl);
3200 Fprin1 (tem, Qnil); /* This can QUIT. */ 3237 Fprin1 (tem, Qnil); /* This can QUIT. */
3201 write_string ("(", -1); 3238 write_string ("(", -1);
3202 if (backlist->nargs == MANY) 3239 {
3203 { /* FIXME: Can this happen? */ 3240 ptrdiff_t i;
3204 bool later_arg = 0; 3241 for (i = 0; i < backtrace_nargs (pdl); i++)
3205 for (tail = *backlist->args; !NILP (tail); tail = Fcdr (tail)) 3242 {
3206 { 3243 if (i) write_string (" ", -1);
3207 if (later_arg) 3244 Fprin1 (backtrace_args (pdl)[i], Qnil);
3208 write_string (" ", -1); 3245 }
3209 Fprin1 (Fcar (tail), Qnil); 3246 }
3210 later_arg = 1;
3211 }
3212 }
3213 else
3214 {
3215 ptrdiff_t i;
3216 for (i = 0; i < backlist->nargs; i++)
3217 {
3218 if (i) write_string (" ", -1);
3219 Fprin1 (backlist->args[i], Qnil);
3220 }
3221 }
3222 write_string (")\n", -1); 3247 write_string (")\n", -1);
3223 } 3248 }
3224 backlist = backlist->next; 3249 pdl = backtrace_next (pdl);
3225 } 3250 }
3226 3251
3227 Vprint_level = old_print_level; 3252 Vprint_level = old_print_level;
3228 UNGCPRO;
3229 return Qnil; 3253 return Qnil;
3230} 3254}
3231 3255
@@ -3241,53 +3265,84 @@ or a lambda expression for macro calls.
3241If NFRAMES is more than the number of frames, the value is nil. */) 3265If NFRAMES is more than the number of frames, the value is nil. */)
3242 (Lisp_Object nframes) 3266 (Lisp_Object nframes)
3243{ 3267{
3244 register struct backtrace *backlist = backtrace_list; 3268 struct specbinding *pdl = backtrace_top ();
3245 register EMACS_INT i; 3269 register EMACS_INT i;
3246 Lisp_Object tem;
3247 3270
3248 CHECK_NATNUM (nframes); 3271 CHECK_NATNUM (nframes);
3249 3272
3250 /* Find the frame requested. */ 3273 /* Find the frame requested. */
3251 for (i = 0; backlist && i < XFASTINT (nframes); i++) 3274 for (i = 0; backtrace_p (pdl) && i < XFASTINT (nframes); i++)
3252 backlist = backlist->next; 3275 pdl = backtrace_next (pdl);
3253 3276
3254 if (!backlist) 3277 if (!backtrace_p (pdl))
3255 return Qnil; 3278 return Qnil;
3256 if (backlist->nargs == UNEVALLED) 3279 if (backtrace_nargs (pdl) == UNEVALLED)
3257 return Fcons (Qnil, Fcons (backlist->function, *backlist->args)); 3280 return Fcons (Qnil,
3281 Fcons (backtrace_function (pdl), *backtrace_args (pdl)));
3258 else 3282 else
3259 { 3283 {
3260 if (backlist->nargs == MANY) /* FIXME: Can this happen? */ 3284 Lisp_Object tem = Flist (backtrace_nargs (pdl), backtrace_args (pdl));
3261 tem = *backlist->args;
3262 else
3263 tem = Flist (backlist->nargs, backlist->args);
3264 3285
3265 return Fcons (Qt, Fcons (backlist->function, tem)); 3286 return Fcons (Qt, Fcons (backtrace_function (pdl), tem));
3266 } 3287 }
3267} 3288}
3268 3289
3269 3290
3270#if BYTE_MARK_STACK
3271void 3291void
3272mark_backtrace (void) 3292mark_specpdl (void)
3273{ 3293{
3274 register struct backtrace *backlist; 3294 struct specbinding *pdl;
3275 ptrdiff_t i; 3295 for (pdl = specpdl; pdl != specpdl_ptr; pdl++)
3276
3277 for (backlist = backtrace_list; backlist; backlist = backlist->next)
3278 { 3296 {
3279 mark_object (backlist->function); 3297 switch (pdl->kind)
3298 {
3299 case SPECPDL_UNWIND:
3300 mark_object (specpdl_arg (pdl));
3301 break;
3302 case SPECPDL_BACKTRACE:
3303 {
3304 ptrdiff_t nargs = backtrace_nargs (pdl);
3305 mark_object (backtrace_function (pdl));
3306 if (nargs == UNEVALLED)
3307 nargs = 1;
3308 while (nargs--)
3309 mark_object (backtrace_args (pdl)[nargs]);
3310 }
3311 break;
3312 case SPECPDL_LET_DEFAULT:
3313 case SPECPDL_LET_LOCAL:
3314 mark_object (specpdl_where (pdl));
3315 case SPECPDL_LET:
3316 mark_object (specpdl_symbol (pdl));
3317 mark_object (specpdl_old_value (pdl));
3318 }
3319 }
3320}
3321
3322void
3323get_backtrace (Lisp_Object array)
3324{
3325 struct specbinding *pdl = backtrace_next (backtrace_top ());
3326 ptrdiff_t i = 0, asize = ASIZE (array);
3280 3327
3281 if (backlist->nargs == UNEVALLED 3328 /* Copy the backtrace contents into working memory. */
3282 || backlist->nargs == MANY) /* FIXME: Can this happen? */ 3329 for (; i < asize; i++)
3283 i = 1; 3330 {
3331 if (backtrace_p (pdl))
3332 {
3333 ASET (array, i, backtrace_function (pdl));
3334 pdl = backtrace_next (pdl);
3335 }
3284 else 3336 else
3285 i = backlist->nargs; 3337 ASET (array, i, Qnil);
3286 while (i--)
3287 mark_object (backlist->args[i]);
3288 } 3338 }
3289} 3339}
3290#endif 3340
3341Lisp_Object backtrace_top_function (void)
3342{
3343 struct specbinding *pdl = backtrace_top ();
3344 return (backtrace_p (pdl) ? backtrace_function (pdl) : Qnil);
3345}
3291 3346
3292void 3347void
3293syms_of_eval (void) 3348syms_of_eval (void)
diff --git a/src/fileio.c b/src/fileio.c
index f20721251e6..ce5d4854fee 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -776,8 +776,9 @@ probably use `make-temp-file' instead, except in three circumstances:
776DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, 776DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
777 doc: /* Convert filename NAME to absolute, and canonicalize it. 777 doc: /* Convert filename NAME to absolute, and canonicalize it.
778Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative 778Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
779\(does not start with slash or tilde); if DEFAULT-DIRECTORY is nil or missing, 779\(does not start with slash or tilde); both the directory name and
780the current buffer's value of `default-directory' is used. 780a directory's file name are accepted. If DEFAULT-DIRECTORY is nil or
781missing, the current buffer's value of `default-directory' is used.
781NAME should be a string that is a valid file name for the underlying 782NAME should be a string that is a valid file name for the underlying
782filesystem. 783filesystem.
783File name components that are `.' are removed, and 784File name components that are `.' are removed, and
@@ -3489,7 +3490,6 @@ by calling `format-decode', which see. */)
3489 EMACS_TIME mtime; 3490 EMACS_TIME mtime;
3490 int fd; 3491 int fd;
3491 ptrdiff_t inserted = 0; 3492 ptrdiff_t inserted = 0;
3492 bool nochange = 0;
3493 ptrdiff_t how_much; 3493 ptrdiff_t how_much;
3494 off_t beg_offset, end_offset; 3494 off_t beg_offset, end_offset;
3495 int unprocessed; 3495 int unprocessed;
@@ -3506,6 +3506,11 @@ by calling `format-decode', which see. */)
3506 bool set_coding_system = 0; 3506 bool set_coding_system = 0;
3507 Lisp_Object coding_system; 3507 Lisp_Object coding_system;
3508 bool read_quit = 0; 3508 bool read_quit = 0;
3509 /* If the undo log only contains the insertion, there's no point
3510 keeping it. It's typically when we first fill a file-buffer. */
3511 bool empty_undo_list_p
3512 = (!NILP (visit) && NILP (BVAR (current_buffer, undo_list))
3513 && BEG == Z);
3509 Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark; 3514 Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark;
3510 bool we_locked_file = 0; 3515 bool we_locked_file = 0;
3511 bool deferred_remove_unwind_protect = 0; 3516 bool deferred_remove_unwind_protect = 0;
@@ -4055,9 +4060,7 @@ by calling `format-decode', which see. */)
4055 if (bufpos == inserted) 4060 if (bufpos == inserted)
4056 { 4061 {
4057 /* Truncate the buffer to the size of the file. */ 4062 /* Truncate the buffer to the size of the file. */
4058 if (same_at_start == same_at_end) 4063 if (same_at_start != same_at_end)
4059 nochange = 1;
4060 else
4061 del_range_byte (same_at_start, same_at_end, 0); 4064 del_range_byte (same_at_start, same_at_end, 0);
4062 inserted = 0; 4065 inserted = 0;
4063 4066
@@ -4108,6 +4111,7 @@ by calling `format-decode', which see. */)
4108 { 4111 {
4109 del_range_byte (same_at_start, same_at_end, 0); 4112 del_range_byte (same_at_start, same_at_end, 0);
4110 temp = GPT; 4113 temp = GPT;
4114 eassert (same_at_start == GPT_BYTE);
4111 same_at_start = GPT_BYTE; 4115 same_at_start = GPT_BYTE;
4112 } 4116 }
4113 else 4117 else
@@ -4120,6 +4124,7 @@ by calling `format-decode', which see. */)
4120 = buf_bytepos_to_charpos (XBUFFER (conversion_buffer), 4124 = buf_bytepos_to_charpos (XBUFFER (conversion_buffer),
4121 same_at_start - BEGV_BYTE 4125 same_at_start - BEGV_BYTE
4122 + BUF_BEG_BYTE (XBUFFER (conversion_buffer))); 4126 + BUF_BEG_BYTE (XBUFFER (conversion_buffer)));
4127 eassert (same_at_start_charpos == temp - (BEGV - BEG));
4123 inserted_chars 4128 inserted_chars
4124 = (buf_bytepos_to_charpos (XBUFFER (conversion_buffer), 4129 = (buf_bytepos_to_charpos (XBUFFER (conversion_buffer),
4125 same_at_start + inserted - BEGV_BYTE 4130 same_at_start + inserted - BEGV_BYTE
@@ -4404,7 +4409,7 @@ by calling `format-decode', which see. */)
4404 4409
4405 if (!NILP (visit)) 4410 if (!NILP (visit))
4406 { 4411 {
4407 if (!EQ (BVAR (current_buffer, undo_list), Qt) && !nochange) 4412 if (empty_undo_list_p)
4408 bset_undo_list (current_buffer, Qnil); 4413 bset_undo_list (current_buffer, Qnil);
4409 4414
4410 if (NILP (handler)) 4415 if (NILP (handler))
@@ -4546,7 +4551,7 @@ by calling `format-decode', which see. */)
4546 p = XCDR (p); 4551 p = XCDR (p);
4547 } 4552 }
4548 4553
4549 if (NILP (visit)) 4554 if (!empty_undo_list_p)
4550 { 4555 {
4551 bset_undo_list (current_buffer, old_undo); 4556 bset_undo_list (current_buffer, old_undo);
4552 if (CONSP (old_undo) && inserted != old_inserted) 4557 if (CONSP (old_undo) && inserted != old_inserted)
diff --git a/src/frame.c b/src/frame.c
index e88432b9802..a207ef690da 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -114,7 +114,7 @@ Lisp_Object Qface_set_after_frame_default;
114 114
115static Lisp_Object Qdelete_frame_functions; 115static Lisp_Object Qdelete_frame_functions;
116 116
117Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource; 117static Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
118 118
119#ifdef HAVE_WINDOW_SYSTEM 119#ifdef HAVE_WINDOW_SYSTEM
120static void x_report_frame_params (struct frame *, Lisp_Object *); 120static void x_report_frame_params (struct frame *, Lisp_Object *);
@@ -167,7 +167,7 @@ struct frame *
167decode_window_system_frame (Lisp_Object frame) 167decode_window_system_frame (Lisp_Object frame)
168{ 168{
169 struct frame *f = decode_live_frame (frame); 169 struct frame *f = decode_live_frame (frame);
170 170
171 if (!window_system_available (f)) 171 if (!window_system_available (f))
172 error ("Window system frame should be used"); 172 error ("Window system frame should be used");
173 return f; 173 return f;
@@ -4138,6 +4138,8 @@ selected frame. This is useful when `make-pointer-invisible' is set. */)
4138 4138
4139#ifdef HAVE_WINDOW_SYSTEM 4139#ifdef HAVE_WINDOW_SYSTEM
4140 4140
4141# if (defined HAVE_NS \
4142 || (!defined USE_GTK && (defined HAVE_XINERAMA || defined HAVE_XRANDR)))
4141void 4143void
4142free_monitors (struct MonitorInfo *monitors, int n_monitors) 4144free_monitors (struct MonitorInfo *monitors, int n_monitors)
4143{ 4145{
@@ -4146,6 +4148,7 @@ free_monitors (struct MonitorInfo *monitors, int n_monitors)
4146 xfree (monitors[i].name); 4148 xfree (monitors[i].name);
4147 xfree (monitors); 4149 xfree (monitors);
4148} 4150}
4151# endif
4149 4152
4150Lisp_Object 4153Lisp_Object
4151make_monitor_attribute_list (struct MonitorInfo *monitors, 4154make_monitor_attribute_list (struct MonitorInfo *monitors,
diff --git a/src/frame.h b/src/frame.h
index 12aa48b2d92..31d3e73c3c3 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1198,8 +1198,6 @@ extern Lisp_Object Qdisplay;
1198 1198
1199extern Lisp_Object Qrun_hook_with_args; 1199extern Lisp_Object Qrun_hook_with_args;
1200 1200
1201extern Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
1202
1203#ifdef HAVE_WINDOW_SYSTEM 1201#ifdef HAVE_WINDOW_SYSTEM
1204 1202
1205/* The class of this X application. */ 1203/* The class of this X application. */
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
new file mode 100644
index 00000000000..c8d12ce8fa0
--- /dev/null
+++ b/src/gfilenotify.c
@@ -0,0 +1,283 @@
1/* Filesystem notifications support with glib API.
2 Copyright (C) 2013 Free Software Foundation, Inc.
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18
19#include <config.h>
20
21#ifdef HAVE_GFILENOTIFY
22#include <stdio.h>
23#include <gio/gio.h>
24#include "lisp.h"
25#include "coding.h"
26#include "frame.h"
27#include "termhooks.h"
28#include "keyboard.h"
29#include "process.h"
30
31
32/* Subroutines. */
33static Lisp_Object Qgfile_add_watch;
34static Lisp_Object Qgfile_rm_watch;
35
36/* Filter objects. */
37static Lisp_Object Qwatch_mounts; /* G_FILE_MONITOR_WATCH_MOUNTS */
38static Lisp_Object Qsend_moved; /* G_FILE_MONITOR_SEND_MOVED */
39
40/* Event types. */
41static Lisp_Object Qchanged; /* G_FILE_MONITOR_EVENT_CHANGED */
42static Lisp_Object Qchanges_done_hint; /* G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT */
43static Lisp_Object Qdeleted; /* G_FILE_MONITOR_EVENT_DELETED */
44static Lisp_Object Qcreated; /* G_FILE_MONITOR_EVENT_CREATED */
45static Lisp_Object Qattribute_changed; /* G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED */
46static Lisp_Object Qpre_unmount; /* G_FILE_MONITOR_EVENT_PRE_UNMOUNT */
47static Lisp_Object Qunmounted; /* G_FILE_MONITOR_EVENT_UNMOUNTED */
48static Lisp_Object Qmoved; /* G_FILE_MONITOR_EVENT_MOVED */
49
50static Lisp_Object watch_list;
51
52/* This is the callback function for arriving signals from
53 g_file_monitor. It shall create a Lisp event, and put it into
54 Emacs input queue. */
55static gboolean
56dir_monitor_callback (GFileMonitor *monitor,
57 GFile *file,
58 GFile *other_file,
59 GFileMonitorEvent event_type,
60 gpointer user_data)
61{
62 Lisp_Object symbol, monitor_object, watch_object;
63 char *name = g_file_get_parse_name (file);
64 char *oname = other_file ? g_file_get_parse_name (other_file) : NULL;
65
66 /* Determine event symbol. */
67 switch (event_type)
68 {
69 case G_FILE_MONITOR_EVENT_CHANGED:
70 symbol = Qchanged;
71 break;
72 case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
73 symbol = Qchanges_done_hint;
74 break;
75 case G_FILE_MONITOR_EVENT_DELETED:
76 symbol = Qdeleted;
77 break;
78 case G_FILE_MONITOR_EVENT_CREATED:
79 symbol = Qcreated;
80 break;
81 case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
82 symbol = Qattribute_changed;
83 break;
84 case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
85 symbol = Qpre_unmount;
86 break;
87 case G_FILE_MONITOR_EVENT_UNMOUNTED:
88 symbol = Qunmounted;
89 break;
90 case G_FILE_MONITOR_EVENT_MOVED:
91 symbol = Qmoved;
92 break;
93 default:
94 goto cleanup;
95 }
96
97 /* Determine callback function. */
98 monitor_object = XIL ((intptr_t) monitor);
99 eassert (INTEGERP (monitor_object));
100 watch_object = assq_no_quit (monitor_object, watch_list);
101
102 if (CONSP (watch_object))
103 {
104 /* Construct an event. */
105 struct input_event event;
106 Lisp_Object otail = oname ? list1 (build_string (oname)) : Qnil;
107 EVENT_INIT (event);
108 event.kind = FILE_NOTIFY_EVENT;
109 event.frame_or_window = Qnil;
110 event.arg = list2 (Fcons (monitor_object,
111 Fcons (symbol,
112 Fcons (build_string (name),
113 otail))),
114 XCDR (watch_object));
115
116 /* Store it into the input event queue. */
117 kbd_buffer_store_event (&event);
118 }
119
120 /* Cleanup. */
121 cleanup:
122 g_free (name);
123 g_free (oname);
124
125 return TRUE;
126}
127
128DEFUN ("gfile-add-watch", Fgfile_add_watch, Sgfile_add_watch, 3, 3, 0,
129 doc: /* Add a watch for filesystem events pertaining to FILE.
130
131This arranges for filesystem events pertaining to FILE to be reported
132to Emacs. Use `gfile-rm-watch' to cancel the watch.
133
134Value is a descriptor for the added watch. If the file cannot be
135watched for some reason, this function signals a `file-error' error.
136
137FLAGS is a list of conditions to set what will be watched for. It can
138include the following symbols:
139
140 'watch-mounts' -- watch for mount events
141 'send-moved' -- pair 'deleted' and 'created' events caused by file
142 renames (moves) and send a single 'event-moved'
143 event instead
144
145When any event happens, Emacs will call the CALLBACK function passing
146it a single argument EVENT, which is of the form
147
148 (DESCRIPTOR ACTION FILE [FILE1])
149
150DESCRIPTOR is the same object as the one returned by this function.
151ACTION is the description of the event. It could be any one of the
152following:
153
154 'changed' -- FILE has changed
155 'changes-done-hint' -- a hint that this was probably the last change
156 in a set of changes
157 'deleted' -- FILE was deleted
158 'created' -- FILE was created
159 'attribute-changed' -- a FILE attribute was changed
160 'pre-unmount' -- the FILE location will soon be unmounted
161 'unmounted' -- the FILE location was unmounted
162 'moved' -- FILE was moved to FILE1
163
164FILE is the name of the file whose event is being reported. FILE1
165will be reported only in case of the 'moved' event. */)
166 (Lisp_Object file, Lisp_Object flags, Lisp_Object callback)
167{
168 Lisp_Object watch_descriptor, watch_object;
169 GFile *gfile;
170 GFileMonitor *monitor;
171 GFileMonitorFlags gflags = G_FILE_MONITOR_NONE;
172
173 /* Check parameters. */
174 CHECK_STRING (file);
175 file = Fdirectory_file_name (Fexpand_file_name (file, Qnil));
176 if (NILP (Ffile_exists_p (file)))
177 report_file_error ("File does not exists", Fcons (file, Qnil));
178
179 CHECK_LIST (flags);
180
181 if (!FUNCTIONP (callback))
182 wrong_type_argument (Qinvalid_function, callback);
183
184 /* Create GFile name. */
185 gfile = g_file_new_for_path (SSDATA (ENCODE_FILE (file)));
186
187 /* Assemble flags. */
188 if (!NILP (Fmember (Qwatch_mounts, flags)))
189 gflags |= G_FILE_MONITOR_WATCH_MOUNTS;
190 if (!NILP (Fmember (Qsend_moved, flags)))
191 gflags |= G_FILE_MONITOR_SEND_MOVED;
192
193 /* Enable watch. */
194 monitor = g_file_monitor (gfile, gflags, NULL, NULL);
195 if (! monitor)
196 xsignal2 (Qfile_error, build_string ("Cannot watch file"), file);
197
198 /* On all known glib platforms, converting MONITOR directly to a
199 Lisp_Object value results is a Lisp integer, which is safe. This
200 assumption is dicey, though, so check it now. */
201 watch_descriptor = XIL ((intptr_t) monitor);
202 if (! INTEGERP (watch_descriptor))
203 {
204 g_object_unref (monitor);
205 xsignal2 (Qfile_error, build_string ("Unsupported file watcher"), file);
206 }
207
208 g_signal_connect (monitor, "changed",
209 (GCallback) dir_monitor_callback, NULL);
210
211 /* Store watch object in watch list. */
212 watch_object = Fcons (watch_descriptor, callback);
213 watch_list = Fcons (watch_object, watch_list);
214
215 return watch_descriptor;
216}
217
218DEFUN ("gfile-rm-watch", Fgfile_rm_watch, Sgfile_rm_watch, 1, 1, 0,
219 doc: /* Remove an existing WATCH-DESCRIPTOR.
220
221WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */)
222 (Lisp_Object watch_descriptor)
223{
224 intptr_t int_monitor;
225 GFileMonitor *monitor;
226 Lisp_Object watch_object = assq_no_quit (watch_descriptor, watch_list);
227
228 if (! CONSP (watch_object))
229 xsignal2 (Qfile_error, build_string ("Not a watch descriptor"),
230 watch_descriptor);
231
232 eassert (INTEGERP (watch_descriptor));
233 int_monitor = XLI (watch_descriptor);
234 monitor = (GFileMonitor *) int_monitor;
235 if (!g_file_monitor_cancel (monitor))
236 xsignal2 (Qfile_error, build_string ("Could not rm watch"),
237 watch_descriptor);
238
239 /* Remove watch descriptor from watch list. */
240 watch_list = Fdelq (watch_object, watch_list);
241
242 /* Cleanup. */
243 g_object_unref (monitor);
244
245 return Qt;
246}
247
248
249void
250globals_of_gfilenotify (void)
251{
252 g_type_init ();
253 watch_list = Qnil;
254}
255
256void
257syms_of_gfilenotify (void)
258{
259
260 DEFSYM (Qgfile_add_watch, "gfile-add-watch");
261 defsubr (&Sgfile_add_watch);
262
263 DEFSYM (Qgfile_rm_watch, "gfile-rm-watch");
264 defsubr (&Sgfile_rm_watch);
265
266 DEFSYM (Qwatch_mounts, "watch-mounts");
267 DEFSYM (Qsend_moved, "send-moved");
268 DEFSYM (Qchanged, "changed");
269 DEFSYM (Qchanges_done_hint, "changes-done-hint");
270 DEFSYM (Qdeleted, "deleted");
271 DEFSYM (Qcreated, "created");
272 DEFSYM (Qattribute_changed, "attribute-changed");
273 DEFSYM (Qpre_unmount, "pre-unmount");
274 DEFSYM (Qunmounted, "unmounted");
275 DEFSYM (Qmoved, "moved");
276
277 staticpro (&watch_list);
278
279 Fprovide (intern_c_string ("gfilenotify"), Qnil);
280
281}
282
283#endif /* HAVE_GFILENOTIFY */
diff --git a/src/keyboard.c b/src/keyboard.c
index 7c3056079be..6129fdd26c8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -308,9 +308,6 @@ static Lisp_Object Qfunction_key;
308Lisp_Object Qmouse_click; 308Lisp_Object Qmouse_click;
309#ifdef HAVE_NTGUI 309#ifdef HAVE_NTGUI
310Lisp_Object Qlanguage_change; 310Lisp_Object Qlanguage_change;
311#ifdef WINDOWSNT
312Lisp_Object Qfile_w32notify;
313#endif
314#endif 311#endif
315static Lisp_Object Qdrag_n_drop; 312static Lisp_Object Qdrag_n_drop;
316static Lisp_Object Qsave_session; 313static Lisp_Object Qsave_session;
@@ -320,9 +317,9 @@ static Lisp_Object Qdbus_event;
320#ifdef HAVE_XWIDGETS 317#ifdef HAVE_XWIDGETS
321Lisp_Object Qxwidget_event; 318Lisp_Object Qxwidget_event;
322#endif 319#endif
323#ifdef HAVE_INOTIFY 320#ifdef USE_FILE_NOTIFY
324static Lisp_Object Qfile_inotify; 321static Lisp_Object Qfile_notify;
325#endif /* HAVE_INOTIFY */ 322#endif /* USE_FILE_NOTIFY */
326static Lisp_Object Qconfig_changed_event; 323static Lisp_Object Qconfig_changed_event;
327 324
328/* Lisp_Object Qmouse_movement; - also an event header */ 325/* Lisp_Object Qmouse_movement; - also an event header */
@@ -1888,7 +1885,7 @@ safe_run_hooks_error (Lisp_Object error_data)
1888 = CONSP (Vinhibit_quit) ? XCAR (Vinhibit_quit) : Vinhibit_quit; 1885 = CONSP (Vinhibit_quit) ? XCAR (Vinhibit_quit) : Vinhibit_quit;
1889 Lisp_Object fun = CONSP (Vinhibit_quit) ? XCDR (Vinhibit_quit) : Qnil; 1886 Lisp_Object fun = CONSP (Vinhibit_quit) ? XCDR (Vinhibit_quit) : Qnil;
1890 Lisp_Object args[4]; 1887 Lisp_Object args[4];
1891 args[0] = build_string ("Error in %s (%s): %S"); 1888 args[0] = build_string ("Error in %s (%S): %S");
1892 args[1] = hook; 1889 args[1] = hook;
1893 args[2] = fun; 1890 args[2] = fun;
1894 args[3] = error_data; 1891 args[3] = error_data;
@@ -4016,18 +4013,22 @@ kbd_buffer_get_event (KBOARD **kbp,
4016 kbd_fetch_ptr = event + 1; 4013 kbd_fetch_ptr = event + 1;
4017 } 4014 }
4018#endif 4015#endif
4019#ifdef WINDOWSNT 4016#ifdef USE_FILE_NOTIFY
4020 else if (event->kind == FILE_NOTIFY_EVENT) 4017 else if (event->kind == FILE_NOTIFY_EVENT)
4021 { 4018 {
4019#ifdef HAVE_W32NOTIFY
4022 /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */ 4020 /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */
4023 obj = Fcons (Qfile_w32notify, 4021 obj = Fcons (Qfile_notify,
4024 list2 (list3 (make_number (event->code), 4022 list2 (list3 (make_number (event->code),
4025 XCAR (event->arg), 4023 XCAR (event->arg),
4026 XCDR (event->arg)), 4024 XCDR (event->arg)),
4027 event->frame_or_window)); 4025 event->frame_or_window));
4026#else
4027 obj = make_lispy_event (event);
4028#endif
4028 kbd_fetch_ptr = event + 1; 4029 kbd_fetch_ptr = event + 1;
4029 } 4030 }
4030#endif 4031#endif /* USE_FILE_NOTIFY */
4031 else if (event->kind == SAVE_SESSION_EVENT) 4032 else if (event->kind == SAVE_SESSION_EVENT)
4032 { 4033 {
4033 obj = Fcons (Qsave_session, Fcons (event->arg, Qnil)); 4034 obj = Fcons (Qsave_session, Fcons (event->arg, Qnil));
@@ -6010,12 +6011,12 @@ make_lispy_event (struct input_event *event)
6010#endif /* HAVE_XWIDGETS */ 6011#endif /* HAVE_XWIDGETS */
6011 6012
6012 6013
6013#ifdef HAVE_INOTIFY 6014#if defined HAVE_GFILENOTIFY || defined HAVE_INOTIFY
6014 case FILE_NOTIFY_EVENT: 6015 case FILE_NOTIFY_EVENT:
6015 { 6016 {
6016 return Fcons (Qfile_inotify, event->arg); 6017 return Fcons (Qfile_notify, event->arg);
6017 } 6018 }
6018#endif /* HAVE_INOTIFY */ 6019#endif /* defined HAVE_GFILENOTIFY || defined HAVE_INOTIFY */
6019 6020
6020 case CONFIG_CHANGED_EVENT: 6021 case CONFIG_CHANGED_EVENT:
6021 return Fcons (Qconfig_changed_event, 6022 return Fcons (Qconfig_changed_event,
@@ -7417,7 +7418,8 @@ menu_bar_items (Lisp_Object old)
7417 Lisp_Object *tmaps; 7418 Lisp_Object *tmaps;
7418 7419
7419 /* Should overriding-terminal-local-map and overriding-local-map apply? */ 7420 /* Should overriding-terminal-local-map and overriding-local-map apply? */
7420 if (!NILP (Voverriding_local_map_menu_flag)) 7421 if (!NILP (Voverriding_local_map_menu_flag)
7422 && !NILP (Voverriding_local_map))
7421 { 7423 {
7422 /* Yes, use them (if non-nil) as well as the global map. */ 7424 /* Yes, use them (if non-nil) as well as the global map. */
7423 maps = alloca (3 * sizeof (maps[0])); 7425 maps = alloca (3 * sizeof (maps[0]));
@@ -7437,8 +7439,11 @@ menu_bar_items (Lisp_Object old)
7437 Lisp_Object tem; 7439 Lisp_Object tem;
7438 ptrdiff_t nminor; 7440 ptrdiff_t nminor;
7439 nminor = current_minor_maps (NULL, &tmaps); 7441 nminor = current_minor_maps (NULL, &tmaps);
7440 maps = alloca ((nminor + 3) * sizeof *maps); 7442 maps = alloca ((nminor + 4) * sizeof *maps);
7441 nmaps = 0; 7443 nmaps = 0;
7444 tem = KVAR (current_kboard, Voverriding_terminal_local_map);
7445 if (!NILP (tem) && !NILP (Voverriding_local_map_menu_flag))
7446 maps[nmaps++] = tem;
7442 if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem)) 7447 if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem))
7443 maps[nmaps++] = tem; 7448 maps[nmaps++] = tem;
7444 memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0])); 7449 memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0]));
@@ -7963,7 +7968,8 @@ tool_bar_items (Lisp_Object reuse, int *nitems)
7963 to process. */ 7968 to process. */
7964 7969
7965 /* Should overriding-terminal-local-map and overriding-local-map apply? */ 7970 /* Should overriding-terminal-local-map and overriding-local-map apply? */
7966 if (!NILP (Voverriding_local_map_menu_flag)) 7971 if (!NILP (Voverriding_local_map_menu_flag)
7972 && !NILP (Voverriding_local_map))
7967 { 7973 {
7968 /* Yes, use them (if non-nil) as well as the global map. */ 7974 /* Yes, use them (if non-nil) as well as the global map. */
7969 maps = alloca (3 * sizeof *maps); 7975 maps = alloca (3 * sizeof *maps);
@@ -7983,8 +7989,11 @@ tool_bar_items (Lisp_Object reuse, int *nitems)
7983 Lisp_Object tem; 7989 Lisp_Object tem;
7984 ptrdiff_t nminor; 7990 ptrdiff_t nminor;
7985 nminor = current_minor_maps (NULL, &tmaps); 7991 nminor = current_minor_maps (NULL, &tmaps);
7986 maps = alloca ((nminor + 3) * sizeof *maps); 7992 maps = alloca ((nminor + 4) * sizeof *maps);
7987 nmaps = 0; 7993 nmaps = 0;
7994 tem = KVAR (current_kboard, Voverriding_terminal_local_map);
7995 if (!NILP (tem) && !NILP (Voverriding_local_map_menu_flag))
7996 maps[nmaps++] = tem;
7988 if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem)) 7997 if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem))
7989 maps[nmaps++] = tem; 7998 maps[nmaps++] = tem;
7990 memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0])); 7999 memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0]));
@@ -8167,11 +8176,12 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8167#if !defined (USE_GTK) && !defined (HAVE_NS) 8176#if !defined (USE_GTK) && !defined (HAVE_NS)
8168 /* If we use build_desired_tool_bar_string to render the 8177 /* If we use build_desired_tool_bar_string to render the
8169 tool bar, the separator is rendered as an image. */ 8178 tool bar, the separator is rendered as an image. */
8170 PROP (TOOL_BAR_ITEM_IMAGES) 8179 set_prop (TOOL_BAR_ITEM_IMAGES,
8171 = menu_item_eval_property (Vtool_bar_separator_image_expression); 8180 (menu_item_eval_property
8172 PROP (TOOL_BAR_ITEM_ENABLED_P) = Qnil; 8181 (Vtool_bar_separator_image_expression)));
8173 PROP (TOOL_BAR_ITEM_SELECTED_P) = Qnil; 8182 set_prop (TOOL_BAR_ITEM_ENABLED_P, Qnil);
8174 PROP (TOOL_BAR_ITEM_CAPTION) = Qnil; 8183 set_prop (TOOL_BAR_ITEM_SELECTED_P, Qnil);
8184 set_prop (TOOL_BAR_ITEM_CAPTION, Qnil);
8175#endif 8185#endif
8176 return 1; 8186 return 1;
8177 } 8187 }
@@ -11025,10 +11035,6 @@ syms_of_keyboard (void)
11025 DEFSYM (Qlanguage_change, "language-change"); 11035 DEFSYM (Qlanguage_change, "language-change");
11026#endif 11036#endif
11027 11037
11028#ifdef WINDOWSNT
11029 DEFSYM (Qfile_w32notify, "file-w32notify");
11030#endif
11031
11032#ifdef HAVE_DBUS 11038#ifdef HAVE_DBUS
11033 DEFSYM (Qdbus_event, "dbus-event"); 11039 DEFSYM (Qdbus_event, "dbus-event");
11034#endif 11040#endif
@@ -11037,9 +11043,9 @@ syms_of_keyboard (void)
11037 Qxwidget_event = intern ("xwidget-event"); 11043 Qxwidget_event = intern ("xwidget-event");
11038 staticpro (&Qxwidget_event); 11044 staticpro (&Qxwidget_event);
11039#endif /* HAVE_XWIDGETS */ 11045#endif /* HAVE_XWIDGETS */
11040#ifdef HAVE_INOTIFY 11046#ifdef USE_FILE_NOTIFY
11041 DEFSYM (Qfile_inotify, "file-inotify"); 11047 DEFSYM (Qfile_notify, "file-notify");
11042#endif /* HAVE_INOTIFY */ 11048#endif /* USE_FILE_NOTIFY */
11043 11049
11044 DEFSYM (QCenable, ":enable"); 11050 DEFSYM (QCenable, ":enable");
11045 DEFSYM (QCvisible, ":visible"); 11051 DEFSYM (QCvisible, ":visible");
@@ -11476,10 +11482,7 @@ tool-bar separators natively. Otherwise it is unused (e.g. on GTK). */);
11476 11482
11477 DEFVAR_KBOARD ("overriding-terminal-local-map", 11483 DEFVAR_KBOARD ("overriding-terminal-local-map",
11478 Voverriding_terminal_local_map, 11484 Voverriding_terminal_local_map,
11479 doc: /* Per-terminal keymap that overrides all other local keymaps. 11485 doc: /* Per-terminal keymap that takes precedence over all other keymaps.
11480If this variable is non-nil, it is used as a keymap instead of the
11481buffer's local map, and the minor mode keymaps and text property keymaps.
11482It also replaces `overriding-local-map'.
11483 11486
11484This variable is intended to let commands such as `universal-argument' 11487This variable is intended to let commands such as `universal-argument'
11485set up a different keymap for reading the next command. 11488set up a different keymap for reading the next command.
@@ -11489,7 +11492,7 @@ terminal device.
11489See Info node `(elisp)Multiple Terminals'. */); 11492See Info node `(elisp)Multiple Terminals'. */);
11490 11493
11491 DEFVAR_LISP ("overriding-local-map", Voverriding_local_map, 11494 DEFVAR_LISP ("overriding-local-map", Voverriding_local_map,
11492 doc: /* Keymap that overrides all other local keymaps. 11495 doc: /* Keymap that overrides almost all other local keymaps.
11493If this variable is non-nil, it is used as a keymap--replacing the 11496If this variable is non-nil, it is used as a keymap--replacing the
11494buffer's local map, the minor mode keymaps, and char property keymaps. */); 11497buffer's local map, the minor mode keymaps, and char property keymaps. */);
11495 Voverriding_local_map = Qnil; 11498 Voverriding_local_map = Qnil;
@@ -11785,20 +11788,18 @@ keys_of_keyboard (void)
11785 "dbus-handle-event"); 11788 "dbus-handle-event");
11786#endif 11789#endif
11787 11790
11788#ifdef HAVE_INOTIFY 11791#ifdef USE_FILE_NOTIFY
11789 /* Define a special event which is raised for inotify callback 11792 /* Define a special event which is raised for notification callback
11790 functions. */ 11793 functions. */
11791 initial_define_lispy_key (Vspecial_event_map, "file-inotify", 11794 initial_define_lispy_key (Vspecial_event_map, "file-notify",
11792 "inotify-handle-event"); 11795 "file-notify-handle-event");
11793#endif /* HAVE_INOTIFY */ 11796#endif /* USE_FILE_NOTIFY */
11794 11797
11795 initial_define_lispy_key (Vspecial_event_map, "config-changed-event", 11798 initial_define_lispy_key (Vspecial_event_map, "config-changed-event",
11796 "ignore"); 11799 "ignore");
11797#if defined (WINDOWSNT) 11800#if defined (WINDOWSNT)
11798 initial_define_lispy_key (Vspecial_event_map, "language-change", 11801 initial_define_lispy_key (Vspecial_event_map, "language-change",
11799 "ignore"); 11802 "ignore");
11800 initial_define_lispy_key (Vspecial_event_map, "file-w32notify",
11801 "w32notify-handle-event");
11802#endif 11803#endif
11803} 11804}
11804 11805
diff --git a/src/keymap.c b/src/keymap.c
index c43d528b25b..536db77f59b 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -56,28 +56,28 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
56#include "keymap.h" 56#include "keymap.h"
57#include "window.h" 57#include "window.h"
58 58
59/* Actually allocate storage for these variables */ 59/* Actually allocate storage for these variables. */
60 60
61Lisp_Object current_global_map; /* Current global keymap */ 61Lisp_Object current_global_map; /* Current global keymap. */
62 62
63Lisp_Object global_map; /* default global key bindings */ 63Lisp_Object global_map; /* Default global key bindings. */
64 64
65Lisp_Object meta_map; /* The keymap used for globally bound 65Lisp_Object meta_map; /* The keymap used for globally bound
66 ESC-prefixed default commands */ 66 ESC-prefixed default commands. */
67 67
68Lisp_Object control_x_map; /* The keymap used for globally bound 68Lisp_Object control_x_map; /* The keymap used for globally bound
69 C-x-prefixed default commands */ 69 C-x-prefixed default commands. */
70 70
71 /* The keymap used by the minibuf for local 71 /* The keymap used by the minibuf for local
72 bindings when spaces are allowed in the 72 bindings when spaces are allowed in the
73 minibuf */ 73 minibuf. */
74 74
75 /* The keymap used by the minibuf for local 75 /* The keymap used by the minibuf for local
76 bindings when spaces are not encouraged 76 bindings when spaces are not encouraged
77 in the minibuf */ 77 in the minibuf. */
78 78
79/* keymap used for minibuffers when doing completion */ 79/* Keymap used for minibuffers when doing completion. */
80/* keymap used for minibuffers when doing completion and require a match */ 80/* Keymap used for minibuffers when doing completion and require a match. */
81static Lisp_Object Qkeymapp, Qnon_ascii; 81static Lisp_Object Qkeymapp, Qnon_ascii;
82Lisp_Object Qkeymap, Qmenu_item, Qremap; 82Lisp_Object Qkeymap, Qmenu_item, Qremap;
83static Lisp_Object QCadvertised_binding; 83static Lisp_Object QCadvertised_binding;
@@ -1571,17 +1571,14 @@ like in the respective argument of `key-binding'. */)
1571 } 1571 }
1572 } 1572 }
1573 1573
1574 if (!NILP (olp)) 1574 if (!NILP (olp)
1575 {
1576 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
1577 keymaps = Fcons (KVAR (current_kboard, Voverriding_terminal_local_map),
1578 keymaps);
1579 /* The doc said that overriding-terminal-local-map should 1575 /* The doc said that overriding-terminal-local-map should
1580 override overriding-local-map. The code used them both, 1576 override overriding-local-map. The code used them both,
1581 but it seems clearer to use just one. rms, jan 2005. */ 1577 but it seems clearer to use just one. rms, jan 2005. */
1582 else if (!NILP (Voverriding_local_map)) 1578 && NILP (KVAR (current_kboard, Voverriding_terminal_local_map))
1583 keymaps = Fcons (Voverriding_local_map, keymaps); 1579 && !NILP (Voverriding_local_map))
1584 } 1580 keymaps = Fcons (Voverriding_local_map, keymaps);
1581
1585 if (NILP (XCDR (keymaps))) 1582 if (NILP (XCDR (keymaps)))
1586 { 1583 {
1587 Lisp_Object *maps; 1584 Lisp_Object *maps;
@@ -1592,6 +1589,7 @@ like in the respective argument of `key-binding'. */)
1592 Lisp_Object local_map = get_local_map (pt, current_buffer, Qlocal_map); 1589 Lisp_Object local_map = get_local_map (pt, current_buffer, Qlocal_map);
1593 /* This returns nil unless there is a `keymap' property. */ 1590 /* This returns nil unless there is a `keymap' property. */
1594 Lisp_Object keymap = get_local_map (pt, current_buffer, Qkeymap); 1591 Lisp_Object keymap = get_local_map (pt, current_buffer, Qkeymap);
1592 Lisp_Object otlp = KVAR (current_kboard, Voverriding_terminal_local_map);
1595 1593
1596 if (CONSP (position)) 1594 if (CONSP (position))
1597 { 1595 {
@@ -1656,6 +1654,9 @@ like in the respective argument of `key-binding'. */)
1656 1654
1657 if (!NILP (keymap)) 1655 if (!NILP (keymap))
1658 keymaps = Fcons (keymap, keymaps); 1656 keymaps = Fcons (keymap, keymaps);
1657
1658 if (!NILP (olp) && !NILP (otlp))
1659 keymaps = Fcons (otlp, keymaps);
1659 } 1660 }
1660 1661
1661 unbind_to (count, Qnil); 1662 unbind_to (count, Qnil);
@@ -2851,7 +2852,7 @@ You type Translation\n\
2851 2852
2852 insert ("\n", 1); 2853 insert ("\n", 1);
2853 2854
2854 /* Insert calls signal_after_change which may GC. */ 2855 /* Insert calls signal_after_change which may GC. */
2855 translate = SDATA (KVAR (current_kboard, Vkeyboard_translate_table)); 2856 translate = SDATA (KVAR (current_kboard, Vkeyboard_translate_table));
2856 } 2857 }
2857 2858
@@ -2867,6 +2868,14 @@ You type Translation\n\
2867 start1 = Qnil; 2868 start1 = Qnil;
2868 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map))) 2869 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
2869 start1 = KVAR (current_kboard, Voverriding_terminal_local_map); 2870 start1 = KVAR (current_kboard, Voverriding_terminal_local_map);
2871
2872 if (!NILP (start1))
2873 {
2874 describe_map_tree (start1, 1, shadow, prefix,
2875 "\f\nOverriding Bindings", nomenu, 0, 0, 0);
2876 shadow = Fcons (start1, shadow);
2877 start1 = Qnil;
2878 }
2870 else if (!NILP (Voverriding_local_map)) 2879 else if (!NILP (Voverriding_local_map))
2871 start1 = Voverriding_local_map; 2880 start1 = Voverriding_local_map;
2872 2881
diff --git a/src/lisp.h b/src/lisp.h
index d5f614881e4..15eb0306251 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -73,6 +73,7 @@ enum
73 BITS_PER_SHORT = CHAR_BIT * sizeof (short), 73 BITS_PER_SHORT = CHAR_BIT * sizeof (short),
74 BITS_PER_INT = CHAR_BIT * sizeof (int), 74 BITS_PER_INT = CHAR_BIT * sizeof (int),
75 BITS_PER_LONG = CHAR_BIT * sizeof (long int), 75 BITS_PER_LONG = CHAR_BIT * sizeof (long int),
76 BITS_PER_PTRDIFF_T = CHAR_BIT * sizeof (ptrdiff_t),
76 BITS_PER_EMACS_INT = CHAR_BIT * sizeof (EMACS_INT) 77 BITS_PER_EMACS_INT = CHAR_BIT * sizeof (EMACS_INT)
77 }; 78 };
78 79
@@ -2181,12 +2182,24 @@ typedef jmp_buf sys_jmp_buf;
2181#endif 2182#endif
2182 2183
2183 2184
2185/* Elisp uses several stacks:
2186 - the C stack.
2187 - the bytecode stack: used internally by the bytecode interpreter.
2188 Allocated from the C stack.
2189 - The specpdl stack: keeps track of active unwind-protect and
2190 dynamic-let-bindings. Allocated from the `specpdl' array, a manually
2191 managed stack.
2192 - The catch stack: keeps track of active catch tags.
2193 Allocated on the C stack. This is where the setmp data is kept.
2194 - The handler stack: keeps track of active condition-case handlers.
2195 Allocated on the C stack. Every entry there also uses an entry in
2196 the catch stack. */
2197
2184/* Structure for recording Lisp call stack for backtrace purposes. */ 2198/* Structure for recording Lisp call stack for backtrace purposes. */
2185 2199
2186/* The special binding stack holds the outer values of variables while 2200/* The special binding stack holds the outer values of variables while
2187 they are bound by a function application or a let form, stores the 2201 they are bound by a function application or a let form, stores the
2188 code to be executed for Lisp unwind-protect forms, and stores the C 2202 code to be executed for unwind-protect forms.
2189 functions to be called for record_unwind_protect.
2190 2203
2191 If func is non-zero, undoing this binding applies func to old_value; 2204 If func is non-zero, undoing this binding applies func to old_value;
2192 This implements record_unwind_protect. 2205 This implements record_unwind_protect.
@@ -2199,35 +2212,77 @@ typedef jmp_buf sys_jmp_buf;
2199 which means having bound a local value while CURRENT-BUFFER was active. 2212 which means having bound a local value while CURRENT-BUFFER was active.
2200 If WHERE is nil this means we saw the default value when binding SYMBOL. 2213 If WHERE is nil this means we saw the default value when binding SYMBOL.
2201 WHERE being a buffer or frame means we saw a buffer-local or frame-local 2214 WHERE being a buffer or frame means we saw a buffer-local or frame-local
2202 value. Other values of WHERE mean an internal error. */ 2215 value. Other values of WHERE mean an internal error.
2216
2217 NOTE: The specbinding struct is defined here, because SPECPDL_INDEX is
2218 used all over the place, needs to be fast, and needs to know the size of
2219 struct specbinding. But only eval.c should access it. */
2203 2220
2204typedef Lisp_Object (*specbinding_func) (Lisp_Object); 2221typedef Lisp_Object (*specbinding_func) (Lisp_Object);
2205 2222
2223enum specbind_tag {
2224 SPECPDL_UNWIND, /* An unwind_protect function. */
2225 SPECPDL_BACKTRACE, /* An element of the backtrace. */
2226 SPECPDL_LET, /* A plain and simple dynamic let-binding. */
2227 /* Tags greater than SPECPDL_LET must be "subkinds" of LET. */
2228 SPECPDL_LET_LOCAL, /* A buffer-local let-binding. */
2229 SPECPDL_LET_DEFAULT /* A global binding for a localized var. */
2230};
2231
2206struct specbinding 2232struct specbinding
2207 { 2233 {
2208 Lisp_Object symbol, old_value; 2234 enum specbind_tag kind;
2209 specbinding_func func; 2235 union {
2210 Lisp_Object unused; /* Dividing by 16 is faster than by 12. */ 2236 struct {
2237 Lisp_Object arg;
2238 specbinding_func func;
2239 } unwind;
2240 struct {
2241 /* `where' is not used in the case of SPECPDL_LET. */
2242 Lisp_Object symbol, old_value, where;
2243 } let;
2244 struct {
2245 Lisp_Object function;
2246 Lisp_Object *args;
2247 ptrdiff_t nargs : BITS_PER_PTRDIFF_T - 1;
2248 bool debug_on_exit : 1;
2249 } bt;
2250 } v;
2211 }; 2251 };
2212 2252
2253LISP_INLINE Lisp_Object specpdl_symbol (struct specbinding *pdl)
2254{ eassert (pdl->kind >= SPECPDL_LET); return pdl->v.let.symbol; }
2255
2256LISP_INLINE Lisp_Object specpdl_old_value (struct specbinding *pdl)
2257{ eassert (pdl->kind >= SPECPDL_LET); return pdl->v.let.old_value; }
2258
2259LISP_INLINE Lisp_Object specpdl_where (struct specbinding *pdl)
2260{ eassert (pdl->kind > SPECPDL_LET); return pdl->v.let.where; }
2261
2262LISP_INLINE Lisp_Object specpdl_arg (struct specbinding *pdl)
2263{ eassert (pdl->kind == SPECPDL_UNWIND); return pdl->v.unwind.arg; }
2264
2265LISP_INLINE specbinding_func specpdl_func (struct specbinding *pdl)
2266{ eassert (pdl->kind == SPECPDL_UNWIND); return pdl->v.unwind.func; }
2267
2268LISP_INLINE Lisp_Object backtrace_function (struct specbinding *pdl)
2269{ eassert (pdl->kind == SPECPDL_BACKTRACE); return pdl->v.bt.function; }
2270
2271LISP_INLINE ptrdiff_t backtrace_nargs (struct specbinding *pdl)
2272{ eassert (pdl->kind == SPECPDL_BACKTRACE); return pdl->v.bt.nargs; }
2273
2274LISP_INLINE Lisp_Object *backtrace_args (struct specbinding *pdl)
2275{ eassert (pdl->kind == SPECPDL_BACKTRACE); return pdl->v.bt.args; }
2276
2277LISP_INLINE bool backtrace_debug_on_exit (struct specbinding *pdl)
2278{ eassert (pdl->kind == SPECPDL_BACKTRACE); return pdl->v.bt.debug_on_exit; }
2279
2213extern struct specbinding *specpdl; 2280extern struct specbinding *specpdl;
2214extern struct specbinding *specpdl_ptr; 2281extern struct specbinding *specpdl_ptr;
2215extern ptrdiff_t specpdl_size; 2282extern ptrdiff_t specpdl_size;
2216 2283
2217#define SPECPDL_INDEX() (specpdl_ptr - specpdl) 2284#define SPECPDL_INDEX() (specpdl_ptr - specpdl)
2218 2285
2219struct backtrace
2220{
2221 struct backtrace *next;
2222 Lisp_Object function;
2223 Lisp_Object *args; /* Points to vector of args. */
2224 ptrdiff_t nargs; /* Length of vector. */
2225 /* Nonzero means call value of debugger when done with this operation. */
2226 unsigned int debug_on_exit : 1;
2227};
2228
2229extern struct backtrace *backtrace_list;
2230
2231/* Everything needed to describe an active condition case. 2286/* Everything needed to describe an active condition case.
2232 2287
2233 Members are volatile if their values need to survive _longjmp when 2288 Members are volatile if their values need to survive _longjmp when
@@ -2282,9 +2337,10 @@ struct catchtag
2282 Lisp_Object tag; 2337 Lisp_Object tag;
2283 Lisp_Object volatile val; 2338 Lisp_Object volatile val;
2284 struct catchtag *volatile next; 2339 struct catchtag *volatile next;
2340#if 1 /* GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS, but they're defined later. */
2285 struct gcpro *gcpro; 2341 struct gcpro *gcpro;
2342#endif
2286 sys_jmp_buf jmp; 2343 sys_jmp_buf jmp;
2287 struct backtrace *backlist;
2288 struct handler *handlerlist; 2344 struct handler *handlerlist;
2289 EMACS_INT lisp_eval_depth; 2345 EMACS_INT lisp_eval_depth;
2290 ptrdiff_t volatile pdlcount; 2346 ptrdiff_t volatile pdlcount;
@@ -3342,10 +3398,15 @@ extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...);
3342extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); 3398extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
3343extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); 3399extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
3344extern void init_eval (void); 3400extern void init_eval (void);
3345#if BYTE_MARK_STACK
3346extern void mark_backtrace (void);
3347#endif
3348extern void syms_of_eval (void); 3401extern void syms_of_eval (void);
3402extern void record_in_backtrace (Lisp_Object function,
3403 Lisp_Object *args, ptrdiff_t nargs);
3404extern void mark_specpdl (void);
3405extern void get_backtrace (Lisp_Object array);
3406Lisp_Object backtrace_top_function (void);
3407extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol);
3408extern bool let_shadows_global_binding_p (Lisp_Object symbol);
3409
3349 3410
3350/* Defined in editfns.c. */ 3411/* Defined in editfns.c. */
3351extern Lisp_Object Qfield; 3412extern Lisp_Object Qfield;
@@ -3728,9 +3789,10 @@ extern void syms_of_fontset (void);
3728extern Lisp_Object Qfont_param; 3789extern Lisp_Object Qfont_param;
3729#endif 3790#endif
3730 3791
3731#ifdef WINDOWSNT 3792/* Defined in gfilenotify.c */
3732/* Defined on w32notify.c. */ 3793#ifdef HAVE_GFILENOTIFY
3733extern void syms_of_w32notify (void); 3794extern void globals_of_gfilenotify (void);
3795extern void syms_of_gfilenotify (void);
3734#endif 3796#endif
3735 3797
3736/* Defined in inotify.c */ 3798/* Defined in inotify.c */
@@ -3738,6 +3800,11 @@ extern void syms_of_w32notify (void);
3738extern void syms_of_inotify (void); 3800extern void syms_of_inotify (void);
3739#endif 3801#endif
3740 3802
3803#ifdef HAVE_W32NOTIFY
3804/* Defined on w32notify.c. */
3805extern void syms_of_w32notify (void);
3806#endif
3807
3741/* Defined in xfaces.c. */ 3808/* Defined in xfaces.c. */
3742extern Lisp_Object Qdefault, Qtool_bar, Qfringe; 3809extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
3743extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor; 3810extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
diff --git a/src/lisp.mk b/src/lisp.mk
index 174e53ed561..edd81bcf493 100644
--- a/src/lisp.mk
+++ b/src/lisp.mk
@@ -129,6 +129,7 @@ lisp = \
129 $(lispsource)/textmodes/page.elc \ 129 $(lispsource)/textmodes/page.elc \
130 $(lispsource)/register.elc \ 130 $(lispsource)/register.elc \
131 $(lispsource)/textmodes/paragraphs.elc \ 131 $(lispsource)/textmodes/paragraphs.elc \
132 $(lispsource)/progmodes/prog-mode.elc \
132 $(lispsource)/emacs-lisp/lisp-mode.elc \ 133 $(lispsource)/emacs-lisp/lisp-mode.elc \
133 $(lispsource)/textmodes/text-mode.elc \ 134 $(lispsource)/textmodes/text-mode.elc \
134 $(lispsource)/textmodes/fill.elc \ 135 $(lispsource)/textmodes/fill.elc \
diff --git a/src/nsfns.m b/src/nsfns.m
index 1170472573e..94339183159 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -287,7 +287,7 @@ static void
287x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 287x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
288{ 288{
289 NSColor *col; 289 NSColor *col;
290 CGFloat r, g, b, alpha; 290 EmacsCGFloat r, g, b, alpha;
291 291
292 if (ns_lisp_to_color (arg, &col)) 292 if (ns_lisp_to_color (arg, &col))
293 { 293 {
@@ -319,7 +319,7 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
319 struct face *face; 319 struct face *face;
320 NSColor *col; 320 NSColor *col;
321 NSView *view = FRAME_NS_VIEW (f); 321 NSView *view = FRAME_NS_VIEW (f);
322 CGFloat r, g, b, alpha; 322 EmacsCGFloat r, g, b, alpha;
323 323
324 if (ns_lisp_to_color (arg, &col)) 324 if (ns_lisp_to_color (arg, &col))
325 { 325 {
@@ -344,7 +344,7 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
344 { 344 {
345 [[view window] setBackgroundColor: col]; 345 [[view window] setBackgroundColor: col];
346 346
347 if (alpha != 1.0) 347 if (alpha != (EmacsCGFloat) 1.0)
348 [[view window] setOpaque: NO]; 348 [[view window] setOpaque: NO];
349 else 349 else
350 [[view window] setOpaque: YES]; 350 [[view window] setOpaque: YES];
@@ -714,7 +714,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
714} 714}
715 715
716 716
717void 717static void
718ns_implicitly_set_icon_type (struct frame *f) 718ns_implicitly_set_icon_type (struct frame *f)
719{ 719{
720 Lisp_Object tem; 720 Lisp_Object tem;
@@ -859,7 +859,7 @@ ns_cursor_type_to_lisp (int arg)
859} 859}
860 860
861/* This is the same as the xfns.c definition. */ 861/* This is the same as the xfns.c definition. */
862void 862static void
863x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) 863x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
864{ 864{
865 set_frame_cursor_types (f, arg); 865 set_frame_cursor_types (f, arg);
@@ -1082,7 +1082,6 @@ This function is an internal primitive--use `make-frame' instead. */)
1082 struct ns_display_info *dpyinfo = NULL; 1082 struct ns_display_info *dpyinfo = NULL;
1083 Lisp_Object parent; 1083 Lisp_Object parent;
1084 struct kboard *kb; 1084 struct kboard *kb;
1085 Lisp_Object tfont, tfontsize;
1086 static int desc_ctr = 1; 1085 static int desc_ctr = 1;
1087 1086
1088 /* x_get_arg modifies parms. */ 1087 /* x_get_arg modifies parms. */
@@ -1189,10 +1188,10 @@ This function is an internal primitive--use `make-frame' instead. */)
1189 { 1188 {
1190 /* use for default font name */ 1189 /* use for default font name */
1191 id font = [NSFont userFixedPitchFontOfSize: -1.0]; /* default */ 1190 id font = [NSFont userFixedPitchFontOfSize: -1.0]; /* default */
1192 tfontsize = x_default_parameter (f, parms, Qfontsize, 1191 x_default_parameter (f, parms, Qfontsize,
1193 make_number (0 /*(int)[font pointSize]*/), 1192 make_number (0 /*(int)[font pointSize]*/),
1194 "fontSize", "FontSize", RES_TYPE_NUMBER); 1193 "fontSize", "FontSize", RES_TYPE_NUMBER);
1195 tfont = x_default_parameter (f, parms, Qfont, 1194 x_default_parameter (f, parms, Qfont,
1196 build_string ([[font fontName] UTF8String]), 1195 build_string ([[font fontName] UTF8String]),
1197 "font", "Font", RES_TYPE_STRING); 1196 "font", "Font", RES_TYPE_STRING);
1198 } 1197 }
@@ -1410,6 +1409,7 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */)
1410{ 1409{
1411 static id fileDelegate = nil; 1410 static id fileDelegate = nil;
1412 BOOL ret; 1411 BOOL ret;
1412 BOOL isSave = NILP (mustmatch) && NILP (dir_only_p);
1413 id panel; 1413 id panel;
1414 Lisp_Object fname; 1414 Lisp_Object fname;
1415 1415
@@ -1431,7 +1431,7 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */)
1431 if ([dirS characterAtIndex: 0] == '~') 1431 if ([dirS characterAtIndex: 0] == '~')
1432 dirS = [dirS stringByExpandingTildeInPath]; 1432 dirS = [dirS stringByExpandingTildeInPath];
1433 1433
1434 panel = NILP (mustmatch) && NILP (dir_only_p) ? 1434 panel = isSave ?
1435 (id)[EmacsSavePanel savePanel] : (id)[EmacsOpenPanel openPanel]; 1435 (id)[EmacsSavePanel savePanel] : (id)[EmacsOpenPanel openPanel];
1436 1436
1437 [panel setTitle: promptS]; 1437 [panel setTitle: promptS];
@@ -1446,7 +1446,7 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */)
1446 [panel setCanChooseDirectories: YES]; 1446 [panel setCanChooseDirectories: YES];
1447 [panel setCanChooseFiles: NO]; 1447 [panel setCanChooseFiles: NO];
1448 } 1448 }
1449 else 1449 else if (! isSave)
1450 { 1450 {
1451 /* This is not quite what the documentation says, but it is compatible 1451 /* This is not quite what the documentation says, but it is compatible
1452 with the Gtk+ code. Also, the menu entry says "Open File...". */ 1452 with the Gtk+ code. Also, the menu entry says "Open File...". */
@@ -1481,8 +1481,8 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */)
1481 1481
1482 if (ret) 1482 if (ret)
1483 { 1483 {
1484 NSString *str = [panel getFilename]; 1484 NSString *str = ns_filename_from_panel (panel);
1485 if (! str) str = [panel getDirectory]; 1485 if (! str) str = ns_directory_from_panel (panel);
1486 if (! str) ret = NO; 1486 if (! str) ret = NO;
1487 else fname = build_string ([str UTF8String]); 1487 else fname = build_string ([str UTF8String]);
1488 } 1488 }
@@ -1909,7 +1909,9 @@ DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0,
1909#else 1909#else
1910 Lisp_Object ret = Qnil; 1910 Lisp_Object ret = Qnil;
1911 NSMenu *svcs; 1911 NSMenu *svcs;
1912#ifdef NS_IMPL_COCOA
1912 id delegate; 1913 id delegate;
1914#endif
1913 1915
1914 check_window_system (NULL); 1916 check_window_system (NULL);
1915 svcs = [[NSMenu alloc] initWithTitle: @"Services"]; 1917 svcs = [[NSMenu alloc] initWithTitle: @"Services"];
@@ -1992,15 +1994,9 @@ DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc,
1992 1994
1993 CHECK_STRING (str); 1995 CHECK_STRING (str);
1994 utfStr = [NSString stringWithUTF8String: SSDATA (str)]; 1996 utfStr = [NSString stringWithUTF8String: SSDATA (str)];
1995 if (![utfStr respondsToSelector: 1997#ifdef NS_IMPL_COCOA
1996 @selector (precomposedStringWithCanonicalMapping)])
1997 {
1998 message1
1999 ("Warning: ns-convert-utf8-nfd-to-nfc unsupported under GNUstep.\n");
2000 return Qnil;
2001 }
2002 else
2003 utfStr = [utfStr precomposedStringWithCanonicalMapping]; 1998 utfStr = [utfStr precomposedStringWithCanonicalMapping];
1999#endif
2004 return build_string ([utfStr UTF8String]); 2000 return build_string ([utfStr UTF8String]);
2005} 2001}
2006 2002
@@ -2155,6 +2151,9 @@ x_set_scroll_bar_default_width (struct frame *f)
2155} 2151}
2156 2152
2157 2153
2154extern const char *x_get_string_resource (XrmDatabase, char *, char *);
2155
2156
2158/* terms impl this instead of x-get-resource directly */ 2157/* terms impl this instead of x-get-resource directly */
2159const char * 2158const char *
2160x_get_string_resource (XrmDatabase rdb, char *name, char *class) 2159x_get_string_resource (XrmDatabase rdb, char *name, char *class)
@@ -2203,13 +2202,6 @@ x_pixel_height (struct frame *f)
2203} 2202}
2204 2203
2205 2204
2206int
2207x_screen_planes (struct frame *f)
2208{
2209 return FRAME_NS_DISPLAY_INFO (f)->n_planes;
2210}
2211
2212
2213void 2205void
2214x_sync (struct frame *f) 2206x_sync (struct frame *f)
2215{ 2207{
@@ -2242,7 +2234,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2242 (Lisp_Object color, Lisp_Object frame) 2234 (Lisp_Object color, Lisp_Object frame)
2243{ 2235{
2244 NSColor * col; 2236 NSColor * col;
2245 CGFloat red, green, blue, alpha; 2237 EmacsCGFloat red, green, blue, alpha;
2246 2238
2247 check_window_system (NULL); 2239 check_window_system (NULL);
2248 CHECK_STRING (color); 2240 CHECK_STRING (color);
@@ -2434,11 +2426,10 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
2434 struct MonitorInfo *m = &monitors[i]; 2426 struct MonitorInfo *m = &monitors[i];
2435 NSRect fr = [s frame]; 2427 NSRect fr = [s frame];
2436 NSRect vfr = [s visibleFrame]; 2428 NSRect vfr = [s visibleFrame];
2437 NSDictionary *dict = [s deviceDescription];
2438 NSValue *resval = [dict valueForKey:NSDeviceResolution];
2439 short y, vy; 2429 short y, vy;
2440 2430
2441#ifdef NS_IMPL_COCOA 2431#ifdef NS_IMPL_COCOA
2432 NSDictionary *dict = [s deviceDescription];
2442 NSNumber *nid = [dict objectForKey:@"NSScreenNumber"]; 2433 NSNumber *nid = [dict objectForKey:@"NSScreenNumber"];
2443 CGDirectDisplayID did = [nid unsignedIntValue]; 2434 CGDirectDisplayID did = [nid unsignedIntValue];
2444#endif 2435#endif
@@ -2776,14 +2767,6 @@ handlePanelKeys (NSSavePanel *panel, NSEvent *theEvent)
2776 [NSApp stop: self]; 2767 [NSApp stop: self];
2777} 2768}
2778#endif 2769#endif
2779- (NSString *) getFilename
2780{
2781 return ns_filename_from_panel (self);
2782}
2783- (NSString *) getDirectory
2784{
2785 return ns_directory_from_panel (self);
2786}
2787 2770
2788- (BOOL)performKeyEquivalent:(NSEvent *)theEvent 2771- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
2789{ 2772{
@@ -2807,8 +2790,8 @@ handlePanelKeys (NSSavePanel *panel, NSEvent *theEvent)
2807 [super ok: sender]; 2790 [super ok: sender];
2808 2791
2809 // If not choosing directories, and Open is pressed on a directory, return. 2792 // If not choosing directories, and Open is pressed on a directory, return.
2810 if (! [self canChooseDirectories] && [self getDirectory] && 2793 if (! [self canChooseDirectories] && ns_directory_from_panel (self) &&
2811 ! [self getFilename]) 2794 ! ns_filename_from_panel (self))
2812 return; 2795 return;
2813 2796
2814 panelOK = 1; 2797 panelOK = 1;
@@ -2821,14 +2804,6 @@ handlePanelKeys (NSSavePanel *panel, NSEvent *theEvent)
2821} 2804}
2822 2805
2823#endif 2806#endif
2824- (NSString *) getFilename
2825{
2826 return ns_filename_from_panel (self);
2827}
2828- (NSString *) getDirectory
2829{
2830 return ns_directory_from_panel (self);
2831}
2832- (BOOL)performKeyEquivalent:(NSEvent *)theEvent 2807- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
2833{ 2808{
2834 // NSOpenPanel inherits NSSavePanel, so passing self is OK. 2809 // NSOpenPanel inherits NSSavePanel, so passing self is OK.
diff --git a/src/nsfont.m b/src/nsfont.m
index 9ab369d1fcd..709f2cb0d86 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -119,7 +119,7 @@ ns_attribute_fvalue (NSFontDescriptor *fdesc, NSString *trait)
119{ 119{
120 NSDictionary *tdict = [fdesc objectForKey: NSFontTraitsAttribute]; 120 NSDictionary *tdict = [fdesc objectForKey: NSFontTraitsAttribute];
121 NSNumber *val = [tdict objectForKey: trait]; 121 NSNumber *val = [tdict objectForKey: trait];
122 return val == nil ? 0.0 : [val floatValue]; 122 return val == nil ? 0.0F : [val floatValue];
123} 123}
124 124
125 125
@@ -138,15 +138,15 @@ ns_spec_to_descriptor (Lisp_Object font_spec)
138 /* add each attr in font_spec to fdAttrs.. */ 138 /* add each attr in font_spec to fdAttrs.. */
139 n = min (FONT_WEIGHT_NUMERIC (font_spec), 200); 139 n = min (FONT_WEIGHT_NUMERIC (font_spec), 200);
140 if (n != -1 && n != STYLE_REF) 140 if (n != -1 && n != STYLE_REF)
141 [tdict setObject: [NSNumber numberWithFloat: (n - 100.0) / 100.0] 141 [tdict setObject: [NSNumber numberWithFloat: (n - 100.0F) / 100.0F]
142 forKey: NSFontWeightTrait]; 142 forKey: NSFontWeightTrait];
143 n = min (FONT_SLANT_NUMERIC (font_spec), 200); 143 n = min (FONT_SLANT_NUMERIC (font_spec), 200);
144 if (n != -1 && n != STYLE_REF) 144 if (n != -1 && n != STYLE_REF)
145 [tdict setObject: [NSNumber numberWithFloat: (n - 100.0) / 100.0] 145 [tdict setObject: [NSNumber numberWithFloat: (n - 100.0F) / 100.0F]
146 forKey: NSFontSlantTrait]; 146 forKey: NSFontSlantTrait];
147 n = min (FONT_WIDTH_NUMERIC (font_spec), 200); 147 n = min (FONT_WIDTH_NUMERIC (font_spec), 200);
148 if (n > -1 && (n > STYLE_REF + 10 || n < STYLE_REF - 10)) 148 if (n > -1 && (n > STYLE_REF + 10 || n < STYLE_REF - 10))
149 [tdict setObject: [NSNumber numberWithFloat: (n - 100.0) / 100.0] 149 [tdict setObject: [NSNumber numberWithFloat: (n - 100.0F) / 100.0F]
150 forKey: NSFontWidthTrait]; 150 forKey: NSFontWidthTrait];
151 if ([tdict count] > 0) 151 if ([tdict count] > 0)
152 [fdAttrs setObject: tdict forKey: NSFontTraitsAttribute]; 152 [fdAttrs setObject: tdict forKey: NSFontTraitsAttribute];
@@ -240,10 +240,10 @@ ns_fallback_entity (void)
240 240
241 241
242/* Utility: get width of a char c in screen font SFONT */ 242/* Utility: get width of a char c in screen font SFONT */
243static float 243static CGFloat
244ns_char_width (NSFont *sfont, int c) 244ns_char_width (NSFont *sfont, int c)
245{ 245{
246 float w = -1.0; 246 CGFloat w = -1.0;
247 NSString *cstr = [NSString stringWithFormat: @"%c", c]; 247 NSString *cstr = [NSString stringWithFormat: @"%c", c];
248 248
249#ifdef NS_IMPL_COCOA 249#ifdef NS_IMPL_COCOA
@@ -269,7 +269,7 @@ static NSString *ascii_printable;
269static int 269static int
270ns_ascii_average_width (NSFont *sfont) 270ns_ascii_average_width (NSFont *sfont)
271{ 271{
272 float w = -1.0; 272 CGFloat w = -1.0;
273 273
274 if (!ascii_printable) 274 if (!ascii_printable)
275 { 275 {
@@ -288,14 +288,14 @@ ns_ascii_average_width (NSFont *sfont)
288 w = [sfont advancementForGlyph: glyph].width; 288 w = [sfont advancementForGlyph: glyph].width;
289#endif 289#endif
290 290
291 if (w < 0.0) 291 if (w < (CGFloat) 0.0)
292 { 292 {
293 NSDictionary *attrsDictionary = 293 NSDictionary *attrsDictionary =
294 [NSDictionary dictionaryWithObject: sfont forKey: NSFontAttributeName]; 294 [NSDictionary dictionaryWithObject: sfont forKey: NSFontAttributeName];
295 w = [ascii_printable sizeWithAttributes: attrsDictionary].width; 295 w = [ascii_printable sizeWithAttributes: attrsDictionary].width;
296 } 296 }
297 297
298 return lrint (w / 95.0); 298 return lrint (w / (CGFloat) 95.0);
299} 299}
300 300
301 301
@@ -323,7 +323,7 @@ ns_charset_covers(NSCharacterSet *set1, NSCharacterSet *set2, float pct)
323 off++; 323 off++;
324 } 324 }
325//fprintf(stderr, "off = %d\ttot = %d\n", off,tot); 325//fprintf(stderr, "off = %d\ttot = %d\n", off,tot);
326 return (float)off / tot < 1.0 - pct; 326 return (float)off / tot < 1.0F - pct;
327} 327}
328 328
329 329
@@ -514,8 +514,8 @@ static NSSet
514 if (ns_charset_covers(fset, charset, pct)) 514 if (ns_charset_covers(fset, charset, pct))
515 [families addObject: family]; 515 [families addObject: family];
516 } 516 }
517 pct -= 0.2; 517 pct -= 0.2F;
518 if ([families count] > 0 || pct < 0.05) 518 if ([families count] > 0 || pct < 0.05F)
519 break; 519 break;
520 } 520 }
521 [charset release]; 521 [charset release];
@@ -763,9 +763,9 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
763 family = [[NSFont userFixedPitchFontOfSize: 0] familyName]; 763 family = [[NSFont userFixedPitchFontOfSize: 0] familyName];
764 /* Should be > 0.23 as some font descriptors (e.g. Terminus) set to that 764 /* Should be > 0.23 as some font descriptors (e.g. Terminus) set to that
765 when setting family in ns_spec_to_descriptor(). */ 765 when setting family in ns_spec_to_descriptor(). */
766 if (ns_attribute_fvalue (fontDesc, NSFontWeightTrait) > 0.50) 766 if (ns_attribute_fvalue (fontDesc, NSFontWeightTrait) > 0.50F)
767 traits |= NSBoldFontMask; 767 traits |= NSBoldFontMask;
768 if (fabs (ns_attribute_fvalue (fontDesc, NSFontSlantTrait) > 0.05)) 768 if (fabs (ns_attribute_fvalue (fontDesc, NSFontSlantTrait) > 0.05F))
769 traits |= NSItalicFontMask; 769 traits |= NSItalicFontMask;
770 770
771 /* see http://cocoadev.com/forums/comments.php?DiscussionID=74 */ 771 /* see http://cocoadev.com/forums/comments.php?DiscussionID=74 */
@@ -880,7 +880,7 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
880 font_info->max_bounds.width = lrint (font_info->width); 880 font_info->max_bounds.width = lrint (font_info->width);
881 font_info->max_bounds.lbearing = lrint (brect.origin.x); 881 font_info->max_bounds.lbearing = lrint (brect.origin.x);
882 font_info->max_bounds.rbearing = 882 font_info->max_bounds.rbearing =
883 lrint (brect.size.width - font_info->width); 883 lrint (brect.size.width - (CGFloat) font_info->width);
884 884
885#ifdef NS_IMPL_COCOA 885#ifdef NS_IMPL_COCOA
886 /* set up synthItal and the CG font */ 886 /* set up synthItal and the CG font */
@@ -1041,8 +1041,8 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1041/* NOTE: focus and clip must be set 1041/* NOTE: focus and clip must be set
1042 also, currently assumed (true in nsterm.m call) from ==0, to ==nchars */ 1042 also, currently assumed (true in nsterm.m call) from ==0, to ==nchars */
1043{ 1043{
1044 static char cbuf[1024]; 1044 static unsigned char cbuf[1024];
1045 char *c = cbuf; 1045 unsigned char *c = cbuf;
1046#ifdef NS_IMPL_GNUSTEP 1046#ifdef NS_IMPL_GNUSTEP
1047 static float advances[1024]; 1047 static float advances[1024];
1048 float *adv = advances; 1048 float *adv = advances;
@@ -1209,7 +1209,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1209 [bgCol set]; 1209 [bgCol set];
1210 DPSmoveto (context, r.origin.x, r.origin.y); 1210 DPSmoveto (context, r.origin.x, r.origin.y);
1211/*[context GSSetTextDrawingMode: GSTextFillStroke]; /// not implemented yet */ 1211/*[context GSSetTextDrawingMode: GSTextFillStroke]; /// not implemented yet */
1212 DPSxshow (context, cbuf, advances, len); 1212 DPSxshow (context, (const char *) cbuf, advances, len);
1213 DPSstroke (context); 1213 DPSstroke (context);
1214 [col set]; 1214 [col set];
1215/*[context GSSetTextDrawingMode: GSTextFill]; /// not implemented yet */ 1215/*[context GSSetTextDrawingMode: GSTextFill]; /// not implemented yet */
@@ -1219,7 +1219,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1219 1219
1220 /* draw with DPSxshow () */ 1220 /* draw with DPSxshow () */
1221 DPSmoveto (context, r.origin.x, r.origin.y); 1221 DPSmoveto (context, r.origin.x, r.origin.y);
1222 DPSxshow (context, cbuf, advances, len); 1222 DPSxshow (context, (const char *) cbuf, advances, len);
1223 DPSstroke (context); 1223 DPSstroke (context);
1224 1224
1225 DPSgrestore (context); 1225 DPSgrestore (context);
@@ -1407,7 +1407,7 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block)
1407 metrics = font_info->metrics[block]; 1407 metrics = font_info->metrics[block];
1408 for (g = block<<8, i =0; i<0x100 && g < numGlyphs; g++, i++, metrics++) 1408 for (g = block<<8, i =0; i<0x100 && g < numGlyphs; g++, i++, metrics++)
1409 { 1409 {
1410 float w, lb, rb; 1410 CGFloat w, lb, rb;
1411 NSRect r = [sfont boundingRectForGlyph: g]; 1411 NSRect r = [sfont boundingRectForGlyph: g];
1412 1412
1413 w = max ([sfont advancementForGlyph: g].width, 2.0); 1413 w = max ([sfont advancementForGlyph: g].width, 2.0);
@@ -1419,7 +1419,7 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block)
1419 if (lb < 0) 1419 if (lb < 0)
1420 metrics->lbearing = round (lb - LCD_SMOOTHING_MARGIN); 1420 metrics->lbearing = round (lb - LCD_SMOOTHING_MARGIN);
1421 if (font_info->ital) 1421 if (font_info->ital)
1422 rb += 0.22 * font_info->height; 1422 rb += (CGFloat) (0.22F * font_info->height);
1423 metrics->rbearing = lrint (w + rb + LCD_SMOOTHING_MARGIN); 1423 metrics->rbearing = lrint (w + rb + LCD_SMOOTHING_MARGIN);
1424 1424
1425 metrics->descent = r.origin.y < 0 ? -r.origin.y : 0; 1425 metrics->descent = r.origin.y < 0 ? -r.origin.y : 0;
diff --git a/src/nsimage.m b/src/nsimage.m
index 9d21ba8afca..a1703272ad2 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -334,7 +334,7 @@ static EmacsImage *ImageList = nil;
334{ 334{
335 NSSize s = [self size]; 335 NSSize s = [self size];
336 unsigned char *planes[5]; 336 unsigned char *planes[5];
337 CGFloat r, g, b, a; 337 EmacsCGFloat r, g, b, a;
338 NSColor *rgbColor; 338 NSColor *rgbColor;
339 339
340 if (bmRep == nil || color == nil) 340 if (bmRep == nil || color == nil)
@@ -437,7 +437,7 @@ static EmacsImage *ImageList = nil;
437 else 437 else
438 { 438 {
439 NSColor *color = [bmRep colorAtX: x y: y]; 439 NSColor *color = [bmRep colorAtX: x y: y];
440 CGFloat r, g, b, a; 440 EmacsCGFloat r, g, b, a;
441 [color getRed: &r green: &g blue: &b alpha: &a]; 441 [color getRed: &r green: &g blue: &b alpha: &a];
442 return ((int)(a * 255.0) << 24) 442 return ((int)(a * 255.0) << 24)
443 | ((int)(r * 255.0) << 16) | ((int)(g * 255.0) << 8) 443 | ((int)(r * 255.0) << 16) | ((int)(g * 255.0) << 8)
diff --git a/src/nsmenu.m b/src/nsmenu.m
index baa683941f8..1d3d111e9a1 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -45,8 +45,6 @@ Carbon version by Yamamoto Mitsuharu. */
45#include <sys/types.h> 45#include <sys/types.h>
46#endif 46#endif
47 47
48#define MenuStagger 10.0
49
50#if 0 48#if 0
51int menu_trace_num = 0; 49int menu_trace_num = 0;
52#define NSTRACE(x) fprintf (stderr, "%s:%d: [%d] " #x "\n", \ 50#define NSTRACE(x) fprintf (stderr, "%s:%d: [%d] " #x "\n", \
@@ -112,7 +110,7 @@ popup_activated (void)
112 2) deep_p, submenu = nil: Recompute all submenus. 110 2) deep_p, submenu = nil: Recompute all submenus.
113 3) deep_p, submenu = non-nil: Update contents of a single submenu. 111 3) deep_p, submenu = non-nil: Update contents of a single submenu.
114 -------------------------------------------------------------------------- */ 112 -------------------------------------------------------------------------- */
115void 113static void
116ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu) 114ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
117{ 115{
118 NSAutoreleasePool *pool; 116 NSAutoreleasePool *pool;
@@ -505,6 +503,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
505void 503void
506x_activate_menubar (struct frame *f) 504x_activate_menubar (struct frame *f)
507{ 505{
506#ifdef NS_IMPL_COCOA
508 NSArray *a = [[NSApp mainMenu] itemArray]; 507 NSArray *a = [[NSApp mainMenu] itemArray];
509 /* Update each submenu separately so ns_update_menubar doesn't reset 508 /* Update each submenu separately so ns_update_menubar doesn't reset
510 the delegate. */ 509 the delegate. */
@@ -521,6 +520,7 @@ x_activate_menubar (struct frame *f)
521 ++i; 520 ++i;
522 } 521 }
523 ns_check_pending_open_menu (); 522 ns_check_pending_open_menu ();
523#endif
524} 524}
525 525
526 526
@@ -740,7 +740,7 @@ extern NSString *NSMenuDidBeginTrackingNotification;
740 [self setSubmenu: submenu forItem: item]; 740 [self setSubmenu: submenu forItem: item];
741 [submenu fillWithWidgetValue: wv->contents]; 741 [submenu fillWithWidgetValue: wv->contents];
742 [submenu release]; 742 [submenu release];
743 [item setAction: nil]; 743 [item setAction: (SEL)nil];
744 } 744 }
745 } 745 }
746 746
@@ -757,7 +757,7 @@ extern NSString *NSMenuDidBeginTrackingNotification;
757{ 757{
758 NSString *titleStr = [NSString stringWithUTF8String: title]; 758 NSString *titleStr = [NSString stringWithUTF8String: title];
759 NSMenuItem *item = [self addItemWithTitle: titleStr 759 NSMenuItem *item = [self addItemWithTitle: titleStr
760 action: nil /*@selector (menuDown:) */ 760 action: (SEL)nil /*@selector (menuDown:) */
761 keyEquivalent: @""]; 761 keyEquivalent: @""];
762 EmacsMenu *submenu = [[EmacsMenu alloc] initWithTitle: titleStr frame: f]; 762 EmacsMenu *submenu = [[EmacsMenu alloc] initWithTitle: titleStr frame: f];
763 [self setSubmenu: submenu forItem: item]; 763 [self setSubmenu: submenu forItem: item];
@@ -1045,13 +1045,18 @@ update_frame_tool_bar (FRAME_PTR f)
1045 Update toolbar contents 1045 Update toolbar contents
1046 -------------------------------------------------------------------------- */ 1046 -------------------------------------------------------------------------- */
1047{ 1047{
1048 int i; 1048 int i, k = 0;
1049 EmacsView *view = FRAME_NS_VIEW (f); 1049 EmacsView *view = FRAME_NS_VIEW (f);
1050 NSWindow *window = [view window]; 1050 NSWindow *window = [view window];
1051 EmacsToolbar *toolbar = [view toolbar]; 1051 EmacsToolbar *toolbar = [view toolbar];
1052 1052
1053 block_input (); 1053 block_input ();
1054
1055#ifdef NS_IMPL_COCOA
1054 [toolbar clearActive]; 1056 [toolbar clearActive];
1057#else
1058 [toolbar clearAll];
1059#endif
1055 1060
1056 /* update EmacsToolbar as in GtkUtils, build items list */ 1061 /* update EmacsToolbar as in GtkUtils, build items list */
1057 for (i = 0; i < f->n_tool_bar_items; ++i) 1062 for (i = 0; i < f->n_tool_bar_items; ++i)
@@ -1067,6 +1072,15 @@ update_frame_tool_bar (FRAME_PTR f)
1067 Lisp_Object helpObj; 1072 Lisp_Object helpObj;
1068 const char *helpText; 1073 const char *helpText;
1069 1074
1075 /* Check if this is a separator. */
1076 if (EQ (TOOLPROP (TOOL_BAR_ITEM_TYPE), Qt))
1077 {
1078 /* Skip separators. Newer OSX don't show them, and on GNUStep they
1079 are wide as a button, thus overflowing the toolbar most of
1080 the time. */
1081 continue;
1082 }
1083
1070 /* If image is a vector, choose the image according to the 1084 /* If image is a vector, choose the image according to the
1071 button state. */ 1085 button state. */
1072 image = TOOLPROP (TOOL_BAR_ITEM_IMAGES); 1086 image = TOOLPROP (TOOL_BAR_ITEM_IMAGES);
@@ -1103,7 +1117,10 @@ update_frame_tool_bar (FRAME_PTR f)
1103 continue; 1117 continue;
1104 } 1118 }
1105 1119
1106 [toolbar addDisplayItemWithImage: img->pixmap idx: i helpText: helpText 1120 [toolbar addDisplayItemWithImage: img->pixmap
1121 idx: k++
1122 tag: i
1123 helpText: helpText
1107 enabled: enabled_p]; 1124 enabled: enabled_p];
1108#undef TOOLPROP 1125#undef TOOLPROP
1109 } 1126 }
@@ -1111,6 +1128,7 @@ update_frame_tool_bar (FRAME_PTR f)
1111 if (![toolbar isVisible]) 1128 if (![toolbar isVisible])
1112 [toolbar setVisible: YES]; 1129 [toolbar setVisible: YES];
1113 1130
1131#ifdef NS_IMPL_COCOA
1114 if ([toolbar changed]) 1132 if ([toolbar changed])
1115 { 1133 {
1116 /* inform app that toolbar has changed */ 1134 /* inform app that toolbar has changed */
@@ -1132,6 +1150,7 @@ update_frame_tool_bar (FRAME_PTR f)
1132 [toolbar setConfigurationFromDictionary: newDict]; 1150 [toolbar setConfigurationFromDictionary: newDict];
1133 [newDict release]; 1151 [newDict release];
1134 } 1152 }
1153#endif
1135 1154
1136 FRAME_TOOLBAR_HEIGHT (f) = 1155 FRAME_TOOLBAR_HEIGHT (f) =
1137 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) 1156 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
@@ -1159,6 +1178,7 @@ update_frame_tool_bar (FRAME_PTR f)
1159 [self setDelegate: self]; 1178 [self setDelegate: self];
1160 identifierToItem = [[NSMutableDictionary alloc] initWithCapacity: 10]; 1179 identifierToItem = [[NSMutableDictionary alloc] initWithCapacity: 10];
1161 activeIdentifiers = [[NSMutableArray alloc] initWithCapacity: 8]; 1180 activeIdentifiers = [[NSMutableArray alloc] initWithCapacity: 8];
1181 prevIdentifiers = nil;
1162 prevEnablement = enablement = 0L; 1182 prevEnablement = enablement = 0L;
1163 return self; 1183 return self;
1164} 1184}
@@ -1180,18 +1200,29 @@ update_frame_tool_bar (FRAME_PTR f)
1180 enablement = 0L; 1200 enablement = 0L;
1181} 1201}
1182 1202
1203- (void) clearAll
1204{
1205 [self clearActive];
1206 while ([[self items] count] > 0)
1207 [self removeItemAtIndex: 0];
1208}
1209
1183- (BOOL) changed 1210- (BOOL) changed
1184{ 1211{
1185 return [activeIdentifiers isEqualToArray: prevIdentifiers] && 1212 return [activeIdentifiers isEqualToArray: prevIdentifiers] &&
1186 enablement == prevEnablement ? NO : YES; 1213 enablement == prevEnablement ? NO : YES;
1187} 1214}
1188 1215
1189- (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx 1216- (void) addDisplayItemWithImage: (EmacsImage *)img
1190 helpText: (const char *)help enabled: (BOOL)enabled 1217 idx: (int)idx
1218 tag: (int)tag
1219 helpText: (const char *)help
1220 enabled: (BOOL)enabled
1191{ 1221{
1192 /* 1) come up w/identifier */ 1222 /* 1) come up w/identifier */
1193 NSString *identifier 1223 NSString *identifier
1194 = [NSString stringWithFormat: @"%u", [img hash]]; 1224 = [NSString stringWithFormat: @"%u", [img hash]];
1225 [activeIdentifiers addObject: identifier];
1195 1226
1196 /* 2) create / reuse item */ 1227 /* 2) create / reuse item */
1197 NSToolbarItem *item = [identifierToItem objectForKey: identifier]; 1228 NSToolbarItem *item = [identifierToItem objectForKey: identifier];
@@ -1203,20 +1234,25 @@ update_frame_tool_bar (FRAME_PTR f)
1203 [item setToolTip: [NSString stringWithUTF8String: help]]; 1234 [item setToolTip: [NSString stringWithUTF8String: help]];
1204 [item setTarget: emacsView]; 1235 [item setTarget: emacsView];
1205 [item setAction: @selector (toolbarClicked:)]; 1236 [item setAction: @selector (toolbarClicked:)];
1237 [identifierToItem setObject: item forKey: identifier];
1206 } 1238 }
1207 1239
1208 [item setTag: idx]; 1240#ifdef NS_IMPL_GNUSTEP
1241 [self insertItemWithItemIdentifier: identifier atIndex: idx];
1242#endif
1243
1244 [item setTag: tag];
1209 [item setEnabled: enabled]; 1245 [item setEnabled: enabled];
1210 1246
1211 /* 3) update state */ 1247 /* 3) update state */
1212 [identifierToItem setObject: item forKey: identifier];
1213 [activeIdentifiers addObject: identifier];
1214 enablement = (enablement << 1) | (enabled == YES); 1248 enablement = (enablement << 1) | (enabled == YES);
1215} 1249}
1216 1250
1217/* This overrides super's implementation, which automatically sets 1251/* This overrides super's implementation, which automatically sets
1218 all items to enabled state (for some reason). */ 1252 all items to enabled state (for some reason). */
1219- (void)validateVisibleItems { } 1253- (void)validateVisibleItems
1254{
1255}
1220 1256
1221 1257
1222/* delegate methods */ 1258/* delegate methods */
@@ -1239,7 +1275,8 @@ update_frame_tool_bar (FRAME_PTR f)
1239- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar 1275- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar
1240{ 1276{
1241 /* return entire set... */ 1277 /* return entire set... */
1242 return [identifierToItem allKeys]; 1278 return activeIdentifiers;
1279 //return [identifierToItem allKeys];
1243} 1280}
1244 1281
1245/* optional and unneeded */ 1282/* optional and unneeded */
@@ -1531,7 +1568,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
1531 [img autorelease]; 1568 [img autorelease];
1532 [imgView autorelease]; 1569 [imgView autorelease];
1533 1570
1534 aStyle = NSTitledWindowMask; 1571 aStyle = NSTitledWindowMask|NSClosableWindowMask|NSUtilityWindowMask;
1535 flag = YES; 1572 flag = YES;
1536 rows = 0; 1573 rows = 0;
1537 cols = 1; 1574 cols = 1;
@@ -1599,9 +1636,6 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
1599 [self setOneShot: YES]; 1636 [self setOneShot: YES];
1600 [self setReleasedWhenClosed: YES]; 1637 [self setReleasedWhenClosed: YES];
1601 [self setHidesOnDeactivate: YES]; 1638 [self setHidesOnDeactivate: YES];
1602 [self setStyleMask:
1603 NSTitledWindowMask|NSClosableWindowMask|NSUtilityWindowMask];
1604
1605 return self; 1639 return self;
1606} 1640}
1607 1641
diff --git a/src/nsselect.m b/src/nsselect.m
index bb9eacd23cd..6053ee9ceb2 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -182,7 +182,7 @@ ns_get_local_selection (Lisp_Object selection_name,
182 Lisp_Object target_type) 182 Lisp_Object target_type)
183{ 183{
184 Lisp_Object local_value; 184 Lisp_Object local_value;
185 Lisp_Object handler_fn, value, type, check; 185 Lisp_Object handler_fn, value, check;
186 ptrdiff_t count; 186 ptrdiff_t count;
187 187
188 local_value = assq_no_quit (selection_name, Vselection_alist); 188 local_value = assq_no_quit (selection_name, Vselection_alist);
@@ -203,7 +203,6 @@ ns_get_local_selection (Lisp_Object selection_name,
203 check = value; 203 check = value;
204 if (CONSP (value) && SYMBOLP (XCAR (value))) 204 if (CONSP (value) && SYMBOLP (XCAR (value)))
205 { 205 {
206 type = XCAR (value);
207 check = XCDR (value); 206 check = XCDR (value);
208 } 207 }
209 208
diff --git a/src/nsterm.h b/src/nsterm.h
index 07cfc2e022e..fd8c9baa3e4 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -51,6 +51,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
51 51
52#ifdef __OBJC__ 52#ifdef __OBJC__
53 53
54/* CGFloat on GNUStep may be 4 or 8 byte, but functions expect float* for some
55 versions.
56 On Cocoa, functions expect CGFloat*. Make compatible type. */
57#if defined (NS_IMPL_COCOA) || GNUSTEP_GUI_MAJOR_VERSION > 0 || \
58 GNUSTEP_GUI_MINOR_VERSION >= 22
59typedef CGFloat EmacsCGFloat;
60#else
61typedef float EmacsCGFloat;
62#endif
63
54/* ========================================================================== 64/* ==========================================================================
55 65
56 The Emacs application 66 The Emacs application
@@ -60,6 +70,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
60/* We override sendEvent: as a means to stop/start the event loop */ 70/* We override sendEvent: as a means to stop/start the event loop */
61@interface EmacsApp : NSApplication 71@interface EmacsApp : NSApplication
62{ 72{
73#ifdef NS_IMPL_GNUSTEP
74@public
75 int nextappdefined;
76#endif
63} 77}
64- (void)logNotification: (NSNotification *)notification; 78- (void)logNotification: (NSNotification *)notification;
65- (void)sendEvent: (NSEvent *)theEvent; 79- (void)sendEvent: (NSEvent *)theEvent;
@@ -68,8 +82,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
68- (void)fd_handler: (id)unused; 82- (void)fd_handler: (id)unused;
69- (void)timeout_handler: (NSTimer *)timedEntry; 83- (void)timeout_handler: (NSTimer *)timedEntry;
70- (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg; 84- (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg;
85#ifdef NS_IMPL_GNUSTEP
86- (void)sendFromMainThread:(id)unused;
87#endif
71@end 88@end
72 89
90#ifdef NS_IMPL_GNUSTEP
91/* Dummy class to get rid of startup warnings. */
92@interface EmacsDocument : NSDocument
93{
94}
95@end
96#endif
73 97
74/* ========================================================================== 98/* ==========================================================================
75 99
@@ -128,8 +152,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
128#endif 152#endif
129 153
130#ifdef NS_IMPL_GNUSTEP 154#ifdef NS_IMPL_GNUSTEP
131/* Not declared, but useful. */ 155- (void)windowDidMove: (id)sender;
132- (void) unlockFocusNeedsFlush: (BOOL)needs;
133#endif 156#endif
134@end 157@end
135 158
@@ -199,10 +222,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
199 } 222 }
200- initForView: (EmacsView *)view withIdentifier: (NSString *)identifier; 223- initForView: (EmacsView *)view withIdentifier: (NSString *)identifier;
201- (void) clearActive; 224- (void) clearActive;
225- (void) clearAll;
202- (BOOL) changed; 226- (BOOL) changed;
203- (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx 227- (void) addDisplayItemWithImage: (EmacsImage *)img
228 idx: (int)idx
229 tag: (int)tag
204 helpText: (const char *)help 230 helpText: (const char *)help
205 enabled: (BOOL)enabled; 231 enabled: (BOOL)enabled;
232
206/* delegate methods */ 233/* delegate methods */
207- (NSToolbarItem *)toolbar: (NSToolbar *)toolbar 234- (NSToolbarItem *)toolbar: (NSToolbar *)toolbar
208 itemForItemIdentifier: (NSString *)itemIdentifier 235 itemForItemIdentifier: (NSString *)itemIdentifier
@@ -267,14 +294,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
267@interface EmacsSavePanel : NSSavePanel 294@interface EmacsSavePanel : NSSavePanel
268{ 295{
269} 296}
270- (NSString *) getFilename;
271- (NSString *) getDirectory;
272@end 297@end
273@interface EmacsOpenPanel : NSOpenPanel 298@interface EmacsOpenPanel : NSOpenPanel
274{ 299{
275} 300}
276- (NSString *) getFilename;
277- (NSString *) getDirectory;
278@end 301@end
279 302
280@interface EmacsFileDelegate : NSObject 303@interface EmacsFileDelegate : NSObject
@@ -335,7 +358,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
335 NSResponder *prevResponder; 358 NSResponder *prevResponder;
336 359
337 /* offset to the bottom of knob of last mouse down */ 360 /* offset to the bottom of knob of last mouse down */
338 float last_mouse_offset; 361 CGFloat last_mouse_offset;
339 float min_portion; 362 float min_portion;
340 int pixel_height; 363 int pixel_height;
341 int last_hit_part; 364 int last_hit_part;
@@ -789,9 +812,9 @@ extern int ns_lisp_to_color (Lisp_Object color, NSColor **col);
789extern NSColor *ns_lookup_indexed_color (unsigned long idx, struct frame *f); 812extern NSColor *ns_lookup_indexed_color (unsigned long idx, struct frame *f);
790extern unsigned long ns_index_color (NSColor *color, struct frame *f); 813extern unsigned long ns_index_color (NSColor *color, struct frame *f);
791extern void ns_free_indexed_color (unsigned long idx, struct frame *f); 814extern void ns_free_indexed_color (unsigned long idx, struct frame *f);
792extern const char *ns_get_pending_menu_title (); 815extern const char *ns_get_pending_menu_title (void);
793extern void ns_check_menu_open (NSMenu *menu); 816extern void ns_check_menu_open (NSMenu *menu);
794extern void ns_check_pending_open_menu (); 817extern void ns_check_pending_open_menu (void);
795#endif 818#endif
796 819
797/* C access to ObjC functionality */ 820/* C access to ObjC functionality */
@@ -840,6 +863,7 @@ extern int x_display_pixel_height (struct ns_display_info *);
840extern int x_display_pixel_width (struct ns_display_info *); 863extern int x_display_pixel_width (struct ns_display_info *);
841 864
842/* This in nsterm.m */ 865/* This in nsterm.m */
866extern void x_destroy_window (struct frame *f);
843extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds, 867extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
844 fd_set *exceptfds, EMACS_TIME *timeout, 868 fd_set *exceptfds, EMACS_TIME *timeout,
845 sigset_t *sigmask); 869 sigset_t *sigmask);
diff --git a/src/nsterm.m b/src/nsterm.m
index e882f00e977..93f693fe55e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -60,6 +60,10 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
60#include "buffer.h" 60#include "buffer.h"
61#include "font.h" 61#include "font.h"
62 62
63#ifdef NS_IMPL_GNUSTEP
64#include "process.h"
65#endif
66
63/* call tracing */ 67/* call tracing */
64#if 0 68#if 0
65int term_trace_num = 0; 69int term_trace_num = 0;
@@ -196,7 +200,9 @@ static BOOL gsaved = NO;
196static BOOL ns_fake_keydown = NO; 200static BOOL ns_fake_keydown = NO;
197int ns_tmp_flags; /* FIXME */ 201int ns_tmp_flags; /* FIXME */
198struct nsfont_info *ns_tmp_font; /* FIXME */ 202struct nsfont_info *ns_tmp_font; /* FIXME */
203#ifdef NS_IMPL_COCOA
199static BOOL ns_menu_bar_is_hidden = NO; 204static BOOL ns_menu_bar_is_hidden = NO;
205#endif
200/*static int debug_lock = 0; */ 206/*static int debug_lock = 0; */
201 207
202/* event loop */ 208/* event loop */
@@ -228,6 +234,7 @@ static struct {
228 NULL, 0, 0 234 NULL, 0, 0
229}; 235};
230 236
237#ifdef NS_IMPL_COCOA
231/* 238/*
232 * State for pending menu activation: 239 * State for pending menu activation:
233 * MENU_NONE Normal state 240 * MENU_NONE Normal state
@@ -246,6 +253,7 @@ static CGPoint menu_mouse_point;
246 253
247/* Title for the menu to open. */ 254/* Title for the menu to open. */
248static char *menu_pending_title = 0; 255static char *menu_pending_title = 0;
256#endif
249 257
250/* Convert modifiers in a NeXTstep event to emacs style modifiers. */ 258/* Convert modifiers in a NeXTstep event to emacs style modifiers. */
251#define NS_FUNCTION_KEY_MASK 0x800000 259#define NS_FUNCTION_KEY_MASK 0x800000
@@ -317,8 +325,6 @@ static char *menu_pending_title = 0;
317 ns_send_appdefined (-1); \ 325 ns_send_appdefined (-1); \
318 } 326 }
319 327
320void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
321
322/* TODO: get rid of need for these forward declarations */ 328/* TODO: get rid of need for these forward declarations */
323static void ns_condemn_scroll_bars (struct frame *f); 329static void ns_condemn_scroll_bars (struct frame *f);
324static void ns_judge_scroll_bars (struct frame *f); 330static void ns_judge_scroll_bars (struct frame *f);
@@ -670,8 +676,6 @@ ns_update_begin (struct frame *f)
670 -------------------------------------------------------------------------- */ 676 -------------------------------------------------------------------------- */
671{ 677{
672 NSView *view = FRAME_NS_VIEW (f); 678 NSView *view = FRAME_NS_VIEW (f);
673 NSRect r = [view frame];
674 NSBezierPath *bp;
675 NSTRACE (ns_update_begin); 679 NSTRACE (ns_update_begin);
676 680
677 ns_update_auto_hide_menu_bar (); 681 ns_update_auto_hide_menu_bar ();
@@ -683,9 +687,15 @@ ns_update_begin (struct frame *f)
683 is for the minibuffer. But the display engine may draw more because 687 is for the minibuffer. But the display engine may draw more because
684 we have set the frame as garbaged. So reset clip path to the whole 688 we have set the frame as garbaged. So reset clip path to the whole
685 view. */ 689 view. */
690#ifdef NS_IMPL_COCOA
691 {
692 NSBezierPath *bp;
693 NSRect r = [view frame];
686 bp = [[NSBezierPath bezierPathWithRect: r] retain]; 694 bp = [[NSBezierPath bezierPathWithRect: r] retain];
687 [bp setClip]; 695 [bp setClip];
688 [bp release]; 696 [bp release];
697 }
698#endif
689 699
690#ifdef NS_IMPL_GNUSTEP 700#ifdef NS_IMPL_GNUSTEP
691 uRect = NSMakeRect (0, 0, 0, 0); 701 uRect = NSMakeRect (0, 0, 0, 0);
@@ -772,20 +782,13 @@ ns_update_end (struct frame *f)
772 external (RIF) call; for whole frame, called after update_window_end 782 external (RIF) call; for whole frame, called after update_window_end
773 -------------------------------------------------------------------------- */ 783 -------------------------------------------------------------------------- */
774{ 784{
775 NSView *view = FRAME_NS_VIEW (f); 785 EmacsView *view = FRAME_NS_VIEW (f);
776 786
777/* if (f == MOUSE_HL_INFO (f)->mouse_face_mouse_frame) */ 787/* if (f == MOUSE_HL_INFO (f)->mouse_face_mouse_frame) */
778 MOUSE_HL_INFO (f)->mouse_face_defer = 0; 788 MOUSE_HL_INFO (f)->mouse_face_defer = 0;
779 789
780 block_input (); 790 block_input ();
781 791
782#ifdef NS_IMPL_GNUSTEP
783 /* trigger flush only in the rectangle we tracked as being drawn */
784 [view unlockFocusNeedsFlush: NO];
785/*fprintf (stderr, " (%.0f, %.0f : %.0f x %.0f)", uRect.origin.x, uRect.origin.y, uRect.size.width, uRect.size.height); */
786 [view lockFocusInRect: uRect];
787#endif
788
789 [view unlockFocus]; 792 [view unlockFocus];
790 [[view window] flushWindow]; 793 [[view window] flushWindow];
791 794
@@ -818,13 +821,6 @@ ns_focus (struct frame *f, NSRect *r, int n)
818 -------------------------------------------------------------------------- */ 821 -------------------------------------------------------------------------- */
819{ 822{
820// NSTRACE (ns_focus); 823// NSTRACE (ns_focus);
821#ifdef NS_IMPL_GNUSTEP
822 NSRect u;
823 if (n == 2)
824 u = NSUnionRect (r[0], r[1]);
825 else if (r)
826 u = *r;
827#endif
828/* static int c =0; 824/* static int c =0;
829 fprintf (stderr, "focus: %d", c++); 825 fprintf (stderr, "focus: %d", c++);
830 if (r) fprintf (stderr, " (%.0f, %.0f : %.0f x %.0f)", r->origin.x, r->origin.y, r->size.width, r->size.height); 826 if (r) fprintf (stderr, " (%.0f, %.0f : %.0f x %.0f)", r->origin.x, r->origin.y, r->size.width, r->size.height);
@@ -843,33 +839,11 @@ ns_focus (struct frame *f, NSRect *r, int n)
843 } 839 }
844 840
845 if (view) 841 if (view)
846#ifdef NS_IMPL_GNUSTEP
847 r ? [view lockFocusInRect: u] : [view lockFocus];
848#else
849 [view lockFocus]; 842 [view lockFocus];
850#endif
851 focus_view = view; 843 focus_view = view;
852/*if (view) debug_lock++; */ 844/*if (view) debug_lock++; */
853 } 845 }
854#ifdef NS_IMPL_GNUSTEP
855 else
856 {
857 /* more than one rect being drawn into */
858 if (view && r)
859 {
860 [view unlockFocus]; /* add prev rect to redraw list */
861 [view lockFocusInRect: u]; /* focus for draw in new rect */
862 }
863 }
864#endif
865 } 846 }
866#ifdef NS_IMPL_GNUSTEP
867 else
868 {
869 /* in batch mode, but in GNUstep must still track rectangles explicitly */
870 uRect = (r ? NSUnionRect (uRect, u) : [FRAME_NS_VIEW (f) visibleRect]);
871 }
872#endif
873 847
874 /* clipping */ 848 /* clipping */
875 if (r) 849 if (r)
@@ -1317,12 +1291,17 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
1317 1291
1318 /* If we have a toolbar, take its height into account. */ 1292 /* If we have a toolbar, take its height into account. */
1319 if (tb && ! [view isFullscreen]) 1293 if (tb && ! [view isFullscreen])
1294 {
1320 /* NOTE: previously this would generate wrong result if toolbar not 1295 /* NOTE: previously this would generate wrong result if toolbar not
1321 yet displayed and fixing toolbar_height=32 helped, but 1296 yet displayed and fixing toolbar_height=32 helped, but
1322 now (200903) seems no longer needed */ 1297 now (200903) seems no longer needed */
1323 FRAME_TOOLBAR_HEIGHT (f) = 1298 FRAME_TOOLBAR_HEIGHT (f) =
1324 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) 1299 NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
1325 - FRAME_NS_TITLEBAR_HEIGHT (f); 1300 - FRAME_NS_TITLEBAR_HEIGHT (f);
1301#ifdef NS_IMPL_GNUSTEP
1302 FRAME_TOOLBAR_HEIGHT (f) -= 3;
1303#endif
1304 }
1326 else 1305 else
1327 FRAME_TOOLBAR_HEIGHT (f) = 0; 1306 FRAME_TOOLBAR_HEIGHT (f) = 0;
1328 1307
@@ -1548,7 +1527,7 @@ ns_get_color (const char *name, NSColor **col)
1548 } 1527 }
1549 } 1528 }
1550 1529
1551 if (r >= 0.0) 1530 if (r >= 0.0F)
1552 { 1531 {
1553 *col = [NSColor colorWithCalibratedRed: r green: g blue: b alpha: 1.0]; 1532 *col = [NSColor colorWithCalibratedRed: r green: g blue: b alpha: 1.0];
1554 unblock_input (); 1533 unblock_input ();
@@ -1609,7 +1588,7 @@ ns_color_to_lisp (NSColor *col)
1609 Convert a color to a lisp string with the RGB equivalent 1588 Convert a color to a lisp string with the RGB equivalent
1610 -------------------------------------------------------------------------- */ 1589 -------------------------------------------------------------------------- */
1611{ 1590{
1612 CGFloat red, green, blue, alpha, gray; 1591 EmacsCGFloat red, green, blue, alpha, gray;
1613 char buf[1024]; 1592 char buf[1024];
1614 const char *str; 1593 const char *str;
1615 NSTRACE (ns_color_to_lisp); 1594 NSTRACE (ns_color_to_lisp);
@@ -1651,7 +1630,7 @@ ns_query_color(void *col, XColor *color_def, int setPixel)
1651 and set color_def pixel to the resulting index. 1630 and set color_def pixel to the resulting index.
1652 -------------------------------------------------------------------------- */ 1631 -------------------------------------------------------------------------- */
1653{ 1632{
1654 CGFloat r, g, b, a; 1633 EmacsCGFloat r, g, b, a;
1655 1634
1656 [((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a]; 1635 [((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a];
1657 color_def->red = r * 65535; 1636 color_def->red = r * 65535;
@@ -1696,26 +1675,6 @@ ns_defined_color (struct frame *f,
1696} 1675}
1697 1676
1698 1677
1699unsigned long
1700ns_get_rgb_color (struct frame *f, float r, float g, float b, float a)
1701/* --------------------------------------------------------------------------
1702 return an autoreleased RGB color
1703 -------------------------------------------------------------------------- */
1704{
1705/*static int c = 1; fprintf (stderr, "color request %d\n", c++); */
1706 if (r < 0.0) r = 0.0;
1707 else if (r > 1.0) r = 1.0;
1708 if (g < 0.0) g = 0.0;
1709 else if (g > 1.0) g = 1.0;
1710 if (b < 0.0) b = 0.0;
1711 else if (b > 1.0) b = 1.0;
1712 if (a < 0.0) a = 0.0;
1713 else if (a > 1.0) a = 1.0;
1714 return (unsigned long) ns_index_color(
1715 [NSColor colorWithCalibratedRed: r green: g blue: b alpha: a], f);
1716}
1717
1718
1719void 1678void
1720x_set_frame_alpha (struct frame *f) 1679x_set_frame_alpha (struct frame *f)
1721/* -------------------------------------------------------------------------- 1680/* --------------------------------------------------------------------------
@@ -1723,7 +1682,6 @@ x_set_frame_alpha (struct frame *f)
1723 -------------------------------------------------------------------------- */ 1682 -------------------------------------------------------------------------- */
1724{ 1683{
1725 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); 1684 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
1726 EmacsView *view = FRAME_NS_VIEW (f);
1727 double alpha = 1.0; 1685 double alpha = 1.0;
1728 double alpha_min = 1.0; 1686 double alpha_min = 1.0;
1729 1687
@@ -1745,7 +1703,10 @@ x_set_frame_alpha (struct frame *f)
1745 alpha = alpha_min; 1703 alpha = alpha_min;
1746 1704
1747#ifdef NS_IMPL_COCOA 1705#ifdef NS_IMPL_COCOA
1706 {
1707 EmacsView *view = FRAME_NS_VIEW (f);
1748 [[view window] setAlphaValue: alpha]; 1708 [[view window] setAlphaValue: alpha];
1709 }
1749#endif 1710#endif
1750} 1711}
1751 1712
@@ -1798,7 +1759,7 @@ x_set_mouse_position (struct frame *f, int h, int v)
1798 1759
1799 1760
1800static int 1761static int
1801note_mouse_movement (struct frame *frame, float x, float y) 1762note_mouse_movement (struct frame *frame, CGFloat x, CGFloat y)
1802/* ------------------------------------------------------------------------ 1763/* ------------------------------------------------------------------------
1803 Called by EmacsView on mouseMovement events. Passes on 1764 Called by EmacsView on mouseMovement events. Passes on
1804 to emacs mainstream code if we moved off of a rect of interest 1765 to emacs mainstream code if we moved off of a rect of interest
@@ -2257,7 +2218,6 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
2257{ 2218{
2258 struct frame *f = XFRAME (WINDOW_FRAME (w)); 2219 struct frame *f = XFRAME (WINDOW_FRAME (w));
2259 struct face *face = p->face; 2220 struct face *face = p->face;
2260 int rowY;
2261 static EmacsImage **bimgs = NULL; 2221 static EmacsImage **bimgs = NULL;
2262 static int nBimgs = 0; 2222 static int nBimgs = 0;
2263 2223
@@ -2271,7 +2231,6 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
2271 } 2231 }
2272 2232
2273 /* Must clip because of partially visible lines. */ 2233 /* Must clip because of partially visible lines. */
2274 rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
2275 ns_clip_to_row (w, row, -1, YES); 2234 ns_clip_to_row (w, row, -1, YES);
2276 2235
2277 if (!p->overlay_p) 2236 if (!p->overlay_p)
@@ -2359,7 +2318,7 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
2359 [ns_lookup_indexed_color(face->background, f) set]; 2318 [ns_lookup_indexed_color(face->background, f) set];
2360 NSRectFill (r); 2319 NSRectFill (r);
2361 [img setXBMColor: ns_lookup_indexed_color(face->foreground, f)]; 2320 [img setXBMColor: ns_lookup_indexed_color(face->foreground, f)];
2362#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 2321#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
2363 [img drawInRect: r 2322 [img drawInRect: r
2364 fromRect: NSZeroRect 2323 fromRect: NSZeroRect
2365 operation: NSCompositeSourceOver 2324 operation: NSCompositeSourceOver
@@ -2391,7 +2350,6 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
2391 int fx, fy, h, cursor_height; 2350 int fx, fy, h, cursor_height;
2392 struct frame *f = WINDOW_XFRAME (w); 2351 struct frame *f = WINDOW_XFRAME (w);
2393 struct glyph *phys_cursor_glyph; 2352 struct glyph *phys_cursor_glyph;
2394 int overspill;
2395 struct glyph *cursor_glyph; 2353 struct glyph *cursor_glyph;
2396 struct face *face; 2354 struct face *face;
2397 NSColor *hollow_color = FRAME_BACKGROUND_COLOR (f); 2355 NSColor *hollow_color = FRAME_BACKGROUND_COLOR (f);
@@ -2598,7 +2556,7 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
2598 --------------------------------------------------------------------- */ 2556 --------------------------------------------------------------------- */
2599 2557
2600static void 2558static void
2601ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x) 2559ns_draw_underwave (struct glyph_string *s, EmacsCGFloat width, EmacsCGFloat x)
2602{ 2560{
2603 int wave_height = 3, wave_length = 2; 2561 int wave_height = 3, wave_length = 2;
2604 int y, dx, dy, odd, xmax; 2562 int y, dx, dy, odd, xmax;
@@ -2616,7 +2574,7 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2616 NSRectClip (waveClip); 2574 NSRectClip (waveClip);
2617 2575
2618 /* Draw the waves */ 2576 /* Draw the waves */
2619 a.x = x - ((int)(x) % dx) + 0.5; 2577 a.x = x - ((int)(x) % dx) + (EmacsCGFloat) 0.5;
2620 b.x = a.x + dx; 2578 b.x = a.x + dx;
2621 odd = (int)(a.x/dx) % 2; 2579 odd = (int)(a.x/dx) % 2;
2622 a.y = b.y = y + 0.5; 2580 a.y = b.y = y + 0.5;
@@ -2756,7 +2714,8 @@ ns_draw_text_decoration (struct glyph_string *s, struct face *face,
2756} 2714}
2757 2715
2758static void 2716static void
2759ns_draw_box (NSRect r, float thickness, NSColor *col, char left_p, char right_p) 2717ns_draw_box (NSRect r, CGFloat thickness, NSColor *col,
2718 char left_p, char right_p)
2760/* -------------------------------------------------------------------------- 2719/* --------------------------------------------------------------------------
2761 Draw an unfilled rect inside r, optionally leaving left and/or right open. 2720 Draw an unfilled rect inside r, optionally leaving left and/or right open.
2762 Note we can't just use an NSDrawRect command, because of the possibility 2721 Note we can't just use an NSDrawRect command, because of the possibility
@@ -3033,7 +2992,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
3033 /* Draw the image.. do we need to draw placeholder if img ==nil? */ 2992 /* Draw the image.. do we need to draw placeholder if img ==nil? */
3034 if (img != nil) 2993 if (img != nil)
3035 { 2994 {
3036#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 2995#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
3037 NSRect dr = NSMakeRect (x, y, s->slice.width, s->slice.height); 2996 NSRect dr = NSMakeRect (x, y, s->slice.width, s->slice.height);
3038 NSRect ir = NSMakeRect (s->slice.x, s->slice.y, 2997 NSRect ir = NSMakeRect (s->slice.x, s->slice.y,
3039 s->slice.width, s->slice.height); 2998 s->slice.width, s->slice.height);
@@ -3358,6 +3317,19 @@ ns_send_appdefined (int value)
3358{ 3317{
3359 /*NSTRACE (ns_send_appdefined); */ 3318 /*NSTRACE (ns_send_appdefined); */
3360 3319
3320#ifdef NS_IMPL_GNUSTEP
3321 // GNUStep needs postEvent to happen on the main thread.
3322 if (! [[NSThread currentThread] isMainThread])
3323 {
3324 EmacsApp *app = (EmacsApp *)NSApp;
3325 app->nextappdefined = value;
3326 [app performSelectorOnMainThread:@selector (sendFromMainThread:)
3327 withObject:nil
3328 waitUntilDone:YES];
3329 return;
3330 }
3331#endif
3332
3361 /* Only post this event if we haven't already posted one. This will end 3333 /* Only post this event if we haven't already posted one. This will end
3362 the [NXApp run] main loop after having processed all events queued at 3334 the [NXApp run] main loop after having processed all events queued at
3363 this moment. */ 3335 this moment. */
@@ -3417,6 +3389,9 @@ check_native_fs ()
3417} 3389}
3418#endif 3390#endif
3419 3391
3392/* GNUStep and OSX <= 10.4 does not have cancelTracking. */
3393#if defined (NS_IMPL_COCOA) && \
3394 MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
3420const char * 3395const char *
3421ns_get_pending_menu_title () 3396ns_get_pending_menu_title ()
3422{ 3397{
@@ -3427,10 +3402,6 @@ ns_get_pending_menu_title ()
3427void 3402void
3428ns_check_menu_open (NSMenu *menu) 3403ns_check_menu_open (NSMenu *menu)
3429{ 3404{
3430 /* GNUStep and OSX <= 10.4 does not have cancelTracking. */
3431#if defined(NS_IMPL_COCOA) && \
3432 MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
3433
3434 /* Click in menu bar? */ 3405 /* Click in menu bar? */
3435 NSArray *a = [[NSApp mainMenu] itemArray]; 3406 NSArray *a = [[NSApp mainMenu] itemArray];
3436 int i; 3407 int i;
@@ -3460,14 +3431,12 @@ ns_check_menu_open (NSMenu *menu)
3460 menu_will_open_state = MENU_NONE; 3431 menu_will_open_state = MENU_NONE;
3461 } 3432 }
3462 } 3433 }
3463#endif
3464} 3434}
3465 3435
3466/* Redo saved menu click if state is MENU_PENDING. */ 3436/* Redo saved menu click if state is MENU_PENDING. */
3467void 3437void
3468ns_check_pending_open_menu () 3438ns_check_pending_open_menu ()
3469{ 3439{
3470#ifdef NS_IMPL_COCOA
3471 if (menu_will_open_state == MENU_PENDING) 3440 if (menu_will_open_state == MENU_PENDING)
3472 { 3441 {
3473 CGEventSourceRef source 3442 CGEventSourceRef source
@@ -3484,9 +3453,8 @@ ns_check_pending_open_menu ()
3484 3453
3485 menu_will_open_state = MENU_OPENING; 3454 menu_will_open_state = MENU_OPENING;
3486 } 3455 }
3487#endif
3488} 3456}
3489 3457#endif /* NS_IMPL_COCOA) && >= MAC_OS_X_VERSION_10_5 */
3490 3458
3491static int 3459static int
3492ns_read_socket (struct terminal *terminal, struct input_event *hold_quit) 3460ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
@@ -4392,6 +4360,12 @@ ns_term_init (Lisp_Object display_name)
4392 4360
4393 [NSApp run]; 4361 [NSApp run];
4394 ns_do_open_file = YES; 4362 ns_do_open_file = YES;
4363
4364#ifdef NS_IMPL_GNUSTEP
4365 /* GNUstep steals SIGCHLD for use in NSTask, but we don't use NSTask.
4366 We must re-catch it so subprocess works. */
4367 catch_child_signal ();
4368#endif
4395 return dpyinfo; 4369 return dpyinfo;
4396} 4370}
4397 4371
@@ -4699,6 +4673,13 @@ not_in_argv (NSString *arg)
4699 ns_send_appdefined (-2); 4673 ns_send_appdefined (-2);
4700} 4674}
4701 4675
4676#ifdef NS_IMPL_GNUSTEP
4677- (void)sendFromMainThread:(id)unused
4678{
4679 ns_send_appdefined (nextappdefined);
4680}
4681#endif
4682
4702- (void)fd_handler:(id)unused 4683- (void)fd_handler:(id)unused
4703/* -------------------------------------------------------------------------- 4684/* --------------------------------------------------------------------------
4704 Check data waiting on file descriptors and terminate if so 4685 Check data waiting on file descriptors and terminate if so
@@ -4863,7 +4844,7 @@ not_in_argv (NSString *arg)
4863 NSEvent *e =[[self window] currentEvent]; 4844 NSEvent *e =[[self window] currentEvent];
4864 struct face *face =FRAME_DEFAULT_FACE (emacsframe); 4845 struct face *face =FRAME_DEFAULT_FACE (emacsframe);
4865 id newFont; 4846 id newFont;
4866 float size; 4847 CGFloat size;
4867 4848
4868 NSTRACE (changeFont); 4849 NSTRACE (changeFont);
4869 if (!emacs_event) 4850 if (!emacs_event)
@@ -4982,7 +4963,16 @@ not_in_argv (NSString *arg)
4982 { 4963 {
4983 /* COUNTERHACK: map 'Delete' on upper-right main KB to 'Backspace', 4964 /* COUNTERHACK: map 'Delete' on upper-right main KB to 'Backspace',
4984 because Emacs treats Delete and KP-Delete same (in simple.el). */ 4965 because Emacs treats Delete and KP-Delete same (in simple.el). */
4985 if (fnKeysym == 0xFFFF && [theEvent keyCode] == 0x33) 4966 if ((fnKeysym == 0xFFFF && [theEvent keyCode] == 0x33)
4967#ifdef NS_IMPL_GNUSTEP
4968 /* GNUstep uses incompatible keycodes, even for those that are
4969 supposed to be hardware independent. Just check for delete.
4970 Keypad delete does not have keysym 0xFFFF.
4971 See http://savannah.gnu.org/bugs/?25395
4972 */
4973 || (fnKeysym == 0xFFFF && code == 127)
4974#endif
4975 )
4986 code = 0xFF08; /* backspace */ 4976 code = 0xFF08; /* backspace */
4987 else 4977 else
4988 code = fnKeysym; 4978 code = fnKeysym;
@@ -5135,10 +5125,14 @@ not_in_argv (NSString *arg)
5135 5125
5136#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 5126#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
5137 /* if we get here we should send the key for input manager processing */ 5127 /* if we get here we should send the key for input manager processing */
5128 /* Disable warning, there is nothing a user can do about it anyway, and
5129 it does not seem to matter. */
5130#if 0
5138 if (firstTime && [[NSInputManager currentInputManager] 5131 if (firstTime && [[NSInputManager currentInputManager]
5139 wantsToDelayTextChangeNotifications] == NO) 5132 wantsToDelayTextChangeNotifications] == NO)
5140 fprintf (stderr, 5133 fprintf (stderr,
5141 "Emacs: WARNING: TextInput mgr wants marked text to be permanent!\n"); 5134 "Emacs: WARNING: TextInput mgr wants marked text to be permanent!\n");
5135#endif
5142 firstTime = NO; 5136 firstTime = NO;
5143#endif 5137#endif
5144 if (NS_KEYLOG && !processingCompose) 5138 if (NS_KEYLOG && !processingCompose)
@@ -5346,7 +5340,12 @@ not_in_argv (NSString *arg)
5346 return NSMakeRange (NSNotFound, 0); 5340 return NSMakeRange (NSNotFound, 0);
5347} 5341}
5348 5342
5343#if defined (NS_IMPL_COCOA) || GNUSTEP_GUI_MAJOR_VERSION > 0 || \
5344 GNUSTEP_GUI_MINOR_VERSION > 22
5349- (NSUInteger)characterIndexForPoint: (NSPoint)thePoint 5345- (NSUInteger)characterIndexForPoint: (NSPoint)thePoint
5346#else
5347- (unsigned int)characterIndexForPoint: (NSPoint)thePoint
5348#endif
5350{ 5349{
5351 if (NS_KEYLOG) 5350 if (NS_KEYLOG)
5352 NSLog (@"characterIndexForPoint request"); 5351 NSLog (@"characterIndexForPoint request");
@@ -5385,7 +5384,7 @@ not_in_argv (NSString *arg)
5385 5384
5386 if ([theEvent type] == NSScrollWheel) 5385 if ([theEvent type] == NSScrollWheel)
5387 { 5386 {
5388 float delta = [theEvent deltaY]; 5387 CGFloat delta = [theEvent deltaY];
5389 /* Mac notebooks send wheel events w/delta =0 when trackpad scrolling */ 5388 /* Mac notebooks send wheel events w/delta =0 when trackpad scrolling */
5390 if (delta == 0) 5389 if (delta == 0)
5391 return; 5390 return;
@@ -5569,7 +5568,6 @@ not_in_argv (NSString *arg)
5569 5568
5570 if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) 5569 if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
5571 { 5570 {
5572 struct frame *f = emacsframe;
5573 NSView *view = FRAME_NS_VIEW (emacsframe); 5571 NSView *view = FRAME_NS_VIEW (emacsframe);
5574 NSWindow *win = [view window]; 5572 NSWindow *win = [view window];
5575 NSSize sz = [win resizeIncrements]; 5573 NSSize sz = [win resizeIncrements];
@@ -5602,7 +5600,7 @@ not_in_argv (NSString *arg)
5602#ifdef NS_IMPL_GNUSTEP 5600#ifdef NS_IMPL_GNUSTEP
5603 gsextra = 3; 5601 gsextra = 3;
5604#endif 5602#endif
5605 5603
5606 NSTRACE (windowWillResize); 5604 NSTRACE (windowWillResize);
5607/*fprintf (stderr,"Window will resize: %.0f x %.0f\n",frameSize.width,frameSize.height); */ 5605/*fprintf (stderr,"Window will resize: %.0f x %.0f\n",frameSize.width,frameSize.height); */
5608 5606
@@ -5668,7 +5666,7 @@ not_in_argv (NSString *arg)
5668 5666
5669- (void)windowDidResize: (NSNotification *)notification 5667- (void)windowDidResize: (NSNotification *)notification
5670{ 5668{
5671 if (! [self fsIsNative]) 5669 if (! [self fsIsNative])
5672 { 5670 {
5673 NSWindow *theWindow = [notification object]; 5671 NSWindow *theWindow = [notification object];
5674 /* We can get notification on the non-FS window when in 5672 /* We can get notification on the non-FS window when in
@@ -5778,7 +5776,6 @@ not_in_argv (NSString *arg)
5778 NSRect r, wr; 5776 NSRect r, wr;
5779 Lisp_Object tem; 5777 Lisp_Object tem;
5780 NSWindow *win; 5778 NSWindow *win;
5781 NSButton *toggleButton;
5782 NSSize sz; 5779 NSSize sz;
5783 NSColor *col; 5780 NSColor *col;
5784 NSString *name; 5781 NSString *name;
@@ -5854,9 +5851,12 @@ not_in_argv (NSString *arg)
5854 [win setToolbar: toolbar]; 5851 [win setToolbar: toolbar];
5855 [toolbar setVisible: NO]; 5852 [toolbar setVisible: NO];
5856#ifdef NS_IMPL_COCOA 5853#ifdef NS_IMPL_COCOA
5854 {
5855 NSButton *toggleButton;
5857 toggleButton = [win standardWindowButton: NSWindowToolbarButton]; 5856 toggleButton = [win standardWindowButton: NSWindowToolbarButton];
5858 [toggleButton setTarget: self]; 5857 [toggleButton setTarget: self];
5859 [toggleButton setAction: @selector (toggleToolbar: )]; 5858 [toggleButton setAction: @selector (toggleToolbar: )];
5859 }
5860#endif 5860#endif
5861 FRAME_TOOLBAR_HEIGHT (f) = 0; 5861 FRAME_TOOLBAR_HEIGHT (f) = 0;
5862 5862
@@ -5880,7 +5880,7 @@ not_in_argv (NSString *arg)
5880 col = ns_lookup_indexed_color (NS_FACE_BACKGROUND 5880 col = ns_lookup_indexed_color (NS_FACE_BACKGROUND
5881 (FRAME_DEFAULT_FACE (emacsframe)), emacsframe); 5881 (FRAME_DEFAULT_FACE (emacsframe)), emacsframe);
5882 [win setBackgroundColor: col]; 5882 [win setBackgroundColor: col];
5883 if ([col alphaComponent] != 1.0) 5883 if ([col alphaComponent] != (EmacsCGFloat) 1.0)
5884 [win setOpaque: NO]; 5884 [win setOpaque: NO];
5885 5885
5886 [self allocateGState]; 5886 [self allocateGState];
@@ -5973,7 +5973,7 @@ not_in_argv (NSString *arg)
5973 result = ns_userRect.size.height ? ns_userRect : result; 5973 result = ns_userRect.size.height ? ns_userRect : result;
5974 ns_userRect = NSMakeRect (0, 0, 0, 0); 5974 ns_userRect = NSMakeRect (0, 0, 0, 0);
5975 [self setFSValue: FULLSCREEN_NONE]; 5975 [self setFSValue: FULLSCREEN_NONE];
5976 maximized_width = maximized_width = -1; 5976 maximized_width = maximized_height = -1;
5977 } 5977 }
5978 5978
5979 if (fs_before_fs == -1) next_maximized = -1; 5979 if (fs_before_fs == -1) next_maximized = -1;
@@ -6066,7 +6066,9 @@ not_in_argv (NSString *arg)
6066{ 6066{
6067 [self setFSValue: fs_before_fs]; 6067 [self setFSValue: fs_before_fs];
6068 fs_before_fs = -1; 6068 fs_before_fs = -1;
6069#ifdef NS_IMPL_COCOA
6069 [self updateCollectionBehaviour]; 6070 [self updateCollectionBehaviour];
6071#endif
6070 if (FRAME_EXTERNAL_TOOL_BAR (emacsframe)) 6072 if (FRAME_EXTERNAL_TOOL_BAR (emacsframe))
6071 { 6073 {
6072 [toolbar setVisible:YES]; 6074 [toolbar setVisible:YES];
@@ -6113,7 +6115,7 @@ not_in_argv (NSString *arg)
6113 } 6115 }
6114} 6116}
6115#endif 6117#endif
6116 6118
6117- (void)toggleFullScreen: (id)sender 6119- (void)toggleFullScreen: (id)sender
6118{ 6120{
6119 NSWindow *w, *fw; 6121 NSWindow *w, *fw;
@@ -6125,7 +6127,9 @@ not_in_argv (NSString *arg)
6125 6127
6126 if (fs_is_native) 6128 if (fs_is_native)
6127 { 6129 {
6130#ifdef NS_IMPL_COCOA
6128 [[self window] toggleFullScreen:sender]; 6131 [[self window] toggleFullScreen:sender];
6132#endif
6129 return; 6133 return;
6130 } 6134 }
6131 6135
@@ -6171,7 +6175,7 @@ not_in_argv (NSString *arg)
6171 [fw useOptimizedDrawing: YES]; 6175 [fw useOptimizedDrawing: YES];
6172 [fw setResizeIncrements: sz]; 6176 [fw setResizeIncrements: sz];
6173 [fw setBackgroundColor: col]; 6177 [fw setBackgroundColor: col];
6174 if ([col alphaComponent] != 1.0) 6178 if ([col alphaComponent] != (EmacsCGFloat) 1.0)
6175 [fw setOpaque: NO]; 6179 [fw setOpaque: NO];
6176 6180
6177 f->border_width = 0; 6181 f->border_width = 0;
@@ -6209,7 +6213,7 @@ not_in_argv (NSString *arg)
6209 [w setContentView:[fw contentView]]; 6213 [w setContentView:[fw contentView]];
6210 [w setResizeIncrements: sz]; 6214 [w setResizeIncrements: sz];
6211 [w setBackgroundColor: col]; 6215 [w setBackgroundColor: col];
6212 if ([col alphaComponent] != 1.0) 6216 if ([col alphaComponent] != (EmacsCGFloat) 1.0)
6213 [w setOpaque: NO]; 6217 [w setOpaque: NO];
6214 6218
6215 f->border_width = bwidth; 6219 f->border_width = bwidth;
@@ -6903,10 +6907,11 @@ not_in_argv (NSString *arg)
6903 } 6907 }
6904 else 6908 else
6905 { 6909 {
6906 float pos, por; 6910 float pos;
6911 CGFloat por;
6907 portion = max ((float)whole*min_portion/pixel_height, portion); 6912 portion = max ((float)whole*min_portion/pixel_height, portion);
6908 pos = (float)position / (whole - portion); 6913 pos = (float)position / (whole - portion);
6909 por = (float)portion/whole; 6914 por = (CGFloat)portion/whole;
6910#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 6915#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
6911 [self setKnobProportion: por]; 6916 [self setKnobProportion: por];
6912 [self setDoubleValue: pos]; 6917 [self setDoubleValue: pos];
@@ -6931,7 +6936,7 @@ not_in_argv (NSString *arg)
6931 *part = last_hit_part; 6936 *part = last_hit_part;
6932 *window = win; 6937 *window = win;
6933 XSETINT (*y, pixel_height); 6938 XSETINT (*y, pixel_height);
6934 if ([self floatValue] > 0.999) 6939 if ([self floatValue] > 0.999F)
6935 XSETINT (*x, pixel_height); 6940 XSETINT (*x, pixel_height);
6936 else 6941 else
6937 XSETINT (*x, pixel_height * [self floatValue]); 6942 XSETINT (*x, pixel_height * [self floatValue]);
@@ -7005,7 +7010,7 @@ not_in_argv (NSString *arg)
7005 NSRect sr, kr; 7010 NSRect sr, kr;
7006 /* hitPart is only updated AFTER event is passed on */ 7011 /* hitPart is only updated AFTER event is passed on */
7007 NSScrollerPart part = [self testPart: [e locationInWindow]]; 7012 NSScrollerPart part = [self testPart: [e locationInWindow]];
7008 double inc = 0.0, loc, kloc, pos; 7013 CGFloat inc = 0.0, loc, kloc, pos;
7009 int edge = 0; 7014 int edge = 0;
7010 7015
7011 NSTRACE (EmacsScroller_mouseDown); 7016 NSTRACE (EmacsScroller_mouseDown);
@@ -7104,7 +7109,6 @@ not_in_argv (NSString *arg)
7104{ 7109{
7105 NSRect sr; 7110 NSRect sr;
7106 double loc, pos; 7111 double loc, pos;
7107 int edge = 0;
7108 7112
7109 NSTRACE (EmacsScroller_mouseDragged); 7113 NSTRACE (EmacsScroller_mouseDragged);
7110 7114
@@ -7115,15 +7119,13 @@ not_in_argv (NSString *arg)
7115 if (loc <= 0.0) 7119 if (loc <= 0.0)
7116 { 7120 {
7117 loc = 0.0; 7121 loc = 0.0;
7118 edge = -1;
7119 } 7122 }
7120 else if (loc >= NSHeight (sr) + last_mouse_offset) 7123 else if (loc >= NSHeight (sr) + last_mouse_offset)
7121 { 7124 {
7122 loc = NSHeight (sr) + last_mouse_offset; 7125 loc = NSHeight (sr) + last_mouse_offset;
7123 edge = 1;
7124 } 7126 }
7125 7127
7126 pos = /*(edge ? loc :*/ (loc - last_mouse_offset) / NSHeight (sr); 7128 pos = (loc - last_mouse_offset) / NSHeight (sr);
7127 [self sendScrollEventAtLoc: pos fromEvent: e]; 7129 [self sendScrollEventAtLoc: pos fromEvent: e];
7128} 7130}
7129 7131
@@ -7150,6 +7152,12 @@ not_in_argv (NSString *arg)
7150@end /* EmacsScroller */ 7152@end /* EmacsScroller */
7151 7153
7152 7154
7155#ifdef NS_IMPL_GNUSTEP
7156/* Dummy class to get rid of startup warnings. */
7157@implementation EmacsDocument
7158
7159@end
7160#endif
7153 7161
7154 7162
7155/* ========================================================================== 7163/* ==========================================================================
diff --git a/src/process.c b/src/process.c
index 46385fa096b..a873dd0cdb2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4528,10 +4528,10 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4528 } 4528 }
4529#endif 4529#endif
4530 4530
4531#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) 4531#if defined (HAVE_NS)
4532 nfds = xg_select 4532 nfds = ns_select
4533#elif defined (HAVE_NS) 4533#elif defined (HAVE_GLIB)
4534 nfds = ns_select 4534 nfds = xg_select
4535#else 4535#else
4536 nfds = pselect 4536 nfds = pselect
4537#endif 4537#endif
@@ -6100,6 +6100,12 @@ process has been transmitted to the serial port. */)
6100 might inadvertently reap a GTK-created process that happened to 6100 might inadvertently reap a GTK-created process that happened to
6101 have the same process ID. */ 6101 have the same process ID. */
6102 6102
6103/* LIB_CHILD_HANDLER is a SIGCHLD handler that Emacs calls while doing
6104 its own SIGCHLD handling. On POSIXish systems, glib needs this to
6105 keep track of its own children. The default handler does nothing. */
6106static void dummy_handler (int sig) {}
6107static signal_handler_t volatile lib_child_handler = dummy_handler;
6108
6103/* Handle a SIGCHLD signal by looking for known child processes of 6109/* Handle a SIGCHLD signal by looking for known child processes of
6104 Emacs whose status have changed. For each one found, record its 6110 Emacs whose status have changed. For each one found, record its
6105 new status. 6111 new status.
@@ -6159,7 +6165,8 @@ handle_child_signal (int sig)
6159 struct Lisp_Process *p = XPROCESS (proc); 6165 struct Lisp_Process *p = XPROCESS (proc);
6160 int status; 6166 int status;
6161 6167
6162 if (p->alive && child_status_changed (p->pid, &status, WUNTRACED)) 6168 if (p->alive
6169 && child_status_changed (p->pid, &status, WUNTRACED | WCONTINUED))
6163 { 6170 {
6164 /* Change the status of the process that was found. */ 6171 /* Change the status of the process that was found. */
6165 p->tick = ++process_tick; 6172 p->tick = ++process_tick;
@@ -6183,6 +6190,8 @@ handle_child_signal (int sig)
6183 } 6190 }
6184 } 6191 }
6185 } 6192 }
6193
6194 lib_child_handler (sig);
6186} 6195}
6187 6196
6188static void 6197static void
@@ -7028,6 +7037,21 @@ integer or floating point values.
7028 return system_process_attributes (pid); 7037 return system_process_attributes (pid);
7029} 7038}
7030 7039
7040#ifndef NS_IMPL_GNUSTEP
7041static
7042#endif
7043void
7044catch_child_signal (void)
7045{
7046 struct sigaction action, old_action;
7047 emacs_sigaction_init (&action, deliver_child_signal);
7048 sigaction (SIGCHLD, &action, &old_action);
7049 eassert (! (old_action.sa_flags & SA_SIGINFO));
7050 if (old_action.sa_handler != SIG_DFL && old_action.sa_handler != SIG_IGN
7051 && old_action.sa_handler != deliver_child_signal)
7052 lib_child_handler = old_action.sa_handler;
7053}
7054
7031 7055
7032/* This is not called "init_process" because that is the name of a 7056/* This is not called "init_process" because that is the name of a
7033 Mach system call, so it would cause problems on Darwin systems. */ 7057 Mach system call, so it would cause problems on Darwin systems. */
@@ -7043,9 +7067,13 @@ init_process_emacs (void)
7043 if (! noninteractive || initialized) 7067 if (! noninteractive || initialized)
7044#endif 7068#endif
7045 { 7069 {
7046 struct sigaction action; 7070#if defined HAVE_GLIB && !defined WINDOWSNT
7047 emacs_sigaction_init (&action, deliver_child_signal); 7071 /* Tickle glib's child-handling code. Ask glib to wait for Emacs itself;
7048 sigaction (SIGCHLD, &action, 0); 7072 this should always fail, but is enough to initialize glib's
7073 private SIGCHLD handler. */
7074 g_source_unref (g_child_watch_source_new (getpid ()));
7075#endif
7076 catch_child_signal ();
7049 } 7077 }
7050 7078
7051 FD_ZERO (&input_wait_mask); 7079 FD_ZERO (&input_wait_mask);
diff --git a/src/process.h b/src/process.h
index 765e5d82567..0c4e17e68cf 100644
--- a/src/process.h
+++ b/src/process.h
@@ -217,5 +217,8 @@ extern void add_read_fd (int fd, fd_callback func, void *data);
217extern void delete_read_fd (int fd); 217extern void delete_read_fd (int fd);
218extern void add_write_fd (int fd, fd_callback func, void *data); 218extern void add_write_fd (int fd, fd_callback func, void *data);
219extern void delete_write_fd (int fd); 219extern void delete_write_fd (int fd);
220#ifdef NS_IMPL_GNUSTEP
221extern void catch_child_signal (void);
222#endif
220 223
221INLINE_HEADER_END 224INLINE_HEADER_END
diff --git a/src/profiler.c b/src/profiler.c
index 0a0a4d0bc57..aba81344c68 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -138,10 +138,8 @@ static void evict_lower_half (log_t *log)
138static void 138static void
139record_backtrace (log_t *log, EMACS_INT count) 139record_backtrace (log_t *log, EMACS_INT count)
140{ 140{
141 struct backtrace *backlist = backtrace_list;
142 Lisp_Object backtrace; 141 Lisp_Object backtrace;
143 ptrdiff_t index, i = 0; 142 ptrdiff_t index;
144 ptrdiff_t asize;
145 143
146 if (!INTEGERP (log->next_free)) 144 if (!INTEGERP (log->next_free))
147 /* FIXME: transfer the evicted counts to a special entry rather 145 /* FIXME: transfer the evicted counts to a special entry rather
@@ -151,16 +149,7 @@ record_backtrace (log_t *log, EMACS_INT count)
151 149
152 /* Get a "working memory" vector. */ 150 /* Get a "working memory" vector. */
153 backtrace = HASH_KEY (log, index); 151 backtrace = HASH_KEY (log, index);
154 asize = ASIZE (backtrace); 152 get_backtrace (backtrace);
155
156 /* Copy the backtrace contents into working memory. */
157 for (; i < asize && backlist; i++, backlist = backlist->next)
158 /* FIXME: For closures we should ignore the environment. */
159 ASET (backtrace, i, backlist->function);
160
161 /* Make sure that unused space of working memory is filled with nil. */
162 for (; i < asize; i++)
163 ASET (backtrace, i, Qnil);
164 153
165 { /* We basically do a `gethash+puthash' here, except that we have to be 154 { /* We basically do a `gethash+puthash' here, except that we have to be
166 careful to avoid memory allocation since we're in a signal 155 careful to avoid memory allocation since we're in a signal
@@ -232,7 +221,7 @@ static EMACS_INT current_sampling_interval;
232static void 221static void
233handle_profiler_signal (int signal) 222handle_profiler_signal (int signal)
234{ 223{
235 if (backtrace_list && EQ (backtrace_list->function, Qautomatic_gc)) 224 if (EQ (backtrace_top_function (), Qautomatic_gc))
236 /* Special case the time-count inside GC because the hash-table 225 /* Special case the time-count inside GC because the hash-table
237 code is not prepared to be used while the GC is running. 226 code is not prepared to be used while the GC is running.
238 More specifically it uses ASIZE at many places where it does 227 More specifically it uses ASIZE at many places where it does
diff --git a/src/puresize.h b/src/puresize.h
index 2f717571c7c..25a11aafbcc 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -73,9 +73,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
73/* Signal an error if OBJ is pure. */ 73/* Signal an error if OBJ is pure. */
74#define CHECK_IMPURE(obj) \ 74#define CHECK_IMPURE(obj) \
75 { if (PURE_P (obj)) \ 75 { if (PURE_P (obj)) \
76 pure_write_error (); } 76 pure_write_error (obj); }
77 77
78extern _Noreturn void pure_write_error (void); 78extern _Noreturn void pure_write_error (Lisp_Object);
79 79
80/* Define PURE_P. */ 80/* Define PURE_P. */
81 81
diff --git a/src/syssignal.h b/src/syssignal.h
index d7399c6cb8c..45ea8f1af3c 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -50,6 +50,10 @@ char const *safe_strsignal (int) ATTRIBUTE_CONST;
50# define NSIG NSIG_MINIMUM 50# define NSIG NSIG_MINIMUM
51#endif 51#endif
52 52
53#ifndef SA_SIGINFO
54# define SA_SIGINFO 0
55#endif
56
53#ifndef emacs_raise 57#ifndef emacs_raise
54# define emacs_raise(sig) raise (sig) 58# define emacs_raise(sig) raise (sig)
55#endif 59#endif
diff --git a/src/term.c b/src/term.c
index 28b944c6436..0bcef55947a 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3189,12 +3189,13 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3189#ifdef WINDOWSNT 3189#ifdef WINDOWSNT
3190 { 3190 {
3191 struct frame *f = XFRAME (selected_frame); 3191 struct frame *f = XFRAME (selected_frame);
3192 int height, width;
3192 3193
3193 initialize_w32_display (terminal); 3194 initialize_w32_display (terminal, &width, &height);
3194 3195
3195 FrameRows (tty) = FRAME_LINES (f); 3196 FrameRows (tty) = height;
3196 FrameCols (tty) = FRAME_COLS (f); 3197 FrameCols (tty) = width;
3197 tty->specified_window = FRAME_LINES (f); 3198 tty->specified_window = height;
3198 3199
3199 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; 3200 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
3200 terminal->char_ins_del_ok = 1; 3201 terminal->char_ins_del_ok = 1;
diff --git a/src/termhooks.h b/src/termhooks.h
index cdb788cfb07..fdbeda076b7 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -215,7 +215,7 @@ enum event_kind
215 /* events generated by xwidgets*/ 215 /* events generated by xwidgets*/
216 , XWIDGET_EVENT 216 , XWIDGET_EVENT
217#endif 217#endif
218#if defined (HAVE_INOTIFY) || defined (HAVE_NTGUI) 218#ifdef USE_FILE_NOTIFY
219 /* File or directory was changed. */ 219 /* File or directory was changed. */
220 , FILE_NOTIFY_EVENT 220 , FILE_NOTIFY_EVENT
221#endif 221#endif
diff --git a/src/w32.c b/src/w32.c
index 7d63c73eb18..7a39a617ee3 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -2452,7 +2452,7 @@ get_emacs_configuration_options (void)
2452 2452
2453/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ 2453/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */
2454int 2454int
2455gettimeofday (struct timeval *restrict tv, struct timezone *restrict tz) 2455gettimeofday (struct timeval *__restrict tv, struct timezone *__restrict tz)
2456{ 2456{
2457 struct _timeb tb; 2457 struct _timeb tb;
2458 _ftime (&tb); 2458 _ftime (&tb);
diff --git a/src/w32console.c b/src/w32console.c
index 06b2c7aa24e..ee92a593301 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -601,7 +601,7 @@ w32_face_attributes (struct frame *f, int face_id)
601} 601}
602 602
603void 603void
604initialize_w32_display (struct terminal *term) 604initialize_w32_display (struct terminal *term, int *width, int *height)
605{ 605{
606 CONSOLE_SCREEN_BUFFER_INFO info; 606 CONSOLE_SCREEN_BUFFER_INFO info;
607 Mouse_HLInfo *hlinfo; 607 Mouse_HLInfo *hlinfo;
@@ -722,23 +722,21 @@ initialize_w32_display (struct terminal *term)
722 || info.srWindow.Right - info.srWindow.Left < 40 722 || info.srWindow.Right - info.srWindow.Left < 40
723 || info.srWindow.Right - info.srWindow.Left > 100))) 723 || info.srWindow.Right - info.srWindow.Left > 100)))
724 { 724 {
725 FRAME_LINES (SELECTED_FRAME ()) = 25; 725 *height = 25;
726 SET_FRAME_COLS (SELECTED_FRAME (), 80); 726 *width = 80;
727 } 727 }
728 728
729 else if (w32_use_full_screen_buffer) 729 else if (w32_use_full_screen_buffer)
730 { 730 {
731 FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */ 731 *height = info.dwSize.Y; /* lines per page */
732 SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */ 732 *width = info.dwSize.X; /* characters per line */
733 } 733 }
734 else 734 else
735 { 735 {
736 /* Lines per page. Use buffer coords instead of buffer size. */ 736 /* Lines per page. Use buffer coords instead of buffer size. */
737 FRAME_LINES (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom - 737 *height = 1 + info.srWindow.Bottom - info.srWindow.Top;
738 info.srWindow.Top;
739 /* Characters per line. Use buffer coords instead of buffer size. */ 738 /* Characters per line. Use buffer coords instead of buffer size. */
740 SET_FRAME_COLS (SELECTED_FRAME (), 1 + info.srWindow.Right - 739 *width = 1 + info.srWindow.Right - info.srWindow.Left;
741 info.srWindow.Left);
742 } 740 }
743 741
744 if (os_subtype == OS_NT) 742 if (os_subtype == OS_NT)
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 3c38cf806e8..88a3f9739cd 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -577,6 +577,7 @@ maybe_generate_resize_event (void)
577 0, 0, 0); 577 0, 0, 0);
578} 578}
579 579
580#if HAVE_W32NOTIFY
580static int 581static int
581handle_file_notifications (struct input_event *hold_quit) 582handle_file_notifications (struct input_event *hold_quit)
582{ 583{
@@ -644,6 +645,13 @@ handle_file_notifications (struct input_event *hold_quit)
644 leave_crit (); 645 leave_crit ();
645 return nevents; 646 return nevents;
646} 647}
648#else /* !HAVE_W32NOTIFY */
649static int
650handle_file_notifications (struct input_event *hold_quit)
651{
652 return 0;
653}
654#endif /* !HAVE_W32NOTIFY */
647 655
648/* Here's an overview of how Emacs input works in non-GUI sessions on 656/* Here's an overview of how Emacs input works in non-GUI sessions on
649 MS-Windows. (For description of the GUI input, see the commentary 657 MS-Windows. (For description of the GUI input, see the commentary
diff --git a/src/w32notify.c b/src/w32notify.c
index 1bcaa794565..be03a6ce45f 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -39,7 +39,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
39 return, and watch_worker then issues another call to 39 return, and watch_worker then issues another call to
40 ReadDirectoryChangesW. (Except when it does not, see below.) 40 ReadDirectoryChangesW. (Except when it does not, see below.)
41 41
42 In a GUI session, The WM_EMACS_FILENOTIFY message, posted to the 42 In a GUI session, the WM_EMACS_FILENOTIFY message posted to the
43 message queue gets dispatched to the main Emacs window procedure, 43 message queue gets dispatched to the main Emacs window procedure,
44 which queues it for processing by w32_read_socket. When 44 which queues it for processing by w32_read_socket. When
45 w32_read_socket sees this message, it accesses the buffer with file 45 w32_read_socket sees this message, it accesses the buffer with file
diff --git a/src/w32term.c b/src/w32term.c
index 58b1d3ca308..617492e189f 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3210,6 +3210,8 @@ construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f)
3210} 3210}
3211 3211
3212 3212
3213#if HAVE_W32NOTIFY
3214
3213/* File event notifications (see w32notify.c). */ 3215/* File event notifications (see w32notify.c). */
3214 3216
3215Lisp_Object 3217Lisp_Object
@@ -3325,7 +3327,8 @@ queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f,
3325 /* We've stuffed all the events ourselves, so w32_read_socket shouldn't. */ 3327 /* We've stuffed all the events ourselves, so w32_read_socket shouldn't. */
3326 event->kind = NO_EVENT; 3328 event->kind = NO_EVENT;
3327} 3329}
3328#endif 3330#endif /* WINDOWSNT */
3331#endif /* HAVE_W32NOTIFY */
3329 3332
3330 3333
3331/* Function to report a mouse movement to the mainstream Emacs code. 3334/* Function to report a mouse movement to the mainstream Emacs code.
@@ -4968,7 +4971,7 @@ w32_read_socket (struct terminal *terminal,
4968 check_visibility = 1; 4971 check_visibility = 1;
4969 break; 4972 break;
4970 4973
4971#ifdef WINDOWSNT 4974#if HAVE_W32NOTIFY
4972 case WM_EMACS_FILENOTIFY: 4975 case WM_EMACS_FILENOTIFY:
4973 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); 4976 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
4974 if (f) 4977 if (f)
diff --git a/src/w32term.h b/src/w32term.h
index 9c27c09d03d..be0b4a6f350 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -683,7 +683,7 @@ extern Lisp_Object w32_get_watch_object (void *);
683extern Lisp_Object lispy_file_action (DWORD); 683extern Lisp_Object lispy_file_action (DWORD);
684 684
685extern void w32_initialize_display_info (Lisp_Object); 685extern void w32_initialize_display_info (Lisp_Object);
686extern void initialize_w32_display (struct terminal *); 686extern void initialize_w32_display (struct terminal *, int *, int *);
687 687
688/* Keypad command key support. W32 doesn't have virtual keys defined 688/* Keypad command key support. W32 doesn't have virtual keys defined
689 for the function keys on the keypad (they are mapped to the standard 689 for the function keys on the keypad (they are mapped to the standard
diff --git a/src/window.c b/src/window.c
index ed2505a893f..68e4291272d 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1621,12 +1621,13 @@ specifies the position of the last visible glyph in WINDOW. POS
1621defaults to point in WINDOW; WINDOW defaults to the selected window. 1621defaults to point in WINDOW; WINDOW defaults to the selected window.
1622 1622
1623If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, 1623If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
1624return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS]), 1624the return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS]),
1625where X and Y are the pixel coordinates relative to the top left corner 1625where X and Y are the pixel coordinates relative to the top left corner
1626of the window. The remaining elements are omitted if the character after 1626of the window. The remaining elements are omitted if the character after
1627POS is fully visible; otherwise, RTOP and RBOT are the number of pixels 1627POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
1628off-window at the top and bottom of the row, ROWH is the height of the 1628off-window at the top and bottom of the screen line ("row") containing
1629display row, and VPOS is the row number (0-based) containing POS. */) 1629POS, ROWH is the visible height of that row, and VPOS is the row number
1630\(zero-based). */)
1630 (Lisp_Object pos, Lisp_Object window, Lisp_Object partially) 1631 (Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
1631{ 1632{
1632 register struct window *w; 1633 register struct window *w;
diff --git a/src/xdisp.c b/src/xdisp.c
index d26f5b4e045..09fb3934cc9 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2655,6 +2655,7 @@ init_iterator (struct it *it, struct window *w,
2655 it->bidi_it.string.lstring = Qnil; 2655 it->bidi_it.string.lstring = Qnil;
2656 it->bidi_it.string.s = NULL; 2656 it->bidi_it.string.s = NULL;
2657 it->bidi_it.string.bufpos = 0; 2657 it->bidi_it.string.bufpos = 0;
2658 it->bidi_it.w = w;
2658 2659
2659 /* The window in which we iterate over current_buffer: */ 2660 /* The window in which we iterate over current_buffer: */
2660 XSETWINDOW (it->window, w); 2661 XSETWINDOW (it->window, w);
@@ -3129,6 +3130,7 @@ init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos)
3129 it->bidi_it.string.bufpos = it->overlay_strings_charpos; 3130 it->bidi_it.string.bufpos = it->overlay_strings_charpos;
3130 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p; 3131 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
3131 it->bidi_it.string.unibyte = !it->multibyte_p; 3132 it->bidi_it.string.unibyte = !it->multibyte_p;
3133 it->bidi_it.w = it->w;
3132 bidi_init_it (IT_STRING_CHARPOS (*it), IT_STRING_BYTEPOS (*it), 3134 bidi_init_it (IT_STRING_CHARPOS (*it), IT_STRING_BYTEPOS (*it),
3133 FRAME_WINDOW_P (it->f), &it->bidi_it); 3135 FRAME_WINDOW_P (it->f), &it->bidi_it);
3134 3136
@@ -3495,11 +3497,11 @@ next_overlay_change (ptrdiff_t pos)
3495ptrdiff_t 3497ptrdiff_t
3496compute_display_string_pos (struct text_pos *position, 3498compute_display_string_pos (struct text_pos *position,
3497 struct bidi_string_data *string, 3499 struct bidi_string_data *string,
3500 struct window *w,
3498 int frame_window_p, int *disp_prop) 3501 int frame_window_p, int *disp_prop)
3499{ 3502{
3500 /* OBJECT = nil means current buffer. */ 3503 /* OBJECT = nil means current buffer. */
3501 Lisp_Object object = 3504 Lisp_Object object, object1;
3502 (string && STRINGP (string->lstring)) ? string->lstring : Qnil;
3503 Lisp_Object pos, spec, limpos; 3505 Lisp_Object pos, spec, limpos;
3504 int string_p = (string && (STRINGP (string->lstring) || string->s)); 3506 int string_p = (string && (STRINGP (string->lstring) || string->s));
3505 ptrdiff_t eob = string_p ? string->schars : ZV; 3507 ptrdiff_t eob = string_p ? string->schars : ZV;
@@ -3510,6 +3512,16 @@ compute_display_string_pos (struct text_pos *position,
3510 struct text_pos tpos; 3512 struct text_pos tpos;
3511 int rv = 0; 3513 int rv = 0;
3512 3514
3515 if (string && STRINGP (string->lstring))
3516 object1 = object = string->lstring;
3517 else if (w && !string_p)
3518 {
3519 XSETWINDOW (object, w);
3520 object1 = Qnil;
3521 }
3522 else
3523 object1 = object = Qnil;
3524
3513 *disp_prop = 1; 3525 *disp_prop = 1;
3514 3526
3515 if (charpos >= eob 3527 if (charpos >= eob
@@ -3548,7 +3560,7 @@ compute_display_string_pos (struct text_pos *position,
3548 that will replace the underlying text when displayed. */ 3560 that will replace the underlying text when displayed. */
3549 limpos = make_number (lim); 3561 limpos = make_number (lim);
3550 do { 3562 do {
3551 pos = Fnext_single_char_property_change (pos, Qdisplay, object, limpos); 3563 pos = Fnext_single_char_property_change (pos, Qdisplay, object1, limpos);
3552 CHARPOS (tpos) = XFASTINT (pos); 3564 CHARPOS (tpos) = XFASTINT (pos);
3553 if (CHARPOS (tpos) >= lim) 3565 if (CHARPOS (tpos) >= lim)
3554 { 3566 {
@@ -5043,6 +5055,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
5043 it->bidi_it.string.bufpos = bufpos; 5055 it->bidi_it.string.bufpos = bufpos;
5044 it->bidi_it.string.from_disp_str = 1; 5056 it->bidi_it.string.from_disp_str = 1;
5045 it->bidi_it.string.unibyte = !it->multibyte_p; 5057 it->bidi_it.string.unibyte = !it->multibyte_p;
5058 it->bidi_it.w = it->w;
5046 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it); 5059 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
5047 } 5060 }
5048 } 5061 }
@@ -5434,6 +5447,7 @@ next_overlay_string (struct it *it)
5434 it->bidi_it.string.bufpos = it->overlay_strings_charpos; 5447 it->bidi_it.string.bufpos = it->overlay_strings_charpos;
5435 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p; 5448 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
5436 it->bidi_it.string.unibyte = !it->multibyte_p; 5449 it->bidi_it.string.unibyte = !it->multibyte_p;
5450 it->bidi_it.w = it->w;
5437 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it); 5451 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
5438 } 5452 }
5439 } 5453 }
@@ -5737,6 +5751,7 @@ get_overlay_strings_1 (struct it *it, ptrdiff_t charpos, int compute_stop_p)
5737 it->bidi_it.string.bufpos = pos; 5751 it->bidi_it.string.bufpos = pos;
5738 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p; 5752 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
5739 it->bidi_it.string.unibyte = !it->multibyte_p; 5753 it->bidi_it.string.unibyte = !it->multibyte_p;
5754 it->bidi_it.w = it->w;
5740 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it); 5755 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
5741 } 5756 }
5742 return 1; 5757 return 1;
@@ -6379,6 +6394,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
6379 it->bidi_it.string.lstring = Qnil; 6394 it->bidi_it.string.lstring = Qnil;
6380 it->bidi_it.string.bufpos = 0; 6395 it->bidi_it.string.bufpos = 0;
6381 it->bidi_it.string.unibyte = 0; 6396 it->bidi_it.string.unibyte = 0;
6397 it->bidi_it.w = it->w;
6382 } 6398 }
6383 6399
6384 if (set_stop_p) 6400 if (set_stop_p)
@@ -6456,6 +6472,7 @@ reseat_to_string (struct it *it, const char *s, Lisp_Object string,
6456 it->bidi_it.string.bufpos = 0; 6472 it->bidi_it.string.bufpos = 0;
6457 it->bidi_it.string.from_disp_str = 0; 6473 it->bidi_it.string.from_disp_str = 0;
6458 it->bidi_it.string.unibyte = !it->multibyte_p; 6474 it->bidi_it.string.unibyte = !it->multibyte_p;
6475 it->bidi_it.w = it->w;
6459 bidi_init_it (charpos, IT_STRING_BYTEPOS (*it), 6476 bidi_init_it (charpos, IT_STRING_BYTEPOS (*it),
6460 FRAME_WINDOW_P (it->f), &it->bidi_it); 6477 FRAME_WINDOW_P (it->f), &it->bidi_it);
6461 } 6478 }
@@ -6487,6 +6504,7 @@ reseat_to_string (struct it *it, const char *s, Lisp_Object string,
6487 it->bidi_it.string.bufpos = 0; 6504 it->bidi_it.string.bufpos = 0;
6488 it->bidi_it.string.from_disp_str = 0; 6505 it->bidi_it.string.from_disp_str = 0;
6489 it->bidi_it.string.unibyte = !it->multibyte_p; 6506 it->bidi_it.string.unibyte = !it->multibyte_p;
6507 it->bidi_it.w = it->w;
6490 bidi_init_it (charpos, IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f), 6508 bidi_init_it (charpos, IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f),
6491 &it->bidi_it); 6509 &it->bidi_it);
6492 } 6510 }
@@ -12186,12 +12204,27 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
12186 int hpos, vpos, prop_idx; 12204 int hpos, vpos, prop_idx;
12187 struct glyph *glyph; 12205 struct glyph *glyph;
12188 Lisp_Object enabled_p; 12206 Lisp_Object enabled_p;
12189 12207 int ts;
12190 /* If not on the highlighted tool-bar item, return. */ 12208
12209 /* If not on the highlighted tool-bar item, and mouse-highlight is
12210 non-nil, return. This is so we generate the tool-bar button
12211 click only when the mouse button is released on the same item as
12212 where it was pressed. However, when mouse-highlight is disabled,
12213 generate the click when the button is released regardless of the
12214 highlight, since tool-bar items are not highlighted in that
12215 case. */
12191 frame_to_window_pixel_xy (w, &x, &y); 12216 frame_to_window_pixel_xy (w, &x, &y);
12192 if (get_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) 12217 ts = get_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx);
12218 if (ts == -1
12219 || (ts != 0 && !NILP (Vmouse_highlight)))
12193 return; 12220 return;
12194 12221
12222 /* When mouse-highlight is off, generate the click for the item
12223 where the button was pressed, disregarding where it was
12224 released. */
12225 if (NILP (Vmouse_highlight) && !down_p)
12226 prop_idx = last_tool_bar_item;
12227
12195 /* If item is disabled, do nothing. */ 12228 /* If item is disabled, do nothing. */
12196 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); 12229 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
12197 if (NILP (enabled_p)) 12230 if (NILP (enabled_p))
@@ -12200,7 +12233,8 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
12200 if (down_p) 12233 if (down_p)
12201 { 12234 {
12202 /* Show item in pressed state. */ 12235 /* Show item in pressed state. */
12203 show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN); 12236 if (!NILP (Vmouse_highlight))
12237 show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
12204 last_tool_bar_item = prop_idx; 12238 last_tool_bar_item = prop_idx;
12205 } 12239 }
12206 else 12240 else
@@ -12210,7 +12244,8 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
12210 EVENT_INIT (event); 12244 EVENT_INIT (event);
12211 12245
12212 /* Show item in released state. */ 12246 /* Show item in released state. */
12213 show_mouse_face (hlinfo, DRAW_IMAGE_RAISED); 12247 if (!NILP (Vmouse_highlight))
12248 show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
12214 12249
12215 key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY); 12250 key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY);
12216 12251
@@ -12283,7 +12318,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
12283 12318
12284 /* If tool-bar item is not enabled, don't highlight it. */ 12319 /* If tool-bar item is not enabled, don't highlight it. */
12285 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); 12320 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
12286 if (!NILP (enabled_p)) 12321 if (!NILP (enabled_p) && !NILP (Vmouse_highlight))
12287 { 12322 {
12288 /* Compute the x-position of the glyph. In front and past the 12323 /* Compute the x-position of the glyph. In front and past the
12289 image is a space. We include this in the highlighted area. */ 12324 image is a space. We include this in the highlighted area. */
@@ -12900,7 +12935,6 @@ redisplay_internal (void)
12900 struct frame *sf; 12935 struct frame *sf;
12901 int polling_stopped_here = 0; 12936 int polling_stopped_here = 0;
12902 Lisp_Object tail, frame; 12937 Lisp_Object tail, frame;
12903 struct backtrace backtrace;
12904 12938
12905 /* Non-zero means redisplay has to consider all windows on all 12939 /* Non-zero means redisplay has to consider all windows on all
12906 frames. Zero means, only selected_window is considered. */ 12940 frames. Zero means, only selected_window is considered. */
@@ -12944,12 +12978,7 @@ redisplay_internal (void)
12944 specbind (Qinhibit_free_realized_faces, Qnil); 12978 specbind (Qinhibit_free_realized_faces, Qnil);
12945 12979
12946 /* Record this function, so it appears on the profiler's backtraces. */ 12980 /* Record this function, so it appears on the profiler's backtraces. */
12947 backtrace.next = backtrace_list; 12981 record_in_backtrace (Qredisplay_internal, &Qnil, 0);
12948 backtrace.function = Qredisplay_internal;
12949 backtrace.args = &Qnil;
12950 backtrace.nargs = 0;
12951 backtrace.debug_on_exit = 0;
12952 backtrace_list = &backtrace;
12953 12982
12954 FOR_EACH_FRAME (tail, frame) 12983 FOR_EACH_FRAME (tail, frame)
12955 XFRAME (frame)->already_hscrolled_p = 0; 12984 XFRAME (frame)->already_hscrolled_p = 0;
@@ -13593,7 +13622,6 @@ redisplay_internal (void)
13593#endif /* HAVE_WINDOW_SYSTEM */ 13622#endif /* HAVE_WINDOW_SYSTEM */
13594 13623
13595 end_of_redisplay: 13624 end_of_redisplay:
13596 backtrace_list = backtrace.next;
13597 unbind_to (count, Qnil); 13625 unbind_to (count, Qnil);
13598 RESUME_POLLING; 13626 RESUME_POLLING;
13599} 13627}
@@ -19016,6 +19044,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
19016 it->bidi_it.string.bufpos = IT_CHARPOS (*it); 19044 it->bidi_it.string.bufpos = IT_CHARPOS (*it);
19017 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p; 19045 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
19018 it->bidi_it.string.unibyte = !it->multibyte_p; 19046 it->bidi_it.string.unibyte = !it->multibyte_p;
19047 it->bidi_it.w = it->w;
19019 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it); 19048 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
19020 } 19049 }
19021 } 19050 }
@@ -19046,16 +19075,19 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
19046static Lisp_Object 19075static Lisp_Object
19047get_it_property (struct it *it, Lisp_Object prop) 19076get_it_property (struct it *it, Lisp_Object prop)
19048{ 19077{
19049 Lisp_Object position; 19078 Lisp_Object position, object = it->object;
19050 19079
19051 if (STRINGP (it->object)) 19080 if (STRINGP (object))
19052 position = make_number (IT_STRING_CHARPOS (*it)); 19081 position = make_number (IT_STRING_CHARPOS (*it));
19053 else if (BUFFERP (it->object)) 19082 else if (BUFFERP (object))
19054 position = make_number (IT_CHARPOS (*it)); 19083 {
19084 position = make_number (IT_CHARPOS (*it));
19085 object = it->window;
19086 }
19055 else 19087 else
19056 return Qnil; 19088 return Qnil;
19057 19089
19058 return Fget_char_property (position, prop, it->object); 19090 return Fget_char_property (position, prop, object);
19059} 19091}
19060 19092
19061/* See if there's a line- or wrap-prefix, and if so, push it on IT. */ 19093/* See if there's a line- or wrap-prefix, and if so, push it on IT. */
@@ -20085,6 +20117,10 @@ See also `bidi-paragraph-direction'. */)
20085 itb.string.lstring = Qnil; 20117 itb.string.lstring = Qnil;
20086 itb.string.bufpos = 0; 20118 itb.string.bufpos = 0;
20087 itb.string.unibyte = 0; 20119 itb.string.unibyte = 0;
20120 /* We have no window to use here for ignoring window-specific
20121 overlays. Using NULL for window pointer will cause
20122 compute_display_string_pos to use the current buffer. */
20123 itb.w = NULL;
20088 bidi_paragraph_init (NEUTRAL_DIR, &itb, 1); 20124 bidi_paragraph_init (NEUTRAL_DIR, &itb, 1);
20089 bidi_unshelve_cache (itb_data, 0); 20125 bidi_unshelve_cache (itb_data, 0);
20090 set_buffer_temp (old); 20126 set_buffer_temp (old);
@@ -27658,7 +27694,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27658 if (STRINGP (string)) 27694 if (STRINGP (string))
27659 { 27695 {
27660 mouse_face = Fget_text_property (pos, Qmouse_face, string); 27696 mouse_face = Fget_text_property (pos, Qmouse_face, string);
27661 if (!NILP (mouse_face) 27697 if (!NILP (Vmouse_highlight) && !NILP (mouse_face)
27662 && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)) 27698 && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE))
27663 && glyph) 27699 && glyph)
27664 { 27700 {
@@ -27796,8 +27832,10 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27796 27832
27797/* EXPORT: 27833/* EXPORT:
27798 Take proper action when the mouse has moved to position X, Y on 27834 Take proper action when the mouse has moved to position X, Y on
27799 frame F as regards highlighting characters that have mouse-face 27835 frame F with regards to highlighting portions of display that have
27800 properties. Also de-highlighting chars where the mouse was before. 27836 mouse-face properties. Also de-highlight portions of display where
27837 the mouse was before, set the mouse pointer shape as appropriate
27838 for the mouse coordinates, and activate help echo (tooltips).
27801 X and Y can be negative or out of range. */ 27839 X and Y can be negative or out of range. */
27802 27840
27803void 27841void
@@ -27817,8 +27855,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
27817 return; 27855 return;
27818#endif 27856#endif
27819 27857
27820 if (NILP (Vmouse_highlight) 27858 if (!f->glyphs_initialized_p
27821 || !f->glyphs_initialized_p
27822 || f->pointer_invisible) 27859 || f->pointer_invisible)
27823 return; 27860 return;
27824 27861
@@ -28014,6 +28051,12 @@ note_mouse_highlight (struct frame *f, int x, int y)
28014 else 28051 else
28015 noverlays = 0; 28052 noverlays = 0;
28016 28053
28054 if (NILP (Vmouse_highlight))
28055 {
28056 clear_mouse_face (hlinfo);
28057 goto check_help_echo;
28058 }
28059
28017 same_region = coords_in_mouse_face_p (w, hpos, vpos); 28060 same_region = coords_in_mouse_face_p (w, hpos, vpos);
28018 28061
28019 if (same_region) 28062 if (same_region)
diff --git a/src/xgselect.c b/src/xgselect.c
index 0b5ad6ae70d..4d90298a9d9 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -21,11 +21,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include "xgselect.h" 22#include "xgselect.h"
23 23
24#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) 24#ifdef HAVE_GLIB
25 25
26#include <glib.h> 26#include <glib.h>
27#include <errno.h> 27#include <errno.h>
28#include "xterm.h"
29#include "frame.h" 28#include "frame.h"
30 29
31int 30int
@@ -44,9 +43,13 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
44 int i, nfds, tmo_in_millisec; 43 int i, nfds, tmo_in_millisec;
45 USE_SAFE_ALLOCA; 44 USE_SAFE_ALLOCA;
46 45
47 if (! (window_system_available (NULL) 46 /* Do not try to optimize with an initial check with g_main_context_pending
48 && g_main_context_pending (context = g_main_context_default ()))) 47 and a call to pselect if it returns false. If Gdk has a timeout for 0.01
49 return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask); 48 second, and Emacs has a timeout for 1 second, g_main_context_pending will
49 return false, but the timeout will be 1 second, thus missing the gdk
50 timeout with a lot. */
51
52 context = g_main_context_default ();
50 53
51 if (rfds) all_rfds = *rfds; 54 if (rfds) all_rfds = *rfds;
52 else FD_ZERO (&all_rfds); 55 else FD_ZERO (&all_rfds);
@@ -140,4 +143,4 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
140 143
141 return retval; 144 return retval;
142} 145}
143#endif /* USE_GTK || HAVE_GCONF || HAVE_GSETTINGS */ 146#endif /* HAVE_GLIB */
diff --git a/test/ChangeLog b/test/ChangeLog
index 8ab70c98c82..98fb2e3da1f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,12 @@
12013-05-31 Dmitry Gutov <dgutov@yandex.ru>
2
3 * automated/ruby-mode-tests.el: New tests, for percent literals
4 and expression expansion.
5
62013-05-29 Leo Liu <sdl.web@gmail.com>
7
8 * indent/octave.m: Tweak.
9
12013-05-26 Aidan Gauland <aidalgol@amuri.net> 102013-05-26 Aidan Gauland <aidalgol@amuri.net>
2 11
3 * tests/eshell.el: Rewrite tests using ERT. 12 * tests/eshell.el: Rewrite tests using ERT.
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index e52927a2968..77dd62821f7 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -112,6 +112,9 @@ VALUES-PLIST is a list with alternating index and value elements."
112(ert-deftest ruby-regexp-starts-after-string () 112(ert-deftest ruby-regexp-starts-after-string ()
113 (ruby-assert-state "'(/', /\d+/" 3 ?/ 8)) 113 (ruby-assert-state "'(/', /\d+/" 3 ?/ 8))
114 114
115(ert-deftest ruby-regexp-interpolation-is-highlighted ()
116 (ruby-assert-face "/#{foobs}/" 4 font-lock-variable-name-face))
117
115(ert-deftest ruby-regexp-skips-over-interpolation () 118(ert-deftest ruby-regexp-skips-over-interpolation ()
116 (ruby-assert-state "/#{foobs.join('/')}/" 3 nil)) 119 (ruby-assert-state "/#{foobs.join('/')}/" 3 nil))
117 120
@@ -353,6 +356,23 @@ VALUES-PLIST is a list with alternating index and value elements."
353 ;; It's confused by the closing paren in the middle. 356 ;; It's confused by the closing paren in the middle.
354 (ruby-assert-state s 8 nil))) 357 (ruby-assert-state s 8 nil)))
355 358
359(ert-deftest ruby-interpolation-inside-double-quoted-percent-literals ()
360 (ruby-assert-face "%Q{foo #@bar}" 8 font-lock-variable-name-face)
361 (ruby-assert-face "%W{foo #@bar}" 8 font-lock-variable-name-face)
362 (ruby-assert-face "%r{foo #@bar}" 8 font-lock-variable-name-face)
363 (ruby-assert-face "%x{foo #@bar}" 8 font-lock-variable-name-face))
364
365(ert-deftest ruby-no-interpolation-in-single-quoted-literals ()
366 (ruby-assert-face "'foo #@bar'" 7 font-lock-string-face)
367 (ruby-assert-face "%q{foo #@bar}" 8 font-lock-string-face)
368 (ruby-assert-face "%w{foo #@bar}" 8 font-lock-string-face)
369 (ruby-assert-face "%s{foo #@bar}" 8 font-lock-string-face))
370
371(ert-deftest ruby-no-unknown-percent-literals ()
372 ;; No folding of case.
373 (ruby-assert-face "%S{foo}" 4 nil)
374 (ruby-assert-face "%R{foo}" 4 nil))
375
356(ert-deftest ruby-add-log-current-method-examples () 376(ert-deftest ruby-add-log-current-method-examples ()
357 (let ((pairs '(("foo" . "#foo") 377 (let ((pairs '(("foo" . "#foo")
358 ("C.foo" . ".foo") 378 ("C.foo" . ".foo")
diff --git a/test/indent/octave.m b/test/indent/octave.m
index 55f8cc045f4..e5bae850589 100644
--- a/test/indent/octave.m
+++ b/test/indent/octave.m
@@ -2311,7 +2311,7 @@ function dep = is_architecture_dependent (nm)
2311 ext(end) = []; 2311 ext(end) = [];
2312 else 2312 else
2313 isglob = false; # I am a test 2313 isglob = false; # I am a test
2314 # me too 2314 #%% me too
2315### I shall align to column 0 2315### I shall align to column 0
2316 endif 2316 endif
2317 pos = findstr (nm, ext); 2317 pos = findstr (nm, ext);