all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* elisp: how to stop messaging in echo area for save-buffer
@ 2009-08-08 15:15 Xah Lee
  2009-08-08 16:54 ` A.Politz
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Xah Lee @ 2009-08-08 15:15 UTC (permalink / raw)
  To: help-gnu-emacs

i have a elisp script that does a few hundred saving files. Each time

    (save-buffer)

is called, the *Message* buffer contains 2 lines like this:

Saving file c:/Users/xah/web/xxst/make_download_copy/
make_download_copy.el...
Wrote c:/Users/xah/web/xxst/make_download_copy/make_download_copy.el

How to disable printing this message?

i vaguely recall i've seen in elisp doc on how, but can't find it atm.

thanks.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: elisp: how to stop messaging in echo area for save-buffer
  2009-08-08 15:15 elisp: how to stop messaging in echo area for save-buffer Xah Lee
@ 2009-08-08 16:54 ` A.Politz
  2009-08-08 17:01   ` Xah Lee
  2009-08-08 17:35 ` Eli Zaretskii
       [not found] ` <mailman.4203.1249752968.2239.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 8+ messages in thread
From: A.Politz @ 2009-08-08 16:54 UTC (permalink / raw)
  To: help-gnu-emacs

On Aug 8, 5:15 pm, Xah Lee <xah...@gmail.com> wrote:
> i have a elisp script that does a few hundred saving files. Each time
>
>     (save-buffer)
>
> is called, the *Message* buffer contains 2 lines like this:
>
> Saving file c:/Users/xah/web/xxst/make_download_copy/
> make_download_copy.el...
> Wrote c:/Users/xah/web/xxst/make_download_copy/make_download_copy.el
>
> How to disable printing this message?
>
> i vaguely recall i've seen in elisp doc on how, but can't find it atm.
>
> thanks.
>
>   Xah
> ∑http://xahlee.org/
>
> ☄

(let (message-log-max)
  (save-buffer))

-ap


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

* Re: elisp: how to stop messaging in echo area for save-buffer
  2009-08-08 16:54 ` A.Politz
@ 2009-08-08 17:01   ` Xah Lee
  2009-08-08 18:56     ` Florian Beck
       [not found]     ` <mailman.4210.1249757817.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Xah Lee @ 2009-08-08 17:01 UTC (permalink / raw)
  To: help-gnu-emacs

On Aug 8, 9:54 am, "A.Politz" <poli...@googlemail.com> wrote:
> > i have a elisp script that does a few hundred saving files. Each time
>
> >     (save-buffer)
>
> > is called, the *Message* buffer contains 2 lines like this:
>
> > Saving file c:/Users/xah/web/xxst/make_download_copy/
> > make_download_copy.el...
> > Wrote c:/Users/xah/web/xxst/make_download_copy/make_download_copy.el
>
> > How to disable printing this message?

> On Aug 8, 5:15 pm, Xah Lee <xah...@gmail.com> wrote:
> (let (message-log-max)
>   (save-buffer))

thanks.

though i needed to keep messages in the *Message* buffer before and
after the save flood.

my problem is that save-buffer caused so many lines (about 2 x 1000
lines) that scrolled off important messages (such as copy dir failed)
in the buffer, and i also wanted messages like “Xyz is done now.” that
happens when the elisp script finished.

am looking for a way to temp disable save-buffer writing a message to
*Message*. Thanks.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: elisp: how to stop messaging in echo area for save-buffer
  2009-08-08 15:15 elisp: how to stop messaging in echo area for save-buffer Xah Lee
  2009-08-08 16:54 ` A.Politz
@ 2009-08-08 17:35 ` Eli Zaretskii
       [not found] ` <mailman.4203.1249752968.2239.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2009-08-08 17:35 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Xah Lee <xahlee@gmail.com>
> Date: Sat, 8 Aug 2009 08:15:52 -0700 (PDT)
> 
> i have a elisp script that does a few hundred saving files. Each time
> 
>     (save-buffer)
> 
> is called, the *Message* buffer contains 2 lines like this:
> 
> Saving file c:/Users/xah/web/xxst/make_download_copy/
> make_download_copy.el...
> Wrote c:/Users/xah/web/xxst/make_download_copy/make_download_copy.el
> 
> How to disable printing this message?

Temporarily bind message-log-max to nil, perhaps?




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

* Re: elisp: how to stop messaging in echo area for save-buffer
  2009-08-08 17:01   ` Xah Lee
@ 2009-08-08 18:56     ` Florian Beck
       [not found]     ` <mailman.4210.1249757817.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Florian Beck @ 2009-08-08 18:56 UTC (permalink / raw)
  To: Xah Lee; +Cc: help-gnu-emacs

Xah Lee <xahlee@gmail.com> writes:


>> > i have a elisp script that does a few hundred saving files. Each time
>>
>> >     (save-buffer)
>>
>> > is called, the *Message* buffer contains 2 lines like this:
>
> am looking for a way to temp disable save-buffer writing a message to
> *Message*. Thanks.

Redfine the save-buffer function.

Or temporarily change `message':

  (flet ((message (lambda (&rest args))))
    ...    
    (save-buffer)
    ...)

Use at your own risk.    
-- 
Florian Beck




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

* Re: elisp: how to stop messaging in echo area for save-buffer
       [not found] ` <mailman.4203.1249752968.2239.help-gnu-emacs@gnu.org>
@ 2009-08-10  8:35   ` Xah Lee
  0 siblings, 0 replies; 8+ messages in thread
From: Xah Lee @ 2009-08-10  8:35 UTC (permalink / raw)
  To: help-gnu-emacs

thanks all. Setting message-log-max worked out for me.

 Xah

On Aug 8, 10:35 am, Eli Zaretskii <e...@gnu.org> wrote:
> > From: Xah Lee <xah...@gmail.com>
> > Date: Sat, 8 Aug 2009 08:15:52 -0700 (PDT)
>
> > i have a elisp script that does a few hundred saving files. Each time
>
> >     (save-buffer)
>
> > is called, the *Message* buffer contains 2 lines like this:
>
> > Saving file c:/Users/xah/web/xxst/make_download_copy/
> > make_download_copy.el...
> > Wrote c:/Users/xah/web/xxst/make_download_copy/make_download_copy.el
>
> > How to disable printing this message?
>
> Temporarily bind message-log-max to nil, perhaps?


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

* Re: elisp: how to stop messaging in echo area for save-buffer
       [not found]     ` <mailman.4210.1249757817.2239.help-gnu-emacs@gnu.org>
@ 2009-08-10 14:23       ` Pascal J. Bourguignon
  2009-08-29  0:34         ` Florian Beck
  0 siblings, 1 reply; 8+ messages in thread
From: Pascal J. Bourguignon @ 2009-08-10 14:23 UTC (permalink / raw)
  To: help-gnu-emacs

Florian Beck <abstraktion@t-online.de> writes:

> Xah Lee <xahlee@gmail.com> writes:
>
>
>>> > i have a elisp script that does a few hundred saving files. Each time
>>>
>>> >     (save-buffer)
>>>
>>> > is called, the *Message* buffer contains 2 lines like this:
>>
>> am looking for a way to temp disable save-buffer writing a message to
>> *Message*. Thanks.
>
> Redfine the save-buffer function.
>
> Or temporarily change `message':
>
>   (flet ((message (lambda (&rest args))))
>     ...    
>     (save-buffer)
>     ...)
>
> Use at your own risk.    

Indeed.  This works because of a bug in flet.  Since it's
inspiration is Common Lisp FLET, it should make only a lexical
binding.  The version I have has corrected this bug:

(macroexpand '(flet   ((message (&rest args))) (f) (message "done")))
-->
(let* ((--cl-letf-bound-- (fboundp #1=(quote message)))
       (--cl-letf-save--  (and --cl-letf-bound-- (symbol-function #1#))))
 (unwind-protect
      (progn
        (fset #1# (function* (lambda (&rest args) (block message))))
        (f)     
        (message "done"))
   (if --cl-letf-bound--
       (fset #1# --cl-letf-save--)
       (fmakunbound #1#))))



-- 
__Pascal Bourguignon__


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

* Re: elisp: how to stop messaging in echo area for save-buffer
  2009-08-10 14:23       ` Pascal J. Bourguignon
@ 2009-08-29  0:34         ` Florian Beck
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Beck @ 2009-08-29  0:34 UTC (permalink / raw)
  To: Pascal J. Bourguignon; +Cc: help-gnu-emacs

pjb@informatimago.com (Pascal J. Bourguignon) writes:

> Florian Beck <abstraktion@t-online.de> writes:
>
>> Xah Lee <xahlee@gmail.com> writes:
>>
>>
>>>> > i have a elisp script that does a few hundred saving files. Each time
>>>>
>>>> >     (save-buffer)
>>>>
>>>> > is called, the *Message* buffer contains 2 lines like this:
>>>
>>> am looking for a way to temp disable save-buffer writing a message to
>>> *Message*. Thanks.
>>
>> Redfine the save-buffer function.
>>
>> Or temporarily change `message':
>>
>>   (flet ((message (lambda (&rest args))))
>>     ...    
>>     (save-buffer)
>>     ...)
>>
>> Use at your own risk.    
>
> Indeed.  This works because of a bug in flet.  Since it's
> inspiration is Common Lisp FLET, it should make only a lexical
> binding. 

An inspiration is not a specification.

In fact, from aber user's perspective, I think the above is about the strongest
argument one can make for elisp's  dynamic binding.

This is strictly from the point of view of someone who want to customize
his emacs.

> The version I have has corrected this bug:
>
> (macroexpand '(flet   ((message (&rest args))) (f) (message "done")))
> -->
> (let* ((--cl-letf-bound-- (fboundp #1=(quote message)))
>        (--cl-letf-save--  (and --cl-letf-bound-- (symbol-function #1#))))
>  (unwind-protect
>       (progn
>         (fset #1# (function* (lambda (&rest args) (block message))))
>         (f)     
>         (message "done"))
>    (if --cl-letf-bound--
>        (fset #1# --cl-letf-save--)
>        (fmakunbound #1#))))

-- 
Florian Beck




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

end of thread, other threads:[~2009-08-29  0:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-08 15:15 elisp: how to stop messaging in echo area for save-buffer Xah Lee
2009-08-08 16:54 ` A.Politz
2009-08-08 17:01   ` Xah Lee
2009-08-08 18:56     ` Florian Beck
     [not found]     ` <mailman.4210.1249757817.2239.help-gnu-emacs@gnu.org>
2009-08-10 14:23       ` Pascal J. Bourguignon
2009-08-29  0:34         ` Florian Beck
2009-08-08 17:35 ` Eli Zaretskii
     [not found] ` <mailman.4203.1249752968.2239.help-gnu-emacs@gnu.org>
2009-08-10  8:35   ` Xah Lee

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.