forked from colonelpanic/dotfiles
[Emacs] Fixup frames-only-mode
This commit is contained in:
parent
4c322bf3fc
commit
34387058bb
@ -1135,34 +1135,36 @@ programming mode.
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** display-buffer-alist
|
*** display-buffer-alist
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq pop-up-frames 'graphic-only)
|
(defvar imalison:use-frames-only)
|
||||||
(defvar imalison:use-frames-only nil)
|
(when imalison:use-frames-only
|
||||||
|
(setq pop-up-frames 'graphic-only)
|
||||||
|
(defvar imalison:use-frames-only nil)
|
||||||
|
|
||||||
(defun imalison:use-frames-only ()
|
(defun imalison:use-frames-only ()
|
||||||
(or imalison:use-frames-only
|
(or imalison:use-frames-only
|
||||||
(member (getenv "XDG_CURRENT_DESKTOP") '("XMonad"))))
|
(member (getenv "XDG_CURRENT_DESKTOP") '("XMonad"))))
|
||||||
|
|
||||||
(defvar imalison:use-new-frame-or-window nil)
|
(defvar imalison:use-new-frame-or-window nil)
|
||||||
|
|
||||||
(defvar imalison:use-new-frame-or-window-next-command nil)
|
(defvar imalison:use-new-frame-or-window-next-command nil)
|
||||||
|
|
||||||
(defun imalison:other-window-or-frame-next-command ()
|
(defun imalison:other-window-or-frame-next-command ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq imalison:use-new-frame-or-window-next-command t))
|
(setq imalison:use-new-frame-or-window-next-command t))
|
||||||
|
|
||||||
(defun imalison:use-other-frame-or-window (&rest args)
|
(defun imalison:use-other-frame-or-window (&rest args)
|
||||||
(or
|
(or
|
||||||
(when imalison:use-new-frame-or-window-next-command
|
(when imalison:use-new-frame-or-window-next-command
|
||||||
(setq imalison:use-new-frame-or-window-next-command nil)
|
(setq imalison:use-new-frame-or-window-next-command nil)
|
||||||
t)
|
t)
|
||||||
imalison:use-new-frame-or-window))
|
imalison:use-new-frame-or-window))
|
||||||
|
|
||||||
(defun imalison:display-buffer (&rest args)
|
(defun imalison:display-buffer (&rest args)
|
||||||
(if (imalison:use-other-frame-or-window args)
|
(if (imalison:use-other-frame-or-window args)
|
||||||
(apply 'imalison:display-buffer-other-frame-or-window args)
|
(apply 'imalison:display-buffer-other-frame-or-window args)
|
||||||
(apply 'display-buffer-same-window args)))
|
(apply 'display-buffer-same-window args)))
|
||||||
|
|
||||||
(defun imalison:display-buffer-other-frame-or-window (buffer &rest args)
|
(defun imalison:display-buffer-other-frame-or-window (buffer &rest args)
|
||||||
(if (imalison:use-frames-only)
|
(if (imalison:use-frames-only)
|
||||||
(display-buffer buffer '((display-buffer-reuse-window
|
(display-buffer buffer '((display-buffer-reuse-window
|
||||||
display-buffer-pop-up-frame)
|
display-buffer-pop-up-frame)
|
||||||
@ -1170,26 +1172,26 @@ programming mode.
|
|||||||
(inhibit-same-window . t)) t)
|
(inhibit-same-window . t)) t)
|
||||||
(apply 'display-buffer-reuse-window args)))
|
(apply 'display-buffer-reuse-window args)))
|
||||||
|
|
||||||
(defun imalison:split-window-right ()
|
(defun imalison:split-window-right ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (imalison:use-frames-only)
|
(if (imalison:use-frames-only)
|
||||||
(make-frame)
|
(make-frame)
|
||||||
(split-window-right)))
|
(split-window-right)))
|
||||||
|
|
||||||
(defun imalison:other-window (&rest args)
|
(defun imalison:other-window (&rest args)
|
||||||
(interactive
|
(interactive
|
||||||
(list 1))
|
(list 1))
|
||||||
(if (imalison:use-frames-only)
|
(if (imalison:use-frames-only)
|
||||||
(apply 'other-frame args)
|
(apply 'other-frame args)
|
||||||
(apply 'other-window args)))
|
(apply 'other-window args)))
|
||||||
|
|
||||||
(bind-key "C-c s" 'imalison:other-window-or-frame-next-command)
|
(bind-key "C-c s" 'imalison:other-window-or-frame-next-command)
|
||||||
|
|
||||||
(bind-key "C-x o" 'imalison:other-window)
|
(bind-key "C-x o" 'imalison:other-window)
|
||||||
(bind-key "C-x 3" 'imalison:split-window-right)
|
(bind-key "C-x 3" 'imalison:split-window-right)
|
||||||
(bind-key "C-x O" (lambda () (interactive) (imalison:other-window -1)))
|
(bind-key "C-x O" (lambda () (interactive) (imalison:other-window -1)))
|
||||||
|
|
||||||
(setq display-buffer-alist
|
(setq display-buffer-alist
|
||||||
'((".*popup\*" . (display-buffer-pop-up-window))
|
'((".*popup\*" . (display-buffer-pop-up-window))
|
||||||
;; XXX: This was a failed attempt to get magit-commit to properly use
|
;; XXX: This was a failed attempt to get magit-commit to properly use
|
||||||
;; frames.
|
;; frames.
|
||||||
@ -1203,9 +1205,7 @@ programming mode.
|
|||||||
;; (inhibit-same-window . t))))
|
;; (inhibit-same-window . t))))
|
||||||
(".*" . ((imalison:display-buffer display-buffer-same-window
|
(".*" . ((imalison:display-buffer display-buffer-same-window
|
||||||
display-buffer-pop-up-frame)
|
display-buffer-pop-up-frame)
|
||||||
((reusable-frames . t))))))
|
((reusable-frames . t)))))))
|
||||||
|
|
||||||
(setq display-buffer-alist nil)
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Fill Setup
|
** Fill Setup
|
||||||
Get rid of nags about requiring setences to end with two spaces.
|
Get rid of nags about requiring setences to end with two spaces.
|
||||||
@ -4481,6 +4481,7 @@ Ensure all themes that I use are installed:
|
|||||||
:diminish (page-break-lines-mode)
|
:diminish (page-break-lines-mode)
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
|
(add-to-list 'page-break-lines-modes 'prog-mode)
|
||||||
(global-page-break-lines-mode +1)))
|
(global-page-break-lines-mode +1)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** helm-themes
|
** helm-themes
|
||||||
|
Loading…
Reference in New Issue
Block a user