Mercurial > emacs
comparison lisp/newcomment.el @ 33468:4d15850856e4
(comment-indent-default): Stick \s<\s< to the left
when it follows non-comment text on the line.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 14 Nov 2000 10:03:56 +0000 |
parents | c3058f7483c4 |
children | decc878ec612 |
comparison
equal
deleted
inserted
replaced
33467:09da172d93be | 33468:4d15850856e4 |
---|---|
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 ;; Version: $Name: $ | 8 ;; Version: $Name: $ |
9 ;; Revision: $Id: newcomment.el,v 1.21 2000/10/05 22:43:22 monnier Exp $ | 9 ;; Revision: $Id: newcomment.el,v 1.22 2000/10/08 19:07:41 monnier Exp $ |
10 | 10 |
11 ;; This file is part of GNU Emacs. | 11 ;; This file is part of GNU Emacs. |
12 | 12 |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
14 ;; it under the terms of the GNU General Public License as published by | 14 ;; it under the terms of the GNU General Public License as published by |
397 ;;;; | 397 ;;;; |
398 | 398 |
399 ;;;###autoload | 399 ;;;###autoload |
400 (defun comment-indent-default () | 400 (defun comment-indent-default () |
401 "Default for `comment-indent-function'." | 401 "Default for `comment-indent-function'." |
402 (if (looking-at "\\s<\\s<\\s<") 0 | 402 (if (and (looking-at "\\s<\\s<\\(\\s<\\)?") |
403 (or (match-end 1) (/= (current-column) (current-indentation)))) | |
404 0 | |
403 (when (or (/= (current-column) (current-indentation)) | 405 (when (or (/= (current-column) (current-indentation)) |
404 (and (> comment-add 0) (looking-at "\\s<\\S<"))) | 406 (and (> comment-add 0) (looking-at "\\s<\\S<"))) |
405 comment-column))) | 407 comment-column))) |
406 | 408 |
407 ;;;###autoload | 409 ;;;###autoload |