Mercurial > emacs
comparison lisp/indent.el @ 110417:8a3552ec7934
* lisp/indent.el (indent-according-to-mode): Apply syntax-propertize.
(indent-region): Use indent-according-to-mode.
* test/indent/octave.m: Remove one more `fixindent'. Use `end'.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sat, 18 Sep 2010 18:21:16 +0200 |
parents | 280c8ae2476d |
children | 417b1e4d63cd |
comparison
equal
deleted
inserted
replaced
110416:0abc226eaa66 | 110417:8a3552ec7934 |
---|---|
66 "Indent line in proper way for current major mode. | 66 "Indent line in proper way for current major mode. |
67 The buffer-local variable `indent-line-function' determines how to do this, | 67 The buffer-local variable `indent-line-function' determines how to do this, |
68 but the functions `indent-relative' and `indent-relative-maybe' are | 68 but the functions `indent-relative' and `indent-relative-maybe' are |
69 special; we don't actually use them here." | 69 special; we don't actually use them here." |
70 (interactive) | 70 (interactive) |
71 (syntax-propertize (line-end-position)) | |
71 (if (memq indent-line-function | 72 (if (memq indent-line-function |
72 '(indent-relative indent-relative-maybe)) | 73 '(indent-relative indent-relative-maybe)) |
73 ;; These functions are used for tabbing, but can't be used for | 74 ;; These functions are used for tabbing, but can't be used for |
74 ;; indenting. Replace with something ad-hoc. | 75 ;; indenting. Replace with something ad-hoc. |
75 (let ((column (save-excursion | 76 (let ((column (save-excursion |
416 (save-excursion | 417 (save-excursion |
417 (setq end (copy-marker end)) | 418 (setq end (copy-marker end)) |
418 (goto-char start) | 419 (goto-char start) |
419 (while (< (point) end) | 420 (while (< (point) end) |
420 (or (and (bolp) (eolp)) | 421 (or (and (bolp) (eolp)) |
421 (funcall indent-line-function)) | 422 (indent-according-to-mode)) |
422 (forward-line 1)) | 423 (forward-line 1)) |
423 (move-marker end nil)))) | 424 (move-marker end nil)))) |
424 (setq column (prefix-numeric-value column)) | 425 (setq column (prefix-numeric-value column)) |
425 (save-excursion | 426 (save-excursion |
426 (goto-char end) | 427 (goto-char end) |