From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#20266: Emacs doesn't respond when editing the attached c header file. Date: 7 Apr 2015 15:16:16 -0000 Organization: muc.de e.V. Message-ID: <20150407151616.87042.qmail@mail.muc.de> References: <5A1E7FCD-088B-49D2-B16B-145A73C0E28E@icloud.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1428419846 23002 80.91.229.3 (7 Apr 2015 15:17:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Apr 2015 15:17:26 +0000 (UTC) To: ??? , 20266@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 07 17:17:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YfVFc-0007X2-IE for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Apr 2015 17:17:16 +0200 Original-Received: from localhost ([::1]:46368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfVFb-00011Q-9k for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Apr 2015 11:17:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfVFV-0000y8-Tj for bug-gnu-emacs@gnu.org; Tue, 07 Apr 2015 11:17:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfVFU-0002Ok-Mw for bug-gnu-emacs@gnu.org; Tue, 07 Apr 2015 11:17:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfVFO-0002Lw-LJ; Tue, 07 Apr 2015 11:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YfVFO-0004Sh-5d; Tue, 07 Apr 2015 11:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 07 Apr 2015 15:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20266 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 20266-submit@debbugs.gnu.org id=B20266.142841978717098 (code B ref 20266); Tue, 07 Apr 2015 15:17:02 +0000 Original-Received: (at 20266) by debbugs.gnu.org; 7 Apr 2015 15:16:27 +0000 Original-Received: from localhost ([127.0.0.1]:47936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YfVEl-0004Re-71 for submit@debbugs.gnu.org; Tue, 07 Apr 2015 11:16:27 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:39982 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YfVEf-0004RM-Dl for 20266@debbugs.gnu.org; Tue, 07 Apr 2015 11:16:21 -0400 Original-Received: (qmail 87043 invoked by uid 3782); 7 Apr 2015 15:16:16 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/10.1-RELEASE (amd64)) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101257 Archived-At: Hello, Netjune. In article 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 .../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).