commit eb6bbd9fb175cacdfdc54c1187f5785ed3858f2f (HEAD, refs/remotes/origin/master) Author: Mattias EngdegÄrd Date: Tue Mar 12 13:19:35 2019 +0100 Use memql instead of memq in pcase * lisp/emacs-lisp/pcase.el (pcase--u1): Use memql instead of memq to work with bignums (Bug#34781). * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-member): Test the above. diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 9de2401549..a644453a94 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -785,7 +785,7 @@ Otherwise, it defers to REST which is a list of branches of the form ((eq 'or (caar matches)) (let* ((alts (cdar matches)) (var (if (eq (caar alts) 'match) (cadr (car alts)))) - (simples '()) (others '()) (memq-ok t)) + (simples '()) (others '()) (memql-ok t)) (when var (dolist (alt alts) (if (and (eq (car alt) 'match) (eq var (cadr alt)) @@ -793,16 +793,16 @@ Otherwise, it defers to REST which is a list of branches of the form (eq (car-safe upat) 'quote))) (let ((val (cadr (cddr alt)))) (unless (or (integerp val) (symbolp val)) - (setq memq-ok nil)) + (setq memql-ok nil)) (push (cadr (cddr alt)) simples)) (push alt others)))) (cond ((null alts) (error "Please avoid it") (pcase--u rest)) - ;; Yes, we can use `memq' (or `member')! + ;; Yes, we can use `memql' (or `member')! ((> (length simples) 1) (pcase--u1 (cons `(match ,var . (pred (pcase--flip - ,(if memq-ok #'memq #'member) + ,(if memql-ok #'memql #'member) ',simples))) (cdr matches)) code vars diff --git a/test/lisp/emacs-lisp/pcase-tests.el b/test/lisp/emacs-lisp/pcase-tests.el index 1e9d37fbfa..af8c9a3f3c 100644 --- a/test/lisp/emacs-lisp/pcase-tests.el +++ b/test/lisp/emacs-lisp/pcase-tests.el @@ -51,11 +51,13 @@ (ert-deftest pcase-tests-member () (should (pcase-tests-grep - 'memq (macroexpand-all '(pcase x ((or 1 2 3) body))))) + 'memql (macroexpand-all '(pcase x ((or 1 2 3) body))))) (should (pcase-tests-grep 'member (macroexpand-all '(pcase x ((or "a" 2 3) body))))) (should-not (pcase-tests-grep 'memq (macroexpand-all '(pcase x ((or "a" 2 3) body))))) + (should-not (pcase-tests-grep + 'memql (macroexpand-all '(pcase x ((or "a" 2 3) body))))) (let ((exp (macroexpand-all '(pcase x ("a" body1) commit dd30154e27b1085939abf144daaf257ebda0c3d6 Author: Eric Abrahamsen Date: Thu Mar 28 15:39:53 2019 -0700 Initiate gnus-active-hashtb before making ephemeral group * lisp/gnus/gnus-group.el (gnus-group-read-ephemeral-group): Needs to be a hash table, not nil. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 8c2411f4d9..bd24c3f8da 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2283,7 +2283,8 @@ Return the name of the group if selection was successful." (nnheader-init-server-buffer) ;; Necessary because of funky inlining. (require 'gnus-cache) - (setq gnus-newsrc-hashtb (gnus-make-hashtable 100))) + (setq gnus-newsrc-hashtb (gnus-make-hashtable 100) + gnus-active-hashtb (gnus-make-hashtable 100))) ;; Transform the select method into a unique server. (when (stringp method) (setq method (gnus-server-to-method method))) commit 2da9f8bf4222fda504f43b4757e154999cdbbf2c Author: Eli Zaretskii Date: Thu Mar 28 18:00:06 2019 +0200 Fix display of sliced images on MS-Windows * src/w32term.c (x_draw_image_foreground): Fix detection of scaled images for sliced images. Scale the original width of a slice and its coordinates of origin as well. diff --git a/src/w32term.c b/src/w32term.c index 0f0d6482fc..4d5f2e7c3c 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1896,6 +1896,24 @@ x_draw_image_foreground (struct glyph_string *s) orig_height = s->slice.height; } + double w_factor = 1.0, h_factor = 1.0; + bool scaled = false; + int orig_slice_width = s->slice.width, + orig_slice_height = s->slice.height; + int orig_slice_x = s->slice.x, orig_slice_y = s->slice.y; + /* For scaled images we need to restore the original slice's + dimensions and origin coordinates, from before the scaling. */ + if (s->img->width != orig_width || s->img->height != orig_height) + { + scaled = true; + w_factor = (double) orig_width / (double) s->img->width; + h_factor = (double) orig_height / (double) s->img->height; + orig_slice_width = s->slice.width * w_factor + 0.5; + orig_slice_height = s->slice.height * h_factor + 0.5; + orig_slice_x = s->slice.x * w_factor + 0.5; + orig_slice_y = s->slice.y * h_factor + 0.5; + } + if (s->img->mask) { HDC mask_dc = CreateCompatibleDC (s->hdc); @@ -1903,7 +1921,7 @@ x_draw_image_foreground (struct glyph_string *s) SetTextColor (s->hdc, RGB (255, 255, 255)); SetBkColor (s->hdc, RGB (0, 0, 0)); - if (s->slice.width == orig_width && s->slice.height == orig_height) + if (!scaled) { BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, compat_hdc, s->slice.x, s->slice.y, SRCINVERT); @@ -1922,14 +1940,14 @@ x_draw_image_foreground (struct glyph_string *s) && (pmode = SetStretchBltMode (s->hdc, HALFTONE)) != 0) SetBrushOrgEx (s->hdc, 0, 0, NULL); StretchBlt (s->hdc, x, y, s->slice.width, s->slice.height, - compat_hdc, s->slice.x, s->slice.y, - orig_width, orig_height, SRCINVERT); + compat_hdc, orig_slice_x, orig_slice_y, + orig_slice_width, orig_slice_height, SRCINVERT); StretchBlt (s->hdc, x, y, s->slice.width, s->slice.height, - mask_dc, s->slice.x, s->slice.y, - orig_width, orig_height, SRCAND); + mask_dc, orig_slice_x, orig_slice_y, + orig_slice_width, orig_slice_height, SRCAND); StretchBlt (s->hdc, x, y, s->slice.width, s->slice.height, - compat_hdc, s->slice.x, s->slice.y, - orig_width, orig_height, SRCINVERT); + compat_hdc, orig_slice_x, orig_slice_y, + orig_slice_width, orig_slice_height, SRCINVERT); if (pmode) SetStretchBltMode (s->hdc, pmode); } @@ -1940,7 +1958,7 @@ x_draw_image_foreground (struct glyph_string *s) { SetTextColor (s->hdc, s->gc->foreground); SetBkColor (s->hdc, s->gc->background); - if (s->slice.width == orig_width && s->slice.height == orig_height) + if (!scaled) BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, compat_hdc, s->slice.x, s->slice.y, SRCCOPY); else @@ -1951,8 +1969,8 @@ x_draw_image_foreground (struct glyph_string *s) && (pmode = SetStretchBltMode (s->hdc, HALFTONE)) != 0) SetBrushOrgEx (s->hdc, 0, 0, NULL); StretchBlt (s->hdc, x, y, s->slice.width, s->slice.height, - compat_hdc, s->slice.x, s->slice.y, - orig_width, orig_height, SRCCOPY); + compat_hdc, orig_slice_x, orig_slice_y, + orig_slice_width, orig_slice_height, SRCCOPY); if (pmode) SetStretchBltMode (s->hdc, pmode); } commit 2654c0b61b2cb8ee14d84f042ae6fc605adf64a8 Author: Michael Albinus Date: Thu Mar 28 11:43:09 2019 +0100 * lisp/net/tramp.el (tramp-accept-process-output): Use `push'. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0e062b7155..5b50d39a0d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4081,7 +4081,7 @@ for process communication also." ;; Enable our progress reporter. (dolist (timer tl) (if (eq (timer--function timer) #'tramp-progress-reporter-update) - (add-to-list 'timer-list timer))) + (push timer timer-list))) ;; JUST-THIS-ONE is set due to Bug#12145. (tramp-message proc 10 "%s %s %s %s\n%s"