diff options
| author | Juri Linkov | 2025-12-30 20:08:07 +0200 |
|---|---|---|
| committer | Juri Linkov | 2025-12-30 20:08:07 +0200 |
| commit | 3ff8f30f838ae062d45da13ad2cc11bcfe53f963 (patch) | |
| tree | d10d525d044eed826bd525e8b6f5cd372ef7bdbb | |
| parent | 996b2304e591f75fd0db5540a315a815a05250e7 (diff) | |
| download | emacs-3ff8f30f838ae062d45da13ad2cc11bcfe53f963.tar.gz emacs-3ff8f30f838ae062d45da13ad2cc11bcfe53f963.zip | |
Make variables 'left-margin-columns' and 'right-margin-columns' buffer-local
* src/xdisp.c (handle_single_display_spec): Use FIXNATP for margin column.
Also use 'Vleft_margin_columns' instead of 'Fsymbol_value' (bug#80025).
(left-margin-columns, right-margin-columns): Use Fmake_variable_buffer_local.
| -rw-r--r-- | src/xdisp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c1a2b6003d5..7903ba582a4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -6410,13 +6410,12 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 6410 | && (tem = XCDR (tem), CONSP (tem)) | 6410 | && (tem = XCDR (tem), CONSP (tem)) |
| 6411 | && (tem = XCAR (tem), !NILP (tem))) | 6411 | && (tem = XCAR (tem), !NILP (tem))) |
| 6412 | { | 6412 | { |
| 6413 | if (FIXNUMP (tem) && XFIXNUM (tem) >= 0) | 6413 | if (FIXNATP (tem)) |
| 6414 | margin_column = (int) XFIXNUM (tem); | 6414 | margin_column = (int) XFIXNUM (tem); |
| 6415 | else if (SYMBOLP (tem)) | 6415 | else if (SYMBOLP (tem)) |
| 6416 | { | 6416 | { |
| 6417 | Lisp_Object columns_list = Fsymbol_value | 6417 | Lisp_Object columns_list = EQ (location, Qleft_margin) |
| 6418 | (EQ (location, Qleft_margin) | 6418 | ? Vleft_margin_columns : Vright_margin_columns; |
| 6419 | ? Qleft_margin_columns : Qright_margin_columns); | ||
| 6420 | int pos = 0; | 6419 | int pos = 0; |
| 6421 | for (Lisp_Object tail = columns_list; CONSP (tail); | 6420 | for (Lisp_Object tail = columns_list; CONSP (tail); |
| 6422 | tail = XCDR (tail), pos++) | 6421 | tail = XCDR (tail), pos++) |
| @@ -39015,7 +39014,6 @@ The recommended non-zero value is between 100000 and 1000000, | |||
| 39015 | depending on your patience and the speed of your system. */); | 39014 | depending on your patience and the speed of your system. */); |
| 39016 | max_redisplay_ticks = 0; | 39015 | max_redisplay_ticks = 0; |
| 39017 | 39016 | ||
| 39018 | DEFSYM (Qleft_margin_columns, "left-margin-columns"); | ||
| 39019 | DEFVAR_LISP ("left-margin-columns", Vleft_margin_columns, | 39017 | DEFVAR_LISP ("left-margin-columns", Vleft_margin_columns, |
| 39020 | doc: /* List of symbols for left margin columns. | 39018 | doc: /* List of symbols for left margin columns. |
| 39021 | Each symbol represents a mode that displays indicators in the left margin. | 39019 | Each symbol represents a mode that displays indicators in the left margin. |
| @@ -39027,8 +39025,9 @@ flymake indicators appear in column 0, outline in column 1, and hideshow | |||
| 39027 | in column 2. Modes can use their symbol in a display spec like | 39025 | in column 2. Modes can use their symbol in a display spec like |
| 39028 | ((margin left-margin flymake) \">\") instead of a numeric column. */); | 39026 | ((margin left-margin flymake) \">\") instead of a numeric column. */); |
| 39029 | Vleft_margin_columns = Qnil; | 39027 | Vleft_margin_columns = Qnil; |
| 39028 | DEFSYM (Qleft_margin_columns, "left-margin-columns"); | ||
| 39029 | Fmake_variable_buffer_local (Qleft_margin_columns); | ||
| 39030 | 39030 | ||
| 39031 | DEFSYM (Qright_margin_columns, "right-margin-columns"); | ||
| 39032 | DEFVAR_LISP ("right-margin-columns", Vright_margin_columns, | 39031 | DEFVAR_LISP ("right-margin-columns", Vright_margin_columns, |
| 39033 | doc: /* List of symbols for right margin columns. | 39032 | doc: /* List of symbols for right margin columns. |
| 39034 | Each symbol represents a mode that displays indicators in the right margin. | 39033 | Each symbol represents a mode that displays indicators in the right margin. |
| @@ -39037,6 +39036,8 @@ where that mode's margin indicators appear. | |||
| 39037 | 39036 | ||
| 39038 | See `left-margin-columns' for more details. */); | 39037 | See `left-margin-columns' for more details. */); |
| 39039 | Vright_margin_columns = Qnil; | 39038 | Vright_margin_columns = Qnil; |
| 39039 | DEFSYM (Qright_margin_columns, "right-margin-columns"); | ||
| 39040 | Fmake_variable_buffer_local (Qright_margin_columns); | ||
| 39040 | 39041 | ||
| 39041 | /* Called by decode_mode_spec. */ | 39042 | /* Called by decode_mode_spec. */ |
| 39042 | DEFSYM (Qfile_remote_p, "file-remote-p"); | 39043 | DEFSYM (Qfile_remote_p, "file-remote-p"); |