emacs-devel
[Top][All Lists]
Advanced

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

Re: Inhibit "Wrote foo" from write-region


From: Sebastian Wiesner
Subject: Re: Inhibit "Wrote foo" from write-region
Date: Wed, 22 Jan 2014 18:08:48 +0100
User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.1

address@hidden writes:

> In the case at hand, I think that package.el should never need to say
> "write file <foo>".  What do you think of the patch below?

There is a typo ("ni" -> "nil"), and I don't exactly understand what the
other changes unrelated to write-region are for.  Other than that, looks
good.

Just out of curiosity:  What is the rationale behind these messages?
Why does write-region even print these messages?

>
>
>         Stefan
>
>
> === modified file 'lisp/emacs-lisp/package.el'
> --- lisp/emacs-lisp/package.el        2014-01-22 01:50:40 +0000
> +++ lisp/emacs-lisp/package.el        2014-01-22 15:08:04 +0000
> @@ -641,7 +641,7 @@
>            ";; End:\n"
>            ";;; " (file-name-nondirectory file)
>            " ends here\n")
> -     nil file))
> +     nil file nil 'silent))
>    file)
>  
>  (defvar generated-autoload-file)
> @@ -710,7 +710,7 @@
>             (package-desc-extras pkg-desc))))
>          "\n")
>         nil
> -       pkg-file))))
> +       pkg-file nil 'silent))))
>  
>  (defun package--alist-to-plist (alist)
>    (apply #'nconc (mapcar (lambda (pair) (list (car pair) (cdr pair))) 
> alist)))
> @@ -759,7 +759,7 @@
>  
>  (defun package--write-file-no-coding (file-name)
>    (let ((buffer-file-coding-system 'no-conversion))
> -    (write-region (point-min) (point-max) file-name)))
> +    (write-region (point-min) (point-max) file-name nil 'silent)))
>  
>  (defmacro package--with-work-buffer (location file &rest body)
>    "Run BODY in a buffer containing the contents of FILE at LOCATION.
> @@ -874,7 +874,8 @@
>                   (expand-file-name
>                    (concat (package-desc-full-name pkg-desc)
>                            ".signed")
> -                  package-user-dir))
> +                  package-user-dir)
> +                    ni 'silent)
>        ;; Update the old pkg-desc which will be shown on the description 
> buffer.
>        (setf (package-desc-signed pkg-desc) t)
>        ;; Update the new (activated) pkg-desc as well.
> @@ -1280,7 +1281,8 @@
>        ;; Write out good signatures into archive-contents.signed file.
>        (write-region (mapconcat #'epg-signature-to-string good-signatures 
> "\n")
>                   nil
> -                 (expand-file-name (concat file ".signed") dir)))))
> +                 (expand-file-name (concat file ".signed") dir)
> +                    nil 'silent))))
>  
>  (declare-function epg-check-configuration "epg-config"
>                 (config &optional minimum-version))
> @@ -1636,10 +1638,12 @@
>  Letters do not insert themselves; instead, they are commands.
>  \\<package-menu-mode-map>
>  \\{package-menu-mode-map}"
> -  (setq tabulated-list-format [("Package" 18 package-menu--name-predicate)
> +  (setq tabulated-list-format
> +        `[("Package" 18 package-menu--name-predicate)
>                              ("Version" 12 nil)
>                              ("Status"  10 package-menu--status-predicate)
> -                            ("Archive" 10 package-menu--archive-predicate)
> +          ,@(if (cdr package-archives)
> +                '(("Archive" 10 package-menu--archive-predicate)))
>                              ("Description" 0 nil)])
>    (setq tabulated-list-padding 2)
>    (setq tabulated-list-sort-key (cons "Status" nil))
> @@ -1825,19 +1829,20 @@
>               (`"unsigned"  'font-lock-warning-face)
>               (_            'font-lock-warning-face)))) ; obsolete.
>      (list pkg-desc
> -       (vector (list (symbol-name (package-desc-name pkg-desc))
> +       `[,(list (symbol-name (package-desc-name pkg-desc))
>                       'face 'link
>                       'follow-link t
>                       'package-desc pkg-desc
>                       'action 'package-menu-describe-package)
> -               (propertize (package-version-join
> +            ,(propertize (package-version-join
>                                 (package-desc-version pkg-desc))
>                             'font-lock-face face)
> -               (propertize status 'font-lock-face face)
> -               (propertize (or (package-desc-archive pkg-desc) "")
> -                              'font-lock-face face)
> -               (propertize (package-desc-summary pkg-desc)
> -                              'font-lock-face face)))))
> +            ,(propertize status 'font-lock-face face)
> +            ,@(if (cdr package-archives)
> +               (list (propertize (or (package-desc-archive pkg-desc) "")
> +                                    'font-lock-face face)))
> +            ,(propertize (package-desc-summary pkg-desc)
> +                         'font-lock-face face)])))
>  
>  (defun package-menu-refresh ()
>    "Download the Emacs Lisp package archive.




reply via email to

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