diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-12-10 07:26:02 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-12-10 07:26:02 +0000 |
commit | 0b01a6d80d6017c7b3fe950912ef772c82a94948 (patch) | |
tree | 06bd1d84ba46f1309f8f13e7ac2574bbaaa9806c | |
parent | 466f392fa5369c0f8e7cca4da99eeaca880115db (diff) | |
download | emacs-0b01a6d80d6017c7b3fe950912ef772c82a94948.tar.gz |
(sort-columns): Don't use `sort' utility if the text has text properties.
-rw-r--r-- | lisp/sort.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/sort.el b/lisp/sort.el index d4131e7825b..61a35b635c6 100644 --- a/lisp/sort.el +++ b/lisp/sort.el @@ -455,8 +455,12 @@ Use \\[untabify] to convert tabs to spaces before sorting." (setq col-end (max col-beg1 col-end1)) (if (search-backward "\t" beg1 t) (error "sort-columns does not work with tabs. Use M-x untabify.")) - (if (not (eq system-type 'vax-vms)) + (if (not (or (eq system-type 'vax-vms) + (text-properties-at beg1) + (< (next-property-change beg1 nil end1) end1))) ;; Use the sort utility if we can; it is 4 times as fast. + ;; Do not use it if there are any properties in the region, + ;; since the sort utility would lose the properties. (call-process-region beg1 end1 "sort" t t nil (if reverse "-rt\n" "-t\n") (concat "+0." col-start) |