bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#57669: 29.0.50; C-n, C-p off under long lines


From: dick
Subject: bug#57669: 29.0.50; C-n, C-p off under long lines
Date: Fri, 09 Sep 2022 09:08:46 -0400
User-agent: Gnus/5.14 (Gnus v5.14) Commercial/29.0.50 (gnu/linux)

> because before the change Emacs couldn't cope with such files at all

Oh, I know what you're trying to do.  After all Commercial Emacs's
original attempt at "making the best of a bad situation" was the impetus
for your own poke at the pig.

When 29 goes mainstream, just be prepared to auto-reply "Does your file
have a long line?" when feckless users ask, "Why did C-n go to a weird
column?"

And to be clear, you're going from "ineffable" performance to just
"underwhelming."  As of cb036a7 you still need find-file-literally for
some semblance of respectability.

OUTPUT:

Under long-line-threshold=nil find-file 62s
Under long-line-threshold=10000 find-file 27s
Under long-line-threshold=nil find-file-literally 30s
Under long-line-threshold=10000 find-file-literally 4s

INPUT: C-n through file of alternating short and long lines.

src/emacs -Q -l cl-lib --eval "                                   \
(let ((long-line-threshold 10000)                                 \
      (file (make-temp-file \"baz\")))                            \
  (cl-assert (= 80 (window-width)) t)                             \
  (with-temp-file file                                            \
    (dotimes (i 100)                                              \
      (insert (make-string (if (zerop (% i 2))                    \
                               200                                \
                             (1+ long-line-threshold))            \
                 ?x) \"\n\")))                                    \
  (dolist (config (list (cons nil (function find-file))           \
                        (cons long-line-threshold (function find-file))         
\
                        (cons nil (function find-file-literally)) \
                        (cons long-line-threshold (function 
find-file-literally)))) \
    (let* ((long-line-threshold (car config))                     \
           (note (format \"long-line-threshold=%s %s\"            \
                         (car config) (cdr config)))              \
           (buffer (funcall (cdr config) file)))                  \
      (with-current-buffer buffer                                 \
        (show-paren-mode -1)                                      \
        (goto-char (point-min))                                   \
        (princ (format \"Under %s %ds\n\" note                    \
                  (fround (car (benchmark-run                     \
                       (while (condition-case nil                 \
                           (prog1 t (call-interactively           \
                             (function next-line))                \
                           (redisplay))                           \
                         (end-of-buffer)))))))                    \
          (function external-debugging-output)))                  \
      (kill-buffer buffer)))                                      \
   (kill-emacs))"





reply via email to

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