🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ed Simpson Thu, 11 Apr 1991 14:12
*-other-screen
#2062
Author: Ed Simpson
Date: Thu, 11 Apr 1991 14:12
39 lines
2056 bytes
It's pretty easy to extend existing code to use other screens.  Here
are examples of what I've done.  I just yanked the original code (e.g
for find-file-read-only) and added the accessory code to put up a new
screen.  Compare find-alternate-file-other-screen with
find-alternate-file in the lisp library.

(require 'epoch)

(defun find-alternate-file-other-screen (filename)
  "Find file FILENAME in a new screen and kill the previous buffer and screen."
  (interactive "FFind alternate file: ")
  (and (buffer-modified-p)
       (not buffer-read-only)
       (not (yes-or-no-p (format "Buffer %s is modified; kill anyway? "
				 (buffer-name))))
       (error "Aborted"))
  (let ((obuf (current-buffer))
	(ofile buffer-file-name)
	(oname (buffer-name))
	(oscr (current-screen)))
    (rename-buffer " **lose**")
    (setq buffer-file-name nil)
    (unwind-protect
	(progn
	  (unlock-buffer)
	  (find-file-other-screen filename))
      (cond ((eq obuf (current-buffer))
	     (setq buffer-file-name ofile)
	     (lock-buffer)
	     (rename-buffer oname))))
    (kill-buffer obuf)
    (delete-screen oscr)))

(defun find-file-other-screen-read-only (filename)
  "Edit file FILENAME in another screen but don't save without confirmation.
Like find-file-other-screen but marks buffer as read-only."
  (interactive "fFind file read-only: ")
  (find-file-other-screen filename)
  (setq buffer-read-only t))
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads