Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-2
authorMiles Bader <miles@gnu.org>
Sun, 16 Jan 2005 03:40:12 +0000 (03:40 +0000)
committerMiles Bader <miles@gnu.org>
Sun, 16 Jan 2005 03:40:12 +0000 (03:40 +0000)
Merge from emacs--cvs-trunk--0

Patches applied:

 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-83
 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-84
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-3
 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-4
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-5
   Merge from gnus--rel--5.10

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-6
 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-11
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-12
   Remove "-face" suffix from lazy-highlight face name

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-13
 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-16
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
   Merge from gnus--rel--5.10

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-18
 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-21
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-22
   <no summary provided>

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-23
 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-39
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-40
   Fix regressions from latest reftex update

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--base-0
   tag of miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-82

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-1
   Merge from emacs--cvs-trunk--0

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-2
   Merge from miles@gnu.org--gnu-2004

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-3
   Merge from emacs--cvs-trunk--0

28 files changed:
1  2 
etc/MORE.STUFF
etc/NEWS
lisp/ChangeLog
lisp/desktop.el
lisp/isearch.el
lisp/mail/rmail.el
lisp/progmodes/perl-mode.el
lisp/progmodes/sh-script.el
lisp/simple.el
lisp/startup.el
lisp/textmodes/sgml-mode.el
src/ChangeLog
src/alloc.c
src/dispextern.h
src/fns.c
src/fringe.c
src/keyboard.c
src/keymap.c
src/macterm.c
src/term.c
src/w32bdf.c
src/w32fns.c
src/w32term.c
src/window.c
src/xdisp.c
src/xfaces.c
src/xmenu.c
src/xterm.h

diff --cc etc/MORE.STUFF
@@@ -184,11 -204,18 +204,11 @@@ Several are for Debian GNU/Linux in par
     Provides an interactive environment for manipulating an inferior
     process running some form of Lisp.
  
-  * JDE: <URL:http://jdee.sunsite.dk/>
+  * JDEE: <URL:http://jdee.sunsite.dk/>
     Provides a Java development environment for Emacs.
  
 - * Mule-UCS: Universal enCoding System:
 -   <URL:ftp://ftp.m17n.org/pub/mule/Mule-UCS/>
 -   Extended coding systems for Mule, specifically for reading and
 -   writing UTF-8 encoded Unicode.  This probably doesn't have much
 -   advantage over the built-in `mule-utf-8' coding system with
 -   `utf-translate-cjk' turned on.
 -
   * Mailcrypt:
-    <URL:http://www.pobox.com/%7Elbudney/linux/software/mailcrypt.html>
+    <URL:http://mailcrypt.sourceforge.net/>
     PGP and GPG support.  PGP isn't free software, but GPG, the GNU
     Privacy Guard, is a free replacement <URL:http://www.gnupg.org/>.
  
diff --cc etc/NEWS
Simple merge
diff --cc lisp/ChangeLog
Simple merge
diff --cc lisp/desktop.el
@@@ -1,6 -1,6 +1,6 @@@
  ;;; desktop.el --- save partial status of Emacs when killed
  
--;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001
++;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001, 2005
  ;;   Free Software Foundation, Inc.
  
  ;; Author: Morten Welinder <terra@diku.dk>
@@@ -630,7 -653,7 +653,7 @@@ See also `desktop-base-file-name'.
        (erase-buffer)
  
        (insert
-         ";; -*- coding: utf-8-emacs; -*-\n"
 -        ";; -*- mode: emacs-lisp; coding: emacs-mule; -*-\n"
++        ";; -*- mode: emacs-lisp; coding: utf-8-emacs; -*-\n"
          desktop-header
          ";; Created " (current-time-string) "\n"
          ";; Desktop file format version " desktop-file-version "\n"
  
        (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
        (mapc #'(lambda (l)
-               (if (apply 'desktop-save-buffer-p l)
-                   (progn
-                     (insert "(desktop-create-buffer " desktop-file-version)
-                     (mapc #'(lambda (e)
-                               (insert "\n  " (desktop-value-to-string e)))
-                           l)
-                     (insert ")\n\n"))))
-           info)
+                 (when (apply 'desktop-save-buffer-p l)
+                   (insert "("
+                           (if (or (not (integerp eager))
+                                   (unless (zerop eager)
+                                     (setq eager (1- eager))
+                                     t))
+                               "desktop-create-buffer"
+                             "desktop-append-buffer-args")
+                           " "
+                           desktop-file-version)
+                   (mapc #'(lambda (e)
+                             (insert "\n  " (desktop-value-to-string e)))
+                         l)
+                   (insert ")\n\n")))
+             info)
        (setq default-directory dirname)
        (when (file-exists-p filename) (delete-file filename))
 -      (let ((coding-system-for-write 'emacs-mule))
 +      (let ((coding-system-for-write 'utf-8-emacs))
          (write-region (point-min) (point-max) filename nil 'nomessage))))
    (setq desktop-dirname dirname))
  
diff --cc lisp/isearch.el
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lisp/simple.el
Simple merge
diff --cc lisp/startup.el
Simple merge
Simple merge
diff --cc src/ChangeLog
Simple merge
diff --cc src/alloc.c
Simple merge
@@@ -2755,13 -2760,12 +2758,14 @@@ int face_at_buffer_position P_ ((struc
                                 int, int));
  int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int,
                                 int, int *, enum face_id, int));
+ int merge_faces P_ ((struct frame *, Lisp_Object, int, int));
  int compute_char_face P_ ((struct frame *, int, Lisp_Object));
  void free_all_realized_faces P_ ((Lisp_Object));
 +void free_realized_face P_ ((struct frame *, struct face *));
  extern Lisp_Object Qforeground_color, Qbackground_color;
  extern char unspecified_fg[], unspecified_bg[];
 -void free_realized_multibyte_face P_ ((struct frame *, int));
 +extern Lisp_Object split_font_name_into_vector P_ ((Lisp_Object));
 +extern Lisp_Object build_font_name_from_vector P_ ((Lisp_Object));
  
  /* Defined in xfns.c  */
  
diff --cc src/fns.c
Simple merge
diff --cc src/fringe.c
Simple merge
diff --cc src/keyboard.c
Simple merge
diff --cc src/keymap.c
Simple merge
diff --cc src/macterm.c
Simple merge
diff --cc src/term.c
@@@ -876,35 -862,25 +876,35 @@@ encode_terminal_code (src, src_len, cod
                }
              else
                {
 -                /* We have a string in Vglyph_table.  */
 -                Lisp_Object string;
 -
 -                string = tbase[g];
 -                if (! STRING_MULTIBYTE (string))
 -                  string = string_to_multibyte (string);
 -                nbytes = buf - encode_terminal_buf;
 -                if (encode_terminal_bufsize < nbytes + SBYTES (string))
 +                /* C is not encodable.  */
 +                *buf++ = '?';
 +                nchars++;
 +                while (src + 1 < src_end && CHAR_GLYPH_PADDING_P (src[1]))
                    {
 -                    encode_terminal_bufsize = nbytes + SBYTES (string);
 -                    encode_terminal_buf = xrealloc (encode_terminal_buf,
 -                                                    encode_terminal_bufsize);
 -                    buf = encode_terminal_buf + nbytes;
 +                    *buf++ = '?';
 +                    nchars++;
 +                    src++;
                    }
 -                bcopy (SDATA (string), buf, SBYTES (string));
 -                buf += SBYTES (string);
 -                nchars += SCHARS (string);
                }
            }
-             if (nbytes + SBYTES (string) < encode_terminal_src_size)
 +        else
 +          {
 +            unsigned char *p = SDATA (string), *pend = p + SBYTES (string);
 +
 +            if (! STRING_MULTIBYTE (string))
 +              string = string_to_multibyte (string);
 +            nbytes = buf - encode_terminal_src;
++            if (encode_terminal_src_size < nbytes + SBYTES (string))
 +              {
 +                encode_terminal_src_size = nbytes + SBYTES (string);
 +                encode_terminal_src = xrealloc (encode_terminal_src,
 +                                                encode_terminal_src_size);
 +                buf = encode_terminal_src + nbytes;
 +              }
 +            bcopy (SDATA (string), buf, SBYTES (string));
 +            buf += SBYTES (string);
 +            nchars += SCHARS (string);
 +          }
        }
        src++;
      }
diff --cc src/w32bdf.c
Simple merge
diff --cc src/w32fns.c
@@@ -4593,7 -4593,24 +4594,26 @@@ w32_load_system_font (f,fontname,size
      fontp->name = (char *) xmalloc (strlen (fontname) + 1);
      bcopy (fontname, fontp->name, strlen (fontname) + 1);
  
+     if (lf.lfPitchAndFamily == FIXED_PITCH)
+       {
+       /* Fixed width font.  */
+       fontp->average_width = fontp->space_width = FONT_WIDTH (font);
+       }
+     else
+       {
+       wchar_t space = 32;
+       XCharStruct* pcm;
+       pcm = w32_per_char_metric (font, &space, ANSI_FONT);
+       if (pcm)
+         fontp->space_width = pcm->width;
+       else
+         fontp->space_width = FONT_WIDTH (font);
+       fontp->average_width = font->tm.tmAveCharWidth;
+       }
++
 +    fontp->charset = -1;
      charset = xlfd_charset_of_font (fontname);
  
    /* Cache the W32 codepage for a font.  This makes w32_encode_char
diff --cc src/w32term.c
@@@ -1,5 -1,5 +1,5 @@@
  /* Implementation of GUI terminal on the Microsoft W32 API.
--   Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001
++   Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001, 2005
     Free Software Foundation, Inc.
  
  This file is part of GNU Emacs.
@@@ -846,10 -819,8 +846,9 @@@ w32_reset_terminal_modes (void
  
  /* Function prototypes of this page.  */
  
- static XCharStruct *w32_per_char_metric P_ ((XFontStruct *,
-                                              wchar_t *, int));
+ XCharStruct *w32_per_char_metric P_ ((XFontStruct *, wchar_t *, int));
 -static int w32_encode_char P_ ((int, wchar_t *, struct font_info *, int *));
 +static int w32_encode_char P_ ((int, wchar_t *, struct font_info *,
 +                              struct charset *, int *));
  
  
  /* Get metrics of character CHAR2B in FONT.  Value is always non-null.
diff --cc src/window.c
Simple merge
diff --cc src/xdisp.c
@@@ -5031,18 -4941,20 +5036,19 @@@ get_next_display_element (it
             don't have corresponding multibyte char code are also
             translated to octal form.  */
          else if ((it->c < ' '
 -                  && (it->area != TEXT_AREA
 -                      /* In mode line, treat \n like other crl chars.  */
 -                      || (it->c != '\n'
 -                          && it->glyph_row && it->glyph_row->mode_line_p)
 -                      || (it->c != '\n' && it->c != '\t')))
 -                 || (it->multibyte_p
 -                     ? ((it->c >= 127
 -                         && it->len == 1)
 -                        || !CHAR_PRINTABLE_P (it->c)
 +                  ? (it->area != TEXT_AREA
 +                     /* In mode line, treat \n, \t like other crl chars.  */
 +                     || (it->c != '\n'
 +                         && it->glyph_row && it->glyph_row->mode_line_p)
 +                     || (it->c != '\n' && it->c != '\t'))
 +                  : (it->multibyte_p
 +                     ? (!CHAR_PRINTABLE_P (it->c)
-                         || it->c == 0xA0 /* NO-BREAK SPACE */
-                         || it->c == 0xAD /* SOFT HYPHEN */)
+                         || (!NILP (Vshow_nonbreak_escape)
 -                            && (it->c == 0x8ad || it->c == 0x8a0)))
++                            && (it->c == 0xA0 /* NO-BREAK SPACE */
++                                || it->c == 0xAD /* SOFT HYPHEN */)))
                       : (it->c >= 127
 -                        && (!unibyte_display_via_language_environment
 -                            || it->c == unibyte_char_to_multibyte (it->c)))))
 +                        && (! unibyte_display_via_language_environment
 +                            || (UNIBYTE_CHAR_HAS_MULTIBYTE_P (it->c)))))))
            {
              /* IT->c is a control character which must be displayed
                 either as '\003' or as `^C' where the '\\' and '^'
                  if (it->dp
                      && INTEGERP (DISP_CTRL_GLYPH (it->dp))
                      && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp))))
-                   g = XINT (DISP_CTRL_GLYPH (it->dp));
+                   {
+                     g = XINT (DISP_CTRL_GLYPH (it->dp));
+                     lface_id = FAST_GLYPH_FACE (g);
+                     if (lface_id)
+                       {
+                         g = FAST_GLYPH_CHAR (g);
+                         face_id = merge_faces (it->f, Qt, lface_id,
+                                                it->face_id);
+                       }
+                   }
                  else
-                   g = FAST_MAKE_GLYPH ('^', face_id);
-                 XSETINT (it->ctl_chars[0], g);
+                   {
+                     /* Merge the escape-glyph face into the current face.  */
+                     face_id = merge_faces (it->f, Qescape_glyph, 0,
+                                            it->face_id);
+                     g = '^';
+                   }
  
-                 g = FAST_MAKE_GLYPH (it->c ^ 0100, face_id);
+                 XSETINT (it->ctl_chars[0], g);
+                 g = it->c ^ 0100;
                  XSETINT (it->ctl_chars[1], g);
                  ctl_len = 2;
+                 goto display_control;
                }
-             else if (it->c == 0xA0 || it->c == 0xAD)
+             if (it->dp
+                 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp))
+                 && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp))))
                {
-                 /* Set IT->ctl_chars[0] to the glyph for `\\'.  */
-                 if (it->dp
-                     && INTEGERP (DISP_ESCAPE_GLYPH (it->dp))
-                     && GLYPH_CHAR_VALID_P (XINT (DISP_ESCAPE_GLYPH (it->dp))))
-                   g = XINT (DISP_ESCAPE_GLYPH (it->dp));
-                 else
-                   g = FAST_MAKE_GLYPH ('\\', face_id);
-                 XSETINT (it->ctl_chars[0], g);
+                 escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp));
+                 lface_id = FAST_GLYPH_FACE (escape_glyph);
+                 if (lface_id)
+                   {
+                     escape_glyph = FAST_GLYPH_CHAR (escape_glyph);
+                     face_id = merge_faces (it->f, Qt, lface_id,
+                                            it->face_id);
+                   }
+               }
+             else
+               {
+                 /* Merge the escape-glyph face into the current face.  */
+                 face_id = merge_faces (it->f, Qescape_glyph, 0,
+                                        it->face_id);
+                 escape_glyph = '\\';
+               }
  
-                 g = FAST_MAKE_GLYPH (it->c == 0xAD ? '-' : ' ', face_id);
 -            if (it->c == 0x8a0 || it->c == 0x8ad)
++            if (it->c == 0xA0 || it->c == 0xAD)
+               {
+                 XSETINT (it->ctl_chars[0], escape_glyph);
 -                g = it->c == 0x8ad ? '-' : ' ';
++                g = it->c == 0xAD ? '-' : ' ';
                  XSETINT (it->ctl_chars[1], g);
                  ctl_len = 2;
+                 goto display_control;
                }
-             else
-               {
-                 unsigned char str[MAX_MULTIBYTE_LENGTH];
-                 int len;
-                 int i;
-                 GLYPH escape_glyph;
  
-                 /* Set IT->ctl_chars[0] to the glyph for `\\'.  */
-                 if (it->dp
-                     && INTEGERP (DISP_ESCAPE_GLYPH (it->dp))
-                     && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp))))
-                   escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp));
-                 else
-                   escape_glyph = FAST_MAKE_GLYPH ('\\', face_id);
+             {
+               unsigned char str[MAX_MULTIBYTE_LENGTH];
+               int len;
+               int i;
  
-                 if (CHAR_BYTE8_P (it->c))
-                   {
-                     str[0] = CHAR_TO_BYTE8 (it->c);
-                     len = 1;
-                   }
-                 else if (it->c < 256)
-                   {
-                     str[0] = it->c;
-                     len = 1;
-                   }
-                 else
-                   {
-                     /* It's an invalid character, which
-                        shouldn't happen actually, but due to
-                        bugs it may happen.  Let's print the char
-                        as is, there's not much meaningful we can
-                        do with it.  */
+               /* Set IT->ctl_chars[0] to the glyph for `\\'.  */
 -              if (SINGLE_BYTE_CHAR_P (it->c))
 -                str[0] = it->c, len = 1;
++              if (CHAR_BYTE8_P (it->c))
++                {
++                  str[0] = CHAR_TO_BYTE8 (it->c);
++                  len = 1;
++                }
++              else if (it->c < 256)
++                {
++                  str[0] = it->c;
++                  len = 1;
++                }
+               else
+                 {
 -                  len = CHAR_STRING_NO_SIGNAL (it->c, str);
 -                  if (len < 0)
 -                    {
 -                      /* It's an invalid character, which shouldn't
 -                         happen actually, but due to bugs it may
 -                         happen.  Let's print the char as is, there's
 -                         not much meaningful we can do with it.  */
 -                        str[0] = it->c;
 -                        str[1] = it->c >> 8;
 -                        str[2] = it->c >> 16;
 -                        str[3] = it->c >> 24;
 -                        len = 4;
 -                      }
++                  /* It's an invalid character, which shouldn't
++                     happen actually, but due to bugs it may
++                     happen.  Let's print the char as is, there's
++                     not much meaningful we can do with it.  */
 +                    str[0] = it->c;
 +                    str[1] = it->c >> 8;
 +                    str[2] = it->c >> 16;
 +                    str[3] = it->c >> 24;
 +                    len = 4;
                    }
  
-                 for (i = 0; i < len; i++)
-                   {
-                     XSETINT (it->ctl_chars[i * 4], escape_glyph);
-                     /* Insert three more glyphs into IT->ctl_chars for
-                        the octal display of the character.  */
-                     g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0',
-                                          face_id);
-                     XSETINT (it->ctl_chars[i * 4 + 1], g);
-                     g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0',
-                                          face_id);
-                     XSETINT (it->ctl_chars[i * 4 + 2], g);
-                     g = FAST_MAKE_GLYPH ((str[i] & 7) + '0',
-                                          face_id);
-                     XSETINT (it->ctl_chars[i * 4 + 3], g);
-                   }
-                 ctl_len = len * 4;
-               }
+               for (i = 0; i < len; i++)
+                 {
+                   XSETINT (it->ctl_chars[i * 4], escape_glyph);
+                   /* Insert three more glyphs into IT->ctl_chars for
+                      the octal display of the character.  */
+                   g = ((str[i] >> 6) & 7) + '0';
+                   XSETINT (it->ctl_chars[i * 4 + 1], g);
+                   g = ((str[i] >> 3) & 7) + '0';
+                   XSETINT (it->ctl_chars[i * 4 + 2], g);
+                   g = (str[i] & 7) + '0';
+                   XSETINT (it->ctl_chars[i * 4 + 3], g);
+                 }
+               ctl_len = len * 4;
+             }
  
+           display_control:
              /* Set up IT->dpvec and return first character from it.  */
              it->dpvec_char_len = it->len;
              it->dpvec = it->ctl_chars;
diff --cc src/xfaces.c
Simple merge
diff --cc src/xmenu.c
Simple merge
diff --cc src/xterm.h
Simple merge