>>>> "Malcolm" == Malcolm Box
<malcolm(a)brownale.demon.co.uk> writes:
Malcolm> This bug report will be sent to the XEmacs Development Team,
Malcolm> not to your local site managers!!
Malcolm> Please write in English, because the XEmacs maintainers do not have
Malcolm> translators to read other languages for them.
Malcolm> Please describe as succinctly as possible:
Malcolm> - What happened.
Malcolm> - What you thought should have happened.
Malcolm> - Precisely what you were doing at the time.
Malcolm> Please also include any C or lisp back-traces that you may have.
Malcolm> ================================================================
Malcolm> Dear Bug Team!
Malcolm> On Windows there is an infinite loop in the function p4-detect-p4 in
p4.el.
Malcolm> The code in question is:
Malcolm> (let ((p4config (getenv "P4CONFIG"))
Malcolm> (p4-cfg-dir (cond (buffer-file-name ;; extrapolate from name
Malcolm> (file-name-directory
Malcolm> (file-truename (buffer-file-name))))
Malcolm> (t default-directory) ;; hmm, use default
Malcolm> )))
Malcolm> (while (not (or (string-match "^\\([a-zA-Z]:\\)?/$"
p4-cfg-dir)
Malcolm> (file-exists-p (concat p4-cfg-dir p4config))))
Malcolm> (setq p4-cfg-dir
Malcolm> (substring p4-cfg-dir 0
Malcolm> (string-match "[^/]*/?$" p4-cfg-dir))))
Malcolm> Which is supposed to traverse up a directory tree looking for a
Malcolm> p4config file and thus show that this is a file controlled by Perforce.
Malcolm> However, in the case of windows, the setq at the end of
Malcolm> the loop will reset p4-cfg-dir to "", which will never
Malcolm> match the loop termination condition. Thus the infinite
Malcolm> loop in the case when there is no p4config file in the
Malcolm> file tree (which is a common occurance).
Malcolm> On an aesthetic note, doing filename manipulations like
Malcolm> this is ugly and error prone.
Right.
Malcolm> The solution to the problem is to replace the loop with:
Malcolm> (while (not (or (string= p4-cfg-dir
Malcolm> (file-name-directory (directory-file-name p4-cfg-dir)))
Malcolm> (file-exists-p (concat p4-cfg-dir p4config))))
Malcolm> (setq p4-cfg-dir
Malcolm> (file-name-directory (directory-file-name p4-cfg-dir))
Malcolm> ))
Hi Malcolm!
Thanks for reporting this problem.
If you would like to get involved a bit more, could you please provide
a patch, which also uses expand-file-name instead of concat?
Thanks in advance,
Adrian
Malcolm> This uses the XEmacs built-in filename manipulation
Malcolm> routines to find the parent directories, and should work
Malcolm> on all filesystems (tested on Windows only). For
Malcolm> termination, it relies on the fact that the parent
Malcolm> directory of the root is the root in Unix or DOS
Malcolm> filesystems ie (file-name-directory (directory-file-name
Malcolm> "/")) is "/".
Malcolm> ================================================================
Malcolm> System Info to help track down your bug:
Malcolm> ---------------------------------------
Malcolm> OS version:
Malcolm> Microsoft Windows 2000 [Version 5.00.2195]
Malcolm> OS: Windows_NT
Malcolm> XEmacs 21.4.8 \"Honest Recruiter (Windows [3])\" configured for
`i586-pc-win32'.
Malcolm> Building XEmacs in \"f:\\xemacs\\xemacs-21.4-release\\nt\".
Malcolm> Using compiler \"cl -nologo -W3 -O2 -G5 -ML\".
Malcolm> Installing XEmacs in \"c:\\Program
Files\\XEmacs\\XEmacs-21.4.8\".
Malcolm> Package path is \"~\\.xemacs;;c:\\Program
Files\\XEmacs\\site-packages;c:\\Program Files\\XEmacs\\xemacs-packages\".
Malcolm> Compiling in support for Microsoft Windows native GUI.
Malcolm> Compiling in support for XPM images.
Malcolm> Compiling in support for GIF images.
Malcolm> Compiling in support for PNG images.
Malcolm> Compiling in support for TIFF images.
Malcolm> Compiling in support for JPEG images.
Malcolm> Compiling in support for X-Face message headers.
Malcolm> Compiling in support for toolbars.
Malcolm> Compiling in support for dialogs.
Malcolm> Compiling in support for widgets.
Malcolm> Compiling in support for native sounds.
Malcolm> Compiling in fast dired implementation.
Malcolm> Using minimal tagbits.
Malcolm> Using indexed lrecord implementation.
Malcolm> Using portable dumper.
Malcolm> Load-Path Lisp Shadows:
Malcolm> ----------------------
Malcolm> nil
Malcolm> Installed XEmacs Packages:
Malcolm> -------------------------
Malcolm> ((zenirc:version 1.13 :type regular)
Malcolm> (xslt-process :version 1.09 :type regular)
Malcolm> (xslide :version 1.01 :type regular)
Malcolm> (xemacs-devel :version 1.46 :type single-file)
Malcolm> (xemacs-base :version 1.65 :type regular)
Malcolm> (w3 :version 1.25 :type regular)
Malcolm> (vm :version 7.07 :type regular)
Malcolm> (viper :version 1.34 :type regular)
Malcolm> (view-process :version 1.11 :type regular)
Malcolm> (vhdl :version 1.15 :type regular)
Malcolm> (vc-cc :version 1.21 :type regular)
Malcolm> (vc :version 1.33 :type regular)
Malcolm> (tramp :version 1.05 :type regular)
Malcolm> (tpu :version 1.12 :type regular)
Malcolm> (tooltalk :version 1.13 :type regular)
Malcolm> (tm :version 1.34 :type regular)
Malcolm> (time :version 1.11 :type regular)
Malcolm> (textools :version 1.12 :type regular)
Malcolm> (text-modes :version 1.48 :type single-file)
Malcolm> (texinfo :version 1.2 :type regular)
Malcolm> (supercite :version 1.19 :type regular)
Malcolm> (strokes :version 1.08 :type regular)
Malcolm> (speedbar :version 1.23 :type regular)
Malcolm> (sounds-wav :version 1.1 :type regular)
Malcolm> (sounds-au :version 1.1 :type regular)
Malcolm> (slider :version 1.13 :type regular)
Malcolm> (sieve :version 1.07 :type regular)
Malcolm> (sh-script :version 1.15 :type regular)
Malcolm> (sgml :version 1.08 :type regular)
Malcolm> (semantic :version 1.12 :type regular)
Malcolm> (scheme :version 1.11 :type regular)
Malcolm> (rmail :version 1.13 :type regular)
Malcolm> (reftex :version 1.25 :type regular)
Malcolm> (psgml :version 1.28 :type regular)
Malcolm> (ps-print :version 1.04 :type regular)
Malcolm> (prog-modes
Malcolm> :version
Malcolm> 1
Malcolm> .59
Malcolm> :type
Malcolm> single-file)
Malcolm> (pcomplete :version 1.01 :type regular)
Malcolm> (pcl-cvs :version 1.63 :type regular)
Malcolm> (pc :version 1.25 :type single-file)
Malcolm> (os-utils :version 1.28 :type single-file)
Malcolm> (net-utils :version 1.27 :type single-file)
Malcolm> (mmm-mode :version 1.0 :type regular)
Malcolm> (misc-games :version 1.15 :type single-file)
Malcolm> (mine :version 1.14 :type regular)
Malcolm> (mh-e :version 1.14 :type regular)
Malcolm> (mew :version 1.17 :type regular)
Malcolm> (mailcrypt :version 2.11 :type regular)
Malcolm> (mail-lib :version 1.46 :type regular)
Malcolm> (liece :version 1.06 :type regular)
Malcolm> (jde :version 1.35 :type regular)
Malcolm> (ispell :version 1.24 :type regular)
Malcolm> (ilisp :version 1.27 :type regular)
Malcolm> (igrep :version 1.08 :type regular)
Malcolm> (idlwave :version 1.25 :type regular)
Malcolm> (ibuffer :version 1.07 :type regular)
Malcolm> (hm--html-menus :version 1.18 :type regular)
Malcolm> (haskell-mode :version 1.03 :type regular)
Malcolm> (gnus :version 1.62 :type regular)
Malcolm> (gnats :version 1.15 :type regular)
Malcolm> (games :version 1.13 :type regular)
Malcolm> (fsf-compat :version 1.11 :type single-file)
Malcolm> (frame-icon :version 1.09 :type regular)
Malcolm> (forms :version 1.14 :type regular)
Malcolm> (footnote :version 1.15 :type regular)
Malcolm> (eudc :version 1.36 :type regular)
Malcolm> (eterm :version 1.13 :type regular)
Malcolm> (ess :version 1.02 :type regular)
Malcolm> (eshell :version 1.03 :type regular)
Malcolm> (emerge :version 1.09 :type regular)
Malcolm> (elib :version 1.1 :type single-file)
Malcolm> (eieio :version 1.02 :type regular)
Malcolm> (efs :version 1.29 :type regular)
Malcolm> (edt :version 1.12 :type regular)
Malcolm> (edit-utils :version 1.89 :type single-file)
Malcolm> (ediff :version 1.41 :type regular)
Malcolm> (edebug :version 1.14 :type regular)
Malcolm> (dired :version 1.12 :type regular)
Malcolm> (dictionary :version 1.11 :type regular)
Malcolm> (debug :version 1.15 :type regular)
Malcolm> (crisp :version 1.12 :type regular)
Malcolm> (cookie :version 1.14 :type regular)
Malcolm> (clearcase :version 1.04 :type regular)
Malcolm> (cc-mode :version 1.28 :type regular)
Malcolm> (calendar :version 1.18 :type regular)
Malcolm> (calc :version 1.23 :type regular)
Malcolm> (c-support :version 1.16 :type single-file)
Malcolm> (build :version 1.05 :type regular)
Malcolm> (bbdb :version 1.21 :type regular)
Malcolm> (auctex :version 1.32 :type regular)
Malcolm> (apel :version 1.23 :type regular)
Malcolm> (ada :version 1.1 :type regular)
Malcolm> (Sun :version 1.13 :type regular))
Malcolm> Features:
Malcolm> --------
Malcolm> (mail-abbrevs xemacsbug shadow dabbrev view-less view cperl-mode
Malcolm> hyper-apropos debug efs-cu lazy-lock p4 env vc ring vc-hooks iswitchb
Malcolm> hideif package-get package-admin config paren blink-paren smtpmail
Malcolm> time-stamp sendmail rfc822 advice advice-preload edmacro hideshow
Malcolm> cc-mode cc-align cc-cmds cc-engine cc-styles cc-langs cc-vars wid-edit
Malcolm> cc-menus imenu cc-defs func-menu font-lock info cus-face filladapt
Malcolm> zenirc-autoloads xslt-process-autoloads xslide-autoloads
Malcolm> xemacs-devel-autoloads xemacs-base-autoloads w3-autoloads vm-autoloads
Malcolm> viper-autoloads view-process-autoloads vhdl-autoloads vc-cc-autoloads
Malcolm> vc-autoloads tramp-autoloads tpu-autoloads tooltalk-autoloads
Malcolm> tm-autoloads time-autoloads textools-autoloads text-modes-autoloads
Malcolm> texinfo-autoloads supercite-autoloads strokes-autoloads
Malcolm> speedbar-autoloads sounds-wav-autoloads sounds-au-autoloads
Malcolm> slider-autoloads sieve-autoloads sh-script-autoloads sgml-autoloads
Malcolm> semantic-autoloads scheme-autoloads rmail-autoloads reftex-autoloads
Malcolm> psgml-autoloads ps-print-autoloads prog-modes-autoloads
Malcolm> pcomplete-autoloads pcl-cvs-autoloads pc-autoloads os-utils-autoloads
Malcolm> net-utils-autoloads mmm-mode-autoloads misc-games-autoloads
Malcolm> mine-autoloads mh-e-autoloads mew-autoloads mailcrypt-autoloads
Malcolm> mail-lib-autoloads liece-autoloads jde-autoloads ispell-autoloads
Malcolm> ilisp-autoloads igrep-autoloads idlwave-autoloads ibuffer-autoloads
Malcolm> hm--html-menus-autoloads haskell-mode-autoloads gnus-autoloads
Malcolm> gnats-autoloads games-autoloads fsf-compat-autoloads
Malcolm> frame-icon-autoloads forms-autoloads footnote-autoloads eudc-autoloads
Malcolm> eterm-autoloads ess-autoloads eshell-autoloads emerge-autoloads
Malcolm> elib-autoloads eieio-autoloads efs-autoloads edt-autoloads
Malcolm> edit-utils-autoloads ediff-autoloads edebug-autoloads dired-autoloads
Malcolm> dictionary-autoloads debug-autoloads crisp-autoloads cookie-autoloads
Malcolm> clearcase-autoloads cc-mode-autoloads calendar-autoloads
Malcolm> calc-autoloads c-support-autoloads build-autoloads bbdb-autoloads
Malcolm> auctex-autoloads apel-autoloads ada-autoloads Sun-autoloads
Malcolm> lisp-autoloads loadhist auto-show fontl-hooks code-cmds gutter-items
Malcolm> menubar-items x-menubar dragdrop mode-motion mouse itimer auto-save
Malcolm> lisp-mode easymenu iso8859-1 page buff-menu lib-complete help-nomule
Malcolm> cus-file derived frame text-props obsolete cus-start custom widget
Malcolm> cl-extra mini-cl cl cl-19 packages backquote very-early-lisp
Malcolm> file-coding mswindows-scrollbars mswindows toolbar native-sound
Malcolm> scrollbar network-streams subprocesses menu-accelerator-support
Malcolm> menubar md5 xemacs gutter tiff png gif jpeg xface xpm xbm
Malcolm> lisp-float-type windows-nt dragdrop-api dialog devices window-system
Malcolm> base64)
Malcolm> Recent keystrokes:
Malcolm> -----------------
Malcolm> down down down down down down down down down down C-e
Malcolm> C-x C-e C-x C-s C-x C-f M-p M-p M-p M-p M-p RET C-h
Malcolm> a b u g RET down down down down down down down down
Malcolm> down down down down down down down down down down down
Malcolm> down down down down down down down down down down down
Malcolm> down down down down down down down down down down down
Malcolm> down down down down down down up up up up down RET
Malcolm> C-x 1 down down RET misc-user M-x r e p o r t - x e
Malcolm> TAB RET
Malcolm> Recent messages (most recent first):
Malcolm> -----------------------------------
Malcolm> Loading xemacsbug...done
Malcolm> Loading xemacsbug...
Malcolm> Scanning for "hard" Perl constructions... done
Malcolm> Scanning for "hard" Perl constructions...
Malcolm> Wrote c:\apps\XEmacs\xemacs-packages\lisp\prog-modes\p4-new.el
Malcolm> p4-detect-p4
Malcolm> Matches: (defun p4-detect-p4 ()
Malcolm> nil
Malcolm> Matches: (defun p4-detect-p4 ()
Malcolm> nil
Malcolm> "c:\\"
Malcolm> t
Malcolm> "c:\\"
Malcolm> "c:\\"
Malcolm> "c:\\"
Malcolm> nil
Malcolm> t
Malcolm> Wrong number of arguments: string=, 1
Malcolm> "c:\\"
Malcolm> Selecting menu item Text Comparison...done
--
Adrian Aichner
mailto:adrianï¼ xemacs.org
http://www.xemacs.org/