X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/093571c374d671607c822dd2e5bedb2ac877ea91..545312c25170f52cab978bcf3fca267896a747d2:/src/buffer.h diff --git a/src/buffer.h b/src/buffer.h index 87d646f35f..992bc8ffca 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -5,10 +5,10 @@ This file is part of GNU Emacs. -GNU Emacs is free software; you can redistribute it and/or modify +GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,9 +16,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GNU Emacs. If not, see . */ /* Accessing the parameters of the current buffer. */ @@ -208,24 +206,22 @@ Boston, MA 02110-1301, USA. */ /* Macros to set PT in the current buffer, or another buffer. */ -#define SET_PT(position) (set_point (current_buffer, (position))) +#define SET_PT(position) (set_point (position)) #define TEMP_SET_PT(position) (temp_set_point (current_buffer, (position))) -#define SET_PT_BOTH(position, byte) \ - (set_point_both (current_buffer, (position), (byte))) +#define SET_PT_BOTH(position, byte) (set_point_both (position, byte)) #define TEMP_SET_PT_BOTH(position, byte) \ (temp_set_point_both (current_buffer, (position), (byte))) -#define BUF_SET_PT(buffer, position) \ - (set_point ((buffer), (position))) #define BUF_TEMP_SET_PT(buffer, position) \ (temp_set_point ((buffer), (position))) -extern void set_point P_ ((struct buffer *, int)); -extern INLINE void temp_set_point P_ ((struct buffer *, int)); -extern void set_point_both P_ ((struct buffer *, int, int)); -extern INLINE void temp_set_point_both P_ ((struct buffer *, int, int)); -extern void enlarge_buffer_text P_ ((struct buffer *, int)); +extern void set_point P_ ((EMACS_INT)); +extern INLINE void temp_set_point P_ ((struct buffer *, EMACS_INT)); +extern void set_point_both P_ ((EMACS_INT, EMACS_INT)); +extern INLINE void temp_set_point_both P_ ((struct buffer *, + EMACS_INT, EMACS_INT)); +extern void enlarge_buffer_text P_ ((struct buffer *, EMACS_INT)); /* Macros for setting the BEGV, ZV or PT of a given buffer. @@ -266,7 +262,7 @@ extern void enlarge_buffer_text P_ ((struct buffer *, int)); and store the charpos in CHARPOS and the bytepos in BYTEPOS. */ #define DECODE_POSITION(charpos, bytepos, pos) \ -if (1) \ +do \ { \ Lisp_Object __pos = (pos); \ if (NUMBERP (__pos)) \ @@ -282,7 +278,7 @@ if (1) \ else \ wrong_type_argument (Qinteger_or_marker_p, __pos); \ } \ -else +while (0) /* Return the address of byte position N in current buffer. */ @@ -343,7 +339,7 @@ extern unsigned char *_fetch_multibyte_char_p; #define FETCH_CHAR_AS_MULTIBYTE(pos) \ (!NILP (current_buffer->enable_multibyte_characters) \ ? FETCH_MULTIBYTE_CHAR ((pos)) \ - : unibyte_char_to_multibyte (FETCH_BYTE ((pos)))) + : unibyte_to_multibyte_table[(FETCH_BYTE ((pos)))]) /* Macros for accessing a character or byte, @@ -562,6 +558,10 @@ struct buffer /* Position where the overlay lists are centered. */ EMACS_INT overlay_center; + /* Everything from here down must be a Lisp_Object. */ + /* buffer-local Lisp variables start at `undo_list', + tho only the ones from `name' on are GC'd normally. */ + /* Changes in the buffer are recorded here for undo. t means don't record anything. This information belongs to the base buffer of an indirect buffer, @@ -571,8 +571,6 @@ struct buffer This comes before `name' because it is marked in a special way. */ Lisp_Object undo_list; - /* Everything from here down must be a Lisp_Object. */ - /* The name of this buffer. */ Lisp_Object name; @@ -652,6 +650,8 @@ struct buffer /* Non-nil means do not display continuation lines. */ Lisp_Object truncate_lines; + /* Non-nil means to use word wrapping when displaying continuation lines. */ + Lisp_Object word_wrap; /* Non-nil means display ctl chars with uparrow. */ Lisp_Object ctl_arrow; /* Non-nil means display text from right to left. */ @@ -832,7 +832,9 @@ extern struct buffer buffer_local_symbols; extern void delete_all_overlays P_ ((struct buffer *)); extern void reset_buffer P_ ((struct buffer *)); extern void evaporate_overlays P_ ((EMACS_INT)); -extern int overlays_at P_ ((EMACS_INT, int, Lisp_Object **, int *, int *, int *, int)); +extern int overlays_at P_ ((EMACS_INT pos, int extend, Lisp_Object **vec_ptr, + int *len_ptr, EMACS_INT *next_ptr, + EMACS_INT *prev_ptr, int change_req)); extern int sort_overlays P_ ((Lisp_Object *, int, struct window *)); extern void recenter_overlay_lists P_ ((struct buffer *, EMACS_INT)); extern int overlay_strings P_ ((EMACS_INT, struct window *, unsigned char **)); @@ -864,6 +866,7 @@ extern void mmap_set_vars P_ ((int)); } \ } while (0) +EXFUN (Fbuffer_list, 1); EXFUN (Fbuffer_live_p, 1); EXFUN (Fbuffer_name, 1); EXFUN (Fget_file_buffer, 1);