zk-phi / togetherly

Allow multiple clients to edit a single file on-line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

some funcall ... mode problems

holtzermann17 opened this issue · comments

Hi, I'm very excited about togetherly which I am using with a friend of mine. Here is one small problem we've noticed. The appropriate "fix" might be org mode configuration, but I think I have a work around in togetherly.el, so I will comment here about it.

On L454 there's the following s-exp:

(funcall (or (and (fboundp mode) mode) 'fundamental-mode))

In an org mode file, with default configurations, restarting the mode causes all of the blocks to fold. It can be annoying for this to happen at random times when editing the buffer. So my work around was just to comment out the line above. Another fix would be to add show-all to the local org mode hook, similar to this question on Stack Exchange: https://emacs.stackexchange.com/questions/21335/prevent-folding-org-files-opened-by-ediff/21336

However, perhaps there is a more sophisticated approach to sharing the mode, i.e., rewriting L454 so that it doesn't turn the mode back on if the mode sent by the server is already equal to the local major mode. That can be detected.

  (with-current-buffer buffer-or-string
     major-mode)

Thanks for reporting!

Fixed with this approach :

doesn't turn the mode back on if the mode sent by the server is already equal to the local major mode