From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.bugs Subject: bug#24632: 25.1; shell-mode sets shell-dirstack-query incorrectly for zsh Date: Thu, 06 Oct 2016 15:09:59 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475797545 3896 195.159.176.226 (6 Oct 2016 23:45:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Oct 2016 23:45:45 +0000 (UTC) To: 24632@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 07 01:45:40 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsILk-0006GK-KQ for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Oct 2016 01:45:16 +0200 Original-Received: from localhost ([::1]:59839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsILg-0004ie-5x for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2016 19:45:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsILY-0004h6-UA for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 19:45:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsILW-0006lg-Tk for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 19:45:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsILW-0006lU-Q8 for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 19:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bsILW-0002LC-1u for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 19:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2016 23:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24632 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14757974818956 (code B ref -1); Thu, 06 Oct 2016 23:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Oct 2016 23:44:41 +0000 Original-Received: from localhost ([127.0.0.1]:47039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsILA-0002KM-RJ for submit@debbugs.gnu.org; Thu, 06 Oct 2016 19:44:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsGro-0008RY-OV for submit@debbugs.gnu.org; Thu, 06 Oct 2016 18:10:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsGrh-0004AN-NI for submit@debbugs.gnu.org; Thu, 06 Oct 2016 18:10:11 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsGrh-00049G-Jj for submit@debbugs.gnu.org; Thu, 06 Oct 2016 18:10:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsGre-0003E1-Ds for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 18:10:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsGrb-000443-CG for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 18:10:05 -0400 Original-Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:35283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsGra-00043A-U4 for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 18:10:03 -0400 Original-Received: by mail-pa0-x22f.google.com with SMTP id qn10so10460641pac.2 for ; Thu, 06 Oct 2016 15:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:mime-version; bh=5mqG5xZb2u+cctMfvZaHh6Ubm28oU/0Qy7MFHsuQ7W8=; b=hpf7rBSu0bgiQjgcUstDkC3i67JQoPf6e5Nte+IDft9oIvN72SeuigJ5YBCV5jLfCg mmiZats2YFFdiREhxunZQlxh3fUfrYpxjRttMKheo1/nG2wSHB/HBGh/A2K/REgFFzc0 oD08nmEmS5yL63yJriHWBGCjH1cXOOLomuT2XKxEtiHhgmfmVEwvTgrfr59ARJIUNES9 4Q1po52L/f5z6fHjI6PaBSs5MxEGBuV1IO/3gzAymbGn+/DQ7N5PgK9+uKJc4t5ORQmm PlAECT3UIXeE2lHzNfKwZ1lCx1RrxPV5fm79byC3Yu3gcMMM/s6nOXZg4zx1ll2mqQ+y ZNnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=5mqG5xZb2u+cctMfvZaHh6Ubm28oU/0Qy7MFHsuQ7W8=; b=B0z9PBSGDBMZBSglz1ELCfLVSdd/DBlF0RGyTregHH2Th938Op1LrEyi7NceaE9BJM Y+bNzcnAJYr5YcBhc69wWBr6wF9G1ZwFqPP3fhLRzAbgRoLazETXZ5zpu+k8UbNeqceA SDXMuK4Q3MAGZUnBy6ieUM7N5T8Qth62BD02yjdGx1ri1TenskyrI0VsAazcoijYHEb9 Cf+u8AM6OG4dsYcvQPcX2NVjUzXyKz6h8iSvhxC6qOxfDEilBDc2C8OuYNbrhfq61jLK q3m1/xB3X+wCUoTpKRu8xIEt/W4IP/ucNW/86tWHJ3VyEarHPK7Sc40FiJK5O3lbKk8m JrZg== X-Gm-Message-State: AA6/9Rn4r16KYmLkFOUpXskZ9BIuVEuSCS00Ad0zZFPp4uRoDq2Qzi1tEW7ICCJRJUY/U1Cq X-Received: by 10.66.148.8 with SMTP id to8mr25294737pab.2.1475791801003; Thu, 06 Oct 2016 15:10:01 -0700 (PDT) Original-Received: from marmstrong-linux.kir.corp.google.com ([2620:0:1008:11:653b:55e7:1114:810c]) by smtp.gmail.com with ESMTPSA id xs10sm25243810pac.24.2016.10.06.15.10.00 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 06 Oct 2016 15:10:00 -0700 (PDT) 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-Mailman-Approved-At: Thu, 06 Oct 2016 19:44:39 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124137 Archived-At: Background: I have my login shell set to /bin/zsh, reflected by SHELL=/bin/zsh in my environment, and M-x shell is picking this up and using it. The zsh dirs command can abbreviate directories. For example, if I issue this sequence in my shell: % mkdir -p /tmp/a/b/c/d/e/f/g % cd /tmp/a/b/c/d/e/f/g % hash -d e=/tmp/a/b/c/d/e % cd ~e % dirs ~e ~e/f/g [...and some prior dirs...] The bug: The zsh tilde abbreviation (above) confuses the M-x dirs command. Emacs can't parse it and determine the correct directory. The fix: The way to disable this in zsh is "dirs -l". Continuing the above: % dirs -l /tmp/a/b/c/d/e /tmp/a/b/c/d/e/f/g [...and some prior dirs...] I have the following in my .emacs to address this: (defun my-shell-mode-hook () (let ((shell (file-name-nondirectory (car (process-command (get-buffer-process (current-buffer))))))) (if (string-equal shell "zsh") (setq shell-dirstack-query "dirs -l")))) (add-hook 'shell-mode-hook 'my-shell-mode-hook) It would be great if shell.el did the same (forgive the hand-written patch): ;; Bypass any aliases. TODO all shells could use this. ((string-equal shell "bash") "command dirs") + ((string-equal shell "zsh") "dirs -l") (t "dirs"))) In GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars), modified by Debian Windowing system distributor 'The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS Configured using: 'configure --build x86_64-linux-gnu --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/google-emacs:/etc/emacs:/usr/local/share/emacs/25.1+gg1+7/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1+gg1+7/site-lisp:/usr/share/emacs/site-lisp --with-crt-dir=/usr/lib/x86_64-linux-gnu --disable-build-details --with-modules GOOGLE_VERSION=25.1+gg1+7 --with-x=yes --with-x-toolkit=lucid --with-toolkit-scroll-bars --without-gconf --without-gsettings build_alias=x86_64-linux-gnu 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-fuse-ld=gold,--export-dynamic-symbol=__google_auxv' 'CPPFLAGS=-D_FORTIFY_SOURCE=2 -DGOOGLE_EMACS_DEFINE_AUXV'' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 MODULES Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: msb-mode: t winner-mode: t global-auto-revert-mode: t google-emacs-support-show-upgrade-mode: t google-kg-mode: t shell-dirtrack-mode: t diff-auto-refine-mode: t flyspell-mode: t auto-insert-mode: t display-time-mode: t show-paren-mode: t keyfreq-autosave-mode: t keyfreq-mode: t icomplete-mode: t which-key-mode: t override-global-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 temp-buffer-resize-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent messages: Quit /google/src/cloud/marmstrong/base_config_lint/google3 ~/env/dot Quit [2 times] Mark saved where search started Auto-saving...done Saving file /usr/local/google/home/marmstrong/env/dot/emacs... Wrote /usr/local/google/home/marmstrong/env/dot/emacs Saving file /usr/local/google/home/marmstrong/env/dot/emacs... Wrote /usr/local/google/home/marmstrong/env/dot/emacs (No changes need to be saved) [2 times] Load-path shadows: /usr/local/google/home/marmstrong/env/elisp/diminish hides /usr/local/google/home/marmstrong/.emacs.d/elpa/diminish-20151215.915/diminish /usr/local/google/home/marmstrong/.emacs.d/elpa/dash-2.13.0/dash hides /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/dash/dash /usr/local/google/home/marmstrong/env/elisp/make-regexp hides /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/ess_mode/lisp/make-regexp /usr/local/google/home/marmstrong/.emacs.d/elpa/goto-chg-20131228.659/goto-chg hides /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/goto_chg/goto-chg /usr/local/google/home/marmstrong/env/elisp/ctypes hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/ctypes /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/markdown_mode/markdown-mode hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/markdown-mode /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/folding/folding hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/folding /usr/local/google/home/marmstrong/env/elisp/htmlize hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/htmlize /usr/local/google/home/marmstrong/env/elisp/graphviz-dot-mode hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/graphviz-dot-mode /usr/local/google/home/marmstrong/env/elisp/diminish hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/diminish /usr/local/google/home/marmstrong/env/elisp/floatbg hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/floatbg /usr/local/google/home/marmstrong/env/elisp/ff-paths hides /usr/share/google-emacs/site-lisp/emacs-goodies-el/ff-paths /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/auto_complete/auto-complete-config hides /usr/share/google-emacs/site-lisp/auto-complete/auto-complete-config /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/auto_complete/auto-complete hides /usr/share/google-emacs/site-lisp/auto-complete/auto-complete /usr/share/google-emacs/site-lisp/emacs-google-config/third_party/elisp/popup/popup hides /usr/share/google-emacs/site-lisp/auto-complete/popup /usr/share/emacs/25.1+gg1+7/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/25.1+gg1+7/lisp/textmodes/rst Features: (shadow emacsbug man pcmpl-unix novice make-mode eieio-opt url-handlers url-http url-gw url-cache url-auth mm-uu mml2015 nnheader hi-lock org-element org-rmail org-mhe org-irc org-info org-gnus org-docview org-bibtex bibtex org-bbdb org-w3m dired-aux imenu two-column iso-transl sh-script smie executable qp mm-archive network-stream nsm starttls tls gnutls mailalias dabbrev sort company-oddmuse company-keywords company-etags company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb company mail-extr tabify p4-google p4 ps-print ps-def lpr cap-words superword subword term/xterm xterm edebug msb misearch multi-isearch google-git vc-git tsdh-dark-theme winner autorevert filenotify cus-start cus-load mu4e mu4e-speedbar speedbar sb-image ezimage dframe mu4e-main mu4e-view epa browse-url mu4e-headers mu4e-compose mu4e-draft mu4e-actions rfc2368 mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils doc-view jka-compr image-mode mu4e-lists mu4e-about mu4e-vars mu4e-meta server google-tricorder google-piper deferred google-flycheck flycheck google-pyformat reformat-file apply-ed-script smtpmail sendmail google-imports grok-service google-prodaccess google-process f grok-macros s dash view gtags-google gtags-aliases gtags tree-widget etags xref project google-cc-extras google3-build clang-format xml cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align gcomplete help-at-pt flymake google google-emacs-support subr-x google-log google3-build-mode gud google3 compile google-gud google-comint google-kg google-emacs-utilities google-trailing-whitespace google-coding-style python-custom python tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell json map cc-engine cc-vars cc-defs google-autogen google-paths google-platform org-protocol org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint comint ansi-color ob-core ob-eval org-compat org-macs org-loaddefs notmuch hl-line notmuch-message notmuch-maildir-fcc notmuch-hello wid-edit notmuch-tree notmuch-show notmuch-print notmuch-crypto notmuch-mua derived notmuch-address notmuch-company notmuch-parser notmuch-wash diff-mode coolj notmuch-query goto-addr icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag crm notmuch-lib notmuch-version message dired format-spec rfc822 mml mailabbrev mail-utils gmm-utils mailheader mm-view mml-smime mml-sec epg smime dig mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums elisp-format flyspell ispell protbuf ctypes skeleton autoinsert time paren ert pp find-func ewoc debug keyfreq generic icomplete edmacro kmacro highlight-symbol thingatpt hydra ring lv which-key advice use-package diminish cl bind-key solarized-theme solarized-definitions finder-inf info package epg-config seq emacs-google-config-loaddefs rx emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode tempo url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source cl-seq eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core cl-macs gv gnus-util mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr password-cache url-vars mailcap xml-parse doxymacs 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 font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1780261 229580) (symbols 48 56246 109) (miscs 40 6294 8007) (strings 32 175701 49080) (string-bytes 1 5935824) (vectors 16 94189) (vector-slots 8 2252231 126077) (floats 8 916 1599) (intervals 56 319265 1777) (buffers 976 218) (heap 1024 113885 15540))