diff options
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/src/lisp.h b/src/lisp.h index 361a3f63b28..0281c483e32 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -368,6 +368,11 @@ typedef EMACS_INT Lisp_Word; ((ok) ? (void) 0 : wrong_type_argument (predicate, x)) #define lisp_h_CONSP(x) TAGGEDP (x, Lisp_Cons) #define lisp_h_BASE_EQ(x, y) (XLI (x) == XLI (y)) +#define lisp_h_BASE2_EQ(x, y) \ + (BASE_EQ (x, y) \ + || (symbols_with_pos_enabled \ + && SYMBOL_WITH_POS_P (x) \ + && BASE_EQ (XSYMBOL_WITH_POS (x)->sym, y))) /* FIXME: Do we really need to inline the whole thing? * What about keeping the part after `symbols_with_pos_enabled` in @@ -453,6 +458,7 @@ typedef EMACS_INT Lisp_Word; # define CHECK_TYPE(ok, predicate, x) lisp_h_CHECK_TYPE (ok, predicate, x) # define CONSP(x) lisp_h_CONSP (x) # define BASE_EQ(x, y) lisp_h_BASE_EQ (x, y) +# define BASE2_EQ(x, y) lisp_h_BASE2_EQ (x, y) # define FLOATP(x) lisp_h_FLOATP (x) # define FIXNUMP(x) lisp_h_FIXNUMP (x) # define NILP(x) lisp_h_NILP (x) @@ -1323,6 +1329,14 @@ INLINE bool return lisp_h_BASE_EQ (x, y); } +/* Return true if X and Y are the same object, reckoning X to be the + same as a bare symbol Y if X is Y with position. */ +INLINE bool +(BASE2_EQ) (Lisp_Object x, Lisp_Object y) +{ + return lisp_h_BASE2_EQ (x, y); +} + /* Return true if X and Y are the same object, reckoning a symbol with position as being the same as the bare symbol. */ INLINE bool @@ -1631,13 +1645,13 @@ STRING_MULTIBYTE (Lisp_Object str) /* Mark STR as a multibyte string. Assure that STR contains only ASCII characters in advance. */ -#define STRING_SET_MULTIBYTE(STR) \ - do { \ - if (XSTRING (STR)->u.s.size == 0) \ - (STR) = empty_multibyte_string; \ - else \ - XSTRING (STR)->u.s.size_byte = XSTRING (STR)->u.s.size; \ - } while (false) +INLINE void +STRING_SET_MULTIBYTE (Lisp_Object str) +{ + /* The 0-length strings are unique&shared so we can't modify them. */ + eassert (XSTRING (str)->u.s.size > 0); + XSTRING (str)->u.s.size_byte = XSTRING (str)->u.s.size; +} /* Convenience functions for dealing with Lisp strings. */ @@ -3137,7 +3151,7 @@ CHECK_NUMBER (Lisp_Object x) INLINE void CHECK_INTEGER (Lisp_Object x) { - CHECK_TYPE (INTEGERP (x), Qnumberp, x); + CHECK_TYPE (INTEGERP (x), Qintegerp, x); } INLINE void @@ -3442,7 +3456,7 @@ union specbinding #define WRAP_SPECPDL_REF 1 #endif -/* Abstract reference to to a specpdl entry. +/* Abstract reference to a specpdl entry. The number is always a multiple of sizeof (union specbinding). */ #ifdef WRAP_SPECPDL_REF /* Use a proper type for specpdl_ref if it does not make the code slower, @@ -3784,10 +3798,10 @@ make_symbol_constant (Lisp_Object sym) /* Buffer-local variable access functions. */ -INLINE int +INLINE bool blv_found (struct Lisp_Buffer_Local_Value *blv) { - eassert (blv->found == !EQ (blv->defcell, blv->valcell)); + eassert (blv->found == !BASE_EQ (blv->defcell, blv->valcell)); return blv->found; } @@ -3902,10 +3916,14 @@ integer_to_uintmax (Lisp_Object num, uintmax_t *n) typedef intmax_t modiff_count; INLINE modiff_count -modiff_incr (modiff_count *a) -{ - modiff_count a0 = *a; - bool modiff_overflow = INT_ADD_WRAPV (a0, 1, a); +modiff_incr (modiff_count *a, ptrdiff_t len) +{ + modiff_count a0 = *a; int incr = len ? 1 : 0; + /* Increase the counter more for a large modification and less for a + small modification. Increase it logarithmically to avoid + increasing it too much. */ + while (len >>= 1) incr++; + bool modiff_overflow = INT_ADD_WRAPV (a0, incr, a); eassert (!modiff_overflow && *a >> 30 >> 30 == 0); return a0; } @@ -4025,6 +4043,10 @@ extern ptrdiff_t string_char_to_byte (Lisp_Object, ptrdiff_t); extern ptrdiff_t string_byte_to_char (Lisp_Object, ptrdiff_t); extern Lisp_Object string_to_multibyte (Lisp_Object); extern Lisp_Object string_make_unibyte (Lisp_Object); +extern Lisp_Object plist_get (Lisp_Object plist, Lisp_Object prop); +extern Lisp_Object plist_put (Lisp_Object plist, Lisp_Object prop, + Lisp_Object val); +extern Lisp_Object plist_member (Lisp_Object plist, Lisp_Object prop); extern void syms_of_fns (void); /* Defined in sort.c */ @@ -4513,6 +4535,7 @@ extern Lisp_Object Vrun_hooks; extern Lisp_Object Vsignaling_function; extern Lisp_Object inhibit_lisp_code; extern bool signal_quit_p (Lisp_Object); +extern bool backtrace_yet; /* To run a normal hook, use the appropriate function from the list below. The calling convention: @@ -4662,6 +4685,7 @@ extern void save_restriction_restore (Lisp_Object); extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool); extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool); +extern Lisp_Object narrow_to_region_internal (Lisp_Object, Lisp_Object, bool); extern void init_editfns (void); extern void syms_of_editfns (void); @@ -4720,6 +4744,7 @@ extern bool internal_delete_file (Lisp_Object); extern Lisp_Object check_emacs_readlinkat (int, Lisp_Object, char const *); extern bool file_directory_p (Lisp_Object); extern bool file_accessible_directory_p (Lisp_Object); +extern Lisp_Object buffer_visited_file_modtime (struct buffer *); extern void init_fileio (void); extern void syms_of_fileio (void); @@ -4748,6 +4773,8 @@ extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *, ptrdiff_t); extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); +extern ptrdiff_t find_newline1 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, + ptrdiff_t, ptrdiff_t *, ptrdiff_t *, bool); extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, bool); extern void scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, @@ -4809,6 +4836,8 @@ extern bool detect_input_pending (void); extern bool detect_input_pending_ignore_squeezables (void); extern bool detect_input_pending_run_timers (bool); extern void safe_run_hooks (Lisp_Object); +extern void safe_run_hooks_maybe_narrowed (Lisp_Object, struct window *); +extern void safe_run_hooks_2 (Lisp_Object, Lisp_Object, Lisp_Object); extern void cmd_error_internal (Lisp_Object, const char *); extern Lisp_Object command_loop_2 (Lisp_Object); extern Lisp_Object read_menu_command (void); @@ -4828,7 +4857,7 @@ extern void syms_of_indent (void); /* Defined in frame.c. */ extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object); -extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object); +extern Lisp_Object do_switch_frame (Lisp_Object, int, Lisp_Object); extern Lisp_Object get_frame_param (struct frame *, Lisp_Object); extern void frames_discard_buffer (Lisp_Object); extern void init_frame_once (void); @@ -4921,7 +4950,8 @@ extern void setup_process_coding_systems (Lisp_Object); #endif extern int emacs_spawn (pid_t *, int, int, int, char **, char **, - const char *, const char *, const sigset_t *); + const char *, const char *, bool, bool, + const sigset_t *); extern char **make_environment_block (Lisp_Object) ATTRIBUTE_RETURNS_NONNULL; extern void init_callproc_1 (void); extern void init_callproc (void); |