aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2025-07-19 12:40:03 +0200
committerMattias EngdegÄrd2025-07-19 15:12:52 +0200
commite9deec70dac822f2f312497c6d7a7bd6b4e648bb (patch)
treeb9f47a200a47cb91ec2238e7e99e8ea1adee8556
parentce90f00feceb64f2dde9a4b4997b9e71a2d52387 (diff)
downloademacs-e9deec70dac822f2f312497c6d7a7bd6b4e648bb.tar.gz
emacs-e9deec70dac822f2f312497c6d7a7bd6b4e648bb.zip
Remove the variable load-convert-to-unibyte
It has been ineffective since 2002. Suggested by Lynn Winebarger. * src/lread.c (Fload, readevalloop_1, readevalloop, Feval_buffer) (Feval_region, syms_of_lread): Remove the variable and its propagation. * etc/NEWS: Announce.
-rw-r--r--etc/NEWS3
-rw-r--r--src/lread.c33
2 files changed, 11 insertions, 25 deletions
diff --git a/etc/NEWS b/etc/NEWS
index d32b2434de1..c778b8239b6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2507,6 +2507,9 @@ instead, which gives the time offset as +/-hh or +/-hh:mm. A designator
2507formats, like "2025-06-04 13:21:00 EDT", without the ISO 8601 "T" 2507formats, like "2025-06-04 13:21:00 EDT", without the ISO 8601 "T"
2508separator, are also supported. 2508separator, are also supported.
2509 2509
2510---
2511** The obsolete variable 'load-convert-to-unibyte' has been removed.
2512
2510 2513
2511* Lisp Changes in Emacs 31.1 2514* Lisp Changes in Emacs 31.1
2512 2515
diff --git a/src/lread.c b/src/lread.c
index 5b7848c3118..00b9a33e45a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -238,7 +238,7 @@ static struct saved_string saved_strings[2];
238static Lisp_Object Vloads_in_progress; 238static Lisp_Object Vloads_in_progress;
239 239
240static void readevalloop (Lisp_Object, struct infile *, Lisp_Object, bool, 240static void readevalloop (Lisp_Object, struct infile *, Lisp_Object, bool,
241 Lisp_Object, Lisp_Object, 241 Lisp_Object,
242 Lisp_Object, Lisp_Object); 242 Lisp_Object, Lisp_Object);
243 243
244static void build_load_history (Lisp_Object, bool); 244static void build_load_history (Lisp_Object, bool);
@@ -1784,14 +1784,14 @@ Return t if the file exists and loads successfully. */)
1784 1784
1785 if (! version || version >= 22) 1785 if (! version || version >= 22)
1786 readevalloop (Qget_file_char, &input, hist_file_name, 1786 readevalloop (Qget_file_char, &input, hist_file_name,
1787 0, Qnil, Qnil, Qnil, Qnil); 1787 0, Qnil, Qnil, Qnil);
1788 else 1788 else
1789 { 1789 {
1790 /* We can't handle a file which was compiled with 1790 /* We can't handle a file which was compiled with
1791 byte-compile-dynamic by older version of Emacs. */ 1791 byte-compile-dynamic by older version of Emacs. */
1792 specbind (Qload_force_doc_strings, Qt); 1792 specbind (Qload_force_doc_strings, Qt);
1793 readevalloop (Qget_emacs_mule_file_char, &input, hist_file_name, 1793 readevalloop (Qget_emacs_mule_file_char, &input, hist_file_name,
1794 0, Qnil, Qnil, Qnil, Qnil); 1794 0, Qnil, Qnil, Qnil);
1795 } 1795 }
1796 } 1796 }
1797 unbind_to (count, Qnil); 1797 unbind_to (count, Qnil);
@@ -2376,12 +2376,6 @@ build_load_history (Lisp_Object filename, bool entire)
2376 } 2376 }
2377} 2377}
2378 2378
2379static void
2380readevalloop_1 (int old)
2381{
2382 load_convert_to_unibyte = old;
2383}
2384
2385/* Signal an `end-of-file' error, if possible with file name 2379/* Signal an `end-of-file' error, if possible with file name
2386 information. */ 2380 information. */
2387 2381
@@ -2415,9 +2409,7 @@ readevalloop_eager_expand_eval (Lisp_Object val, Lisp_Object macroexpand)
2415 return val; 2409 return val;
2416} 2410}
2417 2411
2418/* UNIBYTE specifies how to set load_convert_to_unibyte 2412/* READFUN, if non-nil, is used instead of `read'.
2419 for this invocation.
2420 READFUN, if non-nil, is used instead of `read'.
2421 2413
2422 START, END specify region to read in current buffer (from eval-region). 2414 START, END specify region to read in current buffer (from eval-region).
2423 If the input is not from a buffer, they must be nil. */ 2415 If the input is not from a buffer, they must be nil. */
@@ -2427,7 +2419,7 @@ readevalloop (Lisp_Object readcharfun,
2427 struct infile *infile0, 2419 struct infile *infile0,
2428 Lisp_Object sourcename, 2420 Lisp_Object sourcename,
2429 bool printflag, 2421 bool printflag,
2430 Lisp_Object unibyte, Lisp_Object readfun, 2422 Lisp_Object readfun,
2431 Lisp_Object start, Lisp_Object end) 2423 Lisp_Object start, Lisp_Object end)
2432{ 2424{
2433 int c; 2425 int c;
@@ -2470,8 +2462,6 @@ readevalloop (Lisp_Object readcharfun,
2470 emacs_abort (); 2462 emacs_abort ();
2471 2463
2472 specbind (Qstandard_input, readcharfun); 2464 specbind (Qstandard_input, readcharfun);
2473 record_unwind_protect_int (readevalloop_1, load_convert_to_unibyte);
2474 load_convert_to_unibyte = !NILP (unibyte);
2475 2465
2476 /* If lexical binding is active (either because it was specified in 2466 /* If lexical binding is active (either because it was specified in
2477 the file's header, or via a buffer-local variable), create an empty 2467 the file's header, or via a buffer-local variable), create an empty
@@ -2630,8 +2620,7 @@ PRINTFLAG controls printing of output by any output functions in the
2630 a value of nil means discard it; anything else is the stream to print to. 2620 a value of nil means discard it; anything else is the stream to print to.
2631 See Info node `(elisp)Output Streams' for details on streams. 2621 See Info node `(elisp)Output Streams' for details on streams.
2632FILENAME specifies the file name to use for `load-history'. 2622FILENAME specifies the file name to use for `load-history'.
2633UNIBYTE, if non-nil, specifies `load-convert-to-unibyte' for this 2623UNIBYTE is obsolete and ignored.
2634 invocation.
2635DO-ALLOW-PRINT, if non-nil, specifies that output functions in the 2624DO-ALLOW-PRINT, if non-nil, specifies that output functions in the
2636 evaluated code should work normally even if PRINTFLAG is nil, in 2625 evaluated code should work normally even if PRINTFLAG is nil, in
2637 which case the output is displayed in the echo area. 2626 which case the output is displayed in the echo area.
@@ -2677,7 +2666,7 @@ This function preserves the position of point. */)
2677 specbind (Qlexical_binding, get_lexical_binding (buf, buf)); 2666 specbind (Qlexical_binding, get_lexical_binding (buf, buf));
2678 BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); 2667 BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
2679 readevalloop (buf, 0, filename, 2668 readevalloop (buf, 0, filename,
2680 !NILP (printflag), unibyte, Qnil, Qnil, Qnil); 2669 !NILP (printflag), Qnil, Qnil, Qnil);
2681 return unbind_to (count, Qnil); 2670 return unbind_to (count, Qnil);
2682} 2671}
2683 2672
@@ -2711,7 +2700,7 @@ This function does not move point. */)
2711 2700
2712 /* `readevalloop' calls functions which check the type of start and end. */ 2701 /* `readevalloop' calls functions which check the type of start and end. */
2713 readevalloop (cbuf, 0, BVAR (XBUFFER (cbuf), filename), 2702 readevalloop (cbuf, 0, BVAR (XBUFFER (cbuf), filename),
2714 !NILP (printflag), Qnil, read_function, 2703 !NILP (printflag), read_function,
2715 start, end); 2704 start, end);
2716 2705
2717 return unbind_to (count, Qnil); 2706 return unbind_to (count, Qnil);
@@ -6062,12 +6051,6 @@ and NOERROR and NOMESSAGE are the corresponding arguments passed to
6062This is useful when the file being loaded is a temporary copy. */); 6051This is useful when the file being loaded is a temporary copy. */);
6063 load_force_doc_strings = 0; 6052 load_force_doc_strings = 0;
6064 6053
6065 DEFVAR_BOOL ("load-convert-to-unibyte", load_convert_to_unibyte,
6066 doc: /* Non-nil means `read' converts strings to unibyte whenever possible.
6067This is normally bound by `load' and `eval-buffer' to control `read',
6068and is not meant for users to change. */);
6069 load_convert_to_unibyte = 0;
6070
6071 DEFVAR_LISP ("source-directory", Vsource_directory, 6054 DEFVAR_LISP ("source-directory", Vsource_directory,
6072 doc: /* Directory in which Emacs sources were found when Emacs was built. 6055 doc: /* Directory in which Emacs sources were found when Emacs was built.
6073You cannot count on them to still be there! */); 6056You cannot count on them to still be there! */);