aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-03-25 14:41:06 -0400
committerStefan Monnier2012-03-25 14:41:06 -0400
commit98fb480ee31bf74cf554044f60f21df16566dd7f (patch)
tree9bd83d6ee0fe2e55f74fb718303108f2167e63fa
parent8eb5d48f36bbb758d46a867c52fbc23d7ad7d71f (diff)
downloademacs-98fb480ee31bf74cf554044f60f21df16566dd7f.tar.gz
emacs-98fb480ee31bf74cf554044f60f21df16566dd7f.zip
* lisp/newcomment.el (comment-inline-offset): Don't autoload.
(comment-choose-indent): Obey comment-inline-offset.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/newcomment.el6
2 files changed, 8 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 729795b9bab..d6e8d259ae3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-03-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * newcomment.el (comment-inline-offset): Don't autoload.
4 (comment-choose-indent): Obey comment-inline-offset.
5
12012-03-25 Philipp Haselwarter <philipp.haselwarter@gmx.de> (tiny change) 62012-03-25 Philipp Haselwarter <philipp.haselwarter@gmx.de> (tiny change)
2 7
3 * newcomment.el (comment-inline-offset): New custom var (bug#11090). 8 * newcomment.el (comment-inline-offset): New custom var (bug#11090).
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 2d5608cb225..bac218e4e91 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -268,7 +268,6 @@ makes the comment easier to read. Default is 1. nil means 0."
268 :type '(choice string integer (const nil)) 268 :type '(choice string integer (const nil))
269 :group 'comment) 269 :group 'comment)
270 270
271;;;###autoload
272(defcustom comment-inline-offset 1 271(defcustom comment-inline-offset 1
273 "Inline comments have to be preceded by at least this many spaces. 272 "Inline comments have to be preceded by at least this many spaces.
274This is usefull when style-conventions require a certain minimal offset. 273This is usefull when style-conventions require a certain minimal offset.
@@ -598,7 +597,7 @@ Point is expected to be at the start of the comment."
598 (save-excursion (end-of-line) (current-column))))) 597 (save-excursion (end-of-line) (current-column)))))
599 (other nil) 598 (other nil)
600 (min (save-excursion (skip-chars-backward " \t") 599 (min (save-excursion (skip-chars-backward " \t")
601 (1+ (current-column))))) 600 (+ comment-inline-offset (current-column)))))
602 ;; Fix up the range. 601 ;; Fix up the range.
603 (if (< max min) (setq max min)) 602 (if (< max min) (setq max min))
604 ;; Don't move past the fill column. 603 ;; Don't move past the fill column.
@@ -698,7 +697,8 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any."
698 (save-excursion 697 (save-excursion
699 (skip-chars-backward " \t") 698 (skip-chars-backward " \t")
700 (unless (bolp) 699 (unless (bolp)
701 (setq indent (max indent (+ (current-column) comment-inline-offset))))) 700 (setq indent (max indent
701 (+ (current-column) comment-inline-offset)))))
702 ;; If that's different from comment's current position, change it. 702 ;; If that's different from comment's current position, change it.
703 (unless (= (current-column) indent) 703 (unless (= (current-column) indent)
704 (delete-region (point) (progn (skip-chars-backward " \t") (point))) 704 (delete-region (point) (progn (skip-chars-backward " \t") (point)))