emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Wrong behavior of bs-delete, bs-delete-backward if b


From: Juanma Barranquero
Subject: Re: address@hidden: Wrong behavior of bs-delete, bs-delete-backward if buffer is not actually killed]
Date: Fri, 16 Nov 2001 12:00:49 +0100

On Fri, 16 Nov 2001 05:00:19 -0500, "Stefan Monnier" 
<monnier+gnu/address@hidden> wrote:

> Just because a function can be called interactively doesn't mean
> that it can't have a meaningful return value.

As kill-buffer poignantly demonstrates :)

> It also gives the message to the user and it additionally shortcuts the
> rest of the code in `bs-delete-backward' so we don't need to do anything
> special there any more.

You're right. Your idea is much better than mine.

> But maybe the beeping of `error' is annoying for the user, I don't
> know.

bs.el uses `error' to signal other error conditions, so I don't think
that's a problem.


                                                           /L/e/k/t/u


*** bs.el.orig  Mon Oct 22 13:15:32 2001
--- bs.el       Fri Nov 16 11:56:11 2001
***************
*** 924,931 ****
    (interactive)
    (let ((current (bs--current-buffer))
        (inhibit-read-only t))
      (setq bs-current-list (delq current bs-current-list))
-     (kill-buffer current)
      (beginning-of-line)
      (delete-region (point) (save-excursion
                             (end-of-line)
--- 924,932 ----
    (interactive)
    (let ((current (bs--current-buffer))
        (inhibit-read-only t))
+     (unless (kill-buffer current)
+       (error "Buffer was not deleted"))
      (setq bs-current-list (delq current bs-current-list))
      (beginning-of-line)
      (delete-region (point) (save-excursion
                             (end-of-line)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]