Commit 5f68c1b7 authored by Glenn Morris's avatar Glenn Morris

Use forward-line rather than goto-line.

parent 52199878
2009-09-01 Glenn Morris <rgm@gnu.org>
* net/eudc-bob.el (eudc-bob-generic-menu, eudc-bob-image-menu)
(eudc-bob-sound-menu): Use defvar rather than defconst, since
easy-menu-define wants to modify these.
* net/net-utils.el (nslookup): Use make-comint rather than comint-run.
* net/browse-url.el (browse-url-file-url):
* term/internal.el (dos-codepage-setup):
Use default-value rather than default-enable-multibyte-characters.
* progmodes/flymake.el (flymake-highlight-line)
(flymake-goto-file-and-line, flymake-goto-line):
* progmodes/gdb-mi.el (gdb-mouse-until, gdb-mouse-jump)
(gdb-goto-breakpoint):
* progmodes/idlw-shell.el (idlwave-shell-move-to-bp):
* progmodes/python.el (python-find-function)
(python-pdbtrack-track-stack-file):
* progmodes/verilog-mode.el (verilog-surelint-off):
* term/ns-win.el (ns-open-file-select-line):
* textmodes/bibtex.el (bibtex-validate, bibtex-validate-globally):
Use forward-line rather than goto-line.
* textmodes/reftex-cite.el (reftex-offer-bib-menu):
* textmodes/reftex-index.el (reftex-display-index):
* textmodes/reftex-ref.el (reftex-offer-label-menu):
......
......@@ -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 ()
......
......@@ -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")))))
......
......@@ -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 ------------------------------------------------------
......
......@@ -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)
......
......@@ -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
......
......@@ -723,9 +723,10 @@ Lines are highlighted according to `ns-input-line'."
(if ns-select-overlay
(setq ns-select-overlay (delete-overlay ns-select-overlay)))
(deactivate-mark)
(goto-line (if (consp ns-input-line)
(min (car ns-input-line) (cdr ns-input-line))
ns-input-line)))
(goto-char (point-min))
(forward-line (1- (if (consp ns-input-line)
(min (car ns-input-line) (cdr ns-input-line))
ns-input-line))))
(ns-input-line
(if (not ns-select-overlay)
(overlay-put (setq ns-select-overlay (make-overlay (point-min)
......
......@@ -3845,7 +3845,8 @@ Return t if test was successful, nil otherwise."
(insert (format "%s:%d: %s\n" file (car err) (cdr err))))
(set-buffer-modified-p nil)
(toggle-read-only 1)
(goto-line 3)) ; first error message
(goto-char (point-min))
(forward-line 2)) ; first error message
(display-buffer err-buf)
nil) ; return `nil' (i.e., buffer is invalid)
(message "%s is syntactically correct"
......@@ -3902,7 +3903,8 @@ Return t if test was successful, nil otherwise."
(dolist (err (sort error-list 'string-lessp)) (insert err))
(set-buffer-modified-p nil)
(toggle-read-only 1)
(goto-line 3)) ; first error message
(goto-char (point-min))
(forward-line 2)) ; first error message
(display-buffer err-buf)
nil) ; return `nil' (i.e., buffer is invalid)
(message "No duplicate keys.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment