diff options
-rw-r--r-- | lisp/ChangeLog | 47 | ||||
-rw-r--r-- | lisp/bs.el | 9 | ||||
-rw-r--r-- | lisp/calc/calc.el | 13 | ||||
-rw-r--r-- | lisp/cus-edit.el | 7 | ||||
-rw-r--r-- | lisp/ibuffer.el | 7 | ||||
-rw-r--r-- | lisp/play/gamegrid.el | 3 | ||||
-rw-r--r-- | lisp/progmodes/ada-mode.el | 9 | ||||
-rw-r--r-- | lisp/progmodes/ada-xref.el | 11 | ||||
-rw-r--r-- | lisp/progmodes/ebrowse.el | 8 | ||||
-rw-r--r-- | lisp/progmodes/gud.el | 9 | ||||
-rw-r--r-- | lisp/progmodes/idlw-shell.el | 11 | ||||
-rw-r--r-- | lisp/progmodes/vhdl-mode.el | 9 | ||||
-rw-r--r-- | lisp/server.el | 6 | ||||
-rw-r--r-- | lisp/startup.el | 10 | ||||
-rw-r--r-- | lisp/strokes.el | 6 | ||||
-rw-r--r-- | lisp/term.el | 3 | ||||
-rw-r--r-- | lisp/textmodes/picture.el | 10 | ||||
-rw-r--r-- | lisp/textmodes/reftex-index.el | 3 | ||||
-rw-r--r-- | lisp/textmodes/reftex-sel.el | 40 | ||||
-rw-r--r-- | lisp/textmodes/reftex-toc.el | 66 | ||||
-rw-r--r-- | lisp/textmodes/rst.el | 19 | ||||
-rw-r--r-- | lisp/textmodes/tex-mode.el | 7 | ||||
-rw-r--r-- | lisp/textmodes/two-column.el | 3 | ||||
-rw-r--r-- | lisp/view.el | 3 |
24 files changed, 207 insertions, 112 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6f6e57d56af..076a0a863ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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> * progmodes/grep.el (lgrep, rgrep): At the beginning diff --git a/lisp/bs.el b/lisp/bs.el index 727216c9531..0c7a53cf636 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -1,7 +1,7 @@ ;;; bs.el --- menu for selecting and displaying buffers -;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +;; 2007, 2008, 2009 Free Software Foundation, Inc. ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de> ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de> ;; Keywords: convenience @@ -575,10 +575,11 @@ a special function. SORT-DESCRIPTION is an element of `bs-sort-functions'." "Redisplay whole Buffer Selection Menu. If KEEP-LINE-P is non-nil the point will stay on current line. 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)) (when keep-line-p - (goto-line line)) + (goto-char (point-min)) + (forward-line line)) (beginning-of-line))) (defun bs--goto-current-buffer () diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index b291969b7f5..8e6af0db7e1 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1,7 +1,7 @@ ;;; calc.el --- the GNU Emacs calculator -;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Author: David Gillespie <daveg@synaptics.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) (if (eq major-mode 'calc-mode) (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)) (save-current-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)))) (unless (memq 'keep-flags calc-command-flags) (save-excursion @@ -2019,7 +2021,8 @@ See calc-keypad for details." (eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) (save-excursion (set-buffer calc-trail-buffer) - (goto-line 2) + (goto-char (point-min)) + (forward-line 1) (setq calc-trail-pointer (point-marker)))) calc-trail-buffer) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 9ad6a05fe1a..e0413c19d6c 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2192,9 +2192,10 @@ and `face'." (when (and (>= pos from) (<= pos to)) (condition-case nil (progn - (if (> column 0) - (goto-line line) - (goto-line (1+ line))) + (goto-char (point-min)) + (forward-line (if (> column 0) + (1- line) + line)) (move-to-column column)) (error nil))))) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 335f410475c..4339a29b44b 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1,7 +1,7 @@ ;;; ibuffer.el --- operate on buffers like dired -;; Copyright (C) 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009 Free Software Foundation, Inc. ;; Author: Colin Walters <walters@verbum.org> ;; Maintainer: John Paul Wallington <jpw@gnu.org> @@ -1093,7 +1093,8 @@ one window." (line (+ 1 (count-lines 1 (point))))) (bury-buffer buf) (ibuffer-update nil t) - (goto-line line))) + (goto-char (point-min)) + (forward-line (1- line)))) (defun ibuffer-visit-tags-table () "Visit the tags table in the buffer on this line. See `visit-tags-table'." diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index 18ab694b683..5dd63f0bb56 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -586,7 +586,8 @@ FILE is created there." (t "")))) (sort-fields 1 (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)) (setq buffer-read-only t) (save-buffer))) diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index c28926dbb3d..89cbdd18454 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -1,7 +1,7 @@ ;;; ada-mode.el --- major-mode for editing Ada sources ;; 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> ;; 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)) :group 'ada) +;; FIXME If this is not something required by the ada language, this +;; should be removed. (defcustom ada-clean-buffer-before-saving t "*Non-nil means remove trailing spaces and untabify the buffer before saving." :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) "./") (set-buffer file) - (if (stringp line) - (goto-line (string-to-number line))) + (when (stringp line) + (goto-char (point-min)) + (forward-line (1- (string-to-number line)))) (setq source (point-marker))) diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index 82df4be3dfd..4bb53a85f47 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -1,7 +1,7 @@ ;; ada-xref.el --- for lookup and completion in Ada mode ;; 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> ;; 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))) ;; one => should be the right one ((= len 1) - (goto-line (caar declist))) + (goto-char (point-min)) + (forward-line (1- (caar declist)))) ;; more than one => display choice list (t @@ -1937,7 +1938,8 @@ This function is disabled for operators, and only works for identifiers." (read-from-minibuffer "Enter No. of your choice: ")))) ) (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 (push-mark) - (goto-line line) + (goto-char (point-min)) + (forward-line (1- line)) (move-to-column column) ;; If we are not on the identifier, the ali file was not up-to-date. diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 7e53ec8a5f6..f9cb486eb18 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -1,7 +1,7 @@ ;;; ebrowse.el --- Emacs C++ class browser & tags facility ;; 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. ;; 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)) (let ((old-line (count-lines (point-min) (point)))) (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) (let* ((maxlin (count-lines (point-min) (point-max))) (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)))) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 4b77f4a1ff5..0d3679575d6 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -1,12 +1,12 @@ ;;; 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> ;; Maintainer: FSF ;; 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. ;; 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))) (save-restriction (widen) - (goto-line line) + (goto-char (point-min)) + (forward-line (1- line)) (setq pos (point)) (or gud-overlay-arrow-position (setq gud-overlay-arrow-position (make-marker))) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index a57fba4e822..40418d7ad7f 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -1,7 +1,7 @@ ;; idlw-shell.el --- run IDL as an inferior process of Emacs. -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -;; Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009 Free Software Foundation, Inc. ;; Authors: J.D. Smith <jdsmith@as.arizona.edu> ;; Carsten Dominik <dominik@astro.uva.nl> @@ -2317,7 +2317,8 @@ used. Does nothing if the resulting frame is nil." (frame (set-buffer (idlwave-find-file-noselect (car frame) 'shell)) (widen) - (goto-line (nth 1 frame))))) + (goto-char (point-min)) + (forward-line (1- (nth 1 frame)))))) (defun idlwave-shell-pc-frame () "Returns the frame for IDL execution." @@ -2388,8 +2389,8 @@ matter what the settings of that variable." (set-buffer buffer) (save-restriction (widen) - (goto-line (nth 1 frame)) - (forward-line 0) + (goto-char (point-min)) + (forward-line (1- (nth 1 frame))) (setq pos (point)) (setq idlwave-shell-is-stopped t) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index a7f033c7045..35c372d0b4b 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -15152,7 +15152,8 @@ is already shown in a buffer." (let ((buffer (get-file-buffer (car token)))) (speedbar-find-file-in-frame (car token)) (when (or vhdl-speedbar-jump-to-unit buffer) - (goto-line (cdr token)) + (goto-char (point-min)) + (forward-line (1- (cdr token))) (recenter)) (vhdl-speedbar-update-current-unit t t) (speedbar-set-timer dframe-update-speed) @@ -15170,7 +15171,8 @@ is already shown in a buffer." (let ((token (get-text-property (match-beginning 3) 'speedbar-token))) (vhdl-visit-file (car token) t - (progn (goto-line (cdr token)) + (progn (goto-char (point-min)) + (forward-line (1- (cdr token))) (end-of-line) (if is-entity (vhdl-port-copy) @@ -15919,7 +15921,8 @@ current project/directory." ;; insert component declarations (while ent-alist (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) (vhdl-port-copy))) (goto-char component-pos) diff --git a/lisp/server.el b/lisp/server.el index e06fb030e78..6cff6266b85 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1,7 +1,8 @@ ;;; server.el --- Lisp code for GNU Emacs running as server process ;; 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> ;; Maintainer: FSF @@ -1098,7 +1099,8 @@ The following commands are accepted by the client: "Move point to the position indicated in LINE-COL. LINE-COL should be a pair (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))) (when (> column-number 0) (move-to-column (1- column-number)))))) diff --git a/lisp/startup.el b/lisp/startup.el index c28a2fe599c..3d177f9d944 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -2258,8 +2258,9 @@ A fancy display is used on graphic displays, normal otherwise." (if (= file-count 1) (setq first-file-buffer (find-file file)) (find-file-other-window file))) - (or (zerop line) - (goto-line line)) + (unless (zerop line) + (goto-char (point-min)) + (forward-line (1- line))) (setq line 0) (unless (< column 1) (move-to-column (1- column))) @@ -2292,8 +2293,9 @@ A fancy display is used on graphic displays, normal otherwise." (inhibit-startup-screen (find-file-other-window file)) (t (find-file file)))) - (or (zerop line) - (goto-line line)) + (unless (zerop line) + (goto-char (point-min)) + (forward-line (1- line))) (setq line 0) (unless (< column 1) (move-to-column (1- column))) diff --git a/lisp/strokes.el b/lisp/strokes.el index 673a0fb50d5..75278f69d13 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -1187,14 +1187,16 @@ the stroke as a character in some language." (let ((char (or (car rainbow-chars) ?\.))) (loop for i 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)) (delete-char 1) (insert char))) (setq rainbow-chars (cdr rainbow-chars) lift-flag nil)) ;; Otherwise, just plot the point... - (goto-line (+ 17 y)) + (goto-char (point-min)) + (forward-line (+ 16 y)) (forward-char (+ 2 x)) (subst-char-in-region (point) (1+ (point)) ?\s ?\*))) ((strokes-lift-p point) diff --git a/lisp/term.el b/lisp/term.el index 4511c394fd2..295f1e8d379 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3465,7 +3465,8 @@ The top-most line is line 0." (set-buffer buffer) (save-restriction (widen) - (goto-line line) + (goto-char (point-min)) + (forward-line (1- line)) (setq pos (point)) (setq overlay-arrow-string "=>") (or overlay-arrow-position diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 1f532b41974..92412eccd10 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -1,7 +1,7 @@ ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model -;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009 Free Software Foundation, Inc. ;; Author: K. Shane Hartman ;; Maintainer: FSF @@ -559,7 +559,8 @@ Leaves the region surrounding the rectangle." (left (min c1 c2)) (top (min r1 r2)) (bottom (max r1 r2))) - (goto-line top) + (goto-char (point-min)) + (forward-line (1- top)) (move-to-column left 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-set-motion pvs phs) - (goto-line sl) + (goto-char (point-min)) + (forward-line (1- sl)) (move-to-column sc t))) diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index 21602d3f670..31627604b0b 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el @@ -1088,7 +1088,8 @@ When index is restricted, select the previous section as restriction criterion." "Go to the CHAR section in the index." (let ((pos (point)) (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) (progn (beginning-of-line) 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 diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index c8fa5a7032e..0feda11a49f 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -1,6 +1,7 @@ ;;; 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> ;; 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))) offset toc-window) - (if (setq toc-window (get-buffer-window + (if (setq toc-window (get-buffer-window "*toc*" (if reuse 'visible))) (select-window toc-window) @@ -165,7 +166,7 @@ When called with a raw C-u prefix, rescan the document first." (split-window-horizontally (floor (* (window-width) reftex-toc-split-windows-fraction))) - (split-window-vertically + (split-window-vertically (floor (* (window-height) 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 nil ; counter nil ; commented - here-I-am + here-I-am "" ; xr-prefix t ; a toc buffer )) - + (run-hooks 'reftex-display-copied-context-hook) (message "Building *toc* buffer...done.") (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 reftex-toc-include-index-entries reftex-toc-include-file-boundaries) - (reftex-last-assoc-before-elt + (reftex-last-assoc-before-elt 'toc here-I-am (symbol-value reftex-docstruct-symbol)))) (put 'reftex-toc :reftex-line 3) - (goto-line 3) - (beginning-of-line))) + (goto-char (point-min)) + (forward-line 2))) ;; Find the correct starting point (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)) (memq reftex-highlight-selection '(cursor both)) (reftex-highlight 2 - (or (previous-single-property-change + (or (previous-single-property-change (min (point-max) (1+ (point))) :data) (point-min)) (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)))))) (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. (setq frame (or frame (selected-frame))) - (let ((res (equal + (let ((res (equal (if (fboundp 'frame-property) (frame-property 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)) (setq reftex-callback-fwd t) (or (eobp) (forward-char 1)) - (goto-char (or (next-single-property-change (point) :data) + (goto-char (or (next-single-property-change (point) :data) (point)))) (defun reftex-toc-previous (&optional arg) "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 that specific type." (interactive "P") - (setq reftex-toc-include-labels + (setq reftex-toc-include-labels (if arg (reftex-query-label-type) (not reftex-toc-include-labels))) (reftex-toc-revert)) @@ -468,7 +469,7 @@ With prefix arg 1, restrict index to the section at point." (defun reftex-toc-rescan (&rest ignore) "Regenerate the *toc* buffer by reparsing file of section at point." (interactive) - (if (and reftex-enable-partial-scans + (if (and reftex-enable-partial-scans (null current-prefix-arg)) (let* ((data (get-text-property (point) :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) "Regenerate the *toc* from the internal lists." (interactive) - (let ((unsplittable + (let ((unsplittable (if (fboundp 'frame-property) (frame-property (selected-frame) 'unsplittable) (frame-parameter (selected-frame) 'unsplittable))) @@ -596,7 +597,7 @@ point." (goto-char start-pos) (setq sections (reftex-toc-extract-section-number (car entries))) (if (> (setq nsec (length entries)) 1) - (setq sections + (setq sections (concat sections "-" (reftex-toc-extract-section-number (nth (1- nsec) entries))))) @@ -621,17 +622,20 @@ point." (save-window-excursion (reftex-toc-Rescan)) (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) nil)) (if msg (progn (ding) (message "%s" msg))))) (defun reftex-toc-restore-region (point-line &optional mark-line) - (if mark-line - (progn (goto-line mark-line) - (setq mpos (point)))) - (if point-line (goto-line point-line)) + (when mark-line + (goto-char (point-min)) + (forward-line (1- mark-line)) + (setq mpos (point))) + (when point-line + (goto-char (point-min)) + (forward-line (1- point-line))) (if mark-line (progn (set-mark mpos) @@ -781,7 +785,7 @@ label prefix determines the wording of a reference." (error "This is not a label entry.")) (setq newlabel (read-string (format "Rename label \"%s\" to:" label))) (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))) (error "Abort"))) (save-excursion @@ -791,7 +795,7 @@ label prefix determines the wording of a reference." (reftex-query-replace-document (concat "{" (regexp-quote label) "}") (format "{%s}" newlabel)) - (error t)))) + (error t)))) (reftex-toc-rescan))) @@ -810,9 +814,9 @@ label prefix determines the wording of a reference." show-window show-buffer match) (unless toc (error "Don't know which toc line to visit")) - + (cond - + ((eq (car toc) 'toc) ;; a toc entry (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))) (if (or (not no-revisit) (reftex-get-buffer-visiting file)) (progn - (switch-to-buffer-other-window + (switch-to-buffer-other-window (reftex-get-file-buffer-force file nil)) (goto-char (if (eq where 'bof) (point-min) (point-max)))) (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 (concat "\\\\" (regexp-quote - (car - (rassq level + (car + (rassq level reftex-section-levels-all))) "[[{]?")))) ((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 "-" 'negative-argument) -(easy-menu-define +(easy-menu-define reftex-toc-menu reftex-toc-map "Menu for Table of Contents buffer" '("TOC" @@ -1089,7 +1093,7 @@ always show the current section in connection with the option ["Context" reftex-toc-toggle-context :style toggle :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] ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle :selected reftex-toc-auto-recenter-timer] diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index de2a5350f3c..d24bcf7e2b4 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -1398,7 +1398,8 @@ hierarchy is similar to that used by `rst-adjust-decoration'." (let (m line) (while (and cur (< (setq line (caar cur)) region-end-line)) (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) (setq cur (cdr cur)) )) @@ -1463,7 +1464,8 @@ in order to adapt it to our preferred style." (lambda (deco) (cons (rst-position (cdr deco) hier) (let ((m (make-marker))) - (goto-line (car deco)) + (goto-char (point-min)) + (forward-line (1- (car deco))) (set-marker m (point)) m))) alldecos)) @@ -1497,7 +1499,8 @@ section levels." ;; adjust for the changes in the document. (dolist (deco (nreverse alldecos)) ;; Go to the appropriate position. - (goto-line (car deco)) + (goto-char (point-min)) + (forward-line (1- (car deco))) (insert "@\n") ;; FIXME: todo, we ) @@ -1628,7 +1631,8 @@ child. This has advantages later in processing the graph." (save-excursion (setq lines (mapcar (lambda (deco) - (goto-line (car deco)) + (goto-char (point-min)) + (forward-line (1- (car deco))) (list (gethash (cons (cadr deco) (caddr deco)) levels) (rst-get-stripped-line) (let ((m (make-marker))) @@ -2019,7 +2023,8 @@ brings the cursor in that section." (set (make-local-variable 'rst-toc-return-buffer) curbuf) ;; 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 ;; boundaries. (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)))) )) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 8c8a9d5ac1a..ed975ab45c6 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2210,7 +2210,7 @@ for the error messages." (with-syntax-table tex-error-parse-syntax-table (backward-up-list 1) (skip-syntax-forward "(_") - (while (not + (while (not (and (setq try-filename (thing-at-point 'filename)) (not (string= "" try-filename)) @@ -2229,7 +2229,10 @@ for the error messages." (find-file-noselect filename)) (save-excursion (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) (forward-line (- linenum last-linenum))) ;; first try a forward search for the error text, diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index d8d298909c1..c393e1d9bcd 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -537,7 +537,8 @@ off trailing spaces with \\[delete-trailing-whitespace]." (if (get-buffer-window (2C-other t)) (select-window (get-buffer-window (2C-other))) (switch-to-buffer (2C-other))) - (newline (goto-line line)) + (goto-char (point-min)) + (newline (forward-line (1- line))) (if col (move-to-column col) (end-of-line 1)))) diff --git a/lisp/view.el b/lisp/view.el index 311d5e3123c..40214c073c0 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -817,7 +817,8 @@ Display is centered at LINE. Also set the mark at the position where point was." (interactive "p") (push-mark) - (goto-line line) + (goto-char (point-min)) + (forward-line (1- line)) (view-recenter)) (defun View-back-to-mark (&optional ignore) |