> Calling `eval-last-sexp' on:
> "\u"
> correctly causes the error "Non-hex digit used for Unicode escape", but
> unexpectedly leaves the buffer narrowed to point-min and point.

It's a problem with `save-restriction'.  Take:

(with-current-buffer (get-buffer-create "*foo*")
  (delete-region (point-min) (point-max))
  (insert "foo\nbar\nfoo\n")
  (save-restriction
    (narrow-to-region (line-beginning-position -1) (line-end-position -1))
    (error "????")))

It will leave the buffer narrowed although the doc-string of
`save-restriction' says:

    The old restrictions settings are restored
    even in case of abnormal exit (throw or error).

AFAICT Emacs 20 DTRT here, Emacs 21 and 22 don't.  Could you try to
debug it?

You can side-step the problem with something like

(with-current-buffer (get-buffer-create "*foo*")
  (delete-region (point-min) (point-max))
  (insert "foo\nbar\nfoo\n")
  (condition-case err
      (save-restriction
        (narrow-to-region (line-beginning-position -1) (line-end-position -1))
        (error "????"))
    (error
     err
     (widen)
     (error (error-message-string err)))))

which does the wrong thing when the buffer was already narrowed before
executing the `save-restriction' form.



_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to