all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Inhibit "Wrote foo" from write-region
@ 2014-01-21 12:32 Sebastian Wiesner
  2014-01-21 12:38 ` Sebastian Wiesner
  2014-01-21 16:42 ` Tom Tromey
  0 siblings, 2 replies; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-21 12:32 UTC (permalink / raw)
  To: Emacs-Devel devel

Hello,

I'm writing a tool for non-interactive package installation.  Think of
it as apt-get for ELPA packages, e.g. you can point it do a directory
and then install packages from the command line.

It generally works fine, but the *huge* amount of output produced by
package.el is a major nuisance currently.  Even installing trivial
packages results in a lot of "Compiling …", "Extracting…",
etc. messages, which provide no real value to the user.

Following the old Unix philosophy of "no news is good news", I'm trying
to reduce the output, by catching it in a separate buffer, and only
printing it an error was signalled.

By let-binding "standard-output", and monkey-patching Emacs, I managed
to get rid of most messages, but one kind of messages so far has
resisted any attempt to get rid of it: The "Wrote foo" messages of
"write-region".

By default, write-region these messages for every file it's called with.
For individual calls to write-region, this behaviour can be inhibited by
passing a symbol as VISIT argument, e.g. (write-region "Hello world" nil
"foo" 'no-message), however package.el, url.el and other involved
packages do not make general use of this.  For instance,
"package--write-file-no-coding" is defined as follows:

(defun package--write-file-no-coding (file-name)
  (let ((buffer-file-coding-system 'no-conversion))
    (write-region (point-min) (point-max) file-name)))

As you can see, it doesn't pass something for VISIT, and thus
"write-region" emits a "Wrote foo" for *every* file contained in a
package.  Try that with a package with many files, such as Org or Helm.
It spills the terminal with literally dozens of these pointless
messages:

Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/archives/gnu/archive-contents
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/archives/melpa/archive-contents
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-net.el
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-ring.el
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-command.el
…

Unfortunately, "write-region" does not seem to provide a way to
generally inhibit this message.  I looked at the C source: It calls
"message_with_string", which in turn directly "fprintf"s to stderr in a
non-interactive session.

Do I miss something?  If not, how could I silence "write-region"?



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 12:32 Inhibit "Wrote foo" from write-region Sebastian Wiesner
@ 2014-01-21 12:38 ` Sebastian Wiesner
  2014-01-21 15:57   ` Eli Zaretskii
  2014-01-21 16:42 ` Tom Tromey
  1 sibling, 1 reply; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-21 12:38 UTC (permalink / raw)
  To: Emacs-Devel devel


lunaryorn@gmail.com writes:

> Hello,
>
> I'm writing a tool for non-interactive package installation.  Think of
> it as apt-get for ELPA packages, e.g. you can point it do a directory
> and then install packages from the command line.
>
> It generally works fine, but the *huge* amount of output produced by
> package.el is a major nuisance currently.  Even installing trivial
> packages results in a lot of "Compiling …", "Extracting…",
> etc. messages, which provide no real value to the user.
>
> Following the old Unix philosophy of "no news is good news", I'm trying
> to reduce the output, by catching it in a separate buffer, and only
> printing it an error was signalled.
>
> By let-binding "standard-output", and monkey-patching Emacs, I managed

Monkey-patching "message"… sorry

> to get rid of most messages, but one kind of messages so far has
> resisted any attempt to get rid of it: The "Wrote foo" messages of
> "write-region".
>
> By default, write-region these messages for every file it's called with.
> For individual calls to write-region, this behaviour can be inhibited by
> passing a symbol as VISIT argument, e.g. (write-region "Hello world" nil
> "foo" 'no-message), however package.el, url.el and other involved
> packages do not make general use of this.  For instance,
> "package--write-file-no-coding" is defined as follows:
>
> (defun package--write-file-no-coding (file-name)
>   (let ((buffer-file-coding-system 'no-conversion))
>     (write-region (point-min) (point-max) file-name)))
>
> As you can see, it doesn't pass something for VISIT, and thus
> "write-region" emits a "Wrote foo" for *every* file contained in a
> package.  Try that with a package with many files, such as Org or Helm.
> It spills the terminal with literally dozens of these pointless
> messages:
>
> Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/archives/gnu/archive-contents
> Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/archives/melpa/archive-contents
> Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-net.el
> Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-ring.el
> Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-command.el
> …
>
> Unfortunately, "write-region" does not seem to provide a way to
> generally inhibit this message.  I looked at the C source: It calls
> "message_with_string", which in turn directly "fprintf"s to stderr in a
> non-interactive session.
>
> Do I miss something?  If not, how could I silence "write-region"?




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 12:38 ` Sebastian Wiesner
@ 2014-01-21 15:57   ` Eli Zaretskii
  2014-01-21 16:31     ` Sebastian Wiesner
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-21 15:57 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: emacs-devel

> From: Sebastian Wiesner <lunaryorn@gmail.com>
> Date: Tue, 21 Jan 2014 13:32:02 +0100
> 
> I'm writing a tool for non-interactive package installation.  Think of
> it as apt-get for ELPA packages, e.g. you can point it do a directory
> and then install packages from the command line.
> 
> It generally works fine, but the *huge* amount of output produced by
> package.el is a major nuisance currently.  Even installing trivial
> packages results in a lot of "Compiling …", "Extracting…",
> etc. messages, which provide no real value to the user.
> 
> Following the old Unix philosophy of "no news is good news"

That might not be a good philosophy in interactive programs when some
actions might take a long time.

> Unfortunately, "write-region" does not seem to provide a way to
> generally inhibit this message.  I looked at the C source: It calls
> "message_with_string", which in turn directly "fprintf"s to stderr in a
> non-interactive session.
> 
> Do I miss something?  If not, how could I silence "write-region"?

Already discussed in not-so-far past, see

  http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00784.html




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 15:57   ` Eli Zaretskii
@ 2014-01-21 16:31     ` Sebastian Wiesner
  2014-01-21 16:47       ` Eli Zaretskii
       [not found]       ` <<834n4xgu3z.fsf@gnu.org>
  0 siblings, 2 replies; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-21 16:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


eliz@gnu.org writes:

>> From: Sebastian Wiesner <lunaryorn@gmail.com>
>> Date: Tue, 21 Jan 2014 13:32:02 +0100
>> 
>> I'm writing a tool for non-interactive package installation.  Think of
>> it as apt-get for ELPA packages, e.g. you can point it do a directory
>> and then install packages from the command line.
>> 
>> It generally works fine, but the *huge* amount of output produced by
>> package.el is a major nuisance currently.  Even installing trivial
>> packages results in a lot of "Compiling …", "Extracting…",
>> etc. messages, which provide no real value to the user.
>> 
>> Following the old Unix philosophy of "no news is good news"
>
> That might not be a good philosophy in interactive programs when some
> actions might take a long time.

I appreciate your feedback, but in fact this plan follows complaints by
my users about the amount of output.

And in either case, what package.el currently writes to the terminal, is
simply too much.  *No* other package manager prints a message for *very
single file*.  Imagine, apt-get would do that…

If no output at all turns out to be irritating, I'd still prefer to be
able to control package.el, and probably just print a single message per
installing package.

>> Unfortunately, "write-region" does not seem to provide a way to
>> generally inhibit this message.  I looked at the C source: It calls
>> "message_with_string", which in turn directly "fprintf"s to stderr in a
>> non-interactive session.
>> 
>> Do I miss something?  If not, how could I silence "write-region"?
>
> Already discussed in not-so-far past, see
>
>   http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00784.html

Well, I read that discussion, but it does neither offer a solution, nor
tells about any plan to change write-region to allow to inhibit the
message.




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 12:32 Inhibit "Wrote foo" from write-region Sebastian Wiesner
  2014-01-21 12:38 ` Sebastian Wiesner
@ 2014-01-21 16:42 ` Tom Tromey
  2014-01-22 12:37   ` Sebastian Wiesner
  1 sibling, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2014-01-21 16:42 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Emacs-Devel devel

>>>>> "Sebastian" == Sebastian Wiesner <lunaryorn@gmail.com> writes:

Sebastian> For individual calls to write-region, this behaviour can be
Sebastian> inhibited by passing a symbol as VISIT argument,
Sebastian> e.g. (write-region "Hello world" nil "foo" 'no-message),
Sebastian> however package.el, url.el and other involved packages do not
Sebastian> make general use of this.  For instance,
Sebastian> "package--write-file-no-coding" is defined as follows:

Sebastian> (defun package--write-file-no-coding (file-name)
Sebastian>   (let ((buffer-file-coding-system 'no-conversion))
Sebastian>     (write-region (point-min) (point-max) file-name)))

I agree it would be nice to fix this.

Meanwhile as a workaround I think your program could advise write-region
to add the needed argument.

Tom



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 16:31     ` Sebastian Wiesner
@ 2014-01-21 16:47       ` Eli Zaretskii
  2014-01-22 12:35         ` Sebastian Wiesner
       [not found]       ` <<834n4xgu3z.fsf@gnu.org>
  1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-21 16:47 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: emacs-devel

> From: Sebastian Wiesner <lunaryorn@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Tue, 21 Jan 2014 17:31:12 +0100
> 
> >   http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00784.html
> 
> Well, I read that discussion, but it does neither offer a solution, nor
> tells about any plan to change write-region to allow to inhibit the
> message.

I think the conclusion was that we can add a variable that Lisp
programs could bind, which will force write-region use 'message'.
Then you could override that in Lisp.

Patches to do that are welcome.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: Inhibit "Wrote foo" from write-region
       [not found]       ` <<834n4xgu3z.fsf@gnu.org>
@ 2014-01-21 17:59         ` Drew Adams
  2014-01-21 18:26           ` Eli Zaretskii
  2014-01-22  8:05           ` Juri Linkov
  0 siblings, 2 replies; 31+ messages in thread
From: Drew Adams @ 2014-01-21 17:59 UTC (permalink / raw)
  To: Eli Zaretskii, Sebastian Wiesner; +Cc: emacs-devel

> I think the conclusion was that we can add a variable that Lisp
> programs could bind, which will force write-region use 'message'.
> Then you could override that in Lisp.

That seems pretty crude.  Sounds like all or nothing.  Giving the
user the black & white choice, "Do you want eight zillion useless
messages or no messages at all?" sounds like a cop-out.

Why not do what we do for Dired, when you operate on marked files?
You get *one* message telling you there were errors (if any), and
if you then hit `?' a buffer pops up with all of the details. [1]

IOW, (1) inform the user if there were problems and then (2) let
the user get all the nitty gritty about those individual problems
on demand.  Those details are logged separately, not in *Messages*.

Logging such information to an Emacs buffer seems like the Emacs
way, no?


[1] Yes, I know that for some Dired operations the individual
operation also logs its own little messages to *Messages*.  But
for other Dired operations it does not.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 17:59         ` Drew Adams
@ 2014-01-21 18:26           ` Eli Zaretskii
  2014-01-22  8:05           ` Juri Linkov
  1 sibling, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-21 18:26 UTC (permalink / raw)
  To: Drew Adams; +Cc: lunaryorn, emacs-devel

> Date: Tue, 21 Jan 2014 09:59:16 -0800 (PST)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: emacs-devel@gnu.org
> 
> > I think the conclusion was that we can add a variable that Lisp
> > programs could bind, which will force write-region use 'message'.
> > Then you could override that in Lisp.
> 
> That seems pretty crude.  Sounds like all or nothing.  Giving the
> user the black & white choice, "Do you want eight zillion useless
> messages or no messages at all?" sounds like a cop-out.

I don't know what you are talking about.  Lisp applications can bind
the variable when they need that and not bind when they don't.  How
this is "all or nothing", I don't know.

Besides, the issue is to allow customization of write-region's
messages, for which everyone wants that to be done in Lisp.  What they
do when it is in Lisp is their business.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 17:59         ` Drew Adams
  2014-01-21 18:26           ` Eli Zaretskii
@ 2014-01-22  8:05           ` Juri Linkov
  1 sibling, 0 replies; 31+ messages in thread
From: Juri Linkov @ 2014-01-22  8:05 UTC (permalink / raw)
  To: Drew Adams; +Cc: Sebastian Wiesner, Eli Zaretskii, emacs-devel

>> I think the conclusion was that we can add a variable that Lisp
>> programs could bind, which will force write-region use 'message'.
>> Then you could override that in Lisp.
>
> That seems pretty crude.  Sounds like all or nothing.  Giving the
> user the black & white choice, "Do you want eight zillion useless
> messages or no messages at all?" sounds like a cop-out.
>
> Why not do what we do for Dired, when you operate on marked files?

A better example is `display-warning' that supports different
log levels :debug, :warning, :error, or :emergency.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 16:47       ` Eli Zaretskii
@ 2014-01-22 12:35         ` Sebastian Wiesner
  2014-01-22 15:11           ` Stefan Monnier
  0 siblings, 1 reply; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-22 12:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


eliz@gnu.org writes:

>> From: Sebastian Wiesner <lunaryorn@gmail.com>
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 21 Jan 2014 17:31:12 +0100
>> 
>> >   http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00784.html
>> 
>> Well, I read that discussion, but it does neither offer a solution, nor
>> tells about any plan to change write-region to allow to inhibit the
>> message.
>
> I think the conclusion was that we can add a variable that Lisp
> programs could bind, which will force write-region use 'message'.
> Then you could override that in Lisp.

That would be very nice.

> Patches to do that are welcome.

I seem to have exhausted my "free without copyright assignment" limit
with my first patch, so I won't be able to contribute more.

Also, I am afraid, by knowledge of C and Emacs' internals isn't
sufficient to change write-region accordingly.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-21 16:42 ` Tom Tromey
@ 2014-01-22 12:37   ` Sebastian Wiesner
  2014-01-22 15:09     ` Stefan Monnier
  0 siblings, 1 reply; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-22 12:37 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Emacs-Devel devel


tromey@redhat.com writes:

>>>>>> "Sebastian" == Sebastian Wiesner <lunaryorn@gmail.com> writes:
>
> Sebastian> For individual calls to write-region, this behaviour can be
> Sebastian> inhibited by passing a symbol as VISIT argument,
> Sebastian> e.g. (write-region "Hello world" nil "foo" 'no-message),
> Sebastian> however package.el, url.el and other involved packages do not
> Sebastian> make general use of this.  For instance,
> Sebastian> "package--write-file-no-coding" is defined as follows:
>
> Sebastian> (defun package--write-file-no-coding (file-name)
> Sebastian>   (let ((buffer-file-coding-system 'no-conversion))
> Sebastian>     (write-region (point-min) (point-max) file-name)))
>
> I agree it would be nice to fix this.
>
> Meanwhile as a workaround I think your program could advise write-region
> to add the needed argument.

I do that now, but this does obviously not catch messages, which specify
a string for VISIT.  In this case, "write-region" still produces these
messages.

Also, overriding a core function like write-region just to silence some
messages feels a little brittle.

Thank you for your advice, though




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-22 12:37   ` Sebastian Wiesner
@ 2014-01-22 15:09     ` Stefan Monnier
  2014-01-22 17:08       ` Sebastian Wiesner
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Monnier @ 2014-01-22 15:09 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Tom Tromey, Emacs-Devel devel

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?


        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.




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-22 12:35         ` Sebastian Wiesner
@ 2014-01-22 15:11           ` Stefan Monnier
  2014-01-22 17:00             ` Sebastian Wiesner
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Monnier @ 2014-01-22 15:11 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Eli Zaretskii, emacs-devel

> I seem to have exhausted my "free without copyright assignment" limit

That's easy to fix, right?


        Stefan



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-22 15:11           ` Stefan Monnier
@ 2014-01-22 17:00             ` Sebastian Wiesner
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-22 17:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel


monnier@iro.umontreal.ca writes:

>> I seem to have exhausted my "free without copyright assignment" limit
>
> That's easy to fix, right?

No



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-22 15:09     ` Stefan Monnier
@ 2014-01-22 17:08       ` Sebastian Wiesner
  2014-01-22 19:20         ` Stefan Monnier
  0 siblings, 1 reply; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-22 17:08 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Tromey, Emacs-Devel devel


monnier@iro.umontreal.ca 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.




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-22 17:08       ` Sebastian Wiesner
@ 2014-01-22 19:20         ` Stefan Monnier
  2014-01-23  9:35           ` Sebastian Wiesner
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Monnier @ 2014-01-22 19:20 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Tom Tromey, Emacs-Devel devel

> 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.

Thanks, installed.

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

There's the obvious case where write-region is called interactively.
I guess the behavior is inherited from this case.


        Stefan



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-22 19:20         ` Stefan Monnier
@ 2014-01-23  9:35           ` Sebastian Wiesner
  2014-01-23 13:50             ` Stefan Monnier
  0 siblings, 1 reply; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-23  9:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Tromey, Emacs-Devel devel


monnier@iro.umontreal.ca writes:

>> 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.
>
> Thanks, installed.
>
>> Just out of curiosity:  What is the rationale behind these messages?
>> Why does write-region even print these messages?
>
> There's the obvious case where write-region is called interactively.
> I guess the behavior is inherited from this case.

I presume, there is little chance to change this behaviour for
noninteractive use?  I understand, that these messages are important to
many users in an *interactive* session, and that changing or removing
them would be backwards-incompatible, but do these messages really
matter in a *noninteractive* session?  Is there really a need to inform
about every single file being written to in Emacs Lisp scripts?

I mean, there is no other programming language that behaves this way by
default.

>
>
>         Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23  9:35           ` Sebastian Wiesner
@ 2014-01-23 13:50             ` Stefan Monnier
  2014-01-23 14:24               ` Sebastian Wiesner
  2014-01-23 16:25               ` Eli Zaretskii
  0 siblings, 2 replies; 31+ messages in thread
From: Stefan Monnier @ 2014-01-23 13:50 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Tom Tromey, Emacs-Devel devel

> I presume, there is little chance to change this behaviour for
> noninteractive use?

Definitely not for 24.4.

Afterwards, someone could try and look at the issue in more detail, but
it's risky, since it's a fairly low-level primitive called from many
different packages.  We'd have to go and check how all these calls would
be affected.

> I understand, that these messages are important to many users in an
> *interactive* session, and that changing or removing them would be
> backwards-incompatible, but do these messages really matter in
> a *noninteractive* session?

I find it's usually a bad idea to try and do things differently based on
whether the session is interactive or not.  It's much more frequent that
the deciding factor should be "called interactively or not".


        Stefan



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 13:50             ` Stefan Monnier
@ 2014-01-23 14:24               ` Sebastian Wiesner
  2014-01-23 15:18                 ` Stefan Monnier
  2014-01-23 16:29                 ` Eli Zaretskii
  2014-01-23 16:25               ` Eli Zaretskii
  1 sibling, 2 replies; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-23 14:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Tromey, Emacs-Devel devel


monnier@iro.umontreal.ca writes:

>> I presume, there is little chance to change this behaviour for
>> noninteractive use?
>
> Definitely not for 24.4.
>
> Afterwards, someone could try and look at the issue in more detail,
> but it's risky, since it's a fairly low-level primitive called from
> many different packages.  We'd have to go and check how all these
> calls would be affected.

I cannot see how *not* calling "message_with_string" in "write_region"
could affect anything negatively.  Especially in a non-interactive
session, where "message_with_string" effectively comes down to
"fprintf".

But obviously my understanding of Emacs' internals and design principles
is limited.

>> I understand, that these messages are important to many users in an
>> *interactive* session, and that changing or removing them would be
>> backwards-incompatible, but do these messages really matter in
>> a *noninteractive* session?
>
> I find it's usually a bad idea to try and do things differently based
> on whether the session is interactive or not.  It's much more frequent
> that the deciding factor should be "called interactively or not".

I generally agree, but in this specific case there is a clear difference
between interactive and non-interactive sessions, simply because the
underlying "message_with_string" makes this distinction.

In an interactive session, even excessive messages are not intrusive,
simply because they only appear for a very short time in the mini buffer
and are then logged away in *Messages*, which is usually not visible,
unless the user has explicitly selected this buffer.  As such, the user
can effectively control which messages they want to see and which not.

In a non-interactive session however, the user has no such control.
*All* messages are written to the terminal, and there is no way to
remove or hide them other than clearing the entire screen.  Hence,
excessive messages immediately result in excessive terminal output,
which renders the entire output of a non-interactive session more or
less useless.

And precisely because "write_region" is such an essential primitive and
called from many different places, its messages will lead to excessive
terminal output in non-interactive sessions.

And as things stand, this behaviour just makes it very hard and
inconvenient to write meaningful non-interactive Emacs Lisp programs.

>
>
>         Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 14:24               ` Sebastian Wiesner
@ 2014-01-23 15:18                 ` Stefan Monnier
  2014-01-23 16:15                   ` Sebastian Wiesner
  2014-01-23 16:29                 ` Eli Zaretskii
  1 sibling, 1 reply; 31+ messages in thread
From: Stefan Monnier @ 2014-01-23 15:18 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: Tom Tromey, Emacs-Devel devel

> And as things stand, this behaviour just makes it very hard and
> inconvenient to write meaningful non-interactive Emacs Lisp programs.

Indeed support for batch programs written in Elisp has historically been
very poor.  After all the --script argument was introduced relatively
recently, and before that you pretty much couldn't write a real "batch
Elisp program".

But do note that if write-region is changed to only output the message
when called interactively, it will also solve your problem.  So it might
very well be that checking `noninteractive', while solving your
immediate problem, is not The Right answer.


        Stefan



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 15:18                 ` Stefan Monnier
@ 2014-01-23 16:15                   ` Sebastian Wiesner
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-23 16:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Tromey, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

Am 23.01.2014 16:18 schrieb "Stefan Monnier" <monnier@iro.umontreal.ca>:
>
> > And as things stand, this behaviour just makes it very hard and
> > inconvenient to write meaningful non-interactive Emacs Lisp programs.
>
> Indeed support for batch programs written in Elisp has historically been
> very poor.  After all the --script argument was introduced relatively
> recently, and before that you pretty much couldn't write a real "batch
> Elisp program".
>
> But do note that if write-region is changed to only output the message
> when called interactively, it will also solve your problem.  So it might
> very well be that checking `noninteractive', while solving your
> immediate problem, is not The Right answer.

Well, I'm just stating the problem, and suggest one solution. Finding The
Right one seems to be your job really :-)

>
>
>         Stefan

[-- Attachment #2: Type: text/html, Size: 1136 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 13:50             ` Stefan Monnier
  2014-01-23 14:24               ` Sebastian Wiesner
@ 2014-01-23 16:25               ` Eli Zaretskii
  2014-01-23 17:37                 ` Sebastian Wiesner
  1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-23 16:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: lunaryorn, tromey, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Thu, 23 Jan 2014 08:50:20 -0500
> Cc: Tom Tromey <tromey@redhat.com>, Emacs-Devel devel <emacs-devel@gnu.org>
> 
> > I presume, there is little chance to change this behaviour for
> > noninteractive use?
> 
> Definitely not for 24.4.
> 
> Afterwards, someone could try and look at the issue in more detail, but
> it's risky, since it's a fairly low-level primitive called from many
> different packages.  We'd have to go and check how all these calls would
> be affected.

I, for one, am accustomed to see these messages while Emacs is being
built: in a highly parallel build that is sometimes the only practical
way of knowing whether some part of the build succeeded or not.

So, if 'write-region' stops outputting these messages in
non-interactive uses, there should be a way to get the current
behavior back.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 14:24               ` Sebastian Wiesner
  2014-01-23 15:18                 ` Stefan Monnier
@ 2014-01-23 16:29                 ` Eli Zaretskii
  2014-01-23 17:31                   ` Sebastian Wiesner
  1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-23 16:29 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: tromey, monnier, emacs-devel

> From: Sebastian Wiesner <lunaryorn@gmail.com>
> Date: Thu, 23 Jan 2014 15:24:14 +0100
> Cc: Tom Tromey <tromey@redhat.com>, Emacs-Devel devel <emacs-devel@gnu.org>
> 
> 
> I cannot see how *not* calling "message_with_string" in "write_region"
> could affect anything negatively.  Especially in a non-interactive
> session, where "message_with_string" effectively comes down to
> "fprintf".

Imagine some situation where this output is caught and parsed, for
example.

In general, given behavior that is old enough, you can be sure that
someone, somewhere relies on it.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 16:29                 ` Eli Zaretskii
@ 2014-01-23 17:31                   ` Sebastian Wiesner
  2014-01-23 18:04                     ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-23 17:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tromey, monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

Am 23.01.2014 17:29 schrieb "Eli Zaretskii" <eliz@gnu.org>:
>
> > From: Sebastian Wiesner <lunaryorn@gmail.com>
> > Date: Thu, 23 Jan 2014 15:24:14 +0100
> > Cc: Tom Tromey <tromey@redhat.com>, Emacs-Devel devel <
emacs-devel@gnu.org>
> >
> >
> > I cannot see how *not* calling "message_with_string" in "write_region"
> > could affect anything negatively.  Especially in a non-interactive
> > session, where "message_with_string" effectively comes down to
> > "fprintf".
>
> Imagine some situation where this output is caught and parsed, for
> example.
>
> In general, given behavior that is old enough, you can be sure that
> someone, somewhere relies on it.

I don't think it is my task to care for anyone, anywhere.

If there is a concrete use case for these messages, fine, then we can try
to find a good solution for either party involved, but we can't reasonably
discuss about "virtual" use cases.

[-- Attachment #2: Type: text/html, Size: 1361 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 16:25               ` Eli Zaretskii
@ 2014-01-23 17:37                 ` Sebastian Wiesner
  2014-01-23 18:07                   ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-23 17:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tromey, Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

Am 23.01.2014 17:24 schrieb "Eli Zaretskii" <eliz@gnu.org>:
>
> > From: Stefan Monnier <monnier@iro.umontreal.ca>
> > Date: Thu, 23 Jan 2014 08:50:20 -0500
> > Cc: Tom Tromey <tromey@redhat.com>, Emacs-Devel devel <
emacs-devel@gnu.org>
> >
> > > I presume, there is little chance to change this behaviour for
> > > noninteractive use?
> >
> > Definitely not for 24.4.
> >
> > Afterwards, someone could try and look at the issue in more detail, but
> > it's risky, since it's a fairly low-level primitive called from many
> > different packages.  We'd have to go and check how all these calls would
> > be affected.
>
> I, for one, am accustomed to see these messages while Emacs is being
> built: in a highly parallel build that is sometimes the only practical
> way of knowing whether some part of the build succeeded or not.

How do you do that?!  Do you really read *all* messages being printed while
building?!

I presume that just testing for the existence of interesting files (e.g.
good old "find") isn't an option?

> So, if 'write-region' stops outputting these messages in
> non-interactive uses, there should be a way to get the current
> behavior back.

Isn't that the job of the build system rather?

[-- Attachment #2: Type: text/html, Size: 1742 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 17:31                   ` Sebastian Wiesner
@ 2014-01-23 18:04                     ` Eli Zaretskii
  2014-01-24 20:14                       ` Sebastian Wiesner
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-23 18:04 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: tromey, monnier, emacs-devel

> Date: Thu, 23 Jan 2014 18:31:58 +0100
> From: Sebastian Wiesner <lunaryorn@gmail.com>
> Cc: tromey@redhat.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> > Imagine some situation where this output is caught and parsed, for
> > example.
> >
> > In general, given behavior that is old enough, you can be sure that
> > someone, somewhere relies on it.
> 
> I don't think it is my task to care for anyone, anywhere.

Why not?  Backward incompatibility is one of the worst traits in
software, IMO.

> If there is a concrete use case for these messages, fine, then we can try
> to find a good solution for either party involved, but we can't reasonably
> discuss about "virtual" use cases.

I just gave you one concrete use case, above.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 17:37                 ` Sebastian Wiesner
@ 2014-01-23 18:07                   ` Eli Zaretskii
  2014-01-24 13:34                     ` Johan Andersson
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-23 18:07 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: tromey, monnier, emacs-devel

> Date: Thu, 23 Jan 2014 18:37:09 +0100
> From: Sebastian Wiesner <lunaryorn@gmail.com>
> Cc: tromey@redhat.com, emacs-devel@gnu.org, 
> 	Stefan Monnier <monnier@iro.umontreal.ca>
> 
> > I, for one, am accustomed to see these messages while Emacs is being
> > built: in a highly parallel build that is sometimes the only practical
> > way of knowing whether some part of the build succeeded or not.
> 
> How do you do that?!  Do you really read *all* messages being printed while
> building?!

When I need to understand what went wrong, I read many of them, yes.

> I presume that just testing for the existence of interesting files (e.g.
> good old "find") isn't an option?

With today's fast machines, that's not good enough: it's not easy to
be sure whether a given file was created by this or the previous
build, when you run one after the other (perhaps trying to fix a
problem).

> Isn't that the job of the build system rather?

When the build system becomes smart enough to tell me what went wrong,
I will no longer need this, indeed.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 18:07                   ` Eli Zaretskii
@ 2014-01-24 13:34                     ` Johan Andersson
  2014-01-24 13:48                       ` Stefan Monnier
  2014-01-24 14:25                       ` Eli Zaretskii
  0 siblings, 2 replies; 31+ messages in thread
From: Johan Andersson @ 2014-01-24 13:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Sebastian Wiesner, tromey, Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

> In general, given behavior that is old enough, you can be sure that someone,
somewhere relies on it.

Is it a documented API? If it is, it is probably the worst "API" in the
history of software and should be deprecated and removed. If it's not, just
remove it and be done with it. If you rely on that sort of output, it's
really your own fault and people can change their code.

I really really hate that Emacs prints messages when it really shouldn't.
But I can live with that, as long as there is a way to turn them off, which
there obviously isn't now. The non optional output is sort of a blocker for
me as well.


On Thu, Jan 23, 2014 at 7:07 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Thu, 23 Jan 2014 18:37:09 +0100
> > From: Sebastian Wiesner <lunaryorn@gmail.com>
> > Cc: tromey@redhat.com, emacs-devel@gnu.org,
> >       Stefan Monnier <monnier@iro.umontreal.ca>
> >
> > > I, for one, am accustomed to see these messages while Emacs is being
> > > built: in a highly parallel build that is sometimes the only practical
> > > way of knowing whether some part of the build succeeded or not.
> >
> > How do you do that?!  Do you really read *all* messages being printed
> while
> > building?!
>
> When I need to understand what went wrong, I read many of them, yes.
>
> > I presume that just testing for the existence of interesting files (e.g.
> > good old "find") isn't an option?
>
> With today's fast machines, that's not good enough: it's not easy to
> be sure whether a given file was created by this or the previous
> build, when you run one after the other (perhaps trying to fix a
> problem).
>
> > Isn't that the job of the build system rather?
>
> When the build system becomes smart enough to tell me what went wrong,
> I will no longer need this, indeed.
>
>

[-- Attachment #2: Type: text/html, Size: 2948 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-24 13:34                     ` Johan Andersson
@ 2014-01-24 13:48                       ` Stefan Monnier
  2014-01-24 14:25                       ` Eli Zaretskii
  1 sibling, 0 replies; 31+ messages in thread
From: Stefan Monnier @ 2014-01-24 13:48 UTC (permalink / raw)
  To: Johan Andersson; +Cc: Sebastian Wiesner, tromey, Eli Zaretskii, emacs-devel

> Is it a documented API? If it is, it is probably the worst "API" in the
> history of software

Emacs is a strong contender in that competition, tho I hear there are
many worthy opponents.


        Stefan



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-24 13:34                     ` Johan Andersson
  2014-01-24 13:48                       ` Stefan Monnier
@ 2014-01-24 14:25                       ` Eli Zaretskii
  1 sibling, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2014-01-24 14:25 UTC (permalink / raw)
  To: Johan Andersson; +Cc: lunaryorn, tromey, monnier, emacs-devel

> From: Johan Andersson <johan.rejeep@gmail.com>
> Date: Fri, 24 Jan 2014 14:34:56 +0100
> Cc: Sebastian Wiesner <lunaryorn@gmail.com>, tromey@redhat.com, 
> 	Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel <emacs-devel@gnu.org>
> 
> > In general, given behavior that is old enough, you can be sure that someone,
> somewhere relies on it.
> 
> Is it a documented API? If it is, it is probably the worst "API" in the
> history of software and should be deprecated and removed. If it's not, just
> remove it and be done with it. If you rely on that sort of output, it's
> really your own fault and people can change their code.

That'd be harsh on users.  There should be a very good reason to be
that harsh.

> I really really hate that Emacs prints messages when it really shouldn't.

It did so since time immemoriam.  And a solution to override that was
already proposed.  So I'm not sure why we are still arguing.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Inhibit "Wrote foo" from write-region
  2014-01-23 18:04                     ` Eli Zaretskii
@ 2014-01-24 20:14                       ` Sebastian Wiesner
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-24 20:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tromey, monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

Am 23.01.2014 19:04 schrieb "Eli Zaretskii" <eliz@gnu.org>:
>
> > Date: Thu, 23 Jan 2014 18:31:58 +0100
> > From: Sebastian Wiesner <lunaryorn@gmail.com>
> > Cc: tromey@redhat.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> >
> > > Imagine some situation where this output is caught and parsed, for
> > > example.
> > >
> > > In general, given behavior that is old enough, you can be sure that
> > > someone, somewhere relies on it.
> >
> > I don't think it is my task to care for anyone, anywhere.
>
> Why not?  Backward incompatibility is one of the worst traits in
> software, IMO.

Not undoing or fixing bad design decisions from the past is another one,
IMHO.

> > If there is a concrete use case for these messages, fine, then we can
try
> > to find a good solution for either party involved, but we can't
reasonably
> > discuss about "virtual" use cases.
>
> I just gave you one concrete use case, above.

Which I replied to with concrete questions, with the intent to, well, "find
a good solution for either party involved"...

[-- Attachment #2: Type: text/html, Size: 1573 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2014-01-24 20:14 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 12:32 Inhibit "Wrote foo" from write-region Sebastian Wiesner
2014-01-21 12:38 ` Sebastian Wiesner
2014-01-21 15:57   ` Eli Zaretskii
2014-01-21 16:31     ` Sebastian Wiesner
2014-01-21 16:47       ` Eli Zaretskii
2014-01-22 12:35         ` Sebastian Wiesner
2014-01-22 15:11           ` Stefan Monnier
2014-01-22 17:00             ` Sebastian Wiesner
     [not found]       ` <<834n4xgu3z.fsf@gnu.org>
2014-01-21 17:59         ` Drew Adams
2014-01-21 18:26           ` Eli Zaretskii
2014-01-22  8:05           ` Juri Linkov
2014-01-21 16:42 ` Tom Tromey
2014-01-22 12:37   ` Sebastian Wiesner
2014-01-22 15:09     ` Stefan Monnier
2014-01-22 17:08       ` Sebastian Wiesner
2014-01-22 19:20         ` Stefan Monnier
2014-01-23  9:35           ` Sebastian Wiesner
2014-01-23 13:50             ` Stefan Monnier
2014-01-23 14:24               ` Sebastian Wiesner
2014-01-23 15:18                 ` Stefan Monnier
2014-01-23 16:15                   ` Sebastian Wiesner
2014-01-23 16:29                 ` Eli Zaretskii
2014-01-23 17:31                   ` Sebastian Wiesner
2014-01-23 18:04                     ` Eli Zaretskii
2014-01-24 20:14                       ` Sebastian Wiesner
2014-01-23 16:25               ` Eli Zaretskii
2014-01-23 17:37                 ` Sebastian Wiesner
2014-01-23 18:07                   ` Eli Zaretskii
2014-01-24 13:34                     ` Johan Andersson
2014-01-24 13:48                       ` Stefan Monnier
2014-01-24 14:25                       ` Eli Zaretskii
     [not found] <"<m2r481o6rh.fsf"@lunaryorn-air.fritz.box>

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.