aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd2022-06-16 14:11:03 +0200
committerMattias EngdegÄrd2022-06-16 14:49:58 +0200
commit946d70a8910a827d74a384ff6421b9e952e0df2e (patch)
tree455daa0feaa6cd7edf01a14a697bf7be5d77d0b2 /src/buffer.c
parentdecb64fd835ef1740d720ff877788eb0626737b5 (diff)
downloademacs-946d70a8910a827d74a384ff6421b9e952e0df2e.tar.gz
emacs-946d70a8910a827d74a384ff6421b9e952e0df2e.zip
Use BASE_EQ instead of EQ where obviously safe
* src/alloc.c (deadp): * src/buffer.c (reset_buffer_local_variables, candidate_buffer) (Fkill_buffer, Fbuffer_swap_text, Fmake_overlay, Fmove_overlay): * src/callint.c (Fcall_interactively): * src/coding.c (decode_coding_object, encode_coding_object) (code_convert_region, Ffind_operation_coding_system): * src/comp.c (Fcomp_el_to_eln_rel_filename): * src/conf_post.h (RE_TRANSLATE_P): * src/data.c (Fkill_local_variable, Fash, expt_integer): * src/dired.c (file_name_completion): * src/dispnew.c (set_window_cursor_after_update, update_frame_1) (Fframe_or_buffer_changed_p): * src/doc.c (Fdocumentation, Fdocumentation_property) (default_to_grave_quoting_style): * src/editfns.c (Fconstrain_to_field, save_excursion_save) (save_excursion_restore, Fngettext): * src/eval.c (Fautoload, un_autoload, specbind): * src/fileio.c (Fmake_temp_file_internal): * src/fns.c (string_char_to_byte, string_byte_to_char) (Fnthcdr, Fnreverse): * src/indent.c (vmotion): * src/inotify.c (add_watch): * src/keyboard.c (command_loop_1, read_char) (read_char_minibuf_menu_prompt): * src/lread.c (oblookup): * src/macfont.m (macfont_descriptor_entity, macfont_open): * src/minibuf.c (Finnermost_minibuffer_p, Ftry_completion) (Ftest_completion): * src/nsfns.m (ns_set_icon_name): * src/pdumper.c (dump_queue_dequeue): * src/pgtkfns.c (pgtk_set_icon_type, pgtk_set_icon_name): * src/process.c (Faccept_process_output): * src/textprop.c (set_text_properties): * src/w32fns.c (w32_set_icon_type, w32_set_icon_name): * src/w32select.c (validate_coding_system): * src/window.c (decode_next_window_args, window_loop) (save_window_save): * src/xdisp.c (wset_redisplay): * src/xfaces.c (Fx_family_fonts, resolve_face_name) (gui_supports_face_attributes_p): * src/xfns.c (x_set_icon_type, x_set_icon_name): * src/xselect.c (clean_local_selection_data): Use BASE_EQ instead of EQ where it is obvious that neither argument can be a symbol with properties or at least one argument is a non-symbol.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/buffer.c b/src/buffer.c
index a0761f5b59a..7adcd22d88b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1065,7 +1065,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
1065 eassert (XSYMBOL (sym)->u.s.redirect == SYMBOL_LOCALIZED); 1065 eassert (XSYMBOL (sym)->u.s.redirect == SYMBOL_LOCALIZED);
1066 /* Need not do anything if some other buffer's binding is 1066 /* Need not do anything if some other buffer's binding is
1067 now cached. */ 1067 now cached. */
1068 if (EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer)) 1068 if (BASE_EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer))
1069 { 1069 {
1070 /* Symbol is set up for this buffer's old local value: 1070 /* Symbol is set up for this buffer's old local value:
1071 swap it out! */ 1071 swap it out! */
@@ -1607,7 +1607,7 @@ This does not change the name of the visited file (if any). */)
1607static bool 1607static bool
1608candidate_buffer (Lisp_Object b, Lisp_Object buffer) 1608candidate_buffer (Lisp_Object b, Lisp_Object buffer)
1609{ 1609{
1610 return (BUFFERP (b) && !EQ (b, buffer) 1610 return (BUFFERP (b) && !BASE_EQ (b, buffer)
1611 && BUFFER_LIVE_P (XBUFFER (b)) 1611 && BUFFER_LIVE_P (XBUFFER (b))
1612 && !BUFFER_HIDDEN_P (XBUFFER (b))); 1612 && !BUFFER_HIDDEN_P (XBUFFER (b)));
1613} 1613}
@@ -1851,7 +1851,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1851 since anything can happen within do_yes_or_no_p. */ 1851 since anything can happen within do_yes_or_no_p. */
1852 1852
1853 /* Don't kill the minibuffer now current. */ 1853 /* Don't kill the minibuffer now current. */
1854 if (EQ (buffer, XWINDOW (minibuf_window)->contents)) 1854 if (BASE_EQ (buffer, XWINDOW (minibuf_window)->contents))
1855 return Qnil; 1855 return Qnil;
1856 1856
1857 /* When we kill an ordinary buffer which shares its buffer text 1857 /* When we kill an ordinary buffer which shares its buffer text
@@ -1895,7 +1895,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1895 is the sole other buffer give up. */ 1895 is the sole other buffer give up. */
1896 XSETBUFFER (tem, current_buffer); 1896 XSETBUFFER (tem, current_buffer);
1897 if (EQ (tem, XWINDOW (minibuf_window)->contents) 1897 if (EQ (tem, XWINDOW (minibuf_window)->contents)
1898 && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) 1898 && BASE_EQ (buffer, Fother_buffer (buffer, Qnil, Qnil)))
1899 return Qnil; 1899 return Qnil;
1900 1900
1901 /* Now there is no question: we can kill the buffer. */ 1901 /* Now there is no question: we can kill the buffer. */
@@ -2501,23 +2501,23 @@ results, see Info node `(elisp)Swapping Text'. */)
2501 { 2501 {
2502 ws = Fcons (w, ws); 2502 ws = Fcons (w, ws);
2503 if (MARKERP (XWINDOW (w)->pointm) 2503 if (MARKERP (XWINDOW (w)->pointm)
2504 && (EQ (XWINDOW (w)->contents, buf1) 2504 && (BASE_EQ (XWINDOW (w)->contents, buf1)
2505 || EQ (XWINDOW (w)->contents, buf2))) 2505 || BASE_EQ (XWINDOW (w)->contents, buf2)))
2506 Fset_marker (XWINDOW (w)->pointm, 2506 Fset_marker (XWINDOW (w)->pointm,
2507 make_fixnum 2507 make_fixnum
2508 (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))), 2508 (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))),
2509 XWINDOW (w)->contents); 2509 XWINDOW (w)->contents);
2510 /* Blindly copied from pointm part. */ 2510 /* Blindly copied from pointm part. */
2511 if (MARKERP (XWINDOW (w)->old_pointm) 2511 if (MARKERP (XWINDOW (w)->old_pointm)
2512 && (EQ (XWINDOW (w)->contents, buf1) 2512 && (BASE_EQ (XWINDOW (w)->contents, buf1)
2513 || EQ (XWINDOW (w)->contents, buf2))) 2513 || BASE_EQ (XWINDOW (w)->contents, buf2)))
2514 Fset_marker (XWINDOW (w)->old_pointm, 2514 Fset_marker (XWINDOW (w)->old_pointm,
2515 make_fixnum 2515 make_fixnum
2516 (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))), 2516 (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))),
2517 XWINDOW (w)->contents); 2517 XWINDOW (w)->contents);
2518 if (MARKERP (XWINDOW (w)->start) 2518 if (MARKERP (XWINDOW (w)->start)
2519 && (EQ (XWINDOW (w)->contents, buf1) 2519 && (BASE_EQ (XWINDOW (w)->contents, buf1)
2520 || EQ (XWINDOW (w)->contents, buf2))) 2520 || BASE_EQ (XWINDOW (w)->contents, buf2)))
2521 Fset_marker (XWINDOW (w)->start, 2521 Fset_marker (XWINDOW (w)->start,
2522 make_fixnum 2522 make_fixnum
2523 (XBUFFER (XWINDOW (w)->contents)->last_window_start), 2523 (XBUFFER (XWINDOW (w)->contents)->last_window_start),
@@ -2527,10 +2527,11 @@ results, see Info node `(elisp)Swapping Text'. */)
2527 } 2527 }
2528 2528
2529 if (current_buffer->text->intervals) 2529 if (current_buffer->text->intervals)
2530 (eassert (EQ (current_buffer->text->intervals->up.obj, buffer)), 2530 (eassert (BASE_EQ (current_buffer->text->intervals->up.obj, buffer)),
2531 XSETBUFFER (current_buffer->text->intervals->up.obj, current_buffer)); 2531 XSETBUFFER (current_buffer->text->intervals->up.obj, current_buffer));
2532 if (other_buffer->text->intervals) 2532 if (other_buffer->text->intervals)
2533 (eassert (EQ (other_buffer->text->intervals->up.obj, Fcurrent_buffer ())), 2533 (eassert (BASE_EQ (other_buffer->text->intervals->up.obj,
2534 Fcurrent_buffer ())),
2534 XSETBUFFER (other_buffer->text->intervals->up.obj, other_buffer)); 2535 XSETBUFFER (other_buffer->text->intervals->up.obj, other_buffer));
2535 2536
2536 return Qnil; 2537 return Qnil;
@@ -3940,9 +3941,9 @@ for the rear of the overlay advance when text is inserted there
3940 else 3941 else
3941 CHECK_BUFFER (buffer); 3942 CHECK_BUFFER (buffer);
3942 3943
3943 if (MARKERP (beg) && !EQ (Fmarker_buffer (beg), buffer)) 3944 if (MARKERP (beg) && !BASE_EQ (Fmarker_buffer (beg), buffer))
3944 signal_error ("Marker points into wrong buffer", beg); 3945 signal_error ("Marker points into wrong buffer", beg);
3945 if (MARKERP (end) && !EQ (Fmarker_buffer (end), buffer)) 3946 if (MARKERP (end) && !BASE_EQ (Fmarker_buffer (end), buffer))
3946 signal_error ("Marker points into wrong buffer", end); 3947 signal_error ("Marker points into wrong buffer", end);
3947 3948
3948 CHECK_FIXNUM_COERCE_MARKER (beg); 3949 CHECK_FIXNUM_COERCE_MARKER (beg);
@@ -4060,9 +4061,9 @@ buffer. */)
4060 if (NILP (Fbuffer_live_p (buffer))) 4061 if (NILP (Fbuffer_live_p (buffer)))
4061 error ("Attempt to move overlay to a dead buffer"); 4062 error ("Attempt to move overlay to a dead buffer");
4062 4063
4063 if (MARKERP (beg) && !EQ (Fmarker_buffer (beg), buffer)) 4064 if (MARKERP (beg) && !BASE_EQ (Fmarker_buffer (beg), buffer))
4064 signal_error ("Marker points into wrong buffer", beg); 4065 signal_error ("Marker points into wrong buffer", beg);
4065 if (MARKERP (end) && !EQ (Fmarker_buffer (end), buffer)) 4066 if (MARKERP (end) && !BASE_EQ (Fmarker_buffer (end), buffer))
4066 signal_error ("Marker points into wrong buffer", end); 4067 signal_error ("Marker points into wrong buffer", end);
4067 4068
4068 CHECK_FIXNUM_COERCE_MARKER (beg); 4069 CHECK_FIXNUM_COERCE_MARKER (beg);