1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-26 19:18:50 +00:00

Use forward-line rather than goto-line.

This commit is contained in:
Glenn Morris 2009-08-22 19:29:18 +00:00
parent a569b48010
commit e6ce8c4239
24 changed files with 207 additions and 112 deletions

View File

@ -1,3 +1,50 @@
2009-08-22 Glenn Morris <rgm@gnu.org>
* bs.el (bs--redisplay):
* cus-edit.el (custom-redraw):
* ibuffer.el (ibuffer-bury-buffer):
* server.el (server-goto-line-column):
* startup.el (command-line-1):
* strokes.el (strokes-xpm-for-stroke):
* term.el (term-display-buffer-line):
* view.el (View-goto-line):
* calc/calc.el (calc-do, calc-trail-buffer):
* play/gamegrid.el (gamegrid-add-score-insecure):
* progmodes/ada-mode.el (ada-compile-goto-error):
* progmodes/ada-xref.el (ada-xref-find-in-modified-ali):
(ebrowse-select-1st-to-9nth):
* progmodes/ebrowse.el (ebrowse-toggle-file-name-display)
* progmodes/gud.el (gud-display-line):
(idlwave-shell-display-line):
* progmodes/idlw-shell.el (idlwave-shell-goto-frame)
* progmodes/make-mode.el (makefile-browser-toggle):
(vhdl-speedbar-port-copy, vhdl-compose-components-package):
* progmodes/vhdl-mode.el (vhdl-speedbar-find-file)
* textmodes/picture.el (picture-draw-rectangle):
* textmodes/reftex-index.el (reftex-index-goto-letter):
(reftex-select-jump-to-previous):
* textmodes/reftex-sel.el (reftex-find-start-point)
* textmodes/reftex-toc.el (reftex-toc, reftex-toc-restore-region):
(rst-straighten-deco-spacing, rst-section-tree, rst-toc):
* textmodes/rst.el (rst-promote-region, rst-straighten-decorations)
* textmodes/tex-mode.el (tex-compilation-parse-errors):
* textmodes/two-column.el (2C-associated-buffer):
Use forward-line rather than goto-line.
* emulation/vi.el (vi-goto-line): Don't warn about non-interactive
goto-line.
* international/ucs-normalize.el (nfd)
(decomposition-translation-alist, decomposition-char-recursively)
(alist-list-to-vector, quick-check-list, quick-check-list-to-regexp):
Declare.
* progmodes/make-mode.el (makefile-browser-insert-selection): Use
goto-char rather than goto-line.
* progmodes/prolog.el (compilation-error-regexp-alist)
(compilation-forget-errors): Declare.
2009-08-22 Juri Linkov <juri@jurta.org> 2009-08-22 Juri Linkov <juri@jurta.org>
* progmodes/grep.el (lgrep, rgrep): At the beginning * progmodes/grep.el (lgrep, rgrep): At the beginning

View File

@ -1,7 +1,7 @@
;;; bs.el --- menu for selecting and displaying buffers ;;; bs.el --- menu for selecting and displaying buffers
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de> ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de> ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
;; Keywords: convenience ;; Keywords: convenience
@ -575,10 +575,11 @@ a special function. SORT-DESCRIPTION is an element of `bs-sort-functions'."
"Redisplay whole Buffer Selection Menu. "Redisplay whole Buffer Selection Menu.
If KEEP-LINE-P is non-nil the point will stay on current line. If KEEP-LINE-P is non-nil the point will stay on current line.
SORT-DESCRIPTION is an element of `bs-sort-functions'." SORT-DESCRIPTION is an element of `bs-sort-functions'."
(let ((line (1+ (count-lines 1 (point))))) (let ((line (count-lines 1 (point))))
(bs-show-in-buffer (bs-buffer-list nil sort-description)) (bs-show-in-buffer (bs-buffer-list nil sort-description))
(when keep-line-p (when keep-line-p
(goto-line line)) (goto-char (point-min))
(forward-line line))
(beginning-of-line))) (beginning-of-line)))
(defun bs--goto-current-buffer () (defun bs--goto-current-buffer ()

View File

@ -1,7 +1,7 @@
;;; calc.el --- the GNU Emacs calculator ;;; calc.el --- the GNU Emacs calculator
;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, 2005,
;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com> ;; Author: David Gillespie <daveg@synaptics.com>
;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com> ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
@ -1615,11 +1615,13 @@ See calc-keypad for details."
(and (memq 'position-point calc-command-flags) (and (memq 'position-point calc-command-flags)
(if (eq major-mode 'calc-mode) (if (eq major-mode 'calc-mode)
(progn (progn
(goto-line calc-final-point-line) (goto-char (point-min))
(forward-line (1- calc-final-point-line))
(move-to-column calc-final-point-column)) (move-to-column calc-final-point-column))
(save-current-buffer (save-current-buffer
(calc-select-buffer) (calc-select-buffer)
(goto-line calc-final-point-line) (goto-char (point-min))
(forward-line (1- calc-final-point-line))
(move-to-column calc-final-point-column)))) (move-to-column calc-final-point-column))))
(unless (memq 'keep-flags calc-command-flags) (unless (memq 'keep-flags calc-command-flags)
(save-excursion (save-excursion
@ -2019,7 +2021,8 @@ See calc-keypad for details."
(eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) (eq (marker-buffer calc-trail-pointer) calc-trail-buffer))
(save-excursion (save-excursion
(set-buffer calc-trail-buffer) (set-buffer calc-trail-buffer)
(goto-line 2) (goto-char (point-min))
(forward-line 1)
(setq calc-trail-pointer (point-marker)))) (setq calc-trail-pointer (point-marker))))
calc-trail-buffer) calc-trail-buffer)

View File

@ -2192,9 +2192,10 @@ and `face'."
(when (and (>= pos from) (<= pos to)) (when (and (>= pos from) (<= pos to))
(condition-case nil (condition-case nil
(progn (progn
(if (> column 0) (goto-char (point-min))
(goto-line line) (forward-line (if (> column 0)
(goto-line (1+ line))) (1- line)
line))
(move-to-column column)) (move-to-column column))
(error nil))))) (error nil)))))

View File

@ -1,7 +1,7 @@
;;; ibuffer.el --- operate on buffers like dired ;;; ibuffer.el --- operate on buffers like dired
;; Copyright (C) 2000, 2001, 2002, 2003, 2004, ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; 2009 Free Software Foundation, Inc.
;; Author: Colin Walters <walters@verbum.org> ;; Author: Colin Walters <walters@verbum.org>
;; Maintainer: John Paul Wallington <jpw@gnu.org> ;; Maintainer: John Paul Wallington <jpw@gnu.org>
@ -1093,7 +1093,8 @@ one window."
(line (+ 1 (count-lines 1 (point))))) (line (+ 1 (count-lines 1 (point)))))
(bury-buffer buf) (bury-buffer buf)
(ibuffer-update nil t) (ibuffer-update nil t)
(goto-line line))) (goto-char (point-min))
(forward-line (1- line))))
(defun ibuffer-visit-tags-table () (defun ibuffer-visit-tags-table ()
"Visit the tags table in the buffer on this line. See `visit-tags-table'." "Visit the tags table in the buffer on this line. See `visit-tags-table'."

View File

@ -586,7 +586,8 @@ FILE is created there."
(t "")))) (t ""))))
(sort-fields 1 (point-min) (point-max)) (sort-fields 1 (point-min) (point-max))
(reverse-region (point-min) (point-max)) (reverse-region (point-min) (point-max))
(goto-line (1+ gamegrid-score-file-length)) (goto-char (point-min))
(forward-line gamegrid-score-file-length)
(delete-region (point) (point-max)) (delete-region (point) (point-max))
(setq buffer-read-only t) (setq buffer-read-only t)
(save-buffer))) (save-buffer)))

View File

@ -1,7 +1,7 @@
;;; ada-mode.el --- major-mode for editing Ada sources ;;; ada-mode.el --- major-mode for editing Ada sources
;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Rolf Ebert <ebert@inf.enst.fr> ;; Author: Rolf Ebert <ebert@inf.enst.fr>
;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
@ -229,6 +229,8 @@ It may be `downcase-word', `upcase-word', `ada-loose-case-word' or
(const ada-no-auto-case)) (const ada-no-auto-case))
:group 'ada) :group 'ada)
;; FIXME If this is not something required by the ada language, this
;; should be removed.
(defcustom ada-clean-buffer-before-saving t (defcustom ada-clean-buffer-before-saving t
"*Non-nil means remove trailing spaces and untabify the buffer before saving." "*Non-nil means remove trailing spaces and untabify the buffer before saving."
:type 'boolean :group 'ada) :type 'boolean :group 'ada)
@ -793,8 +795,9 @@ the 4 file locations can be clicked on and jumped to."
(compilation-find-file (point-marker) (match-string 1) "./") (compilation-find-file (point-marker) (match-string 1) "./")
(set-buffer file) (set-buffer file)
(if (stringp line) (when (stringp line)
(goto-line (string-to-number line))) (goto-char (point-min))
(forward-line (1- (string-to-number line))))
(setq source (point-marker))) (setq source (point-marker)))

View File

@ -1,7 +1,7 @@
;; ada-xref.el --- for lookup and completion in Ada mode ;; ada-xref.el --- for lookup and completion in Ada mode
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> ;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
;; Rolf Ebert <ebert@inf.enst.fr> ;; Rolf Ebert <ebert@inf.enst.fr>
@ -1901,7 +1901,8 @@ This function is disabled for operators, and only works for identifiers."
(ada-name-of identlist))) (ada-name-of identlist)))
;; one => should be the right one ;; one => should be the right one
((= len 1) ((= len 1)
(goto-line (caar declist))) (goto-char (point-min))
(forward-line (1- (caar declist))))
;; more than one => display choice list ;; more than one => display choice list
(t (t
@ -1937,7 +1938,8 @@ This function is disabled for operators, and only works for identifiers."
(read-from-minibuffer "Enter No. of your choice: ")))) (read-from-minibuffer "Enter No. of your choice: "))))
) )
(set-buffer ali-buffer) (set-buffer ali-buffer)
(goto-line (car (nth (1- choice) declist))) (goto-char (point-min))
(forward-line (1- (car (nth (1- choice) declist))))
)))))) ))))))
@ -2166,7 +2168,8 @@ If OTHER-FRAME is non-nil, creates a new frame to show the file."
;; move the cursor to the correct position ;; move the cursor to the correct position
(push-mark) (push-mark)
(goto-line line) (goto-char (point-min))
(forward-line (1- line))
(move-to-column column) (move-to-column column)
;; If we are not on the identifier, the ali file was not up-to-date. ;; If we are not on the identifier, the ali file was not up-to-date.

View File

@ -1,7 +1,7 @@
;;; ebrowse.el --- Emacs C++ class browser & tags facility ;;; ebrowse.el --- Emacs C++ class browser & tags facility
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 ;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation Inc. ;; Free Software Foundation Inc.
;; Author: Gerd Moellmann <gerd@gnu.org> ;; Author: Gerd Moellmann <gerd@gnu.org>
@ -1337,7 +1337,8 @@ With PREFIX, insert that many filenames."
(setf ebrowse--show-file-names-flag (not ebrowse--show-file-names-flag)) (setf ebrowse--show-file-names-flag (not ebrowse--show-file-names-flag))
(let ((old-line (count-lines (point-min) (point)))) (let ((old-line (count-lines (point-min) (point))))
(ebrowse-redraw-tree) (ebrowse-redraw-tree)
(goto-line old-line))) (goto-char (point-min))
(forward-line (1- old-line))))
@ -4316,7 +4317,8 @@ NUMBER-OF-STATIC-VARIABLES:"
(interactive) (interactive)
(let* ((maxlin (count-lines (point-min) (point-max))) (let* ((maxlin (count-lines (point-min) (point-max)))
(n (min maxlin (+ 2 (string-to-number (this-command-keys)))))) (n (min maxlin (+ 2 (string-to-number (this-command-keys))))))
(goto-line n) (goto-char (point-min))
(forward-line (1- n))
(throw 'electric-buffer-menu-select (point)))) (throw 'electric-buffer-menu-select (point))))

View File

@ -1,12 +1,12 @@
;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers ;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Eric S. Raymond <esr@snark.thyrsus.com> ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Maintainer: FSF ;; Maintainer: FSF
;; Keywords: unix, tools ;; Keywords: unix, tools
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify ;; GNU Emacs is free software: you can redistribute it and/or modify
@ -2715,7 +2715,8 @@ Obeying it means displaying in another window the specified file and line."
(setq gud-keep-buffer t))) (setq gud-keep-buffer t)))
(save-restriction (save-restriction
(widen) (widen)
(goto-line line) (goto-char (point-min))
(forward-line (1- line))
(setq pos (point)) (setq pos (point))
(or gud-overlay-arrow-position (or gud-overlay-arrow-position
(setq gud-overlay-arrow-position (make-marker))) (setq gud-overlay-arrow-position (make-marker)))

View File

@ -1,7 +1,7 @@
;; idlw-shell.el --- run IDL as an inferior process of Emacs. ;; idlw-shell.el --- run IDL as an inferior process of Emacs.
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
;; Free Software Foundation, Inc. ;; 2009 Free Software Foundation, Inc.
;; Authors: J.D. Smith <jdsmith@as.arizona.edu> ;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@astro.uva.nl> ;; Carsten Dominik <dominik@astro.uva.nl>
@ -2317,7 +2317,8 @@ used. Does nothing if the resulting frame is nil."
(frame (frame
(set-buffer (idlwave-find-file-noselect (car frame) 'shell)) (set-buffer (idlwave-find-file-noselect (car frame) 'shell))
(widen) (widen)
(goto-line (nth 1 frame))))) (goto-char (point-min))
(forward-line (1- (nth 1 frame))))))
(defun idlwave-shell-pc-frame () (defun idlwave-shell-pc-frame ()
"Returns the frame for IDL execution." "Returns the frame for IDL execution."
@ -2388,8 +2389,8 @@ matter what the settings of that variable."
(set-buffer buffer) (set-buffer buffer)
(save-restriction (save-restriction
(widen) (widen)
(goto-line (nth 1 frame)) (goto-char (point-min))
(forward-line 0) (forward-line (1- (nth 1 frame)))
(setq pos (point)) (setq pos (point))
(setq idlwave-shell-is-stopped t) (setq idlwave-shell-is-stopped t)

View File

@ -15152,7 +15152,8 @@ is already shown in a buffer."
(let ((buffer (get-file-buffer (car token)))) (let ((buffer (get-file-buffer (car token))))
(speedbar-find-file-in-frame (car token)) (speedbar-find-file-in-frame (car token))
(when (or vhdl-speedbar-jump-to-unit buffer) (when (or vhdl-speedbar-jump-to-unit buffer)
(goto-line (cdr token)) (goto-char (point-min))
(forward-line (1- (cdr token)))
(recenter)) (recenter))
(vhdl-speedbar-update-current-unit t t) (vhdl-speedbar-update-current-unit t t)
(speedbar-set-timer dframe-update-speed) (speedbar-set-timer dframe-update-speed)
@ -15170,7 +15171,8 @@ is already shown in a buffer."
(let ((token (get-text-property (let ((token (get-text-property
(match-beginning 3) 'speedbar-token))) (match-beginning 3) 'speedbar-token)))
(vhdl-visit-file (car token) t (vhdl-visit-file (car token) t
(progn (goto-line (cdr token)) (progn (goto-char (point-min))
(forward-line (1- (cdr token)))
(end-of-line) (end-of-line)
(if is-entity (if is-entity
(vhdl-port-copy) (vhdl-port-copy)
@ -15919,7 +15921,8 @@ current project/directory."
;; insert component declarations ;; insert component declarations
(while ent-alist (while ent-alist
(vhdl-visit-file (nth 2 (car ent-alist)) nil (vhdl-visit-file (nth 2 (car ent-alist)) nil
(progn (goto-line (nth 3 (car ent-alist))) (progn (goto-char (point-min))
(forward-line (1- (nth 3 (car ent-alist))))
(end-of-line) (end-of-line)
(vhdl-port-copy))) (vhdl-port-copy)))
(goto-char component-pos) (goto-char component-pos)

View File

@ -1,7 +1,8 @@
;;; server.el --- Lisp code for GNU Emacs running as server process ;;; server.el --- Lisp code for GNU Emacs running as server process
;; Copyright (C) 1986, 1987, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ;; Copyright (C) 1986, 1987, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation, Inc.
;; Author: William Sommerfeld <wesommer@athena.mit.edu> ;; Author: William Sommerfeld <wesommer@athena.mit.edu>
;; Maintainer: FSF ;; Maintainer: FSF
@ -1098,7 +1099,8 @@ The following commands are accepted by the client:
"Move point to the position indicated in LINE-COL. "Move point to the position indicated in LINE-COL.
LINE-COL should be a pair (LINE . COL)." LINE-COL should be a pair (LINE . COL)."
(when line-col (when line-col
(goto-line (car line-col)) (goto-char (point-min))
(forward-line (1- (car line-col)))
(let ((column-number (cdr line-col))) (let ((column-number (cdr line-col)))
(when (> column-number 0) (when (> column-number 0)
(move-to-column (1- column-number)))))) (move-to-column (1- column-number))))))

View File

@ -2258,8 +2258,9 @@ A fancy display is used on graphic displays, normal otherwise."
(if (= file-count 1) (if (= file-count 1)
(setq first-file-buffer (find-file file)) (setq first-file-buffer (find-file file))
(find-file-other-window file))) (find-file-other-window file)))
(or (zerop line) (unless (zerop line)
(goto-line line)) (goto-char (point-min))
(forward-line (1- line)))
(setq line 0) (setq line 0)
(unless (< column 1) (unless (< column 1)
(move-to-column (1- column))) (move-to-column (1- column)))
@ -2292,8 +2293,9 @@ A fancy display is used on graphic displays, normal otherwise."
(inhibit-startup-screen (inhibit-startup-screen
(find-file-other-window file)) (find-file-other-window file))
(t (find-file file)))) (t (find-file file))))
(or (zerop line) (unless (zerop line)
(goto-line line)) (goto-char (point-min))
(forward-line (1- line)))
(setq line 0) (setq line 0)
(unless (< column 1) (unless (< column 1)
(move-to-column (1- column))) (move-to-column (1- column)))

View File

@ -1187,14 +1187,16 @@ the stroke as a character in some language."
(let ((char (or (car rainbow-chars) ?\.))) (let ((char (or (car rainbow-chars) ?\.)))
(loop for i from 0 to 2 do (loop for i from 0 to 2 do
(loop for j from 0 to 2 do (loop for j from 0 to 2 do
(goto-line (+ 16 i y)) (goto-char (point-min))
(forward-line (+ 15 i y))
(forward-char (+ 1 j x)) (forward-char (+ 1 j x))
(delete-char 1) (delete-char 1)
(insert char))) (insert char)))
(setq rainbow-chars (cdr rainbow-chars) (setq rainbow-chars (cdr rainbow-chars)
lift-flag nil)) lift-flag nil))
;; Otherwise, just plot the point... ;; Otherwise, just plot the point...
(goto-line (+ 17 y)) (goto-char (point-min))
(forward-line (+ 16 y))
(forward-char (+ 2 x)) (forward-char (+ 2 x))
(subst-char-in-region (point) (1+ (point)) ?\s ?\*))) (subst-char-in-region (point) (1+ (point)) ?\s ?\*)))
((strokes-lift-p point) ((strokes-lift-p point)

View File

@ -3465,7 +3465,8 @@ The top-most line is line 0."
(set-buffer buffer) (set-buffer buffer)
(save-restriction (save-restriction
(widen) (widen)
(goto-line line) (goto-char (point-min))
(forward-line (1- line))
(setq pos (point)) (setq pos (point))
(setq overlay-arrow-string "=>") (setq overlay-arrow-string "=>")
(or overlay-arrow-position (or overlay-arrow-position

View File

@ -1,7 +1,7 @@
;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model
;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, ;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; 2008, 2009 Free Software Foundation, Inc.
;; Author: K. Shane Hartman ;; Author: K. Shane Hartman
;; Maintainer: FSF ;; Maintainer: FSF
@ -559,7 +559,8 @@ Leaves the region surrounding the rectangle."
(left (min c1 c2)) (left (min c1 c2))
(top (min r1 r2)) (top (min r1 r2))
(bottom (max r1 r2))) (bottom (max r1 r2)))
(goto-line top) (goto-char (point-min))
(forward-line (1- top))
(move-to-column left t) (move-to-column left t)
(picture-update-desired-column t) (picture-update-desired-column t)
@ -580,7 +581,8 @@ Leaves the region surrounding the rectangle."
(picture-insert picture-rectangle-v (- (picture-current-line) top)) (picture-insert picture-rectangle-v (- (picture-current-line) top))
(picture-set-motion pvs phs) (picture-set-motion pvs phs)
(goto-line sl) (goto-char (point-min))
(forward-line (1- sl))
(move-to-column sc t))) (move-to-column sc t)))

View File

@ -1088,7 +1088,8 @@ When index is restricted, select the previous section as restriction criterion."
"Go to the CHAR section in the index." "Go to the CHAR section in the index."
(let ((pos (point)) (let ((pos (point))
(case-fold-search nil)) (case-fold-search nil))
(goto-line 3) (goto-char (point-min))
(forward-line 2)
(if (re-search-forward (concat "^" (char-to-string char)) nil t) (if (re-search-forward (concat "^" (char-to-string char)) nil t)
(progn (progn
(beginning-of-line) (beginning-of-line)

View File

@ -39,7 +39,7 @@ started with the command \\[reftex-reference].")
(defun reftex-select-label-mode () (defun reftex-select-label-mode ()
"Major mode for selecting a label in a LaTeX document. "Major mode for selecting a label in a LaTeX document.
This buffer was created with RefTeX. 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. selection process.
To select a label, move the cursor to it and press RET. To select a label, move the cursor to it and press RET.
Press `?' for a summary of important key bindings. Press `?' for a summary of important key bindings.
@ -70,7 +70,7 @@ started with the command \\[reftex-citation].")
(defun reftex-select-bib-mode () (defun reftex-select-bib-mode ()
"Major mode for selecting a citation key in a LaTeX document. "Major mode for selecting a citation key in a LaTeX document.
This buffer was created with RefTeX. 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. selection process.
In order to select a citation, move the cursor to it and press RET. In order to select a citation, move the cursor to it and press RET.
Press `?' for a summary of important key bindings. 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)) note (nth 5 cell))
(when (and labels (when (and labels
(or (eq labels t) (or (eq labels t)
(string= typekey labels) (string= typekey labels)
(string= labels " ")) (string= labels " "))
(or show-commented (null comment))) (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) (put-text-property from to :data cell)
(when mouse-face (when mouse-face
(put-text-property from (1- to) (put-text-property from (1- to)
'mouse-face mouse-face)) 'mouse-face mouse-face))
(goto-char to))) (goto-char to)))
((eq (car cell) 'index) ((eq (car cell) 'index)
@ -315,7 +315,7 @@ During a selection process, these are the local bindings.
(when font (when font
(setq to (point)) (setq to (point))
(put-text-property (put-text-property
(- (point) (length (nth 7 cell))) to (- (point) (length (nth 7 cell))) to
'face index-face) 'face index-face)
(goto-char to)) (goto-char to))
@ -328,10 +328,10 @@ During a selection process, these are the local bindings.
(put-text-property from to :data cell) (put-text-property from to :data cell)
(when mouse-face (when mouse-face
(put-text-property from (1- to) (put-text-property from (1- to)
'mouse-face mouse-face)) 'mouse-face mouse-face))
(goto-char to)))) (goto-char to))))
(if (eq cell here-I-am) (if (eq cell here-I-am)
(setq offset 'attention)) (setq offset 'attention))
(if (and prev-inserted (eq offset 'attention)) (if (and prev-inserted (eq offset 'attention))
(setq offset prev-inserted)) (setq offset prev-inserted))
@ -358,11 +358,12 @@ During a selection process, these are the local bindings.
((listp loc) ((listp loc)
(setq pos (text-property-any (point-min) (point-max) :data loc)) (setq pos (text-property-any (point-min) (point-max) :data loc))
(when pos (when pos
(goto-char pos) (goto-char pos)
(throw 'exit t))) (throw 'exit t)))
((integerp loc) ((integerp loc)
(when (<= loc (count-lines (point-min) (point-max))) (when (<= loc (count-lines (point-min) (point-max)))
(goto-line loc) (goto-char (point-min))
(forward-line (1- loc))
(throw 'exit t))))) (throw 'exit t)))))
(goto-char fallback)))) (goto-char fallback))))
@ -395,7 +396,7 @@ During a selection process, these are the local bindings.
(setq truncate-lines t) (setq truncate-lines t)
;; Find a good starting point ;; Find a good starting point
(reftex-find-start-point (reftex-find-start-point
(point-min) offset reftex-last-data reftex-last-line) (point-min) offset reftex-last-data reftex-last-line)
(beginning-of-line 1) (beginning-of-line 1)
(set (make-local-variable 'reftex-last-follow-point) (point)) (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) (let (b e)
(setq data (get-text-property (point) :data)) (setq data (get-text-property (point) :data))
(setq last-data (or data last-data)) (setq last-data (or data last-data))
(when (and data cb-flag (when (and data cb-flag
(not (equal reftex-last-follow-point (point)))) (not (equal reftex-last-follow-point (point))))
(setq 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))) (not reftex-revisit-to-follow)))
(if data (if data
(setq b (or (previous-single-property-change (setq b (or (previous-single-property-change
@ -525,7 +526,8 @@ Useful for large TOC's."
(goto-char pos)) (goto-char pos))
((and (local-variable-p 'reftex-last-line (current-buffer)) ((and (local-variable-p 'reftex-last-line (current-buffer))
(integerp reftex-last-line)) (integerp reftex-last-line))
(goto-line reftex-last-line)) (goto-char (point-min))
(forward-line (1- reftex-last-line)))
(t (ding))))) (t (ding)))))
(defun reftex-select-toggle-follow () (defun reftex-select-toggle-follow ()
"Toggle follow mode: Other window follows with full context." "Toggle follow mode: Other window follows with full context."
@ -576,7 +578,7 @@ Useful for large TOC's."
(defun reftex-select-read-label () (defun reftex-select-read-label ()
"Use minibuffer to read a label to reference, with completion." "Use minibuffer to read a label to reference, with completion."
(interactive) (interactive)
(let ((label (completing-read (let ((label (completing-read
"Label: " (symbol-value reftex-docstruct-symbol) "Label: " (symbol-value reftex-docstruct-symbol)
nil nil reftex-prefix))) nil nil reftex-prefix)))
(unless (or (equal label "") (equal label reftex-prefix)) (unless (or (equal label "") (equal label reftex-prefix))
@ -676,7 +678,7 @@ Useful for large TOC's."
([(up)] . reftex-select-previous) ([(up)] . reftex-select-previous)
("f" . reftex-select-toggle-follow) ("f" . reftex-select-toggle-follow)
("\C-m" . reftex-select-accept) ("\C-m" . reftex-select-accept)
([(return)] . reftex-select-accept) ([(return)] . reftex-select-accept)
("q" . reftex-select-quit) ("q" . reftex-select-quit)
("." . reftex-select-show-insertion-point) ("." . reftex-select-show-insertion-point)
("?" . reftex-select-help)) ("?" . reftex-select-help))
@ -687,7 +689,7 @@ Useful for large TOC's."
(define-key map [(button2)] 'reftex-select-mouse-accept) (define-key map [(button2)] 'reftex-select-mouse-accept)
(define-key map [(mouse-2)] 'reftex-select-mouse-accept) (define-key map [(mouse-2)] 'reftex-select-mouse-accept)
(define-key map [follow-link] 'mouse-face)) (define-key map [follow-link] 'mouse-face))
;; Digit arguments ;; Digit arguments
(loop for key across "0123456789" do (loop for key across "0123456789" do
@ -701,7 +703,7 @@ Useful for large TOC's."
;; Specific bindings in reftex-select-label-map ;; Specific bindings in reftex-select-label-map
(loop for key across "aAcgFlrRstx#%" do (loop for key across "aAcgFlrRstx#%" do
(define-key reftex-select-label-map (vector (list key)) (define-key reftex-select-label-map (vector (list key))
(list 'lambda '() (list 'lambda '()
"Press `?' during selection to find out about this key." "Press `?' during selection to find out about this key."
'(interactive) (list 'throw '(quote myexit) key)))) '(interactive) (list 'throw '(quote myexit) key))))
@ -725,7 +727,7 @@ Useful for large TOC's."
;; Specific bindings in reftex-select-bib-map ;; Specific bindings in reftex-select-bib-map
(loop for key across "grRaAeE" do (loop for key across "grRaAeE" do
(define-key reftex-select-bib-map (vector (list key)) (define-key reftex-select-bib-map (vector (list key))
(list 'lambda '() (list 'lambda '()
"Press `?' during selection to find out about this key." "Press `?' during selection to find out about this key."
'(interactive) (list 'throw '(quote myexit) key)))) '(interactive) (list 'throw '(quote myexit) key))))
@ -735,7 +737,7 @@ Useful for large TOC's."
("m" . reftex-select-mark) ("m" . reftex-select-mark)
("u" . reftex-select-unmark)) ("u" . reftex-select-unmark))
do (define-key reftex-select-bib-map (car x) (cdr x))) do (define-key reftex-select-bib-map (car x) (cdr x)))
;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464 ;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464
;;; reftex-sel.el ends here ;;; reftex-sel.el ends here

View File

@ -1,6 +1,7 @@
;;; reftex-toc.el --- RefTeX's table of contents mode ;;; reftex-toc.el --- RefTeX's table of contents mode
;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005,
;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007,
;; 2008, 2009 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl> ;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org ;; Maintainer: auctex-devel@gnu.org
@ -149,7 +150,7 @@ When called with a raw C-u prefix, rescan the document first."
(frame-parameter (selected-frame) 'unsplittable))) (frame-parameter (selected-frame) 'unsplittable)))
offset toc-window) offset toc-window)
(if (setq toc-window (get-buffer-window (if (setq toc-window (get-buffer-window
"*toc*" "*toc*"
(if reuse 'visible))) (if reuse 'visible)))
(select-window toc-window) (select-window toc-window)
@ -165,7 +166,7 @@ When called with a raw C-u prefix, rescan the document first."
(split-window-horizontally (split-window-horizontally
(floor (* (window-width) (floor (* (window-width)
reftex-toc-split-windows-fraction))) reftex-toc-split-windows-fraction)))
(split-window-vertically (split-window-vertically
(floor (* (window-height) (floor (* (window-height)
reftex-toc-split-windows-fraction))))) reftex-toc-split-windows-fraction)))))
@ -210,11 +211,11 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
reftex-toc-include-context reftex-toc-include-context
nil ; counter nil ; counter
nil ; commented nil ; commented
here-I-am here-I-am
"" ; xr-prefix "" ; xr-prefix
t ; a toc buffer t ; a toc buffer
)) ))
(run-hooks 'reftex-display-copied-context-hook) (run-hooks 'reftex-display-copied-context-hook)
(message "Building *toc* buffer...done.") (message "Building *toc* buffer...done.")
(setq buffer-read-only t)) (setq buffer-read-only t))
@ -226,12 +227,12 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
t t
reftex-toc-include-index-entries reftex-toc-include-index-entries
reftex-toc-include-file-boundaries) reftex-toc-include-file-boundaries)
(reftex-last-assoc-before-elt (reftex-last-assoc-before-elt
'toc here-I-am 'toc here-I-am
(symbol-value reftex-docstruct-symbol)))) (symbol-value reftex-docstruct-symbol))))
(put 'reftex-toc :reftex-line 3) (put 'reftex-toc :reftex-line 3)
(goto-line 3) (goto-char (point-min))
(beginning-of-line))) (forward-line 2)))
;; Find the correct starting point ;; Find the correct starting point
(reftex-find-start-point (point) offset (get 'reftex-toc :reftex-line)) (reftex-find-start-point (point) offset (get 'reftex-toc :reftex-line))
@ -251,7 +252,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
(not (get-text-property (point) 'intangible)) (not (get-text-property (point) 'intangible))
(memq reftex-highlight-selection '(cursor both)) (memq reftex-highlight-selection '(cursor both))
(reftex-highlight 2 (reftex-highlight 2
(or (previous-single-property-change (or (previous-single-property-change
(min (point-max) (1+ (point))) :data) (min (point-max) (1+ (point))) :data)
(point-min)) (point-min))
(or (next-single-property-change (point) :data) (or (next-single-property-change (point) :data)
@ -298,10 +299,10 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
(window-height)))))) (window-height))))))
(defun reftex-toc-dframe-p (&optional frame error) (defun reftex-toc-dframe-p (&optional frame error)
;; Check if FRAME is the dedicated TOC frame. ;; Check if FRAME is the dedicated TOC frame.
;; If yes, and ERROR is non-nil, throw an error. ;; If yes, and ERROR is non-nil, throw an error.
(setq frame (or frame (selected-frame))) (setq frame (or frame (selected-frame)))
(let ((res (equal (let ((res (equal
(if (fboundp 'frame-property) (if (fboundp 'frame-property)
(frame-property frame 'name) (frame-property frame 'name)
(frame-parameter frame 'name)) (frame-parameter frame 'name))
@ -327,7 +328,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
(when (featurep 'xemacs) (setq zmacs-region-stays t)) (when (featurep 'xemacs) (setq zmacs-region-stays t))
(setq reftex-callback-fwd t) (setq reftex-callback-fwd t)
(or (eobp) (forward-char 1)) (or (eobp) (forward-char 1))
(goto-char (or (next-single-property-change (point) :data) (goto-char (or (next-single-property-change (point) :data)
(point)))) (point))))
(defun reftex-toc-previous (&optional arg) (defun reftex-toc-previous (&optional arg)
"Move to previous selectable item." "Move to previous selectable item."
@ -364,7 +365,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
With prefix ARG, prompt for a label type and include only labels of With prefix ARG, prompt for a label type and include only labels of
that specific type." that specific type."
(interactive "P") (interactive "P")
(setq reftex-toc-include-labels (setq reftex-toc-include-labels
(if arg (reftex-query-label-type) (if arg (reftex-query-label-type)
(not reftex-toc-include-labels))) (not reftex-toc-include-labels)))
(reftex-toc-revert)) (reftex-toc-revert))
@ -468,7 +469,7 @@ With prefix arg 1, restrict index to the section at point."
(defun reftex-toc-rescan (&rest ignore) (defun reftex-toc-rescan (&rest ignore)
"Regenerate the *toc* buffer by reparsing file of section at point." "Regenerate the *toc* buffer by reparsing file of section at point."
(interactive) (interactive)
(if (and reftex-enable-partial-scans (if (and reftex-enable-partial-scans
(null current-prefix-arg)) (null current-prefix-arg))
(let* ((data (get-text-property (point) :data)) (let* ((data (get-text-property (point) :data))
(what (car data)) (what (car data))
@ -502,7 +503,7 @@ With prefix arg 1, restrict index to the section at point."
(defun reftex-toc-revert (&rest ignore) (defun reftex-toc-revert (&rest ignore)
"Regenerate the *toc* from the internal lists." "Regenerate the *toc* from the internal lists."
(interactive) (interactive)
(let ((unsplittable (let ((unsplittable
(if (fboundp 'frame-property) (if (fboundp 'frame-property)
(frame-property (selected-frame) 'unsplittable) (frame-property (selected-frame) 'unsplittable)
(frame-parameter (selected-frame) 'unsplittable))) (frame-parameter (selected-frame) 'unsplittable)))
@ -596,7 +597,7 @@ point."
(goto-char start-pos) (goto-char start-pos)
(setq sections (reftex-toc-extract-section-number (car entries))) (setq sections (reftex-toc-extract-section-number (car entries)))
(if (> (setq nsec (length entries)) 1) (if (> (setq nsec (length entries)) 1)
(setq sections (setq sections
(concat sections "-" (concat sections "-"
(reftex-toc-extract-section-number (reftex-toc-extract-section-number
(nth (1- nsec) entries))))) (nth (1- nsec) entries)))))
@ -621,17 +622,20 @@ point."
(save-window-excursion (save-window-excursion
(reftex-toc-Rescan)) (reftex-toc-Rescan))
(reftex-toc-restore-region start-line mark-line) (reftex-toc-restore-region start-line mark-line)
(message "%d section%s %smoted" (message "%d section%s %smoted"
nsec (if (= 1 nsec) "" "s") pro-or-de) nsec (if (= 1 nsec) "" "s") pro-or-de)
nil)) nil))
(if msg (progn (ding) (message "%s" msg))))) (if msg (progn (ding) (message "%s" msg)))))
(defun reftex-toc-restore-region (point-line &optional mark-line) (defun reftex-toc-restore-region (point-line &optional mark-line)
(if mark-line (when mark-line
(progn (goto-line mark-line) (goto-char (point-min))
(setq mpos (point)))) (forward-line (1- mark-line))
(if point-line (goto-line point-line)) (setq mpos (point)))
(when point-line
(goto-char (point-min))
(forward-line (1- point-line)))
(if mark-line (if mark-line
(progn (progn
(set-mark mpos) (set-mark mpos)
@ -781,7 +785,7 @@ label prefix determines the wording of a reference."
(error "This is not a label entry.")) (error "This is not a label entry."))
(setq newlabel (read-string (format "Rename label \"%s\" to:" label))) (setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
(if (assoc newlabel (symbol-value reftex-docstruct-symbol)) (if (assoc newlabel (symbol-value reftex-docstruct-symbol))
(if (not (y-or-n-p (if (not (y-or-n-p
(format "Label '%s' exists. Use anyway? " label))) (format "Label '%s' exists. Use anyway? " label)))
(error "Abort"))) (error "Abort")))
(save-excursion (save-excursion
@ -791,7 +795,7 @@ label prefix determines the wording of a reference."
(reftex-query-replace-document (reftex-query-replace-document
(concat "{" (regexp-quote label) "}") (concat "{" (regexp-quote label) "}")
(format "{%s}" newlabel)) (format "{%s}" newlabel))
(error t)))) (error t))))
(reftex-toc-rescan))) (reftex-toc-rescan)))
@ -810,9 +814,9 @@ label prefix determines the wording of a reference."
show-window show-buffer match) show-window show-buffer match)
(unless toc (error "Don't know which toc line to visit")) (unless toc (error "Don't know which toc line to visit"))
(cond (cond
((eq (car toc) 'toc) ((eq (car toc) 'toc)
;; a toc entry ;; a toc entry
(setq match (reftex-toc-find-section toc no-revisit))) (setq match (reftex-toc-find-section toc no-revisit)))
@ -828,7 +832,7 @@ label prefix determines the wording of a reference."
(file (nth 1 toc))) (file (nth 1 toc)))
(if (or (not no-revisit) (reftex-get-buffer-visiting file)) (if (or (not no-revisit) (reftex-get-buffer-visiting file))
(progn (progn
(switch-to-buffer-other-window (switch-to-buffer-other-window
(reftex-get-file-buffer-force file nil)) (reftex-get-file-buffer-force file nil))
(goto-char (if (eq where 'bof) (point-min) (point-max)))) (goto-char (if (eq where 'bof) (point-min) (point-max))))
(message "%s" reftex-no-follow-message) nil)))) (message "%s" reftex-no-follow-message) nil))))
@ -881,8 +885,8 @@ label prefix determines the wording of a reference."
(looking-at (reftex-make-desperate-section-regexp literal)) (looking-at (reftex-make-desperate-section-regexp literal))
(looking-at (concat "\\\\" (looking-at (concat "\\\\"
(regexp-quote (regexp-quote
(car (car
(rassq level (rassq level
reftex-section-levels-all))) reftex-section-levels-all)))
"[[{]?")))) "[[{]?"))))
((or (not no-revisit) ((or (not no-revisit)
@ -1056,7 +1060,7 @@ always show the current section in connection with the option
(define-key reftex-toc-map (vector (list key)) 'digit-argument)) (define-key reftex-toc-map (vector (list key)) 'digit-argument))
(define-key reftex-toc-map "-" 'negative-argument) (define-key reftex-toc-map "-" 'negative-argument)
(easy-menu-define (easy-menu-define
reftex-toc-menu reftex-toc-map reftex-toc-menu reftex-toc-map
"Menu for Table of Contents buffer" "Menu for Table of Contents buffer"
'("TOC" '("TOC"
@ -1089,7 +1093,7 @@ always show the current section in connection with the option
["Context" reftex-toc-toggle-context :style toggle ["Context" reftex-toc-toggle-context :style toggle
:selected reftex-toc-include-context] :selected reftex-toc-include-context]
"--" "--"
["Follow Mode" reftex-toc-toggle-follow :style toggle ["Follow Mode" reftex-toc-toggle-follow :style toggle
:selected reftex-toc-follow-mode] :selected reftex-toc-follow-mode]
["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
:selected reftex-toc-auto-recenter-timer] :selected reftex-toc-auto-recenter-timer]

View File

@ -1398,7 +1398,8 @@ hierarchy is similar to that used by `rst-adjust-decoration'."
(let (m line) (let (m line)
(while (and cur (< (setq line (caar cur)) region-end-line)) (while (and cur (< (setq line (caar cur)) region-end-line))
(setq m (make-marker)) (setq m (make-marker))
(goto-line line) (goto-char (point-min))
(forward-line (1- line))
(push (list (set-marker m (point)) (cdar cur)) marker-list) (push (list (set-marker m (point)) (cdar cur)) marker-list)
(setq cur (cdr cur)) )) (setq cur (cdr cur)) ))
@ -1463,7 +1464,8 @@ in order to adapt it to our preferred style."
(lambda (deco) (lambda (deco)
(cons (rst-position (cdr deco) hier) (cons (rst-position (cdr deco) hier)
(let ((m (make-marker))) (let ((m (make-marker)))
(goto-line (car deco)) (goto-char (point-min))
(forward-line (1- (car deco)))
(set-marker m (point)) (set-marker m (point))
m))) m)))
alldecos)) alldecos))
@ -1497,7 +1499,8 @@ section levels."
;; adjust for the changes in the document. ;; adjust for the changes in the document.
(dolist (deco (nreverse alldecos)) (dolist (deco (nreverse alldecos))
;; Go to the appropriate position. ;; Go to the appropriate position.
(goto-line (car deco)) (goto-char (point-min))
(forward-line (1- (car deco)))
(insert "@\n") (insert "@\n")
;; FIXME: todo, we ;; FIXME: todo, we
) )
@ -1628,7 +1631,8 @@ child. This has advantages later in processing the graph."
(save-excursion (save-excursion
(setq lines (setq lines
(mapcar (lambda (deco) (mapcar (lambda (deco)
(goto-line (car deco)) (goto-char (point-min))
(forward-line (1- (car deco)))
(list (gethash (cons (cadr deco) (caddr deco)) levels) (list (gethash (cons (cadr deco) (caddr deco)) levels)
(rst-get-stripped-line) (rst-get-stripped-line)
(let ((m (make-marker))) (let ((m (make-marker)))
@ -2019,7 +2023,8 @@ brings the cursor in that section."
(set (make-local-variable 'rst-toc-return-buffer) curbuf) (set (make-local-variable 'rst-toc-return-buffer) curbuf)
;; Move the cursor near the right section in the TOC. ;; Move the cursor near the right section in the TOC.
(goto-line line) (goto-char (point-min))
(forward-line (1- line))
)) ))
@ -2134,7 +2139,9 @@ backwards in the file (default is to use 1)."
;; If the index is positive, goto the line, otherwise go to the buffer ;; If the index is positive, goto the line, otherwise go to the buffer
;; boundaries. ;; boundaries.
(if (and cur (>= idx 0)) (if (and cur (>= idx 0))
(goto-line (car cur)) (progn
(goto-char (point-min))
(forward-line (1- (car cur))))
(if (> offset 0) (goto-char (point-max)) (goto-char (point-min)))) (if (> offset 0) (goto-char (point-max)) (goto-char (point-min))))
)) ))

View File

@ -2210,7 +2210,7 @@ for the error messages."
(with-syntax-table tex-error-parse-syntax-table (with-syntax-table tex-error-parse-syntax-table
(backward-up-list 1) (backward-up-list 1)
(skip-syntax-forward "(_") (skip-syntax-forward "(_")
(while (not (while (not
(and (setq try-filename (thing-at-point (and (setq try-filename (thing-at-point
'filename)) 'filename))
(not (string= "" try-filename)) (not (string= "" try-filename))
@ -2229,7 +2229,10 @@ for the error messages."
(find-file-noselect filename)) (find-file-noselect filename))
(save-excursion (save-excursion
(if new-file (if new-file
(progn (goto-line linenum) (setq last-position nil)) (progn
(goto-char (point-min))
(forward-line (1- linenum))
(setq last-position nil))
(goto-char last-position) (goto-char last-position)
(forward-line (- linenum last-linenum))) (forward-line (- linenum last-linenum)))
;; first try a forward search for the error text, ;; first try a forward search for the error text,

View File

@ -537,7 +537,8 @@ off trailing spaces with \\[delete-trailing-whitespace]."
(if (get-buffer-window (2C-other t)) (if (get-buffer-window (2C-other t))
(select-window (get-buffer-window (2C-other))) (select-window (get-buffer-window (2C-other)))
(switch-to-buffer (2C-other))) (switch-to-buffer (2C-other)))
(newline (goto-line line)) (goto-char (point-min))
(newline (forward-line (1- line)))
(if col (if col
(move-to-column col) (move-to-column col)
(end-of-line 1)))) (end-of-line 1))))

View File

@ -817,7 +817,8 @@ Display is centered at LINE.
Also set the mark at the position where point was." Also set the mark at the position where point was."
(interactive "p") (interactive "p")
(push-mark) (push-mark)
(goto-line line) (goto-char (point-min))
(forward-line (1- line))
(view-recenter)) (view-recenter))
(defun View-back-to-mark (&optional ignore) (defun View-back-to-mark (&optional ignore)