[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/last-cedet-merge 307b510 09/50: semantic: Deal wit
From: |
David Engster |
Subject: |
[Emacs-diffs] scratch/last-cedet-merge 307b510 09/50: semantic: Deal with missing prefix when completing symbol |
Date: |
Wed, 25 Jan 2017 22:15:20 +0000 (UTC) |
branch: scratch/last-cedet-merge
commit 307b510f7609b6a26a5a120b2f11cffb7453c859
Author: Eric Ludlam <address@hidden>
Commit: David Engster <address@hidden>
semantic: Deal with missing prefix when completing symbol
* lisp/cedet/semantic/ia.el (semantic-ia-complete-symbol): Protect
against a nil prefix.
(semantic-ia-complete-symbol-menu): If bounds are empty (no prefix),
don't delete region.
---
lisp/cedet/semantic/ia.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el
index 4696388..b17af9a 100644
--- a/lisp/cedet/semantic/ia.el
+++ b/lisp/cedet/semantic/ia.el
@@ -123,7 +123,7 @@ Completion options are calculated with
`semantic-analyze-possible-completions'."
;; the smart completion engine sometimes fails.
(semantic-complete-symbol))
;; Use try completion to seek a common substring.
- (let* ((completion-ignore-case (string= (downcase pre) pre))
+ (let* ((completion-ignore-case (and pre (string= (downcase pre) pre)))
(tc (try-completion (or pre "") syms)))
(if (and (stringp tc) (not (string= tc (or pre ""))))
(let ((tok (semantic-find-first-tag-by-name
@@ -188,7 +188,11 @@ Completion options are calculated with
`semantic-analyze-possible-completions'."
(when ans
(if (not (semantic-tag-p ans))
(setq ans (aref (cdr ans) 0)))
- (delete-region (car (oref a bounds)) (cdr (oref a bounds)))
+ (with-slots ((bnds bounds)) a
+ ;; bounds could be nil if we are completing an empty prefix string
+ ;; (e.g. type constrained within a function argument list)
+ (when (and (car bnds) (cdr bnds))
+ (delete-region (car bnds) (cdr bnds))))
(semantic-ia-insert-tag ans))
))))
- [Emacs-diffs] branch scratch/last-cedet-merge created (now d2a57bd), David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge ca20c99 01/50: semantic: make semanticdb-default-find-index-class buffer-local, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 40dd3d9 02/50: semantic: Do not add enum-type for every type, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 5d6f4b8 05/50: EDE: Fix slot type in ede-proj-target-makefile, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 5776e7c 06/50: EDE: Fallback to project-linux-build-directory-default if necessary, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 05d6b4b 03/50: semantic: Apply enum-type to all members, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge fa84466 07/50: semantic: Fix current symbol info, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge a7276f6 08/50: ; semantic: Add TODO comment regarding arg indexing, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 307b510 09/50: semantic: Deal with missing prefix when completing symbol,
David Engster <=
- [Emacs-diffs] scratch/last-cedet-merge fdd5968 15/50: semantic: New function to calculate scope around tag, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge ebc59a5 19/50: semantic: Accept FLAGS parameter for srecode-template-mode, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 47471b9 12/50: EDE: Add missing require and silence byte compiler, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 7308eaf 18/50: semantic: Accept FLAGS parameter for makefile-mode for analyzing completions, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge b4d1399 14/50: EDE: Rework config file detection, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 95f8a69 29/50: semantic: More C grammar optimizations, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge deaa8c9 24/50: semantic: New function to find library with macro definition, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 0391760 13/50: semantic: Do not strip '*' from operator, David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge 6ca095c 21/50: semantic: Add autoload for Add autoload for `semantic-analyze-debug-assist', David Engster, 2017/01/25
- [Emacs-diffs] scratch/last-cedet-merge f3674d0 33/50: semantic: Parse C++ override/final correctly, David Engster, 2017/01/25