unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5297: 23.1; vc: fails to follow symlinks inside HOME
@ 2010-01-03  6:33 Yuya Nishihara
  2010-01-03 14:05 ` bug#5297: [PATCH] vc: fixed test of symlinks on abbreviatable path Yuya Nishihara
  2010-01-03 14:10 ` bug#5297: Re: 23.1; vc: fails to follow symlinks inside HOME Yuya Nishihara
  0 siblings, 2 replies; 4+ messages in thread
From: Yuya Nishihara @ 2010-01-03  6:33 UTC (permalink / raw)
  To: bug-gnu-emacs

When detecting vc backend, vc-find-file-hook passes buffer-file-truename
to vc-backend function. However, because buffer-file-truename is *abbreviated*,
following vc-hg-registered or vc-git-registered just fails.

Also it seems bad to test equalness of buffer-file-name
and buffer-file-truename. Maybe buffer-file-name is expanded,
but buffer-file-truename is abbreviated.


In GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.3)
 of 2009-11-02 on excelsior, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10605000
configured using `configure  '--build=x86_64-linux-gnu' '--host=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/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: C
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  cua-mode: t
  tabbar-mwheel-mode: t
  tabbar-mode: t
  highlight-symbol-mode: t
  hi-lock-mode: t
  global-linum-mode: t
  linum-mode: t
  hl-line-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r <tab> <return>

Recent messages:
Loading /etc/emacs/site-start.d/50php-elisp.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50pymacs.el (source)...done
Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done
Loading /etc/emacs/site-start.d/50python-mode.el (source)...done
Loading /etc/emacs/site-start.d/50ruby1.8-elisp.el (source)...done
Loading /etc/emacs/site-start.d/50yaml-mode.el (source)...done
Loading cua-base...done
Loading paren...done
For information about GNU Emacs and the GNU system, type <f1> C-a.








^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#5297: [PATCH] vc: fixed test of symlinks on abbreviatable path
  2010-01-03  6:33 bug#5297: 23.1; vc: fails to follow symlinks inside HOME Yuya Nishihara
@ 2010-01-03 14:05 ` Yuya Nishihara
  2012-12-01 13:26   ` Chong Yidong
  2010-01-03 14:10 ` bug#5297: Re: 23.1; vc: fails to follow symlinks inside HOME Yuya Nishihara
  1 sibling, 1 reply; 4+ messages in thread
From: Yuya Nishihara @ 2010-01-03 14:05 UTC (permalink / raw)
  To: 5297; +Cc: Yuya Nishihara

commit 51431c222c24bbe2919d3d98032f73723ebfccea
Author: Yuya Nishihara <yuya@tcha.org>
Date:   Sun Jan 3 14:12:56 2010 +0900

    vc: fixed test of symlinks on abbreviatable path
    
    buffer-file-truename is *abbreviated* truename, but buffer-file-name seems not,
    so we need to expand it.
    
    With abbreviated file-name, at least, vc-git and vc-hg are not detected
    as backend. This means symlinks to git/hg-managed files on HOME directory
    are not handled by vc-find-file-hook.

diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index fabb35f..238fafe 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -890,8 +890,9 @@ current, and kill the buffer that visits the link."
 	  (set (make-local-variable 'backup-inhibited) t))
 	;; Let the backend setup any buffer-local things he needs.
 	(vc-call-backend backend 'find-file-hook))
-       ((let ((link-type (and (not (equal buffer-file-name buffer-file-truename))
-			      (vc-backend buffer-file-truename))))
+       ((let* ((truename (expand-file-name buffer-file-truename))
+	       (link-type (and (not (equal buffer-file-name truename))
+			       (vc-backend truename))))
 	  (cond ((not link-type) nil)	;Nothing to do.
 		((eq vc-follow-symlinks nil)
 		 (message






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#5297: Re: 23.1; vc: fails to follow symlinks inside HOME
  2010-01-03  6:33 bug#5297: 23.1; vc: fails to follow symlinks inside HOME Yuya Nishihara
  2010-01-03 14:05 ` bug#5297: [PATCH] vc: fixed test of symlinks on abbreviatable path Yuya Nishihara
@ 2010-01-03 14:10 ` Yuya Nishihara
  1 sibling, 0 replies; 4+ messages in thread
From: Yuya Nishihara @ 2010-01-03 14:10 UTC (permalink / raw)
  To: 5297; +Cc: Yuya Nishihara

Hi,

> When detecting vc backend, vc-find-file-hook passes buffer-file-truename
> to vc-backend function. However, because buffer-file-truename is *abbreviated*,
> following vc-hg-registered or vc-git-registered just fails.

The following snippet is workaround for the problem:

--
(defadvice vc-backend (before vc-backend-fix-abbrev-name activate)
  "Fixes vc-backend to expand abbreviated buffer-file-truename"
  (if (stringp (ad-get-arg 0))
      (ad-set-arg 0 (expand-file-name (ad-get-arg 0)))))
--

Yuya.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#5297: [PATCH] vc: fixed test of symlinks on abbreviatable path
  2010-01-03 14:05 ` bug#5297: [PATCH] vc: fixed test of symlinks on abbreviatable path Yuya Nishihara
@ 2012-12-01 13:26   ` Chong Yidong
  0 siblings, 0 replies; 4+ messages in thread
From: Chong Yidong @ 2012-12-01 13:26 UTC (permalink / raw)
  To: Yuya Nishihara; +Cc: 5297-done

Yuya Nishihara <yuya@tcha.org> writes:

>     vc: fixed test of symlinks on abbreviatable path
>     
>     buffer-file-truename is *abbreviated* truename, but
>     buffer-file-name seems not, so we need to expand it.
>     
>     With abbreviated file-name, at least, vc-git and vc-hg are not detected
>     as backend. This means symlinks to git/hg-managed files on HOME directory
>     are not handled by vc-find-file-hook.

Sorry for the long delay.  I didn't have a test case, but this patch
looks correct so I've installed it in trunk.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-01 13:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03  6:33 bug#5297: 23.1; vc: fails to follow symlinks inside HOME Yuya Nishihara
2010-01-03 14:05 ` bug#5297: [PATCH] vc: fixed test of symlinks on abbreviatable path Yuya Nishihara
2012-12-01 13:26   ` Chong Yidong
2010-01-03 14:10 ` bug#5297: Re: 23.1; vc: fails to follow symlinks inside HOME Yuya Nishihara

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).