[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil c61bc34b40: Defer loading of calc.el
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil c61bc34b40: Defer loading of calc.el |
Date: |
Wed, 22 Mar 2023 15:00:23 -0400 (EDT) |
branch: elpa/evil
commit c61bc34b40f1f0605a999e874e837d1e8bda85af
Author: Axel Forsman <axelsfor@gmail.com>
Commit: Axel Forsman <axelsfor@gmail.com>
Defer loading of calc.el
The function calc-eval is autoloaded so there is no need to eagerly
require it.
---
evil-common.el | 34 +++++++++++++---------------------
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/evil-common.el b/evil-common.el
index 989becfdd5..c9d247e3b4 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -24,14 +24,13 @@
;; You should have received a copy of the GNU General Public License
;; along with Evil. If not, see <http://www.gnu.org/licenses/>.
+;;; Code:
+
(require 'evil-vars)
(require 'evil-digraphs)
(require 'rect)
(require 'thingatpt)
(require 'cl-lib)
-(require 'calc)
-
-;;; Code:
(declare-function evil-visual-state-p "evil-states")
(declare-function evil-visual-restore "evil-states")
@@ -40,10 +39,6 @@
(declare-function evil-ex-p "evil-ex")
(declare-function evil-set-jump "evil-jumps")
-(unless (require 'windmove nil t)
- (message "evil: Could not load `windmove', \
-window commands not available."))
-
;;; Compatibility with different Emacs versions
;; x-set-selection and x-get-selection have been deprecated since 25.1
@@ -1952,33 +1947,30 @@ or a marker object pointing nowhere."
(defun evil-swap-out-markers ()
"Turn markers into file references when the buffer is killed."
- (and buffer-file-name
- (dolist (entry evil-markers-alist)
- (and (markerp (cdr entry))
- (eq (marker-buffer (cdr entry)) (current-buffer))
- (setcdr entry (cons buffer-file-name
- (marker-position (cdr entry))))))))
+ (when buffer-file-name
+ (dolist (entry evil-markers-alist)
+ (and (markerp (cdr entry))
+ (eq (marker-buffer (cdr entry)) (current-buffer))
+ (setcdr entry (cons buffer-file-name
+ (marker-position (cdr entry))))))))
(put 'evil-swap-out-markers 'permanent-local-hook t)
+(defvar calc-multiplication-has-precedence)
(defun evil--eval-expr (input)
"Eval INPUT and return stringified result, if of a suitable type.
If INPUT starts with a number, +, -, or . use `calc-eval' instead."
- (let* ((first-char (car (remove ?\s (string-to-list input))))
- (calcable-p (and first-char (or (<= ?0 first-char ?9)
- (memq first-char '(?- ?+ ?.)))))
+ (let* ((calcable-p (string-match-p "\\`[[:space:]]*[0-9+.-]" input))
(result (if calcable-p
(let ((calc-multiplication-has-precedence nil))
(calc-eval input))
(eval (car (read-from-string input))))))
(cond
- (calcable-p result)
- ((or (stringp result)
- (numberp result)
- (symbolp result))
+ ((stringp result) result)
+ ((or (numberp result) (symbolp result))
(format "%s" result))
((sequencep result)
(mapconcat (lambda (x) (format "%s" x)) result "\n"))
- (t (user-error "Using %s as a string" (type-of result))))))
+ (t (user-error "Using `%s' as a string" (type-of result))))))
(defvar evil-paste-clear-minibuffer-first nil
"`evil-paste-before' cannot have `delete-minibuffer-contents' called before
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/evil c61bc34b40: Defer loading of calc.el,
ELPA Syncer <=
- Prev by Date:
[elpa] externals/jit-spell 03f8050481 1/2: Refinement to Hunspell apostrophe hack
- Next by Date:
[nongnu] elpa/xah-fly-keys e7408e5b60: added an optimot layout, removed beopy layout. optimot shouldn't be added because it's used by maybe just a hundred people in the world. however, cletip really ask for it. Also, he added beopy before which was added years ago in the early days, and beopy is another layout nobody heared of. from now on, only well-known keyboard layout should be supported in xah-fly-keys. you can always put it to your init. optimot may be removed in the future.
- Previous by thread:
[elpa] externals/jit-spell updated (e93e833722 -> 2a34f68726)
- Next by thread:
[nongnu] elpa/xah-fly-keys e7408e5b60: added an optimot layout, removed beopy layout. optimot shouldn't be added because it's used by maybe just a hundred people in the world. however, cletip really ask for it. Also, he added beopy before which was added years ago in the early days, and beopy is another layout nobody heared of. from now on, only well-known keyboard layout should be supported in xah-fly-keys. you can always put it to your init. optimot may be removed in the future.
- Index(es):