diff --git a/pkgs/emacs/data/package.nix b/pkgs/emacs/data/package.nix index d232352..5ea3859 100644 --- a/pkgs/emacs/data/package.nix +++ b/pkgs/emacs/data/package.nix @@ -56,13 +56,19 @@ in # builtins.readFile fails when the source file contains control characters. # pydoc.el is an example. A workaround is to take only the first N bytes of - # the file using `head` command and read its output. + # the file using `head` command and read its output. This is IFD. headers = lib.parseElispHeaders - (lib.readFirstBytes - # magit.el has a relatively long header, so other libraries would be shorter. - 1500 - (self.src + "/${self.mainFile}")); + ( + # This adds support for an option isAsciiMainFile to remove IFD. + if self.isAsciiMainFile or false + then builtins.readFile (self.src + "/${self.mainFile}") + else + (lib.readFirstBytes + # magit.el has a relatively long header, so other libraries would be shorter. + 1500 + (self.src + "/${self.mainFile}")) + ); in lib.getAttrs (filter (name: hasAttr name attrs) [