Now on revision 112649. ------------------------------------------------------------ revno: 112649 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2013-05-21 09:27:33 +0400 message: * xdisp.c (reseat_at_previous_visible_line_start): Already declared in dispextern.h, so remove it here. (move_it_vertically_backward): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-05-20 08:27:56 +0000 +++ src/ChangeLog 2013-05-21 05:27:33 +0000 @@ -1,3 +1,9 @@ +2013-05-21 Dmitry Antipov + + * xdisp.c (reseat_at_previous_visible_line_start): + Already declared in dispextern.h, so remove it here. + (move_it_vertically_backward): Likewise. + 2013-05-20 YAMAMOTO Mitsuharu * xfns.c (check_x_display_info): Don't use XINT for terminal object. === modified file 'src/xdisp.c' --- src/xdisp.c 2013-05-16 18:33:27 +0000 +++ src/xdisp.c 2013-05-21 05:27:33 +0000 @@ -881,7 +881,6 @@ static void reseat (struct it *, struct text_pos, int); static void reseat_1 (struct it *, struct text_pos, int); static void back_to_previous_visible_line_start (struct it *); -void reseat_at_previous_visible_line_start (struct it *); static void reseat_at_next_visible_line_start (struct it *, int); static int next_element_from_ellipsis (struct it *); static int next_element_from_display_vector (struct it *); @@ -900,7 +899,6 @@ static enum move_it_result move_it_in_display_line_to (struct it *, ptrdiff_t, int, enum move_operation_enum); -void move_it_vertically_backward (struct it *, int); static void get_visually_first_element (struct it *); static void init_to_row_start (struct it *, struct window *, struct glyph_row *); ------------------------------------------------------------ revno: 112648 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-05-20 21:59:36 -0400 message: * lisp/mh-e/mh-comp.el (mh-regexp-in-field-p): Fix previous change. diff: === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2013-05-09 01:40:20 +0000 +++ lisp/mh-e/ChangeLog 2013-05-21 01:59:36 +0000 @@ -1,3 +1,7 @@ +2013-05-21 Glenn Morris + + * mh-comp.el (mh-regexp-in-field-p): Fix previous change. + 2013-05-09 Glenn Morris * mh-e.el (mh-sortm-args, mh-default-folder-for-message-function): === modified file 'lisp/mh-e/mh-comp.el' --- lisp/mh-e/mh-comp.el 2013-05-08 16:27:53 +0000 +++ lisp/mh-e/mh-comp.el 2013-05-21 01:59:36 +0000 @@ -1,7 +1,6 @@ ;;; mh-comp.el --- MH-E functions for composing and sending messages -;; Copyright (C) 1993, 1995, 1997, 2000-2013 Free Software Foundation, -;; Inc. +;; Copyright (C) 1993, 1995, 1997, 2000-2013 Free Software Foundation, Inc. ;; Author: Bill Wohler ;; Maintainer: Bill Wohler @@ -1204,18 +1203,18 @@ (save-excursion (let ((search-result nil)) (while fields - (let ((field (car fields)) - (syntax-table - (or mh-regexp-in-field-syntax-table - (let ((case-fold-search t)) - (cond - ((string-match field "^To$\\|^[BD]?cc$\\|^From$") - mh-addr-syntax-table) - ((string-match field "^Fcc$") - mh-fcc-syntax-table) - (t - (syntax-table))) - )))) + (let* ((field (car fields)) + (syntax-table + (or mh-regexp-in-field-syntax-table + (let ((case-fold-search t)) + (cond + ((string-match field "^To$\\|^[BD]?cc$\\|^From$") + mh-addr-syntax-table) + ((string-match field "^Fcc$") + mh-fcc-syntax-table) + (t + (syntax-table))) + )))) (if (and (mh-goto-header-field field) (set-syntax-table syntax-table) (re-search-forward ------------------------------------------------------------ revno: 112647 committer: Leo Liu branch nick: trunk timestamp: Tue 2013-05-21 06:52:40 +0800 message: Use octave-help-mode for the Octave Help buffer diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-20 07:45:58 +0000 +++ lisp/ChangeLog 2013-05-20 22:52:40 +0000 @@ -1,3 +1,10 @@ +2013-05-20 Leo Liu + + * progmodes/octave.el (octave-help-mode-map) + (octave-help-mode-finish-hook): New variables. + (octave-help-mode, octave-help-mode-finish): New functions. + (octave-help): Use octave-help-mode. + 2013-05-20 Glenn Morris * format-spec.el (format-spec): Allow spec chars with nil. (Bug#14420) === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-05-18 03:17:35 +0000 +++ lisp/progmodes/octave.el 2013-05-20 22:52:40 +0000 @@ -1587,14 +1587,54 @@ (octave-help (buffer-substring (button-start b) (button-end b))))) -(defvar help-xref-following) +(defvar octave-help-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\M-." 'octave-find-definition) + (define-key map "\C-hd" 'octave-help) + map)) + +(define-derived-mode octave-help-mode help-mode "OctHelp" + "Major mode for displaying Octave documentation." + :abbrev-table nil + :syntax-table octave-mode-syntax-table + (eval-and-compile (require 'help-mode)) + ;; Mostly stolen from `help-make-xrefs'. + (let ((inhibit-read-only t)) + (setq-local info-lookup-mode 'octave-mode) + ;; Delete extraneous newlines at the end of the docstring + (goto-char (point-max)) + (while (and (not (bobp)) (bolp)) + (delete-char -1)) + (insert "\n") + (when (or help-xref-stack help-xref-forward-stack) + (insert "\n")) + (when help-xref-stack + (help-insert-xref-button help-back-label 'help-back + (current-buffer))) + (when help-xref-forward-stack + (when help-xref-stack + (insert "\t")) + (help-insert-xref-button help-forward-label 'help-forward + (current-buffer))) + (when (or help-xref-stack help-xref-forward-stack) + (insert "\n")))) + +(defvar octave-help-mode-finish-hook nil + "Octave specific hook for `temp-buffer-show-hook'.") + +(defun octave-help-mode-finish () + (when (eq major-mode 'octave-help-mode) + (run-hooks 'octave-help-mode-finish-hook))) + +(add-hook 'temp-buffer-show-hook 'octave-help-mode-finish) (defun octave-help (fn) "Display the documentation of FN." (interactive (list (octave-completing-read))) (inferior-octave-send-list-and-digest (list (format "help \"%s\"\n" fn))) - (let ((lines inferior-octave-output-list)) + (let ((lines inferior-octave-output-list) + (inhibit-read-only t)) (when (string-match "error: \\(.*\\)$" (car lines)) (error "%s" (match-string 1 (car lines)))) (with-help-window octave-help-buffer @@ -1605,7 +1645,6 @@ (let ((help-xref-following t)) (help-setup-xref (list 'octave-help fn) (called-interactively-p 'interactive))) - (setq-local info-lookup-mode 'octave-mode) ;; Note: can be turned off by suppress_verbose_help_message. ;; ;; Remove boring trailing text: Additional help for built-in functions @@ -1631,7 +1670,8 @@ (while (re-search-forward "\\_<\\(?:\\sw\\|\\s_\\)+\\_>" nil t) (make-text-button (match-beginning 0) (match-end 0) - :type 'octave-help-function)))))))) + :type 'octave-help-function)))) + (octave-help-mode))))) (defcustom octave-source-directories nil "A list of directories for Octave sources. ------------------------------------------------------------ revno: 112646 author: Adam Sjøgren committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2013-05-20 22:37:06 +0000 message: lisp/gnus/gnus-spec.el (gnus-parse-complex-format): Use unicode escape for left double angle quotation mark diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-05-19 22:50:16 +0000 +++ lisp/gnus/ChangeLog 2013-05-20 22:37:06 +0000 @@ -1,3 +1,8 @@ +2013-05-20 Adam Sjøgren + + * gnus-spec.el (gnus-parse-complex-format): Use unicode escape for left + double angle quotation mark. + 2013-05-19 Adam Sjøgren * message.el (message-insert-formatted-citation-line): Handle finding === modified file 'lisp/gnus/gnus-spec.el' --- lisp/gnus/gnus-spec.el 2013-03-05 17:13:01 +0000 +++ lisp/gnus/gnus-spec.el 2013-05-20 22:37:06 +0000 @@ -441,7 +441,7 @@ (delim (aref (match-string 2) 0))) (if (or (= delim ?\() (= delim ?\{) - (= delim ?\«)) + (= delim ?\u00AB)) ; « (replace-match (concat "\"(" (cond ((= delim ?\() "mouse") ((= delim ?\{) "face") ------------------------------------------------------------ revno: 112645 committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Mon 2013-05-20 17:27:56 +0900 message: Sync x-server-* and x-display-* functions on NS with those on X11. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-05-20 03:15:20 +0000 +++ src/ChangeLog 2013-05-20 08:27:56 +0000 @@ -5,6 +5,23 @@ (Fx_display_mm_width, Fx_display_mm_height): Mention `display-monitor-attributes-list' in docstrings. + * nsfns.m (ns_get_screen): Remove function. All uses removed. + (check_ns_display_info): Sync with check_x_display_info in xfns.c. + (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version) + (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height) + (Fx_display_backing_store, Fx_display_visual_class) + (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p) + (Fx_display_grayscale_p, Fx_display_pixel_width) + (Fx_display_pixel_height, Fx_display_planes) + (Fx_display_color_cells): Sync args and docstrings with xfns.c. + (Fx_display_screens): Don't confuse X11 screens with NS screens. + (Fx_display_mm_width, Fx_display_mm_height) + (Fx_display_pixel_width, Fx_display_pixel_width): Return width or + height for all physical monitors as in X11. + + * nsterm.m (x_display_pixel_width, x_display_pixel_height): Return + pixel width or height for all physical monitors as in X11. + 2013-05-18 Paul Eggert Port --enable-gcc-warnings to clang. === modified file 'src/nsfns.m' --- src/nsfns.m 2013-05-09 15:17:38 +0000 +++ src/nsfns.m 2013-05-20 08:27:56 +0000 @@ -113,44 +113,45 @@ ========================================================================== */ -/* Let the user specify an Nextstep display with a frame. - nil stands for the selected frame--or, if that is not an Nextstep frame, +/* Let the user specify a Nextstep display with a Lisp object. + OBJECT may be nil, a frame or a terminal object. + nil stands for the selected frame--or, if that is not a Nextstep frame, the first Nextstep display on the list. */ + static struct ns_display_info * -check_ns_display_info (Lisp_Object frame) +check_ns_display_info (Lisp_Object object) { - if (NILP (frame)) + struct ns_display_info *dpyinfo = NULL; + + if (NILP (object)) { - struct frame *f = SELECTED_FRAME (); - if (FRAME_NS_P (f) && FRAME_LIVE_P (f) ) - return FRAME_NS_DISPLAY_INFO (f); + struct frame *sf = XFRAME (selected_frame); + + if (FRAME_NS_P (sf) && FRAME_LIVE_P (sf)) + dpyinfo = FRAME_NS_DISPLAY_INFO (sf); else if (x_display_list != 0) - return x_display_list; + dpyinfo = x_display_list; else error ("Nextstep windows are not in use or not initialized"); } - else if (INTEGERP (frame)) + else if (TERMINALP (object)) { - struct terminal *t = get_terminal (frame, 1); + struct terminal *t = get_terminal (object, 1); if (t->type != output_ns) - error ("Terminal %"pI"d is not a Nextstep display", XINT (frame)); + error ("Terminal %d is not a Nextstep display", t->id); - return t->display_info.ns; + dpyinfo = t->display_info.ns; } - else if (STRINGP (frame)) - return ns_display_info_for_name (frame); + else if (STRINGP (object)) + dpyinfo = ns_display_info_for_name (object); else { - FRAME_PTR f; + FRAME_PTR f = decode_window_system_frame (object); + dpyinfo = FRAME_NS_DISPLAY_INFO (f); + } - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - if (! FRAME_NS_P (f)) - error ("non-Nextstep frame used"); - return FRAME_NS_DISPLAY_INFO (f); - } - return NULL; /* shut compiler up */ + return dpyinfo; } @@ -170,35 +171,6 @@ } -static NSScreen * -ns_get_screen (Lisp_Object screen) -{ - struct frame *f; - struct terminal *terminal; - - if (EQ (Qt, screen)) /* not documented */ - return [NSScreen mainScreen]; - - terminal = get_terminal (screen, 1); - if (terminal->type != output_ns) - return NULL; - - if (NILP (screen)) - f = SELECTED_FRAME (); - else if (FRAMEP (screen)) - f = XFRAME (screen); - else - { - struct ns_display_info *dpyinfo = terminal->display_info.ns; - f = dpyinfo->x_focus_frame - ? dpyinfo->x_focus_frame : dpyinfo->x_highlight_frame; - } - - return ((f && FRAME_NS_P (f)) ? [[FRAME_NS_VIEW (f) window] screen] - : NULL); -} - - /* Return the X display structure for the display named NAME. Open a new connection if necessary. */ struct ns_display_info * @@ -1586,9 +1558,9 @@ Sx_server_max_request_size, 0, 1, 0, doc: /* This function is a no-op. It is only present for completeness. */) - (Lisp_Object display) + (Lisp_Object terminal) { - check_ns_display_info (display); + check_ns_display_info (terminal); /* This function has no real equivalent under NeXTstep. Return nil to indicate this. */ return Qnil; @@ -1596,11 +1568,15 @@ DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, - doc: /* Return the vendor ID string of Nextstep display server DISPLAY. -DISPLAY should be either a frame or a display name (a string). -If omitted or nil, the selected frame's display is used. */) - (Lisp_Object display) + doc: /* Return the "vendor ID" string of Nextstep display server TERMINAL. +\(Labeling every distributor as a "vendor" embodies the false assumption +that operating systems cannot be developed and distributed noncommercially.) +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. */) + (Lisp_Object terminal) { + check_ns_display_info (terminal); #ifdef NS_IMPL_GNUSTEP return build_string ("GNU"); #else @@ -1610,16 +1586,17 @@ DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, - doc: /* Return the version numbers of the server of DISPLAY. + doc: /* Return the version numbers of the server of display TERMINAL. The value is a list of three integers: the major and minor -version numbers of the X Protocol in use, and the distributor-specific -release number. See also the function `x-server-vendor'. +version numbers of the X Protocol in use, and the distributor-specific release +number. See also the function `x-server-vendor'. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (Lisp_Object display) + (Lisp_Object terminal) { + check_ns_display_info (terminal); /*NOTE: it is unclear what would best correspond with "protocol"; we return 10.3, meaning Panther, since this is roughly the level that GNUstep's APIs correspond to. @@ -1631,56 +1608,66 @@ DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, - doc: /* Return the number of screens on Nextstep display server DISPLAY. -DISPLAY should be a frame, the display name as a string, or a terminal ID. -If omitted or nil, the selected frame's display is used. */) - (Lisp_Object display) -{ - int num; - - check_ns_display_info (display); - num = [[NSScreen screens] count]; - - return (num != 0) ? make_number (num) : Qnil; -} - - -DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, - 0, 1, 0, - doc: /* Return the height of Nextstep display server DISPLAY, in millimeters. -DISPLAY should be a frame, the display name as a string, or a terminal ID. -If omitted or nil, the selected frame's display is used. */) - (Lisp_Object display) -{ - check_ns_display_info (display); - return make_number ((int) - ([ns_get_screen (display) frame].size.height/(92.0/25.4))); -} - - -DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, - 0, 1, 0, - doc: /* Return the width of Nextstep display server DISPLAY, in millimeters. -DISPLAY should be a frame, the display name as a string, or a terminal ID. -If omitted or nil, the selected frame's display is used. */) - (Lisp_Object display) -{ - check_ns_display_info (display); - return make_number ((int) - ([ns_get_screen (display) frame].size.width/(92.0/25.4))); + doc: /* Return the number of screens on Nextstep display server TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. + +Note: "screen" here is not in Nextstep terminology but in X11's. For +the number of physical monitors, use `(length +(display-monitor-attributes-list TERMINAL))' instead. */) + (Lisp_Object terminal) +{ + check_ns_display_info (terminal); + return make_number (1); +} + + +DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, + doc: /* Return the height in millimeters of the Nextstep display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the height in millimeters for +all physical monitors associated with TERMINAL. To get information +for each physical monitor, use `display-monitor-attributes-list'. */) + (Lisp_Object terminal) +{ + struct ns_display_info *dpyinfo = check_ns_display_info (terminal); + + return make_number (x_display_pixel_height (dpyinfo) / (92.0/25.4)); +} + + +DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, + doc: /* Return the width in millimeters of the Nextstep display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the width in millimeters for +all physical monitors associated with TERMINAL. To get information +for each physical monitor, use `display-monitor-attributes-list'. */) + (Lisp_Object terminal) +{ + struct ns_display_info *dpyinfo = check_ns_display_info (terminal); + + return make_number (x_display_pixel_width (dpyinfo) / (92.0/25.4)); } DEFUN ("x-display-backing-store", Fx_display_backing_store, Sx_display_backing_store, 0, 1, 0, - doc: /* Return whether the Nextstep display DISPLAY supports backing store. + doc: /* Return an indication of whether the Nextstep display TERMINAL does backing store. The value may be `buffered', `retained', or `non-retained'. -DISPLAY should be a frame, the display name as a string, or a terminal ID. -If omitted or nil, the selected frame's display is used. */) - (Lisp_Object display) +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. */) + (Lisp_Object terminal) { - check_ns_display_info (display); - switch ([ns_get_window (display) backingType]) + check_ns_display_info (terminal); + switch ([ns_get_window (terminal) backingType]) { case NSBackingStoreBuffered: return intern ("buffered"); @@ -1697,17 +1684,19 @@ DEFUN ("x-display-visual-class", Fx_display_visual_class, Sx_display_visual_class, 0, 1, 0, - doc: /* Return the visual class of the Nextstep display server DISPLAY. + doc: /* Return the visual class of the Nextstep display TERMINAL. The value is one of the symbols `static-gray', `gray-scale', `static-color', `pseudo-color', `true-color', or `direct-color'. -DISPLAY should be a frame, the display name as a string, or a terminal ID. -If omitted or nil, the selected frame's display is used. */) - (Lisp_Object display) + +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. */) + (Lisp_Object terminal) { NSWindowDepth depth; - check_ns_display_info (display); - depth = [ns_get_screen (display) depth]; + check_ns_display_info (terminal); + depth = [[[NSScreen screens] objectAtIndex:0] depth]; if ( depth == NSBestDepth (NSCalibratedWhiteColorSpace, 2, 2, YES, NULL)) return intern ("static-gray"); @@ -1727,14 +1716,14 @@ DEFUN ("x-display-save-under", Fx_display_save_under, Sx_display_save_under, 0, 1, 0, - doc: /* Return t if DISPLAY supports the save-under feature. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be a frame, the display name as a string, or a terminal ID. -If omitted or nil, the selected frame's display is used. */) - (Lisp_Object display) + doc: /* Return t if TERMINAL supports the save-under feature. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. */) + (Lisp_Object terminal) { - check_ns_display_info (display); - switch ([ns_get_window (display) backingType]) + check_ns_display_info (terminal); + switch ([ns_get_window (terminal) backingType]) { case NSBackingStoreBuffered: return Qt; @@ -1782,11 +1771,13 @@ DEFUN ("x-close-connection", Fx_close_connection, Sx_close_connection, 1, 1, 0, - doc: /* Close the connection to the current Nextstep display server. -DISPLAY should be a frame, the display name as a string, or a terminal ID. */) - (Lisp_Object display) + doc: /* Close the connection to TERMINAL's Nextstep display server. +For TERMINAL, specify a terminal object, a frame or a display name (a +string). If TERMINAL is nil, that stands for the selected frame's +terminal. */) + (Lisp_Object terminal) { - check_ns_display_info (display); + check_ns_display_info (terminal); [NSApp terminate: NSApp]; return Qnil; } @@ -2269,13 +2260,13 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, doc: /* Internal function called by `display-color-p', which see. */) - (Lisp_Object display) + (Lisp_Object terminal) { NSWindowDepth depth; NSString *colorSpace; - check_ns_display_info (display); - depth = [ns_get_screen (display) depth]; + check_ns_display_info (terminal); + depth = [[[NSScreen screens] objectAtIndex:0] depth]; colorSpace = NSColorSpaceFromDepth (depth); return [colorSpace isEqualToString: NSDeviceWhiteColorSpace] @@ -2284,19 +2275,19 @@ } -DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, - Sx_display_grayscale_p, 0, 1, 0, +DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, + 0, 1, 0, doc: /* Return t if the Nextstep display supports shades of gray. Note that color displays do support shades of gray. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame, a display name (a string), or terminal ID. -If omitted or nil, that stands for the selected frame's display. */) - (Lisp_Object display) +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. */) + (Lisp_Object terminal) { NSWindowDepth depth; - check_ns_display_info (display); - depth = [ns_get_screen (display) depth]; + check_ns_display_info (terminal); + depth = [[[NSScreen screens] objectAtIndex:0] depth]; return NSBitsPerPixelFromDepth (depth) > 1 ? Qt : Qnil; } @@ -2304,27 +2295,37 @@ DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, 0, 1, 0, - doc: /* Return the width in pixels of the Nextstep display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame, a display name (a string), or terminal ID. -If omitted or nil, that stands for the selected frame's display. */) - (Lisp_Object display) + doc: /* Return the width in pixels of the Nextstep display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the pixel width for all +physical monitors associated with TERMINAL. To get information for +each physical monitor, use `display-monitor-attributes-list'. */) + (Lisp_Object terminal) { - check_ns_display_info (display); - return make_number ((int) [ns_get_screen (display) frame].size.width); + struct ns_display_info *dpyinfo = check_ns_display_info (terminal); + + return make_number (x_display_pixel_width (dpyinfo)); } DEFUN ("x-display-pixel-height", Fx_display_pixel_height, Sx_display_pixel_height, 0, 1, 0, - doc: /* Return the height in pixels of the Nextstep display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame, a display name (a string), or terminal ID. -If omitted or nil, that stands for the selected frame's display. */) - (Lisp_Object display) + doc: /* Return the height in pixels of the Nextstep display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the pixel height for all +physical monitors associated with TERMINAL. To get information for +each physical monitor, use `display-monitor-attributes-list'. */) + (Lisp_Object terminal) { - check_ns_display_info (display); - return make_number ((int) [ns_get_screen (display) frame].size.height); + struct ns_display_info *dpyinfo = check_ns_display_info (terminal); + + return make_number (x_display_pixel_height (dpyinfo)); } struct MonitorInfo { @@ -2547,27 +2548,27 @@ DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, 0, 1, 0, - doc: /* Return the number of bitplanes of the Nextstep display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame, a display name (a string), or terminal ID. + doc: /* Return the number of bitplanes of the Nextstep display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (Lisp_Object display) + (Lisp_Object terminal) { - check_ns_display_info (display); + check_ns_display_info (terminal); return make_number - (NSBitsPerPixelFromDepth ([ns_get_screen (display) depth])); + (NSBitsPerPixelFromDepth ([[[NSScreen screens] objectAtIndex:0] depth])); } -DEFUN ("x-display-color-cells", Fx_display_color_cells, - Sx_display_color_cells, 0, 1, 0, - doc: /* Returns the number of color cells of the Nextstep display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame, a display name (a string), or terminal ID. +DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, + 0, 1, 0, + doc: /* Returns the number of color cells of the Nextstep display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (Lisp_Object display) + (Lisp_Object terminal) { - struct ns_display_info *dpyinfo = check_ns_display_info (display); + struct ns_display_info *dpyinfo = check_ns_display_info (terminal); /* We force 24+ bit depths to 24-bit to prevent an overflow. */ return make_number (1 << min (dpyinfo->n_planes, 24)); } === modified file 'src/nsterm.m' --- src/nsterm.m 2013-04-07 10:51:29 +0000 +++ src/nsterm.m 2013-05-20 08:27:56 +0000 @@ -3913,15 +3913,31 @@ int x_display_pixel_height (struct ns_display_info *dpyinfo) { - NSScreen *screen = [NSScreen mainScreen]; - return [screen frame].size.height; + NSArray *screens = [NSScreen screens]; + NSEnumerator *enumerator = [screens objectEnumerator]; + NSScreen *screen; + NSRect frame; + + frame = NSZeroRect; + while ((screen = [enumerator nextObject]) != nil) + frame = NSUnionRect (frame, [screen frame]); + + return NSHeight (frame); } int x_display_pixel_width (struct ns_display_info *dpyinfo) { - NSScreen *screen = [NSScreen mainScreen]; - return [screen frame].size.width; + NSArray *screens = [NSScreen screens]; + NSEnumerator *enumerator = [screens objectEnumerator]; + NSScreen *screen; + NSRect frame; + + frame = NSZeroRect; + while ((screen = [enumerator nextObject]) != nil) + frame = NSUnionRect (frame, [screen frame]); + + return NSWidth (frame); } ------------------------------------------------------------ revno: 112644 fixes bug: http://debbugs.gnu.org/14420 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-05-20 00:45:58 -0700 message: * lisp/format-spec.el (format-spec): Allow spec chars with nil values. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-19 06:52:22 +0000 +++ lisp/ChangeLog 2013-05-20 07:45:58 +0000 @@ -1,3 +1,7 @@ +2013-05-20 Glenn Morris + + * format-spec.el (format-spec): Allow spec chars with nil. (Bug#14420) + 2013-05-19 Dmitry Gutov * progmodes/ruby-mode.el (ruby-expression-expansion-re): Allow to === modified file 'lisp/format-spec.el' --- lisp/format-spec.el 2013-01-01 09:11:05 +0000 +++ lisp/format-spec.el 2013-05-20 07:45:58 +0000 @@ -44,14 +44,15 @@ ((looking-at "\\([-0-9.]*\\)\\([a-zA-Z]\\)") (let* ((num (match-string 1)) (spec (string-to-char (match-string 2))) - (val (cdr (assq spec specification)))) + (val (assq spec specification))) (unless val (error "Invalid format character: `%%%c'" spec)) + (setq val (cdr val)) ;; Pad result to desired length. - (let ((text (format (concat "%" num "s") val))) + (let ((text (format (concat "%" num "s") val))) ;; Insert first, to preserve text properties. - (insert-and-inherit text) - ;; Delete the specifier body. + (insert-and-inherit text) + ;; Delete the specifier body. (delete-region (+ (match-beginning 0) (length text)) (+ (match-end 0) (length text))) ;; Delete the percent sign. ------------------------------------------------------------ revno: 112643 committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Mon 2013-05-20 12:15:20 +0900 message: Mention `display-monitor-attributes-list' in docstrings of X11 display measurement functions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-05-20 03:09:22 +0000 +++ src/ChangeLog 2013-05-20 03:15:20 +0000 @@ -1,6 +1,9 @@ 2013-05-20 YAMAMOTO Mitsuharu * xfns.c (check_x_display_info): Don't use XINT for terminal object. + (Fx_display_pixel_width, Fx_display_pixel_height) + (Fx_display_mm_width, Fx_display_mm_height): Mention + `display-monitor-attributes-list' in docstrings. 2013-05-18 Paul Eggert === modified file 'src/xfns.c' --- src/xfns.c 2013-05-20 03:09:22 +0000 +++ src/xfns.c 2013-05-20 03:15:20 +0000 @@ -3569,7 +3569,11 @@ doc: /* Return the width in pixels of the X display TERMINAL. The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). -If omitted or nil, that stands for the selected frame's display. */) +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the pixel width for all +physical monitors associated with TERMINAL. To get information for +each physical monitor, use `display-monitor-attributes-list'. */) (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3582,7 +3586,11 @@ doc: /* Return the height in pixels of the X display TERMINAL. The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). -If omitted or nil, that stands for the selected frame's display. */) +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the pixel height for all +physical monitors associated with TERMINAL. To get information for +each physical monitor, use `display-monitor-attributes-list'. */) (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3690,7 +3698,11 @@ doc: /* Return the height in millimeters of the X display TERMINAL. The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). -If omitted or nil, that stands for the selected frame's display. */) +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the height in millimeters for +all physical monitors associated with TERMINAL. To get information +for each physical monitor, use `display-monitor-attributes-list'. */) (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3702,7 +3714,11 @@ doc: /* Return the width in millimeters of the X display TERMINAL. The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). -If omitted or nil, that stands for the selected frame's display. */) +If omitted or nil, that stands for the selected frame's display. + +On \"multi-monitor\" setups this refers to the width in millimeters for +all physical monitors associated with TERMINAL. To get information +for each physical monitor, use `display-monitor-attributes-list'. */) (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal);