unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Davis Herring" <herring@lanl.gov>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: emacs-pretest-bug@gnu.org, Drew Adams <drew.adams@oracle.com>
Subject: Re: [Released] Re: 23.0.50; savehist save invalid syntax
Date: Tue, 11 Sep 2007 14:06:06 -0700 (PDT)	[thread overview]
Message-ID: <40804.128.165.123.18.1189544766.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <jwv642i6mbv.fsf-monnier+emacs@gnu.org>

>> I think the documentation for the (new) variable
>> `print-unreadable-function' may be sufficient, but I could add one.
>> I specifically don't want to catch all errors there, because any other
>> error ought to be noticed, not suppressed.
>
> If you bind print-unreadable-function to your own function (instead of
> just
> t), then the code will be easier to understand (and you'll be able to
> use whichever error you feel like, you can even use catch/throw if its
> more convenient).
>
> I think this special case of print-unreadable-function being bound to t is
> rather unnecessary.

It seemed to me that without that option, each package that used the
feature would quickly end up writing the same function:

(defun package-unreadable-function (obj)
  "Signal that OBJ would be unreadable."
  (error "%S can't be printed readably" obj))

(This of course loses the specific error symbol.)  I know when I was
testing it (before it supported t) I immediately felt silly writing a
function that just redirected to `error'.  It seems to me that "print this
readably, and if you can't, fail" is a reasonable thing to expect people
to want; "print this readably but do that instead if you can't" is also
reasonable, so support it we shall.

Of course, while thinking about this it occurs to me that while (4 5 ...)
(produced with a finite `print-length' or `print-level') is actually
readable, it certainly does not read as what was written.  Should this
trigger the unreadable-handling as well?

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

  reply	other threads:[~2007-09-11 21:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-02 10:38 23.0.50; savehist save invalid syntax Leo
2007-09-02 13:21 ` Drew Adams
2007-09-03  3:04 ` Richard Stallman
2007-09-04 22:48   ` Davis Herring
2007-09-05  3:20     ` Stefan Monnier
2007-09-05  6:16     ` Richard Stallman
2007-09-05 18:16       ` Davis Herring
2007-09-06  5:00         ` Richard Stallman
2007-09-09 21:58         ` Drew Adams
2007-09-09 23:14           ` Andreas Schwab
2007-09-10  3:01             ` Drew Adams
2007-09-10  3:07               ` Drew Adams
2007-09-10 22:11               ` Davis Herring
2007-09-10 23:42                 ` Drew Adams
2007-09-10 23:54               ` Richard Stallman
2007-09-11 20:27                 ` Davis Herring
2007-09-10 21:59           ` Davis Herring
2007-09-10 23:42             ` Drew Adams
2007-09-11  0:55               ` Davis Herring
2007-09-11  1:11                 ` Stefan Monnier
2007-09-11 21:06                   ` Davis Herring [this message]
2007-09-11 21:29                     ` [Released] " Stefan Monnier
2007-09-14  7:04                     ` Richard Stallman
2007-09-11  1:18                 ` Drew Adams
2007-09-05 19:57       ` Leo
2007-10-18 21:08 ` Leo
2007-10-19  8:15   ` Leo
2007-10-19 14:01     ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=40804.128.165.123.18.1189544766.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --cc=drew.adams@oracle.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).