From unknown Mon Jun 23 11:25:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#51589 <51589@debbugs.gnu.org> To: bug#51589 <51589@debbugs.gnu.org> Subject: Status: 29.0.50; term-mode hooks are executed twice Reply-To: bug#51589 <51589@debbugs.gnu.org> Date: Mon, 23 Jun 2025 18:25:10 +0000 retitle 51589 29.0.50; term-mode hooks are executed twice reassign 51589 emacs submitter 51589 Raymond severity 51589 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 03 13:10:33 2021 Received: (at submit) by debbugs.gnu.org; 3 Nov 2021 17:10:33 +0000 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 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 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 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 Message-ID: <8607f8cb-abc1-e9d3-0806-20cabf5b672a@jug.gl> Date: Wed, 3 Nov 2021 18:10:12 +0100 Mime-Version: 1.0 Content-Language: en-US To: bug-gnu-emacs@gnu.org From: Raymond Subject: 29.0.50; term-mode hooks are executed twice Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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-Spam-Score: -1.3 (-) 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: -2.3 (--) 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)) From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 04 14:02:57 2021 Received: (at 51589) by debbugs.gnu.org; 4 Nov 2021 18:02:57 +0000 Received: from localhost ([127.0.0.1]:43376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mih4i-0006WA-VG for submit@debbugs.gnu.org; Thu, 04 Nov 2021 14:02:57 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mih4g-0006Vt-No for 51589@debbugs.gnu.org; Thu, 04 Nov 2021 14:02:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JBN025fdEBfyZRGwZSMpuh+YooXpdbdND+TJcSsrcNk=; b=iNZYV0E91gyQx5m9R51UFrFBC3 GzsaNhuCKqoXmkDkgFstX2yUyLintZD7NfH60iK8cpCHVL5bG4oswL6HxYJRpK4E+0nOscIbmhNR2 2/wczB4QNZ5wPhQi6hjqYaDVD/am2o0Z8JkYqN/k6qjAZ2a87fXrhZ1haBs1c4871gOA=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mih4X-0005IV-Ut; Thu, 04 Nov 2021 19:02:48 +0100 From: Lars Ingebrigtsen To: Raymond Subject: Re: bug#51589: 29.0.50; term-mode hooks are executed twice References: <8607f8cb-abc1-e9d3-0806-20cabf5b672a@jug.gl> X-Now-Playing: Orange's _Orange_: "Hindenburg" Date: Thu, 04 Nov 2021 19:02:43 +0100 In-Reply-To: <8607f8cb-abc1-e9d3-0806-20cabf5b672a@jug.gl> (raymond@jug.gl's message of "Wed, 3 Nov 2021 18:10:12 +0100") Message-ID: <871r3vu7cs.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Raymond writes: > A possible reason might be that inside `(defun term)` you'll see > `(term-mode)` being invoked: > >     ... >     (set-buffer (make-term "terminal" program)) >     (term-mode) >     ... [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51589 Cc: 51589@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: -3.3 (---) Raymond writes: > A possible reason might be that inside `(defun term)` you'll see > `(term-mode)` being invoked: > > =C2=A0=C2=A0=C2=A0 ... > =C2=A0=C2=A0=C2=A0 (set-buffer (make-term "terminal" program)) > =C2=A0=C2=A0=C2=A0 (term-mode) > =C2=A0=C2=A0=C2=A0 ... > > Yet, `(defun make-term)` also contains an invocation of `(term-mode)`. Yup. I've now fixed this in Emacs 29. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 04 14:03:01 2021 Received: (at control) by debbugs.gnu.org; 4 Nov 2021 18:03:01 +0000 Received: from localhost ([127.0.0.1]:43379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mih4n-0006WP-5u for submit@debbugs.gnu.org; Thu, 04 Nov 2021 14:03:01 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mih4l-0006W0-2b for control@debbugs.gnu.org; Thu, 04 Nov 2021 14:02:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=auNzRnvmGnLpCUV/uk4y1XSAC/tFGom8PNiBx+j+vJQ=; b=UyzA7ngfV5sSsqTPhpZKU9ZB5v CNd31OC840gW8XclVxU7vBPdDwBkCsM7L785VX7Fwgd0JGrTjUYhpdPz+gHFzvxSzlfz1WwS1hPL7 k8DP+X3Xrj8MG3VQVhLo8v8GdwXF6uDKrJZOEVfh2ltm8uM8snsvNmYIft7yYwHq84/U=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mih4d-0005Ic-8t for control@debbugs.gnu.org; Thu, 04 Nov 2021 19:02:53 +0100 Date: Thu, 04 Nov 2021 19:02:50 +0100 Message-Id: <87zgqjsss5.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #51589 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 51589 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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: -3.3 (---) close 51589 29.1 quit From unknown Mon Jun 23 11:25:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 03 Dec 2021 12:24:12 +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