* Emacs 27 - Changing the "selective display character" (also called "ellipsis")
@ 2021-07-25 10:07 A M
2021-07-25 13:51 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: A M @ 2021-07-25 10:07 UTC (permalink / raw)
To: help-gnu-emacs
Hello
I would like to change the "selective display character" (also called
"ellipsis", default is "...") to some other character, an arrow
character would be nice.
Up until Emacs 27, I used the code below in my init.el , it worked just
great.
;Change the default selective display ("folding") character "..." to " »".
(set-display-table-slot standard-display-table
'selective-display (string-to-vector " »"))
With Emacs 27 this no longer works. I have tested by using
'selective-display' (C-x $) on my init.el as a simple test, I get the
default "...".
Could you help me by providing a working method for Emacs 27?
Additional information:
I have noticed that some changes were introduced in Emacs 27 pertaining
to Selective Display / Hidden Text. Some relevant links to the GNU Emacs
Lisp Reference Manual:
Invisible Text - "Hiding part of the buffer text."
Selective Display - "Hiding part of the buffer text (the old way)."
https://www.gnu.org/software/emacs/manual/html_node/elisp/Invisible-Text.html
https://www.gnu.org/software/emacs/manual/html_node/elisp/Selective-Display.html
Best Regards
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emacs 27 - Changing the "selective display character" (also called "ellipsis")
2021-07-25 10:07 Emacs 27 - Changing the "selective display character" (also called "ellipsis") A M
@ 2021-07-25 13:51 ` Eli Zaretskii
2021-07-26 10:42 ` A M
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-07-25 13:51 UTC (permalink / raw)
To: help-gnu-emacs
> From: A M <alex334599@gmail.com>
> Date: Sun, 25 Jul 2021 12:07:07 +0200
>
> I would like to change the "selective display character" (also called
> "ellipsis", default is "...") to some other character, an arrow
> character would be nice.
>
> Up until Emacs 27, I used the code below in my init.el , it worked just
> great.
>
> ;Change the default selective display ("folding") character "..." to " »".
> (set-display-table-slot standard-display-table
> 'selective-display (string-to-vector " »"))
>
> With Emacs 27 this no longer works. I have tested by using
> 'selective-display' (C-x $) on my init.el as a simple test, I get the
> default "...".
> Could you help me by providing a working method for Emacs 27?
I cannot reproduce the problem you are reporting: the above works for
me in Emacs 27 (and in Emacs 28). The "..." is replaced with the
arrow character.
Just to be sure: to test this you invoke "C-x $" with a numeric
argument that determines the column past which you want to have the
ellipsis, yes?
I suggest to try this in "emacs -Q"; if it works there, there are some
customizations of yours that get in the way.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emacs 27 - Changing the "selective display character" (also called "ellipsis")
2021-07-25 13:51 ` Eli Zaretskii
@ 2021-07-26 10:42 ` A M
2021-07-26 13:00 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: A M @ 2021-07-26 10:42 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]
Hello
Sorry, there was one thing I forgot to mention which is a requirement
for the problem to appear.
I have also enabled automatic byte-compilation, using the following line
of lisp code:
;; Automatic byte-compilation when starting emacs.
(byte-recompile-directory (expand-file-name "~/.emacs.d") 0)
A minimal emacs dotfile that demonstrates my described problem is thus
the code snippet I gave in the first message combined with the one
above. (I am checking that myself right now.) It is when an init.elc has
been generated I get this error specifically in Emacs 27.
I will attach the error message I get in Emacs and also the stack trace
from 'emacs --debug-init', please see the attached file.
Eli, yes you guess correctly. invoke "C-x $" with a numeric argument on
init.el as a way of testing.
On 7/25/21 3:51 PM, Eli Zaretskii wrote:
>> From: A M <alex334599@gmail.com>
>> Date: Sun, 25 Jul 2021 12:07:07 +0200
>>
>> I would like to change the "selective display character" (also called
>> "ellipsis", default is "...") to some other character, an arrow
>> character would be nice.
>>
>> Up until Emacs 27, I used the code below in my init.el , it worked just
>> great.
>>
>> ;Change the default selective display ("folding") character "..." to " »".
>> (set-display-table-slot standard-display-table
>> 'selective-display (string-to-vector " »"))
>>
>> With Emacs 27 this no longer works. I have tested by using
>> 'selective-display' (C-x $) on my init.el as a simple test, I get the
>> default "...".
>> Could you help me by providing a working method for Emacs 27?
> I cannot reproduce the problem you are reporting: the above works for
> me in Emacs 27 (and in Emacs 28). The "..." is replaced with the
> arrow character.
>
> Just to be sure: to test this you invoke "C-x $" with a numeric
> argument that determines the column past which you want to have the
> ellipsis, yes?
>
> I suggest to try this in "emacs -Q"; if it works there, there are some
> customizations of yours that get in the way.
>
[-- Attachment #2: error-message_and_stack-trace.txt --]
[-- Type: text/plain, Size: 989 bytes --]
Warning (initialization): An error occurred while loading ‘/home/user/.emacs.d/init.elc’:
Wrong type argument: char-table-p, nil
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.
$ emacs --debug-init
Debugger entered--Lisp error: (wrong-type-argument char-table-p nil)
set-char-table-extra-slot(nil 4 [32 187])
set-display-table-slot(nil selective-display [32 187])
byte-code("\301\302\303!\304\"\210\305\10\306\307\310\1!\262\1#\210\10\204\31\0\311 \20\301\207" [standard-display-table byte-recompile-directory expand-file-name "~/.emacs.d" 0 set-display-table-slot selective-display " »" vconcat make-display-table] 6)
load("/home/user/.emacs.d/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x5c1655>) #f(compiled-function () #<bytecode 0x5c1669>) t)
command-line()
normal-top-level()
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emacs 27 - Changing the "selective display character" (also called "ellipsis")
2021-07-26 10:42 ` A M
@ 2021-07-26 13:00 ` Eli Zaretskii
2021-07-26 15:01 ` A M
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-07-26 13:00 UTC (permalink / raw)
To: help-gnu-emacs
> From: A M <alex334599@gmail.com>
> Date: Mon, 26 Jul 2021 12:42:41 +0200
>
> Sorry, there was one thing I forgot to mention which is a requirement
> for the problem to appear.
> I have also enabled automatic byte-compilation, using the following line
> of lisp code:
>
> ;; Automatic byte-compilation when starting emacs.
> (byte-recompile-directory (expand-file-name "~/.emacs.d") 0)
>
> A minimal emacs dotfile that demonstrates my described problem is thus
> the code snippet I gave in the first message combined with the one
> above. (I am checking that myself right now.) It is when an init.elc has
> been generated I get this error specifically in Emacs 27.
>
> I will attach the error message I get in Emacs and also the stack trace
> from 'emacs --debug-init', please see the attached file.
I think the error message explains itself, no? It means that your
setting didn't take effect, most probably because you didn't load
disp-table before referencing standard-display-table.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emacs 27 - Changing the "selective display character" (also called "ellipsis")
2021-07-26 13:00 ` Eli Zaretskii
@ 2021-07-26 15:01 ` A M
0 siblings, 0 replies; 5+ messages in thread
From: A M @ 2021-07-26 15:01 UTC (permalink / raw)
To: help-gnu-emacs
Adding this line of code solved the problem:
(require 'disp-table)
Thanks for the help.
On 7/26/21 3:00 PM, Eli Zaretskii wrote:
>> From: A M <alex334599@gmail.com>
>> Date: Mon, 26 Jul 2021 12:42:41 +0200
>>
>> Sorry, there was one thing I forgot to mention which is a requirement
>> for the problem to appear.
>> I have also enabled automatic byte-compilation, using the following line
>> of lisp code:
>>
>> ;; Automatic byte-compilation when starting emacs.
>> (byte-recompile-directory (expand-file-name "~/.emacs.d") 0)
>>
>> A minimal emacs dotfile that demonstrates my described problem is thus
>> the code snippet I gave in the first message combined with the one
>> above. (I am checking that myself right now.) It is when an init.elc has
>> been generated I get this error specifically in Emacs 27.
>>
>> I will attach the error message I get in Emacs and also the stack trace
>> from 'emacs --debug-init', please see the attached file.
> I think the error message explains itself, no? It means that your
> setting didn't take effect, most probably because you didn't load
> disp-table before referencing standard-display-table.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-07-26 15:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-25 10:07 Emacs 27 - Changing the "selective display character" (also called "ellipsis") A M
2021-07-25 13:51 ` Eli Zaretskii
2021-07-26 10:42 ` A M
2021-07-26 13:00 ` Eli Zaretskii
2021-07-26 15:01 ` A M
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).