From: Glenn Morris Date: Mon, 13 May 2013 16:21:00 +0000 (-0700) Subject: * cus-dep.el (defcustom-mh, defgroup-mh, defface-mh): Add compat aliases X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~99 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f4c7dfd2965eac2f8c6520db629aea79da5dd645;p=emacs.git * cus-dep.el (defcustom-mh, defgroup-mh, defface-mh): Add compat aliases as a hack workaround. Fixes: debbugs:14384 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac5a5c34e44..bd5a20ffe13 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-05-13 Glenn Morris + + * cus-dep.el (defcustom-mh, defgroup-mh, defface-mh): + Add compat aliases as a hack workaround. (Bug#14384) + 2013-05-13 Leo Liu * progmodes/octave.el (octave-indent-comment): Fix indentation for diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index 79698cc4b4a..12a3211a0b0 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -38,6 +38,18 @@ ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" (require 'autoload) +;; Hack workaround for bug#14384. +;; Define defcustom-mh as an alias for defcustom, etc. +;; Only do this in batch mode to avoid messing up a normal Emacs session. +;; Alternative would be to load mh-e when making cus-load. +;; (Would be better to split just the necessary parts of mh-e into a +;; separate file and only load that.) +(when (and noninteractive) + (mapc (lambda (e) (let ((sym (intern (format "%s-mh" e)))) + (or (fboundp sym) + (defalias sym e)))) + '(defcustom defface defgroup))) + (defun custom-make-dependencies () "Batch function to extract custom dependencies from .el files. Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" @@ -82,6 +94,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (let ((expr (read (current-buffer)))) (condition-case nil (let ((custom-dont-initialize t)) + ;; Why do we need to eval just for the name? (eval expr) (put (nth 1 expr) 'custom-where name)) (error nil))))