1. 19 Jun, 2011 2 commits
    • Martin Rudalics's avatar
      Provide functions for saving window configurations as Lisp objects. · 9d89fec7
      Martin Rudalics authored
      * window.el (window-list-no-nils, window-state-ignored-parameters)
      (window-state-get-1, window-state-get, window-state-put-list)
      (window-state-put-1, window-state-put-2, window-state-put): New
      functions.
      9d89fec7
    • Martin Rudalics's avatar
      Sanitize processing of display specifiers; new option frame-auto-delete. · fbf5b3ce
      Martin Rudalics authored
      * window.el (display-buffer-other-window-means-other-frame):
      Call display-buffer-normalize-alist.
      (display-buffer-normalize-specifiers-1): Rename to
      display-buffer-normalize-argument.  New argument other-frame.
      Rewrite.
      (display-buffer-normalize-specifiers-2): Rename to
      display-buffer-normalize-options.
      (display-buffer-normalize-alist-1): New function.
      (display-buffer-normalize-specifiers-3): Rename to
      display-buffer-normalize-alist.  Call
      display-buffer-normalize-alist-1.
      (display-buffer-normalize-options-inhibit): New variable.
      (display-buffer-normalize-specifiers): Rewrite calling
      display-buffer-normalize-alist,
      display-buffer-normalize-argument, and
      display-buffer-normalize-options.  Don't call the latter if
      display-buffer-normalize-options-inhibit is non-nil.
      (frame-auto-delete): New option.
      (window-deletable-p): Use frame-auto-delete.
      fbf5b3ce
  2. 18 Jun, 2011 2 commits
    • Martin Rudalics's avatar
      One more fix for display-buffer-normalize-specifiers-1. · 28dec25a
      Martin Rudalics authored
      * window.el (display-buffer-normalize-specifiers-1): Fix thinko.
      28dec25a
    • Martin Rudalics's avatar
      Additional fixes in handling of buffer display specifiers. · be3fb2b8
      Martin Rudalics authored
      * window.el (display-buffer-default-specifiers): Remove
      pop-up-frame.  Add pop-up-window-min-height,
      pop-up-window-min-width, and another reuse-window specifier
      (Bug#8882).  Reported by Dan Nicolaescu <dann@gnu.org>.
      (display-buffer-normalize-specifiers-2): Handle
      split-height-threshold and split-width-threshold also when
      pop-up-windows is unset.  Add a reuse-window specifier for the
      case popping up a new window fails.
      (special-display-popup-frame): Remove double quoting.
      be3fb2b8
  3. 17 Jun, 2011 4 commits
    • Martin Rudalics's avatar
      9be74fbb
    • Martin Rudalics's avatar
      Rewrite display-buffer-alist and display-buffer-normalize-specifiers. · 25aef8b8
      Martin Rudalics authored
      * window.el (display-buffer-alist): Set pop-up-window-min-height
      and pop-up-window-min-width in default value.  Reported by
      Thierry Volpiatto <thierry.volpiatto@gmail.com>.  New specifier
      other-window-means-other-frame.
      (display-buffer-macro-specifiers): Comment out entry for
      other-window specifier.
      (display-buffer-other-window-means-other-frame): New function.
      (display-buffer-normalize-specifiers-1): New arguments
      buffer-name and label.  Treat other-window case specially.
      (display-buffer-normalize-specifiers-2): Treat other-window case
      specially.
      (display-buffer-normalize-specifiers-3): New function.
      (display-buffer-normalize-specifiers): Call
      display-buffer-normalize-specifiers-3.
      25aef8b8
    • Martin Rudalics's avatar
      Fix handling of old `display-buffer' options (bug#8851) (bug#8856). · d1067961
      Martin Rudalics authored
      * window.el (display-buffer-normalize-specifiers-1): Don't
      check pop-up-frames for 'unset initialization.
      (display-buffer-normalize-specifiers-2): Major rewrite using
      special-display-p and same-window-p (Bug#8851) and (Bug#8856).
      (pop-up-frames, display-buffer-reuse-frames)
      (display-buffer-mark-dedicated): Don't initialize to 'unset.
      Suggested by David Engster <deng@randomsample.de>.
      (even-window-heights): Initialize to 'unset.
      (display-buffer-alist-set): Handle new 'unset initializations.
      d1067961
    • Martin Rudalics's avatar
      Fix two typos in same-window-p. · dbad4f69
      Martin Rudalics authored
      * window.el (same-window-p): Fix two typos introduced when
      adding with-no-warnings.
      dbad4f69
  4. 16 Jun, 2011 4 commits
  5. 15 Jun, 2011 2 commits
    • Stefan Monnier's avatar
      Don't encourage the use of display-buffer-alist from Elisp code. · efdcdbf8
      Stefan Monnier authored
      * lisp/window.el (same-window-buffer-names, same-window-regexps)
      (special-display-frame-alist, special-display-popup-frame)
      (special-display-function, special-display-buffer-names)
      (special-display-regexps, pop-up-frame-alist)
      (pop-up-frame-function, pop-up-frames, display-buffer-reuse-frames)
      (pop-up-windows, split-window-preferred-function)
      (split-height-threshold, split-width-threshold, even-window-heights)
      (display-buffer-mark-dedicated): Fix obsolescence info.
      efdcdbf8
    • Martin Rudalics's avatar
      Don't let display-buffer pop up new frames by default (bug#8857). · baa1c9ab
      Martin Rudalics authored
      * window.el (display-buffer-alist): Trim default value to avoid
      popping up a new frame (Bug#8857) or reusing an arbitrary window
      on another frame.
      (display-buffer): Do not fall back on popping up a new frame in
      batch mode (Bug#8857).
      baa1c9ab
  6. 13 Jun, 2011 1 commit
    • Martin Rudalics's avatar
      Install new buffer display functions and variables. · 9481c002
      Martin Rudalics authored
      * window.el (display-buffer-function): Rewrite doc-string.
      (display-buffer-window, display-buffer-alist): New variables.
      (display-buffer-split-specifiers)
      (display-buffer-side-specifiers)
      (display-buffer-macro-specifiers): New constants.
      (display-buffer-even-window-sizes, display-buffer-set-height)
      (display-buffer-set-width, display-buffer-select-window)
      (display-buffer-in-window, display-buffer-reuse-window)
      (display-buffer-split-window-1, display-buffer-split-window)
      (display-buffer-split-atom-window, display-buffer-pop-up-window)
      (display-buffer-pop-up-frame, display-buffer-pop-up-side-window)
      (display-buffer-in-side-window, normalize-buffer-to-display)
      (display-buffer-normalize-specifiers-1)
      (display-buffer-normalize-specifiers-2)
      (display-buffer-normalize-specifiers, display-buffer-frame): New
      functions.
      (display-buffer): Major rewrite.
      (display-buffer-other-window, display-buffer-other-frame)
      (pop-to-buffer, switch-to-buffer-other-window)
      (switch-to-buffer-other-frame): Rewrite.
      (display-buffer-same-window, display-buffer-same-frame)
      (display-buffer-same-frame-other-window)
      (pop-to-buffer-same-window, pop-to-buffer-same-frame)
      (pop-to-buffer-other-window)
      (pop-to-buffer-same-frame-other-window)
      (pop-to-buffer-other-frame, switch-to-buffer-same-frame)
      (switch-to-buffer-other-window-same-frame): New functions.
      (same-window-p, special-display-p): Rewrite disabling warnings.
      Make obsolete.
      (pop-up-frames, display-buffer-reuse-frames, pop-up-windows)
      (display-buffer-mark-dedicated): Initialize to symbol 'unset.
      Make obsolete
      (same-window-buffer-names, same-window-regexps)
      (special-display-frame-alist, special-display-popup-frame)
      (special-display-function, special-display-buffer-names)
      (special-display-regexps, pop-up-frame-alist)
      (pop-up-frame-function, split-window-preferred-function)
      (split-height-threshold, split-width-threshold)
      (even-window-heights): Make obsolete.
      9481c002
  7. 12 Jun, 2011 1 commit
  8. 11 Jun, 2011 2 commits
    • Martin Rudalics's avatar
      Window configuration, balancing and fit-to-buffer rewrites. · 6198ccd0
      Martin Rudalics authored
      * window.c (delete_deletable_window): Re-add.
      (Fset_window_configuration): Rewrite to handle dead buffers and
      consequently deletable windows.
      (window_tree, Fwindow_tree): Remove.  Supply functionality in
      window.el.
      (compare_window_configurations): Simplify code.
      
      * window.el (window-tree-1, window-tree): New functions, moving
      the latter to window.el.
      (bw-get-tree, bw-get-tree-1, bw-find-tree-sub)
      (bw-find-tree-sub-1, bw-l, bw-t, bw-r, bw-b, bw-dir, bw-eqdir)
      (bw-refresh-edges): Remove.
      (balance-windows-1, balance-windows-2): New functions.
      (balance-windows): Rewrite in terms of window tree functions,
      balance-windows-1 and balance-windows-2.
      (bw-adjust-window): Remove.
      (balance-windows-area-adjust): New function with functionality of
      bw-adjust-window but using resize-window.
      (set-window-text-height): Rewrite doc-string.  Use
      normalize-live-window and resize-window.
      (enlarge-window-horizontally, shrink-window-horizontally): Rename
      argument to DELTA.
      (window-buffer-height): New function.
      (fit-window-to-buffer, shrink-window-if-larger-than-buffer):
      Rewrite using new window resize routines.
      (kill-buffer-and-window, mouse-autoselect-window-select): Use
      ignore-errors instead of condition-case.
      (quit-window): Call delete-frame instead of delete-windows-on
      for the only buffer on frame.
      6198ccd0
    • Martin Rudalics's avatar
      Move/add window-buffer-related functions to window.el. · 9397e56f
      Martin Rudalics authored
      * buffer.c: New Lisp objects Qbuffer_list_update_hook and
      Qclone_number.  Remove external declaration of Qdelete_window.
      (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
      code.
      (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
      Qbuffer_list_update_hook if allowed.
      (Fother_buffer): Rewrite doc-string.  Major rewrite for new
      buffer list implementation.
      (other_buffer_safely): New function.
      (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
      calls to replace_buffer_in_windows and
      replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
      if allowed.
      (record_buffer): Inhibit quitting and rewrite using quittable
      functions.  Run Qbuffer_list_update_hook if allowed.
      (Frecord_buffer, Funrecord_buffer): New functions.
      (switch_to_buffer_1, Fswitch_to_buffer): Remove.  Move
      switch-to-buffer to window.el.
      (bury-buffer): Move to window.el.
      (Vbuffer_list_update_hook): New variable.
      
      * lisp.h (other_buffer_safely): Add prototype in buffer.c
      section.
      
      * window.h (resize_frame_windows): Move up in code.
      (Fwindow_frame): Remove EXFUN.
      (replace_buffer_in_all_windows): Remove prototype.
      (replace_buffer_in_windows_safely): Add prototype.
      
      * window.c: Declare Qdelete_window static again.  Move down
      declaration of select_count.
      (Fnext_window, Fprevious_window): Rewrite doc-strings.
      (Fother_window): Move to window.el.
      (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
      cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
      (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
      window.el.
      (replace_buffer_in_windows): Implement by calling
      Qreplace_buffer_in_windows.
      (replace_buffer_in_all_windows): Remove with some functionality
      moved into replace_buffer_in_windows_safely.
      (replace_buffer_in_windows_safely): New function.
      (select_window_norecord, select_frame_norecord): Move in front
      of run_window_configuration_change_hook.  Remove now obsolete
      declarations.
      (Fset_window_buffer): Rewrite doc-string.  Call
      Qrecord_window_buffer.
      (keys_of_window): Move binding for other-window to window.el.
      
      * loadup.el (top-level): Load window before files for the sake
      of replace-buffer-in-windows.
      
      * files.el (read-buffer-to-switch)
      (switch-to-buffer-other-window)
      (switch-to-buffer-other-frame, display-buffer-other-frame): Move
      to window.el.
      
      * simple.el (get-next-valid-buffer, last-buffer, next-buffer)
      (previous-buffer): Move to window.el.
      
      * bindings.el (unbury-buffer): Move to window.el.
      
      * window.el (delete-other-windows-vertically): Move after
      definition of delete-other-windows.
      (other-window, delete-windows-on, replace-buffer-in-windows):
      Move here from window.c.
      (record-window-buffer, unrecord-window-buffer)
      (set-window-buffer-start-and-point, switch-to-prev-buffer)
      (switch-to-next-buffer): New functions.
      (get-next-valid-buffer, last-buffer, next-buffer): Move here
      from simple.el.  Call switch-to-next-buffer.
      (previous-buffer): Move here from simple.el.  Call
      switch-to-prev-buffer.
      (bury-buffer): Move here from buffer.c.  Switch to previous
      buffer when window cannot be deleted.
      (unbury-buffer): Move here from bindings.el.
      (ctl-x-map): Move binding for other-window from window.c to
      here.
      (read-buffer-to-switch, switch-to-buffer-other-window)
      (switch-to-buffer-other-frame): Move here from files.el.
      (normalize-buffer-to-switch-to): New functions.
      (switch-to-buffer): Move here from buffer.c.  Use
      read-buffer-to-switch and normalize-buffer-to-switch-to.
      9397e56f
  9. 10 Jun, 2011 1 commit
    • Martin Rudalics's avatar
      Move window resize code from window.c to window.el. · 562dd5e9
      Martin Rudalics authored
      * window.c: Remove declarations of Qwindow_size_fixed,
      window_min_size_1, window_min_size_2, window_min_size,
      size_window, window_fixed_size_p, enlarge_window, delete_window.
      Remove static from declaration of Qdelete_window, it's
      temporarily needed by Fbury_buffer.
      (replace_window): Don't assign orig_top_line and
      orig_total_lines.
      (Fdelete_window, delete_window): Remove.  Window deletion is
      handled by window.el.
      (window_loop): Remove DELETE_OTHER_WINDOWS case.  Replace
      Fdelete_window calls with calls to Qdelete_window.
      (Fdelete_other_windows): Remove.  Deleting other windows is
      handled by window.el.
      (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
      handled in window.el.
      (window_min_size_2, window_min_size_1, window_min_size): Remove.
      Window minimum sizes are handled in window.el.
      (shrink_windows, size_window, set_window_height)
      (set_window_width, change_window_heights, window_height)
      (window_width, CURBEG, CURSIZE, enlarge_window)
      (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
      (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
      handled in window.el.
      (make_dummy_parent): Rename to make_parent_window and give it a
      second argument horflag.
      (make_window): Don't set resize_proportionally any more.
      (Fsplit_window): Remove.  Windows are split in window.el.
      (save_restore_action, save_restore_orig_size)
      (shrink_window_lowest_first, save_restore_orig_size): Remove.
      Resize mini windows in window.el.
      (grow_mini_window, shrink_mini_window): Implement by calling
      Qresize_root_window_vertically, resize_window_check and
      resize_window_apply.
      (saved_window, Fset_window_configuration, save_window_save): Do
      not handle orig_top_line, orig_total_lines, and
      resize_proportionally.
      (window_min_height, window_min_width): Move to window.el.
      (keys_of_window): Move bindings for delete-other-windows,
      split-window, delete-window and enlarge-window to window.el.
      
      * buffer.c: Temporarily extern Qdelete_window.
      (Fbury_buffer): Temporarily call Qdelete_window instead of
      Fdelete_window (Fbury_buffer will move to window.el soon).
      
      * frame.c (set_menu_bar_lines_1): Remove code handling
      orig_top_line and orig_total_lines.
      
      * dispnew.c (adjust_frame_glyphs_initially): Don't use
      set_window_height but set heights directly.
      (change_frame_size_1): Use resize_frame_windows.
      
      * xdisp.c (init_xdisp): Don't use set_window_height but set
      heights directly.
      
      * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
      resize_frame_windows instead of change_window_heights and run
      run_window_configuration_change_hook.
      
      * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
      instead of change_window_heights and run
      run_window_configuration_change_hook.
      
      * window.el (window-min-height, window-min-width): Move here
      from window.c.  Add defcustoms and rewrite doc-strings.
      (resize-mini-window, resize-window): New functions.
      (adjust-window-trailing-edge, enlarge-window, shrink-window):
      Move here from window.c.
      (maximize-window, minimize-window): New functions.
      (delete-window, delete-other-windows, split-window): Move here
      from window.c.
      (window-split-min-size): New function.
      (split-window-keep-point): Mention split-window-above-each-other
      instead of split-window-vertically.
      (split-window-above-each-other, split-window-vertically): Rename
      split-window-vertically to split-window-above-each-other and
      provide defalias for old definition.
      (split-window-side-by-side, split-window-horizontally): Rename
      split-window-horizontally to split-window-side-by-side and provide
      defalias for the old definition.
      (ctl-x-map): Move bindings for delete-window,
      delete-other-windows and enlarge-window here from window.c.
      Replace bindings for split-window-vertically and
      split-window-horizontally by bindings for
      split-window-above-each-other and split-window-side-by-side.
      
      * cus-start.el (all): Remove entries for window-min-height and
      window-min-width.  Add entries for window-splits and
      window-nest.
      562dd5e9
  10. 09 Jun, 2011 1 commit
    • Martin Rudalics's avatar
      Final preparations in window.el for new window resize code. · 9aab8e0d
      Martin Rudalics authored
      * window.el (resize-window-reset, resize-window-reset-1)
      (resize-subwindows-skip-p, resize-subwindows-normal)
      (resize-subwindows, resize-other-windows, resize-this-window)
      (resize-root-window, resize-root-window-vertically)
      (window-deletable-p, window-or-subwindow-p)
      (frame-root-window-p): New functions.
      9aab8e0d
  11. 08 Jun, 2011 2 commits
  12. 07 Jun, 2011 2 commits
    • Martin Rudalics's avatar
      Add and rewrite window size functions in window.el. · a1511caf
      Martin Rudalics authored
      * window.el (window-safe-min-height, window-safe-min-width):
      New constants.
      (window-size-ignore, window-min-size, window-min-size-1)
      (window-sizable, window-sizable-p, window-size-fixed-1)
      (window-size-fixed-p, window-min-delta-1, window-min-delta)
      (window-max-delta-1, window-max-delta, window-resizable)
      (window-resizable-p, window-total-height, window-total-width)
      (window-body-width): New functions.
      (window-full-height-p, window-full-width-p): Rewrite using
      window-total-size.
      (window-body-height): Rewrite using window-body-size.
      a1511caf
    • Martin Rudalics's avatar
      Move get-lru-window and get-largest-window to window.el. · 190b47e6
      Martin Rudalics authored
      * window.c (window_loop): Remove handling of GET_LRU_WINDOW and
      GET_LARGEST_WINDOW.
      (Fget_lru_window, Fget_largest_window): Move to window.el.
      
      * window.el (get-lru-window, get-largest-window): Move here from
      window.c.  Rename first argument to ALL-FRAMES.  Rephrase
      doc-strings.
      (get-buffer-window-list): Rewrite using window-list-1.  Rephrase
      doc-string.
      190b47e6
  13. 06 Jun, 2011 1 commit
    • Martin Rudalics's avatar
      Add window-tree based, atomic and side window functions to window.el. · 85cc1f11
      Martin Rudalics authored
      * window.el (window-right, window-left, window-child)
      (window-child-count, window-last-child, window-any-p)
      (normalize-live-buffer, normalize-live-frame)
      (normalize-any-window, normalize-live-window)
      (window-iso-combination-p, window-iso-combined-p)
      (window-iso-combinations)
      (walk-window-tree-1, walk-window-tree, walk-window-subtree)
      (windows-with-parameter, window-with-parameter)
      (window-atom-root, make-window-atom, window-atom-check-1)
      (window-atom-check, window-side-check, window-check): New
      functions.
      (ignore-window-parameters, window-sides, window-sides-vertical)
      (window-sides-slots): New variables.
      (window-size-fixed): Move down in code.  Minor doc-string fix.
      85cc1f11
  14. 19 Apr, 2011 1 commit
  15. 06 Mar, 2011 1 commit
  16. 25 Jan, 2011 1 commit
  17. 15 Jan, 2011 1 commit
  18. 02 Jan, 2011 1 commit
  19. 26 Sep, 2010 1 commit
  20. 30 Aug, 2010 1 commit
    • Stefan Monnier's avatar
      Use `declare' in defmacros. · f291fe60
      Stefan Monnier authored
      * lisp/window.el (save-selected-window):
      * lisp/subr.el (with-temp-file, with-temp-message, with-syntax-table):
      * lisp/progmodes/python.el (def-python-skeleton):
      * lisp/net/dbus.el (dbus-ignore-errors):
      * lisp/jka-cmpr-hook.el (with-auto-compression-mode):
      * lisp/international/mule.el (with-category-table):
      * lisp/emacs-lisp/timer.el (with-timeout):
      * lisp/emacs-lisp/lisp-mnt.el (lm-with-file):
      * lisp/emacs-lisp/eieio.el (with-slots):
      * lisp/emacs-lisp/easymenu.el (easy-menu-define):
      * lisp/emacs-lisp/debug.el (debugger-env-macro):
      * lisp/emacs-lisp/cl-compat.el (Multiple-value-bind, Multiple-value-setq)
      (Multiple-value-call, Multiple-value-prog1):
      * lisp/emacs-lisp/cl-seq.el (cl-parsing-keywords, cl-check-key)
      (cl-check-test-nokey, cl-check-test, cl-check-match): Move indent and
      edebug rule to definition.
      * lisp/emacs-lisp/lisp-mode.el (save-selected-window)
      (with-current-buffer, combine-after-change-calls)
      (with-output-to-string, with-temp-file, with-temp-buffer)
      (with-temp-message, with-syntax-table, read-if, eval-after-load)
      (dolist, dotimes, when, unless):
      * lisp/emacs-lisp/byte-run.el (inline): Remove indent rule, redundant.
      f291fe60
  21. 29 Aug, 2010 1 commit
  22. 07 Jun, 2010 1 commit
  23. 16 Apr, 2010 1 commit
    • Juri Linkov's avatar
      Move scrolling commands from simple.el to window.el · 74f806a1
      Juri Linkov authored
      because their primitives are implemented in window.c.
      
      * simple.el (scroll-error-top-bottom)
      (scroll-up-command, scroll-down-command, scroll-up-line)
      (scroll-down-line, scroll-other-window-down)
      (beginning-of-buffer-other-window, end-of-buffer-other-window):
      * window.el (scroll-error-top-bottom)
      (scroll-up-command, scroll-down-command, scroll-up-line)
      (scroll-down-line, scroll-other-window-down)
      (beginning-of-buffer-other-window, end-of-buffer-other-window):
      Move from simple.el to window.el because their primitives are
      implemented in window.c.
      74f806a1
  24. 14 Jan, 2010 1 commit
  25. 13 Jan, 2010 1 commit
  26. 01 Dec, 2009 2 commits
  27. 29 Nov, 2009 1 commit