aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias EngdegÄrd2025-08-20 13:05:12 +0200
committerMattias EngdegÄrd2025-08-21 15:11:13 +0200
commit475a5d56d06253c688d5481dd58d21a9844b33ae (patch)
tree5c0d5937b1a092ae42fcd69ab579220a1d7a3c60 /src
parent6392f5d61f62f9c8b4a836f288bf3d07c31d3f8a (diff)
downloademacs-475a5d56d06253c688d5481dd58d21a9844b33ae.tar.gz
emacs-475a5d56d06253c688d5481dd58d21a9844b33ae.zip
; * src/lread.c (from_buffer_p): New abstraction.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c
index 80172dbe7c8..1a667ce163a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -522,6 +522,12 @@ from_file_p (source_t *source)
522 return source->get == source_file_get; 522 return source->get == source_file_get;
523} 523}
524 524
525static bool
526from_buffer_p (source_t *source)
527{
528 return source->get == source_buffer_get;
529}
530
525static void 531static void
526skip_dyn_bytes (source_t *source, ptrdiff_t n) 532skip_dyn_bytes (source_t *source, ptrdiff_t n)
527{ 533{
@@ -630,7 +636,7 @@ unreadbyte_from_file (unsigned char c)
630static AVOID 636static AVOID
631invalid_syntax_lisp (Lisp_Object s, source_t *source) 637invalid_syntax_lisp (Lisp_Object s, source_t *source)
632{ 638{
633 if (source->get == source_buffer_get) 639 if (from_buffer_p (source))
634 { 640 {
635 Lisp_Object buffer = source->object; 641 Lisp_Object buffer = source->object;
636 /* Get the line/column in the buffer. */ 642 /* Get the line/column in the buffer. */
@@ -2120,7 +2126,7 @@ end_of_file_error (source_t *source)
2120 /* Only Fload calls read on a file, and Fload always binds 2126 /* Only Fload calls read on a file, and Fload always binds
2121 load-true-file-name around the call. */ 2127 load-true-file-name around the call. */
2122 xsignal1 (Qend_of_file, Vload_true_file_name); 2128 xsignal1 (Qend_of_file, Vload_true_file_name);
2123 else if (source->get == source_buffer_get) 2129 else if (from_buffer_p (source))
2124 xsignal1 (Qend_of_file, source->object); 2130 xsignal1 (Qend_of_file, source->object);
2125 else 2131 else
2126 xsignal0 (Qend_of_file); 2132 xsignal0 (Qend_of_file);