diff options
| author | Alan Mackenzie | 2013-03-06 14:24:39 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2013-03-06 14:24:39 +0000 |
| commit | 33d1e2f5bdaca00fa003faab1d3f8b03dec98023 (patch) | |
| tree | 9bb5b87432aa6c966c025deba9bde0d333411726 | |
| parent | 1af1a51aada18d88fac7b2ba09231428c6a65d7c (diff) | |
| download | emacs-33d1e2f5bdaca00fa003faab1d3f8b03dec98023.tar.gz emacs-33d1e2f5bdaca00fa003faab1d3f8b03dec98023.zip | |
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.
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/cc-mode.texi | 15 | ||||
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/cc-align.el | 4 |
4 files changed, 23 insertions, 8 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 8ffc040d27f..3a3ed4623d1 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-03-06 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * cc-mode.texi (Custom Line-Up): Clarify position of point on | ||
| 4 | calling a line-up function. | ||
| 5 | |||
| 1 | 2013-03-04 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2013-03-04 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | * emacs-mime.texi, htmlfontify.texi, mairix-el.texi, mh-e.texi: | 8 | * emacs-mime.texi, htmlfontify.texi, mairix-el.texi, mh-e.texi: |
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index bb6a5b001ad..4fa4e12cf88 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi | |||
| @@ -6475,13 +6475,14 @@ think is generally useful, you're very welcome to contribute it; | |||
| 6475 | please contact @email{bug-cc-mode@@gnu.org}. | 6475 | please contact @email{bug-cc-mode@@gnu.org}. |
| 6476 | 6476 | ||
| 6477 | Line-up functions are passed a single argument, the syntactic | 6477 | Line-up functions are passed a single argument, the syntactic |
| 6478 | element (see below). The return value is a @code{c-offsets-alist} | 6478 | element (see below). At the time of the call, point will be somewhere |
| 6479 | offset specification: for example, an integer, a symbol such as | 6479 | on the line being indented. The return value is a |
| 6480 | @code{+}, a vector, @code{nil}@footnote{Returning @code{nil} is useful | 6480 | @code{c-offsets-alist} offset specification: for example, an integer, |
| 6481 | when the offset specification for a syntactic element is a list | 6481 | a symbol such as @code{+}, a vector, @code{nil}@footnote{Returning |
| 6482 | containing the line-up function (@pxref{c-offsets-alist}).}, or even | 6482 | @code{nil} is useful when the offset specification for a syntactic |
| 6483 | another line-up function. Full details of these are in | 6483 | element is a list containing the line-up function |
| 6484 | @ref{c-offsets-alist}. | 6484 | (@pxref{c-offsets-alist}).}, or even another line-up function. Full |
| 6485 | details of these are in @ref{c-offsets-alist}. | ||
| 6485 | 6486 | ||
| 6486 | Line-up functions must not move point or change the content of the | 6487 | Line-up functions must not move point or change the content of the |
| 6487 | buffer (except temporarily). They are however allowed to do | 6488 | buffer (except temporarily). They are however allowed to do |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac56cd8ba79..18242539cca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-03-06 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | Correct the position of point in some line-up functions. | ||
| 4 | * progmodes/cc-align.el (c-lineup-whitesmith-in-block) | ||
| 5 | (c-lineup-assignments, c-lineup-gcc-asm-reg ): take position of | ||
| 6 | point at column 0 rather than at a random place in the line. | ||
| 7 | |||
| 1 | 2013-03-05 Michael Albinus <michael.albinus@gmx.de> | 8 | 2013-03-05 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 9 | ||
| 3 | * net/tramp-compat.el (tramp-compat-delete-directory): Implement | 10 | * net/tramp-compat.el (tramp-compat-delete-directory): Implement |
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index cdd0561a054..33836f25335 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el | |||
| @@ -737,7 +737,7 @@ arglist-cont-nonempty." | |||
| 737 | (setq startpos (c-langelem-pos langelem))))) | 737 | (setq startpos (c-langelem-pos langelem))))) |
| 738 | 738 | ||
| 739 | (setq startpos (c-langelem-pos langelem) | 739 | (setq startpos (c-langelem-pos langelem) |
| 740 | endpos (point)) | 740 | endpos (c-point 'bol)) |
| 741 | 741 | ||
| 742 | ;; Find a syntactically relevant and unnested "=" token on the | 742 | ;; Find a syntactically relevant and unnested "=" token on the |
| 743 | ;; current line. equalp is in that case set to the number of | 743 | ;; current line. equalp is in that case set to the number of |
| @@ -1039,6 +1039,7 @@ brace-list-close, brace-list-intro, statement-block-intro, | |||
| 1039 | arglist-intro, arglist-cont-nonempty, arglist-close, and all in* | 1039 | arglist-intro, arglist-cont-nonempty, arglist-close, and all in* |
| 1040 | symbols, e.g. inclass and inextern-lang." | 1040 | symbols, e.g. inclass and inextern-lang." |
| 1041 | (save-excursion | 1041 | (save-excursion |
| 1042 | (beginning-of-line) | ||
| 1042 | (if (and (c-go-up-list-backward) | 1043 | (if (and (c-go-up-list-backward) |
| 1043 | (= (point) (c-point 'boi))) | 1044 | (= (point) (c-point 'boi))) |
| 1044 | nil | 1045 | nil |
| @@ -1191,6 +1192,7 @@ Works with: arglist-cont, arglist-cont-nonempty." | |||
| 1191 | (let ((orig-pos (point)) | 1192 | (let ((orig-pos (point)) |
| 1192 | alignto) | 1193 | alignto) |
| 1193 | (save-excursion | 1194 | (save-excursion |
| 1195 | (beginning-of-line) | ||
| 1194 | (and | 1196 | (and |
| 1195 | c-opt-asm-stmt-key | 1197 | c-opt-asm-stmt-key |
| 1196 | 1198 | ||