3

I use mutt for email (outside of emacs) and set my EDITOR to an emacsclient invocation. Thus, mutt spawns emacsclient in the same terminal when I want to compose an E-mail, then catches the output file when I quit.

This buffer operates in Fundamental Server mode. Most things are satisfactory; however, when I use fill-paragraph on a paragraph with a semicolon in it (used as in ordinary English), it interprets the semicolon for some reason and fills badly. Thus:

This is a sentence containing enough text to overflow the fill-column; when I try to fill, it fails.

With fill-column at 80, this should fill to:

This is a sentence containing enough text to overflow the fill-column; when I
try to fill, it fails.

Instead, it becomes:

This is a sentence containing enough text to overflow the fill-column; when I
                                                                     ; try to
                                                                     ; fill, it
                                                                     ; fails.

This is obviously not very useful. The same behavior occurs in text-mode. I assume emacs is parsing the semicolon as a comment delimiter, or something of that nature; however, it's unclear to me why this should occur in either fundamental-mode or text-mode, which shouldn't accomodate specific programming languages.

How do I get rid of this behavior?

Tom Hunt
  • 161
  • 4
  • 3
    Could you try with emacs -Q? I opened emacs -Q, set fill-column to 80, did M-x fundamental-mode, yanked your sample text, with point at the end pressed M-q. It worked as expected. Same with text-mode. – Manuel Uberti Jun 01 '16 at 08:51
  • Okay, with -Q it works correctly. This would point to a problem with my init files? – Tom Hunt Jun 01 '16 at 14:58
  • I think so. You should check to what M-q is bound in your config, or try calling M-x fill-paragraph explicitly to understand where the problem is. – Manuel Uberti Jun 01 '16 at 15:05
  • 1
    Explicitly running fill-paragraph still has the same issue. On a quick glance, nothing in my .emacs should be relevant to fill-paragraph, but I may be missing something. What sort of things influence its functionality? – Tom Hunt Jun 01 '16 at 17:51
  • 1
    Well, it all depends from your config actually. You should bisect it, commenting out piece by piece to track down what is causing the problem. Especially since it is working fine with emacs -Q. – Manuel Uberti Jun 01 '16 at 18:02
  • So when I start up a completely new emacs, the behavior also vanishes. It seems that something strange happened in my long-running server session that caused this; killing it and starting a new one fixes it as well. Can I self-close this somehow? – Tom Hunt Jun 02 '16 at 18:29
  • What is the file extension of the file you are editing? – Andrew Swann Jun 03 '16 at 06:36
  • @TomHunt I suppose so. It would be helpful to rest of the community if you could provide a solution, maybe by answering your own question with what you did. But I think we need a moderator here, I'm not sure what the best approach is. – Manuel Uberti Jun 03 '16 at 07:18
  • I would love to provide a solution, but what I actually did was "restart the emacs session once", and now it's fixed and I can't reproduce. – Tom Hunt Jun 03 '16 at 14:59
  • To comment on a very old question: I had the same problem, and I think the reason was that emacs was in "Recursive editing mode", indicated by square brackets around the parentheses showing the major and minor modes. Exiting the recursive editing mode by C-M-c solved the problem. – Toffomat Nov 30 '22 at 10:11

0 Answers0