[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 09/56: Don't require cl. (crisp-override-meta-x): Doc fix. (crisp
From: |
Luke Lee |
Subject: |
[elpa] 09/56: Don't require cl. (crisp-override-meta-x): Doc fix. (crisp-last-last-command): Doc fix. (mark-something): Function deleted. (crisp-mark-line): Avoid using mark-something. (crisp-region-active): Renamed from region-active. (crisp-set-clipboard): Renamed from copy-primary-selection. (crisp-kill-region): Renamed from kill-primary-selection. (crisp-yank-clipboard): Renamed from yank-clipboard-selection. |
Date: |
Thu, 28 Aug 2014 02:21:39 +0000 |
lukelee pushed a commit to branch master
in repository elpa.
commit afa60c32dd9365266b31342c86c04c8878696987
Author: Richard M. Stallman <address@hidden>
Date: Sat Jul 25 20:58:03 1998 +0000
Don't require cl. (crisp-override-meta-x): Doc fix.
(crisp-last-last-command): Doc fix. (mark-something): Function deleted.
(crisp-mark-line): Avoid using mark-something. (crisp-region-active): Renamed
from region-active. (crisp-set-clipboard): Renamed from copy-primary-selection.
(crisp-kill-region): Renamed from kill-primary-selection.
(crisp-yank-clipboard): Renamed from yank-clipboard-selection.
---
lisp/emulation/crisp.el | 89 ++++++++++++++++++++---------------------------
1 files changed, 38 insertions(+), 51 deletions(-)
diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el
index f71b299..59bf29f 100644
--- a/lisp/emulation/crisp.el
+++ b/lisp/emulation/crisp.el
@@ -22,8 +22,6 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-;; CRiSP is a registered trademark of Foxtrot Systems Ltd.
-
;;; Commentary:
;; Keybindings and minor functions to duplicate the functionality and
@@ -58,8 +56,6 @@
;; Code:
-(require 'cl)
-
;; local variables
(defgroup crisp nil
@@ -92,7 +88,7 @@ indicates CRiSP mode is enabled."
(defcustom crisp-override-meta-x t
"*Controls overriding the normal Emacs M-x key binding in the CRiSP emulator.
-Normally the CRiSP emulator rebinds M-x to save-buffers-exit-emacs and
+Normally the CRiSP emulator rebinds M-x to `save-buffers-exit-emacs', and
provides the usual M-x functionality on the F10 key. If this variable
is non-nil, M-x will exit Emacs."
:type 'boolean
@@ -121,44 +117,25 @@ does not load the scroll-all package."
;; Silence the byte-compiler.
(defvar crisp-last-last-command nil
- "The previous value of last-command.")
+ "The previous value of `last-command'.")
;; The cut and paste routines are different between XEmacs and Emacs
;; so we need to set up aliases for the functions.
-(if (and (not (fboundp 'copy-primary-selection))
- (fboundp 'clipboard-kill-ring-save))
- (defalias 'copy-primary-selection 'clipboard-kill-ring-save))
-
-(if (and (not (fboundp 'kill-primary-selection))
- (fboundp 'clipboard-kill-region))
- (defalias 'kill-primary-selection 'clipboard-kill-region))
-
-(if (and (not (fboundp 'yank-clipboard-selection))
- (fboundp 'clipboard-yank))
- (defalias 'yank-clipboard-selection 'clipboard-yank))
-
-;; 'mark-something is very useful for marking arbitrary areas
-;; so I stole it from simple.el in XEmacs.
-
-(if (not (fboundp 'mark-something))
- (defun mark-something (mark-fn movement-fn arg)
- "Compatibility function swiped from XEmacs."
- (let (newmark (pushp t))
- (save-excursion
- (if (and (eq last-command mark-fn) (mark))
- ;; Extend the previous state in the same direction:
- (progn
- (if (< (mark) (point)) (setq arg (- arg)))
- (goto-char (mark))
- (setq pushp nil)))
- (funcall movement-fn arg)
- (setq newmark (point)))
- (if pushp
- (push-mark newmark nil t)
- ;; Do not mess with the mark stack, but merely adjust the previous state:
- (set-mark newmark)
- (activate-region)))))
+(defalias 'crisp-set-clipboard
+ (if (fboundp 'clipboard-kill-ring-save)
+ 'clipboard-kill-ring-save
+ 'copy-primary-selection))
+
+(defalias 'crisp-kill-region
+ (if (fboundp 'clipboard-kill-region)
+ 'clipboard-kill-region
+ 'kill-primary-selection))
+
+(defalias 'crisp-yank-clipboard
+ (if (fboundp 'clipboard-yank)
+ 'clipboard-yank
+ 'yank-clipboard-selection))
;; force transient-mark-mode in Emacs, so that the marking routines
;; work as expected. If the user turns off transient mark mode,
@@ -169,7 +146,7 @@ does not load the scroll-all package."
(if (fboundp 'transient-mark-mode)
(transient-mark-mode t))
-(defun region-active ()
+(defun crisp-region-active ()
"Compatibility function to test for an active region."
(if (boundp 'zmacs-region-active-p)
zmacs-region-active-p
@@ -212,10 +189,10 @@ does not load the scroll-all package."
(define-key crisp-mode-map [(kp-subtract)] 'crisp-kill-line)
;; just to cover all the bases (GNU Emacs, for instance)
(define-key crisp-mode-map [(f24)] 'crisp-kill-line)
-(define-key crisp-mode-map [(insert)] 'yank-clipboard-selection)
-(define-key crisp-mode-map [(f16)] 'copy-primary-selection) ; copy on
Sun5 kbd
-(define-key crisp-mode-map [(f20)] 'kill-primary-selection) ; cut on
Sun5 kbd
-(define-key crisp-mode-map [(f18)] 'yank-clipboard-selection) ; paste
on Sun5 kbd
+(define-key crisp-mode-map [(insert)] 'crisp-yank-clipboard)
+(define-key crisp-mode-map [(f16)] 'crisp-set-clipboard) ; copy on
Sun5 kbd
+(define-key crisp-mode-map [(f20)] 'crisp-kill-region) ; cut on Sun5
kbd
+(define-key crisp-mode-map [(f18)] 'crisp-yank-clipboard) ; paste on
Sun5 kbd
(define-key crisp-mode-map [(control f)] 'fill-paragraph-or-region)
(define-key crisp-mode-map [(meta d)] (lambda ()
@@ -295,17 +272,27 @@ If ARG, insert results at point."
(defun crisp-mark-line (arg)
"Put mark at the end of line. Arg works as in `end-of-line'."
(interactive "p")
- (mark-something 'crisp-mark-line 'end-of-line arg))
+ (save-excursion
+ (if (and (eq last-command 'crisp-mark-line) (mark))
+ ;; Extend the previous state in the same direction:
+ (progn
+ (if (< (mark) (point)) (setq arg (- arg)))
+ (goto-char (mark))
+ (end-of-line arg)
+ ;; Do not mess with the mark stack, but merely adjust the previous
state:
+ (set-mark (point)))
+ (end-of-line arg)
+ (push-mark (point) nil t))))
(defun crisp-kill-line (arg)
"Mark and kill line(s).
Marks from point to end of the current line (honoring prefix arguments),
copies the region to the kill ring and clipboard, and then deletes it."
(interactive "*p")
- (if (region-active)
- (call-interactively 'kill-primary-selection)
+ (if (crisp-region-active)
+ (call-interactively 'crisp-kill-region)
(crisp-mark-line arg)
- (call-interactively 'kill-primary-selection)))
+ (call-interactively 'crisp-kill-region)))
(defun crisp-copy-line (arg)
"Mark and copy line(s).
@@ -313,10 +300,10 @@ Marks from point to end of the current line (honoring
prefix arguments),
copies the region to the kill ring and clipboard, and then deactivates
the region."
(interactive "*p")
- (if (region-active)
- (call-interactively 'copy-primary-selection)
+ (if (crisp-region-active)
+ (call-interactively 'crisp-set-clipboard)
(crisp-mark-line arg)
- (call-interactively 'copy-primary-selection))
+ (call-interactively 'crisp-set-clipboard))
;; clear the region after the operation is complete
;; XEmacs does this automagically, Emacs doesn't.
(if (boundp 'mark-active)
- [elpa] 49/56: Reduce use of (require 'cl). * admin/bzrmerge.el: Use cl-lib. * leim/quail/hangul.el: Don't require CL. * leim/quail/ipa.el: Use cl-lib. * vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el: * vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el: * register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el: * msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el: * international/quail.el, info-xref.el, imenu.el, image-mode.el: * font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el: * battery.el, avoid.el, abbrev.el: Use cl-lib. * vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el: * vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el: * jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el: * emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el: * calculator.el, autorevert.el, apropos.el: Don't require CL. * emacs-bytecomp.el (byte-recompile-directory, display-call-tree) (byte-compile-unfold-bcf, byte-compile-check-variable): * emacs-byte-opt.el (byte-compile-trueconstp) (byte-compile-nilconstp): * emacs-autoload.el (make-autoload): Use pcase. * face-remap.el (text-scale-adjust): Simplify pcase patterns., (continued)
- [elpa] 49/56: Reduce use of (require 'cl). * admin/bzrmerge.el: Use cl-lib. * leim/quail/hangul.el: Don't require CL. * leim/quail/ipa.el: Use cl-lib. * vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el: * vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el: * register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el: * msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el: * international/quail.el, info-xref.el, imenu.el, image-mode.el: * font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el: * battery.el, avoid.el, abbrev.el: Use cl-lib. * vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el: * vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el: * jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el: * emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el: * calculator.el, autorevert.el, apropos.el: Don't require CL. * emacs-bytecomp.el (byte-recompile-directory, display-call-tree) (byte-compile-unfold-bcf, byte-compile-check-variable): * emacs-byte-opt.el (byte-compile-trueconstp) (byte-compile-nilconstp): * emacs-autoload.el (make-autoload): Use pcase. * face-remap.el (text-scale-adjust): Simplify pcase patterns., Luke Lee, 2014/08/27
- [elpa] 51/56: Aliases to defcustoms must come before the defcustom., Luke Lee, 2014/08/27
- [elpa] 05/56: (crisp-last-last-command): Renamed from last-last-command and defvar added., Luke Lee, 2014/08/27
- [elpa] 01/56: Initial revision, Luke Lee, 2014/08/27
- [elpa] 04/56: (crisp-load-scroll-all): Renamed from ...-lock. (crisp-mode): Use scroll-all... not scroll-lock..., Luke Lee, 2014/08/27
- [elpa] 03/56: Install the proper version., Luke Lee, 2014/08/27
- [elpa] 06/56: (crisp-mode): Add autoload cookie., Luke Lee, 2014/08/27
- [elpa] 07/56: Customized., Luke Lee, 2014/08/27
- [elpa] 10/56: (crisp-mark-line): Greatly simplified., Luke Lee, 2014/08/27
- [elpa] 11/56: Fix header comments., Luke Lee, 2014/08/27
- [elpa] 09/56: Don't require cl. (crisp-override-meta-x): Doc fix. (crisp-last-last-command): Doc fix. (mark-something): Function deleted. (crisp-mark-line): Avoid using mark-something. (crisp-region-active): Renamed from region-active. (crisp-set-clipboard): Renamed from copy-primary-selection. (crisp-kill-region): Renamed from kill-primary-selection. (crisp-yank-clipboard): Renamed from yank-clipboard-selection.,
Luke Lee <=
- [elpa] 12/56: (crisp-mode-map): Don't inherit global-map. Enter it on minor-mode-map-alist. (crisp-mode): Re-named from `crsip-mode-enabled'. Users changed. Autoload. Add custom setter. (crisp-mark-line): Doc fix. (crisp-mode): Autoload. Re-write not to frob keymaps directly. (crisp-mode-hook): Define., Luke Lee, 2014/08/27
- [elpa] 13/56: (crisp-submit-bug-report): Function deleted. Binding deleted also., Luke Lee, 2014/08/27
- [elpa] 14/56: (crisp-mode): (defcustom) Initialize with custom-initialize-default to avoid infinite loop. (crisp-mode): (defun) Call transient-mark-mode here, not when loading the file. Run crisp-mode-hook here, and run crisp-load-hook when loading the file., Luke Lee, 2014/08/27
- [elpa] 15/56: Update author address., Luke Lee, 2014/08/27
- [elpa] 08/56: Added next-buffer/previous-buffer keybindings (bound to M-n/M-p). (crisp-unbury-buffer): New function., Luke Lee, 2014/08/27
- [elpa] 16/56: (brief-mode): New alias., Luke Lee, 2014/08/27
- [elpa] 17/56: Trailing whitepace deleted., Luke Lee, 2014/08/27
- [elpa] 18/56: * man.el (Man-getpage-in-background): Always use `setenv' for environment variables, instead of modifying process-environment directly. The previous version let-bound process-environment -- the let-binding is skipped for GROFF_NO_SGR because there is already a let-binding in effect in some outer scope., Luke Lee, 2014/08/27
- [elpa] 20/56: Add arch taglines, Luke Lee, 2014/08/27
- [elpa] 22/56: Sync to HEAD, Luke Lee, 2014/08/27