diff options
| author | Glenn Morris | 2010-11-06 12:11:38 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-11-06 12:11:38 -0700 |
| commit | c8f3bf36321a221cc7b8bbe10ce1d257dc1f00de (patch) | |
| tree | 5e6c486eddaafe7efb4f07b11bbb047a54db271f | |
| parent | b05fde666f574dd48e8bd2a72fafe3b049608a61 (diff) | |
| download | emacs-c8f3bf36321a221cc7b8bbe10ce1d257dc1f00de.tar.gz emacs-c8f3bf36321a221cc7b8bbe10ce1d257dc1f00de.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-ref.el | 40 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-sel.el | 74 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-toc.el | 13 |
4 files changed, 78 insertions, 65 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 09e6c962f19..31771b2a4e4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | 2010-11-06 Glenn Morris <rgm@gnu.org> | 1 | 2010-11-06 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * textmodes/reftex-toc.el (reftex-toc-do-promote) | ||
| 4 | (reftex-toc-promote-prepare): Pass `delta' as an explicit argument. | ||
| 5 | (reftex-toc-promote-action): Doc fix. | ||
| 6 | |||
| 7 | * textmodes/reftex-sel.el (reftex-select-item): Give local variables | ||
| 8 | `prompt', `data' a prefix. | ||
| 9 | (reftex-select-post-command-hook, reftex-select-callback) | ||
| 10 | (reftex-select-mouse-accept, reftex-select-read-cite): | ||
| 11 | Update for above name changes. | ||
| 12 | |||
| 13 | * textmodes/reftex-ref.el (reftex-reference): Rename local variable | ||
| 14 | `refstyle' to reftex-refstyle. | ||
| 15 | (reftex-offer-label-menu): Update for above name change. | ||
| 16 | * textmodes/reftex-sel.el (reftex-select-toggle-varioref): Update for | ||
| 17 | `refstyle' name change. | ||
| 18 | |||
| 3 | * vc/emerge.el (emerge-eval-in-buffer): Remove, and replace all uses | 19 | * vc/emerge.el (emerge-eval-in-buffer): Remove, and replace all uses |
| 4 | with with-current-buffer. | 20 | with with-current-buffer. |
| 5 | (diff, template): Give dynamic local variables a prefix. | 21 | (diff, template): Give dynamic local variables a prefix. |
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 23723489d13..655d69b531d 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el | |||
| @@ -180,8 +180,8 @@ This function is controlled by the settings of reftex-insert-label-flags." | |||
| 180 | (string-match "^[ \t]*$" default)) | 180 | (string-match "^[ \t]*$" default)) |
| 181 | (setq default prefix | 181 | (setq default prefix |
| 182 | force-prompt t) ; need to prompt | 182 | force-prompt t) ; need to prompt |
| 183 | (setq default | 183 | (setq default |
| 184 | (concat prefix | 184 | (concat prefix |
| 185 | (funcall reftex-string-to-label-function default))) | 185 | (funcall reftex-string-to-label-function default))) |
| 186 | 186 | ||
| 187 | ;; Make it unique. | 187 | ;; Make it unique. |
| @@ -227,7 +227,7 @@ This function is controlled by the settings of reftex-insert-label-flags." | |||
| 227 | ((setq entry (assoc label | 227 | ((setq entry (assoc label |
| 228 | (symbol-value reftex-docstruct-symbol))) | 228 | (symbol-value reftex-docstruct-symbol))) |
| 229 | (ding) | 229 | (ding) |
| 230 | (if (y-or-n-p | 230 | (if (y-or-n-p |
| 231 | (format "Label '%s' exists. Use anyway? " label)) | 231 | (format "Label '%s' exists. Use anyway? " label)) |
| 232 | (setq valid t))) | 232 | (setq valid t))) |
| 233 | 233 | ||
| @@ -294,7 +294,7 @@ also applies `reftex-translate-to-ascii-function' to the string." | |||
| 294 | ;; Translate the upper 128 chars in the Latin-1 charset to ASCII equivalents | 294 | ;; Translate the upper 128 chars in the Latin-1 charset to ASCII equivalents |
| 295 | (let ((tab "@@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@ icLxY|S\"ca<--R-o|23'uq..1o>423?AAAAAAACEEEEIIIIDNOOOOOXOUUUUYP3aaaaaaaceeeeiiiidnooooo:ouuuuypy") | 295 | (let ((tab "@@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@ icLxY|S\"ca<--R-o|23'uq..1o>423?AAAAAAACEEEEIIIIDNOOOOOXOUUUUYP3aaaaaaaceeeeiiiidnooooo:ouuuuypy") |
| 296 | (emacsp (not (featurep 'xemacs)))) | 296 | (emacsp (not (featurep 'xemacs)))) |
| 297 | (mapconcat | 297 | (mapconcat |
| 298 | (lambda (c) | 298 | (lambda (c) |
| 299 | (cond ((and (> c 127) (< c 256)) ; 8 bit Latin-1 | 299 | (cond ((and (> c 127) (< c 256)) ; 8 bit Latin-1 |
| 300 | (char-to-string (aref tab (- c 128)))) | 300 | (char-to-string (aref tab (- c 128)))) |
| @@ -430,7 +430,7 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 430 | type (car type)) | 430 | type (car type)) |
| 431 | (setq type (reftex-query-label-type)))) | 431 | (setq type (reftex-query-label-type)))) |
| 432 | 432 | ||
| 433 | (let* ((refstyle | 433 | (let* ((reftex-refstyle |
| 434 | (cond ((reftex-typekey-check type reftex-vref-is-default) "\\vref") | 434 | (cond ((reftex-typekey-check type reftex-vref-is-default) "\\vref") |
| 435 | ((reftex-typekey-check type reftex-fref-is-default) "\\fref") | 435 | ((reftex-typekey-check type reftex-fref-is-default) "\\fref") |
| 436 | (t "\\ref"))) | 436 | (t "\\ref"))) |
| @@ -452,7 +452,7 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 452 | (setq type (nth 1 (car labels)) | 452 | (setq type (nth 1 (car labels)) |
| 453 | form (or (cdr (assoc type reftex-typekey-to-format-alist)) | 453 | form (or (cdr (assoc type reftex-typekey-to-format-alist)) |
| 454 | form)) | 454 | form)) |
| 455 | 455 | ||
| 456 | (cond | 456 | (cond |
| 457 | (no-insert | 457 | (no-insert |
| 458 | ;; Just return the first label | 458 | ;; Just return the first label |
| @@ -466,7 +466,7 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 466 | sep (nth 2 (car labels)) | 466 | sep (nth 2 (car labels)) |
| 467 | sep1 (cdr (assoc sep reftex-multiref-punctuation)) | 467 | sep1 (cdr (assoc sep reftex-multiref-punctuation)) |
| 468 | labels (cdr labels)) | 468 | labels (cdr labels)) |
| 469 | (when cut | 469 | (when cut |
| 470 | (backward-delete-char cut) | 470 | (backward-delete-char cut) |
| 471 | (setq cut nil)) | 471 | (setq cut nil)) |
| 472 | 472 | ||
| @@ -477,9 +477,9 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 477 | ;; do we have a special format? | 477 | ;; do we have a special format? |
| 478 | (setq reftex-format-ref-function | 478 | (setq reftex-format-ref-function |
| 479 | (cond | 479 | (cond |
| 480 | ((string= refstyle "\\vref") 'reftex-format-vref) | 480 | ((string= reftex-refstyle "\\vref") 'reftex-format-vref) |
| 481 | ((string= refstyle "\\fref") 'reftex-format-fref) | 481 | ((string= reftex-refstyle "\\fref") 'reftex-format-fref) |
| 482 | ((string= refstyle "\\Fref") 'reftex-format-Fref) | 482 | ((string= reftex-refstyle "\\Fref") 'reftex-format-Fref) |
| 483 | (t reftex-format-ref-function))) | 483 | (t reftex-format-ref-function))) |
| 484 | ;; ok, insert the reference | 484 | ;; ok, insert the reference |
| 485 | (if sep1 (insert sep1)) | 485 | (if sep1 (insert sep1)) |
| @@ -501,7 +501,7 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 501 | matched cell) | 501 | matched cell) |
| 502 | (save-excursion | 502 | (save-excursion |
| 503 | (while (and (setq cell (pop words)) | 503 | (while (and (setq cell (pop words)) |
| 504 | (not (setq matched | 504 | (not (setq matched |
| 505 | (re-search-backward (car cell) bound t)))))) | 505 | (re-search-backward (car cell) bound t)))))) |
| 506 | (if matched | 506 | (if matched |
| 507 | (cons (cdr cell) (- (match-end 0) (match-end 1))) | 507 | (cons (cdr cell) (- (match-end 0) (match-end 1))) |
| @@ -549,7 +549,7 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 549 | (setq mode-line-format | 549 | (setq mode-line-format |
| 550 | (list "---- " 'mode-line-buffer-identification | 550 | (list "---- " 'mode-line-buffer-identification |
| 551 | " " 'global-mode-string " (" mode-name ")" | 551 | " " 'global-mode-string " (" mode-name ")" |
| 552 | " S<" 'refstyle ">" | 552 | " S<" 'reftex-refstyle ">" |
| 553 | " -%-")) | 553 | " -%-")) |
| 554 | (cond | 554 | (cond |
| 555 | ((= 0 (buffer-size)) | 555 | ((= 0 (buffer-size)) |
| @@ -564,9 +564,9 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 564 | context | 564 | context |
| 565 | counter | 565 | counter |
| 566 | commented | 566 | commented |
| 567 | (or here-I-am offset) | 567 | (or here-I-am offset) |
| 568 | prefix | 568 | prefix |
| 569 | nil ; no a toc buffer | 569 | nil ; no a toc buffer |
| 570 | )))) | 570 | )))) |
| 571 | (here-I-am | 571 | (here-I-am |
| 572 | (setq offset (reftex-get-offset buf here-I-am typekey))) | 572 | (setq offset (reftex-get-offset buf here-I-am typekey))) |
| @@ -690,13 +690,13 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 690 | 690 | ||
| 691 | (defun reftex-query-label-type () | 691 | (defun reftex-query-label-type () |
| 692 | ;; Ask for label type | 692 | ;; Ask for label type |
| 693 | (let ((key (reftex-select-with-char | 693 | (let ((key (reftex-select-with-char |
| 694 | reftex-type-query-prompt reftex-type-query-help 3))) | 694 | reftex-type-query-prompt reftex-type-query-help 3))) |
| 695 | (unless (member (char-to-string key) reftex-typekey-list) | 695 | (unless (member (char-to-string key) reftex-typekey-list) |
| 696 | (error "No such label type: %s" (char-to-string key))) | 696 | (error "No such label type: %s" (char-to-string key))) |
| 697 | (char-to-string key))) | 697 | (char-to-string key))) |
| 698 | 698 | ||
| 699 | (defun reftex-show-label-location (data forward no-revisit | 699 | (defun reftex-show-label-location (data forward no-revisit |
| 700 | &optional stay error) | 700 | &optional stay error) |
| 701 | ;; View the definition site of a label in another window. | 701 | ;; View the definition site of a label in another window. |
| 702 | ;; DATA is an entry from the docstruct list. | 702 | ;; DATA is an entry from the docstruct list. |
| @@ -718,7 +718,7 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 718 | (throw 'exit nil)) | 718 | (throw 'exit nil)) |
| 719 | 719 | ||
| 720 | ;; Goto the file in another window | 720 | ;; Goto the file in another window |
| 721 | (setq buffer | 721 | (setq buffer |
| 722 | (if no-revisit | 722 | (if no-revisit |
| 723 | (reftex-get-buffer-visiting file) | 723 | (reftex-get-buffer-visiting file) |
| 724 | (reftex-get-file-buffer-force | 724 | (reftex-get-file-buffer-force |
| @@ -784,7 +784,7 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 784 | (when (or (not (eq major-mode 'latex-mode)) | 784 | (when (or (not (eq major-mode 'latex-mode)) |
| 785 | (not font-lock-mode)) | 785 | (not font-lock-mode)) |
| 786 | (latex-mode) | 786 | (latex-mode) |
| 787 | (run-hook-with-args | 787 | (run-hook-with-args |
| 788 | 'reftex-pre-refontification-functions | 788 | 'reftex-pre-refontification-functions |
| 789 | reftex-call-back-to-this-buffer 'reftex-hidden) | 789 | reftex-call-back-to-this-buffer 'reftex-hidden) |
| 790 | (turn-on-font-lock)) | 790 | (turn-on-font-lock)) |
| @@ -839,10 +839,8 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window." | |||
| 839 | (unless other-window | 839 | (unless other-window |
| 840 | (set-window-configuration wcfg) | 840 | (set-window-configuration wcfg) |
| 841 | (switch-to-buffer (marker-buffer where)) | 841 | (switch-to-buffer (marker-buffer where)) |
| 842 | (goto-char where)) | 842 | (goto-char where)) |
| 843 | (reftex-unhighlight 0))) | 843 | (reftex-unhighlight 0))) |
| 844 | 844 | ||
| 845 | 845 | ||
| 846 | |||
| 847 | ;; arch-tag: 52f14032-fb76-4d31-954f-750c72415675 | ||
| 848 | ;;; reftex-ref.el ends here | 846 | ;;; reftex-ref.el ends here |
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el index bebeb1cd51a..bb6531d7980 100644 --- a/lisp/textmodes/reftex-sel.el +++ b/lisp/textmodes/reftex-sel.el | |||
| @@ -369,22 +369,21 @@ During a selection process, these are the local bindings. | |||
| 369 | (defvar reftex-last-line nil) | 369 | (defvar reftex-last-line nil) |
| 370 | (defvar reftex-select-marked nil) | 370 | (defvar reftex-select-marked nil) |
| 371 | 371 | ||
| 372 | (defun reftex-select-item (prompt help-string keymap | 372 | (defun reftex-select-item (reftex-select-prompt help-string keymap |
| 373 | &optional offset | 373 | &optional offset |
| 374 | call-back cb-flag) | 374 | call-back cb-flag) |
| 375 | ;; Select an item, using PROMPT. The function returns a key indicating | 375 | ;; Select an item, using REFTEX-SELECT-PROMPT. |
| 376 | ;; an exit status, along with a data structure indicating which item was | 376 | ;; The function returns a key indicating an exit status, along with a |
| 377 | ;; selected. | 377 | ;; data structure indicating which item was selected. |
| 378 | ;; HELP-STRING contains help. KEYMAP is a keymap with the available | 378 | ;; HELP-STRING contains help. KEYMAP is a keymap with the available |
| 379 | ;; selection commands. | 379 | ;; selection commands. |
| 380 | ;; OFFSET can be a label list item which will be selected at start. | 380 | ;; OFFSET can be a label list item which will be selected at start. |
| 381 | ;; When it is t, point will start out at the beginning of the buffer. | 381 | ;; When it is t, point will start out at the beginning of the buffer. |
| 382 | ;; Any other value will cause restart where last selection left off. | 382 | ;; Any other value will cause restart where last selection left off. |
| 383 | ;; When CALL-BACK is given, it is a function which is called with the index | 383 | ;; When CALL-BACK is given, it is a function which is called with the index |
| 384 | ;; of the element. | 384 | ;; of the element. |
| 385 | ;; CB-FLAG is the initial value of that flag. | 385 | ;; CB-FLAG is the initial value of that flag. |
| 386 | 386 | (let (ev reftex-select-data last-data (selection-buffer (current-buffer))) | |
| 387 | (let* (ev data last-data (selection-buffer (current-buffer))) | ||
| 388 | 387 | ||
| 389 | (setq reftex-select-marked nil) | 388 | (setq reftex-select-marked nil) |
| 390 | 389 | ||
| @@ -404,7 +403,7 @@ During a selection process, these are the local bindings. | |||
| 404 | (use-local-map keymap) | 403 | (use-local-map keymap) |
| 405 | (add-hook 'pre-command-hook 'reftex-select-pre-command-hook nil t) | 404 | (add-hook 'pre-command-hook 'reftex-select-pre-command-hook nil t) |
| 406 | (add-hook 'post-command-hook 'reftex-select-post-command-hook nil t) | 405 | (add-hook 'post-command-hook 'reftex-select-post-command-hook nil t) |
| 407 | (princ prompt) | 406 | (princ reftex-select-prompt) |
| 408 | (set-marker reftex-recursive-edit-marker (point)) | 407 | (set-marker reftex-recursive-edit-marker (point)) |
| 409 | ;; XEmacs does not run post-command-hook here | 408 | ;; XEmacs does not run post-command-hook here |
| 410 | (and (featurep 'xemacs) (run-hooks 'post-command-hook)) | 409 | (and (featurep 'xemacs) (run-hooks 'post-command-hook)) |
| @@ -426,19 +425,18 @@ During a selection process, these are the local bindings. | |||
| 426 | (reftex-kill-buffer "*RefTeX Help*") | 425 | (reftex-kill-buffer "*RefTeX Help*") |
| 427 | (setq reftex-callback-fwd (not reftex-callback-fwd)) ;; ;-))) | 426 | (setq reftex-callback-fwd (not reftex-callback-fwd)) ;; ;-))) |
| 428 | (message "") | 427 | (message "") |
| 429 | (list ev data last-data))) | 428 | (list ev reftex-select-data last-data))) |
| 430 | 429 | ||
| 431 | ;; The following variables are all bound dynamically in `reftex-select-item'. | 430 | ;; The following variables are all bound dynamically in `reftex-select-item'. |
| 432 | ;; The defvars are here only to silence the byte compiler. | 431 | ;; The defvars are here only to silence the byte compiler. |
| 433 | 432 | ||
| 434 | (defvar found-list) | 433 | (defvar found-list) |
| 435 | (defvar cb-flag) | 434 | (defvar cb-flag) |
| 436 | (defvar data) | 435 | (defvar reftex-select-data) |
| 437 | (defvar prompt) | 436 | (defvar reftex-select-prompt) |
| 438 | (defvar last-data) | 437 | (defvar last-data) |
| 439 | (defvar call-back) | 438 | (defvar call-back) |
| 440 | (defvar help-string) | 439 | (defvar help-string) |
| 441 | (defvar refstyle) | ||
| 442 | 440 | ||
| 443 | ;; The selection commands | 441 | ;; The selection commands |
| 444 | 442 | ||
| @@ -448,15 +446,15 @@ During a selection process, these are the local bindings. | |||
| 448 | 446 | ||
| 449 | (defun reftex-select-post-command-hook () | 447 | (defun reftex-select-post-command-hook () |
| 450 | (let (b e) | 448 | (let (b e) |
| 451 | (setq data (get-text-property (point) :data)) | 449 | (setq reftex-select-data (get-text-property (point) :data)) |
| 452 | (setq last-data (or data last-data)) | 450 | (setq last-data (or reftex-select-data last-data)) |
| 453 | 451 | ||
| 454 | (when (and data cb-flag | 452 | (when (and reftex-select-data cb-flag |
| 455 | (not (equal reftex-last-follow-point (point)))) | 453 | (not (equal reftex-last-follow-point (point)))) |
| 456 | (setq reftex-last-follow-point (point)) | 454 | (setq reftex-last-follow-point (point)) |
| 457 | (funcall call-back data reftex-callback-fwd | 455 | (funcall call-back reftex-select-data reftex-callback-fwd |
| 458 | (not reftex-revisit-to-follow))) | 456 | (not reftex-revisit-to-follow))) |
| 459 | (if data | 457 | (if reftex-select-data |
| 460 | (setq b (or (previous-single-property-change | 458 | (setq b (or (previous-single-property-change |
| 461 | (1+ (point)) :data) | 459 | (1+ (point)) :data) |
| 462 | (point-min)) | 460 | (point-min)) |
| @@ -470,7 +468,7 @@ During a selection process, these are the local bindings. | |||
| 470 | (not (pos-visible-in-window-p e))) | 468 | (not (pos-visible-in-window-p e))) |
| 471 | (recenter '(4))) | 469 | (recenter '(4))) |
| 472 | (unless (current-message) | 470 | (unless (current-message) |
| 473 | (princ prompt)))) | 471 | (princ reftex-select-prompt)))) |
| 474 | 472 | ||
| 475 | (defun reftex-select-next (&optional arg) | 473 | (defun reftex-select-next (&optional arg) |
| 476 | "Move to next selectable item." | 474 | "Move to next selectable item." |
| @@ -531,19 +529,22 @@ Useful for large TOC's." | |||
| 531 | (interactive) | 529 | (interactive) |
| 532 | (setq reftex-last-follow-point -1) | 530 | (setq reftex-last-follow-point -1) |
| 533 | (setq cb-flag (not cb-flag))) | 531 | (setq cb-flag (not cb-flag))) |
| 532 | |||
| 533 | (defvar reftex-refstyle) ; from reftex-reference | ||
| 534 | |||
| 534 | (defun reftex-select-toggle-varioref () | 535 | (defun reftex-select-toggle-varioref () |
| 535 | "Toggle the macro used for referencing the label between \\ref and \\vref." | 536 | "Toggle the macro used for referencing the label between \\ref and \\vref." |
| 536 | (interactive) | 537 | (interactive) |
| 537 | (if (string= refstyle "\\ref") | 538 | (if (string= reftex-refstyle "\\ref") |
| 538 | (setq refstyle "\\vref") | 539 | (setq reftex-refstyle "\\vref") |
| 539 | (setq refstyle "\\ref")) | 540 | (setq reftex-refstyle "\\ref")) |
| 540 | (force-mode-line-update)) | 541 | (force-mode-line-update)) |
| 541 | (defun reftex-select-toggle-fancyref () | 542 | (defun reftex-select-toggle-fancyref () |
| 542 | "Toggle the macro used for referencing the label between \\ref and \\vref." | 543 | "Toggle the macro used for referencing the label between \\ref and \\vref." |
| 543 | (interactive) | 544 | (interactive) |
| 544 | (setq refstyle | 545 | (setq reftex-refstyle |
| 545 | (cond ((string= refstyle "\\ref") "\\fref") | 546 | (cond ((string= reftex-refstyle "\\ref") "\\fref") |
| 546 | ((string= refstyle "\\fref") "\\Fref") | 547 | ((string= reftex-refstyle "\\fref") "\\Fref") |
| 547 | (t "\\ref"))) | 548 | (t "\\ref"))) |
| 548 | (force-mode-line-update)) | 549 | (force-mode-line-update)) |
| 549 | (defun reftex-select-show-insertion-point () | 550 | (defun reftex-select-show-insertion-point () |
| @@ -560,7 +561,7 @@ Useful for large TOC's." | |||
| 560 | (defun reftex-select-callback () | 561 | (defun reftex-select-callback () |
| 561 | "Show full context in another window." | 562 | "Show full context in another window." |
| 562 | (interactive) | 563 | (interactive) |
| 563 | (if data (funcall call-back data reftex-callback-fwd nil) (ding))) | 564 | (if reftex-select-data (funcall call-back reftex-select-data reftex-callback-fwd nil) (ding))) |
| 564 | (defun reftex-select-accept () | 565 | (defun reftex-select-accept () |
| 565 | "Accept the currently selected item." | 566 | "Accept the currently selected item." |
| 566 | (interactive) | 567 | (interactive) |
| @@ -569,8 +570,8 @@ Useful for large TOC's." | |||
| 569 | "Accept the item at the mouse click." | 570 | "Accept the item at the mouse click." |
| 570 | (interactive "e") | 571 | (interactive "e") |
| 571 | (mouse-set-point ev) | 572 | (mouse-set-point ev) |
| 572 | (setq data (get-text-property (point) :data)) | 573 | (setq reftex-select-data (get-text-property (point) :data)) |
| 573 | (setq last-data (or data last-data)) | 574 | (setq last-data (or reftex-select-data last-data)) |
| 574 | (throw 'myexit 'return)) | 575 | (throw 'myexit 'return)) |
| 575 | (defun reftex-select-read-label () | 576 | (defun reftex-select-read-label () |
| 576 | "Use minibuffer to read a label to reference, with completion." | 577 | "Use minibuffer to read a label to reference, with completion." |
| @@ -588,8 +589,8 @@ Useful for large TOC's." | |||
| 588 | (cond | 589 | (cond |
| 589 | ((or (null key) (equal key ""))) | 590 | ((or (null key) (equal key ""))) |
| 590 | (entry | 591 | (entry |
| 591 | (setq data entry) | 592 | (setq reftex-select-data entry) |
| 592 | (setq last-data data) | 593 | (setq last-data reftex-select-data) |
| 593 | (throw 'myexit 'return)) | 594 | (throw 'myexit 'return)) |
| 594 | (t (throw 'myexit key))))) | 595 | (t (throw 'myexit key))))) |
| 595 | 596 | ||
| @@ -736,5 +737,4 @@ Useful for large TOC's." | |||
| 736 | do (define-key reftex-select-bib-map (car x) (cdr x))) | 737 | do (define-key reftex-select-bib-map (car x) (cdr x))) |
| 737 | 738 | ||
| 738 | 739 | ||
| 739 | ;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464 | ||
| 740 | ;;; reftex-sel.el ends here | 740 | ;;; reftex-sel.el ends here |
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 496f9b4ddf3..20903706a0e 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el | |||
| @@ -545,7 +545,6 @@ Useful for large TOC's." | |||
| 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) |
| @@ -601,7 +600,9 @@ point." | |||
| 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 |
| @@ -643,12 +644,11 @@ point." | |||
| 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)) |
| @@ -684,7 +684,6 @@ promotion/demotion later." | |||
| 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))) |
| @@ -698,7 +697,7 @@ promotion/demotion later." | |||
| 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)) |