[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 28/38: New helper ggtags-forward-to-line and use it
From: |
Leo Liu |
Subject: |
[elpa] 28/38: New helper ggtags-forward-to-line and use it |
Date: |
Mon, 24 Mar 2014 09:31:37 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 6057800f8e9d24b61fb7f507966fb3aca7cbf62b
Author: Leo Liu <address@hidden>
Date: Thu Mar 20 12:29:52 2014 +0800
New helper ggtags-forward-to-line and use it
Simplify ggtags-list-of-string-p with cl-every.
---
ggtags.el | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index e7e8552..dc85115 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -292,10 +292,15 @@ properly update `ggtags-mode-map'."
(defun ggtags-list-of-string-p (xs)
"Return non-nil if XS is a list of strings."
- (if (null xs)
- t
- (and (stringp (car xs))
- (ggtags-list-of-string-p (cdr xs)))))
+ (cl-every #'stringp xs))
+
+(defun ggtags-forward-to-line (line)
+ "Move to line number LINE in current buffer."
+ (cl-check-type line (integer 1))
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (forward-line (1- line))))
(defun ggtags-program-path (name)
(if ggtags-executable-directory
@@ -850,8 +855,7 @@ Use \\[jump-to-register] to restore the search session."
(add-hook 'compilation-finish-functions
(lambda (buf _msg)
(with-current-buffer buf
- (goto-char (point-min))
- (forward-line (1- line))
+ (ggtags-forward-to-line line)
(compile-goto-error)))
nil t)))))
(prn (data)
@@ -1678,11 +1682,8 @@ When finished invoke CALLBACK in BUFFER with process
exit status."
;;; imenu
(defun ggtags-goto-imenu-index (name line &rest _args)
- (save-restriction
- (widen)
- (goto-char (point-min))
- (forward-line (1- line))
- (ggtags-move-to-tag name)))
+ (ggtags-forward-to-line line)
+ (ggtags-move-to-tag name))
;;;###autoload
(defun ggtags-build-imenu-index ()
- [elpa] 18/38: Fix #36: Allow customising path to global's exectuables, (continued)
- [elpa] 18/38: Fix #36: Allow customising path to global's exectuables, Leo Liu, 2014/03/24
- [elpa] 20/38: Teach ggtags-find-tag-dwim to detect #include files, Leo Liu, 2014/03/24
- [elpa] 25/38: Fix ggtags-find-project to check on the GTAGS file, Leo Liu, 2014/03/24
- [elpa] 23/38: Simplify ggtags-save-to-register by always re-do the search, Leo Liu, 2014/03/24
- [elpa] 21/38: Add new command ggtags-save-to-register for #37, Leo Liu, 2014/03/24
- [elpa] 16/38: Fix ggtags-show-definition to run in current project, Leo Liu, 2014/03/24
- [elpa] 24/38: Fix thinko in "Don't display buffer if ggtags-navigation-mode is exited", Leo Liu, 2014/03/24
- [elpa] 26/38: New macro ignore-errors-unless-debug and use it, Leo Liu, 2014/03/24
- [elpa] 15/38: Small fixes to last change, Leo Liu, 2014/03/24
- [elpa] 32/38: Bind ggtags-save-to-register in ggtags-global-rerun-search-map, Leo Liu, 2014/03/24
- [elpa] 28/38: New helper ggtags-forward-to-line and use it,
Leo Liu <=
- [elpa] 27/38: Cosmetic change: Fix indentation, Leo Liu, 2014/03/24
- [elpa] 29/38: New feature ggtags-global-restore-search for #37, Leo Liu, 2014/03/24
- [elpa] 33/38: Disable ggtags-navigation-mode in ggtags-global-rerun-search, Leo Liu, 2014/03/24
- [elpa] 31/38: Also record ggtags-process-environment in search history, Leo Liu, 2014/03/24
- [elpa] 30/38: Polish last change, Leo Liu, 2014/03/24
- [elpa] 34/38: Support search bookmarks as requested in #39, Leo Liu, 2014/03/24
- [elpa] 38/38: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2014/03/24
- [elpa] 37/38: Rename try-complete-ggtags-tag to ggtags-try-complete-tag, Leo Liu, 2014/03/24
- [elpa] 13/38: Require cl-lib and remove macro when-let, Leo Liu, 2014/03/24
- [elpa] 36/38: Doc fix: Update README.rst and doc-strings, Leo Liu, 2014/03/24