comparison lisp/textmodes/texinfmt.el @ 97142:c3512b2085a0

* bitmaps/README: * xfns.c: * termcap.c: * term.c: * syswait.h: * systty.h: * systime.h: * syssignal.h: * sysdep.c: * process.h: * process.c: * print.c: * ndir.h: * lread.c: * keyboard.c: * getpagesize.h: * floatfns.c: * fileio.c: * emacs.c: * doc.c: * dispnew.c: * dired.c: * data.c: * callproc.c: * buffer.c: * README: * Makefile.in: * s/template.h: * s/msdos.h: * m/vax.h: Remove VMS support. * s/vms.h: * vlimit.h: * uaf.h: * temacs.opt: * param.h: * ioctl.h: Remove file. * descrip.mms: * compile.com: Remove file. * Create.c: Remove VMS support. * message.el (Module): * gnus-start.el (Module): * gnus-registry.el (Module): * textmodes/texinfmt.el: * nxml/nxml-enc.el: * mail/feedmail.el: * international/mule.el: * international/latexenc.el: * emulation/viper-util.el: * emulation/viper-init.el: * emulation/viper-ex.el: * emacs-lisp/bytecomp.el: * version.el: * subr.el: * startup.el: * sort.el: * shadowfile.el: * recentf.el: * printing.el: * paths.el: * minibuffer.el: * ls-lisp.el: * loadup.el: * hippie-exp.el: * finder.el: * files.el: * ediff-util.el: * ediff-ptch.el: * ediff-init.el: * ediff-diff.el: * dired.el: * dired-aux.el: * cus-edit.el: * bindings.el: * arc-mode.el: * add-log.el: Remove VMS support. * obsolete/vmsproc.el: * obsolete/vms-pmail.el: * obsolete/vms-patch.el: Remove file. * etags.c: * emacsclient.c: Remove VMS support. * termcap.src: Remove file. * README: * PROBLEMS: * MACHINES: Remove VMS info. * ediff.texi: Remove VMS support. * os.texi: * intro.texi: * files.texi: Remove VMS support. * emacs.texi: Remove VMS support. * make-dist: * README: Remove VMS support. * vms: Remove directory.
author Dan Nicolaescu <dann@ics.uci.edu>
date Thu, 31 Jul 2008 05:33:56 +0000
parents f4a69fedbd46
children d4ebb53e6be1
comparison
equal deleted inserted replaced
97141:840bd675fd85 97142:c3512b2085a0
2961 ("tp" . texinfo-format-tindex) 2961 ("tp" . texinfo-format-tindex)
2962 ("pg" . texinfo-format-pindex) 2962 ("pg" . texinfo-format-pindex)
2963 ("ky" . texinfo-format-kindex))) 2963 ("ky" . texinfo-format-kindex)))
2964 2964
2965 2965
2966 ;;; Sort and index (for VMS)
2967
2968 ;; Sort an index which is in the current buffer between START and END.
2969 ;; Used on VMS, where the `sort' utility is not available.
2970 (defun texinfo-sort-region (start end)
2971 (require 'sort)
2972 (save-restriction
2973 (narrow-to-region start end)
2974 (goto-char (point-min))
2975 (sort-subr nil 'forward-line 'end-of-line 'texinfo-sort-startkeyfun)))
2976
2977 ;; Subroutine for sorting an index.
2978 ;; At start of a line, return a string to sort the line under.
2979 (defun texinfo-sort-startkeyfun ()
2980 (let ((line (buffer-substring-no-properties (point) (line-end-position))))
2981 ;; Canonicalize whitespace and eliminate funny chars.
2982 (while (string-match "[ \t][ \t]+\\|[^a-z0-9 ]+" line)
2983 (setq line (concat (substring line 0 (match-beginning 0))
2984 " "
2985 (substring line (match-end 0)))))
2986 line))
2987
2988
2989 ;;; @printindex 2966 ;;; @printindex
2990 2967
2991 (put 'printindex 'texinfo-format 'texinfo-format-printindex) 2968 (put 'printindex 'texinfo-format 'texinfo-format-printindex)
2992 2969
2993 (defun texinfo-format-printindex () 2970 (defun texinfo-format-printindex ()
3000 (indexelts (apply #'append nil (mapcar #'symbol-value index-list))) 2977 (indexelts (apply #'append nil (mapcar #'symbol-value index-list)))
3001 opoint) 2978 opoint)
3002 (insert "\n* Menu:\n\n") 2979 (insert "\n* Menu:\n\n")
3003 (setq opoint (point)) 2980 (setq opoint (point))
3004 (texinfo-print-index nil indexelts) 2981 (texinfo-print-index nil indexelts)
3005 (if (memq system-type '(vax-vms windows-nt ms-dos)) 2982 (shell-command-on-region opoint (point) "sort -fd" 1)))
3006 (texinfo-sort-region opoint (point))
3007 (shell-command-on-region opoint (point) "sort -fd" 1))))
3008 2983
3009 (defun texinfo-print-index (file indexelts) 2984 (defun texinfo-print-index (file indexelts)
3010 (while indexelts 2985 (while indexelts
3011 (if (stringp (car (car indexelts))) 2986 (if (stringp (car (car indexelts)))
3012 (progn 2987 (progn