]> code.delx.au - gnu-emacs/commitdiff
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-28
authorMiles Bader <miles@gnu.org>
Sat, 19 Mar 2005 02:42:17 +0000 (02:42 +0000)
committerMiles Bader <miles@gnu.org>
Sat, 19 Mar 2005 02:42:17 +0000 (02:42 +0000)
Merge from emacs--cvs-trunk--0

Patches applied:

 * emacs--cvs-trunk--0  (patch 180-191)

   - Update from CVS
   - Merge from gnus--rel--5.10

 * gnus--rel--5.10  (patch 39-44)

   - Merge from emacs--cvs-trunk--0
   - Update from CVS

90 files changed:
ChangeLog
admin/FOR-RELEASE
configure
configure.in
etc/NEWS
etc/TODO
leim/ChangeLog
leim/quail/thai.el
lib-src/ChangeLog
lib-src/emacsclient.c
lisp/ChangeLog
lisp/bindings.el
lisp/calendar/calendar.el
lisp/calendar/diary-lib.el
lisp/emacs-lisp/byte-run.el
lisp/emacs-lisp/debug.el
lisp/emacs-lisp/find-func.el
lisp/files.el
lisp/font-lock.el
lisp/generic.el
lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
lisp/gnus/gnus-async.el
lisp/gnus/gnus.el
lisp/gnus/mail-source.el
lisp/gnus/message.el
lisp/gnus/mm-url.el
lisp/gnus/nneething.el
lisp/gnus/nnimap.el
lisp/gnus/nnmaildir.el
lisp/help.el
lisp/image-mode.el [new file with mode: 0644]
lisp/image.el
lisp/info.el
lisp/international/mule-cmds.el
lisp/international/quail.el
lisp/isearch.el
lisp/language/thai-util.el
lisp/language/thai.el
lisp/mail/rmail.el
lisp/mail/sendmail.el
lisp/pcvs.el
lisp/progmodes/idlwave.el
lisp/progmodes/perl-mode.el
lisp/replace.el
lisp/simple.el
lisp/subr.el
lisp/tar-mode.el
lisp/term/mac-win.el
lisp/textmodes/ispell.el
lisp/textmodes/table.el
lispref/ChangeLog
lispref/anti.texi
lispref/commands.texi
lispref/display.texi
lispref/edebug.texi
lispref/nonascii.texi
lispref/searching.texi
lispref/text.texi
lwlib/ChangeLog
lwlib/lwlib-Xm.c
lwlib/lwlib-Xm.h
lwlib/xlwmenu.c
lwlib/xlwmenuP.h
mac/ChangeLog
mac/Emacs.app/Contents/Info.plist
man/ChangeLog
man/building.texi
src/ChangeLog
src/buffer.c
src/callint.c
src/coding.c
src/coding.h
src/dispnew.c
src/emacs.c
src/fileio.c
src/floatfns.c
src/frame.c
src/keyboard.c
src/mac.c
src/macfns.c
src/macgui.h
src/macterm.c
src/macterm.h
src/process.c
src/s/darwin.h
src/xfaces.c
src/xfns.c
src/xmenu.c
src/xrdb.c

index 2462370b170c342c786f6edf4bdee8b73e465ed1..93cdb3d787210ef3d5075afd48efdeb7b2ce5625 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * configure.in <Motif>: Don't let a special LessTif/Motif1.2 install
+       shadow the main Lesstif/Motif-2.1 libs and includes.
+
 2005-03-10  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * configure.in: Only add XASSERTS to cppflags.
index e9eac1065be173fa5a8680d9582c0400ea041f07..e182242276be611f705adf93dba90b061524de3a 100644 (file)
@@ -18,13 +18,6 @@ See msg from rms to emacs-devel on 21 Dec.
 
 * FATAL ERRORS
 
-** Investigate face cache related crash.
-
-Indications: Face cache seems to have been cleared, but
-redisplay uses an invalidated face_id with FACE_FROM_ID
-which then returns a NULL pointer.  Said to happen with
-isearch faces.
-
 ** Investigate reported crashes in compact_small_strings.
 
 ** Investigate reported crashes related to using an
@@ -73,28 +66,6 @@ time to make anfe-ftp more intelligent.
 
 * REDISPLAY RELATED BUGS
 
-** Strange text scrolling with Emacs + GTK
-
-> I could reproduce the problem with the latest CVS.
->
->   % emacs -Q
->   M-x info RET
->   M->
->   C-l
->   C-x ( C-u - 1 C-v C-x )
->   C-x e e e e ...
->
-> I see the problem around "CC mode" and "Forms".
-
-It is not specific for the first line of a buffer.
-
-Rather it happens for lines which are indented but the
-indentation is controlled by a display property and
-the newline is part of that display property -- in
-that case, the indentation is not recognized for the
-first display line.
-
-
 ** Avoid unbreakable loops in redisplay.
 
 Redisplay may loop if there is an error in some display property, e.g.
@@ -104,16 +75,6 @@ A fix would be to somehow disable handling of display properties if an error
 is encountered.
 
 
-** Problem with modeline and window margins:
-
-The mode line's right "box" line is misplaced under the right margin,
-rather than at the right window edge.
-
-emacs -Q
-(set-window-margins nil 25 25)
-C-x 2
-
-
 ** custom mode-line face makes Emacs freeze up
 
 From: Stephen Berman <Stephen.Berman@gmx.net>
@@ -208,12 +169,12 @@ man/misc.texi       Chong Yidong
 man/msdog.texi      Chong Yidong
 man/mule.texi       "Luc Teirlinck"
 man/m-x.texi        "Luc Teirlinck"  Chong Yidong
-man/picture.texi    Joakim Verona <joakim@verona.se>
+man/picture.texi    Joakim Verona <joakim@verona.se>   Chong Yidong
 man/programs.texi   "Stephen Eglen"  Chong Yidong
 man/regs.texi       "Luc Teirlinck"   Chong Yidong
 man/rmail.texi      Chong Yidong
-man/screen.texi     "Luc Teirlinck"  Chong Yidong
-man/search.texi     "Luc Teirlinck"
+man/screen.texi     "Luc Teirlinck"   Chong Yidong
+man/search.texi     "Luc Teirlinck"   Chong Yidong
 man/sending.texi    Chong Yidong
 man/text.texi       "Luc Teirlinck"   Chong Yidong
 man/trouble.texi    Chong Yidong
@@ -268,7 +229,7 @@ lispref/objects.texi         "Luc Teirlinck"   Chong Yidong
 lispref/os.texi                 "Luc Teirlinck"   Chong Yidong
 lispref/positions.texi  "Luc Teirlinck"   Chong Yidong
 lispref/processes.texi   Chong Yidong
-lispref/searching.texi  "Luc Teirlinck"
+lispref/searching.texi  "Luc Teirlinck"   Chong Yidong
 lispref/sequences.texi  "Luc Teirlinck"   Chong Yidong
 lispref/streams.texi    "Luc Teirlinck"   Chong Yidong
 lispref/strings.texi    "Luc Teirlinck"   Chong Yidong
index d5efd286ff0a4a2f539eea66dd5fb62ce111c676..32a9d4d94a66e80ff39b4dce2ccfeb73ad48284e 100755 (executable)
--- a/configure
+++ b/configure
 fi
 
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
-  echo "$as_me:$LINENO: checking for LessTif where some systems put it" >&5
-echo $ECHO_N "checking for LessTif where some systems put it... $ECHO_C" >&6
-if test "${emacs_cv_lesstif+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # We put this in CFLAGS temporarily to precede other -I options
-  # that might be in CFLAGS temporarily.
-  # We put this in CPPFLAGS where it precedes the other -I options.
-  OLD_CPPFLAGS=$CPPFLAGS
-  OLD_CFLAGS=$CFLAGS
-  CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
-  CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>
-int
-main ()
-{
-int x = 5;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  emacs_cv_lesstif=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-emacs_cv_lesstif=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $emacs_cv_lesstif" >&5
-echo "${ECHO_T}$emacs_cv_lesstif" >&6
-  if test $emacs_cv_lesstif = yes; then
-    # Make sure this -I option remains in CPPFLAGS after it is set
-    # back to REAL_CPPFLAGS.
-    # There is no need to change REAL_CFLAGS, because REAL_CFLAGS does not
-    # have those other -I options anyway.  Ultimately, having this
-    # directory ultimately in CPPFLAGS will be enough.
-    REAL_CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $REAL_CPPFLAGS"
-    LDFLAGS="-L/usr/X11R6/LessTif/Motif1.2/lib $LDFLAGS"
-  else
-    CFLAGS=$OLD_CFLAGS
-    CPPFLAGS=$OLD_CPPFLAGS
-  fi
   echo "$as_me:$LINENO: checking for Motif version 2.1" >&5
 echo $ECHO_N "checking for Motif version 2.1... $ECHO_C" >&6
 if test "${emacs_cv_motif_version_2_1+set}" = set; then
@@ -10892,6 +10820,79 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
     fi
+  else
+    echo "$as_me:$LINENO: checking for LessTif where some systems put it" >&5
+echo $ECHO_N "checking for LessTif where some systems put it... $ECHO_C" >&6
+if test "${emacs_cv_lesstif+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # We put this in CFLAGS temporarily to precede other -I options
+    # that might be in CFLAGS temporarily.
+    # We put this in CPPFLAGS where it precedes the other -I options.
+    OLD_CPPFLAGS=$CPPFLAGS
+    OLD_CFLAGS=$CFLAGS
+    CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
+    CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>
+int
+main ()
+{
+int x = 5;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  emacs_cv_lesstif=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+emacs_cv_lesstif=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $emacs_cv_lesstif" >&5
+echo "${ECHO_T}$emacs_cv_lesstif" >&6
+    if test $emacs_cv_lesstif = yes; then
+      # Make sure this -I option remains in CPPFLAGS after it is set
+      # back to REAL_CPPFLAGS.
+      # There is no need to change REAL_CFLAGS, because REAL_CFLAGS does not
+      # have those other -I options anyway.  Ultimately, having this
+      # directory ultimately in CPPFLAGS will be enough.
+      REAL_CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $REAL_CPPFLAGS"
+      LDFLAGS="-L/usr/X11R6/LessTif/Motif1.2/lib $LDFLAGS"
+    else
+      CFLAGS=$OLD_CFLAGS
+      CPPFLAGS=$OLD_CPPFLAGS
+    fi
   fi
 fi
 
index 291ae9a9c08238edd0da37b6bd4e5f0b1c98565a..1a818a5b74e9eb8ee0c920826e6778cfedf6f1a1 100644 (file)
@@ -3,7 +3,7 @@ dnl To rebuild the `configure' script from this, execute the command
 dnl    autoconf
 dnl in the directory containing this script.
 dnl
-dnl  Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003, 2004
+dnl  Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 dnl  Free Software Foundation, Inc.
 dnl
 dnl  This file is part of GNU Emacs.
@@ -2080,29 +2080,6 @@ if test "${HAVE_X11}" = "yes"; then
 fi
 
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
-  AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
-  # We put this in CFLAGS temporarily to precede other -I options
-  # that might be in CFLAGS temporarily.
-  # We put this in CPPFLAGS where it precedes the other -I options.
-  OLD_CPPFLAGS=$CPPFLAGS
-  OLD_CFLAGS=$CFLAGS
-  CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
-  CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
-  [AC_TRY_COMPILE([#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>],
-    [int x = 5;],
-    emacs_cv_lesstif=yes, emacs_cv_lesstif=no)])
-  if test $emacs_cv_lesstif = yes; then
-    # Make sure this -I option remains in CPPFLAGS after it is set
-    # back to REAL_CPPFLAGS.
-    # There is no need to change REAL_CFLAGS, because REAL_CFLAGS does not
-    # have those other -I options anyway.  Ultimately, having this
-    # directory ultimately in CPPFLAGS will be enough.
-    REAL_CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $REAL_CPPFLAGS"
-    LDFLAGS="-L/usr/X11R6/LessTif/Motif1.2/lib $LDFLAGS"
-  else
-    CFLAGS=$OLD_CFLAGS
-    CPPFLAGS=$OLD_CPPFLAGS
-  fi
   AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
   [AC_TRY_COMPILE([#include <Xm/Xm.h>],
     [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
@@ -2121,6 +2098,30 @@ Motif version prior to 2.1.
       AC_DEFINE(HAVE_LIBXP, 1,
                [Define to 1 if you have the Xp library (-lXp).])
     fi
+  else
+    AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
+    # We put this in CFLAGS temporarily to precede other -I options
+    # that might be in CFLAGS temporarily.
+    # We put this in CPPFLAGS where it precedes the other -I options.
+    OLD_CPPFLAGS=$CPPFLAGS
+    OLD_CFLAGS=$CFLAGS
+    CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
+    CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
+    [AC_TRY_COMPILE([#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>],
+      [int x = 5;],
+      emacs_cv_lesstif=yes, emacs_cv_lesstif=no)])
+    if test $emacs_cv_lesstif = yes; then
+      # Make sure this -I option remains in CPPFLAGS after it is set
+      # back to REAL_CPPFLAGS.
+      # There is no need to change REAL_CFLAGS, because REAL_CFLAGS does not
+      # have those other -I options anyway.  Ultimately, having this
+      # directory ultimately in CPPFLAGS will be enough.
+      REAL_CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $REAL_CPPFLAGS"
+      LDFLAGS="-L/usr/X11R6/LessTif/Motif1.2/lib $LDFLAGS"
+    else
+      CFLAGS=$OLD_CFLAGS
+      CPPFLAGS=$OLD_CPPFLAGS
+    fi
   fi
 fi
 
index 0e7e4e84736a75bc308006a595ae8f3a25f30d64..2621fcb893122c1fc27a0be7651543433eae9386 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -185,14 +185,23 @@ the existing file's name.  (This is the same convention that shell
 commands cp, mv, and ln follow.)  Thus, M-x copy-file RET ~/foo RET
 /tmp RET copies ~/foo to /tmp/foo.
 
+** M-o now is the prefix key for setting text properties;
+M-o M-o requests refontification.
+
+** M-g is now a prefix key.  M-g g and M-g M-g run goto-line.
+
+** font-lock-lines-before specifies a number of lines before the
+current line that should be refontified when you change the buffer.
+The default value is 1.
+
 ** C-u M-x goto-line now switches to the most recent previous buffer,
 and goes to the specified line in that buffer.
 
 When goto-line starts to execute, if there's a number in the buffer at
 point then it acts as the default argument for the minibuffer.
 
-** Emacs now responds to mouse-clicks on the mode-line, header-line and
-display margin, when run in an xterm.
+** Emacs now responds to mouse-clicks on the mode-line, header-line
+and display margin, when run in an xterm.
 
 ** M-SPC (just-one-space) when given a numeric argument N
 converts whitespace around point to N spaces.
@@ -796,9 +805,13 @@ multiple files, and C-x d passes it to `dired'.
 with the number appended to the *info* buffer name (e.g. "*info*<2>").
 
 *** isearch in Info uses Info-search and searches through multiple nodes.
-Failed isearch wraps to the top/final node.  The user option
-`Info-isearch-search' controls whether to use Info-search or the
-default isearch search function.
+Before leaving the initial Info node isearch fails once with the error
+message [initial node], and with subsequent C-s/C-r continues through
+other nodes.  When isearch fails for the rest of the manual, it wraps
+aroung the whole manual to the top/final node.  The user option
+`Info-isearch-search' controls whether to use Info-search for isearch,
+or the default isearch search function that wraps around the current
+Info node.
 
 *** New search commands: `Info-search-case-sensitively' (bound to S),
 `Info-search-backward', and `Info-search-next' which repeats the last
@@ -2604,10 +2617,20 @@ the command `undefined'.  (In earlier Emacs versions, it used
 \f
 * Lisp Changes in Emacs 22.1
 
-** An element of buffer-undo-list can now have the form (FUNNAME .
-ARGS), where FUNNAME is a symbol other than t or nil.  That stands for
-a high-level change that should be undone by evaluating (apply FUNNAME
-ARGS).
++++
+** The new interactive-specification `G' reads a file name
+much like `F', but if the input is a directory name (even defaulted),
+it returns just the directory name.
+
++++
+** An element of buffer-undo-list can now have the form (apply FUNNAME
+. ARGS), where FUNNAME is a symbol other than t or nil.  That stands
+for a high-level change that should be undone by evaluating (apply
+FUNNAME ARGS).
+
+These entries can also have the form (apply DELTA BEG END FUNNAME . ARGS)
+which indicates that the change which took place was limited to the
+range BEG...END and increased the buffer size by DELTA.
 
 +++
 ** The line-move, scroll-up, and scroll-down functions will now
@@ -12355,7 +12378,7 @@ For example, if a string or comment terminating character is deleted, then if
 this feature is enabled subsequent lines in the buffer will be correctly
 refontified to reflect their new syntactic context.  Previously, only the line
 containing the deleted character would be refontified and you would have to use
-the command M-g M-g (font-lock-fontify-block) to refontify some lines.
+the command M-o M-o (font-lock-fontify-block) to refontify some lines.
 
 As a consequence of this new feature, two other variables have changed:
 
index a587edf1f93cd3ddf56eff067263bbd0f3f00639..6b80737aa04ff20d58f0702278f89d3bddaf1bcd 100644 (file)
--- a/etc/TODO
+++ b/etc/TODO
@@ -65,11 +65,12 @@ to the FSF.
 ** Make the Lucid menu widget display multilingual text.  [This
   probably needs to be done from actual Emacs buffers, either directly
   in the menu or by rendering in an unmapped window and copying the
-  pixels.  Note that the relevant Xlib functions assume a specific
-  locale; that isn't good enough even if X can render the arbitrary
-  text, which it often can't as far as I can tell.  -- fx] [The gtk
+  pixels.  The current code assumes a specific locale; that isn't good
+  enough even if X can render the arbitrary text] [The gtk
   port now displays multilingual text in menus, but only insofar as
   Emacs can encode it as utf-8 and gtk can display the result.]
+  Maybe making Lucid menus work like Gtk's (i.e. just force utf-8) is good
+  enough now that Emacs can encode most chars into utf-8.
 
 ** Remove the limitation that window and frame widths and heights can
   be only full columns/lines.
index 73ec30f0cadd02062cc4ea8e703d02e559e0ca32..988575249e03a58b64e94453459bf3464857d15b 100644 (file)
@@ -1,3 +1,14 @@
+2005-03-18  handa  <handa@m17n.org>
+
+       * quail/thai.el (quail-thai-update-translation): Delete it.
+       (thai-generate-quail-map): Generate is simple map.
+       ("thai-kesmanee"): Don't use quail-thai-update-translation.
+       (thai-generate-quail-map): Likewise.
+
+2005-03-15  Kenichi Handa  <handa@m17n.org>
+
+       * quail/thai.el (thai-generate-quail-map): Fix the kesmanee layout.
+
 2005-03-08  Kenichi Handa  <handa@m17n.org>
 
        * quail/latin-pre.el ("latin-1-prefix"): Add rule "__"->"_".
index ee3e39bf9e408ca19901d9e7d8fd146bbffd1d70..0c5398e1dd04506defca73d46da71ec534f51741 100644 (file)
@@ -2,6 +2,9 @@
 
 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
+;; Copyright (C) 2005
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: multilingual, input method, Thai
 
@@ -55,21 +58,35 @@ The difference from the ordinal Thai keyboard:
  [
   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0      ; control codes
   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0      ; control codes
-  0   "#" "." "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,TQi\e(B" "\e,T'\e(B"       ; SPC .. '
+;; This data is quite old.
+;;   0   "#" "." "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,TQi\e(B" "\e,T'\e(B"    ; SPC .. '
+;;   "\e,Tv\e(B" "\e,Tw\e(B" "\e,Tu\e(B" "\e,Ty\e(B" "\e,TA\e(B" "\e,T"\e(B" "\e,Tc\e(B" "\e,T=\e(B"   ; ( .. /
+;;   "\e,T(\e(B" "\e,TE\e(B" "/" "_" "\e,T@\e(B" "\e,T6\e(B" "\e,TX\e(B" "\e,TV\e(B"       ; 0 .. 7
+;;   "\e,T$\e(B" "\e,T5\e(B" "\e,T+\e(B" "\e,TG\e(B" "\e,T2\e(B" "\e,T*\e(B" "\e,TL\e(B" "\e,TF\e(B"   ; 8 .. ?
+;;   "\e,Tq\e(B" "\e,TD\e(B" "\e,TZ\e(B" "\e,T)\e(B" "\e,T/\e(B" "\e,T.\e(B" "\e,Tb\e(B" "\e,T,\e(B"   ; @ .. G
+;;   "\e,Tg\e(B" "\e,T3\e(B" "\e,Tk\e(B" "\e,TI\e(B" "\e,TH\e(B" "\e,Tn\e(B" "\e,Tl\e(B" "\e,TO\e(B"   ; H .. O
+;;   "\e,T-\e(B" "\e,Tp\e(B" "\e,T1\e(B" "\e,T&\e(B" "\e,T8\e(B" "\e,Tj\e(B" "\e,TN\e(B" "\""        ; P .. W
+;;   ")" "\e,Tm\e(B" "(" "\e,T:\e(B" "\e,T_\e(B" "\e,TE\e(B" "\e,TY\e(B" "\e,Tx\e(B"       ; X .. _
+;;   "\e,T#\e(B" "\e,T?\e(B" "\e,TT\e(B" "\e,Ta\e(B" "\e,T!\e(B" "\e,TS\e(B" "\e,T4\e(B" "\e,T`\e(B"   ; ` .. g
+;;   "\e,Ti\e(B" "\e,TC\e(B" "\e,Th\e(B" "\e,TR\e(B" "\e,TJ\e(B" "\e,T7\e(B" "\e,TW\e(B" "\e,T9\e(B"   ; h .. o
+;;   "\e,TB\e(B" "\e,Tf\e(B" "\e,T>\e(B" "\e,TK\e(B" "\e,TP\e(B" "\e,TU\e(B" "\e,TM\e(B" "\e,Td\e(B"   ; p .. w
+;;   "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,To\e(B" "," "\e,T%\e(B" 0 ; x .. DEL
+;; This is the correct data nowadays.
+  0  "+" "." "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,T_\e(B" "\e,T'\e(B" ; SPC .. '
   "\e,Tv\e(B" "\e,Tw\e(B" "\e,Tu\e(B" "\e,Ty\e(B" "\e,TA\e(B" "\e,T"\e(B" "\e,Tc\e(B" "\e,T=\e(B"      ; ( .. /
-  "\e,T(\e(B" "\e,TE\e(B" "/" "_" "\e,T@\e(B" "\e,T6\e(B" "\e,TX\e(B" "\e,TV\e(B"  ; 0 .. 7
+  "\e,T(\e(B" "\e,Te\e(B" "/" "-" "\e,T@\e(B" "\e,T6\e(B" "\e,TX\e(B" "\e,TV\e(B"  ; 0 .. 7
   "\e,T$\e(B" "\e,T5\e(B" "\e,T+\e(B" "\e,TG\e(B" "\e,T2\e(B" "\e,T*\e(B" "\e,TL\e(B" "\e,TF\e(B"      ; 8 .. ?
   "\e,Tq\e(B" "\e,TD\e(B" "\e,TZ\e(B" "\e,T)\e(B" "\e,T/\e(B" "\e,T.\e(B" "\e,Tb\e(B" "\e,T,\e(B"      ; @ .. G
-  "\e,Tg\e(B" "\e,T3\e(B" "\e,Tk\e(B" "\e,TI\e(B" "\e,TH\e(B" "\e,Tn\e(B" "\e,Tl\e(B" "\e,TO\e(B"      ; H .. O
+  "\e,Tg\e(B" "\e,T3\e(B" "\e,Tk\e(B" "\e,TI\e(B" "\e,TH\e(B" "?" "\e,Tl\e(B" "\e,TO\e(B"    ; H .. O
   "\e,T-\e(B" "\e,Tp\e(B" "\e,T1\e(B" "\e,T&\e(B" "\e,T8\e(B" "\e,Tj\e(B" "\e,TN\e(B" "\""   ; P .. W
-  ")" "\e,Tm\e(B" "(" "\e,T:\e(B" "\e,T_\e(B" "\e,TE\e(B" "\e,TY\e(B" "\e,Tx\e(B"  ; X .. _
-  "\e,T#\e(B" "\e,T?\e(B" "\e,TT\e(B" "\e,Ta\e(B" "\e,T!\e(B" "\e,TS\e(B" "\e,T4\e(B" "\e,T`\e(B"      ; ` .. g
+  "\)" "\e,Tm\e(B" "\(" "\e,T:\e(B" "\e,T#\e(B" "\e,TE\e(B" "\e,TY\e(B" "\e,Tx\e(B"        ; X .. _
+  "_" "\e,T?\e(B" "\e,TT\e(B" "\e,Ta\e(B" "\e,T!\e(B" "\e,TS\e(B" "\e,T4\e(B" "\e,T`\e(B"    ; ` .. g
   "\e,Ti\e(B" "\e,TC\e(B" "\e,Th\e(B" "\e,TR\e(B" "\e,TJ\e(B" "\e,T7\e(B" "\e,TW\e(B" "\e,T9\e(B"      ; h .. o
   "\e,TB\e(B" "\e,Tf\e(B" "\e,T>\e(B" "\e,TK\e(B" "\e,TP\e(B" "\e,TU\e(B" "\e,TM\e(B" "\e,Td\e(B"      ; p .. w
-  "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,To\e(B" "," "\e,T%\e(B" 0            ; x .. DEL
+  "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,T%\e(B" "," "%" 0  ; x .. DEL
   ])
 
-\f
+
 ;; Thai Pattachote keyboard support.
 
 (quail-define-package
index 0978e8835ca26d59368013b1ddb082f492f63ea2..513bc8f21ba1653b45de99f00a86f6e073a6d977 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * emacsclient.c: Avoid expansion of getcwd when defined as a macro.
+
 2005-03-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * make-docfile.c: Undo previous change.
index 24dcdffff2c2cd1f7db622278782515c7f82f7c8..90c0228f7206e0e534b78611e50034eb34c03786 100644 (file)
@@ -42,7 +42,7 @@ Boston, MA 02111-1307, USA.  */
 #endif /* not VMS */
 
 char *getenv (), *getwd ();
-char *getcwd ();
+char *(getcwd) ();
 
 #ifndef VERSION
 #define VERSION "unspecified"
index 5901c35c2e9a31ae56ef42c80841272ba41a99d3..380436e952db8bcf8fdb48f586afe8f439df676c 100644 (file)
@@ -1,3 +1,247 @@
+2005-03-18  Tak Ota  <Takaaki.Ota@am.sony.com>
+
+       * textmodes/table.el (table--line-column-position): New idiom.
+       (table--row-column-insertion-point-p): New function to test
+       validity of row and column insertion operation at a location.
+       (table-global-menu, table-cell-menu): Use above functions for
+       deterministic test operation.
+       (table--editable-cell-p): Behave in deterministic fashion.
+
+2005-03-18  Juri Linkov  <juri@jurta.org>
+
+       * isearch.el (isearch-lazy-highlight-new-loop):
+       Make arguments beg and end optional.
+       (isearch-update): Remove optional arguments nil from
+       isearch-lazy-highlight-new-loop.
+       (isearch-lazy-highlight-search): Let-bind case-fold-search to
+       isearch-lazy-highlight-case-fold-search instead of
+       isearch-case-fold-search, and let-bind isearch-regexp to
+       isearch-lazy-highlight-regexp.
+       Use isearch-lazy-highlight-last-string instead of isearch-string.
+
+       * replace.el (perform-replace): Remove bindings of global
+       variables isearch-string, isearch-regexp, isearch-case-fold-search.
+       Add three new arguments to `replace-highlight'.
+       (replace-highlight): Add arguments string, regexp, case-fold.
+       Let-bind isearch-string, isearch-regexp, isearch-case-fold-search
+       to allow isearch-lazy-highlight-new-loop to use these values
+       to set corresponding isearch-lazy-highlight-* internal
+       variables whose values lazy highlighting will use regardless of
+       changes to global variables isearch-string, isearch-regexp,
+       isearch-case-fold-search during lazy highlighting loop.
+       (replace-dehighlight): Rename `isearch-lazy-highlight-cleanup'
+       to `lazy-highlight-cleanup'.
+
+       * textmodes/ispell.el (ispell-lazy-highlight): New defcustom.
+       (ispell-highlight-face): Set default face to `isearch' when
+       lazy highlighting is enabled.
+       (ispell-highlight-spelling-error-overlay): Set `ispell-overlay'
+       priority to 1.  Add lazy highlighting.
+       (ispell-highlight-spelling-error-xemacs): Remove obsolete arg
+       from `isearch-dehighlight'.
+
+2005-03-18  David Ponce  <david@dponce.com>
+
+       * files.el (hack-local-variables): Do a case-insensitive search
+       for End.
+
+2005-03-18  Juri Linkov  <juri@jurta.org>
+
+       * isearch.el (lazy-highlight-cleanup) <command>: Rename from
+       `isearch-lazy-highlight-cleanup', add alias to old name and
+       declare obsolete.  Add release numbers to other obsolete vars.
+       (isearch-done, isearch-lazy-highlight-new-loop):
+       Rename `isearch-lazy-highlight-cleanup' to `lazy-highlight-cleanup'.
+       (lazy-highlight-cleanup) <variable>: Doc fix.
+       (isearch-lazy-highlight-update): Rename obsolete
+       `isearch-lazy-highlight-face' to `lazy-highlight-face'.
+
+2005-03-18  Kenichi Handa  <handa@m17n.org>
+
+       * language/thai-util.el: Fix categorization of Thai characters in
+       thai-category-table.
+       (thai-composition-pattern): Adjust it for the above change.
+       (thai-self-insert-command, thai-compose-syllable): New functions.
+       (thai-compose-region): Use thai-compose-syllable.
+       (thai-compose-string): Likewise.
+       (thai-composition-function): Likewise.
+       (thai-auto-composition): New function.
+       (thai-auto-composition-mode): New minor mode.
+
+       * language/thai.el: Fix patterns to be registered in
+       composition-function-table.
+
+       * international/quail.el (quail-input-method): Locally bind
+       inhibit-modification-hooks to t.
+
+2005-03-17  Richard M. Stallman  <rms@gnu.org>
+
+       * progmodes/perl-mode.el (perl-mode-hook): Defvar it.
+       (perl-mode): Use run-mode-hooks.
+
+       * mail/rmail.el (rmail-movemail-program, rmail-pop-password)
+       (rmail-pop-password-required, rmail-remote-password): Doc fixes.
+       (rmail-preserve-inbox, rmail-probe, rmail-autodetect): Doc fix.
+
+       * mail/sendmail.el (sendmail-send-it): Reenable the code
+       to compute resend-to-address and use it.
+
+       * tar-mode.el (tar-mode): Turn off undo unconditionally.
+
+       * image-mode.el: New file.
+
+       * image.el (insert-sliced-image): Add autoload cookie.
+
+       * font-lock.el (font-lock-lines-before): New user option.
+       (font-lock-after-change-function): Obey it.
+
+       * bindings.el (esc-map): Make M-g a prefix.
+       Bind M-g g and M-g M-g to goto-line.
+
+       * faces.el (face-id): Doc fix.
+
+2005-03-17  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>
+
+       * mail/rmail.el (rmail-unknown-mail-followup-to): New function.
+       (rmail-show-message): Use rmail-unknown-mail-followup-to.
+       (rmail-reply): Recognize Mail-Followup-To and Mail-Reply-To headers.
+
+       * mail/sendmail.el (mail-yank-ignored-headers)
+       (mail-font-lock-keywords, mail-mode-fill-paragraph):
+       Add Mail-Followup-To and Mail-Reply-To headers.
+       (mail-citation-hook): Add autoload cookie.
+       (mail-mode): Doc fix.
+       (mail-mode-map): Bind mail-mail-followup-to and mail-mail-reply-to.
+       (mail-send): Compute Mail-Followup-To and Mail-Reply-To headers.
+       (mail-mode-fill-paragraph): Handle those headers.
+       (mail-mailing-lists): New variable.
+       (mail-mail-reply-to, mail-mail-followup-to): New functions.
+
+2005-03-17  Juri Linkov  <juri@jurta.org>
+
+       * isearch.el (isearch-fallback): Check for `(car previous)'
+       before calling `isearch-other-end-state'.
+
+2005-03-17  Kim F. Storm  <storm@cua.dk>
+
+       * simple.el (move-beginning-of-line): Move to beginning of buffer
+       line, as well as beginning of screen line.
+
+2005-03-16  Glenn Morris  <gmorris@ast.cam.ac.uk>
+
+       * calendar/diary-lib.el (mark-diary-entries): Use new optional
+       argument REDRAW rather than calendar-redrawing variable.
+       * calendar/calendar.el (calendar-redrawing): Delete.
+       (redraw-calendar): Do not bind calendar-redrawing.
+
+2005-03-16  Matt Hodges  <MPHodges@member.fsf.org>
+
+       * calendar/diary-lib.el (diary-redraw-calendar): Preserve point in
+       diary-file buffer.
+
+2005-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * help.el (describe-mode): Allow a :minor-mode-function property to
+       specify a different minor mode toggle function than the variable.
+       * simple.el (auto-fill-function):
+       * subr.el (add-minor-mode): Use it.
+
+2005-03-16  Kenichi Handa  <handa@m17n.org>
+
+       * language/ethio-util.el (sera-being-called-by-w3): New variable.
+       (ethio-sera-to-fidel-ethio): Check also sera-being-called-by-w3.
+       (ethio-fidel-to-sera-buffer): Likewise.
+
+2005-03-16  Juri Linkov  <juri@jurta.org>
+
+       * emacs-lisp/find-func.el (find-function-regexp):
+       Add defun-emitting macro `menu-bar-make-toggle'.
+
+       * isearch.el: Put `isearch-scroll' property to
+       `split-window-horizontally'.
+
+       * info.el: Update error messages for `debug-ignored-errors'.
+       (Info-isearch-search): Doc fix.
+       (Info-find-node): Move up code to go into info buffer before
+       recording the node to the history.
+       (Info-fontify-node): Fontify titles only if the next line
+       has two or more `*', `=', `-', `.'.
+       Display "go to this node" for empty (match-string 3).
+
+2005-03-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * term/mac-win.el: Add mouse pointer shape constants.
+
+2005-03-15  Kim F. Storm  <storm@cua.dk>
+
+       * simple.el (move-beginning-of-line): Use vertical-motion.
+
+2005-03-15  Juri Linkov  <juri@jurta.org>
+
+       * isearch.el (isearch-error): New variable.
+       (isearch-invalid-regexp, isearch-within-brackets): Remove.
+       (isearch-error-state): Rename from `isearch-invalid-regexp-state'.
+       (isearch-within-brackets-state): Remove.
+       (isearch-case-fold-search-state, isearch-pop-fun-state):
+       Decrease frame index.
+       (isearch-mode, isearch-top-state, isearch-push-state)
+       (isearch-edit-string, isearch-abort, isearch-search-and-update)
+       (isearch-fallback, isearch-message-prefix, isearch-message-suffix)
+       (isearch-search, isearch-lazy-highlight-new-loop):
+       Replace `isearch-invalid-regexp' with `isearch-error'.
+       Remove `isearch-within-brackets'.
+       (isearch-search): Add `search-failed' handler to `condition-case'.
+       (isearch-lazy-highlight-search): Add `condition-case' to catch
+       errors and allow `isearch-lazy-highlight-update' to try
+       highlighting from the beginning of the window.
+       (isearch-repeat): Move up code to set isearch-wrapped to t
+       before calling isearch-wrap-function.
+
+       * info.el (Info-isearch-initial-node): New internal variable.
+       (Info-search): Signal an error in isearch mode when search leaves
+       the initial node.  Signal an error when `bound' is non-nil and
+       nothing was found in the current subfile.
+       (Info-isearch-search): Remove `condition-case'.
+       (Info-isearch-wrap): Don't wrap when search failed during leaving
+       the initial node.  If `Info-isearch-search' is nil, wrap around
+       the current node.
+       (Info-isearch-start): New fun.
+       (Info-mode): Add buffer-local hook `Info-isearch-start' to
+       `isearch-mode-hook'.
+
+2005-03-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * simple.el (normal-erase-is-backspace): Set default to t if
+       running on Mac.
+
+       * term/mac-win.el (function-key-map): Sync with x-win.el.
+
+2005-03-15  Kenichi Handa  <handa@m17n.org>
+
+       * international/mule-cmds.el (locale-language-names): Modify the
+       format of elements and add more entries.
+       (locale-preferred-coding-systems): Add more entries.
+       (set-locale-environment): Adjust for the change of
+       locale-language-names.
+
+2005-03-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * pcvs.el (smerge-ediff): Remove bogus autoload.
+
+2005-03-14  Lute Kamstra  <lute@gnu.org>
+
+       * emacs-lisp/debug.el (debugger-make-xrefs): Docstring fix.
+       Ignore a `*' at the beginning of a line.
+
+       * subr.el (macro-declaration-function): Move to emacs-lisp/byte-run.el.
+       * emacs-lisp/byte-run.el (macro-declaration-function): Move from
+       subr.el.
+       (dont-compile, eval-when-compile, eval-and-compile): Use declare
+       to specify indentation.
+
+       * generic.el (define-generic-mode): Let generic-mode-list be a
+       list of strings; test membership with equal.
+
 2005-03-14  Kim F. Storm  <storm@cua.dk>
 
        * simple.el (next-line, previous-line): Add optional try-vscroll
 2005-03-11  Kenichi Handa  <handa@m17n.org>
 
        * international/mule.el (make-coding-system): Set property
-       'coding-system-define-form to nil.
+       coding-system-define-form to nil.
        (define-coding-system-alias): Likewise.
 
 2005-03-11  Kenichi Handa  <handa@m17n.org>
index dc3fce4e009478b643913516779ee4a48e42994a..fe648d9d1881722489d9e5dabe13f512c25728ed 100644 (file)
@@ -699,7 +699,9 @@ language you are using."
 (define-key ctl-x-map "\C-n" 'set-goal-column)
 (define-key global-map "\C-a" 'move-beginning-of-line)
 (define-key global-map "\C-e" 'move-end-of-line)
-(define-key esc-map "g" 'goto-line)
+(define-key esc-map "g" (make-sparse-keymap))
+(define-key esc-map "g\M-g" 'goto-line)
+(define-key esc-map "gg" 'goto-line)
 
 ;;(defun function-key-error ()
 ;;  (interactive)
index 8c78d9540bfa29c193f1fa6826e0187e7b5790d5..baa18d769c2cba72a25447b1696aecde25066e76 100644 (file)
@@ -2150,16 +2150,12 @@ the inserted text.  Value is always t."
          (forward-line 1))))
   t)
 
-(defvar calendar-redrawing nil
-  "Internal calendar variable, non-nil if inside redraw-calendar.")
-
 (defun redraw-calendar ()
   "Redraw the calendar display, if `calendar-buffer' is live."
   (interactive)
   (if (get-buffer calendar-buffer)
       (with-current-buffer calendar-buffer
-        (let ((cursor-date (calendar-cursor-to-nearest-date))
-              (calendar-redrawing t))
+        (let ((cursor-date (calendar-cursor-to-nearest-date)))
           (generate-calendar-window displayed-month displayed-year)
           (calendar-cursor-to-visible-date cursor-date)))))
 
index 124b29c3fe76ded14028dde9de2692ff2a8a9df4..6b8f69863813ba86db5911d7550077f44c1eb1be 100644 (file)
@@ -835,21 +835,23 @@ argument PAREN is non-nil, the regexp is surrounded by parentheses."
 (defvar marking-diary-entry nil
   "True during the marking of diary entries, if current entry is marking.")
 
-(defun mark-diary-entries ()
+(defun mark-diary-entries (&optional redraw)
   "Mark days in the calendar window that have diary entries.
-Each entry in the diary file visible in the calendar window is marked.
-After the entries are marked, the hooks `nongregorian-diary-marking-hook' and
-`mark-diary-entries-hook' are run."
-  (interactive)
-  ;; To remove any deleted diary entries.
-  (when (and mark-diary-entries-in-calendar
-             ;; Avoid redrawing when called recursively, eg through
-             ;; mark-diary-entries-hook for #include's, else only get
-             ;; the last set of diary marks.
-             (not marking-diary-entries)
-             ;; If called from redraw-calendar, the calendar has been
-             ;; erased, so no need to unmark the diary entries.
-             (not calendar-redrawing))
+Each entry in the diary file visible in the calendar window is
+marked.  After the entries are marked, the hooks
+`nongregorian-diary-marking-hook' and `mark-diary-entries-hook'
+are run.  If the optional argument REDRAW is non-nil (which is
+the case interactively, for example) then any existing diary
+marks are first removed. This is intended to deal with deleted
+diary entries."
+  (interactive "p")
+  ;; To remove any deleted diary entries. Do not redraw when:
+  ;; i) processing #include diary files (else only get the marks from
+  ;; the last #include file processed).
+  ;; ii) called via calendar-redraw (since calendar has already been
+  ;; erased).
+  ;; Use of REDRAW handles both of these cases.
+  (when (and redraw mark-diary-entries-in-calendar)
     (setq mark-diary-entries-in-calendar nil)
     (redraw-calendar))
   (let ((marking-diary-entries t)
@@ -1661,7 +1663,8 @@ Do nothing if DATE or STRING is nil."
 (defun diary-redraw-calendar ()
   "If `calendar-buffer' is live and diary entries are marked, redraw it."
   (and mark-diary-entries-in-calendar
-       (redraw-calendar))
+       (save-excursion
+         (redraw-calendar)))
   ;; Return value suitable for `write-contents-functions'.
   nil)
 
index ef426494b68ea07630f239fd254d984b7f2ad1a7..60fc862676d79420e73298e595f8429336b960f8 100644 (file)
 
 ;;; Code:
 
+;; We define macro-declaration-function here because it is needed to
+;; handle declarations in macro definitions and this is the first file
+;; loaded by loadup.el that uses declarations in macros.
+
+(defun macro-declaration-function (macro decl)
+  "Process a declaration found in a macro definition.
+This is set as the value of the variable `macro-declaration-function'.
+MACRO is the name of the macro being defined.
+DECL is a list `(declare ...)' containing the declarations.
+The return value of this function is not used."
+  ;; We can't use `dolist' or `cadr' yet for bootstrapping reasons.
+  (let (d)
+    ;; Ignore the first element of `decl' (it's always `declare').
+    (while (setq decl (cdr decl))
+      (setq d (car decl))
+      (cond ((and (consp d) (eq (car d) 'indent))
+            (put macro 'lisp-indent-function (car (cdr d))))
+           ((and (consp d) (eq (car d) 'debug))
+            (put macro 'edebug-form-spec (car (cdr d))))
+           (t
+            (message "Unknown declaration %s" d))))))
+
+(setq macro-declaration-function 'macro-declaration-function)
+
+\f
 ;; Redefined in byte-optimize.el.
 ;; This is not documented--it's not clear that we should promote it.
 (fset 'inline 'progn)
 (put 'inline 'lisp-indent-function 0)
 
-
 ;;; Interface to inline functions.
 
 ;; (defmacro proclaim-inline (&rest fns)
@@ -105,11 +129,10 @@ was first made obsolete, for example a date or a release number."
   (put variable 'byte-obsolete-variable (cons new when))
   variable)
 
-(put 'dont-compile 'lisp-indent-function 0)
 (defmacro dont-compile (&rest body)
   "Like `progn', but the body always runs interpreted (not compiled).
 If you think you need this, you're probably making a mistake somewhere."
-  (declare (debug t))
+  (declare (debug t) (indent 0))
   (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
 
 \f
@@ -118,19 +141,17 @@ If you think you need this, you're probably making a mistake somewhere."
 ;;; definition in the file overrides the magic definitions on the
 ;;; byte-compile-macro-environment.
 
-(put 'eval-when-compile 'lisp-indent-function 0)
 (defmacro eval-when-compile (&rest body)
   "Like `progn', but evaluates the body at compile time.
 The result of the body appears to the compiler as a quoted constant."
-  (declare (debug t))
+  (declare (debug t) (indent 0))
   ;; Not necessary because we have it in b-c-initial-macro-environment
   ;; (list 'quote (eval (cons 'progn body)))
   (cons 'progn body))
 
-(put 'eval-and-compile 'lisp-indent-function 0)
 (defmacro eval-and-compile (&rest body)
   "Like `progn', but evaluates the body at compile time and at load time."
-  (declare (debug t))
+  (declare (debug t) (indent 0))
   ;; Remember, it's magic.
   (cons 'progn body))
 
index 2be217a41c6711c7a564f0095ffb5fadc7efdf4a..e97e9012fc12f3c3413aca4f41f45614ec9c5e24 100644 (file)
@@ -302,7 +302,7 @@ That buffer should be current already."
   (debugger-make-xrefs))
 
 (defun debugger-make-xrefs (&optional buffer)
-  "Attach cross-references to symbol names in the `*Backtrace*' buffer."
+  "Attach cross-references to function names in the `*Backtrace*' buffer."
   (interactive "b")
   (save-excursion
     (set-buffer (or buffer (current-buffer)))
@@ -353,6 +353,7 @@ That buffer should be current already."
       ;; Scan the new part of the backtrace, inserting xrefs.
       (goto-char (point-min))
       (while (progn
+              (goto-char (+ (point) 2))
               (skip-syntax-forward "^w_")
               (not (eobp)))
        (let* ((beg (point))
@@ -364,8 +365,8 @@ That buffer should be current already."
            (goto-char beg)
            ;; help-xref-button needs to operate on something matched
            ;; by a regexp, so set that up for it.
-           (re-search-forward "\\(\\(\\sw\\|\\s_\\)+\\)")
-           (help-xref-button 1 'help-function-def sym file)))
+           (re-search-forward "\\(\\sw\\|\\s_\\)+")
+           (help-xref-button 0 'help-function-def sym file)))
        (forward-line 1))
       (widen))
     (setq debugger-previous-backtrace (buffer-string))))
index 18e5706dc3d1f204fe9e741ce11e9d9c931cc697..eab957e56718c7cca026315c41d29fca3399f274 100644 (file)
@@ -63,7 +63,8 @@
   (concat
    "^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\
 ine-minor-mode\\|un-cvs-mode\\|foo\\|[^cfgv]\\w+\\*?\\)\
-\\|easy-mmode-define-global-mode\\)" find-function-space-re
+\\|easy-mmode-define-global-mode\\|menu-bar-make-toggle\\)"
+   find-function-space-re
    "\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)")
   "The regexp used by `find-function' to search for a function definition.
 Note it must contain a `%s' at the place where `format'
index a4bb4f86d4e9b6e6ec7cc8cf2426daac258bfc9b..ebd4d469f5c4d9bd5ab5cb131f08e76b960f11e3 100644 (file)
@@ -2247,10 +2247,11 @@ is specified, returning t if it is specified."
                endpos
                (thisbuf (current-buffer)))
            (save-excursion
-             (if (not (re-search-forward
-                       (concat prefix "[ \t]*End:[ \t]*" suffix)
-                       nil t))
-                 (error "Local variables list is not properly terminated"))
+             (unless (let ((case-fold-search t))
+                       (re-search-forward
+                        (concat prefix "[ \t]*End:[ \t]*" suffix)
+                        nil t))
+               (error "Local variables list is not properly terminated"))
              (beginning-of-line)
              (setq endpos (point)))
 
index aa12fb56ba190b643713386a5987a4e5f7d9321a..af1c7619e380e895e5511d5da8aa09fbbe1e868a 100644 (file)
@@ -292,6 +292,12 @@ If a number, only buffers greater than this size have fontification messages."
                 (other :tag "always" t)
                 (integer :tag "size"))
   :group 'font-lock)
+
+(defcustom font-lock-lines-before 1
+  "*Number of lines before the changed text to include in refontification."
+  :type 'integer
+  :group 'font-lock
+  :version "22.1")
 \f
 
 ;; Originally these variable values were face names such as `bold' etc.
@@ -1062,7 +1068,8 @@ what properties to clear before refontifying a region.")
       (save-match-data
        ;; Rescan between start of lines enclosing the region.
        (font-lock-fontify-region
-        (progn (goto-char beg) (beginning-of-line) (point))
+        (progn (goto-char beg)
+               (forward-line (- font-lock-lines-before)) (point))
         (progn (goto-char end) (forward-line 1) (point)))))))
 
 (defun font-lock-fontify-block (&optional arg)
index d40b0b346747258a330c154616789f7ecc3a82f1..556cb598f1907ab3573f49433cf616d2224904d9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; generic.el --- defining simple major modes with comment and font-lock
 ;;
-;; Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2004, 2005 Free Software Foundation, Inc.
 ;;
 ;; Author:  Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Fri Sep 27 1996
@@ -215,8 +215,7 @@ FUNCTION-LIST is a list of functions to call to do some additional setup.
 See the file generic-x.el for some examples of `define-generic-mode'."
 
   ;; Add a new entry
-  (unless (assq name generic-mode-list)
-    (push (list (symbol-name name)) generic-mode-list))
+  (add-to-list 'generic-mode-list (symbol-name name))
 
   ;; Add it to auto-mode-alist
   (dolist (re auto-mode-list)
index 9213b44170cc7f5859515e3cb5945ce953e9c87a..b997b86b0c85399c1bb2b44c28e4f51d978faa17 100644 (file)
@@ -1,3 +1,42 @@
+2005-03-16  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * nnimap.el (nnimap-open-connection): Print which authinfo file is
+       used.
+
+       * nneething.el (nneething-map-file-directory): Derive from
+       `gnus-directory'.
+
+       * gnus-art.el (gnus-header-button-alist): Use `gnus-msg-mail' for
+       the To/Cc button.
+
+2005-03-15  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * nnmaildir.el (nnmaildir-request-accept-article): Use
+       `nnheader-cancel-timer' for compatibility with current XEmacs.
+
+2005-03-13  Steve Youngs  <steve@sxemacs.org>
+
+       * gnus.el: Don't try and mark `gnus-agent-save-groups' as an
+       autoloaded function.
+       From: Andrey Slusar <anrays@gmail.com>.
+
+2005-03-13  Steve Youngs  <steve@sxemacs.org>
+
+       * mm-url.el: Require timer-funcs at compile time when in XEmacs
+       for `with-timeout'.
+
+       * mail-source.el: Require timer-funcs at compile time when in
+       XEmacs for `run-with-idle-timer'.  
+
+       * gnus-async.el: Ditto.
+
+       * dgnushack.el: No need to ignore `run-with-idle-timer', XEmacs
+       has this function now. 
+
+2005-03-16  Lute Kamstra  <lute@gnu.org>
+
+       * message.el (message-make-date): Require parse-time.
+
 2005-03-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * nnimap.el (nnimap-retrieve-headers-from-server): Fix last change.
index 1fe9348f759fa0b42697a8100e419f7ca499cef0..ff04bfbb56f95dcb11c68224a7e4d88d6055a34d 100644 (file)
@@ -6336,7 +6336,7 @@ variable it the real callback function."
     ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$"
      1 (>= gnus-button-message-level 0) gnus-button-reply 1)
     ("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+"
-     0 (>= gnus-button-message-level 0) gnus-button-mailto 0)
+     0 (>= gnus-button-message-level 0) gnus-msg-mail 0)
     ("^X-[Uu][Rr][Ll]:" gnus-button-url-regexp
      0 (>= gnus-button-browse-level 0) browse-url 0)
     ("^Subject:" gnus-button-url-regexp
index 43ab0bc887d7b6df99ab512e0ec47459ae53b61b..fef7228d13bc7e8d01f76dcc4c47a6f26b235736 100644 (file)
 (require 'gnus-sum)
 (require 'nntp)
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'timer-funcs)))
+
 (defgroup gnus-asynchronous nil
   "Support for asynchronous operations."
   :group 'gnus)
index fa1da9e82f8e00f2e77f8ca774eb4ba151c40a85..3112a07cb2ef3c17cc5b6bd570d2e37d427bcca2 100644 (file)
@@ -2726,7 +2726,7 @@ gnus-registry.el will populate this if it's loaded.")
       gnus-async-prefetch-article gnus-async-prefetch-remove-group
       gnus-async-halt-prefetch)
      ("gnus-agent" gnus-open-agent gnus-agent-get-function
-      gnus-agent-save-groups gnus-agent-save-active gnus-agent-method-p
+      gnus-agent-save-active gnus-agent-method-p
       gnus-agent-get-undownloaded-list gnus-agent-fetch-session
       gnus-summary-set-agent-mark gnus-agent-save-group-info
       gnus-agent-request-article gnus-agent-retrieve-headers)
index 6ff642ac24b24dee1848c93e30f930afdb41c6db..e9cee4fa6f2f5cb95f095e6d6d7e84eb594f62c2 100644 (file)
@@ -862,7 +862,7 @@ See the Gnus manual for details."
 
 (eval-when-compile
   (if (featurep 'xemacs)
-      (require 'itimer)
+      (require 'timer-funcs)
     (require 'timer)))
 
 (defun mail-source-start-idle-timer ()
index 4d9522c72ab46f75685cddde6226ce55605cf22a..9171385fec047a34f23e5362109c0e2b6e1cfb05 100644 (file)
@@ -4567,6 +4567,7 @@ Otherwise, generate and save a value for `canlock-password' first."
 (defun message-make-date (&optional now)
   "Make a valid data header.
 If NOW, use that time instead."
+  (require 'parse-time)
   (let* ((now (or now (current-time)))
         (zone (nth 8 (decode-time now)))
         (sign "+"))
index 29d956ba64f98fbd6a90a3d8d5740cf66d8b22a3..a66c03908eb652b9aede83038f099adbc55b47bd 100644 (file)
@@ -38,7 +38,9 @@
   (autoload 'executable-find "executable"))
 
 (eval-when-compile
-  (require 'timer))
+  (if (featurep 'xemacs)
+      (require 'timer-funcs)
+    (require 'timer)))
 
 (defgroup mm-url nil
   "A wrapper of url package and external url command for Gnus."
index 7028e239a52844e220806bb0c28732dbee4997b2..d7698efb845f3dd7c3d8476bb05d2dd28d7eed5d 100644 (file)
@@ -37,7 +37,8 @@
 
 (nnoo-declare nneething)
 
-(defvoo nneething-map-file-directory "~/.nneething/"
+(defvoo nneething-map-file-directory
+  (nnheader-concat gnus-directory ".nneething/")
   "Where nneething stores the map files.")
 
 (defvoo nneething-map-file ".nneething"
index 09d9aef6f316349db4d84a6102d7d3e7a1db4499..06bc1d76134def7f967dc628da6eb869c5f57d08 100644 (file)
@@ -728,7 +728,9 @@ If EXAMINE is non-nil the group is selected read-only."
                (imap-capability 'IMAP4rev1 nnimap-server-buffer))
       (imap-close nnimap-server-buffer)
       (nnheader-report 'nnimap "Server %s is not IMAP4 compliant" server))
-    (let* ((list (gnus-parse-netrc nnimap-authinfo-file))
+    (let* ((list (progn (gnus-message 7 "Parsing authinfo file `%s'."
+                                     nnimap-authinfo-file)
+                       (gnus-parse-netrc nnimap-authinfo-file)))
           (port (if nnimap-server-port
                     (int-to-string nnimap-server-port)
                   "imap"))
index 25cbbc8db48d14e67cc4a6a40e67a40bc2531500..618418907e831500d5c45b246a062cad185a4992 100644 (file)
@@ -1344,7 +1344,7 @@ by nnmaildir-request-article.")
         (write-region (point-min) (point-max) tmpfile nil 'no-message nil
                       'excl)
         (unix-sync))) ;; no fsync :(
-      (cancel-timer 24h)
+      (nnheader-cancel-timer 24h)
       (condition-case err
          (add-name-to-file tmpfile curfile)
        (error
index 22d383559a13b0db61d7f4ca476da8259c5a653b..a544af59c840ba29d71384a56b2fc910762cbc8b 100644 (file)
@@ -703,32 +703,29 @@ whose documentation describes the minor mode."
        (dolist (mode minor-mode-list)
          ;; Document a minor mode if it is listed in minor-mode-alist,
          ;; non-nil, and has a function definition.
-         (and (boundp mode) (symbol-value mode)
-              (fboundp mode)
-              (let ((pretty-minor-mode mode))
-                (if (string-match "\\(-minor\\)?-mode\\'"
-                                  (symbol-name mode))
-                    (setq pretty-minor-mode
-                          (capitalize
-                           (substring (symbol-name mode)
-                                      0 (match-beginning 0)))))
-                (push (list pretty-minor-mode mode
-                            (format-mode-line (assq mode minor-mode-alist)))
-                      minor-modes))))
-       (if auto-fill-function
-           ;; copy pure string so we can add face property to it below.
-           (push (list (copy-sequence "Auto Fill") 'auto-fill-mode " Fill")
-                 minor-modes))
+         (let ((fmode (or (get mode :minor-mode-function) mode)))
+           (and (boundp mode) (symbol-value mode)
+                (fboundp fmode)
+                (let ((pretty-minor-mode
+                       (if (string-match "\\(\\(-minor\\)?-mode\\)?\\'"
+                                         (symbol-name fmode))
+                           (capitalize
+                            (substring (symbol-name fmode)
+                                       0 (match-beginning 0)))
+                         fmode)))
+                  (push (list fmode pretty-minor-mode
+                              (format-mode-line (assq mode minor-mode-alist)))
+                        minor-modes)))))
        (setq minor-modes
              (sort minor-modes
-                   (lambda (a b) (string-lessp (car a) (car b)))))
+                   (lambda (a b) (string-lessp (cadr a) (cadr b)))))
        (when minor-modes
          (princ "Summary of minor modes:\n")
          (make-local-variable 'help-button-cache)
          (with-current-buffer standard-output
            (dolist (mode minor-modes)
-             (let ((pretty-minor-mode (nth 0 mode))
-                   (mode-function (nth 1 mode))
+             (let ((mode-function (nth 0 mode))
+                   (pretty-minor-mode (nth 1 mode))
                    (indicator (nth 2 mode)))
                (setq indicator (if (zerop (length indicator))
                                    "no indicator"
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
new file mode 100644 (file)
index 0000000..b5b0f77
--- /dev/null
@@ -0,0 +1,113 @@
+;;; image-mode.el --- support for visiting image files
+;;
+;; Copyright (C) 2005 Free Software Foundation, Inc.
+;;
+;; Author: Richard Stallman <rms@gnu.org>
+;; Keywords: multimedia
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Defines a major mode for visiting image files
+;; that allows conversion between viewing the text of the file
+;; and viewing the file as an image.  Viewing the image
+;; works by putting a `display' text-property on the
+;; image data, with the image-data still present underneath; if the
+;; resulting buffer file is saved to another name it will correctly save
+;; the image data to the new file.
+
+;;; Code:
+
+(require 'image)
+
+;;;###autoload (push '("\\.jpg\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.jpeg\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.gif\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.png\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.tiff\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.tif\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.xbm\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.pbm\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.pgm\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.ppm\\'" . image-mode) auto-mode-alist)
+;;;###autoload (push '("\\.pnm\\'" . image-mode) auto-mode-alist)
+
+(defvar image-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\C-c\C-c" 'image-toggle-display)
+    map)
+  "Major mode keymap for Image mode.")
+
+;;;###autoload
+(defun image-mode ()
+  "Major mode for image files.
+You can use \\<image-mode-map>\\[image-toggle-display]
+to toggle between display as an image and display as text."
+  (interactive)
+  (kill-all-local-variables)
+  (setq mode-name "Image")
+  (setq major-mode 'image-mode)
+  (use-local-map image-mode-map)
+  (run-mode-hooks 'image-mode-hook)
+  (message (substitute-command-keys
+           "Type \\[image-toggle-display] to view the image as an image.")))
+
+(defun image-toggle-display ()
+  "Start or stop displaying an image file as the actual image.
+This command toggles between showing the text of the image file
+and showing the image as an image."
+  (interactive)
+  (if (get-text-property (point-min) 'display)
+      (let ((inhibit-read-only t)
+           (buffer-undo-list t))
+       (remove-list-of-text-properties (point-min) (point-max)
+                                       '(display intangible read-nonsticky
+                                                 read-only front-sticky))
+       (kill-local-variable 'cursor-type)
+       (kill-local-variable 'truncate-lines)
+       (message "Repeat this command to go back to displaying the image"))
+    ;; Turn the image data into a real image, but only if the whole file
+    ;; was inserted
+    (let* ((data
+           (string-make-unibyte
+            (buffer-substring-no-properties (point-min) (point-max))))
+          (image
+           (create-image data nil t))
+          (props
+           `(display ,image
+                     intangible ,image
+                     rear-nonsticky (display intangible)
+                     ;; This a cheap attempt to make the whole buffer
+                     ;; read-only when we're visiting the file (as
+                     ;; opposed to just inserting it).
+                     read-only t front-sticky (read-only)))
+          (buffer-undo-list t))
+      (add-text-properties (point-min) (point-max) props)
+      ;; Inhibit the cursor when the buffer contains only an image,
+      ;; because cursors look very strange on top of images.
+      (setq cursor-type nil)
+      ;; This just makes the arrow displayed in the right fringe
+      ;; area look correct when the image is wider than the window.
+      (setq truncate-lines t)
+      (message "Repeat this command to go back to displaying the file as text"))))
+
+(provide 'image-mode)
+
+;; arch-tag: b5b2b7e6-26a7-4b79-96e3-1546b5c4c6cb
+;;; image-mode.el ends here
index 9a6c93c04d10a722449fcefcfc409a1e7a3327ac..ced73c8fb3ab264cc622e2d1f5f053383771f441 100644 (file)
@@ -227,6 +227,7 @@ height of the image; integer values are taken as pixel values."
                                      image) rear-nonsticky (display)))))
 
 
+;;;###autoload
 (defun insert-sliced-image (image &optional string area rows cols)
   "Insert IMAGE into current buffer at point.
 IMAGE is displayed by inserting STRING into the current buffer
index 87ddfa6a55beb2114b282e17860681b43926bb9d..870e1ad89f6734eb09f04265478a3fc29052d2c3 100644 (file)
@@ -202,14 +202,23 @@ a tab, a carriage return (control-M), a newline, and `]+'."
   :group 'info)
 
 (defcustom Info-isearch-search t
-  "*If non-nil, isearch invoked in Info mode uses `Info-search' function.
-This allows isearch to search through multiple nodes.
-When isearch fails, it wraps and restarts the search from the
-top/final node depending on search direction."
+  "*If non-nil, isearch in Info searches through multiple nodes.
+Before leaving the initial Info node, where isearch was started,
+it fails once with the error message [initial node], and with
+subsequent C-s/C-r continues through other nodes without failing
+with this error message in other nodes.  When isearch fails for
+the rest of the manual, it wraps aroung the whole manual and
+restarts the search from the top/final node depending on
+search direction.
+
+Setting this option to nil restores the default isearch behavior
+with wrapping around the current Info node."
   :version "22.1"
   :type 'boolean
   :group 'info)
 
+(defvar Info-isearch-initial-node nil)
+
 (defcustom Info-mode-hook
   ;; Try to obey obsolete Info-fontify settings.
   (unless (and (boundp 'Info-fontify) (null Info-fontify))
@@ -623,13 +632,13 @@ NO-GOING-BACK is non-nil if recovering from an error in this function;
 it says do not attempt further (recursive) error recovery."
   (info-initialize)
   (setq filename (Info-find-file filename))
+  ;; Go into info buffer.
+  (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
   ;; Record the node we are leaving.
   (if (and Info-current-file (not no-going-back))
       (setq Info-history
             (cons (list Info-current-file Info-current-node (point))
                   Info-history)))
-  ;; Go into info buffer.
-  (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
   (Info-find-node-2 filename nodename no-going-back))
 
 (defun Info-on-current-buffer (&optional nodename)
@@ -1514,6 +1523,14 @@ If DIRECTION is `backward', search in the reverse direction."
                  (setq found (point) beg-found (if backward (match-end 0)
                                                  (match-beginning 0)))
                (setq give-up t))))))
+
+      (when (and isearch-mode Info-isearch-search
+                (not Info-isearch-initial-node)
+                (not bound)
+                (or give-up (and found (not (and (> found opoint-min)
+                                                 (< found opoint-max))))))
+       (signal 'search-failed (list regexp "initial node")))
+
       ;; If no subfiles, give error now.
       (if give-up
          (if (null Info-current-subfile)
@@ -1523,6 +1540,9 @@ If DIRECTION is `backward', search in the reverse direction."
                  (re-search-forward regexp)))
            (setq found nil)))
 
+      (if (and bound (not found))
+         (signal 'search-failed (list regexp)))
+
       (unless (or found bound)
        (unwind-protect
            ;; Try other subfiles.
@@ -1650,25 +1670,28 @@ If DIRECTION is `backward', search in the reverse direction."
 (defun Info-isearch-search ()
   (if Info-isearch-search
       (lambda (string &optional bound noerror count)
-       (condition-case nil
-           (if isearch-word
-               (Info-search (concat "\\b" (replace-regexp-in-string
-                                           "\\W+" "\\\\W+"
-                                           (replace-regexp-in-string
-                                            "^\\W+\\|\\W+$" "" string)) "\\b")
-                            bound noerror count
-                            (unless isearch-forward 'backward))
-             (Info-search (if isearch-regexp string (regexp-quote string))
-                          bound noerror count
-                          (unless isearch-forward 'backward))
-             (point))
-         (error nil)))
+       (if isearch-word
+           (Info-search (concat "\\b" (replace-regexp-in-string
+                                       "\\W+" "\\\\W+"
+                                       (replace-regexp-in-string
+                                        "^\\W+\\|\\W+$" "" string)) "\\b")
+                        bound noerror count
+                        (unless isearch-forward 'backward))
+         (Info-search (if isearch-regexp string (regexp-quote string))
+                      bound noerror count
+                      (unless isearch-forward 'backward))
+         (point)))
     (let ((isearch-search-fun-function nil))
       (isearch-search-fun))))
 
 (defun Info-isearch-wrap ()
-  (when Info-isearch-search
-    (if isearch-forward (Info-top-node) (Info-final-node))
+  (if Info-isearch-search
+      (if Info-isearch-initial-node
+         (progn
+           (if isearch-forward (Info-top-node) (Info-final-node))
+           (goto-char (if isearch-forward (point-min) (point-max))))
+       (setq Info-isearch-initial-node Info-current-node)
+       (setq isearch-wrapped nil))
     (goto-char (if isearch-forward (point-min) (point-max)))))
 
 (defun Info-isearch-push-state ()
@@ -1680,6 +1703,8 @@ If DIRECTION is `backward', search in the reverse direction."
            (string= Info-current-node node))
       (progn (Info-find-node file node) (sit-for 0))))
 
+(defun Info-isearch-start ()
+  (setq Info-isearch-initial-node nil))
 \f
 (defun Info-extract-pointer (name &optional errorname)
   "Extract the value of the node-pointer named NAME.
@@ -3217,6 +3242,7 @@ Advanced commands:
   (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)
   (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
   (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
+  (add-hook 'isearch-mode-hook 'Info-isearch-start nil t)
   (set (make-local-variable 'isearch-search-fun-function)
        'Info-isearch-search)
   (set (make-local-variable 'isearch-wrap-function)
@@ -3597,7 +3623,7 @@ Preserve text properties."
       ;; Fontify titles
       (goto-char (point-min))
       (when not-fontified-p
-        (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$"
+        (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*\\*+\\|==+\\|--+\\|\\.\\.+\\)$"
                                   nil t)
           (let* ((c (preceding-char))
                  (face
@@ -3774,7 +3800,8 @@ Preserve text properties."
               (add-text-properties
                (match-beginning 1) (match-end 1)
                (list
-                'help-echo (if (match-end 3)
+                'help-echo (if (and (match-end 3)
+                                    (not (equal (match-string 3) "")))
                                (concat "mouse-2: go to " (match-string 3))
                              "mouse-2: go to this node")
                 'mouse-face 'highlight)))
@@ -4052,12 +4079,24 @@ BUFFER is the buffer speedbar is requesting buttons for."
   (Info-speedbar-hierarchy-buttons nil 0)
   )
 
-(dolist (mess '("^Node has no Previous$"
+(dolist (mess '("^First node in file$"
+               "^No `.*' in index$"
+               "^No cross-reference named"
+               "^No cross.references in this node$"
+               "^No current info node$"
                "^No menu in this node$"
-               "^Node has no Next$"
-                "^No cross-references in this node^"
-                search-failed
-               "^No \".*\" in index$"))
+               "^No more items in menu$"
+               "^No more nodes$"
+               "^No pointer \\(?:forward\\|backward\\) from this node$"
+               "^No previous `i' command$"
+               "^No previous items in menu$"
+               "^No previous nodes$"
+               "^No such item in menu$"
+               "^No such node or anchor"
+               "^Node has no"
+               "^Point neither on reference nor in menu item description$"
+               "^This is the \\(?:first\\|last\\) Info node you looked at$"
+               search-failed))
   (add-to-list 'debug-ignored-errors mess))
 
 ;;;;  Desktop support
index 9d3cd06851d71f4a5394bf3c1d9595a6c1f153e3..f08305de180b7a5c02a399f5dd26add73458f2e4 100644 (file)
@@ -2012,55 +2012,60 @@ of `buffer-file-coding-system' set by this function."
      ;; and Chinese are exceptions, which are listed in the
      ;; non-standard section at the bottom of locale-language-names.
 
-    ; aa Afar
-    ; ab Abkhazian
+    ("aa_DJ" . "Latin-1") ; Afar
+    ("aa" . "UTF-8")
+    ;; ab Abkhazian
     ("af" . "Latin-1") ; Afrikaans
-    ("am" . "Ethiopic") ; Amharic
+    ("am" "Ethiopic" utf-8) ; Amharic
+    ("an" . "Latin-9") ; Aragonese
     ; ar Arabic glibc uses 8859-6
     ; as Assamese
     ; ay Aymara
-    ; az Azerbaijani
+    ("az" . "UTF-8") ; Azerbaijani
     ; ba Bashkir
-    ("be" . "Belarusian") ; Belarusian [Byelorussian until early 1990s]
-    ("bg" . "Bulgarian") ; Bulgarian
+    ("be" "Belarusian" cp1251) ; Belarusian [Byelorussian until early 1990s]
+    ("bg" "Bulgarian" cp1251) ; Bulgarian
     ; bh Bihari
     ; bi Bislama
-    ; bn Bengali, Bangla
+    ("bn" . "UTF-8") ; Bengali, Bangla
     ("bo" . "Tibetan")
     ("br" . "Latin-1") ; Breton
     ("bs" . "Latin-2") ; Bosnian
+    ("byn" . "UTF-8")  ; Bilin; Blin
     ("ca" . "Latin-1") ; Catalan
     ; co Corsican
-    ("cs" . "Czech")
-    ("cy" . "Welsh") ; Welsh [glibc uses Latin-8.  Did this change?]
+    ("cs" "Czech" iso-8859-2)
+    ("cy" "Welsh" iso-8859-14)
     ("da" . "Latin-1") ; Danish
-    ("de" . "German")
+    ("de" "German" iso-8859-1)
     ; dz Bhutani
-    ("el" . "Greek")
+    ("el" "Greek" iso-8859-7)
     ;; Users who specify "en" explicitly typically want Latin-1, not ASCII.
     ;; That's actually what the GNU locales define, modulo things like
     ;; en_IN -- fx.
+    ("en_IN" "English" utf-8) ; glibc uses utf-8 for English in India
     ("en" . "Latin-1") ; English
     ("eo" . "Latin-3") ; Esperanto
-    ("es" . "Spanish")
-    ("et" . "Latin-4") ; Estonian
+    ("es" "Spanish" iso-8859-1)
+    ("et" . "Latin-1") ; Estonian
     ("eu" . "Latin-1") ; Basque
-    ; fa Persian glibc uses utf-8
+    ("fa" . "UTF-8") ; Persian
     ("fi" . "Latin-1") ; Finnish
-    ; fj Fiji
+    ("fj" . "Latin-1") ; Fiji
     ("fo" . "Latin-1") ; Faroese
-    ("fr" . "French") ; French
+    ("fr" "French" iso-8859-1) ; French
     ("fy" . "Latin-1") ; Frisian
     ("ga" . "Latin-1") ; Irish Gaelic (new orthography)
-    ("gd" . "Latin-1") ; Scots Gaelic
-    ("gl" . "Latin-1") ; Galician
+    ("gd" . "Latin-9") ; Scots Gaelic
+    ("gez" "Ethiopic" utf-8) ; Geez
+    ("gl" . "Latin-1") ; Gallegan; Galician
     ; gn Guarani
-    ; gu Gujarati
-    ("gv" . "Latin-8") ; Manx Gaelic  glibc uses 8859-1
+    ("gu" . "UTF-8") ; Gujarati
+    ("gv" . "Latin-1") ; Manx Gaelic
     ; ha Hausa
-    ("he" . "Hebrew")
-    ("hi" . "Devanagari") ; Hindi  glibc uses utf-8
-    ("hr" . "Croatian") ; Croatian
+    ("he" "Hebrew" iso-8859-8)
+    ("hi" "Devanagari" utf-8) ; Hindi
+    ("hr" "Croatian" iso-8859-2) ; Croatian
     ("hu" . "Latin-2") ; Hungarian
     ; hy Armenian
     ; ia Interlingua
@@ -2068,110 +2073,113 @@ of `buffer-file-coding-system' set by this function."
     ; ie Interlingue
     ; ik Inupiak
     ("is" . "Latin-1") ; Icelandic
-    ("it" . "Italian") ; Italian
+    ("it" "Italian" iso-8859-1) ; Italian
     ; iu Inuktitut
-    ("ja" . "Japanese")
+    ("iw" "Hebrew" iso-8859-8)
+    ("ja" "Japanese" euc-jp)
     ; jw Javanese
-    ("ka" . "Georgian") ; Georgian
+    ("ka" "Georgian" georgian-ps) ; Georgian
     ; kk Kazakh
     ("kl" . "Latin-1") ; Greenlandic
     ; km Cambodian
-    ; kn Kannada
-    ("ko" . "Korean")
+    ("kn" "Kannada" utf-8)
+    ("ko" "Korean" euc-kr)
     ; ks Kashmiri
     ; ku Kurdish
     ("kw" . "Latin-1") ; Cornish
     ; ky Kirghiz
     ("la" . "Latin-1") ; Latin
     ("lb" . "Latin-1") ; Luxemburgish
+    ("lg" . "Laint-6") ; Ganda
     ; ln Lingala
-    ("lo" . "Lao") ; Laothian
-    ("lt" . "Lithuanian")
+    ("lo" "Lao" utf-8) ; Laothian
+    ("lt" "Lithuanian" iso-8859-13)
     ("lv" . "Latvian") ; Latvian, Lettish
     ; mg Malagasy
     ("mi" . "Latin-7") ; Maori
-    ("mk" . "Cyrillic-ISO") ; Macedonian
-    ; ml Malayalam
-    ; mn Mongolian
+    ("mk" "Cyrillic-ISO" iso-8859-5) ; Macedonian
+    ("ml" "Malayalam" utf-8)
+    ("mn" . "UTF-8") ; Mongolian
     ; mo Moldavian
-    ("mr" . "Devanagari") ; Marathi  glibc uses utf-8
+    ("mr" "Devanagari" utf-8) ; Marathi
     ("ms" . "Latin-1") ; Malay
     ("mt" . "Latin-3") ; Maltese
     ; my Burmese
     ; na Nauru
-    ("ne" . "Devanagari") ; Nepali
-    ("nl" . "Dutch")
+    ("nb" . "Latin-1") ; Norwegian
+    ("ne" "Devanagari" utf-8) ; Nepali
+    ("nl" "Dutch" iso-8859-1)
     ("no" . "Latin-1") ; Norwegian
     ("oc" . "Latin-1") ; Occitan
-    ; om (Afan) Oromo
+    ("om_ET" . "UTF-8") ; (Afan) Oromo
+    ("om" . "Latin-1") ; (Afan) Oromo
     ; or Oriya
-    ; pa Punjabi
+    ("pa" . "UTF-8") ; Punjabi
     ("pl" . "Latin-2") ; Polish
     ; ps Pashto, Pushto
     ("pt" . "Latin-1") ; Portuguese
     ; qu Quechua
     ("rm" . "Latin-1") ; Rhaeto-Romanic
     ; rn Kirundi
-    ("ro" . "Romanian")
-    ("ru.*[_.]koi8\\(?:-r\\)?\\'" . "Cyrillic-KOI8") ; Russian
-    ("ru" . "Cyrillic-ISO") ; Russian
+    ("ro" "Romanian" iso-8859-2)
+    ("ru_RU" "Russian" iso-8859-5)
+    ("ru_UA" "Russian" koi8-u)
     ; rw Kinyarwanda
     ("sa" . "Devanagari") ; Sanskrit
     ; sd Sindhi
-    ; se   Northern Sami
+    ("se" . "UTF-8") ; Northern Sami
     ; sg Sangho
     ("sh" . "Latin-2") ; Serbo-Croatian
     ; si Sinhalese
-    ("sk" . "Slovak")
-    ("sl" . "Slovenian")
+    ("sid" . "UTF-8") ; Sidamo
+    ("sk" "Slovak" iso-8859-2)
+    ("sl" "Slovenian" iso-8859-2)
     ; sm Samoan
     ; sn Shona
-    ; so Somali
+    ("so_ET" "UTF-8") ; Somali
+    ("so" "Latin-1") ; Somali
     ("sq" . "Latin-1") ; Albanian
     ("sr" . "Latin-2") ; Serbian (Latin alphabet)
-    ("sr.*@cyrillic" . "Cyrillic-ISO") ; per glibc
     ; ss Siswati
-    ; st Sesotho
+    ("st" . "Latin-1") ;  Sesotho
     ; su Sundanese
-    ("sv" . "Swedish") ; Swedish
+    ("sv" "Swedish" iso-8859-1)                ; Swedish
     ("sw" . "Latin-1") ; Swahili
-    ; ta Tamil  glibc uses utf-8
-    ; te Telugu  glibc uses utf-8
-    ("tg" . "Tajik")
-    ("th" . "Thai")
-    ; ti Tigrinya
+    ("ta" "Tamil" utf-8)
+    ("te" . "UTF-8") ; Telugu
+    ("tg" "Tajik" koi8-t)
+    ("th" "Thai" tis-620)
+    ("ti" "Ethiopic" utf-8) ; Tigrinya
+    ("tig_ER" . "UTF-8") ; Tigre
     ; tk Turkmen
     ("tl" . "Latin-1") ; Tagalog
     ; tn Setswana
     ; to Tonga
-    ("tr" . "Turkish")
+    ("tr" "Turkish" iso-8859-9)
     ; ts Tsonga
-    ; tt Tatar
+    ("tt" . "UTF-8") ; Tatar
     ; tw Twi
     ; ug Uighur
-    ("uk" . "Ukrainian") ; Ukrainian
-    ; ur Urdu  glibc uses utf-8
+    ("uk" "Ukrainian" koi8-u)
+    ("ur" . "UTF-8") ; Urdu
+    ("uz_UZ@cyrillic" . "UTF-8"); Uzbek
     ("uz" . "Latin-1") ; Uzbek
-    ("vi" . "Vietnamese") ;  glibc uses utf-8
+    ("vi" "Vietnamese" utf-8)
     ; vo Volapuk
     ("wa" . "Latin-1") ; Walloon
     ; wo Wolof
-    ; xh Xhosa
+    ("xh" . "Latin-1") ; Xhosa
     ("yi" . "Windows-1255") ; Yiddish
     ; yo Yoruba
     ; za Zhuang
-
-    ; glibc:
-    ; zh_HK/BIG5-HKSCS \
-
-    ("zh.*[._]big5" . "Chinese-BIG5")
-    ("zh.*[._]gb18030" . "Chinese-GB18030") ; zh_CN.GB18030/GB18030 in glibc
-    ("zh.*[._]gbk" . "Chinese-GBK")
-    ;; glibc has zh_TW.EUC-TW, with zh_TW defaulting to Big5
-    ("zh_tw" . "Chinese-CNS") ; glibc uses big5
-    ("zh_tw[._]euc-tw" . "Chinese-EUC-TW")
+    ("zh_HK" . "Chinese-Big5")
+    ("zh_TW" . "Chinese-Big5")
+    ("zh_CN" . "Chinese-GB")
     ("zh" . "Chinese-GB")
-    ; zu Zulu
+    ; zh_CN.GB18030/GB18030 \
+    ; zh_CN.GBK/GBK \
+    ; zh_HK/BIG5-HKSCS \
+    ("zu" . "Latin-1") ; Zulu
 
     ;; ISO standard locales
     ("c$" . "ASCII")
@@ -2191,10 +2199,16 @@ of `buffer-file-coding-system' set by this function."
     ("chs" . "Chinese-GB") ; MS Windows Chinese Simplified
     ("cht" . "Chinese-BIG5") ; MS Windows Chinese Traditional
     ))
-  "List of pairs of locale regexps and language names.
-The first element whose locale regexp matches the start of a downcased locale
-specifies the language name corresponding to that locale.
-If the language name is nil, there is no corresponding language environment.")
+  "Alist of locale regexps vs the corresponding languages and coding systems.
+Each element has these form:
+  \(LOCALE-REGEXP LANG-ENV CODING-SYSTEM)
+The first element whose LOCALE-REGEXP matches the start of a
+downcased locale specifies the LANG-ENV \(language environtment)
+and CODING-SYSTEM corresponding to that locale.  If there is no
+appropriate language environment, the element may have this form:
+  \(LOCALE-REGEXP . LANG-ENV)
+In this case, LANG-ENV is one of generic language environments for an
+specific encoding such as \"Latin-1\" and \"UTF-8\".")
 
 (defconst locale-charset-language-names
   (purecopy
@@ -2212,20 +2226,43 @@ If the language name is nil, there is no corresponding language environment.")
   "List of pairs of locale regexps and charset language names.
 The first element whose locale regexp matches the start of a downcased locale
 specifies the language name whose charset corresponds to that locale.
-This language name is used if its charsets disagree with the charsets of
-the language name that would otherwise be used for this locale.")
+This language name is used if the locale is not listed in
+`locale-language-names'")
 
 (defconst locale-preferred-coding-systems
   (purecopy
-   '(("ja.*[._]euc" . japanese-iso-8bit)
+   '((".*8859[-_]?1\\>" . iso-8859-1)
+     (".*8859[-_]?2\\>" . iso-8859-2)
+     (".*8859[-_]?3\\>" . iso-8859-3)
+     (".*8859[-_]?4\\>" . iso-8859-4)
+     (".*8859[-_]?9\\>" . iso-8859-9)
+     (".*8859[-_]?14\\>" . iso-8859-14)
+     (".*8859[-_]?15\\>" . iso-8859-15)
+     (".*utf\\(?:-?8\\)?" . utf-8)
+     ;; utf-8@euro exists, so put this after utf-8.  (@euro really
+     ;; specifies the currency, rather than the charset.)
+     (".*@euro" . iso-8859-15)
+     ("koi8-?r" . koi8-r)
+     ("koi8-?u" . koi8-u)
+     ("tcvn" . tcvn)
+     ("big5" . big5)
+     ("euc-?tw" . euc-tw)
+     ;; We don't support GBK, but as it is upper compatible with
+     ;; GB-2312, we setup the default coding system to gb2312.
+     ("gbk" . gb2312)
+     ;; We don't support BIG5-HKSCS, but as it is upper compatible with
+     ;; BIG5, we setup the default coding system to big5.
+     ("big5hkscs" . big5)
+     ("ja.*[._]euc" . japanese-iso-8bit)
      ("ja.*[._]jis7" . iso-2022-jp)
      ("ja.*[._]pck" . japanese-shift-jis)
      ("ja.*[._]sjis" . japanese-shift-jis)
      ("jpn" . japanese-shift-jis)   ; MS-Windows uses this.
-     (".*[._]utf" . utf-8)))
+     ))
   "List of pairs of locale regexps and preferred coding systems.
 The first element whose locale regexp matches the start of a downcased locale
-specifies the coding system to prefer when using that locale.")
+specifies the coding system to prefer when using that locale.
+This coding system is used if the locale specifies a specific charset.")
 
 (defun locale-name-match (key alist)
   "Search for KEY in ALIST, which should be a list of regexp-value pairs.
@@ -2356,12 +2393,17 @@ See also `locale-charset-language-names', `locale-language-names',
                       (locale-charset-to-coding-system
                        (match-string 1 locale)))))))
 
-       ;; Give preference to charset-language-name over language-name.
-       (if (and charset-language-name
-                (not
-                 (equal (get-language-info language-name 'charset)
-                        (get-language-info charset-language-name 'charset))))
-           (setq language-name charset-language-name))
+       (if (consp language-name)
+           ;; locale-language-names specify both lang-env and coding.
+           ;; But, what specified in locale-preferred-coding-systems
+           ;; has higher priority.
+           (setq coding-system (or coding-system
+                                   (nth 1 language-name))
+                 language-name (car language-name))
+         ;; Otherwise, if locale is not listed in locale-language-names,
+         ;; use what listed in locale-charset-language-names.
+         (if (not language-name)
+             (setq language-name charset-language-name)))
 
        (when language-name
 
@@ -2387,7 +2429,9 @@ See also `locale-charset-language-names', `locale-language-names',
          (setq locale-coding-system
                (car (get-language-info language-name 'coding-priority))))
 
-       (when coding-system
+       (when (and coding-system
+                  (not (coding-system-equal coding-system
+                                            locale-coding-system)))
          (prefer-coding-system coding-system)
          (setq locale-coding-system coding-system))
        (when (get-language-info current-language-environment 'coding-priority)
index 6aff3e4f497ec45164dc8a6f8b095407b248cb10..7594923a7e9f85f5263894638106a45093070622 100644 (file)
@@ -3,6 +3,9 @@
 ;; Copyright (C) 1995, 2000 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
 ;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 2005
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Author: Kenichi HANDA <handa@etl.go.jp>
 ;;        Naoto TAKAHASHI <ntakahas@etl.go.jp>
@@ -1300,7 +1303,8 @@ If STR has `advice' text property, append the following special event:
       (list key)
     (quail-setup-overlays (quail-conversion-keymap))
     (let ((modified-p (buffer-modified-p))
-         (buffer-undo-list t))
+         (buffer-undo-list t)
+         (inhibit-modification-hooks t))
       (unwind-protect
          (let ((input-string (if (quail-conversion-keymap)
                                  (quail-start-conversion key)
index d67a27e2365f45f2a235ddcacd5c7488b7399da2..d7fe01bf0104cff82bfd952216c7f53fbb780a75 100644 (file)
@@ -238,25 +238,25 @@ and `lazy-highlight-interval')."
 (defcustom lazy-highlight-cleanup t
   "*Controls whether to remove extra highlighting after a search.
 If this is nil, extra highlighting can be \"manually\" removed with
-\\[isearch-lazy-highlight-cleanup]."
+\\[lazy-highlight-cleanup]."
   :type 'boolean
   :group 'lazy-highlight)
 (defvaralias 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup)
-(make-obsolete-variable 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup)
+(make-obsolete-variable 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup "22.1")
 
 (defcustom lazy-highlight-initial-delay 0.25
   "*Seconds to wait before beginning to lazily highlight all matches."
   :type 'number
   :group 'lazy-highlight)
 (defvaralias 'isearch-lazy-highlight-initial-delay 'lazy-highlight-initial-delay)
-(make-obsolete-variable 'isearch-lazy-highlight-initial-delay 'lazy-highlight-initial-delay)
+(make-obsolete-variable 'isearch-lazy-highlight-initial-delay 'lazy-highlight-initial-delay "22.1")
 
 (defcustom lazy-highlight-interval 0 ; 0.0625
   "*Seconds between lazily highlighting successive matches."
   :type 'number
   :group 'lazy-highlight)
 (defvaralias 'isearch-lazy-highlight-interval 'lazy-highlight-interval)
-(make-obsolete-variable 'isearch-lazy-highlight-interval 'lazy-highlight-interval)
+(make-obsolete-variable 'isearch-lazy-highlight-interval 'lazy-highlight-interval "22.1")
 
 (defcustom lazy-highlight-max-at-a-time 20
   "*Maximum matches to highlight at a time (for `lazy-highlight').
@@ -267,7 +267,7 @@ A value of nil means highlight all matches."
                 (integer :tag "Some"))
   :group 'lazy-highlight)
 (defvaralias 'isearch-lazy-highlight-max-at-a-time 'lazy-highlight-max-at-a-time)
-(make-obsolete-variable 'isearch-lazy-highlight-max-at-a-time 'lazy-highlight-max-at-a-time)
+(make-obsolete-variable 'isearch-lazy-highlight-max-at-a-time 'lazy-highlight-max-at-a-time "22.1")
 
 (defface lazy-highlight
   '((((class color) (min-colors 88) (background light))
@@ -284,7 +284,7 @@ A value of nil means highlight all matches."
 (put 'isearch-lazy-highlight-face 'face-alias 'lazy-highlight)
 (defvar lazy-highlight-face 'lazy-highlight)
 (defvaralias 'isearch-lazy-highlight-face 'lazy-highlight-face)
-(make-obsolete-variable 'isearch-lazy-highlight-face 'lazy-highlight-face)
+(make-obsolete-variable 'isearch-lazy-highlight-face 'lazy-highlight-face "22.1")
 \f
 ;; Define isearch-mode keymap.
 
@@ -433,9 +433,8 @@ Each set is a vector of the form:
 (defvar isearch-string "")  ; The current search string.
 (defvar isearch-message "") ; text-char-description version of isearch-string
 
-(defvar isearch-success t)             ; Searching is currently successful.
-(defvar isearch-invalid-regexp nil)    ; Regexp not well formed.
-(defvar isearch-within-brackets nil)   ; Regexp has unclosed [.
+(defvar isearch-success t)     ; Searching is currently successful.
+(defvar isearch-error nil)     ; Error message for failed search.
 (defvar isearch-other-end nil) ; Start (end) of match if forward (backward).
 (defvar isearch-wrapped nil)   ; Searching restarted from the top (bottom).
 (defvar isearch-barrier 0)
@@ -636,8 +635,7 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
        isearch-barrier (point)
        isearch-adjusted nil
        isearch-yank-flag nil
-       isearch-invalid-regexp nil
-       isearch-within-brackets nil
+       isearch-error nil
        isearch-slow-terminal-mode (and (<= baud-rate search-slow-speed)
                                        (> (window-height)
                                           (* 4
@@ -742,7 +740,7 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
    isearch-adjusted nil
    isearch-yank-flag nil)
   (when isearch-lazy-highlight
-    (isearch-lazy-highlight-new-loop nil nil))
+    (isearch-lazy-highlight-new-loop))
   ;; We must prevent the point moving to the end of composition when a
   ;; part of the composition has just been searched.
   (setq disable-point-adjustment t))
@@ -766,7 +764,7 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
   ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs
   (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout)
   (isearch-dehighlight)
-  (isearch-lazy-highlight-cleanup lazy-highlight-cleanup)
+  (lazy-highlight-cleanup lazy-highlight-cleanup)
   (let ((found-start (window-start (selected-window)))
        (found-point (point)))
     (if isearch-window-configuration
@@ -863,7 +861,7 @@ REGEXP says which ring to use."
 (defsubst isearch-word-state (frame)
   "Return the search-by-word flag in FRAME."
   (aref frame 6))
-(defsubst isearch-invalid-regexp-state (frame)
+(defsubst isearch-error-state (frame)
   "Return the regexp error message in FRAME, or nil if its regexp is valid."
   (aref frame 7))
 (defsubst isearch-wrapped-state (frame)
@@ -872,15 +870,12 @@ REGEXP says which ring to use."
 (defsubst isearch-barrier-state (frame)
   "Return the barrier value in FRAME."
   (aref frame 9))
-(defsubst isearch-within-brackets-state (frame)
-  "Return the in-character-class flag in FRAME."
-  (aref frame 10))
 (defsubst isearch-case-fold-search-state (frame)
   "Return the case-folding flag in FRAME."
-  (aref frame 11))
+  (aref frame 10))
 (defsubst isearch-pop-fun-state (frame)
   "Return the function restoring the mode-specific isearch state in FRAME."
-  (aref frame 12))
+  (aref frame 11))
 
 (defun isearch-top-state ()
   (let ((cmd (car isearch-cmds)))
@@ -890,10 +885,9 @@ REGEXP says which ring to use."
          isearch-forward (isearch-forward-state cmd)
          isearch-other-end (isearch-other-end-state cmd)
          isearch-word (isearch-word-state cmd)
-         isearch-invalid-regexp (isearch-invalid-regexp-state cmd)
+         isearch-error (isearch-error-state cmd)
          isearch-wrapped (isearch-wrapped-state cmd)
          isearch-barrier (isearch-barrier-state cmd)
-         isearch-within-brackets (isearch-within-brackets-state cmd)
          isearch-case-fold-search (isearch-case-fold-search-state cmd))
     (if (functionp (isearch-pop-fun-state cmd))
        (funcall (isearch-pop-fun-state cmd) cmd))
@@ -908,8 +902,8 @@ REGEXP says which ring to use."
        (cons (vector isearch-string isearch-message (point)
                      isearch-success isearch-forward isearch-other-end
                      isearch-word
-                     isearch-invalid-regexp isearch-wrapped isearch-barrier
-                     isearch-within-brackets isearch-case-fold-search
+                     isearch-error isearch-wrapped isearch-barrier
+                     isearch-case-fold-search
                      (if isearch-push-state-function
                          (funcall isearch-push-state-function)))
              isearch-cmds)))
@@ -972,8 +966,7 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst
              (isearch-barrier isearch-barrier)
              (isearch-adjusted isearch-adjusted)
              (isearch-yank-flag isearch-yank-flag)
-             (isearch-invalid-regexp isearch-invalid-regexp)
-             (isearch-within-brackets isearch-within-brackets)
+             (isearch-error isearch-error)
   ;;; Don't bind this.  We want isearch-search, below, to set it.
   ;;; And the old value won't matter after that.
   ;;;      (isearch-other-end isearch-other-end)
@@ -1120,7 +1113,7 @@ Use `isearch-exit' to quit without signaling."
         (isearch-cancel))
     ;; If search is failing, or has an incomplete regexp,
     ;; rub out until it is once more successful.
-    (while (or (not isearch-success) isearch-invalid-regexp)
+    (while (or (not isearch-success) isearch-error)
       (isearch-pop-state))
     (isearch-update)))
 
@@ -1142,10 +1135,11 @@ Use `isearch-exit' to quit without signaling."
        ;; If already have what to search for, repeat it.
        (or isearch-success
            (progn
+             ;; Set isearch-wrapped before calling isearch-wrap-function
+             (setq isearch-wrapped t)
              (if isearch-wrap-function
                  (funcall isearch-wrap-function)
-               (goto-char (if isearch-forward (point-min) (point-max))))
-             (setq isearch-wrapped t))))
+               (goto-char (if isearch-forward (point-min) (point-max)))))))
     ;; C-s in reverse or C-r in forward, change direction.
     (setq isearch-forward (not isearch-forward)))
 
@@ -1380,8 +1374,7 @@ might return the position of the end of the line."
                     (min isearch-opoint isearch-barrier))))
        (progn
          (setq isearch-success t
-               isearch-invalid-regexp nil
-               isearch-within-brackets nil
+               isearch-error nil
                isearch-other-end (match-end 0))
          (if (and (eq isearch-case-fold-search t) search-upper-case)
              (setq isearch-case-fold-search
@@ -1428,8 +1421,8 @@ barrier."
                                (not want-backslash))
             ;; We have to check 2 stack frames because the last might be
             ;; invalid just because of a backslash.
-            (or (not isearch-invalid-regexp)
-                (not (isearch-invalid-regexp-state (cadr isearch-cmds)))
+            (or (not isearch-error)
+                (not (isearch-error-state (cadr isearch-cmds)))
                 allow-invalid))
     (if to-barrier
        (progn (goto-char isearch-barrier)
@@ -1444,7 +1437,7 @@ barrier."
        ;; Also skip over postfix operators -- though horrid,
        ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal.
        (while (and previous
-                   (or (isearch-invalid-regexp-state frame)
+                   (or (isearch-error-state frame)
                        (let* ((string (isearch-string-state frame))
                               (lchar (aref string (1- (length string)))))
                          ;; The operators aren't always operators; check
@@ -1461,8 +1454,10 @@ barrier."
          ;; `stack' now refers the most recent valid regexp that is not at
          ;; all optional in its last term.  Now dig one level deeper and find
          ;; what matched before that.
-         (let ((last-other-end (or (isearch-other-end-state (car previous))
-                                   isearch-barrier)))
+         (let ((last-other-end
+                (or (and (car previous)
+                         (isearch-other-end-state (car previous)))
+                    isearch-barrier)))
            (goto-char (if isearch-forward
                           (max last-other-end isearch-barrier)
                         (min last-other-end isearch-barrier)))
@@ -1556,6 +1551,7 @@ Scroll-bar or mode-line events are processed appropriately."
 (put 'delete-other-windows 'isearch-scroll t)
 (put 'balance-windows 'isearch-scroll t)
 (put 'split-window-vertically 'isearch-scroll t)
+(put 'split-window-horizontally 'isearch-scroll t)
 (put 'enlarge-window 'isearch-scroll t)
 
 ;; Universal argument commands
@@ -1977,11 +1973,10 @@ If there is no completion possible, say so and continue searching."
   ;; If about to search, and previous search regexp was invalid,
   ;; check that it still is.  If it is valid now,
   ;; let the message we display while searching say that it is valid.
-  (and isearch-invalid-regexp ellipsis
+  (and isearch-error ellipsis
        (condition-case ()
           (progn (re-search-forward isearch-string (point) t)
-                 (setq isearch-invalid-regexp nil
-                       isearch-within-brackets nil))
+                 (setq isearch-error nil))
         (error nil)))
   ;; If currently failing, display no ellipsis.
   (or isearch-success (setq ellipsis nil))
@@ -2007,8 +2002,8 @@ If there is no completion possible, say so and continue searching."
 
 (defun isearch-message-suffix (&optional c-q-hack ellipsis)
   (concat (if c-q-hack "^Q" "")
-         (if isearch-invalid-regexp
-             (concat " [" isearch-invalid-regexp "]")
+         (if isearch-error
+             (concat " [" isearch-error "]")
            "")))
 
 \f
@@ -2045,8 +2040,7 @@ Can be changed via `isearch-search-fun-function' for special needs."
            (case-fold-search isearch-case-fold-search)
            (search-spaces-regexp search-whitespace-regexp)
            (retry t))
-       (if isearch-regexp (setq isearch-invalid-regexp nil))
-       (setq isearch-within-brackets nil)
+       (setq isearch-error nil)
        (while retry
          (setq isearch-success
                (funcall
@@ -2070,16 +2064,19 @@ Can be changed via `isearch-search-fun-function' for special needs."
          (setq isearch-success nil))
 
     (invalid-regexp
-     (setq isearch-invalid-regexp (car (cdr lossage)))
-     (setq isearch-within-brackets (string-match "\\`Unmatched \\["
-                                                isearch-invalid-regexp))
+     (setq isearch-error (car (cdr lossage)))
      (if (string-match
          "\\`Premature \\|\\`Unmatched \\|\\`Invalid "
-         isearch-invalid-regexp)
-        (setq isearch-invalid-regexp "incomplete input")))
+         isearch-error)
+        (setq isearch-error "incomplete input")))
+
+    (search-failed
+     (setq isearch-success nil)
+     (setq isearch-error (nth 2 lossage)))
+
     (error
      ;; stack overflow in regexp search.
-     (setq isearch-invalid-regexp (format "%s" lossage))))
+     (setq isearch-error (format "%s" lossage))))
 
   (if isearch-success
       nil
@@ -2311,7 +2308,7 @@ since they have special meaning in a regexp."
 ;;    `isearch-word' and `isearch-regexp';
 ;;  - the direction of the current search is expected to be given by
 ;;    `isearch-forward';
-;;  - the variable `isearch-invalid-regexp' is expected to be true
+;;  - the variable `isearch-error' is expected to be true
 ;;    iff `isearch-string' is an invalid regexp.
 
 (defvar isearch-lazy-highlight-overlays nil)
@@ -2328,7 +2325,7 @@ since they have special meaning in a regexp."
 (defvar isearch-lazy-highlight-case-fold-search nil)
 (defvar isearch-lazy-highlight-regexp nil)
 
-(defun isearch-lazy-highlight-cleanup (&optional force)
+(defun lazy-highlight-cleanup (&optional force)
   "Stop lazy highlighting and remove extra highlighting from current buffer.
 FORCE non-nil means do it whether or not `lazy-highlight-cleanup'
 is nil.  This function is called when exiting an incremental search if
@@ -2343,7 +2340,10 @@ is nil.  This function is called when exiting an incremental search if
     (cancel-timer isearch-lazy-highlight-timer)
     (setq isearch-lazy-highlight-timer nil)))
 
-(defun isearch-lazy-highlight-new-loop (beg end)
+(defalias 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup)
+(make-obsolete 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup "22.1")
+
+(defun isearch-lazy-highlight-new-loop (&optional beg end)
   "Cleanup any previous `lazy-highlight' loop and begin a new one.
 BEG and END specify the bounds within which highlighting should occur.
 This is called when `isearch-update' is invoked (which can cause the
@@ -2364,8 +2364,8 @@ by other Emacs features."
                  (not (= (window-end)   ; Window may have been split/joined.
                          isearch-lazy-highlight-window-end))))
     ;; something important did indeed change
-    (isearch-lazy-highlight-cleanup t) ;kill old loop & remove overlays
-    (when (not isearch-invalid-regexp)
+    (lazy-highlight-cleanup t) ;kill old loop & remove overlays
+    (when (not isearch-error)
       (setq isearch-lazy-highlight-start-limit beg
            isearch-lazy-highlight-end-limit end)
       (setq isearch-lazy-highlight-window       (selected-window)
@@ -2385,20 +2385,23 @@ by other Emacs features."
 (defun isearch-lazy-highlight-search ()
   "Search ahead for the next or previous match, for lazy highlighting.
 Attempt to do the search exactly the way the pending isearch would."
-  (let ((case-fold-search isearch-case-fold-search)
+  (let ((case-fold-search isearch-lazy-highlight-case-fold-search)
+       (isearch-regexp isearch-lazy-highlight-regexp)
        (search-spaces-regexp search-whitespace-regexp))
-    (funcall (isearch-search-fun)
-             isearch-string
-             (if isearch-forward
-                 (min (or isearch-lazy-highlight-end-limit (point-max))
-                     (if isearch-lazy-highlight-wrapped
-                         isearch-lazy-highlight-start
-                       (window-end)))
-               (max (or isearch-lazy-highlight-start-limit (point-min))
-                   (if isearch-lazy-highlight-wrapped
-                       isearch-lazy-highlight-end
-                     (window-start))))
-             t)))
+    (condition-case nil
+       (funcall (isearch-search-fun)
+                isearch-lazy-highlight-last-string
+                (if isearch-forward
+                    (min (or isearch-lazy-highlight-end-limit (point-max))
+                         (if isearch-lazy-highlight-wrapped
+                             isearch-lazy-highlight-start
+                           (window-end)))
+                  (max (or isearch-lazy-highlight-start-limit (point-min))
+                       (if isearch-lazy-highlight-wrapped
+                           isearch-lazy-highlight-end
+                         (window-start))))
+                t)
+      (error nil))))
 
 (defun isearch-lazy-highlight-update ()
   "Update highlighting of other matches for current search."
@@ -2440,7 +2443,7 @@ Attempt to do the search exactly the way the pending isearch would."
                        ;; non-zero-length match
                        (let ((ov (make-overlay mb me)))
                          (push ov isearch-lazy-highlight-overlays)
-                         (overlay-put ov 'face isearch-lazy-highlight-face)
+                         (overlay-put ov 'face lazy-highlight-face)
                          (overlay-put ov 'priority 0) ;lower than main overlay
                          (overlay-put ov 'window (selected-window))))
                      (if isearch-forward
index 259a102c61ea0a012228789f85af77285cf040e0..b39fadf9567db386845e96e1f3bdeac6c945c609 100644 (file)
 (defconst thai-category-table (make-category-table))
 (define-category ?c "Thai consonant" thai-category-table)
 (define-category ?v "Thai upper/lower vowel" thai-category-table)
-(define-category ?t "Thai tone" thai-category-table)
+(define-category ?t "Thai tone mark" thai-category-table)
+(define-category ?u "Thai tone mark and upper sign" thai-category-table)
+(define-category ?I "THAI CHARACTER SARA I" thai-category-table)
+(define-category ?U "THAI CHARACTER THANTHAKHAT" thai-category-table)
 
 ;; The general composing rules are as follows:
 ;;
 ;;                          T
-;;       V        T         V                  T
-;; CV -> C, CT -> C, CVT -> C, Cv -> C, CvT -> C
+;;       V        U         V                  U
+;; CV -> C, CU -> C, CVT -> C, Cv -> C, CvU -> C
 ;;                                   v         v
 ;;
-;; where C: consonant, V: vowel upper, v: vowel lower, T: tone mark.
+;; where C: consonant, V: vowel upper, v: vowel lower,
+;;       T: tone mark, U: tone mark and upper sign.
+;; Special rule: The sign `\e,Tl\e(B' can be put on the vowel `\e,TT\e(B'.
 
-(defvar thai-composition-pattern "\\cc\\(\\ct\\|\\cv\\ct?\\)"
+
+(defvar thai-composition-pattern
+  "\\cc\\(\\cu\\|\\cI\\cU\\|\\cv\\ct?\\)\\|\\cv\\ct\\|\\cI\\cU"
   "Regular expression matching a Thai composite sequence.")
 
+(defun thai-self-insert-command (&optional n)
+  "Insert the Thai character you type.
+The character will be composed with the surrounding Thai character
+if necessary."
+  (interactive "*p")
+  (let ((pos (point))
+       category-set ch)
+    (self-insert-command n)
+    (or thai-auto-composition-mode
+       (thai-auto-composition (1- (point)) (point) 0))))
+
 (let ((l '((?\e,T!\e(B consonant "LETTER KO KAI")                                ; 0xA1
           (?\e,T"\e(B consonant "LETTER KHO KHAI")                               ; 0xA2
           (?\e,T#\e(B consonant "LETTER KHO KHUAT")                              ; 0xA3
           (?\e,Td\e(B vowel-base "VOWEL SIGN SARA MAI MALAI")                    ; 0xE4
           (?\e,Te\e(B vowel-base "LAK KHANG YAO")                                ; 0xE5
           (?\e,Tf\e(B special "MAI YAMOK (repetion)")                            ; 0xE6
-          (?\e,Tg\e(B vowel-upper "VOWEL SIGN MAI TAI KHU N/S-T")                ; 0xE7
+          (?\e,Tg\e(B sign-upper "VOWEL SIGN MAI TAI KHU N/S-T")         ; 0xE7
           (?\e,Th\e(B tone "TONE MAI EK N/S-T")                          ; 0xE8
           (?\e,Ti\e(B tone "TONE MAI THO N/S-T")                         ; 0xE9
           (?\e,Tj\e(B tone "TONE MAI TRI N/S-T")                         ; 0xEA
           (?\e,Tk\e(B tone "TONE MAI CHATTAWA N/S-T")                            ; 0xEB
-          (?\e,Tl\e(B tone "THANTHAKHAT N/S-T (cancellation mark)")              ; 0xEC
-          (?\e,Tm\e(B tone "NIKKHAHIT N/S-T (final nasal)")                      ; 0xED
-          (?\e,Tn\e(B vowel-upper "YAMAKKAN N/S-T")                              ; 0xEE
+          (?\e,Tl\e(B sign-upper "THANTHAKHAT N/S-T (cancellation mark)")        ; 0xEC
+          (?\e,Tm\e(B sign-upper "NIKKHAHIT N/S-T (final nasal)")                ; 0xED
+          (?\e,Tn\e(B sign-upper "YAMAKKAN N/S-T")                               ; 0xEE
           (?\e,To\e(B special "FONRMAN")                                 ; 0xEF
           (?\e,Tp\e(B special "DIGIT ZERO")                                      ; 0xF0
           (?\e,Tq\e(B special "DIGIT ONE")                                       ; 0xF1
          (ptype (nth 1 elm)))
       (put-char-code-property char 'phonetic-type ptype)
       (cond ((eq ptype 'consonant)
-            (modify-category-entry char ?c thai-category-table))
+            (modify-category-entry char ?c thai-category-table)
+            (global-set-key (vector char) 'thai-self-insert-command))
            ((memq ptype '(vowel-upper vowel-lower))
-            (modify-category-entry char ?v thai-category-table))
+            (modify-category-entry char ?v thai-category-table)
+            (if (or (= char ?\e,TT\e(B) (= char ?\e$,1C4\e(B))
+                ;; Give category `I' to "SARA I".
+                (modify-category-entry char ?I thai-category-table))
+            (global-set-key (vector char) 'thai-self-insert-command))
            ((eq ptype 'tone)
-            (modify-category-entry char ?t thai-category-table)))
+            (modify-category-entry char ?t thai-category-table)
+            (modify-category-entry char ?u thai-category-table)
+            (global-set-key (vector char) 'thai-self-insert-command))
+           ((eq ptype 'sign-upper)
+            (modify-category-entry char ?u thai-category-table)
+            (if (or (= char ?\e,Tl\e(B) (= char ?\e$,1CL\e(B))
+                ;; Give category `U' to "THANTHAKHAT".
+                (modify-category-entry char ?U thai-category-table))
+            (global-set-key (vector char) 'thai-self-insert-command)))
       (put-char-code-property char 'name (nth 2 elm)))))
 
+(defun thai-compose-syllable (beg end &optional category-set string)
+  (or category-set
+      (setq category-set 
+           (char-category-set (if string (aref string beg) (char-after beg)))))
+  (if (aref category-set ?c)
+      ;; Starting with a consonant.  We do relative composition.
+      (if string
+         (compose-string string beg end)
+       (compose-region beg end))
+    ;; Vowel tone sequence.
+    (if string
+       (compose-string string beg end (list (aref string beg) '(Bc . Bc) 
+                                            (aref string (1+ beg))))
+      (compose-region beg end (list (char-after beg) '(Bc . Bc) 
+                                   (char-after (1+ beg))))))
+  (- end beg))
+
 ;;;###autoload
 (defun thai-compose-region (beg end)
   "Compose Thai characters in the region.
 When called from a program, expects two arguments,
 positions (integers or markers) specifying the region."
   (interactive "r")
-  (save-restriction
-    (narrow-to-region beg end)
-    (goto-char (point-min))
-    (with-category-table thai-category-table
-      (while (re-search-forward thai-composition-pattern nil t)
-       (compose-region (match-beginning 0) (match-end 0))))))
+  (let ((pos (point)))
+    (save-restriction
+      (narrow-to-region beg end)
+      (goto-char (point-min))
+      (with-category-table thai-category-table
+       (while (re-search-forward thai-composition-pattern nil t)
+         (setq beg (match-beginning 0) end (match-end 0))
+         (if (and (> pos beg) (< pos end))
+             (setq pos end))
+         (thai-compose-syllable beg end
+                                (char-category-set (char-after beg))))))
+    (goto-char pos)))
 
 ;;;###autoload
 (defun thai-compose-string (string)
@@ -176,7 +230,7 @@ positions (integers or markers) specifying the region."
   (with-category-table thai-category-table
     (let ((idx 0))
       (while (setq idx (string-match thai-composition-pattern string idx))
-       (compose-string string idx (match-end 0))
+       (thai-compose-syllable idx (match-end 0) nil string)
        (setq idx (match-end 0)))))
   string)
 
index 40bd298aeec97bd4977723f73a7242404b6751f3..604eaf6384ed7bc60548492b6928fe4efb03fe4d 100644 (file)
@@ -6,6 +6,9 @@
 ;; Copyright (C) 2003
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H13PRO009
+;; Copyright (C) 2005
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: multilingual, Thai, i18n
 
@@ -53,7 +56,7 @@
          (features thai-util)
          (sample-text
           . (thai-compose-string
-             (copy-sequence "Thai (\e,T@RIRd7B\e(B)              \e,TJ\e0GQ\e1J\e04U\e1$\e0CQ\e1:\e(B, \e,TJ\e0GQ\e1J\e04U\e1\e0$h\e1P\e(B")))
+             (copy-sequence "Thai (\e,T@RIRd7B\e(B)              \e,TJGQJ4U$CQ:\e(B, \e,TJGQJ4U$hP\e(B")))
          (documentation . t)))
 
 (define-coding-system 'cp874
index 1b04c7ab0100c64f1f034203aa8ed38b0249e038..a150259efea2ad9f3dabba00e6e85df6676e038b 100644 (file)
   :group 'rmail)
 
 (defcustom rmail-movemail-program nil
-  "If non-nil, name of program for fetching new mail."
+  "If non-nil, the file name of the `movemail' program."
   :group 'rmail-retrieve
   :type '(choice (const nil) string))
 
 (defcustom rmail-pop-password nil
-  "*Password to use when reading mail from POP server. Please, use rmail-remote-password instead."
+  "*Password to use when reading mail from POP server.
+Please use `rmail-remote-password' instead."
   :type '(choice (string :tag "Password")
                 (const :tag "Not Required" nil))
   :group 'rmail-obsolete)
 
 (defcustom rmail-pop-password-required nil
-  "*Non-nil if a password is required when reading mail from a POP server. Please, use rmail-remote-password-required instead."
+  "*Non-nil if a password is required when reading mail from a POP server. 
+Please use rmail-remote-password-required instead."
   :type 'boolean
   :group 'rmail-obsolete)
 
 (defcustom rmail-remote-password nil
-  "*Password to use when reading mail from a remote server. This setting is ignored for mailboxes whose URL already contains a password."
+  "*Password to use when reading mail from a remote server.
+This setting is ignored for mailboxes whose URL already contains a password."
   :type '(choice (string :tag "Password")
                 (const :tag "Not Required" nil))
   :set-after '(rmail-pop-password)
@@ -160,8 +163,7 @@ please report it with \\[report-emacs-bug].")
 (defvar rmail-encoded-remote-password nil)
 
 (defcustom rmail-preserve-inbox nil
-  "*Non-nil if incoming mail should be left in the user's inbox,
-rather than deleted, after it is retrieved."
+  "*Non-nil means leave incoming mail in the user's inbox--don't delete it."
   :type 'boolean
   :group 'rmail-retrieve)
 
@@ -171,8 +173,8 @@ rather than deleted, after it is retrieved."
     :type '(repeat (directory)))
 
 (defun rmail-probe (prog)
-  "Determine what flavor of movemail PROG is by executing it with --version
-command line option and analyzing its output."
+  "Determine what flavor of movemail PROG is.
+We do this by executing it with `--version' and analyzing its output."
   (with-temp-buffer
     (let ((tbuf (current-buffer)))
       (buffer-disable-undo tbuf)
@@ -191,10 +193,10 @@ command line option and analyzing its output."
          'emacs))))))
 
 (defun rmail-autodetect ()
-  "Determine and return the flavor of `movemail' program in use. If
-rmail-movemail-program is set, use it. Otherwise, look for `movemail'
-in the path constructed by appending rmail-movemail-search-path,
-exec-path and exec-directory."
+  "Determine and return the file name of the `movemail' program.
+If `rmail-movemail-program' is non-nil, use it.
+Otherwise, look for `movemail' in the directories in
+`rmail-movemail-search-path', those in `exec-path', and `exec-directory'."
   (if rmail-movemail-program
       (rmail-probe rmail-movemail-program)
     (catch 'scan
@@ -2609,6 +2611,39 @@ change the invisible header text."
   (interactive)
   (rmail-show-message rmail-current-message))
 
+(defun rmail-unknown-mail-followup-to ()
+  "Handle a \"Mail-Followup-To\" header field with an unknown mailing list.
+Ask the user whether to add that list name to `mail-mailing-lists'."
+   (save-restriction
+     (rmail-narrow-to-non-pruned-header)
+     (let ((mail-followup-to (mail-fetch-field "mail-followup-to" nil t)))
+       (when mail-followup-to
+        (let ((addresses
+               (split-string 
+                (mail-strip-quoted-names mail-followup-to)
+                ",[[:space:]]+" t)))
+          (dolist (addr addresses)
+            (when (and (not (member addr mail-mailing-lists))
+                       (not
+                        ;; taken from rmailsum.el
+                        (string-match
+                         (or rmail-user-mail-address-regexp
+                             (concat "^\\("
+                                     (regexp-quote (user-login-name))
+                                     "\\($\\|@\\)\\|"
+                                     (regexp-quote
+                                      (or user-mail-address
+                                          (concat (user-login-name) "@"
+                                                  (or mail-host-address
+                                                      (system-name)))))
+                                     "\\>\\)"))
+                         addr))
+                       (y-or-n-p
+                        (format "Add `%s' to `mail-mailing-lists'? "
+                                addr)))
+              (customize-save-variable 'mail-mailing-lists
+                                       (cons addr mail-mailing-lists)))))))))
+
 (defun rmail-show-message (&optional n no-summary)
   "Show message number N (prefix argument), counting from start of file.
 If summary buffer is currently displayed, update current message there also."
@@ -2677,8 +2712,9 @@ If summary buffer is currently displayed, update current message there also."
        (rmail-display-labels)
        (if (eq rmail-enable-mime t)
            (funcall rmail-show-mime-function)
-         (setq rmail-view-buffer rmail-buffer)
-         )
+         (setq rmail-view-buffer rmail-buffer))
+       (when mail-mailing-lists
+         (rmail-unknown-mail-followup-to))
        (rmail-highlight-headers)
        (if transient-mark-mode (deactivate-mark))
        (run-hooks 'rmail-show-message-hook)
@@ -3367,9 +3403,14 @@ use \\[mail-yank-original] to yank the original message into it."
                              (progn (search-forward "\n*** EOOH ***\n")
                                     (beginning-of-line) (point)))))
        (setq from (mail-fetch-field "from")
-             reply-to (or (mail-fetch-field "reply-to" nil t)
+             reply-to (or (if just-sender
+                              (mail-fetch-field "mail-reply-to" nil t)
+                            (mail-fetch-field "mail-followup-to" nil t))
+                          (mail-fetch-field "reply-to" nil t)
                           from)
              cc (and (not just-sender)
+                     ;; mail-followup-to, if given, overrides cc.
+                     (not (mail-fetch-field "mail-followup-to" nil t))
                      (mail-fetch-field "cc" nil t))
              subject (mail-fetch-field "subject")
              date (mail-fetch-field "date")
index b456f8543b1f29565a9a151d2aa3d4c8c9275478..5e2da6b5949f223119bdef8cf97e7e5c046fb62a 100644 (file)
@@ -107,7 +107,7 @@ nil means let mailer mail back a message to report errors."
   :group 'sendmail)
 
 ;;;###autoload
-(defcustom mail-yank-ignored-headers "^via:\\|^mail-from:\\|^origin:\\|^status:\\|^remailed\\|^received:\\|^message-id:\\|^summary-line:\\|^to:\\|^subject:\\|^in-reply-to:\\|^return-path:" "\
+(defcustom mail-yank-ignored-headers "^via:\\|^mail-from:\\|^origin:\\|^status:\\|^remailed\\|^received:\\|^message-id:\\|^summary-line:\\|^to:\\|^subject:\\|^in-reply-to:\\|^return-path:\\|^mail-reply-to:\\|^mail-followup-to:" "\
 *Delete these headers from old message when it's inserted in a reply."
   :type 'regexp
   :group 'sendmail)
@@ -213,6 +213,7 @@ text as modified.
 This is a normal hook, misnamed for historical reasons.
 It is semi-obsolete and mail agents should no longer use it.")
 
+;;;###autoload
 (defcustom mail-citation-hook nil
   "*Hook for modifying a citation just inserted in the mail buffer.
 Each hook function can find the citation between (point) and (mark t),
@@ -363,7 +364,7 @@ actually occur.")
           (cite-prefix "[:alpha:]")
           (cite-suffix (concat cite-prefix "0-9_.@-`'\"")))
       (list '("^\\(To\\|Newsgroups\\):" . font-lock-function-name-face)
-           '("^\\(B?CC\\|Reply-to\\):" . font-lock-keyword-face)
+           '("^\\(B?CC\\|Reply-to\\|Mail-\\(reply\\|followup\\)-to\\):" . font-lock-keyword-face)
            '("^\\(Subject:\\)[ \t]*\\(.+\\)?"
              (1 font-lock-comment-face) (2 font-lock-type-face nil t))
            ;; Use EVAL to delay in case `mail-header-separator' gets changed.
@@ -492,6 +493,8 @@ Here are commands that move to a header field (and create it if there isn't):
         \\[mail-to]  move to To:       \\[mail-subject]  move to Subject:
         \\[mail-cc]  move to CC:       \\[mail-bcc]  move to BCC:
         \\[mail-fcc]  move to FCC:     \\[mail-reply-to] move to Reply-To:
+         \\[mail-mail-reply-to]  move to Mail-Reply-To:
+         \\[mail-mail-followup-to] move to Mail-Followup-To:
 \\[mail-text]  mail-text (move to beginning of message text).
 \\[mail-signature]  mail-signature (insert `mail-signature-file' file).
 \\[mail-yank-original]  mail-yank-original (insert current message, in Rmail).
@@ -599,6 +602,7 @@ If within the headers, this makes the new lines into continuation lines."
        ;; make sure we can fill after each address.
        (if (member fieldname
                    '("to" "cc" "bcc" "from" "reply-to"
+                     "mail-reply-to" "mail-followup-to"
                      "resent-to" "resent-cc" "resent-bcc"
                      "resent-from" "resent-reply-to"))
            (while (search-forward "," end t)
@@ -627,6 +631,8 @@ If within the headers, this makes the new lines into continuation lines."
   (define-key mail-mode-map "\C-c\C-f\C-c" 'mail-cc)
   (define-key mail-mode-map "\C-c\C-f\C-s" 'mail-subject)
   (define-key mail-mode-map "\C-c\C-f\C-r" 'mail-reply-to)
+  (define-key mail-mode-map "\C-c\C-f\C-a" 'mail-mail-reply-to) ; author
+  (define-key mail-mode-map "\C-c\C-f\C-l" 'mail-mail-followup-to) ; list
   (define-key mail-mode-map "\C-c\C-t" 'mail-text)
   (define-key mail-mode-map "\C-c\C-y" 'mail-yank-original)
   (define-key mail-mode-map "\C-c\C-r" 'mail-yank-region)
@@ -674,6 +680,12 @@ If within the headers, this makes the new lines into continuation lines."
 (define-key mail-mode-map [menu-bar headers sent-via]
   '("Sent Via" . mail-sent-via))
 
+(define-key mail-mode-map [menu-bar headers mail-reply-to]
+  '("Mail Reply To" . mail-mail-reply-to))
+
+(define-key mail-mode-map [menu-bar headers mail-followup-to]
+  '("Mail Followup To" . mail-mail-followup-to))
+
 (define-key mail-mode-map [menu-bar headers reply-to]
   '("Reply-To" . mail-reply-to))
 
@@ -745,6 +757,16 @@ Prefix arg means don't delete this window."
   :options '(flyspell-mode-off)
   :group 'sendmail)
 
+;;;###autoload
+(defcustom mail-mailing-lists nil "\
+*List of mailing list addresses the user is subscribed to.
+
+The variable is used to trigger insertion of the \"Mail-Followup-To\"
+header when sending a message to a mailing list."
+  :type '(repeat string)
+  :group 'sendmail)
+
+
 (defun mail-send ()
   "Send the message in the current buffer.
 If `mail-interactive' is non-nil, wait for success indication
@@ -757,7 +779,45 @@ the user from the mailer."
        (or (buffer-modified-p)
            (y-or-n-p "Message already sent; resend? ")))
       (let ((inhibit-read-only t)
-           (opoint (point)))
+           (opoint (point))
+           (ml (when mail-mailing-lists
+                ;; The surrounding regexp assumes the use of
+                ;; `mail-strip-quoted-names' on addresses before matching
+                ;; Cannot deal with full RFC 822 freedom, but that is
+                ;; unlikely to be problematic.
+                (concat "\\(?:[[:space:];,]\\|\\`\\)"
+                        (regexp-opt mail-mailing-lists t)
+                        "\\(?:[[:space:];,]\\|\\'\\)"))))
+       ;; If there are mailing lists defined
+       (when ml
+         (save-excursion
+           (let* ((to (mail-fetch-field "to" nil t))
+                  (cc (mail-fetch-field "cc" nil t))
+                  (new-header-values   ; To: and Cc:
+                   (mail-strip-quoted-names
+                    (concat to (when cc (concat ", " cc))))))
+             ;; If message goes to known mailing list ...
+             (when (string-match ml new-header-values)
+               ;; Add Mail-Followup-To if none yet
+               (unless (mail-fetch-field "mail-followup-to")
+                 (goto-char (mail-header-end))
+                 (insert "Mail-Followup-To: "
+                         (let ((l))
+                           (mapc
+                            ;; remove duplicates
+                            '(lambda (e)
+                               (unless (member e l)
+                                 (push e l)))
+                            (split-string new-header-values ", +" t))
+                           (mapconcat 'identity l ", "))
+                         "\n"))
+               ;; Add Mail-Reply-To if none yet
+               (unless (mail-fetch-field "mail-reply-to")
+                 (goto-char (mail-header-end))
+                 (insert "Mail-Reply-To: "
+                         (or (mail-fetch-field "reply-to")
+                             user-mail-address)
+                         "\n"))))))
        (unless (memq mail-send-nonascii '(t mime))
          (goto-char (point-min))
          (skip-chars-forward "\0-\177")
@@ -833,7 +893,7 @@ external program defined by `sendmail-program'."
        (multibyte enable-multibyte-characters)
        (case-fold-search nil)
        (selected-coding (select-message-coding-system))
-;;;    resend-to-addresses
+       resend-to-addresses
        delimline
        fcc-was-found
        (mailbuf (current-buffer))
@@ -869,39 +929,42 @@ external program defined by `sendmail-program'."
                      (< (point) delimline))
            (replace-match "\n"))
          (goto-char (point-min))
+         ;; Look for Resent- headers.  They require sending
+         ;; the message specially.
          (let ((case-fold-search t))
-;;;        (goto-char (point-min))
-;;;        (while (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" delimline t)
-;;;          (setq resend-to-addresses
-;;;                (save-restriction
-;;;                  (narrow-to-region (point)
-;;;                                    (save-excursion
-;;;                                      (forward-line 1)
-;;;                                      (while (looking-at "^[ \t]")
-;;;                                        (forward-line 1))
-;;;                                      (point)))
-;;;                  (append (mail-parse-comma-list)
-;;;                          resend-to-addresses)))
-;;;          ;; Delete Resent-BCC ourselves
-;;;          (if (save-excursion (beginning-of-line)
-;;;                              (looking-at "resent-bcc"))
-;;;              (delete-region (save-excursion (beginning-of-line) (point))
-;;;                             (save-excursion (end-of-line) (1+ (point))))))
-;;; Apparently this causes a duplicate Sender.
-;;;        ;; If the From is different than current user, insert Sender.
-;;;        (goto-char (point-min))
-;;;        (and (re-search-forward "^From:"  delimline t)
-;;;             (progn
-;;;               (require 'mail-utils)
-;;;               (not (string-equal
-;;;                     (mail-strip-quoted-names
-;;;                      (save-restriction
-;;;                        (narrow-to-region (point-min) delimline)
-;;;                        (mail-fetch-field "From")))
-;;;                     (user-login-name))))
-;;;             (progn
-;;;               (forward-line 1)
-;;;               (insert "Sender: " (user-login-name) "\n")))
+           (goto-char (point-min))
+           (while (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" delimline t)
+             ;; Put a list of such addresses in resend-to-addresses.
+             (setq resend-to-addresses
+                   (save-restriction
+                     (narrow-to-region (point)
+                                       (save-excursion
+                                         (forward-line 1)
+                                         (while (looking-at "^[ \t]")
+                                           (forward-line 1))
+                                         (point)))
+                     (append (mail-parse-comma-list)
+                             resend-to-addresses)))
+             ;; Delete Resent-BCC ourselves
+             (if (save-excursion (beginning-of-line)
+                                 (looking-at "resent-bcc"))
+                 (delete-region (save-excursion (beginning-of-line) (point))
+                                (save-excursion (end-of-line) (1+ (point))))))
+;;;  Apparently this causes a duplicate Sender.
+;;;        ;; If the From is different than current user, insert Sender.
+;;;        (goto-char (point-min))
+;;;        (and (re-search-forward "^From:"  delimline t)
+;;;             (progn
+;;;               (require 'mail-utils)
+;;;               (not (string-equal
+;;;                     (mail-strip-quoted-names
+;;;                      (save-restriction
+;;;                        (narrow-to-region (point-min) delimline)
+;;;                        (mail-fetch-field "From")))
+;;;                     (user-login-name))))
+;;;             (progn
+;;;               (forward-line 1)
+;;;               (insert "Sender: " (user-login-name) "\n")))
            ;; Don't send out a blank subject line
            (goto-char (point-min))
            (if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t)
@@ -1000,9 +1063,9 @@ external program defined by `sendmail-program'."
                  (erase-buffer))))
          (goto-char (point-min))
          (if (let ((case-fold-search t))
-               (re-search-forward "^To:\\|^cc:\\|^bcc:\\|^resent-to:\
-\\|^resent-cc:\\|^resent-bcc:"
-                                  delimline t))
+               (or resend-to-addresses
+                   (re-search-forward "^To:\\|^cc:\\|^bcc:"
+                                      delimline t)))
              (let* ((default-directory "/")
                     (coding-system-for-write selected-coding)
                     (args
@@ -1023,14 +1086,14 @@ external program defined by `sendmail-program'."
                                ;; These mean "report errors by mail"
                                ;; and "deliver in background".
                                '("-oem" "-odb"))
-;;;                          ;; Get the addresses from the message
-;;;                          ;; unless this is a resend.
-;;;                          ;; We must not do that for a resend
-;;;                          ;; because we would find the original addresses.
-;;;                          ;; For a resend, include the specific addresses.
-;;;                          (or resend-to-addresses
+                             ;; Get the addresses from the message
+                             ;; unless this is a resend.
+                             ;; We must not do that for a resend
+                             ;; because we would find the original addresses.
+                             ;; For a resend, include the specific addresses.
+                             (or resend-to-addresses
                                  '("-t")
-;;;                              )
+                                 )
                              (if mail-use-dsn
                                  (list "-N" (mapconcat 'symbol-name
                                                        mail-use-dsn ",")))
@@ -1249,6 +1312,24 @@ external program defined by `sendmail-program'."
   (expand-abbrev)
   (mail-position-on-field "Reply-To"))
 
+(defun mail-mail-reply-to ()
+  "Move point to end of Mail-Reply-To field.
+Create a Mail-Reply-To field if none."
+  (interactive)
+  (expand-abbrev)
+  (or (mail-position-on-field "mail-reply-to" t)
+      (progn (mail-position-on-field "to")
+           (insert "\nMail-Reply-To: "))))
+
+(defun mail-mail-followup-to ()
+  "Move point to end of Mail-Followup-To field.
+Create a Mail-Followup-To field if none."
+  (interactive)
+  (expand-abbrev)
+  (or (mail-position-on-field "mail-followup-to" t)
+      (progn (mail-position-on-field "to")
+           (insert "\nMail-Followup-To: "))))
+
 (defun mail-position-on-field (field &optional soft)
   (let (end
        (case-fold-search t))
index 2c0016dcc4777cc6db347addd50c083fcd4e05a4..b00de07e50f10a44bcfb964a274fbebe1c98844b 100644 (file)
@@ -1704,8 +1704,6 @@ Signal an error if there is no backup file."
            (message "Retrieving revision %s... Done" rev)
            (current-buffer))))))
 
-(eval-and-compile (autoload 'smerge-ediff "smerge-mode"))
-
 ;; FIXME: The user should be able to specify ancestor/head/backup and we should
 ;; provide sensible defaults when merge info is unavailable (rather than rely
 ;; on smerge-ediff).  Also provide sane defaults for need-merge files.
index 6aa9fdeb319db4a243528153af89e38837bcdd5a..c6a70173e662377f9f845e80b711562997049e47 100644 (file)
@@ -2,7 +2,7 @@
 ;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
 
 ;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
-;;          Carsten Dominik <dominik@astro.uva.nl>
+;;          Carsten Dominik <dominik@science.uva.nl>
 ;;          Chris Chase <chase@att.com>
 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
 ;; Version: 5.5
index 63848b188bafdd792332e7a7af43286fcd7b6d06..841c62f51211b4575a6081b2361bf201e15c9a33 100644 (file)
@@ -427,6 +427,9 @@ create a new comment."
    ((looking-at "=cut") 1)
    (t 3)))
 \f
+(defvar perl-mode-hook nil
+  "Normal hook to run when entering Perl mode.")
+
 ;;;###autoload
 (defun perl-mode ()
   "Major mode for editing Perl code.
@@ -519,7 +522,7 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
   ;; Setup outline-minor-mode.
   (set (make-local-variable 'outline-regexp) perl-outline-regexp)
   (set (make-local-variable 'outline-level) 'perl-outline-level)
-  (run-hooks 'perl-mode-hook))
+  (run-mode-hooks 'perl-mode-hook))
 \f
 ;; This is used by indent-for-comment
 ;; to decide how much to indent a comment in Perl code
index d2a0370f93ea1ae14bc72b4eb9c140295e5d4eb5..dc8eb131b72104f83c803948d6d231a9f547f3ae 100644 (file)
@@ -1344,9 +1344,6 @@ make, or the user didn't cancel the call."
        ;; (match-data); otherwise it is t if a match is possible at point.
        (match-again t)
 
-       (isearch-string isearch-string)
-       (isearch-regexp isearch-regexp)
-       (isearch-case-fold-search isearch-case-fold-search)
        (message
         (if query-flag
             (substitute-command-keys
@@ -1380,10 +1377,7 @@ make, or the user didn't cancel the call."
                                      (regexp-quote from-string))
                                    "\\b")))
     (when query-replace-lazy-highlight
-      (setq isearch-string search-string
-           isearch-regexp (or delimited-flag regexp-flag)
-           isearch-case-fold-search case-fold-search
-           isearch-lazy-highlight-last-string nil))
+      (setq isearch-lazy-highlight-last-string nil))
 
     (push-mark)
     (undo-boundary)
@@ -1453,9 +1447,10 @@ make, or the user didn't cancel the call."
                (let ((inhibit-read-only
                       query-replace-skip-read-only))
                  (unless (or literal noedit)
-                   (replace-highlight (nth 0 real-match-data)
-                                      (nth 1 real-match-data)
-                                      start end))
+                   (replace-highlight
+                    (nth 0 real-match-data) (nth 1 real-match-data)
+                    start end search-string
+                    (or delimited-flag regexp-flag) case-fold-search))
                  (setq noedit
                        (replace-match-maybe-edit
                         next-replacement nocasify literal
@@ -1471,8 +1466,10 @@ make, or the user didn't cancel the call."
                ;; `real-match-data'.
                (while (not done)
                  (set-match-data real-match-data)
-                 (replace-highlight (match-beginning 0) (match-end 0)
-                                    start end)
+                 (replace-highlight
+                  (match-beginning 0) (match-end 0)
+                  start end search-string
+                  (or delimited-flag regexp-flag) case-fold-search)
                  ;; Bind message-log-max so we don't fill up the message log
                  ;; with a bunch of identical messages.
                  (let ((message-log-max nil))
@@ -1604,11 +1601,6 @@ make, or the user didn't cancel the call."
                                       unread-command-events))
                         (setq done t)))
                  (when query-replace-lazy-highlight
-                   ;; Restore isearch data for lazy highlighting
-                   ;; in case of isearching during recursive edit
-                   (setq isearch-string search-string
-                         isearch-regexp (or delimited-flag regexp-flag)
-                         isearch-case-fold-search case-fold-search)
                    ;; Force lazy rehighlighting only after replacements
                    (if (not (memq def '(skip backup)))
                        (setq isearch-lazy-highlight-last-string nil))))
@@ -1648,21 +1640,25 @@ make, or the user didn't cancel the call."
 
 (defvar replace-overlay nil)
 
-(defun replace-highlight (match-beg match-end range-beg range-end)
+(defun replace-highlight (match-beg match-end range-beg range-end
+                         string regexp case-fold)
   (if query-replace-highlight
       (if replace-overlay
          (move-overlay replace-overlay match-beg match-end (current-buffer))
        (setq replace-overlay (make-overlay match-beg match-end))
        (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays
        (overlay-put replace-overlay 'face 'query-replace)))
-  (when query-replace-lazy-highlight
-    (isearch-lazy-highlight-new-loop range-beg range-end)))
+  (if query-replace-lazy-highlight
+      (let ((isearch-string string)
+           (isearch-regexp regexp)
+           (isearch-case-fold-search case-fold))
+       (isearch-lazy-highlight-new-loop range-beg range-end))))
 
 (defun replace-dehighlight ()
   (when replace-overlay
     (delete-overlay replace-overlay))
   (when query-replace-lazy-highlight
-    (isearch-lazy-highlight-cleanup lazy-highlight-cleanup)
+    (lazy-highlight-cleanup lazy-highlight-cleanup)
     (setq isearch-lazy-highlight-last-string nil)))
 
 ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4
index c69f8d6cf281b6221e0f33c087c1474d9e1f20df..50b008b63cfc3034fdbe9c112eb630ec039774b3 100644 (file)
@@ -3536,17 +3536,11 @@ boundaries bind `inhibit-field-text-motion' to t."
   (or arg (setq arg 1))
   (if (/= arg 1)
       (line-move (1- arg) t))
-  (let (done pos)
-    (while (not done)
-      (beginning-of-line 1)
-      ;; (not bolp) means that it stopped at a field boundary.
-      (if (or (bobp) (not (bolp)))
-         (setq done t)
-       (sit-for 0)
-       (if (and (consp (setq pos (pos-visible-in-window-p (point) nil t)))
-                (= (car pos) 0))
-           (setq done t)
-         (backward-char 1))))))
+  (beginning-of-line 1)
+  (let ((orig (point)))
+    (vertical-motion 0)
+    (if (/= orig (point))
+       (goto-char (constrain-to-field (point) orig (/= arg 1) t nil)))))
 
 
 ;;; Many people have said they rarely use this feature, and often type
@@ -3933,6 +3927,7 @@ Setting this variable automatically makes it local to the current buffer.")
   "The function to use for `auto-fill-function' if Auto Fill mode is turned on.
 Some major modes set this.")
 
+(put 'auto-fill-function :minor-mode-function 'auto-fill-mode)
 ;; FIXME: turn into a proper minor mode.
 ;; Add a global minor mode version of it.
 (defun auto-fill-mode (&optional arg)
@@ -5069,6 +5064,7 @@ the front of the list of recently selected ones."
 (defcustom normal-erase-is-backspace
   (and (not noninteractive)
        (or (memq system-type '(ms-dos windows-nt))
+          (eq window-system 'mac)
           (and (memq window-system '(x))
                (fboundp 'x-backspace-delete-keys-p)
                (x-backspace-delete-keys-p))
index 7f5856f1f04326cc5aee58b6c7353e8357b717d7..0c0152a85b8e9b84ddab41063e33d40a1b477f79 100644 (file)
@@ -36,27 +36,6 @@ Each element of this list holds the arguments to one call to `defcustom'.")
   (setq custom-declare-variable-list
        (cons arguments custom-declare-variable-list)))
 
-\f
-(defun macro-declaration-function (macro decl)
-  "Process a declaration found in a macro definition.
-This is set as the value of the variable `macro-declaration-function'.
-MACRO is the name of the macro being defined.
-DECL is a list `(declare ...)' containing the declarations.
-The return value of this function is not used."
-  ;; We can't use `dolist' or `cadr' yet for bootstrapping reasons.
-  (let (d)
-    ;; Ignore the first element of `decl' (it's always `declare').
-    (while (setq decl (cdr decl))
-      (setq d (car decl))
-      (cond ((and (consp d) (eq (car d) 'indent))
-            (put macro 'lisp-indent-function (car (cdr d))))
-           ((and (consp d) (eq (car d) 'debug))
-            (put macro 'edebug-form-spec (car (cdr d))))
-           (t
-            (message "Unknown declaration %s" d))))))
-
-(setq macro-declaration-function 'macro-declaration-function)
-
 \f
 ;;;; Lisp language features.
 
@@ -2478,6 +2457,8 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
     (push toggle minor-mode-list))
 
   (unless toggle-fun (setq toggle-fun toggle))
+  (unless (eq toggle-fun toggle)
+    (put toggle :minor-mode-function toggle-fun))
   ;; Add the name to the minor-mode-alist.
   (when name
     (let ((existing (assq toggle minor-mode-alist)))
index c6b732da9f33e917fd49aefa3bc739e1c5bfb0b4..91b81c6dece74889ebd5dcbe5d54026686b67fc4 100644 (file)
@@ -581,6 +581,7 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
   (set (make-local-variable 'file-precious-flag) t)
   (auto-save-mode 0)
   (set (make-local-variable 'write-contents-functions) '(tar-mode-write-file))
+  (buffer-disable-undo)
   (widen)
   (if (and (boundp 'tar-header-offset) tar-header-offset)
       (narrow-to-region (point-min) tar-header-offset)
index 53c4f55bd5ef1fc9d032da2975a1a61d8fb4df62..2974bc5a456da56fb7df350e6297c4082fe9e4a4 100644 (file)
@@ -230,6 +230,55 @@ This function returns ARGS minus the arguments that have been processed."
            (funcall handler this-switch))
        (setq args (cons orig-this-switch args)))))
   (nconc (nreverse args) x-invocation-args))
+
+\f
+;;
+;; Standard Mac cursor shapes
+;;
+
+(defconst mac-pointer-arrow 0)
+(defconst mac-pointer-copy-arrow 1)
+(defconst mac-pointer-alias-arrow 2)
+(defconst mac-pointer-contextual-menu-arrow 3)
+(defconst mac-pointer-I-beam 4)
+(defconst mac-pointer-cross 5)
+(defconst mac-pointer-plus 6)
+(defconst mac-pointer-watch 7)
+(defconst mac-pointer-closed-hand 8)
+(defconst mac-pointer-open-hand 9)
+(defconst mac-pointer-pointing-hand 10)
+(defconst mac-pointer-counting-up-hand 11)
+(defconst mac-pointer-counting-down-hand 12)
+(defconst mac-pointer-counting-up-and-down-hand 13)
+(defconst mac-pointer-spinning 14)
+(defconst mac-pointer-resize-left 15)
+(defconst mac-pointer-resize-right 16)
+(defconst mac-pointer-resize-left-right 17)
+;; Mac OS X 10.2 and later
+(defconst mac-pointer-not-allowed 18)
+;; Mac OS X 10.3 and later
+(defconst mac-pointer-resize-up 19)
+(defconst mac-pointer-resize-down 20)
+(defconst mac-pointer-resize-up-down 21)
+(defconst mac-pointer-poof 22)
+
+;;
+;; Standard X cursor shapes that have Mac counterparts
+;;
+
+(defconst x-pointer-left-ptr mac-pointer-arrow)
+(defconst x-pointer-xterm mac-pointer-I-beam)
+(defconst x-pointer-crosshair mac-pointer-cross)
+(defconst x-pointer-plus mac-pointer-plus)
+(defconst x-pointer-watch mac-pointer-watch)
+(defconst x-pointer-hand2 mac-pointer-pointing-hand)
+(defconst x-pointer-left-side mac-pointer-resize-left)
+(defconst x-pointer-right-side mac-pointer-resize-right)
+(defconst x-pointer-sb-h-double-arrow mac-pointer-resize-left-right)
+(defconst x-pointer-top-side mac-pointer-resize-up)
+(defconst x-pointer-bottom-side mac-pointer-resize-down)
+(defconst x-pointer-sb-v-double-arrow mac-pointer-resize-up-down)
+
 \f
 ;;
 ;; Available colors
@@ -1010,20 +1059,29 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
 
 ;; Map certain keypad keys into ASCII characters
 ;; that people usually expect.
-(define-key function-key-map [return] [?\C-m])
-(define-key function-key-map [M-return] [?\M-\C-m])
-(define-key function-key-map [tab] [?\t])
-(define-key function-key-map [M-tab] [?\M-\t])
 (define-key function-key-map [backspace] [?\d])
-(define-key function-key-map [M-backspace] [?\M-\d])
+(define-key function-key-map [delete] [?\d])
+(define-key function-key-map [tab] [?\t])
+(define-key function-key-map [linefeed] [?\n])
+(define-key function-key-map [clear] [?\C-l])
+(define-key function-key-map [return] [?\C-m])
 (define-key function-key-map [escape] [?\e])
+(define-key function-key-map [M-backspace] [?\M-\d])
+(define-key function-key-map [M-delete] [?\M-\d])
+(define-key function-key-map [M-tab] [?\M-\t])
+(define-key function-key-map [M-linefeed] [?\M-\n])
+(define-key function-key-map [M-clear] [?\M-\C-l])
+(define-key function-key-map [M-return] [?\M-\C-m])
 (define-key function-key-map [M-escape] [?\M-\e])
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
-(put 'return 'ascii-character ?\C-m)
-(put 'tab 'ascii-character ?\t)
 (put 'backspace 'ascii-character ?\d)
+(put 'delete 'ascii-character ?\d)
+(put 'tab 'ascii-character ?\t)
+(put 'linefeed 'ascii-character ?\n)
+(put 'clear 'ascii-character ?\C-l)
+(put 'return 'ascii-character ?\C-m)
 (put 'escape 'ascii-character ?\e)
 
 \f
index 6ef33e9580dad1d49b0c1b7d6006dca0fcb57807..3717db6d4c5b770e5db9e842b8a60bb42af566e2 100644 (file)
@@ -238,7 +238,17 @@ When set to `block', assumes a block cursor with TTY displays."
   :type '(choice (const block) (const :tag "off" nil) (const :tag "on" t))
   :group 'ispell)
 
-(defcustom ispell-highlight-face 'highlight
+(defcustom ispell-lazy-highlight (boundp 'lazy-highlight-cleanup)
+  "*Controls the lazy-highlighting of spelling errors.
+When non-nil, all text in the buffer matching the current spelling
+error is highlighted lazily using isearch lazy highlighting (see
+`lazy-highlight-initial-delay' and `lazy-highlight-interval')."
+  :type 'boolean
+  :group 'lazy-highlight
+  :group 'ispell
+  :version "22.1")
+
+(defcustom ispell-highlight-face (if ispell-lazy-highlight 'isearch 'highlight)
   "*The face used for Ispell highlighting.  For Emacses with overlays.
 Possible values are `highlight', `modeline', `secondary-selection',
 `region', and `underline'.
@@ -2130,7 +2140,7 @@ When the optional third arg HIGHLIGHT is set, the word is highlighted,
 otherwise it is displayed normally."
   (if highlight
       (isearch-highlight start end)
-    (isearch-dehighlight t))
+    (isearch-dehighlight))
   ;;(sit-for 0)
   )
 
@@ -2144,8 +2154,23 @@ The variable `ispell-highlight-face' selects the face to use for highlighting."
   (if highlight
       (progn
        (setq ispell-overlay (make-overlay start end))
+       (overlay-put ispell-overlay 'priority 1) ;higher than lazy overlays
        (overlay-put ispell-overlay 'face ispell-highlight-face))
-    (delete-overlay ispell-overlay)))
+    (delete-overlay ispell-overlay))
+  (if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup))
+      (if highlight
+         (let ((isearch-string
+                (concat
+                 "\\b"
+                 (regexp-quote (buffer-substring-no-properties start end))
+                 "\\b"))
+               (isearch-regexp t)
+               (isearch-case-fold-search nil))
+           (isearch-lazy-highlight-new-loop
+            (if (boundp 'reg-start) reg-start)
+            (if (boundp 'reg-end)   reg-end)))
+       (lazy-highlight-cleanup lazy-highlight-cleanup)
+       (setq isearch-lazy-highlight-last-string nil))))
 
 
 (defun ispell-highlight-spelling-error (start end &optional highlight refresh)
index 2c685753f1f338887aceabd8079935390f010e19..52a0c8a1deb2c447f4a41edc2d07116b50a08701 100644 (file)
@@ -1,11 +1,12 @@
 ;;; table.el --- create and edit WYSIWYG text based embedded tables
 
-;; Copyright (C) 2000, 01, 02, 03, 04 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+;;           Free Software Foundation, Inc.
 
 ;; Keywords: wp, convenience
 ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com>
 ;; Created: Sat Jul 08 2000 13:28:45 (PST)
-;; Revised: Tue Jun 01 2004 11:36:39 (PDT)
+;; Revised: Fri Mar 18 2005 13:50:13 (PST)
 
 ;; This file is part of GNU Emacs.
 
@@ -1024,16 +1025,10 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu
       :active (and (not buffer-read-only) (not (table--probe-cell)))
       :help "Insert a text based table at point"]
      ["Row" table-insert-row
-      :active (and (not buffer-read-only)
-                  (or (table--probe-cell)
-                      (save-excursion
-                        (table--find-row-column nil t))))
+      :active (table--row-column-insertion-point-p)
       :help "Insert row(s) of cells in table"]
      ["Column" table-insert-column
-      :active (and (not buffer-read-only)
-                  (or (table--probe-cell)
-                      (save-excursion
-                        (table--find-row-column 'column t))))
+      :active (table--row-column-insertion-point-p 'column)
       :help "Insert column(s) of cells in table"])
     "----"
     ("Recognize"
@@ -1076,16 +1071,10 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu
   '("Table"
     ("Insert"
      ["Row" table-insert-row
-      :active (and (not buffer-read-only)
-                  (or (table--probe-cell)
-                      (save-excursion
-                        (table--find-row-column nil t))))
+      :active (table--row-column-insertion-point-p)
       :help "Insert row(s) of cells in table"]
      ["Column" table-insert-column
-      :active (and (not buffer-read-only)
-                  (or (table--probe-cell)
-                      (save-excursion
-                        (table--find-row-column 'column t))))
+      :active (table--row-column-insertion-point-p 'column)
       :help "Insert column(s) of cells in table"])
     ("Delete"
      ["Row" table-delete-row
@@ -4698,6 +4687,30 @@ of line."
       (setq multiplier (1- multiplier)))
     ret-str))
 
+(defun table--line-column-position (line column)
+  "Return the location of LINE forward at COLUMN."
+  (save-excursion
+    (forward-line line)
+    (move-to-column column)
+    (point)))
+
+(defun table--row-column-insertion-point-p (&optional columnp)
+  "Return non nil if it makes sense to insert a row or a column at point."
+  (and (not buffer-read-only)
+       (or (get-text-property (point) 'table-cell)
+          (let ((column (current-column)))
+            (if columnp
+                (or (text-property-any (line-beginning-position 0)
+                                       (table--line-column-position -1 column)
+                                       'table-cell t)
+                    (text-property-any (line-beginning-position) (point) 'table-cell t)
+                    (text-property-any (line-beginning-position 2)
+                                       (table--line-column-position 1 column)
+                                       'table-cell t))
+              (text-property-any (table--line-column-position -2 column)
+                                 (table--line-column-position -2 (+ 2 column))
+                                 'table-cell t))))))
+
 (defun table--find-row-column (&optional columnp no-error)
   "Search table and return a cell coordinate list of row or column."
   (let ((current-coordinate (table--get-coordinate)))
@@ -5136,7 +5149,7 @@ Focus only on the corner pattern.  Further cell validity check is required."
 
 (defun table--editable-cell-p (&optional abort-on-error)
   (and (not buffer-read-only)
-       (table--probe-cell abort-on-error)))
+       (get-text-property (point) 'table-cell)))
 
 (defun table--probe-cell (&optional abort-on-error)
   "Probes a table cell around the point.
@@ -5603,5 +5616,5 @@ It returns COLUMN unless STR contains some wide characters."
 ;; End: ***
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;;; arch-tag: 0d69b03e-aa5f-4e72-8806-5727217617e0
+;; arch-tag: 0d69b03e-aa5f-4e72-8806-5727217617e0
 ;;; table.el ends here
index 5d5beb1a92db754e08cb18ed602d3b197e91d251..25c0995565d67e038a1aad1927c5f6fd45ad712e 100644 (file)
@@ -1,3 +1,30 @@
+2005-03-17  Richard M. Stallman  <rms@gnu.org>
+
+       * text.texi (Undo): Document extensible undo entries.
+
+       * searching.texi (String Search, Regexp Search, Regexp Search):
+       Cleanups.
+
+       * nonascii.texi (Character Codes): Minor fix.
+
+       * display.texi (Display Property): Explain the significance
+       of having text properties that are eq.
+       (Other Display Specs): Explain string as display spec.
+
+       * commands.texi (Interactive Codes): Document G option.
+
+2005-03-17  Chong Yidong  <cyd@stupidchicken.com>
+
+       * text.texi (Filling): Add sentence-end-without-period and
+       sentence-end-without-space.
+       (Changing Properties): Minor fix.
+
+       * anti.texi: Total rewrite.
+
+2005-03-15  Lute Kamstra  <lute@gnu.org>
+
+       * edebug.texi (Instrumenting Macro Calls): Fix typos.
+
 2005-03-08  Kim F. Storm  <storm@cua.dk>
 
        * display.texi (Specified Space): Property :width is support on
        and calendar-today-marker are strings, not chars.
        (Holiday Customizing): Minor fix.
 
-       * nonascii.texi (Text Representations): Clarify position-bytes.
-       (Character Sets): Add list-charset-chars.
-       (Scanning Charsets): Add charset-after.
-       (Encoding and I/O): Minor fix.
-
        * internals.texi (Writing Emacs Primitives): Update `or' example.
        Update limit on # args of subr.
 
        (Variable Definitions, Group Definitions): Not here.
        (Variable Definitions): Clarify symbol arg to :initialize and :set fns.
 
+2005-03-07  Chong Yidong  <cyd@stupidchicken.com>
+       * nonascii.texi (Text Representations): Clarify position-bytes.
+       (Character Sets): Add list-charset-chars.
+       (Scanning Charsets): Add charset-after.
+       (Encoding and I/O): Minor fix.
+
 2005-03-06  Richard M. Stallman  <rms@gnu.org>
 
        * windows.texi (Vertical Scrolling): Get rid of "Emacs 21".
index 8d3ea8b1886b7cca656237255126be4c6bc7ad4a..bd82c7d1373dcec491c3603f17449d9ccb35fee1 100644 (file)
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1999 Free Software Foundation, Inc.
+@c Copyright (C) 2005 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 
 @c This node must have no pointers.
 
 @node Antinews, GNU Free Documentation License, System Interface, Top
-@appendix Emacs 20 Antinews
+@appendix Emacs 21 Antinews
 
 For those users who live backwards in time, here is information about
-downgrading to Emacs version 20.4.  We hope you will enjoy the greater
-simplicity that results from the absence of many Emacs 21 features.  In
-the following section, we carry this information back to Emacs
-20.3, for which the previous printed edition of this manual was made.
+downgrading to Emacs version 21.4.  We hope you will enjoy the greater
+simplicity that results from the absence of many Emacs 22 features.
 
-@section Old Lisp Features in Emacs 20
+@section Old Lisp Features in Emacs 21
 
 @itemize @bullet
 @item
-The @code{push} and @code{pop} macros are not defined.
-Neither are @code{dolist} and @code{dotimes}.
+Many unnecessary features of redisplay have been eliminated.  (The
+earlier major release, Emacs 20, will have a completely rewritten
+redisplay engine, which will be even simpler.)
 
+@itemize @minus
 @item
-You can't display images in buffers.  (Emacs is meant for editing text.)
-With no images, there are no display margins, and no tool bars.
+The function @code{force-window-update} has been removed.  It
+shouldn't be needed, since changes in window contents are detected
+automatically.  In case they aren't, call @code{redraw-display} to
+redraw everything.
 
 @item
-The @code{display} text property has no special meaning; you can use it
-freely in Lisp programs, with no effects except what you implement for
-yourself.  With no images, who needs the @code{display} text property?
+Point no longer moves out from underneath invisible text at the end of
+each command.  This allows the user to detect invisible text by moving
+the cursor around---if the cursor gets stuck, there is something
+invisible in the way.  If you really want cursor motion to ignore the
+text, try marking it as intangible.
 
 @item
-The @code{field} text property has no special meaning; buffers are no
-longer subdivided into fields.  (The division of information into
-fields is always rather arbitrary.)
+Support for image maps and image slices has been removed.  Emacs was
+always meant for editing text, anyway.
 
 @item
-Faces have fewer attributes.  The attributes @code{:family},
-@code{:height}, @code{:width}, @code{:weight}, and @code{:slant},
-have been replaced with a font name, a ``bold'' flag, and an
-``italic'' flag.
+The mode line now accepts all text properties, as well as
+@code{:propertize} and @code{:eval} forms, regardless of the
+@code{risky-local-variable} property.
 
-The attributes @code{:overline}, @code{:strike-through} and @code{:box}
-have been eliminated too.  Underlining now always has the same color as
-the text---using any other color would be bad taste.
+@item
+The @code{line-height} and @code{line-spacing} properties no longer
+have any meaning for newline characters.  Such properties wouldn't
+make sense, since newlines are not really characters; they just tell
+you where to break a line.
 
-With fewer font attributes, there are no functions
-@code{set-face-attribute} and @code{face-attribute}.  Instead, you
-access these attributes using functions such as @code{face-font}, and
-set them with functions such as @code{set-face-font}.  (These functions
-were available in Emacs 21, but are not as useful there.)
+@item
+Considerable simplifications have been made to the display
+specification @code{(space . @var{props})}, which is used for
+displaying a space of specified width and height.  Pixel-based
+specifications and Lisp expressions are no longer accepted.
 
 @item
-The standard faces @code{scroll-bar}, @code{menu}, @code{border},
-@code{cursor}, and @code{mouse} have been eliminated.  They are rather
-strange, as faces, and therefore shouldn't really exist.  You can use
-@code{set-border-color}, @code{set-cursor-color} and
-@code{set-mouse-color} to specify the colors for the frame border, the
-text cursor, and the mouse cursor.  To specify menu colors, use X
-resources.
+Many features associated with the fringe areas have been removed, to
+encourage people to concentrate on the main editing area (the fringe
+will be completely removed in Emacs 20.)  Arbitrary bitmaps can no
+longer be displayed in the fringe; an overlay arrow can still be
+displayed, but there can only be one overlay arrow at a time (any more
+would be confusing.)  The fringe widths cannot be adjusted, and
+individual windows cannot have their own fringe settings.  A mouse
+click on the fringe no longer generates a special event.
 
 @item
-Colors and other face attributes are no longer supported on character
-terminals, so you no longer have to worry about terminals making faces
-at you.
+Individual windows cannot have their own scroll-bar settings.
 
 @item
-Emacs will respect your peace and quiet, aside from occasional beeps,
-because there are no facilities for playing sounds.
+You can no longer use @samp{default} in a @code{defface} to specify
+defaults for subsequent faces.
 
 @item
-Emacs 20 provides a complex and badly designed method for handling
-character composition for languages such as Thai that display several
-letters as a single combined image.  We are too ashamed of it to tell
-you any more than that.
+The function @code{display-supports-face-attributes-p} has been
+removed.  In @code{defface} specifications, the @code{supports}
+predicate is no longer supported.
 
 @item
-@code{delete-and-extract-region} has been deleted; instead, use
-@code{buffer-substring} to extract the text, then use
-@code{delete-region} to delete it.
+@code{face-attribute-relative-p} and @code{merge-face-attribute} have
+been removed.
 
 @item
-Regular expressions do not support the POSIX character classes
-such as @samp{[:alpha:]}.  All characters are created equal.
+The priority of faces in a list supplied by the @code{:inherit} face
+attribute has been reversed.  We like to make changes like this once
+in a while, to keep Emacs Lisp programmers on their toes.
 
 @item
-Hash tables have been eliminated; use alists instead.
+The @code{min-colors} face attribute, used for tailoring faces to
+limited-color displays, does not exist.  If in doubt, use colors like
+``white'' and ``black'', which ought to be defined everywhere.
 
 @item
-The Lisp printer does not detect and report circular structure.  That is
-ok, because the Lisp reader cannot recreate circular structure anyway.
-However, there is a library @samp{cust-print.el} which can report
-circular structure.
+The @code{tty-color-mode} frame parameter does not exist.  You should
+just trust the terminal capabilities database.
+@end itemize
 
 @item
-Emacs provides its own implementation of scroll bars, instead
-of using those of the X toolkit.  They always use the frame foreground
-and background colors, so you cannot specify different colors for
-the scroll bars.
+Several simplifications have been made to mouse support:
 
+@itemize @minus
 @item
-For simplicity, all @acronym{ASCII} characters now have the same height and width.
-(Certain characters, such as Chinese characters, always have twice
-the standard width.)  All characters are created equal.
+Clicking @kbd{mouse-1} won't follow links, as that is alien to the
+spirit of Emacs.  Therefore, the @code{follow-link} property doesn't
+has any special meaning, and the function @code{mouse-on-link-p} has
+been removed.
 
 @item
-You can now resize any Emacs window, and size changes in one window can
-propagate to all others.  Windows can no longer use
-@code{window-size-fixed} to get special privileges.
+The variable @code{void-text-area-pointer} has been removed, so the
+mouse pointer shape remains unchanged when moving between valid text
+areas and void text areas.  The @code{pointer} image and text
+properties are no longer supported.
 
 @item
-The function @code{intern-soft} no longer accepts a symbol as argument.
+Mouse events will no longer specify the timestamp, the object clicked,
+equivalent buffer positions (for marginal or fringe areas), glyph
+coordinates, or relative pixel coordinates.
+@end itemize
 
 @item
-The function @code{bitmap-spec-p} has been renamed to
-@code{pixmap-spec-p} to encourage users to practice Emacs' help system
-while trying to find it.
+Simplifications have also been made to the way Emacs handles keymaps
+and key sequences:
 
+@itemize @minus
 @item
-Tooltips operate using ordinary Emacs frames.
+The @code{kbd} macro has been removed.  It isn't that difficult to
+write key sequences using the string and vector representations, and
+we want to encourage users to learn.
 
 @item
-Areas of the mode line are not mouse-sensitive; however, some mouse
-commands are available for the mode line as a whole.
+Emacs no longer supports key remapping.  You can do pretty much the
+same thing with @code{substitute-key-definition}, or by advising the
+relevant command.
 
 @item
-Windows cannot have header lines.  Conversely, there is no way to turn
-off the mode line of a window unless it is a minibuffer.
+The @code{keymap} text and overlay property is now overridden by minor
+mode keymaps, and will not work at the ends of text properties and
+overlays.
 
 @item
-Plain dashes are the only separators you can use in a menu.
+The functions @code{map-keymap}, @code{keymap-prompt}, and
+@code{current-active-maps} have been removed.
+@end itemize
 
 @item
-Vertical fractional scrolling does not exist.
+Process support has been pared down to a functional minimum.  The
+functions @code{call-process-shell-command} and @code{process-file}
+have been deleted.  Processes no longer maintain property lists, and
+they won't ask any questions when the user tries to exit Emacs (which
+would simply be rude.)  The function @code{signal-process} won't
+accept a process object, only the process id; determining the process
+id from a process object is left as an exercise to the programmer.
 
 @item
-The functions @code{format} and @code{message} ignore and discard text
-properties.
+Networking has also been simplified: @code{make-network-process} and
+its various associated function have all been replaced with a single
+easy-to-use function, @code{open-network-stream}, which can't use UDP,
+can't act as a server, and can't set up non-blocking connections.
+Also, deleting a network process with @code{delete-process} won't call
+the sentinel.
 
 @item
-The function @code{propertize} does not exist;
-you can get the job done using @code{set-text-properties}.
+Many programming shortcuts have been deleted, to provide you with the
+enjoyment of ``rolling your own''.  The macros @code{while-no-input},
+@code{with-local-quit}, @code{with-selected-window},
+@code{dynamic-completion-table}, and @code{lazy-completion-table} no
+longer exist.  Also, there are no built-in progress reporters.
 
 @item
-Colors are supported only on window systems, not on text-only terminals.
-So the support functions for colors on text-only terminals are
-not needed, and have been eliminated.
+Variable aliases are no longer supported.  Aliases are for functions,
+not for variables.
 
 @item
-The functions @code{color-values}, @code{color-defined-p} and
-@code{defined-colors} have been renamed to @code{x-color-values},
-@code{x-color-defined-p} and @code{x-defined-colors}.
+The variables @code{most-positive-fixnum} and
+@code{most-negative-fixnum} do not exist.  On 32 bit machines, the
+most positive integer is probably 134217727, and the most negative
+integer is probably -134217728.
 
 @item
-Windows cannot be made fixed-width or fixed-height;
-Emacs will adjust the size of all windows when it needs to.
+The functions @code{eql} and @code{macroexpand-all} are no longer
+available.  However, you can find similar functions in the @code{cl}
+package.
 
 @item
-The string used as the value of the @code{before-string} or
-@code{after-string} property must contain only characters that display
-as a single column---control characters, including tabs and newlines,
-will give strange results.
+The list returned by @code{split-string} won't include null substrings
+for separators at the beginning or end of a string.  If you want to
+check for such separators, do it separately.
 
 @item
-The minibuffer prompt does not actually appear in content of the
-minibuffer; it is displayed specially in the minibuffer window.
+The function @code{assoc-string} has been removed.  Use
+@code{assoc-ignore-case} or @code{assoc-ignore-representation} (which
+are no longer obsolete.)
 
 @item
-The ``exclusive open'' feature of @code{write-region}
-has been eliminated; any non-@code{nil} value for the seventh
-argument now means to ask the user for confirmation.
+The escape sequence @samp{\s} is always interpreted as a super
+modifier, never a space.
 
 @item
-The function @code{buffer-size} always reports on the
-current buffer.
+The variable @code{buffer-save-without-query} has been removed, to
+prevent Emacs from sneakily saving buffers.  Also, the hook
+@code{before-save-hook} has been removed, so if you want something to
+be done before saving, advise or redefine @code{basic-save-buffer}.
 
 @item
-The function @code{assq-delete-all} has itself been deleted.
-So there!
+The variable @code{buffer-auto-save-file-format} has been renamed to
+@code{auto-save-file-format}, and is no longer a permanent local.
 
 @item
-The keyword @code{:set-after} no longer does anything in
-@code{defcustom}.
+The function @code{visited-file-modtime} now returns a cons, instead
+of a list of two integers.  The primitive @code{set-file-times} has
+been eliminated.
 
 @item
-The variable @code{small-temporary-file-directory} has no special
-meaning.  There's only one variable for specifying which directory to
-use for temporary files, @code{temporary-file-directory}, but not all
-Emacs features use it anyway.  Some use the @code{TMP} environment
-variable, and some use the @code{TMPDIR} environment variable.
+The function @code{file-remote-p} is no longer available.
 
 @item
-If the second argument of @code{save-some-buffers}, @var{pred}, is not
-@code{nil}, then the precise value no longer matters.  Any
-non-@code{nil} value means the same as @code{t}: offer to save each
-non-file buffer that has a non-@code{nil} value for
-@code{buffer-offer-save}.
+When determining the filename extension, a leading dot in a filename
+is no longer ignored.  Thus, @file{.emacs} is considered to have
+extension @file{emacs}, rather than being extensionless.
 
 @item
-The variable @code{inhibit-modification-hooks}
-has no special meaning.
+Emacs looks for special file handlers in a more efficient manner: it
+will choose the first matching handler in
+@code{file-name-handler-alist}, rather than trying to figure out which
+provides the closest match.
 
 @item
-The hook @code{fontification-functions} has been eliminated,
-but there are other hooks, such as @code{window-scroll-functions},
-that you can use to do a similar job.
+The @code{predicate} argument for @code{read-file-name} has been
+removed, and so have the variables @code{read-file-name-function} and
+@code{read-file-name-completion-ignore-case}.  The function
+@code{read-directory-name} has also been removed.
 
 @item
-The variable  @code{redisplay-dont-pause}
-has no special meaning.
+The functions @code{all-completions} and @code{try-completion} will no
+longer accept lists of strings or hash tables (it will still accept
+alists, obarrays, and functions.)  In addition, the function
+@code{test-completion} is no longer available.
 
 @item
-The hook @code{calendar-move-hook} has been deleted.
+Arbitrary Lisp functions can no longer be recorded into
+@code{buffer-undo-list}.  As a consequence, @code{yank-undo-function}
+is obsolete, and has been removed.
 
 @item
-The function @code{move-to-column} treats any non-@code{nil}
-second argument just like @code{t}.
-@end itemize
+Emacs will never complain about commands that accumulate too much undo
+information, so you no longer have to worry about binding
+@code{buffer-undo-list} to @code{t} for such commands (though you may
+want to do that anyway, to avoid taking up unnecessary memory space.)
 
-@section Old Lisp Features in Emacs 20.3
+@item
+Atomic change groups are no longer supported.
 
-Here are the most important of the features that you will learn
-to do without in Emacs 20.3:
+@item
+The list returned by @code{(match-data t)} no longer records the
+buffer as a final element.
 
-Here are changes in the Lisp language itself:
+@item
+The function @code{looking-back} has been removed, so we no longer
+have the benefit of hindsight.
 
-@itemize @bullet
 @item
-The functions @code{line-beginning-position} and @code{line-end-position}
-have been eliminated.
+The variable @code{search-spaces-regexp} does not exist.  Spaces
+always stand for themselves in regular expression searches.
 
 @item
-The functions @code{directory-files-and-attributes},
-@code{file-attributes-lessp}, and @code{file-expand-wildcards}, have
-been eliminated.
+The functions @code{skip-chars-forward} and @code{skip-chars-backward}
+no longer accepts character classes such as @samp{[:alpha:]}.  All
+characters are created equal.
 
 @item
-The functions @code{decode-coding-region} and @code{encode-coding-region}
-leave text properties untouched, in case that is useful.  (It rarely makes
-any sense, though.)
+The @code{yank-handler} text property no longer has any meaning.
+Also, @code{yank-excluded-properties}, @code{insert-for-yank}, and
+@code{insert-buffer-substring-as-yank} have all been removed.
 
 @item
-The functions @code{position-bytes} and @code{byte-to-position} have
-been eliminated.
+The variable @code{char-property-alias-alist} has been deleted.
+Aliases are for functions, not for properties.
 
 @item
-Temporary buffers made with @code{with-output-to-temp-buffer} are now
-modifiable by default, and use Fundamental mode rather than Help mode.
+The function @code{get-char-property-and-overlay} has been deleted.
+If you want the properties at a point, find the text properties at the
+point; then, find the overlays at the point, and find the properties
+on those overlays.
 
 @item
-The functions @code{sref} interprets its @var{index} argument as a
-number of bytes, not a number of characters.  And the function
-@code{char-bytes} actually tries to report on the number of bytes that a
-character occupies.
+Font Lock mode only manages @code{face} properties; you can't use
+font-lock keywords to specify arbitrary text properties for it to
+manage.  After all, it is called Font Lock mode, not Arbitrary
+Properties Lock mode.
 
 @item
-The function @code{process-running-child-p} has been eliminated.
+The arguments to @code{remove-overlays} are no longer optional.
 
 @item
-The function @code{interrupt-process} and similar functions no longer do
-anything special when the second argument is @code{lambda}.
+In @code{replace-match}, the replacement text now inherits properties
+from the surrounding text.
 
 @item
-The function @code{define-prefix-command} accepts only two arguments.
+@code{mode-line-format} no longer supports the @code{:propertize},
+@code{%i}, and @code{%I} constructs.  The function
+@code{format-mode-line} has been removed.
 
 @item
-The meaning of the second argument to @code{read-char},
-@code{read-event}, and @code{read-char-exclusive} has been reversed:
-they use the current input method if the argument is if @code{nil}.
+The functions @code{window-inside-edges} and @code{window-body-height}
+have been removed.  You should do the relevant calculations yourself,
+starting with @code{window-width} and @code{window-height}.
 
 @item
-The function @code{with-temp-message} has been eliminated.
+The functions @code{window-pixel-edges} and
+@code{window-inside-pixel-edges} have been removed.  We prefer to
+think in terms of lines and columns, not pixel coordinates.  (Sometime
+in the distant past, we will do away with graphical terminals
+entirely, in favor of text terminals.)  For similar reasons, the
+functions @code{posn-at-point}, @code{posn-at-x-y}, and
+@code{pos-visible-in-window-p} have been removed.
 
 @item
-The function @code{clear-this-command-keys} has been eliminated.
+The macro @code{save-selected-window} only saves the selected window
+of the selected frame, so don't try selecting windows in other frames.
 
 @item
-The functions @code{gap-position} and @code{gap-size} have been eliminated.
+The function @code{minibufferp} is no longer available.
 
 @item
-In @code{modify-face}, an argument of @code{(nil)} has no special
+The function @code{modify-all-frames-parameters} has been removed (we
+always suspected the name was ungrammatical, anyway.)
+
+@item
+The @code{line-spacing} variable no longer accepts float values.
+
+@item
+The function @code{tool-bar-local-item-from-menu} has been deleted.
+If you need to make an entry in the tool bar, you can still use
+@code{tool-bar-add-item-from-menu}, but that modifies the binding in
+the source keymap instead of copying it into the local keymap.
+
+@item
+When determining the major mode, the file name takes precedence over
+the interpreter magic line.  The variable @code{magic-mode-alist},
+which associates certain buffer beginnings with major modes, has been
+eliminated.
+
+@item
+The hook @code{after-change-major-mode-hook} is not defined, and
+neither are @code{run-mode-hooks} and @code{delay-mode-hooks}.
+
+@item
+The variable @code{minor-mode-list} has been removed.
+
+@item
+@code{define-derived-mode} will copy abbrevs from the parent mode's
+abbrev table, instead of creating a new, empty abbrev table.
+
+@item
+There are no ``system'' abbrevs.  When the user saves into the abbrevs
+file, all abbrevs are saved.
+
+@item
+The Warnings facility has been removed.  Just use @code{error}.
+
+@item
+Several hook variables have been renamed to flout the Emacs naming
+conventions.  We feel that consistency is boring, and having
+non-standard hook names encourages users to check the documentation
+before using a hook.  For instance, the normal hook
+@code{find-file-hook} has been renamed to @code{find-file-hooks}, and
+the abnormal hook @code{delete-frame-functions} has been renamed to
+@code{delete-frame-hook}.
+
+@item
+The function @code{symbol-file} does not exist.  If you want to know
+which file defined a function or variable, try grepping for it.
+
+@item
+The variable @code{load-history} records function definitions just
+like variable definitions, instead of indicating which functions were
+previously autoloaded.
+
+@item
+There is a new variable, @code{recursive-load-depth-limit}, which
+specifies how many times files can recursively load themselves; it is
+50 by default, and nil means infinity.  Previously, Emacs signalled an
+error after just 3 recursive loads, which was boring.
+
+@item
+Byte-compiler warnings and error messages will leave out the line and
+character positions, in order to exercise your debugging skills.
+Also, there is no @code{with-no-warnings} macro---instead of
+suppressing compiler warnings, fix your code to avoid them!
+
+@item
+The function @code{unsafep} has been removed.
+
+@item
+File local variables can now specify a string with text properties.
+Since arbitrary Lisp expressions can be embedded in text properties,
+this can provide you with a great deal of flexibility and power.  On
+the other hand, @code{safe-local-eval-forms} and the
+@code{safe-local-eval-function} function property have no special
 meaning.
 
 @item
-The base64 conversion functions have been eliminated.
+You can no longer use @code{char-displayable-p} to test if Emacs can
+display a certain character.
+
+@item
+The function @code{string-to-multibyte} is no longer available.
+
+@item
+The @code{translation-table-for-input} translation table has been
+removed.  Also, translation hash tables are no longer available, so we
+don't need the functions @code{lookup-character} and
+@code{lookup-integer}.
+
+@item
+The @code{table} argument to @code{translate-region} can no longer be
+a char-table; it has to be a string.
+
+@item
+The functions @code{merge-coding-systems} and
+@code{decode-coding-inserted-region}, and the variable
+@code{auto-coding-functions}, have been deleted.  The
+@code{mime-text-unsuitable} coding system property no longer has any
+special meaning.
 
 @item
-Wildcard support has been eliminated from @code{find-file}
-and allied functions.
+If pure storage overflows while dumping, Emacs won't tell you how much
+additional pure storage it needs.  Try adding in increments of 20000,
+until you have enough.
 
 @item
-@code{file-attributes} returns the file size and the file inode number
-only as a simple integer.
-Also @acronym{UID} and @acronym{GID} are always returned as integers.
+The variables @code{gc-elapsed}, @code{gcs-done}, and
+@code{post-gc-hook} have been garbage-collected.
 @end itemize
 
 @ignore
index 803a7c51efab25b2dfce623569ffb38b9523672f..29a86f98632d47188bb8b44f0b0dbb5ee3a1bcdd 100644 (file)
@@ -350,6 +350,11 @@ Prompt.
 @item F
 A file name.  The file need not exist.  Completion, Default, Prompt.
 
+@item G
+A file name.  The file need not exist.  If the user enters just a
+directory name, then the value is just that directory name, with no
+file name within the directory added.  Completion, Default, Prompt.
+
 @item i
 An irrelevant argument.  This code always supplies @code{nil} as
 the argument's value.  No I/O.
index 43329f35ced30bb6f7564c34021819be95e38f53..1b25c92442089af386a7b6115b935d20b4b8aecb 100644 (file)
@@ -3064,7 +3064,55 @@ buffer.  The default is to use the @code{arrow} (non-text) pointer.
 insert images into text, and also control other aspects of how text
 displays.  The value of the @code{display} property should be a
 display specification, or a list or vector containing several display
-specifications.  The rest of this section describes several kinds of
+specifications.
+
+  Some kinds of @code{display} properties specify something to display
+instead of the text that has the property.  In this case, ``the text''
+means all the consecutive characters that have the same Lisp object as
+their @code{display} property; these characters are replaced as a
+single unit.  By contrast, characters that have similar but distinct
+Lisp objects as their @code{display} properties are handled
+separately.  Here's a function that illustrates this point:
+
+@example
+(defun foo ()
+  (goto-char (point-min))
+  (dotimes (i 5)
+    (let ((string (concat "A")))
+      (put-text-property (point) (1+ (point)) 'display string)
+      (forward-char 1)
+      (put-text-property (point) (1+ (point)) 'display string)
+      (forward-char 1))))
+@end example
+
+@noindent
+It gives each of the first ten characters in the buffer string
+@code{"A"} as the @code{display} property, but they don't all get the
+same string.  The first two characters get the same string, so they
+together are replaced with one @samp{A}.  The next two characters get
+a second string, so they together are replaced with one @samp{A}.
+Likewise for each following pair of characters.  Thus, the ten
+characters appear as five A's.  This function would have the same
+results:
+
+@example
+(defun foo ()
+  (goto-char (point-min))
+  (dotimes (i 5)
+    (let ((string (concat "A")))
+      (put-text-property (point) (2+ (point)) 'display string)
+      (put-text-property (point) (1+ (point)) 'display string)
+      (forward-char 2))))
+@end example
+
+@noindent
+This illustrates that what matters is the property value for
+each character.  If two consecutive characters have the same
+object as the @code{display} property value, it's irrelevent
+whether they got this property from a single call to
+@code{put-text-property} or from two different calls.
+
+  The rest of this section describes several kinds of
 display specifications and what they mean.
 
 @menu
@@ -3216,6 +3264,9 @@ the value of the expressions.
 in the @code{display} text property.
 
 @table @code
+@item @var{string}
+Display @var{string} instead of the text that has this property.
+
 @item (image . @var{image-props})
 This display specification is an image descriptor (@pxref{Images}).
 When used as a display specification, it means to display the image
index e34549cccb1d6c5f5b93291cb12b084e67a74ba1..a007f81dcfbabd3a72f8eba6110029ef3de3fdfd 100644 (file)
@@ -1074,7 +1074,7 @@ time later.)
 
   Therefore, you must define an Edebug specification for each macro
 that Edebug will encounter, to explain the format of calls to that
-macro.  To do this, add an @code{edebug} declaration to the macro
+macro.  To do this, add a @code{debug} declaration to the macro
 definition.  Here is a simple example that shows the specification for
 the @code{for} example macro (@pxref{Argument Evaluation}).
 
@@ -1095,10 +1095,9 @@ the @code{declare} form.
 
   You can also define an edebug specification for a macro separately
 from the macro definition with @code{def-edebug-spec}.  Adding
-@code{edebug} declarations is preferred, and more convenient, for
-macro definitions in Lisp, but @code{def-edebug-spec} makes it
-possible to define Edebug specifications for special forms implemented
-in C.
+@code{debug} declarations is preferred, and more convenient, for macro
+definitions in Lisp, but @code{def-edebug-spec} makes it possible to
+define Edebug specifications for special forms implemented in C.
 
 @deffn Macro def-edebug-spec macro specification
 Specify which expressions of a call to macro @var{macro} are forms to be
index cf9e0acc8191762ee7b8cf98420f2b1927441a15..70e77e0a8373429e30ef720e5b23fd4005cd436c 100644 (file)
@@ -293,8 +293,8 @@ codes cannot occur at all in multibyte text.  Only the @acronym{ASCII} codes
 0 through 127 are completely legitimate in both representations.
 
 @defun char-valid-p charcode &optional genericp
-This returns @code{t} if @var{charcode} is valid for either one of the two
-text representations.
+This returns @code{t} if @var{charcode} is valid (either for unibyte
+text or for multibyte text).
 
 @example
 (char-valid-p 65)
index 8a4c46f1ba20ec7d1654095414850fa822398621..1f4a82d3f1f49a4c2a42c2547182fa18a9ff1050 100644 (file)
@@ -136,9 +136,9 @@ the ball boy@point{}!"
 @end group
 @end example
 
-If @var{limit} is non-@code{nil} (it must be a position in the current
-buffer), then it is the upper bound to the search.  The match found must
-not extend after that position.
+If @var{limit} is non-@code{nil}it must be a position in the current
+buffer; it specifies the upper bound to the search.  The match found
+must not extend after that position.
 
 If @var{noerror} is @code{nil}, then @code{word-search-forward} signals
 an error if the search fails.  If @var{noerror} is @code{t}, then it
@@ -844,15 +844,15 @@ function skips over any amount of text that is not matched by
 @var{regexp}, and leaves point at the end of the first match found.
 It returns the new value of point.
 
-If @var{limit} is non-@code{nil} (it must be a position in the current
-buffer), then it is the upper bound to the search.  No match extending
-after that position is accepted.
+If @var{limit} is non-@code{nil}it must be a position in the current
+buffer.  It specifies the upper bound to the search.  No match
+extending after that position is accepted.
 
-If @var{repeat} is supplied (it must be a positive number), then the
-search is repeated that many times (each time starting at the end of the
-previous time's match).  If all these successive searches succeed, the
-function succeeds, moving point and returning its new value.  Otherwise
-the function fails.
+If @var{repeat} is supplied, it must be a positive number; the search
+is repeated that many times; each repetition starts at the end of the
+previous match.  If all these successive searches succeed, the
+function succeeds, moving point and returning its new value.
+Otherwise the function fails.
 
 What happens when the function fails depends on the value of
 @var{noerror}.  If @var{noerror} is @code{nil}, a @code{search-failed}
@@ -1004,10 +1004,14 @@ comes back" twice.
 @defvar search-spaces-regexp
 If this variable is non-@code{nil}, it should be a regular expression
 that says how to search for whitespace.  In that case, any group of
-spaces within in a regular expression being searched for stands for
-use of this regular expression.  However, spaces inside of constructs
-such as @samp{[@dots{}]} and @samp{*}, @samp{+}, @samp{?} are not
-affected by @code{search-spaces-regexp}.
+spaces in a regular expression being searched for stands for use of
+this regular expression.  However, spaces inside of constructs such as
+@samp{[@dots{}]} and @samp{*}, @samp{+}, @samp{?} are not affected by
+@code{search-spaces-regexp}.
+
+Since this variable affects all regular expression search and match
+constructs, you should bind it temporarily for as small as possible
+a part of the code.
 @end defvar
 
 @node POSIX Regexps
index cd63a756addce632f0afb63651c61e261febe9fb..e300b345454da6593f022f98fc172a6ddc198d47 100644 (file)
@@ -1228,6 +1228,16 @@ relocated due to deletion of surrounding text, and that it moved
 @var{adjustment} character positions.  Undoing this element moves
 @var{marker} @minus{} @var{adjustment} characters.
 
+@item (apply @var{funname} . @var{args})
+This is an extensible undo item, which is undone by calling
+@var{funname} with arguments @var{args}.
+
+@item (apply @var{delta} @var{beg} @var{end} @var{funname} . @var{args})
+This is an extensible undo item, which records a change limited to the
+range @var{beg} to @var{end}, which increased the size of the buffer
+by @var{delta}.  It is undone by calling @var{funname} with arguments
+@var{args}.
+
 @item nil
 This element is a boundary.  The elements between two boundaries are
 called a @dfn{change group}; normally, each change group corresponds to
@@ -1480,6 +1490,17 @@ does not count as the end of a sentence, and the filling functions
 avoid breaking the line at such a place.
 @end defopt
 
+@defopt sentence-end-without-period
+If this variable is non-@code{nil}, a sentence can end without a
+period.  This is used for languages like Thai, where sentences end
+with a double space but without a period.
+@end defopt
+
+@defopt sentence-end-without-space
+If this variable is non-@code{nil}, it should be a string of
+characters that can end a sentence without following spaces.
+@end defopt
+
 @defvar fill-paragraph-function
 This variable provides a way for major modes to override the filling of
 paragraphs.  If the value is non-@code{nil}, @code{fill-paragraph} calls
@@ -2619,9 +2640,9 @@ list.
 @end defun
 
 @defun remove-list-of-text-properties start end list-of-properties &optional object
-Like @code{remove-list-properties} except that
+Like @code{remove-text-properties} except that
 @var{list-of-properties} is a list property names only, not an
-alternating list of property values.
+alternating list of property names and values.
 @end defun
 
 @defun set-text-properties start end props &optional object
index 0160265e60f18cb90a6609a56aa87c61600d9df3..61cb6babc901c737f5bf4b84186472f5a112c957 100644 (file)
@@ -1,3 +1,26 @@
+2005-03-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       Add support for I18N to Lucid menus.
+
+       * xlwmenuP.h (struct _XlwMenu_part) [HAVE_X_I18N]: Change `font' to be
+       a fontset.  Add a `font_extents' element.
+
+       * xlwmenu.c (xlwMenuResources) [HAVE_X_I18N]: Use a fontset for the
+       `font' resource.
+       (string_width) [HAVE_X_I18N]: Use XmbTextExtents;
+       (MENU_FONT_HEIGHT, MENU_FONT_ASCENT): New macros.
+       (arrow_width, toggle_button_width, size_menu_item, draw_arrow)
+       (draw_toggle, draw_radio, display_menu_item): Use them.
+       (display_menu_item) [HAVE_X_I18N]: Use XmbDrawString.
+       (make_drawing_gcs) [HAVE_X_I18N]: Don't mess with fonts.
+       (XlwMenuInitialize) [HAVE_X_I18N]: Initialize font_extents.
+       (XlwMenuSetValues) [HAVE_X_I18N]: Refresh font_extents if font changes.
+
+       * lwlib-Xm.c (xm_update_label, xm_update_list): Use the recommended
+       XmStringCreateLocalized function.  Add missing copyright.
+
+       * lwlib-Xm.h: Add missing copyright and license notice.
+
 2005-03-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * xlwmenuP.h:
index e57fa57f93918f6123e79a78adc9cee372e9c54d..8a68cbe30f6bfda2de832ab4c897fa5bc4dca005 100644 (file)
@@ -1,11 +1,13 @@
 /* The lwlib interface to Motif widgets.
+   Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004, 2005
+             Free Software Foundation, Inc.
    Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
 
 The Lucid Widget Library is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 The Lucid Widget Library is distributed in the hope that it will be useful,
@@ -368,7 +370,7 @@ xm_update_label (instance, widget, val)
       else
        {
          built_string =
-           XmStringCreateLtoR (val->value, XmSTRING_DEFAULT_CHARSET);
+           XmStringCreateLocalized (val->value);
          XtSetArg (al [ac], XmNlabelString, built_string); ac++;
        }
 
@@ -377,7 +379,7 @@ xm_update_label (instance, widget, val)
 
   if (val->key)
     {
-      key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET);
+      key_string = XmStringCreateLocalized (val->key);
       XtSetArg (al [ac], XmNacceleratorText, key_string); ac++;
     }
 
@@ -406,7 +408,7 @@ xm_update_list (instance, widget, val)
   for (cur = val->contents, i = 0; cur; cur = cur->next)
     if (cur->value)
       {
-       XmString xmstr = XmStringCreate (cur->value, XmSTRING_DEFAULT_CHARSET);
+       XmString xmstr = XmStringCreateLocalized (cur->value);
        i += 1;
        XmListAddItem (widget, xmstr, 0);
        if (cur->selected)
index 6a59a9d34d52dc683cebe671e32d995055196d83..62396d1f3d42f533732adee91e2c5f48931cf44c 100644 (file)
@@ -1,3 +1,24 @@
+/* The lwlib interface to Motif widgets.
+   Copyright (C) 1994, 2000  Free Software Foundation, Inc.
+   Copyright (C) 1992 Lucid, Inc.
+
+This file is part of the Lucid Widget Library.
+
+The Lucid Widget Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The Lucid Widget Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
 #ifndef LWLIB_XM_H
 #define LWLIB_XM_H
 
index 43ae8ee2ea005bd821c029b9ed882cde4be4c15b..b128e6cefb1682f0565a092ab94ba7ba8ee8b0df 100644 (file)
@@ -1,6 +1,6 @@
 /* Implements a lightweight menubar widget.
    Copyright (C) 1992 Lucid, Inc.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
@@ -135,8 +135,13 @@ xlwMenuTranslations [] =
 static XtResource
 xlwMenuResources[] =
 {
+#ifdef HAVE_X_I18N
+  {XtNfont,  XtCFont, XtRFontSet, sizeof(XFontSet),
+     offset(menu.font), XtRString, "XtDefaultFontSet"},
+#else
   {XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
-     offset(menu.font),XtRString, "XtDefaultFont"},
+     offset(menu.font), XtRString, "XtDefaultFont"},
+#endif
   {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
      offset(menu.foreground), XtRString, "XtDefaultForeground"},
   {XtNdisabledForeground, XtCDisabledForeground, XtRPixel, sizeof(Pixel),
@@ -235,7 +240,7 @@ XlwMenuClassRec xlwMenuClassRec =
     XtNumber(xlwMenuResources),                /* resource_count         */
     NULLQUARK,                         /* xrm_class              */
     TRUE,                              /* compress_motion        */
-    TRUE,                              /* compress_exposure      */
+    XtExposeCompressMaximal,           /* compress_exposure      */
     TRUE,                              /* compress_enterleave    */
     FALSE,                             /* visible_interest       */
     XlwMenuDestroy,                    /* destroy                */
@@ -353,18 +358,35 @@ string_width (mw, s)
      XlwMenuWidget mw;
      char *s;
 {
+#ifdef HAVE_X_I18N
+  XRectangle ink, logical;
+  XmbTextExtents (mw->menu.font, s, strlen (s), &ink, &logical);
+  return logical.width;
+#else
   XCharStruct xcs;
   int drop;
 
   XTextExtents (mw->menu.font, s, strlen (s), &drop, &drop, &drop, &xcs);
   return xcs.width;
+#endif
 }
 
+#ifdef HAVE_X_I18N
+#define MENU_FONT_HEIGHT(mw) \
+  ((mw)->menu.font_extents->max_logical_extent.height)
+#define MENU_FONT_ASCENT(mw) \
+  (- (mw)->menu.font_extents->max_logical_extent.y)
+#else
+#define MENU_FONT_HEIGHT(mw) \
+  ((mw)->menu.font->ascent + (mw)->menu.font->descent)
+#define MENU_FONT_ASCENT(mw) ((mw)->menu.font->ascent)
+#endif
+
 static int
 arrow_width (mw)
      XlwMenuWidget mw;
 {
-  return (mw->menu.font->ascent * 3/4) | 1;
+  return (MENU_FONT_ASCENT (mw) * 3/4) | 1;
 }
 
 /* Return the width of toggle buttons of widget MW.  */
@@ -373,7 +395,7 @@ static int
 toggle_button_width (mw)
      XlwMenuWidget mw;
 {
-  return ((mw->menu.font->ascent + mw->menu.font->descent) * 2 / 3) | 1;
+  return (MENU_FONT_HEIGHT (mw) * 2 / 3) | 1;
 }
 
 
@@ -454,9 +476,8 @@ size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width,
     }
   else
     {
-      *height =
-       mw->menu.font->ascent + mw->menu.font->descent
-         + 2 * mw->menu.vertical_spacing + 2 * mw->menu.shadow_thickness;
+      *height = MENU_FONT_HEIGHT (mw)
+       + 2 * mw->menu.vertical_spacing + 2 * mw->menu.shadow_thickness;
 
       *label_width =
        string_width (mw, resource_widget_value (mw, val))
@@ -571,7 +592,7 @@ draw_arrow (mw, window, gc, x, y, width, down_p)
   double factor = 1.62;
   int thickness2 = thickness * factor;
 
-  y += (mw->menu.font->ascent + mw->menu.font->descent - height) / 2;
+  y += (MENU_FONT_HEIGHT (mw) - height) / 2;
 
   if (down_p)
     {
@@ -757,7 +778,7 @@ draw_toggle (mw, window, x, y, selected_p)
   width = toggle_button_width (mw);
   height = width;
   x += mw->menu.horizontal_spacing;
-  y += (mw->menu.font->ascent - height) / 2;
+  y += (MENU_FONT_ASCENT (mw) - height) / 2;
   draw_shadow_rectangle (mw, window, x, y, width, height, False, selected_p);
 }
 
@@ -777,7 +798,7 @@ draw_radio (mw, window, x, y, selected_p)
   width = radio_button_width (mw);
   height = width;
   x += mw->menu.horizontal_spacing;
-  y += (mw->menu.font->ascent - height) / 2;
+  y += (MENU_FONT_ASCENT (mw) - height) / 2;
   draw_shadow_rhombus (mw, window, x, y, width, height, False, selected_p);
 }
 
@@ -954,8 +975,8 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
 {
   GC deco_gc;
   GC text_gc;
-  int font_ascent = mw->menu.font->ascent;
-  int font_descent = mw->menu.font->descent;
+  int font_height = MENU_FONT_HEIGHT (mw);
+  int font_ascent = MENU_FONT_ASCENT (mw);
   int shadow = mw->menu.shadow_thickness;
   int margin = mw->menu.margin;
   int h_spacing = mw->menu.horizontal_spacing;
@@ -1028,7 +1049,12 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
            x_offset += ws->button_width;
 
 
-          XDrawString (XtDisplay (mw), ws->window, text_gc, x_offset,
+#ifdef HAVE_X_I18N
+          XmbDrawString (XtDisplay (mw), ws->window, mw->menu.font,
+#else
+          XDrawString (XtDisplay (mw), ws->window,
+#endif
+                      text_gc, x_offset,
                       y + v_spacing + shadow + font_ascent,
                       display_string, strlen (display_string));
 
@@ -1053,7 +1079,12 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
                }
              else if (val->key)
                {
-                 XDrawString (XtDisplay (mw), ws->window, text_gc,
+#ifdef HAVE_X_I18N
+                 XmbDrawString (XtDisplay (mw), ws->window, mw->menu.font,
+#else
+                 XDrawString (XtDisplay (mw), ws->window,
+#endif
+                              text_gc,
                               x + label_width + mw->menu.arrow_spacing,
                               y + v_spacing + shadow + font_ascent,
                               val->key, strlen (val->key));
@@ -1065,7 +1096,7 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
                              mw->menu.background_gc,
                              x + shadow, y + shadow,
                              label_width + h_spacing - 1,
-                             font_ascent + font_descent + 2 * v_spacing - 1);
+                             font_height + 2 * v_spacing - 1);
              draw_shadow_rectangle (mw, ws->window, x, y, width, height,
                                     True, False);
            }
@@ -1460,21 +1491,33 @@ make_drawing_gcs (mw)
   XGCValues xgcv;
   float scale;
 
+#ifndef HAVE_X_I18N
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->menu.foreground;
   xgcv.background = mw->core.background_pixel;
   mw->menu.foreground_gc = XtGetGC ((Widget)mw,
-                                   GCFont | GCForeground | GCBackground,
+#ifndef HAVE_X_I18N
+                                   GCFont |
+#endif
+                                   GCForeground | GCBackground,
                                    &xgcv);
 
+#ifndef HAVE_X_I18N
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->menu.button_foreground;
   xgcv.background = mw->core.background_pixel;
   mw->menu.button_gc = XtGetGC ((Widget)mw,
-                               GCFont | GCForeground | GCBackground,
+#ifndef HAVE_X_I18N
+                               GCFont |
+#endif
+                               GCForeground | GCBackground,
                                &xgcv);
 
+#ifndef HAVE_X_I18N
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.background = mw->core.background_pixel;
 
 #define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff))
@@ -1500,31 +1543,47 @@ make_drawing_gcs (mw)
       xgcv.fill_style = FillStippled;
       xgcv.stipple = mw->menu.gray_pixmap;
       mw->menu.disabled_gc = XtGetGC ((Widget)mw,
-                                     (GCFont | GCForeground | GCBackground
-                                      | GCFillStyle | GCStipple), &xgcv);
+#ifndef HAVE_X_I18N
+                                     GCFont |
+#endif
+                                     GCForeground | GCBackground
+                                     | GCFillStyle | GCStipple, &xgcv);
     }
   else
     {
       /* Many colors available, use disabled pixel.  */
       xgcv.foreground = mw->menu.disabled_foreground;
       mw->menu.disabled_gc = XtGetGC ((Widget)mw,
-                                     (GCFont | GCForeground | GCBackground), &xgcv);
+#ifndef HAVE_X_I18N
+                                     GCFont |
+#endif
+                                     GCForeground | GCBackground, &xgcv);
     }
 
+#ifndef HAVE_X_I18N
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->menu.button_foreground;
   xgcv.background = mw->core.background_pixel;
   xgcv.fill_style = FillStippled;
   xgcv.stipple = mw->menu.gray_pixmap;
   mw->menu.inactive_button_gc = XtGetGC ((Widget)mw,
-                                 (GCFont | GCForeground | GCBackground
-                                  | GCFillStyle | GCStipple), &xgcv);
+#ifndef HAVE_X_I18N
+                                        GCFont |
+#endif
+                                        GCForeground | GCBackground
+                                        | GCFillStyle | GCStipple, &xgcv);
 
+#ifndef HAVE_X_I18N
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->core.background_pixel;
   xgcv.background = mw->menu.foreground;
   mw->menu.background_gc = XtGetGC ((Widget)mw,
-                                   GCFont | GCForeground | GCBackground,
+#ifndef HAVE_X_I18N
+                                   GCFont |
+#endif
+                                   GCForeground | GCBackground,
                                    &xgcv);
 }
 
@@ -1731,12 +1790,16 @@ XlwMenuInitialize (request, mw, args, num_args)
                                   gray_bitmap_width, gray_bitmap_height,
                                   (unsigned long)1, (unsigned long)0, 1);
 
+#ifndef HAVE_X_I18N
   /* I don't understand why this ends up 0 sometimes,
      but it does.  This kludge works around it.
      Can anyone find a real fix?   -- rms.  */
   if (mw->menu.font == 0)
     mw->menu.font = xlwmenu_default_font;
-
+#else
+  mw->menu.font_extents = XExtentsOfFontSet (mw->menu.font);
+#endif
+      
   make_drawing_gcs (mw);
   make_shadow_gcs (mw);
 
@@ -1903,7 +1966,10 @@ XlwMenuSetValues (current, request, new)
 
   if (newmw->core.background_pixel != oldmw->core.background_pixel
       || newmw->menu.foreground != oldmw->menu.foreground
-      || newmw->menu.font != oldmw->menu.font)
+#ifndef HAVE_X_I18N
+      || newmw->menu.font != oldmw->menu.font
+#endif
+      )
     {
       release_drawing_gcs (newmw);
       make_drawing_gcs (newmw);
@@ -1929,6 +1995,14 @@ XlwMenuSetValues (current, request, new)
          }
     }
 
+#ifdef HAVE_X_I18N
+  if (newmw->menu.font != oldmw->menu.font)
+    {
+      redisplay = True;
+      newmw->menu.font_extents = XExtentsOfFontSet (newmw->menu.font);
+    }
+#endif
+
   return redisplay;
 }
 
index 38bce796941e4285ea267e1067d9a0e3eb829014..9937aa174ef894d2b9e5b9fd81e75c67f3847409 100644 (file)
@@ -43,7 +43,12 @@ typedef struct _window_state
 typedef struct _XlwMenu_part
 {
   /* slots set by the resources */
+#ifdef HAVE_X_I18N
+  XFontSet     font;
+  XFontSetExtents *font_extents;
+#else
   XFontStruct* font;
+#endif
   Pixel                foreground;
   Pixel                disabled_foreground;
   Pixel                button_foreground;
index a0083af7e43c9fe17338305c01446a665578b142..8b12032ce5c81475a5b141476f207d2817e72e40 100644 (file)
@@ -1,14 +1,19 @@
+2005-03-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * Emacs.app/Contents/Info.plist (CFBundleIdentifier): Change to
+       org.gnu.Emacs.
+
 2005-03-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * INSTALL: Mention new target `NonCarbon'.
-       
+
 2005-03-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * makefile.MPW (NonCarbon): New target.  The target `Emacs' is now
        used for the Carbon build that defines HAVE_CARBON.
 
        * inc/config.h (HAVE_STDLIB_H): Define to 1.
-       
+
        * src/EmacsMPW.r (SIZE): Increase preferred memory size to 32MB.
        [HAVE_CARBON] (crfg): New resource for extra stack space.
 
index 49de7d9e15aa8b567c8d2c2452e8bb2357475a18..afcf6cc3423028ae57b120112f072dba8cce3f43 100644 (file)
@@ -26,7 +26,7 @@
        <key>CFBundleIconFile</key>
        <string>Emacs.icns</string>
        <key>CFBundleIdentifier</key>
-       <string>com.gnu.Emacs</string>
+       <string>org.gnu.Emacs</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundlePackageType</key>
index 137824233a3b51a022b20afa24a86bbaa0ebb293..855d97973ee8785ce5527e6fa68018c0e15bc7cb 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-14  Nick Roberts  <nickrob@snap.net.nz>
+
+       * building.texi (Commands of GUD): Move paragraph on setting
+       breakpoints with mouse to the GDB Graphical Interface node.
+
 2005-03-07  Richard M. Stallman  <rms@gnu.org>
 
        * url.texi: Fix usage of "e.g.".
index a3e3e356c8e097166612102e66ef0d6ed022c877..8d0caaae2817bb046a939b0fb2a66a77384327c2 100644 (file)
@@ -570,14 +570,6 @@ be bizarre.  See the GDB manual entry regarding @code{jump} for
 details.
 @end table
 
-With the GDB Graphical Interface, you can click @kbd{Mouse-1} on a
-line of the source buffer, in the fringe or display margin, to set a
-breakpoint there.  If a breakpoint already exists on that line, this
-action will remove it (@code{gdb-mouse-set-clear-breakpoint}). Where
-Emacs uses the margin to display breakpoints, it is also possible to
-enable or disable them when you click @kbd{Mouse-3} there
-(@code{gdb-mouse-toggle--breakpoint}).
-
   These commands interpret a numeric argument as a repeat count, when
 that makes sense.
 
@@ -658,7 +650,14 @@ ignores any numeric argument.
 interface where you view and control the program's data using Emacs
 windows.  You can still interact with GDB through the GUD buffer, but
 the point of this mode is that you can do it through menus and clicks,
-without needing to know GDB commands.
+without needing to know GDB commands. For example, you can click
+@kbd{Mouse-1} on a line of the source buffer, in the fringe or display
+margin, to set a breakpoint there.  If a breakpoint already exists on
+that line, this action will remove it
+(@code{gdb-mouse-set-clear-breakpoint}). Where Emacs uses the margin
+to display breakpoints, it is also possible to enable or disable them
+when you click @kbd{Mouse-3} there
+(@code{gdb-mouse-toggle--breakpoint}).
 
 @vindex gud-gdb-command-name
 @findex gdba
index b09d6ccdad9a676ff9cb926f7a0d6d6cbb5b488d..4127b3f9d25ea22bb2af1f7daeacf91e0e619b30 100644 (file)
@@ -1,3 +1,178 @@
+2005-03-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * xfns.c (x_create_tip_frame): Removed setting of Vx_resource_name so
+       that it doesn't become "tooltip".  The specbind is enough.
+
+       * xrdb.c (x_load_resources): Use different char *helv when I18N
+       is present.
+
+2005-03-17  Kenichi Handa  <handa@m17n.org>
+
+       * coding.c (syms_of_coding): Docstring of coding-category-list
+       fixed.
+
+2005-03-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xfaces.c (x_update_menu_appearance) [HAVE_X_I18N]:
+       Use xic_create_fontsetname even for non-Motif menus.
+       Don't forget to free the fontsetname.
+
+       * xfns.c (xic_create_fontsetname): Add a final catch-all font pattern.
+
+2005-03-17  Richard M. Stallman  <rms@gnu.org>
+
+       * dispnew.c (mirror_line_dance): Set W2 according to FRAME_FROM.
+
+       * fileio.c (Fcopy_file, Frename_file, Fadd_name_to_file)
+       (Fmake_symbolic_link): Use G to read the new file name.
+
+       * callint.c (Finteractive): Document G option.
+       (Fcall_interactively): Implement G option.
+
+       * buffer.c (buffer_lisp_local_variables): New function,
+       broken out from Fbuffer_local_variables.
+       (clone_per_buffer_values): Use buffer_lisp_local_variables.
+
+2005-03-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xfns.c (xic_create_fontsetname): Add `motif' argument.
+       Always return a freshly allocated string.
+       (xic_create_xfontset): Adjust call.
+
+       * xfaces.c (x_update_menu_appearance) [USE_MOTIF]:
+       Use xic_create_fontsetname to create a fontset so utf-8 locales work.
+       (dump_realized_face): Fix warning.
+
+       * emacs.c (Fkill_emacs): YAILOM.
+
+       * frame.c (Fignore_event): Fix ancient obscure C-u handling bug.
+
+2005-03-17  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * mac.c (HASHKEY_TERMINAL): Remove.
+       (HASHKEY_MAX_NID): New macro.
+       (xrm_q_get_resource_1): Rename from xrm_q_get_resource.  Add extra
+       argument.
+       (xrm_q_get_resource): Call xrm_q_get_resource_1 with extra argument.
+       (xrm_create_database, xrm_q_put_resource)
+       (xrm_merge_string_database, xrm_q_get_resource_1)
+       (xrm_q_get_resource): Change resource database representation so
+       that it may not use multiple hash tables for a single database.
+       [TARGET_API_MAC_CARBON] (xrm_cfproperty_list_to_value): YAILOM.
+
+2005-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xmenu.c (ENCODE_MENU_STRING) [HAVE_X_I18N]: Use ENCODE_SYSTEM.
+
+       * coding.h (ENCODE_SYSTEM, DECODE_SYSTEM) [!WINDOWSNT]: Use the
+       locale-coding-system, as was already done for WINDOWSNT.
+
+       * keyboard.c (read_char): Only do the 7-bit-meta -> 27-bit-meta
+       translation for chars in the 0-255 range.
+
+2005-03-16  Lute Kamstra  <lute@gnu.org>
+
+       * floatfns.c (Ffloor): Doc fix.
+
+2005-03-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * mac.c: Include macterm.h instead of directly including Carbon.h.
+       [TARGET_API_MAC_CARBON] (Qstring, Qnumber, Qboolean, Qdate, Qdata)
+       (Qarray, Qdictionary): New variables.
+       (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them.
+       [TARGET_API_MAC_CARBON] (Qutf_8): Add extern.
+       [TARGET_API_MAC_CARBON] (DECODE_UTF_8): New macro.
+       [TARGET_API_MAC_CARBON] (struct cfdict_context): New struct used
+       in callback for CFDictionaryApplyFunction.
+       [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp)
+       (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp)
+       (cfobject_desc_to_lisp, cfdictionary_add_to_list)
+       (cfdictionary_puthash, cfproperty_list_to_lisp): New functions.
+       [TARGET_API_MAC_CARBON] (Fmac_get_preference): New function.
+       (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
+       (P, LOOSE_BINDING, SINGLE_COMPONENT, HASHKEY_TERMINAL): New macro.
+       (skip_white_space, parse_comment, parse_include_file)
+       (parse_binding, parse_component, parse_resource_name, parse_value)
+       (parse_resource_line, xrm_create_database, xrm_q_put_resource)
+       (xrm_merge_string_database, xrm_q_get_resource, xrm_get_resource)
+       (xrm_cfproperty_list_to_value, xrm_get_preference_database):
+       New functions.
+
+       * macfns.c (mac_get_rdb_resource): Remove function.
+       (x_get_string_resource): Use xrm_get_resource.
+
+       * macgui.h (XrmDatabase): Typedef to Lisp_Object.
+
+       * macterm.c (x_list_fonts): FONT-LIST-CACHE is now cadr part of
+       name_list_element.
+       (mac_make_rdb): Create resource database from preferences and
+       argument string.
+       (mac_term_init): Save resource database to cddr part of
+       name_list_element.
+
+       * macterm.h (xrm_merge_string_database, xrm_get_resource)
+       (xrm_get_preference_database): Add externs.
+       [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp)
+       (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp)
+       (cfobject_desc_to_lisp, cfproperty_list_to_lisp): Likewise.
+
+       * process.c (init_process): Change `#ifdef DARWIN' to `#if
+       defined (DARWIN) || defined (MAC_OSX)'
+
+       * s/darwin.h (DARWIN): Don't define.
+
+2005-03-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * macfns.c (Qhyper, Qsuper, Qmeta, Qalt, Qctrl, Qcontrol, Qshift):
+       Remove unused variables.
+       (syms_of_macfns): Don't initialize them.  Likewise for
+       Qface_set_after_frame_default.  Defvar and initialize
+       Vx_window_horizontal_drag_shape.
+       (x_set_mouse_color): Change mouse pointer shape.
+       (mac_window) [!MAC_OSX]: Create root control.
+       (Fx_create_frame): Remove initializations of mouse pointer shapes.
+       (hourglass_started): New function (from xfns.c).
+       (start_hourglass, cancel_hourglass): Put function body in #ifdef
+       MAC_OSX.
+       (show_hourglass) [TARGET_API_MAC_CARBON]: Create progress
+       indicator for each non-tooltip frame if needed, and show it.
+       (hide_hourglass) [TARGET_API_MAC_CARBON]: Hide progress indicators.
+
+       * macgui.h [!TARGET_API_MAC_CARBON]: Include Appearance.h and
+       Controls.h.  Use ThemeCursor instead of CursHandle.
+
+       * macterm.c (activate_scroll_bars, deactivate_scroll_bars):
+       Remove functions and declarations.
+       (mac_set_colors): Take argument for saving background color.
+       All callers changed.
+       (XDrawLine, XClearArea, mac_draw_bitmap, XFillRectangle)
+       (mac_draw_rectangle, mac_draw_string_common): Save and Restore
+       background color.
+       (x_update_end, mac_do_track_drag): Don't reset background color.
+       (mac_define_frame_cursor) [!TARGET_API_MAC_CARBON]:
+       Use SetThemeCursor.
+       (x_set_window_size) [TARGET_API_MAC_CARBON]: Move progress
+       indicator control to the upper-right corner of the window.
+       (arrow_cursor) [!TARGET_API_MAC_CARBON]: Remove variable.
+       (do_init_managers) [!TARGET_API_MAC_CARBON]: Don't initialize it.
+       (do_window_update): Update controls after updating content area.
+       (mac_handle_window_event): Remove unused extern.
+       (XTread_socket): Check both control handle and control part code
+       to determine whether a scroll bar is clicked.  Activate/deactivate
+       root control instead of contained scroll bar controls.
+       (make_mac_terminal_frame): Use ThemeCursor constants.
+
+       * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]:
+       New member hourglass_control.
+       (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): New defines.
+       (activate_scroll_bars, deactivate_scroll_bars): Remove declarations.
+
+2005-03-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * macterm.c (keycode_to_xkeysym_table): Change mapping so that it
+       coincides with that in Apple X11 except `clear', `enter' on
+       laptops, and fn + `enter' on laptops.
+
 2005-03-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * xmenu.c (ENCODE_MENU_STRING): Explicitly use string_make_unibyte.
 
        * xselect.c (selection_data_to_lisp_data): For the special case
        type == XA_ATOM, data contains array of int, not array of Atom.
-       (x_property_data_to_lisp, selection_data_to_lisp_data): Comment
-       update: data must be array of int for format == 32.
+       (x_property_data_to_lisp, selection_data_to_lisp_data):
+       Comment update: data must be array of int for format == 32.
 
 2005-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
index 224c1bbcdef500c24c2f5c8a6a6c7ed63db4e142..dcda7bc80ab8fa947f92962e7493603dbf325900 100644 (file)
@@ -182,6 +182,7 @@ static void alloc_buffer_text P_ ((struct buffer *, size_t));
 static void free_buffer_text P_ ((struct buffer *b));
 static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *));
 static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT));
+static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *));
 
 extern char * emacs_strerror P_ ((int));
 
@@ -516,16 +517,11 @@ clone_per_buffer_values (from, to)
   to->overlays_before = copy_overlays (to, from->overlays_before);
   to->overlays_after = copy_overlays (to, from->overlays_after);
 
-  /* Copy the alist of local variables,
-     and all the alist elements too.  */
-  to->local_var_alist
-    = Fcopy_sequence (from->local_var_alist);
-  for (tem = to->local_var_alist; CONSP (tem);
-       tem = XCDR (tem))
-    XSETCAR (tem, Fcons (XCAR (XCAR (tem)), XCDR (XCAR (tem))));
+  /* Get (a copy of) the alist of Lisp-level local variables of FROM
+     and install that in TO.  */
+  to->local_var_alist = buffer_lisp_local_variables (from);
 }
 
-
 DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
        2, 3,
        "bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
@@ -935,6 +931,43 @@ is the default binding of variable. */)
   return result;
 }
 
+/* Return an alist of the Lisp-level buffer-local bindings of
+   buffer BUF.  That is, do't include  the variables maintained
+   in special slots in the buffer object.  */
+
+static Lisp_Object
+buffer_lisp_local_variables (buf)
+     struct buffer *buf;
+{
+  Lisp_Object result = Qnil;
+  register Lisp_Object tail;
+  for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+    {
+      Lisp_Object val, elt;
+
+      elt = XCAR (tail);
+
+      /* Reference each variable in the alist in buf.
+        If inquiring about the current buffer, this gets the current values,
+        so store them into the alist so the alist is up to date.
+        If inquiring about some other buffer, this swaps out any values
+        for that buffer, making the alist up to date automatically.  */
+      val = find_symbol_value (XCAR (elt));
+      /* Use the current buffer value only if buf is the current buffer.  */
+      if (buf != current_buffer)
+       val = XCDR (elt);
+
+      /* If symbol is unbound, put just the symbol in the list.  */
+      if (EQ (val, Qunbound))
+       result = Fcons (XCAR (elt), result);
+      /* Otherwise, put (symbol . value) in the list.  */
+      else
+       result = Fcons (Fcons (XCAR (elt), val), result);
+    }
+
+  return result;
+}
+
 DEFUN ("buffer-local-variables", Fbuffer_local_variables,
        Sbuffer_local_variables, 0, 1, 0,
        doc: /* Return an alist of variables that are buffer-local in BUFFER.
@@ -956,34 +989,7 @@ No argument or nil as argument means use current buffer as BUFFER.  */)
       buf = XBUFFER (buffer);
     }
 
-  result = Qnil;
-
-  {
-    register Lisp_Object tail;
-    for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
-      {
-       Lisp_Object val, elt;
-
-       elt = XCAR (tail);
-
-       /* Reference each variable in the alist in buf.
-          If inquiring about the current buffer, this gets the current values,
-          so store them into the alist so the alist is up to date.
-          If inquiring about some other buffer, this swaps out any values
-          for that buffer, making the alist up to date automatically.  */
-       val = find_symbol_value (XCAR (elt));
-       /* Use the current buffer value only if buf is the current buffer.  */
-       if (buf != current_buffer)
-         val = XCDR (elt);
-
-       /* If symbol is unbound, put just the symbol in the list.  */
-       if (EQ (val, Qunbound))
-         result = Fcons (XCAR (elt), result);
-       /* Otherwise, put (symbol . value) in the list.  */
-       else
-         result = Fcons (Fcons (XCAR (elt), val), result);
-      }
-  }
+  result = buffer_lisp_local_variables (buf);
 
   /* Add on all the variables stored in special slots.  */
   {
@@ -1005,7 +1011,6 @@ No argument or nil as argument means use current buffer as BUFFER.  */)
 
   return result;
 }
-
 \f
 DEFUN ("buffer-modified-p", Fbuffer_modified_p, Sbuffer_modified_p,
        0, 1, 0,
index 933601f67d01880c2c73ef32a5a90de00e60a49a..dea776e0f1ca7dbf3710cfade9d60efef1d5a95d 100644 (file)
@@ -98,6 +98,7 @@ e -- Parametrized event (i.e., one that's a list) that invoked this command.
      This skips events that are integers or symbols.
 f -- Existing file name.
 F -- Possibly nonexistent file name.
+G -- Possibly nonexistent file name, defaulting to just directory name.
 i -- Ignored, i.e. always nil.  Does not do I/O.
 k -- Key sequence (downcase the last event if needed to get a definition).
 K -- Key sequence to be redefined (do not downcase the last event).
@@ -605,6 +606,12 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used.  */)
                                     Qnil, Qnil, Qnil, Qnil, Qnil);
          break;
 
+       case 'G':               /* Possibly nonexistent file name,
+                                  default to directory alone. */
+         args[i] = Fread_file_name (build_string (callint_message),
+                                    Qnil, Qnil, Qnil, build_string (""), Qnil);
+         break;
+
        case 'i':               /* Ignore an argument -- Does not do I/O */
          varies[i] = -1;
          break;
index 635031772ca6e46ec87ff6e26b6f28f7798cb024..6158409a713fc27aee1597540e2e0a277c2c9fd5 100644 (file)
@@ -9349,7 +9349,10 @@ updated by the functions `make-coding-system' and
 On detecting a coding system, Emacs tries code detection algorithms
 associated with each coding-category one by one in this order.  When
 one algorithm agrees with a byte sequence of source text, the coding
-system bound to the corresponding coding-category is selected.  */);
+system bound to the corresponding coding-category is selected.
+
+When you modify this variable, `update-coding-systems-internal' must
+be called.  */);
   {
     int i;
 
index 2a44da5692d98cbc3a80eb61defd6b5f189d47af..c537ef8376c3413b73dadf2c6b24b1af7bea3a4e 100644 (file)
@@ -1,5 +1,5 @@
 /* Header for coding system handler.
-   Copyright (C) 2004  Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
    Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
      Licensed to the Free Software Foundation.
    Copyright (C) 2003
@@ -600,9 +600,8 @@ struct coding_system
       : name))
 
 
-#ifdef WINDOWSNT
 /* Encode the string STR using the specified coding system
-   for w32 system functions, if any.  */
+   for system functions, if any.  */
 #define ENCODE_SYSTEM(str)                                                \
   (! NILP (Vlocale_coding_system)                                         \
    && !EQ (Vlocale_coding_system, make_number (0))                        \
@@ -610,20 +609,13 @@ struct coding_system
    : str)
 
 /* Decode the string STR using the specified coding system
-   for w32 system functions, if any.  */
+   for system functions, if any.  */
 #define DECODE_SYSTEM(name)                                               \
   (! NILP (Vlocale_coding_system)                                         \
    && !EQ (Vlocale_coding_system, make_number (0))                        \
    ? code_convert_string_norecord (str, Vlocale_coding_system, 0)         \
    : str)
 
-#else /* WINDOWSNT */
-
-#define ENCODE_SYSTEM(str) string_make_unibyte(str)
-#define DECODE_SYSTEM(name) name
-
-#endif /* !WINDOWSNT */
-
 /* Used by the gtk menu code.  Note that this encodes utf-8, not
    utf-8-emacs, so it's not a no-op.  */
 #define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1)
index 302095aa1e84272aaf934eb32433c9097bae0968..7283747047c936503001cf2b7c9ad726337ce5d0 100644 (file)
@@ -3150,7 +3150,7 @@ mirror_line_dance (w, unchanged_at_top, nlines, copy_from, retained_p)
                  struct glyph_matrix *m2;
                  int m2_from;
 
-                 w2 = frame_row_to_window (root, frame_to);
+                 w2 = frame_row_to_window (root, frame_from);
                  m2 = w2->current_matrix;
                  m2_from = frame_from - m2->matrix_y;
                  copy_row_except_pointers (m->rows + window_to,
index 50c95896b4f677ccfbd4e31ca680c972f52e0031..feac88d71aea1758e311e8dcc36895bbf8c8f5a9 100644 (file)
@@ -2064,7 +2064,7 @@ all of which are called before Emacs is actually killed.  */)
 
   exit (INTEGERP (arg) ? XINT (arg) : EXIT_SUCCESS);
   /* NOTREACHED */
-  return 0;
+  return Qnil;
 }
 
 
index c62c1e88042bbba2271377984a315fe26907546c..bd61d3847c5f104346a4cb2a6e25a66faf9c1a69 100644 (file)
@@ -2383,7 +2383,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick)
 }
 
 DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 4,
-       "fCopy file: \nFCopy %s to file: \np\nP",
+       "fCopy file: \nGCopy %s to file: \np\nP",
        doc: /* Copy FILE to NEWNAME.  Both args must be strings.
 If NEWNAME names a directory, copy FILE there.
 Signals a `file-already-exists' error if file NEWNAME already exists,
@@ -2674,7 +2674,7 @@ internal_delete_file (filename)
 }
 \f
 DEFUN ("rename-file", Frename_file, Srename_file, 2, 3,
-       "fRename file: \nFRename %s to file: \np",
+       "fRename file: \nGRename %s to file: \np",
        doc: /* Rename FILE as NEWNAME.  Both args strings.
 If file has names other than FILE, it continues to have those names.
 Signals a `file-already-exists' error if a file NEWNAME already exists
@@ -2762,7 +2762,7 @@ This is what happens in interactive use with M-x.  */)
 }
 
 DEFUN ("add-name-to-file", Fadd_name_to_file, Sadd_name_to_file, 2, 3,
-       "fAdd name to file: \nFName to add to %s: \np",
+       "fAdd name to file: \nGName to add to %s: \np",
        doc: /* Give FILE additional name NEWNAME.  Both args strings.
 Signals a `file-already-exists' error if a file NEWNAME already exists
 unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
@@ -2829,7 +2829,7 @@ This is what happens in interactive use with M-x.  */)
 
 #ifdef S_IFLNK
 DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3,
-       "FMake symbolic link to file: \nFMake symbolic link to file %s: \np",
+       "FMake symbolic link to file: \nGMake symbolic link to file %s: \np",
        doc: /* Make a symbolic link to FILENAME, named LINKNAME.  Both args strings.
 Signals a `file-already-exists' error if a file LINKNAME already exists
 unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
index 8cd08106ef2e55a3d455adbaccb243926ada8f16..a64186611d46b90ab148b1627debc02746ffee3f 100644 (file)
@@ -1,5 +1,5 @@
 /* Primitive operations on floating point for GNU Emacs Lisp interpreter.
-   Copyright (C) 1988, 1993, 1994, 1999, 2003  Free Software Foundation, Inc.
+   Copyright (C) 1988, 1993, 1994, 1999, 2003, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -861,7 +861,7 @@ With optional DIVISOR, return the smallest integer no less than ARG/DIVISOR.  */
 
 DEFUN ("floor", Ffloor, Sfloor, 1, 2, 0,
        doc: /* Return the largest integer no greater than ARG.
-This rounds the value towards +inf.
+This rounds the value towards -inf.
 With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR.  */)
      (arg, divisor)
      Lisp_Object arg, divisor;
index f719fb935d83dc01bf4ca296993c471b6b95567d..9571e2f592f91345cb3f4814bd2dae64f449aa16 100644 (file)
@@ -1,5 +1,5 @@
 /* Generic frame functions.
-   Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003, 2004
+   Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003, 2004, 2005
    Free Software Foundation.
 
 This file is part of GNU Emacs.
@@ -766,11 +766,28 @@ to that frame.  */)
 }
 
 DEFUN ("ignore-event", Fignore_event, Signore_event, 0, 0, "",
-       doc: /* Do nothing, but preserve any prefix argument already specified.
+       doc: /* Do nothing.
 This is a suitable binding for `iconify-frame' and `make-frame-visible'.  */)
      ()
 {
-  current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
+  /* Contrary to `handle-switch-frame', `ignore-event' is used from
+     `special-event-map'.  Commands from that map are run in a special
+     way that automatically preserves the prefix-arg.  Restoring
+     the prefix arg here is not just redundant but harmful:
+     - C-u C-x v =
+     - current-prefix-arg is set to non-nil, prefix-arg is set to nil.
+     - after the first prompt, the exit-minibuffer-hook is run which may
+       iconify a frame and thus push a `iconify-frame' event.
+     - after running exit-minibuffer-hook, current-prefix-arg is
+       restored to the non-nil value it had before the prompt.
+     - we enter the second prompt.
+       current-prefix-arg is non-nil, prefix-arg is nil.
+     - before running the first real event, we run the special iconify-frame
+       event, but we pass the `special' arg to execute-command so
+       current-prefix-arg and prefix-arg are left untouched.
+     - here we foolishly copy the non-nil current-prefix-arg to prefix-arg.
+     - the next key event will have a spuriously non-nil current-prefix-arg.
+  current_kboard->Vprefix_arg = Vcurrent_prefix_arg; */
   return Qnil;
 }
 
index 77e7cf48139c9a40989de1a1598a29b6e1388bb4..a30819fe3cbf929a8f13a239cc47ef2219c5c5e9 100644 (file)
@@ -2508,7 +2508,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
 
       c = Faref (Vexecuting_macro, make_number (executing_macro_index));
       if (STRINGP (Vexecuting_macro)
-         && (XINT (c) & 0x80))
+         && (XINT (c) & 0x80) && (XUINT (c) <= 0xff))
        XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80));
 
       executing_macro_index++;
index 44d763562b0c6c2d4414ff2ac84de8016091839e..f5fc62b2200cbcce42e5f97c30a3bf0fb28f4b1e 100644 (file)
--- a/src/mac.c
+++ b/src/mac.c
@@ -26,31 +26,15 @@ Boston, MA 02111-1307, USA.  */
 #include <errno.h>
 #include <time.h>
 
-#ifdef HAVE_CARBON
-#ifdef MAC_OSX
-#undef mktime
-#undef DEBUG
-#undef free
-#undef malloc
-#undef realloc
-#undef init_process
-#include <Carbon/Carbon.h>
-#undef mktime
-#define mktime emacs_mktime
-#undef free
-#define free unexec_free
-#undef malloc
-#define malloc unexec_malloc
-#undef realloc
-#define realloc unexec_realloc
-#undef init_process
-#define init_process emacs_init_process
-#else  /* not MAC_OSX */
-#undef SIGHUP
-#define OLDP2C 1
-#include <Carbon.h>
-#endif /* not MAC_OSX */
-#else  /* not HAVE_CARBON */
+#include "lisp.h"
+#include "process.h"
+#include "sysselect.h"
+#include "systime.h"
+#include "blockinput.h"
+
+#include "macterm.h"
+
+#ifndef HAVE_CARBON
 #include <Files.h>
 #include <MacTypes.h>
 #include <TextUtils.h>
@@ -81,12 +65,6 @@ Boston, MA 02111-1307, USA.  */
 #include <unistd.h>
 #endif
 
-#include "lisp.h"
-#include "process.h"
-#include "sysselect.h"
-#include "systime.h"
-#include "blockinput.h"
-
 Lisp_Object QCLIPBOARD;
 
 /* An instance of the AppleScript component.  */
@@ -272,7 +250,25 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen)
   return 1;
 }
 
+\f
+/***********************************************************************
+        Conversion between Lisp and Core Foundation objects
+ ***********************************************************************/
+
 #if TARGET_API_MAC_CARBON
+static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;
+static Lisp_Object Qarray, Qdictionary;
+extern Lisp_Object Qutf_8;
+#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0)
+
+struct cfdict_context
+{
+  Lisp_Object *result;
+  int with_tag, hash_bound;
+};
+
+/* C string to CFString. */
+
 CFStringRef
 cfstring_create_with_utf8_cstring (c_str)
      const char *c_str;
@@ -286,8 +282,824 @@ cfstring_create_with_utf8_cstring (c_str)
 
   return str;
 }
+
+
+/* From CFData to a lisp string.  Always returns a unibyte string.  */
+
+Lisp_Object
+cfdata_to_lisp (data)
+     CFDataRef data;
+{
+  CFIndex len = CFDataGetLength (data);
+  Lisp_Object result = make_uninit_string (len);
+  
+  CFDataGetBytes (data, CFRangeMake (0, len), SDATA (result));
+
+  return result;
+}
+
+
+/* From CFString to a lisp string.  Never returns a unibyte string
+   (even if it only contains ASCII characters).
+   This may cause GC during code conversion. */
+
+Lisp_Object
+cfstring_to_lisp (string)
+     CFStringRef string;
+{
+  Lisp_Object result = Qnil;
+  const char *s = CFStringGetCStringPtr (string, kCFStringEncodingUTF8);
+
+  if (s)
+    result = make_unibyte_string (s, strlen (s));
+  else
+    {
+      CFDataRef data =
+       CFStringCreateExternalRepresentation (NULL, string,
+                                             kCFStringEncodingUTF8, '?');
+
+      if (data)
+       {
+         result = cfdata_to_lisp (data);
+         CFRelease (data);
+       }
+    }
+
+  if (!NILP (result))
+    {
+      result = DECODE_UTF_8 (result);
+      /* This may be superfluous.  Just to make sure that the result
+        is a multibyte string.  */
+      result = string_to_multibyte (result);
+    }
+
+  return result;
+}
+
+
+/* CFNumber to a lisp integer or a lisp float.  */
+
+Lisp_Object
+cfnumber_to_lisp (number)
+     CFNumberRef number;
+{
+  Lisp_Object result = Qnil;
+#if BITS_PER_EMACS_INT > 32
+  SInt64 int_val;
+  CFNumberType emacs_int_type = kCFNumberSInt64Type;
+#else
+  SInt32 int_val;
+  CFNumberType emacs_int_type = kCFNumberSInt32Type;
 #endif
+  double float_val;
+
+  if (CFNumberGetValue (number, emacs_int_type, &int_val)
+      && !FIXNUM_OVERFLOW_P (int_val))
+    result = make_number (int_val);
+  else
+    if (CFNumberGetValue (number, kCFNumberDoubleType, &float_val))
+      result = make_float (float_val);
+  return result;
+}
+
+
+/* CFDate to a list of three integers as in a return value of
+   `current-time'xo.  */
+
+Lisp_Object
+cfdate_to_lisp (date)
+     CFDateRef date;
+{
+  static CFGregorianDate epoch_gdate = {1970, 1, 1, 0, 0, 0.0};
+  static CFAbsoluteTime epoch = 0.0, sec;
+  int high, low;
+
+  if (epoch == 0.0)
+    epoch = CFGregorianDateGetAbsoluteTime (epoch_gdate, NULL);
+
+  sec = CFDateGetAbsoluteTime (date) - epoch;
+  high = sec / 65536.0;
+  low = sec - high * 65536.0;
+
+  return list3 (make_number (high), make_number (low), make_number (0));
+}
+
+
+/* CFBoolean to a lisp symbol, `t' or `nil'.  */
+
+Lisp_Object
+cfboolean_to_lisp (boolean)
+     CFBooleanRef boolean;
+{
+  return CFBooleanGetValue (boolean) ? Qt : Qnil;
+}
+
+
+/* Any Core Foundation object to a (lengthy) lisp string.  */
+
+Lisp_Object
+cfobject_desc_to_lisp (object)
+     CFTypeRef object;
+{
+  Lisp_Object result = Qnil;
+  CFStringRef desc = CFCopyDescription (object);
+
+  if (desc)
+    {
+      result = cfstring_to_lisp (desc);
+      CFRelease (desc);
+    }
+
+  return result;
+}
+
+
+/* Callback functions for cfproperty_list_to_lisp.  */
+
+static void
+cfdictionary_add_to_list (key, value, context)
+     const void *key;
+     const void *value;
+     void *context;
+{
+  struct cfdict_context *cxt = (struct cfdict_context *)context;
+
+  *cxt->result =
+    Fcons (Fcons (cfstring_to_lisp (key),
+                 cfproperty_list_to_lisp (value, cxt->with_tag,
+                                          cxt->hash_bound)),
+          *cxt->result);
+}
+
+static void
+cfdictionary_puthash (key, value, context)
+     const void *key;
+     const void *value;
+     void *context;
+{
+  Lisp_Object lisp_key = cfstring_to_lisp (key);
+  struct cfdict_context *cxt = (struct cfdict_context *)context;
+  struct Lisp_Hash_Table *h = XHASH_TABLE (*(cxt->result));
+  unsigned hash_code;
+
+  hash_lookup (h, lisp_key, &hash_code);
+  hash_put (h, lisp_key,
+           cfproperty_list_to_lisp (value, cxt->with_tag, cxt->hash_bound),
+           hash_code);
+}
+
+
+/* Convert CFPropertyList PLIST to a lisp object.  If WITH_TAG is
+   non-zero, a symbol that represents the type of the original Core
+   Foundation object is prepended.  HASH_BOUND specifies which kinds
+   of the lisp objects, alists or hash tables, are used as the targets
+   of the conversion from CFDictionary.  If HASH_BOUND is negative,
+   always generate alists.  If HASH_BOUND >= 0, generate an alist if
+   the number of keys in the dictionary is smaller than HASH_BOUND,
+   and a hash table otherwise.  */
+
+Lisp_Object
+cfproperty_list_to_lisp (plist, with_tag, hash_bound)
+     CFPropertyListRef plist;
+     int with_tag, hash_bound;
+{
+  CFTypeID type_id = CFGetTypeID (plist);
+  Lisp_Object tag = Qnil, result = Qnil;
+  struct gcpro gcpro1, gcpro2;
+
+  GCPRO2 (tag, result);
+
+  if (type_id == CFStringGetTypeID ())
+    {
+      tag = Qstring;
+      result = cfstring_to_lisp (plist);
+    }
+  else if (type_id == CFNumberGetTypeID ())
+    {
+      tag = Qnumber;
+      result = cfnumber_to_lisp (plist);
+    }
+  else if (type_id == CFBooleanGetTypeID ())
+    {
+      tag = Qboolean;
+      result = cfboolean_to_lisp (plist);
+    }
+  else if (type_id == CFDateGetTypeID ())
+    {
+      tag = Qdate;
+      result = cfdate_to_lisp (plist);
+    }
+  else if (type_id == CFDataGetTypeID ())
+    {
+      tag = Qdata;
+      result = cfdata_to_lisp (plist);
+    }
+  else if (type_id == CFArrayGetTypeID ())
+    {
+      CFIndex index, count = CFArrayGetCount (plist);
+
+      tag = Qarray;
+      result = Fmake_vector (make_number (count), Qnil);
+      for (index = 0; index < count; index++)
+       XVECTOR (result)->contents[index] =
+         cfproperty_list_to_lisp (CFArrayGetValueAtIndex (plist, index),
+                                  with_tag, hash_bound);
+    }
+  else if (type_id == CFDictionaryGetTypeID ())
+    {
+      struct cfdict_context context;
+      CFIndex count = CFDictionaryGetCount (plist);
+
+      tag = Qdictionary;
+      context.result  = &result;
+      context.with_tag = with_tag;
+      context.hash_bound = hash_bound;
+      if (hash_bound < 0 || count < hash_bound)
+       {
+         result = Qnil;
+         CFDictionaryApplyFunction (plist, cfdictionary_add_to_list,
+                                    &context);
+       }
+      else
+       {
+         result = make_hash_table (Qequal,
+                                   make_number (count),
+                                   make_float (DEFAULT_REHASH_SIZE),
+                                   make_float (DEFAULT_REHASH_THRESHOLD),
+                                   Qnil, Qnil, Qnil);
+         CFDictionaryApplyFunction (plist, cfdictionary_puthash,
+                                    &context);
+       }
+    }
+  else
+    abort ();
+
+  UNGCPRO;
+
+  if (with_tag)
+    result = Fcons (tag, result);
+
+  return result;
+}
+#endif
+
+\f
+/***********************************************************************
+                Emulation of the X Resource Manager
+ ***********************************************************************/
+
+/* Parser functions for resource lines.  Each function takes an
+   address of a variable whose value points to the head of a string.
+   The value will be advanced so that it points to the next character
+   of the parsed part when the function returns.
+
+   A resource name such as "Emacs*font" is parsed into a non-empty
+   list called `quarks'.  Each element is either a Lisp string that
+   represents a concrete component, a Lisp symbol LOOSE_BINDING
+   (actually Qlambda) that represents any number (>=0) of intervening
+   components, or a Lisp symbol SINGLE_COMPONENT (actually Qquote)
+   that represents as any single component.  */
+
+#define P (*p)
+
+#define LOOSE_BINDING    Qlambda /* '*' ("L"oose) */
+#define SINGLE_COMPONENT Qquote         /* '?' ("Q"uestion) */
+
+static void
+skip_white_space (p)
+     char **p;
+{
+  /* WhiteSpace = {<space> | <horizontal tab>} */
+  while (*P == ' ' || *P == '\t')
+    P++;
+}
+
+static int
+parse_comment (p)
+     char **p;
+{
+  /* Comment = "!" {<any character except null or newline>} */
+  if (*P == '!')
+    {
+      P++;
+      while (*P)
+       if (*P++ == '\n')
+         break;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+/* Don't interpret filename.  Just skip until the newline.  */
+static int
+parse_include_file (p)
+     char **p;
+{
+  /* IncludeFile = "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace */
+  if (*P == '#')
+    {
+      P++;
+      while (*P)
+       if (*P++ == '\n')
+         break;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+static char
+parse_binding (p)
+     char **p;
+{
+  /* Binding = "." | "*"  */
+  if (*P == '.' || *P == '*')
+    {
+      char binding = *P++;
+
+      while (*P == '.' || *P == '*')
+       if (*P++ == '*')
+         binding = '*';
+      return binding;
+    }
+  else
+    return '\0';
+}
+
+static Lisp_Object
+parse_component (p)
+     char **p;
+{
+  /*  Component = "?" | ComponentName
+      ComponentName = NameChar {NameChar}
+      NameChar = "a"-"z" | "A"-"Z" | "0"-"9" | "_" | "-" */
+  if (*P == '?')
+    {
+      P++;
+      return SINGLE_COMPONENT;
+    }
+  else if (isalnum (*P) || *P == '_' || *P == '-')
+    {
+      char *start = P++;
+
+      while (isalnum (*P) || *P == '_' || *P == '-')
+       P++;
+
+      return make_unibyte_string (start, P - start);
+    }
+  else
+    return Qnil;
+}
+
+static Lisp_Object
+parse_resource_name (p)
+     char **p;
+{
+  Lisp_Object result = Qnil, component;
+  char binding;
+
+  /* ResourceName = [Binding] {Component Binding} ComponentName */
+  if (parse_binding (p) == '*')
+    result = Fcons (LOOSE_BINDING, result);
+
+  component = parse_component (p);
+  if (NILP (component))
+    return Qnil;
+
+  result = Fcons (component, result);
+  while (binding = parse_binding (p))
+    {
+      if (binding == '*')
+       result = Fcons (LOOSE_BINDING, result);
+      component = parse_component (p);
+      if (NILP (component))
+       return Qnil;
+      else
+       result = Fcons (component, result);
+    }
+
+  /* The final component should not be '?'.  */
+  if (EQ (component, SINGLE_COMPONENT))
+    return Qnil;
+
+  return Fnreverse (result);
+}
+
+static Lisp_Object
+parse_value (p)
+     char **p;
+{
+  char *q, *buf;
+  Lisp_Object seq = Qnil, result;
+  int buf_len, total_len = 0, len, continue_p;
+
+  q = strchr (P, '\n');
+  buf_len = q ? q - P : strlen (P);
+  buf = xmalloc (buf_len);
 
+  while (1)
+    {
+      q = buf;
+      continue_p = 0;
+      while (*P)
+       {
+         if (*P == '\n')
+           {
+             P++;
+             break;
+           }
+         else if (*P == '\\')
+           {
+             P++;
+             if (*P == '\0')
+               break;
+             else if (*P == '\n')
+               {
+                 P++;
+                 continue_p = 1;
+                 break;
+               }
+             else if (*P == 'n')
+               {
+                 *q++ = '\n';
+                 P++;
+               }
+             else if ('0' <= P[0] && P[0] <= '7'
+                      && '0' <= P[1] && P[1] <= '7'
+                      && '0' <= P[2] && P[2] <= '7')
+               {
+                 *q++ = (P[0] - '0' << 6) + (P[1] - '0' << 3) + (P[2] - '0');
+                 P += 3;
+               }
+             else
+               *q++ = *P++;
+           }
+         else
+           *q++ = *P++;
+       }
+      len = q - buf;
+      seq = Fcons (make_unibyte_string (buf, len), seq);
+      total_len += len;
+
+      if (continue_p)
+       {
+         q = strchr (P, '\n');
+         len = q ? q - P : strlen (P);
+         if (len > buf_len)
+           {
+             xfree (buf);
+             buf_len = len;
+             buf = xmalloc (buf_len);
+           }
+       }
+      else
+       break;
+    }
+  xfree (buf);
+
+  if (SBYTES (XCAR (seq)) == total_len)
+    return make_string (SDATA (XCAR (seq)), total_len);
+  else
+    {
+      buf = xmalloc (total_len);
+      q = buf + total_len;
+      for (; CONSP (seq); seq = XCDR (seq))
+       {
+         len = SBYTES (XCAR (seq));
+         q -= len;
+         memcpy (q, SDATA (XCAR (seq)), len);
+       }
+      result = make_string (buf, total_len);
+      xfree (buf);
+      return result;
+    }
+}
+
+static Lisp_Object
+parse_resource_line (p)
+     char **p;
+{
+  Lisp_Object quarks, value;
+
+  /* ResourceLine = Comment | IncludeFile | ResourceSpec | <empty line> */
+  if (parse_comment (p) || parse_include_file (p))
+    return Qnil;
+
+  /* ResourceSpec = WhiteSpace ResourceName WhiteSpace ":" WhiteSpace Value */
+  skip_white_space (p);
+  quarks = parse_resource_name (p);
+  if (NILP (quarks))
+    goto cleanup;
+  skip_white_space (p);
+  if (*P != ':')
+    goto cleanup;
+  P++;
+  skip_white_space (p);
+  value = parse_value (p);
+  return Fcons (quarks, value);
+
+ cleanup:
+  /* Skip the remaining data as a dummy value.  */
+  parse_value (p);
+  return Qnil;
+}
+
+#undef P
+
+/* Equivalents of X Resource Manager functions.
+
+   An X Resource Database acts as a collection of resource names and
+   associated values.  It is implemented as a trie on quarks.  Namely,
+   each edge is labeled by either a string, LOOSE_BINDING, or
+   SINGLE_COMPONENT.  Each node has a node id, which is a unique
+   nonnegative integer, and the root node id is 0.  A database is
+   implemented as a hash table that maps a pair (SRC-NODE-ID .
+   EDGE-LABEL) to DEST-NODE-ID.  It also holds a maximum node id used
+   in the table as a value for HASHKEY_MAX_NID.  A value associated to
+   a node is recorded as a value for the node id.  */
+
+#define HASHKEY_MAX_NID (make_number (0))
+
+static XrmDatabase
+xrm_create_database ()
+{
+  XrmDatabase database;
+
+  database = make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
+                             make_float (DEFAULT_REHASH_SIZE),
+                             make_float (DEFAULT_REHASH_THRESHOLD),
+                             Qnil, Qnil, Qnil);
+  Fputhash (HASHKEY_MAX_NID, make_number (0), database);
+
+  return database;
+}
+
+static void
+xrm_q_put_resource (database, quarks, value)
+     XrmDatabase database;
+     Lisp_Object quarks, value;
+{
+  struct Lisp_Hash_Table *h = XHASH_TABLE (database);
+  unsigned hash_code;
+  int max_nid, i;
+  Lisp_Object node_id, key;
+
+  max_nid = XINT (Fgethash (HASHKEY_MAX_NID, database, Qnil));
+
+  XSETINT (node_id, 0);
+  for (; CONSP (quarks); quarks = XCDR (quarks))
+    {
+      key = Fcons (node_id, XCAR (quarks));
+      i = hash_lookup (h, key, &hash_code);
+      if (i < 0)
+       {
+         max_nid++;
+         XSETINT (node_id, max_nid); 
+         hash_put (h, key, node_id, hash_code);
+       }
+      else
+       node_id = HASH_VALUE (h, i);
+    }
+  Fputhash (node_id, value, database);
+
+  Fputhash (HASHKEY_MAX_NID, make_number (max_nid), database);
+}
+
+/* Merge multiple resource entries specified by DATA into a resource
+   database DATABASE.  DATA points to the head of a null-terminated
+   string consisting of multiple resource lines.  It's like a
+   combination of XrmGetStringDatabase and XrmMergeDatabases.  */
+
+void
+xrm_merge_string_database (database, data)
+     XrmDatabase database;
+     char *data;
+{
+  Lisp_Object quarks_value;
+
+  while (*data)
+    {
+      quarks_value = parse_resource_line (&data);
+      if (!NILP (quarks_value))
+       xrm_q_put_resource (database,
+                           XCAR (quarks_value), XCDR (quarks_value));
+    }
+}
+
+static Lisp_Object
+xrm_q_get_resource_1 (database, node_id, quark_name, quark_class)
+     XrmDatabase database;
+     Lisp_Object node_id, quark_name, quark_class;
+{
+  struct Lisp_Hash_Table *h = XHASH_TABLE (database);
+  Lisp_Object key, labels[3], value;
+  int i, k;
+
+  if (!CONSP (quark_name))
+    return Fgethash (node_id, database, Qnil);
+
+  /* First, try tight bindings */
+  labels[0] = XCAR (quark_name);
+  labels[1] = XCAR (quark_class);
+  labels[2] = SINGLE_COMPONENT;
+
+  key = Fcons (node_id, Qnil);
+  for (k = 0; k < sizeof (labels) / sizeof (*labels); k++)
+    {
+      XSETCDR (key, labels[k]);
+      i = hash_lookup (h, key, NULL);
+      if (i >= 0)
+       {
+         value = xrm_q_get_resource_1 (database, HASH_VALUE (h, i),
+                                       XCDR (quark_name), XCDR (quark_class));
+         if (!NILP (value))
+           return value;
+       }
+    }
+
+  /* Then, try loose bindings */
+  XSETCDR (key, LOOSE_BINDING);
+  i = hash_lookup (h, key, NULL);
+  if (i >= 0)
+    {
+      value = xrm_q_get_resource_1 (database, HASH_VALUE (h, i),
+                                   quark_name, quark_class);
+      if (!NILP (value))
+       return value;
+      else
+       return xrm_q_get_resource_1 (database, node_id,
+                                    XCDR (quark_name), XCDR (quark_class));
+    }
+  else
+    return Qnil;
+}
+
+static Lisp_Object
+xrm_q_get_resource (database, quark_name, quark_class)
+     XrmDatabase database;
+     Lisp_Object quark_name, quark_class;
+{
+  return xrm_q_get_resource_1 (database, make_number (0),
+                              quark_name, quark_class);
+}
+
+/* Retrieve a resource value for the specified NAME and CLASS from the
+   resource database DATABASE.  It corresponds to XrmGetResource.  */
+
+Lisp_Object
+xrm_get_resource (database, name, class)
+     XrmDatabase database;
+     char *name, *class;
+{
+  Lisp_Object quark_name, quark_class, tmp;
+  int nn, nc;
+
+  quark_name = parse_resource_name (&name);
+  if (*name != '\0')
+    return Qnil;
+  for (tmp = quark_name, nn = 0; CONSP (tmp); tmp = XCDR (tmp), nn++)
+    if (!STRINGP (XCAR (tmp)))
+      return Qnil;
+
+  quark_class = parse_resource_name (&class);
+  if (*class != '\0')
+    return Qnil;
+  for (tmp = quark_class, nc = 0; CONSP (tmp); tmp = XCDR (tmp), nc++)
+    if (!STRINGP (XCAR (tmp)))
+      return Qnil;
+
+  if (nn != nc)
+    return Qnil;
+  else
+    return xrm_q_get_resource (database, quark_name, quark_class);
+}
+
+#if TARGET_API_MAC_CARBON
+static Lisp_Object
+xrm_cfproperty_list_to_value (plist)
+     CFPropertyListRef plist;
+{
+  CFTypeID type_id = CFGetTypeID (plist);
+
+  if (type_id == CFStringGetTypeID ())
+      return cfstring_to_lisp (plist);
+  else if (type_id == CFNumberGetTypeID ())
+    {
+      CFStringRef string;
+      Lisp_Object result = Qnil;
+
+      string = CFStringCreateWithFormat (NULL, NULL, CFSTR ("%@"), plist);
+      if (string)
+       {
+         result = cfstring_to_lisp (string);
+         CFRelease (string);
+       }
+      return result;
+    }
+  else if (type_id == CFBooleanGetTypeID ())
+    return build_string (CFBooleanGetValue (plist) ? "true" : "false");
+  else if (type_id == CFDataGetTypeID ())
+    return cfdata_to_lisp (plist);
+  else
+    return Qnil;
+}
+#endif
+
+/* Create a new resource database from the preferences for the
+   application APPLICATION.  APPLICATION is either a string that
+   specifies an application ID, or NULL that represents the current
+   application.  */
+
+XrmDatabase
+xrm_get_preference_database (application)
+     char *application;
+{
+#if TARGET_API_MAC_CARBON
+  CFStringRef app_id, *keys, user_doms[2], host_doms[2];
+  CFMutableSetRef key_set = NULL;
+  CFArrayRef key_array;
+  CFIndex index, count;
+  char *res_name;
+  XrmDatabase database;
+  Lisp_Object quarks = Qnil, value = Qnil;
+  CFPropertyListRef plist;
+  int iu, ih;
+  struct gcpro gcpro1, gcpro2, gcpro3;
+
+  user_doms[0] = kCFPreferencesCurrentUser;
+  user_doms[1] = kCFPreferencesAnyUser;
+  host_doms[0] = kCFPreferencesCurrentHost;
+  host_doms[1] = kCFPreferencesAnyHost;
+
+  database = xrm_create_database ();
+
+  GCPRO3 (database, quarks, value);
+
+  BLOCK_INPUT;
+
+  app_id = kCFPreferencesCurrentApplication;
+  if (application)
+    {
+      app_id = cfstring_create_with_utf8_cstring (application);
+      if (app_id == NULL)
+       goto out;
+    }
+
+  key_set = CFSetCreateMutable (NULL, 0, &kCFCopyStringSetCallBacks);
+  if (key_set == NULL)
+    goto out;
+  for (iu = 0; iu < sizeof (user_doms) / sizeof (*user_doms) ; iu++)
+    for (ih = 0; ih < sizeof (host_doms) / sizeof (*host_doms); ih++)
+      {
+       key_array = CFPreferencesCopyKeyList (app_id, user_doms[iu],
+                                             host_doms[ih]);
+       if (key_array)
+         {
+           count = CFArrayGetCount (key_array);
+           for (index = 0; index < count; index++)
+             CFSetAddValue (key_set,
+                            CFArrayGetValueAtIndex (key_array, index));
+           CFRelease (key_array);
+         }
+      }
+
+  count = CFSetGetCount (key_set);
+  keys = xmalloc (sizeof (CFStringRef) * count);
+  if (keys == NULL)
+    goto out;
+  CFSetGetValues (key_set, (const void **)keys);
+  for (index = 0; index < count; index++)
+    {
+      res_name = SDATA (cfstring_to_lisp (keys[index]));
+      quarks = parse_resource_name (&res_name);
+      if (!(NILP (quarks) || *res_name))
+       {
+         plist = CFPreferencesCopyAppValue (keys[index], app_id);
+         value = xrm_cfproperty_list_to_value (plist);
+         CFRelease (plist);
+         if (!NILP (value))
+           xrm_q_put_resource (database, quarks, value);
+       }
+    }
+
+  xfree (keys);
+ out:
+  if (key_set)
+    CFRelease (key_set);
+  CFRelease (app_id);
+
+  UNBLOCK_INPUT;
+
+  UNGCPRO;
+
+  return database;
+#else
+  return xrm_create_database ();
+#endif
+}
+
+\f
 #ifndef MAC_OSX
 
 /* The following functions with "sys_" prefix are stubs to Unix
@@ -2825,6 +3637,124 @@ and t is the same as `SECONDARY'.  */)
   return Qnil;
 }
 
+#if TARGET_API_MAC_CARBON
+static Lisp_Object Qxml;
+
+DEFUN ("mac-get-preference", Fmac_get_preference, Smac_get_preference, 1, 4, 0,
+       doc: /* Return the application preference value for KEY.
+KEY is either a string specifying a preference key, or a list of key
+strings.  If it is a list, the (i+1)-th element is used as a key for
+the CFDictionary value obtained by the i-th element.  If lookup is
+failed at some stage, nil is returned.
+
+Optional arg APPLICATION is an application ID string.  If omitted or
+nil, that stands for the current application.
+
+Optional arg FORMAT specifies the data format of the return value.  If
+omitted or nil, each Core Foundation object is converted into a
+corresponding Lisp object as follows:
+
+  Core Foundation    Lisp                           Tag
+  ------------------------------------------------------------
+  CFString           Multibyte string               string
+  CFNumber           Integer or float               number
+  CFBoolean          Symbol (t or nil)              boolean
+  CFDate             List of three integers         date
+                       (cf. `current-time')
+  CFData             Unibyte string                 data
+  CFArray            Array                          array
+  CFDictionary       Alist or hash table            dictionary
+                       (depending on HASH-BOUND)
+
+If it is t, a symbol that represents the type of the original Core
+Foundation object is prepended.  If it is `xml', the value is returned
+as an XML representation.
+
+Optional arg HASH-BOUND specifies which kinds of the list objects,
+alists or hash tables, are used as the targets of the conversion from
+CFDictionary.  If HASH-BOUND is a negative integer or nil, always
+generate alists.  If HASH-BOUND >= 0, generate an alist if the number
+of keys in the dictionary is smaller than HASH-BOUND, and a hash table
+otherwise.  */)
+  (key, application, format, hash_bound)
+     Lisp_Object key, application, format, hash_bound;
+{
+  CFStringRef app_id, key_str;
+  CFPropertyListRef app_plist = NULL, plist;
+  Lisp_Object result = Qnil, tmp;
+
+  if (STRINGP (key))
+    key = Fcons (key, Qnil);
+  else
+    {
+      CHECK_CONS (key);
+      for (tmp = key; CONSP (tmp); tmp = XCDR (tmp))
+       CHECK_STRING_CAR (tmp);
+      if (!NILP (tmp))
+       wrong_type_argument (Qlistp, key);
+    }
+  if (!NILP (application))
+    CHECK_STRING (application);
+  CHECK_SYMBOL (format);
+  if (!NILP (hash_bound))
+    CHECK_NUMBER (hash_bound);
+
+  BLOCK_INPUT;
+
+  app_id = kCFPreferencesCurrentApplication;
+  if (!NILP (application))
+    {
+      app_id = cfstring_create_with_utf8_cstring (SDATA (application));
+      if (app_id == NULL)
+       goto out;
+    }
+  key_str = cfstring_create_with_utf8_cstring (SDATA (XCAR (key)));
+  if (key_str == NULL)
+    goto out;
+  app_plist = CFPreferencesCopyAppValue (key_str, app_id);
+  CFRelease (key_str);
+  if (app_plist == NULL)
+    goto out;
+
+  plist = app_plist;
+  for (key = XCDR (key); CONSP (key); key = XCDR (key))
+    {
+      if (CFGetTypeID (plist) != CFDictionaryGetTypeID ())
+       break;
+      key_str = cfstring_create_with_utf8_cstring (SDATA (XCAR (key)));
+      if (key_str == NULL)
+       goto out;
+      plist = CFDictionaryGetValue (plist, key_str);
+      CFRelease (key_str);
+      if (plist == NULL)
+       goto out;
+    }
+
+  if (NILP (key))
+    if (EQ (format, Qxml))
+      {
+       CFDataRef data = CFPropertyListCreateXMLData (NULL, plist);
+       if (data == NULL)
+         goto out;
+       result = cfdata_to_lisp (data);
+       CFRelease (data);
+      }
+    else
+      result =
+       cfproperty_list_to_lisp (plist, EQ (format, Qt),
+                                NILP (hash_bound) ? -1 : XINT (hash_bound));
+
+ out:
+  if (app_plist)
+    CFRelease (app_plist);
+  CFRelease (app_id);
+
+  UNBLOCK_INPUT;
+
+  return result;
+}
+#endif /* TARGET_API_MAC_CARBON */
+
 
 DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0,
        doc: /* Clear the font name table.  */)
@@ -3243,9 +4173,38 @@ syms_of_mac ()
   QCLIPBOARD = intern ("CLIPBOARD");
   staticpro (&QCLIPBOARD);
 
+#if TARGET_API_MAC_CARBON
+  Qstring = intern ("string");
+  staticpro (&Qstring);
+
+  Qnumber = intern ("number");
+  staticpro (&Qnumber);
+
+  Qboolean = intern ("boolean");
+  staticpro (&Qboolean);
+
+  Qdate = intern ("date");
+  staticpro (&Qdate);
+
+  Qdata = intern ("data");
+  staticpro (&Qdata);
+
+  Qarray = intern ("array");
+  staticpro (&Qarray);
+
+  Qdictionary = intern ("dictionary");
+  staticpro (&Qdictionary);
+
+  Qxml = intern ("xml");
+  staticpro (&Qxml);
+#endif
+
   defsubr (&Smac_paste_function);
   defsubr (&Smac_cut_function);
   defsubr (&Sx_selection_exists_p);
+#if TARGET_API_MAC_CARBON
+  defsubr (&Smac_get_preference);
+#endif
   defsubr (&Smac_clear_font_name_table);
 
   defsubr (&Sdo_applescript);
index 1269803153a1613dee1f46b84cf3d893b900da1a..fa37a1b298be7e37d8161f51666903617539e317 100644 (file)
@@ -149,13 +149,6 @@ Lisp_Object Qnone;
 Lisp_Object Qsuppress_icon;
 Lisp_Object Qundefined_color;
 Lisp_Object Qcancel_timer;
-Lisp_Object Qhyper;
-Lisp_Object Qsuper;
-Lisp_Object Qmeta;
-Lisp_Object Qalt;
-Lisp_Object Qctrl;
-Lisp_Object Qcontrol;
-Lisp_Object Qshift;
 
 extern Lisp_Object Vwindow_system_version;
 
@@ -1453,148 +1446,99 @@ x_set_mouse_color (f, arg, oldval)
      struct frame *f;
      Lisp_Object arg, oldval;
 {
+  struct x_output *x = f->output_data.x;
+  Display *dpy = FRAME_MAC_DISPLAY (f);
   Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
-  int count;
-  int mask_color;
-
-  if (!EQ (Qnil, arg))
-    f->output_data.mac->mouse_pixel
-      = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
-  mask_color = FRAME_BACKGROUND_PIXEL (f);
+  Cursor hourglass_cursor, horizontal_drag_cursor;
+  unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
+  unsigned long mask_color = x->background_pixel;
 
   /* Don't let pointers be invisible.  */
-  if (mask_color == f->output_data.mac->mouse_pixel
-       && mask_color == FRAME_BACKGROUND_PIXEL (f))
-    f->output_data.mac->mouse_pixel = FRAME_FOREGROUND_PIXEL (f);
+  if (mask_color == pixel)
+    pixel = x->foreground_pixel;
 
-#if 0 /* MAC_TODO : cursor changes */
-  BLOCK_INPUT;
-
-  /* It's not okay to crash if the user selects a screwy cursor.  */
-  count = x_catch_errors (FRAME_W32_DISPLAY (f));
+  f->output_data.mac->mouse_pixel = pixel;
 
-  if (!EQ (Qnil, Vx_pointer_shape))
+  if (!NILP (Vx_pointer_shape))
     {
       CHECK_NUMBER (Vx_pointer_shape);
-      cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XINT (Vx_pointer_shape));
+      cursor = XINT (Vx_pointer_shape);
     }
   else
-    cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
-  x_check_errors (FRAME_W32_DISPLAY (f), "bad text pointer cursor: %s");
+    cursor = kThemeIBeamCursor;
 
-  if (!EQ (Qnil, Vx_nontext_pointer_shape))
+  if (!NILP (Vx_nontext_pointer_shape))
     {
       CHECK_NUMBER (Vx_nontext_pointer_shape);
-      nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
-                                         XINT (Vx_nontext_pointer_shape));
+      nontext_cursor = XINT (Vx_nontext_pointer_shape);
     }
   else
-    nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr);
-  x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
+    nontext_cursor = kThemeArrowCursor;
 
-  if (!EQ (Qnil, Vx_hourglass_pointer_shape))
+  if (!NILP (Vx_hourglass_pointer_shape))
     {
       CHECK_NUMBER (Vx_hourglass_pointer_shape);
-      hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
-                                           XINT (Vx_hourglass_pointer_shape));
+      hourglass_cursor = XINT (Vx_hourglass_pointer_shape);
     }
   else
-    hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch);
-  x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s");
+    hourglass_cursor = kThemeWatchCursor;
 
-  x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
-  if (!EQ (Qnil, Vx_mode_pointer_shape))
+  if (!NILP (Vx_mode_pointer_shape))
     {
       CHECK_NUMBER (Vx_mode_pointer_shape);
-      mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
-                                      XINT (Vx_mode_pointer_shape));
+      mode_cursor = XINT (Vx_mode_pointer_shape);
     }
   else
-    mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
-  x_check_errors (FRAME_W32_DISPLAY (f), "bad modeline pointer cursor: %s");
+    mode_cursor = kThemeArrowCursor;
 
-  if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
+  if (!NILP (Vx_sensitive_text_pointer_shape))
     {
       CHECK_NUMBER (Vx_sensitive_text_pointer_shape);
-      hand_cursor
-       = XCreateFontCursor (FRAME_W32_DISPLAY (f),
-                            XINT (Vx_sensitive_text_pointer_shape));
+      hand_cursor = XINT (Vx_sensitive_text_pointer_shape);
     }
   else
-    hand_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_crosshair);
+    hand_cursor = kThemePointingHandCursor;
 
   if (!NILP (Vx_window_horizontal_drag_shape))
     {
       CHECK_NUMBER (Vx_window_horizontal_drag_shape);
-      horizontal_drag_cursor
-       = XCreateFontCursor (FRAME_W32_DISPLAY (f),
-                            XINT (Vx_window_horizontal_drag_shape));
+      horizontal_drag_cursor = XINT (Vx_window_horizontal_drag_shape);
     }
   else
-    horizontal_drag_cursor
-      = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_sb_h_double_arrow);
-
-  /* Check and report errors with the above calls.  */
-  x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
-  x_uncatch_errors (FRAME_W32_DISPLAY (f), count);
+    horizontal_drag_cursor = kThemeResizeLeftRightCursor;
 
+#if 0 /* MAC_TODO: cursor color changes */
   {
     XColor fore_color, back_color;
 
-    fore_color.pixel = f->output_data.w32->mouse_pixel;
+    fore_color.pixel = f->output_data.mac->mouse_pixel;
+    x_query_color (f, &fore_color);
     back_color.pixel = mask_color;
-    XQueryColor (FRAME_W32_DISPLAY (f),
-                DefaultColormap (FRAME_W32_DISPLAY (f),
-                                 DefaultScreen (FRAME_W32_DISPLAY (f))),
-                &fore_color);
-    XQueryColor (FRAME_W32_DISPLAY (f),
-                DefaultColormap (FRAME_W32_DISPLAY (f),
-                                 DefaultScreen (FRAME_W32_DISPLAY (f))),
-                &back_color);
-    XRecolorCursor (FRAME_W32_DISPLAY (f), cursor,
-                   &fore_color, &back_color);
-    XRecolorCursor (FRAME_W32_DISPLAY (f), nontext_cursor,
-                   &fore_color, &back_color);
-    XRecolorCursor (FRAME_W32_DISPLAY (f), mode_cursor,
-                   &fore_color, &back_color);
-    XRecolorCursor (FRAME_W32_DISPLAY (f), hand_cursor,
-                    &fore_color, &back_color);
-    XRecolorCursor (FRAME_W32_DISPLAY (f), hourglass_cursor,
-                    &fore_color, &back_color);
+    x_query_color (f, &back_color);
+
+    XRecolorCursor (dpy, cursor, &fore_color, &back_color);
+    XRecolorCursor (dpy, nontext_cursor, &fore_color, &back_color);
+    XRecolorCursor (dpy, mode_cursor, &fore_color, &back_color);
+    XRecolorCursor (dpy, hand_cursor, &fore_color, &back_color);
+    XRecolorCursor (dpy, hourglass_cursor, &fore_color, &back_color);
+    XRecolorCursor (dpy, horizontal_drag_cursor, &fore_color, &back_color);
   }
+#endif
 
-  if (FRAME_W32_WINDOW (f) != 0)
-    XDefineCursor (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), cursor);
-
-  if (cursor != f->output_data.w32->text_cursor && f->output_data.w32->text_cursor != 0)
-    XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->text_cursor);
-  f->output_data.w32->text_cursor = cursor;
-
-  if (nontext_cursor != f->output_data.w32->nontext_cursor
-      && f->output_data.w32->nontext_cursor != 0)
-    XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->nontext_cursor);
-  f->output_data.w32->nontext_cursor = nontext_cursor;
-
-  if (hourglass_cursor != f->output_data.w32->hourglass_cursor
-      && f->output_data.w32->hourglass_cursor != 0)
-    XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->hourglass_cursor);
-  f->output_data.w32->hourglass_cursor = hourglass_cursor;
+  BLOCK_INPUT;
 
-  if (mode_cursor != f->output_data.w32->modeline_cursor
-      && f->output_data.w32->modeline_cursor != 0)
-    XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->modeline_cursor);
-  f->output_data.w32->modeline_cursor = mode_cursor;
+  rif->define_frame_cursor (f, cursor);
 
-  if (hand_cursor != f->output_data.w32->hand_cursor
-      && f->output_data.w32->hand_cursor != 0)
-    XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->hand_cursor);
-  f->output_data.w32->hand_cursor = hand_cursor;
+  f->output_data.mac->text_cursor = cursor;
+  f->output_data.mac->nontext_cursor = nontext_cursor;
+  f->output_data.mac->hourglass_cursor = hourglass_cursor;
+  f->output_data.mac->modeline_cursor = mode_cursor;
+  f->output_data.mac->hand_cursor = hand_cursor;
+  f->output_data.mac->horizontal_drag_cursor = horizontal_drag_cursor;
 
-  XFlush (FRAME_W32_DISPLAY (f));
   UNBLOCK_INPUT;
 
   update_face_from_frame_parameter (f, Qmouse_color, arg);
-#endif /* MAC_TODO */
 }
 
 void
@@ -2086,49 +2030,24 @@ x_set_scroll_bar_default_width (f)
 \f
 /* Subroutines of creating a frame.  */
 
-static char *
-mac_get_rdb_resource (rdb, resource)
-     char *rdb;
-     char *resource;
-{
-  char *value = rdb;
-  int len = strlen (resource);
-
-  while (*value)
-    {
-      if ((strncmp (value, resource, len) == 0) && (value[len] == ':'))
-        return xstrdup (&value[len + 1]);
-
-      value = strchr (value, '\0') + 1;
-    }
-
-  return NULL;
-}
-
 /* Retrieve the string resource specified by NAME with CLASS from
-   database RDB. */
+   database RDB.
+
+   The return value points to the contents of a Lisp string.  So it
+   will not be valid after the next GC where string compaction will
+   occur.  */
 
 char *
 x_get_string_resource (rdb, name, class)
      XrmDatabase rdb;
      char *name, *class;
 {
-  if (rdb)
-    {
-      char *resource;
+  Lisp_Object value = xrm_get_resource (rdb, name, class);
 
-      if (resource = mac_get_rdb_resource (rdb, name))
-        return resource;
-      if (resource = mac_get_rdb_resource (rdb, class))
-        return resource;
-    }
-
-  /* MAC_TODO: implement resource strings.  (Maybe Property Lists?)  */
-#if 0
-  return mac_get_string_resource (name, class);
-#else
-  return (char *)0;
-#endif
+  if (STRINGP (value))
+    return SDATA (value);
+  else
+    return NULL;
 }
 
 /* Return the value of parameter PARAM.
@@ -2327,6 +2246,18 @@ mac_window (f)
   /* so that update events can find this mac_output struct */
   f->output_data.mac->mFP = f;  /* point back to emacs frame */
 
+#ifndef MAC_OSX
+  if (FRAME_MAC_WINDOW (f))
+    {
+      ControlRef root_control;
+
+      if (CreateRootControl (FRAME_MAC_WINDOW (f), &root_control) != noErr)
+       {
+         DisposeWindow (FRAME_MAC_WINDOW (f));
+         FRAME_MAC_WINDOW (f) = NULL;
+       }
+    }
+#endif
   if (FRAME_MAC_WINDOW (f))
     XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f),
                          FRAME_BACKGROUND_PIXEL (f));
@@ -2775,22 +2706,6 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
   f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window;
 
-#if TARGET_API_MAC_CARBON
-  f->output_data.mac->text_cursor = kThemeIBeamCursor;
-  f->output_data.mac->nontext_cursor = kThemeArrowCursor;
-  f->output_data.mac->modeline_cursor = kThemeArrowCursor;
-  f->output_data.mac->hand_cursor = kThemePointingHandCursor;
-  f->output_data.mac->hourglass_cursor = kThemeWatchCursor;
-  f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor;
-#else
-  f->output_data.mac->text_cursor = GetCursor (iBeamCursor);
-  f->output_data.mac->nontext_cursor = &arrow_cursor;
-  f->output_data.mac->modeline_cursor = &arrow_cursor;
-  f->output_data.mac->hand_cursor = &arrow_cursor;
-  f->output_data.mac->hourglass_cursor = GetCursor (watchCursor);
-  f->output_data.mac->horizontal_drag_cursor = &arrow_cursor;
-#endif
-
   /* Compute the size of the window.  */
   window_prompting = x_figure_window_size (f, parms, 1);
 
@@ -3475,7 +3390,7 @@ value.  */)
 
 \f
 /***********************************************************************
-                               Hourglass cursor
+                               Busy cursor
  ***********************************************************************/
 
 /* If non-null, an asynchronous timer that, when it expires, displays
@@ -3501,13 +3416,21 @@ static Lisp_Object Vhourglass_delay;
 static void show_hourglass P_ ((struct atimer *));
 static void hide_hourglass P_ ((void));
 
+/* Return non-zero if houglass timer has been started or hourglass is shown.  */
+
+int
+hourglass_started ()
+{
+  return hourglass_shown_p || hourglass_atimer != NULL;
+}
+
 
 /* Cancel a currently active hourglass timer, and start a new one.  */
 
 void
 start_hourglass ()
 {
-#if 0 /* MAC_TODO: cursor shape changes.  */
+#ifdef MAC_OSX
   EMACS_TIME delay;
   int secs, usecs = 0;
 
@@ -3530,16 +3453,17 @@ start_hourglass ()
   EMACS_SET_SECS_USECS (delay, secs, usecs);
   hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
                                     show_hourglass, NULL);
-#endif /* MAC_TODO */
+#endif /* MAC_OSX */
 }
 
 
-/* Cancel the hourglass cursor timer if active, hide an hourglass
-   cursor if shown.  */
+/* Cancel the hourglass cursor timer if active, hide a busy cursor if
+   shown.  */
 
 void
 cancel_hourglass ()
 {
+#ifdef MAC_OSX
   if (hourglass_atimer)
     {
       cancel_atimer (hourglass_atimer);
@@ -3548,22 +3472,22 @@ cancel_hourglass ()
 
   if (hourglass_shown_p)
     hide_hourglass ();
+#endif /* MAC_OSX */
 }
 
 
 /* Timer function of hourglass_atimer.  TIMER is equal to
    hourglass_atimer.
 
-   Display an hourglass cursor on all frames by mapping the frames'
-   hourglass_window.  Set the hourglass_p flag in the frames'
-   output_data.x structure to indicate that an hourglass cursor is
-   shown on the frames.  */
+   On Mac, busy status is shown by the progress indicator (chasing
+   arrows) at the upper-right corner of each frame instead of the
+   hourglass pointer.  */
 
 static void
 show_hourglass (timer)
      struct atimer *timer;
 {
-#if 0  /* MAC_TODO: cursor shape changes.  */
+#if TARGET_API_MAC_CARBON
   /* The timer implementation will cancel this timer automatically
      after this function has run.  Set hourglass_atimer to null
      so that we know the timer doesn't have to be canceled.  */
@@ -3576,46 +3500,44 @@ show_hourglass (timer)
       BLOCK_INPUT;
 
       FOR_EACH_FRAME (rest, frame)
-       if (FRAME_W32_P (XFRAME (frame)))
-         {
-           struct frame *f = XFRAME (frame);
-
-           f->output_data.w32->hourglass_p = 1;
+       {
+         struct frame *f = XFRAME (frame);
 
-           if (!f->output_data.w32->hourglass_window)
-             {
-               unsigned long mask = CWCursor;
-               XSetWindowAttributes attrs;
-
-               attrs.cursor = f->output_data.w32->hourglass_cursor;
-
-               f->output_data.w32->hourglass_window
-                 = XCreateWindow (FRAME_X_DISPLAY (f),
-                                  FRAME_OUTER_WINDOW (f),
-                                  0, 0, 32000, 32000, 0, 0,
-                                  InputOnly,
-                                  CopyFromParent,
-                                  mask, &attrs);
-             }
+         if (FRAME_LIVE_P (f) && FRAME_MAC_P (f)
+             && FRAME_MAC_WINDOW (f) != tip_window)
+           {
+             if (!f->output_data.mac->hourglass_control)
+               {
+                 Window w = FRAME_MAC_WINDOW (f);
+                 Rect r;
+                 ControlRef c;
+
+                 GetWindowPortBounds (w, &r);
+                 r.left = r.right - HOURGLASS_WIDTH;
+                 r.bottom = r.top + HOURGLASS_HEIGHT;
+                 if (CreateChasingArrowsControl (w, &r, &c) == noErr)
+                   f->output_data.mac->hourglass_control = c;
+               }
 
-           XMapRaised (FRAME_X_DISPLAY (f),
-                       f->output_data.w32->hourglass_window);
-           XFlush (FRAME_X_DISPLAY (f));
-         }
+             if (f->output_data.mac->hourglass_control)
+               ShowControl (f->output_data.mac->hourglass_control);
+           }
+       }
 
       hourglass_shown_p = 1;
       UNBLOCK_INPUT;
     }
-#endif /* MAC_TODO */
+#endif /* TARGET_API_MAC_CARBON */
 }
 
 
-/* Hide the hourglass cursor on all frames, if it is currently shown.  */
+/* Hide the progress indicators on all frames, if it is currently
+   shown.  */
 
 static void
 hide_hourglass ()
 {
-#if 0 /* MAC_TODO: cursor shape changes.  */
+#if TARGET_API_MAC_CARBON
   if (hourglass_shown_p)
     {
       Lisp_Object rest, frame;
@@ -3625,23 +3547,16 @@ hide_hourglass ()
        {
          struct frame *f = XFRAME (frame);
 
-         if (FRAME_W32_P (f)
+         if (FRAME_MAC_P (f)
              /* Watch out for newly created frames.  */
-             && f->output_data.x->hourglass_window)
-           {
-             XUnmapWindow (FRAME_X_DISPLAY (f),
-                           f->output_data.x->hourglass_window);
-             /* Sync here because XTread_socket looks at the
-                hourglass_p flag that is reset to zero below.  */
-             XSync (FRAME_X_DISPLAY (f), False);
-             f->output_data.x->hourglass_p = 0;
-           }
+             && f->output_data.mac->hourglass_control)
+           HideControl (f->output_data.mac->hourglass_control);
        }
 
       hourglass_shown_p = 0;
       UNBLOCK_INPUT;
     }
-#endif /* MAC_TODO */
+#endif /* TARGET_API_MAC_CARBON */
 }
 
 
@@ -4487,7 +4402,7 @@ mac_nav_event_callback (selector, parms, data)
                            Initialization
  ***********************************************************************/
 
-/* Keep this list in the same order as frame_parms in frame.c. 
+/* Keep this list in the same order as frame_parms in frame.c.
    Use 0 for unsupported frame parameters.  */
 
 frame_parm_handler mac_frame_parm_handlers[] =
@@ -4545,29 +4460,12 @@ syms_of_macfns ()
   staticpro (&Qundefined_color);
   Qcancel_timer = intern ("cancel-timer");
   staticpro (&Qcancel_timer);
-
-  Qhyper = intern ("hyper");
-  staticpro (&Qhyper);
-  Qsuper = intern ("super");
-  staticpro (&Qsuper);
-  Qmeta = intern ("meta");
-  staticpro (&Qmeta);
-  Qalt = intern ("alt");
-  staticpro (&Qalt);
-  Qctrl = intern ("ctrl");
-  staticpro (&Qctrl);
-  Qcontrol = intern ("control");
-  staticpro (&Qcontrol);
-  Qshift = intern ("shift");
-  staticpro (&Qshift);
   /* This is the end of symbol initialization.  */
 
   /* Text property `display' should be nonsticky by default.  */
   Vtext_property_default_nonsticky
     = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky);
 
-  Qface_set_after_frame_default = intern ("face-set-after-frame-default");
-  staticpro (&Qface_set_after_frame_default);
 
   Fput (Qundefined_color, Qerror_conditions,
        Fcons (Qundefined_color, Fcons (Qerror, Qnil)));
@@ -4575,39 +4473,58 @@ syms_of_macfns ()
        build_string ("Undefined color"));
 
   DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
-              doc: /* The shape of the pointer when over text.
+    doc: /* The shape of the pointer when over text.
 Changing the value does not affect existing frames
 unless you set the mouse color.  */);
   Vx_pointer_shape = Qnil;
 
+#if 0 /* This doesn't really do anything.  */
+  DEFVAR_LISP ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape,
+    doc: /* The shape of the pointer when not over text.
+This variable takes effect when you create a new frame
+or when you set the mouse color.  */);
+#endif
   Vx_nontext_pointer_shape = Qnil;
 
-  Vx_mode_pointer_shape = Qnil;
-
   DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape,
-              doc: /* The shape of the pointer when Emacs is hourglass.
+    doc: /* The shape of the pointer when Emacs is busy.
 This variable takes effect when you create a new frame
 or when you set the mouse color.  */);
   Vx_hourglass_pointer_shape = Qnil;
 
   DEFVAR_BOOL ("display-hourglass", &display_hourglass_p,
-              doc: /* Non-zero means Emacs displays an hourglass pointer on window systems.  */);
+    doc: /* Non-zero means Emacs displays an hourglass pointer on window systems.  */);
   display_hourglass_p = 1;
 
   DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay,
-              doc: /* *Seconds to wait before displaying an hourglass pointer.
+    doc: /* *Seconds to wait before displaying an hourglass pointer.
 Value must be an integer or float.  */);
   Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
 
+#if 0 /* This doesn't really do anything.  */
+  DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape,
+    doc: /* The shape of the pointer when over the mode line.
+This variable takes effect when you create a new frame
+or when you set the mouse color.  */);
+#endif
+  Vx_mode_pointer_shape = Qnil;
+
   DEFVAR_LISP ("x-sensitive-text-pointer-shape",
-              &Vx_sensitive_text_pointer_shape,
+             &Vx_sensitive_text_pointer_shape,
               doc: /* The shape of the pointer when over mouse-sensitive text.
 This variable takes effect when you create a new frame
 or when you set the mouse color.  */);
   Vx_sensitive_text_pointer_shape = Qnil;
 
+  DEFVAR_LISP ("x-window-horizontal-drag-cursor",
+             &Vx_window_horizontal_drag_shape,
+  doc: /* Pointer shape to use for indicating a window can be dragged horizontally.
+This variable takes effect when you create a new frame
+or when you set the mouse color.  */);
+  Vx_window_horizontal_drag_shape = Qnil;
+
   DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
-              doc: /* A string indicating the foreground color of the cursor box.  */);
+    doc: /* A string indicating the foreground color of the cursor box.  */);
   Vx_cursor_fore_pixel = Qnil;
 
   DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
@@ -4616,7 +4533,7 @@ Text larger than this is clipped.  */);
   Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
 
   DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
-              doc: /* Non-nil if no window manager is in use.
+    doc: /* Non-nil if no window manager is in use.
 Emacs doesn't try to figure this out; this is always nil
 unless you set it to something else.  */);
   /* We don't have any way to find this out, so set it to nil
@@ -4625,7 +4542,7 @@ unless you set it to something else.  */);
 
   DEFVAR_LISP ("x-pixel-size-width-font-regexp",
               &Vx_pixel_size_width_font_regexp,
-              doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'.
+    doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'.
 
 Since Emacs gets width of a font matching with this regexp from
 PIXEL_SIZE field of the name, font finding mechanism gets faster for
index 6a961318b760c60ed1f3d659689b736f45b609e3..96fd54a603baa4ac4223c0357076dd051bd81a54 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 
 typedef int Display;  /* fix later */
 
-typedef char * XrmDatabase;  /* fix later */
+typedef Lisp_Object XrmDatabase;
 
 typedef unsigned long Time;
 
@@ -68,22 +68,17 @@ typedef unsigned long Time;
 #else /* not HAVE_CARBON */
 #include <QuickDraw.h>         /* for WindowPtr */
 #include <QDOffscreen.h>       /* for GWorldPtr */
+#include <Appearance.h>                /* for ThemeCursor */
 #include <Windows.h>
+#include <Controls.h>
 #include <Gestalt.h>
 #endif /* not HAVE_CARBON */
 
 typedef WindowPtr Window;
 typedef GWorldPtr Pixmap;
 
-#if TARGET_API_MAC_CARBON
 #define Cursor ThemeCursor
 #define No_Cursor (-1)
-#else
-#define SetPortWindowPort(w) SetPort(w)
-#define Cursor CursHandle
-#define No_Cursor (0)
-extern CursPtr arrow_cursor;
-#endif
 
 #define FACE_DEFAULT (~0)
 
index 43e1999d11dec745e368c86c2c66eb324cc5f736..9434cb9a5a24ff2771c402e625b22b837d416ce0 100644 (file)
@@ -131,9 +131,12 @@ int x_use_underline_position_properties;
 struct x_display_info *x_display_list;
 
 /* This is a list of cons cells, each of the form (NAME
-   . FONT-LIST-CACHE), one for each element of x_display_list and in
-   the same order.  NAME is the name of the frame.  FONT-LIST-CACHE
-   records previous values returned by x-list-fonts.  */
+   FONT-LIST-CACHE . RESOURCE-DATABASE), one for each element of
+   x_display_list and in the same order.  NAME is the name of the
+   frame.  FONT-LIST-CACHE records previous values returned by
+   x-list-fonts.  RESOURCE-DATABASE preserves the X Resource Database
+   equivalent, which is implemented with a Lisp object, for the
+   display. */
 
 Lisp_Object x_display_name_list;
 
@@ -292,9 +295,6 @@ static void x_update_begin P_ ((struct frame *));
 static void x_update_window_begin P_ ((struct window *));
 static void x_after_update_window_line P_ ((struct glyph_row *));
 
-void activate_scroll_bars (FRAME_PTR);
-void deactivate_scroll_bars (FRAME_PTR);
-
 static int is_emacs_window (WindowPtr);
 
 int x_bitmap_icon (struct frame *, Lisp_Object);
@@ -352,8 +352,12 @@ mac_set_backcolor (unsigned long color)
    commands.  Assume that the graphic port has already been set.  */
 
 static void
-mac_set_colors (GC gc)
+mac_set_colors (gc, bg_save)
+     GC gc;
+     RGBColor *bg_save;
 {
+  if (bg_save)
+    GetBackColor (bg_save);
   mac_set_forecolor (gc->foreground);
   mac_set_backcolor (gc->background);
 }
@@ -367,12 +371,16 @@ XDrawLine (display, w, gc, x1, y1, x2, y2)
      GC gc;
      int x1, y1, x2, y2;
 {
+  RGBColor old_bg;
+
   SetPortWindowPort (w);
 
-  mac_set_colors (gc);
+  mac_set_colors (gc, &old_bg);
 
   MoveTo (x1, y1);
   LineTo (x2, y2);
+
+  RGBBackColor (&old_bg);
 }
 
 void
@@ -388,7 +396,7 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2)
   GetGWorld (&old_port, &old_gdh);
   SetGWorld (p, NULL);
 
-  mac_set_colors (gc);
+  mac_set_colors (gc, NULL);
 
   LockPixels (GetGWorldPixMap (p));
   MoveTo (x1, y1);
@@ -411,16 +419,19 @@ XClearArea (display, w, x, y, width, height, exposures)
   struct mac_output *mwp = (mac_output *) GetWRefCon (w);
   Rect r;
   XGCValues xgc;
+  RGBColor old_bg;
 
   xgc.foreground = mwp->x_compatible.foreground_pixel;
   xgc.background = mwp->x_compatible.background_pixel;
 
   SetPortWindowPort (w);
 
-  mac_set_colors (&xgc);
+  mac_set_colors (&xgc, &old_bg);
   SetRect (&r, x, y, x + width, y + height);
 
   EraseRect (&r);
+
+  RGBBackColor (&old_bg);
 }
 
 /* Mac version of XClearWindow.  */
@@ -438,7 +449,7 @@ XClearWindow (display, w)
 
   SetPortWindowPort (w);
 
-  mac_set_colors (&xgc);
+  mac_set_colors (&xgc, NULL);
 
 #if TARGET_API_MAC_CARBON
   {
@@ -466,6 +477,7 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
 {
   BitMap bitmap;
   Rect r;
+  RGBColor old_bg;
 
   bitmap.rowBytes = sizeof(unsigned short);
   bitmap.baseAddr = (char *)bits;
@@ -473,7 +485,7 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
 
   SetPortWindowPort (w);
 
-  mac_set_colors (gc);
+  mac_set_colors (gc, &old_bg);
   SetRect (&r, x, y, x + width, y + height);
 
 #if TARGET_API_MAC_CARBON
@@ -485,6 +497,8 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
   CopyBits (&bitmap, &(w->portBits), &(bitmap.bounds), &r,
            overlay_p ? srcOr : srcCopy, 0);
 #endif /* not TARGET_API_MAC_CARBON */
+
+  RGBBackColor (&old_bg);
 }
 
 
@@ -633,13 +647,16 @@ XFillRectangle (display, w, gc, x, y, width, height)
      unsigned int width, height;
 {
   Rect r;
+  RGBColor old_bg;
 
   SetPortWindowPort (w);
 
-  mac_set_colors (gc);
+  mac_set_colors (gc, &old_bg);
   SetRect (&r, x, y, x + width, y + height);
 
   PaintRect (&r); /* using foreground color of gc */
+
+  RGBBackColor (&old_bg);
 }
 
 
@@ -658,7 +675,7 @@ mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height)
 
   GetGWorld (&old_port, &old_gdh);
   SetGWorld (p, NULL);
-  mac_set_colors (gc);
+  mac_set_colors (gc, NULL);
   SetRect (&r, x, y, x + width, y + height);
 
   LockPixels (GetGWorldPixMap (p));
@@ -681,13 +698,16 @@ mac_draw_rectangle (display, w, gc, x, y, width, height)
      unsigned int width, height;
 {
   Rect r;
+  RGBColor old_bg;
 
   SetPortWindowPort (w);
 
-  mac_set_colors (gc);
+  mac_set_colors (gc, &old_bg);
   SetRect (&r, x, y, x + width + 1, y + height + 1);
 
   FrameRect (&r); /* using foreground color of gc */
+
+  RGBBackColor (&old_bg);
 }
 
 
@@ -708,7 +728,7 @@ mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height)
 
   GetGWorld (&old_port, &old_gdh);
   SetGWorld (p, NULL);
-  mac_set_colors (gc);
+  mac_set_colors (gc, NULL);
   SetRect (&r, x, y, x + width + 1, y + height + 1);
 
   LockPixels (GetGWorldPixMap (p));
@@ -730,6 +750,8 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
      char *buf;
      int nchars, mode, bytes_per_char;
 {
+  RGBColor old_bg;
+
   SetPortWindowPort (w);
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
   UInt32 textFlags, savedFlags;
@@ -739,7 +761,7 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
   }
 #endif
 
-  mac_set_colors (gc);
+  mac_set_colors (gc, &old_bg);
 
   TextFont (gc->font->mac_fontnum);
   TextSize (gc->font->mac_fontsize);
@@ -748,6 +770,8 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
 
   MoveTo (x, y);
   DrawText (buf, 0, nchars * bytes_per_char);
+
+  RGBBackColor (&old_bg);
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
   if (!NILP(Vmac_use_core_graphics))
     SwapQDTextFlags(savedFlags);
@@ -935,7 +959,7 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y)
 
   SetPort (w);
 #if 0
-  mac_set_colors (gc);
+  mac_set_colors (gc, NULL);
 #endif
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
@@ -957,7 +981,7 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y)
   BackColor (whiteColor);
   CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
 
-  mac_set_colors (gc);
+  mac_set_colors (gc, NULL);
 #endif
 #endif /* not TARGET_API_MAC_CARBON */
 }
@@ -1397,13 +1421,6 @@ x_update_end (f)
   FRAME_MAC_DISPLAY_INFO (f)->mouse_face_defer = 0;
 
   BLOCK_INPUT;
-  /* Reset the background color of Mac OS Window to that of the frame after
-     update so that it is used by Mac Toolbox to clear the update region before
-     an update event is generated.  */
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
-  mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f));
-
 #if TARGET_API_MAC_CARBON
   EnableScreenUpdates ();
 #endif
@@ -4477,50 +4494,6 @@ XTjudge_scroll_bars (f)
 }
 
 
-void
-activate_scroll_bars (frame)
-     FRAME_PTR frame;
-{
-  Lisp_Object bar;
-  ControlHandle ch;
-
-  bar = FRAME_SCROLL_BARS (frame);
-  while (! NILP (bar))
-    {
-      ch = SCROLL_BAR_CONTROL_HANDLE (XSCROLL_BAR (bar));
-#if 1 /* TARGET_API_MAC_CARBON */
-      ActivateControl (ch);
-#else
-      SetControlMaximum (ch,
-                        VERTICAL_SCROLL_BAR_TOP_RANGE (frame,
-                                                       XINT (XSCROLL_BAR (bar)
-                                                             ->height)) - 1);
-#endif
-      bar = XSCROLL_BAR (bar)->next;
-    }
-}
-
-
-void
-deactivate_scroll_bars (frame)
-     FRAME_PTR frame;
-{
-  Lisp_Object bar;
-  ControlHandle ch;
-
-  bar = FRAME_SCROLL_BARS (frame);
-  while (! NILP (bar))
-    {
-      ch = SCROLL_BAR_CONTROL_HANDLE (XSCROLL_BAR (bar));
-#if 1 /* TARGET_API_MAC_CARBON */
-      DeactivateControl (ch);
-#else
-      SetControlMaximum (ch, -1);
-#endif
-      bar = XSCROLL_BAR (bar)->next;
-    }
-}
-
 /* Handle a mouse click on the scroll bar BAR.  If *EMACS_EVENT's kind
    is set to something other than NO_EVENT, it is enqueued.
 
@@ -4851,11 +4824,7 @@ mac_define_frame_cursor (f, cursor)
      struct frame *f;
      Cursor cursor;
 {
-#if TARGET_API_MAC_CARBON
   SetThemeCursor (cursor);
-#else
-  SetCursor (*cursor);
-#endif
 }
 
 
@@ -5291,6 +5260,11 @@ x_set_window_size (f, change_gravity, cols, rows)
   x_wm_set_size_hint (f, (long) 0, 0);
 
   SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
+#if TARGET_API_MAC_CARBON
+  if (f->output_data.mac->hourglass_control)
+    MoveControl (f->output_data.mac->hourglass_control,
+                pixelwidth - HOURGLASS_WIDTH, 0);
+#endif
 
   /* Now, strictly speaking, we can't be sure that this is accurate,
      but the window manager will get around to dealing with the size
@@ -6500,7 +6474,7 @@ x_list_fonts (struct frame *f,
 
   if (dpyinfo)
     {
-      tem = XCDR (dpyinfo->name_list_element);
+      tem = XCAR (XCDR (dpyinfo->name_list_element));
       key = Fcons (pattern, make_number (maxnames));
 
       newlist = Fassoc (key, tem);
@@ -6519,9 +6493,9 @@ x_list_fonts (struct frame *f,
 
   if (dpyinfo)
     {
-      XSETCDR (dpyinfo->name_list_element,
+      XSETCAR (XCDR (dpyinfo->name_list_element),
               Fcons (Fcons (key, newlist),
-                     XCDR (dpyinfo->name_list_element)));
+                     XCAR (XCDR (dpyinfo->name_list_element))));
     }
  label_cached:
 
@@ -7211,11 +7185,6 @@ Lisp_Object drag_and_drop_file_list;
 
 Point saved_menu_event_location;
 
-#if !TARGET_API_MAC_CARBON
-/* Place holder for the default arrow cursor.  */
-CursPtr arrow_cursor;
-#endif
-
 /* Apple Events */
 static void init_required_apple_events (void);
 static pascal OSErr
@@ -7418,8 +7387,6 @@ do_init_managers (void)
   InitCursor ();
 
 #if !TARGET_API_MAC_CARBON
-  arrow_cursor = &qd.arrow;
-
   /* set up some extra stack space for use by emacs */
   SetApplLimit ((Ptr) ((long) GetApplLimit () - EXTRA_STACK_ALLOC));
 
@@ -7480,15 +7447,16 @@ do_window_update (WindowPtr win)
            RgnHandle region = NewRgn ();
 
            GetPortVisibleRegion (GetWindowPort (win), region);
-           UpdateControls (win, region);
            GetRegionBounds (region, &r);
+           expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top);
+           UpdateControls (win, region);
            DisposeRgn (region);
          }
 #else
-         UpdateControls (win, win->visRgn);
          r = (*win->visRgn)->rgnBBox;
-#endif
          expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top);
+         UpdateControls (win, win->visRgn);
+#endif
 
           handling_window_update = 0;
         }
@@ -7981,8 +7949,6 @@ mac_handle_window_event (next_handler, event, data)
      EventRef event;
      void *data;
 {
-  extern Lisp_Object Qcontrol;
-
   WindowPtr wp;
   OSStatus result;
   UInt32 attributes;
@@ -8252,7 +8218,6 @@ mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
          Rect r;
          struct frame *f = mac_window_to_frame (window);
 
-         mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f));
          GetWindowPortBounds (window, &r);
          OffsetRect (&r, -r.left, -r.top);
          RectRgn (hilite_rgn, &r);
@@ -8270,7 +8235,6 @@ mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
        {
          struct frame *f = mac_window_to_frame (window);
 
-         mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f));
          HideDragHilite (theDrag);
          SetThemeCursor (kThemeArrowCursor);
        }
@@ -8477,19 +8441,23 @@ main (void)
 #endif
 
 /* Table for translating Mac keycode to X keysym values.  Contributed
-   by Sudhir Shenoy.  */
+   by Sudhir Shenoy.
+   Mapping for special keys is now identical to that in Apple X11
+   except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>)
+   on the right of the Cmd key on laptops, and fn + `enter' (->
+   <linefeed>). */
 static unsigned char keycode_to_xkeysym_table[] = {
   /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 
   /*0x30*/ 0x09 /*tab*/, 0 /*0x0020 space*/, 0, 0x08 /*backspace*/,
-  /*0x34*/ 0, 0x1b /*escape*/, 0, 0,
+  /*0x34*/ 0x8d /*enter on laptops*/, 0x1b /*escape*/, 0, 0,
   /*0x38*/ 0, 0, 0, 0,
   /*0x3C*/ 0, 0, 0, 0,
 
   /*0x40*/ 0, 0xae /*kp-.*/, 0, 0xaa /*kp-**/,
-  /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x7f /*kp-clear*/,
+  /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x0b /*clear*/,
   /*0x48*/ 0, 0, 0, 0xaf /*kp-/*/,
   /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp--*/, 0,
 
@@ -8501,11 +8469,11 @@ static unsigned char keycode_to_xkeysym_table[] = {
   /*0x60*/ 0xc2 /*f5*/, 0xc3 /*f6*/, 0xc4 /*f7*/, 0xc0 /*f3*/,
   /*0x64*/ 0xc5 /*f8*/, 0xc6 /*f9*/, 0, 0xc8 /*f11*/,
   /*0x68*/ 0, 0xca /*f13*/, 0, 0xcb /*f14*/,
-  /*0x6C*/ 0, 0xc7 /*f10*/, 0, 0xc9 /*f12*/,
+  /*0x6C*/ 0, 0xc7 /*f10*/, 0x0a /*fn+enter on laptops*/, 0xc9 /*f12*/,
 
-  /*0x70*/ 0, 0xcc /*f15*/, 0x9e /*insert (or 0x6a==help)*/, 0x95 /*home*/,
-  /*0x74*/ 0x9a /*pgup*/, 0x9f /*delete*/, 0xc1 /*f4*/, 0x9c /*end*/,
-  /*0x78*/ 0xbf /*f2*/, 0x9b /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/,
+  /*0x70*/ 0, 0xcc /*f15*/, 0x6a /*help*/, 0x50 /*home*/,
+  /*0x74*/ 0x55 /*pgup*/, 0xff /*delete*/, 0xc1 /*f4*/, 0x57 /*end*/,
+  /*0x78*/ 0xbf /*f2*/, 0x56 /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/,
   /*0x7C*/ 0x53 /*right*/, 0x54 /*down*/, 0x52 /*up*/, 0
 };
 
@@ -8758,12 +8726,9 @@ XTread_socket (sd, expected, hold_quit)
                    /* ticks to milliseconds */
 
                    if (dpyinfo->grabbed && tracked_scroll_bar
-#if TARGET_API_MAC_CARBON
-                       || ch != 0
-#else
-                       || control_part_code != 0
-#endif
-                       )
+                       /* control_part_code becomes kControlNoPart if
+                          a progress indicator is clicked.  */
+                       || ch != 0 && control_part_code != kControlNoPart)
                      {
                        struct scroll_bar *bar;
 
@@ -8932,6 +8897,7 @@ XTread_socket (sd, expected, hold_quit)
        case activateEvt:
          {
            WindowPtr window_ptr = (WindowPtr) er.message;
+           ControlRef root_control;
 
 #if USE_CARBON_EVENTS
            if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
@@ -8948,6 +8914,7 @@ XTread_socket (sd, expected, hold_quit)
              break;
 
            f = mac_window_to_frame (window_ptr);
+           GetRootControl (window_ptr, &root_control);
 
            if ((er.modifiers & activeFlag) != 0)
              {
@@ -8955,7 +8922,7 @@ XTread_socket (sd, expected, hold_quit)
                Point mouse_loc = er.where;
 
                x_new_focus_frame (dpyinfo, f);
-               activate_scroll_bars (f);
+               ActivateControl (root_control);
 
                SetPortWindowPort (window_ptr);
                GlobalToLocal (&mouse_loc);
@@ -8972,7 +8939,7 @@ XTread_socket (sd, expected, hold_quit)
                if (f == dpyinfo->x_focus_frame)
                  {
                    x_new_focus_frame (dpyinfo, 0);
-                   deactivate_scroll_bars (f);
+                   DeactivateControl (root_control);
                  }
 
 
@@ -9310,21 +9277,12 @@ make_mac_terminal_frame (struct frame *f)
   f->output_data.mac->mouse_pixel = 0xff00ff;
   f->output_data.mac->cursor_foreground_pixel = 0x0000ff;
 
-#if TARGET_API_MAC_CARBON
   f->output_data.mac->text_cursor = kThemeIBeamCursor;
   f->output_data.mac->nontext_cursor = kThemeArrowCursor;
   f->output_data.mac->modeline_cursor = kThemeArrowCursor;
   f->output_data.mac->hand_cursor = kThemePointingHandCursor;
   f->output_data.mac->hourglass_cursor = kThemeWatchCursor;
   f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor;
-#else
-  f->output_data.mac->text_cursor = GetCursor (iBeamCursor);
-  f->output_data.mac->nontext_cursor = &arrow_cursor;
-  f->output_data.mac->modeline_cursor = &arrow_cursor;
-  f->output_data.mac->hand_cursor = &arrow_cursor;
-  f->output_data.mac->hourglass_cursor = GetCursor (watchCursor);
-  f->output_data.mac->horizontal_drag_cursor = &arrow_cursor;
-#endif
 
   FRAME_FONTSET (f) = -1;
   f->output_data.mac->explicit_parent = 0;
@@ -9442,59 +9400,18 @@ mac_initialize_display_info ()
   dpyinfo->mouse_face_hidden = 0;
 }
 
-/* Create an xrdb-style database of resources to supercede registry settings.
-   The database is just a concatenation of C strings, finished by an additional
-   \0.  The string are submitted to some basic normalization, so
-
-     [ *]option[ *]:[ *]value...
-
-   becomes
-
-     option:value...
-
-   but any whitespace following value is not removed.  */
 
-static char *
+static XrmDatabase
 mac_make_rdb (xrm_option)
      char *xrm_option;
 {
-  char *buffer = xmalloc (strlen (xrm_option) + 2);
-  char *current = buffer;
-  char ch;
-  int in_option = 1;
-  int before_value = 0;
-
-  do {
-    ch = *xrm_option++;
-
-    if (ch == '\n')
-      {
-        *current++ = '\0';
-        in_option = 1;
-        before_value = 0;
-      }
-    else if (ch != ' ')
-      {
-        *current++ = ch;
-        if (in_option && (ch == ':'))
-          {
-            in_option = 0;
-            before_value = 1;
-          }
-        else if (before_value)
-          {
-            before_value = 0;
-          }
-      }
-    else if (!(in_option || before_value))
-      {
-        *current++ = ch;
-      }
-  } while (ch);
+  XrmDatabase database;
 
-  *current = '\0';
+  database = xrm_get_preference_database (NULL);
+  if (xrm_option)
+    xrm_merge_string_database (database, xrm_option);
 
-  return buffer;
+  return database;
 }
 
 struct mac_display_info *
@@ -9520,14 +9437,15 @@ mac_term_init (display_name, xrm_option, resource_name)
 
   dpyinfo = &one_mac_display_info;
 
-  dpyinfo->xrdb = xrm_option ? mac_make_rdb (xrm_option) : NULL;
+  dpyinfo->xrdb = mac_make_rdb (xrm_option);
 
   /* Put this display on the chain.  */
   dpyinfo->next = x_display_list;
   x_display_list = dpyinfo;
 
   /* Put it on x_display_name_list.  */
-  x_display_name_list = Fcons (Fcons (display_name, Qnil),
+  x_display_name_list = Fcons (Fcons (display_name,
+                                     Fcons (Qnil, dpyinfo->xrdb)),
                                x_display_name_list);
   dpyinfo->name_list_element = XCAR (x_display_name_list);
 
index 27cd1f4964662e3c926a8fb5a4bf52840f8a0c87..cc0ab1a4e2bc8761904eca8e49bc799ddb61c20d 100644 (file)
@@ -355,6 +355,12 @@ struct mac_output {
 
 #endif
 
+#if TARGET_API_MAC_CARBON
+  /* The Mac control reference for the hourglass (progress indicator)
+     shown at the upper-right corner of the window.  */
+  ControlRef hourglass_control;
+#endif
+
 #if 0
   DWORD dwStyle;
 #endif
@@ -573,6 +579,10 @@ struct scroll_bar {
    text from glomming up against the scroll bar */
 #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
 
+/* Size of hourglass controls */
+#define HOURGLASS_WIDTH 16
+#define HOURGLASS_HEIGHT 16
+
 struct frame;
 struct face;
 struct image;
@@ -586,9 +596,6 @@ EXFUN (Fx_display_grayscale_p, 1);
 EXFUN (Fx_display_planes, 1);
 extern void x_free_gcs P_ ((struct frame *));
 
-void activate_scroll_bars (FRAME_PTR);
-void deactivate_scroll_bars (FRAME_PTR);
-
 /* Defined in macterm.c.  */
 
 extern void x_set_window_size P_ ((struct frame *, int, int, int));
@@ -620,7 +627,17 @@ extern OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
 extern void mac_clear_font_name_table P_ ((void));
 #if TARGET_API_MAC_CARBON
 extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
+extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
+extern Lisp_Object cfstring_to_lisp P_ ((CFStringRef));
+extern Lisp_Object cfnumber_to_lisp P_ ((CFNumberRef));
+extern Lisp_Object cfdate_to_lisp P_ ((CFDateRef));
+extern Lisp_Object cfboolean_to_lisp P_ ((CFBooleanRef));
+extern Lisp_Object cfobject_desc_to_lisp P_ ((CFTypeRef));
+extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int));
 #endif
+extern void xrm_merge_string_database P_ ((XrmDatabase, char *));
+extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, char *, char *));
+extern XrmDatabase xrm_get_preference_database P_ ((char *));
 
 /* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79
    (do not change this comment) */
index 1bd8b3ae64d95c4655bb8180144a72ee49e91697..8ce21f3e8ee54463c067c7c02671ef84d21beb57 100644 (file)
@@ -6704,7 +6704,7 @@ init_process ()
  }
 #endif /* HAVE_SOCKETS */
 
-#ifdef DARWIN
+#if defined (DARWIN) || defined (MAC_OSX)
   /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive 
      processes.  As such, we only change the default value.  */
  if (initialized)
index 5b162ea08a35330e80f858e6bb6eca06bbb5b577..970e954b61637a457bd77d78fa762aa957c6aaff 100644 (file)
@@ -37,9 +37,12 @@ Boston, MA 02111-1307, USA.  */
 #define BSD_SYSTEM
 /* #define VMS */
 
+#if 0 /* Don't define DARWIN on Mac OS X because CoreFoundation.h uses
+        it to distinguish Mac OS X from bare Darwin.  */
 #ifndef        DARWIN
 #define        DARWIN 1
 #endif
+#endif
 
 /* MAC_OS is used to conditionally compile code common to both MAC_OS8
    and MAC_OSX.  */
index d9c2185e767d09701ca5ff399f77c875d83afc1f..8e4d0940d02a2ed1e46fd21335109a5f11b05d71 100644 (file)
@@ -4779,16 +4779,27 @@ x_update_menu_appearance (f)
        {
 #ifdef USE_MOTIF
          const char *suffix = "List";
+         Bool motif = True;
 #else
          const char *suffix = "";
+         Bool motif = False;
+#endif
+#if defined HAVE_X_I18N
+         extern char *xic_create_fontsetname
+           P_ ((char *base_fontname, Bool motif));
+         char *fontsetname = xic_create_fontsetname (face->font_name, motif);
+#else
+         char *fontsetname = face->font_name;
 #endif
          sprintf (line, "%s.pane.menubar*font%s: %s",
-                  myname, suffix, face->font_name);
+                  myname, suffix, fontsetname);
          XrmPutLineResource (&rdb, line);
          sprintf (line, "%s.%s*font%s: %s",
-                  myname, popup_path, suffix, face->font_name);
+                  myname, popup_path, suffix, fontsetname);
          XrmPutLineResource (&rdb, line);
          changed_p = 1;
+         if (fontsetname != face->font_name)
+           xfree (fontsetname);
        }
 
       if (changed_p && f->output_data.x->menubar_widget)
@@ -7959,7 +7970,7 @@ dump_realized_face (face)
 {
   fprintf (stderr, "ID: %d\n", face->id);
 #ifdef HAVE_X_WINDOWS
-  fprintf (stderr, "gc: %d\n", (int) face->gc);
+  fprintf (stderr, "gc: %ld\n", (long) face->gc);
 #endif
   fprintf (stderr, "foreground: 0x%lx (%s)\n",
           face->foreground,
index 0522fc4137e029604adb4885486f7e2be1f9606f..11f66a17f616dd18148de8fb65caf54375a2fe61 100644 (file)
@@ -1941,14 +1941,24 @@ static XIMStyle supported_xim_styles[] =
 
 char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
 
+/* Create an Xt fontset spec from the name of a base font.
+   If `motif' is True use the Motif syntax.  */
 char *
-xic_create_fontsetname (base_fontname)
+xic_create_fontsetname (base_fontname, motif)
      char *base_fontname;
+     Bool motif;
 {
+  const char *sep = motif ? ";" : ",";
+  char *fontsetname;
+
   /* Make a fontset name from the base font name.  */
   if (xic_defaut_fontset == base_fontname)
-    /* There is no base font name, use the default.  */
-    return base_fontname;
+    { /* There is no base font name, use the default.  */
+      int len = strlen (base_fontname) + 2;
+      fontsetname = xmalloc (len);
+      bzero (fontsetname, len);
+      strcpy (fontsetname, base_fontname);
+    }
   else
     {
       /* Make a fontset name from the base font name.
@@ -1957,30 +1967,31 @@ xic_create_fontsetname (base_fontname)
         - the base font where the charset spec is replaced by -*-*.
         - the same but with the family also replaced with -*-*-.  */
       char *p = base_fontname;
-      char *fontsetname;
       int i;
-       
+      
       for (i = 0; *p; p++)
        if (*p == '-') i++;
       if (i != 14)
        { /* As the font name doesn't conform to XLFD, we can't
             modify it to generalize it to allcs and allfamilies.
             Use the specified font plus the default.  */
-         int len = strlen (base_fontname) + strlen (xic_defaut_fontset) + 2;
+         int len = strlen (base_fontname) + strlen (xic_defaut_fontset) + 3;
          fontsetname = xmalloc (len);
          bzero (fontsetname, len);
          strcpy (fontsetname, base_fontname);
-         strcat (fontsetname, ",");
+         strcat (fontsetname, sep);
          strcat (fontsetname, xic_defaut_fontset);
        }
       else
        {
          int len;
-         char *p1 = NULL;
+         char *p1 = NULL, *p2 = NULL;
          char *font_allcs = NULL;
          char *font_allfamilies = NULL;
+         char *font_all = NULL;
          char *allcs = "*-*-*-*-*-*-*";
          char *allfamilies = "-*-*-";
+         char *all = "*-*-*-*-";
          
          for (i = 0, p = base_fontname; i < 8; p++)
            {
@@ -1989,6 +2000,8 @@ xic_create_fontsetname (base_fontname)
                  i++;
                  if (i == 3)
                    p1 = p + 1;
+                 else if (i == 7)
+                   p2 = p + 1;
                }
            }
          /* Build the font spec that matches all charsets.  */
@@ -2003,22 +2016,35 @@ xic_create_fontsetname (base_fontname)
          font_allfamilies = (char *) alloca (len);
          bzero (font_allfamilies, len);
          strcpy (font_allfamilies, allfamilies);
-         bcopy (p1, font_allfamilies + (strlen (allfamilies)), p - p1);
+         bcopy (p1, font_allfamilies + strlen (allfamilies), p - p1);
          strcat (font_allfamilies, allcs);
 
+         /* Build the font spec that matches all.  */
+         len = p - p2 + strlen (allcs) + strlen (all) + strlen (allfamilies) + 1;
+         font_all = (char *) alloca (len);
+         bzero (font_all, len);
+         strcpy (font_all, allfamilies);
+         strcat (font_all, all);
+         bcopy (p2, font_all + strlen (all) + strlen (allfamilies), p - p2);
+         strcat (font_all, allcs);
+
          /* Build the actual font set name.  */
          len = strlen (base_fontname) + strlen (font_allcs)
-           + strlen (font_allfamilies) + 3;
+           + strlen (font_allfamilies) + strlen (font_all) + 5;
          fontsetname = xmalloc (len);
          bzero (fontsetname, len);
          strcpy (fontsetname, base_fontname);
-         strcat (fontsetname, ",");
+         strcat (fontsetname, sep);
          strcat (fontsetname, font_allcs);
-         strcat (fontsetname, ",");
+         strcat (fontsetname, sep);
          strcat (fontsetname, font_allfamilies);
+         strcat (fontsetname, sep);
+         strcat (fontsetname, font_all);
        }
-      return fontsetname;
     }
+  if (motif)
+    strcat (fontsetname, ":");
+  return fontsetname;
 }
 
 static XFontSet
@@ -2051,7 +2077,7 @@ xic_create_xfontset (f, base_fontname)
 
   if (!xfs)
     {
-      char *fontsetname = xic_create_fontsetname (base_fontname);
+      char *fontsetname = xic_create_fontsetname (base_fontname, False);
 
       /* New fontset.  */
       xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
@@ -2059,8 +2085,7 @@ xic_create_xfontset (f, base_fontname)
                             &missing_count, &def_string);
       if (missing_list)
         XFreeStringList (missing_list);
-      if (fontsetname != base_fontname)
-       xfree (fontsetname);
+      xfree (fontsetname);
     }
 
   if (FRAME_XIC_BASE_FONTNAME (f))
@@ -4561,9 +4586,6 @@ x_create_tip_frame (dpyinfo, parms, text)
 
   check_x ();
 
-  /* Use this general default value to start with until we know if
-     this frame has a specified name.  */
-  Vx_resource_name = Vinvocation_name;
 
 #ifdef MULTI_KBOARD
   kb = dpyinfo->kboard;
@@ -4577,7 +4599,6 @@ x_create_tip_frame (dpyinfo, parms, text)
       && !EQ (name, Qunbound)
       && !NILP (name))
     error ("Invalid frame name--not a string or nil");
-  Vx_resource_name = name;
 
   frame = Qnil;
   GCPRO3 (parms, name, frame);
index 07d6fe3d73036e12551f08489b7d97563734a418..c8747689c1ec533c1cc39e23be1a437a2aa4450d 100644 (file)
@@ -137,6 +137,8 @@ static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **));
 #ifdef USE_GTK
 /* gtk just uses utf-8.  */
 # define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str)
+#elif defined HAVE_X_I18N
+# define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str)
 #else
 # define ENCODE_MENU_STRING(str) string_make_unibyte (str)
 #endif
index ed701c64c639d8570b471fa0c66736ac2cfa61aa..e4d8b34cab7f47214a092965ba52ff51af010f5f 100644 (file)
@@ -527,7 +527,11 @@ x_load_resources (display, xrm_string, myname, myclass)
   XrmDatabase rdb;
   XrmDatabase db;
   char line[256];
+#ifdef HAVE_X_I18N
+  char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*,*";
+#else
   char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1";
+#endif
 #ifdef USE_MOTIF
   char *courier = "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1";
   extern Lisp_Object Vdouble_click_time;