all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: herring@lanl.gov
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 17:29:44 -0400	[thread overview]
Message-ID: <jwvlkbclwxf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <40804.128.165.123.18.1189544766.squirrel@webmail.lanl.gov> (Davis Herring's message of "Tue\, 11 Sep 2007 14\:06\:06 -0700 \(PDT\)")

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

That's OK.  We can even provide this function in subr.el so they can replace

     (let ((print-unreadable-function t))
with
     (let ((print-unreadable-function 'signal-print-unreadable-error))

[ But I do think that signalling `error' would be wrong: it needs to be more
  precise.  I'm sure you agree with me since that's already what t does
  right now in your code IIUC.  ]

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

I'd personally write

   (let ((print-unreadable-function (lambda (obj) (signal 'the-error obj))))
or
   (let ((print-unreadable-function (lambda (obj) (throw 'the-error obj))))

and I don't feel silly about it at all.

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

I'd prefer that setting print-unreadable-function automatically overrides
any print-length or print-level limit.


        Stefan

  reply	other threads:[~2007-09-11 21:29 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                   ` [Released] " Davis Herring
2007-09-11 21:29                     ` Stefan Monnier [this message]
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

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

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