7

I normally use indirect buffers while I edit python code in python-mode, I create them by running clone-indirect-buffer-other-window. While the syntax highlighting of the main buffer looks just fine, sometimes it is wrong in the indirect one. Specifically, it seems like some closing quotes are ignored adn so big chunks of my code are coloured as if they were part of long literal string.

I have not found references of this elsewhere, and have not clue why it could be happening. Does anybody know why this is and/or how to solve it?

This question could be related, be he does not mention indirect buffers (I only have this problem with those), and also my indirect buffer do not refresh to proper syntax highlighting even if a wait several minutes.

  • Why are you using an indirect buffer in the first place? You can show the main buffer in two different windows, if that is what you are after. – Lindydancer Aug 8 '15 at 16:07
  • 1
    If the problem exists with the most recent public release of Emacs, then consider filing a bug report with as many details as possible regarding the issue. If you are using an older version of Emacs, then try the most recent public release. If you are using Emacs Trunk, then also consider filing a bug report with lots of details. – lawlist Aug 8 '15 at 16:41
  • @Lindydancer indirect buffers are more useful if I want to keep two fixed places of a long buffer open after switching my windows to other buffers – jmlorenzi Aug 8 '15 at 20:24
  • @lawlist Yes, I will play around to get more details and send the bug. I have just reproduced the error with in emacs -q – jmlorenzi Aug 8 '15 at 20:25
0

Indirect buffers suck. They may look like "just what I need", but it's very rarely the case, and then sooner or later you bump into problems. IOW, I think they are an attractive nuisance.

I recommend you try and figure out why you want to use indirect-buffers and then try to look for other ways to get the same result.

E.g. you say:

indirect buffers are more useful if I want to keep two fixed places
of a long buffer open after switching my windows to other buffers

There are many other ways which are a lot less intrusive than using indirect buffers. E.g. using registers, bookmarks, or maybe with a package which tries to remember which point was used for your buffers individually in each window. E.g. in Emacs's master branch we have now enabled switch-to-buffer-preserve-window-point by default, which should provide some of the behavior you were looking for via indirect buffers.

  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – erikstokes Jan 5 '16 at 22:50
  • If you don;t recognize it as a valid answer, it's because you're not familiar enough with indirect-buffers. – Stefan Jan 7 '16 at 5:34
  • @Stefan while you may be right, you're also not following this site's requested format: if you can answer the question, write an answer. If the question is invalid and should be changed, write a comment. – Trevoke Jun 24 '16 at 14:56
  • The question is definitely valid, and I've heard it many times, which is why I think it's important to answer it as it is rather than to try and get the author to "fix it". I much prefer losing a few rep-points than dogmatically following some policy. – Stefan Jun 25 '16 at 0:35
  • 1
    I agree with Stefan. Question and answer are valid. The answer could be formulated more neutral. E.g., "Indirect buffers suck. They" could be replaced by "Indirect buffers". – Tobias Jan 16 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.