Alexandre Oberlin writes: > Thanks for your suggestion. > > I tried to check if one of those solutions would work at least > while editing but none does. Actually in the narrowed region or > cloned buffer the syntax highlighting seems to take into account > the unseen text to set the highlighting. I need to copy the sh > region to a new file to get the correct syntax highlighting. Apart from multiple modes, you can try working with Org mode, which gives a nice way of embedding source code in documents. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591