el-x-0.3.1/0000755000175000017500000000000012620206332012206 5ustar dogslegdogslegel-x-0.3.1/el-x-pkg.el.in0000644000175000017500000000012112620206332014553 0ustar dogslegdogsleg(define-package "el-x" "@VERSION@" "Emacs-lisp extensions." '((cl-lib "0.2"))) el-x-0.3.1/README0000644000175000017500000000041412620206332013065 0ustar dogslegdogslegBecause sometimes, Emacs core is not enough. Content: - dflet.el: defines the `dflet' macro, to provide the historic behavior of `flet', a global and dynamic temporary function (re)definition tool. - subr-compat.el: stubs `declare-function' for older Emacs el-x-0.3.1/Makefile0000644000175000017500000000132612620206332013650 0ustar dogslegdogslegPROJECT=el-x VERSION=$(shell git describe --tags --dirty) EMACS=emacs SRC=lisp ELS=$(wildcard $(SRC)/*.el) ELCS=$(ELS:.el=.elc) ELPA_FILES=$(ELS) $(PROJECT)-pkg.el EFLAGS= BATCH=$(EMACS) $(EFLAGS) -batch -q -no-site-file -eval \ "(setq load-path (cons (expand-file-name \"$(SRC)\") load-path))" %.elc: %.el $(BATCH) --eval '(byte-compile-file "$<")' all: $(ELCS) $(PROJECT)-pkg.el: $(PROJECT)-pkg.el.in sed -e s/@VERSION@/$(VERSION)/ < $< > $@ elpa: $(PROJECT)-$(VERSION).tar $(PROJECT)-$(VERSION).tar: $(ELPA_FILES) mkdir $(PROJECT)-$(VERSION) cp $(ELPA_FILES) $(PROJECT)-$(VERSION) tar -cvf $(PROJECT)-$(VERSION).tar $(PROJECT)-$(VERSION) rm -rf $(PROJECT)-$(VERSION) clean: rm -f $(ELCS) $(PROJECT)-pkg.el el-x-0.3.1/Cask0000644000175000017500000000030012620206332013003 0ustar dogslegdogsleg(source gnu) (source melpa-stable) (package "el-x" "0.3.1" "Emacs-lisp extensions.") (depends-on "cl-lib" "0.2") (development (depends-on "ert-runner") (depends-on "shut-up")) el-x-0.3.1/.gitignore0000644000175000017500000000003112620206332014170 0ustar dogslegdogsleg/el-x-pkg.el /lisp/*.elc el-x-0.3.1/.bumpversion.cfg0000644000175000017500000000022312620206332015313 0ustar dogslegdogsleg[bumpversion] current_version = 0.3.1 commit = True tag = True tag_name = v{new_version} [bumpversion:file:el-x-pkg.el] [bumpversion:file:Cask] el-x-0.3.1/lisp/0000755000175000017500000000000012620206332013155 5ustar dogslegdogslegel-x-0.3.1/lisp/el-x.el0000644000175000017500000000200212620206332014336 0ustar dogslegdogsleg;;; el-x.el --- main entry point for el-x package ;; Copyright (C) 2012 Yann Hodique ;; Author: Yann Hodique ;; Keywords: lisp ;; This file 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 2, or (at your option) ;; any later version. ;; This file 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 GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Because sometimes Emacs core is not enough... ;;; Code: (require 'subr-compat) (require 'dflet) (provide 'el-x) ;;; el-x.el ends here el-x-0.3.1/lisp/subr-compat.el0000644000175000017500000000217512620206332015740 0ustar dogslegdogsleg;;; subr-compat.el --- subr.el compatibility layer ;; Copyright (C) 2012 Yann Hodique ;; Author: Yann Hodique ;; Keywords: lisp ;; This file 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 2, or (at your option) ;; any later version. ;; This file 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 GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Allow `declare-function' to be used in older Emacs versions. Even if that ;; means doing exactly nothing. ;;; Code: (or (fboundp 'declare-function) (defmacro declare-function (&rest args) nil)) (provide 'subr-compat) ;;; subr-compat.el ends here el-x-0.3.1/lisp/dflet.el0000644000175000017500000001043212620206332014575 0ustar dogslegdogsleg;;; dflet.el --- dynamically-scoped flet ;; Copyright (C) 2012 Yann Hodique ;; Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc. ;; Author: Yann Hodique ;; Keywords: lisp ;; This file 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 2, or (at your option) ;; any later version. ;; This file 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 GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; This is bringing back the historical definition of `flet', in all its global ;; and dynamic splendor. ;;; Code: (eval-when-compile (require 'cl) (require 'macroexp) (require 'subr-compat)) (ignore-errors (require 'cl-lib)) ;;; silence byte-compiler (eval-when-compile (unless (fboundp 'cl--compiling-file) ;; should be in cl-lib (cond ((version< emacs-version "24.3") ;; sure it doesn't exist, but it won't be called anyway... (autoload 'cl--compiling-file "cl")) ((version= emacs-version "24.3.1") (declare-function cl--compiling-file "cl" t t))))) (cond ((version< emacs-version "24.3") ;; before that version, flet was not marked as obsolete, so use it (defalias 'dflet 'flet)) ((version= emacs-version "24.3.1") (defmacro dflet (bindings &rest body) "Make temporary overriding function definitions. This is an analogue of a dynamically scoped `let' that operates on the function cell of FUNCs rather than their value cell. \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" `(letf ,(mapcar (lambda (x) (if (or (and (fboundp (car x)) (eq (car-safe (symbol-function (car x))) 'macro)) (cdr (assq (car x) macroexpand-all-environment))) (error "Use `labels', not `dflet', to rebind macro names")) (let ((func `(cl-function (lambda ,(cadr x) (cl-block ,(car x) ,@(cddr x)))))) (when (cl--compiling-file) ;; Bug#411. It would be nice to fix this. (and (get (car x) 'byte-compile) (error "Byte-compiling a redefinition of `%s' \ will not work - use `labels' instead" (symbol-name (car x)))) ;; FIXME This affects the rest of the file, when it ;; should be restricted to the flet body. (and (boundp 'byte-compile-function-environment) (push (cons (car x) (eval func)) byte-compile-function-environment))) (list `(symbol-function ',(car x)) func))) bindings) ,@body))) (t (defmacro dflet (bindings &rest body) "Make temporary overriding function definitions. This is an analogue of a dynamically scoped `let' that operates on the function cell of FUNCs rather than their value cell. \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" (declare (indent 1) (debug cl-flet)) `(cl-letf ,(mapcar (lambda (x) (list (list 'symbol-function (list 'quote (car x))) (cons 'lambda (cons (cadr x) (cddr x))))) bindings) ,@body)))) ;;;###autoload (autoload 'dflet "dflet") ;;;###autoload (defmacro adflet (bindings &rest body) "Anaphoric version of `dflet'. Binds `this-fn' to the original definition of the function." `(dflet ,(mapcar (lambda (x) (list (car x) (cadr x) `(let ((this-fn ,(symbol-function (car x)))) ,@(cddr x)))) bindings) ,@body)) (provide 'dflet) ;;; dflet.el ends here el-x-0.3.1/.travis.yml0000644000175000017500000000110612620206332014315 0ustar dogslegdogsleglanguage: emacs-lisp sudo: false env: - EVM_EMACS=emacs-24.1-travis - EVM_EMACS=emacs-24.2-travis - EVM_EMACS=emacs-24.3-travis - EVM_EMACS=emacs-24.4-travis - EVM_EMACS=emacs-24.5-travis before_install: - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > travis.sh && source ./travis.sh - evm install "$EVM_EMACS" --use --skip script: make clean all notifications: slack: secure: F5LQIeAJ+q6BFpeBTyonzWD/KNKE4GsKHErKXQ7V9xDvh3uY1NF8aYwfkcT3GC8vzdcIitZjSjUkp4twC8T7E5JzaVaHiV25R1Eg7UqsvlM880tsQy7XCpFknhqm2GnBa026zWfNqYOAe1WnhN6YdxQAfklBU7OQuCCEtFEOvKk=