This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "ELPA".
The branch, master has been updated via 839ab0cf78b9cd4d35dc760bdff92a4d10536781 (commit) via 30540f0d8e7edfbdc955e00f5ab4f76b27157f67 (commit) via 04c6addb90fd5763baf28f543a0356d4b3e19dfc (commit) via 841f2678fe49fa1f6ce19fcaadf90f2d36bf10df (commit) via 40d439b14842f8658b2ecc12cd7c43f8a4da73b6 (commit) from 0a76035422903c12a6ad6e9d26244b8ddafec59f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 839ab0cf78b9cd4d35dc760bdff92a4d10536781 Author: Leo Liu <sdl....@gmail.com> Date: Sun Aug 18 11:56:53 2013 +0800 Add temp-buffer-browse to externals-list diff --git a/externals-list b/externals-list index ef40b34..ac809e6 100644 --- a/externals-list +++ b/externals-list @@ -29,6 +29,7 @@ ("ioccur" :subtree "https://github.com/thierryvolpiatto/ioccur.git") ("js2-mode" :subtree "https://github.com/mooz/js2-mode.git") ;;FIXME:("org" :external ??) ;; Need to introduce snapshots!! + ("temp-buffer-browse" :subtree "https://github.com/leoliu/temp-buffer-browse") ;;FIXME:("vlf" :subtree ??) ("websocket" :subtree "https://github.com/ahyatt/emacs-websocket.git") ;;FIXME:("yasnippet" :subtree "https://github.com/capitaomorte/yasnippet.git") commit 30540f0d8e7edfbdc955e00f5ab4f76b27157f67 Merge: 0a76035 04c6add Author: Leo Liu <sdl....@gmail.com> Date: Sun Aug 18 11:54:38 2013 +0800 Merge temp-buffer-browse as our subdirectory diff --cc packages/temp-buffer-browse/Makefile index 0000000,02fbd33..02fbd33 mode 000000,100644..100644 --- a/packages/temp-buffer-browse/Makefile +++ b/packages/temp-buffer-browse/Makefile diff --cc packages/temp-buffer-browse/README.rst index 0000000,2b96bcd..2b96bcd mode 000000,100644..100644 --- a/packages/temp-buffer-browse/README.rst +++ b/packages/temp-buffer-browse/README.rst diff --cc packages/temp-buffer-browse/temp-buffer-browse.el index 0000000,d58e9d9..d58e9d9 mode 000000,100644..100644 --- a/packages/temp-buffer-browse/temp-buffer-browse.el +++ b/packages/temp-buffer-browse/temp-buffer-browse.el commit 04c6addb90fd5763baf28f543a0356d4b3e19dfc Author: Leo Liu <sdl....@gmail.com> Date: Fri Aug 16 12:58:12 2013 +0800 Fixes for GNU ELPA diff --git a/README.rst b/README.rst index ede4578..2b96bcd 100644 --- a/README.rst +++ b/README.rst @@ -6,6 +6,11 @@ Allow keys ``SPC``, ``DEL`` and ``RET`` immediately following a temp buffer popup to scroll up, scroll down and close the temp buffer window, respectively. +This package is part of `GNU ELPA <http://elpa.gnu.org>`_ +(``M-x list-packages``). + +Patches, feature requests and bug reports are welcome. Thanks. + To use ~~~~~~ diff --git a/temp-buffer-browse.el b/temp-buffer-browse.el index 0d5c38a..d58e9d9 100644 --- a/temp-buffer-browse.el +++ b/temp-buffer-browse.el @@ -1,6 +1,6 @@ ;;; temp-buffer-browse.el --- temp buffer browse mode -*- lexical-binding: t; -*- -;; Copyright (C) 2013 Leo Liu +;; Copyright (C) 2013 Free Software Foundation, Inc. ;; Author: Leo Liu <sdl....@gmail.com> ;; Version: 1.0 commit 841f2678fe49fa1f6ce19fcaadf90f2d36bf10df Author: Leo Liu <sdl....@gmail.com> Date: Wed Aug 14 11:00:28 2013 +0800 Override all variants of RET and DEL keys diff --git a/temp-buffer-browse.el b/temp-buffer-browse.el index e8e1051..0d5c38a 100644 --- a/temp-buffer-browse.el +++ b/temp-buffer-browse.el @@ -63,26 +63,29 @@ non-nil then MAP stays active." (defvar temp-buffer-browse--window nil) (defvar temp-buffer-browse-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-m" - (lambda () - (interactive) - (when (window-live-p temp-buffer-browse--window) - (quit-window nil temp-buffer-browse--window)))) - (define-key map " " - (lambda () - (interactive) - (when (window-live-p temp-buffer-browse--window) - (with-selected-window temp-buffer-browse--window - (condition-case nil - (scroll-up) - (end-of-buffer (quit-window))))))) - (define-key map (kbd "DEL") - (lambda () - (interactive) - (when (window-live-p temp-buffer-browse--window) - (with-selected-window temp-buffer-browse--window - (scroll-up '-))))) + (let ((map (make-sparse-keymap)) + (quit (lambda () + (interactive) + (when (window-live-p temp-buffer-browse--window) + (quit-window nil temp-buffer-browse--window)))) + (up (lambda () + (interactive) + (when (window-live-p temp-buffer-browse--window) + (with-selected-window temp-buffer-browse--window + (condition-case nil + (scroll-up) + (end-of-buffer (quit-window))))))) + (down (lambda () + (interactive) + (when (window-live-p temp-buffer-browse--window) + (with-selected-window temp-buffer-browse--window + (scroll-up '-)))))) + (define-key map "\C-m" quit) + (define-key map [return] quit) + (define-key map " " up) + (define-key map (kbd "DEL") down) + (define-key map [delete] down) + (define-key map [backspace] down) map)) (defun temp-buffer-browse-setup () @@ -119,7 +122,7 @@ the temp buffer window, respectively." ;; When any error happens the keymap is active forever. (with-demoted-errors (or (and (window-live-p temp-buffer-browse--window) - (not (equal (this-command-keys) "\C-m")) + (not (member (this-command-keys) '("\C-m" [return]))) (eq this-command (lookup-key temp-buffer-browse-map (this-command-keys)))) (overlay-put o 'line-prefix nil)))))))) commit 40d439b14842f8658b2ecc12cd7c43f8a4da73b6 Author: Leo Liu <sdl....@gmail.com> Date: Tue Aug 13 10:03:26 2013 +0800 Initial commit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..02fbd33 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.PHONY: all clean + +ELCFILES = $(addsuffix .elc, $(basename $(wildcard *.el))) + +all: $(ELCFILES) + +%.elc : %.el + @echo Compiling $< + @emacs -batch -q -no-site-file -f batch-byte-compile $< + +clean: + @rm -f *.elc diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..ede4578 --- /dev/null +++ b/README.rst @@ -0,0 +1,15 @@ +========================= + Temp Buffer Browse Mode +========================= + +Allow keys ``SPC``, ``DEL`` and ``RET`` immediately following a temp +buffer popup to scroll up, scroll down and close the temp buffer +window, respectively. + +To use +~~~~~~ + +:: + + (require 'temp-buffer-browse) + (temp-buffer-browse-mode 1) diff --git a/temp-buffer-browse.el b/temp-buffer-browse.el new file mode 100644 index 0000000..e8e1051 --- /dev/null +++ b/temp-buffer-browse.el @@ -0,0 +1,136 @@ +;;; temp-buffer-browse.el --- temp buffer browse mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2013 Leo Liu + +;; Author: Leo Liu <sdl....@gmail.com> +;; Version: 1.0 +;; Keywords: convenience + +;; 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 +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Allow keys `SPC', `DEL' and `RET' following a temp buffer popup to +;; scroll up, scroll down and close the temp buffer window, +;; respectively. + +;;; Code: + +(eval-and-compile + (or (fboundp 'set-temporary-overlay-map) ; new in 24.4. + (defun set-temporary-overlay-map (map &optional keep-pred) + "Set MAP as a temporary keymap taking precedence over most other keymaps. +Note that this does NOT take precedence over the \"overriding\" maps +`overriding-terminal-local-map' and `overriding-local-map' (or the +`keymap' text property). Unlike those maps, if no match for a key is +found in MAP, the normal key lookup sequence then continues. + +Normally, MAP is used only once. If the optional argument +KEEP-PRED is t, MAP stays active if a key from MAP is used. +KEEP-PRED can also be a function of no arguments: if it returns +non-nil then MAP stays active." + (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map")) + (overlaysym (make-symbol "t")) + (alist (list (cons overlaysym map))) + (clearfun + `(lambda () + (unless ,(cond ((null keep-pred) nil) + ((eq t keep-pred) + `(eq this-command + (lookup-key ',map + (this-command-keys-vector)))) + (t `(funcall ',keep-pred))) + (set ',overlaysym nil) ;Just in case. + (remove-hook 'pre-command-hook ',clearfunsym) + (setq emulation-mode-map-alists + (delq ',alist emulation-mode-map-alists)))))) + (set overlaysym overlaysym) + (fset clearfunsym clearfun) + (add-hook 'pre-command-hook clearfunsym) + (push alist emulation-mode-map-alists))))) + +(defvar temp-buffer-browse--window nil) + +(defvar temp-buffer-browse-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-m" + (lambda () + (interactive) + (when (window-live-p temp-buffer-browse--window) + (quit-window nil temp-buffer-browse--window)))) + (define-key map " " + (lambda () + (interactive) + (when (window-live-p temp-buffer-browse--window) + (with-selected-window temp-buffer-browse--window + (condition-case nil + (scroll-up) + (end-of-buffer (quit-window))))))) + (define-key map (kbd "DEL") + (lambda () + (interactive) + (when (window-live-p temp-buffer-browse--window) + (with-selected-window temp-buffer-browse--window + (scroll-up '-))))) + map)) + +(defun temp-buffer-browse-setup () + "Browse temp buffers easily. +Set up `SPC', `DEL' and `RET' to scroll up, scroll down and close +the temp buffer window, respectively." + (unless (derived-mode-p 'completion-list-mode) + (setq temp-buffer-browse--window (selected-window)) + ;; When re-using existing window don't call + ;; `fit-window-to-buffer'. See also (info "(elisp)Window + ;; Parameters"). + (when (and (window-full-width-p) + (memq (cadr (window-parameter nil 'quit-restore)) + '(window frame))) + (fit-window-to-buffer nil (floor (frame-height) 2)) + ;; In case buffer contents are inserted asynchronously such as + ;; in `slime-inspector-mode'. + (add-hook 'after-change-functions + (lambda (&rest _) + (fit-window-to-buffer nil (floor (frame-height) 2))) + nil 'local)) + (let ((o (make-overlay (point-min) (point-max)))) + (overlay-put o 'evaporate t) + (overlay-put o 'window t) + (overlay-put o 'line-prefix + (propertize + "|" 'display + (unless (zerop (or (frame-parameter nil 'left-fringe) 0)) + '(left-fringe centered-vertical-bar warning)) + 'face 'warning)) + (set-temporary-overlay-map + temp-buffer-browse-map + (lambda () + ;; When any error happens the keymap is active forever. + (with-demoted-errors + (or (and (window-live-p temp-buffer-browse--window) + (not (equal (this-command-keys) "\C-m")) + (eq this-command (lookup-key temp-buffer-browse-map + (this-command-keys)))) + (overlay-put o 'line-prefix nil)))))))) + +;;;###autoload +(define-minor-mode temp-buffer-browse-mode nil + :lighter "" + :global t + (if temp-buffer-browse-mode + (add-hook 'temp-buffer-show-hook 'temp-buffer-browse-setup t) + (remove-hook 'temp-buffer-show-hook 'temp-buffer-browse-setup))) + +(provide 'temp-buffer-browse) +;;; temp-buffer-browse.el ends here ----------------------------------------------------------------------- Summary of changes: externals-list | 1 + packages/{ggtags => temp-buffer-browse}/Makefile | 0 packages/temp-buffer-browse/README.rst | 20 +++ packages/temp-buffer-browse/temp-buffer-browse.el | 139 +++++++++++++++++++++ 4 files changed, 160 insertions(+), 0 deletions(-) copy packages/{ggtags => temp-buffer-browse}/Makefile (100%) create mode 100644 packages/temp-buffer-browse/README.rst create mode 100644 packages/temp-buffer-browse/temp-buffer-browse.el hooks/post-receive -- ELPA