unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Noah Friedman <friedman@splode.com>
Subject: read-file-name error-handling problem
Date: Sat, 10 Aug 2002 10:40:19 -0700 (PDT)	[thread overview]
Message-ID: <20020810104019.961801.FMU3842@piglet.prv.splode.com> (raw)

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 1016 bytes --]

Speaking of read-file-name calling conventions, I'm running into a case
where errors from read-file-name are not caught by condition-case even when
they should be.  I believe that the code snippet below should print a
message in the echo area instead of going into the debugger.

This happens building from the cvs trunk as of last night, but I first
noticed it a few weeks ago but was too busy to produce a smaller test case.
This test case attempts to call read-file-name in an xemacs-compatible
fashion but trap errors from that, and is failing.  (I first ran into this
problem with VM.)

To demonstrate the bug, load this file and run M-x foo, then type some
partial file name in your current working directory and then try to
complete it, e.g. I have a directory called "bin" in my home directory, and
if I type M-x b<TAB>, I get thrown into the elisp debugger.  The backtrace
is attached below.

No fix yet, but I thought I'd report it in the meantime in case someone
else immediately recognizes the problem.


[-- Attachment #2: foo.el --]
[-- Type: text/plain, Size: 232 bytes --]

(setq debug-on-error t)

(defun foo ()
  (interactive)
  (let ((foo-history '("~/foo")))
    (condition-case err
        (read-file-name "Foo: " "~/" nil nil nil foo-history)
      (error
       (message "caught error: %s" err)))))

[-- Attachment #3: backtrace.txt --]
[-- Type: text/plain, Size: 594 bytes --]

Debugger entered--Lisp error: (invalid-function ("~/foo"))
  ("~/foo")("~/bin/")
  read-file-name-internal("~/bin/" "~/" lambda)
  minibuffer-complete()
* call-interactively(minibuffer-complete)
  read-file-name("Foo: " "~/" nil nil nil ("~/foo"))
  (condition-case err (read-file-name "Foo: " "~/" nil nil nil foo-history) (error (message "caught error: %s" err)))
  (let ((foo-history ...)) (condition-case err (read-file-name "Foo: " "~/" nil nil nil foo-history) (error ...)))
  foo()
* call-interactively(foo)
  execute-extended-command(nil)
* call-interactively(execute-extended-command)

             reply	other threads:[~2002-08-10 17:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-10 17:40 Noah Friedman [this message]
2002-08-12 17:06 ` read-file-name error-handling problem Richard Stallman
2002-08-12 17:47 ` Richard Stallman
2002-08-30  3:40   ` Noah Friedman
2002-08-30 19:17     ` 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

  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=20020810104019.961801.FMU3842@piglet.prv.splode.com \
    --to=friedman@splode.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 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).