Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!mips!sgi!dragon!dblues.wpd.sgi.com!jackr From: jackr@dblues.wpd.sgi.com (John Repenning) Newsgroups: comp.emacs Subject: gin-mode for GNU Emacs Keywords: GNU, gin-mode, indentation, text-mode Message-ID: <1990Dec3.190053.10160@relay.wpd.sgi.com> Date: 3 Dec 90 19:00:53 GMT Sender: news@relay.wpd.sgi.com ( CNews Account ) Reply-To: jackr@dblues.wpd.sgi.com Organization: Silicon Graphics, Inc. Lines: 53 I have a copy of a minor mode, called ``gin-mode'', which modifies text-mode so that the indentation functions guess the appropriate indentation and follow it - no more set-fill-prefix! And, no more "ah, shoot! I forgot to reset set-fill-prefix" either!!! The code was written by Martin Neitzel, around a year ago, and I believe I got it (indirectly) from this news group, so I wont repost it (but if someone wants it, I'd be happy to provide you a copy - email me). However, I've found what appears to be a simple, minor bug in it. The code that handles hanging indents doesn't recognize the ones that look like this: 1. Paragraph about something or other, long enough to require several lines ... This recognition is controled by a regular expression, which seems to be trying to include this format, but misses it by just a hair: instead of being defined like this: (defvar gin-left-hang-indent-re "\\s *\\([-*]\\|([a-zA-Z0-9])\\|[a-zA-Z0-9]\\.?:]?\\)\\s +" "*Regexp that defines a hanging indent of a paragraph. If it is seen by gin-guess-prefix, the next lines are indented with white space beyond the hanging indent. Setting this variable makes it buffer-local.") ...it shouls be like this: (defvar gin-left-hang-indent-re "\\s *\\([-*]\\|([a-zA-Z0-9])\\|[a-zA-Z0-9]\\.?:?]?\\)\\s +" "*Regexp that defines a hanging indent of a paragraph. If it is seen by gin-guess-prefix, the next lines are indented with white space beyond the hanging indent. Setting this variable makes it buffer-local.") The change is in the sequence "\\.?:]?", near the end - I've made the colon optional, like the period and the bracket. Or, maybe the sequence should just be "[].:]?", to permit zero or one of any of these characters - strictly, the present code allows a form like 1.:] stuff ...which doesn't look like anything anyone might want. I thought of sending this change to Martin (with whom I've corresponded before), but I've lost his new address. (Do you read this group, Martin? Do you agree with my interpretation?) Jack Repenning jackr@dblues.wpd.sgi.com Brought to you by Super Global Mega Corp .com