diff options
| author | Paul Eggert | 2011-02-09 23:04:56 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-02-09 23:04:56 -0800 |
| commit | be6d99804b3efdecf3660c4b51da1945e955fb4d (patch) | |
| tree | 99b523c445f7b95572ab668f4e878cd703ff3527 /lisp | |
| parent | dd4638842ad1921562bc66049ec81a4530651cdf (diff) | |
| parent | 67f02b82f496be403353a1dc918cc4f2278841bb (diff) | |
| download | emacs-be6d99804b3efdecf3660c4b51da1945e955fb4d.tar.gz emacs-be6d99804b3efdecf3660c4b51da1945e955fb4d.zip | |
Merge from mainline.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 43 | ||||
| -rw-r--r-- | lisp/allout.el | 202 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 4 | ||||
| -rw-r--r-- | lisp/emulation/pc-select.el | 985 | ||||
| -rw-r--r-- | lisp/erc/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/erc/erc-track.el | 15 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 1 | ||||
| -rw-r--r-- | lisp/gnus/nnimap.el | 12 | ||||
| -rw-r--r-- | lisp/gnus/nntp.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/shr.el | 3 | ||||
| -rw-r--r-- | lisp/ibuffer.el | 2 | ||||
| -rw-r--r-- | lisp/net/rcirc.el | 19 | ||||
| -rw-r--r-- | lisp/obsolete/pc-mode.el (renamed from lisp/emulation/pc-mode.el) | 1 | ||||
| -rw-r--r-- | lisp/obsolete/pc-select.el | 417 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 48 |
16 files changed, 628 insertions, 1156 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8826f884560..1a69d98f17e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2011-02-10 Ken Manheimer <ken.manheimer@gmail.com> | ||
| 2 | |||
| 3 | * allout.el: Synopsis: Change allout user configuration so | ||
| 4 | auto-activation is controlled solely by customization | ||
| 5 | `allout-auto-activation'. | ||
| 6 | |||
| 7 | (allout-auto-activation-helper) (allout-setup): New autoloads | ||
| 8 | implement new custom set procedure for allout-auto-activation. | ||
| 9 | Also, explicitly invoke | ||
| 10 | (allout-setup) after allout-auto-activation is custom-defined, to | ||
| 11 | effect the settings in emacs sessions besides the few where | ||
| 12 | allout-auto-activation customization is donea. | ||
| 13 | (allout-auto-activation): Use allout-auto-activation-helper to | ||
| 14 | :set. Revise the docstring. | ||
| 15 | (allout-init): Reduce functionality to just customizing | ||
| 16 | allout-auto-activation, and mark obsolete. | ||
| 17 | (allout-mode): Respect string values for allout-auto-activation. | ||
| 18 | Run allout-after-copy-or-kill-hook without any args. | ||
| 19 | (allout-mode) (allout-layout) (allout-default-layout) | ||
| 20 | (outlineify-sticky): Adjust docstring for new scheme. | ||
| 21 | (allout-after-copy-or-kill-hook): No arguments - hook implementers | ||
| 22 | should concentrate on the kill ring. | ||
| 23 | |||
| 24 | 2011-02-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 25 | |||
| 26 | * progmodes/sh-script.el (sh-font-lock-open-heredoc): Fix case | ||
| 27 | of here-doc that immediately follows a comment. | ||
| 28 | |||
| 29 | 2011-02-09 Deniz Dogan <deniz.a.m.dogan@gmail.com> | ||
| 30 | |||
| 31 | * net/rcirc.el (rcirc-ctcp-sender-PING): Simplifying. | ||
| 32 | |||
| 33 | * net/rcirc.el (rcirc-cmd-ctcp): Use dedicated function when | ||
| 34 | available. | ||
| 35 | (rcirc-ctcp-sender-PING): New function. | ||
| 36 | |||
| 37 | 2011-02-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 38 | |||
| 39 | * obsolete/pc-select.el: Rename from emulation/pc-select.el (bug#7940). | ||
| 40 | Remove the mark/nomark handling, and activate shift-select-mode instead. | ||
| 41 | |||
| 42 | * obsolete/pc-mode.el: Rename from emulation/pc-mode.el. | ||
| 43 | |||
| 1 | 2011-02-07 Jay Belanger <jay.p.belanger@gmail.com> | 44 | 2011-02-07 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 45 | ||
| 3 | * calc/calc-units.el (math-logunits-quant): Add support for | 46 | * calc/calc-units.el (math-logunits-quant): Add support for |
diff --git a/lisp/allout.el b/lisp/allout.el index 49c2dba322a..5d87415a57f 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -62,18 +62,15 @@ | |||
| 62 | ;; The latest development version and helpful notes are available at | 62 | ;; The latest development version and helpful notes are available at |
| 63 | ;; http://myriadicity.net/Sundry/EmacsAllout . | 63 | ;; http://myriadicity.net/Sundry/EmacsAllout . |
| 64 | ;; | 64 | ;; |
| 65 | ;; The outline menubar additions provide quick reference to many of | 65 | ;; The outline menubar additions provide quick reference to many of the |
| 66 | ;; the features, and see the docstring of the variable `allout-init' | 66 | ;; features. See the docstring of the variables `allout-layout' and |
| 67 | ;; for instructions on priming your Emacs session for automatic | ||
| 68 | ;; activation of allout-mode. | ||
| 69 | ;; | ||
| 70 | ;; See the docstring of the variables `allout-layout' and | ||
| 71 | ;; `allout-auto-activation' for details on automatic activation of | 67 | ;; `allout-auto-activation' for details on automatic activation of |
| 72 | ;; `allout-mode' as a minor mode. (It has changed since allout | 68 | ;; `allout-mode' as a minor mode. (`allout-init' is deprecated in favor of |
| 73 | ;; 3.x, for those of you that depend on the old method.) | 69 | ;; a purely customization-based method.) |
| 74 | ;; | 70 | ;; |
| 75 | ;; Note -- the lines beginning with `;;;_' are outline topic headers. | 71 | ;; Note -- the lines beginning with `;;;_' are outline topic headers. |
| 76 | ;; Just `ESC-x eval-buffer' to give it a whirl. | 72 | ;; Customize `allout-auto-activation' to enable, then revisit this |
| 73 | ;; buffer to give it a whirl. | ||
| 77 | 74 | ||
| 78 | ;; ken manheimer (ken dot manheimer at gmail dot com) | 75 | ;; ken manheimer (ken dot manheimer at gmail dot com) |
| 79 | 76 | ||
| @@ -271,35 +268,56 @@ See the existing keys for examples." | |||
| 271 | :set 'allout-compose-and-institute-keymap | 268 | :set 'allout-compose-and-institute-keymap |
| 272 | ) | 269 | ) |
| 273 | 270 | ||
| 271 | ;;;_ > allout-auto-activation-helper (var value) | ||
| 272 | ;;;###autoload | ||
| 273 | (defun allout-auto-activation-helper (var value) | ||
| 274 | "Institute `allout-auto-activation'. | ||
| 275 | |||
| 276 | Intended to be used as the `allout-auto-activation' :set function." | ||
| 277 | (set-default var value) | ||
| 278 | (allout-setup)) | ||
| 279 | ;;;_ > allout-setup () | ||
| 280 | ;;;###autoload | ||
| 281 | (defun allout-setup () | ||
| 282 | "Do fundamental emacs session for allout auto-activation. | ||
| 283 | |||
| 284 | Establishes allout processing as part of visiting a file if | ||
| 285 | `allout-auto-activation' is non-nil, or removes it otherwise. | ||
| 286 | |||
| 287 | The proper way to use this is through customizing the setting of | ||
| 288 | `allout-auto-activation'." | ||
| 289 | (if (not allout-auto-activation) | ||
| 290 | (remove-hook 'find-file-hook 'allout-find-file-hook) | ||
| 291 | (add-hook 'find-file-hook 'allout-find-file-hook))) | ||
| 274 | ;;;_ = allout-auto-activation | 292 | ;;;_ = allout-auto-activation |
| 293 | ;;;###autoload | ||
| 275 | (defcustom allout-auto-activation nil | 294 | (defcustom allout-auto-activation nil |
| 276 | "Regulates auto-activation modality of allout outlines -- see `allout-init'. | 295 | "Configure allout outline mode auto-activation. |
| 277 | 296 | ||
| 278 | Setq-default by `allout-init' to regulate whether or not allout | 297 | Control whether and how allout outline mode is automatically |
| 279 | outline mode is automatically activated when the buffer-specific | 298 | activated when files are visited with non-nil buffer-specific |
| 280 | variable `allout-layout' is non-nil, and whether or not the layout | 299 | file variable `allout-layout'. |
| 281 | dictated by `allout-layout' should be imposed on mode activation. | ||
| 282 | 300 | ||
| 283 | With value t, auto-mode-activation and auto-layout are enabled. | 301 | When allout-auto-activation is \"On\" \(t), allout mode is |
| 284 | \(This also depends on `allout-find-file-hook' being installed in | 302 | activated in buffers with non-nil `allout-layout', and the |
| 285 | `find-file-hook', which is also done by `allout-init'.) | 303 | specified layout is applied. |
| 286 | 304 | ||
| 287 | With value `ask', auto-mode-activation is enabled, and endorsement for | 305 | With value \"ask\", auto-mode-activation is enabled, and endorsement for |
| 288 | performing auto-layout is asked of the user each time. | 306 | performing auto-layout is asked of the user each time. |
| 289 | 307 | ||
| 290 | With value `activate', only auto-mode-activation is enabled, | 308 | With value \"activate\", only auto-mode-activation is enabled. |
| 291 | auto-layout is not. | 309 | Auto-layout is not. |
| 292 | 310 | ||
| 293 | With value nil, neither auto-mode-activation nor auto-layout are | 311 | With value nil, neither auto-mode-activation nor auto-layout are |
| 294 | enabled. | 312 | enabled, and allout auto-activation processing is removed from |
| 295 | 313 | file visiting activities." | |
| 296 | See the docstring for `allout-init' for the proper interface to | 314 | :set 'allout-auto-activation-helper |
| 297 | this variable." | ||
| 298 | :type '(choice (const :tag "On" t) | 315 | :type '(choice (const :tag "On" t) |
| 299 | (const :tag "Ask about layout" "ask") | 316 | (const :tag "Ask about layout" "ask") |
| 300 | (const :tag "Mode only" "activate") | 317 | (const :tag "Mode only" "activate") |
| 301 | (const :tag "Off" nil)) | 318 | (const :tag "Off" nil)) |
| 302 | :group 'allout) | 319 | :group 'allout) |
| 320 | (allout-setup) | ||
| 303 | ;;;_ = allout-default-layout | 321 | ;;;_ = allout-default-layout |
| 304 | (defcustom allout-default-layout '(-2 : 0) | 322 | (defcustom allout-default-layout '(-2 : 0) |
| 305 | "Default allout outline layout specification. | 323 | "Default allout outline layout specification. |
| @@ -311,7 +329,7 @@ layout specifications. | |||
| 311 | A list value specifies a default layout for the current buffer, | 329 | A list value specifies a default layout for the current buffer, |
| 312 | to be applied upon activation of `allout-mode'. Any non-nil | 330 | to be applied upon activation of `allout-mode'. Any non-nil |
| 313 | value will automatically trigger `allout-mode', provided | 331 | value will automatically trigger `allout-mode', provided |
| 314 | `allout-init' has been called to enable this behavior. | 332 | `allout-auto-activation' has been customized to enable it. |
| 315 | 333 | ||
| 316 | The types of elements in the layout specification are: | 334 | The types of elements in the layout specification are: |
| 317 | 335 | ||
| @@ -890,10 +908,10 @@ For details, see `allout-toggle-current-subtree-encryption's docstring." | |||
| 890 | (defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring. | 908 | (defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring. |
| 891 | "Buffer-specific setting for allout layout. | 909 | "Buffer-specific setting for allout layout. |
| 892 | 910 | ||
| 893 | In buffers where this is non-nil (and if `allout-init' has been run, to | 911 | In buffers where this is non-nil \(and if `allout-auto-activation' |
| 894 | enable this behavior), `allout-mode' will be automatically activated. The | 912 | has been customized to enable this behavior), `allout-mode' will be |
| 895 | layout dictated by the value will be used to set the initial exposure when | 913 | automatically activated. The layout dictated by the value will be used to |
| 896 | `allout-mode' is activated. | 914 | set the initial exposure when `allout-mode' is activated. |
| 897 | 915 | ||
| 898 | \*You should not setq-default this variable non-nil unless you want every | 916 | \*You should not setq-default this variable non-nil unless you want every |
| 899 | visited file to be treated as an allout file.* | 917 | visited file to be treated as an allout file.* |
| @@ -906,9 +924,9 @@ example, the following lines at the bottom of an Emacs Lisp file: | |||
| 906 | ;;;End: | 924 | ;;;End: |
| 907 | 925 | ||
| 908 | dictate activation of `allout-mode' mode when the file is visited | 926 | dictate activation of `allout-mode' mode when the file is visited |
| 909 | \(presuming allout-init was already run), followed by the | 927 | \(presuming proper `allout-auto-activation' customization), |
| 910 | equivalent of `(allout-expose-topic 0 : -1 -1 0)'. (This is | 928 | followed by the equivalent of `(allout-expose-topic 0 : -1 -1 0)'. |
| 911 | the layout used for the allout.el source file.) | 929 | \(This is the layout used for the allout.el source file.) |
| 912 | 930 | ||
| 913 | `allout-default-layout' describes the specification format. | 931 | `allout-default-layout' describes the specification format. |
| 914 | `allout-layout' can additionally have the value `t', in which | 932 | `allout-layout' can additionally have the value `t', in which |
| @@ -1441,9 +1459,7 @@ This hook might be invoked multiple times by a single command.") | |||
| 1441 | (defvar allout-after-copy-or-kill-hook nil | 1459 | (defvar allout-after-copy-or-kill-hook nil |
| 1442 | "*Hook that's run after copying outline text. | 1460 | "*Hook that's run after copying outline text. |
| 1443 | 1461 | ||
| 1444 | Functions on the hook should take two arguments: | 1462 | Functions on the hook should not take any arguments.") |
| 1445 | |||
| 1446 | START, END -- integers indicating the span containing the copied text.") | ||
| 1447 | ;;;_ = allout-outside-normal-auto-fill-function | 1463 | ;;;_ = allout-outside-normal-auto-fill-function |
| 1448 | (defvar allout-outside-normal-auto-fill-function nil | 1464 | (defvar allout-outside-normal-auto-fill-function nil |
| 1449 | "Value of normal-auto-fill-function outside of allout mode. | 1465 | "Value of normal-auto-fill-function outside of allout mode. |
| @@ -1621,84 +1637,19 @@ non-nil in a lasting way.") | |||
| 1621 | "If t, `allout-mode's last deactivation was deliberate. | 1637 | "If t, `allout-mode's last deactivation was deliberate. |
| 1622 | So `allout-post-command-business' should not reactivate it...") | 1638 | So `allout-post-command-business' should not reactivate it...") |
| 1623 | (make-variable-buffer-local 'allout-explicitly-deactivated) | 1639 | (make-variable-buffer-local 'allout-explicitly-deactivated) |
| 1624 | ;;;_ > allout-init (&optional mode) | 1640 | ;;;_ > allout-init (mode) |
| 1625 | (defun allout-init (&optional mode) | 1641 | (defun allout-init (mode) |
| 1626 | "Prime `allout-mode' to enable/disable auto-activation, wrt `allout-layout'. | 1642 | "DEPRECATED - configure allout activation by customizing |
| 1627 | 1643 | `allout-auto-activation'. This function remains around, limited | |
| 1628 | MODE is one of the following symbols: | 1644 | from what it did before, for backwards compatability. |
| 1629 | 1645 | ||
| 1630 | - nil (or no argument) deactivate auto-activation/layout; | 1646 | MODE is the activation mode - see `allout-auto-activation' for |
| 1631 | - `activate', enable auto-activation only; | 1647 | valid values." |
| 1632 | - `ask', enable auto-activation, and enable auto-layout but with | 1648 | |
| 1633 | confirmation for layout operation solicited from user each time; | 1649 | (custom-set-variables (list 'allout-auto-activation (format "%s" mode))) |
| 1634 | - `report', just report and return the current auto-activation state; | 1650 | (format "%s" mode)) |
| 1635 | - anything else (eg, t) for auto-activation and auto-layout, without | 1651 | (make-obsolete 'allout-init |
| 1636 | any confirmation check. | 1652 | "customize 'allout-auto-activation' instead." "23.3") |
| 1637 | |||
| 1638 | Use this function to setup your Emacs session for automatic activation | ||
| 1639 | of allout outline mode, contingent to the buffer-specific setting of | ||
| 1640 | the `allout-layout' variable. (See `allout-layout' and | ||
| 1641 | `allout-expose-topic' docstrings for more details on auto layout). | ||
| 1642 | |||
| 1643 | `allout-init' works by setting up (or removing) the `allout-mode' | ||
| 1644 | find-file-hook, and giving `allout-auto-activation' a suitable | ||
| 1645 | setting. | ||
| 1646 | |||
| 1647 | To prime your Emacs session for full auto-outline operation, include | ||
| 1648 | the following two lines in your Emacs init file: | ||
| 1649 | |||
| 1650 | \(require 'allout) | ||
| 1651 | \(allout-init t)" | ||
| 1652 | |||
| 1653 | (interactive) | ||
| 1654 | (if (allout-called-interactively-p) | ||
| 1655 | (progn | ||
| 1656 | (setq mode | ||
| 1657 | (completing-read | ||
| 1658 | (concat "Select outline auto setup mode " | ||
| 1659 | "(empty for report, ? for options) ") | ||
| 1660 | '(("nil")("full")("activate")("deactivate") | ||
| 1661 | ("ask") ("report") ("")) | ||
| 1662 | nil | ||
| 1663 | t)) | ||
| 1664 | (if (string= mode "") | ||
| 1665 | (setq mode 'report) | ||
| 1666 | (setq mode (intern-soft mode))))) | ||
| 1667 | (let | ||
| 1668 | ;; convenience aliases, for consistent ref to respective vars: | ||
| 1669 | ((hook 'allout-find-file-hook) | ||
| 1670 | (find-file-hook-var-name (if (boundp 'find-file-hook) | ||
| 1671 | 'find-file-hook | ||
| 1672 | 'find-file-hooks)) | ||
| 1673 | (curr-mode 'allout-auto-activation)) | ||
| 1674 | |||
| 1675 | (cond ((not mode) | ||
| 1676 | (set find-file-hook-var-name | ||
| 1677 | (delq hook (symbol-value find-file-hook-var-name))) | ||
| 1678 | (if (allout-called-interactively-p) | ||
| 1679 | (message "Allout outline mode auto-activation inhibited."))) | ||
| 1680 | ((eq mode 'report) | ||
| 1681 | (if (not (memq hook (symbol-value find-file-hook-var-name))) | ||
| 1682 | (allout-init nil) | ||
| 1683 | ;; Just punt and use the reports from each of the modes: | ||
| 1684 | (allout-init (symbol-value curr-mode)))) | ||
| 1685 | (t (add-hook find-file-hook-var-name hook) | ||
| 1686 | (set curr-mode ; `set', not `setq'! | ||
| 1687 | (cond ((eq mode 'activate) | ||
| 1688 | (message | ||
| 1689 | "Outline mode auto-activation enabled.") | ||
| 1690 | 'activate) | ||
| 1691 | ((eq mode 'report) | ||
| 1692 | ;; Return the current mode setting: | ||
| 1693 | (allout-init mode)) | ||
| 1694 | ((eq mode 'ask) | ||
| 1695 | (message | ||
| 1696 | (concat "Outline mode auto-activation and " | ||
| 1697 | "-layout (upon confirmation) enabled.")) | ||
| 1698 | 'ask) | ||
| 1699 | ((message | ||
| 1700 | "Outline mode auto-activation and -layout enabled.") | ||
| 1701 | 'full))))))) | ||
| 1702 | ;;;_ > allout-setup-menubar () | 1653 | ;;;_ > allout-setup-menubar () |
| 1703 | (defun allout-setup-menubar () | 1654 | (defun allout-setup-menubar () |
| 1704 | "Populate the current buffer's menubar with `allout-mode' stuff." | 1655 | "Populate the current buffer's menubar with `allout-mode' stuff." |
| @@ -1764,9 +1715,8 @@ and many other features. | |||
| 1764 | Below is a description of the key bindings, and then description | 1715 | Below is a description of the key bindings, and then description |
| 1765 | of special `allout-mode' features and terminology. See also the | 1716 | of special `allout-mode' features and terminology. See also the |
| 1766 | outline menubar additions for quick reference to many of the | 1717 | outline menubar additions for quick reference to many of the |
| 1767 | features, and see the docstring of the function `allout-init' for | 1718 | features. Customize `allout-auto-activation' to prepare your |
| 1768 | instructions on priming your emacs session for automatic | 1719 | emacs session for automatic activation of `allout-mode'. |
| 1769 | activation of `allout-mode'. | ||
| 1770 | 1720 | ||
| 1771 | The bindings are those listed in `allout-prefixed-keybindings' | 1721 | The bindings are those listed in `allout-prefixed-keybindings' |
| 1772 | and `allout-unprefixed-keybindings'. We recommend customizing | 1722 | and `allout-unprefixed-keybindings'. We recommend customizing |
| @@ -1850,7 +1800,8 @@ M-x outlineify-sticky Activate outline mode for current buffer, | |||
| 1850 | Like above 'copy-exposed', but convert topic | 1800 | Like above 'copy-exposed', but convert topic |
| 1851 | prefixes to section.subsection... numeric | 1801 | prefixes to section.subsection... numeric |
| 1852 | format. | 1802 | format. |
| 1853 | \\[eval-expression] (allout-init t) Setup Emacs session for outline mode | 1803 | \\[customize-variable] allout-auto-activation |
| 1804 | Prepare Emacs session for allout outline mode | ||
| 1854 | auto-activation. | 1805 | auto-activation. |
| 1855 | 1806 | ||
| 1856 | Topic Encryption | 1807 | Topic Encryption |
| @@ -2092,8 +2043,8 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be." | |||
| 2092 | (when (and allout-layout | 2043 | (when (and allout-layout |
| 2093 | allout-auto-activation | 2044 | allout-auto-activation |
| 2094 | use-layout | 2045 | use-layout |
| 2095 | (and (not (eq allout-auto-activation 'activate)) | 2046 | (and (not (string= allout-auto-activation "activate")) |
| 2096 | (if (eq allout-auto-activation 'ask) | 2047 | (if (string= allout-auto-activation "ask") |
| 2097 | (if (y-or-n-p (format "Expose %s with layout '%s'? " | 2048 | (if (y-or-n-p (format "Expose %s with layout '%s'? " |
| 2098 | (buffer-name) | 2049 | (buffer-name) |
| 2099 | use-layout)) | 2050 | use-layout)) |
| @@ -3448,7 +3399,7 @@ Returns the qualifying command, if any, else nil." | |||
| 3448 | (defun allout-find-file-hook () | 3399 | (defun allout-find-file-hook () |
| 3449 | "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'. | 3400 | "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'. |
| 3450 | 3401 | ||
| 3451 | See `allout-init' for setup instructions." | 3402 | See `allout-auto-activation' for setup instructions." |
| 3452 | (if (and allout-auto-activation | 3403 | (if (and allout-auto-activation |
| 3453 | (not (allout-mode-p)) | 3404 | (not (allout-mode-p)) |
| 3454 | allout-layout) | 3405 | allout-layout) |
| @@ -4394,7 +4345,7 @@ subtopics into siblings of the item." | |||
| 4394 | (if (and (not beg-hidden) (not end-hidden)) | 4345 | (if (and (not beg-hidden) (not end-hidden)) |
| 4395 | (allout-unprotected (kill-line arg)) | 4346 | (allout-unprotected (kill-line arg)) |
| 4396 | (kill-line arg)) | 4347 | (kill-line arg)) |
| 4397 | (run-hook-with-args 'allout-after-copy-or-kill-hook beg end) | 4348 | (run-hooks 'allout-after-copy-or-kill-hook) |
| 4398 | (allout-deannotate-hidden beg end) | 4349 | (allout-deannotate-hidden beg end) |
| 4399 | 4350 | ||
| 4400 | (if allout-numbered-bullet | 4351 | (if allout-numbered-bullet |
| @@ -4446,7 +4397,7 @@ Topic exposure is marked with text-properties, to be used by | |||
| 4446 | (unwind-protect ; for possible barf-if-buffer-read-only. | 4397 | (unwind-protect ; for possible barf-if-buffer-read-only. |
| 4447 | (allout-unprotected (kill-region beg end)) | 4398 | (allout-unprotected (kill-region beg end)) |
| 4448 | (allout-deannotate-hidden beg end) | 4399 | (allout-deannotate-hidden beg end) |
| 4449 | (run-hook-with-args 'allout-after-copy-or-kill-hook beg end) | 4400 | (run-hooks 'allout-after-copy-or-kill-hook) |
| 4450 | 4401 | ||
| 4451 | (save-excursion | 4402 | (save-excursion |
| 4452 | (allout-renumber-to-depth depth)) | 4403 | (allout-renumber-to-depth depth)) |
| @@ -4503,7 +4454,8 @@ Topic exposure is marked with text-properties, to be used by | |||
| 4503 | (allout-unprotected | 4454 | (allout-unprotected |
| 4504 | (let ((inhibit-read-only t) | 4455 | (let ((inhibit-read-only t) |
| 4505 | (buffer-undo-list t)) | 4456 | (buffer-undo-list t)) |
| 4506 | (remove-text-properties begin end '(allout-was-hidden t))))) | 4457 | (remove-text-properties begin (min end (point-max)) |
| 4458 | '(allout-was-hidden t))))) | ||
| 4507 | ;;;_ > allout-hide-by-annotation (begin end) | 4459 | ;;;_ > allout-hide-by-annotation (begin end) |
| 4508 | (defun allout-hide-by-annotation (begin end) | 4460 | (defun allout-hide-by-annotation (begin end) |
| 4509 | "Translate text properties indicating exposure status into actual exposure." | 4461 | "Translate text properties indicating exposure status into actual exposure." |
| @@ -6312,8 +6264,8 @@ save. See `allout-encrypt-unencrypted-on-saves' for more info." | |||
| 6312 | (defun outlineify-sticky (&optional arg) | 6264 | (defun outlineify-sticky (&optional arg) |
| 6313 | "Activate outline mode and establish file var so it is started subsequently. | 6265 | "Activate outline mode and establish file var so it is started subsequently. |
| 6314 | 6266 | ||
| 6315 | See doc-string for `allout-layout' and `allout-init' for details on | 6267 | See `allout-layout' and customization of `allout-auto-activation' |
| 6316 | setup for auto-startup." | 6268 | for details on preparing emacs for automatic allout activation." |
| 6317 | 6269 | ||
| 6318 | (interactive "P") | 6270 | (interactive "P") |
| 6319 | 6271 | ||
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 05bfa0f262e..e10dc10447c 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -282,7 +282,7 @@ Not documented | |||
| 282 | ;;;;;; do-all-symbols do-symbols dotimes dolist do* do loop return-from | 282 | ;;;;;; do-all-symbols do-symbols dotimes dolist do* do loop return-from |
| 283 | ;;;;;; return block etypecase typecase ecase case load-time-value | 283 | ;;;;;; return block etypecase typecase ecase case load-time-value |
| 284 | ;;;;;; eval-when destructuring-bind function* defmacro* defun* gentemp | 284 | ;;;;;; eval-when destructuring-bind function* defmacro* defun* gentemp |
| 285 | ;;;;;; gensym) "cl-macs" "cl-macs.el" "8b2ce9c2ec0e273606bb37c333c4bdde") | 285 | ;;;;;; gensym) "cl-macs" "cl-macs.el" "0904b956872432ae7cc5fa9abcefce63") |
| 286 | ;;; Generated autoloads from cl-macs.el | 286 | ;;; Generated autoloads from cl-macs.el |
| 287 | 287 | ||
| 288 | (autoload 'gensym "cl-macs" "\ | 288 | (autoload 'gensym "cl-macs" "\ |
| @@ -389,7 +389,7 @@ This is equivalent to `(return-from nil RESULT)'. | |||
| 389 | 389 | ||
| 390 | (autoload 'return-from "cl-macs" "\ | 390 | (autoload 'return-from "cl-macs" "\ |
| 391 | Return from the block named NAME. | 391 | Return from the block named NAME. |
| 392 | This jump out to the innermost enclosing `(block NAME ...)' form, | 392 | This jumps out to the innermost enclosing `(block NAME ...)' form, |
| 393 | returning RESULT from that form (or nil if RESULT is omitted). | 393 | returning RESULT from that form (or nil if RESULT is omitted). |
| 394 | This is compatible with Common Lisp, but note that `defun' and | 394 | This is compatible with Common Lisp, but note that `defun' and |
| 395 | `defmacro' do not create implicit blocks as they do in Common Lisp. | 395 | `defmacro' do not create implicit blocks as they do in Common Lisp. |
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el deleted file mode 100644 index 76562dd75ca..00000000000 --- a/lisp/emulation/pc-select.el +++ /dev/null | |||
| @@ -1,985 +0,0 @@ | |||
| 1 | ;;; pc-select.el --- emulate mark, cut, copy and paste from Motif | ||
| 2 | ;;; (or MAC GUI or MS-windoze (bah)) look-and-feel | ||
| 3 | ;;; including key bindings. | ||
| 4 | |||
| 5 | ;; Copyright (C) 1995-1997, 2000-2011 Free Software Foundation, Inc. | ||
| 6 | |||
| 7 | ;; Author: Michael Staats <michael@thp.Uni-Duisburg.DE> | ||
| 8 | ;; Keywords: convenience emulations | ||
| 9 | ;; Created: 26 Sep 1995 | ||
| 10 | |||
| 11 | ;; This file is part of GNU Emacs. | ||
| 12 | |||
| 13 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 14 | ;; it under the terms of the GNU General Public License as published by | ||
| 15 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 16 | ;; (at your option) any later version. | ||
| 17 | |||
| 18 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | ;; GNU General Public License for more details. | ||
| 22 | |||
| 23 | ;; You should have received a copy of the GNU General Public License | ||
| 24 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 25 | |||
| 26 | ;;; Commentary: | ||
| 27 | |||
| 28 | ;; This package emulates the mark, copy, cut and paste look-and-feel of motif | ||
| 29 | ;; programs (which is the same as the MAC gui and (sorry for that) MS-Windows). | ||
| 30 | ;; It modifies the keybindings of the cursor keys and the next, prior, | ||
| 31 | ;; home and end keys. They will modify mark-active. | ||
| 32 | ;; You can still get the old behavior of cursor moving with the | ||
| 33 | ;; control sequences C-f, C-b, etc. | ||
| 34 | ;; This package uses transient-mark-mode and | ||
| 35 | ;; delete-selection-mode. | ||
| 36 | ;; | ||
| 37 | ;; In addition to that all key-bindings from the pc-mode are | ||
| 38 | ;; done here too (as suggested by RMS). | ||
| 39 | ;; | ||
| 40 | ;; As I found out after I finished the first version, s-region.el tries | ||
| 41 | ;; to do the same.... But my code is a little more complete and using | ||
| 42 | ;; delete-selection-mode is very important for the look-and-feel. | ||
| 43 | ;; Pete Forman <pete.forman@airgun.wg.waii.com> provided some motif | ||
| 44 | ;; compliant keybindings which I added. I had to modify them a little | ||
| 45 | ;; to add the -mark and -nomark functionality of cursor moving. | ||
| 46 | ;; | ||
| 47 | ;; Credits: | ||
| 48 | ;; Many thanks to all who made comments. | ||
| 49 | ;; Thanks to RMS and Ralf Muschall <prm@rz.uni-jena.de> for criticism. | ||
| 50 | ;; Kevin Cutts <cutts@ukraine.corp.mot.com> added the beginning-of-buffer | ||
| 51 | ;; and end-of-buffer functions which I modified a little. | ||
| 52 | ;; David Biesack <sasdjb@unx.sas.com> suggested some more cleanup. | ||
| 53 | ;; Thanks to Pete Forman <pete.forman@airgun.wg.waii.com> | ||
| 54 | ;; for additional motif keybindings. | ||
| 55 | ;; Thanks to jvromans@squirrel.nl (Johan Vromans) for a bug report | ||
| 56 | ;; concerning setting of this-command. | ||
| 57 | ;; Dan Nicolaescu <done@ece.arizona.ro> suggested suppressing the | ||
| 58 | ;; scroll-up/scroll-down error. | ||
| 59 | ;; Eli Barzilay (eli@cs.bgu.ac.il) suggested the sexps functions and | ||
| 60 | ;; keybindings. | ||
| 61 | ;; | ||
| 62 | ;; Ok, some details about the idea of PC Selection mode: | ||
| 63 | ;; | ||
| 64 | ;; o The standard keys for moving around (right, left, up, down, home, end, | ||
| 65 | ;; prior, next, called "move-keys" from now on) will always de-activate | ||
| 66 | ;; the mark. | ||
| 67 | ;; o If you press "Shift" together with the "move-keys", the region | ||
| 68 | ;; you pass along is activated | ||
| 69 | ;; o You have the copy, cut and paste functions (as in many other programs) | ||
| 70 | ;; which will operate on the active region | ||
| 71 | ;; It was not possible to bind them to C-v, C-x and C-c for obvious | ||
| 72 | ;; emacs reasons. | ||
| 73 | ;; They will be bound according to the "old" behavior to S-delete (cut), | ||
| 74 | ;; S-insert (paste) and C-insert (copy). These keys do the same in many | ||
| 75 | ;; other programs. | ||
| 76 | ;; | ||
| 77 | |||
| 78 | ;;; Code: | ||
| 79 | |||
| 80 | ;; Customization: | ||
| 81 | (defgroup pc-select nil | ||
| 82 | "Emulate pc bindings." | ||
| 83 | :prefix "pc-select" | ||
| 84 | :group 'emulations) | ||
| 85 | |||
| 86 | (defcustom pc-select-override-scroll-error t | ||
| 87 | "Non-nil means don't generate error on scrolling past edge of buffer. | ||
| 88 | This variable applies in PC Selection mode only. | ||
| 89 | The scroll commands normally generate an error if you try to scroll | ||
| 90 | past the top or bottom of the buffer. This is annoying when selecting | ||
| 91 | text with these commands. If you set this variable to non-nil, these | ||
| 92 | errors are suppressed." | ||
| 93 | :type 'boolean | ||
| 94 | :group 'pc-select) | ||
| 95 | (define-obsolete-variable-alias 'pc-select-override-scroll-error | ||
| 96 | 'scroll-error-top-bottom | ||
| 97 | "24.1") | ||
| 98 | |||
| 99 | (defcustom pc-select-selection-keys-only nil | ||
| 100 | "Non-nil means only bind the basic selection keys when started. | ||
| 101 | Other keys that emulate pc-behavior will be untouched. | ||
| 102 | This gives mostly Emacs-like behavior with only the selection keys enabled." | ||
| 103 | :type 'boolean | ||
| 104 | :group 'pc-select) | ||
| 105 | |||
| 106 | (defcustom pc-select-meta-moves-sexps nil | ||
| 107 | "Non-nil means move sexp-wise with Meta key, otherwise move word-wise." | ||
| 108 | :type 'boolean | ||
| 109 | :group 'pc-select) | ||
| 110 | |||
| 111 | (defcustom pc-selection-mode-hook nil | ||
| 112 | "The hook to run when PC Selection mode is toggled." | ||
| 113 | :type 'hook | ||
| 114 | :group 'pc-select) | ||
| 115 | |||
| 116 | (defvar pc-select-saved-settings-alist nil | ||
| 117 | "The values of the variables before PC Selection mode was toggled on. | ||
| 118 | When PC Selection mode is toggled on, it sets quite a few variables | ||
| 119 | for its own purposes. This alist holds the original values of the | ||
| 120 | variables PC Selection mode had set, so that these variables can be | ||
| 121 | restored to their original values when PC Selection mode is toggled off.") | ||
| 122 | |||
| 123 | (defvar pc-select-map nil | ||
| 124 | "The keymap used as the global map when PC Selection mode is on." ) | ||
| 125 | |||
| 126 | (defvar pc-select-saved-global-map nil | ||
| 127 | "The global map that was in effect when PC Selection mode was toggled on.") | ||
| 128 | |||
| 129 | (defvar pc-select-key-bindings-alist nil | ||
| 130 | "This alist holds all the key bindings PC Selection mode sets.") | ||
| 131 | |||
| 132 | (defvar pc-select-default-key-bindings nil | ||
| 133 | "These key bindings always get set by PC Selection mode.") | ||
| 134 | |||
| 135 | (unless pc-select-default-key-bindings | ||
| 136 | (let ((lst | ||
| 137 | ;; This is to avoid confusion with the delete-selection-mode. | ||
| 138 | ;; On simple displays you can't see that a region is active and | ||
| 139 | ;; will be deleted on the next keypress IMHO especially for | ||
| 140 | ;; copy-region-as-kill this is confusing. | ||
| 141 | ;; The same goes for exchange-point-and-mark | ||
| 142 | '(("\M-w" . copy-region-as-kill-nomark) | ||
| 143 | ("\C-x\C-x" . exchange-point-and-mark-nomark) | ||
| 144 | ([S-right] . forward-char-mark) | ||
| 145 | ([right] . forward-char-nomark) | ||
| 146 | ([C-S-right] . forward-word-mark) | ||
| 147 | ([C-right] . forward-word-nomark) | ||
| 148 | ([S-left] . backward-char-mark) | ||
| 149 | ([left] . backward-char-nomark) | ||
| 150 | ([C-S-left] . backward-word-mark) | ||
| 151 | ([C-left] . backward-word-nomark) | ||
| 152 | ([S-down] . next-line-mark) | ||
| 153 | ([down] . next-line-nomark) | ||
| 154 | |||
| 155 | ([S-end] . end-of-line-mark) | ||
| 156 | ([end] . end-of-line-nomark) | ||
| 157 | ([S-C-end] . end-of-buffer-mark) | ||
| 158 | ([C-end] . end-of-buffer-nomark) | ||
| 159 | ([S-M-end] . end-of-buffer-mark) | ||
| 160 | ([M-end] . end-of-buffer-nomark) | ||
| 161 | |||
| 162 | ([S-next] . scroll-up-mark) | ||
| 163 | ([next] . scroll-up-nomark) | ||
| 164 | |||
| 165 | ([S-up] . previous-line-mark) | ||
| 166 | ([up] . previous-line-nomark) | ||
| 167 | |||
| 168 | ([S-home] . beginning-of-line-mark) | ||
| 169 | ([home] . beginning-of-line-nomark) | ||
| 170 | ([S-C-home] . beginning-of-buffer-mark) | ||
| 171 | ([C-home] . beginning-of-buffer-nomark) | ||
| 172 | ([S-M-home] . beginning-of-buffer-mark) | ||
| 173 | ([M-home] . beginning-of-buffer-nomark) | ||
| 174 | |||
| 175 | ([M-S-down] . forward-line-mark) | ||
| 176 | ([M-down] . forward-line-nomark) | ||
| 177 | ([M-S-up] . backward-line-mark) | ||
| 178 | ([M-up] . backward-line-nomark) | ||
| 179 | |||
| 180 | ([S-prior] . scroll-down-mark) | ||
| 181 | ([prior] . scroll-down-nomark) | ||
| 182 | |||
| 183 | ;; Next four lines are from Pete Forman. | ||
| 184 | ([C-down] . forward-paragraph-nomark) ; KNextPara cDn | ||
| 185 | ([C-up] . backward-paragraph-nomark) ; KPrevPara cUp | ||
| 186 | ([S-C-down] . forward-paragraph-mark) | ||
| 187 | ([S-C-up] . backward-paragraph-mark)))) | ||
| 188 | |||
| 189 | (setq pc-select-default-key-bindings lst))) | ||
| 190 | |||
| 191 | (defvar pc-select-extra-key-bindings nil | ||
| 192 | "Key bindings to set only if `pc-select-selection-keys-only' is nil.") | ||
| 193 | |||
| 194 | ;; The following keybindings are for standard ISO keyboards | ||
| 195 | ;; as they are used with IBM compatible PCs, IBM RS/6000, | ||
| 196 | ;; MACs, many X-Stations and probably more | ||
| 197 | (unless pc-select-extra-key-bindings | ||
| 198 | (let ((lst | ||
| 199 | '(([S-insert] . yank) | ||
| 200 | ([C-insert] . copy-region-as-kill) | ||
| 201 | ([S-delete] . kill-region) | ||
| 202 | |||
| 203 | ;; The following bindings are useful on Sun Type 3 keyboards | ||
| 204 | ;; They implement the Get-Delete-Put (copy-cut-paste) | ||
| 205 | ;; functions from sunview on the L6, L8 and L10 keys | ||
| 206 | ;; Sam Steingold <sds@gnu.org> says that f16 is copy and f18 is paste. | ||
| 207 | ([f16] . copy-region-as-kill) | ||
| 208 | ([f18] . yank) | ||
| 209 | ([f20] . kill-region) | ||
| 210 | |||
| 211 | ;; The following bindings are from Pete Forman. | ||
| 212 | ([f6] . other-window) ; KNextPane F6 | ||
| 213 | ([C-delete] . kill-line) ; KEraseEndLine cDel | ||
| 214 | ("\M-\d" . undo) ; KUndo aBS | ||
| 215 | |||
| 216 | ;; The following binding is taken from pc-mode.el | ||
| 217 | ;; as suggested by RMS. | ||
| 218 | ;; I only used the one that is not covered above. | ||
| 219 | ([C-M-delete] . kill-sexp) | ||
| 220 | ;; Next line proposed by Eli Barzilay | ||
| 221 | ([C-escape] . electric-buffer-list)))) | ||
| 222 | |||
| 223 | (setq pc-select-extra-key-bindings lst))) | ||
| 224 | |||
| 225 | (defvar pc-select-meta-moves-sexps-key-bindings | ||
| 226 | '((([M-S-right] . forward-sexp-mark) | ||
| 227 | ([M-right] . forward-sexp-nomark) | ||
| 228 | ([M-S-left] . backward-sexp-mark) | ||
| 229 | ([M-left] . backward-sexp-nomark)) | ||
| 230 | (([M-S-right] . forward-word-mark) | ||
| 231 | ([M-right] . forward-word-nomark) | ||
| 232 | ([M-S-left] . backward-word-mark) | ||
| 233 | ([M-left] . backward-word-nomark))) | ||
| 234 | "The list of key bindings controlled by `pc-select-meta-moves-sexp'. | ||
| 235 | The bindings in the car of this list get installed if | ||
| 236 | `pc-select-meta-moves-sexp' is t, the bindings in the cadr of this | ||
| 237 | list get installed otherwise.") | ||
| 238 | |||
| 239 | ;; This is for tty. We don't turn on normal-erase-is-backspace, | ||
| 240 | ;; but bind keys as pc-selection-mode did before | ||
| 241 | ;; normal-erase-is-backspace was invented, to keep us back | ||
| 242 | ;; compatible. | ||
| 243 | (defvar pc-select-tty-key-bindings | ||
| 244 | '(([delete] . delete-char) ; KDelete Del | ||
| 245 | ([C-backspace] . backward-kill-word)) | ||
| 246 | "The list of key bindings controlled by `pc-select-selection-keys-only'. | ||
| 247 | These key bindings get installed when running in a tty, but only if | ||
| 248 | `pc-select-selection-keys-only' is nil.") | ||
| 249 | |||
| 250 | (defvar pc-select-old-M-delete-binding nil | ||
| 251 | "Holds the old mapping of [M-delete] in the `function-key-map'. | ||
| 252 | This variable holds the value associated with [M-delete] in the | ||
| 253 | `function-key-map' before PC Selection mode had changed that | ||
| 254 | association.") | ||
| 255 | |||
| 256 | ;;;; | ||
| 257 | ;; misc | ||
| 258 | ;;;; | ||
| 259 | |||
| 260 | (provide 'pc-select) | ||
| 261 | |||
| 262 | (defun copy-region-as-kill-nomark (beg end) | ||
| 263 | "Save the region as if killed, but don't kill it; deactivate mark. | ||
| 264 | If `interprogram-cut-function' is non-nil, also save the text for a window | ||
| 265 | system cut and paste. | ||
| 266 | |||
| 267 | Deactivating mark is to avoid confusion with `delete-selection-mode' | ||
| 268 | and `transient-mark-mode'." | ||
| 269 | (interactive "r") | ||
| 270 | (copy-region-as-kill beg end) | ||
| 271 | (setq mark-active nil) | ||
| 272 | (message "Region saved")) | ||
| 273 | |||
| 274 | (defun exchange-point-and-mark-nomark () | ||
| 275 | "Like `exchange-point-and-mark' but without activating the mark." | ||
| 276 | (interactive) | ||
| 277 | (exchange-point-and-mark) | ||
| 278 | (setq mark-active nil)) | ||
| 279 | |||
| 280 | ;;;; | ||
| 281 | ;; non-interactive | ||
| 282 | ;;;; | ||
| 283 | (defun pc-select-ensure-mark () | ||
| 284 | ;; make sure mark is active | ||
| 285 | ;; test if it is active, if it isn't, set it and activate it | ||
| 286 | (or mark-active (set-mark-command nil)) | ||
| 287 | ;; Remember who activated the mark. | ||
| 288 | (setq mark-active 'pc-select)) | ||
| 289 | |||
| 290 | (defun pc-select-maybe-deactivate-mark () | ||
| 291 | ;; maybe switch off mark (only if *we* switched it on) | ||
| 292 | (when (eq mark-active 'pc-select) | ||
| 293 | (deactivate-mark))) | ||
| 294 | |||
| 295 | ;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 296 | ;;;;; forward and mark | ||
| 297 | ;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 298 | |||
| 299 | (defun forward-char-mark (&optional arg) | ||
| 300 | "Ensure mark is active; move point right ARG characters (left if ARG negative). | ||
| 301 | On reaching end of buffer, stop and signal error." | ||
| 302 | (interactive "p") | ||
| 303 | (pc-select-ensure-mark) | ||
| 304 | (forward-char arg)) | ||
| 305 | |||
| 306 | (defun forward-word-mark (&optional arg) | ||
| 307 | "Ensure mark is active; move point right ARG words (backward if ARG is negative). | ||
| 308 | Normally returns t. | ||
| 309 | If an edge of the buffer is reached, point is left there | ||
| 310 | and nil is returned." | ||
| 311 | (interactive "p") | ||
| 312 | (pc-select-ensure-mark) | ||
| 313 | (forward-word arg)) | ||
| 314 | |||
| 315 | (defun forward-line-mark (&optional arg) | ||
| 316 | "Ensure mark is active; move cursor vertically down ARG lines." | ||
| 317 | (interactive "p") | ||
| 318 | (pc-select-ensure-mark) | ||
| 319 | (forward-line arg) | ||
| 320 | (setq this-command 'forward-line) | ||
| 321 | ) | ||
| 322 | |||
| 323 | (defun forward-sexp-mark (&optional arg) | ||
| 324 | "Ensure mark is active; move forward across one balanced expression (sexp). | ||
| 325 | With argument, do it that many times. Negative arg -N means | ||
| 326 | move backward across N balanced expressions." | ||
| 327 | (interactive "p") | ||
| 328 | (pc-select-ensure-mark) | ||
| 329 | (forward-sexp arg)) | ||
| 330 | |||
| 331 | (defun forward-paragraph-mark (&optional arg) | ||
| 332 | "Ensure mark is active; move forward to end of paragraph. | ||
| 333 | With arg N, do it N times; negative arg -N means move backward N paragraphs. | ||
| 334 | |||
| 335 | A line which `paragraph-start' matches either separates paragraphs | ||
| 336 | \(if `paragraph-separate' matches it also) or is the first line of a paragraph. | ||
| 337 | A paragraph end is the beginning of a line which is not part of the paragraph | ||
| 338 | to which the end of the previous line belongs, or the end of the buffer." | ||
| 339 | (interactive "p") | ||
| 340 | (pc-select-ensure-mark) | ||
| 341 | (forward-paragraph arg)) | ||
| 342 | |||
| 343 | (defun next-line-mark (&optional arg) | ||
| 344 | "Ensure mark is active; move cursor vertically down ARG lines. | ||
| 345 | If there is no character in the target line exactly under the current column, | ||
| 346 | the cursor is positioned after the character in that line which spans this | ||
| 347 | column, or at the end of the line if it is not long enough. | ||
| 348 | If there is no line in the buffer after this one, behavior depends on the | ||
| 349 | value of `next-line-add-newlines'. If non-nil, it inserts a newline character | ||
| 350 | to create a line, and moves the cursor to that line. Otherwise it moves the | ||
| 351 | cursor to the end of the buffer \(if already at the end of the buffer, an error | ||
| 352 | is signaled). | ||
| 353 | |||
| 354 | The command \\[set-goal-column] can be used to create | ||
| 355 | a semipermanent goal column to which this command always moves. | ||
| 356 | Then it does not try to move vertically. This goal column is stored | ||
| 357 | in `goal-column', which is nil when there is none." | ||
| 358 | (interactive "p") | ||
| 359 | (pc-select-ensure-mark) | ||
| 360 | (with-no-warnings (next-line arg)) | ||
| 361 | (setq this-command 'next-line)) | ||
| 362 | |||
| 363 | (defun end-of-line-mark (&optional arg) | ||
| 364 | "Ensure mark is active; move point to end of current line. | ||
| 365 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | ||
| 366 | If scan reaches end of buffer, stop there without error." | ||
| 367 | (interactive "p") | ||
| 368 | (pc-select-ensure-mark) | ||
| 369 | (end-of-line arg) | ||
| 370 | (setq this-command 'end-of-line)) | ||
| 371 | |||
| 372 | (defun backward-line-mark (&optional arg) | ||
| 373 | "Ensure mark is active; move cursor vertically up ARG lines." | ||
| 374 | (interactive "p") | ||
| 375 | (pc-select-ensure-mark) | ||
| 376 | (if (null arg) | ||
| 377 | (setq arg 1)) | ||
| 378 | (forward-line (- arg)) | ||
| 379 | (setq this-command 'forward-line) | ||
| 380 | ) | ||
| 381 | |||
| 382 | (defun scroll-down-mark (&optional arg) | ||
| 383 | "Ensure mark is active; scroll down ARG lines; or near full screen if no ARG. | ||
| 384 | A near full screen is `next-screen-context-lines' less than a full screen. | ||
| 385 | Negative ARG means scroll upward. | ||
| 386 | When calling from a program, supply a number as argument or nil. | ||
| 387 | Attempting to scroll past the edge of buffer does not raise an | ||
| 388 | error, unless `pc-select-override-scroll-error' is nil." | ||
| 389 | (interactive "P") | ||
| 390 | (pc-select-ensure-mark) | ||
| 391 | (cond (pc-select-override-scroll-error | ||
| 392 | (condition-case nil (scroll-down arg) | ||
| 393 | (beginning-of-buffer (goto-char (point-min))))) | ||
| 394 | (t (scroll-down arg)))) | ||
| 395 | |||
| 396 | (defun end-of-buffer-mark (&optional arg) | ||
| 397 | "Ensure mark is active; move point to the end of the buffer. | ||
| 398 | With arg N, put point N/10 of the way from the end. | ||
| 399 | |||
| 400 | If the buffer is narrowed, this command uses the beginning and size | ||
| 401 | of the accessible part of the buffer. | ||
| 402 | |||
| 403 | Don't use this command in Lisp programs! | ||
| 404 | \(goto-char \(point-max)) is faster and avoids clobbering the mark." | ||
| 405 | (interactive "P") | ||
| 406 | (pc-select-ensure-mark) | ||
| 407 | (let ((size (- (point-max) (point-min)))) | ||
| 408 | (goto-char (if arg | ||
| 409 | (- (point-max) | ||
| 410 | (if (> size 10000) | ||
| 411 | ;; Avoid overflow for large buffer sizes! | ||
| 412 | (* (prefix-numeric-value arg) | ||
| 413 | (/ size 10)) | ||
| 414 | (/ (* size (prefix-numeric-value arg)) 10))) | ||
| 415 | (point-max)))) | ||
| 416 | ;; If we went to a place in the middle of the buffer, | ||
| 417 | ;; adjust it to the beginning of a line. | ||
| 418 | (if arg (forward-line 1) | ||
| 419 | ;; If the end of the buffer is not already on the screen, | ||
| 420 | ;; then scroll specially to put it near, but not at, the bottom. | ||
| 421 | (if (let ((old-point (point))) | ||
| 422 | (save-excursion | ||
| 423 | (goto-char (window-start)) | ||
| 424 | (vertical-motion (window-height)) | ||
| 425 | (< (point) old-point))) | ||
| 426 | (progn | ||
| 427 | (overlay-recenter (point)) | ||
| 428 | (recenter -3))))) | ||
| 429 | |||
| 430 | ;;;;;;;;; | ||
| 431 | ;;;;; no mark | ||
| 432 | ;;;;;;;;; | ||
| 433 | |||
| 434 | (defun forward-char-nomark (&optional arg) | ||
| 435 | "Deactivate mark; move point right ARG characters \(left if ARG negative). | ||
| 436 | On reaching end of buffer, stop and signal error." | ||
| 437 | (interactive "p") | ||
| 438 | (pc-select-maybe-deactivate-mark) | ||
| 439 | (forward-char arg)) | ||
| 440 | |||
| 441 | (defun forward-word-nomark (&optional arg) | ||
| 442 | "Deactivate mark; move point right ARG words \(backward if ARG is negative). | ||
| 443 | Normally returns t. | ||
| 444 | If an edge of the buffer is reached, point is left there | ||
| 445 | and nil is returned." | ||
| 446 | (interactive "p") | ||
| 447 | (pc-select-maybe-deactivate-mark) | ||
| 448 | (forward-word arg)) | ||
| 449 | |||
| 450 | (defun forward-line-nomark (&optional arg) | ||
| 451 | "Deactivate mark; move cursor vertically down ARG lines." | ||
| 452 | (interactive "p") | ||
| 453 | (pc-select-maybe-deactivate-mark) | ||
| 454 | (forward-line arg) | ||
| 455 | (setq this-command 'forward-line) | ||
| 456 | ) | ||
| 457 | |||
| 458 | (defun forward-sexp-nomark (&optional arg) | ||
| 459 | "Deactivate mark; move forward across one balanced expression (sexp). | ||
| 460 | With argument, do it that many times. Negative arg -N means | ||
| 461 | move backward across N balanced expressions." | ||
| 462 | (interactive "p") | ||
| 463 | (pc-select-maybe-deactivate-mark) | ||
| 464 | (forward-sexp arg)) | ||
| 465 | |||
| 466 | (defun forward-paragraph-nomark (&optional arg) | ||
| 467 | "Deactivate mark; move forward to end of paragraph. | ||
| 468 | With arg N, do it N times; negative arg -N means move backward N paragraphs. | ||
| 469 | |||
| 470 | A line which `paragraph-start' matches either separates paragraphs | ||
| 471 | \(if `paragraph-separate' matches it also) or is the first line of a paragraph. | ||
| 472 | A paragraph end is the beginning of a line which is not part of the paragraph | ||
| 473 | to which the end of the previous line belongs, or the end of the buffer." | ||
| 474 | (interactive "p") | ||
| 475 | (pc-select-maybe-deactivate-mark) | ||
| 476 | (forward-paragraph arg)) | ||
| 477 | |||
| 478 | (defun next-line-nomark (&optional arg) | ||
| 479 | "Deactivate mark; move cursor vertically down ARG lines. | ||
| 480 | If there is no character in the target line exactly under the current column, | ||
| 481 | the cursor is positioned after the character in that line which spans this | ||
| 482 | column, or at the end of the line if it is not long enough. | ||
| 483 | If there is no line in the buffer after this one, behavior depends on the | ||
| 484 | value of `next-line-add-newlines'. If non-nil, it inserts a newline character | ||
| 485 | to create a line, and moves the cursor to that line. Otherwise it moves the | ||
| 486 | cursor to the end of the buffer (if already at the end of the buffer, an error | ||
| 487 | is signaled). | ||
| 488 | |||
| 489 | The command \\[set-goal-column] can be used to create | ||
| 490 | a semipermanent goal column to which this command always moves. | ||
| 491 | Then it does not try to move vertically. This goal column is stored | ||
| 492 | in `goal-column', which is nil when there is none." | ||
| 493 | (interactive "p") | ||
| 494 | (pc-select-maybe-deactivate-mark) | ||
| 495 | (with-no-warnings (next-line arg)) | ||
| 496 | (setq this-command 'next-line)) | ||
| 497 | |||
| 498 | (defun end-of-line-nomark (&optional arg) | ||
| 499 | "Deactivate mark; move point to end of current line. | ||
| 500 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | ||
| 501 | If scan reaches end of buffer, stop there without error." | ||
| 502 | (interactive "p") | ||
| 503 | (pc-select-maybe-deactivate-mark) | ||
| 504 | (end-of-line arg) | ||
| 505 | (setq this-command 'end-of-line)) | ||
| 506 | |||
| 507 | (defun backward-line-nomark (&optional arg) | ||
| 508 | "Deactivate mark; move cursor vertically up ARG lines." | ||
| 509 | (interactive "p") | ||
| 510 | (pc-select-maybe-deactivate-mark) | ||
| 511 | (if (null arg) | ||
| 512 | (setq arg 1)) | ||
| 513 | (forward-line (- arg)) | ||
| 514 | (setq this-command 'forward-line) | ||
| 515 | ) | ||
| 516 | |||
| 517 | (defun scroll-down-nomark (&optional arg) | ||
| 518 | "Deactivate mark; scroll down ARG lines; or near full screen if no ARG. | ||
| 519 | A near full screen is `next-screen-context-lines' less than a full screen. | ||
| 520 | Negative ARG means scroll upward. | ||
| 521 | When calling from a program, supply a number as argument or nil. | ||
| 522 | Attempting to scroll past the edge of buffer does not raise an | ||
| 523 | error, unless `pc-select-override-scroll-error' is nil." | ||
| 524 | (interactive "P") | ||
| 525 | (pc-select-maybe-deactivate-mark) | ||
| 526 | (cond (pc-select-override-scroll-error | ||
| 527 | (condition-case nil (scroll-down arg) | ||
| 528 | (beginning-of-buffer (goto-char (point-min))))) | ||
| 529 | (t (scroll-down arg)))) | ||
| 530 | |||
| 531 | (defun end-of-buffer-nomark (&optional arg) | ||
| 532 | "Deactivate mark; move point to the end of the buffer. | ||
| 533 | With arg N, put point N/10 of the way from the end. | ||
| 534 | |||
| 535 | If the buffer is narrowed, this command uses the beginning and size | ||
| 536 | of the accessible part of the buffer. | ||
| 537 | |||
| 538 | Don't use this command in Lisp programs! | ||
| 539 | \(goto-char (point-max)) is faster and avoids clobbering the mark." | ||
| 540 | (interactive "P") | ||
| 541 | (pc-select-maybe-deactivate-mark) | ||
| 542 | (let ((size (- (point-max) (point-min)))) | ||
| 543 | (goto-char (if arg | ||
| 544 | (- (point-max) | ||
| 545 | (if (> size 10000) | ||
| 546 | ;; Avoid overflow for large buffer sizes! | ||
| 547 | (* (prefix-numeric-value arg) | ||
| 548 | (/ size 10)) | ||
| 549 | (/ (* size (prefix-numeric-value arg)) 10))) | ||
| 550 | (point-max)))) | ||
| 551 | ;; If we went to a place in the middle of the buffer, | ||
| 552 | ;; adjust it to the beginning of a line. | ||
| 553 | (if arg (forward-line 1) | ||
| 554 | ;; If the end of the buffer is not already on the screen, | ||
| 555 | ;; then scroll specially to put it near, but not at, the bottom. | ||
| 556 | (if (let ((old-point (point))) | ||
| 557 | (save-excursion | ||
| 558 | (goto-char (window-start)) | ||
| 559 | (vertical-motion (window-height)) | ||
| 560 | (< (point) old-point))) | ||
| 561 | (progn | ||
| 562 | (overlay-recenter (point)) | ||
| 563 | (recenter -3))))) | ||
| 564 | |||
| 565 | |||
| 566 | ;;;;;;;;;;;;;;;;;;;; | ||
| 567 | ;;;;;; backwards and mark | ||
| 568 | ;;;;;;;;;;;;;;;;;;;; | ||
| 569 | |||
| 570 | (defun backward-char-mark (&optional arg) | ||
| 571 | "Ensure mark is active; move point left ARG characters (right if ARG negative). | ||
| 572 | On attempt to pass beginning or end of buffer, stop and signal error." | ||
| 573 | (interactive "p") | ||
| 574 | (pc-select-ensure-mark) | ||
| 575 | (backward-char arg)) | ||
| 576 | |||
| 577 | (defun backward-word-mark (&optional arg) | ||
| 578 | "Ensure mark is active; move backward until encountering the end of a word. | ||
| 579 | With argument, do this that many times." | ||
| 580 | (interactive "p") | ||
| 581 | (pc-select-ensure-mark) | ||
| 582 | (backward-word arg)) | ||
| 583 | |||
| 584 | (defun backward-sexp-mark (&optional arg) | ||
| 585 | "Ensure mark is active; move backward across one balanced expression (sexp). | ||
| 586 | With argument, do it that many times. Negative arg -N means | ||
| 587 | move forward across N balanced expressions." | ||
| 588 | (interactive "p") | ||
| 589 | (pc-select-ensure-mark) | ||
| 590 | (backward-sexp arg)) | ||
| 591 | |||
| 592 | (defun backward-paragraph-mark (&optional arg) | ||
| 593 | "Ensure mark is active; move backward to start of paragraph. | ||
| 594 | With arg N, do it N times; negative arg -N means move forward N paragraphs. | ||
| 595 | |||
| 596 | A paragraph start is the beginning of a line which is a | ||
| 597 | `first-line-of-paragraph' or which is ordinary text and follows a | ||
| 598 | paragraph-separating line; except: if the first real line of a | ||
| 599 | paragraph is preceded by a blank line, the paragraph starts at that | ||
| 600 | blank line. | ||
| 601 | |||
| 602 | See `forward-paragraph' for more information." | ||
| 603 | (interactive "p") | ||
| 604 | (pc-select-ensure-mark) | ||
| 605 | (backward-paragraph arg)) | ||
| 606 | |||
| 607 | (defun previous-line-mark (&optional arg) | ||
| 608 | "Ensure mark is active; move cursor vertically up ARG lines. | ||
| 609 | If there is no character in the target line exactly over the current column, | ||
| 610 | the cursor is positioned after the character in that line which spans this | ||
| 611 | column, or at the end of the line if it is not long enough. | ||
| 612 | |||
| 613 | The command \\[set-goal-column] can be used to create | ||
| 614 | a semipermanent goal column to which this command always moves. | ||
| 615 | Then it does not try to move vertically. | ||
| 616 | |||
| 617 | If you are thinking of using this in a Lisp program, consider using | ||
| 618 | `forward-line' with a negative argument instead. It is usually easier | ||
| 619 | to use and more reliable (no dependence on goal column, etc.)." | ||
| 620 | (interactive "p") | ||
| 621 | (pc-select-ensure-mark) | ||
| 622 | (with-no-warnings (previous-line arg)) | ||
| 623 | (setq this-command 'previous-line)) | ||
| 624 | |||
| 625 | (defun beginning-of-line-mark (&optional arg) | ||
| 626 | "Ensure mark is active; move point to beginning of current line. | ||
| 627 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | ||
| 628 | If scan reaches end of buffer, stop there without error." | ||
| 629 | (interactive "p") | ||
| 630 | (pc-select-ensure-mark) | ||
| 631 | (beginning-of-line arg)) | ||
| 632 | |||
| 633 | |||
| 634 | (defun scroll-up-mark (&optional arg) | ||
| 635 | "Ensure mark is active; scroll upward ARG lines; or near full screen if no ARG. | ||
| 636 | A near full screen is `next-screen-context-lines' less than a full screen. | ||
| 637 | Negative ARG means scroll downward. | ||
| 638 | When calling from a program, supply a number as argument or nil. | ||
| 639 | Attempting to scroll past the edge of buffer does not raise an | ||
| 640 | error, unless `pc-select-override-scroll-error' is nil." | ||
| 641 | (interactive "P") | ||
| 642 | (pc-select-ensure-mark) | ||
| 643 | (cond (pc-select-override-scroll-error | ||
| 644 | (condition-case nil (scroll-up arg) | ||
| 645 | (end-of-buffer (goto-char (point-max))))) | ||
| 646 | (t (scroll-up arg)))) | ||
| 647 | |||
| 648 | (defun beginning-of-buffer-mark (&optional arg) | ||
| 649 | "Ensure mark is active; move point to the beginning of the buffer. | ||
| 650 | With arg N, put point N/10 of the way from the beginning. | ||
| 651 | |||
| 652 | If the buffer is narrowed, this command uses the beginning and size | ||
| 653 | of the accessible part of the buffer. | ||
| 654 | |||
| 655 | Don't use this command in Lisp programs! | ||
| 656 | \(goto-char (point-min)) is faster and avoids clobbering the mark." | ||
| 657 | (interactive "P") | ||
| 658 | (pc-select-ensure-mark) | ||
| 659 | (let ((size (- (point-max) (point-min)))) | ||
| 660 | (goto-char (if arg | ||
| 661 | (+ (point-min) | ||
| 662 | (if (> size 10000) | ||
| 663 | ;; Avoid overflow for large buffer sizes! | ||
| 664 | (* (prefix-numeric-value arg) | ||
| 665 | (/ size 10)) | ||
| 666 | (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) | ||
| 667 | (point-min)))) | ||
| 668 | (if arg (forward-line 1))) | ||
| 669 | |||
| 670 | ;;;;;;;; | ||
| 671 | ;;; no mark | ||
| 672 | ;;;;;;;; | ||
| 673 | |||
| 674 | (defun backward-char-nomark (&optional arg) | ||
| 675 | "Deactivate mark; move point left ARG characters (right if ARG negative). | ||
| 676 | On attempt to pass beginning or end of buffer, stop and signal error." | ||
| 677 | (interactive "p") | ||
| 678 | (pc-select-maybe-deactivate-mark) | ||
| 679 | (backward-char arg)) | ||
| 680 | |||
| 681 | (defun backward-word-nomark (&optional arg) | ||
| 682 | "Deactivate mark; move backward until encountering the end of a word. | ||
| 683 | With argument, do this that many times." | ||
| 684 | (interactive "p") | ||
| 685 | (pc-select-maybe-deactivate-mark) | ||
| 686 | (backward-word arg)) | ||
| 687 | |||
| 688 | (defun backward-sexp-nomark (&optional arg) | ||
| 689 | "Deactivate mark; move backward across one balanced expression (sexp). | ||
| 690 | With argument, do it that many times. Negative arg -N means | ||
| 691 | move forward across N balanced expressions." | ||
| 692 | (interactive "p") | ||
| 693 | (pc-select-maybe-deactivate-mark) | ||
| 694 | (backward-sexp arg)) | ||
| 695 | |||
| 696 | (defun backward-paragraph-nomark (&optional arg) | ||
| 697 | "Deactivate mark; move backward to start of paragraph. | ||
| 698 | With arg N, do it N times; negative arg -N means move forward N paragraphs. | ||
| 699 | |||
| 700 | A paragraph start is the beginning of a line which is a | ||
| 701 | `first-line-of-paragraph' or which is ordinary text and follows a | ||
| 702 | paragraph-separating line; except: if the first real line of a | ||
| 703 | paragraph is preceded by a blank line, the paragraph starts at that | ||
| 704 | blank line. | ||
| 705 | |||
| 706 | See `forward-paragraph' for more information." | ||
| 707 | (interactive "p") | ||
| 708 | (pc-select-maybe-deactivate-mark) | ||
| 709 | (backward-paragraph arg)) | ||
| 710 | |||
| 711 | (defun previous-line-nomark (&optional arg) | ||
| 712 | "Deactivate mark; move cursor vertically up ARG lines. | ||
| 713 | If there is no character in the target line exactly over the current column, | ||
| 714 | the cursor is positioned after the character in that line which spans this | ||
| 715 | column, or at the end of the line if it is not long enough. | ||
| 716 | |||
| 717 | The command \\[set-goal-column] can be used to create | ||
| 718 | a semipermanent goal column to which this command always moves. | ||
| 719 | Then it does not try to move vertically." | ||
| 720 | (interactive "p") | ||
| 721 | (pc-select-maybe-deactivate-mark) | ||
| 722 | (with-no-warnings (previous-line arg)) | ||
| 723 | (setq this-command 'previous-line)) | ||
| 724 | |||
| 725 | (defun beginning-of-line-nomark (&optional arg) | ||
| 726 | "Deactivate mark; move point to beginning of current line. | ||
| 727 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | ||
| 728 | If scan reaches end of buffer, stop there without error." | ||
| 729 | (interactive "p") | ||
| 730 | (pc-select-maybe-deactivate-mark) | ||
| 731 | (beginning-of-line arg)) | ||
| 732 | |||
| 733 | (defun scroll-up-nomark (&optional arg) | ||
| 734 | "Deactivate mark; scroll upward ARG lines; or near full screen if no ARG. | ||
| 735 | A near full screen is `next-screen-context-lines' less than a full screen. | ||
| 736 | Negative ARG means scroll downward. | ||
| 737 | When calling from a program, supply a number as argument or nil. | ||
| 738 | Attempting to scroll past the edge of buffer does not raise an | ||
| 739 | error, unless `pc-select-override-scroll-error' is nil." | ||
| 740 | (interactive "P") | ||
| 741 | (pc-select-maybe-deactivate-mark) | ||
| 742 | (cond (pc-select-override-scroll-error | ||
| 743 | (condition-case nil (scroll-up arg) | ||
| 744 | (end-of-buffer (goto-char (point-max))))) | ||
| 745 | (t (scroll-up arg)))) | ||
| 746 | |||
| 747 | (defun beginning-of-buffer-nomark (&optional arg) | ||
| 748 | "Deactivate mark; move point to the beginning of the buffer. | ||
| 749 | With arg N, put point N/10 of the way from the beginning. | ||
| 750 | |||
| 751 | If the buffer is narrowed, this command uses the beginning and size | ||
| 752 | of the accessible part of the buffer. | ||
| 753 | |||
| 754 | Don't use this command in Lisp programs! | ||
| 755 | \(goto-char (point-min)) is faster and avoids clobbering the mark." | ||
| 756 | (interactive "P") | ||
| 757 | (pc-select-maybe-deactivate-mark) | ||
| 758 | (let ((size (- (point-max) (point-min)))) | ||
| 759 | (goto-char (if arg | ||
| 760 | (+ (point-min) | ||
| 761 | (if (> size 10000) | ||
| 762 | ;; Avoid overflow for large buffer sizes! | ||
| 763 | (* (prefix-numeric-value arg) | ||
| 764 | (/ size 10)) | ||
| 765 | (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) | ||
| 766 | (point-min)))) | ||
| 767 | (if arg (forward-line 1))) | ||
| 768 | |||
| 769 | |||
| 770 | (defun pc-select-define-keys (alist keymap) | ||
| 771 | "Make KEYMAP have the key bindings specified in ALIST." | ||
| 772 | (let ((lst alist)) | ||
| 773 | (while lst | ||
| 774 | (define-key keymap (caar lst) (cdar lst)) | ||
| 775 | (setq lst (cdr lst))))) | ||
| 776 | |||
| 777 | (defun pc-select-restore-keys (alist keymap saved-map) | ||
| 778 | "Use ALIST to restore key bindings from SAVED-MAP into KEYMAP. | ||
| 779 | Go through all the key bindings in ALIST, and, for each key | ||
| 780 | binding, if KEYMAP and ALIST still agree on the key binding, | ||
| 781 | restore the previous value of that key binding from SAVED-MAP." | ||
| 782 | (let ((lst alist)) | ||
| 783 | (while lst | ||
| 784 | (when (equal (lookup-key keymap (caar lst)) (cdar lst)) | ||
| 785 | (define-key keymap (caar lst) (lookup-key saved-map (caar lst)))) | ||
| 786 | (setq lst (cdr lst))))) | ||
| 787 | |||
| 788 | (defmacro pc-select-add-to-alist (alist var val) | ||
| 789 | "Ensure that ALIST contains the cons cell (VAR . VAL). | ||
| 790 | If a cons cell whose car is VAR is already on the ALIST, update the | ||
| 791 | cdr of that cell with VAL. Otherwise, make a new cons cell | ||
| 792 | \(VAR . VAL), and prepend it onto ALIST." | ||
| 793 | (let ((elt (make-symbol "elt"))) | ||
| 794 | `(let ((,elt (assq ',var ,alist))) | ||
| 795 | (if ,elt | ||
| 796 | (setcdr ,elt ,val) | ||
| 797 | (setq ,alist (cons (cons ',var ,val) ,alist)))))) | ||
| 798 | |||
| 799 | (defmacro pc-select-save-and-set-var (var newval) | ||
| 800 | "Set VAR to NEWVAL; save the old value. | ||
| 801 | The old value is saved on the `pc-select-saved-settings-alist'." | ||
| 802 | `(when (boundp ',var) | ||
| 803 | (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var) | ||
| 804 | (setq ,var ,newval))) | ||
| 805 | |||
| 806 | (defmacro pc-select-save-and-set-mode (mode &optional arg mode-var) | ||
| 807 | "Call the function MODE; save the old value of the variable MODE. | ||
| 808 | MODE is presumed to be a function which turns on a minor mode. First, | ||
| 809 | save the value of the variable MODE on `pc-select-saved-settings-alist'. | ||
| 810 | Then, if ARG is specified, call MODE with ARG, otherwise call it with | ||
| 811 | nil as an argument. If MODE-VAR is specified, save the value of the | ||
| 812 | variable MODE-VAR (instead of the value of the variable MODE) on | ||
| 813 | `pc-select-saved-settings-alist'." | ||
| 814 | (unless mode-var (setq mode-var mode)) | ||
| 815 | `(when (fboundp ',mode) | ||
| 816 | (pc-select-add-to-alist pc-select-saved-settings-alist | ||
| 817 | ,mode-var ,mode-var) | ||
| 818 | (,mode ,arg))) | ||
| 819 | |||
| 820 | (defmacro pc-select-restore-var (var) | ||
| 821 | "Restore the previous value of the variable VAR. | ||
| 822 | Look up VAR's previous value in `pc-select-saved-settings-alist', and, | ||
| 823 | if the value is found, set VAR to that value." | ||
| 824 | (let ((elt (make-symbol "elt"))) | ||
| 825 | `(let ((,elt (assq ',var pc-select-saved-settings-alist))) | ||
| 826 | (unless (null ,elt) | ||
| 827 | (setq ,var (cdr ,elt)))))) | ||
| 828 | |||
| 829 | (defmacro pc-select-restore-mode (mode) | ||
| 830 | "Restore the previous state (either on or off) of the minor mode MODE. | ||
| 831 | Look up the value of the variable MODE on `pc-select-saved-settings-alist'. | ||
| 832 | If the value is non-nil, call the function MODE with an argument of | ||
| 833 | 1, otherwise call it with an argument of -1." | ||
| 834 | (let ((elt (make-symbol "elt"))) | ||
| 835 | `(when (fboundp ',mode) | ||
| 836 | (let ((,elt (assq ',mode pc-select-saved-settings-alist))) | ||
| 837 | (unless (null ,elt) | ||
| 838 | (,mode (if (cdr ,elt) 1 -1))))))) | ||
| 839 | |||
| 840 | |||
| 841 | ;;;###autoload | ||
| 842 | (define-minor-mode pc-selection-mode | ||
| 843 | "Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style. | ||
| 844 | |||
| 845 | This mode enables Delete Selection mode and Transient Mark mode. | ||
| 846 | |||
| 847 | The arrow keys (and others) are bound to new functions | ||
| 848 | which modify the status of the mark. | ||
| 849 | |||
| 850 | The ordinary arrow keys disable the mark. | ||
| 851 | The shift-arrow keys move, leaving the mark behind. | ||
| 852 | |||
| 853 | C-LEFT and C-RIGHT move back or forward one word, disabling the mark. | ||
| 854 | S-C-LEFT and S-C-RIGHT move back or forward one word, leaving the mark behind. | ||
| 855 | |||
| 856 | M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark. | ||
| 857 | S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark | ||
| 858 | behind. To control whether these keys move word-wise or sexp-wise set the | ||
| 859 | variable `pc-select-meta-moves-sexps' after loading pc-select.el but before | ||
| 860 | turning PC Selection mode on. | ||
| 861 | |||
| 862 | C-DOWN and C-UP move back or forward a paragraph, disabling the mark. | ||
| 863 | S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind. | ||
| 864 | |||
| 865 | HOME moves to beginning of line, disabling the mark. | ||
| 866 | S-HOME moves to beginning of line, leaving the mark behind. | ||
| 867 | With Ctrl or Meta, these keys move to beginning of buffer instead. | ||
| 868 | |||
| 869 | END moves to end of line, disabling the mark. | ||
| 870 | S-END moves to end of line, leaving the mark behind. | ||
| 871 | With Ctrl or Meta, these keys move to end of buffer instead. | ||
| 872 | |||
| 873 | PRIOR or PAGE-UP scrolls and disables the mark. | ||
| 874 | S-PRIOR or S-PAGE-UP scrolls and leaves the mark behind. | ||
| 875 | |||
| 876 | S-DELETE kills the region (`kill-region'). | ||
| 877 | S-INSERT yanks text from the kill ring (`yank'). | ||
| 878 | C-INSERT copies the region into the kill ring (`copy-region-as-kill'). | ||
| 879 | |||
| 880 | In addition, certain other PC bindings are imitated (to avoid this, set | ||
| 881 | the variable `pc-select-selection-keys-only' to t after loading pc-select.el | ||
| 882 | but before calling PC Selection mode): | ||
| 883 | |||
| 884 | F6 other-window | ||
| 885 | DELETE delete-char | ||
| 886 | C-DELETE kill-line | ||
| 887 | M-DELETE kill-word | ||
| 888 | C-M-DELETE kill-sexp | ||
| 889 | C-BACKSPACE backward-kill-word | ||
| 890 | M-BACKSPACE undo" | ||
| 891 | ;; FIXME: bring pc-bindings-mode here ? | ||
| 892 | nil nil nil | ||
| 893 | |||
| 894 | :group 'pc-select | ||
| 895 | :global t | ||
| 896 | |||
| 897 | (if pc-selection-mode | ||
| 898 | (if (null pc-select-key-bindings-alist) | ||
| 899 | (progn | ||
| 900 | (setq pc-select-saved-global-map (copy-keymap (current-global-map))) | ||
| 901 | (setq pc-select-key-bindings-alist | ||
| 902 | (append pc-select-default-key-bindings | ||
| 903 | (if pc-select-selection-keys-only | ||
| 904 | nil | ||
| 905 | pc-select-extra-key-bindings) | ||
| 906 | (if pc-select-meta-moves-sexps | ||
| 907 | (car pc-select-meta-moves-sexps-key-bindings) | ||
| 908 | (cadr pc-select-meta-moves-sexps-key-bindings)) | ||
| 909 | (if (or pc-select-selection-keys-only | ||
| 910 | (eq window-system 'x) | ||
| 911 | (memq system-name '(ms-dos windows-nt))) | ||
| 912 | nil | ||
| 913 | pc-select-tty-key-bindings))) | ||
| 914 | |||
| 915 | (pc-select-define-keys pc-select-key-bindings-alist | ||
| 916 | (current-global-map)) | ||
| 917 | |||
| 918 | (unless (or pc-select-selection-keys-only | ||
| 919 | (eq window-system 'x) | ||
| 920 | (memq system-name '(ms-dos windows-nt))) | ||
| 921 | ;; it is not clear that we need the following line | ||
| 922 | ;; I hope it doesn't do too much harm to leave it in, though... | ||
| 923 | (setq pc-select-old-M-delete-binding | ||
| 924 | (lookup-key function-key-map [M-delete])) | ||
| 925 | (define-key function-key-map [M-delete] [?\M-d])) | ||
| 926 | |||
| 927 | (when (and (not pc-select-selection-keys-only) | ||
| 928 | (or (eq window-system 'x) | ||
| 929 | (memq system-name '(ms-dos windows-nt))) | ||
| 930 | (fboundp 'normal-erase-is-backspace-mode)) | ||
| 931 | (pc-select-save-and-set-mode normal-erase-is-backspace-mode 1 | ||
| 932 | normal-erase-is-backspace)) | ||
| 933 | ;; the original author also had this above: | ||
| 934 | ;; (setq-default normal-erase-is-backspace t) | ||
| 935 | ;; However, the documentation for the variable says that | ||
| 936 | ;; "setting it with setq has no effect", so I'm removing it. | ||
| 937 | |||
| 938 | (pc-select-save-and-set-var highlight-nonselected-windows nil) | ||
| 939 | (pc-select-save-and-set-var transient-mark-mode t) | ||
| 940 | (pc-select-save-and-set-var mark-even-if-inactive t) | ||
| 941 | (pc-select-save-and-set-mode delete-selection-mode 1)) | ||
| 942 | ;;else | ||
| 943 | ;; If the user turned on pc-selection-mode a second time | ||
| 944 | ;; do not clobber the values of the variables that were | ||
| 945 | ;; saved from before pc-selection mode was activated -- | ||
| 946 | ;; just make sure the values are the way we like them. | ||
| 947 | (pc-select-define-keys pc-select-key-bindings-alist | ||
| 948 | (current-global-map)) | ||
| 949 | (unless (or pc-select-selection-keys-only | ||
| 950 | (eq window-system 'x) | ||
| 951 | (memq system-name '(ms-dos windows-nt))) | ||
| 952 | ;; it is not clear that we need the following line | ||
| 953 | ;; I hope it doesn't do too much harm to leave it in, though... | ||
| 954 | (define-key function-key-map [M-delete] [?\M-d])) | ||
| 955 | (when (and (not pc-select-selection-keys-only) | ||
| 956 | (or (eq window-system 'x) | ||
| 957 | (memq system-name '(ms-dos windows-nt))) | ||
| 958 | (fboundp 'normal-erase-is-backspace-mode)) | ||
| 959 | (normal-erase-is-backspace-mode 1)) | ||
| 960 | (setq highlight-nonselected-windows nil) | ||
| 961 | (setq transient-mark-mode t) | ||
| 962 | (setq mark-even-if-inactive t) | ||
| 963 | (delete-selection-mode 1)) | ||
| 964 | ;;else | ||
| 965 | (when pc-select-key-bindings-alist | ||
| 966 | (when (and (not pc-select-selection-keys-only) | ||
| 967 | (or (eq window-system 'x) | ||
| 968 | (memq system-name '(ms-dos windows-nt)))) | ||
| 969 | (pc-select-restore-mode normal-erase-is-backspace-mode)) | ||
| 970 | |||
| 971 | (pc-select-restore-keys | ||
| 972 | pc-select-key-bindings-alist (current-global-map) | ||
| 973 | pc-select-saved-global-map) | ||
| 974 | |||
| 975 | (pc-select-restore-var highlight-nonselected-windows) | ||
| 976 | (pc-select-restore-var transient-mark-mode) | ||
| 977 | (pc-select-restore-var mark-even-if-inactive) | ||
| 978 | (pc-select-restore-mode delete-selection-mode) | ||
| 979 | (and pc-select-old-M-delete-binding | ||
| 980 | (define-key function-key-map [M-delete] | ||
| 981 | pc-select-old-M-delete-binding)) | ||
| 982 | (setq pc-select-key-bindings-alist nil | ||
| 983 | pc-select-saved-settings-alist nil)))) | ||
| 984 | |||
| 985 | ;;; pc-select.el ends here | ||
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index ee81bc48693..b7cf79cc3cb 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-02-07 Julien Danjou <julien@danjou.info> | ||
| 2 | |||
| 3 | * erc-track.el (erc-window-configuration-change): New function. | ||
| 4 | This will allow to track buffer visibility when a command is | ||
| 5 | finished to executed. Idea stolen from rcirc. | ||
| 6 | (track): Put erc-window-configuration-change in | ||
| 7 | window-configuration-change-hook. | ||
| 8 | (erc-modified-channels-update): Remove | ||
| 9 | erc-modified-channels-update from post-command-hook after update. | ||
| 10 | |||
| 1 | 2011-01-31 Antoine Levitt <antoine.levitt@gmail.com> (tiny change) | 11 | 2011-01-31 Antoine Levitt <antoine.levitt@gmail.com> (tiny change) |
| 2 | 12 | ||
| 3 | * erc-track.el (track): Don't reset erc-modified-channels-object | 13 | * erc-track.el (track): Don't reset erc-modified-channels-object |
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index de920eb9c33..a89244f695d 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el | |||
| @@ -653,7 +653,7 @@ module, otherwise the keybindings will not do anything useful." | |||
| 653 | (defadvice switch-to-buffer (after erc-update (&rest args) activate) | 653 | (defadvice switch-to-buffer (after erc-update (&rest args) activate) |
| 654 | (erc-modified-channels-update)) | 654 | (erc-modified-channels-update)) |
| 655 | (add-hook 'window-configuration-change-hook | 655 | (add-hook 'window-configuration-change-hook |
| 656 | 'erc-modified-channels-update)) | 656 | 'erc-window-configuration-change)) |
| 657 | (add-hook 'erc-insert-post-hook 'erc-track-modified-channels) | 657 | (add-hook 'erc-insert-post-hook 'erc-track-modified-channels) |
| 658 | (add-hook 'erc-disconnected-hook 'erc-modified-channels-update)) | 658 | (add-hook 'erc-disconnected-hook 'erc-modified-channels-update)) |
| 659 | ;; enable the tracking keybindings | 659 | ;; enable the tracking keybindings |
| @@ -675,7 +675,7 @@ module, otherwise the keybindings will not do anything useful." | |||
| 675 | (if (featurep 'xemacs) | 675 | (if (featurep 'xemacs) |
| 676 | (ad-disable-advice 'switch-to-buffer 'after 'erc-update) | 676 | (ad-disable-advice 'switch-to-buffer 'after 'erc-update) |
| 677 | (remove-hook 'window-configuration-change-hook | 677 | (remove-hook 'window-configuration-change-hook |
| 678 | 'erc-modified-channels-update)) | 678 | 'erc-window-configuration-change)) |
| 679 | (remove-hook 'erc-disconnected-hook 'erc-modified-channels-update) | 679 | (remove-hook 'erc-disconnected-hook 'erc-modified-channels-update) |
| 680 | (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels)) | 680 | (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels)) |
| 681 | ;; disable the tracking keybindings | 681 | ;; disable the tracking keybindings |
| @@ -730,6 +730,12 @@ only consider active buffers visible.") | |||
| 730 | 730 | ||
| 731 | ;;; Tracking the channel modifications | 731 | ;;; Tracking the channel modifications |
| 732 | 732 | ||
| 733 | (defun erc-window-configuration-change () | ||
| 734 | (unless (minibuffer-window-active-p (minibuffer-window)) | ||
| 735 | ;; delay this until command has finished to make sure window is | ||
| 736 | ;; actually visible before clearing activity | ||
| 737 | (add-hook 'post-command-hook 'erc-modified-channels-update))) | ||
| 738 | |||
| 733 | (defvar erc-modified-channels-update-inside nil | 739 | (defvar erc-modified-channels-update-inside nil |
| 734 | "Variable to prevent running `erc-modified-channels-update' multiple | 740 | "Variable to prevent running `erc-modified-channels-update' multiple |
| 735 | times. Without it, you cannot debug `erc-modified-channels-display', | 741 | times. Without it, you cannot debug `erc-modified-channels-display', |
| @@ -757,8 +763,9 @@ ARGS are ignored." | |||
| 757 | (erc-modified-channels-remove-buffer buffer)))) | 763 | (erc-modified-channels-remove-buffer buffer)))) |
| 758 | erc-modified-channels-alist) | 764 | erc-modified-channels-alist) |
| 759 | (when removed-channel | 765 | (when removed-channel |
| 760 | (erc-modified-channels-display) | 766 | (erc-modified-channels-display) |
| 761 | (force-mode-line-update t))))) | 767 | (force-mode-line-update t))) |
| 768 | (remove-hook 'post-command-hook 'erc-modified-channels-update))) | ||
| 762 | 769 | ||
| 763 | (defvar erc-track-mouse-face (if (featurep 'xemacs) | 770 | (defvar erc-track-mouse-face (if (featurep 'xemacs) |
| 764 | 'modeline-mousable | 771 | 'modeline-mousable |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index a18f145cb68..ba4d270951b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2011-02-09 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * nntp.el (nntp-retrieve-group-data-early-disabled): Disable the async | ||
| 4 | code for now, since it doesn't work for all users. | ||
| 5 | |||
| 6 | 2011-02-09 Julien Danjou <julien@danjou.info> | ||
| 7 | |||
| 8 | * message.el (message-options): Make message-options really buffer | ||
| 9 | local. | ||
| 10 | |||
| 11 | 2011-02-08 Julien Danjou <julien@danjou.info> | ||
| 12 | |||
| 13 | * shr.el (shr-tag-body): Add support for text attribute in body | ||
| 14 | markups. | ||
| 15 | |||
| 16 | * message.el (message-options): Make message-options a local variable. | ||
| 17 | |||
| 1 | 2011-02-07 Lars Ingebrigtsen <larsi@gnus.org> | 18 | 2011-02-07 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 19 | ||
| 3 | * nnimap.el (nnimap-update-info): Refactor slightly. | 20 | * nnimap.el (nnimap-update-info): Refactor slightly. |
| @@ -7,6 +24,7 @@ | |||
| 7 | characters. | 24 | characters. |
| 8 | (nnimap-process-quirk): Renamed function to avoid collision. | 25 | (nnimap-process-quirk): Renamed function to avoid collision. |
| 9 | (nnimap-update-info): Fix macrology bug-out. | 26 | (nnimap-update-info): Fix macrology bug-out. |
| 27 | (nnimap-update-info): Simplify split history test. | ||
| 10 | 28 | ||
| 11 | 2011-02-06 Lars Ingebrigtsen <larsi@gnus.org> | 29 | 2011-02-06 Lars Ingebrigtsen <larsi@gnus.org> |
| 12 | 30 | ||
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 3ba57caba4f..e30f7f2c973 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -1814,6 +1814,7 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." | |||
| 1814 | 1814 | ||
| 1815 | (defvar message-options nil | 1815 | (defvar message-options nil |
| 1816 | "Some saved answers when sending message.") | 1816 | "Some saved answers when sending message.") |
| 1817 | (make-variable-buffer-local 'message-options) | ||
| 1817 | 1818 | ||
| 1818 | (defvar message-send-mail-real-function nil | 1819 | (defvar message-send-mail-real-function nil |
| 1819 | "Internal send mail function.") | 1820 | "Internal send mail function.") |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 127082bc28f..a6fe6b1489b 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -1342,13 +1342,11 @@ textual parts.") | |||
| 1342 | ;; Tell Gnus whether there are any \Recent messages in any of | 1342 | ;; Tell Gnus whether there are any \Recent messages in any of |
| 1343 | ;; the groups. | 1343 | ;; the groups. |
| 1344 | (let ((recent (cdr (assoc '%Recent flags)))) | 1344 | (let ((recent (cdr (assoc '%Recent flags)))) |
| 1345 | (when (and active recent) | 1345 | (when (and active |
| 1346 | (while recent | 1346 | recent |
| 1347 | (when (> (car recent) (cdr active)) | 1347 | (> (car (last recent)) (cdr active))) |
| 1348 | (push (list (cons (gnus-group-real-name group) 0)) | 1348 | (push (list (cons (gnus-group-real-name group) 0)) |
| 1349 | nnmail-split-history) | 1349 | nnmail-split-history))) |
| 1350 | (setq recent nil)) | ||
| 1351 | (pop recent)))) | ||
| 1352 | ;; Note the active level for the next run-through. | 1350 | ;; Note the active level for the next run-through. |
| 1353 | (gnus-group-set-parameter info 'active (gnus-active group)) | 1351 | (gnus-group-set-parameter info 'active (gnus-active group)) |
| 1354 | (gnus-group-set-parameter info 'uidvalidity uidvalidity) | 1352 | (gnus-group-set-parameter info 'uidvalidity uidvalidity) |
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 0e009b2068b..eb2dd004638 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el | |||
| @@ -774,7 +774,7 @@ command whose response triggered the error." | |||
| 774 | (nntp-copy-to-buffer nntp-server-buffer (point-min) (point-max)) | 774 | (nntp-copy-to-buffer nntp-server-buffer (point-min) (point-max)) |
| 775 | 'headers))))) | 775 | 'headers))))) |
| 776 | 776 | ||
| 777 | (deffoo nntp-retrieve-group-data-early (server infos) | 777 | (deffoo nntp-retrieve-group-data-early-disabled (server infos) |
| 778 | "Retrieve group info on INFOS." | 778 | "Retrieve group info on INFOS." |
| 779 | (nntp-with-open-group nil server | 779 | (nntp-with-open-group nil server |
| 780 | (when (nntp-find-connection-buffer nntp-server-buffer) | 780 | (when (nntp-find-connection-buffer nntp-server-buffer) |
| @@ -793,7 +793,7 @@ command whose response triggered the error." | |||
| 793 | nil command (gnus-group-real-name (gnus-info-group info))))) | 793 | nil command (gnus-group-real-name (gnus-info-group info))))) |
| 794 | (length infos))))) | 794 | (length infos))))) |
| 795 | 795 | ||
| 796 | (deffoo nntp-finish-retrieve-group-infos (server infos count) | 796 | (deffoo nntp-finish-retrieve-group-infos-disabled (server infos count) |
| 797 | (nntp-with-open-group nil server | 797 | (nntp-with-open-group nil server |
| 798 | (let ((buf (nntp-find-connection-buffer nntp-server-buffer)) | 798 | (let ((buf (nntp-find-connection-buffer nntp-server-buffer)) |
| 799 | (method (gnus-find-method-for-group | 799 | (method (gnus-find-method-for-group |
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index 5b4e6c7389d..bb9695ebb72 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el | |||
| @@ -696,7 +696,8 @@ ones, in case fg and bg are nil." | |||
| 696 | 696 | ||
| 697 | (defun shr-tag-body (cont) | 697 | (defun shr-tag-body (cont) |
| 698 | (let* ((start (point)) | 698 | (let* ((start (point)) |
| 699 | (fgcolor (cdr (assq :fgcolor cont))) | 699 | (fgcolor (cdr (or (assq :fgcolor cont) |
| 700 | (assq :text cont)))) | ||
| 700 | (bgcolor (cdr (assq :bgcolor cont))) | 701 | (bgcolor (cdr (assq :bgcolor cont))) |
| 701 | (shr-stylesheet (list (cons 'color fgcolor) | 702 | (shr-stylesheet (list (cons 'color fgcolor) |
| 702 | (cons 'background-color bgcolor)))) | 703 | (cons 'background-color bgcolor)))) |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 3e5b301cbfb..04048e0e572 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -2638,7 +2638,7 @@ will be inserted before the group at point." | |||
| 2638 | ;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group | 2638 | ;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group |
| 2639 | ;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group | 2639 | ;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group |
| 2640 | ;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode | 2640 | ;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode |
| 2641 | ;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "f163e17664a89a6f0aa2b15bfaaa65a4") | 2641 | ;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "eb3de21aef70e4ca75f611f1c3c56aa1") |
| 2642 | ;;; Generated autoloads from ibuf-ext.el | 2642 | ;;; Generated autoloads from ibuf-ext.el |
| 2643 | 2643 | ||
| 2644 | (autoload 'ibuffer-auto-mode "ibuf-ext" "\ | 2644 | (autoload 'ibuffer-auto-mode "ibuf-ext" "\ |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 21934ce8b01..62fa7eb0feb 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -2185,14 +2185,23 @@ With a prefix arg, prompt for new topic." | |||
| 2185 | 2185 | ||
| 2186 | (defun rcirc-cmd-ctcp (args &optional process target) | 2186 | (defun rcirc-cmd-ctcp (args &optional process target) |
| 2187 | (if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args) | 2187 | (if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args) |
| 2188 | (let ((target (match-string 1 args)) | 2188 | (let* ((target (match-string 1 args)) |
| 2189 | (request (match-string 2 args))) | 2189 | (request (upcase (match-string 2 args))) |
| 2190 | (rcirc-send-string process | 2190 | (function (intern-soft (concat "rcirc-ctcp-sender-" request)))) |
| 2191 | (format "PRIVMSG %s \C-a%s\C-a" | 2191 | (if (fboundp function) ;; use special function if available |
| 2192 | target (upcase request)))) | 2192 | (funcall function process target request) |
| 2193 | (rcirc-send-string process | ||
| 2194 | (format "PRIVMSG %s :\C-a%s\C-a" | ||
| 2195 | target request)))) | ||
| 2193 | (rcirc-print process (rcirc-nick process) "ERROR" nil | 2196 | (rcirc-print process (rcirc-nick process) "ERROR" nil |
| 2194 | "usage: /ctcp NICK REQUEST"))) | 2197 | "usage: /ctcp NICK REQUEST"))) |
| 2195 | 2198 | ||
| 2199 | (defun rcirc-ctcp-sender-PING (process target request) | ||
| 2200 | "Send a CTCP PING message to TARGET." | ||
| 2201 | (let ((timestamp (format "%.0f" (float-time)))) | ||
| 2202 | (rcirc-send-string process | ||
| 2203 | (format "PRIVMSG %s :\C-aPING %s\C-a" target timestamp)))) | ||
| 2204 | |||
| 2196 | (defun rcirc-cmd-me (args &optional process target) | 2205 | (defun rcirc-cmd-me (args &optional process target) |
| 2197 | (rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a" | 2206 | (rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a" |
| 2198 | target args))) | 2207 | target args))) |
diff --git a/lisp/emulation/pc-mode.el b/lisp/obsolete/pc-mode.el index c0ed1925b49..192392d3821 100644 --- a/lisp/emulation/pc-mode.el +++ b/lisp/obsolete/pc-mode.el | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Maintainer: FSF | 5 | ;; Maintainer: FSF |
| 6 | ;; Keywords: emulations | 6 | ;; Keywords: emulations |
| 7 | ;; Obsolete-since: 24.1 | ||
| 7 | 8 | ||
| 8 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 9 | 10 | ||
diff --git a/lisp/obsolete/pc-select.el b/lisp/obsolete/pc-select.el new file mode 100644 index 00000000000..9a5f9e9d9dc --- /dev/null +++ b/lisp/obsolete/pc-select.el | |||
| @@ -0,0 +1,417 @@ | |||
| 1 | ;;; pc-select.el --- emulate mark, cut, copy and paste from Motif | ||
| 2 | ;;; (or MAC GUI or MS-windoze (bah)) look-and-feel | ||
| 3 | ;;; including key bindings. | ||
| 4 | |||
| 5 | ;; Copyright (C) 1995-1997, 2000-2011 Free Software Foundation, Inc. | ||
| 6 | |||
| 7 | ;; Author: Michael Staats <michael@thp.Uni-Duisburg.DE> | ||
| 8 | ;; Keywords: convenience emulations | ||
| 9 | ;; Created: 26 Sep 1995 | ||
| 10 | ;; Obsolete-since: 24.1 | ||
| 11 | |||
| 12 | ;; This file is part of GNU Emacs. | ||
| 13 | |||
| 14 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 15 | ;; it under the terms of the GNU General Public License as published by | ||
| 16 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 17 | ;; (at your option) any later version. | ||
| 18 | |||
| 19 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 20 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | ;; GNU General Public License for more details. | ||
| 23 | |||
| 24 | ;; You should have received a copy of the GNU General Public License | ||
| 25 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 26 | |||
| 27 | ;;; Commentary: | ||
| 28 | |||
| 29 | ;; This package emulates the mark, copy, cut and paste look-and-feel of motif | ||
| 30 | ;; programs (which is the same as the MAC gui and (sorry for that) MS-Windows). | ||
| 31 | ;; It modifies the keybindings of the cursor keys and the next, prior, | ||
| 32 | ;; home and end keys. They will modify mark-active. | ||
| 33 | ;; You can still get the old behavior of cursor moving with the | ||
| 34 | ;; control sequences C-f, C-b, etc. | ||
| 35 | ;; This package uses transient-mark-mode and | ||
| 36 | ;; delete-selection-mode. | ||
| 37 | ;; | ||
| 38 | ;; In addition to that all key-bindings from the pc-mode are | ||
| 39 | ;; done here too (as suggested by RMS). | ||
| 40 | ;; | ||
| 41 | ;; As I found out after I finished the first version, s-region.el tries | ||
| 42 | ;; to do the same.... But my code is a little more complete and using | ||
| 43 | ;; delete-selection-mode is very important for the look-and-feel. | ||
| 44 | ;; Pete Forman <pete.forman@airgun.wg.waii.com> provided some motif | ||
| 45 | ;; compliant keybindings which I added. I had to modify them a little | ||
| 46 | ;; to add the -mark and -nomark functionality of cursor moving. | ||
| 47 | ;; | ||
| 48 | ;; Credits: | ||
| 49 | ;; Many thanks to all who made comments. | ||
| 50 | ;; Thanks to RMS and Ralf Muschall <prm@rz.uni-jena.de> for criticism. | ||
| 51 | ;; Kevin Cutts <cutts@ukraine.corp.mot.com> added the beginning-of-buffer | ||
| 52 | ;; and end-of-buffer functions which I modified a little. | ||
| 53 | ;; David Biesack <sasdjb@unx.sas.com> suggested some more cleanup. | ||
| 54 | ;; Thanks to Pete Forman <pete.forman@airgun.wg.waii.com> | ||
| 55 | ;; for additional motif keybindings. | ||
| 56 | ;; Thanks to jvromans@squirrel.nl (Johan Vromans) for a bug report | ||
| 57 | ;; concerning setting of this-command. | ||
| 58 | ;; Dan Nicolaescu <done@ece.arizona.ro> suggested suppressing the | ||
| 59 | ;; scroll-up/scroll-down error. | ||
| 60 | ;; Eli Barzilay (eli@cs.bgu.ac.il) suggested the sexps functions and | ||
| 61 | ;; keybindings. | ||
| 62 | ;; | ||
| 63 | ;; Ok, some details about the idea of PC Selection mode: | ||
| 64 | ;; | ||
| 65 | ;; o The standard keys for moving around (right, left, up, down, home, end, | ||
| 66 | ;; prior, next, called "move-keys" from now on) will always de-activate | ||
| 67 | ;; the mark. | ||
| 68 | ;; o If you press "Shift" together with the "move-keys", the region | ||
| 69 | ;; you pass along is activated | ||
| 70 | ;; o You have the copy, cut and paste functions (as in many other programs) | ||
| 71 | ;; which will operate on the active region | ||
| 72 | ;; It was not possible to bind them to C-v, C-x and C-c for obvious | ||
| 73 | ;; emacs reasons. | ||
| 74 | ;; They will be bound according to the "old" behavior to S-delete (cut), | ||
| 75 | ;; S-insert (paste) and C-insert (copy). These keys do the same in many | ||
| 76 | ;; other programs. | ||
| 77 | ;; | ||
| 78 | |||
| 79 | ;;; Code: | ||
| 80 | |||
| 81 | ;; Customization: | ||
| 82 | (defgroup pc-select nil | ||
| 83 | "Emulate pc bindings." | ||
| 84 | :prefix "pc-select" | ||
| 85 | :group 'emulations) | ||
| 86 | |||
| 87 | (define-obsolete-variable-alias 'pc-select-override-scroll-error | ||
| 88 | 'scroll-error-top-bottom | ||
| 89 | "24.1") | ||
| 90 | (defcustom pc-select-override-scroll-error t | ||
| 91 | "Non-nil means don't generate error on scrolling past edge of buffer. | ||
| 92 | This variable applies in PC Selection mode only. | ||
| 93 | The scroll commands normally generate an error if you try to scroll | ||
| 94 | past the top or bottom of the buffer. This is annoying when selecting | ||
| 95 | text with these commands. If you set this variable to non-nil, these | ||
| 96 | errors are suppressed." | ||
| 97 | :type 'boolean | ||
| 98 | :group 'pc-select) | ||
| 99 | |||
| 100 | (defcustom pc-select-selection-keys-only nil | ||
| 101 | "Non-nil means only bind the basic selection keys when started. | ||
| 102 | Other keys that emulate pc-behavior will be untouched. | ||
| 103 | This gives mostly Emacs-like behavior with only the selection keys enabled." | ||
| 104 | :type 'boolean | ||
| 105 | :group 'pc-select) | ||
| 106 | |||
| 107 | (defcustom pc-select-meta-moves-sexps nil | ||
| 108 | "Non-nil means move sexp-wise with Meta key, otherwise move word-wise." | ||
| 109 | :type 'boolean | ||
| 110 | :group 'pc-select) | ||
| 111 | |||
| 112 | (defcustom pc-selection-mode-hook nil | ||
| 113 | "The hook to run when PC Selection mode is toggled." | ||
| 114 | :type 'hook | ||
| 115 | :group 'pc-select) | ||
| 116 | |||
| 117 | (defvar pc-select-saved-settings-alist nil | ||
| 118 | "The values of the variables before PC Selection mode was toggled on. | ||
| 119 | When PC Selection mode is toggled on, it sets quite a few variables | ||
| 120 | for its own purposes. This alist holds the original values of the | ||
| 121 | variables PC Selection mode had set, so that these variables can be | ||
| 122 | restored to their original values when PC Selection mode is toggled off.") | ||
| 123 | |||
| 124 | (defvar pc-select-map nil | ||
| 125 | "The keymap used as the global map when PC Selection mode is on." ) | ||
| 126 | |||
| 127 | (defvar pc-select-saved-global-map nil | ||
| 128 | "The global map that was in effect when PC Selection mode was toggled on.") | ||
| 129 | |||
| 130 | (defvar pc-select-key-bindings-alist nil | ||
| 131 | "This alist holds all the key bindings PC Selection mode sets.") | ||
| 132 | |||
| 133 | (defvar pc-select-default-key-bindings nil | ||
| 134 | "These key bindings always get set by PC Selection mode.") | ||
| 135 | |||
| 136 | (defvar pc-select-extra-key-bindings | ||
| 137 | ;; The following keybindings are for standard ISO keyboards | ||
| 138 | ;; as they are used with IBM compatible PCs, IBM RS/6000, | ||
| 139 | ;; MACs, many X-Stations and probably more. | ||
| 140 | '(;; Commented out since it's been standard at least since Emacs-21. | ||
| 141 | ;;([S-insert] . yank) | ||
| 142 | ;;([C-insert] . copy-region-as-kill) | ||
| 143 | ;;([S-delete] . kill-region) | ||
| 144 | |||
| 145 | ;; The following bindings are useful on Sun Type 3 keyboards | ||
| 146 | ;; They implement the Get-Delete-Put (copy-cut-paste) | ||
| 147 | ;; functions from sunview on the L6, L8 and L10 keys | ||
| 148 | ;; Sam Steingold <sds@gnu.org> says that f16 is copy and f18 is paste. | ||
| 149 | ([f16] . copy-region-as-kill) | ||
| 150 | ([f18] . yank) | ||
| 151 | ([f20] . kill-region) | ||
| 152 | |||
| 153 | ;; The following bindings are from Pete Forman. | ||
| 154 | ([f6] . other-window) ; KNextPane F6 | ||
| 155 | ([C-delete] . kill-line) ; KEraseEndLine cDel | ||
| 156 | ("\M-\d" . undo) ; KUndo aBS | ||
| 157 | |||
| 158 | ;; The following binding is taken from pc-mode.el | ||
| 159 | ;; as suggested by RMS. | ||
| 160 | ;; I only used the one that is not covered above. | ||
| 161 | ([C-M-delete] . kill-sexp) | ||
| 162 | ;; Next line proposed by Eli Barzilay | ||
| 163 | ([C-escape] . electric-buffer-list)) | ||
| 164 | "Key bindings to set only if `pc-select-selection-keys-only' is nil.") | ||
| 165 | |||
| 166 | (defvar pc-select-meta-moves-sexps-key-bindings | ||
| 167 | '((([M-right] . forward-sexp) | ||
| 168 | ([M-left] . backward-sexp)) | ||
| 169 | (([M-right] . forward-word) | ||
| 170 | ([M-left] . backward-word))) | ||
| 171 | "The list of key bindings controlled by `pc-select-meta-moves-sexp'. | ||
| 172 | The bindings in the car of this list get installed if | ||
| 173 | `pc-select-meta-moves-sexp' is t, the bindings in the cadr of this | ||
| 174 | list get installed otherwise.") | ||
| 175 | |||
| 176 | ;; This is for tty. We don't turn on normal-erase-is-backspace, | ||
| 177 | ;; but bind keys as pc-selection-mode did before | ||
| 178 | ;; normal-erase-is-backspace was invented, to keep us back | ||
| 179 | ;; compatible. | ||
| 180 | (defvar pc-select-tty-key-bindings | ||
| 181 | '(([delete] . delete-char) ; KDelete Del | ||
| 182 | ([C-backspace] . backward-kill-word)) | ||
| 183 | "The list of key bindings controlled by `pc-select-selection-keys-only'. | ||
| 184 | These key bindings get installed when running in a tty, but only if | ||
| 185 | `pc-select-selection-keys-only' is nil.") | ||
| 186 | |||
| 187 | (defvar pc-select-old-M-delete-binding nil | ||
| 188 | "Holds the old mapping of [M-delete] in the `function-key-map'. | ||
| 189 | This variable holds the value associated with [M-delete] in the | ||
| 190 | `function-key-map' before PC Selection mode had changed that | ||
| 191 | association.") | ||
| 192 | |||
| 193 | ;;;; | ||
| 194 | ;; misc | ||
| 195 | ;;;; | ||
| 196 | |||
| 197 | (provide 'pc-select) | ||
| 198 | |||
| 199 | (defun pc-select-define-keys (alist keymap) | ||
| 200 | "Make KEYMAP have the key bindings specified in ALIST." | ||
| 201 | (let ((lst alist)) | ||
| 202 | (while lst | ||
| 203 | (define-key keymap (caar lst) (cdar lst)) | ||
| 204 | (setq lst (cdr lst))))) | ||
| 205 | |||
| 206 | (defun pc-select-restore-keys (alist keymap saved-map) | ||
| 207 | "Use ALIST to restore key bindings from SAVED-MAP into KEYMAP. | ||
| 208 | Go through all the key bindings in ALIST, and, for each key | ||
| 209 | binding, if KEYMAP and ALIST still agree on the key binding, | ||
| 210 | restore the previous value of that key binding from SAVED-MAP." | ||
| 211 | (let ((lst alist)) | ||
| 212 | (while lst | ||
| 213 | (when (equal (lookup-key keymap (caar lst)) (cdar lst)) | ||
| 214 | (define-key keymap (caar lst) (lookup-key saved-map (caar lst)))) | ||
| 215 | (setq lst (cdr lst))))) | ||
| 216 | |||
| 217 | (defmacro pc-select-add-to-alist (alist var val) | ||
| 218 | "Ensure that ALIST contains the cons cell (VAR . VAL). | ||
| 219 | If a cons cell whose car is VAR is already on the ALIST, update the | ||
| 220 | cdr of that cell with VAL. Otherwise, make a new cons cell | ||
| 221 | \(VAR . VAL), and prepend it onto ALIST." | ||
| 222 | (let ((elt (make-symbol "elt"))) | ||
| 223 | `(let ((,elt (assq ',var ,alist))) | ||
| 224 | (if ,elt | ||
| 225 | (setcdr ,elt ,val) | ||
| 226 | (setq ,alist (cons (cons ',var ,val) ,alist)))))) | ||
| 227 | |||
| 228 | (defmacro pc-select-save-and-set-var (var newval) | ||
| 229 | "Set VAR to NEWVAL; save the old value. | ||
| 230 | The old value is saved on the `pc-select-saved-settings-alist'." | ||
| 231 | `(when (boundp ',var) | ||
| 232 | (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var) | ||
| 233 | (setq ,var ,newval))) | ||
| 234 | |||
| 235 | (defmacro pc-select-save-and-set-mode (mode &optional arg mode-var) | ||
| 236 | "Call the function MODE; save the old value of the variable MODE. | ||
| 237 | MODE is presumed to be a function which turns on a minor mode. First, | ||
| 238 | save the value of the variable MODE on `pc-select-saved-settings-alist'. | ||
| 239 | Then, if ARG is specified, call MODE with ARG, otherwise call it with | ||
| 240 | nil as an argument. If MODE-VAR is specified, save the value of the | ||
| 241 | variable MODE-VAR (instead of the value of the variable MODE) on | ||
| 242 | `pc-select-saved-settings-alist'." | ||
| 243 | (unless mode-var (setq mode-var mode)) | ||
| 244 | `(when (fboundp ',mode) | ||
| 245 | (pc-select-add-to-alist pc-select-saved-settings-alist | ||
| 246 | ,mode-var ,mode-var) | ||
| 247 | (,mode ,arg))) | ||
| 248 | |||
| 249 | (defmacro pc-select-restore-var (var) | ||
| 250 | "Restore the previous value of the variable VAR. | ||
| 251 | Look up VAR's previous value in `pc-select-saved-settings-alist', and, | ||
| 252 | if the value is found, set VAR to that value." | ||
| 253 | (let ((elt (make-symbol "elt"))) | ||
| 254 | `(let ((,elt (assq ',var pc-select-saved-settings-alist))) | ||
| 255 | (unless (null ,elt) | ||
| 256 | (setq ,var (cdr ,elt)))))) | ||
| 257 | |||
| 258 | (defmacro pc-select-restore-mode (mode) | ||
| 259 | "Restore the previous state (either on or off) of the minor mode MODE. | ||
| 260 | Look up the value of the variable MODE on `pc-select-saved-settings-alist'. | ||
| 261 | If the value is non-nil, call the function MODE with an argument of | ||
| 262 | 1, otherwise call it with an argument of -1." | ||
| 263 | (let ((elt (make-symbol "elt"))) | ||
| 264 | `(when (fboundp ',mode) | ||
| 265 | (let ((,elt (assq ',mode pc-select-saved-settings-alist))) | ||
| 266 | (unless (null ,elt) | ||
| 267 | (,mode (if (cdr ,elt) 1 -1))))))) | ||
| 268 | |||
| 269 | |||
| 270 | ;;;###autoload | ||
| 271 | (define-minor-mode pc-selection-mode | ||
| 272 | "Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style. | ||
| 273 | |||
| 274 | This mode enables Delete Selection mode and Transient Mark mode. | ||
| 275 | |||
| 276 | The arrow keys (and others) are bound to new functions | ||
| 277 | which modify the status of the mark. | ||
| 278 | |||
| 279 | The ordinary arrow keys disable the mark. | ||
| 280 | The shift-arrow keys move, leaving the mark behind. | ||
| 281 | |||
| 282 | C-LEFT and C-RIGHT move back or forward one word, disabling the mark. | ||
| 283 | S-C-LEFT and S-C-RIGHT move back or forward one word, leaving the mark behind. | ||
| 284 | |||
| 285 | M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark. | ||
| 286 | S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark | ||
| 287 | behind. To control whether these keys move word-wise or sexp-wise set the | ||
| 288 | variable `pc-select-meta-moves-sexps' after loading pc-select.el but before | ||
| 289 | turning PC Selection mode on. | ||
| 290 | |||
| 291 | C-DOWN and C-UP move back or forward a paragraph, disabling the mark. | ||
| 292 | S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind. | ||
| 293 | |||
| 294 | HOME moves to beginning of line, disabling the mark. | ||
| 295 | S-HOME moves to beginning of line, leaving the mark behind. | ||
| 296 | With Ctrl or Meta, these keys move to beginning of buffer instead. | ||
| 297 | |||
| 298 | END moves to end of line, disabling the mark. | ||
| 299 | S-END moves to end of line, leaving the mark behind. | ||
| 300 | With Ctrl or Meta, these keys move to end of buffer instead. | ||
| 301 | |||
| 302 | PRIOR or PAGE-UP scrolls and disables the mark. | ||
| 303 | S-PRIOR or S-PAGE-UP scrolls and leaves the mark behind. | ||
| 304 | |||
| 305 | S-DELETE kills the region (`kill-region'). | ||
| 306 | S-INSERT yanks text from the kill ring (`yank'). | ||
| 307 | C-INSERT copies the region into the kill ring (`copy-region-as-kill'). | ||
| 308 | |||
| 309 | In addition, certain other PC bindings are imitated (to avoid this, set | ||
| 310 | the variable `pc-select-selection-keys-only' to t after loading pc-select.el | ||
| 311 | but before calling PC Selection mode): | ||
| 312 | |||
| 313 | F6 other-window | ||
| 314 | DELETE delete-char | ||
| 315 | C-DELETE kill-line | ||
| 316 | M-DELETE kill-word | ||
| 317 | C-M-DELETE kill-sexp | ||
| 318 | C-BACKSPACE backward-kill-word | ||
| 319 | M-BACKSPACE undo" | ||
| 320 | ;; FIXME: bring pc-bindings-mode here ? | ||
| 321 | nil nil nil | ||
| 322 | |||
| 323 | :group 'pc-select | ||
| 324 | :global t | ||
| 325 | |||
| 326 | (if pc-selection-mode | ||
| 327 | (if (null pc-select-key-bindings-alist) | ||
| 328 | (progn | ||
| 329 | (setq pc-select-saved-global-map (copy-keymap (current-global-map))) | ||
| 330 | (setq pc-select-key-bindings-alist | ||
| 331 | (append pc-select-default-key-bindings | ||
| 332 | (if pc-select-selection-keys-only | ||
| 333 | nil | ||
| 334 | pc-select-extra-key-bindings) | ||
| 335 | (if pc-select-meta-moves-sexps | ||
| 336 | (car pc-select-meta-moves-sexps-key-bindings) | ||
| 337 | (cadr pc-select-meta-moves-sexps-key-bindings)) | ||
| 338 | (if (or pc-select-selection-keys-only | ||
| 339 | (eq window-system 'x) | ||
| 340 | (memq system-name '(ms-dos windows-nt))) | ||
| 341 | nil | ||
| 342 | pc-select-tty-key-bindings))) | ||
| 343 | |||
| 344 | (pc-select-define-keys pc-select-key-bindings-alist | ||
| 345 | (current-global-map)) | ||
| 346 | |||
| 347 | (unless (or pc-select-selection-keys-only | ||
| 348 | (eq window-system 'x) | ||
| 349 | (memq system-name '(ms-dos windows-nt))) | ||
| 350 | ;; it is not clear that we need the following line | ||
| 351 | ;; I hope it doesn't do too much harm to leave it in, though... | ||
| 352 | (setq pc-select-old-M-delete-binding | ||
| 353 | (lookup-key function-key-map [M-delete])) | ||
| 354 | (define-key function-key-map [M-delete] [?\M-d])) | ||
| 355 | |||
| 356 | (when (and (not pc-select-selection-keys-only) | ||
| 357 | (or (eq window-system 'x) | ||
| 358 | (memq system-name '(ms-dos windows-nt))) | ||
| 359 | (fboundp 'normal-erase-is-backspace-mode)) | ||
| 360 | (pc-select-save-and-set-mode normal-erase-is-backspace-mode 1 | ||
| 361 | normal-erase-is-backspace)) | ||
| 362 | ;; the original author also had this above: | ||
| 363 | ;; (setq-default normal-erase-is-backspace t) | ||
| 364 | ;; However, the documentation for the variable says that | ||
| 365 | ;; "setting it with setq has no effect", so I'm removing it. | ||
| 366 | |||
| 367 | (pc-select-save-and-set-var highlight-nonselected-windows nil) | ||
| 368 | (pc-select-save-and-set-var transient-mark-mode t) | ||
| 369 | (pc-select-save-and-set-var shift-select-mode t) | ||
| 370 | (pc-select-save-and-set-var mark-even-if-inactive t) | ||
| 371 | (pc-select-save-and-set-mode delete-selection-mode 1)) | ||
| 372 | ;;else | ||
| 373 | ;; If the user turned on pc-selection-mode a second time | ||
| 374 | ;; do not clobber the values of the variables that were | ||
| 375 | ;; saved from before pc-selection mode was activated -- | ||
| 376 | ;; just make sure the values are the way we like them. | ||
| 377 | (pc-select-define-keys pc-select-key-bindings-alist | ||
| 378 | (current-global-map)) | ||
| 379 | (unless (or pc-select-selection-keys-only | ||
| 380 | (eq window-system 'x) | ||
| 381 | (memq system-name '(ms-dos windows-nt))) | ||
| 382 | ;; it is not clear that we need the following line | ||
| 383 | ;; I hope it doesn't do too much harm to leave it in, though... | ||
| 384 | (define-key function-key-map [M-delete] [?\M-d])) | ||
| 385 | (when (and (not pc-select-selection-keys-only) | ||
| 386 | (or (eq window-system 'x) | ||
| 387 | (memq system-name '(ms-dos windows-nt))) | ||
| 388 | (fboundp 'normal-erase-is-backspace-mode)) | ||
| 389 | (normal-erase-is-backspace-mode 1)) | ||
| 390 | (setq highlight-nonselected-windows nil) | ||
| 391 | (setq transient-mark-mode t) | ||
| 392 | (setq mark-even-if-inactive t) | ||
| 393 | (delete-selection-mode 1)) | ||
| 394 | ;;else | ||
| 395 | (when pc-select-key-bindings-alist | ||
| 396 | (when (and (not pc-select-selection-keys-only) | ||
| 397 | (or (eq window-system 'x) | ||
| 398 | (memq system-name '(ms-dos windows-nt)))) | ||
| 399 | (pc-select-restore-mode normal-erase-is-backspace-mode)) | ||
| 400 | |||
| 401 | (pc-select-restore-keys | ||
| 402 | pc-select-key-bindings-alist (current-global-map) | ||
| 403 | pc-select-saved-global-map) | ||
| 404 | |||
| 405 | (pc-select-restore-var highlight-nonselected-windows) | ||
| 406 | (pc-select-restore-var transient-mark-mode) | ||
| 407 | (pc-select-restore-var shift-select-mode) | ||
| 408 | (pc-select-restore-var mark-even-if-inactive) | ||
| 409 | (pc-select-restore-mode delete-selection-mode) | ||
| 410 | (and pc-select-old-M-delete-binding | ||
| 411 | (define-key function-key-map [M-delete] | ||
| 412 | pc-select-old-M-delete-binding)) | ||
| 413 | (setq pc-select-key-bindings-alist nil | ||
| 414 | pc-select-saved-settings-alist nil)))) | ||
| 415 | (make-obsolete 'pc-selection-mode 'delete-selection-mode "24.1") | ||
| 416 | |||
| 417 | ;;; pc-select.el ends here | ||
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index d80d814156e..900072fe356 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -948,12 +948,12 @@ Point is at the beginning of the next line." | |||
| 948 | ;; We're looking at <<STRING, so we add "^STRING$" to the syntactic | 948 | ;; We're looking at <<STRING, so we add "^STRING$" to the syntactic |
| 949 | ;; font-lock keywords to detect the end of this here document. | 949 | ;; font-lock keywords to detect the end of this here document. |
| 950 | (let ((str (replace-regexp-in-string "['\"]" "" string)) | 950 | (let ((str (replace-regexp-in-string "['\"]" "" string)) |
| 951 | (ppss (save-excursion (syntax-ppss (1- (point)))))) | 951 | (ppss (save-excursion (syntax-ppss eol)))) |
| 952 | (if (nth 4 ppss) | 952 | (if (nth 4 ppss) |
| 953 | ;; The \n not only starts the heredoc but also closes a comment. | 953 | ;; The \n not only starts the heredoc but also closes a comment. |
| 954 | ;; Let's close the comment just before the \n. | 954 | ;; Let's close the comment just before the \n. |
| 955 | (put-text-property (1- (point)) (point) 'syntax-table '(12))) ;">" | 955 | (put-text-property (1- eol) eol 'syntax-table '(12))) ;">" |
| 956 | (if (or (nth 5 ppss) (> (count-lines start (point)) 1)) | 956 | (if (or (nth 5 ppss) (> (count-lines start eol) 1)) |
| 957 | ;; If the sh-escaped-line-re part of sh-here-doc-open-re has matched | 957 | ;; If the sh-escaped-line-re part of sh-here-doc-open-re has matched |
| 958 | ;; several lines, make sure we refontify them together. | 958 | ;; several lines, make sure we refontify them together. |
| 959 | ;; Furthermore, if (nth 5 ppss) is non-nil (i.e. the \n is | 959 | ;; Furthermore, if (nth 5 ppss) is non-nil (i.e. the \n is |
| @@ -961,7 +961,7 @@ Point is at the beginning of the next line." | |||
| 961 | ;; Don't bother fixing it now, but place a multiline property so | 961 | ;; Don't bother fixing it now, but place a multiline property so |
| 962 | ;; that when jit-lock-context-* refontifies the rest of the | 962 | ;; that when jit-lock-context-* refontifies the rest of the |
| 963 | ;; buffer, it also refontifies the current line with it. | 963 | ;; buffer, it also refontifies the current line with it. |
| 964 | (put-text-property start (point) 'syntax-multiline t)) | 964 | (put-text-property start (1+ eol) 'syntax-multiline t)) |
| 965 | (put-text-property eol (1+ eol) 'sh-here-doc-marker str) | 965 | (put-text-property eol (1+ eol) 'sh-here-doc-marker str) |
| 966 | (prog1 sh-here-doc-syntax | 966 | (prog1 sh-here-doc-syntax |
| 967 | (goto-char (+ 2 start)))))) | 967 | (goto-char (+ 2 start)))))) |
| @@ -1083,33 +1083,33 @@ subshells can nest." | |||
| 1083 | (defun sh-syntax-propertize-function (start end) | 1083 | (defun sh-syntax-propertize-function (start end) |
| 1084 | (goto-char start) | 1084 | (goto-char start) |
| 1085 | (sh-syntax-propertize-here-doc end) | 1085 | (sh-syntax-propertize-here-doc end) |
| 1086 | (funcall | 1086 | (funcall |
| 1087 | (syntax-propertize-rules | 1087 | (syntax-propertize-rules |
| 1088 | (sh-here-doc-open-re | 1088 | (sh-here-doc-open-re |
| 1089 | (2 (sh-font-lock-open-heredoc | 1089 | (2 (sh-font-lock-open-heredoc |
| 1090 | (match-beginning 0) (match-string 1) (match-beginning 2)))) | 1090 | (match-beginning 0) (match-string 1) (match-beginning 2)))) |
| 1091 | ("\\s|" (0 (prog1 nil (sh-syntax-propertize-here-doc end)))) | 1091 | ("\\s|" (0 (prog1 nil (sh-syntax-propertize-here-doc end)))) |
| 1092 | ;; A `#' begins a comment when it is unquoted and at the | 1092 | ;; A `#' begins a comment when it is unquoted and at the |
| 1093 | ;; beginning of a word. In the shell, words are separated by | 1093 | ;; beginning of a word. In the shell, words are separated by |
| 1094 | ;; metacharacters. The list of special chars is taken from | 1094 | ;; metacharacters. The list of special chars is taken from |
| 1095 | ;; the single-unix spec of the shell command language (under | 1095 | ;; the single-unix spec of the shell command language (under |
| 1096 | ;; `quoting') but with `$' removed. | 1096 | ;; `quoting') but with `$' removed. |
| 1097 | ("[^|&;<>()`\\\"' \t\n]\\(#+\\)" (1 "_")) | 1097 | ("[^|&;<>()`\\\"' \t\n]\\(#+\\)" (1 "_")) |
| 1098 | ;; In a '...' the backslash is not escaping. | 1098 | ;; In a '...' the backslash is not escaping. |
| 1099 | ("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote))) | 1099 | ("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote))) |
| 1100 | ;; Make sure $@ and $? are correctly recognized as sexps. | 1100 | ;; Make sure $@ and $? are correctly recognized as sexps. |
| 1101 | ("\\$\\([?@]\\)" (1 "_")) | 1101 | ("\\$\\([?@]\\)" (1 "_")) |
| 1102 | ;; Distinguish the special close-paren in `case'. | 1102 | ;; Distinguish the special close-paren in `case'. |
| 1103 | (")" (0 (sh-font-lock-paren (match-beginning 0)))) | 1103 | (")" (0 (sh-font-lock-paren (match-beginning 0)))) |
| 1104 | ;; Highlight (possibly nested) subshells inside "" quoted | 1104 | ;; Highlight (possibly nested) subshells inside "" quoted |
| 1105 | ;; regions correctly. | 1105 | ;; regions correctly. |
| 1106 | ("\"\\(?:\\(?:[^\\\"]\\|\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" | 1106 | ("\"\\(?:\\(?:[^\\\"]\\|\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" |
| 1107 | (1 (ignore | 1107 | (1 (ignore |
| 1108 | ;; Save excursion because we want to also apply other | 1108 | ;; Save excursion because we want to also apply other |
| 1109 | ;; syntax-propertize rules within the affected region. | 1109 | ;; syntax-propertize rules within the affected region. |
| 1110 | (if (nth 8 (syntax-ppss)) | 1110 | (if (nth 8 (syntax-ppss)) |
| 1111 | (goto-char (1+ (match-beginning 0))) | 1111 | (goto-char (1+ (match-beginning 0))) |
| 1112 | (save-excursion | 1112 | (save-excursion |
| 1113 | (sh-font-lock-quoted-subshell end))))))) | 1113 | (sh-font-lock-quoted-subshell end))))))) |
| 1114 | (point) end)) | 1114 | (point) end)) |
| 1115 | 1115 | ||