[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/gnus-cloud b1f7821 03/61: Merge branch 'master' of
From: |
Teodor Zlatanov |
Subject: |
[Emacs-diffs] scratch/gnus-cloud b1f7821 03/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs |
Date: |
Fri, 1 Jul 2016 17:37:50 +0000 (UTC) |
branch: scratch/gnus-cloud
commit b1f7821fab65d439cbdff854e15915c7e9ce1d78
Merge: 26d8ea9 4e9014f
Author: Ted Zlatanov <address@hidden>
Commit: Ted Zlatanov <address@hidden>
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
---
lisp/progmodes/cc-engine.el | 50 +++++++++++++++++++++++++++++++++++++------
1 file changed, 43 insertions(+), 7 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 011d080..595d577 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -7966,16 +7966,32 @@ comment at the start of cc-engine.el for more info."
maybe-typeless
backup-maybe-typeless
(eq at-decl-or-cast t)
+ ;; Check whether we have "bar (gnu);" where we
+ ;; are directly inside a class (etc.) called
"bar".
(save-excursion
- (goto-char name-start)
- (not (memq (c-forward-type) '(nil maybe))))))
+ (and
+ (progn
+ (goto-char name-start)
+ (not (memq (c-forward-type) '(nil maybe))))
+ (progn
+ (goto-char id-start)
+ (c-directly-in-class-called-p
+ (buffer-substring
+ type-start
+ (progn
+ (goto-char type-start)
+ (c-forward-type)
+ (c-backward-syntactic-ws)
+ (point)))))))))
;; Got a declaration of the form "foo bar (gnu);" or "bar
;; (gnu);" where we've recognized "bar" as the type and "gnu"
- ;; as the declarator. In this case it's however more likely
- ;; that "bar" is the declarator and "gnu" a function argument
- ;; or initializer (if `c-recognize-paren-inits' is set),
- ;; since the parens around "gnu" would be superfluous if it's
- ;; a declarator. Shift the type one step backward.
+ ;; as the declarator, and in the latter case, checked that
+ ;; "bar (gnu)" appears directly inside the class "bar". In
+ ;; this case it's however more likely that "bar" is the
+ ;; declarator and "gnu" a function argument or initializer
+ ;; (if `c-recognize-paren-inits' is set), since the parens
+ ;; around "gnu" would be superfluous if it's a declarator.
+ ;; Shift the type one step backward.
(c-fdoc-shift-type-backward)))
;; Found no identifier.
@@ -9414,6 +9430,26 @@ comment at the start of cc-engine.el for more info."
kwd-start)))
+(defun c-directly-in-class-called-p (name)
+ ;; Check whether point is directly inside a brace block which is the brace
+ ;; block of a class, struct, or union which is called NAME, a string.
+ (let* ((paren-state (c-parse-state))
+ (brace-pos (c-pull-open-brace paren-state))
+ )
+ (when (eq (char-after brace-pos) ?{)
+ (goto-char brace-pos)
+ (save-excursion
+ ; *c-looking-at-decl-block
+ ; containing-sexp goto-start &optional
+ ; limit)
+ (when (and (c-looking-at-decl-block
+ (c-pull-open-brace paren-state)
+ nil)
+ (looking-at c-class-key))
+ (goto-char (match-end 1))
+ (c-forward-syntactic-ws)
+ (looking-at name))))))
+
(defun c-search-uplist-for-classkey (paren-state)
;; Check if the closest containing paren sexp is a declaration
;; block, returning a 2 element vector in that case. Aref 0
- [Emacs-diffs] scratch/gnus-cloud updated (743e6b6 -> cb3beec), Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 26d8ea9 02/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud ca64136 04/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2fff330 05/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud b1f7821 03/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs,
Teodor Zlatanov <=
- [Emacs-diffs] scratch/gnus-cloud 92163e0 06/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud b335707 09/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 8136bd2 12/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 8e9940f 07/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 9703790 13/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2f858df 19/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud ad87a3e 15/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2204fd1 17/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud a744c73 16/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud cc0e1f6 20/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01