Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103873. ------------------------------------------------------------ revno: 103873 committer: Tassilo Horn branch nick: trunk timestamp: Fri 2011-04-08 22:09:19 +0200 message: Fit contents to emacs window support for doc-view by Sho Nakatani. 2011-03-28 Sho Nakatani gmail.com> * doc-view.el (doc-view-fit-width-to-window) (doc-view-fit-height-to-window, doc-view-fit-page-to-window): New functions for fitting the shown image to the Emacs window size. (doc-view-mode-map): Add bindings for the new functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-08 18:53:26 +0000 +++ lisp/ChangeLog 2011-04-08 20:09:19 +0000 @@ -1,3 +1,10 @@ +2011-04-08 Sho Nakatani + + * doc-view.el (doc-view-fit-width-to-window) + (doc-view-fit-height-to-window, doc-view-fit-page-to-window): New + functions for fitting the shown image to the Emacs window size. + (doc-view-mode-map): Add bindings for the new functions. + 2011-03-24 Juanma Barranquero * vc-annotate.el (vc-annotate-show-log-revision-at-line): === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2011-02-17 21:19:13 +0000 +++ lisp/doc-view.el 2011-04-08 20:09:19 +0000 @@ -328,6 +328,10 @@ ;; Zoom in/out. (define-key map "+" 'doc-view-enlarge) (define-key map "-" 'doc-view-shrink) + ;; Fit the image to the window + (define-key map "W" 'doc-view-fit-width-to-window) + (define-key map "H" 'doc-view-fit-height-to-window) + (define-key map "P" 'doc-view-fit-page-to-window) ;; Killing the buffer (and the process) (define-key map (kbd "k") 'doc-view-kill-proc-and-buffer) (define-key map (kbd "K") 'doc-view-kill-proc) @@ -664,6 +668,78 @@ (interactive (list doc-view-shrink-factor)) (doc-view-enlarge (/ 1.0 factor))) +(defun doc-view-fit-width-to-window () + "Fit the image width to the window width." + (interactive) + (let ((win-width (- (nth 2 (window-inside-pixel-edges)) + (nth 0 (window-inside-pixel-edges)))) + (slice (doc-view-current-slice))) + (if (not slice) + (let ((img-width (car (image-display-size + (image-get-display-property) t)))) + (doc-view-enlarge (/ (float win-width) (float img-width)))) + + ;; If slice is set + (let* ((slice-width (nth 2 slice)) + (scale-factor (/ (float win-width) (float slice-width))) + (new-slice (mapcar (lambda (x) (ceiling (* scale-factor x))) slice))) + + (doc-view-enlarge scale-factor) + (setf (doc-view-current-slice) new-slice) + (doc-view-goto-page (doc-view-current-page)))))) + +(defun doc-view-fit-height-to-window () + "Fit the image height to the window height." + (interactive) + (let ((win-height (- (nth 3 (window-inside-pixel-edges)) + (nth 1 (window-inside-pixel-edges)))) + (slice (doc-view-current-slice))) + (if (not slice) + (let ((img-height (cdr (image-display-size + (image-get-display-property) t)))) + ;; When users call 'doc-view-fit-height-to-window', + ;; they might want to go to next page by typing SPC + ;; ONLY once. So I used '(- win-height 1)' instead of + ;; 'win-height' + (doc-view-enlarge (/ (float (- win-height 1)) (float img-height)))) + + ;; If slice is set + (let* ((slice-height (nth 3 slice)) + (scale-factor (/ (float (- win-height 1)) (float slice-height))) + (new-slice (mapcar (lambda (x) (ceiling (* scale-factor x))) slice))) + + (doc-view-enlarge scale-factor) + (setf (doc-view-current-slice) new-slice) + (doc-view-goto-page (doc-view-current-page)))))) + +(defun doc-view-fit-page-to-window () + "Fit the image to the window. +More specifically, this function enlarges image by: + +min {(window-width / image-width), (window-height / image-height)} times." + (interactive) + (let ((win-width (- (nth 2 (window-inside-pixel-edges)) + (nth 0 (window-inside-pixel-edges)))) + (win-height (- (nth 3 (window-inside-pixel-edges)) + (nth 1 (window-inside-pixel-edges)))) + (slice (doc-view-current-slice))) + (if (not slice) + (let ((img-width (car (image-display-size + (image-get-display-property) t))) + (img-height (cdr (image-display-size + (image-get-display-property) t)))) + (doc-view-enlarge (min (/ (float win-width) (float img-width)) + (/ (float (- win-height 1)) (float img-height))))) + ;; If slice is set + (let* ((slice-width (nth 2 slice)) + (slice-height (nth 3 slice)) + (scale-factor (min (/ (float win-width) (float slice-width)) + (/ (float (- win-height 1)) (float slice-height)))) + (new-slice (mapcar (lambda (x) (ceiling (* scale-factor x))) slice))) + (doc-view-enlarge scale-factor) + (setf (doc-view-current-slice) new-slice) + (doc-view-goto-page (doc-view-current-page)))))) + (defun doc-view-reconvert-doc () "Reconvert the current document. Should be invoked when the cached images aren't up-to-date." ------------------------------------------------------------ revno: 103872 [merge] committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-04-08 14:54:05 -0400 message: Merge changes from emacs-23 branch diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-04-06 12:18:10 +0000 +++ doc/emacs/ChangeLog 2011-04-08 18:53:26 +0000 @@ -1,3 +1,7 @@ +2011-03-26 Chong Yidong + + * display.texi (Auto Scrolling): Fix scroll-up/scroll-down confusion. + 2011-03-30 Eli Zaretskii * display.texi (Auto Scrolling): Document the limit of 100 lines === modified file 'doc/emacs/display.texi' --- doc/emacs/display.texi 2011-03-30 20:59:42 +0000 +++ doc/emacs/display.texi 2011-04-08 18:53:26 +0000 @@ -206,16 +206,18 @@ @code{scroll-up-aggressively} and @code{scroll-down-aggressively}. The value of @code{scroll-up-aggressively} should be either @code{nil}, or a fraction @var{f} between 0 and 1. A fraction -specifies where on the screen to put point when scrolling upward: when -a window scrolls up because point is above the window start, the new +specifies where on the screen to put point when scrolling upward, +i.e.@: when point moves forward in the buffer, and therefore text +scrolls up in the window. When point goes off the window end, the new start position is chosen to put point @var{f} parts of the window -height from the top. Thus, larger @var{f} means more aggressive -scrolling. The default value, @code{nil}, is equivalent to 0.5. +height from the bottom. Thus, larger @var{f} means more aggressive +scrolling: more new text is brought into view. The default value, +@code{nil}, is equivalent to 0.5. Likewise, @code{scroll-down-aggressively} is used for scrolling -down. The value specifies how far point should be placed from the -bottom of the window; thus, as with @code{scroll-up-aggressively}, a -larger value is more aggressive. +down, i.e.@: moving point back in the buffer. The value specifies how +far point should be placed from the top of the window; thus, as with +@code{scroll-up-aggressively}, a larger value is more aggressive. These two variables are ignored if either @code{scroll-step} or @code{scroll-conservatively} are set to a non-zero value. === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-04-06 12:18:10 +0000 +++ doc/lispref/ChangeLog 2011-04-08 18:53:26 +0000 @@ -1,3 +1,18 @@ +2011-03-21 Stefan Monnier + + * minibuf.texi (Basic Completion): Be a bit more precise about the + valid kinds of completion tables. + (Programmed Completion): Remove obsolete text about lambda expressions + not being valid completion tables. + +2011-03-19 Chong Yidong + + * positions.texi (Excursions): Explain the "save-excursion + defeated by set-buffer" warning. + + * buffers.texi (Current Buffer): Copyedits. Don't recommend using + save-excursion. Suggested by Uday S Reddy. + 2011-04-01 Stefan Monnier * variables.texi (Defining Variables): Mention the new meaning of `defvar'. === modified file 'doc/lispref/buffers.texi' --- doc/lispref/buffers.texi 2011-01-25 04:08:28 +0000 +++ doc/lispref/buffers.texi 2011-04-08 18:53:26 +0000 @@ -85,43 +85,63 @@ @cindex changing to another buffer @cindex current buffer - There are, in general, many buffers in an Emacs session. At any time, -one of them is designated as the @dfn{current buffer}. This is the -buffer in which most editing takes place, because most of the primitives -for examining or changing text in a buffer operate implicitly on the -current buffer (@pxref{Text}). Normally the buffer that is displayed on -the screen in the selected window is the current buffer, but this is not -always so: a Lisp program can temporarily designate any buffer as -current in order to operate on its contents, without changing what is -displayed on the screen. - - The way to designate a current buffer in a Lisp program is by calling -@code{set-buffer}. The specified buffer remains current until a new one -is designated. - - When an editing command returns to the editor command loop, the -command loop designates the buffer displayed in the selected window as -current, to prevent confusion: the buffer that the cursor is in when -Emacs reads a command is the buffer that the command will apply to. -(@xref{Command Loop}.) Therefore, @code{set-buffer} is not the way to -switch visibly to a different buffer so that the user can edit it. For -that, you must use the functions described in @ref{Displaying Buffers}. - - @strong{Warning:} Lisp functions that change to a different current buffer -should not depend on the command loop to set it back afterwards. -Editing commands written in Emacs Lisp can be called from other programs -as well as from the command loop; it is convenient for the caller if -the subroutine does not change which buffer is current (unless, of -course, that is the subroutine's purpose). Therefore, you should -normally use @code{set-buffer} within a @code{save-current-buffer} or -@code{save-excursion} (@pxref{Excursions}) form that will restore the -current buffer when your function is done. Here, as an example, is a + There are, in general, many buffers in an Emacs session. At any +time, one of them is designated the @dfn{current buffer}---the buffer +in which most editing takes place. Most of the primitives for +examining or changing text operate implicitly on the current buffer +(@pxref{Text}). + + Normally, the buffer displayed in the selected window is the current +buffer, but this is not always so: a Lisp program can temporarily +designate any buffer as current in order to operate on its contents, +without changing what is displayed on the screen. The most basic +function for designating a current buffer is @code{set-buffer}. + +@defun current-buffer +This function returns the current buffer. + +@example +@group +(current-buffer) + @result{} # +@end group +@end example +@end defun + +@defun set-buffer buffer-or-name +This function makes @var{buffer-or-name} the current buffer. +@var{buffer-or-name} must be an existing buffer or the name of an +existing buffer. The return value is the buffer made current. + +This function does not display the buffer in any window, so the user +cannot necessarily see the buffer. But Lisp programs will now operate +on it. +@end defun + + When an editing command returns to the editor command loop, Emacs +automatically calls @code{set-buffer} on the buffer shown in the +selected window. This is to prevent confusion: it ensures that the +buffer that the cursor is in, when Emacs reads a command, is the +buffer to which that command applies (@pxref{Command Loop}). Thus, +you should not use @code{set-buffer} to switch visibly to a different +buffer; for that, use the functions described in @ref{Displaying +Buffers}. + + When writing a Lisp function, do @emph{not} rely on this behavior of +the command loop to restore the current buffer after an operation. +Editing commands can also be called as Lisp functions by other +programs, not just from the command loop; it is convenient for the +caller if the subroutine does not change which buffer is current +(unless, of course, that is the subroutine's purpose). + + To operate temporarily on another buffer, put the @code{set-buffer} +within a @code{save-current-buffer} form. Here, as an example, is a simplified version of the command @code{append-to-buffer}: @example @group (defun append-to-buffer (buffer start end) - "Append to specified buffer the text of the region." + "Append the text of the region to BUFFER." (interactive "BAppend to buffer: \nr") (let ((oldbuf (current-buffer))) (save-current-buffer @@ -131,27 +151,36 @@ @end example @noindent -This function binds a local variable to record the current buffer, and -then @code{save-current-buffer} arranges to make it current again. -Next, @code{set-buffer} makes the specified buffer current. Finally, +Here, we bind a local variable to record the current buffer, and then +@code{save-current-buffer} arranges to make it current again later. +Next, @code{set-buffer} makes the specified buffer current, and @code{insert-buffer-substring} copies the string from the original -current buffer to the specified (and now current) buffer. - - If the buffer appended to happens to be displayed in some window, -the next redisplay will show how its text has changed. Otherwise, you -will not see the change immediately on the screen. The buffer becomes -current temporarily during the execution of the command, but this does -not cause it to be displayed. - - If you make local bindings (with @code{let} or function arguments) for -a variable that may also have buffer-local bindings, make sure that the -same buffer is current at the beginning and at the end of the local -binding's scope. Otherwise you might bind it in one buffer and unbind -it in another! There are two ways to do this. In simple cases, you may -see that nothing ever changes the current buffer within the scope of the -binding. Otherwise, use @code{save-current-buffer} or -@code{save-excursion} to make sure that the buffer current at the -beginning is current again whenever the variable is unbound. +buffer to the specified (and now current) buffer. + + Alternatively, we can use the @code{with-current-buffer} macro: + +@example +@group +(defun append-to-buffer (buffer start end) + "Append the text of the region to BUFFER." + (interactive "BAppend to buffer: \nr") + (let ((oldbuf (current-buffer))) + (with-current-buffer (get-buffer-create buffer) + (insert-buffer-substring oldbuf start end)))) +@end group +@end example + + In either case, if the buffer appended to happens to be displayed in +some window, the next redisplay will show how its text has changed. +If it is not displayed in any window, you will not see the change +immediately on the screen. The command causes the buffer to become +current temporarily, but does not cause it to be displayed. + + If you make local bindings (with @code{let} or function arguments) +for a variable that may also have buffer-local bindings, make sure +that the same buffer is current at the beginning and at the end of the +local binding's scope. Otherwise you might bind it in one buffer and +unbind it in another! Do not rely on using @code{set-buffer} to change the current buffer back, because that won't do the job if a quit happens while the wrong @@ -168,29 +197,9 @@ @end example @noindent -Using @code{save-current-buffer}, as we did, handles quitting, errors, -and @code{throw}, as well as ordinary evaluation. - -@defun current-buffer -This function returns the current buffer. - -@example -@group -(current-buffer) - @result{} # -@end group -@end example -@end defun - -@defun set-buffer buffer-or-name -This function makes @var{buffer-or-name} the current buffer. -@var{buffer-or-name} must be an existing buffer or the name of an -existing buffer. The return value is the buffer made current. - -This function does not display the buffer in any window, so the user -cannot necessarily see the buffer. But Lisp programs will now operate -on it. -@end defun +Using @code{save-current-buffer} or @code{with-current-buffer}, as we +did, correctly handles quitting, errors, and @code{throw}, as well as +ordinary evaluation. @defspec save-current-buffer body@dots{} The @code{save-current-buffer} special form saves the identity of the === modified file 'doc/lispref/minibuf.texi' --- doc/lispref/minibuf.texi 2011-02-27 22:10:48 +0000 +++ doc/lispref/minibuf.texi 2011-04-08 18:53:26 +0000 @@ -645,9 +645,9 @@ @defun try-completion string collection &optional predicate This function returns the longest common substring of all possible completions of @var{string} in @var{collection}. The value of -@var{collection} must be a list of strings or symbols, an alist, an -obarray, a hash table, or a completion function (@pxref{Programmed -Completion}). +@var{collection} must be a list of strings, an alist whose keys are +strings or symbols, an obarray, a hash table, or a completion function +(@pxref{Programmed Completion}). Completion compares @var{string} against each of the permissible completions specified by @var{collection}. If no permissible @@ -658,11 +658,11 @@ If @var{collection} is an alist (@pxref{Association Lists}), the permissible completions are the elements of the alist that are either -strings, symbols, or conses whose @sc{car} is a string or symbol. +strings, or conses whose @sc{car} is a string or symbol. Symbols are converted to strings using @code{symbol-name}. Other elements of the alist are ignored. (Remember that in Emacs Lisp, the elements of alists do not @emph{have} to be conses.) In particular, a -list of strings or symbols is allowed, even though we usually do not +list of strings is allowed, even though we usually do not think of such lists as alists. @cindex obarray in completion @@ -678,7 +678,7 @@ If @var{collection} is a hash table, then the keys that are strings are the possible completions. Other keys are ignored. -You can also use a symbol that is a function as @var{collection}. +You can also use a function as @var{collection}. Then the function is solely responsible for performing completion; @code{try-completion} returns whatever this function returns. The function is called with three arguments: @var{string}, @var{predicate} @@ -1632,12 +1632,12 @@ @subsection Programmed Completion @cindex programmed completion - Sometimes it is not possible to create an alist or an obarray -containing all the intended possible completions. In such a case, you -can supply your own function to compute the completion of a given -string. This is called @dfn{programmed completion}. Emacs uses -programmed completion when completing file names (@pxref{File Name -Completion}), among many other cases. + Sometimes it is not possible or convenient to create an alist or +an obarray containing all the intended possible completions ahead +of time. In such a case, you can supply your own function to compute +the completion of a given string. This is called @dfn{programmed +completion}. Emacs uses programmed completion when completing file +names (@pxref{File Name Completion}), among many other cases. To use this feature, pass a function as the @var{collection} argument to @code{completing-read}. The function @@ -1665,7 +1665,7 @@ @end itemize There are currently four methods, i.e. four flag values, one for - each of the four different basic operations: +each of the four different basic operations: @itemize @bullet @item @@ -1696,14 +1696,6 @@ in SUFFIX. @end itemize - It would be consistent and clean for completion functions to allow -lambda expressions (lists that are functions) as well as function -symbols as @var{collection}, but this is impossible. Lists as -completion tables already have other meanings, and it would be -unreliable to treat one differently just because it is also a possible -function. So you must arrange for any function you wish to use for -completion to be encapsulated in a symbol. - @defun completion-table-dynamic function This function is a convenient way to write a function that can act as programmed completion function. The argument @var{function} should be === modified file 'doc/lispref/positions.texi' --- doc/lispref/positions.texi 2011-01-25 04:08:28 +0000 +++ doc/lispref/positions.texi 2011-04-08 18:53:26 +0000 @@ -797,69 +797,72 @@ @cindex excursion It is often useful to move point ``temporarily'' within a localized -portion of the program, or to switch buffers temporarily. This is -called an @dfn{excursion}, and it is done with the @code{save-excursion} -special form. This construct initially remembers the identity of the -current buffer, and its values of point and the mark, and restores them -after the completion of the excursion. +portion of the program. This is called an @dfn{excursion}, and it is +done with the @code{save-excursion} special form. This construct +remembers the initial identity of the current buffer, and its values +of point and the mark, and restores them after the excursion +completes. It is the standard way to move point within one part of a +program and avoid affecting the rest of the program, and is used +thousands of times in the Lisp sources of Emacs. - The forms for saving and restoring the configuration of windows are -described elsewhere (see @ref{Window Configurations}, and @pxref{Frame -Configurations}). When only the identity of the current buffer needs -to be saved and restored, it is preferable to use -@code{save-current-buffer} instead. + If you only need to save and restore the identity of the current +buffer, use @code{save-current-buffer} or @code{with-current-buffer} +instead (@pxref{Current Buffer}). If you need to save or restore +window configurations, see the forms described in @ref{Window +Configurations} and in @ref{Frame Configurations}. @defspec save-excursion body@dots{} @cindex mark excursion @cindex point excursion -The @code{save-excursion} special form saves the identity of the current -buffer and the values of point and the mark in it, evaluates -@var{body}, and finally restores the buffer and its saved values of -point and the mark. All three saved values are restored even in case of -an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}). - -The @code{save-excursion} special form is the standard way to move -point within one part of a program and avoid affecting the rest of the -program. It is used more than 4000 times in the Lisp sources -of Emacs. - -@code{save-excursion} does not save the values of point and the mark for -other buffers, so changes in other buffers remain in effect after -@code{save-excursion} exits. +This special form saves the identity of the current buffer and the +values of point and the mark in it, evaluates @var{body}, and finally +restores the buffer and its saved values of point and the mark. All +three saved values are restored even in case of an abnormal exit via +@code{throw} or error (@pxref{Nonlocal Exits}). + +The value returned by @code{save-excursion} is the result of the last +form in @var{body}, or @code{nil} if no body forms were given. +@end defspec + + Because @code{save-excursion} only saves point and mark for the +buffer that was current at the start of the excursion, any changes +made to point and/or mark in other buffers, during the excursion, will +remain in effect afterward. This frequently leads to unintended +consequences, so the byte compiler warns if you call @code{set-buffer} +during an excursion: + +@example +Warning: @code{save-excursion} defeated by @code{set-buffer} +@end example + +@noindent +To avoid such problems, you should call @code{save-excursion} only +after setting the desired current buffer, as in the following example: + +@example +@group +(defun append-string-to-buffer (string buffer) + "Append STRING to the end of BUFFER." + (with-current-buffer buffer + (save-excursion + (goto-char (point-max)) + (insert string)))) +@end group +@end example @cindex window excursions -Likewise, @code{save-excursion} does not restore window-buffer + Likewise, @code{save-excursion} does not restore window-buffer correspondences altered by functions such as @code{switch-to-buffer}. One way to restore these correspondences, and the selected window, is to use @code{save-window-excursion} inside @code{save-excursion} (@pxref{Window Configurations}). -The value returned by @code{save-excursion} is the result of the last -form in @var{body}, or @code{nil} if no body forms were given. - -@example -@group -(save-excursion @var{forms}) -@equiv{} -(let ((old-buf (current-buffer)) - (old-pnt (point-marker)) -@end group - (old-mark (copy-marker (mark-marker)))) - (unwind-protect - (progn @var{forms}) - (set-buffer old-buf) -@group - (goto-char old-pnt) - (set-marker (mark-marker) old-mark))) -@end group -@end example -@end defspec - @strong{Warning:} Ordinary insertion of text adjacent to the saved -point value relocates the saved value, just as it relocates all markers. -More precisely, the saved value is a marker with insertion type -@code{nil}. @xref{Marker Insertion Types}. Therefore, when the saved -point value is restored, it normally comes before the inserted text. +point value relocates the saved value, just as it relocates all +markers. More precisely, the saved value is a marker with insertion +type @code{nil}. @xref{Marker Insertion Types}. Therefore, when the +saved point value is restored, it normally comes before the inserted +text. Although @code{save-excursion} saves the location of the mark, it does not prevent functions which modify the buffer from setting === modified file 'etc/NEWS.23' --- etc/NEWS.23 2011-03-03 08:03:01 +0000 +++ etc/NEWS.23 2011-04-08 18:53:26 +0000 @@ -21,6 +21,13 @@ crt*.o files, if they are in a non-standard location. This is only used on x86-64 and s390x GNU/Linux architectures. +** The MS-Windows build prefers libpng version 1.14 or later. +Versions of libpng before 1.14 had security issues, so we now +recommend to use version 1.14 or later. Precompiled Windows binaries +require version 1.14 or later. See README.W32 and nt/INSTALL for +details and pointers to URLs where the latest libpng can be +downloaded. + * Changes in Emacs 23.3 ** The last-resort backup file `%backup%~' is now written to === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-08 17:08:17 +0000 +++ lisp/ChangeLog 2011-04-08 18:53:26 +0000 @@ -1,3 +1,8 @@ +2011-03-24 Juanma Barranquero + + * vc-annotate.el (vc-annotate-show-log-revision-at-line): + Fix typo in docstring. + 2011-04-08 Eli Zaretskii * simple.el (list-processes): If async subprocesses are not === modified file 'lisp/vc/vc-annotate.el' --- lisp/vc/vc-annotate.el 2011-01-25 04:08:28 +0000 +++ lisp/vc/vc-annotate.el 2011-04-08 18:53:26 +0000 @@ -489,7 +489,7 @@ "Visit the log of the revision at line. If the VC backend supports it, only show the log entry for the revision. If a *vc-change-log* buffer exists and already shows a log for -the file in question, search for the log entry required and move point ." +the file in question, search for the log entry required and move point." (interactive) (if (not (equal major-mode 'vc-annotate-mode)) (message "Cannot be invoked outside of a vc annotate buffer") === modified file 'src/ChangeLog' --- src/ChangeLog 2011-04-08 16:15:30 +0000 +++ src/ChangeLog 2011-04-08 18:53:26 +0000 @@ -1,3 +1,11 @@ +2011-04-08 Svante Signell (tiny change) + + * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450). + +2011-03-19 Christoph Scholtes + + * process.c (Fformat_network_address): Doc fix. + 2011-04-08 T.V. Raman (tiny change) * xml.c (parse_region): Avoid creating spurious whiespace nodes. === modified file 'src/process.c' --- src/process.c 2011-04-06 21:55:08 +0000 +++ src/process.c 2011-04-08 18:53:26 +0000 @@ -1261,9 +1261,9 @@ function to handle the output. BUFFER may also be nil, meaning that this process is not associated with any buffer. -PROGRAM is the program file name. It is searched for in PATH. If -nil, just associate a pty with the buffer. Remaining arguments are -strings to give program as arguments. +PROGRAM is the program file name. It is searched for in `exec-path' +(which see). If nil, just associate a pty with the buffer. Remaining +arguments are strings to give program as arguments. If you want to separate standard output from standard error, invoke the command through a shell and redirect one of them using the shell === modified file 'src/term.c' --- src/term.c 2011-04-06 04:58:58 +0000 +++ src/term.c 2011-04-08 18:53:26 +0000 @@ -3155,13 +3155,12 @@ if we don't have one at the moment. */ fd = emacs_open (name, O_RDWR | O_IGNORE_CTTY | O_NOCTTY, 0); else -#else +#endif /* O_IGNORE_CTTY */ /* Alas, O_IGNORE_CTTY is a GNU extension that seems to be only defined on Hurd. On other systems, we need to explicitly dissociate ourselves from the controlling tty when we want to open a frame on the same terminal. */ fd = emacs_open (name, O_RDWR | O_NOCTTY, 0); -#endif /* O_IGNORE_CTTY */ tty->name = xstrdup (name); terminal->name = xstrdup (name); ------------------------------------------------------------ revno: 103871 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-04-08 20:08:17 +0300 message: Bail out from list-processes if async subprocesses aren't available. lisp/simple.el (list-processes): If async subprocesses are not available, error out with a clear error message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-08 15:37:15 +0000 +++ lisp/ChangeLog 2011-04-08 17:08:17 +0000 @@ -1,3 +1,8 @@ +2011-04-08 Eli Zaretskii + + * simple.el (list-processes): If async subprocesses are not + available, error out with a clear error message. + 2011-04-08 Chong Yidong * help.el (help-form-show): New function, to be called from C. === modified file 'lisp/simple.el' --- lisp/simple.el 2011-04-06 21:13:17 +0000 +++ lisp/simple.el 2011-04-08 17:08:17 +0000 @@ -2769,6 +2769,8 @@ \"*Process List\". The return value is always nil." (interactive) + (or (fboundp 'process-list) + (error "Asynchronous subprocesses are not supported on this system")) (unless (bufferp buffer) (setq buffer (get-buffer-create "*Process List*"))) (with-current-buffer buffer ------------------------------------------------------------ revno: 103870 author: T.V. Raman committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-04-08 12:15:30 -0400 message: * src/xml.c (parse_region): Avoid creating spurious whiespace nodes. See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00200.html diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-04-08 15:51:28 +0000 +++ src/ChangeLog 2011-04-08 16:15:30 +0000 @@ -1,3 +1,7 @@ +2011-04-08 T.V. Raman (tiny change) + + * xml.c (parse_region): Avoid creating spurious whiespace nodes. + 2011-04-08 Chong Yidong * keyboard.c (read_char): Call Lisp function help-form-show, === modified file 'src/xml.c' --- src/xml.c 2011-03-19 02:43:47 +0000 +++ src/xml.c 2011-04-08 16:15:30 +0000 @@ -113,7 +113,7 @@ doc = xmlReadMemory ((char *) BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), bytes, burl, "utf-8", XML_PARSE_NONET|XML_PARSE_NOWARNING| - XML_PARSE_NOERROR); + XML_PARSE_NOBLANKS |XML_PARSE_NOERROR); if (doc != NULL) { ------------------------------------------------------------ revno: 103869 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-04-08 11:51:28 -0400 message: * keyboard.c (syms_of_keyboard): Use DEFSYM macro. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-04-08 15:37:15 +0000 +++ src/ChangeLog 2011-04-08 15:51:28 +0000 @@ -3,6 +3,7 @@ * keyboard.c (read_char): Call Lisp function help-form-show, instead of using internal_with_output_to_temp_buffer. (Qhelp_form_show): New var. + (syms_of_keyboard): Use DEFSYM macro. * print.c (internal_with_output_to_temp_buffer): Function deleted. === modified file 'src/keyboard.c' --- src/keyboard.c 2011-04-08 15:37:15 +0000 +++ src/keyboard.c 2011-04-08 15:51:28 +0000 @@ -11439,14 +11439,9 @@ staticpro (&Vlispy_mouse_stem); /* Tool-bars. */ - QCimage = intern_c_string (":image"); - staticpro (&QCimage); - - staticpro (&Qhelp_echo); - Qhelp_echo = intern_c_string ("help-echo"); - - staticpro (&Qrtl); - Qrtl = intern_c_string (":rtl"); + DEFSYM (QCimage, ":image"); + DEFSYM (Qhelp_echo, "help-echo"); + DEFSYM (Qrtl, ":rtl"); staticpro (&item_properties); item_properties = Qnil; @@ -11459,150 +11454,81 @@ staticpro (&real_this_command); real_this_command = Qnil; - Qtimer_event_handler = intern_c_string ("timer-event-handler"); - staticpro (&Qtimer_event_handler); - - Qdisabled_command_function = intern_c_string ("disabled-command-function"); - staticpro (&Qdisabled_command_function); - - Qself_insert_command = intern_c_string ("self-insert-command"); - staticpro (&Qself_insert_command); - - Qforward_char = intern_c_string ("forward-char"); - staticpro (&Qforward_char); - - Qbackward_char = intern_c_string ("backward-char"); - staticpro (&Qbackward_char); - - Qdisabled = intern_c_string ("disabled"); - staticpro (&Qdisabled); - - Qundefined = intern_c_string ("undefined"); - staticpro (&Qundefined); - - Qpre_command_hook = intern_c_string ("pre-command-hook"); - staticpro (&Qpre_command_hook); - - Qpost_command_hook = intern_c_string ("post-command-hook"); - staticpro (&Qpost_command_hook); - - Qdeferred_action_function = intern_c_string ("deferred-action-function"); - staticpro (&Qdeferred_action_function); - - Qfunction_key = intern_c_string ("function-key"); - staticpro (&Qfunction_key); - Qmouse_click = intern_c_string ("mouse-click"); - staticpro (&Qmouse_click); + DEFSYM (Qtimer_event_handler, "timer-event-handler"); + DEFSYM (Qdisabled_command_function, "disabled-command-function"); + DEFSYM (Qself_insert_command, "self-insert-command"); + DEFSYM (Qforward_char, "forward-char"); + DEFSYM (Qbackward_char, "backward-char"); + DEFSYM (Qdisabled, "disabled"); + DEFSYM (Qundefined, "undefined"); + DEFSYM (Qpre_command_hook, "pre-command-hook"); + DEFSYM (Qpost_command_hook, "post-command-hook"); + DEFSYM (Qdeferred_action_function, "deferred-action-function"); + DEFSYM (Qfunction_key, "function-key"); + DEFSYM (Qmouse_click, "mouse-click"); + DEFSYM (Qdrag_n_drop, "drag-n-drop"); + DEFSYM (Qsave_session, "save-session"); + DEFSYM (Qconfig_changed_event, "config-changed-event"); + DEFSYM (Qmenu_enable, "menu-enable"); + #if defined (WINDOWSNT) - Qlanguage_change = intern_c_string ("language-change"); - staticpro (&Qlanguage_change); + DEFSYM (Qlanguage_change, "language-change"); #endif - Qdrag_n_drop = intern_c_string ("drag-n-drop"); - staticpro (&Qdrag_n_drop); - - Qsave_session = intern_c_string ("save-session"); - staticpro (&Qsave_session); #ifdef HAVE_DBUS - Qdbus_event = intern_c_string ("dbus-event"); - staticpro (&Qdbus_event); + DEFSYM (Qdbus_event, "dbus-event"); #endif - Qconfig_changed_event = intern_c_string ("config-changed-event"); - staticpro (&Qconfig_changed_event); - - Qmenu_enable = intern_c_string ("menu-enable"); - staticpro (&Qmenu_enable); - QCenable = intern_c_string (":enable"); - staticpro (&QCenable); - QCvisible = intern_c_string (":visible"); - staticpro (&QCvisible); - QChelp = intern_c_string (":help"); - staticpro (&QChelp); - QCfilter = intern_c_string (":filter"); - staticpro (&QCfilter); - QCbutton = intern_c_string (":button"); - staticpro (&QCbutton); - QCkeys = intern_c_string (":keys"); - staticpro (&QCkeys); - QCkey_sequence = intern_c_string (":key-sequence"); - staticpro (&QCkey_sequence); - QCtoggle = intern_c_string (":toggle"); - staticpro (&QCtoggle); - QCradio = intern_c_string (":radio"); - staticpro (&QCradio); - QClabel = intern_c_string (":label"); - staticpro (&QClabel); - QCvert_only = intern_c_string (":vert-only"); - staticpro (&QCvert_only); - - Qmode_line = intern_c_string ("mode-line"); - staticpro (&Qmode_line); - Qvertical_line = intern_c_string ("vertical-line"); - staticpro (&Qvertical_line); - Qvertical_scroll_bar = intern_c_string ("vertical-scroll-bar"); - staticpro (&Qvertical_scroll_bar); - Qmenu_bar = intern_c_string ("menu-bar"); - staticpro (&Qmenu_bar); + DEFSYM (QCenable, ":enable"); + DEFSYM (QCvisible, ":visible"); + DEFSYM (QChelp, ":help"); + DEFSYM (QCfilter, ":filter"); + DEFSYM (QCbutton, ":button"); + DEFSYM (QCkeys, ":keys"); + DEFSYM (QCkey_sequence, ":key-sequence"); + DEFSYM (QCtoggle, ":toggle"); + DEFSYM (QCradio, ":radio"); + DEFSYM (QClabel, ":label"); + DEFSYM (QCvert_only, ":vert-only"); + + DEFSYM (Qmode_line, "mode-line"); + DEFSYM (Qvertical_line, "vertical-line"); + DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar"); + DEFSYM (Qmenu_bar, "menu-bar"); #if defined (HAVE_MOUSE) || defined (HAVE_GPM) - Qmouse_fixup_help_message = intern_c_string ("mouse-fixup-help-message"); - staticpro (&Qmouse_fixup_help_message); + DEFSYM (Qmouse_fixup_help_message, "mouse-fixup-help-message"); #endif - Qabove_handle = intern_c_string ("above-handle"); - staticpro (&Qabove_handle); - Qhandle = intern_c_string ("handle"); - staticpro (&Qhandle); - Qbelow_handle = intern_c_string ("below-handle"); - staticpro (&Qbelow_handle); - Qup = intern_c_string ("up"); - staticpro (&Qup); - Qdown = intern_c_string ("down"); - staticpro (&Qdown); - Qtop = intern_c_string ("top"); - staticpro (&Qtop); - Qbottom = intern_c_string ("bottom"); - staticpro (&Qbottom); - Qend_scroll = intern_c_string ("end-scroll"); - staticpro (&Qend_scroll); - Qratio = intern_c_string ("ratio"); - staticpro (&Qratio); - - Qevent_kind = intern_c_string ("event-kind"); - staticpro (&Qevent_kind); - Qevent_symbol_elements = intern_c_string ("event-symbol-elements"); - staticpro (&Qevent_symbol_elements); - Qevent_symbol_element_mask = intern_c_string ("event-symbol-element-mask"); - staticpro (&Qevent_symbol_element_mask); - Qmodifier_cache = intern_c_string ("modifier-cache"); - staticpro (&Qmodifier_cache); - - Qrecompute_lucid_menubar = intern_c_string ("recompute-lucid-menubar"); - staticpro (&Qrecompute_lucid_menubar); - Qactivate_menubar_hook = intern_c_string ("activate-menubar-hook"); - staticpro (&Qactivate_menubar_hook); - - Qpolling_period = intern_c_string ("polling-period"); - staticpro (&Qpolling_period); - - Qinput_method_function = intern_c_string ("input-method-function"); - staticpro (&Qinput_method_function); - - Qx_set_selection = intern_c_string ("x-set-selection"); - staticpro (&Qx_set_selection); - QPRIMARY = intern_c_string ("PRIMARY"); - staticpro (&QPRIMARY); - Qhandle_switch_frame = intern_c_string ("handle-switch-frame"); - staticpro (&Qhandle_switch_frame); - - Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char"); - staticpro (&Qinput_method_exit_on_first_char); - Qinput_method_use_echo_area = intern_c_string ("input-method-use-echo-area"); - staticpro (&Qinput_method_use_echo_area); - - Qhelp_form_show = intern_c_string ("help-form-show"); - staticpro (&Qhelp_form_show); + DEFSYM (Qabove_handle, "above-handle"); + DEFSYM (Qhandle, "handle"); + DEFSYM (Qbelow_handle, "below-handle"); + DEFSYM (Qup, "up"); + DEFSYM (Qdown, "down"); + DEFSYM (Qtop, "top"); + DEFSYM (Qbottom, "bottom"); + DEFSYM (Qend_scroll, "end-scroll"); + DEFSYM (Qratio, "ratio"); + + DEFSYM (Qevent_kind, "event-kind"); + DEFSYM (Qevent_symbol_elements, "event-symbol-elements"); + DEFSYM (Qevent_symbol_element_mask, "event-symbol-element-mask"); + DEFSYM (Qmodifier_cache, "modifier-cache"); + + DEFSYM (Qrecompute_lucid_menubar, "recompute-lucid-menubar"); + DEFSYM (Qactivate_menubar_hook, "activate-menubar-hook"); + + DEFSYM (Qpolling_period, "polling-period"); + + DEFSYM (Qx_set_selection, "x-set-selection"); + DEFSYM (QPRIMARY, "PRIMARY"); + DEFSYM (Qhandle_switch_frame, "handle-switch-frame"); + + DEFSYM (Qinput_method_function, "input-method-function"); + DEFSYM (Qinput_method_exit_on_first_char, "input-method-exit-on-first-char"); + DEFSYM (Qinput_method_use_echo_area, "input-method-use-echo-area"); + + DEFSYM (Qhelp_form_show, "help-form-show"); Fset (Qinput_method_exit_on_first_char, Qnil); Fset (Qinput_method_use_echo_area, Qnil); @@ -11653,9 +11579,8 @@ raw_keybuf = Fmake_vector (make_number (30), Qnil); staticpro (&raw_keybuf); - Qextended_command_history = intern_c_string ("extended-command-history"); + DEFSYM (Qextended_command_history, "extended-command-history"); Fset (Qextended_command_history, Qnil); - staticpro (&Qextended_command_history); accent_key_syms = Qnil; staticpro (&accent_key_syms); @@ -11956,8 +11881,7 @@ and tests the value when the command returns. Buffer modification stores t in this variable. */); Vdeactivate_mark = Qnil; - Qdeactivate_mark = intern_c_string ("deactivate-mark"); - staticpro (&Qdeactivate_mark); + DEFSYM (Qdeactivate_mark, "deactivate-mark"); DEFVAR_LISP ("pre-command-hook", Vpre_command_hook, doc: /* Normal hook run before each command is executed. @@ -11977,8 +11901,7 @@ DEFVAR_LISP ("echo-area-clear-hook", ..., doc: /* Normal hook run when clearing the echo area. */); #endif - Qecho_area_clear_hook = intern_c_string ("echo-area-clear-hook"); - staticpro (&Qecho_area_clear_hook); + DEFSYM (Qecho_area_clear_hook, "echo-area-clear-hook"); Fset (Qecho_area_clear_hook, Qnil); DEFVAR_LISP ("lucid-menu-bar-dirty-flag", Vlucid_menu_bar_dirty_flag, ------------------------------------------------------------ revno: 103868 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-04-08 11:37:15 -0400 message: Remove internal_with_output_to_temp_buffer, replacing sole user with Lisp. * lisp/help.el (help-form-show): New function, to be called from C. Put help-form output in a buffer named differently than *Help*. * src/keyboard.c (read_char): Call Lisp function help-form-show, instead of using internal_with_output_to_temp_buffer. (Qhelp_form_show): New var. * src/lisp.h (internal_with_output_to_temp_buffer): Remove prototype. * src/print.c (internal_with_output_to_temp_buffer): Function deleted. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-08 15:31:33 +0000 +++ lisp/ChangeLog 2011-04-08 15:37:15 +0000 @@ -1,3 +1,8 @@ +2011-04-08 Chong Yidong + + * help.el (help-form-show): New function, to be called from C. + Put help-form output in a buffer named differently than *Help*. + 2011-04-08 Eli Zaretskii * files.el (file-size-human-readable): New function. === modified file 'lisp/help.el' --- lisp/help.el 2011-03-13 01:57:40 +0000 +++ lisp/help.el 2011-04-08 15:37:15 +0000 @@ -1256,6 +1256,15 @@ ;; Reset `help-window' to nil to avoid confusing future calls of ;; `help-mode-finish' with plain `with-output-to-temp-buffer'. (setq help-window nil)))) + +;; Called from C, on encountering `help-char' when reading a char. +;; Don't print to *Help*; that would clobber Help history. +(defun help-form-show () + "Display the output of a non-nil `help-form'." + (let ((msg (eval help-form))) + (if (stringp msg) + (with-output-to-temp-buffer " *Char Help*" + (princ msg))))) (provide 'help) === modified file 'src/ChangeLog' --- src/ChangeLog 2011-04-06 21:55:08 +0000 +++ src/ChangeLog 2011-04-08 15:37:15 +0000 @@ -1,3 +1,13 @@ +2011-04-08 Chong Yidong + + * keyboard.c (read_char): Call Lisp function help-form-show, + instead of using internal_with_output_to_temp_buffer. + (Qhelp_form_show): New var. + + * print.c (internal_with_output_to_temp_buffer): Function deleted. + + * lisp.h (internal_with_output_to_temp_buffer): Remove prototype. + 2011-04-06 Chong Yidong * process.c (Flist_processes): Removed to Lisp. === modified file 'src/keyboard.c' --- src/keyboard.c 2011-04-05 06:45:27 +0000 +++ src/keyboard.c 2011-04-08 15:37:15 +0000 @@ -260,6 +260,8 @@ Lisp_Object Qinput_method_exit_on_first_char; Lisp_Object Qinput_method_use_echo_area; +Lisp_Object Qhelp_form_show; + /* File in which we write all commands we read. */ FILE *dribble; @@ -3095,10 +3097,7 @@ = Fcons (Fcurrent_window_configuration (Qnil), help_form_saved_window_configs); record_unwind_protect (read_char_help_form_unwind, Qnil); - - tem0 = Feval (Vhelp_form, Qnil); - if (STRINGP (tem0)) - internal_with_output_to_temp_buffer ("*Help*", print_help, tem0); + call0 (Qhelp_form_show); cancel_echoing (); do @@ -11602,6 +11601,9 @@ Qinput_method_use_echo_area = intern_c_string ("input-method-use-echo-area"); staticpro (&Qinput_method_use_echo_area); + Qhelp_form_show = intern_c_string ("help-form-show"); + staticpro (&Qhelp_form_show); + Fset (Qinput_method_exit_on_first_char, Qnil); Fset (Qinput_method_use_echo_area, Qnil); === modified file 'src/lisp.h' --- src/lisp.h 2011-04-06 04:58:58 +0000 +++ src/lisp.h 2011-04-08 15:37:15 +0000 @@ -2775,8 +2775,6 @@ extern void write_string (const char *, int); extern void print_error_message (Lisp_Object, Lisp_Object, const char *, Lisp_Object); -extern Lisp_Object internal_with_output_to_temp_buffer - (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object); #define FLOAT_TO_STRING_BUFSIZE 350 extern void float_to_string (char *, double); extern void syms_of_print (void); === modified file 'src/print.c' --- src/print.c 2011-04-04 06:52:29 +0000 +++ src/print.c 2011-04-08 15:37:15 +0000 @@ -520,29 +520,6 @@ specbind (Qstandard_output, buf); } - -/* FIXME: Use Lisp's with-output-to-temp-buffer instead! */ -Lisp_Object -internal_with_output_to_temp_buffer (const char *bufname, Lisp_Object (*function) (Lisp_Object), Lisp_Object args) -{ - int count = SPECPDL_INDEX (); - Lisp_Object buf, val; - struct gcpro gcpro1; - - GCPRO1 (args); - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - temp_output_buffer_setup (bufname); - buf = Vstandard_output; - UNGCPRO; - - val = (*function) (args); - - GCPRO1 (val); - temp_output_buffer_show (buf); - UNGCPRO; - - return unbind_to (count, val); -} static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); static void print_preprocess (Lisp_Object obj); === modified file 'src/window.c' --- src/window.c 2011-04-01 17:19:52 +0000 +++ src/window.c 2011-04-08 15:37:15 +0000 @@ -3664,9 +3664,6 @@ BEGV = BEG; ZV = Z; SET_PT (BEG); -#if 0 /* rms: there should be no reason for this. */ - XBUFFER (buf)->prevent_redisplay_optimizations_p = 1; -#endif set_buffer_internal (old); if (!NILP (Vtemp_buffer_show_function)) ------------------------------------------------------------ revno: 103867 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-04-08 18:31:33 +0300 message: New function file-size-human-readable. lisp/files.el (file-size-human-readable): New function. lisp/ls-lisp.el (ls-lisp-format-file-size): Use it, instead of computing the representation inline. Don't require `cl'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-08 03:30:26 +0000 +++ lisp/ChangeLog 2011-04-08 15:31:33 +0000 @@ -1,3 +1,10 @@ +2011-04-08 Eli Zaretskii + + * files.el (file-size-human-readable): New function. + + * ls-lisp.el (ls-lisp-format-file-size): Use it, instead of + computing the representation inline. Don't require `cl'. + 2011-04-08 Glenn Morris * man.el (Man-page-header-regexp): Solaris < 2.6 no longer supported. === modified file 'lisp/files.el' --- lisp/files.el 2011-04-06 21:13:17 +0000 +++ lisp/files.el 2011-04-08 15:31:33 +0000 @@ -1140,6 +1140,34 @@ (setq count (1+ count)))) newname)) +;; A handy function to display file sizes in human-readable form. +;; See http://en.wikipedia.org/wiki/Kibibyte for the reference. +(defun file-size-human-readable (file-size &optional flavor) + "Produce a string showing FILE-SIZE in human-readable form. + +Optional second argument FLAVOR controls the units and the display format: + + If FLAVOR is nil or omitted, each kilobyte is 1024 bytes and the produced + suffixes are \"k\", \"M\", \"G\", \"T\", etc. + If FLAVOR is `si', each kilobyte is 1000 bytes and the produced suffixes + are \"k\", \"M\", \"G\", \"T\", etc. + If FLAVOR is `iec', each kilobyte is 1024 bytes and the produced suffixes + are \"KiB\", \"MiB\", \"GiB\", \"TiB\", etc." + (let ((power (if (or (null flavor) (eq flavor 'iec)) + 1024.0 + 1000.0)) + (post-fixes + ;; none, kilo, mega, giga, tera, peta, exa, zetta, yotta + (list "" "k" "M" "G" "T" "P" "E" "Z" "Y"))) + (while (and (>= file-size power) (cdr post-fixes)) + (setq file-size (/ file-size power) + post-fixes (cdr post-fixes))) + (format "%.0f%s%s" file-size + (if (and (eq flavor 'iec) (string= (car post-fixes) "k")) + "K" + (car post-fixes)) + (if (eq flavor 'iec) "iB" "")))) + (defun make-temp-file (prefix &optional dir-flag suffix) "Create a temporary file. The returned file name (created by appending some random characters at the end === modified file 'lisp/ls-lisp.el' --- lisp/ls-lisp.el 2011-01-25 04:08:28 +0000 +++ lisp/ls-lisp.el 2011-04-08 15:31:33 +0000 @@ -62,8 +62,6 @@ ;;; Code: -(eval-when-compile (require 'cl)) - (defgroup ls-lisp nil "Emulate the ls program completely in Emacs Lisp." :version "21.1" @@ -726,13 +724,7 @@ ls-lisp-filesize-f-fmt ls-lisp-filesize-d-fmt) file-size) - (if (< file-size 1024) - (format " %4d" file-size) - (do ((file-size (/ file-size 1024.0) (/ file-size 1024.0)) - ;; kilo, mega, giga, tera, peta, exa - (post-fixes (list "k" "M" "G" "T" "P" "E") (cdr post-fixes))) - ((< file-size 1024) - (format " %3.0f%s" file-size (car post-fixes))))))) + (format " %4s" (file-size-human-readable file-size)))) (provide 'ls-lisp) ------------------------------------------------------------ revno: 103866 committer: Glenn Morris branch nick: trunk timestamp: Thu 2011-04-07 20:30:26 -0700 message: * lisp/man.el (Man-page-header-regexp): Solaris < 2.6 no longer supported. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-08 03:26:40 +0000 +++ lisp/ChangeLog 2011-04-08 03:30:26 +0000 @@ -1,5 +1,7 @@ 2011-04-08 Glenn Morris + * man.el (Man-page-header-regexp): Solaris < 2.6 no longer supported. + * net/browse-url.el (browse-url-firefox): Test system-type, not system-configuration. === modified file 'lisp/man.el' --- lisp/man.el 2011-03-02 08:31:47 +0000 +++ lisp/man.el 2011-04-08 03:30:26 +0000 @@ -254,8 +254,7 @@ "Regular expression describing a manpage section within parentheses.") (defvar Man-page-header-regexp - (if (and (string-match "-solaris2\\." system-configuration) - (not (string-match "-solaris2\\.[123435]$" system-configuration))) + (if (string-match "-solaris2\\." system-configuration) (concat "^[-A-Za-z0-9_].*[ \t]\\(" Man-name-regexp "(\\(" Man-section-regexp "\\))\\)$") (concat "^[ \t]*\\(" Man-name-regexp ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.