Re: query-replace-regexp slow for evaluated lisp expressions
Chris Moore wrote: I'm not confident about it. It seems to be working well for me still, but there's quite a lot of functionality available at the query-replace prompt which I neither understand nor use. All the replacement actions seem to work in my experience. The ones I tested were the ones in the help screen: Query replacing regexp foo with foo. Type Space or `y' to replace one match, Delete or `n' to skip to next, RET or `q' to exit, Period to replace one match and exit, Comma to replace but not move point immediately, C-r to enter recursive edit (C-M-c to get out again), C-w to delete match and recursive edit, C-l to clear the screen, redisplay, and offer same replacement again, ! to replace all remaining matches with no more questions, ^ to move point back to previous match, E to edit the replacement string End quote. This bug is really worth fixing. Otherwise, the lisp expression aspect of `query-replace-regexp' will behave /unnecessarily/ slow. Concerned, /a -- Computer Systems Specialist Leicester Central School Barstow Memorial School Rutland Northeast School District ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: query-replace-regexp slow for evaluated lisp expressions
Quoting Chris Moore [EMAIL PROTECTED]: Aaron S. Hawley [EMAIL PROTECTED] writes: Then, do the most basic of replacements that would never be done in practice, but shows how slow interactive regexp replacements can be: Or just replace it with \,\ for an even simpler test case. Damn right. Does this patch fix the bug? Yes, it does. I felt confident your patch would as soon as I looked at it. When reporting the bug I had narrowed the problem to that section of replace.el and to the `noedit' variable, but had no clue what the resolution of the bug was going to be take. Thanks for taking a look into this, Chris. /a --- old/replace.el 2007-01-07 01:40:26.0 +0100 +++ replace.el 2007-01-07 01:40:42.0 +0100 @@ -1518,8 +1518,7 @@ (set-match-data real-match-data) (setq next-replacement (funcall (car replacements) (cdr replacements) -replace-count) - noedit nil)) +replace-count))) (if (not query-flag) (let ((inhibit-read-only query-replace-skip-read-only)) ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
query-replace-regexp slow for evaluated lisp expressions
Search and evaluated replace expressions with `query-replace-regexp' are a bit slow and do not scale well to large files, even with the simplest of lisp expressions, in particular when using automatic replace of all matches by hitting !? For instance, create a buffer `foo' with 200 lines of foo: C-x b foo RET C-x ( foo RET C-x ) C-u 200 C-x e Then, do the most basic of replacements that would never be done in practice, but shows how slow interactive regexp replacements can be: Search for foo and just format the complete match as a string with a lisp expression, and type ! to do it to all of them: M- C-M-% foo RET \,(format %s \) RET ! Compare this with: M- C-M-% foo RET foo RET ! Much quicker. The former animates each replacement showing it being done, almost as if Emacs is hitting y interactively for me, rather than just zooming through them all, as the latter does. Thanks for Emacs. /a If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /Applications/Emacs/Emacs.app/Contents/Resources/etc/DEBUG for instructions. In GNU Emacs 23.0.0.1 (powerpc-apple-darwin8.8.0, *Step 9.0-rc1) of 2006-12-24 on yesod.local configured using `configure '--with-ns' '--without-x' '--prefix=/Users/arobert/src/EmacsApp/emacs/nextstep/build/Emacs.app/Contents/Resources' '--exec_prefix=/Users/arobert/src/EmacsApp/emacs/nextstep/build/Emacs.app/Contents/MacOS' '--libexecdir=/Users/arobert/src/EmacsApp/emacs/nextstep/build/Emacs.app/Contents/MacOS/libexec' '--with-pop' '--enable-font-backend' 'CC=gcc-4.0' 'CFLAGS=-g -O2 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: delete-selection-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-% f o o return ! M- M- C-M-s M-p return M-% M-p M-p C-k \ return ! M-tab C-x b * s c tab return C-n C-n C-n C-n C-k C-_ help-echo C-x b C-g C-g C-x b C-g C-g C-x C-b C-x o C-n C-n C-n C-p return help-echo M- C-v M- C-g C-g C-x o C-n C-k r e p o tab r tab return Recent messages: complete-tag: No tags table loaded; try M-x visit-tags-table Undo! Quit [4 times] Mark set [2 times] Quit [2 times] Mark set Making completion list... [2 times] Loading emacsbug... Loading regexp-opt...done Loading emacsbug...done ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
fill-paragraph differs with longlines-mode
A traditional fill-paragraph capability is not available in longlines-mode, counter to what is advertised. Try starting a new buffer (in fundamental-mode) by running `C-x b foo RET', and then inserting the following indented line: * Occasionally, some bullet items are so long they wrap on to the next line. Try filling it with `M-q'. You should get: * Occasionally, some bullet items are so long they wrap on to the next line. Nice. Restore the sample text by undoing the filling with `C-x u'. Run `M-x longlines-mode RET'. You will be shown: * Occasionally, some bullet items are so long they wrap on to the next line. Filling with `M-q' does nothing to change this. /a In GNU Emacs 22.0.50.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2005-12-07 on pacem, modified by Debian X server distributor `The X.Org Foundation', version 11.0.60802000 configured using `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/22.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.0.50/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.0.50/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'CFLAGS=-DDEBIAN -g -Wno-pointer-sign -O2' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: tooltip-mode: t auto-compression-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t line-number-mode: t ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug