Commit 037e7c3f authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/htmlfontify.el (hfy-etags-cmd): Remove inoperant eval-and-compile.

(hfy-e2x-etags-cmd, hfy-etags-cmd-alist-default)
(hfy-etags-cmd-alist): Don't eval-and-compile any more.
parent 8b05752a
2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca> 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
* htmlfontify.el (hfy-etags-cmd): Remove inoperant eval-and-compile.
(hfy-e2x-etags-cmd, hfy-etags-cmd-alist-default)
(hfy-etags-cmd-alist): Don't eval-and-compile any more.
* emacs-lisp/bytecomp.el (byte-temp-output-buffer-show) * emacs-lisp/bytecomp.el (byte-temp-output-buffer-show)
(byte-save-window-excursion, byte-temp-output-buffer-setup) (byte-save-window-excursion, byte-temp-output-buffer-setup)
(byte-interactive-p): Define them again, for use when inlining (byte-interactive-p): Define them again, for use when inlining
......
...@@ -290,8 +290,7 @@ in order, to:\n ...@@ -290,8 +290,7 @@ in order, to:\n
:group 'htmlfontify :group 'htmlfontify
:tag "html-quote-map" :tag "html-quote-map"
:type '(alist :key-type (string))) :type '(alist :key-type (string)))
(eval-and-compile (defconst hfy-e2x-etags-cmd "for src in `find . -type f`;
(defconst hfy-e2x-etags-cmd "for src in `find . -type f`;
do do
ETAGS=%s; ETAGS=%s;
case ${src} in case ${src} in
...@@ -322,17 +321,17 @@ do ...@@ -322,17 +321,17 @@ do
esac; esac;
done;") done;")
(defconst hfy-etags-cmd-alist-default (defconst hfy-etags-cmd-alist-default
`(("emacs etags" . ,hfy-e2x-etags-cmd) `(("emacs etags" . ,hfy-e2x-etags-cmd)
("exuberant ctags" . "%s -R -f -" ))) ("exuberant ctags" . "%s -R -f -" )))
(defcustom hfy-etags-cmd-alist (defcustom hfy-etags-cmd-alist
hfy-etags-cmd-alist-default hfy-etags-cmd-alist-default
"Alist of possible shell commands that will generate etags output that "Alist of possible shell commands that will generate etags output that
`htmlfontify' can use. '%s' will be replaced by `hfy-etags-bin'." `htmlfontify' can use. '%s' will be replaced by `hfy-etags-bin'."
:group 'htmlfontify :group 'htmlfontify
:tag "etags-cmd-alist" :tag "etags-cmd-alist"
:type '(alist :key-type (string) :value-type (string)) )) :type '(alist :key-type (string) :value-type (string)))
(defcustom hfy-etags-bin "etags" (defcustom hfy-etags-bin "etags"
"Location of etags binary (we begin by assuming it's in your path).\n "Location of etags binary (we begin by assuming it's in your path).\n
...@@ -367,7 +366,13 @@ commands in `hfy-etags-cmd-alist'." ...@@ -367,7 +366,13 @@ commands in `hfy-etags-cmd-alist'."
((string-match "GNU E" v) "emacs etags" )) )) ((string-match "GNU E" v) "emacs etags" )) ))
(defcustom hfy-etags-cmd (defcustom hfy-etags-cmd
(eval-and-compile (cdr (assoc (hfy-which-etags) hfy-etags-cmd-alist))) ;; We used to wrap this in a `eval-and-compile', but:
;; - it had no effect because this expression was not seen by the
;; byte-compiler (defcustom used to quote this argument).
;; - it signals an error (`hfy-which-etags' is not defined at compile-time).
;; - we want this auto-detection to reflect the system on which Emacs is run
;; rather than the one on which it's compiled.
(cdr (assoc (hfy-which-etags) hfy-etags-cmd-alist))
"The etags equivalent command to run in a source directory to generate a tags "The etags equivalent command to run in a source directory to generate a tags
file for the whole source tree from there on down. The command should emit file for the whole source tree from there on down. The command should emit
the etags output on stdout.\n the etags output on stdout.\n
...@@ -375,11 +380,10 @@ Two canned commands are provided - they drive Emacs' etags and ...@@ -375,11 +380,10 @@ Two canned commands are provided - they drive Emacs' etags and
exuberant-ctags' etags respectively." exuberant-ctags' etags respectively."
:group 'htmlfontify :group 'htmlfontify
:tag "etags-command" :tag "etags-command"
:type (eval-and-compile :type (let ((clist (list '(string))))
(let ((clist (list '(string)))) (dolist (C hfy-etags-cmd-alist)
(dolist (C hfy-etags-cmd-alist) (push (list 'const :tag (car C) (cdr C)) clist))
(push (list 'const :tag (car C) (cdr C)) clist)) (cons 'choice clist)))
(cons 'choice clist)) ))
(defcustom hfy-istext-command "file %s | sed -e 's@^[^:]*:[ \t]*@@'" (defcustom hfy-istext-command "file %s | sed -e 's@^[^:]*:[ \t]*@@'"
"Command to run with the name of a file, to see whether it is a text file "Command to run with the name of a file, to see whether it is a text file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment