Subject: 24.4; vc-git-working-revision vs mode-line gives error

From: Kevin Brubeck Unhammer <[email-masked]>
Date: Wed, 22 Oct 2014 10:31:42 +0200

Whenever I try to save a git-registered file under emacs 24.4, I get

    apply: Args out of range: #("Git@" 0 4 (help-echo "Locally added
    file under the Git version control system")), 0, 7

The function vc-git-mode-line-string tries to get the revision using
vc-working-revision, which returns nil. Instead of checking the `rev'
variable for nil, it checks `detached', before calling substring. It
should probably do

    (if (and detached rev)
        (substring …) 
     …)

instead. I don't know why vc-working-revision returns nil though
(there's a whole lot of indirection to dig through there).

In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 of 2014-10-21 on kiwiarch
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=lucid --with-xft --without-gconf
 --without-gsettings 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe
 -fstack-protector-strong --param=ssp-buffer-size=4'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LANG: nn_NO.UTF-8
  locale-coding-system: utf-8

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  erc-capab-identify-mode: t
  erc-log-mode: t
  erc-track-score-mode: t
  erc-autoaway-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  diff-auto-refine-mode: t
  eldoc-mode: t
  elisp-slime-nav-mode: t
  display-time-mode: t
  recentf-mode: t
  ido-everywhere: t
  delete-selection-mode: t
  cua-mode: t
  window-numbering-mode: t
  show-paren-mode: t
  paredit-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-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 input:
i n i <return> M-: C-y <return> C-n C-p C-x n C-g C-x 
o C-n C-n M-m M-f M-b C-b C-M-SPC M-w C-x o M-: C-y 
<return> q M-f M-f M-f M-f C-f C-M-SPC M-w C-x o M-: 
M-p M-f M-d C-_ M-f M-d M-d C-e <backspace> <return> 
C-x o C-n C-n M-m C-n M-m C-M-SPC M-w C-x o M-: C-y 
<return> M-: M-p <return> C-x o C-f M-. M-, C-x o M-: 
M-p M-p M-p M-p M-p M-p M-p M-p M-f M-f C-f C-M-k w 
o r k <tab> i <tab> C-e C-b C-M-b C-M-k f i l e C-e 
<return> M-: M-p <return> C-x o C-s v c - g i t - w 
o C-r C-a C-s C-s C-a C-x o C-h f v c - g i t - w o 
<tab> i <tab> <return> C-x o <tab> <return> C-a C-x 
o C-x b <return> C-x o C-n C-n C-n C-M-u C-M-SPC M-w 
C-x o M-: C-y <return> q C-f C-n C-M-SPC M-w C-x o 
M-: C-y <return> q M-f C-f C-M-SPC M-w C-x o M-: C-y 
<return> C-x o C-p C-n C-M-SPC M-w C-x o M-: C-y <return> 
M-: M-p <return> C-x o C-f C-n C-n C-n C-n C-n C-n 
C-M-u C-M-SPC M-w C-x o M-: C-y <return> C-x o C-M-b 
C-M-b C-p C-p M-f M-f M-. C-x b C-s C-s <return> C-x 
C-s C-x o M-x M-p C-g C-x b <return> C-u C-SPC C-u 
C-SPC C-e M-: M-p M-p M-p M-p M-p M-p M-p M-p M-p M-p 
M-n M-p M-p M-p M-p M-n M-p <return> M-: M-p M-p M-p 
M-n M-n M-p M-p M-p M-p M-p M-p M-p M-p M-p M-p M-p 
M-p M-p M-p M-p M-p M-p <return> <tab> <return> C-a 
C-x o q C-x C-s C-x o C-M-b C-M-SPC M-x M-p <retur
n>

Recent messages:
Searching for vc-git--run-command-string...
Mark set
(No changes need to be saved)
Quit
#("Git@" 0 4 (help-echo "Locally added file under the Git version control system
Current revision: "))
Entering debugger...
mouse-2, RET: find function's definition
Back to top level.
(No changes need to be saved)

Load-path shadows:
/usr/share/emacs/site-lisp/emms/tq hides /usr/share/emacs/24.4/lisp/emacs-lisp/tq

Features:
(shadow emacsbug bbdb-message footnote face-remap tramp-cache tramp
tramp-compat tramp-loaddefs trampver shell texmathp latexenc texinfo
toolbar-x reporter desktop frameset context plain-tex compile autoload
lisp-mnt tar-mode url-handlers finder-inf apropos preview prv-emacs
tex-fold tex-buf font-latex latex tex-style tex dbus w3m-filter
w3m-cookie w3m-bookmark w3m-tabmenu w3m-session gnus-html xml cal-iso
bbdb-vcard vcard flow-fill shr-color debug cus-start cus-load org-agenda
calc-map calc-stat calc-vec calc-ext calc-menu calc-aent calc
calc-loaddefs calc-macs cal-move tabify org-table org-rmail org-mhe
org-irc org-info org-gnus org-docview org-bibtex bibtex org-bbdb org-w3m
org-random-todo org-element org-crypt org org-macro org-footnote
org-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 ob-core ob-eval org-compat org-macs
org-loaddefs ffap w3m-search kbu-w3m w3m-lnum w3m doc-view dired-x dired
image-mode w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon
w3m-image w3m-proc w3m-util jka-compr eieio-opt speedbar sb-image
ezimage dframe find-func cua-rect rect misearch multi-isearch mule-util
gnus-gravatar gravatar sort gnus-cite smiley mm-archive gnus-bcklg
gnus-async qp mail-extr gnus-ml url-queue url-http url-gw url-cache
url-auth eww mm-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse url-vars shr
browse-url gnus-topic nndraft nnmh gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 utf-7 gnus-cache
gnus-sum bbdb-gnus nnimap parse-time utf7 view gnutls network-stream
starttls tls bitlbee erc-capab erc-log rot13 disp-table epa-file epa epg
netrc znc warnings erc-yank erc-track-score erc-autoaway erc-list
erc-menu erc-join erc-ring erc-networks erc-pcomplete pcomplete
erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit
erc-goodies erc erc-backend erc-compat pp git-commit-mode log-edit
notmuch hl-line notmuch-version notmuch-message notmuch-maildir-fcc
notmuch-hello notmuch-tree notmuch-parser notmuch-show notmuch-print
notmuch-crypto notmuch-mua notmuch-address notmuch-wash diff-mode coolj
notmuch-query goto-addr icalendar notmuch-tag notmuch-lib mm-view
mml-smime smime dig mailcap kbu-bbdb bbdb-anniv bbdb2erc bbdb-mua
bbdb-com crm bbdb bbdb-site timezone gnus-demon nntp gnus-group
gnus-undo nnmail mail-source gnus-start gnus-spec gnus-win nnoo gnus-int
gnus-range offlineimap comint ansi-color smtpmail auth-source eieio
byte-opt bytecomp byte-compile cconv eieio-core password-cache sendmail
gnus gnus-ems nnheader gnus-util message idna format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log eldoc diminish elisp-slime-nav help-mode etags ring
wheatgrass-theme bash-completion-autoloads bbdb-vcard-autoloads
bbdb2erc-autoloads bbdb-autoloads color-theme-approximate-autoloads
csv-mode-autoloads ddg-autoloads diminish-autoloads dix-autoloads
elisp-slime-nav-autoloads erc-track-score-autoloads
find-file-in-repository-autoloads fiplr-autoloads
flymake-jslint-autoloads flymake-easy-autoloads ggtags-autoloads
god-mode-autoloads goto-chg-autoloads grizzl-autoloads
impatient-mode-autoloads htmlize-autoloads jedi-autoloads
auto-complete-autoloads epc-autoloads ctable-autoloads
concurrent-autoloads js2-refactor-autoloads json-snatcher-autoloads
keyfreq-autoloads litable-autoloads magit-filenotify-autoloads
magit-svn-autoloads info git-rebase-mode-autoloads
markdown-mode-autoloads mediawiki-autoloads minimap-autoloads
mwe-log-commands-autoloads noctilux-theme-autoloads oauth-autoloads
offlineimap-autoloads paredit-everywhere-autoloads paredit-autoloads
popup-autoloads powerline powerline-separators color powerline-themes
python-environment-autoloads deferred-autoloads rainbow-mode-autoloads
rust-mode-autoloads s-autoloads simple-httpd-autoloads
tea-time-autoloads tuareg-autoloads undo-tree-autoloads utop-autoloads
wcheck-mode-autoloads zenburn-theme-autoloads kbu-dix kbu-kaldera
csv-kalderagram cg-kalderagram errcorr package epg-config w3m-load
preview-latex tex-site auto-loads kbu-org remember solar cal-dst
holidays hol-loaddefs vc-git appt diary-lib diary-loaddefs pabbrev
derived thingatpt time recentf tree-widget wid-edit ido server saveplace
delsel cua-base cal-menu easymenu calendar cal-loaddefs calendar-norway
advice help-fns midnight window-numbering time-date paren paredit
easy-mmode iso-transl kbu-selector edmacro kmacro cl-macs cl gv
cl-loaddefs cl-lib tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind
gfilenotify dynamic-setting font-render-setting x-toolkit x multi-tty
emacs)

Memory information:
((conses 16 1263704 163547)
 (symbols 48 74875 0)
 (miscs 40 5902 5617)
 (strings 32 187493 18068)
 (string-bytes 1 6647178)
 (vectors 16 67528)
 (vector-slots 8 1920805 145259)
 (floats 8 1124 1215)
 (intervals 56 56303 1123)
 (buffers 960 114)
 (heap 1024 108861 67472))
<#secure method=pgpmime mode=sign>

-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C