GNU bug report logs -
#20266
Emacs doesn't respond when editing the attached c header file.
Previous Next
Reported by: 张海君 <netjune <at> icloud.com>
Date: Mon, 6 Apr 2015 10:11:02 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello, Netjune.
In article <mailman.71.1428315070.904.bug-gnu-emacs <at> gnu.org> you wrote:
> [-- text/plain, encoding 7bit, charset: us-ascii, 13 lines --]
> Emacs doesn't respond when editing the attached c header file.
> Emacs version: 24.4.
> ------------------------------------
> Run emacs with "emacs -Q test.h".
> M-x mark-whole-buffer
> M-x kill-ring-save
> M-x end-of-buffer
> M-x yank
> Then emacs doesn't respond for about 5 seconds.
> M-x scroll-down-command.
> Then emacs doesn't respond for about 5 seconds too.
Yes. This isn't good at all.
> M-x scroll-down-command.
> Then emacs doesn't respond for about 5 seconds too.
I can't actually reproduce this delay.
There is special handling on `yank' for some arcane mechanisms in Emacs,
and these simply waste time in CC Mode for no productive purpose. The
patch below should switch off this processing.
diff -r 5cc874770a5d cc-mode.el
--- a/cc-mode.el Tue Apr 07 10:25:37 2015 +0000
+++ b/cc-mode.el Tue Apr 07 14:58:37 2015 +0000
@@ -502,6 +502,7 @@
(make-local-variable 'adaptive-fill-mode)
(make-local-variable 'adaptive-fill-regexp)
(make-local-variable 'fill-paragraph-handle-comment)
+ (make-local-variable 'yank-handled-properties)
;; now set their values
(setq parse-sexp-ignore-comments t
@@ -511,6 +512,12 @@
comment-multi-line t
comment-line-break-function 'c-indent-new-comment-line)
+ ;; Prevent time-wasting activity on C-y.
+ (let ((yank-cat-handler (assq 'category yank-handled-properties)))
+ (when yank-cat-handler
+ (setq yank-handled-properties (remq yank-cat-handler
+ yank-handled-properties))))
+
;; For the benefit of adaptive file, which otherwise mis-fills.
(setq fill-paragraph-handle-comment nil)
Please try applying this patch to .../emacs/lisp/progmodes/cc-mode.el,
then recompiling that file with either:
(on the command line):
$ emacs -Q -batch -f batch-byte-compile .../path/to/cc-mode.el
, or (from within Emacs):
M-x byte-compile-file <CR> .../path/to/cc-mode.el.
Either load this file (with M-x load-file) or restart Emacs. Hopefully
the first problem (with M-x yank) will have gone away.
Could you please get back to me and confirm that the M-x yank delay has
gone, and let me know whether the delay on M-x scroll-down-command is
still a problem.
Thanks for taking the trouble to report this bug.
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 10 years and 85 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.