aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-12-06 17:26:10 +0800
committerXi Ruoyao <xry111@xry111.site>2023-12-06 17:26:10 +0800
commit7cce808a46c5a1df0de2c52827b89b63834436fe (patch)
treef18f663815f462f66b0a021add221b668a830e14
parent31a9142d108a0fd32660068adc1c223a7e60e8b7 (diff)
kernel-config: The hot key for choices is just the first character
Stupid inconsistency...
-rw-r--r--chapter10/kernel/highmem.xml2
-rwxr-xr-xchapter10/kernel/kernel-config.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/chapter10/kernel/highmem.xml b/chapter10/kernel/highmem.xml
index efedef46c..4f0938142 100644
--- a/chapter10/kernel/highmem.xml
+++ b/chapter10/kernel/highmem.xml
@@ -5,4 +5,4 @@
DO NOT EDIT! -->
<screen role="nodump"><emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
H<emphasis role='blue'>i</emphasis>gh Memory Support ---&gt;
- (X) 64<emphasis role='blue'>G</emphasis>B [HIGHMEM64G]</screen>
+ (X) <emphasis role='blue'>6</emphasis>4GB [HIGHMEM64G]</screen>
diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py
index 03e6ebb22..eac2b6c4d 100755
--- a/chapter10/kernel/kernel-config.py
+++ b/chapter10/kernel/kernel-config.py
@@ -251,6 +251,7 @@ sep = known_config.get('separate_toplevel_menu')
for i0, val, i1, title, arrow, key, menu, comment in r:
rem = max_line
+ is_choice = (val == '(X)')
if val:
val += (max_val_len[menu] - len(val)) * ' '
@@ -263,7 +264,9 @@ for i0, val, i1, title, arrow, key, menu, comment in r:
if len(title) > rem:
title = title[:rem - 3] + '...'
- b = title.lstrip('YyMmNnHh.' + "".join(map(str, range(10))))
+ b = title
+ if not is_choice:
+ b = b.lstrip('YyMmNnHh.' + "".join(map(str, range(10))))
a = title[:len(title) - len(b)]
b0 = "<emphasis role='blue'>" + escape(b[0]) + "</emphasis>"
line += escape(a) + b0 + escape(b[1:]) + escape(arrow)