Article View: gnu.emacs.bug
Article #1217Changes to SORT.EL: now works on VMS too
From: ROBERTS%UORNSRL.BITNET
Date: Thu, 01 Dec 1988 14:32
Date: Thu, 01 Dec 1988 14:32
57 lines
2836 bytes
2836 bytes
I've made a few changes in the file sort.el to the procedure sort-columns.
The changes eliminate the call-subprocess-region and use sort-subr instead.
I did this to get it to work on VMS, but since everything is done in emacs
lisp, it should run anywhere. I'm sending this for consideration as a
change for the next release of GNU Emacs.
Below is the output from the VMS command DIFFERENCES --- not quite the same
as unix, but understandable. Note that there is a change in the
documentation string, thus the documentation program should be re-run and a
new dump file created for everything to be up to date.
If preferred, I can send the entire procedure sort-columns.
************
File EMACS_LIBRARY:[VMS-STUFF]SORT.EL;1
321 A prefix argument means sort into reverse order."
322 (interactive "P\nr")
******
File EMACS_LIBRARY:[VMS-STUFF]SORT.EL-ORIGINAL;1
321 A prefix argument means sort into reverse order.
322
323 Note that sort-columns uses the sort utility program and therefore
324 cannot work on text containing TAB characters. Use M-x untabify
325 to convert tabs to spaces before sorting."
326 (interactive "P\nr")
************
************
File EMACS_LIBRARY:[VMS-STUFF]SORT.EL;1
335 (save-restriction
336 (narrow-to-region beg1 end1)
337 (goto-char beg1)
338 (sort-subr reverse 'forward-line 'end-of-line
339 (function (lambda () (move-to-column col-start) nil))
340 (function (lambda () (move-to-column col-end) nil)))))))
******
File EMACS_LIBRARY:[VMS-STUFF]SORT.EL-ORIGINAL;1
339 (if (search-backward "\t" beg1 t)
340 (error "sort-columns does not work with tabs. Use M-x untabify."))
341 (call-process-region beg1 end1 "sort" t t nil
342 (if reverse "-rt\n" "-t\n")
343 (concat "+0." col-start)
344 (concat "-0." col-end)))))
************
Number of difference sections found: 2
Number of difference records found: 11
DIFFERENCES-
/IGNORE=(SPACING)/MERGED=1/OUTPUT=EMACS_LIBRARY:[VMS-STUFF]SORT.DIFF;1-
EMACS_LIBRARY:[VMS-STUFF]SORT.EL;1-
EMACS_LIBRARY:[VMS-STUFF]SORT.EL-ORIGINAL;1
Roland Roberts BITNET: roberts@uornsrl.bitnet
Nuclear Structure Research Lab INTERNET: rbr4@db2.cc.rochester.edu
271 East River Road UUCP: rochester!ur-cc!rbr4
Rochester, NY 14267 AT&T: (716) 275-8962
Technical Details
Message-ID:
<8812011528.AA10823@prep.ai.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!ROBERTS%UORNSRL.BITNETShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!ROBERTS%UORNSRL.BITNET From: ROBERTS%UORNSRL.BITNET@MITVMA.MIT.EDU Newsgroups: gnu.emacs.bug Subject: Changes to SORT.EL: now works on VMS too Message-ID: <8812011528.AA10823@prep.ai.mit.edu> Date: 1 Dec 88 14:32:00 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 57