From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ikumi Keita Newsgroups: gmane.emacs.bugs Subject: bug#31718: 26.1; Strange behavior of `cond' Date: Tue, 05 Jun 2018 15:26:02 +0900 Message-ID: <37954.1528179962@localhost> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1528179909 28728 195.159.176.226 (5 Jun 2018 06:25:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Jun 2018 06:25:09 +0000 (UTC) To: 31718@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 05 08:25:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQ5Oy-0007JZ-AN for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jun 2018 08:25:04 +0200 Original-Received: from localhost ([::1]:44015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQ5R3-0003e7-Qh for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jun 2018 02:27:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQ5Qv-0003dm-QE for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 02:27:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQ5Qs-0005mp-Il for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 02:27:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQ5Qs-0005mS-E6 for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 02:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fQ5Qs-0000nP-5Y for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 02:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jun 2018 06:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31718 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15281799813005 (code B ref -1); Tue, 05 Jun 2018 06:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jun 2018 06:26:21 +0000 Original-Received: from localhost ([127.0.0.1]:34045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQ5QD-0000mO-4X for submit@debbugs.gnu.org; Tue, 05 Jun 2018 02:26:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQ5QC-0000mD-4N for submit@debbugs.gnu.org; Tue, 05 Jun 2018 02:26:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQ5Q5-00057P-IN for submit@debbugs.gnu.org; Tue, 05 Jun 2018 02:26:14 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52072) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQ5Q5-00057D-E6 for submit@debbugs.gnu.org; Tue, 05 Jun 2018 02:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQ5Q3-0003Xy-RS for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 02:26:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQ5Q0-00053S-K3 for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 02:26:11 -0400 Original-Received: from smtp1.inetd.co.jp ([210.129.88.11]:36910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQ5Q0-0004zF-3I for bug-gnu-emacs@gnu.org; Tue, 05 Jun 2018 02:26:08 -0400 Original-Received: from localhost (210-20-196-135.rev.home.ne.jp [210.20.196.135]) by smtp1.inetd.co.jp (Postfix) with ESMTPA id 1CB8ECD for ; Tue, 5 Jun 2018 15:26:03 +0900 (JST) X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.1 Content-ID: <37953.1528179962.1@localhost> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146996 Archived-At: The special form `cond' does not return expected value under a specific condition. [How to reproduce] 1. Save the following file as /tmp/test.el ---- test.el --------------------------------------------------------- (defun xyz (arg) "dummy" ; (cond ((eq arg nil) ; OK ; (cond ((eq arg 'abc) ; OK ; (cond ((eq arg 'def) ; OK (cond ((eq arg 'default) ; NG ; (cond ((eq arg 'default1) ; OK "A") (t "B"))) (byte-compile 'xyz) (insert (xyz t)) ; should "B", but "A" in actual ---------------------------------------------------------------------- 2. emacs-26.1 -Q -l /tmp/test.el 3. Expected result: "B" is inserted in *scratch* Actual result: "A" is inserted in *scratch* [Some notes related to this issue] a. As the comments written in the above code, only the symbol `default' triggers this behavior. b. Emacs 25.3 doesn't have this problem. c. If `xyz' is not byte compiled, `cond' works as expected. d. It seems that the following entry in NEWS is related: ** Certain cond/pcase/cl-case forms are now compiled using a faster jump table implementation. This uses a new bytecode op 'switch', which isn't compatible with previous Emacs versions. This functionality can be disabled by setting 'byte-compile-cond-use-jump-table' to nil. If I replace the line `(byte-compile 'xyz)' with (let ((byte-compile-cond-use-jump-table nil)) (byte-compile 'xyz)) in the above example, `cond' works as expected. In GNU Emacs 26.1 (build 1, x86_64-unknown-freebsd11.1, GTK+ Version 3.22.= 29) of 2018-05-30 built on freebsd.vmware Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 Recent messages: Saving file /home/keita/Mail/drafts/1... Wrote /home/keita/Mail/drafts/1 next-line: End of buffer [2 times] Saving file /home/keita/Mail/drafts/1... Wrote /home/keita/Mail/drafts/1 next-line: End of buffer [4 times] Sending...backgrounded Scanning +drafts...done No messages in +drafts, range (all) Quit [2 times] user-error: No cross-references in this node Configured using: 'configure --with-canna --with-canna-includes=3D/usr/local/canna/include --with-canna-libraries=3D/usr/local/canna/lib --mandir=3D/usr/local/man --without-xim --with-sound=3Dyes --with-file-notification=3Dyes --disable-largefile --without-pop CFLAGS=3D-O3' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LCMS2 Important settings: value of $EMACSLOADPATH: /home/keita/elisp: value of $LANG: ja_JP.eucJP value of $XMODIFIERS: @im=3Dfcitx locale-coding-system: japanese-iso-8bit-unix Major mode: Info Minor modes in effect: TeX-PDF-mode: t shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: ~/elisp/preview hides /usr/local/share/emacs/site-lisp/auctex/preview ~/elisp/tex-buf hides /usr/local/share/emacs/site-lisp/auctex/tex-buf ~/elisp/tex hides /usr/local/share/emacs/site-lisp/auctex/tex ~/elisp/reftex-parse hides /usr/local/share/emacs/26.1/lisp/textmodes/reft= ex-parse Features: (shadow emacsbug latexenc supercite regi mh-identity mh-letter mh-comp sendmail qp info view mh-alias multi-prompt smiley mm-archive mail-extr mh-mime mh-gnus mh-show goto-addr gnus-cite gnus-art mm-uu mml2015 mm-view mml-smime smime dig mh-inc hl-line mh-tool-bar mh-seq mh-xface mh-utils mh-folder which-func imenu mh-scan mh-e mh-compat mh-buffers mh-loaddefs preview prv-emacs reftex-dcr reftex-auc reftex reftex-loaddefs reftex-vars tex-fold tex-bar tex-buf toolbar-x font-latex latex edmacro kmacro latex-flymake flymake-proc flymake warnings thingatpt tex-ispell tex-style tex dbus crm tex-mode compile shell misearch multi-isearch vc-dispatcher vc-hg org-archive skeleton org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs mail-utils wid-edit org-docview doc-view image-mode dired dired-loaddefs org-bibtex bibtex org-bbdb org-w3m org-element avl-tree generator org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs jka-compr cl-extra help-mode parse-time ucs-normalize json map epa derived epg epg-config url-http tls gnutls url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc puny seq twittering-mode easymenu advice url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source cl-seq eieio byte-opt bytecomp byte-compile cconv eieio-core cl-macs gv eieio-loaddefs cl-loaddefs cl-lib password-cache url-vars mailcap xml elec-pair w3m-load preview-latex auto-loads tex-site canna-im time-date mule-util japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind kqueue lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 585780 62716) (symbols 48 43330 1) (miscs 40 1448 1041) (strings 32 118129 14954) (string-bytes 1 4152041) (vectors 16 71953) (vector-slots 8 1968759 71038) (floats 8 346 479) (intervals 56 6509 2189) (buffers 992 42))