emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#24632: closed (25.1; shell-mode sets shell-dirstac


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#24632: closed (25.1; shell-mode sets shell-dirstack-query incorrectly for zsh)
Date: Sun, 11 Dec 2016 01:34:01 +0000

Your message dated Sat, 10 Dec 2016 20:33:17 -0500
with message-id <address@hidden>
and subject line Re: bug#24632: 25.1; shell-mode sets shell-dirstack-query 
incorrectly for zsh
has caused the debbugs.gnu.org bug report #24632,
regarding 25.1; shell-mode sets shell-dirstack-query incorrectly for zsh
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
24632: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24632
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.1; shell-mode sets shell-dirstack-query incorrectly for zsh Date: Thu, 06 Oct 2016 15:09:59 -0700

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))



--- End Message ---
--- Begin Message --- Subject: Re: bug#24632: 25.1; shell-mode sets shell-dirstack-query incorrectly for zsh Date: Sat, 10 Dec 2016 20:33:17 -0500 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 26.1

Thanks; applied in 8d1b753.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]