1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-28 10:56:36 +00:00

Merge from trunk.

This commit is contained in:
Paul Eggert 2011-07-29 14:14:19 -07:00
commit eacb6b4bfa
24 changed files with 356 additions and 116 deletions

View File

@ -1,4 +1,4 @@
2011-07-28 Paul Eggert <eggert@cs.ucla.edu> 2011-07-29 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, using build-aux to remove clutter (Bug#9169). Merge from gnulib, using build-aux to remove clutter (Bug#9169).
* m4/largefile.m4: New file, so that Emacs does not mess up when * m4/largefile.m4: New file, so that Emacs does not mess up when
@ -30,6 +30,11 @@
'configure'. 'configure'.
* make-dist: Adjust to new build-aux and build-aux/snippit dirs. * make-dist: Adjust to new build-aux and build-aux/snippit dirs.
2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
* configure.in (HAVE_RSVG): Allow use of -lrsvg-2 for any NextStep
build, not just GNUstep (Bug#9177).
2011-07-28 Paul Eggert <eggert@cs.ucla.edu> 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
Assume freestanding C89 headers, string.h, stdlib.h. Assume freestanding C89 headers, string.h, stdlib.h.

View File

@ -79,6 +79,11 @@ Michael Olson
doc/misc/erc.texi doc/misc/erc.texi
lisp/emacs-lisp/tq.el lisp/emacs-lisp/tq.el
Bastien Guerry
Org
lisp/org/*
doc/misc/org.texi
============================================================================== ==============================================================================
2. 2.
============================================================================== ==============================================================================

2
autogen/configure vendored
View File

@ -10240,7 +10240,7 @@ fi
### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified. ### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
HAVE_RSVG=no HAVE_RSVG=no
if test "${HAVE_X11}" = "yes" || test "${NS_IMPL_GNUSTEP}" = "yes"; then if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes"; then
if test "${with_rsvg}" != "no"; then if test "${with_rsvg}" != "no"; then
RSVG_REQUIRED=2.11.0 RSVG_REQUIRED=2.11.0
RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED" RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"

View File

@ -1821,7 +1821,7 @@ fi
### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified. ### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
HAVE_RSVG=no HAVE_RSVG=no
if test "${HAVE_X11}" = "yes" || test "${NS_IMPL_GNUSTEP}" = "yes"; then if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes"; then
if test "${with_rsvg}" != "no"; then if test "${with_rsvg}" != "no"; then
RSVG_REQUIRED=2.11.0 RSVG_REQUIRED=2.11.0
RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED" RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"

View File

@ -1,3 +1,8 @@
2011-07-28 Eli Zaretskii <eliz@gnu.org>
* mule.texi (Bidirectional Editing): Document the fact that
bidi-display-reordering is t by default.
2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org> 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
* help.texi (Misc Help): Mention `describe-prefix-bindings' * help.texi (Misc Help): Mention `describe-prefix-bindings'

View File

@ -1703,7 +1703,7 @@ Annex #9, for reordering of bidirectional text for display.
whether text in the buffer is reordered for display. If its value is whether text in the buffer is reordered for display. If its value is
non-@code{nil}, Emacs reorders characters that have right-to-left non-@code{nil}, Emacs reorders characters that have right-to-left
directionality when they are displayed. The default value is directionality when they are displayed. The default value is
@code{nil}. @code{t}.
Each paragraph of bidirectional text can have its own @dfn{base Each paragraph of bidirectional text can have its own @dfn{base
direction}, either right-to-left or left-to-right. (Paragraph direction}, either right-to-left or left-to-right. (Paragraph

View File

@ -1,3 +1,8 @@
2011-07-28 Eli Zaretskii <eliz@gnu.org>
* display.texi (Bidirectional Display): Document the fact that
bidi-display-reordering is t by default.
2011-07-23 Eli Zaretskii <eliz@gnu.org> 2011-07-23 Eli Zaretskii <eliz@gnu.org>
* display.texi (Bidirectional Display): New section. * display.texi (Bidirectional Display): New section.

View File

@ -6007,7 +6007,7 @@ a ``Full bidirectionality'' class implementation of the @acronym{UBA}.
whether text in the buffer is reordered for display. If its value is whether text in the buffer is reordered for display. If its value is
non-@code{nil}, Emacs reorders characters that have right-to-left non-@code{nil}, Emacs reorders characters that have right-to-left
directionality when they are displayed. The default value is directionality when they are displayed. The default value is
@code{nil}. Text in overlay strings (@pxref{Overlay @code{t}. Text in overlay strings (@pxref{Overlay
Properties,,before-string}), display strings (@pxref{Overlay Properties,,before-string}), display strings (@pxref{Overlay
Properties,,display}), and @code{display} text properties Properties,,display}), and @code{display} text properties
(@pxref{Display Property}) is also reordered if the buffer whose text (@pxref{Display Property}) is also reordered if the buffer whose text

View File

@ -1,3 +1,7 @@
2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
* NEWS: Document ## and #:.
2011-07-28 Carsten Dominik <carsten.dominik@gmail.com> 2011-07-28 Carsten Dominik <carsten.dominik@gmail.com>
* refcards/orgcard.tex: Document `org-copy-visible'. * refcards/orgcard.tex: Document `org-copy-visible'.

View File

@ -173,8 +173,11 @@ in your ~/.authinfo file instead.
See the node "Bidirectional Editing" in the Emacs Manual for some See the node "Bidirectional Editing" in the Emacs Manual for some
additional documentation. additional documentation.
To turn this on in any given buffer, set the buffer-local variable To turn this off in any given buffer, set the buffer-local variable
`bidi-display-reordering' to a non-nil value. The default is nil. `bidi-display-reordering' to a nil value. The default is t. For text
that includes no right-to-left characters, the result of reordering
looks exactly as it did in previous versions, i.e. there's no
reordering at all.
The buffer-local variable `bidi-paragraph-direction', if non-nil, The buffer-local variable `bidi-paragraph-direction', if non-nil,
forces each paragraph in the buffer to have its base direction forces each paragraph in the buffer to have its base direction
@ -1164,6 +1167,11 @@ as well as those in the -*- line.
** rx.el has a new `group-n' construct for explicitly numbered groups. ** rx.el has a new `group-n' construct for explicitly numbered groups.
** keymaps can inherit from multiple parents. ** keymaps can inherit from multiple parents.
** New reader macro ## which stands for the empty symbol.
This means that the empty symbol can now be read back. Also, #: by itself
(when not immediately followed by a possible symbol character) stands for
an empty uninterned symbol.
* Changes in Emacs 24.1 on non-free operating systems * Changes in Emacs 24.1 on non-free operating systems

View File

@ -1,3 +1,8 @@
2011-07-29 Daniel Dehennin <daniel.dehennin@baby-gnu.org>
* mm-decode.el (mm-dissect-buffer): Add a default content-disposition
in mm handle if none is specified.
2011-07-24 Andrew Cohen <cohen@andy.bu.edu> 2011-07-24 Andrew Cohen <cohen@andy.bu.edu>
* nnimap.el (nnimap-make-thread-query): Quote message-ids for gmail. * nnimap.el (nnimap-make-thread-query): Quote message-ids for gmail.

View File

@ -564,7 +564,13 @@ Postpone undisplaying of viewers for types in
(setq ct (mail-fetch-field "content-type") (setq ct (mail-fetch-field "content-type")
ctl (and ct (mail-header-parse-content-type ct)) ctl (and ct (mail-header-parse-content-type ct))
cte (mail-fetch-field "content-transfer-encoding") cte (mail-fetch-field "content-transfer-encoding")
cd (mail-fetch-field "content-disposition") cd (or (mail-fetch-field "content-disposition")
(when (and ctl
(eq 'mm-inline-text
(cadr (mm-assoc-string-match
mm-inline-media-tests
(car ctl)))))
"inline"))
;; Newlines in description should be stripped so as ;; Newlines in description should be stripped so as
;; not to break the MIME tag into two or more lines. ;; not to break the MIME tag into two or more lines.
description (message-fetch-field "content-description") description (message-fetch-field "content-description")

View File

@ -3293,9 +3293,10 @@
* org-capture.el (org-capture-fill-template): fix bug with the * org-capture.el (org-capture-fill-template): fix bug with the
display of interactive prompt in templates expansion. display of interactive prompt in templates expansion.
2011-07-28 Reiner Steib <reinersteib+gmane@imap.cc> 2011-07-28 Reiner Steib <reiner.steib@gmx.de>
* org-clock.el (org-clock-display): docstring fiw. * org-clock.el (org-clock-display): Document how to remove subtree
times.
2011-07-28 Eric Schulte <schulte.eric@gmail.com> 2011-07-28 Eric Schulte <schulte.eric@gmail.com>

View File

@ -1,9 +1,65 @@
2011-07-28 Paul Eggert <eggert@cs.ucla.edu> 2011-07-29 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169). * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
2011-07-28 Paul Eggert <eggert@cs.ucla.edu> 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
* image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
This is needed if max-image-size is a floating-point number.
2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
* print.c (print_object): Print empty symbol as ##.
* lread.c (read1): Read ## as empty symbol.
2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
* nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
setting frame foreground color (Bug#9175).
(x_set_background_color): Likewise.
* nsmenu.m (-setText): Size tooltip dimensions precisely to
contents (Bug#9176).
(EmacsTooltip -init): Remove bezels and add shadows to
tooltip windows.
* nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
or scroll bar (Bug#8470).
* nsfont.m (nsfont_open): Remove assignment to voffset and
unnecessary vars hshink, expand, hd, full_height, min_height.
(nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
* nsterm.h (nsfont_info): Remove voffset field.
2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
Implement strike-through and overline on NextStep (Bug#8863).
* nsfont.m (nsfont_open): Use underline position provided by font,
instead of hard-coded value of 2.
(nsfont_draw): Call ns_draw_text_decoration instead.
* nsterm.h: Add declaration for ns_draw_text_decoration.
* nsterm.m (ns_draw_text_decoration): New function for drawing
underline, overline, and strike-through.
(ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
ns_draw_text_decoration. Change treatment of cursor drawing to
accomodate underlining, etc.
2011-07-28 Eli Zaretskii <eliz@gnu.org>
* buffer.c (init_buffer_once): Set bidi-display-reordering to t by
default.
2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
Without this fix, if a signal arrives just after memory fills up,
'malloc' might be invoked reentrantly.
* image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1. * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
In other words, assume that every image size is allowed, on non-X In other words, assume that every image size is allowed, on non-X
hosts. This assumption is probably wrong, but it lets Emacs compile. hosts. This assumption is probably wrong, but it lets Emacs compile.

View File

@ -3282,12 +3282,16 @@ memory_full (size_t nbytes)
int enough_free_memory = 0; int enough_free_memory = 0;
if (SPARE_MEMORY < nbytes) if (SPARE_MEMORY < nbytes)
{ {
void *p = malloc (SPARE_MEMORY); void *p;
MALLOC_BLOCK_INPUT;
p = malloc (SPARE_MEMORY);
if (p) if (p)
{ {
free (p); free (p);
enough_free_memory = 1; enough_free_memory = 1;
} }
MALLOC_UNBLOCK_INPUT;
} }
if (! enough_free_memory) if (! enough_free_memory)

View File

@ -4926,7 +4926,7 @@ init_buffer_once (void)
BVAR (&buffer_defaults, truncate_lines) = Qnil; BVAR (&buffer_defaults, truncate_lines) = Qnil;
BVAR (&buffer_defaults, word_wrap) = Qnil; BVAR (&buffer_defaults, word_wrap) = Qnil;
BVAR (&buffer_defaults, ctl_arrow) = Qt; BVAR (&buffer_defaults, ctl_arrow) = Qt;
BVAR (&buffer_defaults, bidi_display_reordering) = Qnil; BVAR (&buffer_defaults, bidi_display_reordering) = Qt;
BVAR (&buffer_defaults, bidi_paragraph_direction) = Qnil; BVAR (&buffer_defaults, bidi_paragraph_direction) = Qnil;
BVAR (&buffer_defaults, cursor_type) = Qt; BVAR (&buffer_defaults, cursor_type) = Qt;
BVAR (&buffer_defaults, extra_line_spacing) = Qnil; BVAR (&buffer_defaults, extra_line_spacing) = Qnil;

View File

@ -1053,9 +1053,13 @@ check_image_size (struct frame *f, int width, int height)
&& height <= XINT (Vmax_image_size)); && height <= XINT (Vmax_image_size));
else if (FLOATP (Vmax_image_size)) else if (FLOATP (Vmax_image_size))
{ {
xassert (f); if (f != NULL)
w = FRAME_PIXEL_WIDTH (f); {
h = FRAME_PIXEL_HEIGHT (f); w = FRAME_PIXEL_WIDTH (f);
h = FRAME_PIXEL_HEIGHT (f);
}
else
w = h = 1024; /* Arbitrary size for unknown frame. */
return (width <= XFLOAT_DATA (Vmax_image_size) * w return (width <= XFLOAT_DATA (Vmax_image_size) * w
&& height <= XFLOAT_DATA (Vmax_image_size) * h); && height <= XFLOAT_DATA (Vmax_image_size) * h);
} }

View File

@ -2670,6 +2670,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
} }
goto read_symbol; goto read_symbol;
} }
/* ## is the empty symbol. */
if (c == '#')
return Fintern (build_string (""), Qnil);
/* Reader forms that can reuse previously read objects. */ /* Reader forms that can reuse previously read objects. */
if (c >= '0' && c <= '9') if (c >= '0' && c <= '9')
{ {

View File

@ -321,6 +321,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{ {
NSColor *col; NSColor *col;
CGFloat r, g, b, alpha;
if (ns_lisp_to_color (arg, &col)) if (ns_lisp_to_color (arg, &col))
{ {
@ -332,6 +333,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
[f->output_data.ns->foreground_color release]; [f->output_data.ns->foreground_color release];
f->output_data.ns->foreground_color = col; f->output_data.ns->foreground_color = col;
[col getRed: &r green: &g blue: &b alpha: &alpha];
FRAME_FOREGROUND_PIXEL (f) =
ARGB_TO_ULONG ((int)(alpha*0xff), (int)(r*0xff), (int)(g*0xff), (int)(b*0xff));
if (FRAME_NS_VIEW (f)) if (FRAME_NS_VIEW (f))
{ {
update_face_from_frame_parameter (f, Qforeground_color, arg); update_face_from_frame_parameter (f, Qforeground_color, arg);
@ -348,7 +353,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
struct face *face; struct face *face;
NSColor *col; NSColor *col;
NSView *view = FRAME_NS_VIEW (f); NSView *view = FRAME_NS_VIEW (f);
float alpha; CGFloat r, g, b, alpha;
if (ns_lisp_to_color (arg, &col)) if (ns_lisp_to_color (arg, &col))
{ {
@ -364,10 +369,14 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
[col retain]; [col retain];
[f->output_data.ns->background_color release]; [f->output_data.ns->background_color release];
f->output_data.ns->background_color = col; f->output_data.ns->background_color = col;
[col getRed: &r green: &g blue: &b alpha: &alpha];
FRAME_BACKGROUND_PIXEL (f) =
ARGB_TO_ULONG ((int)(alpha*0xff), (int)(r*0xff), (int)(g*0xff), (int)(b*0xff));
if (view != nil) if (view != nil)
{ {
[[view window] setBackgroundColor: col]; [[view window] setBackgroundColor: col];
alpha = [col alphaComponent];
if (alpha != 1.0) if (alpha != 1.0)
[[view window] setOpaque: NO]; [[view window] setOpaque: NO];

View File

@ -804,8 +804,6 @@ when setting family in ns_spec_to_descriptor(). */
font->props[FONT_FILE_INDEX] = Qnil; font->props[FONT_FILE_INDEX] = Qnil;
{ {
double expand, hshrink;
float full_height, min_height, hd;
const char *fontName = [[nsfont fontName] UTF8String]; const char *fontName = [[nsfont fontName] UTF8String];
int len = strlen (fontName); int len = strlen (fontName);
@ -837,26 +835,16 @@ when setting family in ns_spec_to_descriptor(). */
[sfont maximumAdvancement].width : ns_char_width (sfont, '0'); [sfont maximumAdvancement].width : ns_char_width (sfont, '0');
brect = [sfont boundingRectForFont]; brect = [sfont boundingRectForFont];
full_height = brect.size.height;
min_height = [sfont ascender] - adjusted_descender;
hd = full_height - min_height;
/* standard height, similar to Carbon. Emacs.app: was 0.5 by default. */ font_info->underpos = [sfont underlinePosition];
expand = 0.0;
hshrink = 1.0;
font_info->underpos = 2; /*[sfont underlinePosition] is often clipped out */
font_info->underwidth = [sfont underlineThickness]; font_info->underwidth = [sfont underlineThickness];
font_info->size = font->pixel_size; font_info->size = font->pixel_size;
font_info->voffset = lrint (hshrink * [sfont ascender] + expand * hd / 2);
/* max bounds */ /* max bounds */
font_info->max_bounds.ascent = font_info->max_bounds.ascent = lrint ([sfont ascender]);
lrint (hshrink * [sfont ascender] + expand * hd/2);
/* Descender is usually negative. Use floor to avoid /* Descender is usually negative. Use floor to avoid
clipping descenders. */ clipping descenders. */
font_info->max_bounds.descent = font_info->max_bounds.descent = -lrint (floor(adjusted_descender));
-lrint (floor(hshrink* adjusted_descender - expand*hd/2));
font_info->height = font_info->height =
font_info->max_bounds.ascent + font_info->max_bounds.descent; font_info->max_bounds.ascent + font_info->max_bounds.descent;
font_info->max_bounds.width = lrint (font_info->width); font_info->max_bounds.width = lrint (font_info->width);
@ -1165,7 +1153,7 @@ WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
/* set up for character rendering */ /* set up for character rendering */
r.origin.y += font->voffset + (s->height - font->height)/2; r.origin.y = s->ybase;
col = (NS_FACE_FOREGROUND (face) != 0 col = (NS_FACE_FOREGROUND (face) != 0
? ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f) ? ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f)
@ -1196,20 +1184,7 @@ WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
/*[context GSSetTextDrawingMode: GSTextFill]; /// not implemented yet */ /*[context GSSetTextDrawingMode: GSTextFill]; /// not implemented yet */
} }
/* do underline */ [col set];
if (face->underline_p)
{
if (face->underline_color != 0)
[ns_lookup_indexed_color (face->underline_color, s->f) set];
else
[col set];
DPSmoveto (context, r.origin.x, r.origin.y + font->underpos);
DPSlineto (context, r.origin.x+r.size.width, r.origin.y+font->underpos);
if (face->underline_color != 0)
[col set];
}
else
[col set];
/* draw with DPSxshow () */ /* draw with DPSxshow () */
DPSmoveto (context, r.origin.x, r.origin.y); DPSmoveto (context, r.origin.x, r.origin.y);
@ -1255,23 +1230,7 @@ WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
CGContextSetTextDrawingMode (gcontext, kCGTextFill); CGContextSetTextDrawingMode (gcontext, kCGTextFill);
} }
if (face->underline_p) [col set];
{
if (face->underline_color != 0)
[ns_lookup_indexed_color (face->underline_color, s->f) set];
else
[col set];
CGContextBeginPath (gcontext);
CGContextMoveToPoint (gcontext,
r.origin.x, r.origin.y + font->underpos);
CGContextAddLineToPoint (gcontext, r.origin.x + r.size.width,
r.origin.y + font->underpos);
CGContextStrokePath (gcontext);
if (face->underline_color != 0)
[col set];
}
else
[col set];
CGContextSetTextPosition (gcontext, r.origin.x, r.origin.y); CGContextSetTextPosition (gcontext, r.origin.x, r.origin.y);
CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from, CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from,
@ -1287,6 +1246,10 @@ WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
CGContextRestoreGState (gcontext); CGContextRestoreGState (gcontext);
} }
#endif /* NS_IMPL_COCOA */ #endif /* NS_IMPL_COCOA */
/* Draw underline, overline, strike-through. */
ns_draw_text_decoration (s, face, col, r.size.width, r.origin.x);
return to-from; return to-from;
} }

View File

@ -1228,8 +1228,8 @@ @implementation EmacsTooltip
[textField setEditable: NO]; [textField setEditable: NO];
[textField setSelectable: NO]; [textField setSelectable: NO];
[textField setBordered: YES]; [textField setBordered: NO];
[textField setBezeled: YES]; [textField setBezeled: NO];
[textField setDrawsBackground: YES]; [textField setDrawsBackground: YES];
win = [[NSWindow alloc] win = [[NSWindow alloc]
@ -1237,6 +1237,7 @@ @implementation EmacsTooltip
styleMask: 0 styleMask: 0
backing: NSBackingStoreBuffered backing: NSBackingStoreBuffered
defer: YES]; defer: YES];
[win setHasShadow: YES];
[win setReleasedWhenClosed: NO]; [win setReleasedWhenClosed: NO];
[win setDelegate: self]; [win setDelegate: self];
[[win contentView] addSubview: textField]; [[win contentView] addSubview: textField];
@ -1257,17 +1258,15 @@ - (void) dealloc
- (void) setText: (char *)text - (void) setText: (char *)text
{ {
NSString *str = [NSString stringWithUTF8String: text]; NSString *str = [NSString stringWithUTF8String: text];
NSRect r = [textField frame]; NSRect r = [textField frame];
NSSize textSize = [str sizeWithAttributes: NSSize tooltipDims;
[NSDictionary dictionaryWithObject: [[textField font] screenFont]
forKey: NSFontAttributeName]];
NSSize padSize = [[[textField font] screenFont]
boundingRectForFont].size;
r.size.width = textSize.width + padSize.width/2;
r.size.height = textSize.height + padSize.height/2;
[textField setFrame: r];
[textField setStringValue: str]; [textField setStringValue: str];
tooltipDims = [[textField cell] cellSize];
r.size.width = tooltipDims.width;
r.size.height = tooltipDims.height;
[textField setFrame: r];
} }
- (void) showAtX: (int)x Y: (int)y for: (int)seconds - (void) showAtX: (int)x Y: (int)y for: (int)seconds

View File

@ -467,7 +467,6 @@ struct nsfont_info
#endif #endif
char bold, ital; /* convenience flags */ char bold, ital; /* convenience flags */
char synthItal; char synthItal;
float voffset; /* mean of ascender/descender offsets */
XCharStruct max_bounds; XCharStruct max_bounds;
/* we compute glyph codes and metrics on-demand in blocks of 256 indexed /* we compute glyph codes and metrics on-demand in blocks of 256 indexed
by hibyte, lobyte */ by hibyte, lobyte */
@ -825,6 +824,13 @@ extern unsigned long ns_get_rgb_color (struct frame *f,
float r, float g, float b, float a); float r, float g, float b, float a);
extern NSPoint last_mouse_motion_position; extern NSPoint last_mouse_motion_position;
/* From nsterm.m, needed in nsfont.m. */
#ifdef __OBJC__
extern void
ns_draw_text_decoration (struct glyph_string *s, struct face *face,
NSColor *defaultCol, CGFloat width, CGFloat x);
#endif
#ifdef NS_IMPL_GNUSTEP #ifdef NS_IMPL_GNUSTEP
extern char gnustep_base_version[]; /* version tracking */ extern char gnustep_base_version[]; /* version tracking */
#endif #endif

View File

@ -263,8 +263,6 @@ Updated by Christian Limpach (chris@nice.ch)
static void ns_judge_scroll_bars (struct frame *f); static void ns_judge_scroll_bars (struct frame *f);
void x_set_frame_alpha (struct frame *f); void x_set_frame_alpha (struct frame *f);
/* FIXME: figure out what to do with underline_minimum_offset. */
/* ========================================================================== /* ==========================================================================
@ -2597,6 +2595,107 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
return n; return n;
} }
void
ns_draw_text_decoration (struct glyph_string *s, struct face *face,
NSColor *defaultCol, CGFloat width, CGFloat x)
/* --------------------------------------------------------------------------
Draw underline, overline, and strike-through on glyph string s.
-------------------------------------------------------------------------- */
{
if (s->for_overlaps)
return;
/* Do underline. */
if (face->underline_p)
{
NSRect r;
unsigned long thickness, position;
/* If the prev was underlined, match its appearance. */
if (s->prev && s->prev->face->underline_p
&& s->prev->underline_thickness > 0)
{
thickness = s->prev->underline_thickness;
position = s->prev->underline_position;
}
else
{
struct font *font;
unsigned long descent;
font=s->font;
descent = s->y + s->height - s->ybase;
/* Use underline thickness of font, defaulting to 1. */
thickness = (font && font->underline_thickness > 0)
? font->underline_thickness : 1;
/* Determine the offset of underlining from the baseline. */
if (x_underline_at_descent_line)
position = descent - thickness;
else if (x_use_underline_position_properties
&& font && font->underline_position >= 0)
position = font->underline_position;
else if (font)
position = lround (font->descent / 2);
else
position = underline_minimum_offset;
position = max (position, underline_minimum_offset);
/* Ensure underlining is not cropped. */
if (descent <= position)
{
position = descent - 1;
thickness = 1;
}
else if (descent < position + thickness)
thickness = 1;
}
s->underline_thickness = thickness;
s->underline_position = position;
r = NSMakeRect (x, s->ybase + position, width, thickness);
if (face->underline_defaulted_p)
[defaultCol set];
else
[ns_lookup_indexed_color (face->underline_color, s->f) set];
NSRectFill (r);
}
/* Do overline. We follow other terms in using a thickness of 1
and ignoring overline_margin. */
if (face->overline_p)
{
NSRect r;
r = NSMakeRect (x, s->y, width, 1);
if (face->overline_color_defaulted_p)
[defaultCol set];
else
[ns_lookup_indexed_color (face->overline_color, s->f) set];
NSRectFill (r);
}
/* Do strike-through. We follow other terms for thickness and
vertical position.*/
if (face->strike_through_p)
{
NSRect r;
unsigned long dy;
dy = lrint ((s->height - 1) / 2);
r = NSMakeRect (x, s->y + dy, width, 1);
if (face->strike_through_color_defaulted_p)
[defaultCol set];
else
[ns_lookup_indexed_color (face->strike_through_color, s->f) set];
NSRectFill (r);
}
}
static void static void
ns_draw_box (NSRect r, float thickness, NSColor *col, char left_p, char right_p) ns_draw_box (NSRect r, float thickness, NSColor *col, char left_p, char right_p)
@ -2854,6 +2953,7 @@ Function modeled after x_draw_glyph_string_box ().
char raised_p; char raised_p;
NSRect br; NSRect br;
struct face *face; struct face *face;
NSColor *tdCol;
NSTRACE (ns_dumpglyphs_image); NSTRACE (ns_dumpglyphs_image);
@ -2882,10 +2982,7 @@ Function modeled after x_draw_glyph_string_box ().
else else
face = FACE_FROM_ID (s->f, s->first_glyph->face_id); face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
if (s->hl == DRAW_CURSOR) [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
[FRAME_CURSOR_COLOR (s->f) set];
else
[ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin
|| s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width)
@ -2923,6 +3020,27 @@ Function modeled after x_draw_glyph_string_box ().
[img compositeToPoint: NSMakePoint (x, y + s->slice.height) [img compositeToPoint: NSMakePoint (x, y + s->slice.height)
operation: NSCompositeSourceOver]; operation: NSCompositeSourceOver];
if (s->hl == DRAW_CURSOR)
{
[FRAME_CURSOR_COLOR (s->f) set];
if (s->w->phys_cursor_type == FILLED_BOX_CURSOR)
tdCol = ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f);
else
/* Currently on NS img->mask is always 0. Since
get_window_cursor_type specifies a hollow box cursor when on
a non-masked image we never reach this clause. But we put it
in in antipication of better support for image masks on
NS. */
tdCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f);
}
else
{
tdCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f);
}
/* Draw underline, overline, strike-through. */
ns_draw_text_decoration (s, face, tdCol, br.size.width, br.origin.x);
/* Draw relief, if requested */ /* Draw relief, if requested */
if (s->img->relief || s->hl ==DRAW_IMAGE_RAISED || s->hl ==DRAW_IMAGE_SUNKEN) if (s->img->relief || s->hl ==DRAW_IMAGE_RAISED || s->hl ==DRAW_IMAGE_SUNKEN)
{ {
@ -2967,22 +3085,49 @@ Function modeled after x_draw_glyph_string_box ().
NSRect r[2]; NSRect r[2];
int n, i; int n, i;
struct face *face; struct face *face;
NSColor *fgCol, *bgCol;
if (!s->background_filled_p) if (!s->background_filled_p)
{ {
n = ns_get_glyph_string_clip_rect (s, r); n = ns_get_glyph_string_clip_rect (s, r);
*r = NSMakeRect (s->x, s->y, s->background_width, s->height); *r = NSMakeRect (s->x, s->y, s->background_width, s->height);
ns_focus (s->f, r, n);
if (s->hl == DRAW_MOUSE_FACE)
{
face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
else
face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
bgCol = ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f);
fgCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f);
for (i=0; i<n; i++) for (i=0; i<n; i++)
{ {
if (!s->row->full_width_p) if (!s->row->full_width_p)
{ {
int overrun, leftoverrun;
/* truncate to avoid overwriting fringe and/or scrollbar */ /* truncate to avoid overwriting fringe and/or scrollbar */
int overrun = max (0, (s->x + s->background_width) overrun = max (0, (s->x + s->background_width)
- (WINDOW_BOX_RIGHT_EDGE_X (s->w) - (WINDOW_BOX_RIGHT_EDGE_X (s->w)
- WINDOW_RIGHT_FRINGE_WIDTH (s->w))); - WINDOW_RIGHT_FRINGE_WIDTH (s->w)));
r[i].size.width -= overrun; r[i].size.width -= overrun;
/* truncate to avoid overwriting to left of the window box */
leftoverrun = (WINDOW_BOX_LEFT_EDGE_X (s->w)
+ WINDOW_LEFT_FRINGE_WIDTH (s->w)) - s->x;
if (leftoverrun > 0)
{
r[i].origin.x += leftoverrun;
r[i].size.width -= leftoverrun;
}
/* XXX: Try to work between problem where a stretch glyph on /* XXX: Try to work between problem where a stretch glyph on
a partially-visible bottom row will clear part of the a partially-visible bottom row will clear part of the
modeline, and another where list-buffers headers and similar modeline, and another where list-buffers headers and similar
@ -2998,30 +3143,37 @@ Function modeled after x_draw_glyph_string_box ().
FRAME_PIXEL_WIDTH (s->f)); FRAME_PIXEL_WIDTH (s->f));
} }
[bgCol set];
/* NOTE: under NS this is NOT used to draw cursors, but we must avoid /* NOTE: under NS this is NOT used to draw cursors, but we must avoid
overwriting cursor (usually when cursor on a tab) */ overwriting cursor (usually when cursor on a tab) */
if (s->hl == DRAW_CURSOR) if (s->hl == DRAW_CURSOR)
{ {
r[i].origin.x += s->width; CGFloat x, width;
r[i].size.width -= s->width;
x = r[i].origin.x;
width = s->w->phys_cursor_width;
r[i].size.width -= width;
r[i].origin.x += width;
NSRectFill (r[i]);
/* Draw overlining, etc. on the cursor. */
if (s->w->phys_cursor_type == FILLED_BOX_CURSOR)
ns_draw_text_decoration (s, face, bgCol, width, x);
else
ns_draw_text_decoration (s, face, fgCol, width, x);
} }
else
{
NSRectFill (r[i]);
}
/* Draw overlining, etc. on the stretch glyph (or the part
of the stretch glyph after the cursor). */
ns_draw_text_decoration (s, face, fgCol, r[i].size.width,
r[i].origin.x);
} }
ns_focus (s->f, r, n);
if (s->hl == DRAW_MOUSE_FACE)
{
face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
else
face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
[ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
NSRectFill (r[0]);
NSRectFill (r[1]);
ns_unfocus (s->f); ns_unfocus (s->f);
s->background_filled_p = 1; s->background_filled_p = 1;
} }
@ -6556,23 +6708,17 @@ Convert an X font name (XLFD) to an NS font name.
Vx_toolkit_scroll_bars = Qnil; Vx_toolkit_scroll_bars = Qnil;
#endif #endif
/* these are unsupported but we need the declarations to avoid whining
messages from cus-start.el */
DEFVAR_BOOL ("x-use-underline-position-properties", DEFVAR_BOOL ("x-use-underline-position-properties",
x_use_underline_position_properties, x_use_underline_position_properties,
doc: /* NOT SUPPORTED UNDER NS. doc: /*Non-nil means make use of UNDERLINE_POSITION font properties.
*Non-nil means make use of UNDERLINE_POSITION font properties.
A value of nil means ignore them. If you encounter fonts with bogus A value of nil means ignore them. If you encounter fonts with bogus
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
to 4.1, set this to nil. to 4.1, set this to nil. */);
NOTE: Not supported on Mac yet. */);
x_use_underline_position_properties = 0; x_use_underline_position_properties = 0;
DEFVAR_BOOL ("x-underline-at-descent-line", DEFVAR_BOOL ("x-underline-at-descent-line",
x_underline_at_descent_line, x_underline_at_descent_line,
doc: /* NOT SUPPORTED UNDER NS. doc: /* Non-nil means to draw the underline at the same place as the descent line.
*Non-nil means to draw the underline at the same place as the descent line.
A value of nil means to draw the underline according to the value of the A value of nil means to draw the underline according to the value of the
variable `x-use-underline-position-properties', which is usually at the variable `x-use-underline-position-properties', which is usually at the
baseline level. The default value is nil. */); baseline level. The default value is nil. */);

View File

@ -1536,13 +1536,19 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
else else
confusing = 0; confusing = 0;
size_byte = SBYTES (name);
if (! NILP (Vprint_gensym) && !SYMBOL_INTERNED_P (obj)) if (! NILP (Vprint_gensym) && !SYMBOL_INTERNED_P (obj))
{ {
PRINTCHAR ('#'); PRINTCHAR ('#');
PRINTCHAR (':'); PRINTCHAR (':');
} }
else if (size_byte == 0)
size_byte = SBYTES (name); {
PRINTCHAR ('#');
PRINTCHAR ('#');
break;
}
for (i = 0, i_byte = 0; i_byte < size_byte;) for (i = 0, i_byte = 0; i_byte < size_byte;)
{ {
@ -1555,7 +1561,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
{ {
if (c == '\"' || c == '\\' || c == '\'' if (c == '\"' || c == '\\' || c == '\''
|| c == ';' || c == '#' || c == '(' || c == ')' || c == ';' || c == '#' || c == '(' || c == ')'
|| c == ',' || c =='.' || c == '`' || c == ',' || c == '.' || c == '`'
|| c == '[' || c == ']' || c == '?' || c <= 040 || c == '[' || c == ']' || c == '?' || c <= 040
|| confusing) || confusing)
PRINTCHAR ('\\'), confusing = 0; PRINTCHAR ('\\'), confusing = 0;