diff options
| author | Miles Bader | 2004-12-25 02:00:25 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-12-25 02:00:25 +0000 |
| commit | 6a89b7e95a771e5141bb1718e8278dcf892359ea (patch) | |
| tree | 189a864da85f49e73c6f9220b7231f0c54250e6e /lisp | |
| parent | 054b6b53c3554c83ae02d24a772a74b63ebb08cd (diff) | |
| parent | 70d16390a08dc9d94c961eb380be8e1b5b496963 (diff) | |
| download | emacs-6a89b7e95a771e5141bb1718e8278dcf892359ea.tar.gz emacs-6a89b7e95a771e5141bb1718e8278dcf892359ea.zip | |
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-79
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-735
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-747
Update from CVS
Diffstat (limited to 'lisp')
39 files changed, 1163 insertions, 581 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6912fb5d861..7cf0678dcb0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,280 @@ | |||
| 1 | 2004-12-24 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/hideshow.el: Require `cl' when compiling. | ||
| 4 | Remove XEmacs and Emacs 19 compatibility. | ||
| 5 | Use `dolist' and `add-to-list' for load-time actions. | ||
| 6 | (hs-discard-overlays): Use `dolist'. | ||
| 7 | (hs-show-block): Likewise. | ||
| 8 | |||
| 9 | 2004-12-23 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 10 | |||
| 11 | * faces.el (mode-line, mode-line-inactive): Use min-colors. | ||
| 12 | |||
| 13 | 2004-12-23 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 14 | |||
| 15 | * progmodes/hideshow.el (hs-inside-comment-p): Fix omission bug: | ||
| 16 | When extending backwards, move outside the current comment first. | ||
| 17 | |||
| 18 | 2004-12-22 Kenichi Handa <handa@m17n.org> | ||
| 19 | |||
| 20 | * international/quail.el (quail-start-translation): Fix prompt | ||
| 21 | string for the case if input-method-use-echo-area being non-nil. | ||
| 22 | (quail-start-conversion): Likewise. | ||
| 23 | (quail-show-guidance): Don't show guidance if | ||
| 24 | input-method-use-echo-area is non-nil. | ||
| 25 | |||
| 26 | 2004-12-21 Richard M. Stallman <rms@gnu.org> | ||
| 27 | |||
| 28 | * textmodes/ispell.el (ispell-help): Bind resize-mini-windows. | ||
| 29 | |||
| 30 | 2004-12-21 Markus Rost <rost@ias.edu> | ||
| 31 | |||
| 32 | * calendar/diary-lib.el (mark-diary-entries): Set | ||
| 33 | mark-diary-entries-in-calendar only after checking for diary-file. | ||
| 34 | |||
| 35 | 2004-12-21 Richard M. Stallman <rms@gnu.org> | ||
| 36 | |||
| 37 | * faces.el (escape-glyph): Use blue against light foreground. | ||
| 38 | |||
| 39 | * simple.el (undo-outer-limit-truncate): New function. | ||
| 40 | (undo-outer-limit-function): Use undo-outer-limit-truncate. | ||
| 41 | |||
| 42 | 2004-12-21 Eli Barzilay <eli@barzilay.org> | ||
| 43 | |||
| 44 | * calculator.el: (calculator-radix-grouping-mode) | ||
| 45 | (calculator-radix-grouping-digits) | ||
| 46 | (calculator-radix-grouping-separator): | ||
| 47 | New defcustoms for the new radix grouping mode functionality. | ||
| 48 | (calculator-mode-hook): Now used in electric mode too. | ||
| 49 | (calculator-mode-map): Some new keys. | ||
| 50 | (calculator-message): New function. Some new calls. | ||
| 51 | (calculator-string-to-number): New function, | ||
| 52 | (calculator-curnum-value): Use it. | ||
| 53 | (calculator-rotate-displayer, calculator-rotate-displayer-back) | ||
| 54 | (calculator-displayer-prev, calculator-displayer-next): | ||
| 55 | Change digit group size when in radix mode. | ||
| 56 | (calculator-number-to-string): Renamed from calculator-num-to-string. | ||
| 57 | Now deals with digit grouping in radix mode. | ||
| 58 | |||
| 59 | 2004-12-20 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 60 | |||
| 61 | * calendar/calendar.el (view-other-diary-entries): Add autoload. | ||
| 62 | * calendar/diary-lib.el (view-other-diary-entries): Use | ||
| 63 | current-prefix-arg in interactive spec. | ||
| 64 | |||
| 65 | 2004-12-19 Jay Belanger <belanger@truman.edu> | ||
| 66 | |||
| 67 | * calc/calc-aent.el (calcAlg-blank-matching-open): | ||
| 68 | Temporarily adjust the syntax of both delimiters of half-open | ||
| 69 | intervals. | ||
| 70 | |||
| 71 | 2004-12-19 Kim F. Storm <storm@cua.dk> | ||
| 72 | |||
| 73 | * mouse.el (mouse-1-click-follows-link): Doc fix. | ||
| 74 | |||
| 75 | 2004-12-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 76 | |||
| 77 | * term/mac-win.el (encoding-vector, mac-font-encoder-list) | ||
| 78 | (ccl-encode-mac-centraleurroman-font): Use centraleurroman | ||
| 79 | instead of centraleuropean as the name | ||
| 80 | |||
| 81 | 2004-12-17 Michael Albinus <michael.albinus@gmx.de> | ||
| 82 | |||
| 83 | Sync with Tramp 2.0.46. | ||
| 84 | |||
| 85 | * net/tramp.el (tramp-maybe-send-perl-script): Change order of | ||
| 86 | parameters wrt Tramp convention. | ||
| 87 | (tramp-handle-file-attributes-with-perl) | ||
| 88 | (tramp-handle-directory-files-and-attributes): Apply it. | ||
| 89 | (tramp-do-copy-or-rename-file-out-of-band): Check for existence of | ||
| 90 | `copy-program'. Reported by Zack Weinberg | ||
| 91 | <zack@codesourcery.com>. | ||
| 92 | (top): Set `edebug-form-spec' property directly rather than | ||
| 93 | calling `def-edebug-spec'. | ||
| 94 | |||
| 95 | * net/tramp-smb.el (tramp-smb-advice-PC-do-completion): Make the | ||
| 96 | advice less fragile. Surround temporary redefinition of | ||
| 97 | `substitute-in-file-name' with `unwind-protect'. Suggested by | ||
| 98 | Matt Hodges <MPHodges@member.fsf.org>. | ||
| 99 | |||
| 100 | 2004-12-17 Juri Linkov <juri@jurta.org> | ||
| 101 | |||
| 102 | * replace.el (occur-accumulate-lines, occur-engine): | ||
| 103 | Make forcing deferred font-lock fontification jit-specific. | ||
| 104 | |||
| 105 | 2004-12-17 Kim F. Storm <storm@cua.dk> | ||
| 106 | |||
| 107 | * mouse.el (mouse-1-click-follows-link): New defcustom. | ||
| 108 | (mouse-on-link-p): New function. | ||
| 109 | (mouse-drag-region-1): Implement mouse-1-click-follows-link | ||
| 110 | functionality. Map a mouse-1 click event into a mouse-2 (or | ||
| 111 | other) event when position is inside a link. | ||
| 112 | |||
| 113 | * tooltip.el (tooltip-show-help-function): Replace "mouse-2" | ||
| 114 | prefix in tooltip text with "mouse-1" when this is a link | ||
| 115 | recognized by mouse-1-click-follows-link functionality. | ||
| 116 | |||
| 117 | * help.el (describe-key): Report effective and original binding | ||
| 118 | for mouse-1 when clicked on a link. | ||
| 119 | (describe-mode): Add follow-link property to "minor-mode" button. | ||
| 120 | |||
| 121 | * help-fns.el (describe-variable): Add follow-link property to | ||
| 122 | "below" button. | ||
| 123 | |||
| 124 | * help-mode.el (help-xref): Add follow-link property. | ||
| 125 | |||
| 126 | * apropos.el (apropos-symbol, apropos-function, apropos-macro) | ||
| 127 | (apropos-command, apropos-variable, apropos-face, apropos-group) | ||
| 128 | (apropos-widget, apropos-plist): Add follow-link property. | ||
| 129 | |||
| 130 | * pcvs-defs.el (cvs-mode-map): Map follow-link to a function which | ||
| 131 | checks if position is in a filename, rather than some other | ||
| 132 | clickable item. Function looks for cvs-filename-face at position. | ||
| 133 | |||
| 134 | * wid-edit.el (widget-specify-field, widget-specify-button): | ||
| 135 | Map a :follow-link keyword into a follow-link property. | ||
| 136 | (link): Add :follow-link keyword, map to RET binding. | ||
| 137 | |||
| 138 | * dired.el (dired-mode-map): Map follow-link to mouse-face. | ||
| 139 | |||
| 140 | * progmodes/compile.el (compilation-minor-mode-map) | ||
| 141 | (compilation-button-map, compilation-mode-map): Likewise. | ||
| 142 | |||
| 143 | 2004-12-17 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 144 | |||
| 145 | * play/zone.el (zone): Init `line-spacing' from orig buffer. | ||
| 146 | (zone-replace-char): Take `count' and `del-count' | ||
| 147 | instead of `direction'. Update callers. When `del-count' is | ||
| 148 | non-nil, delete that many characters, otherwise `count' characters | ||
| 149 | backwards. Insert the newly-replaced string `count' times. | ||
| 150 | (zone-fret): Handle chars w/ width greater than one. | ||
| 151 | (zone-fall-through-ws): No longer take window width `ww'. | ||
| 152 | Update callers. Add handling for `char-width' greater than one. | ||
| 153 | (zone-pgm-drip): Update var holding window-end position every cycle. | ||
| 154 | |||
| 155 | 2004-12-17 Andre Spiegel <spiegel@gnu.org> | ||
| 156 | |||
| 157 | * vc.el (vc-default-update-changelog): Use insert-file-contents, | ||
| 158 | rather than insert-file. | ||
| 159 | |||
| 160 | 2004-12-16 Jay Belanger <belanger@truman.edu> | ||
| 161 | |||
| 162 | * calc/calc-comb.el (var-RandSeed): Don't initially bind it. | ||
| 163 | (math-init-random-base, math-random-digit): Check to see if | ||
| 164 | var-RandSeed is bound. | ||
| 165 | (math-random-last): Declare it. | ||
| 166 | (math-random-digit): Don't make math-random-last local. | ||
| 167 | |||
| 168 | 2004-12-16 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 169 | |||
| 170 | * play/zone.el (zone): Fix omission bug: Use a self-disabling | ||
| 171 | one-shot thunk for uniform (error, quit, normal) recovery. | ||
| 172 | Reported by John Paul Wallington. | ||
| 173 | (zone-pgm-random-life): Fix bug: | ||
| 174 | Recognize empty initial field by lack of "@" chars. | ||
| 175 | |||
| 176 | 2004-12-16 Juri Linkov <juri@jurta.org> | ||
| 177 | |||
| 178 | * help.el (function-called-at-point): | ||
| 179 | * help-fns.el (variable-at-point): As a last resort try striping | ||
| 180 | non-word prefixes and suffixes. | ||
| 181 | |||
| 182 | * descr-text.el (describe-property-list): Don't treat syntax-table | ||
| 183 | specially. Use describe-text-sexp which inserts [show] button | ||
| 184 | for large objects and handles printing errors. Sort properties | ||
| 185 | by names in alphabetical order instead of by value sizes. | ||
| 186 | Add `mouse-face' to list of properties for `describe-face' widget. | ||
| 187 | (describe-char): Mask out face-id from 19 bits of character. | ||
| 188 | Print face-id separately. | ||
| 189 | |||
| 190 | * replace.el (occur-accumulate-lines, occur-engine): | ||
| 191 | Fontify unfontified matching lines in the source buffer | ||
| 192 | before copying them. | ||
| 193 | (occur-engine): Don't put mouse-face on context lines. | ||
| 194 | (occur-next-error): Set point to line beginning/end | ||
| 195 | before searching for prev/next property to skip multiple | ||
| 196 | matches on a line (not supported by occur engine). | ||
| 197 | Remove redundant prefix-numeric-value. | ||
| 198 | |||
| 199 | 2004-12-15 Juri Linkov <juri@jurta.org> | ||
| 200 | |||
| 201 | * replace.el (match): New face. | ||
| 202 | (list-matching-lines-face): Change default from `bold' to `match'. | ||
| 203 | |||
| 204 | * progmodes/grep.el (grep-match-face): New defvar. | ||
| 205 | (grep-mode-font-lock-keywords): Use grep-match-face instead of | ||
| 206 | compilation-column-face to highlight grep matches. | ||
| 207 | |||
| 208 | * apropos.el (apropos-match-face): Change default from | ||
| 209 | `secondary-selection' to `match'. | ||
| 210 | |||
| 211 | * info-look.el (info-lookup-highlight-face): Change default from | ||
| 212 | `highlight' to `match'. | ||
| 213 | |||
| 214 | 2004-12-15 Daniel Pfeiffer <occitan@esperanto.org> | ||
| 215 | |||
| 216 | * progmodes/executable.el (executable-interpret): Eliminate | ||
| 217 | obsolete compile-internal, and switch to comint for interaction. | ||
| 218 | |||
| 219 | 2004-12-15 J.D. Smith <jdsmith@as.arizona.edu> | ||
| 220 | |||
| 221 | * progmodes/idlwave.el (idlwave-skip-multi-commands): Don't match | ||
| 222 | `&&' when skipping multiple statements on a line. | ||
| 223 | |||
| 224 | 2004-12-15 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 225 | |||
| 226 | * play/zone.el (zone): Set `truncate-lines'. | ||
| 227 | Also, init `tab-width' with value from original buffer. | ||
| 228 | (zone-shift-up): Rewrite for speed. | ||
| 229 | (zone-shift-down, zone-shift-left, zone-shift-right): Likewise. | ||
| 230 | (zone-pgm-jitter): Remove redundant entries from ops vector. | ||
| 231 | (zone-exploding-remove): Reduce iteration count. | ||
| 232 | (zone-cpos): Convert to defsubst. | ||
| 233 | (zone-replace-char): New defsubst. | ||
| 234 | (zone-park/sit-for): Likewise. | ||
| 235 | (zone-fret): Take window-start arg. | ||
| 236 | Update callers. Use `zone-park/sit-for'. | ||
| 237 | (zone-fill-out-screen): Rewrite. | ||
| 238 | (zone-fall-through-ws): Likewise. Update callers. | ||
| 239 | (zone-pgm-drip): Use `zone-replace-char'. | ||
| 240 | Move var inits before while-loop. Use `zone-park/sit-for'. | ||
| 241 | (zone-pgm-random-life): Handle empty initial field. | ||
| 242 | Use `zone-replace-char' and `zone-park/sit-for'. | ||
| 243 | |||
| 244 | 2004-12-15 Juri Linkov <juri@jurta.org> | ||
| 245 | |||
| 246 | * isearch.el (isearch-update): Test isearch-lazy-highlight | ||
| 247 | before calling isearch-lazy-highlight-new-loop. | ||
| 248 | (isearch-lazy-highlight-new-loop): | ||
| 249 | Don't test isearch-lazy-highlight. | ||
| 250 | |||
| 251 | * replace.el (perform-replace): Add isearch-case-fold-search. | ||
| 252 | Use delimited-flag for isearch-regexp. | ||
| 253 | Reset isearch-lazy-highlight-last-string to force lazy | ||
| 254 | highlighting when called from isearch mode. | ||
| 255 | (query-replace-highlight): Revert defcustom type to boolean. | ||
| 256 | (query-replace-lazy-highlight): New defcustom. | ||
| 257 | (query-replace): New face. | ||
| 258 | (perform-replace, replace-highlight, replace-dehighlight): | ||
| 259 | Test query-replace-lazy-highlight instead of special value | ||
| 260 | `isearch' of query-replace-highlight. | ||
| 261 | (replace-dehighlight): Don't call isearch-dehighlight. | ||
| 262 | (replace-highlight): Don't call isearch-highlight. | ||
| 263 | Use face `query-replace' unconditionally. | ||
| 264 | |||
| 265 | 2004-12-14 Kim F. Storm <storm@cua.dk> | ||
| 266 | |||
| 267 | * simple.el (inhibit-mark-movement): Remove defvar. | ||
| 268 | (beginning-of-buffer, end-of-buffer): Don't use it. | ||
| 269 | |||
| 270 | * emacs-lisp/lisp.el (beginning-of-defun, end-of-defun): Don't | ||
| 271 | use inhibit-mark-movement. | ||
| 272 | |||
| 273 | * emulation/cua-base.el (cua--preserve-mark-commands): Remove. | ||
| 274 | (cua--undo-push-mark): Remove. | ||
| 275 | (cua--pre-command-handler, cua--post-command-handler): Don't | ||
| 276 | fiddle with inhibit-mark-movement. | ||
| 277 | |||
| 1 | 2004-12-14 Juri Linkov <juri@jurta.org> | 278 | 2004-12-14 Juri Linkov <juri@jurta.org> |
| 2 | 279 | ||
| 3 | * buff-menu.el (list-buffers-noselect): Collect internal info | 280 | * buff-menu.el (list-buffers-noselect): Collect internal info |
diff --git a/lisp/apropos.el b/lisp/apropos.el index 8bfaa3ad592..1befefe8814 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -96,7 +96,7 @@ turns off mouse highlighting." | |||
| 96 | :group 'apropos | 96 | :group 'apropos |
| 97 | :type 'face) | 97 | :type 'face) |
| 98 | 98 | ||
| 99 | (defcustom apropos-match-face 'secondary-selection | 99 | (defcustom apropos-match-face 'match |
| 100 | "*Face for matching text in Apropos documentation/value, or nil for none. | 100 | "*Face for matching text in Apropos documentation/value, or nil for none. |
| 101 | This applies when you look for matches in the documentation or variable value | 101 | This applies when you look for matches in the documentation or variable value |
| 102 | for the regexp; the part that matches gets displayed in this font." | 102 | for the regexp; the part that matches gets displayed in this font." |
| @@ -163,6 +163,7 @@ term, and the rest of the words are alternative terms.") | |||
| 163 | (define-button-type 'apropos-symbol | 163 | (define-button-type 'apropos-symbol |
| 164 | 'face apropos-symbol-face | 164 | 'face apropos-symbol-face |
| 165 | 'help-echo "mouse-2, RET: Display more help on this symbol" | 165 | 'help-echo "mouse-2, RET: Display more help on this symbol" |
| 166 | 'follow-link t | ||
| 166 | 'action #'apropos-symbol-button-display-help | 167 | 'action #'apropos-symbol-button-display-help |
| 167 | 'skip t) | 168 | 'skip t) |
| 168 | 169 | ||
| @@ -174,19 +175,24 @@ term, and the rest of the words are alternative terms.") | |||
| 174 | 175 | ||
| 175 | (define-button-type 'apropos-function | 176 | (define-button-type 'apropos-function |
| 176 | 'apropos-label "Function" | 177 | 'apropos-label "Function" |
| 178 | 'help-echo "mouse-2, RET: Display more help on this function" | ||
| 179 | 'follow-link t | ||
| 177 | 'action (lambda (button) | 180 | 'action (lambda (button) |
| 178 | (describe-function (button-get button 'apropos-symbol))) | 181 | (describe-function (button-get button 'apropos-symbol)))) |
| 179 | 'help-echo "mouse-2, RET: Display more help on this function") | 182 | |
| 180 | (define-button-type 'apropos-macro | 183 | (define-button-type 'apropos-macro |
| 181 | 'apropos-label "Macro" | 184 | 'apropos-label "Macro" |
| 185 | 'help-echo "mouse-2, RET: Display more help on this macro" | ||
| 186 | 'follow-link t | ||
| 182 | 'action (lambda (button) | 187 | 'action (lambda (button) |
| 183 | (describe-function (button-get button 'apropos-symbol))) | 188 | (describe-function (button-get button 'apropos-symbol)))) |
| 184 | 'help-echo "mouse-2, RET: Display more help on this macro") | 189 | |
| 185 | (define-button-type 'apropos-command | 190 | (define-button-type 'apropos-command |
| 186 | 'apropos-label "Command" | 191 | 'apropos-label "Command" |
| 192 | 'help-echo "mouse-2, RET: Display more help on this command" | ||
| 193 | 'follow-link t | ||
| 187 | 'action (lambda (button) | 194 | 'action (lambda (button) |
| 188 | (describe-function (button-get button 'apropos-symbol))) | 195 | (describe-function (button-get button 'apropos-symbol)))) |
| 189 | 'help-echo "mouse-2, RET: Display more help on this command") | ||
| 190 | 196 | ||
| 191 | ;; We used to use `customize-variable-other-window' instead for a | 197 | ;; We used to use `customize-variable-other-window' instead for a |
| 192 | ;; customizable variable, but that is slow. It is better to show an | 198 | ;; customizable variable, but that is slow. It is better to show an |
| @@ -196,18 +202,21 @@ term, and the rest of the words are alternative terms.") | |||
| 196 | (define-button-type 'apropos-variable | 202 | (define-button-type 'apropos-variable |
| 197 | 'apropos-label "Variable" | 203 | 'apropos-label "Variable" |
| 198 | 'help-echo "mouse-2, RET: Display more help on this variable" | 204 | 'help-echo "mouse-2, RET: Display more help on this variable" |
| 205 | 'follow-link t | ||
| 199 | 'action (lambda (button) | 206 | 'action (lambda (button) |
| 200 | (describe-variable (button-get button 'apropos-symbol)))) | 207 | (describe-variable (button-get button 'apropos-symbol)))) |
| 201 | 208 | ||
| 202 | (define-button-type 'apropos-face | 209 | (define-button-type 'apropos-face |
| 203 | 'apropos-label "Face" | 210 | 'apropos-label "Face" |
| 204 | 'help-echo "mouse-2, RET: Display more help on this face" | 211 | 'help-echo "mouse-2, RET: Display more help on this face" |
| 212 | 'follow-link t | ||
| 205 | 'action (lambda (button) | 213 | 'action (lambda (button) |
| 206 | (describe-face (button-get button 'apropos-symbol)))) | 214 | (describe-face (button-get button 'apropos-symbol)))) |
| 207 | 215 | ||
| 208 | (define-button-type 'apropos-group | 216 | (define-button-type 'apropos-group |
| 209 | 'apropos-label "Group" | 217 | 'apropos-label "Group" |
| 210 | 'help-echo "mouse-2, RET: Display more help on this group" | 218 | 'help-echo "mouse-2, RET: Display more help on this group" |
| 219 | 'follow-link t | ||
| 211 | 'action (lambda (button) | 220 | 'action (lambda (button) |
| 212 | (customize-group-other-window | 221 | (customize-group-other-window |
| 213 | (button-get button 'apropos-symbol)))) | 222 | (button-get button 'apropos-symbol)))) |
| @@ -215,12 +224,14 @@ term, and the rest of the words are alternative terms.") | |||
| 215 | (define-button-type 'apropos-widget | 224 | (define-button-type 'apropos-widget |
| 216 | 'apropos-label "Widget" | 225 | 'apropos-label "Widget" |
| 217 | 'help-echo "mouse-2, RET: Display more help on this widget" | 226 | 'help-echo "mouse-2, RET: Display more help on this widget" |
| 227 | 'follow-link t | ||
| 218 | 'action (lambda (button) | 228 | 'action (lambda (button) |
| 219 | (widget-browse-other-window (button-get button 'apropos-symbol)))) | 229 | (widget-browse-other-window (button-get button 'apropos-symbol)))) |
| 220 | 230 | ||
| 221 | (define-button-type 'apropos-plist | 231 | (define-button-type 'apropos-plist |
| 222 | 'apropos-label "Plist" | 232 | 'apropos-label "Plist" |
| 223 | 'help-echo "mouse-2, RET: Display more help on this plist" | 233 | 'help-echo "mouse-2, RET: Display more help on this plist" |
| 234 | 'follow-link t | ||
| 224 | 'action (lambda (button) | 235 | 'action (lambda (button) |
| 225 | (apropos-describe-plist (button-get button 'apropos-symbol)))) | 236 | (apropos-describe-plist (button-get button 'apropos-symbol)))) |
| 226 | 237 | ||
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index c062a822e89..2210435036c 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -410,32 +410,40 @@ T means abort and give an error message.") | |||
| 410 | (exit-minibuffer)))) | 410 | (exit-minibuffer)))) |
| 411 | 411 | ||
| 412 | (defun calcAlg-blink-matching-open () | 412 | (defun calcAlg-blink-matching-open () |
| 413 | (let ((oldpos (point)) | 413 | (let ((rightpt (point)) |
| 414 | (blinkpos nil)) | 414 | (leftpt nil) |
| 415 | (rightchar (preceding-char)) | ||
| 416 | leftchar | ||
| 417 | rightsyntax | ||
| 418 | leftsyntax) | ||
| 415 | (save-excursion | 419 | (save-excursion |
| 416 | (condition-case () | 420 | (condition-case () |
| 417 | (setq blinkpos (scan-sexps oldpos -1)) | 421 | (setq leftpt (scan-sexps rightpt -1) |
| 418 | (error nil))) | 422 | leftchar (char-after leftpt)) |
| 419 | (if (and blinkpos | 423 | (error nil))) |
| 420 | (> oldpos (1+ (point-min))) | 424 | (if (and leftpt |
| 421 | (or (and (= (char-after (1- oldpos)) ?\)) | 425 | (or (and (= rightchar ?\)) |
| 422 | (= (char-after blinkpos) ?\[)) | 426 | (= leftchar ?\[)) |
| 423 | (and (= (char-after (1- oldpos)) ?\]) | 427 | (and (= rightchar ?\]) |
| 424 | (= (char-after blinkpos) ?\())) | 428 | (= leftchar ?\())) |
| 425 | (save-excursion | 429 | (save-excursion |
| 426 | (goto-char blinkpos) | 430 | (goto-char leftpt) |
| 427 | (looking-at ".+\\(\\.\\.\\|\\\\dots\\|\\\\ldots\\)"))) | 431 | (looking-at ".+\\(\\.\\.\\|\\\\dots\\|\\\\ldots\\)"))) |
| 428 | (let ((saved (aref (syntax-table) (char-after blinkpos)))) | 432 | (let ((leftsaved (aref (syntax-table) leftchar)) |
| 429 | (unwind-protect | 433 | (rightsaved (aref (syntax-table) rightchar))) |
| 430 | (progn | 434 | (unwind-protect |
| 431 | (aset (syntax-table) (char-after blinkpos) | 435 | (progn |
| 432 | (+ (logand saved 255) | 436 | (cond ((= leftchar ?\[) |
| 433 | (lsh (char-after (1- oldpos)) 8))) | 437 | (aset (syntax-table) leftchar (cons 4 ?\))) |
| 434 | (blink-matching-open)) | 438 | (aset (syntax-table) rightchar (cons 5 ?\[))) |
| 435 | (aset (syntax-table) (char-after blinkpos) saved))) | 439 | (t |
| 440 | (aset (syntax-table) leftchar (cons 4 ?\])) | ||
| 441 | (aset (syntax-table) rightchar (cons 5 ?\()))) | ||
| 442 | (blink-matching-open)) | ||
| 443 | (aset (syntax-table) leftchar leftsaved) | ||
| 444 | (aset (syntax-table) rightchar rightsaved))) | ||
| 436 | (blink-matching-open)))) | 445 | (blink-matching-open)))) |
| 437 | 446 | ||
| 438 | |||
| 439 | (defun calc-alg-digit-entry () | 447 | (defun calc-alg-digit-entry () |
| 440 | (calc-alg-entry | 448 | (calc-alg-entry |
| 441 | (cond ((eq last-command-char ?e) | 449 | (cond ((eq last-command-char ?e) |
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index 24e3e5f182e..adb8fcecce6 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el | |||
| @@ -540,12 +540,12 @@ | |||
| 540 | ;;; Produce a random 10-bit integer, with (random) if no seed provided, | 540 | ;;; Produce a random 10-bit integer, with (random) if no seed provided, |
| 541 | ;;; or else with Numerical Recipes algorithm ran3 / Knuth 3.2.2-A. | 541 | ;;; or else with Numerical Recipes algorithm ran3 / Knuth 3.2.2-A. |
| 542 | 542 | ||
| 543 | (defvar var-RandSeed nil) | 543 | (defvar var-RandSeed) |
| 544 | (defvar math-random-cache nil) | 544 | (defvar math-random-cache nil) |
| 545 | (defvar math-gaussian-cache nil) | 545 | (defvar math-gaussian-cache nil) |
| 546 | 546 | ||
| 547 | (defun math-init-random-base () | 547 | (defun math-init-random-base () |
| 548 | (if var-RandSeed | 548 | (if (and (boundp 'var-RandSeed) var-RandSeed) |
| 549 | (if (eq (car-safe var-RandSeed) 'vec) | 549 | (if (eq (car-safe var-RandSeed) 'vec) |
| 550 | nil | 550 | nil |
| 551 | (if (Math-integerp var-RandSeed) | 551 | (if (Math-integerp var-RandSeed) |
| @@ -599,9 +599,10 @@ | |||
| 599 | ;;; Produce a random digit in the range 0..999. | 599 | ;;; Produce a random digit in the range 0..999. |
| 600 | ;;; Avoid various pitfalls that may lurk in the built-in (random) function! | 600 | ;;; Avoid various pitfalls that may lurk in the built-in (random) function! |
| 601 | ;;; Shuffling algorithm from Numerical Recipes, section 7.1. | 601 | ;;; Shuffling algorithm from Numerical Recipes, section 7.1. |
| 602 | (defvar math-random-last) | ||
| 602 | (defun math-random-digit () | 603 | (defun math-random-digit () |
| 603 | (let (i math-random-last) | 604 | (let (i) |
| 604 | (or (eq var-RandSeed math-last-RandSeed) | 605 | (or (and (boundp 'var-RandSeed) (eq var-RandSeed math-last-RandSeed)) |
| 605 | (math-init-random-base)) | 606 | (math-init-random-base)) |
| 606 | (or math-random-cache | 607 | (or math-random-cache |
| 607 | (progn | 608 | (progn |
diff --git a/lisp/calculator.el b/lisp/calculator.el index a9410ae961c..76ff4053c7f 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Eli Barzilay <eli@barzilay.org> | 5 | ;; Author: Eli Barzilay <eli@barzilay.org> |
| 6 | ;; Keywords: tools, convenience | 6 | ;; Keywords: tools, convenience |
| 7 | ;; Time-stamp: <2002-07-13 01:14:35 eli> | ||
| 7 | 8 | ||
| 8 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 9 | 10 | ||
| @@ -100,6 +101,20 @@ at runtime." | |||
| 100 | :type 'integer | 101 | :type 'integer |
| 101 | :group 'calculator) | 102 | :group 'calculator) |
| 102 | 103 | ||
| 104 | (defcustom calculator-radix-grouping-mode t | ||
| 105 | "*Use digit grouping in radix output mode. | ||
| 106 | If this is set, chunks of `calculator-radix-grouping-digits' characters | ||
| 107 | will be separated by `calculator-radix-grouping-separator' when in radix | ||
| 108 | output mode is active (determined by `calculator-output-radix').") | ||
| 109 | |||
| 110 | (defcustom calculator-radix-grouping-digits 4 | ||
| 111 | "*The number of digits used for grouping display in radix modes. | ||
| 112 | See `calculator-radix-grouping-mode'.") | ||
| 113 | |||
| 114 | (defcustom calculator-radix-grouping-separator "'" | ||
| 115 | "*The separator used in radix grouping display. | ||
| 116 | See `calculator-radix-grouping-mode'.") | ||
| 117 | |||
| 103 | (defcustom calculator-remove-zeros t | 118 | (defcustom calculator-remove-zeros t |
| 104 | "*Non-nil value means delete all redundant zero decimal digits. | 119 | "*Non-nil value means delete all redundant zero decimal digits. |
| 105 | If this value is not t, and not nil, redundant zeros are removed except | 120 | If this value is not t, and not nil, redundant zeros are removed except |
| @@ -163,7 +178,11 @@ Otherwise show as a negative number." | |||
| 163 | :group 'calculator) | 178 | :group 'calculator) |
| 164 | 179 | ||
| 165 | (defcustom calculator-mode-hook nil | 180 | (defcustom calculator-mode-hook nil |
| 166 | "*List of hook functions for `calculator-mode' to run." | 181 | "*List of hook functions for `calculator-mode' to run. |
| 182 | Note: if `calculator-electric-mode' is on, then this hook will get | ||
| 183 | activated in the minibuffer - in that case it should not do much more | ||
| 184 | than local key settings and other effects that will change things | ||
| 185 | outside the scope of calculator related code." | ||
| 167 | :type 'hook | 186 | :type 'hook |
| 168 | :group 'calculator) | 187 | :group 'calculator) |
| 169 | 188 | ||
| @@ -387,7 +406,7 @@ Used for repeating operations in calculator-repR/L.") | |||
| 387 | "oD" "oH" "oX" "oO" "oB") | 406 | "oD" "oH" "oX" "oO" "oB") |
| 388 | (calculator-rotate-displayer "'") | 407 | (calculator-rotate-displayer "'") |
| 389 | (calculator-rotate-displayer-back "\"") | 408 | (calculator-rotate-displayer-back "\"") |
| 390 | (calculator-displayer-pref "{") | 409 | (calculator-displayer-prev "{") |
| 391 | (calculator-displayer-next "}") | 410 | (calculator-displayer-next "}") |
| 392 | (calculator-saved-up [up] [?\C-p]) | 411 | (calculator-saved-up [up] [?\C-p]) |
| 393 | (calculator-saved-down [down] [?\C-n]) | 412 | (calculator-saved-down [down] [?\C-n]) |
| @@ -399,10 +418,10 @@ Used for repeating operations in calculator-repR/L.") | |||
| 399 | (calculator-save-and-quit [(control return)] | 418 | (calculator-save-and-quit [(control return)] |
| 400 | [(control kp-enter)]) | 419 | [(control kp-enter)]) |
| 401 | (calculator-paste [insert] [(shift insert)] | 420 | (calculator-paste [insert] [(shift insert)] |
| 402 | [mouse-2]) | 421 | [paste] [mouse-2] [?\C-y]) |
| 403 | (calculator-clear [delete] [?\C-?] [?\C-d]) | 422 | (calculator-clear [delete] [?\C-?] [?\C-d]) |
| 404 | (calculator-help [?h] [??] [f1] [help]) | 423 | (calculator-help [?h] [??] [f1] [help]) |
| 405 | (calculator-copy [(control insert)]) | 424 | (calculator-copy [(control insert)] [copy]) |
| 406 | (calculator-backspace [backspace]) | 425 | (calculator-backspace [backspace]) |
| 407 | ))) | 426 | ))) |
| 408 | (while p | 427 | (while p |
| @@ -536,7 +555,7 @@ Used for repeating operations in calculator-repR/L.") | |||
| 536 | ,@(mapcar (lambda (x) (nth 1 x)) radix-selectors) | 555 | ,@(mapcar (lambda (x) (nth 1 x)) radix-selectors) |
| 537 | "---" | 556 | "---" |
| 538 | ,@(mapcar (lambda (x) (nth 2 x)) radix-selectors))) | 557 | ,@(mapcar (lambda (x) (nth 2 x)) radix-selectors))) |
| 539 | ("Decimal Dislpay" | 558 | ("Decimal Display" |
| 540 | ,@(mapcar (lambda (d) | 559 | ,@(mapcar (lambda (d) |
| 541 | (vector (cadr d) | 560 | (vector (cadr d) |
| 542 | ;; Note: inserts actual object here | 561 | ;; Note: inserts actual object here |
| @@ -611,10 +630,11 @@ The prompt indicates the current modes: | |||
| 611 | * \"=?\": (? is B/O/H) the display radix (when input is decimal); | 630 | * \"=?\": (? is B/O/H) the display radix (when input is decimal); |
| 612 | * \"??\": (? is D/B/O/H) 1st char for input radix, 2nd for display. | 631 | * \"??\": (? is D/B/O/H) 1st char for input radix, 2nd for display. |
| 613 | 632 | ||
| 614 | Also, the quote character can be used to switch display modes for | 633 | Also, the quote key can be used to switch display modes for decimal |
| 615 | decimal numbers (double-quote rotates back), and the two brace | 634 | numbers (double-quote rotates back), and the two brace characters |
| 616 | characters (\"{\" and \"}\" change display parameters that these | 635 | \(\"{\" and \"}\" change display parameters that these displayers use (if |
| 617 | displayers use (if they handle such). | 636 | they handle such). If output is using any radix mode, then these keys |
| 637 | toggle digit grouping mode and the chunk size. | ||
| 618 | 638 | ||
| 619 | Values can be saved for future reference in either a list of saved | 639 | Values can be saved for future reference in either a list of saved |
| 620 | values, or in registers. | 640 | values, or in registers. |
| @@ -683,6 +703,7 @@ See the documentation for `calculator-mode' for more information." | |||
| 683 | (setq calculator-saved-global-map (current-global-map)) | 703 | (setq calculator-saved-global-map (current-global-map)) |
| 684 | (use-local-map nil) | 704 | (use-local-map nil) |
| 685 | (use-global-map calculator-mode-map) | 705 | (use-global-map calculator-mode-map) |
| 706 | (run-hooks 'calculator-mode-hook) | ||
| 686 | (unwind-protect | 707 | (unwind-protect |
| 687 | (catch 'calculator-done | 708 | (catch 'calculator-done |
| 688 | (Electric-command-loop | 709 | (Electric-command-loop |
| @@ -717,6 +738,12 @@ See the documentation for `calculator-mode' for more information." | |||
| 717 | (if (and calculator-restart-other-mode calculator-electric-mode) | 738 | (if (and calculator-restart-other-mode calculator-electric-mode) |
| 718 | (calculator))) | 739 | (calculator))) |
| 719 | 740 | ||
| 741 | (defun calculator-message (string &rest arguments) | ||
| 742 | "Same as `message', but special handle of electric mode." | ||
| 743 | (apply 'message string arguments) | ||
| 744 | (if calculator-electric-mode | ||
| 745 | (progn (sit-for 1) (message nil)))) | ||
| 746 | |||
| 720 | ;;;--------------------------------------------------------------------- | 747 | ;;;--------------------------------------------------------------------- |
| 721 | ;;; Operators | 748 | ;;; Operators |
| 722 | 749 | ||
| @@ -818,82 +845,116 @@ The string is set not to exceed the screen width." | |||
| 818 | (concat calculator-prompt | 845 | (concat calculator-prompt |
| 819 | (substring prompt (+ trim (length calculator-prompt))))))) | 846 | (substring prompt (+ trim (length calculator-prompt))))))) |
| 820 | 847 | ||
| 821 | (defun calculator-curnum-value () | 848 | (defun calculator-string-to-number (str) |
| 822 | "Get the numeric value of the displayed number string as a float." | 849 | "Convert the given STR to a number, according to the value of |
| 850 | `calculator-input-radix'." | ||
| 823 | (if calculator-input-radix | 851 | (if calculator-input-radix |
| 824 | (let ((radix | 852 | (let ((radix |
| 825 | (cdr (assq calculator-input-radix | 853 | (cdr (assq calculator-input-radix |
| 826 | '((bin . 2) (oct . 8) (hex . 16))))) | 854 | '((bin . 2) (oct . 8) (hex . 16))))) |
| 827 | (i -1) (value 0)) | 855 | (i -1) (value 0) (new-value 0)) |
| 828 | ;; assume valid input (upcased & characters in range) | 856 | ;; assume mostly valid input (e.g., characters in range) |
| 829 | (while (< (setq i (1+ i)) (length calculator-curnum)) | 857 | (while (< (setq i (1+ i)) (length str)) |
| 830 | (setq value | 858 | (setq new-value |
| 831 | (+ (let ((ch (aref calculator-curnum i))) | 859 | (let* ((ch (upcase (aref str i))) |
| 832 | (- ch (if (<= ch ?9) ?0 (- ?A 10)))) | 860 | (n (cond ((< ch ?0) nil) |
| 833 | (* radix value)))) | 861 | ((<= ch ?9) (- ch ?0)) |
| 862 | ((< ch ?A) nil) | ||
| 863 | ((<= ch ?Z) (- ch (- ?A 10))) | ||
| 864 | (t nil)))) | ||
| 865 | (if (and n (<= 0 n) (< n radix)) | ||
| 866 | (+ n (* radix value)) | ||
| 867 | (progn | ||
| 868 | (calculator-message | ||
| 869 | "Warning: Ignoring bad input character `%c'." ch) | ||
| 870 | (sit-for 1) | ||
| 871 | value)))) | ||
| 872 | (if (if (< new-value 0) (> value 0) (< value 0)) | ||
| 873 | (calculator-message "Warning: Overflow in input.")) | ||
| 874 | (setq value new-value)) | ||
| 834 | value) | 875 | value) |
| 835 | (car | 876 | (car (read-from-string |
| 836 | (read-from-string | 877 | (cond ((equal "." str) "0.0") |
| 837 | (cond | 878 | ((string-match "[eE][+-]?$" str) (concat str "0")) |
| 838 | ((equal "." calculator-curnum) | 879 | ((string-match "\\.[0-9]\\|[eE]" str) str) |
| 839 | "0.0") | 880 | ((string-match "\\." str) |
| 840 | ((string-match "[eE][+-]?$" calculator-curnum) | 881 | ;; do this because Emacs reads "23." as an integer |
| 841 | (concat calculator-curnum "0")) | 882 | (concat str "0")) |
| 842 | ((string-match "\\.[0-9]\\|[eE]" calculator-curnum) | 883 | ((stringp str) (concat str ".0")) |
| 843 | calculator-curnum) | 884 | (t "0.0")))))) |
| 844 | ((string-match "\\." calculator-curnum) | 885 | |
| 845 | ;; do this because Emacs reads "23." as an integer | 886 | (defun calculator-curnum-value () |
| 846 | (concat calculator-curnum "0")) | 887 | "Get the numeric value of the displayed number string as a float." |
| 847 | ((stringp calculator-curnum) | 888 | (calculator-string-to-number calculator-curnum)) |
| 848 | (concat calculator-curnum ".0")) | ||
| 849 | (t "0.0")))))) | ||
| 850 | 889 | ||
| 851 | (defun calculator-rotate-displayer (&optional new-disp) | 890 | (defun calculator-rotate-displayer (&optional new-disp) |
| 852 | "Switch to the next displayer on the `calculator-displayers' list. | 891 | "Switch to the next displayer on the `calculator-displayers' list. |
| 853 | Can be called with an optional argument NEW-DISP to force rotation to | 892 | Can be called with an optional argument NEW-DISP to force rotation to |
| 854 | that argument." | 893 | that argument. |
| 894 | If radix output mode is active, toggle digit grouping." | ||
| 855 | (interactive) | 895 | (interactive) |
| 856 | (setq calculator-displayers | 896 | (cond |
| 857 | (if (and new-disp (memq new-disp calculator-displayers)) | 897 | (calculator-output-radix |
| 858 | (let ((tmp nil)) | 898 | (setq calculator-radix-grouping-mode |
| 859 | (while (not (eq (car calculator-displayers) new-disp)) | 899 | (not calculator-radix-grouping-mode)) |
| 860 | (setq tmp (cons (car calculator-displayers) tmp)) | 900 | (calculator-message |
| 861 | (setq calculator-displayers (cdr calculator-displayers))) | 901 | "Digit grouping mode %s." |
| 862 | (setq calculator-displayers | 902 | (if calculator-radix-grouping-mode "ON" "OFF"))) |
| 863 | (nconc calculator-displayers (nreverse tmp)))) | 903 | (t |
| 864 | (nconc (cdr calculator-displayers) | 904 | (setq calculator-displayers |
| 865 | (list (car calculator-displayers))))) | 905 | (if (and new-disp (memq new-disp calculator-displayers)) |
| 866 | (message "Using %s." (cadr (car calculator-displayers))) | 906 | (let ((tmp nil)) |
| 867 | (if calculator-electric-mode | 907 | (while (not (eq (car calculator-displayers) new-disp)) |
| 868 | (progn (sit-for 1) (message nil))) | 908 | (setq tmp (cons (car calculator-displayers) tmp)) |
| 909 | (setq calculator-displayers | ||
| 910 | (cdr calculator-displayers))) | ||
| 911 | (setq calculator-displayers | ||
| 912 | (nconc calculator-displayers (nreverse tmp)))) | ||
| 913 | (nconc (cdr calculator-displayers) | ||
| 914 | (list (car calculator-displayers))))) | ||
| 915 | (calculator-message | ||
| 916 | "Using %s." (cadr (car calculator-displayers))))) | ||
| 869 | (calculator-enter)) | 917 | (calculator-enter)) |
| 870 | 918 | ||
| 871 | (defun calculator-rotate-displayer-back () | 919 | (defun calculator-rotate-displayer-back () |
| 872 | "Like `calculator-rotate-displayer', but rotates modes back." | 920 | "Like `calculator-rotate-displayer', but rotates modes back. |
| 921 | If radix output mode is active, toggle digit grouping." | ||
| 873 | (interactive) | 922 | (interactive) |
| 874 | (calculator-rotate-displayer (car (last calculator-displayers)))) | 923 | (calculator-rotate-displayer (car (last calculator-displayers)))) |
| 875 | 924 | ||
| 876 | (defun calculator-displayer-prev () | 925 | (defun calculator-displayer-prev () |
| 877 | "Send the current displayer function a 'left argument. | 926 | "Send the current displayer function a 'left argument. |
| 878 | This is used to modify display arguments (if the current displayer | 927 | This is used to modify display arguments (if the current displayer |
| 879 | function supports this)." | 928 | function supports this). |
| 929 | If radix output mode is active, increase the grouping size." | ||
| 880 | (interactive) | 930 | (interactive) |
| 881 | (and (car calculator-displayers) | 931 | (if calculator-output-radix |
| 882 | (let ((disp (caar calculator-displayers))) | 932 | (progn (setq calculator-radix-grouping-digits |
| 883 | (cond ((symbolp disp) (funcall disp 'left)) | 933 | (1+ calculator-radix-grouping-digits)) |
| 884 | ((and (consp disp) (eq 'std (car disp))) | 934 | (calculator-enter)) |
| 885 | (calculator-standard-displayer 'left (cadr disp))))))) | 935 | (and (car calculator-displayers) |
| 936 | (let ((disp (caar calculator-displayers))) | ||
| 937 | (cond | ||
| 938 | ((symbolp disp) (funcall disp 'left)) | ||
| 939 | ((and (consp disp) (eq 'std (car disp))) | ||
| 940 | (calculator-standard-displayer 'left (cadr disp)))))))) | ||
| 886 | 941 | ||
| 887 | (defun calculator-displayer-next () | 942 | (defun calculator-displayer-next () |
| 888 | "Send the current displayer function a 'right argument. | 943 | "Send the current displayer function a 'right argument. |
| 889 | This is used to modify display arguments (if the current displayer | 944 | This is used to modify display arguments (if the current displayer |
| 890 | function supports this)." | 945 | function supports this). |
| 946 | If radix output mode is active, decrease the grouping size." | ||
| 891 | (interactive) | 947 | (interactive) |
| 892 | (and (car calculator-displayers) | 948 | (if calculator-output-radix |
| 893 | (let ((disp (caar calculator-displayers))) | 949 | (progn (setq calculator-radix-grouping-digits |
| 894 | (cond ((symbolp disp) (funcall disp 'right)) | 950 | (max 2 (1- calculator-radix-grouping-digits))) |
| 895 | ((and (consp disp) (eq 'std (car disp))) | 951 | (calculator-enter)) |
| 896 | (calculator-standard-displayer 'right (cadr disp))))))) | 952 | (and (car calculator-displayers) |
| 953 | (let ((disp (caar calculator-displayers))) | ||
| 954 | (cond | ||
| 955 | ((symbolp disp) (funcall disp 'right)) | ||
| 956 | ((and (consp disp) (eq 'std (car disp))) | ||
| 957 | (calculator-standard-displayer 'right (cadr disp)))))))) | ||
| 897 | 958 | ||
| 898 | (defun calculator-remove-zeros (numstr) | 959 | (defun calculator-remove-zeros (numstr) |
| 899 | "Get a number string NUMSTR and remove unnecessary zeroes. | 960 | "Get a number string NUMSTR and remove unnecessary zeroes. |
| @@ -995,7 +1056,7 @@ the 'left or 'right when one of the standard modes is used." | |||
| 995 | (calculator-remove-zeros str)) | 1056 | (calculator-remove-zeros str)) |
| 996 | "e" (number-to-string exp)))))) | 1057 | "e" (number-to-string exp)))))) |
| 997 | 1058 | ||
| 998 | (defun calculator-num-to-string (num) | 1059 | (defun calculator-number-to-string (num) |
| 999 | "Convert NUM to a displayable string." | 1060 | "Convert NUM to a displayable string." |
| 1000 | (cond | 1061 | (cond |
| 1001 | ((and (numberp num) calculator-output-radix) | 1062 | ((and (numberp num) calculator-output-radix) |
| @@ -1015,6 +1076,14 @@ the 'left or 'right when one of the standard modes is used." | |||
| 1015 | (?6 . "110") (?7 . "111"))))))) | 1076 | (?6 . "110") (?7 . "111"))))))) |
| 1016 | (string-match "^0*\\(.+\\)" s) | 1077 | (string-match "^0*\\(.+\\)" s) |
| 1017 | (setq str (match-string 1 s)))) | 1078 | (setq str (match-string 1 s)))) |
| 1079 | (if calculator-radix-grouping-mode | ||
| 1080 | (let ((d (/ (length str) calculator-radix-grouping-digits)) | ||
| 1081 | (r (% (length str) calculator-radix-grouping-digits))) | ||
| 1082 | (while (>= (setq d (1- d)) (if (zerop r) 1 0)) | ||
| 1083 | (let ((i (+ r (* d calculator-radix-grouping-digits)))) | ||
| 1084 | (setq str (concat (substring str 0 i) | ||
| 1085 | calculator-radix-grouping-separator | ||
| 1086 | (substring str i))))))) | ||
| 1018 | (upcase | 1087 | (upcase |
| 1019 | (if (and (not calculator-2s-complement) (< num 0)) | 1088 | (if (and (not calculator-2s-complement) (< num 0)) |
| 1020 | (concat "-" str) | 1089 | (concat "-" str) |
| @@ -1051,7 +1120,7 @@ If optional argument FORCE is non-nil, don't use the cached string." | |||
| 1051 | ;; customizable display for a single value | 1120 | ;; customizable display for a single value |
| 1052 | (caar calculator-displayers) | 1121 | (caar calculator-displayers) |
| 1053 | calculator-displayer))) | 1122 | calculator-displayer))) |
| 1054 | (mapconcat 'calculator-num-to-string | 1123 | (mapconcat 'calculator-number-to-string |
| 1055 | (reverse calculator-stack) | 1124 | (reverse calculator-stack) |
| 1056 | " ")) | 1125 | " ")) |
| 1057 | " " | 1126 | " " |
| @@ -1319,9 +1388,8 @@ Optional string argument KEYS will force using it as the keys entered." | |||
| 1319 | (if (not (and op (= -1 (calculator-op-arity op)))) | 1388 | (if (not (and op (= -1 (calculator-op-arity op)))) |
| 1320 | ;;(error "Binary operator without a first operand") | 1389 | ;;(error "Binary operator without a first operand") |
| 1321 | (progn | 1390 | (progn |
| 1322 | (message "Binary operator without a first operand") | 1391 | (calculator-message |
| 1323 | (if calculator-electric-mode | 1392 | "Binary operator without a first operand") |
| 1324 | (progn (sit-for 1) (message nil))) | ||
| 1325 | (throw 'op-error nil))))) | 1393 | (throw 'op-error nil))))) |
| 1326 | (calculator-reduce-stack | 1394 | (calculator-reduce-stack |
| 1327 | (cond ((eq (nth 1 op) '\() 10) | 1395 | (cond ((eq (nth 1 op) '\() 10) |
| @@ -1334,9 +1402,7 @@ Optional string argument KEYS will force using it as the keys entered." | |||
| 1334 | (not (numberp (car calculator-stack))))) | 1402 | (not (numberp (car calculator-stack))))) |
| 1335 | ;;(error "Unterminated expression") | 1403 | ;;(error "Unterminated expression") |
| 1336 | (progn | 1404 | (progn |
| 1337 | (message "Unterminated expression") | 1405 | (calculator-message "Unterminated expression") |
| 1338 | (if calculator-electric-mode | ||
| 1339 | (progn (sit-for 1) (message nil))) | ||
| 1340 | (throw 'op-error nil))) | 1406 | (throw 'op-error nil))) |
| 1341 | (setq calculator-stack (cons op calculator-stack)) | 1407 | (setq calculator-stack (cons op calculator-stack)) |
| 1342 | (calculator-reduce-stack (calculator-op-prec op)) | 1408 | (calculator-reduce-stack (calculator-op-prec op)) |
| @@ -1540,7 +1606,7 @@ Optional string argument KEYS will force using it as the keys entered." | |||
| 1540 | (setcdr as val) | 1606 | (setcdr as val) |
| 1541 | (setq calculator-registers | 1607 | (setq calculator-registers |
| 1542 | (cons (cons reg val) calculator-registers))) | 1608 | (cons (cons reg val) calculator-registers))) |
| 1543 | (message (format "[%c] := %S" reg val)))) | 1609 | (calculator-message "[%c] := %S" reg val))) |
| 1544 | 1610 | ||
| 1545 | (defun calculator-put-value (val) | 1611 | (defun calculator-put-value (val) |
| 1546 | "Paste VAL as if entered. | 1612 | "Paste VAL as if entered. |
| @@ -1552,24 +1618,26 @@ Used by `calculator-paste' and `get-register'." | |||
| 1552 | (progn | 1618 | (progn |
| 1553 | (calculator-clear-fragile) | 1619 | (calculator-clear-fragile) |
| 1554 | (setq calculator-curnum (let ((calculator-displayer "%S")) | 1620 | (setq calculator-curnum (let ((calculator-displayer "%S")) |
| 1555 | (calculator-num-to-string val))) | 1621 | (calculator-number-to-string val))) |
| 1556 | (calculator-update-display)))) | 1622 | (calculator-update-display)))) |
| 1557 | 1623 | ||
| 1558 | (defun calculator-paste () | 1624 | (defun calculator-paste () |
| 1559 | "Paste a value from the `kill-ring'." | 1625 | "Paste a value from the `kill-ring'." |
| 1560 | (interactive) | 1626 | (interactive) |
| 1561 | (calculator-put-value | 1627 | (calculator-put-value |
| 1562 | (let ((str (current-kill 0))) | 1628 | (let ((str (replace-regexp-in-string |
| 1563 | (and calculator-paste-decimals | 1629 | "^ *\\(.+[^ ]\\) *$" "\\1" (current-kill 0)))) |
| 1630 | (and (not calculator-input-radix) | ||
| 1631 | calculator-paste-decimals | ||
| 1564 | (string-match "\\([0-9]+\\)\\(\\.[0-9]+\\)?\\(e[0-9]+\\)?" | 1632 | (string-match "\\([0-9]+\\)\\(\\.[0-9]+\\)?\\(e[0-9]+\\)?" |
| 1565 | str) | 1633 | str) |
| 1566 | (or (match-string 1 str) | 1634 | (or (match-string 1 str) |
| 1567 | (match-string 2 str) | 1635 | (match-string 2 str) |
| 1568 | (match-string 3 str)) | 1636 | (match-string 3 str)) |
| 1569 | (setq str (concat (match-string 1 str) | 1637 | (setq str (concat (or (match-string 1 str) "0") |
| 1570 | (or (match-string 2 str) ".0") | 1638 | (or (match-string 2 str) ".0") |
| 1571 | (match-string 3 str)))) | 1639 | (or (match-string 3 str) "")))) |
| 1572 | (condition-case nil (car (read-from-string str)) | 1640 | (condition-case nil (calculator-string-to-number str) |
| 1573 | (error nil))))) | 1641 | (error nil))))) |
| 1574 | 1642 | ||
| 1575 | (defun calculator-get-register (reg) | 1643 | (defun calculator-get-register (reg) |
| @@ -1678,7 +1746,7 @@ To use this, apply a binary operator (evaluate it), then call this." | |||
| 1678 | (while (> x 0) | 1746 | (while (> x 0) |
| 1679 | (setq r (* r (truncate x))) | 1747 | (setq r (* r (truncate x))) |
| 1680 | (setq x (1- x))) | 1748 | (setq x (1- x))) |
| 1681 | r)) | 1749 | (+ 0.0 r))) |
| 1682 | 1750 | ||
| 1683 | (defun calculator-truncate (n) | 1751 | (defun calculator-truncate (n) |
| 1684 | "Truncate N, return 0 in case of overflow." | 1752 | "Truncate N, return 0 in case of overflow." |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index aa0b3005fad..88d6aee513f 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1660,6 +1660,13 @@ the date indicated by the cursor position in the displayed three-month | |||
| 1660 | calendar." | 1660 | calendar." |
| 1661 | t) | 1661 | t) |
| 1662 | 1662 | ||
| 1663 | (autoload 'view-other-diary-entries "diary-lib" | ||
| 1664 | "Prepare and display buffer of diary entries from an alternative diary file. | ||
| 1665 | Searches for entries that match ARG days, starting with the date indicated | ||
| 1666 | by the cursor position in the displayed three-month calendar. | ||
| 1667 | D-FILE specifies the file to use as the diary file." | ||
| 1668 | t) | ||
| 1669 | |||
| 1663 | (autoload 'calendar-sunrise-sunset "solar" | 1670 | (autoload 'calendar-sunrise-sunset "solar" |
| 1664 | "Local time of sunrise and sunset for date under cursor." | 1671 | "Local time of sunrise and sunset for date under cursor." |
| 1665 | t) | 1672 | t) |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 679c4b991b6..511f82f8f2f 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -80,7 +80,7 @@ Searches for entries that match ARG days, starting with the date indicated | |||
| 80 | by the cursor position in the displayed three-month calendar. | 80 | by the cursor position in the displayed three-month calendar. |
| 81 | D-FILE specifies the file to use as the diary file." | 81 | D-FILE specifies the file to use as the diary file." |
| 82 | (interactive | 82 | (interactive |
| 83 | (list (if arg (prefix-numeric-value arg) 1) | 83 | (list (prefix-numeric-value current-prefix-arg) |
| 84 | (read-file-name "Enter diary file name: " default-directory nil t))) | 84 | (read-file-name "Enter diary file name: " default-directory nil t))) |
| 85 | (let ((diary-file d-file)) | 85 | (let ((diary-file d-file)) |
| 86 | (view-diary-entries arg))) | 86 | (view-diary-entries arg))) |
| @@ -841,11 +841,11 @@ Each entry in the diary file visible in the calendar window is marked. | |||
| 841 | After the entries are marked, the hooks `nongregorian-diary-marking-hook' and | 841 | After the entries are marked, the hooks `nongregorian-diary-marking-hook' and |
| 842 | `mark-diary-entries-hook' are run." | 842 | `mark-diary-entries-hook' are run." |
| 843 | (interactive) | 843 | (interactive) |
| 844 | (setq mark-diary-entries-in-calendar t) | ||
| 845 | (let ((marking-diary-entries t) | 844 | (let ((marking-diary-entries t) |
| 846 | file-glob-attrs marks) | 845 | file-glob-attrs marks) |
| 847 | (save-excursion | 846 | (save-excursion |
| 848 | (set-buffer (find-file-noselect (diary-check-diary-file) t)) | 847 | (set-buffer (find-file-noselect (diary-check-diary-file) t)) |
| 848 | (setq mark-diary-entries-in-calendar t) | ||
| 849 | (message "Marking diary entries...") | 849 | (message "Marking diary entries...") |
| 850 | (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) | 850 | (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) |
| 851 | (let ((d diary-date-forms) | 851 | (let ((d diary-date-forms) |
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 0a5fa799f13..4b41c2501e5 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -104,24 +104,11 @@ The `category', `face' and `font-lock-face' properties are made | |||
| 104 | into widget buttons that call `describe-text-category' or | 104 | into widget buttons that call `describe-text-category' or |
| 105 | `describe-face' when pushed." | 105 | `describe-face' when pushed." |
| 106 | ;; Sort the properties by the size of their value. | 106 | ;; Sort the properties by the size of their value. |
| 107 | (dolist (elt (sort (let ((ret nil) | 107 | (dolist (elt (sort (let (ret) |
| 108 | (key nil) | ||
| 109 | (val nil) | ||
| 110 | (len nil)) | ||
| 111 | (while properties | 108 | (while properties |
| 112 | (setq key (pop properties) | 109 | (push (list (pop properties) (pop properties)) ret)) |
| 113 | val (pop properties) | ||
| 114 | len 0) | ||
| 115 | (unless (or (memq key '(category face font-lock-face | ||
| 116 | syntax-table)) | ||
| 117 | (widgetp val)) | ||
| 118 | (setq val (pp-to-string val) | ||
| 119 | len (length val))) | ||
| 120 | (push (list key val len) ret)) | ||
| 121 | ret) | 110 | ret) |
| 122 | (lambda (a b) | 111 | (lambda (a b) (string< (nth 0 a) (nth 0 b))))) |
| 123 | (< (nth 2 a) | ||
| 124 | (nth 2 b))))) | ||
| 125 | (let ((key (nth 0 elt)) | 112 | (let ((key (nth 0 elt)) |
| 126 | (value (nth 1 elt))) | 113 | (value (nth 1 elt))) |
| 127 | (widget-insert (propertize (format " %-20s " key) | 114 | (widget-insert (propertize (format " %-20s " key) |
| @@ -131,23 +118,15 @@ into widget buttons that call `describe-text-category' or | |||
| 131 | :notify `(lambda (&rest ignore) | 118 | :notify `(lambda (&rest ignore) |
| 132 | (describe-text-category ',value)) | 119 | (describe-text-category ',value)) |
| 133 | (format "%S" value))) | 120 | (format "%S" value))) |
| 134 | ((memq key '(face font-lock-face)) | 121 | ((memq key '(face font-lock-face mouse-face)) |
| 135 | (widget-create 'link | 122 | (widget-create 'link |
| 136 | :notify `(lambda (&rest ignore) | 123 | :notify `(lambda (&rest ignore) |
| 137 | (describe-face ',value)) | 124 | (describe-face ',value)) |
| 138 | (format "%S" value))) | 125 | (format "%S" value))) |
| 139 | ((eq key 'syntax-table) | ||
| 140 | (widget-create 'push-button | ||
| 141 | :tag "show" | ||
| 142 | :action (lambda (widget &optional event) | ||
| 143 | (with-output-to-temp-buffer | ||
| 144 | "*Pp Eval Output*" | ||
| 145 | (pp (widget-get widget :value)))) | ||
| 146 | value)) | ||
| 147 | ((widgetp value) | 126 | ((widgetp value) |
| 148 | (describe-text-widget value)) | 127 | (describe-text-widget value)) |
| 149 | (t | 128 | (t |
| 150 | (widget-insert value)))) | 129 | (describe-text-sexp value)))) |
| 151 | (widget-insert "\n"))) | 130 | (widget-insert "\n"))) |
| 152 | 131 | ||
| 153 | ;;; Describe-Text Commands. | 132 | ;;; Describe-Text Commands. |
| @@ -544,10 +523,17 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 544 | (dotimes (i (length disp-vector)) | 523 | (dotimes (i (length disp-vector)) |
| 545 | (setq char (aref disp-vector i)) | 524 | (setq char (aref disp-vector i)) |
| 546 | (aset disp-vector i | 525 | (aset disp-vector i |
| 547 | (cons char (describe-char-display pos char)))) | 526 | (cons char (describe-char-display |
| 527 | pos (logand char #x7ffff))))) | ||
| 548 | (format "by display table entry [%s] (see below)" | 528 | (format "by display table entry [%s] (see below)" |
| 549 | (mapconcat #'(lambda (x) (format "?%c" (car x))) | 529 | (mapconcat |
| 550 | disp-vector " "))) | 530 | #'(lambda (x) |
| 531 | (if (> (car x) #x7ffff) | ||
| 532 | (format "?%c<face-id=%s>" | ||
| 533 | (logand (car x) #x7ffff) | ||
| 534 | (lsh (car x) -19)) | ||
| 535 | (format "?%c" (car x)))) | ||
| 536 | disp-vector " "))) | ||
| 551 | (composition | 537 | (composition |
| 552 | (let ((from (car composition)) | 538 | (let ((from (car composition)) |
| 553 | (to (nth 1 composition)) | 539 | (to (nth 1 composition)) |
| @@ -618,7 +604,7 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 618 | (progn | 604 | (progn |
| 619 | (insert "these fonts (glyph codes):\n") | 605 | (insert "these fonts (glyph codes):\n") |
| 620 | (dotimes (i (length disp-vector)) | 606 | (dotimes (i (length disp-vector)) |
| 621 | (insert (car (aref disp-vector i)) ?: | 607 | (insert (logand (car (aref disp-vector i)) #x7ffff) ?: |
| 622 | (propertize " " 'display '(space :align-to 5)) | 608 | (propertize " " 'display '(space :align-to 5)) |
| 623 | (if (cdr (aref disp-vector i)) | 609 | (if (cdr (aref disp-vector i)) |
| 624 | (format "%s (0x%02X)" (cadr (aref disp-vector i)) | 610 | (format "%s (0x%02X)" (cadr (aref disp-vector i)) |
diff --git a/lisp/dired.el b/lisp/dired.el index 19ea0768e2b..037bf282eda 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -1104,6 +1104,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." | |||
| 1104 | (let ((map (make-keymap))) | 1104 | (let ((map (make-keymap))) |
| 1105 | (suppress-keymap map) | 1105 | (suppress-keymap map) |
| 1106 | (define-key map [mouse-2] 'dired-mouse-find-file-other-window) | 1106 | (define-key map [mouse-2] 'dired-mouse-find-file-other-window) |
| 1107 | (define-key map [follow-link] 'mouse-face) | ||
| 1107 | ;; Commands to mark or flag certain categories of files | 1108 | ;; Commands to mark or flag certain categories of files |
| 1108 | (define-key map "#" 'dired-flag-auto-save-files) | 1109 | (define-key map "#" 'dired-flag-auto-save-files) |
| 1109 | (define-key map "." 'dired-clean-directory) | 1110 | (define-key map "." 'dired-clean-directory) |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 2f22388d87d..9ba613b267d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -2178,7 +2178,7 @@ list that represents a doc string reference. | |||
| 2178 | (let ((old-load-list current-load-list) | 2178 | (let ((old-load-list current-load-list) |
| 2179 | (args (mapcar 'eval (cdr form)))) | 2179 | (args (mapcar 'eval (cdr form)))) |
| 2180 | (apply 'require args) | 2180 | (apply 'require args) |
| 2181 | ;; Detech (require 'cl) in a way that works even if cl is already loaded. | 2181 | ;; Detect (require 'cl) in a way that works even if cl is already loaded. |
| 2182 | (if (member (car args) '("cl" cl)) | 2182 | (if (member (car args) '("cl" cl)) |
| 2183 | (setq byte-compile-warnings | 2183 | (setq byte-compile-warnings |
| 2184 | (remq 'cl-functions byte-compile-warnings)))) | 2184 | (remq 'cl-functions byte-compile-warnings)))) |
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 090f793c700..82882d6c2b7 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el | |||
| @@ -192,8 +192,7 @@ open-parenthesis, and point ends up at the beginning of the line. | |||
| 192 | If variable `beginning-of-defun-function' is non-nil, its value | 192 | If variable `beginning-of-defun-function' is non-nil, its value |
| 193 | is called as a function to find the defun's beginning." | 193 | is called as a function to find the defun's beginning." |
| 194 | (interactive "p") | 194 | (interactive "p") |
| 195 | (or inhibit-mark-movement | 195 | (or (not (eq this-command 'beginning-of-defun)) |
| 196 | (not (eq this-command 'beginning-of-defun)) | ||
| 197 | (eq last-command 'beginning-of-defun) | 196 | (eq last-command 'beginning-of-defun) |
| 198 | (and transient-mark-mode mark-active) | 197 | (and transient-mark-mode mark-active) |
| 199 | (push-mark)) | 198 | (push-mark)) |
| @@ -245,8 +244,7 @@ matches the open-parenthesis that starts a defun; see function | |||
| 245 | If variable `end-of-defun-function' is non-nil, its value | 244 | If variable `end-of-defun-function' is non-nil, its value |
| 246 | is called as a function to find the defun's end." | 245 | is called as a function to find the defun's end." |
| 247 | (interactive "p") | 246 | (interactive "p") |
| 248 | (or inhibit-mark-movement | 247 | (or (not (eq this-command 'end-of-defun)) |
| 249 | (not (eq this-command 'end-of-defun)) | ||
| 250 | (eq last-command 'end-of-defun) | 248 | (eq last-command 'end-of-defun) |
| 251 | (and transient-mark-mode mark-active) | 249 | (and transient-mark-mode mark-active) |
| 252 | (push-mark)) | 250 | (push-mark)) |
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 523a07d26de..24adae30040 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el | |||
| @@ -1003,14 +1003,6 @@ Extra commands should be added to `cua-movement-commands'") | |||
| 1003 | (defvar cua-movement-commands nil | 1003 | (defvar cua-movement-commands nil |
| 1004 | "User may add additional movement commands to this list.") | 1004 | "User may add additional movement commands to this list.") |
| 1005 | 1005 | ||
| 1006 | (defvar cua--preserve-mark-commands | ||
| 1007 | '(end-of-buffer beginning-of-buffer) | ||
| 1008 | "List of movement commands that move the mark. | ||
| 1009 | CUA will preserve the previous mark position if a mark is already | ||
| 1010 | active before one of these commands is executed.") | ||
| 1011 | |||
| 1012 | (defvar cua--undo-push-mark nil) | ||
| 1013 | |||
| 1014 | ;;; Scrolling commands which does not signal errors at top/bottom | 1006 | ;;; Scrolling commands which does not signal errors at top/bottom |
| 1015 | ;;; of buffer at first key-press (instead moves to top/bottom | 1007 | ;;; of buffer at first key-press (instead moves to top/bottom |
| 1016 | ;;; of buffer). | 1008 | ;;; of buffer). |
| @@ -1100,11 +1092,7 @@ If ARG is the atom `-', scroll upward by nearly full screen." | |||
| 1100 | (aref (if window-system | 1092 | (aref (if window-system |
| 1101 | (this-single-command-raw-keys) | 1093 | (this-single-command-raw-keys) |
| 1102 | (this-single-command-keys)) 0))) | 1094 | (this-single-command-keys)) 0))) |
| 1103 | (if mark-active | 1095 | (unless mark-active |
| 1104 | (if (and (memq this-command cua--preserve-mark-commands) | ||
| 1105 | (not inhibit-mark-movement)) | ||
| 1106 | (setq cua--undo-push-mark t | ||
| 1107 | inhibit-mark-movement t)) | ||
| 1108 | (push-mark-command nil t)) | 1096 | (push-mark-command nil t)) |
| 1109 | (setq cua--last-region-shifted t) | 1097 | (setq cua--last-region-shifted t) |
| 1110 | (setq cua--explicit-region-start nil)) | 1098 | (setq cua--explicit-region-start nil)) |
| @@ -1151,9 +1139,6 @@ If ARG is the atom `-', scroll upward by nearly full screen." | |||
| 1151 | (defun cua--post-command-handler () | 1139 | (defun cua--post-command-handler () |
| 1152 | (condition-case nil | 1140 | (condition-case nil |
| 1153 | (progn | 1141 | (progn |
| 1154 | (when cua--undo-push-mark | ||
| 1155 | (setq cua--undo-push-mark nil | ||
| 1156 | inhibit-mark-movement nil)) | ||
| 1157 | (when cua--global-mark-active | 1142 | (when cua--global-mark-active |
| 1158 | (cua--global-mark-post-command)) | 1143 | (cua--global-mark-post-command)) |
| 1159 | (when (fboundp 'cua--rectangle-post-command) | 1144 | (when (fboundp 'cua--rectangle-post-command) |
diff --git a/lisp/faces.el b/lisp/faces.el index 5a7c119899d..dc4fddd8ae6 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1784,7 +1784,7 @@ created." | |||
| 1784 | 1784 | ||
| 1785 | 1785 | ||
| 1786 | (defface mode-line | 1786 | (defface mode-line |
| 1787 | '((((type x w32 mac) (class color)) | 1787 | '((((class color) (min-colors 88)) |
| 1788 | :box (:line-width -1 :style released-button) | 1788 | :box (:line-width -1 :style released-button) |
| 1789 | :background "grey75" :foreground "black") | 1789 | :background "grey75" :foreground "black") |
| 1790 | (t | 1790 | (t |
| @@ -1797,11 +1797,11 @@ created." | |||
| 1797 | (defface mode-line-inactive | 1797 | (defface mode-line-inactive |
| 1798 | '((default | 1798 | '((default |
| 1799 | :inherit mode-line) | 1799 | :inherit mode-line) |
| 1800 | (((type x w32 mac) (background light) (class color)) | 1800 | (((class color) (min-colors 88) (background light)) |
| 1801 | :weight light | 1801 | :weight light |
| 1802 | :box (:line-width -1 :color "grey75" :style nil) | 1802 | :box (:line-width -1 :color "grey75" :style nil) |
| 1803 | :foreground "grey20" :background "grey90") | 1803 | :foreground "grey20" :background "grey90") |
| 1804 | (((type x w32 mac) (background dark) (class color)) | 1804 | (((class color) (min-colors 88) (background dark) ) |
| 1805 | :weight light | 1805 | :weight light |
| 1806 | :box (:line-width -1 :color "grey40" :style nil) | 1806 | :box (:line-width -1 :color "grey40" :style nil) |
| 1807 | :foreground "grey80" :background "grey30")) | 1807 | :foreground "grey80" :background "grey30")) |
| @@ -2032,8 +2032,8 @@ Note: Other faces cannot inherit from the cursor face." | |||
| 2032 | 2032 | ||
| 2033 | (defface escape-glyph '((((background dark)) :foreground "cyan") | 2033 | (defface escape-glyph '((((background dark)) :foreground "cyan") |
| 2034 | (((type pc)) :foreground "magenta") | 2034 | (((type pc)) :foreground "magenta") |
| 2035 | (t :foreground "dark blue")) | 2035 | (t :foreground "blue")) |
| 2036 | "Face for displaying \\ and ^ in multichar glyphs." | 2036 | "Face for characters displayed as ^-sequences or \-sequences." |
| 2037 | :group 'basic-faces) | 2037 | :group 'basic-faces) |
| 2038 | 2038 | ||
| 2039 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2039 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 518a9903085..bb7b8337f4c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2004-12-17 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * gnus-group.el (gnus-group-mode-map): Map follow-link to mouse-face. | ||
| 4 | |||
| 5 | * gnus-sum.el (gnus-summary-mode-map): Likewise. | ||
| 6 | |||
| 1 | 2004-12-08 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2004-12-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * gnus-art.el (gnus-narrow-to-page): Don't hardcode point-min. | 9 | * gnus-art.el (gnus-narrow-to-page): Don't hardcode point-min. |
| @@ -905,7 +911,7 @@ | |||
| 905 | * gnus-delay.el (gnus-delay-default-hour): Add :version. | 911 | * gnus-delay.el (gnus-delay-default-hour): Add :version. |
| 906 | 912 | ||
| 907 | * gnus-cite.el (gnus-cite-blank-line-after-header) | 913 | * gnus-cite.el (gnus-cite-blank-line-after-header) |
| 908 | (gnus-article-boring-faces): | 914 | (gnus-article-boring-faces): |
| 909 | 915 | ||
| 910 | * gnus-art.el (gnus-buttonized-mime-types) | 916 | * gnus-art.el (gnus-buttonized-mime-types) |
| 911 | (gnus-inhibit-mime-unbuttonizing) | 917 | (gnus-inhibit-mime-unbuttonizing) |
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index b7d0cf9eef4..336b635a6a0 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el | |||
| @@ -591,6 +591,7 @@ simple manner.") | |||
| 591 | "\M-e" gnus-group-edit-group-method | 591 | "\M-e" gnus-group-edit-group-method |
| 592 | "^" gnus-group-enter-server-mode | 592 | "^" gnus-group-enter-server-mode |
| 593 | gnus-mouse-2 gnus-mouse-pick-group | 593 | gnus-mouse-2 gnus-mouse-pick-group |
| 594 | [follow-link] mouse-face | ||
| 594 | "<" beginning-of-buffer | 595 | "<" beginning-of-buffer |
| 595 | ">" end-of-buffer | 596 | ">" end-of-buffer |
| 596 | "\C-c\C-b" gnus-bug | 597 | "\C-c\C-b" gnus-bug |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 0971bb2a265..1f6f5437841 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -1703,6 +1703,7 @@ increase the score of each group you read." | |||
| 1703 | "Q" gnus-summary-exit-no-update | 1703 | "Q" gnus-summary-exit-no-update |
| 1704 | "\C-c\C-i" gnus-info-find-node | 1704 | "\C-c\C-i" gnus-info-find-node |
| 1705 | gnus-mouse-2 gnus-mouse-pick-article | 1705 | gnus-mouse-2 gnus-mouse-pick-article |
| 1706 | [follow-link] mouse-face | ||
| 1706 | "m" gnus-summary-mail-other-window | 1707 | "m" gnus-summary-mail-other-window |
| 1707 | "a" gnus-summary-post-news | 1708 | "a" gnus-summary-post-news |
| 1708 | "i" gnus-summary-news-other-window | 1709 | "i" gnus-summary-news-other-window |
| @@ -5096,7 +5097,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." | |||
| 5096 | 5097 | ||
| 5097 | (when gnus-agent | 5098 | (when gnus-agent |
| 5098 | (gnus-agent-possibly-alter-active group (gnus-active group) info) | 5099 | (gnus-agent-possibly-alter-active group (gnus-active group) info) |
| 5099 | 5100 | ||
| 5100 | (setq gnus-summary-use-undownloaded-faces | 5101 | (setq gnus-summary-use-undownloaded-faces |
| 5101 | (gnus-agent-find-parameter | 5102 | (gnus-agent-find-parameter |
| 5102 | group | 5103 | group |
| @@ -7044,7 +7045,7 @@ If optional argument UNREAD is non-nil, only unread article is selected." | |||
| 7044 | (gnus-summary-goto-subject article t))) | 7045 | (gnus-summary-goto-subject article t))) |
| 7045 | (gnus-summary-limit (append articles gnus-newsgroup-limit)) | 7046 | (gnus-summary-limit (append articles gnus-newsgroup-limit)) |
| 7046 | (gnus-summary-position-point)) | 7047 | (gnus-summary-position-point)) |
| 7047 | 7048 | ||
| 7048 | (defun gnus-summary-goto-subject (article &optional force silent) | 7049 | (defun gnus-summary-goto-subject (article &optional force silent) |
| 7049 | "Go the subject line of ARTICLE. | 7050 | "Go the subject line of ARTICLE. |
| 7050 | If FORCE, also allow jumping to articles not currently shown." | 7051 | If FORCE, also allow jumping to articles not currently shown." |
| @@ -9140,7 +9141,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." | |||
| 9140 | 9141 | ||
| 9141 | ;;;!!!Why is this necessary? | 9142 | ;;;!!!Why is this necessary? |
| 9142 | (set-buffer gnus-summary-buffer) | 9143 | (set-buffer gnus-summary-buffer) |
| 9143 | 9144 | ||
| 9144 | (gnus-summary-goto-subject article) | 9145 | (gnus-summary-goto-subject article) |
| 9145 | (when (eq action 'move) | 9146 | (when (eq action 'move) |
| 9146 | (gnus-summary-mark-article article gnus-canceled-mark)))) | 9147 | (gnus-summary-mark-article article gnus-canceled-mark)))) |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index c06a7b1ee73..f799fbd9be7 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -478,8 +478,13 @@ Return 0 if there is no such symbol." | |||
| 478 | (and (symbolp obj) (boundp obj) obj)))) | 478 | (and (symbolp obj) (boundp obj) obj)))) |
| 479 | (error nil)) | 479 | (error nil)) |
| 480 | (let* ((str (find-tag-default)) | 480 | (let* ((str (find-tag-default)) |
| 481 | (obj (if str (intern str)))) | 481 | (sym (if str (intern-soft str)))) |
| 482 | (and (symbolp obj) (boundp obj) obj)) | 482 | (if (and sym (boundp sym)) |
| 483 | sym | ||
| 484 | (save-match-data | ||
| 485 | (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) | ||
| 486 | (setq sym (intern-soft (match-string 1 str))) | ||
| 487 | (and (boundp sym) sym))))) | ||
| 483 | 0)) | 488 | 0)) |
| 484 | 489 | ||
| 485 | ;;;###autoload | 490 | ;;;###autoload |
| @@ -564,6 +569,7 @@ it is displayed along with the global value." | |||
| 564 | (insert " value is shown ") | 569 | (insert " value is shown ") |
| 565 | (insert-button "below" | 570 | (insert-button "below" |
| 566 | 'action help-button-cache | 571 | 'action help-button-cache |
| 572 | 'follow-link t | ||
| 567 | 'help-echo "mouse-2, RET: show value") | 573 | 'help-echo "mouse-2, RET: show value") |
| 568 | (insert ".\n\n"))) | 574 | (insert ".\n\n"))) |
| 569 | ;; Add a note for variables that have been make-var-buffer-local. | 575 | ;; Add a note for variables that have been make-var-buffer-local. |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index a2dcdf91ed8..e9d3561d251 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -68,6 +68,7 @@ The format is (FUNCTION ARGS...).") | |||
| 68 | ;; Button types used by help | 68 | ;; Button types used by help |
| 69 | 69 | ||
| 70 | (define-button-type 'help-xref | 70 | (define-button-type 'help-xref |
| 71 | 'follow-link t | ||
| 71 | 'action #'help-button-action) | 72 | 'action #'help-button-action) |
| 72 | 73 | ||
| 73 | (defun help-button-action (button) | 74 | (defun help-button-action (button) |
diff --git a/lisp/help.el b/lisp/help.el index 5ec9b1f5299..f5831c9ab3f 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -267,8 +267,13 @@ If that doesn't give a function, return nil." | |||
| 267 | (and (symbolp obj) (fboundp obj) obj)))) | 267 | (and (symbolp obj) (fboundp obj) obj)))) |
| 268 | (error nil)))) | 268 | (error nil)))) |
| 269 | (let* ((str (find-tag-default)) | 269 | (let* ((str (find-tag-default)) |
| 270 | (obj (if str (intern str)))) | 270 | (sym (if str (intern-soft str)))) |
| 271 | (and (symbolp obj) (fboundp obj) obj)))) | 271 | (if (and sym (fboundp sym)) |
| 272 | sym | ||
| 273 | (save-match-data | ||
| 274 | (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) | ||
| 275 | (setq sym (intern-soft (match-string 1 str))) | ||
| 276 | (and (fboundp sym) sym))))))) | ||
| 272 | 277 | ||
| 273 | 278 | ||
| 274 | ;;; `User' help functions | 279 | ;;; `User' help functions |
| @@ -609,17 +614,58 @@ the last key hit are used." | |||
| 609 | (princ "\n which is ") | 614 | (princ "\n which is ") |
| 610 | (describe-function-1 defn) | 615 | (describe-function-1 defn) |
| 611 | (when up-event | 616 | (when up-event |
| 612 | (let ((defn (or (string-key-binding up-event) (key-binding up-event)))) | 617 | (let ((ev (aref up-event 0)) |
| 618 | (descr (key-description up-event)) | ||
| 619 | (hdr "\n\n-------------- up event ---------------\n\n") | ||
| 620 | defn | ||
| 621 | mouse-1-tricky mouse-1-remapped) | ||
| 622 | (when (and (consp ev) | ||
| 623 | (eq (car ev) 'mouse-1) | ||
| 624 | (windowp window) | ||
| 625 | mouse-1-click-follows-link | ||
| 626 | (not (eq mouse-1-click-follows-link 'double)) | ||
| 627 | (with-current-buffer (window-buffer window) | ||
| 628 | (mouse-on-link-p (posn-point (event-start ev))))) | ||
| 629 | (setq mouse-1-tricky (integerp mouse-1-click-follows-link) | ||
| 630 | mouse-1-remapped (or (not mouse-1-tricky) | ||
| 631 | (> mouse-1-click-follows-link 0))) | ||
| 632 | (if mouse-1-remapped | ||
| 633 | (setcar ev 'mouse-2))) | ||
| 634 | (setq defn (or (string-key-binding up-event) (key-binding up-event))) | ||
| 613 | (unless (or (null defn) (integerp defn) (equal defn 'undefined)) | 635 | (unless (or (null defn) (integerp defn) (equal defn 'undefined)) |
| 614 | (princ "\n\n-------------- up event ---------------\n\n") | 636 | (princ (if mouse-1-tricky |
| 615 | (princ (key-description up-event)) | 637 | "\n\n----------------- up-event (short click) ----------------\n\n" |
| 638 | hdr)) | ||
| 639 | (setq hdr nil) | ||
| 640 | (princ descr) | ||
| 616 | (if (windowp window) | 641 | (if (windowp window) |
| 617 | (princ " at that spot")) | 642 | (princ " at that spot")) |
| 643 | (if mouse-1-remapped | ||
| 644 | (princ " is remapped to <mouse-2>\n which" )) | ||
| 618 | (princ " runs the command ") | 645 | (princ " runs the command ") |
| 619 | (prin1 defn) | 646 | (prin1 defn) |
| 620 | (princ "\n which is ") | 647 | (princ "\n which is ") |
| 621 | (describe-function-1 defn)))) | 648 | (describe-function-1 defn)) |
| 622 | (print-help-return-message))))))) | 649 | (when mouse-1-tricky |
| 650 | (setcar ev | ||
| 651 | (if (> mouse-1-click-follows-link 0) 'mouse-1 'mouse-2)) | ||
| 652 | (setq defn (or (string-key-binding up-event) (key-binding up-event))) | ||
| 653 | (unless (or (null defn) (integerp defn) (equal defn 'undefined)) | ||
| 654 | (princ (or hdr | ||
| 655 | "\n\n----------------- up-event (long click) ----------------\n\n")) | ||
| 656 | (princ "Pressing ") | ||
| 657 | (princ descr) | ||
| 658 | (if (windowp window) | ||
| 659 | (princ " at that spot")) | ||
| 660 | (princ (format " for longer than %d milli-seconds\n" | ||
| 661 | (abs mouse-1-click-follows-link))) | ||
| 662 | (if (not mouse-1-remapped) | ||
| 663 | (princ " remaps it to <mouse-2> which" )) | ||
| 664 | (princ " runs the command ") | ||
| 665 | (prin1 defn) | ||
| 666 | (princ "\n which is ") | ||
| 667 | (describe-function-1 defn)))) | ||
| 668 | (print-help-return-message)))))))) | ||
| 623 | 669 | ||
| 624 | 670 | ||
| 625 | (defun describe-mode (&optional buffer) | 671 | (defun describe-mode (&optional buffer) |
| @@ -692,6 +738,7 @@ whose documentation describes the minor mode." | |||
| 692 | (princ " ") | 738 | (princ " ") |
| 693 | (insert-button pretty-minor-mode | 739 | (insert-button pretty-minor-mode |
| 694 | 'action (car help-button-cache) | 740 | 'action (car help-button-cache) |
| 741 | 'follow-link t | ||
| 695 | 'help-echo "mouse-2, RET: show full information") | 742 | 'help-echo "mouse-2, RET: show full information") |
| 696 | (princ (format " minor mode (%s):\n" | 743 | (princ (format " minor mode (%s):\n" |
| 697 | (if indicator | 744 | (if indicator |
diff --git a/lisp/info-look.el b/lisp/info-look.el index 388415ec8c1..bc886f0320c 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el | |||
| @@ -47,7 +47,7 @@ Automatically becomes buffer local when set in any fashion.") | |||
| 47 | "Non-nil means pop up the Info buffer in another window." | 47 | "Non-nil means pop up the Info buffer in another window." |
| 48 | :group 'info-lookup :type 'boolean) | 48 | :group 'info-lookup :type 'boolean) |
| 49 | 49 | ||
| 50 | (defcustom info-lookup-highlight-face 'highlight | 50 | (defcustom info-lookup-highlight-face 'match |
| 51 | "Face for highlighting looked up help items. | 51 | "Face for highlighting looked up help items. |
| 52 | Setting this variable to nil disables highlighting." | 52 | Setting this variable to nil disables highlighting." |
| 53 | :group 'info-lookup :type 'face) | 53 | :group 'info-lookup :type 'face) |
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 2feaaeabf20..6aff3e4f497 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -1359,11 +1359,12 @@ Return the input string." | |||
| 1359 | (while quail-translating | 1359 | (while quail-translating |
| 1360 | (set-buffer-modified-p modified-p) | 1360 | (set-buffer-modified-p modified-p) |
| 1361 | (quail-show-guidance) | 1361 | (quail-show-guidance) |
| 1362 | (let* ((keyseq (read-key-sequence | 1362 | (let* ((prompt (if input-method-use-echo-area |
| 1363 | (and input-method-use-echo-area | 1363 | (format "%s%s %s" |
| 1364 | (concat input-method-previous-message | 1364 | (or input-method-previous-message "") |
| 1365 | quail-current-str)) | 1365 | quail-current-str |
| 1366 | nil nil t)) | 1366 | quail-guidance-str))) |
| 1367 | (keyseq (read-key-sequence prompt nil nil t)) | ||
| 1367 | (cmd (lookup-key (quail-translation-keymap) keyseq))) | 1368 | (cmd (lookup-key (quail-translation-keymap) keyseq))) |
| 1368 | (if (if key | 1369 | (if (if key |
| 1369 | (and (commandp cmd) (not (eq cmd 'quail-other-command))) | 1370 | (and (commandp cmd) (not (eq cmd 'quail-other-command))) |
| @@ -1424,12 +1425,13 @@ Return the input string." | |||
| 1424 | quail-translating t) | 1425 | quail-translating t) |
| 1425 | (quail-setup-overlays nil))) | 1426 | (quail-setup-overlays nil))) |
| 1426 | (quail-show-guidance) | 1427 | (quail-show-guidance) |
| 1427 | (let* ((keyseq (read-key-sequence | 1428 | (let* ((prompt (if input-method-use-echo-area |
| 1428 | (and input-method-use-echo-area | 1429 | (format "%s%s%s %s" |
| 1429 | (concat input-method-previous-message | 1430 | (or input-method-previous-message "") |
| 1430 | quail-conversion-str | 1431 | quail-conversion-str |
| 1431 | quail-current-str)) | 1432 | quail-current-str |
| 1432 | nil nil t)) | 1433 | quail-guidance-str))) |
| 1434 | (keyseq (read-key-sequence prompt nil nil t)) | ||
| 1433 | (cmd (lookup-key (quail-conversion-keymap) keyseq))) | 1435 | (cmd (lookup-key (quail-conversion-keymap) keyseq))) |
| 1434 | (if (if key (commandp cmd) (eq cmd 'quail-self-insert-command)) | 1436 | (if (if key (commandp cmd) (eq cmd 'quail-self-insert-command)) |
| 1435 | (progn | 1437 | (progn |
| @@ -1938,10 +1940,10 @@ minibuffer and the selected frame has no other windows)." | |||
| 1938 | 1940 | ||
| 1939 | ;; Then, show the guidance. | 1941 | ;; Then, show the guidance. |
| 1940 | (when (and (quail-require-guidance-buf) | 1942 | (when (and (quail-require-guidance-buf) |
| 1943 | (not input-method-use-echo-area) | ||
| 1941 | (null unread-command-events) | 1944 | (null unread-command-events) |
| 1942 | (null unread-post-input-method-events)) | 1945 | (null unread-post-input-method-events)) |
| 1943 | (if (or (eq (selected-window) (minibuffer-window)) | 1946 | (if (eq (selected-window) (minibuffer-window)) |
| 1944 | input-method-use-echo-area) | ||
| 1945 | (if (eq (minibuffer-window) (frame-root-window)) | 1947 | (if (eq (minibuffer-window) (frame-root-window)) |
| 1946 | ;; Use another frame. It is sure that we are using some | 1948 | ;; Use another frame. It is sure that we are using some |
| 1947 | ;; window system. | 1949 | ;; window system. |
diff --git a/lisp/isearch.el b/lisp/isearch.el index b15a8f5affe..fb31c3a2587 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -649,7 +649,7 @@ is treated as a regexp. See \\[isearch-forward] for more info." | |||
| 649 | (setq ;; quit-flag nil not for isearch-mode | 649 | (setq ;; quit-flag nil not for isearch-mode |
| 650 | isearch-adjusted nil | 650 | isearch-adjusted nil |
| 651 | isearch-yank-flag nil) | 651 | isearch-yank-flag nil) |
| 652 | (isearch-lazy-highlight-new-loop) | 652 | (if isearch-lazy-highlight (isearch-lazy-highlight-new-loop)) |
| 653 | ;; We must prevent the point moving to the end of composition when a | 653 | ;; We must prevent the point moving to the end of composition when a |
| 654 | ;; part of the composition has just been searched. | 654 | ;; part of the composition has just been searched. |
| 655 | (setq disable-point-adjustment t)) | 655 | (setq disable-point-adjustment t)) |
| @@ -2329,8 +2329,7 @@ is nil. This function is called when exiting an incremental search if | |||
| 2329 | "Cleanup any previous `isearch-lazy-highlight' loop and begin a new one. | 2329 | "Cleanup any previous `isearch-lazy-highlight' loop and begin a new one. |
| 2330 | This happens when `isearch-update' is invoked (which can cause the | 2330 | This happens when `isearch-update' is invoked (which can cause the |
| 2331 | search string to change or the window to scroll)." | 2331 | search string to change or the window to scroll)." |
| 2332 | (when (and isearch-lazy-highlight | 2332 | (when (and (null executing-kbd-macro) |
| 2333 | (null executing-kbd-macro) | ||
| 2334 | (sit-for 0) ;make sure (window-start) is credible | 2333 | (sit-for 0) ;make sure (window-start) is credible |
| 2335 | (or (not (equal isearch-string | 2334 | (or (not (equal isearch-string |
| 2336 | isearch-lazy-highlight-last-string)) | 2335 | isearch-lazy-highlight-last-string)) |
diff --git a/lisp/mouse.el b/lisp/mouse.el index b2fa71dde24..91e2e4ae5c6 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -49,6 +49,39 @@ | |||
| 49 | :version "21.4" | 49 | :version "21.4" |
| 50 | :group 'mouse) | 50 | :group 'mouse) |
| 51 | 51 | ||
| 52 | (defcustom mouse-1-click-follows-link 350 | ||
| 53 | "Non-nil means that clicking Mouse-1 on a link follows the link. | ||
| 54 | |||
| 55 | With the default setting, an ordinary Mouse-1 click on a link | ||
| 56 | performs the same action as Mouse-2 on that link, while a longer | ||
| 57 | Mouse-1 click \(hold down the Mouse-1 button for more than 350 | ||
| 58 | milliseconds) performs the original Mouse-1 binding \(which | ||
| 59 | typically sets point where you click the mouse). | ||
| 60 | |||
| 61 | If value is an integer, the time elapsed between pressing and | ||
| 62 | releasing the mouse button determines whether to follow the link | ||
| 63 | or perform the normal Mouse-1 action (typically set point). | ||
| 64 | The absolute numeric value specifices the maximum duration of a | ||
| 65 | \"short click\" in milliseconds. A positive value means that a | ||
| 66 | short click follows the link, and a longer click performs the | ||
| 67 | normal action. A negative value gives the opposite behaviour. | ||
| 68 | |||
| 69 | If value is `double', a double click follows the link. | ||
| 70 | |||
| 71 | Otherwise, a single Mouse-1 click unconditionally follows the link. | ||
| 72 | |||
| 73 | Note that dragging the mouse never follows the link. | ||
| 74 | |||
| 75 | This feature only works in modes that specifically identify | ||
| 76 | clickable text as links, so it may not work with some external | ||
| 77 | packages. See `mouse-on-link-p' for details." | ||
| 78 | :version "21.4" | ||
| 79 | :type '(choice (const :tag "Disabled" nil) | ||
| 80 | (const :tag "Double click" double) | ||
| 81 | (number :tag "Single click time limit" :value 350) | ||
| 82 | (other :tag "Single click" t)) | ||
| 83 | :group 'mouse) | ||
| 84 | |||
| 52 | 85 | ||
| 53 | ;; Provide a mode-specific menu on a mouse button. | 86 | ;; Provide a mode-specific menu on a mouse button. |
| 54 | 87 | ||
| @@ -733,6 +766,51 @@ If the click is in the echo area, display the `*Messages*' buffer." | |||
| 733 | (run-hooks 'mouse-leave-buffer-hook) | 766 | (run-hooks 'mouse-leave-buffer-hook) |
| 734 | (mouse-drag-region-1 start-event)))) | 767 | (mouse-drag-region-1 start-event)))) |
| 735 | 768 | ||
| 769 | |||
| 770 | (defun mouse-on-link-p (pos) | ||
| 771 | "Return non-nil if POS is on a link in the current buffer. | ||
| 772 | |||
| 773 | A clickable link is identified by one of the following methods: | ||
| 774 | |||
| 775 | 1) If the character at POS has a non-nil `follow-link' text or | ||
| 776 | overlay property, the value of that property is returned. | ||
| 777 | |||
| 778 | 2) If there is a local key-binding or a keybinding at position | ||
| 779 | POS for the `follow-link' event, the binding of that event | ||
| 780 | determines whether POS is inside a link: | ||
| 781 | |||
| 782 | - If the binding is `mouse-face', POS is inside a link if there | ||
| 783 | is a non-nil `mouse-face' property at POS. Return t in this case. | ||
| 784 | |||
| 785 | - If the binding is a function, FUNC, POS is inside a link if | ||
| 786 | the call \(FUNC POS) returns non-nil. Return the return value | ||
| 787 | from that call. | ||
| 788 | |||
| 789 | - Otherwise, return the binding of the `follow-link' binding. | ||
| 790 | |||
| 791 | The return value is interpreted as follows: | ||
| 792 | |||
| 793 | - If it is a string, the mouse-1 event is translated into the | ||
| 794 | first character of the string, i.e. the action of the mouse-1 | ||
| 795 | click is the local or global binding of that character. | ||
| 796 | |||
| 797 | - If it is a vector, the mouse-1 event is translated into the | ||
| 798 | first element of that vector, i.e. the action of the mouse-1 | ||
| 799 | click is the local or global binding of that event. | ||
| 800 | |||
| 801 | - Otherwise, the mouse-1 event is translated into a mouse-2 event | ||
| 802 | at the same position." | ||
| 803 | (or (get-char-property pos 'follow-link) | ||
| 804 | (save-excursion | ||
| 805 | (goto-char pos) | ||
| 806 | (let ((b (key-binding [follow-link] nil t))) | ||
| 807 | (cond | ||
| 808 | ((eq b 'mouse-face) | ||
| 809 | (and (get-char-property pos 'mouse-face) t)) | ||
| 810 | ((functionp b) | ||
| 811 | (funcall b pos)) | ||
| 812 | (t b)))))) | ||
| 813 | |||
| 736 | (defun mouse-drag-region-1 (start-event) | 814 | (defun mouse-drag-region-1 (start-event) |
| 737 | (mouse-minibuffer-check start-event) | 815 | (mouse-minibuffer-check start-event) |
| 738 | (let* ((echo-keystrokes 0) | 816 | (let* ((echo-keystrokes 0) |
| @@ -749,6 +827,7 @@ If the click is in the echo area, display the `*Messages*' buffer." | |||
| 749 | (nth 3 bounds) | 827 | (nth 3 bounds) |
| 750 | ;; Don't count the mode line. | 828 | ;; Don't count the mode line. |
| 751 | (1- (nth 3 bounds)))) | 829 | (1- (nth 3 bounds)))) |
| 830 | on-link remap-double-click | ||
| 752 | (click-count (1- (event-click-count start-event)))) | 831 | (click-count (1- (event-click-count start-event)))) |
| 753 | (setq mouse-selection-click-count click-count) | 832 | (setq mouse-selection-click-count click-count) |
| 754 | (setq mouse-selection-click-count-buffer (current-buffer)) | 833 | (setq mouse-selection-click-count-buffer (current-buffer)) |
| @@ -758,6 +837,13 @@ If the click is in the echo area, display the `*Messages*' buffer." | |||
| 758 | (if (< (point) start-point) | 837 | (if (< (point) start-point) |
| 759 | (goto-char start-point)) | 838 | (goto-char start-point)) |
| 760 | (setq start-point (point)) | 839 | (setq start-point (point)) |
| 840 | (setq on-link (and mouse-1-click-follows-link | ||
| 841 | (mouse-on-link-p start-point))) | ||
| 842 | (setq remap-double-click (and on-link | ||
| 843 | (eq mouse-1-click-follows-link 'double) | ||
| 844 | (= click-count 1))) | ||
| 845 | (if remap-double-click ;; Don't expand mouse overlay in links | ||
| 846 | (setq click-count 0)) | ||
| 761 | (let ((range (mouse-start-end start-point start-point click-count))) | 847 | (let ((range (mouse-start-end start-point start-point click-count))) |
| 762 | (move-overlay mouse-drag-overlay (car range) (nth 1 range) | 848 | (move-overlay mouse-drag-overlay (car range) (nth 1 range) |
| 763 | (window-buffer start-window)) | 849 | (window-buffer start-window)) |
| @@ -880,6 +966,28 @@ If the click is in the echo area, display the `*Messages*' buffer." | |||
| 880 | (or end-point | 966 | (or end-point |
| 881 | (= (window-start start-window) | 967 | (= (window-start start-window) |
| 882 | start-window-start))) | 968 | start-window-start))) |
| 969 | (if (and on-link | ||
| 970 | (not end-point) | ||
| 971 | (consp event) | ||
| 972 | (or remap-double-click | ||
| 973 | (and | ||
| 974 | (not (eq mouse-1-click-follows-link 'double)) | ||
| 975 | (= click-count 0) | ||
| 976 | (= (event-click-count event) 1) | ||
| 977 | (not (input-pending-p)) | ||
| 978 | (or (not (integerp mouse-1-click-follows-link)) | ||
| 979 | (let ((t0 (posn-timestamp (event-start start-event))) | ||
| 980 | (t1 (posn-timestamp (event-end event)))) | ||
| 981 | (and (integerp t0) (integerp t1) | ||
| 982 | (if (> mouse-1-click-follows-link 0) | ||
| 983 | (<= (- t1 t0) mouse-1-click-follows-link) | ||
| 984 | (< (- t0 t1) mouse-1-click-follows-link))))) | ||
| 985 | (or (not double-click-time) | ||
| 986 | (sit-for 0 (if (integerp double-click-time) | ||
| 987 | double-click-time 500) t))))) | ||
| 988 | (if (or (vectorp on-link) (stringp on-link)) | ||
| 989 | (setq event (aref on-link 0)) | ||
| 990 | (setcar event 'mouse-2))) | ||
| 883 | (setq unread-command-events | 991 | (setq unread-command-events |
| 884 | (cons event unread-command-events))))) | 992 | (cons event unread-command-events))))) |
| 885 | (delete-overlay mouse-drag-overlay))))) | 993 | (delete-overlay mouse-drag-overlay))))) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 4628af88178..d0a7cf7b65f 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -1105,9 +1105,11 @@ Return the difference in the format of a time value." | |||
| 1105 | ;; Do `PC-do-completion' without substitution | 1105 | ;; Do `PC-do-completion' without substitution |
| 1106 | (let* (save) | 1106 | (let* (save) |
| 1107 | (fset 'save (symbol-function 'substitute-in-file-name)) | 1107 | (fset 'save (symbol-function 'substitute-in-file-name)) |
| 1108 | (fset 'substitute-in-file-name (symbol-function 'identity)) | 1108 | (unwind-protect |
| 1109 | ad-do-it | 1109 | (progn |
| 1110 | (fset 'substitute-in-file-name (symbol-function 'save))) | 1110 | (fset 'substitute-in-file-name (symbol-function 'identity)) |
| 1111 | ad-do-it) | ||
| 1112 | (fset 'substitute-in-file-name (symbol-function 'save)))) | ||
| 1111 | 1113 | ||
| 1112 | ;; Expand "$" | 1114 | ;; Expand "$" |
| 1113 | (let* ((beg (or (and (functionp 'minibuffer-prompt-end) ; Emacs 21 | 1115 | (let* ((beg (or (and (functionp 'minibuffer-prompt-end) ; Emacs 21 |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b0448fd25e9..34572e98674 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | ;; | 34 | ;; |
| 35 | ;; Notes: | 35 | ;; Notes: |
| 36 | ;; ----- | 36 | ;; ----- |
| 37 | ;; | 37 | ;; |
| 38 | ;; This package only works for Emacs 20 and higher, and for XEmacs 21 | 38 | ;; This package only works for Emacs 20 and higher, and for XEmacs 21 |
| 39 | ;; and higher. (XEmacs 20 is missing the `with-timeout' macro. Emacs | 39 | ;; and higher. (XEmacs 20 is missing the `with-timeout' macro. Emacs |
| 40 | ;; 19 is reported to have other problems. For XEmacs 21, you need the | 40 | ;; 19 is reported to have other problems. For XEmacs 21, you need the |
| @@ -205,7 +205,7 @@ file name, the backup directory is prepended with Tramp file name prefix | |||
| 205 | 205 | ||
| 206 | gives the same backup policy for Tramp files on their hosts like the | 206 | gives the same backup policy for Tramp files on their hosts like the |
| 207 | policy for local files." | 207 | policy for local files." |
| 208 | :type '(repeat | 208 | :type '(repeat |
| 209 | (list (regexp :tag "File regexp") | 209 | (list (regexp :tag "File regexp") |
| 210 | (string :tag "Backup Dir") | 210 | (string :tag "Backup Dir") |
| 211 | (set :inline t | 211 | (set :inline t |
| @@ -506,7 +506,7 @@ This variable defaults to the value of `tramp-encoding-shell'." | |||
| 506 | (tramp-copy-args nil) | 506 | (tramp-copy-args nil) |
| 507 | (tramp-copy-keep-date-arg "-p") | 507 | (tramp-copy-keep-date-arg "-p") |
| 508 | (tramp-password-end-of-line "xy")) ;see docstring for "xy" | 508 | (tramp-password-end-of-line "xy")) ;see docstring for "xy" |
| 509 | ("fcp" | 509 | ("fcp" |
| 510 | (tramp-connection-function tramp-open-connection-rsh) | 510 | (tramp-connection-function tramp-open-connection-rsh) |
| 511 | (tramp-login-program "fsh") | 511 | (tramp-login-program "fsh") |
| 512 | (tramp-copy-program "fcp") | 512 | (tramp-copy-program "fcp") |
| @@ -633,7 +633,7 @@ variable `tramp-methods'." | |||
| 633 | ("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n") | 633 | ("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n") |
| 634 | ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n") | 634 | ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n") |
| 635 | ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n") | 635 | ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n") |
| 636 | ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n") | 636 | ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n") |
| 637 | ("su" tramp-multi-connect-su "su - %u%n") | 637 | ("su" tramp-multi-connect-su "su - %u%n") |
| 638 | ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n")) | 638 | ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n")) |
| 639 | "*List of connection functions for multi-hop methods. | 639 | "*List of connection functions for multi-hop methods. |
| @@ -777,7 +777,7 @@ the info pages.") | |||
| 777 | "sudo" tramp-completion-function-alist-su) | 777 | "sudo" tramp-completion-function-alist-su) |
| 778 | (tramp-set-completion-function | 778 | (tramp-set-completion-function |
| 779 | "multi" nil) | 779 | "multi" nil) |
| 780 | (tramp-set-completion-function | 780 | (tramp-set-completion-function |
| 781 | "scpx" tramp-completion-function-alist-ssh) | 781 | "scpx" tramp-completion-function-alist-ssh) |
| 782 | (tramp-set-completion-function | 782 | (tramp-set-completion-function |
| 783 | "sshx" tramp-completion-function-alist-ssh) | 783 | "sshx" tramp-completion-function-alist-ssh) |
| @@ -1536,9 +1536,9 @@ cat /tmp/tramp.$$ | |||
| 1536 | rm -f /tmp/tramp.$$ | 1536 | rm -f /tmp/tramp.$$ |
| 1537 | }" | 1537 | }" |
| 1538 | "Shell function to implement `uudecode' to standard output. | 1538 | "Shell function to implement `uudecode' to standard output. |
| 1539 | Many systems support `uudecode -o /dev/stdout' for this or | 1539 | Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' |
| 1540 | `uudecode -o -' or `uudecode -p', but some systems don't, and for | 1540 | for this or `uudecode -p', but some systems don't, and for them |
| 1541 | them we have this shell function.") | 1541 | we have this shell function.") |
| 1542 | 1542 | ||
| 1543 | ;; Perl script to implement `file-attributes' in a Lisp `read'able | 1543 | ;; Perl script to implement `file-attributes' in a Lisp `read'able |
| 1544 | ;; output. If you are hacking on this, note that you get *no* output | 1544 | ;; output. If you are hacking on this, note that you get *no* output |
| @@ -1960,10 +1960,9 @@ If VAR is nil, then we bind `v' to the structure and `multi-method', | |||
| 1960 | (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) | 1960 | (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) |
| 1961 | ;; To be activated for debugging containing this macro | 1961 | ;; To be activated for debugging containing this macro |
| 1962 | ;; It works only when VAR is nil. Otherwise, it can be deactivated by | 1962 | ;; It works only when VAR is nil. Otherwise, it can be deactivated by |
| 1963 | ;; (def-edebug-spec with-parsed-tramp-file-name 0) | 1963 | ;; (put 'with-parsed-tramp-file-name 'edebug-form-spec 0) |
| 1964 | ;; I'm too stupid to write a precise SPEC for it. | 1964 | ;; I'm too stupid to write a precise SPEC for it. |
| 1965 | (if (functionp 'def-edebug-spec) | 1965 | (put 'with-parsed-tramp-file-name 'edebug-form-spec t) |
| 1966 | (def-edebug-spec with-parsed-tramp-file-name t)) | ||
| 1967 | 1966 | ||
| 1968 | (defmacro tramp-let-maybe (variable value &rest body) | 1967 | (defmacro tramp-let-maybe (variable value &rest body) |
| 1969 | "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. | 1968 | "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. |
| @@ -2056,7 +2055,7 @@ target of the symlink differ." | |||
| 2056 | (setq filename (tramp-file-name-localname | 2055 | (setq filename (tramp-file-name-localname |
| 2057 | (tramp-dissect-file-name | 2056 | (tramp-dissect-file-name |
| 2058 | (expand-file-name filename))))) | 2057 | (expand-file-name filename))))) |
| 2059 | 2058 | ||
| 2060 | ;; Right, they are on the same host, regardless of user, method, etc. | 2059 | ;; Right, they are on the same host, regardless of user, method, etc. |
| 2061 | ;; We now make the link on the remote machine. This will occur as the user | 2060 | ;; We now make the link on the remote machine. This will occur as the user |
| 2062 | ;; that FILENAME belongs to. | 2061 | ;; that FILENAME belongs to. |
| @@ -2065,7 +2064,7 @@ target of the symlink differ." | |||
| 2065 | l-multi-method l-method l-user l-host | 2064 | l-multi-method l-method l-user l-host |
| 2066 | (format "cd %s && %s -sf %s %s" | 2065 | (format "cd %s && %s -sf %s %s" |
| 2067 | cwd ln | 2066 | cwd ln |
| 2068 | filename | 2067 | filename |
| 2069 | l-localname) | 2068 | l-localname) |
| 2070 | t))))) | 2069 | t))))) |
| 2071 | 2070 | ||
| @@ -2347,9 +2346,9 @@ target of the symlink differ." | |||
| 2347 | "file attributes with perl: %s" | 2346 | "file attributes with perl: %s" |
| 2348 | (tramp-make-tramp-file-name | 2347 | (tramp-make-tramp-file-name |
| 2349 | multi-method method user host localname)) | 2348 | multi-method method user host localname)) |
| 2350 | (tramp-maybe-send-perl-script tramp-perl-file-attributes | 2349 | (tramp-maybe-send-perl-script multi-method method user host |
| 2351 | "tramp_file_attributes" | 2350 | tramp-perl-file-attributes |
| 2352 | multi-method method user host) | 2351 | "tramp_file_attributes") |
| 2353 | (tramp-send-command multi-method method user host | 2352 | (tramp-send-command multi-method method user host |
| 2354 | (format "tramp_file_attributes %s %s" | 2353 | (format "tramp_file_attributes %s %s" |
| 2355 | (tramp-shell-quote-argument localname) id-format)) | 2354 | (tramp-shell-quote-argument localname) id-format)) |
| @@ -2394,7 +2393,12 @@ target of the symlink differ." | |||
| 2394 | ;; This function makes the same assumption as | 2393 | ;; This function makes the same assumption as |
| 2395 | ;; `tramp-handle-set-visited-file-modtime'. | 2394 | ;; `tramp-handle-set-visited-file-modtime'. |
| 2396 | (defun tramp-handle-verify-visited-file-modtime (buf) | 2395 | (defun tramp-handle-verify-visited-file-modtime (buf) |
| 2397 | "Like `verify-visited-file-modtime' for tramp files." | 2396 | "Like `verify-visited-file-modtime' for tramp files. |
| 2397 | At the time `verify-visited-file-modtime' calls this function, we | ||
| 2398 | already know that the buffer is visiting a file and that | ||
| 2399 | `visited-file-modtime' does not return 0. Do not call this | ||
| 2400 | function directly, unless those two cases are already taken care | ||
| 2401 | of." | ||
| 2398 | (with-current-buffer buf | 2402 | (with-current-buffer buf |
| 2399 | ;; There is no file visiting the buffer, or the buffer has no | 2403 | ;; There is no file visiting the buffer, or the buffer has no |
| 2400 | ;; recorded last modification time. | 2404 | ;; recorded last modification time. |
| @@ -2406,7 +2410,7 @@ target of the symlink differ." | |||
| 2406 | (let* ((attr (file-attributes f)) | 2410 | (let* ((attr (file-attributes f)) |
| 2407 | (modtime (nth 5 attr)) | 2411 | (modtime (nth 5 attr)) |
| 2408 | (mt (visited-file-modtime))) | 2412 | (mt (visited-file-modtime))) |
| 2409 | 2413 | ||
| 2410 | (cond | 2414 | (cond |
| 2411 | ;; file exists, and has a known modtime. | 2415 | ;; file exists, and has a known modtime. |
| 2412 | ((and attr (not (equal modtime '(0 0)))) | 2416 | ((and attr (not (equal modtime '(0 0)))) |
| @@ -2689,9 +2693,9 @@ if the remote host can't provide the modtime." | |||
| 2689 | (save-excursion | 2693 | (save-excursion |
| 2690 | (setq directory (tramp-handle-expand-file-name directory)) | 2694 | (setq directory (tramp-handle-expand-file-name directory)) |
| 2691 | (with-parsed-tramp-file-name directory nil | 2695 | (with-parsed-tramp-file-name directory nil |
| 2692 | (tramp-maybe-send-perl-script tramp-perl-directory-files-and-attributes | 2696 | (tramp-maybe-send-perl-script multi-method method user host |
| 2693 | "tramp_directory_files_and_attributes" | 2697 | tramp-perl-directory-files-and-attributes |
| 2694 | multi-method method user host) | 2698 | "tramp_directory_files_and_attributes") |
| 2695 | (tramp-send-command multi-method method user host | 2699 | (tramp-send-command multi-method method user host |
| 2696 | (format "tramp_directory_files_and_attributes %s %s" | 2700 | (format "tramp_directory_files_and_attributes %s %s" |
| 2697 | (tramp-shell-quote-argument localname) | 2701 | (tramp-shell-quote-argument localname) |
| @@ -2753,7 +2757,7 @@ if the remote host can't provide the modtime." | |||
| 2753 | (push (buffer-substring (point) | 2757 | (push (buffer-substring (point) |
| 2754 | (tramp-line-end-position)) | 2758 | (tramp-line-end-position)) |
| 2755 | result)) | 2759 | result)) |
| 2756 | 2760 | ||
| 2757 | (tramp-send-command multi-method method user host "cd") | 2761 | (tramp-send-command multi-method method user host "cd") |
| 2758 | (tramp-wait-for-output) | 2762 | (tramp-wait-for-output) |
| 2759 | 2763 | ||
| @@ -3096,6 +3100,12 @@ be a local filename. The method used must be an out-of-band method." | |||
| 3096 | 3100 | ||
| 3097 | ;; Use an asynchronous process. By this, password can be handled. | 3101 | ;; Use an asynchronous process. By this, password can be handled. |
| 3098 | (save-excursion | 3102 | (save-excursion |
| 3103 | |||
| 3104 | ;; Check for program. | ||
| 3105 | (when (and (fboundp 'executable-find) | ||
| 3106 | (not (executable-find copy-program))) | ||
| 3107 | (error "Cannot find copy program: %s" copy-program)) | ||
| 3108 | |||
| 3099 | (set-buffer trampbuf) | 3109 | (set-buffer trampbuf) |
| 3100 | (setq tramp-current-multi-method multi-method | 3110 | (setq tramp-current-multi-method multi-method |
| 3101 | tramp-current-method method | 3111 | tramp-current-method method |
| @@ -3170,15 +3180,15 @@ This is like `dired-recursive-delete-directory' for tramp files." | |||
| 3170 | 'file-error | 3180 | 'file-error |
| 3171 | (list "Removing old file name" "no such directory" filename))) | 3181 | (list "Removing old file name" "no such directory" filename))) |
| 3172 | ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>) | 3182 | ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>) |
| 3173 | (tramp-send-command multi-method method user host | 3183 | (tramp-send-command multi-method method user host |
| 3174 | (format "rm -r %s" (tramp-shell-quote-argument localname))) | 3184 | (format "rm -r %s" (tramp-shell-quote-argument localname))) |
| 3175 | ;; Wait for the remote system to return to us... | 3185 | ;; Wait for the remote system to return to us... |
| 3176 | ;; This might take a while, allow it plenty of time. | 3186 | ;; This might take a while, allow it plenty of time. |
| 3177 | (tramp-wait-for-output 120) | 3187 | (tramp-wait-for-output 120) |
| 3178 | ;; Make sure that it worked... | 3188 | ;; Make sure that it worked... |
| 3179 | (and (file-exists-p filename) | 3189 | (and (file-exists-p filename) |
| 3180 | (error "Failed to recusively delete %s" filename)))) | 3190 | (error "Failed to recursively delete %s" filename)))) |
| 3181 | 3191 | ||
| 3182 | (defun tramp-handle-dired-call-process (program discard &rest arguments) | 3192 | (defun tramp-handle-dired-call-process (program discard &rest arguments) |
| 3183 | "Like `dired-call-process' for tramp files." | 3193 | "Like `dired-call-process' for tramp files." |
| 3184 | (with-parsed-tramp-file-name default-directory nil | 3194 | (with-parsed-tramp-file-name default-directory nil |
| @@ -3200,7 +3210,7 @@ This is like `dired-recursive-delete-directory' for tramp files." | |||
| 3200 | (tramp-send-command-and-check multi-method method user host nil) | 3210 | (tramp-send-command-and-check multi-method method user host nil) |
| 3201 | (tramp-send-command multi-method method user host "cd") | 3211 | (tramp-send-command multi-method method user host "cd") |
| 3202 | (tramp-wait-for-output))))) | 3212 | (tramp-wait-for-output))))) |
| 3203 | 3213 | ||
| 3204 | (defun tramp-handle-dired-compress-file (file &rest ok-flag) | 3214 | (defun tramp-handle-dired-compress-file (file &rest ok-flag) |
| 3205 | "Like `dired-compress-file' for tramp files." | 3215 | "Like `dired-compress-file' for tramp files." |
| 3206 | ;; OK-FLAG is valid for XEmacs only, but not implemented. | 3216 | ;; OK-FLAG is valid for XEmacs only, but not implemented. |
| @@ -3568,7 +3578,7 @@ This will break if COMMAND prints a newline, followed by the value of | |||
| 3568 | (when (and (numberp buffer) (zerop buffer)) | 3578 | (when (and (numberp buffer) (zerop buffer)) |
| 3569 | (error "Implementation does not handle immediate return")) | 3579 | (error "Implementation does not handle immediate return")) |
| 3570 | (when (consp buffer) (error "Implementation does not handle error files")) | 3580 | (when (consp buffer) (error "Implementation does not handle error files")) |
| 3571 | (shell-command | 3581 | (shell-command |
| 3572 | (mapconcat 'tramp-shell-quote-argument | 3582 | (mapconcat 'tramp-shell-quote-argument |
| 3573 | (cons program args) | 3583 | (cons program args) |
| 3574 | " ") | 3584 | " ") |
| @@ -4250,7 +4260,7 @@ necessary anymore." | |||
| 4250 | ;; `tramp-completion-file-name-regexp-unified' aren't different. | 4260 | ;; `tramp-completion-file-name-regexp-unified' aren't different. |
| 4251 | ;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to | 4261 | ;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to |
| 4252 | ;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'. | 4262 | ;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'. |
| 4253 | ;; Using `last-input-event' is a little bit risky, because completing a file | 4263 | ;; Using `last-input-event' is a little bit risky, because completing a file |
| 4254 | ;; might require loading other files, like "~/.netrc", and for them it | 4264 | ;; might require loading other files, like "~/.netrc", and for them it |
| 4255 | ;; shouldn't be decided based on that variable. On the other hand, those files | 4265 | ;; shouldn't be decided based on that variable. On the other hand, those files |
| 4256 | ;; shouldn't have partial tramp file name syntax. Maybe another variable should | 4266 | ;; shouldn't have partial tramp file name syntax. Maybe another variable should |
| @@ -4354,7 +4364,7 @@ necessary anymore." | |||
| 4354 | (funcall (nth 0 x) (nth 1 x))))) | 4364 | (funcall (nth 0 x) (nth 1 x))))) |
| 4355 | (tramp-get-completion-function m)) | 4365 | (tramp-get-completion-function m)) |
| 4356 | 4366 | ||
| 4357 | (setq result (append result | 4367 | (setq result (append result |
| 4358 | (mapcar | 4368 | (mapcar |
| 4359 | (lambda (x) | 4369 | (lambda (x) |
| 4360 | (tramp-get-completion-user-host | 4370 | (tramp-get-completion-user-host |
| @@ -4395,7 +4405,7 @@ necessary anymore." | |||
| 4395 | ;; [nil nil "x" nil nil] | 4405 | ;; [nil nil "x" nil nil] |
| 4396 | ;; [nil "x" nil nil nil] | 4406 | ;; [nil "x" nil nil nil] |
| 4397 | 4407 | ||
| 4398 | ;; "/x:" "/x:y" "/x:y:" | 4408 | ;; "/x:" "/x:y" "/x:y:" |
| 4399 | ;; [nil nil nil "x" ""] [nil nil nil "x" "y"] [nil "x" nil "y" ""] | 4409 | ;; [nil nil nil "x" ""] [nil nil nil "x" "y"] [nil "x" nil "y" ""] |
| 4400 | ;; "/[x/" "/[x/y" | 4410 | ;; "/[x/" "/[x/y" |
| 4401 | ;; [nil "x" nil "" nil] [nil "x" nil "y" nil] | 4411 | ;; [nil "x" nil "" nil] [nil "x" nil "y" nil] |
| @@ -4769,7 +4779,7 @@ User may be nil." | |||
| 4769 | 4779 | ||
| 4770 | ;;; Internal Functions: | 4780 | ;;; Internal Functions: |
| 4771 | 4781 | ||
| 4772 | (defun tramp-maybe-send-perl-script (script name multi-method method user host) | 4782 | (defun tramp-maybe-send-perl-script (multi-method method user host script name) |
| 4773 | "Define in remote shell function NAME implemented as perl SCRIPT. | 4783 | "Define in remote shell function NAME implemented as perl SCRIPT. |
| 4774 | Only send the definition if it has not already been done. | 4784 | Only send the definition if it has not already been done. |
| 4775 | Function may have 0-3 parameters." | 4785 | Function may have 0-3 parameters." |
| @@ -4864,7 +4874,7 @@ TIME is an Emacs internal time value as returned by `current-time'." | |||
| 4864 | "touch" nil (current-buffer) nil "-t" touch-time file)) | 4874 | "touch" nil (current-buffer) nil "-t" touch-time file)) |
| 4865 | (pop-to-buffer (current-buffer)) | 4875 | (pop-to-buffer (current-buffer)) |
| 4866 | (error "tramp-touch: touch failed")))))) | 4876 | (error "tramp-touch: touch failed")))))) |
| 4867 | 4877 | ||
| 4868 | (defun tramp-buffer-name (multi-method method user host) | 4878 | (defun tramp-buffer-name (multi-method method user host) |
| 4869 | "A name for the connection buffer for USER at HOST using METHOD." | 4879 | "A name for the connection buffer for USER at HOST using METHOD." |
| 4870 | (if multi-method | 4880 | (if multi-method |
| @@ -5022,7 +5032,7 @@ file exists and nonzero exit status otherwise." | |||
| 5022 | (file-exists-p existing) | 5032 | (file-exists-p existing) |
| 5023 | (not (file-exists-p nonexisting)))) | 5033 | (not (file-exists-p nonexisting)))) |
| 5024 | (error "Couldn't find command to check if file exists.")))) | 5034 | (error "Couldn't find command to check if file exists.")))) |
| 5025 | 5035 | ||
| 5026 | 5036 | ||
| 5027 | ;; CCC test ksh or bash found for tilde expansion? | 5037 | ;; CCC test ksh or bash found for tilde expansion? |
| 5028 | (defun tramp-find-shell (multi-method method user host) | 5038 | (defun tramp-find-shell (multi-method method user host) |
| @@ -5121,9 +5131,9 @@ Returns nil if none was found, else the command is returned." | |||
| 5121 | (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path) | 5131 | (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path) |
| 5122 | (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path))) | 5132 | (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path))) |
| 5123 | 5133 | ||
| 5124 | ;; ------------------------------------------------------------ | 5134 | ;; ------------------------------------------------------------ |
| 5125 | ;; -- Functions for establishing connection -- | 5135 | ;; -- Functions for establishing connection -- |
| 5126 | ;; ------------------------------------------------------------ | 5136 | ;; ------------------------------------------------------------ |
| 5127 | 5137 | ||
| 5128 | ;; The following functions are actions to be taken when seeing certain | 5138 | ;; The following functions are actions to be taken when seeing certain |
| 5129 | ;; prompts from the remote host. See the variable | 5139 | ;; prompts from the remote host. See the variable |
| @@ -5364,7 +5374,7 @@ Maybe the different regular expressions need to be tuned. | |||
| 5364 | (when multi-method | 5374 | (when multi-method |
| 5365 | (error "Cannot multi-connect using telnet connection method")) | 5375 | (error "Cannot multi-connect using telnet connection method")) |
| 5366 | (tramp-pre-connection multi-method method user host) | 5376 | (tramp-pre-connection multi-method method user host) |
| 5367 | (tramp-message 7 "Opening connection for %s@%s using %s..." | 5377 | (tramp-message 7 "Opening connection for %s@%s using %s..." |
| 5368 | (or user (user-login-name)) host method) | 5378 | (or user (user-login-name)) host method) |
| 5369 | (let ((process-environment (copy-sequence process-environment))) | 5379 | (let ((process-environment (copy-sequence process-environment))) |
| 5370 | (setenv "TERM" tramp-terminal-type) | 5380 | (setenv "TERM" tramp-terminal-type) |
| @@ -5398,7 +5408,7 @@ Maybe the different regular expressions need to be tuned. | |||
| 5398 | p multi-method method user host) | 5408 | p multi-method method user host) |
| 5399 | (tramp-post-connection multi-method method user host))))) | 5409 | (tramp-post-connection multi-method method user host))))) |
| 5400 | 5410 | ||
| 5401 | 5411 | ||
| 5402 | (defun tramp-open-connection-rsh (multi-method method user host) | 5412 | (defun tramp-open-connection-rsh (multi-method method user host) |
| 5403 | "Open a connection using an rsh METHOD. | 5413 | "Open a connection using an rsh METHOD. |
| 5404 | This starts the command `rsh HOST -l USER'[*], then waits for a remote | 5414 | This starts the command `rsh HOST -l USER'[*], then waits for a remote |
| @@ -5423,7 +5433,7 @@ arguments, and xx will be used as the host name to connect to. | |||
| 5423 | (error "Cannot multi-connect using rsh connection method")) | 5433 | (error "Cannot multi-connect using rsh connection method")) |
| 5424 | (tramp-pre-connection multi-method method user host) | 5434 | (tramp-pre-connection multi-method method user host) |
| 5425 | (if (and user (not (string= user ""))) | 5435 | (if (and user (not (string= user ""))) |
| 5426 | (tramp-message 7 "Opening connection for %s@%s using %s..." | 5436 | (tramp-message 7 "Opening connection for %s@%s using %s..." |
| 5427 | user host method) | 5437 | user host method) |
| 5428 | (tramp-message 7 "Opening connection at %s using %s..." host method)) | 5438 | (tramp-message 7 "Opening connection at %s using %s..." host method)) |
| 5429 | (let ((process-environment (copy-sequence process-environment)) | 5439 | (let ((process-environment (copy-sequence process-environment)) |
| @@ -5452,9 +5462,9 @@ arguments, and xx will be used as the host name to connect to. | |||
| 5452 | (> emacs-major-version 20)) | 5462 | (> emacs-major-version 20)) |
| 5453 | tramp-dos-coding-system)) | 5463 | tramp-dos-coding-system)) |
| 5454 | (p (if (and user (not (string= user ""))) | 5464 | (p (if (and user (not (string= user ""))) |
| 5455 | (apply #'start-process bufnam buf login-program | 5465 | (apply #'start-process bufnam buf login-program |
| 5456 | real-host "-l" user login-args) | 5466 | real-host "-l" user login-args) |
| 5457 | (apply #'start-process bufnam buf login-program | 5467 | (apply #'start-process bufnam buf login-program |
| 5458 | real-host login-args))) | 5468 | real-host login-args))) |
| 5459 | (found nil)) | 5469 | (found nil)) |
| 5460 | (tramp-set-process-query-on-exit-flag p nil) | 5470 | (tramp-set-process-query-on-exit-flag p nil) |
| @@ -5524,10 +5534,10 @@ prompt than you do, so it is not at all unlikely that the variable | |||
| 5524 | tramp-actions-before-shell) | 5534 | tramp-actions-before-shell) |
| 5525 | (tramp-open-connection-setup-interactive-shell | 5535 | (tramp-open-connection-setup-interactive-shell |
| 5526 | p multi-method method user host) | 5536 | p multi-method method user host) |
| 5527 | (tramp-post-connection multi-method method | 5537 | (tramp-post-connection multi-method method |
| 5528 | user host))))) | 5538 | user host))))) |
| 5529 | 5539 | ||
| 5530 | ;; HHH: Not Changed. Multi method. It is not clear to me how this can | 5540 | ;; HHH: Not Changed. Multi method. It is not clear to me how this can |
| 5531 | ;; handle not giving a user name in the "file name". | 5541 | ;; handle not giving a user name in the "file name". |
| 5532 | ;; | 5542 | ;; |
| 5533 | ;; This is more difficult than for the single-hop method. In the | 5543 | ;; This is more difficult than for the single-hop method. In the |
| @@ -5597,7 +5607,7 @@ log in as u2 to h2." | |||
| 5597 | (tramp-post-connection multi-method method user host))))) | 5607 | (tramp-post-connection multi-method method user host))))) |
| 5598 | 5608 | ||
| 5599 | ;; HHH: Changed. Multi method. Don't know how to handle this in the case | 5609 | ;; HHH: Changed. Multi method. Don't know how to handle this in the case |
| 5600 | ;; of no user name provided. Hack to make it work as it did before: | 5610 | ;; of no user name provided. Hack to make it work as it did before: |
| 5601 | ;; changed `user' to `(or user (user-login-name))' in the places where | 5611 | ;; changed `user' to `(or user (user-login-name))' in the places where |
| 5602 | ;; the value is actually used. | 5612 | ;; the value is actually used. |
| 5603 | (defun tramp-multi-connect-telnet (p method user host command) | 5613 | (defun tramp-multi-connect-telnet (p method user host command) |
| @@ -5619,8 +5629,8 @@ If USER is nil, uses the return value of (user-login-name) instead." | |||
| 5619 | (tramp-process-multi-actions p method user host | 5629 | (tramp-process-multi-actions p method user host |
| 5620 | tramp-multi-actions))) | 5630 | tramp-multi-actions))) |
| 5621 | 5631 | ||
| 5622 | ;; HHH: Changed. Multi method. Don't know how to handle this in the case | 5632 | ;; HHH: Changed. Multi method. Don't know how to handle this in the case |
| 5623 | ;; of no user name provided. Hack to make it work as it did before: | 5633 | ;; of no user name provided. Hack to make it work as it did before: |
| 5624 | ;; changed `user' to `(or user (user-login-name))' in the places where | 5634 | ;; changed `user' to `(or user (user-login-name))' in the places where |
| 5625 | ;; the value is actually used. | 5635 | ;; the value is actually used. |
| 5626 | (defun tramp-multi-connect-rlogin (p method user host command) | 5636 | (defun tramp-multi-connect-rlogin (p method user host command) |
| @@ -5645,8 +5655,8 @@ If USER is nil, uses the return value of (user-login-name) instead." | |||
| 5645 | (tramp-process-multi-actions p method user host | 5655 | (tramp-process-multi-actions p method user host |
| 5646 | tramp-multi-actions))) | 5656 | tramp-multi-actions))) |
| 5647 | 5657 | ||
| 5648 | ;; HHH: Changed. Multi method. Don't know how to handle this in the case | 5658 | ;; HHH: Changed. Multi method. Don't know how to handle this in the case |
| 5649 | ;; of no user name provided. Hack to make it work as it did before: | 5659 | ;; of no user name provided. Hack to make it work as it did before: |
| 5650 | ;; changed `user' to `(or user (user-login-name))' in the places where | 5660 | ;; changed `user' to `(or user (user-login-name))' in the places where |
| 5651 | ;; the value is actually used. | 5661 | ;; the value is actually used. |
| 5652 | (defun tramp-multi-connect-su (p method user host command) | 5662 | (defun tramp-multi-connect-su (p method user host command) |
| @@ -6276,7 +6286,7 @@ Sends COMMAND, then waits 30 seconds for shell prompt." | |||
| 6276 | (tramp-barf-if-no-shell-prompt | 6286 | (tramp-barf-if-no-shell-prompt |
| 6277 | nil 30 | 6287 | nil 30 |
| 6278 | "Couldn't `%s', see buffer `%s'" command (buffer-name))) | 6288 | "Couldn't `%s', see buffer `%s'" command (buffer-name))) |
| 6279 | 6289 | ||
| 6280 | (defun tramp-wait-for-output (&optional timeout) | 6290 | (defun tramp-wait-for-output (&optional timeout) |
| 6281 | "Wait for output from remote rsh command." | 6291 | "Wait for output from remote rsh command." |
| 6282 | (let ((proc (get-buffer-process (current-buffer))) | 6292 | (let ((proc (get-buffer-process (current-buffer))) |
| @@ -6609,9 +6619,9 @@ Not actually used. Use `(format \"%o\" i)' instead?" | |||
| 6609 | "")) | 6619 | "")) |
| 6610 | 6620 | ||
| 6611 | 6621 | ||
| 6612 | ;; ------------------------------------------------------------ | 6622 | ;; ------------------------------------------------------------ |
| 6613 | ;; -- TRAMP file names -- | 6623 | ;; -- TRAMP file names -- |
| 6614 | ;; ------------------------------------------------------------ | 6624 | ;; ------------------------------------------------------------ |
| 6615 | ;; Conversion functions between external representation and | 6625 | ;; Conversion functions between external representation and |
| 6616 | ;; internal data structure. Convenience functions for internal | 6626 | ;; internal data structure. Convenience functions for internal |
| 6617 | ;; data structure. | 6627 | ;; data structure. |
| @@ -6622,7 +6632,7 @@ Not actually used. Use `(format \"%o\" i)' instead?" | |||
| 6622 | "Return t iff NAME is a tramp file." | 6632 | "Return t iff NAME is a tramp file." |
| 6623 | (save-match-data | 6633 | (save-match-data |
| 6624 | (string-match tramp-file-name-regexp name))) | 6634 | (string-match tramp-file-name-regexp name))) |
| 6625 | 6635 | ||
| 6626 | ;; HHH: Changed. Used to assign the return value of (user-login-name) | 6636 | ;; HHH: Changed. Used to assign the return value of (user-login-name) |
| 6627 | ;; to the `user' part of the structure if a user name was not | 6637 | ;; to the `user' part of the structure if a user name was not |
| 6628 | ;; provided, now it assigns nil. | 6638 | ;; provided, now it assigns nil. |
| @@ -6675,7 +6685,7 @@ This is MULTI-METHOD, if non-nil. Otherwise, it is METHOD, if non-nil. | |||
| 6675 | If both MULTI-METHOD and METHOD are nil, do a lookup in | 6685 | If both MULTI-METHOD and METHOD are nil, do a lookup in |
| 6676 | `tramp-default-method-alist'." | 6686 | `tramp-default-method-alist'." |
| 6677 | (or multi-method method (tramp-find-default-method user host))) | 6687 | (or multi-method method (tramp-find-default-method user host))) |
| 6678 | 6688 | ||
| 6679 | ;; HHH: Not Changed. Multi method. Will probably not handle the case where | 6689 | ;; HHH: Not Changed. Multi method. Will probably not handle the case where |
| 6680 | ;; a user name is not provided in the "file name" very well. | 6690 | ;; a user name is not provided in the "file name" very well. |
| 6681 | (defun tramp-dissect-multi-file-name (name) | 6691 | (defun tramp-dissect-multi-file-name (name) |
| @@ -6847,7 +6857,7 @@ as default." | |||
| 6847 | (if entry | 6857 | (if entry |
| 6848 | (second entry) | 6858 | (second entry) |
| 6849 | (symbol-value param)))) | 6859 | (symbol-value param)))) |
| 6850 | 6860 | ||
| 6851 | 6861 | ||
| 6852 | ;; Auto saving to a special directory. | 6862 | ;; Auto saving to a special directory. |
| 6853 | 6863 | ||
| @@ -7039,9 +7049,9 @@ exiting if process is running." | |||
| 7039 | process flag))) | 7049 | process flag))) |
| 7040 | 7050 | ||
| 7041 | 7051 | ||
| 7042 | ;; ------------------------------------------------------------ | 7052 | ;; ------------------------------------------------------------ |
| 7043 | ;; -- Kludges section -- | 7053 | ;; -- Kludges section -- |
| 7044 | ;; ------------------------------------------------------------ | 7054 | ;; ------------------------------------------------------------ |
| 7045 | 7055 | ||
| 7046 | ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | 7056 | ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' |
| 7047 | ;; does not deal well with newline characters. Newline is replaced by | 7057 | ;; does not deal well with newline characters. Newline is replaced by |
| @@ -7304,7 +7314,7 @@ report. | |||
| 7304 | ;; strange when doing zerop, we should kill the process and start | 7314 | ;; strange when doing zerop, we should kill the process and start |
| 7305 | ;; again. (Greg Stark) | 7315 | ;; again. (Greg Stark) |
| 7306 | ;; * Add caching for filename completion. (Greg Stark) | 7316 | ;; * Add caching for filename completion. (Greg Stark) |
| 7307 | ;; Of course, this has issues with usability (stale cache bites) | 7317 | ;; Of course, this has issues with usability (stale cache bites) |
| 7308 | ;; -- <daniel@danann.net> | 7318 | ;; -- <daniel@danann.net> |
| 7309 | ;; * Provide a local cache of old versions of remote files for the rsync | 7319 | ;; * Provide a local cache of old versions of remote files for the rsync |
| 7310 | ;; transfer method to use. (Greg Stark) | 7320 | ;; transfer method to use. (Greg Stark) |
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 7456bc1660f..866d6e5647d 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | ;; are auto-frobbed from configure.ac, so you should edit that file and run | 30 | ;; are auto-frobbed from configure.ac, so you should edit that file and run |
| 31 | ;; "autoconf && ./configure" to change them. | 31 | ;; "autoconf && ./configure" to change them. |
| 32 | 32 | ||
| 33 | (defconst tramp-version "2.0.45" | 33 | (defconst tramp-version "2.0.46" |
| 34 | "This version of Tramp.") | 34 | "This version of Tramp.") |
| 35 | 35 | ||
| 36 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" | 36 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" |
diff --git a/lisp/pcvs-defs.el b/lisp/pcvs-defs.el index 6bdd6bb6dd8..27629c5ddc6 100644 --- a/lisp/pcvs-defs.el +++ b/lisp/pcvs-defs.el | |||
| @@ -380,6 +380,8 @@ This variable is buffer local and only used in the *cvs* buffer.") | |||
| 380 | ("+" . cvs-mode-tree) | 380 | ("+" . cvs-mode-tree) |
| 381 | ;; mouse bindings | 381 | ;; mouse bindings |
| 382 | ([mouse-2] . cvs-mode-find-file) | 382 | ([mouse-2] . cvs-mode-find-file) |
| 383 | ([follow-link] . (lambda (pos) | ||
| 384 | (if (eq (get-char-property pos 'face) 'cvs-filename-face) t))) | ||
| 383 | ([(down-mouse-3)] . cvs-menu) | 385 | ([(down-mouse-3)] . cvs-menu) |
| 384 | ;; dired-like bindings | 386 | ;; dired-like bindings |
| 385 | ("\C-o" . cvs-mode-display-file) | 387 | ("\C-o" . cvs-mode-display-file) |
diff --git a/lisp/play/zone.el b/lisp/play/zone.el index e073e343f02..80d0760bed2 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el | |||
| @@ -33,10 +33,11 @@ | |||
| 33 | ;; `zone-programs'. See `zone-call' for higher-ordered zoning. | 33 | ;; `zone-programs'. See `zone-call' for higher-ordered zoning. |
| 34 | 34 | ||
| 35 | ;; WARNING: Not appropriate for Emacs sessions over modems or | 35 | ;; WARNING: Not appropriate for Emacs sessions over modems or |
| 36 | ;; computers as slow as mine. | 36 | ;; computers as slow as mine. |
| 37 | 37 | ||
| 38 | ;; THANKS: Christopher Mayer, Scott Flinchbaugh, Rachel Kalmar, | 38 | ;; THANKS: Christopher Mayer, Scott Flinchbaugh, |
| 39 | ;; Max Froumentin. | 39 | ;; Rachel Kalmar, Max Froumentin, Juri Linkov, |
| 40 | ;; Luigi Panzeri, John Paul Wallington. | ||
| 40 | 41 | ||
| 41 | ;;; Code: | 42 | ;;; Code: |
| 42 | 43 | ||
| @@ -140,19 +141,28 @@ If the element is a function or a list of a function and a number, | |||
| 140 | (window-start))))) | 141 | (window-start))))) |
| 141 | (put 'zone 'orig-buffer (current-buffer)) | 142 | (put 'zone 'orig-buffer (current-buffer)) |
| 142 | (put 'zone 'modeline-hidden-level 0) | 143 | (put 'zone 'modeline-hidden-level 0) |
| 143 | (set-buffer outbuf) | 144 | (switch-to-buffer outbuf) |
| 144 | (setq mode-name "Zone") | 145 | (setq mode-name "Zone") |
| 145 | (erase-buffer) | 146 | (erase-buffer) |
| 147 | (setq buffer-undo-list t | ||
| 148 | truncate-lines t | ||
| 149 | tab-width (zone-orig tab-width) | ||
| 150 | line-spacing (zone-orig line-spacing)) | ||
| 146 | (insert text) | 151 | (insert text) |
| 147 | (switch-to-buffer outbuf) | ||
| 148 | (setq buffer-undo-list t) | ||
| 149 | (untabify (point-min) (point-max)) | 152 | (untabify (point-min) (point-max)) |
| 150 | (set-window-start (selected-window) (point-min)) | 153 | (set-window-start (selected-window) (point-min)) |
| 151 | (set-window-point (selected-window) wp) | 154 | (set-window-point (selected-window) wp) |
| 152 | (sit-for 0 500) | 155 | (sit-for 0 500) |
| 153 | (let ((pgm (elt zone-programs (random (length zone-programs)))) | 156 | (let ((pgm (elt zone-programs (random (length zone-programs)))) |
| 154 | (ct (and f (frame-parameter f 'cursor-type)))) | 157 | (ct (and f (frame-parameter f 'cursor-type))) |
| 155 | (when ct (modify-frame-parameters f '((cursor-type . (bar . 0))))) | 158 | (restore (list '(kill-buffer outbuf)))) |
| 159 | (when ct | ||
| 160 | (modify-frame-parameters f '((cursor-type . (bar . 0)))) | ||
| 161 | (setq restore (cons '(modify-frame-parameters | ||
| 162 | f (list (cons 'cursor-type ct))) | ||
| 163 | restore))) | ||
| 164 | ;; Make `restore' a self-disabling one-shot thunk. | ||
| 165 | (setq restore `(lambda () ,@restore (setq restore nil))) | ||
| 156 | (condition-case nil | 166 | (condition-case nil |
| 157 | (progn | 167 | (progn |
| 158 | (message "Zoning... (%s)" pgm) | 168 | (message "Zoning... (%s)" pgm) |
| @@ -166,14 +176,17 @@ If the element is a function or a list of a function and a number, | |||
| 166 | (zone-call pgm) | 176 | (zone-call pgm) |
| 167 | (message "Zoning...sorry")) | 177 | (message "Zoning...sorry")) |
| 168 | (error | 178 | (error |
| 179 | (funcall restore) | ||
| 169 | (while (not (input-pending-p)) | 180 | (while (not (input-pending-p)) |
| 170 | (message (format "We were zoning when we wrote %s..." pgm)) | 181 | (message (format "We were zoning when we wrote %s..." pgm)) |
| 171 | (sit-for 3) | 182 | (sit-for 3) |
| 172 | (message "...here's hoping we didn't hose your buffer!") | 183 | (message "...here's hoping we didn't hose your buffer!") |
| 173 | (sit-for 3))) | 184 | (sit-for 3))) |
| 174 | (quit (ding) (message "Zoning...sorry"))) | 185 | (quit |
| 175 | (when ct (modify-frame-parameters f (list (cons 'cursor-type ct))))) | 186 | (funcall restore) |
| 176 | (kill-buffer outbuf))) | 187 | (ding) |
| 188 | (message "Zoning...sorry"))) | ||
| 189 | (when restore (funcall restore))))) | ||
| 177 | 190 | ||
| 178 | ;;;; Zone when idle, or not. | 191 | ;;;; Zone when idle, or not. |
| 179 | 192 | ||
| @@ -195,13 +208,11 @@ If the element is a function or a list of a function and a number, | |||
| 195 | (message "I won't zone out any more")) | 208 | (message "I won't zone out any more")) |
| 196 | 209 | ||
| 197 | 210 | ||
| 198 | ;;;; zone-pgm-jitter | 211 | ;;;; jittering |
| 199 | 212 | ||
| 200 | (defun zone-shift-up () | 213 | (defun zone-shift-up () |
| 201 | (let* ((b (point)) | 214 | (let* ((b (point)) |
| 202 | (e (progn | 215 | (e (progn (forward-line 1) (point))) |
| 203 | (end-of-line) | ||
| 204 | (if (looking-at "\n") (1+ (point)) (point)))) | ||
| 205 | (s (buffer-substring b e))) | 216 | (s (buffer-substring b e))) |
| 206 | (delete-region b e) | 217 | (delete-region b e) |
| 207 | (goto-char (point-max)) | 218 | (goto-char (point-max)) |
| @@ -209,48 +220,40 @@ If the element is a function or a list of a function and a number, | |||
| 209 | 220 | ||
| 210 | (defun zone-shift-down () | 221 | (defun zone-shift-down () |
| 211 | (goto-char (point-max)) | 222 | (goto-char (point-max)) |
| 212 | (forward-line -1) | ||
| 213 | (beginning-of-line) | ||
| 214 | (let* ((b (point)) | 223 | (let* ((b (point)) |
| 215 | (e (progn | 224 | (e (progn (forward-line -1) (point))) |
| 216 | (end-of-line) | ||
| 217 | (if (looking-at "\n") (1+ (point)) (point)))) | ||
| 218 | (s (buffer-substring b e))) | 225 | (s (buffer-substring b e))) |
| 219 | (delete-region b e) | 226 | (delete-region b e) |
| 220 | (goto-char (point-min)) | 227 | (goto-char (point-min)) |
| 221 | (insert s))) | 228 | (insert s))) |
| 222 | 229 | ||
| 223 | (defun zone-shift-left () | 230 | (defun zone-shift-left () |
| 224 | (while (not (eobp)) | 231 | (let (s) |
| 225 | (or (eolp) | 232 | (while (not (eobp)) |
| 226 | (let ((c (following-char))) | 233 | (unless (eolp) |
| 227 | (delete-char 1) | 234 | (setq s (buffer-substring (point) (1+ (point)))) |
| 228 | (end-of-line) | 235 | (delete-char 1) |
| 229 | (insert c))) | 236 | (end-of-line) |
| 230 | (forward-line 1))) | 237 | (insert s)) |
| 238 | (forward-char 1)))) | ||
| 231 | 239 | ||
| 232 | (defun zone-shift-right () | 240 | (defun zone-shift-right () |
| 233 | (while (not (eobp)) | 241 | (goto-char (point-max)) |
| 234 | (end-of-line) | 242 | (end-of-line) |
| 235 | (or (bolp) | 243 | (let (s) |
| 236 | (let ((c (preceding-char))) | 244 | (while (not (bobp)) |
| 237 | (delete-backward-char 1) | 245 | (unless (bolp) |
| 238 | (beginning-of-line) | 246 | (setq s (buffer-substring (1- (point)) (point))) |
| 239 | (insert c))) | 247 | (delete-char -1) |
| 240 | (forward-line 1))) | 248 | (beginning-of-line) |
| 249 | (insert s)) | ||
| 250 | (end-of-line 0)))) | ||
| 241 | 251 | ||
| 242 | (defun zone-pgm-jitter () | 252 | (defun zone-pgm-jitter () |
| 243 | (let ((ops [ | 253 | (let ((ops [ |
| 244 | zone-shift-left | 254 | zone-shift-left |
| 245 | zone-shift-left | ||
| 246 | zone-shift-left | ||
| 247 | zone-shift-left | ||
| 248 | zone-shift-right | 255 | zone-shift-right |
| 249 | zone-shift-down | 256 | zone-shift-down |
| 250 | zone-shift-down | ||
| 251 | zone-shift-down | ||
| 252 | zone-shift-down | ||
| 253 | zone-shift-down | ||
| 254 | zone-shift-up | 257 | zone-shift-up |
| 255 | ])) | 258 | ])) |
| 256 | (goto-char (point-min)) | 259 | (goto-char (point-min)) |
| @@ -260,7 +263,7 @@ If the element is a function or a list of a function and a number, | |||
| 260 | (sit-for 0 10)))) | 263 | (sit-for 0 10)))) |
| 261 | 264 | ||
| 262 | 265 | ||
| 263 | ;;;; zone-pgm-whack-chars | 266 | ;;;; whacking chars |
| 264 | 267 | ||
| 265 | (defun zone-pgm-whack-chars () | 268 | (defun zone-pgm-whack-chars () |
| 266 | (let ((tbl (copy-sequence (get 'zone-pgm-whack-chars 'wc-tbl)))) | 269 | (let ((tbl (copy-sequence (get 'zone-pgm-whack-chars 'wc-tbl)))) |
| @@ -280,7 +283,7 @@ If the element is a function or a list of a function and a number, | |||
| 280 | (setq i (1+ i))) | 283 | (setq i (1+ i))) |
| 281 | tbl)) | 284 | tbl)) |
| 282 | 285 | ||
| 283 | ;;;; zone-pgm-dissolve | 286 | ;;;; dissolving |
| 284 | 287 | ||
| 285 | (defun zone-remove-text () | 288 | (defun zone-remove-text () |
| 286 | (let ((working t)) | 289 | (let ((working t)) |
| @@ -305,11 +308,11 @@ If the element is a function or a list of a function and a number, | |||
| 305 | (zone-pgm-jitter)) | 308 | (zone-pgm-jitter)) |
| 306 | 309 | ||
| 307 | 310 | ||
| 308 | ;;;; zone-pgm-explode | 311 | ;;;; exploding |
| 309 | 312 | ||
| 310 | (defun zone-exploding-remove () | 313 | (defun zone-exploding-remove () |
| 311 | (let ((i 0)) | 314 | (let ((i 0)) |
| 312 | (while (< i 20) | 315 | (while (< i 5) |
| 313 | (save-excursion | 316 | (save-excursion |
| 314 | (goto-char (point-min)) | 317 | (goto-char (point-min)) |
| 315 | (while (not (eobp)) | 318 | (while (not (eobp)) |
| @@ -328,7 +331,7 @@ If the element is a function or a list of a function and a number, | |||
| 328 | (zone-pgm-jitter)) | 331 | (zone-pgm-jitter)) |
| 329 | 332 | ||
| 330 | 333 | ||
| 331 | ;;;; zone-pgm-putz-with-case | 334 | ;;;; putzing w/ case |
| 332 | 335 | ||
| 333 | ;; Faster than `zone-pgm-putz-with-case', but not as good: all | 336 | ;; Faster than `zone-pgm-putz-with-case', but not as good: all |
| 334 | ;; instances of the same letter have the same case, which produces a | 337 | ;; instances of the same letter have the same case, which produces a |
| @@ -377,7 +380,7 @@ If the element is a function or a list of a function and a number, | |||
| 377 | (sit-for 0 2))) | 380 | (sit-for 0 2))) |
| 378 | 381 | ||
| 379 | 382 | ||
| 380 | ;;;; zone-pgm-rotate | 383 | ;;;; rotating |
| 381 | 384 | ||
| 382 | (defun zone-line-specs () | 385 | (defun zone-line-specs () |
| 383 | (let (ret) | 386 | (let (ret) |
| @@ -439,66 +442,84 @@ If the element is a function or a list of a function and a number, | |||
| 439 | (zone-pgm-rotate (lambda () (1- (- (random 3)))))) | 442 | (zone-pgm-rotate (lambda () (1- (- (random 3)))))) |
| 440 | 443 | ||
| 441 | 444 | ||
| 442 | ;;;; zone-pgm-drip | 445 | ;;;; dripping |
| 443 | 446 | ||
| 444 | (defun zone-cpos (pos) | 447 | (defsubst zone-cpos (pos) |
| 445 | (buffer-substring pos (1+ pos))) | 448 | (buffer-substring pos (1+ pos))) |
| 446 | 449 | ||
| 447 | (defun zone-fret (pos) | 450 | (defsubst zone-replace-char (count del-count char-as-string new-value) |
| 451 | (delete-char (or del-count (- count))) | ||
| 452 | (aset char-as-string 0 new-value) | ||
| 453 | (dotimes (i count) (insert char-as-string))) | ||
| 454 | |||
| 455 | (defsubst zone-park/sit-for (pos seconds) | ||
| 456 | (let ((p (point))) | ||
| 457 | (goto-char pos) | ||
| 458 | (prog1 (sit-for seconds) | ||
| 459 | (goto-char p)))) | ||
| 460 | |||
| 461 | (defun zone-fret (wbeg pos) | ||
| 448 | (let* ((case-fold-search nil) | 462 | (let* ((case-fold-search nil) |
| 449 | (c-string (zone-cpos pos)) | 463 | (c-string (zone-cpos pos)) |
| 464 | (cw-ceil (ceiling (char-width (aref c-string 0)))) | ||
| 450 | (hmm (cond | 465 | (hmm (cond |
| 451 | ((string-match "[a-z]" c-string) (upcase c-string)) | 466 | ((string-match "[a-z]" c-string) (upcase c-string)) |
| 452 | ((string-match "[A-Z]" c-string) (downcase c-string)) | 467 | ((string-match "[A-Z]" c-string) (downcase c-string)) |
| 453 | (t " ")))) | 468 | (t (propertize " " 'display `(space :width ,cw-ceil)))))) |
| 454 | (do ((i 0 (1+ i)) | 469 | (do ((i 0 (1+ i)) |
| 455 | (wait 0.5 (* wait 0.8))) | 470 | (wait 0.5 (* wait 0.8))) |
| 456 | ((= i 20)) | 471 | ((= i 20)) |
| 457 | (goto-char pos) | 472 | (goto-char pos) |
| 458 | (delete-char 1) | 473 | (delete-char 1) |
| 459 | (insert (if (= 0 (% i 2)) hmm c-string)) | 474 | (insert (if (= 0 (% i 2)) hmm c-string)) |
| 460 | (sit-for wait)) | 475 | (zone-park/sit-for wbeg wait)) |
| 461 | (delete-char -1) (insert c-string))) | 476 | (delete-char -1) (insert c-string))) |
| 462 | 477 | ||
| 463 | (defun zone-fill-out-screen (width height) | 478 | (defun zone-fill-out-screen (width height) |
| 464 | (save-excursion | 479 | (let ((start (window-start)) |
| 465 | (goto-char (point-min)) | 480 | (line (make-string width 32))) |
| 481 | (goto-char start) | ||
| 466 | ;; fill out rectangular ws block | 482 | ;; fill out rectangular ws block |
| 467 | (while (not (eobp)) | 483 | (while (progn (end-of-line) |
| 468 | (end-of-line) | 484 | (let ((cc (current-column))) |
| 469 | (let ((cc (current-column))) | 485 | (if (< cc width) |
| 470 | (if (< cc width) | 486 | (insert (substring line cc)) |
| 471 | (insert (make-string (- width cc) 32)) | 487 | (delete-char (- width cc))) |
| 472 | (delete-char (- width cc)))) | 488 | (cond ((eobp) (insert "\n") nil) |
| 473 | (unless (eobp) | 489 | (t (forward-char 1) t))))) |
| 474 | (forward-char 1))) | ||
| 475 | ;; pad ws past bottom of screen | 490 | ;; pad ws past bottom of screen |
| 476 | (let ((nl (- height (count-lines (point-min) (point))))) | 491 | (let ((nl (- height (count-lines (point-min) (point))))) |
| 477 | (when (> nl 0) | 492 | (when (> nl 0) |
| 478 | (let ((line (concat (make-string (1- width) ? ) "\n"))) | 493 | (setq line (concat line "\n")) |
| 479 | (do ((i 0 (1+ i))) | 494 | (do ((i 0 (1+ i))) |
| 480 | ((= i nl)) | 495 | ((= i nl)) |
| 481 | (insert line))))))) | 496 | (insert line)))) |
| 482 | 497 | (goto-char start) | |
| 483 | (defun zone-fall-through-ws (c col wend) | 498 | (recenter 0) |
| 484 | (let ((fall-p nil) ; todo: move outward | 499 | (sit-for 0))) |
| 485 | (wait 0.15) | 500 | |
| 486 | (o (point)) ; for terminals w/o cursor hiding | 501 | (defun zone-fall-through-ws (c wbeg wend) |
| 487 | (p (point))) | 502 | (let* ((cw-ceil (ceiling (char-width (aref c 0)))) |
| 488 | (while (progn | 503 | (spaces (make-string cw-ceil 32)) |
| 489 | (forward-line 1) | 504 | (col (current-column)) |
| 490 | (move-to-column col) | 505 | (wait 0.15) |
| 491 | (looking-at " ")) | 506 | newpos fall-p) |
| 492 | (setq fall-p t) | 507 | (while (when (save-excursion |
| 493 | (delete-char 1) | 508 | (next-line 1) |
| 494 | (insert (if (< (point) wend) c " ")) | 509 | (and (= col (current-column)) |
| 495 | (save-excursion | 510 | (setq newpos (point)) |
| 496 | (goto-char p) | 511 | (string= spaces (buffer-substring-no-properties |
| 497 | (delete-char 1) | 512 | newpos (+ newpos cw-ceil))) |
| 498 | (insert " ") | 513 | (setq newpos (+ newpos (1- cw-ceil))))) |
| 499 | (goto-char o) | 514 | (setq fall-p t) |
| 500 | (sit-for (setq wait (* wait 0.8)))) | 515 | (delete-char 1) |
| 501 | (setq p (1- (point)))) | 516 | (insert spaces) |
| 517 | (goto-char newpos) | ||
| 518 | (when (< (point) wend) | ||
| 519 | (delete-char cw-ceil) | ||
| 520 | (insert c) | ||
| 521 | (forward-char -1) | ||
| 522 | (zone-park/sit-for wbeg (setq wait (* wait 0.8)))))) | ||
| 502 | fall-p)) | 523 | fall-p)) |
| 503 | 524 | ||
| 504 | (defun zone-pgm-drip (&optional fret-p pancake-p) | 525 | (defun zone-pgm-drip (&optional fret-p pancake-p) |
| @@ -506,41 +527,35 @@ If the element is a function or a list of a function and a number, | |||
| 506 | (wh (window-height)) | 527 | (wh (window-height)) |
| 507 | (mc 0) ; miss count | 528 | (mc 0) ; miss count |
| 508 | (total (* ww wh)) | 529 | (total (* ww wh)) |
| 509 | (fall-p nil)) | 530 | (fall-p nil) |
| 531 | wbeg wend c) | ||
| 510 | (zone-fill-out-screen ww wh) | 532 | (zone-fill-out-screen ww wh) |
| 533 | (setq wbeg (window-start) | ||
| 534 | wend (window-end)) | ||
| 511 | (catch 'done | 535 | (catch 'done |
| 512 | (while (not (input-pending-p)) | 536 | (while (not (input-pending-p)) |
| 513 | (let ((wbeg (window-start)) | 537 | (setq mc 0 wend (window-end)) |
| 514 | (wend (window-end))) | 538 | ;; select non-ws character, but don't miss too much |
| 515 | (setq mc 0) | 539 | (goto-char (+ wbeg (random (- wend wbeg)))) |
| 516 | ;; select non-ws character, but don't miss too much | 540 | (while (looking-at "[ \n\f]") |
| 517 | (goto-char (+ wbeg (random (- wend wbeg)))) | 541 | (if (= total (setq mc (1+ mc))) |
| 518 | (while (looking-at "[ \n\f]") | 542 | (throw 'done 'sel) |
| 519 | (if (= total (setq mc (1+ mc))) | 543 | (goto-char (+ wbeg (random (- wend wbeg)))))) |
| 520 | (throw 'done 'sel) | 544 | ;; character animation sequence |
| 521 | (goto-char (+ wbeg (random (- wend wbeg)))))) | 545 | (let ((p (point))) |
| 522 | ;; character animation sequence | 546 | (when fret-p (zone-fret wbeg p)) |
| 523 | (let ((p (point))) | 547 | (goto-char p) |
| 524 | (when fret-p (zone-fret p)) | 548 | (setq c (zone-cpos p) |
| 525 | (goto-char p) | 549 | fall-p (zone-fall-through-ws c wbeg wend))) |
| 526 | (setq fall-p (zone-fall-through-ws | ||
| 527 | (zone-cpos p) (current-column) wend)))) | ||
| 528 | ;; assuming current-column has not changed... | 550 | ;; assuming current-column has not changed... |
| 529 | (when (and pancake-p | 551 | (when (and pancake-p |
| 530 | fall-p | 552 | fall-p |
| 531 | (< (count-lines (point-min) (point)) | 553 | (< (count-lines (point-min) (point)) |
| 532 | wh)) | 554 | wh)) |
| 533 | (previous-line 1) | 555 | (let ((cw (ceiling (char-width (aref c 0))))) |
| 534 | (forward-char 1) | 556 | (zone-replace-char cw 1 c ?@) (zone-park/sit-for wbeg 0.137) |
| 535 | (sit-for 0.137) | 557 | (zone-replace-char cw nil c ?*) (zone-park/sit-for wbeg 0.137) |
| 536 | (delete-char -1) | 558 | (zone-replace-char cw nil c ?_))))))) |
| 537 | (insert "@") | ||
| 538 | (sit-for 0.137) | ||
| 539 | (delete-char -1) | ||
| 540 | (insert "*") | ||
| 541 | (sit-for 0.137) | ||
| 542 | (delete-char -1) | ||
| 543 | (insert "_")))))) | ||
| 544 | 559 | ||
| 545 | (defun zone-pgm-drip-fretfully () | 560 | (defun zone-pgm-drip-fretfully () |
| 546 | (zone-pgm-drip t)) | 561 | (zone-pgm-drip t)) |
| @@ -552,7 +567,7 @@ If the element is a function or a list of a function and a number, | |||
| 552 | (zone-pgm-drip t t)) | 567 | (zone-pgm-drip t t)) |
| 553 | 568 | ||
| 554 | 569 | ||
| 555 | ;;;; zone-pgm-paragraph-spaz | 570 | ;;;; paragraph spazzing (for textish modes) |
| 556 | 571 | ||
| 557 | (defun zone-pgm-paragraph-spaz () | 572 | (defun zone-pgm-paragraph-spaz () |
| 558 | (if (memq (zone-orig major-mode) | 573 | (if (memq (zone-orig major-mode) |
| @@ -633,30 +648,29 @@ If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).") | |||
| 633 | (rtc (- (frame-width) 11)) | 648 | (rtc (- (frame-width) 11)) |
| 634 | (min (window-start)) | 649 | (min (window-start)) |
| 635 | (max (1- (window-end))) | 650 | (max (1- (window-end))) |
| 636 | c col) | 651 | s c col) |
| 637 | (delete-region max (point-max)) | 652 | (delete-region max (point-max)) |
| 638 | (while (progn (goto-char (+ min (random max))) | 653 | (while (and (progn (goto-char min) (sit-for 0.05)) |
| 639 | (and (sit-for 0.005) | 654 | (progn (goto-char (+ min (random max))) |
| 640 | (or (progn (skip-chars-forward " @\n" max) | 655 | (or (progn (skip-chars-forward " @\n" max) |
| 641 | (not (= max (point)))) | 656 | (not (= max (point)))) |
| 642 | (unless (or (= 0 (skip-chars-backward " @\n" min)) | 657 | (unless (or (= 0 (skip-chars-backward " @\n" min)) |
| 643 | (= min (point))) | 658 | (= min (point))) |
| 644 | (forward-char -1) | 659 | (forward-char -1) |
| 645 | t)))) | 660 | t)))) |
| 646 | (setq c (char-after)) | 661 | (unless (or (eolp) (eobp)) |
| 647 | (unless (or (not c) (= ?\n c)) | 662 | (setq s (zone-cpos (point)) |
| 648 | (forward-char 1) | 663 | c (aref s 0)) |
| 649 | (insert-and-inherit ; keep colors | 664 | (zone-replace-char |
| 650 | (cond ((or (> top (point)) | 665 | (char-width c) |
| 651 | (< bot (point)) | 666 | 1 s (cond ((or (> top (point)) |
| 652 | (or (> 11 (setq col (current-column))) | 667 | (< bot (point)) |
| 653 | (< rtc col))) | 668 | (or (> 11 (setq col (current-column))) |
| 654 | 32) | 669 | (< rtc col))) |
| 655 | ((and (<= ?a c) (>= ?z c)) (+ c (- ?A ?a))) | 670 | 32) |
| 656 | ((and (<= ?A c) (>= ?Z c)) ?*) | 671 | ((and (<= ?a c) (>= ?z c)) (+ c (- ?A ?a))) |
| 657 | (t ?@))) | 672 | ((and (<= ?A c) (>= ?Z c)) ?*) |
| 658 | (forward-char -1) | 673 | (t ?@))))) |
| 659 | (delete-char -1))) | ||
| 660 | (sit-for 3) | 674 | (sit-for 3) |
| 661 | (setq col nil) | 675 | (setq col nil) |
| 662 | (goto-char bot) | 676 | (goto-char bot) |
| @@ -666,8 +680,13 @@ If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).") | |||
| 666 | (setq col (cons (buffer-substring (point) c) col)) | 680 | (setq col (cons (buffer-substring (point) c) col)) |
| 667 | (end-of-line 0) | 681 | (end-of-line 0) |
| 668 | (forward-char -10)) | 682 | (forward-char -10)) |
| 669 | (let ((life-patterns (vector (cons (make-string (length (car col)) 32) | 683 | (let ((life-patterns (vector |
| 670 | col)))) | 684 | (if (and col (search-forward "@" max t)) |
| 685 | (cons (make-string (length (car col)) 32) col) | ||
| 686 | (list (mapconcat 'identity | ||
| 687 | (make-list (/ (- rtc 11) 15) | ||
| 688 | (make-string 5 ?@)) | ||
| 689 | (make-string 10 32))))))) | ||
| 671 | (life (or zone-pgm-random-life-wait (random 4))) | 690 | (life (or zone-pgm-random-life-wait (random 4))) |
| 672 | (kill-buffer nil)))) | 691 | (kill-buffer nil)))) |
| 673 | 692 | ||
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f2750ec8ff4..9c7e8fe1560 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1044,6 +1044,7 @@ exited abnormally with code %d\n" | |||
| 1044 | (defvar compilation-minor-mode-map | 1044 | (defvar compilation-minor-mode-map |
| 1045 | (let ((map (make-sparse-keymap))) | 1045 | (let ((map (make-sparse-keymap))) |
| 1046 | (define-key map [mouse-2] 'compile-goto-error) | 1046 | (define-key map [mouse-2] 'compile-goto-error) |
| 1047 | (define-key map [follow-link] 'mouse-face) | ||
| 1047 | (define-key map "\C-c\C-c" 'compile-goto-error) | 1048 | (define-key map "\C-c\C-c" 'compile-goto-error) |
| 1048 | (define-key map "\C-m" 'compile-goto-error) | 1049 | (define-key map "\C-m" 'compile-goto-error) |
| 1049 | (define-key map "\C-c\C-k" 'kill-compilation) | 1050 | (define-key map "\C-c\C-k" 'kill-compilation) |
| @@ -1073,6 +1074,7 @@ exited abnormally with code %d\n" | |||
| 1073 | (defvar compilation-button-map | 1074 | (defvar compilation-button-map |
| 1074 | (let ((map (make-sparse-keymap))) | 1075 | (let ((map (make-sparse-keymap))) |
| 1075 | (define-key map [mouse-2] 'compile-goto-error) | 1076 | (define-key map [mouse-2] 'compile-goto-error) |
| 1077 | (define-key map [follow-link] 'mouse-face) | ||
| 1076 | (define-key map "\C-m" 'compile-goto-error) | 1078 | (define-key map "\C-m" 'compile-goto-error) |
| 1077 | map) | 1079 | map) |
| 1078 | "Keymap for compilation-message buttons.") | 1080 | "Keymap for compilation-message buttons.") |
| @@ -1084,6 +1086,7 @@ exited abnormally with code %d\n" | |||
| 1084 | ;; because that introduces a menu bar item we don't want. | 1086 | ;; because that introduces a menu bar item we don't want. |
| 1085 | ;; That confuses C-down-mouse-3. | 1087 | ;; That confuses C-down-mouse-3. |
| 1086 | (define-key map [mouse-2] 'compile-goto-error) | 1088 | (define-key map [mouse-2] 'compile-goto-error) |
| 1089 | (define-key map [follow-link] 'mouse-face) | ||
| 1087 | (define-key map "\C-c\C-c" 'compile-goto-error) | 1090 | (define-key map "\C-c\C-c" 'compile-goto-error) |
| 1088 | (define-key map "\C-m" 'compile-goto-error) | 1091 | (define-key map "\C-m" 'compile-goto-error) |
| 1089 | (define-key map "\C-c\C-k" 'kill-compilation) | 1092 | (define-key map "\C-c\C-k" 'kill-compilation) |
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index a5d401a5f5e..0eb53771019 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el | |||
| @@ -199,20 +199,20 @@ non-executable files." | |||
| 199 | (file-modes buffer-file-name))))))) | 199 | (file-modes buffer-file-name))))))) |
| 200 | 200 | ||
| 201 | 201 | ||
| 202 | ;;;###autoload | ||
| 202 | (defun executable-interpret (command) | 203 | (defun executable-interpret (command) |
| 203 | "Run script with user-specified args, and collect output in a buffer. | 204 | "Run script with user-specified args, and collect output in a buffer. |
| 204 | While script runs asynchronously, you can use the \\[next-error] command | 205 | While script runs asynchronously, you can use the \\[next-error] |
| 205 | to find the next error." | 206 | command to find the next error. The buffer is also in `comint-mode' and |
| 207 | `compilation-shell-minor-mode', so that you can answer any prompts." | ||
| 206 | (interactive (list (read-string "Run script: " | 208 | (interactive (list (read-string "Run script: " |
| 207 | (or executable-command | 209 | (or executable-command |
| 208 | buffer-file-name)))) | 210 | buffer-file-name)))) |
| 209 | (require 'compile) | 211 | (require 'compile) |
| 210 | (save-some-buffers (not compilation-ask-about-save)) | 212 | (save-some-buffers (not compilation-ask-about-save)) |
| 211 | (make-local-variable 'executable-command) | 213 | (set (make-local-variable 'executable-command) command) |
| 212 | (compile-internal (setq executable-command command) | 214 | (let ((compilation-error-regexp-alist executable-error-regexp-alist)) |
| 213 | "No more errors." "Interpretation" | 215 | (compilation-start command t (lambda (x) "*interpretation*")))) |
| 214 | ;; Give it a simpler regexp to match. | ||
| 215 | nil executable-error-regexp-alist)) | ||
| 216 | 216 | ||
| 217 | 217 | ||
| 218 | 218 | ||
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index fd4b716ae4b..04fcae78ea6 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -275,6 +275,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 275 | (defvar grep-error-face compilation-error-face | 275 | (defvar grep-error-face compilation-error-face |
| 276 | "Face name to use for grep error messages.") | 276 | "Face name to use for grep error messages.") |
| 277 | 277 | ||
| 278 | (defvar grep-match-face 'match | ||
| 279 | "Face name to use for grep matches.") | ||
| 280 | |||
| 278 | (defvar grep-mode-font-lock-keywords | 281 | (defvar grep-mode-font-lock-keywords |
| 279 | '(;; Command output lines. | 282 | '(;; Command output lines. |
| 280 | ("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face) | 283 | ("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face) |
| @@ -291,7 +294,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 291 | (2 compilation-line-face)) | 294 | (2 compilation-line-face)) |
| 292 | ;; Highlight grep matches and delete markers | 295 | ;; Highlight grep matches and delete markers |
| 293 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" | 296 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" |
| 294 | (2 compilation-column-face) | 297 | (2 grep-match-face) |
| 295 | ((lambda (p)) | 298 | ((lambda (p)) |
| 296 | (progn | 299 | (progn |
| 297 | ;; Delete markers with `replace-match' because it updates | 300 | ;; Delete markers with `replace-match' because it updates |
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 7013c3856e3..3bd5dd2a1f6 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Thien-Thi Nguyen <ttn@gnu.org> | 5 | ;; Author: Thien-Thi Nguyen <ttn@gnu.org> |
| 6 | ;; Dan Nicolaescu <dann@ics.uci.edu> | 6 | ;; Dan Nicolaescu <dann@ics.uci.edu> |
| 7 | ;; Keywords: C C++ java lisp tools editing comments blocks hiding outlines | 7 | ;; Keywords: C C++ java lisp tools editing comments blocks hiding outlines |
| 8 | ;; Maintainer-Version: 5.31 | 8 | ;; Maintainer-Version: 5.39.2.8 |
| 9 | ;; Time-of-Day-Author-Most-Likely-to-be-Recalcitrant: early morning | 9 | ;; Time-of-Day-Author-Most-Likely-to-be-Recalcitrant: early morning |
| 10 | 10 | ||
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| @@ -58,7 +58,7 @@ | |||
| 58 | ;; | 58 | ;; |
| 59 | ;; (load-library "hideshow") | 59 | ;; (load-library "hideshow") |
| 60 | ;; (add-hook 'X-mode-hook ; other modes similarly | 60 | ;; (add-hook 'X-mode-hook ; other modes similarly |
| 61 | ;; '(lambda () (hs-minor-mode 1))) | 61 | ;; (lambda () (hs-minor-mode 1))) |
| 62 | ;; | 62 | ;; |
| 63 | ;; where X = {emacs-lisp,c,c++,perl,...}. You can also manually toggle | 63 | ;; where X = {emacs-lisp,c,c++,perl,...}. You can also manually toggle |
| 64 | ;; hideshow minor mode by typing `M-x hs-minor-mode'. After hideshow is | 64 | ;; hideshow minor mode by typing `M-x hs-minor-mode'. After hideshow is |
| @@ -133,10 +133,7 @@ | |||
| 133 | ;; variable `hs-special-modes-alist'. Packages that use hideshow should | 133 | ;; variable `hs-special-modes-alist'. Packages that use hideshow should |
| 134 | ;; do something like: | 134 | ;; do something like: |
| 135 | ;; | 135 | ;; |
| 136 | ;; (let ((my-mode-hs-info '(my-mode "{{" "}}" ...))) | 136 | ;; (add-to-list 'hs-special-modes-alist '(my-mode "{{" "}}" ...)) |
| 137 | ;; (if (not (member my-mode-hs-info hs-special-modes-alist)) | ||
| 138 | ;; (setq hs-special-modes-alist | ||
| 139 | ;; (cons my-mode-hs-info hs-special-modes-alist)))) | ||
| 140 | ;; | 137 | ;; |
| 141 | ;; If you have an entry that works particularly well, consider | 138 | ;; If you have an entry that works particularly well, consider |
| 142 | ;; submitting it for inclusion in hideshow.el. See docstring for | 139 | ;; submitting it for inclusion in hideshow.el. See docstring for |
| @@ -180,9 +177,9 @@ | |||
| 180 | ;; In the case of `vc-diff', here is a less invasive workaround: | 177 | ;; In the case of `vc-diff', here is a less invasive workaround: |
| 181 | ;; | 178 | ;; |
| 182 | ;; (add-hook 'vc-before-checkin-hook | 179 | ;; (add-hook 'vc-before-checkin-hook |
| 183 | ;; '(lambda () | 180 | ;; (lambda () |
| 184 | ;; (goto-char (point-min)) | 181 | ;; (goto-char (point-min)) |
| 185 | ;; (hs-show-block))) | 182 | ;; (hs-show-block))) |
| 186 | ;; | 183 | ;; |
| 187 | ;; Unfortunately, these workarounds do not restore hideshow state. | 184 | ;; Unfortunately, these workarounds do not restore hideshow state. |
| 188 | ;; If someone figures out a better way, please let me know. | 185 | ;; If someone figures out a better way, please let me know. |
| @@ -223,6 +220,7 @@ | |||
| 223 | ;;; Code: | 220 | ;;; Code: |
| 224 | 221 | ||
| 225 | (require 'easymenu) | 222 | (require 'easymenu) |
| 223 | (eval-when-compile (require 'cl)) | ||
| 226 | 224 | ||
| 227 | ;;--------------------------------------------------------------------------- | 225 | ;;--------------------------------------------------------------------------- |
| 228 | ;; user-configurable variables | 226 | ;; user-configurable variables |
| @@ -265,8 +263,7 @@ This has effect iff `search-invisible' is set to `open'." | |||
| 265 | '((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) | 263 | '((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) |
| 266 | (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) | 264 | (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) |
| 267 | (bibtex-mode ("^@\\S(*\\(\\s(\\)" 1)) | 265 | (bibtex-mode ("^@\\S(*\\(\\s(\\)" 1)) |
| 268 | (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) | 266 | (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning)) |
| 269 | ) | ||
| 270 | "*Alist for initializing the hideshow variables for different modes. | 267 | "*Alist for initializing the hideshow variables for different modes. |
| 271 | Each element has the form | 268 | Each element has the form |
| 272 | (MODE START END COMMENT-START FORWARD-SEXP-FUNC ADJUST-BEG-FUNC). | 269 | (MODE START END COMMENT-START FORWARD-SEXP-FUNC ADJUST-BEG-FUNC). |
| @@ -378,28 +375,6 @@ Note that `mode-line-format' is buffer-local.") | |||
| 378 | ;;--------------------------------------------------------------------------- | 375 | ;;--------------------------------------------------------------------------- |
| 379 | ;; system dependency | 376 | ;; system dependency |
| 380 | 377 | ||
| 381 | ; ;; xemacs compatibility | ||
| 382 | ; (when (string-match "xemacs\\|lucid" emacs-version) | ||
| 383 | ; ;; use pre-packaged compatiblity layer | ||
| 384 | ; (require 'overlay)) | ||
| 385 | ; | ||
| 386 | ; ;; xemacs and emacs-19 compatibility | ||
| 387 | ; (when (or (not (fboundp 'add-to-invisibility-spec)) | ||
| 388 | ; (not (fboundp 'remove-from-invisibility-spec))) | ||
| 389 | ; ;; `buffer-invisibility-spec' mutators snarfed from Emacs 20.3 lisp/subr.el | ||
| 390 | ; (defun add-to-invisibility-spec (arg) | ||
| 391 | ; (cond | ||
| 392 | ; ((or (null buffer-invisibility-spec) (eq buffer-invisibility-spec t)) | ||
| 393 | ; (setq buffer-invisibility-spec (list arg))) | ||
| 394 | ; (t | ||
| 395 | ; (setq buffer-invisibility-spec | ||
| 396 | ; (cons arg buffer-invisibility-spec))))) | ||
| 397 | ; (defun remove-from-invisibility-spec (arg) | ||
| 398 | ; (when buffer-invisibility-spec | ||
| 399 | ; (setq buffer-invisibility-spec | ||
| 400 | ; (delete arg buffer-invisibility-spec))))) | ||
| 401 | |||
| 402 | ;; hs-match-data | ||
| 403 | (defalias 'hs-match-data 'match-data) | 378 | (defalias 'hs-match-data 'match-data) |
| 404 | 379 | ||
| 405 | ;;--------------------------------------------------------------------------- | 380 | ;;--------------------------------------------------------------------------- |
| @@ -409,12 +384,9 @@ Note that `mode-line-format' is buffer-local.") | |||
| 409 | "Delete hideshow overlays in region defined by FROM and TO." | 384 | "Delete hideshow overlays in region defined by FROM and TO." |
| 410 | (when (< to from) | 385 | (when (< to from) |
| 411 | (setq from (prog1 to (setq to from)))) | 386 | (setq from (prog1 to (setq to from)))) |
| 412 | (let ((ovs (overlays-in from to))) | 387 | (dolist (ov (overlays-in from to)) |
| 413 | (while ovs | 388 | (when (overlay-get ov 'hs) |
| 414 | (let ((ov (car ovs))) | 389 | (delete-overlay ov)))) |
| 415 | (when (overlay-get ov 'hs) | ||
| 416 | (delete-overlay ov))) | ||
| 417 | (setq ovs (cdr ovs))))) | ||
| 418 | 390 | ||
| 419 | (defun hs-isearch-show (ov) | 391 | (defun hs-isearch-show (ov) |
| 420 | "Delete overlay OV, and set `hs-headline' to nil. | 392 | "Delete overlay OV, and set `hs-headline' to nil. |
| @@ -433,16 +405,16 @@ OV is shown. | |||
| 433 | This function is meant to be used as the `isearch-open-invisible-temporary' | 405 | This function is meant to be used as the `isearch-open-invisible-temporary' |
| 434 | property of an overlay." | 406 | property of an overlay." |
| 435 | (setq hs-headline | 407 | (setq hs-headline |
| 436 | (if hide-p | 408 | (if hide-p |
| 437 | nil | 409 | nil |
| 438 | (or hs-headline | 410 | (or hs-headline |
| 439 | (let ((start (overlay-start ov))) | 411 | (let ((start (overlay-start ov))) |
| 440 | (buffer-substring | 412 | (buffer-substring |
| 441 | (save-excursion (goto-char start) | 413 | (save-excursion (goto-char start) |
| 442 | (beginning-of-line) | 414 | (beginning-of-line) |
| 443 | (skip-chars-forward " \t") | 415 | (skip-chars-forward " \t") |
| 444 | (point)) | 416 | (point)) |
| 445 | start))))) | 417 | start))))) |
| 446 | (force-mode-line-update) | 418 | (force-mode-line-update) |
| 447 | (overlay-put ov 'invisible (and hide-p 'hs))) | 419 | (overlay-put ov 'invisible (and hide-p 'hs))) |
| 448 | 420 | ||
| @@ -464,10 +436,10 @@ on what kind of block is to be hidden." | |||
| 464 | ;; deprecated backward compatibility -- `block'<=>`code' | 436 | ;; deprecated backward compatibility -- `block'<=>`code' |
| 465 | (and (eq 'block hs-isearch-open) | 437 | (and (eq 'block hs-isearch-open) |
| 466 | (eq 'code flag))) | 438 | (eq 'code flag))) |
| 467 | (overlay-put overlay 'isearch-open-invisible 'hs-isearch-show) | 439 | (overlay-put overlay 'isearch-open-invisible 'hs-isearch-show) |
| 468 | (overlay-put overlay | 440 | (overlay-put overlay |
| 469 | 'isearch-open-invisible-temporary | 441 | 'isearch-open-invisible-temporary |
| 470 | 'hs-isearch-show-temporary)) | 442 | 'hs-isearch-show-temporary)) |
| 471 | overlay)))) | 443 | overlay)))) |
| 472 | 444 | ||
| 473 | (defun hs-forward-sexp (match-data arg) | 445 | (defun hs-forward-sexp (match-data arg) |
| @@ -523,10 +495,10 @@ and then further adjusted to be at the end of the line." | |||
| 523 | 495 | ||
| 524 | (defun hs-safety-is-job-n () | 496 | (defun hs-safety-is-job-n () |
| 525 | "Warn if `buffer-invisibility-spec' does not contain symbol `hs'." | 497 | "Warn if `buffer-invisibility-spec' does not contain symbol `hs'." |
| 526 | (unless (and (listp buffer-invisibility-spec) | 498 | (unless (and (listp buffer-invisibility-spec) |
| 527 | (assq 'hs buffer-invisibility-spec)) | 499 | (assq 'hs buffer-invisibility-spec)) |
| 528 | (message "Warning: `buffer-invisibility-spec' does not contain hs!!") | 500 | (message "Warning: `buffer-invisibility-spec' does not contain hs!!") |
| 529 | (sit-for 2))) | 501 | (sit-for 2))) |
| 530 | 502 | ||
| 531 | (defun hs-inside-comment-p () | 503 | (defun hs-inside-comment-p () |
| 532 | "Return non-nil if point is inside a comment, otherwise nil. | 504 | "Return non-nil if point is inside a comment, otherwise nil. |
| @@ -543,10 +515,15 @@ as cdr." | |||
| 543 | (let ((q (point))) | 515 | (let ((q (point))) |
| 544 | (when (or (looking-at hs-c-start-regexp) | 516 | (when (or (looking-at hs-c-start-regexp) |
| 545 | (re-search-backward hs-c-start-regexp (point-min) t)) | 517 | (re-search-backward hs-c-start-regexp (point-min) t)) |
| 518 | ;; first get to the beginning of this comment... | ||
| 519 | (while (and (not (bobp)) | ||
| 520 | (= (point) (progn (forward-comment -1) (point)))) | ||
| 521 | (forward-char -1)) | ||
| 522 | ;; ...then extend backwards | ||
| 546 | (forward-comment (- (buffer-size))) | 523 | (forward-comment (- (buffer-size))) |
| 547 | (skip-chars-forward " \t\n\f") | 524 | (skip-chars-forward " \t\n\f") |
| 548 | (let ((p (point)) | 525 | (let ((p (point)) |
| 549 | (not-hidable nil)) | 526 | (hidable t)) |
| 550 | (beginning-of-line) | 527 | (beginning-of-line) |
| 551 | (unless (looking-at (concat "[ \t]*" hs-c-start-regexp)) | 528 | (unless (looking-at (concat "[ \t]*" hs-c-start-regexp)) |
| 552 | ;; we are in this situation: (example) | 529 | ;; we are in this situation: (example) |
| @@ -565,19 +542,19 @@ as cdr." | |||
| 565 | (while (and (< (point) q) | 542 | (while (and (< (point) q) |
| 566 | (> (point) p) | 543 | (> (point) p) |
| 567 | (not (looking-at hs-c-start-regexp))) | 544 | (not (looking-at hs-c-start-regexp))) |
| 568 | (setq p (point));; use this to avoid an infinite cycle | 545 | (setq p (point)) ;; use this to avoid an infinite cycle |
| 569 | (forward-comment 1) | 546 | (forward-comment 1) |
| 570 | (skip-chars-forward " \t\n\f")) | 547 | (skip-chars-forward " \t\n\f")) |
| 571 | (when (or (not (looking-at hs-c-start-regexp)) | 548 | (when (or (not (looking-at hs-c-start-regexp)) |
| 572 | (> (point) q)) | 549 | (> (point) q)) |
| 573 | ;; we cannot hide this comment block | 550 | ;; we cannot hide this comment block |
| 574 | (setq not-hidable t))) | 551 | (setq hidable nil))) |
| 575 | ;; goto the end of the comment | 552 | ;; goto the end of the comment |
| 576 | (forward-comment (buffer-size)) | 553 | (forward-comment (buffer-size)) |
| 577 | (skip-chars-backward " \t\n\f") | 554 | (skip-chars-backward " \t\n\f") |
| 578 | (end-of-line) | 555 | (end-of-line) |
| 579 | (when (>= (point) q) | 556 | (when (>= (point) q) |
| 580 | (list (if not-hidable nil p) (point)))))))) | 557 | (list (and hidable p) (point)))))))) |
| 581 | 558 | ||
| 582 | (defun hs-grok-mode-type () | 559 | (defun hs-grok-mode-type () |
| 583 | "Set up hideshow variables for new buffers. | 560 | "Set up hideshow variables for new buffers. |
| @@ -645,7 +622,7 @@ Return point, or nil if original point was not in a block." | |||
| 645 | (hs-hide-level-recursive (1- arg) minp maxp) | 622 | (hs-hide-level-recursive (1- arg) minp maxp) |
| 646 | (goto-char (match-beginning hs-block-start-mdata-select)) | 623 | (goto-char (match-beginning hs-block-start-mdata-select)) |
| 647 | (hs-hide-block-at-point t))) | 624 | (hs-hide-block-at-point t))) |
| 648 | (hs-safety-is-job-n) | 625 | (hs-safety-is-job-n) |
| 649 | (goto-char maxp)) | 626 | (goto-char maxp)) |
| 650 | 627 | ||
| 651 | (defmacro hs-life-goes-on (&rest body) | 628 | (defmacro hs-life-goes-on (&rest body) |
| @@ -675,8 +652,8 @@ and `case-fold-search' are both t." | |||
| 675 | (let ((overlays (overlays-at (point))) | 652 | (let ((overlays (overlays-at (point))) |
| 676 | (found nil)) | 653 | (found nil)) |
| 677 | (while (and (not found) (overlayp (car overlays))) | 654 | (while (and (not found) (overlayp (car overlays))) |
| 678 | (setq found (overlay-get (car overlays) 'hs) | 655 | (setq found (overlay-get (car overlays) 'hs) |
| 679 | overlays (cdr overlays))) | 656 | overlays (cdr overlays))) |
| 680 | found))) | 657 | found))) |
| 681 | 658 | ||
| 682 | (defun hs-c-like-adjust-block-beginning (initial) | 659 | (defun hs-c-like-adjust-block-beginning (initial) |
| @@ -724,7 +701,7 @@ If `hs-hide-comments-when-hiding-all' is non-nil, also hide the comments." | |||
| 724 | (funcall hs-hide-all-non-comment-function) | 701 | (funcall hs-hide-all-non-comment-function) |
| 725 | (hs-hide-block-at-point t))) | 702 | (hs-hide-block-at-point t))) |
| 726 | ;; found a comment, probably | 703 | ;; found a comment, probably |
| 727 | (let ((c-reg (hs-inside-comment-p))) ; blech! | 704 | (let ((c-reg (hs-inside-comment-p))) ; blech! |
| 728 | (when (and c-reg (car c-reg)) | 705 | (when (and c-reg (car c-reg)) |
| 729 | (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1) | 706 | (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1) |
| 730 | (hs-hide-block-at-point t c-reg) | 707 | (hs-hide-block-at-point t c-reg) |
| @@ -772,18 +749,15 @@ See documentation for functions `hs-hide-block' and `run-hooks'." | |||
| 772 | (or | 749 | (or |
| 773 | ;; first see if we have something at the end of the line | 750 | ;; first see if we have something at the end of the line |
| 774 | (catch 'eol-begins-hidden-region-p | 751 | (catch 'eol-begins-hidden-region-p |
| 775 | (let ((here (point)) | 752 | (let ((here (point))) |
| 776 | (ovs (save-excursion (end-of-line) (overlays-at (point))))) | 753 | (dolist (ov (save-excursion (end-of-line) (overlays-at (point)))) |
| 777 | (while ovs | 754 | (when (overlay-get ov 'hs) |
| 778 | (let ((ov (car ovs))) | 755 | (goto-char |
| 779 | (when (overlay-get ov 'hs) | 756 | (cond (end (overlay-end ov)) |
| 780 | (goto-char | 757 | ((eq 'comment (overlay-get ov 'hs)) here) |
| 781 | (cond (end (overlay-end ov)) | 758 | (t (+ (overlay-start ov) (overlay-get ov 'hs-ofs))))) |
| 782 | ((eq 'comment (overlay-get ov 'hs)) here) | 759 | (delete-overlay ov) |
| 783 | (t (+ (overlay-start ov) (overlay-get ov 'hs-ofs))))) | 760 | (throw 'eol-begins-hidden-region-p t))) |
| 784 | (delete-overlay ov) | ||
| 785 | (throw 'eol-begins-hidden-region-p t))) | ||
| 786 | (setq ovs (cdr ovs))) | ||
| 787 | nil)) | 761 | nil)) |
| 788 | ;; not immediately obvious, look for a suitable block | 762 | ;; not immediately obvious, look for a suitable block |
| 789 | (let ((c-reg (hs-inside-comment-p)) | 763 | (let ((c-reg (hs-inside-comment-p)) |
| @@ -870,9 +844,9 @@ Key bindings: | |||
| 870 | 844 | ||
| 871 | (interactive "P") | 845 | (interactive "P") |
| 872 | (setq hs-headline nil | 846 | (setq hs-headline nil |
| 873 | hs-minor-mode (if (null arg) | 847 | hs-minor-mode (if (null arg) |
| 874 | (not hs-minor-mode) | 848 | (not hs-minor-mode) |
| 875 | (> (prefix-numeric-value arg) 0))) | 849 | (> (prefix-numeric-value arg) 0))) |
| 876 | (if hs-minor-mode | 850 | (if hs-minor-mode |
| 877 | (progn | 851 | (progn |
| 878 | (hs-grok-mode-type) | 852 | (hs-grok-mode-type) |
| @@ -912,27 +886,19 @@ Key bindings: | |||
| 912 | ))))) | 886 | ))))) |
| 913 | 887 | ||
| 914 | ;; some housekeeping | 888 | ;; some housekeeping |
| 915 | (or (assq 'hs-minor-mode minor-mode-map-alist) | 889 | (add-to-list 'minor-mode-map-alist (cons 'hs-minor-mode hs-minor-mode-map)) |
| 916 | (setq minor-mode-map-alist | 890 | (add-to-list 'minor-mode-alist '(hs-minor-mode " hs") t) |
| 917 | (cons (cons 'hs-minor-mode hs-minor-mode-map) | ||
| 918 | minor-mode-map-alist))) | ||
| 919 | (or (assq 'hs-minor-mode minor-mode-alist) | ||
| 920 | (setq minor-mode-alist (append minor-mode-alist | ||
| 921 | (list '(hs-minor-mode " hs"))))) | ||
| 922 | 891 | ||
| 923 | ;; make some variables permanently buffer-local | 892 | ;; make some variables permanently buffer-local |
| 924 | (let ((vars '(hs-minor-mode | 893 | (dolist (var '(hs-minor-mode |
| 925 | hs-c-start-regexp | 894 | hs-c-start-regexp |
| 926 | hs-block-start-regexp | 895 | hs-block-start-regexp |
| 927 | hs-block-start-mdata-select | 896 | hs-block-start-mdata-select |
| 928 | hs-block-end-regexp | 897 | hs-block-end-regexp |
| 929 | hs-forward-sexp-func | 898 | hs-forward-sexp-func |
| 930 | hs-adjust-block-beginning))) | 899 | hs-adjust-block-beginning)) |
| 931 | (while vars | 900 | (make-variable-buffer-local var) |
| 932 | (let ((var (car vars))) | 901 | (put var 'permanent-local t)) |
| 933 | (make-variable-buffer-local var) | ||
| 934 | (put var 'permanent-local t)) | ||
| 935 | (setq vars (cdr vars)))) | ||
| 936 | 902 | ||
| 937 | ;;--------------------------------------------------------------------------- | 903 | ;;--------------------------------------------------------------------------- |
| 938 | ;; that's it | 904 | ;; that's it |
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 45694b57b99..a17ba3e844f 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el | |||
| @@ -2571,7 +2571,9 @@ If not in a statement just moves to end of line. Returns position." | |||
| 2571 | (let ((save-point (point))) | 2571 | (let ((save-point (point))) |
| 2572 | (when (re-search-forward ".*&" lim t) | 2572 | (when (re-search-forward ".*&" lim t) |
| 2573 | (goto-char (match-end 0)) | 2573 | (goto-char (match-end 0)) |
| 2574 | (if (idlwave-quoted) (goto-char save-point))) | 2574 | (if (idlwave-quoted) |
| 2575 | (goto-char save-point) | ||
| 2576 | (if (eq (char-after (- (point) 2)) ?&) (goto-char save-point)))) | ||
| 2575 | (point))) | 2577 | (point))) |
| 2576 | 2578 | ||
| 2577 | (defun idlwave-skip-label-or-case () | 2579 | (defun idlwave-skip-label-or-case () |
diff --git a/lisp/replace.el b/lisp/replace.el index 646f693cd7f..775ad0ffb05 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -735,16 +735,17 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. | |||
| 735 | Compatibility function for \\[next-error] invocations." | 735 | Compatibility function for \\[next-error] invocations." |
| 736 | (interactive "p") | 736 | (interactive "p") |
| 737 | ;; we need to run occur-find-match from within the Occur buffer | 737 | ;; we need to run occur-find-match from within the Occur buffer |
| 738 | (with-current-buffer | 738 | (with-current-buffer |
| 739 | (if (next-error-buffer-p (current-buffer)) | 739 | (if (next-error-buffer-p (current-buffer)) |
| 740 | (current-buffer) | 740 | (current-buffer) |
| 741 | (next-error-find-buffer nil nil (lambda() (eq major-mode 'occur-mode)))) | 741 | (next-error-find-buffer nil nil (lambda() (eq major-mode 'occur-mode)))) |
| 742 | 742 | ||
| 743 | (when reset | 743 | (goto-char (cond (reset (point-min)) |
| 744 | (goto-char (point-min))) | 744 | ((< argp 0) (line-beginning-position)) |
| 745 | ((line-end-position)))) | ||
| 745 | (occur-find-match | 746 | (occur-find-match |
| 746 | (abs (prefix-numeric-value argp)) | 747 | (abs argp) |
| 747 | (if (> 0 (prefix-numeric-value argp)) | 748 | (if (> 0 argp) |
| 748 | #'previous-single-property-change | 749 | #'previous-single-property-change |
| 749 | #'next-single-property-change) | 750 | #'next-single-property-change) |
| 750 | "No more matches") | 751 | "No more matches") |
| @@ -752,6 +753,20 @@ Compatibility function for \\[next-error] invocations." | |||
| 752 | (set-window-point (get-buffer-window (current-buffer)) (point)) | 753 | (set-window-point (get-buffer-window (current-buffer)) (point)) |
| 753 | (occur-mode-goto-occurrence))) | 754 | (occur-mode-goto-occurrence))) |
| 754 | 755 | ||
| 756 | (defface match | ||
| 757 | '((((class color) (min-colors 88) (background light)) | ||
| 758 | :background "Tan") | ||
| 759 | (((class color) (min-colors 88) (background dark)) | ||
| 760 | :background "RoyalBlue4") | ||
| 761 | (((class color) (min-colors 8)) | ||
| 762 | :background "blue" :foreground "white") | ||
| 763 | (((type tty) (class mono)) | ||
| 764 | :inverse-video t) | ||
| 765 | (t :background "gray")) | ||
| 766 | "Face used to highlight matches permanently." | ||
| 767 | :group 'matching | ||
| 768 | :version "21.4") | ||
| 769 | |||
| 755 | (defcustom list-matching-lines-default-context-lines 0 | 770 | (defcustom list-matching-lines-default-context-lines 0 |
| 756 | "*Default number of context lines included around `list-matching-lines' matches. | 771 | "*Default number of context lines included around `list-matching-lines' matches. |
| 757 | A negative number means to include that many lines before the match. | 772 | A negative number means to include that many lines before the match. |
| @@ -761,7 +776,7 @@ A positive number means to include that many lines both before and after." | |||
| 761 | 776 | ||
| 762 | (defalias 'list-matching-lines 'occur) | 777 | (defalias 'list-matching-lines 'occur) |
| 763 | 778 | ||
| 764 | (defcustom list-matching-lines-face 'bold | 779 | (defcustom list-matching-lines-face 'match |
| 765 | "*Face used by \\[list-matching-lines] to show the text that matches. | 780 | "*Face used by \\[list-matching-lines] to show the text that matches. |
| 766 | If the value is nil, don't highlight the matching portions specially." | 781 | If the value is nil, don't highlight the matching portions specially." |
| 767 | :type 'face | 782 | :type 'face |
| @@ -776,18 +791,22 @@ If the value is nil, don't highlight the buffer names specially." | |||
| 776 | (defun occur-accumulate-lines (count &optional keep-props) | 791 | (defun occur-accumulate-lines (count &optional keep-props) |
| 777 | (save-excursion | 792 | (save-excursion |
| 778 | (let ((forwardp (> count 0)) | 793 | (let ((forwardp (> count 0)) |
| 779 | (result nil)) | 794 | result beg end) |
| 780 | (while (not (or (zerop count) | 795 | (while (not (or (zerop count) |
| 781 | (if forwardp | 796 | (if forwardp |
| 782 | (eobp) | 797 | (eobp) |
| 783 | (bobp)))) | 798 | (bobp)))) |
| 784 | (setq count (+ count (if forwardp -1 1))) | 799 | (setq count (+ count (if forwardp -1 1))) |
| 800 | (setq beg (line-beginning-position) | ||
| 801 | end (line-end-position)) | ||
| 802 | (if (and keep-props (boundp 'jit-lock-mode) jit-lock-mode | ||
| 803 | (text-property-not-all beg end 'fontified t)) | ||
| 804 | (jit-lock-fontify-now beg end)) | ||
| 785 | (push | 805 | (push |
| 786 | (funcall (if keep-props | 806 | (funcall (if keep-props |
| 787 | #'buffer-substring | 807 | #'buffer-substring |
| 788 | #'buffer-substring-no-properties) | 808 | #'buffer-substring-no-properties) |
| 789 | (line-beginning-position) | 809 | beg end) |
| 790 | (line-end-position)) | ||
| 791 | result) | 810 | result) |
| 792 | (forward-line (if forwardp 1 -1))) | 811 | (forward-line (if forwardp 1 -1))) |
| 793 | (nreverse result)))) | 812 | (nreverse result)))) |
| @@ -982,14 +1001,17 @@ See also `multi-occur'." | |||
| 982 | (when (setq endpt (re-search-forward regexp nil t)) | 1001 | (when (setq endpt (re-search-forward regexp nil t)) |
| 983 | (setq matches (1+ matches)) ;; increment match count | 1002 | (setq matches (1+ matches)) ;; increment match count |
| 984 | (setq matchbeg (match-beginning 0)) | 1003 | (setq matchbeg (match-beginning 0)) |
| 985 | (setq begpt (save-excursion | ||
| 986 | (goto-char matchbeg) | ||
| 987 | (line-beginning-position))) | ||
| 988 | (setq lines (+ lines (1- (count-lines origpt endpt)))) | 1004 | (setq lines (+ lines (1- (count-lines origpt endpt)))) |
| 1005 | (save-excursion | ||
| 1006 | (goto-char matchbeg) | ||
| 1007 | (setq begpt (line-beginning-position) | ||
| 1008 | endpt (line-end-position))) | ||
| 989 | (setq marker (make-marker)) | 1009 | (setq marker (make-marker)) |
| 990 | (set-marker marker matchbeg) | 1010 | (set-marker marker matchbeg) |
| 991 | (setq curstring (buffer-substring begpt | 1011 | (if (and keep-props (boundp 'jit-lock-mode) jit-lock-mode |
| 992 | (line-end-position))) | 1012 | (text-property-not-all begpt endpt 'fontified t)) |
| 1013 | (jit-lock-fontify-now begpt endpt)) | ||
| 1014 | (setq curstring (buffer-substring begpt endpt)) | ||
| 993 | ;; Depropertize the string, and maybe | 1015 | ;; Depropertize the string, and maybe |
| 994 | ;; highlight the matches | 1016 | ;; highlight the matches |
| 995 | (let ((len (length curstring)) | 1017 | (let ((len (length curstring)) |
| @@ -998,17 +1020,15 @@ See also `multi-occur'." | |||
| 998 | (set-text-properties 0 len nil curstring)) | 1020 | (set-text-properties 0 len nil curstring)) |
| 999 | (while (and (< start len) | 1021 | (while (and (< start len) |
| 1000 | (string-match regexp curstring start)) | 1022 | (string-match regexp curstring start)) |
| 1001 | (add-text-properties (match-beginning 0) | 1023 | (add-text-properties |
| 1002 | (match-end 0) | 1024 | (match-beginning 0) (match-end 0) |
| 1003 | (append | 1025 | (append |
| 1004 | `(occur-match t) | 1026 | `(occur-match t) |
| 1005 | (when match-face | 1027 | (when match-face |
| 1006 | ;; Use `face' rather than | 1028 | ;; Use `face' rather than `font-lock-face' here |
| 1007 | ;; `font-lock-face' here | 1029 | ;; so as to override faces copied from the buffer. |
| 1008 | ;; so as to override faces | 1030 | `(face ,match-face))) |
| 1009 | ;; copied from the buffer. | 1031 | curstring) |
| 1010 | `(face ,match-face))) | ||
| 1011 | curstring) | ||
| 1012 | (setq start (match-end 0)))) | 1032 | (setq start (match-end 0)))) |
| 1013 | ;; Generate the string to insert for this match | 1033 | ;; Generate the string to insert for this match |
| 1014 | (let* ((out-line | 1034 | (let* ((out-line |
| @@ -1019,7 +1039,10 @@ See also `multi-occur'." | |||
| 1019 | (when prefix-face | 1039 | (when prefix-face |
| 1020 | `(font-lock-face prefix-face)) | 1040 | `(font-lock-face prefix-face)) |
| 1021 | '(occur-prefix t))) | 1041 | '(occur-prefix t))) |
| 1022 | curstring | 1042 | ;; We don't put `mouse-face' on the newline, |
| 1043 | ;; because that loses. And don't put it | ||
| 1044 | ;; on context lines to reduce flicker. | ||
| 1045 | (propertize curstring 'mouse-face 'highlight) | ||
| 1023 | "\n")) | 1046 | "\n")) |
| 1024 | (data | 1047 | (data |
| 1025 | (if (= nlines 0) | 1048 | (if (= nlines 0) |
| @@ -1043,10 +1066,7 @@ See also `multi-occur'." | |||
| 1043 | (insert "-------\n")) | 1066 | (insert "-------\n")) |
| 1044 | (add-text-properties | 1067 | (add-text-properties |
| 1045 | beg end | 1068 | beg end |
| 1046 | `(occur-target ,marker help-echo "mouse-2: go to this occurrence")) | 1069 | `(occur-target ,marker help-echo "mouse-2: go to this occurrence"))))) |
| 1047 | ;; We don't put `mouse-face' on the newline, | ||
| 1048 | ;; because that loses. | ||
| 1049 | (add-text-properties beg (1- end) '(mouse-face highlight))))) | ||
| 1050 | (goto-char endpt)) | 1070 | (goto-char endpt)) |
| 1051 | (if endpt | 1071 | (if endpt |
| 1052 | (progn | 1072 | (progn |
| @@ -1283,6 +1303,7 @@ make, or the user didn't cancel the call." | |||
| 1283 | 1303 | ||
| 1284 | (isearch-string isearch-string) | 1304 | (isearch-string isearch-string) |
| 1285 | (isearch-regexp isearch-regexp) | 1305 | (isearch-regexp isearch-regexp) |
| 1306 | (isearch-case-fold-search isearch-case-fold-search) | ||
| 1286 | (message | 1307 | (message |
| 1287 | (if query-flag | 1308 | (if query-flag |
| 1288 | (substitute-command-keys | 1309 | (substitute-command-keys |
| @@ -1315,9 +1336,11 @@ make, or the user didn't cancel the call." | |||
| 1315 | (if regexp-flag from-string | 1336 | (if regexp-flag from-string |
| 1316 | (regexp-quote from-string)) | 1337 | (regexp-quote from-string)) |
| 1317 | "\\b"))) | 1338 | "\\b"))) |
| 1318 | (if (eq query-replace-highlight 'isearch) | 1339 | (when query-replace-lazy-highlight |
| 1319 | (setq isearch-string search-string | 1340 | (setq isearch-string search-string |
| 1320 | isearch-regexp regexp-flag)) | 1341 | isearch-regexp (or delimited-flag regexp-flag) |
| 1342 | isearch-case-fold-search case-fold-search | ||
| 1343 | isearch-lazy-highlight-last-string nil)) | ||
| 1321 | 1344 | ||
| 1322 | (push-mark) | 1345 | (push-mark) |
| 1323 | (undo-boundary) | 1346 | (undo-boundary) |
| @@ -1535,13 +1558,15 @@ make, or the user didn't cancel the call." | |||
| 1535 | (append (listify-key-sequence key) | 1558 | (append (listify-key-sequence key) |
| 1536 | unread-command-events)) | 1559 | unread-command-events)) |
| 1537 | (setq done t))) | 1560 | (setq done t))) |
| 1538 | (when (eq query-replace-highlight 'isearch) | 1561 | (when query-replace-lazy-highlight |
| 1539 | ;; Force isearch rehighlighting | 1562 | ;; Restore isearch data for lazy highlighting |
| 1540 | (if (not (memq def '(skip backup))) | 1563 | ;; in case of isearching during recursive edit |
| 1541 | (setq isearch-lazy-highlight-last-string nil)) | ||
| 1542 | ;; Restore isearch data in case of isearching during edit | ||
| 1543 | (setq isearch-string search-string | 1564 | (setq isearch-string search-string |
| 1544 | isearch-regexp regexp-flag))) | 1565 | isearch-regexp (or delimited-flag regexp-flag) |
| 1566 | isearch-case-fold-search case-fold-search) | ||
| 1567 | ;; Force lazy rehighlighting only after replacements | ||
| 1568 | (if (not (memq def '(skip backup))) | ||
| 1569 | (setq isearch-lazy-highlight-last-string nil)))) | ||
| 1545 | ;; Record previous position for ^ when we move on. | 1570 | ;; Record previous position for ^ when we move on. |
| 1546 | ;; Change markers to numbers in the match data | 1571 | ;; Change markers to numbers in the match data |
| 1547 | ;; since lots of markers slow down editing. | 1572 | ;; since lots of markers slow down editing. |
| @@ -1576,38 +1601,45 @@ make, or the user didn't cancel the call." | |||
| 1576 | (if (= replace-count 1) "" "s"))) | 1601 | (if (= replace-count 1) "" "s"))) |
| 1577 | (and keep-going stack))) | 1602 | (and keep-going stack))) |
| 1578 | 1603 | ||
| 1579 | (defcustom query-replace-highlight | 1604 | (defcustom query-replace-highlight t |
| 1580 | (if (and search-highlight isearch-lazy-highlight) 'isearch t) | 1605 | "*Non-nil means to highlight matches during query replacement." |
| 1581 | "*Non-nil means to highlight words during query replacement. | 1606 | :type 'boolean |
| 1582 | If `isearch', use isearch highlighting for query replacement." | ||
| 1583 | :type '(choice (const :tag "Highlight" t) | ||
| 1584 | (const :tag "No highlighting" nil) | ||
| 1585 | (const :tag "Isearch highlighting" 'isearch)) | ||
| 1586 | :group 'matching) | 1607 | :group 'matching) |
| 1587 | 1608 | ||
| 1609 | (defcustom query-replace-lazy-highlight t | ||
| 1610 | "*Controls the lazy-highlighting during query replacements. | ||
| 1611 | When non-nil, all text in the buffer matching the current match | ||
| 1612 | is highlighted lazily using isearch lazy highlighting (see | ||
| 1613 | `isearch-lazy-highlight-initial-delay' and | ||
| 1614 | `isearch-lazy-highlight-interval')." | ||
| 1615 | :type 'boolean | ||
| 1616 | :group 'matching | ||
| 1617 | :version "21.4") | ||
| 1618 | |||
| 1619 | (defface query-replace | ||
| 1620 | '((t (:inherit isearch))) | ||
| 1621 | "Face for highlighting query replacement matches." | ||
| 1622 | :group 'matching | ||
| 1623 | :version "21.4") | ||
| 1624 | |||
| 1588 | (defvar replace-overlay nil) | 1625 | (defvar replace-overlay nil) |
| 1589 | 1626 | ||
| 1627 | (defun replace-highlight (beg end) | ||
| 1628 | (if query-replace-highlight | ||
| 1629 | (if replace-overlay | ||
| 1630 | (move-overlay replace-overlay beg end (current-buffer)) | ||
| 1631 | (setq replace-overlay (make-overlay beg end)) | ||
| 1632 | (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays | ||
| 1633 | (overlay-put replace-overlay 'face 'query-replace))) | ||
| 1634 | (if query-replace-lazy-highlight | ||
| 1635 | (isearch-lazy-highlight-new-loop))) | ||
| 1636 | |||
| 1590 | (defun replace-dehighlight () | 1637 | (defun replace-dehighlight () |
| 1591 | (cond ((eq query-replace-highlight 'isearch) | 1638 | (when replace-overlay |
| 1592 | (isearch-dehighlight t) | 1639 | (delete-overlay replace-overlay)) |
| 1593 | (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup) | 1640 | (when query-replace-lazy-highlight |
| 1594 | (setq isearch-lazy-highlight-last-string nil)) | 1641 | (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup) |
| 1595 | (query-replace-highlight | 1642 | (setq isearch-lazy-highlight-last-string nil))) |
| 1596 | (when replace-overlay | ||
| 1597 | (delete-overlay replace-overlay) | ||
| 1598 | (setq replace-overlay nil))))) | ||
| 1599 | |||
| 1600 | (defun replace-highlight (start end) | ||
| 1601 | (cond ((eq query-replace-highlight 'isearch) | ||
| 1602 | (isearch-highlight start end) | ||
| 1603 | (isearch-lazy-highlight-new-loop)) | ||
| 1604 | (query-replace-highlight | ||
| 1605 | (if replace-overlay | ||
| 1606 | (move-overlay replace-overlay start end (current-buffer)) | ||
| 1607 | (setq replace-overlay (make-overlay start end)) | ||
| 1608 | (overlay-put replace-overlay 'face | ||
| 1609 | (if (facep 'query-replace) | ||
| 1610 | 'query-replace 'region)))))) | ||
| 1611 | 1643 | ||
| 1612 | ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 | 1644 | ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 |
| 1613 | ;;; replace.el ends here | 1645 | ;;; replace.el ends here |
diff --git a/lisp/simple.el b/lisp/simple.el index 4a95b18bcb9..a87a30e1786 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -645,10 +645,6 @@ If BACKWARD-ONLY is non-nil, only delete spaces before point." | |||
| 645 | (skip-chars-forward " \t") | 645 | (skip-chars-forward " \t") |
| 646 | (constrain-to-field nil orig-pos t))))) | 646 | (constrain-to-field nil orig-pos t))))) |
| 647 | 647 | ||
| 648 | (defvar inhibit-mark-movement nil | ||
| 649 | "If non-nil, movement commands, such as \\[beginning-of-buffer], \ | ||
| 650 | do not set the mark.") | ||
| 651 | |||
| 652 | (defun beginning-of-buffer (&optional arg) | 648 | (defun beginning-of-buffer (&optional arg) |
| 653 | "Move point to the beginning of the buffer; leave mark at previous position. | 649 | "Move point to the beginning of the buffer; leave mark at previous position. |
| 654 | With \\[universal-argument] prefix, do not set mark at previous position. | 650 | With \\[universal-argument] prefix, do not set mark at previous position. |
| @@ -660,8 +656,7 @@ of the accessible part of the buffer. | |||
| 660 | Don't use this command in Lisp programs! | 656 | Don't use this command in Lisp programs! |
| 661 | \(goto-char (point-min)) is faster and avoids clobbering the mark." | 657 | \(goto-char (point-min)) is faster and avoids clobbering the mark." |
| 662 | (interactive "P") | 658 | (interactive "P") |
| 663 | (or inhibit-mark-movement | 659 | (or (consp arg) |
| 664 | (consp arg) | ||
| 665 | (and transient-mark-mode mark-active) | 660 | (and transient-mark-mode mark-active) |
| 666 | (push-mark)) | 661 | (push-mark)) |
| 667 | (let ((size (- (point-max) (point-min)))) | 662 | (let ((size (- (point-max) (point-min)))) |
| @@ -686,8 +681,7 @@ of the accessible part of the buffer. | |||
| 686 | Don't use this command in Lisp programs! | 681 | Don't use this command in Lisp programs! |
| 687 | \(goto-char (point-max)) is faster and avoids clobbering the mark." | 682 | \(goto-char (point-max)) is faster and avoids clobbering the mark." |
| 688 | (interactive "P") | 683 | (interactive "P") |
| 689 | (or inhibit-mark-movement | 684 | (or (consp arg) |
| 690 | (consp arg) | ||
| 691 | (and transient-mark-mode mark-active) | 685 | (and transient-mark-mode mark-active) |
| 692 | (push-mark)) | 686 | (push-mark)) |
| 693 | (let ((size (- (point-max) (point-min)))) | 687 | (let ((size (- (point-max) (point-min)))) |
| @@ -1490,6 +1484,17 @@ is not *inside* the region START...END." | |||
| 1490 | (t | 1484 | (t |
| 1491 | '(0 . 0))) | 1485 | '(0 . 0))) |
| 1492 | '(0 . 0))) | 1486 | '(0 . 0))) |
| 1487 | |||
| 1488 | ;; When the first undo batch in an undo list is longer than undo-outer-limit, | ||
| 1489 | ;; this function gets called to ask the user what to do. | ||
| 1490 | ;; Garbage collection is inhibited around the call, | ||
| 1491 | ;; so it had better not do a lot of consing. | ||
| 1492 | (setq undo-outer-limit-function 'undo-outer-limit-truncate) | ||
| 1493 | (defun undo-outer-limit-truncate (size) | ||
| 1494 | (if (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " | ||
| 1495 | (buffer-name) size)) | ||
| 1496 | (progn (setq buffer-undo-list nil) t) | ||
| 1497 | nil)) | ||
| 1493 | 1498 | ||
| 1494 | (defvar shell-command-history nil | 1499 | (defvar shell-command-history nil |
| 1495 | "History list for some commands that read shell commands.") | 1500 | "History list for some commands that read shell commands.") |
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index f6a1c1d5cce..f3a7616bfd6 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -1975,7 +1975,7 @@ SPC: Accept word this time. | |||
| 1975 | (sit-for 5) | 1975 | (sit-for 5) |
| 1976 | (kill-buffer "*Ispell Help*")) | 1976 | (kill-buffer "*Ispell Help*")) |
| 1977 | (unwind-protect | 1977 | (unwind-protect |
| 1978 | (progn | 1978 | (let ((resize-mini-windows 'grow-only)) |
| 1979 | (select-window (minibuffer-window)) | 1979 | (select-window (minibuffer-window)) |
| 1980 | (erase-buffer) | 1980 | (erase-buffer) |
| 1981 | (message nil) | 1981 | (message nil) |
diff --git a/lisp/tooltip.el b/lisp/tooltip.el index 5bcb28dde52..2e60df02459 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; tooltip.el --- show tooltip windows | 1 | ;;; tooltip.el --- show tooltip windows |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004 |
| 4 | ;; Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; Author: Gerd Moellmann <gerd@acm.org> | 6 | ;; Author: Gerd Moellmann <gerd@acm.org> |
| 6 | ;; Keywords: help c mouse tools | 7 | ;; Keywords: help c mouse tools |
| @@ -476,7 +477,25 @@ This function must return nil if it doesn't handle EVENT." | |||
| 476 | (defun tooltip-show-help-function (msg) | 477 | (defun tooltip-show-help-function (msg) |
| 477 | "Function installed as `show-help-function'. | 478 | "Function installed as `show-help-function'. |
| 478 | MSG is either a help string to display, or nil to cancel the display." | 479 | MSG is either a help string to display, or nil to cancel the display." |
| 479 | (let ((previous-help tooltip-help-message)) | 480 | (let ((previous-help tooltip-help-message) |
| 481 | mp pos) | ||
| 482 | (if (and mouse-1-click-follows-link | ||
| 483 | (stringp msg) | ||
| 484 | (save-match-data | ||
| 485 | (string-match "^mouse-2" msg)) | ||
| 486 | (setq mp (mouse-pixel-position)) | ||
| 487 | (consp (setq pos (cdr mp))) | ||
| 488 | (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp))) | ||
| 489 | (windowp (posn-window pos))) | ||
| 490 | (with-current-buffer (window-buffer (posn-window pos)) | ||
| 491 | (if (mouse-on-link-p (posn-point pos)) | ||
| 492 | (setq msg (concat | ||
| 493 | (cond | ||
| 494 | ((eq mouse-1-click-follows-link 'double) "double-") | ||
| 495 | ((and (integerp mouse-1-click-follows-link) | ||
| 496 | (< mouse-1-click-follows-link 0)) "Long ") | ||
| 497 | (t "")) | ||
| 498 | "mouse-1" (substring msg 7)))))) | ||
| 480 | (setq tooltip-help-message msg) | 499 | (setq tooltip-help-message msg) |
| 481 | (cond ((null msg) | 500 | (cond ((null msg) |
| 482 | ;; Cancel display. This also cancels a delayed tip, if | 501 | ;; Cancel display. This also cancels a delayed tip, if |
diff --git a/lisp/vc.el b/lisp/vc.el index 63e9be651d9..64de0351922 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -2836,7 +2836,7 @@ Uses `rcs2log' which only works for RCS and CVS." | |||
| 2836 | (pop-to-buffer | 2836 | (pop-to-buffer |
| 2837 | (set-buffer (get-buffer-create "*vc*"))) | 2837 | (set-buffer (get-buffer-create "*vc*"))) |
| 2838 | (erase-buffer) | 2838 | (erase-buffer) |
| 2839 | (insert-file tempfile) | 2839 | (insert-file-contents tempfile) |
| 2840 | "failed")) | 2840 | "failed")) |
| 2841 | (setq default-directory (file-name-directory changelog)) | 2841 | (setq default-directory (file-name-directory changelog)) |
| 2842 | (delete-file tempfile))))) | 2842 | (delete-file tempfile))))) |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index f3d7657984f..46eb608c690 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -327,6 +327,7 @@ new value.") | |||
| 327 | (let ((keymap (widget-get widget :keymap)) | 327 | (let ((keymap (widget-get widget :keymap)) |
| 328 | (face (or (widget-get widget :value-face) 'widget-field-face)) | 328 | (face (or (widget-get widget :value-face) 'widget-field-face)) |
| 329 | (help-echo (widget-get widget :help-echo)) | 329 | (help-echo (widget-get widget :help-echo)) |
| 330 | (follow-link (widget-get widget :follow-link)) | ||
| 330 | (rear-sticky | 331 | (rear-sticky |
| 331 | (or (not widget-field-add-space) (widget-get widget :size)))) | 332 | (or (not widget-field-add-space) (widget-get widget :size)))) |
| 332 | (if (functionp help-echo) | 333 | (if (functionp help-echo) |
| @@ -345,6 +346,7 @@ new value.") | |||
| 345 | ;; works in the field when, say, Custom uses `suppress-keymap'. | 346 | ;; works in the field when, say, Custom uses `suppress-keymap'. |
| 346 | (overlay-put overlay 'local-map keymap) | 347 | (overlay-put overlay 'local-map keymap) |
| 347 | (overlay-put overlay 'face face) | 348 | (overlay-put overlay 'face face) |
| 349 | (overlay-put overlay 'follow-link follow-link) | ||
| 348 | (overlay-put overlay 'help-echo help-echo)) | 350 | (overlay-put overlay 'help-echo help-echo)) |
| 349 | (setq to (1- to)) | 351 | (setq to (1- to)) |
| 350 | (setq rear-sticky t)) | 352 | (setq rear-sticky t)) |
| @@ -354,6 +356,7 @@ new value.") | |||
| 354 | (overlay-put overlay 'field widget) | 356 | (overlay-put overlay 'field widget) |
| 355 | (overlay-put overlay 'local-map keymap) | 357 | (overlay-put overlay 'local-map keymap) |
| 356 | (overlay-put overlay 'face face) | 358 | (overlay-put overlay 'face face) |
| 359 | (overlay-put overlay 'follow-link follow-link) | ||
| 357 | (overlay-put overlay 'help-echo help-echo))) | 360 | (overlay-put overlay 'help-echo help-echo))) |
| 358 | (widget-specify-secret widget)) | 361 | (widget-specify-secret widget)) |
| 359 | 362 | ||
| @@ -378,6 +381,7 @@ new value.") | |||
| 378 | (defun widget-specify-button (widget from to) | 381 | (defun widget-specify-button (widget from to) |
| 379 | "Specify button for WIDGET between FROM and TO." | 382 | "Specify button for WIDGET between FROM and TO." |
| 380 | (let ((overlay (make-overlay from to nil t nil)) | 383 | (let ((overlay (make-overlay from to nil t nil)) |
| 384 | (follow-link (widget-get widget :follow-link)) | ||
| 381 | (help-echo (widget-get widget :help-echo))) | 385 | (help-echo (widget-get widget :help-echo))) |
| 382 | (widget-put widget :button-overlay overlay) | 386 | (widget-put widget :button-overlay overlay) |
| 383 | (if (functionp help-echo) | 387 | (if (functionp help-echo) |
| @@ -389,6 +393,7 @@ new value.") | |||
| 389 | (unless (widget-get widget :suppress-face) | 393 | (unless (widget-get widget :suppress-face) |
| 390 | (overlay-put overlay 'face (widget-apply widget :button-face-get))) | 394 | (overlay-put overlay 'face (widget-apply widget :button-face-get))) |
| 391 | (overlay-put overlay 'pointer 'hand) | 395 | (overlay-put overlay 'pointer 'hand) |
| 396 | (overlay-put overlay 'follow-link follow-link) | ||
| 392 | (overlay-put overlay 'help-echo help-echo))) | 397 | (overlay-put overlay 'help-echo help-echo))) |
| 393 | 398 | ||
| 394 | (defun widget-mouse-help (window overlay point) | 399 | (defun widget-mouse-help (window overlay point) |
| @@ -1705,6 +1710,7 @@ If END is omitted, it defaults to the length of LIST." | |||
| 1705 | "An embedded link." | 1710 | "An embedded link." |
| 1706 | :button-prefix 'widget-link-prefix | 1711 | :button-prefix 'widget-link-prefix |
| 1707 | :button-suffix 'widget-link-suffix | 1712 | :button-suffix 'widget-link-suffix |
| 1713 | :follow-link "\C-m" | ||
| 1708 | :help-echo "Follow the link." | 1714 | :help-echo "Follow the link." |
| 1709 | :format "%[%t%]") | 1715 | :format "%[%t%]") |
| 1710 | 1716 | ||