From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 07 18:03:45 2018 Received: (at submit) by debbugs.gnu.org; 7 Oct 2018 22:03:45 +0000 Received: from localhost ([127.0.0.1]:39713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9H9M-00036v-QQ for submit@debbugs.gnu.org; Sun, 07 Oct 2018 18:03:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9H9L-00036j-1Z for submit@debbugs.gnu.org; Sun, 07 Oct 2018 18:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9H9E-0008UJ-P2 for submit@debbugs.gnu.org; Sun, 07 Oct 2018 18:03:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9H9E-0008U3-K4 for submit@debbugs.gnu.org; Sun, 07 Oct 2018 18:03:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9H9D-0003XH-Fs for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 18:03:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9H9A-0008Pz-A9 for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 18:03:35 -0400 Received: from mail.parhasard.net ([88.198.122.198]:32830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9H99-0008PH-RI for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 18:03:32 -0400 Received: by mail.parhasard.net (Postfix, from userid 1000) id A5BE04A234E; Mon, 8 Oct 2018 00:03:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=parhasard.net; s=mail; t=1538949808; bh=hikJtkGXZyZzmxtnv/sXRzpAlzRvjn+/EkTOBzdUitU=; h=From:Date:To:Subject:From; b=UuEdEl3nBs6DM/FVQ97hnt+vxn1kWRUSqhKqQbRaRZXlTeK80cDGkFPgaIgMpcZKr ERJoyPa19mYywuN5o8f5iBT/9B1viTQcmOqNzqGQd4hms08L/zTDdcRr+tyN+eccx7 vgRB5kDN9yWd978u8Qbl5uWg9Vorb3z4Z8nAokaI= From: Aidan Kehoe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <5bba.82ad.afd6b.dba0@parhasard.net> Date: Sun, 7 Oct 2018 23:03:25 +0100 To: bug-gnu-emacs@gnu.org Subject: 27.0.50; Oddity in #'keywordp comments. X-Mailer: VM 8.2.0b under 21.5 (beta34) "kale" 0f7b7204a7ff+ XEmacs Lucid (i386-apple-darwin10.8.0) X-NS5-file-as-sent: t Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) When I read the source for the Lisp function #'keywordp, in data.c, I encounter the following: /* Define this in C to avoid unnecessarily consing up the symbol name. */ DEFUN ("keywordp", Fkeywordp, Skeywordp, 1, 1, 0, doc: /* Return t if OBJECT is a keyword. This means that it is a symbol with a print name beginning with `:' interned in the initial obarray. */) (Lisp_Object object) { if (SYMBOLP (object) && SREF (SYMBOL_NAME (object), 0) =3D=3D ':' && SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (object)) return Qt; return Qnil; } It's completely reasonable to implement the #'keywordp predicate in C giv= en the internal GNU Emacs approach to keywords. The equivalent Lisp implementation of: (defun keywordp (object) (and object (symbolp object) (eq ?: (aref (symbol-name object) 0)) (eq object (intern-soft (symbol-name object) obarray)))) involves a hash table lookup after a Lisp funcall, and checking #'keyword= p should be cheap. The comment, however, has nothing to do with anything, t= here is no consing or other dynamic memory allocation at any point, neither in= the obvious Lisp implementation, the old cl-compat.el implementation of 20.7,= nor the current code. The comment should be removed. In GNU Emacs 27.0.50 (build 1, i386-apple-darwin10.8.0, NS appkit-1038.36= Version 10.6.8 (Build 10K549)) of 2018-08-25 built on bonbon Repository revision: 161139a42c02cce051c51fb80c6ae00c9e6beaa6 Windowing system distributor 'Apple', version 10.3.1038 System Description: Mac OS X 10.6.8 Recent messages: Mark set [2 times] Entering debugger... Back to top level Quit s-< is undefined C-x C-g is undefined Mark set [2 times] Mark saved where search started Quit Mark set Configured using: 'configure CC=3Dgcc-4.2 CFLAGS=3D-fobjc-exceptions PKG_CONFIG_PATH=3D/usr/pkg/lib/pkgconfig:/X11/lib/pkgconfig' Configured features: RSVG IMAGEMAGICK DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS THREADS LCMS2 Important settings: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix Major mode: C/*l Minor modes in effect: diff-auto-refine-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-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 line-number-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils misearch multi-isearch vc-git diff-mode easy-mmode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs thingatpt find-func help-fns radix-tree cl-print debug backtrace help-mode easymenu cl-loaddefs cl-lib elec-pair time-date tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win 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 threads dbusbind kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 8 238509 10624) (symbols 24 23285 1) (strings 16 38140 2495) (string-bytes 1 1151011) (vectors 12 40088) (vector-slots 4 878428 30532) (floats 8 55 214) (intervals 28 1547 405) (buffers 536 17)) --=20 =E2=80=98As I sat looking up at the Guinness ad, I could never figure out= / How your man stayed up on the surfboard after forty pints of stout=E2=80=99 (C. Moore) From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 08 16:20:29 2018 Received: (at 32979-done) by debbugs.gnu.org; 8 Oct 2018 20:20:30 +0000 Received: from localhost ([127.0.0.1]:40824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9c0z-0005M0-Cp for submit@debbugs.gnu.org; Mon, 08 Oct 2018 16:20:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9c0x-0005Ll-8P for 32979-done@debbugs.gnu.org; Mon, 08 Oct 2018 16:20:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9c0n-0001Bc-W2 for 32979-done@debbugs.gnu.org; Mon, 08 Oct 2018 16:20:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9c0n-0001BY-Qn; Mon, 08 Oct 2018 16:20:17 -0400 Received: from [176.228.60.248] (port=4532 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g9c0n-0004Fv-Aw; Mon, 08 Oct 2018 16:20:17 -0400 Date: Mon, 08 Oct 2018 23:20:10 +0300 Message-Id: <83k1msyyv9.fsf@gnu.org> From: Eli Zaretskii To: Aidan Kehoe In-reply-to: <5bba.82ad.afd6b.dba0@parhasard.net> (message from Aidan Kehoe on Sun, 7 Oct 2018 23:03:25 +0100) Subject: Re: bug#32979: 27.0.50; Oddity in #'keywordp comments. References: <5bba.82ad.afd6b.dba0@parhasard.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32979-done Cc: 32979-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Aidan Kehoe > Date: Sun, 7 Oct 2018 23:03:25 +0100 > > /* Define this in C to avoid unnecessarily consing up the symbol > name. */ > DEFUN ("keywordp", Fkeywordp, Skeywordp, 1, 1, 0, > doc: /* Return t if OBJECT is a keyword. > This means that it is a symbol with a print name beginning with `:' > interned in the initial obarray. */) > (Lisp_Object object) > { > if (SYMBOLP (object) > && SREF (SYMBOL_NAME (object), 0) == ':' > && SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (object)) > return Qt; > return Qnil; > } > > It's completely reasonable to implement the #'keywordp predicate in C given > the internal GNU Emacs approach to keywords. The equivalent Lisp > implementation of: > > (defun keywordp (object) > (and object (symbolp object) (eq ?: (aref (symbol-name object) 0)) > (eq object (intern-soft (symbol-name object) obarray)))) > > involves a hash table lookup after a Lisp funcall, and checking #'keywordp > should be cheap. The comment, however, has nothing to do with anything, there > is no consing or other dynamic memory allocation at any point, neither in the > obvious Lisp implementation, the old cl-compat.el implementation of 20.7, nor > the current code. The comment should be removed. I think the author of the code thought that symbol-name conses a string. (At some distant point in the past, aref worked in bytes, not in characters, and the internal representation of text was not yet superset of UTF-8, so we couldn't assume that if the first byte is ':', so is the first character, and needed to use substring instead. But that was fixed a year before keywordp got coded in C, so that was unlikely to be the reason for the comment.) I removed the comment. Thanks for bringing this to our attention. From unknown Tue Jun 17 01:46:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 06 Nov 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator