bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42397: [PATCH 06/14] * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-me


From: Basil L. Contovounesios
Subject: bug#42397: [PATCH 06/14] * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Fix indentation.
Date: Fri, 17 Jul 2020 11:49:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jonas Bernoulli <jonas@bernoul.li> writes:

> ---
>  lisp/emacs-lisp/eldoc.el | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
> index 510dff9ed0..90dce4a317 100644
> --- a/lisp/emacs-lisp/eldoc.el
> +++ b/lisp/emacs-lisp/eldoc.el
> @@ -285,13 +285,13 @@ eldoc-minibuffer-message
>            (or (window-in-direction 'above (minibuffer-window))
>                (minibuffer-selected-window)
>                (get-largest-window)))
> -    (when mode-line-format
> -       (unless (and (listp mode-line-format)
> -                    (assq 'eldoc-mode-line-string mode-line-format))
> -         (setq mode-line-format
> -               (list "" '(eldoc-mode-line-string
> -                          (" " eldoc-mode-line-string " "))
> -                     mode-line-format))))
> +       (when mode-line-format
> +         (unless (and (listp mode-line-format)
> +                      (assq 'eldoc-mode-line-string mode-line-format))
> +           (setq mode-line-format
> +                 (list "" '(eldoc-mode-line-string
> +                            (" " eldoc-mode-line-string " "))
> +                       mode-line-format))))

You can avoid reindenting this whole block by merging the conditions of
the redundantly nested when and unless:

  (unless (if (consp mode-line-format)
              (assq 'eldoc-mode-line-string mode-line-format)
            (not mode-line-format))
    (setq mode-line-format
          (list "" '(eldoc-mode-line-string
                     (" " eldoc-mode-line-string " "))
                mode-line-format)))

or similar.

>            (setq eldoc-mode-line-string
>                  (when (stringp format-string)
>                    (apply #'format-message format-string args)))

Thanks,

-- 
Basil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]