[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libtextstyle vs Emacs
From: |
Akim Demaille |
Subject: |
Re: libtextstyle vs Emacs |
Date: |
Sun, 2 Aug 2020 08:15:51 +0200 |
Hi Bruno,
> Le 1 août 2020 à 18:23, Bruno Haible <bruno@clisp.org> a écrit :
>
> Hi Akim,
>
>> In compilation-mode, Emacs reveals the escape for hyperlinks:
>>
>> cd ~/src/faveod/rbs_parser/ && make BSN=~/src/gnu/bison/_build/g9d/src/bison
>> /Users/akim/src/gnu/bison/_build/g9d/src/bison -o src/Parser.cc
>> src/Parser.ypp
>> src/Parser.ypp:270.7-13: avertissement: conflit de type pour l'action par
>> défaut: <string> != <>
>> []8;id=155289640005abcae1cc42ed00000000;https://www.gnu.org/software/bison/manual/html_node/Diagnostics.html#Wother\-Wother]8;;\]
>> 270 | | tLIDENT
>> | ^~~~~~~
>
> Please, can you provide a reproducible test case? Parser.ypp from
> 'git clone https://github.com/Shopify/rbs_parser.git' does not give a warning
> for me, when bison-3.7 is invoked on it.
Doh, sorry about that! I did not mean to get you to look for this example.
This should do:
%token BAR BAR
%%
exp: BAR
-*- mode: compilation; default-directory: "/tmp/" -*-
Compilation started at Sun Aug 2 07:56:07
~/src/gnu/bison/_build/g9d/tests/bison /tmp/foo.y
/tmp/foo.y:1.12-14: avertissement: le symbole BAR est redéclaré
[]8;id=155289640005abdead9e721600000000;https://www.gnu.org/software/bison/manual/html_node/Diagnostics.html#Wother\-Wother]8;;\]
1 | %token BAR BAR
| ^~~
/tmp/foo.y:1.8-10: note: déclaration précédente
1 | %token BAR BAR
| ^~~
Compilation finished at Sun Aug 2 07:56:07
>> Maybe hyperlinks should be disabled when $EMACS == "t"? This is Emacs 26.3.
>
> Please, can you also give the value of $TERM ? This is the common way to
> determine the capabilities of a terminal emulator, not $EMACS.
-*- mode: compilation; default-directory: "/tmp/" -*-
Compilation started at Sun Aug 2 07:56:39
echo $TERM
dumb
Compilation finished at Sun Aug 2 07:56:39
> You should know that
> - There is some doc regarding Emacs [1],
I had not seen that seen, thanks. In my case, this is M-x compile.
M-x shell gives me
bash-3.2$ echo $TERM
dumb
bash-3.2$ ~/src/gnu/bison/_build/g9d/tests/bison /tmp/foo.y
/tmp/foo.y:1.12-14: avertissement: le symbole BAR est redéclaré
[]8;id=155289640005abdebe887c3100000000;https://www.gnu.org/software/bison/manual/html_node/Diagnostics.html#Wother\-Wother]8;;\]
1 | %token BAR BAR
| ^~~
/tmp/foo.y:1.8-10: note: déclaration précédente
1 | %token BAR BAR
| ^~~
with no styling at all, except the failed hyperlink.
And M-x term gives me perform result, styled (which doesn't show here):
bash-3.2$ echo $TERM
eterm-color
bash-3.2$ ~/src/gnu/bison/_build/g9d/tests/bison /tmp/foo.y
/tmp/foo.y:1.12-14: avertissement: le symbole BAR est redéclaré [-Wother]
1 | %token BAR BAR
| ^~~
/tmp/foo.y:1.8-10: note: déclaration précédente
1 | %token BAR BAR
| ^~~
bash-3.2$
Styled, but no links, which is consistant with:
> - libtextstyle does not assume that hyperlinking is supported if $TERM
> starts with "eterm" [2],
> - The user can turn off hyperlink output by setting the environment variable
> NO_TERM_HYPERLINKS [3].
Yup, I've seen that. My point was really to help make it work out-of-the-box
in more cases.
Cheers!