1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Use forward-line rather than goto-line.

This commit is contained in:
Glenn Morris 2009-09-01 03:18:44 +00:00
parent 52199878ae
commit 5f68c1b736
8 changed files with 50 additions and 15 deletions

View file

@ -805,7 +805,8 @@ Return t if it has at least one flymake overlay, nil if no overlay."
(defun flymake-highlight-line (line-no line-err-info-list)
"Highlight line LINE-NO in current buffer.
Perhaps use text from LINE-ERR-INFO-LIST to enhance highlighting."
(goto-line line-no)
(goto-char (point-min))
(forward-line (1- line-no))
(let* ((line-beg (flymake-line-beginning-position))
(line-end (flymake-line-end-position))
(beg line-beg)
@ -1269,7 +1270,8 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
(if (not (file-exists-p file))
(flymake-log 1 "File %s does not exist" file)
(find-file file)
(goto-line line)))
(goto-char (point-min))
(forward-line (1- line))))
;; flymake minor mode declarations
(defvar flymake-mode-line nil)
@ -1443,7 +1445,8 @@ With arg, turn Flymake mode on if and only if arg is positive."
(defun flymake-goto-line (line-no)
"Go to line LINE-NO, then skip whitespace."
(goto-line line-no)
(goto-char (point-min))
(forward-line (1- line-no))
(flymake-skip-whitespace))
(defun flymake-goto-next-error ()

View file

@ -910,7 +910,8 @@ with mouse-1 (default bindings)."
(gud-call (concat "until " (number-to-string line))))
(gdb-if-arrow gdb-disassembly-position
(save-excursion
(goto-line (line-number-at-pos (posn-point end)))
(goto-char (point-min))
(forward-line (1- (line-number-at-pos (posn-point end))))
(forward-char 2)
(gud-call (concat "until *%a"))))))
@ -930,7 +931,8 @@ line, and no execution takes place."
(gud-call (concat "jump " (number-to-string line)))))
(gdb-if-arrow gdb-disassembly-position
(save-excursion
(goto-line (line-number-at-pos (posn-point end)))
(goto-char (point-min))
(forward-line (1- (line-number-at-pos (posn-point end))))
(forward-char 2)
(progn
(gud-call (concat "tbreak *%a"))
@ -3337,7 +3339,8 @@ breakpoints buffer."
(display-buffer buffer))))
(setq gdb-source-window window)
(with-current-buffer buffer
(goto-line (string-to-number line))
(goto-char (point-min))
(forward-line (1- (string-to-number line)))
(set-window-point window (point))))))
(error "Not recognized as break/watchpoint line")))))

View file

@ -2790,7 +2790,8 @@ Runs to the last statement and then steps 1 statement. Use the .out command."
(or (not bp-line) (funcall closer-func cur-line bp-line)))
(setq bp-line cur-line))))
(unless bp-line (error "No further breakpoints"))
(goto-line bp-line)))
(goto-char (point-min))
(forward-line (1- bp-line))))
;; Examine Commands ------------------------------------------------------

View file

@ -2203,7 +2203,8 @@ Interactively, prompt for name."
(unless file (error "Don't know where `%s' is defined" name))
(pop-to-buffer (find-file-noselect file))
(when (integerp line)
(goto-line line))))
(goto-char (point-min))
(forward-line (1- line)))))
;;;; Skeletons
@ -2614,7 +2615,8 @@ find it."
target_buffer (cadr target)
target_fname (buffer-file-name target_buffer))
(switch-to-buffer-other-window target_buffer)
(goto-line target_lineno)
(goto-char (point-min))
(forward-line (1- target_lineno))
(message "pdbtrack: line %s, file %s" target_lineno target_fname)
(python-pdbtrack-overlay-arrow t)
(pop-to-buffer origbuf t)

View file

@ -4071,7 +4071,8 @@ becomes:
(and (file-exists-p name)
(find-file-noselect name))))))))
(switch-to-buffer buffer)
(goto-line (string-to-number line))
(goto-char (point-min))
(forward-line (- (string-to-number line)))
(end-of-line)
(catch 'already
(cond