commit abd3dd3a467fd93ac66db1a13b31787d88a95d55 (HEAD, refs/remotes/origin/master) Author: Juanma Barranquero Date: Sat Nov 30 10:31:45 2019 +0100 * src/lread.c (syms_of_lread): Doc fix. diff --git a/src/lread.c b/src/lread.c index e5a9c93c55..7b3686b3d7 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4900,8 +4900,8 @@ When `load' is run and the file-name argument matches an element's REGEXP-OR-FEATURE, or when `provide' is run and provides the symbol REGEXP-OR-FEATURE, the FUNCS in the element are called. -An error in FORMS does not undo the load, but does prevent execution of -the rest of the FORMS. */); +An error in FUNCS does not undo the load, but does prevent calling +the rest of the FUNCS. */); Vafter_load_alist = Qnil; DEFVAR_LISP ("load-history", Vload_history, commit 3e9c82d99902230812c10e8d464f4908a8a6ea42 Author: Alan Third Date: Sat Nov 9 17:04:25 2019 +0000 Fix image scaling with masks (bug#38109) * src/image.c (lookup_image): Move call to image_set_transform after postprocess_image. (image_create_x_image_and_pixmap_1): Use new function. (image_set_transform): Apply the transform to the mask too. (x_create_xrender_picture): New function. (Create_Pixmap_From_Bitmap_Data): (xpm_load): Use new function. * src/xterm.c (x_composite_image): Use PictOpOver when there is a mask so the transparency is honoured. (x_draw_image_foreground_1): Use x_composite_image. diff --git a/src/image.c b/src/image.c index 870f008b14..70d932f9ed 100644 --- a/src/image.c +++ b/src/image.c @@ -2244,6 +2244,14 @@ image_set_transform (struct frame *f, struct image *img) XRenderSetPictureFilter (FRAME_X_DISPLAY (f), img->picture, FilterBest, 0, 0); XRenderSetPictureTransform (FRAME_X_DISPLAY (f), img->picture, &tmat); + + if (img->mask_picture) + { + XRenderSetPictureFilter (FRAME_X_DISPLAY (f), img->mask_picture, + FilterBest, 0, 0); + XRenderSetPictureTransform (FRAME_X_DISPLAY (f), img->mask_picture, + &tmat); + } } # elif defined HAVE_NTGUI /* Store the transform matrix for application at draw time. */ @@ -2313,10 +2321,6 @@ lookup_image (struct frame *f, Lisp_Object spec) Lisp_Object ascent, margin, relief, bg; int relief_bound; -#ifdef HAVE_NATIVE_TRANSFORMS - image_set_transform (f, img); -#endif - ascent = image_spec_value (spec, QCascent, NULL); if (FIXNUMP (ascent)) img->ascent = XFIXNUM (ascent); @@ -2357,6 +2361,13 @@ lookup_image (struct frame *f, Lisp_Object spec) don't have the image yet. */ if (!EQ (builtin_lisp_symbol (img->type->type), Qpostscript)) postprocess_image (f, img); + + /* postprocess_image above may modify the image or the mask, + relying on the image's real width and height, so + image_set_transform must be called after it. */ +#ifdef HAVE_NATIVE_TRANSFORMS + image_set_transform (f, img); +#endif } unblock_input (); @@ -2527,6 +2538,61 @@ x_destroy_x_image (XImage *ximg) } } +# if !defined USE_CAIRO && defined HAVE_XRENDER +/* Create and return an XRender Picture for XRender transforms. */ +static Picture +x_create_xrender_picture (struct frame *f, Emacs_Pixmap pixmap, int depth) +{ + Picture p; + Display *display = FRAME_X_DISPLAY (f); + int event_basep, error_basep; + + if (XRenderQueryExtension (display, &event_basep, &error_basep)) + { + if (depth <= 0) + depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f)); + if (depth == 32 || depth == 24 || depth == 8 || depth == 4 || depth == 1) + { + /* FIXME: Do we need to handle all possible bit depths? + XRenderFindStandardFormat supports PictStandardARGB32, + PictStandardRGB24, PictStandardA8, PictStandardA4, + PictStandardA1, and PictStandardNUM (what is this?!). + + XRenderFindFormat may support more, but I don't + understand the documentation. */ + XRenderPictFormat *format; + format = XRenderFindStandardFormat (display, + depth == 32 ? PictStandardARGB32 + : depth == 24 ? PictStandardRGB24 + : depth == 8 ? PictStandardA8 + : depth == 4 ? PictStandardA4 + : PictStandardA1); + + /* Set the Picture repeat to "pad". This means when + operations look at pixels outside the image area they + will use the value of the nearest real pixel instead of + using a transparent black pixel. */ + XRenderPictureAttributes attr; + unsigned long attr_mask = CPRepeat; + attr.repeat = RepeatPad; + + p = XRenderCreatePicture (display, pixmap, format, attr_mask, &attr); + } + else + { + image_error ("Specified image bit depth is not supported by XRender"); + return 0; + } + } + else + { + /* XRender not supported on this display. */ + return 0; + } + + return p; +} +# endif /* !defined USE_CAIRO && defined HAVE_XRENDER */ #endif /* HAVE_X_WINDOWS */ /* Return true if XIMG's size WIDTH x HEIGHT doesn't break the @@ -2579,36 +2645,8 @@ image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int d if (!x_create_x_image_and_pixmap (f, width, height, depth, pimg, pixmap)) return 0; # ifdef HAVE_XRENDER - Display *display = FRAME_X_DISPLAY (f); - int event_basep, error_basep; - if (picture && XRenderQueryExtension (display, &event_basep, &error_basep)) - { - if (depth <= 0) - depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f)); - if (depth == 32 || depth == 24 || depth == 8) - { - XRenderPictFormat *format; - XRenderPictureAttributes attr; - - /* FIXME: Do we need to handle all possible bit depths? - XRenderFindStandardFormat supports PictStandardARGB32, - PictStandardRGB24, PictStandardA8, PictStandardA4, - PictStandardA1, and PictStandardNUM (what is this?!). - - XRenderFindFormat may support more, but I don't - understand the documentation. */ - format = XRenderFindStandardFormat (display, - depth == 32 ? PictStandardARGB32 - : depth == 24 ? PictStandardRGB24 - : PictStandardA8); - *picture = XRenderCreatePicture (display, *pixmap, format, 0, &attr); - } - else - { - image_error ("Specified image bit depth is not supported by XRender"); - *picture = 0; - } - } + if (picture) + *picture = x_create_xrender_picture (f, *pixmap, depth); # endif return 1; @@ -3387,6 +3425,11 @@ Create_Pixmap_From_Bitmap_Data (struct frame *f, struct image *img, char *data, img->width, img->height, fg, bg, DefaultDepthOfScreen (FRAME_X_SCREEN (f))); +# if !defined USE_CAIRO && defined HAVE_XRENDER + if (img->pixmap) + img->picture = x_create_xrender_picture (f, img->pixmap, 0); +# endif + #elif defined HAVE_NTGUI img->pixmap = w32_create_pixmap_from_bitmap_data (img->width, img->height, data); @@ -4359,18 +4402,30 @@ xpm_load (struct frame *f, struct image *img) image_clear_image (f, img); rc = XpmNoMemory; } - else if (img->mask_img) - { - img->mask = XCreatePixmap (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f), - img->mask_img->width, - img->mask_img->height, - img->mask_img->depth); - if (img->mask == NO_PIXMAP) - { - image_clear_image (f, img); - rc = XpmNoMemory; - } - } + else + { +# if !defined USE_CAIRO && defined HAVE_XRENDER + img->picture = x_create_xrender_picture (f, img->pixmap, + img->ximg->depth); +# endif + if (img->mask_img) + { + img->mask = XCreatePixmap (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f), + img->mask_img->width, + img->mask_img->height, + img->mask_img->depth); + if (img->mask == NO_PIXMAP) + { + image_clear_image (f, img); + rc = XpmNoMemory; + } +# if !defined USE_CAIRO && defined HAVE_XRENDER + else + img->mask_picture = x_create_xrender_picture + (f, img->mask, img->mask_img->depth); +# endif + } + } } #endif diff --git a/src/xterm.c b/src/xterm.c index d55bc3890d..9a6eda4488 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3049,14 +3049,12 @@ x_composite_image (struct glyph_string *s, Pixmap dest, XRenderPictFormat *default_format; XRenderPictureAttributes attr; - /* FIXME: Should we do this each time or would it make sense to - store destination in the frame struct? */ default_format = XRenderFindVisualFormat (display, DefaultVisual (display, 0)); destination = XRenderCreatePicture (display, dest, default_format, 0, &attr); - XRenderComposite (display, PictOpSrc, + XRenderComposite (display, s->img->mask_picture ? PictOpOver : PictOpSrc, s->img->picture, s->img->mask_picture, destination, srcX, srcY, srcX, srcY, @@ -3315,6 +3313,7 @@ x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap) trust on the shape extension to be available (XShapeCombineRegion). So, compute the rectangle to draw manually. */ + /* FIXME: Do we need to do this when using XRender compositing? */ unsigned long mask = (GCClipMask | GCClipXOrigin | GCClipYOrigin | GCFunction); XGCValues xgcv; @@ -3325,9 +3324,9 @@ x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap) xgcv.function = GXcopy; XChangeGC (display, s->gc, mask, &xgcv); - XCopyArea (display, s->img->pixmap, pixmap, s->gc, - s->slice.x, s->slice.y, - s->slice.width, s->slice.height, x, y); + x_composite_image (s, pixmap, + s->slice.x, s->slice.y, + x, y, s->slice.width, s->slice.height); XSetClipMask (display, s->gc, None); } else commit b1a69505843c593a3a757a614dea16e2a7185579 Author: Stefan Monnier Date: Fri Nov 29 12:26:31 2019 -0500 * lisp/gnus/gnus.el (gnus-info): Define with `cl-defstruct` This makes the accessors into (inlined) functions (instead of macros), which simplifies some uses, and it makes the gnus-info-set- macros redundant since we can use `setf` instead. Remove them and update all users. (gnus-info-group, gnus-info-rank, gnus-info-read, gnus-info-marks) (gnus-info-method, gnus-info-params): Auto-defined by defstruct. (gnus-info-level, gnus-info-score): Define as a function. Add gv-setter. (gnus-info-set-group, gnus-info-set-rank, gnus-info-set-read): Remove, use `setf` instead. (gnus-info-set-marks, gnus-info-set-method, gnus-info-set-params): Define as a function. (gnus-info-set-entry): Delete function. (gnus-info--grow-entry): New function, extracted from it. (gnus-info--set-level, gnus-info--set-score): New functions, extracted from the `gnus-info-set-level` and `gnus-info-set-score` which they replace. (gnus-get-info): Define as a function. * lisp/gnus/gnus-group.el (gnus-group-edit-group-done): Use the `extend` arg of `gnus-info-set-method`. (gnus-group-sort-selected-flat): eta-reduce. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 1f25255278..afe1997378 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -1212,26 +1212,24 @@ This can be added to `gnus-select-article-hook' or (marks (nth 2 action))) (dolist (mark marks) (cond ((eq mark 'read) - (gnus-info-set-read - info - (funcall (if (eq what 'add) - 'gnus-range-add - 'gnus-remove-from-range) - (gnus-info-read info) - range)) + (setf (gnus-info-read info) + (funcall (if (eq what 'add) + #'gnus-range-add + #'gnus-remove-from-range) + (gnus-info-read info) + range)) (gnus-get-unread-articles-in-group info (gnus-active (gnus-info-group info)))) ((memq mark '(tick)) (let ((info-marks (assoc mark (gnus-info-marks info)))) (unless info-marks - (gnus-info-set-marks - info (cons (setq info-marks (list mark)) - (gnus-info-marks info)))) + (push (setq info-marks (list mark)) + (gnus-info-marks info))) (setcdr info-marks (funcall (if (eq what 'add) - 'gnus-range-add - 'gnus-remove-from-range) + #'gnus-range-add + #'gnus-remove-from-range) (cdr info-marks) range)))))))) @@ -1303,12 +1301,11 @@ downloaded into the agent." ;; file. (let ((read (gnus-info-read info))) - (gnus-info-set-read - info - (gnus-range-add - read - (list (cons (1+ agent-max) - (1- active-min)))))) + (setf (gnus-info-read info) + (gnus-range-add + read + (list (cons (1+ agent-max) + (1- active-min)))))) ;; Lie about the agent's local range for this group to ;; disable the set read each time this server is opened. @@ -2533,13 +2530,14 @@ modified) original contents, they are first saved to their own file." (assq mark (gnus-info-marks (setq info (gnus-get-info group)))))) (when (cdr marked-arts) + ;; FIXME: Use `cl-callf'? (setq marks (delq marked-arts (gnus-info-marks info))) - (gnus-info-set-marks info marks))))) + (setf (gnus-info-marks info) marks))))) (let ((read (gnus-info-read (or info (setq info (gnus-get-info group)))))) - (gnus-info-set-read - info (gnus-add-to-range read unfetched-articles))) + (setf (gnus-info-read info) + (gnus-add-to-range read unfetched-articles))) (gnus-group-update-group group t) (sit-for 0) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 742f8f4be5..5d68163ff3 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2973,11 +2973,7 @@ and NEW-NAME will be prompted for." (setq info (copy-tree info)) (setcar info new-group) (unless (gnus-server-equal method "native") - (unless (nthcdr 3 info) - (nconc info (list nil nil))) - (unless (nthcdr 4 info) - (nconc info (list nil))) - (gnus-info-set-method info method)) + (gnus-info-set-method info method t)) (gnus-group-set-info info)) (gnus-group-update-group (or new-group group)) (gnus-group-position-point))) @@ -3374,14 +3370,12 @@ If REVERSE, sort in reverse order." "Sort only the selected GROUPS, using FUNC. If REVERSE is non-nil, reverse the sorting." (let ((infos (sort - (mapcar (lambda (g) - (gnus-get-info g)) - groups) + (mapcar #'gnus-get-info groups) func)) sorted-groups) (when reverse (setq infos (nreverse infos))) - (setq sorted-groups (mapcar (lambda (i) (gnus-info-group i)) infos)) + (setq sorted-groups (mapcar #'gnus-info-group infos)) ;; Find the original locations of GROUPS in `gnus-group-list', and ;; replace each one, in order, with a group from SORTED-GROUPS. @@ -3532,16 +3526,16 @@ Obeys the process/prefix convention." `(progn (gnus-request-set-mark ,group ',action) (gnus-info-set-marks ',info ',(gnus-info-marks info) t) - (gnus-info-set-read ',info ',(gnus-info-read info)) + (setf (gnus-info-read ',info) ',(gnus-info-read info)) (when (gnus-group-jump-to-group ,group) (gnus-get-unread-articles-in-group ',info ',(gnus-active group) t) (gnus-group-update-group-line)))) (setq action (mapcar (lambda (el) (list (nth 0 el) 'del (nth 2 el))) action)) (gnus-request-set-mark group action) - (gnus-info-set-read info nil) + (setf (gnus-info-read info) nil) (when (gnus-info-marks info) - (gnus-info-set-marks info nil)))) + (setf (gnus-info-marks info) nil)))) ;; Group catching up. diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 0abbfe6720..a21bc25840 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -727,7 +727,7 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (let* ((range (if (= min 2) 1 (cons 1 (1- min)))) (read (gnus-info-read info)) (new-read (gnus-range-add read (list range)))) - (gnus-info-set-read info new-read))) + (setf (gnus-info-read info) new-read))) info))))) (defun gnus-request-expire-articles (articles group &optional force) diff --git a/lisp/gnus/gnus-sieve.el b/lisp/gnus/gnus-sieve.el index fc0bf3098b..5edd6f5f7a 100644 --- a/lisp/gnus/gnus-sieve.el +++ b/lisp/gnus/gnus-sieve.el @@ -128,7 +128,7 @@ Return nil if no rule could be guessed." (info (gnus-get-info gnus-newsgroup-name))) (if (null rule) (error "Could not guess rule for article") - (gnus-info-set-params info (cons rule (gnus-info-params info))) + (push rule (gnus-info-params info)) (message "Added rule in group %s for article: %s" gnus-newsgroup-name rule))))) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index e142c438ee..b90229e6f5 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -1828,7 +1828,7 @@ The info element is shared with the same element of ;; Make the same select-methods identical Lisp objects. (when (setq method (gnus-info-method info)) (if (setq rest (member method methods)) - (gnus-info-set-method info (car rest)) + (setf (gnus-info-method info) (car rest)) (push method methods))) ;; Check for encoded group names and decode them. (when (string-match-p "[^[:ascii:]]" (setq gname (car info))) @@ -1890,8 +1890,8 @@ The info element is shared with the same element of (push article news))) (when news ;; Enter this list into the group info. - (gnus-info-set-read - info (gnus-remove-from-range (gnus-info-read info) (nreverse news))) + (setf (gnus-info-read info) + (gnus-remove-from-range (gnus-info-read info) (nreverse news))) ;; Set the number of unread articles in gnus-newsrc-hashtb. (gnus-get-unread-articles-in-group info (gnus-active group)) @@ -1958,7 +1958,7 @@ The info element is shared with the same element of (when (eq modified 'remove-null) (setq r (delq nil r))) ;; Enter this list into the group info. - (gnus-info-set-read info r) + (setf (gnus-info-read info) r) ;; Set the number of unread articles in gnus-newsrc-hashtb. (gnus-get-unread-articles-in-group info (gnus-active group)) @@ -2362,12 +2362,11 @@ If FORCE is non-nil, the .newsrc file is read." (setq dormant (cdr (assq 'dormant marks)) ticked (cdr (assq 'tick marks))) (when (or dormant ticked) - (gnus-info-set-read - info - (gnus-add-to-range - (gnus-info-read info) - (nconc (gnus-uncompress-range dormant) - (gnus-uncompress-range ticked))))))))) + (setf (gnus-info-read info) + (gnus-add-to-range + (gnus-info-read info) + (nconc (gnus-uncompress-range dormant) + (gnus-uncompress-range ticked))))))))) (defun gnus-load (file) "Load FILE, but in such a way that read errors can be reported." @@ -2438,9 +2437,9 @@ If FORCE is non-nil, the .newsrc file is read." (while (setq group (pop newsrc)) (if (setq info (gnus-get-info (car group))) (progn - (gnus-info-set-read info (cddr group)) - (gnus-info-set-level - info (if (nth 1 group) gnus-level-default-subscribed + (setf (gnus-info-read info) (cddr group)) + (setf (gnus-info-level info) + (if (nth 1 group) gnus-level-default-subscribed gnus-level-default-unsubscribed)) (push info gnus-newsrc-alist)) (push (setq info @@ -2453,9 +2452,9 @@ If FORCE is non-nil, the .newsrc file is read." (when (setq m (assoc (car group) marked)) (unless (nthcdr 3 info) (nconc info (list nil))) - (gnus-info-set-marks - info (list (cons 'tick (gnus-compress-sequence - (sort (cdr m) '<) t)))))) + (setf (gnus-info-marks info) + (list (cons 'tick (gnus-compress-sequence + (sort (cdr m) #'<) t)))))) (setq newsrc killed) (while newsrc (setcar newsrc (caar newsrc)) @@ -2609,7 +2608,7 @@ If FORCE is non-nil, the .newsrc file is read." ;; There is an entry for this file in ;; `gnus-newsrc-hashtb'. (progn - (gnus-info-set-read info (nreverse reads)) + (setf (gnus-info-read info) (nreverse reads)) ;; We update the level very gently. In fact, we ;; only change it if there's been a status change ;; from subscribed to unsubscribed, or vice versa. @@ -2621,7 +2620,7 @@ If FORCE is non-nil, the .newsrc file is read." (1+ gnus-level-default-unsubscribed)))) ((and (> level gnus-level-subscribed) subscribed) (setq level gnus-level-default-subscribed))) - (gnus-info-set-level info level)) + (setf (gnus-info-level info) level)) ;; This is a new group. (setq info (list group (if subscribed diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 4a51d2c80b..d62c063436 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6367,7 +6367,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (gnus-undo-register `(progn (gnus-info-set-marks ',info ',(gnus-info-marks info) t) - (gnus-info-set-read ',info ',(gnus-info-read info)) + (setf (gnus-info-read ',info) ',(gnus-info-read info)) (gnus-get-unread-articles-in-group ',info (gnus-active ,group)) (when ,set-marks (gnus-request-set-mark @@ -6375,7 +6375,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (gnus-group-jump-to-group ,group) (gnus-group-update-group ,group t)))) ;; Add the read articles to the range. - (gnus-info-set-read info range) + (setf (gnus-info-read info) range) (when set-marks (gnus-request-set-mark group (list (list range 'add '(read))))) ;; Then we have to re-compute how many unread @@ -10283,8 +10283,8 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." (when (and (not (memq article gnus-newsgroup-unreads)) (cdr art-group)) (push 'read to-marks) - (gnus-info-set-read - info (gnus-add-to-range (gnus-info-read info) + (setf (gnus-info-read info) + (gnus-add-to-range (gnus-info-read info) (list (cdr art-group))))) ;; See whether the article is to be put in the cache. @@ -12891,14 +12891,14 @@ UNREAD is a sorted list." (gnus-undo-register `(progn (gnus-info-set-marks ',info ',(gnus-info-marks info) t) - (gnus-info-set-read ',info ',(gnus-info-read info)) + (setf (gnus-info-read ',info) ',(gnus-info-read info)) (gnus-group-jump-to-group ,group) (gnus-get-unread-articles-in-group ',info (gnus-active ,group)) (gnus-group-update-group ,group t) ,setmarkundo)))) ;; Enter this list into the group info. - (gnus-info-set-read info read) + (setf (gnus-info-read info) read) ;; Set the number of unread articles in gnus-newsrc-hashtb. (gnus-get-unread-articles-in-group info (gnus-active group)) t)))) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 0673ac15f6..23643cc6c7 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2817,67 +2817,50 @@ See Info node `(gnus)Formatting Variables'." ;; Info access macros. -(defmacro gnus-info-group (info) - `(nth 0 ,info)) -(defmacro gnus-info-rank (info) - `(nth 1 ,info)) -(defmacro gnus-info-read (info) - `(nth 2 ,info)) -(defmacro gnus-info-marks (info) - `(nth 3 ,info)) -(defmacro gnus-info-method (info) - `(nth 4 ,info)) -(defmacro gnus-info-params (info) - `(nth 5 ,info)) - -(defmacro gnus-info-level (info) - `(let ((rank (gnus-info-rank ,info))) - (if (consp rank) - (car rank) - rank))) -(defmacro gnus-info-score (info) - `(let ((rank (gnus-info-rank ,info))) - (or (and (consp rank) (cdr rank)) 0))) - -(defmacro gnus-info-set-group (info group) - `(setcar ,info ,group)) -(defmacro gnus-info-set-rank (info rank) - `(setcar (nthcdr 1 ,info) ,rank)) -(defmacro gnus-info-set-read (info read) - `(setcar (nthcdr 2 ,info) ,read)) -(defmacro gnus-info-set-marks (info marks &optional extend) - (if extend - `(gnus-info-set-entry ,info ,marks 3) - `(setcar (nthcdr 3 ,info) ,marks))) -(defmacro gnus-info-set-method (info method &optional extend) - (if extend - `(gnus-info-set-entry ,info ,method 4) - `(setcar (nthcdr 4 ,info) ,method))) -(defmacro gnus-info-set-params (info params &optional extend) - (if extend - `(gnus-info-set-entry ,info ,params 5) - `(setcar (nthcdr 5 ,info) ,params))) - -(defun gnus-info-set-entry (info entry number) +(cl-defstruct (gnus-info + (:constructor nil) + (:type list)) + group rank read marks method params) + +(defsubst gnus-info-level (info) + (declare (gv-setter gnus-info--set-level)) + (let ((rank (gnus-info-rank info))) + (if (consp rank) + (car rank) + rank))) +(defsubst gnus-info-score (info) + (declare (gv-setter gnus-info--set-score)) + (let ((rank (gnus-info-rank info))) + (or (and (consp rank) (cdr rank)) 0))) + +(defsubst gnus-info-set-marks (info marks &optional extend) + (if extend (gnus-info--grow-entry info 3)) + (setf (gnus-info-marks info) marks)) +(defsubst gnus-info-set-method (info method &optional extend) + (if extend (gnus-info--grow-entry info 4)) + (setf (gnus-info-method info) method)) +(defsubst gnus-info-set-params (info params &optional extend) + (if extend (gnus-info--grow-entry info 5)) + (setf (gnus-info-params info) params)) + +(defun gnus-info--grow-entry (info number) ;; Extend the info until we have enough elements. (while (<= (length info) number) - (nconc info (list nil))) - ;; Set the entry. - (setcar (nthcdr number info) entry)) - -(defmacro gnus-info-set-level (info level) - `(let ((rank (cdr ,info))) - (if (consp (car rank)) - (setcar (car rank) ,level) - (setcar rank ,level)))) -(defmacro gnus-info-set-score (info score) - `(let ((rank (cdr ,info))) - (if (consp (car rank)) - (setcdr (car rank) ,score) - (setcar rank (cons (car rank) ,score))))) - -(defmacro gnus-get-info (group) - `(nth 1 (gethash ,group gnus-newsrc-hashtb))) + (nconc info (list nil)))) + +(defsubst gnus-info--set-level (info level) + (let ((rank (gnus-info-rank info))) + (if (consp rank) + (setcar rank level) + (setf (gnus-info-rank info) level)))) +(defsubst gnus-info--set-score (info score) + (let ((rank (gnus-info-rank info))) + (if (consp rank) + (setcdr rank score) + (setf (gnus-info-rank info) (cons rank score))))) + +(defsubst gnus-get-info (group) + (nth 1 (gethash group gnus-newsrc-hashtb))) (defun gnus-set-info (group info) (setcdr (gethash group gnus-newsrc-hashtb) @@ -3704,14 +3687,14 @@ GROUP can also be an INFO structure." (setq params (delq name params)) (while (assq name params) (gnus-alist-pull name params)) - (gnus-info-set-params info params)))))) + (setf (gnus-info-params info) params)))))) (defun gnus-group-add-score (group &optional score) "Add SCORE to the GROUP score. If SCORE is nil, add 1 to the score of GROUP." (let ((info (gnus-get-info group))) (when info - (gnus-info-set-score info (+ (gnus-info-score info) (or score 1)))))) + (setf (gnus-info-score info) (+ (gnus-info-score info) (or score 1)))))) (defun gnus-short-group-name (group &optional levels) "Collapse GROUP name LEVELS. diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index a340804064..94ea259a33 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -793,10 +793,10 @@ all. This may very well take some time.") ;;(message "unread: %s" unread) (sit-for 1) (kill-buffer buf)) - (setq unread (sort unread '<)) + (setq unread (sort unread #'<)) (and unread - (gnus-info-set-read info (gnus-update-read-articles - (gnus-info-group info) unread t))) + (setf (gnus-info-read info) + (gnus-update-read-articles (gnus-info-group info) unread t))) )) (run-hook-with-args 'nndiary-request-update-info-functions (gnus-info-group info)) diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el index bc475ee295..a178f1f119 100644 --- a/lisp/gnus/nndraft.el +++ b/lisp/gnus/nndraft.el @@ -147,10 +147,10 @@ are generated if and only if they are also in `message-draft-headers'." (deffoo nndraft-request-update-info (group info &optional server) (nndraft-possibly-change-group group) - (gnus-info-set-read - info - (gnus-update-read-articles (gnus-group-prefixed-name group '(nndraft "")) - (nndraft-articles) t)) + (setf (gnus-info-read info) + (gnus-update-read-articles + (gnus-group-prefixed-name group '(nndraft "")) + (nndraft-articles) t)) (let ((marks (nth 3 info))) (when marks ;; Nix out all marks except the `unsend'-able article marks. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 800ec3b959..bbbca8f419 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1620,7 +1620,7 @@ If LIMIT, first try to limit the search to the N last articles." read))) (when (or (not (listp permanent-flags)) (memq '%Seen permanent-flags)) - (gnus-info-set-read info read)) + (setf (gnus-info-read info) read)) ;; Update the marks. (setq marks (gnus-info-marks info)) (dolist (type (cdr nnimap-mark-alist)) @@ -1680,14 +1680,13 @@ If LIMIT, first try to limit the search to the N last articles." (defun nnimap-update-qresync-info (info existing vanished flags) ;; Add all the vanished articles to the list of read articles. - (gnus-info-set-read - info - (gnus-add-to-range - (gnus-add-to-range - (gnus-range-add (gnus-info-read info) - vanished) - (cdr (assq '%Flagged flags))) - (cdr (assq '%Seen flags)))) + (setf (gnus-info-read info) + (gnus-add-to-range + (gnus-add-to-range + (gnus-range-add (gnus-info-read info) + vanished) + (cdr (assq '%Flagged flags))) + (cdr (assq '%Seen flags)))) (let ((marks (gnus-info-marks info))) (dolist (type (cdr nnimap-mark-alist)) (let ((ticks (assoc (car type) marks)) diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 3b6b8255f7..bf441ee359 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -874,8 +874,8 @@ A non-nil `specs' arg must be an alist with `nnir-query-spec' and (deffoo nnir-request-update-info (group info &optional server) (nnir-possibly-change-group group server) ;; clear out all existing marks. - (gnus-info-set-marks info nil) - (gnus-info-set-read info nil) + (setf (gnus-info-marks info) nil) + (setf (gnus-info-read info) nil) (let ((group (gnus-group-guess-full-name-from-command-method group)) (articles-by-group (nnir-categorize @@ -889,15 +889,15 @@ A non-nil `specs' arg must be an alist with `nnir-query-spec' and (group-info (gnus-get-info (car group-articles))) (marks (gnus-info-marks group-info)) (read (gnus-info-read group-info))) - (gnus-info-set-read - info - (gnus-add-to-range - (gnus-info-read info) - (delq nil - (mapcar - #'(lambda (art) - (when (gnus-member-of-range (cdr art) read) (car art))) - articleids)))) + (setf (gnus-info-read info) + (gnus-add-to-range + (gnus-info-read info) + (delq nil + (mapcar + #'(lambda (art) + (when (gnus-member-of-range (cdr art) read) + (car art))) + articleids)))) (dolist (mark marks) (cl-destructuring-bind (type . range) mark (gnus-add-marked-articles diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index 0133fc6ce2..b0e79d4f23 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -1000,7 +1000,7 @@ This variable is set by `nnmaildir-request-article'.") pgname (nnmaildir--pgname nnmaildir--cur-server gname) flist (nnmaildir--grp-flist group)) (when (zerop (nnmaildir--grp-count group)) - (gnus-info-set-read info nil) + (setf (gnus-info-read info) nil) (gnus-info-set-marks info nil 'extend) (throw 'return info)) (setq old-marks (cons 'read (gnus-info-read info)) @@ -1083,7 +1083,7 @@ This variable is set by `nnmaildir-request-article'.") (setq ranges (gnus-add-to-range ranges (sort article-list '<))))) (if (eq mark 'read) (setq read ranges) (if ranges (setq marks (cons (cons mark ranges) marks))))) - (gnus-info-set-read info (gnus-range-add read missing)) + (setf (gnus-info-read info) (gnus-range-add read missing)) (gnus-info-set-marks info marks 'extend) (setf (nnmaildir--grp-mmth group) new-mmth) info))) diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index 6e527a5a7a..a4a1caac95 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el @@ -711,29 +711,29 @@ Other back ends might or might not work.") (nnimap-request-update-info-internal folder folderinfo nnmairix-backend-server) (nnmairix-call-backend "request-update-info" folder folderinfo nnmairix-backend-server)) ;; set range of read articles - (gnus-info-set-read - info - (if docorr - (nnmairix-map-range - `(lambda (x) (+ x ,(cadr corr))) - (gnus-info-read folderinfo)) - (gnus-info-read folderinfo))) + (setf (gnus-info-read info) + (if docorr + (nnmairix-map-range + ;; FIXME: Use lexical-binding. + `(lambda (x) (+ x ,(cadr corr))) + (gnus-info-read folderinfo)) + (gnus-info-read folderinfo))) ;; set other marks - (gnus-info-set-marks - info - (if docorr - (mapcar (lambda (cur) - (cons - (car cur) - (nnmairix-map-range - `(lambda (x) (+ x ,(cadr corr))) - (list (cadr cur))))) - (gnus-info-marks folderinfo)) - (gnus-info-marks folderinfo)))) + (setf (gnus-info-marks info) + (if docorr + (mapcar (lambda (cur) + (cons + (car cur) + (nnmairix-map-range + ;; FIXME: Use lexical-binding. + `(lambda (x) (+ x ,(cadr corr))) + (list (cadr cur))))) + (gnus-info-marks folderinfo)) + (gnus-info-marks folderinfo)))) (when (eq readmarks 'unread) - (gnus-info-set-read info nil)) + (setf (gnus-info-read info) nil)) (when (eq readmarks 'read) - (gnus-info-set-read info (gnus-active qualgroup)))) + (setf (gnus-info-read info) (gnus-active qualgroup)))) t) (nnoo-define-skeleton nnmairix) diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 302589bd6d..8d8d5ae83a 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el @@ -1067,7 +1067,7 @@ Use the nov database for the current group if available." (when (gnus-member-of-range old-number read) (setq read (gnus-remove-from-range read (list old-number))) (setq read (gnus-add-to-range read (list new-number)))) - (gnus-info-set-read info read)) + (setf (gnus-info-read info) read)) ;; 2 b/ marked articles: (let ((oldmarks (gnus-info-marks info)) mark newmarks) @@ -1080,7 +1080,7 @@ Use the nov database for the current group if available." (setcdr mark (gnus-add-to-range (cdr mark) (list new-number)))) (push mark newmarks)) - (gnus-info-set-marks info newmarks)) + (setf (gnus-info-marks info) newmarks)) ;; 3/ Update the NOV entry for this article: (unless nnml-nov-is-evil (with-current-buffer (nnml-open-nov group) diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index 25f3413fcd..b4a2376662 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el @@ -463,11 +463,10 @@ If UPDATE-P is not nil, call gnus-group-update-group on the components." (dolist (group nnvirtual-component-groups) (when (and (setq info (gnus-get-info group)) (gnus-info-marks info)) - (gnus-info-set-marks - info - (if (assq 'score (gnus-info-marks info)) - (list (assq 'score (gnus-info-marks info))) - nil)))) + (setf (gnus-info-marks info) + (if (assq 'score (gnus-info-marks info)) + (list (assq 'score (gnus-info-marks info))) + nil)))) ;; Ok, currently type-marks is an assq list with keys of a mark type, ;; with data of an assq list with keys of component group names commit 7fff418edf56244a1fcf54718523aa9b5cb3a854 Author: Stefan Monnier Date: Fri Nov 29 11:51:48 2019 -0500 * lisp/textmodes/mhtml-mode.el: Fix bug#38372 The `sgml-syntax-propertize-rules` rely on the `sgml--syntax-propertize-ppss` setup by `sgml-syntax-propertize` so it is not correct/safe to use them directly like html used to do. Change `sgml-syntax-propertize` so it can be used by mhtml, and then adjust mhtml-mode accordingly. * lisp/textmodes/mhtml-mode.el: Remove redundant `eval-and-compile`. Only require cl-lib at compile-time. (mhtml--syntax-propertize): New const, extracted from mhtml-syntax-propertize. (mhtml-syntax-propertize): Use `sgml-syntax-propertize`. * lisp/textmodes/sgml-mode.el (sgml--syntax-propertize): New const, extracted from sgml-syntax-propertize. (sgml-syntax-propertize): Add optional `rules-function` arg. diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 7de24c783f..9bcf09f25f 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el @@ -21,9 +21,8 @@ ;;; Code: -(eval-and-compile - (require 'cl-lib) - (require 'sgml-mode)) +(eval-when-compile (require 'cl-lib)) +(require 'sgml-mode) (require 'js) (require 'css-mode) (require 'prog-mode) @@ -287,6 +286,22 @@ This is used by `mhtml--pre-command'.") (funcall (mhtml--submode-propertize submode) (point) end) (goto-char end)) +(defvar mhtml--syntax-propertize + (syntax-propertize-rules + ("" + (0 (ignore + (goto-char (match-end 0)) + ;; Don't apply in a comment. + (unless (syntax-ppss-context (syntax-ppss)) + (mhtml--syntax-propertize-submode mhtml--css-submode end))))) + ("" + (0 (ignore + (goto-char (match-end 0)) + ;; Don't apply in a comment. + (unless (syntax-ppss-context (syntax-ppss)) + (mhtml--syntax-propertize-submode mhtml--js-submode end))))) + sgml-syntax-propertize-rules)) + (defun mhtml-syntax-propertize (start end) ;; First remove our special settings from the affected text. They ;; will be re-applied as needed. @@ -298,27 +313,8 @@ This is used by `mhtml--pre-command'.") (unless (bobp) (let ((submode (get-text-property (1- (point)) 'mhtml-submode))) (if submode - (mhtml--syntax-propertize-submode submode end) - ;; No submode, so do what sgml-mode does. - (sgml-syntax-propertize-inside end)))) - (funcall - (syntax-propertize-rules - ("" - (0 (ignore - (goto-char (match-end 0)) - ;; Don't apply in a comment. - (unless (syntax-ppss-context (syntax-ppss)) - (mhtml--syntax-propertize-submode mhtml--css-submode end))))) - ("" - (0 (ignore - (goto-char (match-end 0)) - ;; Don't apply in a comment. - (unless (syntax-ppss-context (syntax-ppss)) - (mhtml--syntax-propertize-submode mhtml--js-submode end))))) - sgml-syntax-propertize-rules) - ;; Make sure to handle the situation where - ;; mhtml--syntax-propertize-submode moved point. - (point) end)) + (mhtml--syntax-propertize-submode submode end)))) + (sgml-syntax-propertize (point) end mhtml--syntax-propertize)) (defun mhtml-indent-line () "Indent the current line as HTML, JS, or CSS, according to its context." diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index f75ce90547..8d39958d74 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -395,16 +395,19 @@ Any terminating `>' or `/' is not matched.") (car (sgml--syntax-propertize-ppss (match-beginning 0))))) (string-to-syntax "."))))) - ))) + ) + "Syntax-propertize rules for sgml text. +These have to be run via `sgml-syntax-propertize'")) -(defun sgml-syntax-propertize (start end) +(defconst sgml--syntax-propertize + (syntax-propertize-rules sgml-syntax-propertize-rules)) + +(defun sgml-syntax-propertize (start end &optional rules-function) "Syntactic keywords for `sgml-mode'." (setq sgml--syntax-propertize-ppss (cons start (syntax-ppss start))) (cl-assert (>= (cadr sgml--syntax-propertize-ppss) 0)) (sgml-syntax-propertize-inside end) - (funcall - (syntax-propertize-rules sgml-syntax-propertize-rules) - start end) + (funcall (or rules-function sgml--syntax-propertize) (point) end) ;; Catch any '>' after the last quote. (sgml--syntax-propertize-ppss end)) commit 6d8e758e85d0662775b27111289aa199e0d0a46f Author: Robert Pluim Date: Mon Nov 18 11:07:51 2019 +0100 Add nsm-should-check IPv6 local subnet tests * test/lisp/net/nsm-tests.el (nsm-check-local-subnet-ipv6): Now that IPv6 addresses are returned from network-interface-list, test nsm-should check and nsm-network-same-subnet for IPv6 as well. diff --git a/test/lisp/net/nsm-tests.el b/test/lisp/net/nsm-tests.el index f354437038..97edcca80d 100644 --- a/test/lisp/net/nsm-tests.el +++ b/test/lisp/net/nsm-tests.el @@ -49,9 +49,6 @@ (should (eq nil (nsm-should-check "127.0.0.1"))) (should (eq nil (nsm-should-check "localhost")))))) -;; FIXME This will never return true, since -;; network-interface-list only gives the primary address of each -;; interface, which will be the IPv4 one (defun nsm-ipv6-is-available () (and (featurep 'make-network-process '(:family ipv6)) (cl-rassoc-if @@ -61,6 +58,17 @@ (ert-deftest nsm-check-local-subnet-ipv6 () (skip-unless (nsm-ipv6-is-available)) + (let ((local-ip '[123 456 789 11 172 26 128 160 0]) + (mask '[255 255 255 255 255 255 255 0 0]) + + (wrong-length-mask '[255 255 255 255 255 255 255]) + (wrong-mask '[255 255 255 255 255 255 255 255 0]) + (remote-ip-yes '[123 456 789 11 172 26 128 161 0]) + (remote-ip-no '[123 456 789 11 172 26 129 161 0])) + (should (eq t (nsm-network-same-subnet local-ip mask remote-ip-yes))) + (should (eq nil (nsm-network-same-subnet local-ip mask remote-ip-no))) + (should-error (nsm-network-same-subnet local-ip wrong-length-mask remote-ip-yes)) + (should (eq nil (nsm-network-same-subnet local-ip wrong-mask remote-ip-yes)))) (should (eq t (nsm-should-check "::1"))) (let ((nsm-trust-local-network t)) (should (eq nil (nsm-should-check "::1"))))) commit 8400766b43ef83768b05e71f13c79ea237e21ca8 Author: Eli Zaretskii Date: Fri Nov 29 16:02:33 2019 +0200 Support showing one revision with Mercurial * lisp/vc/vc-hg.el (vc-hg-print-log): Support 'with-diff' invocation of "C-1 C-x v L". diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 5ff1a6204b..c9407b1b59 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -432,6 +432,8 @@ If LIMIT is non-nil, show no more than this many entries." (nconc (when start-revision (list (format "-r%s:0" start-revision))) (when limit (list "-l" (format "%s" limit))) + (when (eq vc-log-view-type 'with-diff) + (list "-p")) (if shortlog `(,@(if vc-hg-log-graph '("--graph")) "--template" commit 17f9151f4ab22db97bd2a9d46dff8eb0752480c0 Author: Phil Sainty Date: Sat Nov 30 00:57:21 2019 +1300 * lisp/so-long.el (so-long-variable-overrides): Set bidi-inhibit-bpa (Bug#38407) diff --git a/lisp/so-long.el b/lisp/so-long.el index 33b7155d04..49595a3fd9 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -764,7 +764,8 @@ they are in Emacs core, GNU ELPA, or elsewhere." :package-version '(so-long . "1.0")) (defcustom so-long-variable-overrides - '((bidi-paragraph-direction . left-to-right) + '((bidi-inhibit-bpa . t) + (bidi-paragraph-direction . left-to-right) (buffer-read-only . t) (global-hl-line-mode . nil) (line-move-visual . t) @@ -785,7 +786,8 @@ extremely long line, as otherwise the full length of the line may need to be scanned to find the next position." :type '(alist :key-type (variable :tag "Variable") :value-type (sexp :tag "Value")) - :options '((bidi-paragraph-direction (choice (const left-to-right) + :options '((bidi-inhibit-bpa boolean) + (bidi-paragraph-direction (choice (const left-to-right) (const right-to-left) (const nil))) (buffer-read-only boolean) commit baa9ea73953396d93d0455f8ad9ae924d349a6eb Author: Eli Zaretskii Date: Fri Nov 29 12:17:14 2019 +0200 Document 'zap-up-to-char' * doc/emacs/killing.texi (Other Kill Commands): Document 'zap-up-to-char'. * lisp/simple.el (zap-to-char): Mention 'zap-up-to-char' in the doc string. (Bug#38392) diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index ce00cb38a7..f5f715dada 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -219,6 +219,8 @@ Kill to the end of the sentence (@code{kill-sentence}). Kill the following balanced expression (@code{kill-sexp}). @xref{Expressions}. @item M-z @var{char} Kill through the next occurrence of @var{char} (@code{zap-to-char}). +@item M-x zap-up-to-char @var{char} +Kill up to, but not including, the next occurrence of @var{char}. @end table @kindex C-w @@ -248,6 +250,10 @@ search backward and kill text before point. A history of previously used characters is maintained and can be accessed via the @kbd{M-p}/@kbd{M-n} keystrokes. This is mainly useful if the character to be used has to be entered via a complicated input method. +@findex zap-up-to-char +A similar command @code{zap-up-to-char} kills from point up to, but +not including the next occurrence of a character, with numeric +argument acting as a repeat count. @node Kill Options @subsection Options for Killing diff --git a/lisp/simple.el b/lisp/simple.el index 2aac557154..47ce0364d1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5191,7 +5191,8 @@ and KILLP is t if a prefix arg was specified." (defun zap-to-char (arg char) "Kill up to and including ARGth occurrence of CHAR. Case is ignored if `case-fold-search' is non-nil in the current buffer. -Goes backward if ARG is negative; error if CHAR not found." +Goes backward if ARG is negative; error if CHAR not found. +See also `zap-up-to-char'." (interactive (list (prefix-numeric-value current-prefix-arg) (read-char-from-minibuffer "Zap to char: " nil 'read-char-history))) commit 11baa417c56b42441b7cf9e4092acd840440fe47 Author: Eli Zaretskii Date: Fri Nov 29 12:00:59 2019 +0200 Support showing one revision with Subversion * lisp/vc/vc-svn.el (vc-svn-print-log): Support 'with-diff' invocation of "C-1 C-x v L". diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index ed34b357f9..a2081e1ab9 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -579,13 +579,17 @@ If LIMIT is non-nil, show no more than this many entries." ;; subsequent commits. At least that's what the ;; vc-cvs.el code does. "-rHEAD:0")) - (when limit (list "--limit" (format "%s" limit)))))) + (if (eq vc-log-view-type 'with-diff) + (list "--diff")) + (when limit (list "--limit" (format "%s" limit)))))) ;; Dump log for the entire directory. (apply 'vc-svn-command buffer 0 nil "log" (append (list (if start-revision (format "-r%s" start-revision) "-rHEAD:0")) - (when limit (list "--limit" (format "%s" limit))))))))) + (if (eq vc-log-view-type 'with-diff) + (list "--diff")) + (when limit (list "--limit" (format "%s" limit))))))))) (defun vc-svn-diff (files &optional oldvers newvers buffer async) "Get a difference report using SVN between two revisions of fileset FILES."