Now on revision 110998. 1 tag(s) updated. ------------------------------------------------------------ revno: 110998 committer: Bill Wohler branch nick: trunk timestamp: Fri 2012-11-23 23:13:44 -0800 message: Use ~ instead of /home/user. Use mformat instead of obsolete vfolder_format. diff: === modified file 'doc/misc/mh-e.texi' --- doc/misc/mh-e.texi 2012-10-23 15:06:07 +0000 +++ doc/misc/mh-e.texi 2012-11-24 07:13:44 +0000 @@ -6966,23 +6966,22 @@ @cindex @command{mairix} @cindex Unix commands, @command{mairix} -In the examples below, replace @file{/home/user/Mail} with the path to -your MH directory. +In the examples below, replace @file{~/Mail} with the path to your MH +directory. -First create the directory @file{/home/user/Mail/.mairix}. Then create -the file @file{/home/user/Mail/.mairix/config} with the following -contents: +First create the directory @file{~/Mail/.mairix}. Then create the file +@file{~/Mail/.mairix/config} with the following contents: @smallexample @group -base=/home/user/Mail +base=~/Mail # List of folders that should be indexed. 3 dots at the end means there # are subfolders within the folder mh=archive...:inbox:drafts:news:sent:trash -vfolder_format=mh -database=/home/user/Mail/.mairix/database +mformat=mh +database=~/Mail/.mairix/database @end group @end smallexample @@ -6990,7 +6989,7 @@ from cron: @smallexample -mairix -f /home/user/Mail/.mairix/config +mairix -f ~/Mail/.mairix/config @end smallexample @subsection namazu ------------------------------------------------------------ revno: 110997 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-11-23 22:50:44 -0800 message: * loading.texi (Named Features): @ -> @@ to fix typo. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-11-24 01:57:09 +0000 +++ doc/lispref/ChangeLog 2012-11-24 06:50:44 +0000 @@ -1,3 +1,7 @@ +2012-11-24 Paul Eggert + + * loading.texi (Named Features): @ -> @@ to fix typo. + 2012-11-24 Martin Rudalics * windows.texi (Basic Windows): Fix typo. === modified file 'doc/lispref/loading.texi' --- doc/lispref/loading.texi 2012-11-18 01:38:42 +0000 +++ doc/lispref/loading.texi 2012-11-24 06:50:44 +0000 @@ -729,7 +729,7 @@ (defun idlwave-complete-filename () "Use the comint stuff to complete a file name." (require 'comint) - (let* ((comint-file-name-chars "~/A-Za-z0-9+@:_.$#%=@{@}\\-") + (let* ((comint-file-name-chars "~/A-Za-z0-9+@@:_.$#%=@{@}\\-") (comint-completion-addsuffix nil) ...) (comint-dynamic-complete-filename))) ------------------------------------------------------------ revno: 110996 fixes bug: http://debbugs.gnu.org/12952 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-11-24 11:46:29 +0800 message: Fix dependency sorting in custom-theme-set-variables. * lisp/custom.el (custom-theme-set-variables): Use a topological sort for ordering by custom dependencies. (custom--sort-vars, custom--sort-vars-1): New functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-24 01:57:09 +0000 +++ lisp/ChangeLog 2012-11-24 03:46:29 +0000 @@ -1,3 +1,9 @@ +2012-11-24 Chong Yidong + + * custom.el (custom-theme-set-variables): Use a topological sort + for ordering by custom dependencies (Bug#12952). + (custom--sort-vars, custom--sort-vars-1): New functions. + 2012-11-24 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-file): Setup default value for === modified file 'lisp/custom.el' --- lisp/custom.el 2012-09-28 12:18:38 +0000 +++ lisp/custom.el 2012-11-24 03:46:29 +0000 @@ -948,7 +948,6 @@ COMMENT is a comment string about SYMBOL." (custom-check-theme theme) - ;; Process all the needed autoloads before anything else, so that the ;; subsequent code has all the info it needs (e.g. which var corresponds ;; to a minor mode), regardless of the ordering of the variables. @@ -958,29 +957,7 @@ (memq (get symbol 'custom-autoload) '(nil noset))) ;; This symbol needs to be autoloaded, even just for a `set'. (custom-load-symbol symbol)))) - - ;; Move minor modes and variables with explicit requires to the end. - (setq args - (sort args - (lambda (a1 a2) - (let* ((sym1 (car a1)) - (sym2 (car a2)) - (1-then-2 (memq sym1 (get sym2 'custom-dependencies))) - (2-then-1 (memq sym2 (get sym1 'custom-dependencies)))) - (cond ((and 1-then-2 2-then-1) - (error "Circular custom dependency between `%s' and `%s'" - sym1 sym2)) - (2-then-1 nil) - ;; 1 is a dependency of 2, so needs to be set first. - (1-then-2) - ;; Put minor modes and symbols with :require last. - ;; Putting minor modes last ensures that the mode - ;; function will see other customized values rather - ;; than default values. - (t (or (nth 3 a2) - (eq (get sym2 'custom-set) - 'custom-set-minor-mode)))))))) - + (setq args (custom--sort-vars args)) (dolist (entry args) (unless (listp entry) (error "Incompatible Custom theme spec")) @@ -1014,6 +991,60 @@ (and (or now (default-boundp symbol)) (put symbol 'variable-comment comment))))))) +(defvar custom--sort-vars-table) +(defvar custom--sort-vars-result) + +(defun custom--sort-vars (vars) + "Sort VARS based on custom dependencies. +VARS is a list whose elements have the same form as the ARGS +arguments to `custom-theme-set-variables'. Return the sorted +list, in which A occurs before B if B was defined with a +`:set-after' keyword specifying A (see `defcustom')." + (let ((custom--sort-vars-table (make-hash-table)) + (dependants (make-hash-table)) + (custom--sort-vars-result nil) + last) + ;; Construct a pair of tables keyed with the symbols of VARS. + (dolist (var vars) + (puthash (car var) (cons t var) custom--sort-vars-table) + (puthash (car var) var dependants)) + ;; From the second table, remove symbols that are depended-on. + (dolist (var vars) + (dolist (dep (get (car var) 'custom-dependencies)) + (remhash dep dependants))) + ;; If a variable is "stand-alone", put it last if it's a minor + ;; mode or has a :require flag. This is not really necessary, but + ;; putting minor modes last helps ensure that the mode function + ;; sees other customized values rather than default values. + (maphash (lambda (sym var) + (when (and (null (get sym 'custom-dependencies)) + (or (nth 3 var) + (eq (get sym 'custom-set) + 'custom-set-minor-mode))) + (remhash sym dependants) + (push var last))) + dependants) + ;; The remaining symbols depend on others but are not + ;; depended-upon. Do a depth-first topological sort. + (maphash #'custom--sort-vars-1 dependants) + (nreverse (append last custom--sort-vars-result)))) + +(defun custom--sort-vars-1 (sym &optional _ignored) + (let ((elt (gethash sym custom--sort-vars-table))) + ;; The car of the hash table value is nil if the variable has + ;; already been processed, `dependant' if it is a dependant in the + ;; current graph descent, and t otherwise. + (when elt + (cond + ((eq (car elt) 'dependant) + (error "Circular custom dependency on `%s'" sym)) + ((car elt) + (setcar elt 'dependant) + (dolist (dep (get sym 'custom-dependencies)) + (custom--sort-vars-1 dep)) + (setcar elt nil) + (push (cdr elt) custom--sort-vars-result)))))) + ;;; Defining themes. ------------------------------------------------------------ revno: 110995 [merge] committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-11-23 17:57:09 -0800 message: Merge from emacs-24; up to r110946 diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-11-21 08:39:08 +0000 +++ doc/lispref/ChangeLog 2012-11-24 01:57:09 +0000 @@ -1,3 +1,30 @@ +2012-11-24 Martin Rudalics + + * windows.texi (Basic Windows): Fix typo. + (Windows and Frames): Fix example. Move description of + window-in-direction here. + (Recombining Windows): Fix example. + (Buffers and Windows): Fix description of + replace-buffer-in-windows. + (Switching Buffers): Reword. + (Display Action Functions): Minor adjustments. + (Choosing Window Options): Minor fixes. + (Window History): Minor rewording. + (Dedicated Windows): Correct and reword part describing how + dedicatedness affects functions removing buffers or windows. + * buffers.texi (The Buffer List): Fix description of + bury-buffer. + +2012-11-24 Chong Yidong + + * modes.texi (%-Constructs): Fix statement about mode construct + padding (Bug#12866). + +2012-11-24 Stefan Monnier + + * debugging.texi (Profiling): Make it more clear + that --enable-profiling is about profiling the C code. + 2012-11-21 Glenn Morris * display.texi (Attribute Functions): === modified file 'doc/lispref/buffers.texi' --- doc/lispref/buffers.texi 2012-10-24 05:12:23 +0000 +++ doc/lispref/buffers.texi 2012-11-23 14:39:07 +0000 @@ -886,7 +886,7 @@ @code{other-buffer} to return. The argument can be either a buffer itself or the name of one. -This functions operates on each frame's @code{buffer-list} parameter as +This function operates on each frame's @code{buffer-list} parameter as well as the fundamental buffer list; therefore, the buffer that you bury will come last in the value of @code{(buffer-list @var{frame})} and in the value of @code{(buffer-list)}. In addition, it also puts the buffer @@ -896,15 +896,15 @@ If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the current buffer. In addition, if the current buffer is displayed in the selected window, this makes sure that the window is either deleted or -another buffer is shown in it. More precisely, if the window is -dedicated (@pxref{Dedicated Windows}) and there are other windows on its -frame, the window is deleted. If the window is both dedicated and the -only window on its frame's terminal, the function specified by -@code{frame-auto-hide-function} (@pxref{Quitting Windows}) will deal -with the window. If the window is not dedicated to its buffer, it calls -@code{switch-to-prev-buffer} (@pxref{Window History}) to show another -buffer in that window. If @var{buffer-or-name} is displayed in some -other window, it remains displayed there. +another buffer is shown in it. More precisely, if the selected window +is dedicated (@pxref{Dedicated Windows}) and there are other windows on +its frame, the window is deleted. If it is the only window on its frame +and that frame is not the only frame on its terminal, the frame is +``dismissed'' by calling the function specified by +@code{frame-auto-hide-function} (@pxref{Quitting Windows}). Otherwise, +it calls @code{switch-to-prev-buffer} (@pxref{Window History}) to show +another buffer in that window. If @var{buffer-or-name} is displayed in +some other window, it remains displayed there. To replace a buffer in all the windows that display it, use @code{replace-buffer-in-windows}, @xref{Buffers and Windows}. === modified file 'doc/lispref/debugging.texi' --- doc/lispref/debugging.texi 2012-11-21 01:52:03 +0000 +++ doc/lispref/debugging.texi 2012-11-21 14:14:42 +0000 @@ -866,7 +866,7 @@ @c Not worth putting in the printed manual. @ifnottex @cindex --enable-profiling option of configure -For low-level profiling of Emacs itself, you can build it using the +To profile Emacs at the level of its C code, you can build it using the @option{--enable-profiling} option of @command{configure}. When Emacs exits, it generates a file @file{gmon.out} that you can examine using the @command{gprof} utility. This feature is mainly useful for === modified file 'doc/lispref/modes.texi' --- doc/lispref/modes.texi 2012-10-31 20:56:55 +0000 +++ doc/lispref/modes.texi 2012-11-23 08:32:43 +0000 @@ -2086,11 +2086,16 @@ @subsection @code{%}-Constructs in the Mode Line Strings used as mode line constructs can use certain -@code{%}-constructs to substitute various kinds of data. Here is a -list of the defined @code{%}-constructs, and what they mean. In any -construct except @samp{%%}, you can add a decimal integer after the -@samp{%} to specify a minimum field width. If the width is less, the -field is padded with spaces to the right. +@code{%}-constructs to substitute various kinds of data. The +following is a list of the defined @code{%}-constructs, and what they +mean. + + In any construct except @samp{%%}, you can add a decimal integer +after the @samp{%} to specify a minimum field width. If the width is +less, the field is padded to that width. Purely numeric constructs +(@samp{c}, @samp{i}, @samp{I}, and @samp{l}) are padded by inserting +spaces to the left, and others are padded by inserting spaces to the +right. @table @code @item %b === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2012-11-21 04:47:55 +0000 +++ doc/lispref/windows.texi 2012-11-24 01:57:09 +0000 @@ -51,9 +51,9 @@ @section Basic Concepts of Emacs Windows @cindex window -A @dfn{window} is a area of the screen that is used to display a -buffer (@pxref{Buffers}). In Emacs Lisp, windows are represented by a -special Lisp object type. +A @dfn{window} is an area of the screen that is used to display a buffer +(@pxref{Buffers}). In Emacs Lisp, windows are represented by a special +Lisp object type. @cindex multiple windows Windows are grouped into frames (@pxref{Frames}). Each frame @@ -247,12 +247,12 @@ @end smallexample @noindent -The root window of this frame is an internal window, @code{W1}. Its +The root window of this frame is an internal window, @var{W1}. Its child windows form a horizontal combination, consisting of the live -window @code{W2} and the internal window @code{W3}. The child windows -of @code{W3} form a vertical combination, consisting of the live -windows @code{W4} and @code{W5}. Hence, the live windows in this -window tree are @code{W2} @code{W4}, and @code{W5}. +window @var{W2} and the internal window @var{W3}. The child windows +of @var{W3} form a vertical combination, consisting of the live +windows @var{W4} and @var{W5}. Hence, the live windows in this +window tree are @var{W2} @var{W4}, and @var{W5}. The following functions can be used to retrieve a child window of an internal window, and the siblings of a child window. @@ -308,8 +308,8 @@ and previous window, respectively, in the cyclic ordering of windows (@pxref{Cyclic Window Ordering}). - You can use the following functions to find the first live window on -a frame, and to retrieve the entire window tree of a frame: + You can use the following functions to find the first live window on a +frame and the window nearest to a given window. @defun frame-first-window &optional frame-or-window This function returns the live window at the upper left corner of the @@ -318,8 +318,31 @@ to the selected frame. If @var{frame-or-window} specifies a window, this function returns the first window on that window's frame. Under the assumption that the frame from our canonical example is selected -@code{(frame-first-window)} returns @code{W2}. -@end defun +@code{(frame-first-window)} returns @var{W2}. +@end defun + +@cindex window in direction +@defun window-in-direction direction &optional window ignore +This function returns the nearest live window in direction +@var{direction} as seen from the position of @code{window-point} in +window @var{window}. The argument @var{direction} must be one of +@code{above}, @code{below}, @code{left} or @code{right}. The optional +argument @var{window} must denote a live window and defaults to the +selected one. + +This function does not return a window whose @code{no-other-window} +parameter is non-@code{nil} (@pxref{Window Parameters}). If the nearest +window's @code{no-other-window} parameter is non-@code{nil}, this +function tries to find another window in the indicated direction whose +@code{no-other-window} parameter is @code{nil}. If the optional +argument @var{ignore} is non-@code{nil}, a window may be returned even +if its @code{no-other-window} parameter is non-@code{nil}. + +If it doesn't find a suitable window, this function returns @code{nil}. +@end defun + +The following function allows to retrieve the entire window tree of a +frame: @defun window-tree &optional frame This function returns a list representing the window tree for frame @@ -925,9 +948,9 @@ @node Recombining Windows @section Recombining Windows -When deleting the last sibling of a window @code{W}, its parent window -is deleted too, with @code{W} replacing it in the window tree. This -means that @code{W} must be recombined with its parent's siblings to +When deleting the last sibling of a window @var{W}, its parent window +is deleted too, with @var{W} replacing it in the window tree. This +means that @var{W} must be recombined with its parent's siblings to form a new window combination (@pxref{Windows and Frames}). In some occasions, deleting a live window may even entail the deletion of two internal windows. @@ -952,20 +975,20 @@ @end smallexample @noindent -Deleting @code{W5} in this configuration normally causes the deletion of -@code{W3} and @code{W4}. The remaining live windows @code{W2}, -@code{W6} and @code{W7} are recombined to form a new horizontal -combination with parent @code{W1}. +Deleting @var{W5} in this configuration normally causes the deletion of +@var{W3} and @var{W4}. The remaining live windows @var{W2}, +@var{W6} and @var{W7} are recombined to form a new horizontal +combination with parent @var{W1}. Sometimes, however, it makes sense to not delete a parent window like -@code{W4}. In particular, a parent window should not be removed when it +@var{W4}. In particular, a parent window should not be removed when it was used to preserve a combination embedded in a combination of the same type. Such embeddings make sense to assure that when you split a window and subsequently delete the new window, Emacs reestablishes the layout of the associated frame as it existed before the splitting. - Consider a scenario starting with two live windows @code{W2} and -@code{W3} and their parent @code{W1}. + Consider a scenario starting with two live windows @var{W2} and +@var{W3} and their parent @var{W1}. @smallexample @group @@ -988,7 +1011,7 @@ @end smallexample @noindent -Split @code{W2} to make a new window @code{W4} as follows. +Split @var{W2} to make a new window @var{W4} as follows. @smallexample @group @@ -1013,8 +1036,8 @@ @noindent Now, when enlarging a window vertically, Emacs tries to obtain the corresponding space from its lower sibling, provided such a window -exists. In our scenario, enlarging @code{W4} will steal space from -@code{W3}. +exists. In our scenario, enlarging @var{W4} will steal space from +@var{W3}. @smallexample @group @@ -1037,8 +1060,8 @@ @end smallexample @noindent -Deleting @code{W4} will now give its entire space to @code{W2}, -including the space earlier stolen from @code{W3}. +Deleting @var{W4} will now give its entire space to @var{W2}, +including the space earlier stolen from @var{W3}. @smallexample @group @@ -1061,12 +1084,12 @@ @end smallexample @noindent -This can be counterintuitive, in particular if @code{W4} were used for +This can be counterintuitive, in particular if @var{W4} were used for displaying a buffer only temporarily (@pxref{Temporary Displays}), and you want to continue working with the initial layout. The behavior can be fixed by making a new parent window when splitting -@code{W2}. The variable described next allows to do that. +@var{W2}. The variable described next allows to do that. @defopt window-combination-limit This variable controls whether splitting a window shall make a new @@ -1108,7 +1131,7 @@ the child windows are deleted (see below). @end defopt - If @code{window-combination-limit} is @code{t}, splitting @code{W2} in + If @code{window-combination-limit} is @code{t}, splitting @var{W2} in the initial configuration of our scenario would have produced this: @smallexample @@ -1132,12 +1155,12 @@ @end smallexample @noindent -A new internal window @code{W5} has been created; its children are -@code{W2} and the new live window @code{W4}. Now, @code{W2} is the only -sibling of @code{W4}, so enlarging @code{W4} will try to shrink -@code{W2}, leaving @code{W3} unaffected. Observe that @code{W5} +A new internal window @var{W5} has been created; its children are +@var{W2} and the new live window @var{W4}. Now, @var{W2} is the only +sibling of @var{W4}, so enlarging @var{W4} will try to shrink +@var{W2}, leaving @var{W3} unaffected. Observe that @var{W5} represents a vertical combination of two windows embedded in the -vertical combination @code{W1}. +vertical combination @var{W1}. @cindex window combination limit @defun set-window-combination-limit window limit @@ -1162,9 +1185,9 @@ siblings. If, in the configuration shown at the beginning of this section, the -combination limit of @code{W4} (the parent window of @code{W6} and -@code{W7}) is @code{t}, deleting @code{W5} will not implicitly delete -@code{W4} too. +combination limit of @var{W4} (the parent window of @var{W6} and +@var{W7}) is @code{t}, deleting @var{W5} will not implicitly delete +@var{W4} too. @end defun Alternatively, the problems sketched above can be avoided by always @@ -1215,7 +1238,7 @@ @noindent If @code{window-combination-resize} is @code{nil}, splitting window -@code{W3} leaves the size of @code{W2} unchanged: +@var{W3} leaves the size of @var{W2} unchanged: @smallexample @group @@ -1238,7 +1261,7 @@ @end smallexample @noindent -If @code{window-combination-resize} is @code{t}, splitting @code{W3} +If @code{window-combination-resize} is @code{t}, splitting @var{W3} instead leaves all three live windows with approximately the same height: @@ -1263,7 +1286,7 @@ @end smallexample @noindent -Deleting any of the live windows @code{W2}, @code{W3} or @code{W4} will +Deleting any of the live windows @var{W2}, @var{W3} or @var{W4} will distribute its space proportionally among the two remaining live windows. @@ -1510,25 +1533,6 @@ @code{next-window}. @end defun -@cindex window in direction -@defun window-in-direction direction &optional window ignore -This function returns the nearest window in direction @var{direction} as -seen from the position of @code{window-point} in window @var{window}. -The argument @var{direction} must be one of @code{above}, @code{below}, -@code{left} or @code{right}. The optional argument @var{window} must -denote a live window and defaults to the selected one. - -This function does not return a window whose @code{no-other-window} -parameter is non-@code{nil}. If the nearest window's -@code{no-other-window} parameter is non-@code{nil}, this function tries -to find another window in the indicated direction whose -@code{no-other-window} parameter is @code{nil}. If the optional -argument @var{ignore} is non-@code{nil}, a window may be returned even -if its @code{no-other-window} parameter is non-@code{nil}. - -If it doesn't find a suitable window, this function returns @code{nil}. -@end defun - @node Buffers and Windows @section Buffers and Windows @@ -1631,28 +1635,30 @@ @deffn Command replace-buffer-in-windows &optional buffer-or-name This command replaces @var{buffer-or-name} with some other buffer, in -all windows displaying it. @var{buffer-or-name} should be a buffer, -or the name of an existing buffer; if omitted or @code{nil}, it -defaults to the current buffer. +all windows displaying it. @var{buffer-or-name} should be a buffer, or +the name of an existing buffer; if omitted or @code{nil}, it defaults to +the current buffer. The replacement buffer in each window is chosen via @code{switch-to-prev-buffer} (@pxref{Window History}). Any dedicated -window displaying @var{buffer-or-name} is deleted (@pxref{Dedicated -Windows}), unless it is the only window on its frame---if it is the -only window, and that frame is not the only frame on its terminal, the -frame is ``dismissed'' by calling the function specified by -@code{frame-auto-hide-function} (@pxref{Quitting Windows}). If the -dedicated window is the only window on the only frame on its terminal, -the buffer is replaced anyway. +window displaying @var{buffer-or-name} is deleted if possible +(@pxref{Dedicated Windows}). If such a window is the only window on its +frame and there are other frames on the same terminal, the frame is +deleted as well. If the dedicated window is the only window on the only +frame on its terminal, the buffer is replaced anyway. @end deffn + @node Switching Buffers @section Switching to a Buffer in a Window @cindex switching to a buffer @cindex displaying a buffer - This section describes high-level functions for switching to a -specified buffer in some window. +This section describes high-level functions for switching to a specified +buffer in some window. In general, ``switching to a buffer'' means to +(1) show the buffer in some window, (2) make that window the selected +window (and its frame the selected frame), and (3) make the buffer the +current buffer. Do @emph{not} use these functions to make a buffer temporarily current just so a Lisp program can access or modify it. They have @@ -1664,9 +1670,9 @@ @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window This command attempts to display @var{buffer-or-name} in the selected -window, and makes it the current buffer. It is often used -interactively (as the binding of @kbd{C-x b}), as well as in Lisp -programs. The return value is the buffer switched to. +window and make it the current buffer. It is often used interactively +(as the binding of @kbd{C-x b}), as well as in Lisp programs. The +return value is the buffer switched to. If @var{buffer-or-name} is @code{nil}, it defaults to the buffer returned by @code{other-buffer} (@pxref{The Buffer List}). If @@ -1690,9 +1696,8 @@ instead. @end deffn -By default, @code{switch-to-buffer} sets @code{window-point} of the -window used to the buffer's position of @code{point}. This behavior can -be tuned using the following option. +By default, @code{switch-to-buffer} shows the buffer at its position of +@code{point}. This behavior can be tuned using the following option. @defopt switch-to-buffer-preserve-window-point If this variable is @code{nil}, @code{switch-to-buffer} displays the @@ -1710,13 +1715,13 @@ buffer. @end defopt -The next two functions are similar to @code{switch-to-buffer}, except -for the described features. +The next two commands are similar to @code{switch-to-buffer}, except for +the described features. @deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord -This function makes the buffer specified by @var{buffer-or-name} -current and displays it in some window other than the selected window. -It uses the function @code{pop-to-buffer} internally (see below). +This function displays the buffer specified by @var{buffer-or-name} in +some window other than the selected window. It uses the function +@code{pop-to-buffer} internally (see below). If the selected window already displays the specified buffer, it continues to do so, but another window is nonetheless found to display @@ -1727,9 +1732,9 @@ @end deffn @deffn Command switch-to-buffer-other-frame buffer-or-name &optional norecord -This function makes the buffer specified by @var{buffer-or-name} -current and displays it, usually in a new frame. It uses the function -@code{pop-to-buffer} (see below). +This function displays the buffer specified by @var{buffer-or-name} in a +new frame. It uses the function @code{pop-to-buffer} internally (see +below). If the specified buffer is already displayed in another window, in any frame on the current terminal, this switches to that window instead of @@ -1987,8 +1992,8 @@ @end itemize This function can fail if no window splitting can be performed for some -reason (e.g. if there is just one frame and it has an -@code{unsplittable} frame parameter; @pxref{Buffer Parameters}). +reason (e.g. if the selected frame has an @code{unsplittable} frame +parameter; @pxref{Buffer Parameters}). @end defun @defun display-buffer-below-selected buffer alist @@ -2035,14 +2040,15 @@ @noindent Evaluating the form above will cause @code{display-buffer} to proceed as -follows: If `*foo*' already appears on a visible or iconified frame, it -will reuse its window. Otherwise, it will try to pop up a new window -or, if that is impossible, a new frame. If all these steps fail, it -will proceed using whatever @code{display-buffer-base-action} and +follows: If a buffer called *foo* already appears on a visible or +iconified frame, it will reuse its window. Otherwise, it will try to +pop up a new window or, if that is impossible, a new frame and show the +buffer there. If all these steps fail, it will proceed using whatever +@code{display-buffer-base-action} and @code{display-buffer-fallback-action} prescribe. Furthermore, @code{display-buffer} will try to adjust a reused window -(provided `*foo*' was put by @code{display-buffer} there before) or a +(provided *foo* was put by @code{display-buffer} there before) or a popped-up window as follows: If the window is part of a vertical combination, it will set its height to ten lines. Note that if, instead of the number ``10'', we specified the function @@ -2077,10 +2083,10 @@ @end example @noindent -Evaluating this form will cause @code{display-buffer} to first try -reusing a window showing @code{*foo*} on the selected frame. -If no such window exists, it will try to split the selected window or, -if that is impossible, use the window below the selected window. +This form will have @code{display-buffer} first try reusing a window +that shows *foo* on the selected frame. If there's no such window, it +will try to split the selected window or, if that is impossible, use the +window below the selected window. If there's no window below the selected one, or the window below the selected one is dedicated to its buffer, @code{display-buffer} will @@ -2119,8 +2125,8 @@ the window (@pxref{Display Action Functions}). The default value is @code{split-window-sensibly}, which is documented -below. The value must be a function that takes one argument, a -window, and return either a new window (which is used to display the +below. The value must be a function that takes one argument, a window, +and return either a new window (which will be used to display the desired buffer) or @code{nil} (which means the splitting failed). @end defopt @@ -2198,15 +2204,15 @@ @defopt same-window-buffer-names A list of buffer names for buffers that should be displayed in the selected window. If a buffer's name is in this list, -@code{display-buffer} handles the buffer by switching to it in the -selected window. +@code{display-buffer} handles the buffer by showing it in the selected +window. @end defopt @defopt same-window-regexps A list of regular expressions that specify buffers that should be displayed in the selected window. If the buffer's name matches any of the regular expressions in this list, @code{display-buffer} handles the -buffer by switching to it in the selected window. +buffer by showing it in the selected window. @end defopt @defun same-window-p buffer-name @@ -2219,22 +2225,23 @@ @section Window History @cindex window history -Each window remembers the buffers it has previously displayed, and the order -in which these buffers were removed from it. This history is used, -for example, by @code{replace-buffer-in-windows} (@pxref{Buffers and -Windows}). This list is automatically maintained by Emacs, but you can -use the following functions to explicitly inspect or alter it: +Each window remembers in a list the buffers it has previously displayed, +and the order in which these buffers were removed from it. This history +is used, for example, by @code{replace-buffer-in-windows} +(@pxref{Buffers and Windows}). The list is automatically maintained by +Emacs, but you can use the following functions to explicitly inspect or +alter it: @defun window-prev-buffers &optional window This function returns a list specifying the previous contents of -@var{window}, which should be a live window and defaults to the -selected window. +@var{window}. The optional argument @var{window} should be a live +window and defaults to the selected one. Each list element has the form @code{(@var{buffer} @var{window-start} @var{window-pos})}, where @var{buffer} is a buffer previously shown in the window, @var{window-start} is the window start position when that buffer was last shown, and @var{window-pos} is the point position when -that buffer was last shown. +that buffer was last shown in @var{window}. The list is ordered so that earlier elements correspond to more recently-shown buffers, and the first element usually corresponds to the @@ -2331,29 +2338,31 @@ windows by marking these windows as @dfn{dedicated} to their buffers. @code{display-buffer} (@pxref{Choosing Window}) never uses a dedicated window for displaying another buffer in it. @code{get-lru-window} and -@code{get-largest-window} (@pxref{Selecting Windows}) do not consider -dedicated windows as candidates when their @var{dedicated} argument is -non-@code{nil}. The behavior of @code{set-window-buffer} +@code{get-largest-window} (@pxref{Cyclic Window Ordering}) do not +consider dedicated windows as candidates when their @var{dedicated} +argument is non-@code{nil}. The behavior of @code{set-window-buffer} (@pxref{Buffers and Windows}) with respect to dedicated windows is slightly different, see below. -When @code{delete-windows-on} (@pxref{Deleting Windows}) wants to -delete a dedicated window and that window is the only window on its -frame, it deletes the window's frame too, provided there are other -frames left. @code{replace-buffer-in-windows} (@pxref{Switching -Buffers}) tries to delete all dedicated windows showing its buffer -argument. When such a window is the only window on its frame, that -frame is deleted, provided there are other frames left. If there are -no more frames left, some other buffer is displayed in the window, and -the window is marked as non-dedicated. - -When you kill a buffer (@pxref{Killing Buffers}) displayed in a -dedicated window, any such window usually gets deleted too, since -@code{kill-buffer} calls @code{replace-buffer-in-windows} for cleaning -up windows. Burying a buffer (@pxref{The Buffer List}) deletes the -selected window if it is dedicated to that buffer. If, however, that -window is the only window on its frame, @code{bury-buffer} displays -another buffer in it and iconifies the frame. + Functions supposed to remove a buffer from a window or a window from +a frame can behave specially when a window they operate on is dedicated. +We will distinguish three basic cases, namely where (1) the window is +not the only window on its frame, (2) the window is the only window on +its frame but there are other frames on the same terminal left, and (3) +the window is the only window on the only frame on the same terminal. + + In particular, @code{delete-windows-on} (@pxref{Deleting Windows}) +handles case (2) by deleting the associated frame and case (3) by +showing another buffer in that frame's only window. The function +@code{replace-buffer-in-windows} (@pxref{Buffers and Windows}) which is +called when a buffer gets killed, deletes the window in case (1) and +behaves like @code{delete-windows-on} otherwise. + + When @code{bury-buffer} (@pxref{The Buffer List}) operates on the +selected window (which shows the buffer that shall be buried), it +handles case (2) by calling @code{frame-auto-hide-function} +(@pxref{Quitting Windows}) to deal with the selected frame. The other +two cases are handled as with @code{replace-buffer-in-windows}. @defun window-dedicated-p &optional window This function returns non-@code{nil} if @var{window} is dedicated to its === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-23 08:33:20 +0000 +++ lisp/ChangeLog 2012-11-24 01:57:09 +0000 @@ -1,3 +1,55 @@ +2012-11-24 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compile-file): Setup default value for + lexical-binding (bug#12938). + +2012-11-24 Wolfgang Jenkner + + * image-mode.el (image-transform-check-size): Use assertions only + for images of type imagemagick. + + Otherwise no error, image-transform-fit-to-{width,height} is + silently ignored, as before. Doc fix. + +2012-11-24 Chong Yidong + + * faces.el (color-defined-p): Doc fix (Bug#12853). + +2012-11-24 Juri Linkov + + * dired.el (dired-mark): Add optional arg `interactive'. + Check for `use-region-p' if `interactive' is non-nil. + (dired-unmark, dired-flag-file-deletion): Add optional arg + `interactive'. Call `dired-mark' with the arg `interactive'. + (Bug#10624) + + * wdired.el: Revert 2012-10-17 change partly and replace it with + Patch by Christopher Schmidt . + (wdired-finish-edit): Add marks for new file names to + `wdired-old-marks'. Restore marks using `dired-mark-remembered' + after `revert-buffer'. + (wdired-do-renames): Remove calls to `dired-remove-file', + `dired-add-file', `dired-add-entry'. (Bug#11795) + +2012-11-24 Alan Mackenzie + + * progmodes/cc-defs.el (c-version): Bump to 5.32.4. + + Fix bugs in the state cache. Enhance a debugging mechanism. + * progmodes/cc-engine.el (c-parse-state-get-strategy): Don't use + "brace at column zero" strategy for C++. + (c-append-lower-brace-pair-to-state-cache): Repair algorithm. + (c-parse-state-point): New variable. + (c-record-parse-state-state): Record old parse state with + `copy-tree'. Record previous value of point. + (c-debug-parse-state-double-cons): New debugging function. + (c-debug-parse-state): Call the above new function. + (c-toggle-parse-state-debug): Output a confirmatory message. + + * progmodes/cc-mode.el (c-before-change, c-after-change): + Call c-invalidate-state-cache from `c-before-change' instead of + `c-after-change'. + 2012-11-23 Chong Yidong * find-cmd.el (find-constituents): Add executable, ipath, === modified file 'lisp/dired.el' --- lisp/dired.el 2012-11-17 21:52:12 +0000 +++ lisp/dired.el 2012-11-24 01:57:09 +0000 @@ -3109,7 +3109,7 @@ (insert dired-marker-char))) (forward-line 1)))) -(defun dired-mark (arg) +(defun dired-mark (arg &optional interactive) "Mark the file at point in the Dired buffer. If the region is active, mark all files in the region. Otherwise, with a prefix arg, mark files on the next ARG lines. @@ -3119,10 +3119,10 @@ Use \\[dired-unmark-all-files] to remove all marks and \\[dired-unmark] on a subdir to remove the marks in this subdir." - (interactive "P") + (interactive (list current-prefix-arg t)) (cond ;; Mark files in the active region. - ((and transient-mark-mode mark-active) + ((and interactive (use-region-p)) (save-excursion (let ((beg (region-beginning)) (end (region-end))) @@ -3139,7 +3139,7 @@ (prefix-numeric-value arg) (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) -(defun dired-unmark (arg) +(defun dired-unmark (arg &optional interactive) "Unmark the file at point in the Dired buffer. If the region is active, unmark all files in the region. Otherwise, with a prefix arg, unmark files on the next ARG lines. @@ -3147,11 +3147,11 @@ If looking at a subdir, unmark all its files except `.' and `..'. If the region is active in Transient Mark mode, unmark all files in the active region." - (interactive "P") + (interactive (list current-prefix-arg t)) (let ((dired-marker-char ?\040)) - (dired-mark arg))) + (dired-mark arg interactive))) -(defun dired-flag-file-deletion (arg) +(defun dired-flag-file-deletion (arg &optional interactive) "In Dired, flag the current line's file for deletion. If the region is active, flag all files in the region. Otherwise, with a prefix arg, flag files on the next ARG lines. @@ -3159,9 +3159,9 @@ If on a subdir headerline, flag all its files except `.' and `..'. If the region is active in Transient Mark mode, flag all files in the active region." - (interactive "P") + (interactive (list current-prefix-arg t)) (let ((dired-marker-char dired-del-marker)) - (dired-mark arg))) + (dired-mark arg interactive))) (defun dired-unmark-backward (arg) "In Dired, move up lines and remove marks or deletion flags there. === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-11-20 19:05:20 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-11-24 01:57:09 +0000 @@ -1748,6 +1748,9 @@ ;; There may be a file local variable setting (bug#10419). (setq buffer-read-only nil filename buffer-file-name)) + ;; Don't inherit lexical-binding from caller (bug#12938). + (unless (local-variable-p 'lexical-binding) + (setq-local lexical-binding nil)) ;; Set the default directory, in case an eval-when-compile uses it. (setq default-directory (file-name-directory filename))) ;; Check if the file's local variables explicitly specify not to === modified file 'lisp/faces.el' --- lisp/faces.el 2012-11-21 08:39:08 +0000 +++ lisp/faces.el 2012-11-24 01:57:09 +0000 @@ -929,13 +929,25 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun read-face-name (prompt &optional default multiple) - "Read a face, defaulting to the face or faces on the char after point. -If it has the property `read-face-name', that overrides the `face' property. -PROMPT should be a string that describes what the caller will do with the face; -it should not end in a space. + "Read a face, defaulting to the face or faces at point. +If the text at point has the property `read-face-name', that +overrides the `face' property for determining the default. + +PROMPT should be a string that describes what the caller will do +with the face; it should not end in a space. + + +This function uses `completing-read-multiple' with \",\" as the +separator character, i.e. + + + + + The optional argument DEFAULT provides the value to display in the minibuffer prompt that is returned if the user just types RET unless DEFAULT is a string (in which case nil is returned). + If MULTIPLE is non-nil, return a list of faces (possibly only one). Otherwise, return a single face." (let ((faceprop (or (get-char-property (point) 'read-face-name) @@ -1692,12 +1704,16 @@ (declare-function xw-color-defined-p "xfns.c" (color &optional frame)) (defun color-defined-p (color &optional frame) - "Return non-nil if color COLOR is supported on frame FRAME. -If FRAME is omitted or nil, use the selected frame. -If COLOR is the symbol `unspecified' or one of the strings -\"unspecified-fg\" or \"unspecified-bg\", the value is nil." - (if (member color '(unspecified "unspecified-bg" "unspecified-fg")) - nil + "Return non-nil if COLOR is supported on frame FRAME. +COLOR should be a string naming a color (e.g. \"white\"), or a +string specifying a color's RGB components (e.g. \"#ff12ec\"), or +the symbol `unspecified'. + +This function returns nil if COLOR is the symbol `unspecified', +or one of the strings \"unspecified-fg\" or \"unspecified-bg\". + +If FRAME is omitted or nil, use the selected frame." + (unless (member color '(unspecified "unspecified-bg" "unspecified-fg")) (if (member (framep (or frame (selected-frame))) '(x w32 ns)) (xw-color-defined-p color frame) (numberp (tty-color-translate color frame))))) === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2012-09-27 03:16:35 +0000 +++ lisp/image-mode.el 2012-11-23 17:41:01 +0000 @@ -746,8 +746,14 @@ h))))) (defun image-transform-check-size () - "Check that the image exactly fits the width/height of the window." - (unless (numberp image-transform-resize) + "Check that the image exactly fits the width/height of the window. + +Do this for an image of type `imagemagick' to make sure that the +elisp code matches the way ImageMagick computes the bounding box +of a rotated image." + (when (and (not (numberp image-transform-resize)) + (boundp 'image-type) + (eq image-type 'imagemagick)) (let ((size (image-display-size (image-get-display-property) t))) (cond ((eq image-transform-resize 'fit-width) (cl-assert (= (car size) === modified file 'lisp/progmodes/cc-defs.el' --- lisp/progmodes/cc-defs.el 2012-09-13 18:41:21 +0000 +++ lisp/progmodes/cc-defs.el 2012-11-21 20:47:09 +0000 @@ -93,7 +93,7 @@ ;;; Variables also used at compile time. -(defconst c-version "5.32.3" +(defconst c-version "5.32.4" "CC Mode version number.") (defconst c-version-sym (intern c-version)) === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2012-09-21 03:03:48 +0000 +++ lisp/progmodes/cc-engine.el 2012-11-21 20:41:03 +0000 @@ -2561,8 +2561,11 @@ start-point cache-pos))) ;; Might we be better off starting from the top level, two defuns back, - ;; instead? - (when (> how-far c-state-cache-too-far) + ;; instead? This heuristic no longer works well in C++, where + ;; declarations inside namespace brace blocks are frequently placed at + ;; column zero. + (when (and (not (c-major-mode-is 'c++-mode)) + (> how-far c-state-cache-too-far)) (setq BOD-pos (c-get-fallback-scan-pos here)) ; somewhat EXPENSIVE!!! (if (< (- here BOD-pos) how-far) (setq strategy 'BOD @@ -2649,17 +2652,20 @@ ;; If we're essentially repeating a fruitless search, just give up. (unless (and c-state-brace-pair-desert (eq cache-pos (car c-state-brace-pair-desert)) + (or (null (car c-state-brace-pair-desert)) + (> from (car c-state-brace-pair-desert))) (<= from (cdr c-state-brace-pair-desert))) - ;; DESERT-LIM. Only search what we absolutely need to, + ;; DESERT-LIM. Avoid repeated searching through the cached desert. (let ((desert-lim (and c-state-brace-pair-desert (eq cache-pos (car c-state-brace-pair-desert)) + (>= from (cdr c-state-brace-pair-desert)) (cdr c-state-brace-pair-desert))) ;; CACHE-LIM. This limit will be necessary when an opening ;; paren at `cache-pos' has just had its matching close paren - ;; inserted. `cache-pos' continues to be a search bound, even - ;; though the algorithm below would skip over the new paren - ;; pair. + ;; inserted into the buffer. `cache-pos' continues to be a + ;; search bound, even though the algorithm below would skip + ;; over the new paren pair. (cache-lim (and cache-pos (< cache-pos from) cache-pos))) (narrow-to-region (cond @@ -3342,12 +3348,18 @@ (fset 'c-real-parse-state (symbol-function 'c-parse-state))) (cc-bytecomp-defun c-real-parse-state) +(defvar c-parse-state-point nil) (defvar c-parse-state-state nil) (defun c-record-parse-state-state () + (setq c-parse-state-point (point)) (setq c-parse-state-state (mapcar (lambda (arg) - (cons arg (symbol-value arg))) + (let ((val (symbol-value arg))) + (cons arg + (if (consp val) + (copy-tree val) + val)))) '(c-state-cache c-state-cache-good-pos c-state-nonlit-pos-cache @@ -3360,7 +3372,8 @@ c-state-point-min-lit-start c-state-min-scan-pos c-state-old-cpp-beg - c-state-old-cpp-end)))) + c-state-old-cpp-end + c-parse-state-point)))) (defun c-replay-parse-state-state () (message (concat "(setq " @@ -3370,6 +3383,16 @@ c-parse-state-state " ") ")"))) +(defun c-debug-parse-state-double-cons (state) + (let (state-car conses-not-ok) + (while state + (setq state-car (car state) + state (cdr state)) + (if (and (consp state-car) + (consp (car state))) + (setq conses-not-ok t))) + conses-not-ok)) + (defun c-debug-parse-state () (let ((here (point)) (res1 (c-real-parse-state)) res2) (let ((c-state-cache nil) @@ -3402,8 +3425,16 @@ here res1 res2) (message "Old state:") (c-replay-parse-state-state)) + + (when (c-debug-parse-state-double-cons res1) + (message "c-parse-state INVALIDITY at %s: %s" + here res1) + (message "Old state:") + (c-replay-parse-state-state)) + (c-record-parse-state-state) - res1)) + res2 ; res1 correct a cascading series of errors ASAP + )) (defun c-toggle-parse-state-debug (&optional arg) (interactive "P") @@ -3411,7 +3442,9 @@ (fset 'c-parse-state (symbol-function (if c-debug-parse-state 'c-debug-parse-state 'c-real-parse-state))) - (c-keep-region-active)) + (c-keep-region-active) + (message "c-debug-parse-state %sabled" + (if c-debug-parse-state "en" "dis"))) (when c-debug-parse-state (c-toggle-parse-state-debug 1)) === modified file 'lisp/progmodes/cc-mode.el' --- lisp/progmodes/cc-mode.el 2012-10-23 15:06:07 +0000 +++ lisp/progmodes/cc-mode.el 2012-11-21 20:41:03 +0000 @@ -1034,7 +1034,10 @@ (mapc (lambda (fn) (funcall fn beg end)) c-get-state-before-change-functions)) - )))) + ))) + ;; The following must be done here rather than in `c-after-change' because + ;; newly inserted parens would foul up the invalidation algorithm. + (c-invalidate-state-cache beg)) (defvar c-in-after-change-fontification nil) (make-variable-buffer-local 'c-in-after-change-fontification) @@ -1082,7 +1085,7 @@ (c-trim-found-types beg end old-len) ; maybe we don't need all of these. (c-invalidate-sws-region-after beg end) - (c-invalidate-state-cache beg) + ;; (c-invalidate-state-cache beg) ; moved to `c-before-change'. (c-invalidate-find-decl-cache beg) (when c-recognize-<>-arglists === modified file 'lisp/wdired.el' --- lisp/wdired.el 2012-10-27 09:17:14 +0000 +++ lisp/wdired.el 2012-11-23 07:28:37 +0000 @@ -399,6 +399,15 @@ (setq changes t) (if (not file-new) ;empty filename! (push file-old files-deleted) + (when wdired-keep-marker-rename + (let ((mark (cond ((integerp wdired-keep-marker-rename) + wdired-keep-marker-rename) + (wdired-keep-marker-rename + (cdr (assoc file-old wdired-old-marks))) + (t nil)))) + (when mark + (push (cons (substitute-in-file-name file-new) mark) + wdired-old-marks)))) (push (cons file-old (substitute-in-file-name file-new)) files-renamed)))) (forward-line -1))) @@ -416,7 +425,9 @@ (= (length files-renamed) 1)) (setq dired-directory (cdr (car files-renamed)))) ;; Re-sort the buffer. - (revert-buffer)) + (revert-buffer) + (let ((inhibit-read-only t)) + (dired-mark-remembered wdired-old-marks))) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) '(old-name nil end-name nil old-link nil @@ -430,8 +441,6 @@ (set-buffer-modified-p nil) (setq buffer-undo-list nil)) -(declare-function dired-add-entry "dired-aux" (filename &optional marker-char relative)) - (defun wdired-do-renames (renames) "Perform RENAMES in parallel." (let ((residue ()) @@ -473,8 +482,7 @@ (push (cons tmp file-new) residue)))) (t (setq progress t) - (let* ((file-ori (car rename)) - (old-mark (cdr (assoc file-ori wdired-old-marks)))) + (let ((file-ori (car rename))) (if wdired-use-interactive-rename (wdired-search-and-rename file-ori file-new) ;; If dired-rename-file autoloads dired-aux while @@ -485,20 +493,12 @@ (condition-case err (let ((dired-backup-overwrite nil)) (dired-rename-file file-ori file-new - overwrite) - (dired-remove-file file-ori) - (dired-add-file - file-new - (cond ((integerp wdired-keep-marker-rename) - wdired-keep-marker-rename) - (wdired-keep-marker-rename old-mark) - (t nil)))) + overwrite)) (error (setq errors (1+ errors)) (dired-log (concat "Rename `" file-ori "' to `" file-new "' failed:\n%s\n") - err) - (dired-add-entry file-ori old-mark))))))))) + err))))))))) errors)) === modified file 'src/.gdbinit' --- src/.gdbinit 2012-11-09 11:38:31 +0000 +++ src/.gdbinit 2012-11-24 01:57:09 +0000 @@ -495,7 +495,8 @@ end xgettype ($g.object) if ($type == Lisp_String) - printf " str=%x[%d]", $g.object, $g.charpos + xgetptr $g.object + printf " str=0x%x[%d]", ((struct Lisp_String *)$ptr)->data, $g.charpos else printf " pos=%d", $g.charpos end === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-23 15:39:48 +0000 +++ src/ChangeLog 2012-11-24 01:57:09 +0000 @@ -1,3 +1,17 @@ +2012-11-24 Eli Zaretskii + + * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not + between bpos_covered and bpos_max. This fixes cursor display when + several display strings follow each other. + + * .gdbinit (pgx): If the glyph's object is a string, display the + pointer to string data, rather than the value of the string object + itself (which barfs under CHECK_LISP_OBJECT_TYPE). + + * indent.c (Fvertical_motion): If the starting position is covered + by a display string, return to one position before that, to avoid + overshooting it inside move_it_to. (Bug#12930) + 2012-11-23 Dmitry Antipov * frame.h (struct frame): Remove display_preempted member === modified file 'src/indent.c' --- src/indent.c 2012-11-02 10:34:26 +0000 +++ src/indent.c 2012-11-24 01:57:09 +0000 @@ -2048,7 +2048,13 @@ comment said this is "so we don't move too far" (2005-01-19 checkin by kfs). But this does nothing useful that I can tell, and it causes Bug#2694 . -- cyd */ - move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); + /* When the position we started from is covered by a display + string, move_it_to will overshoot it, while vertical-motion + wants to put the cursor _before_ the display string. So in + that case, we move to buffer position before the display + string, and avoid overshooting. */ + move_it_to (&it, disp_string_at_start_p ? PT - 1 : PT, + -1, -1, -1, MOVE_TO_POS); /* IT may move too far if truncate-lines is on and PT lies beyond the right margin. IT may also move too far if the === modified file 'src/xdisp.c' --- src/xdisp.c 2012-11-22 09:32:32 +0000 +++ src/xdisp.c 2012-11-24 01:57:09 +0000 @@ -14233,7 +14233,7 @@ GLYPH_BEFORE and GLYPH_AFTER. */ if (!((row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) && BUFFERP (glyph->object) && glyph->charpos == pt_old) - && bpos_covered < pt_old) + && !(bpos_max < pt_old && pt_old <= bpos_covered)) { /* An empty line has a single glyph whose OBJECT is zero and whose CHARPOS is the position of a newline on that line. ------------------------------------------------------------ revno: 110994 committer: Jay Belanger branch nick: trunk timestamp: Fri 2012-11-23 12:43:29 -0600 message: * doc/misc/calc.texi (Date Formatting Codes): Mention the new beginning of the date numbering system. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-11-23 07:31:58 +0000 +++ doc/misc/ChangeLog 2012-11-23 18:43:29 +0000 @@ -1,3 +1,8 @@ +2012-11-23 Jay Belanger + + * calc.texi (Date Formatting Codes): Mention the new beginning of + the date numbering system. + 2012-11-22 Paul Eggert * calc.texi: Fix TeX issues with capitals followed by ".", "?", "!". === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2012-11-22 08:39:27 +0000 +++ doc/misc/calc.texi 2012-11-23 18:43:29 +0000 @@ -13439,7 +13439,7 @@ match exactly; letter fields must correspond to suitable text in the input. If this doesn't work, Calc checks if the input is a simple number; if so, the number is interpreted as a number of days -since Jan 1, 1 AD@. Otherwise, Calc tries a much more relaxed and +since Dec 31, 1 BC@. Otherwise, Calc tries a much more relaxed and flexible algorithm which is described in the next section. Weekday names are ignored during reading. ------------------------------------------------------------ revno: 110993 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12970 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2012-11-23 11:00:57 -0500 message: * lisp/erc/erc-backend.el: Fix last change that missed calls to `second'. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-11-19 17:24:12 +0000 +++ lisp/erc/ChangeLog 2012-11-23 16:00:57 +0000 @@ -1,3 +1,8 @@ +2012-11-23 Stefan Monnier + + * erc-backend.el: Fix last change that missed calls to `second' + (bug#12970). + 2012-11-19 Stefan Monnier Use cl-lib instead of cl, and interactive-p => called-interactively-p. === modified file 'lisp/erc/erc-backend.el' --- lisp/erc/erc-backend.el 2012-11-19 17:24:12 +0000 +++ lisp/erc/erc-backend.el 2012-11-23 16:00:57 +0000 @@ -1556,17 +1556,17 @@ (define-erc-response-handler (252) "Display the number of IRC operators online." nil (erc-display-message parsed 'notice 'active 's252 - ?i (second (erc-response.command-args parsed)))) + ?i (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (253) "Display the number of unknown connections." nil (erc-display-message parsed 'notice 'active 's253 - ?i (second (erc-response.command-args parsed)))) + ?i (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (254) "Display the number of channels formed." nil (erc-display-message parsed 'notice 'active 's254 - ?i (second (erc-response.command-args parsed)))) + ?i (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (250 251 255 256 257 258 259 265 266 377 378) "Generic display of server messages as notices. @@ -1590,13 +1590,13 @@ (define-erc-response-handler (301) "AWAY notice." nil (erc-display-message parsed 'notice 'active 's301 - ?n (second (erc-response.command-args parsed)) + ?n (cadr (erc-response.command-args parsed)) ?r (erc-response.contents parsed))) (define-erc-response-handler (303) "ISON reply" nil (erc-display-message parsed 'notice 'active 's303 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (305) "Return from AWAYness." nil @@ -1643,7 +1643,7 @@ "IRC Operator response in WHOIS." nil (erc-display-message parsed 'notice 'active 's313 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (315 318 323 369) ;; 315 - End of WHO @@ -1674,14 +1674,14 @@ "Channel names in WHOIS response." nil (erc-display-message parsed 'notice 'active 's319 - ?n (second (erc-response.command-args parsed)) + ?n (cadr (erc-response.command-args parsed)) ?c (erc-response.contents parsed))) (define-erc-response-handler (320) "Identified user in WHOIS." nil (erc-display-message parsed 'notice 'active 's320 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (321) "LIST header." nil @@ -1713,7 +1713,7 @@ (define-erc-response-handler (324) "Channel or nick modes." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (modes (mapconcat 'identity (cddr (erc-response.command-args parsed)) " "))) (erc-set-modes channel modes) @@ -1723,14 +1723,14 @@ (define-erc-response-handler (328) "Channel URL (on freenode network)." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (url (erc-response.contents parsed))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) 's328 ?c channel ?u url))) (define-erc-response-handler (329) "Channel creation date." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (time (erc-string-to-emacs-time (nth 2 (erc-response.command-args parsed))))) (erc-display-message @@ -1748,7 +1748,7 @@ ;; authaccount == (aref parsed 4) ;; authmsg == (aref parsed 5) ;; The guesses below are, well, just that. -- Lawrence 2004/05/10 - (let ((nick (second (erc-response.command-args parsed))) + (let ((nick (cadr (erc-response.command-args parsed))) (authaccount (nth 2 (erc-response.command-args parsed))) (authmsg (erc-response.contents parsed))) (erc-display-message parsed 'notice 'active 's330 @@ -1756,14 +1756,14 @@ (define-erc-response-handler (331) "No topic set for channel." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (topic (erc-response.contents parsed))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) 's331 ?c channel))) (define-erc-response-handler (332) "TOPIC notice." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (topic (erc-response.contents parsed))) (erc-update-channel-topic channel topic) (erc-display-message parsed 'notice (erc-get-buffer channel proc) @@ -1816,7 +1816,7 @@ (define-erc-response-handler (366) "End of NAMES." nil - (erc-with-buffer ((second (erc-response.command-args parsed)) proc) + (erc-with-buffer ((cadr (erc-response.command-args parsed)) proc) (erc-channel-end-receiving-names))) (define-erc-response-handler (367) @@ -1836,7 +1836,7 @@ (define-erc-response-handler (368) "End of channel ban list." nil - (let ((channel (second (erc-response.command-args parsed)))) + (let ((channel (cadr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice 'active 's368 ?c channel))) @@ -1854,12 +1854,12 @@ "Server's time string." nil (erc-display-message parsed 'notice 'active - 's391 ?s (second (erc-response.command-args parsed)) + 's391 ?s (cadr (erc-response.command-args parsed)) ?t (nth 2 (erc-response.command-args parsed)))) (define-erc-response-handler (401) "No such nick/channel." nil - (let ((nick/channel (second (erc-response.command-args parsed)))) + (let ((nick/channel (cadr (erc-response.command-args parsed)))) (when erc-whowas-on-nosuchnick (erc-log (format "cmd: WHOWAS: %s" nick/channel)) (erc-server-send (format "WHOWAS %s 1" nick/channel))) @@ -1869,23 +1869,23 @@ (define-erc-response-handler (403) "No such channel." nil (erc-display-message parsed '(notice error) 'active - 's403 ?c (second (erc-response.command-args parsed)))) + 's403 ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (404) "Cannot send to channel." nil (erc-display-message parsed '(notice error) 'active - 's404 ?c (second (erc-response.command-args parsed)))) + 's404 ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (405) "Can't join that many channels." nil (erc-display-message parsed '(notice error) 'active - 's405 ?c (second (erc-response.command-args parsed)))) + 's405 ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (406) "No such nick." nil (erc-display-message parsed '(notice error) 'active - 's406 ?n (second (erc-response.command-args parsed)))) + 's406 ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (412) "No text to send." nil @@ -1894,33 +1894,33 @@ (define-erc-response-handler (421) "Unknown command." nil (erc-display-message parsed '(notice error) 'active 's421 - ?c (second (erc-response.command-args parsed)))) + ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (432) "Bad nick." nil (erc-display-message parsed '(notice error) 'active 's432 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (433) "Login-time \"nick in use\"." nil - (erc-nickname-in-use (second (erc-response.command-args parsed)) + (erc-nickname-in-use (cadr (erc-response.command-args parsed)) "already in use")) (define-erc-response-handler (437) "Nick temporarily unavailable (on IRCnet)." nil - (let ((nick/channel (second (erc-response.command-args parsed)))) + (let ((nick/channel (cadr (erc-response.command-args parsed)))) (unless (erc-channel-p nick/channel) (erc-nickname-in-use nick/channel "temporarily unavailable")))) (define-erc-response-handler (442) "Not on channel." nil (erc-display-message parsed '(notice error) 'active 's442 - ?c (second (erc-response.command-args parsed)))) + ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (461) "Not enough parameters for command." nil (erc-display-message parsed '(notice error) 'active 's461 - ?c (second (erc-response.command-args parsed)) + ?c (cadr (erc-response.command-args parsed)) ?m (erc-response.contents parsed))) (define-erc-response-handler (465) @@ -1936,37 +1936,37 @@ (erc-display-message parsed '(notice error) nil (intern (format "s%s" (erc-response.command parsed))) - ?c (second (erc-response.command-args parsed)))) + ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (475) "Channel key needed." nil (erc-display-message parsed '(notice error) nil 's475 - ?c (second (erc-response.command-args parsed))) + ?c (cadr (erc-response.command-args parsed))) (when erc-prompt-for-channel-key - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (key (read-from-minibuffer (format "Channel %s is mode +k. Enter key (RET to cancel): " - (second (erc-response.command-args parsed)))))) + (cadr (erc-response.command-args parsed)))))) (when (and key (> (length key) 0)) (erc-cmd-JOIN channel key))))) (define-erc-response-handler (477) "Channel doesn't support modes." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (message (erc-response.contents parsed))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) (format "%s: %s" channel message)))) (define-erc-response-handler (482) "You need to be a channel operator to do that." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (message (erc-response.contents parsed))) (erc-display-message parsed '(error notice) 'active 's482 ?c channel ?m message))) (define-erc-response-handler (671) "Secure connection response in WHOIS." nil - (let ((nick (second (erc-response.command-args parsed))) + (let ((nick (cadr (erc-response.command-args parsed))) (securemsg (erc-response.contents parsed))) (erc-display-message parsed 'notice 'active 's671 ?n nick ?a securemsg))) ------------------------------------------------------------ revno: 110992 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2012-11-23 16:42:40 +0100 message: nt/config.nt: Sync with autogen/config.in. (BROKEN_GETWD, HAVE_CLOSEDIR, HAVE_DIRENT_H, HAVE_FCNTL_H, HAVE_GETWD): Remove. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-23 08:47:34 +0000 +++ nt/ChangeLog 2012-11-23 15:42:40 +0000 @@ -1,3 +1,9 @@ +2012-11-23 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (BROKEN_GETWD, HAVE_CLOSEDIR, HAVE_DIRENT_H, HAVE_FCNTL_H, HAVE_GETWD): + Remove. + 2012-11-23 Eli Zaretskii * gmake.defs (SWITCHCHAR): Define to // under MSYS, / otherwise. === modified file 'nt/config.nt' --- nt/config.nt 2012-11-21 21:06:52 +0000 +++ nt/config.nt 2012-11-23 15:42:40 +0000 @@ -54,9 +54,6 @@ /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T -/* Define if getwd should not be used. */ -#undef BROKEN_GETWD - /* Define if get_current_dir_name should not be used. */ #undef BROKEN_GET_CURRENT_DIR_NAME @@ -262,9 +259,6 @@ /* Define to 1 if you have the `clock_settime' function. */ #undef HAVE_CLOCK_SETTIME -/* Define to 1 if you have the `closedir' function. */ -#define HAVE_CLOSEDIR 1 - /* Define to 1 if you have the header file. */ #undef HAVE_COFF_H @@ -348,9 +342,6 @@ /* Define to 1 if you have the `difftime' function. */ #undef HAVE_DIFFTIME -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRENT_H - /* Define to 1 if you have the 'dup2' function. */ #define HAVE_DUP2 1 @@ -375,9 +366,6 @@ /* Define to 1 if you have the `faccessat' function. */ #undef HAVE_FACCESSAT -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK @@ -459,9 +447,6 @@ /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 -/* Define to 1 if you have the `getwd' function. */ -#undef HAVE_GETWD - /* Define to 1 if you have the `get_current_dir_name' function. */ #undef HAVE_GET_CURRENT_DIR_NAME ------------------------------------------------------------ revno: 110991 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-11-23 19:39:48 +0400 message: * frame.h (struct frame): Remove display_preempted member since all users are dead long ago. * nsterm.h (struct x_output): Use the only dummy member. * w32menu.c (pending_menu_activation): Remove since not really used. (set_frame_menubar): Adjust user. * w32term.h (struct x_output): Drop outdated #if 0 code. (struct w32_output): Use bitfields for explicit_parent, asked_for_visible and menubar_active members. Drop unused pending_menu_activation member. * xterm.h (struct x_output): Drop outdated #if 0 code. Use bitfields for explicit_parent, asked_for_visible, has_been_visible and net_wm_state_hidden_seen members. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-23 08:47:34 +0000 +++ src/ChangeLog 2012-11-23 15:39:48 +0000 @@ -1,3 +1,19 @@ +2012-11-23 Dmitry Antipov + + * frame.h (struct frame): Remove display_preempted member + since all users are dead long ago. + * nsterm.h (struct x_output): Use the only dummy member. + * w32menu.c (pending_menu_activation): Remove since not + really used. + (set_frame_menubar): Adjust user. + * w32term.h (struct x_output): Drop outdated #if 0 code. + (struct w32_output): Use bitfields for explicit_parent, + asked_for_visible and menubar_active members. Drop + unused pending_menu_activation member. + * xterm.h (struct x_output): Drop outdated #if 0 code. + Use bitfields for explicit_parent, asked_for_visible, + has_been_visible and net_wm_state_hidden_seen members. + 2012-11-23 Eli Zaretskii * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead === modified file 'src/frame.h' --- src/frame.h 2012-11-22 09:32:32 +0000 +++ src/frame.h 2012-11-23 15:39:48 +0000 @@ -357,9 +357,6 @@ unsigned int external_menu_bar : 1; #endif - /* Nonzero if last attempt at redisplay on this frame was preempted. */ - unsigned display_preempted : 1; - /* visible is nonzero if the frame is currently displayed; we check it to see if we should bother updating the frame's contents. DON'T SET IT DIRECTLY; instead, use FRAME_SET_VISIBLE. === modified file 'src/nsterm.h' --- src/nsterm.h 2012-10-11 16:23:37 +0000 +++ src/nsterm.h 2012-11-23 15:39:48 +0000 @@ -630,8 +630,7 @@ /* this dummy decl needed to support TTYs */ struct x_output { - unsigned long background_pixel; - unsigned long foreground_pixel; + int unused; }; === modified file 'src/w32menu.c' --- src/w32menu.c 2012-10-08 12:53:18 +0000 +++ src/w32menu.c 2012-11-23 15:39:48 +0000 @@ -114,17 +114,6 @@ void w32_free_menu_strings (HWND); - - -/* This is set nonzero after the user activates the menu bar, and set - to zero again after the menu bars are redisplayed by prepare_menu_bar. - While it is nonzero, all calls to set_frame_menubar go deep. - - I don't understand why this is needed, but it does seem to be - needed on Motif, according to Marcus Daniels . */ - -int pending_menu_activation; - #ifdef HAVE_MENUS DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, @@ -389,8 +378,6 @@ if (! menubar_widget) deep_p = 1; - else if (pending_menu_activation && !deep_p) - deep_p = 1; if (deep_p) { === modified file 'src/w32term.h' --- src/w32term.h 2012-11-21 04:47:55 +0000 +++ src/w32term.h 2012-11-23 15:39:48 +0000 @@ -251,16 +251,10 @@ diffs between X and w32 code. */ struct x_output { -#if 0 /* These are also defined in struct frame. Use that instead. */ - PIX_TYPE background_pixel; - PIX_TYPE foreground_pixel; -#endif - /* Keep track of focus. May be EXPLICIT if we received a FocusIn for this frame, or IMPLICIT if we received an EnterNotify. FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */ int focus_state; - }; enum @@ -347,17 +341,13 @@ /* Nonzero means our parent is another application's window and was explicitly specified. */ - char explicit_parent; + unsigned explicit_parent : 1; /* Nonzero means tried already to make this frame visible. */ - char asked_for_visible; + unsigned asked_for_visible : 1; /* Nonzero means menubar is currently active. */ - char menubar_active; - - /* Nonzero means menubar is about to become active, but should be - brought up to date first. */ - volatile char pending_menu_activation; + unsigned menubar_active : 1; /* Relief GCs, colors etc. */ struct relief === modified file 'src/xterm.h' --- src/xterm.h 2012-11-08 09:26:40 +0000 +++ src/xterm.h 2012-11-23 15:39:48 +0000 @@ -506,12 +506,6 @@ value contains an ID of the fontset, else -1. */ int fontset; - /* Pixel values used for various purposes. - border_pixel may be -1 meaning use a gray tile. */ -#if 0 /* These are also defined in struct frame. Use that instead. */ - unsigned long background_pixel; - unsigned long foreground_pixel; -#endif unsigned long cursor_pixel; unsigned long border_pixel; unsigned long mouse_pixel; @@ -574,13 +568,13 @@ /* Nonzero means our parent is another application's window and was explicitly specified. */ - char explicit_parent; + unsigned explicit_parent : 1; /* Nonzero means tried already to make this frame visible. */ - char asked_for_visible; + unsigned asked_for_visible : 1; /* Nonzero if this frame was ever previously visible. */ - char has_been_visible; + unsigned has_been_visible : 1; #ifdef HAVE_X_I18N /* Input context (currently, this means Compose key handler setup). */ @@ -634,7 +628,7 @@ int top_before_move; /* Non-zero if _NET_WM_STATE_HIDDEN is set for this frame. */ - int net_wm_state_hidden_seen; + unsigned net_wm_state_hidden_seen : 1; }; #define No_Cursor (None) ------------------------------------------------------------ revno: 110990 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-11-23 06:17:42 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-11-22 11:17:34 +0000 +++ autogen/config.in 2012-11-23 11:17:42 +0000 @@ -253,9 +253,6 @@ /* Define to 1 if you have the `clock_settime' function. */ #undef HAVE_CLOCK_SETTIME -/* Define to 1 if you have the `closedir' function. */ -#undef HAVE_CLOSEDIR - /* Define to 1 if you have the header file. */ #undef HAVE_COFF_H @@ -339,9 +336,6 @@ /* Define to 1 if you have the `difftime' function. */ #undef HAVE_DIFFTIME -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRENT_H - /* Define to 1 if you have the 'dup2' function. */ #undef HAVE_DUP2 === modified file 'autogen/configure' --- autogen/configure 2012-11-22 11:17:34 +0000 +++ autogen/configure 2012-11-23 11:17:42 +0000 @@ -3214,7 +3214,6 @@ as_fn_append ac_header_list " sys/utsname.h" as_fn_append ac_header_list " pwd.h" as_fn_append ac_header_list " utmp.h" -as_fn_append ac_header_list " dirent.h" as_fn_append ac_header_list " util.h" as_fn_append ac_header_list " sys/socket.h" as_fn_append ac_header_list " stdlib.h" @@ -8809,8 +8808,6 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if personality LINUX32 can be set" >&5 $as_echo_n "checking if personality LINUX32 can be set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13474,7 +13471,7 @@ for ac_func in gethostname \ -closedir getrusage get_current_dir_name \ +getrusage get_current_dir_name \ lrand48 \ select getpagesize setlocale \ utimes getrlimit setrlimit shutdown getaddrinfo \ ------------------------------------------------------------ revno: 110989 fixes bug: http://debbugs.gnu.org/12955 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-11-23 10:47:34 +0200 message: Fix bug #12955 with building under MSYS Bash. src/makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead of a literal "/". (gl-stamp): Invoke fc.exe directly, not through cmd. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-23 07:48:43 +0000 +++ nt/ChangeLog 2012-11-23 08:47:34 +0000 @@ -1,3 +1,10 @@ +2012-11-23 Eli Zaretskii + + * gmake.defs (SWITCHCHAR): Define to // under MSYS, / otherwise. + (Bug#12955) + + * nmake.defs (SWITCHCHAR): Define to /. + 2012-11-23 Paul Eggert Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958). === modified file 'nt/gmake.defs' --- nt/gmake.defs 2012-10-17 19:02:44 +0000 +++ nt/gmake.defs 2012-11-23 08:47:34 +0000 @@ -69,10 +69,18 @@ ifeq "$(findstring ECHO, $(sh_output))" "ECHO" THE_SHELL = $(COMSPEC)$(ComSpec) SHELLTYPE=CMD +SWITCHCHAR=/ else USING_SH = 1 THE_SHELL = $(SHELL) SHELLTYPE=SH +# MSYS needs to double the slash in cmd-style switches to avoid +# interpreting /x as a Posix style file name reference +ifneq ($(MSYSTEM),) +SWITCHCHAR=// +else +SWITCHCHAR=/ +endif endif MAKETYPE=gmake === modified file 'nt/nmake.defs' --- nt/nmake.defs 2012-11-20 17:13:10 +0000 +++ nt/nmake.defs 2012-11-23 08:47:34 +0000 @@ -22,6 +22,7 @@ THE_SHELL = $(COMSPEC) SHELLTYPE=CMD +SWITCHCHAR=/ MAKETYPE=nmake === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-23 07:48:43 +0000 +++ src/ChangeLog 2012-11-23 08:47:34 +0000 @@ -1,3 +1,9 @@ +2012-11-23 Eli Zaretskii + + * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead + of a literal "/". (Bug#12955) + (gl-stamp): Invoke fc.exe directly, not through cmd. + 2012-11-23 Paul Eggert Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958). === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-11-23 07:48:43 +0000 +++ src/makefile.w32-in 2012-11-23 08:47:34 +0000 @@ -229,12 +229,12 @@ obj = $(GLOBAL_SOURCES:.c=.o) globals.h: gl-stamp - @cmd /c rem true + @cmd $(SWITCHCHAR)c rem true gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES) - $(DEL) gl-tmp "$(THISDIR)/../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp - cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h" + fc.exe $(SWITCHCHAR)b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h - $(DEL) gl-tmp echo timestamp > $@ ------------------------------------------------------------ revno: 110988 fixes bug: http://debbugs.gnu.org/12856 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-11-23 16:33:20 +0800 message: Add some missing find options to find-cmd.el. * find-cmd.el (find-constituents): Add executable, ipath, readable, samefile, writable, daystart, regextype. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-23 07:31:58 +0000 +++ lisp/ChangeLog 2012-11-23 08:33:20 +0000 @@ -1,3 +1,8 @@ +2012-11-23 Chong Yidong + + * find-cmd.el (find-constituents): Add executable, ipath, + readable, samefile, writable, daystart, regextype (Bug#12856). + 2012-11-23 Stefan Monnier * emacs-lisp/ert.el, emacs-lisp/ert-x.el: Use cl-lib and lexical-binding. === modified file 'lisp/find-cmd.el' --- lisp/find-cmd.el 2012-01-19 07:21:25 +0000 +++ lisp/find-cmd.el 2012-11-23 08:33:20 +0000 @@ -63,6 +63,7 @@ (cnewer . (1)) (ctime . (1)) (empty . (0)) + (executable . (0)) (false . (0)) (fstype . (1)) (gid . (1)) @@ -70,37 +71,43 @@ (ilname . (1)) (iname . (1)) (inum . (1)) + (ipath . (1)) + (iregex . (1)) (iwholename . (1)) - (iregex . (1)) (links . (1)) (lname . (1)) (mmin . (1)) (mtime . (1)) (name . (1)) (newer . (1)) + (nogroup . (0)) (nouser . (0)) - (nogroup . (0)) (path . (1)) (perm . (0)) + (readable . (0)) (regex . (1)) - (wholename . (1)) + (samefile . (1)) (size . (1)) (true . (0)) (type . (1)) (uid . (1)) (used . (1)) (user . (1)) + (wholename . (1)) + (writable . (0)) (xtype . (nil)) ;; normal options (always true) + (daystart . (0)) (depth . (0)) (maxdepth . (1)) (mindepth . (1)) (mount . (0)) (noleaf . (0)) - (xdev . (0)) (ignore_readdir_race . (0)) (noignore_readdir_race . (0)) + (regextype . (1)) + (xdev . (0)) ;; actions (delete . (0)) ------------------------------------------------------------ revno: 110987 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-11-23 00:28:06 -0800 message: movemail: treat EACCES etc. failures as permanent * movemail.c (main): Treat any link failure other than EEXIST as a permanent failure, not just EPERM. EACCES, for example. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-11-21 21:06:52 +0000 +++ lib-src/ChangeLog 2012-11-23 08:28:06 +0000 @@ -1,3 +1,9 @@ +2012-11-23 Paul Eggert + + movemail: treat EACCES etc. failures as permanent + * movemail.c (main): Treat any link failure other than EEXIST as a + permanent failure, not just EPERM. EACCES, for example. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2012-11-21 21:06:52 +0000 +++ lib-src/movemail.c 2012-11-23 08:28:06 +0000 @@ -328,11 +328,8 @@ tem = link (tempname, lockname); -#ifdef EPERM - if (tem < 0 && errno == EPERM) - fatal ("Unable to create hard link between %s and %s", - tempname, lockname); -#endif + if (tem < 0 && errno != EEXIST) + pfatal_with_name (lockname); unlink (tempname); if (tem >= 0) ------------------------------------------------------------ revno: 110986 fixes bug: http://debbugs.gnu.org/12958 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-11-22 23:48:43 -0800 message: Assume POSIX 1003.1-1988 or later for dirent.h. * admin/CPP-DEFINES (HAVE_CLOSEDIR, HAVE_DIRENT_H): Remove. * admin/notes/copyright: Adjust to src/ndir.h -> nt/inc/dirent.h renaming. * configure.ac: Do not check for dirent.h or closdir. * nt/inc/dirent.h: Rename from ../src/ndir.h, with these changes: (struct dirent): Rename from struct direct. All uses changed. * nt/inc/sys/dir.h: Remove. * src/dired.c: Assume HAVE_DIRENT_H. (NAMLEN): Remove, replacing with ... (dirent_namelen): New function. All uses changed. Use the GNU macro _D_EXACT_NAMELEN if available, as it's faster than strlen. (DIRENTRY): Remove, replacing all uses with 'struct dirent'. (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero. * src/makefile.w32-in (DIR_H): Remove. All uses replaced with $(NT_INC)/dirent.h. ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h. * src/ndir.h: Rename to ../nt/inc/dirent.h. * src/sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove. Do not include ; no longer needed. * src/w32.c: Include rather than "ndir.h". diff: === modified file 'ChangeLog' --- ChangeLog 2012-11-21 21:06:52 +0000 +++ ChangeLog 2012-11-23 07:48:43 +0000 @@ -1,3 +1,8 @@ +2012-11-23 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958). + * configure.ac: Do not check for dirent.h or closdir. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-11-21 21:06:52 +0000 +++ admin/CPP-DEFINES 2012-11-23 07:48:43 +0000 @@ -118,7 +118,6 @@ HAVE_CFSETSPEED HAVE_CLOCK_GETTIME HAVE_CLOCK_SETTIME -HAVE_CLOSEDIR HAVE_COFF_H HAVE_COM_ERR_H HAVE_COPYSIGN @@ -143,7 +142,6 @@ HAVE_DEV_PTMX HAVE_DIALOGS HAVE_DIFFTIME -HAVE_DIRENT_H HAVE_DUP2 HAVE_ENDGRENT HAVE_ENDPWENT === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-11-21 21:06:52 +0000 +++ admin/ChangeLog 2012-11-23 07:48:43 +0000 @@ -1,3 +1,9 @@ +2012-11-23 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958). + * CPP-DEFINES (HAVE_CLOSEDIR, HAVE_DIRENT_H): Remove. + * notes/copyright: Adjust to src/ndir.h -> nt/inc/dirent.h renaming. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === modified file 'admin/notes/copyright' --- admin/notes/copyright 2012-01-19 07:21:25 +0000 +++ admin/notes/copyright 2012-11-23 07:48:43 +0000 @@ -380,7 +380,7 @@ src/gmalloc.c - contains numerous copyrights from the GNU C library. Leave them alone. -src/ndir.h +nt/inc/dirent.h - see comments below. This file is OK to be released with Emacs 22, but we may want to revisit it afterwards. @@ -429,7 +429,7 @@ File says it's in the public domain, but that might not make it so. etc/e/eterm-color.ti -src/ndir.h +nt/inc/dirent.h On legal advice from Matt Norwood, the following comment was added to these files in Feb/Mar 2007: === modified file 'configure.ac' --- configure.ac 2012-11-21 21:06:52 +0000 +++ configure.ac 2012-11-23 07:48:43 +0000 @@ -1289,7 +1289,7 @@ linux/version.h sys/systeminfo.h coff.h pty.h sys/vlimit.h sys/resource.h - sys/utsname.h pwd.h utmp.h dirent.h util.h) + sys/utsname.h pwd.h utmp.h util.h) AC_MSG_CHECKING(if personality LINUX32 can be set) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[personality (PER_LINUX32)]])], @@ -2891,7 +2891,7 @@ AC_CHECK_FUNCS(gethostname \ -closedir getrusage get_current_dir_name \ +getrusage get_current_dir_name \ lrand48 \ select getpagesize setlocale \ utimes getrlimit setrlimit shutdown getaddrinfo \ === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-21 21:06:52 +0000 +++ nt/ChangeLog 2012-11-23 07:48:43 +0000 @@ -1,3 +1,10 @@ +2012-11-23 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958). + * inc/dirent.h: Rename from ../src/ndir.h, with these changes: + (struct dirent): Rename from struct direct. All uses changed. + * inc/sys/dir.h: Remove. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === renamed file 'src/ndir.h' => 'nt/inc/dirent.h' --- src/ndir.h 2011-01-15 23:16:57 +0000 +++ nt/inc/dirent.h 2012-11-23 07:48:43 +0000 @@ -1,7 +1,5 @@ /* - -- definitions for 4.2BSD-compatible directory access - - last edit: 09-Jul-1983 D A Gwyn + -- definitions for POSIX-compatible directory access * The code here is forced by the interface, and is not subject to * copyright, constituting the only possible expression of the @@ -16,7 +14,7 @@ #endif /* not WINDOWSNT */ /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */ -struct direct /* data from readdir() */ +struct dirent /* data from readdir() */ { long d_ino; /* inode number of entry */ unsigned short d_reclen; /* length of this record */ @@ -33,9 +31,8 @@ } DIR; /* stream data from opendir() */ extern DIR *opendir (char *); -extern struct direct *readdir (DIR *); +extern struct dirent *readdir (DIR *); extern void seekdir (DIR *, long); extern void closedir (DIR *); #define rewinddir( dirp ) seekdir( dirp, 0L ) - === removed file 'nt/inc/sys/dir.h' --- nt/inc/sys/dir.h 2011-01-15 23:16:57 +0000 +++ nt/inc/sys/dir.h 1970-01-01 00:00:00 +0000 @@ -1,6 +0,0 @@ -/* - * map sys\dir.h to ..\..\..\src\ndir.h - */ - -#include "..\..\..\src\ndir.h" - === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-23 06:23:28 +0000 +++ src/ChangeLog 2012-11-23 07:48:43 +0000 @@ -1,3 +1,20 @@ +2012-11-23 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958). + * dired.c: Assume HAVE_DIRENT_H. + (NAMLEN): Remove, replacing with ... + (dirent_namelen): New function. All uses changed. Use the GNU macro + _D_EXACT_NAMELEN if available, as it's faster than strlen. + (DIRENTRY): Remove, replacing all uses with 'struct dirent'. + (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero. + * makefile.w32-in (DIR_H): Remove. All uses replaced with + $(NT_INC)/dirent.h. + ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h. + * ndir.h: Rename to ../nt/inc/dirent.h. + * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove. + Do not include ; no longer needed. + * w32.c: Include rather than "ndir.h". + 2012-11-23 Chong Yidong * xftfont.c (xftfont_open): Remove duplicate assignment. === modified file 'src/dired.c' --- src/dired.c 2012-10-01 02:07:14 +0000 +++ src/dired.c 2012-11-23 07:48:43 +0000 @@ -31,44 +31,10 @@ #include #include -/* The d_nameln member of a struct dirent includes the '\0' character - on some systems, but not on others. What's worse, you can't tell - at compile-time which one it will be, since it really depends on - the sort of system providing the filesystem you're reading from, - not the system you are running on. Paul Eggert - says this occurs when Emacs is running on a - SunOS 4.1.2 host, reading a directory that is remote-mounted from a - Solaris 2.1 host and is in a native Solaris 2.1 filesystem. - - Since applying strlen to the name always works, we'll just do that. */ -#define NAMLEN(p) strlen (p->d_name) - -#ifdef HAVE_DIRENT_H - #include -#define DIRENTRY struct dirent - -#else /* not HAVE_DIRENT_H */ - -#include -#include - -#define DIRENTRY struct direct - -extern DIR *opendir (char *); -extern struct direct *readdir (DIR *); - -#endif /* HAVE_DIRENT_H */ - #include #include -#ifdef MSDOS -#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0) -#else -#define DIRENTRY_NONEMPTY(p) ((p)->d_ino) -#endif - #include "lisp.h" #include "systime.h" #include "character.h" @@ -88,6 +54,17 @@ static ptrdiff_t scmp (const char *, const char *, ptrdiff_t); +/* Return the number of bytes in DP's name. */ +static ptrdiff_t +dirent_namelen (struct dirent *dp) +{ +#ifdef _D_EXACT_NAMLEN + return _D_EXACT_NAMLEN (dp); +#else + return strlen (dp->d_name); +#endif +} + #ifdef WINDOWSNT Lisp_Object directory_files_internal_w32_unwind (Lisp_Object arg) @@ -124,7 +101,7 @@ bool needsep = 0; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; - DIRENTRY *dp; + struct dirent *dp; #ifdef WINDOWSNT Lisp_Object w32_save = Qnil; #endif @@ -209,6 +186,11 @@ /* Loop reading blocks until EOF or error. */ for (;;) { + ptrdiff_t len; + bool wanted = 0; + Lisp_Object name, finalname; + struct gcpro gcpro1, gcpro2; + errno = 0; dp = readdir (d); @@ -225,89 +207,81 @@ if (dp == NULL) break; - if (DIRENTRY_NONEMPTY (dp)) + len = dirent_namelen (dp); + name = finalname = make_unibyte_string (dp->d_name, len); + GCPRO2 (finalname, name); + + /* Note: DECODE_FILE can GC; it should protect its argument, + though. */ + name = DECODE_FILE (name); + len = SBYTES (name); + + /* Now that we have unwind_protect in place, we might as well + allow matching to be interrupted. */ + immediate_quit = 1; + QUIT; + + if (NILP (match) + || (0 <= re_search (bufp, SSDATA (name), len, 0, len, 0))) + wanted = 1; + + immediate_quit = 0; + + if (wanted) { - ptrdiff_t len; - bool wanted = 0; - Lisp_Object name, finalname; - struct gcpro gcpro1, gcpro2; - - len = NAMLEN (dp); - name = finalname = make_unibyte_string (dp->d_name, len); - GCPRO2 (finalname, name); - - /* Note: DECODE_FILE can GC; it should protect its argument, - though. */ - name = DECODE_FILE (name); - len = SBYTES (name); - - /* Now that we have unwind_protect in place, we might as well - allow matching to be interrupted. */ - immediate_quit = 1; - QUIT; - - if (NILP (match) - || (0 <= re_search (bufp, SSDATA (name), len, 0, len, 0))) - wanted = 1; - - immediate_quit = 0; - - if (wanted) - { - if (!NILP (full)) - { - Lisp_Object fullname; - ptrdiff_t nbytes = len + directory_nbytes + needsep; - ptrdiff_t nchars; - - fullname = make_uninit_multibyte_string (nbytes, nbytes); - memcpy (SDATA (fullname), SDATA (directory), - directory_nbytes); - - if (needsep) - SSET (fullname, directory_nbytes, DIRECTORY_SEP); - - memcpy (SDATA (fullname) + directory_nbytes + needsep, - SDATA (name), len); - - nchars = chars_in_text (SDATA (fullname), nbytes); - - /* Some bug somewhere. */ - if (nchars > nbytes) - emacs_abort (); - - STRING_SET_CHARS (fullname, nchars); - if (nchars == nbytes) - STRING_SET_UNIBYTE (fullname); - - finalname = fullname; - } - else - finalname = name; - - if (attrs) - { - /* Construct an expanded filename for the directory entry. - Use the decoded names for input to Ffile_attributes. */ - Lisp_Object decoded_fullname, fileattrs; - struct gcpro gcpro1, gcpro2; - - decoded_fullname = fileattrs = Qnil; - GCPRO2 (decoded_fullname, fileattrs); - - /* Both Fexpand_file_name and Ffile_attributes can GC. */ - decoded_fullname = Fexpand_file_name (name, directory); - fileattrs = Ffile_attributes (decoded_fullname, id_format); - - list = Fcons (Fcons (finalname, fileattrs), list); - UNGCPRO; - } - else - list = Fcons (finalname, list); - } - - UNGCPRO; + if (!NILP (full)) + { + Lisp_Object fullname; + ptrdiff_t nbytes = len + directory_nbytes + needsep; + ptrdiff_t nchars; + + fullname = make_uninit_multibyte_string (nbytes, nbytes); + memcpy (SDATA (fullname), SDATA (directory), + directory_nbytes); + + if (needsep) + SSET (fullname, directory_nbytes, DIRECTORY_SEP); + + memcpy (SDATA (fullname) + directory_nbytes + needsep, + SDATA (name), len); + + nchars = chars_in_text (SDATA (fullname), nbytes); + + /* Some bug somewhere. */ + if (nchars > nbytes) + emacs_abort (); + + STRING_SET_CHARS (fullname, nchars); + if (nchars == nbytes) + STRING_SET_UNIBYTE (fullname); + + finalname = fullname; + } + else + finalname = name; + + if (attrs) + { + /* Construct an expanded filename for the directory entry. + Use the decoded names for input to Ffile_attributes. */ + Lisp_Object decoded_fullname, fileattrs; + struct gcpro gcpro1, gcpro2; + + decoded_fullname = fileattrs = Qnil; + GCPRO2 (decoded_fullname, fileattrs); + + /* Both Fexpand_file_name and Ffile_attributes can GC. */ + decoded_fullname = Fexpand_file_name (name, directory); + fileattrs = Ffile_attributes (decoded_fullname, id_format); + + list = Fcons (Fcons (finalname, fileattrs), list); + UNGCPRO; + } + else + list = Fcons (finalname, list); } + + UNGCPRO; } block_input (); @@ -442,7 +416,8 @@ return file_name_completion (file, directory, 1, Qnil); } -static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); +static int file_name_completion_stat (Lisp_Object dirname, struct dirent *dp, + struct stat *st_addr); static Lisp_Object Qdefault_directory; static Lisp_Object @@ -499,7 +474,7 @@ /* (att3b compiler bug requires do a null comparison this way) */ while (1) { - DIRENTRY *dp; + struct dirent *dp; ptrdiff_t len; bool canexclude = 0; @@ -517,11 +492,10 @@ if (!dp) break; - len = NAMLEN (dp); + len = dirent_namelen (dp); QUIT; - if (! DIRENTRY_NONEMPTY (dp) - || len < SCHARS (encoded_file) + if (len < SCHARS (encoded_file) || 0 <= scmp (dp->d_name, SSDATA (encoded_file), SCHARS (encoded_file))) continue; @@ -806,9 +780,10 @@ } static int -file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr) +file_name_completion_stat (Lisp_Object dirname, struct dirent *dp, + struct stat *st_addr) { - ptrdiff_t len = NAMLEN (dp); + ptrdiff_t len = dirent_namelen (dp); ptrdiff_t pos = SCHARS (dirname); int value; USE_SAFE_ALLOCA; === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-11-17 23:16:24 +0000 +++ src/makefile.w32-in 2012-11-23 07:48:43 +0000 @@ -413,8 +413,6 @@ $(MS_W32_H) CONFIG_H = $(SRC)/config.h \ $(CONF_POST_H) -DIR_H = $(NT_INC)/sys/dir.h \ - $(SRC)/ndir.h W32GUI_H = $(SRC)/w32gui.h \ $(SYSTIME_H) DISPEXTERN_H = $(SRC)/dispextern.h \ @@ -714,6 +712,7 @@ $(SRC)/blockinput.h \ $(SRC)/commands.h \ $(SRC)/regex.h \ + $(NT_INC)/dirent.h \ $(NT_INC)/pwd.h \ $(NT_INC)/sys/stat.h \ $(NT_INC)/unistd.h \ @@ -722,7 +721,6 @@ $(CHARSET_H) \ $(CODING_H) \ $(CONFIG_H) \ - $(DIR_H) \ $(FILEMODE_H) \ $(GRP_H) \ $(LISP_H) \ @@ -1175,11 +1173,11 @@ $(BLD)/w32.$(O) : \ $(SRC)/w32.c \ - $(SRC)/ndir.h \ $(SRC)/w32.h \ $(SRC)/w32common.h \ $(SRC)/w32heap.h \ $(SRC)/w32select.h \ + $(NT_INC)/dirent.h \ $(NT_INC)/pwd.h \ $(NT_INC)/sys/file.h \ $(NT_INC)/sys/time.h \ === modified file 'src/sysdep.c' --- src/sysdep.c 2012-11-21 21:06:52 +0000 +++ src/sysdep.c 2012-11-23 07:48:43 +0000 @@ -2220,28 +2220,6 @@ &emacs_norealloc_allocator, careadlinkatcwd); } -/* Directory routines for systems that don't have them. */ - -#ifdef HAVE_DIRENT_H - -#include - -#if !defined (HAVE_CLOSEDIR) - -int -closedir (DIR *dirp /* stream from opendir */) -{ - int rtnval; - - rtnval = emacs_close (dirp->dd_fd); - xfree (dirp); - - return rtnval; -} -#endif /* not HAVE_CLOSEDIR */ -#endif /* HAVE_DIRENT_H */ - - /* Return a struct timeval that is roughly equivalent to T. Use the least timeval not less than T. Return an extremal value if the result would overflow. */ === modified file 'src/w32.c' --- src/w32.c 2012-11-22 03:56:38 +0000 +++ src/w32.c 2012-11-23 07:48:43 +0000 @@ -179,7 +179,7 @@ #undef sendto #include "w32.h" -#include "ndir.h" +#include #include "w32common.h" #include "w32heap.h" #include "w32select.h" @@ -2448,7 +2448,7 @@ and readdir. We can't use the procedures supplied in sysdep.c, so we provide them here. */ -struct direct dir_static; /* simulated directory contents */ +struct dirent dir_static; /* simulated directory contents */ static HANDLE dir_find_handle = INVALID_HANDLE_VALUE; static int dir_is_fat; static char dir_pathname[MAXPATHLEN+1]; @@ -2518,7 +2518,7 @@ xfree ((char *) dirp); } -struct direct * +struct dirent * readdir (DIR *dirp) { int downcase = !NILP (Vw32_downcase_file_names); @@ -2572,7 +2572,7 @@ downcase = 1; /* 8+3 aliases are returned in all caps */ } dir_static.d_namlen = strlen (dir_static.d_name); - dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 + + dir_static.d_reclen = sizeof (struct dirent) - MAXNAMLEN + 3 + dir_static.d_namlen - dir_static.d_namlen % 4; /* If the file name in cFileName[] includes `?' characters, it means ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.