]> code.delx.au - gnu-emacs/blobdiff - lisp/indent.el
Fix infloop in filepos-to-bufferpos
[gnu-emacs] / lisp / indent.el
index 7df927ff808fe7e3bf464093b047f644abc212a5..18c1fd48db7e297dcab3a412626a0b8c21ec04ac 100644 (file)
@@ -1,6 +1,6 @@
 ;;; indent.el --- indentation commands for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985, 1995, 2001-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1995, 2001-2015 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Package: emacs
@@ -537,7 +537,7 @@ column to indent to; if it is nil, use one of the three methods above."
   ;; In most cases, reindenting modifies the buffer, but it may also
   ;; leave it unmodified, in which case we have to deactivate the mark
   ;; by hand.
-  (deactivate-mark))
+  (setq deactivate-mark t))
 
 (defun indent-relative-maybe ()
   "Indent a new line like previous nonblank line.
@@ -677,6 +677,13 @@ If PREV is non-nil, return the previous one instead."
                             (if (<= column last) -1 (/ (- column last 1) step))
                           (1+ (/ (- column last) step)))))))))
 
+(defun indent-accumulate-tab-stops (limit)
+  "Get a list of tab stops before LIMIT (inclusive)."
+  (let ((tab 0) (tab-stops))
+    (while (<= (setq tab (indent-next-tab-stop tab)) limit)
+      (push tab tab-stops))
+    (nreverse tab-stops)))
+
 (defun tab-to-tab-stop ()
   "Insert spaces or tabs to next defined tab-stop column.
 The variable `tab-stop-list' is a list of columns at which there are tab stops.