aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Spelling fixes.Paul Eggert2011-11-261-2/+2
|
* In Fkill_buffer do replace_buffer_in_windows before Fset_buffer. (Bug#10114)Martin Rudalics2011-11-231-2/+7
| | | | | * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before making another buffer current. (Bug#10114)
* Fix typos.Juanma Barranquero2011-11-201-1/+1
|
* Spelling fixes.Paul Eggert2011-11-191-1/+1
|
* Spelling fixes.Paul Eggert2011-11-141-1/+1
|
* * src/buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don'tStefan Monnier2011-10-071-3/+1
| | | | advertise functionality which we discourage or doesn't work.
* * buffer.h (struct buffer): Use time_t, not int, for a time stamp.Paul Eggert2011-09-301-1/+1
| | | | | | | | | This fixes a Y2038 bug on 64-bit hosts. * buffer.c (reset_buffer): * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved) (Fclear_buffer_auto_save_failure): Use 0, not -1, to represent an unset failure time, since time_t might not be signed.
* * src/buffer.c (truncate-lines): Doc fix.Glenn Morris2011-09-241-1/+3
|
* Merge from trunk.Paul Eggert2011-08-251-22/+10
|\
| * Delete record-buffer, and rename unrecord-buffer to bury-buffer-internal.Chong Yidong2011-08-241-22/+10
| | | | | | | | | | | | | | | | * lisp/window.el (bury-buffer, quit-window): Use bury-buffer-internal. * src/buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer. Change return value to nil. (Frecord_buffer): Delete unused function.
* | * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,Paul Eggert2011-08-151-1/+1
| | | | | | | | since either will do and ptrdiff_t is convenient with xpalloc.
* | Adjust in response to jan.h.d's comments.Paul Eggert2011-08-041-39/+25
| | | | | | | | See, for example <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#26>.
* | Merge from trunk.Paul Eggert2011-07-281-1/+1
|\ \ | |/
| * src/buffer.c: Fix last change.Eli Zaretskii2011-07-281-1/+1
| |
| * Turn on bidi-display-reordering by default.Eli Zaretskii2011-07-281-2/+2
| | | | | | | | | | | | | | | | | | src/buffer.c (init_buffer_once, syms_of_buffer): Set bidi-display-reordering to t by default. doc/emacs/mule.texi (Bidirectional Editing): Document the fact that bidi-display-reordering is t by default. lispref/display.texi (Bidirectional Display): Document the fact that bidi-display-reordering is t by default.
* | * buffer.c: Memory overflow fixes.Paul Eggert2011-07-281-12/+9
|/ | | | | | (overlays_at, overlays_in, record_overlay_string, overlay_strings): Don't update size of array until after memory allocation succeeds, because xmalloc/xrealloc may not return.
* Merge from trunk.Paul Eggert2011-07-131-1/+1
|\
| * src/buffer.c (mmap_find): Fix a typo.Eli Zaretskii2011-07-131-1/+1
| |
* | Merge from trunk.Paul Eggert2011-07-121-0/+1
|\ \ | |/
| * * buffer.c (Fget_buffer_create): Initialized inhibit_shrinking.Paul Eggert2011-07-121-0/+1
| | | | | | | | The old code sometimes used this field without initializing it.
* | Merge from trunk.Paul Eggert2011-07-101-68/+47
|\ \ | |/
| * ProtoizeAndreas Schwab2011-07-101-68/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge) (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Protoize. * src/data.c (fmod): Likewise. * src/dispnew.c (swap_glyphs_in_rows): Likewise. * src/emacs.c (memory_warning_signal): Likewise. * src/floatfns.c (float_error): Likewise. * src/font.c (check_gstring, check_otf_features, otf_tag_symbol) (otf_open, font_otf_capability, generate_otf_features) (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): Likewise. * src/image.c (pbm_read_file): Likewise. * src/indent.c (string_display_width): Likewise. * src/intervals.c (check_for_interval, search_for_interval) (inc_interval_count, count_intervals, root_interval) (adjust_intervals_for_insertion, make_new_interval): Likewise. * src/lread.c (defalias): Likewise. * src/regex.c (set_image_of_range_1, set_image_of_range) (regex_grow_registers): Likewise. * src/sysdep.c (strerror): Likewise. * src/termcap.c (valid_filename_p, tprint, main): Likewise. * src/tparam.c (main): Likewise. * src/unexhp9k800.c (run_time_remap, save_data_space) (update_file_ptrs, read_header, write_header, calculate_checksum) (copy_file, copy_rest, display_header): Likewise. * src/widget.c (mark_shell_size_user_specified, create_frame_gcs): Likewise. * src/xdisp.c (check_it): Likewise. * src/xfaces.c (register_color, unregister_color, unregister_colors): Likewise. * src/xfns.c (print_fontset_result): Likewise. * src/xrdb.c (member, fatal, main): Likewise.
* | * buffer.c: Integer signedness fixes.Paul Eggert2011-07-071-4/+4
|/ | | | | | (alloc_buffer_text, enlarge_buffer_text): Use ptrdiff_t rather than size_t when either will do, as we prefer signed integers.
* Remove more assumptions re struct layout (Bug#8884).Paul Eggert2011-07-061-4/+4
|
* Remove unportable assumption about struct layout (Bug#8884).Paul Eggert2011-07-061-2/+2
| | | | | | | | | * buffer.c (clone_per_buffer_values): Don't assume that sizeof (struct buffer) is a multiple of sizeof (Lisp_Object). This isn't true in general, and it's particularly not true if Emacs is configured with --with-wide-int. * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): New macros, used in the buffer.c change.
* * buffer.c (Foverlay_put): Say what the return value isLars Magne Ingebrigtsen2011-07-041-1/+2
| | | | (bug#7835).
* Remove clone-number support. Provide clone-of parameter in window states.Martin Rudalics2011-07-021-17/+6
| | | | | | | | | | | | | | | | * window.h (window): Remove clone_number slot. * window.c (Fwindow_clone_number, Fset_window_clone_number): Remove. (make_parent_window, make_window, saved_window) (Fset_window_configuration, save_window_save): Don't deal with clone numbers. * buffer.c (Qclone_number): Remove declaration. (sort_overlays, overlay_strings): Don't deal with clone numbers. * window.el (window-state-get-1): Don't assign clone numbers. Add clone-of item to list of window parameters. (window-state-put-2): Don't process clone numbers. (display-buffer-alist): Fix doc-string.
* Have overlays with window property respect clone numbers.Martin Rudalics2011-06-271-6/+17
| | | | | | | * buffer.c (Qclone_number): Declare static and DEFSYM it. (sort_overlays, overlay_strings): When an overlay's clone number matches the window's clone number process the overlay even if the overlay's window property doesn't match the current window.
* Move DEFSYM to lisp.h and use everywhere.Juanma Barranquero2011-06-241-33/+18
|
* * buffer.c (OVERLAY_COUNT_MAX): New macro.Paul Eggert2011-06-211-17/+19
| | | | | | (overlays_in, mouse_face_overlay_overlaps, Foverlays_in): Use ptrdiff_t, not int, for sizes. (overlays_in): Check for size-calculation overflow.
* Use ptrdiff_t, not int, for overlay counts.Paul Eggert2011-06-211-19/+19
| | | | | | | | | | | | * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT): * editfns.c (overlays_around, get_pos_property): * textprop.c (get_char_property_and_overlay): * xdisp.c (next_overlay_change, note_mouse_highlight): * xfaces.c (face_at_buffer_position): * buffer.c (overlays_at, sort_overlays, Foverlays_at) (Fnext_overlay_change, Fprevious_overlay_change): Use ptrdiff_t, not int, for sizes. (overlays_at): Check for size-calculation overflow.
* * buffer.c (init_buffer): Don't assume string length fits in 'int'.Paul Eggert2011-06-191-1/+1
|
* * buffer.c: Include <verify.h>.Paul Eggert2011-06-171-1/+3
| | | | (init_buffer_once): Check at compile-time, not run-time.
* * buffer.c (record_overlay_string): Check for size-calculation overflow.Paul Eggert2011-06-171-3/+6
| | | | (struct sortstrlist.size, struct sortlist.used): Don't truncate size to int.
* * buffer.c (struct sortstr.size, record_overlay_string): Don't truncate size ↵Paul Eggert2011-06-171-2/+3
| | | | to int.
* * buffer.c (compare_overlays, cmp_for_strings): Avoid subtraction overflow.Paul Eggert2011-06-171-5/+5
|
* * buffer.c (struct sortstr.priority): Now EMACS_INT, not int.Paul Eggert2011-06-171-1/+1
|
* * buffer.c (struct sortvec.priority): Now EMACS_INT, not int.Paul Eggert2011-06-171-1/+1
|
* Merge from trunk.Paul Eggert2011-06-131-257/+195
|\
| * * buffer.c (Qclone_number): Remove for now, as it's unused.Paul Eggert2011-06-111-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (record_buffer, Funrecord_buffer): Rename local to avoid shadowing. (record_buffer): Remove unused local. * frame.c (other_visible_frames, frame_buffer_list): Now static. (set_frame_buffer_list): Remove; unused. * frame.h (other_visible_frames): Remove decl. * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF. * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls. (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only if HAVE_GPM. * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF. * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Define only if HAVE_GPM. * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static. (update_hints_inhibit): Remove; never set. All uses removed. * widgetprv.h (emacsFrameClassRec): Remove decl. * window.c (delete_deletable_window): Now returns void, since it wasn't returning anything. (compare_window_configurations): Remove unused locals. * xfns.c (x_set_scroll_bar_default_width): Remove unused locals. * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF. Omit no-longer-needed #ifdef USE_X_TOOLKIT, since USE_X_TOOLKIT is implied by USE_GTK || USE_MOTIF. (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers the same widths as pointers. This follows up on the 2011-05-06 patch. * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID. * xterm.h: Likewise. (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
| * Move/add window-buffer-related functions to window.el.Martin Rudalics2011-06-111-258/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge from trunk.Paul Eggert2011-06-101-1/+3
|\ \ | |/
| * Move window resize code from window.c to window.el.Martin Rudalics2011-06-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | * buffer.c (advance_to_char_boundary): Return EMACS_INT, not int.Paul Eggert2011-06-081-1/+1
| |
* | * buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int.Paul Eggert2011-06-081-3/+3
|/
* [ChangeLog]Paul Eggert2011-05-301-3/+3
| | | | | | | | | | | | | | Malloc failure behavior now depends on size of allocation. * lib/allocator.h (struct allocator.die): New size arg. * lib/careadlinkat.c (careadlinkat): Pass size to 'die' function. If the actual problem is an ssize_t limitation, not a size_t or malloc failure, fail with errno == ENAMETOOLONG instead of calling 'die'. [src/ChangeLog] Malloc failure behavior now depends on size of allocation. * alloc.c (buffer_memory_full, memory_full): New arg NBYTES. * lisp.h: Change signatures accordingly. * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c: All callers changed.
* * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing changePaul Eggert2011-04-271-1/+1
|
* Merge from mainline.Paul Eggert2011-04-251-1/+2
|\
| * Merge from emacs-23; up to 2010-06-09T17:54:28Z!albinus@detlef.Glenn Morris2011-04-221-1/+2
| |\