aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-08-30 14:16:49 -0700
committerPaul Eggert2011-08-30 14:16:49 -0700
commit542f2c78acd26112754474223c85311d6c9cc2eb (patch)
tree40b7b8d083fca48e389c2126b126e8c681782cc7
parent2be7d7020619ebbdfb3df2bc2c3fcc3123bcedc0 (diff)
parent1f87634f0a68f181c4b5aa526fe2985f6c10328c (diff)
downloademacs-542f2c78acd26112754474223c85311d6c9cc2eb.tar.gz
emacs-542f2c78acd26112754474223c85311d6c9cc2eb.zip
Merge from trunk.
-rw-r--r--ChangeLog8
-rw-r--r--configure.in15
-rw-r--r--doc/lispref/ChangeLog7
-rw-r--r--doc/lispref/display.texi59
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/modes.texi41
-rw-r--r--doc/lispref/vol1.texi1
-rw-r--r--doc/lispref/vol2.texi1
-rw-r--r--etc/NEWS1
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/subr.el4
-rw-r--r--lisp/vc/pcvs-defs.el2
-rw-r--r--src/ChangeLog14
-rw-r--r--src/dispextern.h3
-rw-r--r--src/image.c3
-rw-r--r--src/term.c86
-rw-r--r--src/xdisp.c110
17 files changed, 199 insertions, 170 deletions
diff --git a/ChangeLog b/ChangeLog
index dd803790093..1f38dbf71ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12011-08-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * configure.in (opsys): Change pattern to *-*-linux*
4 to recognize powerpc-gnu-linux-uclibc (Bug#9403).
5 Remove unreachable pattern hppa*-*-linux-gnu*.
6 Also, remove ia64*-hp-hpux1[1-9]*, as it also sets machine=hp800,
7 and that can't possibly work now that src/m/hp800.h no longer exists.
8
12011-08-26 Jan Djärv <jan.h.d@swipnet.se> 92011-08-26 Jan Djärv <jan.h.d@swipnet.se>
2 10
3 * configure.in: Add -MP to DEPFLAGS (Bug#9372). 11 * configure.in: Add -MP to DEPFLAGS (Bug#9372).
diff --git a/configure.in b/configure.in
index f62f364715f..715e8278df2 100644
--- a/configure.in
+++ b/configure.in
@@ -410,8 +410,8 @@ dnl quotation begins
410machine='' opsys='' unported=no 410machine='' opsys='' unported=no
411case "${canonical}" in 411case "${canonical}" in
412 412
413 ## GNU/Linux ports 413 ## GNU/Linux and similar ports
414 *-*-linux-gnu*) 414 *-*-linux* )
415 opsys=gnu-linux 415 opsys=gnu-linux
416 case ${canonical} in 416 case ${canonical} in
417 alpha*) machine=alpha ;; 417 alpha*) machine=alpha ;;
@@ -508,17 +508,6 @@ case "${canonical}" in
508 CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS" 508 CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
509 ;; 509 ;;
510 510
511 ia64*-hp-hpux1[1-9]* )
512 machine=hp800 opsys=hpux11
513 ## FIXME. Peter O'Gorman reports that dumping using unexelf.o doesn't
514 ## work either: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6811
515 CANNOT_DUMP=yes
516 ;;
517
518 hppa*-*-linux-gnu* )
519 machine=hp800 opsys=gnu-linux
520 ;;
521
522 ## IBM machines 511 ## IBM machines
523 rs6000-ibm-aix4.[23]* ) 512 rs6000-ibm-aix4.[23]* )
524 machine=ibmrs6000 opsys=aix4-2 513 machine=ibmrs6000 opsys=aix4-2
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 57dde5ac4cb..37689c16e59 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,10 @@
12011-08-30 Chong Yidong <cyd@stupidchicken.com>
2
3 * display.texi (Basic Faces): New node. Document new faces.
4
5 * modes.texi (Major Mode Conventions): Move some text there.
6 (Mode Help): Remove major-mode var, duplicated in Major Modes.
7
12011-08-29 Chong Yidong <cyd@stupidchicken.com> 82011-08-29 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * modes.texi (Basic Major Modes): New node. Callers updated. 10 * modes.texi (Basic Major Modes): New node. Callers updated.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index cfe4b8298fb..68291319ef1 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1833,9 +1833,10 @@ particular face name a special meaning in one frame if you wish.
1833* Face Attributes:: What is in a face? 1833* Face Attributes:: What is in a face?
1834* Attribute Functions:: Functions to examine and set face attributes. 1834* Attribute Functions:: Functions to examine and set face attributes.
1835* Displaying Faces:: How Emacs combines the faces specified for a character. 1835* Displaying Faces:: How Emacs combines the faces specified for a character.
1836* Face Remapping:: Remapping faces to alternative definitions. 1836* Face Remapping:: Remapping faces to alternative definitions.
1837* Face Functions:: How to define and examine faces. 1837* Face Functions:: How to define and examine faces.
1838* Auto Faces:: Hook for automatic face assignment. 1838* Auto Faces:: Hook for automatic face assignment.
1839* Basic Faces:: Faces that are defined by default.
1839* Font Selection:: Finding the best available font for a face. 1840* Font Selection:: Finding the best available font for a face.
1840* Font Lookup:: Looking up the names of available fonts 1841* Font Lookup:: Looking up the names of available fonts
1841 and information about them. 1842 and information about them.
@@ -2687,6 +2688,62 @@ For efficiency, we recommend writing these functions so that they
2687usually assign faces to around 400 to 600 characters at each call. 2688usually assign faces to around 400 to 600 characters at each call.
2688@end defvar 2689@end defvar
2689 2690
2691@node Basic Faces
2692@subsection Basic Faces
2693
2694If your Emacs Lisp program needs to assign some faces to text, it is
2695often a good idea to use certain existing faces or inherit from them,
2696rather than defining entirely new faces. This way, if other users
2697have customized the basic faces to give Emacs a certain look, your
2698program will ``fit in'' without additional customization.
2699
2700 Some of the basic faces defined in Emacs are listed below. In
2701addition to these, you might want to make use of the Font Lock faces
2702for syntactic highlighting, if highlighting is not already handled by
2703Font Lock mode, or if some Font Lock faces are not in use.
2704@xref{Faces for Font Lock}.
2705
2706@table @code
2707@item default
2708The default face, whose attributes are all specified. All other faces
2709implicitly inherit from it: any unspecified attribute defaults to the
2710attribute on this face (@pxref{Face Attributes}).
2711
2712@item bold
2713@itemx italic
2714@itemx bold-italic
2715@itemx underline
2716@itemx fixed-pitch
2717@itemx variable-pitch
2718These have the attributes indicated by their names (e.g. @code{bold}
2719has a bold @code{:weight} attribute), with all other attributes
2720unspecified (and so given by @code{default}).
2721
2722@item shadow
2723For ``dimmed out'' text. For example, it is used for the ignored
2724part of a filename in the minibuffer (@pxref{Minibuffer File,,
2725Minibuffers for File Names, emacs, The GNU Emacs Manual}).
2726
2727@item link
2728@itemx link-visited
2729For clickable text buttons that send the user to a different
2730buffer or ``location''.
2731
2732@item highlight
2733For stretches of text that should temporarily stand out. For example,
2734it is commonly assigned to the @code{mouse-face} property for cursor
2735highlighting (@pxref{Special Properties}).
2736
2737@item match
2738For text matching a search command.
2739
2740@item error
2741@itemx warning
2742@itemx success
2743For text concerning errors, warnings, or successes. For example,
2744these are used for messages in @samp{*Compilation*} buffers.
2745@end table
2746
2690@node Font Selection 2747@node Font Selection
2691@subsection Font Selection 2748@subsection Font Selection
2692 2749
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index a19af903027..bcf6d3318ef 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1308,6 +1308,7 @@ Faces
1308* Face Remapping:: Remapping faces to alternative definitions. 1308* Face Remapping:: Remapping faces to alternative definitions.
1309* Face Functions:: How to define and examine faces. 1309* Face Functions:: How to define and examine faces.
1310* Auto Faces:: Hook for automatic face assignment. 1310* Auto Faces:: Hook for automatic face assignment.
1311* Basic Faces:: Faces that are defined by default.
1311* Font Selection:: Finding the best available font for a face. 1312* Font Selection:: Finding the best available font for a face.
1312* Font Lookup:: Looking up the names of available fonts 1313* Font Lookup:: Looking up the names of available fonts
1313 and information about them. 1314 and information about them.
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 586fc0bbbfb..eb81ebc4acb 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -225,9 +225,9 @@ several major modes, in files such as @file{text-mode.el},
225study these libraries to see how modes are written. 225study these libraries to see how modes are written.
226 226
227@defopt major-mode 227@defopt major-mode
228The buffer-local value of this variable is a symbol naming the buffer's 228The buffer-local value of this variable holds the symbol for the current
229current major mode. Its default value holds the default major mode for 229major mode. Its default value holds the default major mode for new
230new buffers. The standard default value is @code{fundamental-mode}. 230buffers. The standard default value is @code{fundamental-mode}.
231 231
232If the default value is @code{nil}, then whenever Emacs creates a new 232If the default value is @code{nil}, then whenever Emacs creates a new
233buffer via a command such as @kbd{C-x b} (@code{switch-to-buffer}), the 233buffer via a command such as @kbd{C-x b} (@code{switch-to-buffer}), the
@@ -403,28 +403,7 @@ setting up a buffer-local value for the variable
403 403
404@item 404@item
405Each face that the mode defines should, if possible, inherit from an 405Each face that the mode defines should, if possible, inherit from an
406existing Emacs face. This reduces the chance of conflicting with a 406existing Emacs face. @xref{Basic Faces}, and @ref{Faces for Font Lock}.
407user's face customizations. Useful faces include:
408
409@table @asis
410@item @code{highlight}
411for stretches of text that should temporarily stand out.
412
413@item @code{match}
414for text matching a search command.
415
416@item @code{link} and @code{link-visited}
417for clickable text buttons that send the user to a different buffer or
418``location''.
419
420@item @code{button}
421for clickable text buttons that perform other actions.
422
423@item @asis{Font Lock faces}
424for other kinds of syntactic highlighting, if highlighting is not
425handled by Font Lock mode or some Font Lock faces are not in use.
426@xref{Faces for Font Lock}, for how to assign Font Lock faces.
427@end table
428 407
429@item 408@item
430The mode should specify how Imenu should find the definitions or 409The mode should specify how Imenu should find the definitions or
@@ -702,8 +681,8 @@ init file.)
702 681
703 The @code{describe-mode} function is provides information about major 682 The @code{describe-mode} function is provides information about major
704modes. It is normally bound to @kbd{C-h m}. It uses the value of the 683modes. It is normally bound to @kbd{C-h m}. It uses the value of the
705variable @code{major-mode} (which is why every major mode command needs 684variable @code{major-mode} (@pxref{Major Modes}), which is why every
706to set this variable). 685major mode command needs to set that variable.
707 686
708@deffn Command describe-mode 687@deffn Command describe-mode
709This function displays the documentation of the current major mode. 688This function displays the documentation of the current major mode.
@@ -714,14 +693,6 @@ displays the documentation string of the major mode command.
714(@xref{Accessing Documentation}.) 693(@xref{Accessing Documentation}.)
715@end deffn 694@end deffn
716 695
717@defvar major-mode
718This buffer-local variable holds the symbol for the current buffer's
719major mode. This symbol should have a function definition that is the
720command to switch to that major mode. The @code{describe-mode}
721function uses the documentation string of the function as the
722documentation of the major mode.
723@end defvar
724
725@node Derived Modes 696@node Derived Modes
726@subsection Defining Derived Modes 697@subsection Defining Derived Modes
727@cindex derived mode 698@cindex derived mode
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index c192e3bf4b7..1275628cc94 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -1329,6 +1329,7 @@ Faces
1329* Face Remapping:: Remapping faces to alternative definitions. 1329* Face Remapping:: Remapping faces to alternative definitions.
1330* Face Functions:: How to define and examine faces. 1330* Face Functions:: How to define and examine faces.
1331* Auto Faces:: Hook for automatic face assignment. 1331* Auto Faces:: Hook for automatic face assignment.
1332* Basic Faces:: Faces that are defined by default.
1332* Font Selection:: Finding the best available font for a face. 1333* Font Selection:: Finding the best available font for a face.
1333* Font Lookup:: Looking up the names of available fonts 1334* Font Lookup:: Looking up the names of available fonts
1334 and information about them. 1335 and information about them.
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 8e78a5fb5ca..3d849fa2dcf 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -1328,6 +1328,7 @@ Faces
1328* Face Remapping:: Remapping faces to alternative definitions. 1328* Face Remapping:: Remapping faces to alternative definitions.
1329* Face Functions:: How to define and examine faces. 1329* Face Functions:: How to define and examine faces.
1330* Auto Faces:: Hook for automatic face assignment. 1330* Auto Faces:: Hook for automatic face assignment.
1331* Basic Faces:: Faces that are defined by default.
1331* Font Selection:: Finding the best available font for a face. 1332* Font Selection:: Finding the best available font for a face.
1332* Font Lookup:: Looking up the names of available fonts 1333* Font Lookup:: Looking up the names of available fonts
1333 and information about them. 1334 and information about them.
diff --git a/etc/NEWS b/etc/NEWS
index bbaa46c7222..dbeca0b521b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -239,6 +239,7 @@ theme when Emacs is built with GTK.
239*** Emacs uses GTK tooltips by default if built with GTK. You can turn that 239*** Emacs uses GTK tooltips by default if built with GTK. You can turn that
240off by customizing x-gtk-use-system-tooltips. 240off by customizing x-gtk-use-system-tooltips.
241 241
242+++
242** New basic faces `error', `warning', `success' are available to 243** New basic faces `error', `warning', `success' are available to
243highlight strings that indicate failure, caution or successful operation. 244highlight strings that indicate failure, caution or successful operation.
244 245
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 15296e09b46..39cc42477e2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12011-08-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * subr.el (event-modifiers): Fix "missing modifier" part of docstring
4 (bug#9356).
5
62011-08-30 Reuben Thomas <rrt@sc3d.org> (tiny change)
7
8 * vc/pcvs-defs.el (cvs-find-file-and-jump): Docstring typo (bug#9369).
9
12011-08-29 Juri Linkov <juri@jurta.org> 102011-08-29 Juri Linkov <juri@jurta.org>
2 11
3 * isearch.el (isearch-done): Don't display message "Mark saved" 12 * isearch.el (isearch-done): Don't display message "Mark saved"
@@ -134,8 +143,8 @@
134 143
1352011-08-24 Chong Yidong <cyd@stupidchicken.com> 1442011-08-24 Chong Yidong <cyd@stupidchicken.com>
136 145
137 * window.el (quit-window): Renamed from quit-restore-window. Use 146 * window.el (quit-window): Rename from quit-restore-window.
138 same arglist as old quit-window. 147 Use same arglist as old quit-window.
139 (frame-auto-delete): Doc fix. 148 (frame-auto-delete): Doc fix.
140 149
141 * view.el (view-mode-exit): Use quit-window. 150 * view.el (view-mode-exit): Use quit-window.
diff --git a/lisp/subr.el b/lisp/subr.el
index 9aa895b0e94..b49a20e7f6e 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -888,8 +888,8 @@ The elements of the list may include `meta', `control',
888and `down'. 888and `down'.
889EVENT may be an event or an event type. If EVENT is a symbol 889EVENT may be an event or an event type. If EVENT is a symbol
890that has never been used in an event that has been read as input 890that has never been used in an event that has been read as input
891in the current Emacs session, then this function can return nil, 891in the current Emacs session, then this function may fail to include
892even when EVENT actually has modifiers." 892the `click' modifier."
893 (let ((type event)) 893 (let ((type event))
894 (if (listp type) 894 (if (listp type)
895 (setq type (car type))) 895 (setq type (car type)))
diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el
index 67f86dd364c..46b95130ca0 100644
--- a/lisp/vc/pcvs-defs.el
+++ b/lisp/vc/pcvs-defs.el
@@ -183,7 +183,7 @@ If set to nil, `cvs-mode-add' will always prompt for a message."
183 183
184(defcustom cvs-find-file-and-jump nil 184(defcustom cvs-find-file-and-jump nil
185 "Jump to the modified area when finding a file. 185 "Jump to the modified area when finding a file.
186If non-nil, `cvs-mode-file-file' will place the cursor at the beginning of 186If non-nil, `cvs-mode-find-file' will place the cursor at the beginning of
187the modified area. If the file is not locally modified, this will obviously 187the modified area. If the file is not locally modified, this will obviously
188have no effect." 188have no effect."
189 :group 'pcl-cvs 189 :group 'pcl-cvs
diff --git a/src/ChangeLog b/src/ChangeLog
index e6c58903f03..b38c11ace93 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -104,6 +104,20 @@
104 104
105 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF. 105 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
106 106
1072011-08-30 Eli Zaretskii <eliz@gnu.org>
108
109 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
110
111 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
112 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
113 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
114
115 * term.c (tty_append_glyph): New function.
116 (produce_stretch_glyph): Static function and its prototype deleted.
117
118 * dispextern.h (produce_stretch_glyph, tty_append_glyph): Add
119 prototypes.
120
1072011-08-29 Paul Eggert <eggert@cs.ucla.edu> 1212011-08-29 Paul Eggert <eggert@cs.ucla.edu>
108 122
109 * image.c (parse_image_spec): Check for nonnegative, not for positive, 123 * image.c (parse_image_spec): Check for nonnegative, not for positive,
diff --git a/src/dispextern.h b/src/dispextern.h
index f0be8ec136b..831803f58f4 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3043,6 +3043,8 @@ extern EMACS_INT compute_display_string_pos (struct text_pos *,
3043 int, int *); 3043 int, int *);
3044extern EMACS_INT compute_display_string_end (EMACS_INT, 3044extern EMACS_INT compute_display_string_end (EMACS_INT,
3045 struct bidi_string_data *); 3045 struct bidi_string_data *);
3046extern void produce_stretch_glyph (struct it *);
3047
3046 3048
3047#ifdef HAVE_WINDOW_SYSTEM 3049#ifdef HAVE_WINDOW_SYSTEM
3048 3050
@@ -3337,6 +3339,7 @@ extern struct terminal *get_named_tty (const char *);
3337EXFUN (Ftty_type, 1); 3339EXFUN (Ftty_type, 1);
3338extern void create_tty_output (struct frame *); 3340extern void create_tty_output (struct frame *);
3339extern struct terminal *init_tty (const char *, const char *, int); 3341extern struct terminal *init_tty (const char *, const char *, int);
3342extern void tty_append_glyph (struct it *);
3340 3343
3341 3344
3342/* Defined in scroll.c */ 3345/* Defined in scroll.c */
diff --git a/src/image.c b/src/image.c
index d6bfc4050ca..c5dcbb32e5d 100644
--- a/src/image.c
+++ b/src/image.c
@@ -196,7 +196,8 @@ x_bitmap_width (FRAME_PTR f, ptrdiff_t id)
196int 196int
197x_bitmap_pixmap (FRAME_PTR f, ptrdiff_t id) 197x_bitmap_pixmap (FRAME_PTR f, ptrdiff_t id)
198{ 198{
199 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; 199 /* HAVE_NTGUI needs the explicit cast here. */
200 return (int) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap;
200} 201}
201#endif 202#endif
202 203
diff --git a/src/term.c b/src/term.c
index fb07fc4490e..10416090b80 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1440,7 +1440,6 @@ term_get_fkeys_1 (void)
1440 Character Display Information 1440 Character Display Information
1441 ***********************************************************************/ 1441 ***********************************************************************/
1442static void append_glyph (struct it *); 1442static void append_glyph (struct it *);
1443static void produce_stretch_glyph (struct it *);
1444static void append_composite_glyph (struct it *); 1443static void append_composite_glyph (struct it *);
1445static void produce_composite_glyph (struct it *); 1444static void produce_composite_glyph (struct it *);
1446static void append_glyphless_glyph (struct it *, int, const char *); 1445static void append_glyphless_glyph (struct it *, int, const char *);
@@ -1512,6 +1511,14 @@ append_glyph (struct it *it)
1512 } 1511 }
1513} 1512}
1514 1513
1514/* For external use. */
1515void
1516tty_append_glyph (struct it *it)
1517{
1518 append_glyph (it);
1519}
1520
1521
1515/* Produce glyphs for the display element described by IT. *IT 1522/* Produce glyphs for the display element described by IT. *IT
1516 specifies what we want to produce a glyph for (character, image, ...), 1523 specifies what we want to produce a glyph for (character, image, ...),
1517 and where in the glyph matrix we currently are (glyph row and hpos). 1524 and where in the glyph matrix we currently are (glyph row and hpos).
@@ -1638,83 +1645,6 @@ produce_glyphs (struct it *it)
1638 it->descent = it->max_descent = it->phys_descent = it->max_phys_descent = 1; 1645 it->descent = it->max_descent = it->phys_descent = it->max_phys_descent = 1;
1639} 1646}
1640 1647
1641
1642/* Produce a stretch glyph for iterator IT. IT->object is the value
1643 of the glyph property displayed. The value must be a list
1644 `(space KEYWORD VALUE ...)' with the following KEYWORD/VALUE pairs
1645 being recognized:
1646
1647 1. `:width WIDTH' specifies that the space should be WIDTH *
1648 canonical char width wide. WIDTH may be an integer or floating
1649 point number.
1650
1651 2. `:align-to HPOS' specifies that the space should be wide enough
1652 to reach HPOS, a value in canonical character units. */
1653
1654static void
1655produce_stretch_glyph (struct it *it)
1656{
1657 /* (space :width WIDTH ...) */
1658 Lisp_Object prop, plist;
1659 int width = 0, align_to = -1;
1660 int zero_width_ok_p = 0;
1661 double tem;
1662
1663 /* List should start with `space'. */
1664 xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
1665 plist = XCDR (it->object);
1666
1667 /* Compute the width of the stretch. */
1668 if ((prop = Fplist_get (plist, QCwidth), !NILP (prop))
1669 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, 0))
1670 {
1671 /* Absolute width `:width WIDTH' specified and valid. */
1672 zero_width_ok_p = 1;
1673 width = (int)(tem + 0.5);
1674 }
1675 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))
1676 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, &align_to))
1677 {
1678 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
1679 align_to = (align_to < 0
1680 ? 0
1681 : align_to - window_box_left_offset (it->w, TEXT_AREA));
1682 else if (align_to < 0)
1683 align_to = window_box_left_offset (it->w, TEXT_AREA);
1684 width = max (0, (int)(tem + 0.5) + align_to - it->current_x);
1685 zero_width_ok_p = 1;
1686 }
1687 else
1688 /* Nothing specified -> width defaults to canonical char width. */
1689 width = FRAME_COLUMN_WIDTH (it->f);
1690
1691 if (width <= 0 && (width < 0 || !zero_width_ok_p))
1692 width = 1;
1693
1694 if (width > 0 && it->line_wrap != TRUNCATE
1695 && it->current_x + width > it->last_visible_x)
1696 width = it->last_visible_x - it->current_x - 1;
1697
1698 if (width > 0 && it->glyph_row)
1699 {
1700 Lisp_Object o_object = it->object;
1701 Lisp_Object object = it->stack[it->sp - 1].string;
1702 int n = width;
1703
1704 if (!STRINGP (object))
1705 object = it->w->buffer;
1706 it->object = object;
1707 it->char_to_display = ' ';
1708 it->pixel_width = it->len = 1;
1709 while (n--)
1710 append_glyph (it);
1711 it->object = o_object;
1712 }
1713 it->pixel_width = width;
1714 it->nglyphs = width;
1715}
1716
1717
1718/* Append glyphs to IT's glyph_row for the composition IT->cmp_id. 1648/* Append glyphs to IT's glyph_row for the composition IT->cmp_id.
1719 Called from produce_composite_glyph for terminal frames if 1649 Called from produce_composite_glyph for terminal frames if
1720 IT->glyph_row != NULL. IT->face_id contains the character's 1650 IT->glyph_row != NULL. IT->face_id contains the character's
diff --git a/src/xdisp.c b/src/xdisp.c
index 2afc8fc9af1..1716cc82188 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23086,6 +23086,7 @@ append_stretch_glyph (struct it *it, Lisp_Object object,
23086 IT_EXPAND_MATRIX_WIDTH (it, area); 23086 IT_EXPAND_MATRIX_WIDTH (it, area);
23087} 23087}
23088 23088
23089#endif /* HAVE_WINDOW_SYSTEM */
23089 23090
23090/* Produce a stretch glyph for iterator IT. IT->object is the value 23091/* Produce a stretch glyph for iterator IT. IT->object is the value
23091 of the glyph property displayed. The value must be a list 23092 of the glyph property displayed. The value must be a list
@@ -23118,19 +23119,28 @@ append_stretch_glyph (struct it *it, Lisp_Object object,
23118 of the stretch should be used for the ascent of the stretch. 23119 of the stretch should be used for the ascent of the stretch.
23119 ASCENT must be in the range 0 <= ASCENT <= 100. */ 23120 ASCENT must be in the range 0 <= ASCENT <= 100. */
23120 23121
23121static void 23122void
23122produce_stretch_glyph (struct it *it) 23123produce_stretch_glyph (struct it *it)
23123{ 23124{
23124 /* (space :width WIDTH :height HEIGHT ...) */ 23125 /* (space :width WIDTH :height HEIGHT ...) */
23125 Lisp_Object prop, plist; 23126 Lisp_Object prop, plist;
23126 int width = 0, height = 0, align_to = -1; 23127 int width = 0, height = 0, align_to = -1;
23127 int zero_width_ok_p = 0, zero_height_ok_p = 0; 23128 int zero_width_ok_p = 0;
23128 int ascent = 0; 23129 int ascent = 0;
23129 double tem; 23130 double tem;
23130 struct face *face = FACE_FROM_ID (it->f, it->face_id); 23131 struct face *face = NULL;
23131 struct font *font = face->font ? face->font : FRAME_FONT (it->f); 23132 struct font *font = NULL;
23132 23133
23133 PREPARE_FACE_FOR_DISPLAY (it->f, face); 23134#ifdef HAVE_WINDOW_SYSTEM
23135 int zero_height_ok_p = 0;
23136
23137 if (FRAME_WINDOW_P (it->f))
23138 {
23139 face = FACE_FROM_ID (it->f, it->face_id);
23140 font = face->font ? face->font : FRAME_FONT (it->f);
23141 PREPARE_FACE_FOR_DISPLAY (it->f, face);
23142 }
23143#endif
23134 23144
23135 /* List should start with `space'. */ 23145 /* List should start with `space'. */
23136 xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace)); 23146 xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
@@ -23144,8 +23154,9 @@ produce_stretch_glyph (struct it *it)
23144 zero_width_ok_p = 1; 23154 zero_width_ok_p = 1;
23145 width = (int)tem; 23155 width = (int)tem;
23146 } 23156 }
23147 else if (prop = Fplist_get (plist, QCrelative_width), 23157#ifdef HAVE_WINDOW_SYSTEM
23148 NUMVAL (prop) > 0) 23158 else if (FRAME_WINDOW_P (it->f)
23159 && (prop = Fplist_get (plist, QCrelative_width), NUMVAL (prop) > 0))
23149 { 23160 {
23150 /* Relative width `:relative-width FACTOR' specified and valid. 23161 /* Relative width `:relative-width FACTOR' specified and valid.
23151 Compute the width of the characters having the `glyph' 23162 Compute the width of the characters having the `glyph'
@@ -23168,6 +23179,7 @@ produce_stretch_glyph (struct it *it)
23168 x_produce_glyphs (&it2); 23179 x_produce_glyphs (&it2);
23169 width = NUMVAL (prop) * it2.pixel_width; 23180 width = NUMVAL (prop) * it2.pixel_width;
23170 } 23181 }
23182#endif /* HAVE_WINDOW_SYSTEM */
23171 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop)) 23183 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))
23172 && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to)) 23184 && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to))
23173 { 23185 {
@@ -23187,33 +23199,40 @@ produce_stretch_glyph (struct it *it)
23187 if (width <= 0 && (width < 0 || !zero_width_ok_p)) 23199 if (width <= 0 && (width < 0 || !zero_width_ok_p))
23188 width = 1; 23200 width = 1;
23189 23201
23202#ifdef HAVE_WINDOW_SYSTEM
23190 /* Compute height. */ 23203 /* Compute height. */
23191 if ((prop = Fplist_get (plist, QCheight), !NILP (prop)) 23204 if (FRAME_WINDOW_P (it->f))
23192 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
23193 { 23205 {
23194 height = (int)tem; 23206 if ((prop = Fplist_get (plist, QCheight), !NILP (prop))
23195 zero_height_ok_p = 1; 23207 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
23196 } 23208 {
23197 else if (prop = Fplist_get (plist, QCrelative_height), 23209 height = (int)tem;
23198 NUMVAL (prop) > 0) 23210 zero_height_ok_p = 1;
23199 height = FONT_HEIGHT (font) * NUMVAL (prop); 23211 }
23200 else 23212 else if (prop = Fplist_get (plist, QCrelative_height),
23201 height = FONT_HEIGHT (font); 23213 NUMVAL (prop) > 0)
23214 height = FONT_HEIGHT (font) * NUMVAL (prop);
23215 else
23216 height = FONT_HEIGHT (font);
23202 23217
23203 if (height <= 0 && (height < 0 || !zero_height_ok_p)) 23218 if (height <= 0 && (height < 0 || !zero_height_ok_p))
23204 height = 1; 23219 height = 1;
23205 23220
23206 /* Compute percentage of height used for ascent. If 23221 /* Compute percentage of height used for ascent. If
23207 `:ascent ASCENT' is present and valid, use that. Otherwise, 23222 `:ascent ASCENT' is present and valid, use that. Otherwise,
23208 derive the ascent from the font in use. */ 23223 derive the ascent from the font in use. */
23209 if (prop = Fplist_get (plist, QCascent), 23224 if (prop = Fplist_get (plist, QCascent),
23210 NUMVAL (prop) > 0 && NUMVAL (prop) <= 100) 23225 NUMVAL (prop) > 0 && NUMVAL (prop) <= 100)
23211 ascent = height * NUMVAL (prop) / 100.0; 23226 ascent = height * NUMVAL (prop) / 100.0;
23212 else if (!NILP (prop) 23227 else if (!NILP (prop)
23213 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0)) 23228 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
23214 ascent = min (max (0, (int)tem), height); 23229 ascent = min (max (0, (int)tem), height);
23230 else
23231 ascent = (height * FONT_BASE (font)) / FONT_HEIGHT (font);
23232 }
23215 else 23233 else
23216 ascent = (height * FONT_BASE (font)) / FONT_HEIGHT (font); 23234#endif /* HAVE_WINDOW_SYSTEM */
23235 height = 1;
23217 23236
23218 if (width > 0 && it->line_wrap != TRUNCATE 23237 if (width > 0 && it->line_wrap != TRUNCATE
23219 && it->current_x + width > it->last_visible_x) 23238 && it->current_x + width > it->last_visible_x)
@@ -23221,20 +23240,37 @@ produce_stretch_glyph (struct it *it)
23221 23240
23222 if (width > 0 && height > 0 && it->glyph_row) 23241 if (width > 0 && height > 0 && it->glyph_row)
23223 { 23242 {
23243 Lisp_Object o_object = it->object;
23224 Lisp_Object object = it->stack[it->sp - 1].string; 23244 Lisp_Object object = it->stack[it->sp - 1].string;
23245 int n = width;
23246
23225 if (!STRINGP (object)) 23247 if (!STRINGP (object))
23226 object = it->w->buffer; 23248 object = it->w->buffer;
23227 append_stretch_glyph (it, object, width, height, ascent); 23249#ifdef HAVE_WINDOW_SYSTEM
23250 if (FRAME_WINDOW_P (it->f))
23251 {
23252 append_stretch_glyph (it, object, width, height, ascent);
23253 it->ascent = it->phys_ascent = ascent;
23254 it->descent = it->phys_descent = height - it->ascent;
23255 it->nglyphs = width > 0 && height > 0 ? 1 : 0;
23256 take_vertical_position_into_account (it);
23257 }
23258 else
23259#endif
23260 {
23261 it->object = object;
23262 it->char_to_display = ' ';
23263 it->pixel_width = it->len = 1;
23264 while (n--)
23265 tty_append_glyph (it);
23266 it->object = o_object;
23267 it->pixel_width = width;
23268 }
23228 } 23269 }
23229
23230 it->pixel_width = width;
23231 it->ascent = it->phys_ascent = ascent;
23232 it->descent = it->phys_descent = height - it->ascent;
23233 it->nglyphs = width > 0 && height > 0 ? 1 : 0;
23234
23235 take_vertical_position_into_account (it);
23236} 23270}
23237 23271
23272#ifdef HAVE_WINDOW_SYSTEM
23273
23238/* Calculate line-height and line-spacing properties. 23274/* Calculate line-height and line-spacing properties.
23239 An integer value specifies explicit pixel value. 23275 An integer value specifies explicit pixel value.
23240 A float value specifies relative value to current face height. 23276 A float value specifies relative value to current face height.