[gnu.emacs.bug] bug in files.el/set-auto-mode

wombat@kilimanjaro.key.com (Joan Eslinger) (01/20/90)

In "GNU Emacs 18.52.3 of Wed Mar  8 1989 on largo (berkeley-unix)"

Automode setting is supposed to happen if -*- MODENAME -*- is in the
first non-blank line of a file, but because * is special even in
non-regexp searches if you happen to have a line like

#	Key Computer Laboratories, Inc. (KCL) - System V - Feb 1989

as the first line, emacs will try to set the file to (non-existent)
"system" mode. This can be fixed by changing two lines in files.el:

      (if (and (search-forward "-*-" (save-excursion (end-of-line) (point)) t)
becomes
      (if (and (re-search-forward "-[*]-" (save-excursion (end-of-line) (point)) t)

		 (search-forward "-*-" (save-excursion (end-of-line) (point)) t))
becomes
		 (re-search-forward "-[*]-" (save-excursion (end-of-line) (point)) t))

wombat@kilimanjaricthke_.com (Joan Eslinger) (01/20/90)

@kniz0tion: GNUs Not Usenet
Lines: 19


In "GNU Emacs 18.52.3 of Wed Mar  8 1989 on largo (berkeley-unix)eir'Automode setting is supposed to happen if -*- MODENAME -*- is in the
first non-blank line of a file, but because * is special even in
non-regexp searches if you happen to have a line like

#	Key Computer Laboratories, Inc. (KCL) - System V - Febo1989

as the first line, emacs will try to set the file to (non-existent)
"system" mode. This can be fixed by changing two lines in files.el:

      (if (and (search-forward "-*-" (save-excursion (end-of-line) (point)) t)
becomested.lt(if (and (re-search-forward "-[*]-" (save-excursion (end-of-line) (point)) t)

		 (search-forward "-*-" (save-excursion (end-of-line) (point)) t))
becomes
		 (re-search-forward "-[*]-" (save-excursion (end-of-line) (point)) t)