comparison lisp/prim/window.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 376386a54a3c
children 131b0175ea99
comparison
equal deleted inserted replaced
15:ad457d5f7d04 16:0293115a14e9
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of 15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; General Public License for more details. 17 ;; General Public License for more details.
18 18
19 ;; You should have received a copy of the GNU General Public License 19 ;; You should have received a copy of the GNU General Public License
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free 20 ;; along with XEmacs; see the file COPYING. If not, write to the
21 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
22 23
23 ;;; Synched up with: FSF 19.30. 24 ;;; Synched up with: FSF 19.30.
24 25
25 ;;;; Window tree functions. 26 ;;;; Window tree functions.
26 27
291 (> (nth 1 edges) 292 (> (nth 1 edges)
292 ;FSFmacs (frame-property (window-frame window) 293 ;FSFmacs (frame-property (window-frame window)
293 ; 'menu-bar-lines params) 294 ; 'menu-bar-lines params)
294 0))) 295 0)))
295 (unwind-protect 296 (unwind-protect
296 (progn 297 (let ((shrinkee (or window w)))
297 (select-window (or window w)) 298 (set-buffer (window-buffer shrinkee))
298 (goto-char (point-min)) 299 (goto-char (point-min))
299 (while (pos-visible-in-window-p 300 (while (pos-visible-in-window-p
300 (- (point-max) 301 (- (point-max)
301 (if ignore-final-newline 1 0))) 302 (if ignore-final-newline 1 0))
303 shrinkee)
302 ;; defeat file locking... don't try this at home, kids! 304 ;; defeat file locking... don't try this at home, kids!
303 (setq buffer-file-name nil) 305 (setq buffer-file-name nil)
304 (insert ?\n) (setq n (1+ n))) 306 (insert ?\n) (setq n (1+ n)))
305 (if (> n 0) 307 (if (> n 0)
306 (shrink-window (min (1- n) 308 (shrink-window (min (1- n)
307 (- (window-height) 309 (- (window-height shrinkee)
308 window-min-height))))) 310 window-min-height))
311 nil
312 shrinkee)))
309 (delete-region (point-min) (point)) 313 (delete-region (point-min) (point))
310 (set-buffer-modified-p modified) 314 (set-buffer-modified-p modified)
311 (goto-char p) 315 (goto-char p)
312 (select-window w)
313 ;; Make sure we unbind buffer-read-only 316 ;; Make sure we unbind buffer-read-only
314 ;; with the proper current buffer. 317 ;; with the proper current buffer.
315 (set-buffer buffer)))))) 318 (set-buffer buffer))))))
316 319
317 (defun backward-other-window (arg &optional all-frames device) 320 (defun backward-other-window (arg &optional all-frames device)