[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion e77c841dac 107/313: Merge pull request #3
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion e77c841dac 107/313: Merge pull request #3 from seanmcl/master |
Date: |
Sat, 3 Dec 2022 10:59:21 -0500 (EST) |
branch: elpa/bash-completion
commit e77c841dacbbf37cc0bcc0b8577a62ba9904793f
Merge: 983f5c28e9 aedcc114dc
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Merge pull request #3 from seanmcl/master
Fix compilation warnings
---
bash-completion.el | 63 ++++++++++++++++++++++++++++--------------------------
1 file changed, 33 insertions(+), 30 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 263fa39969..ed34c5942e 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 c10cfef5b8 015/313: complex line split, (continued)
- [nongnu] elpa/bash-completion c10cfef5b8 015/313: complex line split, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b5c2fbf4a2 014/313: add hooks, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 9eb026ae0b 025/313: fixed current directory for adding slash, workaround for bash ~ expansion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 02d1acf260 030/313: wordbreaks, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5931a2ba43 037/313: completion-fix, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a78fd6b587 044/313: turn off mailwarn and checkjobs, continue if this failed, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0ffaad3ef0 035/313: wordbreak-split, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 80cd654c35 043/313: turn off mailwarn and checkjobs, continue if this failed, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1c6b2efb67 040/313: enormous test, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fc96b621e2 034/313: pass all tests in bash-completion, new test for -send, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e77c841dac 107/313: Merge pull request #3 from seanmcl/master,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 062acfab3e 052/313: updated documentation, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 75e5de1494 066/313: fix initial completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ffe8bc46a2 097/313: Ignore 'cd' stdout, in case someone (like me) is crazy enough to override the builtin command, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b1ff763566 104/313: Clear PROMPT_COMMAND when creating bash process, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6b1be0da4c 048/313: from split to tokenize and parse, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 679d6f7765 075/313: bugfix at try afterbreak, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8cc9c2fdc6 074/313: bugfix, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 96d764fb18 095/313: removed unnecessary quote escapes in documentation, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion db0545f469 093/313: Add a markdown README file, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3eb77ec9c4 086/313: Moved shell configuration into config. Got rid of */init.el, going, ELPA Syncer, 2022/12/03