Mercurial > emacs
comparison lisp/newcomment.el @ 39078:8aea6fefc072
*** empty log message ***
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sat, 01 Sep 2001 21:19:45 +0000 |
parents | 29a1feb5e1fe |
children | fc69197cb76d |
comparison
equal
deleted
inserted
replaced
39077:b0080041c3c5 | 39078:8aea6fefc072 |
---|---|
3 ;; Copyright (C) 1999, 2000 Free Software Foundation Inc. | 3 ;; Copyright (C) 1999, 2000 Free Software Foundation Inc. |
4 | 4 |
5 ;; Author: code extracted from Emacs-20's simple.el | 5 ;; Author: code extracted from Emacs-20's simple.el |
6 ;; Maintainer: Stefan Monnier <monnier@cs.yale.edu> | 6 ;; Maintainer: Stefan Monnier <monnier@cs.yale.edu> |
7 ;; Keywords: comment uncomment | 7 ;; Keywords: comment uncomment |
8 ;; Revision: $Id: newcomment.el,v 1.31 2001/03/02 20:31:40 monnier Exp $ | 8 ;; Revision: $Id: newcomment.el,v 1.32 2001/08/21 18:30:59 monnier Exp $ |
9 | 9 |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
444 ;; An existing comment? | 444 ;; An existing comment? |
445 (if begpos (setq cpos (point-marker)) | 445 (if begpos (setq cpos (point-marker)) |
446 ;; If none, insert one. | 446 ;; If none, insert one. |
447 (save-excursion | 447 (save-excursion |
448 ;; Some comment-indent-function insist on not moving comments that | 448 ;; Some comment-indent-function insist on not moving comments that |
449 ;; are in column 0, so we insert a space to avoid this special case | 449 ;; are in column 0, so we insert a space to avoid this special |
450 (insert " ") | 450 ;; case. The check for (zerop comment-column) is used for cases |
451 ;; where we're called from comment-indent-new-line. | |
452 (unless (zerop comment-column) (insert " ")) | |
451 (setq begpos (point)) | 453 (setq begpos (point)) |
452 (insert starter) | 454 (insert starter) |
453 (setq cpos (point-marker)) | 455 (setq cpos (point-marker)) |
454 (insert ender))) | 456 (insert ender))) |
455 (goto-char begpos) | 457 (goto-char begpos) |