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: Stefan Monnier
Subject: Re: address@hidden: Wrong behavior of bs-delete, bs-delete-backward if buffer is not actually killed]
Date: Fri, 16 Nov 2001 02:30:54 -0500

> Do you agree with this?  What should we do here?

Looks OK to me.
I'm not 100% sure about the change to bs-delete-backward: maybe bs-delete
should return a success/failure code so that we don't need to infer the
result with (eq current (bs--current-buffer)).
Or maybe we should simply do (error "Buffer was not deleted")
instead of (bs-message-without-log "Buffer was not deleted").


        Stefan

> ------- Start of forwarded message -------
> From: Juanma Barranquero <address@hidden>
> To: address@hidden
> Subject: Wrong behavior of bs-delete, bs-delete-backward if buffer is not 
> actually killed
> Sender: address@hidden
> Date: Thu, 15 Nov 2001 15:47:52 +0100
> 
> Currently, when trying to kill a buffer from within bs-show,
> `bs-delete' and `bs-delete-backward' do the wrong thing if the buffer
> can not be deleted (because one of the kill-buffer-query-functions
> returned nil, or any other reason). With this patch applied, those
> functions show a message ("Buffer was not deleted") and do not delete
> the buffer from the bs list.
> 
> 
>                                                            /L/e/k/t/u
> 
> 
> 
> 2001-11-15  Juanma Barranquero  <address@hidden>
> 
>       * bs.el (bs-delete): Show message and do nothing if buffer could
>       not be deleted.
>       (bs-delete-backward): Likewise.
> 
> 
> - --- bs.el.orig      Mon Oct 22 13:15:32 2001
> +++ bs.el     Thu Nov 15 14:58:21 2001
> @@ -924,25 +924,28 @@
>    (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)
> - -                        (if (eobp) (point) (1+ (point)))))
> - -    (if (eobp)
> - -   (progn
> - -     (backward-delete-char 1)
> - -     (beginning-of-line)
> - -     (recenter -1)))
> - -    (bs--set-window-height)))
> +    (if (not (kill-buffer current))
> +        (bs-message-without-log "Buffer was not deleted")
> +      (setq bs-current-list (delq current bs-current-list))
> +      (beginning-of-line)
> +      (delete-region (point) (save-excursion
> +                               (end-of-line)
> +                               (if (eobp) (point) (1+ (point)))))
> +      (if (eobp)
> +          (progn
> +            (backward-delete-char 1)
> +            (beginning-of-line)
> +            (recenter -1)))
> +      (bs--set-window-height))))
>  
>  (defun bs-delete-backward ()
>    "Like `bs-delete' but go to buffer in front of current."
>    (interactive)
> - -  (let ((on-last-line-p (save-excursion (end-of-line) (eobp))))
> +  (let ((on-last-line-p (save-excursion (end-of-line) (eobp)))
> +        (current (bs--current-buffer)))
>      (bs-delete)
> - -    (unless on-last-line-p
> +    (unless (or (eq current (bs--current-buffer))
> +                on-last-line-p)
>        (bs-up 1))))
>  
>  (defun bs-show-sorted ()
> 
> 
> _______________________________________________
> Bug-gnu-emacs mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
> ------- End of forwarded message -------
> 
> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/emacs-devel
> 




reply via email to

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