From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59979: 30.0.50; dockerfile-ts-mode imenu issue Date: Sun, 11 Dec 2022 22:39:40 +0200 Message-ID: Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12904"; mail-complaints-to="usenet@ciao.gmane.io" To: 59979@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 12 00:01:25 2022 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 1p4VJz-0003A6-QZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Dec 2022 00:01:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4VJr-0002f9-U1; Sun, 11 Dec 2022 18:01:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4VJf-0002c4-3q for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 18:01:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4VJe-0004da-Qg for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 18:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4VJe-0004Le-8K for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 18:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Dec 2022 23:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59979 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.167079963916698 (code B ref -1); Sun, 11 Dec 2022 23:01:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Dec 2022 23:00:39 +0000 Original-Received: from localhost ([127.0.0.1]:48712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4VJG-0004LB-DI for submit@debbugs.gnu.org; Sun, 11 Dec 2022 18:00:38 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4T6x-0002q3-Jt for submit@debbugs.gnu.org; Sun, 11 Dec 2022 15:39:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4T6x-0003x0-98 for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 15:39:47 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4T6v-0003qI-FR for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 15:39:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1670791184; bh=RkQebpqthyivYVAJ5YsHwN8imiC4iXXVDlRuoPfAHqU=; h=From:To:Subject:Date:From; b=lH7WK6gxGdeJYXDDe7tK7P0gLvaZw55W9v46MCp/W66oiDvV7M7w9YXXeP1u797KG Bpa8JxToJUAv8ld8hqDDLJZwdFbsD5RFb3HzP1MzwZkDLbXOWeAf5YNDKnvfa8IMad Ip621Or4Wr5tz1dq4x0eYPB+V6J6X21JigHJ8wzF7z8xZ/FApQj2wmgJrruqcGKeF2 eDDetCJFDzIfzXEwD5rXb0gelP1DOk8EdfxLaRbh8SJFI+NVG+jlQ1jTY4tS1zjr20 94sIEBf7+LHLbPPE9vCzhVJGVTNBsBFNM8qEgf9BTErwXlmRYR9YXtGefdS64F49Lr bT6kwVWlLOFSA== Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 11 Dec 2022 18:00:37 -0500 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250660 Archived-At: I stumbled upon the following issue while checking out the new dockerfile-ts-mode. 1. emacs -Q 2. C-x C-f /tmp/Dockerfile 3. Insert the following contents (taken from https://docs.docker.com/build/building/multi-stage/#use-a-previous-stage-as-a-new-stage): FROM ubuntu AS base RUN echo "base" FROM base AS stage1 RUN echo "stage1" FROM base AS stage2 RUN echo "stage2" 4. Try to use M-x imenu to navigate to the last build stage 4.a. We get the following imenu--index-alist: (("Stage" ("ubuntu" . #) ("base" . #) ("base" . #))) 4.b. Consequently, we can't choose and jump to the last stage, because dockerfile-ts-mode calls both of the last two stages by the same name ("base"). The crux of the issue is that dockerfile-ts-mode uses a stage's base image as its name, which seems kinda wrong and leads to ambiguity since many stages can have a common base image. Instead, it would be preferable IMO to use the index of the stage or, when available, its unique name (such as "stage1" in the example above). Thanks! In GNU Emacs 30.0.50 (build 9, x86_64-apple-darwin22.1.0, NS appkit-2299.00 Version 13.0 (Build 22A380)) of 2022-12-11 built on esmac.lan Repository revision: 85108d541217f0333860c4f86c3b16b4349f85a4 Repository branch: master Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.0 Configured using: 'configure --with-native-compilation --enable-link-time-optimization --with-json --with-xwidgets --with-mailutils --with-imagemagick --without-dbus' Configured features: ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB Important settings: value of $LC_CTYPE: UTF-8 locale-coding-system: utf-8-unix Major mode: Dockerfile Minor modes in effect: 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 line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils pp cl-print byte-opt help-fns radix-tree thingatpt imenu comp comp-cstr warnings icons subr-x rx cl-macs gv cl-extra help-mode bytecomp byte-compile dockerfile-ts-mode treesit cl-seq cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode 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 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 nadvice seq simple cl-generic indonesian philippine 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 abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads xwidget-internal kqueue cocoa ns lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 111634 8544) (symbols 48 7501 0) (strings 32 31342 3006) (string-bytes 1 961129) (vectors 16 23207) (vector-slots 8 403727 9539) (floats 8 60 40) (intervals 56 396 0) (buffers 984 14))