From 94914ca4690c0cff12d600a0c8ba6bfb3fb38dc5 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Tue, 25 Jun 2019 21:44:32 +0200 Subject: [PATCH] magit-log-format-author-margin: New function Split it from `magit-log-format-margin'. --- lisp/magit-log.el | 48 +++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/lisp/magit-log.el b/lisp/magit-log.el index c8e6ef63..c0a79b19 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -1374,28 +1374,32 @@ The shortstat style is experimental and rather slow." (when-let ((option (magit-margin-option))) (if magit-log-margin-show-shortstat (magit-log-format-shortstat-margin rev) - (pcase-let ((`(,_ ,style ,width ,details ,details-width) - (or magit-buffer-margin - (symbol-value option)))) - (magit-make-margin-overlay - (concat (and details - (concat (propertize (truncate-string-to-width - (or author "") - details-width - nil ?\s (make-string 1 magit-ellipsis)) - 'face 'magit-log-author) - " ")) - (propertize - (if (stringp style) - (format-time-string - style - (seconds-to-time (string-to-number date))) - (pcase-let* ((abbr (eq style 'age-abbreviated)) - (`(,cnt ,unit) (magit--age date abbr))) - (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is") - (- width (if details (1+ details-width) 0))) - cnt unit))) - 'face 'magit-log-date))))))) + (magit-log-format-author-margin author date)))) + +(defun magit-log-format-author-margin (author date &optional previous-line) + (pcase-let ((`(,_ ,style ,width ,details ,details-width) + (or magit-buffer-margin + (symbol-value option)))) + (magit-make-margin-overlay + (concat (and details + (concat (propertize (truncate-string-to-width + (or author "") + details-width + nil ?\s (make-string 1 magit-ellipsis)) + 'face 'magit-log-author) + " ")) + (propertize + (if (stringp style) + (format-time-string + style + (seconds-to-time (string-to-number date))) + (pcase-let* ((abbr (eq style 'age-abbreviated)) + (`(,cnt ,unit) (magit--age date abbr))) + (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is") + (- width (if details (1+ details-width) 0))) + cnt unit))) + 'face 'magit-log-date)) + previous-line))) (defun magit-log-format-shortstat-margin (rev) (magit-make-margin-overlay -- 2.23.0 12:03:23 +0100'>2021-03-17daemon: Correctly handle '--discover' with no value....Previously, we'd get: $ guix-daemon --discover error: basic_string::_M_construct null not valid * nix/nix-daemon/guix-daemon.cc (parse_opt): Change second argument to 'settings.set' to properly handle case where ARG is NULL. Ludovic Courtès 2020-11-29Use substitute servers on the local network....* guix/scripts/discover.scm: New file. * Makefile.am (MODULES): Add it. * nix/nix-daemon/guix-daemon.cc (options): Add "discover" option, (parse-opt): parse it, (main): start "guix discover" process when the option is set. * guix/scripts/substitute.scm (%local-substitute-urls): New variable, (substitute-urls): add it. * gnu/services/base.scm (<guix-configuration>): Add "discover?" field, (guix-shepherd-service): honor it. * doc/guix.texi (Invoking guix-daemon): Document "discover" option, (Base Services): ditto. Mathieu Othacehe