bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4427: 23.1; defun* don't work when compiled.


From: Thierry Volpiatto
Subject: bug#4427: 23.1; defun* don't work when compiled.
Date: Mon, 14 Sep 2009 14:29:15 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

Complete information on this bug (if it is one).

Of course when this function is defined as macro, and 
(eval-when-compile (require 'cl)) is used, the code is evaluated by the
byte-compiler and things work as expected.

But i wonder why the other "defun*" with &key that are in traverselisp
works and  specially this function doesn't work.

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Please write in English if possible, because the Emacs maintainers
> usually do not have translators to read other languages for them.
>
> Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
> and to the gnu.emacs.bug news group.
>
> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug:
>
> Hi all,
>
> In traverselisp.el, i use cl stuff with
> (eval-when-compile (require 'cl)) at start of file.
> I have functions that are like:
> (defun* foo (&key a b)...
>
> They all work fine after compiling file.
>
> However, i have one new function that don't work when compiling file but
> work as normal when loading the .el file, or evaluate the function with
> C-M x.
>
> I wonder why.
> It seem that variables coming from key arg and evaluated in a cond clause
> don't work when compiled and evaluated from compiled file (.elc).
>
> Here is the output of:
>
> (symbol-function 'traverse-auto-document-lisp-buffer)
> After loading only .elc file.
>
> #[(&rest --cl-rest--) "\306>A@.\307>A@..\2038.@\310>\203!.
> AA\211.\202.\203Y.\344
> .C\"\203\345.\356.C\357Qc\210\202\345.\356.C\357Qc\210\202\345.       
> \360=\203\222.\354\355.C!!\204\345.
> \203\210.\344
> .C\"\203\345.\356.C\357Qc\210\202\345.\356.C\357Qc\210\202\345.       
> \361=\203\270.
> \203\256.\344
> .C\"\203\345.\356.C\357Qc\210\202\345.\356.C\357Qc\210\202\345.       
> \362=\203\336.
> \203\324.\344
> .C\"\203\345.\356.C\357Qc\210\202\345.\356.C\357Qc\210\202\345.\356.C\357Qc\210+.?A\211.?\204...
>       \312\207" [--cl-rest-- type prefix --cl-keys-- boundary-regexp regexp 
> :type :prefix (:type :prefix :allow-other-keys) :allow-other-keys nil error 
> ...] 9 ("/home/thierry/elisp/traverselisp.elc" . 45818)]
>
> Here is the same after evaluation of .el file or function with C-M x:
>
> (lambda (&rest --cl-rest--) "Not documented
>
> (fn &key TYPE PREFIX)" (let* ((type ...) (prefix ...)) (let (...) (while 
> --cl-keys-- ...)) (block traverse-auto-document-lisp-buffer (let* ... ... ... 
> ... ... ...))))
>
> So here it is normal and the function work as intended.
> When using the function from .elc file, i have no error, the function
> just return nil, even with debug-on-error turned on.
>
> Here the function:
>
> ,----
> | (defun* traverse-auto-document-lisp-buffer (&key type prefix)
> |   (let* ((boundary-regexp "^;;=*LIMIT.*")
> |          (regexp          (case type
> |                             ('nested "^ +\(def\\(un\\|subst\\|advice\\)")
> |                             ('command "\(def\\(un\\|subst\\)")
> |                             ('internal-variable "\(defvar")
> |                             ('user-variable "\(defcustom")
> |                             ('faces "\(defface")
> |                             ('function "\(def\\(un\\|subst\\|advice\\)")
> |                             (t (error "Unknow type"))))
> |          (fn-list         (traverse-find-readlines
> |                            (current-buffer)
> |                            regexp
> |                            :insert-fn 'buffer))
> |          beg end)
> |     (insert "\n") (setq beg (point))
> |     (save-excursion (when (re-search-forward boundary-regexp)
> |                       (forward-line -1) (setq end (point))))
> |     (delete-region beg end)
> |     (dolist (i fn-list)
> |       (let* ((elm     (cadr i))
> |              (elm-mod (replace-regexp-in-string regexp "" elm))
> |              (elm-fin (replace-regexp-in-string "\(\\|\)" ""(car 
> (split-string elm-mod)))))
> |         (cond ((eq type 'command)
> |                (when (commandp (intern elm-fin))
> |                  (if prefix
> |                      (when (string-match prefix elm-fin)
> |                        (insert (concat ";; \`" elm-fin "\'\n")))
> |                      (insert (concat ";; \`" elm-fin "\'\n")))))
> |               ((eq type 'function)
> |                (when (not (commandp (intern elm-fin)))
> |                  (if prefix
> |                      (when (string-match prefix elm-fin)
> |                        (insert (concat ";; \`" elm-fin "\'\n")))
> |                      (insert (concat ";; \`" elm-fin "\'\n")))))
> |               ((eq type 'internal-variable)
> |                (if prefix
> |                    (when (string-match prefix elm-fin)
> |                      (insert (concat ";; \`" elm-fin "\'\n")))
> |                    (insert (concat ";; \`" elm-fin "\'\n"))))
> |               ((eq type 'nested)
> |                (if prefix
> |                    (when (string-match prefix elm-fin)
> |                      (insert (concat ";; \`" elm-fin "\'\n")))
> |                    (insert (concat ";; \`" elm-fin "\'\n"))))
> |               (t
> |                (insert (concat ";; \`" elm-fin "\'\n"))))))))
> `----
>
> If Emacs crashed, and you have the Emacs process in the gdb debugger,
> please include the output from the following gdb commands:
>     `bt full' and `xbacktrace'.
> If you would like to further debug the crash, please read the file
> /usr/share/emacs/23.1/etc/DEBUG for instructions.
>
>
> In GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.16.5)
>  of 2009-07-31 on tux
> Windowing system distributor `The X.Org Foundation', version 11.0.10503000
> configured using `configure  '--prefix=/usr' '--build=i686-pc-linux-gnu' 
> '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' 
> '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' 
> '--localstatedir=/var/lib' '--program-suffix=-emacs-23' 
> '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' 
> '--without-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' 
> '--with-rsvg' '--with-tiff' '--with-xpm' '--with-xft' '--without-libotf' 
> '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' 
> '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' 
> 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 
> 'CFLAGS=-march=i686 -pipe -O2' 'LDFLAGS=-Wl,-O1''
>
> Important settings:
>   value of $LC_ALL: fr_FR.UTF-8
>   value of $LC_COLLATE: nil
>   value of $LC_CTYPE: nil
>   value of $LC_MESSAGES: nil
>   value of $LC_MONETARY: nil
>   value of $LC_NUMERIC: nil
>   value of $LC_TIME: nil
>   value of $LANG: fr_FR.UTF-8
>   value of $XMODIFIERS: nil
>   locale-coding-system: utf-8-unix
>   default-enable-multibyte-characters: t
>
> Major mode: Lisp Interaction
>
> Minor modes in effect:
>   eldoc-mode: t
>   icomplete-mode: t
>   icicle-mode: t
>   delete-selection-mode: t
>   minibuffer-depth-indicate-mode: t
>   auto-image-file-mode: t
>   shell-dirtrack-mode: t
>   partial-completion-mode: t
>   show-paren-mode: t
>   display-battery-mode: t
>   display-time-mode: t
>   diff-auto-refine-mode: t
>   outline-minor-mode: t
>   recentf-mode: t
>   savehist-mode: t
>   desktop-save-mode: t
>   tooltip-mode: t
>   mouse-wheel-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   global-auto-composition-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
>   line-number-mode: t
>   transient-mark-mode: t
>
> Recent input:
> M-x M-p <return> <f11> a <down> <return> <up> <up> 
> C-SPC C-n C-n C-w <up> M-e C-h e <f11> s c M-> <up> 
> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
> <up> <up> <up> <up> <up> <up> <up> <up> C-SPC C-n C-n 
> C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
> C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
> C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
> C-n C-n C-n C-n C-n C-n C-x r s a C-g M-x r e p o r 
> t - e m a c s - b u <tab> <return>
>
> Recent messages:
> Type C-x 4 C-o RET to restore the other window, C-M-v to scroll help. [2 
> times]
>
> Parsing BBDB... (frobnicating...done)
> Loading /home/thierry/.emacs.d/yaoddmuse-cache.el (source)...done
> Mark set
> nil
> Auto-saving...done
> Mark set [2 times]
> Quit
> Computing completion candidates...

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France







reply via email to

[Prev in Thread] Current Thread [Next in Thread]