commit 4a2a1eba09e5bbc37b853733708feae17f1425f5 (HEAD, refs/remotes/origin/master) Author: Dmitry Antipov Date: Wed Jun 29 07:46:59 2016 +0300 Avoid possible NULL pointer dereference found by GCC 6.1.1 * src/xfns.c (x_get_monitor_attributes_xrandr): Always check the value returned by XRRGetOutputInfo. diff --git a/src/xfns.c b/src/xfns.c index 1120c33..265eb6c 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4295,8 +4295,8 @@ x_get_monitor_attributes_xrandr (struct x_display_info *dpyinfo) { XRROutputInfo *info = XRRGetOutputInfo (dpy, resources, resources->outputs[i]); - Connection conn = info ? info->connection : RR_Disconnected; - RRCrtc id = info ? info->crtc : None; + if (!info) + continue; if (strcmp (info->name, "default") == 0) { @@ -4307,9 +4307,9 @@ x_get_monitor_attributes_xrandr (struct x_display_info *dpyinfo) return Qnil; } - if (conn != RR_Disconnected && id != None) + if (info->connection != RR_Disconnected && info->crtc != None) { - XRRCrtcInfo *crtc = XRRGetCrtcInfo (dpy, resources, id); + XRRCrtcInfo *crtc = XRRGetCrtcInfo (dpy, resources, info->crtc); struct MonitorInfo *mi = &monitors[i]; XRectangle workarea_r; commit 1a5d0c15185986e645e8fb8080a2338d8f17d562 Author: Tino Calancha Date: Wed Jun 29 11:47:16 2016 +0900 Dired recognize dirs when file size in human units * lisp/dired.el (dired-re-inode-size): Update 'dired-re-inode-size' to match when Dired displays the allocated file size column in human readable units (Bug#22255). diff --git a/lisp/dired.el b/lisp/dired.el index 38979b5..d078478 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -303,7 +303,7 @@ The directory name must be absolute, but need not be fully expanded.") (put 'dired-actual-switches 'safe-local-variable 'dired-safe-switches-p) -(defvar dired-re-inode-size "[0-9 \t]*" +(defvar dired-re-inode-size "[0-9 \t]*[.,0-9]*[BkKMGTPEZY]?[ \t]*" "Regexp for optional initial inode and file size as made by `ls -i -s'.") ;; These regexps must be tested at beginning-of-line, but are also commit ff64fa75a88dad730568d15dd5037e141d198a8f Author: Mark Oteiza Date: Tue Jun 28 21:52:48 2016 -0400 Fix breakage from previous change * lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): * lisp/vc/log-view.el (log-view-font-lock-keywords): Quote face. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index bc5e516..710899f 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -505,7 +505,7 @@ An alternative value is \" . \", if you use a font with a narrow period." (funcall inbraces-re (concat "{" (funcall inbraces-re "{[^}]*}") "*}")) "*}\\)+\\$?\\$") - (0 tex-math)) + (0 'tex-math)) ;; Heading args. (,(concat slash headings "\\*?" opt arg) ;; If ARG ends up matching too much (if the {} don't match, e.g.) diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index c77770b..44b8e0b 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -241,8 +241,8 @@ The match group number 1 should match the revision number itself.") ;; and log-view-message-re, if applicable. '((eval . `(,log-view-file-re (1 (if (boundp 'cvs-filename-face) cvs-filename-face)) - (0 log-view-file append))) - (eval . `(,log-view-message-re . log-view-message)))) + (0 'log-view-file append))) + (eval . `(,log-view-message-re . 'log-view-message)))) (defconst log-view-font-lock-defaults '(log-view-font-lock-keywords t nil nil nil)) commit 652b638b0f80fda2abc316f3d1b0f005c7d28e1a Author: Mark Oteiza Date: Tue Jun 28 15:49:48 2016 -0400 Fix breakage from previous change. * lisp/textmodes/texinfo.el (texinfo-font-lock-keywords): Quote face. diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index db9944d..bc82bb6 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -379,7 +379,7 @@ Subexpression 1 is what goes into the corresponding `@end' statement.") ;; 1 (texinfo-clone-environment (match-beginning 1) (match-end 1)) keep) (,(concat "^@" (regexp-opt (mapcar 'car texinfo-section-list) t) ".*\n") - 0 texinfo-heading t)) + 0 'texinfo-heading t)) "Additional expressions to highlight in Texinfo mode.") (defun texinfo-clone-environment (start end) commit 2adc4ccd03d24660bcf7f8ff056c7f32b92b584d Author: Eli Zaretskii Date: Tue Jun 28 19:59:46 2016 +0300 Add tests for copying properties by 'format' * test/src/editfns-tests.el (format-properties): New test. diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el new file mode 100644 index 0000000..c515927 --- /dev/null +++ b/test/src/editfns-tests.el @@ -0,0 +1,57 @@ +;;; editfns-tests.el -- tests for editfns.c + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(require 'ert) + +(ert-deftest format-properties () + ;; Bug #23730 + (should (ert-equal-including-properties + (format (propertize "%d" 'face '(:background "red")) 1) + #("1" 0 1 (face (:background "red"))))) + (should (ert-equal-including-properties + (format (propertize "%2d" 'face '(:background "red")) 1) + #(" 1" 0 2 (face (:background "red"))))) + (should (ert-equal-including-properties + (format (propertize "%02d" 'face '(:background "red")) 1) + #("01" 0 2 (face (:background "red"))))) + (should (ert-equal-including-properties + (format (concat (propertize "%2d" 'x 'X) + (propertize "a" 'a 'A) + (propertize "b" 'b 'B)) + 1) + #(" 1ab" 0 2 (x X) 2 3 (a A) 3 4 (b B)))) + + ;; Bug #5306 + (should (ert-equal-including-properties + (format "%.10s" + (concat "1234567890aaaa" + (propertize "12345678901234567890" 'xxx 25))) + "1234567890")) + (should (ert-equal-including-properties + (format "%.10s" + (concat "123456789" + (propertize "12345678901234567890" 'xxx 25))) + #("1234567891" 9 10 (xxx 25)))) + + ;; Bug #23859 + (should (ert-equal-including-properties + (format "%4s" (propertize "hi" 'face 'bold)) + #(" hi" 0 4 (face bold))))) commit 0644e6f56d2be82dd716478eb65e7b3c761d813d Author: Eli Zaretskii Date: Tue Jun 28 19:03:43 2016 +0300 Fix copying properties in 'format' when it produces padding * src/textprop.c (extend_property_ranges): Correct range extension when the new end is beyond the old end. (Bug#23859) diff --git a/src/textprop.c b/src/textprop.c index c4e49d9..aabd567 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -2065,9 +2065,14 @@ extend_property_ranges (Lisp_Object list, Lisp_Object new_end) else XSETCDR (prev, XCDR (list)); } - else if (XINT (end) > max) - /* The end-point is past the end of the new string. */ - XSETCAR (XCDR (item), new_end); + else if (XINT (end) != max) + { + /* Either the end-point is past the end of the new string, + and we need to discard the properties past the new end, + or the caller is extending the property range, and we + should update the end-point to reflect that. */ + XSETCAR (XCDR (item), new_end); + } } return head;