Now on revision 111801. ------------------------------------------------------------ revno: 111801 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 19:39:12 -0800 message: Add variables for default/minimum animated image frame delay * lisp/image.el (image-default-frame-delay): New variable. (image-animated-p): Use image-default-frame-delay. (image-minimum-frame-delay): New constant. (image-animate-timeout): Use image-minimum-frame-delay. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-16 03:29:39 +0000 +++ lisp/ChangeLog 2013-02-16 03:39:12 +0000 @@ -1,5 +1,10 @@ 2013-02-16 Glenn Morris + * image.el (image-default-frame-delay): New variable. + (image-animated-p): Use image-default-frame-delay. + (image-minimum-frame-delay): New constant. + (image-animate-timeout): Use image-minimum-frame-delay. + * image.el (image-nth-frame): New, split from image-animate-timeout. (image-animate-timeout): Use image-nth-frame. * image-mode.el (image-goto-frame, image-next-frame) === modified file 'lisp/image.el' --- lisp/image.el 2013-02-16 03:29:39 +0000 +++ lisp/image.el 2013-02-16 03:39:12 +0000 @@ -609,6 +609,10 @@ (defconst image-animated-types '(gif) "List of supported animated image types.") +(defvar image-default-frame-delay 0.1 + "Default interval in seconds between frames of a multi-frame image. +Only used if the image does not specify a value.") + (defun image-animated-p (image) "Return non-nil if IMAGE can be animated. To be capable of being animated, an image must be of a type @@ -623,7 +627,7 @@ (images (plist-get metadata 'count)) (delay (plist-get metadata 'delay))) (when (and images (> images 1) (numberp delay)) - (if (< delay 0) (setq delay 0.1)) + (if (< delay 0) (setq delay image-default-frame-delay)) (cons images delay)))))) ;; "Destructively"? @@ -657,6 +661,9 @@ (setq timer nil))) timer)) +(defconst image-minimum-frame-delay 0.01 + "Minimum interval in seconds between frames of an animated image.") + (defvar-local image-current-frame nil "The frame index of the current animated image.") @@ -684,7 +691,7 @@ LIMIT determines when to stop. If t, loop forever. If nil, stop after displaying the last animation frame. Otherwise, stop after LIMIT seconds have elapsed. -The minimum delay between successive frames is 0.01s." +The minimum delay between successive frames is `image-minimum-frame-delay'." (image-nth-frame image n t) (setq n (1+ n)) (let* ((time (float-time)) @@ -692,7 +699,7 @@ ;; Subtract off the time we took to load the image from the ;; stated delay time. (delay (max (+ (cdr animation) time (- (float-time))) - 0.01)) + image-minimum-frame-delay)) done) (if (>= n count) (if limit ------------------------------------------------------------ revno: 111800 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 19:29:39 -0800 message: Add commands for navigating multi-frame images * lisp/image.el (image-nth-frame): New, split from image-animate-timeout. (image-animate-timeout): Use image-nth-frame. * lisp/image-mode.el (image-goto-frame, image-next-frame) (image-previous-frame): New commands. (image-mode-map): Add new frame commands. * etc/NEWS: Mention this. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-02-14 12:36:44 +0000 +++ etc/NEWS 2013-02-16 03:29:39 +0000 @@ -141,6 +141,10 @@ visit the next image file and the previous image file in the same directory, respectively. +*** New commands to show specific frames of multi-frame images. +`f' (`image-next-frame') and `b' (`image-previous-frame') visit the +next or previous frame. `F' (`image-goto-frame') shows a specific frame. + --- *** The command `image-mode-fit-frame' deletes other windows. When toggling, it restores the frame's previous window configuration. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-16 02:50:44 +0000 +++ lisp/ChangeLog 2013-02-16 03:29:39 +0000 @@ -1,3 +1,11 @@ +2013-02-16 Glenn Morris + + * image.el (image-nth-frame): New, split from image-animate-timeout. + (image-animate-timeout): Use image-nth-frame. + * image-mode.el (image-goto-frame, image-next-frame) + (image-previous-frame): New commands. + (image-mode-map): Add new frame commands. + 2013-02-16 Jonas Bernoulli * emacs-lisp/tabulated-list.el (tabulated-list-print-col): === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2013-02-16 01:58:20 +0000 +++ lisp/image-mode.el 2013-02-16 03:29:39 +0000 @@ -340,6 +340,9 @@ (define-key map (kbd "S-SPC") 'image-scroll-down) (define-key map (kbd "DEL") 'image-scroll-down) (define-key map (kbd "RET") 'image-toggle-animation) + (define-key map "F" 'image-goto-frame) + (define-key map "f" 'image-next-frame) + (define-key map "b" 'image-previous-frame) (define-key map "n" 'image-next-file) (define-key map "p" 'image-previous-file) (define-key map [remap forward-char] 'image-forward-hscroll) @@ -627,6 +630,37 @@ (image-animate image index (if image-animate-loop t))))))))) +(defun image-goto-frame (n &optional relative) + "Show frame N of a multi-frame image. +Optional argument OFFSET non-nil means interpret N as relative to the +current frame. Frames are indexed from 1." + (interactive + (list (or current-prefix-arg + (read-number "Show frame number: ")))) + (let ((image (image-get-display-property)) + animation) + (cond + ((null image) + (error "No image is present")) + ((null image-current-frame) + (message "No image animation.")) + (t + (image-nth-frame image (if relative (+ n image-current-frame) (1- n))))))) + +(defun image-next-frame (&optional n) + "Switch to the next frame of a multi-frame image. +With optional argument N, switch to the Nth frame after the current one. +If N is negative, switch to the Nth frame before the current one." + (interactive "p") + (image-goto-frame n t)) + +(defun image-previous-frame (&optional n) + "Switch to the previous frame of a multi-frame image. +With optional argument N, switch to the Nth frame before the current one. +If N is negative, switch to the Nth frame after the current one." + (interactive "p") + (image-next-frame (- n))) + ;;; Switching to the next/previous image === modified file 'lisp/image.el' --- lisp/image.el 2013-02-16 01:58:20 +0000 +++ lisp/image.el 2013-02-16 03:29:39 +0000 @@ -660,6 +660,17 @@ (defvar-local image-current-frame nil "The frame index of the current animated image.") +(defun image-nth-frame (image n &optional nocheck) + "Show frame N of IMAGE. +Frames are indexed from 0. Optional argument NOCHECK non-nil means +do not check N is within the range of frames present in the image." + (unless nocheck + (if (< n 0) (setq n 0) + (setq n (min n (1- (car (image-animated-p image))))))) + (plist-put (cdr image) :index n) + (setq image-current-frame n) + (force-window-update)) + ;; FIXME? The delay may not be the same for different sub-images, ;; hence we need to call image-animated-p to return it. ;; But it also returns count, so why do we bother passing that as an @@ -674,9 +685,7 @@ after displaying the last animation frame. Otherwise, stop after LIMIT seconds have elapsed. The minimum delay between successive frames is 0.01s." - (plist-put (cdr image) :index n) - (setq image-current-frame n) - (force-window-update) + (image-nth-frame image n t) (setq n (1+ n)) (let* ((time (float-time)) (animation (image-animated-p image)) ------------------------------------------------------------ revno: 111799 fixes bug: http://debbugs.gnu.org/13563 author: Jonas Bernoulli committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 18:50:44 -0800 message: * emacs-lisp/tabulated-list.el (tabulated-list-print-col): If col-desc already has help-echo, use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-16 01:58:20 +0000 +++ lisp/ChangeLog 2013-02-16 02:50:44 +0000 @@ -1,3 +1,8 @@ +2013-02-16 Jonas Bernoulli + + * emacs-lisp/tabulated-list.el (tabulated-list-print-col): + If col-desc already has help-echo, use it. (Bug#13563) + 2013-02-16 Glenn Morris * image.el (image-current-frame): New variable. === modified file 'lisp/emacs-lisp/tabulated-list.el' --- lisp/emacs-lisp/tabulated-list.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/tabulated-list.el 2013-02-16 02:50:44 +0000 @@ -379,7 +379,9 @@ (setq width (- width shift)) (setq x (+ x shift)))) (if (stringp col-desc) - (insert (propertize label 'help-echo help-echo)) + (insert (if (get-text-property 0 'help-echo label) + label + (propertize label 'help-echo help-echo))) (apply 'insert-text-button label (cdr col-desc))) (let ((next-x (+ x pad-right width))) ;; No need to append any spaces if this is the last column. ------------------------------------------------------------ revno: 111798 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 21:05:32 -0500 message: url-http-wait-for-headers-change-function fix for bug#13598 * lisp/url/url-http.el (url-http-wait-for-headers-change-function): Avoid prematurely finding the end of headers when they arrive line-by-line. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2013-02-03 16:13:36 +0000 +++ lisp/url/ChangeLog 2013-02-16 02:05:32 +0000 @@ -1,3 +1,9 @@ +2013-02-16 Glenn Morris + + * url-http.el (url-http-wait-for-headers-change-function): + Avoid prematurely finding the end of headers when they arrive + line-by-line. (Bug#13598) + 2013-02-03 Stefan Monnier * url-cache.el (url-cache-create-filename-using-md5): Don't waste your === modified file 'lisp/url/url-http.el' --- lisp/url/url-http.el 2013-01-02 16:13:04 +0000 +++ lisp/url/url-http.el 2013-02-16 02:05:32 +0000 @@ -1040,7 +1040,9 @@ (setq end-of-headers t url-http-end-of-headers 0 old-http t) - (when (re-search-forward "^\r*$" nil t) + ;; Blank line at end of headers. + (when (re-search-forward "^\r?\n" nil t) + (backward-char 1) ;; Saw the end of the headers (url-http-debug "Saw end of headers... (%s)" (buffer-name)) (setq url-http-end-of-headers (set-marker (make-marker) ------------------------------------------------------------ revno: 111797 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 20:58:20 -0500 message: Display a mode-line frame counter for animated images * lisp/image.el (image-current-frame): New variable. (image-animate-timeout): Set image-current-frame. * lisp/image-mode.el (image-mode): For animated images, display a frame counter via mode-line-process. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-16 01:55:31 +0000 +++ lisp/ChangeLog 2013-02-16 01:58:20 +0000 @@ -1,5 +1,10 @@ 2013-02-16 Glenn Morris + * image.el (image-current-frame): New variable. + (image-animate-timeout): Set image-current-frame. + * image-mode.el (image-mode): For animated images, + display a frame counter via mode-line-process. + * font-lock.el (lisp-font-lock-keywords-1): Add defvar-local. 2013-02-15 Stefan Monnier === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2013-02-13 08:28:47 +0000 +++ lisp/image-mode.el 2013-02-16 01:58:20 +0000 @@ -409,11 +409,18 @@ (run-mode-hooks 'image-mode-hook) (let ((image (image-get-display-property)) (msg1 (substitute-command-keys - "Type \\[image-toggle-display] to view the image as "))) + "Type \\[image-toggle-display] to view the image as ")) + animated) (cond ((null image) (message "%s" (concat msg1 "an image."))) - ((image-animated-p image) + ((setq animated (image-animated-p image)) + (setq image-current-frame (or (plist-get (cdr image) :index) 0) + mode-line-process + `(:eval (propertize (format " [%s/%s]" + (1+ image-current-frame) + ,(car animated)) + 'help-echo "Frame number"))) (message "%s" (concat msg1 "text, or " (substitute-command-keys === modified file 'lisp/image.el' --- lisp/image.el 2013-01-02 16:13:04 +0000 +++ lisp/image.el 2013-02-16 01:58:20 +0000 @@ -657,6 +657,9 @@ (setq timer nil))) timer)) +(defvar-local image-current-frame nil + "The frame index of the current animated image.") + ;; FIXME? The delay may not be the same for different sub-images, ;; hence we need to call image-animated-p to return it. ;; But it also returns count, so why do we bother passing that as an @@ -672,6 +675,7 @@ after LIMIT seconds have elapsed. The minimum delay between successive frames is 0.01s." (plist-put (cdr image) :index n) + (setq image-current-frame n) (force-window-update) (setq n (1+ n)) (let* ((time (float-time)) ------------------------------------------------------------ revno: 111796 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 20:55:31 -0500 message: * lisp/font-lock.el (lisp-font-lock-keywords-1): Add defvar-local. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-15 23:47:50 +0000 +++ lisp/ChangeLog 2013-02-16 01:55:31 +0000 @@ -1,3 +1,7 @@ +2013-02-16 Glenn Morris + + * font-lock.el (lisp-font-lock-keywords-1): Add defvar-local. + 2013-02-15 Stefan Monnier * simple.el (eval-expression): Let `exp' set the mark (bug#13724). @@ -15,15 +19,13 @@ * iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to `iswitchb-next-match' and `iswitchb-prev-match' resply. - * ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to `ido-next-match' and `ido-prev-match' resply. - * icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'. Bind `C-.' and `C-,' to `icomplete-forward-completions' and `icomplete-backward-completions' (Bug#13708). -2013-02-15 Michael Albinus +2013-02-15 Glenn Morris * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. === modified file 'lisp/font-lock.el' --- lisp/font-lock.el 2013-01-11 23:08:55 +0000 +++ lisp/font-lock.el 2013-02-16 01:55:31 +0000 @@ -2256,7 +2256,7 @@ "method-combination\\|setf-expander\\|skeleton\\|widget\\|" "function\\|\\(compiler\\|modify\\|symbol\\)-macro\\)\\)\\|" ;; Variable declarations. - "\\(const\\(ant\\)?\\|custom\\|varalias\\|face\\|parameter\\|var\\)\\|" + "\\(const\\(ant\\)?\\|custom\\|varalias\\|face\\|parameter\\|var\\(?:-local\\)?\\)\\|" ;; Structure declarations. "\\(class\\|group\\|theme\\|package\\|struct\\|type\\)" "\\)\\)\\>" ------------------------------------------------------------ revno: 111795 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13724 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-02-15 18:47:50 -0500 message: * lisp/simple.el (eval-expression): Let `exp' set the mark. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-15 20:01:51 +0000 +++ lisp/ChangeLog 2013-02-15 23:47:50 +0000 @@ -1,11 +1,15 @@ +2013-02-15 Stefan Monnier + + * simple.el (eval-expression): Let `exp' set the mark (bug#13724). + 2013-02-15 Alan Mackenzie * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a global minor mode has been enabled, call the minor mode function for a new buffer once only, after the major mode hook, whilst allowing that hook explicitly to disable the minor mode. - (MODE-disable-in-buffer): new (generated) function. - (disable-MODE): new (generated) buffer local variable. + (MODE-disable-in-buffer): New (generated) function. + (disable-MODE): New (generated) buffer local variable. 2013-02-15 Jambunathan K @@ -52,8 +56,8 @@ 2013-02-14 Michael Albinus - * net/tramp.el (tramp-debug-message): Add - `tramp-condition-case-unless-debug'. + * net/tramp.el (tramp-debug-message): + Add `tramp-condition-case-unless-debug'. (tramp-debug-on-error): New defvar. (tramp-condition-case-unless-debug): New defun. (tramp-file-name-handler): Use it. @@ -207,8 +211,8 @@ * net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache' only if it doesn't exist. - * net/tramp-sh.el (tramp-sh-handle-start-file-process): Set - process marker. + * net/tramp-sh.el (tramp-sh-handle-start-file-process): + Set process marker. 2013-02-12 Tassilo Horn === modified file 'lisp/simple.el' --- lisp/simple.el 2013-02-12 04:46:18 +0000 +++ lisp/simple.el 2013-02-15 23:47:50 +0000 @@ -1293,13 +1293,12 @@ ;; We define this, rather than making `eval' interactive, ;; for the sake of completion of names like eval-region, eval-buffer. -(defun eval-expression (eval-expression-arg - &optional eval-expression-insert-value) - "Evaluate EVAL-EXPRESSION-ARG and print value in the echo area. +(defun eval-expression (exp &optional insert-value) + "Evaluate EXP and print value in the echo area. When called interactively, read an Emacs Lisp expression and evaluate it. Value is also consed on to front of the variable `values'. -Optional argument EVAL-EXPRESSION-INSERT-VALUE non-nil (interactively, +Optional argument INSERT-VALUE non-nil (interactively, with prefix argument) means insert the result into the current buffer instead of printing it in the echo area. Truncates long output according to the value of the variables `eval-expression-print-length' @@ -1315,12 +1314,12 @@ current-prefix-arg)) (if (null eval-expression-debug-on-error) - (push (eval eval-expression-arg lexical-binding) values) + (push (eval exp lexical-binding) values) (let ((old-value (make-symbol "t")) new-value) ;; Bind debug-on-error to something unique so that we can ;; detect when evalled code changes it. (let ((debug-on-error old-value)) - (push (eval eval-expression-arg lexical-binding) values) + (push (eval exp lexical-binding) values) (setq new-value debug-on-error)) ;; If evalled code has changed the value of debug-on-error, ;; propagate that change to the global binding. @@ -1328,8 +1327,9 @@ (setq debug-on-error new-value)))) (let ((print-length eval-expression-print-length) - (print-level eval-expression-print-level)) - (if eval-expression-insert-value + (print-level eval-expression-print-level) + (deactivate-mark)) + (if insert-value (with-no-warnings (let ((standard-output (current-buffer))) (prin1 (car values)))) ------------------------------------------------------------ revno: 111794 committer: Alan Mackenzie branch nick: trunk timestamp: Fri 2013-02-15 20:01:51 +0000 message: emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a global minor mode has been enabled, call the minor mode function for a new buffer once only, after the major mode hook, whilst allowing that hook explicitly to disable the minor mode. (MODE-disable-in-buffer): new (generated) function. (disable-MODE): new (generated) buffer local variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-15 19:19:29 +0000 +++ lisp/ChangeLog 2013-02-15 20:01:51 +0000 @@ -1,3 +1,12 @@ +2013-02-15 Alan Mackenzie + + * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a + global minor mode has been enabled, call the minor mode function + for a new buffer once only, after the major mode hook, whilst + allowing that hook explicitly to disable the minor mode. + (MODE-disable-in-buffer): new (generated) function. + (disable-MODE): new (generated) buffer local variable. + 2013-02-15 Jambunathan K * iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2013-02-14 17:16:47 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2013-02-15 20:01:51 +0000 @@ -341,9 +341,14 @@ enabled, then disabling and reenabling MODE should make MODE work correctly with the current major mode. This is important to prevent problems with derived modes, that is, major modes that -call another major mode in their body." +call another major mode in their body. + +When a major mode is initialized, MODE is actually turned on just +after running the major mode's hook. However, MODE is not turned +on if the hook has explicitly disabled it." (declare (doc-string 2)) (let* ((global-mode-name (symbol-name global-mode)) + (mode-name (symbol-name mode)) (pretty-name (easy-mmode-pretty-mode-name mode)) (pretty-global-name (easy-mmode-pretty-mode-name global-mode)) (group nil) @@ -354,6 +359,10 @@ (MODE-check-buffers (intern (concat global-mode-name "-check-buffers"))) (MODE-cmhh (intern (concat global-mode-name "-cmhh"))) + (MODE-disable-in-buffer + (intern (concat global-mode-name "-disable-in-buffer"))) + (minor-MODE-hook (intern (concat mode-name "-hook"))) + (disable-MODE (intern (concat "disable-" mode-name))) (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) keyw) @@ -397,8 +406,6 @@ (progn (add-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) - (add-hook 'change-major-mode-after-body-hook - ',MODE-enable-in-buffers) (add-hook 'find-file-hook ',MODE-check-buffers) (add-hook 'change-major-mode-hook ',MODE-cmhh)) (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) @@ -416,6 +423,10 @@ ;; up-to-here. :autoload-end + ;; A function which checks whether MODE has been disabled in the major + ;; mode hook which has just been run. + (add-hook ',minor-MODE-hook ',MODE-disable-in-buffer) + ;; List of buffers left to process. (defvar ,MODE-buffers nil) @@ -424,14 +435,15 @@ (dolist (buf ,MODE-buffers) (when (buffer-live-p buf) (with-current-buffer buf - (unless (eq ,MODE-major-mode major-mode) - (if ,mode - (progn - (,mode -1) - (,turn-on) - (setq ,MODE-major-mode major-mode)) - (,turn-on) - (setq ,MODE-major-mode major-mode))))))) + (if ,disable-MODE + (if ,mode (,mode -1)) + (unless (eq ,MODE-major-mode major-mode) + (if ,mode + (progn + (,mode -1) + (,turn-on)) + (,turn-on)))) + (setq ,MODE-major-mode major-mode))))) (put ',MODE-enable-in-buffers 'definition-name ',global-mode) (defun ,MODE-check-buffers () @@ -444,7 +456,14 @@ (defun ,MODE-cmhh () (add-to-list ',MODE-buffers (current-buffer)) (add-hook 'post-command-hook ',MODE-check-buffers)) - (put ',MODE-cmhh 'definition-name ',global-mode)))) + (put ',MODE-cmhh 'definition-name ',global-mode) + ;; disable-MODE is set in MODE-disable-in-buffer and cleared by + ;; kill-all-local-variables. + (defvar-local ,disable-MODE nil) + (defun ,MODE-disable-in-buffer () + (unless ,mode + (setq ,disable-MODE t))) + (put ',MODE-disable-in-buffer 'definition-name ',global-mode)))) ;;; ;;; easy-mmode-defmap ------------------------------------------------------------ revno: 111793 [merge] committer: Jambunathan K branch nick: trunk timestamp: Sat 2013-02-16 01:09:50 +0530 message: ido, iswitchb, icomplete: Use `C-.' and `C-,' for cycling (Bug#13708) * lisp/icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'. Bind `C-.' and `C-,' to `icomplete-forward-completions' and `icomplete-backward-completions'. * lisp/ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to `ido-next-match' and `ido-prev-match' resply. * lisp/iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to `iswitchb-next-match' and `iswitchb-prev-match' resply. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-15 06:35:54 +0000 +++ lisp/ChangeLog 2013-02-15 19:19:29 +0000 @@ -1,3 +1,15 @@ +2013-02-15 Jambunathan K + + * iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to + `iswitchb-next-match' and `iswitchb-prev-match' resply. + + * ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to + `ido-next-match' and `ido-prev-match' resply. + + * icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'. + Bind `C-.' and `C-,' to `icomplete-forward-completions' and + `icomplete-backward-completions' (Bug#13708). + 2013-02-15 Michael Albinus * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. === modified file 'lisp/icomplete.el' --- lisp/icomplete.el 2013-02-13 15:13:22 +0000 +++ lisp/icomplete.el 2013-02-15 19:19:29 +0000 @@ -168,8 +168,8 @@ (let ((map (make-sparse-keymap))) (define-key map [?\M-\t] 'minibuffer-force-complete) (define-key map [?\C-j] 'minibuffer-force-complete-and-exit) - (define-key map [?\C-s] 'icomplete-forward-completions) - (define-key map [?\C-r] 'icomplete-backward-completions) + (define-key map [?\C-.] 'icomplete-forward-completions) + (define-key map [?\C-,] 'icomplete-backward-completions) map)) (defun icomplete-forward-completions () === modified file 'lisp/ido.el' --- lisp/ido.el 2013-01-02 16:13:04 +0000 +++ lisp/ido.el 2013-02-15 19:19:29 +0000 @@ -1585,6 +1585,8 @@ (define-key map "\C-p" 'ido-toggle-prefix) (define-key map "\C-r" 'ido-prev-match) (define-key map "\C-s" 'ido-next-match) + (define-key map [?\C-.] 'ido-next-match) + (define-key map [?\C-,] 'ido-prev-match) (define-key map "\C-t" 'ido-toggle-regexp) (define-key map "\C-z" 'ido-undo-merge-work-directory) (define-key map [(control ?\s)] 'ido-restrict-to-matches) === modified file 'lisp/iswitchb.el' --- lisp/iswitchb.el 2013-01-01 09:11:05 +0000 +++ lisp/iswitchb.el 2013-02-15 19:19:29 +0000 @@ -471,6 +471,8 @@ (define-key map "?" 'iswitchb-completion-help) (define-key map "\C-s" 'iswitchb-next-match) (define-key map "\C-r" 'iswitchb-prev-match) + (define-key map [?\C-.] 'iswitchb-next-match) + (define-key map [?\C-,] 'iswitchb-prev-match) (define-key map "\t" 'iswitchb-complete) (define-key map "\C-j" 'iswitchb-select-buffer-text) (define-key map "\C-t" 'iswitchb-toggle-regexp) ------------------------------------------------------------ revno: 111792 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-02-15 21:37:29 +0200 message: Remove unneeded bits of commit eliz@gnu.org-20130215094131-hohn5xakw0v6hqp5 merged from release branch. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-15 19:08:11 +0000 +++ src/ChangeLog 2013-02-15 19:37:29 +0000 @@ -8,16 +8,7 @@ when auto-save-timeout is less than 4. (Bug#13720) * w32proc.c (new_child): Free up to 2 slots of dead processes at a - time. Improve diagnostics in DebPrint. - (reader_thread): If cp->char_avail is NULL, set the FILE_AT_EOF - flag, so that sys_select could have a chance of noticing that this - process is dead, and call a SIGCHLD handler for it. Improve - diagnostics in DebPrint. - (reap_subprocess): Reset the FILE_AT_EOF flag set by - reader_thread. - (sys_select): Watch a process whose procinfo.hProcess is non-NULL - even if its char_avail is NULL. Allows to reap subprocesses that - were forcibly deleted by delete-process. (Bug#13546) + time. Improve diagnostics in DebPrint. (Bug#13546) * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname) (sys_gethostbyname, sys_getservbyname, sys_getpeername) === modified file 'src/w32proc.c' --- src/w32proc.c 2013-02-15 17:31:12 +0000 +++ src/w32proc.c 2013-02-15 19:37:29 +0000 @@ -1017,17 +1017,6 @@ if (cp->status == STATUS_READ_ERROR || !cp->char_avail) break; - if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess && cp->fd >= 0) - { - /* Somebody already called delete_child on this child, since - only delete_child zeroes out cp->char_avail. This means - no one will read from cp->fd and will not set the - FILE_AT_EOF flag, therefore preventing sys_select from - noticing that the process died. Set the flag here - instead. */ - fd_info[cp->fd].flags |= FILE_AT_EOF; - } - /* The name char_avail is a misnomer - it really just means the read-ahead has completed, whether successfully or not. */ if (!SetEvent (cp->char_avail)) @@ -1237,11 +1226,6 @@ sys_read when the subprocess output is fully read. */ if (cp->fd < 0) delete_child (cp); - else - { - /* Reset the flag set by reader_thread. */ - fd_info[cp->fd].flags &= ~FILE_AT_EOF; - } } /* Wait for a child process specified by PID, or for any of our @@ -2067,7 +2051,7 @@ /* Some child_procs might be sockets; ignore them. Also some children may have died already, but we haven't finished reading the process output; ignore them too. */ - if ((CHILD_ACTIVE (cp) || cp->procinfo.hProcess) + if ((CHILD_ACTIVE (cp) && cp->procinfo.hProcess) && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_SEND_SIGCHLD) == 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0) ------------------------------------------------------------ revno: 111791 committer: Paul Eggert branch nick: trunk timestamp: Fri 2013-02-15 11:08:11 -0800 message: * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-15 18:52:16 +0000 +++ src/ChangeLog 2013-02-15 19:08:11 +0000 @@ -1,3 +1,7 @@ +2013-02-15 Paul Eggert + + * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl. + 2013-02-15 Eli Zaretskii * keyboard.c (read_char): Fix calculation of auto-save time out === modified file 'src/process.c' --- src/process.c 2013-01-02 16:13:04 +0000 +++ src/process.c 2013-02-15 19:08:11 +0000 @@ -180,10 +180,6 @@ #define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) #define SERIALCONN1_P(p) (EQ (p->type, Qserial)) -#ifndef HAVE_H_ERRNO -extern int h_errno; -#endif - /* Number of events of change of status of a process. */ static EMACS_INT process_tick; /* Number of events for which the user or sentinel has been notified. */ @@ -5567,7 +5563,7 @@ if (XINT (start) < GPT && XINT (end) > GPT) move_gap_both (XINT (start), start_byte); - send_process (proc, (char *) BYTE_POS_ADDR (start_byte), + send_process (proc, (char *) BYTE_POS_ADDR (start_byte), end_byte - start_byte, Fcurrent_buffer ()); return Qnil; ------------------------------------------------------------ revno: 111790 fixes bug: http://debbugs.gnu.org/13720 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-02-15 20:52:16 +0200 message: Fix bug #13720 with auto-save-timeout less than 4 seconds. src/keyboard.c (read_char): Fix calculation of auto-save time out when auto-save-timeout is less than 4. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-15 17:31:12 +0000 +++ src/ChangeLog 2013-02-15 18:52:16 +0000 @@ -1,5 +1,8 @@ 2013-02-15 Eli Zaretskii + * keyboard.c (read_char): Fix calculation of auto-save time out + when auto-save-timeout is less than 4. (Bug#13720) + * w32proc.c (new_child): Free up to 2 slots of dead processes at a time. Improve diagnostics in DebPrint. (reader_thread): If cp->char_avail is NULL, set the FILE_AT_EOF === modified file 'src/keyboard.c' --- src/keyboard.c 2013-02-14 14:40:54 +0000 +++ src/keyboard.c 2013-02-15 18:52:16 +0000 @@ -2657,9 +2657,10 @@ && XINT (Vauto_save_timeout) > 0) { Lisp_Object tem0; - EMACS_INT timeout = (delay_level - * min (XFASTINT (Vauto_save_timeout) / 4, - MOST_POSITIVE_FIXNUM / delay_level)); + EMACS_INT timeout = XFASTINT (Vauto_save_timeout); + + timeout = min (timeout, MOST_POSITIVE_FIXNUM / delay_level * 4); + timeout = delay_level * timeout / 4; save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); tem0 = sit_for (make_number (timeout), 1, 1); ------------------------------------------------------------ revno: 111789 [merge] committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 09:31:12 -0800 message: Merge from emacs-24; up to r111270 diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-02-15 06:35:54 +0000 +++ doc/lispref/ChangeLog 2013-02-15 17:31:12 +0000 @@ -1,4 +1,4 @@ -2013-02-14 Glenn Morris +2013-02-15 Glenn Morris * modes.texi (Basic Major Modes): 'z' no longer bound in special-mode. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-15 12:26:42 +0000 +++ src/ChangeLog 2013-02-15 17:31:12 +0000 @@ -1,3 +1,27 @@ +2013-02-15 Eli Zaretskii + + * w32proc.c (new_child): Free up to 2 slots of dead processes at a + time. Improve diagnostics in DebPrint. + (reader_thread): If cp->char_avail is NULL, set the FILE_AT_EOF + flag, so that sys_select could have a chance of noticing that this + process is dead, and call a SIGCHLD handler for it. Improve + diagnostics in DebPrint. + (reap_subprocess): Reset the FILE_AT_EOF flag set by + reader_thread. + (sys_select): Watch a process whose procinfo.hProcess is non-NULL + even if its char_avail is NULL. Allows to reap subprocesses that + were forcibly deleted by delete-process. (Bug#13546) + + * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname) + (sys_gethostbyname, sys_getservbyname, sys_getpeername) + (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname) + (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure, + make sure errno is set to an appropriate value. (Bug#13546) + (socket_to_fd): Add assertion against indexing fd_info[] with a + value that is out of bounds. + (sys_accept): If fd is negative, do not set up the child_process + structure for reading. + 2013-02-15 Dmitry Antipov * composite.c (fill_gstring_header): Remove useless prototype. === modified file 'src/w32.c' --- src/w32.c 2013-02-15 06:35:54 +0000 +++ src/w32.c 2013-02-15 17:31:12 +0000 @@ -6232,7 +6232,7 @@ if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return INVALID_SOCKET; } @@ -6242,7 +6242,13 @@ s = pfn_socket (af, type, protocol); if (s != INVALID_SOCKET) - return socket_to_fd (s); + { + int retval = socket_to_fd (s); + + if (retval == -1) + errno = h_errno; + return retval; + } set_errno (); return -1; @@ -6309,6 +6315,7 @@ } } } + eassert (fd < MAXDESC); fd_info[fd].hnd = (HANDLE) s; /* set our own internal flags */ @@ -6347,7 +6354,7 @@ { if (winsock_lib == NULL) { - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6359,7 +6366,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6368,7 +6375,7 @@ { if (winsock_lib == NULL) { - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6380,7 +6387,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6414,7 +6421,7 @@ if (namelen > MAX_COMPUTERNAME_LENGTH) return !GetComputerName (name, (DWORD *)&namelen); - h_errno = EFAULT; + errno = h_errno = EFAULT; return SOCKET_ERROR; } @@ -6425,7 +6432,7 @@ if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return NULL; } @@ -6443,7 +6450,7 @@ if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return NULL; } @@ -6459,7 +6466,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return SOCKET_ERROR; } @@ -6471,7 +6478,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6480,7 +6487,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return SOCKET_ERROR; } @@ -6492,7 +6499,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6501,7 +6508,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return SOCKET_ERROR; } @@ -6514,7 +6521,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6523,7 +6530,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return SOCKET_ERROR; } @@ -6537,7 +6544,7 @@ fd_info[s].flags |= FILE_LISTEN; return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6546,7 +6553,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return SOCKET_ERROR; } @@ -6558,7 +6565,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6567,7 +6574,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return -1; } @@ -6579,13 +6586,20 @@ if (t == INVALID_SOCKET) set_errno (); else - fd = socket_to_fd (t); + { + fd = socket_to_fd (t); + if (fd < 0) + errno = h_errno; /* socket_to_fd sets h_errno */ + } - fd_info[s].cp->status = STATUS_READ_ACKNOWLEDGED; - ResetEvent (fd_info[s].cp->char_avail); + if (fd >= 0) + { + fd_info[s].cp->status = STATUS_READ_ACKNOWLEDGED; + ResetEvent (fd_info[s].cp->char_avail); + } return fd; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return -1; } @@ -6595,7 +6609,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return SOCKET_ERROR; } @@ -6607,7 +6621,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6617,7 +6631,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return SOCKET_ERROR; } @@ -6629,7 +6643,7 @@ set_errno (); return rc; } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } @@ -6640,7 +6654,7 @@ { if (winsock_lib == NULL) { - h_errno = ENETDOWN; + errno = h_errno = ENETDOWN; return -1; } @@ -6663,7 +6677,7 @@ return SOCKET_ERROR; } } - h_errno = ENOTSOCK; + errno = h_errno = ENOTSOCK; return SOCKET_ERROR; } === modified file 'src/w32proc.c' --- src/w32proc.c 2013-02-15 06:35:54 +0000 +++ src/w32proc.c 2013-02-15 17:31:12 +0000 @@ -804,6 +804,9 @@ goto Initialize; if (child_proc_count == MAX_CHILDREN) { + int i = 0; + child_process *dead_cp = NULL; + DebPrint (("new_child: No vacant slots, looking for dead processes\n")); for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess) @@ -819,15 +822,27 @@ if (status != STILL_ACTIVE || WaitForSingleObject (cp->procinfo.hProcess, 0) == WAIT_OBJECT_0) { - DebPrint (("new_child: Freeing slot of dead process %d\n", - cp->procinfo.dwProcessId)); + DebPrint (("new_child: Freeing slot of dead process %d, fd %d\n", + cp->procinfo.dwProcessId, cp->fd)); CloseHandle (cp->procinfo.hProcess); cp->procinfo.hProcess = NULL; CloseHandle (cp->procinfo.hThread); cp->procinfo.hThread = NULL; - goto Initialize; + /* Free up to 2 dead slots at a time, so that if we + have a lot of them, they will eventually all be + freed when the tornado ends. */ + if (i == 0) + dead_cp = cp; + else + break; + i++; } } + if (dead_cp) + { + cp = dead_cp; + goto Initialize; + } } if (child_proc_count == MAX_CHILDREN) return NULL; @@ -1002,12 +1017,24 @@ if (cp->status == STATUS_READ_ERROR || !cp->char_avail) break; + if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess && cp->fd >= 0) + { + /* Somebody already called delete_child on this child, since + only delete_child zeroes out cp->char_avail. This means + no one will read from cp->fd and will not set the + FILE_AT_EOF flag, therefore preventing sys_select from + noticing that the process died. Set the flag here + instead. */ + fd_info[cp->fd].flags |= FILE_AT_EOF; + } + /* The name char_avail is a misnomer - it really just means the read-ahead has completed, whether successfully or not. */ if (!SetEvent (cp->char_avail)) { - DebPrint (("reader_thread.SetEvent failed with %lu for fd %ld\n", - GetLastError (), cp->fd)); + DebPrint (("reader_thread.SetEvent(0x%x) failed with %lu for fd %ld (PID %d)\n", + (DWORD_PTR)cp->char_avail, GetLastError (), + cp->fd, cp->pid)); return 1; } @@ -1210,6 +1237,11 @@ sys_read when the subprocess output is fully read. */ if (cp->fd < 0) delete_child (cp); + else + { + /* Reset the flag set by reader_thread. */ + fd_info[cp->fd].flags &= ~FILE_AT_EOF; + } } /* Wait for a child process specified by PID, or for any of our @@ -2035,7 +2067,7 @@ /* Some child_procs might be sockets; ignore them. Also some children may have died already, but we haven't finished reading the process output; ignore them too. */ - if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess + if ((CHILD_ACTIVE (cp) || cp->procinfo.hProcess) && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_SEND_SIGCHLD) == 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0) ------------------------------------------------------------ revno: 111788 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-02-15 16:26:42 +0400 message: * composite.c (fill_gstring_header): Remove useless prototype. Break long line. * lisp.h (message_dolog, compile_pattern): Adjust prototype. * print.c (PRINTDECLARE, print_object): * search.c (compile_pattern, fast_looking_at, search_buffer): (simple_search, boyer_moore, Freplace_match): * xdisp.c (c_string_pos, number_of_chars, message_dolog): (get_overlay_arrow_glyph_row, display_mode_element): (decode_mode_spec_coding, message3): * xfaces.c (face_at_string_position): Use bool for booleans. Adjust comments. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-15 06:35:54 +0000 +++ src/ChangeLog 2013-02-15 12:26:42 +0000 @@ -1,3 +1,17 @@ +2013-02-15 Dmitry Antipov + + * composite.c (fill_gstring_header): Remove useless prototype. + Break long line. + * lisp.h (message_dolog, compile_pattern): Adjust prototype. + * print.c (PRINTDECLARE, print_object): + * search.c (compile_pattern, fast_looking_at, search_buffer): + (simple_search, boyer_moore, Freplace_match): + * xdisp.c (c_string_pos, number_of_chars, message_dolog): + (get_overlay_arrow_glyph_row, display_mode_element): + (decode_mode_spec_coding, message3): + * xfaces.c (face_at_string_position): Use bool for booleans. + Adjust comments. + 2013-02-15 Paul Eggert Fix AIX port (Bug#13650). === modified file 'src/composite.c' --- src/composite.c 2013-02-13 07:14:38 +0000 +++ src/composite.c 2013-02-15 12:26:42 +0000 @@ -698,10 +698,6 @@ return HASH_VALUE (h, id); } -static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object, - Lisp_Object); - bool composition_gstring_p (Lisp_Object gstring) { @@ -791,7 +787,8 @@ static Lisp_Object gstring_work_headers; static Lisp_Object -fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lisp_Object font_object, Lisp_Object string) +fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, + Lisp_Object font_object, Lisp_Object string) { ptrdiff_t from, to, from_byte; ptrdiff_t len, i; === modified file 'src/lisp.h' --- src/lisp.h 2013-02-15 06:35:54 +0000 +++ src/lisp.h 2013-02-15 12:26:42 +0000 @@ -2953,7 +2953,7 @@ extern void message1_nolog (const char *); extern void message3 (Lisp_Object); extern void message3_nolog (Lisp_Object); -extern void message_dolog (const char *, ptrdiff_t, int, int); +extern void message_dolog (const char *, ptrdiff_t, bool, bool); extern void message_with_string (const char *, Lisp_Object, int); extern void message_log_maybe_newline (void); extern void update_echo_area (void); @@ -3335,7 +3335,7 @@ struct re_registers; extern struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, - Lisp_Object, int, int); + Lisp_Object, int, bool); extern ptrdiff_t fast_string_match (Lisp_Object, Lisp_Object); extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *, ptrdiff_t); === modified file 'src/print.c' --- src/print.c 2013-02-01 07:23:18 +0000 +++ src/print.c 2013-02-15 12:26:42 +0000 @@ -102,7 +102,8 @@ ptrdiff_t old_point_byte = -1, start_point_byte = -1; \ ptrdiff_t specpdl_count = SPECPDL_INDEX (); \ int free_print_buffer = 0; \ - int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); \ + bool multibyte \ + = !NILP (BVAR (current_buffer, enable_multibyte_characters)); \ Lisp_Object original #define PRINTPREPARE \ @@ -1396,7 +1397,7 @@ /* 1 means we must ensure that the next character we output cannot be taken as part of a hex character escape. */ int need_nonhex = 0; - int multibyte = STRING_MULTIBYTE (obj); + bool multibyte = STRING_MULTIBYTE (obj); GCPRO1 (obj); === modified file 'src/search.c' --- src/search.c 2013-02-11 23:37:18 +0000 +++ src/search.c 2013-02-15 12:26:42 +0000 @@ -209,7 +209,8 @@ for this pattern. 0 means backtrack only enough to get a valid match. */ struct re_pattern_buffer * -compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object translate, int posix, int multibyte) +compile_pattern (Lisp_Object pattern, struct re_registers *regp, + Lisp_Object translate, int posix, bool multibyte) { struct regexp_cache *cp, **cpp; @@ -534,9 +535,10 @@ data. */ ptrdiff_t -fast_looking_at (Lisp_Object regexp, ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t limit, ptrdiff_t limit_byte, Lisp_Object string) +fast_looking_at (Lisp_Object regexp, ptrdiff_t pos, ptrdiff_t pos_byte, + ptrdiff_t limit, ptrdiff_t limit_byte, Lisp_Object string) { - int multibyte; + bool multibyte; struct re_pattern_buffer *buf; unsigned char *p1, *p2; ptrdiff_t s1, s2; @@ -1248,7 +1250,7 @@ ptrdiff_t raw_pattern_size; ptrdiff_t raw_pattern_size_byte; unsigned char *patbuf; - int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); unsigned char *base_pat; /* Set to positive if we find a non-ASCII char that need translation. Otherwise set to zero later. */ @@ -1461,8 +1463,8 @@ ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t lim, ptrdiff_t lim_byte) { - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); - int forward = n > 0; + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool forward = n > 0; /* Number of buffer bytes matched. Note that this may be different from len_byte in a multibyte buffer. */ ptrdiff_t match_byte = PTRDIFF_MIN; @@ -1681,7 +1683,7 @@ register ptrdiff_t i; register int j; unsigned char *pat, *pat_end; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); unsigned char simple_translate[0400]; /* These are set to the preceding bytes of a byte to be translated @@ -2507,8 +2509,8 @@ ptrdiff_t length = SBYTES (newtext); unsigned char *substed; ptrdiff_t substed_alloc_size, substed_len; - int buf_multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); - int str_multibyte = STRING_MULTIBYTE (newtext); + bool buf_multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool str_multibyte = STRING_MULTIBYTE (newtext); int really_changed = 0; substed_alloc_size = ((STRING_BYTES_BOUND - 100) / 2 < length === modified file 'src/xdisp.c' --- src/xdisp.c 2013-02-12 16:43:09 +0000 +++ src/xdisp.c 2013-02-15 12:26:42 +0000 @@ -910,8 +910,8 @@ static struct text_pos string_pos_nchars_ahead (struct text_pos, Lisp_Object, ptrdiff_t); static struct text_pos string_pos (ptrdiff_t, Lisp_Object); -static struct text_pos c_string_pos (ptrdiff_t, const char *, int); -static ptrdiff_t number_of_chars (const char *, int); +static struct text_pos c_string_pos (ptrdiff_t, const char *, bool); +static ptrdiff_t number_of_chars (const char *, bool); static void compute_stop_pos (struct it *); static void compute_string_pos (struct text_pos *, struct text_pos, Lisp_Object); @@ -1650,7 +1650,7 @@ means recognize multibyte characters. */ static struct text_pos -c_string_pos (ptrdiff_t charpos, const char *s, int multibyte_p) +c_string_pos (ptrdiff_t charpos, const char *s, bool multibyte_p) { struct text_pos pos; @@ -1681,7 +1681,7 @@ non-zero means recognize multibyte characters. */ static ptrdiff_t -number_of_chars (const char *s, int multibyte_p) +number_of_chars (const char *s, bool multibyte_p) { ptrdiff_t nchars; @@ -9357,8 +9357,8 @@ /* Add a string M of length NBYTES to the message log, optionally - terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if - nonzero, means interpret the contents of M as multibyte. This + terminated with a newline when NLFLAG is true. MULTIBYTE, if + true, means interpret the contents of M as multibyte. This function calls low-level routines in order to bypass text property hooks, etc. which might not be safe to run. @@ -9366,7 +9366,7 @@ so the buffer M must NOT point to a Lisp string. */ void -message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte) +message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) { const unsigned char *msg = (const unsigned char *) m; @@ -9591,7 +9591,7 @@ if (STRINGP (m)) { ptrdiff_t nbytes = SBYTES (m); - int multibyte = STRING_MULTIBYTE (m); + bool multibyte = STRING_MULTIBYTE (m); USE_SAFE_ALLOCA; char *buffer = SAFE_ALLOCA (nbytes); memcpy (buffer, SDATA (m), nbytes); @@ -18064,7 +18064,7 @@ const unsigned char *arrow_end = arrow_string + arrow_len; const unsigned char *p; struct it it; - int multibyte_p; + bool multibyte_p; int n_glyphs_before; set_buffer_temp (buffer); @@ -20495,7 +20495,7 @@ risky); else if (c != 0) { - int multibyte; + bool multibyte; ptrdiff_t bytepos, charpos; const char *spec; Lisp_Object string; @@ -21100,7 +21100,7 @@ decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag) { Lisp_Object val; - int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); const unsigned char *eol_str; int eol_str_len; /* The EOL conversion we are using. */ === modified file 'src/xfaces.c' --- src/xfaces.c 2013-02-08 05:28:52 +0000 +++ src/xfaces.c 2013-02-15 12:26:42 +0000 @@ -6152,7 +6152,7 @@ struct frame *f = XFRAME (WINDOW_FRAME (w)); Lisp_Object attrs[LFACE_VECTOR_SIZE]; struct face *base_face; - int multibyte_p = STRING_MULTIBYTE (string); + bool multibyte_p = STRING_MULTIBYTE (string); Lisp_Object prop_name = mouse_p ? Qmouse_face : Qface; /* Get the value of the face property at the current position within ------------------------------------------------------------ revno: 111787 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-02-15 06:17:38 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-02-12 11:17:35 +0000 +++ autogen/configure 2013-02-15 11:17:38 +0000 @@ -15815,6 +15815,12 @@ ;; + aix*) + $as_echo "#define DATA_START 0x20000000" >>confdefs.h + + $as_echo "#define DATA_SEG_BITS 0x20000000" >>confdefs.h + + ;; hpux*) $as_echo "#define DATA_START 0x40000000" >>confdefs.h ------------------------------------------------------------ revno: 111786 [merge] committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-02-14 22:35:54 -0800 message: Merge from emacs-24; up to r111266 diff: === modified file 'ChangeLog' --- ChangeLog 2013-02-12 03:52:04 +0000 +++ ChangeLog 2013-02-15 06:35:54 +0000 @@ -1,3 +1,8 @@ +2013-02-15 Paul Eggert + + Fix AIX port (Bug#13650). + * configure.ac (DATA_START, DATA_SEG_BITS): Set to 0x20000000 on AIX. + 2013-02-12 Eli Zaretskii * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/memrchr.$(O). === modified file 'configure.ac' --- configure.ac 2013-02-12 00:51:24 +0000 +++ configure.ac 2013-02-15 06:35:54 +0000 @@ -3750,6 +3750,11 @@ AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })]) ;; + aix*) + dnl This works with 32-bit executables; Emacs doesn't support 64-bit. + AC_DEFINE(DATA_START, [0x20000000]) + AC_DEFINE(DATA_SEG_BITS, [0x20000000]) + ;; hpux*) dnl The data segment on this machine always starts at address 0x40000000. AC_DEFINE(DATA_START, [0x40000000]) === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-02-13 04:31:09 +0000 +++ doc/lispref/ChangeLog 2013-02-15 06:35:54 +0000 @@ -1,3 +1,7 @@ +2013-02-14 Glenn Morris + + * modes.texi (Basic Major Modes): 'z' no longer bound in special-mode. + 2013-02-13 Glenn Morris * objects.texi (Char-Table Type): Add footnote about #^^. === modified file 'doc/lispref/modes.texi' --- doc/lispref/modes.texi 2013-02-13 04:31:09 +0000 +++ doc/lispref/modes.texi 2013-02-15 06:35:54 +0000 @@ -905,9 +905,8 @@ of @code{special} (@pxref{Major Mode Conventions}). Special mode sets the buffer to read-only. Its keymap defines several -common bindings, including @kbd{q} for @code{quit-window}, @kbd{z} for -@code{kill-this-buffer}, and @kbd{g} for @code{revert-buffer} -(@pxref{Reverting}). +common bindings, including @kbd{q} for @code{quit-window} and @kbd{g} +for @code{revert-buffer} (@pxref{Reverting}). An example of a major mode derived from Special mode is Buffer Menu mode, which is used by the @file{*Buffer List*} buffer. @xref{List === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-15 01:30:11 +0000 +++ lisp/ChangeLog 2013-02-15 06:35:54 +0000 @@ -1,3 +1,30 @@ +2013-02-15 Michael Albinus + + * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. + +2013-02-15 Stefan Monnier + + * net/goto-addr.el (goto-address-fontify): Add start and end args. + (goto-address-fontify-region): Use them instead of narrowing, so + syntax-ppss has access to the whole buffer. + +2013-02-15 Fabián Ezequiel Gallina + + * progmodes/python.el: Explain how to restore "cc-mode"-like + forward-sexp movement in header documentation (Bug#13642). + (python-nav--forward-sexp): Behave like emacs-lisp-mode in + comments and strings (GH bug 114). + +2013-02-15 Fabián Ezequiel Gallina + + * progmodes/python.el (python-info-current-defun): Fix current + defun detection (Bug#13618). + +2013-02-15 Chong Yidong + + * xml.el (xml-parse-string): Fix typo in handling of bad character + references. + 2013-02-15 Glenn Morris * play/fortune.el (fortune-compile): Simplify and fix previous change. === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2013-02-14 17:16:47 +0000 @@ -132,13 +132,14 @@ :require SYM Same as in `defcustom'. :variable PLACE The location to use instead of the variable MODE to store the state of the mode. This can be simply a different - named variable, or more generally anything that can be used - with the CL macro `setf'. PLACE can also be of the form - \(GET . SET), where GET is an expression that returns the - current state, and SET is a function that takes one argument, - the new state, and sets it. If you specify a :variable, - this function does not define a MODE variable (nor any of - the terms used in :variable). + named variable, or a generalized variable. + PLACE can also be of the form \(GET . SET), where GET is + an expression that returns the current state, and SET is + a function that takes one argument, the new state, and + sets it. If you specify a :variable, this function does + not define a MODE variable (nor any of the terms used + in :variable). + :after-hook A single lisp form which is evaluated after the mode hooks have been run. It should not be quoted. === modified file 'lisp/net/goto-addr.el' --- lisp/net/goto-addr.el 2013-01-01 09:11:05 +0000 +++ lisp/net/goto-addr.el 2013-02-14 15:53:46 +0000 @@ -156,18 +156,19 @@ (defvar goto-address-prog-mode) -(defun goto-address-fontify () +(defun goto-address-fontify (&optional start end) "Fontify the URLs and e-mail addresses in the current buffer. This function implements `goto-address-highlight-p' and `goto-address-fontify-p'." ;; Clean up from any previous go. - (goto-address-unfontify (point-min) (point-max)) + (goto-address-unfontify (or start (point-min)) (or end (point-max))) (save-excursion (let ((inhibit-point-motion-hooks t)) - (goto-char (point-min)) + (goto-char (or start (point-min))) (when (or (eq t goto-address-fontify-maximum-size) - (< (- (point-max) (point)) goto-address-fontify-maximum-size)) - (while (re-search-forward goto-address-url-regexp nil t) + (< (- (or end (point-max)) (point)) + goto-address-fontify-maximum-size)) + (while (re-search-forward goto-address-url-regexp end t) (let* ((s (match-beginning 0)) (e (match-end 0)) this-overlay) @@ -187,8 +188,8 @@ (overlay-put this-overlay 'keymap goto-address-highlight-keymap) (overlay-put this-overlay 'goto-address t)))) - (goto-char (point-min)) - (while (re-search-forward goto-address-mail-regexp nil t) + (goto-char (or start (point-min))) + (while (re-search-forward goto-address-mail-regexp end t) (let* ((s (match-beginning 0)) (e (match-end 0)) this-overlay) @@ -212,11 +213,9 @@ (defun goto-address-fontify-region (start end) "Fontify URLs and e-mail addresses in the given region." (save-excursion - (save-restriction - (let ((beg-line (progn (goto-char start) (line-beginning-position))) - (end-line (progn (goto-char end) (line-end-position)))) - (narrow-to-region beg-line end-line) - (goto-address-fontify))))) + (let ((beg-line (progn (goto-char start) (line-beginning-position))) + (end-line (progn (goto-char end) (line-end-position)))) + (goto-address-fontify beg-line end-line)))) ;; code to find and goto addresses; much of this has been blatantly ;; snarfed from browse-url.el === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-02-02 06:04:06 +0000 +++ lisp/progmodes/python.el 2013-02-15 06:35:54 +0000 @@ -54,8 +54,13 @@ ;; `python-nav-beginning-of-statement', `python-nav-end-of-statement', ;; `python-nav-beginning-of-block' and `python-nav-end-of-block' are ;; included but no bound to any key. At last but not least the -;; specialized `python-nav-forward-sexp' allows easy -;; navigation between code blocks. +;; specialized `python-nav-forward-sexp' allows easy navigation +;; between code blocks. If you prefer `cc-mode'-like `forward-sexp' +;; movement, setting `forward-sexp-function' to nil is enough, You can +;; do that using the `python-mode-hook': + +;; (add-hook 'python-mode-hook +;; (lambda () (setq forward-sexp-function nil))) ;; Shell interaction: is provided and allows you to execute easily any ;; block of code of your current buffer in an inferior Python process. @@ -1349,13 +1354,10 @@ 're-search-backward)) (context-type (python-syntax-context-type))) (cond - ((eq context-type 'string) + ((memq context-type '(string comment)) ;; Inside of a string, get out of it. - (while (and (funcall re-search-fn "[\"']" nil t) - (python-syntax-context 'string)))) - ((eq context-type 'comment) - ;; Inside of a comment, just move forward. - (python-util-forward-comment dir)) + (let ((forward-sexp-function)) + (forward-sexp dir))) ((or (eq context-type 'paren) (and forward-p (looking-at (python-rx open-paren))) (and (not forward-p) @@ -1378,16 +1380,16 @@ (save-excursion (python-nav-lisp-forward-sexp-safe dir) (point))) - (next-sexp-context - (save-excursion - (goto-char next-sexp-pos) - (cond - ((python-info-beginning-of-block-p) 'block-start) - ((python-info-end-of-block-p) 'block-end) - ((python-info-beginning-of-statement-p) 'statement-start) - ((python-info-end-of-statement-p) 'statement-end) - ((python-info-statement-starts-block-p) 'starts-block) - ((python-info-statement-ends-block-p) 'ends-block))))) + (next-sexp-context + (save-excursion + (goto-char next-sexp-pos) + (cond + ((python-info-beginning-of-block-p) 'block-start) + ((python-info-end-of-block-p) 'block-end) + ((python-info-beginning-of-statement-p) 'statement-start) + ((python-info-end-of-statement-p) 'statement-end) + ((python-info-statement-starts-block-p) 'starts-block) + ((python-info-statement-ends-block-p) 'ends-block))))) (if forward-p (cond ((and (not (eobp)) (python-info-current-line-empty-p)) @@ -1411,8 +1413,8 @@ (t (goto-char next-sexp-pos))) (cond ((and (not (bobp)) (python-info-current-line-empty-p)) - (python-util-forward-comment dir) - (python-nav--forward-sexp dir)) + (python-util-forward-comment dir) + (python-nav--forward-sexp dir)) ((eq context 'block-end) (python-nav-beginning-of-block)) ((eq context 'statement-end) @@ -2946,40 +2948,61 @@ This function is compatible to be used as `add-log-current-defun-function' since it returns nil if point is not inside a defun." - (save-restriction - (widen) - (save-excursion - (end-of-line 1) - (let ((names) - (starting-indentation - (save-excursion - (and - (python-nav-beginning-of-defun 1) - ;; This extra number is just for checking code - ;; against indentation to work well on first run. - (+ (current-indentation) 4)))) - (starting-point (point))) - ;; Check point is inside a defun. - (when (and starting-indentation - (< starting-point + (save-restriction + (widen) + (save-excursion + (end-of-line 1) + (let ((names) + (starting-indentation (current-indentation)) + (starting-pos (point)) + (first-run t) + (last-indent) + (type)) + (catch 'exit + (while (python-nav-beginning-of-defun 1) + (when (and + (or (not last-indent) + (< (current-indentation) last-indent)) + (or + (and first-run (save-excursion - (python-nav-end-of-defun) - (point)))) - (catch 'exit - (while (python-nav-beginning-of-defun 1) - (when (< (current-indentation) starting-indentation) - (setq starting-indentation (current-indentation)) - (setq names - (cons - (if (not include-type) - (match-string-no-properties 1) - (mapconcat 'identity - (split-string - (match-string-no-properties 0)) " ")) - names))) - (and (= (current-indentation) 0) (throw 'exit t))))) - (and names - (mapconcat (lambda (string) string) names ".")))))) + ;; If this is the first run, we may add + ;; the current defun at point. + (setq first-run nil) + (goto-char starting-pos) + (python-nav-beginning-of-statement) + (beginning-of-line 1) + (looking-at-p + python-nav-beginning-of-defun-regexp))) + (< starting-pos + (save-excursion + (let ((min-indent + (+ (current-indentation) + python-indent-offset))) + (if (< starting-indentation min-indent) + ;; If the starting indentation is not + ;; within the min defun indent make the + ;; check fail. + starting-pos + ;; Else go to the end of defun and add + ;; up the current indentation to the + ;; ending position. + (python-nav-end-of-defun) + (+ (point) + (if (>= (current-indentation) min-indent) + (1+ (current-indentation)) + 0)))))))) + (setq last-indent (current-indentation)) + (if (or (not include-type) type) + (setq names (cons (match-string-no-properties 1) names)) + (let ((match (split-string (match-string-no-properties 0)))) + (setq type (car match)) + (setq names (cons (cadr match) names))))) + ;; Stop searching ASAP. + (and (= (current-indentation) 0) (throw 'exit t)))) + (and names + (concat (and type (format "%s " type)) + (mapconcat 'identity names "."))))))) (defun python-info-current-symbol (&optional replace-self) "Return current symbol using dotty syntax. === modified file 'lisp/xml.el' --- lisp/xml.el 2013-01-23 06:25:50 +0000 +++ lisp/xml.el 2013-02-13 07:24:11 +0000 @@ -611,7 +611,7 @@ xml-validating-parser (error "XML: (Validity) Invalid character reference `%s'" (match-string 0))) - (replace-match (or (string val) xml-undefined-entity) t t)) + (replace-match (if val (string val) xml-undefined-entity) t t)) ;; For an entity reference, search again from the start of ;; the replaced text, since the replacement can contain ;; entity or character references, or markup. @@ -620,7 +620,7 @@ (and (null val) xml-validating-parser (error "XML: (Validity) Undefined entity `%s'" ref)) - (replace-match (cdr val) t t) + (replace-match (or (cdr val) xml-undefined-entity) t t) (goto-char (match-beginning 0))) ;; Check for XML bombs. (and xml-entity-expansion-limit === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-14 19:01:12 +0000 +++ src/ChangeLog 2013-02-15 06:35:54 +0000 @@ -1,3 +1,23 @@ +2013-02-15 Paul Eggert + + Fix AIX port (Bug#13650). + * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]: + Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set, + was #undeffed earlier, so it cannot be used as a macro here. + Use the constant and not the macro. + +2013-02-15 Eli Zaretskii + + * w32proc.c (new_child): If no vacant slots are found in + child_procs[], make another pass looking for slots whose process + has exited or died. (Bug#13546) + + * w32.c (sys_pipe): When failing due to file descriptors above + MAXDESC, set errno to EMFILE. + (_sys_read_ahead): Update cp->status when failing to read serial + communications input, so that the status doesn't stay at + STATUS_READ_IN_PROGRESS. (Bug#13546) + 2013-02-14 Jan Djärv * gtkutil.c (tb_size_cb): New function. === modified file 'src/lisp.h' --- src/lisp.h 2013-02-11 23:37:18 +0000 +++ src/lisp.h 2013-02-15 06:35:54 +0000 @@ -505,13 +505,9 @@ (XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ + ((intptr_t) (ptr) & VALMASK))) -#if DATA_SEG_BITS /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which were stored in a Lisp_Object. */ #define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS)) -#else -#define XPNTR(a) ((uintptr_t) (XLI (a) & VALMASK)) -#endif #endif /* not USE_LSB_TAG */ === modified file 'src/w32.c' --- src/w32.c 2013-02-02 17:14:24 +0000 +++ src/w32.c 2013-02-15 06:35:54 +0000 @@ -6800,6 +6800,7 @@ { _close (phandles[0]); _close (phandles[1]); + errno = EMFILE; rc = -1; } else @@ -6873,19 +6874,31 @@ /* Configure timeouts for blocking read. */ if (!GetCommTimeouts (hnd, &ct)) - return STATUS_READ_ERROR; + { + cp->status = STATUS_READ_ERROR; + return STATUS_READ_ERROR; + } ct.ReadIntervalTimeout = 0; ct.ReadTotalTimeoutMultiplier = 0; ct.ReadTotalTimeoutConstant = 0; if (!SetCommTimeouts (hnd, &ct)) - return STATUS_READ_ERROR; + { + cp->status = STATUS_READ_ERROR; + return STATUS_READ_ERROR; + } if (!ReadFile (hnd, &cp->chr, sizeof (char), (DWORD*) &rc, ovl)) { if (GetLastError () != ERROR_IO_PENDING) - return STATUS_READ_ERROR; + { + cp->status = STATUS_READ_ERROR; + return STATUS_READ_ERROR; + } if (!GetOverlappedResult (hnd, ovl, (DWORD*) &rc, TRUE)) - return STATUS_READ_ERROR; + { + cp->status = STATUS_READ_ERROR; + return STATUS_READ_ERROR; + } } } else if (fd_info[fd].flags & FILE_SOCKET) === modified file 'src/w32proc.c' --- src/w32proc.c 2013-02-02 17:14:24 +0000 +++ src/w32proc.c 2013-02-15 06:35:54 +0000 @@ -803,6 +803,33 @@ if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL) goto Initialize; if (child_proc_count == MAX_CHILDREN) + { + DebPrint (("new_child: No vacant slots, looking for dead processes\n")); + for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) + if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess) + { + DWORD status = 0; + + if (!GetExitCodeProcess (cp->procinfo.hProcess, &status)) + { + DebPrint (("new_child.GetExitCodeProcess: error %lu for PID %lu\n", + GetLastError (), cp->procinfo.dwProcessId)); + status = STILL_ACTIVE; + } + if (status != STILL_ACTIVE + || WaitForSingleObject (cp->procinfo.hProcess, 0) == WAIT_OBJECT_0) + { + DebPrint (("new_child: Freeing slot of dead process %d\n", + cp->procinfo.dwProcessId)); + CloseHandle (cp->procinfo.hProcess); + cp->procinfo.hProcess = NULL; + CloseHandle (cp->procinfo.hThread); + cp->procinfo.hThread = NULL; + goto Initialize; + } + } + } + if (child_proc_count == MAX_CHILDREN) return NULL; cp = &child_procs[child_proc_count++]; ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.