Remove byte-compilation of Gnus format specs.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 10 Jun 2012 18:31:53 +0000 (20:31 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 10 Jun 2012 18:31:53 +0000 (20:31 +0200)
Benchmarking shows that this doesn't really speed things up (any
more?).

lisp/ChangeLog
lisp/gnus-spec.el
lisp/gnus-util.el
lisp/gnus-xmas.el
texi/ChangeLog
texi/gnus.texi

index 005fa64..a70794d 100644 (file)
@@ -1,5 +1,13 @@
 2012-06-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-spec.el: Remove all the byte-compilation stuff, since
+       benchmarking shows that it doesn't help when entering large summary
+       buffers.
+
+       * gnus-xmas.el (gnus-xmas-define): Remove.
+
+       * gnus-util.el (gnus-byte-code): Remove.
+
        * gnus-spec.el (gnus-update-format-specifications): Remove outdated
        grouplens stuff.
 
index 152b4cb..f40177d 100644 (file)
@@ -101,66 +101,13 @@ text properties. This is only needed on XEmacs, as Emacs does this anyway."
                            (propertize (string 8206) 'invisible t)
                          ""))
 
-(defun gnus-summary-line-format-spec ()
-  (insert gnus-tmp-unread gnus-tmp-replied
-         gnus-tmp-score-char gnus-tmp-indentation)
-  (gnus-put-text-property
-   (point)
-   (progn
-     (insert
-      (format "%c%4s: %-23s%c" gnus-tmp-opening-bracket gnus-tmp-lines
-             (let ((val
-                    (inline
-                      (gnus-summary-from-or-to-or-newsgroups
-                       gnus-tmp-header gnus-tmp-from))))
-               (if (> (length val) 23)
-                   (if (gnus-lrm-string-p val)
-                       (concat (substring val 0 23) gnus-lrm-string)
-                     (substring val 0 23))
-                 val))
-             gnus-tmp-closing-bracket))
-     (point))
-   gnus-mouse-face-prop gnus-mouse-face)
-  (insert " " gnus-tmp-subject-or-nil "\n"))
-
-(defvar gnus-summary-line-format-spec
-  (gnus-byte-code 'gnus-summary-line-format-spec))
-
-(defun gnus-summary-dummy-line-format-spec ()
-  (insert "*  ")
-  (gnus-put-text-property
-   (point)
-   (progn
-     (insert ":                                 :")
-     (point))
-   gnus-mouse-face-prop gnus-mouse-face)
-  (insert " " gnus-tmp-subject "\n"))
-
-(defvar gnus-summary-dummy-line-format-spec
-  (gnus-byte-code 'gnus-summary-dummy-line-format-spec))
-
-(defun gnus-group-line-format-spec ()
-  (insert gnus-tmp-marked-mark gnus-tmp-subscribed
-         gnus-tmp-process-marked
-         gnus-group-indentation
-         (format "%5s: " gnus-tmp-number-of-unread))
-  (gnus-put-text-property
-   (point)
-   (progn
-     (insert gnus-tmp-group "\n")
-     (1- (point)))
-   gnus-mouse-face-prop gnus-mouse-face))
-(defvar gnus-group-line-format-spec
-  (gnus-byte-code 'gnus-group-line-format-spec))
+(defvar gnus-summary-line-format-spec nil)
+(defvar gnus-summary-dummy-line-format-spec nil)
+(defvar gnus-group-line-format-spec nil)
 
 (defvar gnus-format-specs
   `((version . ,emacs-version)
-    (gnus-version . ,(gnus-continuum-version))
-    (group "%M\%S\%p\%P\%5y: %(%g%)\n" ,gnus-group-line-format-spec)
-    (summary-dummy "*  %(:                          :%) %S\n"
-                  ,gnus-summary-dummy-line-format-spec)
-    (summary "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n"
-            ,gnus-summary-line-format-spec))
+    (gnus-version . ,(gnus-continuum-version)))
   "Alist of format specs.")
 
 (defvar gnus-default-format-specs gnus-format-specs)
@@ -769,36 +716,6 @@ If PROPS, insert the result."
        (gnus-add-text-properties (point) (progn (eval form) (point)) props)
       (eval form))))
 
-(defun gnus-compile ()
-  "Byte-compile the user-defined format specs."
-  (interactive)
-  (require 'bytecomp)
-  (let ((entries gnus-format-specs)
-       (byte-compile-warnings '(unresolved callargs redefine))
-       entry gnus-tmp-func)
-    (save-excursion
-      (gnus-message 7 "Compiling format specs...")
-
-      (while entries
-       (setq entry (pop entries))
-       (if (memq (car entry) '(gnus-version version))
-           (setq gnus-format-specs (delq entry gnus-format-specs))
-         (let ((form (caddr entry)))
-           (when (and (listp form)
-                      ;; Under GNU Emacs, it's (byte-code ...)
-                      (not (eq 'byte-code (car form)))
-                      ;; Under XEmacs, it's (funcall #<compiled-function ...>)
-                      (not (and (eq 'funcall (car form))
-                                (byte-code-function-p (cadr form)))))
-             (defalias 'gnus-tmp-func `(lambda () ,form))
-             (byte-compile 'gnus-tmp-func)
-             (setcar (cddr entry) (gnus-byte-code 'gnus-tmp-func))))))
-
-      (push (cons 'version emacs-version) gnus-format-specs)
-      ;; Mark the .newsrc.eld file as "dirty".
-      (gnus-dribble-touch)
-      (gnus-message 7 "Compiling user specs...done"))))
-
 (defun gnus-set-format (type &optional insertable)
   (set (intern (format "gnus-%s-line-format-spec" type))
        (gnus-parse-format
index fef67cd..072e7b5 100644 (file)
@@ -169,15 +169,6 @@ This is a compatibility function for different Emacsen."
   `(delete-region (point-at-bol)
                  (progn (forward-line ,(or n 1)) (point))))
 
-(defun gnus-byte-code (func)
-  "Return a form that can be `eval'ed based on FUNC."
-  (let ((fval (indirect-function func)))
-    (if (byte-code-function-p fval)
-       (let ((flist (append fval nil)))
-         (setcar flist 'byte-code)
-         flist)
-      (cons 'progn (cddr fval)))))
-
 (defun gnus-extract-address-components (from)
   "Extract address components from a From header.
 Given an RFC-822 address FROM, extract full name and canonical address.
index 41108ab..32a1761 100644 (file)
@@ -440,13 +440,6 @@ FRONT-ADVANCE and REAR-ADVANCE are ignored."
 
   (defvar gnus-mouse-face-prop 'highlight)
 
-  (defun gnus-byte-code (func)
-    "Return a form that can be `eval'ed based on FUNC."
-    (let ((fval (indirect-function func)))
-      (if (compiled-function-p fval)
-         (list 'funcall fval)
-       (cons 'progn (cdr (cdr fval))))))
-
   (unless (fboundp 'match-string-no-properties)
     (defalias 'match-string-no-properties 'match-string))
 
index 52e11a5..f867031 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus.texi: Remove mention of compilation, as that's no longer
+       supported.
+
 2012-05-01  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * auth.texi (Help for users): Update for .gpg file being second.
index 6929d03..542456c 100644 (file)
@@ -815,7 +815,6 @@ Various
 * Formatting Variables::        You can specify what buffers should look like.
 * Window Layout::               Configuring the Gnus buffer windows.
 * Faces and Fonts::             How to change how faces look.
-* Compilation::                 How to speed Gnus up.
 * Mode Lines::                  Displaying information in the mode lines.
 * Highlighting and Menus::      Making buffers look all nice and cozy.
 * Daemons::                     Gnus can do things behind your back.
@@ -22079,7 +22078,6 @@ to you, using @kbd{G b u} and updating the group will usually fix this.
 * Formatting Variables::        You can specify what buffers should look like.
 * Window Layout::               Configuring the Gnus buffer windows.
 * Faces and Fonts::             How to change how faces look.
-* Compilation::                 How to speed Gnus up.
 * Mode Lines::                  Displaying information in the mode lines.
 * Highlighting and Menus::      Making buffers look all nice and cozy.
 * Daemons::                     Gnus can do things behind your back.
@@ -22376,11 +22374,6 @@ than 6 characters to make it look nice in columns.)
 Ignoring is done first; then cutting; then maxing; and then as the very
 last operation, padding.
 
-If you use lots of these advanced thingies, you'll find that Gnus gets
-quite slow.  This can be helped enormously by running @kbd{M-x
-gnus-compile} when you are satisfied with the look of your lines.
-@xref{Compilation}.
-
 
 @node User-Defined Specs
 @subsection User-Defined Specs
@@ -22889,30 +22882,6 @@ the face you want to alter, and alter it via the standard Customize
 interface.
 
 
-@node Compilation
-@section Compilation
-@cindex compilation
-@cindex byte-compilation
-
-@findex gnus-compile
-
-Remember all those line format specification variables?
-@code{gnus-summary-line-format}, @code{gnus-group-line-format}, and so
-on.  Now, Gnus will of course heed whatever these variables are, but,
-unfortunately, changing them will mean a quite significant slow-down.
-(The default values of these variables have byte-compiled functions
-associated with them, while the user-generated versions do not, of
-course.)
-
-To help with this, you can run @kbd{M-x gnus-compile} after you've
-fiddled around with the variables and feel that you're (kind of)
-satisfied.  This will result in the new specs being byte-compiled, and
-you'll get top speed again.  Gnus will save these compiled specs in the
-@file{.newsrc.eld} file.  (User-defined functions aren't compiled by
-this function, though---you should compile them yourself by sticking
-them into the @file{~/.gnus.el} file and byte-compiling that file.)
-
-
 @node Mode Lines
 @section Mode Lines
 @cindex mode lines