Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun get-file-from-buffer-other-window ()
- "Load a file into another window referenced by the string on the current line"
- (interactive)
- ;; get the filename and lineno
- (setq vals (get-fileline))
- (print vals)
- ;; load the filename into the next window and goto linenumber
- (switch-to-buffer-other-window (find-file-noselect (nth 0 vals)))
- (goto-line (nth 1 vals))
- )
- (defun display-on-side (buffer &optional not-this-window frame)
- (let* ((window (or (minibuffer-selected-window)
- (selected-window)))
- (display-buffer-function nil)
- (pop-up-windows nil))
- (with-selected-window (or window (error "display-on-side"))
- (when (one-window-p t)
- (split-window-horizontally))
- (display-buffer buffer not-this-window frame))))
- (setq display-buffer-function 'display-on-side)
- ;; unit test, should open in the same side window.
- (display-buffer (get-buffer-create "*foo*"))
- (display-buffer (get-buffer-create "*bar*"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement