Now on revision 113151. ------------------------------------------------------------ revno: 113151 [merge] committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-06-23 23:58:52 -0700 message: Merge from emacs-24; up to r111363 diff: === modified file 'ChangeLog' --- ChangeLog 2013-06-22 02:41:14 +0000 +++ ChangeLog 2013-06-24 06:58:52 +0000 @@ -1,3 +1,7 @@ +2013-06-24 Glenn Morris + + * configure.ac: Include X11/X.h when testing for Xft.h. (Bug#14684) + 2013-06-22 Juanma Barranquero * .bzrignore: Add GNU idutils ID database file. === modified file 'configure.ac' --- configure.ac 2013-06-21 01:03:23 +0000 +++ configure.ac 2013-06-24 06:58:52 +0000 @@ -2644,7 +2644,8 @@ XFT_LIBS="-lXrender $XFT_LIBS" LIBS="$XFT_LIBS $LIBS" AC_CHECK_HEADER(X11/Xft/Xft.h, - AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS)) + AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS) , , + [[#include ]]) if test "${HAVE_XFT}" = "yes"; then AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.]) === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2013-05-05 00:51:49 +0000 +++ doc/emacs/files.texi 2013-06-24 06:58:52 +0000 @@ -1267,9 +1267,12 @@ buffer named @file{*diff*}. This works by running the @command{diff} program, using options taken from the variable @code{diff-switches}. The value of @code{diff-switches} should be a string; the default is -@code{"-c"} to specify a context diff. @xref{Top,, Diff, diff, -Comparing and Merging Files}, for more information about the -@command{diff} program. +@code{"-c"} to specify a context diff. +@c Note that the actual name of the info file is diffutils.info, +@c but it adds a dir entry for diff too. +@c On older systems, only "info diff" works, not "info diffutils". +@xref{Top,, Diff, diff, Comparing and Merging Files}, for more +information about the @command{diff} program. The output of the @code{diff} command is shown using a major mode called Diff mode. @xref{Diff Mode}. === modified file 'doc/emacs/rmail.texi' --- doc/emacs/rmail.texi 2013-01-01 09:11:05 +0000 +++ doc/emacs/rmail.texi 2013-06-24 06:52:33 +0000 @@ -1370,6 +1370,7 @@ or IMAP4 protocol, and can retrieve mail from them using a TLS encrypted channel. It also accepts mailbox arguments in @acronym{URL} form. The detailed description of mailbox @acronym{URL}s can be found +@c Note this node seems to be missing in some versions of mailutils.info? in @ref{URL,,,mailutils,Mailbox URL Formats}. In short, a @acronym{URL} is: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-06-23 19:24:27 +0000 +++ doc/lispref/ChangeLog 2013-06-24 06:58:52 +0000 @@ -1,3 +1,11 @@ +2013-06-24 Glenn Morris + + * loading.texi (Autoload): Fix typo. + + * variables.texi (Lexical Binding): Fix typo. + + * functions.texi (Anonymous Functions): Put back ' removed 2012-10-23. + 2013-06-23 Lars Magne Ingebrigtsen * display.texi (ImageMagick Images): Mention :max-width and === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2013-05-29 00:24:50 +0000 +++ doc/lispref/functions.texi 2013-06-24 06:58:52 +0000 @@ -974,10 +974,11 @@ compiled. This would not happen if, say, you had constructed the anonymous function by quoting it as a list: +@c Do not unquote this lambda! @example @group (defun double-property (symbol prop) - (change-property symbol prop (lambda (x) (* 2 x)))) + (change-property symbol prop '(lambda (x) (* 2 x)))) @end group @end example === modified file 'doc/lispref/loading.texi' --- doc/lispref/loading.texi 2013-06-13 22:24:52 +0000 +++ doc/lispref/loading.texi 2013-06-24 06:58:52 +0000 @@ -461,7 +461,7 @@ symbol @var{function}. @cindex function cell in autoload -if @var{function} already has non-void function definition that is not +If @var{function} already has a non-void function definition that is not an autoload object, this function does nothing and returns @code{nil}. Otherwise, it constructs an autoload object (@pxref{Autoload Type}), and stores it as the function definition for @var{function}. The === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2013-02-27 12:12:20 +0000 +++ doc/lispref/variables.texi 2013-06-12 01:25:53 +0000 @@ -988,7 +988,7 @@ (setq my-ticker (lambda () (setq x (1+ x))))) @result{} (closure ((x . 0) t) () - (1+ x)) + (setq x (1+ x))) (funcall my-ticker) @result{} 1 === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-06-23 01:48:23 +0000 +++ doc/misc/ChangeLog 2013-06-24 06:58:52 +0000 @@ -1,3 +1,7 @@ +2013-06-24 Glenn Morris + + * eshell.texi: Fix cross-references to other manuals. + 2013-06-23 Glenn Morris * Makefile.in (HTML_TARGETS, html, emacs-faq.html, emacs-faq): === modified file 'doc/misc/eshell.texi' --- doc/misc/eshell.texi 2013-06-10 02:41:49 +0000 +++ doc/misc/eshell.texi 2013-06-24 06:58:52 +0000 @@ -378,12 +378,13 @@ @item define @cmindex define -Define a varalias. @xref{Variable Aliases, , , elisp}. +Define a varalias. +@xref{Variable Aliases, , , elisp, The Emacs Lisp Reference Manual}. @item diff @cmindex diff Use Emacs's internal @code{diff} (not to be confused with -@code{ediff}). @xref{Comparing Files, , , elisp}. +@code{ediff}). @xref{Comparing Files, , , emacs, The GNU Emacs Manual}. @item grep @cmindex grep @@ -422,15 +423,18 @@ @item locate @cmindex locate Alias to Emacs's @code{locate} function, which simply runs the external -@command{locate} command and parses the results. @xref{Dired and `find', , , elisp}. +@command{locate} command and parses the results. +@xref{Dired and Find, , , emacs, The GNU Emacs Manual}. @item make @cmindex make -Run @command{make} through @code{compile}. @xref{Running Compilations under Emacs, , , elisp}. +Run @command{make} through @code{compile}. +@xref{Compilation, , , emacs, The GNU Emacs Manual}. @item occur @cmindex occur -Alias to Emacs's @code{occur}. @xref{Other Search-and-Loop Commands, , , elisp}. +Alias to Emacs's @code{occur}. +@xref{Other Repeating Search, , , emacs, The GNU Emacs Manual}. @item printnl @cmindex printnl @@ -648,7 +652,8 @@ @item $#var Expands to the length of the value bound to @code{var}. Raises an error -if the value is not a sequence (@pxref{Sequences Arrays and Vectors, Sequences, , elisp}). +if the value is not a sequence +(@pxref{Sequences Arrays Vectors, Sequences, , elisp, The Emacs Lisp Reference Manual}). @item $(lisp) Expands to the result of evaluating the S-expression @code{(lisp)}. On @@ -680,7 +685,8 @@ @item $var[hello] Calls @code{assoc} on @code{var} with @code{"hello"}, expecting it to be -an alist (@pxref{Association List Type, Association Lists, , elisp}). +an alist (@pxref{Association List Type, Association Lists, , elisp, +The Emacs Lisp Reference Manual}). @item $#var[hello] Returns the length of the cdr of the element of @code{var} who car is equal @@ -693,9 +699,11 @@ Eshell's globbing syntax is very similar to that of Zsh. Users coming from Bash can still use Bash-style globbing, as there are no incompatibilities. Most globbing is pattern-based expansion, but there -is also predicate-based expansion. See @ref{Filename Generation, , , zsh} +is also predicate-based expansion. See +@ref{Filename Generation, , , zsh, The Z Shell Manual} for full syntax. To customize the syntax and behaviour of globbing in -Eshell see the Customize@footnote{@xref{Customization Settings, Customize, , elisp}.} +Eshell see the Customize@footnote{@xref{Easy Customization, , , emacs, +The GNU Emacs Manual}.} groups ``eshell-glob'' and ``eshell-pred''. @node Input/Output @@ -757,7 +765,8 @@ and to provide a common parent Customize group for the modules.@footnote{ERC provides a similar module facility.} An Eshell module is defined the same as any other library but one requirement: the -module must define a Customize@footnote{@xref{Customization Settings, Customize, , elisp}.} +module must define a Customize@footnote{@xref{Customization, , , +elisp, The Emacs Lisp Reference Manual}.} group using @code{eshell-defgroup} (in place of @code{defgroup}) with @code{eshell-module} as the parent group.@footnote{If the module has no user-customizable options, then there is no need to define it as an ------------------------------------------------------------ revno: 113150 committer: Leo Liu branch nick: trunk timestamp: Mon 2013-06-24 12:08:10 +0800 message: Simplify last change to ido.el diff: === modified file 'lisp/ido.el' --- lisp/ido.el 2013-06-24 02:15:56 +0000 +++ lisp/ido.el 2013-06-24 04:08:10 +0000 @@ -2141,9 +2141,9 @@ done t) (setq ido-set-default-item t))) - ((if (memq system-type '(windows-nt ms-dos)) - (string-match "\\`[a-zA-Z]:\\|[\\][^\\]" ido-selected) - (string-match "/[^/]" ido-selected)) + ((string-match (if (memq system-type '(windows-nt ms-dos)) + "\\`[a-zA-Z]:\\|[\\][^\\]" + "/[^/]") ido-selected) (ido-set-current-directory (file-name-directory ido-selected)) (setq ido-set-default-item t)) ------------------------------------------------------------ revno: 113149 fixes bug: http://debbugs.gnu.org/14620 committer: Leo Liu branch nick: trunk timestamp: Mon 2013-06-24 10:15:56 +0800 message: * ido.el (ido-read-internal): Fix bug#14620. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-23 20:29:18 +0000 +++ lisp/ChangeLog 2013-06-24 02:15:56 +0000 @@ -1,3 +1,7 @@ +2013-06-24 Leo Liu + + * ido.el (ido-read-internal): Fix bug#14620. + 2013-06-23 Juanma Barranquero * faces.el (face-documentation): Simplify. === modified file 'lisp/ido.el' --- lisp/ido.el 2013-06-12 07:54:57 +0000 +++ lisp/ido.el 2013-06-24 02:15:56 +0000 @@ -2141,9 +2141,9 @@ done t) (setq ido-set-default-item t))) - ((or (string-match "[/\\][^/\\]" ido-selected) - (and (memq system-type '(windows-nt ms-dos)) - (string-match "\\`[a-zA-Z]:" ido-selected))) + ((if (memq system-type '(windows-nt ms-dos)) + (string-match "\\`[a-zA-Z]:\\|[\\][^\\]" ido-selected) + (string-match "/[^/]" ido-selected)) (ido-set-current-directory (file-name-directory ido-selected)) (setq ido-set-default-item t)) ------------------------------------------------------------ revno: 113148 fixes bug: http://debbugs.gnu.org/14569 committer: Paul Eggert branch nick: trunk timestamp: Sun 2013-06-23 17:31:31 -0700 message: A more-conservative workaround for Cygwin SIGCHLD issues. * callproc.c (Fcall_process): * process.c (create_process): Make sure SIGCHLD is caught before we fork, since Emacs startup no arranges to catch SIGCHLD. * process.c (lib_child_handler): Initialize to null, not to dummy_handler. (catch_child_signal): Allow self to be called lazily. Do nothing if it's already been called. Assume caller has blocked SIGCHLD (all callers do now). * emacs.c (main): Do not catch SIGCHLD here; defer it until just before it's really needed. * nsterm.m (ns_term_init): No need to re-catch SIGCHLD here, since it hasn't been caught yet. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-23 19:24:27 +0000 +++ src/ChangeLog 2013-06-24 00:31:31 +0000 @@ -1,3 +1,20 @@ +2013-06-23 Paul Eggert + + A more-conservative workaround for Cygwin SIGCHLD issues (Bug#14569). + * callproc.c (Fcall_process): + * process.c (create_process): + Make sure SIGCHLD is caught before we fork, + since Emacs startup no arranges to catch SIGCHLD. + * process.c (lib_child_handler): Initialize to null, not to + dummy_handler. + (catch_child_signal): Allow self to be called lazily. + Do nothing if it's already been called. + Assume caller has blocked SIGCHLD (all callers do now). + * emacs.c (main): Do not catch SIGCHLD here; defer it until + just before it's really needed. + * nsterm.m (ns_term_init): No need to re-catch SIGCHLD here, + since it hasn't been caught yet. + 2013-06-23 Lars Magne Ingebrigtsen * image.c (compute_image_size): New function to implement === modified file 'src/callproc.c' --- src/callproc.c 2013-06-23 18:18:47 +0000 +++ src/callproc.c 2013-06-24 00:31:31 +0000 @@ -613,6 +613,7 @@ block_input (); block_child_signal (); + catch_child_signal (); #ifdef WINDOWSNT pid = child_setup (filefd, fd1, fd_error, new_argv, 0, current_dir); === modified file 'src/emacs.c' --- src/emacs.c 2013-06-23 18:18:47 +0000 +++ src/emacs.c 2013-06-24 00:31:31 +0000 @@ -1257,13 +1257,6 @@ tzset (); #endif /* MSDOS */ - /* Do this after initializing the memory allocator, since it uses - glib and glib uses malloc. And do it before anything else that - invokes glib, to avoid potential races among glib subthreads in - Cygwin glib. gfilenotify invokes glib, so this can't be delayed - further. */ - catch_child_signal (); - #ifdef HAVE_GFILENOTIFY globals_of_gfilenotify (); #endif === modified file 'src/nsterm.m' --- src/nsterm.m 2013-06-03 18:29:30 +0000 +++ src/nsterm.m 2013-06-24 00:31:31 +0000 @@ -4360,12 +4360,6 @@ [NSApp run]; ns_do_open_file = YES; - -#ifdef NS_IMPL_GNUSTEP - /* GNUstep steals SIGCHLD for use in NSTask, but we don't use NSTask. - We must re-catch it so subprocess works. */ - catch_child_signal (); -#endif return dpyinfo; } === modified file 'src/process.c' --- src/process.c 2013-06-23 18:18:47 +0000 +++ src/process.c 2013-06-24 00:31:31 +0000 @@ -1590,7 +1590,6 @@ #ifndef WINDOWSNT int wait_child_setup[2]; #endif - sigset_t blocked; int forkin, forkout; bool pty_flag = 0; Lisp_Object lisp_pty_name = Qnil; @@ -1685,12 +1684,8 @@ encoded_current_dir = ENCODE_FILE (current_dir); block_input (); - - /* Block SIGCHLD until we have a chance to store the new fork's - pid in its process structure. */ - sigemptyset (&blocked); - sigaddset (&blocked, SIGCHLD); - pthread_sigmask (SIG_BLOCK, &blocked, 0); + block_child_signal (); + catch_child_signal (); #ifndef WINDOWSNT /* vfork, and prevent local vars from being clobbered by the vfork. */ @@ -1822,8 +1817,8 @@ /* Emacs ignores SIGPIPE, but the child should not. */ signal (SIGPIPE, SIG_DFL); - /* Stop blocking signals in the child. */ - pthread_sigmask (SIG_SETMASK, &empty_mask, 0); + /* Stop blocking SIGCHLD in the child. */ + unblock_child_signal (); if (pty_flag) child_setup_tty (xforkout); @@ -1843,8 +1838,8 @@ if (pid >= 0) XPROCESS (process)->alive = 1; - /* Stop blocking signals in the parent. */ - pthread_sigmask (SIG_SETMASK, &empty_mask, 0); + /* Stop blocking in the parent. */ + unblock_child_signal (); unblock_input (); if (pid < 0) @@ -6125,9 +6120,10 @@ /* LIB_CHILD_HANDLER is a SIGCHLD handler that Emacs calls while doing its own SIGCHLD handling. On POSIXish systems, glib needs this to - keep track of its own children. The default handler does nothing. */ + keep track of its own children. GNUstep is similar. */ + static void dummy_handler (int sig) {} -static signal_handler_t volatile lib_child_handler = dummy_handler; +static signal_handler_t volatile lib_child_handler; /* Handle a SIGCHLD signal by looking for known child processes of Emacs whose status have changed. For each one found, record its @@ -7060,7 +7056,10 @@ return system_process_attributes (pid); } -/* Arrange to catch SIGCHLD if needed. */ +/* Arrange to catch SIGCHLD if this hasn't already been arranged. + Invoke this after init_process_emacs, and after glib and/or GNUstep + futz with the SIGCHLD handler, but before Emacs forks any children. + This function's caller should block SIGCHLD. */ void catch_child_signal (void) @@ -7072,25 +7071,38 @@ return; #endif +#ifndef NS_IMPL_GNUSTEP + if (lib_child_handler) + return; +#endif + #if defined HAVE_GLIB && !defined WINDOWSNT /* Tickle glib's child-handling code. Ask glib to wait for Emacs itself; this should always fail, but is enough to initialize glib's private SIGCHLD handler, allowing the code below to copy it into LIB_CHILD_HANDLER. - Do this early in Emacs initialization, before glib creates - threads, to avoid race condition bugs in Cygwin glib. */ - g_source_unref (g_child_watch_source_new (getpid ())); + Do this here, rather than early in Emacs initialization where it + might make more sense, to try to avoid bugs in Cygwin glib (Bug#14569). */ + { + GSource *source = g_child_watch_source_new (getpid ()); + g_source_unref (source); + } #endif emacs_sigaction_init (&action, deliver_child_signal); - block_child_signal (); sigaction (SIGCHLD, &action, &old_action); eassert (! (old_action.sa_flags & SA_SIGINFO)); - if (old_action.sa_handler != SIG_DFL && old_action.sa_handler != SIG_IGN - && old_action.sa_handler != deliver_child_signal) - lib_child_handler = old_action.sa_handler; - unblock_child_signal (); + +#ifdef NS_IMPL_GNUSTEP + if (old_action.sa_handler == deliver_child_signal) + return; +#endif + + lib_child_handler + = (old_action.sa_handler == SIG_DFL || old_action.sa_handler == SIG_IGN + ? dummy_handler + : old_action.sa_handler); } ------------------------------------------------------------ revno: 113147 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2013-06-23 22:29:18 +0200 message: lisp/faces.el: Minor changes. (face-documentation): Simplify. (read-face-attribute, tty-find-type, x-resolve-font-name): Use `string-match-p'. (list-faces-display): Use `string-match-p'. Simplify. (face-spec-recalc): Check face to avoid face alias loops. (read-color): Use `string-match-p' and non-capturing parenthesis. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-23 19:24:27 +0000 +++ lisp/ChangeLog 2013-06-23 20:29:18 +0000 @@ -1,3 +1,12 @@ +2013-06-23 Juanma Barranquero + + * faces.el (face-documentation): Simplify. + (read-face-attribute, tty-find-type, x-resolve-font-name): + Use `string-match-p'. + (list-faces-display): Use `string-match-p'. Simplify. + (face-spec-recalc): Check face to avoid face alias loops. + (read-color): Use `string-match-p' and non-capturing parenthesis. + 2013-06-23 Lars Magne Ingebrigtsen * net/shr.el (shr-rescale-image): Use the new === modified file 'lisp/faces.el' --- lisp/faces.el 2013-05-15 23:55:41 +0000 +++ lisp/faces.el 2013-06-23 20:29:18 +0000 @@ -536,11 +536,9 @@ (defun face-documentation (face) "Get the documentation string for FACE. If FACE is a face-alias, get the documentation for the target face." - (let ((alias (get face 'face-alias)) - doc) + (let ((alias (get face 'face-alias))) (if alias - (progn - (setq doc (get alias 'face-documentation)) + (let ((doc (get alias 'face-documentation))) (format "%s is an alias for the face `%s'.%s" face alias (if doc (format "\n%s" doc) ""))) @@ -1171,7 +1169,7 @@ ;; pixmap file name won't start with an open-paren. (and (memq attribute '(:stipple :box :underline)) (stringp new-value) - (string-match "^[[(]" new-value) + (string-match-p "^[[(]" new-value) (setq new-value (read new-value))) new-value)) @@ -1272,7 +1270,7 @@ (delq nil (mapcar (lambda (f) (let ((s (symbol-name f))) - (when (or all-faces (string-match regexp s)) + (when (or all-faces (string-match-p regexp s)) (setq max-length (max (length s) max-length)) f))) (sort (face-list) #'string-lessp)))) @@ -1328,10 +1326,8 @@ (setq disp-frame (if window (window-frame window) (car (frame-list)))) (or (eq frame disp-frame) - (let ((faces (face-list))) - (while faces - (copy-face (car faces) (car faces) frame disp-frame) - (setq faces (cdr faces))))))) + (dolist (face (face-list)) + (copy-face face face frame disp-frame))))) (defun describe-face (face &optional frame) @@ -1631,6 +1627,7 @@ "Reset the face attributes of FACE on FRAME according to its specs. This applies the defface/custom spec first, then the custom theme specs, then the override spec." + (check-face face) (while (get face 'face-alias) (setq face (get face 'face-alias))) (face-spec-reset-face face frame) @@ -1850,7 +1847,7 @@ (when (and convert-to-RGB (not (string-equal color ""))) (let ((components (x-color-values color))) - (unless (string-match "^#\\([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)+$" color) + (unless (string-match-p "^#\\(?:[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)+$" color) (setq color (format "#%04X%04X%04X" (logand 65535 (nth 0 components)) (logand 65535 (nth 1 components)) @@ -2096,7 +2093,7 @@ (not (funcall pred type))) ;; Strip off last hyphen and what follows, then try again (setq type - (if (setq hyphend (string-match "[-_][^-_]+$" type)) + (if (setq hyphend (string-match-p "[-_][^-_]+$" type)) (substring type 0 hyphend) nil)))) type) @@ -2617,7 +2614,7 @@ (let ((fonts (x-list-fonts pattern face frame 1))) (or fonts (if face - (if (string-match "\\*" pattern) + (if (string-match-p "\\*" pattern) (if (null (face-font face)) (error "No matching fonts are the same height as the frame default font") (error "No matching fonts are the same height as face `%s'" face)) ------------------------------------------------------------ revno: 113146 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2013-06-23 21:24:27 +0200 message: Implement :max-width/:max-height for (ImageMagic) images * doc/lispref/display.texi (ImageMagick Images): Mention :max-width and :max-height. * lisp/net/shr.el (shr-rescale-image): Use the new :max-width/:max-height functionality. * src/image.c (compute_image_size): New function to implement :max-width and :max-height. (imagemagick_load_image): Use it. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-06-20 14:15:42 +0000 +++ doc/lispref/ChangeLog 2013-06-23 19:24:27 +0000 @@ -1,3 +1,8 @@ +2013-06-23 Lars Magne Ingebrigtsen + + * display.texi (ImageMagick Images): Mention :max-width and + :max-height. + 2013-06-20 Paul Eggert * numbers.texi (Math Functions): Remove obsolete function log10. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-06-19 13:51:47 +0000 +++ doc/lispref/display.texi 2013-06-23 19:24:27 +0000 @@ -4653,6 +4653,15 @@ calculated so as to preserve the aspect ratio. If both are specified, aspect ratio may not be preserved. +@item :max-width, :max-height +The @code{:max-width} and @code{:max-height} keywords are used for +scaling if the size of the image of the image exceeds these values. +If @code{:width} is set it will have presedence over @code{max-width}, +and if @code{:height} is set it will have presedence over +@code{max-height}, but you can otherwise mix these keywords as you +wish. @code{:max-width} and @code{:max-height} will always preserve +the aspec ratio. + @item :rotation Specifies a rotation angle in degrees. === modified file 'etc/NEWS' --- etc/NEWS 2013-06-20 14:15:42 +0000 +++ etc/NEWS 2013-06-23 19:24:27 +0000 @@ -695,6 +695,9 @@ `imagemagick-filter-types' returns the list of types that will be treated as images. +*** ImageMagick images now support the :max-width and :max-height +keywords. + ** Minibuffer *** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-23 18:29:30 +0000 +++ lisp/ChangeLog 2013-06-23 19:24:27 +0000 @@ -1,3 +1,8 @@ +2013-06-23 Lars Magne Ingebrigtsen + + * net/shr.el (shr-rescale-image): Use the new + :max-width/:max-height functionality. + 2013-06-23 Ivan Kanis * net/eww.el (eww-search-prefix): New variable. === modified file 'lisp/net/shr.el' --- lisp/net/shr.el 2013-06-19 22:28:04 +0000 +++ lisp/net/shr.el 2013-06-23 19:24:27 +0000 @@ -741,34 +741,18 @@ (defun shr-rescale-image (data &optional force) "Rescale DATA, if too big, to fit the current buffer. If FORCE, rescale the image anyway." - (let ((image (create-image data nil t :ascent 100))) - (if (or (not (fboundp 'imagemagick-types)) - (not (get-buffer-window (current-buffer)))) - image - (let* ((size (image-size image t)) - (width (car size)) - (height (cdr size)) - (edges (window-inside-pixel-edges - (get-buffer-window (current-buffer)))) - (window-width (truncate (* shr-max-image-proportion - (- (nth 2 edges) (nth 0 edges))))) - (window-height (truncate (* shr-max-image-proportion - (- (nth 3 edges) (nth 1 edges))))) - scaled-image) - (when (or force - (> height window-height)) - (setq image (or (create-image data 'imagemagick t - :height window-height - :ascent 100) - image)) - (setq size (image-size image t))) - (when (> (car size) window-width) - (setq image (or - (create-image data 'imagemagick t - :width window-width - :ascent 100) - image))) - image)))) + (if (or (not (fboundp 'imagemagick-types)) + (not (get-buffer-window (current-buffer)))) + (create-image data nil t :ascent 100) + (let ((edges (window-inside-pixel-edges + (get-buffer-window (current-buffer))))) + (create-image + data 'imagemagick t + :ascent 100 + :max-width (truncate (* shr-max-image-proportion + (- (nth 2 edges) (nth 0 edges)))) + :max-height (truncate (* shr-max-image-proportion + (- (nth 3 edges) (nth 1 edges)))))))) ;; url-cache-extract autoloads url-cache. (declare-function url-cache-create-filename "url-cache" (url)) === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-23 18:18:47 +0000 +++ src/ChangeLog 2013-06-23 19:24:27 +0000 @@ -1,3 +1,9 @@ +2013-06-23 Lars Magne Ingebrigtsen + + * image.c (compute_image_size): New function to implement + :max-width and :max-height. + (imagemagick_load_image): Use it. + 2013-06-23 Paul Eggert Try to avoid malloc SEGVs on Cygwin (Bug#14569). === modified file 'src/image.c' --- src/image.c 2013-06-21 20:11:44 +0000 +++ src/image.c 2013-06-23 19:24:27 +0000 @@ -132,6 +132,8 @@ static unsigned long *colors_in_color_table (int *n); #endif +Lisp_Object QCmax_width, QCmax_height; + /* Code to deal with bitmaps. Bitmaps are referenced by their bitmap id, which is just an int that this section returns. Bitmaps are reference counted so they can be shared among frames. @@ -7489,6 +7491,76 @@ #endif /* HAVE_GIF */ +static void +compute_image_size (size_t width, size_t height, + Lisp_Object spec, + int *d_width, int *d_height) +{ + Lisp_Object value; + int desired_width, desired_height; + + /* If width and/or height is set in the display spec assume we want + to scale to those values. If either h or w is unspecified, the + unspecified should be calculated from the specified to preserve + aspect ratio. */ + value = image_spec_value (spec, QCwidth, NULL); + desired_width = (INTEGERP (value) ? XFASTINT (value) : -1); + value = image_spec_value (spec, QCheight, NULL); + desired_height = (INTEGERP (value) ? XFASTINT (value) : -1); + + if (desired_width == -1) + { + value = image_spec_value (spec, QCmax_width, NULL); + if (INTEGERP (value) && + width > XFASTINT (value)) + { + /* The image is wider than :max-width. */ + desired_width = XFASTINT (value); + if (desired_height == -1) + { + value = image_spec_value (spec, QCmax_height, NULL); + if (INTEGERP (value)) + { + /* We have no specified height, but we have a + :max-height value, so check that we satisfy both + conditions. */ + desired_height = (double) desired_width / width * height; + if (desired_height > XFASTINT (value)) + { + desired_height = XFASTINT (value); + desired_width = (double) desired_height / height * width; + } + } + else + { + /* We have no specified height and no specified + max-height, so just compute the height. */ + desired_height = (double) desired_width / width * height; + } + } + } + } + + if (desired_height == -1) + { + value = image_spec_value (spec, QCmax_height, NULL); + if (INTEGERP (value) && + height > XFASTINT (value)) + desired_height = XFASTINT (value); + } + + if (desired_width != -1 && desired_height == -1) + /* w known, calculate h. */ + desired_height = (double) desired_width / width * height; + + if (desired_width == -1 && desired_height != -1) + /* h known, calculate w. */ + desired_width = (double) desired_height / height * width; + + *d_width = desired_width; + *d_height = desired_height; +} + /*********************************************************************** ImageMagick ***********************************************************************/ @@ -7516,6 +7588,8 @@ IMAGEMAGICK_BACKGROUND, IMAGEMAGICK_HEIGHT, IMAGEMAGICK_WIDTH, + IMAGEMAGICK_MAX_HEIGHT, + IMAGEMAGICK_MAX_WIDTH, IMAGEMAGICK_ROTATION, IMAGEMAGICK_CROP, IMAGEMAGICK_LAST @@ -7538,6 +7612,8 @@ {":background", IMAGE_STRING_OR_NIL_VALUE, 0}, {":height", IMAGE_INTEGER_VALUE, 0}, {":width", IMAGE_INTEGER_VALUE, 0}, + {":max-height", IMAGE_INTEGER_VALUE, 0}, + {":max-width", IMAGE_INTEGER_VALUE, 0}, {":rotation", IMAGE_NUMBER_VALUE, 0}, {":crop", IMAGE_DONT_CHECK_VALUE_TYPE, 0} }; @@ -7726,24 +7802,10 @@ PixelSetBlue (bg_wand, (double) bgcolor.blue / 65535); } - /* If width and/or height is set in the display spec assume we want - to scale to those values. If either h or w is unspecified, the - unspecified should be calculated from the specified to preserve - aspect ratio. */ - value = image_spec_value (img->spec, QCwidth, NULL); - desired_width = (INTEGERP (value) ? XFASTINT (value) : -1); - value = image_spec_value (img->spec, QCheight, NULL); - desired_height = (INTEGERP (value) ? XFASTINT (value) : -1); - - height = MagickGetImageHeight (image_wand); - width = MagickGetImageWidth (image_wand); - - if (desired_width != -1 && desired_height == -1) - /* w known, calculate h. */ - desired_height = (double) desired_width / width * height; - if (desired_width == -1 && desired_height != -1) - /* h known, calculate w. */ - desired_width = (double) desired_height / height * width; + compute_image_size (MagickGetImageWidth (image_wand), + MagickGetImageHeight (image_wand), + img->spec, &desired_width, &desired_height); + if (desired_width != -1 && desired_height != -1) { status = MagickScaleImage (image_wand, desired_width, desired_height); @@ -8895,6 +8957,8 @@ DEFSYM (Qheuristic, "heuristic"); DEFSYM (Qpostscript, "postscript"); + DEFSYM (QCmax_width, ":max-width"); + DEFSYM (QCmax_height, ":max-height"); #ifdef HAVE_GHOSTSCRIPT ADD_IMAGE_TYPE (Qpostscript); DEFSYM (QCloader, ":loader"); ------------------------------------------------------------ revno: 113145 author: Ivan Kanis committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2013-06-23 20:29:30 +0200 message: * net/eww.el: Bind `C-c C-c' to "submit" in all form keymaps. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-23 18:27:58 +0000 +++ lisp/ChangeLog 2013-06-23 18:29:30 +0000 @@ -6,6 +6,8 @@ (eww-mode-map): New keystroke. (eww-browse-with-external-browser): New command. + * net/eww.el: Bind `C-c C-c' to "submit" in all form keymaps. + 2013-06-23 Juanma Barranquero * emacs-lisp/tabulated-list.el (tabulated-list-init-header): === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-23 18:27:58 +0000 +++ lisp/net/eww.el 2013-06-23 18:29:30 +0000 @@ -415,12 +415,14 @@ (defvar eww-submit-map (let ((map (make-sparse-keymap))) (define-key map "\r" 'eww-submit) + (define-key map [(control c) (control c)] 'eww-submit) map)) (defvar eww-checkbox-map (let ((map (make-sparse-keymap))) (define-key map [space] 'eww-toggle-checkbox) (define-key map "\r" 'eww-toggle-checkbox) + (define-key map [(control c) (control c)] 'eww-submit) map)) (defvar eww-text-map @@ -428,6 +430,7 @@ (set-keymap-parent map text-mode-map) (define-key map "\r" 'eww-submit) (define-key map [(control a)] 'eww-beginning-of-text) + (define-key map [(control c) (control c)] 'eww-submit) (define-key map [(control e)] 'eww-end-of-text) (define-key map [tab] 'shr-next-link) (define-key map [backtab] 'shr-previous-link) @@ -437,6 +440,7 @@ (let ((map (make-keymap))) (set-keymap-parent map text-mode-map) (define-key map "\r" 'forward-line) + (define-key map [(control c) (control c)] 'eww-submit) (define-key map [tab] 'shr-next-link) (define-key map [backtab] 'shr-previous-link) map)) @@ -444,6 +448,7 @@ (defvar eww-select-map (let ((map (make-sparse-keymap))) (define-key map "\r" 'eww-change-select) + (define-key map [(control c) (control c)] 'eww-submit) map)) (defun eww-beginning-of-text () ------------------------------------------------------------ revno: 113144 author: Ivan Kanis committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2013-06-23 20:27:58 +0200 message: eww.el: Add a command to browse using and external browser (eww-external-browser): New variable. (eww-mode-map): New keystroke. (eww-browse-with-external-browser): New command. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-23 18:22:28 +0000 +++ lisp/ChangeLog 2013-06-23 18:27:58 +0000 @@ -2,6 +2,9 @@ * net/eww.el (eww-search-prefix): New variable. (eww): Use it. + (eww-external-browser): New variable. + (eww-mode-map): New keystroke. + (eww-browse-with-external-browser): New command. 2013-06-23 Juanma Barranquero === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-23 18:22:28 +0000 +++ lisp/net/eww.el 2013-06-23 18:27:58 +0000 @@ -50,6 +50,18 @@ :group 'eww :type 'string) +(defcustom eww-external-browser + (cond ((eq system-type 'windows-nt) + 'browse-url-default-windows-browser) + ((eq system-type 'darwin) + 'browse-url-default-macosx-browser) + (t + 'browse-url-netscape)) + "Function used to launch an external browser." + :version "24.4" + :group 'eww + :type 'function) + (defface eww-form-submit '((((type x w32 ns) (class color)) ; Like default mode line :box (:line-width 2 :style released-button) @@ -317,6 +329,7 @@ (define-key map "p" 'eww-previous-url) (define-key map "u" 'eww-up-url) (define-key map "t" 'eww-top-url) + (define-key map "w" 'eww-browse-with-external-browser) map)) (define-derived-mode eww-mode nil "eww" @@ -823,6 +836,12 @@ "?" (mm-url-encode-www-form-urlencoded values)))))) +(defun eww-browse-with-external-browser () + "Browse the current URL with an external browser. +The browser to used is specified by the `eww-external-browser' variable." + (interactive) + (funcall eww-external-browser eww-current-url)) + (provide 'eww) ;;; eww.el ends here ------------------------------------------------------------ revno: 113143 author: Ivan Kanis committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2013-06-23 20:22:28 +0200 message: eww.el: If given a non-domain text, search for the term * net/eww.el (eww-search-prefix): New variable. (eww): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-23 13:23:49 +0000 +++ lisp/ChangeLog 2013-06-23 18:22:28 +0000 @@ -1,3 +1,8 @@ +2013-06-23 Ivan Kanis + + * net/eww.el (eww-search-prefix): New variable. + (eww): Use it. + 2013-06-23 Juanma Barranquero * emacs-lisp/tabulated-list.el (tabulated-list-init-header): === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-21 07:52:47 +0000 +++ lisp/net/eww.el 2013-06-23 18:22:28 +0000 @@ -40,6 +40,13 @@ "Header line format. - %t is replaced by the title. - %u is replaced by the URL." + :version "24.4" + :group 'eww + :type 'string) + +(defcustom eww-search-prefix "https://duckduckgo.com/html/?q=" + "Prefix URL to search engine" + :version "24.4" :group 'eww :type 'string) @@ -89,10 +96,16 @@ ;;;###autoload (defun eww (url) - "Fetch URL and render the page." - (interactive "sUrl: ") - (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) - (setq url (concat "http://" url))) + "Fetch URL and render the page. +If the input doesn't look like an URL or a domain name, the +word(s) will be searched for via `eww-search-prefix'." + (interactive "sEnter URL or keywords: ") + (if (and (= (length (split-string url)) 1) + (> (length (split-string url "\\.")) 1)) + (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) + (setq url (concat "http://" url))) + (setq url (concat eww-search-prefix + (replace-regexp-in-string " " "+" url)))) (url-retrieve url 'eww-render (list url))) ;;;###autoload ------------------------------------------------------------ revno: 113142 fixes bug: http://debbugs.gnu.org/14569 committer: Paul Eggert branch nick: trunk timestamp: Sun 2013-06-23 11:18:47 -0700 message: Try to avoid malloc SEGVs on Cygwin. * callproc.c, process.h (block_child_signal, unblock_child_signal): Now extern. * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify. * process.c (catch_child_signal): Block SIGCHLD while futzing with the SIGCHLD handler, since the code is not atomic and (due to glib) signals may be arriving now. * sysdep.c (init_signals): Do not catch child signals here; 'main' now does that later, at a safer time. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-22 19:01:47 +0000 +++ src/ChangeLog 2013-06-23 18:18:47 +0000 @@ -1,3 +1,15 @@ +2013-06-23 Paul Eggert + + Try to avoid malloc SEGVs on Cygwin (Bug#14569). + * callproc.c, process.h (block_child_signal, unblock_child_signal): + Now extern. + * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify. + * process.c (catch_child_signal): Block SIGCHLD while futzing with + the SIGCHLD handler, since the code is not atomic and (due to glib) + signals may be arriving now. + * sysdep.c (init_signals): Do not catch child signals here; + 'main' now does that later, at a safer time. + 2013-06-22 Paul Eggert Clean up SIGCHLD handling a bit (Bug#14569). === modified file 'src/callproc.c' --- src/callproc.c 2013-05-25 01:55:00 +0000 +++ src/callproc.c 2013-06-23 18:18:47 +0000 @@ -84,7 +84,7 @@ /* Block SIGCHLD. */ -static void +void block_child_signal (void) { sigset_t blocked; @@ -95,7 +95,7 @@ /* Unblock SIGCHLD. */ -static void +void unblock_child_signal (void) { pthread_sigmask (SIG_SETMASK, &empty_mask, 0); === modified file 'src/emacs.c' --- src/emacs.c 2013-06-17 06:03:19 +0000 +++ src/emacs.c 2013-06-23 18:18:47 +0000 @@ -1257,6 +1257,13 @@ tzset (); #endif /* MSDOS */ + /* Do this after initializing the memory allocator, since it uses + glib and glib uses malloc. And do it before anything else that + invokes glib, to avoid potential races among glib subthreads in + Cygwin glib. gfilenotify invokes glib, so this can't be delayed + further. */ + catch_child_signal (); + #ifdef HAVE_GFILENOTIFY globals_of_gfilenotify (); #endif === modified file 'src/process.c' --- src/process.c 2013-06-22 19:01:47 +0000 +++ src/process.c 2013-06-23 18:18:47 +0000 @@ -7084,11 +7084,13 @@ #endif emacs_sigaction_init (&action, deliver_child_signal); + block_child_signal (); sigaction (SIGCHLD, &action, &old_action); eassert (! (old_action.sa_flags & SA_SIGINFO)); if (old_action.sa_handler != SIG_DFL && old_action.sa_handler != SIG_IGN && old_action.sa_handler != deliver_child_signal) lib_child_handler = old_action.sa_handler; + unblock_child_signal (); } === modified file 'src/process.h' --- src/process.h 2013-06-22 19:01:47 +0000 +++ src/process.h 2013-06-23 18:18:47 +0000 @@ -200,6 +200,8 @@ /* Defined in callproc.c. */ +extern void block_child_signal (void); +extern void unblock_child_signal (void); extern void record_kill_process (struct Lisp_Process *); /* Defined in process.c. */ === modified file 'src/sysdep.c' --- src/sysdep.c 2013-06-22 19:01:47 +0000 +++ src/sysdep.c 2013-06-23 18:18:47 +0000 @@ -1901,8 +1901,6 @@ sigaction (SIGFPE, &action, 0); } - catch_child_signal (); - #ifdef SIGUSR1 add_user_signal (SIGUSR1, "sigusr1"); #endif ------------------------------------------------------------ revno: 113141 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2013-06-23 15:23:49 +0200 message: lisp/emacs-lisp/tabulated-list.el: Fix alignment problem with :pad-right = 0. (tabulated-list-init-header): Don't skip aligning the next header field when padding is 0; otherwise, field width is not respected unless the title is as wide as the field. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-22 20:09:19 +0000 +++ lisp/ChangeLog 2013-06-23 13:23:49 +0000 @@ -1,3 +1,10 @@ +2013-06-23 Juanma Barranquero + + * emacs-lisp/tabulated-list.el (tabulated-list-init-header): + Don't skip aligning the next header field when padding is 0; + otherwise, field width is not respected unless the title is as + wide as the field. + 2013-06-22 Stefan Monnier * emacs-lisp/package.el (package-el-version): Remove. === modified file 'lisp/emacs-lisp/tabulated-list.el' --- lisp/emacs-lisp/tabulated-list.el 2013-06-20 11:57:33 +0000 +++ lisp/emacs-lisp/tabulated-list.el 2013-06-23 13:23:49 +0000 @@ -230,7 +230,7 @@ `(space :align-to ,(+ x shift))) (cdr cols)))) (setq x (+ x shift))))) - (if (> pad-right 0) + (if (>= pad-right 0) (push (propertize " " 'display `(space :align-to ,next-x) 'face 'fixed-pitch) ------------------------------------------------------------ revno: 113140 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-06-22 18:48:23 -0700 message: Remove some doc/misc/Makefile.in stuff that is not needed any more * doc/misc/Makefile.in (HTML_TARGETS, html, emacs-faq.html, emacs-faq): Remove; not needed now we use a standard html layout for the faq. (clean): Remove HTML_TARGETS, emacs-faq.text. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-06-21 14:36:13 +0000 +++ doc/misc/ChangeLog 2013-06-23 01:48:23 +0000 @@ -1,3 +1,9 @@ +2013-06-23 Glenn Morris + + * Makefile.in (HTML_TARGETS, html, emacs-faq.html, emacs-faq): + Remove; not needed now we use a standard html layout for the faq. + (clean): Remove HTML_TARGETS, emacs-faq.text. + 2013-06-21 Eduard Wiebe * flymake.texi (Parsing the output, Customizable variables): === modified file 'doc/misc/Makefile.in' --- doc/misc/Makefile.in 2013-06-19 07:01:22 +0000 +++ doc/misc/Makefile.in 2013-06-23 01:48:23 +0000 @@ -163,8 +163,6 @@ wisent.pdf \ woman.pdf -HTML_TARGETS = emacs-faq.html - TEXI2DVI = texi2dvi TEXI2PDF = texi2pdf @@ -194,8 +192,6 @@ dvi: $(DVI_TARGETS) -html: $(HTML_TARGETS) - pdf: $(PDF_TARGETS) # Note that all the Info targets build the Info files in srcdir. @@ -402,15 +398,6 @@ $(ENVADD) $(TEXI2DVI) ${srcdir}/faq.texi faq.pdf: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi $(ENVADD) $(TEXI2PDF) ${srcdir}/faq.texi -## This is the name used on the Emacs web-page. -## sed fixes up links to point to split version of the manual. -emacs-faq.html: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi - $(MAKEINFO) $(MAKEINFO_OPTS) --no-split \ - --css-ref='/layout.css' --html -o $@ ${srcdir}/faq.texi - sed -i -e 's|a href="\([a-z]*\)\.html#\([^"]*\)"|a href="manual/html_node/\1/\2.html"|g' \ - -e 's|/Top\.html|/|g' $@ -emacs-faq.text: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi - $(MAKEINFO) $(MAKEINFO_OPTS) --plaintext -o $@ ${srcdir}/faq.texi flymake : $(buildinfodir)/flymake$(INFO_EXT) $(buildinfodir)/flymake$(INFO_EXT): ${srcdir}/flymake.texi ${gfdl} @@ -720,7 +707,7 @@ rm -f gnustmp.* clean: mostlyclean - rm -f $(DVI_TARGETS) $(PDF_TARGETS) $(HTML_TARGETS) emacs-faq.text + rm -f $(DVI_TARGETS) $(PDF_TARGETS) rm -f emacs-misc-${version}.tar* distclean: clean ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.