Subject: bug#24197: Removing lisp/play from standard Emacs package

From: Ivan Shmakov <[email-masked]>
Date: Wed, 10 Aug 2016 20:30:53 +0000

>>>>> Otso Rajala <[email-masked]> writes:

 > Emacs is primarily used as a text editor.  Toys shipped in lisp/play
 > directory are fun, no question about that.  Do they belong into core
 > disribution of Emacs is another question.

 > Problems: 1) They increase package size.

	For less than 1 MiB (uncompressed.)  Compare to, say, lisp/org
	and lisp/cedet (which together take about 10% of lisp/) – and
	those aren’t used by every Emacs user out there, either.

 > 2) Their existence clutters M-x <tab> autocomplete lists: example M-x
 > bu <tab> has all things buffer, but also shows bubbles and butterfly,
 > hardly useful during editing process.

	Indeed.  But there’s a simple workaround:

(fset 'butterfly nil)
(fset 'bubbles   nil)

	It’s also possible to exclude unwanted lisp/ subdirectories from
	load-path; for example:

(require 'cl)                   ; Emacs 24.5
(setq load-path
      (apply 'list
             "~/elisp" "~/elisp/hacks"
             ;; Exclude directories holding unwanted packages:
             (let ((blacklist "/\\(calc\\|cedet\\|erc\\|mh-e\\|org\\)$"))
               (remove-if (lambda (dir) (string-match-p blacklist dir))
                          load-path))))

	However, while this prevents accidental (auto)loading of the
	packages of no interest to the specific user, this does /not/ by
	itself remove the respective autoloads themselves.  The latter
	could be accomplished with the following (though this seems a
	tad expensive):

(mapatoms
 (lambda (sym)
   (let* ((fn   (symbol-function sym))
          (lib  (and (autoloadp fn) (cadr fn))))
     (when lib
       (condition-case v
           (find-library-name lib)
         (error
          (fset sym nil)))))))

[…]

 > Advantage of solution: 1) All problems go away

	Old ones go.  New ones come.

[…]

-- 
FSF associate member #7257  np. Across the Stars — Pražský Filmový Orchestr