aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--admin/FOR-RELEASE2
-rwxr-xr-xautogen/configure9
-rw-r--r--configure.in9
-rw-r--r--doc/emacs/ChangeLog18
-rw-r--r--doc/emacs/abbrevs.texi2
-rw-r--r--doc/emacs/buffers.texi5
-rw-r--r--doc/emacs/display.texi175
-rw-r--r--doc/emacs/emacs.texi3
-rw-r--r--doc/emacs/frames.texi121
-rw-r--r--doc/emacs/kmacro.texi2
-rw-r--r--doc/emacs/macos.texi2
-rw-r--r--doc/emacs/programs.texi2
-rw-r--r--doc/emacs/rmail.texi11
-rw-r--r--doc/emacs/search.texi4
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/modes.texi54
-rw-r--r--doc/misc/ChangeLog6
-rw-r--r--doc/misc/cc-mode.texi97
-rw-r--r--doc/misc/trampver.texi2
-rw-r--r--etc/NEWS52
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lib-src/emacsclient.c4
-rw-r--r--lisp/ChangeLog166
-rw-r--r--lisp/comint.el6
-rw-r--r--lisp/emacs-lisp/cl-extra.el14
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el26
-rw-r--r--lisp/emacs-lisp/cl.el54
-rw-r--r--lisp/emacs-lisp/derived.el2
-rw-r--r--lisp/emacs-lisp/easy-mmode.el11
-rw-r--r--lisp/facemenu.el2
-rw-r--r--lisp/files.el6
-rw-r--r--lisp/gnus/ChangeLog15
-rw-r--r--lisp/gnus/message.el6
-rw-r--r--lisp/gnus/mml.el4
-rw-r--r--lisp/ido.el8
-rw-r--r--lisp/info.el2
-rw-r--r--lisp/international/mule-conf.el2
-rw-r--r--lisp/isearch.el2
-rw-r--r--lisp/mail/rmail.el1
-rw-r--r--lisp/net/tramp-cache.el3
-rw-r--r--lisp/net/tramp-sh.el17
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/notifications.el3
-rw-r--r--lisp/org/ChangeLog2
-rw-r--r--lisp/progmodes/cc-defs.el19
-rw-r--r--lisp/progmodes/cc-engine.el150
-rw-r--r--lisp/progmodes/cc-fonts.el8
-rw-r--r--lisp/progmodes/cc-langs.el72
-rw-r--r--lisp/progmodes/cc-mode.el3
-rw-r--r--lisp/progmodes/cc-vars.el48
-rw-r--r--lisp/progmodes/gdb-mi.el42
-rw-r--r--lisp/progmodes/octave-inf.el5
-rw-r--r--lisp/progmodes/octave-mod.el12
-rw-r--r--lisp/simple.el3
-rw-r--r--lisp/subr.el47
-rw-r--r--lisp/term/w32-win.el1
-rw-r--r--lisp/textmodes/reftex.el2
-rw-r--r--lisp/vc/log-edit.el14
-rw-r--r--nt/ChangeLog9
-rw-r--r--nt/INSTALL2
-rw-r--r--nt/makefile.w32-in1
-rw-r--r--src/ChangeLog83
-rw-r--r--src/dispextern.h1
-rw-r--r--src/emacs.c1
-rw-r--r--src/gnutls.c325
-rw-r--r--src/gnutls.h5
-rw-r--r--src/image.c2
-rw-r--r--src/intervals.c2
-rw-r--r--src/keyboard.c140
-rw-r--r--src/lisp.h20
-rw-r--r--src/process.c8
-rw-r--r--src/sysdep.c5
-rw-r--r--src/w32.c6
-rw-r--r--src/w32.h1
-rw-r--r--src/w32fns.c15
-rw-r--r--src/w32font.c153
-rw-r--r--src/w32reg.c7
-rw-r--r--src/window.c40
79 files changed, 1483 insertions, 724 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b9a7176b0..2cd3f8eef8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-10-25 Nali Toja <[email protected]> (tiny change)
+
+ * configure.in (HAVE_GNU_MAKE): Respect MAKE env-var. (Bug#9868)
+
+2011-10-24 Paul Eggert <[email protected]>
+
+ * configure.in (LIB_PTHREAD): Prepend -lpthread to LIBS (Bug#9852)
+ if the library is found. Otherwise, later configure-time tests,
+ such as the test for pthread_sigmask, generate the wrong results
+ on some platforms. Problem reported for FreeBSD by Nali Toja.
+
2011-10-20 Paul Eggert <[email protected]>
Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 80a66be3fa..01d488c97e 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -153,7 +153,7 @@ ack.texi
anti.texi
arevert-xtra.texi cyd
basic.texi cyd
-buffers.texi
+buffers.texi cyd
building.texi
calendar.texi
cal-xtra.texi
diff --git a/autogen/configure b/autogen/configure
index fc906db6fe..5e31231ac3 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -9360,7 +9360,7 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU Make" >&5
$as_echo_n "checking whether we are using GNU Make... " >&6; }
HAVE_GNU_MAKE=no
- testval=`make --version 2>/dev/null | grep 'GNU Make'`
+ testval=`${MAKE-make} --version 2>/dev/null | grep 'GNU Make'`
if test "x$testval" != x; then
HAVE_GNU_MAKE=yes
else
@@ -10380,7 +10380,8 @@ fi
if test "$HAVE_PTHREAD" = yes; then
case "${canonical}" in
*-hpux*) ;;
- *) LIB_PTHREAD="-lpthread" ;;
+ *) LIB_PTHREAD="-lpthread"
+ LIBS="$LIB_PTHREAD $LIBS" ;;
esac
$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
@@ -22444,14 +22445,14 @@ echo
if test "$HAVE_NS" = "yes"; then
echo
- echo "You must run \"make install\" in order to test the built application.
+ echo "You must run \"${MAKE-make} install\" in order to test the built application.
The installed application will go to nextstep/Emacs.app and can be
run or moved from there."
if test "$EN_NS_SELF_CONTAINED" = "yes"; then
echo "The application will be fully self-contained."
else
echo "The lisp resources for the application will be installed under ${prefix}.
-You may need to run \"make install\" with sudo. The application will fail
+You may need to run \"${MAKE-make} install\" with sudo. The application will fail
to run if these resources are not installed."
fi
echo
diff --git a/configure.in b/configure.in
index 5b32e10853..ee52bc9e97 100644
--- a/configure.in
+++ b/configure.in
@@ -1374,7 +1374,7 @@ dnl check for GNU Make if we have GCC and autodepend is on.
if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
AC_MSG_CHECKING([whether we are using GNU Make])
HAVE_GNU_MAKE=no
- testval=`make --version 2>/dev/null | grep 'GNU Make'`
+ testval=`${MAKE-make} --version 2>/dev/null | grep 'GNU Make'`
if test "x$testval" != x; then
HAVE_GNU_MAKE=yes
else
@@ -1723,7 +1723,8 @@ fi
if test "$HAVE_PTHREAD" = yes; then
case "${canonical}" in
*-hpux*) ;;
- *) LIB_PTHREAD="-lpthread" ;;
+ *) LIB_PTHREAD="-lpthread"
+ LIBS="$LIB_PTHREAD $LIBS" ;;
esac
AC_DEFINE(HAVE_PTHREAD, 1, [Define to 1 if you have pthread (-lpthread).])
fi
@@ -3739,14 +3740,14 @@ echo
if test "$HAVE_NS" = "yes"; then
echo
- echo "You must run \"make install\" in order to test the built application.
+ echo "You must run \"${MAKE-make} install\" in order to test the built application.
The installed application will go to nextstep/Emacs.app and can be
run or moved from there."
if test "$EN_NS_SELF_CONTAINED" = "yes"; then
echo "The application will be fully self-contained."
else
echo "The lisp resources for the application will be installed under ${prefix}.
-You may need to run \"make install\" with sudo. The application will fail
+You may need to run \"${MAKE-make} install\" with sudo. The application will fail
to run if these resources are not installed."
fi
echo
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 726f565e83..9a501d3837 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,5 +1,23 @@
+2011-10-26 Juanma Barranquero <[email protected]>
+
+ * emacs.texi (Top): Fix typo.
+
+2011-10-25 Glenn Morris <[email protected]>
+
+ * abbrevs.texi (Saving Abbrevs):
+ quietly-read-abbrev-file is not a command. (Bug#9866)
+
+2011-10-24 Chong Yidong <[email protected]>
+
+ * display.texi (Scrolling): Document scroll-up-line and
+ scroll-down-line. Document scroll-command property.
+ (Recentering): New node, split off from Scrolling.
+
2011-10-23 Chong Yidong <[email protected]>
+ * frames.texi (Scroll Bars): GTK uses right scroll bars now.
+ (Tool Bars): Copyedits.
+
* buffers.texi (Misc Buffer): Don't mention vc-toggle-read-only.
2011-10-22 Chong Yidong <[email protected]>
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi
index d0833ea085..2eafadf484 100644
--- a/doc/emacs/abbrevs.texi
+++ b/doc/emacs/abbrevs.texi
@@ -286,8 +286,6 @@ sessions.
Write a file @var{file} describing all defined abbrevs.
@item M-x read-abbrev-file @key{RET} @var{file} @key{RET}
Read the file @var{file} and define abbrevs as specified therein.
-@item M-x quietly-read-abbrev-file @key{RET} @var{file} @key{RET}
-Similar but do not display a message about what is going on.
@item M-x define-abbrevs
Define abbrevs from definitions in current buffer.
@item M-x insert-abbrevs
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index aed5473ac1..302693aece 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -229,9 +229,8 @@ have special commands to operate on the text; also by visiting a file
whose access control says you cannot write it.
@findex toggle-read-only
- If you wish to make changes in a read-only buffer, use the command
-@kbd{C-x C-q} (@code{toggle-read-only}). It makes a read-only buffer
-writable, and makes a writable buffer read-only. This works by
+ The command @kbd{C-x C-q} (@code{toggle-read-only}) makes a read-only
+buffer writable, and makes a writable buffer read-only. This works by
setting the variable @code{buffer-read-only}, which has a local value
in each buffer and makes the buffer read-only if its value is
non-@code{nil}.
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index b72e24bf24..8995b1242b 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -13,6 +13,7 @@ the text is displayed.
@menu
* Scrolling:: Commands to move text up and down in a window.
+* Recentering:: A scroll command that centers the current line.
* Auto Scrolling:: Redisplay scrolls text automatically when needed.
* Horizontal Scrolling:: Moving text left and right in a window.
* Narrowing:: Restricting display and editing to a portion
@@ -48,15 +49,15 @@ portion of the buffer is displayed.
Scrolling ``forward'' or ``up'' advances the portion of the buffer
displayed in the window; equivalently, it moves the buffer text
upwards relative to the window. Scrolling ``backward'' or ``down''
-moves the displayed portion backwards, and moves the text downwards
-relative to the window. In Emacs, scrolling ``up'' or ``down'' refers
-to the direction that the text moves in the window, @emph{not} the
-direction that the window moves relative to the text; this terminology
-was taken up by Emacs before the modern meaning of ``scrolling up''
-and ``scrolling down'' became widely adopted. Hence the strange
-result that @key{PageDown} scrolls ``up'' in the Emacs sense. In this
-manual, we refer to scrolling ``forward'' and ``backward'' where
-possible, in order to minimize confusion.
+displays an earlier portion of the buffer, and moves the text
+downwards relative to the window.
+
+ In Emacs, scrolling ``up'' or ``down'' refers to the direction that
+the text moves in the window, @emph{not} the direction that the window
+moves relative to the text. This terminology was adopted by Emacs
+before the modern meaning of ``scrolling up'' and ``scrolling down''
+became widespread. Hence, the strange result that @key{PageDown}
+scrolls ``up'' in the Emacs sense.
The portion of a buffer displayed in a window always contains point.
If you move point past the bottom or top of the window, scrolling
@@ -64,11 +65,6 @@ occurs automatically to bring it back onscreen (@pxref{Auto
Scrolling}). You can also scroll explicitly with these commands:
@table @kbd
-@item C-l
-Scroll the selected window so that the current line is the center-most
-text line; on subsequent consecutive invocations, make the current
-line the top-most line, the bottom-most line, and so on in cyclic
-order; also, maybe redisplay the screen (@code{recenter-top-bottom}).
@item C-v
@itemx @key{next}
@itemx @key{PageDown}
@@ -77,6 +73,86 @@ Scroll forward by nearly a full window (@code{scroll-up-command}).
@itemx @key{prior}
@itemx @key{PageUp}
Scroll backward (@code{scroll-down-command}).
+@end table
+
+@kindex C-v
+@kindex M-v
+@kindex next
+@kindex prior
+@kindex PageDown
+@kindex PageUp
+@findex scroll-up-command
+@findex scroll-down-command
+ @kbd{C-v} (@code{scroll-up-command}) scrolls forward by nearly the
+whole window height. The effect is to take the two lines at the
+bottom of the window and put them at the top, followed by lines that
+were not previously visible. If point was in the text that scrolled
+off the top, it ends up on the window's new topmost line. The
+@key{next} (or @key{PageDown}) key is equivalent to @kbd{C-v}.
+
+ @kbd{M-v} (@code{scroll-down-command}) scrolls backward in a similar
+way. The @key{prior} (or @key{PageUp}) key is equivalent to
+@kbd{M-v}.
+
+@vindex next-screen-context-lines
+ The number of lines of overlap left by these scroll commands is
+controlled by the variable @code{next-screen-context-lines}, whose
+default value is 2. You can supply the commands with a numeric prefix
+argument, @var{n}, to scroll by @var{n} lines; Emacs attempts to leave
+point unchanged, so that the text and point move up or down together.
+@kbd{C-v} with a negative argument is like @kbd{M-v} and vice versa.
+
+@vindex scroll-error-top-bottom
+ By default, these commands signal an error (by beeping or flashing
+the screen) if no more scrolling is possible, because the window has
+reached the beginning or end of the buffer. If you change the
+variable @code{scroll-error-top-bottom} to @code{t}, the command moves
+point to the farthest possible position. If point is already there,
+the command signals an error.
+
+@vindex scroll-preserve-screen-position
+@cindex @code{scroll-command} property
+ Some users like scroll commands to keep point at the same screen
+position, so that scrolling back to the same screen conveniently
+returns point to its original position. You can enable this behavior
+via the variable @code{scroll-preserve-screen-position}. If the value
+is @code{t}, Emacs adjusts point to keep the cursor at the same screen
+position whenever a scroll command moves it off-window, rather than
+moving it to the topmost or bottommost line. With any other
+non-@code{nil} value, Emacs adjusts point this way even if the scroll
+command leaves point in the window. This variable affects all the
+scroll commands documented in this section, as well as scrolling with
+the mouse wheel (@pxref{Wheeled Mice}); in general, it affects any
+command that has a non-@code{nil} @code{scroll-command} property.
+@xref{Property Lists,,, elisp, The Emacs Lisp Reference Manual}.
+
+@vindex scroll-up
+@vindex scroll-down
+@findex scroll-up-line
+@findex scroll-down-line
+ The commands @kbd{M-x scroll-up} and @kbd{M-x scroll-down} behave
+similarly to @code{scroll-up-command} and @code{scroll-down-command},
+except they do not obey @code{scroll-error-top-bottom}. Prior to
+Emacs 24, these were the default commands for scrolling up and down.
+The commands @kbd{M-x scroll-up-line} and @kbd{M-x scroll-down-line}
+scroll the current window by one line at a time. If you intend to use
+any of these commands, you might want to give them key bindings
+(@pxref{Init Rebinding}).
+
+@node Recentering
+@section Recentering
+
+@table @kbd
+@item C-l
+Scroll the selected window so the current line is the center-most text
+line; on subsequent consecutive invocations, make the current line the
+top line, the bottom line, and so on in cyclic order. Possibly
+redisplay the screen too (@code{recenter-top-bottom}).
+
+@item M-x recenter
+Scroll the selected window so the current line is the center-most text
+line. Possibly redisplay the screen too.
+
@item C-M-l
Scroll heuristically to bring useful information onto the screen
(@code{reposition-window}).
@@ -107,14 +183,13 @@ non-zero value @var{n}, @kbd{C-l} always leaves at least @var{n}
screen lines between point and the top or bottom of the window
(@pxref{Auto Scrolling}).
- You can also supply @kbd{C-l} with a prefix argument. With a plain
-prefix argument, @kbd{C-u C-l}, Emacs simply recenters point. With a
-positive argument @var{n}, it scrolls to place point @var{n} lines
-down from the top of the window. An argument of zero puts point on
-the topmost line. A negative argument @var{-n} puts point @var{n}
-lines from the bottom of the window. When given an argument,
-@kbd{C-l} does not clear the screen or cycle through different screen
-positions.
+ You can also give @kbd{C-l} a prefix argument. A plain prefix
+argument, @kbd{C-u C-l}, simply recenters point. A positive argument
+@var{n} puts point @var{n} lines down from the top of the window. An
+argument of zero puts point on the topmost line. A negative argument
+@var{-n} puts point @var{n} lines from the bottom of the window. When
+given an argument, @kbd{C-l} does not clear the screen or cycle
+through different screen positions.
@vindex recenter-redisplay
If the variable @code{recenter-redisplay} has a non-@code{nil}
@@ -127,62 +202,6 @@ becomes garbled for any reason (@pxref{Screen Garbled}).
The more primitive command @kbd{M-x recenter} behaves like
@code{recenter-top-bottom}, but does not cycle among screen positions.
-@kindex C-v
-@kindex M-v
-@kindex next
-@kindex prior
-@kindex PageDown
-@kindex PageUp
-@findex scroll-up-command
-@findex scroll-down-command
- @kbd{C-v} (@code{scroll-up-command}) scrolls forward by nearly the
-whole window height. The effect is to take the two lines at the
-bottom of the window and put them at the top, followed by lines that
-were not previously visible. If point was in the text that scrolled
-off the top, it ends up on the window's new topmost line.
-
- Similarly, @kbd{M-v} (@code{scroll-down-command}) scrolls backward.
-
- We refer to @kbd{C-v} and @kbd{M-v} as @dfn{full-screen scroll
-commands}. The function key @key{next}, or @key{PageDown}, is
-equivalent to @kbd{C-v}; the function key @key{prior}, or
-@key{PageUp}, is equivalent to @kbd{M-v}.
-
-@vindex next-screen-context-lines
- The variable @code{next-screen-context-lines} controls the number of
-lines of overlap left by the full-screen scroll commands; by default,
-it is 2. You can supply these commands with a numeric prefix argument
-@var{n}. This scrolls the window by @var{n} lines, while attempting
-to leave point unchanged (so that the text and point move up or down
-together). @kbd{C-v} with a negative argument is like @kbd{M-v} and
-vice versa.
-
-@vindex scroll-error-top-bottom
- By default, the full-screen scroll commands signal an error (by
-beeping or flashing the screen) if no more scrolling is possible,
-because the window has reached the beginning or end of the buffer. If
-you change the variable @code{scroll-error-top-bottom} to @code{t},
-Emacs instead moves point to the farthest possible position. If point
-is already there, the command signals an error.
-
-@vindex scroll-preserve-screen-position
- Some users like scroll commands to keep point at the same screen
-position. Then, scrolling back to the same screen also conveniently
-returns point to its original position. You can enable this via the
-variable @code{scroll-preserve-screen-position}. If the value is
-@code{t}, Emacs adjusts point to keep it at the same vertical position
-within the window, rather than the window edge, whenever a scroll
-command moves it off the window. With any other non-@code{nil} value,
-Emacs adjusts point this way even if the scroll command leaves point
-in the window.
-
-@vindex scroll-up
-@vindex scroll-down
- The commands @code{scroll-up} and @code{scroll-down} behave
-similarly to @code{scroll-up-command} and @code{scroll-down-command},
-except they do not obey @code{scroll-error-top-bottom}. Prior to
-Emacs 24, these were the default commands for scrolling up and down.
-
@kindex C-M-l
@findex reposition-window
@kbd{C-M-l} (@code{reposition-window}) scrolls the current window
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index cad0e4db3c..55fdb9ec87 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -295,7 +295,7 @@ Help
* Package Keywords:: Finding Lisp libraries by keywords (topics).
* Language Help:: Help relating to international language support.
* Misc Help:: Other help commands.
-* Help Files:: Commands to display auxilliary help files.
+* Help Files:: Commands to display auxiliary help files.
* Help Echo:: Help on active text and tooltips (`balloon help').
The Mark and the Region
@@ -342,6 +342,7 @@ Registers
Controlling the Display
* Scrolling:: Commands to move text up and down in a window.
+* Recentering:: A scrolling command that centers the current line.
* Auto Scrolling:: Redisplay scrolls text automatically when needed.
* Horizontal Scrolling:: Moving text left and right in a window.
* Narrowing:: Restricting display and editing to a portion
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 4c239d364f..49222451cc 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -956,55 +956,43 @@ Parameters,,, elisp, The Emacs Lisp Reference Manual}.
@cindex Scroll Bar mode
@cindex mode, Scroll Bar
- On graphical displays, Emacs normally makes a @dfn{scroll bar} at
-the left of each Emacs window, running the height of the
-window.@footnote{Placing it at the left is usually more useful with
-overlapping frames with text starting at the left margin.}
-
- When Emacs is compiled with GTK+ support on the X Window System, or
-in operating systems such as Microsoft Windows or Mac OS, you can use
-the scroll bar as you do in other graphical applications. If you
-click @kbd{Mouse-1} on the scroll bar's up and down buttons, that
-scrolls the window by one line at a time. Clicking @kbd{Mouse-1}
-above or below the scroll bar's inner box scrolls the window by nearly
-the entire height of the window, like @kbd{M-v} and @kbd{C-v}
-respectively (@pxref{Moving Point}). Dragging the inner box with
-@kbd{Mouse-1} scrolls the window continuously.
-
- If Emacs is compiled without GTK+ support on the X Window System,
-the scroll bar behaves differently. The scroll bar's inner box is
-drawn to represent the portion of the buffer currently displayed, with
-the entire height of the scroll bar representing the entire length of
-the buffer. @kbd{Mouse-1} anywhere on the scroll bar scrolls forward
-like @kbd{C-v}, and @kbd{Mouse-3} scrolls backward like @kbd{M-v}.
-Clicking @kbd{Mouse-2} in the scroll bar lets you move or drag the
-inner box up and down.
-
- You can also click @kbd{C-Mouse-2} in the scroll bar to split a
-window vertically. The split occurs on the line where you click.
+ On graphical displays, there is a @dfn{scroll bar} on the side of
+each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's up and
+down buttons scrolls the window by one line at a time. Clicking
+@kbd{Mouse-1} above or below the scroll bar's inner box scrolls the
+window by nearly the entire height of the window, like @kbd{M-v} and
+@kbd{C-v} respectively (@pxref{Moving Point}). Dragging the inner box
+scrolls continuously.
+
+ If Emacs is compiled on the X Window System without X toolkit
+support, the scroll bar behaves differently. Clicking @kbd{Mouse-1}
+anywhere on the scroll bar scrolls forward like @kbd{C-v}, while
+@kbd{Mouse-3} scrolls backward like @kbd{M-v}. Clicking @kbd{Mouse-2}
+in the scroll bar lets you drag the inner box up and down.
@findex scroll-bar-mode
-@vindex scroll-bar-mode
- You can toggle the use of the scroll bar with the command @kbd{M-x
-scroll-bar-mode}. With a prefix argument, this command turns use of
-scroll bars on if and only if the argument is positive. This command
-applies to all frames, including frames yet to be created. Customize
-the variable @code{scroll-bar-mode} to control the use of scroll bars
-at startup. You can use it to specify that they are placed at the
-right of windows if you prefer that. You have to set this variable
-through the @samp{Customize} interface (@pxref{Easy Customization}),
-or it will not work properly. You can also use the X resource
-@samp{verticalScrollBars} to control the initial setting of Scroll Bar
-mode. @xref{Resources}.
-
@findex toggle-scroll-bar
- To enable or disable scroll bars for just the selected frame, use the
+ To toggle the use of scroll bars, type @kbd{M-x scroll-bar-mode}.
+This command applies to all frames, including frames yet to be
+created. To toggle scroll bars for just the selected frame, use the
command @kbd{M-x toggle-scroll-bar}.
+@vindex scroll-bar-mode
+ To control the use of scroll bars at startup, customize the variable
+@code{scroll-bar-mode}. Its value should be either @code{right} (put
+scroll bars on the right side of windows), @code{left} (put them on
+the left), or @code{nil} (disable scroll bars). By default, Emacs
+puts scroll bars on the right if it was compiled with GTK+ support on
+the X Window System, and on MS-Windows or Mac OS; Emacs puts scroll
+bars on the left if compiled on the X Window system without GTK+
+support (following the old convention for X applications).
+
@vindex scroll-bar-width
@cindex width of the scroll bar
- You can control the scroll bar width by changing the value of the
-@code{scroll-bar-width} frame parameter.
+ You can also use the X resource @samp{verticalScrollBars} to enable
+or disable the scroll bars (@pxref{Resources}). To control the scroll
+bar width, change the @code{scroll-bar-width} frame parameter
+(@pxref{Frame Parameters,,, elisp, The Emacs Lisp Reference Manual}).
@node Wheeled Mice
@section Scrolling With ``Wheeled'' Mice
@@ -1082,36 +1070,33 @@ menus' visual appearance.
@cindex mode, Tool Bar
@cindex icons, toolbar
- The @dfn{tool bar} is a line (or lines) of icons at the top of the
-Emacs window, just below the menu bar. You can click on these icons
-with the mouse to do various jobs.
-
- The global tool bar contains general commands. Some major modes
-define their own tool bars to replace it. A few ``special'' modes
-that are not designed for ordinary editing remove some items from the
-global tool bar.
+ On graphical displays, Emacs puts a @dfn{tool bar} at the top of
+each frame, just below the menu bar. This is a row of icons which you
+can click on with the mouse to invoke various commands.
- Tool bars work only on a graphical display. The tool bar uses colored
-XPM icons if Emacs was built with XPM support. Otherwise, the tool
-bar uses monochrome icons (PBM or XBM format).
+ The global (default) tool bar contains general commands. Some major
+modes define their own tool bars; whenever a buffer with such a major
+mode is current, the mode's tool bar replaces the global tool bar.
@findex tool-bar-mode
@vindex tool-bar-mode
- You can turn display of tool bars on or off with @kbd{M-x
-tool-bar-mode} or by customizing the option @code{tool-bar-mode}.
+ To toggle the use of tool bars, type @kbd{M-x tool-bar-mode}. This
+command applies to all frames, including frames yet to be created. To
+control the use of tool bars at startup, customize the variable
+@code{tool-bar-mode}.
@vindex tool-bar-style
@cindex Tool Bar style
- When Emacs is compiled with GTK+ support, tool bars can have text and images.
-Customize @code{tool-bar-style} to select style. The default style is
-the same as for the desktop in the Gnome case. If no default is found,
-the tool bar uses just images.
+ When Emacs is compiled with GTK+ support, each tool bar item can
+consist of an image, or a text label, or both. By default, Emacs
+follows the Gnome desktop's tool bar style setting; if none is
+defined, it displays tool bar items as just images. To impose a
+specific tool bar style, customize the variable @code{tool-bar-style}.
@cindex Tool Bar position
- You can also control the placement of the tool bar for the GTK+ tool bar
-with the frame parameter @code{tool-bar-position}.
-For a detailed description of frame parameters and customization,
-see @ref{Frame Parameters,,, elisp, The Emacs Lisp Reference Manual}.
+ You can also control the placement of the tool bar for the GTK+ tool
+bar with the frame parameter @code{tool-bar-position}. @xref{Frame
+Parameters,,, elisp, The Emacs Lisp Reference Manual}.
@node Dialog Boxes
@section Using Dialog Boxes
@@ -1186,11 +1171,11 @@ options for displaying tooltips, use @kbd{M-x customize-group
customizing the windows that display tooltips.
@vindex x-gtk-use-system-tooltips
- If Emacs is built with GTK support, it displays tooltips via GTK,
-using the default appearance of GTK tooltips. To disable this, change
-the variable @code{x-gtk-use-system-tooltips} to @code{nil}. If you
-do this, or if Emacs is built without GTK support, the @code{tooltip}
-face specifies most attributes of the tooltip text.
+ If Emacs is built with GTK+ support, it displays tooltips via GTK+,
+using the default appearance of GTK+ tooltips. To disable this,
+change the variable @code{x-gtk-use-system-tooltips} to @code{nil}.
+If you do this, or if Emacs is built without GTK+ support, the
+@code{tooltip} face specifies most attributes of the tooltip text.
@node Mouse Avoidance
@section Mouse Avoidance
diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi
index ac81377aec..4676983fc6 100644
--- a/doc/emacs/kmacro.texi
+++ b/doc/emacs/kmacro.texi
@@ -147,7 +147,7 @@ beginning of the line and then executing the macro.
@findex kmacro-start-macro
@findex kmacro-end-macro
In addition to the @key{F3} and @key{F4} commands described above,
-Emacs also supports an older set of keybindings for defining and
+Emacs also supports an older set of key bindings for defining and
executing keyboard macros. To begin a macro definition, type @kbd{C-x
(} (@code{kmacro-start-macro}); as with @key{F3}, a prefix argument
appends this definition to the last keyboard macro. To end a macro
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
index f4a5a2858c..5a97fa8460 100644
--- a/doc/emacs/macos.texi
+++ b/doc/emacs/macos.texi
@@ -36,7 +36,7 @@ Support}), but we hope to improve it in the future.
By default, the @key{alt} and @key{option} keys are the same as
@key{Meta}. The Mac @key{Cmd} key is the same as @key{Super}, and
-Emacs provides a set of keybindings using this modifier key that mimic
+Emacs provides a set of key bindings using this modifier key that mimic
other Mac / GNUstep applications (@pxref{Mac / GNUstep Events}). You
can change these bindings in the usual way (@pxref{Key Bindings}).
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 5745dd7c66..2357902341 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1441,7 +1441,7 @@ parsed, and move point there (@code{semantic-complete-jump}).
@kindex C-c , @key{SPC}
Display a list of possible completions for the symbol at point
(@code{semantic-complete-analyze-inline}). This also activates a set
-of special keybindings for choosing a completion: @key{RET} accepts
+of special key bindings for choosing a completion: @key{RET} accepts
the current completion, @kbd{M-n} and @kbd{M-p} cycle through possible
completions, @key{TAB} completes as far as possible and then cycles,
and @kbd{C-g} or any other key aborts completion.
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index 9e30b65728..71c2365560 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -1242,11 +1242,12 @@ coding system, the result should be readable.
@node Rmail Editing
@section Editing Within a Message
- Most of the usual Emacs keybindings are available in Rmail mode, though a
-few, such as @kbd{C-M-n} and @kbd{C-M-h}, are redefined by Rmail for
-other purposes. However, the Rmail buffer is normally read only, and
-most of the letters are redefined as Rmail commands. If you want to
-edit the text of a message, you must use the Rmail command @kbd{e}.
+ Most of the usual Emacs key bindings are available in Rmail mode,
+though a few, such as @kbd{C-M-n} and @kbd{C-M-h}, are redefined by
+Rmail for other purposes. However, the Rmail buffer is normally read
+only, and most of the letters are redefined as Rmail commands. If you
+want to edit the text of a message, you must use the Rmail command
+@kbd{e}.
@table @kbd
@item e
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 31b5aa37f8..a8bd1cdf18 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -268,8 +268,8 @@ use it (@pxref{Rebinding}).
@vindex isearch-mode-map
When incremental search is active, you can type @kbd{C-h C-h} to
-access interactive help options, including a list of special
-keybindings. These keybindings are part of the keymap
+access interactive help options, including a list of special key
+bindings. These key bindings are part of the keymap
@code{isearch-mode-map} (@pxref{Keymaps}).
@node Isearch Yank
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 490280dae2..acc334ea00 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,7 @@
+2011-10-26 Chong Yidong <[email protected]>
+
+ * modes.texi (Running Hooks): Document with-wrapper-hook.
+
2011-10-18 Chong Yidong <[email protected]>
* display.texi (Glyphless Chars): New node.
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index eb81ebc4ac..9d652901e5 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -84,8 +84,9 @@ its value is just a single function, not a list of functions.
@node Running Hooks
@subsection Running Hooks
- At the appropriate times, Emacs uses the @code{run-hooks} function
-and the other functions below to run particular hooks.
+ In this section, we document the @code{run-hooks} function, which is
+used to run a normal hook. We also document the functions for running
+various kinds of abnormal hooks.
@defun run-hooks &rest hookvars
This function takes one or more normal hook variable names as
@@ -108,28 +109,49 @@ be run as well.
@end defun
@defun run-hook-with-args hook &rest args
-This function is the way to run an abnormal hook and always call all
-of the hook functions. It calls each of the hook functions one by
-one, passing each of them the arguments @var{args}.
+This function runs an abnormal hook by calling all the hook functions in
+@var{hook}, passing each one the arguments @var{args}.
@end defun
@defun run-hook-with-args-until-failure hook &rest args
-This function is the way to run an abnormal hook until one of the hook
-functions fails. It calls each of the hook functions, passing each of
-them the arguments @var{args}, until some hook function returns
-@code{nil}. It then stops and returns @code{nil}. If none of the
-hook functions return @code{nil}, it returns a non-@code{nil} value.
+This function runs an abnormal hook by calling each hook function in
+turn, stopping if one of them ``fails'' by returning @code{nil}. Each
+hook function is passed the arguments @var{args}. If this function
+stops because one of the hook functions fails, it returns @code{nil};
+otherwise it returns a non-@code{nil} value.
@end defun
@defun run-hook-with-args-until-success hook &rest args
-This function is the way to run an abnormal hook until a hook function
-succeeds. It calls each of the hook functions, passing each of them
-the arguments @var{args}, until some hook function returns
-non-@code{nil}. Then it stops, and returns whatever was returned by
-the last hook function that was called. If all hook functions return
-@code{nil}, it returns @code{nil} as well.
+This function runs an abnormal hook by calling each hook function,
+stopping if one of them ``succeeds'' by returning a non-@code{nil}
+value. Each hook function is passed the arguments @var{args}. If this
+function stops because one of the hook functions returns a
+non-@code{nil} value, it returns that value; otherwise it returns
+@code{nil}.
@end defun
+@defmac with-wrapper-hook hook args &rest body
+This macro runs the abnormal hook @code{hook} as a series of nested
+``wrapper functions'' around the @var{body} forms. The effect is
+similar to nested @code{around} advices (@pxref{Around-Advice}).
+
+Each hook function must accept an argument list consisting of a function
+@var{fun}, followed by the additional arguments listed in @var{args}.
+The function @var{fun} passed to the very first hook function in
+@var{hook} does the same as @var{body}, if it is called with arguments
+@var{args}. The @var{fun} passed to each successive hook function is
+constructed from all the preceding hook functions (and @var{body}); if
+this @var{fun} is called with arguments @var{args}, it does what the
+@code{with-wrapper-hook} call would if the preceding hook functions were
+the only ones in @var{hook}.
+
+In the function definition of the hook function, @var{fun} can be called
+any number of times (including not calling it at all). This function
+definition is then used to construct the @var{fun} passed to the next
+hook function in @var{hook}, if any. The last or ``outermost''
+@var{fun} is called once to produce the effect.
+@end defmac
+
@node Setting Hooks
@subsection Setting Hooks
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 02c2d2b875..6b0ef9c5d8 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-23 Michael Albinus <[email protected]>
+
+ Sync with Tramp 2.2.3.
+
+ * trampver.texi: Update release number.
+
2011-10-14 Glenn Morris <[email protected]>
* ert.texi (Introduction, How to Run Tests)
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index 8818904982..887e3f3c80 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -341,6 +341,11 @@ Line-Up Functions
* Comment Line-Up::
* Misc Line-Up::
+Customizing Macros
+
+* Macro Backslashes::
+* Macros with ;::
+
@end detailmenu
@end menu
@@ -655,6 +660,10 @@ expression, to some statements, or perhaps to whole functions, the
syntactic recognition can be wrong. @ccmode{} manages to figure it
out correctly most of the time, though.
+Some macros, when invoked, ''have their own semicolon''. To get the
+next line indented correctly, rather than as a continuation line,
+@xref{Macros with ;}.
+
Reindenting large sections of code can take a long time. When
@ccmode{} reindents a region of code, it is essentially equivalent to
hitting @key{TAB} on every line of the region.
@@ -6561,6 +6570,9 @@ custom line-up function associated with it.
@section Other Special Indentations
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+To configure macros which you invoke without a terminating @samp{;},
+see @xref{Macros with ;}.
+
Here are the remaining odds and ends regarding indentation:
@defopt c-label-minimum-indentation
@@ -6612,6 +6624,13 @@ functions to this hook, not remove them. @xref{Style Variables}.
@cindex preprocessor directives
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+Preprocessor macros in C, C++, and Objective C (introduced by
+@code{#define}) have a syntax different from the main language---for
+example, a macro declaration is not terminated by a semicolon, and if
+it is more than a line long, line breaks in it must be escaped with
+backslashes. @ccmode{} has some commands to manipulate these, see
+@ref{Macro Backslashes}.
+
Normally, the lines in a multi-line macro are indented relative to
each other as though they were code. You can suppress this behavior
by setting the following user option:
@@ -6623,6 +6642,28 @@ is @code{nil}, all lines inside macro definitions are analyzed as
@code{cpp-macro-cont}.
@end defopt
+Because a macro can expand into anything at all, near where one is
+invoked @ccmode{} can only indent and fontify code heuristically.
+Sometimes it gets it wrong. Usually you should try to design your
+macros so that they ''look like ordinary code'' when you invoke them.
+However, one situation is so common that @ccmode{} handles it
+specially: that is when certain macros needn't (or mustn't) be
+followed by a @samp{;}. You need to configure @ccmode{} to handle
+these macros properly, see @ref{Macros with ;}.
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@menu
+* Macro Backslashes::
+* Macros with ;::
+@end menu
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node Macro Backslashes, Macros with ;, Custom Macros, Custom Macros
+@comment node-name, next, previous, up
+@section Customizing Macro Backslashes
+@cindex #define
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
@ccmode{} provides some tools to help keep the line continuation
backslashes in macros neat and tidy. Their precise action is
customized with these variables:
@@ -6665,6 +6706,62 @@ get aligned only when you explicitly invoke the command
@end defopt
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@node Macros with ;, , Macro Backslashes, Custom Macros
+@comment node-name, next, previous, up
+@section Macros with semicolons
+@cindex macros with semicolons
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+Macros which needn't (or mustn't) be followed by a semicolon when you
+invoke them, @dfn{macros with semicolons}, are very common. These can
+cause @ccmode{} to parse the next line wrongly as a
+@code{statement-cont} (@pxref{Function Symbols}) and thus mis-indent
+it.
+
+You can prevent this by specifying which macros have semicolons. It
+doesn't matter whether or not such a macro has a parameter list:
+
+@defopt c-macro-names-with-semicolon
+@vindex macro-names-with-semicolon (c-)
+This buffer-local variable specifies which macros have semicolons.
+After setting its value, you need to call
+@code{c-make-macro-with-semi-re} for it to take effect. It should be
+set to one of these values:
+
+@table @asis
+@item nil
+There are no macros with semicolons.
+@item a list of strings
+Each string is the name of a macro with a semicolon. Only valid
+@code{#define} names are allowed here. For example, to set the
+default value, you could write the following into your @file{.emacs}:
+
+@example
+(setq c-macro-names-with-semicolon
+ '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS"))
+@end example
+
+@item a regular expression
+This matches each symbol which is a macro with a semicolon. It must
+not match any string which isn't a valid @code{#define} name. For
+example:
+
+@example
+(setq c-macro-names-with-semicolon
+ "\\<\\(CLEAN_UP_AND_RETURN\\|Q_[[:upper:]]+\\)\\>")
+@end example
+@end table
+@end defopt
+
+@defun c-make-macro-with-semi-re
+@findex make-macro-with-semi-re (c-)
+Call this (non-interactive) function, which sets internal variables,
+each time you change the value of
+@code{c-macro-names-with-semicolon}. It takes no arguments, and its
+return value has no meaning. This function is called by @ccmode{}'s
+initialization code.
+@end defun
+
+@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@node Odds and Ends, Sample .emacs File, Custom Macros, Top
@comment node-name, next, previous, up
@chapter Odds and Ends
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index 31d3ac0204..63dc78dc4e 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -8,7 +8,7 @@
@c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
-@set trampver 2.2.3-pre
+@set trampver 2.2.3-24.1
@c Other flags from configuration
@set instprefix /usr/local
diff --git a/etc/NEWS b/etc/NEWS
index 68e5720330..9e407133e8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -230,14 +230,14 @@ cannot be encoded by the `terminal-coding-system'.
(U+2010 and U+2011).
** Improved GTK integration
-
++++
*** GTK scroll-bars are now placed on the right by default.
Use `set-scroll-bar-mode' to change this.
-
++++
*** GTK tool bars can have just text, just images or images and text.
Customize `tool-bar-style' to choose style. On a Gnome desktop, the default
is taken from the desktop settings.
-
+---
*** GTK tool bars can be placed on the left/right or top/bottom of the frame.
The frame-parameter tool-bar-position controls this. It takes the values
top, left, right or bottom. The Options => Show/Hide menu has entries
@@ -276,10 +276,6 @@ get and set the SELinux context of a file.
*** Tramp offers handlers for file-selinux-context and set-file-selinux-context
for remote machines which support SELinux.
-+++
-** The function format-time-string now supports the %N directive, for
-higher-resolution time stamps.
-
** Changes for exiting Emacs
+++
*** The function kill-emacs is now run upon receipt of the signals
@@ -295,24 +291,20 @@ consider if it is still appropriate to add it in the noninteractive case.
(bound to C-v/[next] and M-v/[prior]) do not signal errors at top/bottom
of buffer at first key-press (instead move to top/bottom of buffer)
when `scroll-error-top-bottom' is non-nil.
-
+++
*** New variable `scroll-error-top-bottom' (see above).
-
++++
*** New scrolling commands `scroll-up-line' and `scroll-down-line'
scroll a line instead of full screen.
-
+++
*** New property `scroll-command' should be set on a command's symbol to
define it as a scroll command affected by `scroll-preserve-screen-position'.
-
+++
*** If you customize `scroll-conservatively' to a value greater than 100,
Emacs will never recenter point in the window when it scrolls due to
cursor motion commands or commands that move point (e.f., `M-g M-g').
Previously, you needed to use `most-positive-fixnum' as the value of
`scroll-conservatively' to achieve the same effect.
-
---
*** ``Aggressive'' scrolling now honors the scroll margins.
If you customize `scroll-up-aggressively' or
@@ -374,7 +366,6 @@ Affected modes include dired, vc-dir, and log-edit. For example,
adding "(diff-mode . ((mode . whitespace)))" to .dir-locals.el will
turn on `whitespace-mode' for *vc-diff* buffers. Modes should call
`hack-dir-local-variables-non-file-buffer' to support this.
-
+++
*** Using "mode: MINOR-MODE" to enable a minor mode is deprecated.
Instead, use "eval: (minor-mode 1)".
@@ -1178,7 +1169,13 @@ must also be supplied.
** pre/post-command-hook are not reset to nil upon error.
Instead, the offending function is removed.
-** New low-level function run-hook-wrapped.
+** New hook types
+
+*** New function `run-hook-wrapped' for running an abnormal hook by
+passing the hook functions as arguments to a "wrapping" function.
++++
+*** New macro `with-wrapper-hook' for running an abnormal hook as a
+set of "wrapping" filters, similar to around advice.
** `server-eval-at' is provided to allow evaluating forms on different
Emacs server instances.
@@ -1192,6 +1189,10 @@ Also the debugger can now "continue" from an error, which means it will jump
to the error handler as if the debugger had not been invoked instead of
jumping all the way to the top-level.
++++
+** The function format-time-string now supports the %N directive, for
+higher-resolution time stamps.
+
** New function `read-char-choice' reads a restricted set of characters,
discarding any inputs not inside the set.
@@ -1217,15 +1218,22 @@ syntactic rules.
** frame-local variables cannot be let-bound any more.
+** Major and minor mode changes
+++
-** prog-mode is a new major-mode meant to be the parent of programming mode.
-The prog-mode-hook it defines can be used to enable features for
-programming modes. For example:
-(add-hook 'prog-mode-hook 'flyspell-prog-mode)
-enables on the fly spell checking for comments and strings for
-programming modes.
+*** `prog-mode' is a new major mode from which programming modes
+should be derived.
+
+**** `prog-mode-hook' can be used to enable features for programming
+modes, e.g. (add-hook 'prog-mode-hook 'flyspell-prog-mode) to enable
+on-the-fly spell checking for comments and strings.
-** define-minor-mode accepts a new keyword :variable.
+*** New hook `change-major-mode-after-body-hook', run by
+`run-mode-hooks' just before any other mode hooks.
+
+*** Enabled globalized minor modes can be disabled in specific modes,
+by running (FOO-mode-hook 0) via a mode hook.
+
+*** `define-minor-mode' accepts a new keyword :variable.
+++
** `delete-file' and `delete-directory' now accept optional arg TRASH.
@@ -1350,6 +1358,8 @@ with the USER_LIBS build variable.
** New make target `dist' to create binary distribution for MS Windows.
+** Function `w32-default-color-map' is now obsolete.
+
** On Nextstep/OSX, the menu bar can be hidden by customizing
ns-auto-hide-menu-bar.
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 984c4d6c88..a8f9a0ac4b 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
+2011-10-27 Juanma Barranquero <[email protected]>
+
+ * emacsclient.c (w32_getenv): Silence compiler warnings.
+
2011-09-07 Glenn Morris <[email protected]>
* etags.c (Fortran_functions): Handle "elemental" functions.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index ece9dc65c4..76aa21884d 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -359,7 +359,7 @@ w32_getenv (char *envvar)
char *value;
DWORD dwType;
- if (value = getenv (envvar))
+ if ((value = getenv (envvar)))
/* Found in the environment. strdup it, because values returned
by getenv cannot be free'd. */
return xstrdup (value);
@@ -382,7 +382,7 @@ w32_getenv (char *envvar)
{
DWORD size;
- if (size = ExpandEnvironmentStrings (value, NULL, 0))
+ if ((size = ExpandEnvironmentStrings (value, NULL, 0)))
{
char *buffer = (char *) xmalloc (size);
if (ExpandEnvironmentStrings (value, buffer, size))
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 09e2e7dc1d..bf4d87d340 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,149 @@
+2011-10-28 Alan Mackenzie <[email protected]>
+
+ Amend to indent and fontify macros "which include their own semicolon"
+ correctly, using the "virtual semicolon" mechanism.
+
+ * cc-defs.el: Update "virtual semicolon" comments.
+
+ * cc-engine.el (c-crosses-statement-barrier-p): Recoded to scan one line at
+ at time rather than having \n and \r explicitly in c-stmt-delim-chars
+ (for some modes, e.g. AWK).
+ (c-forward-label): Amend for virtual semicolons.
+ (c-at-macro-vsemi-p, c-macro-vsemi-status-unknown-p): New functions
+
+ * cc-fonts.el (c-font-lock-declarations): Take account of the new C macros.
+
+ * cc-langs.el (c-at-vsemi-p-fn, c-vsemi-status-unknown-p-fn): move to
+ earlier in the file.
+ (c-opt-cpp-symbol, c-line-comment-start-regexp): New language variables.
+ (c-opt-cpp-macro-define): Make into a full language variable.
+ (c-stmt-delim-chars, c-stmt-delim-chars-with-comma): Special value for
+ AWK Mode (including \n, \r) removed, no longer needed.
+
+ * cc-mode.el (c-mode, c++-mode, objc-mode): Invoke
+ c-make-macro-with-semi-re. (Erroneously committed early, in previous
+ version, 5.259.)
+
+ * cc-vars.el (c-macro-with-semi-re, c-macro-names-with-semicolon): New
+ variables.
+ (c-make-macro-with-semi-re): New function
+
+ * cc-mode.texi (Indentation Commands): Mention "macros with semicolons".
+ (Other Special Indentations): Add an xref to "Macros with ;".
+ (Customizing Macros): Add stuff about syntax in macros. Add an xref to
+ "Macros with ;".
+ (Macros with ;): New page.
+
+
+
+2011-10-28 Stefan Monnier <[email protected]>
+
+ * vc/log-edit.el: Fill empty field rather than adding new one.
+ (log-edit-add-field): New function.
+ (log-edit-insert-changelog): Use it.
+
+2011-10-28 Mark Lillibridge <[email protected]> (tiny change)
+
+ * mail/rmail.el (rmail-mode-map): Add M-C-f as in rmailsum (bug#9802).
+
+2011-10-28 Stefan Monnier <[email protected]>
+
+ * progmodes/gdb-mi.el: Warn the user when -i=mi is missing.
+ (gdb--check-interpreter): New function.
+ (gdb): Use it.
+
+2011-10-27 Glenn Morris <[email protected]>
+
+ * emacs-lisp/cl-extra.el (most-positive-float, most-negative-float)
+ (least-positive-float, least-negative-float)
+ (least-positive-normalized-float, least-negative-normalized-float)
+ (float-epsilon, float-negative-epsilon):
+ Remove unnecessary declarations.
+
+ * emacs-lisp/cl-extra.el (cl-float-limits): Add doc string.
+ * emacs-lisp/cl.el (most-positive-float, most-negative-float)
+ (least-positive-float, least-negative-float)
+ (least-positive-normalized-float, least-negative-normalized-float)
+ (float-epsilon, float-negative-epsilon): Add doc-strings,
+ based on those in cl.texi.
+
+ * files.el (set-visited-file-name): If the major-mode changed,
+ reload the local variables. (Bug#9796)
+
+2011-10-27 Chong Yidong <[email protected]>
+
+ * subr.el (change-major-mode-after-body-hook): New hook.
+ (run-mode-hooks): Run it.
+
+ * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
+ Use change-major-mode-before-body-hook.
+
+ * simple.el (fundamental-mode):
+ * emacs-lisp/derived.el (define-derived-mode): Revert 2010-04-28
+ change introducing fundamental-mode-hook.
+
+2011-10-26 Juanma Barranquero <[email protected]>
+
+ * term/w32-win.el (w32-default-color-map): Declare obsolete. (Bug#9785)
+
+2011-10-26 Michael Albinus <[email protected]>
+
+ * ido.el (ido-file-name-all-completions-1): Do not require
+ tramp.el explicitely. (Bug#7583)
+
+2011-10-26 Stefan Monnier <[email protected]>
+
+ * progmodes/octave-mod.el:
+ * progmodes/octave-inf.el: Update maintainer.
+
+2011-10-26 Chong Yidong <[email protected]>
+
+ * subr.el (with-wrapper-hook): Rewrite doc.
+
+2011-10-25 Michael Albinus <[email protected]>
+
+ * net/tramp-sh.el (tramp-sh-handle-file-directory-p): Return t for
+ filenames "/method:foo:". (Bug#9793)
+
+2011-10-25 Stefan Monnier <[email protected]>
+
+ * comint.el (comint-get-old-input-default): Fix use-prompt-regexp case
+ (bug#9865).
+
+2011-10-24 Glenn Morris <[email protected]>
+
+ * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. (Bug#9819)
+
+2011-10-24 Michael Albinus <[email protected]>
+
+ * notifications.el: Add the requirement of a running D-Bus session
+ bus to the Commentary.
+
+2011-10-24 Juri Linkov <[email protected]>
+
+ * isearch.el (isearch-occur): Let-bind `search-spaces-regexp' to
+ `search-whitespace-regexp' only when `isearch-regexp' is non-nil.
+ (Bug#9364)
+
+2011-10-24 Juri Linkov <[email protected]>
+
+ * info.el (Info-following-node-name-re): Add newline to the list
+ of allowed characters for leading space. (Bug#9824)
+
+2011-10-24 Stefan Monnier <[email protected]>
+
+ * progmodes/octave-inf.el (inferior-octave-mode-map): Fix C-c C-h binding.
+ * progmodes/octave-mod.el (octave-help): Remove.
+
+2011-10-23 Michael Albinus <[email protected]>
+
+ Sync with Tramp 2.2.3.
+
+ * net/tramp-cache.el (top): Pacify byte-compiler using
+ `init-file-user' and `site-run-file'.
+
+ * net/trampver.el: Update release number.
+
2011-10-23 Chong Yidong <[email protected]>
* files.el (toggle-read-only): Remove obsolete comment about
@@ -7,16 +153,16 @@
for toggle-read-only. Note that this hasn't called vc-next-action
since 2008-05-02, though it wasn't documented at the time.
- * vc/ediff-init.el (ediff-toggle-read-only-function): Use
- toggle-read-only.
+ * vc/ediff-init.el (ediff-toggle-read-only-function):
+ Use toggle-read-only.
2011-10-22 Alan Mackenzie <[email protected]>
Fix bug #9560, sporadic wrong indentation; improve instrumentation
of c-parse-state.
- * cc-engine.el (c-append-lower-brace-pair-to-state-cache): correct
- faulty logical expression.
+ * cc-engine.el (c-append-lower-brace-pair-to-state-cache):
+ correct faulty logical expression.
(c-parse-state-state, c-record-parse-state-state):
(c-replay-parse-state-state): New defvar/defuns.
(c-debug-parse-state): Use new functions.
@@ -30,8 +176,8 @@
* progmodes/idlwave.el (idlwave-mode):
* progmodes/vera-mode.el (vera-mode): No need to set
- require-final-newline; that's done in prog-mode. Suggested by
- Stefan Monnier.
+ require-final-newline; that's done in prog-mode.
+ Suggested by Stefan Monnier.
2011-10-21 Martin Rudalics <[email protected]>
@@ -52,8 +198,8 @@
2011-10-21 Chong Yidong <[email protected]>
* progmodes/idlwave.el (idlwave-mode):
- * progmodes/vera-mode.el (vera-mode): Use
- mode-require-final-newline.
+ * progmodes/vera-mode.el (vera-mode):
+ Use mode-require-final-newline.
2011-10-20 Glenn Morris <[email protected]>
@@ -189,8 +335,8 @@
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
- * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
- autogenerated docstring.
+ * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
+ Fix autogenerated docstring.
2011-10-19 Juri Linkov <[email protected]>
diff --git a/lisp/comint.el b/lisp/comint.el
index 591be5e2d9..b91b82adb2 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2151,8 +2151,10 @@ current line, if point is on an output field.
If `comint-use-prompt-regexp' is non-nil, then return
the current line with any initial string matching the regexp
`comint-prompt-regexp' removed."
- (let ((bof (field-beginning)))
- (if (null (get-char-property bof 'field)) ;Not `output'.
+ (let (bof)
+ (if (and (not comint-use-prompt-regexp)
+ ;; Make sure we're in an input rather than output field.
+ (null (get-char-property (setq bof (field-beginning)) 'field)))
(field-string-no-properties bof)
(comint-bol)
(buffer-substring-no-properties (point) (line-end-position)))))
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 7468a0237c..8ea58b2e07 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -480,17 +480,13 @@ If STATE is t, return a new state object seeded from the time of day."
(and (numberp res) (/= res (/ res 2)) res))
(arith-error nil)))
-(defvar most-positive-float)
-(defvar most-negative-float)
-(defvar least-positive-float)
-(defvar least-negative-float)
-(defvar least-positive-normalized-float)
-(defvar least-negative-normalized-float)
-(defvar float-epsilon)
-(defvar float-negative-epsilon)
-
;;;###autoload
(defun cl-float-limits ()
+ "Initialize the Common Lisp floating-point parameters.
+This sets the values of: `most-positive-float', `most-negative-float',
+`least-positive-float', `least-negative-float', `float-epsilon',
+`float-negative-epsilon', `least-positive-normalized-float', and
+`least-negative-normalized-float'."
(or most-positive-float (not (numberp '2e1))
(let ((x '2e0) y z)
;; Find maximum exponent (first two loops are optimizations)
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index d6512306ad..1cd953d9e1 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -10,7 +10,7 @@
;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p
;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively
;;;;;; notevery notany every some mapcon mapcan mapl maplist map
-;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "26339d9571f9485bf34fa6d2ae38fc84")
+;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "15a5e127e1c9c9c3d1f398963b66cde7")
;;; Generated autoloads from cl-extra.el
(autoload 'coerce "cl-extra" "\
@@ -28,7 +28,7 @@ strings case-insensitively.
\(fn X Y)" nil nil)
(autoload 'cl-mapcar-many "cl-extra" "\
-Not documented
+
\(fn CL-FUNC CL-SEQS)" nil nil)
@@ -84,27 +84,27 @@ Return true if PREDICATE is false of some element of SEQ or SEQs.
(defalias 'cl-map-keymap 'map-keymap)
(autoload 'cl-map-keymap-recursively "cl-extra" "\
-Not documented
+
\(fn CL-FUNC-REC CL-MAP &optional CL-BASE)" nil nil)
(autoload 'cl-map-intervals "cl-extra" "\
-Not documented
+
\(fn CL-FUNC &optional CL-WHAT CL-PROP CL-START CL-END)" nil nil)
(autoload 'cl-map-overlays "cl-extra" "\
-Not documented
+
\(fn CL-FUNC &optional CL-BUFFER CL-START CL-END CL-ARG)" nil nil)
(autoload 'cl-set-frame-visible-p "cl-extra" "\
-Not documented
+
\(fn FRAME VAL)" nil nil)
(autoload 'cl-progv-before "cl-extra" "\
-Not documented
+
\(fn SYMS VALUES)" nil nil)
@@ -180,7 +180,11 @@ Return t if OBJECT is a random-state object.
\(fn OBJECT)" nil nil)
(autoload 'cl-float-limits "cl-extra" "\
-Not documented
+Initialize the Common Lisp floating-point parameters.
+This sets the values of: `most-positive-float', `most-negative-float',
+`least-positive-float', `least-negative-float', `float-epsilon',
+`float-negative-epsilon', `least-positive-normalized-float', and
+`least-negative-normalized-float'.
\(fn)" nil nil)
@@ -228,12 +232,12 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
\(fn PROPLIST PROPNAME &optional DEFAULT)" nil nil)
(autoload 'cl-set-getf "cl-extra" "\
-Not documented
+
\(fn PLIST TAG VAL)" nil nil)
(autoload 'cl-do-remf "cl-extra" "\
-Not documented
+
\(fn PLIST TAG)" nil nil)
@@ -267,7 +271,7 @@ This also does some trivial optimizations to make the form prettier.
\(fn FORM &optional ENV)" nil nil)
(autoload 'cl-prettyexpand "cl-extra" "\
-Not documented
+
\(fn FORM &optional FULL)" nil nil)
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index 526475eb1b..16eb31c120 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -333,15 +333,51 @@ always returns nil."
(defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time)))
-;; The following are actually set by cl-float-limits.
-(defconst most-positive-float nil)
-(defconst most-negative-float nil)
-(defconst least-positive-float nil)
-(defconst least-negative-float nil)
-(defconst least-positive-normalized-float nil)
-(defconst least-negative-normalized-float nil)
-(defconst float-epsilon nil)
-(defconst float-negative-epsilon nil)
+(defconst most-positive-float nil
+ "The largest value that a Lisp float can hold.
+If your system supports infinities, this is the largest finite value.
+For IEEE machines, this is approximately 1.79e+308.
+Call `cl-float-limits' to set this.")
+
+(defconst most-negative-float nil
+ "The largest negative value that a Lisp float can hold.
+This is simply -`most-positive-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst least-positive-float nil
+ "The smallest value greater than zero that a Lisp float can hold.
+For IEEE machines, it is about 4.94e-324 if denormals are supported,
+or 2.22e-308 if they are not.
+Call `cl-float-limits' to set this.")
+
+(defconst least-negative-float nil
+ "The smallest value less than zero that a Lisp float can hold.
+This is simply -`least-positive-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst least-positive-normalized-float nil
+ "The smallest normalized Lisp float greater than zero.
+This is the smallest value for which IEEE denormalization does not lose
+precision. For IEEE machines, this value is about 2.22e-308.
+For machines that do not support the concept of denormalization
+and gradual underflow, this constant equals `least-positive-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst least-negative-normalized-float nil
+ "The smallest normalized Lisp float less than zero.
+This is simply -`least-positive-normalized-float'.
+Call `cl-float-limits' to set this.")
+
+(defconst float-epsilon nil
+ "The smallest positive float that adds to 1.0 to give a distinct value.
+Adding a number less than this to 1.0 returns 1.0 due to roundoff.
+For IEEE machines, epsilon is about 2.22e-16.
+Call `cl-float-limits' to set this.")
+
+(defconst float-negative-epsilon nil
+ "The smallest positive float that subtracts from 1.0 to give a distinct value.
+For IEEE machines, it is about 1.11e-16.
+Call `cl-float-limits' to set this.")
;;; Sequence functions.
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 81932f9940..55ea102ed2 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -230,7 +230,7 @@ No problems result if this variable is not bound.
; Run the parent.
(delay-mode-hooks
- (,(or parent 'fundamental-mode))
+ (,(or parent 'kill-all-local-variables))
; Identify the child mode.
(setq major-mode (quote ,child))
(setq mode-name ,name)
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index b1cb0615e4..bf9f2c9d6e 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -94,8 +94,9 @@ Optional LIGHTER is displayed in the modeline when the mode is on.
Optional KEYMAP is the default keymap bound to the mode keymap.
If non-nil, it should be a variable name (whose value is a keymap),
or an expression that returns either a keymap or a list of
- arguments for `easy-mmode-define-keymap'. If KEYMAP is not a symbol,
- this also defines the variable MODE-map.
+ arguments for `easy-mmode-define-keymap'. If you supply a KEYMAP
+ argument that is not a symbol, this macro defines the variable
+ MODE-map and gives it the value that KEYMAP specifies.
BODY contains code to execute each time the mode is enabled or disabled.
It is executed after toggling the mode, and before running MODE-hook.
@@ -367,11 +368,13 @@ See `%s' for more information on %s."
(progn
(add-hook 'after-change-major-mode-hook
',MODE-enable-in-buffers)
- (add-hook 'fundamental-mode-hook ',MODE-enable-in-buffers)
+ (add-hook 'change-major-mode-after-body-hook
+ ',MODE-enable-in-buffers)
(add-hook 'find-file-hook ',MODE-check-buffers)
(add-hook 'change-major-mode-hook ',MODE-cmhh))
(remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers)
- (remove-hook 'fundamental-mode-hook ',MODE-enable-in-buffers)
+ (remove-hook 'change-major-mode-after-body-hook
+ ',MODE-enable-in-buffers)
(remove-hook 'find-file-hook ',MODE-check-buffers)
(remove-hook 'change-major-mode-hook ',MODE-cmhh))
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 54b17d58f3..4f9db02b5e 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -645,6 +645,8 @@ a list of colors that the current display can handle."
;; text in menu entries) and `SystemWindowText' (the default
;; color w32 uses for the text in windows and dialogs) may
;; be the same display color and be adjacent in the list.
+ ;; These system colors all have names prefixed with "System",
+ ;; which is hardcoded in w32fns.c (SYSTEM_COLOR_PREFIX).
;; This makes them different to any other color. Bug#9722
(not (and (eq system-type 'windows-nt)
(string-match-p "^System" (car (car l))))))
diff --git a/lisp/files.el b/lisp/files.el
index 3ed9bd5a27..40e2df14c1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3682,7 +3682,11 @@ the old visited file has been renamed to the new name FILENAME."
(get major-mode 'mode-class)
;; Don't change the mode if the local variable list specifies it.
(hack-local-variables t)
- (set-auto-mode t))
+ ;; TODO consider making normal-mode handle this case.
+ (let ((old major-mode))
+ (set-auto-mode t)
+ (or (eq old major-mode)
+ (hack-local-variables))))
(error nil)))
(defun write-file (filename &optional confirm)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 592d0671c2..7519252f03 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,8 +1,19 @@
+2011-10-26 Stefan Monnier <[email protected]>
+
+ * message.el (message-completion-function): Make sure
+ message-tab-body-function is not attempted if one of
+ message-completion-alist fails to find a completion (bug#9158).
+
+2011-10-26 Daiki Ueno <[email protected]>
+
+ * mml.el (mml-quote-region): Quote <#secure> tag.
+ (mml-generate-mime-1): Unquote <#secure> tag.
+
2011-10-20 Chong Yidong <[email protected]>
* gnus-cite.el (gnus-message-citation-mode): Doc fix (in Emacs 24,
calling a minor mode from Lisp with nil arg enables it, so we have to
- make the working a bit ambiguous here).
+ make the wording a bit ambiguous here).
2011-10-18 Teodor Zlatanov <[email protected]>
@@ -18548,7 +18559,7 @@
gnus-requst-update-info with explicit code to sync the in-memory
info read flags with the marks being sync'd to the backend.
- *gnus-util.el (gnus-pp): Add optional stream to match pp API.
+ * gnus-util.el (gnus-pp): Add optional stream to match pp API.
2004-09-28 Teodor Zlatanov <[email protected]>
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 948892d1e1..723f8fb72b 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -7888,7 +7888,11 @@ those headers."
(let ((mail-abbrev-mode-regexp (caar alist)))
(not (mail-abbrev-in-expansion-header-p))))
(setq alist (cdr alist)))
- (cdar alist)))
+ (when (cdar alist)
+ (lexical-let ((fun (cdar alist)))
+ ;; Even if completion fails, return a non-nil value, so as to avoid
+ ;; falling back to message-tab-body-function.
+ (lambda () (funcall fun) 'completion-attempted)))))
(eval-and-compile
(condition-case nil
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 0d2ae2a845..352fa329e3 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -525,7 +525,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
;; Remove quotes from quoted tags.
(goto-char (point-min))
(while (re-search-forward
- "<#!+/?\\(part\\|multipart\\|external\\|mml\\)"
+ "<#!+/?\\(part\\|multipart\\|external\\|mml\\|secure\\)"
nil t)
(delete-region (+ (match-beginning 0) 2)
(+ (match-beginning 0) 3))))))
@@ -1232,7 +1232,7 @@ If not set, `default-directory' will be used."
(goto-char (point-min))
;; Quote parts.
(while (re-search-forward
- "<#!*/?\\(multipart\\|part\\|external\\|mml\\)" nil t)
+ "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)" nil t)
;; Insert ! after the #.
(goto-char (+ (match-beginning 0) 2))
(insert "!")))))
diff --git a/lisp/ido.el b/lisp/ido.el
index 88599013ce..fda4c0316f 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3457,8 +3457,6 @@ This is to make them appear as if they were \"virtual buffers\"."
(nconc ido-temp-list items)
(setq ido-temp-list items)))
-(declare-function tramp-tramp-file-p "tramp" (name))
-
(defun ido-file-name-all-completions-1 (dir)
(cond
((ido-nonreadable-directory-p dir) '())
@@ -3466,8 +3464,6 @@ This is to make them appear as if they were \"virtual buffers\"."
;; Caller must have done that if necessary.
((and ido-enable-tramp-completion
- (or (fboundp 'tramp-completion-mode-p)
- (require 'tramp nil t))
(string-match "\\`/[^/]+[:@]\\'" dir))
;; Strip method:user@host: part of tramp completions.
;; Tramp completions do not include leading slash.
@@ -3480,7 +3476,9 @@ This is to make them appear as if they were \"virtual buffers\"."
;; /ftp:user@host:./ => ok
(and
(not (string= "/ftp:" dir))
- (tramp-tramp-file-p dir)
+ (file-remote-p dir)
+ ;; tramp-ftp-file-name-p is available only when tramp
+ ;; has been loaded.
(fboundp 'tramp-ftp-file-name-p)
(funcall 'tramp-ftp-file-name-p dir)
(string-match ":\\'" dir)
diff --git a/lisp/info.el b/lisp/info.el
index 4ccbeba2a4..b8deb3c9c7 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2015,7 +2015,7 @@ Submatch 1 is the complete node name.
Submatch 2 if non-nil is the parenthesized file name part of the node name.
Submatch 3 is the local part of the node name.
End of submatch 0, 1, and 3 are the same, so you can safely concat."
- (concat "[ \t]*" ;Skip leading space.
+ (concat "[ \t\n]*" ;Skip leading space.
"\\(\\(([^)]+)\\)?" ;Node name can start with a file name.
"\\([" (or allowedchars "^,\t\n") "]*" ;Any number of allowed chars.
"[" (or allowedchars "^,\t\n") " ]" ;The last char can't be a space.
diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index 9ba95e4d11..870f2bece2 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -708,7 +708,7 @@
(define-charset-alias 'cp866u 'cp1125)
;; Fixme: C.f. iconv, http://czyborra.com/charsets/codepages.html
-;; shows this as not ASCII comptaible, with various graphics in
+;; shows this as not ASCII compatible, with various graphics in
;; 0x01-0x1F.
(define-charset 'cp437
"CP437 (MS-DOS United States, Australia, New Zealand, South Africa)"
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 6cfcce5967..6bb23916da 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1452,7 +1452,7 @@ string. NLINES has the same meaning as in `occur'."
;; Set `search-upper-case' to nil to not call
;; `isearch-no-upper-case-p' in `occur-1'.
(search-upper-case nil)
- (search-spaces-regexp search-whitespace-regexp))
+ (search-spaces-regexp (if isearch-regexp search-whitespace-regexp)))
(occur regexp nlines)))
(declare-function hi-lock-read-face-name "hi-lock" ())
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 770050efb0..603a615192 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1008,6 +1008,7 @@ The buffer is expected to be narrowed to just the header of the message."
(define-key map "\e\C-l" 'rmail-summary-by-labels)
(define-key map "\e\C-r" 'rmail-summary-by-recipients)
(define-key map "\e\C-s" 'rmail-summary-by-regexp)
+ (define-key map "\e\C-f" 'rmail-summary-by-senders)
(define-key map "\e\C-t" 'rmail-summary-by-topic)
(define-key map "m" 'rmail-mail)
(define-key map "\em" 'rmail-retry-failure)
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 9397025cb6..b35ca3bbd1 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -383,7 +383,8 @@ for all methods. Resulting data are derived from connection history."
;; When "emacs -Q" has been called, both variables are nil.
;; We do not load the persistency file then, in order to
;; have a clean test environment.
- (or init-file-user site-run-file))
+ (or (and (boundp 'init-file-user) (symbol-value 'init-file-user))
+ (and (boundp 'site-run-file) (symbol-value 'site-run-file))))
(condition-case err
(with-temp-buffer
(insert-file-contents tramp-persistency-file-name)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 56424f7947..55732194bc 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1594,17 +1594,14 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(defun tramp-sh-handle-file-directory-p (filename)
"Like `file-directory-p' for Tramp files."
- ;; Care must be taken that this function returns `t' for symlinks
- ;; pointing to directories. Surely the most obvious implementation
- ;; would be `test -d', but that returns false for such symlinks.
- ;; CCC: Stefan Monnier says that `test -d' follows symlinks. And
- ;; I now think he's right. So we could be using `test -d', couldn't
- ;; we?
- ;;
- ;; Alternatives: `cd %s', `test -d %s'
(with-parsed-tramp-file-name filename nil
- (with-file-property v localname "file-directory-p"
- (tramp-run-test "-d" filename))))
+ ;; `file-directory-p' is used as predicate for filename completion.
+ ;; Sometimes, when a connection is not established yet, it is
+ ;; desirable to return t immediately for "/method:foo:". It can
+ ;; be expected that this is always a directory.
+ (or (zerop (length localname))
+ (with-file-property v localname "file-directory-p"
+ (tramp-run-test "-d" filename)))))
(defun tramp-sh-handle-file-writable-p (filename)
"Like `file-writable-p' for Tramp files."
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 5492441ac7..fc0c936c40 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
;; should be changed only there.
;;;###tramp-autoload
-(defconst tramp-version "2.2.3-pre"
+(defconst tramp-version "2.2.3-24.1"
"This version of Tramp.")
;;;###tramp-autoload
@@ -44,7 +44,7 @@
(= emacs-major-version 21)
(>= emacs-minor-version 4)))
"ok"
- (format "Tramp 2.2.3-pre is not fit for %s"
+ (format "Tramp 2.2.3-24.1 is not fit for %s"
(when (string-match "^.*$" (emacs-version))
(match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/notifications.el b/lisp/notifications.el
index 42cd40df36..a4e7fdd542 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -30,6 +30,9 @@
;;
;; (require 'notifications)
+;; For proper usage, Emacs must be started in an environment with an
+;; active D-Bus session bus.
+
;;; Code:
(eval-when-compile
(require 'cl))
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 9fbeb9f188..ae150621dc 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1871,7 +1871,7 @@
* org-list.el (org-list-separating-blank-lines-number): Fix
confusion between point and item beginning. Now, if no
- information is avalaible, truly follow user preference when it
+ information is available, truly follow user preference when it
inserts blank lines manually.
(org-list-insert-item): Send correct argument to the preceding
function.
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index e5b4d7e35a..93da6e3e2b 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -744,19 +744,20 @@ be after it."
;; V i r t u a l S e m i c o l o n s
;;
;; In most CC Mode languages, statements are terminated explicitly by
-;; semicolons or closing braces. In some of the CC modes (currently only AWK
-;; Mode (April 2004)), statements are (or can be) terminated by EOLs. Such a
-;; statement is said to be terminated by a "virtual semicolon" (VS). A
-;; statement terminated by an actual semicolon or brace is never considered to
-;; have a VS.
+;; semicolons or closing braces. In some of the CC modes (currently AWK Mode
+;; and certain user-specified #define macros in C, C++, etc. (November 2008)),
+;; statements are (or can be) terminated by EOLs. Such a statement is said to
+;; be terminated by a "virtual semicolon" (VS). A statement terminated by an
+;; actual semicolon or brace is never considered to have a VS.
;;
;; The indentation engine (or whatever) tests for a VS at a specific position
;; by invoking the macro `c-at-vsemi-p', which in its turn calls the mode
;; specific function (if any) which is the value of the language variable
-;; `c-at-vsemi-p-fn'. The actual details of what constitutes a VS in a
-;; language are thus encapsulated in code specific to that language
-;; (e.g. cc-awk.el). `c-at-vsemi-p' returns non-nil if point (or the optional
-;; parameter POS) is at a VS, nil otherwise.
+;; `c-at-vsemi-p-fn'. This function should only use "low-level" features of
+;; CC Mode, i.e. features which won't trigger infinite recursion. ;-) The
+;; actual details of what constitutes a VS in a language are thus encapsulated
+;; in code specific to that language (e.g. cc-awk.el). `c-at-vsemi-p' returns
+;; non-nil if point (or the optional parameter POS) is at a VS, nil otherwise.
;;
;; The language specific function might well do extensive analysis of the
;; source text, and may use a cacheing scheme to speed up repeated calls.
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index bc42e1032a..ea0a8f2d3b 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -1154,42 +1154,65 @@ the line. If this virtual semicolon is _at_ from, the function recognizes it.
Note that this function might do hidden buffer changes. See the
comment at the start of cc-engine.el for more info."
- (let ((skip-chars c-stmt-delim-chars)
- lit-range)
- (save-excursion
- (catch 'done
- (goto-char from)
- (while (progn (skip-chars-forward skip-chars to)
- (< (point) to))
- (cond
- ((setq lit-range (c-literal-limits from)) ; Have we landed in a string/comment?
- (goto-char (cdr lit-range)))
- ((eq (char-after) ?:)
- (forward-char)
- (if (and (eq (char-after) ?:)
- (< (point) to))
- ;; Ignore scope operators.
- (forward-char)
- (setq c-maybe-labelp (1- (point)))))
- ((eq (char-after) ??)
- ;; A question mark. Can't be a label, so stop
- ;; looking for more : and ?.
- (setq c-maybe-labelp nil
- skip-chars (substring c-stmt-delim-chars 0 -2)))
- ((memq (char-after) '(?# ?\n ?\r)) ; A virtual semicolon?
- (if (and (eq (char-before) ?\\) (memq (char-after) '(?\n ?\r)))
- (backward-char))
- (skip-chars-backward " \t" from)
- (if (c-at-vsemi-p)
- (throw 'done (point))
- (forward-line)))
- (t (throw 'done (point)))))
- ;; In trailing space after an as yet undetected virtual semicolon?
- (c-backward-syntactic-ws from)
- (if (and (< (point) to)
- (c-at-vsemi-p))
- (point)
- nil)))))
+ (let* ((skip-chars
+ ;; If the current language has CPP macros, insert # into skip-chars.
+ (if c-opt-cpp-symbol
+ (concat (substring c-stmt-delim-chars 0 1) ; "^"
+ c-opt-cpp-symbol ; usually "#"
+ (substring c-stmt-delim-chars 1)) ; e.g. ";{}?:"
+ c-stmt-delim-chars))
+ (non-skip-list
+ (append (substring skip-chars 1) nil)) ; e.g. (?# ?\; ?{ ?} ?? ?:)
+ lit-range vsemi-pos)
+ (save-restriction
+ (widen)
+ (save-excursion
+ (catch 'done
+ (goto-char from)
+ (while (progn (skip-chars-forward
+ skip-chars
+ (min to (c-point 'bonl)))
+ (< (point) to))
+ (cond
+ ;; Virtual semicolon?
+ ((and (bolp)
+ (save-excursion
+ (progn
+ (if (setq lit-range (c-literal-limits from)) ; Have we landed in a string/comment?
+ (goto-char (car lit-range)))
+ (c-backward-syntactic-ws) ; ? put a limit here, maybe?
+ (setq vsemi-pos (point))
+ (c-at-vsemi-p))))
+ (throw 'done vsemi-pos))
+ ;; In a string/comment?
+ ((setq lit-range (c-literal-limits))
+ (goto-char (cdr lit-range)))
+ ((eq (char-after) ?:)
+ (forward-char)
+ (if (and (eq (char-after) ?:)
+ (< (point) to))
+ ;; Ignore scope operators.
+ (forward-char)
+ (setq c-maybe-labelp (1- (point)))))
+ ((eq (char-after) ??)
+ ;; A question mark. Can't be a label, so stop
+ ;; looking for more : and ?.
+ (setq c-maybe-labelp nil
+ skip-chars (substring c-stmt-delim-chars 0 -2)))
+ ;; At a CPP construct?
+ ((and c-opt-cpp-symbol (looking-at c-opt-cpp-symbol)
+ (save-excursion
+ (forward-line 0)
+ (looking-at c-opt-cpp-prefix)))
+ (c-end-of-macro))
+ ((memq (char-after) non-skip-list)
+ (throw 'done (point)))))
+ ;; In trailing space after an as yet undetected virtual semicolon?
+ (c-backward-syntactic-ws from)
+ (if (and (< (point) to)
+ (c-at-vsemi-p))
+ (point)
+ nil))))))
(defun c-at-statement-start-p ()
"Return non-nil if the point is at the first token in a statement
@@ -7163,12 +7186,14 @@ comment at the start of cc-engine.el for more info."
;; Check that we're not after a token that can't precede a label.
(or
;; Trivially succeeds when there's no preceding token.
+ ;; Succeeds when we're at a virtual semicolon.
(if preceding-token-end
(<= preceding-token-end (point-min))
(save-excursion
(c-backward-syntactic-ws)
(setq preceding-token-end (point))
- (bobp)))
+ (or (bobp)
+ (c-at-vsemi-p))))
;; Check if we're after a label, if we're after a closing
;; paren that belong to statement, and with
@@ -8400,6 +8425,57 @@ comment at the start of cc-engine.el for more info."
paren-state)
containing-sexp)))))
+(defun c-at-macro-vsemi-p (&optional pos)
+ ;; Is there a "virtual semicolon" at POS or point?
+ ;; (See cc-defs.el for full details of "virtual semicolons".)
+ ;;
+ ;; This is true when point is at the last non syntactic WS position on the
+ ;; line, there is a macro call last on the line, and this particular macro's
+ ;; name is defined by the regexp `c-vs-macro-regexp' as not needing a
+ ;; semicolon.
+ (save-excursion
+ (save-restriction
+ (widen)
+ (if pos
+ (goto-char pos)
+ (setq pos (point)))
+ (and
+ c-macro-with-semi-re
+ (not (c-in-literal))
+ (eq (skip-chars-backward " \t") 0)
+
+ ;; Check we've got nothing after this except comments and empty lines
+ ;; joined by escaped EOLs.
+ (skip-chars-forward " \t") ; always returns non-nil.
+ (progn
+ (while ; go over 1 block comment per iteration.
+ (and
+ (looking-at "\\(\\\\[\n\r][ \t]*\\)*")
+ (goto-char (match-end 0))
+ (cond
+ ((looking-at c-block-comment-start-regexp)
+ (and (forward-comment 1)
+ (skip-chars-forward " \t"))) ; always returns non-nil
+ ((looking-at c-line-comment-start-regexp)
+ (end-of-line)
+ nil)
+ (t nil))))
+ (eolp))
+
+ (goto-char pos)
+ (progn (c-backward-syntactic-ws)
+ (eq (point) pos))
+
+ ;; Check for one of the listed macros being before point.
+ (or (not (eq (char-before) ?\)))
+ (when (c-go-list-backward)
+ (c-backward-syntactic-ws)
+ t))
+ (c-simple-skip-symbol-backward)
+ (looking-at c-macro-with-semi-re)))))
+
+(defun c-macro-vsemi-status-unknown-p () t) ; See cc-defs.el.
+
;; `c-guess-basic-syntax' and the functions that precedes it below
;; implements the main decision tree for determining the syntactic
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index fd817e3b4f..9a83d5196d 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1277,9 +1277,11 @@ casts and declarations are fontified. Used on level 2 and higher."
(when
;; The result of the form below is true when we don't recognize a
;; declaration or cast.
- (if (and (eq (get-text-property (point) 'face)
- 'font-lock-keyword-face)
- (looking-at c-not-decl-init-keywords))
+ (if (or (and (eq (get-text-property (point) 'face)
+ 'font-lock-keyword-face)
+ (looking-at c-not-decl-init-keywords))
+ (and c-macro-with-semi-re
+ (looking-at c-macro-with-semi-re))) ; 2008-11-04
;; Don't do anything more if we're looking at a keyword that
;; can't start a declaration.
t
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 279c5e46c4..09f8b31837 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -509,6 +509,31 @@ parameters \(point-min), \(point-max) and <buffer size>."
(c-lang-const c-before-font-lock-function))
+;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK).
+(c-lang-defconst c-at-vsemi-p-fn
+ "Contains a function \"Is there a virtual semicolon at POS or point?\".
+Such a function takes one optional parameter, a buffer position (defaults to
+point), and returns nil or t. This variable contains nil for languages which
+don't have EOL terminated statements. "
+ t nil
+ (c c++ objc) 'c-at-macro-vsemi-p
+ awk 'c-awk-at-vsemi-p)
+(c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn))
+
+(c-lang-defconst c-vsemi-status-unknown-p-fn
+ "Contains a function \"are we unsure whether there is a virtual semicolon on this line?\".
+The (admittedly kludgey) purpose of such a function is to prevent an infinite
+recursion in c-beginning-of-statement-1 when point starts at a `while' token.
+The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1,
+even indirectly. This variable contains nil for languages which don't have
+EOL terminated statements."
+ t nil
+ (c c++ objc) 'c-macro-vsemi-status-unknown-p
+ awk 'c-awk-vsemi-status-unknown-p)
+(c-lang-defvar c-vsemi-status-unknown-p-fn
+ (c-lang-const c-vsemi-status-unknown-p-fn))
+
+
;;; Lexer-level syntax (identifiers, tokens etc).
(c-lang-defconst c-has-bitfields
@@ -737,6 +762,12 @@ literal are multiline."
(c-lang-defvar c-multiline-string-start-char
(c-lang-const c-multiline-string-start-char))
+(c-lang-defconst c-opt-cpp-symbol
+ "The symbol which starts preprocessor constructs when in the margin."
+ t "#"
+ (java awk) nil)
+(c-lang-defvar c-opt-cpp-symbol (c-lang-const c-opt-cpp-symbol))
+
(c-lang-defconst c-opt-cpp-prefix
"Regexp matching the prefix of a cpp directive in the languages that
normally use that macro preprocessor. Tested at bol or at boi.
@@ -785,6 +816,8 @@ file name in angle brackets or quotes."
definition, or nil if the language doesn't have any."
t (if (c-lang-const c-opt-cpp-prefix)
"define"))
+(c-lang-defvar c-opt-cpp-macro-define
+ (c-lang-const c-opt-cpp-macro-define))
(c-lang-defconst c-opt-cpp-macro-define-start
;; Regexp matching everything up to the macro body of a cpp define, or the
@@ -1171,14 +1204,12 @@ operators."
;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to
;; begin with "^" to negate the set. If ? : operators should be
;; detected then the string must end with "?:".
- t "^;{}?:"
- awk "^;{}#\n\r?:") ; The newline chars gets special treatment.
+ t "^;{}?:")
(c-lang-defvar c-stmt-delim-chars (c-lang-const c-stmt-delim-chars))
(c-lang-defconst c-stmt-delim-chars-with-comma
;; Variant of `c-stmt-delim-chars' that additionally contains ','.
- t "^;,{}?:"
- awk "^;,{}\n\r?:") ; The newline chars gets special treatment.
+ t "^;,{}?:")
(c-lang-defvar c-stmt-delim-chars-with-comma
(c-lang-const c-stmt-delim-chars-with-comma))
@@ -1238,7 +1269,6 @@ properly."
re)))
(c-lang-defvar c-comment-start-regexp (c-lang-const c-comment-start-regexp))
-;;;; Added by ACM, 2003/9/18.
(c-lang-defconst c-block-comment-start-regexp
;; Regexp which matches the start of a block comment (if such exists in the
;; language)
@@ -1248,6 +1278,15 @@ properly."
(c-lang-defvar c-block-comment-start-regexp
(c-lang-const c-block-comment-start-regexp))
+(c-lang-defconst c-line-comment-start-regexp
+ ;; Regexp which matches the start of a line comment (if such exists in the
+ ;; language; it does in all 7 CC Mode languages).
+ t (if (c-lang-const c-line-comment-starter)
+ (regexp-quote (c-lang-const c-line-comment-starter))
+ "\\<\\>"))
+(c-lang-defvar c-line-comment-start-regexp
+ (c-lang-const c-line-comment-start-regexp))
+
(c-lang-defconst c-literal-start-regexp
;; Regexp to match the start of comments and string literals.
t (concat (c-lang-const c-comment-start-regexp)
@@ -1475,29 +1514,6 @@ properly."
(c-lang-defvar c-syntactic-eol (c-lang-const c-syntactic-eol))
-;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK).
-(c-lang-defconst c-at-vsemi-p-fn
- "Contains a function \"Is there a virtual semicolon at POS or point?\".
-Such a function takes one optional parameter, a buffer position (defaults to
-point), and returns nil or t. This variable contains nil for languages which
-don't have EOL terminated statements. "
- t nil
- awk 'c-awk-at-vsemi-p)
-(c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn))
-
-(c-lang-defconst c-vsemi-status-unknown-p-fn
- "Contains a function \"are we unsure whether there is a virtual semicolon on this line?\".
-The (admittedly kludgey) purpose of such a function is to prevent an infinite
-recursion in c-beginning-of-statement-1 when point starts at a `while' token.
-The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1,
-even indirectly. This variable contains nil for languages which don't have
-EOL terminated statements."
- t nil
- awk 'c-awk-vsemi-status-unknown-p)
-(c-lang-defvar c-vsemi-status-unknown-p-fn
- (c-lang-const c-vsemi-status-unknown-p-fn))
-
-
;;; Defun functions
;; The Emacs variables beginning-of-defun-function and
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index eec63b4fa3..a6bf241f0d 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1187,6 +1187,7 @@ Key bindings:
abbrev-mode t)
(use-local-map c-mode-map)
(c-init-language-vars-for 'c-mode)
+ (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
(c-common-init 'c-mode)
(easy-menu-add c-c-menu)
(cc-imenu-init cc-imenu-c-generic-expression)
@@ -1246,6 +1247,7 @@ Key bindings:
abbrev-mode t)
(use-local-map c++-mode-map)
(c-init-language-vars-for 'c++-mode)
+ (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
(c-common-init 'c++-mode)
(easy-menu-add c-c++-menu)
(cc-imenu-init cc-imenu-c++-generic-expression)
@@ -1303,6 +1305,7 @@ Key bindings:
abbrev-mode t)
(use-local-map objc-mode-map)
(c-init-language-vars-for 'objc-mode)
+ (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
(c-common-init 'objc-mode)
(easy-menu-add c-objc-menu)
(cc-imenu-init nil 'cc-imenu-objc-function)
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 769bf63f63..24361e3667 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1622,6 +1622,54 @@ names)."))
;; Non-customizable variables, still part of the interface to CC Mode
+(defvar c-macro-with-semi-re nil
+ ;; Regular expression which matches a (#define'd) symbol whose expansion
+ ;; ends with a semicolon.
+ ;;
+ ;; This variable should be set by `c-make-macros-with-semi-re' rather than
+ ;; directly.
+)
+(make-variable-buffer-local 'c-macro-with-semi-re)
+
+(defun c-make-macro-with-semi-re ()
+ ;; Convert `c-macro-names-with-semicolon' into the regexp
+ ;; `c-macro-with-semi-re' (or just copy it if it's already a re).
+ (setq c-macro-with-semi-re
+ (and
+ c-opt-cpp-macro-define
+ (cond
+ ((stringp c-macro-names-with-semicolon)
+ (copy-sequence c-macro-names-with-semicolon))
+ ((consp c-macro-names-with-semicolon)
+ (concat
+ "\\<"
+ (regexp-opt c-macro-names-with-semicolon)
+ "\\>")) ; N.B. the PAREN param of regexp-opt isn't supported by
+ ; all XEmacsen.
+ ((null c-macro-names-with-semicolon)
+ nil)
+ (t (error "c-make-macro-with-semi-re: invalid \
+c-macro-names-with-semicolon: %s"
+ c-macro-names-with-semicolon))))))
+
+(defvar c-macro-names-with-semicolon
+ '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS")
+ "List of #defined symbols whose expansion ends with a semicolon.
+Alternatively it can be a string, a regular expression which
+matches all such symbols.
+
+The \"symbols\" must be syntactically valid identifiers in the
+target language \(C, C++, Objective C), or \(as the case may be)
+the regular expression must match only valid identifiers.
+
+If you change this variable's value, call the function
+`c-make-macros-with-semi-re' to set the necessary internal
+variables.
+
+Note that currently \(2008-11-04) this variable is a prototype,
+and is likely to disappear or change its form soon.")
+(make-variable-buffer-local 'c-macro-names-with-semicolon)
+
(defvar c-file-style nil
"Variable interface for setting style via File Local Variables.
In a file's Local Variable section, you can set this variable to a
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 22db7b2e5f..dde00d753a 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -43,21 +43,10 @@
;; M-x gdb will start the debugger.
-;; This file uses GDB/MI as the primary interface to GDB. It is still under
-;; development and is part of a process to migrate Emacs from annotations (as
-;; used in gdb-ui.el) to GDB/MI. It runs gdb with GDB/MI (-interp=mi) and
-;; access CLI using "-interpreter-exec console cli-command". This code works
-;; without gdb-ui.el and uses MI tokens instead of queues. Eventually MI
-;; should be asynchronous.
-
-;; This mode will PARTLY WORK WITH RECENT GDB RELEASES (status in modeline
-;; doesn't update properly when execution commands are issued from GUD buffer)
-;; and WORKS BEST when GDB runs asynchronously: maint set linux-async on.
-;;
-;; You need development version of GDB 7.0 for the thread buffer to work.
-
-;; This file replaces gdb-ui.el and is for development with GDB. Use the
-;; release branch of Emacs 22 for the latest version of gdb-ui.el.
+;; This file uses GDB/MI as the primary interface to GDB. It runs gdb with
+;; GDB/MI (-interp=mi) and access CLI using "-interpreter-exec console
+;; cli-command". This code works without gdb-ui.el and uses MI tokens instead
+;; of queues. Eventually MI should be asynchronous.
;; Windows Platforms:
@@ -599,6 +588,22 @@ NOARG must be t when this macro is used outside `gud-def'"
(concat (gdb-gud-context-command ,cmd1 ,noall) " " ,cmd2)
,(when (not noarg) 'arg)))
+(defun gdb--check-interpreter (proc string)
+ (unless (zerop (length string))
+ (let ((filter (process-get proc 'gud-normal-filter)))
+ (set-process-filter proc filter)
+ (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=))
+ ;; Apparently we're not running with -i=mi.
+ (let ((msg "Error: you did not specify -i=mi on GDB's command line!"))
+ (message msg)
+ (setq string (concat (propertize msg 'font-lock-face 'error)
+ "\n" string)))
+ ;; Use the old gud-gbd filter, not because it works, but because it
+ ;; will properly display GDB's answers rather than hanging waiting for
+ ;; answers that aren't coming.
+ (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter))
+ (funcall filter proc string))))
+
;;;###autoload
(defun gdb (command-line)
"Run gdb on program FILE in buffer *gud-FILE*.
@@ -665,6 +670,13 @@ detailed description of this mode.
"Multiple debugging requires restarting in text command mode"))
;;
(gud-common-init command-line nil 'gud-gdbmi-marker-filter)
+
+ ;; Setup a temporary process filter to warn when GDB was not started
+ ;; with -i=mi.
+ (let ((proc (get-buffer-process gud-comint-buffer)))
+ (process-put proc 'gud-normal-filter (process-filter proc))
+ (set-process-filter proc #'gdb--check-interpreter))
+
(set (make-local-variable 'gud-minor-mode) 'gdbmi)
(setq comint-input-sender 'gdb-send)
(when (ring-empty-p comint-input-ring) ; cf shell-mode
diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el
index cb64b2436c..421f476016 100644
--- a/lisp/progmodes/octave-inf.el
+++ b/lisp/progmodes/octave-inf.el
@@ -4,7 +4,7 @@
;; Author: Kurt Hornik <[email protected]>
;; Author: John Eaton <[email protected]>
-;; Maintainer: Kurt Hornik <[email protected]>
+;; Maintainer: FSF
;; Keywords: languages
;; Package: octave-mod
@@ -68,7 +68,8 @@ mode, set this to (\"-q\" \"--traditional\")."
(define-key map "\C-c\C-l" 'inferior-octave-dynamic-list-input-ring)
(define-key map [menu-bar inout list-history]
'("List Input History" . inferior-octave-dynamic-list-input-ring))
- (define-key map "\C-c\C-h" 'octave-help)
+ ;; FIXME: free C-h so it can do the describe-prefix-bindings.
+ (define-key map "\C-c\C-h" 'info-lookup-symbol)
map)
"Keymap used in Inferior Octave mode.")
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index 183347cdec..28e25a35c7 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -4,7 +4,7 @@
;; Author: Kurt Hornik <[email protected]>
;; Author: John Eaton <[email protected]>
-;; Maintainer: Kurt Hornik <[email protected]>
+;; Maintainer: FSF
;; Keywords: languages
;; This file is part of GNU Emacs.
@@ -223,6 +223,7 @@ parenthetical grouping.")
(define-key map "\C-c]" 'smie-close-block)
(define-key map "\C-c/" 'smie-close-block)
(define-key map "\C-c\C-f" 'octave-insert-defun)
+ ;; FIXME: free C-h so it can do the describe-prefix-bindings.
(define-key map "\C-c\C-h" 'info-lookup-symbol)
(define-key map "\C-c\C-il" 'octave-send-line)
(define-key map "\C-c\C-ib" 'octave-send-block)
@@ -236,6 +237,7 @@ parenthetical grouping.")
(define-key map "\C-c\C-i\C-f" 'octave-send-defun)
(define-key map "\C-c\C-i\C-r" 'octave-send-region)
(define-key map "\C-c\C-i\C-s" 'octave-show-process-buffer)
+ ;; FIXME: free C-h so it can do the describe-prefix-bindings.
(define-key map "\C-c\C-i\C-h" 'octave-hide-process-buffer)
(define-key map "\C-c\C-i\C-k" 'octave-kill-process)
map)
@@ -655,14 +657,6 @@ including a reproducible test case and send the message."
(easy-menu-add octave-mode-menu)
(octave-initialize-completions))
-
-(defvar info-lookup-mode)
-
-(defun octave-help ()
- "Get help on Octave symbols from the Octave info files.
-Look up symbol in the function, operator and variable indices of the info files."
- (let ((info-lookup-mode 'octave-mode))
- (call-interactively 'info-lookup-symbol)))
;;; Miscellaneous useful functions
diff --git a/lisp/simple.el b/lisp/simple.el
index 79de6aea3d..90d22c817b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -349,7 +349,8 @@ location."
Other major modes are defined by comparison with this one."
(interactive)
(kill-all-local-variables)
- (run-mode-hooks 'fundamental-mode-hook))
+ (unless delay-mode-hooks
+ (run-hooks 'after-change-major-mode-hook)))
;; Special major modes to view specially formatted data rather than files.
diff --git a/lisp/subr.el b/lisp/subr.el
index 05ac198dd1..f3cd4dabe2 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -116,8 +116,6 @@ BODY should be a list of Lisp expressions.
;; depend on backquote.el.
(list 'function (cons 'lambda cdr)))
-;; Partial application of functions (similar to "currying").
-;; This function is here rather than in subr.el because it uses CL.
(defun apply-partially (fun &rest args)
"Return a function that is a partial application of FUN to ARGS.
ARGS is a list of the first N arguments to pass to FUN.
@@ -1366,18 +1364,26 @@ All symbols are bound before the VALUEFORMs are evalled."
,@(mapcar (lambda (binder) `(setq ,@binder)) binders)
,@body))
-(defmacro with-wrapper-hook (var args &rest body)
- "Run BODY wrapped with the VAR hook.
-VAR is a special hook: its functions are called with a first argument
-which is the \"original\" code (the BODY), so the hook function can wrap
-the original function, or call it any number of times (including not calling
-it at all). This is similar to an `around' advice.
-VAR is normally a symbol (a variable) in which case it is treated like
-a hook, with a buffer-local and a global part. But it can also be an
-arbitrary expression.
-ARGS is a list of variables which will be passed as additional arguments
-to each function, after the initial argument, and which the first argument
-expects to receive when called."
+(defmacro with-wrapper-hook (hook args &rest body)
+ "Run BODY, using wrapper functions from HOOK with additional ARGS.
+HOOK is an abnormal hook. Each hook function in HOOK \"wraps\"
+around the preceding ones, like a set of nested `around' advices.
+
+Each hook function should accept an argument list consisting of a
+function FUN, followed by the additional arguments in ARGS.
+
+The FUN passed to the first hook function in HOOK performs BODY,
+if it is called with arguments ARGS. The FUN passed to each
+successive hook function is defined based on the preceding hook
+functions; if called with arguments ARGS, it does what the
+`with-wrapper-hook' call would do if the preceding hook functions
+were the only ones present in HOOK.
+
+In the function definition of each hook function, FUN can be
+called any number of times (including not calling it at all).
+That function definition is then used to construct the FUN passed
+to the next hook function, if any. The last (or \"outermost\")
+FUN is then called once."
(declare (indent 2) (debug (form sexp body)))
;; We need those two gensyms because CL's lexical scoping is not available
;; for function arguments :-(
@@ -1406,11 +1412,11 @@ expects to receive when called."
;; Once there are no more functions on the hook, run
;; the original body.
(apply (lambda ,args ,@body) ,argssym)))))
- (funcall ,runrestofhook ,var
+ (funcall ,runrestofhook ,hook
;; The global part of the hook, if any.
- ,(if (symbolp var)
- `(if (local-variable-p ',var)
- (default-value ',var)))
+ ,(if (symbolp hook)
+ `(if (local-variable-p ',hook)
+ (default-value ',hook)))
(list ,@args)))))
(defun add-to-list (list-var element &optional append compare-fn)
@@ -1524,6 +1530,9 @@ if it is empty or a duplicate."
(make-variable-buffer-local 'delayed-mode-hooks)
(put 'delay-mode-hooks 'permanent-local t)
+(defvar change-major-mode-after-body-hook nil
+ "Normal hook run in major mode functions, before the mode hooks.")
+
(defvar after-change-major-mode-hook nil
"Normal hook run at the very end of major mode functions.")
@@ -1540,7 +1549,7 @@ FOO-mode-hook."
;; Normal case, just run the hook as before plus any delayed hooks.
(setq hooks (nconc (nreverse delayed-mode-hooks) hooks))
(setq delayed-mode-hooks nil)
- (apply 'run-hooks hooks)
+ (apply 'run-hooks (cons 'change-major-mode-after-body-hook hooks))
(run-hooks 'after-change-major-mode-hook)))
(defmacro delay-mode-hooks (&rest body)
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index e4bf031d42..b7f2a69e77 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -85,6 +85,7 @@
(define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1")
(defvar w32-color-map) ;; defined in w32fns.c
+(make-obsolete 'w32-default-color-map nil "24.1")
(declare-function w32-send-sys-command "w32fns.c")
(declare-function set-message-beep "w32console.c")
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 6f6993980d..cef8a3d154 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1522,7 +1522,7 @@ Valid actions are: readable, restore, read, kill, write."
;;; (while all
;;; (when (and (eq (car (car all)) 'bof)
;;; (not (file-regular-p (nth 1 (car all)))))
-;;; (message "File %s in saved parse info not avalable" (cdr (car all)))
+;;; (message "File %s in saved parse info not available" (cdr (car all)))
;;; (error "File not found"))
;;; (setq all (cdr all))))
)
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index c421304442..f57429c76c 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -593,6 +593,13 @@ to build the Fixes: header.")
(put 'log-edit-rewrite-fixes 'safe-local-variable
(lambda (v) (and (stringp (car-safe v)) (stringp (cdr v)))))
+(defun log-edit-add-field (field value)
+ (rfc822-goto-eoh)
+ (if (save-excursion (re-search-backward (concat "^" field ":\\([ \t]*\\)$")
+ nil t))
+ (replace-match (concat " " value) t t nil 1)
+ (insert field ": " value "\n" (if (looking-at "\n") "" "\n"))))
+
(defun log-edit-insert-changelog (&optional use-first)
"Insert a log message by looking at the ChangeLog.
The idea is to write your ChangeLog entries first, and then use this
@@ -620,9 +627,7 @@ regardless of user name or time."
(log-edit-insert-changelog-entries (log-edit-files)))))
(log-edit-set-common-indentation)
;; Add an Author: field if appropriate.
- (when author
- (rfc822-goto-eoh)
- (insert "Author: " author "\n" (if (looking-at "\n") "" "\n")))
+ (when author (log-edit-add-field "Author" author))
;; Add a Fixes: field if applicable.
(when (consp log-edit-rewrite-fixes)
(rfc822-goto-eoh)
@@ -632,8 +637,7 @@ regardless of user name or time."
(fixes (match-substitute-replacement
(cdr log-edit-rewrite-fixes))))
(delete-region start end)
- (rfc822-goto-eoh)
- (insert "Fixes: " fixes "\n" (if (looking-at "\n") "" "\n")))))
+ (log-edit-add-field "Fixes" fixes))))
(and log-edit-strip-single-file-name
(progn (rfc822-goto-eoh)
(if (looking-at "\n") (forward-char 1))
diff --git a/nt/ChangeLog b/nt/ChangeLog
index fb3a168ebf..08fd767707 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,12 @@
+2011-10-25 Eli Zaretskii <[email protected]>
+
+ * makefile.w32-in (dist): Don't put the top-level INSTALL into the
+ distribution. (Bug#9861)
+
+2011-10-25 Christoph Scholtes <[email protected]>
+
+ * INSTALL: Update URL for GTK download page.
+
2011-10-19 Eli Zaretskii <[email protected]>
* config.nt (HAVE_TZNAME, HAVE_DECL_TZNAME): Define.
diff --git a/nt/INSTALL b/nt/INSTALL
index b4a9701192..613610890a 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -323,7 +323,7 @@
For PNG images, we recommend to use versions 1.4.x and later of
libpng, because previous versions had security issues. You can find
precompiled libraries and headers on the GTK download page for
- Windows (http://www.gtk.org/download-windows.html).
+ Windows (http://www.gtk.org/download/win32.php).
Versions 1.4.0 and later of libpng are binary incompatible with
earlier versions, so Emacs will only look for libpng libraries which
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
index 4e4e6eccbb..07d9be2c11 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -263,7 +263,6 @@ dist: install-bin
$(CP) "$(INSTALL_DIR)/COPYING" $(TMP_DIST_DIR)
$(CP) "$(INSTALL_DIR)/README" $(TMP_DIST_DIR)
$(CP) "$(INSTALL_DIR)/README.W32" $(TMP_DIST_DIR)
- $(CP) "$(INSTALL_DIR)/INSTALL" $(TMP_DIST_DIR)
$(CP_DIR) "$(INSTALL_DIR)/bin" $(TMP_DIST_DIR)
$(CP_DIR) "$(INSTALL_DIR)/etc" $(TMP_DIST_DIR)
$(CP_DIR) "$(INSTALL_DIR)/info" $(TMP_DIST_DIR)
diff --git a/src/ChangeLog b/src/ChangeLog
index 3f9b5beeab..50fc953024 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,86 @@
+2011-10-28 Stefan Monnier <[email protected]>
+
+ * lisp.h (struct Lisp_Symbol): Update comments.
+
+2011-10-28 Juanma Barranquero <[email protected]>
+
+ * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
+
+2011-10-28 Eli Zaretskii <[email protected]>
+
+ Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
+ <[email protected]> for helping to debug this.
+
+ * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
+ (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
+ (g_b_init_get_glyph_outline_w): New static variables.
+ (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
+ (GetGlyphOutlineW_Proc): New typedefs.
+ (w32_load_unicows_or_gdi32, get_outline_metrics_w)
+ (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
+ New functions.
+ (w32font_open_internal, compute_metrics):
+ Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
+ instead of calling the "wide" APIs directly.
+
+ * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
+
+ * w32.h (syms_of_w32font): Add prototype.
+
+2011-10-27 Juanma Barranquero <[email protected]>
+
+ * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
+ (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
+ (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
+ (Fmove_to_window_line): Doc fix.
+
+2011-10-27 Chong Yidong <[email protected]>
+
+ * process.c (make_process): Set gnutls_state to NULL.
+
+ * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
+ non-NULL, regardless of GNUTLS_INITSTAGE.
+ (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
+ an error. Set process slots as soon as we allocate them.
+
+ * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
+
+2011-10-27 Chong Yidong <[email protected]>
+
+ * gnutls.c (emacs_gnutls_deinit): New function.
+ Deallocate credentials structures as well as calling gnutls_deinit.
+ (Fgnutls_deinit, Fgnutls_boot): Use it.
+
+ * process.c (make_process): Initialize GnuTLS credentials to NULL.
+ (deactivate_process): Call emacs_gnutls_deinit.
+
+2011-10-27 Juanma Barranquero <[email protected]>
+
+ * image.c (x_create_x_image_and_pixmap):
+ * w32.c (sys_rename, w32_delayed_load):
+ * w32font.c (fill_in_logfont):
+ * w32reg.c (x_get_string_resource): Silence compiler warnings.
+
+2011-10-26 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (w32_default_color_map): New function,
+ extracted from Fw32_default_color_map.
+ (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
+
+2011-10-25 Paul Eggert <[email protected]>
+
+ * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
+
+2011-10-25 Stefan Monnier <[email protected]>
+
+ * keyboard.c (test_undefined): New function (bug#9751).
+ (read_key_sequence): Use it to detect when a key is bound to `undefined'.
+
+2011-10-25 Enami Tsugutomo <[email protected]>
+
+ * sysdep.c (init_sys_modes): Fix the check for the controlling
+ terminal (Bug#6649).
+
2011-10-20 Eli Zaretskii <[email protected]>
* dispextern.h (struct bidi_it): New member next_en_type.
diff --git a/src/dispextern.h b/src/dispextern.h
index dd5f67d2d1..5c60a5499d 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3346,6 +3346,7 @@ extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, un
extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
extern struct terminal *get_named_tty (const char *);
EXFUN (Ftty_type, 1);
+EXFUN (Fcontrolling_tty_p, 1);
extern void create_tty_output (struct frame *);
extern struct terminal *init_tty (const char *, const char *, int);
extern void tty_append_glyph (struct it *);
diff --git a/src/emacs.c b/src/emacs.c
index 073156bb0c..12be7bc080 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1591,6 +1591,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
/* Initialization that must be done even if the global variable
initialized is non zero. */
#ifdef HAVE_NTGUI
+ globals_of_w32font ();
globals_of_w32fns ();
globals_of_w32menu ();
globals_of_w32select ();
diff --git a/src/gnutls.c b/src/gnutls.c
index 0743ef3f4e..500f09432b 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -464,6 +464,44 @@ gnutls_make_error (int err)
return make_number (err);
}
+Lisp_Object
+emacs_gnutls_deinit (Lisp_Object proc)
+{
+ int log_level;
+
+ CHECK_PROCESS (proc);
+
+ if (XPROCESS (proc)->gnutls_p == 0)
+ return Qnil;
+
+ log_level = XPROCESS (proc)->gnutls_log_level;
+
+ if (XPROCESS (proc)->gnutls_x509_cred)
+ {
+ GNUTLS_LOG (2, log_level, "Deallocating x509 credentials");
+ fn_gnutls_certificate_free_credentials (XPROCESS (proc)->gnutls_x509_cred);
+ XPROCESS (proc)->gnutls_x509_cred = NULL;
+ }
+
+ if (XPROCESS (proc)->gnutls_anon_cred)
+ {
+ GNUTLS_LOG (2, log_level, "Deallocating anon credentials");
+ fn_gnutls_anon_free_client_credentials (XPROCESS (proc)->gnutls_anon_cred);
+ XPROCESS (proc)->gnutls_anon_cred = NULL;
+ }
+
+ if (XPROCESS (proc)->gnutls_state)
+ {
+ fn_gnutls_deinit (XPROCESS (proc)->gnutls_state);
+ XPROCESS (proc)->gnutls_state = NULL;
+ if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT)
+ GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_INIT - 1;
+ }
+
+ XPROCESS (proc)->gnutls_p = 0;
+ return Qt;
+}
+
DEFUN ("gnutls-get-initstage", Fgnutls_get_initstage, Sgnutls_get_initstage, 1, 1, 0,
doc: /* Return the GnuTLS init stage of process PROC.
See also `gnutls-boot'. */)
@@ -551,18 +589,7 @@ DEFUN ("gnutls-deinit", Fgnutls_deinit, Sgnutls_deinit, 1, 1, 0,
See also `gnutls-init'. */)
(Lisp_Object proc)
{
- gnutls_session_t state;
-
- CHECK_PROCESS (proc);
- state = XPROCESS (proc)->gnutls_state;
-
- if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT)
- {
- fn_gnutls_deinit (state);
- GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_INIT - 1;
- }
-
- return Qt;
+ return emacs_gnutls_deinit (proc);
}
DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
@@ -622,7 +649,7 @@ emacs_gnutls_global_deinit (void)
DEFUN ("gnutls-boot", Fgnutls_boot, Sgnutls_boot, 3, 3, 0,
doc: /* Initialize GnuTLS client for process PROC with TYPE+PROPLIST.
-Currently only client mode is supported. Returns a success/failure
+Currently only client mode is supported. Return a success/failure
value you can check with `gnutls-errorp'.
TYPE is a symbol, either `gnutls-anon' or `gnutls-x509pki'.
@@ -673,23 +700,13 @@ one trustfile (usually a CA bundle). */)
(Lisp_Object proc, Lisp_Object type, Lisp_Object proplist)
{
int ret = GNUTLS_E_SUCCESS;
-
int max_log_level = 0;
- /* TODO: GNUTLS_X509_FMT_DER is also an option. */
- int file_format = GNUTLS_X509_FMT_PEM;
-
- unsigned int gnutls_verify_flags = GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT;
- gnutls_x509_crt_t gnutls_verify_cert;
- unsigned int gnutls_verify_cert_list_size;
- const gnutls_datum_t *gnutls_verify_cert_list;
-
gnutls_session_t state;
- gnutls_certificate_credentials_t x509_cred;
- gnutls_anon_client_credentials_t anon_cred;
+ gnutls_certificate_credentials_t x509_cred = NULL;
+ gnutls_anon_client_credentials_t anon_cred = NULL;
Lisp_Object global_init;
char const *priority_string_ptr = "NORMAL"; /* default priority string. */
- Lisp_Object tail;
unsigned int peer_verification;
char* c_hostname;
@@ -701,7 +718,6 @@ one trustfile (usually a CA bundle). */)
/* Lisp_Object callbacks; */
Lisp_Object loglevel;
Lisp_Object hostname;
- Lisp_Object verify_flags;
/* Lisp_Object verify_error; */
Lisp_Object verify_hostname_error;
Lisp_Object prime_bits;
@@ -716,26 +732,25 @@ one trustfile (usually a CA bundle). */)
return gnutls_make_error (GNUTLS_EMACS_ERROR_NOT_LOADED);
}
+ if (!EQ (type, Qgnutls_x509pki) && !EQ (type, Qgnutls_anon))
+ {
+ error ("Invalid GnuTLS credential type");
+ return gnutls_make_error (GNUTLS_EMACS_ERROR_INVALID_TYPE);
+ }
+
hostname = Fplist_get (proplist, QCgnutls_bootprop_hostname);
priority_string = Fplist_get (proplist, QCgnutls_bootprop_priority);
trustfiles = Fplist_get (proplist, QCgnutls_bootprop_trustfiles);
keylist = Fplist_get (proplist, QCgnutls_bootprop_keylist);
crlfiles = Fplist_get (proplist, QCgnutls_bootprop_crlfiles);
- /* callbacks = Fplist_get (proplist, QCgnutls_bootprop_callbacks); */
loglevel = Fplist_get (proplist, QCgnutls_bootprop_loglevel);
- verify_flags = Fplist_get (proplist, QCgnutls_bootprop_verify_flags);
- /* verify_error = Fplist_get (proplist, QCgnutls_bootprop_verify_error); */
verify_hostname_error = Fplist_get (proplist, QCgnutls_bootprop_verify_hostname_error);
prime_bits = Fplist_get (proplist, QCgnutls_bootprop_min_prime_bits);
if (!STRINGP (hostname))
error ("gnutls-boot: invalid :hostname parameter");
-
c_hostname = SSDATA (hostname);
- state = XPROCESS (proc)->gnutls_state;
- XPROCESS (proc)->gnutls_p = 1;
-
if (NUMBERP (loglevel))
{
fn_gnutls_global_set_log_function (gnutls_log_function);
@@ -749,82 +764,56 @@ one trustfile (usually a CA bundle). */)
if (! NILP (Fgnutls_errorp (global_init)))
return global_init;
- /* deinit and free resources. */
- if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_CRED_ALLOC)
- {
- GNUTLS_LOG (1, max_log_level, "deallocating credentials");
-
- if (EQ (type, Qgnutls_x509pki))
- {
- GNUTLS_LOG (2, max_log_level, "deallocating x509 credentials");
- x509_cred = XPROCESS (proc)->gnutls_x509_cred;
- fn_gnutls_certificate_free_credentials (x509_cred);
- }
- else if (EQ (type, Qgnutls_anon))
- {
- GNUTLS_LOG (2, max_log_level, "deallocating anon credentials");
- anon_cred = XPROCESS (proc)->gnutls_anon_cred;
- fn_gnutls_anon_free_client_credentials (anon_cred);
- }
- else
- {
- error ("unknown credential type");
- ret = GNUTLS_EMACS_ERROR_INVALID_TYPE;
- }
-
- if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT)
- {
- GNUTLS_LOG (1, max_log_level, "deallocating x509 credentials");
- Fgnutls_deinit (proc);
- }
- }
+ /* Before allocating new credentials, deallocate any credentials
+ that PROC might already have. */
+ emacs_gnutls_deinit (proc);
+ /* Mark PROC as a GnuTLS process. */
+ XPROCESS (proc)->gnutls_p = 1;
+ XPROCESS (proc)->gnutls_state = NULL;
+ XPROCESS (proc)->gnutls_x509_cred = NULL;
+ XPROCESS (proc)->gnutls_anon_cred = NULL;
+ XPROCESS (proc)->gnutls_cred_type = type;
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY;
GNUTLS_LOG (1, max_log_level, "allocating credentials");
-
if (EQ (type, Qgnutls_x509pki))
{
+ Lisp_Object verify_flags;
+ unsigned int gnutls_verify_flags = GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT;
+
GNUTLS_LOG (2, max_log_level, "allocating x509 credentials");
- x509_cred = XPROCESS (proc)->gnutls_x509_cred;
fn_gnutls_certificate_allocate_credentials (&x509_cred);
+ XPROCESS (proc)->gnutls_x509_cred = x509_cred;
+ verify_flags = Fplist_get (proplist, QCgnutls_bootprop_verify_flags);
if (NUMBERP (verify_flags))
{
gnutls_verify_flags = XINT (verify_flags);
GNUTLS_LOG (2, max_log_level, "setting verification flags");
}
else if (NILP (verify_flags))
- {
- /* The default is already GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT. */
- GNUTLS_LOG (2, max_log_level, "using default verification flags");
- }
+ GNUTLS_LOG (2, max_log_level, "using default verification flags");
else
- {
- /* The default is already GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT. */
- GNUTLS_LOG (2, max_log_level, "ignoring invalid verify-flags");
- }
+ GNUTLS_LOG (2, max_log_level, "ignoring invalid verify-flags");
+
fn_gnutls_certificate_set_verify_flags (x509_cred, gnutls_verify_flags);
}
- else if (EQ (type, Qgnutls_anon))
+ else /* Qgnutls_anon: */
{
GNUTLS_LOG (2, max_log_level, "allocating anon credentials");
- anon_cred = XPROCESS (proc)->gnutls_anon_cred;
fn_gnutls_anon_allocate_client_credentials (&anon_cred);
- }
- else
- {
- error ("unknown credential type");
- ret = GNUTLS_EMACS_ERROR_INVALID_TYPE;
+ XPROCESS (proc)->gnutls_anon_cred = anon_cred;
}
- if (ret < GNUTLS_E_SUCCESS)
- return gnutls_make_error (ret);
-
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_CRED_ALLOC;
if (EQ (type, Qgnutls_x509pki))
{
+ /* TODO: GNUTLS_X509_FMT_DER is also an option. */
+ int file_format = GNUTLS_X509_FMT_PEM;
+ Lisp_Object tail;
+
for (tail = trustfiles; !NILP (tail); tail = Fcdr (tail))
{
Lisp_Object trustfile = Fcar (tail);
@@ -842,8 +831,8 @@ one trustfile (usually a CA bundle). */)
}
else
{
- error ("Sorry, GnuTLS can't use non-string trustfile %s",
- SDATA (trustfile));
+ emacs_gnutls_deinit (proc);
+ error ("Invalid trustfile");
}
}
@@ -855,17 +844,15 @@ one trustfile (usually a CA bundle). */)
GNUTLS_LOG2 (1, max_log_level, "setting the CRL file: ",
SSDATA (crlfile));
ret = fn_gnutls_certificate_set_x509_crl_file
- (x509_cred,
- SSDATA (crlfile),
- file_format);
+ (x509_cred, SSDATA (crlfile), file_format);
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
}
else
{
- error ("Sorry, GnuTLS can't use non-string CRL file %s",
- SDATA (crlfile));
+ emacs_gnutls_deinit (proc);
+ error ("Invalid CRL file");
}
}
@@ -880,45 +867,31 @@ one trustfile (usually a CA bundle). */)
GNUTLS_LOG2 (1, max_log_level, "setting the client cert file: ",
SSDATA (certfile));
ret = fn_gnutls_certificate_set_x509_key_file
- (x509_cred,
- SSDATA (certfile),
- SSDATA (keyfile),
- file_format);
+ (x509_cred, SSDATA (certfile), SSDATA (keyfile), file_format);
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
}
else
{
- if (STRINGP (keyfile))
- error ("Sorry, GnuTLS can't use non-string client cert file %s",
- SDATA (certfile));
- else
- error ("Sorry, GnuTLS can't use non-string client key file %s",
- SDATA (keyfile));
+ emacs_gnutls_deinit (proc);
+ error (STRINGP (keyfile) ? "Invalid client cert file"
+ : "Invalid client key file");
}
}
}
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_FILES;
-
GNUTLS_LOG (1, max_log_level, "gnutls callbacks");
-
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_CALLBACKS;
-#ifdef HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY
-#else
-#endif
+ /* Call gnutls_init here: */
GNUTLS_LOG (1, max_log_level, "gnutls_init");
-
ret = fn_gnutls_init (&state, GNUTLS_CLIENT);
-
+ XPROCESS (proc)->gnutls_state = state;
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
-
- XPROCESS (proc)->gnutls_state = state;
-
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_INIT;
if (STRINGP (priority_string))
@@ -934,46 +907,25 @@ one trustfile (usually a CA bundle). */)
}
GNUTLS_LOG (1, max_log_level, "setting the priority string");
-
ret = fn_gnutls_priority_set_direct (state,
priority_string_ptr,
NULL);
-
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_PRIORITY;
- if (!EQ (prime_bits, Qnil))
- {
- fn_gnutls_dh_set_prime_bits (state, XUINT (prime_bits));
- }
-
- if (EQ (type, Qgnutls_x509pki))
- {
- ret = fn_gnutls_credentials_set (state, GNUTLS_CRD_CERTIFICATE, x509_cred);
- }
- else if (EQ (type, Qgnutls_anon))
- {
- ret = fn_gnutls_credentials_set (state, GNUTLS_CRD_ANON, anon_cred);
- }
- else
- {
- error ("unknown credential type");
- ret = GNUTLS_EMACS_ERROR_INVALID_TYPE;
- }
+ if (INTEGERP (prime_bits))
+ fn_gnutls_dh_set_prime_bits (state, XUINT (prime_bits));
+ ret = EQ (type, Qgnutls_x509pki)
+ ? fn_gnutls_credentials_set (state, GNUTLS_CRD_CERTIFICATE, x509_cred)
+ : fn_gnutls_credentials_set (state, GNUTLS_CRD_ANON, anon_cred);
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
- XPROCESS (proc)->gnutls_anon_cred = anon_cred;
- XPROCESS (proc)->gnutls_x509_cred = x509_cred;
- XPROCESS (proc)->gnutls_cred_type = type;
-
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_CRED_SET;
-
ret = emacs_gnutls_handshake (XPROCESS (proc));
-
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
@@ -984,69 +936,71 @@ one trustfile (usually a CA bundle). */)
gnutls_x509_crt_check_hostname() against :hostname. */
ret = fn_gnutls_certificate_verify_peers2 (state, &peer_verification);
-
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
if (XINT (loglevel) > 0 && peer_verification & GNUTLS_CERT_INVALID)
- message ("%s certificate could not be verified.",
- c_hostname);
-
- if (peer_verification & GNUTLS_CERT_REVOKED)
- GNUTLS_LOG2 (1, max_log_level, "certificate was revoked (CRL):",
- c_hostname);
-
- if (peer_verification & GNUTLS_CERT_SIGNER_NOT_FOUND)
- GNUTLS_LOG2 (1, max_log_level, "certificate signer was not found:",
- c_hostname);
-
- if (peer_verification & GNUTLS_CERT_SIGNER_NOT_CA)
- GNUTLS_LOG2 (1, max_log_level, "certificate signer is not a CA:",
- c_hostname);
-
- if (peer_verification & GNUTLS_CERT_INSECURE_ALGORITHM)
- GNUTLS_LOG2 (1, max_log_level,
- "certificate was signed with an insecure algorithm:",
- c_hostname);
-
- if (peer_verification & GNUTLS_CERT_NOT_ACTIVATED)
- GNUTLS_LOG2 (1, max_log_level, "certificate is not yet activated:",
- c_hostname);
-
- if (peer_verification & GNUTLS_CERT_EXPIRED)
- GNUTLS_LOG2 (1, max_log_level, "certificate has expired:",
- c_hostname);
-
- if (peer_verification != 0)
- {
- if (NILP (verify_hostname_error))
- {
- GNUTLS_LOG2 (1, max_log_level, "certificate validation failed:",
- c_hostname);
- }
- else
- {
- error ("Certificate validation failed %s, verification code %d",
- c_hostname, peer_verification);
- }
- }
+ message ("%s certificate could not be verified.", c_hostname);
+
+ if (peer_verification & GNUTLS_CERT_REVOKED)
+ GNUTLS_LOG2 (1, max_log_level, "certificate was revoked (CRL):",
+ c_hostname);
+
+ if (peer_verification & GNUTLS_CERT_SIGNER_NOT_FOUND)
+ GNUTLS_LOG2 (1, max_log_level, "certificate signer was not found:",
+ c_hostname);
+
+ if (peer_verification & GNUTLS_CERT_SIGNER_NOT_CA)
+ GNUTLS_LOG2 (1, max_log_level, "certificate signer is not a CA:",
+ c_hostname);
+
+ if (peer_verification & GNUTLS_CERT_INSECURE_ALGORITHM)
+ GNUTLS_LOG2 (1, max_log_level,
+ "certificate was signed with an insecure algorithm:",
+ c_hostname);
+
+ if (peer_verification & GNUTLS_CERT_NOT_ACTIVATED)
+ GNUTLS_LOG2 (1, max_log_level, "certificate is not yet activated:",
+ c_hostname);
+
+ if (peer_verification & GNUTLS_CERT_EXPIRED)
+ GNUTLS_LOG2 (1, max_log_level, "certificate has expired:",
+ c_hostname);
+
+ if (peer_verification != 0)
+ {
+ if (NILP (verify_hostname_error))
+ GNUTLS_LOG2 (1, max_log_level, "certificate validation failed:",
+ c_hostname);
+ else
+ {
+ emacs_gnutls_deinit (proc);
+ error ("Certificate validation failed %s, verification code %d",
+ c_hostname, peer_verification);
+ }
+ }
/* Up to here the process is the same for X.509 certificates and
OpenPGP keys. From now on X.509 certificates are assumed. This
can be easily extended to work with openpgp keys as well. */
if (fn_gnutls_certificate_type_get (state) == GNUTLS_CRT_X509)
{
- ret = fn_gnutls_x509_crt_init (&gnutls_verify_cert);
+ gnutls_x509_crt_t gnutls_verify_cert;
+ const gnutls_datum_t *gnutls_verify_cert_list;
+ unsigned int gnutls_verify_cert_list_size;
+ ret = fn_gnutls_x509_crt_init (&gnutls_verify_cert);
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
gnutls_verify_cert_list =
fn_gnutls_certificate_get_peers (state, &gnutls_verify_cert_list_size);
- if (NULL == gnutls_verify_cert_list)
+ if (gnutls_verify_cert_list == NULL)
{
- error ("No x509 certificate was found!\n");
+ fn_gnutls_x509_crt_deinit (gnutls_verify_cert);
+ emacs_gnutls_deinit (proc);
+ error ("No x509 certificate was found\n");
}
/* We only check the first certificate in the given chain. */
@@ -1063,18 +1017,15 @@ one trustfile (usually a CA bundle). */)
if (!fn_gnutls_x509_crt_check_hostname (gnutls_verify_cert, c_hostname))
{
if (NILP (verify_hostname_error))
- {
- GNUTLS_LOG2 (1, max_log_level, "x509 certificate does not match:",
- c_hostname);
- }
+ GNUTLS_LOG2 (1, max_log_level, "x509 certificate does not match:",
+ c_hostname);
else
{
fn_gnutls_x509_crt_deinit (gnutls_verify_cert);
- error ("The x509 certificate does not match \"%s\"",
- c_hostname);
+ emacs_gnutls_deinit (proc);
+ error ("The x509 certificate does not match \"%s\"", c_hostname);
}
}
-
fn_gnutls_x509_crt_deinit (gnutls_verify_cert);
}
diff --git a/src/gnutls.h b/src/gnutls.h
index e2a9bc9eae..076e9fdba9 100644
--- a/src/gnutls.h
+++ b/src/gnutls.h
@@ -49,9 +49,9 @@ typedef enum
#define GNUTLS_PROCESS_USABLE(proc) (GNUTLS_INITSTAGE(proc) >= GNUTLS_STAGE_READY)
-#define GNUTLS_LOG(level, max, string) if (level <= max) { gnutls_log_function (level, "(Emacs) " string); }
+#define GNUTLS_LOG(level, max, string) do { if (level <= max) { gnutls_log_function (level, "(Emacs) " string); } } while (0)
-#define GNUTLS_LOG2(level, max, string, extra) if (level <= max) { gnutls_log_function2 (level, "(Emacs) " string, extra); }
+#define GNUTLS_LOG2(level, max, string, extra) do { if (level <= max) { gnutls_log_function2 (level, "(Emacs) " string, extra); } } while (0)
extern EMACS_INT
emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte);
@@ -60,6 +60,7 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, EMACS_INT nbyte);
extern int emacs_gnutls_record_check_pending (gnutls_session_t state);
extern void emacs_gnutls_transport_set_errno (gnutls_session_t state, int err);
+extern Lisp_Object emacs_gnutls_deinit (Lisp_Object);
extern void syms_of_gnutls (void);
diff --git a/src/image.c b/src/image.c
index ef72745a72..14c74f1060 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2015,7 +2015,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
/* Bitmaps with a depth less than 16 need a palette. */
/* BITMAPINFO structure already contains the first RGBQUAD. */
if (depth < 16)
- palette_colors = 1 << depth - 1;
+ palette_colors = 1 << (depth - 1);
*ximg = xmalloc (sizeof (XImage) + palette_colors * sizeof (RGBQUAD));
diff --git a/src/intervals.c b/src/intervals.c
index 2063655cdb..1f3f8cf793 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1723,8 +1723,6 @@ graft_intervals_into_buffer (INTERVAL source, EMACS_INT position,
BUF_INTERVALS (buffer)->position = BEG;
BUF_INTERVALS (buffer)->up_obj = 1;
- /* Explicitly free the old tree here? */
-
return;
}
diff --git a/src/keyboard.c b/src/keyboard.c
index 6f3bfd8c1e..95604550c8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -73,7 +73,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "nsterm.h"
#endif
-/* Variables for blockinput.h: */
+/* Variables for blockinput.h: */
/* Non-zero if interrupt input is blocked right now. */
volatile int interrupt_input_blocked;
@@ -338,7 +338,7 @@ static Lisp_Object Qconfig_changed_event;
Lisp_Object Qevent_kind;
static Lisp_Object Qevent_symbol_elements;
-/* menu and tool bar item parts */
+/* Menu and tool bar item parts. */
static Lisp_Object Qmenu_enable;
static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence;
Lisp_Object QCfilter;
@@ -835,7 +835,7 @@ recursive_edit_unwind (Lisp_Object buffer)
#if 0 /* These two functions are now replaced with
- temporarily_switch_to_single_kboard. */
+ temporarily_switch_to_single_kboard. */
static void
any_kboard_state ()
{
@@ -1038,7 +1038,7 @@ cmd_error (Lisp_Object data)
Vquit_flag = Qnil;
Vinhibit_quit = Qnil;
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
+#if 0 /* This shouldn't be necessary anymore. --lorentey */
if (command_loop_level == 0 && minibuf_level == 0)
any_kboard_state ();
#endif
@@ -1131,7 +1131,7 @@ command_loop (void)
#if 0 /* This shouldn't be necessary anymore. --lorentey */
/* Reset single_kboard in case top-level set it while
evaluating an -f option, or we are stuck there for some
- other reason. */
+ other reason. */
any_kboard_state ();
#endif
internal_catch (Qtop_level, command_loop_2, Qnil);
@@ -1492,8 +1492,8 @@ command_loop_1 (void)
if (!NILP (Vquit_flag))
{
Vexecuting_kbd_macro = Qt;
- QUIT; /* Make some noise. */
- /* Will return since macro now empty. */
+ QUIT; /* Make some noise. */
+ /* Will return since macro now empty. */
}
}
@@ -1512,7 +1512,7 @@ command_loop_1 (void)
Vdisable_point_adjustment = Qnil;
/* Process filters and timers may have messed with deactivate-mark.
- reset it before we execute the command. */
+ reset it before we execute the command. */
Vdeactivate_mark = Qnil;
/* Remap command through active keymaps. */
@@ -1552,7 +1552,7 @@ command_loop_1 (void)
}
else
{
- /* Here for a command that isn't executed directly */
+ /* Here for a command that isn't executed directly. */
#ifdef HAVE_WINDOW_SYSTEM
int scount = SPECPDL_INDEX ();
@@ -1960,7 +1960,7 @@ void
poll_for_input_1 (void)
{
/* Tell ns_read_socket() it is being called asynchronously so it can avoid
- doing anything dangerous. */
+ doing anything dangerous. */
#ifdef HAVE_NS
++handling_signal;
#endif
@@ -2000,7 +2000,7 @@ start_polling (void)
#ifdef POLL_FOR_INPUT
/* XXX This condition was (read_socket_hook && !interrupt_input),
but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
+ it's always set. */
if (!interrupt_input)
{
/* Turn alarm handling on unconditionally. It might have
@@ -2037,7 +2037,7 @@ input_polling_used (void)
#ifdef POLL_FOR_INPUT
/* XXX This condition was (read_socket_hook && !interrupt_input),
but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
+ it's always set. */
return !interrupt_input;
#else
return 0;
@@ -2052,7 +2052,7 @@ stop_polling (void)
#ifdef POLL_FOR_INPUT
/* XXX This condition was (read_socket_hook && !interrupt_input),
but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
+ it's always set. */
if (!interrupt_input)
++poll_suppress_count;
#endif
@@ -2390,7 +2390,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
real event came from. Normally, a switch-frame event selects
internal_last_event_frame after each command is read, but
events read from a macro should never cause a new frame to be
- selected. */
+ selected. */
Vlast_event_frame = internal_last_event_frame = Qmacro;
/* Exit the macro if we are at the end.
@@ -2500,7 +2500,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
Try this before the sit-for, because the sit-for
would do the wrong thing if we are supposed to do
menu prompting. If EVENT_HAS_PARAMETERS then we are reading
- after a mouse event so don't try a minibuf menu. */
+ after a mouse event so don't try a minibuf menu. */
c = Qnil;
if (nmaps > 0 && INTERACTIVE
&& !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event)
@@ -4980,8 +4980,8 @@ static const char *const lispy_function_keys[] =
"break", /* 0xff6b */
0, 0, 0, 0,
- 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */
- 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */
+ 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */
+ 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */
"kp-space", /* 0xff80 */ /* IsKeypadKey */
0, 0, 0, 0, 0, 0, 0, 0,
"kp-tab", /* 0xff89 */
@@ -5093,14 +5093,14 @@ static Lisp_Object *const scroll_bar_parts[] = {
static Lisp_Object button_down_location;
/* Information about the most recent up-going button event: Which
- button, what location, and what time. */
+ button, what location, and what time. */
static int last_mouse_button;
static int last_mouse_x;
static int last_mouse_y;
static Time button_down_time;
-/* The number of clicks in this multiple-click. */
+/* The number of clicks in this multiple-click. */
static int double_click_count;
@@ -5344,7 +5344,7 @@ make_lispy_event (struct input_event *event)
#ifdef HAVE_NS
/* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs,
- except that they are non-key events (last-nonmenu-event is nil). */
+ except that they are non-key events (last-nonmenu-event is nil). */
case NS_NONKEY_EVENT:
#endif
@@ -5830,7 +5830,7 @@ make_lispy_event (struct input_event *event)
Fcons (make_number (event->timestamp),
Fcons (part, Qnil)))));
- /* Always treat scroll bar events as clicks. */
+ /* Always treat scroll bar events as clicks. */
event->modifiers |= click_modifier;
event->modifiers &= ~up_modifier;
@@ -6694,7 +6694,7 @@ lucid_event_type_list_p (Lisp_Object object)
If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal
events (FOCUS_IN_EVENT).
If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse
- movements and toolkit scroll bar thumb drags. */
+ movements and toolkit scroll bar thumb drags. */
static void
get_input_pending (int *addr, int flags)
@@ -6728,7 +6728,7 @@ gobble_input (int expected)
#ifdef POLL_FOR_INPUT
/* XXX This condition was (read_socket_hook && !interrupt_input),
but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
+ it's always set. */
if (!interrupt_input && poll_suppress_count == 0)
{
SIGMASKTYPE mask;
@@ -6803,7 +6803,7 @@ read_avail_input (int expected)
if (store_user_signal_events ())
expected = 0;
- /* Loop through the available terminals, and call their input hooks. */
+ /* Loop through the available terminals, and call their input hooks. */
t = terminal_list;
while (t)
{
@@ -6824,15 +6824,15 @@ read_avail_input (int expected)
expected = 0;
}
- if (nr == -1) /* Not OK to read input now. */
+ if (nr == -1) /* Not OK to read input now. */
{
err = 1;
}
- else if (nr == -2) /* Non-transient error. */
+ else if (nr == -2) /* Non-transient error. */
{
- /* The terminal device terminated; it should be closed. */
+ /* The terminal device terminated; it should be closed. */
- /* Kill Emacs if this was our last terminal. */
+ /* Kill Emacs if this was our last terminal. */
if (!terminal_list->next_terminal)
/* Formerly simply reported no input, but that
sometimes led to a failure of Emacs to terminate.
@@ -6844,7 +6844,7 @@ read_avail_input (int expected)
alone in its group. */
kill (getpid (), SIGHUP);
- /* XXX Is calling delete_terminal safe here? It calls delete_frame. */
+ /* XXX Is calling delete_terminal safe here? It calls delete_frame. */
{
Lisp_Object tmp;
XSETTERMINAL (tmp, t);
@@ -6934,7 +6934,7 @@ tty_read_avail_input (struct terminal *terminal,
return 0;
#endif /* subprocesses */
- if (!terminal->name) /* Don't read from a dead terminal. */
+ if (!terminal->name) /* Don't read from a dead terminal. */
return 0;
if (terminal->type != output_termcap
@@ -6942,15 +6942,15 @@ tty_read_avail_input (struct terminal *terminal,
abort ();
/* XXX I think the following code should be moved to separate hook
- functions in system-dependent files. */
+ functions in system-dependent files. */
#ifdef WINDOWSNT
return 0;
#else /* not WINDOWSNT */
- if (! tty->term_initted) /* In case we get called during bootstrap. */
+ if (! tty->term_initted) /* In case we get called during bootstrap. */
return 0;
if (! tty->input)
- return 0; /* The terminal is suspended. */
+ return 0; /* The terminal is suspended. */
#ifdef MSDOS
n_to_read = dos_keysns ();
@@ -6976,7 +6976,7 @@ tty_read_avail_input (struct terminal *terminal,
Gpm_GetEvent closes gpm_fd and clears it to -1, which is why
we save it in `fd' so close_gpm can remove it from the
select masks.
- gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */
+ gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */
while (gpm = Gpm_GetEvent (&event), gpm == 1) {
nread += handle_one_term_event (tty, &event, &gpm_hold_quit);
}
@@ -6996,7 +6996,7 @@ tty_read_avail_input (struct terminal *terminal,
if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0)
{
if (! noninteractive)
- return -2; /* Close this terminal. */
+ return -2; /* Close this terminal. */
else
n_to_read = 0;
}
@@ -7029,16 +7029,16 @@ tty_read_avail_input (struct terminal *terminal,
process group won't get SIGHUP's at logout time. BSDI adheres to
this part standard and returns -1 from read (0) with errno==EIO
when the control tty is taken away.
- Jeffrey Honig <[email protected]> says this is generally safe. */
+ Jeffrey Honig <[email protected]> says this is generally safe. */
if (nread == -1 && errno == EIO)
- return -2; /* Close this terminal. */
+ return -2; /* Close this terminal. */
#if defined (AIX) && defined (_BSD)
/* The kernel sometimes fails to deliver SIGHUP for ptys.
This looks incorrect, but it isn't, because _BSD causes
O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
and that causes a value other than 0 when there is no input. */
if (nread == 0)
- return -2; /* Close this terminal. */
+ return -2; /* Close this terminal. */
#endif
}
while (
@@ -7116,7 +7116,7 @@ tty_read_avail_input (struct terminal *terminal,
buf.code = cbuf[i];
/* Set the frame corresponding to the active tty. Note that the
value of selected_frame is not reliable here, redisplay tends
- to temporarily change it. */
+ to temporarily change it. */
buf.frame_or_window = tty->top_frame;
buf.arg = Qnil;
@@ -7139,7 +7139,7 @@ handle_async_input (void)
pending_signals = pending_atimers;
#endif
/* Tell ns_read_socket() it is being called asynchronously so it can avoid
- doing anything dangerous. */
+ doing anything dangerous. */
#ifdef HAVE_NS
++handling_signal;
#endif
@@ -7197,7 +7197,7 @@ input_available_signal (int signo)
This function exists so that the UNBLOCK_INPUT macro in
blockinput.h can have some way to take care of input we put off
dealing with, without assuming that every file which uses
- UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */
+ UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */
void
reinvoke_input_signal (void)
{
@@ -7224,7 +7224,7 @@ struct user_signal_info
struct user_signal_info *next;
};
-/* List of user signals. */
+/* List of user signals. */
static struct user_signal_info *user_signals = NULL;
void
@@ -7761,7 +7761,7 @@ parse_menu_item (Lisp_Object item, int inmenubar)
{
tem = XCAR (item);
if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem))
- /* Be GC protected. Set keyhint to item instead of tem. */
+ /* Be GC protected. Set keyhint to item instead of tem. */
keyhint = item;
}
else if (EQ (tem, QCkeys))
@@ -7844,7 +7844,7 @@ parse_menu_item (Lisp_Object item, int inmenubar)
if (inmenubar > 0)
return 1;
- { /* This is a command. See if there is an equivalent key binding. */
+ { /* This is a command. See if there is an equivalent key binding. */
Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
/* The previous code preferred :key-sequence to :keys, so we
@@ -8400,7 +8400,7 @@ append_tool_bar_item (void)
These are done in different ways, depending on how the input will be read.
Menus using X are done after auto-saving in read-char, getting the input
event from Fx_popup_menu; menus using the minibuf use read_char recursively
- and do auto-saving in the inner call of read_char. */
+ and do auto-saving in the inner call of read_char. */
static Lisp_Object
read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps,
@@ -8620,14 +8620,14 @@ read_char_minibuf_menu_prompt (int commandflag,
tem
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ];
if (!NILP (tem))
- /* Insert equivalent keybinding. */
+ /* Insert equivalent keybinding. */
s = concat2 (s, tem);
#endif
tem
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE];
if (EQ (tem, QCradio) || EQ (tem, QCtoggle))
{
- /* Insert button prefix. */
+ /* Insert button prefix. */
Lisp_Object selected
= XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED];
if (EQ (tem, QCradio))
@@ -8861,7 +8861,7 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
/* If keybuf[fkey->start..fkey->end] is bound in the
map and we're in a position to do the key remapping, replace it with
- the binding and restart with fkey->start at the end. */
+ the binding and restart with fkey->start at the end. */
if ((VECTORP (next) || STRINGP (next)) && doit)
{
int len = XFASTINT (Flength (next));
@@ -8902,6 +8902,14 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
return 0;
}
+static int
+test_undefined (Lisp_Object binding)
+{
+ return (EQ (binding, Qundefined)
+ || (!NILP (binding) && SYMBOLP (binding)
+ && EQ (Fcommand_remapping (binding, Qnil, Qnil), Qundefined)));
+}
+
/* Read a sequence of keys that ends with a non prefix character,
storing it in KEYBUF, a buffer of size BUFSIZE.
Prompt with PROMPT.
@@ -9017,7 +9025,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
/* Non-zero if we are trying to map a key by changing an upper-case
letter to lower case, or a shifted function key to an unshifted
- one. */
+ one. */
int shift_translated = 0;
/* If we receive a `switch-frame' or `select-window' event in the middle of
@@ -9025,7 +9033,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
While we're reading, we keep the event here. */
Lisp_Object delayed_switch_frame;
- /* See the comment below... */
+ /* See the comment below... */
#if defined (GOBBLE_FIRST_EVENT)
Lisp_Object first_event;
#endif
@@ -9300,7 +9308,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
if (!found)
{
/* Don't touch interrupted_kboard when it's been
- deleted. */
+ deleted. */
delayed_switch_frame = Qnil;
goto replay_entire_sequence;
}
@@ -9408,7 +9416,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
{
/* If we're at the beginning of a key sequence, and the caller
says it's okay, go ahead and return this event. If we're
- in the midst of a key sequence, delay it until the end. */
+ in the midst of a key sequence, delay it until the end. */
if (t > 0 || !can_return_switch_frame)
{
delayed_switch_frame = key;
@@ -9705,7 +9713,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
Down-clicks are eliminated.
Double-downs reduce to downs, then are eliminated.
Triple-downs reduce to double-downs, then to downs,
- then are eliminated. */
+ then are eliminated. */
if (modifiers & (down_modifier | drag_modifier
| double_modifier | triple_modifier))
{
@@ -9852,7 +9860,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
}
}
- if (first_binding < nmaps && NILP (submaps[first_binding])
+ if (first_binding < nmaps
+ && NILP (submaps[first_binding])
+ && !test_undefined (defs[first_binding])
&& indec.start >= t)
/* There is a binding and it's not a prefix.
(and it doesn't have any input-decode-map translation pending).
@@ -9879,7 +9889,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
/* If there's a binding (i.e.
first_binding >= nmaps) we don't want
to apply this function-key-mapping. */
- fkey.end + 1 == t && first_binding >= nmaps,
+ fkey.end + 1 == t
+ && (first_binding >= nmaps
+ || test_undefined (defs[first_binding])),
&diff, prompt);
UNGCPRO;
if (done)
@@ -10810,7 +10822,7 @@ set_waiting_for_input (struct timeval *time_to_clear)
waiting_for_input = 1;
/* If handle_interrupt was called before and buffered a C-g,
- make it run again now, to avoid timing error. */
+ make it run again now, to avoid timing error. */
if (!NILP (Vquit_flag))
quit_throw_to_read_char ();
}
@@ -10831,7 +10843,7 @@ clear_waiting_for_input (void)
static void
interrupt_signal (int signalnum) /* If we don't have an argument, some */
- /* compilers complain in signal calls. */
+ /* compilers complain in signal calls. */
{
/* Must preserve main program's value of errno. */
int old_errno = errno;
@@ -10839,12 +10851,12 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
SIGNAL_THREAD_CHECK (signalnum);
- /* See if we have an active terminal on our controlling tty. */
+ /* See if we have an active terminal on our controlling tty. */
terminal = get_named_tty ("/dev/tty");
if (!terminal)
{
/* If there are no frames there, let's pretend that we are a
- well-behaving UN*X program and quit. */
+ well-behaving UN*X program and quit. */
Fkill_emacs (Qnil);
}
else
@@ -10872,7 +10884,7 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
Otherwise it sets the Lisp variable quit-flag not-nil. This causes
eval to throw, when it gets a chance. If quit-flag is already
- non-nil, it stops the job right away. */
+ non-nil, it stops the job right away. */
static void
handle_interrupt (void)
@@ -10881,7 +10893,7 @@ handle_interrupt (void)
cancel_echoing ();
- /* XXX This code needs to be revised for multi-tty support. */
+ /* XXX This code needs to be revised for multi-tty support. */
if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty"))
{
/* If SIGINT isn't blocked, don't let us be interrupted by
@@ -10991,7 +11003,7 @@ handle_interrupt (void)
wait_reading_process_output() under HAVE_NS because of the call
to ns_select there (needed because otherwise events aren't picked up
outside of polling since we don't get SIGIO like X and we don't have a
- separate event loop thread like W32. */
+ separate event loop thread like W32. */
#ifndef HAVE_NS
if (waiting_for_input && !echoing)
quit_throw_to_read_char ();
@@ -11440,7 +11452,7 @@ init_keyboard (void)
session may have multiple display types, so we always handle
SIGINT. There is special code in interrupt_signal to exit
Emacs on SIGINT when there are no termcap frames on the
- controlling terminal. */
+ controlling terminal. */
signal (SIGINT, interrupt_signal);
#ifndef DOS_NT
/* For systems with SysV TERMIO, C-g is set up for both SIGINT and
@@ -12237,7 +12249,7 @@ Currently, the only supported values for this
variable are `sigusr1' and `sigusr2'. */);
Vdebug_on_event = intern_c_string ("sigusr2");
- /* Create the initial keyboard. */
+ /* Create the initial keyboard. */
initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
init_kboard (initial_kboard);
/* Vwindow_system is left at t for now. */
diff --git a/src/lisp.h b/src/lisp.h
index 1bbb5633fe..df8812f73b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -162,7 +162,7 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
/* First, try and define DECL_ALIGN(type,var) which declares a static
variable VAR of type TYPE with the added requirement that it be
- TYPEBITS-aligned. */
+ TYPEBITS-aligned. */
#ifndef NO_DECL_ALIGN
# ifndef DECL_ALIGN
# if HAVE_ATTRIBUTE_ALIGNED
@@ -1084,11 +1084,9 @@ enum symbol_redirect
SYMBOL_PLAINVAL = 4,
SYMBOL_VARALIAS = 1,
SYMBOL_LOCALIZED = 2,
- SYMBOL_FORWARDED = 3
+ SYMBOL_FORWARDED = 3
};
-/* In a symbol, the markbit of the plist is used as the gc mark bit */
-
struct Lisp_Symbol
{
unsigned gcmarkbit : 1;
@@ -1097,8 +1095,7 @@ struct Lisp_Symbol
0 : it's a plain var, the value is in the `value' field.
1 : it's a varalias, the value is really in the `alias' symbol.
2 : it's a localized var, the value is in the `blv' object.
- 3 : it's a forwarding variable, the value is in `forward'.
- */
+ 3 : it's a forwarding variable, the value is in `forward'. */
enum symbol_redirect redirect : 3;
/* Non-zero means symbol is constant, i.e. changing its value
@@ -1115,15 +1112,12 @@ struct Lisp_Symbol
unsigned declared_special : 1;
/* The symbol's name, as a Lisp string.
-
The name "xname" is used to intentionally break code referring to
the old field "name" of type pointer to struct Lisp_String. */
Lisp_Object xname;
- /* Value of the symbol or Qunbound if unbound. If this symbol is a
- defvaralias, `alias' contains the symbol for which it is an
- alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get
- and set a symbol's value, to take defvaralias into account. */
+ /* Value of the symbol or Qunbound if unbound. Which alternative of the
+ union is used depends on the `redirect' field above. */
union {
Lisp_Object value;
struct Lisp_Symbol *alias;
@@ -1318,7 +1312,7 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */
enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */
unsigned gcmarkbit : 1;
int spacer : 15;
- /* Make it as long as "Lisp_Free without padding". */
+ /* Make it as long as "Lisp_Free without padding". */
void *fill;
};
@@ -3603,7 +3597,7 @@ extern void init_system_name (void);
#define SWITCH_ENUM_CAST(x) (x)
-/* Use this to suppress gcc's warnings. */
+/* Use this to suppress gcc's warnings. */
#ifdef lint
/* Use CODE only if lint checking is in effect. */
diff --git a/src/process.c b/src/process.c
index 90ad9c2168..dc37ec5f96 100644
--- a/src/process.c
+++ b/src/process.c
@@ -642,6 +642,9 @@ make_process (Lisp_Object name)
p->gnutls_initstage = GNUTLS_STAGE_EMPTY;
p->gnutls_log_level = 0;
p->gnutls_p = 0;
+ p->gnutls_state = NULL;
+ p->gnutls_x509_cred = NULL;
+ p->gnutls_anon_cred = NULL;
#endif
/* If name is already in use, modify it until it is unused. */
@@ -3867,6 +3870,11 @@ deactivate_process (Lisp_Object proc)
register int inchannel, outchannel;
register struct Lisp_Process *p = XPROCESS (proc);
+#ifdef HAVE_GNUTLS
+ /* Delete GnuTLS structures in PROC, if any. */
+ emacs_gnutls_deinit (proc);
+#endif /* HAVE_GNUTLS */
+
inchannel = p->infd;
outchannel = p->outfd;
diff --git a/src/sysdep.c b/src/sysdep.c
index b0d5a1abbe..d666f8dbb7 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -854,6 +854,7 @@ void
init_sys_modes (struct tty_display_info *tty_out)
{
struct emacs_tty tty;
+ Lisp_Object terminal;
Vtty_erase_char = Qnil;
@@ -907,7 +908,9 @@ init_sys_modes (struct tty_display_info *tty_out)
tty.main.c_cflag &= ~PARENB;/* Don't check parity */
}
#endif
- if (tty_out->input == stdin)
+
+ XSETTERMINAL(terminal, tty_out->terminal);
+ if (!NILP (Fcontrolling_tty_p (terminal)))
{
tty.main.c_cc[VINTR] = quit_char; /* C-g (usually) gives SIGINT */
/* Set up C-g for both SIGQUIT and SIGINT.
diff --git a/src/w32.c b/src/w32.c
index 91893ddfc6..42546fc8d4 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -2892,12 +2892,12 @@ sys_rename (const char * oldname, const char * newname)
int i = 0;
oldname = map_w32_filename (oldname, NULL);
- if (o = strrchr (oldname, '\\'))
+ if ((o = strrchr (oldname, '\\')))
o++;
else
o = (char *) oldname;
- if (p = strrchr (temp, '\\'))
+ if ((p = strrchr (temp, '\\')))
p++;
else
p = temp;
@@ -5756,7 +5756,7 @@ w32_delayed_load (Lisp_Object libraries, Lisp_Object library_id)
for (dlls = XCDR (dlls); CONSP (dlls); dlls = XCDR (dlls))
{
CHECK_STRING_CAR (dlls);
- if (library_dll = LoadLibrary (SDATA (XCAR (dlls))))
+ if ((library_dll = LoadLibrary (SDATA (XCAR (dlls)))))
{
found = XCAR (dlls);
break;
diff --git a/src/w32.h b/src/w32.h
index f1915125c9..a3ca1130ce 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -139,6 +139,7 @@ extern void term_w32select (void);
extern void syms_of_w32menu (void);
extern void globals_of_w32menu (void);
extern void syms_of_fontset (void);
+extern void syms_of_w32font (void);
extern int _sys_read_ahead (int fd);
extern int _sys_wait_accept (int fd);
diff --git a/src/w32fns.c b/src/w32fns.c
index f48e5764b4..2ecd6e9153 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -635,9 +635,8 @@ colormap_t w32_color_map[] =
{"LightGreen" , PALETTERGB (144,238,144)},
};
-DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
- 0, 0, 0, doc: /* Return the default color map. */)
- (void)
+static Lisp_Object
+w32_default_color_map (void)
{
int i;
colormap_t *pc = w32_color_map;
@@ -658,6 +657,13 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
return (cmap);
}
+DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
+ 0, 0, 0, doc: /* Return the default color map. */)
+ (void)
+{
+ return w32_default_color_map ();
+}
+
static Lisp_Object
w32_color_map_lookup (char *colorname)
{
@@ -683,7 +689,6 @@ w32_color_map_lookup (char *colorname)
QUIT;
}
-
UNBLOCK_INPUT;
return ret;
@@ -4768,7 +4773,7 @@ terminate Emacs if we can't open the connection.
UNGCPRO;
}
if (NILP (Vw32_color_map))
- Vw32_color_map = Fw32_default_color_map ();
+ Vw32_color_map = w32_default_color_map ();
/* Merge in system logical colors. */
add_system_logical_colors_to_map (&Vw32_color_map);
diff --git a/src/w32font.c b/src/w32font.c
index 985370c15c..6c1b4d0bc2 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -145,6 +145,138 @@ struct font_callback_data
style variations if the font name is not specified. */
static void list_all_matching_fonts (struct font_callback_data *);
+static BOOL g_b_init_is_w9x;
+static BOOL g_b_init_get_outline_metrics_w;
+static BOOL g_b_init_get_text_metrics_w;
+static BOOL g_b_init_get_glyph_outline_w;
+static BOOL g_b_init_get_glyph_outline_w;
+
+typedef UINT (WINAPI * GetOutlineTextMetricsW_Proc) (
+ HDC hdc,
+ UINT cbData,
+ LPOUTLINETEXTMETRICW lpotmw);
+typedef BOOL (WINAPI * GetTextMetricsW_Proc) (
+ HDC hdc,
+ LPTEXTMETRICW lptmw);
+typedef DWORD (WINAPI * GetGlyphOutlineW_Proc) (
+ HDC hdc,
+ UINT uChar,
+ UINT uFormat,
+ LPGLYPHMETRICS lpgm,
+ DWORD cbBuffer,
+ LPVOID lpvBuffer,
+ const MAT2 *lpmat2);
+
+/* Several "wide" functions we use to support the font backends are
+ unavailable on Windows 9X, unless UNICOWS.DLL is installed (their
+ versions in the default libraries are non-functional stubs). On NT
+ and later systems, these functions are in GDI32.DLL. The following
+ helper function attempts to load UNICOWS.DLL on Windows 9X, and
+ refuses to let Emacs start up if that library is not found. On NT
+ and later versions, it simply loads GDI32.DLL, which should always
+ be available. */
+static HMODULE
+w32_load_unicows_or_gdi32 (void)
+{
+ static BOOL is_9x = 0;
+ OSVERSIONINFO os_ver;
+ HMODULE ret;
+ if (g_b_init_is_w9x == 0)
+ {
+ g_b_init_is_w9x = 1;
+ ZeroMemory (&os_ver, sizeof (OSVERSIONINFO));
+ os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+ if (GetVersionEx (&os_ver))
+ is_9x = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
+ }
+ if (is_9x)
+ {
+ ret = LoadLibrary ("Unicows.dll");
+ if (!ret)
+ {
+ int button;
+
+ button = MessageBox (NULL,
+ "Emacs cannot load the UNICOWS.DLL library.\n"
+ "This library is essential for using Emacs\n"
+ "on this system. You need to install it.\n\n"
+ "However, you can still use Emacs by invoking\n"
+ "it with the '-nw' command-line option.\n\n"
+ "Emacs will exit when you click OK.",
+ "Emacs cannot load UNICOWS.DLL",
+ MB_ICONERROR | MB_TASKMODAL
+ | MB_SETFOREGROUND | MB_OK);
+ switch (button)
+ {
+ case IDOK:
+ default:
+ exit (1);
+ }
+ }
+ }
+ else
+ ret = LoadLibrary ("Gdi32.dll");
+ return ret;
+}
+
+/* The following 3 functions call the problematic "wide" APIs via
+ function pointers, to avoid linking against the non-standard
+ libunicows on W9X. */
+static UINT WINAPI
+get_outline_metrics_w(HDC hdc, UINT cbData, LPOUTLINETEXTMETRICW lpotmw)
+{
+ static GetOutlineTextMetricsW_Proc s_pfn_Get_Outline_Text_MetricsW = NULL;
+ HMODULE hm_unicows = NULL;
+ if (g_b_init_get_outline_metrics_w == 0)
+ {
+ g_b_init_get_outline_metrics_w = 1;
+ hm_unicows = w32_load_unicows_or_gdi32 ();
+ if (hm_unicows)
+ s_pfn_Get_Outline_Text_MetricsW = (GetOutlineTextMetricsW_Proc)
+ GetProcAddress (hm_unicows, "GetOutlineTextMetricsW");
+ }
+ if (s_pfn_Get_Outline_Text_MetricsW == NULL)
+ abort (); /* cannot happen */
+ return s_pfn_Get_Outline_Text_MetricsW (hdc, cbData, lpotmw);
+}
+
+static BOOL WINAPI
+get_text_metrics_w(HDC hdc, LPTEXTMETRICW lptmw)
+{
+ static GetTextMetricsW_Proc s_pfn_Get_Text_MetricsW = NULL;
+ HMODULE hm_unicows = NULL;
+ if (g_b_init_get_text_metrics_w == 0)
+ {
+ g_b_init_get_text_metrics_w = 1;
+ hm_unicows = w32_load_unicows_or_gdi32 ();
+ if (hm_unicows)
+ s_pfn_Get_Text_MetricsW = (GetTextMetricsW_Proc)
+ GetProcAddress (hm_unicows, "GetTextMetricsW");
+ }
+ if (s_pfn_Get_Text_MetricsW == NULL)
+ abort (); /* cannot happen */
+ return s_pfn_Get_Text_MetricsW (hdc, lptmw);
+}
+
+static DWORD WINAPI
+get_glyph_outline_w (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
+ DWORD cbBuffer, LPVOID lpvBuffer, const MAT2 *lpmat2)
+{
+ static GetGlyphOutlineW_Proc s_pfn_Get_Glyph_OutlineW = NULL;
+ HMODULE hm_unicows = NULL;
+ if (g_b_init_get_glyph_outline_w == 0)
+ {
+ g_b_init_get_glyph_outline_w = 1;
+ hm_unicows = w32_load_unicows_or_gdi32 ();
+ if (hm_unicows)
+ s_pfn_Get_Glyph_OutlineW = (GetGlyphOutlineW_Proc)
+ GetProcAddress (hm_unicows, "GetGlyphOutlineW");
+ }
+ if (s_pfn_Get_Glyph_OutlineW == NULL)
+ abort (); /* cannot happen */
+ return s_pfn_Get_Glyph_OutlineW (hdc, uChar, uFormat, lpgm, cbBuffer,
+ lpvBuffer, lpmat2);
+}
static int
memq_no_quit (Lisp_Object elt, Lisp_Object list)
@@ -816,11 +948,11 @@ w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
old_font = SelectObject (dc, hfont);
/* Try getting the outline metrics (only works for truetype fonts). */
- len = GetOutlineTextMetricsW (dc, 0, NULL);
+ len = get_outline_metrics_w (dc, 0, NULL);
if (len)
{
metrics = (OUTLINETEXTMETRICW *) alloca (len);
- if (GetOutlineTextMetricsW (dc, len, metrics))
+ if (get_outline_metrics_w (dc, len, metrics))
memcpy (&w32_font->metrics, &metrics->otmTextMetrics,
sizeof (TEXTMETRICW));
else
@@ -828,7 +960,7 @@ w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
}
if (!metrics)
- GetTextMetricsW (dc, &w32_font->metrics);
+ get_text_metrics_w (dc, &w32_font->metrics);
w32_font->cached_metrics = NULL;
w32_font->n_cache_blocks = 0;
@@ -1916,10 +2048,10 @@ fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec)
int spacing = XINT (tmp);
if (spacing < FONT_SPACING_MONO)
logfont->lfPitchAndFamily
- = logfont->lfPitchAndFamily & 0xF0 | VARIABLE_PITCH;
+ = (logfont->lfPitchAndFamily & 0xF0) | VARIABLE_PITCH;
else
logfont->lfPitchAndFamily
- = logfont->lfPitchAndFamily & 0xF0 | FIXED_PITCH;
+ = (logfont->lfPitchAndFamily & 0xF0) | FIXED_PITCH;
}
/* Process EXTRA info. */
@@ -2306,7 +2438,7 @@ compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code,
transform.eM11.value = 1;
transform.eM22.value = 1;
- if (GetGlyphOutlineW (dc, code, options, &gm, 0, NULL, &transform)
+ if (get_glyph_outline_w (dc, code, options, &gm, 0, NULL, &transform)
!= GDI_ERROR)
{
metrics->lbearing = gm.gmptGlyphOrigin.x;
@@ -2581,3 +2713,12 @@ versions of Windows) characters. */);
w32font_driver.type = Qgdi;
register_font_driver (&w32font_driver, NULL);
}
+
+void
+globals_of_w32font (void)
+{
+ g_b_init_is_w9x = 0;
+ g_b_init_get_outline_metrics_w = 0;
+ g_b_init_get_text_metrics_w = 0;
+ g_b_init_get_glyph_outline_w = 0;
+}
diff --git a/src/w32reg.c b/src/w32reg.c
index e1465be9e4..1837443106 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -147,9 +147,9 @@ x_get_string_resource (XrmDatabase rdb, char *name, char *class)
{
char *resource;
- if (resource = w32_get_rdb_resource (rdb, name))
+ if ((resource = w32_get_rdb_resource (rdb, name)))
return resource;
- if (resource = w32_get_rdb_resource (rdb, class))
+ if ((resource = w32_get_rdb_resource (rdb, class)))
return resource;
}
@@ -157,6 +157,5 @@ x_get_string_resource (XrmDatabase rdb, char *name, char *class)
/* --quick was passed, so this is a no-op. */
return NULL;
- return (w32_get_string_resource (name, class, REG_SZ));
+ return w32_get_string_resource (name, class, REG_SZ);
}
-
diff --git a/src/window.c b/src/window.c
index c3b4384137..0c35b91378 100644
--- a/src/window.c
+++ b/src/window.c
@@ -175,10 +175,10 @@ WINDOW can be any window and defaults to the selected one. */)
}
DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
- doc: /* Return the root window of FRAME_OR_WINDOW.
-If omitted, FRAME_OR_WINDOW defaults to the currently selected frame.
-Else if FRAME_OR_WINDOW denotes any window, return the root window of
-that window's frame. If FRAME_OR_WINDOW denotes a live frame, return
+ doc: /* Return the root window of FRAME-OR-WINDOW.
+If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
+Else if FRAME-OR-WINDOW denotes any window, return the root window of
+that window's frame. If FRAME-OR-WINDOW denotes a live frame, return
the root window of that frame. */)
(Lisp_Object frame_or_window)
{
@@ -220,10 +220,10 @@ WINDOW can be any window and defaults to the selected one. */)
/* Don't move this to window.el - this must be a safe routine. */
DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
- doc: /* Return the topmost, leftmost live window on FRAME_OR_WINDOW.
-If omitted, FRAME_OR_WINDOW defaults to the currently selected frame.
-Else if FRAME_OR_WINDOW denotes any window, return the first window of
-that window's frame. If FRAME_OR_WINDOW denotes a live frame, return
+ doc: /* Return the topmost, leftmost live window on FRAME-OR-WINDOW.
+If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
+Else if FRAME-OR-WINDOW denotes any window, return the first window of
+that window's frame. If FRAME-OR-WINDOW denotes a live frame, return
the first window of that frame. */)
(Lisp_Object frame_or_window)
{
@@ -254,10 +254,10 @@ the first window of that frame. */)
DEFUN ("frame-selected-window", Fframe_selected_window,
Sframe_selected_window, 0, 1, 0,
- doc: /* Return the selected window of FRAME_OR_WINDOW.
-If omitted, FRAME_OR_WINDOW defaults to the currently selected frame.
-Else if FRAME_OR_WINDOW denotes any window, return the selected window
-of that window's frame. If FRAME_OR_WINDOW denotes a live frame, return
+ doc: /* Return the selected window of FRAME-OR-WINDOW.
+If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
+Else if FRAME-OR-WINDOW denotes any window, return the selected window
+of that window's frame. If FRAME-OR-WINDOW denotes a live frame, return
the selected window of that frame. */)
(Lisp_Object frame_or_window)
{
@@ -1297,7 +1297,7 @@ WINDOW must be a live window and defaults to the selected one.
This is updated by redisplay, when it runs to completion.
Simply changing the buffer text or setting `window-start'
does not update this value.
-Return nil if there is no recorded value. \(This can happen if the
+Return nil if there is no recorded value. (This can happen if the
last redisplay of WINDOW was preempted, and did not finish.)
If UPDATE is non-nil, compute the up-to-date position
if it isn't already recorded. */)
@@ -1688,7 +1688,7 @@ DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
0, 1, 0,
doc: /* Return the parameters of WINDOW and their values.
WINDOW defaults to the selected window. The return value is a list of
-elements of the form (PARAMETER . VALUE). */)
+elements of the form (PARAMETER . VALUE). */)
(Lisp_Object window)
{
return Fcopy_alist (decode_any_window (window)->window_parameters);
@@ -2193,7 +2193,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in
DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
doc: /* Return window following WINDOW in cyclic ordering of windows.
-WINDOW must be a live window and defaults to the selected one. The
+WINDOW must be a live window and defaults to the selected one. The
optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
consider.
@@ -3224,7 +3224,7 @@ temp_output_buffer_show (register Lisp_Object buf)
DEFUN ("internal-temp-output-buffer-show",
Ftemp_output_buffer_show, Stemp_output_buffer_show,
1, 1, 0,
- doc: /* Internal function for `with-output-to-temp-buffer''. */)
+ doc: /* Internal function for `with-output-to-temp-buffer'. */)
(Lisp_Object buf)
{
temp_output_buffer_show (buf);
@@ -3845,8 +3845,8 @@ set correctly. See the code of `split-window' for how this is done. */)
DEFUN ("delete-window-internal", Fdelete_window_internal, Sdelete_window_internal, 1, 1, 0,
doc: /* Remove WINDOW from its frame.
-WINDOW defaults to the selected window. Return nil. Signal an error
-when WINDOW is the only window on its frame. */)
+WINDOW defaults to the selected window. Return nil.
+Signal an error when WINDOW is the only window on its frame. */)
(register Lisp_Object window)
{
register Lisp_Object parent, sibling, frame, root;
@@ -5225,8 +5225,8 @@ any partial-height lines in the text display area. */)
DEFUN ("move-to-window-line", Fmove_to_window_line, Smove_to_window_line,
1, 1, "P",
doc: /* Position point relative to window.
-With no argument, position point at center of window.
-An argument specifies vertical position within the window;
+ARG nil means position point at center of window.
+Else, ARG specifies vertical position within the window;
zero means top of window, negative means relative to bottom of window. */)
(Lisp_Object arg)
{