Now on revision 112103. ------------------------------------------------------------ revno: 112103 fixes bug: http://debbugs.gnu.org/13989 committer: Juri Linkov branch nick: trunk timestamp: Thu 2013-03-21 01:04:40 +0200 message: Info footnote fontification and navigation. * lisp/info.el (Info-next-reference-or-link) (Info-prev-reference-or-link): New functions. (Info-next-reference, Info-prev-reference): Use them. (Info-try-follow-nearest-node): Handle footnote navigation. (Info-fontify-node): Fontify footnotes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-20 18:13:00 +0000 +++ lisp/ChangeLog 2013-03-20 23:04:40 +0000 @@ -1,3 +1,11 @@ +2013-03-20 Juri Linkov + + * info.el (Info-next-reference-or-link) + (Info-prev-reference-or-link): New functions. + (Info-next-reference, Info-prev-reference): Use them. + (Info-try-follow-nearest-node): Handle footnote navigation. + (Info-fontify-node): Fontify footnotes. (Bug#13989) + 2013-03-20 Stefan Monnier * subr.el (posn-point, posn-string): Fix it here instead (bug#13979). === modified file 'lisp/info.el' --- lisp/info.el 2013-02-21 06:55:19 +0000 +++ lisp/info.el 2013-03-20 23:04:40 +0000 @@ -3057,6 +3057,38 @@ (select-window (posn-window (event-start e)))) (Info-scroll-down))) +(defun Info-next-reference-or-link (pat prop) + "Move point to the next pattern-based cross-reference or property-based link. +The next cross-reference is searched using the regexp PAT, and the next link +is searched using the text property PROP. Move point to the closest found position +of either a cross-reference found by `re-search-forward' or a link found by +`next-single-char-property-change'. Return the new position of point, or nil." + (let ((pcref (save-excursion (re-search-forward pat nil t))) + (plink (next-single-char-property-change (point) prop))) + (when (and (< plink (point-max)) (not (get-char-property plink prop))) + (setq plink (next-single-char-property-change plink prop))) + (if (< plink (point-max)) + (if (and pcref (<= pcref plink)) + (goto-char (or (match-beginning 1) (match-beginning 0))) + (goto-char plink)) + (if pcref (goto-char (or (match-beginning 1) (match-beginning 0))))))) + +(defun Info-prev-reference-or-link (pat prop) + "Move point to the previous pattern-based cross-reference or property-based link. +The previous cross-reference is searched using the regexp PAT, and the previous link +is searched using the text property PROP. Move point to the closest found position +of either a cross-reference found by `re-search-backward' or a link found by +`previous-single-char-property-change'. Return the new position of point, or nil." + (let ((pcref (save-excursion (re-search-backward pat nil t))) + (plink (previous-single-char-property-change (point) prop))) + (when (and (> plink (point-min)) (not (get-char-property plink prop))) + (setq plink (previous-single-char-property-change plink prop))) + (if (> plink (point-min)) + (if (and pcref (>= pcref plink)) + (goto-char (or (match-beginning 1) (match-beginning 0))) + (goto-char plink)) + (if pcref (goto-char (or (match-beginning 1) (match-beginning 0))))))) + (defun Info-next-reference (&optional recur count) "Move cursor to the next cross-reference or menu item in the node. If COUNT is non-nil (interactively with a prefix arg), jump over @@ -3071,14 +3103,13 @@ (old-pt (point)) (case-fold-search t)) (or (eobp) (forward-char 1)) - (or (re-search-forward pat nil t) + (or (Info-next-reference-or-link pat 'link) (progn (goto-char (point-min)) - (or (re-search-forward pat nil t) + (or (Info-next-reference-or-link pat 'link) (progn (goto-char old-pt) (user-error "No cross references in this node"))))) - (goto-char (or (match-beginning 1) (match-beginning 0))) (if (looking-at "\\* Menu:") (if recur (user-error "No cross references in this node") @@ -3099,14 +3130,13 @@ (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") (old-pt (point)) (case-fold-search t)) - (or (re-search-backward pat nil t) + (or (Info-prev-reference-or-link pat 'link) (progn (goto-char (point-max)) - (or (re-search-backward pat nil t) + (or (Info-prev-reference-or-link pat 'link) (progn (goto-char old-pt) (user-error "No cross references in this node"))))) - (goto-char (or (match-beginning 1) (match-beginning 0))) (if (looking-at "\\* Menu:") (if recur (user-error "No cross references in this node") @@ -3840,7 +3870,25 @@ ((setq node (Info-get-token (point) "File: " "File: \\([^,\n\t]*\\)")) (Info-goto-node "Top" fork)) ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)")) - (Info-goto-node node fork))) + (Info-goto-node node fork)) + ;; footnote + ((setq node (Info-get-token (point) "(" "\\(([0-9]+)\\)")) + (let ((old-point (point)) new-point) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^[ \t]*-+ Footnotes -+$" nil t) + (setq new-point (if (< old-point (point)) + ;; Go to footnote reference + (and (search-forward node nil t) + ;; Put point at beginning of link + (match-beginning 0)) + ;; Go to footnote definition + (search-backward node nil t))))) + (if new-point + (progn + (goto-char new-point) + (setq node t)) + (setq node nil))))) node)) (defun Info-mouse-follow-link (click) @@ -4896,6 +4944,21 @@ mouse-face highlight help-echo "mouse-2: go to this URL")))) + ;; Fontify footnotes + (goto-char (point-min)) + (when (and not-fontified-p (re-search-forward "^[ \t]*-+ Footnotes -+$" nil t)) + (let ((limit (point))) + (goto-char (point-min)) + (while (re-search-forward "\\(([0-9]+)\\)" nil t) + (add-text-properties (match-beginning 0) (match-end 0) + `(font-lock-face info-xref + link t + mouse-face highlight + help-echo + ,(if (< (point) limit) + "mouse-2: go to footnote definition" + "mouse-2: go to footnote reference")))))) + ;; Hide empty lines at the end of the node. (goto-char (point-max)) (skip-chars-backward "\n") ------------------------------------------------------------ revno: 112102 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13979 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-03-20 14:13:00 -0400 message: * lisp/subr.el (posn-point, posn-string): Fix it here instead. * lisp/mouse.el (mouse-on-link-p): Undo scroll-bar fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-20 05:17:04 +0000 +++ lisp/ChangeLog 2013-03-20 18:13:00 +0000 @@ -1,3 +1,8 @@ +2013-03-20 Stefan Monnier + + * subr.el (posn-point, posn-string): Fix it here instead (bug#13979). + * mouse.el (mouse-on-link-p): Undo scroll-bar fix. + 2013-03-20 Paul Eggert Suppress unnecessary non-ASCII chatter during build process. @@ -15,8 +20,8 @@ * whitespace.el (whitespace-font-lock, whitespace-font-lock-mode): Remove vars. - (whitespace-color-on, whitespace-color-off): Use - `font-lock-fontify-buffer' (Bug#13817). + (whitespace-color-on, whitespace-color-off): + Use `font-lock-fontify-buffer' (Bug#13817). 2013-03-19 Stefan Monnier @@ -76,8 +81,7 @@ buffer's first char. Use `with-selected-window' instead of `save-window-excursion' with `select-window'. (doc-view-document->bitmap): Check the current doc-view overlay's - display property instead the char property of the buffer's first - char. + display property instead the char property of the buffer's first char. 2013-03-18 Paul Eggert === modified file 'lisp/mouse.el' --- lisp/mouse.el 2013-03-19 12:47:10 +0000 +++ lisp/mouse.el 2013-03-20 18:13:00 +0000 @@ -759,8 +759,7 @@ - Otherwise, the mouse-1 event is translated into a mouse-2 event at the same position." (let ((action - (and (not (memq 'vertical-scroll-bar pos)) - (or (not (consp pos)) + (and (or (not (consp pos)) mouse-1-click-in-non-selected-windows (eq (selected-window) (posn-window pos))) (or (mouse-posn-property pos 'follow-link) === modified file 'lisp/subr.el' --- lisp/subr.el 2013-03-08 08:11:59 +0000 +++ lisp/subr.el 2013-03-20 18:13:00 +0000 @@ -1044,14 +1044,17 @@ (nth 1 position)))) (and (symbolp area) area))) -(defsubst posn-point (position) +(defun posn-point (position) "Return the buffer location in POSITION. POSITION should be a list of the form returned by the `event-start' -and `event-end' functions." +and `event-end' functions. +Returns nil if POSITION does not correspond to any buffer location (e.g. +a click on a scroll bar)." (or (nth 5 position) - (if (consp (nth 1 position)) - (car (nth 1 position)) - (nth 1 position)))) + (let ((pt (nth 1 position))) + (or (car-safe pt) + ;; Apparently this can also be `vertical-scroll-bar' (bug#13979). + (if (integerp pt) pt))))) (defun posn-set-point (position) "Move point to POSITION. @@ -1124,12 +1127,14 @@ and `event-end' functions." (nth 3 position)) -(defsubst posn-string (position) +(defun posn-string (position) "Return the string object of POSITION. Value is a cons (STRING . STRING-POS), or nil if not a string. POSITION should be a list of the form returned by the `event-start' and `event-end' functions." - (nth 4 position)) + (let ((x (nth 4 position))) + ;; Apparently this can also be `handle' or `below-handle' (bug#13979). + (when (consp x) x))) (defsubst posn-image (position) "Return the image object of POSITION. ------------------------------------------------------------ revno: 112101 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-03-20 15:29:37 +0400 message: * window.h (struct window): Convert left_col, top_line, total_lines and total_cols from Lisp_Objects to integers. Adjust comments. (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines): Remove. (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL) (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion. * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c: Adjust users where appropriate. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-20 09:59:07 +0000 +++ src/ChangeLog 2013-03-20 11:29:37 +0000 @@ -1,5 +1,16 @@ 2013-03-20 Dmitry Antipov + * window.h (struct window): Convert left_col, top_line, total_lines + and total_cols from Lisp_Objects to integers. Adjust comments. + (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines): + Remove. + (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL) + (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion. + * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c: + Adjust users where appropriate. + +2013-03-20 Dmitry Antipov + * frame.h (struct frame): Drop resx and resy because the same data is available from window system-specific output context. Adjust users. (default_pixels_per_inch_x, default_pixels_per_inch_y): New === modified file 'src/dispnew.c' --- src/dispnew.c 2013-03-17 22:49:50 +0000 +++ src/dispnew.c 2013-03-20 11:29:37 +0000 @@ -363,7 +363,7 @@ if (NUMBERP (margin)) { - int width = XFASTINT (w->total_cols); + int width = w->total_cols; double d = max (0, XFLOATINT (margin)); d = min (width / 2 - 1, d); n = (int) ((double) total_glyphs / width * d); @@ -1776,7 +1776,7 @@ } #endif /* HAVE_WINDOW_SYSTEM */ - return XINT (w->total_cols); + return w->total_cols; } @@ -2114,10 +2114,10 @@ /* Set window dimensions to frame dimensions and allocate or adjust glyph matrices of W. */ - wset_top_line (w, make_number (0)); - wset_left_col (w, make_number (0)); - wset_total_lines (w, make_number (FRAME_MENU_BAR_LINES (f))); - wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f))); + w->top_line = 0; + w->left_col = 0; + w->total_lines = FRAME_MENU_BAR_LINES (f); + w->total_cols = FRAME_TOTAL_COLS (f); allocate_matrices_for_window_redisplay (w); } #endif /* not USE_X_TOOLKIT && not USE_GTK */ @@ -2140,10 +2140,10 @@ else w = XWINDOW (f->tool_bar_window); - wset_top_line (w, make_number (FRAME_MENU_BAR_LINES (f))); - wset_left_col (w, make_number (0)); - wset_total_lines (w, make_number (FRAME_TOOL_BAR_LINES (f))); - wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f))); + w->top_line = FRAME_MENU_BAR_LINES (f); + w->left_col = 0; + w->total_lines = FRAME_TOOL_BAR_LINES (f); + w->total_cols = FRAME_TOTAL_COLS (f); allocate_matrices_for_window_redisplay (w); } #endif @@ -5583,7 +5583,7 @@ FrameCols (FRAME_TTY (f)) = newwidth; if (WINDOWP (f->tool_bar_window)) - wset_total_cols (XWINDOW (f->tool_bar_window), make_number (newwidth)); + XWINDOW (f->tool_bar_window)->total_cols = newwidth; } FRAME_LINES (f) = newheight; === modified file 'src/frame.c' --- src/frame.c 2013-02-17 10:41:33 +0000 +++ src/frame.c 2013-03-20 11:29:37 +0000 @@ -155,8 +155,8 @@ struct window *w = XWINDOW (window); w->last_modified = 0; - wset_top_line (w, make_number (XFASTINT (w->top_line) + n)); - wset_total_lines (w, make_number (XFASTINT (w->total_lines) - n)); + w->top_line += n; + w->total_lines -= n; /* Handle just the top child in a vertical split. */ if (!NILP (w->vchild)) @@ -332,14 +332,14 @@ SET_FRAME_COLS (f, 10); FRAME_LINES (f) = 10; - wset_total_cols (XWINDOW (root_window), make_number (10)); - wset_total_lines (XWINDOW (root_window), make_number (mini_p ? 9 : 10)); + XWINDOW (root_window)->total_cols = 10; + XWINDOW (root_window)->total_lines = mini_p ? 9 : 10; if (mini_p) { - wset_total_cols (XWINDOW (mini_window), make_number (10)); - wset_top_line (XWINDOW (mini_window), make_number (9)); - wset_total_lines (XWINDOW (mini_window), make_number (1)); + XWINDOW (mini_window)->total_cols = 10; + XWINDOW (mini_window)->top_line = 9; + XWINDOW (mini_window)->total_lines = 1; } /* Choose a buffer for the frame's root window. */ === modified file 'src/w32fns.c' --- src/w32fns.c 2013-03-20 09:56:19 +0000 +++ src/w32fns.c 2013-03-20 11:29:37 +0000 @@ -5774,8 +5774,8 @@ /* Set up the frame's root window. */ w = XWINDOW (FRAME_ROOT_WINDOW (f)); - wset_left_col (w, make_number (0)); - wset_top_line (w, make_number (0)); + w->left_col = 0; + w->top_line = 0; if (CONSP (Vx_max_tooltip_size) && INTEGERP (XCAR (Vx_max_tooltip_size)) @@ -5783,13 +5783,13 @@ && INTEGERP (XCDR (Vx_max_tooltip_size)) && XINT (XCDR (Vx_max_tooltip_size)) > 0) { - wset_total_cols (w, XCAR (Vx_max_tooltip_size)); - wset_total_lines (w, XCDR (Vx_max_tooltip_size)); + w->total_cols = XFASTINT (XCAR (Vx_max_tooltip_size)); + w->total_lines = XFASTINT (XCDR (Vx_max_tooltip_size)); } else { - wset_total_cols (w, make_number (80)); - wset_total_lines (w, make_number (40)); + w->total_cols = 80; + w->total_lines = 40; } FRAME_TOTAL_COLS (f) = XINT (w->total_cols); @@ -5860,7 +5860,7 @@ /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, not in pixels. */ width /= WINDOW_FRAME_COLUMN_WIDTH (w); - wset_total_cols (w, make_number (width)); + w->total_cols = width; FRAME_TOTAL_COLS (f) = width; adjust_glyphs (f); w->pseudo_window_p = 1; === modified file 'src/window.c' --- src/window.c 2013-03-19 09:21:31 +0000 +++ src/window.c 2013-03-20 11:29:37 +0000 @@ -692,7 +692,7 @@ integer multiple of the default character height. */) (Lisp_Object window) { - return decode_valid_window (window)->total_lines; + return make_number (decode_valid_window (window)->total_lines); } DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, @@ -707,7 +707,7 @@ integer multiple of the default character width. */) (Lisp_Object window) { - return decode_valid_window (window)->total_cols; + return make_number (decode_valid_window (window)->total_cols); } DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, @@ -746,7 +746,7 @@ WINDOW must be a valid window and defaults to the selected one. */) (Lisp_Object window) { - return decode_valid_window (window)->left_col; + return make_number (decode_valid_window (window)->left_col); } DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, @@ -758,7 +758,7 @@ WINDOW must be a valid window and defaults to the selected one. */) (Lisp_Object window) { - return decode_valid_window (window)->top_line; + return make_number (decode_valid_window (window)->top_line); } /* Return the number of lines of W's body. Don't count any mode or @@ -767,7 +767,7 @@ static int window_body_lines (struct window *w) { - int height = XFASTINT (w->total_lines); + int height = w->total_lines; if (!MINI_WINDOW_P (w)) { @@ -789,7 +789,7 @@ window_body_cols (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - int width = XINT (w->total_cols); + int width = w->total_cols; if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) /* Scroll bars occupy a few columns. */ @@ -2007,12 +2007,12 @@ if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame)))) fset_root_window (XFRAME (o->frame), new); - if (setflag) - { - wset_left_col (n, o->left_col); - wset_top_line (n, o->top_line); - wset_total_cols (n, o->total_cols); - wset_total_lines (n, o->total_lines); + if (setflag) + { + n->left_col = o->left_col; + n->top_line = o->top_line; + n->total_cols = o->total_cols; + n->total_lines = o->total_lines; wset_normal_cols (n, o->normal_cols); wset_normal_cols (o, make_float (1.0)); wset_normal_lines (n, o->normal_lines); @@ -2097,12 +2097,12 @@ if (horflag) wset_normal_cols (c, - make_float (XFLOATINT (c->total_cols) - / XFLOATINT (p->total_cols))); + make_float ((double) c->total_cols + / (double) p->total_cols)); else wset_normal_lines (c, - make_float (XFLOATINT (c->total_lines) - / XFLOATINT (p->total_lines))); + make_float ((double) c->total_lines + / (double) p->total_lines)); if (NILP (c->next)) { @@ -2861,9 +2861,8 @@ if (NILP (w->buffer)) { /* Resize child windows vertically. */ - XSETINT (delta, XINT (r->total_lines) - - XINT (w->total_lines)); - wset_top_line (w, r->top_line); + XSETINT (delta, r->total_lines - w->total_lines); + w->top_line = r->top_line; resize_root_window (window, delta, Qnil, Qnil); if (window_resize_check (w, 0)) window_resize_apply (w, 0); @@ -2879,10 +2878,8 @@ /* Resize child windows horizontally. */ if (!resize_failed) { - wset_left_col (w, r->left_col); - XSETINT (delta, - XINT (r->total_cols) - XINT (w->total_cols)); - wset_left_col (w, r->left_col); + w->left_col = r->left_col; + XSETINT (delta, r->total_cols - w->total_cols); resize_root_window (window, delta, Qt, Qnil); if (window_resize_check (w, 1)) window_resize_apply (w, 1); @@ -3453,10 +3450,6 @@ w = allocate_window (); /* Initialize Lisp data. Note that allocate_window initializes all Lisp data to nil, so do it only for slots which should not be nil. */ - wset_left_col (w, make_number (0)); - wset_top_line (w, make_number (0)); - wset_total_lines (w, make_number (0)); - wset_total_cols (w, make_number (0)); wset_normal_lines (w, make_float (1.0)); wset_normal_cols (w, make_float (1.0)); wset_new_total (w, make_number (0)); @@ -3617,19 +3610,19 @@ parent window has been set *before*. */ if (horflag) { - wset_total_cols (w, w->new_total); + w->total_cols = XFASTINT (w->new_total); if (NUMBERP (w->new_normal)) wset_normal_cols (w, w->new_normal); - pos = XINT (w->left_col); + pos = w->left_col; } else { - wset_total_lines (w, w->new_total); + w->total_lines = XFASTINT (w->new_total); if (NUMBERP (w->new_normal)) wset_normal_lines (w, w->new_normal); - pos = XINT (w->top_line); + pos = w->top_line; } if (!NILP (w->vchild)) @@ -3639,12 +3632,12 @@ while (c) { if (horflag) - wset_left_col (c, make_number (pos)); + c->left_col = pos; else - wset_top_line (c, make_number (pos)); + c->top_line = pos; window_resize_apply (c, horflag); if (!horflag) - pos = pos + XINT (c->total_lines); + pos = pos + c->total_lines; c = NILP (c->next) ? 0 : XWINDOW (c->next); } } @@ -3655,12 +3648,12 @@ while (c) { if (horflag) - wset_left_col (c, make_number (pos)); + c->left_col = pos; else - wset_top_line (c, make_number (pos)); + c->top_line = pos; window_resize_apply (c, horflag); if (horflag) - pos = pos + XINT (c->total_cols); + pos = pos + c->total_cols; c = NILP (c->next) ? 0 : XWINDOW (c->next); } } @@ -3692,8 +3685,8 @@ bool horflag = !NILP (horizontal); if (!window_resize_check (r, horflag) - || ! EQ (r->new_total, - (horflag ? r->total_cols : r->total_lines))) + || (XINT (r->new_total) + != (horflag ? r->total_cols : r->total_lines))) return Qnil; block_input (); @@ -3733,18 +3726,17 @@ - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) ? 1 : 0))); - wset_top_line (r, make_number (FRAME_TOP_MARGIN (f))); + r->top_line = FRAME_TOP_MARGIN (f); if (NILP (r->vchild) && NILP (r->hchild)) /* For a leaf root window just set the size. */ if (horflag) - wset_total_cols (r, make_number (new_size)); + r->total_cols = new_size; else - wset_total_lines (r, make_number (new_size)); + r->total_lines = new_size; else { /* old_size is the old size of the frame's root window. */ - int old_size = XFASTINT (horflag ? r->total_cols - : r->total_lines); + int old_size = horflag ? r->total_cols : r->total_lines; Lisp_Object delta; XSETINT (delta, new_size - old_size); @@ -3774,9 +3766,9 @@ root = f->selected_window; Fdelete_other_windows_internal (root, Qnil); if (horflag) - wset_total_cols (XWINDOW (root), make_number (new_size)); + XWINDOW (root)->total_cols = new_size; else - wset_total_lines (XWINDOW (root), make_number (new_size)); + XWINDOW (root)->total_lines = new_size; } } } @@ -3786,13 +3778,12 @@ { m = XWINDOW (mini); if (horflag) - wset_total_cols (m, make_number (size)); + m->total_cols = size; else { /* Are we sure we always want 1 line here? */ - wset_total_lines (m, make_number (1)); - wset_top_line - (m, make_number (XINT (r->top_line) + XINT (r->total_lines))); + m->total_lines = 1; + m->top_line = r->top_line + r->total_lines; } } @@ -3876,20 +3867,21 @@ p = XWINDOW (o->parent); /* Temporarily pretend we split the parent window. */ wset_new_total - (p, make_number (XINT (horflag ? p->total_cols : p->total_lines) + (p, make_number ((horflag ? p->total_cols : p->total_lines) - XINT (total_size))); if (!window_resize_check (p, horflag)) error ("Window sizes don't fit"); else /* Undo the temporary pretension. */ - wset_new_total (p, horflag ? p->total_cols : p->total_lines); + wset_new_total (p, make_number + (horflag ? p->total_cols : p->total_lines)); } else { if (!window_resize_check (o, horflag)) error ("Resizing old window failed"); else if (XINT (total_size) + XINT (o->new_total) - != XINT (horflag ? o->total_cols : o->total_lines)) + != (horflag ? o->total_cols : o->total_lines)) error ("Sum of sizes of old and new window don't fit"); } @@ -3909,7 +3901,8 @@ that its children get merged into another window. */ wset_combination_limit (p, Qt); /* These get applied below. */ - wset_new_total (p, horflag ? o->total_cols : o->total_lines); + wset_new_total (p, make_number + (horflag ? o->total_cols : o->total_lines)); wset_new_normal (p, new_normal); } else @@ -3961,13 +3954,13 @@ /* Directly assign orthogonal coordinates and sizes. */ if (horflag) { - wset_top_line (n, o->top_line); - wset_total_lines (n, o->total_lines); + n->top_line = o->top_line; + n->total_lines = o->total_lines; } else { - wset_left_col (n, o->left_col); - wset_total_cols (n, o->total_cols); + n->left_col = o->left_col; + n->total_cols = o->total_cols; } /* Iso-coordinates and sizes are assigned by window_resize_apply, @@ -4056,8 +4049,8 @@ } if (window_resize_check (r, horflag) - && EQ (r->new_total, - (horflag ? r->total_cols : r->total_lines))) + && (XINT (r->new_total) + == (horflag ? r->total_cols : r->total_lines))) /* We can delete WINDOW now. */ { @@ -4203,10 +4196,8 @@ window_resize_apply (r, 0); /* Grow the mini-window. */ - wset_top_line - (w, make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); - wset_total_lines - (w, make_number (XFASTINT (w->total_lines) - XINT (value))); + w->top_line = r->top_line + r->total_lines; + w->total_lines -= XINT (value); w->last_modified = 0; w->last_overlay_modified = 0; @@ -4228,7 +4219,7 @@ eassert (MINI_WINDOW_P (w)); - size = XINT (w->total_lines); + size = w->total_lines; if (size > 1) { root = FRAME_ROOT_WINDOW (f); @@ -4241,9 +4232,8 @@ window_resize_apply (r, 0); /* Shrink the mini-window. */ - wset_top_line (w, make_number (XFASTINT (r->top_line) - + XFASTINT (r->total_lines))); - wset_total_lines (w, make_number (1)); + w->top_line = r->top_line + r->total_lines; + w->total_lines = 1; w->last_modified = 0; w->last_overlay_modified = 0; @@ -4277,7 +4267,7 @@ error ("Cannot resize a minibuffer-only frame"); r = XWINDOW (FRAME_ROOT_WINDOW (f)); - height = XINT (r->total_lines) + XINT (w->total_lines); + height = r->total_lines + w->total_lines; if (window_resize_check (r, 0) && XINT (w->new_total) > 0 && height == XINT (r->new_total) + XINT (w->new_total)) @@ -4285,9 +4275,8 @@ block_input (); window_resize_apply (r, 0); - wset_total_lines (w, w->new_total); - wset_top_line (w, make_number (XINT (r->top_line) - + XINT (r->total_lines))); + w->total_lines = XFASTINT (w->new_total); + w->top_line = r->top_line + r->total_lines; windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; @@ -4327,7 +4316,7 @@ int window_internal_height (struct window *w) { - int ht = XFASTINT (w->total_lines); + int ht = w->total_lines; if (!MINI_WINDOW_P (w)) { @@ -4637,7 +4626,7 @@ even if there is a header line. */ this_scroll_margin = max (0, scroll_margin); this_scroll_margin - = min (this_scroll_margin, XFASTINT (w->total_lines) / 4); + = min (this_scroll_margin, w->total_lines / 4); this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); if (n > 0) @@ -4814,7 +4803,7 @@ { /* Don't use a scroll margin that is negative or too large. */ int this_scroll_margin = - max (0, min (scroll_margin, XINT (w->total_lines) / 4)); + max (0, min (scroll_margin, w->total_lines / 4)); set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); w->start_at_line_beg = !NILP (bolp); @@ -5231,7 +5220,7 @@ /* Do this after making BUF current in case scroll_margin is buffer-local. */ this_scroll_margin = - max (0, min (scroll_margin, XFASTINT (w->total_lines) / 4)); + max (0, min (scroll_margin, w->total_lines / 4)); /* Handle centering on a graphical frame specially. Such frames can have variable-height lines and centering point on the basis of @@ -5705,7 +5694,7 @@ wset_prev (w, Qnil); if (!NILP (w->parent)) { - if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols)) + if (XINT (p->total_cols) == XWINDOW (w->parent)->total_cols) { wset_vchild (XWINDOW (w->parent), p->window); wset_hchild (XWINDOW (w->parent), Qnil); @@ -5721,10 +5710,10 @@ /* If we squirreled away the buffer, restore it now. */ if (BUFFERP (w->combination_limit)) wset_buffer (w, w->combination_limit); - wset_left_col (w, p->left_col); - wset_top_line (w, p->top_line); - wset_total_cols (w, p->total_cols); - wset_total_lines (w, p->total_lines); + w->left_col = XFASTINT (p->left_col); + w->top_line = XFASTINT (p->top_line); + w->total_cols = XFASTINT (p->total_cols); + w->total_lines = XFASTINT (p->total_lines); wset_normal_cols (w, p->normal_cols); wset_normal_lines (w, p->normal_lines); w->hscroll = XFASTINT (p->hscroll); @@ -6038,10 +6027,10 @@ wset_temslot (w, make_number (i)); i++; p->window = window; p->buffer = w->buffer; - p->left_col = w->left_col; - p->top_line = w->top_line; - p->total_cols = w->total_cols; - p->total_lines = w->total_lines; + p->left_col = make_number (w->left_col); + p->top_line = make_number (w->top_line); + p->total_cols = make_number (w->total_cols); + p->total_lines = make_number (w->total_lines); p->normal_cols = w->normal_cols; p->normal_lines = w->normal_lines; XSETFASTINT (p->hscroll, w->hscroll); === modified file 'src/window.h' --- src/window.h 2013-03-18 13:21:12 +0000 +++ src/window.h 2013-03-20 11:29:37 +0000 @@ -112,20 +112,14 @@ /* The window this one is a child of. */ Lisp_Object parent; - /* The upper left corner coordinates of this window, as integers - relative to upper left corner of frame = 0, 0. */ - Lisp_Object left_col; - Lisp_Object top_line; - - /* The size of the window. */ - Lisp_Object total_lines; - Lisp_Object total_cols; - - /* The normal size of the window. */ + /* The normal size of the window. These are fractions, but we do + not use C doubles to avoid creating new Lisp_Float objects while + interfacing Lisp in Fwindow_normal_size. */ Lisp_Object normal_lines; Lisp_Object normal_cols; - /* New sizes of the window. */ + /* New sizes of the window. Note that Lisp code may set new_normal + to something beyond an integer, so C int can't be used here. */ Lisp_Object new_total; Lisp_Object new_normal; @@ -221,6 +215,15 @@ /* Number saying how recently window was selected. */ int use_time; + /* The upper left corner coordinates of this window, + relative to upper left corner of frame = 0, 0. */ + int left_col; + int top_line; + + /* The size of the window. */ + int total_lines; + int total_cols; + /* Number of columns display within the window is scrolled to the left. */ ptrdiff_t hscroll; @@ -354,11 +357,6 @@ w->frame = val; } WINDOW_INLINE void -wset_left_col (struct window *w, Lisp_Object val) -{ - w->left_col = val; -} -WINDOW_INLINE void wset_next (struct window *w, Lisp_Object val) { w->next = val; @@ -374,21 +372,6 @@ w->redisplay_end_trigger = val; } WINDOW_INLINE void -wset_top_line (struct window *w, Lisp_Object val) -{ - w->top_line = val; -} -WINDOW_INLINE void -wset_total_cols (struct window *w, Lisp_Object val) -{ - w->total_cols = val; -} -WINDOW_INLINE void -wset_total_lines (struct window *w, Lisp_Object val) -{ - w->total_lines = val; -} -WINDOW_INLINE void wset_vertical_scroll_bar (struct window *w, Lisp_Object val) { w->vertical_scroll_bar = val; @@ -461,14 +444,12 @@ /* Return the width of window W in canonical column units. This includes scroll bars and fringes. */ -#define WINDOW_TOTAL_COLS(W) \ - (XFASTINT (W->total_cols)) +#define WINDOW_TOTAL_COLS(W) (W)->total_cols /* Return the height of window W in canonical line units. This includes header and mode lines, if any. */ -#define WINDOW_TOTAL_LINES(W) \ - (XFASTINT (W->total_lines)) +#define WINDOW_TOTAL_LINES(W) (W)->total_lines /* Return the total pixel width of window W. */ @@ -495,8 +476,7 @@ /* Return the canonical frame column at which window W starts. This includes a left-hand scroll bar, if any. */ -#define WINDOW_LEFT_EDGE_COL(W) \ - (XFASTINT (W->left_col)) +#define WINDOW_LEFT_EDGE_COL(W) (W)->left_col /* Return the canonical frame column before which window W ends. This includes a right-hand scroll bar, if any. */ @@ -507,8 +487,7 @@ /* Return the canonical frame line at which window W starts. This includes a header line, if any. */ -#define WINDOW_TOP_EDGE_LINE(W) \ - (XFASTINT (W->top_line)) +#define WINDOW_TOP_EDGE_LINE(W) (W)->top_line /* Return the canonical frame line before which window W ends. This includes a mode line, if any. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2013-03-20 09:56:19 +0000 +++ src/xdisp.c 2013-03-20 11:29:37 +0000 @@ -979,7 +979,7 @@ int window_box_width (struct window *w, int area) { - int cols = XFASTINT (w->total_cols); + int cols = w->total_cols; int pixels = 0; if (!w->pseudo_window_p) @@ -29218,13 +29218,13 @@ echo_area_window = minibuf_window; - wset_top_line (r, make_number (FRAME_TOP_MARGIN (f))); - wset_total_lines - (r, make_number (FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f))); - wset_total_cols (r, make_number (FRAME_COLS (f))); - wset_top_line (m, make_number (FRAME_LINES (f) - 1)); - wset_total_lines (m, make_number (1)); - wset_total_cols (m, make_number (FRAME_COLS (f))); + r->top_line = FRAME_TOP_MARGIN (f); + r->total_lines = FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f); + r->total_cols = FRAME_COLS (f); + + m->top_line = FRAME_LINES (f) - 1; + m->total_lines = 1; + m->total_cols = FRAME_COLS (f); scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs; scratch_glyph_row.glyphs[TEXT_AREA + 1] === modified file 'src/xfns.c' --- src/xfns.c 2013-03-20 09:56:19 +0000 +++ src/xfns.c 2013-03-20 11:29:37 +0000 @@ -5021,23 +5021,23 @@ /* Set up the frame's root window. */ w = XWINDOW (FRAME_ROOT_WINDOW (f)); - wset_left_col (w, make_number (0)); - wset_top_line (w, make_number (0)); + w->left_col = 0; + w->top_line = 0; if (CONSP (Vx_max_tooltip_size) && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX) && RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX)) { - wset_total_cols (w, XCAR (Vx_max_tooltip_size)); - wset_total_lines (w, XCDR (Vx_max_tooltip_size)); + w->total_cols = XFASTINT (XCAR (Vx_max_tooltip_size)); + w->total_lines = XFASTINT (XCDR (Vx_max_tooltip_size)); } else { - wset_total_cols (w, make_number (80)); - wset_total_lines (w, make_number (40)); + w->total_cols = 80; + w->total_lines = 40; } - FRAME_TOTAL_COLS (f) = XINT (w->total_cols); + FRAME_TOTAL_COLS (f) = w->total_cols; adjust_glyphs (f); w->pseudo_window_p = 1; @@ -5104,7 +5104,7 @@ /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, not in pixels. */ width /= WINDOW_FRAME_COLUMN_WIDTH (w); - wset_total_cols (w, make_number (width)); + w->total_cols = width; FRAME_TOTAL_COLS (f) = width; adjust_glyphs (f); clear_glyph_matrix (w->desired_matrix); ------------------------------------------------------------ revno: 112100 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-03-20 13:59:07 +0400 message: Fix ChangeLog entry. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-20 09:56:19 +0000 +++ src/ChangeLog 2013-03-20 09:59:07 +0000 @@ -2,7 +2,7 @@ * frame.h (struct frame): Drop resx and resy because the same data is available from window system-specific output context. Adjust users. - (default_pixesls_per_inch_x, default_pixesls_per_inch_y): New + (default_pixels_per_inch_x, default_pixels_per_inch_y): New functions to provide defaults when no window system available. (FRAME_RES_X, FRAME_RES_Y): New macros. (NUMVAL): Moved from xdisp.c. ------------------------------------------------------------ revno: 112099 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-03-20 13:56:19 +0400 message: * frame.h (struct frame): Drop resx and resy because the same data is available from window system-specific output context. Adjust users. (default_pixesls_per_inch_x, default_pixesls_per_inch_y): New functions to provide defaults when no window system available. (FRAME_RES_X, FRAME_RES_Y): New macros. (NUMVAL): Moved from xdisp.c. * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface) (Ffont_face_attributes, Fopen_font): * image.c (gs_load): * w32font.c (fill_in_logfont): * xdisp.c (calc_pixel_width_or_height): * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them. * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-20 08:08:34 +0000 +++ src/ChangeLog 2013-03-20 09:56:19 +0000 @@ -1,3 +1,19 @@ +2013-03-20 Dmitry Antipov + + * frame.h (struct frame): Drop resx and resy because the same data is + available from window system-specific output context. Adjust users. + (default_pixesls_per_inch_x, default_pixesls_per_inch_y): New + functions to provide defaults when no window system available. + (FRAME_RES_X, FRAME_RES_Y): New macros. + (NUMVAL): Moved from xdisp.c. + * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface) + (Ffont_face_attributes, Fopen_font): + * image.c (gs_load): + * w32font.c (fill_in_logfont): + * xdisp.c (calc_pixel_width_or_height): + * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them. + * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment. + 2013-03-20 Kenichi Handa * coding.c (syms_of_coding): Initialize disable_ascii_optimization === modified file 'src/font.c' --- src/font.c 2013-03-05 01:48:30 +0000 +++ src/font.c 2013-03-20 09:56:19 +0000 @@ -287,7 +287,7 @@ if (INTEGERP (val)) dpi = XINT (val); else - dpi = f->resy; + dpi = FRAME_RES_Y (f); pixel_size = POINT_TO_PIXEL (point_size, dpi); return pixel_size; #else @@ -3117,7 +3117,7 @@ { double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); - pixel_size = POINT_TO_PIXEL (pt / 10, f->resy); + pixel_size = POINT_TO_PIXEL (pt / 10, FRAME_RES_Y (f)); } ASET (work, FONT_SIZE_INDEX, Qnil); foundry[0] = AREF (work, FONT_FOUNDRY_INDEX); @@ -3247,12 +3247,13 @@ } pt /= 10; - size = POINT_TO_PIXEL (pt, f->resy); + size = POINT_TO_PIXEL (pt, FRAME_RES_Y (f)); #ifdef HAVE_NS if (size == 0) { Lisp_Object ffsize = get_frame_param (f, Qfontsize); - size = NUMBERP (ffsize) ? POINT_TO_PIXEL (XINT (ffsize), f->resy) : 0; + size = (NUMBERP (ffsize) + ? POINT_TO_PIXEL (XINT (ffsize), FRAME_RES_Y (f)) : 0); } #endif } @@ -4021,7 +4022,7 @@ if (INTEGERP (val)) { Lisp_Object font_dpi = AREF (font, FONT_DPI_INDEX); - int dpi = INTEGERP (font_dpi) ? XINT (font_dpi) : f->resy; + int dpi = INTEGERP (font_dpi) ? XINT (font_dpi) : FRAME_RES_Y (f); plist[n++] = QCheight; plist[n++] = make_number (PIXEL_TO_POINT (XINT (val) * 10, dpi)); } @@ -4532,7 +4533,7 @@ { CHECK_NUMBER_OR_FLOAT (size); if (FLOATP (size)) - isize = POINT_TO_PIXEL (XFLOAT_DATA (size), f->resy); + isize = POINT_TO_PIXEL (XFLOAT_DATA (size), FRAME_RES_Y (f)); else isize = XINT (size); if (! (INT_MIN <= isize && isize <= INT_MAX)) === modified file 'src/frame.h' --- src/frame.h 2013-01-24 05:41:28 +0000 +++ src/frame.h 2013-03-20 09:56:19 +0000 @@ -276,9 +276,6 @@ /* Size of the frame window in pixels. */ int pixel_height, pixel_width; - /* Dots per inch of the screen the frame is on. */ - double resx, resy; - /* These many pixels are the difference between the outer window (i.e. the left and top of the window manager decoration) and FRAME_X_WINDOW. */ int x_pixels_diff, y_pixels_diff; @@ -569,6 +566,26 @@ f->tool_bar_window = val; } +#define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1) + +FRAME_INLINE double +default_pixels_per_inch_x (void) +{ + Lisp_Object v = (CONSP (Vdisplay_pixels_per_inch) + ? XCAR (Vdisplay_pixels_per_inch) + : Vdisplay_pixels_per_inch); + return NUMVAL (v) > 0 ? NUMVAL (v) : 72.0; +} + +FRAME_INLINE double +default_pixels_per_inch_y (void) +{ + Lisp_Object v = (CONSP (Vdisplay_pixels_per_inch) + ? XCDR (Vdisplay_pixels_per_inch) + : Vdisplay_pixels_per_inch); + return NUMVAL (v) > 0 ? NUMVAL (v) : 72.0; +} + #define FRAME_KBOARD(f) ((f)->terminal->kboard) /* Return a pointer to the image cache of frame F. */ @@ -602,6 +619,37 @@ #else #define FRAME_NS_P(f) ((f)->output_method == output_ns) #endif + +/* Dots per inch of the screen the frame F is on. */ + +#ifdef HAVE_X_WINDOWS +#define FRAME_RES_X(f) \ + (eassert (FRAME_X_P (f)), FRAME_X_DISPLAY_INFO (f)->resx) +#define FRAME_RES_Y(f) \ + (eassert (FRAME_X_P (f)), FRAME_X_DISPLAY_INFO (f)->resy) +#endif + +#ifdef HAVE_NTGUI +#define FRAME_RES_X(f) \ + (eassert (FRAME_W32_P (f)), FRAME_W32_DISPLAY_INFO (f)->resx) +#define FRAME_RES_Y(f) \ + (eassert (FRAME_W32_P (f)), FRAME_W32_DISPLAY_INFO (f)->resy) +#endif + +#ifdef HAVE_NS +#define FRAME_RES_X(f) \ + (eassert (FRAME_NS_P (f)), FRAME_NS_DISPLAY_INFO (f)->resx) +#define FRAME_RES_Y(f) \ + (eassert (FRAME_NS_P (f)), FRAME_NS_DISPLAY_INFO (f)->resy) +#endif + +/* Defaults when no window system available. */ + +#ifndef FRAME_RES_X +#define FRAME_RES_X(f) default_pixels_per_inch_x () +#define FRAME_RES_Y(f) default_pixels_per_inch_y () +#endif + /* FRAME_WINDOW_P tests whether the frame is a window, and is defined to be the predicate for the window system being used. */ === modified file 'src/image.c' --- src/image.c 2013-03-19 04:41:53 +0000 +++ src/image.c 2013-03-20 09:56:19 +0000 @@ -8554,10 +8554,10 @@ info. */ pt_width = image_spec_value (img->spec, QCpt_width, NULL); in_width = INTEGERP (pt_width) ? XFASTINT (pt_width) / 72.0 : 0; - in_width *= FRAME_X_DISPLAY_INFO (f)->resx; + in_width *= FRAME_RES_X (f); pt_height = image_spec_value (img->spec, QCpt_height, NULL); in_height = INTEGERP (pt_height) ? XFASTINT (pt_height) / 72.0 : 0; - in_height *= FRAME_X_DISPLAY_INFO (f)->resy; + in_height *= FRAME_RES_Y (f); if (! (in_width <= INT_MAX && in_height <= INT_MAX && check_image_size (f, in_width, in_height))) === modified file 'src/nsfns.m' --- src/nsfns.m 2013-03-16 13:52:12 +0000 +++ src/nsfns.m 2013-03-20 09:56:19 +0000 @@ -1243,9 +1243,6 @@ specbind (Qx_resource_name, name); } - f->resx = dpyinfo->resx; - f->resy = dpyinfo->resy; - block_input (); register_font_driver (&nsfont_driver, f); x_default_parameter (f, parms, Qfont_backend, Qnil, === modified file 'src/w32fns.c' --- src/w32fns.c 2013-03-10 22:55:25 +0000 +++ src/w32fns.c 2013-03-20 09:56:19 +0000 @@ -4353,9 +4353,6 @@ specbind (Qx_resource_name, name); } - f->resx = dpyinfo->resx; - f->resy = dpyinfo->resy; - if (uniscribe_available) register_font_driver (&uniscribe_font_driver, f); register_font_driver (&w32font_driver, f); @@ -5420,9 +5417,6 @@ specbind (Qx_resource_name, name); } - f->resx = dpyinfo->resx; - f->resy = dpyinfo->resy; - if (uniscribe_available) register_font_driver (&uniscribe_font_driver, f); register_font_driver (&w32font_driver, f); === modified file 'src/w32font.c' --- src/w32font.c 2013-01-01 09:11:05 +0000 +++ src/w32font.c 2013-03-20 09:56:19 +0000 @@ -1967,7 +1967,7 @@ fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec) { Lisp_Object tmp, extra; - int dpi = FRAME_W32_DISPLAY_INFO (f)->resy; + int dpi = FRAME_RES_Y (f); tmp = AREF (font_spec, FONT_DPI_INDEX); if (INTEGERP (tmp)) === modified file 'src/xdisp.c' --- src/xdisp.c 2013-03-13 15:21:46 +0000 +++ src/xdisp.c 2013-03-20 09:56:19 +0000 @@ -22082,11 +22082,6 @@ */ -#define NUMVAL(X) \ - ((INTEGERP (X) || FLOATP (X)) \ - ? XFLOATINT (X) \ - : - 1) - static int calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, struct font *font, int width_p, int *align_to) @@ -22117,24 +22112,11 @@ pixels = 0; if (pixels > 0) { - double ppi; -#ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (it->f) - && (ppi = (width_p - ? FRAME_X_DISPLAY_INFO (it->f)->resx - : FRAME_X_DISPLAY_INFO (it->f)->resy), - ppi > 0)) - return OK_PIXELS (ppi / pixels); -#endif - - if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0) - || (CONSP (Vdisplay_pixels_per_inch) - && (ppi = (width_p - ? NUMVAL (XCAR (Vdisplay_pixels_per_inch)) - : NUMVAL (XCDR (Vdisplay_pixels_per_inch))), - ppi > 0))) - return OK_PIXELS (ppi / pixels); - + double ppi = (width_p ? FRAME_RES_X (it->f) + : FRAME_RES_Y (it->f)); + + if (ppi > 0) + return OK_PIXELS (ppi / pixels); return 0; } } === modified file 'src/xfaces.c' --- src/xfaces.c 2013-03-19 04:41:53 +0000 +++ src/xfaces.c 2013-03-20 09:56:19 +0000 @@ -1592,7 +1592,7 @@ ASET (v, 0, AREF (font, FONT_FAMILY_INDEX)); ASET (v, 1, FONT_WIDTH_SYMBOLIC (font)); point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10, - XFRAME (frame)->resy); + FRAME_RES_Y (XFRAME (frame))); ASET (v, 2, make_number (point)); ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font)); ASET (v, 4, FONT_SLANT_SYMBOLIC (font)); @@ -2118,7 +2118,7 @@ if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface))) { - int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy); + int pt = PIXEL_TO_POINT (font->pixel_size * 10, FRAME_RES_Y (f)); eassert (pt > 0); ASET (lface, LFACE_HEIGHT_INDEX, make_number (pt)); === modified file 'src/xfns.c' --- src/xfns.c 2013-03-13 07:27:34 +0000 +++ src/xfns.c 2013-03-20 09:56:19 +0000 @@ -3182,9 +3182,6 @@ specbind (Qx_resource_name, name); } - f->resx = dpyinfo->resx; - f->resy = dpyinfo->resy; - #ifdef HAVE_FREETYPE #ifdef HAVE_XFT register_font_driver (&xftfont_driver, f); @@ -4631,9 +4628,6 @@ specbind (Qx_resource_name, name); } - f->resx = dpyinfo->resx; - f->resy = dpyinfo->resy; - register_font_driver (&xfont_driver, f); #ifdef HAVE_FREETYPE #ifdef HAVE_XFT === modified file 'src/xsettings.c' --- src/xsettings.c 2013-01-01 09:11:05 +0000 +++ src/xsettings.c 2013-03-20 09:56:19 +0000 @@ -673,19 +673,14 @@ if ((settings->seen & SEEN_DPI) != 0 && oldsettings.dpi != settings->dpi && settings->dpi > 0) { - Lisp_Object frame, tail; - FcPatternDel (pat, FC_DPI); FcPatternAddDouble (pat, FC_DPI, settings->dpi); ++changed; oldsettings.dpi = settings->dpi; - /* Change the DPI on this display and all frames on the display. */ + /* Changing the DPI on this display affects all frames on it. + Check FRAME_RES_X and FRAME_RES_Y in frame.h to see how. */ dpyinfo->resy = dpyinfo->resx = settings->dpi; - FOR_EACH_FRAME (tail, frame) - if (FRAME_X_P (XFRAME (frame)) - && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) - XFRAME (frame)->resy = XFRAME (frame)->resx = settings->dpi; } if (changed) ------------------------------------------------------------ revno: 112098 [merge] committer: K. Handa branch nick: trunk timestamp: Wed 2013-03-20 17:10:02 +0900 message: coding.c (syms_of_coding): Initialize disable_ascii_optimization 1. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-19 14:09:05 +0000 +++ src/ChangeLog 2013-03-20 08:08:34 +0000 @@ -1,3 +1,9 @@ +2013-03-20 Kenichi Handa + + * coding.c (syms_of_coding): Initialize disable_ascii_optimization + to 1 (temporary workaround until a bug related to ASCII + optimization is fixed). + 2013-03-19 Dmitry Antipov * window.c (Fwindow_combination_limit, Fset_window_combination_limit): === modified file 'src/coding.c' --- src/coding.c 2013-03-19 04:41:53 +0000 +++ src/coding.c 2013-03-20 08:08:34 +0000 @@ -10877,7 +10877,7 @@ DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization, doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files. Internal use only. Removed after the experimental optimizer gets stable. */); - disable_ascii_optimization = 0; + disable_ascii_optimization = 1; DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input, doc: /* Char table for translating self-inserting characters. ------------------------------------------------------------ revno: 112097 committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-03-19 22:18:31 -0700 message: * Makefile.in ($(srcdir)/ja-dic/ja-dic.el): Use batch-skkdic-convert. diff: === modified file 'leim/ChangeLog' --- leim/ChangeLog 2013-03-18 18:56:27 +0000 +++ leim/ChangeLog 2013-03-20 05:18:31 +0000 @@ -1,3 +1,7 @@ +2013-03-20 Paul Eggert + + * Makefile.in ($(srcdir)/ja-dic/ja-dic.el): Use batch-skkdic-convert. + 2013-03-18 Eli Zaretskii * makefile.w32-in ($(srcdir)/ja-dic/ja-dic.el): New target. === modified file 'leim/Makefile.in' --- leim/Makefile.in 2013-03-18 04:30:20 +0000 +++ leim/Makefile.in 2013-03-20 05:18:31 +0000 @@ -146,8 +146,9 @@ $(srcdir)/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L @$(MKDIR_P) $(srcdir)/ja-dic - $(RUN_EMACS) -l $(buildlisppath)/international/ja-dic-cnv \ - --eval '(skkdic-convert "$(srcdir)/SKK-DIC/SKK-JISYO.L" "$(srcdir)/ja-dic")' + $(RUN_EMACS) -batch -l $(buildlisppath)/international/ja-dic-cnv \ + -f batch-skkdic-convert -dir "$(srcdir)/ja-dic" \ + "$(srcdir)/SKK-DIC/SKK-JISYO.L" ## Following adapted from lisp/Makefile.in. setwins=wins="${srcdir}/ja-dic quail"; \ ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.