emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/window.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/window.el [lexbind]
Date: Tue, 14 Oct 2003 19:52:40 -0400

Index: emacs/lisp/window.el
diff -c emacs/lisp/window.el:1.86.2.1 emacs/lisp/window.el:1.86.2.2
*** emacs/lisp/window.el:1.86.2.1       Fri Apr  4 01:20:12 2003
--- emacs/lisp/window.el        Tue Oct 14 19:51:28 2003
***************
*** 75,80 ****
--- 75,97 ----
      (eq base-window
        (next-window base-window (if nomini 'arg) all-frames))))
  
+ (defun window-current-scroll-bars (&optional window)
+   "Return the current scroll-bar settings in window WINDOW.
+ Value is a cons (VERTICAL . HORISONTAL) where VERTICAL specifies the
+ current location of the vertical scroll-bars (left, right, or nil),
+ and HORISONTAL specifies the current location of the horisontal scroll
+ bars (top, bottom, or nil)."
+   (let ((vert (nth 2 (window-scroll-bars window)))
+       (hor nil))
+     (when (or (eq vert t) (eq hor t))
+       (let ((fcsb (frame-current-scroll-bars 
+                  (window-frame (or window (selected-window))))))
+       (if (eq vert t)
+           (setq vert (car fcsb)))
+       (if (eq hor t)
+           (setq hor (cdr fcsb)))))
+     (cons vert hor)))
+ 
  (defun walk-windows (proc &optional minibuf all-frames)
    "Cycle through all visible windows, calling PROC for each one.
  PROC is called with a window as argument.
***************
*** 532,542 ****
  (defun kill-buffer-and-window ()
    "Kill the current buffer and delete the selected window."
    (interactive)
!   (if (yes-or-no-p (format "Kill buffer `%s'? " (buffer-name)))
!       (let ((buffer (current-buffer)))
!       (delete-window (selected-window))
!       (kill-buffer buffer))
!     (error "Aborted")))
  
  (defun quit-window (&optional kill window)
    "Quit the current buffer.  Bury it, and maybe delete the selected frame.
--- 549,566 ----
  (defun kill-buffer-and-window ()
    "Kill the current buffer and delete the selected window."
    (interactive)
!   (let ((window-to-delete (selected-window))
!       (delete-window-hook (lambda ()
!                             (condition-case nil
!                                 (delete-window)
!                               (error nil)))))
!     (add-hook 'kill-buffer-hook delete-window-hook t t)
!     (if (kill-buffer (current-buffer))
!       ;; If `delete-window' failed before, we rerun it to regenerate
!       ;; the error so it can be seen in the minibuffer.
!       (when (eq (selected-window) window-to-delete)
!         (delete-window))
!       (remove-hook 'kill-buffer-hook delete-window-hook t))))
  
  (defun quit-window (&optional kill window)
    "Quit the current buffer.  Bury it, and maybe delete the selected frame.
***************
*** 602,605 ****
--- 626,630 ----
  (define-key ctl-x-map "+" 'balance-windows)
  (define-key ctl-x-4-map "0" 'kill-buffer-and-window)
  
+ ;;; arch-tag: b508dfcc-c353-4c37-89fa-e773fe10cea9
  ;;; window.el ends here




reply via email to

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