Now on revision 110940. ------------------------------------------------------------ revno: 110940 fixes bug: http://debbugs.gnu.org/12846 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-11-18 13:38:13 +0800 message: Avoid using "X" interactive flag in filecache.el. * filecache.el (file-cache--read-list): New function. (file-cache-add-directory-list, file-cache-add-file-list) (file-cache-delete-file-list, file-cache-delete-directory-list): Use it to read a list of files or directories. (file-cache-add-file, file-cache-add-directory) (file-cache-delete-file-list, file-cache-delete-file-regexp) (file-cache-delete-directory): Print an message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-18 03:59:00 +0000 +++ lisp/ChangeLog 2012-11-18 05:38:13 +0000 @@ -1,3 +1,13 @@ +2012-11-18 Chong Yidong + + * filecache.el (file-cache--read-list): New function. + (file-cache-add-directory-list, file-cache-add-file-list) + (file-cache-delete-file-list, file-cache-delete-directory-list): + Use it to read a list of files or directories (Bug#12846). + (file-cache-add-file, file-cache-add-directory) + (file-cache-delete-file-list, file-cache-delete-file-regexp) + (file-cache-delete-directory): Print an message. + 2012-11-18 Jay Belanger * calc/calc-forms.el (math-date-to-dt): Use integer date when === modified file 'lisp/filecache.el' --- lisp/filecache.el 2012-11-18 01:52:36 +0000 +++ lisp/filecache.el 2012-11-18 05:38:13 +0000 @@ -267,44 +267,63 @@ ;; Functions to add files to the cache ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun file-cache--read-list (file op-prompt) + (let* ((fun (if file 'read-file-name 'read-directory-name)) + (type (if file "file" "directory")) + (prompt-1 (concat op-prompt " " type ": ")) + (prompt-2 (concat op-prompt " another " type "?")) + (continue t) + result) + (while continue + (push (funcall fun prompt-1 nil nil t) result) + (setq continue (y-or-n-p prompt-2))) + (nreverse result))) + ;;;###autoload (defun file-cache-add-directory (directory &optional regexp) - "Add DIRECTORY to the file cache. -If the optional REGEXP argument is non-nil, only files which match it will -be added to the cache." - (interactive "DAdd files from directory: ") + "Add all files in DIRECTORY to the file cache. +If called from Lisp with a non-nil REGEXP argument is non-nil, +only add files whose names match REGEXP." + (interactive (list (read-directory-name "Add files from directory: " + nil nil t) + nil)) ;; Not an error, because otherwise we can't use load-paths that ;; contain non-existent directories. - (if (not (file-accessible-directory-p directory)) - (message "Directory %s does not exist" directory) + (when (file-accessible-directory-p directory) (let* ((dir (expand-file-name directory)) (dir-files (directory-files dir t regexp))) ;; Filter out files we don't want to see (dolist (file dir-files) - (if (file-directory-p file) - (setq dir-files (delq file dir-files)) - (dolist (regexp file-cache-filter-regexps) - (if (string-match regexp file) - (setq dir-files (delq file dir-files)))))) + (if (file-directory-p file) + (setq dir-files (delq file dir-files)) + (dolist (regexp file-cache-filter-regexps) + (if (string-match regexp file) + (setq dir-files (delq file dir-files)))))) (file-cache-add-file-list dir-files)))) ;;;###autoload -(defun file-cache-add-directory-list (directory-list &optional regexp) - "Add DIRECTORY-LIST (a list of directory names) to the file cache. +(defun file-cache-add-directory-list (directories &optional regexp) + "Add DIRECTORIES (a list of directory names) to the file cache. +If called interactively, read the directory names one by one. If the optional REGEXP argument is non-nil, only files which match it will be added to the cache. Note that the REGEXP is applied to the files in each directory, not to the directory list itself." - (interactive "XAdd files from directory list: ") - (mapcar - (lambda (dir) (file-cache-add-directory dir regexp)) - directory-list)) + (interactive (list (file-cache--read-list nil "Add"))) + (dolist (dir directories) + (file-cache-add-directory dir regexp)) + (let ((n (length directories))) + (message "Filecache: cached file names from %d director%s." + n (if (= n 1) "y" "ies")))) -(defun file-cache-add-file-list (file-list) - "Add FILE-LIST (a list of file names) to the file cache. -Interactively, FILE-LIST is read as a Lisp expression, which -should evaluate to the desired list of file names." - (interactive "XFile List: ") - (mapcar 'file-cache-add-file file-list)) +(defun file-cache-add-file-list (files) + "Add FILES (a list of file names) to the file cache. +If called interactively, read the file names one by one." + (interactive (list (file-cache--read-list t "Add"))) + (dolist (f files) + (file-cache-add-file f)) + (let ((n (length files))) + (message "Filecache: cached %d file name%s." + n (if (= n 1) "" "s")))) ;; Workhorse function @@ -319,15 +338,18 @@ (dir-name (file-name-directory file)) (the-entry (assoc-string file-name file-cache-alist file-cache-ignore-case))) - ;; Does the entry exist already? - (if the-entry - (unless (or (and (stringp (cdr the-entry)) - (string= dir-name (cdr the-entry))) - (and (listp (cdr the-entry)) - (member dir-name (cdr the-entry)))) - (setcdr the-entry (cons dir-name (cdr the-entry)))) - ;; If not, add it to the cache - (push (list file-name dir-name) file-cache-alist)))) + (cond ((null the-entry) + ;; If the entry wasn't in the cache, add it. + (push (list file-name dir-name) file-cache-alist) + (if (called-interactively-p 'interactive) + (message "Filecache: cached file name %s." file))) + ((not (member dir-name (cdr the-entry))) + (setcdr the-entry (cons dir-name (cdr the-entry))) + (if (called-interactively-p 'interactive) + (message "Filecache: cached file name %s." file))) + (t + (if (called-interactively-p 'interactive) + (message "Filecache: %s is already cached." file)))))) ;;;###autoload (defun file-cache-add-directory-using-find (directory) @@ -413,17 +435,26 @@ ;; This clears *all* files with the given name (defun file-cache-delete-file (file) - "Delete FILE from the file cache." + "Delete FILE (a relative file name) from the file cache. +Return nil if FILE was not in the file cache, non-nil otherwise." (interactive (list (completing-read "Delete file from cache: " file-cache-alist))) - (setq file-cache-alist - (delq (assoc-string file file-cache-alist file-cache-ignore-case) - file-cache-alist))) + (let ((elt (assoc-string file file-cache-alist file-cache-ignore-case))) + (setq file-cache-alist (delq elt file-cache-alist)) + elt)) -(defun file-cache-delete-file-list (file-list) - "Delete FILE-LIST (a list of files) from the file cache." - (interactive "XFile List: ") - (mapcar 'file-cache-delete-file file-list)) +(defun file-cache-delete-file-list (files &optional message) + "Delete FILES (a list of files) from the file cache. +If called interactively, read the file names one by one. +If MESSAGE is non-nil, or if called interactively, print a +message reporting the number of file names deleted." + (interactive (list (file-cache--read-list t "Uncache") t)) + (let ((n 0)) + (dolist (f files) + (if (file-cache-delete-file f) + (setq n (1+ n)))) + (message "Filecache: uncached %d file name%s." + n (if (= n 1) "" "s")))) (defun file-cache-delete-file-regexp (regexp) "Delete files matching REGEXP from the file cache." @@ -432,21 +463,18 @@ (dolist (elt file-cache-alist) (and (string-match regexp (car elt)) (push (car elt) delete-list))) - (file-cache-delete-file-list delete-list) - (message "Filecache: deleted %d files from file cache" - (length delete-list)))) + (file-cache-delete-file-list delete-list))) (defun file-cache-delete-directory (directory) "Delete DIRECTORY from the file cache." (interactive "DDelete directory from file cache: ") (let ((dir (expand-file-name directory)) - (result 0)) + (n 0)) (dolist (entry file-cache-alist) (if (file-cache-do-delete-directory dir entry) - (setq result (1+ result)))) - (if (zerop result) - (error "Filecache: no entries containing %s found in cache" directory) - (message "Filecache: deleted %d entries" result)))) + (setq n (1+ n)))) + (message "Filecache: uncached %d file name%s." + n (if (= n 1) "" "s")))) (defun file-cache-do-delete-directory (dir entry) (let ((directory-list (cdr entry)) @@ -457,10 +485,12 @@ (delq entry file-cache-alist)) (setcdr entry (delete directory directory-list)))))) -(defun file-cache-delete-directory-list (directory-list) - "Delete DIRECTORY-LIST (a list of directories) from the file cache." - (interactive "XDirectory List: ") - (mapcar 'file-cache-delete-directory directory-list)) +(defun file-cache-delete-directory-list (directories) + "Delete DIRECTORIES (a list of directory names) from the file cache. +If called interactively, read the directory names one by one." + (interactive (list (file-cache--read-list nil "Uncache"))) + (dolist (d directories) + (file-cache-delete-directory d))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Utility functions ------------------------------------------------------------ revno: 110939 committer: Jay Belanger branch nick: trunk timestamp: Sat 2012-11-17 21:59:00 -0600 message: * calc/calc-forms.el (math-date-to-dt): Use integer date when calling `math-date-to-julian-dt' and 'math-date-to-gregorian-dt'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-18 02:19:43 +0000 +++ lisp/ChangeLog 2012-11-18 03:59:00 +0000 @@ -1,3 +1,8 @@ +2012-11-18 Jay Belanger + + * calc/calc-forms.el (math-date-to-dt): Use integer date when + calling `math-date-to-julian-dt' and 'math-date-to-gregorian-dt'. + 2012-11-18 Glenn Morris * image.el (insert-image, insert-sliced-image): Doc fix. === modified file 'lisp/calc/calc-forms.el' --- lisp/calc/calc-forms.el 2012-11-17 22:01:59 +0000 +++ lisp/calc/calc-forms.el 2012-11-18 03:59:00 +0000 @@ -443,8 +443,8 @@ (nth 3 calc-gregorian-switch) (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)) )) - (math-date-to-julian-dt value) - (math-date-to-gregorian-dt value)))) + (math-date-to-julian-dt date) + (math-date-to-gregorian-dt date)))) (if (math-integerp value) dt (append dt ------------------------------------------------------------ revno: 110938 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-11-17 18:29:09 -0800 message: * nsterm.m (ns_select): Send SIGIO only to self, not to process group. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-18 01:52:36 +0000 +++ src/ChangeLog 2012-11-18 02:29:09 +0000 @@ -1,3 +1,7 @@ +2012-11-18 Paul Eggert + + * nsterm.m (ns_select): Send SIGIO only to self, not to process group. + 2012-11-18 Eli Zaretskii * w32select.c: Include w32common.h before w32term.h, so that === modified file 'src/nsterm.m' --- src/nsterm.m 2012-11-18 01:52:36 +0000 +++ src/nsterm.m 2012-11-18 02:29:09 +0000 @@ -3462,10 +3462,10 @@ /* NSTRACE (ns_select); */ - if (hold_event_q.nr > 0) + if (hold_event_q.nr > 0) { /* We already have events pending. */ - kill (0, SIGIO); + raise (SIGIO); errno = EINTR; return -1; } ------------------------------------------------------------ revno: 110937 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-11-17 18:19:43 -0800 message: ChangeLog Merge fix diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-18 01:52:36 +0000 +++ lisp/ChangeLog 2012-11-18 02:19:43 +0000 @@ -18,7 +18,6 @@ 2012-11-18 Glenn Morris - * woman.el (woman-non-underline-faces): * emacs-lisp/cl-lib.el (face-underline-p): Use set-face-underline rather than the alias set-face-underline-p. ------------------------------------------------------------ revno: 110936 [merge] committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-11-17 17:52:36 -0800 message: Merge from emacs-24; up to r110908 diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-11-16 18:54:42 +0000 +++ doc/emacs/ChangeLog 2012-11-18 01:52:36 +0000 @@ -1,3 +1,7 @@ +2012-11-18 Dani Moncayo + + * mark.texi (Disabled Transient Mark): Doc fixes (Bug#12746). + 2012-11-16 Eli Zaretskii * trouble.texi (Crashing): Add information about MS-Windows and === modified file 'doc/emacs/mark.texi' --- doc/emacs/mark.texi 2012-05-27 01:25:06 +0000 +++ doc/emacs/mark.texi 2012-11-17 06:38:05 +0000 @@ -430,10 +430,6 @@ point and the mark (@pxref{Setting Mark}). @item -Many commands that move point long distances, like @kbd{M-<} and -@kbd{C-s}, first set the mark where point was. - -@item Some commands, which ordinarily act on the region when the mark is active, no longer do so. For example, normally @kbd{M-%} (@code{query-replace}) performs replacements within the region, if the @@ -455,9 +451,10 @@ @item C-u C-x C-x @kindex C-u C-x C-x -Activate the mark and enable Transient Mark mode temporarily, until -the mark is next deactivated. (This is the @kbd{C-x C-x} command, -@code{exchange-point-and-mark}, with a prefix argument.) +Exchange point and mark, activate the mark and enable Transient Mark +mode temporarily, until the mark is next deactivated. (This is the +@kbd{C-x C-x} command, @code{exchange-point-and-mark}, with a prefix +argument.) @end table These commands set or activate the mark, and enable Transient Mark === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-11-16 17:20:23 +0000 +++ doc/lispref/ChangeLog 2012-11-18 01:52:36 +0000 @@ -1,3 +1,24 @@ +2012-11-18 Glenn Morris + + * loading.texi (How Programs Do Loading): Add eager macro expansion. + * macros.texi (Expansion): Mention eager macro expansion. + + * minibuf.texi (Basic Completion): Mention misc completion-table funcs. + +2012-11-18 Leo Liu + + * minibuf.texi (Programmed Completion): Doc fix for metadata + request (Bug#12850). + +2012-11-18 Glenn Morris + + * display.texi (Temporary Displays): Document with-temp-buffer-window. + + * frames.texi (Size and Position): Add fit-frame-to-buffer command. + * windows.texi (Resizing Windows): Add fit-frame-to-buffer option. + (Window Sizes): Add vindex for window-min-height, window-min-width. + (Display Action Functions): Mention pop-up-frame-parameters. + 2012-11-16 Martin Rudalics * windows.texi (Choosing Window): Rewrite description of === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2012-11-15 07:30:46 +0000 +++ doc/lispref/display.texi 2012-11-17 02:29:58 +0000 @@ -1078,7 +1078,8 @@ This function executes @var{forms} while arranging to insert any output they print into the buffer named @var{buffer-name}, which is first created if necessary, and put into Help mode. Finally, the buffer is -displayed in some window, but not selected. +displayed in some window, but not selected. (See the similar +form @code{with-temp-buffer-window} below.) If the @var{forms} do not change the major mode in the output buffer, so that it is still Help mode at the end of their execution, then @@ -1152,6 +1153,37 @@ is current, and the window it was displayed in is selected. @end defvar +@defmac with-temp-buffer-window buffer-or-name action quit-function forms@dots{} +This macro is similar to @code{with-output-to-temp-buffer}. +Like that construct, it executes @var{forms} while arranging to insert +any output they print into the buffer named @var{buffer-or-name}. +Finally, the buffer is displayed in some window, but not selected. +Unlike @code{with-output-to-temp-buffer}, this does not switch to Help +mode. + +The argument @var{buffer-or-name} specifies the temporary buffer. +It can be either a buffer, which must already exist, or a string, +in which case a buffer of that name is created if necessary. +The buffer is marked as unmodified and read-only when +@code{with-temp-buffer-window} exits. + +This macro does not call @code{temp-buffer-show-function}. Rather, it +passes the @var{action} argument to @code{display-buffer} in order to +display the buffer. + +The value of the last form in @var{forms} is returned, unless the +argument @var{quit-function} is specified. In that case, +it is called with two arguments: the window showing the buffer +and the result of @var{forms}. The final return value is then +whatever @var{quit-function} returns. + +@vindex temp-buffer-window-setup-hook +@vindex temp-buffer-window-show-hook +This macro uses the normal hooks @code{temp-buffer-window-setup-hook} +and @code{temp-buffer-window-show-hook} in place of the analogous hooks +run by @code{with-output-to-temp-buffer}. +@end defmac + @defun momentary-string-display string position &optional char message This function momentarily displays @var{string} in the current buffer at @var{position}. It has no effect on the undo list or on the buffer's === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2012-11-05 14:30:58 +0000 +++ doc/lispref/frames.texi 2012-11-17 01:33:26 +0000 @@ -1113,6 +1113,21 @@ @code{set-frame-height}. @end defun +@c FIXME? Belongs more in Emacs manual than here? +@c But eg fit-window-to-buffer is in this manual. +@deffn Command fit-frame-to-buffer &optional frame max-height min-height +This command adjusts the height of @var{frame} (the default is the +selected frame) to fit its contents. The optional arguments +@var{max-height} and @var{min-height} specify the maximum and minimum +new frame heights, respectively. + +@vindex fit-frame-to-buffer-bottom-margin +The default minimum height corresponds to @code{window-min-height}. +The default maximum height is the screen height below the current top +position of the frame, minus any margin specified by the option +@code{fit-frame-to-buffer-bottom-margin}. +@end deffn + @node Geometry @subsection Geometry === modified file 'doc/lispref/loading.texi' --- doc/lispref/loading.texi 2012-10-31 20:59:04 +0000 +++ doc/lispref/loading.texi 2012-11-18 01:38:42 +0000 @@ -113,6 +113,25 @@ character set translation just as Emacs would do when visiting the file. @xref{Coding Systems}. +@c This is referred to from the Macros chapter. +@c Not sure if it should be the other way round. +@cindex eager macro expansion +When loading an uncompiled file, Emacs tries to expand any macros +that the file contains (@pxref{Macros}). We refer to this as +@dfn{eager macro expansion}. Doing this (rather than deferring +the expansion until the relevant code runs) can significantly speed +up the execution of uncompiled code. Sometimes, this macro expansion +cannot be done, owing to a cyclic dependency. In the simplest +example of this, the file you are loading refers to a macro defined +in another file, and that file in turn requires the file you are +loading. This is generally harmless. Emacs prints a warning +(@samp{Eager macro-expansion skipped due to cycle@dots{}}) +giving details of the problem, but it still loads the file, just +leaving the macro unexpanded for now. You may wish to restructure +your code so that this does not happen. Loading a compiled file does +not cause macroexpansion, because this should already have happened +during compilation. @xref{Compiling Macros}. + Messages like @samp{Loading foo...} and @samp{Loading foo...done} appear in the echo area during loading unless @var{nomessage} is non-@code{nil}. === modified file 'doc/lispref/macros.texi' --- doc/lispref/macros.texi 2012-10-15 04:03:04 +0000 +++ doc/lispref/macros.texi 2012-11-18 01:38:42 +0000 @@ -86,6 +86,10 @@ calls to other macros. It may even be a call to the same macro, though this is unusual. + Note that Emacs tries to expand macros when loading an uncompiled +Lisp file. This is not always possible, but if it is, it speeds up +subsequent execution. @xref{How Programs Do Loading}. + You can see the expansion of a given macro call by calling @code{macroexpand}. === modified file 'doc/lispref/minibuf.texi' --- doc/lispref/minibuf.texi 2012-10-27 05:03:52 +0000 +++ doc/lispref/minibuf.texi 2012-11-17 23:29:29 +0000 @@ -886,6 +886,26 @@ @end smallexample @end defmac +@c FIXME? completion-table-with-context? +@findex completion-table-case-fold +@findex completion-table-in-turn +@findex completion-table-subvert +@findex completion-table-with-quoting +@findex completion-table-with-predicate +@findex completion-table-with-terminator +@cindex completion table, modifying +@cindex completion tables, combining +There are several functions that take an existing completion table and +return a modified version. @code{completion-table-case-fold} returns +a case-insensitive table. @code{completion-table-in-turn} combines +multiple input tables. @code{completion-table-subvert} alters a table +to use a different initial prefix. @code{completion-table-with-quoting} +returns a table suitable for operating on quoted text. +@code{completion-table-with-predicate} filters a table with a +predicate function. @code{completion-table-with-terminator} adds a +terminating string. + + @node Minibuffer Completion @subsection Completion and the Minibuffer @cindex minibuffer completion @@ -1710,8 +1730,9 @@ @item metadata This specifies a request for information about the state of the -current completion. The function should return an alist, as described -below. The alist may contain any number of elements. +current completion. The return value should have the form +@code{(metadata . @var{alist})}, where @var{alist} is an alist whose +elements are described below. @end table @noindent === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2012-11-16 17:20:23 +0000 +++ doc/lispref/windows.texi 2012-11-18 01:52:36 +0000 @@ -490,6 +490,8 @@ aliases are considered obsolete and will be removed in the future. @cindex fixed-size window +@vindex window-min-height +@vindex window-min-width Commands that change the size of windows (@pxref{Resizing Windows}), or split them (@pxref{Splitting Windows}), obey the variables @code{window-min-height} and @code{window-min-width}, which specify @@ -633,6 +635,10 @@ If the optional argument @var{override} is non-@code{nil}, this function ignores any size restrictions imposed by @code{window-min-height} and @code{window-min-width}. + +@vindex fit-frame-to-buffer +If the option @code{fit-frame-to-buffer} is non-@code{nil}, this +command may resize the frame to fit its contents. @end deffn @deffn Command shrink-window-if-larger-than-buffer &optional window @@ -1926,7 +1932,9 @@ This function creates a new frame, and displays the buffer in that frame's window. It actually performs the frame creation by calling the function specified in @code{pop-up-frame-function} -(@pxref{Choosing Window Options}). +(@pxref{Choosing Window Options}). If @var{alist} contains a +@code{pop-up-frame-parameters} entry, the associated value +is added to the newly created frame's parameters. @end defun @defun display-buffer-pop-up-window buffer alist === modified file 'etc/NEWS' --- etc/NEWS 2012-11-17 19:01:09 +0000 +++ etc/NEWS 2012-11-18 01:52:36 +0000 @@ -858,15 +858,10 @@ *** New function `completion-table-with-quoting' to handle completion in the presence of quoting, such as file completion in shell buffers. ++++ *** New function `completion-table-subvert' to use an existing completion table, but with a different prefix. -FIXME? -*** There are several other completion-table- functions that never got -added to NEWS or documented: completion-table-case-fold (24.1), -completion-table-with-context (23,1), completion-table-with-terminator (23.1), -completion-table-with-predicate (23.1), completion-table-in-turn (23.1) - ** Debugger changes +++ @@ -892,14 +887,19 @@ +++ *** Additional values recognized for option `window-combination-limit'. -*** New macro `with-temp-buffer-window'. ++++ +*** New macro `with-temp-buffer-window', similar to +`with-output-to-temp-buffer'. +--- *** `temp-buffer-resize-mode' no longer resizes windows that have been reused. ++++ *** New command `fit-frame-to-buffer' adjusts the frame height to fit the contents. ++++ *** The command `fit-window-to-buffer' can adjust the frame height if the new option `fit-frame-to-buffer' is non-nil. @@ -909,11 +909,11 @@ +++ *** New display action functions `display-buffer-below-selected', and `display-buffer-in-previous-window'. - ++++ *** New display action alist entry `inhibit-switch-frame', if non-nil, tells display action functions to avoid changing which frame is selected. - ++++ *** New display action alist entry `pop-up-frame-parameters', if non-nil, specifies frame parameters to give any newly-created frame. +++ @@ -969,13 +969,14 @@ on others. The affected functions are acos, asin, tan, exp, expt, log, log10, sqrt, and mod. -** Interpreted files are eagerly macro-expanded during load. ++++ +** Emacs tries to macroexpand interpreted (non-compiled) files during load. This can significantly speed up execution of non-byte-compiled code, -but can also bump into harmless and previously unnoticed cyclic -dependencies. These should not be fatal: they will simply cause the -macro-calls to be left for later expansion (as before), but will also -result in a warning ("Eager macro-expansion skipped due to cycle") -describing the cycle. +but can also bump into previously unnoticed cyclic dependencies. +These are generally harmless: they will simply cause the macro calls +to be left for later expansion (as before), but will result in a +warning ("Eager macro-expansion skipped due to cycle") describing the cycle. +You may wish to restructure your code so this does not happen. ** Miscellaneous new functions: +++ === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-18 01:20:04 +0000 +++ lisp/ChangeLog 2012-11-18 01:52:36 +0000 @@ -1,3 +1,31 @@ +2012-11-18 Glenn Morris + + * image.el (insert-image, insert-sliced-image): Doc fix. + +2012-11-18 Chong Yidong + + * emacs-lisp/syntax.el (syntax-propertize-function): Doc fix + (Bug#12810). + +2012-11-18 OKAZAKI Tetsurou (tiny change) + + * vc/vc-svn.el (vc-svn-merge-news): Properly parse the merge + response when the target file is in a subdirectory (Bug#12757). + +2012-11-18 Chong Yidong + + * filecache.el (file-cache-add-file-list): Doc fix (Bug#12694). + +2012-11-18 Glenn Morris + + * woman.el (woman-non-underline-faces): + * emacs-lisp/cl-lib.el (face-underline-p): + Use set-face-underline rather than the alias set-face-underline-p. + + * window.el (with-temp-buffer-window): Doc fix. + * subr.el (with-output-to-temp-buffer): + Add doc xref to with-temp-buffer-window. + 2012-11-18 Juanma Barranquero * woman.el (woman-non-underline-faces): Use `set-face-underline'. === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2012-11-16 17:20:23 +0000 +++ lisp/emacs-lisp/cl-lib.el 2012-11-18 01:52:36 +0000 @@ -661,7 +661,7 @@ (gv-define-setter face-foreground (x f &optional s) `(set-face-foreground ,f ,x ,s)) (gv-define-setter face-underline-p (x f &optional s) - `(set-face-underline-p ,f ,x ,s)) + `(set-face-underline ,f ,x ,s)) (gv-define-simple-setter file-modes set-file-modes t) (gv-define-simple-setter frame-height set-screen-height t) (gv-define-simple-setter frame-parameters modify-frame-parameters t) === modified file 'lisp/emacs-lisp/syntax.el' --- lisp/emacs-lisp/syntax.el 2012-06-23 15:38:23 +0000 +++ lisp/emacs-lisp/syntax.el 2012-11-17 07:33:01 +0000 @@ -55,12 +55,18 @@ ;; have to flush that cache between each function, and we couldn't use ;; syntax-ppss-flush-cache since that would not only flush the cache but also ;; reset syntax-propertize--done which should not be done in this case). - "Mode-specific function to apply the syntax-table properties. -Called with two arguments: START and END. -This function can call `syntax-ppss' on any position before END, but it -should not call `syntax-ppss-flush-cache', which means that it should not -call `syntax-ppss' on some position and later modify the buffer on some -earlier position.") + "Mode-specific function to apply `syntax-table' text properties. +The value of this variable is a function to be called by Font +Lock mode, prior to performing syntactic fontification on a +stretch of text. It is given two arguments, START and END: the +start and end of the text to be fontified. Major modes can +specify a custom function to apply `syntax-table' properties to +override the default syntax table in special cases. + +The specified function may call `syntax-ppss' on any position +before END, but it should not call `syntax-ppss-flush-cache', +which means that it should not call `syntax-ppss' on some +position and later modify the buffer on some earlier position.") (defvar syntax-propertize-chunk-size 500) @@ -118,7 +124,7 @@ The return value is an object that can be passed as a rule to `syntax-propertize-rules'. I.e. this is useful only when you want to share rules among several -syntax-propertize-functions." +`syntax-propertize-function's." (declare (debug syntax-propertize-rules)) ;; Precompile? Yeah, right! ;; Seriously, tho, this is a macro for 2 reasons: === modified file 'lisp/filecache.el' --- lisp/filecache.el 2012-11-17 06:16:46 +0000 +++ lisp/filecache.el 2012-11-18 01:52:36 +0000 @@ -300,7 +300,9 @@ directory-list)) (defun file-cache-add-file-list (file-list) - "Add FILE-LIST (a list of files names) to the file cache." + "Add FILE-LIST (a list of file names) to the file cache. +Interactively, FILE-LIST is read as a Lisp expression, which +should evaluate to the desired list of file names." (interactive "XFile List: ") (mapcar 'file-cache-add-file file-list)) === modified file 'lisp/image.el' --- lisp/image.el 2012-11-02 22:41:35 +0000 +++ lisp/image.el 2012-11-18 01:52:36 +0000 @@ -429,7 +429,7 @@ "Insert IMAGE into current buffer at point. IMAGE is displayed by inserting STRING into the current buffer with a `display' property whose value is the image. STRING -defaults to the empty string if you omit it. +defaults to a single space if you omit it. AREA is where to display the image. AREA nil or omitted means display it in the text area, a value of `left-margin' means display it in the left marginal area, a value of `right-margin' @@ -467,8 +467,8 @@ (defun insert-sliced-image (image &optional string area rows cols) "Insert IMAGE into current buffer at point. IMAGE is displayed by inserting STRING into the current buffer -with a `display' property whose value is the image. STRING is -defaulted if you omit it. +with a `display' property whose value is the image. The default +STRING is a single space. AREA is where to display the image. AREA nil or omitted means display it in the text area, a value of `left-margin' means display it in the left marginal area, a value of `right-margin' === modified file 'lisp/subr.el' --- lisp/subr.el 2012-11-16 17:20:23 +0000 +++ lisp/subr.el 2012-11-18 01:52:36 +0000 @@ -3189,6 +3189,7 @@ ;; Return nil. nil) +;; Doc is very similar to with-temp-buffer-window. (defmacro with-output-to-temp-buffer (bufname &rest body) "Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer. @@ -3214,7 +3215,9 @@ `temp-buffer-show-hook' after displaying buffer BUFNAME, with that buffer temporarily current, and the window that was used to display it temporarily selected. But it doesn't run `temp-buffer-show-hook' -if it uses `temp-buffer-show-function'." +if it uses `temp-buffer-show-function'. + +See the related form `with-temp-buffer-window'." (declare (debug t)) (let ((old-dir (make-symbol "old-dir")) (buf (make-symbol "buf"))) === modified file 'lisp/url/url-parse.el' --- lisp/url/url-parse.el 2012-09-25 04:13:02 +0000 +++ lisp/url/url-parse.el 2012-11-17 06:48:51 +0000 @@ -48,7 +48,7 @@ (defun url-path-and-query (urlobj) "Return the path and query components of URLOBJ. -These two components are store together in the FILENAME slot of +These two components are stored together in the FILENAME slot of the object. The return value of this function is (PATH . QUERY), where each of PATH and QUERY are strings or nil." (let ((name (url-filename urlobj)) === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2012-11-04 04:13:13 +0000 +++ lisp/vc/vc-svn.el 2012-11-18 01:52:36 +0000 @@ -414,7 +414,7 @@ ;; We also used to match the filename in column 0 without any ;; meta-info before it, but I believe this can never happen. (concat "^\\(\\([ACGDU]\\)\\(.[B ]\\)? \\)" - (regexp-quote (file-name-nondirectory file))) + (regexp-quote (file-relative-name file))) nil t) (cond ;; Merge successful, we are in sync with repository now === modified file 'lisp/window.el' --- lisp/window.el 2012-11-16 10:29:48 +0000 +++ lisp/window.el 2012-11-17 02:03:58 +0000 @@ -142,41 +142,46 @@ ;; Return the window. window)))) +;; Doc is very similar to with-output-to-temp-buffer. (defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body) - "Evaluate BODY and display the buffer specified by BUFFER-OR-NAME. + "Bind `standard-output' to BUFFER-OR-NAME, eval BODY, show the buffer. BUFFER-OR-NAME must specify either a live buffer, or the name of a buffer (if it does not exist, this macro creates it). -Make sure the specified buffer is empty before evaluating BODY. -Do not make that buffer current for BODY. Instead, bind -`standard-output' to that buffer, so that output generated with -`prin1' and similar functions in BODY goes into that buffer. - -After evaluating BODY, this marks the specified buffer unmodified and -read-only, and displays it in a window via `display-buffer', passing -ACTION as the action argument to `display-buffer'. It automatically -shrinks the relevant window if `temp-buffer-resize-mode' is enabled. - -Returns the value returned by BODY, unless QUIT-FUNCTION specifies -a function. In that case, runs the function with two arguments - +This construct makes buffer BUFFER-OR-NAME empty before running BODY. +It does not make the buffer current for BODY. +Instead it binds `standard-output' to that buffer, so that output +generated with `prin1' and similar functions in BODY goes into +the buffer. + +At the end of BODY, this marks the specified buffer unmodified and +read-only, and displays it in a window (but does not select it, or make +the buffer current). The display happens by calling `display-buffer' +with the ACTION argument. If `temp-buffer-resize-mode' is enabled, +the relevant window shrinks automatically. + +This returns the value returned by BODY, unless QUIT-FUNCTION specifies +a function. In that case, it runs the function with two arguments - the window showing the specified buffer and the value returned by BODY - and returns the value returned by that function. If the buffer is displayed on a new frame, the window manager may decide to select that frame. In that case, it's usually a good -strategy if the function specified by QUIT-FUNCTION selects the -window showing the buffer before reading a value from the -minibuffer; for example, when asking a `yes-or-no-p' question. - -This construct is similar to `with-output-to-temp-buffer', but does -not put the buffer in help mode, or call `temp-buffer-show-function'. -It also runs different hooks, namely `temp-buffer-window-setup-hook' -\(with the specified buffer current) and `temp-buffer-window-show-hook' -\(with the specified buffer current and the window showing it selected). - -Since this macro calls `display-buffer', the window displaying -the buffer is usually not selected and the specified buffer -usually not made current. QUIT-FUNCTION can override that." +strategy if QUIT-FUNCTION selects the window showing the buffer +before reading any value from the minibuffer; for example, when +asking a `yes-or-no-p' question. + +This runs the hook `temp-buffer-window-setup-hook' before BODY, +with the specified buffer temporarily current. It runs the +hook `temp-buffer-window-show-hook' after displaying the buffer, +with that buffer temporarily current, and the window that was used to +display it temporarily selected. + +This construct is similar to `with-output-to-temp-buffer', but +runs different hooks. In particular, it does not run +`temp-buffer-setup-hook', which usually puts the buffer in Help mode. +Also, it does not call `temp-buffer-show-function' (the ACTION +argument replaces this)." (declare (debug t)) (let ((buffer (make-symbol "buffer")) (window (make-symbol "window")) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-18 01:12:17 +0000 +++ src/ChangeLog 2012-11-18 01:52:36 +0000 @@ -1,3 +1,25 @@ +2012-11-18 Eli Zaretskii + + * w32select.c: Include w32common.h before w32term.h, so that + windows.h gets included before w32term.h uses some of its + features, see below. + + * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New + typedefs. + (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New + prototypes. + (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878) + +2012-11-18 Jan Djärv + + * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834). + (ns_select): Return at once if events are held (Bug#12834). + +2012-11-18 enami tsugutomo + + * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64. + Needed following 2012-10-20 change. (Bug#12902) + 2012-11-18 Juanma Barranquero * w32proc.c (waitpid): Remove unused label get_result. === modified file 'src/nsterm.m' --- src/nsterm.m 2012-11-17 22:12:47 +0000 +++ src/nsterm.m 2012-11-18 01:52:36 +0000 @@ -330,6 +330,7 @@ hold_event_q.q[hold_event_q.nr++] = *event; /* Make sure ns_read_socket is called, i.e. we have input. */ raise (SIGIO); + send_appdefined = YES; } static Lisp_Object @@ -3461,6 +3462,14 @@ /* NSTRACE (ns_select); */ + if (hold_event_q.nr > 0) + { + /* We already have events pending. */ + kill (0, SIGIO); + errno = EINTR; + return -1; + } + for (k = 0; k < nfds+1; k++) { if (readfds && FD_ISSET(k, readfds)) ++nr; === modified file 'src/unexelf.c' --- src/unexelf.c 2012-10-20 21:30:51 +0000 +++ src/unexelf.c 2012-11-16 18:41:00 +0000 @@ -461,7 +461,7 @@ /* * NetBSD does not have normal-looking user-land ELF support. */ -# if defined __alpha__ || defined __sparc_v9__ +# if defined __alpha__ || defined __sparc_v9__ || defined _LP64 # define ELFSIZE 64 # else # define ELFSIZE 32 === modified file 'src/w32select.c' --- src/w32select.c 2012-10-11 00:32:25 +0000 +++ src/w32select.c 2012-11-17 18:51:06 +0000 @@ -74,8 +74,8 @@ #include #include "lisp.h" +#include "w32common.h" /* os_subtype */ #include "w32term.h" /* for all of the w32 includes */ -#include "w32common.h" /* os_subtype */ #include "keyboard.h" #include "blockinput.h" #include "charset.h" === modified file 'src/w32term.h' --- src/w32term.h 2012-11-09 14:45:15 +0000 +++ src/w32term.h 2012-11-18 01:52:36 +0000 @@ -745,6 +745,21 @@ extern int w32_system_caret_x; extern int w32_system_caret_y; +#ifdef _MSC_VER +#ifndef EnumSystemLocales +/* MSVC headers define these only for _WIN32_WINNT >= 0x0500. */ +typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR); +typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR); +BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD); +BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD) +#ifdef UNICODE +#define EnumSystemLocales EnumSystemLocalesW +#else +#define EnumSystemLocales EnumSystemLocalesA +#endif +#endif +#endif + #if EMACSDEBUG extern const char* w32_name_of_message (UINT msg); ------------------------------------------------------------ revno: 110935 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2012-11-18 02:20:04 +0100 message: Silence some warnings. lisp/woman.el (woman-non-underline-faces): Use `set-face-underline'. lisp/calc/calc.el (math-format-date-cache): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-17 22:01:59 +0000 +++ lisp/ChangeLog 2012-11-18 01:20:04 +0000 @@ -1,3 +1,8 @@ +2012-11-18 Juanma Barranquero + + * woman.el (woman-non-underline-faces): Use `set-face-underline'. + * calc/calc.el (math-format-date-cache): Declare. + 2012-11-17 Paul Eggert * calc/calc-forms.el (math-julian-date-beginning) === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-11-17 21:30:43 +0000 +++ lisp/calc/calc.el 2012-11-18 01:20:04 +0000 @@ -464,7 +464,9 @@ :type 'string :group 'calc) -;; Dates that are built-in options for `calc-gregorian-switch' should be +(defvar math-format-date-cache) ; calc-forms.el + +;; Dates that are built-in options for `calc-gregorian-switch' should be ;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed. (defcustom calc-gregorian-switch nil "The first day the Gregorian calendar is used by Calc's date forms. @@ -500,8 +502,8 @@ (const :tag "Sweden (1753 3 1)" (1753 3 1 639965)) (const :tag "Switzerland (Catholic) (1584 1 22)" (1584 1 22 578200)) (const :tag "Switzerland (Protestant) (1701 1 12)" (1701 1 12 620924)) - (list :tag "(YEAR MONTH DAY)" - (integer :tag "Year") + (list :tag "(YEAR MONTH DAY)" + (integer :tag "Year") (integer :tag "Month (integer)") (integer :tag "Day"))) :set (lambda (symbol value) === modified file 'lisp/woman.el' --- lisp/woman.el 2012-11-17 21:52:12 +0000 +++ lisp/woman.el 2012-11-18 01:20:04 +0000 @@ -2196,7 +2196,7 @@ (face-underline-p face)) (let ((face-no-ul (intern (concat face-name "-no-ul")))) (copy-face face face-no-ul) - (set-face-underline-p face-no-ul nil))))))) + (set-face-underline face-no-ul nil))))))) ;; Preprocessors ;; ============= ------------------------------------------------------------ revno: 110934 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2012-11-18 02:12:17 +0100 message: src/w32proc.c (waitpid): Remove unused label get_result. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-17 23:16:24 +0000 +++ src/ChangeLog 2012-11-18 01:12:17 +0000 @@ -1,3 +1,7 @@ +2012-11-18 Juanma Barranquero + + * w32proc.c (waitpid): Remove unused label get_result. + 2012-11-17 Juanma Barranquero * makefile.w32-in (SYSWAIT_H): New macro. === modified file 'src/w32proc.c' --- src/w32proc.c 2012-11-17 16:46:45 +0000 +++ src/w32proc.c 2012-11-18 01:12:17 +0000 @@ -1240,7 +1240,6 @@ else emacs_abort (); -get_result: if (!GetExitCodeProcess (wait_hnd[active], &retval)) { DebPrint (("Wait.GetExitCodeProcess failed with %lu\n", ------------------------------------------------------------ revno: 110933 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2012-11-18 00:58:56 +0100 message: nt/config.nt: Sync with autogen/config.in. (HAVE_FPATHCONF): Remove. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-17 22:12:47 +0000 +++ nt/ChangeLog 2012-11-17 23:58:56 +0000 @@ -1,3 +1,8 @@ +2012-11-17 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (HAVE_FPATHCONF): Remove. + 2012-11-17 Paul Eggert Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). === modified file 'nt/config.nt' --- nt/config.nt 2012-11-17 16:46:45 +0000 +++ nt/config.nt 2012-11-17 23:58:56 +0000 @@ -381,9 +381,6 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK -/* Define to 1 if you have the `fpathconf' function. */ -#undef HAVE_FPATHCONF - /* Define to 1 if you have the `freeifaddrs' function. */ #undef HAVE_FREEIFADDRS ------------------------------------------------------------ revno: 110932 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2012-11-18 00:16:24 +0100 message: lib-src/makefile.w32-in, src/makefile.w32-in: Update dependencies. * lib-src/makefile.w32-in (SYSWAIT_H): New macro. ($(BLD)/movemail.$(O)): Update dependencies. * src/makefile.w32-in (SYSWAIT_H): New macro. ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O)) ($(BLD)/sysdep.$(O)): Update dependencies. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-11-17 22:12:47 +0000 +++ lib-src/ChangeLog 2012-11-17 23:16:24 +0000 @@ -1,3 +1,8 @@ +2012-11-17 Juanma Barranquero + + * makefile.w32-in (SYSWAIT_H): New macro. + ($(BLD)/movemail.$(O)): Update dependencies. + 2012-11-17 Paul Eggert Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2012-10-23 17:09:55 +0000 +++ lib-src/makefile.w32-in 2012-11-17 23:16:24 +0000 @@ -374,6 +374,8 @@ SYSTIME_H = $(SRC)/systime.h \ $(NT_INC)/sys/time.h \ $(GNU_LIB)/timespec.h +SYSWAIT_H = $(SRC)/syswait.h \ + $(NT_INC)/sys/wait.h $(BLD)/ctags.$(O) : \ $(LIB_SRC)/ctags.c \ @@ -419,14 +421,14 @@ $(BLD)/movemail.$(O) : \ $(LIB_SRC)/movemail.c \ $(LIB_SRC)/pop.h \ - $(SRC)/syswait.h \ $(NT_INC)/pwd.h \ $(NT_INC)/sys/file.h \ $(NT_INC)/sys/stat.h \ $(NT_INC)/unistd.h \ $(GNU_LIB)/getopt.h \ $(CONFIG_H) \ - $(NTLIB_H) + $(NTLIB_H) \ + $(SYSWAIT_H) $(BLD)/ntlib.$(O) : \ $(LIB_SRC)/ntlib.c \ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-17 22:12:47 +0000 +++ src/ChangeLog 2012-11-17 23:16:24 +0000 @@ -1,3 +1,9 @@ +2012-11-17 Juanma Barranquero + + * makefile.w32-in (SYSWAIT_H): New macro. + ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O)) + ($(BLD)/sysdep.$(O)): Update dependencies. + 2012-11-17 Paul Eggert Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-11-15 16:21:50 +0000 +++ src/makefile.w32-in 2012-11-17 23:16:24 +0000 @@ -472,6 +472,8 @@ SYSTTY_H = $(SRC)/systty.h \ $(NT_INC)/sys/ioctl.h \ $(NT_INC)/unistd.h +SYSWAIT_H = $(SRC)/syswait.h \ + $(NT_INC)/sys/wait.h TERMHOOKS_H = $(SRC)/termhooks.h \ $(SYSTIME_H) W32FONT_H = $(SRC)/w32font.h \ @@ -566,7 +568,6 @@ $(SRC)/commands.h \ $(SRC)/composite.h \ $(SRC)/epaths.h \ - $(SRC)/syswait.h \ $(SRC)/w32.h \ $(NT_INC)/sys/file.h \ $(NT_INC)/unistd.h \ @@ -580,6 +581,7 @@ $(PROCESS_H) \ $(SYSSIGNAL_H) \ $(SYSTTY_H) \ + $(SYSWAIT_H) \ $(TERMHOOKS_H) $(BLD)/casefiddle.$(O) : \ @@ -1216,7 +1218,6 @@ $(BLD)/w32proc.$(O) : \ $(SRC)/w32proc.c \ - $(SRC)/syswait.h \ $(SRC)/w32.h \ $(SRC)/w32common.h \ $(SRC)/w32heap.h \ @@ -1230,6 +1231,7 @@ $(PROCESS_H) \ $(SYSSIGNAL_H) \ $(SYSTIME_H) \ + $(SYSWAIT_H) \ $(W32TERM_H) $(BLD)/w32console.$(O) : \ @@ -1274,7 +1276,6 @@ $(SRC)/composite.h \ $(SRC)/gnutls.h \ $(SRC)/sysselect.h \ - $(SRC)/syswait.h \ $(SRC)/termopts.h \ $(NT_INC)/arpa/inet.h \ $(NT_INC)/netdb.h \ @@ -1297,6 +1298,7 @@ $(SYSSIGNAL_H) \ $(SYSTIME_H) \ $(SYSTTY_H) \ + $(SYSWAIT_H) \ $(TERMHOOKS_H) \ $(W32TERM_H) \ $(WINDOW_H) @@ -1380,7 +1382,6 @@ $(SRC)/blockinput.h \ $(SRC)/cm.h \ $(SRC)/sysselect.h \ - $(SRC)/syswait.h \ $(SRC)/termchar.h \ $(SRC)/termopts.h \ $(NT_INC)/netdb.h \ @@ -1405,6 +1406,7 @@ $(SYSSIGNAL_H) \ $(SYSTIME_H) \ $(SYSTTY_H) \ + $(SYSWAIT_H) \ $(TERMHOOKS_H) \ $(WINDOW_H) ------------------------------------------------------------ revno: 110931 fixes bug: http://debbugs.gnu.org/12881 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-11-17 14:12:47 -0800 message: Assume POSIX 1003.1-1988 or later for fcntl.h. * admin/CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove. * admin/merge-gnulib (GNULIB_MODULES): Add fcntl-h. * configure.ac: Do not check for fcntl.h. * lib/gnulib.mk: Regenerate. * lib-src/movemail.c, lib-src/update-game-score.c: Assume exists. * nt/inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the POSIX name for this flag is O_NONBLOCK. All uses changed. * nt/inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc. these really should be moved to a replacement if and when that gets implemented. In the meantime, include to make sure we don't override its definitions. * src/callproc.c (relocate_fd): Assume F_DUPFD. * src/emacs.c, src/term.c (O_RDWR): Remove. * src/keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than O_NDELAY, since O_NONBLOCK is the standard name for this flag. * src/nsterm.m: Assume exists. * src/process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process) (create_pty, Fmake_network_process, server_accept_connection) (wait_reading_process_output, init_process_emacs): Assume O_NONBLOCK. (wait_reading_process_output): Put in a special case for WINDOWSNT to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK. It's not clear this is needed, but it's a more-conservative change. (create_process): Assume FD_CLOEXEC. (create_process, create_pty): Assume O_NOCTTY. * src/sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL. (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY. Omit if not DOS_NT, since F_GETFL is not defined there. (serial_open): Assume O_NONBLOCK and O_NOCTTY. * src/term.c: Include , for flags like O_NOCTTY. (O_NOCTTY): Remove. (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that lack it, since gnulib guarantees this. * src/w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY. diff: === modified file 'ChangeLog' --- ChangeLog 2012-11-16 15:29:22 +0000 +++ ChangeLog 2012-11-17 22:12:47 +0000 @@ -1,3 +1,9 @@ +2012-11-17 Paul Eggert + + Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). + * configure.ac: Do not check for fcntl.h. + * lib/gnulib.mk: Regenerate. + 2012-11-16 Paul Eggert Remove no-longer-used pty_max_bytes variable. === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-11-16 15:29:22 +0000 +++ admin/CPP-DEFINES 2012-11-17 22:12:47 +0000 @@ -150,7 +150,6 @@ HAVE_ENDPWENT HAVE_ENVIRON_DECL HAVE_EUIDACCESS -HAVE_FCNTL_H HAVE_FORK HAVE_FREEIFADDRS HAVE_FREETYPE @@ -419,8 +418,6 @@ NSIG_MINIMUM NULL_DEVICE ORDINARY_LINK -O_RDONLY -O_RDWR PAGESIZE PREFER_VSUSP PTY_ITERATION === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-11-16 15:29:22 +0000 +++ admin/ChangeLog 2012-11-17 22:12:47 +0000 @@ -1,3 +1,9 @@ +2012-11-17 Paul Eggert + + Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). + * CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove. + * merge-gnulib (GNULIB_MODULES): Add fcntl-h. + 2012-11-16 Paul Eggert Remove no-longer-used pty_max_bytes variable. === modified file 'admin/merge-gnulib' --- admin/merge-gnulib 2012-11-14 04:55:41 +0000 +++ admin/merge-gnulib 2012-11-17 22:12:47 +0000 @@ -29,7 +29,7 @@ alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat - filemode getloadavg getopt-gnu gettime gettimeofday + fcntl-h filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio === modified file 'configure.ac' --- configure.ac 2012-11-16 15:29:22 +0000 +++ configure.ac 2012-11-17 22:12:47 +0000 @@ -1268,7 +1268,7 @@ dnl checks for header files AC_CHECK_HEADERS_ONCE( linux/version.h sys/systeminfo.h - fcntl.h coff.h pty.h + coff.h pty.h sys/vlimit.h sys/resource.h sys/utsname.h pwd.h utmp.h dirent.h util.h) === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-10-26 07:40:51 +0000 +++ lib-src/ChangeLog 2012-11-17 22:12:47 +0000 @@ -1,3 +1,8 @@ +2012-11-17 Paul Eggert + + Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). + * movemail.c, update-game-score.c: Assume exists. + 2012-10-26 Glenn Morris * Makefile.in (uninstall): No INSTALLABLES live in archlibdir. === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2012-08-10 07:07:07 +0000 +++ lib-src/movemail.c 2012-11-17 22:12:47 +0000 @@ -65,9 +65,7 @@ #include #include -#ifdef HAVE_FCNTL_H #include -#endif #include #include "syswait.h" #ifdef MAIL_USE_POP === modified file 'lib-src/update-game-score.c' --- lib-src/update-game-score.c 2012-07-11 05:44:06 +0000 +++ lib-src/update-game-score.c 2012-11-17 22:12:47 +0000 @@ -42,9 +42,7 @@ #include #include #include -#ifdef HAVE_FCNTL_H #include -#endif #include #include === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2012-11-14 04:55:41 +0000 +++ lib/gnulib.mk 2012-11-17 22:12:47 +0000 @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=at-internal --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=openat-h --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=at-internal --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=openat-h --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub utimens warnings MOSTLYCLEANFILES += core *.stackdump === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-17 16:46:45 +0000 +++ nt/ChangeLog 2012-11-17 22:12:47 +0000 @@ -1,3 +1,13 @@ +2012-11-17 Paul Eggert + + Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). + * inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the + POSIX name for this flag is O_NONBLOCK. All uses changed. + * inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc. + these really should be moved to a replacement if and + when that gets implemented. In the meantime, include + to make sure we don't override its definitions. + 2012-11-17 Eli Zaretskii * inc/sys/wait.h: New file, with prototype of waitpid and === modified file 'nt/inc/sys/socket.h' --- nt/inc/sys/socket.h 2012-09-30 21:36:42 +0000 +++ nt/inc/sys/socket.h 2012-11-17 22:12:47 +0000 @@ -119,7 +119,7 @@ an fcntl function, for setting sockets to non-blocking mode. */ int fcntl (int s, int cmd, int options); #define F_SETFL 4 -#define O_NDELAY 04000 +#define O_NONBLOCK 04000 /* we are providing a real h_errno variable */ #undef h_errno === modified file 'nt/inc/unistd.h' --- nt/inc/unistd.h 2012-11-14 17:22:55 +0000 +++ nt/inc/unistd.h 2012-11-17 22:12:47 +0000 @@ -26,4 +26,17 @@ #define AT_EACCESS 4 #define AT_SYMLINK_NOFOLLOW 4096 +/* Here are some more fcntl.h macros that default to gnulib-compatible + values. Include first, to make sure we don't override + its values if any. FIXME: If we know does not define + O_NOCTTY and O_RDWR, this can be replaced with a simple "#define + O_NOCTTY 0" and "#define O_RDWR 2". */ +#include +#ifndef O_NOCTTY +#define O_NOCTTY 0 +#endif +#ifndef O_RDWR +#define O_RDWR 2 +#endif + #endif /* _UNISTD_H */ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-17 16:52:48 +0000 +++ src/ChangeLog 2012-11-17 22:12:47 +0000 @@ -1,3 +1,30 @@ +2012-11-17 Paul Eggert + + Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). + * callproc.c (relocate_fd): Assume F_DUPFD. + * emacs.c, term.c (O_RDWR): Remove. + * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than + O_NDELAY, since O_NONBLOCK is the standard name for this flag. + * nsterm.m: Assume exists. + * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process) + (create_pty, Fmake_network_process, server_accept_connection) + (wait_reading_process_output, init_process_emacs): + Assume O_NONBLOCK. + (wait_reading_process_output): Put in a special case for WINDOWSNT + to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK. + It's not clear this is needed, but it's a more-conservative change. + (create_process): Assume FD_CLOEXEC. + (create_process, create_pty): Assume O_NOCTTY. + * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL. + (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY. + Omit if not DOS_NT, since F_GETFL is not defined there. + (serial_open): Assume O_NONBLOCK and O_NOCTTY. + * term.c: Include , for flags like O_NOCTTY. + (O_NOCTTY): Remove. + (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that + lack it, since gnulib guarantees this. + * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY. + 2012-11-17 Eli Zaretskii * w32.c (faccessat): Pretend that directories have the execute bit === modified file 'src/callproc.c' --- src/callproc.c 2012-11-14 04:55:41 +0000 +++ src/callproc.c 2012-11-17 22:12:47 +0000 @@ -1317,16 +1317,7 @@ return fd; else { - int new; -#ifdef F_DUPFD - new = fcntl (fd, F_DUPFD, minfd); -#else - new = dup (fd); - if (new != -1) - /* Note that we hold the original FD open while we recurse, - to guarantee we'll get a new FD if we need it. */ - new = relocate_fd (new, minfd); -#endif + int new = fcntl (fd, F_DUPFD, minfd); if (new == -1) { const char *message_1 = "Error while setting up child: "; === modified file 'src/emacs.c' --- src/emacs.c 2012-11-08 19:12:23 +0000 +++ src/emacs.c 2012-11-17 22:12:47 +0000 @@ -95,10 +95,6 @@ #include #endif -#ifndef O_RDWR -#define O_RDWR 2 -#endif - static const char emacs_version[] = VERSION; static const char emacs_copyright[] = COPYRIGHT; === modified file 'src/keyboard.c' --- src/keyboard.c 2012-11-08 09:26:40 +0000 +++ src/keyboard.c 2012-11-17 22:12:47 +0000 @@ -6948,7 +6948,7 @@ #elif defined USG || defined CYGWIN /* Read some input if available, but don't wait. */ n_to_read = sizeof cbuf; - fcntl (fileno (tty->input), F_SETFL, O_NDELAY); + fcntl (fileno (tty->input), F_SETFL, O_NONBLOCK); #else # error "Cannot read without possibly delaying" #endif @@ -6982,7 +6982,7 @@ } while ( /* We used to retry the read if it was interrupted. - But this does the wrong thing when O_NDELAY causes + But this does the wrong thing when O_NONBLOCK causes an EAGAIN error. Does anybody know of a situation where a retry is actually needed? */ #if 0 === modified file 'src/nsterm.m' --- src/nsterm.m 2012-11-17 15:15:49 +0000 +++ src/nsterm.m 2012-11-17 22:12:47 +0000 @@ -30,6 +30,7 @@ interpretation of even the system includes. */ #include +#include #include #include #include @@ -41,10 +42,6 @@ #include #include -#ifdef HAVE_FCNTL_H -#include -#endif - #include "lisp.h" #include "blockinput.h" #include "sysselect.h" === modified file 'src/process.c' --- src/process.c 2012-11-17 18:30:16 +0000 +++ src/process.c 2012-11-17 22:12:47 +0000 @@ -196,11 +196,9 @@ #ifndef NON_BLOCKING_CONNECT #ifdef HAVE_SELECT #if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX) -#if O_NONBLOCK || O_NDELAY #if defined (EWOULDBLOCK) || defined (EINPROGRESS) #define NON_BLOCKING_CONNECT #endif /* EWOULDBLOCK || EINPROGRESS */ -#endif /* O_NONBLOCK || O_NDELAY */ #endif /* HAVE_GETPEERNAME || GNU_LINUX */ #endif /* HAVE_SELECT */ #endif /* NON_BLOCKING_CONNECT */ @@ -639,13 +637,7 @@ #ifdef PTY_OPEN PTY_OPEN; #else /* no PTY_OPEN */ - { -# if O_NONBLOCK - fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0); -# else - fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0); -# endif - } + fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0); #endif /* no PTY_OPEN */ if (fd >= 0) @@ -1583,7 +1575,7 @@ int inchannel, outchannel; pid_t pid; int sv[2]; -#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) +#ifndef WINDOWSNT int wait_child_setup[2]; #endif #ifdef SIGCHLD @@ -1609,13 +1601,9 @@ #if ! defined (USG) || defined (USG_SUBTTY_WORKS) /* On most USG systems it does not work to open the pty's tty here, then close it and reopen it in the child. */ -#if O_NOCTTY /* Don't let this terminal become our controlling terminal (in case we don't have one). */ forkout = forkin = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0); -#else - forkout = forkin = emacs_open (pty_name, O_RDWR, 0); -#endif if (forkin < 0) report_file_error ("Opening pty", Qnil); #else @@ -1644,7 +1632,7 @@ forkin = sv[0]; } -#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) +#ifndef WINDOWSNT { int tem; @@ -1663,15 +1651,8 @@ } #endif -#if O_NONBLOCK fcntl (inchannel, F_SETFL, O_NONBLOCK); fcntl (outchannel, F_SETFL, O_NONBLOCK); -#else -#if O_NDELAY - fcntl (inchannel, F_SETFL, O_NDELAY); - fcntl (outchannel, F_SETFL, O_NDELAY); -#endif -#endif /* Record this as an active process, with its channels. As a result, child_setup will close Emacs's side of the pipes. */ @@ -1830,9 +1811,7 @@ pid = child_setup (xforkin, xforkout, xforkout, new_argv, 1, encoded_current_dir); #else /* not WINDOWSNT */ -#ifdef FD_CLOEXEC emacs_close (wait_child_setup[0]); -#endif child_setup (xforkin, xforkout, xforkout, new_argv, 1, encoded_current_dir); #endif /* not WINDOWSNT */ @@ -1891,7 +1870,7 @@ pset_tty_name (XPROCESS (process), lisp_pty_name); -#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) +#ifndef WINDOWSNT /* Wait for child_setup to complete in case that vfork is actually defined as fork. The descriptor wait_child_setup[1] of a pipe is closed at the child side either by close-on-exec @@ -1928,13 +1907,9 @@ #if ! defined (USG) || defined (USG_SUBTTY_WORKS) /* On most USG systems it does not work to open the pty's tty here, then close it and reopen it in the child. */ -#if O_NOCTTY /* Don't let this terminal become our controlling terminal (in case we don't have one). */ int forkout = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0); -#else - int forkout = emacs_open (pty_name, O_RDWR, 0); -#endif if (forkout < 0) report_file_error ("Opening pty", Qnil); #if defined (DONT_REOPEN_PTY) @@ -1948,15 +1923,8 @@ } #endif /* HAVE_PTYS */ -#if O_NONBLOCK fcntl (inchannel, F_SETFL, O_NONBLOCK); fcntl (outchannel, F_SETFL, O_NONBLOCK); -#else -#if O_NDELAY - fcntl (inchannel, F_SETFL, O_NDELAY); - fcntl (outchannel, F_SETFL, O_NDELAY); -#endif -#endif /* Record this as an active process, with its channels. As a result, child_setup will close Emacs's side of the pipes. */ @@ -2912,13 +2880,9 @@ { /* Don't support network sockets when non-blocking mode is not available, since a blocked Emacs is not useful. */ -#if !O_NONBLOCK && !O_NDELAY - error ("Network servers not supported"); -#else is_server = 1; if (TYPE_RANGED_INTEGERP (int, tem)) backlog = XINT (tem); -#endif } /* Make QCaddress an alias for :local (server) or :remote (client). */ @@ -3178,11 +3142,7 @@ #ifdef NON_BLOCKING_CONNECT if (is_non_blocking_client) { -#if O_NONBLOCK ret = fcntl (s, F_SETFL, O_NONBLOCK); -#else - ret = fcntl (s, F_SETFL, O_NDELAY); -#endif if (ret < 0) { xerrno = errno; @@ -3395,13 +3355,7 @@ chan_process[inch] = proc; -#if O_NONBLOCK fcntl (inch, F_SETFL, O_NONBLOCK); -#else -#if O_NDELAY - fcntl (inch, F_SETFL, O_NDELAY); -#endif -#endif p = XPROCESS (proc); @@ -4130,13 +4084,7 @@ chan_process[s] = proc; -#if O_NONBLOCK fcntl (s, F_SETFL, O_NONBLOCK); -#else -#if O_NDELAY - fcntl (s, F_SETFL, O_NDELAY); -#endif -#endif p = XPROCESS (proc); @@ -4832,23 +4780,17 @@ else if (nread == -1 && errno == EWOULDBLOCK) ; #endif - /* ISC 4.1 defines both EWOULDBLOCK and O_NONBLOCK, - and Emacs uses O_NONBLOCK, so what we get is EAGAIN. */ -#if O_NONBLOCK - else if (nread == -1 && errno == EAGAIN) - ; -#else -#if O_NDELAY - else if (nread == -1 && errno == EAGAIN) - ; + else if (nread == -1 && errno == EAGAIN) + ; +#ifdef WINDOWSNT + /* FIXME: Is this special case still needed? */ /* Note that we cannot distinguish between no input available now and a closed pipe. With luck, a closed pipe will be accompanied by subprocess termination and SIGCHLD. */ else if (nread == 0 && !NETCONN_P (proc) && !SERIALCONN_P (proc)) ; -#endif /* O_NDELAY */ -#endif /* O_NONBLOCK */ +#endif #ifdef HAVE_PTYS /* On some OSs with ptys, when the process on one end of a pty exits, the other end gets an error reading with @@ -7312,9 +7254,7 @@ #ifdef HAVE_GETSOCKNAME ADD_SUBFEATURE (QCservice, Qt); #endif -#if O_NONBLOCK || O_NDELAY ADD_SUBFEATURE (QCserver, Qt); -#endif for (sopt = socket_options; sopt->name; sopt++) subfeatures = pure_cons (intern_c_string (sopt->name), subfeatures); === modified file 'src/sysdep.c' --- src/sysdep.c 2012-11-17 16:46:45 +0000 +++ src/sysdep.c 2012-11-17 22:12:47 +0000 @@ -1036,8 +1036,7 @@ #endif #endif -#ifdef F_SETFL -#ifdef F_GETOWN /* F_SETFL does not imply existence of F_GETOWN */ +#ifdef F_GETOWN if (interrupt_input) { old_fcntl_owner[fileno (tty_out->input)] = @@ -1055,7 +1054,6 @@ #endif /* HAVE_GPM */ } #endif /* F_GETOWN */ -#endif /* F_SETFL */ #ifdef _IOFBF /* This symbol is defined on recent USG systems. @@ -1275,8 +1273,8 @@ fsync (fileno (tty_out->output)); #endif -#ifdef F_SETFL -#ifdef F_SETOWN /* F_SETFL does not imply existence of F_SETOWN */ +#ifndef DOS_NT +#ifdef F_SETOWN if (interrupt_input) { reset_sigio (fileno (tty_out->input)); @@ -1284,11 +1282,9 @@ old_fcntl_owner[fileno (tty_out->input)]); } #endif /* F_SETOWN */ -#if O_NDELAY fcntl (fileno (tty_out->input), F_SETFL, - fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NDELAY); + fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NONBLOCK); #endif -#endif /* F_SETFL */ if (tty_out->old_tty) while (emacs_set_tty (fileno (tty_out->input), @@ -2377,19 +2373,7 @@ int serial_open (char *port) { - int fd = -1; - - fd = emacs_open ((char*) port, - O_RDWR -#if O_NONBLOCK - | O_NONBLOCK -#else - | O_NDELAY -#endif -#if O_NOCTTY - | O_NOCTTY -#endif - , 0); + int fd = emacs_open (port, O_RDWR | O_NOCTTY | O_NONBLOCK, 0); if (fd < 0) { error ("Could not open %s: %s", === modified file 'src/term.c' --- src/term.c 2012-11-14 04:55:41 +0000 +++ src/term.c 2012-11-17 22:12:47 +0000 @@ -20,8 +20,9 @@ /* New redisplay, TTY faces by Gerd Moellmann . */ #include +#include +#include #include -#include #include #include #include @@ -55,14 +56,6 @@ #include "xterm.h" #endif -#ifndef O_RDWR -#define O_RDWR 2 -#endif - -#ifndef O_NOCTTY -#define O_NOCTTY 0 -#endif - /* The name of the default console device. */ #ifdef WINDOWSNT #define DEV_TTY "CONOUT$" @@ -2989,22 +2982,18 @@ set_tty_hooks (terminal); { - int fd; + /* Open the terminal device. */ FILE *file; -#if O_IGNORE_CTTY - if (!ctty) - /* Open the terminal device. Don't recognize it as our - controlling terminal, and don't make it the controlling tty - if we don't have one at the moment. */ - fd = emacs_open (name, O_RDWR | O_IGNORE_CTTY | O_NOCTTY, 0); - else -#endif /* O_IGNORE_CTTY */ - /* Alas, O_IGNORE_CTTY is a GNU extension that seems to be only - defined on Hurd. On other systems, we need to explicitly - dissociate ourselves from the controlling tty when we want to - open a frame on the same terminal. */ - fd = emacs_open (name, O_RDWR | O_NOCTTY, 0); + /* If !ctty, don't recognize it as our controlling terminal, and + don't make it the controlling tty if we don't have one now. + + Alas, O_IGNORE_CTTY is a GNU extension that seems to be only + defined on Hurd. On other systems, we need to explicitly + dissociate ourselves from the controlling tty when we want to + open a frame on the same terminal. */ + int flags = O_RDWR | O_NOCTTY | (ctty ? 0 : O_IGNORE_CTTY); + int fd = emacs_open (name, flags, 0); tty->name = xstrdup (name); terminal->name = xstrdup (name); @@ -3023,10 +3012,8 @@ name); } -#if !O_IGNORE_CTTY - if (!ctty) + if (!O_IGNORE_CTTY && !ctty) dissociate_if_controlling_tty (fd); -#endif file = fdopen (fd, "w+"); tty->input = file; === modified file 'src/w32.c' --- src/w32.c 2012-11-17 16:52:48 +0000 +++ src/w32.c 2012-11-17 22:12:47 +0000 @@ -5854,7 +5854,7 @@ check_errno (); if (fd_info[s].flags & FILE_SOCKET) { - if (cmd == F_SETFL && options == O_NDELAY) + if (cmd == F_SETFL && options == O_NONBLOCK) { unsigned long nblock = 1; int rc = pfn_ioctlsocket (SOCK_HANDLE (s), FIONBIO, &nblock); ------------------------------------------------------------ revno: 110930 author: Paul Eggert committer: Jay Belanger branch nick: trunk timestamp: Sat 2012-11-17 16:01:59 -0600 message: Calc now uses the Gregorian calendar for all dates, and uses January 1, 1 AD as its day number 1. * doc/misc/calc.texi (Date Forms): Document this. * lisp/calc/calc-forms.el (math-julian-date-beginning) (math-julian-date-beginning-int): Implement this. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-11-16 17:20:23 +0000 +++ doc/misc/ChangeLog 2012-11-17 22:01:59 +0000 @@ -1,3 +1,9 @@ +2012-11-17 Paul Eggert + + Calc now uses the Gregorian calendar for all dates, + and uses January 1, 1 AD as its day number 1. + * calc.texi (Date Forms): Document this. + 2012-11-16 Glenn Morris * cl.texi (Function Bindings): Clarify that cl-flet is lexical. === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2012-10-05 07:38:05 +0000 +++ doc/misc/calc.texi 2012-11-17 22:01:59 +0000 @@ -11010,35 +11010,41 @@ of a date form. @xref{Packing and Unpacking}. Date forms can go arbitrarily far into the future or past. Negative -year numbers represent years BC. Calc uses a combination of the -Gregorian and Julian calendars, following the history of Great -Britain and the British colonies. This is the same calendar that -is used by the @code{cal} program in most Unix implementations. +year numbers represent years BC. There is no ``year 0''; the day +before @samp{} is @samp{}. These are +days 1 and 0 respectively in Calc's internal numbering scheme. The +Gregorian calendar is used for all dates, including dates before the +Gregorian calendar was invented. Thus Calc's use of the day number +@mathit{-10000} to represent August 15, 28 BC should be taken with a +grain of salt. @cindex Julian calendar @cindex Gregorian calendar Some historical background: The Julian calendar was created by -Julius Caesar in the year 46 BC as an attempt to fix the gradual -drift caused by the lack of leap years in the calendar used -until that time. The Julian calendar introduced an extra day in +Julius Caesar in the year 46 BC as an attempt to fix the confusion +caused by the irregular Roman calendar that was used before that time. +The Julian calendar introduced an extra day in all years divisible by four. After some initial confusion, the -calendar was adopted around the year we call 8 AD. Some centuries +calendar was adopted around the year we call 8 AD, although the years were +numbered differently and did not necessarily begin on January 1. Some centuries later it became apparent that the Julian year of 365.25 days was itself not quite right. In 1582 Pope Gregory XIII introduced the Gregorian calendar, which added the new rule that years divisible by 100, but not by 400, were not to be considered leap years despite being divisible by four. Many countries delayed adoption -of the Gregorian calendar because of religious differences; -in Britain it was put off until the year 1752, by which time -the Julian calendar had fallen eleven days behind the true -seasons. So the switch to the Gregorian calendar in early -September 1752 introduced a discontinuity: The day after -Sep 2, 1752 is Sep 14, 1752. Calc follows this convention. -To take another example, Russia waited until 1918 before -adopting the new calendar, and thus needed to remove thirteen -days (between Feb 1, 1918 and Feb 14, 1918). This means that -Calc's reckoning will be inconsistent with Russian history between -1752 and 1918, and similarly for various other countries. +of the Gregorian calendar because of religious differences, and +used differing year numbers and start-of-year for other reasons; +for example, in early 1752 England changed the start of its year from +March 25 to January 1, and in September it switched to the Gregorian +calendar: in England, the day after December 31, 1750 was January 1, +1750 and the day after March 24, 1750 was March 25, 1751, but the day +after December 31, 1751 was January 1, 1752 and the day after +September 2, 1752 was September 14, 1752. To take another example, +Russia switched both year numbering and start-of-year in 1700, but did +not adopt the Gregorian calendar until 1918. Calc's reckoning +therefore matches English practice starting in 1752 and Russian +practice starting in 1918, but disagrees with earlier dates in both +countries. Today's timekeepers introduce an occasional ``leap second'' as well, but Calc does not take these minor effects into account. @@ -11046,15 +11052,6 @@ between, say, @samp{<12:00am Mon Jan 1, 1900>} and @samp{<12:00am Sat Jan 1, 2000>}.) -Calc uses the Julian calendar for all dates before the year 1752, -including dates BC when the Julian calendar technically had not -yet been invented. Thus the claim that day number @mathit{-10000} is -called ``August 16, 28 BC'' should be taken with a grain of salt. - -Please note that there is no ``year 0''; the day before -@samp{} is @samp{}. These are -days 0 and @mathit{-1} respectively in Calc's internal numbering scheme. - @cindex Julian day counting Another day counting system in common use is, confusingly, also called ``Julian.'' The Julian day number is the numbers of days since === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-17 21:52:12 +0000 +++ lisp/ChangeLog 2012-11-17 22:01:59 +0000 @@ -1,3 +1,8 @@ +2012-11-17 Paul Eggert + + * calc/calc-forms.el (math-julian-date-beginning) + (math-julian-date-beginning-int): Implement [new date numbering]. + 2012-11-17 Juanma Barranquero * descr-text.el (quail-find-key): === modified file 'lisp/calc/calc-forms.el' --- lisp/calc/calc-forms.el 2012-11-17 21:34:09 +0000 +++ lisp/calc/calc-forms.el 2012-11-17 22:01:59 +0000 @@ -656,13 +656,13 @@ (setcdr math-fd-dt nil)) fmt)))) -(defconst math-julian-date-beginning '(float 17214235 -1) - "The beginning of the Julian calendar, -as measured in the number of days before January 1 of the year 1AD.") +(defconst math-julian-date-beginning '(float 17214225 -1) + "The beginning of the Julian date calendar, +as measured in the number of days before December 31, 1 BC (Gregorian).") -(defconst math-julian-date-beginning-int 1721424 - "The beginning of the Julian calendar, -as measured in the integer number of days before January 1 of the year 1AD.") +(defconst math-julian-date-beginning-int 1721423 + "The beginning of the Julian date calendar, +as measured in the integer number of days before December 31, 1 BC (Gregorian).") (defun math-format-date-part (x) (cond ((stringp x) ------------------------------------------------------------ revno: 110929 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2012-11-17 22:52:12 +0100 message: lisp/*.el: Add missing declarations. * descr-text.el (quail-find-key): * dired.el (desktop-file-name): * dirtrack.el (shell-prefixed-directory-name, shell-process-cd): * generic-x.el (comint-mode, comint-exec): * image-dired.el (widget-forward): * info.el (speedbar-add-expansion-list, speedbar-center-buffer-smartly) (speedbar-change-expand-button-char) (speedbar-change-initial-expansion-list, speedbar-delete-subblock) (speedbar-make-specialized-keymap, speedbar-make-tag-line): * printing.el (easy-menu-add-item, easy-menu-remove-item) (widget-field-action, widget-value-set): * speedbar.el (imenu--make-index-alist): * term.el (ring-empty-p, ring-ref, ring-insert-at-beginning) (ring-length, ring-insert): * vcursor.el (compare-windows-skip-whitespace): * woman.el (dired-get-filename): Declare functions. * term/w32-win.el (cygwin-convert-path-from-windows): Fix declaration. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-17 21:30:43 +0000 +++ lisp/ChangeLog 2012-11-17 21:52:12 +0000 @@ -1,3 +1,25 @@ +2012-11-17 Juanma Barranquero + + * descr-text.el (quail-find-key): + * dired.el (desktop-file-name): + * dirtrack.el (shell-prefixed-directory-name, shell-process-cd): + * generic-x.el (comint-mode, comint-exec): + * image-dired.el (widget-forward): + * info.el (speedbar-add-expansion-list, speedbar-center-buffer-smartly) + (speedbar-change-expand-button-char) + (speedbar-change-initial-expansion-list, speedbar-delete-subblock) + (speedbar-make-specialized-keymap, speedbar-make-tag-line): + * printing.el (easy-menu-add-item, easy-menu-remove-item) + (widget-field-action, widget-value-set): + * speedbar.el (imenu--make-index-alist): + * term.el (ring-empty-p, ring-ref, ring-insert-at-beginning) + (ring-length, ring-insert): + * vcursor.el (compare-windows-skip-whitespace): + * woman.el (dired-get-filename): + Declare functions. + + * term/w32-win.el (cygwin-convert-path-from-windows): Fix declaration. + 2012-11-17 Jay Belanger * calc/calc.el (calc-gregorian-switch): New variable. === modified file 'lisp/descr-text.el' --- lisp/descr-text.el 2012-08-20 11:12:16 +0000 +++ lisp/descr-text.el 2012-11-17 21:52:12 +0000 @@ -374,6 +374,8 @@ (format "%c:%s" x doc))) mnemonics ", "))))) +(declare-function quail-find-key "quail" (char)) + ;;;###autoload (defun describe-char (pos &optional buffer) "Describe position POS (interactively, point) and the char after POS. === modified file 'lisp/dired.el' --- lisp/dired.el 2012-10-27 09:17:14 +0000 +++ lisp/dired.el 2012-11-17 21:52:12 +0000 @@ -3732,6 +3732,7 @@ ;;;; Desktop support (eval-when-compile (require 'desktop)) +(declare-function desktop-file-name "desktop" (filename dirname)) (defun dired-desktop-buffer-misc-data (dirname) "Auxiliary information to be saved in desktop file." === modified file 'lisp/dirtrack.el' --- lisp/dirtrack.el 2012-05-13 03:05:06 +0000 +++ lisp/dirtrack.el 2012-11-17 21:52:12 +0000 @@ -220,6 +220,9 @@ (goto-char (point-max)) (insert msg1 msg2 "\n")))) +(declare-function shell-prefixed-directory-name "shell" (dir)) +(declare-function shell-process-cd "shell" (arg)) + ;;;###autoload (defun dirtrack (input) "Determine the current directory from the process output for a prompt. === modified file 'lisp/generic-x.el' --- lisp/generic-x.el 2012-10-08 16:20:59 +0000 +++ lisp/generic-x.el 2012-11-17 21:52:12 +0000 @@ -549,6 +549,9 @@ (concat (w32-shell-name) " -c " (buffer-file-name))))) (eval-when-compile (require 'comint)) +(declare-function comint-mode "comint" ()) +(declare-function comint-exec "comint" (buffer name command startfile switches)) + (defun bat-generic-mode-run-as-comint () "Run the current BAT file in a comint buffer." (interactive) === modified file 'lisp/image-dired.el' --- lisp/image-dired.el 2012-07-11 23:13:41 +0000 +++ lisp/image-dired.el 2012-11-17 21:52:12 +0000 @@ -2454,6 +2454,8 @@ (defvar image-dired-widget-list nil "List to keep track of meta data in edit buffer.") +(declare-function widget-forward "wid-edit" (arg)) + ;;;###autoload (defun image-dired-dired-edit-comment-and-tags () "Edit comment and tags of current or marked image files. === modified file 'lisp/info.el' --- lisp/info.el 2012-10-29 10:42:58 +0000 +++ lisp/info.el 2012-11-17 21:52:12 +0000 @@ -4836,6 +4836,17 @@ ;; current Info node. (eval-when-compile (require 'speedbar)) +(declare-function speedbar-add-expansion-list "speedbar" (new-list)) +(declare-function speedbar-center-buffer-smartly "speedbar" ()) +(declare-function speedbar-change-expand-button-char "speedbar" (char)) +(declare-function speedbar-change-initial-expansion-list "speedbar" (new-default)) +(declare-function speedbar-delete-subblock "speedbar" (indent)) +(declare-function speedbar-make-specialized-keymap "speedbar" ()) +(declare-function speedbar-make-tag-line "speedbar" + (exp-button-type exp-button-char exp-button-function + exp-button-data tag-button tag-button-function + tag-button-data tag-button-face depth)) + (defvar Info-speedbar-key-map nil "Keymap used when in the Info display mode.") === modified file 'lisp/printing.el' --- lisp/printing.el 2012-09-17 05:41:04 +0000 +++ lisp/printing.el 2012-11-17 21:52:12 +0000 @@ -1383,6 +1383,10 @@ (eval-when-compile (require 'easymenu)) ; to avoid compilation gripes + (declare-function easy-menu-add-item "easymenu" + (map path item &optional before)) + (declare-function easy-menu-remove-item "easymenu" (map path name)) + (eval-and-compile (defun pr-global-menubar (pr-menu-spec) (require 'easymenu) @@ -6079,6 +6083,8 @@ (and pr-i-region ; let region activated (pr-keep-region-active))) +(declare-function widget-field-action "wid-edit" (widget &optional _event)) +(declare-function widget-value-set "wid-edit" (widget value)) (defun pr-insert-section-1 () ;; 1. Print: === modified file 'lisp/speedbar.el' --- lisp/speedbar.el 2012-09-17 05:41:04 +0000 +++ lisp/speedbar.el 2012-11-17 21:52:12 +0000 @@ -3608,6 +3608,7 @@ nil (eval-when-compile (condition-case nil (require 'imenu) (error nil))) +(declare-function imenu--make-index-alist "imenu" (&optional no-error)) (defun speedbar-fetch-dynamic-imenu (file) "Load FILE into a buffer, and generate tags using Imenu. === modified file 'lisp/term.el' --- lisp/term.el 2012-11-15 06:17:56 +0000 +++ lisp/term.el 2012-11-17 21:52:12 +0000 @@ -397,6 +397,12 @@ (require 'ring) (require 'ehelp) +(declare-function ring-empty-p "ring" (ring)) +(declare-function ring-ref "ring" (ring index)) +(declare-function ring-insert-at-beginning "ring" (ring item)) +(declare-function ring-length "ring" (ring)) +(declare-function ring-insert "ring" (ring item)) + (defgroup term nil "General command interpreter in a window." :group 'processes) === modified file 'lisp/term/w32-win.el' --- lisp/term/w32-win.el 2012-11-17 20:41:21 +0000 +++ lisp/term/w32-win.el 2012-11-17 21:52:12 +0000 @@ -92,7 +92,7 @@ (declare-function set-message-beep "w32fns.c") (declare-function cygwin-convert-path-from-windows "cygw32.c" - (path absolute_p)) + (path &optional absolute_p)) ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles (if (fboundp 'new-fontset) === modified file 'lisp/vcursor.el' --- lisp/vcursor.el 2012-04-11 14:26:55 +0000 +++ lisp/vcursor.el 2012-11-17 21:52:12 +0000 @@ -881,6 +881,8 @@ (vcursor-disable -1)))) ) +(declare-function compare-windows-skip-whitespace "compare-w" (start)) + ;; vcursor-compare-windows is copied from compare-w.el with only ;; minor modifications; these are too bound up with the function ;; to make it really useful to call compare-windows itself. === modified file 'lisp/woman.el' --- lisp/woman.el 2012-11-13 16:59:34 +0000 +++ lisp/woman.el 2012-11-17 21:52:12 +0000 @@ -1550,11 +1550,13 @@ (woman-dired-define-keys) (add-hook 'dired-mode-hook 'woman-dired-define-keys)) +(declare-function dired-get-filename "dired" + (&optional localp no-error-if-not-filep)) + ;;;###autoload (defun woman-dired-find-file () "In dired, run the WoMan man-page browser on this file." (interactive) - ;; dired-get-filename is defined in dired.el (woman-find-file (dired-get-filename))) @@ -1947,6 +1949,9 @@ (message "Woman fill column set to %s." (if woman-fill-frame "frame width" woman-fill-column))) +(declare-function apropos-print "apropos" + (do-keys spacing &optional text nosubst)) + (defun woman-mini-help () "Display WoMan commands and user options in an `apropos' buffer." ;; Based on apropos-command in apropos.el ------------------------------------------------------------ revno: 110928 committer: Jay Belanger branch nick: trunk timestamp: Sat 2012-11-17 15:34:09 -0600 message: * calc/calc-forms.el (calc-gregorian-switch): Declare. diff: === modified file 'lisp/calc/calc-forms.el' --- lisp/calc/calc-forms.el 2012-11-17 21:30:43 +0000 +++ lisp/calc/calc-forms.el 2012-11-17 21:34:09 +0000 @@ -520,7 +520,7 @@ "Return the number of days of the year up to YEAR MONTH DAY. The count includes the given date." (if calc-gregorian-switch - (cond ((math-equalp year (nth 0 calc-gregorian-switch)) + (cond ((eq year (nth 0 calc-gregorian-switch)) (1+ (- (math-absolute-from-dt year month day) (math-absolute-from-dt year 1 1)))) @@ -587,6 +587,10 @@ ;; Adjustment, since January 1, 1 (Julian) is absolute day -1 2))) +;; calc-gregorian-switch is a customizable variable defined in calc.el +(defvar calc-gregorian-switch) + + (defun math-absolute-from-dt (year month day) "Return the DATE of the day given by the day YEAR MONTH DAY. Recall that DATE is the number of days since December 31, -1 ------------------------------------------------------------ revno: 110927 committer: Jay Belanger branch nick: trunk timestamp: Sat 2012-11-17 15:30:43 -0600 message: * calc/calc.el (calc-gregorian-switch): New variable. * calc/calc-forms.el (math-day-in-year, math-dt-before-p) (math-absolute-from-gregorian-dt, math-absolute-from-julian-dt) (math-date-to-julian-dt, math-date-to-gregorian-dt): New functions. (math-leap-year-p): Add option to distinguish between Julian and Gregorian calendars. (math-day-number): Use `math-day-in-year' to do the computations. (math-absolute-from-dt): Rename from `math-absolute-from-date'. Use `math-absolute-from-gregorian' and `math-absolute-from-julian' to do the computations. (math-date-to-dt): Use `math-date-to-julian-dt' and `math-date-to-gregorian-dt' to do the computations. (calcFunc-weekday, math-format-date-part): Use the new version of the DATE to determine the weekday. (calcFunc-newmonth, calcFunc-newyear): Use `calc-gregorian-switch' when necessary. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-17 20:41:21 +0000 +++ lisp/ChangeLog 2012-11-17 21:30:43 +0000 @@ -1,3 +1,23 @@ +2012-11-17 Jay Belanger + + * calc/calc.el (calc-gregorian-switch): New variable. + + * calc/calc-forms.el (math-day-in-year, math-dt-before-p) + (math-absolute-from-gregorian-dt, math-absolute-from-julian-dt) + (math-date-to-julian-dt, math-date-to-gregorian-dt): New functions. + (math-leap-year-p): Add option to distinguish between Julian + and Gregorian calendars. + (math-day-number): Use `math-day-in-year' to do the computations. + (math-absolute-from-dt): Rename from `math-absolute-from-date'. + Use `math-absolute-from-gregorian' and `math-absolute-from-julian' + to do the computations. + (math-date-to-dt): Use `math-date-to-julian-dt' and + `math-date-to-gregorian-dt' to do the computations. + (calcFunc-weekday, math-format-date-part): Use the new version of + the DATE to determine the weekday. + (calcFunc-newmonth, calcFunc-newyear): Use `calc-gregorian-switch' + when necessary. + 2012-11-17 Eli Zaretskii * term/w32-win.el (w32-handle-dropped-file): Use 'file://' only on === modified file 'lisp/calc/calc-forms.el' --- lisp/calc/calc-forms.el 2012-09-17 05:41:04 +0000 +++ lisp/calc/calc-forms.el 2012-11-17 21:30:43 +0000 @@ -369,17 +369,67 @@ ;;; Some of these functions are adapted from Edward Reingold's "calendar.el". ;;; These versions are rewritten to use arbitrary-size integers. -;;; The Julian calendar is used up to 9/2/1752, after which the Gregorian -;;; calendar is used; the first day after 9/2/1752 is 9/14/1752. ;;; A numerical date is the number of days since midnight on -;;; the morning of January 1, 1 A.D. If the date is a non-integer, -;;; it represents a specific date and time. +;;; the morning of December 31, 1 B.C. Emacs's calendar refers to such +;;; a date as an absolute date, some function names also use that +;;; terminology. If the date is a non-integer, it represents a specific date and time. ;;; A "dt" is a list of the form, (year month day), corresponding to ;;; an integer code, or (year month day hour minute second), corresponding ;;; to a non-integer code. +(defun math-date-to-gregorian-dt (date) + "Return the day (YEAR MONTH DAY) in the Gregorian calendar. +DATE is the number of days since December 31, -1 in the Gregorian calendar." + (let* ((month 1) + day + (year (math-quotient (math-add date (if (Math-lessp date 711859) + 365 ; for speed, we take + -108)) ; >1950 as a special case + (if (math-negp date) 366 365))) + ; this result may be an overestimate + temp) + (while (Math-lessp date (setq temp (math-absolute-from-gregorian-dt year 1 1))) + (setq year (math-add year -1))) + (if (eq year 0) (setq year -1)) + (setq date (1+ (math-sub date temp))) + (setq temp + (if (math-leap-year-p year) + [1 32 61 92 122 153 183 214 245 275 306 336 999] + [1 32 60 91 121 152 182 213 244 274 305 335 999])) + (while (>= date (aref temp month)) + (setq month (1+ month))) + (setq day (1+ (- date (aref temp (1- month))))) + (list year month day))) + +(defun math-date-to-julian-dt (date) + "Return the day (YEAR MONTH DAY) in the Julian calendar. +DATE is the number of days since December 31, -1 in the Gregorian calendar." + (let* ((month 1) + day + (year (math-quotient (math-add date (if (Math-lessp date 711859) + 365 ; for speed, we take + -108)) ; >1950 as a special case + (if (math-negp date) 366 365))) + ; this result may be an overestimate + temp) + (while (Math-lessp date (setq temp (math-absolute-from-julian-dt year 1 1))) + (setq year (math-add year -1))) + (if (eq year 0) (setq year -1)) + (setq date (1+ (math-sub date temp))) + (setq temp + (if (math-leap-year-p year t) + [1 32 61 92 122 153 183 214 245 275 306 336 999] + [1 32 60 91 121 152 182 213 244 274 305 335 999])) + (while (>= date (aref temp month)) + (setq month (1+ month))) + (setq day (1+ (- date (aref temp (1- month))))) + (list year month day))) + (defun math-date-to-dt (value) + "Return the day and time of VALUE. +The integer part of VALUE is the number of days since Dec 31, -1 +in the Gregorian calendar and the remaining part determines the time." (if (eq (car-safe value) 'date) (setq value (nth 1 value))) (or (math-realp value) @@ -387,32 +437,21 @@ (let* ((parts (math-date-parts value)) (date (car parts)) (time (nth 1 parts)) - (month 1) - day - (year (math-quotient (math-add date (if (Math-lessp date 711859) - 365 ; for speed, we take - -108)) ; >1950 as a special case - (if (math-negp value) 366 365))) - ; this result may be an overestimate - temp) - (while (Math-lessp date (setq temp (math-absolute-from-date year 1 1))) - (setq year (math-add year -1))) - (if (eq year 0) (setq year -1)) - (setq date (1+ (math-sub date temp))) - (and (eq year 1752) (>= date 247) - (setq date (+ date 11))) - (setq temp (if (math-leap-year-p year) - [1 32 61 92 122 153 183 214 245 275 306 336 999] - [1 32 60 91 121 152 182 213 244 274 305 335 999])) - (while (>= date (aref temp month)) - (setq month (1+ month))) - (setq day (1+ (- date (aref temp (1- month))))) + (dt (if (and calc-gregorian-switch + (Math-lessp value + (or + (nth 3 calc-gregorian-switch) + (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)) +)) + (math-date-to-julian-dt value) + (math-date-to-gregorian-dt value)))) (if (math-integerp value) - (list year month day) - (list year month day - (/ time 3600) - (% (/ time 60) 60) - (math-add (% time 60) (nth 2 parts)))))) + dt + (append dt + (list + (/ time 3600) + (% (/ time 60) 60) + (math-add (% time 60) (nth 2 parts))))))) (defun math-dt-to-date (dt) (or (integerp (nth 1 dt)) @@ -423,7 +462,7 @@ (math-reject-arg (nth 2 dt) 'fixnump)) (if (or (< (nth 2 dt) 1) (> (nth 2 dt) 31)) (math-reject-arg (nth 2 dt) "Day value is out of range")) - (let ((date (math-absolute-from-date (car dt) (nth 1 dt) (nth 2 dt)))) + (let ((date (math-absolute-from-dt (car dt) (nth 1 dt) (nth 2 dt)))) (if (nth 3 dt) (math-add (math-float date) (math-div (math-add (+ (* (nth 3 dt) 3600) @@ -446,8 +485,12 @@ (defun math-this-year () (nth 5 (decode-time))) -(defun math-leap-year-p (year) - (if (Math-lessp year 1752) +(defun math-leap-year-p (year &optional julian) + "Non-nil if YEAR is a leap year. +If JULIAN is non-nil, then use the criterion for leap years +in the Julian calendar, otherwise use the criterion in the +Gregorian calendar." + (if julian (if (math-negp year) (= (math-imod (math-neg year) 4) 1) (= (math-imod year 4) 0)) @@ -460,39 +503,100 @@ 29 (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) -(defun math-day-number (year month day) +(defun math-day-in-year (year month day &optional julian) + "Return the number of days of the year up to YEAR MONTH DAY. +The count includes the given date. +If JULIAN is non-nil, use the Julian calendar, otherwise +use the Gregorian calendar." (let ((day-of-year (+ day (* 31 (1- month))))) (if (> month 2) (progn (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) - (if (math-leap-year-p year) + (if (math-leap-year-p year julian) (setq day-of-year (1+ day-of-year))))) - (and (eq year 1752) - (or (> month 9) - (and (= month 9) (>= day 14))) - (setq day-of-year (- day-of-year 11))) day-of-year)) -(defun math-absolute-from-date (year month day) - (if (eq year 0) (setq year -1)) - (let ((yearm1 (math-sub year 1))) - (math-sub (math-add (math-day-number year month day) - (math-add (math-mul 365 yearm1) - (if (math-posp year) - (math-quotient yearm1 4) - (math-sub 365 - (math-quotient (math-sub 3 year) - 4))))) - (if (or (Math-lessp year 1753) - (and (eq year 1752) (<= month 9))) - 1 - (let ((correction (math-mul (math-quotient yearm1 100) 3))) - (let ((res (math-idivmod correction 4))) - (math-add (if (= (cdr res) 0) - -1 - 0) - (car res)))))))) - +(defun math-day-number (year month day) + "Return the number of days of the year up to YEAR MONTH DAY. +The count includes the given date." + (if calc-gregorian-switch + (cond ((math-equalp year (nth 0 calc-gregorian-switch)) + (1+ + (- (math-absolute-from-dt year month day) + (math-absolute-from-dt year 1 1)))) + ((Math-lessp year (nth 0 calc-gregorian-switch)) + (math-day-in-year year month day t)) + (t + (math-day-in-year year month day))) + (math-day-in-year year month day))) + +(defun math-dt-before-p (dt1 dt2) + "Non-nil if DT1 occurs before DT2. +A DT is a list of the form (YEAR MONTH DAY)." + (or (Math-lessp (nth 0 dt1) (nth 0 dt2)) + (and (equal (nth 0 dt1) (nth 0 dt2)) + (or (< (nth 1 dt1) (nth 1 dt2)) + (and (= (nth 1 dt1) (nth 1 dt2)) + (< (nth 2 dt1) (nth 2 dt2))))))) + +(defun math-absolute-from-gregorian-dt (year month day) + "Return the DATE of the day given by the Gregorian day YEAR MONTH DAY. +Recall that DATE is the number of days since December 31, -1 +in the Gregorian calendar." + (if (eq year 0) (setq year -1)) + (let ((yearm1 (math-sub year 1))) + (math-sub + ;; Add the number of days of the year and the numbers of days + ;; in the previous years (leap year days to be added separately) + (math-add (math-day-in-year year month day) + (math-add (math-mul 365 yearm1) + ;; Add the number of Julian leap years + (if (math-posp year) + (math-quotient yearm1 4) + (math-sub 365 + (math-quotient (math-sub 3 year) + 4))))) + ;; Subtract the number of Julian leap years which are not + ;; Gregorian leap years. In C=4N+r centuries, there will + ;; be 3N+r of these days. The following will compute + ;; 3N+r. + (let* ((correction (math-mul (math-quotient yearm1 100) 3)) + (res (math-idivmod correction 4))) + (math-add (if (= (cdr res) 0) + 0 + 1) + (car res)))))) + +(defun math-absolute-from-julian-dt (year month day) + "Return the DATE of the day given by the Julian day YEAR MONTH DAY. +Recall that DATE is the number of days since December 31, -1 +in the Gregorian calendar." + (if (eq year 0) (setq year -1)) + (let ((yearm1 (math-sub year 1))) + (math-sub + ;; Add the number of days of the year and the numbers of days + ;; in the previous years (leap year days to be added separately) + (math-add (math-day-in-year year month day) + (math-add (math-mul 365 yearm1) + ;; Add the number of Julian leap years + (if (math-posp year) + (math-quotient yearm1 4) + (math-sub 365 + (math-quotient (math-sub 3 year) + 4))))) + ;; Adjustment, since January 1, 1 (Julian) is absolute day -1 + 2))) + +(defun math-absolute-from-dt (year month day) + "Return the DATE of the day given by the day YEAR MONTH DAY. +Recall that DATE is the number of days since December 31, -1 +in the Gregorian calendar." + (if (and calc-gregorian-switch + ;; The next few lines determine if the given date + ;; occurs before the switch to the Gregorian calendar. + (math-dt-before-p (list year month day) calc-gregorian-switch)) + (math-absolute-from-julian-dt year month day) + (math-absolute-from-gregorian-dt year month day))) ;;; It is safe to redefine these in your init file to use a different ;;; language. @@ -585,8 +689,7 @@ math-fd-year (car math-fd-dt) math-fd-month (nth 1 math-fd-dt) math-fd-day (nth 2 math-fd-dt) - math-fd-weekday (math-mod - (math-add (math-floor math-fd-date) 6) 7) + math-fd-weekday (math-mod (math-floor math-fd-date) 7) math-fd-hour (nth 3 math-fd-dt) math-fd-minute (nth 4 math-fd-dt) math-fd-second (nth 5 math-fd-dt)) @@ -1098,7 +1201,7 @@ (setq date (nth 1 date))) (or (math-realp date) (math-reject-arg date 'datep)) - (math-mod (math-add (math-floor date) 6) 7)) + (math-mod (math-floor date) 7)) (defun calcFunc-yearday (date) (let ((dt (math-date-to-dt date))) @@ -1298,7 +1401,7 @@ 0))) (rounded-abs-date (+ - (calendar-absolute-from-gregorian + (calendar-absolute-from-gregorian (list (nth 1 dt) (nth 2 dt) (nth 0 dt))) (/ (round (* 60 time)) 60.0 24.0)))) (if (dst-in-effect rounded-abs-date) @@ -1434,28 +1537,100 @@ (and (math-messy-integerp day) (setq day (math-trunc day))) (or (integerp day) (math-reject-arg day 'fixnump)) (and (or (< day 0) (> day 31)) (math-reject-arg day 'range)) - (let ((dt (math-date-to-dt date))) - (if (or (= day 0) (> day (math-days-in-month (car dt) (nth 1 dt)))) - (setq day (math-days-in-month (car dt) (nth 1 dt)))) - (and (eq (car dt) 1752) (= (nth 1 dt) 9) - (if (>= day 14) (setq day (- day 11)))) - (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) - (1- day))))) + (let* ((dt (math-date-to-dt date)) + (dim (math-days-in-month (car dt) (nth 1 dt))) + (julian (if calc-gregorian-switch + (math-date-to-dt (math-sub + (or (nth 3 calc-gregorian-switch) + (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)) + 1))))) + (if (or (= day 0) (> day dim)) + (setq day (1- dim)) + (setq day (1- day))) + ;; Adjust if this occurs near the switch to the Gregorian calendar + (if calc-gregorian-switch + (cond + ((and (math-dt-before-p (list (car dt) (nth 1 dt) 1) calc-gregorian-switch) + (math-dt-before-p julian (list (car dt) (nth 1 dt) 1))) + ;; In this case, CALC-GREGORIAN-SWITCH is the first day of the month + (list 'date + (math-dt-to-date (list (car calc-gregorian-switch) + (nth 1 calc-gregorian-switch) + (if (> (+ (nth 2 calc-gregorian-switch) day) dim) + dim + (+ (nth 2 calc-gregorian-switch) day)))))) + ((and (eq (car dt) (car calc-gregorian-switch)) + (= (nth 1 dt) (nth 1 calc-gregorian-switch))) + ;; In this case, the switch to the Gregorian calendar occurs in the given month + (if (< (+ (nth 2 julian) day) (nth 2 calc-gregorian-switch)) + ;; If the DAYth day occurs before the switch, use it + (list 'date (math-dt-to-date (list (car dt) (nth 1 dt) (1+ day)))) + ;; Otherwise do some computations + (let ((tm (+ day (- (nth 2 calc-gregorian-switch) (nth 2 julian))))) + (list 'date (math-dt-to-date + (list (car dt) + (nth 1 dt) + ;; + (if (> tm dim) dim tm))))))) + ((and (eq (car dt) (car julian)) + (= (nth 1 dt) (nth 1 julian))) + ;; In this case, the current month is truncated because of the switch + ;; to the Gregorian calendar + (list 'date (math-dt-to-date + (list (car dt) + (nth 1 dt) + (if (>= day (nth 2 julian)) + (nth 2 julian) + (1+ day)))))) + (t + ;; The default + (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day)))) + (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day))))) (defun calcFunc-newyear (date &optional day) + (if (eq (car-safe date) 'date) (setq date (nth 1 date))) (or day (setq day 1)) (and (math-messy-integerp day) (setq day (math-trunc day))) (or (integerp day) (math-reject-arg day 'fixnump)) - (let ((dt (math-date-to-dt date))) + (let* ((dt (math-date-to-dt date)) + (gregbeg (if calc-gregorian-switch + (or (nth 3 calc-gregorian-switch) + (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)))) + (julianend (if calc-gregorian-switch (math-sub gregbeg 1))) + (julian (if calc-gregorian-switch + (math-date-to-dt julianend)))) (if (and (>= day 0) (<= day 366)) - (let ((max (if (eq (car dt) 1752) 355 - (if (math-leap-year-p (car dt)) 366 365)))) + (let ((max (if (math-leap-year-p (car dt)) 366 365))) (if (or (= day 0) (> day max)) (setq day max)) - (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) - (1- day)))) + (if calc-gregorian-switch + ;; Now to break this down into cases + (cond + ((and (math-dt-before-p (list (car dt) 1 1) calc-gregorian-switch) + (math-dt-before-p julian (list (car dt) 1 1))) + ;; In this case, CALC-GREGORIAN-SWITCH is the first day of the year + (list 'date (math-min (math-add gregbeg (1- day)) + (math-dt-to-date (list (car calc-gregorian-switch) 12 31))))) + ((eq (car dt) (car julian)) + ;; In this case, the switch to the Gregorian calendar occurs in the given year + (if (Math-lessp (car julian) (car calc-gregorian-switch)) + ;; Here, the last Julian day is the last day of the year. + (list 'date (math-min (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day)) + julianend)) + ;; Otherwise, just make sure the date doesn't go past the end of the year + (list 'date (math-min (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day)) + (math-dt-to-date (list (car dt) 12 31)))))) + (t + (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) + (1- day))))) + (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) + (1- day))))) (if (and (>= day -12) (<= day -1)) - (list 'date (math-dt-to-date (list (car dt) (- day) 1))) - (math-reject-arg day 'range))))) + (if (and calc-gregorian-switch + (math-dt-before-p (list (car dt) (- day) 1) calc-gregorian-switch) + (math-dt-before-p julian (list (car dt) (- day) 1))) + (list 'date gregbeg) + (list 'date (math-dt-to-date (list (car dt) (- day) 1)))) + (math-reject-arg day 'range))))) (defun calcFunc-incmonth (date &optional step) (or step (setq step 1)) === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-10-06 20:30:26 +0000 +++ lisp/calc/calc.el 2012-11-17 21:30:43 +0000 @@ -464,6 +464,50 @@ :type 'string :group 'calc) +;; Dates that are built-in options for `calc-gregorian-switch' should be +;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed. +(defcustom calc-gregorian-switch nil + "The first day the Gregorian calendar is used by Calc's date forms. +This is `nil' (the default) if the Gregorian calendar is the only one used. +Otherwise, it should be a list `(YEAR MONTH DAY)' when Calc begins to use +the Gregorian calendar; Calc will use the Julian calendar for earlier dates. +The dates in which different regions of the world began to use the +Gregorian calendar vary quite a bit, even within a single country. +If you want Calc's date forms to switch between the Julian and +Gregorian calendar, you can specify the date or choose from several +common choices. Some of these choices should be taken with a grain +of salt; for example different parts of France changed calendars at +different times, and Sweden's change to the Gregorian calendar was +complicated. Also, the boundaries of the countries were different at +the times of the calendar changes than they are now. +The Vatican decided that the Gregorian calendar should take effect +on 15 October 1582 (Gregorian), and many Catholic countries made +the change then. Great Britian and its colonies had the Gregorian +calendar take effect on 14 September 1752 (Gregorian); this includes +the United States." + :group 'calc + :version "24.4" + :type '(choice (const :tag "Always use the Gregorian calendar" nil) + (const :tag "Great Britian and the US (1752 9 14)" (1752 9 14 639797)) + (const :tag "Vatican (1582 10 15)" (1582 10 15 577736)) + (const :tag "Czechoslovakia (1584 1 17)" (1584 1 17 578195)) + (const :tag "Denmark (1700 3 1)" (1700 3 1 620607)) + (const :tag "France (1582 12 20)" (1582 12 20 577802)) + (const :tag "Hungary (1587 11 1)" (1587 11 1 579579)) + (const :tag "Luxemburg (1582 12 25)" (1582 12 25 577807)) + (const :tag "Romania (1919 4 14)" (1919 4 14 700638)) + (const :tag "Russia (1918 2 14)" (1918 2 14 700214)) + (const :tag "Sweden (1753 3 1)" (1753 3 1 639965)) + (const :tag "Switzerland (Catholic) (1584 1 22)" (1584 1 22 578200)) + (const :tag "Switzerland (Protestant) (1701 1 12)" (1701 1 12 620924)) + (list :tag "(YEAR MONTH DAY)" + (integer :tag "Year") + (integer :tag "Month (integer)") + (integer :tag "Day"))) + :set (lambda (symbol value) + (set-default symbol value) + (setq math-format-date-cache nil))) + (defface calc-nonselected-face '((t :inherit shadow :slant italic)) ------------------------------------------------------------ revno: 110926 fixes bug: http://debbugs.gnu.org/12914 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-11-17 22:41:21 +0200 message: Fix bug #12914 with drag-n-drop in native MS-Windows build. lisp/term/w32-win.el (w32-handle-dropped-file): Use 'file://' only on Cygwin; otherwise use 'file:'. (cygwin-convert-path-from-windows): Declare, to avoid byte-compiler warnings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-17 07:15:23 +0000 +++ lisp/ChangeLog 2012-11-17 20:41:21 +0000 @@ -1,3 +1,10 @@ +2012-11-17 Eli Zaretskii + + * term/w32-win.el (w32-handle-dropped-file): Use 'file://' only on + Cygwin; otherwise use 'file:'. (Bug#12914) + (cygwin-convert-path-from-windows): Declare, to avoid + byte-compiler warnings. + 2012-11-17 Andreas Politz * ibuffer.el (ibuffer-mark-forward, ibuffer-unmark-forward) === modified file 'lisp/term/w32-win.el' --- lisp/term/w32-win.el 2012-11-15 23:28:27 +0000 +++ lisp/term/w32-win.el 2012-11-17 20:41:21 +0000 @@ -91,6 +91,9 @@ (declare-function w32-send-sys-command "w32fns.c") (declare-function set-message-beep "w32fns.c") +(declare-function cygwin-convert-path-from-windows "cygw32.c" + (path absolute_p)) + ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles (if (fboundp 'new-fontset) (require 'fontset)) @@ -116,7 +119,11 @@ "/") "/"))) (dnd-handle-one-url window 'private - (concat "file://" file-name))) + (concat + (if (eq system-type 'cygwin) + "file://" + "file:") + file-name))) (defun w32-drag-n-drop (event &optional new-frame) "Edit the files listed in the drag-n-drop EVENT. ------------------------------------------------------------ revno: 110925 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-11-17 11:01:09 -0800 message: Relocate NEWS entry to correct section diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-11-16 18:54:42 +0000 +++ etc/NEWS 2012-11-17 19:01:09 +0000 @@ -61,6 +61,11 @@ * Changes in Emacs 24.4 on non-free operating systems ++++ +** The "generate a backtrace on fatal error" feature now works on MS Windows. +The backtrace is written to the 'emacs_backtrace.txt' file in the +directory where Emacs was running. + * Installation Changes in Emacs 24.3 @@ -210,9 +215,7 @@ ** Emacs now generates backtraces on fatal errors. On encountering a fatal error, Emacs now outputs a textual description of the fatal signal, and a short backtrace on platforms like glibc -that support backtraces, and also on MS-Windows. On Windows, the -backtrace is also written to the 'emacs_backtrace.txt' file in the -directory where Emacs was running. +that support backtraces. --- ** If your Emacs was built from a bzr checkout, the new variable ------------------------------------------------------------ revno: 110924 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-11-17 10:30:16 -0800 message: Update comment to match recent change. diff: === modified file 'src/process.c' --- src/process.c 2012-11-17 16:46:45 +0000 +++ src/process.c 2012-11-17 18:30:16 +0000 @@ -6283,8 +6283,8 @@ { #ifdef SIGCHLD - /* On POSIXish hosts, record at most one child only if we already - know one child that has exited. */ + /* Record at most one child only if we already know one child that + has exited. */ bool record_at_most_one_child = 0 <= pid; Lisp_Object tail; ------------------------------------------------------------ revno: 110923 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-11-17 18:52:48 +0200 message: Fix MS-Windows emulation of 'faccessat' wrt directories. src/w32.c (faccessat): Pretend that directories have the execute bit set. Emacs expects that, e.g., in files.el:cd-absolute. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-17 16:46:45 +0000 +++ src/ChangeLog 2012-11-17 16:52:48 +0000 @@ -1,5 +1,8 @@ 2012-11-17 Eli Zaretskii + * w32.c (faccessat): Pretend that directories have the execute bit + set. Emacs expects that, e.g., in files.el:cd-absolute. + * w32proc.c (create_child): Don't clip the PID of the child process to fit into an Emacs integer, as this is no longer a restriction. === modified file 'src/w32.c' --- src/w32.c 2012-11-14 17:22:55 +0000 +++ src/w32.c 2012-11-17 16:52:48 +0000 @@ -2762,7 +2762,8 @@ } return -1; } - if ((mode & X_OK) != 0 && !is_exec (path)) + if ((mode & X_OK) != 0 + && !(is_exec (path) || (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0)) { errno = EACCES; return -1; ------------------------------------------------------------ revno: 110922 fixes bug: http://debbugs.gnu.org/12829 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-11-17 18:46:45 +0200 message: Fix bug #12829 with aborts on MS-Windows when several child processes die. nt/inc/sys/wait.h: New file, with prototype of waitpid and definitions of macros it needs. nt/inc/ms-w32.h (wait): Don't define, 'wait' is not used anymore. (sys_wait): Remove prototype. nt/config.nt (HAVE_SYS_WAIT_H): Define to 1. src/w32proc.c (create_child): Don't clip the PID of the child process to fit into an Emacs integer, as this is no longer a restriction. (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by reaping only the process specified by PID argument, if that is positive. Use PID instead of dead_child to know which process to reap. Wait for the child to die only if WNOHANG is not in OPTIONS. (sys_select): Don't set dead_child. src/sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion, as it is no longer needed. src/process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions, no longer needed. (record_child_status_change): Remove the setting of record_at_most_one_child for the !WNOHANG case. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-17 08:55:07 +0000 +++ nt/ChangeLog 2012-11-17 16:46:45 +0000 @@ -1,3 +1,13 @@ +2012-11-17 Eli Zaretskii + + * inc/sys/wait.h: New file, with prototype of waitpid and + definitions of macros it needs. + + * inc/ms-w32.h (wait): Don't define, 'wait' is not used anymore. + (sys_wait): Remove prototype. + + * config.nt (HAVE_SYS_WAIT_H): Define to 1. + 2012-11-17 Dani Moncayo * zipdist.bat (ZIP_CHECK): Remove unused label. When invoking 7z === modified file 'nt/config.nt' --- nt/config.nt 2012-11-15 14:47:31 +0000 +++ nt/config.nt 2012-11-17 16:46:45 +0000 @@ -986,7 +986,7 @@ #undef HAVE_SYS_VLIMIT_H /* Define to 1 if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H +#define HAVE_SYS_WAIT_H 1 /* Define to 1 if you have the header file. */ #undef HAVE_TERM_H === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2012-11-14 17:22:55 +0000 +++ nt/inc/ms-w32.h 2012-11-17 16:46:45 +0000 @@ -183,15 +183,12 @@ /* Subprocess calls that are emulated. */ #define spawnve sys_spawnve -#define wait sys_wait #define kill sys_kill #define signal sys_signal /* Internal signals. */ #define emacs_raise(sig) emacs_abort() -extern int sys_wait (int *); - /* termcap.c calls that are emulated. */ #define tputs sys_tputs #define tgetstr sys_tgetstr === added file 'nt/inc/sys/wait.h' --- nt/inc/sys/wait.h 1970-01-01 00:00:00 +0000 +++ nt/inc/sys/wait.h 2012-11-17 16:46:45 +0000 @@ -0,0 +1,33 @@ +/* A limited emulation of sys/wait.h on Posix systems. + +Copyright (C) 2012 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs 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. + +GNU Emacs 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 GNU Emacs. If not, see . */ + +#ifndef INC_SYS_WAIT_H_ +#define INC_SYS_WAIT_H_ + +#define WNOHANG 1 +#define WUNTRACED 2 +#define WSTOPPED 2 /* same as WUNTRACED */ +#define WEXITED 4 +#define WCONTINUED 8 + +/* The various WIF* macros are defined in src/syswait.h. */ + +extern pid_t waitpid (pid_t, int *, int); + +#endif /* INC_SYS_WAIT_H_ */ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-17 15:15:49 +0000 +++ src/ChangeLog 2012-11-17 16:46:45 +0000 @@ -1,3 +1,23 @@ +2012-11-17 Eli Zaretskii + + * w32proc.c (create_child): Don't clip the PID of the child + process to fit into an Emacs integer, as this is no longer a + restriction. + (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by + reaping only the process specified by PID argument, if that is + positive. Use PID instead of dead_child to know which process to + reap. Wait for the child to die only if WNOHANG is not in + OPTIONS. + (sys_select): Don't set dead_child. + + * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion, + as it is no longer needed. + + * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions, + no longer needed. + (record_child_status_change): Remove the setting of + record_at_most_one_child for the !WNOHANG case. + 2012-11-17 Paul Eggert Fix problems in ns port found by static checking. === modified file 'src/process.c' --- src/process.c 2012-11-16 15:29:22 +0000 +++ src/process.c 2012-11-17 16:46:45 +0000 @@ -130,18 +130,6 @@ EMACS_TIME *, void *); #endif -/* This is for DOS_NT ports. FIXME: Remove this old portability cruft - by having DOS_NT ports implement waitpid instead of wait. Nowadays - POSIXish hosts all define waitpid, WNOHANG, and WUNTRACED, as these - have been standard since POSIX.1-1988. */ -#ifndef WNOHANG -# undef waitpid -# define waitpid(pid, status, options) wait (status) -#endif -#ifndef WUNTRACED -# define WUNTRACED 0 -#endif - /* Work around GCC 4.7.0 bug with strict overflow checking; see . These lines can be removed once the GCC bug is fixed. */ @@ -6295,17 +6283,9 @@ { #ifdef SIGCHLD -# ifdef WNOHANG /* On POSIXish hosts, record at most one child only if we already know one child that has exited. */ bool record_at_most_one_child = 0 <= pid; -# else - /* On DOS_NT (the only porting target that lacks WNOHANG), - record the status of at most one child process, since the SIGCHLD - handler must return right away. If any more processes want to - signal us, we will get another signal. */ - bool record_at_most_one_child = 1; -# endif Lisp_Object tail; === modified file 'src/sysdep.c' --- src/sysdep.c 2012-11-14 04:55:41 +0000 +++ src/sysdep.c 2012-11-17 16:46:45 +0000 @@ -289,10 +289,6 @@ { while (1) { -#ifdef WINDOWSNT - wait (0); - break; -#else /* not WINDOWSNT */ int status; int wait_result = waitpid (pid, &status, 0); if (wait_result < 0) @@ -306,7 +302,8 @@ break; } -#endif /* not WINDOWSNT */ + /* Note: the MS-Windows emulation of waitpid calls QUIT + internally. */ if (interruptible) QUIT; } === modified file 'src/w32proc.c' --- src/w32proc.c 2012-11-16 17:20:23 +0000 +++ src/w32proc.c 2012-11-17 16:46:45 +0000 @@ -789,7 +789,6 @@ /* Child process management list. */ int child_proc_count = 0; child_process child_procs[ MAX_CHILDREN ]; -child_process *dead_child = NULL; static DWORD WINAPI reader_thread (void *arg); @@ -1042,9 +1041,6 @@ if (cp->pid < 0) cp->pid = -cp->pid; - /* pid must fit in a Lisp_Int */ - cp->pid = cp->pid & INTMASK; - *pPid = cp->pid; return TRUE; @@ -1120,55 +1116,110 @@ delete_child (cp); } -/* Wait for any of our existing child processes to die - When it does, close its handle - Return the pid and fill in the status if non-NULL. */ +/* Wait for a child process specified by PID, or for any of our + existing child processes (if PID is nonpositive) to die. When it + does, close its handle. Return the pid of the process that died + and fill in STATUS if non-NULL. */ -int -sys_wait (int *status) +pid_t +waitpid (pid_t pid, int *status, int options) { DWORD active, retval; int nh; - int pid; child_process *cp, *cps[MAX_CHILDREN]; HANDLE wait_hnd[MAX_CHILDREN]; + DWORD timeout_ms; + int dont_wait = (options & WNOHANG) != 0; nh = 0; - if (dead_child != NULL) - { - /* We want to wait for a specific child */ - wait_hnd[nh] = dead_child->procinfo.hProcess; - cps[nh] = dead_child; - if (!wait_hnd[nh]) emacs_abort (); - nh++; - active = 0; - goto get_result; - } - else - { - for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) - /* some child_procs might be sockets; ignore them */ - if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess - && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0)) - { - wait_hnd[nh] = cp->procinfo.hProcess; - cps[nh] = cp; - nh++; - } - } - - if (nh == 0) - { - /* Nothing to wait on, so fail */ - errno = ECHILD; - return -1; - } + /* According to Posix: + + PID = -1 means status is requested for any child process. + + PID > 0 means status is requested for a single child process + whose pid is PID. + + PID = 0 means status is requested for any child process whose + process group ID is equal to that of the calling process. But + since Windows has only a limited support for process groups (only + for console processes and only for the purposes of passing + Ctrl-BREAK signal to them), and since we have no documented way + of determining whether a given process belongs to our group, we + treat 0 as -1. + + PID < -1 means status is requested for any child process whose + process group ID is equal to the absolute value of PID. Again, + since we don't support process groups, we treat that as -1. */ + if (pid > 0) + { + int our_child = 0; + + /* We are requested to wait for a specific child. */ + for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) + { + /* Some child_procs might be sockets; ignore them. Also + ignore subprocesses whose output is not yet completely + read. */ + if (CHILD_ACTIVE (cp) + && cp->procinfo.hProcess + && cp->pid == pid) + { + our_child = 1; + break; + } + } + if (our_child) + { + if (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0) + { + wait_hnd[nh] = cp->procinfo.hProcess; + cps[nh] = cp; + nh++; + } + else if (dont_wait) + { + /* PID specifies our subprocess, but its status is not + yet available. */ + return 0; + } + } + if (nh == 0) + { + /* No such child process, or nothing to wait for, so fail. */ + errno = ECHILD; + return -1; + } + } + else + { + for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) + { + if (CHILD_ACTIVE (cp) + && cp->procinfo.hProcess + && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0)) + { + wait_hnd[nh] = cp->procinfo.hProcess; + cps[nh] = cp; + nh++; + } + } + if (nh == 0) + { + /* Nothing to wait on, so fail. */ + errno = ECHILD; + return -1; + } + } + + if (dont_wait) + timeout_ms = 0; + else + timeout_ms = 1000; /* check for quit about once a second. */ do { - /* Check for quit about once a second. */ QUIT; - active = WaitForMultipleObjects (nh, wait_hnd, FALSE, 1000); + active = WaitForMultipleObjects (nh, wait_hnd, FALSE, timeout_ms); } while (active == WAIT_TIMEOUT); if (active == WAIT_FAILED) @@ -1198,8 +1249,10 @@ } if (retval == STILL_ACTIVE) { - /* Should never happen */ + /* Should never happen. */ DebPrint (("Wait.WaitForMultipleObjects returned an active process\n")); + if (pid > 0 && dont_wait) + return 0; errno = EINVAL; return -1; } @@ -1213,6 +1266,8 @@ else retval <<= 8; + if (pid > 0 && active != 0) + emacs_abort (); cp = cps[active]; pid = cp->pid; #ifdef FULL_DEBUG @@ -2001,9 +2056,7 @@ DebPrint (("select calling SIGCHLD handler for pid %d\n", cp->pid)); #endif - dead_child = cp; sig_handlers[SIGCHLD] (SIGCHLD); - dead_child = NULL; } } else if (fdindex[active] == -1) ------------------------------------------------------------ revno: 110921 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-11-17 07:15:49 -0800 message: Fix problems in ns port found by static checking. * nsterm.m: Include , for pthread_mutex_lock etc. (hold_event, setPosition:portion:whole:): Send SIGIO only to self, not to process group. (ns_select): Use emacs_write, not write, as that's more robust in the presence of signals. (fd_handler:): Check for read errors. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-16 17:20:23 +0000 +++ src/ChangeLog 2012-11-17 15:15:49 +0000 @@ -1,3 +1,13 @@ +2012-11-17 Paul Eggert + + Fix problems in ns port found by static checking. + * nsterm.m: Include , for pthread_mutex_lock etc. + (hold_event, setPosition:portion:whole:): Send SIGIO only to self, + not to process group. + (ns_select): Use emacs_write, not write, as that's more robust + in the presence of signals. + (fd_handler:): Check for read errors. + 2012-11-16 Glenn Morris * editfns.c (Fmessage): Mention message-log-max. (Bug#12849) === modified file 'src/nsterm.m' --- src/nsterm.m 2012-11-16 17:20:23 +0000 +++ src/nsterm.m 2012-11-17 15:15:49 +0000 @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -331,7 +332,7 @@ hold_event_q.q[hold_event_q.nr++] = *event; /* Make sure ns_read_socket is called, i.e. we have input. */ - kill (0, SIGIO); + raise (SIGIO); } static Lisp_Object @@ -3389,7 +3390,7 @@ if ([NSApp modalWindow] != nil) return -1; - if (hold_event_q.nr > 0) + if (hold_event_q.nr > 0) { int i; for (i = 0; i < hold_event_q.nr; ++i) @@ -3504,7 +3505,7 @@ /* Inform fd_handler that select should be called */ c = 'g'; - write (selfds[1], &c, 1); + emacs_write (selfds[1], &c, 1); } else if (nr == 0 && timeout) { @@ -3537,7 +3538,7 @@ if (nr > 0 && readfds) { c = 's'; - write (selfds[1], &c, 1); + emacs_write (selfds[1], &c, 1); } unblock_input (); @@ -4576,11 +4577,8 @@ FD_SET (selfds[0], &fds); result = select (selfds[0]+1, &fds, NULL, NULL, NULL); - if (result > 0) - { - read (selfds[0], &c, 1); - if (c == 'g') waiting = 0; - } + if (result > 0 && read (selfds[0], &c, 1) == 1 && c == 'g') + waiting = 0; } else { @@ -4620,8 +4618,8 @@ { if (FD_ISSET (selfds[0], &readfds)) { - read (selfds[0], &c, 1); - if (c == 's') waiting = 1; + if (read (selfds[0], &c, 1) == 1 && c == 's') + waiting = 1; } else { @@ -6696,7 +6694,7 @@ /* Events may come here even if the event loop is not running. If we don't enter the event loop, the scroll bar will not update. So send SIGIO to ourselves. */ - if (apploopnr == 0) kill (0, SIGIO); + if (apploopnr == 0) raise (SIGIO); return self; } ------------------------------------------------------------ revno: 110920 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-11-17 06:20:58 -0500 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2012-11-16 17:20:23 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2012-11-17 11:20:58 +0000 @@ -267,7 +267,7 @@ ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "887ee7c4b9eb5766c6483d27e84aac21") +;;;;;; "cl-macs" "cl-macs.el" "a7d9b56ea588b869813de8ed7ec1fbcd") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ @@ -416,7 +416,7 @@ (put 'cl-return-from 'lisp-indent-function '1) (autoload 'cl-loop "cl-macs" "\ -The Common Lisp `cl-loop' macro. +The Common Lisp `loop' macro. Valid clauses are: for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM, for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR, @@ -432,14 +432,14 @@ \(fn CLAUSE...)" nil t) (autoload 'cl-do "cl-macs" "\ -The Common Lisp `cl-do' loop. +The Common Lisp `do' loop. \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) (put 'cl-do 'lisp-indent-function '2) (autoload 'cl-do* "cl-macs" "\ -The Common Lisp `cl-do*' loop. +The Common Lisp `do*' loop. \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) @@ -501,7 +501,7 @@ (put 'cl-progv 'lisp-indent-function '2) (autoload 'cl-flet "cl-macs" "\ -Make temporary function definitions. +Make local function definitions. Like `cl-labels' but the definitions are not recursive. \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) @@ -509,7 +509,7 @@ (put 'cl-flet 'lisp-indent-function '1) (autoload 'cl-flet* "cl-macs" "\ -Make temporary function definitions. +Make local function definitions. Like `cl-flet' but the definitions can refer to previous ones. \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) ------------------------------------------------------------ revno: 110919 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-11-17 06:17:40 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-11-14 11:17:36 +0000 +++ autogen/config.in 2012-11-17 11:17:40 +0000 @@ -375,9 +375,6 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK -/* Define to 1 if you have the `fpathconf' function. */ -#undef HAVE_FPATHCONF - /* Define to 1 if you have the `freeifaddrs' function. */ #undef HAVE_FREEIFADDRS === modified file 'autogen/configure' --- autogen/configure 2012-11-14 11:17:36 +0000 +++ autogen/configure 2012-11-17 11:17:40 +0000 @@ -13449,7 +13449,7 @@ for ac_func in gethostname \ closedir getrusage get_current_dir_name \ lrand48 \ -fpathconf select getpagesize setlocale \ +select getpagesize setlocale \ utimes getrlimit setrlimit getcwd shutdown getaddrinfo \ strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ ------------------------------------------------------------ revno: 110918 author: Dani Moncayo committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-11-17 10:55:07 +0200 message: Don't produce "barebin" zip file as part of MS-Windows distributions. nt/zipdist.bat (ZIP_CHECK): Remove unused label. When invoking 7z to check if it's installed, redirect standard output and standard error to the null device. (ZIP_DIST): Don't build the "barebin" distribution. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-15 14:47:31 +0000 +++ nt/ChangeLog 2012-11-17 08:55:07 +0000 @@ -1,3 +1,10 @@ +2012-11-17 Dani Moncayo + + * zipdist.bat (ZIP_CHECK): Remove unused label. When invoking 7z + to check if it's installed, redirect standard output and standard + error to the null device. + (ZIP_DIST): Don't build the "barebin" distribution. + 2012-11-15 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/zipdist.bat' --- nt/zipdist.bat 2012-01-05 09:46:05 +0000 +++ nt/zipdist.bat 2012-11-17 08:55:07 +0000 @@ -25,9 +25,8 @@ set TMP_DIST_DIR=emacs-%EMACS_VER% rem Check, if 7zip is installed and available on path -:ZIP_CHECK -7z -if %ERRORLEVEL% NEQ 0 goto :ZIP_ERROR +7z 1>NUL 2>NUL +if %ERRORLEVEL% NEQ 0 goto ZIP_ERROR goto ZIP_DIST :ZIP_ERROR @@ -35,14 +34,10 @@ echo ERROR: Make sure 7zip is installed and available on the Windows Path! goto EXIT -rem Build distributions +rem Build and verify the binary distribution :ZIP_DIST -rem Build and verify full distribution 7z a -bd -tZIP -mx=9 -x!.bzrignore -x!.gitignore -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory emacs-%EMACS_VER%-bin-i386.zip %TMP_DIST_DIR% 7z t emacs-%EMACS_VER%-bin-i386.zip -rem Build and verify binary only distribution -7z a -bd -tZIP -mx=9 -x!.bzrignore -x!.gitignore -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory emacs-%EMACS_VER%-barebin-i386.zip %TMP_DIST_DIR%/README.W32 %TMP_DIST_DIR%/bin %TMP_DIST_DIR%/etc/DOC-X %TMP_DIST_DIR%/COPYING -7z t emacs-%EMACS_VER%-barebin-i386.zip goto EXIT :EXIT ------------------------------------------------------------ revno: 110917 fixes bug: http://debbugs.gnu.org/12795 author: Andreas Politz committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-11-17 15:15:23 +0800 message: Fix prefix arg handling in ibuffer marking commands. * ibuffer.el (ibuffer-mark-forward, ibuffer-unmark-forward) (ibuffer-unmark-backward, ibuffer-mark-interactive): Support plain prefix and negative numeric prefix args. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-17 07:00:35 +0000 +++ lisp/ChangeLog 2012-11-17 07:15:23 +0000 @@ -1,3 +1,9 @@ +2012-11-17 Andreas Politz + + * ibuffer.el (ibuffer-mark-forward, ibuffer-unmark-forward) + (ibuffer-unmark-backward, ibuffer-mark-interactive): Support plain + prefix and negative numeric prefix args (Bug#12795). + 2012-11-17 Stephen Berman * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1): === modified file 'lisp/ibuffer.el' --- lisp/ibuffer.el 2012-11-11 02:22:26 +0000 +++ lisp/ibuffer.el 2012-11-17 07:15:23 +0000 @@ -1362,24 +1362,27 @@ (defun ibuffer-mark-forward (arg) "Mark the buffer on this line, and move forward ARG lines. If point is on a group name, this function operates on that group." - (interactive "P") - (ibuffer-mark-interactive arg ibuffer-marked-char 1)) + (interactive "p") + (ibuffer-mark-interactive arg ibuffer-marked-char)) (defun ibuffer-unmark-forward (arg) "Unmark the buffer on this line, and move forward ARG lines. If point is on a group name, this function operates on that group." - (interactive "P") - (ibuffer-mark-interactive arg ?\s 1)) + (interactive "p") + (ibuffer-mark-interactive arg ?\s)) (defun ibuffer-unmark-backward (arg) "Unmark the buffer on this line, and move backward ARG lines. If point is on a group name, this function operates on that group." - (interactive "P") - (ibuffer-mark-interactive arg ?\s -1)) + (interactive "p") + (ibuffer-unmark-forward (- arg))) -(defun ibuffer-mark-interactive (arg mark movement) +(defun ibuffer-mark-interactive (arg mark &optional movement) (ibuffer-assert-ibuffer-mode) (or arg (setq arg 1)) + ;; deprecated movement argument + (when (and movement (< movement 0)) + (setq arg (- arg))) (ibuffer-forward-line 0) (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name) (progn @@ -1389,8 +1392,12 @@ (let ((inhibit-read-only t)) (while (> arg 0) (ibuffer-set-mark mark) - (ibuffer-forward-line movement t) - (setq arg (1- arg)))))) + (ibuffer-forward-line 1 t) + (setq arg (1- arg))) + (while (< arg 0) + (ibuffer-forward-line -1 t) + (ibuffer-set-mark mark) + (setq arg (1+ arg)))))) (defun ibuffer-set-mark (mark) (ibuffer-assert-ibuffer-mode) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.