emacs-devel
[Top][All Lists]
Advanced

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

Re: Missing `with' macro?


From: Richard Stallman
Subject: Re: Missing `with' macro?
Date: Sat, 29 Jul 2006 11:18:15 -0400

* This macro has two separate args REUSE and WRITE.
But I think only two combinations make sense: t nil, and nil t.
It is always wrong to reuse an existing buffer if you're going
to modify the file.  And if you're not going to modify it,
there is never any point in not reusing one.

So I think you should get rid of the REUSE argument.

* This is a horrible kludge

                       ;; We need to pretend that any other visiting buffer
                       ;; doesn't actually exist.
                       (if ,extant-sym
                           (with-current-buffer ,extant-sym
                             (setq buffer-file-name nil)))
                       (find-file-noselect ,file-sym t))

and without an unwind-protect it will permanently ruin the other buffer
if an error occurs.  How about this instead?

          ;; Create a new buffer.
          (setq buf (create-file-buffer filename))
          ;; find-file-noselect-1 may use a different buffer.
          (find-file-noselect-1 buf filename nowarn
                                rawfile truename number))))))

* This seems like a mistake:

                 ;; We don't just let-bind buffer-read-only because that
                 ;; interacts poorly with switching buffers.
                 (setq buffer-read-only (not ,write-sym))

What is the problem you're concerned about?

*  Use 'silent with prefix ARG.  Use 'raw with two C-u's."

Please write `silent' and `raw'; that is our convention.




reply via email to

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