🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99640

kill-comment should check for comment-syntax

#99640
From: macrakis
Date: Wed, 20 Jun 1990 14:34
30 lines
1500 bytes
GNU Emacs 18.53.11 on NeXT 1.0.1

kill-comment gives an internal error (Wrong type arg) instead of a
user error when there is no comment syntax defined.

Fix is trivial:

(defun kill-comment (arg)
  "Kill the comment on this line, if any.
With argument, kill comments on that many lines starting with this one."
  (interactive "P")
  (barf-if-buffer-read-only)
;;; Add
  (if (null comment-start-skip)
      (error "No comment syntax defined"))
;;; end Add
  (let ((count (prefix-numeric-value arg)))
    (while (> count 0)
      (save-excursion
	(end-of-line)
	(let ((eolpos (point)))
	  (beginning-of-line)
	  (if (re-search-forward comment-start-skip eolpos t)
	      (progn
		(goto-char (match-beginning 0))
		(skip-chars-backward " \t")
		(kill-region (point) eolpos)))))
      (if arg
	  (forward-line 1))
      (setq count (1- count)))))
Technical Details
Message-ID: <9006201252.AA22936@.dupuis.gr.osf.org.>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!ri.osf.fr!macrakis

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,1effb074e71ca660,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-06-20 07:34:09 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!ri.osf.fr!macrakis
From: macrakis@ri.osf.fr
Newsgroups: gnu.emacs.bug
Subject: kill-comment should check for comment-syntax
Message-ID: <9006201252.AA22936@.dupuis.gr.osf.org.>
Date: 20 Jun 90 14:34:09 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30
Posted: Wed Jun 20 15:34:09 1990
X-Unparsable-Date: Wed, 20 Jun 90 13:57:01 GMT+0100