From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Raymond Newsgroups: gmane.emacs.bugs Subject: bug#51589: 29.0.50; term-mode hooks are executed twice Date: Wed, 3 Nov 2021 18:10:12 +0100 Message-ID: <8607f8cb-abc1-e9d3-0806-20cabf5b672a@jug.gl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14143"; mail-complaints-to="usenet@ciao.gmane.io" To: 51589@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 03 18:16:02 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1miJrm-0003SA-0x for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Nov 2021 18:16:02 +0100 Original-Received: from localhost ([::1]:48242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miJrk-00051m-7V for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Nov 2021 13:16:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miJmw-0001aC-GL for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 13:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miJmw-0006oh-7x for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 13:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1miJmw-0007Ol-3B for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 13:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Raymond Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Nov 2021 17:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51589 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163595943328377 (code B ref -1); Wed, 03 Nov 2021 17:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Nov 2021 17:10:33 +0000 Original-Received: from localhost ([127.0.0.1]:41026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miJmT-0007Nd-7X for submit@debbugs.gnu.org; Wed, 03 Nov 2021 13:10:33 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miJmS-0007NW-CL for submit@debbugs.gnu.org; Wed, 03 Nov 2021 13:10:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miJmS-0000sC-2o for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 13:10:32 -0400 Original-Received: from tp1.intenct.nl ([37.97.236.219]:43780 helo=mail.intenct.nl) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miJmN-0006fF-Uz for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 13:10:30 -0400 Content-Language: en-US Received-SPF: pass client-ip=37.97.236.219; envelope-from=raymond@jug.gl; helo=mail.intenct.nl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218881 Archived-At: To reproduce: 1) emacs -Q 2) In the scratch buffer, type:     (add-hook 'term-mode-hook (lambda () (message "Hello"))) 3) Use C-x C-e to evaluate this line 4) Open a terminal:     M-x term RET     Run program: /bin/bash RET 5) Switch to the messages buffer: C-c b *Messages* Expected result: "Hello" is displayed exactly once. Actual result: "Hello" is listed 2 times:     Hello [2 times] A possible reason might be that inside `(defun term)` you'll see `(term-mode)` being invoked:     ...     (set-buffer (make-term "terminal" program))     (term-mode)     ... Yet, `(defun make-term)` also contains an invocation of `(term-mode)`. In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)  of 2021-10-21 built on lgw01-amd64-019 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Ubuntu 20.04.3 LTS Configured using:  'configure --build=x86_64-linux-gnu --prefix=/usr  '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'  '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var  --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'  '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode  --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib  --program-suffix=-snapshot --with-modules=yes --with-x=yes  --with-x-toolkit=gtk3 --with-xwidgets=yes 'CFLAGS=-g -O2  -fdebug-prefix-map=/build/emacs-snapshot-xcc7hU/emacs-snapshot-107362=. -fstack-protector-strong  -Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time  -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB Important settings:   value of $LC_MONETARY: nl_NL.UTF-8   value of $LC_NUMERIC: nl_NL.UTF-8   value of $LC_TIME: nl_NL.UTF-8   value of $LANG: nl_NL.UTF-8   value of $XMODIFIERS: @im=ibus   locale-coding-system: utf-8-unix Major mode: Messages Minor modes in effect:   shell-dirtrack-mode: t   tooltip-mode: t   global-eldoc-mode: t   show-paren-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   buffer-read-only: t   line-number-mode: t   indent-tabs-mode: t   transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils seq gv subr-x byte-opt bytecomp byte-compile cconv term disp-table shell pcomplete ehelp comint ansi-color ring iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode 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 lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads xwidget-internal dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 58710 6062)  (symbols 48 7564 1)  (strings 32 21033 1721)  (string-bytes 1 697181)  (vectors 16 15509)  (vector-slots 8 201398 10223)  (floats 8 21 39)  (intervals 56 257 0)  (buffers 992 12))