diff options
| author | Miles Bader | 2006-05-02 05:51:52 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-05-02 05:51:52 +0000 |
| commit | fe682fb2f05fcbd9fcd2d12c2110719adcfcb58a (patch) | |
| tree | 2a89d2d9ea2689cfe80a7618885cdd9f449761dd /lisp | |
| parent | 7e635d0ed3c42e6e779821f5c0c1c62289f4c1ee (diff) | |
| parent | 6cf93749317c2e18f850cd0f47f905895e850bfc (diff) | |
| download | emacs-fe682fb2f05fcbd9fcd2d12c2110719adcfcb58a.tar.gz emacs-fe682fb2f05fcbd9fcd2d12c2110719adcfcb58a.zip | |
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-58
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 239-258)
- Update from CVS
- (Ffield_beginning, find_field): Undo change of 2006-04-23.
- Rcirc patch from Ryan Yeske
- Merge from gnus--rel--5.10
- Clean up lisp/gnus/ChangeLog a bit
* gnus--rel--5.10 (patch 91-98)
- Merge from emacs--devo--0
- Update from CVS
Diffstat (limited to 'lisp')
65 files changed, 1883 insertions, 1177 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 56ee9cb71e6..b39bebc7215 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,6 +1,303 @@ | |||
| 1 | 2006-05-01 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C, | ||
| 4 | M-r, M-R, M-A, M-SPC or M-DEL. | ||
| 5 | (diff-mode-map): diff-refine-hunk now on C-c C-w | ||
| 6 | (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u. | ||
| 7 | |||
| 8 | * help-mode.el (help-mode): view-exit-action calls delete-window | ||
| 9 | only when it is safe and possible. | ||
| 10 | |||
| 11 | * simple.el (undo-outer-limit-truncate): Put quotes around buffer name | ||
| 12 | in messages. | ||
| 13 | |||
| 14 | * emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes. | ||
| 15 | |||
| 16 | * tool-bar.el (tool-bar-setup): Put Help and Preferences items | ||
| 17 | in the default tool-bar-map. | ||
| 18 | |||
| 19 | 2006-05-01 Michael Albinus <michael.albinus@gmx.de> | ||
| 20 | |||
| 21 | * net/tramp.el (tramp-completion-file-name-handler-alist) | ||
| 22 | (tramp-run-real-handler, tramp-completion-run-real-handler) | ||
| 23 | (tramp-completion-handle-file-name-all-completions) | ||
| 24 | (tramp-completion-handle-file-name-completion): Autoload them. | ||
| 25 | (tramp-completion-handle-file-exists-p) | ||
| 26 | (tramp-completion-handle-file-name-directory) | ||
| 27 | (tramp-completion-handle-file-name-nondirectory) | ||
| 28 | (tramp-completion-handle-expand-file-name): Remove them. | ||
| 29 | (tramp-handle-file-name-directory): Return the real directory | ||
| 30 | name. Returning "/" only doesn't need to be necessary any longer. | ||
| 31 | (tramp-file-name-handler): Make special attention when in hostname | ||
| 32 | completion mode. | ||
| 33 | (tramp-completion-file-name-handler): Revert patch from | ||
| 34 | 2006-04-28. | ||
| 35 | (tramp-register-file-name-handlers): Register | ||
| 36 | `tramp-completion-file-name-handler' only when | ||
| 37 | `partial-completion-mode is enabled. | ||
| 38 | (tramp-completion-handle-file-name-all-completions): Delete | ||
| 39 | directory part from results. | ||
| 40 | (tramp-get-completion-methods, tramp-get-completion-user-host): | ||
| 41 | Discard deleting "/", it doesn't work after the change of | ||
| 42 | `tramp-handle-file-name-directory' above. | ||
| 43 | |||
| 44 | 2006-05-01 Kim F. Storm <storm@cua.dk> | ||
| 45 | |||
| 46 | * progmodes/grep.el (grep-expand-template): Use save-match-data. | ||
| 47 | |||
| 48 | 2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 49 | |||
| 50 | * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use | ||
| 51 | select-frame-set-input-focus instead of raise-frame. | ||
| 52 | (global-map): Bind M-drag-n-drop to mac-drag-n-drop. | ||
| 53 | |||
| 54 | 2006-05-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 55 | |||
| 56 | * progmodes/gud.el (gud-def): Add %c case. | ||
| 57 | (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily. | ||
| 58 | (gud-format-command): Make match case sensitive. Match on %F. | ||
| 59 | |||
| 60 | 2006-04-30 Glenn Morris <rgm@gnu.org> | ||
| 61 | |||
| 62 | * calendar/cal-tex.el (cal-tex-preamble-extra): New variable. | ||
| 63 | (cal-tex-preamble): Use cal-tex-preamble-extra. | ||
| 64 | (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather | ||
| 65 | than alias `list-diary-entries'. | ||
| 66 | |||
| 67 | 2006-04-29 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 68 | |||
| 69 | * help-fns.el (describe-variable): Add info about safe local variables. | ||
| 70 | |||
| 71 | 2006-04-29 Richard Stallman <rms@gnu.org> | ||
| 72 | |||
| 73 | * bindings.el (mode-line-format): help-echo doc fixes. | ||
| 74 | |||
| 75 | * net/tramp.el (tramp-file-name-handler-alist): Delete | ||
| 76 | expand-file-name and other operations that can cause spurious loading. | ||
| 77 | |||
| 78 | 2006-04-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 79 | |||
| 80 | * files.el (safe-local-variable-p): Remove support for the special | ||
| 81 | value t. | ||
| 82 | |||
| 83 | * textmodes/paragraphs.el (sentence-end-without-space): | ||
| 84 | Fix safety predicate. | ||
| 85 | (sentence-end-double-space, sentence-end-without-period) | ||
| 86 | (paragraph-ignore-fill-prefix): | ||
| 87 | * textmodes/fill.el (colon-double-space): | ||
| 88 | * abbrev.el (abbrev-mode): Tighten the safety predicate. | ||
| 89 | |||
| 90 | * subr.el (booleanp): New fun. | ||
| 91 | |||
| 92 | * textmodes/reftex-vars.el (reftex-guess-label-type): | ||
| 93 | Tighten the safety predicate. | ||
| 94 | |||
| 95 | 2006-04-28 Kim F. Storm <storm@cua.dk> | ||
| 96 | |||
| 97 | * progmodes/grep.el (defgroup grep): Doc fix. | ||
| 98 | (grep-auto-highlight): Remove. | ||
| 99 | (grep-template): New defcustom. | ||
| 100 | (grep-find-template): Rename from grep-tree-template. | ||
| 101 | (grep-files-aliases): Rename from grep-tree-files-aliases. | ||
| 102 | Remove "all" alias, add "l" alias. | ||
| 103 | (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove. | ||
| 104 | (grep-find-ignored-directories): New defcustom to replace | ||
| 105 | grep-tree-ignore-CVS-directories, to facilitate ignoring | ||
| 106 | subdirectories for multiple version control systems. | ||
| 107 | (grep-mode-map): Add Recursive grep item to GREP menu. | ||
| 108 | (grep-regexp-history, grep-files-history): New defvars. | ||
| 109 | (grep-probe): New helper function. | ||
| 110 | (grep-compute-defaults): Use it to simplify code. | ||
| 111 | Adapt to name changes. | ||
| 112 | Use `.' as base in grep-find-template rather than <D>. | ||
| 113 | (grep): Remove superfluous highlight-regexp arg. Fix doc. | ||
| 114 | Call grep-compute-defaults unconditionally. | ||
| 115 | (grep-expand-keywords): New defconst. | ||
| 116 | (grep-expand-template): Rename from grep-expand-command-macros. | ||
| 117 | Simplify via grep-expand-keywords. Look at case-fold-search instead | ||
| 118 | of grep-tree-ignore-case to add -i option. | ||
| 119 | Bind case-fold-search to nil while matching keywords. | ||
| 120 | (grep-tree-last-regexp, grep-tree-last-files): Remove. | ||
| 121 | (grep-read-regexp, grep-read-files): New helper functions. | ||
| 122 | (rgrep): Rename from grep-tree. Rework to use proper histories. | ||
| 123 | Adapt to changes in defcustoms and functions above. | ||
| 124 | (lgrep): New command, as grep, but using same interactive api as rgrep. | ||
| 125 | |||
| 126 | 2006-04-28 Michael Albinus <michael.albinus@gmx.de> | ||
| 127 | |||
| 128 | * net/tramp.el (tramp-completion-file-name-handler): | ||
| 129 | Disable Tramp's functionality while loading Tramp itself. | ||
| 130 | (tramp-register-file-name-handlers): That's a defsubst now. | ||
| 131 | Code from `tramp-repair-jka-compr' moved here. Apply it via | ||
| 132 | `after-init-hook'. | ||
| 133 | (tramp-repair-jka-compr): Remove. | ||
| 134 | |||
| 135 | 2006-04-27 Jay Belanger <belanger@truman.edu> | ||
| 136 | |||
| 137 | * calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to | ||
| 138 | read expression when `math-read-big-expr' doesn't work. | ||
| 139 | |||
| 140 | 2006-04-27 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 141 | |||
| 142 | * startup.el (command-line-1): Display warning when | ||
| 143 | pure-space-overflow is non-nil. | ||
| 144 | |||
| 145 | 2006-04-26 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> | ||
| 146 | |||
| 147 | * textmodes/bibtex.el (bibtex-user-optional-fields): Mark as | ||
| 148 | risky. | ||
| 149 | |||
| 150 | 2006-04-26 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> | ||
| 151 | |||
| 152 | * textmodes/bibtex.el (bibtex-url): New optional arg no-browse. | ||
| 153 | Return the URL or nil if none can be generated. | ||
| 154 | |||
| 155 | 2006-04-27 Nick Roberts <nickrob@snap.net.nz> | ||
| 156 | |||
| 157 | * progmodes/gud.el (gud-comint-buffer): Move forward to stop | ||
| 158 | byte compiler warnings. | ||
| 159 | (gud-basic-call, gud-find-expr): Let user select an expression | ||
| 160 | for printing. Print expression as well as value in GUD buffer. | ||
| 161 | |||
| 162 | 2006-04-17 Ken Manheimer <ken.manheimer@gmail.com> | ||
| 163 | |||
| 164 | * allout.el: Remove local autoload declaration for | ||
| 165 | pgg-gpg-symmetric-key-p, since that's now done in pgg-gpg.el. | ||
| 166 | (allout-show-bodies, allout-header-prefix, allout-primary-bullet) | ||
| 167 | (allout-plain-bullets-string, allout-distinctive-bullets-string) | ||
| 168 | (allout-use-mode-specific-leader, allout-old-style-prefixes) | ||
| 169 | (allout-stylish-prefixes, allout-numbered-bullet) | ||
| 170 | (allout-file-xref-bullet, allout-presentation-padding) | ||
| 171 | (allout-use-hanging-indents, allout-reindent-bodies): Mark as | ||
| 172 | safe-local-variable with suitable value spec, and add autoload | ||
| 173 | cookie for loaddefs inclusion. We now use an explicit spec everywhere. | ||
| 174 | (move-beginning-of-line, move-end-of-line): Repair so these compat | ||
| 175 | functions now actually resituate the point, when appropriate. | ||
| 176 | |||
| 177 | 2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 178 | |||
| 179 | * progmodes/cc-subword.el (c-subword-mode-map): Use command remapping. | ||
| 180 | |||
| 181 | * add-log.el (add-log-iso8601-time-zone): Make parameter optional. | ||
| 182 | (add-log-iso8601-time-string): Fix call to format-time-string. | ||
| 183 | |||
| 184 | 2006-04-26 Kim F. Storm <storm@cua.dk> | ||
| 185 | |||
| 186 | * subr.el (posn-string, posn-image, posn-object): Doc fix. | ||
| 187 | |||
| 188 | 2006-04-26 Masatake YAMATO <jet@gyve.org> | ||
| 189 | |||
| 190 | * progmodes/asm-mode.el (asm-mode, asm-mode-syntax-table): | ||
| 191 | Add support for "//" style comments. Remove `b' flag | ||
| 192 | from ?* in `asm-mode-syntax-table'. | ||
| 193 | |||
| 194 | 2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 195 | |||
| 196 | * follow.el: Use (featurep 'xemacs) everywhere. | ||
| 197 | (follow-mode): Use define-minor-mode. | ||
| 198 | (follow-mode-map): Move initialization into the declaration. | ||
| 199 | Use command remapping. | ||
| 200 | (follow-emacs-version-xemacs-p): Remove. | ||
| 201 | (follow-submit-feedback): Remove. | ||
| 202 | |||
| 203 | * allout.el (allout-layout, allout-passphrase-verifier-string) | ||
| 204 | (allout-passphrase-hint-string): Tighten up a bit the safety predicate. | ||
| 205 | |||
| 206 | * textmodes/reftex-vars.el (reftex-vref-is-default) | ||
| 207 | (reftex-fref-is-default, reftex-guess-label-type): | ||
| 208 | Tighten up a bit the safety predicate. | ||
| 209 | |||
| 210 | * textmodes/paragraphs.el (sentence-end-double-space) | ||
| 211 | (sentence-end-without-period, sentence-end-without-space) | ||
| 212 | (page-delimiter, paragraph-ignore-fill-prefix): | ||
| 213 | Tighten up a bit the safety predicate. | ||
| 214 | |||
| 215 | * textmodes/fill.el (colon-double-space): Tighten up the safety pred. | ||
| 216 | |||
| 217 | * progmodes/python.el (python-continuation-line-p) | ||
| 218 | (python-beginning-of-statement): syntax-ppss may return | ||
| 219 | a negative depth. | ||
| 220 | (python-mode): Don't forcefully enable font-lock. | ||
| 221 | |||
| 222 | * time-stamp.el (time-stamp-start, time-stamp-end) | ||
| 223 | (time-stamp-inserts-lines): Tighten up a bit the safety predicate. | ||
| 224 | |||
| 225 | * add-log.el: Remove spurious * in docstrings. | ||
| 226 | (add-log-time-zone-rule): Rename from change-log-time-zone-rule. | ||
| 227 | (add-change-log-entry): Use it here, since it's not specific | ||
| 228 | to iso8601. | ||
| 229 | (add-log-iso8601-time-string): Don't use it here any more. | ||
| 230 | (change-log-indent-text, change-log-indent): Rename from add-log-*. | ||
| 231 | |||
| 232 | * abbrev.el (abbrev-mode): Tighten up a bit the safety predicate. | ||
| 233 | |||
| 234 | 2006-04-25 Ryan Yeske <rcyeske@gmail.com> | ||
| 235 | |||
| 236 | * net/rcirc.el (rcirc-print): Revert last change with ignored nicks. | ||
| 237 | (rcirc-toggle-low-priority): Doc fix. | ||
| 238 | (rcirc-handler-NOTICE): Remove beginning of line anchor in | ||
| 239 | ChanServ regexp. | ||
| 240 | (rcirc-startup-channels-alist): Connect to #rcirc by default, not | ||
| 241 | #emacs. | ||
| 242 | (rcirc-bright-nick-regexp, rcirc-dim-nick-regexp): Add variables. | ||
| 243 | (rcirc-decode-coding-system): Use utf-8 as the default. | ||
| 244 | (rcirc-multiline-minor-mode): Set the fill-column. | ||
| 245 | (rcirc-format-response-string): Display bright and dim nicks. | ||
| 246 | (rcirc-browse-url): Update interactive spec to fill ARG. | ||
| 247 | (rcirc-bright-nick, rcirc-dim-nick): Add faces. | ||
| 248 | (rcirc-print): Ignore dim-nick messages wrt modeline-activity. | ||
| 249 | |||
| 250 | 2006-04-24 J.D. Smith <jdsmith@as.arizona.edu> | ||
| 251 | |||
| 252 | * textmodes/bibtex.el (bibtex-find-entry): Don't demand matching | ||
| 253 | case for @Article, etc. | ||
| 254 | |||
| 255 | 2006-04-23 Michael Albinus <michael.albinus@gmx.de> | ||
| 256 | |||
| 257 | * net/tramp.el (tramp-register-file-name-handlers): New defun. | ||
| 258 | Added with autoload cookie. | ||
| 259 | (tramp-unload-file-name-handlers): Rename from | ||
| 260 | `tramp-unload-file-name-handler-alist'. | ||
| 261 | |||
| 262 | 2006-04-23 Romain Francoise <romain@orebokech.com> | ||
| 263 | |||
| 264 | * comint.el (comint-match-partial-filename): Doc fix. | ||
| 265 | |||
| 266 | 2006-04-21 Glenn Morris <rgm@gnu.org> | ||
| 267 | |||
| 268 | * calendar/cal-menu.el (calendar-mode-map): Refer to | ||
| 269 | `diary-view-entries' rather than alias `view-diary-entries'. | ||
| 270 | * calendar/diary-lib.el (view-other-diary-entries): Ditto. | ||
| 271 | |||
| 272 | 2006-04-21 Luc Teirlinck <teirllm@auburn.edu> | ||
| 273 | |||
| 274 | * progmodes/antlr-mode.el (antlr-default): | ||
| 275 | * cus-edit.el (custom-documentation): | ||
| 276 | * faces.el (scroll-bar, border, cursor, mouse): Avoid nil spec | ||
| 277 | in defface. | ||
| 278 | |||
| 279 | 2006-04-21 Kim F. Storm <storm@cua.dk> | ||
| 280 | |||
| 281 | * image.el (image-type): New defun split out of create-image. | ||
| 282 | (create-image): Use it. | ||
| 283 | |||
| 284 | 2006-04-21 Carsten Dominik <dominik@science.uva.nl> | ||
| 285 | |||
| 286 | * textmodes/org.el (org-mode-map): Catch conflict with old allout.el. | ||
| 287 | (org-open-at-point): Remove the "...done" message to keep output | ||
| 288 | in the echo area visible. | ||
| 289 | (org-export-as-xoxo): Fix call to `indent-region'. | ||
| 290 | |||
| 291 | 2006-04-21 Kevin Ryde <user42@zip.com.au> | ||
| 292 | |||
| 293 | * international/mule.el (keyboard-coding-system): defcustom | ||
| 294 | info-link fixes: "Specify Coding" has been split, keyboard now in | ||
| 295 | "Terminal Coding", and "Single-Byte Character Support" is now | ||
| 296 | "Unibyte Mode". | ||
| 297 | |||
| 1 | 2006-04-21 Nick Roberts <nickrob@snap.net.nz> | 298 | 2006-04-21 Nick Roberts <nickrob@snap.net.nz> |
| 2 | 299 | ||
| 3 | * progmodes/gdb-ui.el (gdb-data-list-register-values-handler): | 300 | * progmodes/gdb-ui.el (gdb-data-list-register-values-handler): |
| 4 | Use font-lock-warning-face for any errors e.g. no stack. | 301 | Use font-lock-warning-face for any errors e.g. no stack. |
| 5 | (gdb-stack-list-locals-handler): Display any errors e.g. no stack. | 302 | (gdb-stack-list-locals-handler): Display any errors e.g. no stack. |
| 6 | 303 | ||
| @@ -13,26 +310,26 @@ | |||
| 13 | 310 | ||
| 14 | 2006-04-20 Carsten Dominik <dominik@science.uva.nl> | 311 | 2006-04-20 Carsten Dominik <dominik@science.uva.nl> |
| 15 | 312 | ||
| 16 | * textmodes/org.el: (org-deadline-announce): Face removed. | 313 | * textmodes/org.el (org-deadline-announce): Face removed. |
| 17 | (org-level-faces, org-n-levels): Converted to constant. | 314 | (org-level-faces, org-n-levels): Convert to constant. |
| 18 | (org-compatible-face): New function. | 315 | (org-compatible-face): New function. |
| 19 | (org-hide, org-level-1, org-level-2, org-level-3, org-level-4) | 316 | (org-hide, org-level-1, org-level-2, org-level-3, org-level-4) |
| 20 | (org-level-5, org-level-6, org-level-7, org-level-8) | 317 | (org-level-5, org-level-6, org-level-7, org-level-8) |
| 21 | (org-special-keyword, org-warning, org-headline-done, org-link) | 318 | (org-special-keyword, org-warning, org-headline-done, org-link) |
| 22 | (org-date, org-tag, org-todo, org-done, org-table, org-formula) | 319 | (org-date, org-tag, org-todo, org-done, org-table, org-formula) |
| 23 | (org-scheduled-today, org-scheduled-previously, org-time-grid): | 320 | (org-scheduled-today, org-scheduled-previously, org-time-grid): |
| 24 | Face definition revised for better color tty support. | 321 | Face definition revised for better color tty support. |
| 25 | (org-bold-re, org-italic-re, org-underline-re): New constants. | 322 | (org-bold-re, org-italic-re, org-underline-re): New constants. |
| 26 | (org-set-font-lock-defaults): Use the new constants. | 323 | (org-set-font-lock-defaults): Use the new constants. |
| 27 | (org-agenda-highlight-todo): New function. | 324 | (org-agenda-highlight-todo): New function. |
| 28 | (org-agenda-todo): Fixed bug with point at end of line. | 325 | (org-agenda-todo): Fix bug with point at end of line. |
| 29 | (org-agenda-change-all-lines, org-finalize-agenda-entries): | 326 | (org-agenda-change-all-lines, org-finalize-agenda-entries): |
| 30 | Fontify TODO keywords. | 327 | Fontify TODO keywords. |
| 31 | (org-insert-link): Preserve relative path in ../ links. | 328 | (org-insert-link): Preserve relative path in ../ links. |
| 32 | (org-export-as-html): Convert links pointing to .org files into | 329 | (org-export-as-html): Convert links pointing to .org files into |
| 33 | links that will work beteen the exported HTML files. | 330 | links that will work beteen the exported HTML files. |
| 34 | (org-todo-list): Fix bug when arg=0. | 331 | (org-todo-list): Fix bug when arg=0. |
| 35 | (org-insert-heading): More fine-tuning. | 332 | (org-insert-heading): More fine-tuning. |
| 36 | 333 | ||
| 37 | 2006-04-19 Romain Francoise <romain@orebokech.com> | 334 | 2006-04-19 Romain Francoise <romain@orebokech.com> |
| 38 | 335 | ||
| @@ -49,12 +346,11 @@ | |||
| 49 | when moving off either end of the input history ring. | 346 | when moving off either end of the input history ring. |
| 50 | (comint-delete-input): New function, used by | 347 | (comint-delete-input): New function, used by |
| 51 | `comint-previous-input' and others. | 348 | `comint-previous-input' and others. |
| 52 | (comint-previous-matching-input): Use | 349 | (comint-previous-matching-input): |
| 53 | `coming-delete-input'. Save the partial input if leaving the | 350 | Use `coming-delete-input'. Save the partial input if leaving the |
| 54 | edit line. Goto point-max before deleting input to avoid | 351 | edit line. Goto point-max before deleting input to avoid |
| 55 | partial input fragments hanging around. | 352 | partial input fragments hanging around. |
| 56 | (comint-restore-input): New function, used by | 353 | (comint-restore-input): New function, used by `comint-previous-input'. |
| 57 | `comint-previous-input', and bound to "C-c C-j". | ||
| 58 | 354 | ||
| 59 | 2006-04-18 Luc Teirlinck <teirllm@auburn.edu> | 355 | 2006-04-18 Luc Teirlinck <teirllm@auburn.edu> |
| 60 | 356 | ||
| @@ -62,8 +358,7 @@ | |||
| 62 | 358 | ||
| 63 | 2006-04-18 Dan Nicolaescu <dann@ics.uci.edu> | 359 | 2006-04-18 Dan Nicolaescu <dann@ics.uci.edu> |
| 64 | 360 | ||
| 65 | * progmodes/python.el (python-mode): Add support for | 361 | * progmodes/python.el (python-mode): Add support for hs-minor-mode. |
| 66 | hs-minor-mode. | ||
| 67 | 362 | ||
| 68 | 2006-04-19 Reiner Steib <Reiner.Steib@gmx.de> | 363 | 2006-04-19 Reiner Steib <Reiner.Steib@gmx.de> |
| 69 | 364 | ||
| @@ -141,7 +436,7 @@ | |||
| 141 | (gdb-frame-address): Re-use to identify frame for watch expression. | 436 | (gdb-frame-address): Re-use to identify frame for watch expression. |
| 142 | (gdb-var-list, gdb-var-create-handler): Add frame address for root | 437 | (gdb-var-list, gdb-var-create-handler): Add frame address for root |
| 143 | variables. | 438 | variables. |
| 144 | (gdb-init-1, gdb-source, gdb-post-prompt, ) | 439 | (gdb-init-1, gdb-source, gdb-post-prompt) |
| 145 | (gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address. | 440 | (gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address. |
| 146 | (gdb-frame-handler): Get gdb-frame-address. | 441 | (gdb-frame-handler): Get gdb-frame-address. |
| 147 | 442 | ||
| @@ -222,7 +517,7 @@ | |||
| 222 | 517 | ||
| 223 | 2006-04-13 Carsten Dominik <dominik@science.uva.nl> | 518 | 2006-04-13 Carsten Dominik <dominik@science.uva.nl> |
| 224 | 519 | ||
| 225 | * textmodes/org.el: (org-set-regexps-and-options) | 520 | * textmodes/org.el (org-set-regexps-and-options) |
| 226 | (org-get-current-options): Better names for the startup folding | 521 | (org-get-current-options): Better names for the startup folding |
| 227 | options. | 522 | options. |
| 228 | 523 | ||
| @@ -231,7 +526,7 @@ | |||
| 231 | * vc.el (vc-annotate): Arrange for point to end up at the same | 526 | * vc.el (vc-annotate): Arrange for point to end up at the same |
| 232 | line number as in the original, but only when using a new buffer. | 527 | line number as in the original, but only when using a new buffer. |
| 233 | 528 | ||
| 234 | 2006-04-12 Davis Herring <herring@lanl.gov> (tiny change) | 529 | 2006-04-12 Stuart Herring <herring@lanl.gov> (tiny change) |
| 235 | 530 | ||
| 236 | * files.el (hack-one-local-variable-eval-safep): | 531 | * files.el (hack-one-local-variable-eval-safep): |
| 237 | Recognize `edebug-form-spec' for `put', but only if it passes | 532 | Recognize `edebug-form-spec' for `put', but only if it passes |
| @@ -245,7 +540,7 @@ | |||
| 245 | 540 | ||
| 246 | 2006-04-13 Carsten Dominik <dominik@science.uva.nl> | 541 | 2006-04-13 Carsten Dominik <dominik@science.uva.nl> |
| 247 | 542 | ||
| 248 | * textmodes/org.el: (org-ctrl-c-ctrl-c): Improve documentation string. | 543 | * textmodes/org.el (org-ctrl-c-ctrl-c): Improve documentation string. |
| 249 | (org-agenda-mouse-1-follows-link) | 544 | (org-agenda-mouse-1-follows-link) |
| 250 | (org-mouse-1-follows-link): New options. | 545 | (org-mouse-1-follows-link): New options. |
| 251 | (org-format-agenda-item): Fix bug if TAGS is nil. | 546 | (org-format-agenda-item): Fix bug if TAGS is nil. |
| @@ -2437,7 +2732,7 @@ | |||
| 2437 | (describe-key-briefly-internal, describe-key-internal): | 2732 | (describe-key-briefly-internal, describe-key-internal): |
| 2438 | Functions merged back into their callers. | 2733 | Functions merged back into their callers. |
| 2439 | 2734 | ||
| 2440 | 2006-02-13 Martin Rudalics <rudalics@gmx.at> (tiny change) | 2735 | 2006-02-13 Martin Rudalics <rudalics@gmx.at> |
| 2441 | 2736 | ||
| 2442 | * info.el (info-xref-visited): Inherit from info-xref too. | 2737 | * info.el (info-xref-visited): Inherit from info-xref too. |
| 2443 | (Info-set-mode-line): Replace occurrences of `%' by `%%' | 2738 | (Info-set-mode-line): Replace occurrences of `%' by `%%' |
| @@ -3585,7 +3880,7 @@ | |||
| 3585 | * add-log.el (add-change-log-entry, change-log-merge): | 3880 | * add-log.el (add-change-log-entry, change-log-merge): |
| 3586 | Conditionally use `hard-newline'. | 3881 | Conditionally use `hard-newline'. |
| 3587 | 3882 | ||
| 3588 | 2006-01-13 Martin Rudalics <rudalics@gmx.at> (tiny change) | 3883 | 2006-01-13 Martin Rudalics <rudalics@gmx.at> |
| 3589 | 3884 | ||
| 3590 | * wid-edit.el (widget-field-end): If the overlay is no longer | 3885 | * wid-edit.el (widget-field-end): If the overlay is no longer |
| 3591 | associated with a buffer, behave as if the overlay didn't exist. | 3886 | associated with a buffer, behave as if the overlay didn't exist. |
| @@ -4595,7 +4890,7 @@ | |||
| 4595 | display-multi-frame-p, use selected-frame when menu-updating-frame | 4890 | display-multi-frame-p, use selected-frame when menu-updating-frame |
| 4596 | is nil. | 4891 | is nil. |
| 4597 | 4892 | ||
| 4598 | 2005-12-20 Davis Herring <herring@lanl.gov> (tiny change) | 4893 | 2005-12-20 Stuart Herring <herring@lanl.gov> (tiny change) |
| 4599 | 4894 | ||
| 4600 | * align.el (align-rules-list): Use [ \t] instead of \s- | 4895 | * align.el (align-rules-list): Use [ \t] instead of \s- |
| 4601 | for column separators in text mode. | 4896 | for column separators in text mode. |
| @@ -4675,7 +4970,7 @@ | |||
| 4675 | * emacs-lisp/edebug.el (edebug-safe-prin1-to-string): | 4970 | * emacs-lisp/edebug.el (edebug-safe-prin1-to-string): |
| 4676 | Capture error from printing circular structures. | 4971 | Capture error from printing circular structures. |
| 4677 | 4972 | ||
| 4678 | 2005-12-17 Martin Rudalics <rudalics@gmx.at> (tiny change) | 4973 | 2005-12-17 Martin Rudalics <rudalics@gmx.at> |
| 4679 | 4974 | ||
| 4680 | * wid-edit.el (widget-checkbox-action): Clear undo info. | 4975 | * wid-edit.el (widget-checkbox-action): Clear undo info. |
| 4681 | 4976 | ||
| @@ -6658,7 +6953,7 @@ | |||
| 6658 | scrolling the help window. Doc fix. | 6953 | scrolling the help window. Doc fix. |
| 6659 | (help-return-method): Doc fix. | 6954 | (help-return-method): Doc fix. |
| 6660 | 6955 | ||
| 6661 | 2005-12-03 Martin Rudalics <rudalics@gmx.at> (tiny change) | 6956 | 2005-12-03 Martin Rudalics <rudalics@gmx.at> |
| 6662 | 6957 | ||
| 6663 | * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug | 6958 | * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug |
| 6664 | whereby names of length one or names starting with a | 6959 | whereby names of length one or names starting with a |
| @@ -7212,7 +7507,7 @@ | |||
| 7212 | 7507 | ||
| 7213 | * custom.el (defcustom): Update link types in docstring. | 7508 | * custom.el (defcustom): Update link types in docstring. |
| 7214 | 7509 | ||
| 7215 | 2005-11-20 Martin Rudalics <rudalics@gmx.at> (tiny change) | 7510 | 2005-11-20 Martin Rudalics <rudalics@gmx.at> |
| 7216 | 7511 | ||
| 7217 | * custom.el (defgroup): Add doc-string-elt info. | 7512 | * custom.el (defgroup): Add doc-string-elt info. |
| 7218 | 7513 | ||
| @@ -7485,7 +7780,7 @@ | |||
| 7485 | 7780 | ||
| 7486 | * apropos.el (apropos-calc-scores): Use apropos-pattern. | 7781 | * apropos.el (apropos-calc-scores): Use apropos-pattern. |
| 7487 | 7782 | ||
| 7488 | 2005-11-16 Martin Rudalics <rudalics@gmx.at> (tiny change) | 7783 | 2005-11-16 Martin Rudalics <rudalics@gmx.at> |
| 7489 | 7784 | ||
| 7490 | * wid-edit.el (color): Enclose %t in %{...%}. | 7785 | * wid-edit.el (color): Enclose %t in %{...%}. |
| 7491 | 7786 | ||
| @@ -14401,7 +14696,7 @@ | |||
| 14401 | * emulation/edt-mapper.el (edt-save-function-key-map) | 14696 | * emulation/edt-mapper.el (edt-save-function-key-map) |
| 14402 | (EDT-key-name): `defvar' to silence the byte-compiler. | 14697 | (EDT-key-name): `defvar' to silence the byte-compiler. |
| 14403 | 14698 | ||
| 14404 | 2005-07-02 Martin Rudalics <rudalics@gmx.at> (tiny change) | 14699 | 2005-07-02 Martin Rudalics <rudalics@gmx.at> |
| 14405 | 14700 | ||
| 14406 | * font-lock.el (font-lock-regexp-grouping-backslash): Rename from | 14701 | * font-lock.el (font-lock-regexp-grouping-backslash): Rename from |
| 14407 | font-lock-regexp-backslash. Doc fix. | 14702 | font-lock-regexp-backslash. Doc fix. |
diff --git a/lisp/ChangeLog.11 b/lisp/ChangeLog.11 index 8b00b539e69..f9c93d4102e 100644 --- a/lisp/ChangeLog.11 +++ b/lisp/ChangeLog.11 | |||
| @@ -5065,7 +5065,7 @@ | |||
| 5065 | 5065 | ||
| 5066 | * imenu.el: Several doc fixes: don't say variables are buffer-local. | 5066 | * imenu.el: Several doc fixes: don't say variables are buffer-local. |
| 5067 | 5067 | ||
| 5068 | 2004-08-16 Davis Herring <herring@lanl.gov> | 5068 | 2004-08-16 Stuart Herring <herring@lanl.gov> |
| 5069 | 5069 | ||
| 5070 | * isearch.el (isearch-string, isearch-message-string, isearch-point) | 5070 | * isearch.el (isearch-string, isearch-message-string, isearch-point) |
| 5071 | (isearch-success, isearch-forward-flag, isearch-other-end) | 5071 | (isearch-success, isearch-forward-flag, isearch-other-end) |
| @@ -5082,7 +5082,7 @@ | |||
| 5082 | * term/x-win.el (x-selection-value): If utf8 was successful but | 5082 | * term/x-win.el (x-selection-value): If utf8 was successful but |
| 5083 | ctext was not, use utf8 string. | 5083 | ctext was not, use utf8 string. |
| 5084 | 5084 | ||
| 5085 | 2004-08-14 Davis Herring <herring@lanl.gov> | 5085 | 2004-08-14 Stuart Herring <herring@lanl.gov> |
| 5086 | 5086 | ||
| 5087 | * isearch.el: Remove accidental changes of March 4. Fix backing | 5087 | * isearch.el: Remove accidental changes of March 4. Fix backing |
| 5088 | up when a regexp isearch is made more general. Use symbolic | 5088 | up when a regexp isearch is made more general. Use symbolic |
| @@ -11471,7 +11471,7 @@ | |||
| 11471 | 11471 | ||
| 11472 | * files.el (kill-some-buffers): Doc fix. | 11472 | * files.el (kill-some-buffers): Doc fix. |
| 11473 | 11473 | ||
| 11474 | 2003-12-29 David Herring <sdh6@ra.msstate.edu> (tiny change) | 11474 | 2003-12-29 Stuart Herring <herring@lanl.gov> (tiny change) |
| 11475 | 11475 | ||
| 11476 | * comint.el (comint-watch-for-password-prompt): Pass `string' as | 11476 | * comint.el (comint-watch-for-password-prompt): Pass `string' as |
| 11477 | arg to send-invisible | 11477 | arg to send-invisible |
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 9ba53f6f6f5..234b8230587 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -58,7 +58,7 @@ Interactively, use the command `abbrev-mode' | |||
| 58 | to enable or disable Abbrev mode in the current buffer." | 58 | to enable or disable Abbrev mode in the current buffer." |
| 59 | :type 'boolean | 59 | :type 'boolean |
| 60 | :group 'abbrev-mode) | 60 | :group 'abbrev-mode) |
| 61 | ;;;###autoload(put 'abbrev-mode 'safe-local-variable t) | 61 | ;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp) |
| 62 | 62 | ||
| 63 | 63 | ||
| 64 | (defvar edit-abbrevs-map | 64 | (defvar edit-abbrevs-map |
| @@ -363,5 +363,5 @@ A prefix argument means don't query; expand all abbrevs." | |||
| 363 | (if (or noquery (y-or-n-p (format "Expand `%s'? " string))) | 363 | (if (or noquery (y-or-n-p (format "Expand `%s'? " string))) |
| 364 | (expand-abbrev))))))) | 364 | (expand-abbrev))))))) |
| 365 | 365 | ||
| 366 | ;;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5 | 366 | ;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5 |
| 367 | ;;; abbrev.el ends here | 367 | ;;; abbrev.el ends here |
diff --git a/lisp/add-log.el b/lisp/add-log.el index 1afdc7dcb72..47a839d539d 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -72,7 +72,7 @@ This defaults to the value returned by the function `user-full-name'." | |||
| 72 | 72 | ||
| 73 | ;;;###autoload | 73 | ;;;###autoload |
| 74 | (defcustom add-log-mailing-address nil | 74 | (defcustom add-log-mailing-address nil |
| 75 | "*Email addresses of user, for inclusion in ChangeLog headers. | 75 | "Email addresses of user, for inclusion in ChangeLog headers. |
| 76 | This defaults to the value of `user-mail-address'. In addition to | 76 | This defaults to the value of `user-mail-address'. In addition to |
| 77 | being a simple string, this value can also be a list. All elements | 77 | being a simple string, this value can also be a list. All elements |
| 78 | will be recognized as referring to the same user; when creating a new | 78 | will be recognized as referring to the same user; when creating a new |
| @@ -83,7 +83,7 @@ ChangeLog entry, one element will be chosen at random." | |||
| 83 | :group 'change-log) | 83 | :group 'change-log) |
| 84 | 84 | ||
| 85 | (defcustom add-log-time-format 'add-log-iso8601-time-string | 85 | (defcustom add-log-time-format 'add-log-iso8601-time-string |
| 86 | "*Function that defines the time format. | 86 | "Function that defines the time format. |
| 87 | For example, `add-log-iso8601-time-string', which gives the | 87 | For example, `add-log-iso8601-time-string', which gives the |
| 88 | date in international ISO 8601 format, | 88 | date in international ISO 8601 format, |
| 89 | and `current-time-string' are two valid values." | 89 | and `current-time-string' are two valid values." |
| @@ -95,7 +95,7 @@ and `current-time-string' are two valid values." | |||
| 95 | :group 'change-log) | 95 | :group 'change-log) |
| 96 | 96 | ||
| 97 | (defcustom add-log-keep-changes-together nil | 97 | (defcustom add-log-keep-changes-together nil |
| 98 | "*If non-nil, normally keep day's log entries for one file together. | 98 | "If non-nil, normally keep day's log entries for one file together. |
| 99 | 99 | ||
| 100 | Log entries for a given file made with \\[add-change-log-entry] or | 100 | Log entries for a given file made with \\[add-change-log-entry] or |
| 101 | \\[add-change-log-entry-other-window] will only be added to others \ | 101 | \\[add-change-log-entry-other-window] will only be added to others \ |
| @@ -127,20 +127,20 @@ this variable." | |||
| 127 | :group 'change-log) | 127 | :group 'change-log) |
| 128 | 128 | ||
| 129 | (defcustom add-log-always-start-new-record nil | 129 | (defcustom add-log-always-start-new-record nil |
| 130 | "*If non-nil, `add-change-log-entry' will always start a new record." | 130 | "If non-nil, `add-change-log-entry' will always start a new record." |
| 131 | :version "22.1" | 131 | :version "22.1" |
| 132 | :type 'boolean | 132 | :type 'boolean |
| 133 | :group 'change-log) | 133 | :group 'change-log) |
| 134 | 134 | ||
| 135 | (defcustom add-log-buffer-file-name-function nil | 135 | (defcustom add-log-buffer-file-name-function nil |
| 136 | "*If non-nil, function to call to identify the full filename of a buffer. | 136 | "If non-nil, function to call to identify the full filename of a buffer. |
| 137 | This function is called with no argument. If this is nil, the default is to | 137 | This function is called with no argument. If this is nil, the default is to |
| 138 | use `buffer-file-name'." | 138 | use `buffer-file-name'." |
| 139 | :type '(choice (const nil) function) | 139 | :type '(choice (const nil) function) |
| 140 | :group 'change-log) | 140 | :group 'change-log) |
| 141 | 141 | ||
| 142 | (defcustom add-log-file-name-function nil | 142 | (defcustom add-log-file-name-function nil |
| 143 | "*If non-nil, function to call to identify the filename for a ChangeLog entry. | 143 | "If non-nil, function to call to identify the filename for a ChangeLog entry. |
| 144 | This function is called with one argument, the value of variable | 144 | This function is called with one argument, the value of variable |
| 145 | `buffer-file-name' in that buffer. If this is nil, the default is to | 145 | `buffer-file-name' in that buffer. If this is nil, the default is to |
| 146 | use the file's name relative to the directory of the change log file." | 146 | use the file's name relative to the directory of the change log file." |
| @@ -286,12 +286,16 @@ Note: The search is conducted only within 10%, at the beginning of the file." | |||
| 286 | map) | 286 | map) |
| 287 | "Keymap for Change Log major mode.") | 287 | "Keymap for Change Log major mode.") |
| 288 | 288 | ||
| 289 | (defvar change-log-time-zone-rule nil | 289 | ;; It used to be called change-log-time-zone-rule but really should be |
| 290 | ;; called add-log-time-zone-rule since it's only used from add-log-* code. | ||
| 291 | (defvaralias 'change-log-time-zone-rule 'add-log-time-zone-rule) | ||
| 292 | (defvar add-log-time-zone-rule nil | ||
| 290 | "Time zone used for calculating change log time stamps. | 293 | "Time zone used for calculating change log time stamps. |
| 291 | It takes the same format as the TZ argument of `set-time-zone-rule'. | 294 | It takes the same format as the TZ argument of `set-time-zone-rule'. |
| 292 | If nil, use local time.") | 295 | If nil, use local time. |
| 296 | If t, use universal time.") | ||
| 293 | 297 | ||
| 294 | (defun add-log-iso8601-time-zone (time) | 298 | (defun add-log-iso8601-time-zone (&optional time) |
| 295 | (let* ((utc-offset (or (car (current-time-zone time)) 0)) | 299 | (let* ((utc-offset (or (car (current-time-zone time)) 0)) |
| 296 | (sign (if (< utc-offset 0) ?- ?+)) | 300 | (sign (if (< utc-offset 0) ?- ?+)) |
| 297 | (sec (abs utc-offset)) | 301 | (sec (abs utc-offset)) |
| @@ -304,18 +308,14 @@ If nil, use local time.") | |||
| 304 | (t "%c%02d")) | 308 | (t "%c%02d")) |
| 305 | sign hh mm ss))) | 309 | sign hh mm ss))) |
| 306 | 310 | ||
| 311 | (defvar add-log-iso8601-with-time-zone nil) | ||
| 312 | |||
| 307 | (defun add-log-iso8601-time-string () | 313 | (defun add-log-iso8601-time-string () |
| 308 | (if change-log-time-zone-rule | 314 | (let ((time (format-time-string "%Y-%m-%d" |
| 309 | (let ((tz (getenv "TZ")) | 315 | nil (eq t add-log-time-zone-rule)))) |
| 310 | (now (current-time))) | 316 | (if add-log-iso8601-with-time-zone |
| 311 | (unwind-protect | 317 | (concat time " " (add-log-iso8601-time-zone)) |
| 312 | (progn | 318 | time))) |
| 313 | (set-time-zone-rule change-log-time-zone-rule) | ||
| 314 | (concat | ||
| 315 | (format-time-string "%Y-%m-%d " now) | ||
| 316 | (add-log-iso8601-time-zone now))) | ||
| 317 | (set-time-zone-rule tz))) | ||
| 318 | (format-time-string "%Y-%m-%d"))) | ||
| 319 | 319 | ||
| 320 | (defun change-log-name () | 320 | (defun change-log-name () |
| 321 | "Return (system-dependent) default name for a change log file." | 321 | "Return (system-dependent) default name for a change log file." |
| @@ -494,7 +494,7 @@ The change log file can start with a copyright notice and a copying | |||
| 494 | permission notice. The first blank line indicates the end of these | 494 | permission notice. The first blank line indicates the end of these |
| 495 | notices. | 495 | notices. |
| 496 | 496 | ||
| 497 | Today's date is calculated according to `change-log-time-zone-rule' if | 497 | Today's date is calculated according to `add-log-time-zone-rule' if |
| 498 | non-nil, otherwise in local time." | 498 | non-nil, otherwise in local time." |
| 499 | (interactive (list current-prefix-arg | 499 | (interactive (list current-prefix-arg |
| 500 | (prompt-for-change-log-name))) | 500 | (prompt-for-change-log-name))) |
| @@ -538,13 +538,22 @@ non-nil, otherwise in local time." | |||
| 538 | (skip-chars-forward "\n")) | 538 | (skip-chars-forward "\n")) |
| 539 | 539 | ||
| 540 | ;; Advance into first entry if it is usable; else make new one. | 540 | ;; Advance into first entry if it is usable; else make new one. |
| 541 | (let ((new-entries (mapcar (lambda (addr) | 541 | (let ((new-entries |
| 542 | (concat (funcall add-log-time-format) | 542 | (mapcar (lambda (addr) |
| 543 | " " full-name | 543 | (concat |
| 544 | " <" addr ">")) | 544 | (if (stringp add-log-time-zone-rule) |
| 545 | (if (consp mailing-address) | 545 | (let ((tz (getenv "TZ"))) |
| 546 | mailing-address | 546 | (unwind-protect |
| 547 | (list mailing-address))))) | 547 | (progn |
| 548 | (set-time-zone-rule add-log-time-zone-rule) | ||
| 549 | (funcall add-log-time-format)) | ||
| 550 | (set-time-zone-rule tz))) | ||
| 551 | (funcall add-log-time-format)) | ||
| 552 | " " full-name | ||
| 553 | " <" addr ">")) | ||
| 554 | (if (consp mailing-address) | ||
| 555 | mailing-address | ||
| 556 | (list mailing-address))))) | ||
| 548 | (if (and (not add-log-always-start-new-record) | 557 | (if (and (not add-log-always-start-new-record) |
| 549 | (let ((hit nil)) | 558 | (let ((hit nil)) |
| 550 | (dolist (entry new-entries hit) | 559 | (dolist (entry new-entries hit) |
| @@ -652,21 +661,21 @@ the change log file in another window." | |||
| 652 | (add-change-log-entry whoami file-name t)) | 661 | (add-change-log-entry whoami file-name t)) |
| 653 | ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) | 662 | ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) |
| 654 | 663 | ||
| 655 | (defvar add-log-indent-text 0) | 664 | (defvar change-log-indent-text 0) |
| 656 | 665 | ||
| 657 | (defun add-log-indent () | 666 | (defun change-log-indent () |
| 658 | (let* ((indent | 667 | (let* ((indent |
| 659 | (save-excursion | 668 | (save-excursion |
| 660 | (beginning-of-line) | 669 | (beginning-of-line) |
| 661 | (skip-chars-forward " \t") | 670 | (skip-chars-forward " \t") |
| 662 | (cond | 671 | (cond |
| 663 | ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>$") | 672 | ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>\\(?: +(.*)\\)? *$") |
| 664 | ;; Matching the output of add-log-time-format is difficult, | 673 | ;; Matching the output of add-log-time-format is difficult, |
| 665 | ;; but I'll get it has at least two adjacent digits. | 674 | ;; but I'll get it has at least two adjacent digits. |
| 666 | (string-match "[[:digit:]][[:digit:]]" (match-string 1))) | 675 | (string-match "[[:digit:]][[:digit:]]" (match-string 1))) |
| 667 | 0) | 676 | 0) |
| 668 | ((looking-at "[^*(]") | 677 | ((looking-at "[^*(]") |
| 669 | (+ (current-left-margin) add-log-indent-text)) | 678 | (+ (current-left-margin) change-log-indent-text)) |
| 670 | (t (current-left-margin))))) | 679 | (t (current-left-margin))))) |
| 671 | (pos (save-excursion (indent-line-to indent) (point)))) | 680 | (pos (save-excursion (indent-line-to indent) (point)))) |
| 672 | (if (> pos (point)) (goto-char pos)))) | 681 | (if (> pos (point)) (goto-char pos)))) |
| @@ -688,7 +697,7 @@ Runs `change-log-mode-hook'. | |||
| 688 | tab-width 8) | 697 | tab-width 8) |
| 689 | (set (make-local-variable 'fill-paragraph-function) | 698 | (set (make-local-variable 'fill-paragraph-function) |
| 690 | 'change-log-fill-paragraph) | 699 | 'change-log-fill-paragraph) |
| 691 | (set (make-local-variable 'indent-line-function) 'add-log-indent) | 700 | (set (make-local-variable 'indent-line-function) 'change-log-indent) |
| 692 | (set (make-local-variable 'tab-always-indent) nil) | 701 | (set (make-local-variable 'tab-always-indent) nil) |
| 693 | ;; We really do want "^" in paragraph-start below: it is only the | 702 | ;; We really do want "^" in paragraph-start below: it is only the |
| 694 | ;; lines that begin at column 0 (despite the left-margin of 8) that | 703 | ;; lines that begin at column 0 (despite the left-margin of 8) that |
| @@ -722,23 +731,23 @@ Prefix arg means justify as well." | |||
| 722 | 731 | ||
| 723 | (defcustom add-log-current-defun-header-regexp | 732 | (defcustom add-log-current-defun-header-regexp |
| 724 | "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]" | 733 | "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]" |
| 725 | "*Heuristic regexp used by `add-log-current-defun' for unknown major modes." | 734 | "Heuristic regexp used by `add-log-current-defun' for unknown major modes." |
| 726 | :type 'regexp | 735 | :type 'regexp |
| 727 | :group 'change-log) | 736 | :group 'change-log) |
| 728 | 737 | ||
| 729 | ;;;###autoload | 738 | ;;;###autoload |
| 730 | (defvar add-log-lisp-like-modes | 739 | (defvar add-log-lisp-like-modes |
| 731 | '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode) | 740 | '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode) |
| 732 | "*Modes that look like Lisp to `add-log-current-defun'.") | 741 | "*Modes that look like Lisp to `add-log-current-defun'.") |
| 733 | 742 | ||
| 734 | ;;;###autoload | 743 | ;;;###autoload |
| 735 | (defvar add-log-c-like-modes | 744 | (defvar add-log-c-like-modes |
| 736 | '(c-mode c++-mode c++-c-mode objc-mode) | 745 | '(c-mode c++-mode c++-c-mode objc-mode) |
| 737 | "*Modes that look like C to `add-log-current-defun'.") | 746 | "*Modes that look like C to `add-log-current-defun'.") |
| 738 | 747 | ||
| 739 | ;;;###autoload | 748 | ;;;###autoload |
| 740 | (defvar add-log-tex-like-modes | 749 | (defvar add-log-tex-like-modes |
| 741 | '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) | 750 | '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) |
| 742 | "*Modes that look like TeX to `add-log-current-defun'.") | 751 | "*Modes that look like TeX to `add-log-current-defun'.") |
| 743 | 752 | ||
| 744 | ;;;###autoload | 753 | ;;;###autoload |
| @@ -1103,5 +1112,5 @@ old-style time formats for entries are supported." | |||
| 1103 | 1112 | ||
| 1104 | (provide 'add-log) | 1113 | (provide 'add-log) |
| 1105 | 1114 | ||
| 1106 | ;;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 | 1115 | ;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 |
| 1107 | ;;; add-log.el ends here | 1116 | ;;; add-log.el ends here |
diff --git a/lisp/allout.el b/lisp/allout.el index 66c4b8681db..dc19c1fa15a 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -84,8 +84,6 @@ | |||
| 84 | (require 'pgg-gpg) | 84 | (require 'pgg-gpg) |
| 85 | (require 'overlay) | 85 | (require 'overlay) |
| 86 | )) | 86 | )) |
| 87 | (autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" | ||
| 88 | "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.") | ||
| 89 | 87 | ||
| 90 | ;;;_* USER CUSTOMIZATION VARIABLES: | 88 | ;;;_* USER CUSTOMIZATION VARIABLES: |
| 91 | 89 | ||
| @@ -199,6 +197,9 @@ just the header." | |||
| 199 | :type 'boolean | 197 | :type 'boolean |
| 200 | :group 'allout) | 198 | :group 'allout) |
| 201 | (make-variable-buffer-local 'allout-show-bodies) | 199 | (make-variable-buffer-local 'allout-show-bodies) |
| 200 | ;;;###autoload | ||
| 201 | (put 'allout-show-bodies 'safe-local-variable | ||
| 202 | (lambda (x) (member x '(t nil)))) | ||
| 202 | 203 | ||
| 203 | ;;;_ = allout-header-prefix | 204 | ;;;_ = allout-header-prefix |
| 204 | (defcustom allout-header-prefix "." | 205 | (defcustom allout-header-prefix "." |
| @@ -212,6 +213,8 @@ outlines start at level 2 to avoid this discrepancy." | |||
| 212 | :type 'string | 213 | :type 'string |
| 213 | :group 'allout) | 214 | :group 'allout) |
| 214 | (make-variable-buffer-local 'allout-header-prefix) | 215 | (make-variable-buffer-local 'allout-header-prefix) |
| 216 | ;;;###autoload | ||
| 217 | (put 'allout-header-prefix 'safe-local-variable 'stringp) | ||
| 215 | ;;;_ = allout-primary-bullet | 218 | ;;;_ = allout-primary-bullet |
| 216 | (defcustom allout-primary-bullet "*" | 219 | (defcustom allout-primary-bullet "*" |
| 217 | "Bullet used for top-level outline topics. | 220 | "Bullet used for top-level outline topics. |
| @@ -227,6 +230,8 @@ bullets." | |||
| 227 | :type 'string | 230 | :type 'string |
| 228 | :group 'allout) | 231 | :group 'allout) |
| 229 | (make-variable-buffer-local 'allout-primary-bullet) | 232 | (make-variable-buffer-local 'allout-primary-bullet) |
| 233 | ;;;###autoload | ||
| 234 | (put 'allout-primary-bullet 'safe-local-variable 'stringp) | ||
| 230 | ;;;_ = allout-plain-bullets-string | 235 | ;;;_ = allout-plain-bullets-string |
| 231 | (defcustom allout-plain-bullets-string ".," | 236 | (defcustom allout-plain-bullets-string ".," |
| 232 | "*The bullets normally used in outline topic prefixes. | 237 | "*The bullets normally used in outline topic prefixes. |
| @@ -241,6 +246,8 @@ of this var to take effect." | |||
| 241 | :type 'string | 246 | :type 'string |
| 242 | :group 'allout) | 247 | :group 'allout) |
| 243 | (make-variable-buffer-local 'allout-plain-bullets-string) | 248 | (make-variable-buffer-local 'allout-plain-bullets-string) |
| 249 | ;;;###autoload | ||
| 250 | (put 'allout-plain-bullets-string 'safe-local-variable 'stringp) | ||
| 244 | ;;;_ = allout-distinctive-bullets-string | 251 | ;;;_ = allout-distinctive-bullets-string |
| 245 | (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^" | 252 | (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^" |
| 246 | "*Persistent outline header bullets used to distinguish special topics. | 253 | "*Persistent outline header bullets used to distinguish special topics. |
| @@ -274,6 +281,8 @@ strings." | |||
| 274 | :type 'string | 281 | :type 'string |
| 275 | :group 'allout) | 282 | :group 'allout) |
| 276 | (make-variable-buffer-local 'allout-distinctive-bullets-string) | 283 | (make-variable-buffer-local 'allout-distinctive-bullets-string) |
| 284 | ;;;###autoload | ||
| 285 | (put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp) | ||
| 277 | 286 | ||
| 278 | ;;;_ = allout-use-mode-specific-leader | 287 | ;;;_ = allout-use-mode-specific-leader |
| 279 | (defcustom allout-use-mode-specific-leader t | 288 | (defcustom allout-use-mode-specific-leader t |
| @@ -305,6 +314,9 @@ incorrect.]" | |||
| 305 | (const allout-mode-leaders) | 314 | (const allout-mode-leaders) |
| 306 | (const comment-start)) | 315 | (const comment-start)) |
| 307 | :group 'allout) | 316 | :group 'allout) |
| 317 | ;;;###autoload | ||
| 318 | (put 'allout-use-mode-specific-leader 'safe-local-variable | ||
| 319 | (lambda (x) (or (member x '(t nil)) (stringp x)))) | ||
| 308 | ;;;_ = allout-mode-leaders | 320 | ;;;_ = allout-mode-leaders |
| 309 | (defvar allout-mode-leaders '() | 321 | (defvar allout-mode-leaders '() |
| 310 | "Specific allout-prefix leading strings per major modes. | 322 | "Specific allout-prefix leading strings per major modes. |
| @@ -330,6 +342,9 @@ are always respected by the topic maneuvering functions." | |||
| 330 | :type 'boolean | 342 | :type 'boolean |
| 331 | :group 'allout) | 343 | :group 'allout) |
| 332 | (make-variable-buffer-local 'allout-old-style-prefixes) | 344 | (make-variable-buffer-local 'allout-old-style-prefixes) |
| 345 | ;;;###autoload | ||
| 346 | (put 'allout-old-style-prefixes 'safe-local-variable | ||
| 347 | (lambda (x) (member x '(t nil)))) | ||
| 333 | ;;;_ = allout-stylish-prefixes - alternating bullets | 348 | ;;;_ = allout-stylish-prefixes - alternating bullets |
| 334 | (defcustom allout-stylish-prefixes t | 349 | (defcustom allout-stylish-prefixes t |
| 335 | "*Do fancy stuff with topic prefix bullets according to level, etc. | 350 | "*Do fancy stuff with topic prefix bullets according to level, etc. |
| @@ -376,6 +391,9 @@ is non-nil." | |||
| 376 | :type 'boolean | 391 | :type 'boolean |
| 377 | :group 'allout) | 392 | :group 'allout) |
| 378 | (make-variable-buffer-local 'allout-stylish-prefixes) | 393 | (make-variable-buffer-local 'allout-stylish-prefixes) |
| 394 | ;;;###autoload | ||
| 395 | (put 'allout-stylish-prefixes 'safe-local-variable | ||
| 396 | (lambda (x) (member x '(t nil)))) | ||
| 379 | 397 | ||
| 380 | ;;;_ = allout-numbered-bullet | 398 | ;;;_ = allout-numbered-bullet |
| 381 | (defcustom allout-numbered-bullet "#" | 399 | (defcustom allout-numbered-bullet "#" |
| @@ -388,6 +406,9 @@ disables numbering maintenance." | |||
| 388 | :type '(choice (const nil) string) | 406 | :type '(choice (const nil) string) |
| 389 | :group 'allout) | 407 | :group 'allout) |
| 390 | (make-variable-buffer-local 'allout-numbered-bullet) | 408 | (make-variable-buffer-local 'allout-numbered-bullet) |
| 409 | ;;;###autoload | ||
| 410 | (put 'allout-numbered-bullet 'safe-local-variable | ||
| 411 | (lambda (x) (or (not x) (stringp x)))) | ||
| 391 | ;;;_ = allout-file-xref-bullet | 412 | ;;;_ = allout-file-xref-bullet |
| 392 | (defcustom allout-file-xref-bullet "@" | 413 | (defcustom allout-file-xref-bullet "@" |
| 393 | "*Bullet signifying file cross-references, for `allout-resolve-xref'. | 414 | "*Bullet signifying file cross-references, for `allout-resolve-xref'. |
| @@ -395,6 +416,9 @@ disables numbering maintenance." | |||
| 395 | Set this var to the bullet you want to use for file cross-references." | 416 | Set this var to the bullet you want to use for file cross-references." |
| 396 | :type '(choice (const nil) string) | 417 | :type '(choice (const nil) string) |
| 397 | :group 'allout) | 418 | :group 'allout) |
| 419 | ;;;###autoload | ||
| 420 | (put 'allout-file-xref-bullet 'safe-local-variable | ||
| 421 | (lambda (x) (or (not x) (stringp x)))) | ||
| 398 | ;;;_ = allout-presentation-padding | 422 | ;;;_ = allout-presentation-padding |
| 399 | (defcustom allout-presentation-padding 2 | 423 | (defcustom allout-presentation-padding 2 |
| 400 | "*Presentation-format white-space padding factor, for greater indent." | 424 | "*Presentation-format white-space padding factor, for greater indent." |
| @@ -402,6 +426,8 @@ Set this var to the bullet you want to use for file cross-references." | |||
| 402 | :group 'allout) | 426 | :group 'allout) |
| 403 | 427 | ||
| 404 | (make-variable-buffer-local 'allout-presentation-padding) | 428 | (make-variable-buffer-local 'allout-presentation-padding) |
| 429 | ;;;###autoload | ||
| 430 | (put 'allout-presentation-padding 'safe-local-variable 'integerp) | ||
| 405 | 431 | ||
| 406 | ;;;_ = allout-abbreviate-flattened-numbering | 432 | ;;;_ = allout-abbreviate-flattened-numbering |
| 407 | (defcustom allout-abbreviate-flattened-numbering nil | 433 | (defcustom allout-abbreviate-flattened-numbering nil |
| @@ -455,11 +481,16 @@ formatted copy." | |||
| 455 | :group 'allout) | 481 | :group 'allout) |
| 456 | 482 | ||
| 457 | ;;;_ + Topic encryption | 483 | ;;;_ + Topic encryption |
| 484 | ;;;_ = allout-encryption group | ||
| 485 | (defgroup allout-encryption nil | ||
| 486 | "Settings for topic encryption features of allout outliner." | ||
| 487 | :group 'allout) | ||
| 458 | ;;;_ = allout-topic-encryption-bullet | 488 | ;;;_ = allout-topic-encryption-bullet |
| 459 | (defcustom allout-topic-encryption-bullet "~" | 489 | (defcustom allout-topic-encryption-bullet "~" |
| 460 | "*Bullet signifying encryption of the entry's body." | 490 | "*Bullet signifying encryption of the entry's body." |
| 461 | :type '(choice (const nil) string) | 491 | :type '(choice (const nil) string) |
| 462 | :group 'allout) | 492 | :version "22.0" |
| 493 | :group 'allout-encryption) | ||
| 463 | ;;;_ = allout-passphrase-verifier-handling | 494 | ;;;_ = allout-passphrase-verifier-handling |
| 464 | (defcustom allout-passphrase-verifier-handling t | 495 | (defcustom allout-passphrase-verifier-handling t |
| 465 | "*Enable use of symmetric encryption passphrase verifier if non-nil. | 496 | "*Enable use of symmetric encryption passphrase verifier if non-nil. |
| @@ -467,7 +498,8 @@ formatted copy." | |||
| 467 | See the docstring for the `allout-enable-file-variable-adjustment' | 498 | See the docstring for the `allout-enable-file-variable-adjustment' |
| 468 | variable for details about allout ajustment of file variables." | 499 | variable for details about allout ajustment of file variables." |
| 469 | :type 'boolean | 500 | :type 'boolean |
| 470 | :group 'allout) | 501 | :version "22.0" |
| 502 | :group 'allout-encryption) | ||
| 471 | (make-variable-buffer-local 'allout-passphrase-verifier-handling) | 503 | (make-variable-buffer-local 'allout-passphrase-verifier-handling) |
| 472 | ;;;_ = allout-passphrase-hint-handling | 504 | ;;;_ = allout-passphrase-hint-handling |
| 473 | (defcustom allout-passphrase-hint-handling 'always | 505 | (defcustom allout-passphrase-hint-handling 'always |
| @@ -482,7 +514,8 @@ variable for details about allout ajustment of file variables." | |||
| 482 | :type '(choice (const always) | 514 | :type '(choice (const always) |
| 483 | (const needed) | 515 | (const needed) |
| 484 | (const disabled)) | 516 | (const disabled)) |
| 485 | :group 'allout) | 517 | :version "22.0" |
| 518 | :group 'allout-encryption) | ||
| 486 | (make-variable-buffer-local 'allout-passphrase-hint-handling) | 519 | (make-variable-buffer-local 'allout-passphrase-hint-handling) |
| 487 | ;;;_ = allout-encrypt-unencrypted-on-saves | 520 | ;;;_ = allout-encrypt-unencrypted-on-saves |
| 488 | (defcustom allout-encrypt-unencrypted-on-saves t | 521 | (defcustom allout-encrypt-unencrypted-on-saves t |
| @@ -514,7 +547,8 @@ disable auto-saves for that file." | |||
| 514 | :type '(choice (const :tag "Yes" t) | 547 | :type '(choice (const :tag "Yes" t) |
| 515 | (const :tag "All except current topic" except-current) | 548 | (const :tag "All except current topic" except-current) |
| 516 | (const :tag "No" nil)) | 549 | (const :tag "No" nil)) |
| 517 | :group 'allout) | 550 | :version "22.0" |
| 551 | :group 'allout-encryption) | ||
| 518 | (make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves) | 552 | (make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves) |
| 519 | 553 | ||
| 520 | ;;;_ + Miscellaneous customization | 554 | ;;;_ + Miscellaneous customization |
| @@ -585,6 +619,9 @@ where auto-fill occurs." | |||
| 585 | :type 'boolean | 619 | :type 'boolean |
| 586 | :group 'allout) | 620 | :group 'allout) |
| 587 | (make-variable-buffer-local 'allout-use-hanging-indents) | 621 | (make-variable-buffer-local 'allout-use-hanging-indents) |
| 622 | ;;;###autoload | ||
| 623 | (put 'allout-use-hanging-indents 'safe-local-variable | ||
| 624 | (lambda (x) (member x '(t nil)))) | ||
| 588 | 625 | ||
| 589 | ;;;_ = allout-reindent-bodies | 626 | ;;;_ = allout-reindent-bodies |
| 590 | (defcustom allout-reindent-bodies (if allout-use-hanging-indents | 627 | (defcustom allout-reindent-bodies (if allout-use-hanging-indents |
| @@ -602,6 +639,9 @@ those that do not have the variable `comment-start' set. A value of | |||
| 602 | :group 'allout) | 639 | :group 'allout) |
| 603 | 640 | ||
| 604 | (make-variable-buffer-local 'allout-reindent-bodies) | 641 | (make-variable-buffer-local 'allout-reindent-bodies) |
| 642 | ;;;###autoload | ||
| 643 | (put 'allout-reindent-bodies 'safe-local-variable | ||
| 644 | (lambda (x) (member x '(nil t text force)))) | ||
| 605 | 645 | ||
| 606 | ;;;_ = allout-enable-file-variable-adjustment | 646 | ;;;_ = allout-enable-file-variable-adjustment |
| 607 | (defcustom allout-enable-file-variable-adjustment t | 647 | (defcustom allout-enable-file-variable-adjustment t |
| @@ -667,7 +707,9 @@ the layout used for the allout.el source file.) | |||
| 667 | case the value of `allout-default-layout' is used.") | 707 | case the value of `allout-default-layout' is used.") |
| 668 | (make-variable-buffer-local 'allout-layout) | 708 | (make-variable-buffer-local 'allout-layout) |
| 669 | ;;;###autoload | 709 | ;;;###autoload |
| 670 | (put 'allout-layout 'safe-local-variable t) | 710 | (put 'allout-layout 'safe-local-variable |
| 711 | (lambda (x) (or (numberp x) (listp x) (integerp x) | ||
| 712 | (member x '(: * + -))))) | ||
| 671 | 713 | ||
| 672 | ;;;_ : Topic header format | 714 | ;;;_ : Topic header format |
| 673 | ;;;_ = allout-regexp | 715 | ;;;_ = allout-regexp |
| @@ -1053,7 +1095,8 @@ The verifier string is retained as an Emacs file variable, as well as in | |||
| 1053 | the emacs buffer state, if file variable adjustments are enabled. See | 1095 | the emacs buffer state, if file variable adjustments are enabled. See |
| 1054 | `allout-enable-file-variable-adjustment' for details about that.") | 1096 | `allout-enable-file-variable-adjustment' for details about that.") |
| 1055 | (make-variable-buffer-local 'allout-passphrase-verifier-string) | 1097 | (make-variable-buffer-local 'allout-passphrase-verifier-string) |
| 1056 | (put 'allout-passphrase-verifier-string 'safe-local-variable t) | 1098 | ;;;###autoload |
| 1099 | (put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp) | ||
| 1057 | ;;;_ = allout-passphrase-hint-string | 1100 | ;;;_ = allout-passphrase-hint-string |
| 1058 | (defvar allout-passphrase-hint-string "" | 1101 | (defvar allout-passphrase-hint-string "" |
| 1059 | "Variable used to retain reminder string for file's encryption passphrase. | 1102 | "Variable used to retain reminder string for file's encryption passphrase. |
| @@ -1065,8 +1108,9 @@ The hint is retained as an Emacs file variable, as well as in the emacs buffer | |||
| 1065 | state, if file variable adjustments are enabled. See | 1108 | state, if file variable adjustments are enabled. See |
| 1066 | `allout-enable-file-variable-adjustment' for details about that.") | 1109 | `allout-enable-file-variable-adjustment' for details about that.") |
| 1067 | (make-variable-buffer-local 'allout-passphrase-hint-string) | 1110 | (make-variable-buffer-local 'allout-passphrase-hint-string) |
| 1068 | (put 'allout-passphrase-hint-string 'safe-local-variable t) | ||
| 1069 | (setq-default allout-passphrase-hint-string "") | 1111 | (setq-default allout-passphrase-hint-string "") |
| 1112 | ;;;###autoload | ||
| 1113 | (put 'allout-passphrase-hint-string 'safe-local-variable 'stringp) | ||
| 1070 | ;;;_ = allout-after-save-decrypt | 1114 | ;;;_ = allout-after-save-decrypt |
| 1071 | (defvar allout-after-save-decrypt nil | 1115 | (defvar allout-after-save-decrypt nil |
| 1072 | "Internal variable, is nil or has the value of two points: | 1116 | "Internal variable, is nil or has the value of two points: |
| @@ -1573,6 +1617,12 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1573 | ; epoch, minor-mode key bindings: | 1617 | ; epoch, minor-mode key bindings: |
| 1574 | (setq allout-mode-map | 1618 | (setq allout-mode-map |
| 1575 | (produce-allout-mode-map allout-keybindings-list)) | 1619 | (produce-allout-mode-map allout-keybindings-list)) |
| 1620 | (substitute-key-definition 'beginning-of-line | ||
| 1621 | 'move-beginning-of-line | ||
| 1622 | allout-mode-map global-map) | ||
| 1623 | (substitute-key-definition 'end-of-line | ||
| 1624 | 'move-end-of-line | ||
| 1625 | allout-mode-map global-map) | ||
| 1576 | (produce-allout-mode-menubar-entries) | 1626 | (produce-allout-mode-menubar-entries) |
| 1577 | (fset 'allout-mode-map allout-mode-map) | 1627 | (fset 'allout-mode-map allout-mode-map) |
| 1578 | ; Include on minor-mode-map-alist, | 1628 | ; Include on minor-mode-map-alist, |
| @@ -5778,17 +5828,14 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 5778 | (if (/= arg 1) | 5828 | (if (/= arg 1) |
| 5779 | (condition-case nil (line-move (1- arg)) (error nil))) | 5829 | (condition-case nil (line-move (1- arg)) (error nil))) |
| 5780 | 5830 | ||
| 5781 | (let ((orig (point))) | 5831 | ;; Move to beginning-of-line, ignoring fields and invisibles. |
| 5782 | ;; Move to beginning-of-line, ignoring fields and invisibles. | 5832 | (skip-chars-backward "^\n") |
| 5783 | (skip-chars-backward "^\n") | 5833 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) |
| 5784 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) | 5834 | (goto-char (if (featurep 'xemacs) |
| 5785 | (goto-char (if (featurep 'xemacs) | 5835 | (previous-property-change (point)) |
| 5786 | (previous-property-change (point)) | 5836 | (previous-char-property-change (point)))) |
| 5787 | (previous-char-property-change (point)))) | 5837 | (skip-chars-backward "^\n")) |
| 5788 | (skip-chars-backward "^\n")) | 5838 | (vertical-motion 0)) |
| 5789 | (vertical-motion 0) | ||
| 5790 | (if (/= orig (point)) | ||
| 5791 | (goto-char orig)))) | ||
| 5792 | ) | 5839 | ) |
| 5793 | ;;;_ > move-end-of-line if necessary - older emacs, xemacs | 5840 | ;;;_ > move-end-of-line if necessary - older emacs, xemacs |
| 5794 | (if (not (fboundp 'move-end-of-line)) | 5841 | (if (not (fboundp 'move-end-of-line)) |
| @@ -5802,8 +5849,7 @@ If point reaches the beginning or end of buffer, it stops there. | |||
| 5802 | To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | 5849 | To ignore intangibility, bind `inhibit-point-motion-hooks' to t." |
| 5803 | (interactive "p") | 5850 | (interactive "p") |
| 5804 | (or arg (setq arg 1)) | 5851 | (or arg (setq arg 1)) |
| 5805 | (let ((orig (point)) | 5852 | (let (done) |
| 5806 | done) | ||
| 5807 | (while (not done) | 5853 | (while (not done) |
| 5808 | (let ((newpos | 5854 | (let ((newpos |
| 5809 | (save-excursion | 5855 | (save-excursion |
| @@ -5813,8 +5859,10 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 5813 | (error nil)) | 5859 | (error nil)) |
| 5814 | (not (bobp)) | 5860 | (not (bobp)) |
| 5815 | (progn | 5861 | (progn |
| 5816 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) | 5862 | (while (and (not (bobp)) |
| 5817 | (goto-char (previous-char-property-change (point)))) | 5863 | (line-move-invisible-p (1- (point)))) |
| 5864 | (goto-char | ||
| 5865 | (previous-char-property-change (point)))) | ||
| 5818 | (backward-char 1))) | 5866 | (backward-char 1))) |
| 5819 | (point))))) | 5867 | (point))))) |
| 5820 | (goto-char newpos) | 5868 | (goto-char newpos) |
| @@ -5827,9 +5875,7 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 5827 | ;; and now we're not really at eol, | 5875 | ;; and now we're not really at eol, |
| 5828 | ;; keep going. | 5876 | ;; keep going. |
| 5829 | (setq arg 1) | 5877 | (setq arg 1) |
| 5830 | (setq done t))))) | 5878 | (setq done t))))))) |
| 5831 | (if (/= orig (point)) | ||
| 5832 | (goto-char orig)))) | ||
| 5833 | ) | 5879 | ) |
| 5834 | ;;;_ > line-move-invisible-p if necessary | 5880 | ;;;_ > line-move-invisible-p if necessary |
| 5835 | (if (not (fboundp 'line-move-invisible-p)) | 5881 | (if (not (fboundp 'line-move-invisible-p)) |
diff --git a/lisp/bindings.el b/lisp/bindings.el index f8dfc9fe6c0..4fdfb172e3e 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -310,13 +310,13 @@ Keymap to display on minor modes.") | |||
| 310 | (list | 310 | (list |
| 311 | (propertize "%[(" 'help-echo help-echo) | 311 | (propertize "%[(" 'help-echo help-echo) |
| 312 | `(:propertize ("" mode-name) | 312 | `(:propertize ("" mode-name) |
| 313 | help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode" | 313 | help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" |
| 314 | mouse-face mode-line-highlight | 314 | mouse-face mode-line-highlight |
| 315 | local-map ,mode-line-major-mode-keymap) | 315 | local-map ,mode-line-major-mode-keymap) |
| 316 | '("" mode-line-process) | 316 | '("" mode-line-process) |
| 317 | `(:propertize ("" minor-mode-alist) | 317 | `(:propertize ("" minor-mode-alist) |
| 318 | mouse-face mode-line-highlight | 318 | mouse-face mode-line-highlight |
| 319 | help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu" | 319 | help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" |
| 320 | local-map ,mode-line-minor-mode-keymap) | 320 | local-map ,mode-line-minor-mode-keymap) |
| 321 | (propertize "%n" 'help-echo "mouse-2: widen" | 321 | (propertize "%n" 'help-echo "mouse-2: widen" |
| 322 | 'mouse-face 'mode-line-highlight | 322 | 'mouse-face 'mode-line-highlight |
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index 28a319f84e4..adb94ef7381 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el | |||
| @@ -932,7 +932,9 @@ The command \\[yank] can retrieve it from there." | |||
| 932 | (substring str pref-len suff-pos))) | 932 | (substring str pref-len suff-pos))) |
| 933 | (if (string-match "[^ \t\n]" str) | 933 | (if (string-match "[^ \t\n]" str) |
| 934 | (setq pref-len 0 | 934 | (setq pref-len 0 |
| 935 | val (math-read-big-expr str)) | 935 | val (condition-case nil |
| 936 | (math-read-big-expr str) | ||
| 937 | (error (math-read-expr str)))) | ||
| 936 | (setq val nil)))) | 938 | (setq val nil)))) |
| 937 | (if (eq (car-safe val) 'error) | 939 | (if (eq (car-safe val) 'error) |
| 938 | (setq val (list 'error | 940 | (setq val (list 'error |
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index c377bcc8735..262e474f7b9 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el | |||
| @@ -89,7 +89,7 @@ | |||
| 89 | (define-key calendar-mode-map [menu-bar diary mark] | 89 | (define-key calendar-mode-map [menu-bar diary mark] |
| 90 | '("Mark All" . mark-diary-entries)) | 90 | '("Mark All" . mark-diary-entries)) |
| 91 | (define-key calendar-mode-map [menu-bar diary view] | 91 | (define-key calendar-mode-map [menu-bar diary view] |
| 92 | '("Cursor Date" . view-diary-entries)) | 92 | '("Cursor Date" . diary-view-entries)) |
| 93 | (define-key calendar-mode-map [menu-bar diary view] | 93 | (define-key calendar-mode-map [menu-bar diary view] |
| 94 | '("Other File" . view-other-diary-entries)) | 94 | '("Other File" . view-other-diary-entries)) |
| 95 | 95 | ||
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index a67d90c832e..1fd85513230 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el | |||
| @@ -45,7 +45,7 @@ | |||
| 45 | 45 | ||
| 46 | (require 'calendar) | 46 | (require 'calendar) |
| 47 | 47 | ||
| 48 | (autoload 'list-diary-entries "diary-lib" nil t) | 48 | (autoload 'diary-list-entries "diary-lib" nil t) |
| 49 | (autoload 'calendar-holiday-list "holidays" nil t) | 49 | (autoload 'calendar-holiday-list "holidays" nil t) |
| 50 | (autoload 'calendar-iso-from-absolute "cal-iso" nil t) | 50 | (autoload 'calendar-iso-from-absolute "cal-iso" nil t) |
| 51 | 51 | ||
| @@ -121,6 +121,14 @@ will put the Hebrew date at the bottom of each day." | |||
| 121 | :type 'integer | 121 | :type 'integer |
| 122 | :group 'calendar-tex) | 122 | :group 'calendar-tex) |
| 123 | 123 | ||
| 124 | (defcustom cal-tex-preamble-extra nil | ||
| 125 | "A string giving extra LaTeX commands to insert in the calendar preamble. | ||
| 126 | For example, to include extra packages: | ||
| 127 | \"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"." | ||
| 128 | :type 'string | ||
| 129 | :group 'calendar-tex | ||
| 130 | :version "22.1") | ||
| 131 | |||
| 124 | (defcustom cal-tex-hook nil | 132 | (defcustom cal-tex-hook nil |
| 125 | "*List of functions called after any LaTeX calendar buffer is generated. | 133 | "*List of functions called after any LaTeX calendar buffer is generated. |
| 126 | You can use this to do postprocessing on the buffer. For example, to change | 134 | You can use this to do postprocessing on the buffer. For example, to change |
| @@ -240,7 +248,7 @@ This definition is the heart of the calendar!") | |||
| 240 | "Generate a list of all diary-entries from absolute date D1 to D2." | 248 | "Generate a list of all diary-entries from absolute date D1 to D2." |
| 241 | (let ((diary-list-include-blanks nil) | 249 | (let ((diary-list-include-blanks nil) |
| 242 | (diary-display-hook 'ignore)) | 250 | (diary-display-hook 'ignore)) |
| 243 | (list-diary-entries | 251 | (diary-list-entries |
| 244 | (calendar-gregorian-from-absolute d1) | 252 | (calendar-gregorian-from-absolute d1) |
| 245 | (1+ (- d2 d1))))) | 253 | (1+ (- d2 d1))))) |
| 246 | 254 | ||
| @@ -253,8 +261,10 @@ Optional ARGS are included." | |||
| 253 | (insert "\\documentclass") | 261 | (insert "\\documentclass") |
| 254 | (if args | 262 | (if args |
| 255 | (insert "[" args "]")) | 263 | (insert "[" args "]")) |
| 256 | (insert "{article}\n" | 264 | (insert "{article}\n") |
| 257 | "\\hbadness 20000 | 265 | (if (stringp cal-tex-preamble-extra) |
| 266 | (insert cal-tex-preamble-extra "\n")) | ||
| 267 | (insert "\\hbadness 20000 | ||
| 258 | \\hfuzz=1000pt | 268 | \\hfuzz=1000pt |
| 259 | \\vbadness 20000 | 269 | \\vbadness 20000 |
| 260 | \\lineskip 0pt | 270 | \\lineskip 0pt |
| @@ -357,6 +367,8 @@ Optional parameter specifies number of years." | |||
| 357 | (cal-tex-noindent) | 367 | (cal-tex-noindent) |
| 358 | (cal-tex-nl) | 368 | (cal-tex-nl) |
| 359 | (let ((month-names; don't use default in case user changed it | 369 | (let ((month-names; don't use default in case user changed it |
| 370 | ;; These are only used to define the command names, not | ||
| 371 | ;; the names of the months they insert. | ||
| 360 | ["January" "February" "March" "April" "May" "June" | 372 | ["January" "February" "March" "April" "May" "June" |
| 361 | "July" "August" "September" "October" "November" "December"])) | 373 | "July" "August" "September" "October" "November" "December"])) |
| 362 | (calendar-for-loop i from 1 to 12 do | 374 | (calendar-for-loop i from 1 to 12 do |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index a8eeebae8fc..6ced08bf083 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -79,7 +79,7 @@ D-FILE specifies the file to use as the diary file." | |||
| 79 | (list (prefix-numeric-value current-prefix-arg) | 79 | (list (prefix-numeric-value current-prefix-arg) |
| 80 | (read-file-name "Enter diary file name: " default-directory nil t))) | 80 | (read-file-name "Enter diary file name: " default-directory nil t))) |
| 81 | (let ((diary-file d-file)) | 81 | (let ((diary-file d-file)) |
| 82 | (view-diary-entries arg))) | 82 | (diary-view-entries arg))) |
| 83 | 83 | ||
| 84 | (autoload 'check-calendar-holidays "holidays" | 84 | (autoload 'check-calendar-holidays "holidays" |
| 85 | "Check the list of holidays for any that occur on DATE. | 85 | "Check the list of holidays for any that occur on DATE. |
diff --git a/lisp/comint.el b/lisp/comint.el index f8edc85c1ac..946085661fc 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -2703,7 +2703,7 @@ interpreter (e.g., the percent notation of cmd.exe on NT)." | |||
| 2703 | name)) | 2703 | name)) |
| 2704 | 2704 | ||
| 2705 | (defun comint-match-partial-filename () | 2705 | (defun comint-match-partial-filename () |
| 2706 | "Return the filename at point, or nil if non is found. | 2706 | "Return the filename at point, or nil if none is found. |
| 2707 | Environment variables are substituted. See `comint-word'." | 2707 | Environment variables are substituted. See `comint-word'." |
| 2708 | (let ((filename (comint-word comint-file-name-chars))) | 2708 | (let ((filename (comint-word comint-file-name-chars))) |
| 2709 | (and filename (comint-substitute-in-file-name | 2709 | (and filename (comint-substitute-in-file-name |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index e68d2eab293..52f66038ea6 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -2089,7 +2089,7 @@ and `face'." | |||
| 2089 | 'custom-button-pressed | 2089 | 'custom-button-pressed |
| 2090 | 'custom-button-pressed-unraised)) | 2090 | 'custom-button-pressed-unraised)) |
| 2091 | 2091 | ||
| 2092 | (defface custom-documentation nil | 2092 | (defface custom-documentation '((t nil)) |
| 2093 | "Face used for documentation strings in customization buffers." | 2093 | "Face used for documentation strings in customization buffers." |
| 2094 | :group 'custom-faces) | 2094 | :group 'custom-faces) |
| 2095 | ;; backward-compatibility alias | 2095 | ;; backward-compatibility alias |
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el index cf0ee85db23..477914293a7 100644 --- a/lisp/cvs-status.el +++ b/lisp/cvs-status.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: pcl-cvs cvs status tree tools | 7 | ;; Keywords: pcl-cvs cvs status tree tools |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 7c7f7902d82..cc89aad6ca3 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: convenience patch diff | 7 | ;; Keywords: convenience patch diff |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| @@ -118,7 +118,8 @@ when editing big diffs)." | |||
| 118 | ("\C-m" . diff-goto-source) | 118 | ("\C-m" . diff-goto-source) |
| 119 | ([mouse-2] . diff-goto-source) | 119 | ([mouse-2] . diff-goto-source) |
| 120 | ;; From XEmacs' diff-mode. | 120 | ;; From XEmacs' diff-mode. |
| 121 | ("W" . widen) | 121 | ;; Standard M-w is useful, so don't change M-W. |
| 122 | ;; ("W" . widen) | ||
| 122 | ;;("." . diff-goto-source) ;display-buffer | 123 | ;;("." . diff-goto-source) ;display-buffer |
| 123 | ;;("f" . diff-goto-source) ;find-file | 124 | ;;("f" . diff-goto-source) ;find-file |
| 124 | ("o" . diff-goto-source) ;other-window | 125 | ("o" . diff-goto-source) ;other-window |
| @@ -127,14 +128,14 @@ when editing big diffs)." | |||
| 127 | ;;("h" . diff-show-header) | 128 | ;;("h" . diff-show-header) |
| 128 | ;;("j" . diff-show-difference) ;jump to Nth diff | 129 | ;;("j" . diff-show-difference) ;jump to Nth diff |
| 129 | ;;("q" . diff-quit) | 130 | ;;("q" . diff-quit) |
| 130 | (" " . scroll-up) | 131 | ;; Not useful if you have to metafy them. |
| 131 | ("\177" . scroll-down) | 132 | ;; (" " . scroll-up) |
| 132 | ;; Our very own bindings. | 133 | ;; ("\177" . scroll-down) |
| 133 | ("A" . diff-ediff-patch) | 134 | ;; Standard M-a is useful, so don't change M-A. |
| 134 | ("r" . diff-restrict-view) | 135 | ;; ("A" . diff-ediff-patch) |
| 135 | ("R" . diff-reverse-direction) | 136 | ;; Standard M-r is useful, so don't change M-r or M-R. |
| 136 | ("U" . diff-context->unified) | 137 | ;; ("r" . diff-restrict-view) |
| 137 | ("C" . diff-unified->context) | 138 | ;; ("R" . diff-reverse-direction) |
| 138 | ("q" . quit-window)) | 139 | ("q" . quit-window)) |
| 139 | "Basic keymap for `diff-mode', bound to various prefix keys.") | 140 | "Basic keymap for `diff-mode', bound to various prefix keys.") |
| 140 | 141 | ||
| @@ -143,10 +144,14 @@ when editing big diffs)." | |||
| 143 | ;; From compilation-minor-mode. | 144 | ;; From compilation-minor-mode. |
| 144 | ("\C-c\C-c" . diff-goto-source) | 145 | ("\C-c\C-c" . diff-goto-source) |
| 145 | ;; Misc operations. | 146 | ;; Misc operations. |
| 146 | ("\C-c\C-r" . diff-refine-hunk) | ||
| 147 | ("\C-c\C-s" . diff-split-hunk) | ||
| 148 | ("\C-c\C-a" . diff-apply-hunk) | 147 | ("\C-c\C-a" . diff-apply-hunk) |
| 148 | ("\C-c\C-e" . diff-ediff-patch) | ||
| 149 | ("\C-c\C-n" . diff-restrict-view) | ||
| 150 | ("\C-c\C-r" . diff-reverse-direction) | ||
| 151 | ("\C-c\C-s" . diff-split-hunk) | ||
| 149 | ("\C-c\C-t" . diff-test-hunk) | 152 | ("\C-c\C-t" . diff-test-hunk) |
| 153 | ("\C-c\C-u" . diff-context->unified) | ||
| 154 | ("\C-c\C-w" . diff-refine-hunk) | ||
| 150 | ("\C-c\C-f" . next-error-follow-minor-mode)) | 155 | ("\C-c\C-f" . next-error-follow-minor-mode)) |
| 151 | "Keymap for `diff-mode'. See also `diff-mode-shared-map'.") | 156 | "Keymap for `diff-mode'. See also `diff-mode-shared-map'.") |
| 152 | 157 | ||
| @@ -711,77 +716,80 @@ else cover the whole bufer." | |||
| 711 | (delete-region last-pt (point)) | 716 | (delete-region last-pt (point)) |
| 712 | (setq delete nil))))))))))))))) | 717 | (setq delete nil))))))))))))))) |
| 713 | 718 | ||
| 714 | (defun diff-context->unified (start end) | 719 | (defun diff-context->unified (start end &optional to-context) |
| 715 | "Convert context diffs to unified diffs. | 720 | "Convert context diffs to unified diffs. |
| 716 | START and END are either taken from the region (if a prefix arg is given) or | 721 | START and END are either taken from the region |
| 717 | else cover the whole bufer." | 722 | \(when it is highlighted) or else cover the whole buffer. |
| 718 | (interactive (if current-prefix-arg | 723 | With a prefix argument, convert unified format to context format." |
| 719 | (list (mark) (point)) | 724 | (interactive (if (and transient-mark-mode mark-active) |
| 720 | (list (point-min) (point-max)))) | 725 | (list (mark) (point) current-prefix-arg) |
| 721 | (unless (markerp end) (setq end (copy-marker end))) | 726 | (list (point-min) (point-max) current-prefix-arg))) |
| 722 | (let (;;(diff-inhibit-after-change t) | 727 | (if to-context |
| 723 | (inhibit-read-only t)) | 728 | (diff-unified->context start end) |
| 724 | (save-excursion | 729 | (unless (markerp end) (setq end (copy-marker end))) |
| 725 | (goto-char start) | 730 | (let ( ;;(diff-inhibit-after-change t) |
| 726 | (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) | 731 | (inhibit-read-only t)) |
| 727 | (< (point) end)) | 732 | (save-excursion |
| 728 | (combine-after-change-calls | 733 | (goto-char start) |
| 729 | (if (match-beginning 2) | 734 | (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) |
| 730 | ;; we matched a file header | 735 | (< (point) end)) |
| 731 | (progn | 736 | (combine-after-change-calls |
| 732 | ;; use reverse order to make sure the indices are kept valid | 737 | (if (match-beginning 2) |
| 733 | (replace-match "+++" t t nil 3) | 738 | ;; we matched a file header |
| 734 | (replace-match "---" t t nil 2)) | 739 | (progn |
| 735 | ;; we matched a hunk header | 740 | ;; use reverse order to make sure the indices are kept valid |
| 736 | (let ((line1s (match-string 4)) | 741 | (replace-match "+++" t t nil 3) |
| 737 | (line1e (match-string 5)) | 742 | (replace-match "---" t t nil 2)) |
| 738 | (pt1 (match-beginning 0))) | 743 | ;; we matched a hunk header |
| 739 | (replace-match "") | 744 | (let ((line1s (match-string 4)) |
| 740 | (unless (re-search-forward | 745 | (line1e (match-string 5)) |
| 741 | "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t) | 746 | (pt1 (match-beginning 0))) |
| 742 | (error "Can't find matching `--- n1,n2 ----' line")) | 747 | (replace-match "") |
| 743 | (let ((line2s (match-string 1)) | 748 | (unless (re-search-forward |
| 744 | (line2e (match-string 2)) | 749 | "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t) |
| 745 | (pt2 (progn | 750 | (error "Can't find matching `--- n1,n2 ----' line")) |
| 746 | (delete-region (progn (beginning-of-line) (point)) | 751 | (let ((line2s (match-string 1)) |
| 747 | (progn (forward-line 1) (point))) | 752 | (line2e (match-string 2)) |
| 748 | (point-marker)))) | 753 | (pt2 (progn |
| 749 | (goto-char pt1) | 754 | (delete-region (progn (beginning-of-line) (point)) |
| 750 | (forward-line 1) | 755 | (progn (forward-line 1) (point))) |
| 751 | (while (< (point) pt2) | 756 | (point-marker)))) |
| 752 | (case (char-after) | ||
| 753 | ((?! ?-) (delete-char 2) (insert "-") (forward-line 1)) | ||
| 754 | (?\s ;merge with the other half of the chunk | ||
| 755 | (let* ((endline2 | ||
| 756 | (save-excursion | ||
| 757 | (goto-char pt2) (forward-line 1) (point))) | ||
| 758 | (c (char-after pt2))) | ||
| 759 | (case c | ||
| 760 | ((?! ?+) | ||
| 761 | (insert "+" | ||
| 762 | (prog1 (buffer-substring (+ pt2 2) endline2) | ||
| 763 | (delete-region pt2 endline2)))) | ||
| 764 | (?\s ;FIXME: check consistency | ||
| 765 | (delete-region pt2 endline2) | ||
| 766 | (delete-char 1) | ||
| 767 | (forward-line 1)) | ||
| 768 | (?\\ (forward-line 1)) | ||
| 769 | (t (delete-char 1) (forward-line 1))))) | ||
| 770 | (t (forward-line 1)))) | ||
| 771 | (while (looking-at "[+! ] ") | ||
| 772 | (if (/= (char-after) ?!) (forward-char 1) | ||
| 773 | (delete-char 1) (insert "+")) | ||
| 774 | (delete-char 1) (forward-line 1)) | ||
| 775 | (save-excursion | ||
| 776 | (goto-char pt1) | 757 | (goto-char pt1) |
| 777 | (insert "@@ -" line1s "," | 758 | (forward-line 1) |
| 778 | (number-to-string (- (string-to-number line1e) | 759 | (while (< (point) pt2) |
| 779 | (string-to-number line1s) | 760 | (case (char-after) |
| 780 | -1)) | 761 | ((?! ?-) (delete-char 2) (insert "-") (forward-line 1)) |
| 781 | " +" line2s "," | 762 | (?\s ;merge with the other half of the chunk |
| 782 | (number-to-string (- (string-to-number line2e) | 763 | (let* ((endline2 |
| 783 | (string-to-number line2s) | 764 | (save-excursion |
| 784 | -1)) " @@")))))))))) | 765 | (goto-char pt2) (forward-line 1) (point))) |
| 766 | (c (char-after pt2))) | ||
| 767 | (case c | ||
| 768 | ((?! ?+) | ||
| 769 | (insert "+" | ||
| 770 | (prog1 (buffer-substring (+ pt2 2) endline2) | ||
| 771 | (delete-region pt2 endline2)))) | ||
| 772 | (?\s ;FIXME: check consistency | ||
| 773 | (delete-region pt2 endline2) | ||
| 774 | (delete-char 1) | ||
| 775 | (forward-line 1)) | ||
| 776 | (?\\ (forward-line 1)) | ||
| 777 | (t (delete-char 1) (forward-line 1))))) | ||
| 778 | (t (forward-line 1)))) | ||
| 779 | (while (looking-at "[+! ] ") | ||
| 780 | (if (/= (char-after) ?!) (forward-char 1) | ||
| 781 | (delete-char 1) (insert "+")) | ||
| 782 | (delete-char 1) (forward-line 1)) | ||
| 783 | (save-excursion | ||
| 784 | (goto-char pt1) | ||
| 785 | (insert "@@ -" line1s "," | ||
| 786 | (number-to-string (- (string-to-number line1e) | ||
| 787 | (string-to-number line1s) | ||
| 788 | -1)) | ||
| 789 | " +" line2s "," | ||
| 790 | (number-to-string (- (string-to-number line2e) | ||
| 791 | (string-to-number line2s) | ||
| 792 | -1)) " @@"))))))))))) | ||
| 785 | 793 | ||
| 786 | (defun diff-reverse-direction (start end) | 794 | (defun diff-reverse-direction (start end) |
| 787 | "Reverse the direction of the diffs. | 795 | "Reverse the direction of the diffs. |
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 133c4c42f2a..a02a8c14eba 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el | |||
| @@ -209,6 +209,7 @@ only, and you can use whatever symbols you like.) | |||
| 209 | 209 | ||
| 210 | LEVEL should be either :debug, :warning, :error, or :emergency | 210 | LEVEL should be either :debug, :warning, :error, or :emergency |
| 211 | \(but see `warning-minimum-level' and `warning-minimum-log-level'). | 211 | \(but see `warning-minimum-level' and `warning-minimum-log-level'). |
| 212 | Default is :warning. | ||
| 212 | 213 | ||
| 213 | :emergency -- a problem that will seriously impair Emacs operation soon | 214 | :emergency -- a problem that will seriously impair Emacs operation soon |
| 214 | if you do not attend to it promptly. | 215 | if you do not attend to it promptly. |
| @@ -292,7 +293,7 @@ See also `warning-series', `warning-prefix-function' and | |||
| 292 | Aside from generating the message with `format', | 293 | Aside from generating the message with `format', |
| 293 | this is equivalent to `display-warning'. | 294 | this is equivalent to `display-warning'. |
| 294 | 295 | ||
| 295 | TYPE is the warning type: either a custom group name (a symbol). | 296 | TYPE is the warning type: either a custom group name (a symbol), |
| 296 | or a list of symbols whose first element is a custom group name. | 297 | or a list of symbols whose first element is a custom group name. |
| 297 | \(The rest of the symbols represent subcategories and | 298 | \(The rest of the symbols represent subcategories and |
| 298 | can be whatever you like.) | 299 | can be whatever you like.) |
diff --git a/lisp/faces.el b/lisp/faces.el index 67f8a2af07a..6a05edc84ca 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -2144,19 +2144,19 @@ used to display the prompt text." | |||
| 2144 | :group 'frames | 2144 | :group 'frames |
| 2145 | :group 'basic-faces) | 2145 | :group 'basic-faces) |
| 2146 | 2146 | ||
| 2147 | (defface scroll-bar '() | 2147 | (defface scroll-bar '((t nil)) |
| 2148 | "Basic face for the scroll bar colors under X." | 2148 | "Basic face for the scroll bar colors under X." |
| 2149 | :version "21.1" | 2149 | :version "21.1" |
| 2150 | :group 'frames | 2150 | :group 'frames |
| 2151 | :group 'basic-faces) | 2151 | :group 'basic-faces) |
| 2152 | 2152 | ||
| 2153 | (defface border '() | 2153 | (defface border '((t nil)) |
| 2154 | "Basic face for the frame border under X." | 2154 | "Basic face for the frame border under X." |
| 2155 | :version "21.1" | 2155 | :version "21.1" |
| 2156 | :group 'frames | 2156 | :group 'frames |
| 2157 | :group 'basic-faces) | 2157 | :group 'basic-faces) |
| 2158 | 2158 | ||
| 2159 | (defface cursor '() | 2159 | (defface cursor '((t nil)) |
| 2160 | "Basic face for the cursor color under X. | 2160 | "Basic face for the cursor color under X. |
| 2161 | Note: Other faces cannot inherit from the cursor face." | 2161 | Note: Other faces cannot inherit from the cursor face." |
| 2162 | :version "21.1" | 2162 | :version "21.1" |
| @@ -2165,7 +2165,7 @@ Note: Other faces cannot inherit from the cursor face." | |||
| 2165 | 2165 | ||
| 2166 | (put 'cursor 'face-no-inherit t) | 2166 | (put 'cursor 'face-no-inherit t) |
| 2167 | 2167 | ||
| 2168 | (defface mouse '() | 2168 | (defface mouse '((t nil)) |
| 2169 | "Basic face for the mouse color under X." | 2169 | "Basic face for the mouse color under X." |
| 2170 | :version "21.1" | 2170 | :version "21.1" |
| 2171 | :group 'mouse | 2171 | :group 'mouse |
diff --git a/lisp/files.el b/lisp/files.el index df63e016c63..76167eb27cf 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2652,15 +2652,11 @@ It is safe if any of these conditions are met: | |||
| 2652 | * There is a matching entry (SYM . VAL) in the | 2652 | * There is a matching entry (SYM . VAL) in the |
| 2653 | `safe-local-variable-values' user option. | 2653 | `safe-local-variable-values' user option. |
| 2654 | 2654 | ||
| 2655 | * The `safe-local-variable' property of SYM is t. | ||
| 2656 | |||
| 2657 | * The `safe-local-variable' property of SYM is a function that | 2655 | * The `safe-local-variable' property of SYM is a function that |
| 2658 | evaluates to a non-nil value with VAL as an argument." | 2656 | evaluates to a non-nil value with VAL as an argument." |
| 2659 | (or (member (cons sym val) safe-local-variable-values) | 2657 | (or (member (cons sym val) safe-local-variable-values) |
| 2660 | (let ((safep (get sym 'safe-local-variable))) | 2658 | (let ((safep (get sym 'safe-local-variable))) |
| 2661 | (or (eq safep t) | 2659 | (and (functionp safep) (funcall safep val))))) |
| 2662 | (and (functionp safep) | ||
| 2663 | (funcall safep val)))))) | ||
| 2664 | 2660 | ||
| 2665 | (defun risky-local-variable-p (sym &optional ignored) | 2661 | (defun risky-local-variable-p (sym &optional ignored) |
| 2666 | "Non-nil if SYM could be dangerous as a file-local variable. | 2662 | "Non-nil if SYM could be dangerous as a file-local variable. |
diff --git a/lisp/follow.el b/lisp/follow.el index 1958c407664..27c37132f0a 100644 --- a/lisp/follow.el +++ b/lisp/follow.el | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | ;; Maintainer: FSF (Anders' email bounces, Sep 2005) | 7 | ;; Maintainer: FSF (Anders' email bounces, Sep 2005) |
| 8 | ;; Created: 1995-05-25 | 8 | ;; Created: 1995-05-25 |
| 9 | ;; Keywords: display, window, minor-mode, convenience | 9 | ;; Keywords: display, window, minor-mode, convenience |
| 10 | ;; Last Changed: 1999-11-17 | ||
| 11 | 10 | ||
| 12 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 13 | 12 | ||
| @@ -46,14 +45,14 @@ | |||
| 46 | ;; movement commands. | 45 | ;; movement commands. |
| 47 | ;; | 46 | ;; |
| 48 | ;; Follow mode comes to its prime when a large screen and two | 47 | ;; Follow mode comes to its prime when a large screen and two |
| 49 | ;; side-by-side window are used. The user can, with the help of Follow | 48 | ;; side-by-side window are used. The user can, with the help of Follow |
| 50 | ;; mode, use two full-height windows as though they would have been | 49 | ;; mode, use two full-height windows as though they would have been |
| 51 | ;; one. Imagine yourself editing a large function, or section of text, | 50 | ;; one. Imagine yourself editing a large function, or section of text, |
| 52 | ;; and being able to use 144 lines instead of the normal 72... (your | 51 | ;; and being able to use 144 lines instead of the normal 72... (your |
| 53 | ;; mileage may vary). | 52 | ;; mileage may vary). |
| 54 | 53 | ||
| 55 | ;; To test this package, make sure `follow' is loaded, or will be | 54 | ;; To test this package, make sure `follow' is loaded, or will be |
| 56 | ;; autoloaded when activated (see below). Then do the following: | 55 | ;; autoloaded when activated (see below). Then do the following: |
| 57 | ;; | 56 | ;; |
| 58 | ;; * Find your favorite file (preferably a long one). | 57 | ;; * Find your favorite file (preferably a long one). |
| 59 | ;; | 58 | ;; |
| @@ -77,13 +76,13 @@ | |||
| 77 | ;; +----------+----------+ | 76 | ;; +----------+----------+ |
| 78 | ;; | 77 | ;; |
| 79 | ;; As you can see, the right-hand window starts at line 73, the line | 78 | ;; As you can see, the right-hand window starts at line 73, the line |
| 80 | ;; immediately below the end of the left-hand window. As long as | 79 | ;; immediately below the end of the left-hand window. As long as |
| 81 | ;; `follow-mode' is active, the two windows will follow eachother! | 80 | ;; `follow-mode' is active, the two windows will follow eachother! |
| 82 | ;; | 81 | ;; |
| 83 | ;; * Play around and enjoy! Scroll one window and watch the other. | 82 | ;; * Play around and enjoy! Scroll one window and watch the other. |
| 84 | ;; Jump to the beginning or end. Press `Cursor down' at the last | 83 | ;; Jump to the beginning or end. Press `Cursor down' at the last |
| 85 | ;; line of the left-hand window. Enter new lines into the | 84 | ;; line of the left-hand window. Enter new lines into the |
| 86 | ;; text. Enter long lines spanning several lines, or several | 85 | ;; text. Enter long lines spanning several lines, or several |
| 87 | ;; windows. | 86 | ;; windows. |
| 88 | ;; | 87 | ;; |
| 89 | ;; * Should you find `Follow' mode annoying, just type | 88 | ;; * Should you find `Follow' mode annoying, just type |
| @@ -146,7 +145,7 @@ | |||
| 146 | ;; Usage: | 145 | ;; Usage: |
| 147 | ;; | 146 | ;; |
| 148 | ;; To activate issue the command "M-x follow-mode" | 147 | ;; To activate issue the command "M-x follow-mode" |
| 149 | ;; and press return. To deactivate, do it again. | 148 | ;; and press return. To deactivate, do it again. |
| 150 | ;; | 149 | ;; |
| 151 | ;; The following is a list of commands useful when follow-mode is active. | 150 | ;; The following is a list of commands useful when follow-mode is active. |
| 152 | ;; | 151 | ;; |
| @@ -197,7 +196,7 @@ | |||
| 197 | ;; in the same frame. (My apoligies to you who can't use frames.) | 196 | ;; in the same frame. (My apoligies to you who can't use frames.) |
| 198 | ;; | 197 | ;; |
| 199 | ;; 2) Bind `follow-mode' to key so you can turn it off whenever | 198 | ;; 2) Bind `follow-mode' to key so you can turn it off whenever |
| 200 | ;; you want to view two locations. Of course, `follow' mode can | 199 | ;; you want to view two locations. Of course, `follow' mode can |
| 201 | ;; be reactivated by hitting the same key again. | 200 | ;; be reactivated by hitting the same key again. |
| 202 | ;; | 201 | ;; |
| 203 | ;; Example from my ~/.emacs: | 202 | ;; Example from my ~/.emacs: |
| @@ -208,7 +207,7 @@ | |||
| 208 | ;; | 207 | ;; |
| 209 | ;; In an ideal world, follow mode would have been implemented in the | 208 | ;; In an ideal world, follow mode would have been implemented in the |
| 210 | ;; kernel of the display routines, making sure that the windows (using | 209 | ;; kernel of the display routines, making sure that the windows (using |
| 211 | ;; follow mode) ALWAYS are aligned. On planet earth, however, we must | 210 | ;; follow mode) ALWAYS are aligned. On planet earth, however, we must |
| 212 | ;; accept a solution where we ALMOST ALWAYS can make sure that the | 211 | ;; accept a solution where we ALMOST ALWAYS can make sure that the |
| 213 | ;; windows are aligned. | 212 | ;; windows are aligned. |
| 214 | ;; | 213 | ;; |
| @@ -222,7 +221,7 @@ | |||
| 222 | ;; | 221 | ;; |
| 223 | ;; Note that only the selected window is checked, for the reason of | 222 | ;; Note that only the selected window is checked, for the reason of |
| 224 | ;; efficiency and code complexity. (I.e. it is possible to make a | 223 | ;; efficiency and code complexity. (I.e. it is possible to make a |
| 225 | ;; non-selected windows unaligned. It will, however, pop right back | 224 | ;; non-selected windows unaligned. It will, however, pop right back |
| 226 | ;; when it is selected.) | 225 | ;; when it is selected.) |
| 227 | 226 | ||
| 228 | ;;}}} | 227 | ;;}}} |
| @@ -259,7 +258,7 @@ | |||
| 259 | (eval-when-compile | 258 | (eval-when-compile |
| 260 | (if (or (featurep 'bytecomp) | 259 | (if (or (featurep 'bytecomp) |
| 261 | (featurep 'byte-compile)) | 260 | (featurep 'byte-compile)) |
| 262 | (cond ((string-match "XEmacs" emacs-version) | 261 | (cond ((featurep 'xemacs) |
| 263 | ;; Make XEmacs shut up! I'm using standard Emacs | 262 | ;; Make XEmacs shut up! I'm using standard Emacs |
| 264 | ;; functions, they are NOT obsolete! | 263 | ;; functions, they are NOT obsolete! |
| 265 | (if (eq (get 'force-mode-line-update 'byte-compile) | 264 | (if (eq (get 'force-mode-line-update 'byte-compile) |
| @@ -278,176 +277,44 @@ | |||
| 278 | :group 'windows | 277 | :group 'windows |
| 279 | :group 'convenience) | 278 | :group 'convenience) |
| 280 | 279 | ||
| 281 | (defvar follow-mode nil | ||
| 282 | "Variable indicating if Follow mode is active.") | ||
| 283 | |||
| 284 | (defcustom follow-mode-hook nil | 280 | (defcustom follow-mode-hook nil |
| 285 | "*Hooks to run when follow-mode is turned on." | 281 | "Hooks to run when follow-mode is turned on." |
| 286 | :type 'hook | 282 | :type 'hook |
| 287 | :group 'follow) | 283 | :group 'follow) |
| 288 | 284 | ||
| 289 | (defcustom follow-mode-off-hook nil | 285 | (defcustom follow-mode-off-hook nil |
| 290 | "*Hooks to run when follow-mode is turned off." | 286 | "Hooks to run when follow-mode is turned off." |
| 291 | :type 'hook | 287 | :type 'hook |
| 292 | :group 'follow) | 288 | :group 'follow) |
| 293 | 289 | ||
| 294 | (defvar follow-mode-map nil | ||
| 295 | "*Minor mode keymap for Follow mode.") | ||
| 296 | 290 | ||
| 297 | (defcustom follow-mode-line-text " Follow" | 291 | ;;{{{ Keymap/Menu |
| 298 | "*Text shown in the mode line when Follow mode is active. | ||
| 299 | Defaults to \" Follow\". Examples of other values | ||
| 300 | are \" Fw\", or simply \"\"." | ||
| 301 | :type 'string | ||
| 302 | :group 'follow) | ||
| 303 | 292 | ||
| 304 | (defcustom follow-auto nil | 293 | ;; Define keys for the follow-mode minor mode map and replace some |
| 305 | "*Non-nil activates Follow mode whenever a file is loaded." | 294 | ;; functions in the global map. All `follow' mode special functions |
| 306 | :type 'boolean | 295 | ;; can be found on (the somewhat cumbersome) "C-c . <key>" |
| 307 | :group 'follow) | 296 | ;; (Control-C dot <key>). (As of Emacs 19.29 the keys |
| 297 | ;; C-c <punctuation character> are reserved for minor modes.) | ||
| 298 | ;; | ||
| 299 | ;; To change the prefix, redefine `follow-mode-prefix' before | ||
| 300 | ;; `follow' is loaded, or see the section on `follow-mode-hook' | ||
| 301 | ;; above for an example of how to bind the keys the way you like. | ||
| 302 | ;; | ||
| 303 | ;; Please note that the keymap is defined the first time this file is | ||
| 304 | ;; loaded. Also note that the only legal way to manipulate the | ||
| 305 | ;; keymap is to use `define-key'. Don't change it using `setq' or | ||
| 306 | ;; similar! | ||
| 308 | 307 | ||
| 309 | (defcustom follow-mode-prefix "\C-c." | 308 | (defcustom follow-mode-prefix "\C-c." |
| 310 | "*Prefix key to use for follow commands in Follow mode. | 309 | "Prefix key to use for follow commands in Follow mode. |
| 311 | The value of this variable is checked as part of loading Follow mode. | 310 | The value of this variable is checked as part of loading Follow mode. |
| 312 | After that, changing the prefix key requires manipulating keymaps." | 311 | After that, changing the prefix key requires manipulating keymaps." |
| 313 | :type 'string | 312 | :type 'string |
| 314 | :group 'follow) | 313 | :group 'follow) |
| 315 | 314 | ||
| 316 | (defcustom follow-intercept-processes | 315 | (defvar follow-mode-map |
| 317 | (fboundp 'start-process) | 316 | (let ((mainmap (make-sparse-keymap)) |
| 318 | "*When non-nil, Follow Mode will monitor process output." | 317 | (map (make-sparse-keymap))) |
| 319 | :type 'boolean | ||
| 320 | :group 'follow) | ||
| 321 | |||
| 322 | (defvar follow-emacs-version-xemacs-p | ||
| 323 | (string-match "XEmacs" emacs-version) | ||
| 324 | "Non-nil when running under XEmacs.") | ||
| 325 | |||
| 326 | (defvar follow-avoid-tail-recenter-p | ||
| 327 | (not follow-emacs-version-xemacs-p) | ||
| 328 | "*When non-nil, patch emacs so that tail windows won't be recentered. | ||
| 329 | |||
| 330 | A \"tail window\" is a window that displays only the end of | ||
| 331 | the buffer. Normally it is practical for the user that empty | ||
| 332 | windows are recentered automatically. However, when using | ||
| 333 | Follow Mode it breaks the display when the end is displayed | ||
| 334 | in a window \"above\" the last window. This is for | ||
| 335 | example the case when displaying a short page in info. | ||
| 336 | |||
| 337 | Must be set before Follow Mode is loaded. | ||
| 338 | |||
| 339 | Please note that it is not possible to fully prevent Emacs from | ||
| 340 | recentering empty windows. Please report if you find a repeatable | ||
| 341 | situation in which Emacs recenters empty windows. | ||
| 342 | |||
| 343 | XEmacs, as of 19.12, does not recenter windows, good!") | ||
| 344 | |||
| 345 | (defvar follow-cache-command-list | ||
| 346 | '(next-line previous-line forward-char backward-char) | ||
| 347 | "List of commands that don't require recalculation. | ||
| 348 | |||
| 349 | In order to be able to use the cache, a command should not change the | ||
| 350 | contents of the buffer, nor should it change selected window or current | ||
| 351 | buffer. | ||
| 352 | |||
| 353 | The commands in this list are checked at load time. | ||
| 354 | |||
| 355 | To mark other commands as suitable for caching, set the symbol | ||
| 356 | property `follow-mode-use-cache' to non-nil.") | ||
| 357 | |||
| 358 | (defvar follow-debug nil | ||
| 359 | "*Non-nil when debugging Follow mode.") | ||
| 360 | |||
| 361 | |||
| 362 | ;; Internal variables: | ||
| 363 | |||
| 364 | (defvar follow-internal-force-redisplay nil | ||
| 365 | "True when Follow mode should redisplay the windows.") | ||
| 366 | |||
| 367 | (defvar follow-process-filter-alist '() | ||
| 368 | "The original filters for processes intercepted by Follow mode.") | ||
| 369 | |||
| 370 | (defvar follow-active-menu nil | ||
| 371 | "The menu visible when Follow mode is active.") | ||
| 372 | |||
| 373 | (defvar follow-deactive-menu nil | ||
| 374 | "The menu visible when Follow mode is deactivated.") | ||
| 375 | |||
| 376 | (defvar follow-inside-post-command-hook nil | ||
| 377 | "Non-nil when inside Follow modes `post-command-hook'. | ||
| 378 | Used by `follow-window-size-change'.") | ||
| 379 | |||
| 380 | (defvar follow-windows-start-end-cache nil | ||
| 381 | "Cache used by `follow-window-start-end'.") | ||
| 382 | |||
| 383 | ;;}}} | ||
| 384 | ;;{{{ Bug report | ||
| 385 | |||
| 386 | (eval-when-compile (require 'reporter)) | ||
| 387 | |||
| 388 | (defun follow-submit-feedback () | ||
| 389 | "Submit feedback on Follow mode to the author: andersl@andersl.com" | ||
| 390 | (interactive) | ||
| 391 | (require 'reporter) | ||
| 392 | (and (y-or-n-p "Do you really want to submit a report on Follow mode? ") | ||
| 393 | (reporter-submit-bug-report | ||
| 394 | "Anders Lindgren <andersl@andersl.com>" | ||
| 395 | "follow.el" | ||
| 396 | '(post-command-hook | ||
| 397 | pre-command-hook | ||
| 398 | window-size-change-functions | ||
| 399 | window-scroll-functions | ||
| 400 | follow-mode-hook | ||
| 401 | follow-mode-off-hook | ||
| 402 | follow-auto | ||
| 403 | follow-intercept-processes | ||
| 404 | follow-avoid-tail-recenter-p | ||
| 405 | follow-process-filter-alist) | ||
| 406 | nil | ||
| 407 | nil | ||
| 408 | (concat | ||
| 409 | "Hi Anders!\n\n" | ||
| 410 | "(I have read the section on how to report bugs in the " | ||
| 411 | "Emacs manual.)\n\n" | ||
| 412 | "Even though I know you are busy, I thought you might " | ||
| 413 | "want to know...\n\n")))) | ||
| 414 | |||
| 415 | ;;}}} | ||
| 416 | ;;{{{ Debug messages | ||
| 417 | |||
| 418 | ;; This inline function must be as small as possible! | ||
| 419 | ;; Maybe we should define a macro that expands to nil if | ||
| 420 | ;; the variable is not set. | ||
| 421 | |||
| 422 | (defsubst follow-debug-message (&rest args) | ||
| 423 | "Like message, but only active when `follow-debug' is non-nil." | ||
| 424 | (if (and (boundp 'follow-debug) follow-debug) | ||
| 425 | (apply 'message args))) | ||
| 426 | |||
| 427 | ;;}}} | ||
| 428 | |||
| 429 | ;;{{{ Keymap/Menu | ||
| 430 | |||
| 431 | ;;; Define keys for the follow-mode minor mode map and replace some | ||
| 432 | ;;; functions in the global map. All `follow' mode special functions | ||
| 433 | ;;; can be found on (the somewhat cumbersome) "C-c . <key>" | ||
| 434 | ;;; (Control-C dot <key>). (As of Emacs 19.29 the keys | ||
| 435 | ;;; C-c <punctuation character> are reserved for minor modes.) | ||
| 436 | ;;; | ||
| 437 | ;;; To change the prefix, redefine `follow-mode-prefix' before | ||
| 438 | ;;; `follow' is loaded, or see the section on `follow-mode-hook' | ||
| 439 | ;;; above for an example of how to bind the keys the way you like. | ||
| 440 | ;;; | ||
| 441 | ;;; Please note that the keymap is defined the first time this file is | ||
| 442 | ;;; loaded. Also note that the only legal way to manipulate the | ||
| 443 | ;;; keymap is to use `define-key'. Don't change it using `setq' or | ||
| 444 | ;;; similar! | ||
| 445 | |||
| 446 | |||
| 447 | (if follow-mode-map | ||
| 448 | nil | ||
| 449 | (setq follow-mode-map (make-sparse-keymap)) | ||
| 450 | (let ((map (make-sparse-keymap))) | ||
| 451 | (define-key map "\C-v" 'follow-scroll-up) | 318 | (define-key map "\C-v" 'follow-scroll-up) |
| 452 | (define-key map "\M-v" 'follow-scroll-down) | 319 | (define-key map "\M-v" 'follow-scroll-down) |
| 453 | (define-key map "v" 'follow-scroll-down) | 320 | (define-key map "v" 'follow-scroll-down) |
| @@ -460,38 +327,26 @@ Used by `follow-window-size-change'.") | |||
| 460 | (define-key map "n" 'follow-next-window) | 327 | (define-key map "n" 'follow-next-window) |
| 461 | (define-key map "p" 'follow-previous-window) | 328 | (define-key map "p" 'follow-previous-window) |
| 462 | 329 | ||
| 463 | (define-key follow-mode-map follow-mode-prefix map) | 330 | (define-key mainmap follow-mode-prefix map) |
| 464 | 331 | ||
| 465 | ;; Replace the standard `end-of-buffer', when in Follow Mode. (I | 332 | ;; Replace the standard `end-of-buffer', when in Follow Mode. (I |
| 466 | ;; don't see the point in trying to replace every function that | 333 | ;; don't see the point in trying to replace every function that |
| 467 | ;; could be enhanced in Follow mode. End-of-buffer is a special | 334 | ;; could be enhanced in Follow mode. End-of-buffer is a special |
| 468 | ;; case since it is very simple to define and it greatly enhances | 335 | ;; case since it is very simple to define and it greatly enhances |
| 469 | ;; the look and feel of Follow mode.) | 336 | ;; the look and feel of Follow mode.) |
| 470 | ;; | 337 | (define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer) |
| 471 | ;; (The function `substitute-key-definition' does not work | ||
| 472 | ;; in all versions of Emacs.) | ||
| 473 | (mapcar | ||
| 474 | (function | ||
| 475 | (lambda (pair) | ||
| 476 | (let ((old (car pair)) | ||
| 477 | (new (cdr pair))) | ||
| 478 | (mapcar (function (lambda (key) | ||
| 479 | (define-key follow-mode-map key new))) | ||
| 480 | (where-is-internal old global-map))))) | ||
| 481 | '((end-of-buffer . follow-end-of-buffer) | ||
| 482 | (fkey-end-of-buffer . follow-end-of-buffer))) | ||
| 483 | 338 | ||
| 484 | ;;; | 339 | ;; |
| 485 | ;;; The menu. | 340 | ;; The menu. |
| 486 | ;;; | 341 | ;; |
| 487 | 342 | ||
| 488 | (if (not follow-emacs-version-xemacs-p) | 343 | (if (not (featurep 'xemacs)) |
| 489 | 344 | ||
| 490 | ;; | 345 | ;; |
| 491 | ;; Emacs | 346 | ;; Emacs |
| 492 | ;; | 347 | ;; |
| 493 | (let ((menumap (funcall (symbol-function 'make-sparse-keymap) | 348 | (let ((menumap (funcall (symbol-function 'make-sparse-keymap) |
| 494 | "Follow")) | 349 | "Follow")) |
| 495 | (count 0) | 350 | (count 0) |
| 496 | id) | 351 | id) |
| 497 | (mapcar | 352 | (mapcar |
| @@ -516,16 +371,16 @@ Used by `follow-window-size-change'.") | |||
| 516 | ("First Window" . follow-first-window) | 371 | ("First Window" . follow-first-window) |
| 517 | ("--") | 372 | ("--") |
| 518 | ("Switch To Buffer (all windows)" | 373 | ("Switch To Buffer (all windows)" |
| 519 | . follow-switch-to-buffer-all) | 374 | . follow-switch-to-buffer-all) |
| 520 | ("Switch To Buffer" . follow-switch-to-buffer) | 375 | ("Switch To Buffer" . follow-switch-to-buffer) |
| 521 | ("--") | 376 | ("--") |
| 522 | ("Delete Other Windows and Split" | 377 | ("Delete Other Windows and Split" |
| 523 | . follow-delete-other-windows-and-split) | 378 | . follow-delete-other-windows-and-split) |
| 524 | ("--") | 379 | ("--") |
| 525 | ("Scroll Down" . follow-scroll-down) | 380 | ("Scroll Down" . follow-scroll-down) |
| 526 | ("Scroll Up" . follow-scroll-up))) | 381 | ("Scroll Up" . follow-scroll-up))) |
| 527 | 382 | ||
| 528 | ;; If there is a `tools' meny, we use it. However, we can't add a | 383 | ;; If there is a `tools' menu, we use it. However, we can't add a |
| 529 | ;; minor-mode specific item to it (it's broken), so we make the | 384 | ;; minor-mode specific item to it (it's broken), so we make the |
| 530 | ;; contents ghosted when not in use, and add ourselves to the | 385 | ;; contents ghosted when not in use, and add ourselves to the |
| 531 | ;; global map. If no `tools' menu is present, just make a | 386 | ;; global map. If no `tools' menu is present, just make a |
| @@ -546,7 +401,7 @@ Used by `follow-window-size-change'.") | |||
| 546 | (if last | 401 | (if last |
| 547 | (progn | 402 | (progn |
| 548 | (funcall (symbol-function 'define-key-after) | 403 | (funcall (symbol-function 'define-key-after) |
| 549 | tools-map [separator-follow] '("--") last) | 404 | tools-map [separator-follow] '("--") last) |
| 550 | (funcall (symbol-function 'define-key-after) | 405 | (funcall (symbol-function 'define-key-after) |
| 551 | tools-map [follow] (cons "Follow" menumap) | 406 | tools-map [follow] (cons "Follow" menumap) |
| 552 | 'separator-follow)) | 407 | 'separator-follow)) |
| @@ -555,7 +410,7 @@ Used by `follow-window-size-change'.") | |||
| 555 | (define-key (current-global-map) [menu-bar tools follow] | 410 | (define-key (current-global-map) [menu-bar tools follow] |
| 556 | (cons "Follow" menumap)))) | 411 | (cons "Follow" menumap)))) |
| 557 | ;; No tools menu, add "Follow" to the menubar. | 412 | ;; No tools menu, add "Follow" to the menubar. |
| 558 | (define-key follow-mode-map [menu-bar follow] | 413 | (define-key mainmap [menu-bar follow] |
| 559 | (cons "Follow" menumap))))) | 414 | (cons "Follow" menumap))))) |
| 560 | 415 | ||
| 561 | ;; | 416 | ;; |
| @@ -593,21 +448,103 @@ Used by `follow-window-size-change'.") | |||
| 593 | (defun follow-menu-filter (menu) | 448 | (defun follow-menu-filter (menu) |
| 594 | (if follow-mode | 449 | (if follow-mode |
| 595 | menu | 450 | menu |
| 596 | '(["Activate " follow-mode t])))))) | 451 | '(["Activate " follow-mode t])))) |
| 452 | |||
| 453 | mainmap) | ||
| 454 | "Minor mode keymap for Follow mode.") | ||
| 597 | 455 | ||
| 456 | ;;}}} | ||
| 598 | 457 | ||
| 599 | ;;; Register the follow mode keymap. | 458 | (defcustom follow-mode-line-text " Follow" |
| 600 | (or (assq 'follow-mode minor-mode-map-alist) | 459 | "Text shown in the mode line when Follow mode is active. |
| 601 | (setq minor-mode-map-alist | 460 | Defaults to \" Follow\". Examples of other values |
| 602 | (cons (cons 'follow-mode follow-mode-map) minor-mode-map-alist))) | 461 | are \" Fw\", or simply \"\"." |
| 462 | :type 'string | ||
| 463 | :group 'follow) | ||
| 464 | |||
| 465 | (defcustom follow-auto nil | ||
| 466 | "Non-nil activates Follow mode whenever a file is loaded." | ||
| 467 | :type 'boolean | ||
| 468 | :group 'follow) | ||
| 469 | |||
| 470 | (defcustom follow-intercept-processes (fboundp 'start-process) | ||
| 471 | "When non-nil, Follow Mode will monitor process output." | ||
| 472 | :type 'boolean | ||
| 473 | :group 'follow) | ||
| 474 | |||
| 475 | (defvar follow-avoid-tail-recenter-p (not (featurep 'xemacs)) | ||
| 476 | "*When non-nil, patch emacs so that tail windows won't be recentered. | ||
| 477 | |||
| 478 | A \"tail window\" is a window that displays only the end of | ||
| 479 | the buffer. Normally it is practical for the user that empty | ||
| 480 | windows are recentered automatically. However, when using | ||
| 481 | Follow Mode it breaks the display when the end is displayed | ||
| 482 | in a window \"above\" the last window. This is for | ||
| 483 | example the case when displaying a short page in info. | ||
| 484 | |||
| 485 | Must be set before Follow Mode is loaded. | ||
| 486 | |||
| 487 | Please note that it is not possible to fully prevent Emacs from | ||
| 488 | recentering empty windows. Please report if you find a repeatable | ||
| 489 | situation in which Emacs recenters empty windows. | ||
| 490 | |||
| 491 | XEmacs, as of 19.12, does not recenter windows, good!") | ||
| 492 | |||
| 493 | (defvar follow-cache-command-list | ||
| 494 | '(next-line previous-line forward-char backward-char) | ||
| 495 | "List of commands that don't require recalculation. | ||
| 496 | |||
| 497 | In order to be able to use the cache, a command should not change the | ||
| 498 | contents of the buffer, nor should it change selected window or current | ||
| 499 | buffer. | ||
| 500 | |||
| 501 | The commands in this list are checked at load time. | ||
| 502 | |||
| 503 | To mark other commands as suitable for caching, set the symbol | ||
| 504 | property `follow-mode-use-cache' to non-nil.") | ||
| 505 | |||
| 506 | (defvar follow-debug nil | ||
| 507 | "*Non-nil when debugging Follow mode.") | ||
| 508 | |||
| 509 | |||
| 510 | ;; Internal variables: | ||
| 511 | |||
| 512 | (defvar follow-internal-force-redisplay nil | ||
| 513 | "True when Follow mode should redisplay the windows.") | ||
| 514 | |||
| 515 | (defvar follow-process-filter-alist '() | ||
| 516 | "The original filters for processes intercepted by Follow mode.") | ||
| 517 | |||
| 518 | (defvar follow-active-menu nil | ||
| 519 | "The menu visible when Follow mode is active.") | ||
| 520 | |||
| 521 | (defvar follow-deactive-menu nil | ||
| 522 | "The menu visible when Follow mode is deactivated.") | ||
| 523 | |||
| 524 | (defvar follow-inside-post-command-hook nil | ||
| 525 | "Non-nil when inside Follow modes `post-command-hook'. | ||
| 526 | Used by `follow-window-size-change'.") | ||
| 527 | |||
| 528 | (defvar follow-windows-start-end-cache nil | ||
| 529 | "Cache used by `follow-window-start-end'.") | ||
| 530 | |||
| 531 | ;;}}} | ||
| 532 | ;;{{{ Debug messages | ||
| 533 | |||
| 534 | ;; This inline function must be as small as possible! | ||
| 535 | ;; Maybe we should define a macro that expands to nil if | ||
| 536 | ;; the variable is not set. | ||
| 537 | |||
| 538 | (defsubst follow-debug-message (&rest args) | ||
| 539 | "Like message, but only active when `follow-debug' is non-nil." | ||
| 540 | (if (and (boundp 'follow-debug) follow-debug) | ||
| 541 | (apply 'message args))) | ||
| 603 | 542 | ||
| 604 | ;;}}} | 543 | ;;}}} |
| 605 | ;;{{{ Cache | 544 | ;;{{{ Cache |
| 606 | 545 | ||
| 607 | (let ((cmds follow-cache-command-list)) | 546 | (dolist (cmd follow-cache-command-list) |
| 608 | (while cmds | 547 | (put cmd 'follow-mode-use-cache t)) |
| 609 | (put (car cmds) 'follow-mode-use-cache t) | ||
| 610 | (setq cmds (cdr cmds)))) | ||
| 611 | 548 | ||
| 612 | ;;}}} | 549 | ;;}}} |
| 613 | 550 | ||
| @@ -615,20 +552,20 @@ Used by `follow-window-size-change'.") | |||
| 615 | 552 | ||
| 616 | ;;;###autoload | 553 | ;;;###autoload |
| 617 | (defun turn-on-follow-mode () | 554 | (defun turn-on-follow-mode () |
| 618 | "Turn on Follow mode. Please see the function `follow-mode'." | 555 | "Turn on Follow mode. Please see the function `follow-mode'." |
| 619 | (interactive) | 556 | (interactive) |
| 620 | (follow-mode 1)) | 557 | (follow-mode 1)) |
| 621 | 558 | ||
| 622 | 559 | ||
| 623 | ;;;###autoload | 560 | ;;;###autoload |
| 624 | (defun turn-off-follow-mode () | 561 | (defun turn-off-follow-mode () |
| 625 | "Turn off Follow mode. Please see the function `follow-mode'." | 562 | "Turn off Follow mode. Please see the function `follow-mode'." |
| 626 | (interactive) | 563 | (interactive) |
| 627 | (follow-mode -1)) | 564 | (follow-mode -1)) |
| 628 | 565 | ||
| 629 | 566 | (put 'follow-mode 'permanent-local t) | |
| 630 | ;;;###autoload | 567 | ;;;###autoload |
| 631 | (defun follow-mode (arg) | 568 | (define-minor-mode follow-mode |
| 632 | "Minor mode that combines windows into one tall virtual window. | 569 | "Minor mode that combines windows into one tall virtual window. |
| 633 | 570 | ||
| 634 | The feeling of a \"virtual window\" has been accomplished by the use | 571 | The feeling of a \"virtual window\" has been accomplished by the use |
| @@ -665,39 +602,21 @@ is called. When turned off, `follow-mode-off-hook' is called. | |||
| 665 | 602 | ||
| 666 | Keys specific to Follow mode: | 603 | Keys specific to Follow mode: |
| 667 | \\{follow-mode-map}" | 604 | \\{follow-mode-map}" |
| 668 | (interactive "P") | 605 | :keymap follow-mode-map |
| 669 | (make-local-variable 'follow-mode) | 606 | (if (and follow-mode follow-intercept-processes) |
| 670 | (put 'follow-mode 'permanent-local t) | 607 | (follow-intercept-process-output)) |
| 671 | (let ((follow-mode-orig follow-mode)) | 608 | (cond (follow-mode ; On |
| 672 | (setq follow-mode | 609 | ;; XEmacs: If this is non-nil, the window will scroll before |
| 673 | (if (null arg) | 610 | ;; the point will have a chance to get into the next window. |
| 674 | (not follow-mode) | 611 | (if (boundp 'scroll-on-clipped-lines) |
| 675 | (> (prefix-numeric-value arg) 0))) | 612 | (setq scroll-on-clipped-lines nil)) |
| 676 | (if (and follow-mode follow-intercept-processes) | 613 | (force-mode-line-update) |
| 677 | (follow-intercept-process-output)) | 614 | (add-hook 'post-command-hook 'follow-post-command-hook t) |
| 678 | (cond ((and follow-mode (not follow-mode-orig)) ; On | 615 | (run-hooks 'follow-mode-hook)) |
| 679 | ;; XEmacs: If this is non-nil, the window will scroll before | 616 | |
| 680 | ;; the point will have a chance to get into the next window. | 617 | ((not follow-mode) ; Off |
| 681 | (if (boundp 'scroll-on-clipped-lines) | 618 | (force-mode-line-update) |
| 682 | (set 'scroll-on-clipped-lines nil)) | 619 | (run-hooks 'follow-mode-off-hook)))) |
| 683 | (force-mode-line-update) | ||
| 684 | (add-hook 'post-command-hook 'follow-post-command-hook t) | ||
| 685 | (run-hooks 'follow-mode-hook)) | ||
| 686 | |||
| 687 | ((and (not follow-mode) follow-mode-orig) ; Off | ||
| 688 | (force-mode-line-update) | ||
| 689 | (run-hooks 'follow-mode-off-hook))))) | ||
| 690 | |||
| 691 | |||
| 692 | ;; Register follow-mode as a minor mode. | ||
| 693 | |||
| 694 | (if (fboundp 'add-minor-mode) | ||
| 695 | ;; XEmacs | ||
| 696 | (funcall (symbol-function 'add-minor-mode) | ||
| 697 | 'follow-mode 'follow-mode-line-text) | ||
| 698 | (or (assq 'follow-mode minor-mode-alist) | ||
| 699 | (setq minor-mode-alist | ||
| 700 | (cons '(follow-mode follow-mode-line-text) minor-mode-alist)))) | ||
| 701 | 620 | ||
| 702 | ;;}}} | 621 | ;;}}} |
| 703 | ;;{{{ Find file hook | 622 | ;;{{{ Find file hook |
| @@ -1033,7 +952,7 @@ window, normally is the end plus one. | |||
| 1033 | If WIN is nil, the selected window is used. | 952 | If WIN is nil, the selected window is used. |
| 1034 | 953 | ||
| 1035 | Returns (end-pos end-of-buffer-p)" | 954 | Returns (end-pos end-of-buffer-p)" |
| 1036 | (if follow-emacs-version-xemacs-p | 955 | (if (featurep 'xemacs) |
| 1037 | ;; XEmacs can calculate the end of the window by using | 956 | ;; XEmacs can calculate the end of the window by using |
| 1038 | ;; the 'guarantee options. GOOD! | 957 | ;; the 'guarantee options. GOOD! |
| 1039 | (let ((end (window-end win t))) | 958 | (let ((end (window-end win t))) |
| @@ -1511,7 +1430,7 @@ non-first windows in Follow Mode." | |||
| 1511 | ;;}}} | 1430 | ;;}}} |
| 1512 | ;;{{{ Post Command Hook | 1431 | ;;{{{ Post Command Hook |
| 1513 | 1432 | ||
| 1514 | ;;; The magic little box. This function is called after every command. | 1433 | ;; The magic little box. This function is called after every command. |
| 1515 | 1434 | ||
| 1516 | ;; This is not as complicated as it seems. It is simply a list of common | 1435 | ;; This is not as complicated as it seems. It is simply a list of common |
| 1517 | ;; display situations and the actions to take, plus commands for redrawing | 1436 | ;; display situations and the actions to take, plus commands for redrawing |
| @@ -1735,17 +1654,17 @@ non-first windows in Follow Mode." | |||
| 1735 | 1654 | ||
| 1736 | ;;;; Scroll-bar support code. | 1655 | ;;;; Scroll-bar support code. |
| 1737 | 1656 | ||
| 1738 | ;;; Why is it needed? Well, if the selected window is in follow mode, | 1657 | ;; Why is it needed? Well, if the selected window is in follow mode, |
| 1739 | ;;; all its follower stick to it blindly. If one of them is scrolled, | 1658 | ;; all its follower stick to it blindly. If one of them is scrolled, |
| 1740 | ;;; it immediately returns to the original position when the mouse is | 1659 | ;; it immediately returns to the original position when the mouse is |
| 1741 | ;;; released. If the selected window is not a follower of the dragged | 1660 | ;; released. If the selected window is not a follower of the dragged |
| 1742 | ;;; window the windows will be unaligned. | 1661 | ;; window the windows will be unaligned. |
| 1743 | 1662 | ||
| 1744 | ;;; The advices doesn't get compiled. Aestetically, this might be a | 1663 | ;; The advices doesn't get compiled. Aestetically, this might be a |
| 1745 | ;;; problem but in practical life it isn't. | 1664 | ;; problem but in practical life it isn't. |
| 1746 | 1665 | ||
| 1747 | ;;; Discussion: Now when the other windows in the chain follow the | 1666 | ;; Discussion: Now when the other windows in the chain follow the |
| 1748 | ;;; dragged, should we really select it? | 1667 | ;; dragged, should we really select it? |
| 1749 | 1668 | ||
| 1750 | (cond ((fboundp 'scroll-bar-drag) | 1669 | (cond ((fboundp 'scroll-bar-drag) |
| 1751 | ;;; | 1670 | ;;; |
| @@ -1851,29 +1770,29 @@ WINDOW can be an object or a window." | |||
| 1851 | ;;}}} | 1770 | ;;}}} |
| 1852 | ;;{{{ Process output | 1771 | ;;{{{ Process output |
| 1853 | 1772 | ||
| 1854 | ;;; The following sections installs a spy that listens to process | 1773 | ;; The following sections installs a spy that listens to process |
| 1855 | ;;; output and tries to reposition the windows whose buffers are in | 1774 | ;; output and tries to reposition the windows whose buffers are in |
| 1856 | ;;; Follow mode. We play safe as much as possible... | 1775 | ;; Follow mode. We play safe as much as possible... |
| 1857 | ;;; | 1776 | ;; |
| 1858 | ;;; When follow-mode is activated all active processes are | 1777 | ;; When follow-mode is activated all active processes are |
| 1859 | ;;; intercepted. All new processes that change their filter function | 1778 | ;; intercepted. All new processes that change their filter function |
| 1860 | ;;; using `set-process-filter' are also intercepted. The reason is | 1779 | ;; using `set-process-filter' are also intercepted. The reason is |
| 1861 | ;;; that a process can cause a redisplay recentering "tail" windows. | 1780 | ;; that a process can cause a redisplay recentering "tail" windows. |
| 1862 | ;;; Note that it doesn't hurt to spy on more processes than needed. | 1781 | ;; Note that it doesn't hurt to spy on more processes than needed. |
| 1863 | ;;; | 1782 | ;; |
| 1864 | ;;; Technically, we set the process filter to `follow-generic-filter'. | 1783 | ;; Technically, we set the process filter to `follow-generic-filter'. |
| 1865 | ;;; The original filter is stored in `follow-process-filter-alist'. | 1784 | ;; The original filter is stored in `follow-process-filter-alist'. |
| 1866 | ;;; Our generic filter calls the original filter, or inserts the | 1785 | ;; Our generic filter calls the original filter, or inserts the |
| 1867 | ;;; output into the buffer, if the buffer originally didn't have an | 1786 | ;; output into the buffer, if the buffer originally didn't have an |
| 1868 | ;;; output filter. It also makes sure that the windows connected to | 1787 | ;; output filter. It also makes sure that the windows connected to |
| 1869 | ;;; the buffer are aligned. | 1788 | ;; the buffer are aligned. |
| 1870 | ;;; | 1789 | ;; |
| 1871 | ;;; Discussion: How do we find processes that don't call | 1790 | ;; Discussion: How do we find processes that don't call |
| 1872 | ;;; `set-process-filter'? (How often are processes created in a | 1791 | ;; `set-process-filter'? (How often are processes created in a |
| 1873 | ;;; buffer after Follow mode are activated?) | 1792 | ;; buffer after Follow mode are activated?) |
| 1874 | ;;; | 1793 | ;; |
| 1875 | ;;; Discussion: Should we also advice `process-filter' to make our | 1794 | ;; Discussion: Should we also advice `process-filter' to make our |
| 1876 | ;;; filter invisible to others? | 1795 | ;; filter invisible to others? |
| 1877 | 1796 | ||
| 1878 | ;;{{{ Advice for `set-process-filter' | 1797 | ;;{{{ Advice for `set-process-filter' |
| 1879 | 1798 | ||
| @@ -1980,7 +1899,7 @@ connected to processes. | |||
| 1980 | 1899 | ||
| 1981 | The only reason to call this function is if the Follow mode spy filter | 1900 | The only reason to call this function is if the Follow mode spy filter |
| 1982 | would interfere with some other package. If this happens, please | 1901 | would interfere with some other package. If this happens, please |
| 1983 | report this using the `follow-submit-feedback' function." | 1902 | report this using the `report-emacs-bug' function." |
| 1984 | (interactive) | 1903 | (interactive) |
| 1985 | (follow-tidy-process-filter-alist) | 1904 | (follow-tidy-process-filter-alist) |
| 1986 | (let ((list (process-list))) | 1905 | (let ((list (process-list))) |
| @@ -1999,12 +1918,12 @@ report this using the `follow-submit-feedback' function." | |||
| 1999 | ;;}}} | 1918 | ;;}}} |
| 2000 | ;;{{{ The filter | 1919 | ;;{{{ The filter |
| 2001 | 1920 | ||
| 2002 | ;;; The following section is a naive method to make buffers with | 1921 | ;; The following section is a naive method to make buffers with |
| 2003 | ;;; process output to work with Follow mode. Whenever the start of the | 1922 | ;; process output to work with Follow mode. Whenever the start of the |
| 2004 | ;;; window displaying the buffer is moved, we moves it back to its | 1923 | ;; window displaying the buffer is moved, we moves it back to its |
| 2005 | ;;; original position and try to select a new window. (If we fail, | 1924 | ;; original position and try to select a new window. (If we fail, |
| 2006 | ;;; the normal redisplay functions of Emacs will scroll it right | 1925 | ;; the normal redisplay functions of Emacs will scroll it right |
| 2007 | ;;; back!) | 1926 | ;; back!) |
| 2008 | 1927 | ||
| 2009 | (defun follow-generic-filter (proc output) | 1928 | (defun follow-generic-filter (proc output) |
| 2010 | "Process output filter for process connected to buffers in Follow mode." | 1929 | "Process output filter for process connected to buffers in Follow mode." |
| @@ -2219,7 +2138,7 @@ report this using the `follow-submit-feedback' function." | |||
| 2219 | ;; unless we are in `slow-search-mode', i.e. only a few lines | 2138 | ;; unless we are in `slow-search-mode', i.e. only a few lines |
| 2220 | ;; of text is visible. | 2139 | ;; of text is visible. |
| 2221 | 2140 | ||
| 2222 | (if follow-emacs-version-xemacs-p | 2141 | (if (featurep 'xemacs) |
| 2223 | (defadvice isearch-done (before follow-isearch-done activate) | 2142 | (defadvice isearch-done (before follow-isearch-done activate) |
| 2224 | (if (and (boundp 'follow-mode) | 2143 | (if (and (boundp 'follow-mode) |
| 2225 | follow-mode | 2144 | follow-mode |
| @@ -2235,28 +2154,28 @@ report this using the `follow-submit-feedback' function." | |||
| 2235 | ;;}}} | 2154 | ;;}}} |
| 2236 | ;;{{{ Tail window handling | 2155 | ;;{{{ Tail window handling |
| 2237 | 2156 | ||
| 2238 | ;;; In Emacs (not XEmacs) windows showing nothing are sometimes | 2157 | ;; In Emacs (not XEmacs) windows showing nothing are sometimes |
| 2239 | ;;; recentered. When in Follow Mode, this is not desireable for | 2158 | ;; recentered. When in Follow Mode, this is not desireable for |
| 2240 | ;;; non-first windows in the window chain. This section tries to | 2159 | ;; non-first windows in the window chain. This section tries to |
| 2241 | ;;; make the windows stay where they should be. | 2160 | ;; make the windows stay where they should be. |
| 2242 | ;;; | 2161 | ;; |
| 2243 | ;;; If the display is updated, all windows starting at (point-max) are | 2162 | ;; If the display is updated, all windows starting at (point-max) are |
| 2244 | ;;; going to be recentered at the next redisplay, unless we do a | 2163 | ;; going to be recentered at the next redisplay, unless we do a |
| 2245 | ;;; read-and-write cycle to update the `force' flag inside the windows. | 2164 | ;; read-and-write cycle to update the `force' flag inside the windows. |
| 2246 | ;;; | 2165 | ;; |
| 2247 | ;;; In 19.30, a new varible `window-scroll-functions' is called every | 2166 | ;; In 19.30, a new varible `window-scroll-functions' is called every |
| 2248 | ;;; time a window is recentered. It is not perfect for our situation, | 2167 | ;; time a window is recentered. It is not perfect for our situation, |
| 2249 | ;;; since when it is called for a tail window, it is to late. However, | 2168 | ;; since when it is called for a tail window, it is to late. However, |
| 2250 | ;;; if it is called for another window, we can try to update our | 2169 | ;; if it is called for another window, we can try to update our |
| 2251 | ;;; windows. | 2170 | ;; windows. |
| 2252 | ;;; | 2171 | ;; |
| 2253 | ;;; By patching `sit-for' we can make sure that to catch all explicit | 2172 | ;; By patching `sit-for' we can make sure that to catch all explicit |
| 2254 | ;;; updates initiated by lisp programs. Internal calls, on the other | 2173 | ;; updates initiated by lisp programs. Internal calls, on the other |
| 2255 | ;;; hand, are not handled. | 2174 | ;; hand, are not handled. |
| 2256 | ;;; | 2175 | ;; |
| 2257 | ;;; Please note that the function `follow-avoid-tail-recenter' is also | 2176 | ;; Please note that the function `follow-avoid-tail-recenter' is also |
| 2258 | ;;; called from other places, e.g. `post-command-hook' and | 2177 | ;; called from other places, e.g. `post-command-hook' and |
| 2259 | ;;; `post-command-idle-hook'. | 2178 | ;; `post-command-idle-hook'. |
| 2260 | 2179 | ||
| 2261 | ;; If this function is called it is too late for this window, but | 2180 | ;; If this function is called it is too late for this window, but |
| 2262 | ;; we might save other windows from being recentered. | 2181 | ;; we might save other windows from being recentered. |
| @@ -2328,9 +2247,9 @@ This prevents `mouse-drag-region' from messing things up." | |||
| 2328 | 2247 | ||
| 2329 | ;;{{{ The end | 2248 | ;;{{{ The end |
| 2330 | 2249 | ||
| 2331 | ;;; | 2250 | ;; |
| 2332 | ;;; We're done! | 2251 | ;; We're done! |
| 2333 | ;;; | 2252 | ;; |
| 2334 | 2253 | ||
| 2335 | (provide 'follow) | 2254 | (provide 'follow) |
| 2336 | 2255 | ||
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c66def4af66..cecc180f522 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,68 @@ | |||
| 1 | 2006-04-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made | ||
| 4 | unibyte after clear-decrypt function runs. | ||
| 5 | |||
| 6 | * mml2015.el (mml2015-pgg-clear-decrypt): Treat data which pgg | ||
| 7 | returns as a unibyte string. | ||
| 8 | |||
| 9 | 2006-04-27 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 10 | |||
| 11 | * mml1991.el (mml1991-pgg-sign): No need to load pgg.el, which is | ||
| 12 | always loaded by way of gnus-art.el -> mm-uu.el -> mml2015.el. | ||
| 13 | (mml1991-pgg-encrypt): Ditto. | ||
| 14 | |||
| 15 | 2006-04-26 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 16 | |||
| 17 | * deuglify.el (gnus-outlook-deuglify-unwrap-min) | ||
| 18 | (gnus-outlook-deuglify-unwrap-max): Remove autoload. | ||
| 19 | |||
| 20 | * mml-sec.el (mml-secure-method): New internal variable. | ||
| 21 | (mml-secure-sign, mml-secure-encrypt, mml-secure-message-sign) | ||
| 22 | (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): New | ||
| 23 | functions using mml-secure-method. Sync from the trunk. | ||
| 24 | |||
| 25 | * mml.el (mml-mode-map): Add key bindings for those functions. | ||
| 26 | (mml-menu): Simplify security menu entries. Suggested by Jesper | ||
| 27 | Harder <harder@myrealbox.com>. Sync from the trunk. | ||
| 28 | |||
| 29 | * message.el (message-valid-fqdn-regexp): Add TLDs .cat, jobs, | ||
| 30 | .mobi and .travel. Remove .nato, .bitnet and .uucp. | ||
| 31 | (message-in-body-p): New function. Sync from the trunk. | ||
| 32 | |||
| 33 | * mml.el (mml-mode, mml-dnd-protocol-alist) | ||
| 34 | (mml-dnd-attach-options, mml-dnd-attach-file) | ||
| 35 | (mml-attach-file, mml-attach-buffer, mml-attach-external): Sync | ||
| 36 | DND support and use of message-in-body-p from the trunk. | ||
| 37 | |||
| 38 | 2006-04-26 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 39 | |||
| 40 | * mml1991.el (mml1991-pgg-sign): Make sure to load pgg.el before | ||
| 41 | binding pgg-* variables; reimplement the section which prevents | ||
| 42 | MIME header from being signed. | ||
| 43 | (mml1991-pgg-encrypt): Make sure to load pgg.el before binding | ||
| 44 | pgg-text-mode; remove a blank line at the top of body. | ||
| 45 | |||
| 46 | * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Don't remove blank | ||
| 47 | lines at the top of body; use gnus-newsgroup-charset if there's no | ||
| 48 | Charset header. | ||
| 49 | |||
| 50 | 2006-04-25 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 51 | |||
| 52 | * nnweb.el (nnweb-google-wash-article): Sync up to new Google | ||
| 53 | HTML. | ||
| 54 | |||
| 55 | 2006-04-25 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 56 | |||
| 57 | * mm-uu.el (mm-uu-pgp-signed-test): Erase prompt. | ||
| 58 | (mm-uu-pgp-encrypted-test): Ditto. | ||
| 59 | (mm-uu-pgp-encrypted-extract-1): Make sure there's a blank line | ||
| 60 | between header and body; return application/pgp-encrypted handle | ||
| 61 | if decryption failed; decode decrypted body by charset. | ||
| 62 | |||
| 63 | * mm-decode.el (mm-automatic-display): Don't make application/pgp | ||
| 64 | element match to application/pgp-*. | ||
| 65 | |||
| 1 | 2006-04-20 Reiner Steib <Reiner.Steib@gmx.de> | 66 | 2006-04-20 Reiner Steib <Reiner.Steib@gmx.de> |
| 2 | 67 | ||
| 3 | * gnus-util.el (gnus-replace-in-string): Prefer | 68 | * gnus-util.el (gnus-replace-in-string): Prefer |
| @@ -419,13 +484,6 @@ | |||
| 419 | 484 | ||
| 420 | 2006-02-09 Daiki Ueno <ueno@unixuser.org> | 485 | 2006-02-09 Daiki Ueno <ueno@unixuser.org> |
| 421 | 486 | ||
| 422 | * pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings | ||
| 423 | in elisp. | ||
| 424 | (pgg-gpg-encrypt-symmetric-region): Ditto. | ||
| 425 | (pgg-gpg-sign-region): Ditto. | ||
| 426 | |||
| 427 | * pgg-def.el (pgg-text-mode): New variable. | ||
| 428 | |||
| 429 | * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode. | 487 | * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode. |
| 430 | (mml2015-pgg-encrypt): Ditto. | 488 | (mml2015-pgg-encrypt): Ditto. |
| 431 | 489 | ||
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el index 4096324fdaa..404aebbd921 100644 --- a/lisp/gnus/deuglify.el +++ b/lisp/gnus/deuglify.el | |||
| @@ -234,14 +234,12 @@ | |||
| 234 | :version "22.1" | 234 | :version "22.1" |
| 235 | :group 'gnus) | 235 | :group 'gnus) |
| 236 | 236 | ||
| 237 | ;;;###autoload | ||
| 238 | (defcustom gnus-outlook-deuglify-unwrap-min 45 | 237 | (defcustom gnus-outlook-deuglify-unwrap-min 45 |
| 239 | "Minimum length of the cited line above the (possibly) wrapped line." | 238 | "Minimum length of the cited line above the (possibly) wrapped line." |
| 240 | :version "22.1" | 239 | :version "22.1" |
| 241 | :type 'integer | 240 | :type 'integer |
| 242 | :group 'gnus-outlook-deuglify) | 241 | :group 'gnus-outlook-deuglify) |
| 243 | 242 | ||
| 244 | ;;;###autoload | ||
| 245 | (defcustom gnus-outlook-deuglify-unwrap-max 95 | 243 | (defcustom gnus-outlook-deuglify-unwrap-max 95 |
| 246 | "Maximum length of the cited line after unwrapping." | 244 | "Maximum length of the cited line after unwrapping." |
| 247 | :version "22.1" | 245 | :version "22.1" |
| @@ -288,7 +286,6 @@ | |||
| 288 | :type 'string | 286 | :type 'string |
| 289 | :group 'gnus-outlook-deuglify) | 287 | :group 'gnus-outlook-deuglify) |
| 290 | 288 | ||
| 291 | ;;;###autoload | ||
| 292 | (defcustom gnus-outlook-display-hook nil | 289 | (defcustom gnus-outlook-display-hook nil |
| 293 | "A hook called after an deuglified article has been prepared. | 290 | "A hook called after an deuglified article has been prepared. |
| 294 | It is run after `gnus-article-prepare-hook'." | 291 | It is run after `gnus-article-prepare-hook'." |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 472eb2468dd..8bc0f704b5c 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -1586,11 +1586,16 @@ functionality to work." | |||
| 1586 | (defcustom message-valid-fqdn-regexp | 1586 | (defcustom message-valid-fqdn-regexp |
| 1587 | (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain. | 1587 | (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain. |
| 1588 | ;; valid TLDs: | 1588 | ;; valid TLDs: |
| 1589 | "\\([a-z][a-z]" ;; two letter country TDLs | 1589 | "\\([a-z][a-z]\\|" ;; two letter country TDLs |
| 1590 | "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org" | 1590 | "aero\\|arpa\\|bitnet\\|biz\\|bofh\\|" |
| 1591 | "\\|aero\\|coop\\|info\\|name\\|museum" | 1591 | "cat\\|com\\|coop\\|edu\\|gov\\|" |
| 1592 | "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style? | 1592 | "info\\|int\\|jobs\\|" |
| 1593 | "\\)") | 1593 | "mil\\|mobi\\|museum\\|name\\|net\\|" |
| 1594 | "org\\|pro\\|travel\\|uucp\\)") | ||
| 1595 | ;; http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains | ||
| 1596 | ;; http://en.wikipedia.org/wiki/GTLD | ||
| 1597 | ;; `in the process of being approved': .asia .post .tel .sex | ||
| 1598 | ;; "dead" nato bitnet uucp | ||
| 1594 | "Regular expression that matches a valid FQDN." | 1599 | "Regular expression that matches a valid FQDN." |
| 1595 | ;; see also: gnus-button-valid-fqdn-regexp | 1600 | ;; see also: gnus-button-valid-fqdn-regexp |
| 1596 | :version "22.1" | 1601 | :version "22.1" |
| @@ -2679,6 +2684,11 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." | |||
| 2679 | (or (search-forward (concat "\n" mail-header-separator "\n") nil t) | 2684 | (or (search-forward (concat "\n" mail-header-separator "\n") nil t) |
| 2680 | (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))) | 2685 | (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))) |
| 2681 | 2686 | ||
| 2687 | (defun message-in-body-p () | ||
| 2688 | "Return t if point is in the message body." | ||
| 2689 | (let ((body (save-excursion (message-goto-body) (point)))) | ||
| 2690 | (>= (point) body))) | ||
| 2691 | |||
| 2682 | (defun message-goto-eoh () | 2692 | (defun message-goto-eoh () |
| 2683 | "Move point to the end of the headers." | 2693 | "Move point to the end of the headers." |
| 2684 | (interactive) | 2694 | (interactive) |
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 5ee47a8ce26..b79e081f0e1 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -307,7 +307,7 @@ when selecting a different article." | |||
| 307 | "application/pkcs7-signature" "application/x-pkcs7-mime" | 307 | "application/pkcs7-signature" "application/x-pkcs7-mime" |
| 308 | "application/pkcs7-mime" | 308 | "application/pkcs7-mime" |
| 309 | ;; Mutt still uses this even though it has already been withdrawn. | 309 | ;; Mutt still uses this even though it has already been withdrawn. |
| 310 | "application/pgp") | 310 | "application/pgp\\'") |
| 311 | "A list of MIME types to be displayed automatically." | 311 | "A list of MIME types to be displayed automatically." |
| 312 | :type '(repeat regexp) | 312 | :type '(repeat regexp) |
| 313 | :group 'mime-display) | 313 | :group 'mime-display) |
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index 9029e0d699c..9d9d87a3670 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el | |||
| @@ -352,7 +352,9 @@ Return that buffer." | |||
| 352 | ((eq mm-verify-option 'never) nil) | 352 | ((eq mm-verify-option 'never) nil) |
| 353 | ((eq mm-verify-option 'always) t) | 353 | ((eq mm-verify-option 'always) t) |
| 354 | ((eq mm-verify-option 'known) t) | 354 | ((eq mm-verify-option 'known) t) |
| 355 | (t (y-or-n-p "Verify pgp signed part? "))))) | 355 | (t (prog1 |
| 356 | (y-or-n-p "Verify pgp signed part? ") | ||
| 357 | (message "")))))) | ||
| 356 | 358 | ||
| 357 | (eval-when-compile | 359 | (eval-when-compile |
| 358 | (defvar gnus-newsgroup-charset)) | 360 | (defvar gnus-newsgroup-charset)) |
| @@ -403,15 +405,51 @@ Return that buffer." | |||
| 403 | ((eq mm-decrypt-option 'never) nil) | 405 | ((eq mm-decrypt-option 'never) nil) |
| 404 | ((eq mm-decrypt-option 'always) t) | 406 | ((eq mm-decrypt-option 'always) t) |
| 405 | ((eq mm-decrypt-option 'known) t) | 407 | ((eq mm-decrypt-option 'known) t) |
| 406 | (t (y-or-n-p "Decrypt pgp encrypted part? "))))) | 408 | (t (prog1 |
| 409 | (y-or-n-p "Decrypt pgp encrypted part? ") | ||
| 410 | (message "")))))) | ||
| 407 | 411 | ||
| 408 | (defun mm-uu-pgp-encrypted-extract-1 (handles ctl) | 412 | (defun mm-uu-pgp-encrypted-extract-1 (handles ctl) |
| 409 | (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max)))) | 413 | (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max))) |
| 410 | (if (mm-uu-pgp-encrypted-test) | 414 | (first t) |
| 411 | (with-current-buffer buf | 415 | charset) |
| 412 | (mml2015-clean-buffer) | 416 | ;; Make sure there's a blank line between header and body. |
| 413 | (funcall (mml2015-clear-decrypt-function)))) | 417 | (with-current-buffer buf |
| 414 | (list (mm-make-handle buf mm-uu-text-plain-type)))) | 418 | (goto-char (point-min)) |
| 419 | (while (prog2 | ||
| 420 | (forward-line 1) | ||
| 421 | (if first | ||
| 422 | (looking-at "[^\t\n ]+:") | ||
| 423 | (looking-at "[^\t\n ]+:\\|[\t ]")) | ||
| 424 | (setq first nil))) | ||
| 425 | (unless (memq (char-after) '(?\n nil)) | ||
| 426 | (insert "\n")) | ||
| 427 | (save-restriction | ||
| 428 | (narrow-to-region (point-min) (point)) | ||
| 429 | (setq charset (mail-fetch-field "charset"))) | ||
| 430 | (if (and (mm-uu-pgp-encrypted-test) | ||
| 431 | (progn | ||
| 432 | (mml2015-clean-buffer) | ||
| 433 | (funcall (mml2015-clear-decrypt-function)) | ||
| 434 | (equal (mm-handle-multipart-ctl-parameter mm-security-handle | ||
| 435 | 'gnus-info) | ||
| 436 | "OK"))) | ||
| 437 | (progn | ||
| 438 | ;; Decode charset. | ||
| 439 | (if (and (or charset | ||
| 440 | (setq charset gnus-newsgroup-charset)) | ||
| 441 | (setq charset (mm-charset-to-coding-system charset)) | ||
| 442 | (not (eq charset 'ascii))) | ||
| 443 | ;; Assume that buffer's multibyteness is turned off. | ||
| 444 | ;; See `mml2015-pgg-clear-decrypt'. | ||
| 445 | (insert (mm-decode-coding-string (prog1 | ||
| 446 | (buffer-string) | ||
| 447 | (erase-buffer) | ||
| 448 | (mm-enable-multibyte)) | ||
| 449 | charset)) | ||
| 450 | (mm-enable-multibyte)) | ||
| 451 | (list (mm-make-handle buf mm-uu-text-plain-type))) | ||
| 452 | (list (mm-make-handle buf '("application/pgp-encrypted"))))))) | ||
| 415 | 453 | ||
| 416 | (defun mm-uu-pgp-encrypted-extract () | 454 | (defun mm-uu-pgp-encrypted-extract () |
| 417 | (let ((mm-security-handle (list (format "multipart/encrypted")))) | 455 | (let ((mm-security-handle (list (format "multipart/encrypted")))) |
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 2af068897f0..df301dc74b7 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el | |||
| @@ -188,6 +188,29 @@ You can also customize or set `mml-signencrypt-style-alist' instead." | |||
| 188 | (cons method tags)))) | 188 | (cons method tags)))) |
| 189 | (t (error "The message is corrupted. No mail header separator")))))) | 189 | (t (error "The message is corrupted. No mail header separator")))))) |
| 190 | 190 | ||
| 191 | (defvar mml-secure-method | ||
| 192 | (if (equal mml-default-encrypt-method mml-default-sign-method) | ||
| 193 | mml-default-sign-method | ||
| 194 | "pgpmime") | ||
| 195 | "Current security method. Internal variable.") | ||
| 196 | |||
| 197 | (defun mml-secure-sign (&optional method) | ||
| 198 | "Add MML tags to sign this MML part. | ||
| 199 | Use METHOD if given. Else use `mml-secure-method' or | ||
| 200 | `mml-default-sign-method'." | ||
| 201 | (interactive) | ||
| 202 | (mml-secure-part | ||
| 203 | (or method mml-secure-method mml-default-sign-method) | ||
| 204 | 'sign)) | ||
| 205 | |||
| 206 | (defun mml-secure-encrypt (&optional method) | ||
| 207 | "Add MML tags to encrypt this MML part. | ||
| 208 | Use METHOD if given. Else use `mml-secure-method' or | ||
| 209 | `mml-default-sign-method'." | ||
| 210 | (interactive) | ||
| 211 | (mml-secure-part | ||
| 212 | (or method mml-secure-method mml-default-sign-method))) | ||
| 213 | |||
| 191 | (defun mml-secure-sign-pgp () | 214 | (defun mml-secure-sign-pgp () |
| 192 | "Add MML tags to PGP sign this MML part." | 215 | "Add MML tags to PGP sign this MML part." |
| 193 | (interactive) | 216 | (interactive) |
| @@ -249,6 +272,34 @@ You can also customize or set `mml-signencrypt-style-alist' instead." | |||
| 249 | (when (re-search-backward "^<#secure.*>\n" nil t) | 272 | (when (re-search-backward "^<#secure.*>\n" nil t) |
| 250 | (delete-region (match-beginning 0) (match-end 0))))) | 273 | (delete-region (match-beginning 0) (match-end 0))))) |
| 251 | 274 | ||
| 275 | |||
| 276 | (defun mml-secure-message-sign (&optional method) | ||
| 277 | "Add MML tags to sign this MML part. | ||
| 278 | Use METHOD if given. Else use `mml-secure-method' or | ||
| 279 | `mml-default-sign-method'." | ||
| 280 | (interactive) | ||
| 281 | (mml-secure-part | ||
| 282 | (or method mml-secure-method mml-default-sign-method) | ||
| 283 | 'sign)) | ||
| 284 | |||
| 285 | (defun mml-secure-message-sign-encrypt (&optional method) | ||
| 286 | "Add MML tag to sign and encrypt the entire message. | ||
| 287 | Use METHOD if given. Else use `mml-secure-method' or | ||
| 288 | `mml-default-sign-method'." | ||
| 289 | (interactive) | ||
| 290 | (mml-secure-message | ||
| 291 | (or method mml-secure-method mml-default-sign-method) | ||
| 292 | 'signencrypt)) | ||
| 293 | |||
| 294 | (defun mml-secure-message-encrypt (&optional method) | ||
| 295 | "Add MML tag to encrypt the entire message. | ||
| 296 | Use METHOD if given. Else use `mml-secure-method' or | ||
| 297 | `mml-default-sign-method'." | ||
| 298 | (interactive) | ||
| 299 | (mml-secure-message | ||
| 300 | (or method mml-secure-method mml-default-sign-method) | ||
| 301 | 'encrypt)) | ||
| 302 | |||
| 252 | (defun mml-secure-message-sign-smime () | 303 | (defun mml-secure-message-sign-smime () |
| 253 | "Add MML tag to encrypt/sign the entire message." | 304 | "Add MML tag to encrypt/sign the entire message." |
| 254 | (interactive) | 305 | (interactive) |
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 6ae004a2a3b..466c0b832de 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el | |||
| @@ -40,7 +40,8 @@ | |||
| 40 | (autoload 'message-fetch-field "message") | 40 | (autoload 'message-fetch-field "message") |
| 41 | (autoload 'message-info "message") | 41 | (autoload 'message-info "message") |
| 42 | (autoload 'fill-flowed-encode "flow-fill") | 42 | (autoload 'fill-flowed-encode "flow-fill") |
| 43 | (autoload 'message-posting-charset "message")) | 43 | (autoload 'message-posting-charset "message") |
| 44 | (autoload 'dnd-get-local-file-name "dnd")) | ||
| 44 | 45 | ||
| 45 | (defvar gnus-article-mime-handles) | 46 | (defvar gnus-article-mime-handles) |
| 46 | (defvar gnus-mouse-2) | 47 | (defvar gnus-mouse-2) |
| @@ -51,6 +52,7 @@ | |||
| 51 | (defvar message-posting-charset) | 52 | (defvar message-posting-charset) |
| 52 | (defvar message-required-mail-headers) | 53 | (defvar message-required-mail-headers) |
| 53 | (defvar message-required-news-headers) | 54 | (defvar message-required-news-headers) |
| 55 | (defvar dnd-protocol-alist) | ||
| 54 | 56 | ||
| 55 | (defcustom mml-content-type-parameters | 57 | (defcustom mml-content-type-parameters |
| 56 | '(name access-type expiration size permission format) | 58 | '(name access-type expiration size permission format) |
| @@ -877,6 +879,11 @@ If HANDLES is non-nil, use it instead reparsing the buffer." | |||
| 877 | (encryptpart (make-sparse-keymap)) | 879 | (encryptpart (make-sparse-keymap)) |
| 878 | (map (make-sparse-keymap)) | 880 | (map (make-sparse-keymap)) |
| 879 | (main (make-sparse-keymap))) | 881 | (main (make-sparse-keymap))) |
| 882 | (define-key map "\C-s" 'mml-secure-message-sign) | ||
| 883 | (define-key map "\C-c" 'mml-secure-message-encrypt) | ||
| 884 | (define-key map "\C-e" 'mml-secure-message-sign-encrypt) | ||
| 885 | (define-key map "\C-p\C-s" 'mml-secure-sign) | ||
| 886 | (define-key map "\C-p\C-c" 'mml-secure-encrypt) | ||
| 880 | (define-key sign "p" 'mml-secure-message-sign-pgpmime) | 887 | (define-key sign "p" 'mml-secure-message-sign-pgpmime) |
| 881 | (define-key sign "o" 'mml-secure-message-sign-pgp) | 888 | (define-key sign "o" 'mml-secure-message-sign-pgp) |
| 882 | (define-key sign "s" 'mml-secure-message-sign-smime) | 889 | (define-key sign "s" 'mml-secure-message-sign-smime) |
| @@ -914,26 +921,54 @@ If HANDLES is non-nil, use it instead reparsing the buffer." | |||
| 914 | ["Attach File..." mml-attach-file | 921 | ["Attach File..." mml-attach-file |
| 915 | ,@(if (featurep 'xemacs) '(t) | 922 | ,@(if (featurep 'xemacs) '(t) |
| 916 | '(:help "Attach a file at point"))] | 923 | '(:help "Attach a file at point"))] |
| 917 | ["Attach Buffer..." mml-attach-buffer t] | 924 | ["Attach Buffer..." mml-attach-buffer |
| 918 | ["Attach External..." mml-attach-external t] | 925 | ,@(if (featurep 'xemacs) '(t) |
| 919 | ["Insert Part..." mml-insert-part t] | 926 | '(:help "Attach a buffer to the outgoing MIME message"))] |
| 920 | ["Insert Multipart..." mml-insert-multipart t] | 927 | ["Attach External..." mml-attach-external |
| 921 | ["PGP/MIME Sign" mml-secure-message-sign-pgpmime t] | 928 | ,@(if (featurep 'xemacs) '(t) |
| 922 | ["PGP/MIME Encrypt" mml-secure-message-encrypt-pgpmime t] | 929 | '(:help "Attach reference to file"))] |
| 923 | ["PGP Sign" mml-secure-message-sign-pgp t] | 930 | ;; |
| 924 | ["PGP Encrypt" mml-secure-message-encrypt-pgp t] | 931 | ("Change Security Method" |
| 925 | ["S/MIME Sign" mml-secure-message-sign-smime t] | 932 | ["PGP/MIME" |
| 926 | ["S/MIME Encrypt" mml-secure-message-encrypt-smime t] | 933 | (lambda () (interactive) (setq mml-secure-method "pgpmime")) |
| 927 | ("Secure MIME part" | 934 | ,@(if (featurep 'xemacs) nil |
| 928 | ["PGP/MIME Sign Part" mml-secure-sign-pgpmime t] | 935 | '(:help "Set Security Method to PGP/MIME")) |
| 929 | ["PGP/MIME Encrypt Part" mml-secure-encrypt-pgpmime t] | 936 | :style radio |
| 930 | ["PGP Sign Part" mml-secure-sign-pgp t] | 937 | :selected (equal mml-secure-method "pgpmime") ] |
| 931 | ["PGP Encrypt Part" mml-secure-encrypt-pgp t] | 938 | ["S/MIME" |
| 932 | ["S/MIME Sign Part" mml-secure-sign-smime t] | 939 | (lambda () (interactive) (setq mml-secure-method "smime")) |
| 933 | ["S/MIME Encrypt Part" mml-secure-encrypt-smime t]) | 940 | ,@(if (featurep 'xemacs) nil |
| 934 | ["Encrypt/Sign off" mml-unsecure-message t] | 941 | '(:help "Set Security Method to S/MIME")) |
| 942 | :style radio | ||
| 943 | :selected (equal mml-secure-method "smime") ] | ||
| 944 | ["Inline PGP" | ||
| 945 | (lambda () (interactive) (setq mml-secure-method "pgp")) | ||
| 946 | ,@(if (featurep 'xemacs) nil | ||
| 947 | '(:help "Set Security Method to inline PGP")) | ||
| 948 | :style radio | ||
| 949 | :selected (equal mml-secure-method "pgp") ] ) | ||
| 950 | ;; | ||
| 951 | ["Sign Message" mml-secure-message-sign t] | ||
| 952 | ["Encrypt Message" mml-secure-message-encrypt t] | ||
| 953 | ["Sign and Encrypt Message" mml-secure-message-sign-encrypt t] | ||
| 954 | ["Encrypt/Sign off" mml-unsecure-message | ||
| 955 | ,@(if (featurep 'xemacs) '(t) | ||
| 956 | '(:help "Don't Encrypt/Sign Message"))] | ||
| 957 | ;; Maybe we could remove these, because people who write MML most probably | ||
| 958 | ;; don't use the menu: | ||
| 959 | ["Insert Part..." mml-insert-part | ||
| 960 | :active (message-in-body-p)] | ||
| 961 | ["Insert Multipart..." mml-insert-multipart | ||
| 962 | :active (message-in-body-p)] | ||
| 963 | ;; | ||
| 964 | ;; Do we have separate encrypt and encrypt/sign commands for parts? | ||
| 965 | ["Sign Part" mml-secure-sign t] | ||
| 966 | ["Encrypt Part" mml-secure-encrypt t] | ||
| 935 | ;;["Narrow" mml-narrow-to-part t] | 967 | ;;["Narrow" mml-narrow-to-part t] |
| 936 | ["Quote MML" mml-quote-region t] | 968 | ["Quote MML in region" mml-quote-region |
| 969 | :active (message-mark-active-p) | ||
| 970 | ,@(if (featurep 'xemacs) nil | ||
| 971 | '(:help "Quote MML tags in region"))] | ||
| 937 | ["Validate MML" mml-validate t] | 972 | ["Validate MML" mml-validate t] |
| 938 | ["Preview" mml-preview t] | 973 | ["Preview" mml-preview t] |
| 939 | "----" | 974 | "----" |
| @@ -957,8 +992,11 @@ See Info node `(emacs-mime)Composing'. | |||
| 957 | (when (set (make-local-variable 'mml-mode) | 992 | (when (set (make-local-variable 'mml-mode) |
| 958 | (if (null arg) (not mml-mode) | 993 | (if (null arg) (not mml-mode) |
| 959 | (> (prefix-numeric-value arg) 0))) | 994 | (> (prefix-numeric-value arg) 0))) |
| 960 | (gnus-add-minor-mode 'mml-mode " MML" mml-mode-map) | 995 | (add-minor-mode 'mml-mode " MML" mml-mode-map) |
| 961 | (easy-menu-add mml-menu mml-mode-map) | 996 | (easy-menu-add mml-menu mml-mode-map) |
| 997 | (when (boundp 'dnd-protocol-alist) | ||
| 998 | (set (make-local-variable 'dnd-protocol-alist) | ||
| 999 | (append mml-dnd-protocol-alist dnd-protocol-alist))) | ||
| 962 | (run-hooks 'mml-mode-hook))) | 1000 | (run-hooks 'mml-mode-hook))) |
| 963 | 1001 | ||
| 964 | ;;; | 1002 | ;;; |
| @@ -1056,6 +1094,36 @@ See Info node `(emacs-mime)Composing'. | |||
| 1056 | 1094 | ||
| 1057 | ;;; Attachment functions. | 1095 | ;;; Attachment functions. |
| 1058 | 1096 | ||
| 1097 | (defcustom mml-dnd-protocol-alist | ||
| 1098 | '(("^file:///" . mml-dnd-attach-file) | ||
| 1099 | ("^file://" . dnd-open-file) | ||
| 1100 | ("^file:" . mml-dnd-attach-file)) | ||
| 1101 | "The functions to call when a drop in `mml-mode' is made. | ||
| 1102 | See `dnd-protocol-alist' for more information. When nil, behave | ||
| 1103 | as in other buffers." | ||
| 1104 | :type '(choice (repeat (cons (regexp) (function))) | ||
| 1105 | (const :tag "Behave as in other buffers" nil)) | ||
| 1106 | :version "22.1" ;; Gnus 5.10.9 | ||
| 1107 | :group 'message) | ||
| 1108 | |||
| 1109 | (defcustom mml-dnd-attach-options nil | ||
| 1110 | "Which options should be queried when attaching a file via drag and drop. | ||
| 1111 | |||
| 1112 | If it is a list, valid members are `type', `description' and | ||
| 1113 | `disposition'. `disposition' implies `type'. If it is nil, | ||
| 1114 | don't ask for options. If it is t, ask the user whether or not | ||
| 1115 | to specify options." | ||
| 1116 | :type '(choice | ||
| 1117 | (const :tag "Non" nil) | ||
| 1118 | (const :tag "Query" t) | ||
| 1119 | (list :value (type description disposition) | ||
| 1120 | (set :inline t | ||
| 1121 | (const type) | ||
| 1122 | (const description) | ||
| 1123 | (const disposition)))) | ||
| 1124 | :version "22.1" ;; Gnus 5.10.9 | ||
| 1125 | :group 'message) | ||
| 1126 | |||
| 1059 | (defun mml-attach-file (file &optional type description disposition) | 1127 | (defun mml-attach-file (file &optional type description disposition) |
| 1060 | "Attach a file to the outgoing MIME message. | 1128 | "Attach a file to the outgoing MIME message. |
| 1061 | The file is not inserted or encoded until you send the message with | 1129 | The file is not inserted or encoded until you send the message with |
| @@ -1073,11 +1141,37 @@ body) or \"attachment\" (separate from the body)." | |||
| 1073 | (description (mml-minibuffer-read-description)) | 1141 | (description (mml-minibuffer-read-description)) |
| 1074 | (disposition (mml-minibuffer-read-disposition type))) | 1142 | (disposition (mml-minibuffer-read-disposition type))) |
| 1075 | (list file type description disposition))) | 1143 | (list file type description disposition))) |
| 1076 | (mml-insert-empty-tag 'part | 1144 | (save-excursion |
| 1077 | 'type type | 1145 | (unless (message-in-body-p) (goto-char (point-max))) |
| 1078 | 'filename file | 1146 | (mml-insert-empty-tag 'part |
| 1079 | 'disposition (or disposition "attachment") | 1147 | 'type type |
| 1080 | 'description description)) | 1148 | 'filename file |
| 1149 | 'disposition (or disposition "attachment") | ||
| 1150 | 'description description))) | ||
| 1151 | |||
| 1152 | (defun mml-dnd-attach-file (uri action) | ||
| 1153 | "Attach a drag and drop file. | ||
| 1154 | |||
| 1155 | Ask for type, description or disposition according to | ||
| 1156 | `mml-dnd-attach-options'." | ||
| 1157 | (let ((file (dnd-get-local-file-name uri t))) | ||
| 1158 | (when (and file (file-regular-p file)) | ||
| 1159 | (let ((mml-dnd-attach-options mml-dnd-attach-options) | ||
| 1160 | type description disposition) | ||
| 1161 | (setq mml-dnd-attach-options | ||
| 1162 | (when (and (eq mml-dnd-attach-options t) | ||
| 1163 | (not | ||
| 1164 | (y-or-n-p | ||
| 1165 | "Use default type, disposition and description? "))) | ||
| 1166 | '(type description disposition))) | ||
| 1167 | (when (or (memq 'type mml-dnd-attach-options) | ||
| 1168 | (memq 'disposition mml-dnd-attach-options)) | ||
| 1169 | (setq type (mml-minibuffer-read-type file))) | ||
| 1170 | (when (memq 'description mml-dnd-attach-options) | ||
| 1171 | (setq description (mml-minibuffer-read-description))) | ||
| 1172 | (when (memq 'disposition mml-dnd-attach-options) | ||
| 1173 | (setq disposition (mml-minibuffer-read-disposition type))) | ||
| 1174 | (mml-attach-file file type description disposition))))) | ||
| 1081 | 1175 | ||
| 1082 | (defun mml-attach-buffer (buffer &optional type description) | 1176 | (defun mml-attach-buffer (buffer &optional type description) |
| 1083 | "Attach a buffer to the outgoing MIME message. | 1177 | "Attach a buffer to the outgoing MIME message. |
| @@ -1087,8 +1181,11 @@ See `mml-attach-file' for details of operation." | |||
| 1087 | (type (mml-minibuffer-read-type buffer "text/plain")) | 1181 | (type (mml-minibuffer-read-type buffer "text/plain")) |
| 1088 | (description (mml-minibuffer-read-description))) | 1182 | (description (mml-minibuffer-read-description))) |
| 1089 | (list buffer type description))) | 1183 | (list buffer type description))) |
| 1090 | (mml-insert-empty-tag 'part 'type type 'buffer buffer | 1184 | (save-excursion |
| 1091 | 'disposition "attachment" 'description description)) | 1185 | (unless (message-in-body-p) (goto-char (point-max))) |
| 1186 | (mml-insert-empty-tag 'part 'type type 'buffer buffer | ||
| 1187 | 'disposition "attachment" | ||
| 1188 | 'description description))) | ||
| 1092 | 1189 | ||
| 1093 | (defun mml-attach-external (file &optional type description) | 1190 | (defun mml-attach-external (file &optional type description) |
| 1094 | "Attach an external file into the buffer. | 1191 | "Attach an external file into the buffer. |
| @@ -1099,8 +1196,10 @@ TYPE is the MIME type to use." | |||
| 1099 | (type (mml-minibuffer-read-type file)) | 1196 | (type (mml-minibuffer-read-type file)) |
| 1100 | (description (mml-minibuffer-read-description))) | 1197 | (description (mml-minibuffer-read-description))) |
| 1101 | (list file type description))) | 1198 | (list file type description))) |
| 1102 | (mml-insert-empty-tag 'external 'type type 'name file | 1199 | (save-excursion |
| 1103 | 'disposition "attachment" 'description description)) | 1200 | (unless (message-in-body-p) (goto-char (point-max))) |
| 1201 | (mml-insert-empty-tag 'external 'type type 'name file | ||
| 1202 | 'disposition "attachment" 'description description))) | ||
| 1104 | 1203 | ||
| 1105 | (defun mml-insert-multipart (&optional type) | 1204 | (defun mml-insert-multipart (&optional type) |
| 1106 | (interactive (list (completing-read "Multipart type (default mixed): " | 1205 | (interactive (list (completing-read "Multipart type (default mixed): " |
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el index 0c6bb675388..4db3540aec1 100644 --- a/lisp/gnus/mml1991.el +++ b/lisp/gnus/mml1991.el | |||
| @@ -230,22 +230,22 @@ | |||
| 230 | 230 | ||
| 231 | (defun mml1991-pgg-sign (cont) | 231 | (defun mml1991-pgg-sign (cont) |
| 232 | (let ((pgg-text-mode t) | 232 | (let ((pgg-text-mode t) |
| 233 | (pgg-default-user-id (or (message-options-get 'mml-sender) | ||
| 234 | pgg-default-user-id)) | ||
| 233 | headers cte) | 235 | headers cte) |
| 234 | ;; Don't sign headers. | 236 | ;; Don't sign headers. |
| 235 | (goto-char (point-min)) | 237 | (goto-char (point-min)) |
| 236 | (while (not (looking-at "^$")) | 238 | (when (re-search-forward "^$" nil t) |
| 237 | (forward-line)) | ||
| 238 | (unless (eobp) ;; no headers? | ||
| 239 | (setq headers (buffer-substring (point-min) (point))) | 239 | (setq headers (buffer-substring (point-min) (point))) |
| 240 | (forward-line) ;; skip header/body separator | 240 | (save-restriction |
| 241 | (delete-region (point-min) (point))) | 241 | (narrow-to-region (point-min) (point)) |
| 242 | (when (string-match "^Content-Transfer-Encoding: \\(.+\\)" headers) | 242 | (setq cte (mail-fetch-field "content-transfer-encoding"))) |
| 243 | (setq cte (intern (match-string 1 headers)))) | 243 | (forward-line 1) |
| 244 | (mm-decode-content-transfer-encoding cte) | 244 | (delete-region (point-min) (point)) |
| 245 | (unless (let ((pgg-default-user-id | 245 | (when cte |
| 246 | (or (message-options-get 'mml-sender) | 246 | (setq cte (intern (downcase cte))) |
| 247 | pgg-default-user-id))) | 247 | (mm-decode-content-transfer-encoding cte))) |
| 248 | (pgg-sign-region (point-min) (point-max) t)) | 248 | (unless (pgg-sign-region (point-min) (point-max) t) |
| 249 | (pop-to-buffer pgg-errors-buffer) | 249 | (pop-to-buffer pgg-errors-buffer) |
| 250 | (error "Encrypt error")) | 250 | (error "Encrypt error")) |
| 251 | (delete-region (point-min) (point-max)) | 251 | (delete-region (point-min) (point-max)) |
| @@ -254,7 +254,8 @@ | |||
| 254 | (goto-char (point-min)) | 254 | (goto-char (point-min)) |
| 255 | (while (re-search-forward "\r+$" nil t) | 255 | (while (re-search-forward "\r+$" nil t) |
| 256 | (replace-match "" t t)) | 256 | (replace-match "" t t)) |
| 257 | (mm-encode-content-transfer-encoding cte) | 257 | (when cte |
| 258 | (mm-encode-content-transfer-encoding cte)) | ||
| 258 | (goto-char (point-min)) | 259 | (goto-char (point-min)) |
| 259 | (when headers | 260 | (when headers |
| 260 | (insert headers)) | 261 | (insert headers)) |
| @@ -262,18 +263,18 @@ | |||
| 262 | t)) | 263 | t)) |
| 263 | 264 | ||
| 264 | (defun mml1991-pgg-encrypt (cont &optional sign) | 265 | (defun mml1991-pgg-encrypt (cont &optional sign) |
| 265 | (let ((pgg-text-mode t) | 266 | (goto-char (point-min)) |
| 266 | cte) | 267 | (when (re-search-forward "^$" nil t) |
| 267 | ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED | 268 | (let ((cte (save-restriction |
| 268 | (goto-char (point-min)) | 269 | (narrow-to-region (point-min) (point)) |
| 269 | (while (looking-at "^Content[^ ]+:") | 270 | (mail-fetch-field "content-transfer-encoding")))) |
| 270 | (when (looking-at "^Content-Transfer-Encoding: \\(.+\\)") | 271 | ;; Strip MIME headers since it will be ASCII armoured. |
| 271 | (setq cte (intern (match-string 1)))) | 272 | (forward-line 1) |
| 272 | (forward-line)) | 273 | (delete-region (point-min) (point)) |
| 273 | (unless (bobp) | 274 | (when cte |
| 274 | (delete-region (point-min) (point))) | 275 | (mm-decode-content-transfer-encoding (intern (downcase cte)))))) |
| 275 | (mm-decode-content-transfer-encoding cte) | 276 | (unless (let ((pgg-text-mode t)) |
| 276 | (unless (pgg-encrypt-region | 277 | (pgg-encrypt-region |
| 277 | (point-min) (point-max) | 278 | (point-min) (point-max) |
| 278 | (split-string | 279 | (split-string |
| 279 | (or | 280 | (or |
| @@ -281,15 +282,13 @@ | |||
| 281 | (message-options-set 'message-recipients | 282 | (message-options-set 'message-recipients |
| 282 | (read-string "Recipients: "))) | 283 | (read-string "Recipients: "))) |
| 283 | "[ \f\t\n\r\v,]+") | 284 | "[ \f\t\n\r\v,]+") |
| 284 | sign) | 285 | sign)) |
| 285 | (pop-to-buffer pgg-errors-buffer) | 286 | (pop-to-buffer pgg-errors-buffer) |
| 286 | (error "Encrypt error")) | 287 | (error "Encrypt error")) |
| 287 | (delete-region (point-min) (point-max)) | 288 | (delete-region (point-min) (point-max)) |
| 288 | ;;(insert "Content-Type: application/pgp-encrypted\n\n") | 289 | (insert "\n") |
| 289 | ;;(insert "Version: 1\n\n") | 290 | (insert-buffer-substring pgg-output-buffer) |
| 290 | (insert "\n") | 291 | t) |
| 291 | (insert-buffer-substring pgg-output-buffer) | ||
| 292 | t)) | ||
| 293 | 292 | ||
| 294 | ;;;###autoload | 293 | ;;;###autoload |
| 295 | (defun mml1991-encrypt (cont &optional sign) | 294 | (defun mml1991-encrypt (cont &optional sign) |
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 80dd5b26597..591ef647678 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el | |||
| @@ -707,6 +707,8 @@ | |||
| 707 | (buffer-string)))) | 707 | (buffer-string)))) |
| 708 | (progn | 708 | (progn |
| 709 | (erase-buffer) | 709 | (erase-buffer) |
| 710 | ;; Treat data which pgg returns as a unibyte string. | ||
| 711 | (mm-disable-multibyte) | ||
| 710 | (insert-buffer-substring pgg-output-buffer) | 712 | (insert-buffer-substring pgg-output-buffer) |
| 711 | (goto-char (point-min)) | 713 | (goto-char (point-min)) |
| 712 | (while (search-forward "\r\n" nil t) | 714 | (while (search-forward "\r\n" nil t) |
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 134b62e97b9..a67d5a469f6 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el | |||
| @@ -307,8 +307,8 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 307 | (defun nnweb-google-wash-article () | 307 | (defun nnweb-google-wash-article () |
| 308 | ;; We have Google's masked e-mail addresses here. :-/ | 308 | ;; We have Google's masked e-mail addresses here. :-/ |
| 309 | (let ((case-fold-search t) | 309 | (let ((case-fold-search t) |
| 310 | (start-re "<pre>\n *") | 310 | (start-re "<pre>[\r\n ]*") |
| 311 | (end-re "\n *</pre>")) | 311 | (end-re "[\r\n ]*</pre>")) |
| 312 | (goto-char (point-min)) | 312 | (goto-char (point-min)) |
| 313 | (if (save-excursion | 313 | (if (save-excursion |
| 314 | (or (re-search-forward "The requested message.*could not be found." | 314 | (or (re-search-forward "The requested message.*could not be found." |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index d30fc02c409..2b75e7fd053 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -630,6 +630,7 @@ it is displayed along with the global value." | |||
| 630 | (indirect-variable variable) | 630 | (indirect-variable variable) |
| 631 | (error variable))) | 631 | (error variable))) |
| 632 | (obsolete (get variable 'byte-obsolete-variable)) | 632 | (obsolete (get variable 'byte-obsolete-variable)) |
| 633 | (safe-var (get variable 'safe-local-variable)) | ||
| 633 | (doc (or (documentation-property variable 'variable-documentation) | 634 | (doc (or (documentation-property variable 'variable-documentation) |
| 634 | (documentation-property alias 'variable-documentation)))) | 635 | (documentation-property alias 'variable-documentation)))) |
| 635 | (unless (eq alias variable) | 636 | (unless (eq alias variable) |
| @@ -641,6 +642,11 @@ it is displayed along with the global value." | |||
| 641 | (princ (if (stringp (car obsolete)) (car obsolete) | 642 | (princ (if (stringp (car obsolete)) (car obsolete) |
| 642 | (format "use `%s' instead." (car obsolete)))) | 643 | (format "use `%s' instead." (car obsolete)))) |
| 643 | (terpri)) | 644 | (terpri)) |
| 645 | (when safe-var | ||
| 646 | (princ "This variable is safe to use as a file local variable") | ||
| 647 | (princ (format " only if its value\nsatisfies the predicate `%s'.\n" | ||
| 648 | safe-var)) | ||
| 649 | (terpri)) | ||
| 644 | (princ "Documentation:\n") | 650 | (princ "Documentation:\n") |
| 645 | (princ (or doc "Not documented as a variable."))) | 651 | (princ (or doc "Not documented as a variable."))) |
| 646 | ;; Make a link to customize if this variable can be customized. | 652 | ;; Make a link to customize if this variable can be customized. |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index a5cdf1f4d72..0c6e0f47453 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -197,7 +197,10 @@ Commands: | |||
| 197 | (view-mode) | 197 | (view-mode) |
| 198 | (make-local-variable 'view-no-disable-on-exit) | 198 | (make-local-variable 'view-no-disable-on-exit) |
| 199 | (setq view-no-disable-on-exit t) | 199 | (setq view-no-disable-on-exit t) |
| 200 | (setq view-exit-action (lambda (buffer) (delete-window))) | 200 | (setq view-exit-action (lambda (buffer) |
| 201 | (or (window-minibuffer-p (selected-window)) | ||
| 202 | (one-window-p t) | ||
| 203 | (delete-window)))) | ||
| 201 | (run-mode-hooks 'help-mode-hook)) | 204 | (run-mode-hooks 'help-mode-hook)) |
| 202 | 205 | ||
| 203 | ;;;###autoload | 206 | ;;;###autoload |
diff --git a/lisp/image.el b/lisp/image.el index 2212b0fb471..b388396ded7 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -280,27 +280,14 @@ be determined." | |||
| 280 | 280 | ||
| 281 | 281 | ||
| 282 | ;;;###autoload | 282 | ;;;###autoload |
| 283 | (defun image-type-available-p (type) | 283 | (defun image-type (file-or-data &optional type data-p) |
| 284 | "Return non-nil if image type TYPE is available. | 284 | "Determine and return image type. |
| 285 | Image types are symbols like `xbm' or `jpeg'." | ||
| 286 | (and (fboundp 'init-image-library) | ||
| 287 | (init-image-library type image-library-alist))) | ||
| 288 | |||
| 289 | |||
| 290 | ;;;###autoload | ||
| 291 | (defun create-image (file-or-data &optional type data-p &rest props) | ||
| 292 | "Create an image. | ||
| 293 | FILE-OR-DATA is an image file name or image data. | 285 | FILE-OR-DATA is an image file name or image data. |
| 294 | Optional TYPE is a symbol describing the image type. If TYPE is omitted | 286 | Optional TYPE is a symbol describing the image type. If TYPE is omitted |
| 295 | or nil, try to determine the image type from its first few bytes | 287 | or nil, try to determine the image type from its first few bytes |
| 296 | of image data. If that doesn't work, and FILE-OR-DATA is a file name, | 288 | of image data. If that doesn't work, and FILE-OR-DATA is a file name, |
| 297 | use its file extension as image type. | 289 | use its file extension as image type. |
| 298 | Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data. | 290 | Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data." |
| 299 | Optional PROPS are additional image attributes to assign to the image, | ||
| 300 | like, e.g. `:mask MASK'. | ||
| 301 | Value is the image created, or nil if images of type TYPE are not supported. | ||
| 302 | |||
| 303 | Images should not be larger than specified by `max-image-size'." | ||
| 304 | (when (and (not data-p) (not (stringp file-or-data))) | 291 | (when (and (not data-p) (not (stringp file-or-data))) |
| 305 | (error "Invalid image file name `%s'" file-or-data)) | 292 | (error "Invalid image file name `%s'" file-or-data)) |
| 306 | (cond ((null data-p) | 293 | (cond ((null data-p) |
| @@ -319,6 +306,31 @@ Images should not be larger than specified by `max-image-size'." | |||
| 319 | (error "Cannot determine image type")) | 306 | (error "Cannot determine image type")) |
| 320 | (unless (symbolp type) | 307 | (unless (symbolp type) |
| 321 | (error "Invalid image type `%s'" type)) | 308 | (error "Invalid image type `%s'" type)) |
| 309 | type) | ||
| 310 | |||
| 311 | ;;;###autoload | ||
| 312 | (defun image-type-available-p (type) | ||
| 313 | "Return non-nil if image type TYPE is available. | ||
| 314 | Image types are symbols like `xbm' or `jpeg'." | ||
| 315 | (and (fboundp 'init-image-library) | ||
| 316 | (init-image-library type image-library-alist))) | ||
| 317 | |||
| 318 | |||
| 319 | ;;;###autoload | ||
| 320 | (defun create-image (file-or-data &optional type data-p &rest props) | ||
| 321 | "Create an image. | ||
| 322 | FILE-OR-DATA is an image file name or image data. | ||
| 323 | Optional TYPE is a symbol describing the image type. If TYPE is omitted | ||
| 324 | or nil, try to determine the image type from its first few bytes | ||
| 325 | of image data. If that doesn't work, and FILE-OR-DATA is a file name, | ||
| 326 | use its file extension as image type. | ||
| 327 | Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data. | ||
| 328 | Optional PROPS are additional image attributes to assign to the image, | ||
| 329 | like, e.g. `:mask MASK'. | ||
| 330 | Value is the image created, or nil if images of type TYPE are not supported. | ||
| 331 | |||
| 332 | Images should not be larger than specified by `max-image-size'." | ||
| 333 | (setq type (image-type file-or-data type data-p)) | ||
| 322 | (when (image-type-available-p type) | 334 | (when (image-type-available-p type) |
| 323 | (append (list 'image :type type (if data-p :data :file) file-or-data) | 335 | (append (list 'image :type type (if data-p :data :file) file-or-data) |
| 324 | props))) | 336 | props))) |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 3a6c53c3113..82c022075a4 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -1265,15 +1265,15 @@ or by the previous use of this command." | |||
| 1265 | "Specify coding system for keyboard input. | 1265 | "Specify coding system for keyboard input. |
| 1266 | If you set this on a terminal which can't distinguish Meta keys from | 1266 | If you set this on a terminal which can't distinguish Meta keys from |
| 1267 | 8-bit characters, you will have to use ESC to type Meta characters. | 1267 | 8-bit characters, you will have to use ESC to type Meta characters. |
| 1268 | See Info node `Specify Coding' and Info node `Single-Byte Character Support'. | 1268 | See Info node `Terminal Coding' and Info node `Unibyte Mode'. |
| 1269 | 1269 | ||
| 1270 | On non-windowing terminals, this is set from the locale by default. | 1270 | On non-windowing terminals, this is set from the locale by default. |
| 1271 | 1271 | ||
| 1272 | Setting this variable directly does not take effect; | 1272 | Setting this variable directly does not take effect; |
| 1273 | use either \\[customize] or \\[set-keyboard-coding-system]." | 1273 | use either \\[customize] or \\[set-keyboard-coding-system]." |
| 1274 | :type '(coding-system :tag "Coding system") | 1274 | :type '(coding-system :tag "Coding system") |
| 1275 | :link '(info-link "(emacs)Specify Coding") | 1275 | :link '(info-link "(emacs)Terminal Coding") |
| 1276 | :link '(info-link "(emacs)Single-Byte Character Support") | 1276 | :link '(info-link "(emacs)Unibyte Mode") |
| 1277 | :set (lambda (symbol value) | 1277 | :set (lambda (symbol value) |
| 1278 | ;; Don't load encoded-kbd-mode unnecessarily. | 1278 | ;; Don't load encoded-kbd-mode unnecessarily. |
| 1279 | (if (or value (boundp 'encoded-kbd-mode)) | 1279 | (if (or value (boundp 'encoded-kbd-mode)) |
diff --git a/lisp/log-edit.el b/lisp/log-edit.el index 0c7a655a237..611bab0a247 100644 --- a/lisp/log-edit.el +++ b/lisp/log-edit.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: pcl-cvs cvs commit log | 7 | ;; Keywords: pcl-cvs cvs commit log |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/log-view.el b/lisp/log-view.el index 8a6f88650d2..dbee454b7d6 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, | 3 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
| 4 | ;; 2006 Free Software Foundation, Inc. | 4 | ;; 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: rcs sccs cvs log version-control | 7 | ;; Keywords: rcs sccs cvs log version-control |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 89ca1dc04aa..f7846394638 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog | |||
| @@ -1,3 +1,40 @@ | |||
| 1 | 2006-04-28 Bill Wohler <wohler@newt.com> | ||
| 2 | |||
| 3 | Release MH-E version 7.95. | ||
| 4 | |||
| 5 | * mh-e.el (Version, mh-version): Update for release 7.95. | ||
| 6 | |||
| 7 | 2006-04-26 Eric Ding <ericding@alum.mit.edu> | ||
| 8 | |||
| 9 | * mh-e.el (mh-invisible-header-fields-internal): Add entry | ||
| 10 | "X-Provags-ID:" | ||
| 11 | |||
| 12 | 2006-04-25 Bill Wohler <wohler@newt.com> | ||
| 13 | |||
| 14 | * mh-letter.el (mh-folder-expand-at-point): Fix folder completion. | ||
| 15 | Folders returned by mh-folder-completion-function no longer need | ||
| 16 | adornment (closes SF #1476270). | ||
| 17 | |||
| 18 | 2006-04-21 Bill Wohler <wohler@newt.com> | ||
| 19 | |||
| 20 | * mh-e.el (Version, mh-version): Add +cvs to version. | ||
| 21 | |||
| 22 | 2006-04-21 Bill Wohler <wohler@newt.com> | ||
| 23 | |||
| 24 | Release MH-E version 7.94. | ||
| 25 | |||
| 26 | * mh-e.el (Version, mh-version): Update for release 7.94. | ||
| 27 | |||
| 28 | 2006-04-21 Bill Wohler <wohler@newt.com> | ||
| 29 | |||
| 30 | * mh-letter.el (mh-insert-letter): If a message number isn't | ||
| 31 | given, throw an error rather than using a potentially incorrect | ||
| 32 | message number (closes SF #1473729). In addition, use the cur | ||
| 33 | message if mh-sent-from-msg is nil (when sending a message, in | ||
| 34 | contrast to replying). Move conversion of int to string into | ||
| 35 | interactive stanza so body can assume variables are of proper | ||
| 36 | type. | ||
| 37 | |||
| 1 | 2006-04-20 Bill Wohler <wohler@newt.com> | 38 | 2006-04-20 Bill Wohler <wohler@newt.com> |
| 2 | 39 | ||
| 3 | * mh-tool-bar.el (image-load-path): Define to shush compiler. | 40 | * mh-tool-bar.el (image-load-path): Define to shush compiler. |
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 9ae686d8950..88b8c5bac09 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | ;; Author: Bill Wohler <wohler@newt.com> | 7 | ;; Author: Bill Wohler <wohler@newt.com> |
| 8 | ;; Maintainer: Bill Wohler <wohler@newt.com> | 8 | ;; Maintainer: Bill Wohler <wohler@newt.com> |
| 9 | ;; Version: 7.93+cvs | 9 | ;; Version: 7.95 |
| 10 | ;; Keywords: mail | 10 | ;; Keywords: mail |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -136,7 +136,7 @@ | |||
| 136 | ;; Try to keep variables local to a single file. Provide accessors if | 136 | ;; Try to keep variables local to a single file. Provide accessors if |
| 137 | ;; variables are shared. Use this section as a last resort. | 137 | ;; variables are shared. Use this section as a last resort. |
| 138 | 138 | ||
| 139 | (defconst mh-version "7.93+cvs" "Version number of MH-E.") | 139 | (defconst mh-version "7.95" "Version number of MH-E.") |
| 140 | 140 | ||
| 141 | ;; Variants | 141 | ;; Variants |
| 142 | 142 | ||
| @@ -2526,6 +2526,7 @@ of citations entirely, choose \"None\"." | |||
| 2526 | "X-Originating-IP:" ; Hotmail | 2526 | "X-Originating-IP:" ; Hotmail |
| 2527 | "X-Postfilter:" | 2527 | "X-Postfilter:" |
| 2528 | "X-Priority:" ; MS Outlook | 2528 | "X-Priority:" ; MS Outlook |
| 2529 | "X-Provags-ID:" | ||
| 2529 | "X-Qotd-" ; User added | 2530 | "X-Qotd-" ; User added |
| 2530 | "X-RM" | 2531 | "X-RM" |
| 2531 | "X-Received-Date:" | 2532 | "X-Received-Date:" |
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index 9445b5ea41f..d037c09e2aa 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el | |||
| @@ -393,24 +393,26 @@ message is not indented, and \"> \" is not inserted before each line. | |||
| 393 | This command leaves the mark before the letter and point after it." | 393 | This command leaves the mark before the letter and point after it." |
| 394 | (interactive | 394 | (interactive |
| 395 | (let* ((folder | 395 | (let* ((folder |
| 396 | (mh-prompt-for-folder "Message from" | 396 | (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)) |
| 397 | mh-sent-from-folder nil)) | ||
| 398 | (default | 397 | (default |
| 399 | (if (and (equal folder mh-sent-from-folder) | 398 | (if (equal folder mh-sent-from-folder) |
| 400 | (numberp mh-sent-from-msg)) | 399 | (or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur"))) |
| 401 | mh-sent-from-msg | ||
| 402 | (nth 0 (mh-translate-range folder "cur")))) | 400 | (nth 0 (mh-translate-range folder "cur")))) |
| 403 | (message | 401 | (message |
| 404 | (read-string (concat "Message number" | 402 | (read-string (concat "Message number" |
| 405 | (or (and default | 403 | (or (and default |
| 406 | (format " (default %d): " default)) | 404 | (format " (default %d): " default)) |
| 407 | ": "))))) | 405 | ": ")) |
| 406 | nil nil | ||
| 407 | (if (numberp default) | ||
| 408 | (int-to-string default) | ||
| 409 | default)))) | ||
| 408 | (list folder message current-prefix-arg))) | 410 | (list folder message current-prefix-arg))) |
| 411 | (if (equal message "") | ||
| 412 | (error "No message number given")) | ||
| 409 | (save-restriction | 413 | (save-restriction |
| 410 | (narrow-to-region (point) (point)) | 414 | (narrow-to-region (point) (point)) |
| 411 | (let ((start (point-min))) | 415 | (let ((start (point-min))) |
| 412 | (if (and (equal message "") (numberp mh-sent-from-msg)) | ||
| 413 | (setq message (int-to-string mh-sent-from-msg))) | ||
| 414 | (insert-file-contents | 416 | (insert-file-contents |
| 415 | (expand-file-name message (mh-expand-file-name folder))) | 417 | (expand-file-name message (mh-expand-file-name folder))) |
| 416 | (when (not verbatim) | 418 | (when (not verbatim) |
| @@ -864,15 +866,12 @@ downcasing the field name." | |||
| 864 | "Do folder name completion in Fcc header field." | 866 | "Do folder name completion in Fcc header field." |
| 865 | (let* ((end (point)) | 867 | (let* ((end (point)) |
| 866 | (beg (mh-beginning-of-word)) | 868 | (beg (mh-beginning-of-word)) |
| 867 | (folder (buffer-substring beg end)) | 869 | (folder (buffer-substring-no-properties beg end)) |
| 868 | (leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+))) | 870 | (leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+))) |
| 869 | (last-slash (mh-search-from-end ?/ folder)) | 871 | (choices (mapcar (lambda (x) (list x)) |
| 870 | (prefix (and last-slash (substring folder 0 last-slash))) | ||
| 871 | (choices (mapcar #'(lambda (x) | ||
| 872 | (list (cond (prefix (format "%s/%s" prefix x)) | ||
| 873 | (leading-plus (format "+%s" x)) | ||
| 874 | (t x)))) | ||
| 875 | (mh-folder-completion-function folder nil t)))) | 872 | (mh-folder-completion-function folder nil t)))) |
| 873 | (unless leading-plus | ||
| 874 | (setq folder (concat "+" folder))) | ||
| 876 | (mh-complete-word folder choices beg end))) | 875 | (mh-complete-word folder choices beg end))) |
| 877 | 876 | ||
| 878 | ;;;###mh-autoload | 877 | ;;;###mh-autoload |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 53703166e64..a0b328413b0 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -74,13 +74,13 @@ | |||
| 74 | :group 'rcirc) | 74 | :group 'rcirc) |
| 75 | 75 | ||
| 76 | (defcustom rcirc-default-user-full-name (if (string= (user-full-name) "") | 76 | (defcustom rcirc-default-user-full-name (if (string= (user-full-name) "") |
| 77 | rcirc-user-name | 77 | rcirc-user-name |
| 78 | (user-full-name)) | 78 | (user-full-name)) |
| 79 | "The full name sent to the server when connecting." | 79 | "The full name sent to the server when connecting." |
| 80 | :type 'string | 80 | :type 'string |
| 81 | :group 'rcirc) | 81 | :group 'rcirc) |
| 82 | 82 | ||
| 83 | (defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#emacs")) | 83 | (defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc")) |
| 84 | "Alist of channels to join at startup. | 84 | "Alist of channels to join at startup. |
| 85 | Each element looks like (SERVER-REGEXP . CHANNEL-LIST)." | 85 | Each element looks like (SERVER-REGEXP . CHANNEL-LIST)." |
| 86 | :type '(alist :key-type string :value-type (repeat string)) | 86 | :type '(alist :key-type string :value-type (repeat string)) |
| @@ -206,6 +206,18 @@ When an ignored person renames, their nick is added to both lists. | |||
| 206 | Nicks will be removed from the automatic list on follow-up renamings or | 206 | Nicks will be removed from the automatic list on follow-up renamings or |
| 207 | parts.") | 207 | parts.") |
| 208 | 208 | ||
| 209 | (defcustom rcirc-bright-nick-regexp nil | ||
| 210 | "Regexp matching nicks to be emphasized. | ||
| 211 | See `rcirc-bright-nick' face." | ||
| 212 | :type 'regexp | ||
| 213 | :group 'rcirc) | ||
| 214 | |||
| 215 | (defcustom rcirc-dim-nick-regexp nil | ||
| 216 | "Regexp matching nicks to be deemphasized. | ||
| 217 | See `rcirc-dim-nick' face." | ||
| 218 | :type 'regexp | ||
| 219 | :group 'rcirc) | ||
| 220 | |||
| 209 | (defcustom rcirc-print-hooks nil | 221 | (defcustom rcirc-print-hooks nil |
| 210 | "Hook run after text is printed. | 222 | "Hook run after text is printed. |
| 211 | Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." | 223 | Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." |
| @@ -217,7 +229,7 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." | |||
| 217 | :type 'boolean | 229 | :type 'boolean |
| 218 | :group 'rcirc) | 230 | :group 'rcirc) |
| 219 | 231 | ||
| 220 | (defcustom rcirc-decode-coding-system 'undecided | 232 | (defcustom rcirc-decode-coding-system 'utf-8 |
| 221 | "Coding system used to decode incoming irc messages." | 233 | "Coding system used to decode incoming irc messages." |
| 222 | :type 'coding-system | 234 | :type 'coding-system |
| 223 | :group 'rcirc) | 235 | :group 'rcirc) |
| @@ -546,7 +558,7 @@ With no argument or nil as argument, use the current buffer." | |||
| 546 | (with-current-buffer rcirc-server-buffer | 558 | (with-current-buffer rcirc-server-buffer |
| 547 | (or rcirc-nick rcirc-default-nick)))) | 559 | (or rcirc-nick rcirc-default-nick)))) |
| 548 | 560 | ||
| 549 | (defvar rcirc-max-message-length 450 | 561 | (defvar rcirc-max-message-length 420 |
| 550 | "Messages longer than this value will be split.") | 562 | "Messages longer than this value will be split.") |
| 551 | 563 | ||
| 552 | (defun rcirc-send-message (process target message &optional noticep) | 564 | (defun rcirc-send-message (process target message &optional noticep) |
| @@ -955,7 +967,8 @@ Create the buffer if it doesn't exist." | |||
| 955 | :global nil | 967 | :global nil |
| 956 | :group 'rcirc | 968 | :group 'rcirc |
| 957 | (make-local-variable 'rcirc-parent-buffer) | 969 | (make-local-variable 'rcirc-parent-buffer) |
| 958 | (put 'rcirc-parent-buffer 'permanent-local t)) | 970 | (put 'rcirc-parent-buffer 'permanent-local t) |
| 971 | (setq fill-column rcirc-max-message-length)) | ||
| 959 | 972 | ||
| 960 | (defun rcirc-multiline-minor-submit () | 973 | (defun rcirc-multiline-minor-submit () |
| 961 | "Send the text in buffer back to parent buffer." | 974 | "Send the text in buffer back to parent buffer." |
| @@ -1029,6 +1042,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'." | |||
| 1029 | (split-string (or (cdr (assoc response rcirc-response-formats)) | 1042 | (split-string (or (cdr (assoc response rcirc-response-formats)) |
| 1030 | (cdr (assq t rcirc-response-formats))) | 1043 | (cdr (assq t rcirc-response-formats))) |
| 1031 | "%")) | 1044 | "%")) |
| 1045 | (sender (or sender "")) | ||
| 1032 | (result "") | 1046 | (result "") |
| 1033 | (face nil) | 1047 | (face nil) |
| 1034 | key face-key repl) | 1048 | key face-key repl) |
| @@ -1054,9 +1068,16 @@ is found by looking up RESPONSE in `rcirc-response-formats'." | |||
| 1054 | (rcirc-facify nick | 1068 | (rcirc-facify nick |
| 1055 | (if (eq key ?n) | 1069 | (if (eq key ?n) |
| 1056 | face | 1070 | face |
| 1057 | (if (string= sender (rcirc-nick process)) | 1071 | (cond ((string= sender (rcirc-nick process)) |
| 1058 | 'rcirc-my-nick | 1072 | 'rcirc-my-nick) |
| 1059 | 'rcirc-other-nick))))) | 1073 | ((and rcirc-bright-nick-regexp |
| 1074 | (string-match rcirc-bright-nick-regexp sender)) | ||
| 1075 | 'rcirc-bright-nick) | ||
| 1076 | ((and rcirc-dim-nick-regexp | ||
| 1077 | (string-match rcirc-dim-nick-regexp sender)) | ||
| 1078 | 'rcirc-dim-nick) | ||
| 1079 | (t | ||
| 1080 | 'rcirc-other-nick)))))) | ||
| 1060 | ((eq key ?T) | 1081 | ((eq key ?T) |
| 1061 | ;; %T -- timestamp | 1082 | ;; %T -- timestamp |
| 1062 | (rcirc-facify | 1083 | (rcirc-facify |
| @@ -1130,8 +1151,9 @@ record activity." | |||
| 1130 | (or text (setq text "")) | 1151 | (or text (setq text "")) |
| 1131 | (unless (or (member sender rcirc-ignore-list) | 1152 | (unless (or (member sender rcirc-ignore-list) |
| 1132 | (member (with-syntax-table rcirc-nick-syntax-table | 1153 | (member (with-syntax-table rcirc-nick-syntax-table |
| 1133 | (when (string-match "^\\([^/]\\w*\\)\\b" text) | 1154 | (when (string-match "^\\([^/]\\w*\\)[:,]" text) |
| 1134 | (match-string 1 text))) rcirc-ignore-list)) | 1155 | (match-string 1 text))) |
| 1156 | rcirc-ignore-list)) | ||
| 1135 | (let* ((buffer (rcirc-target-buffer process sender response target text)) | 1157 | (let* ((buffer (rcirc-target-buffer process sender response target text)) |
| 1136 | (inhibit-read-only t)) | 1158 | (inhibit-read-only t)) |
| 1137 | (with-current-buffer buffer | 1159 | (with-current-buffer buffer |
| @@ -1222,10 +1244,12 @@ record activity." | |||
| 1222 | (regexp-quote (rcirc-nick process)) | 1244 | (regexp-quote (rcirc-nick process)) |
| 1223 | "\\b") | 1245 | "\\b") |
| 1224 | text))) | 1246 | text))) |
| 1225 | (when (or (not rcirc-ignore-buffer-activity-flag) | 1247 | (when (if rcirc-ignore-buffer-activity-flag |
| 1226 | ;; always notice when our nick is mentioned, even | 1248 | ;; - Always notice when our nick is mentioned |
| 1227 | ;; if ignoring channel activity | 1249 | nick-match |
| 1228 | nick-match) | 1250 | ;; - Never bother us if a dim-nick spoke |
| 1251 | (not (and rcirc-dim-nick-regexp sender | ||
| 1252 | (string-match rcirc-dim-nick-regexp sender)))) | ||
| 1229 | (rcirc-record-activity | 1253 | (rcirc-record-activity |
| 1230 | (current-buffer) | 1254 | (current-buffer) |
| 1231 | (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) | 1255 | (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) |
| @@ -1375,7 +1399,7 @@ if NICK is also on `rcirc-ignore-list-automatic'." | |||
| 1375 | (force-mode-line-update)) | 1399 | (force-mode-line-update)) |
| 1376 | 1400 | ||
| 1377 | (defun rcirc-toggle-low-priority () | 1401 | (defun rcirc-toggle-low-priority () |
| 1378 | "Toggle the value of `rcirc-ignore-buffer-activity-flag'." | 1402 | "Toggle the value of `rcirc-low-priority-flag'." |
| 1379 | (interactive) | 1403 | (interactive) |
| 1380 | (setq rcirc-low-priority-flag | 1404 | (setq rcirc-low-priority-flag |
| 1381 | (not rcirc-low-priority-flag)) | 1405 | (not rcirc-low-priority-flag)) |
| @@ -1788,7 +1812,7 @@ ones added to the list automatically are marked with an asterisk." | |||
| 1788 | 1812 | ||
| 1789 | (defun rcirc-browse-url (&optional arg) | 1813 | (defun rcirc-browse-url (&optional arg) |
| 1790 | "Prompt for URL to browse based on URLs in buffer." | 1814 | "Prompt for URL to browse based on URLs in buffer." |
| 1791 | (interactive) | 1815 | (interactive "P") |
| 1792 | (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls)) | 1816 | (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls)) |
| 1793 | (initial-input (car rcirc-urls)) | 1817 | (initial-input (car rcirc-urls)) |
| 1794 | (history (cdr rcirc-urls))) | 1818 | (history (cdr rcirc-urls))) |
| @@ -1910,7 +1934,7 @@ FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING." | |||
| 1910 | (cond ((rcirc-channel-p target) | 1934 | (cond ((rcirc-channel-p target) |
| 1911 | target) | 1935 | target) |
| 1912 | ;;; -ChanServ- [#gnu] Welcome... | 1936 | ;;; -ChanServ- [#gnu] Welcome... |
| 1913 | ((string-match "^\\[\\(#[^ ]+\\)\\]" message) | 1937 | ((string-match "\\[\\(#[^\] ]+\\)\\]" message) |
| 1914 | (match-string 1 message)) | 1938 | (match-string 1 message)) |
| 1915 | (sender | 1939 | (sender |
| 1916 | (if (string= sender (rcirc-server-name process)) | 1940 | (if (string= sender (rcirc-server-name process)) |
| @@ -2211,6 +2235,25 @@ Passwords are stored in `rcirc-authinfo' (which see)." | |||
| 2211 | "The face used to highlight other messages." | 2235 | "The face used to highlight other messages." |
| 2212 | :group 'rcirc-faces) | 2236 | :group 'rcirc-faces) |
| 2213 | 2237 | ||
| 2238 | (defface rcirc-bright-nick | ||
| 2239 | '((((class grayscale) (background light)) | ||
| 2240 | (:foreground "LightGray" :weight bold :underline t)) | ||
| 2241 | (((class grayscale) (background dark)) | ||
| 2242 | (:foreground "Gray50" :weight bold :underline t)) | ||
| 2243 | (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue")) | ||
| 2244 | (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine")) | ||
| 2245 | (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue")) | ||
| 2246 | (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine")) | ||
| 2247 | (((class color) (min-colors 8)) (:foreground "magenta")) | ||
| 2248 | (t (:weight bold :underline t))) | ||
| 2249 | "Face used for nicks matched by `rcirc-bright-nick-regexp'." | ||
| 2250 | :group 'rcirc-faces) | ||
| 2251 | |||
| 2252 | (defface rcirc-dim-nick | ||
| 2253 | '((t :inherit default)) | ||
| 2254 | "Face used for nicks matched by `rcirc-dim-nick-regexp'." | ||
| 2255 | :group 'rcirc-faces) | ||
| 2256 | |||
| 2214 | (defface rcirc-server ; font-lock-comment-face | 2257 | (defface rcirc-server ; font-lock-comment-face |
| 2215 | '((((class grayscale) (background light)) | 2258 | '((((class grayscale) (background light)) |
| 2216 | (:foreground "DimGray" :weight bold :slant italic)) | 2259 | (:foreground "DimGray" :weight bold :slant italic)) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 617e21ebfeb..6e166aa2393 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1821,8 +1821,6 @@ while (my $data = <STDIN>) { | |||
| 1821 | Escape sequence %s is replaced with name of Perl binary. | 1821 | Escape sequence %s is replaced with name of Perl binary. |
| 1822 | This string is passed to `format', so percent characters need to be doubled.") | 1822 | This string is passed to `format', so percent characters need to be doubled.") |
| 1823 | 1823 | ||
| 1824 | ; These values conform to `file-attributes' from XEmacs 21.2. | ||
| 1825 | ; GNU Emacs and other tools not checked. | ||
| 1826 | (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) | 1824 | (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) |
| 1827 | (1 . "p") ; fifo | 1825 | (1 . "p") ; fifo |
| 1828 | (2 . "c") ; character device | 1826 | (2 . "c") ; character device |
| @@ -1927,17 +1925,12 @@ on the FILENAME argument, even if VISIT was a string.") | |||
| 1927 | "Alist of handler functions. | 1925 | "Alist of handler functions. |
| 1928 | Operations not mentioned here will be handled by the normal Emacs functions.") | 1926 | Operations not mentioned here will be handled by the normal Emacs functions.") |
| 1929 | 1927 | ||
| 1930 | ;; Handlers for partial tramp file names. For GNU Emacs just | 1928 | ;; Handlers for partial tramp file names. For Emacs just |
| 1931 | ;; `file-name-all-completions' is needed. The other ones are necessary | 1929 | ;; `file-name-all-completions' is needed. |
| 1932 | ;; for XEmacs. | 1930 | ;;;###autoload |
| 1933 | (defconst tramp-completion-file-name-handler-alist | 1931 | (defconst tramp-completion-file-name-handler-alist |
| 1934 | '( | 1932 | '((file-name-all-completions . tramp-completion-handle-file-name-all-completions) |
| 1935 | (file-name-directory . tramp-completion-handle-file-name-directory) | 1933 | (file-name-completion . tramp-completion-handle-file-name-completion)) |
| 1936 | (file-name-nondirectory . tramp-completion-handle-file-name-nondirectory) | ||
| 1937 | (file-exists-p . tramp-completion-handle-file-exists-p) | ||
| 1938 | (file-name-all-completions . tramp-completion-handle-file-name-all-completions) | ||
| 1939 | (file-name-completion . tramp-completion-handle-file-name-completion) | ||
| 1940 | (expand-file-name . tramp-completion-handle-expand-file-name)) | ||
| 1941 | "Alist of completion handler functions. | 1934 | "Alist of completion handler functions. |
| 1942 | Used for file names matching `tramp-file-name-regexp'. Operations not | 1935 | Used for file names matching `tramp-file-name-regexp'. Operations not |
| 1943 | mentioned here will be handled by `tramp-file-name-handler-alist' or the | 1936 | mentioned here will be handled by `tramp-file-name-handler-alist' or the |
| @@ -2172,28 +2165,11 @@ target of the symlink differ." | |||
| 2172 | ;; Localname manipulation functions that grok TRAMP localnames... | 2165 | ;; Localname manipulation functions that grok TRAMP localnames... |
| 2173 | (defun tramp-handle-file-name-directory (file) | 2166 | (defun tramp-handle-file-name-directory (file) |
| 2174 | "Like `file-name-directory' but aware of TRAMP files." | 2167 | "Like `file-name-directory' but aware of TRAMP files." |
| 2175 | ;; everything except the last filename thing is the directory | 2168 | ;; Everything except the last filename thing is the directory. |
| 2176 | (with-parsed-tramp-file-name file nil | 2169 | (with-parsed-tramp-file-name file nil |
| 2177 | ;; For the following condition, two possibilities should be tried: | 2170 | ;; Run the command on the localname portion only. |
| 2178 | ;; (1) (string= localname "") | 2171 | (tramp-make-tramp-file-name |
| 2179 | ;; (2) (or (string= localname "") (string= localname "/")) | 2172 | multi-method method user host (file-name-directory (or localname ""))))) |
| 2180 | ;; The second variant fails when completing a "/" directory on | ||
| 2181 | ;; the remote host, that is a filename which looks like | ||
| 2182 | ;; "/user@host:/". But maybe wildcards fail with the first variant. | ||
| 2183 | ;; We should do some investigation. | ||
| 2184 | (if (string= localname "") | ||
| 2185 | ;; For a filename like "/[foo]", we return "/". The `else' | ||
| 2186 | ;; case would return "/[foo]" unchanged. But if we do that, | ||
| 2187 | ;; then `file-expand-wildcards' ceases to work. It's not | ||
| 2188 | ;; quite clear to me what's the intuition that tells that this | ||
| 2189 | ;; behavior is the right behavior, but oh, well. | ||
| 2190 | "/" | ||
| 2191 | ;; run the command on the localname portion only | ||
| 2192 | ;; CCC: This should take into account the remote machine type, no? | ||
| 2193 | ;; --daniel <daniel@danann.net> | ||
| 2194 | (tramp-make-tramp-file-name multi-method method user host | ||
| 2195 | ;; This will not recurse... | ||
| 2196 | (or (file-name-directory localname) ""))))) | ||
| 2197 | 2173 | ||
| 2198 | (defun tramp-handle-file-name-nondirectory (file) | 2174 | (defun tramp-handle-file-name-nondirectory (file) |
| 2199 | "Like `file-name-nondirectory' but aware of TRAMP files." | 2175 | "Like `file-name-nondirectory' but aware of TRAMP files." |
| @@ -4144,7 +4120,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." | |||
| 4144 | ;; (inhibit-file-name-operation operation)) | 4120 | ;; (inhibit-file-name-operation operation)) |
| 4145 | ;; (apply operation args))) | 4121 | ;; (apply operation args))) |
| 4146 | 4122 | ||
| 4147 | (defun tramp-run-real-handler (operation args) | 4123 | ;;;###autoload |
| 4124 | (progn (defun tramp-run-real-handler (operation args) | ||
| 4148 | "Invoke normal file name handler for OPERATION. | 4125 | "Invoke normal file name handler for OPERATION. |
| 4149 | First arg specifies the OPERATION, second arg is a list of arguments to | 4126 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 4150 | pass to the OPERATION." | 4127 | pass to the OPERATION." |
| @@ -4157,13 +4134,14 @@ pass to the OPERATION." | |||
| 4157 | ,(and (eq inhibit-file-name-operation operation) | 4134 | ,(and (eq inhibit-file-name-operation operation) |
| 4158 | inhibit-file-name-handlers))) | 4135 | inhibit-file-name-handlers))) |
| 4159 | (inhibit-file-name-operation operation)) | 4136 | (inhibit-file-name-operation operation)) |
| 4160 | (apply operation args))) | 4137 | (apply operation args)))) |
| 4161 | 4138 | ||
| 4162 | ;; This function is used from `tramp-completion-file-name-handler' functions | 4139 | ;; This function is used from `tramp-completion-file-name-handler' functions |
| 4163 | ;; only, if `tramp-completion-mode' is true. But this cannot be checked here | 4140 | ;; only, if `tramp-completion-mode' is true. But this cannot be checked here |
| 4164 | ;; because the check is based on a full filename, not available for all | 4141 | ;; because the check is based on a full filename, not available for all |
| 4165 | ;; basic I/O operations. | 4142 | ;; basic I/O operations. |
| 4166 | (defun tramp-completion-run-real-handler (operation args) | 4143 | ;;;###autoload |
| 4144 | (progn (defun tramp-completion-run-real-handler (operation args) | ||
| 4167 | "Invoke `tramp-file-name-handler' for OPERATION. | 4145 | "Invoke `tramp-file-name-handler' for OPERATION. |
| 4168 | First arg specifies the OPERATION, second arg is a list of arguments to | 4146 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 4169 | pass to the OPERATION." | 4147 | pass to the OPERATION." |
| @@ -4175,7 +4153,7 @@ pass to the OPERATION." | |||
| 4175 | ,(and (eq inhibit-file-name-operation operation) | 4153 | ,(and (eq inhibit-file-name-operation operation) |
| 4176 | inhibit-file-name-handlers))) | 4154 | inhibit-file-name-handlers))) |
| 4177 | (inhibit-file-name-operation operation)) | 4155 | (inhibit-file-name-operation operation)) |
| 4178 | (apply operation args))) | 4156 | (apply operation args)))) |
| 4179 | 4157 | ||
| 4180 | ;; We handle here all file primitives. Most of them have the file | 4158 | ;; We handle here all file primitives. Most of them have the file |
| 4181 | ;; name as first parameter; nevertheless we check for them explicitly | 4159 | ;; name as first parameter; nevertheless we check for them explicitly |
| @@ -4272,12 +4250,25 @@ ARGS are the arguments OPERATION has been called with." | |||
| 4272 | (defun tramp-file-name-handler (operation &rest args) | 4250 | (defun tramp-file-name-handler (operation &rest args) |
| 4273 | "Invoke Tramp file name handler. | 4251 | "Invoke Tramp file name handler. |
| 4274 | Falls back to normal file name handler if no tramp file name handler exists." | 4252 | Falls back to normal file name handler if no tramp file name handler exists." |
| 4253 | ;; (setq edebug-trace t) | ||
| 4254 | ;; (edebug-trace "%s" (with-output-to-string (backtrace))) | ||
| 4275 | (save-match-data | 4255 | (save-match-data |
| 4276 | (let* ((filename (apply 'tramp-file-name-for-operation operation args)) | 4256 | (let* ((filename (apply 'tramp-file-name-for-operation operation args)) |
| 4257 | (completion (tramp-completion-mode filename)) | ||
| 4277 | (foreign (tramp-find-foreign-file-name-handler filename))) | 4258 | (foreign (tramp-find-foreign-file-name-handler filename))) |
| 4278 | (cond | 4259 | (with-parsed-tramp-file-name filename nil |
| 4279 | (foreign (apply foreign operation args)) | 4260 | (cond |
| 4280 | (t (tramp-run-real-handler operation args)))))) | 4261 | ;; When we are in completion mode, some operations shouldn' be |
| 4262 | ;; handled by backend. | ||
| 4263 | ((and completion (memq operation '(expand-file-name))) | ||
| 4264 | (tramp-run-real-handler operation args)) | ||
| 4265 | ((and completion (zerop (length localname)) | ||
| 4266 | (memq operation '(file-exists-p file-directory-p))) | ||
| 4267 | t) | ||
| 4268 | ;; Call the backend function. | ||
| 4269 | (foreign (apply foreign operation args)) | ||
| 4270 | ;; Nothing to do for us. | ||
| 4271 | (t (tramp-run-real-handler operation args))))))) | ||
| 4281 | 4272 | ||
| 4282 | 4273 | ||
| 4283 | ;; In Emacs, there is some concurrency due to timers. If a timer | 4274 | ;; In Emacs, there is some concurrency due to timers. If a timer |
| @@ -4325,31 +4316,43 @@ Fall back to normal file name handler if no Tramp handler exists." | |||
| 4325 | (setq tramp-locked tl)))) | 4316 | (setq tramp-locked tl)))) |
| 4326 | 4317 | ||
| 4327 | ;;;###autoload | 4318 | ;;;###autoload |
| 4328 | (defun tramp-completion-file-name-handler (operation &rest args) | 4319 | (progn (defun tramp-completion-file-name-handler (operation &rest args) |
| 4329 | "Invoke tramp file name completion handler. | 4320 | "Invoke tramp file name completion handler. |
| 4330 | Falls back to normal file name handler if no tramp file name handler exists." | 4321 | Falls back to normal file name handler if no tramp file name handler exists." |
| 4331 | ;; (setq tramp-debug-buffer t) | 4322 | ;; (setq edebug-trace t) |
| 4332 | ;; (tramp-message 1 "%s %s" operation args) | 4323 | ;; (edebug-trace "%s" (with-output-to-string (backtrace))) |
| 4333 | ;; (tramp-message 1 "%s %s\n%s" | ||
| 4334 | ;; operation args (with-output-to-string (backtrace))) | ||
| 4335 | (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) | 4324 | (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) |
| 4336 | (if fn | 4325 | (if fn |
| 4337 | (save-match-data (apply (cdr fn) args)) | 4326 | (save-match-data (apply (cdr fn) args)) |
| 4338 | (tramp-completion-run-real-handler operation args)))) | 4327 | (tramp-completion-run-real-handler operation args))))) |
| 4339 | 4328 | ||
| 4340 | ;;;###autoload | 4329 | ;;;###autoload |
| 4341 | (put 'tramp-completion-file-name-handler 'safe-magic t) | 4330 | (defsubst tramp-register-file-name-handlers () |
| 4331 | "Add tramp file name handlers to `file-name-handler-alist'." | ||
| 4332 | (add-to-list 'file-name-handler-alist | ||
| 4333 | (cons tramp-file-name-regexp 'tramp-file-name-handler)) | ||
| 4334 | (when partial-completion-mode | ||
| 4335 | (add-to-list 'file-name-handler-alist | ||
| 4336 | (cons tramp-completion-file-name-regexp | ||
| 4337 | 'tramp-completion-file-name-handler)) | ||
| 4338 | (put 'tramp-completion-file-name-handler 'safe-magic t)) | ||
| 4339 | ;; If jka-compr is already loaded, move it to the front of | ||
| 4340 | ;; `file-name-handler-alist'. | ||
| 4341 | (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) | ||
| 4342 | (when jka | ||
| 4343 | (setq file-name-handler-alist | ||
| 4344 | (cons jka (delete jka file-name-handler-alist)))))) | ||
| 4342 | 4345 | ||
| 4343 | ;; Register in file name handler alist | 4346 | ;; During autoload, it shall be checked whether |
| 4344 | ;;;###autoload | 4347 | ;; `partial-completion-mode' is active. Therefore registering will be |
| 4345 | (add-to-list 'file-name-handler-alist | 4348 | ;; delayed. |
| 4346 | (cons tramp-file-name-regexp 'tramp-file-name-handler)) | 4349 | ;;;###autoload(add-hook |
| 4347 | (add-to-list 'file-name-handler-alist | 4350 | ;;;###autoload 'after-init-hook |
| 4348 | (cons tramp-completion-file-name-regexp | 4351 | ;;;###autoload '(lambda () (tramp-register-file-name-handlers))) |
| 4349 | 'tramp-completion-file-name-handler)) | 4352 | (tramp-register-file-name-handlers) |
| 4350 | 4353 | ||
| 4351 | ;;;###autoload | 4354 | ;;;###autoload |
| 4352 | (defun tramp-unload-file-name-handler-alist () | 4355 | (defun tramp-unload-file-name-handlers () |
| 4353 | (setq file-name-handler-alist | 4356 | (setq file-name-handler-alist |
| 4354 | (delete (rassoc 'tramp-file-name-handler | 4357 | (delete (rassoc 'tramp-file-name-handler |
| 4355 | file-name-handler-alist) | 4358 | file-name-handler-alist) |
| @@ -4357,17 +4360,7 @@ Falls back to normal file name handler if no tramp file name handler exists." | |||
| 4357 | file-name-handler-alist) | 4360 | file-name-handler-alist) |
| 4358 | file-name-handler-alist)))) | 4361 | file-name-handler-alist)))) |
| 4359 | 4362 | ||
| 4360 | (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handler-alist) | 4363 | (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) |
| 4361 | |||
| 4362 | (defun tramp-repair-jka-compr () | ||
| 4363 | "If jka-compr is already loaded, move it to the front of | ||
| 4364 | `file-name-handler-alist'. On Emacs 22 or so this will not be | ||
| 4365 | necessary anymore." | ||
| 4366 | (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) | ||
| 4367 | (when jka | ||
| 4368 | (setq file-name-handler-alist | ||
| 4369 | (cons jka (delete jka file-name-handler-alist)))))) | ||
| 4370 | (tramp-repair-jka-compr) | ||
| 4371 | 4364 | ||
| 4372 | 4365 | ||
| 4373 | ;;; Interactions with other packages: | 4366 | ;;; Interactions with other packages: |
| @@ -4482,31 +4475,10 @@ necessary anymore." | |||
| 4482 | last-input-event) ?\ )))))) | 4475 | last-input-event) ?\ )))))) |
| 4483 | t))) | 4476 | t))) |
| 4484 | 4477 | ||
| 4485 | (defun tramp-completion-handle-file-exists-p (filename) | ||
| 4486 | "Like `file-exists-p' for tramp files." | ||
| 4487 | (if (tramp-completion-mode filename) | ||
| 4488 | (tramp-run-real-handler | ||
| 4489 | 'file-exists-p (list filename)) | ||
| 4490 | (tramp-completion-run-real-handler | ||
| 4491 | 'file-exists-p (list filename)))) | ||
| 4492 | |||
| 4493 | ;; Localname manipulation in case of partial TRAMP file names. | ||
| 4494 | (defun tramp-completion-handle-file-name-directory (file) | ||
| 4495 | "Like `file-name-directory' but aware of TRAMP files." | ||
| 4496 | (if (tramp-completion-mode file) | ||
| 4497 | "/" | ||
| 4498 | (tramp-completion-run-real-handler | ||
| 4499 | 'file-name-directory (list file)))) | ||
| 4500 | |||
| 4501 | ;; Localname manipulation in case of partial TRAMP file names. | ||
| 4502 | (defun tramp-completion-handle-file-name-nondirectory (file) | ||
| 4503 | "Like `file-name-nondirectory' but aware of TRAMP files." | ||
| 4504 | (substring | ||
| 4505 | file (length (tramp-completion-handle-file-name-directory file)))) | ||
| 4506 | |||
| 4507 | ;; Method, host name and user name completion. | 4478 | ;; Method, host name and user name completion. |
| 4508 | ;; `tramp-completion-dissect-file-name' returns a list of | 4479 | ;; `tramp-completion-dissect-file-name' returns a list of |
| 4509 | ;; tramp-file-name structures. For all of them we return possible completions. | 4480 | ;; tramp-file-name structures. For all of them we return possible completions. |
| 4481 | ;;;###autoload | ||
| 4510 | (defun tramp-completion-handle-file-name-all-completions (filename directory) | 4482 | (defun tramp-completion-handle-file-name-all-completions (filename directory) |
| 4511 | "Like `file-name-all-completions' for partial tramp files." | 4483 | "Like `file-name-all-completions' for partial tramp files." |
| 4512 | 4484 | ||
| @@ -4561,7 +4533,8 @@ necessary anymore." | |||
| 4561 | ;; unify list, remove nil elements | 4533 | ;; unify list, remove nil elements |
| 4562 | (while result | 4534 | (while result |
| 4563 | (let ((car (car result))) | 4535 | (let ((car (car result))) |
| 4564 | (when car (add-to-list 'result1 car)) | 4536 | (when car (add-to-list |
| 4537 | 'result1 (substring car (length directory)))) | ||
| 4565 | (setq result (cdr result)))) | 4538 | (setq result (cdr result)))) |
| 4566 | 4539 | ||
| 4567 | ;; Complete local parts | 4540 | ;; Complete local parts |
| @@ -4580,6 +4553,7 @@ necessary anymore." | |||
| 4580 | (setq tramp-completion-mode nil))) | 4553 | (setq tramp-completion-mode nil))) |
| 4581 | 4554 | ||
| 4582 | ;; Method, host name and user name completion for a file. | 4555 | ;; Method, host name and user name completion for a file. |
| 4556 | ;;;###autoload | ||
| 4583 | (defun tramp-completion-handle-file-name-completion (filename directory) | 4557 | (defun tramp-completion-handle-file-name-completion (filename directory) |
| 4584 | "Like `file-name-completion' for tramp files." | 4558 | "Like `file-name-completion' for tramp files." |
| 4585 | (try-completion filename | 4559 | (try-completion filename |
| @@ -4706,8 +4680,7 @@ remote host and localname (filename on remote host)." | |||
| 4706 | (lambda (method) | 4680 | (lambda (method) |
| 4707 | (and method | 4681 | (and method |
| 4708 | (string-match (concat "^" (regexp-quote partial-method)) method) | 4682 | (string-match (concat "^" (regexp-quote partial-method)) method) |
| 4709 | ;; we must remove leading "/". | 4683 | (tramp-make-tramp-file-name nil method nil nil nil))) |
| 4710 | (substring (tramp-make-tramp-file-name nil method nil nil nil) 1))) | ||
| 4711 | (delete "multi" (mapcar 'car tramp-methods)))) | 4684 | (delete "multi" (mapcar 'car tramp-methods)))) |
| 4712 | 4685 | ||
| 4713 | ;; Compares partial user and host names with possible completions. | 4686 | ;; Compares partial user and host names with possible completions. |
| @@ -4740,8 +4713,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST." | |||
| 4740 | host nil))) | 4713 | host nil))) |
| 4741 | 4714 | ||
| 4742 | (unless (zerop (+ (length user) (length host))) | 4715 | (unless (zerop (+ (length user) (length host))) |
| 4743 | ;; we must remove leading "/". | 4716 | (tramp-make-tramp-file-name nil method user host nil))) |
| 4744 | (substring (tramp-make-tramp-file-name nil method user host nil) 1))) | ||
| 4745 | 4717 | ||
| 4746 | (defun tramp-parse-rhosts (filename) | 4718 | (defun tramp-parse-rhosts (filename) |
| 4747 | "Return a list of (user host) tuples allowed to access. | 4719 | "Return a list of (user host) tuples allowed to access. |
| @@ -4960,15 +4932,6 @@ User may be nil." | |||
| 4960 | (forward-line 1) | 4932 | (forward-line 1) |
| 4961 | result)) | 4933 | result)) |
| 4962 | 4934 | ||
| 4963 | (defun tramp-completion-handle-expand-file-name (name &optional dir) | ||
| 4964 | "Like `expand-file-name' for tramp files." | ||
| 4965 | (let ((fullname (concat (or dir default-directory) name))) | ||
| 4966 | (if (tramp-completion-mode fullname) | ||
| 4967 | (tramp-run-real-handler | ||
| 4968 | 'expand-file-name (list name dir)) | ||
| 4969 | (tramp-completion-run-real-handler | ||
| 4970 | 'expand-file-name (list name dir))))) | ||
| 4971 | |||
| 4972 | ;;; Internal Functions: | 4935 | ;;; Internal Functions: |
| 4973 | 4936 | ||
| 4974 | (defun tramp-maybe-send-perl-script (multi-method method user host script name) | 4937 | (defun tramp-maybe-send-perl-script (multi-method method user host script name) |
| @@ -7629,7 +7592,7 @@ Therefore, the contents of files might be included in the debug buffer(s).") | |||
| 7629 | (defun tramp-unload-tramp () | 7592 | (defun tramp-unload-tramp () |
| 7630 | (interactive) | 7593 | (interactive) |
| 7631 | ;; When Tramp is not loaded yet, its autoloads are still active. | 7594 | ;; When Tramp is not loaded yet, its autoloads are still active. |
| 7632 | (tramp-unload-file-name-handler-alist) | 7595 | (tramp-unload-file-name-handlers) |
| 7633 | ;; ange-ftp settings must be enabled. | 7596 | ;; ange-ftp settings must be enabled. |
| 7634 | (when (functionp 'tramp-ftp-enable-ange-ftp) | 7597 | (when (functionp 'tramp-ftp-enable-ange-ftp) |
| 7635 | (funcall (symbol-function 'tramp-ftp-enable-ange-ftp))) | 7598 | (funcall (symbol-function 'tramp-ftp-enable-ange-ftp))) |
diff --git a/lisp/pcvs-defs.el b/lisp/pcvs-defs.el index 8f7de913261..127a550b28c 100644 --- a/lisp/pcvs-defs.el +++ b/lisp/pcvs-defs.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: pcl-cvs | 7 | ;; Keywords: pcl-cvs |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/pcvs-info.el b/lisp/pcvs-info.el index 7d1a11ccb68..4aaa5add58d 100644 --- a/lisp/pcvs-info.el +++ b/lisp/pcvs-info.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: pcl-cvs | 7 | ;; Keywords: pcl-cvs |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el index 892dc962767..0193939606c 100644 --- a/lisp/pcvs-parse.el +++ b/lisp/pcvs-parse.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: pcl-cvs | 7 | ;; Keywords: pcl-cvs |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el index b04f3c121a1..cb18fc83d59 100644 --- a/lisp/pcvs-util.el +++ b/lisp/pcvs-util.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 3 | ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: pcl-cvs | 7 | ;; Keywords: pcl-cvs |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 7ddd9212f6c..e31a94030c3 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el | |||
| @@ -829,7 +829,7 @@ in the grammar's actions and semantic predicates, see | |||
| 829 | `antlr-font-lock-maximum-decoration'.") | 829 | `antlr-font-lock-maximum-decoration'.") |
| 830 | 830 | ||
| 831 | (defvar antlr-default-face 'antlr-default) | 831 | (defvar antlr-default-face 'antlr-default) |
| 832 | (defface antlr-default nil | 832 | (defface antlr-default '((t nil)) |
| 833 | "Face to prevent strings from language dependent highlighting. | 833 | "Face to prevent strings from language dependent highlighting. |
| 834 | Do not change." | 834 | Do not change." |
| 835 | :group 'antlr) | 835 | :group 'antlr) |
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el index b79237adba7..ebb532a3525 100644 --- a/lisp/progmodes/asm-mode.el +++ b/lisp/progmodes/asm-mode.el | |||
| @@ -62,9 +62,9 @@ | |||
| 62 | 62 | ||
| 63 | (defvar asm-mode-syntax-table | 63 | (defvar asm-mode-syntax-table |
| 64 | (let ((st (make-syntax-table))) | 64 | (let ((st (make-syntax-table))) |
| 65 | (modify-syntax-entry ?\n ">" st) | 65 | (modify-syntax-entry ?\n "> b" st) |
| 66 | (modify-syntax-entry ?/ ". 14b" st) | 66 | (modify-syntax-entry ?/ ". 124b" st) |
| 67 | (modify-syntax-entry ?* ". 23b" st) | 67 | (modify-syntax-entry ?* ". 23" st) |
| 68 | st) | 68 | st) |
| 69 | "Syntax table used while in Asm mode.") | 69 | "Syntax table used while in Asm mode.") |
| 70 | 70 | ||
| @@ -136,14 +136,14 @@ Special commands: | |||
| 136 | (use-local-map (nconc (make-sparse-keymap) asm-mode-map)) | 136 | (use-local-map (nconc (make-sparse-keymap) asm-mode-map)) |
| 137 | (local-set-key (vector asm-comment-char) 'asm-comment) | 137 | (local-set-key (vector asm-comment-char) 'asm-comment) |
| 138 | (set-syntax-table (make-syntax-table asm-mode-syntax-table)) | 138 | (set-syntax-table (make-syntax-table asm-mode-syntax-table)) |
| 139 | (modify-syntax-entry asm-comment-char "<") | 139 | (modify-syntax-entry asm-comment-char "< b") |
| 140 | 140 | ||
| 141 | (make-local-variable 'comment-start) | 141 | (make-local-variable 'comment-start) |
| 142 | (setq comment-start (string asm-comment-char)) | 142 | (setq comment-start (string asm-comment-char)) |
| 143 | (make-local-variable 'comment-add) | 143 | (make-local-variable 'comment-add) |
| 144 | (setq comment-add 1) | 144 | (setq comment-add 1) |
| 145 | (make-local-variable 'comment-start-skip) | 145 | (make-local-variable 'comment-start-skip) |
| 146 | (setq comment-start-skip "\\(?:\\s<+\\|/\\*+\\)[ \t]*") | 146 | (setq comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*") |
| 147 | (make-local-variable 'comment-end-skip) | 147 | (make-local-variable 'comment-end-skip) |
| 148 | (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)") | 148 | (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)") |
| 149 | (make-local-variable 'comment-end) | 149 | (make-local-variable 'comment-end) |
diff --git a/lisp/progmodes/cc-subword.el b/lisp/progmodes/cc-subword.el index 6ba76708ebf..72227e33290 100644 --- a/lisp/progmodes/cc-subword.el +++ b/lisp/progmodes/cc-subword.el | |||
| @@ -91,8 +91,8 @@ | |||
| 91 | ;; Don't complain about the `define-minor-mode' form if it isn't defined. | 91 | ;; Don't complain about the `define-minor-mode' form if it isn't defined. |
| 92 | (cc-bytecomp-defvar c-subword-mode) | 92 | (cc-bytecomp-defvar c-subword-mode) |
| 93 | 93 | ||
| 94 | ;;; Autoload directives must be on the top level, so we construct an | 94 | ;; Autoload directives must be on the top level, so we construct an |
| 95 | ;;; autoload form instead. | 95 | ;; autoload form instead. |
| 96 | ;;;###autoload (autoload 'c-subword-mode "cc-subword" "Mode enabling subword movement and editing keys." t) | 96 | ;;;###autoload (autoload 'c-subword-mode "cc-subword" "Mode enabling subword movement and editing keys." t) |
| 97 | 97 | ||
| 98 | (if (not (fboundp 'define-minor-mode)) | 98 | (if (not (fboundp 'define-minor-mode)) |
| @@ -107,36 +107,19 @@ telling us which (X)Emacs version you're using." | |||
| 107 | 107 | ||
| 108 | (defvar c-subword-mode-map | 108 | (defvar c-subword-mode-map |
| 109 | (let ((map (make-sparse-keymap))) | 109 | (let ((map (make-sparse-keymap))) |
| 110 | (substitute-key-definition 'forward-word | 110 | (dolist (cmd '(forward-word backward-word mark-word |
| 111 | 'c-forward-subword | 111 | kill-word backward-kill-word |
| 112 | map global-map) | 112 | transpose-words |
| 113 | (substitute-key-definition 'backward-word | 113 | capitalize-word upcase-word downcase-word)) |
| 114 | 'c-backward-subword | 114 | (let ((othercmd (let ((name (symbol-name cmd))) |
| 115 | map global-map) | 115 | (string-match "\\(.*-\\)\\(word.*\\)" name) |
| 116 | (substitute-key-definition 'mark-word | 116 | (intern (concat "c-" |
| 117 | 'c-mark-subword | 117 | (match-string 1 name) |
| 118 | map global-map) | 118 | "sub" |
| 119 | 119 | (match-string 2 name)))))) | |
| 120 | (substitute-key-definition 'kill-word | 120 | (if (fboundp 'command-remapping) |
| 121 | 'c-kill-subword | 121 | (define-key map (vector 'remap cmd) othercmd) |
| 122 | map global-map) | 122 | (substitute-key-definition cmd othercmd map global-map)))) |
| 123 | (substitute-key-definition 'backward-kill-word | ||
| 124 | 'c-backward-kill-subword | ||
| 125 | map global-map) | ||
| 126 | |||
| 127 | (substitute-key-definition 'transpose-words | ||
| 128 | 'c-transpose-subwords | ||
| 129 | map global-map) | ||
| 130 | |||
| 131 | (substitute-key-definition 'capitalize-word | ||
| 132 | 'c-capitalize-subword | ||
| 133 | map global-map) | ||
| 134 | (substitute-key-definition 'upcase-word | ||
| 135 | 'c-upcase-subword | ||
| 136 | map global-map) | ||
| 137 | (substitute-key-definition 'downcase-word | ||
| 138 | 'c-downcase-subword | ||
| 139 | map global-map) | ||
| 140 | map) | 123 | map) |
| 141 | "Keymap used in command `c-subword-mode' minor mode.") | 124 | "Keymap used in command `c-subword-mode' minor mode.") |
| 142 | 125 | ||
| @@ -308,5 +291,5 @@ Optional argument ARG is the same as for `upcase-word'." | |||
| 308 | 291 | ||
| 309 | (cc-provide 'cc-subword) | 292 | (cc-provide 'cc-subword) |
| 310 | 293 | ||
| 311 | ;;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3 | 294 | ;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3 |
| 312 | ;;; cc-subword.el ends here | 295 | ;;; cc-subword.el ends here |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 6afa3f29348..0aba9d42b84 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | (defgroup grep nil | 37 | (defgroup grep nil |
| 38 | "Run compiler as inferior of Emacs, parse error messages." | 38 | "Run grep as inferior of Emacs, parse error messages." |
| 39 | :group 'tools | 39 | :group 'tools |
| 40 | :group 'processes) | 40 | :group 'processes) |
| 41 | 41 | ||
| @@ -48,23 +48,6 @@ | |||
| 48 | :version "22.1" | 48 | :version "22.1" |
| 49 | :group 'grep) | 49 | :group 'grep) |
| 50 | 50 | ||
| 51 | (defcustom grep-auto-highlight t | ||
| 52 | "*Specify how many grep matches to highlight (and parse) initially. | ||
| 53 | \(Highlighting applies to an grep match when the mouse is over it.) | ||
| 54 | If this is a number N, all grep matches in the first N lines | ||
| 55 | are highlighted and parsed as soon as they arrive in Emacs. | ||
| 56 | If t, highlight and parse the whole grep output as soon as it arrives. | ||
| 57 | If nil, don't highlight or parse any of the grep buffer until you try to | ||
| 58 | move to the error messages. | ||
| 59 | |||
| 60 | Those grep matches which are not parsed and highlighted initially | ||
| 61 | will be parsed and highlighted as soon as you try to move to them." | ||
| 62 | :type '(choice (const :tag "All" t) | ||
| 63 | (const :tag "None" nil) | ||
| 64 | (integer :tag "First N lines")) | ||
| 65 | :version "22.1" | ||
| 66 | :group 'grep) | ||
| 67 | |||
| 68 | (defcustom grep-highlight-matches 'auto-detect | 51 | (defcustom grep-highlight-matches 'auto-detect |
| 69 | "If t, use special markers to highlight grep matches. | 52 | "If t, use special markers to highlight grep matches. |
| 70 | 53 | ||
| @@ -108,6 +91,20 @@ call that function before using this variable in your program." | |||
| 108 | (const :tag "Not Set" nil)) | 91 | (const :tag "Not Set" nil)) |
| 109 | :group 'grep) | 92 | :group 'grep) |
| 110 | 93 | ||
| 94 | (defcustom grep-template nil | ||
| 95 | "The default command to run for \\[lgrep]. | ||
| 96 | The default value of this variable is set up by `grep-compute-defaults'; | ||
| 97 | call that function before using this variable in your program. | ||
| 98 | The following place holders should be present in the string: | ||
| 99 | <C> - place to put -i if case insensitive grep. | ||
| 100 | <F> - file names and wildcards to search. | ||
| 101 | <R> - the regular expression searched for. | ||
| 102 | <N> - place to insert null-device." | ||
| 103 | :type '(choice string | ||
| 104 | (const :tag "Not Set" nil)) | ||
| 105 | :version "22.1" | ||
| 106 | :group 'grep) | ||
| 107 | |||
| 111 | (defcustom grep-use-null-device 'auto-detect | 108 | (defcustom grep-use-null-device 'auto-detect |
| 112 | "If t, append the value of `null-device' to `grep' commands. | 109 | "If t, append the value of `null-device' to `grep' commands. |
| 113 | This is done to ensure that the output of grep includes the filename of | 110 | This is done to ensure that the output of grep includes the filename of |
| @@ -130,8 +127,8 @@ call that function before using this variable in your program." | |||
| 130 | (const :tag "Not Set" nil)) | 127 | (const :tag "Not Set" nil)) |
| 131 | :group 'grep) | 128 | :group 'grep) |
| 132 | 129 | ||
| 133 | (defcustom grep-tree-command nil | 130 | (defcustom grep-find-template nil |
| 134 | "The default find command for \\[grep-tree]. | 131 | "The default command to run for \\[rgrep]. |
| 135 | The default value of this variable is set up by `grep-compute-defaults'; | 132 | The default value of this variable is set up by `grep-compute-defaults'; |
| 136 | call that function before using this variable in your program. | 133 | call that function before using this variable in your program. |
| 137 | The following place holders should be present in the string: | 134 | The following place holders should be present in the string: |
| @@ -145,27 +142,22 @@ The following place holders should be present in the string: | |||
| 145 | :version "22.1" | 142 | :version "22.1" |
| 146 | :group 'grep) | 143 | :group 'grep) |
| 147 | 144 | ||
| 148 | (defcustom grep-tree-files-aliases '( | 145 | (defcustom grep-files-aliases '( |
| 146 | ("el" . "*.el") | ||
| 149 | ("ch" . "*.[ch]") | 147 | ("ch" . "*.[ch]") |
| 150 | ("c" . "*.c") | 148 | ("c" . "*.c") |
| 151 | ("h" . "*.h") | 149 | ("h" . "*.h") |
| 152 | ("m" . "[Mm]akefile*") | ||
| 153 | ("asm" . "*.[sS]") | 150 | ("asm" . "*.[sS]") |
| 154 | ("all" . "*") | 151 | ("m" . "[Mm]akefile*") |
| 155 | ("el" . "*.el") | 152 | ("l" . "[Cc]hange[Ll]og*") |
| 156 | ) | 153 | ) |
| 157 | "*Alist of aliases for the FILES argument to `grep-tree'." | 154 | "*Alist of aliases for the FILES argument to `lgrep' and `rgrep'." |
| 158 | :type 'alist | 155 | :type 'alist |
| 159 | :group 'grep) | 156 | :group 'grep) |
| 160 | 157 | ||
| 161 | (defcustom grep-tree-ignore-case t | 158 | (defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}") |
| 162 | "*If non-nil, `grep-tree' ignores case in matches." | 159 | "*List of names of sub-directories which `rgrep' shall not recurse into." |
| 163 | :type 'boolean | 160 | :type '(repeat string) |
| 164 | :group 'grep) | ||
| 165 | |||
| 166 | (defcustom grep-tree-ignore-CVS-directories t | ||
| 167 | "*If non-nil, `grep-tree' does no recurse into CVS directories." | ||
| 168 | :type 'boolean | ||
| 169 | :group 'grep) | 161 | :group 'grep) |
| 170 | 162 | ||
| 171 | (defcustom grep-error-screen-columns nil | 163 | (defcustom grep-error-screen-columns nil |
| @@ -208,6 +200,8 @@ See `compilation-error-screen-columns'" | |||
| 208 | '("Compile..." . compile)) | 200 | '("Compile..." . compile)) |
| 209 | (define-key map [menu-bar grep compilation-grep] | 201 | (define-key map [menu-bar grep compilation-grep] |
| 210 | '("Another grep..." . grep)) | 202 | '("Another grep..." . grep)) |
| 203 | (define-key map [menu-bar grep compilation-grep-find] | ||
| 204 | '("Recursive grep..." . grep-find)) | ||
| 211 | (define-key map [menu-bar grep compilation-recompile] | 205 | (define-key map [menu-bar grep compilation-recompile] |
| 212 | '("Repeat grep" . recompile)) | 206 | '("Repeat grep" . recompile)) |
| 213 | (define-key map [menu-bar grep compilation-separator2] | 207 | (define-key map [menu-bar grep compilation-separator2] |
| @@ -353,6 +347,11 @@ This variable's value takes effect when `grep-compute-defaults' is called.") | |||
| 353 | ;;;###autoload | 347 | ;;;###autoload |
| 354 | (defvar grep-find-history nil) | 348 | (defvar grep-find-history nil) |
| 355 | 349 | ||
| 350 | ;; History of lgrep and rgrep regexp and files args. | ||
| 351 | (defvar grep-regexp-history nil) | ||
| 352 | (defvar grep-files-history '("ch" "el")) | ||
| 353 | |||
| 354 | |||
| 356 | ;;;###autoload | 355 | ;;;###autoload |
| 357 | (defun grep-process-setup () | 356 | (defun grep-process-setup () |
| 358 | "Setup compilation variables and buffer for `grep'. | 357 | "Setup compilation variables and buffer for `grep'. |
| @@ -378,6 +377,12 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 378 | (cons msg code)))) | 377 | (cons msg code)))) |
| 379 | (run-hooks 'grep-setup-hook)) | 378 | (run-hooks 'grep-setup-hook)) |
| 380 | 379 | ||
| 380 | (defun grep-probe (command args &optional func result) | ||
| 381 | (equal (condition-case nil | ||
| 382 | (apply (or func 'call-process) command args) | ||
| 383 | (error nil)) | ||
| 384 | (or result 0))) | ||
| 385 | |||
| 381 | ;;;###autoload | 386 | ;;;###autoload |
| 382 | (defun grep-compute-defaults () | 387 | (defun grep-compute-defaults () |
| 383 | (unless (or (not grep-use-null-device) (eq grep-use-null-device t)) | 388 | (unless (or (not grep-use-null-device) (eq grep-use-null-device t)) |
| @@ -385,73 +390,67 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 385 | (with-temp-buffer | 390 | (with-temp-buffer |
| 386 | (let ((hello-file (expand-file-name "HELLO" data-directory))) | 391 | (let ((hello-file (expand-file-name "HELLO" data-directory))) |
| 387 | (not | 392 | (not |
| 388 | (and (equal (condition-case nil | 393 | (and (if grep-command |
| 389 | (if grep-command | 394 | ;; `grep-command' is already set, so |
| 390 | ;; `grep-command' is already set, so | 395 | ;; use that for testing. |
| 391 | ;; use that for testing. | 396 | (grep-probe grep-command |
| 392 | (call-process-shell-command | 397 | `(nil t nil "^English" ,hello-file) |
| 393 | grep-command nil t nil | 398 | #'call-process-shell-command) |
| 394 | "^English" hello-file) | 399 | ;; otherwise use `grep-program' |
| 395 | ;; otherwise use `grep-program' | 400 | (grep-probe grep-program |
| 396 | (call-process grep-program nil t nil | 401 | `(nil t nil "-nH" "^English" ,hello-file))) |
| 397 | "-nH" "^English" hello-file)) | ||
| 398 | (error nil)) | ||
| 399 | 0) | ||
| 400 | (progn | 402 | (progn |
| 401 | (goto-char (point-min)) | 403 | (goto-char (point-min)) |
| 402 | (looking-at | 404 | (looking-at |
| 403 | (concat (regexp-quote hello-file) | 405 | (concat (regexp-quote hello-file) |
| 404 | ":[0-9]+:English"))))))))) | 406 | ":[0-9]+:English"))))))))) |
| 405 | (unless grep-command | 407 | (unless (and grep-command grep-find-command |
| 406 | (setq grep-command | 408 | grep-template grep-find-template) |
| 407 | (let ((required-options (if grep-use-null-device "-n" "-nH"))) | 409 | (let ((grep-options |
| 408 | (if (equal (condition-case nil ; in case "grep" isn't in exec-path | 410 | (concat (if grep-use-null-device "-n" "-nH") |
| 409 | (call-process grep-program nil nil nil | 411 | (if (grep-probe grep-program |
| 410 | "-e" "foo" null-device) | 412 | `(nil nil nil "-e" "foo" ,null-device) |
| 411 | (error nil)) | 413 | nil 1) |
| 412 | 1) | 414 | " -e")))) |
| 413 | (format "%s %s -e " grep-program required-options) | 415 | (unless grep-command |
| 414 | (format "%s %s " grep-program required-options))))) | 416 | (setq grep-command |
| 415 | (unless grep-find-use-xargs | 417 | (format "%s %s " grep-program grep-options))) |
| 416 | (setq grep-find-use-xargs | 418 | (unless grep-template |
| 417 | (if (and | 419 | (setq grep-template |
| 418 | (equal (call-process "find" nil nil nil | 420 | (format "%s <C> %s <R> <F>" grep-program grep-options))) |
| 419 | null-device "-print0") | 421 | (unless grep-find-use-xargs |
| 420 | 0) | 422 | (setq grep-find-use-xargs |
| 421 | (equal (call-process "xargs" nil nil nil | 423 | (if (and |
| 422 | "-0" "-e" "echo") | 424 | (grep-probe find-program `(nil nil nil ,null-device "-print0")) |
| 423 | 0)) | 425 | (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo"))) |
| 424 | 'gnu))) | 426 | 'gnu))) |
| 425 | (unless grep-find-command | 427 | (unless grep-find-command |
| 426 | (setq grep-find-command | 428 | (setq grep-find-command |
| 427 | (cond ((eq grep-find-use-xargs 'gnu) | 429 | (cond ((eq grep-find-use-xargs 'gnu) |
| 428 | (format "%s . -type f -print0 | xargs -0 -e %s" | 430 | (format "%s . -type f -print0 | xargs -0 -e %s" |
| 429 | find-program grep-command)) | 431 | find-program grep-command)) |
| 430 | (grep-find-use-xargs | 432 | (grep-find-use-xargs |
| 431 | (format "%s . -type f -print | xargs %s" | 433 | (format "%s . -type f -print | xargs %s" |
| 432 | find-program grep-command)) | 434 | find-program grep-command)) |
| 433 | (t (cons (format "%s . -type f -exec %s {} %s \\;" | 435 | (t (cons (format "%s . -type f -exec %s {} %s \\;" |
| 434 | find-program grep-command null-device) | 436 | find-program grep-command null-device) |
| 435 | (+ 22 (length grep-command))))))) | 437 | (+ 22 (length grep-command))))))) |
| 436 | (unless grep-tree-command | 438 | (unless grep-find-template |
| 437 | (setq grep-tree-command | 439 | (setq grep-find-template |
| 438 | (let* ((glen (length grep-program)) | 440 | (let ((gcmd (format "%s <C> %s <R>" |
| 439 | (gcmd (concat grep-program " <C>" (substring grep-command glen)))) | 441 | grep-program grep-options))) |
| 440 | (cond ((eq grep-find-use-xargs 'gnu) | 442 | (cond ((eq grep-find-use-xargs 'gnu) |
| 441 | (format "%s <D> <X> -type f <F> -print0 | xargs -0 -e %s <R>" | 443 | (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s" |
| 442 | find-program gcmd)) | 444 | find-program gcmd)) |
| 443 | (grep-find-use-xargs | 445 | (grep-find-use-xargs |
| 444 | (format "%s <D> <X> -type f <F> -print | xargs %s <R>" | 446 | (format "%s . <X> -type f <F> -print | xargs %s" |
| 445 | find-program gcmd)) | 447 | find-program gcmd)) |
| 446 | (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;" | 448 | (t (format "%s . <X> -type f <F> -exec %s {} %s \\;" |
| 447 | find-program gcmd null-device)))))) | 449 | find-program gcmd null-device)))))))) |
| 448 | (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) | 450 | (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) |
| 449 | (setq grep-highlight-matches | 451 | (setq grep-highlight-matches |
| 450 | (with-temp-buffer | 452 | (with-temp-buffer |
| 451 | (and (equal (condition-case nil | 453 | (and (grep-probe grep-program '(nil t nil "--help")) |
| 452 | (call-process grep-program nil t nil "--help") | ||
| 453 | (error nil)) | ||
| 454 | 0) | ||
| 455 | (progn | 454 | (progn |
| 456 | (goto-char (point-min)) | 455 | (goto-char (point-min)) |
| 457 | (search-forward "--color" nil t)) | 456 | (search-forward "--color" nil t)) |
| @@ -487,8 +486,22 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 487 | (file-name-extension buffer-file-name)))) | 486 | (file-name-extension buffer-file-name)))) |
| 488 | (replace-match tag-default t t grep-default 1)))) | 487 | (replace-match tag-default t t grep-default 1)))) |
| 489 | 488 | ||
| 489 | |||
| 490 | ;;;###autoload | 490 | ;;;###autoload |
| 491 | (defun grep (command-args &optional highlight-regexp) | 491 | (define-compilation-mode grep-mode "Grep" |
| 492 | "Sets `grep-last-buffer' and `compilation-window-height'." | ||
| 493 | (setq grep-last-buffer (current-buffer)) | ||
| 494 | (set (make-local-variable 'compilation-error-face) | ||
| 495 | grep-hit-face) | ||
| 496 | (set (make-local-variable 'compilation-error-regexp-alist) | ||
| 497 | grep-regexp-alist) | ||
| 498 | (set (make-local-variable 'compilation-process-setup-function) | ||
| 499 | 'grep-process-setup) | ||
| 500 | (set (make-local-variable 'compilation-disable-input) t)) | ||
| 501 | |||
| 502 | |||
| 503 | ;;;###autoload | ||
| 504 | (defun grep (command-args) | ||
| 492 | "Run grep, with user-specified args, and collect output in a buffer. | 505 | "Run grep, with user-specified args, and collect output in a buffer. |
| 493 | While grep runs asynchronously, you can use \\[next-error] (M-x next-error), | 506 | While grep runs asynchronously, you can use \\[next-error] (M-x next-error), |
| 494 | or \\<grep-mode-map>\\[compile-goto-error] in the grep \ | 507 | or \\<grep-mode-map>\\[compile-goto-error] in the grep \ |
| @@ -501,15 +514,10 @@ easily repeat a grep command. | |||
| 501 | A prefix argument says to default the argument based upon the current | 514 | A prefix argument says to default the argument based upon the current |
| 502 | tag the cursor is over, substituting it into the last grep command | 515 | tag the cursor is over, substituting it into the last grep command |
| 503 | in the grep command history (or into `grep-command' | 516 | in the grep command history (or into `grep-command' |
| 504 | if that history list is empty). | 517 | if that history list is empty)." |
| 505 | |||
| 506 | If specified, optional second arg HIGHLIGHT-REGEXP is the regexp to | ||
| 507 | temporarily highlight in visited source lines." | ||
| 508 | (interactive | 518 | (interactive |
| 509 | (progn | 519 | (progn |
| 510 | (unless (and grep-command | 520 | (grep-compute-defaults) |
| 511 | (or (not grep-use-null-device) (eq grep-use-null-device t))) | ||
| 512 | (grep-compute-defaults)) | ||
| 513 | (let ((default (grep-default-command))) | 521 | (let ((default (grep-default-command))) |
| 514 | (list (read-from-minibuffer "Run grep (like this): " | 522 | (list (read-from-minibuffer "Run grep (like this): " |
| 515 | (if current-prefix-arg | 523 | (if current-prefix-arg |
| @@ -522,19 +530,8 @@ temporarily highlight in visited source lines." | |||
| 522 | (compilation-start (if (and grep-use-null-device null-device) | 530 | (compilation-start (if (and grep-use-null-device null-device) |
| 523 | (concat command-args " " null-device) | 531 | (concat command-args " " null-device) |
| 524 | command-args) | 532 | command-args) |
| 525 | 'grep-mode nil highlight-regexp)) | 533 | 'grep-mode)) |
| 526 | 534 | ||
| 527 | ;;;###autoload | ||
| 528 | (define-compilation-mode grep-mode "Grep" | ||
| 529 | "Sets `grep-last-buffer' and `compilation-window-height'." | ||
| 530 | (setq grep-last-buffer (current-buffer)) | ||
| 531 | (set (make-local-variable 'compilation-error-face) | ||
| 532 | grep-hit-face) | ||
| 533 | (set (make-local-variable 'compilation-error-regexp-alist) | ||
| 534 | grep-regexp-alist) | ||
| 535 | (set (make-local-variable 'compilation-process-setup-function) | ||
| 536 | 'grep-process-setup) | ||
| 537 | (set (make-local-variable 'compilation-disable-input) t)) | ||
| 538 | 535 | ||
| 539 | ;;;###autoload | 536 | ;;;###autoload |
| 540 | (defun grep-find (command-args) | 537 | (defun grep-find (command-args) |
| @@ -547,9 +544,7 @@ This command uses a special history list for its arguments, so you can | |||
| 547 | easily repeat a find command." | 544 | easily repeat a find command." |
| 548 | (interactive | 545 | (interactive |
| 549 | (progn | 546 | (progn |
| 550 | (unless (and grep-command | 547 | (grep-compute-defaults) |
| 551 | (or (not grep-use-null-device) (eq grep-use-null-device t))) | ||
| 552 | (grep-compute-defaults)) | ||
| 553 | (if grep-find-command | 548 | (if grep-find-command |
| 554 | (list (read-from-minibuffer "Run find (like this): " | 549 | (list (read-from-minibuffer "Run find (like this): " |
| 555 | grep-find-command nil nil | 550 | grep-find-command nil nil |
| @@ -565,84 +560,190 @@ easily repeat a find command." | |||
| 565 | ;;;###autoload | 560 | ;;;###autoload |
| 566 | (defalias 'find-grep 'grep-find) | 561 | (defalias 'find-grep 'grep-find) |
| 567 | 562 | ||
| 568 | (defun grep-expand-command-macros (command &optional regexp files dir excl case-fold) | 563 | |
| 569 | "Patch grep COMMAND replacing <D>, etc." | 564 | ;; User-friendly interactive API. |
| 570 | (setq command | 565 | |
| 571 | (replace-regexp-in-string "<D>" | 566 | (defconst grep-expand-keywords |
| 572 | (or dir ".") command t t)) | 567 | '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i")) |
| 573 | (setq command | 568 | ("<D>" . dir) |
| 574 | (replace-regexp-in-string "<X>" | 569 | ("<F>" . files) |
| 575 | (or excl "") command t t)) | 570 | ("<N>" . null-device) |
| 576 | (setq command | 571 | ("<X>" . excl) |
| 577 | (replace-regexp-in-string "<F>" | 572 | ("<R>" . (shell-quote-argument (or regexp "")))) |
| 578 | (or files "") command t t)) | 573 | "List of substitutions performed by `grep-expand-template'. |
| 579 | (setq command | 574 | If car of an element matches, the cdr is evalled in to get the |
| 580 | (replace-regexp-in-string "<C>" | 575 | substitution string. Note dynamic scoping of variables.") |
| 581 | (if case-fold "-i" "") command t t)) | 576 | |
| 582 | (setq command | 577 | (defun grep-expand-template (template &optional regexp files dir excl) |
| 583 | (replace-regexp-in-string "<R>" | 578 | "Patch grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>." |
| 584 | (or regexp "") command t t)) | 579 | (let ((command template) |
| 585 | command) | 580 | (cf case-fold-search) |
| 586 | 581 | (case-fold-search nil)) | |
| 587 | (defvar grep-tree-last-regexp "") | 582 | (dolist (kw grep-expand-keywords command) |
| 588 | (defvar grep-tree-last-files (car (car grep-tree-files-aliases))) | 583 | (if (string-match (car kw) command) |
| 584 | (setq command | ||
| 585 | (replace-match | ||
| 586 | (or (if (symbolp (cdr kw)) | ||
| 587 | (eval (cdr kw)) | ||
| 588 | (save-match-data (eval (cdr kw)))) | ||
| 589 | "") | ||
| 590 | t t command)))))) | ||
| 591 | |||
| 592 | (defun grep-read-regexp () | ||
| 593 | "Read regexp arg for interactive grep." | ||
| 594 | (let ((default | ||
| 595 | (or (funcall (or find-tag-default-function | ||
| 596 | (get major-mode 'find-tag-default-function) | ||
| 597 | 'find-tag-default)) | ||
| 598 | ""))) | ||
| 599 | (read-string | ||
| 600 | (concat "Search for" | ||
| 601 | (if (and default (> (length default) 0)) | ||
| 602 | (format " (default %s): " default) ": ")) | ||
| 603 | nil 'grep-regexp-history default))) | ||
| 604 | |||
| 605 | (defun grep-read-files (regexp) | ||
| 606 | "Read files arg for interactive grep." | ||
| 607 | (let* ((bn (or (buffer-file-name) (buffer-name))) | ||
| 608 | (fn (and bn | ||
| 609 | (stringp bn) | ||
| 610 | (file-name-nondirectory bn))) | ||
| 611 | (default | ||
| 612 | (or (and fn | ||
| 613 | (let ((aliases grep-files-aliases) | ||
| 614 | alias) | ||
| 615 | (while aliases | ||
| 616 | (setq alias (car aliases) | ||
| 617 | aliases (cdr aliases)) | ||
| 618 | (if (string-match (wildcard-to-regexp (cdr alias)) fn) | ||
| 619 | (setq aliases nil) | ||
| 620 | (setq alias nil))) | ||
| 621 | (cdr alias))) | ||
| 622 | (and fn | ||
| 623 | (let ((ext (file-name-extension fn))) | ||
| 624 | (and ext (concat "*." ext)))))) | ||
| 625 | (files (read-string | ||
| 626 | (concat "Search for \"" regexp | ||
| 627 | "\" in files" | ||
| 628 | (if default (concat " (default " default ")")) | ||
| 629 | ": ") | ||
| 630 | nil 'grep-files-history default))) | ||
| 631 | (and files | ||
| 632 | (or (cdr (assoc files grep-files-aliases)) | ||
| 633 | files)))) | ||
| 589 | 634 | ||
| 590 | ;;;###autoload | 635 | ;;;###autoload |
| 591 | (defun grep-tree (regexp files dir &optional subdirs) | 636 | (defun lgrep (regexp &optional files) |
| 592 | "Grep for REGEXP in FILES in directory tree rooted at DIR. | 637 | "Run grep, searching for REGEXP in FILES in current directory. |
| 593 | Collect output in a buffer. | ||
| 594 | Interactively, prompt separately for each search parameter. | ||
| 595 | With prefix arg, reuse previous REGEXP. | ||
| 596 | The search is limited to file names matching shell pattern FILES. | 638 | The search is limited to file names matching shell pattern FILES. |
| 597 | FILES may use abbreviations defined in `grep-tree-files-aliases', e.g. | 639 | FILES may use abbreviations defined in `grep-files-aliases', e.g. |
| 598 | entering `ch' is equivalent to `*.[ch]'. | 640 | entering `ch' is equivalent to `*.[ch]'. |
| 599 | 641 | ||
| 600 | While find runs asynchronously, you can use the \\[next-error] command | 642 | With \\[universal-argument] prefix, allow user to edit the constructed |
| 601 | to find the text that grep hits refer to. | 643 | shell command line before it is executed. |
| 644 | With two \\[universal-argument] prefixes, edit and run grep shell command. | ||
| 602 | 645 | ||
| 603 | This command uses a special history list for its arguments, so you can | 646 | Collect output in a buffer. While grep runs asynchronously, you |
| 604 | easily repeat a find command. | 647 | can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] |
| 648 | in the grep output buffer, to go to the lines where grep found matches. | ||
| 605 | 649 | ||
| 606 | When used non-interactively, optional arg SUBDIRS limits the search to | 650 | This command shares argument histories with \\[rgrep] and \\[grep]." |
| 607 | those sub directories of DIR." | ||
| 608 | (interactive | 651 | (interactive |
| 609 | (let* ((regexp | 652 | (progn |
| 610 | (if current-prefix-arg | 653 | (grep-compute-defaults) |
| 611 | grep-tree-last-regexp | 654 | (cond |
| 612 | (let* ((default (current-word)) | 655 | ((and grep-command (equal current-prefix-arg '(16))) |
| 613 | (spec (read-string | 656 | (list (read-from-minibuffer "Run: " grep-command |
| 614 | (concat "Search for" | 657 | nil nil 'grep-history) |
| 615 | (if (and default (> (length default) 0)) | 658 | nil)) |
| 616 | (format " (default %s): " default) ": "))))) | 659 | ((not grep-template) |
| 617 | (if (equal spec "") default spec)))) | 660 | (list nil |
| 618 | (files | 661 | (read-string "grep.el: No `grep-template' available. Press RET."))) |
| 619 | (read-string (concat "Search for \"" regexp "\" in files (default " grep-tree-last-files "): "))) | 662 | (t (let* ((regexp (grep-read-regexp)) |
| 620 | (dir | 663 | (files (grep-read-files regexp))) |
| 621 | (read-directory-name "Base directory: " nil default-directory t))) | 664 | (list regexp files)))))) |
| 622 | (list regexp files dir))) | 665 | (when (and (stringp regexp) (> (length regexp) 0)) |
| 623 | (unless grep-tree-command | 666 | (let ((command regexp)) |
| 624 | (grep-compute-defaults)) | 667 | (if (null files) |
| 625 | (unless (and (stringp files) (> (length files) 0)) | 668 | (if (string= command grep-command) |
| 626 | (setq files grep-tree-last-files)) | 669 | (setq command nil)) |
| 627 | (when files | 670 | (setq command (grep-expand-template |
| 628 | (setq grep-tree-last-files files) | 671 | grep-template |
| 629 | (let ((mf (assoc files grep-tree-files-aliases))) | 672 | regexp |
| 630 | (if mf | 673 | files)) |
| 631 | (setq files (cdr mf))))) | 674 | (when command |
| 632 | (let ((command-args (grep-expand-command-macros | 675 | (if (equal current-prefix-arg '(4)) |
| 633 | grep-tree-command | 676 | (setq command |
| 634 | (setq grep-tree-last-regexp regexp) | 677 | (read-from-minibuffer "Confirm: " |
| 635 | (and files (concat "-name '" files "'")) | 678 | command nil nil 'grep-history)) |
| 636 | (if subdirs | 679 | (push command grep-history)))) |
| 637 | (if (stringp subdirs) | 680 | (when command |
| 638 | subdirs | 681 | ;; Setting process-setup-function makes exit-message-function work |
| 639 | (mapconcat 'identity subdirs " ")) | 682 | ;; even when async processes aren't supported. |
| 640 | nil) ;; we change default-directory to dir | 683 | (compilation-start (if (and grep-use-null-device null-device) |
| 641 | (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ") | 684 | (concat command " " null-device) |
| 642 | grep-tree-ignore-case)) | 685 | command) 'grep-mode))))) |
| 643 | (default-directory (file-name-as-directory (expand-file-name dir))) | 686 | |
| 644 | (null-device nil)) ; see grep | 687 | |
| 645 | (grep command-args regexp))) | 688 | ;;;###autoload |
| 689 | (defun rgrep (regexp &optional files dir) | ||
| 690 | "Recusively grep for REGEXP in FILES in directory tree rooted at DIR. | ||
| 691 | The search is limited to file names matching shell pattern FILES. | ||
| 692 | FILES may use abbreviations defined in `grep-files-aliases', e.g. | ||
| 693 | entering `ch' is equivalent to `*.[ch]'. | ||
| 694 | |||
| 695 | With \\[universal-argument] prefix, allow user to edit the constructed | ||
| 696 | shell command line before it is executed. | ||
| 697 | With two \\[universal-argument] prefixes, edit and run grep-find shell command. | ||
| 698 | |||
| 699 | Collect output in a buffer. While find runs asynchronously, you | ||
| 700 | can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] | ||
| 701 | in the grep output buffer, to go to the lines where grep found matches. | ||
| 702 | |||
| 703 | This command shares argument histories with \\[lgrep] and \\[grep-find]." | ||
| 704 | (interactive | ||
| 705 | (progn | ||
| 706 | (grep-compute-defaults) | ||
| 707 | (cond | ||
| 708 | ((and grep-find-command (equal current-prefix-arg '(16))) | ||
| 709 | (list (read-from-minibuffer "Run: " grep-find-command | ||
| 710 | nil nil 'grep-find-history) | ||
| 711 | nil)) | ||
| 712 | ((not grep-find-template) | ||
| 713 | (list nil nil | ||
| 714 | (read-string "grep.el: No `grep-find-template' available. Press RET."))) | ||
| 715 | (t (let* ((regexp (grep-read-regexp)) | ||
| 716 | (files (grep-read-files regexp)) | ||
| 717 | (dir (read-directory-name "Base directory: " | ||
| 718 | nil default-directory t))) | ||
| 719 | (list regexp files dir)))))) | ||
| 720 | (when (and (stringp regexp) (> (length regexp) 0)) | ||
| 721 | (if (null files) | ||
| 722 | (if (not (string= regexp grep-find-command)) | ||
| 723 | (compilation-start regexp 'grep-mode)) | ||
| 724 | (let* ((default-directory (file-name-as-directory (expand-file-name dir))) | ||
| 725 | (command (grep-expand-template | ||
| 726 | grep-find-template | ||
| 727 | regexp | ||
| 728 | (concat "\\( -name " | ||
| 729 | (mapconcat #'shell-quote-argument | ||
| 730 | (split-string files) | ||
| 731 | " -o -name ") | ||
| 732 | " \\)") | ||
| 733 | default-directory | ||
| 734 | (and grep-find-ignored-directories | ||
| 735 | (concat "\\( -path '*/" | ||
| 736 | (mapconcat #'identity | ||
| 737 | grep-find-ignored-directories | ||
| 738 | "' -o -path '*/") | ||
| 739 | "' \\) -prune -o "))))) | ||
| 740 | (when command | ||
| 741 | (if current-prefix-arg | ||
| 742 | (setq command | ||
| 743 | (read-from-minibuffer "Confirm: " | ||
| 744 | command nil nil 'grep-find-history)) | ||
| 745 | (push command grep-find-history)) | ||
| 746 | (compilation-start command 'grep-mode)))))) | ||
| 646 | 747 | ||
| 647 | 748 | ||
| 648 | (provide 'grep) | 749 | (provide 'grep) |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index e1e2b9e28cd..11259aa3965 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -83,6 +83,8 @@ Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb, and b | |||
| 83 | (defvar gud-minor-mode nil) | 83 | (defvar gud-minor-mode nil) |
| 84 | (put 'gud-minor-mode 'permanent-local t) | 84 | (put 'gud-minor-mode 'permanent-local t) |
| 85 | 85 | ||
| 86 | (defvar gud-comint-buffer nil) | ||
| 87 | |||
| 86 | (defvar gud-keep-buffer nil) | 88 | (defvar gud-keep-buffer nil) |
| 87 | 89 | ||
| 88 | (defun gud-symbol (sym &optional soft minor-mode) | 90 | (defun gud-symbol (sym &optional soft minor-mode) |
| @@ -301,13 +303,15 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files." | |||
| 301 | optional doc string DOC. Certain %-escapes in the string arguments | 303 | optional doc string DOC. Certain %-escapes in the string arguments |
| 302 | are interpreted specially if present. These are: | 304 | are interpreted specially if present. These are: |
| 303 | 305 | ||
| 304 | %f name (without directory) of current source file. | 306 | %f -- Name (without directory) of current source file. |
| 305 | %F name (without directory or extension) of current source file. | 307 | %F -- Name (without directory or extension) of current source file. |
| 306 | %d directory of current source file. | 308 | %d -- Directory of current source file. |
| 307 | %l number of current source line | 309 | %l -- Number of current source line. |
| 308 | %e text of the C lvalue or function-call expression surrounding point. | 310 | %e -- Text of the C lvalue or function-call expression surrounding point. |
| 309 | %a text of the hexadecimal address surrounding point | 311 | %a -- Text of the hexadecimal address surrounding point. |
| 310 | %p prefix argument to the command (if any) as a number | 312 | %p -- Prefix argument to the command (if any) as a number. |
| 313 | %c -- Fully qualified class name derived from the expression | ||
| 314 | surrounding point (jdb only). | ||
| 311 | 315 | ||
| 312 | The `current' source file is the file of the current buffer (if | 316 | The `current' source file is the file of the current buffer (if |
| 313 | we're in a C file) or the source file current at the last break or | 317 | we're in a C file) or the source file current at the last break or |
| @@ -444,8 +448,7 @@ required by the caller." | |||
| 444 | (when (or gdb-force-update | 448 | (when (or gdb-force-update |
| 445 | (not (save-excursion | 449 | (not (save-excursion |
| 446 | (goto-char (point-min)) | 450 | (goto-char (point-min)) |
| 447 | (let ((case-fold-search t)) | 451 | (looking-at "Watch Expressions:")))) |
| 448 | (looking-at "Watch Expressions:"))))) | ||
| 449 | (erase-buffer) | 452 | (erase-buffer) |
| 450 | (insert "Watch Expressions:\n") | 453 | (insert "Watch Expressions:\n") |
| 451 | (if gdb-speedbar-auto-raise | 454 | (if gdb-speedbar-auto-raise |
| @@ -740,8 +743,6 @@ To run GDB in text command mode, set `gud-gdb-command-name' to | |||
| 740 | ;; The completion list is constructed by the process filter. | 743 | ;; The completion list is constructed by the process filter. |
| 741 | (defvar gud-gdb-fetched-lines) | 744 | (defvar gud-gdb-fetched-lines) |
| 742 | 745 | ||
| 743 | (defvar gud-comint-buffer nil) | ||
| 744 | |||
| 745 | (defun gud-gdb-complete-command (&optional command a b) | 746 | (defun gud-gdb-complete-command (&optional command a b) |
| 746 | "Perform completion on the GDB command preceding point. | 747 | "Perform completion on the GDB command preceding point. |
| 747 | This is implemented using the GDB `complete' command which isn't | 748 | This is implemented using the GDB `complete' command which isn't |
| @@ -2804,7 +2805,9 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2804 | (let ((insource (not (eq (current-buffer) gud-comint-buffer))) | 2805 | (let ((insource (not (eq (current-buffer) gud-comint-buffer))) |
| 2805 | (frame (or gud-last-frame gud-last-last-frame)) | 2806 | (frame (or gud-last-frame gud-last-last-frame)) |
| 2806 | result) | 2807 | result) |
| 2807 | (while (and str (string-match "\\([^%]*\\)%\\([adeflpc]\\)" str)) | 2808 | (while (and str |
| 2809 | (let ((case-fold-search nil)) | ||
| 2810 | (string-match "\\([^%]*\\)%\\([adefFlpc]\\)" str))) | ||
| 2808 | (let ((key (string-to-char (match-string 2 str))) | 2811 | (let ((key (string-to-char (match-string 2 str))) |
| 2809 | subst) | 2812 | subst) |
| 2810 | (cond | 2813 | (cond |
| @@ -2889,8 +2892,11 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2889 | (set-buffer gud-comint-buffer) | 2892 | (set-buffer gud-comint-buffer) |
| 2890 | (save-restriction | 2893 | (save-restriction |
| 2891 | (widen) | 2894 | (widen) |
| 2892 | (goto-char (process-mark proc)) | 2895 | (if (marker-position gud-delete-prompt-marker) |
| 2893 | (forward-line 0) | 2896 | ;; We get here when printing an expression. |
| 2897 | (goto-char gud-delete-prompt-marker) | ||
| 2898 | (goto-char (process-mark proc)) | ||
| 2899 | (forward-line 0)) | ||
| 2894 | (if (looking-at comint-prompt-regexp) | 2900 | (if (looking-at comint-prompt-regexp) |
| 2895 | (set-marker gud-delete-prompt-marker (point))) | 2901 | (set-marker gud-delete-prompt-marker (point))) |
| 2896 | (if (memq gud-minor-mode '(gdbmi gdba)) | 2902 | (if (memq gud-minor-mode '(gdbmi gdba)) |
| @@ -2911,7 +2917,21 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2911 | (defvar gud-find-expr-function 'gud-find-c-expr) | 2917 | (defvar gud-find-expr-function 'gud-find-c-expr) |
| 2912 | 2918 | ||
| 2913 | (defun gud-find-expr (&rest args) | 2919 | (defun gud-find-expr (&rest args) |
| 2914 | (apply gud-find-expr-function args)) | 2920 | (let ((expr (if (and transient-mark-mode mark-active) |
| 2921 | (buffer-substring (region-beginning) (region-end)) | ||
| 2922 | (apply gud-find-expr-function args)))) | ||
| 2923 | (save-match-data | ||
| 2924 | (if (string-match "\n" expr) | ||
| 2925 | (error "Expression must not include a newline")) | ||
| 2926 | (with-current-buffer gud-comint-buffer | ||
| 2927 | (save-excursion | ||
| 2928 | (goto-char (process-mark (get-buffer-process gud-comint-buffer))) | ||
| 2929 | (forward-line 0) | ||
| 2930 | (when (looking-at comint-prompt-regexp) | ||
| 2931 | (set-marker gud-delete-prompt-marker (point)) | ||
| 2932 | (set-marker-insertion-type gud-delete-prompt-marker t)) | ||
| 2933 | (insert (concat expr " = "))))) | ||
| 2934 | expr)) | ||
| 2915 | 2935 | ||
| 2916 | ;; The next eight functions are hacked from gdbsrc.el by | 2936 | ;; The next eight functions are hacked from gdbsrc.el by |
| 2917 | ;; Debby Ayers <ayers@asc.slb.com>, | 2937 | ;; Debby Ayers <ayers@asc.slb.com>, |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5e645535a23..9636f7eaeae 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -292,9 +292,9 @@ The criteria are that the previous line ends in a backslash outside | |||
| 292 | comments and strings, or that the bracket/paren nesting depth is nonzero." | 292 | comments and strings, or that the bracket/paren nesting depth is nonzero." |
| 293 | (or (and (eq ?\\ (char-before (line-end-position 0))) | 293 | (or (and (eq ?\\ (char-before (line-end-position 0))) |
| 294 | (not (syntax-ppss-context (syntax-ppss)))) | 294 | (not (syntax-ppss-context (syntax-ppss)))) |
| 295 | (/= 0 (syntax-ppss-depth | 295 | (< 0 (syntax-ppss-depth |
| 296 | (save-excursion ; syntax-ppss with arg changes point | 296 | (save-excursion ; syntax-ppss with arg changes point |
| 297 | (syntax-ppss (line-beginning-position))))))) | 297 | (syntax-ppss (line-beginning-position))))))) |
| 298 | 298 | ||
| 299 | (defun python-comment-line-p () | 299 | (defun python-comment-line-p () |
| 300 | "Return non-nil iff current line has only a comment." | 300 | "Return non-nil iff current line has only a comment." |
| @@ -719,7 +719,10 @@ expressions." | |||
| 719 | (python-beginning-of-string) | 719 | (python-beginning-of-string) |
| 720 | ;; Skip forward out of nested brackets. | 720 | ;; Skip forward out of nested brackets. |
| 721 | (condition-case () ; beware invalid syntax | 721 | (condition-case () ; beware invalid syntax |
| 722 | (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t) | 722 | (let ((depth (syntax-ppss-depth (syntax-ppss)))) |
| 723 | ;; Beware negative depths. | ||
| 724 | (if (> depth 0) (backward-up-list depth)) | ||
| 725 | t) | ||
| 723 | (error (throw 'foo nil)))))) | 726 | (error (throw 'foo nil)))))) |
| 724 | (back-to-indentation)) | 727 | (back-to-indentation)) |
| 725 | 728 | ||
| @@ -1755,7 +1758,6 @@ lines count as headers. | |||
| 1755 | (if (featurep 'hippie-exp) | 1758 | (if (featurep 'hippie-exp) |
| 1756 | (set (make-local-variable 'hippie-expand-try-functions-list) | 1759 | (set (make-local-variable 'hippie-expand-try-functions-list) |
| 1757 | (cons 'python-try-complete hippie-expand-try-functions-list))) | 1760 | (cons 'python-try-complete hippie-expand-try-functions-list))) |
| 1758 | (unless font-lock-mode (font-lock-mode 1)) | ||
| 1759 | (when python-guess-indent (python-guess-indent)) | 1761 | (when python-guess-indent (python-guess-indent)) |
| 1760 | (set (make-local-variable 'python-command) python-python-command) | 1762 | (set (make-local-variable 'python-command) python-python-command) |
| 1761 | (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode | 1763 | (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode |
diff --git a/lisp/reveal.el b/lisp/reveal.el index 4120f9331b3..84411f98658 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: outlines | 7 | ;; Keywords: outlines |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/simple.el b/lisp/simple.el index 36b2d8b8f21..6b571aaba3f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1709,7 +1709,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.") | |||
| 1709 | ;; but we don't want to ask the question again. | 1709 | ;; but we don't want to ask the question again. |
| 1710 | (setq undo-extra-outer-limit (+ size 50000)) | 1710 | (setq undo-extra-outer-limit (+ size 50000)) |
| 1711 | (if (let (use-dialog-box track-mouse executing-kbd-macro ) | 1711 | (if (let (use-dialog-box track-mouse executing-kbd-macro ) |
| 1712 | (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " | 1712 | (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; discard it? " |
| 1713 | (buffer-name) size))) | 1713 | (buffer-name) size))) |
| 1714 | (progn (setq buffer-undo-list nil) | 1714 | (progn (setq buffer-undo-list nil) |
| 1715 | (setq undo-extra-outer-limit nil) | 1715 | (setq undo-extra-outer-limit nil) |
| @@ -1717,7 +1717,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.") | |||
| 1717 | nil)) | 1717 | nil)) |
| 1718 | (display-warning '(undo discard-info) | 1718 | (display-warning '(undo discard-info) |
| 1719 | (concat | 1719 | (concat |
| 1720 | (format "Buffer %s undo info was %d bytes long.\n" | 1720 | (format "Buffer `%s' undo info was %d bytes long.\n" |
| 1721 | (buffer-name) size) | 1721 | (buffer-name) size) |
| 1722 | "The undo info was discarded because it exceeded \ | 1722 | "The undo info was discarded because it exceeded \ |
| 1723 | `undo-outer-limit'. | 1723 | `undo-outer-limit'. |
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index 9fddc4b1a05..8d9df188875 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, | 3 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, |
| 4 | ;; 2004, 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2004, 2005, 2006 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | ;; Keywords: tools revision-control merge diff3 cvs conflict | 7 | ;; Keywords: tools revision-control merge diff3 cvs conflict |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/startup.el b/lisp/startup.el index c28fc728145..66676c302b9 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1620,6 +1620,15 @@ normal otherwise." | |||
| 1620 | (when init-file-had-error | 1620 | (when init-file-had-error |
| 1621 | (sit-for 2)) | 1621 | (sit-for 2)) |
| 1622 | 1622 | ||
| 1623 | (when (and pure-space-overflow | ||
| 1624 | (not noninteractive)) | ||
| 1625 | (display-warning | ||
| 1626 | 'initialization | ||
| 1627 | "Building Emacs overflowed pure space." | ||
| 1628 | ;; FIXME: Tell the user what kind of problems are possible and how to fix | ||
| 1629 | ;; the overflow. | ||
| 1630 | :warning)) | ||
| 1631 | |||
| 1623 | (when command-line-args-left | 1632 | (when command-line-args-left |
| 1624 | ;; We have command args; process them. | 1633 | ;; We have command args; process them. |
| 1625 | (let ((dir command-line-default-directory) | 1634 | (let ((dir command-line-default-directory) |
diff --git a/lisp/subr.el b/lisp/subr.el index 5e18eaa5992..5c0317d00c3 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -851,19 +851,23 @@ and `event-end' functions." | |||
| 851 | (nth 3 position)) | 851 | (nth 3 position)) |
| 852 | 852 | ||
| 853 | (defsubst posn-string (position) | 853 | (defsubst posn-string (position) |
| 854 | "Return the string object of POSITION, or nil if a buffer position. | 854 | "Return the string object of POSITION. |
| 855 | Value is a cons (STRING . STRING-POS), or nil if not a string. | ||
| 855 | POSITION should be a list of the form returned by the `event-start' | 856 | POSITION should be a list of the form returned by the `event-start' |
| 856 | and `event-end' functions." | 857 | and `event-end' functions." |
| 857 | (nth 4 position)) | 858 | (nth 4 position)) |
| 858 | 859 | ||
| 859 | (defsubst posn-image (position) | 860 | (defsubst posn-image (position) |
| 860 | "Return the image object of POSITION, or nil if a not an image. | 861 | "Return the image object of POSITION. |
| 862 | Value is an list (image ...), or nil if not an image. | ||
| 861 | POSITION should be a list of the form returned by the `event-start' | 863 | POSITION should be a list of the form returned by the `event-start' |
| 862 | and `event-end' functions." | 864 | and `event-end' functions." |
| 863 | (nth 7 position)) | 865 | (nth 7 position)) |
| 864 | 866 | ||
| 865 | (defsubst posn-object (position) | 867 | (defsubst posn-object (position) |
| 866 | "Return the object (image or string) of POSITION. | 868 | "Return the object (image or string) of POSITION. |
| 869 | Value is a list (image ...) for an image object, a cons cell | ||
| 870 | \(STRING . STRING-POS) for a string object, and nil for a buffer position. | ||
| 867 | POSITION should be a list of the form returned by the `event-start' | 871 | POSITION should be a list of the form returned by the `event-start' |
| 868 | and `event-end' functions." | 872 | and `event-end' functions." |
| 869 | (or (posn-image position) (posn-string position))) | 873 | (or (posn-image position) (posn-string position))) |
| @@ -1258,25 +1262,25 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label." | |||
| 1258 | 1262 | ||
| 1259 | ;;; Load history | 1263 | ;;; Load history |
| 1260 | 1264 | ||
| 1261 | ;;; (defvar symbol-file-load-history-loaded nil | 1265 | ;; (defvar symbol-file-load-history-loaded nil |
| 1262 | ;;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'. | 1266 | ;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'. |
| 1263 | ;;; That file records the part of `load-history' for preloaded files, | 1267 | ;; That file records the part of `load-history' for preloaded files, |
| 1264 | ;;; which is cleared out before dumping to make Emacs smaller.") | 1268 | ;; which is cleared out before dumping to make Emacs smaller.") |
| 1265 | 1269 | ||
| 1266 | ;;; (defun load-symbol-file-load-history () | 1270 | ;; (defun load-symbol-file-load-history () |
| 1267 | ;;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done. | 1271 | ;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done. |
| 1268 | ;;; That file records the part of `load-history' for preloaded files, | 1272 | ;; That file records the part of `load-history' for preloaded files, |
| 1269 | ;;; which is cleared out before dumping to make Emacs smaller." | 1273 | ;; which is cleared out before dumping to make Emacs smaller." |
| 1270 | ;;; (unless symbol-file-load-history-loaded | 1274 | ;; (unless symbol-file-load-history-loaded |
| 1271 | ;;; (load (expand-file-name | 1275 | ;; (load (expand-file-name |
| 1272 | ;;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem. | 1276 | ;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem. |
| 1273 | ;;; (if (eq system-type 'ms-dos) | 1277 | ;; (if (eq system-type 'ms-dos) |
| 1274 | ;;; "fns.el" | 1278 | ;; "fns.el" |
| 1275 | ;;; (format "fns-%s.el" emacs-version)) | 1279 | ;; (format "fns-%s.el" emacs-version)) |
| 1276 | ;;; exec-directory) | 1280 | ;; exec-directory) |
| 1277 | ;;; ;; The file name fns-%s.el already has a .el extension. | 1281 | ;; ;; The file name fns-%s.el already has a .el extension. |
| 1278 | ;;; nil nil t) | 1282 | ;; nil nil t) |
| 1279 | ;;; (setq symbol-file-load-history-loaded t))) | 1283 | ;; (setq symbol-file-load-history-loaded t))) |
| 1280 | 1284 | ||
| 1281 | (defun symbol-file (symbol &optional type) | 1285 | (defun symbol-file (symbol &optional type) |
| 1282 | "Return the input source in which SYMBOL was defined. | 1286 | "Return the input source in which SYMBOL was defined. |
| @@ -1923,6 +1927,10 @@ a system-dependent default device name is used." | |||
| 1923 | Otherwise, return nil." | 1927 | Otherwise, return nil." |
| 1924 | (or (stringp object) (null object))) | 1928 | (or (stringp object) (null object))) |
| 1925 | 1929 | ||
| 1930 | (defun booleanp (object) | ||
| 1931 | "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil." | ||
| 1932 | (memq object '(nil t))) | ||
| 1933 | |||
| 1926 | 1934 | ||
| 1927 | ;;;; Support for yanking and text properties. | 1935 | ;;;; Support for yanking and text properties. |
| 1928 | 1936 | ||
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index c5c5bc5ef03..fa8934aec9e 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el | |||
| @@ -1480,7 +1480,7 @@ in `selection-converter-alist', which see." | |||
| 1480 | (re-search-forward | 1480 | (re-search-forward |
| 1481 | (mapconcat 'regexp-quote (split-string search-text) "\\|") | 1481 | (mapconcat 'regexp-quote (split-string search-text) "\\|") |
| 1482 | nil t))))) | 1482 | nil t))))) |
| 1483 | (raise-frame)) | 1483 | (select-frame-set-input-focus (selected-frame))) |
| 1484 | 1484 | ||
| 1485 | (defun mac-ae-text (ae) | 1485 | (defun mac-ae-text (ae) |
| 1486 | (or (cdr (mac-ae-parameter ae nil "TEXT")) | 1486 | (or (cdr (mac-ae-parameter ae nil "TEXT")) |
| @@ -1911,9 +1911,10 @@ Switch to a buffer editing the last file dropped." | |||
| 1911 | (dolist (file-name (nth 2 event)) | 1911 | (dolist (file-name (nth 2 event)) |
| 1912 | (dnd-handle-one-url window 'private | 1912 | (dnd-handle-one-url window 'private |
| 1913 | (concat "file:" file-name)))) | 1913 | (concat "file:" file-name)))) |
| 1914 | (raise-frame)) | 1914 | (select-frame-set-input-focus (selected-frame))) |
| 1915 | 1915 | ||
| 1916 | (global-set-key [drag-n-drop] 'mac-drag-n-drop) | 1916 | (global-set-key [drag-n-drop] 'mac-drag-n-drop) |
| 1917 | (global-set-key [M-drag-n-drop] 'mac-drag-n-drop) | ||
| 1917 | 1918 | ||
| 1918 | ;;;; Non-toolkit Scroll bars | 1919 | ;;;; Non-toolkit Scroll bars |
| 1919 | 1920 | ||
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index ff1c1e48eb0..e4f0a3db545 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -103,6 +103,7 @@ CROSSREF-OPTIONAL lists in `bibtex-entry-field-alist' (which see)." | |||
| 103 | (choice :tag "Init" :value "" | 103 | (choice :tag "Init" :value "" |
| 104 | string | 104 | string |
| 105 | function)))))) | 105 | function)))))) |
| 106 | (put 'bibtex-user-optional-fields 'risky-local-variable t) | ||
| 106 | 107 | ||
| 107 | (defcustom bibtex-entry-format | 108 | (defcustom bibtex-entry-format |
| 108 | '(opts-or-alts required-fields numerical-fields) | 109 | '(opts-or-alts required-fields numerical-fields) |
| @@ -3303,7 +3304,7 @@ Otherwise, use `set-buffer'. DISPLAY is t when called interactively." | |||
| 3303 | (display (message "Key `%s' not found" key))) | 3304 | (display (message "Key `%s' not found" key))) |
| 3304 | found) | 3305 | found) |
| 3305 | 3306 | ||
| 3306 | (let* (case-fold-search | 3307 | (let* ((case-fold-search t) |
| 3307 | (pnt (save-excursion | 3308 | (pnt (save-excursion |
| 3308 | (goto-char (or start (point-min))) | 3309 | (goto-char (or start (point-min))) |
| 3309 | (if (re-search-forward (concat "^[ \t]*\\(" | 3310 | (if (re-search-forward (concat "^[ \t]*\\(" |
| @@ -4330,11 +4331,12 @@ An error is signaled if point is outside key or BibTeX field." | |||
| 4330 | "\n") | 4331 | "\n") |
| 4331 | (goto-char endpos))) | 4332 | (goto-char endpos))) |
| 4332 | 4333 | ||
| 4333 | (defun bibtex-url (&optional pos) | 4334 | (defun bibtex-url (&optional pos no-browse) |
| 4334 | "Browse a URL for the BibTeX entry at point. | 4335 | "Browse a URL for the BibTeX entry at point. |
| 4335 | Optional POS is the location of the BibTeX entry. | 4336 | Optional POS is the location of the BibTeX entry. |
| 4336 | The URL is generated using the schemes defined in `bibtex-generate-url-list' | 4337 | The URL is generated using the schemes defined in `bibtex-generate-url-list' |
| 4337 | \(see there\). Then the URL is passed to `browse-url'." | 4338 | \(see there\). Then the URL is passed to `browse-url' unless NO-BROWSE is nil. |
| 4339 | Return the URL or nil if none can be generated." | ||
| 4338 | (interactive) | 4340 | (interactive) |
| 4339 | (save-excursion | 4341 | (save-excursion |
| 4340 | (if pos (goto-char pos)) | 4342 | (if pos (goto-char pos)) |
| @@ -4369,8 +4371,10 @@ The URL is generated using the schemes defined in `bibtex-generate-url-list' | |||
| 4369 | (error "Match failed: %s" field))) | 4371 | (error "Match failed: %s" field))) |
| 4370 | (if fmt (apply 'format fmt (nreverse obj)) | 4372 | (if fmt (apply 'format fmt (nreverse obj)) |
| 4371 | (apply 'concat (nreverse obj))))) | 4373 | (apply 'concat (nreverse obj))))) |
| 4372 | (browse-url (message "%s" url)))) | 4374 | (if (interactive-p) (message "%s" url)) |
| 4373 | (unless url (message "No URL known."))))) | 4375 | (unless no-browse (browse-url url)))) |
| 4376 | (if (and (not url) (interactive-p)) (message "No URL known.")) | ||
| 4377 | url))) | ||
| 4374 | 4378 | ||
| 4375 | 4379 | ||
| 4376 | ;; Make BibTeX a Feature | 4380 | ;; Make BibTeX a Feature |
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 312c73a380b..9218c565c97 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -48,7 +48,7 @@ A value of nil means that any change in indentation starts a new paragraph." | |||
| 48 | "*Non-nil means put two spaces after a colon when filling." | 48 | "*Non-nil means put two spaces after a colon when filling." |
| 49 | :type 'boolean | 49 | :type 'boolean |
| 50 | :group 'fill) | 50 | :group 'fill) |
| 51 | ;;;###autoload(put 'colon-double-space 'safe-local-variable t) | 51 | ;;;###autoload(put 'colon-double-space 'safe-local-variable 'booleanp) |
| 52 | 52 | ||
| 53 | (defvar fill-paragraph-function nil | 53 | (defvar fill-paragraph-function nil |
| 54 | "Mode-specific function to fill a paragraph, or nil if there is none. | 54 | "Mode-specific function to fill a paragraph, or nil if there is none. |
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index 12359391f73..3c18eda2305 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> | 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ | 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
| 8 | ;; Version: 4.25 | 8 | ;; Version: 4.26 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -79,8 +79,11 @@ | |||
| 79 | ;; excellent reference card made by Philip Rooke. This card can be found | 79 | ;; excellent reference card made by Philip Rooke. This card can be found |
| 80 | ;; in the etc/ directory of Emacs 22. | 80 | ;; in the etc/ directory of Emacs 22. |
| 81 | ;; | 81 | ;; |
| 82 | ;; Changes since version 4.00: | 82 | ;; Changes since version 4.10: |
| 83 | ;; --------------------------- | 83 | ;; --------------------------- |
| 84 | ;; Version 4.26 | ||
| 85 | ;; - Bug fixes. | ||
| 86 | ;; | ||
| 84 | ;; Version 4.25 | 87 | ;; Version 4.25 |
| 85 | ;; - Revision of the font-lock faces section, with better tty support. | 88 | ;; - Revision of the font-lock faces section, with better tty support. |
| 86 | ;; - TODO keywords in Agenda buffer are fontified. | 89 | ;; - TODO keywords in Agenda buffer are fontified. |
| @@ -119,60 +122,6 @@ | |||
| 119 | ;; `org-time-stamp-rounding-minutes'. | 122 | ;; `org-time-stamp-rounding-minutes'. |
| 120 | ;; - Bug fixes (there are *always* more bugs). | 123 | ;; - Bug fixes (there are *always* more bugs). |
| 121 | ;; | 124 | ;; |
| 122 | ;; Version 4.10 | ||
| 123 | ;; - Bug fixes. | ||
| 124 | ;; | ||
| 125 | ;; Version 4.09 | ||
| 126 | ;; - Bug fixes. | ||
| 127 | ;; - Small improvements to font-lock support. | ||
| 128 | ;; - MHE support finalized. | ||
| 129 | ;; | ||
| 130 | ;; Version 4.08 | ||
| 131 | ;; - Bug fixes. | ||
| 132 | ;; - Improved MHE support | ||
| 133 | ;; | ||
| 134 | ;; Version 4.07 | ||
| 135 | ;; - Bug fixes. | ||
| 136 | ;; - Leading stars in headlines can be hidden, so make the outline look | ||
| 137 | ;; cleaner. | ||
| 138 | ;; - Mouse-1 can be used to follow links. | ||
| 139 | ;; | ||
| 140 | ;; Version 4.06 | ||
| 141 | ;; - HTML exporter treats targeted internal links. | ||
| 142 | ;; - Bug fixes. | ||
| 143 | ;; | ||
| 144 | ;; Version 4.05 | ||
| 145 | ;; - Changes to internal link system (thanks to David Wainberg for ideas). | ||
| 146 | ;; - in-file links: [[Search String]] instead of <file:::Search String> | ||
| 147 | ;; - automatic links to "radio targets". | ||
| 148 | ;; - CamelCase not longer active by default, configure org-activate-camels | ||
| 149 | ;; if you want to turn it back on. | ||
| 150 | ;; - After following a link, `C-c &' jumps back to it. | ||
| 151 | ;; - MH-E link support (thanks to Thomas Baumann). | ||
| 152 | ;; - Special table lines are no longer exported. | ||
| 153 | ;; - Bug fixes and minor improvements. | ||
| 154 | ;; | ||
| 155 | ;; Version 4.04 | ||
| 156 | ;; - Cleanup tags display in agenda. | ||
| 157 | ;; - Bug fixes. | ||
| 158 | ;; | ||
| 159 | ;; Version 4.03 | ||
| 160 | ;; - Table alignment fixed for use with wide characters. | ||
| 161 | ;; - `C-c -' leaves cursor in current table line. | ||
| 162 | ;; - The current TAG can be incorporated into the agenda prefix. | ||
| 163 | ;; See option `org-agenda-prefix-format' for details. | ||
| 164 | ;; | ||
| 165 | ;; Version 4.02 | ||
| 166 | ;; - Minor bug fixes and improvements around tag searches. | ||
| 167 | ;; - XEmacs compatibility fixes. | ||
| 168 | ;; | ||
| 169 | ;; Version 4.01 | ||
| 170 | ;; - Tags can also be set remotely from agenda buffer. | ||
| 171 | ;; - Boolean logic for tag searches. | ||
| 172 | ;; - Additional agenda commands can be configured through the variable | ||
| 173 | ;; `org-agenda-custom-commands'. | ||
| 174 | ;; - Minor bug fixes. | ||
| 175 | ;; | ||
| 176 | ;;; Code: | 125 | ;;; Code: |
| 177 | 126 | ||
| 178 | (eval-when-compile | 127 | (eval-when-compile |
| @@ -188,7 +137,7 @@ | |||
| 188 | 137 | ||
| 189 | ;;; Customization variables | 138 | ;;; Customization variables |
| 190 | 139 | ||
| 191 | (defvar org-version "4.25" | 140 | (defvar org-version "4.26" |
| 192 | "The version number of the file org.el.") | 141 | "The version number of the file org.el.") |
| 193 | (defun org-version () | 142 | (defun org-version () |
| 194 | (interactive) | 143 | (interactive) |
| @@ -198,7 +147,7 @@ | |||
| 198 | ;; of outline.el. | 147 | ;; of outline.el. |
| 199 | (defconst org-noutline-p (featurep 'noutline) | 148 | (defconst org-noutline-p (featurep 'noutline) |
| 200 | "Are we using the new outline mode?") | 149 | "Are we using the new outline mode?") |
| 201 | (defconst org-xemacs-p (featurep 'xemacs)) ;; FIXME: used by external code? | 150 | (defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself |
| 202 | (defconst org-format-transports-properties-p | 151 | (defconst org-format-transports-properties-p |
| 203 | (let ((x "a")) | 152 | (let ((x "a")) |
| 204 | (add-text-properties 0 1 '(test t) x) | 153 | (add-text-properties 0 1 '(test t) x) |
| @@ -2383,7 +2332,10 @@ This face is only used if `org-fontify-done-headline' is set." | |||
| 2383 | (defvar orgtbl-mode) ; defined later in this file | 2332 | (defvar orgtbl-mode) ; defined later in this file |
| 2384 | ;;; Define the mode | 2333 | ;;; Define the mode |
| 2385 | 2334 | ||
| 2386 | (defvar org-mode-map (copy-keymap outline-mode-map) | 2335 | (defvar org-mode-map |
| 2336 | (if (and (not (keymapp outline-mode-map)) (featurep 'allout)) | ||
| 2337 | (error "Conflict with outdated version of allout.el. Load org.el before allout.el, or ugrade to newer allout, for example by switching to Emacs 22.") | ||
| 2338 | (copy-keymap outline-mode-map)) | ||
| 2387 | "Keymap for Org-mode.") | 2339 | "Keymap for Org-mode.") |
| 2388 | 2340 | ||
| 2389 | (defvar org-struct-menu) ; defined later in this file | 2341 | (defvar org-struct-menu) ; defined later in this file |
| @@ -7448,9 +7400,8 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file." | |||
| 7448 | (org-add-props cmd nil | 7400 | (org-add-props cmd nil |
| 7449 | 'face 'org-warning)))) | 7401 | 'face 'org-warning)))) |
| 7450 | (progn | 7402 | (progn |
| 7451 | (message "Executing %s..." cmd) | 7403 | (message "Executing %s" cmd) |
| 7452 | (shell-command cmd) | 7404 | (shell-command cmd)) |
| 7453 | (message "Executing %s...done" cmd)) | ||
| 7454 | (error "Abort")))) | 7405 | (error "Abort")))) |
| 7455 | 7406 | ||
| 7456 | (t | 7407 | (t |
| @@ -7904,8 +7855,7 @@ If the file does not exist, an error is thrown." | |||
| 7904 | (setq cmd 'emacs)))) | 7855 | (setq cmd 'emacs)))) |
| 7905 | (cond | 7856 | (cond |
| 7906 | ((and (stringp cmd) (not (string-match "^\\s-*$" cmd))) | 7857 | ((and (stringp cmd) (not (string-match "^\\s-*$" cmd))) |
| 7907 | ; (setq cmd (format cmd (concat "\"" file "\""))) | 7858 | ;; Normalize use of quote, this can vary. |
| 7908 | ;; FIXME: normalize use of quotes | ||
| 7909 | (if (string-match "['\"]%s['\"]" cmd) | 7859 | (if (string-match "['\"]%s['\"]" cmd) |
| 7910 | (setq cmd (replace-match "'%s'" t t cmd))) | 7860 | (setq cmd (replace-match "'%s'" t t cmd))) |
| 7911 | (setq cmd (format cmd file)) | 7861 | (setq cmd (format cmd file)) |
| @@ -8958,10 +8908,10 @@ Optional argument NEW may specify text to replace the current field content." | |||
| 8958 | e (not (= (match-beginning 2) (match-end 2)))) | 8908 | e (not (= (match-beginning 2) (match-end 2)))) |
| 8959 | (setq f (format (if num " %%%ds %s" " %%-%ds %s") | 8909 | (setq f (format (if num " %%%ds %s" " %%-%ds %s") |
| 8960 | l (if e "|" (setq org-table-may-need-update t) "")) | 8910 | l (if e "|" (setq org-table-may-need-update t) "")) |
| 8961 | n (format f s t t)) | 8911 | n (format f s)) |
| 8962 | (if new | 8912 | (if new |
| 8963 | (if (<= (length new) l) | 8913 | (if (<= (length new) l) ;; FIXME: length -> str-width? |
| 8964 | (setq n (format f new t t)) ;; FIXME: why t t????? | 8914 | (setq n (format f new t t)) ;; FIXME: t t? |
| 8965 | (setq n (concat new "|") org-table-may-need-update t))) | 8915 | (setq n (concat new "|") org-table-may-need-update t))) |
| 8966 | (or (equal n o) | 8916 | (or (equal n o) |
| 8967 | (let (org-table-may-need-update) | 8917 | (let (org-table-may-need-update) |
| @@ -12277,16 +12227,6 @@ stacked delimiters is N. Escaping delimiters is not possible." | |||
| 12277 | (setq string (replace-match (match-string 1 string) t t string)))) | 12227 | (setq string (replace-match (match-string 1 string) t t string)))) |
| 12278 | string) | 12228 | string) |
| 12279 | 12229 | ||
| 12280 | ;(defun org-export-html-convert-emphasize (string) | ||
| 12281 | ; (let (c (s 0)) | ||
| 12282 | ; (while (string-match "\\(\\W\\|^\\)\\([*/_]\\)\\(\\w+\\)\\2\\(\\W\\|$\\)" string s) | ||
| 12283 | ; (setq c (cdr (assoc (match-string 2 string) | ||
| 12284 | ; '(("*" . "b") ("/" . "i") ("_" . "u")))) | ||
| 12285 | ; s (+ (match-end 0) 3) | ||
| 12286 | ; string (replace-match | ||
| 12287 | ; (concat "\\1<" c ">\\3</" c ">\\4") t nil string))) | ||
| 12288 | ; string)) | ||
| 12289 | |||
| 12290 | (defun org-export-html-convert-emphasize (string) | 12230 | (defun org-export-html-convert-emphasize (string) |
| 12291 | (while (string-match org-italic-re string) | 12231 | (while (string-match org-italic-re string) |
| 12292 | (setq string (replace-match "\\1<i>\\3</i>\\4" t nil string))) | 12232 | (setq string (replace-match "\\1<i>\\3</i>\\4" t nil string))) |
| @@ -12496,7 +12436,7 @@ The XOXO buffer is named *xoxo-<source buffer name>*" | |||
| 12496 | 12436 | ||
| 12497 | ;; Finish the buffer off and clean it up. | 12437 | ;; Finish the buffer off and clean it up. |
| 12498 | (switch-to-buffer-other-window out) | 12438 | (switch-to-buffer-other-window out) |
| 12499 | (indent-region (point-min) (point-max)) | 12439 | (indent-region (point-min) (point-max) nil) |
| 12500 | (save-buffer) | 12440 | (save-buffer) |
| 12501 | (goto-char (point-min)) | 12441 | (goto-char (point-min)) |
| 12502 | ))) | 12442 | ))) |
| @@ -12719,6 +12659,8 @@ a time), or the day by one (if it does not contain a time)." | |||
| 12719 | (define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright) | 12659 | (define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright) |
| 12720 | 12660 | ||
| 12721 | ;; All the other keys | 12661 | ;; All the other keys |
| 12662 | |||
| 12663 | (define-key org-mode-map "\C-c\C-a" 'show-all) ; in case allout messed up. | ||
| 12722 | (define-key org-mode-map "\C-c$" 'org-archive-subtree) | 12664 | (define-key org-mode-map "\C-c$" 'org-archive-subtree) |
| 12723 | (define-key org-mode-map "\C-c\C-j" 'org-goto) | 12665 | (define-key org-mode-map "\C-c\C-j" 'org-goto) |
| 12724 | (define-key org-mode-map "\C-c\C-t" 'org-todo) | 12666 | (define-key org-mode-map "\C-c\C-t" 'org-todo) |
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 6693be4e0c9..aac4cee4dd7 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -81,7 +81,7 @@ to paragraphs. The fill functions insert and delete only soft newlines." | |||
| 81 | (set-hard-newline-properties (point) (1+ (point))))))))))) | 81 | (set-hard-newline-properties (point) (1+ (point))))))))))) |
| 82 | 82 | ||
| 83 | (defcustom paragraph-start "\f\\|[ \t]*$" "\ | 83 | (defcustom paragraph-start "\f\\|[ \t]*$" "\ |
| 84 | *Regexp for beginning of a line that starts OR separates paragraphs. | 84 | Regexp for beginning of a line that starts OR separates paragraphs. |
| 85 | This regexp should match lines that separate paragraphs | 85 | This regexp should match lines that separate paragraphs |
| 86 | and should also match lines that start a paragraph | 86 | and should also match lines that start a paragraph |
| 87 | \(and are part of that paragraph). | 87 | \(and are part of that paragraph). |
| @@ -107,7 +107,7 @@ hard newline are considered to match." | |||
| 107 | ;; start a new paragraph). | 107 | ;; start a new paragraph). |
| 108 | 108 | ||
| 109 | (defcustom paragraph-separate "[ \t\f]*$" | 109 | (defcustom paragraph-separate "[ \t\f]*$" |
| 110 | "*Regexp for beginning of a line that separates paragraphs. | 110 | "Regexp for beginning of a line that separates paragraphs. |
| 111 | If you change this, you may have to change `paragraph-start' also. | 111 | If you change this, you may have to change `paragraph-start' also. |
| 112 | 112 | ||
| 113 | This is matched against the text at the left margin, which is not necessarily | 113 | This is matched against the text at the left margin, which is not necessarily |
| @@ -119,7 +119,7 @@ text indented by a margin setting." | |||
| 119 | ;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp) | 119 | ;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp) |
| 120 | 120 | ||
| 121 | (defcustom sentence-end-double-space t | 121 | (defcustom sentence-end-double-space t |
| 122 | "*Non-nil means a single space does not end a sentence. | 122 | "Non-nil means a single space does not end a sentence. |
| 123 | This is relevant for filling. See also `sentence-end-without-period' | 123 | This is relevant for filling. See also `sentence-end-without-period' |
| 124 | and `colon-double-space'. | 124 | and `colon-double-space'. |
| 125 | 125 | ||
| @@ -128,10 +128,10 @@ regexp describing the end of a sentence, when the value of the variable | |||
| 128 | `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." | 128 | `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." |
| 129 | :type 'boolean | 129 | :type 'boolean |
| 130 | :group 'fill) | 130 | :group 'fill) |
| 131 | ;;;###autoload(put 'sentence-end-double-space 'safe-local-variable t) | 131 | ;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'booleanp) |
| 132 | 132 | ||
| 133 | (defcustom sentence-end-without-period nil | 133 | (defcustom sentence-end-without-period nil |
| 134 | "*Non-nil means a sentence will end without a period. | 134 | "Non-nil means a sentence will end without a period. |
| 135 | For example, a sentence in Thai text ends with double space but | 135 | For example, a sentence in Thai text ends with double space but |
| 136 | without a period. | 136 | without a period. |
| 137 | 137 | ||
| @@ -140,21 +140,21 @@ regexp describing the end of a sentence, when the value of the variable | |||
| 140 | `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." | 140 | `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." |
| 141 | :type 'boolean | 141 | :type 'boolean |
| 142 | :group 'fill) | 142 | :group 'fill) |
| 143 | ;;;###autoload(put 'sentence-end-without-period 'safe-local-variable t) | 143 | ;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'booleanp) |
| 144 | 144 | ||
| 145 | (defcustom sentence-end-without-space | 145 | (defcustom sentence-end-without-space |
| 146 | "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B" | 146 | "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B" |
| 147 | "*String of characters that end sentence without following spaces. | 147 | "String of characters that end sentence without following spaces. |
| 148 | 148 | ||
| 149 | This value is used by the function `sentence-end' to construct the | 149 | This value is used by the function `sentence-end' to construct the |
| 150 | regexp describing the end of a sentence, when the value of the variable | 150 | regexp describing the end of a sentence, when the value of the variable |
| 151 | `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." | 151 | `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." |
| 152 | :group 'paragraphs | 152 | :group 'paragraphs |
| 153 | :type 'string) | 153 | :type 'string) |
| 154 | ;;;###autoload(put 'sentence-end-without-space 'safe-local-variable t) | 154 | ;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'stringp) |
| 155 | 155 | ||
| 156 | (defcustom sentence-end nil | 156 | (defcustom sentence-end nil |
| 157 | "*Regexp describing the end of a sentence. | 157 | "Regexp describing the end of a sentence. |
| 158 | The value includes the whitespace following the sentence. | 158 | The value includes the whitespace following the sentence. |
| 159 | All paragraph boundaries also end sentences, regardless. | 159 | All paragraph boundaries also end sentences, regardless. |
| 160 | 160 | ||
| @@ -166,7 +166,7 @@ to obtain the value of this variable." | |||
| 166 | ;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p) | 166 | ;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p) |
| 167 | 167 | ||
| 168 | (defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*" | 168 | (defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*" |
| 169 | "*Regexp matching the basic end of a sentence, not including following space." | 169 | "Regexp matching the basic end of a sentence, not including following space." |
| 170 | :group 'paragraphs | 170 | :group 'paragraphs |
| 171 | :type 'string | 171 | :type 'string |
| 172 | :version "22.1") | 172 | :version "22.1") |
| @@ -195,17 +195,17 @@ in between. See Info node `(elisp)Standard Regexps'." | |||
| 195 | "[ \t\n]*"))) | 195 | "[ \t\n]*"))) |
| 196 | 196 | ||
| 197 | (defcustom page-delimiter "^\014" | 197 | (defcustom page-delimiter "^\014" |
| 198 | "*Regexp describing line-beginnings that separate pages." | 198 | "Regexp describing line-beginnings that separate pages." |
| 199 | :group 'paragraphs | 199 | :group 'paragraphs |
| 200 | :type 'regexp) | 200 | :type 'regexp) |
| 201 | ;;;###autoload(put 'page-delimiter 'safe-local-variable t) | 201 | ;;;###autoload(put 'page-delimiter 'safe-local-variable 'stringp) |
| 202 | 202 | ||
| 203 | (defcustom paragraph-ignore-fill-prefix nil | 203 | (defcustom paragraph-ignore-fill-prefix nil |
| 204 | "*Non-nil means the paragraph commands are not affected by `fill-prefix'. | 204 | "Non-nil means the paragraph commands are not affected by `fill-prefix'. |
| 205 | This is desirable in modes where blank lines are the paragraph delimiters." | 205 | This is desirable in modes where blank lines are the paragraph delimiters." |
| 206 | :group 'paragraphs | 206 | :group 'paragraphs |
| 207 | :type 'boolean) | 207 | :type 'boolean) |
| 208 | ;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable t) | 208 | ;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'booleanp) |
| 209 | 209 | ||
| 210 | (defun forward-paragraph (&optional arg) | 210 | (defun forward-paragraph (&optional arg) |
| 211 | "Move forward to end of paragraph. | 211 | "Move forward to end of paragraph. |
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 07b5d1ca178..f4334fbbd70 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el | |||
| @@ -948,7 +948,7 @@ Instead of nil or t, this may also be a string of type letters indicating | |||
| 948 | the label types for which it should be true." | 948 | the label types for which it should be true." |
| 949 | :group 'reftex-referencing-labels | 949 | :group 'reftex-referencing-labels |
| 950 | :type `(choice :tag "\\vref is default macro" ,@reftex-tmp)) | 950 | :type `(choice :tag "\\vref is default macro" ,@reftex-tmp)) |
| 951 | ;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable t) | 951 | ;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) |
| 952 | 952 | ||
| 953 | (defcustom reftex-fref-is-default nil | 953 | (defcustom reftex-fref-is-default nil |
| 954 | "*Non-nil means, the fancyref macro \\fref is used as default. | 954 | "*Non-nil means, the fancyref macro \\fref is used as default. |
| @@ -959,7 +959,7 @@ Instead of nil or t, this may also be a string of type letters indicating | |||
| 959 | the label types for which it should be true." | 959 | the label types for which it should be true." |
| 960 | :group 'reftex-referencing-labels | 960 | :group 'reftex-referencing-labels |
| 961 | :type `(choice :tag "\\fref is default macro" ,@reftex-tmp)) | 961 | :type `(choice :tag "\\fref is default macro" ,@reftex-tmp)) |
| 962 | ;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable t) | 962 | ;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) |
| 963 | 963 | ||
| 964 | (defcustom reftex-level-indent 2 | 964 | (defcustom reftex-level-indent 2 |
| 965 | "*Number of spaces to be used for indentation per section level." | 965 | "*Number of spaces to be used for indentation per section level." |
| @@ -975,7 +975,7 @@ immediately offer the correct label menu - otherwise it will prompt you for | |||
| 975 | a label type. If you set this variable to nil, RefTeX will always prompt." | 975 | a label type. If you set this variable to nil, RefTeX will always prompt." |
| 976 | :group 'reftex-referencing-labels | 976 | :group 'reftex-referencing-labels |
| 977 | :type 'boolean) | 977 | :type 'boolean) |
| 978 | ;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable t) | 978 | ;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable (lambda (x) (memq x '(nil t)))) |
| 979 | 979 | ||
| 980 | (defcustom reftex-format-ref-function nil | 980 | (defcustom reftex-format-ref-function nil |
| 981 | "Function which produces the string to insert as a reference. | 981 | "Function which produces the string to insert as a reference. |
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 2f6d860bd21..4a14a0197e8 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el | |||
| @@ -164,7 +164,7 @@ Do not change `time-stamp-line-limit', `time-stamp-start', | |||
| 164 | incompatible with other people's files! If you must change them for some | 164 | incompatible with other people's files! If you must change them for some |
| 165 | application, do so in the local variables section of the time-stamped file | 165 | application, do so in the local variables section of the time-stamped file |
| 166 | itself.") | 166 | itself.") |
| 167 | ;;;###autoload(put 'time-stamp-start 'safe-local-variable t) | 167 | ;;;###autoload(put 'time-stamp-start 'safe-local-variable 'stringp) |
| 168 | 168 | ||
| 169 | (defvar time-stamp-end "\\\\?[\">]" ;Do not change! | 169 | (defvar time-stamp-end "\\\\?[\">]" ;Do not change! |
| 170 | "Regexp marking the text after the time stamp. | 170 | "Regexp marking the text after the time stamp. |
| @@ -184,7 +184,7 @@ Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern', | |||
| 184 | or `time-stamp-inserts-lines' for yourself or you will be incompatible | 184 | or `time-stamp-inserts-lines' for yourself or you will be incompatible |
| 185 | with other people's files! If you must change them for some application, | 185 | with other people's files! If you must change them for some application, |
| 186 | do so in the local variables section of the time-stamped file itself.") | 186 | do so in the local variables section of the time-stamped file itself.") |
| 187 | ;;;###autoload(put 'time-stamp-end 'safe-local-variable t) | 187 | ;;;###autoload(put 'time-stamp-end 'safe-local-variable 'stringp) |
| 188 | 188 | ||
| 189 | 189 | ||
| 190 | (defvar time-stamp-inserts-lines nil ;Do not change! | 190 | (defvar time-stamp-inserts-lines nil ;Do not change! |
| @@ -201,7 +201,7 @@ Do not change `time-stamp-end' or `time-stamp-inserts-lines' for | |||
| 201 | yourself or you will be incompatible with other people's files! | 201 | yourself or you will be incompatible with other people's files! |
| 202 | If you must change them for some application, do so in the local | 202 | If you must change them for some application, do so in the local |
| 203 | variables section of the time-stamped file itself.") | 203 | variables section of the time-stamped file itself.") |
| 204 | ;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable t) | 204 | ;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable 'symbolp) |
| 205 | 205 | ||
| 206 | 206 | ||
| 207 | (defvar time-stamp-count 1 ;Do not change! | 207 | (defvar time-stamp-count 1 ;Do not change! |
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el index 0a1d706a694..37d60441648 100644 --- a/lisp/tool-bar.el +++ b/lisp/tool-bar.el | |||
| @@ -267,14 +267,20 @@ holds a keymap." | |||
| 267 | ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose") | 267 | ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose") |
| 268 | 268 | ||
| 269 | (tool-bar-add-item-from-menu 'print-buffer "print") | 269 | (tool-bar-add-item-from-menu 'print-buffer "print") |
| 270 | (tool-bar-add-item "preferences" 'customize 'customize | 270 | |
| 271 | :help "Edit preferences (customize)") | 271 | ;; tool-bar-add-item-from-menu itself operates on |
| 272 | 272 | ;; (default-value 'tool-bar-map), but when we don't use that function, | |
| 273 | (tool-bar-add-item "help" (lambda () | 273 | ;; we must explicitly operate on the default value. |
| 274 | (interactive) | 274 | |
| 275 | (popup-menu menu-bar-help-menu)) | 275 | (let ((tool-bar-map (default-value 'tool-bar-map))) |
| 276 | 'help | 276 | (tool-bar-add-item "preferences" 'customize 'customize |
| 277 | :help "Pop up the Help menu") | 277 | :help "Edit preferences (customize)") |
| 278 | |||
| 279 | (tool-bar-add-item "help" (lambda () | ||
| 280 | (interactive) | ||
| 281 | (popup-menu menu-bar-help-menu)) | ||
| 282 | 'help | ||
| 283 | :help "Pop up the Help menu")) | ||
| 278 | ) | 284 | ) |
| 279 | 285 | ||
| 280 | (provide 'tool-bar) | 286 | (provide 'tool-bar) |
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 7d9e289e8e5..92bdf480e06 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * url-gw.el (url-open-stream): Don't hide errors. | ||
| 4 | (url-gateway-nslookup-host, url-open-telnet): Use with-current-buffer. | ||
| 5 | |||
| 6 | * url-handlers.el (url-insert): New function. | ||
| 7 | (url-insert-file-contents): Use it. | ||
| 8 | |||
| 1 | 2006-03-29 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2006-03-29 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * url-handlers.el (url-handler-directory-file-name): New handler. | 11 | * url-handlers.el (url-handler-directory-file-name): New handler. |
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el index 0cd2e6f9a50..878259927eb 100644 --- a/lisp/url/url-gw.el +++ b/lisp/url/url-gw.el | |||
| @@ -118,8 +118,7 @@ linked Emacs under SunOS 4.x" | |||
| 118 | url-gateway-nslookup-program host)) | 118 | url-gateway-nslookup-program host)) |
| 119 | (res host)) | 119 | (res host)) |
| 120 | (set-process-query-on-exit-flag proc nil) | 120 | (set-process-query-on-exit-flag proc nil) |
| 121 | (save-excursion | 121 | (with-current-buffer (process-buffer proc) |
| 122 | (set-buffer (process-buffer proc)) | ||
| 123 | (while (memq (process-status proc) '(run open)) | 122 | (while (memq (process-status proc) '(run open)) |
| 124 | (accept-process-output proc)) | 123 | (accept-process-output proc)) |
| 125 | (goto-char (point-min)) | 124 | (goto-char (point-min)) |
| @@ -168,8 +167,7 @@ linked Emacs under SunOS 4.x" | |||
| 168 | (defun url-open-telnet (name buffer host service) | 167 | (defun url-open-telnet (name buffer host service) |
| 169 | (if (not (stringp service)) | 168 | (if (not (stringp service)) |
| 170 | (setq service (int-to-string service))) | 169 | (setq service (int-to-string service))) |
| 171 | (save-excursion | 170 | (with-current-buffer (get-buffer-create buffer) |
| 172 | (set-buffer (get-buffer-create buffer)) | ||
| 173 | (erase-buffer) | 171 | (erase-buffer) |
| 174 | (let ((proc (start-process name buffer "telnet" "-8")) | 172 | (let ((proc (start-process name buffer "telnet" "-8")) |
| 175 | (case-fold-search t)) | 173 | (case-fold-search t)) |
| @@ -261,11 +259,15 @@ Will not make a connection if `url-gateway-unplugged' is non-nil." | |||
| 261 | (otherwise | 259 | (otherwise |
| 262 | (error "Bad setting of url-gateway-method: %s" | 260 | (error "Bad setting of url-gateway-method: %s" |
| 263 | url-gateway-method))))) | 261 | url-gateway-method))))) |
| 264 | (error | 262 | ;; Ignoring errors here seems wrong. E.g. it'll throw away the |
| 265 | (setq conn nil))) | 263 | ;; error signalled two lines above. It was also found inconvenient |
| 264 | ;; during debugging. | ||
| 265 | ;; (error | ||
| 266 | ;; (setq conn nil)) | ||
| 267 | ) | ||
| 266 | conn))) | 268 | conn))) |
| 267 | 269 | ||
| 268 | (provide 'url-gw) | 270 | (provide 'url-gw) |
| 269 | 271 | ||
| 270 | ;;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838 | 272 | ;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838 |
| 271 | ;;; url-gw.el ends here | 273 | ;;; url-gw.el ends here |
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index 00fc415659e..6c6d85a1e03 100644 --- a/lisp/url/url-handlers.el +++ b/lisp/url/url-handlers.el | |||
| @@ -216,33 +216,47 @@ accessible." | |||
| 216 | (url-copy-file url filename) | 216 | (url-copy-file url filename) |
| 217 | filename)) | 217 | filename)) |
| 218 | 218 | ||
| 219 | (defun url-insert (buffer &optional beg end) | ||
| 220 | "Insert the body of a URL object. | ||
| 221 | BUFFER should be a complete URL buffer as returned by `url-retrieve'. | ||
| 222 | If the headers specify a coding-system, it is applied to the body before it is inserted. | ||
| 223 | Returns a list of the form (SIZE CHARSET), where SIZE is the size in bytes | ||
| 224 | of the inserted text and CHARSET is the charset that was specified in the header, | ||
| 225 | or nil if none was found. | ||
| 226 | BEG and END can be used to only insert a subpart of the body. | ||
| 227 | They count bytes from the beginning of the body." | ||
| 228 | (let* ((handle (with-current-buffer buffer (mm-dissect-buffer t))) | ||
| 229 | (data (with-current-buffer (mm-handle-buffer handle) | ||
| 230 | (if beg | ||
| 231 | (buffer-substring (+ (point-min) beg) | ||
| 232 | (if end (+ (point-min) end) (point-max))) | ||
| 233 | (buffer-string)))) | ||
| 234 | (charset (mail-content-type-get (mm-handle-type handle) | ||
| 235 | 'charset))) | ||
| 236 | (mm-destroy-parts handle) | ||
| 237 | (if charset | ||
| 238 | (insert (mm-decode-string data (mm-charset-to-coding-system charset))) | ||
| 239 | (insert data)) | ||
| 240 | (list (length data) charset))) | ||
| 241 | |||
| 219 | ;;;###autoload | 242 | ;;;###autoload |
| 220 | (defun url-insert-file-contents (url &optional visit beg end replace) | 243 | (defun url-insert-file-contents (url &optional visit beg end replace) |
| 221 | (let ((buffer (url-retrieve-synchronously url)) | 244 | (let ((buffer (url-retrieve-synchronously url))) |
| 222 | (handle nil) | ||
| 223 | (charset nil) | ||
| 224 | (data nil)) | ||
| 225 | (if (not buffer) | 245 | (if (not buffer) |
| 226 | (error "Opening input file: No such file or directory, %s" url)) | 246 | (error "Opening input file: No such file or directory, %s" url)) |
| 227 | (if visit (setq buffer-file-name url)) | 247 | (if visit (setq buffer-file-name url)) |
| 228 | (with-current-buffer buffer | ||
| 229 | (setq handle (mm-dissect-buffer t)) | ||
| 230 | (set-buffer (mm-handle-buffer handle)) | ||
| 231 | (setq data (if beg (buffer-substring beg end) | ||
| 232 | (buffer-string)))) | ||
| 233 | (kill-buffer buffer) | ||
| 234 | (mm-destroy-parts handle) | ||
| 235 | (if replace (delete-region (point-min) (point-max))) | ||
| 236 | (save-excursion | 248 | (save-excursion |
| 237 | (setq charset (mail-content-type-get (mm-handle-type handle) | 249 | (let* ((start (point)) |
| 238 | 'charset)) | 250 | (size-and-charset (url-insert buffer beg end))) |
| 239 | (let ((start (point))) | 251 | (kill-buffer buffer) |
| 240 | (if charset | 252 | (when replace |
| 241 | (insert (mm-decode-string data (mm-charset-to-coding-system charset))) | 253 | (delete-region (point-min) start) |
| 242 | (progn | 254 | (delete-region (point) (point-max))) |
| 243 | (insert data) | 255 | (unless (cadr size-and-charset) |
| 244 | (decode-coding-inserted-region start (point) url visit beg end replace))))) | 256 | ;; If the headers don't specify any particular charset, use the |
| 245 | (list url (length data)))) | 257 | ;; usual heuristic/rules that we apply to files. |
| 258 | (decode-coding-inserted-region start (point) url visit beg end replace)) | ||
| 259 | (list url (car size-and-charset)))))) | ||
| 246 | 260 | ||
| 247 | (defun url-file-name-completion (url directory) | 261 | (defun url-file-name-completion (url directory) |
| 248 | (error "Unimplemented")) | 262 | (error "Unimplemented")) |