all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Possible bug in resolving "~" folder
@ 2003-05-26  5:19 Dhruva Krishnamurthy
  2003-05-26 14:31 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Dhruva Krishnamurthy @ 2003-05-26  5:19 UTC (permalink / raw)
  Cc: Emacs Devel

Hello,
  I am using Emacs 21.3.50 (CVS) on W2K (MSVC 6.0 build).
Scenerio:
- Open a file (as in my case:"~/bin/cinclude.pl")
- Do a Save As (to "~/bin/cinclude1_0.pl")
- A call to (vc-mcvs-registered "~/bin/cinclude1_0.pl") is made
- In the "while" loop, a call to (file-name-directory "~") [progressively
going to top dir]
- The above call returns "nil". IMHO, it should have called
"expand-file-name" internally inside "file-name-directory" or should
handle 'nil' and return 'nil' instead of throwing error.

A fix which solved my problem was: in loaddefs.el @23991, call
expand-file-name
(defun vc-mcvs-registered (file)
  (let ((dir file))
    (while (and (stringp dir)
 		(not (equal dir (setq dir (file-name-directory (expand-file-name dir)))))) ;; Modified here
      (setq dir (if (file-directory-p
 		     (expand-file-name "MCVS/CVS" dir))
 		    t (directory-file-name dir))))
    (if (eq dir t)
 	(progn
 	  (load "vc-mcvs")
 	  (vc-mcvs-registered file)))))
-- 
Dhruva Krishnamurthy
Home: http://www32.brinkster.com/schemer/

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

* Re: Possible bug in resolving "~" folder
  2003-05-26  5:19 Possible bug in resolving "~" folder Dhruva Krishnamurthy
@ 2003-05-26 14:31 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2003-05-26 14:31 UTC (permalink / raw)
  Cc: Emacs Devel

> Hello,
>   I am using Emacs 21.3.50 (CVS) on W2K (MSVC 6.0 build).
> Scenerio:
> - Open a file (as in my case:"~/bin/cinclude.pl")
> - Do a Save As (to "~/bin/cinclude1_0.pl")
> - A call to (vc-mcvs-registered "~/bin/cinclude1_0.pl") is made
> - In the "while" loop, a call to (file-name-directory "~") [progressively
> going to top dir]
> - The above call returns "nil". IMHO, it should have called
> "expand-file-name" internally inside "file-name-directory" or should
> handle 'nil' and return 'nil' instead of throwing error.
> 
> A fix which solved my problem was: in loaddefs.el @23991, call
> expand-file-name
> (defun vc-mcvs-registered (file)
>   (let ((dir file))
>     (while (and (stringp dir)
>  		(not (equal dir (setq dir (file-name-directory (expand-file-name dir)))))) ;; Modified here
>       (setq dir (if (file-directory-p
>  		     (expand-file-name "MCVS/CVS" dir))
>  		    t (directory-file-name dir))))
>     (if (eq dir t)
>  	(progn
>  	  (load "vc-mcvs")
>  	  (vc-mcvs-registered file)))))

It's been fixed a while ago in vc-mcvs.el, but it seems nobody has
refreshed the loaddefs.el file since.  The fix doesn't do the
expand-file-name but checks nil instead because I thought it was
neat that the search stops at ~ rather than going all the way to /.

Could someone commit a refreshed version of loaddefs.el ?
Mine has all kinds of unrelated stuff in it.


	Stefan

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

end of thread, other threads:[~2003-05-26 14:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-26  5:19 Possible bug in resolving "~" folder Dhruva Krishnamurthy
2003-05-26 14:31 ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.