comparison src/buffer.c @ 95590:9a4b27c8feec

* window.el (display-buffer-function, special-display-p) (special-display-buffer-names, special-display-regexps) (special-display-function, same-window-p, same-window-buffer-names) (same-window-regexps, pop-up-frames, display-buffer-reuse-frames) (pop-up-frame-function, pop-up-windows) (split-window-preferred-function, split-height-threshold) (split-width-threshold, window--splittable-p) (window--try-to-split-window, window--frame-usable-p) (even-window-heights, window--even-window-heights) (window--display-buffer-1, window--display-buffer-2, display-buffer) (pop-to-buffer): Move from window.c and buffer.c. (split-window-preferred-horizontally): Remove. * cus-start.el: Remove corresponding declarations. * window.c (pop_up_windows, pop_up_frames) (display_buffer_reuse_frames, Vpop_up_frame_function) (Vdisplay_buffer_function, Veven_window_heights) (Vspecial_display_buffer_names, Vspecial_display_regexps) (Vspecial_display_function, Vsame_window_buffer_names) (Vsame_window_regexps, split_height_threshold) (Vsplit_window_preferred_function): Move those vars to window.el. (display_buffer_1, Fspecial_display_p, Fsame_window_p) (Fdisplay_buffer): Move those functions to window.el. (syms_of_window): Remove corresponding declarations. (display_buffer): New function. (temp_output_buffer_show, Fother_window_for_scrolling): Use it. * dispnew.c (Flast_nonminibuf_frame): New function. * buffer.c (Fpop_to_buffer): Move to window.el.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 05 Jun 2008 18:00:36 +0000
parents 0835cb21d60e
children 54e76878a8c0
comparison
equal deleted inserted replaced
95589:4f530a89d1ee 95590:9a4b27c8feec
1807 /* If can't display in current window, let pop-to-buffer 1807 /* If can't display in current window, let pop-to-buffer
1808 try some other window. */ 1808 try some other window. */
1809 return call3 (intern ("pop-to-buffer"), buffer, Qnil, norecord); 1809 return call3 (intern ("pop-to-buffer"), buffer, Qnil, norecord);
1810 1810
1811 return switch_to_buffer_1 (buffer, norecord); 1811 return switch_to_buffer_1 (buffer, norecord);
1812 }
1813
1814 DEFUN ("pop-to-buffer", Fpop_to_buffer, Spop_to_buffer, 1, 3, 0,
1815 doc: /* Select buffer BUFFER in some window, preferably a different one.
1816 BUFFER may be a buffer, a string \(a buffer name), or nil.
1817 If BUFFER is a string which is not the name of an existing buffer,
1818 then this function creates a buffer with that name.
1819 If BUFFER is nil, then it chooses some other buffer.
1820 If `pop-up-windows' is non-nil, windows can be split to do this.
1821 If optional second arg OTHER-WINDOW is non-nil, insist on finding another
1822 window even if BUFFER is already visible in the selected window,
1823 and ignore `same-window-regexps' and `same-window-buffer-names'.
1824 This function returns the buffer it switched to.
1825 This uses the function `display-buffer' as a subroutine; see the documentation
1826 of `display-buffer' for additional customization information.
1827
1828 Optional third arg NORECORD non-nil means
1829 do not put this buffer at the front of the list of recently selected ones. */)
1830 (buffer, other_window, norecord)
1831 Lisp_Object buffer, other_window, norecord;
1832 {
1833 register Lisp_Object buf;
1834 if (NILP (buffer))
1835 buf = Fother_buffer (Fcurrent_buffer (), Qnil, Qnil);
1836 else
1837 {
1838 buf = Fget_buffer (buffer);
1839 if (NILP (buf))
1840 {
1841 buf = Fget_buffer_create (buffer);
1842 Fset_buffer_major_mode (buf);
1843 }
1844 }
1845 Fset_buffer (buf);
1846 Fselect_window (Fdisplay_buffer (buf, other_window, Qnil), norecord);
1847 return buf;
1848 } 1812 }
1849 1813
1850 DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, 1814 DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0,
1851 doc: /* Return the current buffer as a Lisp object. */) 1815 doc: /* Return the current buffer as a Lisp object. */)
1852 () 1816 ()
6267 defsubr (&Sother_buffer); 6231 defsubr (&Sother_buffer);
6268 defsubr (&Sbuffer_enable_undo); 6232 defsubr (&Sbuffer_enable_undo);
6269 defsubr (&Skill_buffer); 6233 defsubr (&Skill_buffer);
6270 defsubr (&Sset_buffer_major_mode); 6234 defsubr (&Sset_buffer_major_mode);
6271 defsubr (&Sswitch_to_buffer); 6235 defsubr (&Sswitch_to_buffer);
6272 defsubr (&Spop_to_buffer);
6273 defsubr (&Scurrent_buffer); 6236 defsubr (&Scurrent_buffer);
6274 defsubr (&Sset_buffer); 6237 defsubr (&Sset_buffer);
6275 defsubr (&Sbarf_if_buffer_read_only); 6238 defsubr (&Sbarf_if_buffer_read_only);
6276 defsubr (&Sbury_buffer); 6239 defsubr (&Sbury_buffer);
6277 defsubr (&Serase_buffer); 6240 defsubr (&Serase_buffer);