[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt ea22302660 258/323: Delete beardbolt-split.el
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt ea22302660 258/323: Delete beardbolt-split.el, doesn't justify separate file |
Date: |
Thu, 9 Mar 2023 10:58:36 -0500 (EST) |
branch: externals/beardbolt
commit ea22302660b1e32762e3922d372fdeba0f6567a9
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Delete beardbolt-split.el, doesn't justify separate file
* beardbolt-split.el: Remove
* beardbolt.el (beardbolt-split-rm-single, beardbolt-split-rm-double): Move
here
---
beardbolt-split.el | 74 ------------------------------------------------------
beardbolt.el | 17 ++++++++++++-
2 files changed, 16 insertions(+), 75 deletions(-)
diff --git a/beardbolt-split.el b/beardbolt-split.el
deleted file mode 100644
index b145efe052..0000000000
--- a/beardbolt-split.el
+++ /dev/null
@@ -1,74 +0,0 @@
-;;; beardbolt-split.el --- An Elisp library to edit command lines -*-
lexical-binding: t; -*-
-
-;; Copyright (C) 2018 Jay Kamat
-;; Author: Jay Kamat <jaygkamat@gmail.com>
-;; Version: 0.1.0
-;; Keywords: compilation, tools
-;; URL: http://gitlab.com/jgkamat/beardbolt
-;; Package-Requires: ((emacs "25.1"))
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU Affero General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU Affero General Public License for more details.
-
-;; You should have received a copy of the GNU Affero General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This is a small library for editing command line parameters, passed as
-;; a string. For example, given:
-;; gcc -o one two -c -S
-;; This library tries to make it possible to remove '-o one' '-c' and '-S'.
-;;
-;; This is not easy to do without bugs, and therefore this is mostly
incomplete.
-;; Hopefully we will never see more complicated formats (such as quoted
arguments)
-;; in generated commands, or we will need to write a parser.
-
-;;; Requires:
-
-(require 'cl-lib)
-
-;;; Variables
-
-(defvar beardbolt-split--regexp (rx (1+ blank)))
-
-;;; Code:
-
-(defun beardbolt-split-rm-single (cmd flag &optional comparator)
- "Remove a single FLAG from CMD.
-
-Optionally compares using COMPARATOR."
- (let ((cmd (split-string cmd beardbolt-split--regexp))
- (comparator (or comparator #'string=)))
- (mapconcat
- #'identity
- (cl-remove-if (apply-partially comparator flag) cmd)
- " ")))
-
-(defun beardbolt-split-rm-double (cmd flag)
- "Remove a single FLAG and arg from CMD."
- (let ((cmd (split-string cmd beardbolt-split--regexp))
- (removed nil))
- (mapconcat
- #'identity
- (cl-remove-if (lambda (f)
- (cond
- ((string= f flag)
- (setq removed t))
- (removed
- (setq removed nil)
- t)
- (t nil)))
- cmd)
- " ")))
-
-(provide 'beardbolt-split)
-
-;;; beardbolt-split.el ends here
diff --git a/beardbolt.el b/beardbolt.el
index 8049a89788..b946ed6b2c 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -76,7 +76,6 @@
(require 'color)
(require 'beardbolt-java)
-(require 'beardbolt-split)
;;; Code:
;;;; Customize:
@@ -414,6 +413,22 @@ Return value is quoted for passing to the shell."
(declare (debug (symbolp form)))
`(set (make-local-variable ,var) ,val))
+(defun beardbolt-split-rm-single (cmd flag &optional test)
+ "Remove a single FLAG from CMD. Test according to TEST."
+ (mapconcat #'identity (cl-remove flag (split-string cmd)
+ :test (or test #'string=))
+ " "))
+
+(defun beardbolt-split-rm-double (cmd flag)
+ "Remove a single FLAG and arg from CMD."
+ (cl-loop while split with split = (split-string cmd)
+ for i from 0
+ for probe = (car split)
+ if (string= probe flag) do (setq split (cddr split))
+ else
+ concat (and (cl-plusp i) " ")
+ and concat probe and do (setq split (cdr split))))
+
;;;; Language Functions
;;;;; Compile Commands
- [elpa] externals/beardbolt af37266681 227/323: Rename rmsbolt--cleanup-overlays -> rmsbolt--remove-overlays, (continued)
- [elpa] externals/beardbolt af37266681 227/323: Rename rmsbolt--cleanup-overlays -> rmsbolt--remove-overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f3fe3d24db 230/323: Don't use a timer for updating overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 6d0d799d44 233/323: Fix docstring warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b4f31813dc 240/323: Auto stop an existing compilation, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 50cd4c6d0c 234/323: Use setq for `rmsbolt-dir`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9c56c62993 247/323: Update texi docs, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3baf531b55 238/323: Refactor: Move let binding closer to point of usage, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 24ac775643 246/323: Support Nim 1.6.6, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt e634757395 235/323: Remove unneeded lambda, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3514e6f288 237/323: rmsbolt-compile: Only ask to save the current buffer, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ea22302660 258/323: Delete beardbolt-split.el, doesn't justify separate file,
ELPA Syncer <=
- [elpa] externals/beardbolt 7619539a86 243/323: starters/elisp: Fix compiler warning, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d37371b088 249/323: Fix byte-compilation warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 1873e605ab 256/323: Remove unused test/test-helper.el, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ce91938102 261/323: Simplify management of bb--temp-dir, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 264b614805 264/323: * beardbolt.el (bb-compile): Better handling of hack-local-variables., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ed99686703 267/323: Handle TTYs with unknown background color, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 715f132d0e 263/323: Started rewriting. Too many changes to mention., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 325327bc70 273/323: Use inhibit-modification-hooks when modifying buffer, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5131185d13 272/323: Add a Makefile, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9aba82b6cd 271/323: Update starter/test files, ELPA Syncer, 2023/03/09