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:

It did not fail when I tried it.  I tried it in two ways:
using C-M-x, and by putting that code into the body of a function

    (defun foo ()
      (interactive)
      (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 "????"))))

and typing M-x foo.  In both cases, the buffer was not narrowed
afterward.

Can anyone else reproduce such a problem?


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

Reply via email to