From 9c8e6c852cb5046b20bdcadc491f289ddb1709cf Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 15 Nov 2004 23:10:38 +0000 Subject: [PATCH] (compilation-move-to-column): New fun. (compilation-internal-error-properties) (compilation-next-error-function): Use it to make sure we don't go past the end of line. --- lisp/ChangeLog | 27 +++++++++++++++++++-------- lisp/progmodes/compile.el | 23 +++++++++++++---------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ec09e119786..0c803b26723 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-11-15 Stefan Monnier + + * progmodes/compile.el (compilation-move-to-column): New fun. + (compilation-internal-error-properties) + (compilation-next-error-function): Use it to make sure we don't go past + the end of line. + 2004-11-15 John Paul Wallington * autoinsert.el (auto-insert-alist): Insert the user's name in @@ -15,10 +22,10 @@ 2004-11-15 Jay Belanger - * calc/calcalg2.el (math-integrate-by-parts): Removed unused - variable var-thing. + * calc/calcalg2.el (math-integrate-by-parts): Remove unused + variable var-thing. - (math-integ-depth, math-integ-level, math-integral-limit) + (math-integ-depth, math-integ-level, math-integral-limit) (math-enable-subst, math-any-substs, math-integ-msg) (math-prev-parts-v, math-good-parts, math-max-integral-limit) (math-int-threshold, math-int-factors, math-double-roots) @@ -26,8 +33,8 @@ (var-GenCount): Declare these variables. (calcFunc-integ): Don't check if var-IntegLimit is bound. - (math-integral-cache, math-integral-cache-state): Move - declarations to earlier in the file. + (math-integral-cache, math-integral-cache-state): + Move declarations to earlier in the file. (math-deriv-var, math-deriv-total, math-deriv-symb) (math-cur-record, math-has-rules, math-t1, math-t2, math-t3) @@ -39,13 +46,13 @@ (math-integral, math-replace-integral-parts) (math-integrate-by-parts, calc-dump-integral-cache) (math-try-integral, math-do-integral, math-do-integral) - (math-do-integral-methods, math-try-solve-for) + (math-do-integral-methods, math-try-solve-for) (math-try-solve-prod, math-solve-poly-funny-powers) (math-solve-crunch-poly, math-decompose-poly) (math-solve-find-root-term, math-find-root-in-prod) (math-integ-try-linear-substitutions) (math-integ-try-substitutions, math-expr-rational-in) - (math-expr-rational-in-rec, calcFunc-table, math-scan-for-limits) + (math-expr-rational-in-rec, calcFunc-table, math-scan-for-limits) (math-solve-prod, math-solve-quartic, math-poly-all-roots) (math-solve-for, math-solve-system, math-solve-system-rec) (math-solve-get-sign, math-solve-get-int) @@ -58,7 +65,7 @@ 2004-11-14 Daniel Pfeiffer - * files.el (auto-mode-alist): handle .gtkrc, and under /etc + * files.el (auto-mode-alist): Handle .gtkrc, and under /etc passwd, group, shadow, default/* and pam.d/*. 2004-11-14 Vinicius Jose Latorre @@ -312,6 +319,10 @@ 2004-11-10 Stefan Monnier + * emacs-lisp/easymenu.el (easy-menu-define-key): Understand the case + where the keymap is a symbol. + (easy-menu-add-item): Use keymap-prompt. Simplify. + * files.el (magic-mode-alist): Reduce backtracking in the HTML regexp. * textmodes/sgml-mode.el (sgml-tag-text-p): New fun. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 895b97b462a..fb2e2e78317 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -606,6 +606,14 @@ Faces `compilation-error-face', `compilation-warning-face', 2))) (compilation-internal-error-properties file line end-line col end-col type fmt))) +(defun compilation-move-to-column (col screen) + "Go to column COL on the current line. +If SCREEN is non-nil, columns are screen columns, otherwise, they are +just char-counts." + (if screen + (move-to-column col) + (goto-char (min (+ (line-beginning-position) col) (line-end-position))))) + (defun compilation-internal-error-properties (file line end-line col end-col type fmt) "Get the meta-info that will be added as text-properties. LINE, END-LINE, COL, END-COL are integers or nil. @@ -640,17 +648,15 @@ FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil." (beginning-of-line (- (or end-line line) marker-line -1)) (if (or (null end-col) (< end-col 0)) (end-of-line) - (if compilation-error-screen-columns - (move-to-column end-col) - (forward-char end-col))) + (compilation-move-to-column + end-col compilation-error-screen-columns)) (setq end-marker (list (point-marker)))) (beginning-of-line (if end-line (- line end-line -1) (- loc marker-line -1))) (if col - (if compilation-error-screen-columns - (move-to-column col) - (forward-char col)) + (compilation-move-to-column + col compilation-error-screen-columns) (forward-to-indentation 0)) (setq marker (list (point-marker)))))) @@ -1491,10 +1497,7 @@ Use this command in a compilation log buffer. Sets the mark at point there." (if (car col) (if (eq (car col) -1) ; special case for range end (end-of-line) - (if columns - (move-to-column (car col)) - (beginning-of-line) - (forward-char (car col)))) + (compilation-move-to-column (car col) columns)) (beginning-of-line) (skip-chars-forward " \t")) (if (nth 3 col) -- 2.39.2