diff options
author | Glenn Morris <rgm@gnu.org> | 2009-08-22 19:29:18 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2009-08-22 19:29:18 +0000 |
commit | e6ce8c4239a0b7003430d94a5f591e1d4ad50213 (patch) | |
tree | 17852bba62da89f449af8c75f4fe50a3fb89852f /lisp/textmodes/reftex-sel.el | |
parent | a569b4801085fa14c3bd0d153e389636645908b9 (diff) | |
download | emacs-e6ce8c4239a0b7003430d94a5f591e1d4ad50213.tar.gz emacs-e6ce8c4239a0b7003430d94a5f591e1d4ad50213.tar.bz2 emacs-e6ce8c4239a0b7003430d94a5f591e1d4ad50213.zip |
Use forward-line rather than goto-line.
Diffstat (limited to 'lisp/textmodes/reftex-sel.el')
-rw-r--r-- | lisp/textmodes/reftex-sel.el | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el index e35ac10a6c9..f6f384fcb7d 100644 --- a/lisp/textmodes/reftex-sel.el +++ b/lisp/textmodes/reftex-sel.el @@ -39,7 +39,7 @@ started with the command \\[reftex-reference].") (defun reftex-select-label-mode () "Major mode for selecting a label in a LaTeX document. This buffer was created with RefTeX. -It only has a meaningful keymap when you are in the middle of a +It only has a meaningful keymap when you are in the middle of a selection process. To select a label, move the cursor to it and press RET. Press `?' for a summary of important key bindings. @@ -70,7 +70,7 @@ started with the command \\[reftex-citation].") (defun reftex-select-bib-mode () "Major mode for selecting a citation key in a LaTeX document. This buffer was created with RefTeX. -It only has a meaningful keymap when you are in the middle of a +It only has a meaningful keymap when you are in the middle of a selection process. In order to select a citation, move the cursor to it and press RET. Press `?' for a summary of important key bindings. @@ -263,7 +263,7 @@ During a selection process, these are the local bindings. note (nth 5 cell)) (when (and labels - (or (eq labels t) + (or (eq labels t) (string= typekey labels) (string= labels " ")) (or show-commented (null comment))) @@ -297,7 +297,7 @@ During a selection process, these are the local bindings. (put-text-property from to :data cell) (when mouse-face (put-text-property from (1- to) - 'mouse-face mouse-face)) + 'mouse-face mouse-face)) (goto-char to))) ((eq (car cell) 'index) @@ -315,7 +315,7 @@ During a selection process, these are the local bindings. (when font (setq to (point)) - (put-text-property + (put-text-property (- (point) (length (nth 7 cell))) to 'face index-face) (goto-char to)) @@ -328,10 +328,10 @@ During a selection process, these are the local bindings. (put-text-property from to :data cell) (when mouse-face (put-text-property from (1- to) - 'mouse-face mouse-face)) + 'mouse-face mouse-face)) (goto-char to)))) - (if (eq cell here-I-am) + (if (eq cell here-I-am) (setq offset 'attention)) (if (and prev-inserted (eq offset 'attention)) (setq offset prev-inserted)) @@ -358,11 +358,12 @@ During a selection process, these are the local bindings. ((listp loc) (setq pos (text-property-any (point-min) (point-max) :data loc)) (when pos - (goto-char pos) + (goto-char pos) (throw 'exit t))) ((integerp loc) (when (<= loc (count-lines (point-min) (point-max))) - (goto-line loc) + (goto-char (point-min)) + (forward-line (1- loc)) (throw 'exit t))))) (goto-char fallback)))) @@ -395,7 +396,7 @@ During a selection process, these are the local bindings. (setq truncate-lines t) ;; Find a good starting point - (reftex-find-start-point + (reftex-find-start-point (point-min) offset reftex-last-data reftex-last-line) (beginning-of-line 1) (set (make-local-variable 'reftex-last-follow-point) (point)) @@ -452,11 +453,11 @@ During a selection process, these are the local bindings. (let (b e) (setq data (get-text-property (point) :data)) (setq last-data (or data last-data)) - + (when (and data cb-flag (not (equal reftex-last-follow-point (point)))) (setq reftex-last-follow-point (point)) - (funcall call-back data reftex-callback-fwd + (funcall call-back data reftex-callback-fwd (not reftex-revisit-to-follow))) (if data (setq b (or (previous-single-property-change @@ -525,7 +526,8 @@ Useful for large TOC's." (goto-char pos)) ((and (local-variable-p 'reftex-last-line (current-buffer)) (integerp reftex-last-line)) - (goto-line reftex-last-line)) + (goto-char (point-min)) + (forward-line (1- reftex-last-line))) (t (ding))))) (defun reftex-select-toggle-follow () "Toggle follow mode: Other window follows with full context." @@ -576,7 +578,7 @@ Useful for large TOC's." (defun reftex-select-read-label () "Use minibuffer to read a label to reference, with completion." (interactive) - (let ((label (completing-read + (let ((label (completing-read "Label: " (symbol-value reftex-docstruct-symbol) nil nil reftex-prefix))) (unless (or (equal label "") (equal label reftex-prefix)) @@ -676,7 +678,7 @@ Useful for large TOC's." ([(up)] . reftex-select-previous) ("f" . reftex-select-toggle-follow) ("\C-m" . reftex-select-accept) - ([(return)] . reftex-select-accept) + ([(return)] . reftex-select-accept) ("q" . reftex-select-quit) ("." . reftex-select-show-insertion-point) ("?" . reftex-select-help)) @@ -687,7 +689,7 @@ Useful for large TOC's." (define-key map [(button2)] 'reftex-select-mouse-accept) (define-key map [(mouse-2)] 'reftex-select-mouse-accept) (define-key map [follow-link] 'mouse-face)) - + ;; Digit arguments (loop for key across "0123456789" do @@ -701,7 +703,7 @@ Useful for large TOC's." ;; Specific bindings in reftex-select-label-map (loop for key across "aAcgFlrRstx#%" do (define-key reftex-select-label-map (vector (list key)) - (list 'lambda '() + (list 'lambda '() "Press `?' during selection to find out about this key." '(interactive) (list 'throw '(quote myexit) key)))) @@ -725,7 +727,7 @@ Useful for large TOC's." ;; Specific bindings in reftex-select-bib-map (loop for key across "grRaAeE" do (define-key reftex-select-bib-map (vector (list key)) - (list 'lambda '() + (list 'lambda '() "Press `?' during selection to find out about this key." '(interactive) (list 'throw '(quote myexit) key)))) @@ -735,7 +737,7 @@ Useful for large TOC's." ("m" . reftex-select-mark) ("u" . reftex-select-unmark)) do (define-key reftex-select-bib-map (car x) (cdr x))) - + ;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464 ;;; reftex-sel.el ends here |