2

I just noticed that Emacs will trim a very big file before saving it. I opened a 4.6 GB file (not the best thing to do, but anyway) and after saving, the file was trimmed to around 375 MB. It didn't warn me about the file size, trimming or anything. I'm using Emacs 22.1.1 for Mac.

Is this default behavior (I definitely hope not) or a bug?

  • 4
    I'd imagine that this is a bug, but your Emacs version is really old, so, it could've been fixed since then (Emacs 25 was released not so long ago). I'm not sure what the equivalent of dmesg would be on Mac, but I'd try to look into system logs to see if there weren't any kernel-level I/O errors. Or, maybe, Emacs silently crashed during the operation... – wvxvw Nov 3 '16 at 17:37
  • Looks like a bug. 4.6*1000*1000*1000-2**32 is 305,032,704. So depending on exactly how big the 4.6GB was and how big the 375MB is, I would hesitate a guess that they differ by 2**32. Is this a 32bit system? Is this a 32bit emacs? – icarus Nov 4 '16 at 3:22
  • @wvxvw Where can I find emacs logs? – erickrf Nov 4 '16 at 10:39
  • @icarus yes, the system is 64 (it is a 2016 Macbook, I just realized how old the default Emacs is). I don't know how to check whether Emacs itself is 32 or 64 – erickrf Nov 4 '16 at 10:40
  • I don't know, my best guess is looking at the output of file $(type -p emacs) and hoping it says something useful. However there is not much point in spending time on this, as once we know the answer it doesn't help us decide the next step. – icarus Nov 4 '16 at 12:34
4

Emacs-22.1 was released on June 2 2007, so it qualifies as ancient.

AFAIK the usual 32bit build of Emacs is currently limited to 512MB buffers (tho there's a compilation option to push this limit to 2GB at the cost of performance), and IIRC on Emacs<24 a similar limit applied to 64bit versions of Emacs.

So better ditch Apple's bundled Emacs and install the real thing.

  • 1
    on a side note, why does apple bundle such an ancient version of emacs for macOS ?? what's the point in even shipping with such old version – Chakravarthy Raghunandan Nov 4 '16 at 16:25
  • Not sure why they bother. OTOH I do know why they stick to an old version of Emacs (and Bash): Apple is much too control-freakish to be willing to distribute any GPLv3 code, so they stick to the last GPLv2 version of those tools. – Stefan Nov 4 '16 at 21:57
  • You're right, I'll update it. I just never bothered to check the version until now. – erickrf Nov 4 '16 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.