view lib-src/ad2c @ 4435:1e2fc51563a5

Fix auto-formatting of comments in auto-fill-mode This patch makes auto-fill-mode properly format comments (when lines are automatically broken). It looks strangely similar to that of: | 1999-06-24 Bob Weiner <weiner@beopen.com> | | * simple.el (indent-new-comment-line): Locally bound | `block-comment-start' to `comstart' or else when this is called | from do-auto-fill, e.g. in Lisp mode, it will insert any non-nil | `block-comment-start' value, ignoring any existing spacing after a | comment prefix in the previous line and producing ugly comments.
author Didier Verna <didier@xemacs.org>
date Wed, 05 Mar 2008 18:01:37 +0100
parents 376386a54a3c
children ac2d302a0011 26a007fa2f4c
line wrap: on
line source

#!/bin/sh
#
#	ad2c : Convert app-defaults file to C strings decls.
#
#	George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
#	19 Mar 1991 : gf
#		Made it self-contained.
#	6 Jan 1992 : mycroft@gnu.ai.mit.edu (Charles Hannum)
#		Removed use of "-n" and ":read" label since Gnu and
#		IBM sed print pattern space on "n" command. Still works
#		with Sun sed, of course.
#	7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
#		Escape quotes after escaping backslashes.
#
# Synched up with: Not in FSF.

sed '
/^!/d
/^$/d
s/\\/\\\\/g
s/\\$//g
s/"/\\"/g
s/^/"/
: test
/\\$/b slash
s/$/",/
p
d
: slash
n
/^!/d
/^$/d
s/"/\\"/g
s/\\\\/\\/g
s/\\n/\\\\n/g
s/\\t/\\\\t/g
s/\\f/\\\\f/g
s/\\b/\\\\b/g
b test' "$@"