------------------------------------------------------------ revno: 116261 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-02-04 18:25:52 +0200 message: src/w32fns.c (Fw32_shell_execute): Improve commentary. diff: === modified file 'src/w32fns.c' --- src/w32fns.c 2014-02-02 13:00:41 +0000 +++ src/w32fns.c 2014-02-04 16:25:52 +0000 @@ -6924,11 +6924,12 @@ #else /* !CYGWIN */ current_dir = ENCODE_FILE (current_dir); /* We have a situation here. If DOCUMENT is a relative file name, - and is not in CURRENT_DIR, ShellExecute below will fail to find - it. So we need to make the file name absolute. But DOCUMENT - does not have to be a file, it can be a URL, for example. So we - make it absolute only if it is an existing file; if it is a file - that does not exist, tough. */ + but its name includes leading directories, i.e. it lives not in + CURRENT_DIR, but in its subdirectory, then ShellExecute below + will fail to find it. So we need to make the file name is + absolute. But DOCUMENT does not have to be a file, it can be a + URL, for example. So we make it absolute only if it is an + existing file; if it is a file that does not exist, tough. */ GCPRO1 (absdoc); absdoc = Fexpand_file_name (document, Qnil); /* Don't call file handlers for file-exists-p, since they might ------------------------------------------------------------ revno: 116260 fixes bug: http://debbugs.gnu.org/16636 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-02-04 18:13:51 +0200 message: Fix bug #16636 with simple dialogs on MS-Windows. src/w32menu.c (w32_popup_dialog): Don't condition the whole function on HAVE_DIALOGS. If the dialog is "simple", pop up a message box to show it; otherwise return 'unsupported--w32-dialog' to signal to the caller that emulation with menus is necessary. This resurrects code inadvertently deleted by the 2013-10-08 commit. (syms_of_w32menu): DEFSYM Qunsupported__w32_dialog. src/w32term.h (w32_popup_dialog): Prototype is no longer conditioned by HAVE_DIALOGS. src/menu.c (Fx_popup_dialog): Don't condition the call to w32_popup_dialog on HAVE_DIALOGS. If w32_popup_dialog returns a special symbol 'unsupported--w32-dialog', emulate the dialog with a menu by calling x-popup-menu. src/menu.h (Qunsupported__w32_dialog): New extern variable. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-04 11:40:31 +0000 +++ src/ChangeLog 2014-02-04 16:13:51 +0000 @@ -1,3 +1,23 @@ +2014-02-04 Eli Zaretskii + + * w32menu.c (w32_popup_dialog): Don't condition the whole function + on HAVE_DIALOGS. If the dialog is "simple", pop up a message box + to show it; otherwise return 'unsupported--w32-dialog' to signal + to the caller that emulation with menus is necessary. This + resurrects code inadvertently deleted by the 2013-10-08 commit. + (Bug#16636) + (syms_of_w32menu): DEFSYM Qunsupported__w32_dialog. + + * w32term.h (w32_popup_dialog): Prototype is no longer conditioned + by HAVE_DIALOGS. + + * menu.c (Fx_popup_dialog): Don't condition the call to + w32_popup_dialog on HAVE_DIALOGS. If w32_popup_dialog returns a + special symbol 'unsupported--w32-dialog', emulate the dialog with + a menu by calling x-popup-menu. + + * menu.h (Qunsupported__w32_dialog): New extern variable. + 2014-02-04 Michael Albinus * keyboard.c (kbd_buffer_get_event): Read file notification events === modified file 'src/menu.c' --- src/menu.c 2014-01-17 11:55:00 +0000 +++ src/menu.c 2014-02-04 16:13:51 +0000 @@ -1566,9 +1566,15 @@ return xw_popup_dialog (f, header, contents); else #endif -#if defined (HAVE_NTGUI) && defined (HAVE_DIALOGS) +#if defined (HAVE_NTGUI) if (FRAME_W32_P (f)) - return w32_popup_dialog (f, header, contents); + { + Lisp_Object selection = w32_popup_dialog (f, header, contents); + + if (!EQ (selection, Qunsupported__w32_dialog)) + return selection; + goto dialog_via_menu; + } else #endif #ifdef HAVE_NS @@ -1582,6 +1588,8 @@ Lisp_Object x, y, frame, newpos, prompt; int x_coord, y_coord; + dialog_via_menu: + prompt = Fcar (contents); if (FRAME_WINDOW_P (f)) { === modified file 'src/menu.h' --- src/menu.h 2014-01-01 07:43:34 +0000 +++ src/menu.h 2014-02-04 16:13:51 +0000 @@ -21,6 +21,10 @@ #include "systime.h" /* for Time */ +#ifdef HAVE_NTGUI +extern Lisp_Object Qunsupported__w32_dialog; +#endif + extern void x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval); === modified file 'src/w32menu.c' --- src/w32menu.c 2014-01-01 07:43:34 +0000 +++ src/w32menu.c 2014-02-04 16:13:51 +0000 @@ -98,7 +98,7 @@ MessageBoxW_Proc unicode_message_box = NULL; #endif /* NTGUI_UNICODE */ -Lisp_Object Qdebug_on_next_call; +Lisp_Object Qdebug_on_next_call, Qunsupported__w32_dialog; void set_frame_menubar (struct frame *, bool, bool); @@ -114,34 +114,44 @@ void w32_free_menu_strings (HWND); -#ifdef HAVE_DIALOGS Lisp_Object w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) { - Lisp_Object title; - char *error_name; - Lisp_Object selection; check_window_system (f); - /* Decode the dialog items from what was specified. */ - title = Fcar (contents); - CHECK_STRING (title); - - list_of_panes (Fcons (contents, Qnil)); - - /* Display them in a dialog box. */ - block_input (); - selection = w32_dialog_show (f, 0, title, header, &error_name); - unblock_input (); - - discard_menu_items (); - FRAME_DISPLAY_INFO (f)->grabbed = 0; - - if (error_name) error (error_name); - return selection; -} +#ifndef HAVE_DIALOGS + + /* Handle simple Yes/No choices as MessageBox popups. */ + if (is_simple_dialog (contents)) + return simple_dialog_show (f, contents, header); + else + return Qunsupported__w32_dialog; +#else /* HAVE_DIALOGS */ + { + Lisp_Object title; + char *error_name; + Lisp_Object selection; + + /* Decode the dialog items from what was specified. */ + title = Fcar (contents); + CHECK_STRING (title); + + list_of_panes (Fcons (contents, Qnil)); + + /* Display them in a dialog box. */ + block_input (); + selection = w32_dialog_show (f, 0, title, header, &error_name); + unblock_input (); + + discard_menu_items (); + FRAME_DISPLAY_INFO (f)->grabbed = 0; + + if (error_name) error (error_name); + return selection; + } #endif /* HAVE_DIALOGS */ +} /* Activate the menu bar of frame F. This is called from keyboard.c when it gets the @@ -1621,6 +1631,7 @@ current_popup_menu = NULL; DEFSYM (Qdebug_on_next_call, "debug-on-next-call"); + DEFSYM (Qunsupported__w32_dialog, "unsupported--w32-dialog"); defsubr (&Smenu_or_popup_active_p); } === modified file 'src/w32term.h' --- src/w32term.h 2014-02-04 07:36:58 +0000 +++ src/w32term.h 2014-02-04 16:13:51 +0000 @@ -781,9 +781,7 @@ #define GUI_SDATA(x) ((guichar_t*) SDATA (x)) -#if defined HAVE_DIALOGS extern Lisp_Object w32_popup_dialog (struct frame *, Lisp_Object, Lisp_Object); -#endif extern void syms_of_w32term (void); extern void syms_of_w32menu (void); ------------------------------------------------------------ revno: 116259 committer: Michael Albinus branch nick: trunk timestamp: Tue 2014-02-04 12:41:20 +0100 message: * automated/file-notify-tests.el (file-notify--wait-for-events): Use `read-event' instead of `sit-for'. (file-notify-test02-events): Remove expected result, the bug is fixed meanwhile. (file-notify-test02-events, file-notify-test03-autorevert): Use `sleep-for' instead of `sit-for'. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-01-31 17:13:49 +0000 +++ test/ChangeLog 2014-02-04 11:41:20 +0000 @@ -1,3 +1,12 @@ +2014-02-04 Michael Albinus + + * automated/file-notify-tests.el (file-notify--wait-for-events): + Use `read-event' instead of `sit-for'. + (file-notify-test02-events): Remove expected result, the bug is + fixed meanwhile. + (file-notify-test02-events, file-notify-test03-autorevert): + Use `sleep-for' instead of `sit-for'. + 2014-01-31 Dmitry Gutov * automated/ruby-mode-tests.el (ruby-align-chained-calls): === modified file 'test/automated/file-notify-tests.el' --- test/automated/file-notify-tests.el 2014-01-27 19:10:02 +0000 +++ test/automated/file-notify-tests.el 2014-02-04 11:41:20 +0000 @@ -187,17 +187,10 @@ TIMEOUT is the maximum time to wait for, in seconds." `(with-timeout (,timeout (ignore)) (while (null ,until) - (let (noninteractive) - (sit-for 0.1 'nodisplay))))) + (read-event nil nil 0.1)))) (ert-deftest file-notify-test02-events () "Check file creation/removal notifications." - ;; Bug#16519. - :expected-result - (if (and noninteractive - (not (file-remote-p temporary-file-directory)) - (memq file-notify--library '(gfilenotify w32notify))) - :failed :passed) (skip-unless (file-notify--test-local-enabled)) (let (desc) (unwind-protect @@ -214,7 +207,7 @@ (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) (delete-file file-notify--test-tmpfile) - (sit-for 0.1 'nodisplay) + (sleep-for 0.1) ;; Check copy and rename. (write-region @@ -222,13 +215,13 @@ (copy-file file-notify--test-tmpfile file-notify--test-tmpfile1) (delete-file file-notify--test-tmpfile) (delete-file file-notify--test-tmpfile1) - (sit-for 0.1 'nodisplay) + (sleep-for 0.1) (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) (rename-file file-notify--test-tmpfile file-notify--test-tmpfile1) (delete-file file-notify--test-tmpfile1) - (sit-for 0.1 'nodisplay)) + (sleep-for 0.1)) ;; Wait for events, and exit. (file-notify--wait-for-events 5 file-notify--test-results) @@ -274,7 +267,7 @@ ;; `auto-revert-buffers' runs every 5". (with-timeout (timeout (ignore)) (while (null auto-revert-notify-watch-descriptor) - (sit-for 1 'nodisplay))) + (sleep-for 1))) ;; Check, that file notification has been used. (should auto-revert-mode) @@ -283,7 +276,7 @@ ;; Modify file. We wait for a second, in order to ;; have another timestamp. - (sit-for 1) + (sleep-for 1) (shell-command (format "echo -n 'another text' >%s" (or (file-remote-p file-notify--test-tmpfile 'localname) ------------------------------------------------------------ revno: 116258 committer: Michael Albinus branch nick: trunk timestamp: Tue 2014-02-04 12:40:31 +0100 message: * keyboard.c (kbd_buffer_get_event): Read file notification events also in batch mode. * xgselect.c (xg_select): Read glib events in any case, even if there are no file descriptors to watch for. (Bug#16519) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-04 07:36:58 +0000 +++ src/ChangeLog 2014-02-04 11:40:31 +0000 @@ -1,3 +1,11 @@ +2014-02-04 Michael Albinus + + * keyboard.c (kbd_buffer_get_event): Read file notification events + also in batch mode. + + * xgselect.c (xg_select): Read glib events in any case, even if + there are no file descriptors to watch for. (Bug#16519) + 2014-02-03 Martin Rudalics * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID === modified file 'src/keyboard.c' --- src/keyboard.c 2014-01-01 07:43:34 +0000 +++ src/keyboard.c 2014-02-04 11:40:31 +0000 @@ -3820,7 +3820,7 @@ } #endif /* subprocesses */ -#ifndef HAVE_DBUS /* We want to read D-Bus events in batch mode. */ +#if !defined HAVE_DBUS && !defined USE_FILE_NOTIFY if (noninteractive /* In case we are running as a daemon, only do this before detaching from the terminal. */ @@ -3831,7 +3831,7 @@ *kbp = current_kboard; return obj; } -#endif /* ! HAVE_DBUS */ +#endif /* !defined HAVE_DBUS && !defined USE_FILE_NOTIFY */ /* Wait until there is input available. */ for (;;) === modified file 'src/xgselect.c' --- src/xgselect.c 2014-01-01 07:43:34 +0000 +++ src/xgselect.c 2014-02-04 11:40:31 +0000 @@ -124,23 +124,19 @@ } } - if (our_fds > 0 || (nfds == 0 && tmop == &tmo)) - { - - /* If Gtk+ is in use eventually gtk_main_iteration will be called, - unless retval is zero. */ + /* If Gtk+ is in use eventually gtk_main_iteration will be called, + unless retval is zero. */ #ifdef USE_GTK - if (retval == 0) + if (retval == 0) #endif - while (g_main_context_pending (context)) - g_main_context_dispatch (context); + while (g_main_context_pending (context)) + g_main_context_dispatch (context); - /* To not have to recalculate timeout, return like this. */ - if (retval == 0) - { - retval = -1; - errno = EINTR; - } + /* To not have to recalculate timeout, return like this. */ + if ((our_fds > 0 || (nfds == 0 && tmop == &tmo)) && (retval == 0)) + { + retval = -1; + errno = EINTR; } return retval; ------------------------------------------------------------ revno: 116257 committer: martin rudalics branch nick: trunk timestamp: Tue 2014-02-04 08:36:58 +0100 message: Improve window dividers code. * faces.el (window-divider): New default value. Rewrite doc-string. (window-divider-first-pixel, window-divider-last-pixel): New faces. * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID and WINDOW_DIVIDER_LAST_PIXEL_FACE_ID. * w32term.c (w32_draw_window_divider): Handle first and last pixels specially. * w32term.h (w32_fill_area_abs): New function. * xdisp.c (x_draw_right_divider): Don't draw over bottom divider. * xfaces.c (realize_basic_faces): Handle new face ids. * xfns.c (Fx_create_frame): Call x_default_parameter for right and bottom divider width. * xterm.c (x_draw_window_divider): Handle first and last pixels specially. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-02-03 07:35:44 +0000 +++ etc/NEWS 2014-02-04 07:36:58 +0000 @@ -197,6 +197,18 @@ These are normal hooks run when an Emacs frame gains or loses input focus. --- +*** Emacs can now draw dividers between adjacent windows. To put +dividers between side-by-side windows customize the frame parameter +right-divider-width to some positive integer. To put dividers between +vertically stacked windows set the frame parameter bottom-divider-width +to some positive integer. Dividers can be dragged with the mouse and +show a corresponding cursor when the mouse hovers over them. The +appearance of dividers can be changed by customizing the basic faces +window-divider, window-divider-first-pixel and window-divider-last-pixel +where the latter two are useful to provide a 3D effect or to better set +dividers apart from surrounding display objects. + +--- *** `split-window' is now a non-interactive function, not a command. As a command, it was a special case of `C-x 2' (`split-window-below'), and as such superfluous. After being reimplemented in Lisp, its === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-03 15:59:39 +0000 +++ lisp/ChangeLog 2014-02-04 07:36:58 +0000 @@ -1,3 +1,10 @@ +2014-02-03 Martin Rudalics + + * faces.el (window-divider): New default value. Rewrite + doc-string. + (window-divider-first-pixel, window-divider-last-pixel): New + faces. + 2014-02-03 Dmitry Gutov * progmodes/ruby-mode.el (ruby-font-lock-keywords): `private', === modified file 'lisp/faces.el' --- lisp/faces.el 2014-01-01 07:43:34 +0000 +++ lisp/faces.el 2014-02-04 07:36:58 +0000 @@ -2425,6 +2425,39 @@ :version "22.1" :group 'basic-faces) +(defface window-divider '((t :foreground "gray60")) + "Basic face for window dividers. +When a divider is less than 3 pixels wide, it is drawn solidly +with the foreground of this face. For larger dividers this face +is used for the inner part while the first pixel line/column is +drawn with the `window-divider-first-pixel' face and the last +pixel line/column with the `window-divider-last-pixel' face." + :version "24.4" + :group 'frames + :group 'basic-faces) + +(defface window-divider-first-pixel + '((t :foreground "gray80")) + "Basic face for first pixel line/column of window dividers. +When a divider is at least 3 pixels wide, its first pixel +line/column is drawn with the foreground of this face. If you do +not want to accentuate the first pixel line/column, set this to +the same as `window-divider' face." + :version "24.4" + :group 'frames + :group 'basic-faces) + +(defface window-divider-last-pixel + '((t :foreground "gray40")) + "Basic face for last pixel line/column of window dividers. +When a divider is at least 3 pixels wide, its last pixel +line/column is drawn with the foreground of this face. If you do +not want to accentuate the last pixel line/column, set this to +the same as `window-divider' face." + :version "24.4" + :group 'frames + :group 'basic-faces) + (defface minibuffer-prompt '((((background dark)) :foreground "cyan") ;; Don't use blue because many users of the MS-DOS port customize === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-03 09:37:43 +0000 +++ src/ChangeLog 2014-02-04 07:36:58 +0000 @@ -1,3 +1,18 @@ +2014-02-03 Martin Rudalics + + * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID + and WINDOW_DIVIDER_LAST_PIXEL_FACE_ID. + * w32term.c (w32_draw_window_divider): Handle first and last + pixels specially. + * w32term.h (w32_fill_area_abs): New function. + * xdisp.c (x_draw_right_divider): Don't draw over bottom + divider. + * xfaces.c (realize_basic_faces): Handle new face ids. + * xfns.c (Fx_create_frame): Call x_default_parameter for right + and bottom divider width. + * xterm.c (x_draw_window_divider): Handle first and last pixels + specially. + 2014-02-03 Dmitry Antipov * print.c (Fexternal_debugging_output): Add cast to pacify === modified file 'src/dispextern.h' --- src/dispextern.h 2014-01-01 07:43:34 +0000 +++ src/dispextern.h 2014-02-04 07:36:58 +0000 @@ -1765,6 +1765,8 @@ MENU_FACE_ID, VERTICAL_BORDER_FACE_ID, WINDOW_DIVIDER_FACE_ID, + WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID, + WINDOW_DIVIDER_LAST_PIXEL_FACE_ID, BASIC_FACE_ID_SENTINEL }; === modified file 'src/w32term.c' --- src/w32term.c 2014-01-25 13:04:48 +0000 +++ src/w32term.c 2014-02-04 07:36:58 +0000 @@ -628,26 +628,38 @@ w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - RECT r; - HDC hdc; - struct face *face; - - r.left = x0; - r.right = x1; - r.top = y0; - r.bottom = y1; - - hdc = get_frame_dc (f); - face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); - if (face) - w32_fill_rect (f, hdc, face->foreground, &r); + HDC hdc = get_frame_dc (f); + struct face *face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); + struct face *face_first = FACE_FROM_ID (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID); + struct face *face_last = FACE_FROM_ID (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID); + unsigned long color = face ? face->foreground : FRAME_FOREGROUND_PIXEL (f); + unsigned long color_first = (face_first + ? face_first->foreground + : FRAME_FOREGROUND_PIXEL (f)); + unsigned long color_last = (face_last + ? face_last->foreground + : FRAME_FOREGROUND_PIXEL (f)); + + if (y1 - y0 > x1 - x0 && x1 - x0 > 2) + /* Vertical. */ + { + w32_fill_area_abs (f, hdc, color_first, x0, y0, x0 + 1, y1); + w32_fill_area_abs (f, hdc, color, x0 + 1, y0, x1 - 1, y1); + w32_fill_area_abs (f, hdc, color_last, x1 - 1, y0, x1, y1); + } + else if (x1 - x0 > y1 - y0 && y1 - y0 > 3) + /* Horizontal. */ + { + w32_fill_area_abs (f, hdc, color_first, x0, y0, x1, y0 + 1); + w32_fill_area_abs (f, hdc, color, x0, y0 + 1, x1, y1 - 1); + w32_fill_area_abs (f, hdc, color_last, x0, y1 - 1, x1, y1); + } else - w32_fill_rect (f, hdc, FRAME_FOREGROUND_PIXEL (f), &r); + w32_fill_area_abs (f, hdc, color, x0, y0, x1, y1); release_frame_dc (f, hdc); } - /* End update of window W. Draw vertical borders between horizontally adjacent windows, and === modified file 'src/w32term.h' --- src/w32term.h 2014-01-01 07:43:34 +0000 +++ src/w32term.h 2014-02-04 07:36:58 +0000 @@ -537,6 +537,16 @@ w32_fill_rect (f,hdc,pix,&rect); \ } while (0) +#define w32_fill_area_abs(f,hdc,pix,x0,y0,x1,y1) \ +do { \ + RECT rect; \ + rect.left = x0; \ + rect.top = y0; \ + rect.right = x1; \ + rect.bottom = y1; \ + w32_fill_rect (f,hdc,pix,&rect); \ +} while (0) + #define w32_clear_rect(f,hdc,lprect) \ w32_fill_rect (f, hdc, FRAME_BACKGROUND_PIXEL (f), lprect) === modified file 'src/xdisp.c' --- src/xdisp.c 2014-01-28 09:45:37 +0000 +++ src/xdisp.c 2014-02-04 07:36:58 +0000 @@ -29277,7 +29277,8 @@ int x0 = WINDOW_RIGHT_EDGE_X (w) - WINDOW_RIGHT_DIVIDER_WIDTH (w); int x1 = WINDOW_RIGHT_EDGE_X (w); int y0 = WINDOW_TOP_EDGE_Y (w); - int y1 = WINDOW_BOTTOM_EDGE_Y (w); + /* The bottom divider prevails. */ + int y1 = WINDOW_BOTTOM_EDGE_Y (w) - WINDOW_BOTTOM_DIVIDER_WIDTH (w); FRAME_RIF (f)->draw_window_divider (w, x0, x1, y0, y1); } === modified file 'src/xfaces.c' --- src/xfaces.c 2014-01-28 07:43:24 +0000 +++ src/xfaces.c 2014-02-04 07:36:58 +0000 @@ -324,6 +324,8 @@ Lisp_Object Qmode_line_inactive; static Lisp_Object Qvertical_border; static Lisp_Object Qwindow_divider; +static Lisp_Object Qwindow_divider_first_pixel; +static Lisp_Object Qwindow_divider_last_pixel; /* The symbol `face-alias'. A symbols having that property is an alias for another face. Value of the property is the name of @@ -5249,6 +5251,10 @@ realize_named_face (f, Qmenu, MENU_FACE_ID); realize_named_face (f, Qvertical_border, VERTICAL_BORDER_FACE_ID); realize_named_face (f, Qwindow_divider, WINDOW_DIVIDER_FACE_ID); + realize_named_face (f, Qwindow_divider_first_pixel, + WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID); + realize_named_face (f, Qwindow_divider_last_pixel, + WINDOW_DIVIDER_LAST_PIXEL_FACE_ID); /* Reflect changes in the `menu' face in menu bars. */ if (FRAME_FACE_CACHE (f)->menu_face_changed_p) @@ -6452,6 +6458,8 @@ DEFSYM (Qmode_line_inactive, "mode-line-inactive"); DEFSYM (Qvertical_border, "vertical-border"); DEFSYM (Qwindow_divider, "window-divider"); + DEFSYM (Qwindow_divider_first_pixel, "window-divider-first-pixel"); + DEFSYM (Qwindow_divider_last_pixel, "window-divider-last-pixel"); DEFSYM (Qtty_color_desc, "tty-color-desc"); DEFSYM (Qtty_color_standard_values, "tty-color-standard-values"); DEFSYM (Qtty_color_by_index, "tty-color-by-index"); === modified file 'src/xfns.c' --- src/xfns.c 2014-01-11 09:31:09 +0000 +++ src/xfns.c 2014-02-04 07:36:58 +0000 @@ -3033,6 +3033,10 @@ #endif "internalBorderWidth", "internalBorderWidth", RES_TYPE_NUMBER); + x_default_parameter (f, parms, Qright_divider_width, make_number (0), + NULL, NULL, RES_TYPE_NUMBER); + x_default_parameter (f, parms, Qbottom_divider_width, make_number (0), + NULL, NULL, RES_TYPE_NUMBER); x_default_parameter (f, parms, Qvertical_scroll_bars, #if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS) Qright, === modified file 'src/xterm.c' --- src/xterm.c 2014-01-26 12:17:55 +0000 +++ src/xterm.c 2014-02-04 07:36:58 +0000 @@ -510,15 +510,51 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - struct face *face; - - face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); - if (face) - XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, - face->foreground); - - XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - f->output_data.x->normal_gc, x0, y0, x1 - x0, y1 - y0); + struct face *face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); + struct face *face_first = FACE_FROM_ID (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID); + struct face *face_last = FACE_FROM_ID (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID); + unsigned long color = face ? face->foreground : FRAME_FOREGROUND_PIXEL (f); + unsigned long color_first = (face_first + ? face_first->foreground + : FRAME_FOREGROUND_PIXEL (f)); + unsigned long color_last = (face_last + ? face_last->foreground + : FRAME_FOREGROUND_PIXEL (f)); + Display *display = FRAME_X_DISPLAY (f); + Window window = FRAME_X_WINDOW (f); + + if (y1 - y0 > x1 - x0 && x1 - x0 > 2) + /* Vertical. */ + { + XSetForeground (display, f->output_data.x->normal_gc, color_first); + XFillRectangle (display, window, f->output_data.x->normal_gc, + x0, y0, 1, y1 - y0); + XSetForeground (display, f->output_data.x->normal_gc, color); + XFillRectangle (display, window, f->output_data.x->normal_gc, + x0 + 1, y0, x1 - x0 - 2, y1 - y0); + XSetForeground (display, f->output_data.x->normal_gc, color_last); + XFillRectangle (display, window, f->output_data.x->normal_gc, + x1 - 1, y0, 1, y1 - y0); + } + else if (x1 - x0 > y1 - y0 && y1 - y0 > 3) + /* Horizontal. */ + { + XSetForeground (display, f->output_data.x->normal_gc, color_first); + XFillRectangle (display, window, f->output_data.x->normal_gc, + x0, y0, x1 - x0, 1); + XSetForeground (display, f->output_data.x->normal_gc, color); + XFillRectangle (display, window, f->output_data.x->normal_gc, + x0, y0 + 1, x1 - x0, y1 - y0 - 2); + XSetForeground (display, f->output_data.x->normal_gc, color_last); + XFillRectangle (display, window, f->output_data.x->normal_gc, + x0, y1 - 1, x1 - x0, 1); + } + else + { + XSetForeground (display, f->output_data.x->normal_gc, color); + XFillRectangle (display, window, f->output_data.x->normal_gc, + x0, y0, x1 - x0, y1 - y0); + } } /* End update of window W.