[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion aedcc114dc 105/313: Minor fixes to elimina
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion aedcc114dc 105/313: Minor fixes to eliminate byte-compiler warnings. |
Date: |
Sat, 3 Dec 2022 10:59:21 -0500 (EST) |
branch: elpa/bash-completion
commit aedcc114dc67643a39d201db905e3b9f1225c71c
Author: Sean McLaughlin <seanmcl@gmail.com>
Commit: Sean McLaughlin <seanmcl@gmail.com>
Minor fixes to eliminate byte-compiler warnings.
---
bash-completion.el | 63 ++++++++++++++++++++++++++++--------------------------
1 file changed, 33 insertions(+), 30 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 0498598fb3..68197d695c 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -56,7 +56,7 @@
;; 'bash-completion-dynamic-complete)
;;
;; or simpler, but forces you to load this file at startup:
-;;
+;;
;; (require 'bash-completion)
;; (bash-completion-setup)
;;
@@ -132,11 +132,11 @@
;; 2009-11-25 Stephane Zermatten <szermatt@gmail.com>
;;
;; * bash-completion-require-process: set MAILCHECK to -1
-;; to disable mail check message.
+;; to disable mail check message.
;;
;; 2009-08-01 Stephane Zermatten <szermatt@gmail.com>
;;
-;; * bash-completion-generate-line: add missing compgen
+;; * bash-completion-generate-line: add missing compgen
;; option to complete commands (duh!).
;;
;; Current version:
@@ -206,6 +206,7 @@ to remove the extra space bash adds after a completion."
(defvar bash-completion-process nil
"Bash process object.")
+(defvar bash-completion-prefix "" "")
(defvar bash-completion-alist nil
"Maps from command name to the 'complete' arguments.
@@ -227,6 +228,32 @@ completion in colon-separated values.")
(append bash-completion-wordbreaks-str nil)
"`bash-completion-wordbreaks-str' as a list of characters.")
+;;; ---------- Inline functions
+
+(defsubst bash-completion-tokenize-get-range (token)
+ "Return the TOKEN range as a cons: (start . end)."
+ (cdr (assq 'range token)))
+
+(defsubst bash-completion-tokenize-set-end (token)
+ "Set the end position of TOKEN to the cursor position."
+ (setcdr (bash-completion-tokenize-get-range token) (point)))
+
+(defsubst bash-completion-tokenize-append-str (token str)
+ "Append to TOKEN the string STR."
+ (let ((str-cons (assq 'str token)))
+ (setcdr str-cons (concat (cdr str-cons) str))))
+
+(defsubst bash-completion-tokenize-get-str (token)
+ "Return the TOKEN string."
+ (cdr (assq 'str token)))
+
+(defsubst bash-completion-tokenize-open-quote (tokens)
+ "Return the quote character that was still open in the last token.
+
+TOKENS is a list of token as returned by
+`bash-completion-tokenize'."
+ (cdr (assq 'quote (car (last tokens)))))
+
;;; ---------- Functions: completion
;;;###autoload
@@ -432,30 +459,6 @@ list of strings.
TOKENS should be in the format returned by `bash-completion-tokenize'."
(mapcar 'bash-completion-tokenize-get-str tokens))
-(defsubst bash-completion-tokenize-get-range (token)
- "Return the TOKEN range as a cons: (start . end)."
- (cdr (assq 'range token)))
-
-(defsubst bash-completion-tokenize-set-end (token)
- "Set the end position of TOKEN to the cursor position."
- (setcdr (bash-completion-tokenize-get-range token) (point)))
-
-(defsubst bash-completion-tokenize-append-str (token str)
- "Append to TOKEN the string STR."
- (let ((str-cons (assq 'str token)))
- (setcdr str-cons (concat (cdr str-cons) str))))
-
-(defsubst bash-completion-tokenize-get-str (token)
- "Return the TOKEN string."
- (cdr (assq 'str token)))
-
-(defsubst bash-completion-tokenize-open-quote (tokens)
- "Return the quote character that was still open in the last token.
-
-TOKENS is a list of token as returned by
-`bash-completion-tokenize'."
- (cdr (assq 'quote (car (last tokens)))))
-
(defun bash-completion-tokenize (start end)
"Tokenize the portion of the current buffer between START and END.
@@ -689,8 +692,8 @@ for directory name detection to work."
;; completion is a substring of prefix something's
;; gone wrong. Treat it as one (useless)
;; candidate.
- (setq prefix "")
- (setq rest str))
+ (setq prefix "")
+ str)
;; completion sometimes only applies to the last word, as
;; defined by COMP_WORDBREAKS. This detects and works around
;; this feature.
@@ -1040,7 +1043,7 @@ of the command in the bash completion process buffer."
(unless (accept-process-output process timeout)
(error "Timeout while waiting for an answer from bash-completion
process")))
(goto-char (point-max))
- (delete-backward-char 1))))
+ (delete-char -1))))
(provide 'bash-completion)
;;; bash-completion.el ends here
- [nongnu] elpa/bash-completion 28ec870dd1 019/313: only one -complete method, (continued)
- [nongnu] elpa/bash-completion 28ec870dd1 019/313: only one -complete method, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6a0ada6278 038/313: completed test cases, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7d6236e6e7 100/313: ignore .elc files, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1aff6d8806 084/313: comment about shell-command, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f5384c6176 051/313: A little refactoring, test case for wordbreak completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6f7c2b8b4f 080/313: removed initial version, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a2cf41d7fc 102/313: put in accidentally removed blank line from README, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a8b652d00a 058/313: commented all functions, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b4fe25b51c 060/313: update tests for latest refactorings, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 49ae0ada64 076/313: keep open quote, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion aedcc114dc 105/313: Minor fixes to eliminate byte-compiler warnings.,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 8c771b10d1 082/313: fix typo, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 9ca7e3a77f 085/313: Fixed errors in documentation, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 97cace2287 089/313: Split shopt sets; if one fails the rest can run, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 007765fdd1 111/313: Make bash-completion.el work under emacs trunk., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 102316ebf9 117/313: Test bash-completion-dynamic-complete-standard, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 094da8d6f8 115/313: Fallback to comint-dynamic-simple-complete for shellcommand, even under, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion acdedd0b48 122/313: Remove colon added by mistake in -test.el, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4e8090c081 128/313: Wrap use of obsolete fn in backward compatibility code path., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f639154925 134/313: Add bash-completion-dynamic-complete-nocomint for issue #13, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8fa510a174 136/313: Fix comments in header of bash-completion.el:, ELPA Syncer, 2022/12/03