all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org, mathias.dahl@gmail.com
Subject: Re: Missing `with' macro?
Date: Sat, 29 Jul 2006 11:18:15 -0400	[thread overview]
Message-ID: <E1G6qZz-0000Gd-SK@fencepost.gnu.org> (raw)
In-Reply-To: <33776.128.165.123.18.1154052850.squirrel@webmail.lanl.gov> (herring@lanl.gov)

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

  parent reply	other threads:[~2006-07-29 15:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-24 10:17 Missing `with' macro? Mathias Dahl
2006-07-24 13:46 ` Stefan Monnier
2006-07-24 14:33   ` Mathias Dahl
2006-07-24 18:22 ` Richard Stallman
2006-07-24 20:55   ` Jorgen Schaefer
2006-07-25  3:09     ` Richard Stallman
2006-07-28  2:14   ` Stuart D. Herring
2006-07-28  2:23     ` Stuart D. Herring
2006-07-29 15:18     ` Richard Stallman [this message]
2006-08-01  1:06       ` Stuart D. Herring
2006-08-07  5:01         ` Richard Stallman
2006-08-07 21:38           ` Stuart D. Herring
2006-08-08 18:01             ` Richard Stallman
2006-08-08 18:32               ` Stuart D. Herring
2006-08-09  4:58                 ` Richard Stallman
2006-08-08 18:01             ` Richard Stallman
2006-08-16 19:59               ` Stuart D. Herring
2006-08-17 15:18                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1G6qZz-0000Gd-SK@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mathias.dahl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.