commit dbc57b5573e2978581439fe8b81da80672c4ecd8 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sat Sep 14 22:00:20 2019 -0700 file_name_case_insensitive_p int->long fix * src/fileio.c (file_name_case_insensitive_p): Don’t assume ‘long int’ fits in ‘int’. diff --git a/src/fileio.c b/src/fileio.c index cbc0c89cf3..da32d6c095 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2391,11 +2391,11 @@ file_name_case_insensitive_p (const char *filename) support the latter. */ #ifdef _PC_CASE_INSENSITIVE - int res = pathconf (filename, _PC_CASE_INSENSITIVE); + long int res = pathconf (filename, _PC_CASE_INSENSITIVE); if (res >= 0) return res > 0; #elif defined _PC_CASE_SENSITIVE - int res = pathconf (filename, _PC_CASE_SENSITIVE); + long int res = pathconf (filename, _PC_CASE_SENSITIVE); if (res >= 0) return res == 0; #endif commit 52172d234015776bcc595c731477b98fa2949e50 Author: Paul Eggert Date: Sat Sep 14 10:55:53 2019 -0700 Fix gc-elapsed rounding bug * src/alloc.c (garbage_collect): Don’t accumulate rounding errors when computing gc-elapsed. diff --git a/src/alloc.c b/src/alloc.c index 497f600551..9fbd0d0573 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6021,9 +6021,10 @@ garbage_collect (void) /* Accumulate statistics. */ if (FLOATP (Vgc_elapsed)) { - struct timespec since_start = timespec_sub (current_timespec (), start); - Vgc_elapsed = make_float (XFLOAT_DATA (Vgc_elapsed) - + timespectod (since_start)); + static struct timespec gc_elapsed; + gc_elapsed = timespec_add (gc_elapsed, + timespec_sub (current_timespec (), start)); + Vgc_elapsed = make_float (timespectod (gc_elapsed)); } gcs_done++; commit 1acc0cc9aaf25c808a60cf09cf8a4d1c653c3aa9 Author: Paul Eggert Date: Sat Sep 14 10:53:24 2019 -0700 Improve doc of GC thresholds * doc/lispref/internals.texi (Garbage Collection), etc/NEWS: Warn that control over GC is only approximate. diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index f85c266ede..c52999e1cd 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -533,9 +533,6 @@ be allocated for Lisp objects after one garbage collection in order to trigger another garbage collection. You can use the result returned by @code{garbage-collect} to get an information about size of the particular object type; space allocated to the contents of buffers does not count. -Note that the subsequent garbage collection does not happen immediately -when the threshold is exhausted, but only the next time the Lisp interpreter -is called. The initial threshold value is @code{GC_DEFAULT_THRESHOLD}, defined in @file{alloc.c}. Since it's defined in @code{word_size} units, the value @@ -562,6 +559,16 @@ increases. Thus, it can be desirable to do them less frequently in proportion. @end defopt + Control over the garbage collector via @code{gc-cons-threshold} and +@code{gc-cons-percentage} is only approximate. Although Emacs checks +for threshold exhaustion regularly, for efficiency reasons it does not +do so immediately after every change to the heap or to +@code{gc-cons-threshold} or @code{gc-cons-percentage}, so exhausting +the threshold does not immediately trigger garbage collection. Also, +for efficency in threshold calculations Emacs approximates the heap +size, which counts the bytes used by currently-accessible objects in +the heap. + The value returned by @code{garbage-collect} describes the amount of memory used by Lisp data, broken down by data type. By contrast, the function @code{memory-limit} provides information on the total amount of diff --git a/etc/NEWS b/etc/NEWS index 94c98a7ebe..252c6bf9b9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2429,6 +2429,13 @@ remote systems, which support this check. +++ ** 'memory-limit' now returns a better estimate of memory consumption. ++++ +** When interpreting 'gc-cons-percentage', Emacs now estimates the +heap size more often and (we hope) more accurately. E.g., formerly +(progn (let ((gc-cons-percentage 0.8)) BODY1) BODY2) continued to use +the 0.8 value during BODY2 until the next garbage collection, but that +is no longer true. Applications may need to re-tune their GC tricks. + +++ ** New macro 'combine-change-calls' arranges to call the change hooks ('before-change-functions' and 'after-change-functions') just once commit 3f43adac495364aa76703acb86b07b47fe64b422 Author: Bruno Félix Rezende Ribeiro Date: Sat Sep 14 17:00:40 2019 +0200 Fix picon installation instructions in the Gnus manual * doc/misc/gnus.texi (Picons): Fix instructions for installing picons on Debian (bug#37247). Copyright-paperwork-exempt: yes diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 28a5eccc6a..fb9581f985 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -23682,7 +23682,7 @@ point your Web browser at @uref{http://www.cs.indiana.edu/picons/ftp/index.html}. If you are using Debian GNU/Linux, saying @samp{apt-get install -picons.*} will install the picons where Gnus can find them. +picon-.*} will install the picons where Gnus can find them. To enable displaying picons, simply make sure that @code{gnus-picon-databases} points to the directory containing the commit c6d814345370307be3de802c65152c887a01359a Author: Basil L. Contovounesios Date: Sat Sep 14 16:55:24 2019 +0200 Fix fileless eww form submission * lisp/net/eww.el (eww-submit): Ignore file inputs with no associated file name (bug#36520). diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2013604c9e..fb495a9858 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1447,15 +1447,15 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (push (cons name (plist-get input :value)) values))) ((equal (plist-get input :type) "file") - (push (cons "file" - (list (cons "filedata" - (with-temp-buffer - (insert-file-contents - (plist-get input :filename)) - (buffer-string))) - (cons "name" (plist-get input :name)) - (cons "filename" (plist-get input :filename)))) - values)) + (when-let ((file (plist-get input :filename))) + (push (list "file" + (cons "filedata" + (with-temp-buffer + (insert-file-contents file) + (buffer-string))) + (cons "name" name) + (cons "filename" file)) + values))) ((equal (plist-get input :type) "submit") ;; We want the values from buttons if we hit a button if ;; we hit enter on it, or if it's the first button after commit 5a0ab88cc984e8a5e66f85cb5acfa362fc66bdb6 Author: Lars Ingebrigtsen Date: Sat Sep 14 16:48:21 2019 +0200 Add default foreground colours to SVG images * lisp/net/shr.el (svg--wrap-svg): Add a default foreground colour to SVG images (bug#37159). This helps with images like the ones in https://en.wikipedia.org/wiki/Banach_fixed-point_theorem that specify no foreground or background colours. (shr-parse-image-data): Use it. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 81c3fb4aa5..1dff129b9d 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1180,8 +1180,24 @@ Return a string with image data." ;; so glitches may occur during this transformation. (shr-dom-to-xml (libxml-parse-xml-region (point) (point-max))))) + ;; SVG images often do not have a specified foreground/background + ;; color, so wrap them in styles. + (when (eq content-type 'image/svg+xml) + (setq data (svg--wrap-svg data))) (list data content-type))) +(defun svg--wrap-svg (data) + "Add a default foreground colour to SVG images." + (with-temp-buffer + (insert "" + "") + (buffer-string))) + (defun shr-image-displayer (content-function) "Return a function to display an image. CONTENT-FUNCTION is a function to retrieve an image for a cid url that commit 568f1488a69e8cb0961571ff8f158df8891c3c44 Author: Lars Ingebrigtsen Date: Sat Sep 14 16:07:34 2019 +0200 Make eww more liberal when interpreting some invalid HTML * lisp/net/eww.el (eww--preprocess-html): New function (bug#37009) to be more lenient with invalid HTML and translate common invalid HTML like "a <= b" into "a <= b" to be more liberal in what we accept before parsing. (eww-display-html): Use it. (eww-readable): Ditto. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 77e6cec9b0..2013604c9e 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -326,6 +326,18 @@ the default EWW buffer." #'url-hexify-string (split-string url) "+")))))) url) +(defun eww--preprocess-html (start end) + "Translate all < characters that do not look like start of tags into <." + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char start) + (let ((case-fold-search t)) + (while (re-search-forward "<[^0-9a-z!/]" nil t) + (goto-char (match-beginning 0)) + (delete-region (point) (1+ (point))) + (insert "<")))))) + ;;;###autoload (defalias 'browse-web 'eww) ;;;###autoload @@ -479,6 +491,7 @@ Currently this means either text/html or application/xhtml+xml." ;; Remove CRLF and replace NUL with � before parsing. (while (re-search-forward "\\(\r$\\)\\|\0" nil t) (replace-match (if (match-beginning 1) "" "�") t t))) + (eww--preprocess-html (point) (point-max)) (libxml-parse-html-region (point) (point-max)))))) (source (and (null document) (buffer-substring (point) (point-max))))) @@ -716,6 +729,7 @@ the like." (condition-case nil (decode-coding-region (point-min) (point-max) 'utf-8) (coding-system-error nil)) + (eww--preprocess-html (point-min) (point-max)) (libxml-parse-html-region (point-min) (point-max)))) (base (plist-get eww-data :url))) (eww-score-readability dom) commit 49a4b86925f1338268a2e79d0ef164a3cb368ec2 Author: Eli Zaretskii Date: Sat Sep 14 17:04:30 2019 +0300 * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Fix a thinko. (Bug#36566) diff --git a/src/print.c b/src/print.c index c870aa5a08..7e5aed8287 100644 --- a/src/print.c +++ b/src/print.c @@ -1151,8 +1151,8 @@ print (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) #define PRINT_CIRCLE_CANDIDATE_P(obj) \ ((STRINGP (obj) \ && (string_intervals (obj) \ - || print_depth > 1 \ - || Vprint_continuous_numbering)) \ + || print_depth > 1 \ + || !NILP (Vprint_continuous_numbering))) \ || CONSP (obj) \ || (VECTORLIKEP (obj) \ && (VECTORP (obj) || COMPILEDP (obj) \ commit 5f7531f9e9b1d3d645d64937a9d5df80fc5b1222 Author: Tobias Zawada Date: Sat Sep 14 14:20:03 2019 +0200 Add a debug declaration to widget-specify-insert * lisp/wid-edit.el (widget-specify-insert): Add a debug declaration (bug#37368). Copyright-paperwork-exempt: yes diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 9bc7a076ee..7ed7b81280 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -414,6 +414,7 @@ the :notify function can't know the new value.") (defmacro widget-specify-insert (&rest form) "Execute FORM without inheriting any text properties." + (declare (debug body)) `(save-restriction (let ((inhibit-read-only t) (inhibit-modification-hooks t))