diff options
author | Miles Bader <miles@gnu.org> | 2007-04-24 21:56:25 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-04-24 21:56:25 +0000 |
commit | 991a760232de757d71d8dbbed47ee12d81e29d53 (patch) | |
tree | 2440730c37ae3f167a50f5c3ac5eaeab9b72b7b0 /src | |
parent | 0bb328f8f6fce06a7fc65670c7d5c011b613e1c5 (diff) | |
parent | 3851329262d6558d5e1a93157d44777d0a39e38e (diff) | |
download | emacs-991a760232de757d71d8dbbed47ee12d81e29d53.tar.gz emacs-991a760232de757d71d8dbbed47ee12d81e29d53.tar.bz2 emacs-991a760232de757d71d8dbbed47ee12d81e29d53.zip |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 698-710)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 216)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-196
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 83 | ||||
-rw-r--r-- | src/abbrev.c | 2 | ||||
-rw-r--r-- | src/alloc.c | 4 | ||||
-rw-r--r-- | src/buffer.c | 9 | ||||
-rw-r--r-- | src/dispnew.c | 35 | ||||
-rw-r--r-- | src/keymap.c | 3 | ||||
-rw-r--r-- | src/mac.c | 7 | ||||
-rw-r--r-- | src/macterm.c | 212 | ||||
-rw-r--r-- | src/minibuf.c | 10 | ||||
-rw-r--r-- | src/process.c | 14 | ||||
-rw-r--r-- | src/sysdep.c | 4 | ||||
-rw-r--r-- | src/xdisp.c | 62 |
12 files changed, 333 insertions, 112 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 61e6de2c97d..e3c660dbbab 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,86 @@ +2007-04-24 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (redisplay_window): Use BEG_UNCHANGED and END_UNCHANGED + values of the actual window. + +2007-04-23 Richard Stallman <rms@gnu.org> + + * process.c (Fstart_process): Doc fix. + +2007-04-23 Eli Zaretskii <eliz@gnu.org> + + * process.c (Fstart_process): Doc fix. + +2007-04-22 Richard Stallman <rms@gnu.org> + + * abbrev.c (Fdefine_abbrev): Doc fix. + + * keymap.c (Fdefine_key): Minor doc fix. + +2007-04-21 Glenn Morris <rgm@gnu.org> + + * keymap.c (Fdefine_key): Fix info ref in doc string. + +2007-04-20 Glenn Morris <rgm@gnu.org> + + * sysdep.c (init_system_name): Don't accept localhost.localdomain. + +2007-04-19 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Fminibuffer_contents, Fminibuffer_contents_no_properties) + (Fminibuffer_completion_contents, Fdelete_minibuffer_contents): + Doc fixes. + +2007-04-16 Chong Yidong <cyd@stupidchicken.com> + + * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Set + garbaged flag in presence of window margins. + (showing_window_margins_p): New function. + + * xdisp.c (cursor_row_p): Only end row on newline if it's a + display string. Suggested by Lennart Borgman. + +2007-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * alloc.c (mem_insert): Set min_heap_address and max_heap_address + if they are not yet initialized. + +2007-04-15 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (redisplay_window): When deciding whether or not to + recenter, don't use the reset values of BEG_UNCHANGED and + END_UNCHANGED. + +2007-04-13 Kim F. Storm <storm@cua.dk> + + * buffer.c (Fkill_buffer): gcpro BUF during kill_buffer_processes + and check that buffer is still alive upon return. + +2007-04-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [!TARGET_API_MAC_CARBON]: Include Displays.h. + (mac_screen_config_changed): New variable. + (mac_handle_dm_notification, init_dm_notification_handler) + (mac_get_screen_info): New functions. + [MAC_OS8] (main): Call init_dm_notification_handler. + (mac_initialize) [MAC_OSX]: Likewise. + (XTread_socket): Call mac_get_screen_info if screen config changed. + (mac_initialized): Make static. + (mac_initialize_display_info): Remove function. + (mac_term_init): Call mac_get_screen_info. Add partial contents of + mac_initialize_display_info. + +2007-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (xrm_get_preference_database, Fmac_get_preference) + [TARGET_API_MAC_CARBON]: Use CFPreferencesAppSynchronize. + + * macterm.c [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): + Use GetGlobalMouse instead of GetMouse and LocalToGlobal. + (mac_initialize_display_info) [MAC_OSX]: Use CGRectZero. + (mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and + dpyinfo->width are those of whole screen. + 2007-04-10 Chong Yidong <cyd@stupidchicken.com> * xdisp.c (note_mode_line_or_margin_highlight): Don't decrement diff --git a/src/abbrev.c b/src/abbrev.c index 8e9bd143089..cb8e334591c 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -110,7 +110,7 @@ DEFUN ("clear-abbrev-table", Fclear_abbrev_table, Sclear_abbrev_table, 1, 1, 0, DEFUN ("define-abbrev", Fdefine_abbrev, Sdefine_abbrev, 3, 6, 0, doc: /* Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK. -NAME must be a string. +NAME must be a string, and should be lower-case. EXPANSION should usually be a string. To undefine an abbrev, define it with EXPANSION = nil. If HOOK is non-nil, it should be a function of no arguments; diff --git a/src/alloc.c b/src/alloc.c index f847b4052b7..6c757567354 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3572,9 +3572,9 @@ mem_insert (start, end, type) { struct mem_node *c, *parent, *x; - if (start < min_heap_address) + if (min_heap_address == NULL || start < min_heap_address) min_heap_address = start; - if (end > max_heap_address) + if (max_heap_address == NULL || end > max_heap_address) max_heap_address = end; /* See where in the tree a node for START belongs. In this diff --git a/src/buffer.c b/src/buffer.c index 09166b17cfb..895bb2b32e8 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1459,7 +1459,16 @@ with SIGHUP. */) unlock_buffer (b); #endif /* CLASH_DETECTION */ + GCPRO1 (buf); kill_buffer_processes (buf); + UNGCPRO; + + /* Killing buffer processes may run sentinels which may + have called kill-buffer. */ + + if (NILP (b->name)) + return Qnil; + clear_charpos_cache (b); tem = Vinhibit_quit; diff --git a/src/dispnew.c b/src/dispnew.c index 313221f43f5..c3434c915f3 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -120,6 +120,7 @@ struct dim static struct glyph_matrix *save_current_matrix P_ ((struct frame *)); static void restore_current_matrix P_ ((struct frame *, struct glyph_matrix *)); +static int showing_window_margins_p P_ ((struct window *)); static void fake_current_matrices P_ ((Lisp_Object)); static void redraw_overlapping_rows P_ ((struct window *, int)); static void redraw_overlapped_rows P_ ((struct window *, int)); @@ -2164,6 +2165,33 @@ adjust_frame_glyphs (f) f->glyphs_initialized_p = 1; } +/* Return 1 if any window in the tree has nonzero window margins. See + the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */ +static int +showing_window_margins_p (w) + struct window *w; +{ + while (w) + { + if (!NILP (w->hchild)) + { + if (showing_window_margins_p (XWINDOW (w->hchild))) + return 1; + } + else if (!NILP (w->vchild)) + { + if (showing_window_margins_p (XWINDOW (w->vchild))) + return 1; + } + else if (!NILP (w->left_margin_cols) + || !NILP (w->right_margin_cols)) + return 1; + + w = NILP (w->next) ? 0 : XWINDOW (w->next); + } + return 0; +} + /* In the window tree with root W, build current matrices of leaf windows from the frame's current matrix. */ @@ -2351,7 +2379,12 @@ adjust_frame_glyphs_for_frame_redisplay (f) if (display_completed && !FRAME_GARBAGED_P (f) && matrix_dim.width == f->current_matrix->matrix_w - && matrix_dim.height == f->current_matrix->matrix_h) + && matrix_dim.height == f->current_matrix->matrix_h + /* For some reason, the frame glyph matrix gets corrupted if + any of the windows contain margins. I haven't been able + to hunt down the reason, but for the moment this prevents + the problem from manifesting. -- cyd */ + && !showing_window_margins_p (XWINDOW (FRAME_ROOT_WINDOW (f)))) { struct glyph_matrix *copy = save_current_matrix (f); adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim); diff --git a/src/keymap.c b/src/keymap.c index d953df008d7..4a5c53ca626 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1148,7 +1148,8 @@ DEF is anything that can be a key's definition: a cons (STRING . DEFN), meaning that DEFN is the definition (DEFN should be a valid definition in its own right), or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP, - or an extended menu item definition. (See info node `Extended Menu Items'.) + or an extended menu item definition. + (See info node `(elisp)Extended Menu Items'.) If KEYMAP is a sparse keymap with a binding for KEY, the existing binding is altered. If there is no binding for KEY, the new pair diff --git a/src/mac.c b/src/mac.c index 5084a02b27d..8e3f49d2bfe 100644 --- a/src/mac.c +++ b/src/mac.c @@ -1835,6 +1835,8 @@ xrm_get_preference_database (application) if (app_id == NULL) goto out; } + if (!CFPreferencesAppSynchronize (app_id)) + goto out; key_set = CFSetCreateMutable (NULL, 0, &kCFCopyStringSetCallBacks); if (key_set == NULL) @@ -4650,6 +4652,9 @@ otherwise. */) if (app_id == NULL) goto out; } + if (!CFPreferencesAppSynchronize (app_id)) + goto out; + key_str = cfstring_create_with_string (XCAR (key)); if (key_str == NULL) goto out; @@ -4986,7 +4991,7 @@ extern int noninteractive; 3. [If SELECT_USE_CFSOCKET is set] Only the window event channel and socket read/write channels are involved, and timeout is not too short (greater than - SELECT_TIMEOUT_THRESHHOLD_RUNLOOP seconds). + SELECT_TIMEOUT_THRESHOLD_RUNLOOP seconds). -> Create CFSocket for each socket and add it into the current event RunLoop so that the current event loop gets quit when the socket becomes ready. Then ReceiveNextEvent can wait for diff --git a/src/macterm.c b/src/macterm.c index 596d74cddd9..df0275fe22b 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -52,6 +52,7 @@ Boston, MA 02110-1301, USA. */ #include <LowMem.h> #include <Controls.h> #include <Windows.h> +#include <Displays.h> #if defined (__MRC__) || (__MSL__ >= 0x6000) #include <ControlDefinitions.h> #endif @@ -8890,6 +8891,9 @@ int mac_pass_control_to_system; Carbon/Apple event handlers. */ static struct input_event *read_socket_inev = NULL; +/* Whether or not the screen configuration has changed. */ +static int mac_screen_config_changed = 0; + Point saved_menu_event_location; /* Apple Events */ @@ -10420,6 +10424,87 @@ remove_window_handler (window) } +static pascal void +mac_handle_dm_notification (event) + AppleEvent *event; +{ + mac_screen_config_changed = 1; +} + +static OSErr +init_dm_notification_handler () +{ + OSErr err; + static DMNotificationUPP handle_dm_notificationUPP = NULL; + ProcessSerialNumber psn; + + if (handle_dm_notificationUPP == NULL) + handle_dm_notificationUPP = + NewDMNotificationUPP (mac_handle_dm_notification); + + err = GetCurrentProcess (&psn); + if (err == noErr) + err = DMRegisterNotifyProc (handle_dm_notificationUPP, &psn); + + return err; +} + +static void +mac_get_screen_info (dpyinfo) + struct mac_display_info *dpyinfo; +{ +#ifdef MAC_OSX + /* HasDepth returns true if it is possible to have a 32 bit display, + but this may not be what is actually used. Mac OSX can do better. */ + dpyinfo->color_p = CGDisplaySamplesPerPixel (kCGDirectMainDisplay) > 1; + dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay); + { + CGDisplayErr err; + CGDisplayCount ndisps; + CGDirectDisplayID *displays; + + err = CGGetActiveDisplayList (0, NULL, &ndisps); + if (err == noErr) + { + displays = alloca (sizeof (CGDirectDisplayID) * ndisps); + err = CGGetActiveDisplayList (ndisps, displays, &ndisps); + } + if (err == noErr) + { + CGRect bounds = CGRectZero; + + while (ndisps-- > 0) + bounds = CGRectUnion (bounds, CGDisplayBounds (displays[ndisps])); + dpyinfo->height = CGRectGetHeight (bounds); + dpyinfo->width = CGRectGetWidth (bounds); + } + else + { + dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay); + dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay); + } + } +#else /* !MAC_OSX */ + { + GDHandle gdh = GetMainDevice (); + Rect rect = (**gdh).gdRect; + + dpyinfo->color_p = TestDeviceAttribute (gdh, gdDevType); + for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) + if (HasDepth (gdh, dpyinfo->n_planes, gdDevType, dpyinfo->color_p)) + break; + + for (gdh = DMGetFirstScreenDevice (dmOnlyActiveDisplays); gdh; + gdh = DMGetNextScreenDevice (gdh, dmOnlyActiveDisplays)) + UnionRect (&rect, &(**gdh).gdRect, &rect); + + dpyinfo->height = rect.bottom - rect.top; + dpyinfo->width = rect.right - rect.left; + } +#endif /* !MAC_OSX */ +} + + #if __profile__ void profiler_exit_proc () @@ -10477,6 +10562,8 @@ main (void) init_apple_event_handler (); + init_dm_notification_handler (); + { char **argv; int argc = 0; @@ -10554,8 +10641,7 @@ mac_post_mouse_moved_event () { Point mouse_pos; - GetMouse (&mouse_pos); - LocalToGlobal (&mouse_pos); + GetGlobalMouse (&mouse_pos); err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint, sizeof (Point), &mouse_pos); } @@ -11375,6 +11461,12 @@ XTread_socket (sd, expected, hold_quit) pending_autoraise_frame = 0; } + if (mac_screen_config_changed) + { + mac_get_screen_info (dpyinfo); + mac_screen_config_changed = 0; + } + #if !USE_CARBON_EVENTS /* Check which frames are still visible. We do this here because there doesn't seem to be any direct notification from the Window @@ -11509,86 +11601,7 @@ make_mac_terminal_frame (struct frame *f) Initialization ***********************************************************************/ -int mac_initialized = 0; - -void -mac_initialize_display_info () -{ - struct mac_display_info *dpyinfo = &one_mac_display_info; - - bzero (dpyinfo, sizeof (*dpyinfo)); - -#ifdef MAC_OSX - dpyinfo->mac_id_name - = (char *) xmalloc (SCHARS (Vinvocation_name) - + SCHARS (Vsystem_name) - + 2); - sprintf (dpyinfo->mac_id_name, "%s@%s", - SDATA (Vinvocation_name), SDATA (Vsystem_name)); -#else - dpyinfo->mac_id_name = (char *) xmalloc (strlen ("Mac Display") + 1); - strcpy (dpyinfo->mac_id_name, "Mac Display"); -#endif - - dpyinfo->reference_count = 0; - dpyinfo->resx = 72.0; - dpyinfo->resy = 72.0; -#ifdef MAC_OSX - /* HasDepth returns true if it is possible to have a 32 bit display, - but this may not be what is actually used. Mac OSX can do better. */ - dpyinfo->color_p = CGDisplaySamplesPerPixel (kCGDirectMainDisplay) > 1; - dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay); - { - CGDisplayErr err; - CGDisplayCount ndisps; - CGDirectDisplayID *displays; - - err = CGGetActiveDisplayList (0, NULL, &ndisps); - if (err == noErr) - { - displays = alloca (sizeof (CGDirectDisplayID) * ndisps); - err = CGGetActiveDisplayList (ndisps, displays, &ndisps); - } - if (err == noErr) - { - CGRect bounds = CGRectMake (0, 0, 0, 0); - - while (ndisps-- > 0) - bounds = CGRectUnion (bounds, CGDisplayBounds (displays[ndisps])); - dpyinfo->height = CGRectGetHeight (bounds); - dpyinfo->width = CGRectGetWidth (bounds); - } - else - { - dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay); - dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay); - } - } -#else - { - GDHandle main_device_handle = LMGetMainDevice(); - - dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); - for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) - if (HasDepth (main_device_handle, dpyinfo->n_planes, - gdDevType, dpyinfo->color_p)) - break; - dpyinfo->height = (**main_device_handle).gdRect.bottom; - dpyinfo->width = (**main_device_handle).gdRect.right; - } -#endif - dpyinfo->grabbed = 0; - dpyinfo->root_window = NULL; - dpyinfo->image_cache = make_image_cache (); - - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; - dpyinfo->mouse_face_window = Qnil; - dpyinfo->mouse_face_overlay = Qnil; - dpyinfo->mouse_face_hidden = 0; -} - +static int mac_initialized = 0; static XrmDatabase mac_make_rdb (xrm_option) @@ -11622,9 +11635,37 @@ mac_term_init (display_name, xrm_option, resource_name) if (x_display_list) error ("Sorry, this version can only handle one display"); - mac_initialize_display_info (); - dpyinfo = &one_mac_display_info; + bzero (dpyinfo, sizeof (*dpyinfo)); + +#ifdef MAC_OSX + dpyinfo->mac_id_name + = (char *) xmalloc (SCHARS (Vinvocation_name) + + SCHARS (Vsystem_name) + + 2); + sprintf (dpyinfo->mac_id_name, "%s@%s", + SDATA (Vinvocation_name), SDATA (Vsystem_name)); +#else + dpyinfo->mac_id_name = (char *) xmalloc (strlen ("Mac Display") + 1); + strcpy (dpyinfo->mac_id_name, "Mac Display"); +#endif + + dpyinfo->reference_count = 0; + dpyinfo->resx = 72.0; + dpyinfo->resy = 72.0; + + mac_get_screen_info (dpyinfo); + + dpyinfo->grabbed = 0; + dpyinfo->root_window = NULL; + dpyinfo->image_cache = make_image_cache (); + + dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; + dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; + dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; + dpyinfo->mouse_face_window = Qnil; + dpyinfo->mouse_face_overlay = Qnil; + dpyinfo->mouse_face_hidden = 0; dpyinfo->xrdb = mac_make_rdb (xrm_option); @@ -11642,6 +11683,7 @@ mac_term_init (display_name, xrm_option, resource_name) return dpyinfo; } + /* Get rid of display DPYINFO, assuming all frames are already gone. */ void @@ -11861,6 +11903,8 @@ mac_initialize () init_apple_event_handler (); + init_dm_notification_handler (); + if (!inhibit_window_system) { static const ProcessSerialNumber psn = {0, kCurrentProcess}; diff --git a/src/minibuf.c b/src/minibuf.c index 50f48c2344f..6c6fa7451fc 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -386,7 +386,7 @@ Return (point-min) if current buffer is not a minibuffer. */) DEFUN ("minibuffer-contents", Fminibuffer_contents, Sminibuffer_contents, 0, 0, 0, doc: /* Return the user input in a minibuffer as a string. -The current buffer must be a minibuffer. */) +If the current buffer is not a minibuffer, return its entire contents. */) () { int prompt_end = XINT (Fminibuffer_prompt_end ()); @@ -396,7 +396,7 @@ The current buffer must be a minibuffer. */) DEFUN ("minibuffer-contents-no-properties", Fminibuffer_contents_no_properties, Sminibuffer_contents_no_properties, 0, 0, 0, doc: /* Return the user input in a minibuffer as a string, without text-properties. -The current buffer must be a minibuffer. */) +If the current buffer is not a minibuffer, return its entire contents. */) () { int prompt_end = XINT (Fminibuffer_prompt_end ()); @@ -407,7 +407,7 @@ DEFUN ("minibuffer-completion-contents", Fminibuffer_completion_contents, Sminibuffer_completion_contents, 0, 0, 0, doc: /* Return the user input in a minibuffer before point as a string. That is what completion commands operate on. -The current buffer must be a minibuffer. */) +If the current buffer is not a minibuffer, return its entire contents. */) () { int prompt_end = XINT (Fminibuffer_prompt_end ()); @@ -419,7 +419,7 @@ The current buffer must be a minibuffer. */) DEFUN ("delete-minibuffer-contents", Fdelete_minibuffer_contents, Sdelete_minibuffer_contents, 0, 0, 0, doc: /* Delete all user input in a minibuffer. -The current buffer must be a minibuffer. */) +If the current buffer is not a minibuffer, erase its entire contents. */) () { int prompt_end = XINT (Fminibuffer_prompt_end ()); @@ -704,7 +704,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, if (!NILP (current_buffer->enable_multibyte_characters) && ! STRING_MULTIBYTE (minibuf_prompt)) minibuf_prompt = Fstring_make_multibyte (minibuf_prompt); - + /* Insert the prompt, record where it ends. */ Finsert (1, &minibuf_prompt); if (PT > BEG) diff --git a/src/process.c b/src/process.c index 2e41267479c..567aae7c08f 100644 --- a/src/process.c +++ b/src/process.c @@ -1557,13 +1557,19 @@ DEFUN ("start-process", Fstart_process, Sstart_process, 3, MANY, 0, doc: /* Start a program in a subprocess. Return the process object for it. NAME is name for process. It is modified if necessary to make it unique. BUFFER is the buffer (or buffer name) to associate with the process. - Process output goes at end of that buffer, unless you specify - an output stream or filter function to handle the output. - BUFFER may be also nil, meaning that this process is not associated - with any buffer. + +Process output (both standard output and standard error streams) goes +at end of BUFFER, unless you specify an output stream or filter +function to handle the output. BUFFER may also be nil, meaning that +this process is not associated with any buffer. + PROGRAM is the program file name. It is searched for in PATH. Remaining arguments are strings to give program as arguments. +If you want to separate standard output from standard error, invoke +the command through a shell and redirect one of them using the shell +syntax. + usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) (nargs, args) int nargs; diff --git a/src/sysdep.c b/src/sysdep.c index 20d60400dcb..27e90349cb6 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2433,7 +2433,9 @@ init_system_name () /* We still don't have a fully qualified domain name. Try to find one in the list of alternate names */ char **alias = hp->h_aliases; - while (*alias && !index (*alias, '.')) + while (*alias + && (!index (*alias, '.') + || !strcmp (*alias, "localhost.localdomain"))) alias++; if (*alias) fqdn = *alias; diff --git a/src/xdisp.c b/src/xdisp.c index 5c273540c41..eb97ef110a9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12926,6 +12926,7 @@ redisplay_window (window, just_this_one_p) int rc; int centering_position = -1; int last_line_misfit = 0; + int save_beg_unchanged, save_end_unchanged; SET_TEXT_POS (lpoint, PT, PT_BYTE); opoint = lpoint; @@ -12990,6 +12991,9 @@ redisplay_window (window, just_this_one_p) set_buffer_internal_1 (XBUFFER (w->buffer)); SET_TEXT_POS (opoint, PT, PT_BYTE); + save_beg_unchanged = BEG_UNCHANGED; + save_end_unchanged = END_UNCHANGED; + current_matrix_up_to_date_p = (!NILP (w->window_end_valid) && !current_buffer->clip_changed @@ -13294,11 +13298,20 @@ redisplay_window (window, just_this_one_p) && NILP (do_mouse_tracking) && CHARPOS (startp) > BEGV) { - /* Make sure beg_unchanged and end_unchanged are up to date. - Do it only if buffer has really changed. This may or may - not have been done by try_window_id (see which) already. */ +#if 0 + /* The following code tried to make BEG_UNCHANGED and + END_UNCHANGED up to date (similar to try_window_id). + Is it important to do so? + + The trouble is that it's a little too strict when it + comes to overlays: modify_overlay can call + BUF_COMPUTE_UNCHANGED, which alters BUF_BEG_UNCHANGED and + BUF_END_UNCHANGED directly without moving the gap. + + This can result in spurious recentering when overlays are + altered in the buffer. So unless it's proven necessary, + let's leave this commented out for now. -- cyd. */ if (MODIFF > SAVE_MODIFF - /* This seems to happen sometimes after saving a buffer. */ || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE) { if (GPT - BEG < BEG_UNCHANGED) @@ -13306,9 +13319,10 @@ redisplay_window (window, just_this_one_p) if (Z - GPT < END_UNCHANGED) END_UNCHANGED = Z - GPT; } +#endif - if (CHARPOS (startp) > BEG + BEG_UNCHANGED - && CHARPOS (startp) <= Z - END_UNCHANGED) + if (CHARPOS (startp) > BEG + save_beg_unchanged + && CHARPOS (startp) <= Z - save_end_unchanged) { /* There doesn't seems to be a simple way to find a new window start that is near the old window start, so @@ -16002,13 +16016,37 @@ cursor_row_p (w, row) if (PT == MATRIX_ROW_END_CHARPOS (row)) { - /* If the row ends with a newline from a string, we don't want - the cursor there, but we still want it at the start of the - string if the string starts in this row. - If the row is continued it doesn't end in a newline. */ + /* Suppose the row ends on a string. + Unless the row is continued, that means it ends on a newline + in the string. If it's anything other than a display string + (e.g. a before-string from an overlay), we don't want the + cursor there. (This heuristic seems to give the optimal + behavior for the various types of multi-line strings.) */ if (CHARPOS (row->end.string_pos) >= 0) - cursor_row_p = (row->continued_p - || PT >= MATRIX_ROW_START_CHARPOS (row)); + { + if (row->continued_p) + cursor_row_p = 1; + else + { + /* Check for `display' property. */ + struct glyph *beg = row->glyphs[TEXT_AREA]; + struct glyph *end = beg + row->used[TEXT_AREA] - 1; + struct glyph *glyph; + + cursor_row_p = 0; + for (glyph = end; glyph >= beg; --glyph) + if (STRINGP (glyph->object)) + { + Lisp_Object prop + = Fget_char_property (make_number (PT), + Qdisplay, Qnil); + cursor_row_p = + (!NILP (prop) + && display_prop_string_p (prop, glyph->object)); + break; + } + } + } else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) { /* If the row ends in middle of a real character, |