From d2fca3fdf418ee1ffceda81010ae47ef598506b1 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 13 Nov 2018 12:44:56 +0100 Subject: [PATCH] update fullframe. Signed-off-by: Andreas Gerler --- bba.org | 3 +- elpa/fullframe-20160209.2318/fullframe-pkg.el | 1 - .../fullframe-autoloads.el | 10 ++- elpa/fullframe-20170816.1003/fullframe-pkg.el | 2 + .../fullframe.el | 82 ++++++++++++------- 5 files changed, 63 insertions(+), 35 deletions(-) delete mode 100644 elpa/fullframe-20160209.2318/fullframe-pkg.el rename elpa/{fullframe-20160209.2318 => fullframe-20170816.1003}/fullframe-autoloads.el (86%) create mode 100644 elpa/fullframe-20170816.1003/fullframe-pkg.el rename elpa/{fullframe-20160209.2318 => fullframe-20170816.1003}/fullframe.el (71%) diff --git a/bba.org b/bba.org index a680f95e..c1bcc364 100644 --- a/bba.org +++ b/bba.org @@ -317,10 +317,9 @@ open ibuffer and magit-status in fullframe mode. #+BEGIN_SRC emacs-lisp :tangle no (if (>= emacs-major-version 25) (progn - (add-to-list 'load-path "~/.emacs.d/elpa/fullframe-20160209.2318") + (add-to-list 'load-path "~/.emacs.d/elpa/fullframe-20170816.1003") (require 'fullframe) (fullframe magit-status magit-mode-quit-window) - (fullframe ibuffer) ) ) #+END_SRC diff --git a/elpa/fullframe-20160209.2318/fullframe-pkg.el b/elpa/fullframe-20160209.2318/fullframe-pkg.el deleted file mode 100644 index bf7b69d7..00000000 --- a/elpa/fullframe-20160209.2318/fullframe-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "fullframe" "20160209.2318" "Generalized automatic execution in a single frame" '((cl-lib "0.5")) :keywords '("fullscreen")) diff --git a/elpa/fullframe-20160209.2318/fullframe-autoloads.el b/elpa/fullframe-20170816.1003/fullframe-autoloads.el similarity index 86% rename from elpa/fullframe-20160209.2318/fullframe-autoloads.el rename to elpa/fullframe-20170816.1003/fullframe-autoloads.el index 9512c16e..0e174900 100644 --- a/elpa/fullframe-20160209.2318/fullframe-autoloads.el +++ b/elpa/fullframe-20170816.1003/fullframe-autoloads.el @@ -1,9 +1,12 @@ ;;; fullframe-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + -;;;### (autoloads nil "fullframe" "fullframe.el" (22215 7657 0 0)) +;;;### (autoloads nil "fullframe" "fullframe.el" (0 0 0 0)) ;;; Generated autoloads from fullframe.el (autoload 'fullframe/current-buffer-window-config "fullframe" "\ @@ -48,11 +51,14 @@ the window it generated is the only one in in the frame. \(fn COMMAND-ON COMMAND-OFF &optional KILL-ON-COFF AFTER-COMMAND-ON-FUNC)" nil t) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "fullframe" '("fullframe/"))) + ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; fullframe-autoloads.el ends here diff --git a/elpa/fullframe-20170816.1003/fullframe-pkg.el b/elpa/fullframe-20170816.1003/fullframe-pkg.el new file mode 100644 index 00000000..70a4b735 --- /dev/null +++ b/elpa/fullframe-20170816.1003/fullframe-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "fullframe" "20170816.1003" "Generalized automatic execution in a single frame" '((cl-lib "0.5")) :commit "d6a5217f7f2a5a5edcb75140f3fa69b3a50f1cdd" :keywords '("fullscreen") :authors '(("Tom Regner" . "tom@goochesa.de")) :maintainer '("Tom Regner" . "tom@goochesa.de")) diff --git a/elpa/fullframe-20160209.2318/fullframe.el b/elpa/fullframe-20170816.1003/fullframe.el similarity index 71% rename from elpa/fullframe-20160209.2318/fullframe.el rename to elpa/fullframe-20170816.1003/fullframe.el index 9ae45250..4f1c7c89 100644 --- a/elpa/fullframe-20160209.2318/fullframe.el +++ b/elpa/fullframe-20170816.1003/fullframe.el @@ -4,8 +4,8 @@ ;; Author: Tom Regner ;; Maintainer: Tom Regner -;; Version: 0.4.0 -;; Package-Version: 20160209.2318 +;; Version: 0.5.0 +;; Package-Version: 20170816.1003 ;; Keywords: fullscreen ;; Package-Requires: ((cl-lib "0.5")) @@ -43,11 +43,26 @@ ;;; Code: -(eval-when-compile - (require 'cl)) +(require 'cl-lib) ;; customization -;; - none +;; + +(defcustom fullframe/advice-generic-quit-commands nil + "If set to a non-nil value, on each call to fullframe ALL +functions in `fullframe/generic-exit-frame-commands' will be +adviced to restore the previous window configuration, not only +the one given as `exit-cmd' to the fullframe-call. + +The default value is `nil'." + :type '(boolean) + :group 'fullframe) + +(defcustom fullframe/generic-quit-commands + '(kill-this-buffer kill-current-buffer kill-buffer-and-window kill-other-buffer-and-window bury-buffer) + "List of functions that will adviced in addition to `command-off', iff `fullframe/advice-generic-quit-commands' is not `nil'" + :type '(set :value-type function) + :group 'fullframe) ;; variables (defvar fullframe/previous-window-configuration nil @@ -123,16 +138,16 @@ Idea attributed to Peter Seibel where I found it." not `nil', the window holding SECOND-BUFFER will be activated. " `(fullframe ,command-on - ,command-off - nil - (lambda () - (let ((wconf (fullframe/current-buffer-window-config)) - (new-window (if (eq 'horizontal ,direction)(split-window-right)(split-window-below)))) - (set-window-buffer new-window ,second-buffer) - (fullframe/erase-current-buffer-window-config) - (if ,switch-to-second-buffer (select-window new-window)) - (with-current-buffer ,second-buffer - (fullframe/set-current-buffer-window-config wconf)))))) + ,command-off + nil + (lambda () + (let ((wconf (fullframe/current-buffer-window-config)) + (new-window (if (eq 'horizontal ,direction)(split-window-right)(split-window-below)))) + (set-window-buffer new-window ,second-buffer) + (fullframe/erase-current-buffer-window-config) + (if ,switch-to-second-buffer (select-window new-window)) + (with-current-buffer ,second-buffer + (fullframe/set-current-buffer-window-config wconf)))))) ;;;###autoload (defmacro fullframe (command-on command-off &optional kill-on-coff after-command-on-func) @@ -161,34 +176,41 @@ the window it generated is the only one in in the frame. (list `(funcall #',after-command-on-func))))) (off-code `(progn (fullframe/maybe-restore-configuration ,window-config) - ,@(when kill-on-coff (list `(kill-buffer ,buf)))))) + ,@(when kill-on-coff (list `(kill-buffer ,buf))))) + (exit-cmds `(append (if fullframe/advice-generic-quit-commands fullframe/generic-quit-commands nil) + (if (and (not (functionp ',command-off)) (listp ',command-off)) ',command-off (list ',command-off))))) (if (version< emacs-version "24.4") `(progn + (require 'fullframe) (defadvice ,command-on (around fullframe activate) (let ((,window-config (current-window-configuration))) ad-do-it ,on-code)) - (defadvice ,command-off (around fullframe activate) - (let ((,window-config fullframe/previous-window-configuration) - (,buf (current-buffer))) - (prog1 - ad-do-it - ,off-code)))) + (dolist (coff ,exit-cmds) + (defadvice coff (around fullframe activate) + (let ((,window-config fullframe/previous-window-configuration) + (,buf (current-buffer))) + (prog1 + ad-do-it + ,off-code))))) `(progn + (require 'fullframe) (advice-add #',command-on :around #'(lambda (orig-fun &rest args) (let ((,window-config (current-window-configuration))) (apply orig-fun args) ,on-code)) '((name . "fullframe-command-on-advice"))) - (advice-add #',command-off :around - #'(lambda (orig-fun &rest args) - (let ((,window-config fullframe/previous-window-configuration) - (,buf (current-buffer))) - (prog1 - (apply orig-fun args) - ,off-code))) - '((name . "fullframe-command-off-advice")))))))) + (dolist (coff ,exit-cmds) + (progn + (advice-add coff :around + #'(lambda (orig-fun &rest args) + (let ((,window-config fullframe/previous-window-configuration) + (,buf (current-buffer))) + (prog1 + (apply orig-fun args) + ,off-code))) + '((name . "fullframe-command-off-advice")))))))))) ;; interactive functions ;; - none -- 2.47.3