[CEDET-devel] Re: conditionally disabling semantic
Brought to you by:
zappo
From: <ry...@ds...> - 2003-02-24 18:06:26
|
Klaus, You are absolutely correct. After I sent out my email, I had a feeling that I should have done something more to figure this out on my own. This hook should definitely be added to the manual. Thanks. >>>>> "KB" == Klaus Berndl <kla...@sd...> writes: KB> KB> On Sun, 23 Feb 2003, ry...@ds... wrote: >> Hi all, >> >> I use pcl-cvs (aka pcvs in emacs 21) daily. I use the cvs-mode-idiff >> differencing command dozens if not hundreds of times each day. >> Hence the extra 3 or 4 second delay that semantic causes while it >> parses files cvs-mode-idiff loads for differencing purpose was too >> much for me especially since these files are used only for >> differencing and nothing else. >> >> So I wrote the code below to conditionally suppress semantic on >> temporary files. I tracked semantic-activate-mode-bindings down by >> starting with semantic-post-change-major-mode-function which was in >> find-file-hook list. >> >> What do you think? Is there a better way? Should something like this >> be a part of semantic? KB> KB> IMHO there is a better way, means an already builtin way ;-) KB> Take a look at `semantic-before-toplevel-bovination-hook'. KB> If i understand your problem and your solution right then the following should KB> be enough: KB> KB> ,---- KB> | (add-hook 'semantic-before-toplevel-bovination-hook KB> | (lambda () KB> | (not (string-match "\\.\\(HEAD$\\|BASE\\)$" (buffer-name))))) KB> `---- KB> KB> Any hook-function returning nil prevents semantic from parsing. KB> KB> At least this should do what your solution does... KB> KB> Thoughts? KB> KB> Klaus KB> >> >> >> (defadvice semantic-activate-mode-bindings >> (around suppress-tmp-files activate compile) >> "Don't setup semantic for tmp files such as files CVS loads for the >> purpose of differencing." >> (cond >> ;; Bypass files loaded by CVS for differencing. >> ;; This doesn't work on files retrieved with explicit version numbers. >> ((string-match "\\.\\(HEAD$\\|BASE\\)$" (buffer-name)) >> ;; Hmm. I thought the line below would not be needed at first, >> ;; because bypassing the body of semantic-activate-mode-bindings >> ;; would not setup semantic variables. But this advice does not >> ;; work without the line below. -ryk2/23/03. >> (setq semantic-toplevel-bovine-table nil)) >> (t ad-do-it))) >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. >> The most comprehensive and flexible code editor you can use. >> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. >> www.slickedit.com/sourceforge KB> KB> -- KB> Klaus Berndl mailto: kla...@sd... KB> sd&m AG http://www.sdm.de KB> software design & management KB> Thomas-Dehler-Str. 27, 81737 München, Germany KB> Tel +49 89 63812-392, Fax -220 KB> KB> KB> KB> ------------------------------------------------------- KB> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. KB> The most comprehensive and flexible code editor you can use. KB> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. KB> www.slickedit.com/sourceforge KB> _______________________________________________ KB> Cedet-devel mailing list KB> Ced...@li... KB> https://lists.sourceforge.net/lists/listinfo/cedet-devel KB> |