Commit 79d585c2 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/obsolete: Use lexical-binding

Use lexical-binding in all the lisp/obsolete/*.el files.
While at it, removed redundant :group arguments and used #' to quote
functions.  Commented out the key bindings which the #' revealed
to lead to non-existing commands, and replaced those revealed to be obsolete.

* lisp/obsolete/cl-compat.el: Use cl-lib.

* lisp/obsolete/cust-print.el: Assume `defalias` exists.
(with-custom-print): Use `declare`.

* lisp/obsolete/iswitchb.el (iswitchb-init-XEmacs-trick)
(iswitchb-xemacs-backspacekey): Remove functions.

* lisp/obsolete/landmark.el (landmark, landmark-nslify-wts):
Prefer `apply` to `eval`.

* lisp/obsolete/longlines.el (longlines-mode): Don't use `add-to-list`
on a hook.

* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): Use `clear-string`.

* lisp/obsolete/pgg-pgp.el (pgg-pgp-encrypt-region): Remove oddly
unused var `passphrase`.
(pgg-pgp-verify-region): Declare var `jam-zcat-filename-list`.

* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-encrypt-region): Remove oddly
unused var `passphrase`.
(pgg-pgp5-verify-region): Declare var `jam-zcat-filename-list`.

* lisp/obsolete/pgg.el: Remove some XEmacs compatibility code.
(pgg-run-at-time, pgg-cancel-timer, pgg-clear-string): Remove functions.
Use their core equivalent instead.

* lisp/obsolete/rcompile.el (remote-compile): Remove unused vars `l`,
`l-host`, `l-user`, and `localname`.

* lisp/obsolete/starttls.el (starttls-any-program-available):
Use `define-obsolete-function-alias`.

* lisp/obsolete/tls.el (tls-format-message): Delete function, use
`format-message` instead.

* lisp/obsolete/url-ns.el (url-ns-prefs): Use `with-current-buffer`
and `dlet`.

* lisp/obsolete/vip.el (vip-escape-to-emacs): Remove unused var `key`.
(vip-command-argument, vip-read-string, ex-delete, ex-line): Remove
unused var `conditions`.
(ex-map): Use a closure instead of `eval`.
(ex-set): Make it an alias of `set-variable`.
(ex-substitute): Remove unused var `cont`.

* lisp/obsolete/abbrevlist.el:
* lisp/obsolete/bruce.el:
* lisp/obsolete/cc-compat.el:
* lisp/obsolete/cl-compat.el:
* lisp/obsolete/cl.el:
* lisp/obsolete/complete.el:
* lisp/obsolete/crisp.el:
* lisp/obsolete/cust-print.el:
* lisp/obsolete/erc-compat.el:
* lisp/obsolete/erc-hecomplete.el:
* lisp/obsolete/eudcb-ph.el:
* lisp/obsolete/fast-lock.el:
* lisp/obsolete/gs.el:
* lisp/obsolete/gulp.el:
* lisp/obsolete/html2text.el:
* lisp/obsolete/info-edit.el:
* lisp/obsolete/iswitchb.el:
* lisp/obsolete/landmark.el:
* lisp/obsolete/lazy-lock.el:
* lisp/obsolete/longlines.el:
* lisp/obsolete/mailpost.el:
* lisp/obsolete/mantemp.el:
* lisp/obsolete/meese.el:
* lisp/obsolete/messcompat.el:
* lisp/obsolete/metamail.el:
* lisp/obsolete/mouse-sel.el:
* lisp/obsolete/nnir.el:
* lisp/obsolete/old-emacs-lock.el:
* lisp/obsolete/otodo-mode.el:
* lisp/obsolete/patcomp.el:
* lisp/obsolete/pc-mode.el:
* lisp/obsolete/pc-select.el:
* lisp/obsolete/pgg-def.el:
* lisp/obsolete/pgg-gpg.el:
* lisp/obsolete/pgg-parse.el:
* lisp/obsolete/pgg-pgp.el:
* lisp/obsolete/pgg-pgp5.el:
* lisp/obsolete/pgg.el:
* lisp/obsolete/rcompile.el:
* lisp/obsolete/s-region.el:
* lisp/obsolete/sb-image.el:
* lisp/obsolete/sregex.el:
* lisp/obsolete/starttls.el:
* lisp/obsolete/sup-mouse.el:
* lisp/obsolete/terminal.el:
* lisp/obsolete/tls.el:
* lisp/obsolete/tpu-edt.el:
* lisp/obsolete/tpu-extras.el:
* lisp/obsolete/tpu-mapper.el:
* lisp/obsolete/url-ns.el:
* lisp/obsolete/vc-arch.el:
* lisp/obsolete/vi.el:
* lisp/obsolete/vip.el:
* lisp/obsolete/ws-mode.el:
* lisp/obsolete/yow.el: Use lexical-binding.
parent 59698d92
Pipeline #9463 passed with stages
in 8 minutes and 51 seconds
;;; abbrevlist.el --- list one abbrev table alphabetically ordered
;;; abbrevlist.el --- list one abbrev table alphabetically ordered -*- lexical-binding: t; -*-
;; Copyright (C) 1986, 1992, 2001-2021 Free Software Foundation, Inc.
;; Suggested by a previous version by Gildea.
......@@ -38,7 +38,7 @@
(function (lambda (abbrev)
(setq abbrev-list (cons abbrev abbrev-list))))
abbrev-table)
(setq abbrev-list (sort abbrev-list 'string-lessp))
(setq abbrev-list (sort abbrev-list #'string-lessp))
(while abbrev-list
(if (> (+ first-column 40) (window-width))
(progn
......
;;; bruce.el --- bruce phrase utility for overloading the Communications
;;; bruce.el --- bruce phrase utility for overloading the Communications -*- lexical-binding: t; -*-
;;; Decency Act snoops, if any.
;; Copyright (C) 1988, 1993, 1997, 2001-2021 Free Software Foundation,
......@@ -113,13 +113,11 @@
(defcustom bruce-phrases-file "~/bruce.lines"
"Keep your favorite phrases here."
:type 'file
:group 'bruce)
:type 'file)
(defcustom bruce-phrase-default-count 15
"Default number of phrases to insert."
:type 'integer
:group 'bruce)
:type 'integer)
;;;###autoload
(defun bruce ()
......
;;; cc-compat.el --- cc-mode compatibility with c-mode.el confusion
;;; cc-compat.el --- cc-mode compatibility with c-mode.el confusion -*- lexical-binding: t; -*-
;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
......@@ -156,7 +156,7 @@ This is in addition to c-continued-statement-offset.")
(if bracep 0 c-indent-level)))))
(defun cc-substatement-open-offset (langelem)
(defun cc-substatement-open-offset (_langelem)
(+ c-continued-statement-offset c-continued-brace-offset))
......
;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility)
;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility) -*- lexical-binding: t; -*-
;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
......@@ -46,31 +46,23 @@
;;; Code:
;; This used to be:
;; (or (featurep 'cl) (require 'cl))
;; which just has the effect of fooling the byte-compiler into not
;; loading cl when compiling. However, that leads to some bogus
;; compiler warnings. Loading cl when compiling cannot do any harm,
;; because for a long time bootstrap-emacs contained 'cl, due to being
;; dumped from uncompiled files that eval-when-compile'd cl. So every
;; file was compiled with 'cl loaded.
(require 'cl)
(require 'cl-lib)
;;; Keyword routines not supported by new package.
(defmacro defkeyword (x &optional doc)
(list* 'defconst x (list 'quote x) (and doc (list doc))))
(cl-list* 'defconst x (list 'quote x) (and doc (list doc))))
(defun keyword-of (sym)
(or (keywordp sym) (keywordp (intern (format ":%s" sym)))))
;;; Multiple values. Note that the new package uses a different
;;; convention for multiple values. The following definitions
;;; emulate the old convention; all function names have been changed
;;; by capitalizing the first letter: Values, Multiple-value-*,
;;; to avoid conflict with the new-style definitions in cl-macs.
;; Multiple values. Note that the new package uses a different
;; convention for multiple values. The following definitions
;; emulate the old convention; all function names have been changed
;; by capitalizing the first letter: Values, Multiple-value-*,
;; to avoid conflict with the new-style definitions in cl-macs.
(defvar *mvalues-values* nil)
......@@ -79,7 +71,7 @@
(car val-forms))
(defun Values-list (val-forms)
(apply 'values val-forms))
(apply #'cl-values val-forms))
(defmacro Multiple-value-list (form)
(list 'let* (list '(*mvalues-values* nil) (list '*mvalues-temp* form))
......@@ -95,7 +87,7 @@
(defmacro Multiple-value-bind (vars form &rest body)
(declare (indent 2))
(list* 'multiple-value-bind vars (list 'Multiple-value-list form) body))
(cl-list* 'multiple-value-bind vars (list 'Multiple-value-list form) body))
(defmacro Multiple-value-setq (vars form)
(declare (indent 2))
......@@ -103,17 +95,16 @@
(defmacro Multiple-value-prog1 (form &rest body)
(declare (indent 1))
(list 'prog1 form (list* 'let '((*mvalues-values* nil)) body)))
(list 'prog1 form (cl-list* 'let '((*mvalues-values* nil)) body)))
;;; Routines for parsing keyword arguments.
(defun build-klist (arglist keys &optional allow-others)
(let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist))))
(let ((res (Multiple-value-call #'cl-mapcar 'cons (unzip-lists arglist))))
(or allow-others
(with-suppressed-warnings ((obsolete set-difference))
(let ((bad (set-difference (mapcar 'car res) keys)))
(if bad (error "Bad keywords: %s not in %s" bad keys)))))
(let ((bad (cl-set-difference (mapcar #'car res) keys)))
(if bad (error "Bad keywords: %s not in %s" bad keys))))
res))
(defun extract-from-klist (klist key &optional def)
......@@ -131,18 +122,16 @@
(funcall (or test 'eql) item elt))))
(defun safe-idiv (a b)
(with-suppressed-warnings ((obsolete signum))
(let* ((q (/ (abs a) (abs b)))
(s (* (signum a) (signum b))))
(Values q (- a (* s q b)) s))))
(let* ((q (/ (abs a) (abs b)))
(s (* (cl-signum a) (cl-signum b))))
(Values q (- a (* s q b)) s)))
;; Internal routines.
(defun pair-with-newsyms (oldforms)
(with-suppressed-warnings ((obsolete mapcar*))
(let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms)))
(Values (mapcar* 'list newsyms oldforms) newsyms))))
(let ((newsyms (mapcar (lambda (_) (make-symbol "--cl-var--")) oldforms)))
(Values (cl-mapcar #'list newsyms oldforms) newsyms)))
(defun zip-lists (evens odds)
(cl-mapcan 'list evens odds))
......@@ -154,7 +143,7 @@
(Values (nreverse e) (nreverse o))))
(defun reassemble-argslists (list)
(let ((n (apply 'min (mapcar 'length list))) (res nil))
(let ((n (apply #'min (mapcar #'length list))) (res nil))
(while (>= (setq n (1- n)) 0)
(setq res (cons (mapcar (function (lambda (x) (elt x n))) list) res)))
res))
......
......@@ -331,7 +331,7 @@ The two cases that are handled are:
(cddr f))))
(if (and cl-closure-vars
(cl--expr-contains-any body cl-closure-vars))
(let* ((new (mapcar 'cl-gensym cl-closure-vars))
(let* ((new (mapcar #'cl-gensym cl-closure-vars))
(sub (cl-pairlis cl-closure-vars new)) (decls nil))
(while (or (stringp (car body))
(eq (car-safe (car body)) 'interactive))
......@@ -446,7 +446,7 @@ will not work - use `labels' instead" (symbol-name (car x))))
;; FIXME This affects the rest of the file, when it
;; should be restricted to the flet body.
(and (boundp 'byte-compile-function-environment)
(push (cons (car x) (eval func))
(push (cons (car x) (eval func t))
byte-compile-function-environment)))
(list `(symbol-function ',(car x)) func)))
bindings)
......@@ -630,10 +630,10 @@ You can replace this macro with `gv-letplace'."
;;; Additional compatibility code.
;; For names that were clean but really aren't needed any more.
(define-obsolete-function-alias 'cl-macroexpand 'macroexpand "24.3")
(define-obsolete-function-alias 'cl-macroexpand #'macroexpand "24.3")
(define-obsolete-variable-alias 'cl-macro-environment
'macroexpand-all-environment "24.3")
(define-obsolete-function-alias 'cl-macroexpand-all 'macroexpand-all "24.3")
(define-obsolete-function-alias 'cl-macroexpand-all #'macroexpand-all "24.3")
;;; Hash tables.
;; This is just kept for compatibility with code byte-compiled by Emacs-20.
......@@ -652,22 +652,22 @@ You can replace this macro with `gv-letplace'."
(defvar cl-builtin-maphash (symbol-function 'maphash))
(make-obsolete-variable 'cl-builtin-maphash nil "24.3")
(define-obsolete-function-alias 'cl-map-keymap 'map-keymap "24.3")
(define-obsolete-function-alias 'cl-copy-tree 'copy-tree "24.3")
(define-obsolete-function-alias 'cl-gethash 'gethash "24.3")
(define-obsolete-function-alias 'cl-puthash 'puthash "24.3")
(define-obsolete-function-alias 'cl-remhash 'remhash "24.3")
(define-obsolete-function-alias 'cl-clrhash 'clrhash "24.3")
(define-obsolete-function-alias 'cl-maphash 'maphash "24.3")
(define-obsolete-function-alias 'cl-make-hash-table 'make-hash-table "24.3")
(define-obsolete-function-alias 'cl-hash-table-p 'hash-table-p "24.3")
(define-obsolete-function-alias 'cl-hash-table-count 'hash-table-count "24.3")
(define-obsolete-function-alias 'cl-map-keymap #'map-keymap "24.3")
(define-obsolete-function-alias 'cl-copy-tree #'copy-tree "24.3")
(define-obsolete-function-alias 'cl-gethash #'gethash "24.3")
(define-obsolete-function-alias 'cl-puthash #'puthash "24.3")
(define-obsolete-function-alias 'cl-remhash #'remhash "24.3")
(define-obsolete-function-alias 'cl-clrhash #'clrhash "24.3")
(define-obsolete-function-alias 'cl-maphash #'maphash "24.3")
(define-obsolete-function-alias 'cl-make-hash-table #'make-hash-table "24.3")
(define-obsolete-function-alias 'cl-hash-table-p #'hash-table-p "24.3")
(define-obsolete-function-alias 'cl-hash-table-count #'hash-table-count "24.3")
(define-obsolete-function-alias 'cl-map-keymap-recursively
'cl--map-keymap-recursively "24.3")
(define-obsolete-function-alias 'cl-map-intervals 'cl--map-intervals "24.3")
(define-obsolete-function-alias 'cl-map-extents 'cl--map-overlays "24.3")
(define-obsolete-function-alias 'cl-set-getf 'cl--set-getf "24.3")
#'cl--map-keymap-recursively "24.3")
(define-obsolete-function-alias 'cl-map-intervals #'cl--map-intervals "24.3")
(define-obsolete-function-alias 'cl-map-extents #'cl--map-overlays "24.3")
(define-obsolete-function-alias 'cl-set-getf #'cl--set-getf "24.3")
(defun cl-maclisp-member (item list)
(declare (obsolete member "24.3"))
......
;;; complete.el --- partial completion mechanism plus other goodies
;;; complete.el --- partial completion mechanism plus other goodies -*- lexical-binding: t; -*-
;; Copyright (C) 1990-1993, 1999-2021 Free Software Foundation, Inc.
......@@ -102,14 +102,12 @@ If non-nil and non-t, the first character is taken literally only for file name
completion."
:type '(choice (const :tag "delimiter" nil)
(const :tag "literal" t)
(other :tag "find-file" find-file))
:group 'partial-completion)
(other :tag "find-file" find-file)))
(defcustom PC-meta-flag t
"If non-nil, TAB means PC completion and M-TAB means normal completion.
Otherwise, TAB means normal completion and M-TAB means Partial Completion."
:type 'boolean
:group 'partial-completion)
:type 'boolean)
(defcustom PC-word-delimiters "-_. "
"A string of characters treated as word delimiters for completion.
......@@ -119,19 +117,16 @@ If `^' is in this string, it must not come first.
If `-' is in this string, it must come first or right after `]'.
In other words, if S is this string, then `[S]' must be a valid Emacs regular
expression (not containing character ranges like `a-z')."
:type 'string
:group 'partial-completion)
:type 'string)
(defcustom PC-include-file-path '("/usr/include" "/usr/local/include")
"A list of directories in which to look for include files.
If nil, means use the colon-separated path in the variable $INCPATH instead."
:type '(repeat directory)
:group 'partial-completion)
:type '(repeat directory))
(defcustom PC-disable-includes nil
"If non-nil, include-file support in \\[find-file] is disabled."
:type 'boolean
:group 'partial-completion)
:type 'boolean)
(defvar PC-default-bindings t
"If non-nil, default partial completion key bindings are suppressed.")
......@@ -146,36 +141,36 @@ If nil, means use the colon-separated path in the variable $INCPATH instead."
(cond ((not bind)
;; These bindings are the default bindings. It would be better to
;; restore the previous bindings.
(define-key read-expression-map "\e\t" 'lisp-complete-symbol)
(define-key read-expression-map "\e\t" #'completion-at-point)
(define-key completion-map "\t" 'minibuffer-complete)
(define-key completion-map " " 'minibuffer-complete-word)
(define-key completion-map "?" 'minibuffer-completion-help)
(define-key completion-map "\t" #'minibuffer-complete)
(define-key completion-map " " #'minibuffer-complete-word)
(define-key completion-map "?" #'minibuffer-completion-help)
(define-key must-match-map "\r" 'minibuffer-complete-and-exit)
(define-key must-match-map "\n" 'minibuffer-complete-and-exit)
(define-key must-match-map "\r" #'minibuffer-complete-and-exit)
(define-key must-match-map "\n" #'minibuffer-complete-and-exit)
(define-key global-map [remap lisp-complete-symbol] nil))
(PC-default-bindings
(define-key read-expression-map "\e\t" 'PC-lisp-complete-symbol)
(define-key read-expression-map "\e\t" #'PC-lisp-complete-symbol)
(define-key completion-map "\t" 'PC-complete)
(define-key completion-map " " 'PC-complete-word)
(define-key completion-map "?" 'PC-completion-help)
(define-key completion-map "\t" #'PC-complete)
(define-key completion-map " " #'PC-complete-word)
(define-key completion-map "?" #'PC-completion-help)
(define-key completion-map "\e\t" 'PC-complete)
(define-key completion-map "\e " 'PC-complete-word)
(define-key completion-map "\e\r" 'PC-force-complete-and-exit)
(define-key completion-map "\e\n" 'PC-force-complete-and-exit)
(define-key completion-map "\e?" 'PC-completion-help)
(define-key completion-map "\e\t" #'PC-complete)
(define-key completion-map "\e " #'PC-complete-word)
(define-key completion-map "\e\r" #'PC-force-complete-and-exit)
(define-key completion-map "\e\n" #'PC-force-complete-and-exit)
(define-key completion-map "\e?" #'PC-completion-help)
(define-key must-match-map "\r" 'PC-complete-and-exit)
(define-key must-match-map "\n" 'PC-complete-and-exit)
(define-key must-match-map "\r" #'PC-complete-and-exit)
(define-key must-match-map "\n" #'PC-complete-and-exit)
(define-key must-match-map "\e\r" 'PC-complete-and-exit)
(define-key must-match-map "\e\n" 'PC-complete-and-exit)
(define-key must-match-map "\e\r" #'PC-complete-and-exit)
(define-key must-match-map "\e\n" #'PC-complete-and-exit)
(define-key global-map [remap lisp-complete-symbol] 'PC-lisp-complete-symbol)))))
(define-key global-map [remap lisp-complete-symbol] #'PC-lisp-complete-symbol)))))
(defvar PC-do-completion-end nil
"Internal variable used by `PC-do-completion'.")
......@@ -212,14 +207,15 @@ see), so that if it is neither nil nor t, Emacs shows the `*Completions*'
buffer only on the second attempt to complete. That is, if TAB finds nothing
to complete, the first TAB just says \"Next char not unique\" and the
second TAB brings up the `*Completions*' buffer."
:global t :group 'partial-completion
:global t
;; Deal with key bindings...
(PC-bindings partial-completion-mode)
;; Deal with include file feature...
(cond ((not partial-completion-mode)
(remove-hook 'find-file-not-found-functions 'PC-look-for-include-file))
(remove-hook 'find-file-not-found-functions
#'PC-look-for-include-file))
((not PC-disable-includes)
(add-hook 'find-file-not-found-functions 'PC-look-for-include-file)))
(add-hook 'find-file-not-found-functions #'PC-look-for-include-file)))
;; Adjust the completion selection in *Completion* buffers to the way
;; we work. The default minibuffer completion code only completes the
;; text before point and leaves the text after point alone (new in
......@@ -229,9 +225,9 @@ second TAB brings up the `*Completions*' buffer."
;; to trick choose-completion into replacing the whole minibuffer text
;; rather than only the text before point. --Stef
(funcall
(if partial-completion-mode 'add-hook 'remove-hook)
(if partial-completion-mode #'add-hook #'remove-hook)
'choose-completion-string-functions
(lambda (choice buffer &rest ignored)
(lambda (_choice buffer &rest _)
;; When completing M-: (lisp- ) with point before the ), it is
;; not appropriate to go to point-max (unlike the filename case).
(if (and (not PC-goto-end)
......@@ -648,7 +644,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(when (string-match regex x)
(push x p)))
(setq basestr (try-completion "" p)))
(setq basestr (mapconcat 'list str "-"))
(setq basestr (mapconcat #'list str "-"))
(delete-region beg end)
(setq end (+ beg (length basestr)))
(insert basestr))))
......@@ -672,7 +668,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(setq PC-ignored-regexp
(concat "\\("
(mapconcat
'regexp-quote
#'regexp-quote
(setq PC-ignored-extensions
completion-ignored-extensions)
"\\|")
......@@ -815,7 +811,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(eq mode 'help))
(let ((prompt-end (minibuffer-prompt-end)))
(with-output-to-temp-buffer "*Completions*"
(display-completion-list (sort helpposs 'string-lessp))
(display-completion-list (sort helpposs #'string-lessp))
(setq PC-do-completion-end end
PC-goto-end goto-end)
(with-current-buffer standard-output
......@@ -1093,7 +1089,7 @@ absolute rather than relative to some directory on the SEARCH-PATH."
file-lists))))
(setq search-path (cdr search-path))))
;; Compress out duplicates while building complete list (slloooow!)
(let ((sorted (sort (apply 'nconc file-lists)
(let ((sorted (sort (apply #'nconc file-lists)
(lambda (x y) (not (string-lessp x y)))))
compressed)
(while sorted
......
;;; crisp.el --- CRiSP/Brief Emacs emulator
;;; crisp.el --- CRiSP/Brief Emacs emulator -*- lexical-binding: t; -*-
;; Copyright (C) 1997-1999, 2001-2021 Free Software Foundation, Inc.
......@@ -66,63 +66,63 @@
(defvar crisp-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [(f1)] 'other-window)
(define-key map [(f1)] #'other-window)
(define-key map [(f2) (down)] 'enlarge-window)
(define-key map [(f2) (left)] 'shrink-window-horizontally)
(define-key map [(f2) (right)] 'enlarge-window-horizontally)
(define-key map [(f2) (up)] 'shrink-window)
(define-key map [(f3) (down)] 'split-window-below)
(define-key map [(f3) (right)] 'split-window-right)
(define-key map [(f2) (down)] #'enlarge-window)
(define-key map [(f2) (left)] #'shrink-window-horizontally)
(define-key map [(f2) (right)] #'enlarge-window-horizontally)
(define-key map [(f2) (up)] #'shrink-window)
(define-key map [(f3) (down)] #'split-window-below)
(define-key map [(f3) (right)] #'split-window-right)
(define-key map [(f4)] 'delete-window)
(define-key map [(control f4)] 'delete-other-windows)
(define-key map [(f4)] #'delete-window)
(define-key map [(control f4)] #'delete-other-windows)
(define-key map [(f5)] 'search-forward-regexp)
(define-key map [(f19)] 'search-forward-regexp)
(define-key map [(meta f5)] 'search-backward-regexp)
(define-key map [(f5)] #'search-forward-regexp)
(define-key map [(f19)] #'search-forward-regexp)
(define-key map [(meta f5)] #'search-backward-regexp)
(define-key map [(f6)] 'query-replace)
(define-key map [(f6)] #'query-replace)
(define-key map [(f7)] 'start-kbd-macro)
(define-key map [(meta f7)] 'end-kbd-macro)
(define-key map [(f7)] #'start-kbd-macro)
(define-key map [(meta f7)] #'end-kbd-macro)
(define-key map [(f8)] 'call-last-kbd-macro)
(define-key map [(meta f8)] 'save-kbd-macro)
(define-key map [(f8)] #'call-last-kbd-macro)
;;(define-key map [(meta f8)] #'save-kbd-macro) ;FIXME:Unknown command?
(define-key map [(f9)] 'find-file)
(define-key map [(meta f9)] 'load-library)
(define-key map [(f9)] #'find-file)
(define-key map [(meta f9)] #'load-library)
(define-key map [(f10)] 'execute-extended-command)
(define-key map [(meta f10)] 'compile)
(define-key map [(f10)] #'execute-extended-command)
(define-key map [(meta f10)] #'compile)
(define-key map [(SunF37)] 'kill-buffer)
(define-key map [(kp-add)] 'crisp-copy-line)
(define-key map [(kp-subtract)] 'crisp-kill-line)
(define-key map [(SunF37)] #'kill-buffer)
(define-key map [(kp-add)] #'crisp-copy-line)
(define-key map [(kp-subtract)] #'crisp-kill-line)
;; just to cover all the bases (GNU Emacs, for instance)
(define-key map [(f24)] 'crisp-kill-line)
(define-key map [(insert)] 'crisp-yank-clipboard)
(define-key map [(f16)] 'crisp-set-clipboard) ; copy on Sun5 kbd
(define-key map [(f20)] 'crisp-kill-region) ; cut on Sun5 kbd
(define-key map [(f18)] 'crisp-yank-clipboard) ; paste on Sun5 kbd
(define-key map [(f24)] #'crisp-kill-line)
(define-key map [(insert)] #'crisp-yank-clipboard)
(define-key map [(f16)] #'crisp-set-clipboard) ; copy on Sun5 kbd
(define-key map [(f20)] #'crisp-kill-region) ; cut on Sun5 kbd
(define-key map [(f18)] #'crisp-yank-clipboard) ; paste on Sun5 kbd
(define-key map [(control f)] 'fill-paragraph-or-region)
;; (define-key map [(control f)] #'fill-paragraph-or-region)
(define-key map [(meta d)] (lambda ()
(interactive)
(beginning-of-line) (kill-line)))
(define-key map [(meta e)] 'find-file)
(define-key map [(meta g)] 'goto-line)
(define-key map [(meta h)] 'help)
(define-key map [(meta i)] 'overwrite-mode)
(define-key map [(meta j)] 'bookmark-jump)
(define-key map [(meta l)] 'crisp-mark-line)
(define-key map [(meta m)] 'set-mark-command)
(define-key map [(meta n)] 'bury-buffer)
(define-key map [(meta p)] 'crisp-unbury-buffer)
(define-key map [(meta u)] 'undo)
(define-key map [(f14)] 'undo)
(define-key map [(meta w)] 'save-buffer)
(define-key map [(meta x)] 'crisp-meta-x-wrapper)
(define-key map [(meta e)] #'find-file)
(define-key map [(meta g)] #'goto-line)
(define-key map [(meta h)] #'help)
(define-key map [(meta i)] #'overwrite-mode)
(define-key map [(meta j)] #'bookmark-jump)
(define-key map [(meta l)] #'crisp-mark-line)
(define-key map [(meta m)] #'set-mark-command)
(define-key map [(meta n)] #'bury-buffer)
(define-key map [(meta p)] #'crisp-unbury-buffer)
(define-key map [(meta u)] #'undo)
(define-key map [(f14)] #'undo)
(define-key map [(meta w)] #'save-buffer)
(define-key map [(meta x)] #'crisp-meta-x-wrapper)
(define-key map [(meta ?0)] (lambda ()
(interactive)
(bookmark-set "0")))
......@@ -154,21 +154,21 @@
(interactive)
(bookmark-set "9")))
(define-key map [(shift delete)] 'kill-word)
(define-key map [(shift backspace)] 'backward-kill-word)
(define-key map [(control left)] 'backward-word)
(define-key map [(control right)] 'forward-word)
(define-key map [(shift delete)] #'kill-word)
(define-key map [(shift backspace)] #'backward-kill-word)
(define-key map [(control left)] #'backward-word)
(define-key map [(control right)] #'forward-word)
(define-key map [(home)] 'crisp-home)
(define-key map [(home)] #'crisp-home)
(define-key map [(control home)] (lambda ()
(interactive)
(move-to-window-line 0)))
(define-key map [(meta home)] 'beginning-of-line)
(define-key map [(end)] 'crisp-end)
(define-key map [(meta home)] #'beginning-of-line)
(define-key map [(end)] #'crisp-end)
(define-key map [(control end)] (lambda ()
(interactive)
(move-to-window-line -1)))
(define-key map [(meta end)] 'end-of-line)
(define-key map [(meta end)] #'end-of-line)
map)
"Local keymap for CRiSP emulation mode.
All the bindings are done here instead of globally to try and be
......@@ -179,8 +179,7 @@ nice to the world.")
(defcustom crisp-mode-mode-line-string " *CRiSP*"
"String to display in the mode line when CRiSP emulation mode is enabled."
:type 'string
:group 'crisp)
:type 'string)
;;;###autoload
(defcustom crisp-mode nil
......@@ -190,20 +189,18 @@ indicates CRiSP mode is enabled.
Setting this variable directly does not take effect;
use either M-x customize or the function `crisp-mode'."
:set (lambda (symbol value) (crisp-mode (if value 1 0)))
:initialize 'custom-initialize-default
:set (lambda (_symbol value) (crisp-mode (if value 1 0)))
:initialize #'custom-initialize-default
:require 'crisp
:version "20.4"
:type 'boolean
:group 'crisp)
:type 'boolean)
(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
provides the usual M-x functionality on the F10 key. If this variable
is non-nil, M-x will exit Emacs."
:type 'boolean
:group 'crisp)
:type 'boolean)
(defcustom crisp-load-scroll-all nil
"Controls loading of the Scroll Lock in the CRiSP emulator.
......@@ -212,18 +209,15 @@ package when enabling the CRiSP emulator.
If this variable is nil when you start the CRiSP emulator, it
does not load the scroll-all package."
:type 'boolean
:group 'crisp)
:type 'boolean)
(defcustom crisp-load-hook nil
"Hooks to run after loading the CRiSP emulator package."