From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#4427: 23.1; defun* don't work when compiled. Date: Mon, 14 Sep 2009 12:24:40 +0200 Organization: ThierryVolpiatto Message-ID: <87k5016cyf.fsf@tux.homenetwork> Reply-To: Thierry Volpiatto , 4427@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1252925244 2855 80.91.229.12 (14 Sep 2009 10:47:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2009 10:47:24 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 14 12:47:17 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mn95Y-0004kE-Hd for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 12:47:17 +0200 Original-Received: from localhost ([127.0.0.1]:59830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn95X-0001UJ-R4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 06:47:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mn95Q-0001Qz-3o for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:47:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mn95L-0001NS-TO for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:47:07 -0400 Original-Received: from [199.232.76.173] (port=34435 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn95L-0001NM-ID for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:47:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60860) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mn95K-0003sg-U1 for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:47:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8EAl0gg026625; Mon, 14 Sep 2009 03:47:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8EAe6Nc025500; Mon, 14 Sep 2009 03:40:06 -0700 Resent-Date: Mon, 14 Sep 2009 03:40:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Thierry Volpiatto Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 14 Sep 2009 10:40:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4427 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125292425924118 (code B ref -1); Mon, 14 Sep 2009 10:40:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 14 Sep 2009 10:30:59 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8EAUvNm024115 for ; Mon, 14 Sep 2009 03:30:58 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mn8pk-00074E-QZ for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:30:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mn8pf-00072r-8h for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:30:55 -0400 Original-Received: from [199.232.76.173] (port=33200 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn8pf-00072c-08 for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:30:51 -0400 Original-Received: from mail-ew0-f211.google.com ([209.85.219.211]:56844) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mn8pe-0001PJ-AS for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 06:30:50 -0400 Original-Received: by ewy7 with SMTP id 7so1292574ewy.31 for ; Mon, 14 Sep 2009 03:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:organization :date:message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=LVP/Q55ZS8vJGA3Fxp3SyYm8TKY0iwMxtlc81fbqsNw=; b=dpfV7cY6nHP7rIo9BPXsXjj9n7AcQlJpv0zlj00pLFWuSz8BzyfMvgDSuWOA7yiMuN ZIjouLdbU/czGljPYwAdaUj0eStqv9ENgT3ajczelcgN4ssqyspJWKNzydDGJSQ6e0Li oY8aIa3PII7SlBSJwRxuRCL1cACJ7PSI5HIR0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:organization:date:message-id:user-agent :mime-version:content-type:content-transfer-encoding; b=DMFe/K3ZFOaBkAXAxB/htsrv4NjHwfS3pyL94DbXP8uWP/v0/yjUVcsZHbnyucYWNF kneBGn4U4biZYSQVXihPnH9q34N2hw7W6ETCktkH2S1/vODQSQVxMqLa++bzZxiiIvH+ O4SxKTZEC7HYQKtUmRlKCuI9llmWzdFgRdkps= Original-Received: by 10.211.131.12 with SMTP id i12mr2964195ebn.97.1252924248873; Mon, 14 Sep 2009 03:30:48 -0700 (PDT) Original-Received: from tux.homenetwork ([79.88.78.121]) by mx.google.com with ESMTPS id 7sm501310eyg.38.2009.09.14.03.30.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 14 Sep 2009 03:30:48 -0700 (PDT) User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 14 Sep 2009 06:47:07 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31081 Archived-At: 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. --8<---------------cut here---------------start------------->8--- #[(&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)] --8<---------------cut here---------------end--------------->8--- Here is the same after evaluation of .el file or function with C-M x: --8<---------------cut here---------------start------------->8--- (lambda (&rest --cl-rest--) "Not documented (fn &key TYPE PREFIX)" (let* ((type ...) (prefix ...)) (let (...) (while --cl-keys-- ...)) (block traverse-auto-document-lisp-buffer (let* ... ... ... ... ... ...)))) --8<---------------cut here---------------end--------------->8--- 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 a C-SPC C-n C-n C-w M-e C-h e s c M-> 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 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