]> code.delx.au - gnu-emacs/commitdiff
(compilation-move-to-column): New fun.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 15 Nov 2004 23:10:38 +0000 (23:10 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 15 Nov 2004 23:10:38 +0000 (23:10 +0000)
(compilation-internal-error-properties)
(compilation-next-error-function): Use it to make sure we don't go past
the end of line.

lisp/ChangeLog
lisp/progmodes/compile.el

index ec09e11978645adb544164d00f284e7bba27e678..0c803b26723b2018c31ca95c8c3e3fd1074ca509 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-15  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * 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  <jpw@gnu.org>
 
        * autoinsert.el (auto-insert-alist): Insert the user's name in
 
 2004-11-15  Jay Belanger  <belanger@truman.edu>
 
-       * 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)
        (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  <occitan@esperanto.org>
 
-       * 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  <viniciusjl@ig.com.br>
 
 2004-11-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * 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.
index 895b97b462ad26864135a8cf09a37649e925f55d..fb2e2e78317c5961ecadcfd3b46ca03e9c591971 100644 (file)
@@ -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)