2001-11-19 07:44:56 +00:00
|
|
|
;;; calc-yank.el --- kill-ring functionality for Calc
|
|
|
|
|
2017-01-01 03:14:01 +00:00
|
|
|
;; Copyright (C) 1990-1993, 2001-2017 Free Software Foundation, Inc.
|
2001-11-19 07:44:56 +00:00
|
|
|
|
|
|
|
;; Author: David Gillespie <daveg@synaptics.com>
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 03:16:00 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2007-03-19 20:59:53 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:16:00 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
2007-03-19 20:59:53 +00:00
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2007-03-19 20:59:53 +00:00
|
|
|
;; 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 22:52:52 +00:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2001-11-19 07:44:56 +00:00
|
|
|
;;; Commentary:
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2001-11-19 07:44:56 +00:00
|
|
|
;;; Code:
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
;; This file is autoloaded from calc-ext.el.
|
|
|
|
|
2004-11-30 17:29:04 +00:00
|
|
|
(require 'calc-ext)
|
2001-11-06 18:59:06 +00:00
|
|
|
(require 'calc-macs)
|
|
|
|
|
|
|
|
;;; Kill ring commands.
|
|
|
|
|
|
|
|
(defun calc-kill (nn &optional no-delete)
|
|
|
|
(interactive "P")
|
|
|
|
(if (eq major-mode 'calc-mode)
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-force-refresh)
|
|
|
|
(calc-set-command-flag 'no-align)
|
|
|
|
(let ((num (max (calc-locate-cursor-element (point)) 1))
|
|
|
|
(n (prefix-numeric-value nn)))
|
|
|
|
(if (< n 0)
|
|
|
|
(progn
|
|
|
|
(if (eobp)
|
|
|
|
(setq num (1- num)))
|
|
|
|
(setq num (- num n)
|
|
|
|
n (- n))))
|
2008-05-18 05:10:51 +00:00
|
|
|
(calc-check-stack num)
|
2001-11-06 18:59:06 +00:00
|
|
|
(let ((stuff (calc-top-list n (- num n -1))))
|
|
|
|
(calc-cursor-stack-index num)
|
|
|
|
(let ((first (point)))
|
|
|
|
(calc-cursor-stack-index (- num n))
|
|
|
|
(if (null nn)
|
|
|
|
(backward-char 1)) ; don't include newline for raw C-k
|
|
|
|
(copy-region-as-kill first (point))
|
|
|
|
(if (not no-delete)
|
|
|
|
(calc-pop-stack n (- num n -1))))
|
|
|
|
(setq calc-last-kill (cons (car kill-ring) stuff)))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(kill-line nn)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-force-refresh ()
|
|
|
|
(if (or calc-executing-macro calc-display-dirty)
|
|
|
|
(let ((calc-executing-macro nil))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-refresh))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-locate-cursor-element (pt)
|
|
|
|
(save-excursion
|
|
|
|
(goto-char (point-max))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-locate-cursor-scan (- calc-stack-top) calc-stack pt)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-locate-cursor-scan (n stack pt)
|
|
|
|
(if (or (<= (point) pt)
|
|
|
|
(null stack))
|
|
|
|
n
|
|
|
|
(forward-line (- (nth 1 (car stack))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-locate-cursor-scan (1+ n) (cdr stack) pt)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-kill-region (top bot &optional no-delete)
|
|
|
|
(interactive "r")
|
|
|
|
(if (eq major-mode 'calc-mode)
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-force-refresh)
|
|
|
|
(calc-set-command-flag 'no-align)
|
|
|
|
(let* ((top-num (calc-locate-cursor-element top))
|
2008-05-18 05:10:51 +00:00
|
|
|
(top-pos (save-excursion
|
|
|
|
(calc-cursor-stack-index top-num)
|
|
|
|
(point)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(bot-num (calc-locate-cursor-element (1- bot)))
|
2008-05-18 05:10:51 +00:00
|
|
|
(bot-pos (save-excursion
|
|
|
|
(calc-cursor-stack-index (max 0 (1- bot-num)))
|
|
|
|
(point)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(num (- top-num bot-num -1)))
|
2008-05-18 05:10:51 +00:00
|
|
|
(copy-region-as-kill top-pos bot-pos)
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq calc-last-kill (cons (car kill-ring)
|
|
|
|
(calc-top-list num bot-num)))
|
|
|
|
(if (not no-delete)
|
|
|
|
(calc-pop-stack num bot-num))))
|
|
|
|
(if no-delete
|
|
|
|
(copy-region-as-kill top bot)
|
2001-11-14 09:09:09 +00:00
|
|
|
(kill-region top bot))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-copy-as-kill (n)
|
|
|
|
(interactive "P")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-kill n t))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-copy-region-as-kill (top bot)
|
|
|
|
(interactive "r")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-kill-region top bot t))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2015-10-11 20:35:18 +00:00
|
|
|
(defun math-number-regexp (radix-num)
|
|
|
|
"Return a regexp which will match a Calc number base RADIX-NUM."
|
|
|
|
(let* ((digit-range
|
|
|
|
(cond
|
|
|
|
;; radix 2 to 10
|
|
|
|
((and (<= 2 radix-num)
|
|
|
|
(>= 10 radix-num))
|
|
|
|
(concat "[0-"
|
|
|
|
(number-to-string (1- radix-num))
|
|
|
|
"]"))
|
|
|
|
;; radix 11
|
|
|
|
((= 11 radix-num) "[0-9aA]")
|
|
|
|
;; radix 12+
|
|
|
|
(t
|
|
|
|
(concat "[0-9"
|
|
|
|
"a-" (format "%c" (+ (- ?a 11) radix-num))
|
|
|
|
"A-" (format "%c" (+ (- ?A 11) radix-num))
|
|
|
|
"]"))))
|
|
|
|
(integer-regexp (concat digit-range "+"))
|
|
|
|
(decimal-regexp (concat digit-range "+\\." digit-range "*")))
|
|
|
|
(concat
|
|
|
|
" *\\("
|
|
|
|
;; "e" notation
|
|
|
|
"[-_+]?" decimal-regexp "[eE][-+]?[0-9]+"
|
|
|
|
"\\|"
|
|
|
|
"[-_+]?" integer-regexp "[eE][-+]?[0-9]+"
|
|
|
|
"\\|"
|
|
|
|
;; Integer+fractions
|
|
|
|
"[-_+]?" integer-regexp "*[:/]" integer-regexp "[:/]" integer-regexp
|
|
|
|
"\\|"
|
|
|
|
;; Fractions
|
|
|
|
"[-_+]?" integer-regexp "[:/]" integer-regexp
|
|
|
|
"\\|"
|
|
|
|
;; Decimal point
|
|
|
|
"[-_+]?" decimal-regexp
|
|
|
|
"\\|"
|
|
|
|
;; Integers
|
|
|
|
"[-_+]?" integer-regexp
|
|
|
|
"\\) *\\(\n\\|\\'\\)")))
|
|
|
|
|
2008-04-08 22:07:55 +00:00
|
|
|
;; This function uses calc-last-kill if possible to get an exact result,
|
|
|
|
;; otherwise it just parses the yanked string.
|
|
|
|
;; Modified to use Emacs 19 extended concept of kill-ring. -- daveg 12/15/96
|
|
|
|
;;;###autoload
|
2015-10-10 23:36:51 +00:00
|
|
|
(defun calc-yank (radix)
|
|
|
|
"Yank a value into the Calculator buffer.
|
|
|
|
|
|
|
|
Valid numeric prefixes for RADIX: 0, 2, 6, 8
|
|
|
|
No radix notation is prepended for any other numeric prefix.
|
|
|
|
|
|
|
|
If RADIX is 2, prepend \"2#\" - Binary.
|
|
|
|
If RADIX is 8, prepend \"8#\" - Octal.
|
|
|
|
If RADIX is 0, prepend \"10#\" - Decimal.
|
|
|
|
If RADIX is 6, prepend \"16#\" - Hexadecimal.
|
|
|
|
|
|
|
|
If RADIX is a non-nil list (created using \\[universal-argument]), the user
|
|
|
|
will be prompted to enter the radix in the minibuffer.
|
|
|
|
|
|
|
|
If RADIX is nil or if the yanked string already has a calc radix prefix, the
|
|
|
|
yanked string will be passed on directly to the Calculator buffer without any
|
|
|
|
alteration."
|
|
|
|
(interactive "P")
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-wrapper
|
|
|
|
(calc-pop-push-record-list
|
|
|
|
0 "yank"
|
2015-10-10 23:36:51 +00:00
|
|
|
(let* (radix-num
|
|
|
|
radix-notation
|
|
|
|
valid-num-regexp
|
|
|
|
(thing-raw
|
|
|
|
(if (fboundp 'current-kill)
|
|
|
|
(current-kill 0 t)
|
|
|
|
(car kill-ring-yank-pointer)))
|
|
|
|
(thing
|
|
|
|
(if (or (null radix)
|
|
|
|
;; Match examples: -2#10, 10\n(10#10,01)
|
|
|
|
(string-match-p "^[-(]*[0-9]\\{1,2\\}#" thing-raw))
|
|
|
|
thing-raw
|
|
|
|
(progn
|
|
|
|
(if (listp radix)
|
|
|
|
(progn
|
|
|
|
(setq radix-num
|
|
|
|
(read-number
|
|
|
|
"Set radix for yanked content (2-36): "))
|
|
|
|
(when (not (and (integerp radix-num)
|
|
|
|
(<= 2 radix-num)
|
|
|
|
(>= 36 radix-num)))
|
|
|
|
(error (concat "The radix has to be an "
|
|
|
|
"integer between 2 and 36."))))
|
|
|
|
(setq radix-num
|
|
|
|
(cond ((eq radix 2) 2)
|
|
|
|
((eq radix 8) 8)
|
|
|
|
((eq radix 0) 10)
|
|
|
|
((eq radix 6) 16)
|
|
|
|
(t (message
|
|
|
|
(concat "No radix prepended "
|
|
|
|
"for invalid *numeric* "
|
|
|
|
"prefix %0d.")
|
|
|
|
radix)
|
|
|
|
nil))))
|
|
|
|
(if radix-num
|
|
|
|
(progn
|
|
|
|
(setq radix-notation
|
|
|
|
(concat (number-to-string radix-num) "#"))
|
|
|
|
(setq valid-num-regexp
|
2015-10-11 20:35:18 +00:00
|
|
|
(math-number-regexp radix-num))
|
2015-10-10 23:36:51 +00:00
|
|
|
;; Ensure that the radix-notation is prefixed
|
|
|
|
;; correctly even for multi-line yanks like below,
|
|
|
|
;; 111
|
|
|
|
;; 1111
|
|
|
|
(replace-regexp-in-string
|
|
|
|
valid-num-regexp
|
|
|
|
(concat radix-notation "\\&")
|
|
|
|
thing-raw))
|
|
|
|
thing-raw)))))
|
2015-10-11 03:08:33 +00:00
|
|
|
(if (eq (car-safe calc-last-kill) thing-raw)
|
2015-10-10 23:36:51 +00:00
|
|
|
(cdr calc-last-kill)
|
|
|
|
(if (stringp thing)
|
|
|
|
(let ((val (math-read-exprs (calc-clean-newlines thing))))
|
|
|
|
(if (eq (car-safe val) 'error)
|
|
|
|
(progn
|
|
|
|
(setq val (math-read-exprs thing))
|
|
|
|
(if (eq (car-safe val) 'error)
|
|
|
|
(error "Bad format in yanked data")
|
|
|
|
val))
|
|
|
|
val))))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2011-12-04 08:02:42 +00:00
|
|
|
;;; The Calc set- and get-register commands are modified versions of functions
|
2008-05-18 20:34:02 +00:00
|
|
|
;;; in register.el
|
|
|
|
|
|
|
|
(defvar calc-register-alist nil
|
|
|
|
"Alist of elements (NAME . (TEXT . CALCVAL)).
|
|
|
|
NAME is a character (a number).
|
|
|
|
TEXT and CALCVAL are the TEXT and internal structure of stack entries.")
|
|
|
|
|
|
|
|
(defun calc-set-register (register text calcval)
|
|
|
|
"Set the contents of the Calc register REGISTER to (TEXT . CALCVAL),
|
|
|
|
as well as set the contents of the Emacs register REGISTER to TEXT."
|
|
|
|
(set-register register text)
|
2014-10-01 17:23:42 +00:00
|
|
|
(setf (alist-get register calc-register-alist) (cons text calcval)))
|
2008-05-18 20:34:02 +00:00
|
|
|
|
|
|
|
(defun calc-get-register (reg)
|
|
|
|
"Return the CALCVAL portion of the contents of the Calc register REG,
|
|
|
|
unless the TEXT portion doesn't match the contents of the Emacs register REG,
|
|
|
|
in which case either return the contents of the Emacs register (if it is
|
2015-05-21 17:04:45 +00:00
|
|
|
text) or nil."
|
2008-05-18 20:34:02 +00:00
|
|
|
(let ((cval (cdr (assq reg calc-register-alist)))
|
|
|
|
(val (cdr (assq reg register-alist))))
|
2008-05-19 02:42:28 +00:00
|
|
|
(if (stringp val)
|
|
|
|
(if (and (stringp (car cval))
|
|
|
|
(string= (car cval) val))
|
2008-05-18 20:34:02 +00:00
|
|
|
(cdr cval)
|
|
|
|
val))))
|
|
|
|
|
|
|
|
(defun calc-copy-to-register (register start end &optional delete-flag)
|
|
|
|
"Copy the lines in the region into register REGISTER.
|
2014-02-03 00:40:49 +00:00
|
|
|
With prefix arg, delete as well.
|
|
|
|
|
|
|
|
Interactively, reads the register using `register-read-with-preview'."
|
|
|
|
(interactive (list (register-read-with-preview "Copy to register: ")
|
|
|
|
(region-beginning) (region-end)
|
|
|
|
current-prefix-arg))
|
2008-05-18 20:34:02 +00:00
|
|
|
(if (eq major-mode 'calc-mode)
|
|
|
|
(let* ((top-num (calc-locate-cursor-element start))
|
|
|
|
(top-pos (save-excursion
|
|
|
|
(calc-cursor-stack-index top-num)
|
|
|
|
(point)))
|
|
|
|
(bot-num (calc-locate-cursor-element (1- end)))
|
|
|
|
(bot-pos (save-excursion
|
|
|
|
(calc-cursor-stack-index (max 0 (1- bot-num)))
|
|
|
|
(point)))
|
|
|
|
(num (- top-num bot-num -1))
|
|
|
|
(str (buffer-substring top-pos bot-pos)))
|
|
|
|
(calc-set-register register str (calc-top-list num bot-num))
|
|
|
|
(if delete-flag
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-pop-stack num bot-num))))
|
|
|
|
(copy-to-register register start end delete-flag)))
|
|
|
|
|
|
|
|
(defun calc-insert-register (register)
|
2014-02-03 00:40:49 +00:00
|
|
|
"Insert the contents of register REGISTER.
|
|
|
|
|
|
|
|
Interactively, reads the register using `register-read-with-preview'."
|
|
|
|
(interactive (list (register-read-with-preview "Insert register: ")))
|
2008-05-18 20:34:02 +00:00
|
|
|
(if (eq major-mode 'calc-mode)
|
|
|
|
(let ((val (calc-get-register register)))
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-pop-push-record-list
|
|
|
|
0 "insr"
|
|
|
|
(if (not val)
|
|
|
|
(error "Bad format in register data")
|
|
|
|
(if (consp val)
|
|
|
|
val
|
|
|
|
(let ((nval (math-read-exprs (calc-clean-newlines val))))
|
|
|
|
(if (eq (car-safe nval) 'error)
|
|
|
|
(progn
|
|
|
|
(setq nval (math-read-exprs val))
|
|
|
|
(if (eq (car-safe nval) 'error)
|
|
|
|
(error "Bad format in register data")
|
|
|
|
nval))
|
|
|
|
nval)))))))
|
|
|
|
(insert-register register)))
|
|
|
|
|
|
|
|
(defun calc-add-to-register (register start end prepend delete-flag)
|
|
|
|
"Add the lines in the region to register REGISTER.
|
2011-12-04 08:02:42 +00:00
|
|
|
If PREPEND is non-nil, add them to the beginning of the register,
|
2008-05-18 20:34:02 +00:00
|
|
|
otherwise the end. If DELETE-FLAG is non-nil, also delete the region."
|
|
|
|
(let* ((top-num (calc-locate-cursor-element start))
|
|
|
|
(top-pos (save-excursion
|
|
|
|
(calc-cursor-stack-index top-num)
|
|
|
|
(point)))
|
|
|
|
(bot-num (calc-locate-cursor-element (1- end)))
|
|
|
|
(bot-pos (save-excursion
|
|
|
|
(calc-cursor-stack-index (max 0 (1- bot-num)))
|
|
|
|
(point)))
|
|
|
|
(num (- top-num bot-num -1))
|
|
|
|
(str (buffer-substring top-pos bot-pos))
|
|
|
|
(calcval (calc-top-list num bot-num))
|
|
|
|
(cval (cdr (assq register calc-register-alist))))
|
|
|
|
(if (not cval)
|
|
|
|
(calc-set-register register str calcval)
|
|
|
|
(if prepend
|
|
|
|
(calc-set-register
|
|
|
|
register
|
|
|
|
(concat str (car cval))
|
|
|
|
(append calcval (cdr cval)))
|
|
|
|
(calc-set-register
|
|
|
|
register
|
|
|
|
(concat (car cval) str)
|
|
|
|
(append (cdr cval) calcval))))
|
|
|
|
(if delete-flag
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-pop-stack num bot-num)))))
|
|
|
|
|
|
|
|
(defun calc-append-to-register (register start end &optional delete-flag)
|
|
|
|
"Copy the lines in the region to the end of register REGISTER.
|
2014-02-03 00:40:49 +00:00
|
|
|
With prefix arg, also delete the region.
|
|
|
|
|
|
|
|
Interactively, reads the register using `register-read-with-preview'."
|
|
|
|
(interactive (list (register-read-with-preview "Append to register: ")
|
|
|
|
(region-beginning) (region-end)
|
|
|
|
current-prefix-arg))
|
2008-05-18 20:34:02 +00:00
|
|
|
(if (eq major-mode 'calc-mode)
|
|
|
|
(calc-add-to-register register start end nil delete-flag)
|
|
|
|
(append-to-register register start end delete-flag)))
|
2011-12-04 08:02:42 +00:00
|
|
|
|
2008-05-18 20:34:02 +00:00
|
|
|
(defun calc-prepend-to-register (register start end &optional delete-flag)
|
|
|
|
"Copy the lines in the region to the beginning of register REGISTER.
|
2014-02-03 00:40:49 +00:00
|
|
|
With prefix arg, also delete the region.
|
|
|
|
|
|
|
|
Interactively, reads the register using `register-read-with-preview'."
|
|
|
|
(interactive (list (register-read-with-preview "Prepend to register: ")
|
|
|
|
(region-beginning) (region-end)
|
|
|
|
current-prefix-arg))
|
2008-05-18 20:34:02 +00:00
|
|
|
(if (eq major-mode 'calc-mode)
|
|
|
|
(calc-add-to-register register start end t delete-flag)
|
|
|
|
(prepend-to-register register start end delete-flag)))
|
2011-12-04 08:02:42 +00:00
|
|
|
|
2008-05-18 20:34:02 +00:00
|
|
|
|
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
(defun calc-clean-newlines (s)
|
|
|
|
(cond
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
;; Omit leading/trailing whitespace
|
|
|
|
((or (string-match "\\`[ \n\r]+\\([^\001]*\\)\\'" s)
|
|
|
|
(string-match "\\`\\([^\001]*\\)[ \n\r]+\\'" s))
|
|
|
|
(calc-clean-newlines (math-match-substring s 1)))
|
|
|
|
|
|
|
|
;; Convert newlines to commas
|
|
|
|
((string-match "\\`\\(.*\\)[\n\r]+\\([^\001]*\\)\\'" s)
|
|
|
|
(calc-clean-newlines (concat (math-match-substring s 1) ","
|
|
|
|
(math-match-substring s 2))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2001-11-14 09:09:09 +00:00
|
|
|
(t s)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
(defun calc-do-grab-region (top bot arg)
|
2001-11-19 07:44:56 +00:00
|
|
|
(when (memq major-mode '(calc-mode calc-trail-mode))
|
|
|
|
(error "This command works only in a regular text buffer"))
|
2001-11-06 18:59:06 +00:00
|
|
|
(let* ((from-buffer (current-buffer))
|
|
|
|
(calc-was-started (get-buffer-window "*Calculator*"))
|
|
|
|
(single nil)
|
|
|
|
data vals pos)
|
|
|
|
(if arg
|
|
|
|
(if (consp arg)
|
|
|
|
(setq single t)
|
|
|
|
(setq arg (prefix-numeric-value arg))
|
|
|
|
(if (= arg 0)
|
Replace still more end-of-line etc with line-end-position, etc.
* lisp/gnus/nnbabyl.el (nnbabyl-request-move-article, nnbabyl-delete-mail)
(nnbabyl-check-mbox): Use point-at-bol.
* lisp/cedet/semantic/lex.el (semantic-lex-ignore-comments, semantic-flex):
* lisp/cedet/semantic/grammar.el (semantic-grammar-epilogue):
* lisp/cedet/ede/speedbar.el (ede-find-nearest-file-line):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/ede/autoconf-edit.el (autoconf-delete-parameter):
Use point-at-bol and point-at-eol.
* lisp/vc/emerge.el (emerge-line-number-in-buf):
* lisp/textmodes/ispell.el (ispell-region):
* lisp/textmodes/fill.el (current-fill-column):
* lisp/progmodes/xscheme.el (xscheme-send-current-line):
* lisp/progmodes/vhdl-mode.el (vhdl-current-line, vhdl-line-copy):
* lisp/progmodes/tcl.el (tcl-hairy-scan-for-comment):
* lisp/progmodes/sh-script.el (sh-handle-prev-do):
* lisp/progmodes/meta-mode.el (meta-indent-line):
* lisp/progmodes/idlwave.el (idlwave-goto-comment, idlwave-fill-paragraph)
(idlwave-in-quote):
* lisp/progmodes/idlw-shell.el (idlwave-shell-current-frame)
(idlwave-shell-update-bp-overlays, idlwave-shell-sources-filter):
* lisp/progmodes/fortran.el (fortran-looking-at-if-then):
* lisp/progmodes/etags.el (find-tag-in-order, etags-snarf-tag):
* lisp/progmodes/cperl-mode.el (cperl-sniff-for-indent)
(cperl-find-pods-heres):
* lisp/progmodes/ada-mode.el (ada-get-current-indent, ada-narrow-to-defun):
* lisp/net/quickurl.el (quickurl-list-insert):
* lisp/net/ldap.el (ldap-search-internal):
* lisp/net/eudc.el (eudc-expand-inline):
* lisp/mail/sendmail.el (sendmail-send-it):
* lisp/mail/mspools.el (mspools-visit-spool, mspools-get-spool-name):
* lisp/emulation/viper-cmd.el (viper-paren-match, viper-backward-indent)
(viper-brac-function):
* lisp/calc/calc-yank.el (calc-do-grab-region):
* lisp/calc/calc-keypd.el (calc-keypad-press):
* lisp/term.el (term-move-columns, term-insert-spaces):
* lisp/speedbar.el (speedbar-highlight-one-tag-line):
* lisp/simple.el (current-word):
* lisp/mouse-drag.el (mouse-drag-should-do-col-scrolling):
* lisp/info.el (Info-find-node-in-buffer-1, Info-follow-reference)
(Info-scroll-down):
* lisp/hippie-exp.el (he-line-beg):
* lisp/epa.el (epa--marked-keys):
* lisp/dired-aux.el (dired-kill-line, dired-do-kill-lines)
(dired-update-file-line, dired-add-entry, dired-remove-entry)
(dired-relist-entry):
* lisp/buff-menu.el (Buffer-menu-buffer):
* lisp/array.el (current-line):
* lisp/allout.el (allout-resolve-xref)
(allout-latex-verbatim-quote-curr-line):
Replace yet more uses of end-of-line etc with line-end-position.
2010-11-09 05:33:07 +00:00
|
|
|
(setq top (point-at-bol)
|
|
|
|
bot (point-at-eol))
|
2001-11-06 18:59:06 +00:00
|
|
|
(save-excursion
|
|
|
|
(setq top (point))
|
|
|
|
(forward-line arg)
|
|
|
|
(if (> arg 0)
|
|
|
|
(setq bot (point))
|
|
|
|
(setq bot top
|
|
|
|
top (point)))))))
|
|
|
|
(setq data (buffer-substring top bot))
|
|
|
|
(calc)
|
|
|
|
(if single
|
|
|
|
(setq vals (math-read-expr data))
|
|
|
|
(setq vals (math-read-expr (concat "[" data "]")))
|
|
|
|
(and (eq (car-safe vals) 'vec)
|
|
|
|
(= (length vals) 2)
|
|
|
|
(eq (car-safe (nth 1 vals)) 'vec)
|
|
|
|
(setq vals (nth 1 vals))))
|
|
|
|
(if (eq (car-safe vals) 'error)
|
|
|
|
(progn
|
|
|
|
(if calc-was-started
|
|
|
|
(pop-to-buffer from-buffer)
|
|
|
|
(calc-quit t)
|
|
|
|
(switch-to-buffer from-buffer))
|
|
|
|
(goto-char top)
|
|
|
|
(forward-char (+ (nth 1 vals) (if single 0 1)))
|
|
|
|
(error (nth 2 vals))))
|
|
|
|
(calc-slow-wrapper
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-enter-result 0 "grab" vals))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
(defun calc-do-grab-rectangle (top bot arg &optional reduce)
|
|
|
|
(and (memq major-mode '(calc-mode calc-trail-mode))
|
2001-11-19 07:44:56 +00:00
|
|
|
(error "This command works only in a regular text buffer"))
|
2001-11-06 18:59:06 +00:00
|
|
|
(let* ((col1 (save-excursion (goto-char top) (current-column)))
|
|
|
|
(col2 (save-excursion (goto-char bot) (current-column)))
|
|
|
|
(from-buffer (current-buffer))
|
|
|
|
(calc-was-started (get-buffer-window "*Calculator*"))
|
|
|
|
data mat vals lnum pt pos)
|
|
|
|
(if (= col1 col2)
|
|
|
|
(save-excursion
|
2001-11-19 07:44:56 +00:00
|
|
|
(unless (= col1 0)
|
|
|
|
(error "Point and mark must be at beginning of line, or define a rectangle"))
|
2001-11-06 18:59:06 +00:00
|
|
|
(goto-char top)
|
|
|
|
(while (< (point) bot)
|
|
|
|
(setq pt (point))
|
|
|
|
(forward-line 1)
|
|
|
|
(setq data (cons (buffer-substring pt (1- (point))) data)))
|
|
|
|
(setq data (nreverse data)))
|
|
|
|
(setq data (extract-rectangle top bot)))
|
|
|
|
(calc)
|
|
|
|
(setq mat (list 'vec)
|
|
|
|
lnum 0)
|
2001-11-19 07:44:56 +00:00
|
|
|
(when arg
|
|
|
|
(setq arg (if (consp arg) 0 (prefix-numeric-value arg))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(while data
|
|
|
|
(if (natnump arg)
|
|
|
|
(progn
|
|
|
|
(if (= arg 0)
|
|
|
|
(setq arg 1000000))
|
|
|
|
(setq pos 0
|
|
|
|
vals (list 'vec))
|
|
|
|
(let ((w (length (car data)))
|
|
|
|
j v)
|
|
|
|
(while (< pos w)
|
|
|
|
(setq j (+ pos arg)
|
|
|
|
v (if (>= j w)
|
|
|
|
(math-read-expr (substring (car data) pos))
|
|
|
|
(math-read-expr (substring (car data) pos j))))
|
|
|
|
(if (eq (car-safe v) 'error)
|
|
|
|
(setq vals v w 0)
|
|
|
|
(setq vals (nconc vals (list v))
|
|
|
|
pos j)))))
|
|
|
|
(if (string-match "\\` *-?[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]? *\\'"
|
|
|
|
(car data))
|
2005-05-02 19:45:21 +00:00
|
|
|
(setq vals (list 'vec (string-to-number (car data))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (and (null arg)
|
|
|
|
(string-match "[[{][^][{}]*[]}]" (car data)))
|
|
|
|
(setq pos (match-beginning 0)
|
|
|
|
vals (math-read-expr (math-match-substring (car data) 0)))
|
|
|
|
(let ((s (if (string-match
|
|
|
|
"\\`\\([0-9]+:[ \t]\\)?\\(.*[^, \t]\\)[, \t]*\\'"
|
|
|
|
(car data))
|
|
|
|
(math-match-substring (car data) 2)
|
|
|
|
(car data))))
|
|
|
|
(setq pos -1
|
|
|
|
vals (math-read-expr (concat "[" s "]")))
|
|
|
|
(if (eq (car-safe vals) 'error)
|
|
|
|
(let ((v2 (math-read-expr s)))
|
2001-11-19 07:44:56 +00:00
|
|
|
(unless (eq (car-safe v2) 'error)
|
|
|
|
(setq vals (list 'vec v2)))))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (eq (car-safe vals) 'error)
|
|
|
|
(progn
|
|
|
|
(if calc-was-started
|
|
|
|
(pop-to-buffer from-buffer)
|
|
|
|
(calc-quit t)
|
|
|
|
(switch-to-buffer from-buffer))
|
|
|
|
(goto-char top)
|
|
|
|
(forward-line lnum)
|
|
|
|
(forward-char (+ (nth 1 vals) (min col1 col2) pos))
|
|
|
|
(error (nth 2 vals))))
|
2001-11-19 07:44:56 +00:00
|
|
|
(unless (equal vals '(vec))
|
|
|
|
(setq mat (cons vals mat)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq data (cdr data)
|
|
|
|
lnum (1+ lnum)))
|
|
|
|
(calc-slow-wrapper
|
|
|
|
(if reduce
|
|
|
|
(calc-enter-result 0 "grb+" (list reduce '(var add var-add)
|
|
|
|
(nreverse mat)))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-enter-result 0 "grab" (nreverse mat))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
(defun calc-copy-to-buffer (nn)
|
|
|
|
"Copy the top of stack into an editing buffer."
|
|
|
|
(interactive "P")
|
|
|
|
(let ((thebuf (and (not (memq major-mode '(calc-mode calc-trail-mode)))
|
|
|
|
(current-buffer)))
|
|
|
|
(movept nil)
|
|
|
|
oldbuf newbuf)
|
|
|
|
(calc-wrapper
|
|
|
|
(save-excursion
|
|
|
|
(calc-force-refresh)
|
|
|
|
(let ((n (prefix-numeric-value nn))
|
|
|
|
(eat-lnums calc-line-numbering)
|
|
|
|
(big-offset (if (eq calc-language 'big) 1 0))
|
|
|
|
top bot)
|
|
|
|
(setq oldbuf (current-buffer)
|
|
|
|
newbuf (or thebuf
|
|
|
|
(calc-find-writable-buffer (buffer-list) 0)
|
|
|
|
(calc-find-writable-buffer (buffer-list) 1)
|
|
|
|
(error "No other buffer")))
|
|
|
|
(cond ((and (or (null nn)
|
|
|
|
(consp nn))
|
|
|
|
(= (calc-substack-height 0)
|
|
|
|
(- (1- (calc-substack-height 1)) big-offset)))
|
|
|
|
(calc-cursor-stack-index 1)
|
|
|
|
(if (looking-at
|
|
|
|
(if calc-line-numbering "[0-9]+: *[^ \n]" " *[^ \n]"))
|
|
|
|
(goto-char (1- (match-end 0))))
|
|
|
|
(setq eat-lnums nil
|
|
|
|
top (point))
|
|
|
|
(calc-cursor-stack-index 0)
|
|
|
|
(setq bot (- (1- (point)) big-offset)))
|
|
|
|
((> n 0)
|
|
|
|
(calc-cursor-stack-index n)
|
|
|
|
(setq top (point))
|
|
|
|
(calc-cursor-stack-index 0)
|
|
|
|
(setq bot (- (point) big-offset)))
|
|
|
|
((< n 0)
|
|
|
|
(calc-cursor-stack-index (- n))
|
|
|
|
(setq top (point))
|
|
|
|
(calc-cursor-stack-index (1- (- n)))
|
|
|
|
(setq bot (point)))
|
|
|
|
(t
|
|
|
|
(goto-char (point-min))
|
|
|
|
(forward-line 1)
|
|
|
|
(setq top (point))
|
|
|
|
(calc-cursor-stack-index 0)
|
|
|
|
(setq bot (point))))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer newbuf
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (consp nn)
|
|
|
|
(kill-region (region-beginning) (region-end)))
|
|
|
|
(push-mark (point) t)
|
|
|
|
(if (and overwrite-mode (not (consp nn)))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(calc-overwrite-string (with-current-buffer oldbuf
|
2001-11-06 18:59:06 +00:00
|
|
|
(buffer-substring top bot))
|
|
|
|
eat-lnums)
|
|
|
|
(or (bolp) (setq eat-lnums nil))
|
|
|
|
(insert-buffer-substring oldbuf top bot)
|
|
|
|
(and eat-lnums
|
|
|
|
(let ((n 1))
|
|
|
|
(while (and (> (point) (mark))
|
|
|
|
(progn
|
|
|
|
(forward-line -1)
|
|
|
|
(>= (point) (mark))))
|
|
|
|
(delete-char 4)
|
|
|
|
(setq n (1+ n)))
|
|
|
|
(forward-line n))))
|
2001-11-19 07:44:56 +00:00
|
|
|
(when thebuf
|
|
|
|
(setq movept (point)))
|
|
|
|
(when (get-buffer-window (current-buffer))
|
|
|
|
(set-window-point (get-buffer-window (current-buffer))
|
|
|
|
(point)))))))
|
|
|
|
(when movept
|
|
|
|
(goto-char movept))
|
|
|
|
(when (and (consp nn)
|
|
|
|
(not thebuf))
|
|
|
|
(calc-quit t)
|
|
|
|
(switch-to-buffer newbuf))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-overwrite-string (str eat-lnums)
|
2001-11-19 07:44:56 +00:00
|
|
|
(when (string-match "\n\\'" str)
|
|
|
|
(setq str (substring str 0 -1)))
|
|
|
|
(when eat-lnums
|
|
|
|
(setq str (substring str 4)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (and (string-match "\\`[-+]?[0-9.]+\\(e-?[0-9]+\\)?\\'" str)
|
|
|
|
(looking-at "[-+]?[0-9.]+\\(e-?[0-9]+\\)?"))
|
|
|
|
(progn
|
|
|
|
(delete-region (point) (match-end 0))
|
|
|
|
(insert str))
|
|
|
|
(let ((i 0))
|
|
|
|
(while (< i (length str))
|
2009-01-09 03:57:12 +00:00
|
|
|
(if (= (setq last-command-event (aref str i)) ?\n)
|
2001-11-06 18:59:06 +00:00
|
|
|
(or (= i (1- (length str)))
|
|
|
|
(let ((pt (point)))
|
|
|
|
(end-of-line)
|
|
|
|
(delete-region pt (point))
|
|
|
|
(if (eobp)
|
|
|
|
(insert "\n")
|
|
|
|
(forward-char 1))
|
|
|
|
(if eat-lnums (setq i (+ i 4)))))
|
|
|
|
(self-insert-command 1))
|
2001-11-14 09:09:09 +00:00
|
|
|
(setq i (1+ i))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2008-04-08 22:07:55 +00:00
|
|
|
;; First, require that buffer is visible and does not begin with "*"
|
|
|
|
;; Second, require only that it not begin with "*Calc"
|
2001-11-06 18:59:06 +00:00
|
|
|
(defun calc-find-writable-buffer (buf mode)
|
|
|
|
(and buf
|
|
|
|
(if (or (string-match "\\`\\( .*\\|\\*Calc.*\\)"
|
|
|
|
(buffer-name (car buf)))
|
|
|
|
(and (= mode 0)
|
|
|
|
(or (string-match "\\`\\*.*" (buffer-name (car buf)))
|
|
|
|
(not (get-buffer-window (car buf))))))
|
|
|
|
(calc-find-writable-buffer (cdr buf) mode)
|
2001-11-14 09:09:09 +00:00
|
|
|
(car buf))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
(defun calc-edit (n)
|
|
|
|
(interactive "p")
|
|
|
|
(calc-slow-wrapper
|
2001-11-19 07:44:56 +00:00
|
|
|
(when (eq n 0)
|
|
|
|
(setq n (calc-stack-size)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(let* ((flag nil)
|
|
|
|
(allow-ret (> n 1))
|
|
|
|
(list (math-showing-full-precision
|
|
|
|
(mapcar (if (> n 1)
|
|
|
|
(function (lambda (x)
|
|
|
|
(math-format-flat-expr x 0)))
|
|
|
|
(function
|
|
|
|
(lambda (x)
|
|
|
|
(if (math-vectorp x) (setq allow-ret t))
|
2001-11-13 07:30:58 +00:00
|
|
|
(math-format-nice-expr x (frame-width)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (> n 0)
|
|
|
|
(calc-top-list n)
|
|
|
|
(calc-top-list 1 (- n)))))))
|
|
|
|
(calc-edit-mode (list 'calc-finish-stack-edit (or flag n)) allow-ret)
|
|
|
|
(while list
|
|
|
|
(insert (car list) "\n")
|
|
|
|
(setq list (cdr list)))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-show-edit-buffer))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-alg-edit (str)
|
|
|
|
(calc-edit-mode '(calc-finish-stack-edit 0))
|
|
|
|
(calc-show-edit-buffer)
|
|
|
|
(insert str "\n")
|
|
|
|
(backward-char 1)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-set-command-flag 'do-edit))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2008-04-08 22:07:55 +00:00
|
|
|
(defvar calc-edit-mode-map
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
(define-key map "\n" 'calc-edit-finish)
|
|
|
|
(define-key map "\r" 'calc-edit-return)
|
|
|
|
(define-key map "\C-c\C-c" 'calc-edit-finish)
|
|
|
|
map)
|
|
|
|
"Keymap for use by the calc-edit command.")
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2004-11-26 22:34:23 +00:00
|
|
|
(defvar calc-original-buffer)
|
|
|
|
(defvar calc-return-buffer)
|
|
|
|
(defvar calc-one-window)
|
|
|
|
(defvar calc-edit-handler)
|
|
|
|
(defvar calc-restore-trail)
|
|
|
|
(defvar calc-allow-ret)
|
2005-01-02 17:04:37 +00:00
|
|
|
(defvar calc-edit-top)
|
2004-11-26 22:34:23 +00:00
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
(defun calc-edit-mode (&optional handler allow-ret title)
|
|
|
|
"Calculator editing mode. Press RET, LFD, or C-c C-c to finish.
|
|
|
|
To cancel the edit, simply kill the *Calc Edit* buffer."
|
|
|
|
(interactive)
|
2001-11-19 07:44:56 +00:00
|
|
|
(unless handler
|
|
|
|
(error "This command can be used only indirectly through calc-edit"))
|
2001-11-06 18:59:06 +00:00
|
|
|
(let ((oldbuf (current-buffer))
|
|
|
|
(buf (get-buffer-create "*Calc Edit*")))
|
|
|
|
(set-buffer buf)
|
|
|
|
(kill-all-local-variables)
|
|
|
|
(use-local-map calc-edit-mode-map)
|
|
|
|
(setq buffer-read-only nil)
|
|
|
|
(setq truncate-lines nil)
|
|
|
|
(setq major-mode 'calc-edit-mode)
|
|
|
|
(setq mode-name "Calc Edit")
|
2005-05-26 13:27:35 +00:00
|
|
|
(run-mode-hooks 'calc-edit-mode-hook)
|
2001-11-06 18:59:06 +00:00
|
|
|
(make-local-variable 'calc-original-buffer)
|
|
|
|
(setq calc-original-buffer oldbuf)
|
|
|
|
(make-local-variable 'calc-return-buffer)
|
|
|
|
(setq calc-return-buffer oldbuf)
|
|
|
|
(make-local-variable 'calc-one-window)
|
|
|
|
(setq calc-one-window (and (one-window-p t) pop-up-windows))
|
|
|
|
(make-local-variable 'calc-edit-handler)
|
|
|
|
(setq calc-edit-handler handler)
|
|
|
|
(make-local-variable 'calc-restore-trail)
|
|
|
|
(setq calc-restore-trail (get-buffer-window (calc-trail-buffer)))
|
|
|
|
(make-local-variable 'calc-allow-ret)
|
|
|
|
(setq calc-allow-ret allow-ret)
|
2005-01-18 04:52:55 +00:00
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(erase-buffer))
|
2011-12-04 08:02:42 +00:00
|
|
|
(add-hook 'kill-buffer-hook (lambda ()
|
2004-12-31 05:59:44 +00:00
|
|
|
(let ((calc-edit-handler nil))
|
|
|
|
(calc-edit-finish t))
|
2014-01-06 06:25:30 +00:00
|
|
|
(message "(Canceled)")) t t)
|
2005-01-02 07:39:20 +00:00
|
|
|
(insert (propertize
|
2011-12-04 08:02:42 +00:00
|
|
|
(concat
|
2005-01-02 07:39:20 +00:00
|
|
|
(or title title "Calc Edit Mode. ")
|
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 15:41:44 +00:00
|
|
|
(format-message "Press `C-c C-c'")
|
2005-01-02 07:39:20 +00:00
|
|
|
(if allow-ret "" " or RET")
|
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 15:41:44 +00:00
|
|
|
(format-message " to finish, `C-x k RET' to cancel.\n\n"))
|
2005-01-02 17:04:37 +00:00
|
|
|
'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t))
|
|
|
|
(make-local-variable 'calc-edit-top)
|
|
|
|
(setq calc-edit-top (point))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(put 'calc-edit-mode 'mode-class 'special)
|
|
|
|
|
|
|
|
(defun calc-show-edit-buffer ()
|
|
|
|
(let ((buf (current-buffer)))
|
|
|
|
(if (and (one-window-p t) pop-up-windows)
|
|
|
|
(pop-to-buffer (get-buffer-create "*Calc Edit*"))
|
|
|
|
(and calc-embedded-info (get-buffer-window (aref calc-embedded-info 1))
|
|
|
|
(select-window (get-buffer-window (aref calc-embedded-info 1))))
|
|
|
|
(switch-to-buffer (get-buffer-create "*Calc Edit*")))
|
|
|
|
(setq calc-return-buffer buf)
|
2001-11-13 07:30:58 +00:00
|
|
|
(if (and (< (window-width) (frame-width))
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-display-trail)
|
|
|
|
(let ((win (get-buffer-window (calc-trail-buffer))))
|
|
|
|
(if win
|
|
|
|
(delete-window win))))
|
|
|
|
(set-buffer-modified-p nil)
|
2005-01-02 17:04:37 +00:00
|
|
|
(goto-char calc-edit-top)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-edit-return ()
|
|
|
|
(interactive)
|
|
|
|
(if (and (boundp 'calc-allow-ret) calc-allow-ret)
|
|
|
|
(newline)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-edit-finish)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2004-11-19 22:17:25 +00:00
|
|
|
;; The variable calc-edit-disp-trail is local to calc-edit finish, but
|
|
|
|
;; is used by calc-finish-selection-edit and calc-finish-stack-edit.
|
|
|
|
(defvar calc-edit-disp-trail)
|
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
(defun calc-edit-finish (&optional keep)
|
|
|
|
"Finish calc-edit mode. Parse buffer contents and push them on the stack."
|
|
|
|
(interactive "P")
|
|
|
|
(message "Working...")
|
|
|
|
(or (and (boundp 'calc-original-buffer)
|
|
|
|
(boundp 'calc-return-buffer)
|
|
|
|
(boundp 'calc-one-window)
|
|
|
|
(boundp 'calc-edit-handler)
|
|
|
|
(boundp 'calc-restore-trail)
|
|
|
|
(eq major-mode 'calc-edit-mode))
|
2001-11-19 07:44:56 +00:00
|
|
|
(error "This command is valid only in buffers created by calc-edit"))
|
2001-11-06 18:59:06 +00:00
|
|
|
(let ((buf (current-buffer))
|
|
|
|
(original calc-original-buffer)
|
|
|
|
(return calc-return-buffer)
|
|
|
|
(one-window calc-one-window)
|
2004-11-19 22:17:25 +00:00
|
|
|
(calc-edit-disp-trail calc-restore-trail))
|
2001-11-06 18:59:06 +00:00
|
|
|
(save-excursion
|
2001-11-19 07:44:56 +00:00
|
|
|
(when (or (null (buffer-name original))
|
|
|
|
(progn
|
|
|
|
(set-buffer original)
|
|
|
|
(not (eq major-mode 'calc-mode))))
|
|
|
|
(error "Original calculator buffer has been corrupted")))
|
2005-01-02 17:04:37 +00:00
|
|
|
(goto-char calc-edit-top)
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (buffer-modified-p)
|
|
|
|
(eval calc-edit-handler))
|
2005-04-27 04:35:16 +00:00
|
|
|
(if (and one-window (not (one-window-p t)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(delete-window))
|
|
|
|
(if (get-buffer-window return)
|
|
|
|
(select-window (get-buffer-window return))
|
|
|
|
(switch-to-buffer return))
|
|
|
|
(if keep
|
|
|
|
(bury-buffer buf)
|
|
|
|
(kill-buffer buf))
|
2004-11-19 22:17:25 +00:00
|
|
|
(if calc-edit-disp-trail
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-wrapper
|
|
|
|
(calc-trail-display 1 t)))
|
2001-11-14 09:09:09 +00:00
|
|
|
(message "")))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-edit-cancel ()
|
|
|
|
"Cancel calc-edit mode. Ignore the Calc Edit buffer and don't change stack."
|
|
|
|
(interactive)
|
|
|
|
(let ((calc-edit-handler nil))
|
|
|
|
(calc-edit-finish))
|
2014-01-06 06:25:30 +00:00
|
|
|
(message "(Canceled)"))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-finish-stack-edit (num)
|
|
|
|
(let ((buf (current-buffer))
|
2005-01-02 17:04:37 +00:00
|
|
|
(str (buffer-substring calc-edit-top (point-max)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(start (point))
|
|
|
|
pos)
|
|
|
|
(if (and (integerp num) (> num 1))
|
|
|
|
(while (setq pos (string-match "\n." str))
|
|
|
|
(aset str pos ?\,)))
|
|
|
|
(switch-to-buffer calc-original-buffer)
|
|
|
|
(let ((vals (let ((calc-language nil)
|
2007-06-20 04:17:27 +00:00
|
|
|
(math-expr-opers (math-standard-ops)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(and (string-match "[^\n\t ]" str)
|
|
|
|
(math-read-exprs str)))))
|
2001-11-19 07:44:56 +00:00
|
|
|
(when (eq (car-safe vals) 'error)
|
|
|
|
(switch-to-buffer buf)
|
|
|
|
(goto-char (+ start (nth 1 vals)))
|
|
|
|
(error (nth 2 vals)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-wrapper
|
|
|
|
(if (symbolp num)
|
|
|
|
(progn
|
|
|
|
(set num (car vals))
|
|
|
|
(calc-refresh-evaltos num))
|
2004-11-19 22:17:25 +00:00
|
|
|
(if calc-edit-disp-trail
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-trail-display 1 t))
|
|
|
|
(and vals
|
2009-01-09 03:57:12 +00:00
|
|
|
(let ((calc-simplify-mode (if (eq last-command-event ?\C-j)
|
2001-11-06 18:59:06 +00:00
|
|
|
'none
|
|
|
|
calc-simplify-mode)))
|
|
|
|
(if (>= num 0)
|
|
|
|
(calc-enter-result num "edit" vals)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-enter-result 1 "edit" vals (- num))))))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2004-11-30 17:29:04 +00:00
|
|
|
(provide 'calc-yank)
|
|
|
|
|
2008-04-08 22:07:55 +00:00
|
|
|
;; Local variables:
|
|
|
|
;; generated-autoload-file: "calc-loaddefs.el"
|
|
|
|
;; End:
|
|
|
|
|
2001-11-14 09:09:09 +00:00
|
|
|
;;; calc-yank.el ends here
|