emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111955: Correct the position of poin


From: Alan Mackenzie
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111955: Correct the position of point in some line-up functions.
Date: Wed, 06 Mar 2013 14:24:39 +0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111955
committer: Alan Mackenzie <address@hidden>
branch nick: trunk
timestamp: Wed 2013-03-06 14:24:39 +0000
message:
  Correct the position of point in some line-up functions.
  progmodes/cc-align.el (c-lineup-whitesmith-in-block, c-lineup-assignments)
  (c-lineup-gcc-asm-reg ): take position of point at column 0 rather than
  at a random place in the line.
  doc/misc/cc-mode.texi (Custom Line-Up): State explicitly that point
  starts at a random position in the line being indented.
modified:
  doc/misc/ChangeLog
  doc/misc/cc-mode.texi
  lisp/ChangeLog
  lisp/progmodes/cc-align.el
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2013-03-04 08:45:03 +0000
+++ b/doc/misc/ChangeLog        2013-03-06 14:24:39 +0000
@@ -1,3 +1,8 @@
+2013-03-06  Alan Mackenzie  <address@hidden>
+
+       * cc-mode.texi (Custom Line-Up): Clarify position of point on
+       calling a line-up function.
+
 2013-03-04  Paul Eggert  <address@hidden>
 
        * emacs-mime.texi, htmlfontify.texi, mairix-el.texi, mh-e.texi:

=== modified file 'doc/misc/cc-mode.texi'
--- a/doc/misc/cc-mode.texi     2013-02-12 17:36:54 +0000
+++ b/doc/misc/cc-mode.texi     2013-03-06 14:24:39 +0000
@@ -6475,13 +6475,14 @@
 please contact @email{bug-cc-mode@@gnu.org}.
 
    Line-up functions are passed a single argument, the syntactic
-element (see below).  The return value is a @code{c-offsets-alist}
-offset specification: for example, an integer, a symbol such as
address@hidden, a vector, @address@hidden @code{nil} is useful
-when the offset specification for a syntactic element is a list
-containing the line-up function (@pxref{c-offsets-alist}).}, or even
-another line-up function.  Full details of these are in
address@hidden
+element (see below).  At the time of the call, point will be somewhere
+on the line being indented.  The return value is a
address@hidden offset specification: for example, an integer,
+a symbol such as @code{+}, a vector, @address@hidden
address@hidden is useful when the offset specification for a syntactic
+element is a list containing the line-up function
+(@pxref{c-offsets-alist}).}, or even another line-up function.  Full
+details of these are in @ref{c-offsets-alist}.
 
 Line-up functions must not move point or change the content of the
 buffer (except temporarily).  They are however allowed to do

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-05 15:55:53 +0000
+++ b/lisp/ChangeLog    2013-03-06 14:24:39 +0000
@@ -1,3 +1,10 @@
+2013-03-06  Alan Mackenzie  <address@hidden>
+
+       Correct the position of point in some line-up functions.
+       * progmodes/cc-align.el (c-lineup-whitesmith-in-block)
+       (c-lineup-assignments, c-lineup-gcc-asm-reg ): take position of
+       point at column 0 rather than at a random place in the line.
+
 2013-03-05  Michael Albinus  <address@hidden>
 
        * net/tramp-compat.el (tramp-compat-delete-directory): Implement

=== modified file 'lisp/progmodes/cc-align.el'
--- a/lisp/progmodes/cc-align.el        2013-03-04 19:33:23 +0000
+++ b/lisp/progmodes/cc-align.el        2013-03-06 14:24:39 +0000
@@ -737,7 +737,7 @@
              (setq startpos (c-langelem-pos langelem)))))
 
       (setq startpos (c-langelem-pos langelem)
-           endpos (point))
+           endpos (c-point 'bol))
 
       ;; Find a syntactically relevant and unnested "=" token on the
       ;; current line.  equalp is in that case set to the number of
@@ -1039,6 +1039,7 @@
 arglist-intro, arglist-cont-nonempty, arglist-close, and all in*
 symbols, e.g. inclass and inextern-lang."
   (save-excursion
+    (beginning-of-line)
     (if (and (c-go-up-list-backward)
             (= (point) (c-point 'boi)))
        nil
@@ -1191,6 +1192,7 @@
   (let ((orig-pos (point))
        alignto)
     (save-excursion
+      (beginning-of-line)
       (and
        c-opt-asm-stmt-key
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]