[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/paredit 0ada66e 023/224: Update the compatibility and comp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/paredit 0ada66e 023/224: Update the compatibility and compiler warning suppression hacks for Emacs 22. |
Date: |
Sat, 7 Aug 2021 09:22:10 -0400 (EDT) |
branch: elpa/paredit
commit 0ada66e5c5b62af4f25b97b21e69bfe587912a81
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>
Update the compatibility and compiler warning suppression hacks for Emacs
22.
The byte-code compiler of GNU Emacs 22 is now clever enough to detect
and flag (funcall 'an-undefined-function ...), so use `autoload' for
the newcomment.el routines instead.
There may be other functions that should be autoloaded, such as
`comment-kill' and `comment-indent'. Currently GNU Emacs 22 signals
no warnings about these, however. I don't know whether these changes
works in GNU Emacs 21 or XEmacs, but they probably do.
darcs-hash:20081025201214-00fcc-350188c1285ba0519aa7bf20fbab0209c1ee21df
---
paredit.el | 46 ++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/paredit.el b/paredit.el
index 28c6b7b..6c705a0 100644
--- a/paredit.el
+++ b/paredit.el
@@ -988,6 +988,29 @@ If the point is in a string or a comment, fill the
paragraph instead,
;;;; Comment Insertion
+;;; This is all a horrible, horrible hack, primarily for GNU Emacs 21,
+;;; in which there is no `comment-or-uncomment-region'.
+
+(autoload 'comment-forward "newcomment")
+(autoload 'comment-normalize-vars "newcomment")
+(autoload 'comment-region "newcomment")
+(autoload 'comment-search-forward "newcomment")
+(autoload 'uncomment-region "newcomment")
+
+(defun paredit-initialize-comment-dwim ()
+ (require 'newcomment)
+ (if (not (fboundp 'comment-or-uncomment-region))
+ (defalias 'comment-or-uncomment-region
+ (lambda (beginning end &optional argument)
+ (interactive "*r\nP")
+ (if (save-excursion (goto-char beginning)
+ (comment-forward (point-max))
+ (<= end (point)))
+ (uncomment-region beginning end argument)
+ (comment-region beginning end argument)))))
+ (defalias 'paredit-initialize-comment-dwim 'comment-normalize-vars)
+ (comment-normalize-vars))
+
(defun paredit-comment-dwim (&optional argument)
"Call the Lisp comment command you want (Do What I Mean).
This is like `comment-dwim', but it is specialized for Lisp editing.
@@ -1016,27 +1039,6 @@ At the top level, where indentation is calculated to be
at column 0,
(comment-kill (if (integerp argument) argument nil))
(comment-indent)))
(t (paredit-insert-comment))))
-
-;;; This is all a horrible, horrible hack, primarily for GNU Emacs 21,
-;;; in which there is no `comment-or-uncomment-region'.
-
-(defun paredit-initialize-comment-dwim ()
- (require 'newcomment)
- (if (not (fboundp 'comment-or-uncomment-region))
- (defalias 'comment-or-uncomment-region
- (lambda (beginning end &optional argument)
- (interactive "*r\nP")
- (funcall (if (save-excursion (goto-char beginning)
- ;; This is undefined until `newcomment'
- ;; is loaded. Using `funcall' with a
- ;; symbol shuts up the compiler.
- (funcall 'comment-forward (point-max))
- (<= end (point)))
- 'uncomment-region
- 'comment-region)
- beginning end argument))))
- (defalias 'paredit-initialize-comment-dwim 'comment-normalize-vars)
- (comment-normalize-vars))
(defun paredit-comment-on-line-p ()
"True if there is a comment on the line following point.
@@ -1049,7 +1051,7 @@ This is expected to be called only in
`paredit-comment-dwim'; do not
;; COMMENT-P to true; if not, it will be nil.
(while (progn
(setq comment-p ;t -> no error
- (funcall 'comment-search-forward (point-at-eol) t))
+ (comment-search-forward (point-at-eol) t))
(and comment-p
(or (paredit-in-string-p)
(paredit-in-char-p (1- (point))))))
- [nongnu] branch elpa/paredit created (now 8330a41), ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit de45eb6 005/224: Changes for version 9., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 9464588 016/224: Changes for version 20., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 0ada66e 023/224: Update the compatibility and compiler warning suppression hacks for Emacs 22.,
ELPA Syncer <=
- [nongnu] elpa/paredit f7c26b9 027/224: Fix kill & yank errors with `paredit-lose-if-not-in-sexp' while barfing., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 929e547 038/224: Fix some opening remarks about enabling paredit mode., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 90c7eda 042/224: Revive `paredit-semicolon', with better behaviour., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit a26a9a7 075/224: Permit joining adjacent lists without intervening whitespace., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit f27c480 070/224: Implement `paredit-override-check-parens-function'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 67caf7e 071/224: Eliminate fboundp check for `check-parens' in `paredit-check-region'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit ae53a2c 077/224: Show point in `paredit-semicolon' example., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 26a3ddb 085/224: Add `paredit-doublequote' examples at end of string and in comment., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 33463ae 102/224: Third argument to `indent-region' is not optional in GNU Emacs 21., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit c91bc2f 099/224: Fix bug in change to check structure in backward-delete of comment end., ELPA Syncer, 2021/08/07