comparison lisp/textmodes/reftex-toc.el @ 111422:2eee976277c5

Silence reftex compilation. * lisp/textmodes/reftex-toc.el (reftex-toc-do-promote) (reftex-toc-promote-prepare): Pass `delta' as an explicit argument. (reftex-toc-promote-action): Doc fix. * lisp/textmodes/reftex-sel.el (reftex-select-item): Give local variables `prompt', `data' a prefix. (reftex-select-post-command-hook, reftex-select-callback) (reftex-select-mouse-accept, reftex-select-read-cite): Update for above name changes. * lisp/textmodes/reftex-ref.el (reftex-reference): Rename local variable `refstyle' to reftex-refstyle. (reftex-offer-label-menu): Update for above name change. * lisp/textmodes/reftex-sel.el (reftex-select-toggle-varioref): Update for `refstyle' name change.
author Glenn Morris <rgm@gnu.org>
date Sat, 06 Nov 2010 12:11:38 -0700
parents f36bcc8c2a23
children 6e613fbf73d7
comparison
equal deleted inserted replaced
111421:ac911360c429 111422:2eee976277c5
543 nil t) 543 nil t)
544 (beginning-of-line)) 544 (beginning-of-line))
545 545
546 ;; Promotion/Demotion stuff 546 ;; Promotion/Demotion stuff
547 547
548 (defvar delta)
549 (defvar pro-or-de) 548 (defvar pro-or-de)
550 (defvar start-pos) 549 (defvar start-pos)
551 (defvar start-line) 550 (defvar start-line)
552 (defvar mark-line) 551 (defvar mark-line)
553 552
599 (setq sections 598 (setq sections
600 (concat sections "-" 599 (concat sections "-"
601 (reftex-toc-extract-section-number 600 (reftex-toc-extract-section-number
602 (nth (1- nsec) entries))))) 601 (nth (1- nsec) entries)))))
603 ;; Run through the list and prepare the changes. 602 ;; Run through the list and prepare the changes.
604 (setq entries (mapcar 'reftex-toc-promote-prepare entries)) 603 (setq entries (mapcar
604 (lambda (e) (reftex-toc-promote-prepare e delta))
605 entries))
605 ;; Ask for permission 606 ;; Ask for permission
606 (if (or (not reftex-toc-confirm-promotion) ; never confirm 607 (if (or (not reftex-toc-confirm-promotion) ; never confirm
607 (and (integerp reftex-toc-confirm-promotion) ; confirm if many 608 (and (integerp reftex-toc-confirm-promotion) ; confirm if many
608 (< nsec reftex-toc-confirm-promotion)) 609 (< nsec reftex-toc-confirm-promotion))
609 (yes-or-no-p ; ask 610 (yes-or-no-p ; ask
641 (if (featurep 'xemacs) 642 (if (featurep 'xemacs)
642 (zmacs-activate-region) 643 (zmacs-activate-region)
643 (setq mark-active t 644 (setq mark-active t
644 deactivate-mark nil))))) 645 deactivate-mark nil)))))
645 646
646 (defun reftex-toc-promote-prepare (x) 647 (defun reftex-toc-promote-prepare (x delta)
647 "Look at a toc entry and see if we could pro/demote it. 648 "Look at a toc entry and see if we could pro/demote it.
648 Expects the level change DELTA to be dynamically scoped into this function.
649 This function prepares everything for the changes, but does not do it. 649 This function prepares everything for the changes, but does not do it.
650 The return value is a list with information needed when doing the 650 The return value is a list with information needed when doing the
651 promotion/demotion later." 651 promotion/demotion later. DELTA is the level change."
652 (let* ((data (car x)) 652 (let* ((data (car x))
653 (toc-point (cdr x)) 653 (toc-point (cdr x))
654 (marker (nth 4 data)) 654 (marker (nth 4 data))
655 (literal (nth 7 data)) 655 (literal (nth 7 data))
656 (load nil) 656 (load nil)
682 (level (cdr (assoc name reftex-section-levels-all))) 682 (level (cdr (assoc name reftex-section-levels-all)))
683 (dummy (if (not (integerp level)) 683 (dummy (if (not (integerp level))
684 (progn 684 (progn
685 (goto-char toc-point) 685 (goto-char toc-point)
686 (error "Cannot %smote special sections" pro-or-de)))) 686 (error "Cannot %smote special sections" pro-or-de))))
687 ;; Delta is dynamically scoped into here...
688 (newlevel (if (>= level 0) (+ delta level) (- level delta))) 687 (newlevel (if (>= level 0) (+ delta level) (- level delta)))
689 (dummy2 (if (or (and (>= level 0) (= newlevel -1)) 688 (dummy2 (if (or (and (>= level 0) (= newlevel -1))
690 (and (< level 0) (= newlevel 0))) 689 (and (< level 0) (= newlevel 0)))
691 (error "Cannot %smote \\%s" pro-or-de name))) 690 (error "Cannot %smote \\%s" pro-or-de name)))
692 (newname (reftex-toc-newhead-from-alist newlevel name 691 (newname (reftex-toc-newhead-from-alist newlevel name
696 (goto-char toc-point) 695 (goto-char toc-point)
697 (error "Cannot %smote \\%s" pro-or-de name)))) 696 (error "Cannot %smote \\%s" pro-or-de name))))
698 697
699 (defun reftex-toc-promote-action (x) 698 (defun reftex-toc-promote-action (x)
700 "Change the level of a toc entry. 699 "Change the level of a toc entry.
701 DELTA and PRO-OR-DE are assumed to be dynamically scoped into this function." 700 PRO-OR-DE is assumed to be dynamically scoped into this function."
702 (let* ((data (car x)) 701 (let* ((data (car x))
703 (name (nth 1 x)) 702 (name (nth 1 x))
704 (newname (nth 2 x)) 703 (newname (nth 2 x))
705 (marker (nth 4 data))) 704 (marker (nth 4 data)))
706 (with-current-buffer (marker-buffer marker) 705 (with-current-buffer (marker-buffer marker)