all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stephen Berman <Stephen.Berman@gmx.net>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: 22.1.50; insert-file-contents is slow under tramp
Date: Thu, 23 Aug 2007 16:25:32 +0200	[thread overview]
Message-ID: <46CD98DC.1050701@gmx.at> (raw)
In-Reply-To: <87veb6l9b0.fsf@escher.local.home>

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

> Using edebug I found the slowdown occurs when insert-file-contents is
> called in find-file-noselect-1.  I don't know how to debug it further.
> This slowdown did not exist in my previous Emacs build from 2007-06-30.

Stefan found a bug in my recent changes to `insert-file-contents'.
I can't tell whether it's related to your problem but could you try
with the attached patch?

[-- Attachment #2: fileio.patch --]
[-- Type: text/plain, Size: 2673 bytes --]

*** fileio.c	Sat Aug 18 09:50:08 2007
--- fileio.c	Thu Aug 23 11:04:32 2007
***************
*** 4733,4746 ****
  	  int opoint = PT;
  	  int opoint_byte = PT_BYTE;
  	  int oinserted = ZV - BEGV;
  	  
  	  TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); 
  	  insval = call3 (Qformat_decode,
  			  Qnil, make_number (oinserted), visit);
  	  CHECK_NUMBER (insval);
! 	  if (XINT (insval) == oinserted)
  	    SET_PT_BOTH (opoint, opoint_byte);
! 	  inserted = XFASTINT (insval);
  	}
  
        /* For consistency with format-decode call these now iff inserted > 0
--- 4733,4753 ----
  	  int opoint = PT;
  	  int opoint_byte = PT_BYTE;
  	  int oinserted = ZV - BEGV;
+ 	  int ochars_modiff = CHARS_MODIFF;
  	  
  	  TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); 
  	  insval = call3 (Qformat_decode,
  			  Qnil, make_number (oinserted), visit);
  	  CHECK_NUMBER (insval);
! 	  if (ochars_modiff == CHARS_MODIFF)
! 	    /* format_decode didn't modify buffer's characters => move
! 	       point back to position before inserted text and leave
! 	       value of inserted alone. */
  	    SET_PT_BOTH (opoint, opoint_byte);
! 	  else
! 	    /* format_decode modified buffer's characters => consider
! 	       entire buffer changed and leave point at point-min. */
! 	    inserted = XFASTINT (insval);
  	}
  
        /* For consistency with format-decode call these now iff inserted > 0
***************
*** 4763,4777 ****
  	      int opoint = PT;
  	      int opoint_byte = PT_BYTE;
  	      int oinserted = ZV - BEGV;
! 
  	      TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
  	      insval = call1 (XCAR (p), make_number (oinserted));
  	      if (!NILP (insval))
  		{
  		  CHECK_NUMBER (insval);
! 		  if (XINT (insval) == oinserted)
  		    SET_PT_BOTH (opoint, opoint_byte);
! 		  inserted = XFASTINT (insval);
  		}
  	    }
  
--- 4770,4793 ----
  	      int opoint = PT;
  	      int opoint_byte = PT_BYTE;
  	      int oinserted = ZV - BEGV;
! 	      int ochars_modiff = CHARS_MODIFF;
! 	      
  	      TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
  	      insval = call1 (XCAR (p), make_number (oinserted));
  	      if (!NILP (insval))
  		{
  		  CHECK_NUMBER (insval);
! 		  if (ochars_modiff == CHARS_MODIFF)
! 		    /* after_insert_file_functions didn't modify
! 		       buffer's characters => move point back to
! 		       position before inserted text and leave value of
! 		       inserted alone. */
  		    SET_PT_BOTH (opoint, opoint_byte);
! 		  else
! 		    /* after_insert_file_functions did modify buffer's
! 	               characters => consider entire buffer changed and
! 	               leave point at point-min. */
! 		    inserted = XFASTINT (insval);
  		}
  	    }
  

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2007-08-23 14:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-23 12:33 22.1.50; insert-file-contents is slow under tramp Stephen Berman
2007-08-23 14:25 ` martin rudalics [this message]
2007-08-23 15:02   ` Stephen Berman
2007-08-23 17:49     ` martin rudalics
2007-08-23 18:59       ` Stefan Monnier
2007-08-23 20:25         ` martin rudalics
2007-08-23 20:39           ` Stephen Berman
2007-08-23 21:01             ` martin rudalics
     [not found]             ` <46CDF5B7.2030201@g\x04mx.at>
2007-08-23 21:40               ` Stephen Berman
2007-08-24  5:34                 ` Michael Albinus
2007-08-24  7:18                   ` Stephen Berman
2007-08-24 14:32                   ` Stefan Monnier
2007-08-26 10:36                     ` Michael Albinus
2007-08-26 19:01                       ` David Kastrup
2007-08-26 19:24                         ` Michael Albinus
2007-08-27  4:16                       ` Stefan Monnier
2007-08-27 11:41                         ` Michael Albinus
2007-08-27 13:58                           ` Stefan Monnier
2007-08-27 14:09                             ` Thien-Thi Nguyen
2007-08-27 14:14                             ` David Kastrup
2007-08-27 14:53                             ` Michael Albinus
2007-08-27 20:11                               ` Stefan Monnier
2007-08-27 20:37                                 ` Michael Albinus
2007-08-27 10:52                     ` Michael Albinus
2007-08-27 11:33                       ` David Kastrup
2007-08-27 18:18                         ` Richard Stallman
2007-08-27 18:51                           ` David Kastrup
2007-08-24  9:28                 ` Eli Zaretskii
2007-08-24  9:35                   ` Stephen Berman
2007-08-24 16:10                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46CD98DC.1050701@gmx.at \
    --to=rudalics@gmx.at \
    --cc=Stephen.Berman@gmx.net \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.