2018-09-12 21:47:39 -04:00
|
|
|
|
;;; viper-macs.el --- functions implementing keyboard macros for Viper -*- lexical-binding:t -*-
|
1995-10-30 17:35:01 +00:00
|
|
|
|
|
2020-01-01 00:19:43 +00:00
|
|
|
|
;; Copyright (C) 1994-1997, 2000-2020 Free Software Foundation, Inc.
|
1995-04-08 02:20:38 +00:00
|
|
|
|
|
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-init.el (viper-cond-compile-for-xemacs-or-emacs):
new macro that replaces viper-emacs-p and viper-xemacs-p in many
cases. Used to reduce the number of warnings.
* viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs.
(viper-standard-value): moved here from viper.el.
(viper-set-unread-command-events): moved to viper-util.el
(viper-check-minibuffer-overlay): make sure
viper-minibuffer-overlay is moved to cover the entire input field.
* viper-util.el: use viper-cond-compile-for-xemacs-or-emacs.
(viper-read-key-sequence, viper-set-unread-command-events,
viper-char-symbol-sequence-p, viper-char-array-p): moved here.
* viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs.
* viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs.
* viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs.
* viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p,
viper-event-vector-p): moved to viper-util.el
* viper.el (viper-standard-value): moved to viper-cmd.el.
Use viper-cond-compile-for-xemacs-or-emacs.
* ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new
macro designed to be used in many places where ediff-emacs-p or
ediff-xemacs-p was previously used. Reduces the number of
warnings.
Use ediff-cond-compile-for-xemacs-or-emacs in many places in lieue
of ediff-xemacs-p.
(ediff-make-current-diff-overlay, ediff-highlight-diff-in-one-buffer,
ediff-convert-fine-diffs-to-overlays, ediff-empty-diff-region-p,
ediff-whitespace-diff-region-p, ediff-get-region-contents):
moved to ediff-util.el.
(ediff-event-key): moved here.
* ediff-merge.el: got rid of unreferenced variables.
* ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs.
(ediff-cleanup-mess): improved the way windows are set up after
quitting ediff.
(ediff-janitor): use ediff-dispose-of-variant-according-to-user.
(ediff-dispose-of-variant-according-to-user): new function
designed to be smarter and also understands indirect buffers.
(ediff-highlight-diff-in-one-buffer,
ediff-unhighlight-diff-in-one-buffer,
ediff-unhighlight-diffs-totally-in-one-buffer,
ediff-highlight-diff, ediff-highlight-diff,
ediff-unhighlight-diff, ediff-unhighlight-diffs-totally,
ediff-empty-diff-region-p, ediff-whitespace-diff-region-p,
ediff-get-region-contents, ediff-make-current-diff-overlay):
moved here.
(ediff-format-bindings-of): new function by Hannu Koivisto
<azure@iki.fi>.
(ediff-setup): make sure the merge buffer is always widened and
modifiable.
(ediff-write-merge-buffer-and-maybe-kill): refuse to write the
result of a merge into a file visited by another buffer.
(ediff-arrange-autosave-in-merge-jobs): check if the merge file
is visited by another buffer and ask to save/delete that buffer.
(ediff-verify-file-merge-buffer): new function to do the above.
* ediff-vers.el: load ediff-init.el at compile time.
* ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff.el (ediff-windows, ediff-regions-wordwise,
ediff-regions-linewise): use indirect buffers to improve
robustness and make it possible to compare regions of the same
buffer (even overlapping regions).
(ediff-clone-buffer-for-region-comparison,
ediff-clone-buffer-for-window-comparison): new functions.
(ediff-files-internal): refuse to compare identical files.
(ediff-regions-internal): get rid of the warning about comparing
regions of the same buffer.
* ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here.
Plus the following fixes courtesy of Dave Love:
Doc fixes.
(ediff-word-1): Use word class and move - to the
front per regexp documentation.
(ediff-wordify): Bind forward-word-function outside loop.
(ediff-copy-to-buffer): Use insert-buffer-substring rather than
consing buffer contents.
(ediff-goto-word): Move syntax table setting outside loop.
2002-01-08 04:36:01 +00:00
|
|
|
|
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
|
2010-08-29 12:17:13 -04:00
|
|
|
|
;; Package: viper
|
2001-09-09 22:33:38 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 03:28:01 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:28:01 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
;; GNU Emacs 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 General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 15:52:52 -07:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
2001-07-15 19:53:53 +00:00
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
1996-03-29 01:02:28 +00:00
|
|
|
|
|
1997-05-31 00:02:53 +00:00
|
|
|
|
(provide 'viper-macs)
|
|
|
|
|
|
|
|
|
|
;; compiler pacifier
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-ex-work-buf)
|
|
|
|
|
(defvar viper-custom-file-name)
|
|
|
|
|
(defvar viper-current-state)
|
|
|
|
|
(defvar viper-fast-keyseq-timeout)
|
Small viper clean-up
* lisp/emulation/viper-cmd.el (viper-set-searchstyle-toggling-macros)
(viper-set-parsing-style-toggling-macro)
(viper-set-emacs-state-searchstyle-macros):
Use called-interactively-p on Emacs.
(viper-looking-back): Make it an obsolete alias. Update callers.
* lisp/emulation/viper-ex.el: Load viper-keym, not viper-cmd.
Use looking-back rather than viper-looking-back.
(viper-tmp-insert-at-eob, viper-enlarge-region)
(viper-read-string-with-history, viper-register-to-point)
(viper-append-to-register, viper-change-state-to-vi)
(viper-backward-char-carefully, viper-forward-char-carefully)
(viper-Put-back, viper-put-back, viper-add-newline-at-eob-if-necessary)
(viper-change-state-to-emacs): Declare.
* lisp/emulation/viper-macs.el: Load viper-mous, viper-ex, not viper-cmd.
(viper-change-state-to-insert, viper-change-state-to-vi): Declare.
* lisp/emulation/viper-mous.el: Do not load viper-cmd.
(viper-backward-char-carefully, viper-forward-char-carefully)
(viper-forward-word, viper-adjust-window): Declare.
2013-05-21 20:21:30 -07:00
|
|
|
|
(require 'viper-mous)
|
|
|
|
|
(require 'viper-ex)
|
1997-05-31 00:02:53 +00:00
|
|
|
|
;; end pacifier
|
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(require 'viper-util)
|
1996-03-29 01:02:28 +00:00
|
|
|
|
(require 'viper-keym)
|
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
;;; Variables
|
|
|
|
|
|
|
|
|
|
;; Register holding last macro.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-last-macro-reg nil)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
2003-02-04 13:24:35 +00:00
|
|
|
|
;; format of the elements of kbd alists:
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; (name ((buf . macr)...(buf . macr)) ((maj-mode . macr)...) (t . macr))
|
|
|
|
|
;; kbd macro alist for Vi state
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-vi-kbd-macro-alist nil)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; same for insert/replace state
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-insert-kbd-macro-alist nil)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; same for emacs state
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-emacs-kbd-macro-alist nil)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
;; Internal var that passes info between start-kbd-macro and end-kbd-macro
|
|
|
|
|
;; in :map and :map!
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-kbd-macro-parameters nil)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-this-kbd-macro nil
|
1995-02-20 23:15:10 +00:00
|
|
|
|
"Vector of keys representing the name of currently running Viper kbd macro.")
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defvar viper-last-kbd-macro nil
|
1995-02-20 23:15:10 +00:00
|
|
|
|
"Vector of keys representing the name of last Viper keyboard macro.")
|
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defcustom viper-repeat-from-history-key 'f12
|
1997-07-17 19:37:07 +00:00
|
|
|
|
"Prefix key for accessing previously typed Vi commands.
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
1999-11-01 07:16:15 +00:00
|
|
|
|
The previous command is accessible, as usual, via `.'. The command before this
|
1997-07-17 19:37:07 +00:00
|
|
|
|
can be invoked as `<this key> 1', and the command before that, and the command
|
|
|
|
|
before that one is accessible as `<this key> 2'.
|
1999-11-01 07:16:15 +00:00
|
|
|
|
The notation for these keys is borrowed from XEmacs. Basically,
|
1995-02-20 23:15:10 +00:00
|
|
|
|
a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
|
1997-07-17 19:37:07 +00:00
|
|
|
|
`(meta control f1)'."
|
1997-09-13 06:13:10 +00:00
|
|
|
|
:type 'sexp
|
1997-07-17 19:37:07 +00:00
|
|
|
|
:group 'viper)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Code
|
|
|
|
|
|
Small viper clean-up
* lisp/emulation/viper-cmd.el (viper-set-searchstyle-toggling-macros)
(viper-set-parsing-style-toggling-macro)
(viper-set-emacs-state-searchstyle-macros):
Use called-interactively-p on Emacs.
(viper-looking-back): Make it an obsolete alias. Update callers.
* lisp/emulation/viper-ex.el: Load viper-keym, not viper-cmd.
Use looking-back rather than viper-looking-back.
(viper-tmp-insert-at-eob, viper-enlarge-region)
(viper-read-string-with-history, viper-register-to-point)
(viper-append-to-register, viper-change-state-to-vi)
(viper-backward-char-carefully, viper-forward-char-carefully)
(viper-Put-back, viper-put-back, viper-add-newline-at-eob-if-necessary)
(viper-change-state-to-emacs): Declare.
* lisp/emulation/viper-macs.el: Load viper-mous, viper-ex, not viper-cmd.
(viper-change-state-to-insert, viper-change-state-to-vi): Declare.
* lisp/emulation/viper-mous.el: Do not load viper-cmd.
(viper-backward-char-carefully, viper-forward-char-carefully)
(viper-forward-word, viper-adjust-window): Declare.
2013-05-21 20:21:30 -07:00
|
|
|
|
(declare-function viper-change-state-to-insert "viper-cmd" ())
|
|
|
|
|
|
1995-06-09 00:12:29 +00:00
|
|
|
|
;; Ex map command
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(defun ex-map ()
|
|
|
|
|
(let ((mod-char "")
|
|
|
|
|
macro-name macro-body map-args ins)
|
|
|
|
|
(save-window-excursion
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(set-buffer viper-ex-work-buf)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (looking-at "!")
|
|
|
|
|
(progn
|
|
|
|
|
(setq ins t
|
|
|
|
|
mod-char "!")
|
|
|
|
|
(forward-char 1))))
|
|
|
|
|
(setq map-args (ex-map-read-args mod-char)
|
|
|
|
|
macro-name (car map-args)
|
|
|
|
|
macro-body (cdr map-args))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq viper-kbd-macro-parameters (list ins mod-char macro-name macro-body))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if macro-body
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-end-mapping-kbd-macro 'ignore)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(ex-fixup-history (format "map%s %S" mod-char
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; if defining macro for insert, switch there for authentic WYSIWYG
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(if ins (viper-change-state-to-insert))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(start-kbd-macro nil)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(define-key viper-vi-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
|
|
|
|
|
(define-key viper-insert-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
|
|
|
|
|
(define-key viper-emacs-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
|
2005-09-20 17:47:28 +00:00
|
|
|
|
(message "Mapping %S in %s state. Type macro definition followed by `C-x )'"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if ins "Insert" "Vi")))
|
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
1995-06-09 00:12:29 +00:00
|
|
|
|
;; Ex unmap
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(defun ex-unmap ()
|
|
|
|
|
(let ((mod-char "")
|
|
|
|
|
temp macro-name ins)
|
|
|
|
|
(save-window-excursion
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(set-buffer viper-ex-work-buf)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (looking-at "!")
|
|
|
|
|
(progn
|
|
|
|
|
(setq ins t
|
|
|
|
|
mod-char "!")
|
|
|
|
|
(forward-char 1))))
|
|
|
|
|
|
|
|
|
|
(setq macro-name (ex-unmap-read-args mod-char))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq temp (viper-fixup-macro (vconcat macro-name))) ;; copy and fixup
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(ex-fixup-history (format "unmap%s %S" mod-char
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro temp)))
|
|
|
|
|
(viper-unrecord-kbd-macro macro-name (if ins 'insert-state 'vi-state))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
;; read arguments for ex-map
|
|
|
|
|
(defun ex-map-read-args (variant)
|
|
|
|
|
(let ((cursor-in-echo-area t)
|
|
|
|
|
(key-seq [])
|
|
|
|
|
temp key event message
|
|
|
|
|
macro-name macro-body args)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(condition-case nil
|
|
|
|
|
(setq args (concat (ex-get-inline-cmd-args ".*map[!]*[ \t]?" "\n\C-m")
|
|
|
|
|
" nil nil ")
|
|
|
|
|
temp (read-from-string args)
|
|
|
|
|
macro-name (car temp)
|
|
|
|
|
macro-body (car (read-from-string args (cdr temp))))
|
|
|
|
|
(error
|
|
|
|
|
(signal
|
2003-02-04 13:24:35 +00:00
|
|
|
|
'error
|
1995-02-20 23:15:10 +00:00
|
|
|
|
'("map: Macro name and body must be a quoted string or a vector"))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; We expect macro-name to be a vector, a string, or a quoted string.
|
|
|
|
|
;; In the second case, it will emerge as a symbol when read from
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; the above read-from-string. So we need to convert it into a string
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if macro-name
|
|
|
|
|
(cond ((vectorp macro-name) nil)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
((stringp macro-name)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq macro-name (vconcat macro-name)))
|
|
|
|
|
(t (setq macro-name (vconcat (prin1-to-string macro-name)))))
|
2005-09-20 17:47:28 +00:00
|
|
|
|
(message ":map%s <Macro Name>" variant)(sit-for 2)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(while
|
|
|
|
|
(not (member key
|
|
|
|
|
'(?\C-m ?\n (control m) (control j) return linefeed)))
|
|
|
|
|
(setq key-seq (vconcat key-seq (if key (vector key) [])))
|
|
|
|
|
;; the only keys available for editing are these-- no help while there
|
|
|
|
|
(if (member
|
|
|
|
|
key
|
|
|
|
|
'(?\b ?\d '^? '^H (control h) (control \?) backspace delete))
|
2005-07-10 18:46:24 +00:00
|
|
|
|
(setq key-seq (viper-subseq key-seq 0 (- (length key-seq) 2))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq message
|
1996-02-16 19:02:38 +00:00
|
|
|
|
(format
|
|
|
|
|
":map%s %s"
|
|
|
|
|
variant (if (> (length key-seq) 0)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(prin1-to-string (viper-display-macro key-seq))
|
1996-02-16 19:02:38 +00:00
|
|
|
|
"")))
|
2005-09-18 12:39:40 +00:00
|
|
|
|
(message "%s" message)
|
2018-09-12 21:47:39 -04:00
|
|
|
|
(setq event (read-key))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
;;(setq event (viper-read-event))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq key
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(if (viper-mouse-event-p event)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(progn
|
|
|
|
|
(message "%s (No mouse---only keyboard keys, please)"
|
|
|
|
|
message)
|
|
|
|
|
(sit-for 2)
|
|
|
|
|
nil)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-event-key event)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
)
|
|
|
|
|
(setq macro-name key-seq))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (= (length macro-name) 0)
|
|
|
|
|
(error "Can't map an empty macro name"))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq macro-name (viper-fixup-macro macro-name))
|
|
|
|
|
(if (viper-char-array-p macro-name)
|
|
|
|
|
(setq macro-name (viper-char-array-to-macro macro-name)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if macro-body
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(cond ((viper-char-array-p macro-body)
|
|
|
|
|
(setq macro-body (viper-char-array-to-macro macro-body)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((vectorp macro-body) nil)
|
|
|
|
|
(t (error "map: Invalid syntax in macro definition"))))
|
1995-06-09 00:12:29 +00:00
|
|
|
|
(setq cursor-in-echo-area nil)(sit-for 0) ; this overcomes xemacs tty bug
|
|
|
|
|
(cons macro-name macro-body)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; read arguments for ex-unmap
|
|
|
|
|
(defun ex-unmap-read-args (variant)
|
|
|
|
|
(let ((cursor-in-echo-area t)
|
|
|
|
|
(macro-alist (if (string= variant "!")
|
1997-08-02 07:40:22 +00:00
|
|
|
|
viper-insert-kbd-macro-alist
|
|
|
|
|
viper-vi-kbd-macro-alist))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; these are disabled just in case, to avoid surprises when doing
|
|
|
|
|
;; completing-read
|
1997-08-02 07:40:22 +00:00
|
|
|
|
viper-vi-kbd-minor-mode viper-insert-kbd-minor-mode
|
|
|
|
|
viper-emacs-kbd-minor-mode
|
|
|
|
|
viper-vi-intercept-minor-mode viper-insert-intercept-minor-mode
|
|
|
|
|
viper-emacs-intercept-minor-mode
|
1995-02-20 23:15:10 +00:00
|
|
|
|
event message
|
|
|
|
|
key key-seq macro-name)
|
|
|
|
|
(setq macro-name (ex-get-inline-cmd-args ".*unma?p?[!]*[ \t]*"))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (> (length macro-name) 0)
|
|
|
|
|
()
|
|
|
|
|
(message ":unmap%s <Name>" variant) (sit-for 2)
|
|
|
|
|
(while
|
|
|
|
|
(not
|
|
|
|
|
(member key '(?\C-m ?\n (control m) (control j) return linefeed)))
|
|
|
|
|
(setq key-seq (vconcat key-seq (if key (vector key) [])))
|
|
|
|
|
;; the only keys available for editing are these-- no help while there
|
|
|
|
|
(cond ((member
|
|
|
|
|
key
|
|
|
|
|
'(?\b ?\d '^? '^H (control h) (control \?) backspace delete))
|
2005-07-10 18:46:24 +00:00
|
|
|
|
(setq key-seq (viper-subseq key-seq 0 (- (length key-seq) 2))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((member key '(tab (control i) ?\t))
|
2005-07-10 18:46:24 +00:00
|
|
|
|
(setq key-seq (viper-subseq key-seq 0 (1- (length key-seq))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(setq message
|
1996-02-16 19:02:38 +00:00
|
|
|
|
(format
|
|
|
|
|
":unmap%s %s"
|
|
|
|
|
variant (if (> (length key-seq) 0)
|
|
|
|
|
(prin1-to-string
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro key-seq))
|
1996-02-16 19:02:38 +00:00
|
|
|
|
"")))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq key-seq
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-do-sequence-completion key-seq macro-alist message))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(setq message
|
1996-02-16 19:02:38 +00:00
|
|
|
|
(format
|
|
|
|
|
":unmap%s %s"
|
|
|
|
|
variant (if (> (length key-seq) 0)
|
|
|
|
|
(prin1-to-string
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro key-seq))
|
1996-02-16 19:02:38 +00:00
|
|
|
|
"")))
|
2005-09-18 12:39:40 +00:00
|
|
|
|
(message "%s" message)
|
2018-09-12 21:47:39 -04:00
|
|
|
|
(setq event (read-key))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
;;(setq event (viper-read-event))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq key
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(if (viper-mouse-event-p event)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(progn
|
|
|
|
|
(message "%s (No mouse---only keyboard keys, please)"
|
|
|
|
|
message)
|
|
|
|
|
(sit-for 2)
|
|
|
|
|
nil)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-event-key event)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
)
|
|
|
|
|
(setq macro-name key-seq))
|
|
|
|
|
|
|
|
|
|
(if (= (length macro-name) 0)
|
|
|
|
|
(error "Can't unmap an empty macro name"))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; convert macro names into vector, if starts with a `['
|
|
|
|
|
(if (memq (elt macro-name 0) '(?\[ ?\"))
|
|
|
|
|
(car (read-from-string macro-name))
|
|
|
|
|
(vconcat macro-name))
|
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
Pacify ‘make check-declare’
* lisp/cedet/srecode/insert.el (data-debug-new-buffer)
(data-debug-insert-stuff-list, data-debug-insert-thing):
* lisp/emulation/viper-ex.el (viper-change-state-to-vi)
(viper-change-state-to-emacs):
* lisp/emulation/viper-macs.el (viper-change-state-to-vi):
* lisp/org/ob-asymptote.el (orgtbl-to-generic):
* lisp/org/ob-awk.el (orgtbl-to-generic):
* lisp/org/ob-core.el (org-edit-src-code, orgtbl-to-generic):
* lisp/org/ob-emacs-lisp.el (orgtbl-to-generic):
* lisp/org/ob-exp.el (org-element-context):
* lisp/org/ob-gnuplot.el (org-time-string-to-time)
(orgtbl-to-generic):
* lisp/org/ob-haskell.el (org-export-to-file):
* lisp/org/ob-latex.el (org-create-formula-image)
(org-latex-compile):
* lisp/org/ob-python.el (run-python):
* lisp/org/ob-sh.el (orgtbl-to-generic):
* lisp/org/ob-tangle.el (org-link-escape, org-back-to-heading):
* lisp/org/org-colview.el (org-agenda-redo):
* lisp/org/org-feed.el (url-retrieve-synchronously):
* lisp/org/org-info.el (Info-find-node):
* lisp/org/org-list.el (org-previous-line-empty-p):
* lisp/org/org-macs.el (org-string-match-p):
* lisp/org/org.el (org-beamer-mode):
Fix prototype to match current definition.
* lisp/emacs-lisp/advice.el (function-called-at-point):
* lisp/progmodes/prolog.el (compilation-shell-minor-mode):
Fix typo: extra '.
* lisp/emacs-lisp/cl-generic.el (cl-defmethod):
Insert ,' to pacify check-declare.
* lisp/org/ob-comint.el (tramp-flush-directory-property):
* lisp/org/ob-tangle.el (org-babel-update-block-body):
* lisp/org/org-bibtex.el (org-babel-trim):
* lisp/org/org-pcomplete.el (org-export-backend-options):
* lisp/org/org-protocol.el (org-publish-get-project-from-filename):
Fix file name in declare-function.
* lisp/org/ob-comint.el (with-parsed-tramp-file-name)
* lisp/org/ob-core.el (with-parsed-tramp-file-name):
* lisp/org/org.el (org-beamer-mode):
* lisp/url/url-http.el (gnutls-negotiate):
Append ‘t’ to declare-function, since the declaration isn’t a defun.
* lisp/org/ob-core.el (show-all):
Declare outline-show-all instead, since it is the
non-obsolete version of this function.
(org-save-outline-visibility): Remove; not needed.
* lisp/org/ob-scheme.el (run-geiser, geiser-mode)
(geiser-eval-region, geiser-repl-exit):
* lisp/org/ox-org.el (htmlize-buffer):
Prepend "ext:" to file name, since it is not part of Emacs.
* lisp/org/ob-sh.el (org-babel-comint-in-buffer)
* lisp/org/org-gnus.el (nnimap-group-overview-filename):
Remove decl, since function was removed.
* lisp/org/ob-sh.el (org-babel-comint-with-output):
* lisp/org/org-macro.el (org-with-wide-buffer):
Omit unnecessary (and mismatching) decl.
* lisp/org/org-agenda.el (calendar-absolute-from-iso):
* lisp/org/org-clock.el (calendar-iso-to-absolute):
Declare calendar-iso-to-absolute instead, since it is the
non-obsolete version of this function.
* lisp/org/org-compat.el (w32-focus-frame):
Remove decl, since function is now obsolete.
2016-05-14 19:56:53 -07:00
|
|
|
|
(declare-function viper-change-state-to-vi "viper-cmd" (&rest _))
|
Small viper clean-up
* lisp/emulation/viper-cmd.el (viper-set-searchstyle-toggling-macros)
(viper-set-parsing-style-toggling-macro)
(viper-set-emacs-state-searchstyle-macros):
Use called-interactively-p on Emacs.
(viper-looking-back): Make it an obsolete alias. Update callers.
* lisp/emulation/viper-ex.el: Load viper-keym, not viper-cmd.
Use looking-back rather than viper-looking-back.
(viper-tmp-insert-at-eob, viper-enlarge-region)
(viper-read-string-with-history, viper-register-to-point)
(viper-append-to-register, viper-change-state-to-vi)
(viper-backward-char-carefully, viper-forward-char-carefully)
(viper-Put-back, viper-put-back, viper-add-newline-at-eob-if-necessary)
(viper-change-state-to-emacs): Declare.
* lisp/emulation/viper-macs.el: Load viper-mous, viper-ex, not viper-cmd.
(viper-change-state-to-insert, viper-change-state-to-vi): Declare.
* lisp/emulation/viper-mous.el: Do not load viper-cmd.
(viper-backward-char-carefully, viper-forward-char-carefully)
(viper-forward-word, viper-adjust-window): Declare.
2013-05-21 20:21:30 -07:00
|
|
|
|
|
1996-02-16 19:02:38 +00:00
|
|
|
|
;; Terminate a Vi kbd macro.
|
|
|
|
|
;; optional argument IGNORE, if t, indicates that we are dealing with an
|
|
|
|
|
;; existing macro that needs to be registered, but there is no need to
|
|
|
|
|
;; terminate a kbd macro.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-end-mapping-kbd-macro (&optional ignore)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(interactive)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(define-key viper-vi-intercept-map "\C-x)" nil)
|
|
|
|
|
(define-key viper-insert-intercept-map "\C-x)" nil)
|
|
|
|
|
(define-key viper-emacs-intercept-map "\C-x)" nil)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (and (not ignore)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(or (not viper-kbd-macro-parameters)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(not defining-kbd-macro)))
|
|
|
|
|
(error "Not mapping a kbd-macro"))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(let ((mod-char (nth 1 viper-kbd-macro-parameters))
|
|
|
|
|
(ins (nth 0 viper-kbd-macro-parameters))
|
|
|
|
|
(macro-name (nth 2 viper-kbd-macro-parameters))
|
|
|
|
|
(macro-body (nth 3 viper-kbd-macro-parameters)))
|
|
|
|
|
(setq viper-kbd-macro-parameters nil)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(or ignore
|
|
|
|
|
(progn
|
|
|
|
|
(end-kbd-macro nil)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq macro-body (viper-events-to-macro last-kbd-macro))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; always go back to Vi, since this is where we started
|
|
|
|
|
;; defining macro
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-change-state-to-vi)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-record-kbd-macro macro-name
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if ins 'insert-state 'vi-state)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-body))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(ex-fixup-history (format "map%s %S %S" mod-char
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
|
|
|
|
(viper-display-macro macro-body)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Recording, unrecording, executing
|
|
|
|
|
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; Accepts as macro names: strings and vectors.
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; strings must be strings of characters; vectors must be vectors of keys
|
2011-11-26 00:26:37 -08:00
|
|
|
|
;; in canonical form, which is essentially the form used in XEmacs.
|
2005-02-19 19:32:47 +00:00
|
|
|
|
;; More general definitions are inherited by more specific scopes:
|
|
|
|
|
;; global->major mode->buffer. More specific definitions override more general
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-record-kbd-macro (macro-name state macro-body &optional scope)
|
2014-01-26 18:02:28 -08:00
|
|
|
|
"Record a Vi macro.
|
|
|
|
|
Can be used in `viper-custom-file-name' to define permanent macros.
|
1999-11-01 07:16:15 +00:00
|
|
|
|
MACRO-NAME is a string of characters or a vector of keys. STATE is
|
|
|
|
|
either `vi-state' or `insert-state'. It specifies the Viper state in which to
|
|
|
|
|
define the macro. MACRO-BODY is a string that represents the keyboard macro.
|
2015-09-17 16:08:20 -07:00
|
|
|
|
Optional SCOPE says whether the macro should be global \(t), mode-specific
|
|
|
|
|
\(a major-mode symbol), or buffer-specific \(buffer name, a string).
|
1995-02-20 23:15:10 +00:00
|
|
|
|
If SCOPE is nil, the user is asked to specify the scope."
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(let* (state-name keymap
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(macro-alist-var
|
|
|
|
|
(cond ((eq state 'vi-state)
|
|
|
|
|
(setq state-name "Vi state"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
keymap viper-vi-kbd-map)
|
|
|
|
|
'viper-vi-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((memq state '(insert-state replace-state))
|
|
|
|
|
(setq state-name "Insert state"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
keymap viper-insert-kbd-map)
|
|
|
|
|
'viper-insert-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(t
|
|
|
|
|
(setq state-name "Emacs state"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
keymap viper-emacs-kbd-map)
|
|
|
|
|
'viper-emacs-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
|
|
|
|
new-elt old-elt old-sub-elt msg
|
|
|
|
|
temp lis lis2)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (= (length macro-name) 0)
|
|
|
|
|
(error "Can't map an empty macro name"))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; Macro-name is usually a vector. However, command history or macros
|
2014-01-26 18:02:28 -08:00
|
|
|
|
;; recorded in viper-custom-file-name may be recorded as strings.
|
|
|
|
|
;; So, convert to vectors.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq macro-name (viper-fixup-macro macro-name))
|
|
|
|
|
(if (viper-char-array-p macro-name)
|
|
|
|
|
(setq macro-name (viper-char-array-to-macro macro-name)))
|
|
|
|
|
(setq macro-body (viper-fixup-macro macro-body))
|
|
|
|
|
(if (viper-char-array-p macro-body)
|
|
|
|
|
(setq macro-body (viper-char-array-to-macro macro-body)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; don't ask if scope is given and is of the right type
|
|
|
|
|
(or (eq scope t)
|
|
|
|
|
(stringp scope)
|
|
|
|
|
(and scope (symbolp scope))
|
|
|
|
|
(progn
|
|
|
|
|
(setq scope
|
|
|
|
|
(cond
|
|
|
|
|
((y-or-n-p
|
More-conservative ‘format’ quote restyling
Instead of restyling curved quotes for every call to ‘format’,
create a new function ‘format-message’ that does the restyling,
and using the new function instead of ‘format’ only in contexts
where this seems appropriate.
Problem reported by Dmitry Gutov and Andreas Schwab in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00826.html
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00827.html
* doc/lispref/commands.texi (Using Interactive):
* doc/lispref/control.texi (Signaling Errors, Signaling Errors):
* doc/lispref/display.texi (Displaying Messages, Progress):
* doc/lispref/elisp.texi:
* doc/lispref/help.texi (Keys in Documentation):
* doc/lispref/minibuf.texi (Minibuffer Misc):
* doc/lispref/strings.texi (Formatting Strings):
* etc/NEWS:
Document the changes.
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/apropos.el (apropos-library):
* lisp/calc/calc-ext.el (calc-record-message)
(calc-user-function-list):
* lisp/calc/calc-help.el (calc-describe-key, calc-full-help):
* lisp/calc/calc-lang.el (math-read-big-balance):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--add-diary-entry):
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-completion-message):
* lisp/cedet/semantic/edit.el (semantic-parse-changes-failed):
* lisp/cedet/semantic/wisent/comp.el (wisent-log):
* lisp/cedet/srecode/insert.el (srecode-insert-show-error-report):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dframe.el (dframe-message):
* lisp/dired-aux.el (dired-query):
* lisp/emacs-lisp/byte-opt.el (byte-compile-log-lap-1):
* lisp/emacs-lisp/bytecomp.el (byte-compile-log)
(byte-compile-log-file, byte-compile-warn, byte-compile-form):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
(cconv-analyze-form):
* lisp/emacs-lisp/check-declare.el (check-declare-warn):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet):
* lisp/emacs-lisp/edebug.el (edebug-format):
* lisp/emacs-lisp/eieio-core.el (eieio-oref):
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message)
(eldoc-message):
* lisp/emacs-lisp/elint.el (elint-file, elint-log):
* lisp/emacs-lisp/find-func.el (find-function-library):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring):
* lisp/emacs-lisp/package.el (package-compute-transaction)
(package-install-button-action, package-delete-button-action)
(package-menu--list-to-prompt):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emacs-lisp/warnings.el (lwarn, warn):
* lisp/emulation/viper-cmd.el:
(viper-toggle-parse-sexp-ignore-comments)
(viper-kill-buffer, viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/facemenu.el (facemenu-add-new-face):
* lisp/faces.el (face-documentation, read-face-name)
(face-read-string, read-face-font, describe-face):
* lisp/files.el (find-alternate-file, hack-local-variables)
(hack-one-local-variable--obsolete, write-file)
(basic-save-buffer, delete-directory):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--obsolete)
(help-fns--interactive-only, describe-function-1)
(describe-variable):
* lisp/help.el (describe-mode):
* lisp/info-xref.el (info-xref-output):
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
* lisp/international/kkc.el (kkc-error):
* lisp/international/mule-cmds.el:
(select-safe-coding-system-interactively)
(select-safe-coding-system, describe-input-method):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/international/quail.el (quail-error):
* lisp/minibuffer.el (minibuffer-message):
* lisp/mpc.el (mpc--debug):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-message):
* lisp/net/gnutls.el (gnutls-message-maybe):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/nsm.el (nsm-query-user):
* lisp/net/rlogin.el (rlogin):
* lisp/net/soap-client.el (soap-warning):
* lisp/net/tramp.el (tramp-debug-message):
* lisp/nxml/nxml-outln.el (nxml-report-outline-error):
* lisp/nxml/nxml-parse.el (nxml-parse-error):
* lisp/nxml/rng-cmpct.el (rng-c-error):
* lisp/nxml/rng-match.el (rng-compile-error):
* lisp/nxml/rng-uri.el (rng-uri-error):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/org/org-ctags.el:
(org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/proced.el (proced-log):
* lisp/progmodes/ebnf2ps.el (ebnf-log):
* lisp/progmodes/flymake.el (flymake-log):
* lisp/progmodes/vhdl-mode.el (vhdl-warning-when-idle):
* lisp/replace.el (occur-1):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, define-alternatives):
* lisp/startup.el (command-line):
* lisp/subr.el (error, user-error, add-to-list):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* src/callint.c (Fcall_interactively):
* src/editfns.c (Fmessage, Fmessage_box):
Restyle the quotes of format strings intended for use as a
diagnostic, when restyling seems appropriate.
* lisp/subr.el (format-message): New function.
* src/doc.c (Finternal__text_restyle): New function.
(syms_of_doc): Define it.
2015-08-23 22:38:02 -07:00
|
|
|
|
(format-message
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 08:41:44 -07:00
|
|
|
|
"Map this macro for buffer `%s' only? "
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(buffer-name)))
|
|
|
|
|
(setq msg
|
More-conservative ‘format’ quote restyling
Instead of restyling curved quotes for every call to ‘format’,
create a new function ‘format-message’ that does the restyling,
and using the new function instead of ‘format’ only in contexts
where this seems appropriate.
Problem reported by Dmitry Gutov and Andreas Schwab in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00826.html
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00827.html
* doc/lispref/commands.texi (Using Interactive):
* doc/lispref/control.texi (Signaling Errors, Signaling Errors):
* doc/lispref/display.texi (Displaying Messages, Progress):
* doc/lispref/elisp.texi:
* doc/lispref/help.texi (Keys in Documentation):
* doc/lispref/minibuf.texi (Minibuffer Misc):
* doc/lispref/strings.texi (Formatting Strings):
* etc/NEWS:
Document the changes.
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/apropos.el (apropos-library):
* lisp/calc/calc-ext.el (calc-record-message)
(calc-user-function-list):
* lisp/calc/calc-help.el (calc-describe-key, calc-full-help):
* lisp/calc/calc-lang.el (math-read-big-balance):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--add-diary-entry):
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-completion-message):
* lisp/cedet/semantic/edit.el (semantic-parse-changes-failed):
* lisp/cedet/semantic/wisent/comp.el (wisent-log):
* lisp/cedet/srecode/insert.el (srecode-insert-show-error-report):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dframe.el (dframe-message):
* lisp/dired-aux.el (dired-query):
* lisp/emacs-lisp/byte-opt.el (byte-compile-log-lap-1):
* lisp/emacs-lisp/bytecomp.el (byte-compile-log)
(byte-compile-log-file, byte-compile-warn, byte-compile-form):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
(cconv-analyze-form):
* lisp/emacs-lisp/check-declare.el (check-declare-warn):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet):
* lisp/emacs-lisp/edebug.el (edebug-format):
* lisp/emacs-lisp/eieio-core.el (eieio-oref):
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message)
(eldoc-message):
* lisp/emacs-lisp/elint.el (elint-file, elint-log):
* lisp/emacs-lisp/find-func.el (find-function-library):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring):
* lisp/emacs-lisp/package.el (package-compute-transaction)
(package-install-button-action, package-delete-button-action)
(package-menu--list-to-prompt):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emacs-lisp/warnings.el (lwarn, warn):
* lisp/emulation/viper-cmd.el:
(viper-toggle-parse-sexp-ignore-comments)
(viper-kill-buffer, viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/facemenu.el (facemenu-add-new-face):
* lisp/faces.el (face-documentation, read-face-name)
(face-read-string, read-face-font, describe-face):
* lisp/files.el (find-alternate-file, hack-local-variables)
(hack-one-local-variable--obsolete, write-file)
(basic-save-buffer, delete-directory):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--obsolete)
(help-fns--interactive-only, describe-function-1)
(describe-variable):
* lisp/help.el (describe-mode):
* lisp/info-xref.el (info-xref-output):
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
* lisp/international/kkc.el (kkc-error):
* lisp/international/mule-cmds.el:
(select-safe-coding-system-interactively)
(select-safe-coding-system, describe-input-method):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/international/quail.el (quail-error):
* lisp/minibuffer.el (minibuffer-message):
* lisp/mpc.el (mpc--debug):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-message):
* lisp/net/gnutls.el (gnutls-message-maybe):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/nsm.el (nsm-query-user):
* lisp/net/rlogin.el (rlogin):
* lisp/net/soap-client.el (soap-warning):
* lisp/net/tramp.el (tramp-debug-message):
* lisp/nxml/nxml-outln.el (nxml-report-outline-error):
* lisp/nxml/nxml-parse.el (nxml-parse-error):
* lisp/nxml/rng-cmpct.el (rng-c-error):
* lisp/nxml/rng-match.el (rng-compile-error):
* lisp/nxml/rng-uri.el (rng-uri-error):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/org/org-ctags.el:
(org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/proced.el (proced-log):
* lisp/progmodes/ebnf2ps.el (ebnf-log):
* lisp/progmodes/flymake.el (flymake-log):
* lisp/progmodes/vhdl-mode.el (vhdl-warning-when-idle):
* lisp/replace.el (occur-1):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, define-alternatives):
* lisp/startup.el (command-line):
* lisp/subr.el (error, user-error, add-to-list):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* src/callint.c (Fcall_interactively):
* src/editfns.c (Fmessage, Fmessage_box):
Restyle the quotes of format strings intended for use as a
diagnostic, when restyling seems appropriate.
* lisp/subr.el (format-message): New function.
* src/doc.c (Finternal__text_restyle): New function.
(syms_of_doc): Define it.
2015-08-23 22:38:02 -07:00
|
|
|
|
(format-message
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 08:41:44 -07:00
|
|
|
|
"%S is mapped to %s for %s in `%s'"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
|
|
|
|
(viper-abbreviate-string
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(format
|
|
|
|
|
"%S"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq temp (viper-display-macro macro-body)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
14 "" ""
|
|
|
|
|
(if (stringp temp) " ....\"" " ....]"))
|
|
|
|
|
state-name (buffer-name)))
|
|
|
|
|
(buffer-name))
|
|
|
|
|
((y-or-n-p
|
More-conservative ‘format’ quote restyling
Instead of restyling curved quotes for every call to ‘format’,
create a new function ‘format-message’ that does the restyling,
and using the new function instead of ‘format’ only in contexts
where this seems appropriate.
Problem reported by Dmitry Gutov and Andreas Schwab in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00826.html
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00827.html
* doc/lispref/commands.texi (Using Interactive):
* doc/lispref/control.texi (Signaling Errors, Signaling Errors):
* doc/lispref/display.texi (Displaying Messages, Progress):
* doc/lispref/elisp.texi:
* doc/lispref/help.texi (Keys in Documentation):
* doc/lispref/minibuf.texi (Minibuffer Misc):
* doc/lispref/strings.texi (Formatting Strings):
* etc/NEWS:
Document the changes.
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/apropos.el (apropos-library):
* lisp/calc/calc-ext.el (calc-record-message)
(calc-user-function-list):
* lisp/calc/calc-help.el (calc-describe-key, calc-full-help):
* lisp/calc/calc-lang.el (math-read-big-balance):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--add-diary-entry):
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-completion-message):
* lisp/cedet/semantic/edit.el (semantic-parse-changes-failed):
* lisp/cedet/semantic/wisent/comp.el (wisent-log):
* lisp/cedet/srecode/insert.el (srecode-insert-show-error-report):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dframe.el (dframe-message):
* lisp/dired-aux.el (dired-query):
* lisp/emacs-lisp/byte-opt.el (byte-compile-log-lap-1):
* lisp/emacs-lisp/bytecomp.el (byte-compile-log)
(byte-compile-log-file, byte-compile-warn, byte-compile-form):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
(cconv-analyze-form):
* lisp/emacs-lisp/check-declare.el (check-declare-warn):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet):
* lisp/emacs-lisp/edebug.el (edebug-format):
* lisp/emacs-lisp/eieio-core.el (eieio-oref):
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message)
(eldoc-message):
* lisp/emacs-lisp/elint.el (elint-file, elint-log):
* lisp/emacs-lisp/find-func.el (find-function-library):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring):
* lisp/emacs-lisp/package.el (package-compute-transaction)
(package-install-button-action, package-delete-button-action)
(package-menu--list-to-prompt):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emacs-lisp/warnings.el (lwarn, warn):
* lisp/emulation/viper-cmd.el:
(viper-toggle-parse-sexp-ignore-comments)
(viper-kill-buffer, viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/facemenu.el (facemenu-add-new-face):
* lisp/faces.el (face-documentation, read-face-name)
(face-read-string, read-face-font, describe-face):
* lisp/files.el (find-alternate-file, hack-local-variables)
(hack-one-local-variable--obsolete, write-file)
(basic-save-buffer, delete-directory):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--obsolete)
(help-fns--interactive-only, describe-function-1)
(describe-variable):
* lisp/help.el (describe-mode):
* lisp/info-xref.el (info-xref-output):
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
* lisp/international/kkc.el (kkc-error):
* lisp/international/mule-cmds.el:
(select-safe-coding-system-interactively)
(select-safe-coding-system, describe-input-method):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/international/quail.el (quail-error):
* lisp/minibuffer.el (minibuffer-message):
* lisp/mpc.el (mpc--debug):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-message):
* lisp/net/gnutls.el (gnutls-message-maybe):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/nsm.el (nsm-query-user):
* lisp/net/rlogin.el (rlogin):
* lisp/net/soap-client.el (soap-warning):
* lisp/net/tramp.el (tramp-debug-message):
* lisp/nxml/nxml-outln.el (nxml-report-outline-error):
* lisp/nxml/nxml-parse.el (nxml-parse-error):
* lisp/nxml/rng-cmpct.el (rng-c-error):
* lisp/nxml/rng-match.el (rng-compile-error):
* lisp/nxml/rng-uri.el (rng-uri-error):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/org/org-ctags.el:
(org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/proced.el (proced-log):
* lisp/progmodes/ebnf2ps.el (ebnf-log):
* lisp/progmodes/flymake.el (flymake-log):
* lisp/progmodes/vhdl-mode.el (vhdl-warning-when-idle):
* lisp/replace.el (occur-1):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, define-alternatives):
* lisp/startup.el (command-line):
* lisp/subr.el (error, user-error, add-to-list):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* src/callint.c (Fcall_interactively):
* src/editfns.c (Fmessage, Fmessage_box):
Restyle the quotes of format strings intended for use as a
diagnostic, when restyling seems appropriate.
* lisp/subr.el (format-message): New function.
* src/doc.c (Finternal__text_restyle): New function.
(syms_of_doc): Define it.
2015-08-23 22:38:02 -07:00
|
|
|
|
(format-message
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 08:41:44 -07:00
|
|
|
|
"Map this macro for the major mode `%S' only? "
|
1995-02-20 23:15:10 +00:00
|
|
|
|
major-mode))
|
|
|
|
|
(setq msg
|
More-conservative ‘format’ quote restyling
Instead of restyling curved quotes for every call to ‘format’,
create a new function ‘format-message’ that does the restyling,
and using the new function instead of ‘format’ only in contexts
where this seems appropriate.
Problem reported by Dmitry Gutov and Andreas Schwab in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00826.html
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00827.html
* doc/lispref/commands.texi (Using Interactive):
* doc/lispref/control.texi (Signaling Errors, Signaling Errors):
* doc/lispref/display.texi (Displaying Messages, Progress):
* doc/lispref/elisp.texi:
* doc/lispref/help.texi (Keys in Documentation):
* doc/lispref/minibuf.texi (Minibuffer Misc):
* doc/lispref/strings.texi (Formatting Strings):
* etc/NEWS:
Document the changes.
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/apropos.el (apropos-library):
* lisp/calc/calc-ext.el (calc-record-message)
(calc-user-function-list):
* lisp/calc/calc-help.el (calc-describe-key, calc-full-help):
* lisp/calc/calc-lang.el (math-read-big-balance):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--add-diary-entry):
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-completion-message):
* lisp/cedet/semantic/edit.el (semantic-parse-changes-failed):
* lisp/cedet/semantic/wisent/comp.el (wisent-log):
* lisp/cedet/srecode/insert.el (srecode-insert-show-error-report):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dframe.el (dframe-message):
* lisp/dired-aux.el (dired-query):
* lisp/emacs-lisp/byte-opt.el (byte-compile-log-lap-1):
* lisp/emacs-lisp/bytecomp.el (byte-compile-log)
(byte-compile-log-file, byte-compile-warn, byte-compile-form):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
(cconv-analyze-form):
* lisp/emacs-lisp/check-declare.el (check-declare-warn):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet):
* lisp/emacs-lisp/edebug.el (edebug-format):
* lisp/emacs-lisp/eieio-core.el (eieio-oref):
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message)
(eldoc-message):
* lisp/emacs-lisp/elint.el (elint-file, elint-log):
* lisp/emacs-lisp/find-func.el (find-function-library):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring):
* lisp/emacs-lisp/package.el (package-compute-transaction)
(package-install-button-action, package-delete-button-action)
(package-menu--list-to-prompt):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emacs-lisp/warnings.el (lwarn, warn):
* lisp/emulation/viper-cmd.el:
(viper-toggle-parse-sexp-ignore-comments)
(viper-kill-buffer, viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/facemenu.el (facemenu-add-new-face):
* lisp/faces.el (face-documentation, read-face-name)
(face-read-string, read-face-font, describe-face):
* lisp/files.el (find-alternate-file, hack-local-variables)
(hack-one-local-variable--obsolete, write-file)
(basic-save-buffer, delete-directory):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--obsolete)
(help-fns--interactive-only, describe-function-1)
(describe-variable):
* lisp/help.el (describe-mode):
* lisp/info-xref.el (info-xref-output):
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
* lisp/international/kkc.el (kkc-error):
* lisp/international/mule-cmds.el:
(select-safe-coding-system-interactively)
(select-safe-coding-system, describe-input-method):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/international/quail.el (quail-error):
* lisp/minibuffer.el (minibuffer-message):
* lisp/mpc.el (mpc--debug):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-message):
* lisp/net/gnutls.el (gnutls-message-maybe):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/nsm.el (nsm-query-user):
* lisp/net/rlogin.el (rlogin):
* lisp/net/soap-client.el (soap-warning):
* lisp/net/tramp.el (tramp-debug-message):
* lisp/nxml/nxml-outln.el (nxml-report-outline-error):
* lisp/nxml/nxml-parse.el (nxml-parse-error):
* lisp/nxml/rng-cmpct.el (rng-c-error):
* lisp/nxml/rng-match.el (rng-compile-error):
* lisp/nxml/rng-uri.el (rng-uri-error):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/org/org-ctags.el:
(org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/proced.el (proced-log):
* lisp/progmodes/ebnf2ps.el (ebnf-log):
* lisp/progmodes/flymake.el (flymake-log):
* lisp/progmodes/vhdl-mode.el (vhdl-warning-when-idle):
* lisp/replace.el (occur-1):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, define-alternatives):
* lisp/startup.el (command-line):
* lisp/subr.el (error, user-error, add-to-list):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* src/callint.c (Fcall_interactively):
* src/editfns.c (Fmessage, Fmessage_box):
Restyle the quotes of format strings intended for use as a
diagnostic, when restyling seems appropriate.
* lisp/subr.el (format-message): New function.
* src/doc.c (Finternal__text_restyle): New function.
(syms_of_doc): Define it.
2015-08-23 22:38:02 -07:00
|
|
|
|
(format-message
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 08:41:44 -07:00
|
|
|
|
"%S is mapped to %s for %s in `%S'"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
|
|
|
|
(viper-abbreviate-string
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(format
|
|
|
|
|
"%S"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq temp (viper-display-macro macro-body)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
14 "" ""
|
|
|
|
|
(if (stringp macro-body) " ....\"" " ....]"))
|
|
|
|
|
state-name major-mode))
|
|
|
|
|
major-mode)
|
|
|
|
|
(t
|
|
|
|
|
(setq msg
|
|
|
|
|
(format
|
|
|
|
|
"%S is globally mapped to %s in %s"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
|
|
|
|
(viper-abbreviate-string
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(format
|
|
|
|
|
"%S"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq temp (viper-display-macro macro-body)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
14 "" ""
|
|
|
|
|
(if (stringp macro-body) " ....\"" " ....]"))
|
|
|
|
|
state-name))
|
|
|
|
|
t)))
|
1996-02-16 04:49:12 +00:00
|
|
|
|
(if (y-or-n-p
|
|
|
|
|
(format "Save this macro in %s? "
|
Remove most of the XEmacs compat code from viper*.el
* lisp/emulation/viper-cmd.el ()
(viper-insert-state-post-command-sentinel)
(viper-change-state-to-vi, viper-change-state-to-insert)
(viper-change-state-to-emacs, viper-escape-to-state)
(viper-special-read-and-insert-char, viper-toggle-key-action)
(viper-prefix-arg-value, viper-prefix-arg-com)
(viper-digit-argument, viper-command-argument, )
(viper-exec-Yank, viper-repeat, viper-forward-char)
(viper-backward-char, viper-forward-word, viper-forward-Word)
(viper-end-of-word, viper-end-of-Word, viper-backward-word)
(viper-backward-Word, viper-beginning-of-line)
(viper-bol-and-skip-white, viper-goto-eol, viper-goto-col)
(viper-next-line, viper-next-line-at-bol, viper-previous-line)
(viper-previous-line-at-bol, viper-goto-line, )
(viper-repeat-find, viper-repeat-find-opposite)
(viper-window-top, viper-window-middle, viper-window-bottom)
(viper-paren-match, viper-search, viper-buffer-search-enable)
(viper-put-back, viper-Put-back, viper-mark-point)
(viper-cycle-through-mark-ring, viper-goto-mark-subr)
(viper-brac-function, viper-register-to-point)
(viper-submit-report): Remove some XEmacs compat code.
* lisp/emulation/viper-ex.el (viper-get-ex-address-subr)
(viper-handle-!, ex-edit, ex-mark, ex-next-related-buffer)
(ex-help, ex-write, ex-write-info, viper-info-on-file): Ditto.
* lisp/emulation/viper-keym.el (viper-add-keymap): Ditto.
* lisp/emulation/viper-macs.el (viper-record-kbd-macro): Remove
XEmacs compat code.
* lisp/emulation/viper-mous.el (viper-mouse-click-insert-word)
(viper-mouse-click-search-word): Remove some XEmacs compat code.
* lisp/emulation/viper-util.el (viper-overlay-p)
(viper-color-defined-p, viper-iconify, viper-memq-char)
(viper-char-equal, viper=, viper-color-display-p)
(viper-get-cursor-color, viper-frame-value)
(viper-change-cursor-color, viper-save-cursor-color)
(viper-restore-cursor-color, viper-get-visible-buffer-window)
(viper-file-checked-in-p, viper-put-on-search-overlay)
(viper-flash-search-pattern, viper-hide-search-overlay)
(viper-move-replace-overlay, viper-set-replace-overlay)
(viper-set-replace-overlay-glyphs, viper-hide-replace-overlay)
(viper-replace-start, viper-replace-end)
(viper-set-minibuffer-overlay, viper-check-minibuffer-overlay)
(viper-abbreviate-file-name, viper-mark-marker)
(viper-set-mark-if-necessary, viper-leave-region-active)
(viper-copy-event, viper-read-event-convert-to-char)
(viper-event-key, viper-last-command-char)
(viper-key-to-emacs-key, viper-eventify-list-xemacs)
(viper-set-unread-command-events, viper-char-array-p)
(viper-key-press-events-to-chars, viper-read-char-exclusive):
Remove most of the XEmacs compat code.
* lisp/emulation/viper.el (viper-go-away, viper-set-hooks)
(viper-non-hook-settings): Remove some XEmacs compat code.
2019-06-20 00:48:49 +02:00
|
|
|
|
(abbreviate-file-name viper-custom-file-name)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(viper-save-string-in-file
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(format "\n(viper-record-kbd-macro %S '%S %s '%S)"
|
|
|
|
|
(viper-display-macro macro-name)
|
1995-10-14 02:25:42 +00:00
|
|
|
|
state
|
|
|
|
|
;; if we don't let vector macro-body through %S,
|
|
|
|
|
;; the symbols `\.' `\[' etc will be converted into
|
|
|
|
|
;; characters, causing invalid read error on recorded
|
2014-01-26 18:02:28 -08:00
|
|
|
|
;; macros in viper-custom-file-name.
|
1995-10-14 02:25:42 +00:00
|
|
|
|
;; I am not sure is macro-body can still be a string at
|
|
|
|
|
;; this point, but I am preserving this option anyway.
|
|
|
|
|
(if (vectorp macro-body)
|
|
|
|
|
(format "%S" macro-body)
|
|
|
|
|
macro-body)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
scope)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
viper-custom-file-name))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
2005-09-18 12:39:40 +00:00
|
|
|
|
(message "%s" msg)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq new-elt
|
|
|
|
|
(cons macro-name
|
|
|
|
|
(cond ((eq scope t) (list nil nil (cons t nil)))
|
|
|
|
|
((symbolp scope)
|
|
|
|
|
(list nil (list (cons scope nil)) (cons t nil)))
|
|
|
|
|
((stringp scope)
|
|
|
|
|
(list (list (cons scope nil)) nil (cons t nil))))))
|
|
|
|
|
(setq old-elt (assoc macro-name (eval macro-alist-var)))
|
|
|
|
|
|
2005-02-19 19:32:47 +00:00
|
|
|
|
(if (null old-elt)
|
|
|
|
|
(progn
|
|
|
|
|
;; insert new-elt in macro-alist-var and keep the list sorted
|
|
|
|
|
(define-key
|
|
|
|
|
keymap
|
|
|
|
|
(vector (viper-key-to-emacs-key (aref macro-name 0)))
|
|
|
|
|
'viper-exec-mapped-kbd-macro)
|
|
|
|
|
(setq lis (eval macro-alist-var))
|
|
|
|
|
(while (and lis (string< (viper-array-to-string (car (car lis)))
|
|
|
|
|
(viper-array-to-string macro-name)))
|
|
|
|
|
(setq lis2 (cons (car lis) lis2))
|
|
|
|
|
(setq lis (cdr lis)))
|
2007-09-26 00:17:55 +00:00
|
|
|
|
|
2005-02-19 19:32:47 +00:00
|
|
|
|
(setq lis2 (reverse lis2))
|
|
|
|
|
(set macro-alist-var (append lis2 (cons new-elt lis)))
|
|
|
|
|
(setq old-elt new-elt)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq old-sub-elt
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(cond ((eq scope t) (viper-kbd-global-pair old-elt))
|
|
|
|
|
((symbolp scope) (assoc scope (viper-kbd-mode-alist old-elt)))
|
|
|
|
|
((stringp scope) (assoc scope (viper-kbd-buf-alist old-elt)))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(if old-sub-elt
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setcdr old-sub-elt macro-body)
|
|
|
|
|
(cond ((symbolp scope) (setcar (cdr (cdr old-elt))
|
|
|
|
|
(cons (cons scope macro-body)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-kbd-mode-alist old-elt))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((stringp scope) (setcar (cdr old-elt)
|
|
|
|
|
(cons (cons scope macro-body)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-kbd-buf-alist old-elt))))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
|
|
|
|
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
;; macro name must be a vector of viper-style keys
|
2005-02-19 19:32:47 +00:00
|
|
|
|
;; viper-unrecord-kbd-macro doesn't have scope. Macro definitions are inherited
|
|
|
|
|
;; from global -> major mode -> buffer
|
|
|
|
|
;; More specific definition overrides more general
|
|
|
|
|
;; Can't unrecord definition for more specific, if a more general definition is
|
|
|
|
|
;; in effect
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-unrecord-kbd-macro (macro-name state)
|
1995-06-09 00:12:29 +00:00
|
|
|
|
"Delete macro MACRO-NAME from Viper STATE.
|
2014-01-26 18:02:28 -08:00
|
|
|
|
MACRO-NAME must be a vector of viper-style keys. This command is used
|
|
|
|
|
by Viper internally, but you can also use it in `viper-custom-file-name'
|
|
|
|
|
to delete pre-defined macros supplied with Viper. The best way to avoid
|
|
|
|
|
mistakes in macro names to be passed to this function is to use
|
|
|
|
|
`viper-describe-kbd-macros' and copy the name from there."
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(let* (state-name keymap
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(macro-alist-var
|
|
|
|
|
(cond ((eq state 'vi-state)
|
|
|
|
|
(setq state-name "Vi state"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
keymap viper-vi-kbd-map)
|
|
|
|
|
'viper-vi-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((memq state '(insert-state replace-state))
|
|
|
|
|
(setq state-name "Insert state"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
keymap viper-insert-kbd-map)
|
|
|
|
|
'viper-insert-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(t
|
|
|
|
|
(setq state-name "Emacs state"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
keymap viper-emacs-kbd-map)
|
|
|
|
|
'viper-emacs-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
|
|
|
|
buf-mapping mode-mapping global-mapping
|
|
|
|
|
macro-pair macro-entry)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; Macro-name is usually a vector. However, command history or macros
|
2014-01-26 18:02:28 -08:00
|
|
|
|
;; recorded in viper-custom-file-name may appear as strings.
|
|
|
|
|
;; So, convert to vectors.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq macro-name (viper-fixup-macro macro-name))
|
|
|
|
|
(if (viper-char-array-p macro-name)
|
|
|
|
|
(setq macro-name (viper-char-array-to-macro macro-name)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
(setq macro-entry (assoc macro-name (eval macro-alist-var)))
|
|
|
|
|
(if (= (length macro-name) 0)
|
|
|
|
|
(error "Can't unmap an empty macro name"))
|
|
|
|
|
(if (null macro-entry)
|
|
|
|
|
(error "%S is not mapped to a macro for %s in `%s'"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
state-name (buffer-name)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq buf-mapping (viper-kbd-buf-pair macro-entry)
|
|
|
|
|
mode-mapping (viper-kbd-mode-pair macro-entry)
|
|
|
|
|
global-mapping (viper-kbd-global-pair macro-entry))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(cond ((and (cdr buf-mapping)
|
|
|
|
|
(or (and (not (cdr mode-mapping)) (not (cdr global-mapping)))
|
|
|
|
|
(y-or-n-p
|
2015-08-29 21:40:21 -07:00
|
|
|
|
(format-message "Unmap %S for `%s' only? "
|
|
|
|
|
(viper-display-macro macro-name)
|
|
|
|
|
(buffer-name)))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq macro-pair buf-mapping)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(message "%S is unmapped for %s in `%s'"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
state-name (buffer-name)))
|
|
|
|
|
((and (cdr mode-mapping)
|
|
|
|
|
(or (not (cdr global-mapping))
|
|
|
|
|
(y-or-n-p
|
2015-08-29 21:40:21 -07:00
|
|
|
|
(format-message "Unmap %S for the major mode `%S' only? "
|
|
|
|
|
(viper-display-macro macro-name)
|
|
|
|
|
major-mode))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq macro-pair mode-mapping)
|
|
|
|
|
(message "%S is unmapped for %s in %S"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name) state-name major-mode))
|
2005-02-19 19:32:47 +00:00
|
|
|
|
((cdr (setq macro-pair global-mapping))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(message
|
1997-07-17 19:37:07 +00:00
|
|
|
|
"Global mapping for %S in %s is removed"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name) state-name))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(t (error "%S is not mapped to a macro for %s in `%s'"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro macro-name)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
state-name (buffer-name))))
|
|
|
|
|
(setcdr macro-pair nil)
|
|
|
|
|
(or (cdr buf-mapping)
|
|
|
|
|
(cdr mode-mapping)
|
|
|
|
|
(cdr global-mapping)
|
|
|
|
|
(progn
|
|
|
|
|
(set macro-alist-var (delq macro-entry (eval macro-alist-var)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(if (viper-can-release-key (aref macro-name 0)
|
2005-02-19 19:32:47 +00:00
|
|
|
|
(eval macro-alist-var))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(define-key
|
|
|
|
|
keymap
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(vector (viper-key-to-emacs-key (aref macro-name 0)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
nil))
|
|
|
|
|
))
|
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-06-09 00:12:29 +00:00
|
|
|
|
;; Check if MACRO-ALIST has an entry for a macro name starting with
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; CHAR. If not, this indicates that the binding for this char
|
1997-08-02 07:40:22 +00:00
|
|
|
|
;; in viper-vi/insert-kbd-map can be released.
|
|
|
|
|
(defun viper-can-release-key (char macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let ((lis macro-alist)
|
|
|
|
|
(can-release t)
|
|
|
|
|
macro-name)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(while (and lis can-release)
|
|
|
|
|
(setq macro-name (car (car lis)))
|
|
|
|
|
(if (eq char (aref macro-name 0))
|
|
|
|
|
(setq can-release nil))
|
|
|
|
|
(setq lis (cdr lis)))
|
|
|
|
|
can-release))
|
|
|
|
|
|
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-exec-mapped-kbd-macro (count)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
"Dispatch kbd macro."
|
|
|
|
|
(interactive "P")
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(let* ((macro-alist (cond ((eq viper-current-state 'vi-state)
|
|
|
|
|
viper-vi-kbd-macro-alist)
|
|
|
|
|
((memq viper-current-state
|
1995-02-20 23:15:10 +00:00
|
|
|
|
'(insert-state replace-state))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
viper-insert-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(t
|
1997-08-02 07:40:22 +00:00
|
|
|
|
viper-emacs-kbd-macro-alist)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(unmatched-suffix "")
|
|
|
|
|
;; Macros and keys are executed with other macros turned off
|
|
|
|
|
;; For macros, this is done to avoid macro recursion
|
1997-08-02 07:40:22 +00:00
|
|
|
|
viper-vi-kbd-minor-mode viper-insert-kbd-minor-mode
|
|
|
|
|
viper-emacs-kbd-minor-mode
|
1995-02-20 23:15:10 +00:00
|
|
|
|
next-best-match keyseq event-seq
|
|
|
|
|
macro-first-char macro-alist-elt macro-body
|
|
|
|
|
command)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq macro-first-char last-command-event
|
1997-08-02 07:40:22 +00:00
|
|
|
|
event-seq (viper-read-fast-keysequence macro-first-char macro-alist)
|
|
|
|
|
keyseq (viper-events-to-macro event-seq)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
macro-alist-elt (assoc keyseq macro-alist)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
next-best-match (viper-find-best-matching-macro macro-alist keyseq))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (null macro-alist-elt)
|
|
|
|
|
(setq macro-alist-elt (car next-best-match)
|
2005-07-10 18:46:24 +00:00
|
|
|
|
unmatched-suffix (viper-subseq event-seq (cdr next-best-match))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
(cond ((null macro-alist-elt))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
((setq macro-body (viper-kbd-buf-definition macro-alist-elt)))
|
|
|
|
|
((setq macro-body (viper-kbd-mode-definition macro-alist-elt)))
|
|
|
|
|
((setq macro-body (viper-kbd-global-definition macro-alist-elt))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; when defining keyboard macro, don't use the macro mappings
|
|
|
|
|
(if (and macro-body (not defining-kbd-macro))
|
|
|
|
|
;; block cmd executed as part of a macro from entering command history
|
|
|
|
|
(let ((command-history command-history))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq viper-this-kbd-macro (car macro-alist-elt))
|
|
|
|
|
(execute-kbd-macro (viper-macro-to-events macro-body) count)
|
|
|
|
|
(setq viper-this-kbd-macro nil
|
|
|
|
|
viper-last-kbd-macro (car macro-alist-elt))
|
|
|
|
|
(viper-set-unread-command-events unmatched-suffix))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; If not a macro, or the macro is suppressed while defining another
|
|
|
|
|
;; macro, put keyseq back on the event queue
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-set-unread-command-events event-seq)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; if the user typed arg, then use it if prefix arg is not set by
|
|
|
|
|
;; some other command (setting prefix arg can happen if we do, say,
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; 2dw and there is a macro starting with 2. Then control will go to
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; this routine
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(or prefix-arg (setq prefix-arg count))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq command (key-binding (read-key-sequence nil)))
|
|
|
|
|
(if (commandp command)
|
|
|
|
|
(command-execute command)
|
|
|
|
|
(beep 1)))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Displaying and completing macros
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-describe-kbd-macros ()
|
1995-02-20 23:15:10 +00:00
|
|
|
|
"Show currently defined keyboard macros."
|
|
|
|
|
(interactive)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(with-output-to-temp-buffer " *viper-info*"
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ "Macros in Vi state:\n===================\n")
|
2007-09-26 00:17:55 +00:00
|
|
|
|
(mapc 'viper-describe-one-macro viper-vi-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ "\n\nMacros in Insert and Replace states:\n====================================\n")
|
2007-09-26 00:17:55 +00:00
|
|
|
|
(mapc 'viper-describe-one-macro viper-insert-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ "\n\nMacros in Emacs state:\n======================\n")
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(mapcar 'viper-describe-one-macro viper-emacs-kbd-macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-describe-one-macro (macro)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ (format "\n *** Mappings for %S:\n ------------\n"
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-macro (car macro))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ " ** Buffer-specific:")
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(if (viper-kbd-buf-alist macro)
|
2007-09-26 00:17:55 +00:00
|
|
|
|
(mapc 'viper-describe-one-macro-elt (viper-kbd-buf-alist macro))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ " none\n"))
|
|
|
|
|
(princ "\n ** Mode-specific:")
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(if (viper-kbd-mode-alist macro)
|
2007-09-26 00:17:55 +00:00
|
|
|
|
(mapc 'viper-describe-one-macro-elt (viper-kbd-mode-alist macro))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ " none\n"))
|
|
|
|
|
(princ "\n ** Global:")
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(if (viper-kbd-global-definition macro)
|
|
|
|
|
(princ (format "\n %S" (cdr (viper-kbd-global-pair macro))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(princ " none"))
|
|
|
|
|
(princ "\n"))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-describe-one-macro-elt (elt)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let ((name (car elt))
|
|
|
|
|
(defn (cdr elt)))
|
|
|
|
|
(princ (format "\n * %S:\n %S\n" name defn))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; check if SEQ is a prefix of some car of an element in ALIST
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-keyseq-is-a-possible-macro (seq alist)
|
|
|
|
|
(let ((converted-seq (viper-events-to-macro seq)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(eval (cons 'or
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(mapcar
|
1999-11-01 07:16:15 +00:00
|
|
|
|
(lambda (elt) (viper-prefix-subseq-p converted-seq elt))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-this-buffer-macros alist))))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; whether SEQ1 is a prefix of SEQ2
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-prefix-subseq-p (seq1 seq2)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let ((len1 (length seq1))
|
|
|
|
|
(len2 (length seq2)))
|
|
|
|
|
(if (<= len1 len2)
|
2005-07-10 18:46:24 +00:00
|
|
|
|
(equal seq1 (viper-subseq seq2 0 len1)))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; find the longest common prefix
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-common-seq-prefix (&rest seqs)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let* ((first (car seqs))
|
|
|
|
|
(rest (cdr seqs))
|
|
|
|
|
(pref [])
|
|
|
|
|
(idx 0)
|
|
|
|
|
len)
|
|
|
|
|
(if (= (length seqs) 0)
|
|
|
|
|
(setq len 0)
|
|
|
|
|
(setq len (apply 'min (mapcar 'length seqs))))
|
|
|
|
|
(while (< idx len)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(if (eval (cons 'and
|
1999-11-01 07:16:15 +00:00
|
|
|
|
(mapcar (lambda (s) (equal (elt first idx) (elt s idx)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
rest)))
|
|
|
|
|
(setq pref (vconcat pref (vector (elt first idx)))))
|
|
|
|
|
(setq idx (1+ idx)))
|
|
|
|
|
pref))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; get all sequences that match PREFIX from a given A-LIST
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-extract-matching-alist-members (pref alist)
|
1999-11-01 07:16:15 +00:00
|
|
|
|
(delq nil (mapcar (lambda (elt) (if (viper-prefix-subseq-p pref elt) elt))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-this-buffer-macros alist))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-do-sequence-completion (seq alist compl-message)
|
|
|
|
|
(let* ((matches (viper-extract-matching-alist-members seq alist))
|
|
|
|
|
(new-seq (apply 'viper-common-seq-prefix matches))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
)
|
|
|
|
|
(cond ((and (equal seq new-seq) (= (length matches) 1))
|
|
|
|
|
(message "%s (Sole completion)" compl-message)
|
|
|
|
|
(sit-for 2))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
((null matches)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(message "%s (No match)" compl-message)
|
|
|
|
|
(sit-for 2)
|
|
|
|
|
(setq new-seq seq))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
((member seq matches)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(message "%s (Complete, but not unique)" compl-message)
|
|
|
|
|
(sit-for 2)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-vector-completions matches))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((equal seq new-seq)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-display-vector-completions matches)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
new-seq))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-display-vector-completions (list)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(with-output-to-temp-buffer "*Completions*"
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(display-completion-list
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(mapcar 'prin1-to-string
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(mapcar 'viper-display-macro list)))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; alist is the alist of macros
|
|
|
|
|
;; str is the fast key sequence entered
|
|
|
|
|
;; returns: (matching-macro-def . unmatched-suffix-start-index)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-find-best-matching-macro (alist str)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let ((lis alist)
|
|
|
|
|
(def-len 0)
|
|
|
|
|
(str-len (length str))
|
|
|
|
|
match unmatched-start-idx found macro-def)
|
|
|
|
|
(while (and (not found) lis)
|
|
|
|
|
(setq macro-def (car lis)
|
|
|
|
|
def-len (length (car macro-def)))
|
|
|
|
|
(if (and (>= str-len def-len)
|
2005-07-10 18:46:24 +00:00
|
|
|
|
(equal (car macro-def) (viper-subseq str 0 def-len)))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(if (or (viper-kbd-buf-definition macro-def)
|
|
|
|
|
(viper-kbd-mode-definition macro-def)
|
|
|
|
|
(viper-kbd-global-definition macro-def))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq found t))
|
|
|
|
|
)
|
|
|
|
|
(setq lis (cdr lis)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if found
|
|
|
|
|
(setq match macro-def
|
|
|
|
|
unmatched-start-idx def-len)
|
|
|
|
|
(setq match nil
|
|
|
|
|
unmatched-start-idx 0))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(cons match unmatched-start-idx)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; returns a list of names of macros defined for the current buffer
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-this-buffer-macros (macro-alist)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let (candidates)
|
|
|
|
|
(setq candidates
|
1999-11-01 07:16:15 +00:00
|
|
|
|
(mapcar (lambda (elt)
|
|
|
|
|
(if (or (viper-kbd-buf-definition elt)
|
|
|
|
|
(viper-kbd-mode-definition elt)
|
|
|
|
|
(viper-kbd-global-definition elt))
|
|
|
|
|
(car elt)))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
macro-alist))
|
|
|
|
|
(setq candidates (delq nil candidates))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
1995-06-09 00:12:29 +00:00
|
|
|
|
;; if seq of Viper key symbols (representing a macro) can be converted to a
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; string--do so. Otherwise, do nothing.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-display-macro (macro-name-or-body)
|
|
|
|
|
(cond ((viper-char-symbol-sequence-p macro-name-or-body)
|
1996-02-16 19:02:38 +00:00
|
|
|
|
(mapconcat 'symbol-name macro-name-or-body ""))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
((viper-char-array-p macro-name-or-body)
|
1996-02-16 19:02:38 +00:00
|
|
|
|
(mapconcat 'char-to-string macro-name-or-body ""))
|
|
|
|
|
(t macro-name-or-body)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1996-02-16 21:50:58 +00:00
|
|
|
|
;; convert sequence of events (that came presumably from emacs kbd macro) into
|
|
|
|
|
;; Viper's macro, which is a vector of the form
|
|
|
|
|
;; [ desc desc ... ]
|
|
|
|
|
;; Each desc is either a symbol of (meta symb), (shift symb), etc.
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; Here we purge events that happen to be lists. In most cases, these events
|
1996-02-16 21:50:58 +00:00
|
|
|
|
;; got into a macro definition unintentionally; say, when the user moves mouse
|
|
|
|
|
;; during a macro definition, then something like (switch-frame ...) might get
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; in. Another reason for purging lists-events is that we can't store them in
|
1996-02-16 21:50:58 +00:00
|
|
|
|
;; textual form (say, in .emacs) and then read them back.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-events-to-macro (event-seq)
|
1999-11-01 07:16:15 +00:00
|
|
|
|
(vconcat (delq nil (mapcar (lambda (elt) (if (consp elt)
|
|
|
|
|
nil
|
|
|
|
|
(viper-event-key elt)))
|
1996-02-16 21:50:58 +00:00
|
|
|
|
event-seq))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-06-09 00:12:29 +00:00
|
|
|
|
;; convert strings or arrays of characters to Viper macro form
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-char-array-to-macro (array)
|
2019-06-20 00:11:42 +02:00
|
|
|
|
(vconcat (mapcar 'viper-event-key (vconcat array))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1996-02-16 19:02:38 +00:00
|
|
|
|
;; For macros bodies and names, goes over MACRO and checks if all members are
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; names of keys (actually, it only checks if they are symbols or lists
|
1996-02-16 19:02:38 +00:00
|
|
|
|
;; if a digit is found, it is converted into a symbol (e.g., 0 -> \0, etc).
|
|
|
|
|
;; If MACRO is not a list or vector -- doesn't change MACRO.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-fixup-macro (macro)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let ((len (length macro))
|
|
|
|
|
(idx 0)
|
|
|
|
|
elt break)
|
|
|
|
|
(if (or (vectorp macro) (listp macro))
|
|
|
|
|
(while (and (< idx len) (not break))
|
|
|
|
|
(setq elt (elt macro idx))
|
|
|
|
|
(cond ((numberp elt)
|
|
|
|
|
;; fix number
|
|
|
|
|
(if (and (<= 0 elt) (<= elt 9))
|
|
|
|
|
(cond ((arrayp macro)
|
|
|
|
|
(aset macro
|
|
|
|
|
idx
|
|
|
|
|
(intern (char-to-string (+ ?0 elt)))))
|
|
|
|
|
((listp macro)
|
|
|
|
|
(setcar (nthcdr idx macro)
|
|
|
|
|
(intern (char-to-string (+ ?0 elt)))))
|
|
|
|
|
)))
|
|
|
|
|
((listp elt)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-fixup-macro elt))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((symbolp elt) nil)
|
|
|
|
|
(t (setq break t)))
|
|
|
|
|
(setq idx (1+ idx))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if break
|
|
|
|
|
(error "Wrong type macro component, symbol-or-listp, %S" elt)
|
|
|
|
|
macro)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-macro-to-events (macro-body)
|
|
|
|
|
(vconcat (mapcar 'viper-key-to-emacs-key macro-body)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
|
|
|
|
;;; Reading fast key sequences
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; Assuming that CHAR was the first character in a fast succession of key
|
1999-11-01 07:16:15 +00:00
|
|
|
|
;; strokes, read the rest. Return the vector of keys that was entered in
|
1995-02-20 23:15:10 +00:00
|
|
|
|
;; this fast succession of key strokes.
|
|
|
|
|
;; A fast keysequence is one that is terminated by a pause longer than
|
1997-08-02 07:40:22 +00:00
|
|
|
|
;; viper-fast-keyseq-timeout.
|
|
|
|
|
(defun viper-read-fast-keysequence (event macro-alist)
|
2018-09-12 21:47:39 -04:00
|
|
|
|
;; FIXME: Do we still need this? Now that the discrimination between the ESC
|
|
|
|
|
;; key and the ESC byte sent as part of terminal escape sequences is performed
|
|
|
|
|
;; in the input-decode-map, I suspect that we don't need this hack any more.
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(let ((lis (vector event))
|
|
|
|
|
next-event)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(while (and (viper-fast-keysequence-p)
|
2008-04-03 21:04:18 +00:00
|
|
|
|
(viper-keyseq-is-a-possible-macro lis macro-alist))
|
|
|
|
|
;; Seems that viper-read-event is more robust here. We need to be able to
|
|
|
|
|
;; place these events on unread-command-events list. If we use
|
2018-09-12 21:47:39 -04:00
|
|
|
|
;; read-key then events will be converted to keys, and sometimes
|
2008-04-03 21:04:18 +00:00
|
|
|
|
;; (e.g., (control \[)) those keys differ from the corresponding events.
|
2018-09-12 21:47:39 -04:00
|
|
|
|
;; So, do not use (setq next-event (read-key))
|
2019-06-20 00:59:07 +02:00
|
|
|
|
(setq next-event (read-event))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(or (viper-mouse-event-p next-event)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(setq lis (vconcat lis (vector next-event)))))
|
|
|
|
|
lis))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Keyboard macros in registers
|
|
|
|
|
|
|
|
|
|
;; sets register to last-kbd-macro carefully.
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-set-register-macro (reg)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (get-register reg)
|
1999-11-01 07:16:15 +00:00
|
|
|
|
(if (y-or-n-p "Register contains data. Overwrite? ")
|
1995-02-20 23:15:10 +00:00
|
|
|
|
()
|
|
|
|
|
(error
|
1999-11-01 07:16:15 +00:00
|
|
|
|
"Macro not saved in register. Can still be invoked via `C-x e'")))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(set-register reg last-kbd-macro))
|
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-register-macro (count)
|
2015-09-17 16:08:20 -07:00
|
|
|
|
"Keyboard macros in registers - a modified @ command."
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(interactive "P")
|
|
|
|
|
(let ((reg (downcase (read-char))))
|
|
|
|
|
(cond ((or (and (<= ?a reg) (<= reg ?z)))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq viper-last-macro-reg reg)
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if defining-kbd-macro
|
|
|
|
|
(progn
|
|
|
|
|
(end-kbd-macro)
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(viper-set-register-macro reg))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(execute-kbd-macro (get-register reg) count)))
|
|
|
|
|
((or (= ?@ reg) (= ?\^j reg) (= ?\^m reg))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(if viper-last-macro-reg
|
1995-02-20 23:15:10 +00:00
|
|
|
|
nil
|
|
|
|
|
(error "No previous kbd macro"))
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(execute-kbd-macro (get-register viper-last-macro-reg) count))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
((= ?\# reg)
|
|
|
|
|
(start-kbd-macro count))
|
|
|
|
|
((= ?! reg)
|
|
|
|
|
(setq reg (downcase (read-char)))
|
|
|
|
|
(if (or (and (<= ?a reg) (<= reg ?z)))
|
|
|
|
|
(progn
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(setq viper-last-macro-reg reg)
|
|
|
|
|
(viper-set-register-macro reg))))
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(t
|
1996-02-16 05:25:08 +00:00
|
|
|
|
(error "`%c': Unknown register" reg)))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
1995-02-20 23:15:10 +00:00
|
|
|
|
|
1997-08-02 07:40:22 +00:00
|
|
|
|
(defun viper-global-execute ()
|
2011-12-04 00:02:42 -08:00
|
|
|
|
"Call last keyboard macro for each line in the region."
|
1995-02-20 23:15:10 +00:00
|
|
|
|
(if (> (point) (mark t)) (exchange-point-and-mark))
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(call-last-kbd-macro)
|
|
|
|
|
(while (< (point) (mark t))
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(call-last-kbd-macro)))
|
|
|
|
|
|
|
|
|
|
|
2001-07-15 19:53:53 +00:00
|
|
|
|
;;; viper-macs.el ends here
|