From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3 Date: Sat, 28 Mar 2020 11:43:01 +0000 Message-ID: <20200328114301.GB7449@ACM> References: <86tv2h2vww.fsf@gmail.com> <20200322123818.GB32470@ACM> <87eetk5swm.fsf@gnu.org> <20200326193128.GC14092@ACM> <86d08y4zsx.fsf@gmail.com> <83wo768eq5.fsf@gnu.org> <838sjl7y60.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="88674"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: rrandresf@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 28 12:43:39 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jI9sJ-000MyE-Ma for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Mar 2020 12:43:39 +0100 Original-Received: from localhost ([::1]:52306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jI9sI-0000E7-Pe for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Mar 2020 07:43:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45440) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jI9rm-0008Fk-Mn for emacs-devel@gnu.org; Sat, 28 Mar 2020 07:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jI9rl-0007vI-FC for emacs-devel@gnu.org; Sat, 28 Mar 2020 07:43:06 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:29912 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1jI9rl-0007st-5W for emacs-devel@gnu.org; Sat, 28 Mar 2020 07:43:05 -0400 Original-Received: (qmail 61557 invoked by uid 3782); 28 Mar 2020 11:43:03 -0000 Original-Received: from acm.muc.de (p2E5D54D7.dip0.t-ipconnect.de [46.93.84.215]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 28 Mar 2020 12:43:01 +0100 Original-Received: (qmail 7464 invoked by uid 1000); 28 Mar 2020 11:43:01 -0000 Content-Disposition: inline In-Reply-To: <838sjl7y60.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245864 Archived-At: Hello, Eli. On Sat, Mar 28, 2020 at 10:09:59 +0300, Eli Zaretskii wrote: > > From: Richard Stallman > > Cc: rrandresf@gmail.com, acm@muc.de, emacs-devel@gnu.org > > Date: Fri, 27 Mar 2020 22:48:38 -0400 [ .... ] > I expect an average twofold slowdown due to bidirectional support. > The OP indicates less than that (comparing Emacs 23 with Emacs 26), so > it's reasonable, IMO, and probably means the CC Mode contribution is > relatively minor. > The tricky part is testing the bidirectional part and the CC Mode part > separately, by loading the old Emacs-23 CC Mode files into later > versions of Emacs. Maybe Alan could help by providing a Lisp file > which, when loaded, would load CC Mode from a given directory -- this > should be run before visiting any C/C++ file. Here you go: (defvar loaded-cc-version nil) (defun load-cc-version (dir) "Load the version of CC Mode contained in directory DIR." (interactive "D") (or (string-match "/$" dir) (setq dir (concat dir "/"))) (let (fname) ;; `c-fallback-style' gets stuff pushed onto it by loading cc-vars. So ;; clear it out first, after a quick and dirty sanity check. (if (file-exists-p (concat dir "cc-vars.elc")) (setq c-fallback-style nil)) (mapc (lambda (f) (condition-case err (load-file (setq fname (concat dir "cc-" f ".elc"))) (error (message "Couldn't load %s" fname)))) '("defs" "vars" "fix" "engine" "cmds" "menus" "align" "styles" "awk" "fonts" "mode" "subword" "bytecomp" "compat" "guess")) (setq loaded-cc-version dir))) You can actually run load-cc-version repeatedly within an Emacs session (I frequently do), together with M-x c-mode (etc.) on the pertinent buffers. Very occasionally, there're problems with defvars when their value have changed between versions, since they don't get reinitialised. -- Alan Mackenzie (Nuremberg, Germany).