// You need to make changes to the following functions in these // two files to enable the alias expansions. // I modify the Slick macro files in place, but you can also // copy them to your configuration directory and change them there as well. // In program files/Slickedit/macros/tbfind.e // This enables alias expansion in FileTypes and Exclude // _get_files_list // In program files/Slickedit/macros/diff.e // This enabled alias expansion in "Exclude filespecs" in the DiffZilla dialog // MFDiff2 // MFDiff // In program files/Slickedit/macros/tbfind.e #define JPORKKA static int _get_files_list(_str &files, _str &wildcards, _str &exclude) { _str tree_option = _isUnix()?'':def_find_file_attr_options; _str result = ''; result = _unix_expansion(_findfiles.p_text); #if defined(JPORKKA) call_list('_jalias_expansion', result); #endif if (result != '') { if ((_findinzipfiles.p_value && _findinzipfiles.p_visible && _findinzipfiles.p_enabled) || (_findsubfolder.p_value && _findsubfolder.p_enabled)) { tree_option = '+t ' :+ tree_option; } } result = translate(result, FILESEP, FILESEP2); wildcards = getFindFileTypes(); #if defined(JPORKKA) call_list('_jalias_expansion', wildcards); #endif if (wildcards == '') wildcards = ALLFILES_RE; files = tree_option:+result; result = _unix_expansion(_findexclude.p_text); #if defined(JPORKKA) call_list('_jalias_expansion', result); #endif exclude = translate(result, FILESEP, FILESEP2); return(0); } // In program files/Slickedit/macros/diff.e #define JPORKKA static int MFDiff2(DIFF_SETUP_DATA &DiffSetupData,bool showNoEditorOptions,bool restorefromini) { if ( !_haveProDiff() ) { popup_nls_message(VSRC_FEATURE_REQUIRES_PRO_EDITION_1ARG, "Multi-file Diff"); return VSRC_FEATURE_REQUIRES_PRO_EDITION; } DIFF_SETUP_INFO MFDiffSetup; InitDiffSetupStruct(&MFDiffSetup); MFDiffSetup.path1=DiffSetupData.file1.fileName; MFDiffSetup.path2=DiffSetupData.file2.fileName; MFDiffSetup.filespec=DiffSetupData.FileSpec; MFDiffSetup.excludeFilespec=DiffSetupData.ExcludeFileSpec; #if defined(JPORKKA) call_list('_jalias_expansion', MFDiffSetup.excludeFilespec); //say("xExpand '"DiffSetupData.ExcludeFileSpec"' --> '"MFDiffSetup.excludeFilespec"'"); #endif MFDiffSetup.recursive=DiffSetupData.Recursive; MFDiffSetup.compareAllSymbols=DiffSetupData.DiffTags; MFDiffSetup.fileListInfo=DiffSetupData.FileListInfo; MFDiffSetup.compareAllSymbols=DiffSetupData.DiffTags; MFDiffSetup.compareOnly=DiffSetupData.CompareOnly; MFDiffSetup.restoreFromINI=restorefromini; MFDiffSetup.fileListFilename = DiffSetupData.fileListFile; MFDiffSetup.compareFilenamesOnly = DiffSetupData.compareFilenamesOnly; status := MFDiff(&MFDiffSetup,showNoEditorOptions); return(status); } static int MFDiff(DIFF_SETUP_INFO *pSetupInfo,bool showNoEditorOptions) { int mfdiff_callback_index=find_index("_diff_mf_callback1",PROC_TYPE); if (pSetupInfo->compareOnly && !mfdiff_callback_index) { // If we are doing a compare only, but no callback was specified, there is // nothing to do if (pSetupInfo->compareAllSymbols) { int diff_tags_index=find_index("_diff_tags_callback1",PROC_TYPE); if (diff_tags_index && index_callable(diff_tags_index)) { return(_DiffExpandTags2(pSetupInfo->path1,pSetupInfo->path2,-1,-1)); } } return(1); } if (! (GMFDiffViewOptions&(DIFF_VIEW_DIFFERENT_SYMBOLS|DIFF_VIEW_MISSING_SYMBOLS1|DIFF_VIEW_MISSING_SYMBOLS2) ) ) { GMFDiffViewOptions|=DIFF_VIEW_DIFFERENT_SYMBOLS|DIFF_VIEW_MISSING_SYMBOLS1|DIFF_VIEW_MISSING_SYMBOLS2; } _str path1=_diff_absolute(pSetupInfo->path1),path2=_diff_absolute(pSetupInfo->path2); _str Filespecs=pSetupInfo->filespec,ExcludeFilespecs=pSetupInfo->excludeFilespec; #if defined(JPORKKA) call_list('_jalias_expansion', Filespecs); #endif recursive := pSetupInfo->recursive; _str recursiveOptionString=''; _str cmdline=''; typeless status=0; _str tempname=''; if ((def_diff_edit_flags&DIFFEDIT_SPAWN_MFDIFF) && (_default_option(VSOPTION_MDI_SHOW_WINDOW_FLAGS)!=SW_HIDE) && _win32s()!=1/*just in case*/) { recursiveOptionString=(recursive?'-recursive':''); cmdline=_maybe_quote_filename(editor_name('P'):+'vs');//editor name status=MakeOptionsFile(tempname,Filespecs,ExcludeFilespecs,def_diff_flags,recursive,path1,path2,showNoEditorOptions); cmdline=cmdline' +new -q -st 0 -mdihide -p diff -optionsfile 'tempname; status=list_modified('',true); if (status==COMMAND_CANCELLED_RC) { return(COMMAND_CANCELLED_RC); } status=shell(cmdline,'QA'); return(0); } _str FileTable1:[],FileTable2:[]; int ProgressFormWID=0; if (!pSetupInfo->compareAllSymbols) { ProgressFormWID=show('-desktop -hidden _difftree_progress_form'); } _str disabled_wid_list=''; if (ProgressFormWID) { ProgressFormWID._DiffHideProgressGauge(); ProgressFormWID.p_visible=true; disabled_wid_list=_enable_non_modal_forms(false,ProgressFormWID); if (_default_option(VSOPTION_MDI_SHOW_WINDOW_FLAGS)==SW_HIDE) { ProgressFormWID._ShowWindow(SW_SHOWNOACTIVATE); } ProgressFormWID._set_foreground_window(); } int NumFilesInPath1=0; int NumFilesInPath2=0; if (PathIsDiffFileList(path1)) { GetFileTablesFromList(path1,path2,FileTable1,FileTable2); path1=_strip_filename(path1,'N'); pSetupInfo->path1=path1; }else if (pSetupInfo->compareAllSymbols){ NumFilesInPath1=NumFilesInPath2=1; pSetupInfo->path1=strip(pSetupInfo->path1,'B','"'); pSetupInfo->path2=strip(pSetupInfo->path2,'B','"'); justPath1 := _file_path(path1); justPath2 := _file_path(path2); justName1 := _strip_filename(pSetupInfo->path1,'P'); justName2 := _strip_filename(pSetupInfo->path2,'P'); NumFilesInPath1=_GetFileTable(FileTable1,justPath1,justName1,"",false,0); NumFilesInPath1=_GetFileTable(FileTable2,justPath2,justName2,"",false,0); }else if (pSetupInfo->fileListFilename!="") { status = GetTableFromList(FileTable1,path1,pSetupInfo->fileListFilename); if ( status ) { _message_box(nls("'%s' is not a valid list file",pSetupInfo->fileListFilename)); _enable_non_modal_forms(true,0,disabled_wid_list); if (ProgressFormWID) ProgressFormWID._delete_window(); return 1; } status = GetTableFromList(FileTable2,path2,pSetupInfo->fileListFilename); if ( status ) { _message_box(nls("'%s' is not a valid list file",pSetupInfo->fileListFilename)); _enable_non_modal_forms(true,0,disabled_wid_list); if (ProgressFormWID) ProgressFormWID._delete_window(); return 1; } }else{ NumFilesInPath1=_GetFileTable(FileTable1,path1,Filespecs,ExcludeFilespecs,recursive,ProgressFormWID); if (NumFilesInPath1<0) { _enable_non_modal_forms(true,0,disabled_wid_list); if (ProgressFormWID) { ProgressFormWID._delete_window(); } return(1); } NumFilesInPath2=_GetFileTable(FileTable2,path2,Filespecs,ExcludeFilespecs,recursive,ProgressFormWID); if (NumFilesInPath2<0) { _enable_non_modal_forms(true,0,disabled_wid_list); if (ProgressFormWID) { ProgressFormWID._delete_window(); } return(1); } } clear_message(); if (!NumFilesInPath1 && !NumFilesInPath2 && pSetupInfo->fileListFilename=="" ) { _message_box("No Files match these parameters"); _enable_non_modal_forms(true,0,disabled_wid_list); if (ProgressFormWID) { ProgressFormWID._delete_window(); } return(1); } _str OutputTable[]; status=DiffFileTables(FileTable1,path1,FileTable2,path2,OutputTable,ProgressFormWID,pSetupInfo->compareAllSymbols,pSetupInfo->compareFilenamesOnly); if (status) { _enable_non_modal_forms(true,0,disabled_wid_list); if (ProgressFormWID) { ProgressFormWID._delete_window(); } return(status); } _str parent_option='-desktop'; typeless modaloption=''; if (_default_option(VSOPTION_MDI_SHOW_WINDOW_FLAGS)==SW_HIDE || showNoEditorOptions) { modaloption=' -modal '; } if (ProgressFormWID) { _enable_non_modal_forms(true,0,disabled_wid_list); } if (ProgressFormWID) { ProgressFormWID._delete_window(); } if (pSetupInfo->compareAllSymbols) { path1=_strip_filename(path1,'N'); path2=_strip_filename(path2,'N'); } MFDIFF_SETUP_INFO SetupInfo; SetupInfo.FileTable1=FileTable1; SetupInfo.Path1=path1; SetupInfo.FileTable2=FileTable2; SetupInfo.Path2=path2; SetupInfo.OutputTable=OutputTable; SetupInfo.BasePath1=path1; SetupInfo.BasePath2=path2; SetupInfo.Filespecs=Filespecs; SetupInfo.ExcludeFilespecs=ExcludeFilespecs; SetupInfo.modalOption=modaloption; SetupInfo.recursive=recursive; SetupInfo.fileListInfo=pSetupInfo->fileListInfo; SetupInfo.ExpandFirst=pSetupInfo->compareAllSymbols; SetupInfo.ShowNoEditorOptions=showNoEditorOptions; SetupInfo.RestoreFromINI=pSetupInfo->restoreFromINI; if (pSetupInfo->compareOnly) { // Run the diff operation and call all of the callbacks, but do not bring // up the dialog return(MFDiffNoDialog(&SetupInfo,mfdiff_callback_index)); } // For better multi-monitor support, typeless formwid=show('-new -xy 'parent_option' _difftree_output_form', &SetupInfo ); if ( formwid>=0 ) { if ( modaloption!='' ) { if ( pSetupInfo->restoreFromINI ) { int DialogX,DialogY,DialogWidth,DialogHeight; status=_DiffGetConfigInfoFromIniFile("MFDiffGeometry",DialogX,DialogY,DialogWidth,DialogHeight); if (!status) { formwid.p_x=DialogX; formwid.p_y=DialogY; formwid.p_width=DialogWidth; formwid.p_height=DialogHeight; } } _modal_wait(formwid); } if ( modaloption=='' ) { _nocheck _control tree1; _nocheck _control tree2; int s1=formwid.tree1._TreeScroll(); int s2=formwid.tree2._TreeScroll(); formwid.tree2._TreeScroll(s1); } } return(0); }