[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gtags-mode c1bbe60f19 30/61: Simplify code:
From: |
ELPA Syncer |
Subject: |
[elpa] externals/gtags-mode c1bbe60f19 30/61: Simplify code: |
Date: |
Thu, 28 Apr 2022 10:57:40 -0400 (EDT) |
branch: externals/gtags-mode
commit c1bbe60f1956a5d1e966325ad5136a8e15689ee7
Author: Jimmy Aguilar Mena <kratsbinovish@gmail.com>
Commit: Jimmy Aguilar Mena <kratsbinovish@gmail.com>
Simplify code:
Don't use symbol-value, but the variable directly as we use
hack-connection-local-variables-apply in
global-xref--set-connection-locals we can use the variable directly
because the with-connection-local-variables is not used anymore.
---
global-xref.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/global-xref.el b/global-xref.el
index b5bd14492c..e51157c64b 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -107,24 +107,24 @@ This is the sentinel set in `global-xref--exec-async'."
(message "Global error output:\n%s" (buffer-string)))))
(message "Async %s: %s" (process-command process) event))
-(defun global-xref--exec-async (command args &optional sentinel)
- "Run COMMAND with ARGS asynchronously and set SENTINEL to process.
+(defun global-xref--exec-async (cmd args)
+ "Run CMD with ARGS asynchronously and set SENTINEL to process.
Starts an asynchronous process and sets
`global-xref--exec-async-sentinel' as the process sentinel if
SENTINEL is nil or not specified. Returns the process object."
- (when-let ((cmd (symbol-value command)))
+ (when cmd
(make-process :name (format "%s-async" cmd)
:buffer (generate-new-buffer " *temp*" t)
:command (append (list cmd) args)
:sentinel #'global-xref--exec-async-sentinel
:file-handler t)))
-(defun global-xref--exec-sync (command args)
- "Run COMMAND with ARGS synchronously, on success call SENTINEL.
+(defun global-xref--exec-sync (cmd args)
+ "Run CMD with ARGS synchronously, on success call SENTINEL.
Starts a sync process; on success call SENTINEL or
`global-xref--sync-sentinel' if SENTINEL is not specified or nil.
Returns the output of SENTINEL or nil if any error occurred."
- (when-let ((cmd (symbol-value command)))
+ (when cmd
(with-temp-buffer ;; When sync
(let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
(if (eq status 0)
@@ -136,7 +136,7 @@ Returns the output of SENTINEL or nil if any error
occurred."
;; Api functions
(defun global-xref--find-root ()
"Return the GLOBAL project root. Return nil if none."
- (when-let ((root (car (global-xref--exec-sync 'global-xref--global
+ (when-let ((root (car (global-xref--exec-sync global-xref--global
'("--print-dbpath")))))
(setq root (concat (file-remote-p default-directory)
(file-truename root)))
@@ -158,7 +158,7 @@ name, code, file, line."
(match-string 3 line) ;; file
(string-to-number (match-string 2 line))))) ;; line
(global-xref--exec-sync
- 'global-xref--global
+ global-xref--global
(append args global-xref--output-format-options
(unless (string-blank-p symbol)
(list (shell-quote-argument symbol))))))))
@@ -168,20 +168,20 @@ name, code, file, line."
"Create a GLOBAL GTAGS file in ROOT-DIR asynchronously."
(interactive "DCreate db in directory: ")
(let ((default-directory root-dir))
- (global-xref--exec-async 'global-xref--gtags nil)))
+ (global-xref--exec-async global-xref--gtags nil)))
(defun global-xref-update ()
"Update GLOBAL project database."
(interactive)
(if global-xref--project-root
- (global-xref--exec-async 'global-xref--global '("--update"))
+ (global-xref--exec-async global-xref--global '("--update"))
(error "Not under a GLOBAL project")))
(defun global-xref--after-save-hook ()
"After save hook to update GLOBAL database with changed data."
(when (and buffer-file-name global-xref--project-root)
(global-xref--exec-async
- 'global-xref--global
+ global-xref--global
(list "--single-update"
(file-name-nondirectory buffer-file-name)))))
@@ -229,7 +229,7 @@ any additional command line arguments to pass to GNU
Global."
(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql
global-xref)))
"List all symbols."
- (global-xref--exec-sync 'global-xref--global '("--completion")))
+ (global-xref--exec-sync global-xref--global '("--completion")))
(cl-defmethod xref-backend-definitions ((_backend (eql global-xref)) symbol)
"List all definitions for SYMBOL."
- [elpa] externals/gtags-mode 55b0cbadb6 01/61: First commit., (continued)
- [elpa] externals/gtags-mode 55b0cbadb6 01/61: First commit., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode c88225e3f1 02/61: Add Readme.md, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 9763f8fb69 03/61: Add async processes to create and update database cleanly., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode f4bda60a1a 06/61: Fix global-xref--set-connection-locals., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 82b7f79aff 08/61: Simplify code., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 45fdfac932 09/61: Simplify imenu again., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 8734f6b54d 48/61: Reorder, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 10a710a3dd 54/61: Fix and simplify, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 86777df9a3 50/61: Call gtags-mode--set-connection-locals before processes, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode ae397208b5 32/61: Finish rename process., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode c1bbe60f19 30/61: Simplify code:,
ELPA Syncer <=
- [elpa] externals/gtags-mode b18a7cb93d 46/61: Fix docs, info messages and use `(,, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 3d7bf179bb 29/61: Use make-process instead of start-file-process., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode dc50f340d4 12/61: Small fixes in documentation and other details., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 5525174de9 34/61: Many changes:, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 317ed00754 61/61: Assert we retun nil on error, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 7dc81cbae2 56/61: Small simplifies, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 5445a63b79 21/61: Small fixes., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 33938b17e7 41/61: New function, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode d1195ca318 40/61: Use memoization function, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 65c2da145a 11/61: Reorder code a but and simplify., ELPA Syncer, 2022/04/28