X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/6eab3936c71951e304f13b69ad2e835ddaf9f2f4..1dd4f26ab6c1f14628d9fcf03b0cca7e54d52302:/lisp/textmodes/reftex-index.el diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index b1aff42827..0ed6f26699 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el @@ -1,6 +1,6 @@ ;;; reftex-index.el --- index support with RefTeX -;; Copyright (C) 1997-2015 Free Software Foundation, Inc. +;; Copyright (C) 1997-2016 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org @@ -544,18 +544,28 @@ With prefix 3, restrict index to region." (setq buffer-read-only nil) (insert (format -"INDEX <%s> on %s + "INDEX <%s> on %s Restriction: <%s> SPC=view TAB=goto RET=goto+hide [e]dit [q]uit [r]escan [f]ollow [?]Help ------------------------------------------------------------------------------ -" index-tag (abbreviate-file-name master) -(if (eq (car (car reftex-index-restriction-data)) 'toc) - (nth 2 (car reftex-index-restriction-data)) - reftex-index-restriction-indicator))) +" + index-tag (abbreviate-file-name master) + (if (eq (car (car reftex-index-restriction-data)) 'toc) + (nth 2 (car reftex-index-restriction-data)) + reftex-index-restriction-indicator))) (if (reftex-use-fonts) - (put-text-property 1 (point) 'face reftex-index-header-face)) - (put-text-property 1 (point) 'intangible t) + (put-text-property (point-min) (point) + 'face reftex-index-header-face)) + (if (fboundp 'cursor-intangible-mode) + (cursor-intangible-mode 1) + ;; If `cursor-intangible' is not available, fallback on the old + ;; intrusive `intangible' property. + (put-text-property (point-min) (point) 'intangible t)) + (add-text-properties (point-min) (point) + '(cursor-intangible t + front-sticky (cursor-intangible) + rear-nonsticky (cursor-intangible))) (reftex-insert-index docstruct index-tag) (goto-char (point-min)) @@ -697,9 +707,10 @@ SPC=view TAB=goto RET=goto+hide [e]dit [q]uit [r]escan [f]ollow [?]Help (defun reftex-index-post-command-hook () ;; Used in the post-command-hook for the *Index* buffer + ;; FIXME: Lots of redundancy with reftex-toc-post-command-hook! (when (get-text-property (point) :data) - (and (> (point) 1) - (not (get-text-property (point) 'intangible)) + (and (> (point) 1) ;FIXME: Is this point-min or do we care about narrowing? + (not (get-text-property (point) 'cursor-intangible)) (memq reftex-highlight-selection '(cursor both)) (reftex-highlight 1 (or (previous-single-property-change (1+ (point)) :data) @@ -2108,5 +2119,5 @@ Does not do a save-excursion." ;;; reftex-index.el ends here ;; Local Variables: -;; generated-autoload-file: "reftex.el" +;; generated-autoload-file: "reftex-loaddefs.el" ;; End: