[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/simple.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/simple.el [lexbind] |
Date: |
Thu, 20 Nov 2003 19:36:41 -0500 |
Index: emacs/lisp/simple.el
diff -c emacs/lisp/simple.el:1.551.2.2 emacs/lisp/simple.el:1.551.2.3
*** emacs/lisp/simple.el:1.551.2.2 Tue Oct 14 19:51:23 2003
--- emacs/lisp/simple.el Thu Nov 20 19:36:06 2003
***************
*** 303,316 ****
In some text modes, where TAB inserts a tab, this indents to the
column specified by the function `current-left-margin'."
(interactive "*")
- (delete-horizontal-space t)
(let ((pos (point)))
;; Be careful to insert the newline before indenting the line.
;; Otherwise, the indentation might be wrong.
(newline)
(save-excursion
(goto-char pos)
! (indent-according-to-mode))
(indent-according-to-mode)))
(defun quoted-insert (arg)
--- 303,316 ----
In some text modes, where TAB inserts a tab, this indents to the
column specified by the function `current-left-margin'."
(interactive "*")
(let ((pos (point)))
;; Be careful to insert the newline before indenting the line.
;; Otherwise, the indentation might be wrong.
(newline)
(save-excursion
(goto-char pos)
! (indent-according-to-mode)
! (delete-horizontal-space t))
(indent-according-to-mode)))
(defun quoted-insert (arg)
***************
*** 1657,1662 ****
--- 1657,1682 ----
`universal-argument-other-key' uses this to discard those events
from (this-command-keys), and reread only the final command.")
+ (defvar overriding-map-is-bound nil
+ "Non-nil when `overriding-terminal-local-map' is `universal-argument-map'.")
+
+ (defvar saved-overriding-map nil
+ "The saved value of `overriding-terminal-local-map'.
+ That variable gets restored to this value on exiting \"universal
+ argument mode\".")
+
+ (defun ensure-overriding-map-is-bound ()
+ "Check `overriding-terminal-local-map' is `universal-argument-map'."
+ (unless overriding-map-is-bound
+ (setq saved-overriding-map overriding-terminal-local-map)
+ (setq overriding-terminal-local-map universal-argument-map)
+ (setq overriding-map-is-bound t)))
+
+ (defun restore-overriding-map ()
+ "Restore `overriding-terminal-local-map' to its saved value."
+ (setq overriding-terminal-local-map saved-overriding-map)
+ (setq overriding-map-is-bound nil))
+
(defun universal-argument ()
"Begin a numeric argument for the following command.
Digits or minus sign following \\[universal-argument] make up the numeric
argument.
***************
*** 1670,1676 ****
(interactive)
(setq prefix-arg (list 4))
(setq universal-argument-num-events (length (this-command-keys)))
! (setq overriding-terminal-local-map universal-argument-map))
;; A subsequent C-u means to multiply the factor by 4 if we've typed
;; nothing but C-u's; otherwise it means to terminate the prefix arg.
--- 1690,1696 ----
(interactive)
(setq prefix-arg (list 4))
(setq universal-argument-num-events (length (this-command-keys)))
! (ensure-overriding-map-is-bound))
;; A subsequent C-u means to multiply the factor by 4 if we've typed
;; nothing but C-u's; otherwise it means to terminate the prefix arg.
***************
*** 1681,1687 ****
(if (eq arg '-)
(setq prefix-arg (list -4))
(setq prefix-arg arg)
! (setq overriding-terminal-local-map nil)))
(setq universal-argument-num-events (length (this-command-keys))))
(defun negative-argument (arg)
--- 1701,1707 ----
(if (eq arg '-)
(setq prefix-arg (list -4))
(setq prefix-arg arg)
! (restore-overriding-map)))
(setq universal-argument-num-events (length (this-command-keys))))
(defun negative-argument (arg)
***************
*** 1695,1701 ****
(t
(setq prefix-arg '-)))
(setq universal-argument-num-events (length (this-command-keys)))
! (setq overriding-terminal-local-map universal-argument-map))
(defun digit-argument (arg)
"Part of the numeric argument for the next command.
--- 1715,1721 ----
(t
(setq prefix-arg '-)))
(setq universal-argument-num-events (length (this-command-keys)))
! (ensure-overriding-map-is-bound))
(defun digit-argument (arg)
"Part of the numeric argument for the next command.
***************
*** 1714,1720 ****
(t
(setq prefix-arg digit))))
(setq universal-argument-num-events (length (this-command-keys)))
! (setq overriding-terminal-local-map universal-argument-map))
;; For backward compatibility, minus with no modifiers is an ordinary
;; command if digits have already been entered.
--- 1734,1740 ----
(t
(setq prefix-arg digit))))
(setq universal-argument-num-events (length (this-command-keys)))
! (ensure-overriding-map-is-bound))
;; For backward compatibility, minus with no modifiers is an ordinary
;; command if digits have already been entered.
***************
*** 1735,1741 ****
(append (nthcdr universal-argument-num-events keylist)
unread-command-events)))
(reset-this-command-lengths)
! (setq overriding-terminal-local-map nil))
;;;; Window system cut and paste hooks.
--- 1755,1761 ----
(append (nthcdr universal-argument-num-events keylist)
unread-command-events)))
(reset-this-command-lengths)
! (restore-overriding-map))
;;;; Window system cut and paste hooks.
***************
*** 3348,3354 ****
(setq arg (current-column)))
(if (not (integerp arg))
;; Disallow missing argument; it's probably a typo for C-x C-f.
! (error "set-fill-column requires an explicit argument")
(message "Fill column set to %d (was %d)" arg fill-column)
(setq fill-column arg)))
--- 3368,3374 ----
(setq arg (current-column)))
(if (not (integerp arg))
;; Disallow missing argument; it's probably a typo for C-x C-f.
! (error "Set-fill-column requires an explicit argument")
(message "Fill column set to %d (was %d)" arg fill-column)
(setq fill-column arg)))
***************
*** 3810,3834 ****
(read-variable (format "Set variable (default %s): "
default-var)
default-var)
(read-variable "Set variable: ")))
! (minibuffer-help-form '(describe-variable var))
! (prop (get var 'variable-interactive))
! (prompt (format "Set %s%s to value: " var
! (cond ((local-variable-p var)
! " (buffer-local)")
! ((or current-prefix-arg
! (local-variable-if-set-p var))
! " buffer-locally")
! (t " globally"))))
! (val (if prop
! ;; Use VAR's `variable-interactive' property
! ;; as an interactive spec for prompting.
! (call-interactively `(lambda (arg)
! (interactive ,prop)
! arg))
! (read
! (read-string prompt nil
! 'set-variable-value-history)))))
! (list var val current-prefix-arg)))
(and (custom-variable-p var)
(not (get var 'custom-type))
--- 3830,3854 ----
(read-variable (format "Set variable (default %s): "
default-var)
default-var)
(read-variable "Set variable: ")))
! (minibuffer-help-form '(describe-variable var))
! (prop (get var 'variable-interactive))
! (prompt (format "Set %s%s to value: " var
! (cond ((local-variable-p var)
! " (buffer-local)")
! ((or current-prefix-arg
! (local-variable-if-set-p var))
! " buffer-locally")
! (t " globally"))))
! (val (if prop
! ;; Use VAR's `variable-interactive' property
! ;; as an interactive spec for prompting.
! (call-interactively `(lambda (arg)
! (interactive ,prop)
! arg))
! (read
! (read-string prompt nil
! 'set-variable-value-history)))))
! (list var val current-prefix-arg)))
(and (custom-variable-p var)
(not (get var 'custom-type))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/simple.el [lexbind],
Miles Bader <=