From 7ee339506ac528a7a4b091c36e350b971ad5d28f Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 15 Jul 2015 08:12:15 +0200 Subject: [PATCH] new versions of guide-key and popwin. --- bba.org | 4 +- elpa/guide-key-20140828.807/guide-key-pkg.el | 1 - .../guide-key-autoloads.el | 12 +--- elpa/guide-key-20150107.2235/guide-key-pkg.el | 1 + .../guide-key.el | 71 ++++++++++++------- elpa/popwin-20140902.1727/popwin-pkg.el | 1 - .../popwin-autoloads.el | 15 +--- elpa/popwin-20150315.600/popwin-pkg.el | 1 + .../popwin.el | 24 ++++--- 9 files changed, 72 insertions(+), 58 deletions(-) delete mode 100644 elpa/guide-key-20140828.807/guide-key-pkg.el rename elpa/{guide-key-20140828.807 => guide-key-20150107.2235}/guide-key-autoloads.el (79%) create mode 100644 elpa/guide-key-20150107.2235/guide-key-pkg.el rename elpa/{guide-key-20140828.807 => guide-key-20150107.2235}/guide-key.el (91%) delete mode 100644 elpa/popwin-20140902.1727/popwin-pkg.el rename elpa/{popwin-20140902.1727 => popwin-20150315.600}/popwin-autoloads.el (83%) create mode 100644 elpa/popwin-20150315.600/popwin-pkg.el rename elpa/{popwin-20140902.1727 => popwin-20150315.600}/popwin.el (98%) diff --git a/bba.org b/bba.org index a9033a9b..62639da9 100644 --- a/bba.org +++ b/bba.org @@ -278,8 +278,8 @@ snippets. Some help for Perl and even for org-mode. Probably the best help to keep track of the not every day used keybindings. #+BEGIN_SRC emacs-lisp - (add-to-list 'load-path "~/.emacs.d/elpa/popwin-20140902.1727") - (add-to-list 'load-path "~/.emacs.d/elpa/guide-key-20140828.807") + (add-to-list 'load-path "~/.emacs.d/elpa/popwin-20150315.600") + (add-to-list 'load-path "~/.emacs.d/elpa/guide-key-20150107.2235") (require 'guide-key) (setq guide-key/guide-key-sequence '("C-x" "C-x 4" "C-c" "C-x l" "")) (setq guide-key/recursive-key-sequence-flag t) diff --git a/elpa/guide-key-20140828.807/guide-key-pkg.el b/elpa/guide-key-20140828.807/guide-key-pkg.el deleted file mode 100644 index d2659e23..00000000 --- a/elpa/guide-key-20140828.807/guide-key-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "guide-key" "20140828.807" "Guide the following key bindings automatically and dynamically" (quote ((popwin "0.3.0")))) diff --git a/elpa/guide-key-20140828.807/guide-key-autoloads.el b/elpa/guide-key-20150107.2235/guide-key-autoloads.el similarity index 79% rename from elpa/guide-key-20140828.807/guide-key-autoloads.el rename to elpa/guide-key-20150107.2235/guide-key-autoloads.el index ddbc13d9..57b593e8 100644 --- a/elpa/guide-key-20140828.807/guide-key-autoloads.el +++ b/elpa/guide-key-20150107.2235/guide-key-autoloads.el @@ -1,10 +1,9 @@ ;;; guide-key-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -;;;### (autoloads (guide-key-mode) "guide-key" "guide-key.el" (21520 -;;;;;; 11977 0 0)) +;;;### (autoloads nil "guide-key" "guide-key.el" (21908 14266 0 0)) ;;; Generated autoloads from guide-key.el (defvar guide-key-mode nil "\ @@ -28,16 +27,9 @@ positive, otherwise disable. ;;;*** -;;;### (autoloads nil nil ("guide-key-pkg.el") (21520 11977 525636 -;;;;;; 0)) - -;;;*** - -(provide 'guide-key-autoloads) ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; guide-key-autoloads.el ends here diff --git a/elpa/guide-key-20150107.2235/guide-key-pkg.el b/elpa/guide-key-20150107.2235/guide-key-pkg.el new file mode 100644 index 00000000..cb609081 --- /dev/null +++ b/elpa/guide-key-20150107.2235/guide-key-pkg.el @@ -0,0 +1 @@ +(define-package "guide-key" "20150107.2235" "Guide the following key bindings automatically and dynamically" '((dash "2.10.0") (popwin "0.3.0") (s "1.9.0")) :url "https://github.com/kai2nenobu/guide-key" :keywords '("help" "convenience")) diff --git a/elpa/guide-key-20140828.807/guide-key.el b/elpa/guide-key-20150107.2235/guide-key.el similarity index 91% rename from elpa/guide-key-20140828.807/guide-key.el rename to elpa/guide-key-20150107.2235/guide-key.el index ae0f40ba..7f318a61 100644 --- a/elpa/guide-key-20140828.807/guide-key.el +++ b/elpa/guide-key-20150107.2235/guide-key.el @@ -4,9 +4,9 @@ ;; Author: Tsunenobu Kai ;; URL: https://github.com/kai2nenobu/guide-key -;; Version: 20140828.807 -;; X-Original-Version: 1.2.3 -;; Package-Requires: ((popwin "0.3.0")) +;; Package-Version: 20150107.2235 +;; Version: 1.2.5 +;; Package-Requires: ((dash "2.10.0") (popwin "0.3.0") (s "1.9.0")) ;; Keywords: help convenience ;; This program is free software; you can redistribute it and/or modify @@ -62,18 +62,30 @@ ;; When you press these prefix keys, key bindings are automatically ;; popped up after a short delay (1 second by default). ;; +;; To activate guide-key for any key sequence instead of just the ones +;; listed above then use: +;; +;; (setq guide-key/guide-key-sequence t) +;; ;; guide-key can highlight commands which match a specified regular expression. -;; Key bindings following "C-x r" are rectangle family and register family. -;; If you want to highlight only rectangle family commands, put this setting -;; in your init.el. +;; Key bindings following "C-x r" are rectangle family, register family and +;; bookmark family. If you want to highlight only rectangle family +;; commands, put this setting in your init.el. ;; ;; (setq guide-key/highlight-command-regexp "rectangle") ;; -;; This feature makes it easy to find commands and learn their key bindings. If -;; you want to highlight both rectangle family and register family, set an -;; adequate regular expression like this. +;; This feature makes it easy to find commands and learn their key bindings. +;; If you want to highlight all families, you can specify multiple regular +;; expressions and faces as below. ;; -;; (setq guide-key/highlight-command-regexp "rectangle\\|register") +;; (setq guide-key/highlight-command-regexp +;; '("rectangle" +;; ("register" . font-lock-type-face) +;; ("bookmark" . font-lock-warning-face))) +;; +;; If an element of `guide-key/highlight-command-regexp' is cons, its car +;; means a regular expression to highlight, and its cdr means a face put on +;; command names. ;; ;; Moreover, prefix commands are automatically highlighted. ;; @@ -192,10 +204,12 @@ ;;; Code: (eval-when-compile - (require 'cl)) + (require 'cl) + (require 'face-remap)) +(require 'dash) (require 'popwin) -(require 'face-remap) +(require 's) ;;; variables (defgroup guide-key nil @@ -211,7 +225,9 @@ are allowed. In addition, an element of this list can be a list whose car is the symbol for a certain mode, and whose cdr is a list of key -sequences to consider only if that mode is active." +sequences to consider only if that mode is active. + +Set this variable to `t' to enable for any key sequence." :type '(repeat (choice (string :tag "Prefix key sequence") (cons :tag "Mode specific sequence" (symbol :tag "Symbol for mode") @@ -239,14 +255,16 @@ If a command name matches this regexp, it is highlighted with `guide-key/highlight-command-face'. This variable can be a list and its element is either a regexp or -a cons cell, its car is a regexp and its cdr is a face. If -regexp, commands which match the regexp are highlighted with -`guide-key/highlight-command-face'. If cons cell, commands -which match the car regexp are highlighted with the cdr face." +a cons cell, its car is a regexp and its cdr is face symbol or +color name string. If regexp, commands which match the regexp +are highlighted with `guide-key/highlight-command-face'. If cons +cell, commands which match the car regexp are highlighted with +the cdr face or color." :type '(choice (regexp :tag "Regexp to highlight") (repeat (choice (regexp :tag "Regexp to highlight") (cons (regexp :tag "Regexp to highlight") - (face :tag "Face on command"))))) + (choice (face :tag "Face on command") + (string :tag "Color name string")))))) :group 'guide-key) (defcustom guide-key/align-command-by-space-flag nil @@ -337,7 +355,7 @@ positive, otherwise disable." (defun guide-key/popup-function (&optional input) "Popup function called after delay of `guide-key/idle-delay' second." - (let ((key-seq (or input (this-command-keys-vector))) + (let ((key-seq (or input (this-single-command-keys))) (regexp guide-key/highlight-command-regexp)) (let ((dsc-buf (current-buffer)) (max-width 0)) @@ -356,7 +374,7 @@ positive, otherwise disable." ;;; internal functions (defun guide-key/polling-function () "Polling function executed every `guide-key/polling-time' second." - (let ((key-seq (this-command-keys-vector))) + (let ((key-seq (this-single-command-keys))) (if (guide-key/popup-guide-buffer-p key-seq) (when (guide-key/update-guide-buffer-p key-seq) (guide-key/turn-on-idle-timer)) @@ -405,11 +423,12 @@ window. Otherwise, return the width of popup window" (defun guide-key/popup-guide-buffer-p (key-seq) "Return t if guide buffer should be popped up." (and (> (length key-seq) 0) - (or (member key-seq (guide-key/buffer-key-seqences)) + (or (eq guide-key/guide-key-sequence t) + (member key-seq (guide-key/buffer-key-sequences)) (and guide-key/recursive-key-sequence-flag (guide-key/popup-guide-buffer-p (guide-key/vbutlast key-seq)))))) -(defun guide-key/buffer-key-seqences () +(defun guide-key/buffer-key-sequences () "Return a list of key sequences (vector representation) in current buffer." (let (lst) ;; global key sequences @@ -533,7 +552,10 @@ appropriate face is not found." 'guide-key/highlight-command-face)) ((consp elm) (when (string-match (car elm) string) - (cdr elm)))) + (if (stringp (cdr elm)) + ;; anonymous face, see (info "(elisp)Faces") + (list :foreground (cdr elm)) + (cdr elm))))) return it))) ))) @@ -606,10 +628,11 @@ functions; this-command-keys and this-command-keys-vector." ;;; debug (defun guide-key/message-events () "" - (message (format "lce:%S tck:%S tckv:%S lie:%S uce:%S" + (message (format "lce:%S tck:%S tckv:%S tsck:%S lie:%S uce:%S" last-command-event (this-command-keys) (this-command-keys-vector) + (this-single-command-keys) last-input-event unread-command-events ))) diff --git a/elpa/popwin-20140902.1727/popwin-pkg.el b/elpa/popwin-20140902.1727/popwin-pkg.el deleted file mode 100644 index c6644f3e..00000000 --- a/elpa/popwin-20140902.1727/popwin-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "popwin" "20140902.1727" "Popup Window Manager." (quote nil)) diff --git a/elpa/popwin-20140902.1727/popwin-autoloads.el b/elpa/popwin-20150315.600/popwin-autoloads.el similarity index 83% rename from elpa/popwin-20140902.1727/popwin-autoloads.el rename to elpa/popwin-20150315.600/popwin-autoloads.el index ef2294f8..e6feec0d 100644 --- a/elpa/popwin-20140902.1727/popwin-autoloads.el +++ b/elpa/popwin-20150315.600/popwin-autoloads.el @@ -1,12 +1,9 @@ ;;; popwin-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -;;;### (autoloads (popwin:messages popwin:find-file-tail popwin:find-file -;;;;;; popwin:popup-buffer-tail popwin:one-window popwin:universal-display -;;;;;; popwin:pop-to-buffer popwin:display-buffer popwin:popup-buffer) -;;;;;; "popwin" "popwin.el" (21520 11976 0 0)) +;;;### (autoloads nil "popwin" "popwin.el" (21908 14200 0 0)) ;;; Generated autoloads from popwin.el (autoload 'popwin:popup-buffer "popwin" "\ @@ -36,7 +33,7 @@ Same as `pop-to-buffer' except that this function will use (autoload 'popwin:universal-display "popwin" "\ Call the following command interactively with letting `popwin:special-display-config' be -`popwin:universal-display-config'. This wil be useful when +`popwin:universal-display-config'. This will be useful when displaying buffers in popup windows temporarily. \(fn)" t nil) @@ -71,15 +68,9 @@ Display *Messages* buffer in a popup window. ;;;*** -;;;### (autoloads nil nil ("popwin-pkg.el") (21520 11976 628600 0)) - -;;;*** - -(provide 'popwin-autoloads) ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; popwin-autoloads.el ends here diff --git a/elpa/popwin-20150315.600/popwin-pkg.el b/elpa/popwin-20150315.600/popwin-pkg.el new file mode 100644 index 00000000..c20df1b6 --- /dev/null +++ b/elpa/popwin-20150315.600/popwin-pkg.el @@ -0,0 +1 @@ +(define-package "popwin" "20150315.600" "Popup Window Manager." 'nil :keywords '("convenience")) diff --git a/elpa/popwin-20140902.1727/popwin.el b/elpa/popwin-20150315.600/popwin.el similarity index 98% rename from elpa/popwin-20140902.1727/popwin.el rename to elpa/popwin-20150315.600/popwin.el index 98a74137..6bb6c536 100644 --- a/elpa/popwin-20140902.1727/popwin.el +++ b/elpa/popwin-20150315.600/popwin.el @@ -1,11 +1,11 @@ ;;; popwin.el --- Popup Window Manager. -;; Copyright (C) 2011, 2012, 2013, 2014 Tomohiro Matsuyama +;; Copyright (C) 2011-2015 Tomohiro Matsuyama -;; Author: Tomohiro Matsuyama +;; Author: Tomohiro Matsuyama ;; Keywords: convenience -;; Version: 20140902.1727 -;; X-Original-Version: 0.7.0alpha +;; Package-Version: 20150315.600 +;; Version: 1.0.0 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ (eval-when-compile (require 'cl)) -(defconst popwin:version "0.7.0alpha") +(defconst popwin:version "1.0.0") @@ -101,6 +101,11 @@ the selected window." (switch-to-buffer buffer-or-name norecord t) (switch-to-buffer buffer-or-name norecord)))) +(defun popwin:select-window (window &optional norecord) + "Call `select-window' with saving the current buffer." + (save-current-buffer + (select-window window norecord))) + (defun popwin:buried-buffer-p (buffer) "Return t if BUFFER might be thought of as a buried buffer." (eq (car (last (buffer-list))) buffer)) @@ -190,7 +195,10 @@ HFACTOR, and vertical factor VFACTOR." (window-dedicated-p node)) (destructuring-bind (dir edges . windows) node (append (list dir edges) - (mapcar 'popwin:window-config-tree-1 windows))))) + (loop for window in windows + unless (and (windowp window) + (window-parameter window 'window-side)) + collect (popwin:window-config-tree-1 window)))))) (defun popwin:window-config-tree () "Return `window-tree' with replacing window values in the tree @@ -212,7 +220,7 @@ new-window." (with-selected-window window (popwin:switch-to-buffer buffer t)) (when selected - (select-window window)) + (popwin:select-window window)) (set-window-point window point) (set-window-start window start t) (when dedicated @@ -981,7 +989,7 @@ be used for `popwin:universal-display'." (defun popwin:universal-display () "Call the following command interactively with letting `popwin:special-display-config' be -`popwin:universal-display-config'. This wil be useful when +`popwin:universal-display-config'. This will be useful when displaying buffers in popup windows temporarily." (interactive) (let ((command (key-binding (read-key-sequence "" t))) -- 2.47.3