[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs rendering comparisson between emacs23 and emacs26.3

From: Alan Mackenzie
Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Sat, 28 Mar 2020 11:43:01 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Eli.

On Sat, Mar 28, 2020 at 10:09:59 +0300, Eli Zaretskii wrote:
> > From: Richard Stallman <address@hidden>
> > Cc: address@hidden, address@hidden, address@hidden
> > 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).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]