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 14:29:15 +0200 Organization: ThierryVolpiatto Message-ID: <87ljkhwvz8.fsf@tux.homenetwork> References: <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 X-Trace: ger.gmane.org 1252933643 29834 80.91.229.12 (14 Sep 2009 13:07:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2009 13:07:23 +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 15:07:16 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 1MnBH0-00025a-65 for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 15:07:16 +0200 Original-Received: from localhost ([127.0.0.1]:47819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnBGz-0007UJ-Ds for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 09:07:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnBGu-0007Rr-45 for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 09:07:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnBGp-0007E4-KA for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 09:07:07 -0400 Original-Received: from [199.232.76.173] (port=55985 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnBGp-0007Dn-FZ for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 09:07:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52586) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MnBGo-0004AK-AF for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 09:07: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 n8ED704T020188; Mon, 14 Sep 2009 06:07:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8ED04Si018182; Mon, 14 Sep 2009 06:00:04 -0700 Resent-Date: Mon, 14 Sep 2009 06:00:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Thierry Volpiatto Original-Sender: news Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 14 Sep 2009 13:00:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4427 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125293261716733 (code B ref -1); Mon, 14 Sep 2009 13:00:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 14 Sep 2009 12:50:17 +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 n8ECoD0M016730 for ; Mon, 14 Sep 2009 05:50:16 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnB0X-0005C6-Kl for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 08:50:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnB0S-00059g-46 for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 08:50:13 -0400 Original-Received: from [199.232.76.173] (port=40524 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnB0R-00059d-TO for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 08:50:08 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:55218) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MnB0Q-0008Le-Fm for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 08:50:07 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MnB0M-0004Wr-Qh for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 14:50:02 +0200 Original-Received: from 121.78.88-79.rev.gaoland.net ([79.88.78.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2009 14:50:02 +0200 Original-Received: from thierry.volpiatto by 121.78.88-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2009 14:50:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 198 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 121.78.88-79.rev.gaoland.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUHAwNfJRBVTESlTym0 RB/OwKFivhZqAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABeElE QVQ4y3VTW47CMAyMwwUyTfYfUvG/wfC/ET4B0t7/KmsHurRgXFVVPRm/xglhsRj2+npW98G3+Amp tS5BXxl3SqzcXGRuEyf7n5lPA9jXetNPRhE7EJkzfz8YWnIgBSwW95TK4H79/t4GINKNADWj4PgA DiJX/ZxFDzDXeb4oYMw7kNUvyMzcaj3ioICG4hCKEShkPpwQ49Q05nnkGAQLDFDdExjm0qpowBYA Wi61bDlFU1GW0WbY2dSJYX5ZD2S0AiZL+rPyE19TpMzP2IvNWly+NkuWNgD4pO2oL73IQXoSyVX2 NHna7tgadWRXoCdvf2guqEcvGHqZwE520iRD0/QCYiiTE+U21w1Qxvg6iSp9fbIiDCnSAelDkCVF Vn+HekqXzRybwJ40xF4DMRG6SWGK9G1lYzHSxLYEm05GWbpJCB6A9tb9A3BGn2XdwJbS/WuInj74 4QNF8sVFdP3vl+5tgYp4Ev7fyrfFMkXgElDgV4uV/w8TWEeLCIGJ/AAAACV0RVh0Y3JlYXRlLWRh dGUAMjAwOC0wNS0zMVQyMjoxNDoyMiswMjowMM7uH/IAAAARdEVYdGpwZWc6Y29sb3JzcGFjZQAy LHVVnwAAACB0RVh0anBlZzpzYW1wbGluZy1mYWN0b3IAMngyLDF4MSwxeDFJ+qa0AAAAJXRFWHRt b2RpZnktZGF0ZQAyMDA3LTEwLTI4VDE3OjA4OjQ4KzAxOjAwhqNSRgAAAABJRU5ErkJggg== User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:iWaDS5b9qHFkrnwJBKml5/EWkm4= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 14 Sep 2009 09:07: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:31082 Archived-At: 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 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 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