GNU bug report logs - #25585
25.1; shell-script mode not providing proper support for finding variables at point

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Bob Hepple <bob.hepple@HIDDEN>; dated Tue, 31 Jan 2017 00:40:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 25585 <at> debbugs.gnu.org:


Received: (at 25585) by debbugs.gnu.org; 1 Feb 2017 23:32:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 01 18:32:08 2017
Received: from localhost ([127.0.0.1]:53684 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cZ4Nj-0006xf-Qo
	for submit <at> debbugs.gnu.org; Wed, 01 Feb 2017 18:32:08 -0500
Received: from mail-yw0-f178.google.com ([209.85.161.178]:36296)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bob.hepple@HIDDEN>) id 1cZ4Ni-0006xA-3g
 for 25585 <at> debbugs.gnu.org; Wed, 01 Feb 2017 18:32:06 -0500
Received: by mail-yw0-f178.google.com with SMTP id v200so77114311ywc.3
 for <25585 <at> debbugs.gnu.org>; Wed, 01 Feb 2017 15:32:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
 bh=Etc4DvHBK5Ge+o0x+bglJxwebAf0fUgbdmDVBFnQE3s=;
 b=rlHtZDA7+L4qCo24oh5tDQRmL1W82gLmd1hecufz+0mNE2waZC1E+1uYHQmRCo3OFU
 fYWHYC1j2gWVTqQDHCoybh+q55oKoqc7lZxqTyiTsXhtQ+ZwIa44XDmCdctQqW3+Fcv/
 j3MiOO9HlChDo6o/CV44opTJ6baYHKPgYNlk/IajxZOiP8z2ffu98f/XHHayplRLiZLn
 euW1JXG6utgVUpKKCCokNQVJOgdZV9rxGSdVI/68uETkAeDVF+arnbixtsg8FqXERRHa
 pvQfAXlux34Bb0XOiYAxxYYZpZHeL9Q2CA7YUfgVmRA3NSrFeQM2fA4eCDW5rXVxIFuX
 3PMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to;
 bh=Etc4DvHBK5Ge+o0x+bglJxwebAf0fUgbdmDVBFnQE3s=;
 b=OFd5Kua94DnHkZscNj/CAS5Sru2rgIAheVFCsyrbvtu9KRi5K8vUHntAS3w4lvjBCy
 eUdNN/l8QMfUpiPzMA9PuAQiT8mKWTjM33JjrMMd/1a2jXRc11q1qWF3mXlretp4bMr1
 oN/xOKTW0ui3cvf7VafUnyqm9leCftC9eiR7NSF9YIVMBy0Ydh+qEbflIUHQfy6+5IBZ
 lYtroftp4rln+mxtWTHsMiCpYU59drvO7ufkAPmZXAl+2KTsa9F1AYlVol6aDxYDK44T
 AOw7SwLJzXQR2riC0BI27NlkONFTPN/V8/H7wgKks+0x4qSwuj9wghrwHm9YtW5ZjWPp
 FhYw==
X-Gm-Message-State: AIkVDXLmOPly2cNlS8cKPue2lqdWQ40V2b85YL35beMc/Qqe43wOy1jaszdJYQ3sbKMX1uyBS6C68EeONtF+jg==
X-Received: by 10.129.72.208 with SMTP id v199mr3546888ywa.236.1485991920396; 
 Wed, 01 Feb 2017 15:32:00 -0800 (PST)
MIME-Version: 1.0
References: <20170201155249.114487.66089.C90F097C@HIDDEN>
In-Reply-To: <20170201155249.114487.66089.C90F097C@HIDDEN>
From: Bob Hepple <bob.hepple@HIDDEN>
Date: Wed, 01 Feb 2017 23:31:50 +0000
Message-ID: <CAHzpm2i_3GHpwLvxSqxMDNEb_R74==p5GTJhUh78OM9L-J869Q@HIDDEN>
Subject: Fwd: [reddit] 1 new message from u/hvis
To: 25585 <at> debbugs.gnu.org
Content-Type: multipart/alternative; boundary=001a114dc2fc8defef05478074c8
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 25585
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.5 (/)

--001a114dc2fc8defef05478074c8
Content-Type: text/plain; charset=UTF-8

This patch (suggested by https://reddit.com/u/hvis) works for me ...


diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el

index a0bbf55..dc296a2 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -483,6 +483,7 @@ sh-mode-syntax-table
    ?~ "_"
    ?, "_"
    ?= "."
+        ?/ "."
    ?\; "."
    ?| "."
    ?& "."

--001a114dc2fc8defef05478074c8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">This patch (suggested by <a href=3D"https://reddit.com/u/h=
vis">https://reddit.com/u/hvis</a>) works for me ...<br><div class=3D"gmail=
_quote"><div dir=3D"ltr"><br></div>








<u class=3D"gmail_msg"></u>


 =20
 =20
 =20
 =20
 =20
 =20

 =20

<div class=3D"m_7131272969782406528body gmail_msg" style=3D"padding:0!impor=
tant;margin:0!important;display:block!important;width:100%!important;backgr=
ound:#ffffff">
  <table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" bg=
color=3D"#ffffff" class=3D"gmail_msg">
    <tbody><tr class=3D"gmail_msg">
      <td align=3D"center" valign=3D"top" class=3D"gmail_msg">
        <table width=3D"620" border=3D"0" cellspacing=3D"0" cellpadding=3D"=
0" class=3D"m_7131272969782406528mobile-shell gmail_msg">
          <tbody><tr class=3D"gmail_msg">
            <td class=3D"m_7131272969782406528img gmail_msg" style=3D"font-=
size:0pt;line-height:0pt;text-align:left" width=3D"20"><br></td><td class=
=3D"gmail_msg">
              <div class=3D"m_7131272969782406528md gmail_msg"><p class=3D"=
gmail_msg">diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-scr=
ipt.el<br></p><pre class=3D"gmail_msg"><code class=3D"gmail_msg">index a0bb=
f55..dc296a2 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -483,6 +483,7 @@ sh-mode-syntax-table
    ?~ &quot;_&quot;
    ?, &quot;_&quot;
    ?=3D &quot;.&quot;
+        ?/ &quot;.&quot;
    ?\; &quot;.&quot;
    ?| &quot;.&quot;
    ?&amp; &quot;.&quot;
</code></pre>
</div>

               =20
                <div style=3D"font-size:0pt;line-height:0pt;height:8px" cla=
ss=3D"gmail_msg"><br></div></td><td class=3D"m_7131272969782406528img gmail=
_msg" style=3D"font-size:0pt;line-height:0pt;text-align:left" width=3D"20">=
<br></td></tr></tbody></table></td></tr></tbody></table>
</div>

</div></div>

--001a114dc2fc8defef05478074c8--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25585; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Jan 2017 00:39:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 30 19:39:51 2017
Received: from localhost ([127.0.0.1]:51492 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cYMUA-0005Ci-1e
	for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 19:39:51 -0500
Received: from eggs.gnu.org ([208.118.235.92]:48766)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bob.hepple@HIDDEN>) id 1cYMU7-0005CE-NG
 for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 19:39:48 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <bob.hepple@HIDDEN>) id 1cYMU0-0004hS-8c
 for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 19:39:42 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:41779)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <bob.hepple@HIDDEN>)
 id 1cYMU0-0004hM-4l
 for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 19:39:40 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39731)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <bob.hepple@HIDDEN>) id 1cYMTx-0001EY-MF
 for bug-gnu-emacs@HIDDEN; Mon, 30 Jan 2017 19:39:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <bob.hepple@HIDDEN>) id 1cYMTv-0004gv-6w
 for bug-gnu-emacs@HIDDEN; Mon, 30 Jan 2017 19:39:37 -0500
Received: from mail-yb0-x22e.google.com ([2607:f8b0:4002:c09::22e]:34856)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <bob.hepple@HIDDEN>)
 id 1cYMTu-0004gn-Vn
 for bug-gnu-emacs@HIDDEN; Mon, 30 Jan 2017 19:39:35 -0500
Received: by mail-yb0-x22e.google.com with SMTP id o65so20283551ybo.2
 for <bug-gnu-emacs@HIDDEN>; Mon, 30 Jan 2017 16:39:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=AgqR6MzreZxN/LtR9G3dReOFLA17Zx0yJJpHUWnzJTY=;
 b=k1Gh7zdz0AuqJy98Z9mz4C8ra8USCvnrurCHJY4fVHEqw0fUQkP/JdOG2O/CtberWq
 drkWvveZvhE+GFTcgcIBLDkBdFU8DBh20GCpCe7pLsvhM5SSLs9TOyu35gDb/tpKON4q
 0RBZq9HHjEr4ttAteHDy6KI6A3bTCDbUx82kEQrA2evX35+Q/Ow7311/Znc0Uv85N/4g
 IpxgkyiwHICsdSf1WvXHrc+ozS70QEJ6PO1uFLb2Ptc8Yyic0v7Tp/WMCYE9CU1hfqnK
 KVOHW4h+YVaCfsNwmIgIdkbshWqLazPknxj5hk2oEJ+xTxvsgz0boova6qXBwHTbOIYm
 zNQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=AgqR6MzreZxN/LtR9G3dReOFLA17Zx0yJJpHUWnzJTY=;
 b=q7aOyJl9Phw1dhIX01MV/138DyfVvY5HoGNYHeryXHwOu6DvgKqT79k3ym4qUNJVn6
 q6FRUwd1gbPvmHSm7EyCjISDihGMWTH2IOSEvQD3a33QciwtNPrwrmPNfXlydGnpSxyD
 mkcqexP3VNVZuur0znmSOqrvEtgamAdl/U5VMXbUlkutyArxgG43cRVwcDld9W37ysT8
 l5adop/XmqrPr9Xd3eSsZBLleazmc7ETE4lgWXz3RemRW59OJkCCFuE0boHnGd37p8HZ
 taSapkHRoq5LKmsdyJvM6kgOKJiR5XjWXSOa7bTlDtTDKBh6/jpiGIzT0N0s2L65iAB4
 1ePg==
X-Gm-Message-State: AIkVDXLi1jxKUxWyp0w8l6fFdglXqy7SIemnPYOpdCvvILvj7IgygOsw1fgYuyOxZ4SBsp4oP6VpZvaFr4emBw==
X-Received: by 10.37.115.17 with SMTP id o17mr14022960ybc.6.1485823173749;
 Mon, 30 Jan 2017 16:39:33 -0800 (PST)
MIME-Version: 1.0
From: Bob Hepple <bob.hepple@HIDDEN>
Date: Tue, 31 Jan 2017 00:39:23 +0000
Message-ID: <CAHzpm2ggiQHTxgHSwfxzQ8whNAY=qMg61TCjuK7yx+RekJoJTw@HIDDEN>
Subject: 25.1; shell-script mode not providing proper support for finding
 variables at point
To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN>
Content-Type: multipart/alternative; boundary=94eb2c0979f47871d00547592a02
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
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.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--94eb2c0979f47871d00547592a02
Content-Type: text/plain; charset=UTF-8

One of the GNU Emacs maintainers eli-zaretski suggested that I post my
problem as a bug report:
https://www.reddit.com/r/emacs/comments/5qz6en/ctags_and_bash/:

'Report a bug against Shell-script Mode. It sounds like it doesn't
define proper support for finding variables at point, so xref uses a
generic facility, which is only mostly correct in this case.'

My original problem is as follows: (confirm that it also fails with emacs
-Q):

So I've now got ctags(1) to understand bash variables as well as
functions.

Now I can jump to the defining location with M-. (ref-find-definitions)-
all fine and dandy.

The only fly in the ointment is that when a bash variable is
concatenated with literal text, M-. wants to look for the entire text.
eg if I M-. on the variable in:

$foobar/bar/foo

... then it wants to search for foobar/bar/foo instead of just foobar.

It wouldn't be so bad if I could repeat-complex-command and edit the
search string but M-. doesn't appear to push the command there.

Short of re-writing all the code as "$foobar"/bar/foo is there something
I can set to fix this?

In case it's interesting, this is how I build TAGS:
DIRS=(
    dir1
    dir2
)

ctags_opts='--regex-sh=/^[ \t]*(local|export|declare)?[
\t]*([A-Za-z0-9_-]+)=/\2/v,variable,variables/'

find ${DIRS[@]} -name .svn -prune -o -print | while read F; do
    file -i "$F" | egrep -q 'shellscript|text/plain' && ctags -e
--languages=sh -a "$ctags_opts" "$F"
done



In GNU Emacs 25.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.20.9)
 of 2016-10-13 built on buildvm-05.phx2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.11804000
System Description: Fedora release 24 (Twenty Four)

Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no --with-xwidgets build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
 -m64 -mtune=generic' LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XWIDGETS

Important settings:
  value of $LC_ALL: en_AU.utf8
  value of $LANG: C
  locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
  global-flycheck-mode: t
  helm-mode: t
  shell-dirtrack-mode: t
  async-bytecomp-package-mode: t
  diff-auto-refine-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  recentf-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
ARCH appears unused. Verify it or export it. [SC2034]
Setting up indent for shell type sh
Indentation variables are now local.
Indentation setup for shell type sh
TARGET_ARCH appears unused. Verify it or export it. [SC2034] [3 times]
Type C-x 4 C-o RET to restore the other window.
Type "q" to restore previous buffer.

Load-path shadows:
/usr/share/emacs/site-lisp/gnus-bonus/nnir hides
/usr/share/emacs/25.1/lisp/gnus/nnir
/usr/share/emacs/site-lisp/gnus-bonus/nnnil hides
/usr/share/emacs/25.1/lisp/gnus/nnnil
/usr/share/emacs/site-lisp/gnus-bonus/spam-stat hides
/usr/share/emacs/25.1/lisp/gnus/spam-stat
/usr/share/emacs/site-lisp/goodies/browse-kill-ring hides
~/.config/emacs/browse-kill-ring
/usr/share/emacs/25.1/lisp/vc/vc-svn hides ~/.config/emacs/vc-svn

Features:
(shadow sort mail-extr emacsbug sendmail warnings apropos jka-compr
helm-command helm-elisp helm-eval edebug eieio-opt dabbrev pulse
ibuf-ext ibuffer locate find-dired ido winner grep etags xref project
misearch multi-isearch vc-svn hideshow sh-script smie executable
flycheck json map find-func subr-x dash indent-tools yafolding hydra lv
indent-tools-indentation-of helm-mode helm-files rx image-dired tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen helm-tags
helm-bookmark helm-adaptive helm-info bookmark helm-locate helm-grep
helm-regexp helm-external helm-net browse-url xml url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse auth-source url-vars mailcap helm-utils compile
comint ansi-color helm-help helm-types helm-config helm-easymenu
async-bytecomp async helm helm-source cl-seq eieio-compat eieio
eieio-core helm-multi-match helm-lib finder-inf info package seq
browse-kill-ring hide-comnt psvn byte-opt bytecomp byte-compile cl-extra
cconv advice derived edmacro kmacro cl-macs cl gv log-edit message idna
format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util help-fns help-mode mail-prsvr mailabbrev mail-utils
gmm-utils mailheader ring pcvs-util add-log diff-mode pp elp ediff-merg
ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util dired
highline speedbar sb-image ezimage dframe ps-ccrypt delsel server paren
recentf tree-widget wid-edit xcscope easymenu vc cl-loaddefs pcase
cl-lib vc-dispatcher emacs-goodies-loaddefs easy-mmode time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev 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 inotify dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 526407 64788)
 (symbols 48 40045 0)
 (miscs 40 3384 1255)
 (strings 32 86658 8760)
 (string-bytes 1 2653873)
 (vectors 16 61835)
 (vector-slots 8 1055224 27352)
 (floats 8 479 585)
 (intervals 56 17632 351)
 (buffers 976 59)
 (heap 1024 153739 47906))

--94eb2c0979f47871d00547592a02
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>One of the GNU Emacs maintainers eli-zaretski suggest=
ed that I post my<br></div><div>problem as a bug report:</div><div><a href=
=3D"https://www.reddit.com/r/emacs/comments/5qz6en/ctags_and_bash/">https:/=
/www.reddit.com/r/emacs/comments/5qz6en/ctags_and_bash/</a>:</div><div><br>=
</div><div>&#39;Report a bug against Shell-script Mode. It sounds like it d=
oesn&#39;t</div><div>define proper support for finding variables at point, =
so xref uses a</div><div>generic facility, which is only mostly correct in =
this case.&#39;</div><div><br></div><div>My original problem is as follows:=
 (confirm that it also fails with emacs -Q):</div><div><br></div><div>So I&=
#39;ve now got ctags(1) to understand bash variables as well as</div><div>f=
unctions.</div><div><br></div><div>Now I can jump to the defining location =
with M-. (ref-find-definitions)-</div><div>all fine and dandy.</div><div><b=
r></div><div>The only fly in the ointment is that when a bash variable is</=
div><div>concatenated with literal text, M-. wants to look for the entire t=
ext.</div><div>eg if I M-. on the variable in:</div><div><br></div><div>$fo=
obar/bar/foo</div><div><br></div><div>... then it wants to search for fooba=
r/bar/foo instead of just foobar.</div><div>=C2=A0</div><div>It wouldn&#39;=
t be so bad if I could repeat-complex-command and edit the</div><div>search=
 string but M-. doesn&#39;t appear to push the command there.</div><div><br=
></div><div>Short of re-writing all the code as &quot;$foobar&quot;/bar/foo=
 is there something</div><div>I can set to fix this?</div><div><br></div><d=
iv>In case it&#39;s interesting, this is how I build TAGS:</div><div>DIRS=
=3D(</div><div>=C2=A0 =C2=A0 dir1</div><div>=C2=A0 =C2=A0 dir2</div><div>)<=
/div><div><br></div><div>ctags_opts=3D&#39;--regex-sh=3D/^[ \t]*(local|expo=
rt|declare)?[ \t]*([A-Za-z0-9_-]+)=3D/\2/v,variable,variables/&#39;</div><d=
iv><br></div><div>find ${DIRS[@]} -name .svn -prune -o -print | while read =
F; do</div><div>=C2=A0 =C2=A0 file -i &quot;$F&quot; | egrep -q &#39;shells=
cript|text/plain&#39; &amp;&amp; ctags -e --languages=3Dsh -a &quot;$ctags_=
opts&quot; &quot;$F&quot;</div><div>done</div><div><br></div><div><br></div=
><div><br></div><div>In GNU Emacs 25.1.1 (x86_64-redhat-linux-gnu, GTK+ Ver=
sion 3.20.9)</div><div>=C2=A0of 2016-10-13 built on <a href=3D"http://build=
vm-05.phx2.fedoraproject.org">buildvm-05.phx2.fedoraproject.org</a></div><d=
iv>Windowing system distributor &#39;Fedora Project&#39;, version 11.0.1180=
4000</div><div>System Description:<span class=3D"Apple-tab-span" style=3D"w=
hite-space:pre">	</span>Fedora release 24 (Twenty Four)</div><div><br></div=
><div>Configured using:</div><div>=C2=A0&#39;configure --build=3Dx86_64-red=
hat-linux-gnu</div><div>=C2=A0--host=3Dx86_64-redhat-linux-gnu --program-pr=
efix=3D</div><div>=C2=A0--disable-dependency-tracking --prefix=3D/usr --exe=
c-prefix=3D/usr</div><div>=C2=A0--bindir=3D/usr/bin --sbindir=3D/usr/sbin -=
-sysconfdir=3D/etc</div><div>=C2=A0--datadir=3D/usr/share --includedir=3D/u=
sr/include --libdir=3D/usr/lib64</div><div>=C2=A0--libexecdir=3D/usr/libexe=
c --localstatedir=3D/var</div><div>=C2=A0--sharedstatedir=3D/var/lib --mand=
ir=3D/usr/share/man</div><div>=C2=A0--infodir=3D/usr/share/info --with-dbus=
 --with-gif --with-jpeg --with-png</div><div>=C2=A0--with-rsvg --with-tiff =
--with-xft --with-xpm --with-x-toolkit=3Dgtk3</div><div>=C2=A0--with-gpm=3D=
no --with-xwidgets build_alias=3Dx86_64-redhat-linux-gnu</div><div>=C2=A0ho=
st_alias=3Dx86_64-redhat-linux-gnu &#39;CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g</d=
iv><div>=C2=A0-pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=
=3D2</div><div>=C2=A0-fexceptions -fstack-protector-strong --param=3Dssp-bu=
ffer-size=3D4</div><div>=C2=A0-grecord-gcc-switches -specs=3D/usr/lib/rpm/r=
edhat/redhat-hardened-cc1</div><div>=C2=A0-m64 -mtune=3Dgeneric&#39; LDFLAG=
S=3D-Wl,-z,relro</div><div>=C2=A0PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/u=
sr/share/pkgconfig&#39;</div><div><br></div><div>Configured features:</div>=
<div>XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTI=
FY</div><div>ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLI=
B</div><div>TOOLKIT_SCROLL_BARS GTK3 X11 XWIDGETS</div><div><br></div><div>=
Important settings:</div><div>=C2=A0 value of $LC_ALL: en_AU.utf8</div><div=
>=C2=A0 value of $LANG: C</div><div>=C2=A0 locale-coding-system: utf-8-unix=
</div><div><br></div><div>Major mode: Help</div><div><br></div><div>Minor m=
odes in effect:</div><div>=C2=A0 global-flycheck-mode: t</div><div>=C2=A0 h=
elm-mode: t</div><div>=C2=A0 shell-dirtrack-mode: t</div><div>=C2=A0 async-=
bytecomp-package-mode: t</div><div>=C2=A0 diff-auto-refine-mode: t</div><di=
v>=C2=A0 delete-selection-mode: t</div><div>=C2=A0 show-paren-mode: t</div>=
<div>=C2=A0 recentf-mode: t</div><div>=C2=A0 tooltip-mode: t</div><div>=C2=
=A0 global-eldoc-mode: t</div><div>=C2=A0 electric-indent-mode: t</div><div=
>=C2=A0 mouse-wheel-mode: t</div><div>=C2=A0 menu-bar-mode: t</div><div>=C2=
=A0 file-name-shadow-mode: t</div><div>=C2=A0 global-font-lock-mode: t</div=
><div>=C2=A0 font-lock-mode: t</div><div>=C2=A0 blink-cursor-mode: t</div><=
div>=C2=A0 auto-composition-mode: t</div><div>=C2=A0 auto-encryption-mode: =
t</div><div>=C2=A0 auto-compression-mode: t</div><div>=C2=A0 buffer-read-on=
ly: t</div><div>=C2=A0 column-number-mode: t</div><div>=C2=A0 line-number-m=
ode: t</div><div>=C2=A0 transient-mark-mode: t</div><div><br></div><div>Rec=
ent messages:</div><div>Setting up indent for shell type bash</div><div>Ind=
entation variables are now local.</div><div>Indentation setup for shell typ=
e bash</div><div>ARCH appears unused. Verify it or export it. [SC2034]</div=
><div>Setting up indent for shell type sh</div><div>Indentation variables a=
re now local.</div><div>Indentation setup for shell type sh</div><div>TARGE=
T_ARCH appears unused. Verify it or export it. [SC2034] [3 times]</div><div=
>Type C-x 4 C-o RET to restore the other window. =C2=A0</div><div>Type &quo=
t;q&quot; to restore previous buffer.</div><div><br></div><div>Load-path sh=
adows:</div><div>/usr/share/emacs/site-lisp/gnus-bonus/nnir hides /usr/shar=
e/emacs/25.1/lisp/gnus/nnir</div><div>/usr/share/emacs/site-lisp/gnus-bonus=
/nnnil hides /usr/share/emacs/25.1/lisp/gnus/nnnil</div><div>/usr/share/ema=
cs/site-lisp/gnus-bonus/spam-stat hides /usr/share/emacs/25.1/lisp/gnus/spa=
m-stat</div><div>/usr/share/emacs/site-lisp/goodies/browse-kill-ring hides =
~/.config/emacs/browse-kill-ring</div><div>/usr/share/emacs/25.1/lisp/vc/vc=
-svn hides ~/.config/emacs/vc-svn</div><div><br></div><div>Features:</div><=
div>(shadow sort mail-extr emacsbug sendmail warnings apropos jka-compr</di=
v><div>helm-command helm-elisp helm-eval edebug eieio-opt dabbrev pulse</di=
v><div>ibuf-ext ibuffer locate find-dired ido winner grep etags xref projec=
t</div><div>misearch multi-isearch vc-svn hideshow sh-script smie executabl=
e</div><div>flycheck json map find-func subr-x dash indent-tools yafolding =
hydra lv</div><div>indent-tools-indentation-of helm-mode helm-files rx imag=
e-dired tramp</div><div>tramp-compat tramp-loaddefs trampver ucs-normalize =
shell pcomplete</div><div>dired-x dired-aux ffap thingatpt helm-buffers hel=
m-elscreen helm-tags</div><div>helm-bookmark helm-adaptive helm-info bookma=
rk helm-locate helm-grep</div><div>helm-regexp helm-external helm-net brows=
e-url xml url url-proxy</div><div>url-privacy url-expand url-methods url-hi=
story url-cookie url-domsuf</div><div>url-util url-parse auth-source url-va=
rs mailcap helm-utils compile</div><div>comint ansi-color helm-help helm-ty=
pes helm-config helm-easymenu</div><div>async-bytecomp async helm helm-sour=
ce cl-seq eieio-compat eieio</div><div>eieio-core helm-multi-match helm-lib=
 finder-inf info package seq</div><div>browse-kill-ring hide-comnt psvn byt=
e-opt bytecomp byte-compile cl-extra</div><div>cconv advice derived edmacro=
 kmacro cl-macs cl gv log-edit message idna</div><div>format-spec rfc822 mm=
l mml-sec password-cache epg epg-config gnus-util</div><div>mm-decode mm-bo=
dies mm-encode mail-parse rfc2231 rfc2047 rfc2045</div><div>ietf-drums mm-u=
til help-fns help-mode mail-prsvr mailabbrev mail-utils</div><div>gmm-utils=
 mailheader ring pcvs-util add-log diff-mode pp elp ediff-merg</div><div>ed=
iff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util dired</div>=
<div>highline speedbar sb-image ezimage dframe ps-ccrypt delsel server pare=
n</div><div>recentf tree-widget wid-edit xcscope easymenu vc cl-loaddefs pc=
ase</div><div>cl-lib vc-dispatcher emacs-goodies-loaddefs easy-mmode time-d=
ate</div><div>mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks=
</div><div>lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd =
fontset</div><div>image regexp-opt fringe tabulated-list newcomment elisp-m=
ode lisp-mode</div><div>prog-mode register page menu-bar rfn-eshadow timer =
select scroll-bar</div><div>mouse jit-lock font-lock syntax facemenu font-c=
ore frame cl-generic cham</div><div>georgian utf-8-lang misc-lang vietnames=
e tibetan thai tai-viet lao</div><div>korean japanese eucjp-ms cp51932 hebr=
ew greek romanian slovak czech</div><div>european ethiopic indian cyrillic =
chinese charscript case-table epa-hook</div><div>jka-cmpr-hook help simple =
abbrev minibuffer cl-preloaded nadvice</div><div>loaddefs button faces cus-=
face macroexp files text-properties overlay</div><div>sha1 md5 base64 forma=
t env code-pages mule custom widget</div><div>hashtable-print-readable back=
quote dbusbind inotify dynamic-setting</div><div>system-font-setting font-r=
ender-setting xwidget-internal move-toolbar</div><div>gtk x-toolkit x multi=
-tty make-network-process emacs)</div><div><br></div><div>Memory informatio=
n:</div><div>((conses 16 526407 64788)</div><div>=C2=A0(symbols 48 40045 0)=
</div><div>=C2=A0(miscs 40 3384 1255)</div><div>=C2=A0(strings 32 86658 876=
0)</div><div>=C2=A0(string-bytes 1 2653873)</div><div>=C2=A0(vectors 16 618=
35)</div><div>=C2=A0(vector-slots 8 1055224 27352)</div><div>=C2=A0(floats =
8 479 585)</div><div>=C2=A0(intervals 56 17632 351)</div><div>=C2=A0(buffer=
s 976 59)</div><div>=C2=A0(heap 1024 153739 47906))</div><div><br></div></d=
iv>

--94eb2c0979f47871d00547592a02--




Acknowledgement sent to Bob Hepple <bob.hepple@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#25585; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.