🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #88020

[19.25.93] insert-parentheses at beginning/end of buffer

#88020
From: Erik Naggum
Date: Sun, 14 Aug 1994 19:34
43 lines
2209 bytes
In GNU Emacs 19.25.93.6 (sparc-sun-sunos4shr) of Sun Aug 14 1994 on naggum.no

when `insert-parentheses' is called at the beginning and/or end of the
buffer, it will insert spaces before and after the parens.  I didn't quite
expect this, and found the reason to be that `preceding-char' and
`following-char' return 0 at these boundary positions.  (char-syntax 0) in
turn says it's a whitespace, which I definitely don't think it is.  maybe
`preceding-char' and `following-char' should return nil?

this patch causes spurious blanks not be inserted at the beginning and the
end of the buffer.

</Erik>

---------------------------------------------------------------------------

Sun Aug 14 19:21:43 1994  Erik Naggum  <erik@naggum.no>

	* lisp.el (insert-parentheses): don't insert spaces at beginning
	and end of buffer.

*** lisp/lisp.el.~1~	Mon Jul 11 21:26:15 1994
--- lisp/lisp.el	Sun Aug 14 19:14:41 1994
***************
*** 218,223 ****
--- 218,224 ----
      (setq arg 0))
    (or (eq arg 0) (skip-chars-forward " \t"))
    (and parens-require-spaces
+        (not (bobp))
         (memq (char-syntax (preceding-char)) '(?w ?_ ?\) ))
         (insert " "))
    (insert ?\()
***************
*** 225,230 ****
--- 226,232 ----
      (or (eq arg 0) (forward-sexp arg))
      (insert ?\))
      (and parens-require-spaces
+ 	 (not (eobp))
  	 (memq (char-syntax (following-char)) '(?w ?_ ?\( ))
  	 (insert " "))))
  
Technical Details
Message-ID: <19940814.4263@naggum.no>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!naggum.no!erik

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,eb003304ed0372e8,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-14 12:57:47 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!naggum.no!erik
From: erik@naggum.no (Erik Naggum)
Newsgroups: gnu.emacs.bug
Subject: [19.25.93] insert-parentheses at beginning/end of buffer
Date: 14 Aug 1994 15:34:05 -0400
Organization: Naggum Software; +47 2295 0313
Lines: 44
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <19940814.4263@naggum.no>