aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS12
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/faces.el33
-rw-r--r--src/ChangeLog15
-rw-r--r--src/dispextern.h2
-rw-r--r--src/w32term.c42
-rw-r--r--src/w32term.h10
-rw-r--r--src/xdisp.c3
-rw-r--r--src/xfaces.c8
-rw-r--r--src/xfns.c4
-rw-r--r--src/xterm.c52
11 files changed, 164 insertions, 24 deletions
diff --git a/etc/NEWS b/etc/NEWS
index cfcb74cf782..11cb240890a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -197,6 +197,18 @@ command `frame-configuration-to-register' still exists, but is unbound.
197These are normal hooks run when an Emacs frame gains or loses input focus. 197These are normal hooks run when an Emacs frame gains or loses input focus.
198 198
199--- 199---
200*** Emacs can now draw dividers between adjacent windows. To put
201dividers between side-by-side windows customize the frame parameter
202right-divider-width to some positive integer. To put dividers between
203vertically stacked windows set the frame parameter bottom-divider-width
204to some positive integer. Dividers can be dragged with the mouse and
205show a corresponding cursor when the mouse hovers over them. The
206appearance of dividers can be changed by customizing the basic faces
207window-divider, window-divider-first-pixel and window-divider-last-pixel
208where the latter two are useful to provide a 3D effect or to better set
209dividers apart from surrounding display objects.
210
211---
200*** `split-window' is now a non-interactive function, not a command. 212*** `split-window' is now a non-interactive function, not a command.
201As a command, it was a special case of `C-x 2' (`split-window-below'), 213As a command, it was a special case of `C-x 2' (`split-window-below'),
202and as such superfluous. After being reimplemented in Lisp, its 214and as such superfluous. After being reimplemented in Lisp, its
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7c204726568..a97860c8aa6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12014-02-03 Martin Rudalics <rudalics@gmx.at>
2
3 * faces.el (window-divider): New default value. Rewrite
4 doc-string.
5 (window-divider-first-pixel, window-divider-last-pixel): New
6 faces.
7
12014-02-03 Dmitry Gutov <dgutov@yandex.ru> 82014-02-03 Dmitry Gutov <dgutov@yandex.ru>
2 9
3 * progmodes/ruby-mode.el (ruby-font-lock-keywords): `private', 10 * progmodes/ruby-mode.el (ruby-font-lock-keywords): `private',
diff --git a/lisp/faces.el b/lisp/faces.el
index aa9d25c31d7..460fddf9ccd 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2425,6 +2425,39 @@ Use the face `mode-line-highlight' for features that can be selected."
2425 :version "22.1" 2425 :version "22.1"
2426 :group 'basic-faces) 2426 :group 'basic-faces)
2427 2427
2428(defface window-divider '((t :foreground "gray60"))
2429 "Basic face for window dividers.
2430When a divider is less than 3 pixels wide, it is drawn solidly
2431with the foreground of this face. For larger dividers this face
2432is used for the inner part while the first pixel line/column is
2433drawn with the `window-divider-first-pixel' face and the last
2434pixel line/column with the `window-divider-last-pixel' face."
2435 :version "24.4"
2436 :group 'frames
2437 :group 'basic-faces)
2438
2439(defface window-divider-first-pixel
2440 '((t :foreground "gray80"))
2441 "Basic face for first pixel line/column of window dividers.
2442When a divider is at least 3 pixels wide, its first pixel
2443line/column is drawn with the foreground of this face. If you do
2444not want to accentuate the first pixel line/column, set this to
2445the same as `window-divider' face."
2446 :version "24.4"
2447 :group 'frames
2448 :group 'basic-faces)
2449
2450(defface window-divider-last-pixel
2451 '((t :foreground "gray40"))
2452 "Basic face for last pixel line/column of window dividers.
2453When a divider is at least 3 pixels wide, its last pixel
2454line/column is drawn with the foreground of this face. If you do
2455not want to accentuate the last pixel line/column, set this to
2456the same as `window-divider' face."
2457 :version "24.4"
2458 :group 'frames
2459 :group 'basic-faces)
2460
2428(defface minibuffer-prompt 2461(defface minibuffer-prompt
2429 '((((background dark)) :foreground "cyan") 2462 '((((background dark)) :foreground "cyan")
2430 ;; Don't use blue because many users of the MS-DOS port customize 2463 ;; Don't use blue because many users of the MS-DOS port customize
diff --git a/src/ChangeLog b/src/ChangeLog
index ac41dabafcd..ec003cd59b2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,18 @@
12014-02-03 Martin Rudalics <rudalics@gmx.at>
2
3 * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID
4 and WINDOW_DIVIDER_LAST_PIXEL_FACE_ID.
5 * w32term.c (w32_draw_window_divider): Handle first and last
6 pixels specially.
7 * w32term.h (w32_fill_area_abs): New function.
8 * xdisp.c (x_draw_right_divider): Don't draw over bottom
9 divider.
10 * xfaces.c (realize_basic_faces): Handle new face ids.
11 * xfns.c (Fx_create_frame): Call x_default_parameter for right
12 and bottom divider width.
13 * xterm.c (x_draw_window_divider): Handle first and last pixels
14 specially.
15
12014-02-03 Dmitry Antipov <dmantipov@yandex.ru> 162014-02-03 Dmitry Antipov <dmantipov@yandex.ru>
2 17
3 * print.c (Fexternal_debugging_output): Add cast to pacify 18 * print.c (Fexternal_debugging_output): Add cast to pacify
diff --git a/src/dispextern.h b/src/dispextern.h
index a5dd054c123..9ecd4ecdf7e 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1765,6 +1765,8 @@ enum face_id
1765 MENU_FACE_ID, 1765 MENU_FACE_ID,
1766 VERTICAL_BORDER_FACE_ID, 1766 VERTICAL_BORDER_FACE_ID,
1767 WINDOW_DIVIDER_FACE_ID, 1767 WINDOW_DIVIDER_FACE_ID,
1768 WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID,
1769 WINDOW_DIVIDER_LAST_PIXEL_FACE_ID,
1768 BASIC_FACE_ID_SENTINEL 1770 BASIC_FACE_ID_SENTINEL
1769}; 1771};
1770 1772
diff --git a/src/w32term.c b/src/w32term.c
index 03d5a0047bc..b77d01796d7 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -628,26 +628,38 @@ static void
628w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) 628w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
629{ 629{
630 struct frame *f = XFRAME (WINDOW_FRAME (w)); 630 struct frame *f = XFRAME (WINDOW_FRAME (w));
631 RECT r; 631 HDC hdc = get_frame_dc (f);
632 HDC hdc; 632 struct face *face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID);
633 struct face *face; 633 struct face *face_first = FACE_FROM_ID (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID);
634 634 struct face *face_last = FACE_FROM_ID (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID);
635 r.left = x0; 635 unsigned long color = face ? face->foreground : FRAME_FOREGROUND_PIXEL (f);
636 r.right = x1; 636 unsigned long color_first = (face_first
637 r.top = y0; 637 ? face_first->foreground
638 r.bottom = y1; 638 : FRAME_FOREGROUND_PIXEL (f));
639 639 unsigned long color_last = (face_last
640 hdc = get_frame_dc (f); 640 ? face_last->foreground
641 face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); 641 : FRAME_FOREGROUND_PIXEL (f));
642 if (face) 642
643 w32_fill_rect (f, hdc, face->foreground, &r); 643 if (y1 - y0 > x1 - x0 && x1 - x0 > 2)
644 /* Vertical. */
645 {
646 w32_fill_area_abs (f, hdc, color_first, x0, y0, x0 + 1, y1);
647 w32_fill_area_abs (f, hdc, color, x0 + 1, y0, x1 - 1, y1);
648 w32_fill_area_abs (f, hdc, color_last, x1 - 1, y0, x1, y1);
649 }
650 else if (x1 - x0 > y1 - y0 && y1 - y0 > 3)
651 /* Horizontal. */
652 {
653 w32_fill_area_abs (f, hdc, color_first, x0, y0, x1, y0 + 1);
654 w32_fill_area_abs (f, hdc, color, x0, y0 + 1, x1, y1 - 1);
655 w32_fill_area_abs (f, hdc, color_last, x0, y1 - 1, x1, y1);
656 }
644 else 657 else
645 w32_fill_rect (f, hdc, FRAME_FOREGROUND_PIXEL (f), &r); 658 w32_fill_area_abs (f, hdc, color, x0, y0, x1, y1);
646 659
647 release_frame_dc (f, hdc); 660 release_frame_dc (f, hdc);
648} 661}
649 662
650
651/* End update of window W. 663/* End update of window W.
652 664
653 Draw vertical borders between horizontally adjacent windows, and 665 Draw vertical borders between horizontally adjacent windows, and
diff --git a/src/w32term.h b/src/w32term.h
index 5a1ae283137..f85e6bced8b 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -537,6 +537,16 @@ do { \
537 w32_fill_rect (f,hdc,pix,&rect); \ 537 w32_fill_rect (f,hdc,pix,&rect); \
538} while (0) 538} while (0)
539 539
540#define w32_fill_area_abs(f,hdc,pix,x0,y0,x1,y1) \
541do { \
542 RECT rect; \
543 rect.left = x0; \
544 rect.top = y0; \
545 rect.right = x1; \
546 rect.bottom = y1; \
547 w32_fill_rect (f,hdc,pix,&rect); \
548} while (0)
549
540#define w32_clear_rect(f,hdc,lprect) \ 550#define w32_clear_rect(f,hdc,lprect) \
541 w32_fill_rect (f, hdc, FRAME_BACKGROUND_PIXEL (f), lprect) 551 w32_fill_rect (f, hdc, FRAME_BACKGROUND_PIXEL (f), lprect)
542 552
diff --git a/src/xdisp.c b/src/xdisp.c
index b5dec35568a..0ca877d997f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -29277,7 +29277,8 @@ x_draw_right_divider (struct window *w)
29277 int x0 = WINDOW_RIGHT_EDGE_X (w) - WINDOW_RIGHT_DIVIDER_WIDTH (w); 29277 int x0 = WINDOW_RIGHT_EDGE_X (w) - WINDOW_RIGHT_DIVIDER_WIDTH (w);
29278 int x1 = WINDOW_RIGHT_EDGE_X (w); 29278 int x1 = WINDOW_RIGHT_EDGE_X (w);
29279 int y0 = WINDOW_TOP_EDGE_Y (w); 29279 int y0 = WINDOW_TOP_EDGE_Y (w);
29280 int y1 = WINDOW_BOTTOM_EDGE_Y (w); 29280 /* The bottom divider prevails. */
29281 int y1 = WINDOW_BOTTOM_EDGE_Y (w) - WINDOW_BOTTOM_DIVIDER_WIDTH (w);
29281 29282
29282 FRAME_RIF (f)->draw_window_divider (w, x0, x1, y0, y1); 29283 FRAME_RIF (f)->draw_window_divider (w, x0, x1, y0, y1);
29283 } 29284 }
diff --git a/src/xfaces.c b/src/xfaces.c
index f2d777a12b1..4271e47c36f 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -324,6 +324,8 @@ static Lisp_Object Qborder, Qmouse, Qmenu;
324Lisp_Object Qmode_line_inactive; 324Lisp_Object Qmode_line_inactive;
325static Lisp_Object Qvertical_border; 325static Lisp_Object Qvertical_border;
326static Lisp_Object Qwindow_divider; 326static Lisp_Object Qwindow_divider;
327static Lisp_Object Qwindow_divider_first_pixel;
328static Lisp_Object Qwindow_divider_last_pixel;
327 329
328/* The symbol `face-alias'. A symbols having that property is an 330/* The symbol `face-alias'. A symbols having that property is an
329 alias for another face. Value of the property is the name of 331 alias for another face. Value of the property is the name of
@@ -5249,6 +5251,10 @@ realize_basic_faces (struct frame *f)
5249 realize_named_face (f, Qmenu, MENU_FACE_ID); 5251 realize_named_face (f, Qmenu, MENU_FACE_ID);
5250 realize_named_face (f, Qvertical_border, VERTICAL_BORDER_FACE_ID); 5252 realize_named_face (f, Qvertical_border, VERTICAL_BORDER_FACE_ID);
5251 realize_named_face (f, Qwindow_divider, WINDOW_DIVIDER_FACE_ID); 5253 realize_named_face (f, Qwindow_divider, WINDOW_DIVIDER_FACE_ID);
5254 realize_named_face (f, Qwindow_divider_first_pixel,
5255 WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID);
5256 realize_named_face (f, Qwindow_divider_last_pixel,
5257 WINDOW_DIVIDER_LAST_PIXEL_FACE_ID);
5252 5258
5253 /* Reflect changes in the `menu' face in menu bars. */ 5259 /* Reflect changes in the `menu' face in menu bars. */
5254 if (FRAME_FACE_CACHE (f)->menu_face_changed_p) 5260 if (FRAME_FACE_CACHE (f)->menu_face_changed_p)
@@ -6452,6 +6458,8 @@ syms_of_xfaces (void)
6452 DEFSYM (Qmode_line_inactive, "mode-line-inactive"); 6458 DEFSYM (Qmode_line_inactive, "mode-line-inactive");
6453 DEFSYM (Qvertical_border, "vertical-border"); 6459 DEFSYM (Qvertical_border, "vertical-border");
6454 DEFSYM (Qwindow_divider, "window-divider"); 6460 DEFSYM (Qwindow_divider, "window-divider");
6461 DEFSYM (Qwindow_divider_first_pixel, "window-divider-first-pixel");
6462 DEFSYM (Qwindow_divider_last_pixel, "window-divider-last-pixel");
6455 DEFSYM (Qtty_color_desc, "tty-color-desc"); 6463 DEFSYM (Qtty_color_desc, "tty-color-desc");
6456 DEFSYM (Qtty_color_standard_values, "tty-color-standard-values"); 6464 DEFSYM (Qtty_color_standard_values, "tty-color-standard-values");
6457 DEFSYM (Qtty_color_by_index, "tty-color-by-index"); 6465 DEFSYM (Qtty_color_by_index, "tty-color-by-index");
diff --git a/src/xfns.c b/src/xfns.c
index debc707dba2..ff492dcf126 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3033,6 +3033,10 @@ This function is an internal primitive--use `make-frame' instead. */)
3033#endif 3033#endif
3034 "internalBorderWidth", "internalBorderWidth", 3034 "internalBorderWidth", "internalBorderWidth",
3035 RES_TYPE_NUMBER); 3035 RES_TYPE_NUMBER);
3036 x_default_parameter (f, parms, Qright_divider_width, make_number (0),
3037 NULL, NULL, RES_TYPE_NUMBER);
3038 x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
3039 NULL, NULL, RES_TYPE_NUMBER);
3036 x_default_parameter (f, parms, Qvertical_scroll_bars, 3040 x_default_parameter (f, parms, Qvertical_scroll_bars,
3037#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS) 3041#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
3038 Qright, 3042 Qright,
diff --git a/src/xterm.c b/src/xterm.c
index 685fdf40a70..e1873127276 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -510,15 +510,51 @@ static void
510x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) 510x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
511{ 511{
512 struct frame *f = XFRAME (WINDOW_FRAME (w)); 512 struct frame *f = XFRAME (WINDOW_FRAME (w));
513 struct face *face; 513 struct face *face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID);
514 514 struct face *face_first = FACE_FROM_ID (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID);
515 face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); 515 struct face *face_last = FACE_FROM_ID (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID);
516 if (face) 516 unsigned long color = face ? face->foreground : FRAME_FOREGROUND_PIXEL (f);
517 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, 517 unsigned long color_first = (face_first
518 face->foreground); 518 ? face_first->foreground
519 : FRAME_FOREGROUND_PIXEL (f));
520 unsigned long color_last = (face_last
521 ? face_last->foreground
522 : FRAME_FOREGROUND_PIXEL (f));
523 Display *display = FRAME_X_DISPLAY (f);
524 Window window = FRAME_X_WINDOW (f);
519 525
520 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 526 if (y1 - y0 > x1 - x0 && x1 - x0 > 2)
521 f->output_data.x->normal_gc, x0, y0, x1 - x0, y1 - y0); 527 /* Vertical. */
528 {
529 XSetForeground (display, f->output_data.x->normal_gc, color_first);
530 XFillRectangle (display, window, f->output_data.x->normal_gc,
531 x0, y0, 1, y1 - y0);
532 XSetForeground (display, f->output_data.x->normal_gc, color);
533 XFillRectangle (display, window, f->output_data.x->normal_gc,
534 x0 + 1, y0, x1 - x0 - 2, y1 - y0);
535 XSetForeground (display, f->output_data.x->normal_gc, color_last);
536 XFillRectangle (display, window, f->output_data.x->normal_gc,
537 x1 - 1, y0, 1, y1 - y0);
538 }
539 else if (x1 - x0 > y1 - y0 && y1 - y0 > 3)
540 /* Horizontal. */
541 {
542 XSetForeground (display, f->output_data.x->normal_gc, color_first);
543 XFillRectangle (display, window, f->output_data.x->normal_gc,
544 x0, y0, x1 - x0, 1);
545 XSetForeground (display, f->output_data.x->normal_gc, color);
546 XFillRectangle (display, window, f->output_data.x->normal_gc,
547 x0, y0 + 1, x1 - x0, y1 - y0 - 2);
548 XSetForeground (display, f->output_data.x->normal_gc, color_last);
549 XFillRectangle (display, window, f->output_data.x->normal_gc,
550 x0, y1 - 1, x1 - x0, 1);
551 }
552 else
553 {
554 XSetForeground (display, f->output_data.x->normal_gc, color);
555 XFillRectangle (display, window, f->output_data.x->normal_gc,
556 x0, y0, x1 - x0, y1 - y0);
557 }
522} 558}
523 559
524/* End update of window W. 560/* End update of window W.