🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #1755

Bug report

#1755
From: Minh.Tue.Vo
Date: Sat, 17 Aug 1991 11:08
44 lines
1744 bytes
Epoch version: 3.2.22
X Window version: X11R4

Major mode: c-mode

Bug description:

	scan-sexps screws up when there is a colon (:) in the sexp;
	the return value is 1 more than it should be, i.e. going past
	the colon instead of stopping just before it.

Example: (running in c-mode)

	-------- Text in buffer ---------
	abc:
	---------------------------------

	Point is just before 'a'.
	Call (forward-sexp 1) [this does (goto-char (scan-sexps (point) 1))].
	Point is now just after ':'.  Should be just before ':'.

Consequence:

	c-indent-line in c-mode uses forward-sexp to detect labels:

	[excerpt code from GNU/lisp/c-mode.el]
	(defun c-indent-line ()
		...
		(cond ((or (looking-at "case[ \t]")
		           (and (looking-at "[A-Za-z]")
		                (save-excursion
		                  (forward-sexp 1)
		                  (looking-at ":"))))
		        (setq indent (max 1 (+ indent c-label-offset))))
		...
	[end excerpt]

	This bug in scan-sexps causes c-indent-line to indent lines
	containing labels incorrectly (although "case" lines are OK).

This bug is not present in GNU-Emacs version 18.54.52 which I used
before I switched to Epoch 3.2.22.

Minh Tue Vo (Minh.Tue.Vo@cs.cmu.edu)
Technical Details
Message-ID: <McfLF1S00hYdF41cQI@cs.cmu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!cs.cmu.edu!Minh.Tue.Vo

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,a588f72844ba63,start
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1991-08-18 01:31:33 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!cs.cmu.edu!Minh.Tue.Vo
From: Minh.Tue.Vo@cs.cmu.edu
Newsgroups: gnu.epoch.misc
Subject: Bug report
Message-ID: <McfLF1S00hYdF41cQI@cs.cmu.edu>
Date: 17 Aug 91 11:08:49 GMT
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 44