------------------------------------------------------------ revno: 118080 committer: Paul Eggert branch nick: trunk timestamp: Wed 2014-10-08 23:54:10 -0700 message: * lisp.h (USE_STACK_STRING): Now true only if USE_STACK CONS. On x86 platforms this works around GCC bug 63495 , and more generally should fix a portability problem in Emacs. Problem reported by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00261.html diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-09 04:23:09 +0000 +++ src/ChangeLog 2014-10-09 06:54:10 +0000 @@ -1,3 +1,12 @@ +2014-10-09 Paul Eggert + + * lisp.h (USE_STACK_STRING): Now true only if USE_STACK CONS. + On x86 platforms this works around GCC bug 63495 + , + and more generally should fix a portability problem in Emacs. + Problem reported by Stefan Monnier in: + http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00261.html + 2014-10-08 Leo Liu Enhance terpri to allow conditionally output a newline. (Bug#18652) === modified file 'src/lisp.h' --- src/lisp.h 2014-10-02 12:27:19 +0000 +++ src/lisp.h 2014-10-09 06:54:10 +0000 @@ -4615,13 +4615,16 @@ double d; intmax_t i; void *p; }; -/* True for stack-based cons and string implementations. */ +/* True for stack-based cons and string implementations, respectively. + Use stack-based strings only if stack-based cons also works. + Otherwise, STACK_CONS would create heap-based cons cells that + could point to stack-based strings, which is a no-no. */ enum { USE_STACK_CONS = (USE_STACK_LISP_OBJECTS && alignof (union Aligned_Cons) % GCALIGNMENT == 0), - USE_STACK_STRING = (USE_STACK_LISP_OBJECTS + USE_STACK_STRING = (USE_STACK_CONS && alignof (union Aligned_String) % GCALIGNMENT == 0) }; ------------------------------------------------------------ revno: 118079 [merge] committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-10-08 21:23:09 -0700 message: Merge from emacs-24; up to r117563 diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-10-05 17:19:23 +0000 +++ doc/emacs/ChangeLog 2014-10-09 04:23:09 +0000 @@ -1,3 +1,8 @@ +2014-10-09 Glenn Morris + + * package.texi (Package Menu): The package list was changed to not + say "unsigned" any more. + 2014-10-05 Glenn Morris * misc.texi (Sorting): === modified file 'doc/emacs/package.texi' --- doc/emacs/package.texi 2014-10-01 23:29:46 +0000 +++ doc/emacs/package.texi 2014-10-06 06:34:21 +0000 @@ -60,7 +60,7 @@ @item The package's status---normally one of @samp{available} (can be downloaded from the package archive), @samp{installed}, -@samp{unsigned} (installed, but not signed; @pxref{Package Signing}), +@c @samp{unsigned} (installed, but not signed; @pxref{Package Signing}), or @samp{built-in} (included in Emacs by default). The status can also be @samp{new}. This is equivalent to === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-10-08 22:05:48 +0000 +++ doc/lispref/ChangeLog 2014-10-09 04:23:09 +0000 @@ -1,3 +1,20 @@ +2014-10-09 Glenn Morris + + * frames.texi (Multiple Terminals): Copyedits. + +2014-10-09 Eli Zaretskii + + * frames.texi (Multiple Terminals): Improve the description of X + display names. Add index entries. + (Basic Parameters): Add a cross-reference to where X display names + are described. + (Position Parameters): Mention that positional parameters of the + form (+ POS) can be negative if they are on a non-primary monitor + of a multi-monitor display. (Bug#18636) + (Creating Frames): Mention that on multi-monitor displays the + frame might be positioned differently than specified by the frame + parameters alist. + 2014-10-08 Leo Liu * streams.texi (Output Functions): Document new argument ENSURE to === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2014-10-04 08:20:24 +0000 +++ doc/lispref/frames.texi 2014-10-09 04:23:09 +0000 @@ -131,6 +131,13 @@ (see below) and not present in the argument, taking the values from the frame that was selected when @code{make-frame} was called. +Note that on multi-monitor displays (@pxref{Multiple Terminals}), the +window manager might position the frame differently than specified by +the positional parameters in @var{alist} (@pxref{Position +Parameters}). For example, some window managers have a policy of +displaying the frame on the monitor that contains the largest part of +the window (a.k.a.@: the @dfn{dominating} monitor). + This function itself does not make the new frame the selected frame. @xref{Input Focus}. The previously selected frame remains selected. On graphical terminals, however, the windowing system may select the @@ -258,13 +265,27 @@ terminals, by interacting with the @command{emacsclient} program. @xref{Emacs Server,,, emacs, The GNU Emacs Manual}. +@cindex X display names +@cindex display name on X A single X server can handle more than one display. Each X display -has a three-part name, @samp{@var{host}:@var{server}.@var{screen}}. -The first two parts, @var{host} and @var{server}, identify the X -server; the third part, @var{screen}, identifies a screen number on -that X server. When you use two or more screens belonging to one -server, Emacs knows by the similarity in their names that they share a -single keyboard. +has a three-part name, +@samp{@var{hostname}:@var{displaynumber}.@var{screennumber}}. The +first part, @var{hostname}, specifies the name of the machine to which +the display is physically connected. The second part, +@var{displaynumber}, is a zero-based number that identifies one or +more monitors connected to that machine that share a common keyboard +and pointing device (mouse, tablet, etc.). The third part, +@var{screennumber}, identifies a zero-based screen number (a separate +monitor) that is part of a single monitor collection on that X server. +When you use two or more screens belonging to one server, Emacs knows +by the similarity in their names that they share a single keyboard. + + Systems that don't use the X window system, such as MS-Windows, +don't support the notion of X displays, and have only one display on +each host. The display name on these systems doesn't follow the above +3-part format; for example, the display name on MS-Windows systems is +a constant string @samp{w32}, and exists for compatibility, so that +you could pass it to functions that expect a display name. @deffn Command make-frame-on-display display &optional parameters This function creates and returns a new frame on @var{display}, taking @@ -320,19 +341,29 @@ @defun display-monitor-attributes-list &optional display This function returns a list of physical monitor attributes on -@var{display}, which defaults to that of the selected frame. -Each element of the list is an association list, representing the -attributes of a physical monitor. The first element corresponds to -the primary monitor. The attribute keys and values are: +@var{display}, which can be a display name (a string), a terminal, or +a frame; if omitted or @code{nil}, it defaults to the selected frame's +display. Each element of the list is an association list, +representing the attributes of a physical monitor. The first element +corresponds to the primary monitor. The attribute keys and values +are: @table @samp @item geometry -Position and size in pixels as @samp{(@var{x} @var{y} -@var{width} @var{height})}. +Position of the top-left corner of the monitor's screen and its size, +in pixels, as @samp{(@var{x} @var{y} @var{width} @var{height})}. Note +that, if the monitor is not the primary monitor, some of the +coordinates might be negative. @item workarea -Position and size of the work area in pixels as -@samp{(@var{x} @var{y} @var{width} @var{height})}. +Position of the top-left corner and size of the work area (``usable'' +space) in pixels as @samp{(@var{x} @var{y} @var{width} @var{height})}. +This may be different from @samp{geometry} in that space occupied by +various window manager features (docks, taskbars, etc.) may be +excluded from the work area. Whether or not such features actually +subtract from the work area depends on the platform and environment. +Again, if the monitor is not the primary monitor, some of the +coordinates might be negative. @item mm-size Width and height in millimeters as @samp{(@var{width} @var{height})} @@ -342,10 +373,14 @@ @item name Name of the physical monitor as @var{string}. + +@item source +Source of the multi-monitor information as @var{string}; +e.g., @samp{XRandr} or @samp{Xinerama}. @end table @var{x}, @var{y}, @var{width}, and @var{height} are integers. -@samp{name} may not be present. +@samp{name} and @samp{source} may be absent. A frame is @dfn{dominated} by a physical monitor when either the largest area of the frame resides in that monitor, or (if the frame @@ -353,6 +388,26 @@ to the frame. Every (non-tooltip) frame (whether visible or not) in a graphical display is dominated by exactly one physical monitor at a time, though the frame can span multiple (or no) physical monitors. + +Here's an example of the data produced by this function on a 2-monitor +display: + +@lisp + (display-monitor-attributes-list) + @result{} + (((geometry 0 0 1920 1080) ;; @r{Left-hand, primary monitor} + (workarea 0 0 1920 1050) ;; @r{A taskbar occupies some of the height} + (mm-size 677 381) + (name . "DISPLAY1") + (frames # + #)) + ((geometry 1920 0 1680 1050) ;; @r{Right-hand monitor} + (workarea 1920 0 1680 1050) ;; @r{Whole screen can be used} + (mm-size 593 370) + (name . "DISPLAY2") + (frames))) +@end lisp + @end defun @defun frame-monitor-attributes &optional frame @@ -529,8 +584,9 @@ @vindex display, a frame parameter @item display The display on which to open this frame. It should be a string of the -form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the -@env{DISPLAY} environment variable. +form @samp{@var{host}:@var{dpy}.@var{screen}}, just like the +@env{DISPLAY} environment variable. @xref{Multiple Terminals}, for +more details about display names. @vindex display-type, a frame parameter @item display-type @@ -586,12 +642,14 @@ @item @code{(+ @var{pos})} This specifies the position of the left frame edge relative to the left screen edge. The integer @var{pos} may be positive or negative; a -negative value specifies a position outside the screen. +negative value specifies a position outside the screen or on a monitor +other than the primary one (for multi-monitor displays). @item @code{(- @var{pos})} This specifies the position of the right frame edge relative to the right screen edge. The integer @var{pos} may be positive or negative; a -negative value specifies a position outside the screen. +negative value specifies a position outside the screen or on a monitor +other than the primary one (for multi-monitor displays). @end table Some window managers ignore program-specified positions. If you want to === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-09 03:04:59 +0000 +++ lisp/ChangeLog 2014-10-09 04:23:09 +0000 @@ -1,3 +1,25 @@ +2014-10-09 Glenn Morris + + * frame.el (display-monitor-attributes-list): Doc tweaks. + +2014-10-09 Eli Zaretskii + + * faces.el (display-grayscale-p): Mention in the doc string that + the argument can be either a display name or a frame. + + * frame.el (display-pixel-height, display-pixel-width) + (display-mm-height, display-mm-width, display-backing-store) + (display-save-under, display-planes, display-color-cells) + (display-visual-class, display-monitor-attributes-list) + (display-screens): Mention in the doc string that the argument can + be either a display name or a frame. Improve the docs of the + monitor attributes. (Bug#18636) + +2014-10-09 Martin Rudalics + + * term.el (term-window-width): Subtract 1 from the width when + any fringe has zero width, not just the right fringe. (Bug#18601) + 2014-10-09 Stefan Monnier * frame.el (make-frame): Use t rather than nil for `w' (bug#18653). === modified file 'lisp/faces.el' --- lisp/faces.el 2014-09-29 18:14:08 +0000 +++ lisp/faces.el 2014-10-09 04:23:09 +0000 @@ -1825,7 +1825,9 @@ (declare-function x-display-grayscale-p "xfns.c" (&optional terminal)) (defun display-grayscale-p (&optional display) - "Return non-nil if frames on DISPLAY can display shades of gray." + "Return non-nil if frames on DISPLAY can display shades of gray. +DISPLAY should be either a frame or a display name (a string). +If omitted or nil, that stands for the selected frame's display." (let ((frame-type (framep-on-display display))) (cond ((memq frame-type '(x w32 ns)) === modified file 'lisp/frame.el' --- lisp/frame.el 2014-10-09 03:04:59 +0000 +++ lisp/frame.el 2014-10-09 04:23:09 +0000 @@ -1373,6 +1373,7 @@ (defun display-screens (&optional display) "Return the number of screens associated with DISPLAY. +DISPLAY should be either a frame or a display name (a string). If DISPLAY is omitted or nil, it defaults to the selected frame's display." (let ((frame-type (framep-on-display display))) (cond @@ -1385,6 +1386,7 @@ (defun display-pixel-height (&optional display) "Return the height of DISPLAY's screen in pixels. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display. For character terminals, each character counts as a single pixel. @@ -1404,6 +1406,7 @@ (defun display-pixel-width (&optional display) "Return the width of DISPLAY's screen in pixels. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display. For character terminals, each character counts as a single pixel. @@ -1442,6 +1445,7 @@ (defun display-mm-height (&optional display) "Return the height of DISPLAY's screen in millimeters. If the information is unavailable, this function returns nil. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display. You can override what the system thinks the result should be by @@ -1462,6 +1466,7 @@ (defun display-mm-width (&optional display) "Return the width of DISPLAY's screen in millimeters. If the information is unavailable, this function returns nil. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display. You can override what the system thinks the result should be by @@ -1485,6 +1490,7 @@ "Return the backing store capability of DISPLAY's screen. The value may be `always', `when-mapped', `not-useful', or nil if the question is inapplicable to a certain kind of display. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display." (let ((frame-type (framep-on-display display))) (cond @@ -1497,6 +1503,7 @@ (defun display-save-under (&optional display) "Return non-nil if DISPLAY's screen supports the SaveUnder feature. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display." (let ((frame-type (framep-on-display display))) (cond @@ -1509,6 +1516,7 @@ (defun display-planes (&optional display) "Return the number of planes supported by DISPLAY. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display." (let ((frame-type (framep-on-display display))) (cond @@ -1523,6 +1531,7 @@ (defun display-color-cells (&optional display) "Return the number of color cells supported by DISPLAY. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display." (let ((frame-type (framep-on-display display))) (cond @@ -1539,6 +1548,7 @@ "Return the visual class of DISPLAY. The value is one of the symbols `static-gray', `gray-scale', `static-color', `pseudo-color', `true-color', or `direct-color'. +DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display." (let ((frame-type (framep-on-display display))) (cond @@ -1559,6 +1569,7 @@ (defun display-monitor-attributes-list (&optional display) "Return a list of physical monitor attributes on DISPLAY. +DISPLAY can be a display name, a terminal name, or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display. Each element of the list represents the attributes of a physical monitor. The first element corresponds to the primary monitor. @@ -1573,9 +1584,20 @@ (WIDTH HEIGHT) frames -- List of frames dominated by the physical monitor name (*) -- Name of the physical monitor as a string - -where X, Y, WIDTH, and HEIGHT are integers. Keys labeled -with (*) are optional. + source (*) -- Source of multi-monitor information as a string + +where X, Y, WIDTH, and HEIGHT are integers. X and Y are coordinates +of the top-left corner, and might be negative for monitors other than +the primary one. Keys labeled with (*) are optional. + +The \"work area\" is a measure of the \"usable\" display space. +It may be less than the total screen size, owing to space taken up +by window manager features (docks, taskbars, etc.). The precise +details depend on the platform and environment. + +The `source' attribute describes the source from which the information +was obtained. On X, this may be one of: \"Gdk\", \"XRandr\", \"Xinerama\", +or \"fallback\". A frame is dominated by a physical monitor when either the largest area of the frame resides in the monitor, or the monitor === modified file 'lisp/term.el' --- lisp/term.el 2014-10-02 03:19:32 +0000 +++ lisp/term.el 2014-10-09 04:23:09 +0000 @@ -972,6 +972,9 @@ (if (and (not (featurep 'xemacs)) (display-graphic-p) overflow-newline-into-fringe + ;; Subtract 1 from the width when any fringe has zero width, + ;; not just the right fringe. Bug#18601. + (/= (frame-parameter nil 'left-fringe) 0) (/= (frame-parameter nil 'right-fringe) 0)) (window-body-width) (1- (window-body-width)))) === modified file 'nt/README.W32' --- nt/README.W32 2014-02-08 10:25:33 +0000 +++ nt/README.W32 2014-10-09 00:47:30 +0000 @@ -220,7 +220,7 @@ key in HKEY_CURRENT_USER. Just delete the whole Software\GNU\Emacs key. - The Start menu entry can be removed by right-clicking on the Task bar + The Start menu entry can be removed by right-clicking on the Taskbar and selecting Properties, then using the Remove option on the Start Menu Programs page. (If you installed under an account with administrator privileges, then you need to click the Advanced button === modified file 'src/ChangeLog.10' --- src/ChangeLog.10 2014-01-15 03:06:07 +0000 +++ src/ChangeLog.10 2014-10-09 00:47:30 +0000 @@ -3264,7 +3264,7 @@ * w32term.c (x_make_frame_visible): Use SystemParametersInfo with SPI_GETWORKAREA to find the dimensions of the screen work area, and adjust vertical position of the frame in order to avoid being - covered by the task bar. + covered by the taskbar. * w32fns.c (w32_createwindow): Use CW_USEDEFAULT instead of f->left_pos and SH_SHOW instead of f->top_pos in the call to === modified file 'src/w32term.c' --- src/w32term.c 2014-09-30 23:19:31 +0000 +++ src/w32term.c 2014-10-09 04:23:09 +0000 @@ -6347,7 +6347,7 @@ RECT window_rect; /* Adjust vertical window position in order to avoid being - covered by a task bar placed at the bottom of the desktop. */ + covered by a taskbar placed at the bottom of the desktop. */ SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0); GetWindowRect (FRAME_W32_WINDOW (f), &window_rect); if (window_rect.bottom > workarea_rect.bottom ------------------------------------------------------------ revno: 118078 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18653 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-10-08 23:04:59 -0400 message: * lisp/frame.el (make-frame): Use t rather than nil for `w'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-08 22:05:48 +0000 +++ lisp/ChangeLog 2014-10-09 03:04:59 +0000 @@ -1,3 +1,7 @@ +2014-10-09 Stefan Monnier + + * frame.el (make-frame): Use t rather than nil for `w' (bug#18653). + 2014-10-08 Leo Liu * emacs-lisp/cl-extra.el (cl-fresh-line): New function. @@ -9,8 +13,8 @@ 2014-10-08 Leo Liu - * progmodes/cfengine.el (cfengine3-make-syntax-cache): Always - return a syntax. Replace call-process-shell-command with + * progmodes/cfengine.el (cfengine3-make-syntax-cache): + Always return a syntax. Replace call-process-shell-command with process-file. Ensure cfengine-mode-syntax-functions-regex is always set. Ensure cache when cfengine-cf-promises fails. (Bug#18620) === modified file 'lisp/frame.el' --- lisp/frame.el 2014-10-04 08:20:24 +0000 +++ lisp/frame.el 2014-10-09 03:04:59 +0000 @@ -646,20 +646,23 @@ the new frame according to its own rules." (interactive) (let* ((display (cdr (assq 'display parameters))) - (w (cond - ((assq 'terminal parameters) - (let ((type (terminal-live-p (cdr (assq 'terminal parameters))))) - (cond - ((null type) (error "Terminal %s does not exist" - (cdr (assq 'terminal parameters)))) - (t type)))) - ((assq 'window-system parameters) - (cdr (assq 'window-system parameters))) - (display - (or (window-system-for-display display) - (error "Don't know how to interpret display %S" - display))) - (t window-system))) + (w (or + (cond + ((assq 'terminal parameters) + (let ((type (terminal-live-p + (cdr (assq 'terminal parameters))))) + (cond + ((null type) (error "Terminal %s does not exist" + (cdr (assq 'terminal parameters)))) + (t type)))) + ((assq 'window-system parameters) + (cdr (assq 'window-system parameters))) + (display + (or (window-system-for-display display) + (error "Don't know how to interpret display %S" + display))) + (t window-system)) + t)) (oldframe (selected-frame)) (params parameters) frame) @@ -680,7 +683,7 @@ ;; Now make the frame. (run-hooks 'before-make-frame-hook) (setq frame - (funcall (gui-method frame-creation-function (or w t)) params)) + (funcall (gui-method frame-creation-function w) params)) (normal-erase-is-backspace-setup-frame frame) ;; Inherit the original frame's parameters. (dolist (param frame-inherited-parameters) ------------------------------------------------------------ revno: 118077 committer: Leo Liu branch nick: trunk timestamp: Thu 2014-10-09 09:52:47 +0800 message: * NEWS: Mention optional arg to terpri and new cl-lib functions. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-10-05 12:25:00 +0000 +++ etc/ChangeLog 2014-10-09 01:52:47 +0000 @@ -1,3 +1,7 @@ +2014-10-09 Leo Liu + + * NEWS: Mention optional arg to terpri and new cl-lib functions. + 2014-10-05 Jan Djärv * NEWS: Mention ns-use-fullscreen-animation. === modified file 'etc/NEWS' --- etc/NEWS 2014-10-06 02:02:04 +0000 +++ etc/NEWS 2014-10-09 01:52:47 +0000 @@ -52,6 +52,9 @@ ** x-select-enable-clipboard is renamed gui-select-enable-clipboard. Additionally it now also applies to OSX and GNUstep. ++++ +** terpri gets an optional arg ENSURE to conditionally output a newline. + ** `insert-register' now leaves point after the inserted text when called interactively. A prefix argument toggles this behavior. @@ -117,6 +120,8 @@ ** pcase *** New UPatterns `quote' and `app'. *** New UPatterns can be defined with `pcase-defmacro'. ++++ +*** New vector QPattern. ** Lisp mode *** Strings after `:documentation' are highlighted as docstrings. @@ -126,15 +131,15 @@ *** C-x C-x in rectangle-mark-mode now cycles through the four corners. *** `string-rectangle' provides on-the-fly preview of the result. -+++ -** Macro `pcase' now supports vector qpattern. - ** New font-lock functions font-lock-ensure and font-lock-flush, which should be used instead of font-lock-fontify-buffer when called from Elisp. ** Macro `minibuffer-with-setup-hook' takes (:append FUN) to mean appending FUN to `minibuffer-setup-hook'. +** cl-lib +*** New functions cl-fresh-line, cl-digit-char-p and cl-parse-integer. + ** Calendar and diary +++ ------------------------------------------------------------ revno: 118076 fixes bug: http://debbugs.gnu.org/18652 committer: Leo Liu branch nick: trunk timestamp: Thu 2014-10-09 06:05:48 +0800 message: Enhance terpri to allow conditionally output a newline * doc/lispref/streams.texi (Output Functions): Document new argument ENSURE to terpri. * doc/misc/cl.texi (Porting Common Lisp): Remove parse-integer. * lisp/emacs-lisp/cl-extra.el (cl-fresh-line): New function. * src/keymap.c (describe_vector_princ): * src/keyboard.c (Fcommand_error_default_function): Adapt to change to Fterpri. * src/print.c (printchar_stdout_last): Declare. (printchar): Record the last char written to stdout. (Fterpri): Add optional argument ENSURE. * test/automated/print-tests.el: New file. (terpri): Tests for terpri. (Bug#18652) diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-10-04 08:20:24 +0000 +++ doc/lispref/ChangeLog 2014-10-08 22:05:48 +0000 @@ -1,3 +1,8 @@ +2014-10-08 Leo Liu + + * streams.texi (Output Functions): Document new argument ENSURE to + terpri. (Bug#18652) + 2014-10-04 Martin Rudalics * display.texi (Scroll Bars): Add description of horizontal scroll === modified file 'doc/lispref/streams.texi' --- doc/lispref/streams.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/streams.texi 2014-10-08 22:05:48 +0000 @@ -615,10 +615,13 @@ @end example @end defun -@defun terpri &optional stream +@defun terpri &optional stream ensure @cindex newline in print -This function outputs a newline to @var{stream}. The name stands -for ``terminate print''. +This function outputs a newline to @var{stream}. The name stands for +``terminate print''. If @var{ensure} is non-nil no newline is printed +if @var{stream} is already at the beginning of a line. Note in this +case @var{stream} can not be a function and an error is signalled if +it is. This function returns @code{t} if a newline is printed. @end defun @defun write-char character &optional stream === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-10-06 18:26:24 +0000 +++ doc/misc/ChangeLog 2014-10-08 22:05:48 +0000 @@ -1,3 +1,7 @@ +2014-10-08 Leo Liu + + * cl.texi (Porting Common Lisp): Remove parse-integer. + 2014-10-06 Ulf Jasper * newsticker.texi (Supported Formats): Fix order of subheading and === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2014-09-26 00:15:21 +0000 +++ doc/misc/cl.texi 2014-10-08 22:05:48 +0000 @@ -4707,9 +4707,8 @@ implement a Common Lisp-style @code{make-list}. @item -A few more notable Common Lisp features not included in this -package: @code{compiler-let}, @code{tagbody}, @code{prog}, -@code{ldb/dpb}, @code{parse-integer}, @code{cerror}. +A few more notable Common Lisp features not included in this package: +@code{compiler-let}, @code{prog}, @code{ldb/dpb}, @code{cerror}. @item Recursion. While recursion works in Emacs Lisp just like it === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-08 18:30:45 +0000 +++ lisp/ChangeLog 2014-10-08 22:05:48 +0000 @@ -1,3 +1,7 @@ +2014-10-08 Leo Liu + + * emacs-lisp/cl-extra.el (cl-fresh-line): New function. + 2014-10-08 Glenn Morris * calendar/cal-x.el (calendar-dedicate-diary): === modified file 'lisp/emacs-lisp/cl-extra.el' --- lisp/emacs-lisp/cl-extra.el 2014-09-26 02:01:17 +0000 +++ lisp/emacs-lisp/cl-extra.el 2014-10-08 22:05:48 +0000 @@ -647,6 +647,13 @@ (progn (setplist sym (cdr (cdr plist))) t) (cl--do-remf plist tag)))) +;;; Streams. + +;;;###autoload +(defun cl-fresh-line (&optional stream) + "Output a newline unless already at the beginning of a line." + (terpri stream 'ensure)) + ;;; Some debugging aids. (defun cl-prettyprint (form) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-08 12:32:38 +0000 +++ src/ChangeLog 2014-10-08 22:05:48 +0000 @@ -1,3 +1,14 @@ +2014-10-08 Leo Liu + + Enhance terpri to allow conditionally output a newline. (Bug#18652) + * keymap.c (describe_vector_princ): + * keyboard.c (Fcommand_error_default_function): Adapt to change to + Fterpri. + + * print.c (printchar_stdout_last): Declare. + (printchar): Record the last char written to stdout. + (Fterpri): Add optional argument ENSURE. + 2014-10-08 Eli Zaretskii * w32inevt.c (maybe_generate_resize_event): Pass non-zero as the === modified file 'src/keyboard.c' --- src/keyboard.c 2014-10-05 23:18:31 +0000 +++ src/keyboard.c 2014-10-08 22:05:48 +0000 @@ -1126,7 +1126,7 @@ { print_error_message (data, Qexternal_debugging_output, SSDATA (context), signal); - Fterpri (Qexternal_debugging_output); + Fterpri (Qexternal_debugging_output, Qnil); Fkill_emacs (make_number (-1)); } else === modified file 'src/keymap.c' --- src/keymap.c 2014-10-01 03:28:16 +0000 +++ src/keymap.c 2014-10-08 22:05:48 +0000 @@ -3364,7 +3364,7 @@ { Findent_to (make_number (16), make_number (1)); call1 (fun, elt); - Fterpri (Qnil); + Fterpri (Qnil, Qnil); } DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 2, 0, === modified file 'src/print.c' --- src/print.c 2014-09-11 06:21:55 +0000 +++ src/print.c 2014-10-08 22:05:48 +0000 @@ -58,6 +58,9 @@ #define PRINT_CIRCLE 200 static Lisp_Object being_printed[PRINT_CIRCLE]; +/* Last char printed to stdout by printchar. */ +static unsigned int printchar_stdout_last; + /* When printing into a buffer, first we put the text in this block, then insert it all at once. */ static char *print_buffer; @@ -238,6 +241,7 @@ } else if (noninteractive) { + printchar_stdout_last = ch; fwrite (str, 1, len, stdout); noninteractive_need_newline = 1; } @@ -515,19 +519,33 @@ static void print_preprocess_string (INTERVAL, Lisp_Object); static void print_object (Lisp_Object, Lisp_Object, bool); -DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, +DEFUN ("terpri", Fterpri, Sterpri, 0, 2, 0, doc: /* Output a newline to stream PRINTCHARFUN. +If ENSURE is non-nil only output a newline if not already at the +beginning of a line. Value is non-nil if a newline is printed. If PRINTCHARFUN is omitted or nil, the value of `standard-output' is used. */) - (Lisp_Object printcharfun) + (Lisp_Object printcharfun, Lisp_Object ensure) { + Lisp_Object val = Qnil; + PRINTDECLARE; - if (NILP (printcharfun)) printcharfun = Vstandard_output; PRINTPREPARE; - PRINTCHAR ('\n'); + + if (NILP (ensure)) + val = Qt; + /* Difficult to check if at line beginning so abort. */ + else if (FUNCTIONP (printcharfun)) + signal_error ("Unsupported function argument", printcharfun); + else if (noninteractive && !NILP (printcharfun)) + val = printchar_stdout_last == 10 ? Qnil : Qt; + else if (NILP (Fbolp ())) + val = Qt; + + if (!NILP (val)) PRINTCHAR ('\n'); PRINTFINISH; - return Qt; + return val; } DEFUN ("prin1", Fprin1, Sprin1, 1, 2, 0, === modified file 'test/ChangeLog' --- test/ChangeLog 2014-10-06 02:02:04 +0000 +++ test/ChangeLog 2014-10-08 22:05:48 +0000 @@ -1,3 +1,8 @@ +2014-10-08 Leo Liu + + * automated/print-tests.el: New file. + (terpri): Tests for terpri. (Bug#18652) + 2014-10-06 Glenn Morris * automated/icalendar-tests.el (icalendar--calendar-style): === added file 'test/automated/print-tests.el' --- test/automated/print-tests.el 1970-01-01 00:00:00 +0000 +++ test/automated/print-tests.el 2014-10-08 22:05:48 +0000 @@ -0,0 +1,56 @@ +;;; print-tests.el --- tests for src/print.c -*- lexical-binding: t; -*- + +;; Copyright (C) 2014 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(require 'ert) + +(ert-deftest terpri () + (should (string= (with-output-to-string + (princ 'abc) + (should (terpri nil t))) + "abc\n")) + (should (string= (with-output-to-string + (should-not (terpri nil t)) + (princ 'xyz)) + "xyz")) + (message nil) + (if noninteractive + (progn (should (terpri nil t)) + (should-not (terpri nil t)) + (princ 'abc) + (should (terpri nil t)) + (should-not (terpri nil t))) + (should (string= (progn (should-not (terpri nil t)) + (princ 'abc) + (should (terpri nil t)) + (current-message)) + "abc\n"))) + (let ((standard-output + (with-current-buffer (get-buffer-create "*terpri-test*") + (insert "--------") + (point-max-marker)))) + (should (terpri nil t)) + (should-not (terpri nil t)) + (should (string= (with-current-buffer (marker-buffer standard-output) + (buffer-string)) + "--------\n")))) + +(provide 'print-tests) +;;; print-tests.el ends here ------------------------------------------------------------ revno: 118075 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-10-08 14:30:45 -0400 message: * cal-x.el (calendar-dedicate-diary): Drop support for deleted aliases. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-08 15:34:58 +0000 +++ lisp/ChangeLog 2014-10-08 18:30:45 +0000 @@ -1,3 +1,8 @@ +2014-10-08 Glenn Morris + + * calendar/cal-x.el (calendar-dedicate-diary): + Drop support for recently deleted aliases. + 2014-10-08 Leo Liu * progmodes/cfengine.el (cfengine3-make-syntax-cache): Always === modified file 'lisp/calendar/cal-x.el' --- lisp/calendar/cal-x.el 2014-10-06 02:02:04 +0000 +++ lisp/calendar/cal-x.el 2014-10-08 18:30:45 +0000 @@ -94,12 +94,10 @@ (set-window-dedicated-p (display-buffer (if (if (listp diary-display-function) - (or (memq 'diary-fancy-display diary-display-function) - (memq 'fancy-diary-display diary-display-function)) - (memq diary-display-function '(diary-fancy-display - fancy-diary-display))) + (memq 'diary-fancy-display diary-display-function) + (eq diary-display-function 'diary-fancy-display)) (progn - ;; If there are no diary entries, there won't be a fancy-diary + ;; If there are no diary entries, there won't be a buffer ;; to dedicate, so make a basic one. (or (get-buffer diary-fancy-buffer) (calendar-in-read-only-buffer diary-fancy-buffer ------------------------------------------------------------ revno: 118074 fixes bug: http://debbugs.gnu.org/18620 committer: Leo Liu branch nick: trunk timestamp: Wed 2014-10-08 23:34:58 +0800 message: * lisp/progmodes/cfengine.el (cfengine3-make-syntax-cache): Always return a syntax. Replace call-process-shell-command with process-file. Ensure cfengine-mode-syntax-functions-regex is always set. Ensure cache when cfengine-cf-promises fails. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-07 03:20:33 +0000 +++ lisp/ChangeLog 2014-10-08 15:34:58 +0000 @@ -1,3 +1,11 @@ +2014-10-08 Leo Liu + + * progmodes/cfengine.el (cfengine3-make-syntax-cache): Always + return a syntax. Replace call-process-shell-command with + process-file. Ensure cfengine-mode-syntax-functions-regex is + always set. Ensure cache when cfengine-cf-promises fails. + (Bug#18620) + 2014-10-07 Glenn Morris * font-lock.el (font-lock-fontify-buffer): Fix interactive-only markup. === modified file 'lisp/progmodes/cfengine.el' --- lisp/progmodes/cfengine.el 2014-01-30 07:42:57 +0000 +++ lisp/progmodes/cfengine.el 2014-10-08 15:34:58 +0000 @@ -1231,29 +1231,32 @@ (setq cfengine-mode-syntax-cache nil)) (defun cfengine3-make-syntax-cache () - "Build the CFEngine 3 syntax cache. -Calls `cfengine-cf-promises' with \"-s json\"" - (let ((syntax (cddr (assoc cfengine-cf-promises cfengine-mode-syntax-cache)))) - (if cfengine-cf-promises - (or syntax - (with-demoted-errors - (with-temp-buffer - (call-process-shell-command cfengine-cf-promises - nil ; no input - t ; current buffer - nil ; no redisplay - "-s" "json") - (goto-char (point-min)) - (setq syntax (json-read)) - (setq cfengine-mode-syntax-cache - (cons (cons cfengine-cf-promises syntax) - cfengine-mode-syntax-cache)) - (setq cfengine-mode-syntax-functions-regex - (regexp-opt (mapcar (lambda (def) - (format "%s" (car def))) - (cdr (assq 'functions syntax))) - 'symbols)))))) - cfengine3-fallback-syntax)) + "Build the CFEngine 3 syntax cache and return the syntax. +Calls `cfengine-cf-promises' with \"-s json\"." + (or (cdr (assoc cfengine-cf-promises cfengine-mode-syntax-cache)) + (let ((syntax (or (when cfengine-cf-promises + (with-demoted-errors "cfengine3-make-syntax-cache: %S" + (with-temp-buffer + (or (zerop (process-file cfengine-cf-promises + nil ; no input + t ; output + nil ; no redisplay + "-s" "json")) + (error "%s" (buffer-substring + (point-min) + (progn (goto-char (point-min)) + (line-end-position))))) + (goto-char (point-min)) + (json-read)))) + cfengine3-fallback-syntax))) + (push (cons cfengine-cf-promises syntax) + cfengine-mode-syntax-cache) + (setq cfengine-mode-syntax-functions-regex + (regexp-opt (mapcar (lambda (def) + (format "%s" (car def))) + (cdr (assq 'functions syntax))) + 'symbols)) + syntax))) (defun cfengine3-documentation-function () "Document CFengine 3 functions around point. @@ -1265,7 +1268,6 @@ (defun cfengine3-completion-function () "Return completions for function name around or before point." - (cfengine3-make-syntax-cache) (let* ((bounds (save-excursion (let ((p (point))) (skip-syntax-backward "w_" (point-at-bol)) ------------------------------------------------------------ revno: 118073 fixes bug: http://debbugs.gnu.org/18649 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-10-08 15:32:38 +0300 message: Fix bug #18649 with handling C-g on MS-Windows in -nw sessions. src/w32inevt.c (maybe_generate_resize_event): Pass non-zero as the DELAY argument to change_frame_size, so that the frame size changes, if any are needed, are delayed until the next redisplay. This is to avoid a too early QUIT inside change_frame_size, when it calls Lisp in frame_windows_min_size, in case one of the events we've read sets the quit-flag. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-08 10:39:45 +0000 +++ src/ChangeLog 2014-10-08 12:32:38 +0000 @@ -1,5 +1,12 @@ 2014-10-08 Eli Zaretskii + * w32inevt.c (maybe_generate_resize_event): Pass non-zero as the + DELAY argument to change_frame_size, so that the frame size + changes, if any are needed, are delayed until the next redisplay. + This is to avoid a too early QUIT inside change_frame_size, when + it calls Lisp in frame_windows_min_size, in case one of the events + we've read sets the quit-flag. (Bug#18649) + * w32fns.c (check_x_display_info): Accept terminal objects as argument, to follow what xfns.c does. === modified file 'src/w32inevt.c' --- src/w32inevt.c 2014-09-24 07:17:51 +0000 +++ src/w32inevt.c 2014-10-08 12:32:38 +0000 @@ -605,7 +605,7 @@ change_frame_size (f, 1 + info.srWindow.Right - info.srWindow.Left, 1 + info.srWindow.Bottom - info.srWindow.Top - - FRAME_MENU_BAR_LINES (f), 0, 0, 0, 0); + - FRAME_MENU_BAR_LINES (f), 0, 1, 0, 0); } #if HAVE_W32NOTIFY ------------------------------------------------------------ revno: 118072 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-10-08 13:39:45 +0300 message: Accept terminal devices on MS-Windows in APIs that accept frame or display. src/w32fns.c (check_x_display_info): Accept terminal objects as argument, to follow what xfns.c does. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-07 20:17:09 +0000 +++ src/ChangeLog 2014-10-08 10:39:45 +0000 @@ -1,3 +1,8 @@ +2014-10-08 Eli Zaretskii + + * w32fns.c (check_x_display_info): Accept terminal objects as + argument, to follow what xfns.c does. + 2014-10-07 Glenn Morris * Makefile.in ($(srcdir)/macuvs.h) === modified file 'src/w32fns.c' --- src/w32fns.c 2014-10-03 05:31:17 +0000 +++ src/w32fns.c 2014-10-08 10:39:45 +0000 @@ -263,9 +263,9 @@ the first display on the list. */ struct w32_display_info * -check_x_display_info (Lisp_Object frame) +check_x_display_info (Lisp_Object object) { - if (NILP (frame)) + if (NILP (object)) { struct frame *sf = XFRAME (selected_frame); @@ -274,14 +274,23 @@ else return &one_w32_display_info; } - else if (STRINGP (frame)) - return x_display_info_for_name (frame); + else if (TERMINALP (object)) + { + struct terminal *t = get_terminal (object, 1); + + if (t->type != output_w32) + error ("Terminal %d is not a W32 display", t->id); + + return t->display_info.w32; + } + else if (STRINGP (object)) + return x_display_info_for_name (object); else { struct frame *f; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); + CHECK_LIVE_FRAME (object); + f = XFRAME (object); if (! FRAME_W32_P (f)) error ("Non-W32 frame used"); return FRAME_DISPLAY_INFO (f); ------------------------------------------------------------ revno: 118071 fixes bug: http://debbugs.gnu.org/18489 committer: Glenn Morris branch nick: trunk timestamp: Tue 2014-10-07 16:17:09 -0400 message: * admin/unidata/Makefile.in: Check for deleted uni- files. (all): Use unifiles rather than charprop.el. (FORCE): New variable and phony rule. (${unidir}/charprop.el): Respect FORCE. (unifiles): New rule. * src/Makefile.in ($(srcdir)/macuvs.h) ($(lispsource)/international/charprop.el): Add explicit FORCE. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-10-07 05:14:28 +0000 +++ admin/ChangeLog 2014-10-07 20:17:09 +0000 @@ -1,5 +1,11 @@ 2014-10-07 Glenn Morris + * unidata/Makefile.in: Check for deleted uni- files. (Bug#18489) + (all): Use unifiles rather than charprop.el. + (FORCE): New variable and phony rule. + (${unidir}/charprop.el): Respect FORCE. + (unifiles): New rule. + * unidata/Makefile.in (unidir): Rename from DSTDIR. Change all uses. (charprop.el, install): Remove rules. (clean): Simplify. === modified file 'admin/unidata/Makefile.in' --- admin/unidata/Makefile.in 2014-10-07 05:14:28 +0000 +++ admin/unidata/Makefile.in 2014-10-07 20:17:09 +0000 @@ -31,9 +31,9 @@ unidir = ${top_srcdir}/lisp/international emacs = "${EMACS}" -batch --no-site-file --no-site-lisp -.PHONY: all +.PHONY: all unifiles -all: ${top_srcdir}/src/macuvs.h ${unidir}/charprop.el +all: ${top_srcdir}/src/macuvs.h unifiles ## Specify .elc as an order-only prereq so as to not needlessly rebuild ## target just because the .elc is missing. @@ -50,7 +50,11 @@ unidata.txt: ${srcdir}/UnicodeData.txt sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < $< > $@ -${unidir}/charprop.el: ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt | \ +FORCE = +FORCE: +.PHONY: FORCE + +${unidir}/charprop.el: ${FORCE} ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt | \ ${srcdir}/unidata-gen.elc unidata.txt -if [ -f "$@" ]; then \ cd ${unidir} && chmod +w charprop.el `sed -n 's/^;; FILE: //p' < charprop.el`; \ @@ -58,6 +62,15 @@ ${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \ ${srcdir} "${unidir}" +## Check for deleted uni- files, and if any such, force a rebuild. +## Perhaps a more elegant way would be for the previous rule +## to generate a Makefile fragment explicitly listing the uni- files, +## which this file could include. If no fragment, rebuild everything. +unifiles: ${unidir}/charprop.el + for f in `sed -n 's/^;; FILE: //p' < $<`; do \ + [ -f ${unidir}/$$f ] || { ${MAKE} $< FORCE=FORCE || exit 1; break; };\ + done + .PHONY: clean bootstrap-clean distclean maintainer-clean extraclean clean: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-07 17:18:07 +0000 +++ src/ChangeLog 2014-10-07 20:17:09 +0000 @@ -1,3 +1,8 @@ +2014-10-07 Glenn Morris + + * Makefile.in ($(srcdir)/macuvs.h) + ($(lispsource)/international/charprop.el): Add explicit FORCE. + 2014-10-07 Eli Zaretskii * decompress.c (init_zlib_functions): Move the message about zlib === modified file 'src/Makefile.in' --- src/Makefile.in 2014-09-06 07:40:43 +0000 +++ src/Makefile.in 2014-10-07 20:17:09 +0000 @@ -437,8 +437,12 @@ $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT) $(MAKE) -C ../leim leim-list.el EMACS="$(bootstrap_exe)" +## FORCE it so that admin/unidata can decide whether these files +## are up-to-date. Although since charprop depends on bootstrap-emacs, +## and emacs (which recreates bootstrap-emacs) depends on charprop, +## in practice this rule was always run anyway. $(srcdir)/macuvs.h $(lispsource)/international/charprop.el: \ - bootstrap-emacs$(EXEEXT) + bootstrap-emacs$(EXEEXT) FORCE $(MAKE) -C ../admin/unidata all EMACS="../$(bootstrap_exe)" ## The dumped Emacs is as functional and more efficient than ------------------------------------------------------------ revno: 118070 fixes bug: http://debbugs.gnu.org/18650 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-10-07 20:18:07 +0300 message: Fix bug #18650 with warning about zlib when loading url-vars.el. src/decompress.c (init_zlib_functions): Move the message about zlib being unavailable from here... (Fzlib_decompress_region): ...to here. lisp/url/url-http.el (url-http-create-request): Recheck zlib availability on windows-nt each time it might be required. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2014-09-28 18:00:54 +0000 +++ lisp/url/ChangeLog 2014-10-07 17:18:07 +0000 @@ -1,3 +1,8 @@ +2014-10-07 Eli Zaretskii + + * url-http.el (url-http-create-request): Recheck zlib availability + on windows-nt each time it might be required. (Bug#18650) + 2014-09-28 Ulf Jasper * url-gw.el (url-open-stream): New optional parameter === modified file 'lisp/url/url-http.el' --- lisp/url/url-http.el 2014-09-28 18:00:54 +0000 +++ lisp/url/url-http.el 2014-10-07 17:18:07 +0000 @@ -313,7 +313,14 @@ (concat "From: " url-personal-mail-address "\r\n")) ;; Encodings we understand - (if url-mime-encoding-string + (if (or url-mime-encoding-string + ;; MS-Windows loads zlib dynamically, so recheck + ;; in case they made it available since + ;; initialization in url-vars.el. + (and (eq 'system-type 'windows-nt) + (fboundp 'zlib-available-p) + (zlib-available-p) + (setq url-mime-encoding-string "gzip"))) (concat "Accept-encoding: " url-mime-encoding-string "\r\n")) (if url-mime-charset-string === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-07 16:00:35 +0000 +++ src/ChangeLog 2014-10-07 17:18:07 +0000 @@ -1,3 +1,9 @@ +2014-10-07 Eli Zaretskii + + * decompress.c (init_zlib_functions): Move the message about zlib + being unavailable from here... + (Fzlib_decompress_region): ...to here. (Bug#18650) + 2014-10-07 Dmitry Antipov * font.c (Ffont_get_glyphs): Use validate_subarray and fix === modified file 'src/decompress.c' --- src/decompress.c 2014-01-01 07:43:34 +0000 +++ src/decompress.c 2014-10-07 17:18:07 +0000 @@ -60,10 +60,7 @@ HMODULE library = w32_delayed_load (Qzlib_dll); if (!library) - { - message1 ("zlib library not found"); - return false; - } + return false; LOAD_ZLIB_FN (library, inflateInit2_); LOAD_ZLIB_FN (library, inflate); @@ -150,7 +147,10 @@ if (!zlib_initialized) zlib_initialized = init_zlib_functions (); if (!zlib_initialized) - return Qnil; + { + message1 ("zlib library not found"); + return Qnil; + } #endif /* This is a unibyte buffer, so character positions and bytes are ------------------------------------------------------------ revno: 118069 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-10-07 20:00:35 +0400 message: * font.c (Ffont_get_glyphs): Use validate_subarray and fix the case where an optional string is used. Adjust docstring. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-06 17:47:56 +0000 +++ src/ChangeLog 2014-10-07 16:00:35 +0000 @@ -1,3 +1,8 @@ +2014-10-07 Dmitry Antipov + + * font.c (Ffont_get_glyphs): Use validate_subarray and fix + the case where an optional string is used. Adjust docstring. + 2014-10-06 Stefan Monnier * lisp.mk (lisp): Remove w32-common-fns.elc. === modified file 'src/font.c' --- src/font.c 2014-10-03 15:44:46 +0000 +++ src/font.c 2014-10-07 16:00:35 +0000 @@ -4687,9 +4687,10 @@ doc: /* Return a vector of FONT-OBJECT's glyphs for the specified characters. FROM and TO are positions (integers or markers) specifying a region -of the current buffer. -If the optional fourth arg OBJECT is not nil, it is a string or a -vector containing the target characters. +of the current buffer, and can be in either order. If the optional +fourth arg OBJECT is not nil, it is a string or a vector containing +the target characters between indices FROM and TO, which are treated +as in `substring'. Each element is a vector containing information of a glyph in this format: [FROM-IDX TO-IDX C CODE WIDTH LBEARING RBEARING ASCENT DESCENT ADJUSTMENT] @@ -4732,45 +4733,50 @@ else if (STRINGP (object)) { const unsigned char *p; + ptrdiff_t ifrom, ito; - CHECK_NUMBER (from); - CHECK_NUMBER (to); - if (XINT (from) < 0 || XINT (from) > XINT (to) - || XINT (to) > SCHARS (object)) - args_out_of_range_3 (object, from, to); - if (EQ (from, to)) + validate_subarray (object, from, to, SCHARS (object), &ifrom, &ito); + if (ifrom == ito) return Qnil; - len = XFASTINT (to) - XFASTINT (from); + len = ito - ifrom; SAFE_ALLOCA_LISP (chars, len); p = SDATA (object); if (STRING_MULTIBYTE (object)) - for (i = 0; i < len; i++) + { + int c; + + /* Skip IFROM characters from the beginning. */ + for (i = 0; i < ifrom; i++) + c = STRING_CHAR_ADVANCE (p); + + /* Now fetch an interesting characters. */ + for (i = 0; i < len; i++) { - int c = STRING_CHAR_ADVANCE (p); + c = STRING_CHAR_ADVANCE (p); chars[i] = make_number (c); } + } else for (i = 0; i < len; i++) - chars[i] = make_number (p[i]); + chars[i] = make_number (p[ifrom + i]); } - else + else if (VECTORP (object)) { - CHECK_VECTOR (object); - CHECK_NUMBER (from); - CHECK_NUMBER (to); - if (XINT (from) < 0 || XINT (from) > XINT (to) - || XINT (to) > ASIZE (object)) - args_out_of_range_3 (object, from, to); - if (EQ (from, to)) + ptrdiff_t ifrom, ito; + + validate_subarray (object, from, to, ASIZE (object), &ifrom, &ito); + if (ifrom == ito) return Qnil; - len = XFASTINT (to) - XFASTINT (from); + len = ito - ifrom; for (i = 0; i < len; i++) { - Lisp_Object elt = AREF (object, XFASTINT (from) + i); + Lisp_Object elt = AREF (object, ifrom + i); CHECK_CHARACTER (elt); } - chars = aref_addr (object, XFASTINT (from)); + chars = aref_addr (object, ifrom); } + else + wrong_type_argument (Qarrayp, object); vec = make_uninit_vector (len); for (i = 0; i < len; i++) ------------------------------------------------------------ revno: 118068 committer: Glenn Morris branch nick: trunk timestamp: Mon 2014-10-06 22:14:28 -0700 message: admin/unidata/Makefile.in small cleanup * admin/unidata/Makefile.in (unidir): Rename from DSTDIR. Change all uses. (charprop.el, install): Remove rules. (clean): Simplify. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-10-04 19:07:05 +0000 +++ admin/ChangeLog 2014-10-07 05:14:28 +0000 @@ -1,3 +1,9 @@ +2014-10-07 Glenn Morris + + * unidata/Makefile.in (unidir): Rename from DSTDIR. Change all uses. + (charprop.el, install): Remove rules. + (clean): Simplify. + 2014-10-04 Glenn Morris * authors.el (authors-renamed-files-alist): Add package-x-test.el === modified file 'admin/unidata/Makefile.in' --- admin/unidata/Makefile.in 2014-06-25 06:03:13 +0000 +++ admin/unidata/Makefile.in 2014-10-07 05:14:28 +0000 @@ -28,12 +28,12 @@ top_builddir = @top_builddir@ EMACS = ${top_builddir}/src/emacs -DSTDIR = ${top_srcdir}/lisp/international +unidir = ${top_srcdir}/lisp/international emacs = "${EMACS}" -batch --no-site-file --no-site-lisp -.PHONY: all compile install +.PHONY: all -all: ${top_srcdir}/src/macuvs.h ${DSTDIR}/charprop.el +all: ${top_srcdir}/src/macuvs.h ${unidir}/charprop.el ## Specify .elc as an order-only prereq so as to not needlessly rebuild ## target just because the .elc is missing. @@ -50,30 +50,18 @@ unidata.txt: ${srcdir}/UnicodeData.txt sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < $< > $@ -${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt | \ +${unidir}/charprop.el: ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt | \ ${srcdir}/unidata-gen.elc unidata.txt -if [ -f "$@" ]; then \ - cd ${DSTDIR} && chmod +w charprop.el `sed -n 's/^;; FILE: //p' < charprop.el`; \ + cd ${unidir} && chmod +w charprop.el `sed -n 's/^;; FILE: //p' < charprop.el`; \ fi ${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \ - ${srcdir} "${DSTDIR}" - -## Like the above, but generate in PWD rather than lisp/international. -charprop.el: ${srcdir}/unidata-gen.elc unidata.txt - ${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \ - ${srcdir} + ${srcdir} "${unidir}" .PHONY: clean bootstrap-clean distclean maintainer-clean extraclean -install: charprop.el - cp charprop.el ${DSTDIR} - cp `sed -n 's/^;; FILE: //p' < charprop.el` ${DSTDIR} - clean: - if test -f charprop.el; then \ - rm -f `sed -n 's/^;; FILE: //p' < charprop.el`; \ - fi - rm -f charprop.el ${srcdir}/*.elc unidata.txt + rm -f ${srcdir}/*.elc unidata.txt bootstrap-clean: clean @@ -87,7 +75,7 @@ ## Cf leim/ja-dic (which is much slower). extraclean: rm -f ${top_srcdir}/src/macuvs.h - if test -f ${DSTDIR}/charprop.el; then \ - (cd ${DSTDIR} && rm -f `sed -n 's/^;; FILE: //p' < charprop.el`); \ - rm -f ${DSTDIR}/charprop.el; \ + if test -f ${unidir}/charprop.el; then \ + (cd ${unidir} && rm -f `sed -n 's/^;; FILE: //p' < charprop.el`); \ + rm -f ${unidir}/charprop.el; \ fi ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.