aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXue Fuqiao2013-12-26 06:27:00 +0800
committerXue Fuqiao2013-12-26 06:27:00 +0800
commit77bbf3713d459c45492e6daed68437edcf863a0c (patch)
tree0e2ea82f80e907cea52eb683a362504a3813a463
parent3bc1e1880f232ccaea7c35a0c51bac61df9ac23c (diff)
parent83fa295c1236aba5a73d565082dcb58a32f3e446 (diff)
downloademacs-77bbf3713d459c45492e6daed68437edcf863a0c.tar.gz
emacs-77bbf3713d459c45492e6daed68437edcf863a0c.zip
Merge from mainline.
-rw-r--r--ChangeLog8
-rw-r--r--admin/ChangeLog7
-rw-r--r--admin/admin.el3
-rwxr-xr-xadmin/merge-gnulib3
-rw-r--r--admin/notes/years6
-rwxr-xr-xadmin/update-copyright75
-rwxr-xr-xbuild-aux/update-copyright274
-rw-r--r--doc/emacs/ChangeLog8
-rw-r--r--doc/emacs/files.texi1
-rw-r--r--doc/emacs/glossary.texi12
-rw-r--r--doc/emacs/mule.texi1
-rw-r--r--doc/lispref/ChangeLog43
-rw-r--r--doc/lispref/commands.texi6
-rw-r--r--doc/lispref/control.texi16
-rw-r--r--doc/lispref/display.texi4
-rw-r--r--doc/lispref/eval.texi18
-rw-r--r--doc/lispref/keymaps.texi196
-rw-r--r--doc/lispref/nonascii.texi16
-rw-r--r--doc/lispref/tips.texi13
-rw-r--r--doc/lispref/variables.texi119
-rw-r--r--etc/NEWS14
-rw-r--r--lib/gnulib.mk9
-rw-r--r--lisp/ChangeLog54
-rw-r--r--lisp/net/eww.el20
-rw-r--r--lisp/net/shr.el34
-rw-r--r--lisp/progmodes/python.el112
-rw-r--r--lisp/window.el16
-rw-r--r--m4/gnulib-comp.m42
-rwxr-xr-xmake-dist3
-rw-r--r--msdos/autogen/Makefile.in4
-rw-r--r--src/ChangeLog19
-rw-r--r--src/intervals.c1
-rw-r--r--src/keyboard.c13
-rw-r--r--src/keymap.c2
-rw-r--r--src/w32fns.c45
-rw-r--r--test/ChangeLog6
-rw-r--r--test/automated/python-tests.el45
37 files changed, 906 insertions, 322 deletions
diff --git a/ChangeLog b/ChangeLog
index 417172e5852..3630d570b28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12013-12-24 Paul Eggert <eggert@cs.ucla.edu>
2
3 Automate the procedure for updating copyright year.
4 * build-aux/update-copyright: New file.
5 * make-dist: Distribute it.
6 * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
7 * msdos/autogen/Makefile.in: Update copyright year.
8
12013-12-23 Andreas Schwab <schwab@linux-m68k.org> 92013-12-23 Andreas Schwab <schwab@linux-m68k.org>
2 10
3 * configure.ac: Replace obsolete macro AC_CONFIG_HEADER by 11 * configure.ac: Replace obsolete macro AC_CONFIG_HEADER by
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 40d1e069f03..ea47a6798b5 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,10 @@
12013-12-24 Paul Eggert <eggert@cs.ucla.edu>
2
3 Automate the procedure for updating copyright year.
4 * merge-gnulib (GNULIB_MODULES): Add update-copyright.
5 * notes/years: Mention admin/update-copyright.
6 * update-copyright: New file.
7
12013-12-24 Xue Fuqiao <xfq.free@gmail.com> 82013-12-24 Xue Fuqiao <xfq.free@gmail.com>
2 9
3 * admin.el (add-release-logs): 10 * admin.el (add-release-logs):
diff --git a/admin/admin.el b/admin/admin.el
index baf18992953..5e5e57cb3ce 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -75,6 +75,9 @@ Root must be the root of an Emacs source tree."
75 (interactive "DEmacs root directory: \nsVersion number: ") 75 (interactive "DEmacs root directory: \nsVersion number: ")
76 (unless (file-exists-p (expand-file-name "src/emacs.c" root)) 76 (unless (file-exists-p (expand-file-name "src/emacs.c" root))
77 (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) 77 (user-error "%s doesn't seem to be the root of an Emacs source tree" root))
78 ;; There's also a "version 3" (standing for GPLv3) at the end of
79 ;; `README', but since `set-version-in-file' only replaces the first
80 ;; occurence, it won't be replaced.
78 (set-version-in-file root "README" version 81 (set-version-in-file root "README" version
79 (rx (and "version" (1+ space) 82 (rx (and "version" (1+ space)
80 (submatch (1+ (in "0-9.")))))) 83 (submatch (1+ (in "0-9."))))))
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index af9300edbec..a86630f9e17 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -37,7 +37,8 @@ GNULIB_MODULES='
37 pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat 37 pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat
38 sig2str socklen stat-time stdalign stdarg stdbool stdio 38 sig2str socklen stat-time stdalign stdarg stdbool stdio
39 strftime strtoimax strtoumax symlink sys_stat 39 strftime strtoimax strtoumax symlink sys_stat
40 sys_time time timer-time timespec-add timespec-sub unsetenv utimens 40 sys_time time timer-time timespec-add timespec-sub
41 unsetenv update-copyright utimens
41 warnings 42 warnings
42' 43'
43 44
diff --git a/admin/notes/years b/admin/notes/years
index e6b38c5aefd..57cb5ad7e4f 100644
--- a/admin/notes/years
+++ b/admin/notes/years
@@ -2,6 +2,8 @@ HOW TO MAINTAIN COPYRIGHT YEARS FOR GNU EMACS
2 2
3Maintaining copyright years is now very simple: every time a new year 3Maintaining copyright years is now very simple: every time a new year
4rolls around, add that year to every FSF (and AIST) copyright notice. 4rolls around, add that year to every FSF (and AIST) copyright notice.
5Do this by running the 'admin/update-copyright' script on a fresh bzr
6checkout. Inspect the results for plausiblity, then commit them.
5 7
6There's no need to worry about whether an individual file has changed 8There's no need to worry about whether an individual file has changed
7in a given year - it's sufficient that Emacs as a whole has changed. 9in a given year - it's sufficient that Emacs as a whole has changed.
@@ -28,10 +30,10 @@ but should keep the full list in a comment in the source.
28 since Emacs 21 came out in 2001, all the subsequent years[1]. We don't 30 since Emacs 21 came out in 2001, all the subsequent years[1]. We don't
29 need to check whether *that file* was changed in those years. 31 need to check whether *that file* was changed in those years.
30 It's sufficient that *Emacs* was changed in those years (and it was!). 32 It's sufficient that *Emacs* was changed in those years (and it was!).
31 33
32 For those files that have been added since then, we should add 34 For those files that have been added since then, we should add
33 the year it was added to Emacs, and all subsequent years." 35 the year it was added to Emacs, and all subsequent years."
34 36
35 --RMS, 2005-07-13 37 --RMS, 2005-07-13
36 38
37[1] Note that this includes 2001 - see 39[1] Note that this includes 2001 - see
diff --git a/admin/update-copyright b/admin/update-copyright
new file mode 100755
index 00000000000..64653d97237
--- /dev/null
+++ b/admin/update-copyright
@@ -0,0 +1,75 @@
1#! /bin/sh
2# Update the copyright dates in Emacs sources.
3# Typical usage:
4#
5# admin/update-copyright
6#
7# By default, this script uses the local-time calendar year.
8# Set the UPDATE_COPYRIGHT_YEAR environment variable to override the default.
9
10# Copyright 2013 Free Software Foundation, Inc.
11
12# This file is part of GNU Emacs.
13
14# GNU Emacs is free software: you can redistribute it and/or modify
15# it under the terms of the GNU General Public License as published by
16# the Free Software Foundation, either version 3 of the License, or
17# (at your option) any later version.
18
19# GNU Emacs is distributed in the hope that it will be useful,
20# but WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22# GNU General Public License for more details.
23
24# You should have received a copy of the GNU General Public License
25# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26
27# written by Paul Eggert
28
29# FIXME: The file 'notes/copyright' says that the AIST copyright years
30# should be updated, but by inspection it appears that some should be
31# updated and some should not be, due to registration numbers, so
32# this script leaves these copyright years alone for now.
33
34: ${UPDATE_COPYRIGHT_USE_INTERVALS=1}
35export UPDATE_COPYRIGHT_USE_INTERVALS
36
37: ${UPDATE_COPYRIGHT_YEAR=$(date +%Y)}
38export UPDATE_COPYRIGHT_YEAR
39
40emacsver=etc/refcards/emacsver.tex
41sed 's/\\def\\year[{][0-9]*[}]/\\def\\year{'"$UPDATE_COPYRIGHT_YEAR"'}'/g \
42 $emacsver >$emacsver.aux &&
43{ cmp -s $emacsver $emacsver.aux ||
44 cp $emacsver.aux $emacsver
45} &&
46rm $emacsver.aux &&
47
48bzr_files=$(bzr ls -RV --kind file) &&
49
50# Do not update the copyright of files that have one or more of the
51# following problems:
52# . They are license files, maintained by the FSF, with their own dates.
53# . Their format cannot withstand changing the contents of copyright strings.
54
55updatable_files=$(find $bzr_files \
56 ! -name COPYING \
57 ! -name doclicense.texi \
58 ! -name gpl.texi \
59 ! -name '*-gzipped' \
60 ! -name '*.ico' \
61 ! -name '*.icns' \
62 ! -name '*.pbm' \
63 ! -name '*.pdf' \
64 ! -name '*.png' \
65 ! -name '*.sig' \
66 ! -name '*.tar' \
67 ! -name '*.tiff' \
68 ! -name '*.xpm' \
69 ! -name eterm-color \
70 ! -name hand.cur \
71 ! -name key.pub \
72 ! -name key.sec \
73 -print) &&
74
75build-aux/update-copyright $updatable_files
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
new file mode 100755
index 00000000000..c72d0e67da7
--- /dev/null
+++ b/build-aux/update-copyright
@@ -0,0 +1,274 @@
1eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
2 & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
3 if 0;
4# Update an FSF copyright year list to include the current year.
5
6my $VERSION = '2013-01-03.09:41'; # UTC
7
8# Copyright (C) 2009-2013 Free Software Foundation, Inc.
9#
10# This program 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, or (at your option)
13# any later version.
14#
15# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
22
23# Written by Jim Meyering and Joel E. Denny
24
25# The arguments to this script should be names of files that contain
26# copyright statements to be updated. The copyright holder's name
27# defaults to "Free Software Foundation, Inc." but may be changed to
28# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment
29# variable.
30#
31# For example, you might wish to use the update-copyright target rule
32# in maint.mk from gnulib's maintainer-makefile module.
33#
34# Iff a copyright statement is recognized in a file and the final
35# year is not the current year, then the statement is updated for the
36# new year and it is reformatted to:
37#
38# 1. Fit within 72 columns.
39# 2. Convert 2-digit years to 4-digit years by prepending "19".
40# 3. Expand copyright year intervals. (See "Environment variables"
41# below.)
42#
43# A warning is printed for every file for which no copyright
44# statement is recognized.
45#
46# Each file's copyright statement must be formatted correctly in
47# order to be recognized. For example, each of these is fine:
48#
49# Copyright @copyright{} 1990-2005, 2007-2009 Free Software
50# Foundation, Inc.
51#
52# # Copyright (C) 1990-2005, 2007-2009 Free Software
53# # Foundation, Inc.
54#
55# /*
56# * Copyright &copy; 90,2005,2007-2009
57# * Free Software Foundation, Inc.
58# */
59#
60# However, the following format is not recognized because the line
61# prefix changes after the first line:
62#
63# ## Copyright (C) 1990-2005, 2007-2009 Free Software
64# # Foundation, Inc.
65#
66# However, any correctly formatted copyright statement following
67# a non-matching copyright statements would be recognized.
68#
69# The exact conditions that a file's copyright statement must meet
70# to be recognized are:
71#
72# 1. It is the first copyright statement that meets all of the
73# following conditions. Subsequent copyright statements are
74# ignored.
75# 2. Its format is "Copyright (C)", then a list of copyright years,
76# and then the name of the copyright holder.
77# 3. The "(C)" takes one of the following forms or is omitted
78# entirely:
79#
80# A. (C)
81# B. (c)
82# C. @copyright{}
83# D. &copy;
84#
85# 4. The "Copyright" appears at the beginning of a line, except that it
86# may be prefixed by any sequence (e.g., a comment) of no more than
87# 5 characters -- including white space.
88# 5. Iff such a prefix is present, the same prefix appears at the
89# beginning of each remaining line within the FSF copyright
90# statement. There is one exception in order to support C-style
91# comments: if the first line's prefix contains nothing but
92# whitespace surrounding a "/*", then the prefix for all subsequent
93# lines is the same as the first line's prefix except with each of
94# "/" and possibly "*" replaced by a " ". The replacement of "*"
95# by " " is consistent throughout all subsequent lines.
96# 6. Blank lines, even if preceded by the prefix, do not appear
97# within the FSF copyright statement.
98# 7. Each copyright year is 2 or 4 digits, and years are separated by
99# commas or dashes. Whitespace may appear after commas.
100#
101# Environment variables:
102#
103# 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement
104# is reformatted even if it does not need updating for the new
105# year. If unset or set to 0, only updated FSF copyright
106# statements are reformatted.
107# 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive
108# copyright years (such as 90, 1991, 1992-2007, 2008) in a
109# reformatted FSF copyright statement is collapsed to a single
110# interval (such as 1990-2008). If unset or set to 0, all existing
111# copyright year intervals in a reformatted FSF copyright statement
112# are expanded instead.
113# If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps
114# to the minimal containing range. For example, convert
115# 2000, 2004-2007, 2009 to 2000-2009.
116# 3. For testing purposes, you can set the assumed current year in
117# UPDATE_COPYRIGHT_YEAR.
118# 4. The default maximum line length for a copyright line is 72.
119# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length.
120# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
121# than "Free Software Foundation, Inc.".
122
123use strict;
124use warnings;
125
126my $copyright_re = 'Copyright';
127my $circle_c_re = '(?:\([cC]\)|@copyright{}|&copy;)';
128my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
129$holder ||= 'Free Software Foundation, Inc.';
130my $prefix_max = 5;
131my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH};
132!$margin || $margin !~ m/^\d+$/
133 and $margin = 72;
134
135my $tab_width = 8;
136
137my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
138if (!$this_year || $this_year !~ m/^\d{4}$/)
139 {
140 my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
141 $this_year = $year + 1900;
142 }
143
144# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead.
145my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n";
146
147my $leading;
148my $prefix;
149my $ws_re;
150my $stmt_re;
151while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
152 {
153 $leading = "$1$2";
154 $prefix = $2;
155 if ($prefix =~ /^(\s*\/)\*(\s*)$/)
156 {
157 $prefix =~ s,/, ,;
158 my $prefix_ws = $prefix;
159 $prefix_ws =~ s/\*/ /; # Only whitespace.
160 if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/)
161 {
162 $prefix = $prefix_ws;
163 }
164 }
165 $ws_re = '[ \t\r\f]'; # \s without \n
166 $ws_re =
167 "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)";
168 my $holder_re = $holder;
169 $holder_re =~ s/\s/$ws_re/g;
170 my $stmt_remainder_re =
171 "(?:$ws_re$circle_c_re)?"
172 . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
173 . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
174 if (/\G$stmt_remainder_re/)
175 {
176 $stmt_re =
177 quotemeta($leading) . "($copyright_re$stmt_remainder_re)";
178 last;
179 }
180 }
181if (defined $stmt_re)
182 {
183 /$stmt_re/ or die; # Should never die.
184 my $stmt = $1;
185 my $final_year_orig = $2;
186
187 # Handle two-digit year numbers like "98" and "99".
188 my $final_year = $final_year_orig;
189 $final_year <= 99
190 and $final_year += 1900;
191
192 if ($final_year != $this_year)
193 {
194 # Update the year.
195 $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/;
196 }
197 if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
198 {
199 # Normalize all whitespace including newline-prefix sequences.
200 $stmt =~ s/$ws_re/ /g;
201
202 # Put spaces after commas.
203 $stmt =~ s/, ?/, /g;
204
205 # Convert 2-digit to 4-digit years.
206 $stmt =~ s/(\b\d\d\b)/19$1/g;
207
208 # Make the use of intervals consistent.
209 if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
210 {
211 $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
212 }
213 else
214 {
215 $stmt =~
216 s/
217 (\d{4})
218 (?:
219 (,\ |-)
220 ((??{
221 if ($2 eq '-') { '\d{4}'; }
222 elsif (!$3) { $1 + 1; }
223 else { $3 + 1; }
224 }))
225 )+
226 /$1-$3/gx;
227
228 # When it's 2, emit a single range encompassing all year numbers.
229 $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
230 and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
231 }
232
233 # Format within margin.
234 my $stmt_wrapped;
235 my $text_margin = $margin - length($prefix);
236 if ($prefix =~ /^(\t+)/)
237 {
238 $text_margin -= length($1) * ($tab_width - 1);
239 }
240 while (length $stmt)
241 {
242 if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//)
243 || ($stmt =~ s/^([\S]+)(?: |$)//))
244 {
245 my $line = $1;
246 $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading;
247 $stmt_wrapped .= $line;
248 }
249 else
250 {
251 # Should be unreachable, but we don't want an infinite
252 # loop if it can be reached.
253 die;
254 }
255 }
256
257 # Replace the old copyright statement.
258 s/$stmt_re/$stmt_wrapped/;
259 }
260 }
261else
262 {
263 print STDERR "$ARGV: warning: copyright statement not found\n";
264 }
265
266# Local variables:
267# mode: perl
268# indent-tabs-mode: nil
269# eval: (add-hook 'write-file-hooks 'time-stamp)
270# time-stamp-start: "my $VERSION = '"
271# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
272# time-stamp-time-zone: "UTC"
273# time-stamp-end: "'; # UTC"
274# End:
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 00a6c6a29a1..96008f63e93 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,11 @@
12013-12-25 Chong Yidong <cyd@gnu.org>
2
3 * glossary.texi (Glossary): Define MULE in modern terms.
4
52013-12-25 Xue Fuqiao <xfq.free@gmail.com>
6
7 * files.texi (Diff Mode): Add an index.
8
12013-12-24 Xue Fuqiao <xfq.free@gmail.com> 92013-12-24 Xue Fuqiao <xfq.free@gmail.com>
2 10
3 * trouble.texi (Understanding Bug Reporting): Minor update. 11 * trouble.texi (Understanding Bug Reporting): Minor update.
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index c28a30bf823..5564f9a23f3 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1419,6 +1419,7 @@ In a multi-file patch, kill the current file part.
1419 1419
1420@item C-c C-a 1420@item C-c C-a
1421@findex diff-apply-hunk 1421@findex diff-apply-hunk
1422@cindex patches, applying
1422Apply this hunk to its target file (@code{diff-apply-hunk}). With a 1423Apply this hunk to its target file (@code{diff-apply-hunk}). With a
1423prefix argument of @kbd{C-u}, revert this hunk. 1424prefix argument of @kbd{C-u}, revert this hunk.
1424 1425
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index c8b4b40416f..d6c8477b1c6 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -953,9 +953,15 @@ another. The usual way to move text is by killing (q.v.@:) it and then
953yanking (q.v.@:) it. @xref{Killing}. 953yanking (q.v.@:) it. @xref{Killing}.
954 954
955@item MULE 955@item MULE
956MULE refers to the Emacs features for editing multilingual 956@cindex MULE
957non-@acronym{ASCII} text using multibyte characters (q.v.). 957Prior to Emacs 23, @acronym{MULE} was the name of a software package
958@xref{International}. 958which provided a @dfn{MULtilingual Enhancement} to Emacs, by adding
959support for multiple character sets (q.v.). @acronym{MULE} was later
960integrated into Emacs, and much of it was replaced when Emacs gained
961internal Unicode support in version 23.
962
963Some parts of Emacs that deal with character set support still use the
964@acronym{MULE} name. @xref{International}.
959 965
960@item Multibyte Character 966@item Multibyte Character
961A multibyte character is a character that takes up several bytes in a 967A multibyte character is a character that takes up several bytes in a
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 6efbc2b7190..e0653c96f8b 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -5,7 +5,6 @@
5@chapter International Character Set Support 5@chapter International Character Set Support
6@c This node is referenced in the tutorial. When renaming or deleting 6@c This node is referenced in the tutorial. When renaming or deleting
7@c it, the tutorial needs to be adjusted. (TUTORIAL.de) 7@c it, the tutorial needs to be adjusted. (TUTORIAL.de)
8@cindex MULE
9@cindex international scripts 8@cindex international scripts
10@cindex multibyte characters 9@cindex multibyte characters
11@cindex encoding of characters 10@cindex encoding of characters
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index bee08a59072..354efd5f40c 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,46 @@
12013-12-25 Chong Yidong <cyd@gnu.org>
2
3 * keymaps.texi (Active Keymaps): Re-organize the text.
4 (Searching Keymaps): Rewrite the pseudo-code for 24.4 changes.
5 (Controlling Active Maps): Note that set-transient-map uses
6 overriding-terminal-local-map.
7
8 * tips.texi (Coding Conventions): Tweak the coding system tip;
9 Emacs now uses utf-8 by default for Emacs Lisp source files.
10
11 * display.texi (Font Selection): Tweak example.
12
13 * commands.texi (Event Input Misc): Document new arg to
14 input-pending-p.
15
16 * nonascii.texi (Specifying Coding Systems): Don't refer to
17 emacs-mule-dos.
18 (Lisp and Coding Systems): Describe emacs-mule return value in
19 modern terms.
20
212013-12-25 Tassilo Horn <tsdh@gnu.org>
22
23 * control.texi (Pattern matching case statement): Rephrase lexical
24 binding requirement: the example needs it, not `pcase' itself.
25
262013-12-25 Chong Yidong <cyd@gnu.org>
27
28 * eval.texi (Eval): Document the LEXICAL arg to eval.
29
30 * variables.texi (Variables, Void Variables): Use "scoping rule"
31 terminology consistently.
32 (Variable Scoping): Add index entries, and use "dynamic scope"
33 terminology in place of "indefinite scope" to reduce confusion.
34 (Lexical Binding): Document lexical environment format.
35 (Using Lexical Binding): Add index entries for error messages.
36
372013-12-24 Tassilo Horn <tsdh@gnu.org>
38
39 * control.texi (Pattern matching case statement): Fix missing
40 argument in simple expression language sample (Bug#16238). Add
41 some sample programs written in that language. Mention that
42 `pcase' requires lexical binding.
43
12013-12-23 Xue Fuqiao <xfq.free@gmail.com> 442013-12-23 Xue Fuqiao <xfq.free@gmail.com>
2 45
3 * eval.texi (Special Forms): Document `special-form-p'. 46 * eval.texi (Special Forms): Document `special-form-p'.
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 846d6f3a4a9..a9322640880 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -2739,12 +2739,16 @@ This function converts the string or vector @var{key} to a list of
2739individual events, which you can put in @code{unread-command-events}. 2739individual events, which you can put in @code{unread-command-events}.
2740@end defun 2740@end defun
2741 2741
2742@defun input-pending-p 2742@defun input-pending-p &optional check-timers
2743@cindex waiting for command key input 2743@cindex waiting for command key input
2744This function determines whether any command input is currently 2744This function determines whether any command input is currently
2745available to be read. It returns immediately, with value @code{t} if 2745available to be read. It returns immediately, with value @code{t} if
2746there is available input, @code{nil} otherwise. On rare occasions it 2746there is available input, @code{nil} otherwise. On rare occasions it
2747may return @code{t} when no input is available. 2747may return @code{t} when no input is available.
2748
2749If the optional argument @var{check-timers} is non-@code{nil}, then if
2750no input is available, Emacs runs any timers which are ready.
2751@xref{Timers}.
2748@end defun 2752@end defun
2749 2753
2750@defvar last-input-event 2754@defvar last-input-event
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 34a02aab69d..f5cdd3dc80f 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -328,7 +328,7 @@ expression language could look like:
328(defun evaluate (exp env) 328(defun evaluate (exp env)
329 (pcase exp 329 (pcase exp
330 (`(add ,x ,y) (+ (evaluate x env) (evaluate y env))) 330 (`(add ,x ,y) (+ (evaluate x env) (evaluate y env)))
331 (`(call ,fun ,arg) (funcall (evaluate fun) (evaluate arg env))) 331 (`(call ,fun ,arg) (funcall (evaluate fun env) (evaluate arg env)))
332 (`(fn ,arg ,body) (lambda (val) 332 (`(fn ,arg ,body) (lambda (val)
333 (evaluate body (cons (cons arg val) env)))) 333 (evaluate body (cons (cons arg val) env))))
334 ((pred numberp) exp) 334 ((pred numberp) exp)
@@ -342,6 +342,20 @@ third elements and binds them to the variables @code{x} and @code{y}.
342@code{(pred numberp)} is a pattern that simply checks that @code{exp} 342@code{(pred numberp)} is a pattern that simply checks that @code{exp}
343is a number, and @code{_} is the catch-all pattern that matches anything. 343is a number, and @code{_} is the catch-all pattern that matches anything.
344 344
345Note that the the lambda being the result of the @code{fn} clause is a
346closure (@pxref{Closures}), so the file defining @code{evaluate} must
347have lexical binding enabled (@pxref{Using Lexical Binding}, for how
348to enable it).
349
350Here are some sample programs including their evaluation results:
351
352@example
353(evaluate '(add 1 2) nil) ;=> 3
354(evaluate '(add x y) '((x . 1) (y . 2))) ;=> 3
355(evaluate '(call (fn x (add 1 x)) 2) nil) ;=> 3
356(evaluate '(sub 1 2) nil) ;=> error
357@end example
358
345There are two kinds of patterns involved in @code{pcase}, called 359There are two kinds of patterns involved in @code{pcase}, called
346@emph{U-patterns} and @emph{Q-patterns}. The @var{upattern} mentioned above 360@emph{U-patterns} and @emph{Q-patterns}. The @var{upattern} mentioned above
347are U-patterns and can take the following forms: 361are U-patterns and can take the following forms:
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index ead436ab809..6bb8f64d9eb 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2962,11 +2962,11 @@ scalable font is enabled for use if its name matches any regular
2962expression in the list. For example, 2962expression in the list. For example,
2963 2963
2964@example 2964@example
2965(setq scalable-fonts-allowed '("muleindian-2$")) 2965(setq scalable-fonts-allowed '("iso10646-1$"))
2966@end example 2966@end example
2967 2967
2968@noindent 2968@noindent
2969allows the use of scalable fonts with registry @code{muleindian-2}. 2969allows the use of scalable fonts with registry @code{iso10646-1}.
2970@end defopt 2970@end defopt
2971 2971
2972@defvar face-font-rescale-alist 2972@defvar face-font-rescale-alist
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi
index df30b909cbd..4a63ec2add1 100644
--- a/doc/lispref/eval.texi
+++ b/doc/lispref/eval.texi
@@ -715,12 +715,18 @@ arguments.
715 715
716@defun eval form &optional lexical 716@defun eval form &optional lexical
717This is the basic function for evaluating an expression. It evaluates 717This is the basic function for evaluating an expression. It evaluates
718@var{form} in the current environment and returns the result. How the 718@var{form} in the current environment, and returns the result. The
719evaluation proceeds depends on the type of the object (@pxref{Forms}). 719type of the @var{form} object determines how it is evaluated.
720 720@xref{Forms}.
721The argument @var{lexical}, if non-@code{nil}, means to evaluate 721
722@var{form} using lexical scoping rules for variables, instead of the 722The argument @var{lexical} specifies the scoping rule for local
723default dynamic scoping rules. @xref{Lexical Binding}. 723variables (@pxref{Variable Scoping}). If it is omitted or @code{nil},
724that means to evaluate @var{form} using the default dynamic scoping
725rule. If it is @code{t}, that means to use the lexical scoping rule.
726The value of @var{lexical} can also be a non-empty alist specifying a
727particular @dfn{lexical environment} for lexical bindings; however,
728this feature is only useful for specialized purposes, such as in Emacs
729Lisp debuggers. @xref{Lexical Binding}.
724 730
725Since @code{eval} is a function, the argument expression that appears 731Since @code{eval} is a function, the argument expression that appears
726in a call to @code{eval} is evaluated twice: once as preparation before 732in a call to @code{eval} is evaluated twice: once as preparation before
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 86e205cf14d..c5ffbc964cc 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -622,75 +622,67 @@ string for the keymap. The prompt string should be given for menu keymaps
622@node Active Keymaps 622@node Active Keymaps
623@section Active Keymaps 623@section Active Keymaps
624@cindex active keymap 624@cindex active keymap
625@cindex global keymap
626@cindex local keymap
627 625
628 Emacs normally contains many keymaps; at any given time, just a few 626 Emacs contains many keymaps, but at any time only a few keymaps are
629of them are @dfn{active}, meaning that they participate in the 627@dfn{active}. When Emacs receives user input, it translates the input
630interpretation of user input. All the active keymaps are used 628event (@pxref{Translation Keymaps}), and looks for a key binding in
631together to determine what command to execute when a key is entered. 629the active keymaps.
632 630
633 Normally the active keymaps are the @code{keymap} property keymap, 631 Usually, the active keymaps are: (i) the keymap specified by the
634the keymaps of any enabled minor modes, the current buffer's local 632@code{keymap} property, (ii) the keymaps of enabled minor modes, (iii)
635keymap, and the global keymap, in that order. Emacs searches for each 633the current buffer's local keymap, and (iv) the global keymap, in that
636input key sequence in all these keymaps. @xref{Searching Keymaps}, 634order. Emacs searches for each input key sequence in all these
637for more details of this procedure. 635keymaps.
638 636
639 When the key sequence starts with a mouse event, 637 Of these ``usual'' keymaps, the highest-precedence one is specified
640the active keymaps are determined based on the 638by the @code{keymap} text or overlay property at point, if any. (For
641position in that event. If the event happened on a string embedded 639a mouse input event, Emacs uses the event position instead of point;
642with a @code{display}, @code{before-string}, or @code{after-string} 640@iftex
643property (@pxref{Special Properties}), the non-@code{nil} map 641see the next section for details.)
644properties of the string override those of the buffer (if the 642@end iftex
645underlying buffer text contains map properties in its text properties 643@ifnottex
646or overlays, they are ignored). 644@pxref{Searching Keymaps}.)
647 645@end ifnottex
648 The @dfn{global keymap} holds the bindings of keys that are defined 646
649regardless of the current buffer, such as @kbd{C-f}. The variable 647 Next in precedence are keymaps specified by enabled minor modes.
650@code{global-map} holds this keymap, which is always active. 648These keymaps, if any, are specified by the variables
651 649@code{emulation-mode-map-alists},
652 Each buffer may have another keymap, its @dfn{local keymap}, which 650@code{minor-mode-overriding-map-alist}, and
653may contain new or overriding definitions for keys. The current 651@code{minor-mode-map-alist}. @xref{Controlling Active Maps}.
654buffer's local keymap is always active except when
655@code{overriding-local-map} overrides it. The @code{local-map} text
656or overlay property can specify an alternative local keymap for certain
657parts of the buffer; see @ref{Special Properties}.
658
659 Each minor mode can have a keymap; if it does, the keymap is active
660when the minor mode is enabled. Modes for emulation can specify
661additional active keymaps through the variable
662@code{emulation-mode-map-alists}.
663
664 The highest precedence normal keymap comes from the @code{keymap}
665text or overlay property. If that is non-@code{nil}, it is the first
666keymap to be processed, in normal circumstances.
667
668 However, there are also special ways for programs to substitute
669other keymaps for some of those. The variable
670@code{overriding-local-map}, if non-@code{nil}, specifies a keymap
671that replaces all the usual active keymaps except the global keymap.
672
673The very highest precedence keymap comes from
674@code{overriding-terminal-local-map}; it operates on a per-terminal basis and
675is normally used for modal/transient keybindings.
676 652
677@cindex major mode keymap 653@cindex local keymap
678 Since every buffer that uses the same major mode normally uses the 654 Next in precedence is the buffer's @dfn{local keymap}, containing
679same local keymap, you can think of the keymap as local to the mode. A 655key bindings specific to the buffer. The minibuffer also has a local
680change to the local keymap of a buffer (using @code{local-set-key}, for 656keymap (@pxref{Intro to Minibuffers}). If there is a @code{local-map}
681example) is seen also in the other buffers that share that keymap. 657text or overlay property at point, that specifies the local keymap to
682 658use, in place of the buffer's default local keymap.
683 The local keymaps that are used for Lisp mode and some other major
684modes exist even if they have not yet been used. These local keymaps are
685the values of variables such as @code{lisp-mode-map}. For most major
686modes, which are less frequently used, the local keymap is constructed
687only when the mode is used for the first time in a session.
688 659
689 The minibuffer has local keymaps, too; they contain various completion 660@cindex major mode keymap
690and exit commands. @xref{Intro to Minibuffers}. 661 The local keymap is normally set by the buffer's major mode, and
662every buffer with the same major mode shares the same local keymap.
663Hence, if you call @code{local-set-key} (@pxref{Key Binding Commands})
664to change the local keymap in one buffer, that also affects the local
665keymaps in other buffers with the same major mode.
691 666
692 Emacs has other keymaps that are used in a different way---translating 667@cindex global keymap
693events within @code{read-key-sequence}. @xref{Translation Keymaps}. 668 Finally, the @dfn{global keymap} contains key bindings that are
669defined regardless of the current buffer, such as @kbd{C-f}. It is
670always active, and is bound to the variable @code{global-map}.
671
672 Apart from the above ``usual'' keymaps, Emacs provides special ways
673for programs to make other keymaps active. Firstly, the variable
674@code{overriding-local-map} specifies a keymap that replaces the usual
675active keymaps, except for the global keymap. Secondly, the
676terminal-local variable @code{overriding-terminal-local-map} specifies
677a keymap that takes precedence over @emph{all} other keymaps
678(including @code{overriding-local-map}); this is normally used for
679modal/transient keybindings (the function @code{set-transient-map}
680provides a convenient interface for this). @xref{Controlling Active
681Maps}, for details.
682
683 Making keymaps active is not the only way to use them. Keymaps are
684also used in other ways, such as for translating events within
685@code{read-key-sequence}. @xref{Translation Keymaps}.
694 686
695 @xref{Standard Keymaps}, for a list of some standard keymaps. 687 @xref{Standard Keymaps}, for a list of some standard keymaps.
696 688
@@ -727,7 +719,7 @@ If @var{position} is non-@code{nil}, it should be either a buffer
727position or an event position like the value of @code{event-start}. 719position or an event position like the value of @code{event-start}.
728Then the maps consulted are determined based on @var{position}. 720Then the maps consulted are determined based on @var{position}.
729 721
730An error is signaled if @var{key} is not a string or a vector. 722Emacs signals an error if @var{key} is not a string or a vector.
731 723
732@example 724@example
733@group 725@group
@@ -741,49 +733,52 @@ An error is signaled if @var{key} is not a string or a vector.
741@section Searching the Active Keymaps 733@section Searching the Active Keymaps
742@cindex searching active keymaps for keys 734@cindex searching active keymaps for keys
743 735
744 After translation of event subsequences (@pxref{Translation 736Here is a pseudo-Lisp summary of how Emacs searches the active
745Keymaps}) Emacs looks for them in the active keymaps. Here is a 737keymaps:
746pseudo-Lisp description of the order and conditions for searching
747them:
748 738
749@lisp 739@lisp
750(or (@var{find-in} @var{transient-map}) 740(or (if overriding-terminal-local-map
751 (cond 741 (@var{find-in} overriding-terminal-local-map))
752 (overriding-terminal-local-map 742 (if overriding-local-map
753 (@var{find-in} overriding-terminal-local-map)) 743 (@var{find-in} overriding-local-map)
754 (overriding-local-map 744 (or (@var{find-in} (get-char-property (point) 'keymap))
755 (@var{find-in} overriding-local-map))
756 ((or (@var{find-in} (get-char-property (point) 'keymap))
757 (@var{find-in-any} emulation-mode-map-alists) 745 (@var{find-in-any} emulation-mode-map-alists)
758 (@var{find-in-any} minor-mode-overriding-map-alist) 746 (@var{find-in-any} minor-mode-overriding-map-alist)
759 (@var{find-in-any} minor-mode-map-alist) 747 (@var{find-in-any} minor-mode-map-alist)
760 (if (get-text-property (point) 'local-map) 748 (if (get-text-property (point) 'local-map)
761 (@var{find-in} (get-char-property (point) 'local-map)) 749 (@var{find-in} (get-char-property (point) 'local-map))
762 (@var{find-in} (current-local-map)))))) 750 (@var{find-in} (current-local-map)))))
763 (@var{find-in} (current-global-map))) 751 (@var{find-in} (current-global-map)))
764@end lisp 752@end lisp
765 753
766@noindent 754@noindent
767Here, @var{find-in} and @var{find-in-any} are pseudo functions that 755Here, @var{find-in} and @var{find-in-any} are pseudo functions that
768search in one keymap and in an alist of keymaps, respectively. 756search in one keymap and in an alist of keymaps, respectively. Note
769(Searching a single keymap for a binding is called @dfn{key lookup}; 757that the @code{set-transient-map} function works by setting
770see @ref{Key Lookup}.) @var{transient-map} is a pseudo variable that 758@code{overriding-terminal-local-map} (@pxref{Controlling Active
771represents the effect of a @code{set-transient-map} call 759Maps}).
772(@pxref{Controlling Active Maps}).
773 760
774 In the above pseudo-code, if a key sequence starts with a mouse 761 In the above pseudo-code, if a key sequence starts with a mouse
775event, that event's position is used instead of point and the current 762event (@pxref{Mouse Events}), that event's position is used instead of
776buffer. Mouse events on an embedded string use non-@code{nil} text 763point, and the event's buffer is used instead of the current buffer.
777properties from that string instead of the buffer. 764In particular, this affects how the @code{keymap} and @code{local-map}
778 765properties are looked up. If a mouse event occurs on a string
779 When a match is found (@pxref{Key Lookup}), if the binding in the 766embedded with a @code{display}, @code{before-string}, or
780keymap is a function, the search is over. However if the keymap entry 767@code{after-string} property (@pxref{Special Properties}), and the
781is a symbol with a value or a string, Emacs replaces the input key 768string has a non-@code{nil} @code{keymap} or @code{local-map}
782sequences with the variable's value or the string, and restarts the 769property, that overrides the corresponding property in the underlying
783search of the active keymaps. 770buffer text (i.e., the property specified by the underlying text is
784 771ignored).
785 The function finally found might also be remapped. @xref{Remapping 772
786Commands}. 773 When a key binding is found in one of the active keymaps, and that
774binding is a command, the search is over---the command is executed.
775However, if the binding is a symbol with a value or a string, Emacs
776replaces the input key sequences with the variable's value or the
777string, and restarts the search of the active keymaps. @xref{Key
778Lookup}.
779
780 The command which is finally found might also be remapped.
781@xref{Remapping Commands}.
787 782
788@node Controlling Active Maps 783@node Controlling Active Maps
789@section Controlling the Active Keymaps 784@section Controlling the Active Keymaps
@@ -860,7 +855,6 @@ keymap. @code{use-local-map} returns @code{nil}. Most major mode
860commands use this function. 855commands use this function.
861@end defun 856@end defun
862 857
863@c Emacs 19 feature
864@defvar minor-mode-map-alist 858@defvar minor-mode-map-alist
865@anchor{Definition of minor-mode-map-alist} 859@anchor{Definition of minor-mode-map-alist}
866This variable is an alist describing keymaps that may or may not be 860This variable is an alist describing keymaps that may or may not be
@@ -945,7 +939,7 @@ event is run directly by @code{read-event}. @xref{Special Events}.
945@end defvar 939@end defvar
946 940
947@defvar emulation-mode-map-alists 941@defvar emulation-mode-map-alists
948This variable holds a list of keymap alists to use for emulations 942This variable holds a list of keymap alists to use for emulation
949modes. It is intended for modes or packages using multiple minor-mode 943modes. It is intended for modes or packages using multiple minor-mode
950keymaps. Each element is a keymap alist which has the same format and 944keymaps. Each element is a keymap alist which has the same format and
951meaning as @code{minor-mode-map-alist}, or a symbol with a variable 945meaning as @code{minor-mode-map-alist}, or a symbol with a variable
@@ -970,11 +964,9 @@ function is called with no arguments, prior to running each command,
970while @var{keymap} is active; it should return non-@code{nil} if 964while @var{keymap} is active; it should return non-@code{nil} if
971@var{keymap} should stay active. 965@var{keymap} should stay active.
972 966
973The transient keymap takes precedence over the ``overriding'' maps 967This function works by adding and removing @code{keymap} from the
974(see above); and unlike them, if no match for a key is found in 968variable @code{overriding-terminal-local-map}, which takes precedence
975@var{keymap}, the key lookup process continues. For a pseudo-Lisp 969over all other active keymaps (@pxref{Searching Keymaps}).
976description of exactly how and when this keymap applies,
977@xref{Searching Keymaps}.
978@end defun 970@end defun
979 971
980@node Key Lookup 972@node Key Lookup
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index ddbb5aeaa6b..7b499159d93 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1289,17 +1289,18 @@ Sets}) supported by @var{coding-system}. Some coding systems that
1289support too many character sets to list them all yield special values: 1289support too many character sets to list them all yield special values:
1290@itemize @bullet 1290@itemize @bullet
1291@item 1291@item
1292If @var{coding-system} supports all the ISO-2022 charsets, the value
1293is @code{iso-2022}.
1294@item
1295If @var{coding-system} supports all Emacs characters, the value is 1292If @var{coding-system} supports all Emacs characters, the value is
1296@code{(emacs)}. 1293@code{(emacs)}.
1297@item 1294@item
1298If @var{coding-system} supports all emacs-mule characters, the value
1299is @code{emacs-mule}.
1300@item
1301If @var{coding-system} supports all Unicode characters, the value is 1295If @var{coding-system} supports all Unicode characters, the value is
1302@code{(unicode)}. 1296@code{(unicode)}.
1297@item
1298If @var{coding-system} supports all ISO-2022 charsets, the value is
1299@code{iso-2022}.
1300@item
1301If @var{coding-system} supports all the characters in the internal
1302coding system used by Emacs version 21 (prior to the implementation of
1303internal Unicode support), the value is @code{emacs-mule}.
1303@end itemize 1304@end itemize
1304@end defun 1305@end defun
1305 1306
@@ -1617,8 +1618,7 @@ of the right way to use the variable:
1617 1618
1618@example 1619@example
1619;; @r{Read the file with no character code conversion.} 1620;; @r{Read the file with no character code conversion.}
1620;; @r{Assume @acronym{crlf} represents end-of-line.} 1621(let ((coding-system-for-read 'no-conversion))
1621(let ((coding-system-for-read 'emacs-mule-dos))
1622 (insert-file-contents filename)) 1622 (insert-file-contents filename))
1623@end example 1623@end example
1624 1624
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 26d81f738fc..159938eedf3 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -223,18 +223,13 @@ only for special-purpose buffers.) People will find Emacs more
223coherent if all libraries use the same conventions. 223coherent if all libraries use the same conventions.
224 224
225@item 225@item
226If your program contains non-ASCII characters in string or character 226The default file coding system for Emacs Lisp source files is UTF-8
227constants, you should make sure Emacs always decodes these characters 227(@pxref{Text Representations}). In the rare event that your program
228the same way, regardless of the user's settings. The easiest way to 228contains characters which are @emph{not} in UTF-8, you should specify
229do this is to use the coding system @code{utf-8-emacs} (@pxref{Coding 229an appropriate coding system in the source file's @samp{-*-} line or
230System Basics}), and specify that coding in the @samp{-*-} line or the
231local variables list. @xref{File Variables, , Local Variables in 230local variables list. @xref{File Variables, , Local Variables in
232Files, emacs, The GNU Emacs Manual}. 231Files, emacs, The GNU Emacs Manual}.
233 232
234@example
235;; XXX.el -*- coding: utf-8-emacs; -*-
236@end example
237
238@item 233@item
239Indent the file using the default indentation parameters. 234Indent the file using the default indentation parameters.
240 235
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 941b2d880e4..5d1a47661aa 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -10,10 +10,10 @@
10In Lisp, each variable is represented by a Lisp symbol 10In Lisp, each variable is represented by a Lisp symbol
11(@pxref{Symbols}). The variable name is simply the symbol's name, and 11(@pxref{Symbols}). The variable name is simply the symbol's name, and
12the variable's value is stored in the symbol's value cell@footnote{To 12the variable's value is stored in the symbol's value cell@footnote{To
13be precise, under the default @dfn{dynamic binding} rules the value 13be precise, under the default @dfn{dynamic scoping} rule, the value
14cell always holds the variable's current value, but this is not the 14cell always holds the variable's current value, but this is not the
15case under @dfn{lexical binding} rules. @xref{Variable Scoping}, for 15case under the @dfn{lexical scoping} rule. @xref{Variable Scoping},
16details.}. @xref{Symbol Components}. In Emacs Lisp, the use of a 16for details.}. @xref{Symbol Components}. In Emacs Lisp, the use of a
17symbol as a variable is independent of its use as a function name. 17symbol as a variable is independent of its use as a function name.
18 18
19 As previously noted in this manual, a Lisp program is represented 19 As previously noted in this manual, a Lisp program is represented
@@ -292,20 +292,22 @@ has room to execute.
292@cindex void variable 292@cindex void variable
293 293
294 We say that a variable is void if its symbol has an unassigned value 294 We say that a variable is void if its symbol has an unassigned value
295cell (@pxref{Symbol Components}). Under Emacs Lisp's default dynamic 295cell (@pxref{Symbol Components}).
296binding rules (@pxref{Variable Scoping}), the value cell stores the 296
297variable's current (local or global) value. Note that an unassigned 297 Under Emacs Lisp's default dynamic scoping rule (@pxref{Variable
298value cell is @emph{not} the same as having @code{nil} in the value 298Scoping}), the value cell stores the variable's current (local or
299cell. The symbol @code{nil} is a Lisp object and can be the value of 299global) value. Note that an unassigned value cell is @emph{not} the
300a variable, just as any other object can be; but it is still a value. 300same as having @code{nil} in the value cell. The symbol @code{nil} is
301If a variable is void, trying to evaluate the variable signals a 301a Lisp object and can be the value of a variable, just as any other
302@code{void-variable} error rather than a value. 302object can be; but it is still a value. If a variable is void, trying
303 303to evaluate the variable signals a @code{void-variable} error, instead
304 Under lexical binding rules, the value cell only holds the 304of returning a value.
305variable's global value, i.e., the value outside of any lexical 305
306binding construct. When a variable is lexically bound, the local value 306 Under the optional lexical scoping rule, the value cell only holds
307is determined by the lexical environment; the variable may have a 307the variable's global value---the value outside of any lexical binding
308local value if its symbol's value cell is unassigned. 308construct. When a variable is lexically bound, the local value is
309determined by the lexical environment; hence, variables can have local
310values even if their symbols' value cells are unassigned.
309 311
310@defun makunbound symbol 312@defun makunbound symbol
311This function empties out the value cell of @var{symbol}, making the 313This function empties out the value cell of @var{symbol}, making the
@@ -761,6 +763,7 @@ error is signaled.
761 763
762@node Variable Scoping 764@node Variable Scoping
763@section Scoping Rules for Variable Bindings 765@section Scoping Rules for Variable Bindings
766@cindex scoping rule
764 767
765 When you create a local binding for a variable, that binding takes 768 When you create a local binding for a variable, that binding takes
766effect only within a limited portion of the program (@pxref{Local 769effect only within a limited portion of the program (@pxref{Local
@@ -774,12 +777,12 @@ binding can be accessed. @dfn{Extent} refers to @emph{when}, as the
774program is executing, the binding exists. 777program is executing, the binding exists.
775 778
776@cindex dynamic binding 779@cindex dynamic binding
777@cindex indefinite scope 780@cindex dynamic scope
778@cindex dynamic extent 781@cindex dynamic extent
779 By default, the local bindings that Emacs creates are @dfn{dynamic 782 By default, the local bindings that Emacs creates are @dfn{dynamic
780bindings}. Such a binding has @dfn{indefinite scope}, meaning that 783bindings}. Such a binding has @dfn{dynamic scope}, meaning that any
781any part of the program can potentially access the variable binding. 784part of the program can potentially access the variable binding. It
782It also has @dfn{dynamic extent}, meaning that the binding lasts only 785also has @dfn{dynamic extent}, meaning that the binding lasts only
783while the binding construct (such as the body of a @code{let} form) is 786while the binding construct (such as the body of a @code{let} form) is
784being executed. 787being executed.
785 788
@@ -788,11 +791,12 @@ being executed.
788@cindex indefinite extent 791@cindex indefinite extent
789 Emacs can optionally create @dfn{lexical bindings}. A lexical 792 Emacs can optionally create @dfn{lexical bindings}. A lexical
790binding has @dfn{lexical scope}, meaning that any reference to the 793binding has @dfn{lexical scope}, meaning that any reference to the
791variable must be located textually within the binding construct. It 794variable must be located textually within the binding
792also has @dfn{indefinite extent}, meaning that under some 795construct@footnote{With some exceptions; for instance, a lexical
793circumstances the binding can live on even after the binding construct 796binding can also be accessed from the Lisp debugger.}. It also has
794has finished executing, by means of special objects called 797@dfn{indefinite extent}, meaning that under some circumstances the
795@dfn{closures}. 798binding can live on even after the binding construct has finished
799executing, by means of special objects called @dfn{closures}.
796 800
797 The following subsections describe dynamic binding and lexical 801 The following subsections describe dynamic binding and lexical
798binding in greater detail, and how to enable lexical binding in Emacs 802binding in greater detail, and how to enable lexical binding in Emacs
@@ -814,8 +818,8 @@ at any point in the execution of the Lisp program is simply the most
814recently-created dynamic local binding for that symbol, or the global 818recently-created dynamic local binding for that symbol, or the global
815binding if there is no such local binding. 819binding if there is no such local binding.
816 820
817 Dynamic bindings have indefinite scope and dynamic extent, as shown 821 Dynamic bindings have dynamic scope and extent, as shown by the
818by the following example: 822following example:
819 823
820@example 824@example
821@group 825@group
@@ -841,9 +845,9 @@ The function @code{getx} refers to @code{x}. This is a ``free''
841reference, in the sense that there is no binding for @code{x} within 845reference, in the sense that there is no binding for @code{x} within
842that @code{defun} construct itself. When we call @code{getx} from 846that @code{defun} construct itself. When we call @code{getx} from
843within a @code{let} form in which @code{x} is (dynamically) bound, it 847within a @code{let} form in which @code{x} is (dynamically) bound, it
844retrieves the local value of @code{x} (i.e., 1). But when we call 848retrieves the local value (i.e., 1). But when we call @code{getx}
845@code{getx} outside the @code{let} form, it retrieves the global value 849outside the @code{let} form, it retrieves the global value (i.e.,
846of @code{x} (i.e., -99). 850-99).
847 851
848 Here is another example, which illustrates setting a dynamically 852 Here is another example, which illustrates setting a dynamically
849bound variable using @code{setq}: 853bound variable using @code{setq}:
@@ -888,12 +892,11 @@ technique:
888@itemize @bullet 892@itemize @bullet
889@item 893@item
890If a variable has no global definition, use it as a local variable 894If a variable has no global definition, use it as a local variable
891only within a binding construct, e.g., the body of the @code{let} 895only within a binding construct, such as the body of the @code{let}
892form where the variable was bound, or the body of the function for an 896form where the variable was bound. If this convention is followed
893argument variable. If this convention is followed consistently 897consistently throughout a program, the value of the variable will not
894throughout a program, the value of the variable will not affect, nor 898affect, nor be affected by, any uses of the same variable symbol
895be affected by, any uses of the same variable symbol elsewhere in the 899elsewhere in the program.
896program.
897 900
898@item 901@item
899Otherwise, define the variable with @code{defvar}, @code{defconst}, or 902Otherwise, define the variable with @code{defvar}, @code{defconst}, or
@@ -925,12 +928,16 @@ variables like @code{case-fold-search}:
925@node Lexical Binding 928@node Lexical Binding
926@subsection Lexical Binding 929@subsection Lexical Binding
927 930
928Optionally, you can create lexical bindings in Emacs Lisp. A 931 Lexical binding was introduced to Emacs, as an optional feature, in
929lexically bound variable has @dfn{lexical scope}, meaning that any 932version 24.1. We expect its importance to increase in the future.
930reference to the variable must be located textually within the binding 933Lexical binding opens up many more opportunities for optimization, so
931construct. 934programs using it are likely to run faster in future Emacs versions.
935Lexical binding is also more compatible with concurrency, which we
936want to add to Emacs in the future.
932 937
933 Here is an example 938 A lexically-bound variable has @dfn{lexical scope}, meaning that any
939reference to the variable must be located textually within the binding
940construct. Here is an example
934@iftex 941@iftex
935(see the next subsection, for how to actually enable lexical binding): 942(see the next subsection, for how to actually enable lexical binding):
936@end iftex 943@end iftex
@@ -969,6 +976,14 @@ wants the current value of a variable, it looks first in the lexical
969environment; if the variable is not specified in there, it looks in 976environment; if the variable is not specified in there, it looks in
970the symbol's value cell, where the dynamic value is stored. 977the symbol's value cell, where the dynamic value is stored.
971 978
979 (Internally, the lexical environment is an alist of symbol-value
980pairs, with the final element in the alist being the symbol @code{t}
981rather than a cons cell. Such an alist can be passed as the second
982argument to the @code{eval} function, in order to specify a lexical
983environment in which to evaluate a form. @xref{Eval}. Most Emacs
984Lisp programs, however, should not interact directly with lexical
985environments in this way; only specialized programs like debuggers.)
986
972@cindex closures, example of using 987@cindex closures, example of using
973 Lexical bindings have indefinite extent. Even after a binding 988 Lexical bindings have indefinite extent. Even after a binding
974construct has finished executing, its lexical environment can be 989construct has finished executing, its lexical environment can be
@@ -1019,13 +1034,6 @@ binding of @code{x} in that lexical environment.
1019the body of a @code{defun} or @code{defmacro} cannot refer to 1034the body of a @code{defun} or @code{defmacro} cannot refer to
1020surrounding lexical variables. 1035surrounding lexical variables.
1021 1036
1022 Currently, lexical binding is not much used within the Emacs
1023sources. However, we expect its importance to increase in the future.
1024Lexical binding opens up a lot more opportunities for optimization, so
1025Emacs Lisp code that makes use of lexical binding is likely to run
1026faster in future Emacs versions. Such code is also much more friendly
1027to concurrency, which we want to add to Emacs in the near future.
1028
1029@node Using Lexical Binding 1037@node Using Lexical Binding
1030@subsection Using Lexical Binding 1038@subsection Using Lexical Binding
1031 1039
@@ -1069,12 +1077,15 @@ discouraged. Doing so gives rise to unspecified behavior when lexical
1069binding mode is enabled (it may use lexical binding sometimes, and 1077binding mode is enabled (it may use lexical binding sometimes, and
1070dynamic binding other times). 1078dynamic binding other times).
1071 1079
1072 Converting an Emacs Lisp program to lexical binding is pretty easy. 1080 Converting an Emacs Lisp program to lexical binding is easy. First,
1073First, add a file-local variable setting of @code{lexical-binding} to 1081add a file-local variable setting of @code{lexical-binding} to
1074@code{t} in the Emacs Lisp source file. Second, check that every 1082@code{t} in the header line of the Emacs Lisp source file (@pxref{File
1075variable in the program which needs to be dynamically bound has a 1083Local Variables}). Second, check that every variable in the program
1076variable definition, so that it is not inadvertently bound lexically. 1084which needs to be dynamically bound has a variable definition, so that
1085it is not inadvertently bound lexically.
1077 1086
1087@cindex free variable
1088@cindex unused lexical variable
1078 A simple way to find out which variables need a variable definition 1089 A simple way to find out which variables need a variable definition
1079is to byte-compile the source file. @xref{Byte Compilation}. If a 1090is to byte-compile the source file. @xref{Byte Compilation}. If a
1080non-special variable is used outside of a @code{let} form, the 1091non-special variable is used outside of a @code{let} form, the
diff --git a/etc/NEWS b/etc/NEWS
index 2e6da37590c..de461aa2bf7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -545,7 +545,7 @@ using the next face automatically.
545*** New option `imenu-generic-skip-comments-and-strings'. 545*** New option `imenu-generic-skip-comments-and-strings'.
546 546
547** Info 547** Info
548 548---
549*** New face `info-index-match' is used to highlight matches in index 549*** New face `info-index-match' is used to highlight matches in index
550entries displayed by `Info-index-next', `Info-virtual-index' and 550entries displayed by `Info-index-next', `Info-virtual-index' and
551`info-apropos'. 551`info-apropos'.
@@ -849,19 +849,23 @@ low-level libraries gfilenotify.c, inotify.c or w32notify.c.
849 849
850* Incompatible Lisp Changes in Emacs 24.4 850* Incompatible Lisp Changes in Emacs 24.4
851 851
852---
852** `kill-region' lost its `yank-handler' optional argument. 853** `kill-region' lost its `yank-handler' optional argument.
853 854
855+++
854** `(input-pending-p)' no longer runs other timers which are ready to 856** `(input-pending-p)' no longer runs other timers which are ready to
855run. The new optional CHECK-TIMERS param allows for the prior behavior. 857run. The new optional CHECK-TIMERS param allows for the prior behavior.
856 858
857** `defvar' and `defcustom' in a let-binding affect the "external" default. 859** `defvar' and `defcustom' in a let-binding affect the "external" default.
858 860
861---
859** The syntax of ?» and ?« is now punctuation instead of matched parens. 862** The syntax of ?» and ?« is now punctuation instead of matched parens.
860Some languages match those as »...« and others as «...» so better stay neutral. 863Some languages match those as »...« and others as «...» so better stay neutral.
861 864
862--- 865---
863** In compiled Lisp files, the header no longer includes a timestamp. 866** In compiled Lisp files, the header no longer includes a timestamp.
864 867
868+++
865** The default file coding for Emacs Lisp files is now utf-8. 869** The default file coding for Emacs Lisp files is now utf-8.
866(See `file-coding-system-alist'.) In most cases, this change is 870(See `file-coding-system-alist'.) In most cases, this change is
867transparent, but files that contain unusual characters without 871transparent, but files that contain unusual characters without
@@ -869,6 +873,7 @@ specifying an explicit coding system may fail to load with obscure
869errors. You should either convert them to utf-8 or add an explicit 873errors. You should either convert them to utf-8 or add an explicit
870`coding:' cookie. 874`coding:' cookie.
871 875
876+++
872** `overriding-terminal-local-map' no longer replaces the local keymaps. 877** `overriding-terminal-local-map' no longer replaces the local keymaps.
873It used to disable the minor mode, major mode, and text-property keymaps, 878It used to disable the minor mode, major mode, and text-property keymaps,
874whereas now it simply has higher precedence. 879whereas now it simply has higher precedence.
@@ -881,9 +886,11 @@ Just as was the case in Emacs-22 and before, decoding of tty input according to
881keyboard-coding-system is not performed in read-event any more. But contrary 886keyboard-coding-system is not performed in read-event any more. But contrary
882to that past, it is still done before input-decode-map/function-key-map/... 887to that past, it is still done before input-decode-map/function-key-map/...
883 888
884** Removed inhibit-local-menu-bar-menus. 889---
890** Removed `inhibit-local-menu-bar-menus'.
885 891
886** frame-local variables that affect redisplay do not work any more. 892---
893** Frame-local variables that affect redisplay do not work any more.
887More specifically, the redisplay does not bother to check for a frame-local 894More specifically, the redisplay does not bother to check for a frame-local
888value when looking up variables. 895value when looking up variables.
889 896
@@ -916,6 +923,7 @@ something (not just adding elements to it).
916 923
917* Lisp Changes in Emacs 24.4 924* Lisp Changes in Emacs 24.4
918 925
926+++
919** The second argument of `eval' can now specify a lexical environment. 927** The second argument of `eval' can now specify a lexical environment.
920 928
921+++ 929+++
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 16a4ed8700a..9748ce115dc 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -21,7 +21,7 @@
21# the same distribution terms as the rest of that program. 21# the same distribution terms as the rest of that program.
22# 22#
23# Generated by gnulib-tool. 23# Generated by gnulib-tool.
24# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings 24# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv update-copyright utimens warnings
25 25
26 26
27MOSTLYCLEANFILES += core *.stackdump 27MOSTLYCLEANFILES += core *.stackdump
@@ -1802,6 +1802,13 @@ EXTRA_libgnu_a_SOURCES += unsetenv.c
1802 1802
1803## end gnulib module unsetenv 1803## end gnulib module unsetenv
1804 1804
1805## begin gnulib module update-copyright
1806
1807
1808EXTRA_DIST += $(top_srcdir)/build-aux/update-copyright
1809
1810## end gnulib module update-copyright
1811
1805## begin gnulib module utimens 1812## begin gnulib module utimens
1806 1813
1807libgnu_a_SOURCES += utimens.c 1814libgnu_a_SOURCES += utimens.c
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 79244ec160c..45c2154db0e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,57 @@
12013-12-25 Lars Ingebrigtsen <larsi@gnus.org>
2
3 * net/shr.el (shr-visit-file): Remove debugging function.
4
52013-12-25 Fabián Ezequiel Gallina <fgallina@gnu.org>
6
7 * progmodes/python.el:
8 (python-nav--lisp-forward-sexp): New function.
9 (python-nav--lisp-forward-sexp-safe): Use it. Rename from
10 python-nav-lisp-forward-sexp-safe.
11 (python-nav--forward-sexp): New argument SAFE allows switching
12 forward sexp movement behavior for parens.
13 (python-nav-forward-sexp): Throw errors on unterminated parens
14 (Bug#16191).
15 (python-nav-backward-sexp, python-nav-forward-sexp-safe)
16 (python-nav-backward-sexp-safe): New functions.
17 (python-shell-buffer-substring): Use
18 `python-nav-forward-sexp-safe'.
19
202013-12-25 Lars Ingebrigtsen <larsi@gnus.org>
21
22 * net/shr.el (shr-find-fill-point): Don't break lines before a
23 quotation mark.
24 (shr-char-kinsoku-bol-p): The quotation mark isn't a kinsoky BOL char.
25 (shr-find-fill-point): Remove the special checks for the quotation
26 mark, since `shr-char-kinsoku-bol-p' should now return the right
27 thing.
28
292013-12-25 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
30
31 * net/eww.el (eww-form-textarea): Use a different face for
32 textareas than text input since they have different keymaps
33 (bug#16142).
34
352013-12-24 Fabián Ezequiel Gallina <fgallina@gnu.org>
36
37 * progmodes/python.el (python-nav-beginning-of-statement): Speed
38 up (Bug#15295).
39
402013-12-24 Lars Ingebrigtsen <larsi@gnus.org>
41
42 * net/eww.el (eww-bookmark-browse): Use `quit-window' to restore
43 the window configuration.
44
452013-12-24 Eli Zaretskii <eliz@gnu.org>
46
47 * net/eww.el (eww-open-file): Ensure 3 slashes after "file:" when
48 we run on MS-Windows or MS-DOS.
49
502013-12-24 Martin Rudalics <rudalics@gmx.at>
51
52 * window.el (balance-windows-area): Call window-size instead of
53 window-height and window-width. Bug#16241.
54
12013-12-24 Lars Ingebrigtsen <larsi@gnus.org> 552013-12-24 Lars Ingebrigtsen <larsi@gnus.org>
2 56
3 * net/eww.el (eww-bookmark-quit): Remove. 57 * net/eww.el (eww-bookmark-quit): Remove.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index b7f50c19321..25309d16951 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -115,6 +115,14 @@ See also `eww-form-checkbox-selected-symbol'."
115 :version "24.4" 115 :version "24.4"
116 :group 'eww) 116 :group 'eww)
117 117
118(defface eww-form-textarea
119 '((t (:background "#C0C0C0"
120 :foreground "black"
121 :box (:line-width 1))))
122 "Face for eww textarea inputs."
123 :version "24.4"
124 :group 'eww)
125
118(defvar eww-current-url nil) 126(defvar eww-current-url nil)
119(defvar eww-current-dom nil) 127(defvar eww-current-dom nil)
120(defvar eww-current-source nil) 128(defvar eww-current-source nil)
@@ -167,7 +175,10 @@ word(s) will be searched for via `eww-search-prefix'."
167(defun eww-open-file (file) 175(defun eww-open-file (file)
168 "Render a file using EWW." 176 "Render a file using EWW."
169 (interactive "fFile: ") 177 (interactive "fFile: ")
170 (eww (concat "file://" (expand-file-name file)))) 178 (eww (concat "file://"
179 (and (memq system-type '(windows-nt ms-dos))
180 "/")
181 (expand-file-name file))))
171 182
172(defun eww-render (status url &optional point) 183(defun eww-render (status url &optional point)
173 (let ((redirect (plist-get status :redirect))) 184 (let ((redirect (plist-get status :redirect)))
@@ -773,7 +784,7 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
773 (when (> pad 0) 784 (when (> pad 0)
774 (insert (make-string pad ? )))) 785 (insert (make-string pad ? ))))
775 (add-face-text-property (line-beginning-position) 786 (add-face-text-property (line-beginning-position)
776 (point) 'eww-form-text) 787 (point) 'eww-form-textarea)
777 (put-text-property (line-beginning-position) (point) 788 (put-text-property (line-beginning-position) (point)
778 'local-map eww-textarea-map) 789 'local-map eww-textarea-map)
779 (forward-line 1)) 790 (forward-line 1))
@@ -1083,8 +1094,6 @@ Differences in #targets are ignored."
1083;;; Bookmarks code 1094;;; Bookmarks code
1084 1095
1085(defvar eww-bookmarks nil) 1096(defvar eww-bookmarks nil)
1086(defvar eww-previous-window-configuration nil)
1087(make-variable-buffer-local 'eww-previous-window-configuration)
1088 1097
1089(defun eww-add-bookmark () 1098(defun eww-add-bookmark ()
1090 "Add the current page to the bookmarks." 1099 "Add the current page to the bookmarks."
@@ -1129,7 +1138,6 @@ Differences in #targets are ignored."
1129 (unless eww-bookmarks 1138 (unless eww-bookmarks
1130 (user-error "No bookmarks are defined")) 1139 (user-error "No bookmarks are defined"))
1131 (set-buffer (get-buffer-create "*eww bookmarks*")) 1140 (set-buffer (get-buffer-create "*eww bookmarks*"))
1132 (setq eww-previous-window-configuration (current-window-configuration))
1133 (eww-bookmark-mode) 1141 (eww-bookmark-mode)
1134 (let ((format "%-40s %s") 1142 (let ((format "%-40s %s")
1135 (inhibit-read-only t) 1143 (inhibit-read-only t)
@@ -1188,8 +1196,6 @@ Differences in #targets are ignored."
1188 (unless bookmark 1196 (unless bookmark
1189 (user-error "No bookmark on the current line")) 1197 (user-error "No bookmark on the current line"))
1190 (quit-window) 1198 (quit-window)
1191 (when eww-previous-window-configuration
1192 (set-window-configuration eww-previous-window-configuration))
1193 (eww-browse-url (plist-get bookmark :url)))) 1199 (eww-browse-url (plist-get bookmark :url))))
1194 1200
1195(defun eww-next-bookmark () 1201(defun eww-next-bookmark ()
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 5c30bd8ac67..5b8ab28c837 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -179,13 +179,6 @@ cid: URL as the argument.")
179 (goto-char begin) 179 (goto-char begin)
180 (shr-insert-document dom)))) 180 (shr-insert-document dom))))
181 181
182(defun shr-visit-file (file)
183 "Parse FILE as an HTML document, and render it in a new buffer."
184 (interactive "fHTML file name: ")
185 (with-temp-buffer
186 (insert-file-contents file)
187 (shr-render-buffer (current-buffer))))
188
189;;;###autoload 182;;;###autoload
190(defun shr-insert-document (dom) 183(defun shr-insert-document (dom)
191 "Render the parsed document DOM into the current buffer. 184 "Render the parsed document DOM into the current buffer.
@@ -414,7 +407,9 @@ size, and full-buffer size."
414;; of a line or the end of a line. 407;; of a line or the end of a line.
415(defmacro shr-char-kinsoku-bol-p (char) 408(defmacro shr-char-kinsoku-bol-p (char)
416 "Return non-nil if a line ought not to begin with CHAR." 409 "Return non-nil if a line ought not to begin with CHAR."
417 `(aref (char-category-set ,char) ?>)) 410 `(let ((char ,char))
411 (and (not (eq char ?'))
412 (aref (char-category-set char) ?>))))
418(defmacro shr-char-kinsoku-eol-p (char) 413(defmacro shr-char-kinsoku-eol-p (char)
419 "Return non-nil if a line ought not to end with CHAR." 414 "Return non-nil if a line ought not to end with CHAR."
420 `(aref (char-category-set ,char) ?<)) 415 `(aref (char-category-set ,char) ?<))
@@ -489,30 +484,19 @@ size, and full-buffer size."
489 (eq (following-char) ? ) 484 (eq (following-char) ? )
490 (shr-char-breakable-p (preceding-char)) 485 (shr-char-breakable-p (preceding-char))
491 (shr-char-breakable-p (following-char)) 486 (shr-char-breakable-p (following-char))
492 (if (eq (preceding-char) ?') 487 (and (shr-char-kinsoku-bol-p (preceding-char))
493 (not (memq (char-after (- (point) 2)) 488 (shr-char-breakable-p (following-char))
494 (list nil ?\n ? ))) 489 (not (shr-char-kinsoku-bol-p (following-char))))
495 (and (shr-char-kinsoku-bol-p (preceding-char))
496 (shr-char-breakable-p (following-char))
497 (not (shr-char-kinsoku-bol-p (following-char)))))
498 (shr-char-kinsoku-eol-p (following-char)))) 490 (shr-char-kinsoku-eol-p (following-char))))
499 (backward-char 1)) 491 (backward-char 1))
500 (if (and (not (or failed (eolp)))
501 (eq (preceding-char) ?'))
502 (while (not (or (setq failed (eolp))
503 (eq (following-char) ? )
504 (shr-char-breakable-p (following-char))
505 (shr-char-kinsoku-eol-p (following-char))))
506 (forward-char 1)))
507 (if failed 492 (if failed
508 ;; There's no breakable point, so we give it up. 493 ;; There's no breakable point, so we give it up.
509 (let (found) 494 (let (found)
510 (goto-char bp) 495 (goto-char bp)
511 (unless shr-kinsoku-shorten 496 (unless shr-kinsoku-shorten
512 (while (and (setq found (re-search-forward 497 (while (setq found (re-search-forward
513 "\\(\\c>\\)\\| \\|\\c<\\|\\c|" 498 "\\(\\c>\\)\\| \\|\\c<\\|\\c|"
514 (line-end-position) 'move)) 499 (line-end-position) 'move)))
515 (eq (preceding-char) ?')))
516 (if (and found (not (match-beginning 1))) 500 (if (and found (not (match-beginning 1)))
517 (goto-char (match-beginning 0))))) 501 (goto-char (match-beginning 0)))))
518 (or 502 (or
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index aeee179c7e7..0646eade780 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1279,15 +1279,21 @@ nested definitions."
1279(defun python-nav-beginning-of-statement () 1279(defun python-nav-beginning-of-statement ()
1280 "Move to start of current statement." 1280 "Move to start of current statement."
1281 (interactive "^") 1281 (interactive "^")
1282 (while (and (or (back-to-indentation) t) 1282 (back-to-indentation)
1283 (not (bobp)) 1283 (let* ((ppss (syntax-ppss))
1284 (when (or 1284 (context-point
1285 (save-excursion 1285 (or
1286 (forward-line -1) 1286 (python-syntax-context 'paren ppss)
1287 (python-info-line-ends-backslash-p)) 1287 (python-syntax-context 'string ppss))))
1288 (python-syntax-context 'string) 1288 (cond ((bobp))
1289 (python-syntax-context 'paren)) 1289 (context-point
1290 (forward-line -1)))) 1290 (goto-char context-point)
1291 (python-nav-beginning-of-statement))
1292 ((save-excursion
1293 (forward-line -1)
1294 (python-info-line-ends-backslash-p))
1295 (forward-line -1)
1296 (python-nav-beginning-of-statement))))
1291 (point-marker)) 1297 (point-marker))
1292 1298
1293(defun python-nav-end-of-statement (&optional noend) 1299(defun python-nav-end-of-statement (&optional noend)
@@ -1418,25 +1424,36 @@ backward to previous block."
1418 (and (goto-char starting-pos) nil) 1424 (and (goto-char starting-pos) nil)
1419 (and (not (= (point) starting-pos)) (point-marker))))) 1425 (and (not (= (point) starting-pos)) (point-marker)))))
1420 1426
1421(defun python-nav-lisp-forward-sexp-safe (&optional arg) 1427(defun python-nav--lisp-forward-sexp (&optional arg)
1422 "Safe version of standard `forward-sexp'. 1428 "Standard version `forward-sexp'.
1423When ARG > 0 move forward, else if ARG is < 0." 1429It ignores completely the value of `forward-sexp-function' by
1424 (or arg (setq arg 1)) 1430setting it to nil before calling `forward-sexp'. With positive
1431ARG move forward only one sexp, else move backwards."
1425 (let ((forward-sexp-function) 1432 (let ((forward-sexp-function)
1426 (paren-regexp 1433 (arg (if (or (not arg) (> arg 0)) 1 -1)))
1427 (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) 1434 (forward-sexp arg)))
1428 (search-fn 1435
1429 (if (> arg 0) #'re-search-forward #'re-search-backward))) 1436(defun python-nav--lisp-forward-sexp-safe (&optional arg)
1437 "Safe version of standard `forward-sexp'.
1438When at end of sexp (i.e. looking at a opening/closing paren)
1439skips it instead of throwing an error. With positive ARG move
1440forward only one sexp, else move backwards."
1441 (let* ((arg (if (or (not arg) (> arg 0)) 1 -1))
1442 (paren-regexp
1443 (if (> arg 0) (python-rx close-paren) (python-rx open-paren)))
1444 (search-fn
1445 (if (> arg 0) #'re-search-forward #'re-search-backward)))
1430 (condition-case nil 1446 (condition-case nil
1431 (forward-sexp arg) 1447 (python-nav--lisp-forward-sexp arg)
1432 (error 1448 (error
1433 (while (and (funcall search-fn paren-regexp nil t) 1449 (while (and (funcall search-fn paren-regexp nil t)
1434 (python-syntax-context 'paren))))))) 1450 (python-syntax-context 'paren)))))))
1435 1451
1436(defun python-nav--forward-sexp (&optional dir) 1452(defun python-nav--forward-sexp (&optional dir safe)
1437 "Move to forward sexp. 1453 "Move to forward sexp.
1438With positive Optional argument DIR direction move forward, else 1454With positive optional argument DIR direction move forward, else
1439backwards." 1455backwards. When optional argument SAFE is non-nil do not throw
1456errors when at end of sexp, skip it instead."
1440 (setq dir (or dir 1)) 1457 (setq dir (or dir 1))
1441 (unless (= dir 0) 1458 (unless (= dir 0)
1442 (let* ((forward-p (if (> dir 0) 1459 (let* ((forward-p (if (> dir 0)
@@ -1454,7 +1471,9 @@ backwards."
1454 (eq (syntax-class (syntax-after (1- (point)))) 1471 (eq (syntax-class (syntax-after (1- (point))))
1455 (car (string-to-syntax ")"))))) 1472 (car (string-to-syntax ")")))))
1456 ;; Inside a paren or looking at it, lisp knows what to do. 1473 ;; Inside a paren or looking at it, lisp knows what to do.
1457 (python-nav-lisp-forward-sexp-safe dir)) 1474 (if safe
1475 (python-nav--lisp-forward-sexp-safe dir)
1476 (python-nav--lisp-forward-sexp dir)))
1458 (t 1477 (t
1459 ;; This part handles the lispy feel of 1478 ;; This part handles the lispy feel of
1460 ;; `python-nav-forward-sexp'. Knowing everything about the 1479 ;; `python-nav-forward-sexp'. Knowing everything about the
@@ -1468,7 +1487,9 @@ backwards."
1468 ((python-info-end-of-statement-p) 'statement-end))) 1487 ((python-info-end-of-statement-p) 'statement-end)))
1469 (next-sexp-pos 1488 (next-sexp-pos
1470 (save-excursion 1489 (save-excursion
1471 (python-nav-lisp-forward-sexp-safe dir) 1490 (if safe
1491 (python-nav--lisp-forward-sexp-safe dir)
1492 (python-nav--lisp-forward-sexp dir))
1472 (point))) 1493 (point)))
1473 (next-sexp-context 1494 (next-sexp-context
1474 (save-excursion 1495 (save-excursion
@@ -1522,23 +1543,48 @@ backwards."
1522 (python-nav-beginning-of-statement)) 1543 (python-nav-beginning-of-statement))
1523 (t (goto-char next-sexp-pos)))))))))) 1544 (t (goto-char next-sexp-pos))))))))))
1524 1545
1525(defun python-nav--backward-sexp ()
1526 "Move to backward sexp."
1527 (python-nav--forward-sexp -1))
1528
1529(defun python-nav-forward-sexp (&optional arg) 1546(defun python-nav-forward-sexp (&optional arg)
1530 "Move forward across one block of code. 1547 "Move forward across expressions.
1531With ARG, do it that many times. Negative arg -N means 1548With ARG, do it that many times. Negative arg -N means move
1532move backward N times." 1549backward N times."
1533 (interactive "^p") 1550 (interactive "^p")
1534 (or arg (setq arg 1)) 1551 (or arg (setq arg 1))
1535 (while (> arg 0) 1552 (while (> arg 0)
1536 (python-nav--forward-sexp) 1553 (python-nav--forward-sexp 1)
1537 (setq arg (1- arg))) 1554 (setq arg (1- arg)))
1538 (while (< arg 0) 1555 (while (< arg 0)
1539 (python-nav--backward-sexp) 1556 (python-nav--forward-sexp -1)
1540 (setq arg (1+ arg)))) 1557 (setq arg (1+ arg))))
1541 1558
1559(defun python-nav-backward-sexp (&optional arg)
1560 "Move backward across expressions.
1561With ARG, do it that many times. Negative arg -N means move
1562backward N times."
1563 (interactive "^p")
1564 (or arg (setq arg 1))
1565 (python-nav-forward-sexp (- arg)))
1566
1567(defun python-nav-forward-sexp-safe (&optional arg)
1568 "Move forward safely across expressions.
1569With ARG, do it that many times. Negative arg -N means move
1570backward N times."
1571 (interactive "^p")
1572 (or arg (setq arg 1))
1573 (while (> arg 0)
1574 (python-nav--forward-sexp 1 t)
1575 (setq arg (1- arg)))
1576 (while (< arg 0)
1577 (python-nav--forward-sexp -1 t)
1578 (setq arg (1+ arg))))
1579
1580(defun python-nav-backward-sexp-safe (&optional arg)
1581 "Move backward safely across expressions.
1582With ARG, do it that many times. Negative arg -N means move
1583backward N times."
1584 (interactive "^p")
1585 (or arg (setq arg 1))
1586 (python-nav-forward-sexp-safe (- arg)))
1587
1542(defun python-nav--up-list (&optional dir) 1588(defun python-nav--up-list (&optional dir)
1543 "Internal implementation of `python-nav-up-list'. 1589 "Internal implementation of `python-nav-up-list'.
1544DIR is always 1 or -1 and comes sanitized from 1590DIR is always 1 or -1 and comes sanitized from
@@ -2206,7 +2252,7 @@ the python shell:
2206 (save-excursion 2252 (save-excursion
2207 (when (python-nav-if-name-main) 2253 (when (python-nav-if-name-main)
2208 (cons (point) 2254 (cons (point)
2209 (progn (python-nav-forward-sexp) 2255 (progn (python-nav-forward-sexp-safe)
2210 (point))))))) 2256 (point)))))))
2211 ;; Oh destructuring bind, how I miss you. 2257 ;; Oh destructuring bind, how I miss you.
2212 (if-name-main-start (car if-name-main-start-end)) 2258 (if-name-main-start (car if-name-main-start-end))
diff --git a/lisp/window.el b/lisp/window.el
index 3b841747205..b58f8b85815 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4681,12 +4681,12 @@ specific buffers."
4681 ;; (assert (eq next (or (cadr (member win wins)) (car wins)))) 4681 ;; (assert (eq next (or (cadr (member win wins)) (car wins))))
4682 (let* ((horiz 4682 (let* ((horiz
4683 (< (car (window-pixel-edges win)) (car (window-pixel-edges next)))) 4683 (< (car (window-pixel-edges win)) (car (window-pixel-edges next))))
4684 (areadiff (/ (- (* (window-height next pixelwise) 4684 (areadiff (/ (- (* (window-size next nil pixelwise)
4685 (window-width next pixelwise) 4685 (window-size next t pixelwise)
4686 (buffer-local-value 'window-area-factor 4686 (buffer-local-value 'window-area-factor
4687 (window-buffer next))) 4687 (window-buffer next)))
4688 (* (window-height win pixelwise) 4688 (* (window-size win nil pixelwise)
4689 (window-width win pixelwise) 4689 (window-size win t pixelwise)
4690 (buffer-local-value 'window-area-factor 4690 (buffer-local-value 'window-area-factor
4691 (window-buffer win)))) 4691 (window-buffer win))))
4692 (max (buffer-local-value 'window-area-factor 4692 (max (buffer-local-value 'window-area-factor
@@ -4694,10 +4694,10 @@ specific buffers."
4694 (buffer-local-value 'window-area-factor 4694 (buffer-local-value 'window-area-factor
4695 (window-buffer next))))) 4695 (window-buffer next)))))
4696 (edgesize (if horiz 4696 (edgesize (if horiz
4697 (+ (window-height win pixelwise) 4697 (+ (window-size win nil pixelwise)
4698 (window-height next pixelwise)) 4698 (window-size next nil pixelwise))
4699 (+ (window-width win pixelwise) 4699 (+ (window-size win t pixelwise)
4700 (window-width next pixelwise)))) 4700 (window-size next t pixelwise))))
4701 (diff (/ areadiff edgesize))) 4701 (diff (/ areadiff edgesize)))
4702 (when (zerop diff) 4702 (when (zerop diff)
4703 ;; Maybe diff is actually closer to 1 than to 0. 4703 ;; Maybe diff is actually closer to 1 than to 0.
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 3a04c84ac90..cdb671c3d14 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -150,6 +150,7 @@ AC_DEFUN([gl_EARLY],
150 # Code from module u64: 150 # Code from module u64:
151 # Code from module unistd: 151 # Code from module unistd:
152 # Code from module unsetenv: 152 # Code from module unsetenv:
153 # Code from module update-copyright:
153 # Code from module utimens: 154 # Code from module utimens:
154 # Code from module verify: 155 # Code from module verify:
155 # Code from module warnings: 156 # Code from module warnings:
@@ -791,6 +792,7 @@ AC_DEFUN([gl_FILE_LIST], [
791 build-aux/snippet/arg-nonnull.h 792 build-aux/snippet/arg-nonnull.h
792 build-aux/snippet/c++defs.h 793 build-aux/snippet/c++defs.h
793 build-aux/snippet/warn-on-use.h 794 build-aux/snippet/warn-on-use.h
795 build-aux/update-copyright
794 lib/acl-errno-valid.c 796 lib/acl-errno-valid.c
795 lib/acl-internal.h 797 lib/acl-internal.h
796 lib/acl.h 798 lib/acl.h
diff --git a/make-dist b/make-dist
index 17f54419606..03e9763089c 100755
--- a/make-dist
+++ b/make-dist
@@ -344,7 +344,8 @@ echo "Making links to \`leim' and its subdirectories"
344echo "Making links to \`build-aux'" 344echo "Making links to \`build-aux'"
345(cd build-aux 345(cd build-aux
346 ln compile config.guess config.sub depcomp msys-to-w32 ../${tempdir}/build-aux 346 ln compile config.guess config.sub depcomp msys-to-w32 ../${tempdir}/build-aux
347 ln install-sh missing move-if-change update-subdirs ../${tempdir}/build-aux 347 ln install-sh missing move-if-change ../${tempdir}/build-aux
348 ln update-copyright update-subdirs ../${tempdir}/build-aux
348 ln dir_top make-info-dir ../${tempdir}/build-aux) 349 ln dir_top make-info-dir ../${tempdir}/build-aux)
349 350
350echo "Making links to \`build-aux/snippet'" 351echo "Making links to \`build-aux/snippet'"
diff --git a/msdos/autogen/Makefile.in b/msdos/autogen/Makefile.in
index 11bcb600f7e..99adcab17ed 100644
--- a/msdos/autogen/Makefile.in
+++ b/msdos/autogen/Makefile.in
@@ -1,9 +1,7 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am. 1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@ 2# @configure_input@
3 3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 4# Copyright (C) 1994-2009, 2013 Free Software Foundation, Inc.
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation 5# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it, 6# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved. 7# with or without modifications, as long as this notice is preserved.
diff --git a/src/ChangeLog b/src/ChangeLog
index 818ff2784be..1e8684c4ddb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12013-12-25 Eli Zaretskii <eliz@gnu.org>
2
3 * w32fns.c (Fw32_shell_execute): Make DOCUMENT absolute only if it
4 is a file name. (Bug#16252)
5
62013-12-25 Chong Yidong <cyd@gnu.org>
7
8 * keyboard.c (Voverriding_terminal_local_map):
9 (Voverriding_local_map): Doc fix.
10
11 * keymap.c (Vemulation_mode_map_alists): Doc fix.
12
132013-12-24 Eli Zaretskii <eliz@gnu.org>
14
15 * w32fns.c (Fw32_shell_execute): Ensure DOCUMENT is an absolute
16 file name when it is submitted to ShellExecute. Simplify code.
17 Don't test DOCUMENT for being a string, as that is enforced by
18 CHECK_STRING. Doc fix.
19
12013-12-23 Eli Zaretskii <eliz@gnu.org> 202013-12-23 Eli Zaretskii <eliz@gnu.org>
2 21
3 * xdisp.c (tool_bar_height): Use WINDOW_PIXEL_WIDTH to set up the 22 * xdisp.c (tool_bar_height): Use WINDOW_PIXEL_WIDTH to set up the
diff --git a/src/intervals.c b/src/intervals.c
index 0e3b684f570..f2a2a16f4ad 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -676,6 +676,7 @@ find_interval (register INTERVAL tree, register ptrdiff_t position)
676 676
677 while (1) 677 while (1)
678 { 678 {
679 eassert (tree);
679 if (relative_position < LEFT_TOTAL_LENGTH (tree)) 680 if (relative_position < LEFT_TOTAL_LENGTH (tree))
680 { 681 {
681 tree = tree->left; 682 tree = tree->left;
diff --git a/src/keyboard.c b/src/keyboard.c
index 915ce9dcf23..8ccbf77871c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11415,18 +11415,19 @@ tool-bar separators natively. Otherwise it is unused (e.g. on GTK). */);
11415 DEFVAR_KBOARD ("overriding-terminal-local-map", 11415 DEFVAR_KBOARD ("overriding-terminal-local-map",
11416 Voverriding_terminal_local_map, 11416 Voverriding_terminal_local_map,
11417 doc: /* Per-terminal keymap that takes precedence over all other keymaps. 11417 doc: /* Per-terminal keymap that takes precedence over all other keymaps.
11418
11419This variable is intended to let commands such as `universal-argument' 11418This variable is intended to let commands such as `universal-argument'
11420set up a different keymap for reading the next command. 11419set up a different keymap for reading the next command.
11421 11420
11422`overriding-terminal-local-map' has a separate binding for each 11421`overriding-terminal-local-map' has a separate binding for each
11423terminal device. 11422terminal device. See Info node `(elisp)Multiple Terminals'. */);
11424See Info node `(elisp)Multiple Terminals'. */);
11425 11423
11426 DEFVAR_LISP ("overriding-local-map", Voverriding_local_map, 11424 DEFVAR_LISP ("overriding-local-map", Voverriding_local_map,
11427 doc: /* Keymap that overrides almost all other local keymaps. 11425 doc: /* Keymap that replaces (overrides) local keymaps.
11428If this variable is non-nil, it is used as a keymap--replacing the 11426If this variable is non-nil, Emacs looks up key bindings in this
11429buffer's local map, the minor mode keymaps, and char property keymaps. */); 11427keymap INSTEAD OF the keymap char property, minor mode maps, and the
11428buffer's local map. Hence, the only active keymaps would be
11429`overriding-terminal-local-map', this keymap, and `global-keymap', in
11430order of precedence. */);
11430 Voverriding_local_map = Qnil; 11431 Voverriding_local_map = Qnil;
11431 11432
11432 DEFVAR_LISP ("overriding-local-map-menu-flag", Voverriding_local_map_menu_flag, 11433 DEFVAR_LISP ("overriding-local-map-menu-flag", Voverriding_local_map_menu_flag,
diff --git a/src/keymap.c b/src/keymap.c
index 562787ee8a5..9ef5a0b294f 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3753,7 +3753,7 @@ it is provided for major modes to bind locally. */);
3753 Vminor_mode_overriding_map_alist = Qnil; 3753 Vminor_mode_overriding_map_alist = Qnil;
3754 3754
3755 DEFVAR_LISP ("emulation-mode-map-alists", Vemulation_mode_map_alists, 3755 DEFVAR_LISP ("emulation-mode-map-alists", Vemulation_mode_map_alists,
3756 doc: /* List of keymap alists to use for emulations modes. 3756 doc: /* List of keymap alists to use for emulation modes.
3757It is intended for modes or packages using multiple minor-mode keymaps. 3757It is intended for modes or packages using multiple minor-mode keymaps.
3758Each element is a keymap alist just like `minor-mode-map-alist', or a 3758Each element is a keymap alist just like `minor-mode-map-alist', or a
3759symbol with a variable binding which is a keymap alist, and it is used 3759symbol with a variable binding which is a keymap alist, and it is used
diff --git a/src/w32fns.c b/src/w32fns.c
index 59526936afe..02850d8954d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -6844,12 +6844,15 @@ operations:
6844 specified DOCUMENT 6844 specified DOCUMENT
6845 \"find\" - initiate search starting from DOCUMENT which must specify 6845 \"find\" - initiate search starting from DOCUMENT which must specify
6846 a directory 6846 a directory
6847 \"runas\" - run DOCUMENT, which must be an excutable file, with
6848 elevated privileges (a.k.a. \"as Administrator\").
6847 nil - invoke the default OPERATION, or \"open\" if default is 6849 nil - invoke the default OPERATION, or \"open\" if default is
6848 not defined or unavailable 6850 not defined or unavailable
6849 6851
6850DOCUMENT is typically the name of a document file or a URL, but can 6852DOCUMENT is typically the name of a document file or a URL, but can
6851also be a program executable to run, or a directory to open in the 6853also be a program executable to run, or a directory to open in the
6852Windows Explorer. 6854Windows Explorer. If it is a file, it must be a local one; this
6855function does not support remote file names.
6853 6856
6854If DOCUMENT is a program executable, the optional third arg PARAMETERS 6857If DOCUMENT is a program executable, the optional third arg PARAMETERS
6855can be a string containing command line parameters that will be passed 6858can be a string containing command line parameters that will be passed
@@ -6873,22 +6876,19 @@ an integer representing a ShowWindow flag:
6873#ifndef CYGWIN 6876#ifndef CYGWIN
6874 int use_unicode = w32_unicode_filenames; 6877 int use_unicode = w32_unicode_filenames;
6875 char *doc_a = NULL, *params_a = NULL, *ops_a = NULL; 6878 char *doc_a = NULL, *params_a = NULL, *ops_a = NULL;
6879 Lisp_Object absdoc;
6876#endif 6880#endif
6877 6881
6878 CHECK_STRING (document); 6882 CHECK_STRING (document);
6879 6883
6880#ifdef CYGWIN 6884#ifdef CYGWIN
6881 current_dir = Fcygwin_convert_file_name_to_windows (current_dir, Qt); 6885 current_dir = Fcygwin_convert_file_name_to_windows (current_dir, Qt);
6882 if (STRINGP (document)) 6886 document = Fcygwin_convert_file_name_to_windows (document, Qt);
6883 document = Fcygwin_convert_file_name_to_windows (document, Qt);
6884 6887
6885 /* Encode filename, current directory and parameters. */ 6888 /* Encode filename, current directory and parameters. */
6886 current_dir = GUI_ENCODE_FILE (current_dir); 6889 current_dir = GUI_ENCODE_FILE (current_dir);
6887 if (STRINGP (document)) 6890 document = GUI_ENCODE_FILE (document);
6888 { 6891 doc_w = GUI_SDATA (document);
6889 document = GUI_ENCODE_FILE (document);
6890 doc_w = GUI_SDATA (document);
6891 }
6892 if (STRINGP (parameters)) 6892 if (STRINGP (parameters))
6893 { 6893 {
6894 parameters = GUI_ENCODE_SYSTEM (parameters); 6894 parameters = GUI_ENCODE_SYSTEM (parameters);
@@ -6904,20 +6904,26 @@ an integer representing a ShowWindow flag:
6904 (INTEGERP (show_flag) 6904 (INTEGERP (show_flag)
6905 ? XINT (show_flag) : SW_SHOWDEFAULT)); 6905 ? XINT (show_flag) : SW_SHOWDEFAULT));
6906#else /* !CYGWIN */ 6906#else /* !CYGWIN */
6907 current_dir = ENCODE_FILE (current_dir);
6908 /* We have a situation here. If DOCUMENT is a relative file name,
6909 and is not in CURRENT_DIR, ShellExecute below will fail to find
6910 it. So we need to make the file name absolute. But DOCUMENT
6911 does not have to be a file, it can be a URL, for example. So we
6912 make it absolute only if it is an existing file; if it is a file
6913 that does not exist, tough. */
6914 absdoc = Fexpand_file_name (document, Qnil);
6915 if (!NILP (Ffile_exists_p (absdoc)))
6916 document = absdoc;
6917 document = ENCODE_FILE (document);
6907 if (use_unicode) 6918 if (use_unicode)
6908 { 6919 {
6909 wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH]; 6920 wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH];
6910 6921
6911 /* Encode filename, current directory and parameters, and 6922 /* Encode filename, current directory and parameters, and
6912 convert operation to UTF-16. */ 6923 convert operation to UTF-16. */
6913 current_dir = ENCODE_FILE (current_dir);
6914 filename_to_utf16 (SSDATA (current_dir), current_dir_w); 6924 filename_to_utf16 (SSDATA (current_dir), current_dir_w);
6915 if (STRINGP (document)) 6925 filename_to_utf16 (SSDATA (document), document_w);
6916 { 6926 doc_w = document_w;
6917 document = ENCODE_FILE (document);
6918 filename_to_utf16 (SSDATA (document), document_w);
6919 doc_w = document_w;
6920 }
6921 if (STRINGP (parameters)) 6927 if (STRINGP (parameters))
6922 { 6928 {
6923 int len; 6929 int len;
@@ -6954,14 +6960,9 @@ an integer representing a ShowWindow flag:
6954 { 6960 {
6955 char document_a[MAX_PATH], current_dir_a[MAX_PATH]; 6961 char document_a[MAX_PATH], current_dir_a[MAX_PATH];
6956 6962
6957 current_dir = ENCODE_FILE (current_dir);
6958 filename_to_ansi (SSDATA (current_dir), current_dir_a); 6963 filename_to_ansi (SSDATA (current_dir), current_dir_a);
6959 if (STRINGP (document)) 6964 filename_to_ansi (SSDATA (document), document_a);
6960 { 6965 doc_a = document_a;
6961 ENCODE_FILE (document);
6962 filename_to_ansi (SSDATA (document), document_a);
6963 doc_a = document_a;
6964 }
6965 if (STRINGP (parameters)) 6966 if (STRINGP (parameters))
6966 { 6967 {
6967 parameters = ENCODE_SYSTEM (parameters); 6968 parameters = ENCODE_SYSTEM (parameters);
diff --git a/test/ChangeLog b/test/ChangeLog
index cefdd2de9fd..1f4d5164e37 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
12013-12-25 Fabián Ezequiel Gallina <fgallina@gnu.org>
2
3 * automated/python-tests.el
4 (python-nav-lisp-forward-sexp-safe-1): Remove test.
5 (python-nav-forward-sexp-safe-1): New test.
6
12013-12-20 Dmitry Gutov <dgutov@yandex.ru> 72013-12-20 Dmitry Gutov <dgutov@yandex.ru>
2 8
3 * automated/ruby-mode-tests.el: Add tests for 9 * automated/ruby-mode-tests.el: Add tests for
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 5756507fc92..03667a74666 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -1339,28 +1339,6 @@ if request.user.is_authenticated():
1339 (python-tests-look-at 1339 (python-tests-look-at
1340 "if request.user.is_authenticated():" -1))))) 1340 "if request.user.is_authenticated():" -1)))))
1341 1341
1342(ert-deftest python-nav-lisp-forward-sexp-safe-1 ()
1343 (python-tests-with-temp-buffer
1344 "
1345profile = Profile.objects.create(user=request.user)
1346profile.notify()
1347"
1348 (python-tests-look-at "profile =")
1349 (python-nav-lisp-forward-sexp-safe 4)
1350 (should (looking-at "(user=request.user)"))
1351 (python-tests-look-at "user=request.user")
1352 (python-nav-lisp-forward-sexp-safe -1)
1353 (should (looking-at "(user=request.user)"))
1354 (python-nav-lisp-forward-sexp-safe -4)
1355 (should (looking-at "profile ="))
1356 (python-tests-look-at "user=request.user")
1357 (python-nav-lisp-forward-sexp-safe 3)
1358 (should (looking-at ")"))
1359 (python-nav-lisp-forward-sexp-safe 1)
1360 (should (looking-at "$"))
1361 (python-nav-lisp-forward-sexp-safe 1)
1362 (should (looking-at ".notify()"))))
1363
1364(ert-deftest python-nav-forward-sexp-1 () 1342(ert-deftest python-nav-forward-sexp-1 ()
1365 (python-tests-with-temp-buffer 1343 (python-tests-with-temp-buffer
1366 " 1344 "
@@ -1477,6 +1455,29 @@ def another_statement():
1477 (python-nav-forward-sexp -1) 1455 (python-nav-forward-sexp -1)
1478 (should (looking-at "from some_module import some_sub_module")))) 1456 (should (looking-at "from some_module import some_sub_module"))))
1479 1457
1458(ert-deftest python-nav-forward-sexp-safe-1 ()
1459 (python-tests-with-temp-buffer
1460 "
1461profile = Profile.objects.create(user=request.user)
1462profile.notify()
1463"
1464 (python-tests-look-at "profile =")
1465 (python-nav-forward-sexp-safe 1)
1466 (should (looking-at "$"))
1467 (beginning-of-line 1)
1468 (python-tests-look-at "user=request.user")
1469 (python-nav-forward-sexp-safe -1)
1470 (should (looking-at "(user=request.user)"))
1471 (python-nav-forward-sexp-safe -4)
1472 (should (looking-at "profile ="))
1473 (python-tests-look-at "user=request.user")
1474 (python-nav-forward-sexp-safe 3)
1475 (should (looking-at ")"))
1476 (python-nav-forward-sexp-safe 1)
1477 (should (looking-at "$"))
1478 (python-nav-forward-sexp-safe 1)
1479 (should (looking-at "$"))))
1480
1480(ert-deftest python-nav-up-list-1 () 1481(ert-deftest python-nav-up-list-1 ()
1481 (python-tests-with-temp-buffer 1482 (python-tests-with-temp-buffer
1482 " 1483 "