logoalt Hacker News

timonokotoday at 7:59 AM2 repliesview on HN

Unrelated, but me and Gemini just invented "C-x 4" for multiscreens.

  (defun my-external-readonly-split ()
    "Open the current file in an external xfce4-terminal as read-only."
    (interactive)
    (if buffer-file-name
        (start-process "xfce-terminal-split" nil 
                       "xfce4-terminal" "-x" "emacs" "-nw" 
                       "--eval" "(find-file-read-only (pop command-line-args-left))"
                       buffer-file-name)
      (message "Current buffer is not visiting a file!")))

  (global-set-key (kbd "C-x 4") 'my-external-readonly-split)

Replies

the-lazy-guytoday at 11:50 AM

You should use emacsclient, so file will be actually shared. Or better yet - use GUI emacs with its ability to have multiple frames.

show 1 reply
timonokotoday at 8:30 AM

Incredibly splendid. I just tested it myself.

Try C-x 2, C-x 3 and C-x 4