From: Alpha-Bugzilla <alp...@ic...> - 2002-05-31 05:48:30
|
[This e-mail has been automatically generated.] http://www.maths.mq.edu.au/~steffen/Alpha/bugzilla/show_bug.cgi?id=552 Summary: 'saveAs -f $f' still requires 'close [open ...]' in Product: Alpha Version: 8.0b1 Platform: All OS/Version: All Status: NEW Status Whiteboard: Keywords: mail-interface Resolution: Severity: normal Priority: P2 Component: Core AssignedTo: alp...@li... ReportedBy: cup...@pr... Alpha8 BRIEF DESCRIPTION 'saveAs -f $f' still requires 'close [open ...]' in Alpha8 DETAILS The core command 'saveAs' allows an optional 'force' argument to save the current window to a target file without bringing up the normal 'Save As...' dialog. In Alpha7, the core version throws an error if the target file doesn't already exist, so there's a fix in "coreFixes.tcl" that ensures that the file is created if necessary, using To replicate this, try these shell commands: <<Alpha 8.0b1>> set f [file join $HOME testSaveAs] cbu:Applications (Mac OS 9):Alpha:Alpha 8.0b1:testSaveAs <<Alpha 8.0b1>> file exists $f 0 <<Alpha 8.0b1>> saveAs -f $f Can't locate 'cbu:Applications (Mac OS 9):Alpha:Alpha 8.0b1:testSaveAs' Now do this, and it works: <<Alpha 8.0b1>> close [open $f w] <<Alpha 8.0b1>> saveAs -f $f POSSIBLE SOLUTION This probably should be addressed in the Alpha8 core, but in the meantime applying the same core fix that is used for Alpha7 takes care of this. Remove the 'testSaveAs' file, evaluate the following, and the above test now works. rename saveAs __saveAs ;proc saveAs {args} { if {([llength $args] == 2) && ([lindex $args 0] == "-f")} { set fn [lindex $args 1] # Check name is legal. set tail [file tail $fn] if {[file::makeNameLegal $tail] != $tail} { return -code error "Illegal file name '$tail' to saveAs" } if {![file exists $fn]} { close [open $fn w] } uplevel 1 [list __saveAs] $args save } else { uplevel 1 [list __saveAs] $args savePostHook [win::Current] } } I have no idea if the 'savePostHook' is now called by Alpha8's core 'saveAs' command, so this possible solution might need some tweaking. VERSION INFO 8.0b1 on alpha (macintosh), with Tcl8.3.4 and AlphaTcl 7.6d2 GENERAL SYSTEM INFO mode Shel global features: tags tclAE openWindowsMenu AlphaTcl Alpha isoTime internationalMenus aeom backup emacs macros elecBindings elecExpansions elecCompletions autoContinueComment switchToMenu contextualMenu documentProjects fileUtils recentDirsMenu smartPaste specialCharacters searchPaths filesets filesetMenu ftpMenu alphaDeveloperMenu htmlUtilities addressBook electricReturn recentFilesMultiMenu newDocument notes manipCols wwwMenu mode features: alphaDeveloperMenu Tcl-version 8.3.4 system encoding macRoman AlphaTcl encoding macRoman Tclae loaded Tclx loaded This report was generated by the "Report A Bug" menu item. -- This e-mail has been sent to you by the Alpha-Bugzilla bugsystem (http://www.maths.mq.edu.au/~steffen/Alpha/bugzilla/) I am an automated system, please direct your replies or complaints to my maintainer <st...@ma...> |