/[emacs]/emacs/lisp/simple.el
ViewVC logotype

Diff of /emacs/lisp/simple.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.622 by monnier, Mon Oct 27 15:20:46 2003 UTC revision 1.623 by eliz, Sat Nov 1 17:01:36 2003 UTC
# Line 1657  specifies the value of ERROR-BUFFER." Line 1657  specifies the value of ERROR-BUFFER."
1657  `universal-argument-other-key' uses this to discard those events  `universal-argument-other-key' uses this to discard those events
1658  from (this-command-keys), and reread only the final command.")  from (this-command-keys), and reread only the final command.")
1659    
1660    (defvar overriding-map-is-bound nil
1661      "Non-nil when `overriding-terminal-local-map' is `universal-argument-map'.")
1662    
1663    (defvar saved-overriding-map nil
1664      "The saved value of `overriding-terminal-local-map'.
1665    That variable gets restored to this value on exiting \"universal
1666    argument mode\".")
1667    
1668    (defun ensure-overriding-map-is-bound ()
1669      "Check `overriding-terminal-local-map' is `universal-argument-map'."
1670      (unless overriding-map-is-bound
1671        (setq saved-overriding-map overriding-terminal-local-map)
1672        (setq overriding-terminal-local-map universal-argument-map)
1673        (setq overriding-map-is-bound t)))
1674    
1675    (defun restore-overriding-map ()
1676      "Restore `overriding-terminal-local-map' to its saved value."
1677      (setq overriding-terminal-local-map saved-overriding-map)
1678      (setq overriding-map-is-bound nil))
1679    
1680  (defun universal-argument ()  (defun universal-argument ()
1681    "Begin a numeric argument for the following command.    "Begin a numeric argument for the following command.
1682  Digits or minus sign following \\[universal-argument] make up the numeric argument.  Digits or minus sign following \\[universal-argument] make up the numeric argument.
# Line 1670  These commands include \\[set-mark-comma Line 1690  These commands include \\[set-mark-comma
1690    (interactive)    (interactive)
1691    (setq prefix-arg (list 4))    (setq prefix-arg (list 4))
1692    (setq universal-argument-num-events (length (this-command-keys)))    (setq universal-argument-num-events (length (this-command-keys)))
1693    (setq overriding-terminal-local-map universal-argument-map))    (ensure-overriding-map-is-bound))
1694    
1695  ;; A subsequent C-u means to multiply the factor by 4 if we've typed  ;; A subsequent C-u means to multiply the factor by 4 if we've typed
1696  ;; nothing but C-u's; otherwise it means to terminate the prefix arg.  ;; nothing but C-u's; otherwise it means to terminate the prefix arg.
# Line 1681  These commands include \\[set-mark-comma Line 1701  These commands include \\[set-mark-comma
1701      (if (eq arg '-)      (if (eq arg '-)
1702          (setq prefix-arg (list -4))          (setq prefix-arg (list -4))
1703        (setq prefix-arg arg)        (setq prefix-arg arg)
1704        (setq overriding-terminal-local-map nil)))        (restore-overriding-map)))
1705    (setq universal-argument-num-events (length (this-command-keys))))    (setq universal-argument-num-events (length (this-command-keys))))
1706    
1707  (defun negative-argument (arg)  (defun negative-argument (arg)
# Line 1695  These commands include \\[set-mark-comma Line 1715  These commands include \\[set-mark-comma
1715          (t          (t
1716           (setq prefix-arg '-)))           (setq prefix-arg '-)))
1717    (setq universal-argument-num-events (length (this-command-keys)))    (setq universal-argument-num-events (length (this-command-keys)))
1718    (setq overriding-terminal-local-map universal-argument-map))    (ensure-overriding-map-is-bound))
1719    
1720  (defun digit-argument (arg)  (defun digit-argument (arg)
1721    "Part of the numeric argument for the next command.    "Part of the numeric argument for the next command.
# Line 1714  These commands include \\[set-mark-comma Line 1734  These commands include \\[set-mark-comma
1734            (t            (t
1735             (setq prefix-arg digit))))             (setq prefix-arg digit))))
1736    (setq universal-argument-num-events (length (this-command-keys)))    (setq universal-argument-num-events (length (this-command-keys)))
1737    (setq overriding-terminal-local-map universal-argument-map))    (ensure-overriding-map-is-bound))
1738    
1739  ;; For backward compatibility, minus with no modifiers is an ordinary  ;; For backward compatibility, minus with no modifiers is an ordinary
1740  ;; command if digits have already been entered.  ;; command if digits have already been entered.
# Line 1735  These commands include \\[set-mark-comma Line 1755  These commands include \\[set-mark-comma
1755            (append (nthcdr universal-argument-num-events keylist)            (append (nthcdr universal-argument-num-events keylist)
1756                    unread-command-events)))                    unread-command-events)))
1757    (reset-this-command-lengths)    (reset-this-command-lengths)
1758    (setq overriding-terminal-local-map nil))    (restore-overriding-map))
1759    
1760  ;;;; Window system cut and paste hooks.  ;;;; Window system cut and paste hooks.
1761    
# Line 3348  Just \\[universal-argument] as argument Line 3368  Just \\[universal-argument] as argument
3368        (setq arg (current-column)))        (setq arg (current-column)))
3369    (if (not (integerp arg))    (if (not (integerp arg))
3370        ;; Disallow missing argument; it's probably a typo for C-x C-f.        ;; Disallow missing argument; it's probably a typo for C-x C-f.
3371        (error "set-fill-column requires an explicit argument")        (error "Set-fill-column requires an explicit argument")
3372      (message "Fill column set to %d (was %d)" arg fill-column)      (message "Fill column set to %d (was %d)" arg fill-column)
3373      (setq fill-column arg)))      (setq fill-column arg)))
3374    

Legend:
Removed from v.1.622  
changed lines
  Added in v.1.623

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26